@tekmidian/pai 1.0.2 → 1.0.4
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/{auto-route-B4azPk4l.mjs → auto-route-21GdHL70.mjs} +2 -2
- package/dist/auto-route-C3S2W3Bc.mjs +11 -0
- package/dist/{budget-Dod6rnA9.mjs → budget-BrloTOZW.mjs} +1 -1
- package/dist/{chain-D-yvET_y.mjs → chain-D7PFur8Y.mjs} +2 -2
- package/dist/cli/index.mjs +82 -198
- package/dist/{cockpit-actions-BWunx3rY.mjs → cockpit-actions-BfRMr2sm.mjs} +6 -6
- package/dist/{cockpit-actions-C8GlTzts.mjs → cockpit-actions-OodH_vx_.mjs} +20 -18
- package/dist/{cockpit-memory-vTlFWV7F.mjs → cockpit-memory-teG9M8bG.mjs} +6 -6
- package/dist/config/defaults/config.yaml +6 -0
- package/dist/{controls-BcKFHeG1.mjs → controls-JLm6g0yP.mjs} +7 -5
- package/dist/daemon/index.mjs +23 -23
- package/dist/daemon-DeYImF1F.mjs +45 -0
- package/dist/daemon-mcp/index.mjs +21 -21
- package/dist/{daemon-ColVHwGZ.mjs → daemon-nXanenDM.mjs} +23 -19
- package/dist/{detect-9CZNO0yf.mjs → detect-BLKsUOgG.mjs} +2 -2
- package/dist/{detect-D1ziFFfA.mjs → detect-Rrimh0xc.mjs} +3 -3
- package/dist/{embed-pass-DIWjA68P.mjs → embed-pass-e64AwDCa.mjs} +1 -1
- package/dist/{endreason-C577xIQz.mjs → endreason-BC-v05H_.mjs} +17 -3
- package/dist/{factory-DjAAsqr_.mjs → factory-B7nv75rC.mjs} +2 -2
- package/dist/{factory-Bsib-qDG.mjs → factory-Bs9imVMq.mjs} +2 -2
- package/dist/{fallback-DFlItw1Z.mjs → fallback-CBWpp2F2.mjs} +227 -5
- package/dist/{health-Dnym-qcT.mjs → health-C4FQmkJn.mjs} +2 -2
- package/dist/{helpers-BD6V-p9w.mjs → helpers-DSNK_1KP.mjs} +2 -2
- package/dist/{helpers-CMGjy_0N.mjs → helpers-Dz7mjTSw.mjs} +3 -3
- package/dist/hooks/capture-all-events.mjs +21 -2
- package/dist/hooks/capture-tool-output.mjs +21 -2
- package/dist/hooks/worker-pool-host.mjs +167 -124
- package/dist/hooks/worker-status-line.mjs +34 -6
- package/dist/index.mjs +4 -4
- package/dist/{indexer-backend-_a6UNhXJ.mjs → indexer-backend-BdjeL4P8.mjs} +32 -229
- package/dist/{ipc-client-CaiGJnSM.mjs → ipc-client-CnYEF31R.mjs} +1 -1
- package/dist/{ipc-client-ZRmDKd5Z.mjs → ipc-client-DN7EvoVo.mjs} +1 -1
- package/dist/{kill-tree-EWYaEk5v.mjs → kill-tree-DleMNZX3.mjs} +2 -2
- package/dist/{kill-tree-BG7dRVtp.mjs → kill-tree-SV6hrIa3.mjs} +2 -2
- package/dist/{launch-Jh5NVeNe.mjs → launch-Di7N-J5X.mjs} +2 -2
- package/dist/{launch-CXVlZjHt.mjs → launch-DlZTKE3u.mjs} +2 -2
- package/dist/{main-config-ops-BEMpuhDz.mjs → main-config-ops-kTXR8Pyv.mjs} +1 -1
- package/dist/{main-resolver-3Ns1HPmS.mjs → main-resolver-yp_puSSb.mjs} +5 -5
- package/dist/{model-inventory-BFVSNFT3.mjs → model-inventory-h6Z9fN_o.mjs} +1 -1
- package/dist/{models-add-BtB3Se6f.mjs → models-add-TVni3A7V.mjs} +22 -22
- package/dist/{pai-marker-DurzIbw8.mjs → pai-marker-BcZyJguM.mjs} +2 -2
- package/dist/{pane-audit-BQytYa60.mjs → pane-audit-Lqy9N_Ki.mjs} +23 -5
- package/dist/{planner-BM27GBfC.mjs → planner-j77ndkBf.mjs} +14 -14
- package/dist/{pool-BRvoOkv6.mjs → pool-Dh-q3iJi.mjs} +43 -4
- package/dist/{pool-cli-B_YR8_Gl.mjs → pool-cli-BggU8GRp.mjs} +2 -2
- package/dist/{pool-cli-DkZTAlSW.mjs → pool-cli-DQ6OzRy2.mjs} +2 -2
- package/dist/{postgres-BdBNkL_l.mjs → postgres-BK4FP9Zg.mjs} +1 -1
- package/dist/{postgres-C6ti4haA.mjs → postgres-DNIOQijl.mjs} +17 -7
- package/dist/{project-setup-CfpApz5o.mjs → project-setup-CBRtFFh0.mjs} +16 -236
- package/dist/{providers-CblTFrhz.mjs → providers-C9QC0TtO.mjs} +2 -2
- package/dist/{providers-BeDiVEb-.mjs → providers-FvCLzFge.mjs} +2 -2
- package/dist/{query-feedback-BRfPtqki.mjs → query-feedback-DN52N9C5.mjs} +1 -1
- package/dist/{registrable-C7b6givx.mjs → registrable-BzH4TObg.mjs} +3 -3
- package/dist/{registrable-Uzgmfyhz.mjs → registrable-DpyTtajg.mjs} +2 -2
- package/dist/{render-Cc2j5QG9.mjs → render-B35bQTE-.mjs} +4 -4
- package/dist/{render-CwIrgxLi.mjs → render-C84BqQRC.mjs} +3 -3
- package/dist/{root-BWy0c2Lq.mjs → root-C4oXlXS_.mjs} +7 -7
- package/dist/{root-wC_6Fx0B.mjs → root-DD1xx_Vu.mjs} +16 -16
- package/dist/route-table-FEfDuhIV.mjs +15 -0
- package/dist/{routing-BAAST9vT.mjs → routing-DmkheCRH.mjs} +126 -8
- package/dist/{routing-CENt4HH1.mjs → routing-f2zulGwD.mjs} +1 -1
- package/dist/{run-6Q9kCPem.mjs → run-BwZKBJZZ.mjs} +28 -14
- package/dist/{scan-ZQWm-_se.mjs → scan-BBGvU5EB.mjs} +4 -4
- package/dist/{session-Bok2PqRS.mjs → session-BAhtXdxj.mjs} +15 -15
- package/dist/{session-DVUExUnX.mjs → session-Dn5OJXlg.mjs} +23 -23
- package/dist/{session-scan-BJI_ZO8M.mjs → session-scan-B57dNuA4.mjs} +1 -1
- package/dist/{session-scan-W-gbwJHM.mjs → session-scan-DUn10MBd.mjs} +2 -2
- package/dist/session-usage-CPvXvSkw.mjs +222 -0
- package/dist/{sources-ESUkZaWv.mjs → sources-CiE3rZek.mjs} +1 -1
- package/dist/{viewer-MWBVJP3u.mjs → viewer-DEySE4c_.mjs} +8 -8
- package/dist/{viewer-DcpJwGKE.mjs → viewer-wfKnvnrI.mjs} +6 -6
- package/dist/{worker-config-gmAq_-rI.mjs → worker-config-CO5FXLAT.mjs} +21 -21
- package/dist/{worker-config-BDYNxbYz.mjs → worker-config-eY5Qy4vl.mjs} +322 -25
- package/dist/{worktree-CrnOqTBW.mjs → worktree-CRs2gyg0.mjs} +2 -2
- package/dist/{zettelkasten-BzMm8REH.mjs → zettelkasten-_h_tUm2T.mjs} +1 -1
- package/dist/{zettelkasten-B_rRRRvD.mjs → zettelkasten-tpCRBYvH.mjs} +2 -2
- package/docs/cockpit.md +1 -0
- package/docs/images/architecture.png +0 -0
- package/gemini-extension.json +1 -1
- package/package.json +1 -1
- 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/capture-all-events.ts +15 -3
- package/src/hooks/ts/lib/raw-capture.ts +7 -0
- package/src/hooks/ts/post-tool-use/capture-tool-output.ts +13 -3
- package/dist/auto-route-BjoMHKyI.mjs +0 -11
- package/dist/daemon-N7WhYi6I.mjs +0 -45
- package/dist/route-table-B7zpoypi.mjs +0 -15
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as readPaiMarker } from "./pai-marker-
|
|
1
|
+
import { r as readPaiMarker } from "./pai-marker-BcZyJguM.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-21GdHL70.mjs.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "./config-XpZWOYOG.mjs";
|
|
2
|
+
import "./config-Bu1_vbY8.mjs";
|
|
3
|
+
import "./paths-CHifubDh.mjs";
|
|
4
|
+
import "./worktree-CRs2gyg0.mjs";
|
|
5
|
+
import "./status-ggJ7lgVg.mjs";
|
|
6
|
+
import "./pool-Dh-q3iJi.mjs";
|
|
7
|
+
import "./registrable-DpyTtajg.mjs";
|
|
8
|
+
import "./pai-marker-BcZyJguM.mjs";
|
|
9
|
+
import { n as formatAutoRouteJson, t as autoRoute } from "./auto-route-21GdHL70.mjs";
|
|
10
|
+
|
|
11
|
+
export { autoRoute, formatAutoRouteJson };
|
|
@@ -3,7 +3,7 @@ import "./config-Bu1_vbY8.mjs";
|
|
|
3
3
|
import "./paths-CHifubDh.mjs";
|
|
4
4
|
import "./status-ggJ7lgVg.mjs";
|
|
5
5
|
import "./scope-D-h6F6DN.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-
|
|
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-DmkheCRH.mjs";
|
|
7
7
|
import "./tool-errors-7E13StWd.mjs";
|
|
8
8
|
import "./wait-ByV0OyMZ.mjs";
|
|
9
9
|
import "./local-tiers-BE4jGaMa.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as readWorkersSection, wt as appendLedger } from "./config-XpZWOYOG.mjs";
|
|
2
2
|
import { i as ledgerPath, u as workersLogDir } from "./paths-CHifubDh.mjs";
|
|
3
3
|
import { $ as isFlagToken, S as newWorkerId, nt as shortText } from "./status-ggJ7lgVg.mjs";
|
|
4
|
-
import { t as runWorker } from "./run-
|
|
4
|
+
import { t as runWorker } from "./run-BwZKBJZZ.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-D7PFur8Y.mjs.map
|
package/dist/cli/index.mjs
CHANGED
|
@@ -5,16 +5,16 @@ import { a as slugify$1, i as parseSessionFilename } from "../migrate-DrA_OwlZ.m
|
|
|
5
5
|
import { I as LOOPBACK_HOST, Q as relocateWorkersYaml, _t as contextWindowFromModelId, c as WorkersConfigError, f as escalationCloud, ht as DEFAULT_CONTEXT_WINDOW, j as readWorkersSection, m as isLocalProvider, p as getProviderOrNative, t as ANTHROPIC_NATIVE, tt as workersYamlPath, v as nativeAnthropicModels, vt as stripModelVariant, wt as appendLedger } from "../config-XpZWOYOG.mjs";
|
|
6
6
|
import { A as assertPgName, C as migrateMainConfigToYaml, D as readJsonStrict, M as postgresConnectionString, N as postgresFullTarget, O as writeJsonAtomic, P as quoteIdent, S as MainConfigError, c as loadConfig, d as paiConfigYamlFilePath, f as readMainConfigRaw, j as isContainerTarget, k as DEFAULT_PG_CONNECTION_TIMEOUT_MS, l as migrateConfigFile, n as CONFIG_FILE$2, o as expandHome, p as writeMainConfigRaw, t as CONFIG_DIR, u as paiConfigFilePath, w as resolvedMainConfigPath } from "../config-Bu1_vbY8.mjs";
|
|
7
7
|
import { i as ledgerPath, n as ensureNoMcpConfig, u as workersLogDir } from "../paths-CHifubDh.mjs";
|
|
8
|
-
import "../worktree-
|
|
8
|
+
import "../worktree-CRs2gyg0.mjs";
|
|
9
9
|
import { B as loadStatusConfig, G as writeSectionToForge, L as formatStale, U as upsertSection, b as loadStatusesCached, g as isLive, h as isChatPane, y as loadStatuses } from "../status-ggJ7lgVg.mjs";
|
|
10
|
-
import { S as inputSideTokens, h as poolSettings, i as bundleBuildStamp, j as
|
|
11
|
-
import { a as unregistrableReason, s as worktreeReason } from "../registrable-
|
|
12
|
-
import "../pai-marker-
|
|
10
|
+
import { A as readClaudeJson, N as writeClaudeJson, S as inputSideTokens, h as poolSettings, i as bundleBuildStamp, j as registerMcpScript, k as mcpEntryRunsScript, v as readPoolState, w as expandMcpNames } from "../pool-Dh-q3iJi.mjs";
|
|
11
|
+
import { a as unregistrableReason, s as worktreeReason } from "../registrable-DpyTtajg.mjs";
|
|
12
|
+
import "../pai-marker-BcZyJguM.mjs";
|
|
13
13
|
import "../helpers-CRuBUas3.mjs";
|
|
14
14
|
import { t as applyRecencyBoost } from "../search-RSyeQqj1.mjs";
|
|
15
15
|
import { t as dropItermBundleId } from "../env-BE8mrsxr.mjs";
|
|
16
16
|
import { a as ownerSessionName, d as terminalHasName } from "../scope-D-h6F6DN.mjs";
|
|
17
|
-
import {
|
|
17
|
+
import { At as hostAllowed, Bn as parkConfigFrom, Cn as providerHostPort, Dt as routerPort, E as budgetCache, Et as routerHandler, F as LimitsCache, Gn as aggregateBySession, Hn as sharedParker, Jn as formatStats, Jt as sessionStartTarget, Kn as appendUsage, Ln as setupsPath, Mn as loadSaved, On as allSetups, Ot as defaultV1Guard, Pn as saveSetup, Qn as readUsage, U as computeInventory, Un as recordDuration, Vn as setParkConfigSource, W as currentInventory, Wn as aggregate, Y as inventoryText, Zn as parseSince, at as readInventoryInput, dn as SESSION_NAME_ENV, jt as resolveBindAddress, kn as downLocalProviders, kt as displayHost, m as readRoutingState, mn as readProfiles, pt as isLoopbackProvider, qn as formatSessionStats, x as SESSION_WORKER_PROVIDER_ENV, xt as routeVerdictLine, yn as localProviderForDelegation } from "../routing-DmkheCRH.mjs";
|
|
18
18
|
import { n as minOf } from "../min-max-DrSRUaWQ.mjs";
|
|
19
19
|
import "../tool-errors-7E13StWd.mjs";
|
|
20
20
|
import "../wait-ByV0OyMZ.mjs";
|
|
@@ -24,48 +24,48 @@ import { d as setSchedConfigSource, f as sharedScheduler, i as mirrorTo, s as sc
|
|
|
24
24
|
import { i as effectiveCap, o as providerCap, r as capacityOf } from "../capacity-DEveQdFV.mjs";
|
|
25
25
|
import "../local-instances-DOxSgT_L.mjs";
|
|
26
26
|
import { n as tierProviderNames, t as isLocalCandidate } from "../local-candidate-DLdwQt0s.mjs";
|
|
27
|
-
import { n as TAILSCALE_STATUS_TIMEOUT_MS } from "../timeouts-1MLooEBB.mjs";
|
|
28
27
|
import { n as OPT, t as CliError } from "../define-CjJsmq-6.mjs";
|
|
29
|
-
import { a as getStorageBackend, c as MergeError, f as humanDuration, i as getRegistryBackend, l as federationDbPath, o as oldRegistryPath, r as createStorageBackend, s as registryDbPath, u as oldFederationPath } from "../factory-
|
|
30
|
-
import { c as resolveFromModule, i as retryTransient, n as embedChunksWithBackend, r as indexProjectWithBackend, s as packageRoot } from "../postgres-
|
|
28
|
+
import { a as getStorageBackend, c as MergeError, f as humanDuration, i as getRegistryBackend, l as federationDbPath, o as oldRegistryPath, r as createStorageBackend, s as registryDbPath, u as oldFederationPath } from "../factory-B7nv75rC.mjs";
|
|
29
|
+
import { c as resolveFromModule, i as retryTransient, n as embedChunksWithBackend, r as indexProjectWithBackend, s as packageRoot } from "../postgres-DNIOQijl.mjs";
|
|
31
30
|
import { d as OLLAMA_ID, f as ollamaDefaultUrl, i as measureThroughput, l as provisionOllama, o as createBackend, s as detectBackends, u as OLLAMA_DEFAULT_MODEL } from "../embedding-gate-6rZrWRXa.mjs";
|
|
32
31
|
import "../embeddings-BVq3esBF.mjs";
|
|
33
32
|
import "../router-CQSc3lk3.mjs";
|
|
34
|
-
import { t as detectProject } from "../detect-
|
|
35
|
-
import { n as getProject$1, o as requireProject, r as getProjectAliases, s as resolveIdentifier } from "../helpers-
|
|
36
|
-
import { a as resolveHome, c as upsertSession, d as scanTranscriptFolders, f as transcriptFiles, l as claudeProjectsDir$1, n as loadScanConfig, o as saveScanConfig, r as migrateScanConfig, s as upsertProject, t as cmdScan, u as findMovedProjects } from "../scan-
|
|
37
|
-
import { A as cmdAdd, B as cmdRebind, F as cmdEdit, H as cmdUnarchive, I as cmdGo, L as cmdInfo$1, M as cmdArchive, N as cmdConsolidate, P as cmdDetect, R as cmdList$1, S as legacy, U as findMovedPath, V as cmdTag$1, _ as cmdList, a as newTop, b as cmdSlug, f as sessionCommand, g as cmdInfo, h as cmdAutoRoute, i as lsCommand, j as cmdAlias, l as renameTop, m as cmdActive, r as collectView, s as openTop, v as cmdRename, x as cmdTag, y as cmdRoute, z as cmdMove } from "../session-
|
|
38
|
-
import { a as detectCurrentProviderName, i as detectCurrentModel, n as buildLaunchPlan, o as launchableProviderNames, r as buildLaunchRows, s as maskLaunchEnv } from "../launch-
|
|
39
|
-
import { a as colorEnabled, c as renderCommandHelp, d as renderOverview, f as renderTable$2, l as renderMarkdown, m as usageLine, o as makeStyle, p as suggest, s as mdCommand, u as renderMore } from "../health-
|
|
40
|
-
import { a as providerResumePlan, n as launchInDir, o as restoreTopLevel, r as launchPrompt, s as resumeArgvText, t as hasConversation } from "../launch-
|
|
41
|
-
import { _ as setupsTable, a as lastSetup, m as rootCommand } from "../root-
|
|
33
|
+
import { t as detectProject } from "../detect-BLKsUOgG.mjs";
|
|
34
|
+
import { n as getProject$1, o as requireProject, r as getProjectAliases, s as resolveIdentifier } from "../helpers-DSNK_1KP.mjs";
|
|
35
|
+
import { a as resolveHome, c as upsertSession, d as scanTranscriptFolders, f as transcriptFiles, l as claudeProjectsDir$1, n as loadScanConfig, o as saveScanConfig, r as migrateScanConfig, s as upsertProject, t as cmdScan, u as findMovedProjects } from "../scan-BBGvU5EB.mjs";
|
|
36
|
+
import { A as cmdAdd, B as cmdRebind, F as cmdEdit, H as cmdUnarchive, I as cmdGo, L as cmdInfo$1, M as cmdArchive, N as cmdConsolidate, P as cmdDetect, R as cmdList$1, S as legacy, U as findMovedPath, V as cmdTag$1, _ as cmdList, a as newTop, b as cmdSlug, f as sessionCommand, g as cmdInfo, h as cmdAutoRoute, i as lsCommand, j as cmdAlias, l as renameTop, m as cmdActive, r as collectView, s as openTop, v as cmdRename, x as cmdTag, y as cmdRoute, z as cmdMove } from "../session-Dn5OJXlg.mjs";
|
|
37
|
+
import { a as detectCurrentProviderName, i as detectCurrentModel, n as buildLaunchPlan, o as launchableProviderNames, r as buildLaunchRows, s as maskLaunchEnv } from "../launch-Di7N-J5X.mjs";
|
|
38
|
+
import { a as colorEnabled, c as renderCommandHelp, d as renderOverview, f as renderTable$2, l as renderMarkdown, m as usageLine, o as makeStyle, p as suggest, s as mdCommand, u as renderMore } from "../health-C4FQmkJn.mjs";
|
|
39
|
+
import { a as providerResumePlan, n as launchInDir, o as restoreTopLevel, r as launchPrompt, s as resumeArgvText, t as hasConversation } from "../launch-DlZTKE3u.mjs";
|
|
40
|
+
import { _ as setupsTable, a as lastSetup, m as rootCommand } from "../root-C4oXlXS_.mjs";
|
|
42
41
|
import { n as fetchLiveSessions, r as sendToSession, t as callAiBroker } from "../aibroker-client-CQPGqLxL.mjs";
|
|
43
|
-
import { a as resolveSessionByNameOrId, o as scanCacheFilePath, r as migrateSessionScanCache, s as scanSessions, t as fmtAge } from "../session-scan-
|
|
44
|
-
import { A as routerPidFile, B as usageContextTokens, D as routerHandoverFile, E as probeRouter, F as startHandover, I as paneWaiver, L as launchPane, M as routerSwapArgs, P as spawnRouter, R as noTerminalReasons, S as usageJson, T as projectLaunchConfig, b as renderUsage, c as reportOriginWithHost, f as dirtyPaths, g as realRunnerDeps, j as routerRunningPid, k as routerLogFile, l as runMessenger, s as finishDetached, u as startDetached, w as pinNotices, x as transcriptUsage, y as priceTableText } from "../run-
|
|
45
|
-
import { C as readRunLog, D as resumeState, E as requestPlanStop, F as runLogPath, I as PlanTracker, M as dirtyConflicts, O as runExitCode, P as loadPlan, S as planStopPath, T as renderStatus, Y as readRunLock, ht as resolveHostSession, j as PlanError, jt as runPaneExec, k as runPlan, l as PlanReporter, nt as closePaneForWorker, ot as inVisiblePane, q as planLockPath, rt as closeSelfPane, u as QueueReporter, vt as writePaneTitle, w as renderSchedule, x as planStatus, y as blockedMessage, yt as psTable } from "../controls-
|
|
46
|
-
import "../endreason-
|
|
47
|
-
import { N as endBuildWait, j as beginBuildWait } from "../render-
|
|
42
|
+
import { a as resolveSessionByNameOrId, o as scanCacheFilePath, r as migrateSessionScanCache, s as scanSessions, t as fmtAge } from "../session-scan-DUn10MBd.mjs";
|
|
43
|
+
import { A as routerPidFile, B as usageContextTokens, D as routerHandoverFile, E as probeRouter, F as startHandover, I as paneWaiver, L as launchPane, M as routerSwapArgs, P as spawnRouter, R as noTerminalReasons, S as usageJson, T as projectLaunchConfig, b as renderUsage, c as reportOriginWithHost, f as dirtyPaths, g as realRunnerDeps, j as routerRunningPid, k as routerLogFile, l as runMessenger, s as finishDetached, u as startDetached, w as pinNotices, x as transcriptUsage, y as priceTableText } from "../run-BwZKBJZZ.mjs";
|
|
44
|
+
import { C as readRunLog, D as resumeState, E as requestPlanStop, F as runLogPath, I as PlanTracker, M as dirtyConflicts, O as runExitCode, P as loadPlan, S as planStopPath, T as renderStatus, Y as readRunLock, ht as resolveHostSession, j as PlanError, jt as runPaneExec, k as runPlan, l as PlanReporter, nt as closePaneForWorker, ot as inVisiblePane, q as planLockPath, rt as closeSelfPane, u as QueueReporter, vt as writePaneTitle, w as renderSchedule, x as planStatus, y as blockedMessage, yt as psTable } from "../controls-JLm6g0yP.mjs";
|
|
45
|
+
import "../endreason-BC-v05H_.mjs";
|
|
46
|
+
import { N as endBuildWait, j as beginBuildWait } from "../render-C84BqQRC.mjs";
|
|
48
47
|
import "../operator-CyuB3aVw.mjs";
|
|
49
|
-
import "../kill-tree-
|
|
50
|
-
import { s as poolReloadLive } from "../pool-cli-
|
|
51
|
-
import "../chain-
|
|
52
|
-
import { _ as issueClaims, a as branchDiff, b as workerCommand, 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 } from "../project-setup-
|
|
53
|
-
import { m as runInPane, r as closeFinishedPanes } from "../pane-audit-
|
|
54
|
-
import "../viewer-
|
|
55
|
-
import
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import "../
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
48
|
+
import "../kill-tree-DleMNZX3.mjs";
|
|
49
|
+
import { s as poolReloadLive } from "../pool-cli-BggU8GRp.mjs";
|
|
50
|
+
import "../chain-D7PFur8Y.mjs";
|
|
51
|
+
import { _ as issueClaims, a as branchDiff, b as workerCommand, 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 } from "../project-setup-CBRtFFh0.mjs";
|
|
52
|
+
import { m as runInPane, r as closeFinishedPanes } from "../pane-audit-Lqy9N_Ki.mjs";
|
|
53
|
+
import "../viewer-wfKnvnrI.mjs";
|
|
54
|
+
import "../fallback-CBWpp2F2.mjs";
|
|
55
|
+
import { g as setWorkersEnabled, s as describeProviders } from "../providers-C9QC0TtO.mjs";
|
|
56
|
+
import { $ as exportDefaultLayout, B as mergeSettings, G as cachedRows, J as handleCockpit, K as cachedSessionMap, Q as warmCockpit, W as SystemMonitor, X as setEndpointHealth, Y as setActionHooks, Z as setRuntimeSampler, at as withWorkerAttribution, et as loadBuildsConfig, it as sessionDisplayName, lt as providersCommand, n as WORKER_CONFIG_COMMANDS, nt as loadSessionMap, q as cachedWorkerWindows, rt as loadWorkerWindows, t as PROVIDER_EDIT_COMMANDS, tt as createEndpointHealth, z as installWorkers } from "../worker-config-eY5Qy4vl.mjs";
|
|
57
|
+
import { a as listConfigOp, i as getConfigValueOp, n as formatConfigGetOutput, o as setConfigValueOp, r as formatConfigSource, s as unsetConfigValueOp, t as MainConfigOpsError } from "../main-config-ops-kTXR8Pyv.mjs";
|
|
58
|
+
import { H as acquireRun, U as readRun, V as cockpitProbeSettings, k as readRuntimeCommands } from "../cockpit-actions-OodH_vx_.mjs";
|
|
59
|
+
import { n as PaiClient } from "../ipc-client-CnYEF31R.mjs";
|
|
60
|
+
import { a as EMBED_PASS_BATCH_SIZE, c as liveYieldCheck, n as DEFAULT_EMBED_MAX_LOAD, o as formatEmbedStatus, r as DEFAULT_EMBED_MAX_MINUTES, s as lastRecordedEmbedPass } from "../embed-pass-e64AwDCa.mjs";
|
|
61
|
+
import { i as totalUsageTokens, r as parseSessionUsage } from "../session-usage-CPvXvSkw.mjs";
|
|
62
|
+
import { Bt as findLatestNote, C as migrateSummaryCooldowns, Dt as nextOccurrence, Et as describeQuiet, Ht as readBodyFile, It as readContextHandoverCache, Mt as LAUNCHD_LABEL, Ot as readQuiet, Pt as resolveDaemonPid, Rt as appendCheckpointToNote, St as loadSessionKeepaliveState, Ut as restartRouter, Vt as findNotesDir$1, bt as reapJob, ht as obsidianEnabled, i as reexecBackground, jt as writeQuiet, mt as OBSIDIAN_DISABLED_MESSAGE, o as backfillKgFromNotes, s as migrateKgBackfillState, v as migrateWorkQueue, vt as migrateIdentityFile, wt as sessionKeepaliveLedgerSummary, yt as jobPaths, zt as applyContinue } from "../indexer-backend-BdjeL4P8.mjs";
|
|
63
|
+
import { n as queriesDirPath, t as migrateQueriesDir } from "../query-feedback-DN52N9C5.mjs";
|
|
64
64
|
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";
|
|
65
|
-
import { createHash,
|
|
66
|
-
import { basename, dirname,
|
|
65
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
66
|
+
import { basename, dirname, join, relative, resolve, sep } from "node:path";
|
|
67
67
|
import chalk from "chalk";
|
|
68
|
-
import { cpus, homedir,
|
|
68
|
+
import { cpus, homedir, platform, userInfo } from "node:os";
|
|
69
69
|
import { execFile, execFileSync, execSync, spawn, spawnSync } from "node:child_process";
|
|
70
70
|
import { fileURLToPath } from "node:url";
|
|
71
71
|
import http from "node:http";
|
|
@@ -590,77 +590,6 @@ function startStallMonitor(o) {
|
|
|
590
590
|
};
|
|
591
591
|
}
|
|
592
592
|
|
|
593
|
-
//#endregion
|
|
594
|
-
//#region src/router/cockpit-auth.ts
|
|
595
|
-
/** The /v1 remote rule: loopback (any 127/8, ::1, v4-mapped) or the tailnet. */
|
|
596
|
-
function defaultV1Guard(remoteAddress) {
|
|
597
|
-
return isLoopbackAddress(remoteAddress) || inTailscaleRange(remoteAddress);
|
|
598
|
-
}
|
|
599
|
-
/** Strip the ::ffff: IPv4-mapped prefix (Node reports v4 peers this way on v6 sockets). */
|
|
600
|
-
function normalizeIp(ip) {
|
|
601
|
-
const a = (ip ?? "").trim().toLowerCase();
|
|
602
|
-
return a.startsWith("::ffff:") ? a.slice(7) : a;
|
|
603
|
-
}
|
|
604
|
-
function isLoopbackAddress(ip) {
|
|
605
|
-
const a = normalizeIp(ip);
|
|
606
|
-
return a === "::1" || a.startsWith("127.");
|
|
607
|
-
}
|
|
608
|
-
function ipv4ToInt(ip) {
|
|
609
|
-
const parts = ip.split(".");
|
|
610
|
-
if (parts.length !== 4) return null;
|
|
611
|
-
let out = 0;
|
|
612
|
-
for (const p of parts) {
|
|
613
|
-
if (!/^\d{1,3}$/.test(p)) return null;
|
|
614
|
-
const n = Number(p);
|
|
615
|
-
if (n > 255) return null;
|
|
616
|
-
out = out * 256 + n;
|
|
617
|
-
}
|
|
618
|
-
return out;
|
|
619
|
-
}
|
|
620
|
-
function inTailscaleRange(ip) {
|
|
621
|
-
const n = ipv4ToInt(normalizeIp(ip));
|
|
622
|
-
if (n === null) return false;
|
|
623
|
-
return (n & 4290772992) === 1681915904;
|
|
624
|
-
}
|
|
625
|
-
/**
|
|
626
|
-
* router.bind → a concrete address. "loopback" (also empty/unset) is
|
|
627
|
-
* 127.0.0.1; "tailscale" resolves the utun/tailscale interface's IPv4 inside
|
|
628
|
-
* 100.64.0.0/10 (null when Tailscale is down); anything else must be a dotted
|
|
629
|
-
* quad — 0.0.0.0 and every non-IPv4 value are refused (null).
|
|
630
|
-
*/
|
|
631
|
-
function resolveBindAddress(bind, interfaces = networkInterfaces) {
|
|
632
|
-
const v = (bind ?? "").trim().toLowerCase();
|
|
633
|
-
if (!v || v === "loopback") return LOOPBACK_HOST;
|
|
634
|
-
if (v === "tailscale") {
|
|
635
|
-
let fallback;
|
|
636
|
-
for (const [name, addrs] of Object.entries(interfaces() ?? {})) for (const a of addrs ?? []) {
|
|
637
|
-
if (a.family !== "IPv4" && a.family !== 4) continue;
|
|
638
|
-
if (!inTailscaleRange(a.address)) continue;
|
|
639
|
-
if (/^(utun|tailscale)/i.test(name)) return a.address;
|
|
640
|
-
fallback ??= a.address;
|
|
641
|
-
}
|
|
642
|
-
return fallback ?? null;
|
|
643
|
-
}
|
|
644
|
-
if (v === "0.0.0.0" || v === "::" || v === "*") return null;
|
|
645
|
-
return ipv4ToInt(v) !== null ? v : null;
|
|
646
|
-
}
|
|
647
|
-
/**
|
|
648
|
-
* The address to show a human for a bind address: the tailnet hostname
|
|
649
|
-
* (MagicDNS name, from `tailscale status --json`) when the address is the
|
|
650
|
-
* machine's own Tailscale IP, else the address itself.
|
|
651
|
-
*/
|
|
652
|
-
async function displayHost(addr) {
|
|
653
|
-
if (!inTailscaleRange(addr)) return addr;
|
|
654
|
-
try {
|
|
655
|
-
const { execFile } = await import("node:child_process");
|
|
656
|
-
const { promisify } = await import("node:util");
|
|
657
|
-
const { stdout } = await promisify(execFile)("tailscale", ["status", "--json"], { timeout: TAILSCALE_STATUS_TIMEOUT_MS });
|
|
658
|
-
const self = JSON.parse(stdout).Self;
|
|
659
|
-
if (self?.DNSName && self.TailscaleIPs?.includes(addr)) return self.DNSName.replace(/\.$/, "");
|
|
660
|
-
} catch {}
|
|
661
|
-
return addr;
|
|
662
|
-
}
|
|
663
|
-
|
|
664
593
|
//#endregion
|
|
665
594
|
//#region src/router/runtime-samples.ts
|
|
666
595
|
/**
|
|
@@ -901,7 +830,7 @@ function routerSamplerDeps(sched, engineStatusTimeoutMs = () => DEFAULT_RUNTIME_
|
|
|
901
830
|
});
|
|
902
831
|
return {
|
|
903
832
|
inventory: async () => {
|
|
904
|
-
const { currentInventory } = await import("../model-inventory-
|
|
833
|
+
const { currentInventory } = await import("../model-inventory-h6Z9fN_o.mjs");
|
|
905
834
|
return currentInventory();
|
|
906
835
|
},
|
|
907
836
|
sched,
|
|
@@ -916,7 +845,7 @@ function routerSamplerDeps(sched, engineStatusTimeoutMs = () => DEFAULT_RUNTIME_
|
|
|
916
845
|
}
|
|
917
846
|
},
|
|
918
847
|
async rssMb(port) {
|
|
919
|
-
const { processTreeRssMb } = await import("../model-inventory-
|
|
848
|
+
const { processTreeRssMb } = await import("../model-inventory-h6Z9fN_o.mjs");
|
|
920
849
|
const pid = (await exec("lsof", [
|
|
921
850
|
"-ti",
|
|
922
851
|
`tcp:${port}`,
|
|
@@ -1231,6 +1160,12 @@ const runCommand = {
|
|
|
1231
1160
|
const addr = resolveBindAddress(bindName);
|
|
1232
1161
|
if (!addr) throw new CliError(`cannot resolve router.bind "${bindName}" — use "loopback", "tailscale", or an IPv4 (never 0.0.0.0)`, "pai daemon status");
|
|
1233
1162
|
const remote = addr !== LOOPBACK_HOST;
|
|
1163
|
+
const extraHosts = (loadConfig().router.allowedHosts ?? []).filter((h) => h.trim());
|
|
1164
|
+
const hosts = remote ? {
|
|
1165
|
+
bind: addr,
|
|
1166
|
+
extraHosts
|
|
1167
|
+
} : void 0;
|
|
1168
|
+
if (remote && !extraHosts.some((h) => hostAllowed(`${h}:${port}`, addr, extraHosts))) process.stderr.write(`pai: router: router.allowedHosts has no entry matching the bind ${addr} — cockpit requests by hostname will be refused (403)\n`);
|
|
1234
1169
|
const rows = cachedRows(usageFile);
|
|
1235
1170
|
let schedCache;
|
|
1236
1171
|
setSchedConfigSource(() => {
|
|
@@ -1279,7 +1214,7 @@ const runCommand = {
|
|
|
1279
1214
|
sampler.start();
|
|
1280
1215
|
setRuntimeSampler(sampler);
|
|
1281
1216
|
setActionHooks({ runLocalJob: async (kind, tier) => {
|
|
1282
|
-
const { startTier, stopAll } = await import("../worker-config-
|
|
1217
|
+
const { startTier, stopAll } = await import("../worker-config-CO5FXLAT.mjs");
|
|
1283
1218
|
const { readLocalConfig } = await import("../local-tiers-DNMI5W86.mjs");
|
|
1284
1219
|
const { workersYamlPath } = await import("../workers-config-f8KrkY4L.mjs");
|
|
1285
1220
|
const cfg = readLocalConfig(workersYamlPath());
|
|
@@ -1295,7 +1230,10 @@ const runCommand = {
|
|
|
1295
1230
|
setEndpointHealth(endpointHealth);
|
|
1296
1231
|
const serve = (req, res) => handleCockpit(req, res, limits, rows, sessionMap, system, workerWindows);
|
|
1297
1232
|
const inner = routerHandler(void 0, void 0, void 0, usageFile ? () => void 0 : (row) => appendUsage(row), serve, {
|
|
1298
|
-
...remote ? {
|
|
1233
|
+
...remote ? {
|
|
1234
|
+
remoteAllowed: defaultV1Guard,
|
|
1235
|
+
hosts
|
|
1236
|
+
} : {},
|
|
1299
1237
|
isUp: limits.isUp,
|
|
1300
1238
|
health: endpointHealth
|
|
1301
1239
|
});
|
|
@@ -1657,7 +1595,7 @@ const modelsCommand = {
|
|
|
1657
1595
|
if (words[0] === "add") {
|
|
1658
1596
|
const source = words[1];
|
|
1659
1597
|
if (!source) throw new Error("usage: pai models add <hf-id|path> [--name n] [--download] [--try]");
|
|
1660
|
-
const { addModel } = await import("../models-add-
|
|
1598
|
+
const { addModel } = await import("../models-add-TVni3A7V.mjs");
|
|
1661
1599
|
const r = await addModel({
|
|
1662
1600
|
source,
|
|
1663
1601
|
name: typeof ctx.opts.name === "string" ? ctx.opts.name : void 0,
|
|
@@ -1672,7 +1610,7 @@ const modelsCommand = {
|
|
|
1672
1610
|
if (op) {
|
|
1673
1611
|
const runtime = words[1];
|
|
1674
1612
|
if (!runtime) throw new Error(`usage: pai models ${op} <runtime> (configured: ${Object.keys(readRuntimeCommands()).join(", ") || "none"})`);
|
|
1675
|
-
const { defaultDeps, runtimeStartStop } = await import("../cockpit-actions-
|
|
1613
|
+
const { defaultDeps, runtimeStartStop } = await import("../cockpit-actions-BfRMr2sm.mjs");
|
|
1676
1614
|
const r = await runtimeStartStop(runtime, op, defaultDeps(), { model: typeof ctx.opts.model === "string" ? ctx.opts.model : void 0 });
|
|
1677
1615
|
process.stdout.write(r.message + "\n");
|
|
1678
1616
|
if (!r.ok) process.exitCode = 1;
|
|
@@ -2987,7 +2925,7 @@ async function cmdPause(opts) {
|
|
|
2987
2925
|
process.exitCode = 1;
|
|
2988
2926
|
return;
|
|
2989
2927
|
}
|
|
2990
|
-
const { getRegistryBackend } = await import("../factory-
|
|
2928
|
+
const { getRegistryBackend } = await import("../factory-Bs9imVMq.mjs");
|
|
2991
2929
|
const registryBackend = await getRegistryBackend();
|
|
2992
2930
|
const cwd = process.cwd();
|
|
2993
2931
|
const project = await resolveProjectByCwd(registryBackend, cwd);
|
|
@@ -3087,7 +3025,7 @@ function touchSentinel(rootPath) {
|
|
|
3087
3025
|
async function cmdAutosave(opts) {
|
|
3088
3026
|
const minGap = parseInt(opts.minGap ?? String(DEFAULT_MIN_GAP), 10);
|
|
3089
3027
|
const cwd = process.cwd();
|
|
3090
|
-
const { getRegistryBackend } = await import("../factory-
|
|
3028
|
+
const { getRegistryBackend } = await import("../factory-Bs9imVMq.mjs");
|
|
3091
3029
|
const registryBackend = await getRegistryBackend();
|
|
3092
3030
|
const project = await resolveProjectByCwd(registryBackend, cwd);
|
|
3093
3031
|
if (!project) return;
|
|
@@ -3313,7 +3251,7 @@ function finalizeNote(notePath) {
|
|
|
3313
3251
|
}
|
|
3314
3252
|
async function cmdEnd(opts) {
|
|
3315
3253
|
await cmdPause(opts);
|
|
3316
|
-
const { getRegistryBackend } = await import("../factory-
|
|
3254
|
+
const { getRegistryBackend } = await import("../factory-Bs9imVMq.mjs");
|
|
3317
3255
|
const registryBackend = await getRegistryBackend();
|
|
3318
3256
|
const cwd = process.cwd();
|
|
3319
3257
|
const project = await registryBackend.findProjectByCwdPrefix(cwd);
|
|
@@ -3494,7 +3432,7 @@ function buildStopBody(project, sessionId) {
|
|
|
3494
3432
|
}
|
|
3495
3433
|
}
|
|
3496
3434
|
async function cmdHandover(projectSlug, numberOrLatest, sessionId) {
|
|
3497
|
-
const { getRegistryBackend } = await import("../factory-
|
|
3435
|
+
const { getRegistryBackend } = await import("../factory-Bs9imVMq.mjs");
|
|
3498
3436
|
const registryBackend = await getRegistryBackend();
|
|
3499
3437
|
let project;
|
|
3500
3438
|
if (projectSlug) {
|
|
@@ -4441,7 +4379,7 @@ async function countVectorDbPaths(oldPaths) {
|
|
|
4441
4379
|
if (oldPaths.length === 0) return 0;
|
|
4442
4380
|
try {
|
|
4443
4381
|
const { loadConfig } = await import("../config-DtENJ6cL.mjs");
|
|
4444
|
-
const { createStorageBackend } = await import("../factory-
|
|
4382
|
+
const { createStorageBackend } = await import("../factory-Bs9imVMq.mjs");
|
|
4445
4383
|
const config = loadConfig();
|
|
4446
4384
|
if (config.storageBackend !== "postgres") return 0;
|
|
4447
4385
|
const backend = await createStorageBackend(config);
|
|
@@ -4459,7 +4397,7 @@ async function updateVectorDbPaths(moves) {
|
|
|
4459
4397
|
if (moves.length === 0) return 0;
|
|
4460
4398
|
try {
|
|
4461
4399
|
const { loadConfig } = await import("../config-DtENJ6cL.mjs");
|
|
4462
|
-
const { createStorageBackend } = await import("../factory-
|
|
4400
|
+
const { createStorageBackend } = await import("../factory-Bs9imVMq.mjs");
|
|
4463
4401
|
const config = loadConfig();
|
|
4464
4402
|
if (config.storageBackend !== "postgres") return 0;
|
|
4465
4403
|
const backend = await createStorageBackend(config);
|
|
@@ -4546,7 +4484,7 @@ async function displayDryRun(plans) {
|
|
|
4546
4484
|
console.log();
|
|
4547
4485
|
}
|
|
4548
4486
|
async function executeCleanup(plans, skipReindex) {
|
|
4549
|
-
const { getRegistryBackend } = await import("../factory-
|
|
4487
|
+
const { getRegistryBackend } = await import("../factory-Bs9imVMq.mjs");
|
|
4550
4488
|
const registryBackend = await getRegistryBackend();
|
|
4551
4489
|
let deleted = 0;
|
|
4552
4490
|
let renamed = 0;
|
|
@@ -4746,7 +4684,7 @@ async function executeCleanup(plans, skipReindex) {
|
|
|
4746
4684
|
* them into YYYY/MM/ folders and renumber. Dry run unless `execute` is set.
|
|
4747
4685
|
*/
|
|
4748
4686
|
async function runCleanup(projectSlug, opts) {
|
|
4749
|
-
const { getRegistryBackend } = await import("../factory-
|
|
4687
|
+
const { getRegistryBackend } = await import("../factory-Bs9imVMq.mjs");
|
|
4750
4688
|
const registryBackend = await getRegistryBackend();
|
|
4751
4689
|
const dryRun = !opts.execute;
|
|
4752
4690
|
const skipReindex = opts.reindex === false;
|
|
@@ -8859,24 +8797,17 @@ function cmdInstall() {
|
|
|
8859
8797
|
const config = readClaudeJson();
|
|
8860
8798
|
if (typeof config.mcpServers !== "object" || config.mcpServers === null) config.mcpServers = {};
|
|
8861
8799
|
const servers = config.mcpServers;
|
|
8862
|
-
const
|
|
8863
|
-
if (
|
|
8800
|
+
const outcome = registerMcpScript(servers, "pai", shimBin);
|
|
8801
|
+
if (outcome === "unchanged") console.log(ok$1(" ~/.claude.json already points to the shim."));
|
|
8864
8802
|
else {
|
|
8865
|
-
if (existing) {
|
|
8866
|
-
servers["pai-legacy"] = existing;
|
|
8867
|
-
console.log(dim$1(" Backed up existing 'pai' entry as 'pai-legacy'."));
|
|
8868
|
-
}
|
|
8869
|
-
servers["pai"] = {
|
|
8870
|
-
command: "node",
|
|
8871
|
-
args: [shimBin]
|
|
8872
|
-
};
|
|
8873
8803
|
try {
|
|
8874
8804
|
writeClaudeJson(config);
|
|
8875
|
-
console.log(ok$1(" Updated ~/.claude.json to use daemon shim."));
|
|
8876
8805
|
} catch (e) {
|
|
8877
8806
|
console.error(err(` Failed to write ~/.claude.json: ${e}`));
|
|
8878
8807
|
return 1;
|
|
8879
8808
|
}
|
|
8809
|
+
if (outcome === "legacy-kept") console.log(dim$1(" Existing 'pai' entry runs a different server; kept as 'pai-legacy'."));
|
|
8810
|
+
console.log(ok$1(" Updated ~/.claude.json to use daemon shim."));
|
|
8880
8811
|
}
|
|
8881
8812
|
console.log();
|
|
8882
8813
|
if (!existsSync(daemonBin)) {
|
|
@@ -9036,7 +8967,7 @@ function cmdLogs(opts) {
|
|
|
9036
8967
|
return 0;
|
|
9037
8968
|
}
|
|
9038
8969
|
async function daemonServeCmd() {
|
|
9039
|
-
const { serve } = await import("../daemon-
|
|
8970
|
+
const { serve } = await import("../daemon-DeYImF1F.mjs");
|
|
9040
8971
|
const { loadConfig: lc, ensureConfigDir } = await import("../config-DtENJ6cL.mjs");
|
|
9041
8972
|
ensureConfigDir();
|
|
9042
8973
|
await serve(lc());
|
|
@@ -11208,54 +11139,6 @@ async function watchTicket(dir, id, deps = {}, intervalMs = 1e3, simctl, reap) {
|
|
|
11208
11139
|
}
|
|
11209
11140
|
}
|
|
11210
11141
|
|
|
11211
|
-
//#endregion
|
|
11212
|
-
//#region src/hooks/ts/lib/build-gate.ts
|
|
11213
|
-
/** Tiny reader for the two keys of builds.yaml: flow `[a, b]` or block `- a` lists. */
|
|
11214
|
-
function parseBuildsYaml(text) {
|
|
11215
|
-
const res = {
|
|
11216
|
-
doors: [],
|
|
11217
|
-
patterns: []
|
|
11218
|
-
};
|
|
11219
|
-
let key = null;
|
|
11220
|
-
const unq = (s) => s.trim().replace(/^(['"])(.*)\1$/, "$2");
|
|
11221
|
-
for (const raw of text.split("\n")) {
|
|
11222
|
-
const line = raw.replace(/(^|\s)#.*$/, "");
|
|
11223
|
-
if (!line.trim()) continue;
|
|
11224
|
-
const m = /^(doors|patterns)\s*:\s*(.*)$/.exec(line);
|
|
11225
|
-
if (m) {
|
|
11226
|
-
key = m[1];
|
|
11227
|
-
const rest = m[2].trim();
|
|
11228
|
-
if (rest.startsWith("[")) {
|
|
11229
|
-
res[key].push(...rest.replace(/^\[|\]$/g, "").split(",").map(unq).filter(Boolean));
|
|
11230
|
-
key = null;
|
|
11231
|
-
}
|
|
11232
|
-
continue;
|
|
11233
|
-
}
|
|
11234
|
-
const li = /^\s*-\s+(.*)$/.exec(line);
|
|
11235
|
-
if (li && key) res[key].push(unq(li[1]));
|
|
11236
|
-
else if (!/^\s/.test(line)) key = null;
|
|
11237
|
-
}
|
|
11238
|
-
return res;
|
|
11239
|
-
}
|
|
11240
|
-
/** The nearest `.pai/builds.yaml` at or above `cwd`. */
|
|
11241
|
-
function loadBuildsConfig(cwd) {
|
|
11242
|
-
let dir = resolve(cwd);
|
|
11243
|
-
for (;;) {
|
|
11244
|
-
const f = join(dir, ".pai", "builds.yaml");
|
|
11245
|
-
if (existsSync(f)) try {
|
|
11246
|
-
return {
|
|
11247
|
-
root: dir,
|
|
11248
|
-
...parseBuildsYaml(readFileSync(f, "utf8"))
|
|
11249
|
-
};
|
|
11250
|
-
} catch {
|
|
11251
|
-
return null;
|
|
11252
|
-
}
|
|
11253
|
-
const up = dirname(dir);
|
|
11254
|
-
if (up === dir) return null;
|
|
11255
|
-
dir = up;
|
|
11256
|
-
}
|
|
11257
|
-
}
|
|
11258
|
-
|
|
11259
11142
|
//#endregion
|
|
11260
11143
|
//#region src/builds/doctor.ts
|
|
11261
11144
|
/**
|
|
@@ -15041,7 +14924,7 @@ async function migrateToPostgres(opts = {}) {
|
|
|
15041
14924
|
const dump = pgDump(container, pgConfig, dumpPath);
|
|
15042
14925
|
if (!dump.ok) return refused(dump.reason, dryRun);
|
|
15043
14926
|
}
|
|
15044
|
-
const { PostgresBackend } = await import("../postgres-
|
|
14927
|
+
const { PostgresBackend } = await import("../postgres-BK4FP9Zg.mjs");
|
|
15045
14928
|
await PostgresBackend.ensureDatabase(pgConfig);
|
|
15046
14929
|
const sqlite = new BetterSqlite3(sqliteFederationPath, { readonly: true });
|
|
15047
14930
|
const registrySqlite = sqliteRegistryPath === sqliteFederationPath ? sqlite : new BetterSqlite3(sqliteRegistryPath, { readonly: true });
|
|
@@ -16428,7 +16311,7 @@ const out = (s) => process.stdout.write(s + "\n");
|
|
|
16428
16311
|
async function repoOf(project) {
|
|
16429
16312
|
if (typeof project === "string" && project) {
|
|
16430
16313
|
if (existsSync(project)) return resolve(project);
|
|
16431
|
-
const { getProject } = await import("../helpers-
|
|
16314
|
+
const { getProject } = await import("../helpers-Dz7mjTSw.mjs");
|
|
16432
16315
|
const row = await getProject(project);
|
|
16433
16316
|
if (!row) throw new CliError(`no project ${project}`, "pai projects list");
|
|
16434
16317
|
return row.root_path;
|
|
@@ -16796,7 +16679,8 @@ function mcpInstallCmd() {
|
|
|
16796
16679
|
for (const spec of SERVERS) {
|
|
16797
16680
|
const bin = distEntry(spec.entry);
|
|
16798
16681
|
if (spec.name in servers) {
|
|
16799
|
-
|
|
16682
|
+
const same = mcpEntryRunsScript(servers[spec.name], bin);
|
|
16683
|
+
console.log(warn$1(`${spec.label} is already registered in ~/.claude.json as "${spec.name}"${same ? "" : " (different script)"}.`));
|
|
16800
16684
|
console.log(dim$1(` Entry: ${JSON.stringify(servers[spec.name])}`));
|
|
16801
16685
|
continue;
|
|
16802
16686
|
}
|
|
@@ -17250,7 +17134,7 @@ async function cmdPromote(opts) {
|
|
|
17250
17134
|
console.error(dim$1(` Pick a durable location for the new project.`));
|
|
17251
17135
|
process.exit(1);
|
|
17252
17136
|
}
|
|
17253
|
-
const { getRegistryBackend } = await import("../factory-
|
|
17137
|
+
const { getRegistryBackend } = await import("../factory-Bs9imVMq.mjs");
|
|
17254
17138
|
const registryBackend = await getRegistryBackend();
|
|
17255
17139
|
const encodedDir = encodeDir(targetPath);
|
|
17256
17140
|
if (await registryBackend.getProjectBySlug(slug) ?? await registryBackend.getProjectByRootPath(targetPath) ?? await registryBackend.getProjectByEncodedDir(encodedDir)) {
|
|
@@ -18494,7 +18378,7 @@ async function cmdUnregister(slug, opts = {}) {
|
|
|
18494
18378
|
* deprecated alias that forwards here with a stderr notice.
|
|
18495
18379
|
*/
|
|
18496
18380
|
async function projectListCmd(opts) {
|
|
18497
|
-
const { cmdMain } = await import("../main-resolver-
|
|
18381
|
+
const { cmdMain } = await import("../main-resolver-yp_puSSb.mjs");
|
|
18498
18382
|
await cmdMain(void 0, void 0, opts);
|
|
18499
18383
|
return 0;
|
|
18500
18384
|
}
|
|
@@ -19917,7 +19801,7 @@ async function registryScanCmd(opts) {
|
|
|
19917
19801
|
return 0;
|
|
19918
19802
|
}
|
|
19919
19803
|
if (opts.filterReport) {
|
|
19920
|
-
const { reportUnregistrable } = await import("../registrable-
|
|
19804
|
+
const { reportUnregistrable } = await import("../registrable-BzH4TObg.mjs");
|
|
19921
19805
|
const r = await reportUnregistrable(await getRegistryBackend());
|
|
19922
19806
|
console.log(`Registry rows: ${r.total}`);
|
|
19923
19807
|
console.log(` matching the registration filter: ${r.matching} (${r.matchingMissing} with a missing path)`);
|
|
@@ -22169,9 +22053,9 @@ async function memorySearchCmd(query, opts) {
|
|
|
22169
22053
|
//#region src/cli/commands/memory/sources-cmd.ts
|
|
22170
22054
|
/** `pai memory sources` — what the indexer has taken in. */
|
|
22171
22055
|
async function memorySourcesCmd(opts) {
|
|
22172
|
-
const { createStorageBackend } = await import("../factory-
|
|
22056
|
+
const { createStorageBackend } = await import("../factory-Bs9imVMq.mjs");
|
|
22173
22057
|
const { loadConfig } = await import("../config-DtENJ6cL.mjs");
|
|
22174
|
-
const { cmdMemorySources } = await import("../sources-
|
|
22058
|
+
const { cmdMemorySources } = await import("../sources-CiE3rZek.mjs");
|
|
22175
22059
|
let backend;
|
|
22176
22060
|
try {
|
|
22177
22061
|
backend = await createStorageBackend(loadConfig());
|
|
@@ -22930,7 +22814,7 @@ async function zettelExploreCmd(note, opts) {
|
|
|
22930
22814
|
const depth = opts.depth ?? 3;
|
|
22931
22815
|
const direction = opts.direction ?? "both";
|
|
22932
22816
|
const mode = opts.mode ?? "all";
|
|
22933
|
-
const { zettelExplore } = await import("../zettelkasten-
|
|
22817
|
+
const { zettelExplore } = await import("../zettelkasten-tpCRBYvH.mjs");
|
|
22934
22818
|
const result = await zettelExplore(await getFedBackend(), {
|
|
22935
22819
|
startNote: note,
|
|
22936
22820
|
depth,
|
|
@@ -22986,7 +22870,7 @@ async function zettelHealthCmd(opts) {
|
|
|
22986
22870
|
const projectPath = opts.project;
|
|
22987
22871
|
const recentDays = opts.days ?? 30;
|
|
22988
22872
|
const includeTypes = opts.include ? opts.include.split(",").map((s) => s.trim()) : void 0;
|
|
22989
|
-
const { zettelHealth } = await import("../zettelkasten-
|
|
22873
|
+
const { zettelHealth } = await import("../zettelkasten-tpCRBYvH.mjs");
|
|
22990
22874
|
const result = await zettelHealth(await getFedBackend(), {
|
|
22991
22875
|
scope,
|
|
22992
22876
|
projectPath,
|
|
@@ -23044,7 +22928,7 @@ async function zettelSurpriseCmd(note, opts) {
|
|
|
23044
22928
|
const limit = opts.limit ?? 10;
|
|
23045
22929
|
const minSimilarity = opts.minSimilarity ?? .3;
|
|
23046
22930
|
const minGraphDistance = opts.minDistance ?? 3;
|
|
23047
|
-
const { zettelSurprise } = await import("../zettelkasten-
|
|
22931
|
+
const { zettelSurprise } = await import("../zettelkasten-tpCRBYvH.mjs");
|
|
23048
22932
|
const backend = await getFedBackend();
|
|
23049
22933
|
console.log();
|
|
23050
22934
|
console.log(header(" PAI Zettel Surprise"));
|
|
@@ -23086,7 +22970,7 @@ async function zettelConverseCmd(question, opts) {
|
|
|
23086
22970
|
const vaultProjectId = Number(opts.vaultProjectId);
|
|
23087
22971
|
const depth = opts.depth ?? 2;
|
|
23088
22972
|
const limit = opts.limit ?? 15;
|
|
23089
|
-
const { zettelConverse } = await import("../zettelkasten-
|
|
22973
|
+
const { zettelConverse } = await import("../zettelkasten-tpCRBYvH.mjs");
|
|
23090
22974
|
const backend = await getFedBackend();
|
|
23091
22975
|
console.log();
|
|
23092
22976
|
console.log(header(" PAI Zettel Converse"));
|
|
@@ -23136,7 +23020,7 @@ async function zettelThemesCmd(opts) {
|
|
|
23136
23020
|
const minClusterSize = opts.minSize ?? 3;
|
|
23137
23021
|
const maxThemes = opts.maxThemes ?? 10;
|
|
23138
23022
|
const similarityThreshold = opts.threshold ?? .65;
|
|
23139
|
-
const { zettelThemes } = await import("../zettelkasten-
|
|
23023
|
+
const { zettelThemes } = await import("../zettelkasten-tpCRBYvH.mjs");
|
|
23140
23024
|
const backend = await getFedBackend();
|
|
23141
23025
|
console.log();
|
|
23142
23026
|
console.log(header(" PAI Zettel Themes"));
|
|
@@ -23184,7 +23068,7 @@ async function zettelSuggestCmd(note, opts) {
|
|
|
23184
23068
|
const vaultProjectId = Number(opts.vaultProjectId);
|
|
23185
23069
|
const limit = opts.limit ?? 5;
|
|
23186
23070
|
const excludeLinked = opts.excludeLinked !== true;
|
|
23187
|
-
const { zettelSuggest } = await import("../zettelkasten-
|
|
23071
|
+
const { zettelSuggest } = await import("../zettelkasten-tpCRBYvH.mjs");
|
|
23188
23072
|
const backend = await getFedBackend();
|
|
23189
23073
|
console.log();
|
|
23190
23074
|
console.log(header(" PAI Zettel Suggest"));
|
|
@@ -3,7 +3,7 @@ import "./config-Bu1_vbY8.mjs";
|
|
|
3
3
|
import "./paths-CHifubDh.mjs";
|
|
4
4
|
import "./status-ggJ7lgVg.mjs";
|
|
5
5
|
import "./scope-D-h6F6DN.mjs";
|
|
6
|
-
import "./routing-
|
|
6
|
+
import "./routing-DmkheCRH.mjs";
|
|
7
7
|
import "./tool-errors-7E13StWd.mjs";
|
|
8
8
|
import "./wait-ByV0OyMZ.mjs";
|
|
9
9
|
import "./local-tiers-BE4jGaMa.mjs";
|
|
@@ -11,10 +11,10 @@ import "./caller-identity-yLFb7CKq.mjs";
|
|
|
11
11
|
import "./capacity-DEveQdFV.mjs";
|
|
12
12
|
import "./local-instances-DOxSgT_L.mjs";
|
|
13
13
|
import "./local-candidate-DLdwQt0s.mjs";
|
|
14
|
-
import "./providers-
|
|
15
|
-
import "./main-config-ops-
|
|
16
|
-
import { C as runtimeOpRefusal, D as writeLedgerLine, E as tierNames, S as runtimeJobProgress, T as spawnMemoryRun, _ as resolveTierName, a as classesOnProvider, b as runningRuntimeJob, c as defaultDeps, d as labelPath, f as logTailSince, g as readLabels, h as readCockpitJob, i as WORKER_ROLE_CLASSES, l as engineInflight, m as orchestratorProvider, n as RUNTIME_START_EVENT, o as cockpitActionLedger, p as memoryRunRefusal, r as RUNTIME_STOP_EVENT, s as cockpitJobFile, t as COCKPIT_ACTION_EVENT, u as labelFor, v as runCockpitAction, w as runtimeStartStop, x as runningRuntimeJobs, y as runningLocalModel } from "./cockpit-actions-
|
|
17
|
-
import "./ipc-client-
|
|
18
|
-
import "./embed-pass-
|
|
14
|
+
import "./providers-C9QC0TtO.mjs";
|
|
15
|
+
import "./main-config-ops-kTXR8Pyv.mjs";
|
|
16
|
+
import { C as runtimeOpRefusal, D as writeLedgerLine, E as tierNames, S as runtimeJobProgress, T as spawnMemoryRun, _ as resolveTierName, a as classesOnProvider, b as runningRuntimeJob, c as defaultDeps, d as labelPath, f as logTailSince, g as readLabels, h as readCockpitJob, i as WORKER_ROLE_CLASSES, l as engineInflight, m as orchestratorProvider, n as RUNTIME_START_EVENT, o as cockpitActionLedger, p as memoryRunRefusal, r as RUNTIME_STOP_EVENT, s as cockpitJobFile, t as COCKPIT_ACTION_EVENT, u as labelFor, v as runCockpitAction, w as runtimeStartStop, x as runningRuntimeJobs, y as runningLocalModel } from "./cockpit-actions-OodH_vx_.mjs";
|
|
17
|
+
import "./ipc-client-CnYEF31R.mjs";
|
|
18
|
+
import "./embed-pass-e64AwDCa.mjs";
|
|
19
19
|
|
|
20
20
|
export { COCKPIT_ACTION_EVENT, RUNTIME_START_EVENT, RUNTIME_STOP_EVENT, WORKER_ROLE_CLASSES, classesOnProvider, cockpitActionLedger, cockpitJobFile, defaultDeps, engineInflight, labelFor, labelPath, logTailSince, memoryRunRefusal, orchestratorProvider, readCockpitJob, readLabels, resolveTierName, runCockpitAction, runningLocalModel, runningRuntimeJob, runningRuntimeJobs, runtimeJobProgress, runtimeOpRefusal, runtimeStartStop, spawnMemoryRun, tierNames, writeLedgerLine };
|