@tekmidian/pai 0.71.0 → 0.71.1

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.
@@ -0,0 +1,165 @@
1
+ import { At as newWorkerId, B as readWorkersSection, _n as shortText, fn as workersLogDir, mn as isFlagToken, on as ledgerPath } from "./config-CH2Xj7BG.mjs";
2
+ import { t as appendLedger } from "./ledger-D6xicYlV.mjs";
3
+ import { r as runWorker } from "./run-DwHfR1WP.mjs";
4
+ import { existsSync, mkdirSync, readFileSync } from "node:fs";
5
+ import { join } from "node:path";
6
+
7
+ //#region src/workers/chain.ts
8
+ /**
9
+ * chain.ts — draft-then-implement chains: `--chain draft,implement[,review]`.
10
+ *
11
+ * The chain runs each stage as its own worker (own id, own pane, `parent` set
12
+ * to the chain id), so `ps` shows the chain as a tree and every stage can be
13
+ * followed, replayed and said to like any other worker:
14
+ *
15
+ * - draft turns the operator's brief into a full spec file under
16
+ * <logDir>/specs/<chain id>.md (goal, constraints, files likely
17
+ * touched, acceptance checks, verification commands);
18
+ * - any other stage (implement, plan, …) runs with that spec as its prompt
19
+ * and the original brief attached;
20
+ * - review reads the spec and the working-tree diff and produces the
21
+ * structured report.
22
+ *
23
+ * A stage that fails (or a draft that produces no spec file) stops the chain;
24
+ * the caller then writes the spec itself and re-runs without the draft stage.
25
+ */
26
+ /** Where a chain's spec file lives: <logDir>/specs/<chain id>.md. */
27
+ function specPathFor(logDir, chainId) {
28
+ return join(logDir, "specs", `${chainId}.md`);
29
+ }
30
+ /**
31
+ * Replace the caller's -p value with `prompt`, dropping every existing
32
+ * -p/--print pair first (two -p flags on one claude command line are an error,
33
+ * so the chain must never leave the brief in place when swapping prompts).
34
+ */
35
+ function swapPromptArg(claudeArgs, prompt) {
36
+ const out = [];
37
+ for (let i = 0; i < claudeArgs.length; i++) {
38
+ const a = claudeArgs[i];
39
+ if (a === "-p" || a === "--print") {
40
+ if (i + 1 < claudeArgs.length && !isFlagToken(claudeArgs[i + 1])) i += 1;
41
+ continue;
42
+ }
43
+ out.push(a);
44
+ }
45
+ out.push("-p", prompt);
46
+ return out;
47
+ }
48
+ function draftPrompt(brief, specPath) {
49
+ return [
50
+ "You are the DRAFT stage of a worker chain. Turn the operator's brief below into a full implementation spec and write it to",
51
+ specPath,
52
+ "with the Write tool.",
53
+ "",
54
+ "Use exactly these five sections as Markdown headings:",
55
+ "# Goal",
56
+ "# Constraints",
57
+ "# Files likely touched",
58
+ "# Acceptance checks",
59
+ "# Verification commands",
60
+ "",
61
+ "Read the repository first (Glob/Grep/Read) so the spec names real files and real commands. Do not implement anything.",
62
+ "",
63
+ "## Operator brief",
64
+ "",
65
+ brief
66
+ ].join("\n");
67
+ }
68
+ function implementPrompt(brief, specPath, spec) {
69
+ return [
70
+ ...spec ? [
71
+ "You are the IMPLEMENT stage of a worker chain. The draft stage wrote the spec below (also at " + specPath + "). Implement it exactly, then run the spec's verification commands before finishing.",
72
+ "",
73
+ "## Spec",
74
+ "",
75
+ spec
76
+ ] : ["Implement the operator's brief below."],
77
+ "",
78
+ "## Operator brief",
79
+ "",
80
+ brief
81
+ ].join("\n");
82
+ }
83
+ function reviewPrompt(brief, specPath, spec) {
84
+ return [
85
+ "You are the REVIEW stage of a worker chain. The implement stage just ran. Read the repository's diff (run `git diff` and `git status`; use `git diff --stat` for the overview) and check it against the spec's acceptance checks and verification commands — run the checks when they are cheap. Do not fix anything you find; report it.",
86
+ ...spec ? [
87
+ "",
88
+ "## Spec (also at " + specPath + ")",
89
+ "",
90
+ spec
91
+ ] : [],
92
+ "",
93
+ "## Operator brief",
94
+ "",
95
+ brief
96
+ ].join("\n");
97
+ }
98
+ /** Run a chain of stages; returns the exit code of the first failed stage, 0 when all pass. */
99
+ async function runChain(opts, deps = {}) {
100
+ const stages = opts.stages.map((s) => s.trim()).filter(Boolean);
101
+ if (!stages.length) throw new Error("--chain needs at least one class, e.g. --chain draft,implement");
102
+ const runStage = deps.runStage ?? runWorker;
103
+ const logDir = deps.logDir ?? workersLogDir(readWorkersSection().workers);
104
+ const chainId = newWorkerId();
105
+ const specPath = specPathFor(logDir, chainId);
106
+ mkdirSync(join(logDir, "specs"), { recursive: true });
107
+ const baseLabel = opts.label ?? shortText(opts.brief, 40);
108
+ appendLedger(ledgerPath(logDir), "WORKER-CHAIN", {
109
+ chain: chainId,
110
+ stages: stages.join(","),
111
+ label: baseLabel
112
+ });
113
+ opts.onChainStart?.(chainId);
114
+ let spec = null;
115
+ for (let i = 0; i < stages.length; i++) {
116
+ const stage = stages[i];
117
+ if (stage === "draft") spec = null;
118
+ else if (spec === null && existsSync(specPath)) spec = readFileSync(specPath, "utf8");
119
+ const prompt = stage === "draft" ? draftPrompt(opts.brief, specPath) : stage === "review" ? reviewPrompt(opts.brief, spec ? specPath : null, spec) : implementPrompt(opts.brief, spec ? specPath : null, spec);
120
+ process.stderr.write(`chain ${chainId}: stage ${i + 1}/${stages.length} ${stage} (spec: ${specPath})\n`);
121
+ const rc = await runStage({
122
+ className: opts.className ?? stage,
123
+ providerFlag: opts.providerFlag,
124
+ modelFlag: opts.modelFlag,
125
+ label: `${baseLabel} · ${stage}`,
126
+ noPane: opts.noPane,
127
+ mcpFlag: opts.mcpFlag,
128
+ specPath: opts.specPath,
129
+ claudeArgs: swapPromptArg(opts.claudeArgs, prompt),
130
+ cwd: opts.cwd,
131
+ parent: chainId,
132
+ stage,
133
+ quiet: opts.quiet
134
+ });
135
+ if (stage === "draft") {
136
+ if (!existsSync(specPath)) {
137
+ process.stderr.write(`chain ${chainId}: draft stage produced no spec at ${specPath} — stopping. Write the spec yourself and re-run without the draft stage.\n`);
138
+ appendLedger(ledgerPath(logDir), "WORKER-CHAIN-END", {
139
+ chain: chainId,
140
+ rc: rc !== 0 ? rc : 1,
141
+ failed: "draft"
142
+ });
143
+ return rc !== 0 ? rc : 1;
144
+ }
145
+ spec = readFileSync(specPath, "utf8");
146
+ }
147
+ if (rc !== 0) {
148
+ appendLedger(ledgerPath(logDir), "WORKER-CHAIN-END", {
149
+ chain: chainId,
150
+ rc,
151
+ failed: stage
152
+ });
153
+ return rc;
154
+ }
155
+ }
156
+ appendLedger(ledgerPath(logDir), "WORKER-CHAIN-END", {
157
+ chain: chainId,
158
+ rc: 0
159
+ });
160
+ return 0;
161
+ }
162
+
163
+ //#endregion
164
+ export { swapPromptArg as n, runChain as t };
165
+ //# sourceMappingURL=chain-CgTRLiOk.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chain-CgTRLiOk.mjs","names":[],"sources":["../src/workers/chain.ts"],"sourcesContent":["/**\n * chain.ts — draft-then-implement chains: `--chain draft,implement[,review]`.\n *\n * The chain runs each stage as its own worker (own id, own pane, `parent` set\n * to the chain id), so `ps` shows the chain as a tree and every stage can be\n * followed, replayed and said to like any other worker:\n *\n * - draft turns the operator's brief into a full spec file under\n * <logDir>/specs/<chain id>.md (goal, constraints, files likely\n * touched, acceptance checks, verification commands);\n * - any other stage (implement, plan, …) runs with that spec as its prompt\n * and the original brief attached;\n * - review reads the spec and the working-tree diff and produces the\n * structured report.\n *\n * A stage that fails (or a draft that produces no spec file) stops the chain;\n * the caller then writes the spec itself and re-runs without the draft stage.\n */\n\nimport { existsSync, mkdirSync, readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { readWorkersSection } from \"./config.js\";\nimport { appendLedger } from \"./ledger.js\";\nimport { ledgerPath, workersLogDir } from \"./paths.js\";\nimport { newWorkerId } from \"./status.js\";\nimport { isFlagToken, shortText } from \"./args.js\";\nimport { runWorker, type RunOptions } from \"./run.js\";\n\n/** Where a chain's spec file lives: <logDir>/specs/<chain id>.md. */\nexport function specPathFor(logDir: string, chainId: string): string {\n return join(logDir, \"specs\", `${chainId}.md`);\n}\n\n/**\n * Replace the caller's -p value with `prompt`, dropping every existing\n * -p/--print pair first (two -p flags on one claude command line are an error,\n * so the chain must never leave the brief in place when swapping prompts).\n */\nexport function swapPromptArg(claudeArgs: string[], prompt: string): string[] {\n const out: string[] = [];\n for (let i = 0; i < claudeArgs.length; i++) {\n const a = claudeArgs[i];\n if (a === \"-p\" || a === \"--print\") {\n if (i + 1 < claudeArgs.length && !isFlagToken(claudeArgs[i + 1])) i += 1;\n continue;\n }\n out.push(a);\n }\n out.push(\"-p\", prompt);\n return out;\n}\n\nexport function draftPrompt(brief: string, specPath: string): string {\n return [\n \"You are the DRAFT stage of a worker chain. Turn the operator's brief below into a full implementation spec and write it to\",\n specPath,\n \"with the Write tool.\",\n \"\",\n \"Use exactly these five sections as Markdown headings:\",\n \"# Goal\",\n \"# Constraints\",\n \"# Files likely touched\",\n \"# Acceptance checks\",\n \"# Verification commands\",\n \"\",\n \"Read the repository first (Glob/Grep/Read) so the spec names real files and real commands. Do not implement anything.\",\n \"\",\n \"## Operator brief\",\n \"\",\n brief,\n ].join(\"\\n\");\n}\n\nexport function implementPrompt(brief: string, specPath: string | null, spec: string | null): string {\n const head = spec\n ? [\n \"You are the IMPLEMENT stage of a worker chain. The draft stage wrote the spec below (also at \" +\n specPath +\n \"). Implement it exactly, then run the spec's verification commands before finishing.\",\n \"\",\n \"## Spec\",\n \"\",\n spec,\n ]\n : [\"Implement the operator's brief below.\"];\n return [...head, \"\", \"## Operator brief\", \"\", brief].join(\"\\n\");\n}\n\nexport function reviewPrompt(brief: string, specPath: string | null, spec: string | null): string {\n const specPart = spec\n ? [\n \"\",\n \"## Spec (also at \" + specPath + \")\",\n \"\",\n spec,\n ]\n : [];\n return [\n \"You are the REVIEW stage of a worker chain. The implement stage just ran. Read the repository's diff (run `git diff` and `git status`; use `git diff --stat` for the overview) and check it against the spec's acceptance checks and verification commands — run the checks when they are cheap. Do not fix anything you find; report it.\",\n ...specPart,\n \"\",\n \"## Operator brief\",\n \"\",\n brief,\n ].join(\"\\n\");\n}\n\nexport interface ChainOptions {\n /** Class names, run in order: e.g. [\"draft\", \"implement\", \"review\"]. */\n stages: string[];\n /** Overrides the class of every stage when given (--class with --chain). */\n className?: string;\n providerFlag?: string;\n modelFlag?: string;\n label?: string;\n noPane?: boolean;\n mcpFlag?: string;\n /** --spec value, resolved for display/recording (\"-\" for stdin). */\n specPath?: string;\n /** The operator's brief — the -p value of the run. */\n brief: string;\n /** The caller's claude args (allowedTools etc.); the -p value is swapped. */\n claudeArgs: string[];\n cwd?: string;\n /** Internal: notified with the chain id once it exists (worker_run uses it). */\n onChainStart?: (chainId: string) => void;\n /** Internal: suppress result printing (the MCP shim's stdout is the RPC channel). */\n quiet?: boolean;\n}\n\nexport interface ChainDeps {\n /** Stage runner; tests inject a mock, production uses runWorker. */\n runStage?: (opts: RunOptions) => Promise<number>;\n /** logDir override for tests; default: the configured workers logDir. */\n logDir?: string;\n}\n\n/** Run a chain of stages; returns the exit code of the first failed stage, 0 when all pass. */\nexport async function runChain(opts: ChainOptions, deps: ChainDeps = {}): Promise<number> {\n const stages = opts.stages.map((s) => s.trim()).filter(Boolean);\n if (!stages.length) throw new Error(\"--chain needs at least one class, e.g. --chain draft,implement\");\n const runStage = deps.runStage ?? runWorker;\n const logDir = deps.logDir ?? workersLogDir(readWorkersSection().workers);\n const chainId = newWorkerId();\n const specPath = specPathFor(logDir, chainId);\n mkdirSync(join(logDir, \"specs\"), { recursive: true }); // the draft stage writes into it\n const baseLabel = opts.label ?? shortText(opts.brief, 40);\n\n appendLedger(ledgerPath(logDir), \"WORKER-CHAIN\", {\n chain: chainId,\n stages: stages.join(\",\"),\n label: baseLabel,\n });\n opts.onChainStart?.(chainId);\n\n let spec: string | null = null;\n for (let i = 0; i < stages.length; i++) {\n const stage = stages[i];\n if (stage === \"draft\") {\n spec = null; // a chain may legally start over; the draft rewrites it\n } else if (spec === null && existsSync(specPath)) {\n spec = readFileSync(specPath, \"utf8\");\n }\n const prompt =\n stage === \"draft\"\n ? draftPrompt(opts.brief, specPath)\n : stage === \"review\"\n ? reviewPrompt(opts.brief, spec ? specPath : null, spec)\n : implementPrompt(opts.brief, spec ? specPath : null, spec);\n process.stderr.write(\n `chain ${chainId}: stage ${i + 1}/${stages.length} ${stage} (spec: ${specPath})\\n`\n );\n const rc = await runStage({\n className: opts.className ?? stage,\n providerFlag: opts.providerFlag,\n modelFlag: opts.modelFlag,\n label: `${baseLabel} · ${stage}`,\n noPane: opts.noPane,\n mcpFlag: opts.mcpFlag,\n specPath: opts.specPath,\n claudeArgs: swapPromptArg(opts.claudeArgs, prompt),\n cwd: opts.cwd,\n parent: chainId,\n stage,\n quiet: opts.quiet,\n });\n if (stage === \"draft\") {\n if (!existsSync(specPath)) {\n process.stderr.write(\n `chain ${chainId}: draft stage produced no spec at ${specPath} — stopping. ` +\n `Write the spec yourself and re-run without the draft stage.\\n`\n );\n appendLedger(ledgerPath(logDir), \"WORKER-CHAIN-END\", {\n chain: chainId,\n rc: rc !== 0 ? rc : 1,\n failed: \"draft\",\n });\n return rc !== 0 ? rc : 1;\n }\n spec = readFileSync(specPath, \"utf8\");\n }\n if (rc !== 0) {\n appendLedger(ledgerPath(logDir), \"WORKER-CHAIN-END\", {\n chain: chainId,\n rc,\n failed: stage,\n });\n return rc;\n }\n }\n appendLedger(ledgerPath(logDir), \"WORKER-CHAIN-END\", { chain: chainId, rc: 0 });\n return 0;\n}\n"],"mappings":"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"}
@@ -33,14 +33,14 @@ import { a as providerResumePlan, n as launchInDir, o as restoreTopLevel, r as l
33
33
  import { _ as setupsTable, a as lastSetup, m as rootCommand } from "../root-DEqt0gqK.mjs";
34
34
  import { n as fetchLiveSessions, r as sendToSession, t as callAiBroker } from "../aibroker-client-eRILToKG.mjs";
35
35
  import { a as resolveSessionByNameOrId, o as scanCacheFilePath, r as migrateSessionScanCache, s as scanSessions, t as fmtAge } from "../session-scan-BZlFbryO.mjs";
36
- import { $ as realPaneOps, A as finishDetached, B as realRunnerDeps, Bt as readRunLock, C as onBattery, Ct as PlanError, D as writePolicy, Dt as runLogPath, E as routeRun, Et as loadPlan, F as dirtyPaths, Gt as routerPidFile, Jt as spawnRouter, Kt as routerRunningPid, M as runMessenger, Mt as loadPlanStatuses, N as startDetached, O as clickrControlsArgv, Ot as PlanTracker, Pt as planRows, R as openPlanPane, Rt as planLockPath, S as findLocal, T as readPolicy, Ut as probeRouter, Wt as routerLogFile, X as openVerifiedPane, _t as renderStatus, a as usageContextTokens, at as usageJson, b as POLICY_MODES, bt as runExitCode, ct as QueueReporter, dt as blockedMessage, et as resolveHostSession, gt as renderSchedule, ht as readRunLog, i as testProvider, it as transcriptUsage, j as reportOrigin, k as markControlsHeld, mt as planStopPath, nt as priceTableText, o as pinNotices, pt as planStatus, rt as renderUsage, s as projectLaunchConfig, st as PlanReporter, v as sessionWorkersLine, vt as requestPlanStop, w as parseDuration, wt as dirtyConflicts, x as clearPolicy, xt as runPlan, yt as resumeState } from "../run-CNnGsKVE.mjs";
36
+ import { $ as realPaneOps, A as finishDetached, B as realRunnerDeps, Bt as readRunLock, C as onBattery, Ct as PlanError, D as writePolicy, Dt as runLogPath, E as routeRun, Et as loadPlan, F as dirtyPaths, Gt as routerPidFile, Jt as spawnRouter, Kt as routerRunningPid, M as runMessenger, Mt as loadPlanStatuses, N as startDetached, O as clickrControlsArgv, Ot as PlanTracker, Pt as planRows, R as openPlanPane, Rt as planLockPath, S as findLocal, T as readPolicy, Ut as probeRouter, Wt as routerLogFile, X as openVerifiedPane, _t as renderStatus, a as usageContextTokens, at as usageJson, b as POLICY_MODES, bt as runExitCode, ct as QueueReporter, dt as blockedMessage, et as resolveHostSession, gt as renderSchedule, ht as readRunLog, i as testProvider, it as transcriptUsage, j as reportOrigin, k as markControlsHeld, mt as planStopPath, nt as priceTableText, o as pinNotices, pt as planStatus, rt as renderUsage, s as projectLaunchConfig, st as PlanReporter, v as sessionWorkersLine, vt as requestPlanStop, w as parseDuration, wt as dirtyConflicts, x as clearPolicy, xt as runPlan, yt as resumeState } from "../run-DwHfR1WP.mjs";
37
37
  import { _ as buildSlots, a as buildNext, b as testSlots, c as getTicket, d as patchTicket, g as tryStart, h as ticketKind, i as buildLogPath, l as listBuilds, m as renderBuildQueue, o as buildsDir, p as removeTicket, s as enqueue, u as listBuildsSync, v as poolSlots, y as slotsFor } from "../kill-tree-LL3IeMI2.mjs";
38
38
  import "../operator-CUHD_PDR.mjs";
39
- import { d as readPoolMetrics, f as readPoolState, g as expandMcpNames, h as describeMcp, i as poolHostAlive, l as poolSettings, m as inputSideTokens, n as poolCarry, o as poolMetricsPath, p as warmOrCold } from "../pool-CUFmhtZv.mjs";
40
- import "../chain-BaLnXC6r.mjs";
41
- import { A as workerCommand, C as setConfigValueOp, D as fallbackStatus, E as fallbackOn, H as setClass, J as unsetClass, K as setWorkersEnabled, L as describeProviders, N as addProvider, O as fallbackStatusText, P as classTargetText, S as listConfigOp, T as fallbackOff, U as setProviderCap, W as setProviderEnabled, X as useProvider, Y as updateProvider, _ as issueClaims, a as branchDiff, b as formatConfigGetOutput, c as runQueue, d as loadSettings, f as move, g as issueClaim, h as renderReview, i as projectChecks, l as QueueStore, m as renderList, n as initProject, o as realQueueDeps, p as queueStatePath, r as isGitProject, s as acceptItems, t as formatCheck, u as again, v as issueStale, w as unsetConfigValueOp, x as getConfigValueOp, y as MainConfigOpsError, z as removeProvider } from "../project-setup-TrN4hlvg.mjs";
42
- import { d as loadPaneRunStatuses, f as paneRunRows, i as readAudit, m as runInPane, s as PANE_RUN_ENV } from "../pane-audit-C-ZBEKzI.mjs";
43
- import { At as DEFAULT_EMBED_MAX_MINUTES, Bt as applyContinue, C as migrateSummaryCooldowns, Ct as describeQuiet, Ft as resolveDaemonPid, Ht as findNotesDir$1, Lt as readContextHandoverCache, Mt as formatEmbedStatus, Nt as liveYieldCheck, Ot as writeQuiet, Tt as readQuiet, Ut as readBodyFile, Vt as findLatestNote, _t as loadSessionKeepaliveState, bt as parseSessionUsage, ft as OBSIDIAN_DISABLED_MESSAGE, gt as migrateIdentityFile, i as reexecBackground, jt as EMBED_PASS_BATCH_SIZE, kt as DEFAULT_EMBED_MAX_LOAD, o as backfillKgFromNotes, pt as obsidianEnabled, s as migrateKgBackfillState, v as migrateWorkQueue, wt as nextOccurrence, xt as totalUsageTokens, yt as sessionKeepaliveLedgerSummary, zt as appendCheckpointToNote } from "../indexer-backend-DMSUiDwF.mjs";
39
+ import { _ as describeMcp, c as poolMetricsPath, d as poolSettings, g as inputSideTokens, h as warmOrCold, i as poolCarry, m as readPoolState, o as poolHostAlive, p as readPoolMetrics, v as expandMcpNames } from "../pool-CRpTNNWq.mjs";
40
+ import "../chain-CgTRLiOk.mjs";
41
+ import { A as workerCommand, C as setConfigValueOp, D as fallbackStatus, E as fallbackOn, H as setClass, J as unsetClass, K as setWorkersEnabled, L as describeProviders, N as addProvider, O as fallbackStatusText, P as classTargetText, S as listConfigOp, T as fallbackOff, U as setProviderCap, W as setProviderEnabled, X as useProvider, Y as updateProvider, _ as issueClaims, a as branchDiff, b as formatConfigGetOutput, c as runQueue, d as loadSettings, f as move, g as issueClaim, h as renderReview, i as projectChecks, l as QueueStore, m as renderList, n as initProject, o as realQueueDeps, p as queueStatePath, r as isGitProject, s as acceptItems, t as formatCheck, u as again, v as issueStale, w as unsetConfigValueOp, x as getConfigValueOp, y as MainConfigOpsError, z as removeProvider } from "../project-setup-s3eywtRb.mjs";
42
+ import { d as loadPaneRunStatuses, f as paneRunRows, i as readAudit, m as runInPane, s as PANE_RUN_ENV } from "../pane-audit-C1QnR1vx.mjs";
43
+ import { At as DEFAULT_EMBED_MAX_MINUTES, Bt as applyContinue, C as migrateSummaryCooldowns, Ct as describeQuiet, Ft as resolveDaemonPid, Ht as findNotesDir$1, Lt as readContextHandoverCache, Mt as formatEmbedStatus, Nt as liveYieldCheck, Ot as writeQuiet, Tt as readQuiet, Ut as readBodyFile, Vt as findLatestNote, _t as loadSessionKeepaliveState, bt as parseSessionUsage, ft as OBSIDIAN_DISABLED_MESSAGE, gt as migrateIdentityFile, i as reexecBackground, jt as EMBED_PASS_BATCH_SIZE, kt as DEFAULT_EMBED_MAX_LOAD, o as backfillKgFromNotes, pt as obsidianEnabled, s as migrateKgBackfillState, v as migrateWorkQueue, wt as nextOccurrence, xt as totalUsageTokens, yt as sessionKeepaliveLedgerSummary, zt as appendCheckpointToNote } from "../indexer-backend-1tkR2y1-.mjs";
44
44
  import { n as PaiClient } from "../ipc-client-FcavY9Be.mjs";
45
45
  import { n as queriesDirPath, t as migrateQueriesDir } from "../query-feedback-CfNEtHf9.mjs";
46
46
  import { appendFileSync, chmodSync, closeSync, copyFileSync, cpSync, createReadStream, createWriteStream, existsSync, fstatSync, lstatSync, mkdirSync, openSync, readFileSync, readSync, readdirSync, readlinkSync, realpathSync, renameSync, rmSync, rmdirSync, statSync, symlinkSync, unlinkSync, writeFileSync } from "node:fs";
@@ -2155,7 +2155,7 @@ const workerPoolCommand = {
2155
2155
  async run(ctx) {
2156
2156
  try {
2157
2157
  const action = ctx.args.ACTION;
2158
- const { poolOn, poolOff, poolStatusText } = await import("../pool-cli-Bq2hR8CD.mjs");
2158
+ const { poolOn, poolOff, poolStatusText } = await import("../pool-cli-Dt62g-Sd.mjs");
2159
2159
  if (action === void 0 || action === "status") return void out$4(await poolStatusText(logDir()));
2160
2160
  if (action === "on") return void (await poolOn(logDir())).forEach((l) => out$4(l));
2161
2161
  if (action === "off") return void (await poolOff(logDir())).forEach((l) => out$4(l));
@@ -10898,7 +10898,7 @@ function cmdLogs(opts) {
10898
10898
  return 0;
10899
10899
  }
10900
10900
  async function daemonServeCmd() {
10901
- const { serve } = await import("../daemon-CQvQXiC1.mjs");
10901
+ const { serve } = await import("../daemon-RceHUATC.mjs");
10902
10902
  const { loadConfig: lc, ensureConfigDir } = await import("../config-j5GisZos.mjs");
10903
10903
  ensureConfigDir();
10904
10904
  await serve(lc());
@@ -25,14 +25,14 @@ import "../router-B5bmAnqL.mjs";
25
25
  import "../detect-DuuSBvSD.mjs";
26
26
  import "../scan-tu3Fb-KW.mjs";
27
27
  import "../aibroker-client-eRILToKG.mjs";
28
- import "../run-CNnGsKVE.mjs";
28
+ import "../run-DwHfR1WP.mjs";
29
29
  import "../kill-tree-LL3IeMI2.mjs";
30
30
  import "../operator-CUHD_PDR.mjs";
31
- import "../pool-CUFmhtZv.mjs";
32
- import "../pane-audit-C-ZBEKzI.mjs";
33
- import "../indexer-backend-DMSUiDwF.mjs";
31
+ import "../pool-CRpTNNWq.mjs";
32
+ import "../pane-audit-C1QnR1vx.mjs";
33
+ import "../indexer-backend-1tkR2y1-.mjs";
34
34
  import { n as PaiClient } from "../ipc-client-FcavY9Be.mjs";
35
- import { t as serve } from "../daemon-ByJ6iAp6.mjs";
35
+ import { t as serve } from "../daemon-DTkwXkGA.mjs";
36
36
  import "../auto-route-B8m3WuW9.mjs";
37
37
  import "../zettelkasten-IFL_ru4W.mjs";
38
38