@tekmidian/pai 0.66.6 → 0.66.8
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/dist/{aibroker-client-WCZi_tn-.mjs → aibroker-client-BfnVwGZl.mjs} +3 -3
- package/dist/{aibroker-client-WCZi_tn-.mjs.map → aibroker-client-BfnVwGZl.mjs.map} +1 -1
- package/dist/{aibroker-client-Ck3p3k_-.mjs → aibroker-client-C-O3Fflh.mjs} +1 -1
- package/dist/{auto-route-BnizyALK.mjs → auto-route-D8TBDNqb.mjs} +3 -3
- package/dist/{auto-route-BnizyALK.mjs.map → auto-route-D8TBDNqb.mjs.map} +1 -1
- package/dist/auto-route-DCxTKz19.mjs +7 -0
- package/dist/{chain-2_uoiEdD.mjs → chain-BL4khGgy.mjs} +4 -3
- package/dist/{chain-2_uoiEdD.mjs.map → chain-BL4khGgy.mjs.map} +1 -1
- package/dist/cli/index.mjs +20 -16
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/program.mjs +19 -15
- package/dist/{config-Ddc4DIPk.mjs → config-DjZELvoA.mjs} +12 -3
- package/dist/config-DjZELvoA.mjs.map +1 -0
- package/dist/{run-env-CQRnxNht.mjs → config-Dpe2JlbY.mjs} +5 -114
- package/dist/config-Dpe2JlbY.mjs.map +1 -0
- package/dist/{config-CnsDMETf.mjs → config-yomayAwe.mjs} +1 -1
- package/dist/{context-handover-cache-SFkWucuT.mjs → context-handover-cache-DFqxNh-H.mjs} +27 -13
- package/dist/context-handover-cache-DFqxNh-H.mjs.map +1 -0
- package/dist/daemon/index.mjs +20 -15
- package/dist/daemon/index.mjs.map +1 -1
- package/dist/{daemon-vLtT3yaI.mjs → daemon-CsR1S_Qr.mjs} +762 -24
- package/dist/daemon-CsR1S_Qr.mjs.map +1 -0
- package/dist/daemon-WrncnGua.mjs +23 -0
- package/dist/daemon-mcp/index.mjs +15 -12
- package/dist/daemon-mcp/index.mjs.map +1 -1
- package/dist/embedding-gate-DqbKvn56.mjs +378 -0
- package/dist/embedding-gate-DqbKvn56.mjs.map +1 -0
- package/dist/embedding-gate-SJMCPwxG.mjs +5 -0
- package/dist/{embeddings-DMVzpvRZ.mjs → embeddings-BUjZMD9F.mjs} +16 -2
- package/dist/{embeddings-DMVzpvRZ.mjs.map → embeddings-BUjZMD9F.mjs.map} +1 -1
- package/dist/embeddings-DrJ-ewfi.mjs +3 -0
- package/dist/{env-DiolswKQ.mjs → env-CPCNHz3i.mjs} +1 -1
- package/dist/{env-DiolswKQ.mjs.map → env-CPCNHz3i.mjs.map} +1 -1
- package/dist/factory-DjtXElOI.mjs +9 -0
- package/dist/{factory-CXFHwvcv.mjs → factory-yElzJc6f.mjs} +31 -9
- package/dist/factory-yElzJc6f.mjs.map +1 -0
- package/dist/{fallback-DNzd3jJc.mjs → fallback-2yWDDYiT.mjs} +5 -4
- package/dist/{fallback-DNzd3jJc.mjs.map → fallback-2yWDDYiT.mjs.map} +1 -1
- package/dist/{helpers-CZsi_49C.mjs → helpers-B9LHRJ8R.mjs} +1 -1
- package/dist/{helpers-CZsi_49C.mjs.map → helpers-B9LHRJ8R.mjs.map} +1 -1
- package/dist/hooks/block-sleep-poll.mjs +7 -2
- package/dist/hooks/block-sleep-poll.mjs.map +3 -3
- package/dist/hooks/context-compression-hook.mjs +2 -0
- package/dist/hooks/context-compression-hook.mjs.map +2 -2
- package/dist/hooks/load-core-context.mjs +5 -5
- package/dist/hooks/load-core-context.mjs.map +2 -2
- package/dist/hooks/load-project-context.mjs +2 -0
- package/dist/hooks/load-project-context.mjs.map +2 -2
- package/dist/hooks/post-compact-inject.mjs +2 -0
- package/dist/hooks/post-compact-inject.mjs.map +2 -2
- package/dist/hooks/route-agents-to-worker.mjs +2 -0
- package/dist/hooks/route-agents-to-worker.mjs.map +2 -2
- package/dist/hooks/security-validator.mjs +2 -0
- package/dist/hooks/security-validator.mjs.map +2 -2
- package/dist/hooks/whisper-rules.mjs +2 -0
- package/dist/hooks/whisper-rules.mjs.map +2 -2
- package/dist/hooks/worker-guard.mjs +82 -5
- package/dist/hooks/worker-guard.mjs.map +4 -4
- package/dist/hooks/worker-proxy.mjs +2 -0
- package/dist/hooks/worker-proxy.mjs.map +2 -2
- package/dist/hooks/worker-status-line.mjs +7 -2
- package/dist/hooks/worker-status-line.mjs.map +3 -3
- package/dist/hooks/worker-supervision.mjs +2 -0
- package/dist/hooks/worker-supervision.mjs.map +2 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +7 -4
- package/dist/{ipc-client-DkxRay-o.mjs → ipc-client-DVZ_EGnu.mjs} +2 -2
- package/dist/{ipc-client-DkxRay-o.mjs.map → ipc-client-DVZ_EGnu.mjs.map} +1 -1
- package/dist/main-resolver-DjQsexge.mjs +8 -0
- package/dist/{main-resolver-SfGGg1DB.mjs → main-resolver-Dxvn4Mv8.mjs} +7 -6
- package/dist/{main-resolver-SfGGg1DB.mjs.map → main-resolver-Dxvn4Mv8.mjs.map} +1 -1
- package/dist/{pai-marker-DXVpFsYz.mjs → pai-marker-1B7iC7oq.mjs} +121 -3
- package/dist/pai-marker-1B7iC7oq.mjs.map +1 -0
- package/dist/{planner-C-gzg7ye.mjs → planner-CspP59ya.mjs} +13 -10
- package/dist/{planner-C-gzg7ye.mjs.map → planner-CspP59ya.mjs.map} +1 -1
- package/dist/{postgres-BxmyQHoA.mjs → postgres-CCAGq1qp.mjs} +86 -5
- package/dist/postgres-CCAGq1qp.mjs.map +1 -0
- package/dist/postgres-CzkEPfAm.mjs +7 -0
- package/dist/{program-CfG1T_ko.mjs → program-cWqZI0_L.mjs} +231 -125
- package/dist/program-cWqZI0_L.mjs.map +1 -0
- package/dist/{query-feedback-BPdapXKd.mjs → query-feedback-GPeVGvIa.mjs} +2 -2
- package/dist/{query-feedback-BPdapXKd.mjs.map → query-feedback-GPeVGvIa.mjs.map} +1 -1
- package/dist/{reranker-3lnggwgq.mjs → reranker-BTiOia8Y.mjs} +1 -1
- package/dist/{reranker-3lnggwgq.mjs.map → reranker-BTiOia8Y.mjs.map} +1 -1
- package/dist/{reranker-CZ2mP4cf.mjs → reranker-YwDT2n5e.mjs} +1 -1
- package/dist/{router-BaTbc9VX.mjs → router-Bk_ySIZT.mjs} +2 -2
- package/dist/{router-BaTbc9VX.mjs.map → router-Bk_ySIZT.mjs.map} +1 -1
- package/dist/router-DyiZNI6o.mjs +3 -0
- package/dist/{run-ChlIbDJ0.mjs → run-BZNdpUGQ.mjs} +226 -1797
- package/dist/run-BZNdpUGQ.mjs.map +1 -0
- package/dist/run-env-Cd0Son-Y.mjs +115 -0
- package/dist/run-env-Cd0Son-Y.mjs.map +1 -0
- package/dist/{pai-home-UncxWxlX.mjs → runtime-paths-DkZoxofH.mjs} +50 -2
- package/dist/runtime-paths-DkZoxofH.mjs.map +1 -0
- package/dist/{search-CNAGTiJP.mjs → search-cPDj-9fO.mjs} +2 -2
- package/dist/{search-CNAGTiJP.mjs.map → search-cPDj-9fO.mjs.map} +1 -1
- package/dist/{sources-CM2g-CLT.mjs → sources-CvvzNZad.mjs} +1 -1
- package/dist/{sources-CM2g-CLT.mjs.map → sources-CvvzNZad.mjs.map} +1 -1
- package/dist/{stop-words-DtxaTWU_.mjs → stop-words-LtkS-Pej.mjs} +1 -1
- package/dist/{stop-words-DtxaTWU_.mjs.map → stop-words-LtkS-Pej.mjs.map} +1 -1
- package/dist/worktree-CwMRTa0H.mjs +1578 -0
- package/dist/worktree-CwMRTa0H.mjs.map +1 -0
- package/dist/{zettelkasten-BRIaHzFm.mjs → zettelkasten-DSIe6wpF.mjs} +6 -5
- package/dist/zettelkasten-DSIe6wpF.mjs.map +1 -0
- package/dist/{zettelkasten-G0-ZTybr.mjs → zettelkasten-DtkAvA18.mjs} +5 -3
- package/docker/docker-compose.yml +4 -0
- package/docs/commands/README.md +6 -0
- package/docs/commands/memory.md +52 -0
- package/docs/commands/worker.md +22 -0
- package/docs/install-linux.md +1 -0
- package/docs/memory.md +69 -0
- package/package.json +1 -1
- package/src/hooks/ts/lib/sleep-poll-gate.test.ts +2 -2
- package/src/hooks/ts/lib/sleep-poll-gate.ts +4 -4
- package/src/hooks/ts/lib/worker-guard-longwait.test.ts +48 -0
- package/src/hooks/ts/lib/worker-guard.ts +50 -6
- package/src/hooks/ts/pre-tool-use/block-sleep-poll.test.ts +1 -1
- package/src/hooks/ts/session-start/load-core-context.ts +11 -8
- package/src/hooks/ts/session-start/session-start-worker-guard.test.ts +34 -2
- package/dist/auto-route-D6fW1Q8z.mjs +0 -3
- package/dist/config-Ddc4DIPk.mjs.map +0 -1
- package/dist/context-handover-cache-SFkWucuT.mjs.map +0 -1
- package/dist/daemon-BHQoEjt0.mjs +0 -18
- package/dist/daemon-vLtT3yaI.mjs.map +0 -1
- package/dist/embeddings-D0WOQpYR.mjs +0 -3
- package/dist/factory-CXFHwvcv.mjs.map +0 -1
- package/dist/factory-CnKsU6zX.mjs +0 -8
- package/dist/main-resolver-DrHtx8iW.mjs +0 -7
- package/dist/pai-home-UncxWxlX.mjs.map +0 -1
- package/dist/pai-marker-DXVpFsYz.mjs.map +0 -1
- package/dist/postgres-B2BEBT-J.mjs +0 -5
- package/dist/postgres-BxmyQHoA.mjs.map +0 -1
- package/dist/program-CfG1T_ko.mjs.map +0 -1
- package/dist/router-BK-hFeQ6.mjs +0 -3
- package/dist/run-ChlIbDJ0.mjs.map +0 -1
- package/dist/run-env-CQRnxNht.mjs.map +0 -1
- package/dist/runtime-paths-Bw3Jk8qJ.mjs +0 -52
- package/dist/runtime-paths-Bw3Jk8qJ.mjs.map +0 -1
- package/dist/zettelkasten-BRIaHzFm.mjs.map +0 -1
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { c as ok, g as warn, i as err, n as dim, r as encodeDir, s as now, t as bold } from "./utils-DddRwMsG.mjs";
|
|
2
2
|
import { a as slugify, i as parseSessionFilename, n as decodeEncodedDir, t as buildEncodedDirMap } from "./migrate-Bq0esMOa.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
3
|
+
import { y as writeJsonAtomic } from "./config-DjZELvoA.mjs";
|
|
4
|
+
import { c as migratePaiFile, d as resolvePaiFile, r as daemonPidPath, u as paiHomePath } from "./runtime-paths-DkZoxofH.mjs";
|
|
5
|
+
import { D as resolveModelCapability, T as readWorkersSection, g as defaultWorkersConfig } from "./config-Dpe2JlbY.mjs";
|
|
6
|
+
import { H as ensureNoMcpConfig, _ as appendLedger, p as worktreesDir, q as workersLogDir } from "./worktree-CwMRTa0H.mjs";
|
|
7
|
+
import { i as pruneWorktreeProjects, n as ensurePaiMarker, o as worktreeReason, t as discoverPaiMarkers } from "./pai-marker-1B7iC7oq.mjs";
|
|
8
|
+
import { i as getRegistryBackend } from "./factory-yElzJc6f.mjs";
|
|
9
|
+
import { A as ensureProxyRunning, E as sessionMapPath, F as resolveTarget, k as DEFAULT_PROXY_PORT, w as itermUuid } from "./run-BZNdpUGQ.mjs";
|
|
10
|
+
import { t as buildRunEnv } from "./run-env-Cd0Son-Y.mjs";
|
|
11
|
+
import { i as sendToSession, n as fetchLiveSessions } from "./aibroker-client-BfnVwGZl.mjs";
|
|
11
12
|
import { createReadStream, existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, renameSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
12
13
|
import { homedir, setPriority, tmpdir, userInfo } from "node:os";
|
|
13
14
|
import { basename, delimiter, dirname, join, resolve } from "node:path";
|
|
14
|
-
import { randomUUID } from "node:crypto";
|
|
15
15
|
import { spawn, spawnSync } from "node:child_process";
|
|
16
|
+
import { randomUUID } from "node:crypto";
|
|
16
17
|
import { copyFileSync as copyFileSync$1, existsSync as existsSync$1, linkSync as linkSync$1, mkdirSync as mkdirSync$1, readFileSync as readFileSync$1, readdirSync as readdirSync$1, renameSync as renameSync$1, writeFileSync as writeFileSync$1 } from "fs";
|
|
17
18
|
import { basename as basename$1, join as join$1, resolve as resolve$1 } from "path";
|
|
18
19
|
import { homedir as homedir$1 } from "os";
|
|
@@ -299,7 +300,7 @@ async function worthWriting(backend, projectId, encodedDir) {
|
|
|
299
300
|
return transcriptFiles(join(claudeProjectsDir(), current)).length === 0;
|
|
300
301
|
}
|
|
301
302
|
/**
|
|
302
|
-
* Upsert a project row. Returns { id, isNew }.
|
|
303
|
+
* Upsert a project row. Returns { id, isNew }, or null for an unregistrable path.
|
|
303
304
|
*
|
|
304
305
|
* Matching priority:
|
|
305
306
|
* 1. root_path — most reliable; handles slug collisions
|
|
@@ -310,6 +311,7 @@ async function worthWriting(backend, projectId, encodedDir) {
|
|
|
310
311
|
* listing always shows a human-readable name rather than the kebab-case slug.
|
|
311
312
|
*/
|
|
312
313
|
async function upsertProject(backend, slug, rootPath, encodedDir) {
|
|
314
|
+
if (worktreeReason(rootPath)) return null;
|
|
313
315
|
const ts = now();
|
|
314
316
|
const byPath = await backend.getProjectByRootPath(rootPath);
|
|
315
317
|
if (byPath) {
|
|
@@ -464,6 +466,7 @@ async function performScan() {
|
|
|
464
466
|
skipped: []
|
|
465
467
|
};
|
|
466
468
|
if (!existsSync(CLAUDE_PROJECTS_DIR$1)) throw new Error(`Claude projects directory not found: ${CLAUDE_PROJECTS_DIR$1}`);
|
|
469
|
+
await pruneWorktreeProjects(backend);
|
|
467
470
|
const entries = readdirSync(CLAUDE_PROJECTS_DIR$1).filter((name) => {
|
|
468
471
|
return statSync(join(CLAUDE_PROJECTS_DIR$1, name)).isDirectory();
|
|
469
472
|
});
|
|
@@ -482,7 +485,13 @@ async function performScan() {
|
|
|
482
485
|
}
|
|
483
486
|
rootPath = canonicalPath(rootPath);
|
|
484
487
|
const slug = slugify(basename(rootPath) || encodedDir);
|
|
485
|
-
const
|
|
488
|
+
const upserted = await upsertProject(backend, slug, rootPath, encodedDir);
|
|
489
|
+
if (!upserted) {
|
|
490
|
+
result.skipped.push(`${encodedDir} (${rootPath} — ${worktreeReason(rootPath)})`);
|
|
491
|
+
result.projectsScanned++;
|
|
492
|
+
continue;
|
|
493
|
+
}
|
|
494
|
+
const { id, isNew } = upserted;
|
|
486
495
|
result.projectsScanned++;
|
|
487
496
|
if (isNew) result.projectsNew++;
|
|
488
497
|
else result.projectsUpdated++;
|
|
@@ -560,7 +569,12 @@ async function performScan() {
|
|
|
560
569
|
}
|
|
561
570
|
continue;
|
|
562
571
|
}
|
|
563
|
-
const
|
|
572
|
+
const upserted = await upsertProject(backend, childSlug, childPath, childEncoded);
|
|
573
|
+
if (!upserted) {
|
|
574
|
+
result.skipped.push(`${childPath} (${worktreeReason(childPath)})`);
|
|
575
|
+
continue;
|
|
576
|
+
}
|
|
577
|
+
const { id, isNew } = upserted;
|
|
564
578
|
result.projectsScanned++;
|
|
565
579
|
if (isNew) result.projectsNew++;
|
|
566
580
|
else result.projectsUpdated++;
|
|
@@ -4412,4 +4426,4 @@ function writeContextHandoverCache(cache) {
|
|
|
4412
4426
|
|
|
4413
4427
|
//#endregion
|
|
4414
4428
|
export { shutdownRequested as $, indexInProgress as A, claudeProjectsDir as At, setEmbedInProgress as B, handleSessionSummary as C, loadScanConfig as Ct, daemonConfig as D, saveScanConfig as Dt, cacheKeepaliveTimer as E, resolveHome as Et, notificationConfig as F, formatDetection as Ft, setLastIndexTime as G, setIndexInProgress as H, passFailures as I, formatDetectionJson as It, setRegistryBackend as J, setLastVaultIndexTime as K, registryBackend as L, lastEmbedTime as M, scanTranscriptFolders as Mt, lastIndexTime as N, transcriptFiles as Nt, embedInProgress as O, upsertProject as Ot, lastVaultIndexTime as P, detectProject as Pt, setVaultIndexInProgress as Q, setCacheKeepaliveTimer as R, getGitContext as S, cmdScan as St, spawnSummarizer as T, performScan as Tt, setIndexSchedulerTimer as U, setEmbedSchedulerTimer as V, setLastEmbedTime as W, setStartTime as X, setShutdownRequested as Y, setStorageBackend as Z, markCompleted as _, buildWakeupContext as _t, sessionKeepaliveLedgerSummary as a, updateTodoContinue as at, contentToText as b, reexecBackground as bt, removeDaemonPidfile as c, findLatestNote as ct, cleanup as d, addWorkToSessionNote as dt, startTime as et, dequeue as f, appendCheckpoint as ft, loadQueue as g, findNotesDir$1 as gt, hasPendingOrProcessingOfType as h, archiveSessionFilesToSessionsDir as ht, runSessionKeepaliveTick as i, sessionIdFromTranscript as it, indexSchedulerTimer as j, findMovedProjects as jt, embedSchedulerTimer as k, upsertSession as kt, resolveDaemonPid as l, findNotesDir as lt, getStats as m, getCurrentNotePath as mt, writeContextHandoverCache as n, vaultIndexInProgress as nt, parseSessionUsage as o, appendCheckpointToNote as ot, enqueue as p, finalizeSessionNote as pt, setNotificationConfig as q, loadSessionKeepaliveState as r, extractAndStoreTriples$1 as rt, totalUsageTokens as s, applyContinue as st, readContextHandoverCache as t, storageBackend as tt, writeDaemonPidfile as u, readBodyFile as ut, markFailed as v, migrateIdentityFile as vt, migrateSummaryCooldowns as w, migrateScanConfig as wt, findLatestJsonl as x, runPassChild as xt, migrateWorkQueue as y, PassSpawnError as yt, setDaemonConfig as z };
|
|
4415
|
-
//# sourceMappingURL=context-handover-cache-
|
|
4429
|
+
//# sourceMappingURL=context-handover-cache-DFqxNh-H.mjs.map
|