@tekmidian/pai 0.12.0 → 0.12.2
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/cli/index.mjs +2 -2
- package/dist/cli/program.mjs +2 -2
- package/dist/daemon/index.mjs +3 -3
- package/dist/{daemon-DDplhnm9.mjs → daemon-Ca7YXHUW.mjs} +17 -17
- package/dist/{daemon-DDplhnm9.mjs.map → daemon-Ca7YXHUW.mjs.map} +1 -1
- package/dist/factory-Q88X1bAN.mjs +69 -0
- package/dist/factory-Q88X1bAN.mjs.map +1 -0
- package/dist/{pick-Dt21ojcW.mjs → pick-C5sUQ5g_.mjs} +27 -11
- package/dist/pick-C5sUQ5g_.mjs.map +1 -0
- package/dist/{work-queue-worker-DHOIVVQ7.mjs → work-queue-worker-0tUMEhSS.mjs} +16 -1
- package/dist/{work-queue-worker-DHOIVVQ7.mjs.map → work-queue-worker-0tUMEhSS.mjs.map} +1 -1
- package/docs/commands/project.md +1 -0
- package/docs/commands/projects.md +1 -0
- package/package.json +1 -1
- package/dist/factory-CayQCMoN.mjs +0 -41
- package/dist/factory-CayQCMoN.mjs.map +0 -1
- package/dist/pick-Dt21ojcW.mjs.map +0 -1
package/dist/cli/index.mjs
CHANGED
|
@@ -6,9 +6,9 @@ import "../db-CmYbAVCD.mjs";
|
|
|
6
6
|
import "../helpers-IjZkXBhj.mjs";
|
|
7
7
|
import "../embeddings-BJPOcbik.mjs";
|
|
8
8
|
import "../search-HcdKtMla.mjs";
|
|
9
|
-
import "../pick-
|
|
9
|
+
import "../pick-C5sUQ5g_.mjs";
|
|
10
10
|
import "../kg-extraction-C8DEUHTS.mjs";
|
|
11
|
-
import "../factory-
|
|
11
|
+
import "../factory-Q88X1bAN.mjs";
|
|
12
12
|
import "../config-BuhHWyOK.mjs";
|
|
13
13
|
import "../main-resolver-uFxNiDy7.mjs";
|
|
14
14
|
import { buildProgram } from "./program.mjs";
|
package/dist/cli/program.mjs
CHANGED
|
@@ -5,9 +5,9 @@ import "../db-CmYbAVCD.mjs";
|
|
|
5
5
|
import "../helpers-IjZkXBhj.mjs";
|
|
6
6
|
import "../embeddings-BJPOcbik.mjs";
|
|
7
7
|
import "../search-HcdKtMla.mjs";
|
|
8
|
-
import { C as registerMcpCommands, D as findMovedPath, E as registerProjectsCommands, O as resolveIdentifier, S as registerDaemonCommands, T as registerRegistryCommands, _ as registerZettelCommands, a as cmdPauseAll, b as registerRestoreCommands, c as cmdPause, d as registerKgCommands, f as registerTopicCommands, g as registerObservationCommands, h as registerSkillCommands, i as cmdClearNames, l as registerHelpCommand, m as registerUpdateCommand, n as cmdFind, o as cmdGoto, p as registerNotifyCommands, r as cmdList, s as cmdEnd, t as cmdPick, u as registerDbCommands, v as registerObsidianCommands, w as registerMemoryCommands, x as registerBackupCommands, y as registerSetupCommand } from "../pick-
|
|
8
|
+
import { C as registerMcpCommands, D as findMovedPath, E as registerProjectsCommands, O as resolveIdentifier, S as registerDaemonCommands, T as registerRegistryCommands, _ as registerZettelCommands, a as cmdPauseAll, b as registerRestoreCommands, c as cmdPause, d as registerKgCommands, f as registerTopicCommands, g as registerObservationCommands, h as registerSkillCommands, i as cmdClearNames, l as registerHelpCommand, m as registerUpdateCommand, n as cmdFind, o as cmdGoto, p as registerNotifyCommands, r as cmdList, s as cmdEnd, t as cmdPick, u as registerDbCommands, v as registerObsidianCommands, w as registerMemoryCommands, x as registerBackupCommands, y as registerSetupCommand } from "../pick-C5sUQ5g_.mjs";
|
|
9
9
|
import "../kg-extraction-C8DEUHTS.mjs";
|
|
10
|
-
import "../factory-
|
|
10
|
+
import "../factory-Q88X1bAN.mjs";
|
|
11
11
|
import "../config-BuhHWyOK.mjs";
|
|
12
12
|
import { t as cmdMain } from "../main-resolver-uFxNiDy7.mjs";
|
|
13
13
|
import { existsSync, readFileSync } from "node:fs";
|
package/dist/daemon/index.mjs
CHANGED
|
@@ -7,14 +7,14 @@ import "../helpers-IjZkXBhj.mjs";
|
|
|
7
7
|
import "../embeddings-BJPOcbik.mjs";
|
|
8
8
|
import "../search-HcdKtMla.mjs";
|
|
9
9
|
import "../kg-extraction-C8DEUHTS.mjs";
|
|
10
|
-
import "../factory-
|
|
10
|
+
import "../factory-Q88X1bAN.mjs";
|
|
11
11
|
import { t as PaiClient } from "../ipc-client-CoyUHPod.mjs";
|
|
12
12
|
import { i as ensureConfigDir, o as loadConfig } from "../config-BuhHWyOK.mjs";
|
|
13
|
-
import { n as serve } from "../daemon-
|
|
13
|
+
import { n as serve } from "../daemon-Ca7YXHUW.mjs";
|
|
14
14
|
import "../state-BIlxNRUn.mjs";
|
|
15
15
|
import "../tools-Op3C2Nm6.mjs";
|
|
16
16
|
import "../detector-ZiOhHszd.mjs";
|
|
17
|
-
import "../work-queue-worker-
|
|
17
|
+
import "../work-queue-worker-0tUMEhSS.mjs";
|
|
18
18
|
import { Command } from "commander";
|
|
19
19
|
|
|
20
20
|
//#region src/daemon/index.ts
|
|
@@ -3,12 +3,12 @@ import { a as openRegistry, n as indexAll } from "./sync-uPR4g438.mjs";
|
|
|
3
3
|
import { n as openFederation } from "./db-CmYbAVCD.mjs";
|
|
4
4
|
import { d as sha256 } from "./helpers-IjZkXBhj.mjs";
|
|
5
5
|
import { t as configureEmbeddingModel } from "./embeddings-BJPOcbik.mjs";
|
|
6
|
-
import { t as createStorageBackend } from "./factory-
|
|
6
|
+
import { t as createStorageBackend } from "./factory-Q88X1bAN.mjs";
|
|
7
7
|
import { n as CONFIG_FILE, s as DEFAULT_NOTIFICATION_CONFIG, t as CONFIG_DIR } from "./config-BuhHWyOK.mjs";
|
|
8
8
|
import { C as setStorageBackend, E as startTime, O as storageBackend, S as setStartTime, T as shutdownRequested, _ as setLastIndexTime, a as indexSchedulerTimer, b as setRegistryDb, c as lastVaultIndexTime, d as setDaemonConfig, f as setEmbedInProgress, g as setLastEmbedTime, h as setIndexSchedulerTimer, i as indexInProgress, k as vaultIndexInProgress, l as notificationConfig, m as setIndexInProgress, n as embedInProgress, o as lastEmbedTime, p as setEmbedSchedulerTimer, r as embedSchedulerTimer, s as lastIndexTime, t as daemonConfig, u as registryDb, v as setLastVaultIndexTime, w as setVaultIndexInProgress, x as setShutdownRequested, y as setNotificationConfig } from "./state-BIlxNRUn.mjs";
|
|
9
9
|
import { a as toolMemoryWakeup, c as toolSessionRoute, d as toolProjectInfo, f as toolProjectList, h as toolMemorySearch, i as toolMemoryTaxonomy, l as toolProjectDetect, m as toolMemoryGet, n as toolMemoryKgSearch, o as toolRegistrySearch, p as toolProjectTodo, r as toolMemoryFeedback, s as toolSessionList, u as toolProjectHealth } from "./tools-Op3C2Nm6.mjs";
|
|
10
10
|
import { t as detectTopicShift } from "./detector-ZiOhHszd.mjs";
|
|
11
|
-
import { a as enqueue, n as startWorker, o as getStats, r as stopWorker, s as loadQueue, t as notifyNewWork } from "./work-queue-worker-
|
|
11
|
+
import { a as enqueue, n as startWorker, o as getStats, r as stopWorker, s as loadQueue, t as notifyNewWork } from "./work-queue-worker-0tUMEhSS.mjs";
|
|
12
12
|
import { existsSync, mkdirSync, readFileSync, unlinkSync, writeFileSync } from "node:fs";
|
|
13
13
|
import { setPriority } from "node:os";
|
|
14
14
|
import { randomUUID } from "node:crypto";
|
|
@@ -270,12 +270,12 @@ const REGISTRY_SCAN_STARTUP_DELAY_MS = 1e4;
|
|
|
270
270
|
function startRegistryScanScheduler() {
|
|
271
271
|
process.stderr.write("[pai-daemon] Registry scan scheduler: every 30min (first in 10s)\n");
|
|
272
272
|
setTimeout(() => {
|
|
273
|
-
import("./work-queue-worker-
|
|
273
|
+
import("./work-queue-worker-0tUMEhSS.mjs").then((n) => n.i).then(({ enqueueRegistryScan }) => enqueueRegistryScan()).catch((e) => {
|
|
274
274
|
process.stderr.write(`[pai-daemon] Startup registry scan error: ${e}\n`);
|
|
275
275
|
});
|
|
276
276
|
}, REGISTRY_SCAN_STARTUP_DELAY_MS);
|
|
277
277
|
const timer = setInterval(() => {
|
|
278
|
-
import("./work-queue-worker-
|
|
278
|
+
import("./work-queue-worker-0tUMEhSS.mjs").then((n) => n.i).then(({ enqueueRegistryScan }) => enqueueRegistryScan()).catch((e) => {
|
|
279
279
|
process.stderr.write(`[pai-daemon] Scheduled registry scan error: ${e}\n`);
|
|
280
280
|
});
|
|
281
281
|
}, REGISTRY_SCAN_INTERVAL_MS);
|
|
@@ -902,6 +902,7 @@ async function handleRequest(request, socket) {
|
|
|
902
902
|
if (method === "status") {
|
|
903
903
|
const dbStats = await (async () => {
|
|
904
904
|
try {
|
|
905
|
+
if (!storageBackend) return null;
|
|
905
906
|
const fedStats = await storageBackend.getStats();
|
|
906
907
|
const projects = registryDb.prepare("SELECT COUNT(*) AS n FROM projects").get().n;
|
|
907
908
|
return {
|
|
@@ -925,7 +926,7 @@ async function handleRequest(request, socket) {
|
|
|
925
926
|
lastEmbedTime: lastEmbedTime ? new Date(lastEmbedTime).toISOString() : null,
|
|
926
927
|
embedIntervalSecs: daemonConfig.embedIntervalSecs,
|
|
927
928
|
socketPath: daemonConfig.socketPath,
|
|
928
|
-
storageBackend: storageBackend
|
|
929
|
+
storageBackend: storageBackend?.backendType ?? "initializing",
|
|
929
930
|
db: dbStats,
|
|
930
931
|
vaultIndexInProgress,
|
|
931
932
|
lastVaultIndexTime: lastVaultIndexTime ? new Date(lastVaultIndexTime).toISOString() : null,
|
|
@@ -1522,22 +1523,21 @@ async function serve(config) {
|
|
|
1522
1523
|
process.stderr.write(`[pai-daemon] Fatal: Could not open registry: ${msg}\n`);
|
|
1523
1524
|
process.exit(1);
|
|
1524
1525
|
}
|
|
1525
|
-
|
|
1526
|
-
|
|
1526
|
+
const server = await startIpcServer(config.socketPath);
|
|
1527
|
+
startRegistryScanScheduler();
|
|
1528
|
+
createStorageBackend(config, { waitForPostgres: true }).then((backend) => {
|
|
1527
1529
|
setStorageBackend(backend);
|
|
1528
1530
|
process.stderr.write(`[pai-daemon] Federation backend: ${backend.backendType}\n`);
|
|
1529
|
-
|
|
1531
|
+
startIndexScheduler();
|
|
1532
|
+
if (backend.backendType === "postgres") startEmbedScheduler();
|
|
1533
|
+
else process.stderr.write("[pai-daemon] Embed scheduler: disabled (SQLite backend)\n");
|
|
1534
|
+
loadQueue();
|
|
1535
|
+
startWorker();
|
|
1536
|
+
}).catch((e) => {
|
|
1530
1537
|
const msg = e instanceof Error ? e.message : String(e);
|
|
1531
1538
|
process.stderr.write(`[pai-daemon] Fatal: Could not open federation storage: ${msg}\n`);
|
|
1532
1539
|
process.exit(1);
|
|
1533
|
-
}
|
|
1534
|
-
startIndexScheduler();
|
|
1535
|
-
if (storageBackend.backendType === "postgres") startEmbedScheduler();
|
|
1536
|
-
else process.stderr.write("[pai-daemon] Embed scheduler: disabled (SQLite backend)\n");
|
|
1537
|
-
loadQueue();
|
|
1538
|
-
startWorker();
|
|
1539
|
-
startRegistryScanScheduler();
|
|
1540
|
-
const server = await startIpcServer(config.socketPath);
|
|
1540
|
+
});
|
|
1541
1541
|
const shutdown = async (signal) => {
|
|
1542
1542
|
process.stderr.write(`\n[pai-daemon] ${signal} received. Stopping.\n`);
|
|
1543
1543
|
setShutdownRequested(true);
|
|
@@ -1577,4 +1577,4 @@ var daemon_exports = /* @__PURE__ */ __exportAll({ serve: () => serve });
|
|
|
1577
1577
|
|
|
1578
1578
|
//#endregion
|
|
1579
1579
|
export { serve as n, daemon_exports as t };
|
|
1580
|
-
//# sourceMappingURL=daemon-
|
|
1580
|
+
//# sourceMappingURL=daemon-Ca7YXHUW.mjs.map
|