@tekmidian/pai 0.60.1 → 0.61.0
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/{chain-CGyAIHo4.mjs → chain-C5oeyUg4.mjs} +4 -4
- package/dist/{chain-CGyAIHo4.mjs.map → chain-C5oeyUg4.mjs.map} +1 -1
- package/dist/cli/index.mjs +9 -9
- package/dist/cli/program.mjs +9 -9
- package/dist/{context-handover-cache-BzM7Qudn.mjs → context-handover-cache-BdtJZpgv.mjs} +3 -3
- package/dist/{context-handover-cache-BzM7Qudn.mjs.map → context-handover-cache-BdtJZpgv.mjs.map} +1 -1
- package/dist/daemon/index.mjs +7 -7
- package/dist/{daemon-B_TodsIS.mjs → daemon-DSsIEqzW.mjs} +20 -13
- package/dist/{daemon-B_TodsIS.mjs.map → daemon-DSsIEqzW.mjs.map} +1 -1
- package/dist/{daemon-jviL3VVJ.mjs → daemon-MoFF4oeg.mjs} +7 -7
- package/dist/daemon-mcp/index.mjs +7 -9
- package/dist/daemon-mcp/index.mjs.map +1 -1
- package/dist/{fallback-CjdakQVu.mjs → fallback-DDbJVaR8.mjs} +11 -13
- package/dist/{fallback-CjdakQVu.mjs.map → fallback-DDbJVaR8.mjs.map} +1 -1
- package/dist/hooks/block-sleep-poll.mjs.map +2 -2
- package/dist/hooks/context-compression-hook.mjs.map +1 -1
- package/dist/hooks/post-compact-inject.mjs.map +1 -1
- package/dist/hooks/route-agents-to-worker.mjs +3 -3
- package/dist/hooks/route-agents-to-worker.mjs.map +2 -2
- package/dist/hooks/security-validator.mjs +58 -58
- package/dist/hooks/security-validator.mjs.map +3 -3
- package/dist/hooks/stop-hook.mjs +15 -15
- package/dist/hooks/stop-hook.mjs.map +3 -3
- package/dist/hooks/update-tab-on-action.mjs +14 -12
- package/dist/hooks/update-tab-on-action.mjs.map +3 -3
- package/dist/hooks/update-tab-titles.mjs +13 -9
- package/dist/hooks/update-tab-titles.mjs.map +3 -3
- package/dist/hooks/worker-proxy.mjs +3 -3
- package/dist/hooks/worker-proxy.mjs.map +2 -2
- package/dist/hooks/worker-status-line.mjs +3 -3
- package/dist/hooks/worker-status-line.mjs.map +2 -2
- package/dist/hooks/worker-supervision.mjs +3 -3
- package/dist/hooks/worker-supervision.mjs.map +2 -2
- package/dist/{main-resolver-VMBENifT.mjs → main-resolver-CxOsxtOr.mjs} +2 -2
- package/dist/{main-resolver-BFQfU5xo.mjs → main-resolver-DIQ6m_RA.mjs} +2 -2
- package/dist/{main-resolver-BFQfU5xo.mjs.map → main-resolver-DIQ6m_RA.mjs.map} +1 -1
- package/dist/{planner-DN967Lvm.mjs → planner-D8jAr_sx.mjs} +5 -5
- package/dist/{planner-DN967Lvm.mjs.map → planner-D8jAr_sx.mjs.map} +1 -1
- package/dist/{program-BnsjB57Q.mjs → program-BTdspOOa.mjs} +102 -52
- package/dist/program-BTdspOOa.mjs.map +1 -0
- package/dist/{run-FeM1_UVa.mjs → run-CxxZKEZw.mjs} +333 -172
- package/dist/run-CxxZKEZw.mjs.map +1 -0
- package/dist/{run-env-CEHTeIUM.mjs → run-env-BE5xyCwy.mjs} +25 -6
- package/dist/run-env-BE5xyCwy.mjs.map +1 -0
- package/dist/{server-CekGOJcp.mjs → server-BY6AedmC.mjs} +2 -2
- package/dist/{server-CekGOJcp.mjs.map → server-BY6AedmC.mjs.map} +1 -1
- package/dist/{session-keepalive-Bc9aT678.mjs → session-keepalive-urk--pfa.mjs} +4 -4
- package/dist/{session-keepalive-Bc9aT678.mjs.map → session-keepalive-urk--pfa.mjs.map} +1 -1
- package/dist/{work-queue-worker-DVOVcEnO.mjs → work-queue-worker-1_VBfI_k.mjs} +4 -4
- package/dist/{work-queue-worker-BL4dq5P7.mjs → work-queue-worker-DUvPiwGO.mjs} +2 -2
- package/dist/{work-queue-worker-BL4dq5P7.mjs.map → work-queue-worker-DUvPiwGO.mjs.map} +1 -1
- package/docs/commands/worker.md +1 -0
- package/package.json +1 -1
- package/src/hooks/ts/lib/tab-title.ts +18 -0
- package/src/hooks/ts/post-tool-use/update-tab-on-action.ts +3 -20
- package/src/hooks/ts/stop/stop-hook.ts +4 -15
- package/src/hooks/ts/user-prompt/update-tab-titles.ts +2 -10
- package/dist/program-BnsjB57Q.mjs.map +0 -1
- package/dist/run-FeM1_UVa.mjs.map +0 -1
- package/dist/run-env-CEHTeIUM.mjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as writeYamlFileAtomic, d as readMainConfigRaw, f as writeMainConfigRaw, l as paiConfigFilePath, m as migrateMainConfigToYaml, n as CONFIG_FILE, r as DEFAULTS, s as loadConfig, u as paiConfigYamlFilePath, v as readJsonStrict, y as writeJsonAtomic } from "./config-CQCmH_gV.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { A as UNLABELED, C as workerInScope, F as elapsedOf, I as isChatPane, J as shortText, L as isLive, M as alive, N as contextLabel, O as appendLedger, P as contextPercent, S as sessionTag, _ as currentTabKey, b as resolveSession, d as workerDepth, g as markControlsHeld, h as clickrControlsArgv, j as ageOf, l as readInbox, o as parseWorkerReport, s as renderReport, u as sayToWorker, z as loadStatuses } from "./run-
|
|
4
|
-
import { a as clearCooldown, c as probeQuota, d as resolveTarget, h as ledgerPath, l as quotaSkipThreshold, m as eventsPath, v as workersLogDir } from "./server-
|
|
2
|
+
import { A as writeWorkersSection, C as nativeAnthropicProvider, D as resolveCapability, E as readWorkersSection, O as resolveModelCapability, R as workersYamlPath, S as maskKey, a as DEFAULT_CACHE_KEEPALIVE_SECS, b as isModelCapability, c as DEFAULT_ROUTING, f as PROVIDER_TAGS, k as resolveProviderKey, l as DEFAULT_TREE, m as WorkersConfigError, o as DEFAULT_LOG_DIR, r as ANTHROPIC_NATIVE, s as DEFAULT_PANE, u as MODEL_CAPABILITIES, v as expandHome, w as providerCostTier, x as keysDir, y as getProviderOrNative } from "./run-env-BE5xyCwy.mjs";
|
|
3
|
+
import { A as UNLABELED, C as workerInScope, F as elapsedOf, I as isChatPane, J as shortText, L as isLive, M as alive, N as contextLabel, O as appendLedger, P as contextPercent, S as sessionTag, _ as currentTabKey, b as resolveSession, d as workerDepth, g as markControlsHeld, h as clickrControlsArgv, j as ageOf, l as readInbox, o as parseWorkerReport, s as renderReport, u as sayToWorker, z as loadStatuses } from "./run-CxxZKEZw.mjs";
|
|
4
|
+
import { a as clearCooldown, c as probeQuota, d as resolveTarget, h as ledgerPath, l as quotaSkipThreshold, m as eventsPath, v as workersLogDir } from "./server-BY6AedmC.mjs";
|
|
5
5
|
import { chmodSync, closeSync, existsSync, mkdirSync, openSync, readFileSync, readSync, unlinkSync, writeFileSync } from "node:fs";
|
|
6
6
|
import { homedir } from "node:os";
|
|
7
7
|
import { basename, join, relative, resolve } from "node:path";
|
|
@@ -1753,10 +1753,10 @@ function useProvider(name, configPath) {
|
|
|
1753
1753
|
*/
|
|
1754
1754
|
function resolveProviderName(workers, name) {
|
|
1755
1755
|
const target = name ?? workers.active ?? "";
|
|
1756
|
-
if (workers.providers[target]) return target;
|
|
1756
|
+
if (target === ANTHROPIC_NATIVE || workers.providers[target]) return target;
|
|
1757
1757
|
if (!target) throw new WorkersConfigError("no active provider — name one explicitly");
|
|
1758
1758
|
if (target === "auto") throw new WorkersConfigError("active is \"auto\" — name a provider explicitly");
|
|
1759
|
-
throw new WorkersConfigError(`no provider named "${target}". Configured: ${Object.keys(workers.providers).join(", ")
|
|
1759
|
+
throw new WorkersConfigError(`no provider named "${target}". Configured: ${[ANTHROPIC_NATIVE, ...Object.keys(workers.providers)].join(", ")}`);
|
|
1760
1760
|
}
|
|
1761
1761
|
/**
|
|
1762
1762
|
* Set a provider's model id for a capability — default, fast, image, …
|
|
@@ -1767,9 +1767,9 @@ function setProviderModel(name, capability, model, configPath) {
|
|
|
1767
1767
|
const id = model.trim();
|
|
1768
1768
|
if (!id) throw new WorkersConfigError(`a ${capability} model id must not be empty`);
|
|
1769
1769
|
const { raw, workers } = readWorkersSection(configPath);
|
|
1770
|
-
const p = workers
|
|
1771
|
-
if (!p) throw new WorkersConfigError(`no provider named "${name}". Configured: ${Object.keys(workers.providers).join(", ")
|
|
1772
|
-
p.models[capability] = id;
|
|
1770
|
+
const p = getProviderOrNative(workers, name);
|
|
1771
|
+
if (!p) throw new WorkersConfigError(`no provider named "${name}". Configured: ${[ANTHROPIC_NATIVE, ...Object.keys(workers.providers)].join(", ")}`);
|
|
1772
|
+
(name === ANTHROPIC_NATIVE ? workers.nativeModels : p.models)[capability] = id;
|
|
1773
1773
|
writeWorkersSection(raw, workers, configPath);
|
|
1774
1774
|
return workers;
|
|
1775
1775
|
}
|
|
@@ -1844,11 +1844,9 @@ function modelPrefsText(p) {
|
|
|
1844
1844
|
* provider, then one line per provider with all its capability preferences.
|
|
1845
1845
|
*/
|
|
1846
1846
|
function describeModels(workers) {
|
|
1847
|
-
const names = Object.keys(workers.providers);
|
|
1848
|
-
if (!names.length) return ["no providers configured — add one with `pai worker providers add <name> …`"];
|
|
1849
1847
|
const lines = [`active provider: ${workers.active ?? "(none)"}`];
|
|
1850
|
-
for (const name of
|
|
1851
|
-
const p = workers
|
|
1848
|
+
for (const name of [...Object.keys(workers.providers), ANTHROPIC_NATIVE]) {
|
|
1849
|
+
const p = getProviderOrNative(workers, name);
|
|
1852
1850
|
const active = workers.active === name ? " [active]" : "";
|
|
1853
1851
|
lines.push(`${name}${active} ${modelPrefsText(p)}`);
|
|
1854
1852
|
}
|
|
@@ -2206,4 +2204,4 @@ function fallbackStatusText(s) {
|
|
|
2206
2204
|
|
|
2207
2205
|
//#endregion
|
|
2208
2206
|
export { getConfigValueOp as A, psOutput as C, resolveSpecPath as D, readSpecPrompt as E, setConfigValueOp as M, unsetConfigValueOp as N, MainConfigOpsError as O, followWorkers as S, statusLineOutput as T, setWorkersEnabled as _, addProvider as a, updateProvider as b, describeModels as c, removeProvider as d, resolveProviderName as f, setProviderModel as g, setProviderEnabled as h, fallbackStatusText as i, listConfigOp as j, formatConfigGetOutput as k, describeProviders as l, setClass as m, fallbackOn as n, classTargetText as o, setCapabilityPreference as p, fallbackStatus as r, describeCapabilities as s, fallbackOff as t, modelPrefsText as u, unsetCapabilityPreference as v, replayOutput as w, useProvider as x, unsetClass as y };
|
|
2209
|
-
//# sourceMappingURL=fallback-
|
|
2207
|
+
//# sourceMappingURL=fallback-DDbJVaR8.mjs.map
|