@tekmidian/pai 1.0.0 → 1.0.3
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/.claude-plugin/plugin.json +1 -1
- package/README.md +67 -5
- package/dist/aibroker-client-BxzeEHPF.mjs +3 -0
- package/dist/{aibroker-client-CXEYBzbf.mjs → aibroker-client-CQPGqLxL.mjs} +1 -1
- package/dist/atomic-file-BorMa4T3.mjs +21 -0
- package/dist/{auto-route-D5SXrMpB.mjs → auto-route-B7Yu6Uam.mjs} +3 -3
- package/dist/auto-route-CjjQqU1o.mjs +11 -0
- package/dist/budget-Dod6rnA9.mjs +15 -0
- package/dist/{caller-identity-CVTuiLSs.mjs → caller-identity-yLFb7CKq.mjs} +6 -5
- package/dist/{capacity-DaXrVj3J.mjs → capacity-DEveQdFV.mjs} +3 -3
- package/dist/{chain-BcQlIlEd.mjs → chain-7n9Gx56r.mjs} +5 -5
- package/dist/cli/index.mjs +1628 -370
- package/dist/{cockpit-actions-ODmt8yF9.mjs → cockpit-actions-BBHeyEZI.mjs} +84 -42
- package/dist/cockpit-actions-DR9X514g.mjs +20 -0
- package/dist/cockpit-memory--dnShXBA.mjs +20 -0
- package/dist/{config-BSXKyeJ1.mjs → config-Bu1_vbY8.mjs} +42 -3
- package/dist/{config-B955yYmo.mjs → config-Cxi-aBf4.mjs} +2 -2
- package/dist/{config-TaWmdTLx.mjs → config-DtENJ6cL.mjs} +1 -1
- package/dist/{config-D5chi2LO.mjs → config-XpZWOYOG.mjs} +2 -2
- package/dist/{controls-BGkK_Bdi.mjs → controls-CPoeudou.mjs} +37 -22
- package/dist/daemon/index.mjs +43 -42
- package/dist/daemon-DKdBNKfa.mjs +45 -0
- package/dist/{daemon-CorGh6Ub.mjs → daemon-DPAo6WTa.mjs} +103 -55
- package/dist/daemon-mcp/index.mjs +40 -39
- package/dist/{define-DGFu-sCf.mjs → define-CjJsmq-6.mjs} +1 -1
- package/dist/{detect-C1d5cUkT.mjs → detect-9CZNO0yf.mjs} +2 -2
- package/dist/detect-D1ziFFfA.mjs +10 -0
- package/dist/{embed-pass-CeQD8kRE.mjs → embed-pass-DIWjA68P.mjs} +5 -5
- package/dist/{embedding-gate-BHuBsgHD.mjs → embedding-gate-6rZrWRXa.mjs} +5 -5
- package/dist/{embedding-gate-Z7CJSOJk.mjs → embedding-gate-Cnk4YCyX.mjs} +3 -3
- package/dist/{embeddings-D4t6L-EH.mjs → embeddings-BVq3esBF.mjs} +1 -1
- package/dist/{embeddings-OF9Pt4by.mjs → embeddings-CIkJBKd-.mjs} +1 -1
- package/dist/{endreason-x1KOSrcO.mjs → endreason-C577xIQz.mjs} +7 -6
- package/dist/{env-DArqGq-Z.mjs → env-BE8mrsxr.mjs} +1 -1
- package/dist/factory-Bsib-qDG.mjs +9 -0
- package/dist/{factory-BtjbQ0np.mjs → factory-DjAAsqr_.mjs} +15 -13
- package/dist/{fallback-BIyEpPsQ.mjs → fallback-DFlItw1Z.mjs} +5 -5
- package/dist/{fmt-age-BiSHrTKN.mjs → fmt-age-ByDkvkoU.mjs} +1 -1
- package/dist/{health-C6jZWvRG.mjs → health-Dnym-qcT.mjs} +4 -4
- package/dist/{helpers-DFmYRCOa.mjs → helpers-BD6V-p9w.mjs} +2 -2
- package/dist/helpers-CMGjy_0N.mjs +10 -0
- package/dist/{helpers-CJpb_MNB.mjs → helpers-CRuBUas3.mjs} +87 -38
- package/dist/hooks/capture-all-events.mjs +52 -11
- package/dist/hooks/capture-session-summary.mjs +64 -47
- package/dist/hooks/capture-tool-output.mjs +49 -8
- package/dist/hooks/context-compression-hook.mjs +30 -10
- package/dist/hooks/initialize-session.mjs +1 -0
- package/dist/hooks/load-core-context.mjs +1 -1
- package/dist/hooks/load-project-context.mjs +32 -29
- package/dist/hooks/security-validator.mjs +45 -13
- package/dist/hooks/stop-hook.mjs +54 -16
- package/dist/hooks/supervision-banner.mjs +9 -0
- package/dist/hooks/sync-todo-to-md.mjs +147 -113
- package/dist/hooks/worker-edit-repair.mjs +2 -1
- package/dist/hooks/worker-guard.mjs +40 -16
- package/dist/hooks/worker-note.mjs +12 -5
- package/dist/hooks/worker-path-repair.mjs +1 -1
- package/dist/hooks/worker-pool-host.mjs +329 -231
- package/dist/hooks/worker-status-line.mjs +195 -114
- package/dist/index.d.mts +18 -0
- package/dist/index.mjs +12 -12
- package/dist/{indexer-backend-BM2CUSu8.mjs → indexer-backend-Cll7le4P.mjs} +149 -96
- package/dist/{ipc-client-BMqWw_gv.mjs → ipc-client-CaiGJnSM.mjs} +1 -1
- package/dist/{ipc-client-YYDD6zzU.mjs → ipc-client-ZRmDKd5Z.mjs} +1 -1
- package/dist/kill-tree-BG7dRVtp.mjs +10 -0
- package/dist/{kill-tree-BjYz5BxK.mjs → kill-tree-EWYaEk5v.mjs} +8 -8
- package/dist/{launch-CLp0OJxV.mjs → launch-CXVlZjHt.mjs} +8 -8
- package/dist/{launch-DgqQdAjI.mjs → launch-Jh5NVeNe.mjs} +3 -3
- package/dist/local-candidate-DLdwQt0s.mjs +112 -0
- package/dist/local-instances-DOxSgT_L.mjs +210 -0
- package/dist/local-instances-ZeRkkuS5.mjs +6 -0
- package/dist/{local-tiers-DPZYqv9m.mjs → local-tiers-BE4jGaMa.mjs} +2 -2
- package/dist/{local-tiers-DnBIAkbK.mjs → local-tiers-DNMI5W86.mjs} +3 -3
- package/dist/{main-config-ops-C0SflOWk.mjs → main-config-ops-BEMpuhDz.mjs} +3 -3
- package/dist/{main-resolver-DVPpSWVy.mjs → main-resolver-3Ns1HPmS.mjs} +18 -17
- package/dist/{migrate-BUJHadA8.mjs → migrate-DrA_OwlZ.mjs} +45 -14
- package/dist/min-max-DrSRUaWQ.mjs +16 -0
- package/dist/{model-inventory-Dasber3S.mjs → model-inventory-BFVSNFT3.mjs} +13 -12
- package/dist/{models-add-Bt7aUHDs.mjs → models-add-C1QIc1DA.mjs} +39 -38
- package/dist/operator-BTqvTIc8.mjs +7 -0
- package/dist/{operator-DZxcP-g8.mjs → operator-CyuB3aVw.mjs} +3 -3
- package/dist/{pai-marker-kIYuNt3c.mjs → pai-marker-BcZyJguM.mjs} +7 -6
- package/dist/{pane-audit-OGYrOAik.mjs → pane-audit-DKQt71s4.mjs} +7 -7
- package/dist/{paths-DoRuFc60.mjs → paths-CFHTloSe.mjs} +3 -3
- package/dist/{paths-DoIyRnhx.mjs → paths-CHifubDh.mjs} +3 -3
- package/dist/{planner-DLGOYlVb.mjs → planner-BmFACdLa.mjs} +31 -30
- package/dist/{pool-CZ5MZaXg.mjs → pool-Dh-q3iJi.mjs} +45 -6
- package/dist/{pool-cli-BxNSPzzY.mjs → pool-cli-BggU8GRp.mjs} +5 -5
- package/dist/{pool-cli-CbJfl37y.mjs → pool-cli-DQ6OzRy2.mjs} +6 -6
- package/dist/postgres-BdBNkL_l.mjs +7 -0
- package/dist/{postgres-CDnd_k5f.mjs → postgres-C6ti4haA.mjs} +55 -34
- package/dist/{project-setup-DM4npnL3.mjs → project-setup-jvfONJTQ.mjs} +131 -74
- package/dist/providers-BeDiVEb-.mjs +16 -0
- package/dist/{providers-UsKtLcUR.mjs → providers-CblTFrhz.mjs} +6 -6
- package/dist/{query-feedback-I-txSnld.mjs → query-feedback-BRfPtqki.mjs} +2 -2
- package/dist/registrable-BzH4TObg.mjs +9 -0
- package/dist/{registrable-LrRIVYQc.mjs → registrable-DpyTtajg.mjs} +4 -4
- package/dist/{render-BDbb4CF-.mjs → render-BYmQkuLd.mjs} +8 -8
- package/dist/render-CoMvwMPs.mjs +13 -0
- package/dist/{reranker-B4r4vykM.mjs → reranker-8g6xMwP7.mjs} +1 -1
- package/dist/{reranker-DxxMCtA0.mjs → reranker-CqCbpGnX.mjs} +1 -1
- package/dist/root-FtJsxYnm.mjs +36 -0
- package/dist/{root-BMeJuHOb.mjs → root-Xglu0OPD.mjs} +11 -11
- package/dist/route-table-B7zpoypi.mjs +15 -0
- package/dist/{router-L8Nu-OHF.mjs → router-CQSc3lk3.mjs} +17 -7
- package/dist/{router-D6Ec6Fid.mjs → router-DwHJRgG9.mjs} +1 -1
- package/dist/{routing-CUyiglfu.mjs → routing-BAAST9vT.mjs} +27 -308
- package/dist/{routing-ZuGlc0ge.mjs → routing-CENt4HH1.mjs} +13 -12
- package/dist/{run-ulAi5dFD.mjs → run-CSC7mgPf.mjs} +35 -33
- package/dist/{scan-B7I0gPe-.mjs → scan-C_Y5W9py.mjs} +6 -6
- package/dist/{local-candidate-jOjTNlOL.mjs → scheduler-CtUyWJ3O.mjs} +7 -109
- package/dist/scheduler-dmHXoRvm.mjs +3 -0
- package/dist/{scope-D5VSQxe4.mjs → scope-D-h6F6DN.mjs} +4 -4
- package/dist/{search-CPoE0830.mjs → search-RSyeQqj1.mjs} +18 -18
- package/dist/{session-CNXF6DLP.mjs → session-8iqQDkqb.mjs} +55 -31
- package/dist/session-BeqAbNPd.mjs +35 -0
- package/dist/session-scan-BJI_ZO8M.mjs +9 -0
- package/dist/{session-scan-BDLEc4w1.mjs → session-scan-W-gbwJHM.mjs} +6 -6
- package/dist/{sources-CjhUKKtO.mjs → sources-ESUkZaWv.mjs} +1 -1
- package/dist/{status-DYydKQUI.mjs → status-Dm4dYciN.mjs} +4 -4
- package/dist/{status-CvVi9cDf.mjs → status-ggJ7lgVg.mjs} +17 -9
- package/dist/{stop-words-SdSL1WKH.mjs → stop-words-DSEYQdNe.mjs} +1 -1
- package/dist/{test-isolation-CoDeOVXb.mjs → test-isolation-lqSmYxr0.mjs} +1 -1
- package/dist/{timeouts-OwEONmc8.mjs → timeouts-1MLooEBB.mjs} +1 -1
- package/dist/{tool-errors-AeRQuG3Y.mjs → tool-errors-7E13StWd.mjs} +4 -3
- package/dist/{tool-errors-R5E0fCgf.mjs → tool-errors-CJWODvlo.mjs} +6 -6
- package/dist/viewer-CqozWW39.mjs +22 -0
- package/dist/{viewer-DtWj5Vti.mjs → viewer-mDXUNHNy.mjs} +15 -15
- package/dist/{wait-BMUR-U-U.mjs → wait-ByV0OyMZ.mjs} +3 -3
- package/dist/{worker-config-BLqa1yiD.mjs → worker-config-CJhEMk19.mjs} +294 -92
- package/dist/worker-config-DESkIjMF.mjs +41 -0
- package/dist/{workers-config-DEI9lrV4.mjs → workers-config-f8KrkY4L.mjs} +2 -2
- package/dist/{worktree-zmRf556h.mjs → worktree-CRs2gyg0.mjs} +37 -7
- package/dist/{zettelkasten-nigq7fqs.mjs → zettelkasten-B_rRRRvD.mjs} +5 -5
- package/dist/{zettelkasten-Cr_Xj0mG.mjs → zettelkasten-BzMm8REH.mjs} +29 -19
- package/docs/README.md +2 -0
- package/docs/cockpit.md +10 -4
- package/docs/commands/README.md +4 -4
- package/docs/commands/backup.md +2 -0
- package/docs/commands/install.md +29 -4
- package/docs/commands/providers.md +1 -1
- package/docs/commands/restore.md +4 -0
- package/docs/commands/setup.md +29 -4
- package/docs/commands/worker.md +1 -1
- package/docs/config.md +2 -0
- package/docs/features.md +299 -0
- package/docs/images/architecture.drawio +51 -0
- package/docs/images/architecture.png +0 -0
- package/docs/images/architecture.svg +3 -0
- package/docs/images/cockpit-01-system-tokens.jpg +0 -0
- package/docs/images/cockpit-02-totals-cache.jpg +0 -0
- package/docs/images/cockpit-03-local-servers-models-pool.jpg +0 -0
- package/docs/images/cockpit-04-workers-memory.jpg +0 -0
- package/docs/images/cockpit-05-performance.jpg +0 -0
- package/docs/images/cockpit-06-runs-speed-routing.jpg +0 -0
- package/docs/images/cockpit-07-settings-registry.jpg +0 -0
- package/docs/install/index.md +29 -0
- package/docs/three-tier-coding.md +1 -1
- package/gemini-extension.json +1 -1
- package/package.json +1 -5
- package/pai-plugin.json +1 -1
- package/plugins/context-preservation/plugin.json +1 -1
- package/plugins/core/plugin.json +1 -1
- package/plugins/core/skills/setup/SKILL.md +41 -9
- package/plugins/creative/plugin.json +1 -1
- package/plugins/observability/plugin.json +1 -1
- package/plugins/productivity/plugin.json +1 -1
- package/plugins/semantic-search/plugin.json +1 -1
- package/plugins/ui/plugin.json +1 -1
- package/plugins/zettelkasten/plugin.json +1 -1
- package/src/hooks/session-autosave.sh +8 -1
- package/src/hooks/session-stop.sh +8 -1
- package/src/hooks/ts/capture-all-events.ts +7 -12
- package/src/hooks/ts/lib/context-fill.ts +2 -1
- package/src/hooks/ts/lib/path-repair.ts +1 -1
- package/src/hooks/ts/lib/project-utils/notify.ts +1 -0
- package/src/hooks/ts/lib/project-utils/session-notes.ts +23 -6
- package/src/hooks/ts/lib/raw-capture.ts +36 -0
- package/src/hooks/ts/lib/session-summary.ts +129 -0
- package/src/hooks/ts/lib/todo-sync.ts +120 -0
- package/src/hooks/ts/lib/worker-git-guard.ts +1 -1
- package/src/hooks/ts/post-tool-use/capture-tool-output.ts +6 -10
- package/src/hooks/ts/post-tool-use/sync-todo-to-md.ts +5 -105
- package/src/hooks/ts/pre-compact/context-compression-hook.ts +1 -1
- package/src/hooks/ts/pre-tool-use/security-validator.ts +35 -14
- package/src/hooks/ts/session-end/capture-session-summary.ts +20 -128
- package/src/hooks/ts/session-start/load-core-context.ts +3 -3
- package/src/hooks/ts/session-start/load-project-context.ts +18 -22
- package/src/hooks/ts/stop/stop-hook.ts +13 -5
- package/src/hooks/ztk-auto.sh +7 -2
- package/dist/aibroker-client-JjE74jo0.mjs +0 -3
- package/dist/auto-route-BRk8NEFv.mjs +0 -11
- package/dist/budget-DuhQ2zzG.mjs +0 -14
- package/dist/cockpit-actions-DcQ-ucU8.mjs +0 -19
- package/dist/cockpit-memory-KV45PPO2.mjs +0 -19
- package/dist/daemon-C7yt_ptC.mjs +0 -44
- package/dist/detect-DRUkmHnb.mjs +0 -10
- package/dist/factory-DAGG9_n8.mjs +0 -9
- package/dist/helpers-DPJEHPq6.mjs +0 -10
- package/dist/kill-tree-LV0Q7Mte.mjs +0 -10
- package/dist/operator-CfL0HiBK.mjs +0 -7
- package/dist/postgres-DgqWyqhN.mjs +0 -7
- package/dist/providers-CTu2s1z2.mjs +0 -15
- package/dist/registrable-D9aNZOTh.mjs +0 -9
- package/dist/render-BSfVlYHj.mjs +0 -13
- package/dist/root-xI9DqVIe.mjs +0 -35
- package/dist/route-table-HjvnLVEU.mjs +0 -14
- package/dist/session-BJHzmUg2.mjs +0 -34
- package/dist/session-scan-YORKE1NO.mjs +0 -9
- package/dist/viewer-B8709jDN.mjs +0 -22
- package/dist/worker-config-D8tRuvo7.mjs +0 -40
- package/docs/images/cockpit-limits-routing.jpg +0 -0
- package/docs/images/cockpit-models.jpg +0 -0
- package/docs/images/cockpit-usage.jpg +0 -0
- package/docs/images/cockpit-workers-system.jpg +0 -0
- package/scripts/build-docs.mjs +0 -41
- package/scripts/build-hooks.mjs +0 -311
- package/scripts/build-skill-stubs.mjs +0 -216
- package/scripts/copy-defaults.mjs +0 -46
|
@@ -84,6 +84,9 @@ function getRoutedNotesPath(): string | null {
|
|
|
84
84
|
/**
|
|
85
85
|
* Project signals that indicate a directory is a real project root.
|
|
86
86
|
*/
|
|
87
|
+
/** Upper bound for each `pai` CLI call on the SessionStart path. */
|
|
88
|
+
const PAI_CLI_TIMEOUT_MS = 10_000;
|
|
89
|
+
|
|
87
90
|
const PROJECT_SIGNALS = [
|
|
88
91
|
'.git',
|
|
89
92
|
'package.json',
|
|
@@ -296,10 +299,11 @@ async function main() {
|
|
|
296
299
|
if (hasTodo) {
|
|
297
300
|
console.error(`TODO.md: ${todoPath}`);
|
|
298
301
|
} else {
|
|
299
|
-
// Create TODO.md
|
|
300
|
-
const newTodoPath =
|
|
301
|
-
const { writeFileSync } = await import('fs');
|
|
302
|
-
|
|
302
|
+
// Create TODO.md where findTodoPath expects it
|
|
303
|
+
const newTodoPath = todoPath;
|
|
304
|
+
const { writeFileSync, mkdirSync } = await import('fs');
|
|
305
|
+
mkdirSync(dirname(newTodoPath), { recursive: true });
|
|
306
|
+
writeFileSync(newTodoPath, `# TODO\n\n## Current Session\n\n- [ ] (Tasks will be tracked here)\n\n## Backlog\n\n- [ ] (Future tasks)\n\n---\n\n*Last updated: ${new Date().toISOString()}*\n`);
|
|
303
307
|
console.error(`Created TODO.md: ${newTodoPath}`);
|
|
304
308
|
}
|
|
305
309
|
|
|
@@ -355,16 +359,18 @@ async function main() {
|
|
|
355
359
|
}
|
|
356
360
|
|
|
357
361
|
// 7. Send ntfy.sh notification (MANDATORY)
|
|
358
|
-
await sendNtfyNotification(
|
|
362
|
+
await sendNtfyNotification('Session started');
|
|
359
363
|
|
|
360
364
|
// 7.5. Run pai project detect to identify the registered PAI project
|
|
361
365
|
const paiBin = findPaiBinary();
|
|
362
366
|
let paiProjectBlock = '';
|
|
367
|
+
let detectedRootPath: string | undefined;
|
|
363
368
|
try {
|
|
364
369
|
const { execFileSync } = await import('child_process');
|
|
365
370
|
const raw = execFileSync(paiBin, ['project', 'detect', '--json', cwd], {
|
|
366
371
|
encoding: 'utf-8',
|
|
367
372
|
env: process.env,
|
|
373
|
+
timeout: PAI_CLI_TIMEOUT_MS,
|
|
368
374
|
}).trim();
|
|
369
375
|
|
|
370
376
|
if (raw) {
|
|
@@ -379,6 +385,7 @@ async function main() {
|
|
|
379
385
|
error?: string;
|
|
380
386
|
cwd?: string;
|
|
381
387
|
};
|
|
388
|
+
detectedRootPath = detected.root_path;
|
|
382
389
|
|
|
383
390
|
/**
|
|
384
391
|
* Attempt to auto-register the CWD as a new PAI project.
|
|
@@ -393,6 +400,7 @@ async function main() {
|
|
|
393
400
|
execFileSync(paiBin, ['project', 'add', cwd], {
|
|
394
401
|
encoding: 'utf-8',
|
|
395
402
|
env: process.env,
|
|
403
|
+
timeout: PAI_CLI_TIMEOUT_MS,
|
|
396
404
|
});
|
|
397
405
|
console.error(`PAI auto-registered project at: ${cwd}`);
|
|
398
406
|
|
|
@@ -401,6 +409,7 @@ async function main() {
|
|
|
401
409
|
const raw2 = execFileSync(paiBin, ['project', 'detect', '--json', cwd], {
|
|
402
410
|
encoding: 'utf-8',
|
|
403
411
|
env: process.env,
|
|
412
|
+
timeout: PAI_CLI_TIMEOUT_MS,
|
|
404
413
|
}).trim();
|
|
405
414
|
|
|
406
415
|
if (raw2) {
|
|
@@ -474,6 +483,7 @@ Match: ${matchDesc} | Sessions: ${detected.session_count ?? 0}${detected.status
|
|
|
474
483
|
} catch (e) {
|
|
475
484
|
// Non-fatal — don't break session start if pai is unavailable
|
|
476
485
|
console.error('pai project detect failed:', e);
|
|
486
|
+
detectedRootPath = cwd;
|
|
477
487
|
}
|
|
478
488
|
|
|
479
489
|
// 8. Output system reminder with session info
|
|
@@ -509,7 +519,7 @@ ${paiProjectBlock ? `\n${paiProjectBlock}` : ''}
|
|
|
509
519
|
// An MCP/tools pin silently drops servers; say so. Nothing printed when unpinned.
|
|
510
520
|
try {
|
|
511
521
|
const { execFileSync: run } = await import('child_process');
|
|
512
|
-
const pins = run(paiBin, ['project', 'pins'], { encoding: 'utf-8', cwd }).trim();
|
|
522
|
+
const pins = run(paiBin, ['project', 'pins'], { encoding: 'utf-8', cwd, timeout: PAI_CLI_TIMEOUT_MS }).trim();
|
|
513
523
|
if (pins) console.log(pins);
|
|
514
524
|
} catch {
|
|
515
525
|
// pai unavailable: stay silent
|
|
@@ -590,22 +600,8 @@ THE ABOVE INSTRUCTIONS ARE MANDATORY. Follow them exactly.
|
|
|
590
600
|
// We derive it from the `paiProjectBlock` detection result by re-running a
|
|
591
601
|
// lightweight registry lookup, or by falling back to cwd for local-notes projects.
|
|
592
602
|
try {
|
|
593
|
-
//
|
|
594
|
-
|
|
595
|
-
try {
|
|
596
|
-
const { execFileSync: efs } = await import('child_process');
|
|
597
|
-
const raw2 = efs(paiBin, ['project', 'detect', '--json', cwd], {
|
|
598
|
-
encoding: 'utf-8',
|
|
599
|
-
env: process.env,
|
|
600
|
-
}).trim();
|
|
601
|
-
if (raw2) {
|
|
602
|
-
const det = JSON.parse(raw2) as { root_path?: string; slug?: string };
|
|
603
|
-
if (det.root_path) wakeupRootPath = det.root_path;
|
|
604
|
-
}
|
|
605
|
-
} catch {
|
|
606
|
-
// Non-fatal — fall back to cwd
|
|
607
|
-
wakeupRootPath = cwd;
|
|
608
|
-
}
|
|
603
|
+
// Reuse the root path from the detect call above (no second spawn).
|
|
604
|
+
const wakeupRootPath = detectedRootPath;
|
|
609
605
|
|
|
610
606
|
// Handover supersedes the L1 story: both summarise the same recent note,
|
|
611
607
|
// and the handover is a curated message while the story is auto-extracted.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { isWorkerSession } from "../lib/worker-session.js";
|
|
4
4
|
import { setTabTitle } from "../lib/tab-title.js";
|
|
5
|
-
import { readFileSync,
|
|
5
|
+
import { readFileSync, existsSync, unlinkSync } from 'fs';
|
|
6
6
|
import { join, basename, dirname } from 'path';
|
|
7
7
|
import { connect } from 'net';
|
|
8
8
|
import { randomUUID } from 'crypto';
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
WorkItem
|
|
19
19
|
} from '../lib/project-utils.js';
|
|
20
20
|
import { paiHomePath, sessionStateDir } from '../../../config/pai-files.js';
|
|
21
|
+
import { writeFileAtomic } from '../../../config/atomic-file.js';
|
|
21
22
|
|
|
22
23
|
// ---------------------------------------------------------------------------
|
|
23
24
|
// Constants
|
|
@@ -63,8 +64,12 @@ interface SessionState {
|
|
|
63
64
|
humanMessageCount: number;
|
|
64
65
|
}
|
|
65
66
|
|
|
67
|
+
/** uuid-like ids only: no path separators or dots, so the state file stays inside session-state. */
|
|
68
|
+
const SAFE_SESSION_ID = /^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/;
|
|
69
|
+
|
|
66
70
|
function readSessionState(sessionId: string): SessionState {
|
|
67
71
|
try {
|
|
72
|
+
if (!SAFE_SESSION_ID.test(sessionId)) return { humanMessageCount: 0 };
|
|
68
73
|
const stateFile = join(sessionStateDir(), `${sessionId}.json`);
|
|
69
74
|
if (!existsSync(stateFile)) return { humanMessageCount: 0 };
|
|
70
75
|
const raw = readFileSync(stateFile, 'utf-8');
|
|
@@ -79,10 +84,12 @@ function readSessionState(sessionId: string): SessionState {
|
|
|
79
84
|
|
|
80
85
|
function writeSessionState(sessionId: string, state: SessionState): void {
|
|
81
86
|
try {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
87
|
+
if (!SAFE_SESSION_ID.test(sessionId)) {
|
|
88
|
+
console.error(`STOP-HOOK: Refusing session state for unsafe session id`);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const stateFile = join(paiHomePath('session-state'), `${sessionId}.json`);
|
|
92
|
+
writeFileAtomic(stateFile, JSON.stringify(state, null, 2));
|
|
86
93
|
} catch (e) {
|
|
87
94
|
console.error(`STOP-HOOK: Could not write session state: ${e}`);
|
|
88
95
|
}
|
|
@@ -90,6 +97,7 @@ function writeSessionState(sessionId: string, state: SessionState): void {
|
|
|
90
97
|
|
|
91
98
|
function deleteSessionState(sessionId: string): void {
|
|
92
99
|
try {
|
|
100
|
+
if (!SAFE_SESSION_ID.test(sessionId)) return;
|
|
93
101
|
const stateFile = join(sessionStateDir(), `${sessionId}.json`);
|
|
94
102
|
if (existsSync(stateFile)) {
|
|
95
103
|
unlinkSync(stateFile);
|
package/src/hooks/ztk-auto.sh
CHANGED
|
@@ -17,11 +17,16 @@ if [ -n "$command" ]; then
|
|
|
17
17
|
fi
|
|
18
18
|
fi
|
|
19
19
|
|
|
20
|
+
if ! command -v ztk &>/dev/null; then
|
|
21
|
+
# no ztk: no decision, the normal permission flow applies
|
|
22
|
+
exit 0
|
|
23
|
+
fi
|
|
24
|
+
|
|
20
25
|
result=$(printf '%s' "$stdin" | ztk rewrite 2>/dev/null)
|
|
21
26
|
|
|
22
27
|
if [ -z "$result" ]; then
|
|
23
|
-
# ztk
|
|
24
|
-
|
|
28
|
+
# ztk printed nothing: no decision, the normal permission flow applies
|
|
29
|
+
exit 0
|
|
25
30
|
else
|
|
26
31
|
# ztk returned something - change ask to allow
|
|
27
32
|
echo "$result" | sed 's/"permissionDecision":"ask"/"permissionDecision":"allow"/'
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import "./config-D5chi2LO.mjs";
|
|
2
|
-
import "./config-BSXKyeJ1.mjs";
|
|
3
|
-
import "./paths-DoIyRnhx.mjs";
|
|
4
|
-
import "./worktree-zmRf556h.mjs";
|
|
5
|
-
import "./status-CvVi9cDf.mjs";
|
|
6
|
-
import "./pool-CZ5MZaXg.mjs";
|
|
7
|
-
import "./registrable-LrRIVYQc.mjs";
|
|
8
|
-
import "./pai-marker-kIYuNt3c.mjs";
|
|
9
|
-
import { n as formatAutoRouteJson, t as autoRoute } from "./auto-route-D5SXrMpB.mjs";
|
|
10
|
-
|
|
11
|
-
export { autoRoute, formatAutoRouteJson };
|
package/dist/budget-DuhQ2zzG.mjs
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import "./config-D5chi2LO.mjs";
|
|
2
|
-
import "./config-BSXKyeJ1.mjs";
|
|
3
|
-
import "./paths-DoIyRnhx.mjs";
|
|
4
|
-
import "./status-CvVi9cDf.mjs";
|
|
5
|
-
import "./scope-D5VSQxe4.mjs";
|
|
6
|
-
import { A as budgetSkipReason, D as budgetExceeded, E as budgetCache, M as budgetWall, N as fetchBudgetReading, O as budgetFresh, P as pickBudgetWindow, T as BudgetCache, j as budgetUntilLabel, k as budgetFull, w as BUDGET_TTL_MS } from "./routing-CUyiglfu.mjs";
|
|
7
|
-
import "./tool-errors-AeRQuG3Y.mjs";
|
|
8
|
-
import "./wait-BMUR-U-U.mjs";
|
|
9
|
-
import "./local-tiers-DPZYqv9m.mjs";
|
|
10
|
-
import "./caller-identity-CVTuiLSs.mjs";
|
|
11
|
-
import "./local-candidate-jOjTNlOL.mjs";
|
|
12
|
-
import "./capacity-DaXrVj3J.mjs";
|
|
13
|
-
|
|
14
|
-
export { BUDGET_TTL_MS, BudgetCache, budgetCache, budgetExceeded, budgetFresh, budgetFull, budgetSkipReason, budgetUntilLabel, budgetWall, fetchBudgetReading, pickBudgetWindow };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import "./config-D5chi2LO.mjs";
|
|
2
|
-
import "./config-BSXKyeJ1.mjs";
|
|
3
|
-
import "./paths-DoIyRnhx.mjs";
|
|
4
|
-
import "./status-CvVi9cDf.mjs";
|
|
5
|
-
import "./scope-D5VSQxe4.mjs";
|
|
6
|
-
import "./routing-CUyiglfu.mjs";
|
|
7
|
-
import "./tool-errors-AeRQuG3Y.mjs";
|
|
8
|
-
import "./wait-BMUR-U-U.mjs";
|
|
9
|
-
import "./local-tiers-DPZYqv9m.mjs";
|
|
10
|
-
import "./caller-identity-CVTuiLSs.mjs";
|
|
11
|
-
import "./local-candidate-jOjTNlOL.mjs";
|
|
12
|
-
import "./capacity-DaXrVj3J.mjs";
|
|
13
|
-
import "./providers-UsKtLcUR.mjs";
|
|
14
|
-
import "./main-config-ops-C0SflOWk.mjs";
|
|
15
|
-
import { S as writeLedgerLine, _ as runtimeJobProgress, a as cockpitJobFile, b as spawnMemoryRun, c as labelPath, d as readCockpitJob, f as readLabels, g as runningRuntimeJobs, h as runningRuntimeJob, i as WORKER_ROLE_CLASSES, l as logTailSince, m as runCockpitAction, n as RUNTIME_START_EVENT, o as defaultDeps, p as resolveTierName, r as RUNTIME_STOP_EVENT, s as engineInflight, t as COCKPIT_ACTION_EVENT, u as memoryRunRefusal, v as runtimeOpRefusal, x as tierNames, y as runtimeStartStop } from "./cockpit-actions-ODmt8yF9.mjs";
|
|
16
|
-
import "./ipc-client-BMqWw_gv.mjs";
|
|
17
|
-
import "./embed-pass-CeQD8kRE.mjs";
|
|
18
|
-
|
|
19
|
-
export { defaultDeps, runtimeStartStop };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import "./config-D5chi2LO.mjs";
|
|
2
|
-
import "./config-BSXKyeJ1.mjs";
|
|
3
|
-
import "./paths-DoIyRnhx.mjs";
|
|
4
|
-
import "./status-CvVi9cDf.mjs";
|
|
5
|
-
import "./scope-D5VSQxe4.mjs";
|
|
6
|
-
import "./routing-CUyiglfu.mjs";
|
|
7
|
-
import "./tool-errors-AeRQuG3Y.mjs";
|
|
8
|
-
import "./wait-BMUR-U-U.mjs";
|
|
9
|
-
import "./local-tiers-DPZYqv9m.mjs";
|
|
10
|
-
import "./caller-identity-CVTuiLSs.mjs";
|
|
11
|
-
import "./local-candidate-jOjTNlOL.mjs";
|
|
12
|
-
import "./capacity-DaXrVj3J.mjs";
|
|
13
|
-
import "./providers-UsKtLcUR.mjs";
|
|
14
|
-
import "./main-config-ops-C0SflOWk.mjs";
|
|
15
|
-
import { A as memoryRunLog, D as latestMemoryJob, E as fetchDaemonMemory, M as runProgress, N as runningMemoryJob, O as liveMemoryDeps, P as sameModel, T as cockpitMemoryPayload, j as rateSeries, k as memoryJobProgress } from "./cockpit-actions-ODmt8yF9.mjs";
|
|
16
|
-
import "./ipc-client-BMqWw_gv.mjs";
|
|
17
|
-
import "./embed-pass-CeQD8kRE.mjs";
|
|
18
|
-
|
|
19
|
-
export { fetchDaemonMemory };
|
package/dist/daemon-C7yt_ptC.mjs
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import "./utils-J2b9y8PC.mjs";
|
|
2
|
-
import "./migrate-BUJHadA8.mjs";
|
|
3
|
-
import "./config-D5chi2LO.mjs";
|
|
4
|
-
import "./config-BSXKyeJ1.mjs";
|
|
5
|
-
import "./paths-DoIyRnhx.mjs";
|
|
6
|
-
import "./worktree-zmRf556h.mjs";
|
|
7
|
-
import "./status-CvVi9cDf.mjs";
|
|
8
|
-
import "./pool-CZ5MZaXg.mjs";
|
|
9
|
-
import "./registrable-LrRIVYQc.mjs";
|
|
10
|
-
import "./pai-marker-kIYuNt3c.mjs";
|
|
11
|
-
import "./helpers-CJpb_MNB.mjs";
|
|
12
|
-
import "./reranker-DxxMCtA0.mjs";
|
|
13
|
-
import "./scope-D5VSQxe4.mjs";
|
|
14
|
-
import "./routing-CUyiglfu.mjs";
|
|
15
|
-
import "./tool-errors-AeRQuG3Y.mjs";
|
|
16
|
-
import "./wait-BMUR-U-U.mjs";
|
|
17
|
-
import "./local-tiers-DPZYqv9m.mjs";
|
|
18
|
-
import "./caller-identity-CVTuiLSs.mjs";
|
|
19
|
-
import "./local-candidate-jOjTNlOL.mjs";
|
|
20
|
-
import "./capacity-DaXrVj3J.mjs";
|
|
21
|
-
import "./factory-BtjbQ0np.mjs";
|
|
22
|
-
import "./postgres-CDnd_k5f.mjs";
|
|
23
|
-
import "./embedding-gate-BHuBsgHD.mjs";
|
|
24
|
-
import "./embeddings-D4t6L-EH.mjs";
|
|
25
|
-
import "./router-L8Nu-OHF.mjs";
|
|
26
|
-
import "./detect-C1d5cUkT.mjs";
|
|
27
|
-
import "./scan-B7I0gPe-.mjs";
|
|
28
|
-
import "./launch-DgqQdAjI.mjs";
|
|
29
|
-
import "./run-ulAi5dFD.mjs";
|
|
30
|
-
import "./controls-BGkK_Bdi.mjs";
|
|
31
|
-
import "./endreason-x1KOSrcO.mjs";
|
|
32
|
-
import "./render-BDbb4CF-.mjs";
|
|
33
|
-
import "./operator-DZxcP-g8.mjs";
|
|
34
|
-
import "./kill-tree-BjYz5BxK.mjs";
|
|
35
|
-
import "./pool-cli-BxNSPzzY.mjs";
|
|
36
|
-
import "./pane-audit-OGYrOAik.mjs";
|
|
37
|
-
import "./ipc-client-BMqWw_gv.mjs";
|
|
38
|
-
import "./embed-pass-CeQD8kRE.mjs";
|
|
39
|
-
import "./indexer-backend-BM2CUSu8.mjs";
|
|
40
|
-
import { t as serve } from "./daemon-CorGh6Ub.mjs";
|
|
41
|
-
import "./auto-route-D5SXrMpB.mjs";
|
|
42
|
-
import "./zettelkasten-Cr_Xj0mG.mjs";
|
|
43
|
-
|
|
44
|
-
export { serve };
|
package/dist/detect-DRUkmHnb.mjs
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import "./config-BSXKyeJ1.mjs";
|
|
2
|
-
import "./helpers-CJpb_MNB.mjs";
|
|
3
|
-
import "./factory-BtjbQ0np.mjs";
|
|
4
|
-
import "./postgres-CDnd_k5f.mjs";
|
|
5
|
-
import "./embedding-gate-BHuBsgHD.mjs";
|
|
6
|
-
import "./embeddings-D4t6L-EH.mjs";
|
|
7
|
-
import "./router-L8Nu-OHF.mjs";
|
|
8
|
-
import { n as formatDetection, r as formatDetectionJson, t as detectProject } from "./detect-C1d5cUkT.mjs";
|
|
9
|
-
|
|
10
|
-
export { detectProject };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import "./config-BSXKyeJ1.mjs";
|
|
2
|
-
import "./helpers-CJpb_MNB.mjs";
|
|
3
|
-
import { a as getStorageBackend, i as getRegistryBackend, n as createRegistryBackend, r as createStorageBackend, t as closeStorage } from "./factory-BtjbQ0np.mjs";
|
|
4
|
-
import "./postgres-CDnd_k5f.mjs";
|
|
5
|
-
import "./embedding-gate-BHuBsgHD.mjs";
|
|
6
|
-
import "./embeddings-D4t6L-EH.mjs";
|
|
7
|
-
import "./router-L8Nu-OHF.mjs";
|
|
8
|
-
|
|
9
|
-
export { createStorageBackend, getRegistryBackend };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import "./config-BSXKyeJ1.mjs";
|
|
2
|
-
import "./helpers-CJpb_MNB.mjs";
|
|
3
|
-
import "./factory-BtjbQ0np.mjs";
|
|
4
|
-
import "./postgres-CDnd_k5f.mjs";
|
|
5
|
-
import "./embedding-gate-BHuBsgHD.mjs";
|
|
6
|
-
import "./embeddings-D4t6L-EH.mjs";
|
|
7
|
-
import "./router-L8Nu-OHF.mjs";
|
|
8
|
-
import { a as getSessionCount, c as upsertTag, i as getProjectTags, n as getProject, o as requireProject, r as getProjectAliases, s as resolveIdentifier, t as getLastSessionDate } from "./helpers-DFmYRCOa.mjs";
|
|
9
|
-
|
|
10
|
-
export { getProject };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import "./config-D5chi2LO.mjs";
|
|
2
|
-
import "./config-BSXKyeJ1.mjs";
|
|
3
|
-
import "./paths-DoIyRnhx.mjs";
|
|
4
|
-
import "./status-CvVi9cDf.mjs";
|
|
5
|
-
import "./scope-D5VSQxe4.mjs";
|
|
6
|
-
import "./caller-identity-CVTuiLSs.mjs";
|
|
7
|
-
import "./endreason-x1KOSrcO.mjs";
|
|
8
|
-
import { i as killTree, n as isOwner, r as killRefusal, t as descendantsLeavesFirst } from "./kill-tree-BjYz5BxK.mjs";
|
|
9
|
-
|
|
10
|
-
export { killTree };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import "./config-D5chi2LO.mjs";
|
|
2
|
-
import "./config-BSXKyeJ1.mjs";
|
|
3
|
-
import "./paths-DoIyRnhx.mjs";
|
|
4
|
-
import "./status-CvVi9cDf.mjs";
|
|
5
|
-
import { n as operatorSocketPath, r as sayToWorker, t as createOperatorServer } from "./operator-DZxcP-g8.mjs";
|
|
6
|
-
|
|
7
|
-
export { sayToWorker };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import "./config-D5chi2LO.mjs";
|
|
2
|
-
import "./config-BSXKyeJ1.mjs";
|
|
3
|
-
import "./paths-DoIyRnhx.mjs";
|
|
4
|
-
import "./status-CvVi9cDf.mjs";
|
|
5
|
-
import "./scope-D5VSQxe4.mjs";
|
|
6
|
-
import "./routing-CUyiglfu.mjs";
|
|
7
|
-
import "./tool-errors-AeRQuG3Y.mjs";
|
|
8
|
-
import "./wait-BMUR-U-U.mjs";
|
|
9
|
-
import "./local-tiers-DPZYqv9m.mjs";
|
|
10
|
-
import "./caller-identity-CVTuiLSs.mjs";
|
|
11
|
-
import "./local-candidate-jOjTNlOL.mjs";
|
|
12
|
-
import "./capacity-DaXrVj3J.mjs";
|
|
13
|
-
import { _ as unsetCapabilityPreference, a as describeCapabilities, b as useProvider, c as modelPrefsText, d as setCapabilityPreference, f as setClass, g as setWorkersEnabled, h as setProviderModel, i as describeCap, l as removeProvider, m as setProviderEnabled, n as capText, o as describeModels, p as setProviderCap, r as classTargetText, s as describeProviders, t as addProvider, u as resolveProviderName, v as unsetClass, y as updateProvider } from "./providers-UsKtLcUR.mjs";
|
|
14
|
-
|
|
15
|
-
export { setProviderEnabled, useProvider };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import "./config-D5chi2LO.mjs";
|
|
2
|
-
import "./config-BSXKyeJ1.mjs";
|
|
3
|
-
import "./paths-DoIyRnhx.mjs";
|
|
4
|
-
import "./worktree-zmRf556h.mjs";
|
|
5
|
-
import "./status-CvVi9cDf.mjs";
|
|
6
|
-
import "./pool-CZ5MZaXg.mjs";
|
|
7
|
-
import { a as unregistrableReason, i as reportUnregistrable, n as mainRepoOf, o as workerWorktreesRoot, r as pruneWorktreeProjects, s as worktreeReason, t as isLinkedWorktree } from "./registrable-LrRIVYQc.mjs";
|
|
8
|
-
|
|
9
|
-
export { reportUnregistrable };
|
package/dist/render-BSfVlYHj.mjs
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import "./config-D5chi2LO.mjs";
|
|
2
|
-
import "./config-BSXKyeJ1.mjs";
|
|
3
|
-
import "./paths-DoIyRnhx.mjs";
|
|
4
|
-
import "./worktree-zmRf556h.mjs";
|
|
5
|
-
import "./status-CvVi9cDf.mjs";
|
|
6
|
-
import "./pool-CZ5MZaXg.mjs";
|
|
7
|
-
import "./scope-D5VSQxe4.mjs";
|
|
8
|
-
import { D as fmtElapsed } from "./wait-BMUR-U-U.mjs";
|
|
9
|
-
import "./capacity-DaXrVj3J.mjs";
|
|
10
|
-
import "./endreason-x1KOSrcO.mjs";
|
|
11
|
-
import { S as warmupText, _ as renderTable, a as fullLines, b as tickerTool, c as headerLine, d as paneRunStatusRow, f as paneStatusRow, g as renderStatusLine, h as renderEvent, i as dayOf, l as intentOf, m as relPath, n as clockOf, o as goalOf, p as providerTag, r as contextMeter, s as gutterFor, t as blankBetween, u as makeColor, v as shortModel, x as unifiedDiffLines, y as tickerText } from "./render-BDbb4CF-.mjs";
|
|
12
|
-
|
|
13
|
-
export { makeColor };
|
package/dist/root-xI9DqVIe.mjs
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import "./utils-J2b9y8PC.mjs";
|
|
2
|
-
import "./migrate-BUJHadA8.mjs";
|
|
3
|
-
import "./config-D5chi2LO.mjs";
|
|
4
|
-
import "./config-BSXKyeJ1.mjs";
|
|
5
|
-
import "./paths-DoIyRnhx.mjs";
|
|
6
|
-
import "./worktree-zmRf556h.mjs";
|
|
7
|
-
import "./status-CvVi9cDf.mjs";
|
|
8
|
-
import "./pool-CZ5MZaXg.mjs";
|
|
9
|
-
import "./registrable-LrRIVYQc.mjs";
|
|
10
|
-
import "./pai-marker-kIYuNt3c.mjs";
|
|
11
|
-
import "./helpers-CJpb_MNB.mjs";
|
|
12
|
-
import "./scope-D5VSQxe4.mjs";
|
|
13
|
-
import "./routing-CUyiglfu.mjs";
|
|
14
|
-
import "./tool-errors-AeRQuG3Y.mjs";
|
|
15
|
-
import "./wait-BMUR-U-U.mjs";
|
|
16
|
-
import "./local-tiers-DPZYqv9m.mjs";
|
|
17
|
-
import "./caller-identity-CVTuiLSs.mjs";
|
|
18
|
-
import "./local-candidate-jOjTNlOL.mjs";
|
|
19
|
-
import "./capacity-DaXrVj3J.mjs";
|
|
20
|
-
import "./factory-BtjbQ0np.mjs";
|
|
21
|
-
import "./postgres-CDnd_k5f.mjs";
|
|
22
|
-
import "./embedding-gate-BHuBsgHD.mjs";
|
|
23
|
-
import "./embeddings-D4t6L-EH.mjs";
|
|
24
|
-
import "./router-L8Nu-OHF.mjs";
|
|
25
|
-
import "./detect-C1d5cUkT.mjs";
|
|
26
|
-
import "./helpers-DFmYRCOa.mjs";
|
|
27
|
-
import "./scan-B7I0gPe-.mjs";
|
|
28
|
-
import "./session-CNXF6DLP.mjs";
|
|
29
|
-
import "./launch-DgqQdAjI.mjs";
|
|
30
|
-
import "./health-C6jZWvRG.mjs";
|
|
31
|
-
import "./launch-CLp0OJxV.mjs";
|
|
32
|
-
import { _ as setupsTable, a as lastSetup, b as truncate, c as localState, d as pickerOpts, f as plainTable, g as runRoot, h as runNewWith, i as lastOnLabel, l as matchRows, m as rootCommand, n as ago, o as launchKey, p as resolveSetup, r as finishCd, s as launchScreen, t as CANCELLED, u as pickerLayout, v as startSession, y as systemTerm } from "./root-BMeJuHOb.mjs";
|
|
33
|
-
import "./session-scan-BDLEc4w1.mjs";
|
|
34
|
-
|
|
35
|
-
export { runNewWith };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import "./config-D5chi2LO.mjs";
|
|
2
|
-
import "./config-BSXKyeJ1.mjs";
|
|
3
|
-
import "./paths-DoIyRnhx.mjs";
|
|
4
|
-
import "./status-CvVi9cDf.mjs";
|
|
5
|
-
import "./scope-D5VSQxe4.mjs";
|
|
6
|
-
import { At as applyPolicyToRoutes, Bt as routeText, Ft as parseSelector, Gt as setSessionRoute, Ht as sessionRoutesPatch, It as resolveSelector, Kt as tierFlow, Lt as resolveSessionArg, Mt as configuredLocal, Nt as entryLabel, Pt as flowText, Rt as routeChoices, Ut as sessionStartTarget, Vt as servingChip, Wt as setRoute, jt as clearSessionRoute, kt as TIGHT_PERCENT, qt as validateRoute, zt as routeRows } from "./routing-CUyiglfu.mjs";
|
|
7
|
-
import "./tool-errors-AeRQuG3Y.mjs";
|
|
8
|
-
import "./wait-BMUR-U-U.mjs";
|
|
9
|
-
import "./local-tiers-DPZYqv9m.mjs";
|
|
10
|
-
import "./caller-identity-CVTuiLSs.mjs";
|
|
11
|
-
import "./local-candidate-jOjTNlOL.mjs";
|
|
12
|
-
import "./capacity-DaXrVj3J.mjs";
|
|
13
|
-
|
|
14
|
-
export { setRoute };
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import "./utils-J2b9y8PC.mjs";
|
|
2
|
-
import "./migrate-BUJHadA8.mjs";
|
|
3
|
-
import "./config-D5chi2LO.mjs";
|
|
4
|
-
import "./config-BSXKyeJ1.mjs";
|
|
5
|
-
import "./paths-DoIyRnhx.mjs";
|
|
6
|
-
import "./worktree-zmRf556h.mjs";
|
|
7
|
-
import "./status-CvVi9cDf.mjs";
|
|
8
|
-
import "./pool-CZ5MZaXg.mjs";
|
|
9
|
-
import "./registrable-LrRIVYQc.mjs";
|
|
10
|
-
import "./pai-marker-kIYuNt3c.mjs";
|
|
11
|
-
import "./helpers-CJpb_MNB.mjs";
|
|
12
|
-
import "./scope-D5VSQxe4.mjs";
|
|
13
|
-
import "./routing-CUyiglfu.mjs";
|
|
14
|
-
import "./tool-errors-AeRQuG3Y.mjs";
|
|
15
|
-
import "./wait-BMUR-U-U.mjs";
|
|
16
|
-
import "./local-tiers-DPZYqv9m.mjs";
|
|
17
|
-
import "./caller-identity-CVTuiLSs.mjs";
|
|
18
|
-
import "./local-candidate-jOjTNlOL.mjs";
|
|
19
|
-
import "./capacity-DaXrVj3J.mjs";
|
|
20
|
-
import "./factory-BtjbQ0np.mjs";
|
|
21
|
-
import "./postgres-CDnd_k5f.mjs";
|
|
22
|
-
import "./embedding-gate-BHuBsgHD.mjs";
|
|
23
|
-
import "./embeddings-D4t6L-EH.mjs";
|
|
24
|
-
import "./router-L8Nu-OHF.mjs";
|
|
25
|
-
import "./detect-C1d5cUkT.mjs";
|
|
26
|
-
import "./helpers-DFmYRCOa.mjs";
|
|
27
|
-
import "./scan-B7I0gPe-.mjs";
|
|
28
|
-
import { a as newTop, c as planOpen, d as runNewDefault, f as sessionCommand, i as lsCommand, l as renameTop, n as collectRows, o as oneLine, p as sessionDir, r as collectView, s as openTop, t as applyProfileChat, u as rowsTable } from "./session-CNXF6DLP.mjs";
|
|
29
|
-
import "./launch-DgqQdAjI.mjs";
|
|
30
|
-
import "./health-C6jZWvRG.mjs";
|
|
31
|
-
import "./launch-CLp0OJxV.mjs";
|
|
32
|
-
import "./session-scan-BDLEc4w1.mjs";
|
|
33
|
-
|
|
34
|
-
export { runNewDefault };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import "./utils-J2b9y8PC.mjs";
|
|
2
|
-
import "./config-D5chi2LO.mjs";
|
|
3
|
-
import "./config-BSXKyeJ1.mjs";
|
|
4
|
-
import "./paths-DoIyRnhx.mjs";
|
|
5
|
-
import "./status-CvVi9cDf.mjs";
|
|
6
|
-
import "./scope-D5VSQxe4.mjs";
|
|
7
|
-
import { a as resolveSessionByNameOrId, c as transcriptCustomTitle, i as resolveFriendlyName, n as loadBrokerNames, o as scanCacheFilePath, r as migrateSessionScanCache, s as scanSessions, t as fmtAge } from "./session-scan-BDLEc4w1.mjs";
|
|
8
|
-
|
|
9
|
-
export { loadBrokerNames, transcriptCustomTitle };
|
package/dist/viewer-B8709jDN.mjs
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import "./config-D5chi2LO.mjs";
|
|
2
|
-
import "./config-BSXKyeJ1.mjs";
|
|
3
|
-
import "./paths-DoIyRnhx.mjs";
|
|
4
|
-
import "./worktree-zmRf556h.mjs";
|
|
5
|
-
import "./status-CvVi9cDf.mjs";
|
|
6
|
-
import "./pool-CZ5MZaXg.mjs";
|
|
7
|
-
import "./scope-D5VSQxe4.mjs";
|
|
8
|
-
import "./tool-errors-AeRQuG3Y.mjs";
|
|
9
|
-
import "./wait-BMUR-U-U.mjs";
|
|
10
|
-
import "./local-tiers-DPZYqv9m.mjs";
|
|
11
|
-
import "./caller-identity-CVTuiLSs.mjs";
|
|
12
|
-
import "./local-candidate-jOjTNlOL.mjs";
|
|
13
|
-
import "./capacity-DaXrVj3J.mjs";
|
|
14
|
-
import "./controls-BGkK_Bdi.mjs";
|
|
15
|
-
import "./endreason-x1KOSrcO.mjs";
|
|
16
|
-
import "./render-BDbb4CF-.mjs";
|
|
17
|
-
import "./operator-DZxcP-g8.mjs";
|
|
18
|
-
import "./kill-tree-BjYz5BxK.mjs";
|
|
19
|
-
import "./pane-audit-OGYrOAik.mjs";
|
|
20
|
-
import { a as followTailOutput, c as inboxCounts, d as psOutput, f as replayOutput, g as workerEnded, h as strayWorkerProcesses, i as backfillLines, l as initialFollowState, m as statusLineOutput, n as FOLLOW_TAIL_ENTRIES, o as followWorkers, p as resumeArgv, r as applyEvent, s as gutterBody, t as BACKFILL_EVENTS, u as makeOperatorInput } from "./viewer-DtWj5Vti.mjs";
|
|
21
|
-
|
|
22
|
-
export { applyEvent, initialFollowState };
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import "./utils-J2b9y8PC.mjs";
|
|
2
|
-
import "./config-D5chi2LO.mjs";
|
|
3
|
-
import "./config-BSXKyeJ1.mjs";
|
|
4
|
-
import "./paths-DoIyRnhx.mjs";
|
|
5
|
-
import "./worktree-zmRf556h.mjs";
|
|
6
|
-
import "./status-CvVi9cDf.mjs";
|
|
7
|
-
import "./pool-CZ5MZaXg.mjs";
|
|
8
|
-
import "./helpers-CJpb_MNB.mjs";
|
|
9
|
-
import "./scope-D5VSQxe4.mjs";
|
|
10
|
-
import "./routing-CUyiglfu.mjs";
|
|
11
|
-
import "./tool-errors-AeRQuG3Y.mjs";
|
|
12
|
-
import "./wait-BMUR-U-U.mjs";
|
|
13
|
-
import "./local-tiers-DPZYqv9m.mjs";
|
|
14
|
-
import "./caller-identity-CVTuiLSs.mjs";
|
|
15
|
-
import "./local-candidate-jOjTNlOL.mjs";
|
|
16
|
-
import "./capacity-DaXrVj3J.mjs";
|
|
17
|
-
import "./factory-BtjbQ0np.mjs";
|
|
18
|
-
import "./postgres-CDnd_k5f.mjs";
|
|
19
|
-
import "./embedding-gate-BHuBsgHD.mjs";
|
|
20
|
-
import "./embeddings-D4t6L-EH.mjs";
|
|
21
|
-
import "./router-L8Nu-OHF.mjs";
|
|
22
|
-
import "./launch-DgqQdAjI.mjs";
|
|
23
|
-
import "./health-C6jZWvRG.mjs";
|
|
24
|
-
import "./run-ulAi5dFD.mjs";
|
|
25
|
-
import "./controls-BGkK_Bdi.mjs";
|
|
26
|
-
import "./endreason-x1KOSrcO.mjs";
|
|
27
|
-
import "./render-BDbb4CF-.mjs";
|
|
28
|
-
import "./operator-DZxcP-g8.mjs";
|
|
29
|
-
import "./kill-tree-BjYz5BxK.mjs";
|
|
30
|
-
import "./pool-cli-BxNSPzzY.mjs";
|
|
31
|
-
import "./pane-audit-OGYrOAik.mjs";
|
|
32
|
-
import "./providers-UsKtLcUR.mjs";
|
|
33
|
-
import { A as workerOffCommand, C as workerClassesCommand, D as workerInstallCommand, E as workerFallbackCommand, F as workerProxyCommand, I as workerRolesCommand, L as workerRouteCommand, M as workerPolicyCommand, N as workerPoolCommand, O as workerLocalCommand, P as workerProvidersCommand, S as workerBenchCommand, T as workerControlsCommand, _ as serverLine, a as collectTags, b as stopAll, c as fail, d as killInstance, f as launchDetached, g as portOpen, h as portListeners, i as collectEnv, j as workerOnCommand, k as workerMcpCommand, l as healthOk, m as parseCostTier, n as WORKER_CONFIG_COMMANDS, o as controlsArgv, p as listServers, r as buildClassTarget, s as currentInstances, t as PROVIDER_EDIT_COMMANDS, u as isUp, v as startInstance, w as workerConfigCommand, x as stopInstance, y as startTier } from "./worker-config-BLqa1yiD.mjs";
|
|
34
|
-
import "./main-config-ops-C0SflOWk.mjs";
|
|
35
|
-
import "./cockpit-actions-ODmt8yF9.mjs";
|
|
36
|
-
import "./ipc-client-BMqWw_gv.mjs";
|
|
37
|
-
import "./embed-pass-CeQD8kRE.mjs";
|
|
38
|
-
import "./fallback-BIyEpPsQ.mjs";
|
|
39
|
-
|
|
40
|
-
export { currentInstances, startInstance, startTier, stopAll, stopInstance };
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/scripts/build-docs.mjs
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* Generate the per-area command reference ("man pages") from the live command
|
|
4
|
-
* definitions.
|
|
5
|
-
*
|
|
6
|
-
* Source of truth: src/cli (the definitions `pai help` reads). The built CLI
|
|
7
|
-
* writes the pages itself:
|
|
8
|
-
*
|
|
9
|
-
* docs/commands/<area>.md — one page per top-level command
|
|
10
|
-
* docs/commands/README.md — index (area table + flat list of every command)
|
|
11
|
-
*
|
|
12
|
-
* Hand-written examples are spliced in from docs/commands/_examples/<area>.md
|
|
13
|
-
* when present (the only part that isn't generated).
|
|
14
|
-
*
|
|
15
|
-
* Never edit the generated files by hand — they are overwritten on every build.
|
|
16
|
-
* Run automatically during `bun run build`.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
import { spawnSync } from "node:child_process";
|
|
20
|
-
import { existsSync } from "node:fs";
|
|
21
|
-
import { join, resolve, dirname } from "node:path";
|
|
22
|
-
import { fileURLToPath } from "node:url";
|
|
23
|
-
|
|
24
|
-
const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
|
25
|
-
const CLI = join(ROOT, "dist", "cli", "index.mjs");
|
|
26
|
-
const OUT_DIR = process.env.PAI_DOCS_OUT ?? join(ROOT, "docs", "commands");
|
|
27
|
-
|
|
28
|
-
if (!existsSync(CLI)) {
|
|
29
|
-
console.error(`✖ ${CLI} not found — run tsdown first.`);
|
|
30
|
-
process.exit(1);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const r = spawnSync(process.execPath, [CLI, "doc", "--dir", OUT_DIR, "--examples", join(ROOT, "docs", "commands", "_examples")], {
|
|
34
|
-
encoding: "utf8",
|
|
35
|
-
stdio: ["ignore", "pipe", "inherit"],
|
|
36
|
-
});
|
|
37
|
-
if (r.status !== 0) {
|
|
38
|
-
console.error("✖ build-docs failed: `pai doc --dir` exited with", r.status);
|
|
39
|
-
process.exit(1);
|
|
40
|
-
}
|
|
41
|
-
console.log(`✔ ${r.stdout.trim()} (docs/commands)`);
|