@tekmidian/pai 1.0.4 → 1.0.6
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/dist/{aibroker-client-CQPGqLxL.mjs → aibroker-client-CXsyC7A8.mjs} +2 -2
- package/dist/aibroker-client-ChB7gSxV.mjs +3 -0
- package/dist/auto-route-Bc8xP6TQ.mjs +11 -0
- package/dist/{auto-route-21GdHL70.mjs → auto-route-YaEGVrFl.mjs} +2 -2
- package/dist/budget-DEiebT2A.mjs +15 -0
- package/dist/{caller-identity-yLFb7CKq.mjs → caller-identity-C6Nc96iM.mjs} +4 -4
- package/dist/{capacity-DEveQdFV.mjs → capacity-B2PgKAg4.mjs} +69 -6
- package/dist/{chain-D7PFur8Y.mjs → chain-CtK49-Ma.mjs} +5 -5
- package/dist/cli/index.mjs +2126 -290
- package/dist/{cockpit-actions-BfRMr2sm.mjs → cockpit-actions-C73mJAJ8.mjs} +18 -18
- package/dist/{cockpit-actions-OodH_vx_.mjs → cockpit-actions-D1OPP6Es.mjs} +30 -26
- package/dist/cockpit-memory-CLHZD64W.mjs +20 -0
- package/dist/config/defaults/config.yaml +21 -1
- package/dist/{config-XpZWOYOG.mjs → config-Bz8pAU5Q.mjs} +30 -5
- package/dist/{config-DtENJ6cL.mjs → config-DHgPx3ER.mjs} +1 -1
- package/dist/config-DLmyEK2q.mjs +4 -0
- package/dist/{config-Bu1_vbY8.mjs → config-SlZ-Z52i.mjs} +4 -3
- package/dist/{controls-JLm6g0yP.mjs → controls-rIItFeIJ.mjs} +59 -66
- package/dist/daemon/index.mjs +40 -39
- package/dist/daemon-176qA79N.mjs +46 -0
- package/dist/{daemon-nXanenDM.mjs → daemon-SoUvPUOf.mjs} +80 -30
- package/dist/daemon-mcp/index.mjs +49 -38
- package/dist/detect-C8nFP-kR.mjs +10 -0
- package/dist/{detect-BLKsUOgG.mjs → detect-DLjeYwnt.mjs} +2 -2
- package/dist/{embed-pass-e64AwDCa.mjs → embed-pass-CN1D8MXl.mjs} +5 -5
- package/dist/{embedding-gate-Cnk4YCyX.mjs → embedding-gate-BVQvUmox.mjs} +2 -2
- package/dist/{embedding-gate-6rZrWRXa.mjs → embedding-gate-iq0oQEkF.mjs} +3 -3
- package/dist/{endreason-BC-v05H_.mjs → endreason-C2-hYK0_.mjs} +4 -4
- package/dist/{factory-B7nv75rC.mjs → factory-CYwa0jYj.mjs} +6 -6
- package/dist/factory-DFwez99M.mjs +9 -0
- package/dist/{fallback-CBWpp2F2.mjs → fallback-CwPSCrX8.mjs} +9 -231
- package/dist/{health-C4FQmkJn.mjs → health-D0mUAVdw.mjs} +5 -5
- package/dist/{helpers-DSNK_1KP.mjs → helpers-Dj2nY56t.mjs} +2 -2
- package/dist/{helpers-Dz7mjTSw.mjs → helpers-DyHKAwrW.mjs} +6 -6
- package/dist/hooks/block-sleep-poll.mjs +1 -1
- package/dist/hooks/capture-all-events.mjs +68 -3
- package/dist/hooks/capture-tool-output.mjs +68 -3
- package/dist/hooks/handoff-link.mjs +128 -0
- package/dist/hooks/load-project-context.mjs +8 -8
- package/dist/hooks/local-model-hint.mjs +1 -1
- package/dist/hooks/route-agents-to-worker.mjs +1 -1
- package/dist/hooks/security-validator.mjs +842 -90
- package/dist/hooks/supervision-banner.mjs +186 -48
- package/dist/hooks/worker-edit-repair.mjs +2 -2
- package/dist/hooks/worker-guard.mjs +65 -9
- package/dist/hooks/worker-note.mjs +70 -5
- package/dist/hooks/worker-pool-host.mjs +1518 -265
- package/dist/hooks/worker-proxy.mjs +1 -1
- package/dist/hooks/worker-status-line.mjs +225 -86
- package/dist/hooks/worker-supervision.mjs +1 -1
- package/dist/hooks/worker-tool-name-repair.mjs +2 -2
- package/dist/index.mjs +9 -9
- package/dist/{ipc-client-CnYEF31R.mjs → ipc-client-CmagIFLh.mjs} +2 -2
- package/dist/{ipc-client-DN7EvoVo.mjs → ipc-client-DmbSIBUK.mjs} +1 -1
- package/dist/{kill-tree-DleMNZX3.mjs → kill-tree-DPiMscaY.mjs} +8 -8
- package/dist/kill-tree-Dxei6qlR.mjs +10 -0
- package/dist/{launch-DlZTKE3u.mjs → launch-BZT3JDoZ.mjs} +3 -3
- package/dist/{launch-Di7N-J5X.mjs → launch-Bn2Zf90h.mjs} +3 -3
- package/dist/{indexer-backend-BdjeL4P8.mjs → lessons-CFVU0cwA.mjs} +262 -43
- package/dist/{local-candidate-DLdwQt0s.mjs → local-candidate-DFd4pp-w.mjs} +3 -3
- package/dist/{local-instances-DOxSgT_L.mjs → local-instances-DhF4_sV2.mjs} +2 -2
- package/dist/{local-instances-ZeRkkuS5.mjs → local-instances-KTh8IeOT.mjs} +4 -4
- package/dist/{local-tiers-BE4jGaMa.mjs → local-tiers-CqwGUcEn.mjs} +3 -3
- package/dist/{local-tiers-DNMI5W86.mjs → local-tiers-DSlIYvvm.mjs} +3 -3
- package/dist/{main-config-ops-kTXR8Pyv.mjs → main-config-ops-rda08BCD.mjs} +3 -3
- package/dist/{main-resolver-yp_puSSb.mjs → main-resolver-BKwI0I6H.mjs} +18 -18
- package/dist/{migrate-DrA_OwlZ.mjs → migrate-C2z1YmWC.mjs} +2 -2
- package/dist/{model-inventory-h6Z9fN_o.mjs → model-inventory-BXv15B0d.mjs} +13 -13
- package/dist/{models-add-TVni3A7V.mjs → models-add-5yXTyz3g.mjs} +38 -37
- package/dist/operator-Bmv5tiHQ.mjs +7 -0
- package/dist/{operator-CyuB3aVw.mjs → operator-Br6GeswF.mjs} +2 -2
- package/dist/{pai-marker-BcZyJguM.mjs → pai-marker-D6OoVbM_.mjs} +2 -2
- package/dist/{pane-audit-Lqy9N_Ki.mjs → pane-audit-DLYy9-4g.mjs} +13 -23
- package/dist/{paths-CHifubDh.mjs → paths-CypxFTfn.mjs} +4 -4
- package/dist/{paths-CFHTloSe.mjs → paths-DIOwNcj-.mjs} +3 -3
- package/dist/{planner-j77ndkBf.mjs → planner-BzZ_2lc-.mjs} +29 -29
- package/dist/{pool-Dh-q3iJi.mjs → pool-9EsbKD-U.mjs} +2 -2
- package/dist/{pool-cli-DQ6OzRy2.mjs → pool-cli-Cy5mlycP.mjs} +6 -6
- package/dist/{pool-cli-BggU8GRp.mjs → pool-cli-Db0uDwB9.mjs} +5 -5
- package/dist/{postgres-BK4FP9Zg.mjs → postgres-B1B80bcj.mjs} +3 -3
- package/dist/{postgres-DNIOQijl.mjs → postgres-BL5oBBgY.mjs} +3 -3
- package/dist/{project-setup-CBRtFFh0.mjs → project-setup-DHxdJjEc.mjs} +24 -25
- package/dist/providers-BH6hQYbU.mjs +16 -0
- package/dist/{providers-C9QC0TtO.mjs → providers-BNV7CzC-.mjs} +6 -6
- package/dist/{query-feedback-DN52N9C5.mjs → query-feedback-BWl2HRwN.mjs} +2 -2
- package/dist/registrable-BwFiqazy.mjs +9 -0
- package/dist/{registrable-DpyTtajg.mjs → registrable-Dxs4oKIj.mjs} +4 -4
- package/dist/render-DVGXpfaT.mjs +13 -0
- package/dist/render-jPpMrudf.mjs +2240 -0
- package/dist/root-C8cxhdn9.mjs +36 -0
- package/dist/{root-C4oXlXS_.mjs → root-DmOzMeSv.mjs} +10 -10
- package/dist/route-table-COAmc1nB.mjs +15 -0
- package/dist/{router-CQSc3lk3.mjs → router-D2476pOp.mjs} +2 -2
- package/dist/{router-DwHJRgG9.mjs → router-ghujlEFb.mjs} +1 -1
- package/dist/{routing-f2zulGwD.mjs → routing-B_cg1_Xx.mjs} +13 -13
- package/dist/{routing-DmkheCRH.mjs → routing-aJKMIagQ.mjs} +16 -16
- package/dist/{run-BwZKBJZZ.mjs → run-DE9Q0ldN.mjs} +55 -31
- package/dist/{runtime-paths-WsO9sJFc.mjs → runtime-paths-twfV23YL.mjs} +2 -2
- package/dist/{scan-BBGvU5EB.mjs → scan-CNMcltOX.mjs} +7 -7
- package/dist/{scope-D-h6F6DN.mjs → scope-BTWstJ1B.mjs} +4 -4
- package/dist/session-DgZifjLx.mjs +35 -0
- package/dist/{session-Dn5OJXlg.mjs → session-HBYOABWU.mjs} +28 -28
- package/dist/session-scan-BZxnYN1v.mjs +9 -0
- package/dist/{session-scan-DUn10MBd.mjs → session-scan-CX3MKCNg.mjs} +6 -6
- package/dist/{session-usage-CPvXvSkw.mjs → session-usage-CCmPFFa6.mjs} +117 -2
- package/dist/{status-ggJ7lgVg.mjs → status-Cecau8Ps.mjs} +9 -5
- package/dist/status-D52xC_i0.mjs +6 -0
- package/dist/{tool-errors-7E13StWd.mjs → tool-errors-BFw1gv-z.mjs} +2 -2
- package/dist/{tool-errors-CJWODvlo.mjs → tool-errors-COM2JGEr.mjs} +6 -6
- package/dist/viewer-Ce-Xa9L3.mjs +22 -0
- package/dist/{viewer-wfKnvnrI.mjs → viewer-DvBg6N22.mjs} +16 -14
- package/dist/{wait-ByV0OyMZ.mjs → wait-C5iWILj_.mjs} +3 -3
- package/dist/worker-config-BmcJ9R0U.mjs +42 -0
- package/dist/{worker-config-eY5Qy4vl.mjs → worker-config-DkONNk_H.mjs} +164 -107
- package/dist/workers-config-DwzrtdYu.mjs +4 -0
- package/dist/{worktree-CRs2gyg0.mjs → worktree-O_kU6Q3y.mjs} +164 -8
- package/dist/{zettelkasten-tpCRBYvH.mjs → zettelkasten-BH8AdNh8.mjs} +4 -4
- package/dist/{zettelkasten-_h_tUm2T.mjs → zettelkasten-FFhQFESJ.mjs} +2 -2
- package/docs/commands/README.md +33 -2
- package/docs/commands/audit.md +34 -3
- package/docs/commands/backup.md +1 -1
- package/docs/commands/build.md +4 -4
- package/docs/commands/cd.md +1 -1
- package/docs/commands/clear-names.md +1 -1
- package/docs/commands/cockpit.md +1 -1
- package/docs/commands/config.md +21 -1
- package/docs/commands/daemon.md +1 -1
- package/docs/commands/db.md +1 -1
- package/docs/commands/doc.md +1 -1
- package/docs/commands/end.md +1 -1
- package/docs/commands/find.md +1 -1
- package/docs/commands/git.md +110 -0
- package/docs/commands/handoff.md +70 -0
- package/docs/commands/harness.md +74 -0
- package/docs/commands/help.md +1 -1
- package/docs/commands/home.md +1 -1
- package/docs/commands/hooks-db.md +1 -1
- package/docs/commands/identity.md +1 -1
- package/docs/commands/install.md +1 -1
- package/docs/commands/issue.md +1 -1
- package/docs/commands/kg.md +1 -1
- package/docs/commands/launch.md +1 -1
- package/docs/commands/lessons.md +201 -0
- package/docs/commands/list.md +1 -1
- package/docs/commands/ls.md +1 -1
- package/docs/commands/mcp.md +1 -1
- package/docs/commands/memory.md +1 -1
- package/docs/commands/models.md +1 -1
- package/docs/commands/more.md +1 -1
- package/docs/commands/new.md +1 -1
- package/docs/commands/notes.md +1 -1
- package/docs/commands/notify.md +1 -1
- package/docs/commands/observation.md +1 -1
- package/docs/commands/obsidian.md +1 -1
- package/docs/commands/open.md +1 -1
- package/docs/commands/pane.md +1 -1
- package/docs/commands/pause.md +1 -1
- package/docs/commands/plan.md +1 -1
- package/docs/commands/project.md +1 -1
- package/docs/commands/projects.md +1 -1
- package/docs/commands/providers.md +1 -1
- package/docs/commands/queue.md +1 -1
- package/docs/commands/registry.md +1 -1
- package/docs/commands/reload.md +1 -1
- package/docs/commands/rename.md +1 -1
- package/docs/commands/restore.md +1 -1
- package/docs/commands/resume.md +1 -1
- package/docs/commands/router.md +1 -1
- package/docs/commands/rules.md +70 -0
- package/docs/commands/session.md +1 -1
- package/docs/commands/sessions.md +1 -1
- package/docs/commands/setup.md +1 -1
- package/docs/commands/setups.md +1 -1
- package/docs/commands/shell-init.md +1 -1
- package/docs/commands/skill.md +1 -1
- package/docs/commands/task.md +1 -1
- package/docs/commands/tasks.md +1 -1
- package/docs/commands/topic.md +1 -1
- package/docs/commands/update.md +1 -1
- package/docs/commands/worker.md +1 -1
- package/docs/commands/zettel.md +1 -1
- package/docs/concepts/panes.md +3 -2
- package/gemini-extension.json +1 -1
- package/package.json +2 -2
- package/pai-plugin.json +1 -1
- package/plugins/context-preservation/plugin.json +1 -1
- package/plugins/core/plugin.json +1 -1
- 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/ts/lib/loop-guard.ts +3 -5
- package/src/hooks/ts/lib/rules/builtin/base64-decode-to-shell.rule.yaml +13 -0
- package/src/hooks/ts/lib/rules/builtin/chmod-world-writable.rule.yaml +13 -0
- package/src/hooks/ts/lib/rules/builtin/chmod-zero.rule.yaml +11 -0
- package/src/hooks/ts/lib/rules/builtin/credential-file-read.rule.yaml +13 -0
- package/src/hooks/ts/lib/rules/builtin/credential-read-then-network.rule.yaml +29 -0
- package/src/hooks/ts/lib/rules/builtin/crontab-persistence.rule.yaml +10 -0
- package/src/hooks/ts/lib/rules/builtin/curl-piped-to-shell.rule.yaml +15 -0
- package/src/hooks/ts/lib/rules/builtin/download-then-execute.rule.yaml +30 -0
- package/src/hooks/ts/lib/rules/builtin/find-root-delete.rule.yaml +11 -0
- package/src/hooks/ts/lib/rules/builtin/git-push-force.rule.yaml +24 -0
- package/src/hooks/ts/lib/rules/builtin/git-push-plus-refspec.rule.yaml +12 -0
- package/src/hooks/ts/lib/rules/builtin/git-reset-hard.rule.yaml +12 -0
- package/src/hooks/ts/lib/rules/builtin/injection-then-tool.rule.yaml +30 -0
- package/src/hooks/ts/lib/rules/builtin/instruction-override-disregard.rule.yaml +12 -0
- package/src/hooks/ts/lib/rules/builtin/instruction-override-ignore.rule.yaml +13 -0
- package/src/hooks/ts/lib/rules/builtin/launchagents-write-persistence.rule.yaml +12 -0
- package/src/hooks/ts/lib/rules/builtin/launchctl-load-persistence.rule.yaml +10 -0
- package/src/hooks/ts/lib/rules/builtin/reverse-shell-dev-tcp.rule.yaml +11 -0
- package/src/hooks/ts/lib/rules/builtin/reverse-shell-interactive-bash.rule.yaml +11 -0
- package/src/hooks/ts/lib/rules/builtin/rm-recursive-parent.rule.yaml +11 -0
- package/src/hooks/ts/lib/rules/builtin/rm-recursive-relative.rule.yaml +11 -0
- package/src/hooks/ts/lib/rules/builtin/rm-recursive-root.rule.yaml +24 -0
- package/src/hooks/ts/lib/rules/builtin/rm-trailing-tilde.rule.yaml +11 -0
- package/src/hooks/ts/lib/rules/builtin/sudoers-nopasswd.rule.yaml +15 -0
- package/src/hooks/ts/lib/rules/builtin.generated.ts +530 -0
- package/src/hooks/ts/lib/rules/eval.ts +74 -0
- package/src/hooks/ts/lib/rules/lint.ts +102 -0
- package/src/hooks/ts/lib/rules/load.ts +229 -0
- package/src/hooks/ts/lib/rules/types.ts +56 -0
- package/src/hooks/ts/pre-tool-use/security-validator.ts +27 -96
- package/src/hooks/ts/user-prompt/handoff-link.ts +34 -0
- package/dist/aibroker-client-BxzeEHPF.mjs +0 -3
- package/dist/auto-route-C3S2W3Bc.mjs +0 -11
- package/dist/budget-BrloTOZW.mjs +0 -15
- package/dist/cockpit-memory-teG9M8bG.mjs +0 -20
- package/dist/config-Cxi-aBf4.mjs +0 -4
- package/dist/daemon-DeYImF1F.mjs +0 -45
- package/dist/detect-Rrimh0xc.mjs +0 -10
- package/dist/factory-Bs9imVMq.mjs +0 -9
- package/dist/kill-tree-SV6hrIa3.mjs +0 -10
- package/dist/operator-BTqvTIc8.mjs +0 -7
- package/dist/providers-FvCLzFge.mjs +0 -16
- package/dist/registrable-BzH4TObg.mjs +0 -9
- package/dist/render-B35bQTE-.mjs +0 -13
- package/dist/render-C84BqQRC.mjs +0 -903
- package/dist/root-DD1xx_Vu.mjs +0 -36
- package/dist/route-table-FEfDuhIV.mjs +0 -15
- package/dist/session-BAhtXdxj.mjs +0 -35
- package/dist/session-scan-B57dNuA4.mjs +0 -9
- package/dist/status-Dm4dYciN.mjs +0 -6
- package/dist/viewer-DEySE4c_.mjs +0 -22
- package/dist/worker-config-CO5FXLAT.mjs +0 -41
- package/dist/workers-config-f8KrkY4L.mjs +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as aibrokerSocketPath } from "./runtime-paths-
|
|
1
|
+
import { n as aibrokerSocketPath } from "./runtime-paths-twfV23YL.mjs";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
import { connect } from "node:net";
|
|
4
4
|
|
|
@@ -177,4 +177,4 @@ async function switchToSession(target, opts = {}) {
|
|
|
177
177
|
|
|
178
178
|
//#endregion
|
|
179
179
|
export { switchToSession as i, fetchLiveSessions as n, sendToSession as r, callAiBroker as t };
|
|
180
|
-
//# sourceMappingURL=aibroker-client-
|
|
180
|
+
//# sourceMappingURL=aibroker-client-CXsyC7A8.mjs.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "./config-Bz8pAU5Q.mjs";
|
|
2
|
+
import "./config-SlZ-Z52i.mjs";
|
|
3
|
+
import "./paths-CypxFTfn.mjs";
|
|
4
|
+
import "./worktree-O_kU6Q3y.mjs";
|
|
5
|
+
import "./status-Cecau8Ps.mjs";
|
|
6
|
+
import "./pool-9EsbKD-U.mjs";
|
|
7
|
+
import "./registrable-Dxs4oKIj.mjs";
|
|
8
|
+
import "./pai-marker-D6OoVbM_.mjs";
|
|
9
|
+
import { n as formatAutoRouteJson, t as autoRoute } from "./auto-route-YaEGVrFl.mjs";
|
|
10
|
+
|
|
11
|
+
export { autoRoute, formatAutoRouteJson };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as readPaiMarker } from "./pai-marker-
|
|
1
|
+
import { r as readPaiMarker } from "./pai-marker-D6OoVbM_.mjs";
|
|
2
2
|
import { i as populateSlugs } from "./search-RSyeQqj1.mjs";
|
|
3
3
|
import { existsSync } from "node:fs";
|
|
4
4
|
import { dirname, resolve } from "node:path";
|
|
@@ -158,4 +158,4 @@ function formatAutoRouteJson(result) {
|
|
|
158
158
|
|
|
159
159
|
//#endregion
|
|
160
160
|
export { formatAutoRouteJson as n, detectTopicShift as r, autoRoute as t };
|
|
161
|
-
//# sourceMappingURL=auto-route-
|
|
161
|
+
//# sourceMappingURL=auto-route-YaEGVrFl.mjs.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import "./config-Bz8pAU5Q.mjs";
|
|
2
|
+
import "./config-SlZ-Z52i.mjs";
|
|
3
|
+
import "./paths-CypxFTfn.mjs";
|
|
4
|
+
import "./status-Cecau8Ps.mjs";
|
|
5
|
+
import "./scope-BTWstJ1B.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-aJKMIagQ.mjs";
|
|
7
|
+
import "./tool-errors-BFw1gv-z.mjs";
|
|
8
|
+
import "./wait-C5iWILj_.mjs";
|
|
9
|
+
import "./local-tiers-CqwGUcEn.mjs";
|
|
10
|
+
import "./caller-identity-C6Nc96iM.mjs";
|
|
11
|
+
import "./capacity-B2PgKAg4.mjs";
|
|
12
|
+
import "./local-instances-DhF4_sV2.mjs";
|
|
13
|
+
import "./local-candidate-DFd4pp-w.mjs";
|
|
14
|
+
|
|
15
|
+
export { BUDGET_TTL_MS, BudgetCache, budgetCache, budgetExceeded, budgetFresh, budgetFull, budgetSkipReason, budgetUntilLabel, budgetWall, fetchBudgetReading, pickBudgetWindow };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { f as readMainConfigRaw } from "./config-
|
|
3
|
-
import { i as itermUuid } from "./scope-
|
|
1
|
+
import { _ as paiHomePath, l as claudeHomeDir } from "./runtime-paths-twfV23YL.mjs";
|
|
2
|
+
import { f as readMainConfigRaw } from "./config-SlZ-Z52i.mjs";
|
|
3
|
+
import { i as itermUuid } from "./scope-BTWstJ1B.mjs";
|
|
4
4
|
import { n as minOf } from "./min-max-DrSRUaWQ.mjs";
|
|
5
5
|
import { existsSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, rmdirSync, statSync, writeFileSync } from "node:fs";
|
|
6
6
|
import { join } from "node:path";
|
|
@@ -371,4 +371,4 @@ function callerIdentity(env = process.env, deps = {}) {
|
|
|
371
371
|
|
|
372
372
|
//#endregion
|
|
373
373
|
export { buildSlots as _, buildsDir as a, stallMinutes as b, listBuilds as c, releaseBuildsOf as d, removeTicket as f, waitReason as g, tryStart as h, buildNext as i, listBuildsSync as l, ticketKind as m, breakStaleMutex as n, enqueue as o, renderBuildQueue as p, buildLogPath as r, getTicket as s, callerIdentity as t, patchTicket as u, poolSlots as v, testSlots as x, slotsFor as y };
|
|
374
|
-
//# sourceMappingURL=caller-identity-
|
|
374
|
+
//# sourceMappingURL=caller-identity-C6Nc96iM.mjs.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { m as isLocalProvider } from "./config-
|
|
2
|
-
import { O as reconcileStatuses, g as isLive, s as alive, v as loadStatus, w as ownsPid, y as loadStatuses } from "./status-
|
|
1
|
+
import { m as isLocalProvider } from "./config-Bz8pAU5Q.mjs";
|
|
2
|
+
import { O as reconcileStatuses, g as isLive, s as alive, v as loadStatus, w as ownsPid, y as loadStatuses } from "./status-Cecau8Ps.mjs";
|
|
3
|
+
import { D as fmtElapsed } from "./wait-C5iWILj_.mjs";
|
|
3
4
|
import { mkdirSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
4
5
|
import { join } from "node:path";
|
|
5
6
|
|
|
@@ -196,8 +197,15 @@ function providerCap(config, provider) {
|
|
|
196
197
|
const sessionScopeKey = (name) => `session~${name}`;
|
|
197
198
|
const queueDir = (logDir, provider) => join(logDir, "queue", provider.replace(/[^\w.~-]/g, "_"));
|
|
198
199
|
const entryText = (e) => `${e.pid}${e.front ? " front" : ""}${e.rank === void 0 ? "" : ` ${e.rank}`}${e.since === void 0 ? "" : ` @${e.since}`}`;
|
|
200
|
+
/** A ticket deleted (its run stopped) or written unparsably between the listing and this read is absent, not an error. */
|
|
199
201
|
function readEntry(dir, id) {
|
|
200
|
-
|
|
202
|
+
let text;
|
|
203
|
+
try {
|
|
204
|
+
text = readFileSync(join(dir, id), "utf8");
|
|
205
|
+
} catch {
|
|
206
|
+
return null;
|
|
207
|
+
}
|
|
208
|
+
const [p, ...marks] = text.trim().split(/\s+/);
|
|
201
209
|
const rank = marks.map(Number).find((n) => Number.isInteger(n));
|
|
202
210
|
const at = marks.find((m) => m.startsWith("@"));
|
|
203
211
|
const since = at ? Number(at.slice(1)) : NaN;
|
|
@@ -290,6 +298,7 @@ function liveEntries(logDir, provider, isAlive) {
|
|
|
290
298
|
const out = [];
|
|
291
299
|
for (const id of names.sort()) {
|
|
292
300
|
const e = readEntry(dir, id);
|
|
301
|
+
if (!e) continue;
|
|
293
302
|
if (Number.isInteger(e.pid) && e.pid > 0 && isAlive(e.pid)) out.push(e);
|
|
294
303
|
else rmSync(join(dir, id), { force: true });
|
|
295
304
|
}
|
|
@@ -406,11 +415,53 @@ function queuedText(q) {
|
|
|
406
415
|
const hhmm = `${String(d.getHours()).padStart(2, "0")}:${String(d.getMinutes()).padStart(2, "0")}`;
|
|
407
416
|
return `queued on ${q.provider}: position ${q.position} of ${q.queued}${q.behind ? `, behind ${q.behind}` : ""} — waiting since ${hhmm}`;
|
|
408
417
|
}
|
|
418
|
+
/** The pane's queue line, refreshed in place: "queued on gyro-m · position 2 of 5 · waiting 2m10s · <label>". */
|
|
419
|
+
function queuedPaneLine(q) {
|
|
420
|
+
const parts = [
|
|
421
|
+
`queued on ${q.provider}`,
|
|
422
|
+
`position ${q.position} of ${q.queued}`,
|
|
423
|
+
`waiting ${fmtElapsed(q.elapsedSec)}`
|
|
424
|
+
];
|
|
425
|
+
if (q.behind) parts.push(`behind ${q.behind}`);
|
|
426
|
+
if (q.label) parts.push(q.label);
|
|
427
|
+
return parts.join(" · ");
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* The pane's queue file: <pane-exec dir>/<id>.queued, written while the run
|
|
431
|
+
* waits for a slot and removed when the command starts, so a pane opened
|
|
432
|
+
* before the queue shows its place in line instead of sitting empty. The
|
|
433
|
+
* wrapper (`pai pane exec`) prints it in place until the start frame arrives;
|
|
434
|
+
* a missing or malformed file is simply no queue line.
|
|
435
|
+
*/
|
|
436
|
+
function queuedFilePath(dir, id) {
|
|
437
|
+
return join(dir, `${id}.queued`);
|
|
438
|
+
}
|
|
439
|
+
function readQueued(dir, id) {
|
|
440
|
+
try {
|
|
441
|
+
const q = JSON.parse(readFileSync(queuedFilePath(dir, id), "utf8"));
|
|
442
|
+
if (typeof q.provider !== "string" || !Number.isInteger(q.position) || !Number.isInteger(q.queued) || !Number.isInteger(q.elapsedSec)) return null;
|
|
443
|
+
return q;
|
|
444
|
+
} catch {
|
|
445
|
+
return null;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
/** Write atomically (rename), so the wrapper's poll never reads a half-written file. */
|
|
449
|
+
function writeQueued(dir, id, q) {
|
|
450
|
+
mkdirSync(dir, { recursive: true });
|
|
451
|
+
const path = queuedFilePath(dir, id);
|
|
452
|
+
const tmp = `${path}.${process.pid}.tmp`;
|
|
453
|
+
writeFileSync(tmp, JSON.stringify(q), "utf8");
|
|
454
|
+
renameSync(tmp, path);
|
|
455
|
+
}
|
|
456
|
+
function removeQueued(dir, id) {
|
|
457
|
+
rmSync(queuedFilePath(dir, id), { force: true });
|
|
458
|
+
}
|
|
409
459
|
/** Resolves once fewer than `cap` other runs hold a slot on the provider and this run heads the queue; null when it never had to wait. */
|
|
410
460
|
async function capacityGate(o) {
|
|
411
461
|
const cfg = capacityOf(o.config);
|
|
412
462
|
if (o.disabled || !cfg.enabled || o.cap === void 0 || o.cap <= 0) return null;
|
|
413
|
-
const { logDir, self
|
|
463
|
+
const { logDir, self } = o;
|
|
464
|
+
let cap = o.cap;
|
|
414
465
|
const load = o.load ?? ((dir) => (reconcileStatuses(dir, /* @__PURE__ */ new Date(), 0), loadStatuses(dir)));
|
|
415
466
|
const now = o.now ?? Date.now;
|
|
416
467
|
const isAlive = o.isAlive ?? alive;
|
|
@@ -458,13 +509,24 @@ async function capacityGate(o) {
|
|
|
458
509
|
o.log?.(info().line);
|
|
459
510
|
let lastBeat = t0;
|
|
460
511
|
let alarmed = false;
|
|
512
|
+
const paneQueued = (i) => ({
|
|
513
|
+
provider: i.provider,
|
|
514
|
+
position: i.position,
|
|
515
|
+
queued: i.queued,
|
|
516
|
+
elapsedSec: i.elapsedSec,
|
|
517
|
+
...c.behind ? { behind: c.behind } : {}
|
|
518
|
+
});
|
|
461
519
|
try {
|
|
462
520
|
o.onWait?.(info());
|
|
521
|
+
o.onQueued?.(paneQueued(info()));
|
|
463
522
|
for (let n = 0;; n++) {
|
|
464
523
|
await sleep(backoffMs(n));
|
|
524
|
+
const fresh = o.capOf?.();
|
|
525
|
+
if (fresh !== void 0 && fresh > 0) cap = fresh;
|
|
465
526
|
c = check();
|
|
466
527
|
if (c.position === 1 && c.holding < cap) break;
|
|
467
528
|
o.onWait?.(info());
|
|
529
|
+
o.onQueued?.(paneQueued(info()));
|
|
468
530
|
if (!alarmed && o.onAlarm && now() - t0 >= (o.alarmMs ?? cfg.maxTotalWaitMs)) {
|
|
469
531
|
alarmed = true;
|
|
470
532
|
o.onAlarm(info());
|
|
@@ -479,6 +541,7 @@ async function capacityGate(o) {
|
|
|
479
541
|
}
|
|
480
542
|
const waitedSec = Math.round((now() - t0) / 100) / 10;
|
|
481
543
|
o.onWait?.(null);
|
|
544
|
+
o.onQueued?.(null);
|
|
482
545
|
o.log?.(`waited ${waitedSec}s for a ${label} slot`);
|
|
483
546
|
return {
|
|
484
547
|
waitedSec,
|
|
@@ -487,5 +550,5 @@ async function capacityGate(o) {
|
|
|
487
550
|
}
|
|
488
551
|
|
|
489
552
|
//#endregion
|
|
490
|
-
export { liveQueue as a,
|
|
491
|
-
//# sourceMappingURL=capacity-
|
|
553
|
+
export { sessionScopeKey as _, liveQueue as a, staggerGate as b, queuedFilePath as c, readQueued as d, removeQueued as f, sessionOf as g, resolveCap as h, effectiveCap as i, queuedPaneLine as l, reorderQueueTo as m, capacityGate as n, providerCap as o, reorderQueue as p, capacityOf as r, queueRows as s, admitCap as t, queuedText as u, writeQueued as v, recordWarmup as y };
|
|
554
|
+
//# sourceMappingURL=capacity-B2PgKAg4.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as ledgerPath, u as workersLogDir } from "./paths-
|
|
3
|
-
import {
|
|
4
|
-
import { t as runWorker } from "./run-
|
|
1
|
+
import { Et as appendLedger, M as readWorkersSection } from "./config-Bz8pAU5Q.mjs";
|
|
2
|
+
import { i as ledgerPath, u as workersLogDir } from "./paths-CypxFTfn.mjs";
|
|
3
|
+
import { S as newWorkerId, et as isFlagToken, rt as shortText } from "./status-Cecau8Ps.mjs";
|
|
4
|
+
import { t as runWorker } from "./run-DE9Q0ldN.mjs";
|
|
5
5
|
import { existsSync, mkdirSync, readFileSync } from "node:fs";
|
|
6
6
|
import { join } from "node:path";
|
|
7
7
|
|
|
@@ -163,4 +163,4 @@ async function runChain(opts, deps = {}) {
|
|
|
163
163
|
|
|
164
164
|
//#endregion
|
|
165
165
|
export { swapPromptArg as n, runChain as t };
|
|
166
|
-
//# sourceMappingURL=chain-
|
|
166
|
+
//# sourceMappingURL=chain-CtK49-Ma.mjs.map
|