squidclaw 3.0.21 → 3.0.23
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-DwGoZKGm.js → accounts-B6F_XCgS.js} +17 -17
- package/dist/{accounts-DjhBQg_8.js → accounts-Bkb-J8V6.js} +2 -2
- package/dist/{accounts-C7pGQPcS.js → accounts-s5e9zidf.js} +2 -2
- package/dist/{active-listener-DPc_PGsA.js → active-listener-6-Svu8Dx.js} +2 -2
- package/dist/{api-key-rotation-DVyYtQxC.js → api-key-rotation-TRwuCWbu.js} +2 -2
- package/dist/{audio-preflight-BUCBED7N.js → audio-preflight-1KULThhV.js} +32 -32
- package/dist/{audio-transcription-runner-Cv0Q47cM.js → audio-transcription-runner-C3N9eAGM.js} +12 -12
- package/dist/{audit-membership-runtime-DyLj-uhz.js → audit-membership-runtime-w23FnNAN.js} +4 -4
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +51 -51
- package/dist/bundled/bootstrap-extra-files/handler.js +6 -6
- package/dist/bundled/command-logger/handler.js +2 -2
- package/dist/bundled/session-memory/handler.js +53 -53
- package/dist/{channel-activity-CPpt4XaL.js → channel-activity-CxJbx4sD.js} +3 -3
- package/dist/{chrome-OgCChbC_.js → chrome-Qbvnl6so.js} +18 -18
- package/dist/{commands-registry-BJjv8_oR.js → commands-registry-B44COZFz.js} +4 -4
- package/dist/{deliver-DMTUTpTM.js → deliver-BC5egJvm.js} +21 -21
- package/dist/deliver-runtime-B6NtHUuv.js +36 -0
- package/dist/deps-send-discord.runtime-CUTAK2hy.js +26 -0
- package/dist/deps-send-imessage.runtime-CQOiEIuA.js +25 -0
- package/dist/deps-send-signal.runtime-wN7MkzLw.js +24 -0
- package/dist/deps-send-slack.runtime-HEEwW4uU.js +22 -0
- package/dist/deps-send-telegram.runtime-DHlcnjQO.js +27 -0
- package/dist/deps-send-whatsapp.runtime-C2x2R2Ow.js +60 -0
- package/dist/{diagnostic-CnVwZNbm.js → diagnostic-C2lklhkn.js} +2 -2
- package/dist/{errors-kkRuS2Cs.js → errors-DfgAh2Ml.js} +1 -1
- package/dist/{fetch-DP-JjB6Z.js → fetch-b8tSR7_e.js} +5 -5
- package/dist/{fetch-guard-BDy975wP.js → fetch-guard-D16tjNsZ.js} +2 -2
- package/dist/{frontmatter-Cq1TcIQ2.js → frontmatter-CjKtFduT.js} +3 -3
- package/dist/{fs-safe-BoB4X3GD.js → fs-safe-CwHbZdFH.js} +4 -4
- package/dist/{github-copilot-token-B5cPlwaz.js → github-copilot-token-Cw3tAXM9.js} +7 -7
- package/dist/{image-kKMG59st.js → image-ByqExb8z.js} +6 -6
- package/dist/{image-ops-Dg8iraUV.js → image-ops-BoN1E_WZ.js} +2 -2
- package/dist/image-runtime-BSVF52oe.js +29 -0
- package/dist/{ir-CKK03mBV.js → ir-Dut0zXyS.js} +8 -8
- package/dist/{legacy-names-aGJJuzM_.js → legacy-names-B0wgIP0Q.js} +1 -1
- package/dist/llm-slug-generator.js +51 -51
- package/dist/{logger-CnTSBL7T.js → logger-oGKcCLZ5.js} +7 -7
- package/dist/{login-CeKDrz6_.js → login-DJ357UQV.js} +5 -5
- package/dist/{login-qr-KbOpR0GQ.js → login-qr-C0fDBnpM.js} +10 -10
- package/dist/{manager-DINhLnMi.js → manager-BPGhs30n.js} +13 -13
- package/dist/manager-runtime-BB9lcoFR.js +18 -0
- package/dist/{model-selection-DuNLFQPR.js → model-selection-CHnojCCK.js} +43 -43
- package/dist/{outbound-attachment-DwupUxYF.js → outbound-attachment-rlW7G5df.js} +2 -2
- package/dist/{outbound-C9svt6RH.js → outbound-qTioiTJg.js} +6 -6
- package/dist/{path-alias-guards-DORgbZ1w.js → path-alias-guards-Cpsiv2KL.js} +1 -1
- package/dist/{paths-DA5srn0U.js → paths-CSdAWKDO.js} +5 -5
- package/dist/{paths-DSd911Oe.js → paths-CXClY8zC.js} +4 -4
- package/dist/{pi-embedded-BiC4tIJ8.js → pi-embedded-DUtpCH0X.js} +162 -162
- package/dist/{pi-embedded-helpers-Di58J7Eh.js → pi-embedded-helpers-CYR1UemI.js} +52 -52
- package/dist/{pi-model-discovery-V-InbjOM.js → pi-model-discovery-o-WX5w2t.js} +7 -7
- package/dist/pi-model-discovery-runtime-DBkQoIJw.js +11 -0
- package/dist/{pi-tools.before-tool-call.runtime-Bpk4qTgV.js → pi-tools.before-tool-call.runtime-B_LUttg1.js} +9 -9
- package/dist/plugin-sdk/mattermost.js +3 -3
- package/dist/plugin-sdk/signal.js +2 -2
- package/dist/{plugins-DvejjZnJ.js → plugins-AqsVZZk3.js} +11 -11
- package/dist/{proxy-env-D-fike7s.js → proxy-env-DXXfs2WL.js} +1 -1
- package/dist/{proxy-fetch-lH6RsRTE.js → proxy-fetch-C2v-Utgg.js} +1 -1
- package/dist/{pw-ai-B8ymIYub.js → pw-ai-1NQPuno2.js} +14 -14
- package/dist/{qmd-manager-BN0siR2Z.js → qmd-manager-CO-shcLU.js} +10 -10
- package/dist/{query-expansion-Dzxt6kXo.js → query-expansion-DlQOkf-g.js} +6 -6
- package/dist/{redact-DvzicBMu.js → redact-NmPEVjIo.js} +1 -1
- package/dist/{run-with-concurrency-BFR3ReeF.js → run-with-concurrency-FczpX8ng.js} +4 -4
- package/dist/runtime-whatsapp-login.runtime-DumUjKRz.js +13 -0
- package/dist/runtime-whatsapp-outbound.runtime-Cgu2MfqR.js +22 -0
- package/dist/{send-dTQd-IyJ.js → send-B5QEmMJ4.js} +5 -5
- package/dist/{send-DdBbRpTP.js → send-B9H0BkfO.js} +6 -6
- package/dist/{send-4nRsZJXH.js → send-Bx9CqcZr.js} +7 -7
- package/dist/{send-BGlcHjUD.js → send-D5D0ZGht.js} +26 -26
- package/dist/{send-BTUU1jWM.js → send-DtHQ7_6Z.js} +8 -8
- package/dist/{session-CnCwDJke.js → session-DLTCuoUD.js} +8 -8
- package/dist/{skill-commands-Cz45_nme.js → skill-commands-BwTLQRR8.js} +9 -9
- package/dist/{skills-CdCS1HeL.js → skills-B9N2bqKU.js} +22 -22
- package/dist/slash-commands.runtime-CjBXruwG.js +16 -0
- package/dist/slash-dispatch.runtime-CGd3HarH.js +56 -0
- package/dist/slash-skill-commands.runtime-DYK20Lxf.js +20 -0
- package/dist/{store-D9z0dn7D.js → store-CvQ41zCV.js} +2 -2
- package/dist/subagent-registry-runtime-m9bFJFix.js +56 -0
- package/dist/{subsystem-6v7sWnAD.js → subsystem-BaLYRf7D.js} +14 -14
- package/dist/{tables-BTFiZyRU.js → tables-BRYYxYs7.js} +1 -1
- package/dist/{target-errors-DgNRx3Nr.js → target-errors-D0ZJUbbf.js} +2 -2
- package/dist/{thinking-B75CXkTT.js → thinking-B-A99X3F.js} +7 -7
- package/dist/{tokens-DfbMVF9y.js → tokens-D2XhLqIz.js} +1 -1
- package/dist/{tool-images-Dp5OiXeA.js → tool-images-Zn6jVmkX.js} +2 -2
- package/dist/{web-QsxgXbNK.js → web-CEdWU_u3.js} +55 -55
- package/dist/{whatsapp-actions-CzqsuSGx.js → whatsapp-actions-Cuy0qeQK.js} +21 -21
- package/dist/{workspace-kVMIaBrV.js → workspace-TqfVSQuO.js} +20 -20
- package/docs/reference/templates/IDENTITY.md +14 -0
- package/docs/reference/templates/MEMORY.md +3 -0
- package/docs/reference/templates/USER.md +9 -0
- package/package.json +1 -1
- package/dist/deliver-runtime-B80olQwJ.js +0 -36
- package/dist/deps-send-discord.runtime-GIuvX7Xw.js +0 -26
- package/dist/deps-send-imessage.runtime-B3TC7G80.js +0 -25
- package/dist/deps-send-signal.runtime-CuVJyw7n.js +0 -24
- package/dist/deps-send-slack.runtime-cbfFoLZ4.js +0 -22
- package/dist/deps-send-telegram.runtime-CRyP-xDQ.js +0 -27
- package/dist/deps-send-whatsapp.runtime-4aOUBP2J.js +0 -60
- package/dist/image-runtime-BqIv7p_K.js +0 -29
- package/dist/manager-runtime-D6ckUNSs.js +0 -18
- package/dist/pi-model-discovery-runtime--t6tAlar.js +0 -11
- package/dist/runtime-whatsapp-login.runtime-DxV9iv6l.js +0 -13
- package/dist/runtime-whatsapp-outbound.runtime-DQqIlwhS.js +0 -22
- package/dist/slash-commands.runtime-CZz6v6b3.js +0 -16
- package/dist/slash-dispatch.runtime-SO7HOe8q.js +0 -56
- package/dist/slash-skill-commands.runtime-Bawt7j0r.js +0 -20
- package/dist/subagent-registry-runtime-D2rUxU5J.js +0 -56
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
import { _ as toAgentModelListLike, a as resolveAgentDir, c as resolveAgentWorkspaceDir, d as resolveRunModelFallbacksOverride, f as resolveSessionAgentId, g as resolveAgentModelPrimaryValue, h as resolveAgentModelFallbackValues, i as resolveAgentConfig, l as resolveDefaultAgentId, n as hasConfiguredModelFallbacks, p as resolveSessionAgentIds, r as listAgentIds, s as resolveAgentSkillsFilter, t as runTasksWithConcurrency, u as resolveEffectiveModelFallbacks } from "./run-with-concurrency-
|
|
2
|
-
import { a as resolveGatewayPort, c as resolveStateDir, d as resolveRequiredHomeDir, l as expandHomePrefix, n as STATE_DIR, r as resolveConfigPath } from "./paths-
|
|
3
|
-
import { C as normalizeLogLevel, E as consumeRootOptionToken, T as FLAG_TERMINATOR, _ as isRich, a as clearActiveProgressLine, c as danger, f as setVerbose, g as colorize, h as warn, i as defaultRuntime, o as registerActiveProgressLine, p as shouldLogVerbose, r as createNonExitingRuntime, s as unregisterActiveProgressLine, t as createSubsystemLogger, u as logVerbose, v as theme, w as resolvePreferredSquidClawTmpDir, y as getChildLogger } from "./subsystem-
|
|
4
|
-
import { $ as parseAgentSessionKey, A as normalizeWindowsPathForComparison, B as resolveAgentIdFromSessionKey, G as normalizeAccountId$2, H as sanitizeAgentId, I as classifySessionKeyShape, J as deriveSessionChatType, K as normalizeOptionalAccountId, L as isValidAgentId, M as DEFAULT_MAIN_KEY, N as buildAgentMainSessionKey, P as buildAgentPeerSessionKey, Q as isSubagentSessionKey, R as normalizeAgentId, U as scopedHeartbeatWakeOptions, V as resolveThreadSessionKeys, W as DEFAULT_ACCOUNT_ID, X as isAcpSessionKey, Y as getSubagentDepth, Z as isCronSessionKey, _ as runExec, a as DEFAULT_IDENTITY_FILENAME, b as openBoundaryFile, et as resolveThreadParentSessionKey, f as loadWorkspaceBootstrapFiles, g as runCommandWithTimeout, j as DEFAULT_AGENT_ID, l as ensureAgentWorkspace, m as resolveSquidClawPackageRoot, n as DEFAULT_AGENT_WORKSPACE_DIR, q as isBlockedObjectKey, r as DEFAULT_BOOTSTRAP_FILENAME, u as filterBootstrapFilesForSession, v as spawnWithFallback, x as openBoundaryFileSync, z as normalizeMainKey } from "./workspace-
|
|
5
|
-
import { C as sleep$1, D as isPlainObject, E as truncateUtf16Safe, S as shortenHomePath, a as CONFIG_DIR, d as formatTerminalLink, f as isRecord$1, h as normalizeE164, i as logWarn, l as ensureDir$3, n as logError, r as logInfo, s as clampInt, t as logDebug, u as escapeRegExp, w as sliceUtf16Safe, x as shortenHomeInString, y as resolveUserPath } from "./logger-
|
|
6
|
-
import { $ as resolveConfigSnapshotHash, $n as dedupeProfileIds, $t as createPluginRegistry, A as getCustomProviderApiKey, An as unwrapKnownDispatchWrapperInvocation, At as isPathWithinRoot, B as markAuthProfileFailure, Bn as resolveSlackNativeStreaming, Bt as resolveMemorySlotDecision, C as OLLAMA_NATIVE_BASE_URL, Cn as DEFAULT_SAFE_BINS, D as buildStreamErrorAssistantMessage, Dn as extractShellWrapperInlineCommand, Dt as AVATAR_MAX_BYTES, E as buildAssistantMessageWithZeroUsage, En as resolveCommandResolutionFromArgv, Fn as resolveSafeBinProfiles, Ft as isPathInside, G as describeUnknownError$1, Gn as DEFAULT_SUBAGENT_MAX_SPAWN_DEPTH, Gt as normalizeAnyChannelId, H as resolveProfilesUnavailableReason, Ht as CHAT_CHANNEL_ORDER, I as resolveAuthProfileOrder, In as applyMergePatch, It as safeStatSync, J as parseDotPath, Jn as getShellPathFromLoginShell, Jt as getActivePluginRegistry, K as isNonEmptyString, Kn as resolveAgentMaxConcurrent, Kt as normalizeChannelId$1, L as clearExpiredCooldowns, Ln as isSafeExecutableValue, Lt as applyTestPluginDefaults, M as resolveApiKeyForProvider, Mn as splitShellArgs, Mt as validateJsonSchemaValue, N as resolveEnvApiKey, Nn as SAFE_BIN_PROFILES, Nt as loadPluginManifestRegistry, O as buildUsageWithNoCost, On as isDispatchWrapperExecutable, Ot as isAvatarDataUrl, P as resolveModelAuthMode, Pn as normalizeSafeBinProfileFixtures, Pt as discoverSquidClawPlugins, Qn as resolveOwnerDisplaySetting, Qt as setActivePluginRegistry, R as getSoonestCooldownExpiry, Rn as mapStreamingModeToSlackLegacyDraftStreamMode, Rt as normalizePluginsConfig, S as retryAsync, Sn as splitCommandChain, T as buildAssistantMessage, Tn as resolveAllowlistCandidatePath, U as resolveApiKeyForProfile, Ut as getChatChannelMeta, V as markAuthProfileUsed, Vn as resolveSlackStreamingMode, W as resolveSecretRefValues, Wt as listChatChannels, X as loadConfig, Xn as isDangerousHostEnvVarName, Yn as resolveShellEnvFallbackTimeoutMs, Yt as getActivePluginRegistryKey, Z as readConfigFileSnapshot, Zn as isTruthyEnvValue, Zt as requireActivePluginRegistry, _n as normalizeTrustedSafeBinDirs, _r as resolveSecretInputRef, a as isCliProvider, an as matchPluginCommand, ar as withFileLock, bn as buildEnforcedShellCommand, br as DEFAULT_MODEL, c as normalizeProviderId, cn as setConfigOverride, ct as resolveIMessageAttachmentRoots, d as resolveDefaultModelForAgent, dn as parseConfigPath, dr as resolveAuthProfileDisplayLabel, dt as parseNonNegativeByteSize, en as normalizePluginHttpPath, er as listProfilesForProvider, et as writeConfigFile, f as resolveModelRefFromString, fn as setConfigValueAtPath, ft as secretRefKey, gn as listWritableExplicitTrustedSafeBinDirs, gr as normalizeResolvedSecretInputString, h as resolveThinkingDefault, hn as isTrustedSafeBinPath, hr as hasConfiguredSecretInput, i as findNormalizedProviderValue, in as listPluginCommands, ir as resolveSquidClawAgentDir, it as resolveTelegramCustomCommands, j as requireApiKey, jn as unwrapKnownShellMultiplexerInvocation, jt as isSupportedLocalAvatarExtension, k as getApiKeyForModel, kn as isShellWrapperExecutable, kt as isAvatarHttpUrl, ln as unsetConfigOverride, lr as formatCliCommand, lt as resolveIMessageRemoteAttachmentRoots, m as resolveSubagentSpawnModelSelection, mn as getTrustedSafeBinDirs, mr as coerceSecretRef, mt as parseDurationMs, n as buildConfiguredAllowlistKeys, nn as executePluginCommand, nr as ensureAuthProfileStore, nt as TELEGRAM_COMMAND_NAME_PATTERN, o as modelKey, on as getConfigOverrides, ot as isInboundPathAllowed, p as resolveReasoningDefault, pn as unsetConfigValueAtPath, pr as normalizeSecretInput, q as isRecord$2, qn as VERSION, qt as normalizeChatChannelId, r as buildModelAliasIndex, rn as getPluginCommandSpecs, rr as resolveAuthStorePathForDisplay, rt as normalizeTelegramCommandName, s as normalizeModelRef$2, sn as resetConfigOverrides, t as buildAllowedModelSet, tn as clearPluginCommands, tr as markAuthProfileGood, tt as validateConfigObjectWithPlugins, u as resolveConfiguredModelRef, un as getConfigValueAtPath, ur as resolveCliName, ut as normalizeScpRemoteHost, vn as validateSafeBinArgv, vr as splitTrailingAuthProfile, w as createOllamaStreamFn, wn as matchAllowlist, x as resolveRetryConfig, xn as isWindowsPlatform, xr as DEFAULT_PROVIDER, yn as analyzeShellCommand, yr as DEFAULT_CONTEXT_TOKENS, z as isProfileInCooldown, zn as resolveDiscordPreviewStreamMode, zt as resolveEffectiveEnableState } from "./model-selection-
|
|
7
|
-
import { a as saveJsonFile, i as loadJsonFile } from "./github-copilot-token-
|
|
8
|
-
import { c as parseBooleanValue$1, n as MANIFEST_KEY, r as createInternalHookEvent, s as triggerInternalHook } from "./legacy-names-
|
|
9
|
-
import { _ as normalizeAtHashSlug, a as normalizeReasoningLevel, b as normalizeStringEntriesLower, c as normalizeVerboseLevel, d as getChannelDock, f as listChannelDocks, g as resolveChannelGroupToolsPolicy, h as resolveChannelGroupRequireMention, i as normalizeElevatedLevel, l as resolveResponseUsageMode, m as resolveChannelGroupPolicy, n as formatXHighModelHint, o as normalizeThinkLevel, p as normalizeSignalMessagingTarget, s as normalizeUsageDisplay, t as formatThinkingLevels, u as supportsXHighThinking, v as normalizeHyphenSlug, y as normalizeStringEntries } from "./thinking-
|
|
10
|
-
import { a as stripSilentToken, i as isSilentReplyText, n as SILENT_REPLY_TOKEN, r as isSilentReplyPrefixText, t as HEARTBEAT_TOKEN } from "./tokens-
|
|
11
|
-
import { _ as normalizeChatType, a as normalizeWhatsAppTarget, b as resolveDiscordAccount, c as listTelegramAccountIds, d as buildChannelAccountBindings, f as listBindings, g as resolveSlackBotToken, h as resolveSlackAppToken, i as isWhatsAppGroupJid, l as resolveTelegramAccount, m as resolveSlackReplyToMode, n as listChannelPlugins, o as createTelegramActionGate, p as resolveSlackAccount, r as normalizeChannelId$2, s as listEnabledTelegramAccounts, t as getChannelPlugin, u as resolveTelegramToken, v as createDiscordActionGate, x as normalizeDiscordToken, y as listEnabledDiscordAccounts } from "./plugins-
|
|
12
|
-
import { a as logWebSelfId, h as resolveAccountEntry, i as getWebAuthAgeMs, m as webAuthExists, n as resolveWhatsAppAccount, o as logoutWeb, t as hasAnyWhatsAppAuth, u as readWebSelfId } from "./accounts-
|
|
13
|
-
import { a as resolveSlackWebClientOptions, c as buildSlackBlocksFallbackText, i as createSlackWebClient, l as parseSlackTarget, n as markdownToSlackMrkdwnChunks, o as parseSlackBlocksInput, r as normalizeSlackOutboundText, s as validateSlackBlocksArray, t as sendMessageSlack, u as resolveSlackChannelId } from "./send-
|
|
14
|
-
import { $ as stripUndefinedFields, A as unpinMessageDiscord, At as resolveChannelEntryMatchWithFallback, B as listScheduledEventsDiscord, C as editMessageDiscord, Ct as resolveDiscordSystemLocation, D as pinMessageDiscord, Dt as applyChannelMatchMeta, E as listThreadsDiscord, Et as fetchDiscord, F as fetchMemberInfoDiscord, G as uploadStickerDiscord, H as timeoutMemberDiscord, I as fetchRoleInfoDiscord, J as editChannelDiscord, K as createChannelDiscord, L as fetchVoiceStatusDiscord, M as banMemberDiscord, N as createScheduledEventDiscord, O as readMessagesDiscord, Ot as buildChannelKeyCandidates, P as fetchChannelInfoDiscord, Q as sendDiscordText, R as kickMemberDiscord, S as deleteMessageDiscord, St as formatDiscordUserTag, T as listPinsDiscord, Tt as DiscordApiError, U as listGuildEmojisDiscord, V as removeRoleDiscord, W as uploadEmojiDiscord, X as removeChannelPermissionDiscord, Y as moveChannelDiscord, Z as setChannelPermissionDiscord, _ as sendStickerDiscord, _t as resolveDiscordOwnerAllowFrom, a as sendDiscordComponentMessage, at as parseDiscordTarget, b as formatMention, bt as shouldEmitDiscordReactionNotification, c as parseDiscordComponentCustomId, ct as listDiscordDirectoryPeersLive, d as parseDiscordModalCustomIdForCarbon, dt as normalizeDiscordSlug, et as fetchChannelPermissionsDiscord, f as readDiscordComponentSpec, ft as resolveDiscordAllowListMatch, g as sendPollDiscord, gt as resolveDiscordOwnerAccess, h as sendMessageDiscord, ht as resolveDiscordMemberAccessState, i as removeReactionDiscord, it as createDiscordRestClient, j as addRoleDiscord, k as searchMessagesDiscord, kt as normalizeChannelSlug, l as parseDiscordComponentCustomIdForCarbon, lt as isDiscordGroupAllowedByPolicy, m as resolveDiscordModalEntry, mt as resolveDiscordGuildEntry, n as reactMessageDiscord, nt as chunkDiscordTextWithMode, o as createDiscordFormModal, ot as resolveDiscordChannelId, p as resolveDiscordComponentEntry, pt as resolveDiscordChannelConfigWithFallback, q as deleteChannelDiscord, r as removeOwnReactionsDiscord, rt as createDiscordClient, s as formatDiscordComponentEventText, st as listDiscordDirectoryGroupsLive, t as fetchReactionsDiscord, tt as hasAnyGuildPermissionDiscord, u as parseDiscordModalCustomId, ut as normalizeDiscordAllowList, v as sendVoiceMessageDiscord, vt as resolveDiscordShouldRequireMention, w as fetchMessageDiscord, wt as resolveTimestampMs, x as createThreadDiscord, xt as formatDiscordReactionEmoji, y as sendWebhookMessageDiscord, yt as resolveGroupDmAllow, z as listGuildChannelsDiscord } from "./send-
|
|
1
|
+
import { _ as toAgentModelListLike, a as resolveAgentDir, c as resolveAgentWorkspaceDir, d as resolveRunModelFallbacksOverride, f as resolveSessionAgentId, g as resolveAgentModelPrimaryValue, h as resolveAgentModelFallbackValues, i as resolveAgentConfig, l as resolveDefaultAgentId, n as hasConfiguredModelFallbacks, p as resolveSessionAgentIds, r as listAgentIds, s as resolveAgentSkillsFilter, t as runTasksWithConcurrency, u as resolveEffectiveModelFallbacks } from "./run-with-concurrency-FczpX8ng.js";
|
|
2
|
+
import { a as resolveGatewayPort, c as resolveStateDir, d as resolveRequiredHomeDir, l as expandHomePrefix, n as STATE_DIR, r as resolveConfigPath } from "./paths-CSdAWKDO.js";
|
|
3
|
+
import { C as normalizeLogLevel, E as consumeRootOptionToken, T as FLAG_TERMINATOR, _ as isRich, a as clearActiveProgressLine, c as danger, f as setVerbose, g as colorize, h as warn, i as defaultRuntime, o as registerActiveProgressLine, p as shouldLogVerbose, r as createNonExitingRuntime, s as unregisterActiveProgressLine, t as createSubsystemLogger, u as logVerbose, v as theme, w as resolvePreferredSquidClawTmpDir, y as getChildLogger } from "./subsystem-BaLYRf7D.js";
|
|
4
|
+
import { $ as parseAgentSessionKey, A as normalizeWindowsPathForComparison, B as resolveAgentIdFromSessionKey, G as normalizeAccountId$2, H as sanitizeAgentId, I as classifySessionKeyShape, J as deriveSessionChatType, K as normalizeOptionalAccountId, L as isValidAgentId, M as DEFAULT_MAIN_KEY, N as buildAgentMainSessionKey, P as buildAgentPeerSessionKey, Q as isSubagentSessionKey, R as normalizeAgentId, U as scopedHeartbeatWakeOptions, V as resolveThreadSessionKeys, W as DEFAULT_ACCOUNT_ID, X as isAcpSessionKey, Y as getSubagentDepth, Z as isCronSessionKey, _ as runExec, a as DEFAULT_IDENTITY_FILENAME, b as openBoundaryFile, et as resolveThreadParentSessionKey, f as loadWorkspaceBootstrapFiles, g as runCommandWithTimeout, j as DEFAULT_AGENT_ID, l as ensureAgentWorkspace, m as resolveSquidClawPackageRoot, n as DEFAULT_AGENT_WORKSPACE_DIR, q as isBlockedObjectKey, r as DEFAULT_BOOTSTRAP_FILENAME, u as filterBootstrapFilesForSession, v as spawnWithFallback, x as openBoundaryFileSync, z as normalizeMainKey } from "./workspace-TqfVSQuO.js";
|
|
5
|
+
import { C as sleep$1, D as isPlainObject, E as truncateUtf16Safe, S as shortenHomePath, a as CONFIG_DIR, d as formatTerminalLink, f as isRecord$1, h as normalizeE164, i as logWarn, l as ensureDir$3, n as logError, r as logInfo, s as clampInt, t as logDebug, u as escapeRegExp, w as sliceUtf16Safe, x as shortenHomeInString, y as resolveUserPath } from "./logger-oGKcCLZ5.js";
|
|
6
|
+
import { $ as resolveConfigSnapshotHash, $n as dedupeProfileIds, $t as createPluginRegistry, A as getCustomProviderApiKey, An as unwrapKnownDispatchWrapperInvocation, At as isPathWithinRoot, B as markAuthProfileFailure, Bn as resolveSlackNativeStreaming, Bt as resolveMemorySlotDecision, C as OLLAMA_NATIVE_BASE_URL, Cn as DEFAULT_SAFE_BINS, D as buildStreamErrorAssistantMessage, Dn as extractShellWrapperInlineCommand, Dt as AVATAR_MAX_BYTES, E as buildAssistantMessageWithZeroUsage, En as resolveCommandResolutionFromArgv, Fn as resolveSafeBinProfiles, Ft as isPathInside, G as describeUnknownError$1, Gn as DEFAULT_SUBAGENT_MAX_SPAWN_DEPTH, Gt as normalizeAnyChannelId, H as resolveProfilesUnavailableReason, Ht as CHAT_CHANNEL_ORDER, I as resolveAuthProfileOrder, In as applyMergePatch, It as safeStatSync, J as parseDotPath, Jn as getShellPathFromLoginShell, Jt as getActivePluginRegistry, K as isNonEmptyString, Kn as resolveAgentMaxConcurrent, Kt as normalizeChannelId$1, L as clearExpiredCooldowns, Ln as isSafeExecutableValue, Lt as applyTestPluginDefaults, M as resolveApiKeyForProvider, Mn as splitShellArgs, Mt as validateJsonSchemaValue, N as resolveEnvApiKey, Nn as SAFE_BIN_PROFILES, Nt as loadPluginManifestRegistry, O as buildUsageWithNoCost, On as isDispatchWrapperExecutable, Ot as isAvatarDataUrl, P as resolveModelAuthMode, Pn as normalizeSafeBinProfileFixtures, Pt as discoverSquidClawPlugins, Qn as resolveOwnerDisplaySetting, Qt as setActivePluginRegistry, R as getSoonestCooldownExpiry, Rn as mapStreamingModeToSlackLegacyDraftStreamMode, Rt as normalizePluginsConfig, S as retryAsync, Sn as splitCommandChain, T as buildAssistantMessage, Tn as resolveAllowlistCandidatePath, U as resolveApiKeyForProfile, Ut as getChatChannelMeta, V as markAuthProfileUsed, Vn as resolveSlackStreamingMode, W as resolveSecretRefValues, Wt as listChatChannels, X as loadConfig, Xn as isDangerousHostEnvVarName, Yn as resolveShellEnvFallbackTimeoutMs, Yt as getActivePluginRegistryKey, Z as readConfigFileSnapshot, Zn as isTruthyEnvValue, Zt as requireActivePluginRegistry, _n as normalizeTrustedSafeBinDirs, _r as resolveSecretInputRef, a as isCliProvider, an as matchPluginCommand, ar as withFileLock, bn as buildEnforcedShellCommand, br as DEFAULT_MODEL, c as normalizeProviderId, cn as setConfigOverride, ct as resolveIMessageAttachmentRoots, d as resolveDefaultModelForAgent, dn as parseConfigPath, dr as resolveAuthProfileDisplayLabel, dt as parseNonNegativeByteSize, en as normalizePluginHttpPath, er as listProfilesForProvider, et as writeConfigFile, f as resolveModelRefFromString, fn as setConfigValueAtPath, ft as secretRefKey, gn as listWritableExplicitTrustedSafeBinDirs, gr as normalizeResolvedSecretInputString, h as resolveThinkingDefault, hn as isTrustedSafeBinPath, hr as hasConfiguredSecretInput, i as findNormalizedProviderValue, in as listPluginCommands, ir as resolveSquidClawAgentDir, it as resolveTelegramCustomCommands, j as requireApiKey, jn as unwrapKnownShellMultiplexerInvocation, jt as isSupportedLocalAvatarExtension, k as getApiKeyForModel, kn as isShellWrapperExecutable, kt as isAvatarHttpUrl, ln as unsetConfigOverride, lr as formatCliCommand, lt as resolveIMessageRemoteAttachmentRoots, m as resolveSubagentSpawnModelSelection, mn as getTrustedSafeBinDirs, mr as coerceSecretRef, mt as parseDurationMs, n as buildConfiguredAllowlistKeys, nn as executePluginCommand, nr as ensureAuthProfileStore, nt as TELEGRAM_COMMAND_NAME_PATTERN, o as modelKey, on as getConfigOverrides, ot as isInboundPathAllowed, p as resolveReasoningDefault, pn as unsetConfigValueAtPath, pr as normalizeSecretInput, q as isRecord$2, qn as VERSION, qt as normalizeChatChannelId, r as buildModelAliasIndex, rn as getPluginCommandSpecs, rr as resolveAuthStorePathForDisplay, rt as normalizeTelegramCommandName, s as normalizeModelRef$2, sn as resetConfigOverrides, t as buildAllowedModelSet, tn as clearPluginCommands, tr as markAuthProfileGood, tt as validateConfigObjectWithPlugins, u as resolveConfiguredModelRef, un as getConfigValueAtPath, ur as resolveCliName, ut as normalizeScpRemoteHost, vn as validateSafeBinArgv, vr as splitTrailingAuthProfile, w as createOllamaStreamFn, wn as matchAllowlist, x as resolveRetryConfig, xn as isWindowsPlatform, xr as DEFAULT_PROVIDER, yn as analyzeShellCommand, yr as DEFAULT_CONTEXT_TOKENS, z as isProfileInCooldown, zn as resolveDiscordPreviewStreamMode, zt as resolveEffectiveEnableState } from "./model-selection-CHnojCCK.js";
|
|
7
|
+
import { a as saveJsonFile, i as loadJsonFile } from "./github-copilot-token-Cw3tAXM9.js";
|
|
8
|
+
import { c as parseBooleanValue$1, n as MANIFEST_KEY, r as createInternalHookEvent, s as triggerInternalHook } from "./legacy-names-B0wgIP0Q.js";
|
|
9
|
+
import { _ as normalizeAtHashSlug, a as normalizeReasoningLevel, b as normalizeStringEntriesLower, c as normalizeVerboseLevel, d as getChannelDock, f as listChannelDocks, g as resolveChannelGroupToolsPolicy, h as resolveChannelGroupRequireMention, i as normalizeElevatedLevel, l as resolveResponseUsageMode, m as resolveChannelGroupPolicy, n as formatXHighModelHint, o as normalizeThinkLevel, p as normalizeSignalMessagingTarget, s as normalizeUsageDisplay, t as formatThinkingLevels, u as supportsXHighThinking, v as normalizeHyphenSlug, y as normalizeStringEntries } from "./thinking-B-A99X3F.js";
|
|
10
|
+
import { a as stripSilentToken, i as isSilentReplyText, n as SILENT_REPLY_TOKEN, r as isSilentReplyPrefixText, t as HEARTBEAT_TOKEN } from "./tokens-D2XhLqIz.js";
|
|
11
|
+
import { _ as normalizeChatType, a as normalizeWhatsAppTarget, b as resolveDiscordAccount, c as listTelegramAccountIds, d as buildChannelAccountBindings, f as listBindings, g as resolveSlackBotToken, h as resolveSlackAppToken, i as isWhatsAppGroupJid, l as resolveTelegramAccount, m as resolveSlackReplyToMode, n as listChannelPlugins, o as createTelegramActionGate, p as resolveSlackAccount, r as normalizeChannelId$2, s as listEnabledTelegramAccounts, t as getChannelPlugin, u as resolveTelegramToken, v as createDiscordActionGate, x as normalizeDiscordToken, y as listEnabledDiscordAccounts } from "./plugins-AqsVZZk3.js";
|
|
12
|
+
import { a as logWebSelfId, h as resolveAccountEntry, i as getWebAuthAgeMs, m as webAuthExists, n as resolveWhatsAppAccount, o as logoutWeb, t as hasAnyWhatsAppAuth, u as readWebSelfId } from "./accounts-B6F_XCgS.js";
|
|
13
|
+
import { a as resolveSlackWebClientOptions, c as buildSlackBlocksFallbackText, i as createSlackWebClient, l as parseSlackTarget, n as markdownToSlackMrkdwnChunks, o as parseSlackBlocksInput, r as normalizeSlackOutboundText, s as validateSlackBlocksArray, t as sendMessageSlack, u as resolveSlackChannelId } from "./send-B9H0BkfO.js";
|
|
14
|
+
import { $ as stripUndefinedFields, A as unpinMessageDiscord, At as resolveChannelEntryMatchWithFallback, B as listScheduledEventsDiscord, C as editMessageDiscord, Ct as resolveDiscordSystemLocation, D as pinMessageDiscord, Dt as applyChannelMatchMeta, E as listThreadsDiscord, Et as fetchDiscord, F as fetchMemberInfoDiscord, G as uploadStickerDiscord, H as timeoutMemberDiscord, I as fetchRoleInfoDiscord, J as editChannelDiscord, K as createChannelDiscord, L as fetchVoiceStatusDiscord, M as banMemberDiscord, N as createScheduledEventDiscord, O as readMessagesDiscord, Ot as buildChannelKeyCandidates, P as fetchChannelInfoDiscord, Q as sendDiscordText, R as kickMemberDiscord, S as deleteMessageDiscord, St as formatDiscordUserTag, T as listPinsDiscord, Tt as DiscordApiError, U as listGuildEmojisDiscord, V as removeRoleDiscord, W as uploadEmojiDiscord, X as removeChannelPermissionDiscord, Y as moveChannelDiscord, Z as setChannelPermissionDiscord, _ as sendStickerDiscord, _t as resolveDiscordOwnerAllowFrom, a as sendDiscordComponentMessage, at as parseDiscordTarget, b as formatMention, bt as shouldEmitDiscordReactionNotification, c as parseDiscordComponentCustomId, ct as listDiscordDirectoryPeersLive, d as parseDiscordModalCustomIdForCarbon, dt as normalizeDiscordSlug, et as fetchChannelPermissionsDiscord, f as readDiscordComponentSpec, ft as resolveDiscordAllowListMatch, g as sendPollDiscord, gt as resolveDiscordOwnerAccess, h as sendMessageDiscord, ht as resolveDiscordMemberAccessState, i as removeReactionDiscord, it as createDiscordRestClient, j as addRoleDiscord, k as searchMessagesDiscord, kt as normalizeChannelSlug, l as parseDiscordComponentCustomIdForCarbon, lt as isDiscordGroupAllowedByPolicy, m as resolveDiscordModalEntry, mt as resolveDiscordGuildEntry, n as reactMessageDiscord, nt as chunkDiscordTextWithMode, o as createDiscordFormModal, ot as resolveDiscordChannelId, p as resolveDiscordComponentEntry, pt as resolveDiscordChannelConfigWithFallback, q as deleteChannelDiscord, r as removeOwnReactionsDiscord, rt as createDiscordClient, s as formatDiscordComponentEventText, st as listDiscordDirectoryGroupsLive, t as fetchReactionsDiscord, tt as hasAnyGuildPermissionDiscord, u as parseDiscordModalCustomId, ut as normalizeDiscordAllowList, v as sendVoiceMessageDiscord, vt as resolveDiscordShouldRequireMention, w as fetchMessageDiscord, wt as resolveTimestampMs, x as createThreadDiscord, xt as formatDiscordReactionEmoji, y as sendWebhookMessageDiscord, yt as resolveGroupDmAllow, z as listGuildChannelsDiscord } from "./send-DtHQ7_6Z.js";
|
|
15
15
|
import { n as generateSecureUuid, t as generateSecureToken } from "./secure-random-CXrBi7Jq.js";
|
|
16
|
-
import { C as createReplyToModeFilterForChannel, D as normalizeTargetForProvider, E as normalizeChannelTargetInput, O as getGlobalHookRunner, S as shouldSuppressReasoningPayload, T as buildTargetResolverSignature, _ as applyReplyThreading, a as normalizeReplyPayloadsForDelivery, b as isRenderablePayload, c as splitMediaFromOutput, d as toInternalMessageReceivedContext, f as toInternalMessageTranscribedContext, g as applyReplyTagsToPayload, h as fireAndForgetHook, i as normalizeOutboundPayloadsForJson, k as initializeGlobalHookRunner, l as deriveInboundMessageHookContext, m as toPluginMessageReceivedEvent, n as formatOutboundPayloadLog, o as throwIfAborted, p as toPluginMessageContext, r as normalizeOutboundPayloads, s as parseReplyDirectives, t as deliverOutboundPayloads, u as toInternalMessagePreprocessedContext, v as filterMessagingToolDuplicates, w as resolveReplyToMode, x as shouldSuppressMessagingToolReplies, y as filterMessagingToolMediaDuplicates } from "./deliver-
|
|
17
|
-
import { a as logMessageQueued, c as logWebhookError, d as startDiagnosticHeartbeat, f as stopDiagnosticHeartbeat, h as isDiagnosticsEnabled, i as logMessageProcessed, l as logWebhookProcessed, m as emitDiagnosticEvent, n as logLaneDequeue, o as logSessionStateChange, p as getDiagnosticSessionState, r as logLaneEnqueue, t as diag, u as logWebhookReceived } from "./diagnostic-
|
|
18
|
-
import { n as resolveSignalAccount, t as listEnabledSignalAccounts } from "./accounts-
|
|
16
|
+
import { C as createReplyToModeFilterForChannel, D as normalizeTargetForProvider, E as normalizeChannelTargetInput, O as getGlobalHookRunner, S as shouldSuppressReasoningPayload, T as buildTargetResolverSignature, _ as applyReplyThreading, a as normalizeReplyPayloadsForDelivery, b as isRenderablePayload, c as splitMediaFromOutput, d as toInternalMessageReceivedContext, f as toInternalMessageTranscribedContext, g as applyReplyTagsToPayload, h as fireAndForgetHook, i as normalizeOutboundPayloadsForJson, k as initializeGlobalHookRunner, l as deriveInboundMessageHookContext, m as toPluginMessageReceivedEvent, n as formatOutboundPayloadLog, o as throwIfAborted, p as toPluginMessageContext, r as normalizeOutboundPayloads, s as parseReplyDirectives, t as deliverOutboundPayloads, u as toInternalMessagePreprocessedContext, v as filterMessagingToolDuplicates, w as resolveReplyToMode, x as shouldSuppressMessagingToolReplies, y as filterMessagingToolMediaDuplicates } from "./deliver-BC5egJvm.js";
|
|
17
|
+
import { a as logMessageQueued, c as logWebhookError, d as startDiagnosticHeartbeat, f as stopDiagnosticHeartbeat, h as isDiagnosticsEnabled, i as logMessageProcessed, l as logWebhookProcessed, m as emitDiagnosticEvent, n as logLaneDequeue, o as logSessionStateChange, p as getDiagnosticSessionState, r as logLaneEnqueue, t as diag, u as logWebhookReceived } from "./diagnostic-C2lklhkn.js";
|
|
18
|
+
import { n as resolveSignalAccount, t as listEnabledSignalAccounts } from "./accounts-s5e9zidf.js";
|
|
19
19
|
import { i as resolveTelegramTargetChatType, r as parseTelegramTarget } from "./targets-BiE9e9-P.js";
|
|
20
|
-
import { A as mediaKindFromMime, C as imageMimeFromFormat, E as kindFromMime, O as MAX_IMAGE_BYTES, T as isGifMedia, _ as GATEWAY_CLIENT_IDS, b as detectMime, c as INTERNAL_MESSAGE_CHANNEL, d as isInternalMessageChannel, f as isMarkdownCapableMessageChannel, g as resolveMessageChannel, h as resolveGatewayMessageChannel, i as getImageMetadata, l as isDeliverableMessageChannel, m as normalizeMessageChannel, p as listDeliverableMessageChannels, s as resizeToJpeg, u as isGatewayMessageChannel, v as GATEWAY_CLIENT_MODES, w as isAudioFileName, x as extensionForMime, y as GATEWAY_CLIENT_NAMES } from "./image-ops-
|
|
21
|
-
import { $ as removeChannelAllowFromStoreEntry, A as expandTextLinks, B as resolveTelegramThreadSpec, C as buildSenderName, D as buildTelegramThreadParams, E as buildTelegramParentPeer, F as resolveTelegramForumThreadId, G as firstDefined$1, H as normalizeAllowFrom$2, I as resolveTelegramGroupAllowFromContext, J as resolveGroupAllowFromSources, K as isSenderIdAllowed, L as resolveTelegramMediaPlaceholder, M as hasBotMention, N as normalizeForwardedContext, O as buildTypingThreadParams, P as resolveTelegramDirectPeerId, Q as readChannelAllowFromStore, R as resolveTelegramReplyId, S as buildSenderLabel, T as buildTelegramGroupPeerId, U as normalizeDmAllowFromWithStore$1, V as isSenderAllowed$1, W as resolveSenderAllowMatch$1, X as toLocationContext, Y as formatLocationText, Z as addChannelAllowFromStoreEntry, _ as splitTelegramCaption, a as reactMessageTelegram, at as isVoiceCompatibleAudio, b as resolveCronStorePath, c as sendStickerTelegram, d as isRecoverableTelegramNetworkError, et as upsertChannelPairingRequest, f as markdownToTelegramChunks, g as resolveTelegramFetch, h as wrapFileReferencesInHtml, i as editMessageTelegram, it as listPairingChannels, j as extractTelegramLocation, k as describeReplyTarget, l as resolveTelegramVoiceSend, m as renderTelegramHtmlText, n as createForumTopicTelegram, nt as writeJsonFileAtomically, o as sendMessageTelegram, p as markdownToTelegramHtml, q as mergeDmAllowFromSources, r as deleteMessageTelegram, rt as getPairingAdapter, s as sendPollTelegram, t as buildInlineKeyboard, tt as readJsonFileWithFallback, u as wasSentByBot, v as withTelegramApiErrorLogging, w as buildTelegramGroupFrom, x as buildGroupLabel, y as loadCronStore, z as resolveTelegramStreamMode } from "./send-
|
|
22
|
-
import { n as discoverModels, t as discoverAuthStorage } from "./pi-model-discovery-
|
|
23
|
-
import { $ as deliveryContextKey, $t as matchesAnyGlobPattern, A as isTransientHttpError, At as resolveGroupSessionKey, B as parseSessionThreadInfo, Bt as resolveGatewayCredentialsFromConfig, C as isCompactionFailureError, Ct as setSessionRuntimeModel, D as isLikelyContextOverflowError, Dt as resolveMainSessionKey, E as isFailoverErrorMessage, Et as resolveExplicitAgentSessionKey, F as isTimeoutErrorMessage, Ft as resolveBrowserConfig, G as readSessionUpdatedAt, Gt as collectExplicitAllowlist, Ht as resolveSandboxConfigForAgent, I as ensureSandboxWorkspaceForSession, It as resolveProfile, J as updateSessionStore, Jt as stripPluginOnlyAllowlist, K as recordSessionMetaFromInbound, Kt as expandPolicyWithPluginGroups, L as resolveSandboxContext, Lt as getBridgeAuthForPort, M as parseImageSizeError, Mt as resolveSessionLockMaxHoldFromTimeout, N as sanitizeUserFacingText, Nt as createBrowserRouteContext, O as isRateLimitAssistantError, Ot as deriveSessionMetaPatch, P as isAuthPermanentErrorMessage, Pt as registerBrowserRoutes, Q as deliveryContextFromSession, Qt as compileGlobPatterns, R as resolveSandboxRuntimeStatus, Rt as ensureBrowserControlAuth, S as isCloudCodeAssistFormatError, St as resolveFreshSessionTotalTokens, T as isFailoverAssistantError, U as resolveAndPersistSessionFile, Ut as applyOwnerOnlyToolPolicy, V as appendAssistantMessageToSessionTranscript, Vt as trimToUndefined$1, W as loadSessionStore, Wt as buildPluginToolGroups, X as isCacheEnabled, Xt as normalizeToolName, Y as updateSessionStoreEntry, Yt as expandToolGroups, Z as resolveCacheTtlMs$1, Zt as resolveToolProfilePolicy, _ as formatBillingErrorMessage, _t as resolveSessionResetPolicy, a as isMessagingToolDuplicateNormalized, an as sanitizeGoogleTurnOrdering, at as capArrayByJsonBytes, b as isAuthAssistantError, bt as DEFAULT_RESET_TRIGGERS, c as extractToolCallsFromAssistant, ct as parseInlineDirectives$1, d as downgradeOpenAIFunctionCallReasoningPairs, dt as hasInterSessionUserProvenance, en as buildBootstrapContextFiles, et as mergeDeliveryContext, f as downgradeOpenAIReasoningBlocks, ft as normalizeInputProvenance, g as formatAssistantErrorText, gt as resolveChannelResetConfig, h as classifyFailoverReason, ht as evaluateSessionFreshness, in as resolveBootstrapTotalMaxChars, it as archiveSessionTranscripts, j as parseImageDimensionError, jt as acquireSessionWriteLock, k as isRawApiErrorPayload, kt as resolveConversationLabel, l as extractToolResultId, lt as INPUT_PROVENANCE_KIND_VALUES, m as BILLING_ERROR_USER_MESSAGE, mt as resolveSessionKey, n as validateGeminiTurns, nn as resolveBootstrapMaxChars, nt as normalizeSessionDeliveryFields, o as normalizeTextForComparison, ot as countToolResults, p as isGoogleModelApi, pt as jsonUtf8Bytes, q as updateLastRoute, qt as mergeAlsoAllowPolicy, r as pickFallbackThinkingLevel, rn as resolveBootstrapPromptTruncationWarningMode, rt as normalizeAccountId$3, s as sanitizeSessionMessagesImages, st as extractToolCallNames, t as validateAnthropicTurns, tn as ensureSessionHeader, tt as normalizeDeliveryContext, u as sanitizeToolCallIdsForCloudCodeAssist, ut as applyInputProvenanceToUserMessage, v as formatRawAssistantErrorForUi, vt as resolveSessionResetType, w as isContextOverflowError, wt as canonicalizeMainSessionAlias, x as isBillingAssistantError, xt as mergeSessionEntry, y as getApiErrorPayloadFingerprint, yt as resolveThreadFlag, z as extractDeliveryInfo, zt as resolveBrowserControlAuth } from "./pi-embedded-helpers-
|
|
24
|
-
import { A as rawDataToString, B as isSecureWebSocketUrl, C as ensureChromeExtensionRelayServer, N as DEFAULT_UPLOAD_DIR, P as resolveExistingPathsWithinRoot, U as DEFAULT_AI_SNAPSHOT_MAX_CHARS, s as resolveLsofCommandSync, z as isLoopbackHost } from "./chrome-
|
|
25
|
-
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-
|
|
26
|
-
import { t as PATH_ALIAS_POLICIES } from "./path-alias-guards-
|
|
27
|
-
import { i as testRegexWithBoundedInput, r as compileSafeRegex, t as redactSensitiveText } from "./redact-
|
|
28
|
-
import { i as formatUncaughtError, o as readErrorName, r as formatErrorMessage } from "./errors-
|
|
29
|
-
import { a as readFileWithinRoot, c as writeFileWithinRoot, i as openFileWithinRoot, n as copyFileWithinRoot, r as createRootScopedReadFile, t as SafeOpenError } from "./fs-safe-
|
|
30
|
-
import { a as isBlockedHostnameOrIp, c as normalizeHostname, n as SsrFBlockedError } from "./proxy-env-
|
|
31
|
-
import { i as saveMediaBuffer, r as getMediaDir, t as MEDIA_MAX_BYTES } from "./store-
|
|
20
|
+
import { A as mediaKindFromMime, C as imageMimeFromFormat, E as kindFromMime, O as MAX_IMAGE_BYTES, T as isGifMedia, _ as GATEWAY_CLIENT_IDS, b as detectMime, c as INTERNAL_MESSAGE_CHANNEL, d as isInternalMessageChannel, f as isMarkdownCapableMessageChannel, g as resolveMessageChannel, h as resolveGatewayMessageChannel, i as getImageMetadata, l as isDeliverableMessageChannel, m as normalizeMessageChannel, p as listDeliverableMessageChannels, s as resizeToJpeg, u as isGatewayMessageChannel, v as GATEWAY_CLIENT_MODES, w as isAudioFileName, x as extensionForMime, y as GATEWAY_CLIENT_NAMES } from "./image-ops-BoN1E_WZ.js";
|
|
21
|
+
import { $ as removeChannelAllowFromStoreEntry, A as expandTextLinks, B as resolveTelegramThreadSpec, C as buildSenderName, D as buildTelegramThreadParams, E as buildTelegramParentPeer, F as resolveTelegramForumThreadId, G as firstDefined$1, H as normalizeAllowFrom$2, I as resolveTelegramGroupAllowFromContext, J as resolveGroupAllowFromSources, K as isSenderIdAllowed, L as resolveTelegramMediaPlaceholder, M as hasBotMention, N as normalizeForwardedContext, O as buildTypingThreadParams, P as resolveTelegramDirectPeerId, Q as readChannelAllowFromStore, R as resolveTelegramReplyId, S as buildSenderLabel, T as buildTelegramGroupPeerId, U as normalizeDmAllowFromWithStore$1, V as isSenderAllowed$1, W as resolveSenderAllowMatch$1, X as toLocationContext, Y as formatLocationText, Z as addChannelAllowFromStoreEntry, _ as splitTelegramCaption, a as reactMessageTelegram, at as isVoiceCompatibleAudio, b as resolveCronStorePath, c as sendStickerTelegram, d as isRecoverableTelegramNetworkError, et as upsertChannelPairingRequest, f as markdownToTelegramChunks, g as resolveTelegramFetch, h as wrapFileReferencesInHtml, i as editMessageTelegram, it as listPairingChannels, j as extractTelegramLocation, k as describeReplyTarget, l as resolveTelegramVoiceSend, m as renderTelegramHtmlText, n as createForumTopicTelegram, nt as writeJsonFileAtomically, o as sendMessageTelegram, p as markdownToTelegramHtml, q as mergeDmAllowFromSources, r as deleteMessageTelegram, rt as getPairingAdapter, s as sendPollTelegram, t as buildInlineKeyboard, tt as readJsonFileWithFallback, u as wasSentByBot, v as withTelegramApiErrorLogging, w as buildTelegramGroupFrom, x as buildGroupLabel, y as loadCronStore, z as resolveTelegramStreamMode } from "./send-D5D0ZGht.js";
|
|
22
|
+
import { n as discoverModels, t as discoverAuthStorage } from "./pi-model-discovery-o-WX5w2t.js";
|
|
23
|
+
import { $ as deliveryContextKey, $t as matchesAnyGlobPattern, A as isTransientHttpError, At as resolveGroupSessionKey, B as parseSessionThreadInfo, Bt as resolveGatewayCredentialsFromConfig, C as isCompactionFailureError, Ct as setSessionRuntimeModel, D as isLikelyContextOverflowError, Dt as resolveMainSessionKey, E as isFailoverErrorMessage, Et as resolveExplicitAgentSessionKey, F as isTimeoutErrorMessage, Ft as resolveBrowserConfig, G as readSessionUpdatedAt, Gt as collectExplicitAllowlist, Ht as resolveSandboxConfigForAgent, I as ensureSandboxWorkspaceForSession, It as resolveProfile, J as updateSessionStore, Jt as stripPluginOnlyAllowlist, K as recordSessionMetaFromInbound, Kt as expandPolicyWithPluginGroups, L as resolveSandboxContext, Lt as getBridgeAuthForPort, M as parseImageSizeError, Mt as resolveSessionLockMaxHoldFromTimeout, N as sanitizeUserFacingText, Nt as createBrowserRouteContext, O as isRateLimitAssistantError, Ot as deriveSessionMetaPatch, P as isAuthPermanentErrorMessage, Pt as registerBrowserRoutes, Q as deliveryContextFromSession, Qt as compileGlobPatterns, R as resolveSandboxRuntimeStatus, Rt as ensureBrowserControlAuth, S as isCloudCodeAssistFormatError, St as resolveFreshSessionTotalTokens, T as isFailoverAssistantError, U as resolveAndPersistSessionFile, Ut as applyOwnerOnlyToolPolicy, V as appendAssistantMessageToSessionTranscript, Vt as trimToUndefined$1, W as loadSessionStore, Wt as buildPluginToolGroups, X as isCacheEnabled, Xt as normalizeToolName, Y as updateSessionStoreEntry, Yt as expandToolGroups, Z as resolveCacheTtlMs$1, Zt as resolveToolProfilePolicy, _ as formatBillingErrorMessage, _t as resolveSessionResetPolicy, a as isMessagingToolDuplicateNormalized, an as sanitizeGoogleTurnOrdering, at as capArrayByJsonBytes, b as isAuthAssistantError, bt as DEFAULT_RESET_TRIGGERS, c as extractToolCallsFromAssistant, ct as parseInlineDirectives$1, d as downgradeOpenAIFunctionCallReasoningPairs, dt as hasInterSessionUserProvenance, en as buildBootstrapContextFiles, et as mergeDeliveryContext, f as downgradeOpenAIReasoningBlocks, ft as normalizeInputProvenance, g as formatAssistantErrorText, gt as resolveChannelResetConfig, h as classifyFailoverReason, ht as evaluateSessionFreshness, in as resolveBootstrapTotalMaxChars, it as archiveSessionTranscripts, j as parseImageDimensionError, jt as acquireSessionWriteLock, k as isRawApiErrorPayload, kt as resolveConversationLabel, l as extractToolResultId, lt as INPUT_PROVENANCE_KIND_VALUES, m as BILLING_ERROR_USER_MESSAGE, mt as resolveSessionKey, n as validateGeminiTurns, nn as resolveBootstrapMaxChars, nt as normalizeSessionDeliveryFields, o as normalizeTextForComparison, ot as countToolResults, p as isGoogleModelApi, pt as jsonUtf8Bytes, q as updateLastRoute, qt as mergeAlsoAllowPolicy, r as pickFallbackThinkingLevel, rn as resolveBootstrapPromptTruncationWarningMode, rt as normalizeAccountId$3, s as sanitizeSessionMessagesImages, st as extractToolCallNames, t as validateAnthropicTurns, tn as ensureSessionHeader, tt as normalizeDeliveryContext, u as sanitizeToolCallIdsForCloudCodeAssist, ut as applyInputProvenanceToUserMessage, v as formatRawAssistantErrorForUi, vt as resolveSessionResetType, w as isContextOverflowError, wt as canonicalizeMainSessionAlias, x as isBillingAssistantError, xt as mergeSessionEntry, y as getApiErrorPayloadFingerprint, yt as resolveThreadFlag, z as extractDeliveryInfo, zt as resolveBrowserControlAuth } from "./pi-embedded-helpers-CYR1UemI.js";
|
|
24
|
+
import { A as rawDataToString, B as isSecureWebSocketUrl, C as ensureChromeExtensionRelayServer, N as DEFAULT_UPLOAD_DIR, P as resolveExistingPathsWithinRoot, U as DEFAULT_AI_SNAPSHOT_MAX_CHARS, s as resolveLsofCommandSync, z as isLoopbackHost } from "./chrome-Qbvnl6so.js";
|
|
25
|
+
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-B9N2bqKU.js";
|
|
26
|
+
import { t as PATH_ALIAS_POLICIES } from "./path-alias-guards-Cpsiv2KL.js";
|
|
27
|
+
import { i as testRegexWithBoundedInput, r as compileSafeRegex, t as redactSensitiveText } from "./redact-NmPEVjIo.js";
|
|
28
|
+
import { i as formatUncaughtError, o as readErrorName, r as formatErrorMessage } from "./errors-DfgAh2Ml.js";
|
|
29
|
+
import { a as readFileWithinRoot, c as writeFileWithinRoot, i as openFileWithinRoot, n as copyFileWithinRoot, r as createRootScopedReadFile, t as SafeOpenError } from "./fs-safe-CwHbZdFH.js";
|
|
30
|
+
import { a as isBlockedHostnameOrIp, c as normalizeHostname, n as SsrFBlockedError } from "./proxy-env-DXXfs2WL.js";
|
|
31
|
+
import { i as saveMediaBuffer, r as getMediaDir, t as MEDIA_MAX_BYTES } from "./store-CvQ41zCV.js";
|
|
32
32
|
import { n as readJsonFile, r as writeJsonAtomic, t as createAsyncLock } from "./json-files-D7-rxoSr.js";
|
|
33
|
-
import { t as resolveIMessageAccount } from "./accounts-
|
|
34
|
-
import { i as resolveSessionTranscriptPath, n as resolveSessionFilePath, o as resolveSessionTranscriptsDirForAgent, r as resolveSessionFilePathOptions, s as resolveStorePath, t as resolveDefaultSessionStorePath } from "./paths-
|
|
33
|
+
import { t as resolveIMessageAccount } from "./accounts-Bkb-J8V6.js";
|
|
34
|
+
import { i as resolveSessionTranscriptPath, n as resolveSessionFilePath, o as resolveSessionTranscriptsDirForAgent, r as resolveSessionFilePathOptions, s as resolveStorePath, t as resolveDefaultSessionStorePath } from "./paths-CXClY8zC.js";
|
|
35
35
|
import { n as onSessionTranscriptUpdate, t as emitSessionTranscriptUpdate } from "./transcript-events-uYL2gEou.js";
|
|
36
|
-
import { a as canonicalizeBase64, i as resolveImageSanitizationLimits, n as sanitizeImageBlocks, o as estimateBase64DecodedBytes, r as sanitizeToolResultImages } from "./tool-images-
|
|
37
|
-
import { C as minimaxUnderstandImage, S as extractTextFromChatContent, _ as formatToolSummary, a as resolveProviderVisionModelFromConfig, b as findCodeRegions, c as extractThinkingFromTaggedStream, d as inferToolMetaFromArgs, f as isAssistantMessage, g as stripThinkingTagsFromText, h as stripMinimaxToolCallXml, i as decodeDataUrl, l as extractThinkingFromTaggedText, m as stripDowngradedToolCallText, n as coerceImageAssistantText, o as extractAssistantText$1, p as promoteThinkingTagsToBlocks, r as coerceImageModelConfig, s as extractAssistantThinking, u as formatReasoningMessage, v as resolveToolDisplay, w as ensureSquidClawModelsJson, x as isInsideCode, y as stripReasoningTagsFromText } from "./image-
|
|
38
|
-
import { _ as resolveAttachmentKind, a as resolveAutoImageModel, b as modelSupportsVision, c as applyTemplate, d as normalizeMediaUnderstandingChatType, f as resolveMediaUnderstandingScope, h as registerUnhandledRejectionHandler, i as normalizeMediaAttachments, l as resolveConcurrency, m as buildRandomTempFilePath, n as buildProviderRegistry, o as resolveMediaAttachmentLocalRoots, p as CLI_OUTPUT_MAX_BUFFER, r as createMediaAttachmentCache, s as runCapability, t as runAudioTranscription, u as resolveTimeoutMs$2, v as findModelInCatalog, y as loadModelCatalog } from "./audio-transcription-runner-
|
|
39
|
-
import { a as getDefaultMediaLocalRoots, i as getAgentScopedMediaLocalRoots, n as fetchRemoteMedia, r as readResponseWithLimit, t as MediaFetchError } from "./fetch-
|
|
36
|
+
import { a as canonicalizeBase64, i as resolveImageSanitizationLimits, n as sanitizeImageBlocks, o as estimateBase64DecodedBytes, r as sanitizeToolResultImages } from "./tool-images-Zn6jVmkX.js";
|
|
37
|
+
import { C as minimaxUnderstandImage, S as extractTextFromChatContent, _ as formatToolSummary, a as resolveProviderVisionModelFromConfig, b as findCodeRegions, c as extractThinkingFromTaggedStream, d as inferToolMetaFromArgs, f as isAssistantMessage, g as stripThinkingTagsFromText, h as stripMinimaxToolCallXml, i as decodeDataUrl, l as extractThinkingFromTaggedText, m as stripDowngradedToolCallText, n as coerceImageAssistantText, o as extractAssistantText$1, p as promoteThinkingTagsToBlocks, r as coerceImageModelConfig, s as extractAssistantThinking, u as formatReasoningMessage, v as resolveToolDisplay, w as ensureSquidClawModelsJson, x as isInsideCode, y as stripReasoningTagsFromText } from "./image-ByqExb8z.js";
|
|
38
|
+
import { _ as resolveAttachmentKind, a as resolveAutoImageModel, b as modelSupportsVision, c as applyTemplate, d as normalizeMediaUnderstandingChatType, f as resolveMediaUnderstandingScope, h as registerUnhandledRejectionHandler, i as normalizeMediaAttachments, l as resolveConcurrency, m as buildRandomTempFilePath, n as buildProviderRegistry, o as resolveMediaAttachmentLocalRoots, p as CLI_OUTPUT_MAX_BUFFER, r as createMediaAttachmentCache, s as runCapability, t as runAudioTranscription, u as resolveTimeoutMs$2, v as findModelInCatalog, y as loadModelCatalog } from "./audio-transcription-runner-C3N9eAGM.js";
|
|
39
|
+
import { a as getDefaultMediaLocalRoots, i as getAgentScopedMediaLocalRoots, n as fetchRemoteMedia, r as readResponseWithLimit, t as MediaFetchError } from "./fetch-b8tSR7_e.js";
|
|
40
40
|
import { n as fetchWithTimeout, t as bindAbortRelay } from "./fetch-timeout-Wgx3OXYj.js";
|
|
41
|
-
import { n as withStrictGuardedFetchMode, r as withTrustedEnvProxyGuardedFetchMode, t as fetchWithSsrFGuard } from "./fetch-guard-
|
|
42
|
-
import { t as makeProxyFetch } from "./proxy-fetch-
|
|
43
|
-
import { _ as isSafeFenceBreak, a as loadWebMedia, c as chunkByNewline, d as chunkMarkdownTextWithMode, f as chunkText, g as findFenceSpanAt, h as resolveTextChunkLimit, i as getDefaultLocalRoots, m as resolveChunkMode, o as loadWebMediaRaw, p as chunkTextWithMode, s as resolveMarkdownTableMode, u as chunkMarkdownText, v as parseFenceSpans } from "./ir-
|
|
44
|
-
import { a as ToolInputError, c as imageResultFromFile, d as readNumberParam, f as readReactionParams, h as readStringParam, l as jsonResult, m as readStringOrNumberParam, n as missingTargetError, o as createActionGate, p as readStringArrayParam, r as unknownTargetError, s as imageResult, t as ambiguousTargetError, u as parseAvailableTags } from "./target-errors-
|
|
45
|
-
import { _ as isRestartEnabled, a as listChatCommandsForConfig, c as maybeResolveTextAlias, d as resolveCommandArgChoices, f as resolveCommandArgMenu, g as isNativeCommandsExplicitlyDisabled, h as isCommandFlagEnabled, i as listChatCommands, l as normalizeCommandBody, m as shouldHandleTextCommands, n as findCommandByNativeName, o as listNativeCommandSpecs, p as serializeCommandArgs, r as isCommandEnabled, s as listNativeCommandSpecsForConfig, t as buildCommandTextFromArgs, u as parseCommandArgs, v as resolveNativeCommandsEnabled, y as resolveNativeSkillsEnabled } from "./commands-registry-
|
|
46
|
-
import { a as getRemoteSkillEligibility, c as pruneExpiredPending, i as resolveSkillCommandInvocation, l as resolvePairingPaths, n as listSkillCommandsForAgents, o as ensureSkillsWatcher, r as listSkillCommandsForWorkspace, s as getSkillsSnapshotVersion, t as listReservedChatSlashCommandNames } from "./skill-commands-
|
|
41
|
+
import { n as withStrictGuardedFetchMode, r as withTrustedEnvProxyGuardedFetchMode, t as fetchWithSsrFGuard } from "./fetch-guard-D16tjNsZ.js";
|
|
42
|
+
import { t as makeProxyFetch } from "./proxy-fetch-C2v-Utgg.js";
|
|
43
|
+
import { _ as isSafeFenceBreak, a as loadWebMedia, c as chunkByNewline, d as chunkMarkdownTextWithMode, f as chunkText, g as findFenceSpanAt, h as resolveTextChunkLimit, i as getDefaultLocalRoots, m as resolveChunkMode, o as loadWebMediaRaw, p as chunkTextWithMode, s as resolveMarkdownTableMode, u as chunkMarkdownText, v as parseFenceSpans } from "./ir-Dut0zXyS.js";
|
|
44
|
+
import { a as ToolInputError, c as imageResultFromFile, d as readNumberParam, f as readReactionParams, h as readStringParam, l as jsonResult, m as readStringOrNumberParam, n as missingTargetError, o as createActionGate, p as readStringArrayParam, r as unknownTargetError, s as imageResult, t as ambiguousTargetError, u as parseAvailableTags } from "./target-errors-D0ZJUbbf.js";
|
|
45
|
+
import { _ as isRestartEnabled, a as listChatCommandsForConfig, c as maybeResolveTextAlias, d as resolveCommandArgChoices, f as resolveCommandArgMenu, g as isNativeCommandsExplicitlyDisabled, h as isCommandFlagEnabled, i as listChatCommands, l as normalizeCommandBody, m as shouldHandleTextCommands, n as findCommandByNativeName, o as listNativeCommandSpecs, p as serializeCommandArgs, r as isCommandEnabled, s as listNativeCommandSpecsForConfig, t as buildCommandTextFromArgs, u as parseCommandArgs, v as resolveNativeCommandsEnabled, y as resolveNativeSkillsEnabled } from "./commands-registry-B44COZFz.js";
|
|
46
|
+
import { a as getRemoteSkillEligibility, c as pruneExpiredPending, i as resolveSkillCommandInvocation, l as resolvePairingPaths, n as listSkillCommandsForAgents, o as ensureSkillsWatcher, r as listSkillCommandsForWorkspace, s as getSkillsSnapshotVersion, t as listReservedChatSlashCommandNames } from "./skill-commands-BwTLQRR8.js";
|
|
47
47
|
import { n as wrapFetchWithAbortSignal, t as resolveFetch } from "./fetch-tZXOZ9FV.js";
|
|
48
48
|
import { n as recordCommandPoll, r as resetCommandPollCount } from "./command-poll-backoff-CmCpeg5n.js";
|
|
49
|
-
import { n as recordChannelActivity, r as createDiscordRetryRunner, t as getChannelActivity } from "./channel-activity-
|
|
49
|
+
import { n as recordChannelActivity, r as createDiscordRetryRunner, t as getChannelActivity } from "./channel-activity-CxJbx4sD.js";
|
|
50
50
|
import { t as buildOutboundMediaLoadOptions } from "./load-options-BFUunM8u.js";
|
|
51
51
|
import { n as normalizePollInput } from "./polls-CYTwXmA1.js";
|
|
52
|
-
import { t as convertMarkdownTables } from "./tables-
|
|
53
|
-
import { a as signalCheck, i as resolveSignalRpcContext, n as sendReadReceiptSignal, o as signalRpcRequest, r as sendTypingSignal, s as streamSignalEvents, t as sendMessageSignal } from "./send-
|
|
54
|
-
import { a as isAllowedIMessageSender, i as formatIMessageChatTarget, n as createIMessageRpcClient, o as normalizeIMessageHandle, r as DEFAULT_IMESSAGE_PROBE_TIMEOUT_MS, s as parseIMessageTarget, t as sendMessageIMessage } from "./send-
|
|
55
|
-
import { i as redactIdentifier, t as getActiveWebListener } from "./active-listener-
|
|
56
|
-
import { n as resolveMemorySearchConfig } from "./manager-
|
|
57
|
-
import { f as listMemoryFiles, p as normalizeExtraMemoryPaths } from "./query-expansion-
|
|
52
|
+
import { t as convertMarkdownTables } from "./tables-BRYYxYs7.js";
|
|
53
|
+
import { a as signalCheck, i as resolveSignalRpcContext, n as sendReadReceiptSignal, o as signalRpcRequest, r as sendTypingSignal, s as streamSignalEvents, t as sendMessageSignal } from "./send-B5QEmMJ4.js";
|
|
54
|
+
import { a as isAllowedIMessageSender, i as formatIMessageChatTarget, n as createIMessageRpcClient, o as normalizeIMessageHandle, r as DEFAULT_IMESSAGE_PROBE_TIMEOUT_MS, s as parseIMessageTarget, t as sendMessageIMessage } from "./send-Bx9CqcZr.js";
|
|
55
|
+
import { i as redactIdentifier, t as getActiveWebListener } from "./active-listener-6-Svu8Dx.js";
|
|
56
|
+
import { n as resolveMemorySearchConfig } from "./manager-BPGhs30n.js";
|
|
57
|
+
import { f as listMemoryFiles, p as normalizeExtraMemoryPaths } from "./query-expansion-DlQOkf-g.js";
|
|
58
58
|
import { createRequire } from "node:module";
|
|
59
|
-
import * as fs$
|
|
59
|
+
import * as fs$2 from "node:fs/promises";
|
|
60
60
|
import fs, { appendFile, mkdir } from "node:fs/promises";
|
|
61
61
|
import os, { homedir } from "node:os";
|
|
62
62
|
import * as path$1 from "node:path";
|
|
63
63
|
import path, { isAbsolute } from "node:path";
|
|
64
|
-
import
|
|
64
|
+
import fs$1, { existsSync, mkdirSync, mkdtempSync, promises, readFileSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
65
65
|
import JSON5 from "json5";
|
|
66
66
|
import { inspect, isDeepStrictEqual, promisify } from "node:util";
|
|
67
67
|
import { execFile, execFileSync, spawn, spawnSync } from "node:child_process";
|
|
@@ -3285,7 +3285,7 @@ async function resolveSquidClawDocsPath(params) {
|
|
|
3285
3285
|
const workspaceDir = params.workspaceDir?.trim();
|
|
3286
3286
|
if (workspaceDir) {
|
|
3287
3287
|
const workspaceDocs = path.join(workspaceDir, "docs");
|
|
3288
|
-
if (
|
|
3288
|
+
if (fs$1.existsSync(workspaceDocs)) return workspaceDocs;
|
|
3289
3289
|
}
|
|
3290
3290
|
const packageRoot = await resolveSquidClawPackageRoot({
|
|
3291
3291
|
cwd: params.cwd,
|
|
@@ -3294,7 +3294,7 @@ async function resolveSquidClawDocsPath(params) {
|
|
|
3294
3294
|
});
|
|
3295
3295
|
if (!packageRoot) return null;
|
|
3296
3296
|
const packageDocs = path.join(packageRoot, "docs");
|
|
3297
|
-
return
|
|
3297
|
+
return fs$1.existsSync(packageDocs) ? packageDocs : null;
|
|
3298
3298
|
}
|
|
3299
3299
|
|
|
3300
3300
|
//#endregion
|
|
@@ -6431,7 +6431,7 @@ function resolveDefaultIdentityPath() {
|
|
|
6431
6431
|
return path.join(resolveStateDir(), "identity", "device.json");
|
|
6432
6432
|
}
|
|
6433
6433
|
function ensureDir$2(filePath) {
|
|
6434
|
-
|
|
6434
|
+
fs$1.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
6435
6435
|
}
|
|
6436
6436
|
const ED25519_SPKI_PREFIX = Buffer.from("302a300506032b6570032100", "hex");
|
|
6437
6437
|
function base64UrlEncode(buf) {
|
|
@@ -6467,8 +6467,8 @@ function generateIdentity() {
|
|
|
6467
6467
|
}
|
|
6468
6468
|
function loadOrCreateDeviceIdentity(filePath = resolveDefaultIdentityPath()) {
|
|
6469
6469
|
try {
|
|
6470
|
-
if (
|
|
6471
|
-
const raw =
|
|
6470
|
+
if (fs$1.existsSync(filePath)) {
|
|
6471
|
+
const raw = fs$1.readFileSync(filePath, "utf8");
|
|
6472
6472
|
const parsed = JSON.parse(raw);
|
|
6473
6473
|
if (parsed?.version === 1 && typeof parsed.deviceId === "string" && typeof parsed.publicKeyPem === "string" && typeof parsed.privateKeyPem === "string") {
|
|
6474
6474
|
const derivedId = fingerprintPublicKey(parsed.publicKeyPem);
|
|
@@ -6477,9 +6477,9 @@ function loadOrCreateDeviceIdentity(filePath = resolveDefaultIdentityPath()) {
|
|
|
6477
6477
|
...parsed,
|
|
6478
6478
|
deviceId: derivedId
|
|
6479
6479
|
};
|
|
6480
|
-
|
|
6480
|
+
fs$1.writeFileSync(filePath, `${JSON.stringify(updated, null, 2)}\n`, { mode: 384 });
|
|
6481
6481
|
try {
|
|
6482
|
-
|
|
6482
|
+
fs$1.chmodSync(filePath, 384);
|
|
6483
6483
|
} catch {}
|
|
6484
6484
|
return {
|
|
6485
6485
|
deviceId: derivedId,
|
|
@@ -6504,9 +6504,9 @@ function loadOrCreateDeviceIdentity(filePath = resolveDefaultIdentityPath()) {
|
|
|
6504
6504
|
privateKeyPem: identity.privateKeyPem,
|
|
6505
6505
|
createdAtMs: Date.now()
|
|
6506
6506
|
};
|
|
6507
|
-
|
|
6507
|
+
fs$1.writeFileSync(filePath, `${JSON.stringify(stored, null, 2)}\n`, { mode: 384 });
|
|
6508
6508
|
try {
|
|
6509
|
-
|
|
6509
|
+
fs$1.chmodSync(filePath, 384);
|
|
6510
6510
|
} catch {}
|
|
6511
6511
|
return identity;
|
|
6512
6512
|
}
|
|
@@ -6698,8 +6698,8 @@ function resolveDeviceAuthPath(env = process.env) {
|
|
|
6698
6698
|
}
|
|
6699
6699
|
function readStore(filePath) {
|
|
6700
6700
|
try {
|
|
6701
|
-
if (!
|
|
6702
|
-
const raw =
|
|
6701
|
+
if (!fs$1.existsSync(filePath)) return null;
|
|
6702
|
+
const raw = fs$1.readFileSync(filePath, "utf8");
|
|
6703
6703
|
const parsed = JSON.parse(raw);
|
|
6704
6704
|
if (parsed?.version !== 1 || typeof parsed.deviceId !== "string") return null;
|
|
6705
6705
|
if (!parsed.tokens || typeof parsed.tokens !== "object") return null;
|
|
@@ -6709,10 +6709,10 @@ function readStore(filePath) {
|
|
|
6709
6709
|
}
|
|
6710
6710
|
}
|
|
6711
6711
|
function writeStore(filePath, store) {
|
|
6712
|
-
|
|
6713
|
-
|
|
6712
|
+
fs$1.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
6713
|
+
fs$1.writeFileSync(filePath, `${JSON.stringify(store, null, 2)}\n`, { mode: 384 });
|
|
6714
6714
|
try {
|
|
6715
|
-
|
|
6715
|
+
fs$1.chmodSync(filePath, 384);
|
|
6716
6716
|
} catch {}
|
|
6717
6717
|
}
|
|
6718
6718
|
function loadDeviceAuthToken(params) {
|
|
@@ -9893,7 +9893,7 @@ function normalizeReplyPayload(payload, opts = {}) {
|
|
|
9893
9893
|
*/
|
|
9894
9894
|
let deliverRuntimePromise$2 = null;
|
|
9895
9895
|
function loadDeliverRuntime$2() {
|
|
9896
|
-
deliverRuntimePromise$2 ??= import("./deliver-runtime-
|
|
9896
|
+
deliverRuntimePromise$2 ??= import("./deliver-runtime-B6NtHUuv.js");
|
|
9897
9897
|
return deliverRuntimePromise$2;
|
|
9898
9898
|
}
|
|
9899
9899
|
/**
|
|
@@ -10581,7 +10581,7 @@ function normalizeSessionKey(value) {
|
|
|
10581
10581
|
}
|
|
10582
10582
|
function readSessionStore(storePath) {
|
|
10583
10583
|
try {
|
|
10584
|
-
const raw =
|
|
10584
|
+
const raw = fs$1.readFileSync(storePath, "utf-8");
|
|
10585
10585
|
const parsed = JSON5.parse(raw);
|
|
10586
10586
|
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) return parsed;
|
|
10587
10587
|
} catch {}
|
|
@@ -11181,7 +11181,7 @@ const DEFAULT_SUBAGENT_ANNOUNCE_TIMEOUT_MS = 6e4;
|
|
|
11181
11181
|
const MAX_TIMER_SAFE_TIMEOUT_MS = 2147e6;
|
|
11182
11182
|
let subagentRegistryRuntimePromise = null;
|
|
11183
11183
|
function loadSubagentRegistryRuntime() {
|
|
11184
|
-
subagentRegistryRuntimePromise ??= import("./subagent-registry-runtime-
|
|
11184
|
+
subagentRegistryRuntimePromise ??= import("./subagent-registry-runtime-m9bFJFix.js");
|
|
11185
11185
|
return subagentRegistryRuntimePromise;
|
|
11186
11186
|
}
|
|
11187
11187
|
const DIRECT_ANNOUNCE_TRANSIENT_RETRY_DELAYS_MS = FAST_TEST_MODE ? [
|
|
@@ -14535,7 +14535,7 @@ async function runWithConcurrency(tasks, limit) {
|
|
|
14535
14535
|
//#region src/media-understanding/echo-transcript.ts
|
|
14536
14536
|
let deliverRuntimePromise$1 = null;
|
|
14537
14537
|
function loadDeliverRuntime$1() {
|
|
14538
|
-
deliverRuntimePromise$1 ??= import("./deliver-runtime-
|
|
14538
|
+
deliverRuntimePromise$1 ??= import("./deliver-runtime-B6NtHUuv.js");
|
|
14539
14539
|
return deliverRuntimePromise$1;
|
|
14540
14540
|
}
|
|
14541
14541
|
const DEFAULT_ECHO_TRANSCRIPT_FORMAT = "📝 \"{transcript}\"";
|
|
@@ -18184,7 +18184,7 @@ function mergeLegacyAgent(current, legacy) {
|
|
|
18184
18184
|
}
|
|
18185
18185
|
function ensureDir$1(filePath) {
|
|
18186
18186
|
const dir = path.dirname(filePath);
|
|
18187
|
-
|
|
18187
|
+
fs$1.mkdirSync(dir, { recursive: true });
|
|
18188
18188
|
}
|
|
18189
18189
|
function coerceAllowlistEntries(allowlist) {
|
|
18190
18190
|
if (!Array.isArray(allowlist) || allowlist.length === 0) return Array.isArray(allowlist) ? allowlist : void 0;
|
|
@@ -18254,11 +18254,11 @@ function generateToken() {
|
|
|
18254
18254
|
function loadExecApprovals() {
|
|
18255
18255
|
const filePath = resolveExecApprovalsPath();
|
|
18256
18256
|
try {
|
|
18257
|
-
if (!
|
|
18257
|
+
if (!fs$1.existsSync(filePath)) return normalizeExecApprovals({
|
|
18258
18258
|
version: 1,
|
|
18259
18259
|
agents: {}
|
|
18260
18260
|
});
|
|
18261
|
-
const raw =
|
|
18261
|
+
const raw = fs$1.readFileSync(filePath, "utf8");
|
|
18262
18262
|
const parsed = JSON.parse(raw);
|
|
18263
18263
|
if (parsed?.version !== 1) return normalizeExecApprovals({
|
|
18264
18264
|
version: 1,
|
|
@@ -18275,9 +18275,9 @@ function loadExecApprovals() {
|
|
|
18275
18275
|
function saveExecApprovals(file) {
|
|
18276
18276
|
const filePath = resolveExecApprovalsPath();
|
|
18277
18277
|
ensureDir$1(filePath);
|
|
18278
|
-
|
|
18278
|
+
fs$1.writeFileSync(filePath, `${JSON.stringify(file, null, 2)}\n`, { mode: 384 });
|
|
18279
18279
|
try {
|
|
18280
|
-
|
|
18280
|
+
fs$1.chmodSync(filePath, 384);
|
|
18281
18281
|
} catch {}
|
|
18282
18282
|
}
|
|
18283
18283
|
function ensureExecApprovals() {
|
|
@@ -18774,18 +18774,18 @@ function drainSystemEventEntries(sessionKey) {
|
|
|
18774
18774
|
function resolvePowerShellPath() {
|
|
18775
18775
|
const programFiles = process.env.ProgramFiles || process.env.PROGRAMFILES || "C:\\Program Files";
|
|
18776
18776
|
const pwsh7 = path.join(programFiles, "PowerShell", "7", "pwsh.exe");
|
|
18777
|
-
if (
|
|
18777
|
+
if (fs$1.existsSync(pwsh7)) return pwsh7;
|
|
18778
18778
|
const programW6432 = process.env.ProgramW6432;
|
|
18779
18779
|
if (programW6432 && programW6432 !== programFiles) {
|
|
18780
18780
|
const pwsh7Alt = path.join(programW6432, "PowerShell", "7", "pwsh.exe");
|
|
18781
|
-
if (
|
|
18781
|
+
if (fs$1.existsSync(pwsh7Alt)) return pwsh7Alt;
|
|
18782
18782
|
}
|
|
18783
18783
|
const pwshInPath = resolveShellFromPath("pwsh");
|
|
18784
18784
|
if (pwshInPath) return pwshInPath;
|
|
18785
18785
|
const systemRoot = process.env.SystemRoot || process.env.WINDIR;
|
|
18786
18786
|
if (systemRoot) {
|
|
18787
18787
|
const candidate = path.join(systemRoot, "System32", "WindowsPowerShell", "v1.0", "powershell.exe");
|
|
18788
|
-
if (
|
|
18788
|
+
if (fs$1.existsSync(candidate)) return candidate;
|
|
18789
18789
|
}
|
|
18790
18790
|
return "powershell.exe";
|
|
18791
18791
|
}
|
|
@@ -18823,7 +18823,7 @@ function resolveShellFromPath(name) {
|
|
|
18823
18823
|
for (const entry of entries) {
|
|
18824
18824
|
const candidate = path.join(entry, name);
|
|
18825
18825
|
try {
|
|
18826
|
-
|
|
18826
|
+
fs$1.accessSync(candidate, fs$1.constants.X_OK);
|
|
18827
18827
|
return candidate;
|
|
18828
18828
|
} catch {}
|
|
18829
18829
|
}
|
|
@@ -22298,7 +22298,7 @@ function ensureContextWindowCacheLoaded() {
|
|
|
22298
22298
|
await ensureSquidClawModelsJson(cfg);
|
|
22299
22299
|
} catch {}
|
|
22300
22300
|
try {
|
|
22301
|
-
const { discoverAuthStorage, discoverModels } = await import("./pi-model-discovery-
|
|
22301
|
+
const { discoverAuthStorage, discoverModels } = await import("./pi-model-discovery-o-WX5w2t.js").then((n) => n.r);
|
|
22302
22302
|
const agentDir = resolveSquidClawAgentDir();
|
|
22303
22303
|
const modelRegistry = discoverModels(discoverAuthStorage(agentDir), agentDir);
|
|
22304
22304
|
applyDiscoveredContextWindows({
|
|
@@ -22407,8 +22407,8 @@ function resolveFallbackFlagPath() {
|
|
|
22407
22407
|
function readFallbackFlag() {
|
|
22408
22408
|
try {
|
|
22409
22409
|
const flagPath = resolveFallbackFlagPath();
|
|
22410
|
-
if (!
|
|
22411
|
-
const data = JSON.parse(
|
|
22410
|
+
if (!fs$1.existsSync(flagPath)) return null;
|
|
22411
|
+
const data = JSON.parse(fs$1.readFileSync(flagPath, "utf8"));
|
|
22412
22412
|
if (data && data.active) return data;
|
|
22413
22413
|
return null;
|
|
22414
22414
|
} catch {
|
|
@@ -22421,7 +22421,7 @@ function readFallbackFlag() {
|
|
|
22421
22421
|
function writeFallbackFlag(data) {
|
|
22422
22422
|
try {
|
|
22423
22423
|
const flagPath = resolveFallbackFlagPath();
|
|
22424
|
-
|
|
22424
|
+
fs$1.writeFileSync(flagPath, JSON.stringify({
|
|
22425
22425
|
active: true,
|
|
22426
22426
|
...data,
|
|
22427
22427
|
since: Date.now()
|
|
@@ -22434,7 +22434,7 @@ function writeFallbackFlag(data) {
|
|
|
22434
22434
|
function clearFallbackFlag() {
|
|
22435
22435
|
try {
|
|
22436
22436
|
const flagPath = resolveFallbackFlagPath();
|
|
22437
|
-
if (
|
|
22437
|
+
if (fs$1.existsSync(flagPath)) fs$1.unlinkSync(flagPath);
|
|
22438
22438
|
} catch {}
|
|
22439
22439
|
}
|
|
22440
22440
|
/**
|
|
@@ -22560,7 +22560,7 @@ function walkUpFrom(startDir, opts, resolveAtDir) {
|
|
|
22560
22560
|
function hasGitMarker(repoRoot) {
|
|
22561
22561
|
const gitPath = path.join(repoRoot, ".git");
|
|
22562
22562
|
try {
|
|
22563
|
-
const stat =
|
|
22563
|
+
const stat = fs$1.statSync(gitPath);
|
|
22564
22564
|
return stat.isDirectory() || stat.isFile();
|
|
22565
22565
|
} catch {
|
|
22566
22566
|
return false;
|
|
@@ -22572,10 +22572,10 @@ function findGitRoot(startDir, opts = {}) {
|
|
|
22572
22572
|
function resolveGitDirFromMarker(repoRoot) {
|
|
22573
22573
|
const gitPath = path.join(repoRoot, ".git");
|
|
22574
22574
|
try {
|
|
22575
|
-
const stat =
|
|
22575
|
+
const stat = fs$1.statSync(gitPath);
|
|
22576
22576
|
if (stat.isDirectory()) return gitPath;
|
|
22577
22577
|
if (!stat.isFile()) return null;
|
|
22578
|
-
const match =
|
|
22578
|
+
const match = fs$1.readFileSync(gitPath, "utf-8").match(/gitdir:\s*(.+)/i);
|
|
22579
22579
|
if (!match?.[1]) return null;
|
|
22580
22580
|
return path.resolve(repoRoot, match[1].trim());
|
|
22581
22581
|
} catch {
|
|
@@ -22642,7 +22642,7 @@ const resolveCommitHash = (options = {}) => {
|
|
|
22642
22642
|
cachedCommit = null;
|
|
22643
22643
|
return cachedCommit;
|
|
22644
22644
|
}
|
|
22645
|
-
const head =
|
|
22645
|
+
const head = fs$1.readFileSync(headPath, "utf-8").trim();
|
|
22646
22646
|
if (!head) {
|
|
22647
22647
|
cachedCommit = null;
|
|
22648
22648
|
return cachedCommit;
|
|
@@ -22650,7 +22650,7 @@ const resolveCommitHash = (options = {}) => {
|
|
|
22650
22650
|
if (head.startsWith("ref:")) {
|
|
22651
22651
|
const ref = head.replace(/^ref:\s*/i, "").trim();
|
|
22652
22652
|
const refPath = path.resolve(path.dirname(headPath), ref);
|
|
22653
|
-
cachedCommit = formatCommit(
|
|
22653
|
+
cachedCommit = formatCommit(fs$1.readFileSync(refPath, "utf-8").trim());
|
|
22654
22654
|
return cachedCommit;
|
|
22655
22655
|
}
|
|
22656
22656
|
cachedCommit = formatCommit(head);
|
|
@@ -22910,17 +22910,17 @@ const readUsageFromSessionLog = (sessionId, sessionEntry, agentId, sessionKey, s
|
|
|
22910
22910
|
} catch {
|
|
22911
22911
|
return;
|
|
22912
22912
|
}
|
|
22913
|
-
if (!
|
|
22913
|
+
if (!fs$1.existsSync(logPath)) return;
|
|
22914
22914
|
try {
|
|
22915
22915
|
const TAIL_BYTES = 8192;
|
|
22916
|
-
const stat =
|
|
22916
|
+
const stat = fs$1.statSync(logPath);
|
|
22917
22917
|
const offset = Math.max(0, stat.size - TAIL_BYTES);
|
|
22918
22918
|
const buf = Buffer.alloc(Math.min(TAIL_BYTES, stat.size));
|
|
22919
|
-
const fd =
|
|
22919
|
+
const fd = fs$1.openSync(logPath, "r");
|
|
22920
22920
|
try {
|
|
22921
|
-
|
|
22921
|
+
fs$1.readSync(fd, buf, 0, buf.length, offset);
|
|
22922
22922
|
} finally {
|
|
22923
|
-
|
|
22923
|
+
fs$1.closeSync(fd);
|
|
22924
22924
|
}
|
|
22925
22925
|
const tail = buf.toString("utf-8");
|
|
22926
22926
|
const lines = (offset > 0 ? tail.slice(tail.indexOf("\n") + 1) : tail).split(/\n+/);
|
|
@@ -24450,7 +24450,7 @@ function resolveRepoRoot(params) {
|
|
|
24450
24450
|
const configured = params.config?.agents?.defaults?.repoRoot?.trim();
|
|
24451
24451
|
if (configured) try {
|
|
24452
24452
|
const resolved = path.resolve(configured);
|
|
24453
|
-
if (
|
|
24453
|
+
if (fs$1.statSync(resolved).isDirectory()) return resolved;
|
|
24454
24454
|
} catch {}
|
|
24455
24455
|
const candidates = [params.workspaceDir, params.cwd].map((value) => value?.trim()).filter(Boolean);
|
|
24456
24456
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -25236,7 +25236,7 @@ async function buildContextReply(params) {
|
|
|
25236
25236
|
//#region src/auto-reply/reply/commands-export-session.ts
|
|
25237
25237
|
const EXPORT_HTML_DIR = path.join(path.dirname(fileURLToPath(import.meta.url)), "export-html");
|
|
25238
25238
|
function loadTemplate(fileName) {
|
|
25239
|
-
return
|
|
25239
|
+
return fs$1.readFileSync(path.join(EXPORT_HTML_DIR, fileName), "utf-8");
|
|
25240
25240
|
}
|
|
25241
25241
|
function generateHtml(sessionData) {
|
|
25242
25242
|
const template = loadTemplate("template.html");
|
|
@@ -25310,7 +25310,7 @@ async function buildExportSessionReply(params) {
|
|
|
25310
25310
|
} catch (err) {
|
|
25311
25311
|
return { text: `❌ Failed to resolve session file: ${err instanceof Error ? err.message : String(err)}` };
|
|
25312
25312
|
}
|
|
25313
|
-
if (!
|
|
25313
|
+
if (!fs$1.existsSync(sessionFile)) return { text: `❌ Session file not found: ${sessionFile}` };
|
|
25314
25314
|
const sessionManager = SessionManager.open(sessionFile);
|
|
25315
25315
|
const entries = sessionManager.getEntries();
|
|
25316
25316
|
const header = sessionManager.getHeader();
|
|
@@ -25331,8 +25331,8 @@ async function buildExportSessionReply(params) {
|
|
|
25331
25331
|
const defaultFileName = `squidclaw-session-${entry.sessionId.slice(0, 8)}-${timestamp}.html`;
|
|
25332
25332
|
const outputPath = args.outputPath ? path.resolve(args.outputPath.startsWith("~") ? args.outputPath.replace("~", process.env.HOME ?? "") : args.outputPath) : path.join(params.workspaceDir, defaultFileName);
|
|
25333
25333
|
const outputDir = path.dirname(outputPath);
|
|
25334
|
-
if (!
|
|
25335
|
-
|
|
25334
|
+
if (!fs$1.existsSync(outputDir)) fs$1.mkdirSync(outputDir, { recursive: true });
|
|
25335
|
+
fs$1.writeFileSync(outputPath, html, "utf-8");
|
|
25336
25336
|
const relativePath = path.relative(params.workspaceDir, outputPath);
|
|
25337
25337
|
return { text: [
|
|
25338
25338
|
"✅ Session exported!",
|
|
@@ -25479,8 +25479,8 @@ function resolveZaiApiKey() {
|
|
|
25479
25479
|
}
|
|
25480
25480
|
try {
|
|
25481
25481
|
const authPath = path.join(resolveRequiredHomeDir(process.env, os.homedir), ".pi", "agent", "auth.json");
|
|
25482
|
-
if (!
|
|
25483
|
-
const data = JSON.parse(
|
|
25482
|
+
if (!fs$1.existsSync(authPath)) return;
|
|
25483
|
+
const data = JSON.parse(fs$1.readFileSync(authPath, "utf-8"));
|
|
25484
25484
|
return data["z-ai"]?.access || data.zai?.access;
|
|
25485
25485
|
} catch {
|
|
25486
25486
|
return;
|
|
@@ -27299,7 +27299,7 @@ function shouldPersistAnyBindingState() {
|
|
|
27299
27299
|
}
|
|
27300
27300
|
function shouldPersistBindingMutations() {
|
|
27301
27301
|
if (shouldPersistAnyBindingState()) return true;
|
|
27302
|
-
return
|
|
27302
|
+
return fs$1.existsSync(resolveThreadBindingsPath());
|
|
27303
27303
|
}
|
|
27304
27304
|
function saveBindingsToDisk(params = {}) {
|
|
27305
27305
|
if (!params.force && !shouldPersistAnyBindingState()) return;
|
|
@@ -28767,7 +28767,7 @@ const applyCostTotal = (totals, costTotal) => {
|
|
|
28767
28767
|
totals.totalCost += costTotal;
|
|
28768
28768
|
};
|
|
28769
28769
|
async function* readJsonlRecords(filePath) {
|
|
28770
|
-
const fileStream =
|
|
28770
|
+
const fileStream = fs$1.createReadStream(filePath, { encoding: "utf-8" });
|
|
28771
28771
|
const rl = readline.createInterface({
|
|
28772
28772
|
input: fileStream,
|
|
28773
28773
|
crlfDelay: Infinity
|
|
@@ -28839,10 +28839,10 @@ async function loadCostUsageSummary(params) {
|
|
|
28839
28839
|
const dailyMap = /* @__PURE__ */ new Map();
|
|
28840
28840
|
const totals = emptyTotals();
|
|
28841
28841
|
const sessionsDir = resolveSessionTranscriptsDirForAgent(params?.agentId);
|
|
28842
|
-
const entries = await
|
|
28842
|
+
const entries = await fs$1.promises.readdir(sessionsDir, { withFileTypes: true }).catch(() => []);
|
|
28843
28843
|
const files = (await Promise.all(entries.filter((entry) => entry.isFile() && entry.name.endsWith(".jsonl")).map(async (entry) => {
|
|
28844
28844
|
const filePath = path.join(sessionsDir, entry.name);
|
|
28845
|
-
const stats = await
|
|
28845
|
+
const stats = await fs$1.promises.stat(filePath).catch(() => null);
|
|
28846
28846
|
if (!stats) return null;
|
|
28847
28847
|
if (stats.mtimeMs < sinceTime) return null;
|
|
28848
28848
|
return filePath;
|
|
@@ -28875,7 +28875,7 @@ async function loadCostUsageSummary(params) {
|
|
|
28875
28875
|
}
|
|
28876
28876
|
async function loadSessionCostSummary(params) {
|
|
28877
28877
|
const sessionFile = params.sessionFile ?? (params.sessionId ? resolveSessionFilePath(params.sessionId, params.sessionEntry, { agentId: params.agentId }) : void 0);
|
|
28878
|
-
if (!sessionFile || !
|
|
28878
|
+
if (!sessionFile || !fs$1.existsSync(sessionFile)) return null;
|
|
28879
28879
|
const totals = emptyTotals();
|
|
28880
28880
|
let firstActivity;
|
|
28881
28881
|
let lastActivity;
|
|
@@ -31399,7 +31399,7 @@ async function createModelSelectionState(params) {
|
|
|
31399
31399
|
}
|
|
31400
31400
|
}
|
|
31401
31401
|
if (sessionEntry && sessionStore && sessionKey && sessionEntry.authProfileOverride) {
|
|
31402
|
-
const { ensureAuthProfileStore } = await import("./model-selection-
|
|
31402
|
+
const { ensureAuthProfileStore } = await import("./model-selection-CHnojCCK.js").then((n) => n.F);
|
|
31403
31403
|
const profile = ensureAuthProfileStore(void 0, { allowKeychainPrompt: false }).profiles[sessionEntry.authProfileOverride];
|
|
31404
31404
|
const providerKey = normalizeProviderId(provider);
|
|
31405
31405
|
if (!profile || normalizeProviderId(profile.provider) !== providerKey) await clearSessionAuthProfileOverride({
|
|
@@ -35060,7 +35060,7 @@ function asBoolean(value) {
|
|
|
35060
35060
|
}
|
|
35061
35061
|
function resolveTempPathParts(opts) {
|
|
35062
35062
|
const tmpDir = opts.tmpDir ?? resolvePreferredSquidClawTmpDir();
|
|
35063
|
-
if (!opts.tmpDir)
|
|
35063
|
+
if (!opts.tmpDir) fs$1.mkdirSync(tmpDir, {
|
|
35064
35064
|
recursive: true,
|
|
35065
35065
|
mode: 448
|
|
35066
35066
|
});
|
|
@@ -35146,7 +35146,7 @@ async function writeUrlToFile(filePath, url, opts) {
|
|
|
35146
35146
|
if (typeof contentLength === "number" && Number.isFinite(contentLength) && contentLength > MAX_CAMERA_URL_DOWNLOAD_BYTES) throw new Error(`writeUrlToFile: content-length ${contentLength} exceeds max ${MAX_CAMERA_URL_DOWNLOAD_BYTES}`);
|
|
35147
35147
|
const body = res.body;
|
|
35148
35148
|
if (!body) throw new Error(`failed to download ${url}: empty response body`);
|
|
35149
|
-
const fileHandle = await fs$
|
|
35149
|
+
const fileHandle = await fs$2.open(filePath, "w");
|
|
35150
35150
|
let thrown;
|
|
35151
35151
|
try {
|
|
35152
35152
|
const reader = body.getReader();
|
|
@@ -35164,7 +35164,7 @@ async function writeUrlToFile(filePath, url, opts) {
|
|
|
35164
35164
|
await fileHandle.close();
|
|
35165
35165
|
}
|
|
35166
35166
|
if (thrown) {
|
|
35167
|
-
await fs$
|
|
35167
|
+
await fs$2.unlink(filePath).catch(() => {});
|
|
35168
35168
|
throw thrown;
|
|
35169
35169
|
}
|
|
35170
35170
|
} finally {
|
|
@@ -35177,7 +35177,7 @@ async function writeUrlToFile(filePath, url, opts) {
|
|
|
35177
35177
|
}
|
|
35178
35178
|
async function writeBase64ToFile(filePath, base64) {
|
|
35179
35179
|
const buf = Buffer.from(base64, "base64");
|
|
35180
|
-
await fs$
|
|
35180
|
+
await fs$2.writeFile(filePath, buf);
|
|
35181
35181
|
return {
|
|
35182
35182
|
path: filePath,
|
|
35183
35183
|
bytes: buf.length
|
|
@@ -38235,9 +38235,9 @@ function loadExternalCatalogEntries(options) {
|
|
|
38235
38235
|
const entries = [];
|
|
38236
38236
|
for (const rawPath of paths) {
|
|
38237
38237
|
const resolved = resolveUserPath(rawPath);
|
|
38238
|
-
if (!
|
|
38238
|
+
if (!fs$1.existsSync(resolved)) continue;
|
|
38239
38239
|
try {
|
|
38240
|
-
const payload = JSON.parse(
|
|
38240
|
+
const payload = JSON.parse(fs$1.readFileSync(resolved, "utf-8"));
|
|
38241
38241
|
entries.push(...parseCatalogEntries(payload));
|
|
38242
38242
|
} catch {}
|
|
38243
38243
|
}
|
|
@@ -42429,7 +42429,7 @@ function listExistingAgentIdsFromDisk() {
|
|
|
42429
42429
|
const root = resolveStateDir();
|
|
42430
42430
|
const agentsDir = path.join(root, "agents");
|
|
42431
42431
|
try {
|
|
42432
|
-
return
|
|
42432
|
+
return fs$1.readdirSync(agentsDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => normalizeAgentId(entry.name)).filter(Boolean);
|
|
42433
42433
|
} catch {
|
|
42434
42434
|
return [];
|
|
42435
42435
|
}
|
|
@@ -48829,7 +48829,7 @@ async function runAgentTurnWithFallback(params) {
|
|
|
48829
48829
|
if (corruptedSessionId) {
|
|
48830
48830
|
const transcriptPath = resolveSessionTranscriptPath(corruptedSessionId);
|
|
48831
48831
|
try {
|
|
48832
|
-
|
|
48832
|
+
fs$1.unlinkSync(transcriptPath);
|
|
48833
48833
|
} catch {}
|
|
48834
48834
|
}
|
|
48835
48835
|
delete params.activeSessionStore[sessionKey];
|
|
@@ -49649,7 +49649,7 @@ async function readSessionLogSnapshot(params) {
|
|
|
49649
49649
|
if (!logPath) return {};
|
|
49650
49650
|
const snapshot = {};
|
|
49651
49651
|
if (params.includeByteSize) try {
|
|
49652
|
-
const stat = await
|
|
49652
|
+
const stat = await fs$1.promises.stat(logPath);
|
|
49653
49653
|
const size = Math.floor(stat.size);
|
|
49654
49654
|
snapshot.byteSize = Number.isFinite(size) && size >= 0 ? size : void 0;
|
|
49655
49655
|
} catch {
|
|
@@ -49663,7 +49663,7 @@ async function readSessionLogSnapshot(params) {
|
|
|
49663
49663
|
return snapshot;
|
|
49664
49664
|
}
|
|
49665
49665
|
async function readLastNonzeroUsageFromSessionLog(logPath) {
|
|
49666
|
-
const handle = await
|
|
49666
|
+
const handle = await fs$1.promises.open(logPath, "r");
|
|
49667
49667
|
try {
|
|
49668
49668
|
let position = (await handle.stat()).size;
|
|
49669
49669
|
let leadingPartial = "";
|
|
@@ -50360,9 +50360,9 @@ async function readPostCompactionContext(workspaceDir, cfg, nowMs) {
|
|
|
50360
50360
|
if (!opened.ok) return null;
|
|
50361
50361
|
const sections = extractSections((() => {
|
|
50362
50362
|
try {
|
|
50363
|
-
return
|
|
50363
|
+
return fs$1.readFileSync(opened.fd, "utf-8");
|
|
50364
50364
|
} finally {
|
|
50365
|
-
|
|
50365
|
+
fs$1.closeSync(opened.fd);
|
|
50366
50366
|
}
|
|
50367
50367
|
})(), ["Session Startup", "Red Lines"]);
|
|
50368
50368
|
if (sections.length === 0) return null;
|
|
@@ -50584,7 +50584,7 @@ async function runReplyAgent(params) {
|
|
|
50584
50584
|
if (resolved) transcriptCandidates.add(resolved);
|
|
50585
50585
|
transcriptCandidates.add(resolveSessionTranscriptPath(prevSessionId, agentId));
|
|
50586
50586
|
for (const candidate of transcriptCandidates) try {
|
|
50587
|
-
|
|
50587
|
+
fs$1.unlinkSync(candidate);
|
|
50588
50588
|
} catch {}
|
|
50589
50589
|
}
|
|
50590
50590
|
return true;
|
|
@@ -51535,7 +51535,7 @@ const warnedContexts = /* @__PURE__ */ new Map();
|
|
|
51535
51535
|
const log$10 = createSubsystemLogger("session-maintenance-warning");
|
|
51536
51536
|
let deliverRuntimePromise = null;
|
|
51537
51537
|
function loadDeliverRuntime() {
|
|
51538
|
-
deliverRuntimePromise ??= import("./deliver-runtime-
|
|
51538
|
+
deliverRuntimePromise ??= import("./deliver-runtime-B6NtHUuv.js");
|
|
51539
51539
|
return deliverRuntimePromise;
|
|
51540
51540
|
}
|
|
51541
51541
|
function shouldSendWarning() {
|
|
@@ -51702,7 +51702,7 @@ function forkSessionFromParent(params) {
|
|
|
51702
51702
|
agentId: params.agentId,
|
|
51703
51703
|
sessionsDir: params.sessionsDir
|
|
51704
51704
|
});
|
|
51705
|
-
if (!parentSessionFile || !
|
|
51705
|
+
if (!parentSessionFile || !fs$1.existsSync(parentSessionFile)) return null;
|
|
51706
51706
|
try {
|
|
51707
51707
|
const manager = SessionManager.open(parentSessionFile);
|
|
51708
51708
|
const leafId = manager.getLeafId();
|
|
@@ -51726,7 +51726,7 @@ function forkSessionFromParent(params) {
|
|
|
51726
51726
|
cwd: manager.getCwd(),
|
|
51727
51727
|
parentSession: parentSessionFile
|
|
51728
51728
|
};
|
|
51729
|
-
|
|
51729
|
+
fs$1.writeFileSync(sessionFile, `${JSON.stringify(header)}\n`, "utf-8");
|
|
51730
51730
|
return {
|
|
51731
51731
|
sessionId,
|
|
51732
51732
|
sessionFile
|
|
@@ -56512,7 +56512,7 @@ const VISION_PROVIDERS = [
|
|
|
56512
56512
|
];
|
|
56513
56513
|
let imageRuntimePromise = null;
|
|
56514
56514
|
function loadImageRuntime() {
|
|
56515
|
-
imageRuntimePromise ??= import("./image-runtime-
|
|
56515
|
+
imageRuntimePromise ??= import("./image-runtime-BSVF52oe.js");
|
|
56516
56516
|
return imageRuntimePromise;
|
|
56517
56517
|
}
|
|
56518
56518
|
/**
|
|
@@ -58573,7 +58573,7 @@ async function resolveDiscordPreflightAudioMentionContext(params) {
|
|
|
58573
58573
|
hasTypedText
|
|
58574
58574
|
};
|
|
58575
58575
|
try {
|
|
58576
|
-
const { transcribeFirstAudio } = await import("./audio-preflight-
|
|
58576
|
+
const { transcribeFirstAudio } = await import("./audio-preflight-1KULThhV.js");
|
|
58577
58577
|
if (params.abortSignal?.aborted) return {
|
|
58578
58578
|
hasAudioAttachment,
|
|
58579
58579
|
hasTypedText
|
|
@@ -60152,7 +60152,7 @@ function identityHasValues(identity) {
|
|
|
60152
60152
|
}
|
|
60153
60153
|
function loadIdentityFromFile(identityPath) {
|
|
60154
60154
|
try {
|
|
60155
|
-
const parsed = parseIdentityMarkdown(
|
|
60155
|
+
const parsed = parseIdentityMarkdown(fs$1.readFileSync(identityPath, "utf-8"));
|
|
60156
60156
|
if (!identityHasValues(parsed)) return null;
|
|
60157
60157
|
return parsed;
|
|
60158
60158
|
} catch {
|
|
@@ -60176,7 +60176,7 @@ function resolveAvatarSource(cfg, agentId) {
|
|
|
60176
60176
|
}
|
|
60177
60177
|
function resolveExistingPath(value) {
|
|
60178
60178
|
try {
|
|
60179
|
-
return
|
|
60179
|
+
return fs$1.realpathSync(value);
|
|
60180
60180
|
} catch {
|
|
60181
60181
|
return path.resolve(value);
|
|
60182
60182
|
}
|
|
@@ -60194,7 +60194,7 @@ function resolveLocalAvatarPath(params) {
|
|
|
60194
60194
|
reason: "unsupported_extension"
|
|
60195
60195
|
};
|
|
60196
60196
|
try {
|
|
60197
|
-
const stat =
|
|
60197
|
+
const stat = fs$1.statSync(realPath);
|
|
60198
60198
|
if (!stat.isFile()) return {
|
|
60199
60199
|
ok: false,
|
|
60200
60200
|
reason: "missing"
|
|
@@ -65967,27 +65967,27 @@ let slackSenderRuntimePromise = null;
|
|
|
65967
65967
|
let signalSenderRuntimePromise = null;
|
|
65968
65968
|
let imessageSenderRuntimePromise = null;
|
|
65969
65969
|
function loadWhatsAppSenderRuntime() {
|
|
65970
|
-
whatsappSenderRuntimePromise ??= import("./deps-send-whatsapp.runtime-
|
|
65970
|
+
whatsappSenderRuntimePromise ??= import("./deps-send-whatsapp.runtime-C2x2R2Ow.js");
|
|
65971
65971
|
return whatsappSenderRuntimePromise;
|
|
65972
65972
|
}
|
|
65973
65973
|
function loadTelegramSenderRuntime() {
|
|
65974
|
-
telegramSenderRuntimePromise ??= import("./deps-send-telegram.runtime-
|
|
65974
|
+
telegramSenderRuntimePromise ??= import("./deps-send-telegram.runtime-DHlcnjQO.js");
|
|
65975
65975
|
return telegramSenderRuntimePromise;
|
|
65976
65976
|
}
|
|
65977
65977
|
function loadDiscordSenderRuntime() {
|
|
65978
|
-
discordSenderRuntimePromise ??= import("./deps-send-discord.runtime-
|
|
65978
|
+
discordSenderRuntimePromise ??= import("./deps-send-discord.runtime-CUTAK2hy.js");
|
|
65979
65979
|
return discordSenderRuntimePromise;
|
|
65980
65980
|
}
|
|
65981
65981
|
function loadSlackSenderRuntime() {
|
|
65982
|
-
slackSenderRuntimePromise ??= import("./deps-send-slack.runtime-
|
|
65982
|
+
slackSenderRuntimePromise ??= import("./deps-send-slack.runtime-HEEwW4uU.js");
|
|
65983
65983
|
return slackSenderRuntimePromise;
|
|
65984
65984
|
}
|
|
65985
65985
|
function loadSignalSenderRuntime() {
|
|
65986
|
-
signalSenderRuntimePromise ??= import("./deps-send-signal.runtime-
|
|
65986
|
+
signalSenderRuntimePromise ??= import("./deps-send-signal.runtime-wN7MkzLw.js");
|
|
65987
65987
|
return signalSenderRuntimePromise;
|
|
65988
65988
|
}
|
|
65989
65989
|
function loadIMessageSenderRuntime() {
|
|
65990
|
-
imessageSenderRuntimePromise ??= import("./deps-send-imessage.runtime-
|
|
65990
|
+
imessageSenderRuntimePromise ??= import("./deps-send-imessage.runtime-CQOiEIuA.js");
|
|
65991
65991
|
return imessageSenderRuntimePromise;
|
|
65992
65992
|
}
|
|
65993
65993
|
function createDefaultDeps() {
|
|
@@ -72171,7 +72171,7 @@ async function monitorIMessageProvider(opts = {}) {
|
|
|
72171
72171
|
function readFileIfExists(filePath) {
|
|
72172
72172
|
if (!filePath) return;
|
|
72173
72173
|
try {
|
|
72174
|
-
return
|
|
72174
|
+
return fs$1.readFileSync(filePath, "utf-8").trim();
|
|
72175
72175
|
} catch {
|
|
72176
72176
|
return;
|
|
72177
72177
|
}
|
|
@@ -72801,7 +72801,7 @@ async function downloadLineMedia(messageId, channelAccessToken, maxBytes = 10 *
|
|
|
72801
72801
|
prefix: "line-media",
|
|
72802
72802
|
extension: getExtensionForContentType(contentType)
|
|
72803
72803
|
});
|
|
72804
|
-
await
|
|
72804
|
+
await fs$1.promises.writeFile(filePath, buffer);
|
|
72805
72805
|
logVerbose(`line: downloaded media ${messageId} to ${filePath} (${buffer.length} bytes)`);
|
|
72806
72806
|
return {
|
|
72807
72807
|
path: filePath,
|
|
@@ -78824,15 +78824,15 @@ let slashCommandsRuntimePromise = null;
|
|
|
78824
78824
|
let slashDispatchRuntimePromise = null;
|
|
78825
78825
|
let slashSkillCommandsRuntimePromise = null;
|
|
78826
78826
|
function loadSlashCommandsRuntime() {
|
|
78827
|
-
slashCommandsRuntimePromise ??= import("./slash-commands.runtime-
|
|
78827
|
+
slashCommandsRuntimePromise ??= import("./slash-commands.runtime-CjBXruwG.js");
|
|
78828
78828
|
return slashCommandsRuntimePromise;
|
|
78829
78829
|
}
|
|
78830
78830
|
function loadSlashDispatchRuntime() {
|
|
78831
|
-
slashDispatchRuntimePromise ??= import("./slash-dispatch.runtime-
|
|
78831
|
+
slashDispatchRuntimePromise ??= import("./slash-dispatch.runtime-CGd3HarH.js");
|
|
78832
78832
|
return slashDispatchRuntimePromise;
|
|
78833
78833
|
}
|
|
78834
78834
|
function loadSlashSkillCommandsRuntime() {
|
|
78835
|
-
slashSkillCommandsRuntimePromise ??= import("./slash-skill-commands.runtime-
|
|
78835
|
+
slashSkillCommandsRuntimePromise ??= import("./slash-skill-commands.runtime-DYK20Lxf.js");
|
|
78836
78836
|
return slashSkillCommandsRuntimePromise;
|
|
78837
78837
|
}
|
|
78838
78838
|
const slackExternalArgMenuStore = createSlackExternalArgMenuStore();
|
|
@@ -79822,7 +79822,7 @@ function collectTelegramUnmentionedGroupIds(groups) {
|
|
|
79822
79822
|
}
|
|
79823
79823
|
let auditMembershipRuntimePromise = null;
|
|
79824
79824
|
function loadAuditMembershipRuntime() {
|
|
79825
|
-
auditMembershipRuntimePromise ??= import("./audit-membership-runtime-
|
|
79825
|
+
auditMembershipRuntimePromise ??= import("./audit-membership-runtime-w23FnNAN.js");
|
|
79826
79826
|
return auditMembershipRuntimePromise;
|
|
79827
79827
|
}
|
|
79828
79828
|
async function auditTelegramGroupMembership(params) {
|
|
@@ -82197,7 +82197,7 @@ const buildTelegramMessageContext = async ({ primaryCtx, allMedia, replyMedia =
|
|
|
82197
82197
|
const disableAudioPreflight = firstDefined$1(topicConfig?.disableAudioPreflight, groupConfig?.disableAudioPreflight) === true;
|
|
82198
82198
|
let preflightTranscript;
|
|
82199
82199
|
if (isGroup && requireMention && hasAudio && !hasUserText && mentionRegexes.length > 0 && !disableAudioPreflight) try {
|
|
82200
|
-
const { transcribeFirstAudio } = await import("./audio-preflight-
|
|
82200
|
+
const { transcribeFirstAudio } = await import("./audio-preflight-1KULThhV.js");
|
|
82201
82201
|
preflightTranscript = await transcribeFirstAudio({
|
|
82202
82202
|
ctx: {
|
|
82203
82203
|
MediaPaths: allMedia.length > 0 ? allMedia.map((m) => m.path) : void 0,
|
|
@@ -85036,7 +85036,7 @@ function createWhatsAppLoginTool() {
|
|
|
85036
85036
|
force: Type.Optional(Type.Boolean())
|
|
85037
85037
|
}),
|
|
85038
85038
|
execute: async (_toolCallId, args) => {
|
|
85039
|
-
const { startWebLoginWithQr, waitForWebLogin } = await import("./login-qr-
|
|
85039
|
+
const { startWebLoginWithQr, waitForWebLogin } = await import("./login-qr-C0fDBnpM.js");
|
|
85040
85040
|
if ((args?.action ?? "start") === "wait") {
|
|
85041
85041
|
const result = await waitForWebLogin({ timeoutMs: typeof args.timeoutMs === "number" ? args.timeoutMs : void 0 });
|
|
85042
85042
|
return {
|
|
@@ -85111,23 +85111,23 @@ let webOutboundPromise = null;
|
|
|
85111
85111
|
let webLoginPromise = null;
|
|
85112
85112
|
let whatsappActionsPromise = null;
|
|
85113
85113
|
function loadWebOutbound() {
|
|
85114
|
-
webOutboundPromise ??= import("./runtime-whatsapp-outbound.runtime-
|
|
85114
|
+
webOutboundPromise ??= import("./runtime-whatsapp-outbound.runtime-Cgu2MfqR.js");
|
|
85115
85115
|
return webOutboundPromise;
|
|
85116
85116
|
}
|
|
85117
85117
|
function loadWebLogin() {
|
|
85118
|
-
webLoginPromise ??= import("./runtime-whatsapp-login.runtime-
|
|
85118
|
+
webLoginPromise ??= import("./runtime-whatsapp-login.runtime-DumUjKRz.js");
|
|
85119
85119
|
return webLoginPromise;
|
|
85120
85120
|
}
|
|
85121
85121
|
function loadWebLoginQr() {
|
|
85122
|
-
webLoginQrPromise ??= import("./login-qr-
|
|
85122
|
+
webLoginQrPromise ??= import("./login-qr-C0fDBnpM.js");
|
|
85123
85123
|
return webLoginQrPromise;
|
|
85124
85124
|
}
|
|
85125
85125
|
function loadWebChannel() {
|
|
85126
|
-
webChannelPromise ??= import("./web-
|
|
85126
|
+
webChannelPromise ??= import("./web-CEdWU_u3.js");
|
|
85127
85127
|
return webChannelPromise;
|
|
85128
85128
|
}
|
|
85129
85129
|
function loadWhatsAppActions() {
|
|
85130
|
-
whatsappActionsPromise ??= import("./whatsapp-actions-
|
|
85130
|
+
whatsappActionsPromise ??= import("./whatsapp-actions-Cuy0qeQK.js");
|
|
85131
85131
|
return whatsappActionsPromise;
|
|
85132
85132
|
}
|
|
85133
85133
|
function createRuntimeWhatsApp() {
|
|
@@ -85568,7 +85568,7 @@ const log$6 = createSubsystemLogger("memory");
|
|
|
85568
85568
|
const QMD_MANAGER_CACHE = /* @__PURE__ */ new Map();
|
|
85569
85569
|
let managerRuntimePromise = null;
|
|
85570
85570
|
function loadManagerRuntime() {
|
|
85571
|
-
managerRuntimePromise ??= import("./manager-runtime-
|
|
85571
|
+
managerRuntimePromise ??= import("./manager-runtime-BB9lcoFR.js");
|
|
85572
85572
|
return managerRuntimePromise;
|
|
85573
85573
|
}
|
|
85574
85574
|
async function getMemorySearchManager(params) {
|
|
@@ -85582,7 +85582,7 @@ async function getMemorySearchManager(params) {
|
|
|
85582
85582
|
if (cached) return { manager: cached };
|
|
85583
85583
|
}
|
|
85584
85584
|
try {
|
|
85585
|
-
const { QmdMemoryManager } = await import("./qmd-manager-
|
|
85585
|
+
const { QmdMemoryManager } = await import("./qmd-manager-CO-shcLU.js");
|
|
85586
85586
|
const primary = await QmdMemoryManager.create({
|
|
85587
85587
|
cfg: params.cfg,
|
|
85588
85588
|
agentId: params.agentId,
|
|
@@ -86156,7 +86156,7 @@ async function withMemoryManagerForAgent(params) {
|
|
|
86156
86156
|
}
|
|
86157
86157
|
async function checkReadableFile(pathname) {
|
|
86158
86158
|
try {
|
|
86159
|
-
await fs.access(pathname,
|
|
86159
|
+
await fs.access(pathname, fs$1.constants.R_OK);
|
|
86160
86160
|
return { exists: true };
|
|
86161
86161
|
} catch (err) {
|
|
86162
86162
|
const code = err.code;
|
|
@@ -86215,7 +86215,7 @@ async function scanMemoryFiles(workspaceDir, extraPaths = []) {
|
|
|
86215
86215
|
}
|
|
86216
86216
|
let dirReadable = null;
|
|
86217
86217
|
try {
|
|
86218
|
-
await fs.access(memoryDir,
|
|
86218
|
+
await fs.access(memoryDir, fs$1.constants.R_OK);
|
|
86219
86219
|
dirReadable = true;
|
|
86220
86220
|
} catch (err) {
|
|
86221
86221
|
const code = err.code;
|
|
@@ -86664,7 +86664,7 @@ const resolvePluginSdkAliasFile = (params) => {
|
|
|
86664
86664
|
const srcCandidate = path.join(cursor, "src", "plugin-sdk", params.srcFile);
|
|
86665
86665
|
const distCandidate = path.join(cursor, "dist", "plugin-sdk", params.distFile);
|
|
86666
86666
|
const orderedCandidates = isDistRuntime ? [distCandidate, srcCandidate] : isTest ? [distCandidate, srcCandidate] : [distCandidate];
|
|
86667
|
-
for (const candidate of orderedCandidates) if (
|
|
86667
|
+
for (const candidate of orderedCandidates) if (fs$1.existsSync(candidate)) return candidate;
|
|
86668
86668
|
const parent = path.dirname(cursor);
|
|
86669
86669
|
if (parent === cursor) break;
|
|
86670
86670
|
cursor = parent;
|
|
@@ -87270,7 +87270,7 @@ function loadSquidClawPlugins(options = {}) {
|
|
|
87270
87270
|
continue;
|
|
87271
87271
|
}
|
|
87272
87272
|
const safeSource = opened.path;
|
|
87273
|
-
|
|
87273
|
+
fs$1.closeSync(opened.fd);
|
|
87274
87274
|
let mod = null;
|
|
87275
87275
|
try {
|
|
87276
87276
|
mod = getJiti()(safeSource);
|
|
@@ -87388,7 +87388,7 @@ function loadSquidClawPlugins(options = {}) {
|
|
|
87388
87388
|
}
|
|
87389
87389
|
function safeRealpathOrResolve(value) {
|
|
87390
87390
|
try {
|
|
87391
|
-
return
|
|
87391
|
+
return fs$1.realpathSync(value);
|
|
87392
87392
|
} catch {
|
|
87393
87393
|
return path.resolve(value);
|
|
87394
87394
|
}
|
|
@@ -87827,9 +87827,9 @@ function resolvePatchFileOps(options) {
|
|
|
87827
87827
|
});
|
|
87828
87828
|
assertBoundaryRead(opened, filePath);
|
|
87829
87829
|
try {
|
|
87830
|
-
return
|
|
87830
|
+
return fs$1.readFileSync(opened.fd, "utf8");
|
|
87831
87831
|
} finally {
|
|
87832
|
-
|
|
87832
|
+
fs$1.closeSync(opened.fd);
|
|
87833
87833
|
}
|
|
87834
87834
|
},
|
|
87835
87835
|
writeFile: async (filePath, content) => {
|
|
@@ -88108,7 +88108,7 @@ const LOOP_WARNING_BUCKET_SIZE = 10;
|
|
|
88108
88108
|
const MAX_LOOP_WARNING_KEYS = 256;
|
|
88109
88109
|
let beforeToolCallRuntimePromise = null;
|
|
88110
88110
|
function loadBeforeToolCallRuntime() {
|
|
88111
|
-
beforeToolCallRuntimePromise ??= import("./pi-tools.before-tool-call.runtime-
|
|
88111
|
+
beforeToolCallRuntimePromise ??= import("./pi-tools.before-tool-call.runtime-B_LUttg1.js");
|
|
88112
88112
|
return beforeToolCallRuntimePromise;
|
|
88113
88113
|
}
|
|
88114
88114
|
function buildAdjustedParamsKey(params) {
|
|
@@ -90790,9 +90790,9 @@ async function readWorkspaceContextForSummary() {
|
|
|
90790
90790
|
if (!opened.ok) return "";
|
|
90791
90791
|
const sections = extractSections((() => {
|
|
90792
90792
|
try {
|
|
90793
|
-
return
|
|
90793
|
+
return fs$1.readFileSync(opened.fd, "utf-8");
|
|
90794
90794
|
} finally {
|
|
90795
|
-
|
|
90795
|
+
fs$1.closeSync(opened.fd);
|
|
90796
90796
|
}
|
|
90797
90797
|
})(), ["Session Startup", "Red Lines"]);
|
|
90798
90798
|
if (sections.length === 0) return "";
|
|
@@ -92161,7 +92161,7 @@ async function compactEmbeddedPiSessionDirect(params) {
|
|
|
92161
92161
|
if (!apiKeyInfo.apiKey) {
|
|
92162
92162
|
if (apiKeyInfo.mode !== "aws-sdk") throw new Error(`No API key resolved for provider "${model.provider}" (auth mode: ${apiKeyInfo.mode}).`);
|
|
92163
92163
|
} else if (model.provider === "github-copilot") {
|
|
92164
|
-
const { resolveCopilotApiToken } = await import("./github-copilot-token-
|
|
92164
|
+
const { resolveCopilotApiToken } = await import("./github-copilot-token-Cw3tAXM9.js").then((n) => n.n);
|
|
92165
92165
|
const copilotToken = await resolveCopilotApiToken({ githubToken: apiKeyInfo.apiKey });
|
|
92166
92166
|
authStorage.setRuntimeApiKey(model.provider, copilotToken.token);
|
|
92167
92167
|
} else authStorage.setRuntimeApiKey(model.provider, apiKeyInfo.apiKey);
|
|
@@ -94389,11 +94389,11 @@ function appendRawStream(payload) {
|
|
|
94389
94389
|
if (!rawStreamReady) {
|
|
94390
94390
|
rawStreamReady = true;
|
|
94391
94391
|
try {
|
|
94392
|
-
|
|
94392
|
+
fs$1.mkdirSync(path.dirname(RAW_STREAM_PATH), { recursive: true });
|
|
94393
94393
|
} catch {}
|
|
94394
94394
|
}
|
|
94395
94395
|
try {
|
|
94396
|
-
|
|
94396
|
+
fs$1.promises.appendFile(RAW_STREAM_PATH, `${JSON.stringify(payload)}\n`);
|
|
94397
94397
|
} catch {}
|
|
94398
94398
|
}
|
|
94399
94399
|
|
|
@@ -97898,7 +97898,7 @@ async function runEmbeddedPiAgent(params) {
|
|
|
97898
97898
|
await copilotTokenState.refreshInFlight;
|
|
97899
97899
|
return;
|
|
97900
97900
|
}
|
|
97901
|
-
const { resolveCopilotApiToken } = await import("./github-copilot-token-
|
|
97901
|
+
const { resolveCopilotApiToken } = await import("./github-copilot-token-Cw3tAXM9.js").then((n) => n.n);
|
|
97902
97902
|
copilotTokenState.refreshInFlight = (async () => {
|
|
97903
97903
|
const githubToken = copilotTokenState.githubToken.trim();
|
|
97904
97904
|
if (!githubToken) throw new Error("Copilot refresh requires a GitHub token.");
|
|
@@ -97990,7 +97990,7 @@ async function runEmbeddedPiAgent(params) {
|
|
|
97990
97990
|
return;
|
|
97991
97991
|
}
|
|
97992
97992
|
if (model.provider === "github-copilot") {
|
|
97993
|
-
const { resolveCopilotApiToken } = await import("./github-copilot-token-
|
|
97993
|
+
const { resolveCopilotApiToken } = await import("./github-copilot-token-Cw3tAXM9.js").then((n) => n.n);
|
|
97994
97994
|
const copilotToken = await resolveCopilotApiToken({ githubToken: apiKeyInfo.apiKey });
|
|
97995
97995
|
authStorage.setRuntimeApiKey(model.provider, copilotToken.token);
|
|
97996
97996
|
if (copilotTokenState) {
|