@tekmidian/pai 0.65.1 → 0.66.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{async-CNn36gm4.mjs → async-C2Bm_Lal.mjs} +2 -2
- package/dist/{async-CNn36gm4.mjs.map → async-C2Bm_Lal.mjs.map} +1 -1
- package/dist/{auto-route-sLMU-NnM.mjs → auto-route-o0BOsXn7.mjs} +2 -2
- package/dist/{auto-route-sLMU-NnM.mjs.map → auto-route-o0BOsXn7.mjs.map} +1 -1
- package/dist/{chain-CLb6hbFS.mjs → chain-D4PuQ2c-.mjs} +4 -4
- package/dist/{chain-CLb6hbFS.mjs.map → chain-D4PuQ2c-.mjs.map} +1 -1
- package/dist/cli/index.mjs +14 -12
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/program.mjs +12 -12
- package/dist/{clusters-PgIUYT_v.mjs → clusters-BCtD3fbe.mjs} +1 -1
- package/dist/{clusters-PgIUYT_v.mjs.map → clusters-BCtD3fbe.mjs.map} +1 -1
- package/dist/{context-handover-cache-mGxq2-8f.mjs → context-handover-cache-pkHzmL3c.mjs} +4 -4
- package/dist/{context-handover-cache-mGxq2-8f.mjs.map → context-handover-cache-pkHzmL3c.mjs.map} +1 -1
- package/dist/daemon/index.mjs +14 -12
- package/dist/daemon/index.mjs.map +1 -1
- package/dist/{daemon-DqCB3fO-.mjs → daemon-BEoVgVfJ.mjs} +25 -25
- package/dist/{daemon-DqCB3fO-.mjs.map → daemon-BEoVgVfJ.mjs.map} +1 -1
- package/dist/daemon-DPAYU9hp.mjs +19 -0
- package/dist/daemon-mcp/index.mjs +9 -7
- package/dist/daemon-mcp/index.mjs.map +1 -1
- package/dist/detector-BEPFsINR.mjs +3 -0
- package/dist/{detector-CIHEXKsV.mjs → detector-BRTtAWrM.mjs} +1 -1
- package/dist/{detector-CIHEXKsV.mjs.map → detector-BRTtAWrM.mjs.map} +1 -1
- package/dist/{embeddings-BbNVXa_0.mjs → embeddings-Bx3q0QOY.mjs} +1 -1
- package/dist/{embeddings-BbNVXa_0.mjs.map → embeddings-Bx3q0QOY.mjs.map} +1 -1
- package/dist/{embeddings-CDfM63uC.mjs → embeddings-CcscYWwk.mjs} +1 -1
- package/dist/env-JNEIrQWg.mjs +14 -0
- package/dist/env-JNEIrQWg.mjs.map +1 -0
- package/dist/{factory-y36qGegI.mjs → factory-CNpPQQ-5.mjs} +7 -7
- package/dist/{factory-y36qGegI.mjs.map → factory-CNpPQQ-5.mjs.map} +1 -1
- package/dist/{factory-CaswxuJ0.mjs → factory-DY7x73mE.mjs} +1 -1
- package/dist/{fallback-CupzGkuJ.mjs → fallback-B5svk75f.mjs} +15 -7
- package/dist/fallback-B5svk75f.mjs.map +1 -0
- package/dist/hooks/block-sleep-poll.mjs.map +2 -2
- package/dist/hooks/load-project-context.mjs +16 -0
- package/dist/hooks/load-project-context.mjs.map +2 -2
- package/dist/hooks/route-agents-to-worker.mjs +16 -0
- package/dist/hooks/route-agents-to-worker.mjs.map +2 -2
- package/dist/hooks/security-validator.mjs +16 -0
- package/dist/hooks/security-validator.mjs.map +2 -2
- package/dist/hooks/worker-guard.mjs +10 -0
- package/dist/hooks/worker-guard.mjs.map +3 -3
- package/dist/hooks/worker-proxy.mjs +16 -0
- package/dist/hooks/worker-proxy.mjs.map +2 -2
- package/dist/hooks/worker-status-line.mjs +16 -0
- package/dist/hooks/worker-status-line.mjs.map +2 -2
- package/dist/hooks/worker-supervision.mjs +16 -0
- package/dist/hooks/worker-supervision.mjs.map +2 -2
- package/dist/{indexer-backend-Cnc7Tf5C.mjs → indexer-backend-DFF2FrYx.mjs} +1 -1
- package/dist/{kg-entity-COTUj1ZC.mjs → kg-entity-DCOcsVFD.mjs} +1 -1
- package/dist/{kg-entity-COTUj1ZC.mjs.map → kg-entity-DCOcsVFD.mjs.map} +1 -1
- package/dist/{latent-ideas-ByvMjVcb.mjs → latent-ideas-wwAXquGe.mjs} +3 -3
- package/dist/{latent-ideas-ByvMjVcb.mjs.map → latent-ideas-wwAXquGe.mjs.map} +1 -1
- package/dist/{link-boost-UiE-uooT.mjs → link-boost-CnI7UVMJ.mjs} +1 -1
- package/dist/{link-boost-UiE-uooT.mjs.map → link-boost-CnI7UVMJ.mjs.map} +1 -1
- package/dist/{main-resolver-kHW6FewU.mjs → main-resolver-BKz_OuEh.mjs} +2 -2
- package/dist/{main-resolver-BeYWNzrt.mjs → main-resolver-DPPwHNtn.mjs} +4 -4
- package/dist/{main-resolver-BeYWNzrt.mjs.map → main-resolver-DPPwHNtn.mjs.map} +1 -1
- package/dist/{neighborhood-CvRHlqdR.mjs → neighborhood-2FsmzoxG.mjs} +2 -2
- package/dist/{neighborhood-CvRHlqdR.mjs.map → neighborhood-2FsmzoxG.mjs.map} +1 -1
- package/dist/{note-context-BrbfUIoP.mjs → note-context-De63k8na.mjs} +1 -1
- package/dist/{note-context-BrbfUIoP.mjs.map → note-context-De63k8na.mjs.map} +1 -1
- package/dist/{planner-DAq4Yx-H.mjs → planner-EJPZnnif.mjs} +6 -6
- package/dist/{planner-DAq4Yx-H.mjs.map → planner-EJPZnnif.mjs.map} +1 -1
- package/dist/{postgres-DYtZg7J7.mjs → postgres-Ceqsa64C.mjs} +3 -3
- package/dist/{postgres-DYtZg7J7.mjs.map → postgres-Ceqsa64C.mjs.map} +1 -1
- package/dist/{program-CWf9mT7Z.mjs → program-DSETzrWg.mjs} +91 -51
- package/dist/{program-CWf9mT7Z.mjs.map → program-DSETzrWg.mjs.map} +1 -1
- package/dist/{registry-postgres-DSrkxqfF.mjs → registry-postgres-nOfyBSIW.mjs} +1 -1
- package/dist/{registry-postgres-DSrkxqfF.mjs.map → registry-postgres-nOfyBSIW.mjs.map} +1 -1
- package/dist/{registry-sqlite-B2436JgX.mjs → registry-sqlite-DrCW1aRK.mjs} +1 -1
- package/dist/{registry-sqlite-B2436JgX.mjs.map → registry-sqlite-DrCW1aRK.mjs.map} +1 -1
- package/dist/router-CXUGsv85.mjs +3 -0
- package/dist/{router-aqLMvNMg.mjs → router-a5G7q8_3.mjs} +1 -1
- package/dist/{router-aqLMvNMg.mjs.map → router-a5G7q8_3.mjs.map} +1 -1
- package/dist/{run-uAkNItb6.mjs → run-Z4akoa8G.mjs} +326 -24
- package/dist/run-Z4akoa8G.mjs.map +1 -0
- package/dist/{run-env-BHWnXqle.mjs → run-env-DRcp7A8K.mjs} +16 -2
- package/dist/run-env-DRcp7A8K.mjs.map +1 -0
- package/dist/{server-DlL1QI2k.mjs → server-DgmAHyFK.mjs} +2 -2
- package/dist/{server-DlL1QI2k.mjs.map → server-DgmAHyFK.mjs.map} +1 -1
- package/dist/{session-keepalive-BWEjcRrh.mjs → session-keepalive-BDhytXEo.mjs} +4 -4
- package/dist/{session-keepalive-BWEjcRrh.mjs.map → session-keepalive-BDhytXEo.mjs.map} +1 -1
- package/dist/{sources-DX4ElmrE.mjs → sources-CijVso3n.mjs} +1 -1
- package/dist/{sources-DX4ElmrE.mjs.map → sources-CijVso3n.mjs.map} +1 -1
- package/dist/{sqlite-BrEu3avy.mjs → sqlite-CqsTy6xo.mjs} +3 -3
- package/dist/{sqlite-BrEu3avy.mjs.map → sqlite-CqsTy6xo.mjs.map} +1 -1
- package/dist/{themes-BgqahYVM.mjs → themes-CTaOj3e1.mjs} +2 -2
- package/dist/{themes-BgqahYVM.mjs.map → themes-CTaOj3e1.mjs.map} +1 -1
- package/dist/{tools-gMGDIpJ9.mjs → tools-BcOKPBtg.mjs} +16 -16
- package/dist/{tools-gMGDIpJ9.mjs.map → tools-BcOKPBtg.mjs.map} +1 -1
- package/dist/{tools-BbqQIHPe.mjs → tools-C-_l0o8Z.mjs} +4 -4
- package/dist/{trace-CmAB7iJZ.mjs → trace-CtV0RO6n.mjs} +1 -1
- package/dist/{trace-CmAB7iJZ.mjs.map → trace-CtV0RO6n.mjs.map} +1 -1
- package/dist/{vault-indexer-Ddq51X20.mjs → vault-indexer-BG1sEVyM.mjs} +1 -1
- package/dist/{vault-indexer-Ddq51X20.mjs.map → vault-indexer-BG1sEVyM.mjs.map} +1 -1
- package/dist/{wakeup-CZw88uXf.mjs → wakeup-D8n33hYV.mjs} +2 -2
- package/dist/{wakeup-CZw88uXf.mjs.map → wakeup-D8n33hYV.mjs.map} +1 -1
- package/dist/{work-queue-worker-DCzfH0d1.mjs → work-queue-worker-4tLa5gpQ.mjs} +3 -3
- package/dist/{work-queue-worker-DCzfH0d1.mjs.map → work-queue-worker-4tLa5gpQ.mjs.map} +1 -1
- package/dist/work-queue-worker-rFZvTO3p.mjs +11 -0
- package/dist/{zettelkasten-Dwj67e4p.mjs → zettelkasten-CtGHQWPU.mjs} +3 -3
- package/dist/{zettelkasten-Dwj67e4p.mjs.map → zettelkasten-CtGHQWPU.mjs.map} +1 -1
- package/docs/commands/README.md +1 -0
- package/docs/commands/worker.md +30 -0
- package/package.json +1 -1
- package/src/hooks/ts/lib/worker-guard.ts +4 -0
- package/statusline-command.sh +1 -1
- package/dist/daemon-BjaPR39W.mjs +0 -19
- package/dist/detector-C3Q7mxQU.mjs +0 -3
- package/dist/fallback-CupzGkuJ.mjs.map +0 -1
- package/dist/router-S6C5BxzZ.mjs +0 -3
- package/dist/run-env-BHWnXqle.mjs.map +0 -1
- package/dist/run-uAkNItb6.mjs.map +0 -1
- package/dist/work-queue-worker-Taba_vcA.mjs +0 -11
|
@@ -4,32 +4,32 @@ import { n as ensurePaiMarker } from "./pai-marker-D1MMswkz.mjs";
|
|
|
4
4
|
import { t as STOP_WORDS } from "./stop-words-BdQuaE9K.mjs";
|
|
5
5
|
import { t as applyRecencyBoost } from "./search-BOSphCJ1.mjs";
|
|
6
6
|
import { n as resolveFromModule, t as packageRoot } from "./module-paths-DdRzbkUI.mjs";
|
|
7
|
-
import { a as getStorageBackend, i as getRegistryBackend, r as createStorageBackend, s as humanDuration } from "./factory-
|
|
8
|
-
import { a as formatDetectionJson, i as formatDetection, n as migrateIdentityFile, r as detectProject } from "./wakeup-
|
|
9
|
-
import { B as claudeProjectsDir, C as findLatestNote, H as scanTranscriptFolders, I as resolveHome, L as saveScanConfig, M as cmdScan, N as loadScanConfig, P as migrateScanConfig, R as upsertProject, S as applyContinue, T as readBodyFile, U as transcriptFiles, V as findMovedProjects, d as migrateWorkQueue, g as migrateSummaryCooldowns, t as readContextHandoverCache, v as extractAndStoreTriples, w as findNotesDir$1, x as appendCheckpointToNote, z as upsertSession } from "./context-handover-cache-
|
|
7
|
+
import { a as getStorageBackend, i as getRegistryBackend, r as createStorageBackend, s as humanDuration } from "./factory-CNpPQQ-5.mjs";
|
|
8
|
+
import { a as formatDetectionJson, i as formatDetection, n as migrateIdentityFile, r as detectProject } from "./wakeup-D8n33hYV.mjs";
|
|
9
|
+
import { B as claudeProjectsDir, C as findLatestNote, H as scanTranscriptFolders, I as resolveHome, L as saveScanConfig, M as cmdScan, N as loadScanConfig, P as migrateScanConfig, R as upsertProject, S as applyContinue, T as readBodyFile, U as transcriptFiles, V as findMovedProjects, d as migrateWorkQueue, g as migrateSummaryCooldowns, t as readContextHandoverCache, v as extractAndStoreTriples, w as findNotesDir$1, x as appendCheckpointToNote, z as upsertSession } from "./context-handover-cache-pkHzmL3c.mjs";
|
|
10
10
|
import { a as paiHomePath, i as paiHomeDir, n as migratePaiDir, o as resolvePaiFile, r as migratePaiFile, t as PaiFileMigrationError } from "./pai-home-Cm9rcJgX.mjs";
|
|
11
11
|
import { b as OWNER_LABEL_PREFIX, c as migrateConfigFile, d as readMainConfigRaw, f as writeMainConfigRaw, h as resolvedMainConfigPath, l as paiConfigFilePath, m as migrateMainConfigToYaml, n as CONFIG_FILE$2, o as expandHome, p as MainConfigError, s as loadConfig, t as CONFIG_DIR, u as paiConfigYamlFilePath, v as readJsonStrict, x as UNROUTED, y as writeJsonAtomic } from "./config-BbLFD7Uf.mjs";
|
|
12
12
|
import { a as schedulerLogPath, i as paiSocketPath, n as daemonLogPath, r as daemonPidPath } from "./runtime-paths-CHTg3ywb.mjs";
|
|
13
|
-
import { B as
|
|
14
|
-
import { $ as
|
|
13
|
+
import { B as DEFAULT_CONTEXT_WINDOW, C as maskKey, D as readWorkersSection, F as needsWorkersYamlRelocation, H as stripModelVariant, I as parseWorkersYamlDocument, L as relocateWorkersYaml, M as initWorkersYaml, N as inlineWorkersYamlKeys, P as migrateWorkersToYaml, R as workersYamlLegacyNotice, V as contextWindowFromModelId, b as getProviderOrNative, d as MODEL_CAPABILITIES, h as WorkersConfigError, p as PROVIDER_TAGS, r as ANTHROPIC_NATIVE, t as buildRunEnv, w as nativeAnthropicProvider, x as isModelCapability, y as expandHome$1, z as workersYamlPath } from "./run-env-DRcp7A8K.mjs";
|
|
14
|
+
import { $ as projectLaunchConfig, B as isLive, D as mergeWorker, E as git, G as ownsPid, H as loadStatuses, J as waitForTerminalStatus, K as saveStatus, N as UNLABELED, O as uncommittedPaths, Q as pinNotices, T as gcWorktrees, V as loadStatus, X as parseRunnerArgs, Y as longInlinePromptHint, c as handoffFromInside, et as describeMcp, f as checkPaneForWorker, g as markControlsHeld, h as clickrControlsArgv, i as usageContextTokens, j as appendLedger, k as verifyWorker, m as openPaneForWorker, n as runWorker, o as parseWorkerReport, p as openFollowPane, q as setWorkerLabel, r as testProvider, tt as expandMcpNames, u as sayToWorker, w as discardWorker, z as isChatPane } from "./run-Z4akoa8G.mjs";
|
|
15
15
|
import { t as MergeError } from "./merge-DgU9OgZy.mjs";
|
|
16
16
|
import { n as oldFederationPath, t as federationDbPath } from "./federation-db-BTyoufBh.mjs";
|
|
17
17
|
import { r as registryDbPath, t as oldRegistryPath } from "./registry-db-C7voqML9.mjs";
|
|
18
|
-
import { i as indexProjectWithBackend } from "./async-
|
|
18
|
+
import { i as indexProjectWithBackend } from "./async-C2Bm_Lal.mjs";
|
|
19
19
|
import { t as PaiClient } from "./ipc-client-D16Xw6Uo.mjs";
|
|
20
|
-
import { A as getConfigValueOp, C as setWorkersEnabled, D as useProvider, E as updateProvider, M as setConfigValueOp, N as unsetConfigValueOp, O as MainConfigOpsError, S as setProviderModel, T as unsetClass, _ as removeProvider, a as followWorkers, b as setClass, c as statusLineOutput, d as addProvider, f as classTargetText, g as modelPrefsText, h as describeProviders, i as fallbackStatusText, j as listConfigOp, k as formatConfigGetOutput, l as readSpecPrompt, m as describeModels, n as fallbackOn, o as psOutput, p as describeCapabilities, r as fallbackStatus, s as replayOutput, t as fallbackOff, u as resolveSpecPath, v as resolveProviderName, w as unsetCapabilityPreference, x as setProviderEnabled, y as setCapabilityPreference } from "./fallback-
|
|
21
|
-
import { _ as resolveSessionByNameOrId, a as buildDeduped, c as hasConversation, d as providerResumePlan, f as restoreTopLevel, g as migrateSessionScanCache, h as fmtAge$1, l as launchInDir, m as printExitDir, o as normalizeName$2, p as resumeArgvText, s as renderDedupedSessions, t as cmdMain, u as launchPrompt, v as scanCacheFilePath, y as scanSessions } from "./main-resolver-
|
|
20
|
+
import { A as getConfigValueOp, C as setWorkersEnabled, D as useProvider, E as updateProvider, M as setConfigValueOp, N as unsetConfigValueOp, O as MainConfigOpsError, S as setProviderModel, T as unsetClass, _ as removeProvider, a as followWorkers, b as setClass, c as statusLineOutput, d as addProvider, f as classTargetText, g as modelPrefsText, h as describeProviders, i as fallbackStatusText, j as listConfigOp, k as formatConfigGetOutput, l as readSpecPrompt, m as describeModels, n as fallbackOn, o as psOutput, p as describeCapabilities, r as fallbackStatus, s as replayOutput, t as fallbackOff, u as resolveSpecPath, v as resolveProviderName, w as unsetCapabilityPreference, x as setProviderEnabled, y as setCapabilityPreference } from "./fallback-B5svk75f.mjs";
|
|
21
|
+
import { _ as resolveSessionByNameOrId, a as buildDeduped, c as hasConversation, d as providerResumePlan, f as restoreTopLevel, g as migrateSessionScanCache, h as fmtAge$1, l as launchInDir, m as printExitDir, o as normalizeName$2, p as resumeArgvText, s as renderDedupedSessions, t as cmdMain, u as launchPrompt, v as scanCacheFilePath, y as scanSessions } from "./main-resolver-DPPwHNtn.mjs";
|
|
22
22
|
import { n as queriesDirPath, t as migrateQueriesDir } from "./query-feedback-BIaZTTFO.mjs";
|
|
23
|
-
import { _ as statusPath, h as ledgerPath, m as eventsPath, n as ensureProxyRunning, p as ensureNoMcpConfig, r as stopProxy, t as DEFAULT_PROXY_PORT, v as workersLogDir } from "./server-
|
|
23
|
+
import { _ as statusPath, h as ledgerPath, m as eventsPath, n as ensureProxyRunning, p as ensureNoMcpConfig, r as stopProxy, t as DEFAULT_PROXY_PORT, v as workersLogDir } from "./server-DgmAHyFK.mjs";
|
|
24
24
|
import { i as sendToSession, n as fetchLiveSessions, r as revealItermSession, t as callAiBroker } from "./aibroker-client-C5Fw7DNz.mjs";
|
|
25
|
-
import { a as totalUsageTokens, i as parseSessionUsage, r as sessionKeepaliveLedgerSummary, t as loadSessionKeepaliveState } from "./session-keepalive-
|
|
26
|
-
import { t as runChain } from "./chain-
|
|
25
|
+
import { a as totalUsageTokens, i as parseSessionUsage, r as sessionKeepaliveLedgerSummary, t as loadSessionKeepaliveState } from "./session-keepalive-BDhytXEo.mjs";
|
|
26
|
+
import { t as runChain } from "./chain-D4PuQ2c-.mjs";
|
|
27
27
|
import { appendFileSync, chmodSync, closeSync, copyFileSync, cpSync, createReadStream, existsSync, lstatSync, mkdirSync, openSync, readFileSync, readdirSync, readlinkSync, realpathSync, renameSync, statSync, symlinkSync, unlinkSync, writeFileSync } from "node:fs";
|
|
28
28
|
import { homedir, platform, tmpdir, userInfo } from "node:os";
|
|
29
29
|
import { basename, dirname, join, relative, resolve, sep } from "node:path";
|
|
30
30
|
import chalk from "chalk";
|
|
31
31
|
import { createHash, randomUUID } from "node:crypto";
|
|
32
|
-
import { Command } from "commander";
|
|
32
|
+
import { Command, InvalidArgumentError } from "commander";
|
|
33
33
|
import { fileURLToPath } from "node:url";
|
|
34
34
|
import { execFile, execFileSync, execSync, spawn, spawnSync } from "node:child_process";
|
|
35
35
|
import { parseDocument } from "yaml";
|
|
@@ -162,7 +162,7 @@ async function cmdPromote(opts) {
|
|
|
162
162
|
console.error(dim$1(` Pick a durable location for the new project.`));
|
|
163
163
|
process.exit(1);
|
|
164
164
|
}
|
|
165
|
-
const { getRegistryBackend } = await import("./factory-
|
|
165
|
+
const { getRegistryBackend } = await import("./factory-DY7x73mE.mjs");
|
|
166
166
|
const registryBackend = await getRegistryBackend();
|
|
167
167
|
const encodedDir = encodeDir(targetPath);
|
|
168
168
|
if (await registryBackend.getProjectBySlug(slug) ?? await registryBackend.getProjectByRootPath(targetPath) ?? await registryBackend.getProjectByEncodedDir(encodedDir)) {
|
|
@@ -2046,7 +2046,7 @@ async function cmdUnregister(slug, opts = {}) {
|
|
|
2046
2046
|
//#region src/cli/commands/project/projects-index.ts
|
|
2047
2047
|
function registerProjectsCommands(projectsCmd) {
|
|
2048
2048
|
projectsCmd.command("list", { isDefault: true }).description("Show the unified deduped listing (same as `pai`).\nUse --all to include cold / zero-session / archived projects.").option("--all", "Show all entries including cold / zero-session / archived projects").option("-n, --n <count>", "Max rows to show", "20").action(async (opts) => {
|
|
2049
|
-
const { cmdMain } = await import("./main-resolver-
|
|
2049
|
+
const { cmdMain } = await import("./main-resolver-BKz_OuEh.mjs");
|
|
2050
2050
|
await cmdMain(void 0, void 0, opts);
|
|
2051
2051
|
});
|
|
2052
2052
|
projectsCmd.command("list-raw").description("Raw registry listing with slug, path, status, last_active columns").option("--all", "Include archived projects (default: active only)").option("--status <status>", "Filter by status: active | archived").option("--tag <tag>", "Filter by tag").option("--type <type>", "Filter by type").action(async (opts) => {
|
|
@@ -2912,7 +2912,7 @@ const DEFAULT_PAGE_SIZE = 500;
|
|
|
2912
2912
|
async function runEmbed(backend, projectId, projectSlug, batchSize = 50, pageSize = DEFAULT_PAGE_SIZE) {
|
|
2913
2913
|
const label = projectSlug ? `project ${projectSlug}` : "all projects";
|
|
2914
2914
|
console.log(dim$1(`Generating embeddings for ${label} (this may take a while on first run)...`));
|
|
2915
|
-
const { generateEmbeddings, serializeEmbedding } = await import("./embeddings-
|
|
2915
|
+
const { generateEmbeddings, serializeEmbedding } = await import("./embeddings-CcscYWwk.mjs");
|
|
2916
2916
|
const { chunks: totalEstimate } = projectId !== void 0 ? await backend.getProjectStats(projectId) : await backend.getStats();
|
|
2917
2917
|
let done = 0;
|
|
2918
2918
|
let after = null;
|
|
@@ -3076,7 +3076,7 @@ function registerSearchCommand(memoryCmd) {
|
|
|
3076
3076
|
let results;
|
|
3077
3077
|
if (mode === "keyword") results = await backend.searchKeyword(query, searchOpts);
|
|
3078
3078
|
else {
|
|
3079
|
-
const { generateEmbedding } = await import("./embeddings-
|
|
3079
|
+
const { generateEmbedding } = await import("./embeddings-CcscYWwk.mjs");
|
|
3080
3080
|
console.log(dim$1("Generating query embedding..."));
|
|
3081
3081
|
const queryEmbedding = await generateEmbedding(query, true);
|
|
3082
3082
|
if (mode === "semantic") results = await backend.searchSemantic(queryEmbedding, searchOpts);
|
|
@@ -3261,9 +3261,9 @@ function registerStatsCommands(memoryCmd) {
|
|
|
3261
3261
|
//#region src/cli/commands/memory/sources-cmd.ts
|
|
3262
3262
|
function registerSourcesCommand(memoryCmd) {
|
|
3263
3263
|
memoryCmd.command("sources").description("Show what the indexer has taken in: composition by source, which roots\ncontent enters from, the heaviest single files, and how many chunks are\nrewritten per day (which distinguishes a finite backlog from a treadmill).").option("--limit <n>", "Rows per section (default 8)", "8").action(async (opts) => {
|
|
3264
|
-
const { createStorageBackend } = await import("./factory-
|
|
3264
|
+
const { createStorageBackend } = await import("./factory-DY7x73mE.mjs");
|
|
3265
3265
|
const { loadConfig } = await import("./config-YinjgXEJ.mjs");
|
|
3266
|
-
const { cmdMemorySources } = await import("./sources-
|
|
3266
|
+
const { cmdMemorySources } = await import("./sources-CijVso3n.mjs");
|
|
3267
3267
|
let backend;
|
|
3268
3268
|
try {
|
|
3269
3269
|
backend = await createStorageBackend(loadConfig());
|
|
@@ -3963,7 +3963,7 @@ async function escalate(task, headline, detail, state, now, opts) {
|
|
|
3963
3963
|
state.alarmedAt[task.id] = now;
|
|
3964
3964
|
let delivered = false;
|
|
3965
3965
|
try {
|
|
3966
|
-
const { routeNotification } = await import("./router-
|
|
3966
|
+
const { routeNotification } = await import("./router-CXUGsv85.mjs");
|
|
3967
3967
|
const { loadConfig } = await import("./config-YinjgXEJ.mjs");
|
|
3968
3968
|
delivered = (await routeNotification({
|
|
3969
3969
|
event: "error",
|
|
@@ -7097,7 +7097,7 @@ function cmdLogs(opts) {
|
|
|
7097
7097
|
}
|
|
7098
7098
|
function registerDaemonCommands(daemonCmd) {
|
|
7099
7099
|
daemonCmd.command("serve").description("Start the PAI daemon in the foreground").action(async () => {
|
|
7100
|
-
const { serve } = await import("./daemon-
|
|
7100
|
+
const { serve } = await import("./daemon-DPAYU9hp.mjs");
|
|
7101
7101
|
const { loadConfig: lc, ensureConfigDir } = await import("./config-YinjgXEJ.mjs");
|
|
7102
7102
|
ensureConfigDir();
|
|
7103
7103
|
await serve(lc());
|
|
@@ -8402,7 +8402,7 @@ async function stepSettings(rl, daName) {
|
|
|
8402
8402
|
},
|
|
8403
8403
|
{
|
|
8404
8404
|
hookType: "PreToolUse",
|
|
8405
|
-
matcher: "Bash|Edit|Write|MultiEdit|NotebookEdit",
|
|
8405
|
+
matcher: "Bash|Edit|Write|MultiEdit|NotebookEdit|mcp__.*",
|
|
8406
8406
|
command: "${ADAPTER_DIR}/Hooks/worker-guard.mjs"
|
|
8407
8407
|
},
|
|
8408
8408
|
{
|
|
@@ -9724,7 +9724,7 @@ async function cmdExplore(note, opts) {
|
|
|
9724
9724
|
const depth = parseInt(opts.depth ?? "3", 10);
|
|
9725
9725
|
const direction = opts.direction ?? "both";
|
|
9726
9726
|
const mode = opts.mode ?? "all";
|
|
9727
|
-
const { zettelExplore } = await import("./zettelkasten-
|
|
9727
|
+
const { zettelExplore } = await import("./zettelkasten-CtGHQWPU.mjs");
|
|
9728
9728
|
const result = await zettelExplore(await getFedBackend(), {
|
|
9729
9729
|
startNote: note,
|
|
9730
9730
|
depth,
|
|
@@ -9789,7 +9789,7 @@ async function cmdHealth(opts) {
|
|
|
9789
9789
|
const projectPath = opts.project;
|
|
9790
9790
|
const recentDays = parseInt(opts.days ?? "30", 10);
|
|
9791
9791
|
const includeTypes = opts.include ? opts.include.split(",").map((s) => s.trim()) : void 0;
|
|
9792
|
-
const { zettelHealth } = await import("./zettelkasten-
|
|
9792
|
+
const { zettelHealth } = await import("./zettelkasten-CtGHQWPU.mjs");
|
|
9793
9793
|
const result = await zettelHealth(await getFedBackend(), {
|
|
9794
9794
|
scope,
|
|
9795
9795
|
projectPath,
|
|
@@ -9860,7 +9860,7 @@ async function cmdSurprise(note, opts) {
|
|
|
9860
9860
|
const limit = parseInt(opts.limit ?? "10", 10);
|
|
9861
9861
|
const minSimilarity = parseFloat(opts.minSimilarity ?? "0.3");
|
|
9862
9862
|
const minGraphDistance = parseInt(opts.minDistance ?? "3", 10);
|
|
9863
|
-
const { zettelSurprise } = await import("./zettelkasten-
|
|
9863
|
+
const { zettelSurprise } = await import("./zettelkasten-CtGHQWPU.mjs");
|
|
9864
9864
|
const backend = await getFedBackend();
|
|
9865
9865
|
console.log();
|
|
9866
9866
|
console.log(header(" PAI Zettel Surprise"));
|
|
@@ -9915,7 +9915,7 @@ async function cmdSuggest(note, opts) {
|
|
|
9915
9915
|
const vaultProjectId = parseInt(opts.vaultProjectId, 10);
|
|
9916
9916
|
const limit = parseInt(opts.limit ?? "5", 10);
|
|
9917
9917
|
const excludeLinked = opts.excludeLinked !== false;
|
|
9918
|
-
const { zettelSuggest } = await import("./zettelkasten-
|
|
9918
|
+
const { zettelSuggest } = await import("./zettelkasten-CtGHQWPU.mjs");
|
|
9919
9919
|
const backend = await getFedBackend();
|
|
9920
9920
|
console.log();
|
|
9921
9921
|
console.log(header(" PAI Zettel Suggest"));
|
|
@@ -9968,7 +9968,7 @@ async function cmdConverse(question, opts) {
|
|
|
9968
9968
|
const vaultProjectId = parseInt(opts.vaultProjectId, 10);
|
|
9969
9969
|
const depth = parseInt(opts.depth ?? "2", 10);
|
|
9970
9970
|
const limit = parseInt(opts.limit ?? "15", 10);
|
|
9971
|
-
const { zettelConverse } = await import("./zettelkasten-
|
|
9971
|
+
const { zettelConverse } = await import("./zettelkasten-CtGHQWPU.mjs");
|
|
9972
9972
|
const backend = await getFedBackend();
|
|
9973
9973
|
console.log();
|
|
9974
9974
|
console.log(header(" PAI Zettel Converse"));
|
|
@@ -10031,7 +10031,7 @@ async function cmdThemes(opts) {
|
|
|
10031
10031
|
const minClusterSize = parseInt(opts.minSize ?? "3", 10);
|
|
10032
10032
|
const maxThemes = parseInt(opts.maxThemes ?? "10", 10);
|
|
10033
10033
|
const similarityThreshold = parseFloat(opts.threshold ?? "0.65");
|
|
10034
|
-
const { zettelThemes } = await import("./zettelkasten-
|
|
10034
|
+
const { zettelThemes } = await import("./zettelkasten-CtGHQWPU.mjs");
|
|
10035
10035
|
const backend = await getFedBackend();
|
|
10036
10036
|
console.log();
|
|
10037
10037
|
console.log(header(" PAI Zettel Themes"));
|
|
@@ -16106,7 +16106,7 @@ async function migrateToPostgres(opts = {}) {
|
|
|
16106
16106
|
const dump = pgDump(container, pgConfig, dumpPath);
|
|
16107
16107
|
if (!dump.ok) return refused(dump.reason, dryRun);
|
|
16108
16108
|
}
|
|
16109
|
-
const { PostgresBackend } = await import("./postgres-
|
|
16109
|
+
const { PostgresBackend } = await import("./postgres-Ceqsa64C.mjs");
|
|
16110
16110
|
await PostgresBackend.ensureDatabase(pgConfig);
|
|
16111
16111
|
const sqlite = new BetterSqlite3(sqliteFederationPath, { readonly: true });
|
|
16112
16112
|
const registrySqlite = sqliteRegistryPath === sqliteFederationPath ? sqlite : new BetterSqlite3(sqliteRegistryPath, { readonly: true });
|
|
@@ -16677,7 +16677,7 @@ async function getSessionTags(registryBackend, sessionId) {
|
|
|
16677
16677
|
* Session CRUD commands: list, info, rename, slug, tag, route, active, auto-route.
|
|
16678
16678
|
*/
|
|
16679
16679
|
async function cmdList(projectSlug, opts) {
|
|
16680
|
-
const { getRegistryBackend } = await import("./factory-
|
|
16680
|
+
const { getRegistryBackend } = await import("./factory-DY7x73mE.mjs");
|
|
16681
16681
|
const registryBackend = await getRegistryBackend();
|
|
16682
16682
|
const limit = parseInt(opts.limit ?? "20", 10);
|
|
16683
16683
|
let project;
|
|
@@ -16742,7 +16742,7 @@ async function cmdList(projectSlug, opts) {
|
|
|
16742
16742
|
console.log(dim$1(` ${rows.length} session(s) shown (limit: ${limit})`));
|
|
16743
16743
|
}
|
|
16744
16744
|
async function cmdInfo(projectSlug, sessionNumber) {
|
|
16745
|
-
const { getRegistryBackend } = await import("./factory-
|
|
16745
|
+
const { getRegistryBackend } = await import("./factory-DY7x73mE.mjs");
|
|
16746
16746
|
const registryBackend = await getRegistryBackend();
|
|
16747
16747
|
const project = await getProject$1(registryBackend, projectSlug);
|
|
16748
16748
|
if (!project) {
|
|
@@ -16766,7 +16766,7 @@ async function cmdInfo(projectSlug, sessionNumber) {
|
|
|
16766
16766
|
console.log();
|
|
16767
16767
|
}
|
|
16768
16768
|
async function cmdRename(projectSlug, numberOrLatest, newSlug) {
|
|
16769
|
-
const { getRegistryBackend } = await import("./factory-
|
|
16769
|
+
const { getRegistryBackend } = await import("./factory-DY7x73mE.mjs");
|
|
16770
16770
|
await cmdRenameWith(await getRegistryBackend(), projectSlug, numberOrLatest, newSlug);
|
|
16771
16771
|
}
|
|
16772
16772
|
async function cmdRenameWith(registryBackend, projectSlug, numberOrLatest, newSlug) {
|
|
@@ -16829,7 +16829,7 @@ async function cmdRenameWith(registryBackend, projectSlug, numberOrLatest, newSl
|
|
|
16829
16829
|
console.log();
|
|
16830
16830
|
}
|
|
16831
16831
|
async function cmdSlug(projectSlug, numberOrLatest, opts) {
|
|
16832
|
-
const { getRegistryBackend } = await import("./factory-
|
|
16832
|
+
const { getRegistryBackend } = await import("./factory-DY7x73mE.mjs");
|
|
16833
16833
|
const registryBackend = await getRegistryBackend();
|
|
16834
16834
|
const project = await getProject$1(registryBackend, projectSlug);
|
|
16835
16835
|
if (!project) {
|
|
@@ -16859,7 +16859,7 @@ async function cmdSlug(projectSlug, numberOrLatest, opts) {
|
|
|
16859
16859
|
}
|
|
16860
16860
|
}
|
|
16861
16861
|
async function cmdTag(projectSlug, sessionNumber, rawTags) {
|
|
16862
|
-
const { getRegistryBackend } = await import("./factory-
|
|
16862
|
+
const { getRegistryBackend } = await import("./factory-DY7x73mE.mjs");
|
|
16863
16863
|
const registryBackend = await getRegistryBackend();
|
|
16864
16864
|
const project = await getProject$1(registryBackend, projectSlug);
|
|
16865
16865
|
if (!project) {
|
|
@@ -16899,7 +16899,7 @@ async function cmdTag(projectSlug, sessionNumber, rawTags) {
|
|
|
16899
16899
|
console.log();
|
|
16900
16900
|
}
|
|
16901
16901
|
async function cmdRoute(projectSlug, sessionNumber, targetProjectSlug, opts) {
|
|
16902
|
-
const { getRegistryBackend } = await import("./factory-
|
|
16902
|
+
const { getRegistryBackend } = await import("./factory-DY7x73mE.mjs");
|
|
16903
16903
|
const registryBackend = await getRegistryBackend();
|
|
16904
16904
|
const project = await getProject$1(registryBackend, projectSlug);
|
|
16905
16905
|
if (!project) {
|
|
@@ -16941,7 +16941,7 @@ async function cmdRoute(projectSlug, sessionNumber, targetProjectSlug, opts) {
|
|
|
16941
16941
|
console.log();
|
|
16942
16942
|
}
|
|
16943
16943
|
async function cmdActive(opts) {
|
|
16944
|
-
const { getRegistryBackend } = await import("./factory-
|
|
16944
|
+
const { getRegistryBackend } = await import("./factory-DY7x73mE.mjs");
|
|
16945
16945
|
const registryBackend = await getRegistryBackend();
|
|
16946
16946
|
const minutes = parseInt(opts.minutes ?? "60", 10);
|
|
16947
16947
|
const cutoff = Date.now() - minutes * 60 * 1e3;
|
|
@@ -17028,8 +17028,8 @@ async function cmdActive(opts) {
|
|
|
17028
17028
|
], rows));
|
|
17029
17029
|
}
|
|
17030
17030
|
async function cmdAutoRoute(opts) {
|
|
17031
|
-
const { autoRoute, formatAutoRouteJson } = await import("./auto-route-
|
|
17032
|
-
const { getRegistryBackend, createStorageBackend } = await import("./factory-
|
|
17031
|
+
const { autoRoute, formatAutoRouteJson } = await import("./auto-route-o0BOsXn7.mjs");
|
|
17032
|
+
const { getRegistryBackend, createStorageBackend } = await import("./factory-DY7x73mE.mjs");
|
|
17033
17033
|
const { loadConfig } = await import("./config-YinjgXEJ.mjs");
|
|
17034
17034
|
const config = loadConfig();
|
|
17035
17035
|
const registryBackend = await getRegistryBackend();
|
|
@@ -17266,7 +17266,7 @@ async function cmdPause(opts) {
|
|
|
17266
17266
|
process.exitCode = 1;
|
|
17267
17267
|
return;
|
|
17268
17268
|
}
|
|
17269
|
-
const { getRegistryBackend } = await import("./factory-
|
|
17269
|
+
const { getRegistryBackend } = await import("./factory-DY7x73mE.mjs");
|
|
17270
17270
|
const registryBackend = await getRegistryBackend();
|
|
17271
17271
|
const cwd = process.cwd();
|
|
17272
17272
|
const project = await resolveProjectByCwd(registryBackend, cwd);
|
|
@@ -17661,7 +17661,7 @@ function buildStopBody(project, sessionId) {
|
|
|
17661
17661
|
}
|
|
17662
17662
|
}
|
|
17663
17663
|
async function cmdHandover(projectSlug, numberOrLatest, sessionId) {
|
|
17664
|
-
const { getRegistryBackend } = await import("./factory-
|
|
17664
|
+
const { getRegistryBackend } = await import("./factory-DY7x73mE.mjs");
|
|
17665
17665
|
const registryBackend = await getRegistryBackend();
|
|
17666
17666
|
let project;
|
|
17667
17667
|
if (projectSlug) {
|
|
@@ -17957,7 +17957,7 @@ function touchSentinel(rootPath) {
|
|
|
17957
17957
|
async function cmdAutosave(opts) {
|
|
17958
17958
|
const minGap = parseInt(opts.minGap ?? String(DEFAULT_MIN_GAP), 10);
|
|
17959
17959
|
const cwd = process.cwd();
|
|
17960
|
-
const { getRegistryBackend } = await import("./factory-
|
|
17960
|
+
const { getRegistryBackend } = await import("./factory-DY7x73mE.mjs");
|
|
17961
17961
|
const registryBackend = await getRegistryBackend();
|
|
17962
17962
|
const project = await resolveProjectByCwd(registryBackend, cwd);
|
|
17963
17963
|
if (!project) return;
|
|
@@ -19200,6 +19200,25 @@ async function waitWorkers(logDir, ids, opts = {}) {
|
|
|
19200
19200
|
|
|
19201
19201
|
//#endregion
|
|
19202
19202
|
//#region src/cli/commands/worker/index.ts
|
|
19203
|
+
/**
|
|
19204
|
+
* `pai worker` — the CLI face of the worker system.
|
|
19205
|
+
*
|
|
19206
|
+
* Thin: every command here is a wrapper over src/workers/*, which is also
|
|
19207
|
+
* what the MCP tools and the Agent hook call. Nothing in this file decides
|
|
19208
|
+
* routing, providers or rendering on its own.
|
|
19209
|
+
*
|
|
19210
|
+
* Layout mirrors the old glm tooling so the habits transfer:
|
|
19211
|
+
*
|
|
19212
|
+
* pai worker run … (glm / glm-run)
|
|
19213
|
+
* pai worker ps (glm-ps)
|
|
19214
|
+
* pai worker follow (glm-ps follow / watch)
|
|
19215
|
+
* pai worker replay <id> (glm-ps <id>)
|
|
19216
|
+
* pai worker pane (glm-ps pane)
|
|
19217
|
+
* pai worker log (glm-log)
|
|
19218
|
+
*
|
|
19219
|
+
* Plus the operator surface: say/resume for talking to workers, proxy for the
|
|
19220
|
+
* local Anthropic↔OpenAI translation, mcp for the allowlist workers may load.
|
|
19221
|
+
*/
|
|
19203
19222
|
function currentLogDir() {
|
|
19204
19223
|
const { workers } = readWorkersSection();
|
|
19205
19224
|
return workersLogDir(workers);
|
|
@@ -19210,7 +19229,7 @@ function fail(e) {
|
|
|
19210
19229
|
process.exitCode = 1;
|
|
19211
19230
|
}
|
|
19212
19231
|
function registerWorkerCommands(workerCmd) {
|
|
19213
|
-
workerCmd.command("run").description("Run one claude-code worker through the configured provider.\nUnknown options are passed to claude verbatim (e.g. -p, --allowedTools);\n--output-format/--verbose are handled here.\n--label \"<goal>\" is optional — it is the row shown in ps / follow /\nthe status line; when absent it is derived from the prompt's first line\n(--chain/--agent derive their own instead).\n--spec <file> (or --spec -) reads the prompt from a file/stdin instead of\nan inline -p '<prompt>', which breaks on shell quoting; mutually\nexclusive with -p.\nGrant MCP tools by naming mcp__server__tool in --allowedTools (the server loads automatically);\n--chain draft,implement[,review] runs a spec-first pipeline;\n--agent <name> runs an agent definition from ~/.claude/agents.").allowUnknownOption(true).option("--provider <name>", "Provider to run on (default: active, else routing order)").option("--class <name>", "Use the provider of this class (draft, implement, review, research, spotcheck, simple, complex, image)").option("--role <name>", "Alias of --class (roles were renamed to classes)").option("--capability <name>", "Run on whichever configured provider serves this capability (see `pai worker capability`), not the active provider or --class's own one — e.g. --capability image runs an `engine: image` provider directly, POSTing a prompt and writing the PNG instead of spawning claude").option("--for <name>", "Alias of --capability").option("--out <file>", "Where an image-capability run writes its PNG (default: <logDir>/<worker-id>.png)").option("--size <WxH>", "Image size for an image-capability run, e.g. 1024x1024 (default: 1024x1024)").option("--timeout-ms <n>", "Timeout for an image-capability run's HTTP request (default: 120000)", parseIntArg).option("--chain <stages>", "Comma-separated stage classes, e.g. draft,implement or draft,implement,review").option("--agent <name>", "Run the agent definition ~/.claude/agents/<name>.md on a worker").option("--model <model>", "Override the model for this run. Headless (-p) workers default to the --class model; an interactive launch (no -p) with no --model uses the harness default model from settings.json.").option("--label <text>", "Short task label shown in ps / follow / status line (default: first line of the prompt)").option("--spec <path>", "Read the prompt from this file (or - for stdin) instead of -p; mutually exclusive with -p").option("--cwd <dir>", "Directory the worker runs in (default: this process's cwd)").option("--mcp <names>", "MCP servers/sets this worker may use (comma-separated; see `pai worker mcp`)").option("--no-pane", "Do not open a follow pane for this worker").option("--worktree", "Run in a git worktree on branch worker/<id> (default for implement/complex/plan in a git repo)").option("--no-worktree", "Run in place, no worktree").option("--print-cmd", "Print the assembled claude argv as JSON and exit, without spawning (audit tool)").option("--report <format>", "Final-report contract/parser: json or ag2 (default: ag2, or PAI_WORKER_REPORT)").option("--no-report-retry", "Skip the one bounded re-ask when the final AG2 message fails validation").argument("[args...]", "claude arguments, e.g. -p '<task>' --allowedTools 'Read,Edit,Bash'").action(async (args, opts) => {
|
|
19232
|
+
workerCmd.command("run").description("Run one claude-code worker through the configured provider.\nUnknown options are passed to claude verbatim (e.g. -p, --allowedTools);\n--output-format/--verbose are handled here.\n--label \"<goal>\" is optional — it is the row shown in ps / follow /\nthe status line; when absent it is derived from the prompt's first line\n(--chain/--agent derive their own instead).\n--spec <file> (or --spec -) reads the prompt from a file/stdin instead of\nan inline -p '<prompt>', which breaks on shell quoting; mutually\nexclusive with -p.\nGrant MCP tools by naming mcp__server__tool in --allowedTools (the server loads automatically);\n--chain draft,implement[,review] runs a spec-first pipeline;\n--agent <name> runs an agent definition from ~/.claude/agents.").allowUnknownOption(true).option("--provider <name>", "Provider to run on (default: active, else routing order)").option("--class <name>", "Use the provider of this class (draft, implement, review, research, spotcheck, simple, complex, image)").option("--role <name>", "Alias of --class (roles were renamed to classes)").option("--capability <name>", "Run on whichever configured provider serves this capability (see `pai worker capability`), not the active provider or --class's own one — e.g. --capability image runs an `engine: image` provider directly, POSTing a prompt and writing the PNG instead of spawning claude").option("--for <name>", "Alias of --capability").option("--out <file>", "Where an image-capability run writes its PNG (default: <logDir>/<worker-id>.png)").option("--size <WxH>", "Image size for an image-capability run, e.g. 1024x1024 (default: 1024x1024)").option("--timeout-ms <n>", "Timeout for an image-capability run's HTTP request (default: 120000)", parseIntArg).option("--chain <stages>", "Comma-separated stage classes, e.g. draft,implement or draft,implement,review").option("--agent <name>", "Run the agent definition ~/.claude/agents/<name>.md on a worker").option("--model <model>", "Override the model for this run. Headless (-p) workers default to the --class model; an interactive launch (no -p) with no --model uses the harness default model from settings.json.").option("--label <text>", "Short task label shown in ps / follow / status line (default: first line of the prompt)").option("--spec <path>", "Read the prompt from this file (or - for stdin) instead of -p; mutually exclusive with -p").option("--cwd <dir>", "Directory the worker runs in (default: this process's cwd)").option("--mcp <names>", "MCP servers/sets this worker may use (comma-separated; see `pai worker mcp`)").option("--no-pane", "Do not open a follow pane for this worker").option("--worktree", "Run in a git worktree on branch worker/<id> (default for implement/complex/plan in a git repo)").option("--no-worktree", "Run in place, no worktree").option("--max-minutes <n>", "Stop the run after n minutes, salvaging its work (0 = no limit; default workers.defaultMaxMinutes, 60)", parseMinutesArg).option("--deadline <HH:MM>", "Stop the run at this local time (tomorrow if already past); exclusive with --max-minutes").option("--browser", "Allow browser tools (re-enables them when workers.noBrowserByDefault is on)").option("--no-browser", "Strip --chrome and every browser MCP tool from this worker and deny them in its hooks").option("--print-cmd", "Print the assembled claude argv as JSON and exit, without spawning (audit tool)").option("--report <format>", "Final-report contract/parser: json or ag2 (default: ag2, or PAI_WORKER_REPORT)").option("--no-report-retry", "Skip the one bounded re-ask when the final AG2 message fails validation").argument("[args...]", "claude arguments, e.g. -p '<task>' --allowedTools 'Read,Edit,Bash'").action(async (args, opts) => {
|
|
19214
19233
|
try {
|
|
19215
19234
|
const className = opts.class ?? opts.role;
|
|
19216
19235
|
if (opts.report !== void 0 && opts.report !== "json" && opts.report !== "ag2") throw new Error(`--report: expected "json" or "ag2", got "${opts.report}"`);
|
|
@@ -19278,6 +19297,9 @@ function registerWorkerCommands(workerCmd) {
|
|
|
19278
19297
|
cwd: opts.cwd,
|
|
19279
19298
|
noPane: opts.pane === false,
|
|
19280
19299
|
worktreeFlag: opts.worktree,
|
|
19300
|
+
maxMinutes: opts.maxMinutes,
|
|
19301
|
+
deadline: opts.deadline,
|
|
19302
|
+
browser: opts.browser,
|
|
19281
19303
|
printCmd: opts.printCmd,
|
|
19282
19304
|
reportFormatFlag,
|
|
19283
19305
|
noReportRetry: opts.reportRetry === false,
|
|
@@ -19428,9 +19450,22 @@ function registerWorkerCommands(workerCmd) {
|
|
|
19428
19450
|
fail(e);
|
|
19429
19451
|
}
|
|
19430
19452
|
});
|
|
19431
|
-
workerCmd.command("merge <id>").description("Merge a worker's worktree branch (worker/<id>) into the original checkout, then remove the worktree and delete the branch").action((id) => {
|
|
19453
|
+
workerCmd.command("merge <id>").description("Merge a worker's worktree branch (worker/<id>) into the original checkout, then remove the worktree and delete the branch").option("--no-commit", "apply the changes as uncommitted working-tree changes; keep branch and worktree").option("--patch", "alias for --no-commit").action((id, opts) => {
|
|
19432
19454
|
try {
|
|
19433
|
-
console.log(mergeWorker(currentLogDir(), id));
|
|
19455
|
+
console.log(mergeWorker(currentLogDir(), id, { noCommit: opts.commit === false || opts.patch === true }));
|
|
19456
|
+
} catch (e) {
|
|
19457
|
+
fail(e);
|
|
19458
|
+
}
|
|
19459
|
+
});
|
|
19460
|
+
workerCmd.command("verify <id>").description("Compare a worker's committed changes with the working tree (or --against <ref>); exit 0 when every file is identical, so discarding is safe. Also reads an archived worker (refs/pai-archive/<id>)").option("--against <ref>", "compare against this ref instead of the working tree").option("--json", "print the result as JSON").action((id, opts) => {
|
|
19461
|
+
try {
|
|
19462
|
+
const r = verifyWorker(currentLogDir(), id, { against: opts.against });
|
|
19463
|
+
if (opts.json) console.log(JSON.stringify(r, null, 2));
|
|
19464
|
+
else {
|
|
19465
|
+
for (const f of r.files) console.log(`${f.state.padEnd(9)} ${f.path}`);
|
|
19466
|
+
console.log(`${r.ok ? "all identical" : "not applied"} (${r.files.length} file(s), ${r.ref} vs ${r.against})`);
|
|
19467
|
+
}
|
|
19468
|
+
if (!r.ok) process.exitCode = 1;
|
|
19434
19469
|
} catch (e) {
|
|
19435
19470
|
fail(e);
|
|
19436
19471
|
}
|
|
@@ -19670,6 +19705,11 @@ function parseIntArg(v) {
|
|
|
19670
19705
|
const n = parseInt(v, 10);
|
|
19671
19706
|
return Number.isNaN(n) ? 0 : n;
|
|
19672
19707
|
}
|
|
19708
|
+
function parseMinutesArg(v) {
|
|
19709
|
+
const n = Number(v);
|
|
19710
|
+
if (!Number.isFinite(n) || n < 0) throw new InvalidArgumentError(`expected minutes >= 0, got "${v}"`);
|
|
19711
|
+
return n;
|
|
19712
|
+
}
|
|
19673
19713
|
|
|
19674
19714
|
//#endregion
|
|
19675
19715
|
//#region src/workers/launch.ts
|
|
@@ -20352,7 +20392,7 @@ async function countVectorDbPaths(oldPaths) {
|
|
|
20352
20392
|
if (oldPaths.length === 0) return 0;
|
|
20353
20393
|
try {
|
|
20354
20394
|
const { loadConfig } = await import("./config-YinjgXEJ.mjs");
|
|
20355
|
-
const { createStorageBackend } = await import("./factory-
|
|
20395
|
+
const { createStorageBackend } = await import("./factory-DY7x73mE.mjs");
|
|
20356
20396
|
const config = loadConfig();
|
|
20357
20397
|
if (config.storageBackend !== "postgres") return 0;
|
|
20358
20398
|
const backend = await createStorageBackend(config);
|
|
@@ -20370,7 +20410,7 @@ async function updateVectorDbPaths(moves) {
|
|
|
20370
20410
|
if (moves.length === 0) return 0;
|
|
20371
20411
|
try {
|
|
20372
20412
|
const { loadConfig } = await import("./config-YinjgXEJ.mjs");
|
|
20373
|
-
const { createStorageBackend } = await import("./factory-
|
|
20413
|
+
const { createStorageBackend } = await import("./factory-DY7x73mE.mjs");
|
|
20374
20414
|
const config = loadConfig();
|
|
20375
20415
|
if (config.storageBackend !== "postgres") return 0;
|
|
20376
20416
|
const backend = await createStorageBackend(config);
|
|
@@ -20457,7 +20497,7 @@ async function displayDryRun(plans) {
|
|
|
20457
20497
|
console.log();
|
|
20458
20498
|
}
|
|
20459
20499
|
async function executeCleanup(plans, skipReindex) {
|
|
20460
|
-
const { getRegistryBackend } = await import("./factory-
|
|
20500
|
+
const { getRegistryBackend } = await import("./factory-DY7x73mE.mjs");
|
|
20461
20501
|
const registryBackend = await getRegistryBackend();
|
|
20462
20502
|
let deleted = 0;
|
|
20463
20503
|
let renamed = 0;
|
|
@@ -20654,7 +20694,7 @@ async function executeCleanup(plans, skipReindex) {
|
|
|
20654
20694
|
//#region src/cli/commands/session-cleanup/index.ts
|
|
20655
20695
|
function registerSessionCleanupCommand(sessionCmd) {
|
|
20656
20696
|
sessionCmd.command("cleanup [project-slug]").description("Clean up session notes: delete empties, auto-name unnamed, move into YYYY/MM/ hierarchy, renumber").option("--execute", "Actually perform the cleanup (default is dry-run)").option("--no-renumber", "Skip renumbering sessions after deletions").option("--no-reindex", "Skip triggering memory re-index after moves").action(async (projectSlug, opts) => {
|
|
20657
|
-
const { getRegistryBackend } = await import("./factory-
|
|
20697
|
+
const { getRegistryBackend } = await import("./factory-DY7x73mE.mjs");
|
|
20658
20698
|
const registryBackend = await getRegistryBackend();
|
|
20659
20699
|
const dryRun = !opts.execute;
|
|
20660
20700
|
const skipReindex = opts.reindex === false;
|
|
@@ -20724,7 +20764,7 @@ function finalizeNote(notePath) {
|
|
|
20724
20764
|
}
|
|
20725
20765
|
async function cmdEnd(opts) {
|
|
20726
20766
|
await cmdPause(opts);
|
|
20727
|
-
const { getRegistryBackend } = await import("./factory-
|
|
20767
|
+
const { getRegistryBackend } = await import("./factory-DY7x73mE.mjs");
|
|
20728
20768
|
const registryBackend = await getRegistryBackend();
|
|
20729
20769
|
const cwd = process.cwd();
|
|
20730
20770
|
const project = await registryBackend.findProjectByCwdPrefix(cwd);
|
|
@@ -21172,7 +21212,7 @@ async function cmdFind(query, opts) {
|
|
|
21172
21212
|
*/
|
|
21173
21213
|
async function getProjects(includeArchived) {
|
|
21174
21214
|
try {
|
|
21175
|
-
const { getRegistryBackend } = await import("./factory-
|
|
21215
|
+
const { getRegistryBackend } = await import("./factory-DY7x73mE.mjs");
|
|
21176
21216
|
const rows = await (await getRegistryBackend()).listProjectsWithSessionStats();
|
|
21177
21217
|
return includeArchived ? rows : rows.filter((p) => p.status === "active");
|
|
21178
21218
|
} catch {
|
|
@@ -21646,7 +21686,7 @@ async function cmdPick(opts = {}) {
|
|
|
21646
21686
|
const onRemove = async (rec) => {
|
|
21647
21687
|
if (!rec.slug) return false;
|
|
21648
21688
|
try {
|
|
21649
|
-
const { getRegistryBackend } = await import("./factory-
|
|
21689
|
+
const { getRegistryBackend } = await import("./factory-DY7x73mE.mjs");
|
|
21650
21690
|
const registryBackend = await getRegistryBackend();
|
|
21651
21691
|
const project = await registryBackend.getProjectBySlug(rec.slug);
|
|
21652
21692
|
if (!project || project.status !== "active") return false;
|
|
@@ -21931,4 +21971,4 @@ claude() {
|
|
|
21931
21971
|
|
|
21932
21972
|
//#endregion
|
|
21933
21973
|
export { drainStdio as n, buildProgram as t };
|
|
21934
|
-
//# sourceMappingURL=program-
|
|
21974
|
+
//# sourceMappingURL=program-DSETzrWg.mjs.map
|