@tekmidian/pai 0.42.0 → 0.42.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/README.md +1 -1
- package/dist/chain-B-DbR82m.mjs +164 -0
- package/dist/chain-B-DbR82m.mjs.map +1 -0
- package/dist/cli/index.mjs +8 -8
- package/dist/cli/program.mjs +8 -8
- package/dist/{config-DgzR5sfb.mjs → config-_lQI_W08.mjs} +116 -3
- package/dist/config-_lQI_W08.mjs.map +1 -0
- package/dist/{context-handover-cache-dUnSZwaA.mjs → context-handover-cache-pNFdBNrU.mjs} +27 -8
- package/dist/context-handover-cache-pNFdBNrU.mjs.map +1 -0
- package/dist/daemon/index.mjs +7 -7
- package/dist/{daemon-CKBkhOsZ.mjs → daemon-Awt_3UJp.mjs} +7 -7
- package/dist/{daemon-DsvP8KMy.mjs → daemon-Dq8A1uDF.mjs} +591 -370
- package/dist/daemon-Dq8A1uDF.mjs.map +1 -0
- package/dist/daemon-mcp/index.mjs +5 -5
- package/dist/{fallback-5UJO-RyX.mjs → fallback-vQPI1qxt.mjs} +15 -13
- package/dist/fallback-vQPI1qxt.mjs.map +1 -0
- package/dist/hooks/mcp-deferred-gate.mjs +286 -0
- package/dist/hooks/mcp-deferred-gate.mjs.map +7 -0
- package/dist/hooks/mcp-deferred-reminder.mjs +54 -0
- package/dist/hooks/mcp-deferred-reminder.mjs.map +7 -0
- package/dist/hooks/route-agents-to-worker.mjs +65 -2
- package/dist/hooks/route-agents-to-worker.mjs.map +2 -2
- package/dist/hooks/worker-proxy.mjs +64 -1
- package/dist/hooks/worker-proxy.mjs.map +2 -2
- package/dist/hooks/worker-status-line.mjs +68 -2
- package/dist/hooks/worker-status-line.mjs.map +2 -2
- package/dist/hooks/worker-supervision.mjs +64 -1
- package/dist/hooks/worker-supervision.mjs.map +2 -2
- package/dist/{main-resolver-DXGuygFG.mjs → main-resolver-BAfOMppW.mjs} +2 -2
- package/dist/{main-resolver-BgIrC-D9.mjs → main-resolver-DnkxPYkr.mjs} +111 -16
- package/dist/main-resolver-DnkxPYkr.mjs.map +1 -0
- package/dist/{planner-BLDJt3ZS.mjs → planner-BfEGcEs1.mjs} +5 -5
- package/dist/{planner-BLDJt3ZS.mjs.map → planner-BfEGcEs1.mjs.map} +1 -1
- package/dist/{program-CruRnLtc.mjs → program-BDmeZP-v.mjs} +17 -11
- package/dist/{program-CruRnLtc.mjs.map → program-BDmeZP-v.mjs.map} +1 -1
- package/dist/{chain-DGXNoTwc.mjs → run-CGXbhf2k.mjs} +422 -195
- package/dist/run-CGXbhf2k.mjs.map +1 -0
- package/dist/{server-Cp7tNzNC.mjs → server-D4vAieF4.mjs} +49 -8
- package/dist/server-D4vAieF4.mjs.map +1 -0
- package/dist/{state-BTa10SOM.mjs → state-BRdB-Bf1.mjs} +7 -2
- package/dist/state-BRdB-Bf1.mjs.map +1 -0
- package/dist/state-CY6I-Hnc.mjs +3 -0
- package/dist/{work-queue-worker-D1p2V-ae.mjs → work-queue-worker-AEmfVE0F.mjs} +5 -5
- package/dist/{work-queue-worker-7Vkli4Yh.mjs → work-queue-worker-DIT-VLSh.mjs} +3 -3
- package/dist/{work-queue-worker-7Vkli4Yh.mjs.map → work-queue-worker-DIT-VLSh.mjs.map} +1 -1
- package/docs/cache-keepalive.md +82 -0
- package/docs/commands/worker.md +1 -0
- package/docs/merge-demo.md +1 -0
- package/docs/provider-abstraction.md +52 -2
- package/package.json +1 -1
- package/plugins/core/hooks/hooks.json +12 -0
- package/src/hooks/ts/lib/mcp-deferred-gate.test.ts +258 -0
- package/src/hooks/ts/lib/mcp-deferred-gate.ts +261 -0
- package/src/hooks/ts/lib/mcp-deferred-reminder.test.ts +90 -0
- package/src/hooks/ts/lib/mcp-deferred-reminder.ts +66 -0
- package/src/hooks/ts/pre-tool-use/mcp-deferred-gate.ts +126 -0
- package/src/hooks/ts/pre-tool-use/route-agents-to-worker.ts +6 -2
- package/src/hooks/ts/session-start/mcp-deferred-reminder.ts +52 -0
- package/statusline-command.sh +149 -72
- package/dist/chain-DGXNoTwc.mjs.map +0 -1
- package/dist/config-DgzR5sfb.mjs.map +0 -1
- package/dist/context-handover-cache-dUnSZwaA.mjs.map +0 -1
- package/dist/daemon-DsvP8KMy.mjs.map +0 -1
- package/dist/fallback-5UJO-RyX.mjs.map +0 -1
- package/dist/main-resolver-BgIrC-D9.mjs.map +0 -1
- package/dist/scope-NIwCGxRI.mjs +0 -351
- package/dist/scope-NIwCGxRI.mjs.map +0 -1
- package/dist/server-Cp7tNzNC.mjs.map +0 -1
- package/dist/state-BTa10SOM.mjs.map +0 -1
- package/dist/state-RXepvbnO.mjs +0 -3
|
@@ -7,19 +7,19 @@ import { i as indexProject, n as indexAll, t as embedChunks } from "./sync-BWbe8
|
|
|
7
7
|
import { t as STOP_WORDS } from "./stop-words-Hfu8u22w.mjs";
|
|
8
8
|
import { a as searchMemory, i as populateSlugs } from "./search-Rpk1cSBC.mjs";
|
|
9
9
|
import { n as formatDetection, r as formatDetectionJson, t as detectProject } from "./detect-CdaA48EI.mjs";
|
|
10
|
-
import { _ as claudeProjectsDir, a as findLatestNote, b as transcriptFiles, c as extractAndStoreTriples, d as loadScanConfig, g as upsertSession, h as upsertProject, i as applyContinue, m as saveScanConfig, o as findNotesDir$1, p as resolveHome, r as appendCheckpointToNote, s as readBodyFile, t as readContextHandoverCache, u as cmdScan, v as findMovedProjects, y as scanTranscriptFolders } from "./context-handover-cache-
|
|
10
|
+
import { _ as claudeProjectsDir, a as findLatestNote, b as transcriptFiles, c as extractAndStoreTriples, d as loadScanConfig, g as upsertSession, h as upsertProject, i as applyContinue, m as saveScanConfig, o as findNotesDir$1, p as resolveHome, r as appendCheckpointToNote, s as readBodyFile, t as readContextHandoverCache, u as cmdScan, v as findMovedProjects, y as scanTranscriptFolders } from "./context-handover-cache-pNFdBNrU.mjs";
|
|
11
11
|
import { a as schedulerLogPath, i as paiSocketPath, n as daemonLogPath, r as daemonPidPath } from "./runtime-paths-rni52zHX.mjs";
|
|
12
12
|
import { t as PaiClient } from "./ipc-client-BmypMNYk.mjs";
|
|
13
13
|
import { a as expandHome, c as UNROUTED, i as ensureConfigDir, n as CONFIG_FILE$2, o as loadConfig, s as OWNER_LABEL_PREFIX, t as CONFIG_DIR } from "./config-B64vFg14.mjs";
|
|
14
14
|
import { r as humanDuration, t as createStorageBackend } from "./factory-DEb9NmHJ.mjs";
|
|
15
|
-
import {
|
|
15
|
+
import { C as readJsonStrict, S as stripModelVariant, _ as readWorkersSection, b as DEFAULT_CONTEXT_WINDOW, f as isModelCapability, i as PROVIDER_TAGS, o as WorkersConfigError, w as writeJsonAtomic, x as contextWindowFromModelId } from "./config-_lQI_W08.mjs";
|
|
16
16
|
import { s as kgQuery } from "./kg-entity-r8duqhi9.mjs";
|
|
17
|
-
import { _ as workersLogDir,
|
|
18
|
-
import { a as renderDedupedSessions, c as probeResume, d as fmtAge, f as resolveSessionByNameOrId, i as normalizeName$2, l as restoreTopLevel, o as hasConversation, p as scanSessions, r as buildDeduped, s as launchInDir, t as cmdMain, u as printExitDir } from "./main-resolver-
|
|
17
|
+
import { _ as workersLogDir, m as ledgerPath, n as ensureProxyRunning, p as eventsPath, r as stopProxy, t as DEFAULT_PROXY_PORT } from "./server-D4vAieF4.mjs";
|
|
18
|
+
import { a as renderDedupedSessions, c as probeResume, d as fmtAge, f as resolveSessionByNameOrId, i as normalizeName$2, l as restoreTopLevel, o as hasConversation, p as scanSessions, r as buildDeduped, s as launchInDir, t as cmdMain, u as printExitDir } from "./main-resolver-DnkxPYkr.mjs";
|
|
19
19
|
import { i as sendToSession, n as fetchLiveSessions, r as revealItermSession, t as callAiBroker } from "./aibroker-client-BP74gGwD.mjs";
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import { S as statusLineOutput, _ as updateProvider, a as addProvider, b as psOutput, c as describeProviders, d as resolveProviderName, f as setClass, g as unsetClass, h as setWorkersEnabled, i as fallbackStatusText, l as modelPrefsText, m as setProviderModel, n as fallbackOn, o as classTargetText, p as setProviderEnabled, r as fallbackStatus, s as describeModels, t as fallbackOff, u as removeProvider, v as useProvider, x as replayOutput, y as followWorkers } from "./fallback-
|
|
20
|
+
import { D as loadStatus, N as parseRunnerArgs, a as parseWorkerReport, c as mergeWorker, d as sayToWorker, h as openPaneForWorker, i as describeMcp, l as handoffFromInside, m as openFollowPane, n as runWorker, p as checkPaneForWorker, r as testProvider, s as discardWorker, x as UNLABELED } from "./run-CGXbhf2k.mjs";
|
|
21
|
+
import { t as runChain } from "./chain-B-DbR82m.mjs";
|
|
22
|
+
import { S as statusLineOutput, _ as updateProvider, a as addProvider, b as psOutput, c as describeProviders, d as resolveProviderName, f as setClass, g as unsetClass, h as setWorkersEnabled, i as fallbackStatusText, l as modelPrefsText, m as setProviderModel, n as fallbackOn, o as classTargetText, p as setProviderEnabled, r as fallbackStatus, s as describeModels, t as fallbackOff, u as removeProvider, v as useProvider, x as replayOutput, y as followWorkers } from "./fallback-vQPI1qxt.mjs";
|
|
23
23
|
import { appendFileSync, chmodSync, copyFileSync, createReadStream, existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, readlinkSync, realpathSync, renameSync, statSync, symlinkSync, unlinkSync, writeFileSync } from "node:fs";
|
|
24
24
|
import { homedir, platform, tmpdir } from "node:os";
|
|
25
25
|
import { basename, dirname, join, relative, resolve, sep } from "node:path";
|
|
@@ -1894,7 +1894,7 @@ function cmdUnregister(db, slug, opts = {}) {
|
|
|
1894
1894
|
//#region src/cli/commands/project/projects-index.ts
|
|
1895
1895
|
function registerProjectsCommands(projectsCmd, getDb) {
|
|
1896
1896
|
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) => {
|
|
1897
|
-
const { cmdMain } = await import("./main-resolver-
|
|
1897
|
+
const { cmdMain } = await import("./main-resolver-BAfOMppW.mjs");
|
|
1898
1898
|
await cmdMain(getDb(), void 0, void 0, opts);
|
|
1899
1899
|
});
|
|
1900
1900
|
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((opts) => {
|
|
@@ -3666,7 +3666,7 @@ function cmdLogs(opts) {
|
|
|
3666
3666
|
}
|
|
3667
3667
|
function registerDaemonCommands(daemonCmd) {
|
|
3668
3668
|
daemonCmd.command("serve").description("Start the PAI daemon in the foreground").action(async () => {
|
|
3669
|
-
const { serve } = await import("./daemon-
|
|
3669
|
+
const { serve } = await import("./daemon-Awt_3UJp.mjs");
|
|
3670
3670
|
const { loadConfig: lc, ensureConfigDir } = await import("./config-C_ErGddD.mjs");
|
|
3671
3671
|
ensureConfigDir();
|
|
3672
3672
|
await serve(lc());
|
|
@@ -14090,9 +14090,13 @@ function fail(e) {
|
|
|
14090
14090
|
process.exitCode = 1;
|
|
14091
14091
|
}
|
|
14092
14092
|
function registerWorkerCommands(workerCmd) {
|
|
14093
|
-
workerCmd.command("run").description("Run one claude-code worker through the configured provider.\nUnknown options are passed to claude verbatim (e.g. -p, --allowedTools);\n--output-format/--verbose are handled here.\nGrant MCP tools by naming mcp__server__tool in --allowedTools (the server loads automatically);\n--chain draft,implement[,review] runs a spec-first pipeline;\n--agent <name> runs an agent definition from ~/.claude/agents.").allowUnknownOption(true).option("--provider <name>", "Provider to run on (default: active, else routing order)").option("--class <name>", "Use the provider of this class (draft, implement, review, research, spotcheck, simple, complex, image)").option("--role <name>", "Alias of --class (roles were renamed to classes)").option("--chain <stages>", "Comma-separated stage classes, e.g. draft,implement or draft,implement,review").option("--agent <name>", "Run the agent definition ~/.claude/agents/<name>.md on a worker").option("--model <model>", "Override the provider's model for this run").option("--label <text>", "Short task label shown in ps / follow / status line").option("--mcp <names>", "MCP servers/sets this worker may use (comma-separated; see `pai worker mcp`)").option("--no-pane", "Do not open a follow pane for this worker").option("--worktree", "Run in a git worktree on branch worker/<id> (default for implement/complex/plan in a git repo)").option("--no-worktree", "Run in place, no worktree").argument("[args...]", "claude arguments, e.g. -p '<task>' --allowedTools 'Read,Edit,Bash'").action(async (args, opts) => {
|
|
14093
|
+
workerCmd.command("run").description("Run one claude-code worker through the configured provider.\nUnknown options are passed to claude verbatim (e.g. -p, --allowedTools);\n--output-format/--verbose are handled here.\nGrant MCP tools by naming mcp__server__tool in --allowedTools (the server loads automatically);\n--chain draft,implement[,review] runs a spec-first pipeline;\n--agent <name> runs an agent definition from ~/.claude/agents.").allowUnknownOption(true).option("--provider <name>", "Provider to run on (default: active, else routing order)").option("--class <name>", "Use the provider of this class (draft, implement, review, research, spotcheck, simple, complex, image)").option("--role <name>", "Alias of --class (roles were renamed to classes)").option("--chain <stages>", "Comma-separated stage classes, e.g. draft,implement or draft,implement,review").option("--agent <name>", "Run the agent definition ~/.claude/agents/<name>.md on a worker").option("--model <model>", "Override the provider's model for this run").option("--label <text>", "Short task label shown in ps / follow / status line").option("--cwd <dir>", "Directory the worker runs in (default: this process's cwd)").option("--mcp <names>", "MCP servers/sets this worker may use (comma-separated; see `pai worker mcp`)").option("--no-pane", "Do not open a follow pane for this worker").option("--worktree", "Run in a git worktree on branch worker/<id> (default for implement/complex/plan in a git repo)").option("--no-worktree", "Run in place, no worktree").argument("[args...]", "claude arguments, e.g. -p '<task>' --allowedTools 'Read,Edit,Bash'").action(async (args, opts) => {
|
|
14094
14094
|
try {
|
|
14095
14095
|
const className = opts.class ?? opts.role;
|
|
14096
|
+
if (opts.cwd !== void 0) {
|
|
14097
|
+
if (!existsSync(opts.cwd)) throw new Error(`--cwd: directory does not exist: ${opts.cwd}`);
|
|
14098
|
+
if (!statSync(opts.cwd).isDirectory()) throw new Error(`--cwd: not a directory: ${opts.cwd}`);
|
|
14099
|
+
}
|
|
14096
14100
|
let claudeArgs = args;
|
|
14097
14101
|
let label = opts.label;
|
|
14098
14102
|
let agentClass;
|
|
@@ -14119,6 +14123,7 @@ function registerWorkerCommands(workerCmd) {
|
|
|
14119
14123
|
label,
|
|
14120
14124
|
noPane: opts.pane === false,
|
|
14121
14125
|
mcpFlag: opts.mcp,
|
|
14126
|
+
cwd: opts.cwd,
|
|
14122
14127
|
brief,
|
|
14123
14128
|
claudeArgs
|
|
14124
14129
|
});
|
|
@@ -14131,6 +14136,7 @@ function registerWorkerCommands(workerCmd) {
|
|
|
14131
14136
|
modelFlag: opts.model,
|
|
14132
14137
|
label,
|
|
14133
14138
|
mcpFlag: opts.mcp,
|
|
14139
|
+
cwd: opts.cwd,
|
|
14134
14140
|
noPane: opts.pane === false,
|
|
14135
14141
|
worktreeFlag: opts.worktree,
|
|
14136
14142
|
claudeArgs
|
|
@@ -16352,4 +16358,4 @@ claude() {
|
|
|
16352
16358
|
|
|
16353
16359
|
//#endregion
|
|
16354
16360
|
export { drainStdio as n, buildProgram as t };
|
|
16355
|
-
//# sourceMappingURL=program-
|
|
16361
|
+
//# sourceMappingURL=program-BDmeZP-v.mjs.map
|