Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/cli/pilotdeck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,12 @@ async function main(argv = process.argv.slice(2)): Promise<void> {
let reloadChain = Promise.resolve();

configStore.subscribe((event) => {
if (event.changedPaths.some((p) => p.startsWith("telemetry."))) {
if (event.changedPaths.some((p) => p.startsWith("telemetry.") || p === "telemetry")) {
telemetry.setEnabled(event.nextSnapshot.config.telemetry?.enabled ?? false);
}

const aoChanged = event.changedPaths.some((p) => p.startsWith("alwaysOn."));
const cronChanged = event.changedPaths.some((p) => p.startsWith("cron."));
const aoChanged = event.changedPaths.some((p) => p.startsWith("alwaysOn.") || p === "alwaysOn");
const cronChanged = event.changedPaths.some((p) => p.startsWith("cron.") || p === "cron");
const proxyChanged = event.changedPaths.some((p) => p.startsWith("proxy.") || p === "proxy");
const adapterChanged = event.changedPaths.some((p) => p.startsWith("adapters."));

Expand Down
2 changes: 1 addition & 1 deletion src/context/memory/edgeclaw-memory-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
},
"scripts": {
"build": "rm -rf lib && tsc -p tsconfig.json",
"build": "node -e \"require('fs').rmSync('lib',{recursive:true,force:true})\" && tsc -p tsconfig.json",
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"devDependencies": {
Expand Down
3 changes: 2 additions & 1 deletion src/mcp/config/loadMcpServerConfig.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { existsSync, readFileSync } from "node:fs";
import { homedir } from "node:os";
import { resolve } from "node:path";

export const MCP_CONFIG_FILE_NAME = "mcp.json";
Expand Down Expand Up @@ -82,7 +83,7 @@ function expandConfig(value: unknown): unknown {
function expandString(value: string): string {
return value
.replace(/\$\{env:([^}]+)\}/g, (_match, name: string) => process.env[name] ?? "")
.replace(/\$\{userHome\}/g, process.env.HOME ?? "");
.replace(/\$\{userHome\}/g, process.env.HOME ?? process.env.USERPROFILE ?? homedir());
}

function isRecord(value: unknown): value is Record<string, unknown> {
Expand Down
4 changes: 3 additions & 1 deletion src/model/streaming/streamModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ export async function* streamModel(
const body = buildModelRequest(currentRequest, config);
if (process.env.PILOTDECK_DUMP_REQUEST === "1") {
const fs = await import("node:fs");
const dumpPath = `/tmp/pilotdeck_request_${Date.now()}.json`;
const os = await import("node:os");
const path = await import("node:path");
const dumpPath = path.join(os.tmpdir(), `pilotdeck_request_${Date.now()}.json`);
fs.writeFileSync(dumpPath, JSON.stringify(body, null, 2));
console.log(`[model-debug] Request dumped to ${dumpPath} (model=${currentRequest.model})`);
}
Expand Down
9 changes: 7 additions & 2 deletions src/pilot/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function findStoredProjectId(projectRoot: string, pilotHome: string): string | n
if (!existsSync(projectsDir)) {
return null;
}
const target = resolve(projectRoot);
const target = normalizeProjectPathForMarkerComparison(projectRoot);
try {
for (const entry of readdirSync(projectsDir, { withFileTypes: true })) {
if (!entry.isDirectory()) {
Expand All @@ -133,7 +133,7 @@ function findStoredProjectId(projectRoot: string, pilotHome: string): string | n
} catch {
continue;
}
if (!marker || resolve(marker) !== target) {
if (!marker || normalizeProjectPathForMarkerComparison(marker) !== target) {
continue;
}
try {
Expand All @@ -149,3 +149,8 @@ function findStoredProjectId(projectRoot: string, pilotHome: string): string | n
}
return null;
}

function normalizeProjectPathForMarkerComparison(projectRoot: string): string {
const resolved = resolve(projectRoot);
return process.platform === "win32" ? resolved.toLowerCase() : resolved;
}
8 changes: 2 additions & 6 deletions src/session/storage/SessionList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@ import { join, resolve } from "node:path";
import { getPilotProjectChatDir } from "../../pilot/index.js";
import { readSessionLite, type SessionLiteFile } from "./SessionLiteReader.js";

const ALWAYS_ON_AUXILIARY_PREFIXES = [
"always-on-discovery:",
"always-on-workspace:",
"always-on-report:",
];
const ALWAYS_ON_AUXILIARY_PATTERN = /^always-on-(discovery|workspace|report)[:\-]/;

function isInternalSession(sessionId: string): boolean {
return ALWAYS_ON_AUXILIARY_PREFIXES.some((p) => sessionId.startsWith(p));
return ALWAYS_ON_AUXILIARY_PATTERN.test(sessionId);
}

export type SessionInfo = {
Expand Down
4 changes: 2 additions & 2 deletions src/tool/builtin/bash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export type CreateBashToolOptions = {
const BASH_TOOL_DESCRIPTION = `Run a shell command in the PilotDeck workspace.

Usage:
- The \`command\` parameter is passed to \`/bin/sh -c\`.
- The \`command\` parameter is passed to the system shell (\`cmd.exe\` on Windows, \`/bin/sh\` on macOS/Linux).
- The shell runs in the current workspace directory and inherits the tool runtime environment.
- Use \`timeout\` to override the command timeout in milliseconds. When omitted, the default is 30000ms. Values above 600000ms are clamped to the maximum.
- Use \`description\` to provide a short, clear label for logs and audits. Prefer 3-10 words that say what the command does.
Expand All @@ -43,7 +43,7 @@ export function createBashTool(options?: CreateBashToolOptions): PilotDeckToolDe
properties: {
command: {
type: "string",
description: "The shell command to execute (passed to /bin/sh -c).",
description: "The shell command to execute (passed to the system shell).",
},
timeout: {
type: "integer",
Expand Down
Loading