@tekmidian/pai 0.66.2 → 0.66.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{aibroker-client-CHEEvJZW.mjs → aibroker-client-Ck3p3k_-.mjs} +1 -1
- package/dist/{aibroker-client-Dfv7j1Od.mjs → aibroker-client-WCZi_tn-.mjs} +2 -2
- package/dist/{aibroker-client-Dfv7j1Od.mjs.map → aibroker-client-WCZi_tn-.mjs.map} +1 -1
- package/dist/{chain-D5876UQX.mjs → chain-Fz4NLm4D.mjs} +3 -3
- package/dist/{chain-D5876UQX.mjs.map → chain-Fz4NLm4D.mjs.map} +1 -1
- package/dist/cli/index.mjs +13 -13
- package/dist/cli/program.mjs +13 -13
- package/dist/{config-DKIA7wgF.mjs → config-CnsDMETf.mjs} +1 -1
- package/dist/{config-C-LiGlop.mjs → config-Ddc4DIPk.mjs} +5 -3
- package/dist/config-Ddc4DIPk.mjs.map +1 -0
- package/dist/{context-handover-cache-9PGvXRIw.mjs → context-handover-cache-DcPEW6vf.mjs} +244 -10
- package/dist/context-handover-cache-DcPEW6vf.mjs.map +1 -0
- package/dist/daemon/index.mjs +11 -11
- package/dist/{daemon-BUgNvMUh.mjs → daemon-Bl8TpHdM.mjs} +37 -18
- package/dist/daemon-Bl8TpHdM.mjs.map +1 -0
- package/dist/daemon-ZhHU6D0i.mjs +18 -0
- package/dist/daemon-mcp/index.mjs +9 -9
- package/dist/{embeddings-CEBGrzwu.mjs → embeddings-D0WOQpYR.mjs} +1 -1
- package/dist/{embeddings-DOLZnT1X.mjs → embeddings-DMVzpvRZ.mjs} +18 -9
- package/dist/embeddings-DMVzpvRZ.mjs.map +1 -0
- package/dist/{factory-Ypf8r0fK.mjs → factory-BUnZgnKW.mjs} +5 -5
- package/dist/{factory-Ypf8r0fK.mjs.map → factory-BUnZgnKW.mjs.map} +1 -1
- package/dist/{factory-DrBg24UT.mjs → factory-CrVlo2hY.mjs} +4 -4
- package/dist/{fallback-D51R4shY.mjs → fallback-awOmq_9A.mjs} +4 -4
- package/dist/{fallback-D51R4shY.mjs.map → fallback-awOmq_9A.mjs.map} +1 -1
- package/dist/hooks/block-sleep-poll.mjs +6 -5
- package/dist/hooks/block-sleep-poll.mjs.map +3 -3
- package/dist/hooks/context-compression-hook.mjs +1 -0
- package/dist/hooks/context-compression-hook.mjs.map +2 -2
- package/dist/hooks/load-project-context.mjs +6 -5
- package/dist/hooks/load-project-context.mjs.map +3 -3
- package/dist/hooks/post-compact-inject.mjs +6 -5
- package/dist/hooks/post-compact-inject.mjs.map +3 -3
- package/dist/hooks/route-agents-to-worker.mjs +6 -5
- package/dist/hooks/route-agents-to-worker.mjs.map +3 -3
- package/dist/hooks/security-validator.mjs +1 -0
- package/dist/hooks/security-validator.mjs.map +2 -2
- package/dist/hooks/whisper-rules.mjs +1 -0
- package/dist/hooks/whisper-rules.mjs.map +2 -2
- package/dist/hooks/worker-guard.mjs +6 -5
- package/dist/hooks/worker-guard.mjs.map +3 -3
- package/dist/hooks/worker-proxy.mjs +6 -5
- package/dist/hooks/worker-proxy.mjs.map +3 -3
- package/dist/hooks/worker-status-line.mjs +6 -5
- package/dist/hooks/worker-status-line.mjs.map +3 -3
- package/dist/hooks/worker-supervision.mjs +6 -5
- package/dist/hooks/worker-supervision.mjs.map +3 -3
- package/dist/{ipc-client-BLYX51nG.mjs → ipc-client-DkxRay-o.mjs} +2 -2
- package/dist/{ipc-client-BLYX51nG.mjs.map → ipc-client-DkxRay-o.mjs.map} +1 -1
- package/dist/{main-resolver-kVkMJZUD.mjs → main-resolver-CVGPICy-.mjs} +6 -6
- package/dist/{main-resolver-kVkMJZUD.mjs.map → main-resolver-CVGPICy-.mjs.map} +1 -1
- package/dist/main-resolver-DDShdDBm.mjs +7 -0
- package/dist/{pai-home-Cm9rcJgX.mjs → pai-home-UncxWxlX.mjs} +1 -1
- package/dist/{pai-home-Cm9rcJgX.mjs.map → pai-home-UncxWxlX.mjs.map} +1 -1
- package/dist/{planner-D5yt0EfA.mjs → planner-GdiYe2FO.mjs} +8 -8
- package/dist/{planner-D5yt0EfA.mjs.map → planner-GdiYe2FO.mjs.map} +1 -1
- package/dist/{postgres-BmLr0MUm.mjs → postgres-DKyiCA5V.mjs} +2 -2
- package/dist/{postgres-D3xc2RB4.mjs → postgres-H85VSYHI.mjs} +2 -2
- package/dist/{postgres-D3xc2RB4.mjs.map → postgres-H85VSYHI.mjs.map} +1 -1
- package/dist/{program-DIXRtAFy.mjs → program-D3MSfx86.mjs} +117 -82
- package/dist/program-D3MSfx86.mjs.map +1 -0
- package/dist/{query-feedback-B7FYE4JR.mjs → query-feedback-BPdapXKd.mjs} +2 -2
- package/dist/{query-feedback-B7FYE4JR.mjs.map → query-feedback-BPdapXKd.mjs.map} +1 -1
- package/dist/{run-CLYTOm0x.mjs → run-D9YbWsnL.mjs} +5 -5
- package/dist/{run-CLYTOm0x.mjs.map → run-D9YbWsnL.mjs.map} +1 -1
- package/dist/{run-env-Bnmf6bRI.mjs → run-env-CQRnxNht.mjs} +3 -3
- package/dist/{run-env-Bnmf6bRI.mjs.map → run-env-CQRnxNht.mjs.map} +1 -1
- package/dist/{runtime-paths-D3FKAm69.mjs → runtime-paths-Bw3Jk8qJ.mjs} +4 -2
- package/dist/runtime-paths-Bw3Jk8qJ.mjs.map +1 -0
- package/dist/{zettelkasten-BhZMvmoK.mjs → zettelkasten-BRIaHzFm.mjs} +2 -2
- package/dist/{zettelkasten-BhZMvmoK.mjs.map → zettelkasten-BRIaHzFm.mjs.map} +1 -1
- package/dist/{zettelkasten-BwV1pluL.mjs → zettelkasten-G0-ZTybr.mjs} +3 -3
- package/docs/commands/memory.md +2 -0
- package/package.json +1 -1
- package/dist/config-C-LiGlop.mjs.map +0 -1
- package/dist/context-handover-cache-9PGvXRIw.mjs.map +0 -1
- package/dist/daemon-BUgNvMUh.mjs.map +0 -1
- package/dist/daemon-DL0eglMJ.mjs +0 -18
- package/dist/embeddings-DOLZnT1X.mjs.map +0 -1
- package/dist/main-resolver-BYgP86C1.mjs +0 -7
- package/dist/program-DIXRtAFy.mjs.map +0 -1
- package/dist/runtime-paths-D3FKAm69.mjs.map +0 -1
|
@@ -3,20 +3,20 @@ import { a as slugify$1, i as parseSessionFilename } from "./migrate-Bq0esMOa.mj
|
|
|
3
3
|
import { n as ensurePaiMarker } from "./pai-marker-DXVpFsYz.mjs";
|
|
4
4
|
import { t as STOP_WORDS } from "./stop-words-DtxaTWU_.mjs";
|
|
5
5
|
import { t as applyRecencyBoost } from "./search-CNAGTiJP.mjs";
|
|
6
|
-
import { o as packageRoot, r as indexProjectWithBackend, s as resolveFromModule } from "./postgres-
|
|
7
|
-
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-
|
|
8
|
-
import { b as OWNER_LABEL_PREFIX, c as migrateConfigFile, d as readMainConfigRaw, f as writeMainConfigRaw, h as resolvedMainConfigPath, l as paiConfigFilePath, m as migrateMainConfigToYaml, n as CONFIG_FILE$2, o as expandHome, p as MainConfigError, s as loadConfig, t as CONFIG_DIR, u as paiConfigYamlFilePath, v as readJsonStrict, x as UNROUTED, y as writeJsonAtomic } from "./config-
|
|
9
|
-
import { a as
|
|
10
|
-
import { a as
|
|
11
|
-
import { At as
|
|
12
|
-
import { B as DEFAULT_CONTEXT_WINDOW, C as maskKey, D as readWorkersSection, F as needsWorkersYamlRelocation, H as stripModelVariant, I as parseWorkersYamlDocument, L as relocateWorkersYaml, M as initWorkersYaml, N as inlineWorkersYamlKeys, P as migrateWorkersToYaml, R as workersYamlLegacyNotice, V as contextWindowFromModelId, b as getProviderOrNative, d as MODEL_CAPABILITIES, h as WorkersConfigError, p as PROVIDER_TAGS, r as ANTHROPIC_NATIVE, t as buildRunEnv, w as nativeAnthropicProvider, x as isModelCapability, y as expandHome$1, z as workersYamlPath } from "./run-env-
|
|
13
|
-
import { $ as longInlinePromptHint, A as git, F as appendLedger, G as loadStatus, K as loadStatuses, L as UNLABELED, M as uncommittedPaths, N as verifyWorker, O as discardWorker, Q as waitForTerminalStatus, U as isChatPane, W as isLive, X as saveStatus, Y as ownsPid, Z as setWorkerLabel, _ as markControlsHeld, _t as expandMcpNames, b as requestKill, c as handoffFromInside, dt as ledgerPath, et as parseRunnerArgs, f as checkPaneForWorker, ft as statusPath, g as clickrControlsArgv, gt as describeMcp, h as openPaneForWorker, ht as projectLaunchConfig, i as usageContextTokens, it as stopProxy, j as mergeWorker, k as gcWorktrees, lt as ensureNoMcpConfig, m as openFollowPane, mt as pinNotices, n as runWorker, nt as DEFAULT_PROXY_PORT, o as parseWorkerReport, p as closeEndedPanes, pt as workersLogDir, r as testProvider, rt as ensureProxyRunning, u as sayToWorker, ut as eventsPath, v as callerDescription } from "./run-
|
|
14
|
-
import { t as PaiClient } from "./ipc-client-
|
|
15
|
-
import { A as getConfigValueOp, C as setWorkersEnabled, D as useProvider, E as updateProvider, M as setConfigValueOp, N as unsetConfigValueOp, O as MainConfigOpsError, S as setProviderModel, T as unsetClass, _ as removeProvider, a as followWorkers, b as setClass, c as statusLineOutput, d as addProvider, f as classTargetText, g as modelPrefsText, h as describeProviders, i as fallbackStatusText, j as listConfigOp, k as formatConfigGetOutput, l as readSpecPrompt, m as describeModels, n as fallbackOn, o as psOutput, p as describeCapabilities, r as fallbackStatus, s as replayOutput, t as fallbackOff, u as resolveSpecPath, v as resolveProviderName, w as unsetCapabilityPreference, x as setProviderEnabled, y as setCapabilityPreference } from "./fallback-
|
|
16
|
-
import { _ as resolveSessionByNameOrId, a as buildDeduped, c as hasConversation, d as providerResumePlan, f as restoreTopLevel, g as migrateSessionScanCache, h as fmtAge$1, l as launchInDir, m as printExitDir, o as normalizeName$2, p as resumeArgvText, s as renderDedupedSessions, t as cmdMain, u as launchPrompt, v as scanCacheFilePath, y as scanSessions } from "./main-resolver-
|
|
17
|
-
import { n as queriesDirPath, t as migrateQueriesDir } from "./query-feedback-
|
|
18
|
-
import { i as sendToSession, n as fetchLiveSessions, r as revealItermSession, t as callAiBroker } from "./aibroker-client-
|
|
19
|
-
import { t as runChain } from "./chain-
|
|
6
|
+
import { n as embedChunksWithBackend, o as packageRoot, r as indexProjectWithBackend, s as resolveFromModule } from "./postgres-H85VSYHI.mjs";
|
|
7
|
+
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-BUnZgnKW.mjs";
|
|
8
|
+
import { b as OWNER_LABEL_PREFIX, c as migrateConfigFile, d as readMainConfigRaw, f as writeMainConfigRaw, h as resolvedMainConfigPath, l as paiConfigFilePath, m as migrateMainConfigToYaml, n as CONFIG_FILE$2, o as expandHome, p as MainConfigError, s as loadConfig, t as CONFIG_DIR, u as paiConfigYamlFilePath, v as readJsonStrict, x as UNROUTED, y as writeJsonAtomic } from "./config-Ddc4DIPk.mjs";
|
|
9
|
+
import { a as paiHomePath, i as paiHomeDir, n as migratePaiDir, o as resolvePaiFile, r as migratePaiFile, t as PaiFileMigrationError } from "./pai-home-UncxWxlX.mjs";
|
|
10
|
+
import { a as schedulerLogPath, i as paiSocketPath, n as daemonLogPath } from "./runtime-paths-Bw3Jk8qJ.mjs";
|
|
11
|
+
import { At as claudeProjectsDir, Ct as loadScanConfig, Dt as saveScanConfig, Et as resolveHome, Ft as formatDetection, It as formatDetectionJson, Mt as scanTranscriptFolders, Nt as transcriptFiles, Ot as upsertProject, Pt as detectProject, St as cmdScan, a as sessionKeepaliveLedgerSummary, bt as reexecBackground, ct as findLatestNote, jt as findMovedProjects, kt as upsertSession, l as resolveDaemonPid, lt as findNotesDir$1, o as parseSessionUsage, ot as appendCheckpointToNote, r as loadSessionKeepaliveState, rt as extractAndStoreTriples, s as totalUsageTokens, st as applyContinue, t as readContextHandoverCache, ut as readBodyFile, vt as migrateIdentityFile, w as migrateSummaryCooldowns, wt as migrateScanConfig, y as migrateWorkQueue } from "./context-handover-cache-DcPEW6vf.mjs";
|
|
12
|
+
import { B as DEFAULT_CONTEXT_WINDOW, C as maskKey, D as readWorkersSection, F as needsWorkersYamlRelocation, H as stripModelVariant, I as parseWorkersYamlDocument, L as relocateWorkersYaml, M as initWorkersYaml, N as inlineWorkersYamlKeys, P as migrateWorkersToYaml, R as workersYamlLegacyNotice, V as contextWindowFromModelId, b as getProviderOrNative, d as MODEL_CAPABILITIES, h as WorkersConfigError, p as PROVIDER_TAGS, r as ANTHROPIC_NATIVE, t as buildRunEnv, w as nativeAnthropicProvider, x as isModelCapability, y as expandHome$1, z as workersYamlPath } from "./run-env-CQRnxNht.mjs";
|
|
13
|
+
import { $ as longInlinePromptHint, A as git, F as appendLedger, G as loadStatus, K as loadStatuses, L as UNLABELED, M as uncommittedPaths, N as verifyWorker, O as discardWorker, Q as waitForTerminalStatus, U as isChatPane, W as isLive, X as saveStatus, Y as ownsPid, Z as setWorkerLabel, _ as markControlsHeld, _t as expandMcpNames, b as requestKill, c as handoffFromInside, dt as ledgerPath, et as parseRunnerArgs, f as checkPaneForWorker, ft as statusPath, g as clickrControlsArgv, gt as describeMcp, h as openPaneForWorker, ht as projectLaunchConfig, i as usageContextTokens, it as stopProxy, j as mergeWorker, k as gcWorktrees, lt as ensureNoMcpConfig, m as openFollowPane, mt as pinNotices, n as runWorker, nt as DEFAULT_PROXY_PORT, o as parseWorkerReport, p as closeEndedPanes, pt as workersLogDir, r as testProvider, rt as ensureProxyRunning, u as sayToWorker, ut as eventsPath, v as callerDescription } from "./run-D9YbWsnL.mjs";
|
|
14
|
+
import { t as PaiClient } from "./ipc-client-DkxRay-o.mjs";
|
|
15
|
+
import { A as getConfigValueOp, C as setWorkersEnabled, D as useProvider, E as updateProvider, M as setConfigValueOp, N as unsetConfigValueOp, O as MainConfigOpsError, S as setProviderModel, T as unsetClass, _ as removeProvider, a as followWorkers, b as setClass, c as statusLineOutput, d as addProvider, f as classTargetText, g as modelPrefsText, h as describeProviders, i as fallbackStatusText, j as listConfigOp, k as formatConfigGetOutput, l as readSpecPrompt, m as describeModels, n as fallbackOn, o as psOutput, p as describeCapabilities, r as fallbackStatus, s as replayOutput, t as fallbackOff, u as resolveSpecPath, v as resolveProviderName, w as unsetCapabilityPreference, x as setProviderEnabled, y as setCapabilityPreference } from "./fallback-awOmq_9A.mjs";
|
|
16
|
+
import { _ as resolveSessionByNameOrId, a as buildDeduped, c as hasConversation, d as providerResumePlan, f as restoreTopLevel, g as migrateSessionScanCache, h as fmtAge$1, l as launchInDir, m as printExitDir, o as normalizeName$2, p as resumeArgvText, s as renderDedupedSessions, t as cmdMain, u as launchPrompt, v as scanCacheFilePath, y as scanSessions } from "./main-resolver-CVGPICy-.mjs";
|
|
17
|
+
import { n as queriesDirPath, t as migrateQueriesDir } from "./query-feedback-BPdapXKd.mjs";
|
|
18
|
+
import { i as sendToSession, n as fetchLiveSessions, r as revealItermSession, t as callAiBroker } from "./aibroker-client-WCZi_tn-.mjs";
|
|
19
|
+
import { t as runChain } from "./chain-Fz4NLm4D.mjs";
|
|
20
20
|
import { appendFileSync, chmodSync, closeSync, copyFileSync, cpSync, createReadStream, existsSync, lstatSync, mkdirSync, openSync, readFileSync, readdirSync, readlinkSync, realpathSync, renameSync, statSync, symlinkSync, unlinkSync, writeFileSync } from "node:fs";
|
|
21
21
|
import { homedir, platform, tmpdir, userInfo } from "node:os";
|
|
22
22
|
import { basename, dirname, join, relative, resolve, sep } from "node:path";
|
|
@@ -155,7 +155,7 @@ async function cmdPromote(opts) {
|
|
|
155
155
|
console.error(dim$1(` Pick a durable location for the new project.`));
|
|
156
156
|
process.exit(1);
|
|
157
157
|
}
|
|
158
|
-
const { getRegistryBackend } = await import("./factory-
|
|
158
|
+
const { getRegistryBackend } = await import("./factory-CrVlo2hY.mjs");
|
|
159
159
|
const registryBackend = await getRegistryBackend();
|
|
160
160
|
const encodedDir = encodeDir(targetPath);
|
|
161
161
|
if (await registryBackend.getProjectBySlug(slug) ?? await registryBackend.getProjectByRootPath(targetPath) ?? await registryBackend.getProjectByEncodedDir(encodedDir)) {
|
|
@@ -2039,7 +2039,7 @@ async function cmdUnregister(slug, opts = {}) {
|
|
|
2039
2039
|
//#region src/cli/commands/project/projects-index.ts
|
|
2040
2040
|
function registerProjectsCommands(projectsCmd) {
|
|
2041
2041
|
projectsCmd.command("list", { isDefault: true }).description("Show the unified deduped listing (same as `pai`).\nUse --all to include cold / zero-session / archived projects.").option("--all", "Show all entries including cold / zero-session / archived projects").option("-n, --n <count>", "Max rows to show", "20").action(async (opts) => {
|
|
2042
|
-
const { cmdMain } = await import("./main-resolver-
|
|
2042
|
+
const { cmdMain } = await import("./main-resolver-DDShdDBm.mjs");
|
|
2043
2043
|
await cmdMain(void 0, void 0, opts);
|
|
2044
2044
|
});
|
|
2045
2045
|
projectsCmd.command("list-raw").description("Raw registry listing with slug, path, status, last_active columns").option("--all", "Include archived projects (default: active only)").option("--status <status>", "Filter by status: active | archived").option("--tag <tag>", "Filter by tag").option("--type <type>", "Filter by type").action(async (opts) => {
|
|
@@ -2905,7 +2905,7 @@ const DEFAULT_PAGE_SIZE = 500;
|
|
|
2905
2905
|
async function runEmbed(backend, projectId, projectSlug, batchSize = 50, pageSize = DEFAULT_PAGE_SIZE) {
|
|
2906
2906
|
const label = projectSlug ? `project ${projectSlug}` : "all projects";
|
|
2907
2907
|
console.log(dim$1(`Generating embeddings for ${label} (this may take a while on first run)...`));
|
|
2908
|
-
const { generateEmbeddings, serializeEmbedding } = await import("./embeddings-
|
|
2908
|
+
const { generateEmbeddings, serializeEmbedding } = await import("./embeddings-D0WOQpYR.mjs");
|
|
2909
2909
|
const { chunks: totalEstimate } = projectId !== void 0 ? await backend.getProjectStats(projectId) : await backend.getStats();
|
|
2910
2910
|
let done = 0;
|
|
2911
2911
|
let after = null;
|
|
@@ -2929,7 +2929,8 @@ async function runEmbed(backend, projectId, projectSlug, batchSize = 50, pageSiz
|
|
|
2929
2929
|
console.log(ok$1(`Done.`) + ` ${bold$1(String(done))} chunks embedded`);
|
|
2930
2930
|
}
|
|
2931
2931
|
function registerEmbedCommand(memoryCmd) {
|
|
2932
|
-
memoryCmd.command("embed [project-slug]").description("Generate embeddings for un-embedded chunks (Phase 2.5)").option("--batch-size <n>", "Chunks to embed per batch", "50").action(async (projectSlug, opts) => {
|
|
2932
|
+
memoryCmd.command("embed [project-slug]").description("Generate embeddings for un-embedded chunks (Phase 2.5)").option("--batch-size <n>", "Chunks to embed per batch", "50").option("--background", "Run at background priority (taskpolicy -b + nice)").action(async (projectSlug, opts) => {
|
|
2933
|
+
if (opts.background) reexecBackground();
|
|
2933
2934
|
let backend;
|
|
2934
2935
|
try {
|
|
2935
2936
|
backend = await getStorageBackend();
|
|
@@ -2976,7 +2977,11 @@ async function indexAllProjects(backend) {
|
|
|
2976
2977
|
};
|
|
2977
2978
|
}
|
|
2978
2979
|
function registerIndexCommand(memoryCmd) {
|
|
2979
|
-
memoryCmd.command("index [project-slug]").description("Index memory files for one project or all projects").option("--all", "Index all active projects (default when no slug given)").option("--embed", "Also generate embeddings for newly indexed chunks (Phase 2.5)").option("--direct", "Skip daemon IPC and run index directly (for debugging)").action(async (projectSlug, opts) => {
|
|
2980
|
+
memoryCmd.command("index [project-slug]").description("Index memory files for one project or all projects").option("--all", "Index all active projects (default when no slug given)").option("--embed", "Also generate embeddings for newly indexed chunks (Phase 2.5)").option("--direct", "Skip daemon IPC and run index directly (for debugging)").option("--background", "Run at background priority (taskpolicy -b + nice); implies --direct").action(async (projectSlug, opts) => {
|
|
2981
|
+
if (opts.background) {
|
|
2982
|
+
opts.direct = true;
|
|
2983
|
+
reexecBackground();
|
|
2984
|
+
}
|
|
2980
2985
|
if (!opts.direct && !projectSlug) try {
|
|
2981
2986
|
await new PaiClient(loadConfig().socketPath).triggerIndex();
|
|
2982
2987
|
console.log(ok$1("Index triggered in daemon.") + dim$1(" Check daemon logs for progress."));
|
|
@@ -3069,7 +3074,7 @@ function registerSearchCommand(memoryCmd) {
|
|
|
3069
3074
|
let results;
|
|
3070
3075
|
if (mode === "keyword") results = await backend.searchKeyword(query, searchOpts);
|
|
3071
3076
|
else {
|
|
3072
|
-
const { generateEmbedding } = await import("./embeddings-
|
|
3077
|
+
const { generateEmbedding } = await import("./embeddings-D0WOQpYR.mjs");
|
|
3073
3078
|
console.log(dim$1("Generating query embedding..."));
|
|
3074
3079
|
const queryEmbedding = await generateEmbedding(query, true);
|
|
3075
3080
|
if (mode === "semantic") results = await backend.searchSemantic(queryEmbedding, searchOpts);
|
|
@@ -3254,8 +3259,8 @@ function registerStatsCommands(memoryCmd) {
|
|
|
3254
3259
|
//#region src/cli/commands/memory/sources-cmd.ts
|
|
3255
3260
|
function registerSourcesCommand(memoryCmd) {
|
|
3256
3261
|
memoryCmd.command("sources").description("Show what the indexer has taken in: composition by source, which roots\ncontent enters from, the heaviest single files, and how many chunks are\nrewritten per day (which distinguishes a finite backlog from a treadmill).").option("--limit <n>", "Rows per section (default 8)", "8").action(async (opts) => {
|
|
3257
|
-
const { createStorageBackend } = await import("./factory-
|
|
3258
|
-
const { loadConfig } = await import("./config-
|
|
3262
|
+
const { createStorageBackend } = await import("./factory-CrVlo2hY.mjs");
|
|
3263
|
+
const { loadConfig } = await import("./config-CnsDMETf.mjs");
|
|
3259
3264
|
const { cmdMemorySources } = await import("./sources-CM2g-CLT.mjs");
|
|
3260
3265
|
let backend;
|
|
3261
3266
|
try {
|
|
@@ -3274,6 +3279,45 @@ function registerSourcesCommand(memoryCmd) {
|
|
|
3274
3279
|
});
|
|
3275
3280
|
}
|
|
3276
3281
|
|
|
3282
|
+
//#endregion
|
|
3283
|
+
//#region src/cli/commands/memory/pass.ts
|
|
3284
|
+
/** Budget for one embed pass; mirrors the daemon's in-process budget. */
|
|
3285
|
+
const EMBED_MAX_MILLIS = 24e4;
|
|
3286
|
+
async function runPass(name, sleepMs) {
|
|
3287
|
+
if (name === "noop") {
|
|
3288
|
+
await new Promise((r) => setTimeout(r, sleepMs));
|
|
3289
|
+
return { pid: process.pid };
|
|
3290
|
+
}
|
|
3291
|
+
const storage = await getStorageBackend();
|
|
3292
|
+
const registry = await getRegistryBackend();
|
|
3293
|
+
if (name === "index") return await storage.indexAll(registry);
|
|
3294
|
+
const projectNames = /* @__PURE__ */ new Map();
|
|
3295
|
+
try {
|
|
3296
|
+
for (const r of await registry.listProjects({ status: "active" })) projectNames.set(r.id, r.slug);
|
|
3297
|
+
} catch {}
|
|
3298
|
+
return { count: await embedChunksWithBackend(storage, () => false, projectNames, { maxMillis: EMBED_MAX_MILLIS }) };
|
|
3299
|
+
}
|
|
3300
|
+
function registerPassCommand(memoryCmd) {
|
|
3301
|
+
memoryCmd.command("pass <name>", { hidden: true }).option("--sleep <ms>", "noop pass: sleep this long", "0").action(async (name, opts) => {
|
|
3302
|
+
reexecBackground();
|
|
3303
|
+
try {
|
|
3304
|
+
const result = await runPass(name, parseInt(opts.sleep, 10));
|
|
3305
|
+
process.stdout.write(JSON.stringify({
|
|
3306
|
+
ok: true,
|
|
3307
|
+
result
|
|
3308
|
+
}) + "\n");
|
|
3309
|
+
process.exitCode = 0;
|
|
3310
|
+
} catch (e) {
|
|
3311
|
+
process.stdout.write(JSON.stringify({
|
|
3312
|
+
ok: false,
|
|
3313
|
+
error: e instanceof Error ? e.message : String(e)
|
|
3314
|
+
}) + "\n");
|
|
3315
|
+
process.exitCode = 1;
|
|
3316
|
+
}
|
|
3317
|
+
process.exit();
|
|
3318
|
+
});
|
|
3319
|
+
}
|
|
3320
|
+
|
|
3277
3321
|
//#endregion
|
|
3278
3322
|
//#region src/cli/commands/memory/index.ts
|
|
3279
3323
|
function registerMemoryCommands(memoryCmd) {
|
|
@@ -3282,6 +3326,7 @@ function registerMemoryCommands(memoryCmd) {
|
|
|
3282
3326
|
registerSearchCommand(memoryCmd);
|
|
3283
3327
|
registerStatsCommands(memoryCmd);
|
|
3284
3328
|
registerSourcesCommand(memoryCmd);
|
|
3329
|
+
registerPassCommand(memoryCmd);
|
|
3285
3330
|
}
|
|
3286
3331
|
|
|
3287
3332
|
//#endregion
|
|
@@ -3957,7 +4002,7 @@ async function escalate(task, headline, detail, state, now, opts) {
|
|
|
3957
4002
|
let delivered = false;
|
|
3958
4003
|
try {
|
|
3959
4004
|
const { routeNotification } = await import("./router-BK-hFeQ6.mjs");
|
|
3960
|
-
const { loadConfig } = await import("./config-
|
|
4005
|
+
const { loadConfig } = await import("./config-CnsDMETf.mjs");
|
|
3961
4006
|
delivered = (await routeNotification({
|
|
3962
4007
|
event: "error",
|
|
3963
4008
|
title: `PAI: ${headline}`,
|
|
@@ -3992,7 +4037,7 @@ async function escalate(task, headline, detail, state, now, opts) {
|
|
|
3992
4037
|
async function alertParked(task, reason) {
|
|
3993
4038
|
const text = `PAI parked "${task.title}" (${task.id}) — the scheduler will not retry it.\nReason: ${reason}\nTo release it: fix the cause, then move the due date — due_string, natural language only (e.g. "tomorrow 9am").`;
|
|
3994
4039
|
try {
|
|
3995
|
-
const { callAiBroker } = await import("./aibroker-client-
|
|
4040
|
+
const { callAiBroker } = await import("./aibroker-client-Ck3p3k_-.mjs");
|
|
3996
4041
|
await callAiBroker("pailot_send", { text }, 8e3);
|
|
3997
4042
|
} catch (e) {
|
|
3998
4043
|
console.error(`[pai-poller] parked-task alert not delivered to PAILot (${e instanceof Error ? e.message : String(e)}): ${text}`);
|
|
@@ -6778,6 +6823,7 @@ async function cmdStatus$1() {
|
|
|
6778
6823
|
console.log(bold$1(" PAI Daemon Status"));
|
|
6779
6824
|
console.log();
|
|
6780
6825
|
console.log(ok$1(` Daemon running`));
|
|
6826
|
+
console.log(dim$1(` PID: ${resolveDaemonPid() ?? "unknown"}`));
|
|
6781
6827
|
console.log(dim$1(` Uptime: ${s["uptime"]}s`));
|
|
6782
6828
|
console.log(dim$1(` Socket: ${s["socketPath"]}`));
|
|
6783
6829
|
const health = formatStorageHealth(s);
|
|
@@ -6811,12 +6857,13 @@ async function cmdStatus$1() {
|
|
|
6811
6857
|
function cmdRestart() {
|
|
6812
6858
|
if (!serviceManagerAllowed("pai daemon restart")) return;
|
|
6813
6859
|
if (process.platform === "linux") {
|
|
6860
|
+
const before = resolveDaemonPid();
|
|
6814
6861
|
const result = spawnSync("systemctl", [
|
|
6815
6862
|
"--user",
|
|
6816
6863
|
"restart",
|
|
6817
6864
|
SYSTEMD_UNIT_NAME
|
|
6818
6865
|
], { encoding: "utf8" });
|
|
6819
|
-
if (result.status === 0) console.log(ok$1(
|
|
6866
|
+
if (result.status === 0) console.log(ok$1(`Restarted daemon pid ${before ?? "?"} -> ${resolveDaemonPid() ?? "?"}`));
|
|
6820
6867
|
else {
|
|
6821
6868
|
console.error(err(`systemctl restart failed: ${(result.stderr || "").trim()}`));
|
|
6822
6869
|
process.exitCode = 1;
|
|
@@ -6829,25 +6876,16 @@ function cmdRestart() {
|
|
|
6829
6876
|
return;
|
|
6830
6877
|
}
|
|
6831
6878
|
try {
|
|
6832
|
-
const
|
|
6833
|
-
if (
|
|
6834
|
-
|
|
6835
|
-
|
|
6836
|
-
|
|
6837
|
-
|
|
6838
|
-
|
|
6839
|
-
], { encoding: "utf8" }).status === 0) console.log(ok$1("Sent kickstart to launchd."));
|
|
6840
|
-
else console.log(dim$1("Not managed by launchd either. Run: pai daemon serve"));
|
|
6879
|
+
const before = resolveDaemonPid();
|
|
6880
|
+
if (spawnSync("launchctl", [
|
|
6881
|
+
"kickstart",
|
|
6882
|
+
"-k",
|
|
6883
|
+
`gui/${process.getuid?.() ?? 501}/${PLIST_LABEL}`
|
|
6884
|
+
], { encoding: "utf8" }).status !== 0) {
|
|
6885
|
+
console.log(dim$1("Not managed by launchd. Run: pai daemon serve"));
|
|
6841
6886
|
return;
|
|
6842
6887
|
}
|
|
6843
|
-
|
|
6844
|
-
for (const pid of pids) try {
|
|
6845
|
-
process.kill(parseInt(pid, 10), "SIGTERM");
|
|
6846
|
-
console.log(ok$1(`Sent SIGTERM to pid ${pid}.`));
|
|
6847
|
-
} catch {
|
|
6848
|
-
console.log(warn$1(`Could not signal pid ${pid}.`));
|
|
6849
|
-
}
|
|
6850
|
-
console.log(dim$1("launchd will restart the daemon automatically."));
|
|
6888
|
+
console.log(ok$1(`Restarted daemon pid ${before ?? "?"} -> ${resolveDaemonPid() ?? "?"}`));
|
|
6851
6889
|
} catch (e) {
|
|
6852
6890
|
const msg = e instanceof Error ? e.message : String(e);
|
|
6853
6891
|
console.error(err(`restart error: ${msg}`));
|
|
@@ -7094,8 +7132,8 @@ function cmdLogs(opts) {
|
|
|
7094
7132
|
}
|
|
7095
7133
|
function registerDaemonCommands(daemonCmd) {
|
|
7096
7134
|
daemonCmd.command("serve").description("Start the PAI daemon in the foreground").action(async () => {
|
|
7097
|
-
const { serve } = await import("./daemon-
|
|
7098
|
-
const { loadConfig: lc, ensureConfigDir } = await import("./config-
|
|
7135
|
+
const { serve } = await import("./daemon-ZhHU6D0i.mjs");
|
|
7136
|
+
const { loadConfig: lc, ensureConfigDir } = await import("./config-CnsDMETf.mjs");
|
|
7099
7137
|
ensureConfigDir();
|
|
7100
7138
|
await serve(lc());
|
|
7101
7139
|
});
|
|
@@ -9721,7 +9759,7 @@ async function cmdExplore(note, opts) {
|
|
|
9721
9759
|
const depth = parseInt(opts.depth ?? "3", 10);
|
|
9722
9760
|
const direction = opts.direction ?? "both";
|
|
9723
9761
|
const mode = opts.mode ?? "all";
|
|
9724
|
-
const { zettelExplore } = await import("./zettelkasten-
|
|
9762
|
+
const { zettelExplore } = await import("./zettelkasten-G0-ZTybr.mjs");
|
|
9725
9763
|
const result = await zettelExplore(await getFedBackend(), {
|
|
9726
9764
|
startNote: note,
|
|
9727
9765
|
depth,
|
|
@@ -9786,7 +9824,7 @@ async function cmdHealth(opts) {
|
|
|
9786
9824
|
const projectPath = opts.project;
|
|
9787
9825
|
const recentDays = parseInt(opts.days ?? "30", 10);
|
|
9788
9826
|
const includeTypes = opts.include ? opts.include.split(",").map((s) => s.trim()) : void 0;
|
|
9789
|
-
const { zettelHealth } = await import("./zettelkasten-
|
|
9827
|
+
const { zettelHealth } = await import("./zettelkasten-G0-ZTybr.mjs");
|
|
9790
9828
|
const result = await zettelHealth(await getFedBackend(), {
|
|
9791
9829
|
scope,
|
|
9792
9830
|
projectPath,
|
|
@@ -9857,7 +9895,7 @@ async function cmdSurprise(note, opts) {
|
|
|
9857
9895
|
const limit = parseInt(opts.limit ?? "10", 10);
|
|
9858
9896
|
const minSimilarity = parseFloat(opts.minSimilarity ?? "0.3");
|
|
9859
9897
|
const minGraphDistance = parseInt(opts.minDistance ?? "3", 10);
|
|
9860
|
-
const { zettelSurprise } = await import("./zettelkasten-
|
|
9898
|
+
const { zettelSurprise } = await import("./zettelkasten-G0-ZTybr.mjs");
|
|
9861
9899
|
const backend = await getFedBackend();
|
|
9862
9900
|
console.log();
|
|
9863
9901
|
console.log(header(" PAI Zettel Surprise"));
|
|
@@ -9912,7 +9950,7 @@ async function cmdSuggest(note, opts) {
|
|
|
9912
9950
|
const vaultProjectId = parseInt(opts.vaultProjectId, 10);
|
|
9913
9951
|
const limit = parseInt(opts.limit ?? "5", 10);
|
|
9914
9952
|
const excludeLinked = opts.excludeLinked !== false;
|
|
9915
|
-
const { zettelSuggest } = await import("./zettelkasten-
|
|
9953
|
+
const { zettelSuggest } = await import("./zettelkasten-G0-ZTybr.mjs");
|
|
9916
9954
|
const backend = await getFedBackend();
|
|
9917
9955
|
console.log();
|
|
9918
9956
|
console.log(header(" PAI Zettel Suggest"));
|
|
@@ -9965,7 +10003,7 @@ async function cmdConverse(question, opts) {
|
|
|
9965
10003
|
const vaultProjectId = parseInt(opts.vaultProjectId, 10);
|
|
9966
10004
|
const depth = parseInt(opts.depth ?? "2", 10);
|
|
9967
10005
|
const limit = parseInt(opts.limit ?? "15", 10);
|
|
9968
|
-
const { zettelConverse } = await import("./zettelkasten-
|
|
10006
|
+
const { zettelConverse } = await import("./zettelkasten-G0-ZTybr.mjs");
|
|
9969
10007
|
const backend = await getFedBackend();
|
|
9970
10008
|
console.log();
|
|
9971
10009
|
console.log(header(" PAI Zettel Converse"));
|
|
@@ -10028,7 +10066,7 @@ async function cmdThemes(opts) {
|
|
|
10028
10066
|
const minClusterSize = parseInt(opts.minSize ?? "3", 10);
|
|
10029
10067
|
const maxThemes = parseInt(opts.maxThemes ?? "10", 10);
|
|
10030
10068
|
const similarityThreshold = parseFloat(opts.threshold ?? "0.65");
|
|
10031
|
-
const { zettelThemes } = await import("./zettelkasten-
|
|
10069
|
+
const { zettelThemes } = await import("./zettelkasten-G0-ZTybr.mjs");
|
|
10032
10070
|
const backend = await getFedBackend();
|
|
10033
10071
|
console.log();
|
|
10034
10072
|
console.log(header(" PAI Zettel Themes"));
|
|
@@ -13990,16 +14028,13 @@ function stepBuild(repoDir) {
|
|
|
13990
14028
|
*/
|
|
13991
14029
|
function stepRestartDaemon(repoDir) {
|
|
13992
14030
|
step("Restarting PAI daemon...");
|
|
13993
|
-
const
|
|
13994
|
-
if (
|
|
13995
|
-
|
|
13996
|
-
|
|
13997
|
-
|
|
13998
|
-
success(`Sent SIGHUP to daemon (PID ${pid}).`);
|
|
13999
|
-
return;
|
|
14000
|
-
}
|
|
14031
|
+
const pid = resolveDaemonPid();
|
|
14032
|
+
if (pid) {
|
|
14033
|
+
if (capture(`kill -HUP ${pid}`) !== null) {
|
|
14034
|
+
success(`Sent SIGHUP to daemon (PID ${pid}).`);
|
|
14035
|
+
return;
|
|
14001
14036
|
}
|
|
14002
|
-
}
|
|
14037
|
+
}
|
|
14003
14038
|
if (spawnSync("pai", ["daemon", "restart"], {
|
|
14004
14039
|
cwd: repoDir,
|
|
14005
14040
|
stdio: "pipe",
|
|
@@ -16103,7 +16138,7 @@ async function migrateToPostgres(opts = {}) {
|
|
|
16103
16138
|
const dump = pgDump(container, pgConfig, dumpPath);
|
|
16104
16139
|
if (!dump.ok) return refused(dump.reason, dryRun);
|
|
16105
16140
|
}
|
|
16106
|
-
const { PostgresBackend } = await import("./postgres-
|
|
16141
|
+
const { PostgresBackend } = await import("./postgres-DKyiCA5V.mjs");
|
|
16107
16142
|
await PostgresBackend.ensureDatabase(pgConfig);
|
|
16108
16143
|
const sqlite = new BetterSqlite3(sqliteFederationPath, { readonly: true });
|
|
16109
16144
|
const registrySqlite = sqliteRegistryPath === sqliteFederationPath ? sqlite : new BetterSqlite3(sqliteRegistryPath, { readonly: true });
|
|
@@ -16674,7 +16709,7 @@ async function getSessionTags(registryBackend, sessionId) {
|
|
|
16674
16709
|
* Session CRUD commands: list, info, rename, slug, tag, route, active, auto-route.
|
|
16675
16710
|
*/
|
|
16676
16711
|
async function cmdList(projectSlug, opts) {
|
|
16677
|
-
const { getRegistryBackend } = await import("./factory-
|
|
16712
|
+
const { getRegistryBackend } = await import("./factory-CrVlo2hY.mjs");
|
|
16678
16713
|
const registryBackend = await getRegistryBackend();
|
|
16679
16714
|
const limit = parseInt(opts.limit ?? "20", 10);
|
|
16680
16715
|
let project;
|
|
@@ -16739,7 +16774,7 @@ async function cmdList(projectSlug, opts) {
|
|
|
16739
16774
|
console.log(dim$1(` ${rows.length} session(s) shown (limit: ${limit})`));
|
|
16740
16775
|
}
|
|
16741
16776
|
async function cmdInfo(projectSlug, sessionNumber) {
|
|
16742
|
-
const { getRegistryBackend } = await import("./factory-
|
|
16777
|
+
const { getRegistryBackend } = await import("./factory-CrVlo2hY.mjs");
|
|
16743
16778
|
const registryBackend = await getRegistryBackend();
|
|
16744
16779
|
const project = await getProject$1(registryBackend, projectSlug);
|
|
16745
16780
|
if (!project) {
|
|
@@ -16763,7 +16798,7 @@ async function cmdInfo(projectSlug, sessionNumber) {
|
|
|
16763
16798
|
console.log();
|
|
16764
16799
|
}
|
|
16765
16800
|
async function cmdRename(projectSlug, numberOrLatest, newSlug) {
|
|
16766
|
-
const { getRegistryBackend } = await import("./factory-
|
|
16801
|
+
const { getRegistryBackend } = await import("./factory-CrVlo2hY.mjs");
|
|
16767
16802
|
await cmdRenameWith(await getRegistryBackend(), projectSlug, numberOrLatest, newSlug);
|
|
16768
16803
|
}
|
|
16769
16804
|
async function cmdRenameWith(registryBackend, projectSlug, numberOrLatest, newSlug) {
|
|
@@ -16826,7 +16861,7 @@ async function cmdRenameWith(registryBackend, projectSlug, numberOrLatest, newSl
|
|
|
16826
16861
|
console.log();
|
|
16827
16862
|
}
|
|
16828
16863
|
async function cmdSlug(projectSlug, numberOrLatest, opts) {
|
|
16829
|
-
const { getRegistryBackend } = await import("./factory-
|
|
16864
|
+
const { getRegistryBackend } = await import("./factory-CrVlo2hY.mjs");
|
|
16830
16865
|
const registryBackend = await getRegistryBackend();
|
|
16831
16866
|
const project = await getProject$1(registryBackend, projectSlug);
|
|
16832
16867
|
if (!project) {
|
|
@@ -16856,7 +16891,7 @@ async function cmdSlug(projectSlug, numberOrLatest, opts) {
|
|
|
16856
16891
|
}
|
|
16857
16892
|
}
|
|
16858
16893
|
async function cmdTag(projectSlug, sessionNumber, rawTags) {
|
|
16859
|
-
const { getRegistryBackend } = await import("./factory-
|
|
16894
|
+
const { getRegistryBackend } = await import("./factory-CrVlo2hY.mjs");
|
|
16860
16895
|
const registryBackend = await getRegistryBackend();
|
|
16861
16896
|
const project = await getProject$1(registryBackend, projectSlug);
|
|
16862
16897
|
if (!project) {
|
|
@@ -16896,7 +16931,7 @@ async function cmdTag(projectSlug, sessionNumber, rawTags) {
|
|
|
16896
16931
|
console.log();
|
|
16897
16932
|
}
|
|
16898
16933
|
async function cmdRoute(projectSlug, sessionNumber, targetProjectSlug, opts) {
|
|
16899
|
-
const { getRegistryBackend } = await import("./factory-
|
|
16934
|
+
const { getRegistryBackend } = await import("./factory-CrVlo2hY.mjs");
|
|
16900
16935
|
const registryBackend = await getRegistryBackend();
|
|
16901
16936
|
const project = await getProject$1(registryBackend, projectSlug);
|
|
16902
16937
|
if (!project) {
|
|
@@ -16938,7 +16973,7 @@ async function cmdRoute(projectSlug, sessionNumber, targetProjectSlug, opts) {
|
|
|
16938
16973
|
console.log();
|
|
16939
16974
|
}
|
|
16940
16975
|
async function cmdActive(opts) {
|
|
16941
|
-
const { getRegistryBackend } = await import("./factory-
|
|
16976
|
+
const { getRegistryBackend } = await import("./factory-CrVlo2hY.mjs");
|
|
16942
16977
|
const registryBackend = await getRegistryBackend();
|
|
16943
16978
|
const minutes = parseInt(opts.minutes ?? "60", 10);
|
|
16944
16979
|
const cutoff = Date.now() - minutes * 60 * 1e3;
|
|
@@ -17026,8 +17061,8 @@ async function cmdActive(opts) {
|
|
|
17026
17061
|
}
|
|
17027
17062
|
async function cmdAutoRoute(opts) {
|
|
17028
17063
|
const { autoRoute, formatAutoRouteJson } = await import("./auto-route-D6fW1Q8z.mjs");
|
|
17029
|
-
const { getRegistryBackend, createStorageBackend } = await import("./factory-
|
|
17030
|
-
const { loadConfig } = await import("./config-
|
|
17064
|
+
const { getRegistryBackend, createStorageBackend } = await import("./factory-CrVlo2hY.mjs");
|
|
17065
|
+
const { loadConfig } = await import("./config-CnsDMETf.mjs");
|
|
17031
17066
|
const config = loadConfig();
|
|
17032
17067
|
const registryBackend = await getRegistryBackend();
|
|
17033
17068
|
const federation = await createStorageBackend(config);
|
|
@@ -17263,7 +17298,7 @@ async function cmdPause(opts) {
|
|
|
17263
17298
|
process.exitCode = 1;
|
|
17264
17299
|
return;
|
|
17265
17300
|
}
|
|
17266
|
-
const { getRegistryBackend } = await import("./factory-
|
|
17301
|
+
const { getRegistryBackend } = await import("./factory-CrVlo2hY.mjs");
|
|
17267
17302
|
const registryBackend = await getRegistryBackend();
|
|
17268
17303
|
const cwd = process.cwd();
|
|
17269
17304
|
const project = await resolveProjectByCwd(registryBackend, cwd);
|
|
@@ -17658,7 +17693,7 @@ function buildStopBody(project, sessionId) {
|
|
|
17658
17693
|
}
|
|
17659
17694
|
}
|
|
17660
17695
|
async function cmdHandover(projectSlug, numberOrLatest, sessionId) {
|
|
17661
|
-
const { getRegistryBackend } = await import("./factory-
|
|
17696
|
+
const { getRegistryBackend } = await import("./factory-CrVlo2hY.mjs");
|
|
17662
17697
|
const registryBackend = await getRegistryBackend();
|
|
17663
17698
|
let project;
|
|
17664
17699
|
if (projectSlug) {
|
|
@@ -17954,7 +17989,7 @@ function touchSentinel(rootPath) {
|
|
|
17954
17989
|
async function cmdAutosave(opts) {
|
|
17955
17990
|
const minGap = parseInt(opts.minGap ?? String(DEFAULT_MIN_GAP), 10);
|
|
17956
17991
|
const cwd = process.cwd();
|
|
17957
|
-
const { getRegistryBackend } = await import("./factory-
|
|
17992
|
+
const { getRegistryBackend } = await import("./factory-CrVlo2hY.mjs");
|
|
17958
17993
|
const registryBackend = await getRegistryBackend();
|
|
17959
17994
|
const project = await resolveProjectByCwd(registryBackend, cwd);
|
|
17960
17995
|
if (!project) return;
|
|
@@ -20401,8 +20436,8 @@ async function analyzeProject(registryBackend, project) {
|
|
|
20401
20436
|
async function countVectorDbPaths(oldPaths) {
|
|
20402
20437
|
if (oldPaths.length === 0) return 0;
|
|
20403
20438
|
try {
|
|
20404
|
-
const { loadConfig } = await import("./config-
|
|
20405
|
-
const { createStorageBackend } = await import("./factory-
|
|
20439
|
+
const { loadConfig } = await import("./config-CnsDMETf.mjs");
|
|
20440
|
+
const { createStorageBackend } = await import("./factory-CrVlo2hY.mjs");
|
|
20406
20441
|
const config = loadConfig();
|
|
20407
20442
|
if (config.storageBackend !== "postgres") return 0;
|
|
20408
20443
|
const backend = await createStorageBackend(config);
|
|
@@ -20419,8 +20454,8 @@ async function countVectorDbPaths(oldPaths) {
|
|
|
20419
20454
|
async function updateVectorDbPaths(moves) {
|
|
20420
20455
|
if (moves.length === 0) return 0;
|
|
20421
20456
|
try {
|
|
20422
|
-
const { loadConfig } = await import("./config-
|
|
20423
|
-
const { createStorageBackend } = await import("./factory-
|
|
20457
|
+
const { loadConfig } = await import("./config-CnsDMETf.mjs");
|
|
20458
|
+
const { createStorageBackend } = await import("./factory-CrVlo2hY.mjs");
|
|
20424
20459
|
const config = loadConfig();
|
|
20425
20460
|
if (config.storageBackend !== "postgres") return 0;
|
|
20426
20461
|
const backend = await createStorageBackend(config);
|
|
@@ -20507,7 +20542,7 @@ async function displayDryRun(plans) {
|
|
|
20507
20542
|
console.log();
|
|
20508
20543
|
}
|
|
20509
20544
|
async function executeCleanup(plans, skipReindex) {
|
|
20510
|
-
const { getRegistryBackend } = await import("./factory-
|
|
20545
|
+
const { getRegistryBackend } = await import("./factory-CrVlo2hY.mjs");
|
|
20511
20546
|
const registryBackend = await getRegistryBackend();
|
|
20512
20547
|
let deleted = 0;
|
|
20513
20548
|
let renamed = 0;
|
|
@@ -20704,7 +20739,7 @@ async function executeCleanup(plans, skipReindex) {
|
|
|
20704
20739
|
//#region src/cli/commands/session-cleanup/index.ts
|
|
20705
20740
|
function registerSessionCleanupCommand(sessionCmd) {
|
|
20706
20741
|
sessionCmd.command("cleanup [project-slug]").description("Clean up session notes: delete empties, auto-name unnamed, move into YYYY/MM/ hierarchy, renumber").option("--execute", "Actually perform the cleanup (default is dry-run)").option("--no-renumber", "Skip renumbering sessions after deletions").option("--no-reindex", "Skip triggering memory re-index after moves").action(async (projectSlug, opts) => {
|
|
20707
|
-
const { getRegistryBackend } = await import("./factory-
|
|
20742
|
+
const { getRegistryBackend } = await import("./factory-CrVlo2hY.mjs");
|
|
20708
20743
|
const registryBackend = await getRegistryBackend();
|
|
20709
20744
|
const dryRun = !opts.execute;
|
|
20710
20745
|
const skipReindex = opts.reindex === false;
|
|
@@ -20774,7 +20809,7 @@ function finalizeNote(notePath) {
|
|
|
20774
20809
|
}
|
|
20775
20810
|
async function cmdEnd(opts) {
|
|
20776
20811
|
await cmdPause(opts);
|
|
20777
|
-
const { getRegistryBackend } = await import("./factory-
|
|
20812
|
+
const { getRegistryBackend } = await import("./factory-CrVlo2hY.mjs");
|
|
20778
20813
|
const registryBackend = await getRegistryBackend();
|
|
20779
20814
|
const cwd = process.cwd();
|
|
20780
20815
|
const project = await registryBackend.findProjectByCwdPrefix(cwd);
|
|
@@ -21222,7 +21257,7 @@ async function cmdFind(query, opts) {
|
|
|
21222
21257
|
*/
|
|
21223
21258
|
async function getProjects(includeArchived) {
|
|
21224
21259
|
try {
|
|
21225
|
-
const { getRegistryBackend } = await import("./factory-
|
|
21260
|
+
const { getRegistryBackend } = await import("./factory-CrVlo2hY.mjs");
|
|
21226
21261
|
const rows = await (await getRegistryBackend()).listProjectsWithSessionStats();
|
|
21227
21262
|
return includeArchived ? rows : rows.filter((p) => p.status === "active");
|
|
21228
21263
|
} catch {
|
|
@@ -21696,7 +21731,7 @@ async function cmdPick(opts = {}) {
|
|
|
21696
21731
|
const onRemove = async (rec) => {
|
|
21697
21732
|
if (!rec.slug) return false;
|
|
21698
21733
|
try {
|
|
21699
|
-
const { getRegistryBackend } = await import("./factory-
|
|
21734
|
+
const { getRegistryBackend } = await import("./factory-CrVlo2hY.mjs");
|
|
21700
21735
|
const registryBackend = await getRegistryBackend();
|
|
21701
21736
|
const project = await registryBackend.getProjectBySlug(rec.slug);
|
|
21702
21737
|
if (!project || project.status !== "active") return false;
|
|
@@ -21981,4 +22016,4 @@ claude() {
|
|
|
21981
22016
|
|
|
21982
22017
|
//#endregion
|
|
21983
22018
|
export { drainStdio as n, buildProgram as t };
|
|
21984
|
-
//# sourceMappingURL=program-
|
|
22019
|
+
//# sourceMappingURL=program-D3MSfx86.mjs.map
|