@noxsoft/anima 5.0.1 → 5.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-BOkEyUcS.js → accounts-CSCVz9k9.js} +7 -7
- package/dist/{acp-cli-BcshtFqY.js → acp-cli-DyVMXQS8.js} +1 -1
- package/dist/{agent-c49U1LxE.js → agent-CWQdTmzC.js} +3 -3
- package/dist/{agent-Cil6Zvns.js → agent-DiEXJmhj.js} +8 -8
- package/dist/{agents-2BloqCjm.js → agents-rAIsxGuA.js} +8 -8
- package/dist/{anthropic-direct-runner-BVlO2Vi5.js → anthropic-direct-runner--MPTWkYA.js} +228 -193
- package/dist/{anthropic-direct-runner-mh6c_WBB.js → anthropic-direct-runner-_uCPWuBb.js} +232 -197
- package/dist/{audit-BbmRSFjf.js → audit-DqjWCAbO.js} +7 -7
- package/dist/{auth-choice-BVAMr2Dk.js → auth-choice-o5GHtPGA.js} +57 -5
- package/dist/{auth-profiles-Chf1JBpl.js → auth-profiles-DriJ4HU5.js} +1 -1
- package/dist/{banner-CgxCSS-T.js → banner-Gtp-FQrx.js} +1 -1
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +13 -13
- package/dist/bundled/bootstrap-extra-files/handler.js +3 -3
- package/dist/bundled/session-memory/handler.js +10 -10
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{channel-web-Y8i3EzJq.js → channel-web-Dz0XZNjP.js} +4 -4
- package/dist/{channels-status-issues-BlmAMBCg.js → channels-status-issues-Dqd_vE0e.js} +2 -2
- package/dist/{chrome-B2-33FWf.js → chrome-CB6uZMvl.js} +1 -1
- package/dist/{chrome-Cxl7I5SB.js → chrome-CKvch3UL.js} +7 -7
- package/dist/{clack-prompter-B-ZJG628.js → clack-prompter-BRLXmV52.js} +1 -1
- package/dist/{clack-prompter-CCRr4nAr.js → clack-prompter-OFy356QZ.js} +1 -1
- package/dist/{cli-C3uw3mId.js → cli-BZz5MnAE.js} +29 -29
- package/dist/{cli-CfvBmuhw.js → cli-CJfwHH_z.js} +5 -5
- package/dist/{cli-session-BzZYmGP1.js → cli-session-8PeURiwF.js} +6 -6
- package/dist/{cli-session-DgUHOBYo.js → cli-session-CczB2Dni.js} +1 -1
- package/dist/{command-registry-DLofaVIN.js → command-registry-C9kvlc67.js} +12 -12
- package/dist/{common-FlJ-8clz.js → common-C5mWuFve.js} +2 -2
- package/dist/{completion-cli-C9KvX2ZF.js → completion-cli-Ci_MzRm6.js} +2 -2
- package/dist/{completion-cli-3eYvtAih.js → completion-cli-DhbIrk13.js} +1 -1
- package/dist/{config-B-9UciOO.js → config-DezP7V65.js} +2 -2
- package/dist/{config-cli-CBXWDtvj.js → config-cli-ePL5ncye.js} +1 -1
- package/dist/{config-cli-cmNuTlw0.js → config-cli-uk9vdQZH.js} +1 -1
- package/dist/{config-guard-qiKju2Fg.js → config-guard-CCOBZ77Q.js} +1 -1
- package/dist/{configure-CGTBBLR_.js → configure-CkGsX5z9.js} +9 -9
- package/dist/{configure-Dpk4lSoz.js → configure-D-9Ezgal.js} +11 -11
- package/dist/{configure-jlAKeuki.js → configure-DxKMnCHX.js} +40 -40
- package/dist/{configure-CH_-SNya.js → configure-KP7q9c7h.js} +4 -4
- package/dist/{control-service-CUhnhmpc.js → control-service-D3rS-Yd1.js} +3 -3
- package/dist/{cron-cli-CKs1evSF.js → cron-cli-3QY_K0l_.js} +1 -1
- package/dist/{daemon-cli-CSCFNzUo.js → daemon-cli-NZ84KRN8.js} +3 -3
- package/dist/{deliver-BYxbDIF0.js → deliver-BJn4EmMZ.js} +1 -1
- package/dist/{deliver-DkF6LCoS.js → deliver-BhezvxNA.js} +4 -4
- package/dist/{deps-D9266xfk.js → deps-CBLy0fqA.js} +1 -1
- package/dist/{dispatcher-BeO47t7A.js → dispatcher-Bk0gFz4b.js} +1 -1
- package/dist/{doctor-DJfgnQ67.js → doctor-Bto-K3wL.js} +16 -16
- package/dist/{doctor-CWmHUAjs.js → doctor-DsRSWr6B.js} +5 -5
- package/dist/{doctor-completion-CtCwd1fi.js → doctor-completion-B-SFdu-f.js} +1 -1
- package/dist/{doctor-completion-CmJmktDv.js → doctor-completion-OQXTo6RG.js} +1 -1
- package/dist/{doctor-config-flow-D_8YNTSK.js → doctor-config-flow-CEkHIHe5.js} +1 -1
- package/dist/entry.js +1 -1
- package/dist/extensionAPI.js +1531 -411
- package/dist/{frontmatter-BmBmtOUh.js → frontmatter-Dsa7N963.js} +1 -1
- package/dist/{gateway-cli-DYrzIvOE.js → gateway-cli-Buxz8Y2n.js} +17 -17
- package/dist/{gateway-cli-BazTmg20.js → gateway-cli-CEGPCQ_C.js} +52 -52
- package/dist/{health-BRSKF_iF.js → health-CMIY7xAI.js} +12 -12
- package/dist/{health-JqtB_B8C.js → health-DoGFlPcq.js} +6 -6
- package/dist/{heartbeat-visibility-BGj2czmk.js → heartbeat-visibility-BOyU9ccw.js} +2 -2
- package/dist/{heartbeat-visibility-pyFf6XBW.js → heartbeat-visibility-DuRmIKOk.js} +2 -2
- package/dist/{hooks-cli-B7g3jEC3.js → hooks-cli-B1NXXLxe.js} +30 -30
- package/dist/{hooks-cli-ZK4Z044T.js → hooks-cli-BuIU6v0Q.js} +6 -6
- package/dist/index.js +11 -11
- package/dist/{installs-DBvIs2By.js → installs-Drds9RDI.js} +1 -1
- package/dist/{lanes-DyM6NSSL.js → lanes-4_8h1ZQO.js} +274 -12
- package/dist/llm-slug-generator.js +10 -10
- package/dist/{login-BbfWLOBl.js → login-DwP4KleZ.js} +2 -2
- package/dist/{login-qr-BqhujMcQ.js → login-qr-wnynuvLt.js} +5 -5
- package/dist/{manager-CcawxgaC.js → manager-ibNP7jE3.js} +2 -2
- package/dist/{manager-DS1DfkbC.js → manager-j0ghUvcW.js} +4 -4
- package/dist/{media-IIqSkFpd.js → media-BLVMhFB3.js} +2 -2
- package/dist/{memory-cli-wDO418hx.js → memory-cli-DSWsPuub.js} +6 -6
- package/dist/{model-auth-Uxm-wRjR.js → model-auth-BKf-GZVK.js} +3 -3
- package/dist/{models-tQnX4hL4.js → models-BU0CytAy.js} +32 -32
- package/dist/{node-cli-DAcW-rfA.js → node-cli-DcwOFcxq.js} +8 -8
- package/dist/{onboard-Dd6xFMYB.js → onboard-Dd5wJkeU.js} +6 -6
- package/dist/{onboard-dasbF9G1.js → onboard-c84IExbH.js} +4 -4
- package/dist/{onboard-channels-DisvVyIs.js → onboard-channels-CCoMzCXV.js} +3 -3
- package/dist/{onboard-channels-BUv3VbAL.js → onboard-channels-DYr7fQZq.js} +1 -1
- package/dist/{onboard-helpers-49TVSf7J.js → onboard-helpers-BRp_xJvW.js} +1 -1
- package/dist/{onboarding-Dq3bCBjc.js → onboarding-192Oe9K6.js} +8 -8
- package/dist/{onboarding-6Xs4orLw.js → onboarding-BINruD5r.js} +4 -4
- package/dist/{outbound-CliT3nme.js → outbound-BVSyNp-t.js} +1 -1
- package/dist/{outbound-CLII4C2A.js → outbound-BaBDhLp1.js} +1 -1
- package/dist/{parse-timeout-BnOIKwx8.js → parse-timeout-C1INlSUG.js} +2 -2
- package/dist/{pi-auth-json-DLroEcea.js → pi-auth-json-BSLIRI41.js} +2 -2
- package/dist/{pi-embedded-CS4D_0t7.js → pi-embedded-DJF_gfcQ.js} +667 -372
- package/dist/{pi-tools.policy-RhdERrk3.js → pi-tools.policy-Dtytaq21.js} +3 -3
- package/dist/{plugin-registry-l3z9phEV.js → plugin-registry-B0k-53-_.js} +1 -1
- package/dist/{plugin-registry-esOxvV3X.js → plugin-registry-CqUo-PU_.js} +1 -1
- package/dist/plugin-sdk/agents/gemini-direct-runner.d.ts +38 -0
- package/dist/plugin-sdk/commands/onboard-types.d.ts +2 -2
- package/dist/{plugins-cli-D2v0n4BL.js → plugins-cli-BYLUFsjH.js} +33 -33
- package/dist/{plugins-cli-CbXtuN4b.js → plugins-cli-YjM8IsVo.js} +6 -6
- package/dist/{ports-DyX87qKc.js → ports-BmSDzOHm.js} +1 -1
- package/dist/{ports-COy7Yg_k.js → ports-Bv3sZ3bd.js} +1 -1
- package/dist/{program-y0NPJuYm.js → program-CG5u1KAB.js} +36 -36
- package/dist/{program-context-CqPwmgYa.js → program-context-Co2gkUS0.js} +16 -16
- package/dist/{prompts-DTKoIKPV.js → prompts-DjKZfP5R.js} +67 -4
- package/dist/{prompts-DY0qdoD1.js → prompts-NvPXbNVc.js} +12 -1
- package/dist/{pw-ai-CJgeaF06.js → pw-ai-C3j5kV3T.js} +1 -1
- package/dist/{pw-ai-A7vggLw8.js → pw-ai-CvxTpFmB.js} +3 -3
- package/dist/{qmd-manager-DQsAtmK7.js → qmd-manager-BDq5_dd6.js} +2 -2
- package/dist/{register.agent-Bi2FqIlN.js → register.agent-PbAKdlNK.js} +10 -10
- package/dist/{register.agent-CRazop1A.js → register.agent-WAjZHuZe.js} +38 -38
- package/dist/{register.anima-FFaI_C8x.js → register.anima-CDcnWfQF.js} +2 -2
- package/dist/{register.anima-BmdRCJLy.js → register.anima-CZNjkwJH.js} +2 -2
- package/dist/{register.configure-FIXOWrO9.js → register.configure-C2zfgyp9.js} +39 -39
- package/dist/{register.configure-r5AViY3N.js → register.configure-CNhagtHN.js} +10 -10
- package/dist/{register.maintenance-Cpf0ZZTL.js → register.maintenance-DWJjWsIl.js} +11 -11
- package/dist/{register.maintenance-DJYji5mV.js → register.maintenance-DkF1Nu_y.js} +39 -39
- package/dist/{register.onboard-thGXwzOX.js → register.onboard-DiZzjEwz.js} +13 -13
- package/dist/{register.onboard-oUsWjmam.js → register.onboard-xOXNrMu-.js} +41 -41
- package/dist/{register.setup-B4MYuE3g.js → register.setup-BmbpgUVU.js} +41 -41
- package/dist/{register.setup-DWDrQ7RT.js → register.setup-QAjNkIZr.js} +13 -13
- package/dist/{register.status-health-sessions-CTKdzo7a.js → register.status-health-sessions-Cm-lxcT6.js} +37 -37
- package/dist/{register.status-health-sessions-Ce9QUAyj.js → register.status-health-sessions-RZxaVSa6.js} +7 -7
- package/dist/{register.subclis-CWmYc4AB.js → register.subclis-DCljHJ5a.js} +13 -13
- package/dist/{reply-CpHIJ9Kk.js → reply-Bw4torMz.js} +30 -30
- package/dist/{reply-BKpIrCr-.js → reply-Dd3EmI4M.js} +5 -5
- package/dist/{reply-prefix-BO_Dt82N.js → reply-prefix-DIoRETAD.js} +2 -2
- package/dist/{reply-prefix-BwVBvQXp.js → reply-prefix-Dy_yxyCq.js} +2 -2
- package/dist/{routes-XhTPYecR.js → routes-CNSdZAkl.js} +3 -3
- package/dist/{run--9hftM2H.js → run--R4y3YlU.js} +41 -41
- package/dist/{run-CGokiDR8.js → run-DgtaDzEe.js} +15 -15
- package/dist/{run-main-DxcOzCLw.js → run-main-eUWh86lF.js} +47 -47
- package/dist/{sandbox-CiwAPzO7.js → sandbox-BoNWDo4X.js} +1 -1
- package/dist/{sandbox-cli-DsrzwG_s.js → sandbox-cli-lbp0TV67.js} +10 -10
- package/dist/{security-cli-CouqfUGc.js → security-cli-CfvP5VqT.js} +13 -13
- package/dist/{server-context-B78_sSOW.js → server-context-IfJbmK25.js} +6 -6
- package/dist/{server-node-events-DJlLCF2M.js → server-node-events-BG4e9Ws7.js} +5 -5
- package/dist/{server-node-events-TN_Y9MgU.js → server-node-events-CFCwOP0n.js} +18 -18
- package/dist/{session-cost-usage-vltn5akf.js → session-cost-usage-lLyz71EH.js} +1 -1
- package/dist/{sessions-B7clh58j.js → sessions-BZgIAOwH.js} +2 -2
- package/dist/{sessions-B7ikzhI_.js → sessions-C3bteMLZ.js} +3 -3
- package/dist/{settings-cli-JU5bg5jb.js → settings-cli-C9TMl9Ye.js} +11 -11
- package/dist/{settings-cli-DjVugHID.js → settings-cli-Cf0LCRjt.js} +40 -40
- package/dist/{setup-token-CvRwJUVY.js → setup-token-DBwe6GDq.js} +1 -1
- package/dist/{setup-token-wFsQlaW2.js → setup-token-DTgSXfj7.js} +14 -14
- package/dist/{shell-env-C1yK_Rod.js → shell-env-V934Ymrk.js} +1 -1
- package/dist/{skill-scanner-BzOYLFR8.js → skill-scanner-DPQDhVEr.js} +1 -1
- package/dist/{skills-install-D_bxdc-6.js → skills-install-CC63dOs4.js} +2 -2
- package/dist/{sqlite-jyjat2Yt.js → sqlite-Co_lF3s-.js} +1 -1
- package/dist/{start-M9abr1O1.js → start-B2DQAmEK.js} +17 -17
- package/dist/{start-CAbxlnFZ.js → start-CHLGEHeF.js} +50 -50
- package/dist/{status-YH65ctig.js → status-BsCeWiLS.js} +1 -1
- package/dist/{status-1TjjCE1l.js → status-C4ZTdSwA.js} +14 -14
- package/dist/{status-CxxXFU4R.js → status-CwjUrZ7a.js} +4 -4
- package/dist/{status-CrJV2Y4x.js → status-D_FTGxBZ.js} +1 -1
- package/dist/{status.update-BzAuf_G-.js → status.update-Cx5l38lC.js} +1 -1
- package/dist/{subagent-registry-xJY9wqZy.js → subagent-registry-7qo93ip8.js} +2 -2
- package/dist/{subagent-registry-3Dw3YppH.js → subagent-registry-EoZxIEKl.js} +8 -8
- package/dist/{subagent-registry-B_65nJFp.js → subagent-registry-hRt-aJnL.js} +9 -9
- package/dist/{timeout-Dbspj9Jf.js → timeout-B0mCaCG5.js} +275 -13
- package/dist/{pi-embedded-helpers-DnRfi8bN.js → tokens-DXjI-TIV.js} +19 -19
- package/dist/{tool-images-y_Ribdl6.js → tool-images-09hnvylP.js} +1 -1
- package/dist/{tui--eIVX_W0.js → tui-LRoQ5xyx.js} +2 -2
- package/dist/{tui-cli-DBV3lnXA.js → tui-cli-DO_6-GWy.js} +14 -14
- package/dist/{update-VFbS9X5L.js → update-DmVSt9s3.js} +1 -1
- package/dist/{update-cli-QP5L8xlv.js → update-cli-CnYFvEud.js} +11 -11
- package/dist/{update-cli-BzaQvirL.js → update-cli-jEzmvaqS.js} +44 -44
- package/dist/{update-runner-B_oj7S_n.js → update-runner-IARYjXbS.js} +2 -2
- package/dist/{update-runner-ZuJN8uBE.js → update-runner-OPbRGUfX.js} +1 -1
- package/dist/{usage-DzKbMa8N.js → usage-BTc8TK3f.js} +6 -6
- package/dist/{web-nI3eIGAT.js → web-Honf40Cm.js} +31 -31
- package/dist/{web-CgQc2Raf.js → web-kEraFv8s.js} +28 -28
- package/dist/{web-DtWSf5wm.js → web-u554zkLK.js} +7 -7
- package/dist/{whatsapp-actions-BzPQUcRR.js → whatsapp-actions-I9RXDK_k.js} +6 -6
- package/dist/{whatsapp-actions-CZuxHplg.js → whatsapp-actions-_BrQebuX.js} +5 -5
- package/package.json +1 -1
- /package/dist/{auth-DuBZWd74.js → auth-DK-0XxZU.js} +0 -0
- /package/dist/{boolean-M-esQJt6.js → boolean-Ce2-qkSB.js} +0 -0
- /package/dist/{errors-l_q3lLBC.js → errors-B9FgVZ2s.js} +0 -0
- /package/dist/{image-ops-BVtm-rU-.js → image-ops-BsXjYj1e.js} +0 -0
- /package/dist/{internal-hooks-Exeq-wmx.js → internal-hooks-CZOlj8zG.js} +0 -0
- /package/dist/{model-selection-xZLlICyg.js → model-selection-DT-L7bjC.js} +0 -0
- /package/dist/{paths-B_RPJLsn.js → paths-CxBUgtZS.js} +0 -0
- /package/dist/{pi-embedded-helpers-Cxzk0pra.js → pi-embedded-helpers-CWl0I3Qm.js} +0 -0
- /package/dist/{plugins-CFBEoAN4.js → plugins-BDSP0cT6.js} +0 -0
- /package/dist/{tokens-DLpZ8RFH.js → tokens-QjoPADtG.js} +0 -0
- /package/dist/{transcript-events-CJRvASY_.js → transcript-events-DdnTeoR1.js} +0 -0
|
@@ -5,10 +5,12 @@ import { u as resolveSessionAgentIds } from "./agent-scope-BLiq3nK_.js";
|
|
|
5
5
|
import { c as normalizeProviderId } from "./model-selection-C2dAUmK_.js";
|
|
6
6
|
import { t as isTruthyEnvValue } from "./env-T3-raV4i.js";
|
|
7
7
|
import { u as loadAuthProfileStore } from "./auth-profiles-BhZX2spm.js";
|
|
8
|
-
import {
|
|
8
|
+
import { i as resolveApiKeyForProvider } from "./model-auth-DVG37yXU.js";
|
|
9
|
+
import { J as resolveAnimaDocsPath, Q as resolveHeartbeatPrompt, a as buildSystemPrompt, c as enqueueCliRun, d as parseCliJsonl, et as makeBootstrapWarn, f as resolvePromptInput, h as writeCliImages, i as buildCliArgs, l as normalizeCliModel, m as resolveSystemPromptUsage, o as cleanupResumeProcesses, ot as redactRunIdentifier, p as resolveSessionIdToSend, r as appendImagePathsToPrompt, s as cleanupSuspendedCliProcesses, st as resolveRunWorkspaceDir, t as runAnthropicDirectAgent, tt as resolveBootstrapContextForRun, u as parseCliJson } from "./anthropic-direct-runner--MPTWkYA.js";
|
|
9
10
|
import { existsSync } from "node:fs";
|
|
10
|
-
import { homedir } from "node:os";
|
|
11
|
-
import { join } from "node:path";
|
|
11
|
+
import os, { homedir } from "node:os";
|
|
12
|
+
import path, { join } from "node:path";
|
|
13
|
+
import fs$1 from "node:fs/promises";
|
|
12
14
|
import crypto from "node:crypto";
|
|
13
15
|
|
|
14
16
|
//#region src/agents/timeout.ts
|
|
@@ -329,7 +331,7 @@ function coerceToFailoverError(err, context) {
|
|
|
329
331
|
|
|
330
332
|
//#endregion
|
|
331
333
|
//#region src/agents/cli-runner.ts
|
|
332
|
-
const log = createSubsystemLogger("agent/claude-cli");
|
|
334
|
+
const log$1 = createSubsystemLogger("agent/claude-cli");
|
|
333
335
|
async function runCliAgent(params) {
|
|
334
336
|
const started = Date.now();
|
|
335
337
|
const workspaceResolution = resolveRunWorkspaceDir({
|
|
@@ -342,7 +344,7 @@ async function runCliAgent(params) {
|
|
|
342
344
|
const redactedSessionId = redactRunIdentifier(params.sessionId);
|
|
343
345
|
const redactedSessionKey = redactRunIdentifier(params.sessionKey);
|
|
344
346
|
const redactedWorkspace = redactRunIdentifier(resolvedWorkspace);
|
|
345
|
-
if (workspaceResolution.usedFallback) log.warn(`[workspace-fallback] caller=runCliAgent reason=${workspaceResolution.fallbackReason} run=${params.runId} session=${redactedSessionId} sessionKey=${redactedSessionKey} agent=${workspaceResolution.agentId} workspace=${redactedWorkspace}`);
|
|
347
|
+
if (workspaceResolution.usedFallback) log$1.warn(`[workspace-fallback] caller=runCliAgent reason=${workspaceResolution.fallbackReason} run=${params.runId} session=${redactedSessionId} sessionKey=${redactedSessionKey} agent=${workspaceResolution.agentId} workspace=${redactedWorkspace}`);
|
|
346
348
|
const workspaceDir = resolvedWorkspace;
|
|
347
349
|
const backendResolved = resolveCliBackendConfig(params.provider, params.config);
|
|
348
350
|
if (!backendResolved) throw new Error(`Unknown CLI backend: ${params.provider}`);
|
|
@@ -359,7 +361,7 @@ async function runCliAgent(params) {
|
|
|
359
361
|
sessionId: params.sessionId,
|
|
360
362
|
warn: makeBootstrapWarn({
|
|
361
363
|
sessionLabel,
|
|
362
|
-
warn: (message) => log.warn(message)
|
|
364
|
+
warn: (message) => log$1.warn(message)
|
|
363
365
|
})
|
|
364
366
|
});
|
|
365
367
|
const { defaultAgentId, sessionAgentId } = resolveSessionAgentIds({
|
|
@@ -432,7 +434,7 @@ async function runCliAgent(params) {
|
|
|
432
434
|
const queueKey = backend.serialize ?? true ? backendResolved.id : `${backendResolved.id}:${params.runId}`;
|
|
433
435
|
try {
|
|
434
436
|
const output = await enqueueCliRun(queueKey, async () => {
|
|
435
|
-
log.info(`cli exec: provider=${params.provider} model=${normalizedModel} promptChars=${params.prompt.length}`);
|
|
437
|
+
log$1.info(`cli exec: provider=${params.provider} model=${normalizedModel} promptChars=${params.prompt.length}`);
|
|
436
438
|
const logOutputText = isTruthyEnvValue(process.env.ANIMA_CLAUDE_CLI_LOG_OUTPUT);
|
|
437
439
|
if (logOutputText) {
|
|
438
440
|
const logArgs = [];
|
|
@@ -465,7 +467,7 @@ async function runCliAgent(params) {
|
|
|
465
467
|
const promptIndex = logArgs.indexOf(argsPrompt);
|
|
466
468
|
if (promptIndex >= 0) logArgs[promptIndex] = `<prompt:${argsPrompt.length} chars>`;
|
|
467
469
|
}
|
|
468
|
-
log.info(`cli argv: ${backend.command} ${logArgs.join(" ")}`);
|
|
470
|
+
log$1.info(`cli argv: ${backend.command} ${logArgs.join(" ")}`);
|
|
469
471
|
}
|
|
470
472
|
const env = (() => {
|
|
471
473
|
const next = {
|
|
@@ -498,12 +500,12 @@ async function runCliAgent(params) {
|
|
|
498
500
|
const stdout = result.stdout.trim();
|
|
499
501
|
const stderr = result.stderr.trim();
|
|
500
502
|
if (logOutputText) {
|
|
501
|
-
if (stdout) log.info(`cli stdout:\n${stdout}`);
|
|
502
|
-
if (stderr) log.info(`cli stderr:\n${stderr}`);
|
|
503
|
+
if (stdout) log$1.info(`cli stdout:\n${stdout}`);
|
|
504
|
+
if (stderr) log$1.info(`cli stderr:\n${stderr}`);
|
|
503
505
|
}
|
|
504
506
|
if (shouldLogVerbose()) {
|
|
505
|
-
if (stdout) log.debug(`cli stdout:\n${stdout}`);
|
|
506
|
-
if (stderr) log.debug(`cli stderr:\n${stderr}`);
|
|
507
|
+
if (stdout) log$1.debug(`cli stdout:\n${stdout}`);
|
|
508
|
+
if (stderr) log$1.debug(`cli stderr:\n${stderr}`);
|
|
507
509
|
}
|
|
508
510
|
if (result.code !== 0) {
|
|
509
511
|
const err = stderr || stdout || "CLI failed.";
|
|
@@ -556,6 +558,215 @@ async function runCliAgent(params) {
|
|
|
556
558
|
}
|
|
557
559
|
}
|
|
558
560
|
|
|
561
|
+
//#endregion
|
|
562
|
+
//#region src/agents/gemini-direct-runner.ts
|
|
563
|
+
/**
|
|
564
|
+
* Gemini Direct API Runner
|
|
565
|
+
*
|
|
566
|
+
* Makes calls directly to generativelanguage.googleapis.com without needing
|
|
567
|
+
* a CLI wrapper. Works with Google API keys (GEMINI_API_KEY).
|
|
568
|
+
*
|
|
569
|
+
* This runner is automatically used when a google API key is available
|
|
570
|
+
* and the provider is set to "google" or "gemini".
|
|
571
|
+
*/
|
|
572
|
+
const log = createSubsystemLogger("agent/gemini-direct");
|
|
573
|
+
const DEFAULT_GEMINI_BASE_URL = "https://generativelanguage.googleapis.com/v1beta";
|
|
574
|
+
const MODEL_MAP = {
|
|
575
|
+
gemini: "gemini-2.0-flash",
|
|
576
|
+
"gemini-pro": "gemini-1.5-pro",
|
|
577
|
+
"gemini-flash": "gemini-2.0-flash",
|
|
578
|
+
"gemini-2.0": "gemini-2.0-flash",
|
|
579
|
+
"gemini-2.0-flash": "gemini-2.0-flash",
|
|
580
|
+
"gemini-2.0-pro": "gemini-2.0-pro-exp-02-05",
|
|
581
|
+
"gemini-1.5": "gemini-1.5-pro",
|
|
582
|
+
"gemini-1.5-pro": "gemini-1.5-pro",
|
|
583
|
+
"gemini-1.5-flash": "gemini-1.5-flash",
|
|
584
|
+
default: "gemini-2.0-flash"
|
|
585
|
+
};
|
|
586
|
+
const HISTORY_FILE_SUFFIX = ".gemini-history.json";
|
|
587
|
+
async function loadSessionHistory(sessionFile) {
|
|
588
|
+
const histPath = sessionFile + HISTORY_FILE_SUFFIX;
|
|
589
|
+
try {
|
|
590
|
+
const raw = await fs$1.readFile(histPath, "utf8");
|
|
591
|
+
return JSON.parse(raw);
|
|
592
|
+
} catch {
|
|
593
|
+
return null;
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
async function saveSessionHistory(sessionFile, history) {
|
|
597
|
+
const histPath = sessionFile + HISTORY_FILE_SUFFIX;
|
|
598
|
+
try {
|
|
599
|
+
await fs$1.mkdir(path.dirname(histPath), { recursive: true });
|
|
600
|
+
await fs$1.writeFile(histPath, JSON.stringify(history, null, 2), "utf8");
|
|
601
|
+
} catch (err) {
|
|
602
|
+
log.warn("failed to save session history", { error: String(err) });
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
function resolveModel(model) {
|
|
606
|
+
const key = (model ?? "default").trim().toLowerCase() || "default";
|
|
607
|
+
return MODEL_MAP[key] ?? key;
|
|
608
|
+
}
|
|
609
|
+
function buildModelPath(model) {
|
|
610
|
+
return model.startsWith("models/") ? model : `models/${model}`;
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
* Run an agent turn directly against generativelanguage.googleapis.com.
|
|
614
|
+
*
|
|
615
|
+
* Maintains multi-turn conversation history per session file.
|
|
616
|
+
* Falls back to single-turn if history is unavailable.
|
|
617
|
+
*/
|
|
618
|
+
async function runGeminiDirectAgent(params) {
|
|
619
|
+
const started = Date.now();
|
|
620
|
+
const resolvedModel = resolveModel(params.model);
|
|
621
|
+
const modelPath = buildModelPath(resolvedModel);
|
|
622
|
+
log.info(`direct api exec: model=${resolvedModel} promptChars=${params.prompt.length}`);
|
|
623
|
+
const workspaceDir = resolveRunWorkspaceDir({
|
|
624
|
+
workspaceDir: params.workspaceDir,
|
|
625
|
+
sessionKey: params.sessionKey,
|
|
626
|
+
agentId: params.agentId,
|
|
627
|
+
config: params.config
|
|
628
|
+
}).workspaceDir;
|
|
629
|
+
const { contextFiles } = await resolveBootstrapContextForRun({
|
|
630
|
+
workspaceDir,
|
|
631
|
+
config: params.config,
|
|
632
|
+
sessionKey: params.sessionKey,
|
|
633
|
+
sessionId: params.sessionId,
|
|
634
|
+
warn: makeBootstrapWarn({
|
|
635
|
+
sessionLabel: params.sessionKey ?? params.sessionId,
|
|
636
|
+
warn: (msg) => log.warn(msg)
|
|
637
|
+
})
|
|
638
|
+
});
|
|
639
|
+
const { defaultAgentId, sessionAgentId } = resolveSessionAgentIds({
|
|
640
|
+
sessionKey: params.sessionKey,
|
|
641
|
+
config: params.config
|
|
642
|
+
});
|
|
643
|
+
const heartbeatPrompt = sessionAgentId === defaultAgentId ? resolveHeartbeatPrompt(params.config?.agents?.defaults?.heartbeat?.prompt) : void 0;
|
|
644
|
+
const docsPath = await resolveAnimaDocsPath({
|
|
645
|
+
workspaceDir,
|
|
646
|
+
argv1: process.argv[1],
|
|
647
|
+
cwd: process.cwd(),
|
|
648
|
+
moduleUrl: import.meta.url
|
|
649
|
+
});
|
|
650
|
+
const extraSystemPrompt = [params.extraSystemPrompt?.trim(), "Tools are disabled in this session. Do not call tools."].filter(Boolean).join("\n");
|
|
651
|
+
const systemPrompt = buildSystemPrompt({
|
|
652
|
+
workspaceDir,
|
|
653
|
+
config: params.config,
|
|
654
|
+
defaultThinkLevel: params.thinkLevel,
|
|
655
|
+
extraSystemPrompt,
|
|
656
|
+
ownerNumbers: params.ownerNumbers,
|
|
657
|
+
heartbeatPrompt,
|
|
658
|
+
docsPath: docsPath ?? void 0,
|
|
659
|
+
tools: [],
|
|
660
|
+
contextFiles,
|
|
661
|
+
modelDisplay: `google/${resolvedModel}`,
|
|
662
|
+
agentId: sessionAgentId
|
|
663
|
+
});
|
|
664
|
+
let history = await loadSessionHistory(params.sessionFile);
|
|
665
|
+
if (!history) history = {
|
|
666
|
+
sessionId: params.sessionId,
|
|
667
|
+
contents: [],
|
|
668
|
+
createdAt: started,
|
|
669
|
+
updatedAt: started
|
|
670
|
+
};
|
|
671
|
+
history.contents.push({
|
|
672
|
+
role: "user",
|
|
673
|
+
parts: [{ text: params.prompt }]
|
|
674
|
+
});
|
|
675
|
+
const requestBody = {
|
|
676
|
+
systemInstruction: { parts: [{ text: systemPrompt }] },
|
|
677
|
+
contents: history.contents,
|
|
678
|
+
generationConfig: {
|
|
679
|
+
maxOutputTokens: 8192,
|
|
680
|
+
temperature: 1
|
|
681
|
+
}
|
|
682
|
+
};
|
|
683
|
+
try {
|
|
684
|
+
const controller = new AbortController();
|
|
685
|
+
const timeoutHandle = setTimeout(() => controller.abort(), params.timeoutMs);
|
|
686
|
+
const url = `${DEFAULT_GEMINI_BASE_URL}/${modelPath}:generateContent?key=${params.apiKey}`;
|
|
687
|
+
const response = await fetch(url, {
|
|
688
|
+
method: "POST",
|
|
689
|
+
headers: {
|
|
690
|
+
"Content-Type": "application/json",
|
|
691
|
+
"User-Agent": `anima/5.0.1 (gemini-direct-runner; ${os.platform()})`
|
|
692
|
+
},
|
|
693
|
+
body: JSON.stringify(requestBody),
|
|
694
|
+
signal: controller.signal
|
|
695
|
+
});
|
|
696
|
+
clearTimeout(timeoutHandle);
|
|
697
|
+
if (!response.ok) {
|
|
698
|
+
const body = await response.text().catch(() => "");
|
|
699
|
+
const isAuth = response.status === 401 || response.status === 403;
|
|
700
|
+
const isRateLimit = response.status === 429;
|
|
701
|
+
const rateHint = isRateLimit ? " — rate limit hit, will retry next heartbeat." : "";
|
|
702
|
+
const authHint = isAuth ? " — API key may be invalid. Check GEMINI_API_KEY environment variable." : "";
|
|
703
|
+
log.error(`gemini api error: HTTP ${response.status}${authHint}${rateHint}`, {
|
|
704
|
+
status: response.status,
|
|
705
|
+
body: body.slice(0, 500)
|
|
706
|
+
});
|
|
707
|
+
return {
|
|
708
|
+
status: "failed",
|
|
709
|
+
meta: {
|
|
710
|
+
durationMs: Date.now() - started,
|
|
711
|
+
error: {
|
|
712
|
+
message: `HTTP ${response.status}: ${body.slice(0, 200)}${authHint}${rateHint}`,
|
|
713
|
+
kind: isAuth ? "auth" : isRateLimit ? "rate_limit" : "unknown"
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
};
|
|
717
|
+
}
|
|
718
|
+
const data = await response.json();
|
|
719
|
+
const candidate = data.candidates?.[0];
|
|
720
|
+
const assistantText = (candidate?.content?.parts ?? []).filter((p) => typeof p.text === "string").map((p) => p.text).join("\n");
|
|
721
|
+
if (assistantText && params.onPartialReply) await params.onPartialReply({ text: assistantText });
|
|
722
|
+
if (assistantText) {
|
|
723
|
+
history.contents.push({
|
|
724
|
+
role: "model",
|
|
725
|
+
parts: [{ text: assistantText }]
|
|
726
|
+
});
|
|
727
|
+
history.updatedAt = Date.now();
|
|
728
|
+
await saveSessionHistory(params.sessionFile, history);
|
|
729
|
+
}
|
|
730
|
+
const usage = data.usageMetadata;
|
|
731
|
+
const durationMs = Date.now() - started;
|
|
732
|
+
log.info(`gemini api complete: ${durationMs}ms`, {
|
|
733
|
+
inputTokens: usage?.promptTokenCount,
|
|
734
|
+
outputTokens: usage?.candidatesTokenCount,
|
|
735
|
+
finishReason: candidate?.finishReason
|
|
736
|
+
});
|
|
737
|
+
return {
|
|
738
|
+
status: "completed",
|
|
739
|
+
output: assistantText,
|
|
740
|
+
meta: {
|
|
741
|
+
durationMs,
|
|
742
|
+
agentMeta: {
|
|
743
|
+
model: resolvedModel,
|
|
744
|
+
provider: "google",
|
|
745
|
+
usage: usage ? {
|
|
746
|
+
input: usage.promptTokenCount ?? 0,
|
|
747
|
+
output: usage.candidatesTokenCount ?? 0
|
|
748
|
+
} : void 0
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
};
|
|
752
|
+
} catch (err) {
|
|
753
|
+
const isAbort = err instanceof Error && err.name === "AbortError";
|
|
754
|
+
const errorKind = isAbort ? "timeout" : "unknown";
|
|
755
|
+
const errorMsg = isAbort ? `Request timed out after ${params.timeoutMs}ms` : String(err);
|
|
756
|
+
log.error(`gemini api error: ${errorMsg}`, { error: String(err) });
|
|
757
|
+
return {
|
|
758
|
+
status: "failed",
|
|
759
|
+
meta: {
|
|
760
|
+
durationMs: Date.now() - started,
|
|
761
|
+
error: {
|
|
762
|
+
message: errorMsg,
|
|
763
|
+
kind: errorKind
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
};
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
|
|
559
770
|
//#endregion
|
|
560
771
|
//#region src/agents/pi-embedded.ts
|
|
561
772
|
function normalizeEmbeddedProvider(provider) {
|
|
@@ -637,6 +848,57 @@ async function runEmbeddedPiAgent(...args) {
|
|
|
637
848
|
}
|
|
638
849
|
}
|
|
639
850
|
}
|
|
851
|
+
if (provider === "google" || provider === "gemini") {
|
|
852
|
+
const geminiApiKey = (await resolveApiKeyForProvider({
|
|
853
|
+
provider: "google",
|
|
854
|
+
cfg: params.config
|
|
855
|
+
}))?.apiKey;
|
|
856
|
+
if (geminiApiKey) {
|
|
857
|
+
await emitAgentEvent$1(params, "lifecycle", {
|
|
858
|
+
phase: "start",
|
|
859
|
+
startedAt
|
|
860
|
+
});
|
|
861
|
+
try {
|
|
862
|
+
const result = await runGeminiDirectAgent({
|
|
863
|
+
apiKey: geminiApiKey,
|
|
864
|
+
sessionId: params.sessionId,
|
|
865
|
+
sessionKey: params.sessionKey,
|
|
866
|
+
agentId: params.agentId,
|
|
867
|
+
sessionFile: params.sessionFile,
|
|
868
|
+
workspaceDir: params.workspaceDir,
|
|
869
|
+
config: params.config,
|
|
870
|
+
prompt: params.prompt,
|
|
871
|
+
model: params.model,
|
|
872
|
+
thinkLevel: params.thinkLevel,
|
|
873
|
+
timeoutMs,
|
|
874
|
+
runId,
|
|
875
|
+
extraSystemPrompt: params.extraSystemPrompt,
|
|
876
|
+
ownerNumbers: params.ownerNumbers,
|
|
877
|
+
onPartialReply: async (payload) => {
|
|
878
|
+
if (!assistantStarted) {
|
|
879
|
+
assistantStarted = true;
|
|
880
|
+
await params.onAssistantMessageStart?.();
|
|
881
|
+
}
|
|
882
|
+
await params.onPartialReply?.(payload);
|
|
883
|
+
await emitAgentEvent$1(params, "assistant", { text: payload.text });
|
|
884
|
+
},
|
|
885
|
+
onAssistantMessageStart: params.onAssistantMessageStart
|
|
886
|
+
});
|
|
887
|
+
await emitAgentEvent$1(params, "lifecycle", {
|
|
888
|
+
phase: "end",
|
|
889
|
+
durationMs: Date.now() - startedAt,
|
|
890
|
+
status: result.status
|
|
891
|
+
});
|
|
892
|
+
return result;
|
|
893
|
+
} catch (err) {
|
|
894
|
+
await emitAgentEvent$1(params, "lifecycle", {
|
|
895
|
+
phase: "error",
|
|
896
|
+
error: String(err instanceof Error ? err.message : err)
|
|
897
|
+
});
|
|
898
|
+
throw err;
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
}
|
|
640
902
|
const cliProvider = resolveCompatCliProvider(provider, params.config);
|
|
641
903
|
if (!resolveCliBackendConfig(cliProvider, params.config)) throw new Error(`No CLI backend available for provider "${provider}" (resolved "${cliProvider}").\nEither:\n • Run: anima setup-token (set an Anthropic API key — no CLI needed)\n • Install the matching CLI and log in`);
|
|
642
904
|
await emitAgentEvent$1(params, "lifecycle", {
|
|
@@ -3,19 +3,19 @@ import "./workspace-DOJssemp.js";
|
|
|
3
3
|
import "./subsystem-WFp78xn1.js";
|
|
4
4
|
import "./exec-DnanRQle.js";
|
|
5
5
|
import { c as resolveDefaultAgentId, r as resolveAgentDir, s as resolveAgentWorkspaceDir } from "./agent-scope-DICrDp7Y.js";
|
|
6
|
-
import "./
|
|
7
|
-
import
|
|
8
|
-
import "./
|
|
9
|
-
import "./boolean-
|
|
10
|
-
import "./shell-env-
|
|
11
|
-
import "./
|
|
12
|
-
import "./chrome-
|
|
13
|
-
import "./frontmatter-
|
|
6
|
+
import { s as runEmbeddedPiAgent } from "./pi-embedded-DJF_gfcQ.js";
|
|
7
|
+
import "./tokens-DXjI-TIV.js";
|
|
8
|
+
import "./config-DezP7V65.js";
|
|
9
|
+
import "./boolean-Ce2-qkSB.js";
|
|
10
|
+
import "./shell-env-V934Ymrk.js";
|
|
11
|
+
import "./model-selection-DT-L7bjC.js";
|
|
12
|
+
import "./chrome-CKvch3UL.js";
|
|
13
|
+
import "./frontmatter-Dsa7N963.js";
|
|
14
14
|
import "./plugins-C_GedoUi.js";
|
|
15
15
|
import "./paths-DybdJi5a.js";
|
|
16
16
|
import "./tool-images-DJZPwGqm.js";
|
|
17
|
-
import "./auth-profiles-
|
|
18
|
-
import "./model-auth-
|
|
17
|
+
import "./auth-profiles-DriJ4HU5.js";
|
|
18
|
+
import "./model-auth-BKf-GZVK.js";
|
|
19
19
|
import fs from "node:fs/promises";
|
|
20
20
|
import os from "node:os";
|
|
21
21
|
import path from "node:path";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { n as __exportAll } from "./chunk-BXK9XSlF.js";
|
|
2
2
|
import { S as success, _ as info, g as danger, n as defaultRuntime } from "./subsystem-WFp78xn1.js";
|
|
3
3
|
import { s as logInfo } from "./exec-DnanRQle.js";
|
|
4
|
-
import { n as loadConfig } from "./config-
|
|
4
|
+
import { n as loadConfig } from "./config-DezP7V65.js";
|
|
5
5
|
import { t as formatCliCommand } from "./command-format-GLYKXXl-.js";
|
|
6
6
|
import { i as logoutWeb } from "./auth-store-BMwyg-WK.js";
|
|
7
|
-
import { a as waitForWaConnection, d as DisconnectReason, n as createWaSocket, r as formatError, t as resolveWhatsAppAccount } from "./accounts-
|
|
7
|
+
import { a as waitForWaConnection, d as DisconnectReason, n as createWaSocket, r as formatError, t as resolveWhatsAppAccount } from "./accounts-CSCVz9k9.js";
|
|
8
8
|
|
|
9
9
|
//#region src/web/login.ts
|
|
10
10
|
var login_exports = /* @__PURE__ */ __exportAll({ loginWeb: () => loginWeb });
|
|
@@ -3,12 +3,12 @@ import "./workspace-DOJssemp.js";
|
|
|
3
3
|
import { S as success, _ as info, g as danger, n as defaultRuntime } from "./subsystem-WFp78xn1.js";
|
|
4
4
|
import { s as logInfo } from "./exec-DnanRQle.js";
|
|
5
5
|
import "./agent-scope-DICrDp7Y.js";
|
|
6
|
-
import "./
|
|
7
|
-
import "./boolean-
|
|
8
|
-
import "./shell-env-
|
|
9
|
-
import
|
|
6
|
+
import { n as loadConfig } from "./config-DezP7V65.js";
|
|
7
|
+
import "./boolean-Ce2-qkSB.js";
|
|
8
|
+
import "./shell-env-V934Ymrk.js";
|
|
9
|
+
import "./model-selection-DT-L7bjC.js";
|
|
10
10
|
import { d as webAuthExists, i as logoutWeb, s as readWebSelfId } from "./auth-store-BMwyg-WK.js";
|
|
11
|
-
import { a as waitForWaConnection, d as DisconnectReason, i as getStatusCode, n as createWaSocket, r as formatError, t as resolveWhatsAppAccount } from "./accounts-
|
|
11
|
+
import { a as waitForWaConnection, d as DisconnectReason, i as getStatusCode, n as createWaSocket, r as formatError, t as resolveWhatsAppAccount } from "./accounts-CSCVz9k9.js";
|
|
12
12
|
import { randomUUID } from "node:crypto";
|
|
13
13
|
import QRCodeModule from "qrcode-terminal/vendor/QRCode/index.js";
|
|
14
14
|
import QRErrorCorrectLevelModule from "qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js";
|
|
@@ -3,11 +3,11 @@ import { s as resolveStateDir } from "./paths-B-AkG5FD.js";
|
|
|
3
3
|
import { t as createSubsystemLogger } from "./subsystem-WFp78xn1.js";
|
|
4
4
|
import { O as sleep, d as clampInt, f as clampNumber$1, j as truncateUtf16Safe, w as resolveUserPath } from "./exec-DnanRQle.js";
|
|
5
5
|
import { n as resolveAgentConfig, r as resolveAgentDir$1, s as resolveAgentWorkspaceDir } from "./agent-scope-DICrDp7Y.js";
|
|
6
|
-
import { s as isTruthyEnvValue } from "./shell-env-
|
|
6
|
+
import { s as isTruthyEnvValue } from "./shell-env-V934Ymrk.js";
|
|
7
7
|
import { n as formatErrorMessage } from "./errors-UbDRvfEx.js";
|
|
8
8
|
import { o as resolveSessionTranscriptsDirForAgent } from "./paths-DybdJi5a.js";
|
|
9
9
|
import { n as onSessionTranscriptUpdate } from "./transcript-events-D0hT93vo.js";
|
|
10
|
-
import { i as resolveApiKeyForProvider, r as requireApiKey } from "./model-auth-
|
|
10
|
+
import { i as resolveApiKeyForProvider, r as requireApiKey } from "./model-auth-BKf-GZVK.js";
|
|
11
11
|
import { a as buildFileEntry, c as ensureDir, d as listMemoryFiles, f as normalizeExtraMemoryPaths, h as runWithConcurrency, i as sessionPathForFile, l as hashText, m as remapChunkLines, n as buildSessionEntry, o as chunkMarkdown, p as parseEmbedding, r as listSessionFilesForAgent, s as cosineSimilarity, t as requireNodeSqlite, u as isMemoryPath } from "./sqlite-CnVGUfhz.js";
|
|
12
12
|
import fs from "node:fs/promises";
|
|
13
13
|
import os from "node:os";
|
|
@@ -2,11 +2,11 @@ import { n as __exportAll } from "./chunk-BXK9XSlF.js";
|
|
|
2
2
|
import { $ as resolveStateDir, n as isTruthyEnvValue, o as createSubsystemLogger } from "./entry.js";
|
|
3
3
|
import { C as sleep, E as truncateUtf16Safe, i as clampNumber$1, r as clampInt, y as resolveUserPath } from "./utils-D1VGbO3C.js";
|
|
4
4
|
import { n as resolveAgentConfig, r as resolveAgentDir$1, s as resolveAgentWorkspaceDir } from "./agent-scope-Dm8IL1Ks.js";
|
|
5
|
-
import { n as formatErrorMessage } from "./errors-
|
|
6
|
-
import { s as resolveSessionTranscriptsDirForAgent } from "./paths-
|
|
7
|
-
import { n as onSessionTranscriptUpdate } from "./transcript-events-
|
|
5
|
+
import { n as formatErrorMessage } from "./errors-B9FgVZ2s.js";
|
|
6
|
+
import { s as resolveSessionTranscriptsDirForAgent } from "./paths-CxBUgtZS.js";
|
|
7
|
+
import { n as onSessionTranscriptUpdate } from "./transcript-events-DdnTeoR1.js";
|
|
8
8
|
import { i as resolveApiKeyForProvider, r as requireApiKey } from "./model-auth-Ja4oelNH.js";
|
|
9
|
-
import { a as buildFileEntry, c as ensureDir, d as listMemoryFiles, f as normalizeExtraMemoryPaths, h as runWithConcurrency, i as sessionPathForFile, l as hashText, m as remapChunkLines, n as buildSessionEntry, o as chunkMarkdown, p as parseEmbedding, r as listSessionFilesForAgent, s as cosineSimilarity, t as requireNodeSqlite, u as isMemoryPath } from "./sqlite-
|
|
9
|
+
import { a as buildFileEntry, c as ensureDir, d as listMemoryFiles, f as normalizeExtraMemoryPaths, h as runWithConcurrency, i as sessionPathForFile, l as hashText, m as remapChunkLines, n as buildSessionEntry, o as chunkMarkdown, p as parseEmbedding, r as listSessionFilesForAgent, s as cosineSimilarity, t as requireNodeSqlite, u as isMemoryPath } from "./sqlite-Co_lF3s-.js";
|
|
10
10
|
import os from "node:os";
|
|
11
11
|
import path from "node:path";
|
|
12
12
|
import fs from "node:fs";
|
|
@@ -3,8 +3,8 @@ import { t as formatCliCommand } from "./command-format-kLw3YIIu.js";
|
|
|
3
3
|
import { c as normalizeAccountId, t as DEFAULT_ACCOUNT_ID } from "./session-key-DP2WHl90.js";
|
|
4
4
|
import { y as resolveUserPath } from "./utils-D1VGbO3C.js";
|
|
5
5
|
import { c as logWarn } from "./exec-BtBJICHE.js";
|
|
6
|
-
import { _ as createPinnedDispatcher, a as resizeToJpeg, b as resolvePinnedHostnameWithPolicy, g as closeDispatcher, h as SsrFBlockedError, i as optimizeImageToPng, m as mediaKindFromMime, o as detectMime, p as maxBytesForKind, r as hasAlphaChannel, s as extensionForMime, t as convertHeicToJpeg } from "./image-ops-
|
|
7
|
-
import { r as normalizeChannelId } from "./plugins-
|
|
6
|
+
import { _ as createPinnedDispatcher, a as resizeToJpeg, b as resolvePinnedHostnameWithPolicy, g as closeDispatcher, h as SsrFBlockedError, i as optimizeImageToPng, m as mediaKindFromMime, o as detectMime, p as maxBytesForKind, r as hasAlphaChannel, s as extensionForMime, t as convertHeicToJpeg } from "./image-ops-BsXjYj1e.js";
|
|
7
|
+
import { r as normalizeChannelId } from "./plugins-BDSP0cT6.js";
|
|
8
8
|
import os from "node:os";
|
|
9
9
|
import path from "node:path";
|
|
10
10
|
import fs from "node:fs/promises";
|
|
@@ -3,10 +3,10 @@ import { $ as resolveStateDir, D as setVerbose, M as isRich, N as theme, g as de
|
|
|
3
3
|
import { S as shortenHomePath, x as shortenHomeInString, y as resolveUserPath } from "./utils-D1VGbO3C.js";
|
|
4
4
|
import { c as resolveDefaultAgentId, s as resolveAgentWorkspaceDir } from "./agent-scope-Dm8IL1Ks.js";
|
|
5
5
|
import { i as loadConfig, m as parseDurationMs } from "./config-D6D_ieel.js";
|
|
6
|
-
import { n as formatErrorMessage } from "./errors-
|
|
7
|
-
import { s as resolveSessionTranscriptsDirForAgent } from "./paths-
|
|
6
|
+
import { n as formatErrorMessage } from "./errors-B9FgVZ2s.js";
|
|
7
|
+
import { s as resolveSessionTranscriptsDirForAgent } from "./paths-CxBUgtZS.js";
|
|
8
8
|
import { t as splitShellArgs } from "./shell-argv-ChJujo6D.js";
|
|
9
|
-
import { d as listMemoryFiles, f as normalizeExtraMemoryPaths } from "./sqlite-
|
|
9
|
+
import { d as listMemoryFiles, f as normalizeExtraMemoryPaths } from "./sqlite-Co_lF3s-.js";
|
|
10
10
|
import { t as formatDocsLink } from "./links-BEV1YSPz.js";
|
|
11
11
|
import { n as withManager } from "./cli-utils-zeGRx7Cp.js";
|
|
12
12
|
import { n as withProgress, r as withProgressTotals } from "./progress-BVxbUItq.js";
|
|
@@ -207,7 +207,7 @@ async function getMemorySearchManager(params) {
|
|
|
207
207
|
if (cached) return { manager: cached };
|
|
208
208
|
}
|
|
209
209
|
try {
|
|
210
|
-
const { QmdMemoryManager } = await import("./qmd-manager-
|
|
210
|
+
const { QmdMemoryManager } = await import("./qmd-manager-BDq5_dd6.js");
|
|
211
211
|
const primary = await QmdMemoryManager.create({
|
|
212
212
|
cfg: params.cfg,
|
|
213
213
|
agentId: params.agentId,
|
|
@@ -219,7 +219,7 @@ async function getMemorySearchManager(params) {
|
|
|
219
219
|
const wrapper = new FallbackMemoryManager({
|
|
220
220
|
primary,
|
|
221
221
|
fallbackFactory: async () => {
|
|
222
|
-
const { MemoryIndexManager } = await import("./manager-
|
|
222
|
+
const { MemoryIndexManager } = await import("./manager-j0ghUvcW.js").then((n) => n.t);
|
|
223
223
|
return await MemoryIndexManager.get(params);
|
|
224
224
|
}
|
|
225
225
|
}, () => QMD_MANAGER_CACHE.delete(cacheKey));
|
|
@@ -232,7 +232,7 @@ async function getMemorySearchManager(params) {
|
|
|
232
232
|
}
|
|
233
233
|
}
|
|
234
234
|
try {
|
|
235
|
-
const { MemoryIndexManager } = await import("./manager-
|
|
235
|
+
const { MemoryIndexManager } = await import("./manager-j0ghUvcW.js").then((n) => n.t);
|
|
236
236
|
return { manager: await MemoryIndexManager.get(params) };
|
|
237
237
|
} catch (err) {
|
|
238
238
|
return {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { t as getShellEnvAppliedKeys } from "./shell-env-V934Ymrk.js";
|
|
2
|
+
import { s as normalizeProviderId } from "./model-selection-DT-L7bjC.js";
|
|
3
3
|
import { t as formatCliCommand } from "./command-format-GLYKXXl-.js";
|
|
4
|
-
import { a as listProfilesForProvider, c as resolveAuthStorePathForDisplay, h as normalizeSecretInput, i as resolveApiKeyForProfile, m as normalizeOptionalSecretInput, n as resolveAuthProfileOrder, o as ensureAuthProfileStore } from "./auth-profiles-
|
|
4
|
+
import { a as listProfilesForProvider, c as resolveAuthStorePathForDisplay, h as normalizeSecretInput, i as resolveApiKeyForProfile, m as normalizeOptionalSecretInput, n as resolveAuthProfileOrder, o as ensureAuthProfileStore } from "./auth-profiles-DriJ4HU5.js";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { getEnvApiKey } from "@mariozechner/pi-ai";
|
|
7
7
|
|
|
@@ -15,36 +15,36 @@ import { o as shouldEnableShellEnvFallback, t as getShellEnvAppliedKeys } from "
|
|
|
15
15
|
import "./client-tKWDYo7c.js";
|
|
16
16
|
import "./call-Z_GCO8CL.js";
|
|
17
17
|
import "./message-channel-DdOBO6Qm.js";
|
|
18
|
-
import { d as runEmbeddedPiAgent, h as describeFailoverError } from "./timeout-
|
|
19
|
-
import "./sessions-
|
|
20
|
-
import "./subagent-registry-
|
|
21
|
-
import "./
|
|
22
|
-
import
|
|
23
|
-
import "./
|
|
24
|
-
import "./
|
|
25
|
-
import "./
|
|
26
|
-
import "./
|
|
27
|
-
import "./
|
|
28
|
-
import "./
|
|
29
|
-
import "./
|
|
30
|
-
import "./
|
|
31
|
-
import "./
|
|
32
|
-
import
|
|
33
|
-
import "./
|
|
18
|
+
import { d as runEmbeddedPiAgent, h as describeFailoverError } from "./timeout-B0mCaCG5.js";
|
|
19
|
+
import "./sessions-C3bteMLZ.js";
|
|
20
|
+
import "./subagent-registry-EoZxIEKl.js";
|
|
21
|
+
import { q as resolveModel } from "./anthropic-direct-runner-_uCPWuBb.js";
|
|
22
|
+
import "./pi-embedded-helpers-CWl0I3Qm.js";
|
|
23
|
+
import "./sandbox-BoNWDo4X.js";
|
|
24
|
+
import "./chrome-CB6uZMvl.js";
|
|
25
|
+
import "./auth-DK-0XxZU.js";
|
|
26
|
+
import "./server-context-IfJbmK25.js";
|
|
27
|
+
import "./routes-CNSdZAkl.js";
|
|
28
|
+
import "./image-ops-BsXjYj1e.js";
|
|
29
|
+
import "./ports-Bv3sZ3bd.js";
|
|
30
|
+
import "./plugins-BDSP0cT6.js";
|
|
31
|
+
import { i as resolveSessionTranscriptPath, s as resolveSessionTranscriptsDirForAgent } from "./paths-CxBUgtZS.js";
|
|
32
|
+
import "./tool-images-09hnvylP.js";
|
|
33
|
+
import "./tokens-QjoPADtG.js";
|
|
34
34
|
import { a as resolveAwsSdkEnvVarName, n as getCustomProviderApiKey, o as resolveEnvApiKey } from "./model-auth-Ja4oelNH.js";
|
|
35
|
-
import "./media-
|
|
35
|
+
import "./media-BLVMhFB3.js";
|
|
36
36
|
import "./chunk-CCPPbWoa.js";
|
|
37
|
-
import "./common-
|
|
38
|
-
import "./control-service-
|
|
39
|
-
import { c as loadProviderUsageSummary, m as resolveUsageProviderId, p as formatUsageWindowSummary } from "./reply-
|
|
37
|
+
import "./common-C5mWuFve.js";
|
|
38
|
+
import "./control-service-D3rS-Yd1.js";
|
|
39
|
+
import { c as loadProviderUsageSummary, m as resolveUsageProviderId, p as formatUsageWindowSummary } from "./reply-Bw4torMz.js";
|
|
40
40
|
import { n as ensureAnimaModelsJson } from "./context-Cau0zD3W.js";
|
|
41
|
-
import { dt as loadModelCatalog } from "./cli-session-
|
|
42
|
-
import "./parse-timeout-
|
|
43
|
-
import "./deliver-
|
|
44
|
-
import "./pi-tools.policy-
|
|
45
|
-
import "./memory-cli-
|
|
46
|
-
import "./manager-
|
|
47
|
-
import "./sqlite-
|
|
41
|
+
import { dt as loadModelCatalog } from "./cli-session-8PeURiwF.js";
|
|
42
|
+
import "./parse-timeout-C1INlSUG.js";
|
|
43
|
+
import "./deliver-BhezvxNA.js";
|
|
44
|
+
import "./pi-tools.policy-Dtytaq21.js";
|
|
45
|
+
import "./memory-cli-DSWsPuub.js";
|
|
46
|
+
import "./manager-j0ghUvcW.js";
|
|
47
|
+
import "./sqlite-Co_lF3s-.js";
|
|
48
48
|
import "./redact-BGU5Bi0z.js";
|
|
49
49
|
import "./session-DKVXdG83.js";
|
|
50
50
|
import "./semantic-Bcyloakq.js";
|
|
@@ -54,17 +54,17 @@ import "./links-BEV1YSPz.js";
|
|
|
54
54
|
import { r as withProgressTotals } from "./progress-BVxbUItq.js";
|
|
55
55
|
import "./logging-CAAlgQEE.js";
|
|
56
56
|
import "./auth-store-BkbTsJDp.js";
|
|
57
|
-
import "./dispatcher-
|
|
57
|
+
import "./dispatcher-Bk0gFz4b.js";
|
|
58
58
|
import "./delivery-queue-qVRizdA1.js";
|
|
59
|
-
import "./session-cost-usage-
|
|
60
|
-
import "./onboard-helpers-
|
|
59
|
+
import "./session-cost-usage-lLyz71EH.js";
|
|
60
|
+
import "./onboard-helpers-BRp_xJvW.js";
|
|
61
61
|
import "./prompt-style-DWBbDpfM.js";
|
|
62
62
|
import { t as renderTable } from "./table-C24zdeCz.js";
|
|
63
|
-
import { a as isLocalBaseUrl, i as formatTokenK, n as ensureFlagCompatibility, o as resolveKnownAgentId, r as formatMs } from "./prompts-
|
|
63
|
+
import { a as isLocalBaseUrl, i as formatTokenK, n as ensureFlagCompatibility, o as resolveKnownAgentId, r as formatMs } from "./prompts-NvPXbNVc.js";
|
|
64
64
|
import "./logging-1Q0hsvJ1.js";
|
|
65
65
|
import "./note-CnRyQQ-j.js";
|
|
66
66
|
import { n as redactSecrets } from "./format-CR3VGLwC.js";
|
|
67
|
-
import "./clack-prompter-
|
|
67
|
+
import "./clack-prompter-BRLXmV52.js";
|
|
68
68
|
import { n as buildAuthHealthSummary, r as formatRemainingShort, t as DEFAULT_OAUTH_WARN_MS } from "./auth-health-D0VUH0FQ.js";
|
|
69
69
|
import path from "node:path";
|
|
70
70
|
import fs from "node:fs/promises";
|
|
@@ -9,17 +9,17 @@ import { M as VERSION, i as loadConfig } from "./config-D6D_ieel.js";
|
|
|
9
9
|
import "./shell-env-2QqHvBMl.js";
|
|
10
10
|
import { Ft as loadOrCreateDeviceIdentity, t as GatewayClient } from "./client-tKWDYo7c.js";
|
|
11
11
|
import { h as GATEWAY_CLIENT_NAMES, m as GATEWAY_CLIENT_MODES } from "./message-channel-DdOBO6Qm.js";
|
|
12
|
-
import "./chrome-
|
|
13
|
-
import "./auth-
|
|
14
|
-
import { a as resolveBrowserConfig } from "./server-context-
|
|
15
|
-
import "./routes-
|
|
16
|
-
import { o as detectMime } from "./image-ops-
|
|
17
|
-
import "./ports-
|
|
18
|
-
import { n as createBrowserControlContext, r as startBrowserControlServiceFromConfig } from "./control-service-
|
|
12
|
+
import "./chrome-CB6uZMvl.js";
|
|
13
|
+
import "./auth-DK-0XxZU.js";
|
|
14
|
+
import { a as resolveBrowserConfig } from "./server-context-IfJbmK25.js";
|
|
15
|
+
import "./routes-CNSdZAkl.js";
|
|
16
|
+
import { o as detectMime } from "./image-ops-BsXjYj1e.js";
|
|
17
|
+
import "./ports-Bv3sZ3bd.js";
|
|
18
|
+
import { n as createBrowserControlContext, r as startBrowserControlServiceFromConfig } from "./control-service-D3rS-Yd1.js";
|
|
19
19
|
import { _ as analyzeArgvCommand, c as recordAllowlistUse, f as resolveExecApprovalsSocketPath, g as resolveSafeBins, h as evaluateShellAllowlist, l as requiresExecApproval, m as evaluateExecAllowlist, n as addAllowlistEntry, o as normalizeExecApprovals, p as saveExecApprovals, r as ensureExecApprovals, s as readExecApprovalsSnapshot, u as resolveExecApprovals } from "./exec-approvals-C93qAWaS.js";
|
|
20
20
|
import { t as formatDocsLink } from "./links-BEV1YSPz.js";
|
|
21
21
|
import "./logging-CAAlgQEE.js";
|
|
22
|
-
import { t as createBrowserRouteDispatcher } from "./dispatcher-
|
|
22
|
+
import { t as createBrowserRouteDispatcher } from "./dispatcher-Bk0gFz4b.js";
|
|
23
23
|
import { c as formatNodeServiceDescription, g as resolveNodeWindowsTaskName, h as resolveNodeSystemdServiceName, m as resolveNodeLaunchAgentLabel } from "./constants-CqQxCjLN.js";
|
|
24
24
|
import { t as ensureAnimaCliOnPath } from "./path-env-DPAIJ-gH.js";
|
|
25
25
|
import { d as renderSystemNodeWarning, f as resolvePreferredNodePath, h as resolveNodeProgramArguments, o as resolveGatewayDevMode, p as resolveSystemNodeInfo, r as isGatewayDaemonRuntime, s as buildNodeServiceEnvironment, t as DEFAULT_GATEWAY_DAEMON_RUNTIME } from "./daemon-runtime-DpY6Y5qE.js";
|