@noxsoft/anima 3.0.0 → 3.0.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/{accounts-4HFzweNO.js → accounts-ZMhj636e.js} +38 -38
- package/dist/{agent-events-BiKKV3wj.js → agent-events-iR_gRjZA.js} +2 -2
- package/dist/{agent-scope-BXuH9s05.js → agent-scope-DWKQJUUZ.js} +3 -3
- package/dist/{agents-GDJBET4Z.js → agents-DAg3VWr9.js} +1 -1
- package/dist/{auth-choice-BTMheCDo.js → auth-choice-CPDNhDPT.js} +17 -4
- package/dist/{auth-profiles-xk_1uopf.js → auth-profiles-BqrAPweI.js} +9 -9
- package/dist/{auth-store-Bis9WSLR.js → auth-store-eNVxoq_h.js} +13 -13
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +22 -22
- package/dist/bundled/bootstrap-extra-files/handler.js +6 -6
- package/dist/bundled/command-logger/handler.js +1 -1
- package/dist/bundled/session-memory/handler.js +8 -8
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{chrome-C1KpzLwu.js → chrome-s7nTgmbn.js} +12 -12
- package/dist/{chunk-Cguey_55.js → chunk-lDG_8LI5.js} +2 -2
- package/dist/{clack-prompter-S0pujJNH.js → clack-prompter-DXovYg0Q.js} +1 -1
- package/dist/{command-registry-D5y3Nn9i.js → command-registry-Cl3Z-qsS.js} +7 -7
- package/dist/{common-DgcMt-pi.js → common-DbouukNi.js} +2 -2
- package/dist/{completion-cli-CDsbJ-p2.js → completion-cli-D3yIDiMz.js} +1 -1
- package/dist/{completion-cli-CqZwlvs2.js → completion-cli-DcTEhrAe.js} +2 -2
- package/dist/{config-CrQw7iqE.js → config-H_VHtPeY.js} +27 -27
- package/dist/{config-cli-Brwjz25Y.js → config-cli-DgXOXMb_.js} +1 -1
- package/dist/{config-cli-CaUpfkTl.js → config-cli-VB37XAkf.js} +1 -1
- package/dist/{configure-B_PLPDkP.js → configure-8QclXvjE.js} +2 -2
- package/dist/{configure-QwZPOdBf.js → configure-Du07BFtQ.js} +1 -1
- package/dist/{deliver-Bri9Y1qG.js → deliver-DyQtnfXd.js} +14 -14
- package/dist/{doctor-qFADypWz.js → doctor-BxzkshQH.js} +1 -1
- package/dist/{doctor-BDWGCEMG.js → doctor-DR7CLoAy.js} +1 -1
- package/dist/{doctor-completion-DguJOZqA.js → doctor-completion-CZgNNZVd.js} +1 -1
- package/dist/{doctor-completion-BY4djQTY.js → doctor-completion-Dend-SU1.js} +1 -1
- package/dist/entry.js +1 -1
- package/dist/{exec-DJTRaYS6.js → exec-CK8CHr7j.js} +7 -7
- package/dist/{frontmatter-DDYuWuK5.js → frontmatter-BBFYH_d2.js} +2 -2
- package/dist/{gateway-cli-B091bAD6.js → gateway-cli-BMOKBWwi.js} +5 -5
- package/dist/{gateway-cli-CUmQFMSU.js → gateway-cli-D0mD_UV8.js} +6 -6
- package/dist/{image-ops-ZMEg1-kE.js → image-ops-DJjERl7d.js} +2 -2
- package/dist/index.js +1 -1
- package/dist/json-file-Dvrir7_o.js +25 -0
- package/dist/llm-slug-generator.js +5 -5
- package/dist/{login-DP5hIYxG.js → login-CdRss5_H.js} +5 -5
- package/dist/{login-qr-DOt_1aAq.js → login-qr-DoNanonP.js} +10 -10
- package/dist/{manager-CHN3-66K.js → manager-BlXVqzLP.js} +14 -14
- package/dist/{model-auth-C4Jglp-Y.js → model-auth-ChSwMwh7.js} +3 -3
- package/dist/{model-selection-BsVvfxCt.js → model-selection-DPoLkg_t.js} +1 -1
- package/dist/{onboard-BqpDno7i.js → onboard-D8Khq7CJ.js} +2 -2
- package/dist/{onboard-B006xiEP.js → onboard-DHlStqHP.js} +3 -3
- package/dist/{onboarding-DXQ0Qtq6.js → onboarding-BappVKxE.js} +3 -3
- package/dist/{onboarding-BLFJufto.js → onboarding-CGG6jZ0y.js} +3 -3
- package/dist/{outbound-DdFghG1N.js → outbound-DK71dddk.js} +6 -6
- package/dist/{paths-OaazGgrn.js → paths-CmZenvlb.js} +2 -2
- package/dist/{paths-B-AkG5FD.js → paths-D2eokayo.js} +3 -3
- package/dist/{pi-auth-json-CYnJfuU-.js → pi-auth-json-BYN-DI5a.js} +7 -7
- package/dist/{pi-embedded-helpers-CeMv9QXO.js → pi-embedded-helpers-CvYnWzAn.js} +44 -44
- package/dist/{program-CzWSwu9I.js → program-Dk1iylK1.js} +2 -2
- package/dist/{program-context-C8DYJdS-.js → program-context-DYdCPzyt.js} +9 -9
- package/dist/{prompts-Cm8eJ-i3.js → prompts-BT5ztuUd.js} +17 -4
- package/dist/{pw-ai-DVQKx_ca.js → pw-ai-q5Enhcu7.js} +4 -4
- package/dist/{qmd-manager-lcdr9Faq.js → qmd-manager-D_lZFetA.js} +7 -7
- package/dist/{register.agent-DY1YeTsP.js → register.agent-CzQfwzdi.js} +2 -2
- package/dist/{register.agent-B_gLj3iW.js → register.agent-sq78vQTz.js} +2 -2
- package/dist/{register.configure-BHsLGGdB.js → register.configure-ChWH2Kph.js} +3 -3
- package/dist/{register.configure-De5ZyOFg.js → register.configure-w6Ptx3C9.js} +2 -2
- package/dist/{register.maintenance-Bcb2lf7H.js → register.maintenance-Chm2rk_s.js} +5 -5
- package/dist/{register.maintenance-DSQmEYe7.js → register.maintenance-Da29S58I.js} +4 -4
- package/dist/{register.onboard-COEVeozO.js → register.onboard-B7Ozkx53.js} +7 -7
- package/dist/{register.onboard-DUWYMOX1.js → register.onboard-BBqM-ETs.js} +7 -7
- package/dist/{register.setup-D__YdHzY.js → register.setup-BId1QGzk.js} +7 -7
- package/dist/{register.setup-fJdxj_9G.js → register.setup-Bc3Xk--Q.js} +7 -7
- package/dist/{register.subclis-D2HE_7Rz.js → register.subclis-N7uAMRX_.js} +3 -3
- package/dist/{run-main-BTol0uPD.js → run-main-DA4rt9qc.js} +6 -6
- package/dist/{semantic-BTp-RtM8.js → semantic-BcioSN1d.js} +1 -1
- package/dist/{session-CzBccNiw.js → session-DTRcP2Sj.js} +1 -1
- package/dist/{shell-env-5vFwNQcz.js → shell-env-BBHdjHEl.js} +1 -1
- package/dist/{soul-D4rF0iXu.js → soul-CXGTzaKZ.js} +1 -1
- package/dist/{sqlite-B3u2TqVF.js → sqlite-B-dYyac7.js} +4 -4
- package/dist/{subagent-registry-xUCd2ZX9.js → subagent-registry-DjB3VS5s.js} +28 -28
- package/dist/{subsystem-BlEuMJjX.js → subsystem-CJTCKTwb.js} +13 -13
- package/dist/{tool-images-2qKyjXUj.js → tool-images-DBOSl4NL.js} +2 -2
- package/dist/{update-cli-CATjbP1k.js → update-cli-CGVsahIi.js} +5 -5
- package/dist/{update-cli-C6zUK6ap.js → update-cli-D-QvSeu0.js} +4 -4
- package/dist/{usage-kmpmqBES.js → usage-DSZ_juox.js} +20 -20
- package/dist/{web-CTS-vEIT.js → web-DY2TrPoD.js} +86 -86
- package/dist/{whatsapp-actions-qDftmVCc.js → whatsapp-actions-B_fglZZt.js} +13 -13
- package/dist/{workspace-CZlo4alz.js → workspace-xzxJwPTB.js} +5 -5
- package/package.json +2 -1
- package/dist/json-file-CZ3ssFR9.js +0 -25
- /package/dist/{config-Btt1rkoB.js → config-COtiNNtV.js} +0 -0
- /package/dist/{input-provenance-B0pwc6mp.js → input-provenance-MbkIKHHL.js} +0 -0
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { n as __exportAll } from "./chunk-BXK9XSlF.js";
|
|
2
|
-
import { i as resolveGatewayPort, n as resolveConfigPath, s as resolveStateDir } from "./paths-
|
|
3
|
-
import { A as isAcpSessionKey, E as resolveAgentIdFromSessionKey, M as parseAgentSessionKey, T as normalizeMainKey, k as getSubagentDepth } from "./workspace-
|
|
4
|
-
import { n as defaultRuntime, t as createSubsystemLogger } from "./subsystem-
|
|
5
|
-
import { E as shortenHomeInString, a as logDebug, l as CONFIG_DIR, o as logError, p as ensureDir$1, w as resolveUserPath } from "./exec-
|
|
6
|
-
import { c as resolveDefaultAgentId, l as resolveSessionAgentId, n as resolveAgentConfig } from "./agent-scope-
|
|
2
|
+
import { i as resolveGatewayPort, n as resolveConfigPath, s as resolveStateDir } from "./paths-D2eokayo.js";
|
|
3
|
+
import { A as isAcpSessionKey, E as resolveAgentIdFromSessionKey, M as parseAgentSessionKey, T as normalizeMainKey, k as getSubagentDepth } from "./workspace-xzxJwPTB.js";
|
|
4
|
+
import { n as defaultRuntime, t as createSubsystemLogger } from "./subsystem-CJTCKTwb.js";
|
|
5
|
+
import { E as shortenHomeInString, a as logDebug, l as CONFIG_DIR, o as logError, p as ensureDir$1, w as resolveUserPath } from "./exec-CK8CHr7j.js";
|
|
6
|
+
import { c as resolveDefaultAgentId, l as resolveSessionAgentId, n as resolveAgentConfig } from "./agent-scope-DWKQJUUZ.js";
|
|
7
7
|
import { a as queueEmbeddedPiMessage, c as waitForEmbeddedPiRunEnd, o as resolveEmbeddedSessionLane, r as isEmbeddedPiRunActive } from "./pi-embedded-CVojjlMb.js";
|
|
8
|
-
import { At as HEARTBEAT_TOKEN, Ct as resolveMainSessionKey, Mt as isSilentReplyText, ct as deliveryContextKey, jt as SILENT_REPLY_TOKEN, lt as mergeDeliveryContext, st as deliveryContextFromSession, tt as loadSessionStore, ut as normalizeDeliveryContext, v as sanitizeUserFacingText } from "./pi-embedded-helpers-
|
|
9
|
-
import { n as saveJsonFile, t as loadJsonFile } from "./json-file-
|
|
10
|
-
import { A as normalizeMessageChannel, C as normalizeChannelId, F as GATEWAY_CLIENT_NAMES, N as GATEWAY_CLIENT_IDS, P as GATEWAY_CLIENT_MODES, w as INTERNAL_MESSAGE_CHANNEL, x as getChannelPlugin } from "./image-ops-
|
|
11
|
-
import { c as parseDurationMs, n as loadConfig } from "./config-
|
|
12
|
-
import { s as resolveStorePath } from "./paths-
|
|
13
|
-
import { a as resolveAgentTimeoutMs, c as CommandLane, o as AGENT_LANE_NESTED, r as onAgentEvent, u as stripHeartbeatToken } from "./agent-events-
|
|
14
|
-
import { S as pickPrimaryTailnetIPv4, x as pickPrimaryLanIPv4, y as rawDataToString } from "./chrome-
|
|
15
|
-
import { t as INPUT_PROVENANCE_KIND_VALUES } from "./input-provenance-
|
|
8
|
+
import { At as HEARTBEAT_TOKEN, Ct as resolveMainSessionKey, Mt as isSilentReplyText, ct as deliveryContextKey, jt as SILENT_REPLY_TOKEN, lt as mergeDeliveryContext, st as deliveryContextFromSession, tt as loadSessionStore, ut as normalizeDeliveryContext, v as sanitizeUserFacingText } from "./pi-embedded-helpers-CvYnWzAn.js";
|
|
9
|
+
import { n as saveJsonFile, t as loadJsonFile } from "./json-file-Dvrir7_o.js";
|
|
10
|
+
import { A as normalizeMessageChannel, C as normalizeChannelId, F as GATEWAY_CLIENT_NAMES, N as GATEWAY_CLIENT_IDS, P as GATEWAY_CLIENT_MODES, w as INTERNAL_MESSAGE_CHANNEL, x as getChannelPlugin } from "./image-ops-DJjERl7d.js";
|
|
11
|
+
import { c as parseDurationMs, n as loadConfig } from "./config-H_VHtPeY.js";
|
|
12
|
+
import { s as resolveStorePath } from "./paths-CmZenvlb.js";
|
|
13
|
+
import { a as resolveAgentTimeoutMs, c as CommandLane, o as AGENT_LANE_NESTED, r as onAgentEvent, u as stripHeartbeatToken } from "./agent-events-iR_gRjZA.js";
|
|
14
|
+
import { S as pickPrimaryTailnetIPv4, x as pickPrimaryLanIPv4, y as rawDataToString } from "./chrome-s7nTgmbn.js";
|
|
15
|
+
import { t as INPUT_PROVENANCE_KIND_VALUES } from "./input-provenance-MbkIKHHL.js";
|
|
16
16
|
import fs from "node:fs/promises";
|
|
17
17
|
import os from "node:os";
|
|
18
18
|
import path from "node:path";
|
|
19
|
-
import
|
|
19
|
+
import fsSync from "node:fs";
|
|
20
20
|
import JSON5 from "json5";
|
|
21
21
|
import { execFile } from "node:child_process";
|
|
22
22
|
import { promisify } from "node:util";
|
|
@@ -30,7 +30,7 @@ function resolveDefaultIdentityPath() {
|
|
|
30
30
|
return path.join(resolveStateDir(), "identity", "device.json");
|
|
31
31
|
}
|
|
32
32
|
function ensureDir(filePath) {
|
|
33
|
-
|
|
33
|
+
fsSync.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
34
34
|
}
|
|
35
35
|
const ED25519_SPKI_PREFIX = Buffer.from("302a300506032b6570032100", "hex");
|
|
36
36
|
function base64UrlEncode(buf) {
|
|
@@ -66,8 +66,8 @@ function generateIdentity() {
|
|
|
66
66
|
}
|
|
67
67
|
function loadOrCreateDeviceIdentity(filePath = resolveDefaultIdentityPath()) {
|
|
68
68
|
try {
|
|
69
|
-
if (
|
|
70
|
-
const raw =
|
|
69
|
+
if (fsSync.existsSync(filePath)) {
|
|
70
|
+
const raw = fsSync.readFileSync(filePath, "utf8");
|
|
71
71
|
const parsed = JSON.parse(raw);
|
|
72
72
|
if (parsed?.version === 1 && typeof parsed.deviceId === "string" && typeof parsed.publicKeyPem === "string" && typeof parsed.privateKeyPem === "string") {
|
|
73
73
|
const derivedId = fingerprintPublicKey(parsed.publicKeyPem);
|
|
@@ -76,9 +76,9 @@ function loadOrCreateDeviceIdentity(filePath = resolveDefaultIdentityPath()) {
|
|
|
76
76
|
...parsed,
|
|
77
77
|
deviceId: derivedId
|
|
78
78
|
};
|
|
79
|
-
|
|
79
|
+
fsSync.writeFileSync(filePath, `${JSON.stringify(updated, null, 2)}\n`, { mode: 384 });
|
|
80
80
|
try {
|
|
81
|
-
|
|
81
|
+
fsSync.chmodSync(filePath, 384);
|
|
82
82
|
} catch {}
|
|
83
83
|
return {
|
|
84
84
|
deviceId: derivedId,
|
|
@@ -103,9 +103,9 @@ function loadOrCreateDeviceIdentity(filePath = resolveDefaultIdentityPath()) {
|
|
|
103
103
|
privateKeyPem: identity.privateKeyPem,
|
|
104
104
|
createdAtMs: Date.now()
|
|
105
105
|
};
|
|
106
|
-
|
|
106
|
+
fsSync.writeFileSync(filePath, `${JSON.stringify(stored, null, 2)}\n`, { mode: 384 });
|
|
107
107
|
try {
|
|
108
|
-
|
|
108
|
+
fsSync.chmodSync(filePath, 384);
|
|
109
109
|
} catch {}
|
|
110
110
|
return identity;
|
|
111
111
|
}
|
|
@@ -255,8 +255,8 @@ function resolveDeviceAuthPath(env = process.env) {
|
|
|
255
255
|
}
|
|
256
256
|
function readStore(filePath) {
|
|
257
257
|
try {
|
|
258
|
-
if (!
|
|
259
|
-
const raw =
|
|
258
|
+
if (!fsSync.existsSync(filePath)) return null;
|
|
259
|
+
const raw = fsSync.readFileSync(filePath, "utf8");
|
|
260
260
|
const parsed = JSON.parse(raw);
|
|
261
261
|
if (parsed?.version !== 1 || typeof parsed.deviceId !== "string") return null;
|
|
262
262
|
if (!parsed.tokens || typeof parsed.tokens !== "object") return null;
|
|
@@ -266,10 +266,10 @@ function readStore(filePath) {
|
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
268
|
function writeStore(filePath, store) {
|
|
269
|
-
|
|
270
|
-
|
|
269
|
+
fsSync.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
270
|
+
fsSync.writeFileSync(filePath, `${JSON.stringify(store, null, 2)}\n`, { mode: 384 });
|
|
271
271
|
try {
|
|
272
|
-
|
|
272
|
+
fsSync.chmodSync(filePath, 384);
|
|
273
273
|
} catch {}
|
|
274
274
|
}
|
|
275
275
|
function loadDeviceAuthToken(params) {
|
|
@@ -2713,7 +2713,7 @@ async function routeReply(params) {
|
|
|
2713
2713
|
const resolvedReplyToId = replyToId ?? (channelId === "slack" && threadId != null && threadId !== "" ? String(threadId) : void 0);
|
|
2714
2714
|
const resolvedThreadId = channelId === "slack" ? null : threadId ?? null;
|
|
2715
2715
|
try {
|
|
2716
|
-
const { deliverOutboundPayloads } = await import("./deliver-
|
|
2716
|
+
const { deliverOutboundPayloads } = await import("./deliver-DyQtnfXd.js").then((n) => n.n);
|
|
2717
2717
|
return {
|
|
2718
2718
|
ok: true,
|
|
2719
2719
|
messageId: (await deliverOutboundPayloads({
|
|
@@ -2947,7 +2947,7 @@ function normalizeSessionKey(value) {
|
|
|
2947
2947
|
}
|
|
2948
2948
|
function readSessionStore(storePath) {
|
|
2949
2949
|
try {
|
|
2950
|
-
const raw =
|
|
2950
|
+
const raw = fsSync.readFileSync(storePath, "utf-8");
|
|
2951
2951
|
const parsed = JSON5.parse(raw);
|
|
2952
2952
|
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) return parsed;
|
|
2953
2953
|
} catch {}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as resolveConfigPath } from "./paths-
|
|
1
|
+
import { n as resolveConfigPath } from "./paths-D2eokayo.js";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import os from "node:os";
|
|
4
4
|
import path from "node:path";
|
|
5
|
-
import
|
|
5
|
+
import fsSync from "node:fs";
|
|
6
6
|
import { Logger } from "tslog";
|
|
7
7
|
import JSON5 from "json5";
|
|
8
8
|
import chalk, { Chalk } from "chalk";
|
|
@@ -13,9 +13,9 @@ function isNodeErrorWithCode(err, code) {
|
|
|
13
13
|
return typeof err === "object" && err !== null && "code" in err && err.code === code;
|
|
14
14
|
}
|
|
15
15
|
function resolvePreferredAnimaTmpDir(options = {}) {
|
|
16
|
-
const accessSync = options.accessSync ??
|
|
17
|
-
const lstatSync = options.lstatSync ??
|
|
18
|
-
const mkdirSync = options.mkdirSync ??
|
|
16
|
+
const accessSync = options.accessSync ?? fsSync.accessSync;
|
|
17
|
+
const lstatSync = options.lstatSync ?? fsSync.lstatSync;
|
|
18
|
+
const mkdirSync = options.mkdirSync ?? fsSync.mkdirSync;
|
|
19
19
|
const getuid = options.getuid ?? (() => {
|
|
20
20
|
try {
|
|
21
21
|
return typeof process.getuid === "function" ? process.getuid() : void 0;
|
|
@@ -39,14 +39,14 @@ function resolvePreferredAnimaTmpDir(options = {}) {
|
|
|
39
39
|
try {
|
|
40
40
|
const preferred = lstatSync(POSIX_ANIMA_TMP_DIR);
|
|
41
41
|
if (!preferred.isDirectory() || preferred.isSymbolicLink()) return fallback();
|
|
42
|
-
accessSync(POSIX_ANIMA_TMP_DIR,
|
|
42
|
+
accessSync(POSIX_ANIMA_TMP_DIR, fsSync.constants.W_OK | fsSync.constants.X_OK);
|
|
43
43
|
if (!isSecureDirForUser(preferred)) return fallback();
|
|
44
44
|
return POSIX_ANIMA_TMP_DIR;
|
|
45
45
|
} catch (err) {
|
|
46
46
|
if (!isNodeErrorWithCode(err, "ENOENT")) return fallback();
|
|
47
47
|
}
|
|
48
48
|
try {
|
|
49
|
-
accessSync("/tmp",
|
|
49
|
+
accessSync("/tmp", fsSync.constants.W_OK | fsSync.constants.X_OK);
|
|
50
50
|
mkdirSync(POSIX_ANIMA_TMP_DIR, {
|
|
51
51
|
recursive: true,
|
|
52
52
|
mode: 448
|
|
@@ -69,8 +69,8 @@ function resolvePreferredAnimaTmpDir(options = {}) {
|
|
|
69
69
|
function readLoggingConfig() {
|
|
70
70
|
const configPath = resolveConfigPath();
|
|
71
71
|
try {
|
|
72
|
-
if (!
|
|
73
|
-
const raw =
|
|
72
|
+
if (!fsSync.existsSync(configPath)) return;
|
|
73
|
+
const raw = fsSync.readFileSync(configPath, "utf-8");
|
|
74
74
|
const logging = JSON5.parse(raw)?.logging;
|
|
75
75
|
if (!logging || typeof logging !== "object" || Array.isArray(logging)) return;
|
|
76
76
|
return logging;
|
|
@@ -163,7 +163,7 @@ function isFileLogLevelEnabled(level) {
|
|
|
163
163
|
return levelToMinLevel(level) <= levelToMinLevel(settings.level);
|
|
164
164
|
}
|
|
165
165
|
function buildLogger(settings) {
|
|
166
|
-
|
|
166
|
+
fsSync.mkdirSync(path.dirname(settings.file), { recursive: true });
|
|
167
167
|
if (isRollingPath(settings.file)) pruneOldRollingLogs(path.dirname(settings.file));
|
|
168
168
|
const logger = new Logger({
|
|
169
169
|
name: "anima",
|
|
@@ -177,7 +177,7 @@ function buildLogger(settings) {
|
|
|
177
177
|
...logObj,
|
|
178
178
|
time
|
|
179
179
|
});
|
|
180
|
-
|
|
180
|
+
fsSync.appendFileSync(settings.file, `${line}\n`, { encoding: "utf8" });
|
|
181
181
|
} catch {}
|
|
182
182
|
});
|
|
183
183
|
for (const transport of externalTransports) attachExternalTransport(logger, transport);
|
|
@@ -229,14 +229,14 @@ function isRollingPath(file) {
|
|
|
229
229
|
}
|
|
230
230
|
function pruneOldRollingLogs(dir) {
|
|
231
231
|
try {
|
|
232
|
-
const entries =
|
|
232
|
+
const entries = fsSync.readdirSync(dir, { withFileTypes: true });
|
|
233
233
|
const cutoff = Date.now() - MAX_LOG_AGE_MS;
|
|
234
234
|
for (const entry of entries) {
|
|
235
235
|
if (!entry.isFile()) continue;
|
|
236
236
|
if (!entry.name.startsWith(`${LOG_PREFIX}-`) || !entry.name.endsWith(LOG_SUFFIX)) continue;
|
|
237
237
|
const fullPath = path.join(dir, entry.name);
|
|
238
238
|
try {
|
|
239
|
-
if (
|
|
239
|
+
if (fsSync.statSync(fullPath).mtimeMs < cutoff) fsSync.rmSync(fullPath, { force: true });
|
|
240
240
|
} catch {}
|
|
241
241
|
}
|
|
242
242
|
} catch {}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as createSubsystemLogger } from "./subsystem-
|
|
2
|
-
import { a as resizeToJpeg, n as getImageMetadata } from "./image-ops-
|
|
1
|
+
import { t as createSubsystemLogger } from "./subsystem-CJTCKTwb.js";
|
|
2
|
+
import { a as resizeToJpeg, n as getImageMetadata } from "./image-ops-DJjERl7d.js";
|
|
3
3
|
|
|
4
4
|
//#region src/agents/tool-images.ts
|
|
5
5
|
const MAX_IMAGE_DIMENSION_PX = 2e3;
|
|
@@ -60,10 +60,10 @@ import "./dispatcher-BhzRMibw.js";
|
|
|
60
60
|
import "./delivery-queue-BqJKnOa_.js";
|
|
61
61
|
import "./session-cost-usage-lfPU35Sb.js";
|
|
62
62
|
import "./accounts-BmC37n9k.js";
|
|
63
|
-
import "./register.subclis-
|
|
64
|
-
import "./command-registry-
|
|
63
|
+
import "./register.subclis-N7uAMRX_.js";
|
|
64
|
+
import "./command-registry-Cl3Z-qsS.js";
|
|
65
65
|
import "./program-context-DItEQSzX.js";
|
|
66
|
-
import { r as installCompletion } from "./completion-cli-
|
|
66
|
+
import { r as installCompletion } from "./completion-cli-DcTEhrAe.js";
|
|
67
67
|
import "./daemon-runtime-Cbi2Ox6g.js";
|
|
68
68
|
import { r as parseSemver } from "./runtime-guard-BdBLhuIK.js";
|
|
69
69
|
import "./onboard-helpers-DKu_2enh.js";
|
|
@@ -82,7 +82,7 @@ import "./health-format-Dug5Rbjg.js";
|
|
|
82
82
|
import { c as DEFAULT_GIT_CHANNEL, d as channelToNpmTag, f as formatUpdateChannelLabel, g as resolveEffectiveUpdateChannel, h as normalizeUpdateChannel, i as fetchNpmTagVersion, l as DEFAULT_PACKAGE_CHANNEL, n as checkUpdateStatus, o as resolveNpmChannelTag, r as compareSemverStrings } from "./channels-status-issues-BSWv108Y.js";
|
|
83
83
|
import "./logging-B05aEFEO.js";
|
|
84
84
|
import "./note-Cdu0wcse.js";
|
|
85
|
-
import { r as ensureCompletionCacheExists, t as checkShellCompletionStatus } from "./doctor-completion-
|
|
85
|
+
import { r as ensureCompletionCacheExists, t as checkShellCompletionStatus } from "./doctor-completion-CZgNNZVd.js";
|
|
86
86
|
import "./skill-scanner-CUbVbJhZ.js";
|
|
87
87
|
import { i as resolveUpdateAvailability, n as formatUpdateOneLiner, t as formatUpdateAvailableHint } from "./status.update-_DOVm6Tr.js";
|
|
88
88
|
import "./archive-CI3UtbnF.js";
|
|
@@ -94,7 +94,7 @@ import "./doctor-config-flow-BAntaUow.js";
|
|
|
94
94
|
import { t as formatHelpExamples } from "./help-format-NtbQydGl.js";
|
|
95
95
|
import "./systemd-linger-BXOkxYnH.js";
|
|
96
96
|
import "./auth-health-C0g38cq2.js";
|
|
97
|
-
import { t as doctorCommand } from "./doctor-
|
|
97
|
+
import { t as doctorCommand } from "./doctor-BxzkshQH.js";
|
|
98
98
|
import { spawnSync } from "node:child_process";
|
|
99
99
|
import os from "node:os";
|
|
100
100
|
import path from "node:path";
|
|
@@ -61,10 +61,10 @@ import "./delivery-queue-CdUtwMZr.js";
|
|
|
61
61
|
import "./session-cost-usage-CYdqhmt6.js";
|
|
62
62
|
import "./accounts-C9dcy8Gp.js";
|
|
63
63
|
import { r as parseSemver } from "./runtime-guard-PndcQBdO.js";
|
|
64
|
-
import "./program-context-
|
|
64
|
+
import "./program-context-DYdCPzyt.js";
|
|
65
65
|
import "./catalog-VwQGLU6M.js";
|
|
66
66
|
import "./skills-status-DeW3dXom.js";
|
|
67
|
-
import { r as installCompletion } from "./completion-cli-
|
|
67
|
+
import { r as installCompletion } from "./completion-cli-D3yIDiMz.js";
|
|
68
68
|
import "./daemon-runtime-DOk9qM0y.js";
|
|
69
69
|
import "./onboard-helpers-K7wUCSoE.js";
|
|
70
70
|
import { n as stylePromptMessage, t as stylePromptHint } from "./prompt-style-CXrnxWQG.js";
|
|
@@ -81,7 +81,7 @@ import "./health-format-BMwPAU53.js";
|
|
|
81
81
|
import { c as DEFAULT_GIT_CHANNEL, d as channelToNpmTag, f as formatUpdateChannelLabel, g as resolveEffectiveUpdateChannel, h as normalizeUpdateChannel, i as fetchNpmTagVersion, l as DEFAULT_PACKAGE_CHANNEL, n as checkUpdateStatus, o as resolveNpmChannelTag, r as compareSemverStrings } from "./channels-status-issues-BCuAG8zm.js";
|
|
82
82
|
import "./logging-ClHj0gnP.js";
|
|
83
83
|
import "./note-CLRVmCnr.js";
|
|
84
|
-
import { r as ensureCompletionCacheExists, t as checkShellCompletionStatus } from "./doctor-completion-
|
|
84
|
+
import { r as ensureCompletionCacheExists, t as checkShellCompletionStatus } from "./doctor-completion-Dend-SU1.js";
|
|
85
85
|
import "./skill-scanner-BA9Rv4AE.js";
|
|
86
86
|
import { i as resolveUpdateAvailability, n as formatUpdateOneLiner, t as formatUpdateAvailableHint } from "./status.update-s92nCoGl.js";
|
|
87
87
|
import "./archive-BZANtsGY.js";
|
|
@@ -92,7 +92,7 @@ import { n as updateNpmInstalledPlugins, t as syncPluginsForUpdateChannel } from
|
|
|
92
92
|
import "./doctor-config-flow-d6ocIX0r.js";
|
|
93
93
|
import { t as formatHelpExamples } from "./help-format-CaDQjeYI.js";
|
|
94
94
|
import "./systemd-linger-q1hyIpoI.js";
|
|
95
|
-
import { t as doctorCommand } from "./doctor-
|
|
95
|
+
import { t as doctorCommand } from "./doctor-DR7CLoAy.js";
|
|
96
96
|
import os from "node:os";
|
|
97
97
|
import path from "node:path";
|
|
98
98
|
import fs from "node:fs/promises";
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { E as resolveAgentIdFromSessionKey, M as parseAgentSessionKey, S as classifySessionKeyShape, _ as DEFAULT_AGENT_ID, f as loadWorkspaceBootstrapFiles, m as resolveAnimaPackageRoot, u as filterBootstrapFilesForSession, w as normalizeAgentId } from "./workspace-
|
|
2
|
-
import { t as createSubsystemLogger, v as logVerbose, x as shouldLogVerbose } from "./subsystem-
|
|
3
|
-
import { _ as isRecord, l as CONFIG_DIR, m as escapeRegExp, n as runExec, t as runCommandWithTimeout, w as resolveUserPath } from "./exec-
|
|
4
|
-
import { c as resolveDefaultAgentId, s as resolveAgentWorkspaceDir, u as resolveSessionAgentIds } from "./agent-scope-
|
|
1
|
+
import { E as resolveAgentIdFromSessionKey, M as parseAgentSessionKey, S as classifySessionKeyShape, _ as DEFAULT_AGENT_ID, f as loadWorkspaceBootstrapFiles, m as resolveAnimaPackageRoot, u as filterBootstrapFilesForSession, w as normalizeAgentId } from "./workspace-xzxJwPTB.js";
|
|
2
|
+
import { t as createSubsystemLogger, v as logVerbose, x as shouldLogVerbose } from "./subsystem-CJTCKTwb.js";
|
|
3
|
+
import { _ as isRecord, l as CONFIG_DIR, m as escapeRegExp, n as runExec, t as runCommandWithTimeout, w as resolveUserPath } from "./exec-CK8CHr7j.js";
|
|
4
|
+
import { c as resolveDefaultAgentId, s as resolveAgentWorkspaceDir, u as resolveSessionAgentIds } from "./agent-scope-DWKQJUUZ.js";
|
|
5
5
|
import { t as formatCliCommand } from "./command-format-CZk1W3UP.js";
|
|
6
|
-
import { M as resolvePluginSkillDirs, Ot as normalizeChatType, X as resolveBootstrapMaxChars, Y as buildBootstrapContextFiles, Z as resolveBootstrapTotalMaxChars, at as updateSessionStore, f as classifyFailoverReason, g as isLikelyContextOverflowError, h as isFailoverErrorMessage, jt as SILENT_REPLY_TOKEN, st as deliveryContextFromSession } from "./pi-embedded-helpers-
|
|
7
|
-
import { c as resolveAnimaAgentDir, n as resolveAuthProfileOrder, o as ensureAuthProfileStore, r as isProfileInCooldown } from "./auth-profiles-
|
|
8
|
-
import { a as modelKey, d as resolveModelRefFromString, h as DEFAULT_PROVIDER, l as resolveConfiguredModelRef, m as DEFAULT_MODEL, n as buildConfiguredAllowlistKeys, o as normalizeModelRef, r as buildModelAliasIndex, s as normalizeProviderId, u as resolveDefaultModelForAgent } from "./model-selection-
|
|
9
|
-
import { A as normalizeMessageChannel, C as normalizeChannelId, T as isDeliverableMessageChannel, c as getFileExtension, f as normalizeMimeType, k as listDeliverableMessageChannels, w as INTERNAL_MESSAGE_CHANNEL, x as getChannelPlugin } from "./image-ops-
|
|
10
|
-
import { n as loadConfig } from "./config-
|
|
11
|
-
import { s as isTruthyEnvValue } from "./shell-env-
|
|
12
|
-
import { l as resolveHeartbeatPrompt } from "./agent-events-
|
|
6
|
+
import { M as resolvePluginSkillDirs, Ot as normalizeChatType, X as resolveBootstrapMaxChars, Y as buildBootstrapContextFiles, Z as resolveBootstrapTotalMaxChars, at as updateSessionStore, f as classifyFailoverReason, g as isLikelyContextOverflowError, h as isFailoverErrorMessage, jt as SILENT_REPLY_TOKEN, st as deliveryContextFromSession } from "./pi-embedded-helpers-CvYnWzAn.js";
|
|
7
|
+
import { c as resolveAnimaAgentDir, n as resolveAuthProfileOrder, o as ensureAuthProfileStore, r as isProfileInCooldown } from "./auth-profiles-BqrAPweI.js";
|
|
8
|
+
import { a as modelKey, d as resolveModelRefFromString, h as DEFAULT_PROVIDER, l as resolveConfiguredModelRef, m as DEFAULT_MODEL, n as buildConfiguredAllowlistKeys, o as normalizeModelRef, r as buildModelAliasIndex, s as normalizeProviderId, u as resolveDefaultModelForAgent } from "./model-selection-DPoLkg_t.js";
|
|
9
|
+
import { A as normalizeMessageChannel, C as normalizeChannelId, T as isDeliverableMessageChannel, c as getFileExtension, f as normalizeMimeType, k as listDeliverableMessageChannels, w as INTERNAL_MESSAGE_CHANNEL, x as getChannelPlugin } from "./image-ops-DJjERl7d.js";
|
|
10
|
+
import { n as loadConfig } from "./config-H_VHtPeY.js";
|
|
11
|
+
import { s as isTruthyEnvValue } from "./shell-env-BBHdjHEl.js";
|
|
12
|
+
import { l as resolveHeartbeatPrompt } from "./agent-events-iR_gRjZA.js";
|
|
13
13
|
import { i as triggerInternalHook, t as createInternalHookEvent } from "./internal-hooks-CmG29WRF.js";
|
|
14
|
-
import { r as requireApiKey, t as getApiKeyForModel } from "./model-auth-
|
|
14
|
+
import { r as requireApiKey, t as getApiKeyForModel } from "./model-auth-ChSwMwh7.js";
|
|
15
15
|
import fs from "node:fs/promises";
|
|
16
16
|
import os, { tmpdir } from "node:os";
|
|
17
17
|
import path from "node:path";
|
|
18
|
-
import
|
|
18
|
+
import fsSync, { existsSync, mkdirSync, mkdtempSync, readFileSync, renameSync, rmSync, unlinkSync, writeFileSync } from "node:fs";
|
|
19
19
|
import { execSync, spawn } from "node:child_process";
|
|
20
20
|
import crypto, { randomUUID } from "node:crypto";
|
|
21
21
|
import { completeSimple } from "@mariozechner/pi-ai";
|
|
@@ -1393,7 +1393,7 @@ function resolvePowerShellPath() {
|
|
|
1393
1393
|
const systemRoot = process.env.SystemRoot || process.env.WINDIR;
|
|
1394
1394
|
if (systemRoot) {
|
|
1395
1395
|
const candidate = path.join(systemRoot, "System32", "WindowsPowerShell", "v1.0", "powershell.exe");
|
|
1396
|
-
if (
|
|
1396
|
+
if (fsSync.existsSync(candidate)) return candidate;
|
|
1397
1397
|
}
|
|
1398
1398
|
return "powershell.exe";
|
|
1399
1399
|
}
|
|
@@ -1431,7 +1431,7 @@ function resolveShellFromPath(name) {
|
|
|
1431
1431
|
for (const entry of entries) {
|
|
1432
1432
|
const candidate = path.join(entry, name);
|
|
1433
1433
|
try {
|
|
1434
|
-
|
|
1434
|
+
fsSync.accessSync(candidate, fsSync.constants.X_OK);
|
|
1435
1435
|
return candidate;
|
|
1436
1436
|
} catch {}
|
|
1437
1437
|
}
|
|
@@ -1604,7 +1604,7 @@ function resolveRepoRoot(params) {
|
|
|
1604
1604
|
const configured = params.config?.agents?.defaults?.repoRoot?.trim();
|
|
1605
1605
|
if (configured) try {
|
|
1606
1606
|
const resolved = path.resolve(configured);
|
|
1607
|
-
if (
|
|
1607
|
+
if (fsSync.statSync(resolved).isDirectory()) return resolved;
|
|
1608
1608
|
} catch {}
|
|
1609
1609
|
const candidates = [params.workspaceDir, params.cwd].map((value) => value?.trim()).filter(Boolean);
|
|
1610
1610
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -1621,7 +1621,7 @@ function findGitRoot(startDir) {
|
|
|
1621
1621
|
for (let i = 0; i < 12; i += 1) {
|
|
1622
1622
|
const gitPath = path.join(current, ".git");
|
|
1623
1623
|
try {
|
|
1624
|
-
const stat =
|
|
1624
|
+
const stat = fsSync.statSync(gitPath);
|
|
1625
1625
|
if (stat.isDirectory() || stat.isFile()) return current;
|
|
1626
1626
|
} catch {}
|
|
1627
1627
|
const parent = path.dirname(current);
|
|
@@ -2443,7 +2443,7 @@ async function resolveAnimaDocsPath(params) {
|
|
|
2443
2443
|
const workspaceDir = params.workspaceDir?.trim();
|
|
2444
2444
|
if (workspaceDir) {
|
|
2445
2445
|
const workspaceDocs = path.join(workspaceDir, "docs");
|
|
2446
|
-
if (
|
|
2446
|
+
if (fsSync.existsSync(workspaceDocs)) return workspaceDocs;
|
|
2447
2447
|
}
|
|
2448
2448
|
const packageRoot = await resolveAnimaPackageRoot({
|
|
2449
2449
|
cwd: params.cwd,
|
|
@@ -2452,7 +2452,7 @@ async function resolveAnimaDocsPath(params) {
|
|
|
2452
2452
|
});
|
|
2453
2453
|
if (!packageRoot) return null;
|
|
2454
2454
|
const packageDocs = path.join(packageRoot, "docs");
|
|
2455
|
-
return
|
|
2455
|
+
return fsSync.existsSync(packageDocs) ? packageDocs : null;
|
|
2456
2456
|
}
|
|
2457
2457
|
|
|
2458
2458
|
//#endregion
|
|
@@ -2931,7 +2931,7 @@ async function loadModelCatalog(params) {
|
|
|
2931
2931
|
});
|
|
2932
2932
|
try {
|
|
2933
2933
|
await ensureAnimaModelsJson(params?.config ?? loadConfig());
|
|
2934
|
-
await (await import("./pi-auth-json-
|
|
2934
|
+
await (await import("./pi-auth-json-BYN-DI5a.js")).ensurePiAuthJsonFromAuthProfiles(resolveAnimaAgentDir());
|
|
2935
2935
|
const piSdk = await importPiSdk();
|
|
2936
2936
|
const agentDir = resolveAnimaAgentDir();
|
|
2937
2937
|
const { join } = await import("node:path");
|