@symerian/symi 3.4.32 → 3.4.33
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/{agent-BaSGoKPq.js → agent-DQfitMBw.js} +1 -1
- package/dist/{agent-C8IIjDyn.js → agent-DkDdGuzJ.js} +1 -1
- package/dist/{agents-D6Ygz9ED.js → agents-AMdYY8k4.js} +2 -2
- package/dist/{auth-choice-Bx4Duu6u.js → auth-choice-BfSOQfbj.js} +1 -1
- package/dist/{auth-choice-BBrEzoy2.js → auth-choice-Di69jPrV.js} +1 -1
- package/dist/{banner-l9GjW5Rm.js → banner-2AO478QB.js} +1 -1
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +4 -4
- package/dist/bundled/session-memory/handler.js +4 -4
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{channel-options-DGUqfnbP.js → channel-options-BCzXW2z-.js} +1 -1
- package/dist/{channel-options-COanIUoQ.js → channel-options-W61Bhzx-.js} +1 -1
- package/dist/{channels-cli-CZ3M3yE1.js → channels-cli-BUG1t9xo.js} +7 -7
- package/dist/{channels-cli-B1zmnm5a.js → channels-cli-Dw4fyG1g.js} +7 -7
- package/dist/{chrome-CQn8fDIy.js → chrome-CPSDqbK6.js} +7 -7
- package/dist/{chrome-B4P7ycw5.js → chrome-DT1fIVG1.js} +7 -7
- package/dist/{cli-CC5GrdTI.js → cli-CXO2Tt3f.js} +4 -4
- package/dist/{cli-C7I5uEFC.js → cli-CaF1rsTl.js} +4 -4
- package/dist/{command-registry-D8fj6th4.js → command-registry-HlICZbMN.js} +10 -10
- package/dist/{completion-cli-C-85b5b8.js → completion-cli-BGyTfZsT.js} +1 -1
- package/dist/{completion-cli-BxspmuYm.js → completion-cli-C9s04Ris.js} +2 -2
- package/dist/{config-cli-DSDGwckX.js → config-cli-Ce0FG7iI.js} +1 -1
- package/dist/{config-cli-BqzjDmIH.js → config-cli-p2PrIOF5.js} +1 -1
- package/dist/{configure-Dl1f1Den.js → configure-Dj3xQ-cs.js} +2 -2
- package/dist/{configure-BazJdwKU.js → configure-c96EHRee.js} +2 -2
- package/dist/{deliver-BkCYBlzi.js → deliver-59sRVaYQ.js} +4 -4
- package/dist/{deliver-DvW5xHHr.js → deliver-Mqq3tgqB.js} +4 -4
- package/dist/{doctor-completion-CX7LjkOD.js → doctor-completion-B1ny8yKk.js} +1 -1
- package/dist/{doctor-completion-BwHbIZjF.js → doctor-completion-RWwGjpox.js} +1 -1
- package/dist/entry.js +1 -1
- package/dist/extensionAPI.js +4 -4
- package/dist/{gateway-cli-CW-Z71cE.js → gateway-cli-8lvej8_J.js} +10 -10
- package/dist/{gateway-cli-CTcK1Az2.js → gateway-cli-CkZXvPYl.js} +10 -10
- package/dist/{glass-ui-ws-BNJkhJrL.js → glass-ui-ws-Ce9TvGD_.js} +8 -8
- package/dist/{glass-ui-ws-BZvH4MBO.js → glass-ui-ws-CmUlgTXc.js} +8 -8
- package/dist/{hooks-cli-DkP3Y4ou.js → hooks-cli-BGzzZ0NS.js} +5 -5
- package/dist/{hooks-cli-qO421UdO.js → hooks-cli-hb_Ed-Jz.js} +5 -5
- package/dist/index.js +8 -8
- package/dist/llm-slug-generator.js +4 -4
- package/dist/{manager-D0NIHMuQ.js → manager-CWnvYURh.js} +1 -1
- package/dist/{manager-DOiW-Koo.js → manager-CnHkbF80.js} +1 -1
- package/dist/{manager-BD_cpL9b.js → manager-DkZ5wkXy.js} +1 -1
- package/dist/{manager-BQaZlWzK.js → manager-v-DndeD8.js} +1 -1
- package/dist/{memory-Cl4I_45k.js → memory-DAiUTYsN.js} +2 -2
- package/dist/{memory-kIYeV9aO.js → memory-DIz78XgT.js} +2 -2
- package/dist/{memory-cli-DkD_OD70.js → memory-cli-DfW-A_QO.js} +2 -2
- package/dist/{memory-cli-CszP57Ee.js → memory-cli-Xhj74cTT.js} +2 -2
- package/dist/{models-BYi0Fo1a.js → models-CE_4elo3.js} +2 -2
- package/dist/{models-cli-Bn9M1TgO.js → models-cli-BKKWrGzr.js} +5 -5
- package/dist/{models-cli-EdjvkvFO.js → models-cli-Dc2tXjX2.js} +6 -6
- package/dist/{onboard-CAIujkV7.js → onboard-DepZiaNF.js} +1 -1
- package/dist/{onboard-channels-D_uUQbem.js → onboard-channels-C6BRMuCW.js} +1 -1
- package/dist/{onboard-channels-B2l6OoMg.js → onboard-channels-CXpGsHLr.js} +1 -1
- package/dist/{onboard-C8IQnigm.js → onboard-jE4b4C-p.js} +1 -1
- package/dist/{onboarding-BIq5BxG0.js → onboarding-DPH9gWr4.js} +3 -3
- package/dist/{onboarding-4v9LJueP.js → onboarding-DnTefFwg.js} +3 -3
- package/dist/{onboarding.finalize-CXAQzVXM.js → onboarding.finalize-3ZKGCjhd.js} +4 -4
- package/dist/{onboarding.finalize-Bkcwe5RS.js → onboarding.finalize-C8ibJ9uq.js} +3 -3
- package/dist/{pi-embedded-CGebiST2.js → pi-embedded-C1ziBpAk.js} +10 -99
- package/dist/{plugin-registry-D7ACpV2Y.js → plugin-registry-COJjE9SO.js} +1 -1
- package/dist/{plugin-registry-d4hMhLLZ.js → plugin-registry-c9GdlkR9.js} +1 -1
- package/dist/plugin-sdk/agents/model-aware-stream.d.ts +0 -21
- package/dist/plugin-sdk/index.js +6 -6
- package/dist/{plugins-cli-CPf1hMaZ.js → plugins-cli-C9oli8ls.js} +5 -5
- package/dist/{plugins-cli-D1gd8p9T.js → plugins-cli-D6dclODT.js} +5 -5
- package/dist/{program-C19G7o-Q.js → program-9PTJNfZ7.js} +10 -10
- package/dist/{program-context-BSUkEz3n.js → program-context-BUekmPwY.js} +18 -18
- package/dist/{prompt-select-styled-CnYM7W0j.js → prompt-select-styled-BK0mAdgX.js} +4 -4
- package/dist/{prompt-select-styled-B5wlPYN5.js → prompt-select-styled-BUycx1hY.js} +4 -4
- package/dist/{provider-auth-helpers-DpRoNr_8.js → provider-auth-helpers-CczPUO0p.js} +1 -1
- package/dist/{provider-auth-helpers-BUC4xGK9.js → provider-auth-helpers-DgK9MncE.js} +1 -1
- package/dist/{push-apns-Bm39oOO9.js → push-apns-BGpLn10e.js} +1 -1
- package/dist/{push-apns-DqmFEcqh.js → push-apns-CgvbJbQC.js} +1 -1
- package/dist/{pw-ai-BsEf8C15.js → pw-ai-C5MJKzUM.js} +1 -1
- package/dist/{pw-ai-BB1pJj9_.js → pw-ai-w6Qalz1W.js} +1 -1
- package/dist/{register.agent-DZuxoC0a.js → register.agent-BdAFrDZP.js} +9 -9
- package/dist/{register.agent-CCKcgAXs.js → register.agent-CiSmK5cW.js} +8 -8
- package/dist/{register.configure-JT8T7HO5.js → register.configure-CJ8DVLfn.js} +8 -8
- package/dist/{register.configure-CJErdFO_.js → register.configure-FMKBV7zr.js} +8 -8
- package/dist/{register.maintenance-CKsv0lok.js → register.maintenance-C9VugUAp.js} +9 -9
- package/dist/{register.maintenance-DDzKUGYJ.js → register.maintenance-D5Li0TBK.js} +8 -8
- package/dist/{register.message-_bfhetTg.js → register.message-BYoMS5CB.js} +5 -5
- package/dist/{register.message-CpOXi1rz.js → register.message-Ds_xPChV.js} +5 -5
- package/dist/{register.onboard-CkIM3hU7.js → register.onboard-BzIJn1Lg.js} +2 -2
- package/dist/{register.onboard-BHtTh0b_.js → register.onboard-si2z7-YL.js} +2 -2
- package/dist/{register.setup-CYtYDKMU.js → register.setup-BsJUgbDb.js} +2 -2
- package/dist/{register.setup-CLhdFQHW.js → register.setup-Df3R4yLs.js} +2 -2
- package/dist/{register.status-health-sessions-DmX0DLAt.js → register.status-health-sessions-B8sNB-yT.js} +3 -3
- package/dist/{register.status-health-sessions-DZnebsxZ.js → register.status-health-sessions-D8NDF7y5.js} +3 -3
- package/dist/{register.subclis-CnDo2jzv.js → register.subclis-Yhn2bUmt.js} +9 -9
- package/dist/{run-main-BIRbWKyA.js → run-main-CFH2Lrwb.js} +17 -17
- package/dist/{server-methods-Dz6NGEg3.js → server-methods-C-CwdwCK.js} +6 -6
- package/dist/{server-methods-vp5zi6v5.js → server-methods-DeytIhcV.js} +6 -6
- package/dist/{server-node-events-B7UtUhkC.js → server-node-events-C1ClYFgH.js} +6 -6
- package/dist/{server-node-events-4ufB_olv.js → server-node-events-V9Lp56Gv.js} +6 -6
- package/dist/{status-DEXnB1sw.js → status-9g-DM9_P.js} +1 -1
- package/dist/{status-MMLxoRgQ.js → status-DI7oeBoM.js} +1 -1
- package/dist/{status-BD8gFYKH.js → status-DajsgZgR.js} +1 -1
- package/dist/{status-B0HecH1s.js → status-JGAm0LR-.js} +1 -1
- package/dist/{subagent-registry-C57PFGHU.js → subagent-registry-Fio11IHF.js} +3 -92
- package/dist/{synthesis-CjsIBd8X.js → synthesis-Bz8Yp6oI.js} +4 -4
- package/dist/{synthesis-j_kjlFo1.js → synthesis-CXXYGwNN.js} +4 -4
- package/dist/{synthesis-DSdF0vsi.js → synthesis-DUu4tYgx.js} +4 -4
- package/dist/{synthesis-CQdzrLFL.js → synthesis-DwljJPko.js} +4 -4
- package/dist/{unified-runner-DCiPB--z.js → unified-runner-B3G4fVeJ.js} +3 -92
- package/dist/{unified-runner-BNt7TQKM.js → unified-runner-V6KJgMsY.js} +10 -99
- package/dist/{update-cli-CWufRpkr.js → update-cli-BaLUelaZ.js} +8 -8
- package/dist/{update-cli-Dl_QbjXc.js → update-cli-C8Uy9Hox.js} +9 -9
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { o as createSubsystemLogger } from "./entry.js";
|
|
2
2
|
import { D as resolveDefaultAgentWorkspaceDir, c as resolveAgentWorkspaceDir, l as resolveDefaultAgentId } from "./agent-scope-B6p555mP.js";
|
|
3
3
|
import { i as loadConfig } from "./config-igdtSRrZ.js";
|
|
4
|
-
import { m as loadSymiPlugins, p as createPluginLoaderLogger } from "./subagent-registry-
|
|
4
|
+
import { m as loadSymiPlugins, p as createPluginLoaderLogger } from "./subagent-registry-Fio11IHF.js";
|
|
5
5
|
|
|
6
6
|
//#region src/plugins/status.ts
|
|
7
7
|
const log = createSubsystemLogger("plugins");
|
|
@@ -14,7 +14,7 @@ import { n as listChannelPlugins } from "./plugins-Bq-Msc8Z.js";
|
|
|
14
14
|
import { o as getTailnetHostname, s as readTailscaleStatusJson } from "./tailscale-BsA0YClX.js";
|
|
15
15
|
import { i as formatPortDiagnostics, n as inspectPortUsage } from "./ports-Cv4kt1bT.js";
|
|
16
16
|
import { c as resolveStorePath } from "./paths-CNexk5_o.js";
|
|
17
|
-
import { t as getMemorySearchManager } from "./memory-
|
|
17
|
+
import { t as getMemorySearchManager } from "./memory-DAiUTYsN.js";
|
|
18
18
|
import { n as formatTimeAgo } from "./format-relative-Cyq001S7.js";
|
|
19
19
|
import { t as getRemoteSkillEligibility } from "./skills-remote-DHfuS68n.js";
|
|
20
20
|
import { _ as peekSystemEvents, b as formatChannelAllowFrom, d as formatUsageReportLines, n as sha256HexPrefix, o as readRestartSentinel, s as summarizeRestartSentinel, u as loadProviderUsageSummary, v as buildChannelSummary, y as buildChannelAccountSnapshot } from "./redact-identifier-Cm1VfV7E.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as createPluginLoaderLogger, s as loadSymiPlugins } from "./unified-runner-
|
|
1
|
+
import { o as createPluginLoaderLogger, s as loadSymiPlugins } from "./unified-runner-B3G4fVeJ.js";
|
|
2
2
|
import { t as createSubsystemLogger } from "./subsystem-CtH6J8AV.js";
|
|
3
3
|
import { D as resolveDefaultAgentWorkspaceDir, c as resolveAgentWorkspaceDir, l as resolveDefaultAgentId } from "./agent-scope-DIjW66iO.js";
|
|
4
4
|
import { i as loadConfig } from "./config-DqMsGcSQ.js";
|
|
@@ -44,8 +44,8 @@ import { t as emitSessionTranscriptUpdate } from "./transcript-events-C1GkbPky.j
|
|
|
44
44
|
import { a as normalizeElevatedLevel, c as normalizeUsageDisplay, d as supportsXHighThinking, l as normalizeVerboseLevel, n as formatXHighModelHint, o as normalizeReasoningLevel, s as normalizeThinkLevel, t as formatThinkingLevels, u as resolveResponseUsageMode } from "./thinking-BDh5LPh-.js";
|
|
45
45
|
import { t as ensureSymiModelsJson } from "./models-config-yKxNCn4V.js";
|
|
46
46
|
import { i as resolveAckReaction, o as resolveEffectiveMessagesConfig, r as resolveResponsePrefixTemplate, s as resolveHumanDelayConfig, t as createReplyPrefixOptions } from "./reply-prefix-B7pYEiW_.js";
|
|
47
|
-
import { n as resolveMemoryBackendConfig, t as getMemorySearchManager } from "./memory-
|
|
48
|
-
import { a as parseGeminiAuth, c as resolveMemorySearchConfig, n as retryAsync, o as collectProviderApiKeysForExecution, s as executeWithApiKeyRotation } from "./manager-
|
|
47
|
+
import { n as resolveMemoryBackendConfig, t as getMemorySearchManager } from "./memory-DAiUTYsN.js";
|
|
48
|
+
import { a as parseGeminiAuth, c as resolveMemorySearchConfig, n as retryAsync, o as collectProviderApiKeysForExecution, s as executeWithApiKeyRotation } from "./manager-v-DndeD8.js";
|
|
49
49
|
import { f as runTasksWithConcurrency } from "./internal-BuBDa4KX.js";
|
|
50
50
|
import { a as chunkText, c as resolveChunkMode, d as isSafeFenceBreak, f as parseFenceSpans, i as chunkMarkdownTextWithMode, l as resolveTextChunkLimit, o as chunkTextWithMode, r as chunkMarkdownText, t as chunkByNewline, u as findFenceSpanAt } from "./chunk-BySyfaEr.js";
|
|
51
51
|
import { n as resolveMarkdownTableMode } from "./markdown-tables-CCOfinlW.js";
|
|
@@ -76,7 +76,7 @@ import { i as parseAbsoluteTimeMs, r as resolveDefaultCronStaggerMs, t as normal
|
|
|
76
76
|
import { n as resolveMessageChannelSelection, t as listConfiguredMessageChannels } from "./channel-selection-p35DYzAL.js";
|
|
77
77
|
import { n as resolveAgentRoute, t as buildAgentSessionKey } from "./resolve-route-DNKcB7Q9.js";
|
|
78
78
|
import { t as parseTimeoutMs } from "./parse-timeout-CMozMfzr.js";
|
|
79
|
-
import { n as registerMemoryCli } from "./memory-cli-
|
|
79
|
+
import { n as registerMemoryCli } from "./memory-cli-Xhj74cTT.js";
|
|
80
80
|
import { i as resolveSlackThreadTs, n as deliverReplies, t as createSlackReplyDeliveryPlan } from "./replies-DIHkSwoW.js";
|
|
81
81
|
import { a as resolveSubagentToolPolicy, i as resolveGroupToolPolicy, n as isToolAllowedByPolicies, r as resolveEffectiveToolPolicy, t as filterToolsByPolicy } from "./pi-tools.policy-BaRznBvu.js";
|
|
82
82
|
import { createRequire } from "node:module";
|
|
@@ -30988,91 +30988,6 @@ function createOutputNormalizer(profile, modelId) {
|
|
|
30988
30988
|
//#endregion
|
|
30989
30989
|
//#region src/agents/model-aware-stream.ts
|
|
30990
30990
|
/**
|
|
30991
|
-
* Match imperative tool requests:
|
|
30992
|
-
* "Use the exec tool to run X"
|
|
30993
|
-
* "use exec to ..."
|
|
30994
|
-
* "Please invoke the read tool"
|
|
30995
|
-
* "call memory_search with ..."
|
|
30996
|
-
*
|
|
30997
|
-
* Anchored to start-of-string, start-of-line, or after a closing-bracket
|
|
30998
|
-
* delimiter `] ` (covers Symi's `[Thu 2026-04-30 20:48 EDT] ` timestamp
|
|
30999
|
-
* envelope, the `[Outlook 365] ` plugin banner, and similar prefixes that
|
|
31000
|
-
* gateway middleware can inject before the user's actual prompt — verified
|
|
31001
|
-
* live: `chat.send` from Glass UI ships content like
|
|
31002
|
-
*
|
|
31003
|
-
* Conversation info (untrusted metadata):
|
|
31004
|
-
* ```json
|
|
31005
|
-
* { "message_id": "...", ... }
|
|
31006
|
-
* ```
|
|
31007
|
-
*
|
|
31008
|
-
* [Thu 2026-04-30 20:48 EDT] Use the exec tool to run: hostname
|
|
31009
|
-
*
|
|
31010
|
-
* so the `Use` is preceded by `] ` not by `\n` or `^`).
|
|
31011
|
-
*
|
|
31012
|
-
* Verb list is conservative (use/invoke/call/please-{use,call}) — pure
|
|
31013
|
-
* imperative verbs that read unambiguously as "do this for me." Tool name
|
|
31014
|
-
* must match EXPLICIT_TOOL_NAMES exactly to keep "use poetic language" /
|
|
31015
|
-
* "use clear writing" / etc. from triggering.
|
|
31016
|
-
*/
|
|
31017
|
-
const EXPLICIT_TOOL_REQUEST_PATTERN = new RegExp(String.raw`(?:^|\n|\]\s)\s*(?:please\s+)?(?:use|invoke|call)\s+(?:the\s+)?(?:` + [
|
|
31018
|
-
"exec",
|
|
31019
|
-
"bash",
|
|
31020
|
-
"read",
|
|
31021
|
-
"write",
|
|
31022
|
-
"edit",
|
|
31023
|
-
"patch",
|
|
31024
|
-
"web_search",
|
|
31025
|
-
"web_fetch",
|
|
31026
|
-
"browser",
|
|
31027
|
-
"browser_navigate",
|
|
31028
|
-
"browser_snapshot",
|
|
31029
|
-
"browser_click",
|
|
31030
|
-
"browser_type",
|
|
31031
|
-
"memory_search",
|
|
31032
|
-
"memory_get",
|
|
31033
|
-
"memory_pin",
|
|
31034
|
-
"memory_unpin",
|
|
31035
|
-
"spawn_agent",
|
|
31036
|
-
"message",
|
|
31037
|
-
"task_list",
|
|
31038
|
-
"task_cancel",
|
|
31039
|
-
"cron",
|
|
31040
|
-
"fetch",
|
|
31041
|
-
"skill_search"
|
|
31042
|
-
].map((n) => n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|") + String.raw`)(?:\s+tool)?\b`, "i");
|
|
31043
|
-
/**
|
|
31044
|
-
* Extract the user-role text ONLY when it's the LAST message in the
|
|
31045
|
-
* conversation (i.e., we're at the start of a fresh turn, not in the
|
|
31046
|
-
* middle of an agent loop). Returns "" when:
|
|
31047
|
-
* - messages isn't an array
|
|
31048
|
-
* - the last message isn't user-role (= we're after a tool_call /
|
|
31049
|
-
* tool_result and the model is continuing — forcing tool_choice
|
|
31050
|
-
* "required" here would loop the agent: model must call a tool →
|
|
31051
|
-
* tool result → model must call ANOTHER tool → tool result → ...)
|
|
31052
|
-
*
|
|
31053
|
-
* Verified live on 3.0.7 dev: with the original "find any prior user
|
|
31054
|
-
* message" implementation, every agent-loop iteration saw the same
|
|
31055
|
-
* matching userText and re-forced tool_choice="required", spinning the
|
|
31056
|
-
* model in an infinite tool-call loop and timing out at 180s.
|
|
31057
|
-
*/
|
|
31058
|
-
function extractLastUserText(messages) {
|
|
31059
|
-
if (!Array.isArray(messages) || messages.length === 0) return "";
|
|
31060
|
-
const last = messages[messages.length - 1];
|
|
31061
|
-
if (!last || typeof last !== "object") return "";
|
|
31062
|
-
const msg = last;
|
|
31063
|
-
if (msg.role !== "user") return "";
|
|
31064
|
-
if (typeof msg.content === "string") return msg.content;
|
|
31065
|
-
if (Array.isArray(msg.content)) {
|
|
31066
|
-
const parts = [];
|
|
31067
|
-
for (const part of msg.content) if (part && typeof part === "object") {
|
|
31068
|
-
const block = part;
|
|
31069
|
-
if (block.type === "text" && typeof block.text === "string") parts.push(block.text);
|
|
31070
|
-
}
|
|
31071
|
-
return parts.join("\n");
|
|
31072
|
-
}
|
|
31073
|
-
return "";
|
|
31074
|
-
}
|
|
31075
|
-
/**
|
|
31076
30991
|
* Create a single stream function wrapper that handles all provider-specific
|
|
31077
30992
|
* param injection via one onPayload hook.
|
|
31078
30993
|
*
|
|
@@ -31120,10 +31035,6 @@ function createModelAwareStreamFn(opts) {
|
|
|
31120
31035
|
delete p.store;
|
|
31121
31036
|
}
|
|
31122
31037
|
if (Array.isArray(p.tools) && p.tools.length > 0 && p.tool_choice === void 0) p.tool_choice = "auto";
|
|
31123
|
-
if (Array.isArray(p.tools) && p.tools.length > 0 && p.tool_choice === "auto") {
|
|
31124
|
-
const userText = extractLastUserText(p.messages);
|
|
31125
|
-
if (userText && EXPLICIT_TOOL_REQUEST_PATTERN.test(userText)) p.tool_choice = "required";
|
|
31126
|
-
}
|
|
31127
31038
|
}
|
|
31128
31039
|
callerOnPayload?.(payload);
|
|
31129
31040
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as runAgentTurn } from "./unified-runner-
|
|
1
|
+
import { t as runAgentTurn } from "./unified-runner-B3G4fVeJ.js";
|
|
2
2
|
import "./registry-DKJLAPDB.js";
|
|
3
3
|
import "./paths-BSzKwaxE.js";
|
|
4
4
|
import "./utils-BU8jVQFM.js";
|
|
@@ -45,8 +45,8 @@ import "./session-cost-usage-DYcv40ss.js";
|
|
|
45
45
|
import "./session-utils-CgGDr4eh.js";
|
|
46
46
|
import "./with-timeout-BE7lxhxW.js";
|
|
47
47
|
import "./reply-prefix-BOdARKaY.js";
|
|
48
|
-
import "./memory-
|
|
49
|
-
import "./manager-
|
|
48
|
+
import "./memory-DIz78XgT.js";
|
|
49
|
+
import "./manager-CnHkbF80.js";
|
|
50
50
|
import "./sqlite-DBEvS-Ne.js";
|
|
51
51
|
import "./chunk-DQGU0F8t.js";
|
|
52
52
|
import "./markdown-tables-GTLvbzuR.js";
|
|
@@ -76,7 +76,7 @@ import "./links-CSaUKNKm.js";
|
|
|
76
76
|
import "./cli-utils-CX1oQ81G.js";
|
|
77
77
|
import "./help-format-BI_G2p1e.js";
|
|
78
78
|
import "./progress-CyPyGCDn.js";
|
|
79
|
-
import "./memory-cli-
|
|
79
|
+
import "./memory-cli-DfW-A_QO.js";
|
|
80
80
|
import "./logging-B5YNzZB9.js";
|
|
81
81
|
import "./replies-B2O2eRh6.js";
|
|
82
82
|
import "./pi-tools.policy-Dyx3nBmp.js";
|
|
@@ -14,7 +14,7 @@ import "./client-Dp8LUTmF.js";
|
|
|
14
14
|
import "./call-5IE9ycvm.js";
|
|
15
15
|
import "./message-channel-CNPAq1Tl.js";
|
|
16
16
|
import "./pairing-token-Bnr7QjVF.js";
|
|
17
|
-
import { T as runAgentTurn } from "./subagent-registry-
|
|
17
|
+
import { T as runAgentTurn } from "./subagent-registry-Fio11IHF.js";
|
|
18
18
|
import "./sessions-BNEDanZO.js";
|
|
19
19
|
import "./plugins-Bq-Msc8Z.js";
|
|
20
20
|
import "./send-EluKytgO.js";
|
|
@@ -42,8 +42,8 @@ import "./paths-CNexk5_o.js";
|
|
|
42
42
|
import "./thinking-BDh5LPh-.js";
|
|
43
43
|
import "./models-config-yKxNCn4V.js";
|
|
44
44
|
import "./reply-prefix-B7pYEiW_.js";
|
|
45
|
-
import "./memory-
|
|
46
|
-
import "./manager-
|
|
45
|
+
import "./memory-DAiUTYsN.js";
|
|
46
|
+
import "./manager-v-DndeD8.js";
|
|
47
47
|
import "./sqlite-l3CZYU6t.js";
|
|
48
48
|
import "./chunk-BySyfaEr.js";
|
|
49
49
|
import "./markdown-tables-CCOfinlW.js";
|
|
@@ -73,7 +73,7 @@ import "./links-Db3Rw0Tg.js";
|
|
|
73
73
|
import "./cli-utils-BqMwAlgf.js";
|
|
74
74
|
import "./help-format-DbbIlOje.js";
|
|
75
75
|
import "./progress-C4ck6JXh.js";
|
|
76
|
-
import "./memory-cli-
|
|
76
|
+
import "./memory-cli-Xhj74cTT.js";
|
|
77
77
|
import "./logging-D0L9TWhE.js";
|
|
78
78
|
import "./replies-DIHkSwoW.js";
|
|
79
79
|
import "./pi-tools.policy-BaRznBvu.js";
|
|
@@ -3,14 +3,14 @@ import "./registry-C-JddWwo.js";
|
|
|
3
3
|
import "./agent-scope-B1Ina6jV.js";
|
|
4
4
|
import { t as createSubsystemLogger } from "./subsystem-DzRUKS9f.js";
|
|
5
5
|
import "./workspace-CsaDUuDn.js";
|
|
6
|
-
import { t as runAgentTurn } from "./unified-runner-
|
|
6
|
+
import { t as runAgentTurn } from "./unified-runner-V6KJgMsY.js";
|
|
7
7
|
import "./auth-profiles-Boy_KMd1.js";
|
|
8
8
|
import "./github-copilot-token-B31ugq7R.js";
|
|
9
9
|
import "./boolean-mcn6kL0s.js";
|
|
10
|
-
import "./deliver-
|
|
10
|
+
import "./deliver-59sRVaYQ.js";
|
|
11
11
|
import "./ssrf-CeQ2Aub-.js";
|
|
12
12
|
import "./manifest-registry-C0nJ3Ja3.js";
|
|
13
|
-
import "./chrome-
|
|
13
|
+
import "./chrome-DT1fIVG1.js";
|
|
14
14
|
import "./frontmatter-CwO0i5Q7.js";
|
|
15
15
|
import "./skills-DaU_5XvP.js";
|
|
16
16
|
import "./redact-Dd8jrogi.js";
|
|
@@ -26,7 +26,7 @@ import "./diagnostic-D7z6O7v0.js";
|
|
|
26
26
|
import "./diagnostic-session-state-BkfiP_y6.js";
|
|
27
27
|
import "./pi-auth-json-De8XczIE.js";
|
|
28
28
|
import "./reply-prefix-D3muTai5.js";
|
|
29
|
-
import "./manager-
|
|
29
|
+
import "./manager-DkZ5wkXy.js";
|
|
30
30
|
import "./sqlite--aBEq1-J.js";
|
|
31
31
|
import "./markdown-tables-ptfgMe6b.js";
|
|
32
32
|
import "./commands-registry-CBFyeJ5K.js";
|
|
@@ -7,21 +7,21 @@ import "./reply-prefix-i-FPYcoQ.js";
|
|
|
7
7
|
import "./github-copilot-token-BbsJ0Qbo.js";
|
|
8
8
|
import "./plugins-Cp39v6b_.js";
|
|
9
9
|
import "./replies-DU-fXkSk.js";
|
|
10
|
-
import { n as runAgentTurn } from "./pi-embedded-
|
|
11
|
-
import "./deliver-
|
|
10
|
+
import { n as runAgentTurn } from "./pi-embedded-C1ziBpAk.js";
|
|
11
|
+
import "./deliver-Mqq3tgqB.js";
|
|
12
12
|
import "./diagnostic-BvZmqxYI.js";
|
|
13
13
|
import "./diagnostic-session-state-CWtaDOiK.js";
|
|
14
14
|
import "./chunk-BjnT3w_x.js";
|
|
15
15
|
import "./ssrf-CBajKNWO.js";
|
|
16
16
|
import "./manifest-registry-CAWGTwb5.js";
|
|
17
|
-
import "./chrome-
|
|
17
|
+
import "./chrome-CPSDqbK6.js";
|
|
18
18
|
import "./skills-Bn0f9KTL.js";
|
|
19
19
|
import "./redact-ojHFHOAb.js";
|
|
20
20
|
import "./errors-C6sHIFo_.js";
|
|
21
21
|
import "./tokens-Dm_xa-oz.js";
|
|
22
22
|
import "./thinking-BKsvyjWX.js";
|
|
23
23
|
import "./paths-N698mtPE.js";
|
|
24
|
-
import "./manager-
|
|
24
|
+
import "./manager-CWnvYURh.js";
|
|
25
25
|
import "./sqlite-jFnvSfLz.js";
|
|
26
26
|
import "./markdown-tables-BtWlyyt1.js";
|
|
27
27
|
import "./commands-registry-BRWqR35Z.js";
|
|
@@ -47,8 +47,8 @@ import { c as hasNonzeroUsage, l as normalizeUsage, n as loadCostUsageSummary, o
|
|
|
47
47
|
import { C as enqueueSystemEvent, E as buildChannelSummary, S as drainSystemEventEntries, _ as loadProviderUsageSummary, a as loadCombinedSessionStoreForGateway, b as resolveUsageProviderId, d as formatDoctorNonInteractiveHint, g as writeRestartSentinel, k as redactIdentifier, x as lookupContextTokens, y as formatUsageWindowSummary } from "./session-utils-CgGDr4eh.js";
|
|
48
48
|
import { n as createBrowserRouteDispatcher, r as getMachineDisplayName, t as withTimeout$2 } from "./with-timeout-BE7lxhxW.js";
|
|
49
49
|
import { i as resolveAckReaction, o as resolveEffectiveMessagesConfig, r as resolveResponsePrefixTemplate, s as resolveHumanDelayConfig, t as createReplyPrefixOptions } from "./reply-prefix-BOdARKaY.js";
|
|
50
|
-
import { n as resolveMemoryBackendConfig, t as getMemorySearchManager } from "./memory-
|
|
51
|
-
import { a as parseGeminiAuth, c as resolveMemorySearchConfig, n as retryAsync, o as collectProviderApiKeysForExecution, s as executeWithApiKeyRotation } from "./manager-
|
|
50
|
+
import { n as resolveMemoryBackendConfig, t as getMemorySearchManager } from "./memory-DIz78XgT.js";
|
|
51
|
+
import { a as parseGeminiAuth, c as resolveMemorySearchConfig, n as retryAsync, o as collectProviderApiKeysForExecution, s as executeWithApiKeyRotation } from "./manager-CnHkbF80.js";
|
|
52
52
|
import { f as runTasksWithConcurrency } from "./internal-CHnZdvRy.js";
|
|
53
53
|
import { a as chunkText, c as resolveChunkMode, d as isSafeFenceBreak, f as parseFenceSpans, i as chunkMarkdownTextWithMode, l as resolveTextChunkLimit, o as chunkTextWithMode, r as chunkMarkdownText, t as chunkByNewline, u as findFenceSpanAt } from "./chunk-DQGU0F8t.js";
|
|
54
54
|
import { n as resolveMarkdownTableMode } from "./markdown-tables-GTLvbzuR.js";
|
|
@@ -79,7 +79,7 @@ import { i as parseAbsoluteTimeMs, r as resolveDefaultCronStaggerMs, t as normal
|
|
|
79
79
|
import { n as resolveMessageChannelSelection, t as listConfiguredMessageChannels } from "./channel-selection-BvIcXQLj.js";
|
|
80
80
|
import { n as resolveAgentRoute, t as buildAgentSessionKey } from "./resolve-route-CRWE36h5.js";
|
|
81
81
|
import { t as parseTimeoutMs } from "./parse-timeout-CpgyC-LD.js";
|
|
82
|
-
import { n as registerMemoryCli } from "./memory-cli-
|
|
82
|
+
import { n as registerMemoryCli } from "./memory-cli-DfW-A_QO.js";
|
|
83
83
|
import { i as resolveSlackThreadTs, n as deliverReplies, t as createSlackReplyDeliveryPlan } from "./replies-B2O2eRh6.js";
|
|
84
84
|
import { a as resolveSubagentToolPolicy, i as resolveGroupToolPolicy, n as isToolAllowedByPolicies, r as resolveEffectiveToolPolicy, t as filterToolsByPolicy } from "./pi-tools.policy-Dyx3nBmp.js";
|
|
85
85
|
import { a as buildModelAliasLines, n as resolveModel$2 } from "./model-BRcKPW49.js";
|
|
@@ -44150,91 +44150,6 @@ function createOutputNormalizer(profile, modelId) {
|
|
|
44150
44150
|
//#endregion
|
|
44151
44151
|
//#region src/agents/model-aware-stream.ts
|
|
44152
44152
|
/**
|
|
44153
|
-
* Match imperative tool requests:
|
|
44154
|
-
* "Use the exec tool to run X"
|
|
44155
|
-
* "use exec to ..."
|
|
44156
|
-
* "Please invoke the read tool"
|
|
44157
|
-
* "call memory_search with ..."
|
|
44158
|
-
*
|
|
44159
|
-
* Anchored to start-of-string, start-of-line, or after a closing-bracket
|
|
44160
|
-
* delimiter `] ` (covers Symi's `[Thu 2026-04-30 20:48 EDT] ` timestamp
|
|
44161
|
-
* envelope, the `[Outlook 365] ` plugin banner, and similar prefixes that
|
|
44162
|
-
* gateway middleware can inject before the user's actual prompt — verified
|
|
44163
|
-
* live: `chat.send` from Glass UI ships content like
|
|
44164
|
-
*
|
|
44165
|
-
* Conversation info (untrusted metadata):
|
|
44166
|
-
* ```json
|
|
44167
|
-
* { "message_id": "...", ... }
|
|
44168
|
-
* ```
|
|
44169
|
-
*
|
|
44170
|
-
* [Thu 2026-04-30 20:48 EDT] Use the exec tool to run: hostname
|
|
44171
|
-
*
|
|
44172
|
-
* so the `Use` is preceded by `] ` not by `\n` or `^`).
|
|
44173
|
-
*
|
|
44174
|
-
* Verb list is conservative (use/invoke/call/please-{use,call}) — pure
|
|
44175
|
-
* imperative verbs that read unambiguously as "do this for me." Tool name
|
|
44176
|
-
* must match EXPLICIT_TOOL_NAMES exactly to keep "use poetic language" /
|
|
44177
|
-
* "use clear writing" / etc. from triggering.
|
|
44178
|
-
*/
|
|
44179
|
-
const EXPLICIT_TOOL_REQUEST_PATTERN = new RegExp(String.raw`(?:^|\n|\]\s)\s*(?:please\s+)?(?:use|invoke|call)\s+(?:the\s+)?(?:` + [
|
|
44180
|
-
"exec",
|
|
44181
|
-
"bash",
|
|
44182
|
-
"read",
|
|
44183
|
-
"write",
|
|
44184
|
-
"edit",
|
|
44185
|
-
"patch",
|
|
44186
|
-
"web_search",
|
|
44187
|
-
"web_fetch",
|
|
44188
|
-
"browser",
|
|
44189
|
-
"browser_navigate",
|
|
44190
|
-
"browser_snapshot",
|
|
44191
|
-
"browser_click",
|
|
44192
|
-
"browser_type",
|
|
44193
|
-
"memory_search",
|
|
44194
|
-
"memory_get",
|
|
44195
|
-
"memory_pin",
|
|
44196
|
-
"memory_unpin",
|
|
44197
|
-
"spawn_agent",
|
|
44198
|
-
"message",
|
|
44199
|
-
"task_list",
|
|
44200
|
-
"task_cancel",
|
|
44201
|
-
"cron",
|
|
44202
|
-
"fetch",
|
|
44203
|
-
"skill_search"
|
|
44204
|
-
].map((n) => n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|") + String.raw`)(?:\s+tool)?\b`, "i");
|
|
44205
|
-
/**
|
|
44206
|
-
* Extract the user-role text ONLY when it's the LAST message in the
|
|
44207
|
-
* conversation (i.e., we're at the start of a fresh turn, not in the
|
|
44208
|
-
* middle of an agent loop). Returns "" when:
|
|
44209
|
-
* - messages isn't an array
|
|
44210
|
-
* - the last message isn't user-role (= we're after a tool_call /
|
|
44211
|
-
* tool_result and the model is continuing — forcing tool_choice
|
|
44212
|
-
* "required" here would loop the agent: model must call a tool →
|
|
44213
|
-
* tool result → model must call ANOTHER tool → tool result → ...)
|
|
44214
|
-
*
|
|
44215
|
-
* Verified live on 3.0.7 dev: with the original "find any prior user
|
|
44216
|
-
* message" implementation, every agent-loop iteration saw the same
|
|
44217
|
-
* matching userText and re-forced tool_choice="required", spinning the
|
|
44218
|
-
* model in an infinite tool-call loop and timing out at 180s.
|
|
44219
|
-
*/
|
|
44220
|
-
function extractLastUserText(messages) {
|
|
44221
|
-
if (!Array.isArray(messages) || messages.length === 0) return "";
|
|
44222
|
-
const last = messages[messages.length - 1];
|
|
44223
|
-
if (!last || typeof last !== "object") return "";
|
|
44224
|
-
const msg = last;
|
|
44225
|
-
if (msg.role !== "user") return "";
|
|
44226
|
-
if (typeof msg.content === "string") return msg.content;
|
|
44227
|
-
if (Array.isArray(msg.content)) {
|
|
44228
|
-
const parts = [];
|
|
44229
|
-
for (const part of msg.content) if (part && typeof part === "object") {
|
|
44230
|
-
const block = part;
|
|
44231
|
-
if (block.type === "text" && typeof block.text === "string") parts.push(block.text);
|
|
44232
|
-
}
|
|
44233
|
-
return parts.join("\n");
|
|
44234
|
-
}
|
|
44235
|
-
return "";
|
|
44236
|
-
}
|
|
44237
|
-
/**
|
|
44238
44153
|
* Create a single stream function wrapper that handles all provider-specific
|
|
44239
44154
|
* param injection via one onPayload hook.
|
|
44240
44155
|
*
|
|
@@ -44282,10 +44197,6 @@ function createModelAwareStreamFn(opts) {
|
|
|
44282
44197
|
delete p.store;
|
|
44283
44198
|
}
|
|
44284
44199
|
if (Array.isArray(p.tools) && p.tools.length > 0 && p.tool_choice === void 0) p.tool_choice = "auto";
|
|
44285
|
-
if (Array.isArray(p.tools) && p.tools.length > 0 && p.tool_choice === "auto") {
|
|
44286
|
-
const userText = extractLastUserText(p.messages);
|
|
44287
|
-
if (userText && EXPLICIT_TOOL_REQUEST_PATTERN.test(userText)) p.tool_choice = "required";
|
|
44288
|
-
}
|
|
44289
44200
|
}
|
|
44290
44201
|
callerOnPayload?.(payload);
|
|
44291
44202
|
};
|
|
@@ -8,10 +8,10 @@ import { S as logWarn, _ as runExec, b as logError, f as loadWorkspaceBootstrapF
|
|
|
8
8
|
import { $ as DEFAULT_MODEL, A as resolveThinkingDefault, B as requireApiKey, C as normalizeModelRef$1, D as resolveDefaultModelForAgent, E as resolveConfiguredModelRef, F as resolveImplicitProviders, G as normalizeSecretInput, H as resolveEnvApiKey, I as OLLAMA_NATIVE_BASE_URL, J as resolveShellEnvFallbackTimeoutMs, K as getShellPathFromLoginShell, L as createOllamaStreamFn, M as normalizeProviders, N as resolveImplicitBedrockProvider, O as resolveModelRefFromString, P as resolveImplicitCopilotProvider, Q as DEFAULT_CONTEXT_TOKENS, R as getApiKeyForModel, S as modelKey, U as resolveModelAuthMode, V as resolveApiKeyForProvider, Z as isTruthyEnvValue, _ as buildAllowedModelSet, a as markAuthProfileFailure, b as findNormalizedProviderValue, c as dedupeProfileIds, d as ensureAuthProfileStore, et as DEFAULT_PROVIDER, f as resolveAuthStorePathForDisplay, i as isProfileInCooldown, j as normalizeGoogleModelId, k as resolveSubagentSpawnModelSelection, l as listProfilesForProvider, m as withFileLock$1, n as resolveAuthProfileOrder, nt as resolveCliName, o as markAuthProfileUsed, p as resolveSymiAgentDir, r as getSoonestCooldownExpiry, rt as resolveAuthProfileDisplayLabel, s as resolveApiKeyForProfile, tt as formatCliCommand, u as markAuthProfileGood, v as buildConfiguredAllowlistKeys, w as normalizeProviderId, y as buildModelAliasIndex, z as getCustomProviderApiKey } from "./auth-profiles-Boy_KMd1.js";
|
|
9
9
|
import { a as saveJsonFile, i as loadJsonFile } from "./github-copilot-token-B31ugq7R.js";
|
|
10
10
|
import { t as parseBooleanValue } from "./boolean-mcn6kL0s.js";
|
|
11
|
-
import { $ as resolveSandboxContext, $t as resolveBrowserControlAuth, A as isGoogleModelApi, At as resolveSessionResetPolicy, B as isCompactionFailureError, Bt as resolveGroupSessionKey, C as sanitizeImageBlocks, Ct as INPUT_PROVENANCE_KIND_VALUES, D as extractToolResultId, Dt as resolveSessionKey, E as extractToolCallsFromAssistant, Et as normalizeInputProvenance, F as formatRawAssistantErrorForUi, Ft as canonicalizeMainSessionAlias, G as isRateLimitAssistantError, Gt as resolveBrowserConfig, H as isFailoverAssistantError, Ht as resolveSessionLockMaxHoldFromTimeout, I as getApiErrorPayloadFingerprint, J as isTransientHttpError, Jt as saveMediaBuffer, K as isRawApiErrorPayload, Kt as resolveProfile, L as isAuthAssistantError, M as classifyFailoverReason, Mt as resolveThreadFlag, N as formatAssistantErrorText, Nt as DEFAULT_RESET_TRIGGERS, O as downgradeOpenAIReasoningBlocks, Ot as evaluateSessionFreshness, P as formatBillingErrorMessage, Pt as resolveFreshSessionTotalTokens, Q as ensureSandboxWorkspaceForSession, Qt as ensureBrowserControlAuth, R as isBillingAssistantError, Rt as resolveMainSessionKey, S as sanitizeSessionMessagesImages, St as extractToolCallNames, T as resolveImageSanitizationLimits, Tt as hasInterSessionUserProvenance, U as isFailoverErrorMessage, Ut as createBrowserRouteContext, V as isContextOverflowError, Vt as acquireSessionWriteLock, W as isLikelyContextOverflowError, Wt as registerBrowserRoutes, X as parseImageSizeError, Xt as resolveExistingPathsWithinRoot, Y as parseImageDimensionError, Yt as DEFAULT_UPLOAD_DIR, Z as sanitizeUserFacingText, Zt as getBridgeAuthForPort, _ as validateAnthropicTurns, _t as normalizeSessionDeliveryFields, an as mergeAlsoAllowPolicy, at as loadSessionStore, b as isMessagingToolDuplicateNormalized, bt as capArrayByJsonBytes, c as normalizeChannelTargetInput, cn as stripPluginOnlyAllowlist, ct as updateLastRoute, d as parseReplyDirectives, dn as buildBootstrapContextFiles, dt as isCacheEnabled, en as applyOwnerOnlyToolPolicy, et as resolveSandboxRuntimeStatus, f as MEDIA_TOKEN_RE, fn as ensureSessionHeader, ft as resolveCacheTtlMs$1, g as initializeGlobalHookRunner, gt as normalizeDeliveryContext, h as getGlobalHookRunner, hn as sanitizeGoogleTurnOrdering, ht as mergeDeliveryContext, in as expandToolGroups, it as resolveAndPersistSessionFile, j as BILLING_ERROR_USER_MESSAGE, jt as resolveSessionResetType, k as isAntigravityClaude, kt as resolveChannelResetConfig, l as normalizeTargetForProvider, ln as compileGlobPatterns, lt as updateSessionStore, m as parseInlineDirectives$1, mn as resolveBootstrapTotalMaxChars, mt as deliveryContextKey, nn as collectExplicitAllowlist, o as normalizeReplyPayloadsForDelivery, on as normalizeToolName$1, ot as readSessionUpdatedAt, p as splitMediaFromOutput, pn as resolveBootstrapMaxChars, pt as deliveryContextFromSession, q as isTimeoutErrorMessage, qt as getMediaDir, rn as expandPolicyWithPluginGroups, rt as appendAssistantMessageToSessionTranscript, s as buildTargetResolverSignature, sn as resolveToolProfilePolicy, st as recordSessionMetaFromInbound, t as deliverOutboundPayloads, tn as buildPluginToolGroups, tt as extractDeliveryInfo, u as throwIfAborted, un as matchesAnyGlobPattern, ut as updateSessionStoreEntry, v as validateGeminiTurns, w as sanitizeToolResultImages, wt as applyInputProvenanceToUserMessage, x as normalizeTextForComparison, xt as countToolResults, y as pickFallbackThinkingLevel, yt as archiveSessionTranscripts, z as isCloudCodeAssistFormatError, zt as deriveSessionMetaPatch } from "./deliver-
|
|
11
|
+
import { $ as resolveSandboxContext, $t as resolveBrowserControlAuth, A as isGoogleModelApi, At as resolveSessionResetPolicy, B as isCompactionFailureError, Bt as resolveGroupSessionKey, C as sanitizeImageBlocks, Ct as INPUT_PROVENANCE_KIND_VALUES, D as extractToolResultId, Dt as resolveSessionKey, E as extractToolCallsFromAssistant, Et as normalizeInputProvenance, F as formatRawAssistantErrorForUi, Ft as canonicalizeMainSessionAlias, G as isRateLimitAssistantError, Gt as resolveBrowserConfig, H as isFailoverAssistantError, Ht as resolveSessionLockMaxHoldFromTimeout, I as getApiErrorPayloadFingerprint, J as isTransientHttpError, Jt as saveMediaBuffer, K as isRawApiErrorPayload, Kt as resolveProfile, L as isAuthAssistantError, M as classifyFailoverReason, Mt as resolveThreadFlag, N as formatAssistantErrorText, Nt as DEFAULT_RESET_TRIGGERS, O as downgradeOpenAIReasoningBlocks, Ot as evaluateSessionFreshness, P as formatBillingErrorMessage, Pt as resolveFreshSessionTotalTokens, Q as ensureSandboxWorkspaceForSession, Qt as ensureBrowserControlAuth, R as isBillingAssistantError, Rt as resolveMainSessionKey, S as sanitizeSessionMessagesImages, St as extractToolCallNames, T as resolveImageSanitizationLimits, Tt as hasInterSessionUserProvenance, U as isFailoverErrorMessage, Ut as createBrowserRouteContext, V as isContextOverflowError, Vt as acquireSessionWriteLock, W as isLikelyContextOverflowError, Wt as registerBrowserRoutes, X as parseImageSizeError, Xt as resolveExistingPathsWithinRoot, Y as parseImageDimensionError, Yt as DEFAULT_UPLOAD_DIR, Z as sanitizeUserFacingText, Zt as getBridgeAuthForPort, _ as validateAnthropicTurns, _t as normalizeSessionDeliveryFields, an as mergeAlsoAllowPolicy, at as loadSessionStore, b as isMessagingToolDuplicateNormalized, bt as capArrayByJsonBytes, c as normalizeChannelTargetInput, cn as stripPluginOnlyAllowlist, ct as updateLastRoute, d as parseReplyDirectives, dn as buildBootstrapContextFiles, dt as isCacheEnabled, en as applyOwnerOnlyToolPolicy, et as resolveSandboxRuntimeStatus, f as MEDIA_TOKEN_RE, fn as ensureSessionHeader, ft as resolveCacheTtlMs$1, g as initializeGlobalHookRunner, gt as normalizeDeliveryContext, h as getGlobalHookRunner, hn as sanitizeGoogleTurnOrdering, ht as mergeDeliveryContext, in as expandToolGroups, it as resolveAndPersistSessionFile, j as BILLING_ERROR_USER_MESSAGE, jt as resolveSessionResetType, k as isAntigravityClaude, kt as resolveChannelResetConfig, l as normalizeTargetForProvider, ln as compileGlobPatterns, lt as updateSessionStore, m as parseInlineDirectives$1, mn as resolveBootstrapTotalMaxChars, mt as deliveryContextKey, nn as collectExplicitAllowlist, o as normalizeReplyPayloadsForDelivery, on as normalizeToolName$1, ot as readSessionUpdatedAt, p as splitMediaFromOutput, pn as resolveBootstrapMaxChars, pt as deliveryContextFromSession, q as isTimeoutErrorMessage, qt as getMediaDir, rn as expandPolicyWithPluginGroups, rt as appendAssistantMessageToSessionTranscript, s as buildTargetResolverSignature, sn as resolveToolProfilePolicy, st as recordSessionMetaFromInbound, t as deliverOutboundPayloads, tn as buildPluginToolGroups, tt as extractDeliveryInfo, u as throwIfAborted, un as matchesAnyGlobPattern, ut as updateSessionStoreEntry, v as validateGeminiTurns, w as sanitizeToolResultImages, wt as applyInputProvenanceToUserMessage, x as normalizeTextForComparison, xt as countToolResults, y as pickFallbackThinkingLevel, yt as archiveSessionTranscripts, z as isCloudCodeAssistFormatError, zt as deriveSessionMetaPatch } from "./deliver-59sRVaYQ.js";
|
|
12
12
|
import { C as unsetConfigValueAtPath, S as setConfigValueAtPath, T as VERSION, _ as resetConfigOverrides, b as getConfigValueAtPath, c as loadConfig, d as writeConfigFile, f as validateConfigObjectWithPlugins, g as getConfigOverrides, h as validateJsonSchemaValue, i as isBlockedHostnameOrIp, l as readConfigFileSnapshot, o as normalizeHostname, p as parseDurationMs, t as SsrFBlockedError, u as resolveConfigSnapshotHash, v as setConfigOverride, w as DEFAULT_SUBAGENT_MAX_SPAWN_DEPTH, x as parseConfigPath, y as unsetConfigOverride } from "./ssrf-CeQ2Aub-.js";
|
|
13
13
|
import { a as applyTestPluginDefaults, c as resolveMemorySlotDecision, d as isDangerousHostEnvVarName, i as safeStatSync, n as discoverSymiPlugins, o as normalizePluginsConfig, r as isPathInside, s as resolveEnableState, t as loadPluginManifestRegistry, u as isPathInsideWithRealpath } from "./manifest-registry-C0nJ3Ja3.js";
|
|
14
|
-
import { C as rawDataToString, O as DEFAULT_AI_SNAPSHOT_MAX_CHARS, T as isSecureWebSocketUrl, x as ensureChromeExtensionRelayServer } from "./chrome-
|
|
14
|
+
import { C as rawDataToString, O as DEFAULT_AI_SNAPSHOT_MAX_CHARS, T as isSecureWebSocketUrl, x as ensureChromeExtensionRelayServer } from "./chrome-DT1fIVG1.js";
|
|
15
15
|
import { l as parseFrontmatterBlock } from "./frontmatter-CwO0i5Q7.js";
|
|
16
16
|
import { c as assertSandboxPath, d as resolveSandboxedMediaSource, f as applySkillEnvOverrides, i as resolveSkillsPromptForRun, l as resolveSandboxInputPath, n as buildWorkspaceSkillSnapshot, p as applySkillEnvOverridesFromSnapshot, r as loadWorkspaceSkillEntries, s as assertMediaNotDataUrl } from "./skills-DaU_5XvP.js";
|
|
17
17
|
import { n as redactToolDetail } from "./redact-Dd8jrogi.js";
|
|
@@ -30,7 +30,7 @@ import { a as logMessageProcessed, i as logLaneEnqueue, o as logMessageQueued, r
|
|
|
30
30
|
import { n as getDiagnosticSessionState } from "./diagnostic-session-state-BkfiP_y6.js";
|
|
31
31
|
import { t as ensurePiAuthJsonFromAuthProfiles } from "./pi-auth-json-De8XczIE.js";
|
|
32
32
|
import { a as resolveEffectiveMessagesConfig, i as resolveAckReaction, o as resolveHumanDelayConfig, r as resolveResponsePrefixTemplate, t as createReplyPrefixOptions } from "./reply-prefix-D3muTai5.js";
|
|
33
|
-
import { a as parseGeminiAuth, c as resolveMemorySearchConfig, i as resolveOllamaBaseUrl, n as retryAsync, o as collectProviderApiKeysForExecution, r as probeOllamaEmbeddingModels, s as executeWithApiKeyRotation } from "./manager-
|
|
33
|
+
import { a as parseGeminiAuth, c as resolveMemorySearchConfig, i as resolveOllamaBaseUrl, n as retryAsync, o as collectProviderApiKeysForExecution, r as probeOllamaEmbeddingModels, s as executeWithApiKeyRotation } from "./manager-DkZ5wkXy.js";
|
|
34
34
|
import { c as normalizeExtraMemoryPaths, f as runTasksWithConcurrency, s as listMemoryFiles } from "./internal-Crkye5gI.js";
|
|
35
35
|
import { n as resolveMarkdownTableMode } from "./markdown-tables-ptfgMe6b.js";
|
|
36
36
|
import { a as shouldHandleTextCommands, c as resolveNativeCommandsEnabled, i as normalizeCommandBody, l as resolveNativeSkillsEnabled, n as listChatCommands, o as isCommandFlagEnabled, r as listChatCommandsForConfig, s as isRestartEnabled } from "./commands-registry-CBFyeJ5K.js";
|
|
@@ -54,7 +54,7 @@ import crypto, { X509Certificate, createHash, createHmac, randomBytes, randomUUI
|
|
|
54
54
|
import { complete, createAssistantMessageEventStream, streamSimple } from "@mariozechner/pi-ai";
|
|
55
55
|
import AjvPkg from "ajv";
|
|
56
56
|
import { CURRENT_SESSION_VERSION, DefaultResourceLoader, SessionManager, SettingsManager, codingTools, createAgentSession, createEditTool, createReadTool, createWriteTool, estimateTokens, generateSummary, readTool } from "@mariozechner/pi-coding-agent";
|
|
57
|
-
import { WebSocket } from "ws";
|
|
57
|
+
import { WebSocket as WebSocket$1 } from "ws";
|
|
58
58
|
import { Buffer as Buffer$1 } from "node:buffer";
|
|
59
59
|
import { createJiti } from "jiti";
|
|
60
60
|
import { Type } from "@sinclair/typebox";
|
|
@@ -2099,7 +2099,7 @@ async function getMemorySearchManager(params) {
|
|
|
2099
2099
|
const wrapper = new FallbackMemoryManager({
|
|
2100
2100
|
primary,
|
|
2101
2101
|
fallbackFactory: async () => {
|
|
2102
|
-
const { MemoryIndexManager } = await import("./manager-
|
|
2102
|
+
const { MemoryIndexManager } = await import("./manager-DkZ5wkXy.js").then((n) => n.t);
|
|
2103
2103
|
return await MemoryIndexManager.get(params);
|
|
2104
2104
|
}
|
|
2105
2105
|
}, () => QMD_MANAGER_CACHE.delete(cacheKey));
|
|
@@ -2112,7 +2112,7 @@ async function getMemorySearchManager(params) {
|
|
|
2112
2112
|
}
|
|
2113
2113
|
}
|
|
2114
2114
|
try {
|
|
2115
|
-
const { MemoryIndexManager } = await import("./manager-
|
|
2115
|
+
const { MemoryIndexManager } = await import("./manager-DkZ5wkXy.js").then((n) => n.t);
|
|
2116
2116
|
return { manager: await MemoryIndexManager.get(params) };
|
|
2117
2117
|
} catch (err) {
|
|
2118
2118
|
return {
|
|
@@ -7255,7 +7255,7 @@ var GatewayClient = class {
|
|
|
7255
7255
|
if (fingerprint !== expected) return /* @__PURE__ */ new Error("gateway tls fingerprint mismatch");
|
|
7256
7256
|
});
|
|
7257
7257
|
}
|
|
7258
|
-
this.ws = new WebSocket(url, wsOptions);
|
|
7258
|
+
this.ws = new WebSocket$1(url, wsOptions);
|
|
7259
7259
|
this.ws.on("open", () => {
|
|
7260
7260
|
if (url.startsWith("wss://") && this.opts.tlsFingerprint) {
|
|
7261
7261
|
const tlsError = this.validateTlsFingerprint();
|
|
@@ -7474,7 +7474,7 @@ var GatewayClient = class {
|
|
|
7474
7474
|
return null;
|
|
7475
7475
|
}
|
|
7476
7476
|
async request(method, params, opts) {
|
|
7477
|
-
if (!this.ws || this.ws.readyState !== WebSocket.OPEN) throw new Error("gateway not connected");
|
|
7477
|
+
if (!this.ws || this.ws.readyState !== WebSocket$1.OPEN) throw new Error("gateway not connected");
|
|
7478
7478
|
const id = randomUUID();
|
|
7479
7479
|
const frame = {
|
|
7480
7480
|
type: "req",
|
|
@@ -8433,7 +8433,7 @@ async function routeReply(params) {
|
|
|
8433
8433
|
const resolvedReplyToId = replyToId ?? (channelId === "slack" && threadId != null && threadId !== "" ? String(threadId) : void 0);
|
|
8434
8434
|
const resolvedThreadId = channelId === "slack" ? null : threadId ?? null;
|
|
8435
8435
|
try {
|
|
8436
|
-
const { deliverOutboundPayloads } = await import("./deliver-
|
|
8436
|
+
const { deliverOutboundPayloads } = await import("./deliver-59sRVaYQ.js").then((n) => n.n);
|
|
8437
8437
|
return {
|
|
8438
8438
|
ok: true,
|
|
8439
8439
|
messageId: (await deliverOutboundPayloads({
|
|
@@ -41267,7 +41267,7 @@ async function deliverSessionMaintenanceWarning(params) {
|
|
|
41267
41267
|
return;
|
|
41268
41268
|
}
|
|
41269
41269
|
try {
|
|
41270
|
-
const { deliverOutboundPayloads } = await import("./deliver-
|
|
41270
|
+
const { deliverOutboundPayloads } = await import("./deliver-59sRVaYQ.js").then((n) => n.n);
|
|
41271
41271
|
await deliverOutboundPayloads({
|
|
41272
41272
|
cfg: params.cfg,
|
|
41273
41273
|
channel,
|
|
@@ -53649,91 +53649,6 @@ function createOutputNormalizer(profile, modelId) {
|
|
|
53649
53649
|
//#endregion
|
|
53650
53650
|
//#region src/agents/model-aware-stream.ts
|
|
53651
53651
|
/**
|
|
53652
|
-
* Match imperative tool requests:
|
|
53653
|
-
* "Use the exec tool to run X"
|
|
53654
|
-
* "use exec to ..."
|
|
53655
|
-
* "Please invoke the read tool"
|
|
53656
|
-
* "call memory_search with ..."
|
|
53657
|
-
*
|
|
53658
|
-
* Anchored to start-of-string, start-of-line, or after a closing-bracket
|
|
53659
|
-
* delimiter `] ` (covers Symi's `[Thu 2026-04-30 20:48 EDT] ` timestamp
|
|
53660
|
-
* envelope, the `[Outlook 365] ` plugin banner, and similar prefixes that
|
|
53661
|
-
* gateway middleware can inject before the user's actual prompt — verified
|
|
53662
|
-
* live: `chat.send` from Glass UI ships content like
|
|
53663
|
-
*
|
|
53664
|
-
* Conversation info (untrusted metadata):
|
|
53665
|
-
* ```json
|
|
53666
|
-
* { "message_id": "...", ... }
|
|
53667
|
-
* ```
|
|
53668
|
-
*
|
|
53669
|
-
* [Thu 2026-04-30 20:48 EDT] Use the exec tool to run: hostname
|
|
53670
|
-
*
|
|
53671
|
-
* so the `Use` is preceded by `] ` not by `\n` or `^`).
|
|
53672
|
-
*
|
|
53673
|
-
* Verb list is conservative (use/invoke/call/please-{use,call}) — pure
|
|
53674
|
-
* imperative verbs that read unambiguously as "do this for me." Tool name
|
|
53675
|
-
* must match EXPLICIT_TOOL_NAMES exactly to keep "use poetic language" /
|
|
53676
|
-
* "use clear writing" / etc. from triggering.
|
|
53677
|
-
*/
|
|
53678
|
-
const EXPLICIT_TOOL_REQUEST_PATTERN = new RegExp(String.raw`(?:^|\n|\]\s)\s*(?:please\s+)?(?:use|invoke|call)\s+(?:the\s+)?(?:` + [
|
|
53679
|
-
"exec",
|
|
53680
|
-
"bash",
|
|
53681
|
-
"read",
|
|
53682
|
-
"write",
|
|
53683
|
-
"edit",
|
|
53684
|
-
"patch",
|
|
53685
|
-
"web_search",
|
|
53686
|
-
"web_fetch",
|
|
53687
|
-
"browser",
|
|
53688
|
-
"browser_navigate",
|
|
53689
|
-
"browser_snapshot",
|
|
53690
|
-
"browser_click",
|
|
53691
|
-
"browser_type",
|
|
53692
|
-
"memory_search",
|
|
53693
|
-
"memory_get",
|
|
53694
|
-
"memory_pin",
|
|
53695
|
-
"memory_unpin",
|
|
53696
|
-
"spawn_agent",
|
|
53697
|
-
"message",
|
|
53698
|
-
"task_list",
|
|
53699
|
-
"task_cancel",
|
|
53700
|
-
"cron",
|
|
53701
|
-
"fetch",
|
|
53702
|
-
"skill_search"
|
|
53703
|
-
].map((n) => n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|") + String.raw`)(?:\s+tool)?\b`, "i");
|
|
53704
|
-
/**
|
|
53705
|
-
* Extract the user-role text ONLY when it's the LAST message in the
|
|
53706
|
-
* conversation (i.e., we're at the start of a fresh turn, not in the
|
|
53707
|
-
* middle of an agent loop). Returns "" when:
|
|
53708
|
-
* - messages isn't an array
|
|
53709
|
-
* - the last message isn't user-role (= we're after a tool_call /
|
|
53710
|
-
* tool_result and the model is continuing — forcing tool_choice
|
|
53711
|
-
* "required" here would loop the agent: model must call a tool →
|
|
53712
|
-
* tool result → model must call ANOTHER tool → tool result → ...)
|
|
53713
|
-
*
|
|
53714
|
-
* Verified live on 3.0.7 dev: with the original "find any prior user
|
|
53715
|
-
* message" implementation, every agent-loop iteration saw the same
|
|
53716
|
-
* matching userText and re-forced tool_choice="required", spinning the
|
|
53717
|
-
* model in an infinite tool-call loop and timing out at 180s.
|
|
53718
|
-
*/
|
|
53719
|
-
function extractLastUserText(messages) {
|
|
53720
|
-
if (!Array.isArray(messages) || messages.length === 0) return "";
|
|
53721
|
-
const last = messages[messages.length - 1];
|
|
53722
|
-
if (!last || typeof last !== "object") return "";
|
|
53723
|
-
const msg = last;
|
|
53724
|
-
if (msg.role !== "user") return "";
|
|
53725
|
-
if (typeof msg.content === "string") return msg.content;
|
|
53726
|
-
if (Array.isArray(msg.content)) {
|
|
53727
|
-
const parts = [];
|
|
53728
|
-
for (const part of msg.content) if (part && typeof part === "object") {
|
|
53729
|
-
const block = part;
|
|
53730
|
-
if (block.type === "text" && typeof block.text === "string") parts.push(block.text);
|
|
53731
|
-
}
|
|
53732
|
-
return parts.join("\n");
|
|
53733
|
-
}
|
|
53734
|
-
return "";
|
|
53735
|
-
}
|
|
53736
|
-
/**
|
|
53737
53652
|
* Create a single stream function wrapper that handles all provider-specific
|
|
53738
53653
|
* param injection via one onPayload hook.
|
|
53739
53654
|
*
|
|
@@ -53781,10 +53696,6 @@ function createModelAwareStreamFn(opts) {
|
|
|
53781
53696
|
delete p.store;
|
|
53782
53697
|
}
|
|
53783
53698
|
if (Array.isArray(p.tools) && p.tools.length > 0 && p.tool_choice === void 0) p.tool_choice = "auto";
|
|
53784
|
-
if (Array.isArray(p.tools) && p.tools.length > 0 && p.tool_choice === "auto") {
|
|
53785
|
-
const userText = extractLastUserText(p.messages);
|
|
53786
|
-
if (userText && EXPLICIT_TOOL_REQUEST_PATTERN.test(userText)) p.tool_choice = "required";
|
|
53787
|
-
}
|
|
53788
53699
|
}
|
|
53789
53700
|
callerOnPayload?.(payload);
|
|
53790
53701
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./unified-runner-
|
|
1
|
+
import "./unified-runner-B3G4fVeJ.js";
|
|
2
2
|
import { j as theme } from "./registry-DKJLAPDB.js";
|
|
3
3
|
import { g as resolveStateDir } from "./paths-BSzKwaxE.js";
|
|
4
4
|
import { f as pathExists } from "./utils-BU8jVQFM.js";
|
|
@@ -47,8 +47,8 @@ import "./session-cost-usage-DYcv40ss.js";
|
|
|
47
47
|
import { h as trimLogTail } from "./session-utils-CgGDr4eh.js";
|
|
48
48
|
import "./with-timeout-BE7lxhxW.js";
|
|
49
49
|
import "./reply-prefix-BOdARKaY.js";
|
|
50
|
-
import "./memory-
|
|
51
|
-
import "./manager-
|
|
50
|
+
import "./memory-DIz78XgT.js";
|
|
51
|
+
import "./manager-CnHkbF80.js";
|
|
52
52
|
import "./sqlite-DBEvS-Ne.js";
|
|
53
53
|
import "./chunk-DQGU0F8t.js";
|
|
54
54
|
import "./markdown-tables-GTLvbzuR.js";
|
|
@@ -80,13 +80,13 @@ import { t as formatDocsLink } from "./links-CSaUKNKm.js";
|
|
|
80
80
|
import "./cli-utils-CX1oQ81G.js";
|
|
81
81
|
import { t as formatHelpExamples } from "./help-format-BI_G2p1e.js";
|
|
82
82
|
import "./progress-CyPyGCDn.js";
|
|
83
|
-
import "./memory-cli-
|
|
83
|
+
import "./memory-cli-DfW-A_QO.js";
|
|
84
84
|
import "./logging-B5YNzZB9.js";
|
|
85
85
|
import "./replies-B2O2eRh6.js";
|
|
86
86
|
import "./pi-tools.policy-Dyx3nBmp.js";
|
|
87
87
|
import "./model-BRcKPW49.js";
|
|
88
88
|
import { r as parseSemver } from "./runtime-guard-BZ3_1QqS.js";
|
|
89
|
-
import "./program-context-
|
|
89
|
+
import "./program-context-BUekmPwY.js";
|
|
90
90
|
import "./catalog-CSgSg5Gp.js";
|
|
91
91
|
import "./skills-status-BNDqwHkP.js";
|
|
92
92
|
import { n as inheritOptionFromParent } from "./command-options-ChiIn6Na.js";
|
|
@@ -98,7 +98,7 @@ import "./npm-registry-spec-BXw_6vF6.js";
|
|
|
98
98
|
import "./skill-scanner-YF2jR4RY.js";
|
|
99
99
|
import "./installs-DhSLZRT7.js";
|
|
100
100
|
import "./channels-status-issues-DC8vgOMo.js";
|
|
101
|
-
import { r as installCompletion } from "./completion-cli-
|
|
101
|
+
import { r as installCompletion } from "./completion-cli-BGyTfZsT.js";
|
|
102
102
|
import "./daemon-runtime-BpfA4d6Q.js";
|
|
103
103
|
import "./onboard-helpers-CHfdRdZR.js";
|
|
104
104
|
import "./systemd-9LEEqibe.js";
|
|
@@ -119,8 +119,8 @@ import { n as updateNpmInstalledPlugins, t as syncPluginsForUpdateChannel } from
|
|
|
119
119
|
import "./doctor-config-flow-CYDx1U0Z.js";
|
|
120
120
|
import "./systemd-linger-PqG8iGCt.js";
|
|
121
121
|
import "./health-format-39e76m9p.js";
|
|
122
|
-
import { n as doctorCommand, t as selectStyled } from "./prompt-select-styled-
|
|
123
|
-
import { r as ensureCompletionCacheExists, t as checkShellCompletionStatus } from "./doctor-completion-
|
|
122
|
+
import { n as doctorCommand, t as selectStyled } from "./prompt-select-styled-BUycx1hY.js";
|
|
123
|
+
import { r as ensureCompletionCacheExists, t as checkShellCompletionStatus } from "./doctor-completion-RWwGjpox.js";
|
|
124
124
|
import path from "node:path";
|
|
125
125
|
import os from "node:os";
|
|
126
126
|
import fs from "node:fs/promises";
|