wednesdayai 0.5.0 → 0.5.1-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-scope-DaYoimRo.js → agent-scope-VTjBKG-0.js} +3 -3
- package/dist/{agent-turn-runner-B9ZpICYG.js → agent-turn-runner-CZilDjoa.js} +4 -4
- package/dist/{agent-turn-runner-D17nO0vK.js → agent-turn-runner-DGW1XTSZ.js} +6 -6
- package/dist/{api-key-rotation-CFBqEjJo.js → api-key-rotation-C7Uer3wX.js} +2 -2
- package/dist/{audio-preflight-IAvClu-y.js → audio-preflight-5kfGz36M.js} +29 -29
- package/dist/{audio-preflight-0IORdIpv.js → audio-preflight-CyoX7lif.js} +5 -5
- package/dist/{audio-transcription-runner-XF9vtq2K.js → audio-transcription-runner-6owLZL6w.js} +1 -1
- package/dist/{audio-transcription-runner-DO37G4ea.js → audio-transcription-runner-CBRRwnRT.js} +26 -26
- package/dist/build-info.json +4 -4
- package/dist/bundled/boot-md/handler.js +60 -60
- package/dist/bundled/bootstrap-extra-files/handler.js +6 -6
- package/dist/bundled/command-logger/handler.js +2 -2
- package/dist/bundled/session-journal/handler.js +60 -60
- package/dist/bundled/session-memory/handler.js +60 -60
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{channel-activity-osbmoIZV.js → channel-activity-CgARXGuN.js} +3 -3
- package/dist/{chat-content-D9t717tu.js → chat-content-CjKyPXfO.js} +34 -34
- package/dist/{chat-content-CF94bdqd.js → chat-content-Dp_TK_pI.js} +3 -3
- package/dist/{chrome-Bz--jRWP.js → chrome-C9hAxf3E.js} +5 -5
- package/dist/{chrome-Cb_eHwXe.js → chrome-DKYaSdXE.js} +23 -23
- package/dist/{chunk-BGAIfwvG.js → chunk-CmQRdRrT.js} +3 -3
- package/dist/{command-queue-Blj57uZh.js → command-queue-DiOM6aJb.js} +1 -1
- package/dist/{command-queue-CHDYFklA.js → command-queue-arMRWvX5.js} +1 -1
- package/dist/{commands-registry-CHyanyMK.js → commands-registry-Bpqy7T_m.js} +2 -2
- package/dist/{deliver-ItqNbpAj.js → deliver-DGxrgy4y.js} +1 -1
- package/dist/{deliver-B1z53DPr.js → deliver-hdhBsluU.js} +29 -29
- package/dist/{diagnostic-DHSjiKQ1.js → diagnostic-DWnW43D8.js} +5 -5
- package/dist/{diagnostic-BsxoGiFO.js → diagnostic-f8CKHXWb.js} +1 -1
- package/dist/{errors-CCOle-CH.js → errors-h4QgDEJU.js} +1 -1
- package/dist/extensionAPI.js +12 -12
- package/dist/{fetch-CJta9EH3.js → fetch-BkWHUyJz.js} +8 -8
- package/dist/{fetch-guard-CnaMeBGo.js → fetch-guard-BUJnD_0T.js} +3 -3
- package/dist/{frontmatter-DlRD-Jnx.js → frontmatter-IfoWyoLV.js} +3 -3
- package/dist/{fs-safe-DpdLT3fB.js → fs-safe-joAzTKB9.js} +26 -26
- package/dist/{image-ops-YU6OONEl.js → image-ops-d6AhYSNh.js} +1 -1
- package/dist/{ir-BdHn6F6Y.js → ir-B0cUtyev.js} +5 -5
- package/dist/{legacy-names-me5dD9PP.js → legacy-names-Dh4RlQMQ.js} +1 -1
- package/dist/llm-slug-generator.js +60 -60
- package/dist/{logger-BrQxLcMY.js → logger-vVASmiVr.js} +1 -1
- package/dist/{manager-xwMosvyt.js → manager-SEkHJEk4.js} +18 -18
- package/dist/{markdown-tables-BVgH365V.js → markdown-tables-pw9wiTpN.js} +2 -2
- package/dist/{model-selection-CYypdqr8.js → model-selection-BTxcwzNF.js} +83 -83
- package/dist/{models-config-D7vsT5RL.js → models-config-CrYtS7l_.js} +2 -2
- package/dist/{outbound-attachment-C_QOYkXN.js → outbound-attachment-ecpn937X.js} +2 -2
- package/dist/{outbound-message-hooks-BYTh0d2Q.js → outbound-message-hooks-BA0MXlRL.js} +5 -5
- package/dist/{path-alias-guards-BdGLz9X0.js → path-alias-guards-BzCkdlOk.js} +1 -1
- package/dist/{pi-embedded-BtqsPDuE.js → pi-embedded-C3a3mJgO.js} +272 -272
- package/dist/{pi-embedded-D6nR71l7.js → pi-embedded-cc9FvjV6.js} +28 -28
- package/dist/{pi-embedded-utils-C-iiawNt.js → pi-embedded-utils-Bu-pLHgt.js} +3 -3
- package/dist/{pi-embedded-utils-Bb82klSc.js → pi-embedded-utils-DKfjTsdf.js} +1 -1
- package/dist/{pi-model-discovery-fTAJjO1L.js → pi-model-discovery-BHTeo1nC.js} +7 -7
- package/dist/plugin-sdk/{agent-turn-execute-R1HDfkzv.js → agent-turn-execute-5UY7VtoM.js} +12 -12
- package/dist/plugin-sdk/{agent-turn-runner-BJKm0xiy.js → agent-turn-runner-Cn8kBLTA.js} +4 -4
- package/dist/plugin-sdk/{audio-preflight-BB1yTgKL.js → audio-preflight-DmcETAqz.js} +5 -5
- package/dist/plugin-sdk/{audio-transcription-runner-reKaz0zD.js → audio-transcription-runner-CmY7S8fK.js} +1 -1
- package/dist/plugin-sdk/{chrome-WLpY6l2E.js → chrome-6h5M_drY.js} +8 -8
- package/dist/plugin-sdk/{command-queue-CAp1zb7F.js → command-queue-DIuk1L2E.js} +1 -1
- package/dist/plugin-sdk/{deliver-DlvbM-qn.js → deliver-C9GFYFwr.js} +1 -1
- package/dist/plugin-sdk/{deliver-BmT0wV-k.js → deliver-DPfI8dVE.js} +3 -3
- package/dist/plugin-sdk/{diagnostic-RXIEvDQf.js → diagnostic-DRY8-0JL.js} +1 -1
- package/dist/plugin-sdk/{pi-embedded-helpers-21OqohWy.js → pi-embedded-helpers-D5vYvfne.js} +3 -3
- package/dist/plugin-sdk/{pi-embedded-utils-BW2p1kKO.js → pi-embedded-utils-CGDgVtzV.js} +1 -1
- package/dist/plugin-sdk/{provider-dispatcher-rwnQ0CEc.js → provider-dispatcher-DryAXJsi.js} +12 -12
- package/dist/plugin-sdk/{provider-image-3obRwbTZ.js → provider-image-CVcMld07.js} +4 -4
- package/dist/plugin-sdk/{provider-image-B68yYRAm.js → provider-image-Df0uD0Oe.js} +1 -1
- package/dist/plugin-sdk/{pw-ai-CSRaN1ac.js → pw-ai-DMALp-EA.js} +1 -1
- package/dist/plugin-sdk/{runs-5hM5yurH.js → runs-BASRXkuM.js} +3 -3
- package/dist/plugin-sdk/{runs-DvLuGamE.js → runs-yMaO6qGS.js} +5 -5
- package/dist/plugin-sdk/{send-Zxl5JOn5.js → send-BqbtJqgu.js} +1 -1
- package/dist/plugin-sdk/{send-CzwcnXPR.js → send-CmZ4gvBw.js} +2 -2
- package/dist/plugin-sdk/{subagent-registry-Y727Of1U.js → subagent-registry-GgT4DYT1.js} +12 -12
- package/dist/plugin-sdk/testing.js +12 -12
- package/dist/plugin-sdk/{tools-joKDe6rw.js → tools-Bigk4qN-.js} +32 -32
- package/dist/{provider-image-Do7qMZhI.js → provider-image-BZgdxPq1.js} +1 -1
- package/dist/{provider-image-DEcMOAkN.js → provider-image-BoLaTMGA.js} +6 -6
- package/dist/{proxy-DaAwoyLn.js → proxy-CPi-EHQf.js} +1 -1
- package/dist/{proxy-env-DbK61KfJ.js → proxy-env-D-BYfN9f.js} +1 -1
- package/dist/{proxy-fetch-DfICXirF.js → proxy-fetch-SAeVJOzX.js} +1 -1
- package/dist/{pw-ai-BPTONp50.js → pw-ai-BX6tMIuu.js} +14 -14
- package/dist/{pw-ai-vX880pfn.js → pw-ai-ZhKSFpfJ.js} +1 -1
- package/dist/{qmd-manager-BwE9yS9R.js → qmd-manager-D8ak7kq1.js} +12 -12
- package/dist/{query-expansion-D98bVcfg.js → query-expansion-Cfj6kuQN.js} +13 -13
- package/dist/{recorder-DsunFllM.js → recorder-9g0HAfTV.js} +2 -2
- package/dist/{redact-CO0RqVMz.js → redact-CteA3IBL.js} +1 -1
- package/dist/{replies-pB9HCyld.js → replies-BbIj7g9M.js} +5 -5
- package/dist/{reply-directives-mulrKdb0.js → reply-directives-DBlsFghT.js} +2 -2
- package/dist/{reply-prefix-JmOFNTVH.js → reply-prefix-B4-hQLj2.js} +1 -1
- package/dist/{resolve-route-5h1UlQhK.js → resolve-route-BVQQmyE-.js} +5 -5
- package/dist/{runs-DEhpITiC.js → runs-Dar4NRlC.js} +3 -3
- package/dist/{runs-CYEm5TJX.js → runs-n_IyEnjI.js} +9 -9
- package/dist/{send-Bcmcrt2M.js → send-BaBji8OV.js} +6 -6
- package/dist/{send-CaxLshmb.js → send-Blzch_-J.js} +6 -6
- package/dist/{send-i_w4A0N2.js → send-D3AqPouq.js} +7 -7
- package/dist/{send-LdGFidPd.js → send-D4CyRJfb.js} +8 -8
- package/dist/{send-mGol3d2c.js → send-Owye3CdT.js} +27 -27
- package/dist/{send-C4CkAZXl.js → send-tEYUiTsj.js} +1 -1
- package/dist/{session-meta-CmQ6a7H5.js → session-meta-n_Hhzi0B.js} +1 -1
- package/dist/{sessions-ZdGPevHF.js → sessions-C8YjZYd5.js} +5 -5
- package/dist/{skill-commands-XRDXSro6.js → skill-commands-DyocWgx1.js} +8 -8
- package/dist/{skills-CXVcffYI.js → skills-BNWKnQc8.js} +21 -21
- package/dist/{store-CYs-lya8.js → store-BkbDrlDX.js} +7 -7
- package/dist/{subsystem-Bv4j-uIg.js → subsystem-D_zHSy02.js} +67 -67
- package/dist/{tables-BbGV4Ys1.js → tables-B_gp2rXG.js} +1 -1
- package/dist/{tokens-BdntrBR4.js → tokens-B3OPeQh5.js} +1 -1
- package/dist/{tool-loop-detection-CdZfb_CR.js → tool-loop-detection-ST5jhih3.js} +2 -2
- package/dist/{user-run-recording-Dr98Mjnd.js → user-run-recording-CMwTVvoc.js} +2 -2
- package/dist/{workspace-yHh5Lf7Z.js → workspace-CkXKTYV4.js} +27 -27
- package/extensions/acpx/package.json +1 -1
- package/extensions/anthropic/package.json +1 -1
- package/extensions/bifrost/package.json +1 -1
- package/extensions/bluebubbles/package.json +1 -1
- package/extensions/copilot-proxy/package.json +1 -1
- package/extensions/deepgram/package.json +1 -1
- package/extensions/deepinfra/package.json +1 -1
- package/extensions/diagnostics-otel/package.json +1 -1
- package/extensions/diffs/package.json +1 -1
- package/extensions/discord/package.json +1 -1
- package/extensions/dream-cycle/package.json +1 -1
- package/extensions/elevenlabs/package.json +1 -1
- package/extensions/feishu/package.json +1 -1
- package/extensions/gemini-search/package.json +1 -1
- package/extensions/google/package.json +1 -1
- package/extensions/google-gemini-cli-auth/package.json +1 -1
- package/extensions/googlechat/package.json +1 -1
- package/extensions/grok-search/package.json +1 -1
- package/extensions/groq/package.json +1 -1
- package/extensions/imessage/package.json +1 -1
- package/extensions/irc/package.json +1 -1
- package/extensions/kimi-search/package.json +1 -1
- package/extensions/learning-core/package.json +1 -1
- package/extensions/line/package.json +1 -1
- package/extensions/llm-task/package.json +1 -1
- package/extensions/lobster/package.json +1 -1
- package/extensions/matrix/CHANGELOG.md +6 -0
- package/extensions/matrix/package.json +1 -1
- package/extensions/mattermost/package.json +1 -1
- package/extensions/memory-core/package.json +1 -1
- package/extensions/memory-lancedb/package.json +1 -1
- package/extensions/minimax/package.json +1 -1
- package/extensions/minimax-portal-auth/package.json +1 -1
- package/extensions/mistral/package.json +1 -1
- package/extensions/moonshot/package.json +1 -1
- package/extensions/msteams/CHANGELOG.md +6 -0
- package/extensions/msteams/package.json +1 -1
- package/extensions/nextcloud-talk/package.json +1 -1
- package/extensions/nostr/CHANGELOG.md +6 -0
- package/extensions/nostr/package.json +1 -1
- package/extensions/open-prose/package.json +1 -1
- package/extensions/openai/package.json +1 -1
- package/extensions/openai-realtime/package.json +1 -1
- package/extensions/openrouter/package.json +1 -1
- package/extensions/perplexity-search/package.json +1 -1
- package/extensions/searxng-search/package.json +1 -1
- package/extensions/signal/package.json +1 -1
- package/extensions/slack/package.json +1 -1
- package/extensions/synology-chat/package.json +1 -1
- package/extensions/telegram/package.json +1 -1
- package/extensions/tlon/package.json +1 -1
- package/extensions/twitch/CHANGELOG.md +6 -0
- package/extensions/twitch/package.json +1 -1
- package/extensions/voice-call/CHANGELOG.md +6 -0
- package/extensions/voice-call/package.json +1 -1
- package/extensions/whatsapp/package.json +1 -1
- package/extensions/zai/package.json +1 -1
- package/extensions/zalo/CHANGELOG.md +6 -0
- package/extensions/zalo/package.json +1 -1
- package/extensions/zalouser/CHANGELOG.md +6 -0
- package/extensions/zalouser/package.json +1 -1
- package/package.json +1 -1
- package/dist/github-copilot-token-DYYKoDuV.js +0 -106
- package/dist/paths-BIDPYPVC.js +0 -233
|
@@ -1,84 +1,84 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
|
-
import { _ as toAgentModelListLike, c as resolveAgentWorkspaceDir, d as resolveRunModelFallbacksOverride, f as resolveSessionAgentId, g as resolveAgentModelPrimaryValue, h as resolveAgentModelFallbackValues, i as resolveAgentDir, l as resolveDefaultAgentId, n as listAgentIds, p as resolveSessionAgentIds, r as resolveAgentConfig, s as resolveAgentSkillsFilter, t as hasConfiguredModelFallbacks, u as resolveEffectiveModelFallbacks } from "./agent-scope-
|
|
3
|
-
import { a as resolveGatewayLockDir, f as resolveRequiredHomeDir, l as resolveStateDir, n as STATE_DIR, o as resolveGatewayPort, r as resolveConfigPath, u as expandHomePrefix } from "./paths-
|
|
4
|
-
import { C as appendFileLog, F as openBoundaryFileSync, K as isDangerousHostEnvVarName, O as INCLUDE_KEY, P as openBoundaryFile, Q as clampInt, T as normalizeLogLevel, W as normalizeWindowsPathForComparison, Z as CONFIG_DIR, _ as colorize, a as createNonExitingRuntime, b as getChildLogger, c as registerActiveProgressLine, dt as sleep$3, et as ensureDir$3, f as logVerbose, ft as sliceUtf16Safe, g as warn, h as shouldLogVerbose, it as normalizeE164, j as isBlockedObjectKey, l as unregisterActiveProgressLine, lt as shortenHomeInString, m as setVerbose, mt as resolvePreferredOpenClawTmpDir, nt as formatTerminalLink, o as defaultRuntime, pt as truncateUtf16Safe, rt as isRecord$1, s as clearActiveProgressLine, st as resolveUserPath, t as createSubsystemLogger, tt as escapeRegExp, u as danger, ut as shortenHomePath, v as isRich, y as theme } from "./subsystem-
|
|
2
|
+
import { _ as toAgentModelListLike, c as resolveAgentWorkspaceDir, d as resolveRunModelFallbacksOverride, f as resolveSessionAgentId, g as resolveAgentModelPrimaryValue, h as resolveAgentModelFallbackValues, i as resolveAgentDir, l as resolveDefaultAgentId, n as listAgentIds, p as resolveSessionAgentIds, r as resolveAgentConfig, s as resolveAgentSkillsFilter, t as hasConfiguredModelFallbacks, u as resolveEffectiveModelFallbacks } from "./agent-scope-VTjBKG-0.js";
|
|
3
|
+
import { a as resolveGatewayLockDir, f as resolveRequiredHomeDir, l as resolveStateDir, n as STATE_DIR, o as resolveGatewayPort, r as resolveConfigPath, u as expandHomePrefix } from "./paths-B_gs59ga.js";
|
|
4
|
+
import { C as appendFileLog, F as openBoundaryFileSync, K as isDangerousHostEnvVarName, O as INCLUDE_KEY, P as openBoundaryFile, Q as clampInt, T as normalizeLogLevel, W as normalizeWindowsPathForComparison, Z as CONFIG_DIR, _ as colorize, a as createNonExitingRuntime, b as getChildLogger, c as registerActiveProgressLine, dt as sleep$3, et as ensureDir$3, f as logVerbose, ft as sliceUtf16Safe, g as warn, h as shouldLogVerbose, it as normalizeE164, j as isBlockedObjectKey, l as unregisterActiveProgressLine, lt as shortenHomeInString, m as setVerbose, mt as resolvePreferredOpenClawTmpDir, nt as formatTerminalLink, o as defaultRuntime, pt as truncateUtf16Safe, rt as isRecord$1, s as clearActiveProgressLine, st as resolveUserPath, t as createSubsystemLogger, tt as escapeRegExp, u as danger, ut as shortenHomePath, v as isRich, y as theme } from "./subsystem-D_zHSy02.js";
|
|
5
5
|
import { t as isPlainObject } from "./plain-object-CLm2c5Nu.js";
|
|
6
|
-
import { A as isValidAgentId, B as DEFAULT_ACCOUNT_ID, C as buildAgentMainSessionKey, F as resolveConfiguredCanonicalIdentity, G as WAKE_GATE_SESSION_KEY_SEGMENT, H as normalizeOptionalAccountId, I as resolveThreadSessionKeys, J as isAcpSessionKey, K as deriveSessionChatType, L as sanitizeAgentId, M as normalizeMainKey, N as resolveAgentIdFromSessionKey, P as resolveCanonicalIdentity, Q as resolveThreadParentSessionKey, R as sessionKeyAgentMatches, T as classifySessionKeyShape, V as normalizeAccountId$3, X as isSubagentSessionKey, Y as isCronSessionKey, Z as parseAgentSessionKey, _ as runExec, a as DEFAULT_IDENTITY_FILENAME, f as loadWorkspaceBootstrapFiles, g as runCommandWithTimeout, i as DEFAULT_HEARTBEAT_FILENAME, j as normalizeAgentId, k as isKnownAgentMainSessionKey, l as ensureAgentWorkspace, m as resolveOpenClawPackageRoot, n as DEFAULT_AGENT_WORKSPACE_DIR, q as getSubagentDepth, r as DEFAULT_BOOTSTRAP_FILENAME, u as filterBootstrapFilesForSession, v as spawnWithFallback, x as DEVICE_SENDER_PREFIX, y as DEFAULT_AGENT_ID, z as toAgentStoreSessionKey } from "./workspace-
|
|
7
|
-
import { i as logWarn, n as logError, r as logInfo, t as logDebug } from "./logger-
|
|
8
|
-
import { $i as isRecord$2, $n as normalizeHyphenSlug, $t as normalizePluginHttpPath, A as requireApiKey, Aa as DEFAULT_PROVIDER, Ai as DEFAULT_SAFE_BINS, An as setSessionRuntimeModel, Ar as deliveryContextFromSession, At as normalizePluginsConfig, B as resolveProfilesUnavailableReason, Bi as SAFE_BIN_PROFILES, Bn as resolveSessionFilePathOptions, Br as listDeliverableMessageChannels, Bt as normalizeAnyChannelId, C as createOllamaStreamFn, Ca as coerceSecretRef, Ci as listWritableExplicitTrustedSafeBinDirs, Cn as updateLastRoute, Cr as listEnabledDiscordAccounts, Ct as isPathWithinRoot, D as buildUsageWithNoCost, Da as splitTrailingAuthProfile, Di as buildEnforcedShellCommand, Dn as DEFAULT_RESET_TRIGGERS, Dr as resolveChannelGroupRequireMention, Dt as BUNDLED_ENABLED_BY_DEFAULT, E as buildStreamErrorAssistantMessage, Ea as resolveSecretInputRef, Ei as analyzeShellCommand, Er as resolveChannelGroupPolicy, Et as loadPluginManifestRegistry, F as resolveAuthProfileOrder, Fi as isDispatchWrapperExecutable, Fr as INTERNAL_MESSAGE_CHANNEL, Ft as safeStatSync, Gi as mapStreamingModeToSlackLegacyDraftStreamMode, Gn as resolveGroupSessionKey, Gr as GATEWAY_CLIENT_MODES, Gt as getActivePluginRegistry, Hi as resolveSafeBinProfiles, Hr as resolveGatewayMessageChannel, Ht as normalizeChatChannelId, I as getSoonestCooldownExpiry, Ii as isShellWrapperExecutable, In as SAFE_SESSION_ID_RE, Ir as isDeliverableMessageChannel, J as TELEGRAM_COMMAND_NAME_PATTERN, Ji as resolveSlackStreamingMode, Jn as normalizeChannelId$1, Jr as acquireSessionWriteLock, Jt as requireActivePluginRegistry, K as writeConfigFile, Ki as resolveDiscordPreviewStreamMode, Kn as getChannelPlugin, Kr as GATEWAY_CLIENT_NAMES, Kt as getActivePluginRegistryKey, L as isProfileInCooldown, Li as unwrapKnownDispatchWrapperInvocation, Ln as SESSION_RUN_STORE_FILE_NAME, Lr as isGatewayMessageChannel, Lt as CHAT_CHANNEL_ORDER, M as resolveEnvApiKey, Mi as resolveAllowlistCandidatePath, Mn as parseSessionIndexRecordKey, Mr as mergeDeliveryContext, Mt as resolveMemorySlotDecision, N as resolveModelAuthMode, Ni as resolveCommandResolutionFromArgv, Nr as normalizeDeliveryContext, Nt as discoverOpenClawPlugins, O as getApiKeyForModel, Oa as DEFAULT_CONTEXT_TOKENS, Oi as isWindowsPlatform, On as mergeSessionEntry, Or as resolveChannelGroupToolsPolicy, Ot as applyTestPluginDefaults, Pi as extractShellWrapperInlineCommand, Pr as normalizeSessionDeliveryFields, Pt as isPathInside, Q as isInboundPathAllowed, Qi as isNonEmptyString, Qn as normalizeAtHashSlug, Qt as createPluginRegistry, R as markAuthProfileFailure, Ri as unwrapKnownShellMultiplexerInvocation, Rr as isInternalMessageChannel, Rt as getChatChannelMeta, S as OLLAMA_NATIVE_BASE_URL, Sa as normalizeSecretInput, Si as isTrustedSafeBinPath, Sn as refreshConfiguredSessionBindingEntry, Sr as createDiscordActionGate, St as isAvatarHttpUrl, T as buildAssistantMessageWithZeroUsage, Ta as normalizeResolvedSecretInputString, Ti as validateSafeBinArgv, Tn as updateSessionStoreEntry, Tr as normalizeDiscordToken, Tt as validateJsonSchemaValue, U as loadConfig, Ui as applyMergePatch, Un as resolveStorePath, Ur as resolveMessageChannel, Ut as resolveChannelConfigId, V as resolveApiKeyForProfile, Vi as normalizeSafeBinProfileFixtures, Vn as resolveSessionTranscriptPath, Vr as normalizeMessageChannel, Vt as normalizeChannelId$2, W as readConfigFileSnapshot, Wi as isSafeExecutableValue, Wn as deriveSessionMetaPatch, Wr as GATEWAY_CLIENT_IDS, Wt as getActiveGatewayPluginRegistry, X as resolveTelegramCustomCommands, Xi as resolveSecretRefValues, Xn as listChannelDocks, Xr as readTaskWorkStates, Xt as addRegisteredPluginApi, Y as normalizeTelegramCommandName, Yn as getChannelDock, Yr as resolveSessionLockMaxHoldFromTimeout, Yt as setActivePluginRegistry, Zi as describeUnknownError$1, Zn as normalizeSignalMessagingTarget, Zt as clearRegisteredPluginApis, _a as resolveProcessScopedMap, _i as getConfigValueAtPath, _n as loadSessionStore, _r as hasAnyWhatsAppAuth, a as isCliProvider, aa as VERSION, ai as applyTargetToParams, an as matchPluginCommand, ar as resolveTelegramAccount, at as resolveExecPolicyPreset, ba as resolveAuthProfileDisplayLabel, bi as unsetConfigValueAtPath, bn as readSessionUpdatedAt, br as resolveCliName, bt as AVATAR_MAX_BYTES, c as normalizeProviderId, ca as isTruthyEnvValue, cn as createConversationReadQuery, d as resolveDefaultModelForAgent, da as listProfilesForProvider, di as replaceBufferedPluginTaskPasses, dn as requireSessionStorageRuntime, dr as resolveSlackAppToken, ea as parseDotPath, en as buildPluginHealthReport, er as normalizeStringEntries, et as resolveIMessageAttachmentRoots, f as resolveModelRefFromString, fa as markAuthProfileGood, fi as RecoveryAdmissionError, fn as closeConfiguredSessionStorageRuntime, fr as resolveSlackBotToken, ga as withFileLock, gi as unsetConfigOverride, gr as normalizeWhatsAppTarget, h as resolveThinkingDefault, ha as resolveOpenClawAgentDir, hi as setConfigOverride, hn as getConfiguredSessionStorageRuntime, hr as isWhatsAppGroupJid, i as findNormalizedProviderValue, ia as resolveAgentMaxConcurrent, ii as stringEnum, in as listPluginCommands, ir as listTelegramAccountIds, it as ASSISTANT_IDENTITY_COLORS, j as resolveApiKeyForProvider, ji as matchAllowlist, jn as parseDurationMs, jr as deliveryContextKey, jt as resolveEffectiveEnableState, k as getCustomProviderApiKey, ka as DEFAULT_MODEL, ki as splitCommandChain, kn as resolveFreshSessionTotalTokens, kr as resolveAccountEntry, kt as isBundledChannelEnabledByChannelConfig, l as parseModelRef, la as resolveOwnerDisplaySetting, li as discardBufferedPluginTaskPasses, ln as getConversationReadQuery, lr as resolveSlackAccount, m as resolveSubagentSpawnModelSelection, ma as resolveAuthStorePathForDisplay, mi as resetConfigOverrides, mn as commitPreparedConfiguredSessionStorageRuntimeActivation, mr as resolveSignalAccount, n as buildConfiguredAllowlistKeys, na as runTasksWithConcurrency, ni as channelTargetsSchema, nn as executePluginCommand, nr as createTelegramActionGate, nt as normalizeScpRemoteHost, o as modelKey, oa as getShellPathFromLoginShell, oi as actionHasTarget, on as registerPluginCommand, or as resolveTelegramToken, p as resolveReasoningDefault, pa as ensureAuthProfileStore, pi as getConfigOverrides, pn as closeReplacedConfiguredSessionStorageRuntime, pr as listEnabledSignalAccounts, q as validateConfigObjectWithPlugins, qi as resolveSlackNativeStreaming, qn as listChannelPlugins, qr as normalizeAccountId$4, r as buildModelAliasIndex, ra as DEFAULT_SUBAGENT_MAX_SPAWN_DEPTH, ri as optionalStringEnum, rn as getPluginCommandSpecs, rr as listEnabledTelegramAccounts, rt as parseNonNegativeByteSize, s as normalizeModelRef$2, sa as resolveShellEnvFallbackTimeoutMs, si as actionRequiresTarget, sn as StorageReadAccessError, sr as buildChannelAccountBindings, t as buildAllowedModelSet, ta as secretRefKey, ti as channelTargetSchema, tn as clearPluginCommands, tr as normalizeStringEntriesLower, tt as resolveIMessageRemoteAttachmentRoots, u as resolveConfiguredModelRef, ua as dedupeProfileIds, ui as listBufferedPluginTaskPasses, ur as resolveSlackReplyToMode, va as isPidAlive, vi as parseConfigPath, vn as loadSessionStoreFromDisk, vr as resolveWhatsAppAccount, w as buildAssistantMessage, wa as hasConfiguredSecretInput, wi as normalizeTrustedSafeBinDirs, wn as updateSessionStore, wr as resolveDiscordAccount, wt as isSupportedLocalAvatarExtension, x as retryAsync, xi as getTrustedSafeBinDirs, xn as recordSessionMetaFromInbound, xr as resolveIMessageAccount, xt as isAvatarDataUrl, ya as readProcessElapsedSeconds, yi as setConfigValueAtPath, yn as prepareConfiguredSessionStorageRuntimeActivation, yr as formatCliCommand, z as markAuthProfileUsed, zi as splitShellArgs, zn as resolveSessionFilePath, zr as isMarkdownCapableMessageChannel, zt as listChatChannels } from "./model-selection-
|
|
9
|
-
import { a as saveJsonFile, i as loadJsonFile, r as resolveCopilotApiToken } from "./github-copilot-token-
|
|
10
|
-
import { n as createInternalHookEvent, o as triggerInternalHook, s as parseBooleanValue$1, t as readManifestNamespace } from "./legacy-names-
|
|
6
|
+
import { A as isValidAgentId, B as DEFAULT_ACCOUNT_ID, C as buildAgentMainSessionKey, F as resolveConfiguredCanonicalIdentity, G as WAKE_GATE_SESSION_KEY_SEGMENT, H as normalizeOptionalAccountId, I as resolveThreadSessionKeys, J as isAcpSessionKey, K as deriveSessionChatType, L as sanitizeAgentId, M as normalizeMainKey, N as resolveAgentIdFromSessionKey, P as resolveCanonicalIdentity, Q as resolveThreadParentSessionKey, R as sessionKeyAgentMatches, T as classifySessionKeyShape, V as normalizeAccountId$3, X as isSubagentSessionKey, Y as isCronSessionKey, Z as parseAgentSessionKey, _ as runExec, a as DEFAULT_IDENTITY_FILENAME, f as loadWorkspaceBootstrapFiles, g as runCommandWithTimeout, i as DEFAULT_HEARTBEAT_FILENAME, j as normalizeAgentId, k as isKnownAgentMainSessionKey, l as ensureAgentWorkspace, m as resolveOpenClawPackageRoot, n as DEFAULT_AGENT_WORKSPACE_DIR, q as getSubagentDepth, r as DEFAULT_BOOTSTRAP_FILENAME, u as filterBootstrapFilesForSession, v as spawnWithFallback, x as DEVICE_SENDER_PREFIX, y as DEFAULT_AGENT_ID, z as toAgentStoreSessionKey } from "./workspace-CkXKTYV4.js";
|
|
7
|
+
import { i as logWarn, n as logError, r as logInfo, t as logDebug } from "./logger-vVASmiVr.js";
|
|
8
|
+
import { $i as isRecord$2, $n as normalizeHyphenSlug, $t as normalizePluginHttpPath, A as requireApiKey, Aa as DEFAULT_PROVIDER, Ai as DEFAULT_SAFE_BINS, An as setSessionRuntimeModel, Ar as deliveryContextFromSession, At as normalizePluginsConfig, B as resolveProfilesUnavailableReason, Bi as SAFE_BIN_PROFILES, Bn as resolveSessionFilePathOptions, Br as listDeliverableMessageChannels, Bt as normalizeAnyChannelId, C as createOllamaStreamFn, Ca as coerceSecretRef, Ci as listWritableExplicitTrustedSafeBinDirs, Cn as updateLastRoute, Cr as listEnabledDiscordAccounts, Ct as isPathWithinRoot, D as buildUsageWithNoCost, Da as splitTrailingAuthProfile, Di as buildEnforcedShellCommand, Dn as DEFAULT_RESET_TRIGGERS, Dr as resolveChannelGroupRequireMention, Dt as BUNDLED_ENABLED_BY_DEFAULT, E as buildStreamErrorAssistantMessage, Ea as resolveSecretInputRef, Ei as analyzeShellCommand, Er as resolveChannelGroupPolicy, Et as loadPluginManifestRegistry, F as resolveAuthProfileOrder, Fi as isDispatchWrapperExecutable, Fr as INTERNAL_MESSAGE_CHANNEL, Ft as safeStatSync, Gi as mapStreamingModeToSlackLegacyDraftStreamMode, Gn as resolveGroupSessionKey, Gr as GATEWAY_CLIENT_MODES, Gt as getActivePluginRegistry, Hi as resolveSafeBinProfiles, Hr as resolveGatewayMessageChannel, Ht as normalizeChatChannelId, I as getSoonestCooldownExpiry, Ii as isShellWrapperExecutable, In as SAFE_SESSION_ID_RE, Ir as isDeliverableMessageChannel, J as TELEGRAM_COMMAND_NAME_PATTERN, Ji as resolveSlackStreamingMode, Jn as normalizeChannelId$1, Jr as acquireSessionWriteLock, Jt as requireActivePluginRegistry, K as writeConfigFile, Ki as resolveDiscordPreviewStreamMode, Kn as getChannelPlugin, Kr as GATEWAY_CLIENT_NAMES, Kt as getActivePluginRegistryKey, L as isProfileInCooldown, Li as unwrapKnownDispatchWrapperInvocation, Ln as SESSION_RUN_STORE_FILE_NAME, Lr as isGatewayMessageChannel, Lt as CHAT_CHANNEL_ORDER, M as resolveEnvApiKey, Mi as resolveAllowlistCandidatePath, Mn as parseSessionIndexRecordKey, Mr as mergeDeliveryContext, Mt as resolveMemorySlotDecision, N as resolveModelAuthMode, Ni as resolveCommandResolutionFromArgv, Nr as normalizeDeliveryContext, Nt as discoverOpenClawPlugins, O as getApiKeyForModel, Oa as DEFAULT_CONTEXT_TOKENS, Oi as isWindowsPlatform, On as mergeSessionEntry, Or as resolveChannelGroupToolsPolicy, Ot as applyTestPluginDefaults, Pi as extractShellWrapperInlineCommand, Pr as normalizeSessionDeliveryFields, Pt as isPathInside, Q as isInboundPathAllowed, Qi as isNonEmptyString, Qn as normalizeAtHashSlug, Qt as createPluginRegistry, R as markAuthProfileFailure, Ri as unwrapKnownShellMultiplexerInvocation, Rr as isInternalMessageChannel, Rt as getChatChannelMeta, S as OLLAMA_NATIVE_BASE_URL, Sa as normalizeSecretInput, Si as isTrustedSafeBinPath, Sn as refreshConfiguredSessionBindingEntry, Sr as createDiscordActionGate, St as isAvatarHttpUrl, T as buildAssistantMessageWithZeroUsage, Ta as normalizeResolvedSecretInputString, Ti as validateSafeBinArgv, Tn as updateSessionStoreEntry, Tr as normalizeDiscordToken, Tt as validateJsonSchemaValue, U as loadConfig, Ui as applyMergePatch, Un as resolveStorePath, Ur as resolveMessageChannel, Ut as resolveChannelConfigId, V as resolveApiKeyForProfile, Vi as normalizeSafeBinProfileFixtures, Vn as resolveSessionTranscriptPath, Vr as normalizeMessageChannel, Vt as normalizeChannelId$2, W as readConfigFileSnapshot, Wi as isSafeExecutableValue, Wn as deriveSessionMetaPatch, Wr as GATEWAY_CLIENT_IDS, Wt as getActiveGatewayPluginRegistry, X as resolveTelegramCustomCommands, Xi as resolveSecretRefValues, Xn as listChannelDocks, Xr as readTaskWorkStates, Xt as addRegisteredPluginApi, Y as normalizeTelegramCommandName, Yn as getChannelDock, Yr as resolveSessionLockMaxHoldFromTimeout, Yt as setActivePluginRegistry, Zi as describeUnknownError$1, Zn as normalizeSignalMessagingTarget, Zt as clearRegisteredPluginApis, _a as resolveProcessScopedMap, _i as getConfigValueAtPath, _n as loadSessionStore, _r as hasAnyWhatsAppAuth, a as isCliProvider, aa as VERSION, ai as applyTargetToParams, an as matchPluginCommand, ar as resolveTelegramAccount, at as resolveExecPolicyPreset, ba as resolveAuthProfileDisplayLabel, bi as unsetConfigValueAtPath, bn as readSessionUpdatedAt, br as resolveCliName, bt as AVATAR_MAX_BYTES, c as normalizeProviderId, ca as isTruthyEnvValue, cn as createConversationReadQuery, d as resolveDefaultModelForAgent, da as listProfilesForProvider, di as replaceBufferedPluginTaskPasses, dn as requireSessionStorageRuntime, dr as resolveSlackAppToken, ea as parseDotPath, en as buildPluginHealthReport, er as normalizeStringEntries, et as resolveIMessageAttachmentRoots, f as resolveModelRefFromString, fa as markAuthProfileGood, fi as RecoveryAdmissionError, fn as closeConfiguredSessionStorageRuntime, fr as resolveSlackBotToken, ga as withFileLock, gi as unsetConfigOverride, gr as normalizeWhatsAppTarget, h as resolveThinkingDefault, ha as resolveOpenClawAgentDir, hi as setConfigOverride, hn as getConfiguredSessionStorageRuntime, hr as isWhatsAppGroupJid, i as findNormalizedProviderValue, ia as resolveAgentMaxConcurrent, ii as stringEnum, in as listPluginCommands, ir as listTelegramAccountIds, it as ASSISTANT_IDENTITY_COLORS, j as resolveApiKeyForProvider, ji as matchAllowlist, jn as parseDurationMs, jr as deliveryContextKey, jt as resolveEffectiveEnableState, k as getCustomProviderApiKey, ka as DEFAULT_MODEL, ki as splitCommandChain, kn as resolveFreshSessionTotalTokens, kr as resolveAccountEntry, kt as isBundledChannelEnabledByChannelConfig, l as parseModelRef, la as resolveOwnerDisplaySetting, li as discardBufferedPluginTaskPasses, ln as getConversationReadQuery, lr as resolveSlackAccount, m as resolveSubagentSpawnModelSelection, ma as resolveAuthStorePathForDisplay, mi as resetConfigOverrides, mn as commitPreparedConfiguredSessionStorageRuntimeActivation, mr as resolveSignalAccount, n as buildConfiguredAllowlistKeys, na as runTasksWithConcurrency, ni as channelTargetsSchema, nn as executePluginCommand, nr as createTelegramActionGate, nt as normalizeScpRemoteHost, o as modelKey, oa as getShellPathFromLoginShell, oi as actionHasTarget, on as registerPluginCommand, or as resolveTelegramToken, p as resolveReasoningDefault, pa as ensureAuthProfileStore, pi as getConfigOverrides, pn as closeReplacedConfiguredSessionStorageRuntime, pr as listEnabledSignalAccounts, q as validateConfigObjectWithPlugins, qi as resolveSlackNativeStreaming, qn as listChannelPlugins, qr as normalizeAccountId$4, r as buildModelAliasIndex, ra as DEFAULT_SUBAGENT_MAX_SPAWN_DEPTH, ri as optionalStringEnum, rn as getPluginCommandSpecs, rr as listEnabledTelegramAccounts, rt as parseNonNegativeByteSize, s as normalizeModelRef$2, sa as resolveShellEnvFallbackTimeoutMs, si as actionRequiresTarget, sn as StorageReadAccessError, sr as buildChannelAccountBindings, t as buildAllowedModelSet, ta as secretRefKey, ti as channelTargetSchema, tn as clearPluginCommands, tr as normalizeStringEntriesLower, tt as resolveIMessageRemoteAttachmentRoots, u as resolveConfiguredModelRef, ua as dedupeProfileIds, ui as listBufferedPluginTaskPasses, ur as resolveSlackReplyToMode, va as isPidAlive, vi as parseConfigPath, vn as loadSessionStoreFromDisk, vr as resolveWhatsAppAccount, w as buildAssistantMessage, wa as hasConfiguredSecretInput, wi as normalizeTrustedSafeBinDirs, wn as updateSessionStore, wr as resolveDiscordAccount, wt as isSupportedLocalAvatarExtension, x as retryAsync, xi as getTrustedSafeBinDirs, xn as recordSessionMetaFromInbound, xr as resolveIMessageAccount, xt as isAvatarDataUrl, ya as readProcessElapsedSeconds, yi as setConfigValueAtPath, yn as prepareConfiguredSessionStorageRuntimeActivation, yr as formatCliCommand, z as markAuthProfileUsed, zi as splitShellArgs, zn as resolveSessionFilePath, zr as isMarkdownCapableMessageChannel, zt as listChatChannels } from "./model-selection-BTxcwzNF.js";
|
|
9
|
+
import { a as saveJsonFile, i as loadJsonFile, r as resolveCopilotApiToken } from "./github-copilot-token-DHoyZ4I0.js";
|
|
10
|
+
import { n as createInternalHookEvent, o as triggerInternalHook, s as parseBooleanValue$1, t as readManifestNamespace } from "./legacy-names-Dh4RlQMQ.js";
|
|
11
11
|
import { n as resolveConversationLabel, r as normalizeChatType } from "./conversation-label-CrORLc0j.js";
|
|
12
|
-
import { a as createSlackWebClient, c as validateSlackBlocksArray, d as resolveSlackChannelId, i as normalizeSlackOutboundText, l as buildSlackBlocksFallbackText, o as resolveSlackWebClientOptions, s as parseSlackBlocksInput, t as sendMessageSlack, u as parseSlackTarget } from "./send-
|
|
13
|
-
import { $ as fetchChannelPermissionsDiscord, A as unpinMessageDiscord, B as listScheduledEventsDiscord, C as editMessageDiscord, Ct as resolveTimestampMs, D as pinMessageDiscord, Dt as normalizeChannelSlug, E as listThreadsDiscord, Et as buildChannelKeyCandidates, 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 resolveChannelEntryMatchWithFallback, P as fetchChannelInfoDiscord, Q as stripUndefinedFields, R as kickMemberDiscord, S as deleteMessageDiscord, St as resolveDiscordSystemLocation, T as listPinsDiscord, Tt as applyChannelMatchMeta, U as listGuildEmojisDiscord, V as removeRoleDiscord, W as uploadEmojiDiscord, X as removeChannelPermissionDiscord, Y as moveChannelDiscord, Z as setChannelPermissionDiscord, _ as sendPollDiscord, _t as resolveDiscordShouldRequireMention, a as removeReactionDiscord, at as resolveDiscordChannelId, b as sendWebhookMessageDiscord, bt as formatDiscordReactionEmoji, c as formatDiscordComponentEventText, ct as isDiscordGroupAllowedByPolicy, d as parseDiscordModalCustomId, dt as resolveDiscordAllowListMatch, et as hasAnyGuildPermissionDiscord, f as parseDiscordModalCustomIdForCarbon, ft as resolveDiscordChannelConfigWithFallback, g as sendMessageDiscord, gt as resolveDiscordOwnerAllowFrom, h as resolveDiscordModalEntry, ht as resolveDiscordOwnerAccess, i as removeOwnReactionsDiscord, it as parseDiscordTarget, j as addRoleDiscord, k as searchMessagesDiscord, l as parseDiscordComponentCustomId, lt as normalizeDiscordAllowList, m as resolveDiscordComponentEntry, mt as resolveDiscordMemberAccessState, n as fetchReactionsDiscord, nt as createDiscordClient, o as sendDiscordComponentMessage, ot as listDiscordDirectoryGroupsLive, p as readDiscordComponentSpec, pt as resolveDiscordGuildEntry, q as deleteChannelDiscord, r as reactMessageDiscord, rt as createDiscordRestClient, s as createDiscordFormModal, st as listDiscordDirectoryPeersLive, tt as chunkDiscordTextWithMode, u as parseDiscordComponentCustomIdForCarbon, ut as normalizeDiscordSlug, v as sendStickerDiscord, vt as resolveGroupDmAllow, w as fetchMessageDiscord, wt as fetchDiscord, x as createThreadDiscord, xt as formatDiscordUserTag, y as sendVoiceMessageDiscord, yt as shouldEmitDiscordReactionNotification, z as listGuildChannelsDiscord } from "./send-
|
|
14
|
-
import { a as stripSilentToken, i as isSilentReplyText, n as SILENT_REPLY_TOKEN, r as isSilentReplyPrefixText, t as HEARTBEAT_TOKEN } from "./tokens-
|
|
15
|
-
import { $ as DB_SESSION_HYDRATION_LIMIT, A as resolveExplicitAgentSessionKey, B as userIdFromSessionKey, C as evaluateSessionFreshness, Ct as toJsonValue$1, D as resolveThreadFlag, E as resolveSessionResetType, F as runSerializedBySession, G as getMessageIngress, H as collectInboundUserContext, I as drainPendingPrimaryWrites, J as stripMessageCarriers, K as isRepresentableEpochMs, L as extractLegacyTranscriptEntryFields, M as isPrimarySessionTranscriptFileName, N as isSessionArchiveArtifactName, O as canonicalizeMainSessionAlias, P as openDbSessionManager, Q as resolveSenderLabel, R as sanitizeJsonb, S as resolveSessionKey, St as mergePromptContributions, T as resolveSessionResetPolicy, U as renderInboundUserContext, V as buildInboundMetaSystemPrompt, W as attachMessageIngress, X as formatZonedTimestamp, Y as formatMessageStamp, Z as resolveTimezone, _ as deriveSessionTotalTokens, _t as buildPluginRuntimeIdentity, a as resolveMirroredTranscriptText, at as sanitizeToolCallInputs, b as normalizeUsage, bt as resolveProviderRuntimeIdentity, c as resolveSessionStorageConfig, ct as sanitizeToolCallIdsForCloudCodeAssist, d as TASK_RUN_STATUSES, dt as normalizeInputProvenance, et as eventOrder, f as buildEqualityProjection, ft as getGlobalHookRunner, g as derivePromptTokens, gt as promptBuildResultToContribution, h as sanitizeAppendEntry, ht as hasHookForPlugin, i as appendAssistantMessageToSessionTranscript, it as repairToolUseResultPairing, j as resolveMainSessionKey, k as resolveAgentMainSessionKey, l as validateCtxStorage, lt as INPUT_PROVENANCE_KIND_VALUES, m as deriveLegacyActorIdentity, mt as initializeGlobalHookRunner, n as parseSessionThreadInfo, nt as HIDDEN_HEARTBEAT_CUSTOM_TYPE, o as parseInlineDirectives$1, ot as sanitizeToolUseResultPairing, p as CREATE_CTX_STORAGE_OWNER_SQL, pt as getGlobalPluginRegistry, q as messageTime, r as resolveAndPersistSessionFile, rt as guardSessionManager, s as createSessionStorageRuntimeFromConfig, st as stripToolResultDetails, t as extractDeliveryInfo, tt as pickLeaf, u as TASK_RUN_MODES, ut as hasInterSessionUserProvenance, v as hasNonzeroUsage, vt as buildPluginTurnIdentity, w as resolveChannelResetConfig, x as SESSION_RUN_STATUSES, xt as createCurrentUserPromptEnvelope, y as makeZeroUsageSnapshot, yt as resolveProviderPromptCacheKey, z as sha256 } from "./sessions-
|
|
12
|
+
import { a as createSlackWebClient, c as validateSlackBlocksArray, d as resolveSlackChannelId, i as normalizeSlackOutboundText, l as buildSlackBlocksFallbackText, o as resolveSlackWebClientOptions, s as parseSlackBlocksInput, t as sendMessageSlack, u as parseSlackTarget } from "./send-D3AqPouq.js";
|
|
13
|
+
import { $ as fetchChannelPermissionsDiscord, A as unpinMessageDiscord, B as listScheduledEventsDiscord, C as editMessageDiscord, Ct as resolveTimestampMs, D as pinMessageDiscord, Dt as normalizeChannelSlug, E as listThreadsDiscord, Et as buildChannelKeyCandidates, 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 resolveChannelEntryMatchWithFallback, P as fetchChannelInfoDiscord, Q as stripUndefinedFields, R as kickMemberDiscord, S as deleteMessageDiscord, St as resolveDiscordSystemLocation, T as listPinsDiscord, Tt as applyChannelMatchMeta, U as listGuildEmojisDiscord, V as removeRoleDiscord, W as uploadEmojiDiscord, X as removeChannelPermissionDiscord, Y as moveChannelDiscord, Z as setChannelPermissionDiscord, _ as sendPollDiscord, _t as resolveDiscordShouldRequireMention, a as removeReactionDiscord, at as resolveDiscordChannelId, b as sendWebhookMessageDiscord, bt as formatDiscordReactionEmoji, c as formatDiscordComponentEventText, ct as isDiscordGroupAllowedByPolicy, d as parseDiscordModalCustomId, dt as resolveDiscordAllowListMatch, et as hasAnyGuildPermissionDiscord, f as parseDiscordModalCustomIdForCarbon, ft as resolveDiscordChannelConfigWithFallback, g as sendMessageDiscord, gt as resolveDiscordOwnerAllowFrom, h as resolveDiscordModalEntry, ht as resolveDiscordOwnerAccess, i as removeOwnReactionsDiscord, it as parseDiscordTarget, j as addRoleDiscord, k as searchMessagesDiscord, l as parseDiscordComponentCustomId, lt as normalizeDiscordAllowList, m as resolveDiscordComponentEntry, mt as resolveDiscordMemberAccessState, n as fetchReactionsDiscord, nt as createDiscordClient, o as sendDiscordComponentMessage, ot as listDiscordDirectoryGroupsLive, p as readDiscordComponentSpec, pt as resolveDiscordGuildEntry, q as deleteChannelDiscord, r as reactMessageDiscord, rt as createDiscordRestClient, s as createDiscordFormModal, st as listDiscordDirectoryPeersLive, tt as chunkDiscordTextWithMode, u as parseDiscordComponentCustomIdForCarbon, ut as normalizeDiscordSlug, v as sendStickerDiscord, vt as resolveGroupDmAllow, w as fetchMessageDiscord, wt as fetchDiscord, x as createThreadDiscord, xt as formatDiscordUserTag, y as sendVoiceMessageDiscord, yt as shouldEmitDiscordReactionNotification, z as listGuildChannelsDiscord } from "./send-D4CyRJfb.js";
|
|
14
|
+
import { a as stripSilentToken, i as isSilentReplyText, n as SILENT_REPLY_TOKEN, r as isSilentReplyPrefixText, t as HEARTBEAT_TOKEN } from "./tokens-B3OPeQh5.js";
|
|
15
|
+
import { $ as DB_SESSION_HYDRATION_LIMIT, A as resolveExplicitAgentSessionKey, B as userIdFromSessionKey, C as evaluateSessionFreshness, Ct as toJsonValue$1, D as resolveThreadFlag, E as resolveSessionResetType, F as runSerializedBySession, G as getMessageIngress, H as collectInboundUserContext, I as drainPendingPrimaryWrites, J as stripMessageCarriers, K as isRepresentableEpochMs, L as extractLegacyTranscriptEntryFields, M as isPrimarySessionTranscriptFileName, N as isSessionArchiveArtifactName, O as canonicalizeMainSessionAlias, P as openDbSessionManager, Q as resolveSenderLabel, R as sanitizeJsonb, S as resolveSessionKey, St as mergePromptContributions, T as resolveSessionResetPolicy, U as renderInboundUserContext, V as buildInboundMetaSystemPrompt, W as attachMessageIngress, X as formatZonedTimestamp, Y as formatMessageStamp, Z as resolveTimezone, _ as deriveSessionTotalTokens, _t as buildPluginRuntimeIdentity, a as resolveMirroredTranscriptText, at as sanitizeToolCallInputs, b as normalizeUsage, bt as resolveProviderRuntimeIdentity, c as resolveSessionStorageConfig, ct as sanitizeToolCallIdsForCloudCodeAssist, d as TASK_RUN_STATUSES, dt as normalizeInputProvenance, et as eventOrder, f as buildEqualityProjection, ft as getGlobalHookRunner, g as derivePromptTokens, gt as promptBuildResultToContribution, h as sanitizeAppendEntry, ht as hasHookForPlugin, i as appendAssistantMessageToSessionTranscript, it as repairToolUseResultPairing, j as resolveMainSessionKey, k as resolveAgentMainSessionKey, l as validateCtxStorage, lt as INPUT_PROVENANCE_KIND_VALUES, m as deriveLegacyActorIdentity, mt as initializeGlobalHookRunner, n as parseSessionThreadInfo, nt as HIDDEN_HEARTBEAT_CUSTOM_TYPE, o as parseInlineDirectives$1, ot as sanitizeToolUseResultPairing, p as CREATE_CTX_STORAGE_OWNER_SQL, pt as getGlobalPluginRegistry, q as messageTime, r as resolveAndPersistSessionFile, rt as guardSessionManager, s as createSessionStorageRuntimeFromConfig, st as stripToolResultDetails, t as extractDeliveryInfo, tt as pickLeaf, u as TASK_RUN_MODES, ut as hasInterSessionUserProvenance, v as hasNonzeroUsage, vt as buildPluginTurnIdentity, w as resolveChannelResetConfig, x as SESSION_RUN_STATUSES, xt as createCurrentUserPromptEnvelope, y as makeZeroUsageSnapshot, yt as resolveProviderPromptCacheKey, z as sha256 } from "./sessions-C8YjZYd5.js";
|
|
16
16
|
import { n as isDiagnosticsEnabled, t as emitDiagnosticEvent } from "./diagnostic-events-DGRcTqIH.js";
|
|
17
17
|
import { n as onSessionTranscriptUpdate } from "./transcript-events-C9cNWasT.js";
|
|
18
18
|
import { n as generateSecureUuid, t as generateSecureToken } from "./secure-random-BEYczWtd.js";
|
|
19
|
-
import { A as boundDiagnosticContent, C as logWebhookError, D as refreshRunProgress, E as recordSystemPromptHashComparison, M as resetCommandPollCount, O as startDiagnosticHeartbeat, S as logToolExecutionStarted, T as logWebhookReceived, b as logToolExecutionBlocked, d as logRunCompleted, f as logRunStarted, j as recordCommandPoll, k as stopDiagnosticHeartbeat, l as logModelCallError, o as logMessageProcessed, p as logSessionStateChange, s as logMessageQueued, w as logWebhookProcessed, x as logToolExecutionCompleted } from "./diagnostic-
|
|
19
|
+
import { A as boundDiagnosticContent, C as logWebhookError, D as refreshRunProgress, E as recordSystemPromptHashComparison, M as resetCommandPollCount, O as startDiagnosticHeartbeat, S as logToolExecutionStarted, T as logWebhookReceived, b as logToolExecutionBlocked, d as logRunCompleted, f as logRunStarted, j as recordCommandPoll, k as stopDiagnosticHeartbeat, l as logModelCallError, o as logMessageProcessed, p as logSessionStateChange, s as logMessageQueued, w as logWebhookProcessed, x as logToolExecutionCompleted } from "./diagnostic-DWnW43D8.js";
|
|
20
20
|
import { r as getDiagnosticSessionState, s as redactChannelCorrelation } from "./diagnostic-session-state-Bnyx-w0F.js";
|
|
21
21
|
import { t as redactIdentifier } from "./redact-identifier-WYElxwAZ.js";
|
|
22
|
-
import { i as testRegexWithBoundedInput, r as compileSafeRegex, t as redactSensitiveText } from "./redact-
|
|
22
|
+
import { i as testRegexWithBoundedInput, r as compileSafeRegex, t as redactSensitiveText } from "./redact-CteA3IBL.js";
|
|
23
23
|
import { t as CommandLane } from "./lanes-DTaUAkeG.js";
|
|
24
|
-
import { a as getCommandLaneSnapshots, c as isQueuedCommandCancellation, i as enqueueCommandInLane, n as clearCommandLane, o as getQueueSize, s as isGatewayDraining, t as CommandLaneAbortedError } from "./command-queue-
|
|
25
|
-
import { $ as resolveTelegramReplyId, A as resolveTelegramFetch, B as buildTelegramGroupPeerId, C as getTelegramFleetSupervisor, D as recordWebhook, E as recordUpdate, F as resolveCronStorePath, G as expandTextLinks, H as buildTelegramThreadParams, I as buildGroupLabel, J as normalizeForwardedContext, K as extractTelegramLocation, L as buildSenderLabel, M as formatTelegramErrorMessage, N as withTelegramApiErrorLogging, O as registerAccount, P as loadCronStore, Q as resolveTelegramMediaPlaceholder, R as buildSenderName, S as fingerprintTelegramToken, St as resolveTelegramTargetChatType, T as recordState, U as buildTypingThreadParams, V as buildTelegramParentPeer, W as describeReplyTarget, X as resolveTelegramForumThreadId, Y as resolveTelegramDirectPeerId, Z as resolveTelegramGroupAllowFromContext, _ as isTelegramEditMayHaveLandedError, _t as writeJsonFileAtomically, a as reactMessageTelegram, at as resolveSenderAllowMatch$1, b as renderTelegramHtmlText, bt as isVoiceCompatibleAudio, c as sendStickerTelegram, ct as mergeDmAllowFromSources, d as wasSentByBot, dt as toLocationContext, et as resolveTelegramStreamMode, f as extractTelegramErrorText, ft as addChannelAllowFromStoreEntry, g as isTelegramClientRejection, gt as readJsonFileWithFallback, h as isSafeToRetrySendError, ht as upsertChannelPairingRequest, i as editMessageTelegram, it as normalizeDmAllowFromWithStore$1, j as splitTelegramCaption, k as releaseAccountOwner, lt as resolveGroupAllowFromSources, m as isRecoverableTelegramNetworkError, mt as removeChannelAllowFromStoreEntry, n as createForumTopicTelegram, nt as isSenderAllowed$1, o as sendMessageTelegram, ot as firstDefined$1, p as isDefiniteTelegramRequestNonDeliveryError, pt as readChannelAllowFromStore, q as hasBotMention, r as deleteMessageTelegram, rt as normalizeAllowFrom$2, s as sendPollTelegram, st as isSenderIdAllowed, t as buildInlineKeyboard, tt as resolveTelegramThreadSpec, u as resolveTelegramVoiceSend, ut as formatLocationText, v as markdownToTelegramChunks, vt as getPairingAdapter, w as recordApiRequest, x as wrapFileReferencesInHtml, xt as parseTelegramTarget, y as markdownToTelegramHtml, yt as listPairingChannels, z as buildTelegramGroupFrom } from "./send-
|
|
26
|
-
import { c as detectMime, d as imageMimeFromFormat, f as isAudioFileName, g as MAX_IMAGE_BYTES, i as getImageMetadata, l as extensionForMime, m as kindFromMime, p as isGifMedia, s as resizeToJpeg, v as mediaKindFromMime } from "./image-ops-
|
|
27
|
-
import { n as discoverModels, t as discoverAuthStorage } from "./pi-model-discovery-
|
|
28
|
-
import { $ as buildPluginToolGroups, A as isLikelyContextOverflowError, B as resolveSandboxContext, C as isAuthAssistantError, D as isContextOverflowError, E as isCompactionFailureError, F as parseImageSizeError, G as resolveProfile, H as createBrowserRouteContext, I as sanitizeUserFacingText, J as resolveBrowserControlAuth, K as getBridgeAuthForPort, L as isAuthPermanentErrorMessage, M as isRawApiErrorPayload, N as isTransientHttpError, O as isFailoverAssistantError, P as parseImageDimensionError, Q as applyOwnerOnlyToolPolicy, R as isTimeoutErrorMessage, S as getApiErrorPayloadFingerprint, T as isCloudCodeAssistFormatError, U as registerBrowserRoutes, V as resolveSandboxRuntimeStatus, W as resolveBrowserConfig, X as trimToUndefined$1, Y as resolveGatewayCredentialsFromConfig, Z as resolveSandboxConfigForAgent, _ as BILLING_ERROR_USER_MESSAGE, at as normalizeToolName, b as formatBillingErrorMessage, c as sanitizeSessionMessagesImages, ct as matchesAnyGlobPattern, d as resolveImageSanitizationLimits, dt as resolveBootstrapTotalMaxChars, et as collectExplicitAllowlist, f as canonicalizeBase64, ft as sanitizeGoogleTurnOrdering, g as isGoogleModelApi, h as downgradeOpenAIReasoningBlocks, i as pickFallbackThinkingLevel, it as expandToolGroups, j as isRateLimitAssistantError, k as isFailoverErrorMessage, l as sanitizeImageBlocks, lt as buildBootstrapContextFiles, m as downgradeOpenAIFunctionCallReasoningPairs, n as validateAnthropicTurns, nt as mergeAlsoAllowPolicy, o as isMessagingToolDuplicateNormalized, ot as resolveToolProfilePolicy, p as estimateBase64DecodedBytes, q as ensureBrowserControlAuth, r as validateGeminiTurns, rt as stripPluginOnlyAllowlist, s as normalizeTextForComparison, st as compileGlobPatterns, t as extractTextFromChatContent, tt as expandPolicyWithPluginGroups, u as sanitizeToolResultImages, ut as resolveBootstrapMaxChars, v as classifyFailoverReason, w as isBillingAssistantError, x as formatRawAssistantErrorForUi, y as formatAssistantErrorText, z as ensureSandboxWorkspaceForSession } from "./chat-content-
|
|
29
|
-
import { A as rawDataToString, B as isSecureWebSocketUrl, C as ensureChromeExtensionRelayServer, N as DEFAULT_UPLOAD_DIR, P as resolveExistingPathsWithinRoot, V as resolveClientIp, W as DEFAULT_AI_SNAPSHOT_MAX_CHARS, s as resolveLsofCommandSync, z as isLoopbackHost } from "./chrome-
|
|
30
|
-
import { a as skillsSnapshotSourceDiffers, c as assertMediaNotDataUrl, f as resolveSandboxedMediaSource, i as resolveSkillsPromptForRun, l as assertSandboxPath, m as applySkillEnvOverridesFromSnapshot, n as buildWorkspaceSkillSnapshot, p as applySkillEnvOverrides, r as loadWorkspaceSkillEntries, u as resolveSandboxInputPath } from "./skills-
|
|
31
|
-
import { t as PATH_ALIAS_POLICIES } from "./path-alias-guards-
|
|
32
|
-
import { a as formatUncaughtError, c as readErrorName, i as formatErrorMessage, o as hasErrnoCode, r as formatErrorChainMessage, t as collectErrorGraphCandidates } from "./errors-
|
|
33
|
-
import { a as readFileWithinRoot, c as writeFileWithinRoot, i as openFileWithinRoot, n as copyFileWithinRoot, r as createRootScopedReadFile, t as SafeOpenError } from "./fs-safe-
|
|
34
|
-
import { a as isBlockedHostnameOrIp, l as normalizeHostname, n as SsrFBlockedError } from "./proxy-env-
|
|
35
|
-
import { i as saveMediaBuffer, r as getMediaDir, t as MEDIA_MAX_BYTES } from "./store-
|
|
24
|
+
import { a as getCommandLaneSnapshots, c as isQueuedCommandCancellation, i as enqueueCommandInLane, n as clearCommandLane, o as getQueueSize, s as isGatewayDraining, t as CommandLaneAbortedError } from "./command-queue-DiOM6aJb.js";
|
|
25
|
+
import { $ as resolveTelegramReplyId, A as resolveTelegramFetch, B as buildTelegramGroupPeerId, C as getTelegramFleetSupervisor, D as recordWebhook, E as recordUpdate, F as resolveCronStorePath, G as expandTextLinks, H as buildTelegramThreadParams, I as buildGroupLabel, J as normalizeForwardedContext, K as extractTelegramLocation, L as buildSenderLabel, M as formatTelegramErrorMessage, N as withTelegramApiErrorLogging, O as registerAccount, P as loadCronStore, Q as resolveTelegramMediaPlaceholder, R as buildSenderName, S as fingerprintTelegramToken, St as resolveTelegramTargetChatType, T as recordState, U as buildTypingThreadParams, V as buildTelegramParentPeer, W as describeReplyTarget, X as resolveTelegramForumThreadId, Y as resolveTelegramDirectPeerId, Z as resolveTelegramGroupAllowFromContext, _ as isTelegramEditMayHaveLandedError, _t as writeJsonFileAtomically, a as reactMessageTelegram, at as resolveSenderAllowMatch$1, b as renderTelegramHtmlText, bt as isVoiceCompatibleAudio, c as sendStickerTelegram, ct as mergeDmAllowFromSources, d as wasSentByBot, dt as toLocationContext, et as resolveTelegramStreamMode, f as extractTelegramErrorText, ft as addChannelAllowFromStoreEntry, g as isTelegramClientRejection, gt as readJsonFileWithFallback, h as isSafeToRetrySendError, ht as upsertChannelPairingRequest, i as editMessageTelegram, it as normalizeDmAllowFromWithStore$1, j as splitTelegramCaption, k as releaseAccountOwner, lt as resolveGroupAllowFromSources, m as isRecoverableTelegramNetworkError, mt as removeChannelAllowFromStoreEntry, n as createForumTopicTelegram, nt as isSenderAllowed$1, o as sendMessageTelegram, ot as firstDefined$1, p as isDefiniteTelegramRequestNonDeliveryError, pt as readChannelAllowFromStore, q as hasBotMention, r as deleteMessageTelegram, rt as normalizeAllowFrom$2, s as sendPollTelegram, st as isSenderIdAllowed, t as buildInlineKeyboard, tt as resolveTelegramThreadSpec, u as resolveTelegramVoiceSend, ut as formatLocationText, v as markdownToTelegramChunks, vt as getPairingAdapter, w as recordApiRequest, x as wrapFileReferencesInHtml, xt as parseTelegramTarget, y as markdownToTelegramHtml, yt as listPairingChannels, z as buildTelegramGroupFrom } from "./send-Owye3CdT.js";
|
|
26
|
+
import { c as detectMime, d as imageMimeFromFormat, f as isAudioFileName, g as MAX_IMAGE_BYTES, i as getImageMetadata, l as extensionForMime, m as kindFromMime, p as isGifMedia, s as resizeToJpeg, v as mediaKindFromMime } from "./image-ops-d6AhYSNh.js";
|
|
27
|
+
import { n as discoverModels, t as discoverAuthStorage } from "./pi-model-discovery-BHTeo1nC.js";
|
|
28
|
+
import { $ as buildPluginToolGroups, A as isLikelyContextOverflowError, B as resolveSandboxContext, C as isAuthAssistantError, D as isContextOverflowError, E as isCompactionFailureError, F as parseImageSizeError, G as resolveProfile, H as createBrowserRouteContext, I as sanitizeUserFacingText, J as resolveBrowserControlAuth, K as getBridgeAuthForPort, L as isAuthPermanentErrorMessage, M as isRawApiErrorPayload, N as isTransientHttpError, O as isFailoverAssistantError, P as parseImageDimensionError, Q as applyOwnerOnlyToolPolicy, R as isTimeoutErrorMessage, S as getApiErrorPayloadFingerprint, T as isCloudCodeAssistFormatError, U as registerBrowserRoutes, V as resolveSandboxRuntimeStatus, W as resolveBrowserConfig, X as trimToUndefined$1, Y as resolveGatewayCredentialsFromConfig, Z as resolveSandboxConfigForAgent, _ as BILLING_ERROR_USER_MESSAGE, at as normalizeToolName, b as formatBillingErrorMessage, c as sanitizeSessionMessagesImages, ct as matchesAnyGlobPattern, d as resolveImageSanitizationLimits, dt as resolveBootstrapTotalMaxChars, et as collectExplicitAllowlist, f as canonicalizeBase64, ft as sanitizeGoogleTurnOrdering, g as isGoogleModelApi, h as downgradeOpenAIReasoningBlocks, i as pickFallbackThinkingLevel, it as expandToolGroups, j as isRateLimitAssistantError, k as isFailoverErrorMessage, l as sanitizeImageBlocks, lt as buildBootstrapContextFiles, m as downgradeOpenAIFunctionCallReasoningPairs, n as validateAnthropicTurns, nt as mergeAlsoAllowPolicy, o as isMessagingToolDuplicateNormalized, ot as resolveToolProfilePolicy, p as estimateBase64DecodedBytes, q as ensureBrowserControlAuth, r as validateGeminiTurns, rt as stripPluginOnlyAllowlist, s as normalizeTextForComparison, st as compileGlobPatterns, t as extractTextFromChatContent, tt as expandPolicyWithPluginGroups, u as sanitizeToolResultImages, ut as resolveBootstrapMaxChars, v as classifyFailoverReason, w as isBillingAssistantError, x as formatRawAssistantErrorForUi, y as formatAssistantErrorText, z as ensureSandboxWorkspaceForSession } from "./chat-content-CjKyPXfO.js";
|
|
29
|
+
import { A as rawDataToString, B as isSecureWebSocketUrl, C as ensureChromeExtensionRelayServer, N as DEFAULT_UPLOAD_DIR, P as resolveExistingPathsWithinRoot, V as resolveClientIp, W as DEFAULT_AI_SNAPSHOT_MAX_CHARS, s as resolveLsofCommandSync, z as isLoopbackHost } from "./chrome-C9hAxf3E.js";
|
|
30
|
+
import { a as skillsSnapshotSourceDiffers, c as assertMediaNotDataUrl, f as resolveSandboxedMediaSource, i as resolveSkillsPromptForRun, l as assertSandboxPath, m as applySkillEnvOverridesFromSnapshot, n as buildWorkspaceSkillSnapshot, p as applySkillEnvOverrides, r as loadWorkspaceSkillEntries, u as resolveSandboxInputPath } from "./skills-BNWKnQc8.js";
|
|
31
|
+
import { t as PATH_ALIAS_POLICIES } from "./path-alias-guards-BzCkdlOk.js";
|
|
32
|
+
import { a as formatUncaughtError, c as readErrorName, i as formatErrorMessage, o as hasErrnoCode, r as formatErrorChainMessage, t as collectErrorGraphCandidates } from "./errors-h4QgDEJU.js";
|
|
33
|
+
import { a as readFileWithinRoot, c as writeFileWithinRoot, i as openFileWithinRoot, n as copyFileWithinRoot, r as createRootScopedReadFile, t as SafeOpenError } from "./fs-safe-joAzTKB9.js";
|
|
34
|
+
import { a as isBlockedHostnameOrIp, l as normalizeHostname, n as SsrFBlockedError } from "./proxy-env-D-BYfN9f.js";
|
|
35
|
+
import { i as saveMediaBuffer, r as getMediaDir, t as MEDIA_MAX_BYTES } from "./store-BkbDrlDX.js";
|
|
36
36
|
import { t as resolveNetworkSsrFPolicy } from "./ssrf-config-Cj-XaaTu.js";
|
|
37
37
|
import { n as readJsonFile, r as writeJsonAtomic, t as createAsyncLock } from "./json-files-DBtcstGX.js";
|
|
38
38
|
import { a as normalizeReasoningLevel, c as normalizeVerboseLevel, i as normalizeElevatedLevel, l as resolveResponseUsageMode, n as formatXHighModelHint, o as normalizeThinkLevel, s as normalizeUsageDisplay, t as formatThinkingLevels, u as supportsXHighThinking } from "./thinking-CcoiS9V4.js";
|
|
39
|
-
import { t as ensureOpenClawModelsJson } from "./models-config-
|
|
40
|
-
import { C as loadModelCatalog, S as findModelInCatalog, _ as stripCarriedTranscriptFromBody, a as resolveAutoImageModel, c as applyTemplate, d as normalizeMediaUnderstandingChatType, f as resolveMediaUnderstandingScope, i as normalizeMediaAttachments, l as resolveConcurrency, 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 buildRandomTempFilePath, w as modelSupportsVision, x as resolveAttachmentKind, y as registerUnhandledRejectionHandler } from "./audio-transcription-runner-
|
|
41
|
-
import { a as formatReasoningMessage, d as stripThinkingTagsFromText, f as formatToolSummary, g as isInsideCode, h as findCodeRegions, l as stripDowngradedToolCallText, m as stripReasoningTagsFromText, n as extractAssistantThinking, o as inferToolMetaFromArgs, p as resolveToolDisplay, s as isAssistantMessage, t as extractAssistantText$1, u as stripMinimaxToolCallXml } from "./pi-embedded-utils-
|
|
42
|
-
import { a as coerceImageModelConfig, i as coerceImageAssistantText, o as decodeDataUrl, r as minimaxUnderstandImage, s as resolveProviderVisionModelFromConfig } from "./provider-image-
|
|
43
|
-
import { a as getDefaultMediaLocalRoots, i as getAgentScopedMediaLocalRoots, n as fetchRemoteMedia, r as readResponseWithLimit, t as MediaFetchError } from "./fetch-
|
|
39
|
+
import { t as ensureOpenClawModelsJson } from "./models-config-CrYtS7l_.js";
|
|
40
|
+
import { C as loadModelCatalog, S as findModelInCatalog, _ as stripCarriedTranscriptFromBody, a as resolveAutoImageModel, c as applyTemplate, d as normalizeMediaUnderstandingChatType, f as resolveMediaUnderstandingScope, i as normalizeMediaAttachments, l as resolveConcurrency, 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 buildRandomTempFilePath, w as modelSupportsVision, x as resolveAttachmentKind, y as registerUnhandledRejectionHandler } from "./audio-transcription-runner-CBRRwnRT.js";
|
|
41
|
+
import { a as formatReasoningMessage, d as stripThinkingTagsFromText, f as formatToolSummary, g as isInsideCode, h as findCodeRegions, l as stripDowngradedToolCallText, m as stripReasoningTagsFromText, n as extractAssistantThinking, o as inferToolMetaFromArgs, p as resolveToolDisplay, s as isAssistantMessage, t as extractAssistantText$1, u as stripMinimaxToolCallXml } from "./pi-embedded-utils-Bu-pLHgt.js";
|
|
42
|
+
import { a as coerceImageModelConfig, i as coerceImageAssistantText, o as decodeDataUrl, r as minimaxUnderstandImage, s as resolveProviderVisionModelFromConfig } from "./provider-image-BoLaTMGA.js";
|
|
43
|
+
import { a as getDefaultMediaLocalRoots, i as getAgentScopedMediaLocalRoots, n as fetchRemoteMedia, r as readResponseWithLimit, t as MediaFetchError } from "./fetch-BkWHUyJz.js";
|
|
44
44
|
import { n as fetchWithTimeout, t as bindAbortRelay } from "./fetch-timeout-Dyj5Y_Ss.js";
|
|
45
|
-
import { n as withStrictGuardedFetchMode, r as withTrustedEnvProxyGuardedFetchMode, t as fetchWithSsrFGuard } from "./fetch-guard-
|
|
46
|
-
import { r as makeProxyFetch } from "./proxy-fetch-
|
|
47
|
-
import { a as resolveAgentIdentity, i as resolveAckReaction, o as resolveEffectiveMessagesConfig, r as resolveResponsePrefixTemplate, s as resolveHumanDelayConfig, t as createReplyPrefixOptions } from "./reply-prefix-
|
|
45
|
+
import { n as withStrictGuardedFetchMode, r as withTrustedEnvProxyGuardedFetchMode, t as fetchWithSsrFGuard } from "./fetch-guard-BUJnD_0T.js";
|
|
46
|
+
import { r as makeProxyFetch } from "./proxy-fetch-SAeVJOzX.js";
|
|
47
|
+
import { a as resolveAgentIdentity, i as resolveAckReaction, o as resolveEffectiveMessagesConfig, r as resolveResponsePrefixTemplate, s as resolveHumanDelayConfig, t as createReplyPrefixOptions } from "./reply-prefix-B4-hQLj2.js";
|
|
48
48
|
import { n as isSafeFenceBreak, r as parseFenceSpans, t as findFenceSpanAt } from "./fences-RrqZTgHp.js";
|
|
49
|
-
import { a as chunkText, c as resolveChunkDelivery, d as resolveTextChunkLimit, i as chunkMarkdownTextWithMode, l as resolveChunkMode, o as chunkTextWithMode, r as chunkMarkdownText, t as chunkByNewline, u as resolveChunkNewlinePacking } from "./chunk-
|
|
50
|
-
import { n as resolveMarkdownTableMode } from "./markdown-tables-
|
|
51
|
-
import { a as loadWebMedia, i as getDefaultLocalRoots, o as loadWebMediaRaw } from "./ir-
|
|
52
|
-
import { _ as isNativeCommandsExplicitlyDisabled, a as listChatCommands, b as resolveNativeSkillsEnabled, c as listNativeCommandSpecsForConfig, d as parseCommandArgs, f as resolveCommandArgChoices, g as isCommandFlagEnabled, h as shouldHandleTextCommands, i as isCommandEnabled, l as maybeResolveTextAlias, m as serializeCommandArgs, o as listChatCommandsForConfig, p as resolveCommandArgMenu, r as findCommandByNativeName, s as listNativeCommandSpecs, t as buildCommandTextFromArgs, u as normalizeCommandBody, v as isRestartEnabled, y as resolveNativeCommandsEnabled } from "./commands-registry-
|
|
53
|
-
import { i as AGENT_LANE_SUBAGENT, r as AGENT_LANE_NESTED, t as startUserSessionRun } from "./user-run-recording-
|
|
54
|
-
import { a as getGatewayInstanceId, n as deriveSessionRunId, o as resolveSessionRunStore, r as inferSessionRunKind, t as createSessionRunRecorder } from "./recorder-
|
|
55
|
-
import { a as clearDelayedReleaseHold, c as mergeDelayedAgentTurn, d as WORKSPACE_LANE_DENIED_REASON, f as KeyedAsyncQueue, i as agentTurnIdempotencyKey, l as peekDelayedAgentTurn, n as getAgentTurnRuntime, o as enqueueAgentTurn, r as tryGetAgentTurnRuntime, s as isClaimableAgentTurnWorkId, u as setDelayedReleaseHold } from "./agent-turn-runner-
|
|
56
|
-
import { c as getSkillsSnapshotVersion, i as resolveSkillCommandInvocation, l as pruneExpiredPending, n as listSkillCommandsForAgents, o as getRemoteSkillEligibility, r as listSkillCommandsForWorkspace, s as ensureSkillsWatcher, t as listReservedChatSlashCommandNames, u as resolvePairingPaths } from "./skill-commands-
|
|
57
|
-
import { _ as endModelCall, a as isEmbeddedPiRunActive, b as onAgentEvent, d as handleMessageEnd, f as handleMessageStart, g as createInlineCodeState, h as buildCodeSpanIndex, i as endInFlightEmbeddedAttempt, l as setActiveEmbeddedRun, m as emitEmbeddedAgentEvent, n as beginInFlightEmbeddedAttempt, o as isEmbeddedPiRunStreaming, p as handleMessageUpdate, r as clearActiveEmbeddedRun, s as queueEmbeddedPiMessage, t as abortEmbeddedPiRun, u as waitForEmbeddedPiRunEnd, v as clearAgentRunContext, x as registerAgentRunContext, y as emitAgentEvent } from "./runs-
|
|
58
|
-
import { a as toInternalMessageReceivedContext, c as toPluginMessageReceivedEvent, d as resolveOutboundSessionId, i as toInternalMessagePreprocessedContext, l as fireAndForgetHook, n as createMessageSentEmitter, o as toInternalMessageTranscribedContext, r as deriveInboundMessageHookContext, s as toPluginMessageContext, t as applyMessageSendingHook, u as buildOutboundSessionContext } from "./outbound-message-hooks-
|
|
59
|
-
import { A as createReplyToModeFilterForChannel, C as applyReplyTagsToPayload, D as isRenderablePayload, E as filterMessagingToolMediaDuplicates, M as buildTargetResolverSignature, N as normalizeChannelTargetInput, O as shouldSuppressMessagingToolReplies, P as normalizeTargetForProvider, S as transcriptEntriesToMessages, T as filterMessagingToolDuplicates, _ as resolveContextTokensForModel, a as normalizeOutboundPayloadsForJson, c as loadCombinedSessionStoreForGateway, d as throwIfAborted, f as loadChannelOutboundAdapter, g as lookupContextTokens, h as stripLeadingInboundMetadata, i as normalizeOutboundPayloads, j as resolveReplyToMode, k as shouldSuppressReasoningPayload, l as capArrayByJsonBytes, m as extractToolCallNames, o as normalizeReplyPayloadsForDelivery, p as countToolResults, r as formatOutboundPayloadLog, s as stampReplyActivity, t as deliverOutboundPayloads, u as jsonUtf8Bytes, v as computeBackoff, w as applyReplyThreading, x as readFullTranscriptEntriesFromBackend, y as sleepWithAbort } from "./deliver-
|
|
49
|
+
import { a as chunkText, c as resolveChunkDelivery, d as resolveTextChunkLimit, i as chunkMarkdownTextWithMode, l as resolveChunkMode, o as chunkTextWithMode, r as chunkMarkdownText, t as chunkByNewline, u as resolveChunkNewlinePacking } from "./chunk-CmQRdRrT.js";
|
|
50
|
+
import { n as resolveMarkdownTableMode } from "./markdown-tables-pw9wiTpN.js";
|
|
51
|
+
import { a as loadWebMedia, i as getDefaultLocalRoots, o as loadWebMediaRaw } from "./ir-B0cUtyev.js";
|
|
52
|
+
import { _ as isNativeCommandsExplicitlyDisabled, a as listChatCommands, b as resolveNativeSkillsEnabled, c as listNativeCommandSpecsForConfig, d as parseCommandArgs, f as resolveCommandArgChoices, g as isCommandFlagEnabled, h as shouldHandleTextCommands, i as isCommandEnabled, l as maybeResolveTextAlias, m as serializeCommandArgs, o as listChatCommandsForConfig, p as resolveCommandArgMenu, r as findCommandByNativeName, s as listNativeCommandSpecs, t as buildCommandTextFromArgs, u as normalizeCommandBody, v as isRestartEnabled, y as resolveNativeCommandsEnabled } from "./commands-registry-Bpqy7T_m.js";
|
|
53
|
+
import { i as AGENT_LANE_SUBAGENT, r as AGENT_LANE_NESTED, t as startUserSessionRun } from "./user-run-recording-CMwTVvoc.js";
|
|
54
|
+
import { a as getGatewayInstanceId, n as deriveSessionRunId, o as resolveSessionRunStore, r as inferSessionRunKind, t as createSessionRunRecorder } from "./recorder-9g0HAfTV.js";
|
|
55
|
+
import { a as clearDelayedReleaseHold, c as mergeDelayedAgentTurn, d as WORKSPACE_LANE_DENIED_REASON, f as KeyedAsyncQueue, i as agentTurnIdempotencyKey, l as peekDelayedAgentTurn, n as getAgentTurnRuntime, o as enqueueAgentTurn, r as tryGetAgentTurnRuntime, s as isClaimableAgentTurnWorkId, u as setDelayedReleaseHold } from "./agent-turn-runner-DGW1XTSZ.js";
|
|
56
|
+
import { c as getSkillsSnapshotVersion, i as resolveSkillCommandInvocation, l as pruneExpiredPending, n as listSkillCommandsForAgents, o as getRemoteSkillEligibility, r as listSkillCommandsForWorkspace, s as ensureSkillsWatcher, t as listReservedChatSlashCommandNames, u as resolvePairingPaths } from "./skill-commands-DyocWgx1.js";
|
|
57
|
+
import { _ as endModelCall, a as isEmbeddedPiRunActive, b as onAgentEvent, d as handleMessageEnd, f as handleMessageStart, g as createInlineCodeState, h as buildCodeSpanIndex, i as endInFlightEmbeddedAttempt, l as setActiveEmbeddedRun, m as emitEmbeddedAgentEvent, n as beginInFlightEmbeddedAttempt, o as isEmbeddedPiRunStreaming, p as handleMessageUpdate, r as clearActiveEmbeddedRun, s as queueEmbeddedPiMessage, t as abortEmbeddedPiRun, u as waitForEmbeddedPiRunEnd, v as clearAgentRunContext, x as registerAgentRunContext, y as emitAgentEvent } from "./runs-n_IyEnjI.js";
|
|
58
|
+
import { a as toInternalMessageReceivedContext, c as toPluginMessageReceivedEvent, d as resolveOutboundSessionId, i as toInternalMessagePreprocessedContext, l as fireAndForgetHook, n as createMessageSentEmitter, o as toInternalMessageTranscribedContext, r as deriveInboundMessageHookContext, s as toPluginMessageContext, t as applyMessageSendingHook, u as buildOutboundSessionContext } from "./outbound-message-hooks-BA0MXlRL.js";
|
|
59
|
+
import { A as createReplyToModeFilterForChannel, C as applyReplyTagsToPayload, D as isRenderablePayload, E as filterMessagingToolMediaDuplicates, M as buildTargetResolverSignature, N as normalizeChannelTargetInput, O as shouldSuppressMessagingToolReplies, P as normalizeTargetForProvider, S as transcriptEntriesToMessages, T as filterMessagingToolDuplicates, _ as resolveContextTokensForModel, a as normalizeOutboundPayloadsForJson, c as loadCombinedSessionStoreForGateway, d as throwIfAborted, f as loadChannelOutboundAdapter, g as lookupContextTokens, h as stripLeadingInboundMetadata, i as normalizeOutboundPayloads, j as resolveReplyToMode, k as shouldSuppressReasoningPayload, l as capArrayByJsonBytes, m as extractToolCallNames, o as normalizeReplyPayloadsForDelivery, p as countToolResults, r as formatOutboundPayloadLog, s as stampReplyActivity, t as deliverOutboundPayloads, u as jsonUtf8Bytes, v as computeBackoff, w as applyReplyThreading, x as readFullTranscriptEntriesFromBackend, y as sleepWithAbort } from "./deliver-hdhBsluU.js";
|
|
60
60
|
import { r as normalizeInboundTextNewlines, t as finalizeInboundContext } from "./inbound-context-CYjjc71l.js";
|
|
61
61
|
import { n as wrapFetchWithAbortSignal, t as resolveFetch } from "./fetch-BVyUaG_D.js";
|
|
62
|
-
import { a as createDiscordRetryRunner, i as normalizePollInput, n as recordChannelActivity, t as getChannelActivity } from "./channel-activity-
|
|
62
|
+
import { a as createDiscordRetryRunner, i as normalizePollInput, n as recordChannelActivity, t as getChannelActivity } from "./channel-activity-CgARXGuN.js";
|
|
63
63
|
import { t as buildOutboundMediaLoadOptions } from "./load-options-CkQ1z00p.js";
|
|
64
|
-
import { t as convertMarkdownTables } from "./tables-
|
|
65
|
-
import { n as splitMediaFromOutput, t as parseReplyDirectives } from "./reply-directives-
|
|
66
|
-
import { a as resolveSignalRpcContext, c as streamSignalEvents, n as sendReadReceiptSignal, o as signalCheck, r as sendTypingSignal, s as signalRpcRequest, t as sendMessageSignal } from "./send-
|
|
67
|
-
import { a as formatIMessageChatTarget, c as parseIMessageTarget, i as DEFAULT_IMESSAGE_PROBE_TIMEOUT_MS, o as isAllowedIMessageSender, r as createIMessageRpcClient, s as normalizeIMessageHandle, t as sendMessageIMessage } from "./send-
|
|
68
|
-
import { n as resolveAgentRoute, t as buildAgentSessionKey } from "./resolve-route-
|
|
69
|
-
import { t as createTelegramPollingTransport } from "./proxy-
|
|
70
|
-
import { a as createReplyReferencePlanner, i as resolveSlackThreadTs, n as deliverReplies$3, t as createSlackReplyDeliveryPlan } from "./replies-
|
|
71
|
-
import { t as recordInboundSessionMetaSafe } from "./session-meta-
|
|
72
|
-
import { n as resolveMemorySearchConfig } from "./manager-
|
|
73
|
-
import { m as normalizeExtraMemoryPaths, p as listMemoryFiles } from "./query-expansion-
|
|
64
|
+
import { t as convertMarkdownTables } from "./tables-B_gp2rXG.js";
|
|
65
|
+
import { n as splitMediaFromOutput, t as parseReplyDirectives } from "./reply-directives-DBlsFghT.js";
|
|
66
|
+
import { a as resolveSignalRpcContext, c as streamSignalEvents, n as sendReadReceiptSignal, o as signalCheck, r as sendTypingSignal, s as signalRpcRequest, t as sendMessageSignal } from "./send-BaBji8OV.js";
|
|
67
|
+
import { a as formatIMessageChatTarget, c as parseIMessageTarget, i as DEFAULT_IMESSAGE_PROBE_TIMEOUT_MS, o as isAllowedIMessageSender, r as createIMessageRpcClient, s as normalizeIMessageHandle, t as sendMessageIMessage } from "./send-Blzch_-J.js";
|
|
68
|
+
import { n as resolveAgentRoute, t as buildAgentSessionKey } from "./resolve-route-BVQQmyE-.js";
|
|
69
|
+
import { t as createTelegramPollingTransport } from "./proxy-CPi-EHQf.js";
|
|
70
|
+
import { a as createReplyReferencePlanner, i as resolveSlackThreadTs, n as deliverReplies$3, t as createSlackReplyDeliveryPlan } from "./replies-BbIj7g9M.js";
|
|
71
|
+
import { t as recordInboundSessionMetaSafe } from "./session-meta-n_Hhzi0B.js";
|
|
72
|
+
import { n as resolveMemorySearchConfig } from "./manager-SEkHJEk4.js";
|
|
73
|
+
import { m as normalizeExtraMemoryPaths, p as listMemoryFiles } from "./query-expansion-Cfj6kuQN.js";
|
|
74
74
|
import { createRequire } from "node:module";
|
|
75
75
|
import * as path$1 from "node:path";
|
|
76
76
|
import path, { basename, isAbsolute, join } from "node:path";
|
|
77
|
-
import
|
|
77
|
+
import syncFs, { existsSync, mkdirSync, mkdtempSync, promises, readFileSync, realpathSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
78
78
|
import os, { homedir } from "node:os";
|
|
79
79
|
import json5 from "json5";
|
|
80
|
-
import * as fs$
|
|
81
|
-
import fs
|
|
80
|
+
import * as fs$1 from "node:fs/promises";
|
|
81
|
+
import fs, { open } from "node:fs/promises";
|
|
82
82
|
import { inspect, isDeepStrictEqual, promisify } from "node:util";
|
|
83
83
|
import { execFile, execFileSync, spawn, spawnSync } from "node:child_process";
|
|
84
84
|
import { fileURLToPath } from "node:url";
|
|
@@ -91,7 +91,7 @@ import { EdgeTTS } from "node-edge-tts";
|
|
|
91
91
|
import net from "node:net";
|
|
92
92
|
import { createServer } from "node:http";
|
|
93
93
|
import { ProxyAgent, fetch as fetch$1 } from "undici";
|
|
94
|
-
import WebSocket
|
|
94
|
+
import WebSocket, { WebSocket as WebSocket$1 } from "ws";
|
|
95
95
|
import { Worker } from "node:worker_threads";
|
|
96
96
|
import { createJiti } from "jiti";
|
|
97
97
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
@@ -3105,7 +3105,7 @@ function setPromptSourceCacheEntry(key, entry) {
|
|
|
3105
3105
|
}
|
|
3106
3106
|
function readOpenFileUtf8(fd) {
|
|
3107
3107
|
return new Promise((resolve, reject) => {
|
|
3108
|
-
|
|
3108
|
+
syncFs.readFile(fd, "utf-8", (error, data) => {
|
|
3109
3109
|
if (error) {
|
|
3110
3110
|
reject(error);
|
|
3111
3111
|
return;
|
|
@@ -3116,7 +3116,7 @@ function readOpenFileUtf8(fd) {
|
|
|
3116
3116
|
}
|
|
3117
3117
|
function closeOpenFile(fd) {
|
|
3118
3118
|
return new Promise((resolve, reject) => {
|
|
3119
|
-
|
|
3119
|
+
syncFs.close(fd, (error) => {
|
|
3120
3120
|
if (error) {
|
|
3121
3121
|
reject(error);
|
|
3122
3122
|
return;
|
|
@@ -3525,7 +3525,7 @@ function resolveWorkspaceLane(params) {
|
|
|
3525
3525
|
}
|
|
3526
3526
|
async function pathExists(targetPath) {
|
|
3527
3527
|
try {
|
|
3528
|
-
await fs
|
|
3528
|
+
await fs.access(targetPath);
|
|
3529
3529
|
return true;
|
|
3530
3530
|
} catch {
|
|
3531
3531
|
return false;
|
|
@@ -3533,7 +3533,7 @@ async function pathExists(targetPath) {
|
|
|
3533
3533
|
}
|
|
3534
3534
|
async function getExistingPathState(targetPath) {
|
|
3535
3535
|
try {
|
|
3536
|
-
const stats = await fs
|
|
3536
|
+
const stats = await fs.lstat(targetPath);
|
|
3537
3537
|
if (stats.isSymbolicLink()) return "other";
|
|
3538
3538
|
return stats.isDirectory() ? "directory" : "other";
|
|
3539
3539
|
} catch {
|
|
@@ -3542,7 +3542,7 @@ async function getExistingPathState(targetPath) {
|
|
|
3542
3542
|
}
|
|
3543
3543
|
async function pathLexicallyExists(targetPath) {
|
|
3544
3544
|
try {
|
|
3545
|
-
await fs
|
|
3545
|
+
await fs.lstat(targetPath);
|
|
3546
3546
|
return true;
|
|
3547
3547
|
} catch {
|
|
3548
3548
|
return false;
|
|
@@ -3563,9 +3563,9 @@ async function copyIfMissing(params) {
|
|
|
3563
3563
|
if (!opened.ok) return opened.reason === "path" ? "missing-source" : "invalid";
|
|
3564
3564
|
let content;
|
|
3565
3565
|
try {
|
|
3566
|
-
content =
|
|
3566
|
+
content = syncFs.readFileSync(opened.fd);
|
|
3567
3567
|
} finally {
|
|
3568
|
-
|
|
3568
|
+
syncFs.closeSync(opened.fd);
|
|
3569
3569
|
}
|
|
3570
3570
|
try {
|
|
3571
3571
|
await writeFileWithinRoot({
|
|
@@ -3609,7 +3609,7 @@ async function resolveWorkspaceLaneForTurn(params) {
|
|
|
3609
3609
|
const config = resolveWorkspaceLaneConfig(params.cfg, resolution.agentId);
|
|
3610
3610
|
if ((config?.create ?? "on-first-message") !== "on-first-message") return resolution;
|
|
3611
3611
|
const existed = pathState === "directory";
|
|
3612
|
-
if (!existed) await fs
|
|
3612
|
+
if (!existed) await fs.mkdir(resolution.effectiveWorkspaceDir, { recursive: true });
|
|
3613
3613
|
for (const file of config?.copiedOnCreate ?? DEFAULT_COPIED_ON_CREATE_FILES) {
|
|
3614
3614
|
const decision = await copyIfMissing({
|
|
3615
3615
|
sourceRoot: resolution.personaWorkspaceDir,
|
|
@@ -3933,7 +3933,7 @@ async function resolveOpenClawDocsPath(params) {
|
|
|
3933
3933
|
const workspaceDir = params.workspaceDir?.trim();
|
|
3934
3934
|
if (workspaceDir) {
|
|
3935
3935
|
const workspaceDocs = path.join(workspaceDir, "docs");
|
|
3936
|
-
if (
|
|
3936
|
+
if (syncFs.existsSync(workspaceDocs)) return workspaceDocs;
|
|
3937
3937
|
}
|
|
3938
3938
|
const packageRoot = await resolveOpenClawPackageRoot({
|
|
3939
3939
|
cwd: params.cwd,
|
|
@@ -3942,7 +3942,7 @@ async function resolveOpenClawDocsPath(params) {
|
|
|
3942
3942
|
});
|
|
3943
3943
|
if (packageRoot) {
|
|
3944
3944
|
const packageDocs = path.join(packageRoot, "docs");
|
|
3945
|
-
if (
|
|
3945
|
+
if (syncFs.existsSync(path.join(packageDocs, "docs.json"))) return packageDocs;
|
|
3946
3946
|
}
|
|
3947
3947
|
return DOCS_SITE_URL;
|
|
3948
3948
|
}
|
|
@@ -6416,7 +6416,7 @@ async function imageResult(params) {
|
|
|
6416
6416
|
}, params.label, params.imageSanitization);
|
|
6417
6417
|
}
|
|
6418
6418
|
async function imageResultFromFile(params) {
|
|
6419
|
-
const buf = await fs
|
|
6419
|
+
const buf = await fs.readFile(params.path);
|
|
6420
6420
|
const mimeType = await detectMime({ buffer: buf.slice(0, 256) }) ?? "image/png";
|
|
6421
6421
|
return await imageResult({
|
|
6422
6422
|
label: params.label,
|
|
@@ -7327,7 +7327,7 @@ async function resolveAgentSessionDirs(stateDir) {
|
|
|
7327
7327
|
const agentsDir = path.join(stateDir, "agents");
|
|
7328
7328
|
let entries = [];
|
|
7329
7329
|
try {
|
|
7330
|
-
entries = await fs
|
|
7330
|
+
entries = await fs.readdir(agentsDir, { withFileTypes: true });
|
|
7331
7331
|
} catch (err) {
|
|
7332
7332
|
if (err.code === "ENOENT") return [];
|
|
7333
7333
|
throw err;
|
|
@@ -8789,7 +8789,7 @@ function resolveDefaultIdentityPath() {
|
|
|
8789
8789
|
return path.join(resolveStateDir(), "identity", "device.json");
|
|
8790
8790
|
}
|
|
8791
8791
|
function ensureDir$2(filePath) {
|
|
8792
|
-
|
|
8792
|
+
syncFs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
8793
8793
|
}
|
|
8794
8794
|
const ED25519_SPKI_PREFIX = Buffer.from("302a300506032b6570032100", "hex");
|
|
8795
8795
|
function base64UrlEncode(buf) {
|
|
@@ -8825,8 +8825,8 @@ function generateIdentity() {
|
|
|
8825
8825
|
}
|
|
8826
8826
|
function loadOrCreateDeviceIdentity(filePath = resolveDefaultIdentityPath()) {
|
|
8827
8827
|
try {
|
|
8828
|
-
if (
|
|
8829
|
-
const raw =
|
|
8828
|
+
if (syncFs.existsSync(filePath)) {
|
|
8829
|
+
const raw = syncFs.readFileSync(filePath, "utf8");
|
|
8830
8830
|
const parsed = JSON.parse(raw);
|
|
8831
8831
|
if (parsed?.version === 1 && typeof parsed.deviceId === "string" && typeof parsed.publicKeyPem === "string" && typeof parsed.privateKeyPem === "string") {
|
|
8832
8832
|
const derivedId = fingerprintPublicKey(parsed.publicKeyPem);
|
|
@@ -8835,9 +8835,9 @@ function loadOrCreateDeviceIdentity(filePath = resolveDefaultIdentityPath()) {
|
|
|
8835
8835
|
...parsed,
|
|
8836
8836
|
deviceId: derivedId
|
|
8837
8837
|
};
|
|
8838
|
-
|
|
8838
|
+
syncFs.writeFileSync(filePath, `${JSON.stringify(updated, null, 2)}\n`, { mode: 384 });
|
|
8839
8839
|
try {
|
|
8840
|
-
|
|
8840
|
+
syncFs.chmodSync(filePath, 384);
|
|
8841
8841
|
} catch {}
|
|
8842
8842
|
return {
|
|
8843
8843
|
deviceId: derivedId,
|
|
@@ -8862,9 +8862,9 @@ function loadOrCreateDeviceIdentity(filePath = resolveDefaultIdentityPath()) {
|
|
|
8862
8862
|
privateKeyPem: identity.privateKeyPem,
|
|
8863
8863
|
createdAtMs: Date.now()
|
|
8864
8864
|
};
|
|
8865
|
-
|
|
8865
|
+
syncFs.writeFileSync(filePath, `${JSON.stringify(stored, null, 2)}\n`, { mode: 384 });
|
|
8866
8866
|
try {
|
|
8867
|
-
|
|
8867
|
+
syncFs.chmodSync(filePath, 384);
|
|
8868
8868
|
} catch {}
|
|
8869
8869
|
return identity;
|
|
8870
8870
|
}
|
|
@@ -8887,7 +8887,7 @@ function normalizeFingerprint(input) {
|
|
|
8887
8887
|
const execFileAsync = promisify(execFile);
|
|
8888
8888
|
async function fileExists(filePath) {
|
|
8889
8889
|
try {
|
|
8890
|
-
await fs
|
|
8890
|
+
await fs.access(filePath);
|
|
8891
8891
|
return true;
|
|
8892
8892
|
} catch {
|
|
8893
8893
|
return false;
|
|
@@ -8914,8 +8914,8 @@ async function generateSelfSignedCert(params) {
|
|
|
8914
8914
|
"-subj",
|
|
8915
8915
|
"/CN=openclaw-gateway"
|
|
8916
8916
|
]);
|
|
8917
|
-
await fs
|
|
8918
|
-
await fs
|
|
8917
|
+
await fs.chmod(params.keyPath, 384).catch(() => {});
|
|
8918
|
+
await fs.chmod(params.certPath, 384).catch(() => {});
|
|
8919
8919
|
params.log?.info?.(`gateway tls: generated self-signed cert at ${shortenHomeInString(params.certPath)}`);
|
|
8920
8920
|
}
|
|
8921
8921
|
async function loadGatewayTlsRuntime(cfg, log) {
|
|
@@ -8953,9 +8953,9 @@ async function loadGatewayTlsRuntime(cfg, log) {
|
|
|
8953
8953
|
error: "gateway tls: cert/key missing"
|
|
8954
8954
|
};
|
|
8955
8955
|
try {
|
|
8956
|
-
const cert = await fs
|
|
8957
|
-
const key = await fs
|
|
8958
|
-
const ca = caPath ? await fs
|
|
8956
|
+
const cert = await fs.readFile(certPath, "utf8");
|
|
8957
|
+
const key = await fs.readFile(keyPath, "utf8");
|
|
8958
|
+
const ca = caPath ? await fs.readFile(caPath, "utf8") : void 0;
|
|
8959
8959
|
const fingerprintSha256 = normalizeFingerprint(new X509Certificate(cert).fingerprint256 ?? "");
|
|
8960
8960
|
if (!fingerprintSha256) return {
|
|
8961
8961
|
enabled: false,
|
|
@@ -9056,8 +9056,8 @@ function resolveDeviceAuthPath(env = process.env) {
|
|
|
9056
9056
|
}
|
|
9057
9057
|
function readStore(filePath) {
|
|
9058
9058
|
try {
|
|
9059
|
-
if (!
|
|
9060
|
-
const raw =
|
|
9059
|
+
if (!syncFs.existsSync(filePath)) return null;
|
|
9060
|
+
const raw = syncFs.readFileSync(filePath, "utf8");
|
|
9061
9061
|
const parsed = JSON.parse(raw);
|
|
9062
9062
|
if (parsed?.version !== 1 || typeof parsed.deviceId !== "string") return null;
|
|
9063
9063
|
if (!parsed.tokens || typeof parsed.tokens !== "object") return null;
|
|
@@ -9067,10 +9067,10 @@ function readStore(filePath) {
|
|
|
9067
9067
|
}
|
|
9068
9068
|
}
|
|
9069
9069
|
function writeStore(filePath, store) {
|
|
9070
|
-
|
|
9071
|
-
|
|
9070
|
+
syncFs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
9071
|
+
syncFs.writeFileSync(filePath, `${JSON.stringify(store, null, 2)}\n`, { mode: 384 });
|
|
9072
9072
|
try {
|
|
9073
|
-
|
|
9073
|
+
syncFs.chmodSync(filePath, 384);
|
|
9074
9074
|
} catch {}
|
|
9075
9075
|
}
|
|
9076
9076
|
function loadDeviceAuthToken(params) {
|
|
@@ -11465,7 +11465,7 @@ var GatewayClient = class {
|
|
|
11465
11465
|
if (fingerprint !== expected) return /* @__PURE__ */ new Error("gateway tls fingerprint mismatch");
|
|
11466
11466
|
});
|
|
11467
11467
|
}
|
|
11468
|
-
this.ws = new WebSocket(url, wsOptions);
|
|
11468
|
+
this.ws = new WebSocket$1(url, wsOptions);
|
|
11469
11469
|
this.ws.on("open", () => {
|
|
11470
11470
|
if (url.startsWith("wss://") && this.opts.tlsFingerprint) {
|
|
11471
11471
|
const tlsError = this.validateTlsFingerprint();
|
|
@@ -11661,7 +11661,7 @@ var GatewayClient = class {
|
|
|
11661
11661
|
const connectChallengeTimeoutMs = typeof rawConnectDelayMs === "number" && Number.isFinite(rawConnectDelayMs) ? Math.max(250, Math.min(1e4, rawConnectDelayMs)) : 2e3;
|
|
11662
11662
|
if (this.connectTimer) clearTimeout(this.connectTimer);
|
|
11663
11663
|
this.connectTimer = setTimeout(() => {
|
|
11664
|
-
if (this.connectSent || this.ws?.readyState !== WebSocket.OPEN) return;
|
|
11664
|
+
if (this.connectSent || this.ws?.readyState !== WebSocket$1.OPEN) return;
|
|
11665
11665
|
this.opts.onConnectError?.(/* @__PURE__ */ new Error("gateway connect challenge timeout"));
|
|
11666
11666
|
this.ws?.close(1008, "connect challenge timeout");
|
|
11667
11667
|
}, connectChallengeTimeoutMs);
|
|
@@ -11703,7 +11703,7 @@ var GatewayClient = class {
|
|
|
11703
11703
|
return null;
|
|
11704
11704
|
}
|
|
11705
11705
|
async request(method, params, opts) {
|
|
11706
|
-
if (!this.ws || this.ws.readyState !== WebSocket.OPEN) throw new Error("gateway not connected");
|
|
11706
|
+
if (!this.ws || this.ws.readyState !== WebSocket$1.OPEN) throw new Error("gateway not connected");
|
|
11707
11707
|
const id = randomUUID();
|
|
11708
11708
|
const frame = {
|
|
11709
11709
|
type: "req",
|
|
@@ -13178,7 +13178,7 @@ async function routeReply(params) {
|
|
|
13178
13178
|
const resolvedReplyToId = replyToId ?? (channelId === "slack" && threadId != null && threadId !== "" ? String(threadId) : void 0);
|
|
13179
13179
|
const resolvedThreadId = channelId === "slack" ? null : threadId ?? null;
|
|
13180
13180
|
try {
|
|
13181
|
-
const { deliverOutboundPayloads } = await import("./deliver-
|
|
13181
|
+
const { deliverOutboundPayloads } = await import("./deliver-hdhBsluU.js").then((n) => n.n);
|
|
13182
13182
|
const outboundSession = buildOutboundSessionContext({
|
|
13183
13183
|
cfg,
|
|
13184
13184
|
agentId: resolvedAgentId,
|
|
@@ -14736,7 +14736,7 @@ async function sendTranscriptEcho(params) {
|
|
|
14736
14736
|
}
|
|
14737
14737
|
const text = formatEchoTranscript(transcript, params.format ?? DEFAULT_ECHO_TRANSCRIPT_FORMAT);
|
|
14738
14738
|
try {
|
|
14739
|
-
const { deliverOutboundPayloads } = await import("./deliver-
|
|
14739
|
+
const { deliverOutboundPayloads } = await import("./deliver-hdhBsluU.js").then((n) => n.n);
|
|
14740
14740
|
await deliverOutboundPayloads({
|
|
14741
14741
|
cfg,
|
|
14742
14742
|
channel: normalizedChannel,
|
|
@@ -19023,7 +19023,7 @@ function mergeLegacyAgent(current, legacy) {
|
|
|
19023
19023
|
}
|
|
19024
19024
|
function ensureDir$1(filePath) {
|
|
19025
19025
|
const dir = path.dirname(filePath);
|
|
19026
|
-
|
|
19026
|
+
syncFs.mkdirSync(dir, { recursive: true });
|
|
19027
19027
|
}
|
|
19028
19028
|
function coerceAllowlistEntries(allowlist) {
|
|
19029
19029
|
if (!Array.isArray(allowlist) || allowlist.length === 0) return Array.isArray(allowlist) ? allowlist : void 0;
|
|
@@ -19093,11 +19093,11 @@ function generateToken() {
|
|
|
19093
19093
|
function loadExecApprovals() {
|
|
19094
19094
|
const filePath = resolveExecApprovalsPath();
|
|
19095
19095
|
try {
|
|
19096
|
-
if (!
|
|
19096
|
+
if (!syncFs.existsSync(filePath)) return normalizeExecApprovals({
|
|
19097
19097
|
version: 1,
|
|
19098
19098
|
agents: {}
|
|
19099
19099
|
});
|
|
19100
|
-
const raw =
|
|
19100
|
+
const raw = syncFs.readFileSync(filePath, "utf8");
|
|
19101
19101
|
const parsed = JSON.parse(raw);
|
|
19102
19102
|
if (parsed?.version !== 1) return normalizeExecApprovals({
|
|
19103
19103
|
version: 1,
|
|
@@ -19114,9 +19114,9 @@ function loadExecApprovals() {
|
|
|
19114
19114
|
function saveExecApprovals(file) {
|
|
19115
19115
|
const filePath = resolveExecApprovalsPath();
|
|
19116
19116
|
ensureDir$1(filePath);
|
|
19117
|
-
|
|
19117
|
+
syncFs.writeFileSync(filePath, `${JSON.stringify(file, null, 2)}\n`, { mode: 384 });
|
|
19118
19118
|
try {
|
|
19119
|
-
|
|
19119
|
+
syncFs.chmodSync(filePath, 384);
|
|
19120
19120
|
} catch {}
|
|
19121
19121
|
}
|
|
19122
19122
|
function ensureExecApprovals() {
|
|
@@ -19682,18 +19682,18 @@ function peekSystemEventEntries(sessionKey) {
|
|
|
19682
19682
|
function resolvePowerShellPath() {
|
|
19683
19683
|
const programFiles = process.env.ProgramFiles || process.env.PROGRAMFILES || "C:\\Program Files";
|
|
19684
19684
|
const pwsh7 = path.join(programFiles, "PowerShell", "7", "pwsh.exe");
|
|
19685
|
-
if (
|
|
19685
|
+
if (syncFs.existsSync(pwsh7)) return pwsh7;
|
|
19686
19686
|
const programW6432 = process.env.ProgramW6432;
|
|
19687
19687
|
if (programW6432 && programW6432 !== programFiles) {
|
|
19688
19688
|
const pwsh7Alt = path.join(programW6432, "PowerShell", "7", "pwsh.exe");
|
|
19689
|
-
if (
|
|
19689
|
+
if (syncFs.existsSync(pwsh7Alt)) return pwsh7Alt;
|
|
19690
19690
|
}
|
|
19691
19691
|
const pwshInPath = resolveShellFromPath("pwsh");
|
|
19692
19692
|
if (pwshInPath) return pwshInPath;
|
|
19693
19693
|
const systemRoot = process.env.SystemRoot || process.env.WINDIR;
|
|
19694
19694
|
if (systemRoot) {
|
|
19695
19695
|
const candidate = path.join(systemRoot, "System32", "WindowsPowerShell", "v1.0", "powershell.exe");
|
|
19696
|
-
if (
|
|
19696
|
+
if (syncFs.existsSync(candidate)) return candidate;
|
|
19697
19697
|
}
|
|
19698
19698
|
return "powershell.exe";
|
|
19699
19699
|
}
|
|
@@ -19731,7 +19731,7 @@ function resolveShellFromPath(name) {
|
|
|
19731
19731
|
for (const entry of entries) {
|
|
19732
19732
|
const candidate = path.join(entry, name);
|
|
19733
19733
|
try {
|
|
19734
|
-
|
|
19734
|
+
syncFs.accessSync(candidate, syncFs.constants.X_OK);
|
|
19735
19735
|
return candidate;
|
|
19736
19736
|
} catch {}
|
|
19737
19737
|
}
|
|
@@ -20669,7 +20669,7 @@ async function resolveSandboxWorkdir(params) {
|
|
|
20669
20669
|
cwd: process.cwd(),
|
|
20670
20670
|
root: params.sandbox.workspaceDir
|
|
20671
20671
|
});
|
|
20672
|
-
if (!(await fs
|
|
20672
|
+
if (!(await fs.stat(resolved.resolved)).isDirectory()) throw new Error("workdir is not a directory");
|
|
20673
20673
|
const relative = resolved.relative ? resolved.relative.split(path.sep).join(path.posix.sep) : "";
|
|
20674
20674
|
const containerWorkdir = relative ? path.posix.join(params.sandbox.containerWorkdir, relative) : params.sandbox.containerWorkdir;
|
|
20675
20675
|
return {
|
|
@@ -22059,13 +22059,13 @@ async function validateScriptFileForShellBleed(params) {
|
|
|
22059
22059
|
cwd: params.workdir,
|
|
22060
22060
|
root: params.workdir
|
|
22061
22061
|
});
|
|
22062
|
-
stat = await fs
|
|
22062
|
+
stat = await fs.stat(absPath);
|
|
22063
22063
|
} catch {
|
|
22064
22064
|
return;
|
|
22065
22065
|
}
|
|
22066
22066
|
if (!stat.isFile()) return;
|
|
22067
22067
|
if (stat.size > 512 * 1024) return;
|
|
22068
|
-
const content = await fs
|
|
22068
|
+
const content = await fs.readFile(absPath, "utf-8");
|
|
22069
22069
|
const first = /\$[A-Z_][A-Z0-9_]{1,}/g.exec(content);
|
|
22070
22070
|
if (first) {
|
|
22071
22071
|
const idx = first.index;
|
|
@@ -23508,7 +23508,7 @@ function walkUpFrom(startDir, opts, resolveAtDir) {
|
|
|
23508
23508
|
function hasGitMarker(repoRoot) {
|
|
23509
23509
|
const gitPath = path.join(repoRoot, ".git");
|
|
23510
23510
|
try {
|
|
23511
|
-
const stat =
|
|
23511
|
+
const stat = syncFs.statSync(gitPath);
|
|
23512
23512
|
return stat.isDirectory() || stat.isFile();
|
|
23513
23513
|
} catch {
|
|
23514
23514
|
return false;
|
|
@@ -23520,10 +23520,10 @@ function findGitRoot(startDir, opts = {}) {
|
|
|
23520
23520
|
function resolveGitDirFromMarker(repoRoot) {
|
|
23521
23521
|
const gitPath = path.join(repoRoot, ".git");
|
|
23522
23522
|
try {
|
|
23523
|
-
const stat =
|
|
23523
|
+
const stat = syncFs.statSync(gitPath);
|
|
23524
23524
|
if (stat.isDirectory()) return gitPath;
|
|
23525
23525
|
if (!stat.isFile()) return null;
|
|
23526
|
-
const match =
|
|
23526
|
+
const match = syncFs.readFileSync(gitPath, "utf-8").match(/gitdir:\s*(.+)/i);
|
|
23527
23527
|
if (!match?.[1]) return null;
|
|
23528
23528
|
return path.resolve(repoRoot, match[1].trim());
|
|
23529
23529
|
} catch {
|
|
@@ -23590,7 +23590,7 @@ const resolveCommitHash = (options = {}) => {
|
|
|
23590
23590
|
cachedCommit = null;
|
|
23591
23591
|
return cachedCommit;
|
|
23592
23592
|
}
|
|
23593
|
-
const head =
|
|
23593
|
+
const head = syncFs.readFileSync(headPath, "utf-8").trim();
|
|
23594
23594
|
if (!head) {
|
|
23595
23595
|
cachedCommit = null;
|
|
23596
23596
|
return cachedCommit;
|
|
@@ -23598,7 +23598,7 @@ const resolveCommitHash = (options = {}) => {
|
|
|
23598
23598
|
if (head.startsWith("ref:")) {
|
|
23599
23599
|
const ref = head.replace(/^ref:\s*/i, "").trim();
|
|
23600
23600
|
const refPath = path.resolve(path.dirname(headPath), ref);
|
|
23601
|
-
cachedCommit = formatCommit(
|
|
23601
|
+
cachedCommit = formatCommit(syncFs.readFileSync(refPath, "utf-8").trim());
|
|
23602
23602
|
return cachedCommit;
|
|
23603
23603
|
}
|
|
23604
23604
|
cachedCommit = formatCommit(head);
|
|
@@ -28198,7 +28198,7 @@ function resolveRepoRoot(params) {
|
|
|
28198
28198
|
const configured = params.config?.agents?.defaults?.repoRoot?.trim();
|
|
28199
28199
|
if (configured) try {
|
|
28200
28200
|
const resolved = path.resolve(configured);
|
|
28201
|
-
if (
|
|
28201
|
+
if (syncFs.statSync(resolved).isDirectory()) return resolved;
|
|
28202
28202
|
} catch {}
|
|
28203
28203
|
const candidates = [params.workspaceDir, params.cwd].map((value) => value?.trim()).filter(Boolean);
|
|
28204
28204
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -28715,7 +28715,7 @@ async function readForwardAndSort(query, sessionId) {
|
|
|
28715
28715
|
//#region src/auto-reply/reply/commands-export-session.ts
|
|
28716
28716
|
const EXPORT_HTML_DIR = path.join(path.dirname(fileURLToPath(import.meta.url)), "export-html");
|
|
28717
28717
|
function loadTemplate(fileName) {
|
|
28718
|
-
return
|
|
28718
|
+
return syncFs.readFileSync(path.join(EXPORT_HTML_DIR, fileName), "utf-8");
|
|
28719
28719
|
}
|
|
28720
28720
|
function generateHtml(sessionData) {
|
|
28721
28721
|
const template = loadTemplate("template.html");
|
|
@@ -28818,8 +28818,8 @@ async function buildExportSessionReply(params) {
|
|
|
28818
28818
|
const defaultFileName = `openclaw-session-${entry.sessionId.slice(0, 8)}-${timestamp}.html`;
|
|
28819
28819
|
const outputPath = args.outputPath ? path.resolve(args.outputPath.startsWith("~") ? args.outputPath.replace("~", process.env.HOME ?? "") : args.outputPath) : path.join(params.workspaceDir, defaultFileName);
|
|
28820
28820
|
const outputDir = path.dirname(outputPath);
|
|
28821
|
-
if (!
|
|
28822
|
-
|
|
28821
|
+
if (!syncFs.existsSync(outputDir)) syncFs.mkdirSync(outputDir, { recursive: true });
|
|
28822
|
+
syncFs.writeFileSync(outputPath, html, "utf-8");
|
|
28823
28823
|
const relativePath = path.relative(params.workspaceDir, outputPath);
|
|
28824
28824
|
return { text: [
|
|
28825
28825
|
"✅ Session exported!",
|
|
@@ -28994,8 +28994,8 @@ function resolveZaiApiKey() {
|
|
|
28994
28994
|
}
|
|
28995
28995
|
try {
|
|
28996
28996
|
const authPath = path.join(resolveRequiredHomeDir(process.env, os.homedir), ".pi", "agent", "auth.json");
|
|
28997
|
-
if (!
|
|
28998
|
-
const data = JSON.parse(
|
|
28997
|
+
if (!syncFs.existsSync(authPath)) return;
|
|
28998
|
+
const data = JSON.parse(syncFs.readFileSync(authPath, "utf-8"));
|
|
28999
28999
|
return data["z-ai"]?.access || data.zai?.access;
|
|
29000
29000
|
} catch {
|
|
29001
29001
|
return;
|
|
@@ -30812,7 +30812,7 @@ function shouldPersistAnyBindingState() {
|
|
|
30812
30812
|
}
|
|
30813
30813
|
function shouldPersistBindingMutations() {
|
|
30814
30814
|
if (shouldPersistAnyBindingState()) return true;
|
|
30815
|
-
return
|
|
30815
|
+
return syncFs.existsSync(resolveThreadBindingsPath());
|
|
30816
30816
|
}
|
|
30817
30817
|
function saveBindingsToDisk(params = {}) {
|
|
30818
30818
|
if (!params.force && !shouldPersistAnyBindingState()) return;
|
|
@@ -33419,7 +33419,7 @@ function normalizeSessionKey(value) {
|
|
|
33419
33419
|
}
|
|
33420
33420
|
function readSessionStore(storePath) {
|
|
33421
33421
|
try {
|
|
33422
|
-
const raw =
|
|
33422
|
+
const raw = syncFs.readFileSync(storePath, "utf-8");
|
|
33423
33423
|
const parsed = json5.parse(raw);
|
|
33424
33424
|
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) return parsed;
|
|
33425
33425
|
} catch {}
|
|
@@ -35089,7 +35089,7 @@ async function createModelSelectionState(params) {
|
|
|
35089
35089
|
}
|
|
35090
35090
|
}
|
|
35091
35091
|
if (sessionEntry && sessionStore && sessionKey && sessionEntry.authProfileOverride) {
|
|
35092
|
-
const { ensureAuthProfileStore } = await import("./model-selection-
|
|
35092
|
+
const { ensureAuthProfileStore } = await import("./model-selection-BTxcwzNF.js").then((n) => n.P);
|
|
35093
35093
|
const profile = ensureAuthProfileStore(void 0, { allowKeychainPrompt: false }).profiles[sessionEntry.authProfileOverride];
|
|
35094
35094
|
const providerKey = normalizeProviderId(provider);
|
|
35095
35095
|
if (!profile || normalizeProviderId(profile.provider) !== providerKey) await clearSessionAuthProfileOverride({
|
|
@@ -38611,7 +38611,7 @@ function asBoolean(value) {
|
|
|
38611
38611
|
}
|
|
38612
38612
|
function resolveTempPathParts(opts) {
|
|
38613
38613
|
const tmpDir = opts.tmpDir ?? resolvePreferredOpenClawTmpDir();
|
|
38614
|
-
if (!opts.tmpDir)
|
|
38614
|
+
if (!opts.tmpDir) syncFs.mkdirSync(tmpDir, {
|
|
38615
38615
|
recursive: true,
|
|
38616
38616
|
mode: 448
|
|
38617
38617
|
});
|
|
@@ -38697,7 +38697,7 @@ async function writeUrlToFile(filePath, url, opts) {
|
|
|
38697
38697
|
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}`);
|
|
38698
38698
|
const body = res.body;
|
|
38699
38699
|
if (!body) throw new Error(`failed to download ${url}: empty response body`);
|
|
38700
|
-
const fileHandle = await fs$
|
|
38700
|
+
const fileHandle = await fs$1.open(filePath, "w");
|
|
38701
38701
|
let thrown;
|
|
38702
38702
|
try {
|
|
38703
38703
|
const reader = body.getReader();
|
|
@@ -38715,7 +38715,7 @@ async function writeUrlToFile(filePath, url, opts) {
|
|
|
38715
38715
|
await fileHandle.close();
|
|
38716
38716
|
}
|
|
38717
38717
|
if (thrown) {
|
|
38718
|
-
await fs$
|
|
38718
|
+
await fs$1.unlink(filePath).catch(() => {});
|
|
38719
38719
|
throw thrown;
|
|
38720
38720
|
}
|
|
38721
38721
|
} finally {
|
|
@@ -38728,7 +38728,7 @@ async function writeUrlToFile(filePath, url, opts) {
|
|
|
38728
38728
|
}
|
|
38729
38729
|
async function writeBase64ToFile(filePath, base64) {
|
|
38730
38730
|
const buf = Buffer.from(base64, "base64");
|
|
38731
|
-
await fs$
|
|
38731
|
+
await fs$1.writeFile(filePath, buf);
|
|
38732
38732
|
return {
|
|
38733
38733
|
path: filePath,
|
|
38734
38734
|
bytes: buf.length
|
|
@@ -38813,7 +38813,7 @@ async function readJsonlFromPath(jsonlPath) {
|
|
|
38813
38813
|
if (shouldLogVerbose()) logVerbose(`Blocked canvas jsonlPath outside allowed roots: ${resolved}`);
|
|
38814
38814
|
throw new Error("jsonlPath outside allowed roots");
|
|
38815
38815
|
}
|
|
38816
|
-
const canonical = await fs
|
|
38816
|
+
const canonical = await fs.realpath(resolved).catch(() => resolved);
|
|
38817
38817
|
if (!isInboundPathAllowed({
|
|
38818
38818
|
filePath: canonical,
|
|
38819
38819
|
roots
|
|
@@ -38821,7 +38821,7 @@ async function readJsonlFromPath(jsonlPath) {
|
|
|
38821
38821
|
if (shouldLogVerbose()) logVerbose(`Blocked canvas jsonlPath outside allowed roots: ${canonical}`);
|
|
38822
38822
|
throw new Error("jsonlPath outside allowed roots");
|
|
38823
38823
|
}
|
|
38824
|
-
return await fs
|
|
38824
|
+
return await fs.readFile(canonical, "utf8");
|
|
38825
38825
|
}
|
|
38826
38826
|
const CanvasToolSchema = Type.Object({
|
|
38827
38827
|
action: stringEnum(CANVAS_ACTIONS),
|
|
@@ -39754,12 +39754,12 @@ function resolveRestartSentinelPath(env = process.env) {
|
|
|
39754
39754
|
}
|
|
39755
39755
|
async function writeRestartSentinel(payload, env = process.env) {
|
|
39756
39756
|
const filePath = resolveRestartSentinelPath(env);
|
|
39757
|
-
await fs
|
|
39757
|
+
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
|
39758
39758
|
const data = {
|
|
39759
39759
|
version: 1,
|
|
39760
39760
|
payload
|
|
39761
39761
|
};
|
|
39762
|
-
await fs
|
|
39762
|
+
await fs.writeFile(filePath, `${JSON.stringify(data, null, 2)}\n`, "utf-8");
|
|
39763
39763
|
return filePath;
|
|
39764
39764
|
}
|
|
39765
39765
|
|
|
@@ -42201,9 +42201,9 @@ function loadExternalCatalogEntries(options) {
|
|
|
42201
42201
|
const entries = [];
|
|
42202
42202
|
for (const rawPath of paths) {
|
|
42203
42203
|
const resolved = resolveUserPath(rawPath);
|
|
42204
|
-
if (!
|
|
42204
|
+
if (!syncFs.existsSync(resolved)) continue;
|
|
42205
42205
|
try {
|
|
42206
|
-
const payload = JSON.parse(
|
|
42206
|
+
const payload = JSON.parse(syncFs.readFileSync(resolved, "utf-8"));
|
|
42207
42207
|
entries.push(...parseCatalogEntries(payload));
|
|
42208
42208
|
} catch {}
|
|
42209
42209
|
}
|
|
@@ -51257,18 +51257,18 @@ function appendImagePathsToPrompt(prompt, paths) {
|
|
|
51257
51257
|
return `${trimmed}${trimmed ? "\n\n" : ""}${paths.join("\n")}`;
|
|
51258
51258
|
}
|
|
51259
51259
|
async function writeCliImages(images) {
|
|
51260
|
-
const tempDir = await fs
|
|
51260
|
+
const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-cli-images-"));
|
|
51261
51261
|
const paths = [];
|
|
51262
51262
|
for (let i = 0; i < images.length; i += 1) {
|
|
51263
51263
|
const image = images[i];
|
|
51264
51264
|
const ext = resolveImageExtension(image.mimeType);
|
|
51265
51265
|
const filePath = path.join(tempDir, `image-${i + 1}.${ext}`);
|
|
51266
51266
|
const buffer = Buffer.from(image.data, "base64");
|
|
51267
|
-
await fs
|
|
51267
|
+
await fs.writeFile(filePath, buffer, { mode: 384 });
|
|
51268
51268
|
paths.push(filePath);
|
|
51269
51269
|
}
|
|
51270
51270
|
const cleanup = async () => {
|
|
51271
|
-
await fs
|
|
51271
|
+
await fs.rm(tempDir, {
|
|
51272
51272
|
recursive: true,
|
|
51273
51273
|
force: true
|
|
51274
51274
|
});
|
|
@@ -53650,9 +53650,9 @@ async function readPostCompactionContext(workspaceDir) {
|
|
|
53650
53650
|
if (!opened.ok) return null;
|
|
53651
53651
|
const sections = extractSections((() => {
|
|
53652
53652
|
try {
|
|
53653
|
-
return
|
|
53653
|
+
return syncFs.readFileSync(opened.fd, "utf-8");
|
|
53654
53654
|
} finally {
|
|
53655
|
-
|
|
53655
|
+
syncFs.closeSync(opened.fd);
|
|
53656
53656
|
}
|
|
53657
53657
|
})(), ["Session Startup", "Red Lines"]);
|
|
53658
53658
|
if (sections.length === 0) return null;
|
|
@@ -54881,7 +54881,7 @@ async function deliverSessionMaintenanceWarning(params) {
|
|
|
54881
54881
|
return;
|
|
54882
54882
|
}
|
|
54883
54883
|
try {
|
|
54884
|
-
const { deliverOutboundPayloads } = await import("./deliver-
|
|
54884
|
+
const { deliverOutboundPayloads } = await import("./deliver-hdhBsluU.js").then((n) => n.n);
|
|
54885
54885
|
const outboundSession = buildOutboundSessionContext({
|
|
54886
54886
|
cfg: params.cfg,
|
|
54887
54887
|
sessionKey: params.sessionKey
|
|
@@ -55838,7 +55838,7 @@ async function stageSandboxMedia(params) {
|
|
|
55838
55838
|
const remoteMediaCacheDir = ctx.MediaRemoteHost ? path.join(workspaceDir, ".openclaw", "media", "remote-cache", sessionKey) : null;
|
|
55839
55839
|
const effectiveWorkspaceDir = sandbox?.workspaceDir ?? remoteMediaCacheDir;
|
|
55840
55840
|
if (!effectiveWorkspaceDir) return;
|
|
55841
|
-
await fs
|
|
55841
|
+
await fs.mkdir(effectiveWorkspaceDir, { recursive: true });
|
|
55842
55842
|
const remoteAttachmentRoots = resolveIMessageRemoteAttachmentRoots({
|
|
55843
55843
|
cfg,
|
|
55844
55844
|
accountId: ctx.AccountId
|
|
@@ -55897,8 +55897,8 @@ async function stageLocalFileIntoRoot(params) {
|
|
|
55897
55897
|
}
|
|
55898
55898
|
async function stageRemoteFileIntoRoot(params) {
|
|
55899
55899
|
const tmpRoot = resolvePreferredOpenClawTmpDir();
|
|
55900
|
-
await fs
|
|
55901
|
-
const tmpDir = await fs
|
|
55900
|
+
await fs.mkdir(tmpRoot, { recursive: true });
|
|
55901
|
+
const tmpDir = await fs.mkdtemp(path.join(tmpRoot, "stage-sandbox-media-"));
|
|
55902
55902
|
const tmpPath = path.join(tmpDir, "download");
|
|
55903
55903
|
try {
|
|
55904
55904
|
await scpFile(params.remoteHost, params.remotePath, tmpPath);
|
|
@@ -55909,7 +55909,7 @@ async function stageRemoteFileIntoRoot(params) {
|
|
|
55909
55909
|
maxBytes: params.maxBytes
|
|
55910
55910
|
});
|
|
55911
55911
|
} finally {
|
|
55912
|
-
await fs
|
|
55912
|
+
await fs.rm(tmpDir, {
|
|
55913
55913
|
recursive: true,
|
|
55914
55914
|
force: true
|
|
55915
55915
|
}).catch(() => {});
|
|
@@ -57074,7 +57074,7 @@ async function runModelGate(spec, ctx) {
|
|
|
57074
57074
|
const isolatedSessionId = randomNonce;
|
|
57075
57075
|
const isolatedRunId = randomNonce;
|
|
57076
57076
|
const tmpBaseDir = resolvePreferredOpenClawTmpDir();
|
|
57077
|
-
tmpDir = await fs
|
|
57077
|
+
tmpDir = await fs.mkdtemp(path.join(tmpBaseDir, "wake-gate-"));
|
|
57078
57078
|
const workspaceDir = tmpDir;
|
|
57079
57079
|
const prompt = spec.prompt ?? DEFAULT_MODEL_PROMPT;
|
|
57080
57080
|
const timeoutMs = spec.timeoutMs ?? DEFAULT_MODEL_TIMEOUT_MS;
|
|
@@ -57132,7 +57132,7 @@ async function runModelGate(spec, ctx) {
|
|
|
57132
57132
|
log$35.warn("model gate error", { error: err instanceof Error ? err.message : String(err) });
|
|
57133
57133
|
return { wake: false };
|
|
57134
57134
|
} finally {
|
|
57135
|
-
if (tmpDir) await fs
|
|
57135
|
+
if (tmpDir) await fs.rm(tmpDir, {
|
|
57136
57136
|
recursive: true,
|
|
57137
57137
|
force: true
|
|
57138
57138
|
}).catch(() => void 0);
|
|
@@ -57362,7 +57362,7 @@ async function resolveHeartbeatPreflight(params) {
|
|
|
57362
57362
|
const workspaceDir = resolveAgentWorkspaceDir(params.cfg, params.agentId);
|
|
57363
57363
|
const heartbeatFilePath = path.join(workspaceDir, DEFAULT_HEARTBEAT_FILENAME);
|
|
57364
57364
|
try {
|
|
57365
|
-
if (isHeartbeatContentEffectivelyEmpty(await fs
|
|
57365
|
+
if (isHeartbeatContentEffectivelyEmpty(await fs.readFile(heartbeatFilePath, "utf-8"))) return {
|
|
57366
57366
|
...basePreflight,
|
|
57367
57367
|
skipReason: "empty-heartbeat-file"
|
|
57368
57368
|
};
|
|
@@ -64580,8 +64580,8 @@ async function describeStickerImage(params) {
|
|
|
64580
64580
|
const { provider, model } = resolved;
|
|
64581
64581
|
logVerbose(`telegram: describing sticker with ${provider}/${model}`);
|
|
64582
64582
|
try {
|
|
64583
|
-
const buffer = await fs
|
|
64584
|
-
const { describeImageWithModel } = await import("./provider-image-
|
|
64583
|
+
const buffer = await fs.readFile(imagePath);
|
|
64584
|
+
const { describeImageWithModel } = await import("./provider-image-BoLaTMGA.js").then((n) => n.n);
|
|
64585
64585
|
return (await describeImageWithModel({
|
|
64586
64586
|
buffer,
|
|
64587
64587
|
fileName: "sticker.webp",
|
|
@@ -66294,7 +66294,7 @@ async function resolveDiscordPreflightAudioMentionContext(params) {
|
|
|
66294
66294
|
let transcript;
|
|
66295
66295
|
let carry;
|
|
66296
66296
|
if (needsPreflightTranscription) try {
|
|
66297
|
-
const { transcribeFirstAudio } = await import("./audio-preflight-
|
|
66297
|
+
const { transcribeFirstAudio } = await import("./audio-preflight-5kfGz36M.js");
|
|
66298
66298
|
const uploadable = audioAttachments.filter((att) => typeof att.url === "string" && att.url.length > 0);
|
|
66299
66299
|
if (uploadable.length > 0) {
|
|
66300
66300
|
const preflight = await transcribeFirstAudio({
|
|
@@ -67755,7 +67755,7 @@ function identityHasValues(identity) {
|
|
|
67755
67755
|
}
|
|
67756
67756
|
function loadIdentityFromFile(identityPath) {
|
|
67757
67757
|
try {
|
|
67758
|
-
const parsed = parseIdentityMarkdown(
|
|
67758
|
+
const parsed = parseIdentityMarkdown(syncFs.readFileSync(identityPath, "utf-8"));
|
|
67759
67759
|
if (!identityHasValues(parsed)) return null;
|
|
67760
67760
|
return parsed;
|
|
67761
67761
|
} catch {
|
|
@@ -67779,7 +67779,7 @@ function resolveAvatarSource(cfg, agentId) {
|
|
|
67779
67779
|
}
|
|
67780
67780
|
function resolveExistingPath(value) {
|
|
67781
67781
|
try {
|
|
67782
|
-
return
|
|
67782
|
+
return syncFs.realpathSync(value);
|
|
67783
67783
|
} catch {
|
|
67784
67784
|
return path.resolve(value);
|
|
67785
67785
|
}
|
|
@@ -67797,7 +67797,7 @@ function resolveLocalAvatarPath(params) {
|
|
|
67797
67797
|
reason: "unsupported_extension"
|
|
67798
67798
|
};
|
|
67799
67799
|
try {
|
|
67800
|
-
const stat =
|
|
67800
|
+
const stat = syncFs.statSync(realPath);
|
|
67801
67801
|
if (!stat.isFile()) return {
|
|
67802
67802
|
ok: false,
|
|
67803
67803
|
reason: "missing"
|
|
@@ -73500,23 +73500,23 @@ function createDefaultDeps() {
|
|
|
73500
73500
|
};
|
|
73501
73501
|
},
|
|
73502
73502
|
sendMessageTelegram: async (...args) => {
|
|
73503
|
-
const { sendMessageTelegram } = await import("./send-
|
|
73503
|
+
const { sendMessageTelegram } = await import("./send-Owye3CdT.js").then((n) => n.l);
|
|
73504
73504
|
return await sendMessageTelegram(...args);
|
|
73505
73505
|
},
|
|
73506
73506
|
sendMessageDiscord: async (...args) => {
|
|
73507
|
-
const { sendMessageDiscord } = await import("./send-
|
|
73507
|
+
const { sendMessageDiscord } = await import("./send-D4CyRJfb.js").then((n) => n.t);
|
|
73508
73508
|
return await sendMessageDiscord(...args);
|
|
73509
73509
|
},
|
|
73510
73510
|
sendMessageSlack: async (...args) => {
|
|
73511
|
-
const { sendMessageSlack } = await import("./send-
|
|
73511
|
+
const { sendMessageSlack } = await import("./send-D3AqPouq.js").then((n) => n.n);
|
|
73512
73512
|
return await sendMessageSlack(...args);
|
|
73513
73513
|
},
|
|
73514
73514
|
sendMessageSignal: async (...args) => {
|
|
73515
|
-
const { sendMessageSignal } = await import("./send-
|
|
73515
|
+
const { sendMessageSignal } = await import("./send-BaBji8OV.js").then((n) => n.i);
|
|
73516
73516
|
return await sendMessageSignal(...args);
|
|
73517
73517
|
},
|
|
73518
73518
|
sendMessageIMessage: async (...args) => {
|
|
73519
|
-
const { sendMessageIMessage } = await import("./send-
|
|
73519
|
+
const { sendMessageIMessage } = await import("./send-Blzch_-J.js").then((n) => n.n);
|
|
73520
73520
|
return await sendMessageIMessage(...args);
|
|
73521
73521
|
}
|
|
73522
73522
|
};
|
|
@@ -74777,10 +74777,10 @@ function estimateDurationSeconds(pcm) {
|
|
|
74777
74777
|
return pcm.length / (bytesPerSample * SAMPLE_RATE);
|
|
74778
74778
|
}
|
|
74779
74779
|
async function writeWavFile(pcm) {
|
|
74780
|
-
const tempDir = await fs
|
|
74780
|
+
const tempDir = await fs.mkdtemp(path.join(resolvePreferredOpenClawTmpDir(), "discord-voice-"));
|
|
74781
74781
|
const filePath = path.join(tempDir, `segment-${randomUUID()}.wav`);
|
|
74782
74782
|
const wav = buildWavBuffer(pcm);
|
|
74783
|
-
await fs
|
|
74783
|
+
await fs.writeFile(filePath, wav);
|
|
74784
74784
|
scheduleTempCleanup(tempDir);
|
|
74785
74785
|
return {
|
|
74786
74786
|
path: filePath,
|
|
@@ -74789,7 +74789,7 @@ async function writeWavFile(pcm) {
|
|
|
74789
74789
|
}
|
|
74790
74790
|
function scheduleTempCleanup(tempDir, delayMs = 1800 * 1e3) {
|
|
74791
74791
|
setTimeout(() => {
|
|
74792
|
-
fs
|
|
74792
|
+
fs.rm(tempDir, {
|
|
74793
74793
|
recursive: true,
|
|
74794
74794
|
force: true
|
|
74795
74795
|
}).catch((err) => {
|
|
@@ -77071,7 +77071,7 @@ function createDiscordGatewayPlugin(params) {
|
|
|
77071
77071
|
return super.registerClient(client);
|
|
77072
77072
|
}
|
|
77073
77073
|
createWebSocket(url) {
|
|
77074
|
-
return new WebSocket
|
|
77074
|
+
return new WebSocket(url, { agent: wsAgent });
|
|
77075
77075
|
}
|
|
77076
77076
|
}
|
|
77077
77077
|
return new ProxyGatewayPlugin();
|
|
@@ -78479,7 +78479,7 @@ async function detectBinary(name) {
|
|
|
78479
78479
|
if (!isSafeExecutableValue(name)) return false;
|
|
78480
78480
|
const resolved = name.startsWith("~") ? resolveUserPath(name) : name;
|
|
78481
78481
|
if (path.isAbsolute(resolved) || resolved.startsWith(".") || resolved.includes("/") || resolved.includes("\\")) try {
|
|
78482
|
-
await fs
|
|
78482
|
+
await fs.access(resolved);
|
|
78483
78483
|
return true;
|
|
78484
78484
|
} catch {
|
|
78485
78485
|
return false;
|
|
@@ -79143,7 +79143,7 @@ function normalizeAllowList$1(list) {
|
|
|
79143
79143
|
async function detectRemoteHostFromCliPath(cliPath) {
|
|
79144
79144
|
try {
|
|
79145
79145
|
const expanded = cliPath.startsWith("~") ? cliPath.replace(/^~/, process.env.HOME ?? "") : cliPath;
|
|
79146
|
-
const content = await fs
|
|
79146
|
+
const content = await fs.readFile(expanded, "utf8");
|
|
79147
79147
|
const userHostMatch = content.match(/\bssh\b[^\n]*?\s+([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+)/);
|
|
79148
79148
|
if (userHostMatch) return userHostMatch[1];
|
|
79149
79149
|
return content.match(/\bssh\b[^\n]*?\s+([a-zA-Z][a-zA-Z0-9._-]*)\s+\S*\bimsg\b/)?.[1];
|
|
@@ -79479,7 +79479,7 @@ async function monitorIMessageProvider(opts = {}) {
|
|
|
79479
79479
|
function readFileIfExists(filePath) {
|
|
79480
79480
|
if (!filePath) return;
|
|
79481
79481
|
try {
|
|
79482
|
-
return
|
|
79482
|
+
return syncFs.readFileSync(filePath, "utf-8").trim();
|
|
79483
79483
|
} catch {
|
|
79484
79484
|
return;
|
|
79485
79485
|
}
|
|
@@ -80100,7 +80100,7 @@ async function downloadLineMedia(messageId, channelAccessToken, maxBytes = 10 *
|
|
|
80100
80100
|
prefix: "line-media",
|
|
80101
80101
|
extension: getExtensionForContentType(contentType)
|
|
80102
80102
|
});
|
|
80103
|
-
await
|
|
80103
|
+
await syncFs.promises.writeFile(filePath, buffer);
|
|
80104
80104
|
logVerbose(`line: downloaded media ${messageId} to ${filePath} (${buffer.length} bytes)`);
|
|
80105
80105
|
return {
|
|
80106
80106
|
path: filePath,
|
|
@@ -85900,7 +85900,7 @@ function readSlackExternalArgMenuToken(raw) {
|
|
|
85900
85900
|
}
|
|
85901
85901
|
let commandsRegistry;
|
|
85902
85902
|
async function getCommandsRegistry() {
|
|
85903
|
-
if (!commandsRegistry) commandsRegistry = await import("./commands-registry-
|
|
85903
|
+
if (!commandsRegistry) commandsRegistry = await import("./commands-registry-Bpqy7T_m.js").then((n) => n.n);
|
|
85904
85904
|
return commandsRegistry;
|
|
85905
85905
|
}
|
|
85906
85906
|
function encodeSlackCommandArgValue(parts) {
|
|
@@ -86230,14 +86230,14 @@ async function registerSlackMonitorSlashCommands(params) {
|
|
|
86230
86230
|
const channelName = channelInfo?.name;
|
|
86231
86231
|
const roomLabel = channelName ? `#${channelName}` : `#${command.channel_id}`;
|
|
86232
86232
|
const [{ resolveAgentRoute }, { finalizeInboundContext }, { dispatchReplyWithDispatcher }] = await Promise.all([
|
|
86233
|
-
import("./resolve-route-
|
|
86233
|
+
import("./resolve-route-BVQQmyE-.js").then((n) => n.r),
|
|
86234
86234
|
import("./inbound-context-CYjjc71l.js").then((n) => n.n),
|
|
86235
86235
|
Promise.resolve().then(() => provider_dispatcher_exports)
|
|
86236
86236
|
]);
|
|
86237
86237
|
const [{ resolveConversationLabel }, { createReplyPrefixOptions }, { recordInboundSessionMetaSafe }] = await Promise.all([
|
|
86238
86238
|
import("./conversation-label-CrORLc0j.js").then((n) => n.t),
|
|
86239
|
-
import("./reply-prefix-
|
|
86240
|
-
import("./session-meta-
|
|
86239
|
+
import("./reply-prefix-B4-hQLj2.js").then((n) => n.n),
|
|
86240
|
+
import("./session-meta-n_Hhzi0B.js").then((n) => n.n)
|
|
86241
86241
|
]);
|
|
86242
86242
|
const route = resolveAgentRoute({
|
|
86243
86243
|
cfg,
|
|
@@ -86302,9 +86302,9 @@ async function registerSlackMonitorSlashCommands(params) {
|
|
|
86302
86302
|
});
|
|
86303
86303
|
const deliverSlashPayloads = async (replies) => {
|
|
86304
86304
|
const [{ deliverSlackSlashReplies }, { resolveChunkMode, resolveChunkNewlinePacking }, { resolveMarkdownTableMode }] = await Promise.all([
|
|
86305
|
-
import("./replies-
|
|
86306
|
-
import("./chunk-
|
|
86307
|
-
import("./markdown-tables-
|
|
86305
|
+
import("./replies-BbIj7g9M.js").then((n) => n.r),
|
|
86306
|
+
import("./chunk-CmQRdRrT.js").then((n) => n.s),
|
|
86307
|
+
import("./markdown-tables-pw9wiTpN.js").then((n) => n.t)
|
|
86308
86308
|
]);
|
|
86309
86309
|
await deliverSlackSlashReplies({
|
|
86310
86310
|
replies,
|
|
@@ -86358,7 +86358,7 @@ async function registerSlackMonitorSlashCommands(params) {
|
|
|
86358
86358
|
let nativeCommands = [];
|
|
86359
86359
|
if (nativeEnabled) {
|
|
86360
86360
|
reg = await getCommandsRegistry();
|
|
86361
|
-
const skillCommands = nativeSkillsEnabled ? (await import("./skill-commands-
|
|
86361
|
+
const skillCommands = nativeSkillsEnabled ? (await import("./skill-commands-DyocWgx1.js").then((n) => n.a)).listSkillCommandsForAgents({ cfg }) : [];
|
|
86362
86362
|
nativeCommands = reg.listNativeCommandSpecsForConfig(cfg, {
|
|
86363
86363
|
skillCommands,
|
|
86364
86364
|
provider: "slack"
|
|
@@ -86877,7 +86877,7 @@ async function auditTelegramGroupMembership(params) {
|
|
|
86877
86877
|
groups: [],
|
|
86878
86878
|
elapsedMs: Date.now() - started
|
|
86879
86879
|
};
|
|
86880
|
-
const fetcher = params.proxyUrl ? (await import("./proxy-
|
|
86880
|
+
const fetcher = params.proxyUrl ? (await import("./proxy-CPi-EHQf.js").then((n) => n.n)).makeProxyFetch(params.proxyUrl) : fetch;
|
|
86881
86881
|
const { fetchWithTimeout } = await import("./fetch-timeout-Dyj5Y_Ss.js").then((n) => n.r);
|
|
86882
86882
|
const base = `${TELEGRAM_API_BASE$1}/bot${token}`;
|
|
86883
86883
|
const groups = [];
|
|
@@ -89436,7 +89436,7 @@ const buildTelegramMessageContext = async ({ primaryCtx, allMedia, replyMedia =
|
|
|
89436
89436
|
let audioPreflightCarry;
|
|
89437
89437
|
const audioConfigEnabled = cfg.tools?.media?.audio && cfg.tools.media.audio.enabled !== false;
|
|
89438
89438
|
if (hasAudio && !hasUserText && !disableAudioPreflight && (isGroup && requireMention && mentionRegexes.length > 0 || audioConfigEnabled === true)) try {
|
|
89439
|
-
const { transcribeFirstAudio } = await import("./audio-preflight-
|
|
89439
|
+
const { transcribeFirstAudio } = await import("./audio-preflight-5kfGz36M.js");
|
|
89440
89440
|
const preflight = await transcribeFirstAudio({
|
|
89441
89441
|
ctx: {
|
|
89442
89442
|
MediaPaths: allMedia.length > 0 ? allMedia.map((m) => m.path) : void 0,
|
|
@@ -90908,7 +90908,7 @@ function resolveCommandHashPath(accountId, botIdentity) {
|
|
|
90908
90908
|
}
|
|
90909
90909
|
async function readCachedCommandHash(accountId, botIdentity) {
|
|
90910
90910
|
try {
|
|
90911
|
-
return (await fs
|
|
90911
|
+
return (await fs.readFile(resolveCommandHashPath(accountId, botIdentity), "utf-8")).trim();
|
|
90912
90912
|
} catch {
|
|
90913
90913
|
return null;
|
|
90914
90914
|
}
|
|
@@ -90916,8 +90916,8 @@ async function readCachedCommandHash(accountId, botIdentity) {
|
|
|
90916
90916
|
async function writeCachedCommandHash(accountId, botIdentity, hash) {
|
|
90917
90917
|
const filePath = resolveCommandHashPath(accountId, botIdentity);
|
|
90918
90918
|
try {
|
|
90919
|
-
await fs
|
|
90920
|
-
await fs
|
|
90919
|
+
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
|
90920
|
+
await fs.writeFile(filePath, hash, "utf-8");
|
|
90921
90921
|
} catch {}
|
|
90922
90922
|
}
|
|
90923
90923
|
async function syncTelegramMenuCommands(params) {
|
|
@@ -92182,7 +92182,7 @@ function safeParseState(raw) {
|
|
|
92182
92182
|
async function readTelegramUpdateOffset(params) {
|
|
92183
92183
|
const filePath = resolveTelegramUpdateOffsetPath(params.accountId, params.env);
|
|
92184
92184
|
try {
|
|
92185
|
-
const parsed = safeParseState(await fs
|
|
92185
|
+
const parsed = safeParseState(await fs.readFile(filePath, "utf-8"));
|
|
92186
92186
|
const expectedBotId = extractBotIdFromToken(params.botToken);
|
|
92187
92187
|
if (expectedBotId && parsed?.botId && parsed.botId !== expectedBotId) return null;
|
|
92188
92188
|
if (expectedBotId && parsed?.botId === null) return null;
|
|
@@ -93905,7 +93905,7 @@ async function getMemorySearchManager(params) {
|
|
|
93905
93905
|
if (cached) return { manager: cached };
|
|
93906
93906
|
}
|
|
93907
93907
|
try {
|
|
93908
|
-
const { QmdMemoryManager } = await import("./qmd-manager-
|
|
93908
|
+
const { QmdMemoryManager } = await import("./qmd-manager-D8ak7kq1.js");
|
|
93909
93909
|
const primary = await QmdMemoryManager.create({
|
|
93910
93910
|
cfg: params.cfg,
|
|
93911
93911
|
agentId: params.agentId,
|
|
@@ -93917,7 +93917,7 @@ async function getMemorySearchManager(params) {
|
|
|
93917
93917
|
const wrapper = new FallbackMemoryManager({
|
|
93918
93918
|
primary,
|
|
93919
93919
|
fallbackFactory: async () => {
|
|
93920
|
-
const { MemoryIndexManager } = await import("./manager-
|
|
93920
|
+
const { MemoryIndexManager } = await import("./manager-SEkHJEk4.js").then((n) => n.t);
|
|
93921
93921
|
return await MemoryIndexManager.get(params);
|
|
93922
93922
|
}
|
|
93923
93923
|
}, () => {
|
|
@@ -93932,7 +93932,7 @@ async function getMemorySearchManager(params) {
|
|
|
93932
93932
|
}
|
|
93933
93933
|
}
|
|
93934
93934
|
try {
|
|
93935
|
-
const { MemoryIndexManager } = await import("./manager-
|
|
93935
|
+
const { MemoryIndexManager } = await import("./manager-SEkHJEk4.js").then((n) => n.t);
|
|
93936
93936
|
return { manager: await MemoryIndexManager.get(params) };
|
|
93937
93937
|
} catch (err) {
|
|
93938
93938
|
return {
|
|
@@ -94282,7 +94282,7 @@ const LEGACY_ARCHIVE_DEFAULT_RETENTION_MS = 720 * 60 * 60 * 1e3;
|
|
|
94282
94282
|
const log$24 = createSubsystemLogger("config/sessions/legacy-import/archive");
|
|
94283
94283
|
/** SHA-256 over the file's bytes; null when the file is gone (ENOENT). Other errors propagate. */
|
|
94284
94284
|
async function sourceIdentity(filePath) {
|
|
94285
|
-
const handle = await fs
|
|
94285
|
+
const handle = await fs.open(filePath, "r").catch((error) => {
|
|
94286
94286
|
if (error.code === "ENOENT") return null;
|
|
94287
94287
|
throw error;
|
|
94288
94288
|
});
|
|
@@ -94335,9 +94335,9 @@ function fallbackArchiveDest(source, archiveRoot) {
|
|
|
94335
94335
|
async function copyVerifiedTo(sourcePath, dest, expected) {
|
|
94336
94336
|
const tmp = `${dest}.tmp-${randomUUID()}`;
|
|
94337
94337
|
try {
|
|
94338
|
-
const handle = await fs
|
|
94338
|
+
const handle = await fs.open(tmp, "wx", 384);
|
|
94339
94339
|
try {
|
|
94340
|
-
const sourceHandle = await fs
|
|
94340
|
+
const sourceHandle = await fs.open(sourcePath, "r");
|
|
94341
94341
|
try {
|
|
94342
94342
|
const chunk = Buffer.allocUnsafe(256 * 1024);
|
|
94343
94343
|
let size = 0;
|
|
@@ -94354,18 +94354,18 @@ async function copyVerifiedTo(sourcePath, dest, expected) {
|
|
|
94354
94354
|
} finally {
|
|
94355
94355
|
await handle.close();
|
|
94356
94356
|
}
|
|
94357
|
-
await fs
|
|
94357
|
+
await fs.chmod(tmp, 384);
|
|
94358
94358
|
const copied = await identityOf(tmp);
|
|
94359
94359
|
if (!copied || copied.fingerprint !== expected.fingerprint) throw new Error(`legacy archive cross-device copy diverged from the imported bytes: ${dest}`);
|
|
94360
94360
|
try {
|
|
94361
|
-
await fs
|
|
94361
|
+
await fs.link(tmp, dest);
|
|
94362
94362
|
} catch (error) {
|
|
94363
94363
|
if (error.code !== "EEXIST") throw error;
|
|
94364
94364
|
const existing = await identityOf(dest);
|
|
94365
94365
|
if (!existing || existing.fingerprint !== expected.fingerprint) throw new Error(`legacy archive destination exists with different content: ${dest}`, { cause: error });
|
|
94366
94366
|
}
|
|
94367
94367
|
} finally {
|
|
94368
|
-
await fs
|
|
94368
|
+
await fs.rm(tmp, { force: true });
|
|
94369
94369
|
}
|
|
94370
94370
|
}
|
|
94371
94371
|
/**
|
|
@@ -94381,7 +94381,7 @@ async function planLegacyArchiveDest(source, archiveRoot, expected) {
|
|
|
94381
94381
|
const resolvedRoot = path.resolve(archiveRoot);
|
|
94382
94382
|
const { dir, dest } = archivePathsFor(source, resolvedRoot);
|
|
94383
94383
|
try {
|
|
94384
|
-
await fs
|
|
94384
|
+
await fs.mkdir(dir, {
|
|
94385
94385
|
recursive: true,
|
|
94386
94386
|
mode: 448
|
|
94387
94387
|
});
|
|
@@ -94421,7 +94421,7 @@ async function archiveLegacySource(source, archiveRoot, expected) {
|
|
|
94421
94421
|
*/
|
|
94422
94422
|
async function archiveLegacySourceTo(source, dest, archiveRoot, expected) {
|
|
94423
94423
|
const resolvedRoot = path.resolve(archiveRoot);
|
|
94424
|
-
await fs
|
|
94424
|
+
await fs.mkdir(path.dirname(dest), {
|
|
94425
94425
|
recursive: true,
|
|
94426
94426
|
mode: 448
|
|
94427
94427
|
});
|
|
@@ -94431,14 +94431,14 @@ async function archiveLegacySourceTo(source, dest, archiveRoot, expected) {
|
|
|
94431
94431
|
const expectedIdentity = expected ?? sourceIdentityValue;
|
|
94432
94432
|
if (sourceIdentityValue.fingerprint !== expectedIdentity.fingerprint) throw new Error(`legacy source changed after import; failing closed: ${source.path}`);
|
|
94433
94433
|
const destInodeVerified = async (destPath) => {
|
|
94434
|
-
const [sourceStat, destStat] = await Promise.all([fs
|
|
94434
|
+
const [sourceStat, destStat] = await Promise.all([fs.stat(source.path), fs.stat(destPath).catch(() => void 0)]);
|
|
94435
94435
|
return destStat !== void 0 && destStat.dev === sourceStat.dev && destStat.ino === sourceStat.ino;
|
|
94436
94436
|
};
|
|
94437
94437
|
const moveInto = async (destPath) => {
|
|
94438
94438
|
let moved = false;
|
|
94439
94439
|
let independentArchive = false;
|
|
94440
94440
|
try {
|
|
94441
|
-
await fs
|
|
94441
|
+
await fs.link(source.path, destPath);
|
|
94442
94442
|
moved = true;
|
|
94443
94443
|
} catch (error) {
|
|
94444
94444
|
const code = error.code;
|
|
@@ -94446,7 +94446,7 @@ async function archiveLegacySourceTo(source, dest, archiveRoot, expected) {
|
|
|
94446
94446
|
const existing = await identityOf(destPath);
|
|
94447
94447
|
if (existing && existing.fingerprint === expectedIdentity.fingerprint) {
|
|
94448
94448
|
moved = true;
|
|
94449
|
-
const [sourceStat, destStat] = await Promise.all([fs
|
|
94449
|
+
const [sourceStat, destStat] = await Promise.all([fs.stat(source.path), fs.stat(destPath)]);
|
|
94450
94450
|
independentArchive = sourceStat.dev !== destStat.dev || sourceStat.ino !== destStat.ino;
|
|
94451
94451
|
} else return {
|
|
94452
94452
|
moved: false,
|
|
@@ -94467,13 +94467,13 @@ async function archiveLegacySourceTo(source, dest, archiveRoot, expected) {
|
|
|
94467
94467
|
};
|
|
94468
94468
|
const outcome = await moveInto(dest);
|
|
94469
94469
|
if (outcome.divergent) throw new Error(`legacy archive destination exists with different content: ${dest}`);
|
|
94470
|
-
await fs
|
|
94470
|
+
await fs.chmod(dest, 384);
|
|
94471
94471
|
if (!await destInodeVerified(dest)) {
|
|
94472
94472
|
const archived = await identityOf(dest);
|
|
94473
94473
|
if (!archived || archived.fingerprint !== expectedIdentity.fingerprint) throw new Error(`legacy archive verification failed: ${dest}`);
|
|
94474
94474
|
}
|
|
94475
94475
|
if (outcome.moved) if (outcome.independentArchive) await unlinkSourceIfUnchanged(source.path, expectedIdentity);
|
|
94476
|
-
else await fs
|
|
94476
|
+
else await fs.unlink(source.path);
|
|
94477
94477
|
return dest;
|
|
94478
94478
|
}
|
|
94479
94479
|
/**
|
|
@@ -94487,12 +94487,12 @@ async function unlinkSourceIfUnchanged(sourcePath, expected) {
|
|
|
94487
94487
|
const current = await sourceIdentity(sourcePath);
|
|
94488
94488
|
if (!current) return;
|
|
94489
94489
|
if (current.fingerprint !== expected.fingerprint) throw new Error(`legacy source changed before removal; failing closed: ${sourcePath}`);
|
|
94490
|
-
await fs
|
|
94490
|
+
await fs.unlink(sourcePath);
|
|
94491
94491
|
}
|
|
94492
94492
|
async function chmodDirs(dir, stopAt) {
|
|
94493
94493
|
let current = dir;
|
|
94494
94494
|
while (current.startsWith(stopAt) && current !== stopAt) {
|
|
94495
|
-
await fs
|
|
94495
|
+
await fs.chmod(current, 448).catch(() => void 0);
|
|
94496
94496
|
const parent = path.dirname(current);
|
|
94497
94497
|
if (parent === current) return;
|
|
94498
94498
|
current = parent;
|
|
@@ -94521,11 +94521,11 @@ async function purgeExpiredLegacyArchives(runtime, opts) {
|
|
|
94521
94521
|
log$24.warn("skipping legacy archive outside the archive root", { sourcePath: receipt.sourcePath });
|
|
94522
94522
|
continue;
|
|
94523
94523
|
}
|
|
94524
|
-
if (!await fs
|
|
94524
|
+
if (!await fs.stat(archivePath).then(() => true).catch((error) => {
|
|
94525
94525
|
if (error.code === "ENOENT") return false;
|
|
94526
94526
|
throw error;
|
|
94527
94527
|
})) continue;
|
|
94528
|
-
await fs
|
|
94528
|
+
await fs.rm(archivePath, { force: true });
|
|
94529
94529
|
purged += 1;
|
|
94530
94530
|
await pruneEmptyArchiveDirs(path.dirname(archivePath), archiveRoot);
|
|
94531
94531
|
}
|
|
@@ -94536,12 +94536,12 @@ async function pruneEmptyArchiveDirs(dir, stopAt) {
|
|
|
94536
94536
|
while (current.startsWith(stopAt + path.sep)) {
|
|
94537
94537
|
let entries;
|
|
94538
94538
|
try {
|
|
94539
|
-
entries = await fs
|
|
94539
|
+
entries = await fs.readdir(current);
|
|
94540
94540
|
} catch {
|
|
94541
94541
|
return;
|
|
94542
94542
|
}
|
|
94543
94543
|
if (entries.length > 0) return;
|
|
94544
|
-
await fs
|
|
94544
|
+
await fs.rmdir(current).catch(() => void 0);
|
|
94545
94545
|
current = path.dirname(current);
|
|
94546
94546
|
}
|
|
94547
94547
|
}
|
|
@@ -94824,7 +94824,7 @@ function byPath(a, b) {
|
|
|
94824
94824
|
}
|
|
94825
94825
|
function readDirents(dirPath) {
|
|
94826
94826
|
try {
|
|
94827
|
-
return
|
|
94827
|
+
return syncFs.readdirSync(dirPath, { withFileTypes: true });
|
|
94828
94828
|
} catch {
|
|
94829
94829
|
return [];
|
|
94830
94830
|
}
|
|
@@ -94837,7 +94837,7 @@ function isUnderQuarantine(rootDir, candidatePath) {
|
|
|
94837
94837
|
}
|
|
94838
94838
|
function statSource(filePath) {
|
|
94839
94839
|
try {
|
|
94840
|
-
const stats =
|
|
94840
|
+
const stats = syncFs.statSync(filePath);
|
|
94841
94841
|
if (!stats.isFile()) return;
|
|
94842
94842
|
return {
|
|
94843
94843
|
mtimeMs: stats.mtimeMs,
|
|
@@ -95028,12 +95028,12 @@ async function censusLegacySources(cfg, env) {
|
|
|
95028
95028
|
for (const agentDir of readDirents(agentsRoot).filter((entry) => entry.isDirectory()).toSorted((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
|
|
95029
95029
|
const agentId = normalizeAgentId(agentDir.name);
|
|
95030
95030
|
const sessionsDir = path.join(agentsRoot, agentDir.name, LEGACY_SESSIONS_DIR_NAME);
|
|
95031
|
-
if (
|
|
95031
|
+
if (syncFs.existsSync(sessionsDir)) censusAgentDir(sessionsDir, agentId);
|
|
95032
95032
|
}
|
|
95033
95033
|
const legacyRoot = path.join(stateDir, LEGACY_SESSIONS_DIR_NAME);
|
|
95034
|
-
if (
|
|
95034
|
+
if (syncFs.existsSync(legacyRoot)) censusAgentDir(legacyRoot, defaultAgent);
|
|
95035
95035
|
const recoveryDir = path.join(stateDir, RECOVERY_DIR_NAME);
|
|
95036
|
-
if (
|
|
95036
|
+
if (syncFs.existsSync(recoveryDir)) censusRecoveryTree(sources, recoveryDir);
|
|
95037
95037
|
return sources.values();
|
|
95038
95038
|
}
|
|
95039
95039
|
/**
|
|
@@ -95117,7 +95117,7 @@ async function admitDurableKeyMappings(registry, listKeys, opts) {
|
|
|
95117
95117
|
await opts?.clearMappingSourcePath?.(mapping.agentId, mapping.sessionId).catch(() => void 0);
|
|
95118
95118
|
continue;
|
|
95119
95119
|
}
|
|
95120
|
-
const stats = await fs
|
|
95120
|
+
const stats = await fs.stat(mapping.sourcePath).catch(() => void 0);
|
|
95121
95121
|
if (!stats?.isFile()) continue;
|
|
95122
95122
|
registry.admit({
|
|
95123
95123
|
path: mapping.sourcePath,
|
|
@@ -95317,7 +95317,7 @@ function createLegacySourceRegistry() {
|
|
|
95317
95317
|
if (!isSettledReceipt(receipt, source.sizeBytes)) trackPendingPath(key, source);
|
|
95318
95318
|
return;
|
|
95319
95319
|
}
|
|
95320
|
-
const stats = await fs
|
|
95320
|
+
const stats = await fs.stat(key).catch(() => void 0);
|
|
95321
95321
|
if (!stats?.isFile() && receipt.status !== "imported") return;
|
|
95322
95322
|
admit({
|
|
95323
95323
|
path: key,
|
|
@@ -95669,7 +95669,7 @@ async function claimExclusivePartial(destPath) {
|
|
|
95669
95669
|
for (let attempt = 0; attempt < 3; attempt += 1) {
|
|
95670
95670
|
const candidate = `${destPath}.${process.pid}.${randomBytes(8).toString("hex")}.partial`;
|
|
95671
95671
|
try {
|
|
95672
|
-
await (await fs
|
|
95672
|
+
await (await fs.open(candidate, "wx", 384)).close();
|
|
95673
95673
|
return candidate;
|
|
95674
95674
|
} catch (err) {
|
|
95675
95675
|
if (err.code !== "EEXIST") throw err;
|
|
@@ -95688,7 +95688,7 @@ async function backupSqliteSessionDatabase(params) {
|
|
|
95688
95688
|
const dbPath = path.resolve(params.dbPath);
|
|
95689
95689
|
const destPath = path.resolve(params.destPath);
|
|
95690
95690
|
for (const guarded of protectedLivePaths(dbPath)) if (sameFile$1(destPath, guarded)) throw new Error("backup destination must not be the live database or its owner lock, holder sidecar, or journal files");
|
|
95691
|
-
await fs
|
|
95691
|
+
await fs.mkdir(path.dirname(destPath), {
|
|
95692
95692
|
recursive: true,
|
|
95693
95693
|
mode: 448
|
|
95694
95694
|
});
|
|
@@ -95700,14 +95700,14 @@ async function backupSqliteSessionDatabase(params) {
|
|
|
95700
95700
|
gated: sqliteBackupTestHooks.holdWorkerAtGate === true,
|
|
95701
95701
|
writableSource: false
|
|
95702
95702
|
});
|
|
95703
|
-
await fs
|
|
95703
|
+
await fs.rename(partialPath, destPath);
|
|
95704
95704
|
} catch (err) {
|
|
95705
|
-
await fs
|
|
95705
|
+
await fs.rm(partialPath, { force: true }).catch(() => {});
|
|
95706
95706
|
throw err;
|
|
95707
95707
|
}
|
|
95708
95708
|
return {
|
|
95709
95709
|
path: destPath,
|
|
95710
|
-
bytes: (await fs
|
|
95710
|
+
bytes: (await fs.stat(destPath)).size
|
|
95711
95711
|
};
|
|
95712
95712
|
}
|
|
95713
95713
|
|
|
@@ -95736,7 +95736,7 @@ async function takePreImportLegacySnapshot(params) {
|
|
|
95736
95736
|
const marked = await readSnapshotMarker(backupsDir);
|
|
95737
95737
|
if (marked) return marked;
|
|
95738
95738
|
if ((await params.listReceipts()).length > 0) return;
|
|
95739
|
-
await fs
|
|
95739
|
+
await fs.mkdir(backupsDir, {
|
|
95740
95740
|
recursive: true,
|
|
95741
95741
|
mode: 448
|
|
95742
95742
|
});
|
|
@@ -95746,7 +95746,7 @@ async function takePreImportLegacySnapshot(params) {
|
|
|
95746
95746
|
dbPath,
|
|
95747
95747
|
destPath
|
|
95748
95748
|
});
|
|
95749
|
-
await fs
|
|
95749
|
+
await fs.writeFile(path.join(backupsDir, SNAPSHOT_MARKER_FILE), `${JSON.stringify({
|
|
95750
95750
|
path: backup.path,
|
|
95751
95751
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
95752
95752
|
})}\n`, { mode: 384 });
|
|
@@ -95762,14 +95762,14 @@ async function takePreImportLegacySnapshot(params) {
|
|
|
95762
95762
|
*/
|
|
95763
95763
|
async function cleanupPartialLegacyBackups(stateDir) {
|
|
95764
95764
|
const backupsDir = path.join(stateDir, "backups");
|
|
95765
|
-
const names = await fs
|
|
95765
|
+
const names = await fs.readdir(backupsDir).catch(() => []);
|
|
95766
95766
|
for (const name of names) {
|
|
95767
95767
|
if (!name.endsWith(".partial")) continue;
|
|
95768
|
-
await fs
|
|
95768
|
+
await fs.rm(path.join(backupsDir, name), { force: true }).catch(() => void 0);
|
|
95769
95769
|
}
|
|
95770
95770
|
}
|
|
95771
95771
|
async function readSnapshotMarker(backupsDir) {
|
|
95772
|
-
const raw = await fs
|
|
95772
|
+
const raw = await fs.readFile(path.join(backupsDir, SNAPSHOT_MARKER_FILE), "utf8").catch(() => void 0);
|
|
95773
95773
|
if (!raw) return;
|
|
95774
95774
|
try {
|
|
95775
95775
|
const markerPath = JSON.parse(raw)?.path;
|
|
@@ -96037,7 +96037,7 @@ const log$16 = createSubsystemLogger("config/sessions/legacy-import/index-import
|
|
|
96037
96037
|
async function readLegacyIndexStore(storePath) {
|
|
96038
96038
|
let raw;
|
|
96039
96039
|
try {
|
|
96040
|
-
raw = await fs
|
|
96040
|
+
raw = await fs.readFile(storePath, "utf8");
|
|
96041
96041
|
} catch (error) {
|
|
96042
96042
|
throw new Error(`legacy index source unreadable: ${storePath}`, { cause: error });
|
|
96043
96043
|
}
|
|
@@ -96276,7 +96276,7 @@ async function importLegacyIndex(runtime, source, opts = {}) {
|
|
|
96276
96276
|
actorExplicit: entry.actor !== void 0
|
|
96277
96277
|
}), opts.signal);
|
|
96278
96278
|
if (transcriptPath && opts.discoveredTranscripts && path.resolve(transcriptPath) !== path.resolve(source.path)) try {
|
|
96279
|
-
const stats = await fs
|
|
96279
|
+
const stats = await fs.stat(transcriptPath);
|
|
96280
96280
|
if (stats.isFile()) opts.discoveredTranscripts.push({
|
|
96281
96281
|
path: transcriptPath,
|
|
96282
96282
|
kind: "transcript",
|
|
@@ -96392,7 +96392,7 @@ async function loadSessionKeyOverrides(stateDir) {
|
|
|
96392
96392
|
const filePath = path.join(stateDir, "recovery", SESSION_KEY_OVERRIDES_FILENAME);
|
|
96393
96393
|
let raw;
|
|
96394
96394
|
try {
|
|
96395
|
-
raw = await fs
|
|
96395
|
+
raw = await fs.readFile(filePath, "utf8");
|
|
96396
96396
|
} catch (error) {
|
|
96397
96397
|
if (error.code !== "ENOENT") log$14.warn("session key overrides unreadable; ignoring", { error });
|
|
96398
96398
|
return /* @__PURE__ */ new Map();
|
|
@@ -97615,12 +97615,12 @@ function sleep$1(ms) {
|
|
|
97615
97615
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
97616
97616
|
}
|
|
97617
97617
|
function acquireKernelOwnerLock(lock) {
|
|
97618
|
-
|
|
97618
|
+
syncFs.mkdirSync(path.dirname(lock.lockPath), {
|
|
97619
97619
|
recursive: true,
|
|
97620
97620
|
mode: 448
|
|
97621
97621
|
});
|
|
97622
97622
|
try {
|
|
97623
|
-
|
|
97623
|
+
syncFs.closeSync(syncFs.openSync(lock.lockPath, "wx", 384));
|
|
97624
97624
|
} catch (err) {
|
|
97625
97625
|
if (err.code !== "EEXIST") throw err;
|
|
97626
97626
|
}
|
|
@@ -97654,7 +97654,7 @@ function closeSqliteQuietly(db) {
|
|
|
97654
97654
|
function releaseKernelOwnerLock(lock, db, info) {
|
|
97655
97655
|
try {
|
|
97656
97656
|
const current = readHolderSidecar(lock.sidecarPath);
|
|
97657
|
-
if (current !== void 0 && current.pid === info.pid && current.startedAt === info.startedAt)
|
|
97657
|
+
if (current !== void 0 && current.pid === info.pid && current.startedAt === info.startedAt) syncFs.rmSync(lock.sidecarPath, { force: true });
|
|
97658
97658
|
} finally {
|
|
97659
97659
|
closeSqliteQuietly(db);
|
|
97660
97660
|
}
|
|
@@ -97662,17 +97662,17 @@ function releaseKernelOwnerLock(lock, db, info) {
|
|
|
97662
97662
|
function writeHolderSidecar(sidecarPath, info) {
|
|
97663
97663
|
const temp = `${sidecarPath}.${process.pid}.tmp`;
|
|
97664
97664
|
try {
|
|
97665
|
-
const fd =
|
|
97665
|
+
const fd = syncFs.openSync(temp, "w", 384);
|
|
97666
97666
|
try {
|
|
97667
|
-
|
|
97668
|
-
|
|
97667
|
+
syncFs.writeFileSync(fd, `${JSON.stringify(info)}\n`);
|
|
97668
|
+
syncFs.fsyncSync(fd);
|
|
97669
97669
|
} finally {
|
|
97670
|
-
|
|
97670
|
+
syncFs.closeSync(fd);
|
|
97671
97671
|
}
|
|
97672
|
-
|
|
97672
|
+
syncFs.renameSync(temp, sidecarPath);
|
|
97673
97673
|
} catch (err) {
|
|
97674
97674
|
try {
|
|
97675
|
-
|
|
97675
|
+
syncFs.rmSync(temp, { force: true });
|
|
97676
97676
|
} catch {}
|
|
97677
97677
|
throw err;
|
|
97678
97678
|
}
|
|
@@ -97697,7 +97697,7 @@ function parseHolderSidecar(raw) {
|
|
|
97697
97697
|
function readHolderSidecar(sidecarPath) {
|
|
97698
97698
|
let raw;
|
|
97699
97699
|
try {
|
|
97700
|
-
raw =
|
|
97700
|
+
raw = syncFs.readFileSync(sidecarPath, "utf8");
|
|
97701
97701
|
} catch {
|
|
97702
97702
|
return;
|
|
97703
97703
|
}
|
|
@@ -97708,7 +97708,7 @@ async function readHolderSidecarBriefly(sidecarPath, timeoutMs = 1e3) {
|
|
|
97708
97708
|
for (;;) {
|
|
97709
97709
|
let raw;
|
|
97710
97710
|
try {
|
|
97711
|
-
raw =
|
|
97711
|
+
raw = syncFs.readFileSync(sidecarPath, "utf8");
|
|
97712
97712
|
} catch {
|
|
97713
97713
|
raw = void 0;
|
|
97714
97714
|
}
|
|
@@ -97985,14 +97985,14 @@ function isGatewayArgv(args) {
|
|
|
97985
97985
|
}
|
|
97986
97986
|
function readLinuxCmdline(pid) {
|
|
97987
97987
|
try {
|
|
97988
|
-
return parseProcCmdline(
|
|
97988
|
+
return parseProcCmdline(syncFs.readFileSync(`/proc/${pid}/cmdline`, "utf8"));
|
|
97989
97989
|
} catch {
|
|
97990
97990
|
return null;
|
|
97991
97991
|
}
|
|
97992
97992
|
}
|
|
97993
97993
|
function readLinuxStartTime(pid) {
|
|
97994
97994
|
try {
|
|
97995
|
-
const raw =
|
|
97995
|
+
const raw = syncFs.readFileSync(`/proc/${pid}/stat`, "utf8").trim();
|
|
97996
97996
|
const closeParen = raw.lastIndexOf(")");
|
|
97997
97997
|
if (closeParen < 0) return null;
|
|
97998
97998
|
const fields = raw.slice(closeParen + 1).trim().split(/\s+/);
|
|
@@ -98046,7 +98046,7 @@ async function resolveGatewayOwnerStatus(pid, payload, platform, port) {
|
|
|
98046
98046
|
}
|
|
98047
98047
|
async function readLockPayload(lockPath) {
|
|
98048
98048
|
try {
|
|
98049
|
-
const raw = await fs
|
|
98049
|
+
const raw = await fs.readFile(lockPath, "utf8");
|
|
98050
98050
|
const parsed = JSON.parse(raw);
|
|
98051
98051
|
if (typeof parsed.pid !== "number") return null;
|
|
98052
98052
|
if (typeof parsed.createdAt !== "string") return null;
|
|
@@ -98431,7 +98431,7 @@ async function withMemoryManagerForAgent(params) {
|
|
|
98431
98431
|
}
|
|
98432
98432
|
async function checkReadableFile(pathname) {
|
|
98433
98433
|
try {
|
|
98434
|
-
await fs
|
|
98434
|
+
await fs.access(pathname, syncFs.constants.R_OK);
|
|
98435
98435
|
return { exists: true };
|
|
98436
98436
|
} catch (err) {
|
|
98437
98437
|
const code = err.code;
|
|
@@ -98466,7 +98466,7 @@ async function scanMemoryFiles(workspaceDir, extraPaths = []) {
|
|
|
98466
98466
|
if (alt.issue) issues.push(alt.issue);
|
|
98467
98467
|
const resolvedExtraPaths = normalizeExtraMemoryPaths(workspaceDir, extraPaths);
|
|
98468
98468
|
for (const extraPath of resolvedExtraPaths) try {
|
|
98469
|
-
if ((await fs
|
|
98469
|
+
if ((await fs.lstat(extraPath)).isSymbolicLink()) continue;
|
|
98470
98470
|
const extraCheck = await checkReadableFile(extraPath);
|
|
98471
98471
|
if (extraCheck.issue) issues.push(extraCheck.issue);
|
|
98472
98472
|
} catch (err) {
|
|
@@ -98476,7 +98476,7 @@ async function scanMemoryFiles(workspaceDir, extraPaths = []) {
|
|
|
98476
98476
|
}
|
|
98477
98477
|
let dirReadable = null;
|
|
98478
98478
|
try {
|
|
98479
|
-
await fs
|
|
98479
|
+
await fs.access(memoryDir, syncFs.constants.R_OK);
|
|
98480
98480
|
dirReadable = true;
|
|
98481
98481
|
} catch (err) {
|
|
98482
98482
|
const code = err.code;
|
|
@@ -98524,7 +98524,7 @@ async function summarizeQmdIndexArtifact(manager) {
|
|
|
98524
98524
|
if (!dbPath) return null;
|
|
98525
98525
|
let stat;
|
|
98526
98526
|
try {
|
|
98527
|
-
stat = await fs
|
|
98527
|
+
stat = await fs.stat(dbPath);
|
|
98528
98528
|
} catch (err) {
|
|
98529
98529
|
const code = err.code;
|
|
98530
98530
|
if (code === "ENOENT") throw new Error(`QMD index file not found: ${shortenHomePath(dbPath)}`, { cause: err });
|
|
@@ -98991,7 +98991,7 @@ function createPluginRuntime(options = {}) {
|
|
|
98991
98991
|
workStates: readTaskWorkStates
|
|
98992
98992
|
},
|
|
98993
98993
|
resolveLearningWorkspaceDir: (agentId) => resolveLearningWorkspaceDir(loadConfig(), agentId),
|
|
98994
|
-
sessions: { startUserRun: async (params) => (await import("./user-run-recording-
|
|
98994
|
+
sessions: { startUserRun: async (params) => (await import("./user-run-recording-CMwTVvoc.js").then((n) => n.n)).startUserSessionRun(params) }
|
|
98995
98995
|
};
|
|
98996
98996
|
Object.defineProperty(runtime, "analysis", {
|
|
98997
98997
|
enumerable: true,
|
|
@@ -99034,7 +99034,7 @@ const resolvePluginSdkAliasFile = (params) => {
|
|
|
99034
99034
|
const srcCandidate = path.join(cursor, "src", "plugin-sdk", params.srcFile);
|
|
99035
99035
|
const distCandidate = path.join(cursor, "dist", "plugin-sdk", params.distFile);
|
|
99036
99036
|
const orderedCandidates = isDistRuntime ? [distCandidate, srcCandidate] : isTest ? [distCandidate, srcCandidate] : [distCandidate];
|
|
99037
|
-
for (const candidate of orderedCandidates) if (
|
|
99037
|
+
for (const candidate of orderedCandidates) if (syncFs.existsSync(candidate)) return candidate;
|
|
99038
99038
|
const parent = path.dirname(cursor);
|
|
99039
99039
|
if (parent === cursor) break;
|
|
99040
99040
|
cursor = parent;
|
|
@@ -99577,7 +99577,7 @@ function loadOpenClawPlugins(options = {}) {
|
|
|
99577
99577
|
continue;
|
|
99578
99578
|
}
|
|
99579
99579
|
const safeSource = opened.path;
|
|
99580
|
-
|
|
99580
|
+
syncFs.closeSync(opened.fd);
|
|
99581
99581
|
let mod = null;
|
|
99582
99582
|
try {
|
|
99583
99583
|
mod = getJiti()(safeSource);
|
|
@@ -99737,7 +99737,7 @@ function loadOpenClawPlugins(options = {}) {
|
|
|
99737
99737
|
}
|
|
99738
99738
|
function safeRealpathOrResolve(value) {
|
|
99739
99739
|
try {
|
|
99740
|
-
return
|
|
99740
|
+
return syncFs.realpathSync(value);
|
|
99741
99741
|
} catch {
|
|
99742
99742
|
return path.resolve(value);
|
|
99743
99743
|
}
|
|
@@ -99895,7 +99895,7 @@ function resolvePluginWebSearchProviders(params) {
|
|
|
99895
99895
|
//#endregion
|
|
99896
99896
|
//#region src/agents/apply-patch-update.ts
|
|
99897
99897
|
async function defaultReadFile(filePath) {
|
|
99898
|
-
return fs
|
|
99898
|
+
return fs.readFile(filePath, "utf8");
|
|
99899
99899
|
}
|
|
99900
99900
|
async function applyUpdateHunk(filePath, chunks, options) {
|
|
99901
99901
|
const originalLines = (await (options?.readFile ?? defaultReadFile)(filePath).catch((err) => {
|
|
@@ -100216,7 +100216,7 @@ function resolvePatchFileOps(options) {
|
|
|
100216
100216
|
const workspaceOnly = options.workspaceOnly !== false;
|
|
100217
100217
|
return {
|
|
100218
100218
|
readFile: async (filePath) => {
|
|
100219
|
-
if (!workspaceOnly) return await fs
|
|
100219
|
+
if (!workspaceOnly) return await fs.readFile(filePath, "utf8");
|
|
100220
100220
|
const opened = await openBoundaryFile({
|
|
100221
100221
|
absolutePath: filePath,
|
|
100222
100222
|
rootPath: options.cwd,
|
|
@@ -100224,14 +100224,14 @@ function resolvePatchFileOps(options) {
|
|
|
100224
100224
|
});
|
|
100225
100225
|
assertBoundaryRead(opened, filePath);
|
|
100226
100226
|
try {
|
|
100227
|
-
return
|
|
100227
|
+
return syncFs.readFileSync(opened.fd, "utf8");
|
|
100228
100228
|
} finally {
|
|
100229
|
-
|
|
100229
|
+
syncFs.closeSync(opened.fd);
|
|
100230
100230
|
}
|
|
100231
100231
|
},
|
|
100232
100232
|
writeFile: async (filePath, content) => {
|
|
100233
100233
|
if (!workspaceOnly) {
|
|
100234
|
-
await fs
|
|
100234
|
+
await fs.writeFile(filePath, content, "utf8");
|
|
100235
100235
|
return;
|
|
100236
100236
|
}
|
|
100237
100237
|
const relative = toRelativeSandboxPath(options.cwd, filePath);
|
|
@@ -100242,8 +100242,8 @@ function resolvePatchFileOps(options) {
|
|
|
100242
100242
|
encoding: "utf8"
|
|
100243
100243
|
});
|
|
100244
100244
|
},
|
|
100245
|
-
remove: (filePath) => fs
|
|
100246
|
-
mkdirp: (dir) => fs
|
|
100245
|
+
remove: (filePath) => fs.rm(filePath),
|
|
100246
|
+
mkdirp: (dir) => fs.mkdir(dir, { recursive: true }).then(() => {})
|
|
100247
100247
|
};
|
|
100248
100248
|
}
|
|
100249
100249
|
async function ensureDir(filePath, ops) {
|
|
@@ -100522,7 +100522,7 @@ async function recordLoopOutcome(args) {
|
|
|
100522
100522
|
if (!args.ctx?.sessionKey) return;
|
|
100523
100523
|
try {
|
|
100524
100524
|
const { getDiagnosticSessionState } = await import("./diagnostic-session-state-Bnyx-w0F.js").then((n) => n.n);
|
|
100525
|
-
const { recordToolCallOutcome } = await import("./tool-loop-detection-
|
|
100525
|
+
const { recordToolCallOutcome } = await import("./tool-loop-detection-ST5jhih3.js");
|
|
100526
100526
|
recordToolCallOutcome(getDiagnosticSessionState({
|
|
100527
100527
|
sessionKey: args.ctx.sessionKey,
|
|
100528
100528
|
sessionId: args.ctx?.agentId
|
|
@@ -100549,8 +100549,8 @@ async function runBeforeToolCallHook(args) {
|
|
|
100549
100549
|
const params = args.params;
|
|
100550
100550
|
if (args.ctx?.sessionKey) {
|
|
100551
100551
|
const { getDiagnosticSessionState } = await import("./diagnostic-session-state-Bnyx-w0F.js").then((n) => n.n);
|
|
100552
|
-
const { logToolLoopAction } = await import("./diagnostic-
|
|
100553
|
-
const { detectToolCallLoop, recordToolCall } = await import("./tool-loop-detection-
|
|
100552
|
+
const { logToolLoopAction } = await import("./diagnostic-DWnW43D8.js").then((n) => n.n);
|
|
100553
|
+
const { detectToolCallLoop, recordToolCall } = await import("./tool-loop-detection-ST5jhih3.js");
|
|
100554
100554
|
const sessionState = getDiagnosticSessionState({
|
|
100555
100555
|
sessionKey: args.ctx.sessionKey,
|
|
100556
100556
|
sessionId: args.ctx?.agentId
|
|
@@ -100768,7 +100768,7 @@ function wrapHostEditToolWithPostWriteRecovery(base, root) {
|
|
|
100768
100768
|
if (!pathParam || !newText) throw err;
|
|
100769
100769
|
try {
|
|
100770
100770
|
const absolutePath = resolveHostEditPath(root, pathParam);
|
|
100771
|
-
const content = await fs
|
|
100771
|
+
const content = await fs.readFile(absolutePath, "utf-8");
|
|
100772
100772
|
const hasNew = content.includes(newText);
|
|
100773
100773
|
const stillHasOld = oldText !== void 0 && oldText.length > 0 && content.includes(oldText);
|
|
100774
100774
|
if (hasNew && !stillHasOld) return {
|
|
@@ -101239,14 +101239,14 @@ function createSandboxEditOperations(params) {
|
|
|
101239
101239
|
}
|
|
101240
101240
|
async function writeHostFile(absolutePath, content) {
|
|
101241
101241
|
const resolved = path.resolve(absolutePath);
|
|
101242
|
-
await fs
|
|
101243
|
-
await fs
|
|
101242
|
+
await fs.mkdir(path.dirname(resolved), { recursive: true });
|
|
101243
|
+
await fs.writeFile(resolved, content, "utf-8");
|
|
101244
101244
|
}
|
|
101245
101245
|
function createHostWriteOperations(root, options) {
|
|
101246
101246
|
if (!(options?.workspaceOnly ?? false)) return {
|
|
101247
101247
|
mkdir: async (dir) => {
|
|
101248
101248
|
const resolved = path.resolve(dir);
|
|
101249
|
-
await fs
|
|
101249
|
+
await fs.mkdir(resolved, { recursive: true });
|
|
101250
101250
|
},
|
|
101251
101251
|
writeFile: writeHostFile
|
|
101252
101252
|
};
|
|
@@ -101259,7 +101259,7 @@ function createHostWriteOperations(root, options) {
|
|
|
101259
101259
|
cwd: root,
|
|
101260
101260
|
root
|
|
101261
101261
|
});
|
|
101262
|
-
await fs
|
|
101262
|
+
await fs.mkdir(resolved, { recursive: true });
|
|
101263
101263
|
},
|
|
101264
101264
|
writeFile: async (absolutePath, content) => {
|
|
101265
101265
|
await writeFileWithinRoot({
|
|
@@ -101275,12 +101275,12 @@ function createHostEditOperations(root, options) {
|
|
|
101275
101275
|
if (!(options?.workspaceOnly ?? false)) return {
|
|
101276
101276
|
readFile: async (absolutePath) => {
|
|
101277
101277
|
const resolved = path.resolve(absolutePath);
|
|
101278
|
-
return await fs
|
|
101278
|
+
return await fs.readFile(resolved);
|
|
101279
101279
|
},
|
|
101280
101280
|
writeFile: writeHostFile,
|
|
101281
101281
|
access: async (absolutePath) => {
|
|
101282
101282
|
const resolved = path.resolve(absolutePath);
|
|
101283
|
-
await fs
|
|
101283
|
+
await fs.access(resolved);
|
|
101284
101284
|
}
|
|
101285
101285
|
};
|
|
101286
101286
|
return {
|
|
@@ -102440,9 +102440,9 @@ async function readWorkspaceContextForSummary() {
|
|
|
102440
102440
|
if (!opened.ok) return "";
|
|
102441
102441
|
const sections = extractSections((() => {
|
|
102442
102442
|
try {
|
|
102443
|
-
return
|
|
102443
|
+
return syncFs.readFileSync(opened.fd, "utf-8");
|
|
102444
102444
|
} finally {
|
|
102445
|
-
|
|
102445
|
+
syncFs.closeSync(opened.fd);
|
|
102446
102446
|
}
|
|
102447
102447
|
})(), ["Session Startup", "Red Lines"]);
|
|
102448
102448
|
if (sections.length === 0) return "";
|
|
@@ -104240,14 +104240,14 @@ async function compactEmbeddedPiSessionDirect(params) {
|
|
|
104240
104240
|
if (!apiKeyInfo.apiKey) {
|
|
104241
104241
|
if (apiKeyInfo.mode !== "aws-sdk") throw new Error(`No API key resolved for provider "${model.provider}" (auth mode: ${apiKeyInfo.mode}).`);
|
|
104242
104242
|
} else if (model.provider === "github-copilot") {
|
|
104243
|
-
const { resolveCopilotApiToken } = await import("./github-copilot-token-
|
|
104243
|
+
const { resolveCopilotApiToken } = await import("./github-copilot-token-DHoyZ4I0.js").then((n) => n.n);
|
|
104244
104244
|
const copilotToken = await resolveCopilotApiToken({ githubToken: apiKeyInfo.apiKey });
|
|
104245
104245
|
authStorage.setRuntimeApiKey(model.provider, copilotToken.token);
|
|
104246
104246
|
} else authStorage.setRuntimeApiKey(model.provider, apiKeyInfo.apiKey);
|
|
104247
104247
|
} catch (err) {
|
|
104248
104248
|
return fail(describeUnknownError(err));
|
|
104249
104249
|
}
|
|
104250
|
-
await fs
|
|
104250
|
+
await fs.mkdir(resolvedWorkspace, { recursive: true });
|
|
104251
104251
|
const sandboxSessionKey = params.sessionKey?.trim() || params.sessionId;
|
|
104252
104252
|
const sandbox = await resolveSandboxContext({
|
|
104253
104253
|
config: params.config,
|
|
@@ -104256,7 +104256,7 @@ async function compactEmbeddedPiSessionDirect(params) {
|
|
|
104256
104256
|
workspaceLane: params.workspaceLane
|
|
104257
104257
|
});
|
|
104258
104258
|
const effectiveWorkspace = sandbox?.enabled ? sandbox.workspaceAccess === "rw" ? resolvedWorkspace : sandbox.workspaceDir : resolvedWorkspace;
|
|
104259
|
-
await fs
|
|
104259
|
+
await fs.mkdir(effectiveWorkspace, { recursive: true });
|
|
104260
104260
|
let restoreSkillEnv;
|
|
104261
104261
|
const releaseWorkspaceCwd = acquireWorkspaceCwd(effectiveWorkspace);
|
|
104262
104262
|
try {
|
|
@@ -105664,7 +105664,7 @@ var OpenAIWebSocketManager = class extends EventEmitter {
|
|
|
105664
105664
|
* Throws if the connection is not open.
|
|
105665
105665
|
*/
|
|
105666
105666
|
send(event) {
|
|
105667
|
-
if (!this.ws || this.ws.readyState !== WebSocket
|
|
105667
|
+
if (!this.ws || this.ws.readyState !== WebSocket.OPEN) throw new Error(`OpenAIWebSocketManager: cannot send — connection is not open (readyState=${this.ws?.readyState ?? "no socket"})`);
|
|
105668
105668
|
this.ws.send(JSON.stringify(event));
|
|
105669
105669
|
}
|
|
105670
105670
|
/**
|
|
@@ -105681,7 +105681,7 @@ var OpenAIWebSocketManager = class extends EventEmitter {
|
|
|
105681
105681
|
* Returns true if the WebSocket is currently open and ready to send.
|
|
105682
105682
|
*/
|
|
105683
105683
|
isConnected() {
|
|
105684
|
-
return this.ws !== null && this.ws.readyState === WebSocket
|
|
105684
|
+
return this.ws !== null && this.ws.readyState === WebSocket.OPEN;
|
|
105685
105685
|
}
|
|
105686
105686
|
/**
|
|
105687
105687
|
* Permanently closes the WebSocket connection and disables auto-reconnect.
|
|
@@ -105691,7 +105691,7 @@ var OpenAIWebSocketManager = class extends EventEmitter {
|
|
|
105691
105691
|
this._cancelRetryTimer();
|
|
105692
105692
|
if (this.ws) {
|
|
105693
105693
|
this.ws.removeAllListeners();
|
|
105694
|
-
if (this.ws.readyState === WebSocket
|
|
105694
|
+
if (this.ws.readyState === WebSocket.OPEN || this.ws.readyState === WebSocket.CONNECTING) this.ws.close(1e3, "Client closed");
|
|
105695
105695
|
this.ws = null;
|
|
105696
105696
|
}
|
|
105697
105697
|
}
|
|
@@ -105701,7 +105701,7 @@ var OpenAIWebSocketManager = class extends EventEmitter {
|
|
|
105701
105701
|
reject(/* @__PURE__ */ new Error("OpenAIWebSocketManager: apiKey is required before connecting."));
|
|
105702
105702
|
return;
|
|
105703
105703
|
}
|
|
105704
|
-
const socket = new WebSocket
|
|
105704
|
+
const socket = new WebSocket(this.wsUrl, { headers: {
|
|
105705
105705
|
Authorization: `Bearer ${this.apiKey}`,
|
|
105706
105706
|
"OpenAI-Beta": "responses-websocket=v1"
|
|
105707
105707
|
} });
|
|
@@ -110064,7 +110064,7 @@ async function runEmbeddedAttempt(params) {
|
|
|
110064
110064
|
let embeddedAttemptBegun = false;
|
|
110065
110065
|
const runAbortController = new AbortController();
|
|
110066
110066
|
log$52.debug(`embedded run start: runId=${params.runId} sessionId=${params.sessionId} provider=${params.provider} model=${params.modelId} thinking=${params.thinkLevel} messageChannel=${params.messageChannel ?? params.messageProvider ?? "unknown"}`);
|
|
110067
|
-
await fs
|
|
110067
|
+
await fs.mkdir(resolvedWorkspace, { recursive: true });
|
|
110068
110068
|
const sandboxSessionKey = params.sessionKey?.trim() || params.sessionId;
|
|
110069
110069
|
const toolSessionKey = params.toolSessionKey?.trim() || sandboxSessionKey;
|
|
110070
110070
|
const sandbox = params.skipSandbox ? null : await resolveSandboxContext({
|
|
@@ -110074,7 +110074,7 @@ async function runEmbeddedAttempt(params) {
|
|
|
110074
110074
|
workspaceLane: params.workspaceLane
|
|
110075
110075
|
});
|
|
110076
110076
|
const effectiveWorkspace = sandbox?.enabled ? sandbox.workspaceAccess === "rw" ? resolvedWorkspace : sandbox.workspaceDir : resolvedWorkspace;
|
|
110077
|
-
await fs
|
|
110077
|
+
await fs.mkdir(effectiveWorkspace, { recursive: true });
|
|
110078
110078
|
let restoreSkillEnv;
|
|
110079
110079
|
const releaseWorkspaceCwd = params.skipCwdChange ? void 0 : acquireWorkspaceCwd(effectiveWorkspace);
|
|
110080
110080
|
try {
|
|
@@ -111725,7 +111725,7 @@ async function runEmbeddedPiAgent(params) {
|
|
|
111725
111725
|
await copilotTokenState.refreshInFlight;
|
|
111726
111726
|
return;
|
|
111727
111727
|
}
|
|
111728
|
-
const { resolveCopilotApiToken } = await import("./github-copilot-token-
|
|
111728
|
+
const { resolveCopilotApiToken } = await import("./github-copilot-token-DHoyZ4I0.js").then((n) => n.n);
|
|
111729
111729
|
copilotTokenState.refreshInFlight = (async () => {
|
|
111730
111730
|
const githubToken = copilotTokenState.githubToken.trim();
|
|
111731
111731
|
if (!githubToken) throw new Error("Copilot refresh requires a GitHub token.");
|
|
@@ -111817,7 +111817,7 @@ async function runEmbeddedPiAgent(params) {
|
|
|
111817
111817
|
return;
|
|
111818
111818
|
}
|
|
111819
111819
|
if (model.provider === "github-copilot") {
|
|
111820
|
-
const { resolveCopilotApiToken } = await import("./github-copilot-token-
|
|
111820
|
+
const { resolveCopilotApiToken } = await import("./github-copilot-token-DHoyZ4I0.js").then((n) => n.n);
|
|
111821
111821
|
const copilotToken = await resolveCopilotApiToken({ githubToken: apiKeyInfo.apiKey });
|
|
111822
111822
|
authStorage.setRuntimeApiKey(model.provider, copilotToken.token);
|
|
111823
111823
|
if (copilotTokenState) {
|
|
@@ -111939,7 +111939,7 @@ async function runEmbeddedPiAgent(params) {
|
|
|
111939
111939
|
const copilotAuthRetry = authRetryPending;
|
|
111940
111940
|
authRetryPending = false;
|
|
111941
111941
|
attemptedThinking.add(thinkLevel);
|
|
111942
|
-
await fs
|
|
111942
|
+
await fs.mkdir(resolvedWorkspace, { recursive: true });
|
|
111943
111943
|
const prompt = provider === "anthropic" ? scrubAnthropicRefusalMagic(params.prompt) : params.prompt;
|
|
111944
111944
|
const attempt = await runEmbeddedAttempt({
|
|
111945
111945
|
sessionId: params.sessionId,
|