@tekmidian/pai 1.0.3 → 1.0.5
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-B7Yu6Uam.mjs → auto-route-DUYr57rs.mjs} +2 -2
- package/dist/auto-route-DWYK_0i0.mjs +11 -0
- package/dist/budget-DX-VIWGf.mjs +15 -0
- package/dist/{caller-identity-yLFb7CKq.mjs → caller-identity-Bim8JT-D.mjs} +3 -3
- package/dist/{capacity-DEveQdFV.mjs → capacity-CsZMkVyg.mjs} +7 -4
- package/dist/{chain-7n9Gx56r.mjs → chain-Dzz6xcKH.mjs} +5 -5
- package/dist/cli/index.mjs +114 -208
- package/dist/{cockpit-actions-BBHeyEZI.mjs → cockpit-actions-BTA1njMO.mjs} +31 -25
- package/dist/{cockpit-actions-DR9X514g.mjs → cockpit-actions-BgsiNcUY.mjs} +18 -18
- package/dist/cockpit-memory-DIrNs4xr.mjs +20 -0
- package/dist/config/defaults/config.yaml +9 -0
- package/dist/{config-XpZWOYOG.mjs → config-CST2uq1v.mjs} +29 -4
- package/dist/{config-Bu1_vbY8.mjs → config-DYbyEe4-.mjs} +2 -2
- package/dist/{config-DtENJ6cL.mjs → config-Dv3t7xnT.mjs} +1 -1
- package/dist/config-h5qK3fst.mjs +4 -0
- package/dist/{controls-CPoeudou.mjs → controls-OiVVbe-f.mjs} +18 -16
- package/dist/daemon/index.mjs +38 -37
- package/dist/{daemon-DPAo6WTa.mjs → daemon-C1dycZ3W.mjs} +35 -29
- package/dist/daemon-ieo0lnpq.mjs +46 -0
- package/dist/daemon-mcp/index.mjs +35 -35
- package/dist/detect-C0ZBXqDL.mjs +10 -0
- package/dist/{detect-9CZNO0yf.mjs → detect-CHuxFrLy.mjs} +2 -2
- package/dist/{embed-pass-DIWjA68P.mjs → embed-pass-DtVF2fOV.mjs} +4 -4
- package/dist/{embedding-gate-Cnk4YCyX.mjs → embedding-gate-B98PK_wz.mjs} +2 -2
- package/dist/{embedding-gate-6rZrWRXa.mjs → embedding-gate-CTAk8STe.mjs} +2 -2
- package/dist/{endreason-C577xIQz.mjs → endreason-BqyyU7BH.mjs} +20 -6
- package/dist/{factory-DjAAsqr_.mjs → factory-BV0MQA3T.mjs} +4 -4
- package/dist/{factory-Bsib-qDG.mjs → factory-DeASMV7Z.mjs} +4 -4
- package/dist/{fallback-DFlItw1Z.mjs → fallback-Bj2cyVk_.mjs} +230 -8
- package/dist/{health-Dnym-qcT.mjs → health-kufVIf6i.mjs} +4 -4
- package/dist/{helpers-BD6V-p9w.mjs → helpers-CvbYEKoD.mjs} +2 -2
- package/dist/{helpers-CMGjy_0N.mjs → helpers-WV8tdQHM.mjs} +5 -5
- package/dist/hooks/block-sleep-poll.mjs +1 -1
- package/dist/hooks/capture-all-events.mjs +21 -2
- package/dist/hooks/capture-tool-output.mjs +21 -2
- package/dist/hooks/load-project-context.mjs +7 -7
- 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 +2 -2
- package/dist/hooks/worker-edit-repair.mjs +2 -2
- package/dist/hooks/worker-guard.mjs +8 -8
- package/dist/hooks/worker-note.mjs +2 -2
- package/dist/hooks/worker-pool-host.mjs +158 -55
- package/dist/hooks/worker-proxy.mjs +1 -1
- package/dist/hooks/worker-status-line.mjs +50 -22
- package/dist/hooks/worker-supervision.mjs +1 -1
- package/dist/hooks/worker-tool-name-repair.mjs +2 -2
- package/dist/index.mjs +8 -8
- package/dist/{indexer-backend-Cll7le4P.mjs → indexer-backend-B2vtFl38.mjs} +37 -234
- 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-CXZ0WfVf.mjs +10 -0
- package/dist/{kill-tree-EWYaEk5v.mjs → kill-tree-CcpsRLCZ.mjs} +7 -7
- package/dist/{launch-Jh5NVeNe.mjs → launch-DpQPZGsT.mjs} +3 -3
- package/dist/{launch-CXVlZjHt.mjs → launch-UPQBoW2q.mjs} +3 -3
- package/dist/{local-candidate-DLdwQt0s.mjs → local-candidate-Cp_bw4kK.mjs} +3 -3
- package/dist/{local-instances-ZeRkkuS5.mjs → local-instances-B-c-CxzP.mjs} +4 -4
- package/dist/{local-instances-DOxSgT_L.mjs → local-instances-bdCNNSsL.mjs} +2 -2
- package/dist/{local-tiers-BE4jGaMa.mjs → local-tiers-BtdEEe5n.mjs} +2 -2
- package/dist/{local-tiers-DNMI5W86.mjs → local-tiers-OBqAAfOg.mjs} +3 -3
- package/dist/{main-config-ops-BEMpuhDz.mjs → main-config-ops-BYsK3BxM.mjs} +3 -3
- package/dist/{main-resolver-3Ns1HPmS.mjs → main-resolver-CAC3xfZM.mjs} +17 -17
- package/dist/{model-inventory-BFVSNFT3.mjs → model-inventory-BuTpi9a6.mjs} +13 -13
- package/dist/{models-add-C1QIc1DA.mjs → models-add-CJx2YAwh.mjs} +37 -36
- package/dist/operator-Bpxq_WB5.mjs +7 -0
- package/dist/{operator-CyuB3aVw.mjs → operator-DrwWItVt.mjs} +2 -2
- package/dist/{pai-marker-BcZyJguM.mjs → pai-marker-DLKJ9Yr5.mjs} +2 -2
- package/dist/{pane-audit-DKQt71s4.mjs → pane-audit-wv9UkyCe.mjs} +27 -9
- package/dist/{paths-CFHTloSe.mjs → paths-DBd78I7Z.mjs} +3 -3
- package/dist/{paths-CHifubDh.mjs → paths-DS5VQKoR.mjs} +3 -3
- package/dist/{planner-BmFACdLa.mjs → planner-K0mFrCpL.mjs} +28 -28
- package/dist/{pool-Dh-q3iJi.mjs → pool-BZ94nFuq.mjs} +2 -2
- package/dist/{pool-cli-BggU8GRp.mjs → pool-cli-B1eKySeN.mjs} +5 -5
- package/dist/{pool-cli-DQ6OzRy2.mjs → pool-cli-BjYQDfx6.mjs} +6 -6
- package/dist/{postgres-C6ti4haA.mjs → postgres-C-T5OWer.mjs} +19 -9
- package/dist/{postgres-BdBNkL_l.mjs → postgres-CBHY5PIi.mjs} +3 -3
- package/dist/{project-setup-jvfONJTQ.mjs → project-setup-pIPHZaXf.mjs} +26 -246
- package/dist/{providers-CblTFrhz.mjs → providers-Dzx5GAUI.mjs} +6 -6
- package/dist/providers-QJzpaNhX.mjs +16 -0
- package/dist/{query-feedback-BRfPtqki.mjs → query-feedback-DN52N9C5.mjs} +1 -1
- package/dist/{registrable-DpyTtajg.mjs → registrable-CXBBpUcz.mjs} +4 -4
- package/dist/registrable-Drn8wIDO.mjs +9 -0
- package/dist/render-C4KR8qQ8.mjs +13 -0
- package/dist/{render-BYmQkuLd.mjs → render-Cz3BWIBO.mjs} +8 -8
- package/dist/root-Bfb1zgwE.mjs +36 -0
- package/dist/{root-Xglu0OPD.mjs → root-bG48WVpW.mjs} +10 -10
- package/dist/route-table-ZVMNBsy7.mjs +15 -0
- package/dist/{routing-BAAST9vT.mjs → routing-BlD_tKjW.mjs} +136 -18
- package/dist/{routing-CENt4HH1.mjs → routing-D27jxj9x.mjs} +13 -13
- package/dist/{run-CSC7mgPf.mjs → run-AZVwceiU.mjs} +49 -27
- package/dist/{scan-C_Y5W9py.mjs → scan-C3uotg_f.mjs} +5 -5
- package/dist/{scope-D-h6F6DN.mjs → scope-D8HK6vU7.mjs} +4 -4
- package/dist/{session-8iqQDkqb.mjs → session-BAfypQb9.mjs} +26 -26
- package/dist/session-BcnhepLZ.mjs +35 -0
- package/dist/{session-scan-W-gbwJHM.mjs → session-scan-BmnjSReu.mjs} +5 -5
- package/dist/session-scan-CqUQdCac.mjs +9 -0
- package/dist/session-usage-oycSdiD3.mjs +337 -0
- package/dist/{sources-ESUkZaWv.mjs → sources-CiE3rZek.mjs} +1 -1
- package/dist/{status-ggJ7lgVg.mjs → status-COtzewKV.mjs} +3 -3
- package/dist/{status-Dm4dYciN.mjs → status-D_SWmOlH.mjs} +4 -4
- package/dist/{tool-errors-CJWODvlo.mjs → tool-errors-B2LnIqR0.mjs} +6 -6
- package/dist/{tool-errors-7E13StWd.mjs → tool-errors-DXJ70-sr.mjs} +2 -2
- package/dist/{viewer-mDXUNHNy.mjs → viewer-BgGRqXfD.mjs} +14 -14
- package/dist/viewer-CbGN2Ri4.mjs +22 -0
- package/dist/{wait-ByV0OyMZ.mjs → wait-ChpHKJZV.mjs} +3 -3
- package/dist/worker-config-D1KVAMp4.mjs +42 -0
- package/dist/{worker-config-CJhEMk19.mjs → worker-config-DgdT0iTB.mjs} +443 -40
- package/dist/workers-config-BhZBrR-Q.mjs +4 -0
- package/dist/{worktree-CRs2gyg0.mjs → worktree-BY--Rgmy.mjs} +5 -5
- package/dist/{zettelkasten-B_rRRRvD.mjs → zettelkasten-BHVx5zj-.mjs} +4 -4
- package/dist/{zettelkasten-BzMm8REH.mjs → zettelkasten-LoH9RBiN.mjs} +2 -2
- package/docs/cockpit.md +1 -0
- package/docs/commands/README.md +1 -0
- package/docs/commands/config.md +20 -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-CjjQqU1o.mjs +0 -11
- package/dist/budget-Dod6rnA9.mjs +0 -15
- package/dist/cockpit-memory--dnShXBA.mjs +0 -20
- package/dist/config-Cxi-aBf4.mjs +0 -4
- package/dist/daemon-DKdBNKfa.mjs +0 -45
- package/dist/detect-D1ziFFfA.mjs +0 -10
- package/dist/kill-tree-BG7dRVtp.mjs +0 -10
- package/dist/operator-BTqvTIc8.mjs +0 -7
- package/dist/providers-BeDiVEb-.mjs +0 -16
- package/dist/registrable-BzH4TObg.mjs +0 -9
- package/dist/render-CoMvwMPs.mjs +0 -13
- package/dist/root-FtJsxYnm.mjs +0 -36
- package/dist/route-table-B7zpoypi.mjs +0 -15
- package/dist/session-BeqAbNPd.mjs +0 -35
- package/dist/session-scan-BJI_ZO8M.mjs +0 -9
- package/dist/viewer-CqozWW39.mjs +0 -22
- package/dist/worker-config-DESkIjMF.mjs +0 -41
- package/dist/workers-config-f8KrkY4L.mjs +0 -4
package/dist/cli/index.mjs
CHANGED
|
@@ -2,70 +2,70 @@
|
|
|
2
2
|
import { _ as warn$1, a as fmtDate, c as ok$1, d as scaffoldProjectDirs, f as shortenPath, g as stripAnsi, h as smartDecodeDir, i as err, l as renderTable$1, m as slugify, n as dim$1, o as header, r as encodeDir, s as now, t as bold$1, u as resolvePath } from "../utils-J2b9y8PC.mjs";
|
|
3
3
|
import { _ as resolvePaiFile, a as paiCacheDir, c as PaiFileMigrationError, d as defaultPaiHomeDir, f as legacyConfigDir, g as paiHomePath, h as paiHomeDir, l as claudeHomeDir, m as migratePaiFile, o as paiSocketPath, p as migratePaiDir, r as daemonLogPath, s as schedulerLogPath, u as claudeProjectsDir } from "../runtime-paths-WsO9sJFc.mjs";
|
|
4
4
|
import { a as slugify$1, i as parseSessionFilename } from "../migrate-DrA_OwlZ.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import { A as
|
|
7
|
-
import { i as ledgerPath, n as ensureNoMcpConfig, u as workersLogDir } from "../paths-
|
|
8
|
-
import "../worktree-
|
|
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-
|
|
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-
|
|
11
|
-
import { a as unregistrableReason, s as worktreeReason } from "../registrable-
|
|
12
|
-
import "../pai-marker-
|
|
5
|
+
import { Et as appendLedger, M as readWorkersSection, R as LOOPBACK_HOST, _t as DEFAULT_CONTEXT_WINDOW, bt as stripModelVariant, c as WorkersConfigError, et as relocateWorkersYaml, f as escalationCloud, m as isLocalProvider, p as getProviderOrNative, rt as workersYamlPath, t as ANTHROPIC_NATIVE, v as nativeAnthropicModels, yt as contextWindowFromModelId } from "../config-CST2uq1v.mjs";
|
|
6
|
+
import { A as DEFAULT_PG_CONNECTION_TIMEOUT_MS, C as migrateMainConfigToYaml, F as quoteIdent, M as isContainerTarget, N as postgresConnectionString, O as readJsonStrict, P as postgresFullTarget, S as MainConfigError, T as resolvedMainConfigPath, c as loadConfig, d as paiConfigYamlFilePath, f as readMainConfigRaw, j as assertPgName, k as writeJsonAtomic, l as migrateConfigFile, n as CONFIG_FILE$2, o as expandHome, p as writeMainConfigRaw, t as CONFIG_DIR, u as paiConfigFilePath } from "../config-DYbyEe4-.mjs";
|
|
7
|
+
import { i as ledgerPath, n as ensureNoMcpConfig, u as workersLogDir } from "../paths-DS5VQKoR.mjs";
|
|
8
|
+
import "../worktree-BY--Rgmy.mjs";
|
|
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-COtzewKV.mjs";
|
|
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-BZ94nFuq.mjs";
|
|
11
|
+
import { a as unregistrableReason, s as worktreeReason } from "../registrable-CXBBpUcz.mjs";
|
|
12
|
+
import "../pai-marker-DLKJ9Yr5.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
|
-
import { a as ownerSessionName, d as terminalHasName } from "../scope-
|
|
17
|
-
import {
|
|
16
|
+
import { a as ownerSessionName, d as terminalHasName } from "../scope-D8HK6vU7.mjs";
|
|
17
|
+
import { At as resolveBindAddress, Bn as setParkConfigSource, Dn as allSetups, Dt as routerPort, E as budgetCache, Et as routerHandler, F as LimitsCache, Gn as appendUsage, Hn as recordDuration, In as setupsPath, Kn as formatSessionStats, Nn as saveSetup, On as downLocalProviders, Ot as defaultV1Guard, Sn as providerHostPort, U as computeInventory, Un as aggregate, Vn as sharedParker, W as currentInventory, Wn as aggregateBySession, Xn as parseSince, Y as inventoryText, Zn as readUsage, at as readInventoryInput, jn as loadSaved, kt as displayHost, m as readRoutingState, pn as readProfiles, pt as isLoopbackProvider, qn as formatStats, qt as sessionStartTarget, un as SESSION_NAME_ENV, vn as localProviderForDelegation, x as SESSION_WORKER_PROVIDER_ENV, xt as routeVerdictLine, zn as parkConfigFrom } from "../routing-BlD_tKjW.mjs";
|
|
18
18
|
import { n as minOf } from "../min-max-DrSRUaWQ.mjs";
|
|
19
|
-
import "../tool-errors-
|
|
20
|
-
import "../wait-
|
|
21
|
-
import "../local-tiers-
|
|
22
|
-
import { a as buildsDir, c as listBuilds, f as removeTicket, h as tryStart, i as buildNext, o as enqueue, p as renderBuildQueue, r as buildLogPath, s as getTicket, u as patchTicket, v as poolSlots, y as slotsFor } from "../caller-identity-
|
|
19
|
+
import "../tool-errors-DXJ70-sr.mjs";
|
|
20
|
+
import "../wait-ChpHKJZV.mjs";
|
|
21
|
+
import "../local-tiers-BtdEEe5n.mjs";
|
|
22
|
+
import { a as buildsDir, c as listBuilds, f as removeTicket, h as tryStart, i as buildNext, o as enqueue, p as renderBuildQueue, r as buildLogPath, s as getTicket, u as patchTicket, v as poolSlots, y as slotsFor } from "../caller-identity-Bim8JT-D.mjs";
|
|
23
23
|
import { d as setSchedConfigSource, f as sharedScheduler, i as mirrorTo, s as schedConfigFrom } from "../scheduler-CtUyWJ3O.mjs";
|
|
24
|
-
import { i as effectiveCap, o as providerCap, r as capacityOf } from "../capacity-
|
|
25
|
-
import "../local-instances-
|
|
26
|
-
import { n as tierProviderNames, t as isLocalCandidate } from "../local-candidate-
|
|
27
|
-
import { n as TAILSCALE_STATUS_TIMEOUT_MS } from "../timeouts-1MLooEBB.mjs";
|
|
24
|
+
import { i as effectiveCap, o as providerCap, r as capacityOf } from "../capacity-CsZMkVyg.mjs";
|
|
25
|
+
import "../local-instances-bdCNNSsL.mjs";
|
|
26
|
+
import { n as tierProviderNames, t as isLocalCandidate } from "../local-candidate-Cp_bw4kK.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-
|
|
31
|
-
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-
|
|
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-BV0MQA3T.mjs";
|
|
29
|
+
import { c as resolveFromModule, i as retryTransient, n as embedChunksWithBackend, r as indexProjectWithBackend, s as packageRoot } from "../postgres-C-T5OWer.mjs";
|
|
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-CTAk8STe.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-CHuxFrLy.mjs";
|
|
34
|
+
import { n as getProject$1, o as requireProject, r as getProjectAliases, s as resolveIdentifier } from "../helpers-CvbYEKoD.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-C3uotg_f.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-BAfypQb9.mjs";
|
|
37
|
+
import { a as detectCurrentProviderName, i as detectCurrentModel, n as buildLaunchPlan, o as launchableProviderNames, r as buildLaunchRows, s as maskLaunchEnv } from "../launch-DpQPZGsT.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-kufVIf6i.mjs";
|
|
39
|
+
import { a as providerResumePlan, n as launchInDir, o as restoreTopLevel, r as launchPrompt, s as resumeArgvText, t as hasConversation } from "../launch-UPQBoW2q.mjs";
|
|
40
|
+
import { _ as setupsTable, a as lastSetup, m as rootCommand } from "../root-bG48WVpW.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-
|
|
48
|
-
import "../operator-
|
|
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 {
|
|
42
|
+
import { a as resolveSessionByNameOrId, o as scanCacheFilePath, r as migrateSessionScanCache, s as scanSessions, t as fmtAge } from "../session-scan-BmnjSReu.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-AZVwceiU.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-OiVVbe-f.mjs";
|
|
45
|
+
import "../endreason-BqyyU7BH.mjs";
|
|
46
|
+
import { N as endBuildWait, j as beginBuildWait } from "../render-Cz3BWIBO.mjs";
|
|
47
|
+
import "../operator-DrwWItVt.mjs";
|
|
48
|
+
import "../kill-tree-CcpsRLCZ.mjs";
|
|
49
|
+
import { s as poolReloadLive } from "../pool-cli-B1eKySeN.mjs";
|
|
50
|
+
import "../chain-Dzz6xcKH.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-pIPHZaXf.mjs";
|
|
52
|
+
import { m as runInPane, r as closeFinishedPanes } from "../pane-audit-wv9UkyCe.mjs";
|
|
53
|
+
import "../viewer-BgGRqXfD.mjs";
|
|
54
|
+
import "../fallback-Bj2cyVk_.mjs";
|
|
55
|
+
import { g as setWorkersEnabled, s as describeProviders } from "../providers-Dzx5GAUI.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-DgdT0iTB.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-BYsK3BxM.mjs";
|
|
58
|
+
import { H as acquireRun, U as readRun, V as cockpitProbeSettings, k as readRuntimeCommands } from "../cockpit-actions-BTA1njMO.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-DtVF2fOV.mjs";
|
|
61
|
+
import { a as liveWorkersConfigShadows, i as totalUsageTokens, r as parseSessionUsage } from "../session-usage-oycSdiD3.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-B2vtFl38.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-BuTpi9a6.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-BuTpi9a6.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 = {
|
|
1165
|
+
bind: bindName || addr,
|
|
1166
|
+
extraHosts
|
|
1167
|
+
};
|
|
1168
|
+
if (remote && extraHosts.length === 0) process.stderr.write("pai: router: router.allowedHosts is empty: the cockpit opened by tailnet hostname will be refused (403); add the name to router.allowedHosts\n");
|
|
1234
1169
|
const rows = cachedRows(usageFile);
|
|
1235
1170
|
let schedCache;
|
|
1236
1171
|
setSchedConfigSource(() => {
|
|
@@ -1279,9 +1214,9 @@ 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-
|
|
1283
|
-
const { readLocalConfig } = await import("../local-tiers-
|
|
1284
|
-
const { workersYamlPath } = await import("../workers-config-
|
|
1217
|
+
const { startTier, stopAll } = await import("../worker-config-D1KVAMp4.mjs");
|
|
1218
|
+
const { readLocalConfig } = await import("../local-tiers-OBqAAfOg.mjs");
|
|
1219
|
+
const { workersYamlPath } = await import("../workers-config-BhZBrR-Q.mjs");
|
|
1285
1220
|
const cfg = readLocalConfig(workersYamlPath());
|
|
1286
1221
|
if (kind === "off") return void await stopAll(cfg);
|
|
1287
1222
|
const t = cfg.tiers[tier];
|
|
@@ -1295,6 +1230,7 @@ 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, {
|
|
1233
|
+
hosts,
|
|
1298
1234
|
...remote ? { remoteAllowed: defaultV1Guard } : {},
|
|
1299
1235
|
isUp: limits.isUp,
|
|
1300
1236
|
health: endpointHealth
|
|
@@ -1657,7 +1593,7 @@ const modelsCommand = {
|
|
|
1657
1593
|
if (words[0] === "add") {
|
|
1658
1594
|
const source = words[1];
|
|
1659
1595
|
if (!source) throw new Error("usage: pai models add <hf-id|path> [--name n] [--download] [--try]");
|
|
1660
|
-
const { addModel } = await import("../models-add-
|
|
1596
|
+
const { addModel } = await import("../models-add-CJx2YAwh.mjs");
|
|
1661
1597
|
const r = await addModel({
|
|
1662
1598
|
source,
|
|
1663
1599
|
name: typeof ctx.opts.name === "string" ? ctx.opts.name : void 0,
|
|
@@ -1672,7 +1608,7 @@ const modelsCommand = {
|
|
|
1672
1608
|
if (op) {
|
|
1673
1609
|
const runtime = words[1];
|
|
1674
1610
|
if (!runtime) throw new Error(`usage: pai models ${op} <runtime> (configured: ${Object.keys(readRuntimeCommands()).join(", ") || "none"})`);
|
|
1675
|
-
const { defaultDeps, runtimeStartStop } = await import("../cockpit-actions-
|
|
1611
|
+
const { defaultDeps, runtimeStartStop } = await import("../cockpit-actions-BgsiNcUY.mjs");
|
|
1676
1612
|
const r = await runtimeStartStop(runtime, op, defaultDeps(), { model: typeof ctx.opts.model === "string" ? ctx.opts.model : void 0 });
|
|
1677
1613
|
process.stdout.write(r.message + "\n");
|
|
1678
1614
|
if (!r.ok) process.exitCode = 1;
|
|
@@ -2987,7 +2923,7 @@ async function cmdPause(opts) {
|
|
|
2987
2923
|
process.exitCode = 1;
|
|
2988
2924
|
return;
|
|
2989
2925
|
}
|
|
2990
|
-
const { getRegistryBackend } = await import("../factory-
|
|
2926
|
+
const { getRegistryBackend } = await import("../factory-DeASMV7Z.mjs");
|
|
2991
2927
|
const registryBackend = await getRegistryBackend();
|
|
2992
2928
|
const cwd = process.cwd();
|
|
2993
2929
|
const project = await resolveProjectByCwd(registryBackend, cwd);
|
|
@@ -3087,7 +3023,7 @@ function touchSentinel(rootPath) {
|
|
|
3087
3023
|
async function cmdAutosave(opts) {
|
|
3088
3024
|
const minGap = parseInt(opts.minGap ?? String(DEFAULT_MIN_GAP), 10);
|
|
3089
3025
|
const cwd = process.cwd();
|
|
3090
|
-
const { getRegistryBackend } = await import("../factory-
|
|
3026
|
+
const { getRegistryBackend } = await import("../factory-DeASMV7Z.mjs");
|
|
3091
3027
|
const registryBackend = await getRegistryBackend();
|
|
3092
3028
|
const project = await resolveProjectByCwd(registryBackend, cwd);
|
|
3093
3029
|
if (!project) return;
|
|
@@ -3313,7 +3249,7 @@ function finalizeNote(notePath) {
|
|
|
3313
3249
|
}
|
|
3314
3250
|
async function cmdEnd(opts) {
|
|
3315
3251
|
await cmdPause(opts);
|
|
3316
|
-
const { getRegistryBackend } = await import("../factory-
|
|
3252
|
+
const { getRegistryBackend } = await import("../factory-DeASMV7Z.mjs");
|
|
3317
3253
|
const registryBackend = await getRegistryBackend();
|
|
3318
3254
|
const cwd = process.cwd();
|
|
3319
3255
|
const project = await registryBackend.findProjectByCwdPrefix(cwd);
|
|
@@ -3494,7 +3430,7 @@ function buildStopBody(project, sessionId) {
|
|
|
3494
3430
|
}
|
|
3495
3431
|
}
|
|
3496
3432
|
async function cmdHandover(projectSlug, numberOrLatest, sessionId) {
|
|
3497
|
-
const { getRegistryBackend } = await import("../factory-
|
|
3433
|
+
const { getRegistryBackend } = await import("../factory-DeASMV7Z.mjs");
|
|
3498
3434
|
const registryBackend = await getRegistryBackend();
|
|
3499
3435
|
let project;
|
|
3500
3436
|
if (projectSlug) {
|
|
@@ -4440,8 +4376,8 @@ async function analyzeProject(registryBackend, project) {
|
|
|
4440
4376
|
async function countVectorDbPaths(oldPaths) {
|
|
4441
4377
|
if (oldPaths.length === 0) return 0;
|
|
4442
4378
|
try {
|
|
4443
|
-
const { loadConfig } = await import("../config-
|
|
4444
|
-
const { createStorageBackend } = await import("../factory-
|
|
4379
|
+
const { loadConfig } = await import("../config-Dv3t7xnT.mjs");
|
|
4380
|
+
const { createStorageBackend } = await import("../factory-DeASMV7Z.mjs");
|
|
4445
4381
|
const config = loadConfig();
|
|
4446
4382
|
if (config.storageBackend !== "postgres") return 0;
|
|
4447
4383
|
const backend = await createStorageBackend(config);
|
|
@@ -4458,8 +4394,8 @@ async function countVectorDbPaths(oldPaths) {
|
|
|
4458
4394
|
async function updateVectorDbPaths(moves) {
|
|
4459
4395
|
if (moves.length === 0) return 0;
|
|
4460
4396
|
try {
|
|
4461
|
-
const { loadConfig } = await import("../config-
|
|
4462
|
-
const { createStorageBackend } = await import("../factory-
|
|
4397
|
+
const { loadConfig } = await import("../config-Dv3t7xnT.mjs");
|
|
4398
|
+
const { createStorageBackend } = await import("../factory-DeASMV7Z.mjs");
|
|
4463
4399
|
const config = loadConfig();
|
|
4464
4400
|
if (config.storageBackend !== "postgres") return 0;
|
|
4465
4401
|
const backend = await createStorageBackend(config);
|
|
@@ -4546,7 +4482,7 @@ async function displayDryRun(plans) {
|
|
|
4546
4482
|
console.log();
|
|
4547
4483
|
}
|
|
4548
4484
|
async function executeCleanup(plans, skipReindex) {
|
|
4549
|
-
const { getRegistryBackend } = await import("../factory-
|
|
4485
|
+
const { getRegistryBackend } = await import("../factory-DeASMV7Z.mjs");
|
|
4550
4486
|
const registryBackend = await getRegistryBackend();
|
|
4551
4487
|
let deleted = 0;
|
|
4552
4488
|
let renamed = 0;
|
|
@@ -4746,7 +4682,7 @@ async function executeCleanup(plans, skipReindex) {
|
|
|
4746
4682
|
* them into YYYY/MM/ folders and renumber. Dry run unless `execute` is set.
|
|
4747
4683
|
*/
|
|
4748
4684
|
async function runCleanup(projectSlug, opts) {
|
|
4749
|
-
const { getRegistryBackend } = await import("../factory-
|
|
4685
|
+
const { getRegistryBackend } = await import("../factory-DeASMV7Z.mjs");
|
|
4750
4686
|
const registryBackend = await getRegistryBackend();
|
|
4751
4687
|
const dryRun = !opts.execute;
|
|
4752
4688
|
const skipReindex = opts.reindex === false;
|
|
@@ -9029,8 +8965,8 @@ function cmdLogs(opts) {
|
|
|
9029
8965
|
return 0;
|
|
9030
8966
|
}
|
|
9031
8967
|
async function daemonServeCmd() {
|
|
9032
|
-
const { serve } = await import("../daemon-
|
|
9033
|
-
const { loadConfig: lc, ensureConfigDir } = await import("../config-
|
|
8968
|
+
const { serve } = await import("../daemon-ieo0lnpq.mjs");
|
|
8969
|
+
const { loadConfig: lc, ensureConfigDir } = await import("../config-Dv3t7xnT.mjs");
|
|
9034
8970
|
ensureConfigDir();
|
|
9035
8971
|
await serve(lc());
|
|
9036
8972
|
return 0;
|
|
@@ -11201,54 +11137,6 @@ async function watchTicket(dir, id, deps = {}, intervalMs = 1e3, simctl, reap) {
|
|
|
11201
11137
|
}
|
|
11202
11138
|
}
|
|
11203
11139
|
|
|
11204
|
-
//#endregion
|
|
11205
|
-
//#region src/hooks/ts/lib/build-gate.ts
|
|
11206
|
-
/** Tiny reader for the two keys of builds.yaml: flow `[a, b]` or block `- a` lists. */
|
|
11207
|
-
function parseBuildsYaml(text) {
|
|
11208
|
-
const res = {
|
|
11209
|
-
doors: [],
|
|
11210
|
-
patterns: []
|
|
11211
|
-
};
|
|
11212
|
-
let key = null;
|
|
11213
|
-
const unq = (s) => s.trim().replace(/^(['"])(.*)\1$/, "$2");
|
|
11214
|
-
for (const raw of text.split("\n")) {
|
|
11215
|
-
const line = raw.replace(/(^|\s)#.*$/, "");
|
|
11216
|
-
if (!line.trim()) continue;
|
|
11217
|
-
const m = /^(doors|patterns)\s*:\s*(.*)$/.exec(line);
|
|
11218
|
-
if (m) {
|
|
11219
|
-
key = m[1];
|
|
11220
|
-
const rest = m[2].trim();
|
|
11221
|
-
if (rest.startsWith("[")) {
|
|
11222
|
-
res[key].push(...rest.replace(/^\[|\]$/g, "").split(",").map(unq).filter(Boolean));
|
|
11223
|
-
key = null;
|
|
11224
|
-
}
|
|
11225
|
-
continue;
|
|
11226
|
-
}
|
|
11227
|
-
const li = /^\s*-\s+(.*)$/.exec(line);
|
|
11228
|
-
if (li && key) res[key].push(unq(li[1]));
|
|
11229
|
-
else if (!/^\s/.test(line)) key = null;
|
|
11230
|
-
}
|
|
11231
|
-
return res;
|
|
11232
|
-
}
|
|
11233
|
-
/** The nearest `.pai/builds.yaml` at or above `cwd`. */
|
|
11234
|
-
function loadBuildsConfig(cwd) {
|
|
11235
|
-
let dir = resolve(cwd);
|
|
11236
|
-
for (;;) {
|
|
11237
|
-
const f = join(dir, ".pai", "builds.yaml");
|
|
11238
|
-
if (existsSync(f)) try {
|
|
11239
|
-
return {
|
|
11240
|
-
root: dir,
|
|
11241
|
-
...parseBuildsYaml(readFileSync(f, "utf8"))
|
|
11242
|
-
};
|
|
11243
|
-
} catch {
|
|
11244
|
-
return null;
|
|
11245
|
-
}
|
|
11246
|
-
const up = dirname(dir);
|
|
11247
|
-
if (up === dir) return null;
|
|
11248
|
-
dir = up;
|
|
11249
|
-
}
|
|
11250
|
-
}
|
|
11251
|
-
|
|
11252
11140
|
//#endregion
|
|
11253
11141
|
//#region src/builds/doctor.ts
|
|
11254
11142
|
/**
|
|
@@ -12110,7 +11998,7 @@ async function escalate(task, headline, detail, state, now, opts) {
|
|
|
12110
11998
|
let delivered = false;
|
|
12111
11999
|
try {
|
|
12112
12000
|
const { routeNotification } = await import("../router-DwHJRgG9.mjs");
|
|
12113
|
-
const { loadConfig } = await import("../config-
|
|
12001
|
+
const { loadConfig } = await import("../config-Dv3t7xnT.mjs");
|
|
12114
12002
|
delivered = (await routeNotification({
|
|
12115
12003
|
event: "error",
|
|
12116
12004
|
title: `PAI: ${headline}`,
|
|
@@ -14026,6 +13914,16 @@ function configListCmd(opts) {
|
|
|
14026
13914
|
console.log(opts.json ? JSON.stringify(r.data, null, 2) : r.yaml.trimEnd());
|
|
14027
13915
|
return 0;
|
|
14028
13916
|
}
|
|
13917
|
+
/** `pai config validate`: shadowed and unused workers keys across config.yaml and workers.yaml (warnings; exit 0). */
|
|
13918
|
+
function configValidateCmd() {
|
|
13919
|
+
const shadows = liveWorkersConfigShadows();
|
|
13920
|
+
if (!shadows.length) {
|
|
13921
|
+
console.log(ok$1("config.yaml and workers.yaml: no shadowed or unused keys"));
|
|
13922
|
+
return 0;
|
|
13923
|
+
}
|
|
13924
|
+
for (const s of shadows) console.log(`warning: ${s.message}`);
|
|
13925
|
+
return 0;
|
|
13926
|
+
}
|
|
14029
13927
|
function configGetCmd(path, opts) {
|
|
14030
13928
|
try {
|
|
14031
13929
|
const r = getConfigValueOp(path);
|
|
@@ -14302,6 +14200,14 @@ const configSubcommands = [
|
|
|
14302
14200
|
seeAlso: ["pai config migrate", "pai config set"],
|
|
14303
14201
|
run: (ctx) => configUnsetCmd(String(ctx.args.PATH))
|
|
14304
14202
|
},
|
|
14203
|
+
{
|
|
14204
|
+
name: "validate",
|
|
14205
|
+
summary: "Warn about workers settings that are shadowed or unused",
|
|
14206
|
+
description: "Warn about workers settings that are shadowed or unused.\n\nThe non-provider workers.* settings (pool, pane, routing, …) are read from config.yaml only; the routing tables (providers, tiers, classes, mcp_sets, …) from workers.yaml only. Names every key written in the file that does not win, and every top-level workers.yaml block nothing reads.",
|
|
14207
|
+
examples: ["pai config validate", "pai config get workers.pool.maxSlots --source"],
|
|
14208
|
+
seeAlso: ["pai config get", "pai config set"],
|
|
14209
|
+
run: () => configValidateCmd()
|
|
14210
|
+
},
|
|
14305
14211
|
{
|
|
14306
14212
|
name: "migrate",
|
|
14307
14213
|
summary: "Move old settings files into the current layout",
|
|
@@ -15034,7 +14940,7 @@ async function migrateToPostgres(opts = {}) {
|
|
|
15034
14940
|
const dump = pgDump(container, pgConfig, dumpPath);
|
|
15035
14941
|
if (!dump.ok) return refused(dump.reason, dryRun);
|
|
15036
14942
|
}
|
|
15037
|
-
const { PostgresBackend } = await import("../postgres-
|
|
14943
|
+
const { PostgresBackend } = await import("../postgres-CBHY5PIi.mjs");
|
|
15038
14944
|
await PostgresBackend.ensureDatabase(pgConfig);
|
|
15039
14945
|
const sqlite = new BetterSqlite3(sqliteFederationPath, { readonly: true });
|
|
15040
14946
|
const registrySqlite = sqliteRegistryPath === sqliteFederationPath ? sqlite : new BetterSqlite3(sqliteRegistryPath, { readonly: true });
|
|
@@ -16421,7 +16327,7 @@ const out = (s) => process.stdout.write(s + "\n");
|
|
|
16421
16327
|
async function repoOf(project) {
|
|
16422
16328
|
if (typeof project === "string" && project) {
|
|
16423
16329
|
if (existsSync(project)) return resolve(project);
|
|
16424
|
-
const { getProject } = await import("../helpers-
|
|
16330
|
+
const { getProject } = await import("../helpers-WV8tdQHM.mjs");
|
|
16425
16331
|
const row = await getProject(project);
|
|
16426
16332
|
if (!row) throw new CliError(`no project ${project}`, "pai projects list");
|
|
16427
16333
|
return row.root_path;
|
|
@@ -17244,7 +17150,7 @@ async function cmdPromote(opts) {
|
|
|
17244
17150
|
console.error(dim$1(` Pick a durable location for the new project.`));
|
|
17245
17151
|
process.exit(1);
|
|
17246
17152
|
}
|
|
17247
|
-
const { getRegistryBackend } = await import("../factory-
|
|
17153
|
+
const { getRegistryBackend } = await import("../factory-DeASMV7Z.mjs");
|
|
17248
17154
|
const registryBackend = await getRegistryBackend();
|
|
17249
17155
|
const encodedDir = encodeDir(targetPath);
|
|
17250
17156
|
if (await registryBackend.getProjectBySlug(slug) ?? await registryBackend.getProjectByRootPath(targetPath) ?? await registryBackend.getProjectByEncodedDir(encodedDir)) {
|
|
@@ -18488,7 +18394,7 @@ async function cmdUnregister(slug, opts = {}) {
|
|
|
18488
18394
|
* deprecated alias that forwards here with a stderr notice.
|
|
18489
18395
|
*/
|
|
18490
18396
|
async function projectListCmd(opts) {
|
|
18491
|
-
const { cmdMain } = await import("../main-resolver-
|
|
18397
|
+
const { cmdMain } = await import("../main-resolver-CAC3xfZM.mjs");
|
|
18492
18398
|
await cmdMain(void 0, void 0, opts);
|
|
18493
18399
|
return 0;
|
|
18494
18400
|
}
|
|
@@ -19911,7 +19817,7 @@ async function registryScanCmd(opts) {
|
|
|
19911
19817
|
return 0;
|
|
19912
19818
|
}
|
|
19913
19819
|
if (opts.filterReport) {
|
|
19914
|
-
const { reportUnregistrable } = await import("../registrable-
|
|
19820
|
+
const { reportUnregistrable } = await import("../registrable-Drn8wIDO.mjs");
|
|
19915
19821
|
const r = await reportUnregistrable(await getRegistryBackend());
|
|
19916
19822
|
console.log(`Registry rows: ${r.total}`);
|
|
19917
19823
|
console.log(` matching the registration filter: ${r.matching} (${r.matchingMissing} with a missing path)`);
|
|
@@ -21754,7 +21660,7 @@ async function runEmbed(backend, projectId, projectSlug, batchSize = 50, pageSiz
|
|
|
21754
21660
|
const label = projectSlug ? `project ${projectSlug}` : "all projects";
|
|
21755
21661
|
console.log(dim$1(`Generating embeddings for ${label} (this may take a while on first run)...`));
|
|
21756
21662
|
const { serializeEmbedding } = await import("../embeddings-CIkJBKd-.mjs");
|
|
21757
|
-
const { gateBackend } = await import("../embedding-gate-
|
|
21663
|
+
const { gateBackend } = await import("../embedding-gate-B98PK_wz.mjs");
|
|
21758
21664
|
const gate = await gateBackend(backend, { record: true });
|
|
21759
21665
|
if (!gate.ok) {
|
|
21760
21666
|
console.error(err(gate.reason));
|
|
@@ -22083,7 +21989,7 @@ async function memorySearchCmd(query, opts) {
|
|
|
22083
21989
|
let results;
|
|
22084
21990
|
if (mode === "keyword") results = await backend.searchKeyword(query, searchOpts);
|
|
22085
21991
|
else {
|
|
22086
|
-
const { embedQuery } = await import("../embedding-gate-
|
|
21992
|
+
const { embedQuery } = await import("../embedding-gate-B98PK_wz.mjs");
|
|
22087
21993
|
console.log(dim$1("Generating query embedding..."));
|
|
22088
21994
|
const q = await embedQuery(backend, query);
|
|
22089
21995
|
const queryEmbedding = q.vec;
|
|
@@ -22163,9 +22069,9 @@ async function memorySearchCmd(query, opts) {
|
|
|
22163
22069
|
//#region src/cli/commands/memory/sources-cmd.ts
|
|
22164
22070
|
/** `pai memory sources` — what the indexer has taken in. */
|
|
22165
22071
|
async function memorySourcesCmd(opts) {
|
|
22166
|
-
const { createStorageBackend } = await import("../factory-
|
|
22167
|
-
const { loadConfig } = await import("../config-
|
|
22168
|
-
const { cmdMemorySources } = await import("../sources-
|
|
22072
|
+
const { createStorageBackend } = await import("../factory-DeASMV7Z.mjs");
|
|
22073
|
+
const { loadConfig } = await import("../config-Dv3t7xnT.mjs");
|
|
22074
|
+
const { cmdMemorySources } = await import("../sources-CiE3rZek.mjs");
|
|
22169
22075
|
let backend;
|
|
22170
22076
|
try {
|
|
22171
22077
|
backend = await createStorageBackend(loadConfig());
|
|
@@ -22924,7 +22830,7 @@ async function zettelExploreCmd(note, opts) {
|
|
|
22924
22830
|
const depth = opts.depth ?? 3;
|
|
22925
22831
|
const direction = opts.direction ?? "both";
|
|
22926
22832
|
const mode = opts.mode ?? "all";
|
|
22927
|
-
const { zettelExplore } = await import("../zettelkasten-
|
|
22833
|
+
const { zettelExplore } = await import("../zettelkasten-BHVx5zj-.mjs");
|
|
22928
22834
|
const result = await zettelExplore(await getFedBackend(), {
|
|
22929
22835
|
startNote: note,
|
|
22930
22836
|
depth,
|
|
@@ -22980,7 +22886,7 @@ async function zettelHealthCmd(opts) {
|
|
|
22980
22886
|
const projectPath = opts.project;
|
|
22981
22887
|
const recentDays = opts.days ?? 30;
|
|
22982
22888
|
const includeTypes = opts.include ? opts.include.split(",").map((s) => s.trim()) : void 0;
|
|
22983
|
-
const { zettelHealth } = await import("../zettelkasten-
|
|
22889
|
+
const { zettelHealth } = await import("../zettelkasten-BHVx5zj-.mjs");
|
|
22984
22890
|
const result = await zettelHealth(await getFedBackend(), {
|
|
22985
22891
|
scope,
|
|
22986
22892
|
projectPath,
|
|
@@ -23038,7 +22944,7 @@ async function zettelSurpriseCmd(note, opts) {
|
|
|
23038
22944
|
const limit = opts.limit ?? 10;
|
|
23039
22945
|
const minSimilarity = opts.minSimilarity ?? .3;
|
|
23040
22946
|
const minGraphDistance = opts.minDistance ?? 3;
|
|
23041
|
-
const { zettelSurprise } = await import("../zettelkasten-
|
|
22947
|
+
const { zettelSurprise } = await import("../zettelkasten-BHVx5zj-.mjs");
|
|
23042
22948
|
const backend = await getFedBackend();
|
|
23043
22949
|
console.log();
|
|
23044
22950
|
console.log(header(" PAI Zettel Surprise"));
|
|
@@ -23080,7 +22986,7 @@ async function zettelConverseCmd(question, opts) {
|
|
|
23080
22986
|
const vaultProjectId = Number(opts.vaultProjectId);
|
|
23081
22987
|
const depth = opts.depth ?? 2;
|
|
23082
22988
|
const limit = opts.limit ?? 15;
|
|
23083
|
-
const { zettelConverse } = await import("../zettelkasten-
|
|
22989
|
+
const { zettelConverse } = await import("../zettelkasten-BHVx5zj-.mjs");
|
|
23084
22990
|
const backend = await getFedBackend();
|
|
23085
22991
|
console.log();
|
|
23086
22992
|
console.log(header(" PAI Zettel Converse"));
|
|
@@ -23130,7 +23036,7 @@ async function zettelThemesCmd(opts) {
|
|
|
23130
23036
|
const minClusterSize = opts.minSize ?? 3;
|
|
23131
23037
|
const maxThemes = opts.maxThemes ?? 10;
|
|
23132
23038
|
const similarityThreshold = opts.threshold ?? .65;
|
|
23133
|
-
const { zettelThemes } = await import("../zettelkasten-
|
|
23039
|
+
const { zettelThemes } = await import("../zettelkasten-BHVx5zj-.mjs");
|
|
23134
23040
|
const backend = await getFedBackend();
|
|
23135
23041
|
console.log();
|
|
23136
23042
|
console.log(header(" PAI Zettel Themes"));
|
|
@@ -23178,7 +23084,7 @@ async function zettelSuggestCmd(note, opts) {
|
|
|
23178
23084
|
const vaultProjectId = Number(opts.vaultProjectId);
|
|
23179
23085
|
const limit = opts.limit ?? 5;
|
|
23180
23086
|
const excludeLinked = opts.excludeLinked !== true;
|
|
23181
|
-
const { zettelSuggest } = await import("../zettelkasten-
|
|
23087
|
+
const { zettelSuggest } = await import("../zettelkasten-BHVx5zj-.mjs");
|
|
23182
23088
|
const backend = await getFedBackend();
|
|
23183
23089
|
console.log();
|
|
23184
23090
|
console.log(header(" PAI Zettel Suggest"));
|