@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
|
@@ -3,11 +3,13 @@ import { u as loadAuthProfileStore } from "./auth-profiles-k5IOWaG2.js";
|
|
|
3
3
|
import { t as runCommandWithTimeout } from "./exec-BtBJICHE.js";
|
|
4
4
|
import { u as resolveSessionAgentIds } from "./agent-scope-Dm8IL1Ks.js";
|
|
5
5
|
import { c as normalizeProviderId } from "./model-selection-BKFF7fDb.js";
|
|
6
|
-
import { $ as
|
|
7
|
-
import { _ as isFailoverErrorMessage, p as classifyFailoverReason } from "./pi-embedded-helpers-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import { $ as resolveHeartbeatPrompt, Y as resolveAnimaDocsPath, a as buildSystemPrompt, c as enqueueCliRun, ct as resolveRunWorkspaceDir, d as parseCliJsonl, f as resolvePromptInput, h as writeCliImages, i as buildCliArgs, l as normalizeCliModel, m as resolveSystemPromptUsage, nt as resolveBootstrapContextForRun, o as cleanupResumeProcesses, p as resolveSessionIdToSend, r as appendImagePathsToPrompt, s as cleanupSuspendedCliProcesses, st as redactRunIdentifier, t as runAnthropicDirectAgent, tt as makeBootstrapWarn, u as parseCliJson } from "./anthropic-direct-runner-_uCPWuBb.js";
|
|
7
|
+
import { _ as isFailoverErrorMessage, p as classifyFailoverReason } from "./pi-embedded-helpers-CWl0I3Qm.js";
|
|
8
|
+
import { i as resolveApiKeyForProvider } from "./model-auth-Ja4oelNH.js";
|
|
9
|
+
import os, { homedir } from "node:os";
|
|
10
|
+
import path, { join } from "node:path";
|
|
10
11
|
import { existsSync } from "node:fs";
|
|
12
|
+
import fs$1 from "node:fs/promises";
|
|
11
13
|
import crypto from "node:crypto";
|
|
12
14
|
|
|
13
15
|
//#region src/infra/agent-events.ts
|
|
@@ -341,7 +343,7 @@ function coerceToFailoverError(err, context) {
|
|
|
341
343
|
|
|
342
344
|
//#endregion
|
|
343
345
|
//#region src/agents/cli-runner.ts
|
|
344
|
-
const log = createSubsystemLogger("agent/claude-cli");
|
|
346
|
+
const log$1 = createSubsystemLogger("agent/claude-cli");
|
|
345
347
|
async function runCliAgent(params) {
|
|
346
348
|
const started = Date.now();
|
|
347
349
|
const workspaceResolution = resolveRunWorkspaceDir({
|
|
@@ -354,7 +356,7 @@ async function runCliAgent(params) {
|
|
|
354
356
|
const redactedSessionId = redactRunIdentifier(params.sessionId);
|
|
355
357
|
const redactedSessionKey = redactRunIdentifier(params.sessionKey);
|
|
356
358
|
const redactedWorkspace = redactRunIdentifier(resolvedWorkspace);
|
|
357
|
-
if (workspaceResolution.usedFallback) log.warn(`[workspace-fallback] caller=runCliAgent reason=${workspaceResolution.fallbackReason} run=${params.runId} session=${redactedSessionId} sessionKey=${redactedSessionKey} agent=${workspaceResolution.agentId} workspace=${redactedWorkspace}`);
|
|
359
|
+
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}`);
|
|
358
360
|
const workspaceDir = resolvedWorkspace;
|
|
359
361
|
const backendResolved = resolveCliBackendConfig(params.provider, params.config);
|
|
360
362
|
if (!backendResolved) throw new Error(`Unknown CLI backend: ${params.provider}`);
|
|
@@ -371,7 +373,7 @@ async function runCliAgent(params) {
|
|
|
371
373
|
sessionId: params.sessionId,
|
|
372
374
|
warn: makeBootstrapWarn({
|
|
373
375
|
sessionLabel,
|
|
374
|
-
warn: (message) => log.warn(message)
|
|
376
|
+
warn: (message) => log$1.warn(message)
|
|
375
377
|
})
|
|
376
378
|
});
|
|
377
379
|
const { defaultAgentId, sessionAgentId } = resolveSessionAgentIds({
|
|
@@ -444,7 +446,7 @@ async function runCliAgent(params) {
|
|
|
444
446
|
const queueKey = backend.serialize ?? true ? backendResolved.id : `${backendResolved.id}:${params.runId}`;
|
|
445
447
|
try {
|
|
446
448
|
const output = await enqueueCliRun(queueKey, async () => {
|
|
447
|
-
log.info(`cli exec: provider=${params.provider} model=${normalizedModel} promptChars=${params.prompt.length}`);
|
|
449
|
+
log$1.info(`cli exec: provider=${params.provider} model=${normalizedModel} promptChars=${params.prompt.length}`);
|
|
448
450
|
const logOutputText = isTruthyEnvValue(process.env.ANIMA_CLAUDE_CLI_LOG_OUTPUT);
|
|
449
451
|
if (logOutputText) {
|
|
450
452
|
const logArgs = [];
|
|
@@ -477,7 +479,7 @@ async function runCliAgent(params) {
|
|
|
477
479
|
const promptIndex = logArgs.indexOf(argsPrompt);
|
|
478
480
|
if (promptIndex >= 0) logArgs[promptIndex] = `<prompt:${argsPrompt.length} chars>`;
|
|
479
481
|
}
|
|
480
|
-
log.info(`cli argv: ${backend.command} ${logArgs.join(" ")}`);
|
|
482
|
+
log$1.info(`cli argv: ${backend.command} ${logArgs.join(" ")}`);
|
|
481
483
|
}
|
|
482
484
|
const env = (() => {
|
|
483
485
|
const next = {
|
|
@@ -510,12 +512,12 @@ async function runCliAgent(params) {
|
|
|
510
512
|
const stdout = result.stdout.trim();
|
|
511
513
|
const stderr = result.stderr.trim();
|
|
512
514
|
if (logOutputText) {
|
|
513
|
-
if (stdout) log.info(`cli stdout:\n${stdout}`);
|
|
514
|
-
if (stderr) log.info(`cli stderr:\n${stderr}`);
|
|
515
|
+
if (stdout) log$1.info(`cli stdout:\n${stdout}`);
|
|
516
|
+
if (stderr) log$1.info(`cli stderr:\n${stderr}`);
|
|
515
517
|
}
|
|
516
518
|
if (shouldLogVerbose()) {
|
|
517
|
-
if (stdout) log.debug(`cli stdout:\n${stdout}`);
|
|
518
|
-
if (stderr) log.debug(`cli stderr:\n${stderr}`);
|
|
519
|
+
if (stdout) log$1.debug(`cli stdout:\n${stdout}`);
|
|
520
|
+
if (stderr) log$1.debug(`cli stderr:\n${stderr}`);
|
|
519
521
|
}
|
|
520
522
|
if (result.code !== 0) {
|
|
521
523
|
const err = stderr || stdout || "CLI failed.";
|
|
@@ -568,6 +570,215 @@ async function runCliAgent(params) {
|
|
|
568
570
|
}
|
|
569
571
|
}
|
|
570
572
|
|
|
573
|
+
//#endregion
|
|
574
|
+
//#region src/agents/gemini-direct-runner.ts
|
|
575
|
+
/**
|
|
576
|
+
* Gemini Direct API Runner
|
|
577
|
+
*
|
|
578
|
+
* Makes calls directly to generativelanguage.googleapis.com without needing
|
|
579
|
+
* a CLI wrapper. Works with Google API keys (GEMINI_API_KEY).
|
|
580
|
+
*
|
|
581
|
+
* This runner is automatically used when a google API key is available
|
|
582
|
+
* and the provider is set to "google" or "gemini".
|
|
583
|
+
*/
|
|
584
|
+
const log = createSubsystemLogger("agent/gemini-direct");
|
|
585
|
+
const DEFAULT_GEMINI_BASE_URL = "https://generativelanguage.googleapis.com/v1beta";
|
|
586
|
+
const MODEL_MAP = {
|
|
587
|
+
gemini: "gemini-2.0-flash",
|
|
588
|
+
"gemini-pro": "gemini-1.5-pro",
|
|
589
|
+
"gemini-flash": "gemini-2.0-flash",
|
|
590
|
+
"gemini-2.0": "gemini-2.0-flash",
|
|
591
|
+
"gemini-2.0-flash": "gemini-2.0-flash",
|
|
592
|
+
"gemini-2.0-pro": "gemini-2.0-pro-exp-02-05",
|
|
593
|
+
"gemini-1.5": "gemini-1.5-pro",
|
|
594
|
+
"gemini-1.5-pro": "gemini-1.5-pro",
|
|
595
|
+
"gemini-1.5-flash": "gemini-1.5-flash",
|
|
596
|
+
default: "gemini-2.0-flash"
|
|
597
|
+
};
|
|
598
|
+
const HISTORY_FILE_SUFFIX = ".gemini-history.json";
|
|
599
|
+
async function loadSessionHistory(sessionFile) {
|
|
600
|
+
const histPath = sessionFile + HISTORY_FILE_SUFFIX;
|
|
601
|
+
try {
|
|
602
|
+
const raw = await fs$1.readFile(histPath, "utf8");
|
|
603
|
+
return JSON.parse(raw);
|
|
604
|
+
} catch {
|
|
605
|
+
return null;
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
async function saveSessionHistory(sessionFile, history) {
|
|
609
|
+
const histPath = sessionFile + HISTORY_FILE_SUFFIX;
|
|
610
|
+
try {
|
|
611
|
+
await fs$1.mkdir(path.dirname(histPath), { recursive: true });
|
|
612
|
+
await fs$1.writeFile(histPath, JSON.stringify(history, null, 2), "utf8");
|
|
613
|
+
} catch (err) {
|
|
614
|
+
log.warn("failed to save session history", { error: String(err) });
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
function resolveModel(model) {
|
|
618
|
+
const key = (model ?? "default").trim().toLowerCase() || "default";
|
|
619
|
+
return MODEL_MAP[key] ?? key;
|
|
620
|
+
}
|
|
621
|
+
function buildModelPath(model) {
|
|
622
|
+
return model.startsWith("models/") ? model : `models/${model}`;
|
|
623
|
+
}
|
|
624
|
+
/**
|
|
625
|
+
* Run an agent turn directly against generativelanguage.googleapis.com.
|
|
626
|
+
*
|
|
627
|
+
* Maintains multi-turn conversation history per session file.
|
|
628
|
+
* Falls back to single-turn if history is unavailable.
|
|
629
|
+
*/
|
|
630
|
+
async function runGeminiDirectAgent(params) {
|
|
631
|
+
const started = Date.now();
|
|
632
|
+
const resolvedModel = resolveModel(params.model);
|
|
633
|
+
const modelPath = buildModelPath(resolvedModel);
|
|
634
|
+
log.info(`direct api exec: model=${resolvedModel} promptChars=${params.prompt.length}`);
|
|
635
|
+
const workspaceDir = resolveRunWorkspaceDir({
|
|
636
|
+
workspaceDir: params.workspaceDir,
|
|
637
|
+
sessionKey: params.sessionKey,
|
|
638
|
+
agentId: params.agentId,
|
|
639
|
+
config: params.config
|
|
640
|
+
}).workspaceDir;
|
|
641
|
+
const { contextFiles } = await resolveBootstrapContextForRun({
|
|
642
|
+
workspaceDir,
|
|
643
|
+
config: params.config,
|
|
644
|
+
sessionKey: params.sessionKey,
|
|
645
|
+
sessionId: params.sessionId,
|
|
646
|
+
warn: makeBootstrapWarn({
|
|
647
|
+
sessionLabel: params.sessionKey ?? params.sessionId,
|
|
648
|
+
warn: (msg) => log.warn(msg)
|
|
649
|
+
})
|
|
650
|
+
});
|
|
651
|
+
const { defaultAgentId, sessionAgentId } = resolveSessionAgentIds({
|
|
652
|
+
sessionKey: params.sessionKey,
|
|
653
|
+
config: params.config
|
|
654
|
+
});
|
|
655
|
+
const heartbeatPrompt = sessionAgentId === defaultAgentId ? resolveHeartbeatPrompt(params.config?.agents?.defaults?.heartbeat?.prompt) : void 0;
|
|
656
|
+
const docsPath = await resolveAnimaDocsPath({
|
|
657
|
+
workspaceDir,
|
|
658
|
+
argv1: process.argv[1],
|
|
659
|
+
cwd: process.cwd(),
|
|
660
|
+
moduleUrl: import.meta.url
|
|
661
|
+
});
|
|
662
|
+
const extraSystemPrompt = [params.extraSystemPrompt?.trim(), "Tools are disabled in this session. Do not call tools."].filter(Boolean).join("\n");
|
|
663
|
+
const systemPrompt = buildSystemPrompt({
|
|
664
|
+
workspaceDir,
|
|
665
|
+
config: params.config,
|
|
666
|
+
defaultThinkLevel: params.thinkLevel,
|
|
667
|
+
extraSystemPrompt,
|
|
668
|
+
ownerNumbers: params.ownerNumbers,
|
|
669
|
+
heartbeatPrompt,
|
|
670
|
+
docsPath: docsPath ?? void 0,
|
|
671
|
+
tools: [],
|
|
672
|
+
contextFiles,
|
|
673
|
+
modelDisplay: `google/${resolvedModel}`,
|
|
674
|
+
agentId: sessionAgentId
|
|
675
|
+
});
|
|
676
|
+
let history = await loadSessionHistory(params.sessionFile);
|
|
677
|
+
if (!history) history = {
|
|
678
|
+
sessionId: params.sessionId,
|
|
679
|
+
contents: [],
|
|
680
|
+
createdAt: started,
|
|
681
|
+
updatedAt: started
|
|
682
|
+
};
|
|
683
|
+
history.contents.push({
|
|
684
|
+
role: "user",
|
|
685
|
+
parts: [{ text: params.prompt }]
|
|
686
|
+
});
|
|
687
|
+
const requestBody = {
|
|
688
|
+
systemInstruction: { parts: [{ text: systemPrompt }] },
|
|
689
|
+
contents: history.contents,
|
|
690
|
+
generationConfig: {
|
|
691
|
+
maxOutputTokens: 8192,
|
|
692
|
+
temperature: 1
|
|
693
|
+
}
|
|
694
|
+
};
|
|
695
|
+
try {
|
|
696
|
+
const controller = new AbortController();
|
|
697
|
+
const timeoutHandle = setTimeout(() => controller.abort(), params.timeoutMs);
|
|
698
|
+
const url = `${DEFAULT_GEMINI_BASE_URL}/${modelPath}:generateContent?key=${params.apiKey}`;
|
|
699
|
+
const response = await fetch(url, {
|
|
700
|
+
method: "POST",
|
|
701
|
+
headers: {
|
|
702
|
+
"Content-Type": "application/json",
|
|
703
|
+
"User-Agent": `anima/5.0.1 (gemini-direct-runner; ${os.platform()})`
|
|
704
|
+
},
|
|
705
|
+
body: JSON.stringify(requestBody),
|
|
706
|
+
signal: controller.signal
|
|
707
|
+
});
|
|
708
|
+
clearTimeout(timeoutHandle);
|
|
709
|
+
if (!response.ok) {
|
|
710
|
+
const body = await response.text().catch(() => "");
|
|
711
|
+
const isAuth = response.status === 401 || response.status === 403;
|
|
712
|
+
const isRateLimit = response.status === 429;
|
|
713
|
+
const rateHint = isRateLimit ? " — rate limit hit, will retry next heartbeat." : "";
|
|
714
|
+
const authHint = isAuth ? " — API key may be invalid. Check GEMINI_API_KEY environment variable." : "";
|
|
715
|
+
log.error(`gemini api error: HTTP ${response.status}${authHint}${rateHint}`, {
|
|
716
|
+
status: response.status,
|
|
717
|
+
body: body.slice(0, 500)
|
|
718
|
+
});
|
|
719
|
+
return {
|
|
720
|
+
status: "failed",
|
|
721
|
+
meta: {
|
|
722
|
+
durationMs: Date.now() - started,
|
|
723
|
+
error: {
|
|
724
|
+
message: `HTTP ${response.status}: ${body.slice(0, 200)}${authHint}${rateHint}`,
|
|
725
|
+
kind: isAuth ? "auth" : isRateLimit ? "rate_limit" : "unknown"
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
};
|
|
729
|
+
}
|
|
730
|
+
const data = await response.json();
|
|
731
|
+
const candidate = data.candidates?.[0];
|
|
732
|
+
const assistantText = (candidate?.content?.parts ?? []).filter((p) => typeof p.text === "string").map((p) => p.text).join("\n");
|
|
733
|
+
if (assistantText && params.onPartialReply) await params.onPartialReply({ text: assistantText });
|
|
734
|
+
if (assistantText) {
|
|
735
|
+
history.contents.push({
|
|
736
|
+
role: "model",
|
|
737
|
+
parts: [{ text: assistantText }]
|
|
738
|
+
});
|
|
739
|
+
history.updatedAt = Date.now();
|
|
740
|
+
await saveSessionHistory(params.sessionFile, history);
|
|
741
|
+
}
|
|
742
|
+
const usage = data.usageMetadata;
|
|
743
|
+
const durationMs = Date.now() - started;
|
|
744
|
+
log.info(`gemini api complete: ${durationMs}ms`, {
|
|
745
|
+
inputTokens: usage?.promptTokenCount,
|
|
746
|
+
outputTokens: usage?.candidatesTokenCount,
|
|
747
|
+
finishReason: candidate?.finishReason
|
|
748
|
+
});
|
|
749
|
+
return {
|
|
750
|
+
status: "completed",
|
|
751
|
+
output: assistantText,
|
|
752
|
+
meta: {
|
|
753
|
+
durationMs,
|
|
754
|
+
agentMeta: {
|
|
755
|
+
model: resolvedModel,
|
|
756
|
+
provider: "google",
|
|
757
|
+
usage: usage ? {
|
|
758
|
+
input: usage.promptTokenCount ?? 0,
|
|
759
|
+
output: usage.candidatesTokenCount ?? 0
|
|
760
|
+
} : void 0
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
};
|
|
764
|
+
} catch (err) {
|
|
765
|
+
const isAbort = err instanceof Error && err.name === "AbortError";
|
|
766
|
+
const errorKind = isAbort ? "timeout" : "unknown";
|
|
767
|
+
const errorMsg = isAbort ? `Request timed out after ${params.timeoutMs}ms` : String(err);
|
|
768
|
+
log.error(`gemini api error: ${errorMsg}`, { error: String(err) });
|
|
769
|
+
return {
|
|
770
|
+
status: "failed",
|
|
771
|
+
meta: {
|
|
772
|
+
durationMs: Date.now() - started,
|
|
773
|
+
error: {
|
|
774
|
+
message: errorMsg,
|
|
775
|
+
kind: errorKind
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
};
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
|
|
571
782
|
//#endregion
|
|
572
783
|
//#region src/agents/pi-embedded.ts
|
|
573
784
|
function normalizeEmbeddedProvider(provider) {
|
|
@@ -649,6 +860,57 @@ async function runEmbeddedPiAgent(...args) {
|
|
|
649
860
|
}
|
|
650
861
|
}
|
|
651
862
|
}
|
|
863
|
+
if (provider === "google" || provider === "gemini") {
|
|
864
|
+
const geminiApiKey = (await resolveApiKeyForProvider({
|
|
865
|
+
provider: "google",
|
|
866
|
+
cfg: params.config
|
|
867
|
+
}))?.apiKey;
|
|
868
|
+
if (geminiApiKey) {
|
|
869
|
+
await emitAgentEvent(params, "lifecycle", {
|
|
870
|
+
phase: "start",
|
|
871
|
+
startedAt
|
|
872
|
+
});
|
|
873
|
+
try {
|
|
874
|
+
const result = await runGeminiDirectAgent({
|
|
875
|
+
apiKey: geminiApiKey,
|
|
876
|
+
sessionId: params.sessionId,
|
|
877
|
+
sessionKey: params.sessionKey,
|
|
878
|
+
agentId: params.agentId,
|
|
879
|
+
sessionFile: params.sessionFile,
|
|
880
|
+
workspaceDir: params.workspaceDir,
|
|
881
|
+
config: params.config,
|
|
882
|
+
prompt: params.prompt,
|
|
883
|
+
model: params.model,
|
|
884
|
+
thinkLevel: params.thinkLevel,
|
|
885
|
+
timeoutMs,
|
|
886
|
+
runId,
|
|
887
|
+
extraSystemPrompt: params.extraSystemPrompt,
|
|
888
|
+
ownerNumbers: params.ownerNumbers,
|
|
889
|
+
onPartialReply: async (payload) => {
|
|
890
|
+
if (!assistantStarted) {
|
|
891
|
+
assistantStarted = true;
|
|
892
|
+
await params.onAssistantMessageStart?.();
|
|
893
|
+
}
|
|
894
|
+
await params.onPartialReply?.(payload);
|
|
895
|
+
await emitAgentEvent(params, "assistant", { text: payload.text });
|
|
896
|
+
},
|
|
897
|
+
onAssistantMessageStart: params.onAssistantMessageStart
|
|
898
|
+
});
|
|
899
|
+
await emitAgentEvent(params, "lifecycle", {
|
|
900
|
+
phase: "end",
|
|
901
|
+
durationMs: Date.now() - startedAt,
|
|
902
|
+
status: result.status
|
|
903
|
+
});
|
|
904
|
+
return result;
|
|
905
|
+
} catch (err) {
|
|
906
|
+
await emitAgentEvent(params, "lifecycle", {
|
|
907
|
+
phase: "error",
|
|
908
|
+
error: String(err instanceof Error ? err.message : err)
|
|
909
|
+
});
|
|
910
|
+
throw err;
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
}
|
|
652
914
|
const cliProvider = resolveCompatCliProvider(provider, params.config);
|
|
653
915
|
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`);
|
|
654
916
|
await emitAgentEvent(params, "lifecycle", {
|
|
@@ -3,10 +3,10 @@ import { E as resolveAgentIdFromSessionKey, T as normalizeMainKey, _ as DEFAULT_
|
|
|
3
3
|
import { j as resolvePreferredAnimaTmpDir, l as getChatChannelMeta, m as requireActivePluginRegistry, n as defaultRuntime, o as CHANNEL_IDS, s as CHAT_CHANNEL_ORDER, t as createSubsystemLogger } from "./subsystem-WFp78xn1.js";
|
|
4
4
|
import { S as resolveConfigDir, b as normalizeE164, j as truncateUtf16Safe, l as CONFIG_DIR, m as escapeRegExp, n as runExec, w as resolveUserPath } from "./exec-DnanRQle.js";
|
|
5
5
|
import { l as resolveSessionAgentId, n as resolveAgentConfig } from "./agent-scope-DICrDp7Y.js";
|
|
6
|
-
import { t as
|
|
7
|
-
import {
|
|
8
|
-
import { A as DEFAULT_BROWSER_EVALUATE_ENABLED, C as DEFAULT_AI_SNAPSHOT_EFFICIENT_DEPTH, D as DEFAULT_ANIMA_BROWSER_ENABLED, E as DEFAULT_ANIMA_BROWSER_COLOR, O as DEFAULT_ANIMA_BROWSER_PROFILE_NAME, T as DEFAULT_AI_SNAPSHOT_MAX_CHARS, _ as ensureChromeExtensionRelayServer, a as resolveAnimaUserDataDir, b as isLoopbackHost, c as captureScreenshot, d as normalizeCdpWsUrl, f as snapshotAria, h as getHeadersWithAuth, i as launchAnimaChrome, k as DEFAULT_BROWSER_DEFAULT_PROFILE_NAME, l as createTargetViaCdp, n as isChromeCdpReady, o as stopAnimaChrome, p as appendCdpPath, r as isChromeReachable, s as resolveBrowserExecutableForPlatform, v as stopChromeExtensionRelayServer, w as DEFAULT_AI_SNAPSHOT_EFFICIENT_MAX_CHARS } from "./chrome-
|
|
9
|
-
import { a as parseFrontmatterBlock, c as resolveRuntimePlatform, i as resolveAnimaManifestBlock, n as normalizeStringList, o as hasBinary, r as parseFrontmatterBool, s as isConfigPathTruthyWithDefaults, t as getFrontmatterString } from "./frontmatter-
|
|
6
|
+
import { a as writeConfigFile, c as parseDurationMs, h as resolveMemorySlotDecision, m as resolveEnableState, n as loadConfig, p as normalizePluginsConfig, s as parseByteSize, t as createConfigIO, u as loadPluginManifestRegistry } from "./config-DezP7V65.js";
|
|
7
|
+
import { t as parseBooleanValue } from "./boolean-Ce2-qkSB.js";
|
|
8
|
+
import { A as DEFAULT_BROWSER_EVALUATE_ENABLED, C as DEFAULT_AI_SNAPSHOT_EFFICIENT_DEPTH, D as DEFAULT_ANIMA_BROWSER_ENABLED, E as DEFAULT_ANIMA_BROWSER_COLOR, O as DEFAULT_ANIMA_BROWSER_PROFILE_NAME, T as DEFAULT_AI_SNAPSHOT_MAX_CHARS, _ as ensureChromeExtensionRelayServer, a as resolveAnimaUserDataDir, b as isLoopbackHost, c as captureScreenshot, d as normalizeCdpWsUrl, f as snapshotAria, h as getHeadersWithAuth, i as launchAnimaChrome, k as DEFAULT_BROWSER_DEFAULT_PROFILE_NAME, l as createTargetViaCdp, n as isChromeCdpReady, o as stopAnimaChrome, p as appendCdpPath, r as isChromeReachable, s as resolveBrowserExecutableForPlatform, v as stopChromeExtensionRelayServer, w as DEFAULT_AI_SNAPSHOT_EFFICIENT_MAX_CHARS } from "./chrome-CKvch3UL.js";
|
|
9
|
+
import { a as parseFrontmatterBlock, c as resolveRuntimePlatform, i as resolveAnimaManifestBlock, n as normalizeStringList, o as hasBinary, r as parseFrontmatterBool, s as isConfigPathTruthyWithDefaults, t as getFrontmatterString } from "./frontmatter-Dsa7N963.js";
|
|
10
10
|
import { n as formatErrorMessage, t as extractErrorCode } from "./errors-UbDRvfEx.js";
|
|
11
11
|
import { S as extensionForMime, _ as getImageMetadata, b as resizeToJpeg, l as listDeliverableMessageChannels, r as normalizeChannelId, u as normalizeMessageChannel, x as detectMime } from "./plugins-C_GedoUi.js";
|
|
12
12
|
import { n as resolveSessionFilePath, s as resolveStorePath, t as resolveDefaultSessionStorePath } from "./paths-DybdJi5a.js";
|
|
@@ -21,17 +21,6 @@ import crypto from "node:crypto";
|
|
|
21
21
|
import { CURRENT_SESSION_VERSION, SessionManager, formatSkillsForPrompt, loadSkillsFromDir } from "@mariozechner/pi-coding-agent";
|
|
22
22
|
import "express";
|
|
23
23
|
|
|
24
|
-
//#region src/auto-reply/tokens.ts
|
|
25
|
-
const HEARTBEAT_TOKEN = "HEARTBEAT_OK";
|
|
26
|
-
const SILENT_REPLY_TOKEN = "NO_REPLY";
|
|
27
|
-
function isSilentReplyText(text, token = SILENT_REPLY_TOKEN) {
|
|
28
|
-
if (!text) return false;
|
|
29
|
-
const escaped = escapeRegExp(token);
|
|
30
|
-
if (new RegExp(`^\\s*${escaped}(?=$|\\W)`).test(text)) return true;
|
|
31
|
-
return new RegExp(`\\b${escaped}\\b\\W*$`).test(text);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
//#endregion
|
|
35
24
|
//#region src/agents/pi-embedded-helpers/bootstrap.ts
|
|
36
25
|
const DEFAULT_BOOTSTRAP_MAX_CHARS = 2e4;
|
|
37
26
|
const DEFAULT_BOOTSTRAP_TOTAL_MAX_CHARS = 24e3;
|
|
@@ -1268,7 +1257,7 @@ function isModuleNotFoundError(err) {
|
|
|
1268
1257
|
}
|
|
1269
1258
|
async function loadPwAiModule(mode) {
|
|
1270
1259
|
try {
|
|
1271
|
-
return await import("./pw-ai-
|
|
1260
|
+
return await import("./pw-ai-C3j5kV3T.js");
|
|
1272
1261
|
} catch (err) {
|
|
1273
1262
|
if (mode === "soft") return null;
|
|
1274
1263
|
if (isModuleNotFoundError(err)) return null;
|
|
@@ -3726,11 +3715,11 @@ function createProfileContext(opts, profile) {
|
|
|
3726
3715
|
const userDataDir = resolveAnimaUserDataDir(profile.name);
|
|
3727
3716
|
const profileState = getProfileState();
|
|
3728
3717
|
if (await isHttpReachable(300) && !profileState.running) try {
|
|
3729
|
-
await (await import("./pw-ai-
|
|
3718
|
+
await (await import("./pw-ai-C3j5kV3T.js")).closePlaywrightBrowserConnection();
|
|
3730
3719
|
} catch {}
|
|
3731
3720
|
if (profileState.running) await stopRunningBrowser();
|
|
3732
3721
|
try {
|
|
3733
|
-
await (await import("./pw-ai-
|
|
3722
|
+
await (await import("./pw-ai-C3j5kV3T.js")).closePlaywrightBrowserConnection();
|
|
3734
3723
|
} catch {}
|
|
3735
3724
|
if (!fs$1.existsSync(userDataDir)) return {
|
|
3736
3725
|
moved: false,
|
|
@@ -5971,4 +5960,15 @@ function normalizeReasoningLevel(raw) {
|
|
|
5971
5960
|
}
|
|
5972
5961
|
|
|
5973
5962
|
//#endregion
|
|
5974
|
-
|
|
5963
|
+
//#region src/auto-reply/tokens.ts
|
|
5964
|
+
const HEARTBEAT_TOKEN = "HEARTBEAT_OK";
|
|
5965
|
+
const SILENT_REPLY_TOKEN = "NO_REPLY";
|
|
5966
|
+
function isSilentReplyText(text, token = SILENT_REPLY_TOKEN) {
|
|
5967
|
+
if (!text) return false;
|
|
5968
|
+
const escaped = escapeRegExp(token);
|
|
5969
|
+
if (new RegExp(`^\\s*${escaped}(?=$|\\W)`).test(text)) return true;
|
|
5970
|
+
return new RegExp(`\\b${escaped}\\b\\W*$`).test(text);
|
|
5971
|
+
}
|
|
5972
|
+
|
|
5973
|
+
//#endregion
|
|
5974
|
+
export { resolveConversationLabel as $, updateLastRoute as A, buildBootstrapContextFiles as At, evaluateSessionFreshness as B, resolveSandboxRuntimeStatus as C, expandPolicyWithPluginGroups as Ct, loadSessionStore as D, stripPluginOnlyAllowlist as Dt, resolveMirroredTranscriptText as E, resolveToolProfilePolicy as Et, mergeDeliveryContext as F, DEFAULT_RESET_TRIGGERS as G, resolveSessionResetPolicy as H, normalizeDeliveryContext as I, resolveExplicitAgentSessionKey as J, resolveFreshSessionTotalTokens as K, normalizeSessionDeliveryFields as L, updateSessionStoreEntry as M, resolveBootstrapTotalMaxChars as Mt, deliveryContextFromSession as N, readSessionUpdatedAt as O, compileGlobPatterns as Ot, deliveryContextKey as P, listChannelDocks as Q, normalizeAccountId as R, ensureSandboxWorkspaceForSession as S, collectExplicitAllowlist as St, appendAssistantMessageToSessionTranscript as T, normalizeToolName as Tt, resolveSessionResetType as U, resolveChannelResetConfig as V, resolveThreadFlag as W, deriveSessionMetaPatch as X, resolveMainSessionKey as Y, getChannelDock as Z, isContextOverflowError as _, ensureBrowserControlAuth as _t, formatXHighModelHint as a, resolveProfile as at, isTransientHttpError as b, applyOwnerOnlyToolPolicy as bt, normalizeReasoningLevel as c, DEFAULT_UPLOAD_DIR as ct, normalizeVerboseLevel as d, buildWorkspaceSkillCommandSpecs as dt, normalizeChatType as et, resolveResponseUsageMode as f, buildWorkspaceSkillSnapshot as ft, isCompactionFailureError as g, resolveSandboxedMediaSource as gt, classifyFailoverReason as h, assertSandboxPath as ht, formatThinkingLevels as i, resolveBrowserConfig as it, updateSessionStore as j, resolveBootstrapMaxChars as jt, recordSessionMetaFromInbound as k, matchesAnyGlobPattern as kt, normalizeThinkLevel as l, resolvePathsWithinRoot as lt, isMessagingToolDuplicate as m, assertMediaNotDataUrl as mt, SILENT_REPLY_TOKEN as n, createBrowserRouteContext as nt, listThinkingLevels as o, getMediaDir as ot, supportsXHighThinking as p, resolvePluginSkillDirs as pt, canonicalizeMainSessionAlias as q, isSilentReplyText as r, registerBrowserRoutes as rt, normalizeElevatedLevel as s, saveMediaBuffer as st, HEARTBEAT_TOKEN as t, resolveGroupSessionKey as tt, normalizeUsageDisplay as u, getBridgeAuthForPort as ut, isFailoverErrorMessage as v, resolveBrowserControlAuth as vt, extractDeliveryInfo as w, expandToolGroups as wt, sanitizeUserFacingText as x, buildPluginToolGroups as xt, isLikelyContextOverflowError as y, resolveSandboxConfigForAgent as yt, resolveSessionKey as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as createSubsystemLogger } from "./entry.js";
|
|
2
|
-
import { a as resizeToJpeg, n as getImageMetadata } from "./image-ops-
|
|
2
|
+
import { a as resizeToJpeg, n as getImageMetadata } from "./image-ops-BsXjYj1e.js";
|
|
3
3
|
|
|
4
4
|
//#region src/agents/tool-images.ts
|
|
5
5
|
const MAX_IMAGE_DIMENSION_PX = 2e3;
|
|
@@ -6,8 +6,8 @@ import { M as VERSION, i as loadConfig } from "./config-D6D_ieel.js";
|
|
|
6
6
|
import { Dt as PROTOCOL_VERSION, t as GatewayClient } from "./client-tKWDYo7c.js";
|
|
7
7
|
import { i as ensureExplicitGatewayAuth, o as resolveExplicitGatewayAuth, t as buildGatewayConnectionDetails } from "./call-Z_GCO8CL.js";
|
|
8
8
|
import { f as GATEWAY_CLIENT_CAPS, h as GATEWAY_CLIENT_NAMES, m as GATEWAY_CLIENT_MODES } from "./message-channel-DdOBO6Qm.js";
|
|
9
|
-
import { c as normalizeUsageDisplay, m as formatRawAssistantErrorForUi, r as listThinkingLevelLabels, t as formatThinkingLevels, u as resolveResponseUsageMode } from "./pi-embedded-helpers-
|
|
10
|
-
import { n as listChatCommands, r as listChatCommandsForConfig } from "./parse-timeout-
|
|
9
|
+
import { c as normalizeUsageDisplay, m as formatRawAssistantErrorForUi, r as listThinkingLevelLabels, t as formatThinkingLevels, u as resolveResponseUsageMode } from "./pi-embedded-helpers-CWl0I3Qm.js";
|
|
10
|
+
import { n as listChatCommands, r as listChatCommandsForConfig } from "./parse-timeout-C1INlSUG.js";
|
|
11
11
|
import { n as formatTimeAgo, t as formatRelativeTimestamp } from "./format-relative-CEWK-aoC.js";
|
|
12
12
|
import { n as formatTokenCount } from "./usage-format-CzRY73um.js";
|
|
13
13
|
import { r as redactToolDetail } from "./redact-BGU5Bi0z.js";
|
|
@@ -10,22 +10,22 @@ import "./shell-env-2QqHvBMl.js";
|
|
|
10
10
|
import "./client-tKWDYo7c.js";
|
|
11
11
|
import "./call-Z_GCO8CL.js";
|
|
12
12
|
import "./message-channel-DdOBO6Qm.js";
|
|
13
|
-
import "./sessions-
|
|
14
|
-
import "./pi-embedded-helpers-
|
|
15
|
-
import "./sandbox-
|
|
16
|
-
import "./chrome-
|
|
17
|
-
import "./auth-
|
|
18
|
-
import "./server-context-
|
|
19
|
-
import "./routes-
|
|
20
|
-
import "./image-ops-
|
|
21
|
-
import "./ports-
|
|
22
|
-
import "./plugins-
|
|
23
|
-
import "./paths-
|
|
24
|
-
import "./tool-images-
|
|
25
|
-
import { t as parseTimeoutMs } from "./parse-timeout-
|
|
13
|
+
import "./sessions-C3bteMLZ.js";
|
|
14
|
+
import "./pi-embedded-helpers-CWl0I3Qm.js";
|
|
15
|
+
import "./sandbox-BoNWDo4X.js";
|
|
16
|
+
import "./chrome-CB6uZMvl.js";
|
|
17
|
+
import "./auth-DK-0XxZU.js";
|
|
18
|
+
import "./server-context-IfJbmK25.js";
|
|
19
|
+
import "./routes-CNSdZAkl.js";
|
|
20
|
+
import "./image-ops-BsXjYj1e.js";
|
|
21
|
+
import "./ports-Bv3sZ3bd.js";
|
|
22
|
+
import "./plugins-BDSP0cT6.js";
|
|
23
|
+
import "./paths-CxBUgtZS.js";
|
|
24
|
+
import "./tool-images-09hnvylP.js";
|
|
25
|
+
import { t as parseTimeoutMs } from "./parse-timeout-C1INlSUG.js";
|
|
26
26
|
import "./redact-BGU5Bi0z.js";
|
|
27
27
|
import { t as formatDocsLink } from "./links-BEV1YSPz.js";
|
|
28
|
-
import { t as runTui } from "./tui
|
|
28
|
+
import { t as runTui } from "./tui-LRoQ5xyx.js";
|
|
29
29
|
|
|
30
30
|
//#region src/cli/tui-cli.ts
|
|
31
31
|
function registerTuiCli(program) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { y as resolveUserPath } from "./utils-D1VGbO3C.js";
|
|
2
2
|
import { n as discoverAnimaPlugins, r as loadPluginManifest } from "./manifest-registry-W_OfCIRP.js";
|
|
3
|
-
import { i as resolvePluginInstallDir, n as installPluginFromNpmSpec, t as recordPluginInstall } from "./installs-
|
|
3
|
+
import { i as resolvePluginInstallDir, n as installPluginFromNpmSpec, t as recordPluginInstall } from "./installs-Drds9RDI.js";
|
|
4
4
|
import fs from "node:fs/promises";
|
|
5
5
|
|
|
6
6
|
//#region src/plugins/update.ts
|
|
@@ -2,13 +2,13 @@ import { m as resolveStateDir } from "./paths-zhVksOvm.js";
|
|
|
2
2
|
import { V as theme, d as defaultRuntime } from "./subsystem-Cn6bJV8Z.js";
|
|
3
3
|
import { g as pathExists } from "./utils-dWKYjULE.js";
|
|
4
4
|
import "./pi-embedded-helpers-iju5zIIA.js";
|
|
5
|
-
import "./subagent-registry-
|
|
6
|
-
import { M as trimLogTail } from "./reply-
|
|
5
|
+
import "./subagent-registry-7qo93ip8.js";
|
|
6
|
+
import { M as trimLogTail } from "./reply-Dd3EmI4M.js";
|
|
7
7
|
import { t as runCommandWithTimeout } from "./exec-DbnX_71w.js";
|
|
8
8
|
import { t as resolveAnimaPackageRoot } from "./anima-root-Bot0EbzI.js";
|
|
9
9
|
import "./agent-scope-BLiq3nK_.js";
|
|
10
10
|
import "./model-selection-C2dAUmK_.js";
|
|
11
|
-
import "./lanes-
|
|
11
|
+
import "./lanes-4_8h1ZQO.js";
|
|
12
12
|
import { l as writeConfigFile, o as readConfigFileSnapshot } from "./config-CG7uuHNE.js";
|
|
13
13
|
import "./boolean-Wzu0-e0P.js";
|
|
14
14
|
import "./env-T3-raV4i.js";
|
|
@@ -21,7 +21,7 @@ import { n as replaceCliName, r as resolveCliName, t as formatCliCommand } from
|
|
|
21
21
|
import "./auth-profiles-BhZX2spm.js";
|
|
22
22
|
import "./file-lock-BRW4LeL0.js";
|
|
23
23
|
import "./model-auth-DVG37yXU.js";
|
|
24
|
-
import "./cli-session-
|
|
24
|
+
import "./cli-session-CczB2Dni.js";
|
|
25
25
|
import "./tokens-k_R7Y792.js";
|
|
26
26
|
import "./sandbox-BwUo1b0I.js";
|
|
27
27
|
import "./chrome-C3-muxXb.js";
|
|
@@ -33,7 +33,7 @@ import "./ports-DOiSDgNp.js";
|
|
|
33
33
|
import "./message-channel-DuxJGOJz.js";
|
|
34
34
|
import "./plugins-BmYfBGLM.js";
|
|
35
35
|
import "./paths-BvY3CbW0.js";
|
|
36
|
-
import "./anthropic-direct-runner
|
|
36
|
+
import "./anthropic-direct-runner--MPTWkYA.js";
|
|
37
37
|
import "./tool-images-BehEzEZF.js";
|
|
38
38
|
import "./parse-timeout-C8t_lmnL.js";
|
|
39
39
|
import "./chunk-DFCmYqgJ.js";
|
|
@@ -62,10 +62,10 @@ import "./delivery-queue-CQi61CMr.js";
|
|
|
62
62
|
import "./session-cost-usage-6bDLU9Pb.js";
|
|
63
63
|
import "./accounts-CVmv61PJ.js";
|
|
64
64
|
import { r as parseSemver } from "./runtime-guard-B40AREJ_.js";
|
|
65
|
-
import "./program-context-
|
|
65
|
+
import "./program-context-Co2gkUS0.js";
|
|
66
66
|
import "./catalog-B-pfqu76.js";
|
|
67
67
|
import "./skills-status-B_umZ78Q.js";
|
|
68
|
-
import { r as installCompletion } from "./completion-cli-
|
|
68
|
+
import { r as installCompletion } from "./completion-cli-DhbIrk13.js";
|
|
69
69
|
import "./daemon-runtime-B9AywEma.js";
|
|
70
70
|
import "./onboard-helpers-BgsHO6fO.js";
|
|
71
71
|
import { n as stylePromptMessage, t as stylePromptHint } from "./prompt-style-1bwj7IzZ.js";
|
|
@@ -76,24 +76,24 @@ import { r as runDaemonRestart } from "./daemon-cli-C5Tosclk.js";
|
|
|
76
76
|
import "./diagnostics-TXSvtpaq.js";
|
|
77
77
|
import "./service-audit-BbwXAhsr.js";
|
|
78
78
|
import { t as renderTable } from "./table-B991ZwKi.js";
|
|
79
|
-
import "./health-
|
|
79
|
+
import "./health-DoGFlPcq.js";
|
|
80
80
|
import "./plugin-auto-enable-DIWd94Po.js";
|
|
81
81
|
import "./health-format-Ojy0hLp3.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-DenKLCLq.js";
|
|
83
83
|
import "./logging-Dwz0XtXm.js";
|
|
84
84
|
import "./note-Daao-cv8.js";
|
|
85
|
-
import { r as ensureCompletionCacheExists, t as checkShellCompletionStatus } from "./doctor-completion-
|
|
85
|
+
import { r as ensureCompletionCacheExists, t as checkShellCompletionStatus } from "./doctor-completion-B-SFdu-f.js";
|
|
86
86
|
import "./skill-scanner-HQwt_KRF.js";
|
|
87
87
|
import { i as resolveUpdateAvailability, n as formatUpdateOneLiner, t as formatUpdateAvailableHint } from "./status.update-P6xyBet8.js";
|
|
88
88
|
import "./archive-PQcg3EQT.js";
|
|
89
|
-
import { a as globalInstallArgs, i as detectGlobalInstallManagerForRoot, n as cleanupGlobalRenameDirs, o as resolveGlobalPackageRoot, r as detectGlobalInstallManagerByPresence, t as runGatewayUpdate } from "./update-runner-
|
|
89
|
+
import { a as globalInstallArgs, i as detectGlobalInstallManagerForRoot, n as cleanupGlobalRenameDirs, o as resolveGlobalPackageRoot, r as detectGlobalInstallManagerByPresence, t as runGatewayUpdate } from "./update-runner-OPbRGUfX.js";
|
|
90
90
|
import "./npm-registry-spec-fJIJ8GG5.js";
|
|
91
91
|
import "./installs-BxZFjTKY.js";
|
|
92
92
|
import { n as updateNpmInstalledPlugins, t as syncPluginsForUpdateChannel } from "./update-tjMvDUCw.js";
|
|
93
93
|
import "./doctor-config-flow-D0GgdMmi.js";
|
|
94
94
|
import { t as formatHelpExamples } from "./help-format-BZ7j9sHT.js";
|
|
95
95
|
import "./systemd-linger-CpWguZ4b.js";
|
|
96
|
-
import { t as doctorCommand } from "./doctor-
|
|
96
|
+
import { t as doctorCommand } from "./doctor-DsRSWr6B.js";
|
|
97
97
|
import os from "node:os";
|
|
98
98
|
import path from "node:path";
|
|
99
99
|
import fs from "node:fs/promises";
|