wednesdayai 0.6.1-dev.27 → 0.6.1-dev.28
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-CQhgyAis.js → agent-BDuI5Zvc.js} +26 -26
- package/dist/{agent-Y_2aRBZH.js → agent-BW-Yan08.js} +11 -11
- package/dist/{agent-turn-runner-faZvyYiv.js → agent-turn-runner-BfXiXNe2.js} +6 -6
- package/dist/{agent-turn-runner-ClBJoKQQ.js → agent-turn-runner-CHm-I95T.js} +5 -5
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +32 -32
- package/dist/bundled/bootstrap-extra-files/handler.js +4 -4
- package/dist/bundled/command-logger/handler.js +2 -2
- package/dist/bundled/session-journal/handler.js +31 -31
- package/dist/bundled/session-memory/handler.js +31 -31
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{chrome-B3nEcesV.js → chrome-CKy31bWh.js} +32 -32
- package/dist/{chrome-DLbFTDQE.js → chrome-Ct9vb6SC.js} +12 -12
- package/dist/{command-queue-BSbitNdP.js → command-queue-AIWqKnVD.js} +1 -1
- package/dist/{command-queue-BijpV9rd.js → command-queue-CNStMA4Y.js} +1 -1
- package/dist/control-ui-v2/assets/{AgentsView-DVvw6PTU.js → AgentsView-3Qsr3xnf.js} +1 -1
- package/dist/control-ui-v2/assets/{AutomationsView-CxjmPRdI.js → AutomationsView-DkBzPKKQ.js} +1 -1
- package/dist/control-ui-v2/assets/Badge-CB5TWfdz.js +1 -0
- package/dist/control-ui-v2/assets/{Button-DL76WqX4.js → Button-CGdLofSY.js} +1 -1
- package/dist/control-ui-v2/assets/{ChannelsView-BDcVzQIM.js → ChannelsView-BRb8eYyh.js} +1 -1
- package/dist/control-ui-v2/assets/{ConfigForm-CbvOdyOA.js → ConfigForm-D8_bqW8x.js} +1 -1
- package/dist/control-ui-v2/assets/{ConfirmDialog-DGHQXUr5.js → ConfirmDialog-B7aotBjN.js} +1 -1
- package/dist/control-ui-v2/assets/{DataTable-lEkd1R85.js → DataTable-CSi930kO.js} +1 -1
- package/dist/control-ui-v2/assets/{DebugView-CHHmLv3x.js → DebugView-8cZqh6FQ.js} +1 -1
- package/dist/control-ui-v2/assets/{Dialog-rIrrCPSu.js → Dialog-CQE8Pvh6.js} +1 -1
- package/dist/control-ui-v2/assets/{DreamsView-uQSpm1S4.js → DreamsView-B0KzP2OM.js} +1 -1
- package/dist/control-ui-v2/assets/{EntityLink-AEBgCNQX.js → EntityLink-BO2oG3y8.js} +1 -1
- package/dist/control-ui-v2/assets/{FilterPills-HxAXXDO8.js → FilterPills-9pNaAyrL.js} +1 -1
- package/dist/control-ui-v2/assets/{InstancesView-Svk7C7AX.js → InstancesView-BbunCxYg.js} +1 -1
- package/dist/control-ui-v2/assets/{LearningView-CWqWycCM.js → LearningView-CEqD48Ll.js} +1 -1
- package/dist/control-ui-v2/assets/{LogsView-D7kaR6es.js → LogsView-fcI0vxkz.js} +1 -1
- package/dist/control-ui-v2/assets/{NodesView-CqKA1XAX.js → NodesView-BONHE7EP.js} +1 -1
- package/dist/control-ui-v2/assets/{OverviewView-Dz3YnxWP.js → OverviewView-BpynJnjy.js} +1 -1
- package/dist/control-ui-v2/assets/{Panel-CyfpswdJ.js → Panel-9wOynsWc.js} +1 -1
- package/dist/control-ui-v2/assets/{PluginMount-C1HeSpS9.js → PluginMount-6N20-nhI.js} +1 -1
- package/dist/control-ui-v2/assets/{PluginPageView-Dap5OwAt.js → PluginPageView-DZ3bh805.js} +1 -1
- package/dist/control-ui-v2/assets/{PluginPanels-DdDZQ_Dn.js → PluginPanels-DulRlgcm.js} +1 -1
- package/dist/control-ui-v2/assets/{RunsView-CQXkKsIZ.js → RunsView-dcBTwtFX.js} +1 -1
- package/dist/control-ui-v2/assets/{SessionsView-Bs9UqOQr.js → SessionsView-CZuTvckb.js} +1 -1
- package/dist/control-ui-v2/assets/{SettingsView-BhorzAw5.js → SettingsView-BTcubWvr.js} +1 -1
- package/dist/control-ui-v2/assets/{SkillsView-ClzUjPU-.js → SkillsView-Bj7lvW23.js} +1 -1
- package/dist/control-ui-v2/assets/{Stat-BruDi6qc.js → Stat-BZwg1PGE.js} +1 -1
- package/dist/control-ui-v2/assets/{StatusDot-Cij-6nH8.js → StatusDot-DHhJ1VpB.js} +1 -1
- package/dist/control-ui-v2/assets/{StorageView-BYgvfNcg.js → StorageView-B5cF1lld.js} +1 -1
- package/dist/control-ui-v2/assets/{UpdatedAgo-DWSnE4WG.js → UpdatedAgo-Dw3kxb2x.js} +1 -1
- package/dist/control-ui-v2/assets/{UsageView-C_ezU9jy.js → UsageView-DBZ1WkEI.js} +1 -1
- package/dist/control-ui-v2/assets/{config-store-27hOx1yp.js → config-store-XvvVJ8Fq.js} +1 -1
- package/dist/control-ui-v2/assets/{format-dlOOV12I.js → format-CGs6a1G6.js} +1 -1
- package/dist/control-ui-v2/assets/gateway-features-BZH74_Oc.js +1 -0
- package/dist/control-ui-v2/assets/{index-OijNknZs.js → index-BvXiY83i.js} +1 -1
- package/dist/control-ui-v2/assets/{links-C1sAzVEH.js → links-DlVrQOFC.js} +2 -2
- package/dist/control-ui-v2/assets/{run-rows-BYCIH1Sn.js → run-rows-Au2UUkD7.js} +1 -1
- package/dist/control-ui-v2/assets/{runs-store-DLIlHRM6.js → runs-store-DXgNPFWM.js} +1 -1
- package/dist/control-ui-v2/assets/{use-gateway-query-CF94JYnM.js → use-gateway-query-D25QZANO.js} +1 -1
- package/dist/control-ui-v2/index.html +7 -7
- package/dist/{deliver-CY4Fs4RX.js → deliver-DsuMPE0S.js} +28 -28
- package/dist/{deliver-xfGDp6XD.js → deliver-DxVojbH7.js} +6 -6
- package/dist/{diagnostic-S8OX1Eq2.js → diagnostic-C4pLNG6a.js} +1 -1
- package/dist/{diagnostic-BZYYYnMx.js → diagnostic-DJ11ZJIJ.js} +3 -3
- package/dist/{errors-BRYMqzPb.js → errors-0-at0aYV.js} +1 -1
- package/dist/extensionAPI.js +24 -24
- package/dist/{fences-Dtk43Q2a.js → fences-Z8d1dj8p.js} +16 -16
- package/dist/{fences-DbKcVN_n.js → fences-j5vzXLXf.js} +1 -1
- package/dist/{fetch-guard-UCuiKQ5E.js → fetch-guard-BQ-NMG7L.js} +2 -2
- package/dist/{fetch-guard-DuBGo4VE.js → fetch-guard-BaBd9ZVm.js} +2 -2
- package/dist/{frontmatter-DHBTRDiB.js → frontmatter-CzhUc9Ri.js} +5 -5
- package/dist/{fs-safe-Bk4Thq7a.js → fs-safe-Bd1xxVwv.js} +1 -1
- package/dist/{fs-safe-CyG0wflg.js → fs-safe-DMWtsz4J.js} +26 -26
- package/dist/{legacy-names-6uH6aLhq.js → legacy-names-chsmo2vs.js} +26 -26
- package/dist/llm-slug-generator.js +31 -31
- package/dist/{manager-BvLLls5L.js → manager-B4xc1xN6.js} +16 -16
- package/dist/{manager-Cf3W8LKj.js → manager-CD-sBxdS.js} +3 -3
- package/dist/{model-selection-Ca4WCV4n.js → model-selection-CYS--Nqz.js} +1 -1
- package/dist/{model-selection-CbMZx9fR.js → model-selection-Ds5bEVQ2.js} +82 -82
- package/dist/{nudge-DelcKR7z.js → nudge-CKFTN2YI.js} +9 -9
- package/dist/{nudge-Dd9wU1K5.js → nudge-DZuNGDE_.js} +32 -32
- package/dist/{outbound-attachment-CKATrxgO.js → outbound-attachment-BsEApkFu.js} +9 -9
- package/dist/{outbound-attachment-Btl5f-Lu.js → outbound-attachment-DHLTkCuI.js} +4 -4
- package/dist/{pi-embedded-ApthdT0k.js → pi-embedded-C8SqFziv.js} +40 -40
- package/dist/{pi-embedded-D-4wht-f.js → pi-embedded-yXKiYEGf.js} +229 -229
- package/dist/{pi-model-discovery-Dgbp4zjx.js → pi-model-discovery-CtfGh_up.js} +7 -7
- package/dist/{pi-model-discovery-D-D_mngz.js → pi-model-discovery-De5Z6lro.js} +1 -1
- package/dist/{proxy-env-v_oj7Urd.js → proxy-env-D4WYaw6X.js} +1 -1
- package/dist/{proxy-env-BRG1LWK1.js → proxy-env-DPCNy_X3.js} +1 -1
- package/dist/{pw-ai-BH-MmrGa.js → pw-ai-BmuDO1HM.js} +5 -5
- package/dist/{pw-ai-DK4N7_nV.js → pw-ai-ohfJZ9jX.js} +11 -11
- package/dist/{qmd-manager-Cdz2xlNp.js → qmd-manager-2dro3Ccn.js} +9 -9
- package/dist/{qmd-manager-NT_CKYQG.js → qmd-manager-CgZ9ng9u.js} +4 -4
- package/dist/{qmd-scope-CyWbQgiS.js → qmd-scope-DMUA3Vq9.js} +1 -1
- package/dist/{qmd-scope-hzI66flw.js → qmd-scope-RFd-g5Qi.js} +1 -1
- package/dist/{query-expansion-CPkdZdty.js → query-expansion-DQ8zm-TE.js} +1 -1
- package/dist/{query-expansion-feTsk3WF.js → query-expansion-GZKwviqQ.js} +13 -13
- package/dist/{recorder-DCGoPaKG.js → recorder-DA5NY6nl.js} +1 -1
- package/dist/{recorder-C3f7IlHZ.js → recorder-dKE74HOC.js} +2 -2
- package/dist/{redact-C4XKILzo.js → redact-LOuk7TRy.js} +1 -1
- package/dist/{reply-directives-BjV2MFIq.js → reply-directives-8FtYI79u.js} +9 -9
- package/dist/{reply-directives-ToqsETSh.js → reply-directives-CE9WoRyW.js} +49 -49
- package/dist/{runs-CPjMwHXQ.js → runs-BIabbRe5.js} +8 -8
- package/dist/{runs-D7qs08K3.js → runs-Dw8BeXyu.js} +5 -5
- package/dist/{send-BnVk7V-5.js → send-BQzswQlt.js} +5 -5
- package/dist/{send-DDBl5H1k.js → send-BTp_lz-m.js} +4 -4
- package/dist/{send-B9huC0Lk.js → send-CWcFiq7U.js} +3 -3
- package/dist/{send-Cj5zKV3M.js → send-DW_8PsC0.js} +4 -4
- package/dist/{sessions-zel35iDK.js → sessions-Bz8mUwgo.js} +5 -5
- package/dist/{sessions-CXuFR_IY.js → sessions-DKv9bCbi.js} +1 -1
- package/dist/{subsystem-DoQFckDJ.js → subsystem-cFv2jJm-.js} +71 -71
- package/dist/{tool-loop-detection-CtOkwPJY.js → tool-loop-detection-9fAxiikd.js} +2 -2
- package/dist/{user-run-recording-BVpLQDqe.js → user-run-recording-C1LRU5Lb.js} +2 -2
- package/dist/{user-run-recording-C10wwXyW.js → user-run-recording-CWRiZJsh.js} +1 -1
- package/dist/web-client/assets/{hast-util-from-dom-CvePVP6E.js → hast-util-from-dom-BoP9fB2c.js} +1 -1
- package/dist/web-client/assets/{hast-util-to-mdast-CwugKdbc.js → hast-util-to-mdast-Bo07nYTv.js} +1 -1
- package/dist/web-client/assets/{index-CFHLAWrp.js → index-CwqOe0fG.js} +2 -2
- package/dist/web-client/index.html +1 -1
- package/dist/{ws-2U5gNvRt.js → ws-Do6yaRWR.js} +1 -1
- package/dist/{ws-DrXm3NWZ.js → ws-Dt2EocLN.js} +1 -1
- package/extensions/a2a/package.json +1 -1
- 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/identity-oidc/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/kokoro/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 +1 -1
- 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 +1 -1
- package/extensions/msteams/package.json +1 -1
- package/extensions/nextcloud-talk/package.json +1 -1
- package/extensions/nostr/CHANGELOG.md +1 -1
- 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 +1 -1
- package/extensions/twitch/package.json +1 -1
- package/extensions/ui-surfaces/package.json +1 -1
- package/extensions/voice-call/CHANGELOG.md +1 -1
- 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 +1 -1
- package/extensions/zalo/package.json +1 -1
- package/extensions/zalouser/CHANGELOG.md +1 -1
- package/extensions/zalouser/package.json +1 -1
- package/package.json +1 -1
- package/dist/control-ui-v2/assets/Badge-4n2tRQ02.js +0 -1
- package/dist/control-ui-v2/assets/gateway-features-BIj6-KTX.js +0 -1
- package/dist/github-copilot-token-Bm6yG6tw.js +0 -106
- package/dist/paths-BIDPYPVC.js +0 -233
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
|
-
import { $ as unsetConfigValueAtPath, $i as isPidAlive, $n as deriveSessionMetaPatch, $r as applyTargetToParams, $t as clearRegisteredPluginApis, A as resolveApiKeyForProvider, Aa as resolveAgentModelFallbackValues, Ai as resolveSecretRefValues, An as readSessionUpdatedAt, Ar as INTERNAL_MESSAGE_CHANNEL, At as applyTestPluginDefaults, B as resolveApiKeyForProfile, Bi as resolveShellEnvFallbackTimeoutMs, Br as GATEWAY_CLIENT_MODES, Bt as getChatChannelMeta, C as buildAssistantMessage, Ca as resolveAgentWorkspaceDir, Ci as unwrapKnownDispatchWrapperInvocation, Cn as closeConfiguredSessionStorageRuntime, Cr as resolveConversationLabel, Ct as buildChannelAccountBindings, D as getApiKeyForModel, Da as resolveSessionAgentId, Di as normalizeSafeBinProfileFixtures, Dn as refreshConfiguredSessionBindingEntry, Dr as mergeDeliveryContext, Dt as DOCS_SITE_URL, E as buildUsageWithNoCost, Ea as resolveRunModelFallbacksOverride, Ei as SAFE_BIN_PROFILES, En as prepareConfiguredSessionStorageRuntimeActivation, Er as deliveryContextKey, Et as loadPluginManifestRegistry, F as getSoonestCooldownExpiry, Fi as secretRefKey, Fr as listDeliverableMessageChannels, Ft as discoverOpenClawPlugins, G as createConfigIO, Gi as applyMergePatch, Gn as resolveStorePath, Gt as resolveChannelConfigId, H as readConfigFileSnapshot, Hi as resolveOwnerDisplaySetting, Hn as resolveSessionFilePathOptions, Ht as normalizeAnyChannelId, I as isProfileInCooldown, Ii as runTasksWithConcurrency, Ir as normalizeMessageChannel, It as isPathInside, J as setConfigOverride, Ji as markAuthProfileGood, Jt as getActivePluginRegistryKey, K as getConfigOverrides, Ki as dedupeProfileIds, Kn as acquireSessionWriteLock, Kt as getActiveGatewayPluginRegistry, L as markAuthProfileFailure, Li as DEFAULT_SUBAGENT_MAX_SPAWN_DEPTH, Lr as resolveGatewayMessageChannel, Lt as safeStatSync, M as resolveModelAuthMode, Ma as toAgentModelListLike, Mi as isNonEmptyString, Mn as getConfiguredSessionStorageRuntime, Mt as normalizePluginsConfig, Ni as isRecord$1, Nr as isInternalMessageChannel, Nt as resolveEffectiveEnableState, O as getCustomProviderApiKey, Oa as resolveSessionAgentIds, Oi as resolveSafeBinProfiles, On as loadSessionStore, Or as normalizeDeliveryContext, Ot as docsSiteUrl, P as resolveAuthProfileOrder, Pi as parseDotPath, Pn as parseSessionIndexRecordKey, Pr as isMarkdownCapableMessageChannel, Pt as resolveMemorySlotDecision, Q as setConfigValueAtPath, Qi as withFileLock$1, Qr as stringEnum, Qt as addRegisteredPluginApi, R as markAuthProfileUsed, Ri as VERSION, Rn as SAFE_SESSION_ID_RE, Rr as resolveMessageChannel, S as createOllamaStreamFn, Sa as resolveAgentSkillsFilter, Si as isShellWrapperExecutable, Sn as updateSessionStoreEntry, Sr as resolveAccountEntry, T as buildStreamErrorAssistantMessage, Ti as splitShellArgs, Tn as commitPreparedConfiguredSessionStorageRuntimeActivation, Tr as deliveryContextFromSession, Tt as validateJsonSchemaValue, U as readConfigFileSnapshotForWrite, Ui as advanceRuntimeConfigSnapshot, Un as resolveSessionTranscriptPath, Ur as CtxProjectionCorruptionError, Ut as normalizeChannelId$2, V as loadConfig, Vi as isTruthyEnvValue, Vn as resolveSessionFilePath, Vr as GATEWAY_CLIENT_NAMES, Vt as listChatChannels, W as writeConfigFile, Wi as getRuntimeConfigSnapshot, Wr as readTaskWorkStates, Wt as normalizeChatChannelId, X as getConfigValueAtPath, Xi as resolveAuthStorePathForDisplay, Xn as mergeSessionEntry, Xr as channelTargetsSchema, Xt as requireActivePluginRegistry, Y as unsetConfigOverride, Yi as ensureAuthProfileStore, Yn as DEFAULT_RESET_TRIGGERS, Yr as channelTargetSchema, Z as parseConfigPath, Zi as resolveOpenClawAgentDir, Zn as resolveFreshSessionTotalTokens, Zr as optionalStringEnum, Zt as setActivePluginRegistry, _a as listAgentIds, _i as matchAllowlist, _r as resolveCliName, a as isCliProvider, aa as hasConfiguredSecretInput, ai as replaceBufferedPluginTaskPasses, an as listPluginCommands, ar as listChannelDocks, at as resolveIMessageRemoteAttachmentRoots, b as retryAsync, bi as extractShellWrapperInlineCommand, bn as updateLastRoute, br as resolveChannelGroupRequireMention, c as normalizeProviderId, ca as splitTrailingAuthProfile, ci as isTrustedSafeBinPath, cn as BUILTIN_TTS_PROVIDER_IDS, cr as listChannelPlugins, d as resolveDefaultModelForAgent, da as DEFAULT_PROVIDER, di as validateSafeBinArgv, dn as isBuiltinTtsProvider, dr as resolveSignalAccount, ea as readProcessElapsedSeconds, ei as actionHasTarget, en as createPluginRegistry, er as resolveGroupSessionKey, et as validateConfigObjectWithPlugins, f as resolveModelRefFromString, fa as acceptsInheritedIdentity, fi as analyzeShellCommand, fn as replaceSpeechProviders, fr as isWhatsAppGroupJid, gi as DEFAULT_SAFE_BINS, gn as getConversationReadQuery, gr as formatCliCommand, h as resolveThinkingDefault, ha as isInternalAgentSessionKey, hi as splitCommandChain, hn as createConversationReadQuery, hr as resolveWhatsAppAccount, i as findNormalizedProviderValue, ia as coerceSecretRef, ii as listBufferedPluginTaskPasses, in as executePluginCommand, ir as getChannelDock, it as resolveIMessageAttachmentRoots, j as resolveEnvApiKey, ja as resolveAgentModelPrimaryValue, ji as describeUnknownError$1, jn as parseDurationMs, jr as isDeliverableMessageChannel, jt as isBundledChannelEnabledByChannelConfig, k as requireApiKey, ki as isSafeExecutableValue, kn as loadSessionStoreFromDisk, kr as normalizeSessionDeliveryFields, kt as BUNDLED_ENABLED_BY_DEFAULT, l as parseModelRef, la as DEFAULT_CONTEXT_TOKENS, li as listWritableExplicitTrustedSafeBinDirs, ln as getRegisteredSpeechProviders, lr as normalizeChannelId$1, lt as resolveExecPolicyPreset, m as resolveSubagentSpawnModelSelection, ma as isAgentUserFacing, mi as isWindowsPlatform, mn as StorageReadAccessError, mr as hasAnyWhatsAppAuth, n as buildConfiguredAllowlistKeys, nn as buildPluginHealthReport, nr as normalizeAtHashSlug, nt as isInboundPathAllowed, o as modelKey, oa as normalizeResolvedSecretInputString, oi as RecoveryAdmissionError, on as matchPluginCommand, or as normalizeSignalMessagingTarget, ot as normalizeScpRemoteHost, p as resolveReasoningDefault, pa as hasConfiguredModelFallbacks, pi as buildEnforcedShellCommand, pn as normalizeProviderId$1, pr as normalizeWhatsAppTarget, q as resetConfigOverrides, qi as listProfilesForProvider, qn as resolveSessionLockMaxHoldFromTimeout, qt as getActivePluginRegistry, r as buildModelAliasIndex, ra as normalizeSecretInput, ri as discardBufferedPluginTaskPasses, rn as clearPluginCommands, rr as normalizeStringEntries, rt as mergeInboundPathRoots, s as normalizeModelRef$1, sa as resolveSecretInputRef, si as getTrustedSafeBinDirs, sn as registerPluginCommand, sr as getChannelPlugin, st as parseNonNegativeByteSize, t as buildAllowedModelSet, ta as resolveAuthProfileDisplayLabel, ti as actionRequiresTarget, tn as normalizePluginHttpPath, tr as resolveParentSessionGroupId, tt as DEFAULT_IMESSAGE_ATTACHMENT_ROOTS, u as resolveConfiguredModelRef, ua as DEFAULT_MODEL, ui as normalizeTrustedSafeBinDirs, un as getSpeechProvider, ur as listEnabledSignalAccounts, va as resolveAgentConfig, vi as resolveAllowlistCandidatePath, vn as requireSessionStorageRuntime, vr as resolveIMessageAccount, w as buildAssistantMessageWithZeroUsage, wa as resolveDefaultAgentId, wi as unwrapKnownShellMultiplexerInvocation, wn as closeReplacedConfiguredSessionStorageRuntime, wr as normalizeChatType, wt as listBindings, x as OLLAMA_NATIVE_BASE_URL, xi as isDispatchWrapperExecutable, xn as updateSessionStore, xr as resolveChannelGroupToolsPolicy, ya as resolveAgentDir, yi as resolveCommandResolutionFromArgv, yn as recordSessionMetaFromInbound, yr as resolveChannelGroupPolicy, z as resolveProfilesUnavailableReason, zi as getShellPathFromLoginShell, zn as SESSION_RUN_STORE_FILE_NAME, zr as GATEWAY_CLIENT_IDS, zt as CHAT_CHANNEL_ORDER } from "./model-selection-
|
|
3
|
-
import { a as resolveGatewayLockDir, f as resolveRequiredHomeDir, l as resolveStateDir, o as resolveGatewayPort, r as resolveConfigPath, s as resolveOAuthDir, 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, U as isSymlinkOpenError, V as isNotFoundPathError, W as normalizeWindowsPathForComparison, Z as CONFIG_DIR, _ as colorize, a as createNonExitingRuntime, b as getChildLogger, c as registerActiveProgressLine, ct as safeParseJson, dt as sleep$2, 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$2, 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 unsetConfigValueAtPath, $i as isPidAlive, $n as deriveSessionMetaPatch, $r as applyTargetToParams, $t as clearRegisteredPluginApis, A as resolveApiKeyForProvider, Aa as resolveAgentModelFallbackValues, Ai as resolveSecretRefValues, An as readSessionUpdatedAt, Ar as INTERNAL_MESSAGE_CHANNEL, At as applyTestPluginDefaults, B as resolveApiKeyForProfile, Bi as resolveShellEnvFallbackTimeoutMs, Br as GATEWAY_CLIENT_MODES, Bt as getChatChannelMeta, C as buildAssistantMessage, Ca as resolveAgentWorkspaceDir, Ci as unwrapKnownDispatchWrapperInvocation, Cn as closeConfiguredSessionStorageRuntime, Cr as resolveConversationLabel, Ct as buildChannelAccountBindings, D as getApiKeyForModel, Da as resolveSessionAgentId, Di as normalizeSafeBinProfileFixtures, Dn as refreshConfiguredSessionBindingEntry, Dr as mergeDeliveryContext, Dt as DOCS_SITE_URL, E as buildUsageWithNoCost, Ea as resolveRunModelFallbacksOverride, Ei as SAFE_BIN_PROFILES, En as prepareConfiguredSessionStorageRuntimeActivation, Er as deliveryContextKey, Et as loadPluginManifestRegistry, F as getSoonestCooldownExpiry, Fi as secretRefKey, Fr as listDeliverableMessageChannels, Ft as discoverOpenClawPlugins, G as createConfigIO, Gi as applyMergePatch, Gn as resolveStorePath, Gt as resolveChannelConfigId, H as readConfigFileSnapshot, Hi as resolveOwnerDisplaySetting, Hn as resolveSessionFilePathOptions, Ht as normalizeAnyChannelId, I as isProfileInCooldown, Ii as runTasksWithConcurrency, Ir as normalizeMessageChannel, It as isPathInside, J as setConfigOverride, Ji as markAuthProfileGood, Jt as getActivePluginRegistryKey, K as getConfigOverrides, Ki as dedupeProfileIds, Kn as acquireSessionWriteLock, Kt as getActiveGatewayPluginRegistry, L as markAuthProfileFailure, Li as DEFAULT_SUBAGENT_MAX_SPAWN_DEPTH, Lr as resolveGatewayMessageChannel, Lt as safeStatSync, M as resolveModelAuthMode, Ma as toAgentModelListLike, Mi as isNonEmptyString, Mn as getConfiguredSessionStorageRuntime, Mt as normalizePluginsConfig, Ni as isRecord$1, Nr as isInternalMessageChannel, Nt as resolveEffectiveEnableState, O as getCustomProviderApiKey, Oa as resolveSessionAgentIds, Oi as resolveSafeBinProfiles, On as loadSessionStore, Or as normalizeDeliveryContext, Ot as docsSiteUrl, P as resolveAuthProfileOrder, Pi as parseDotPath, Pn as parseSessionIndexRecordKey, Pr as isMarkdownCapableMessageChannel, Pt as resolveMemorySlotDecision, Q as setConfigValueAtPath, Qi as withFileLock$1, Qr as stringEnum, Qt as addRegisteredPluginApi, R as markAuthProfileUsed, Ri as VERSION, Rn as SAFE_SESSION_ID_RE, Rr as resolveMessageChannel, S as createOllamaStreamFn, Sa as resolveAgentSkillsFilter, Si as isShellWrapperExecutable, Sn as updateSessionStoreEntry, Sr as resolveAccountEntry, T as buildStreamErrorAssistantMessage, Ti as splitShellArgs, Tn as commitPreparedConfiguredSessionStorageRuntimeActivation, Tr as deliveryContextFromSession, Tt as validateJsonSchemaValue, U as readConfigFileSnapshotForWrite, Ui as advanceRuntimeConfigSnapshot, Un as resolveSessionTranscriptPath, Ur as CtxProjectionCorruptionError, Ut as normalizeChannelId$2, V as loadConfig, Vi as isTruthyEnvValue, Vn as resolveSessionFilePath, Vr as GATEWAY_CLIENT_NAMES, Vt as listChatChannels, W as writeConfigFile, Wi as getRuntimeConfigSnapshot, Wr as readTaskWorkStates, Wt as normalizeChatChannelId, X as getConfigValueAtPath, Xi as resolveAuthStorePathForDisplay, Xn as mergeSessionEntry, Xr as channelTargetsSchema, Xt as requireActivePluginRegistry, Y as unsetConfigOverride, Yi as ensureAuthProfileStore, Yn as DEFAULT_RESET_TRIGGERS, Yr as channelTargetSchema, Z as parseConfigPath, Zi as resolveOpenClawAgentDir, Zn as resolveFreshSessionTotalTokens, Zr as optionalStringEnum, Zt as setActivePluginRegistry, _a as listAgentIds, _i as matchAllowlist, _r as resolveCliName, a as isCliProvider, aa as hasConfiguredSecretInput, ai as replaceBufferedPluginTaskPasses, an as listPluginCommands, ar as listChannelDocks, at as resolveIMessageRemoteAttachmentRoots, b as retryAsync, bi as extractShellWrapperInlineCommand, bn as updateLastRoute, br as resolveChannelGroupRequireMention, c as normalizeProviderId, ca as splitTrailingAuthProfile, ci as isTrustedSafeBinPath, cn as BUILTIN_TTS_PROVIDER_IDS, cr as listChannelPlugins, d as resolveDefaultModelForAgent, da as DEFAULT_PROVIDER, di as validateSafeBinArgv, dn as isBuiltinTtsProvider, dr as resolveSignalAccount, ea as readProcessElapsedSeconds, ei as actionHasTarget, en as createPluginRegistry, er as resolveGroupSessionKey, et as validateConfigObjectWithPlugins, f as resolveModelRefFromString, fa as acceptsInheritedIdentity, fi as analyzeShellCommand, fn as replaceSpeechProviders, fr as isWhatsAppGroupJid, gi as DEFAULT_SAFE_BINS, gn as getConversationReadQuery, gr as formatCliCommand, h as resolveThinkingDefault, ha as isInternalAgentSessionKey, hi as splitCommandChain, hn as createConversationReadQuery, hr as resolveWhatsAppAccount, i as findNormalizedProviderValue, ia as coerceSecretRef, ii as listBufferedPluginTaskPasses, in as executePluginCommand, ir as getChannelDock, it as resolveIMessageAttachmentRoots, j as resolveEnvApiKey, ja as resolveAgentModelPrimaryValue, ji as describeUnknownError$1, jn as parseDurationMs, jr as isDeliverableMessageChannel, jt as isBundledChannelEnabledByChannelConfig, k as requireApiKey, ki as isSafeExecutableValue, kn as loadSessionStoreFromDisk, kr as normalizeSessionDeliveryFields, kt as BUNDLED_ENABLED_BY_DEFAULT, l as parseModelRef, la as DEFAULT_CONTEXT_TOKENS, li as listWritableExplicitTrustedSafeBinDirs, ln as getRegisteredSpeechProviders, lr as normalizeChannelId$1, lt as resolveExecPolicyPreset, m as resolveSubagentSpawnModelSelection, ma as isAgentUserFacing, mi as isWindowsPlatform, mn as StorageReadAccessError, mr as hasAnyWhatsAppAuth, n as buildConfiguredAllowlistKeys, nn as buildPluginHealthReport, nr as normalizeAtHashSlug, nt as isInboundPathAllowed, o as modelKey, oa as normalizeResolvedSecretInputString, oi as RecoveryAdmissionError, on as matchPluginCommand, or as normalizeSignalMessagingTarget, ot as normalizeScpRemoteHost, p as resolveReasoningDefault, pa as hasConfiguredModelFallbacks, pi as buildEnforcedShellCommand, pn as normalizeProviderId$1, pr as normalizeWhatsAppTarget, q as resetConfigOverrides, qi as listProfilesForProvider, qn as resolveSessionLockMaxHoldFromTimeout, qt as getActivePluginRegistry, r as buildModelAliasIndex, ra as normalizeSecretInput, ri as discardBufferedPluginTaskPasses, rn as clearPluginCommands, rr as normalizeStringEntries, rt as mergeInboundPathRoots, s as normalizeModelRef$1, sa as resolveSecretInputRef, si as getTrustedSafeBinDirs, sn as registerPluginCommand, sr as getChannelPlugin, st as parseNonNegativeByteSize, t as buildAllowedModelSet, ta as resolveAuthProfileDisplayLabel, ti as actionRequiresTarget, tn as normalizePluginHttpPath, tr as resolveParentSessionGroupId, tt as DEFAULT_IMESSAGE_ATTACHMENT_ROOTS, u as resolveConfiguredModelRef, ua as DEFAULT_MODEL, ui as normalizeTrustedSafeBinDirs, un as getSpeechProvider, ur as listEnabledSignalAccounts, va as resolveAgentConfig, vi as resolveAllowlistCandidatePath, vn as requireSessionStorageRuntime, vr as resolveIMessageAccount, w as buildAssistantMessageWithZeroUsage, wa as resolveDefaultAgentId, wi as unwrapKnownShellMultiplexerInvocation, wn as closeReplacedConfiguredSessionStorageRuntime, wr as normalizeChatType, wt as listBindings, x as OLLAMA_NATIVE_BASE_URL, xi as isDispatchWrapperExecutable, xn as updateSessionStore, xr as resolveChannelGroupToolsPolicy, ya as resolveAgentDir, yi as resolveCommandResolutionFromArgv, yn as recordSessionMetaFromInbound, yr as resolveChannelGroupPolicy, z as resolveProfilesUnavailableReason, zi as getShellPathFromLoginShell, zn as SESSION_RUN_STORE_FILE_NAME, zr as GATEWAY_CLIENT_IDS, zt as CHAT_CHANNEL_ORDER } from "./model-selection-Ds5bEVQ2.js";
|
|
3
|
+
import { a as resolveGatewayLockDir, f as resolveRequiredHomeDir, l as resolveStateDir, o as resolveGatewayPort, r as resolveConfigPath, s as resolveOAuthDir, 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, U as isSymlinkOpenError, V as isNotFoundPathError, W as normalizeWindowsPathForComparison, Z as CONFIG_DIR, _ as colorize, a as createNonExitingRuntime, b as getChildLogger, c as registerActiveProgressLine, ct as safeParseJson, dt as sleep$2, 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$2, 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-cFv2jJm-.js";
|
|
5
5
|
import { n as resolveProcessScopedMap, t as isPlainObject } from "./plain-object-Doc_YkH1.js";
|
|
6
|
-
import { $ as normalizeAccountId$1, A as DEFAULT_AGENT_ID, B as isKnownAgentMainSessionKey, C as runCommandWithTimeout, D as logError, E as logDebug, F as buildAgentPeerSessionKey, G as resolveAgentIdFromSessionKey, H as normalizeAgentId, I as classifySessionKeyShape, J as resolveThreadSessionKeys, K as resolveCanonicalIdentity, M as DEVICE_SENDER_PREFIX, O as logInfo, P as buildAgentMainSessionKey, Q as DEFAULT_ACCOUNT_ID, T as spawnWithFallback, U as normalizeMainKey, V as isValidAgentId, W as normalizeToken$1, X as sessionKeyAgentMatches, Y as sanitizeAgentId, Z as toAgentStoreSessionKey, _ as filterBootstrapFilesForSession, at as isAcpSessionKey, ct as isSubagentSessionKey, d as DEFAULT_HEARTBEAT_FILENAME, dt as stripAgentSessionKeyPrefix, et as normalizeOptionalAccountId, g as ensureAgentWorkspace, it as getSubagentDepth, j as DEFAULT_MAIN_KEY, k as logWarn, l as DEFAULT_AGENT_WORKSPACE_DIR, lt as parseAgentSessionKey, n as createInternalHookEvent, o as triggerInternalHook, ot as isCronSessionKey, q as resolveConfiguredCanonicalIdentity, rt as WAKE_GATE_SESSION_KEY_SEGMENT, s as parseBooleanValue$1, t as readManifestNamespace, u as DEFAULT_BOOTSTRAP_FILENAME, ut as resolveThreadParentSessionKey, w as runExec, x as resolveOpenClawPackageRoot, y as loadWorkspaceBootstrapFiles } from "./legacy-names-
|
|
7
|
-
import { a as saveJsonFile, i as loadJsonFile, r as resolveCopilotApiToken } from "./github-copilot-token-
|
|
8
|
-
import { $ as resolveSandboxRuntimeStatus, A as classifyFailoverReason, At as compileGlobPatterns, B as isFailoverAssistantError, Bt as stripSilentToken, C as resolveImageSanitizationLimits, Ct as expandPolicyWithPluginGroups, D as downgradeOpenAIReasoningBlocks, Dt as normalizeToolName, E as downgradeOpenAIFunctionCallReasoningPairs, Et as expandToolGroups, F as isAuthAssistantError, Ft as sanitizeGoogleTurnOrdering, G as isTransientHttpError, H as isLikelyContextOverflowError, I as isBillingAssistantError, It as HEARTBEAT_TOKEN, J as sanitizeUserFacingText, K as parseImageDimensionError, L as isCloudCodeAssistFormatError, Lt as SILENT_REPLY_TOKEN, M as formatBillingErrorMessage, Mt as buildBootstrapContextFiles, N as formatRawAssistantErrorForUi, Nt as resolveBootstrapMaxChars, O as isGoogleModelApi, Ot as resolveToolProfilePolicy, P as getApiErrorPayloadFingerprint, Pt as resolveBootstrapTotalMaxChars, Q as resolveSandboxContext, R as isCompactionFailureError, Rt as isSilentReplyPrefixText, S as sanitizeToolResultImages, St as collectExplicitAllowlist, T as estimateBase64DecodedBytes, Tt as stripPluginOnlyAllowlist, U as isRateLimitAssistantError, V as isFailoverErrorMessage, W as isRawApiErrorPayload, X as isTimeoutErrorMessage, Y as isAuthPermanentErrorMessage, Z as ensureSandboxWorkspaceForSession, _t as ensureBrowserControlAuth, a as validateGeminiTurns, at as buildWorkspaceSkillCommandSpecs, b as sanitizeSessionMessagesImages, bt as applyOwnerOnlyToolPolicy, c as formatXHighModelHint, ct as resolveSkillsPromptForRun, d as normalizeReasoningLevel, dt as assertMediaNotDataUrl, et as createBrowserRouteContext, f as normalizeThinkLevel, ft as assertSandboxPath, g as supportsXHighThinking, gt as applySkillEnvOverridesFromSnapshot, h as resolveResponseUsageMode, ht as applySkillEnvOverrides, i as validateAnthropicTurns, it as getBridgeAuthForPort, j as formatAssistantErrorText, jt as matchesAnyGlobPattern, k as BILLING_ERROR_USER_MESSAGE, kt as listCoreToolIds, l as listThinkingLevels, lt as skillsSnapshotSourceDiffers, m as normalizeVerboseLevel, mt as resolveSandboxedMediaSource, n as splitMediaFromOutput, nt as resolveBrowserConfig, o as pickFallbackThinkingLevel, ot as buildWorkspaceSkillSnapshot, p as normalizeUsageDisplay, pt as resolveSandboxInputPath, q as parseImageSizeError, r as extractTextFromChatContent, rt as resolveProfile, s as formatThinkingLevels, st as loadWorkspaceSkillEntries, t as parseReplyDirectives, tt as registerBrowserRoutes, u as normalizeElevatedLevel, ut as resolvePluginSkillDirs, v as isMessagingToolDuplicateNormalized, vt as resolveBrowserControlAuth, w as canonicalizeBase64, wt as mergeAlsoAllowPolicy, x as sanitizeImageBlocks, xt as buildPluginToolGroups, y as normalizeTextForComparison, yt as resolveSandboxConfigForAgent, z as isContextOverflowError, zt as isSilentReplyText } from "./reply-directives-
|
|
6
|
+
import { $ as normalizeAccountId$1, A as DEFAULT_AGENT_ID, B as isKnownAgentMainSessionKey, C as runCommandWithTimeout, D as logError, E as logDebug, F as buildAgentPeerSessionKey, G as resolveAgentIdFromSessionKey, H as normalizeAgentId, I as classifySessionKeyShape, J as resolveThreadSessionKeys, K as resolveCanonicalIdentity, M as DEVICE_SENDER_PREFIX, O as logInfo, P as buildAgentMainSessionKey, Q as DEFAULT_ACCOUNT_ID, T as spawnWithFallback, U as normalizeMainKey, V as isValidAgentId, W as normalizeToken$1, X as sessionKeyAgentMatches, Y as sanitizeAgentId, Z as toAgentStoreSessionKey, _ as filterBootstrapFilesForSession, at as isAcpSessionKey, ct as isSubagentSessionKey, d as DEFAULT_HEARTBEAT_FILENAME, dt as stripAgentSessionKeyPrefix, et as normalizeOptionalAccountId, g as ensureAgentWorkspace, it as getSubagentDepth, j as DEFAULT_MAIN_KEY, k as logWarn, l as DEFAULT_AGENT_WORKSPACE_DIR, lt as parseAgentSessionKey, n as createInternalHookEvent, o as triggerInternalHook, ot as isCronSessionKey, q as resolveConfiguredCanonicalIdentity, rt as WAKE_GATE_SESSION_KEY_SEGMENT, s as parseBooleanValue$1, t as readManifestNamespace, u as DEFAULT_BOOTSTRAP_FILENAME, ut as resolveThreadParentSessionKey, w as runExec, x as resolveOpenClawPackageRoot, y as loadWorkspaceBootstrapFiles } from "./legacy-names-chsmo2vs.js";
|
|
7
|
+
import { a as saveJsonFile, i as loadJsonFile, r as resolveCopilotApiToken } from "./github-copilot-token-C-29TbW-.js";
|
|
8
|
+
import { $ as resolveSandboxRuntimeStatus, A as classifyFailoverReason, At as compileGlobPatterns, B as isFailoverAssistantError, Bt as stripSilentToken, C as resolveImageSanitizationLimits, Ct as expandPolicyWithPluginGroups, D as downgradeOpenAIReasoningBlocks, Dt as normalizeToolName, E as downgradeOpenAIFunctionCallReasoningPairs, Et as expandToolGroups, F as isAuthAssistantError, Ft as sanitizeGoogleTurnOrdering, G as isTransientHttpError, H as isLikelyContextOverflowError, I as isBillingAssistantError, It as HEARTBEAT_TOKEN, J as sanitizeUserFacingText, K as parseImageDimensionError, L as isCloudCodeAssistFormatError, Lt as SILENT_REPLY_TOKEN, M as formatBillingErrorMessage, Mt as buildBootstrapContextFiles, N as formatRawAssistantErrorForUi, Nt as resolveBootstrapMaxChars, O as isGoogleModelApi, Ot as resolveToolProfilePolicy, P as getApiErrorPayloadFingerprint, Pt as resolveBootstrapTotalMaxChars, Q as resolveSandboxContext, R as isCompactionFailureError, Rt as isSilentReplyPrefixText, S as sanitizeToolResultImages, St as collectExplicitAllowlist, T as estimateBase64DecodedBytes, Tt as stripPluginOnlyAllowlist, U as isRateLimitAssistantError, V as isFailoverErrorMessage, W as isRawApiErrorPayload, X as isTimeoutErrorMessage, Y as isAuthPermanentErrorMessage, Z as ensureSandboxWorkspaceForSession, _t as ensureBrowserControlAuth, a as validateGeminiTurns, at as buildWorkspaceSkillCommandSpecs, b as sanitizeSessionMessagesImages, bt as applyOwnerOnlyToolPolicy, c as formatXHighModelHint, ct as resolveSkillsPromptForRun, d as normalizeReasoningLevel, dt as assertMediaNotDataUrl, et as createBrowserRouteContext, f as normalizeThinkLevel, ft as assertSandboxPath, g as supportsXHighThinking, gt as applySkillEnvOverridesFromSnapshot, h as resolveResponseUsageMode, ht as applySkillEnvOverrides, i as validateAnthropicTurns, it as getBridgeAuthForPort, j as formatAssistantErrorText, jt as matchesAnyGlobPattern, k as BILLING_ERROR_USER_MESSAGE, kt as listCoreToolIds, l as listThinkingLevels, lt as skillsSnapshotSourceDiffers, m as normalizeVerboseLevel, mt as resolveSandboxedMediaSource, n as splitMediaFromOutput, nt as resolveBrowserConfig, o as pickFallbackThinkingLevel, ot as buildWorkspaceSkillSnapshot, p as normalizeUsageDisplay, pt as resolveSandboxInputPath, q as parseImageSizeError, r as extractTextFromChatContent, rt as resolveProfile, s as formatThinkingLevels, st as loadWorkspaceSkillEntries, t as parseReplyDirectives, tt as registerBrowserRoutes, u as normalizeElevatedLevel, ut as resolvePluginSkillDirs, v as isMessagingToolDuplicateNormalized, vt as resolveBrowserControlAuth, w as canonicalizeBase64, wt as mergeAlsoAllowPolicy, x as sanitizeImageBlocks, xt as buildPluginToolGroups, y as normalizeTextForComparison, yt as resolveSandboxConfigForAgent, z as isContextOverflowError, zt as isSilentReplyText } from "./reply-directives-CE9WoRyW.js";
|
|
9
9
|
import { n as isDiagnosticsEnabled, t as emitDiagnosticEvent } from "./diagnostic-events-RfJYFlJM.js";
|
|
10
|
-
import { $ as collectInboundUserContext, A as resolveChannelResetConfig, At as repairToolUseResultPairing, B as createAsyncLock, Bt as getGlobalPluginRegistry, C as normalizeHttpWebhookUrl, Ct as createMessageCharEstimateCache, Dt as isToolResultMessage, E as parseAbsoluteTimeMs, Et as getToolResultText$1, F as resolveAgentMainSessionKey, Ft as sanitizeToolCallIdsForCloudCodeAssist, G as trimToUndefined, Gt as mergePromptContributions, H as writeJsonAtomic, Ht as hasHookForPlugin, J as drainPendingPrimaryWrites, Jt as buildPluginTurnIdentity, K as openDbSessionManager, Kt as toJsonValue$1, L as resolveMainSessionKey, Lt as hasInterSessionUserProvenance, M as resolveSessionResetType, Mt as sanitizeToolUseResultPairing, N as resolveThreadFlag, Nt as stripToolResultDetails, O as resolveSessionKey, Ot as guardSessionManager, P as canonicalizeMainSessionAlias, Pt as canonicalToolCallIdBase, Q as buildInboundMetaSystemPrompt, R as isPrimarySessionTranscriptFileName, Rt as normalizeInputProvenance, S as inferLegacyName, St as TOOL_RESULT_CHARS_PER_TOKEN_ESTIMATE, T as resolveDefaultCronStaggerMs, Tt as estimateMessageCharsCached, U as resolveGatewayCredentialsFromConfig, Ut as promptBuildResultToContribution, Vt as initializeGlobalHookRunner, Wt as createCurrentUserPromptEnvelope, X as sanitizeJsonb, Xt as resolveProviderRuntimeIdentity, Y as extractLegacyTranscriptEntryFields, Yt as resolveProviderPromptCacheKey, Z as sha256, _ as derivePromptTokens, _t as PREEMPTIVE_TOOL_RESULT_COMPACTION_PLACEHOLDER, a as resolveMirroredTranscriptText, at as stripMessageCarriers, b as makeZeroUsageSnapshot, bt as truncateToolResultToChars, c as createSessionStorageRuntimeFromConfig, ct as resolveTimezone, d as buildEqualityProjection, dt as eventOrder, et as renderInboundUserContext, ft as pickLeaf, g as sanitizeAppendEntry, gt as sessionLikelyHasOversizedToolResults, h as CREATE_CTX_STORAGE_OWNER_SQL, ht as HARD_MAX_TOOL_RESULT_CHARS, i as appendAssistantMessageToSessionTranscript, it as messageTime, j as resolveSessionResetPolicy, jt as sanitizeToolCallInputs, k as evaluateSessionFreshness, kt as openRawToolResultStash, l as resolveSessionStorageConfig, lt as resolveSenderLabel, m as deriveLegacyActorIdentity, mt as capToolResultContent, n as parseSessionThreadInfo, nt as getMessageIngress, o as parseInlineDirectives$1, ot as formatMessageStamp, pt as HIDDEN_HEARTBEAT_CUSTOM_TYPE, q as runSerializedBySession, qt as buildPluginRuntimeIdentity, r as resolveAndPersistSessionFile, rt as isRepresentableEpochMs, s as attachPgPoolErrorListeners, st as formatZonedTimestamp, t as extractDeliveryInfo, tt as attachMessageIngress, u as validateCtxStorage, ut as DB_SESSION_HYDRATION_LIMIT, v as deriveSessionTotalTokens, vt as TOOL_RESULT_TEXT_WEIGHT, w as normalizeCronStaggerMs, wt as estimateContextChars$1, x as normalizeUsage, xt as CHARS_PER_TOKEN_ESTIMATE$2, y as hasNonzeroUsage, yt as truncateTextHeadTail, z as isSessionArchiveArtifactName, zt as getGlobalHookRunner } from "./sessions-
|
|
10
|
+
import { $ as collectInboundUserContext, A as resolveChannelResetConfig, At as repairToolUseResultPairing, B as createAsyncLock, Bt as getGlobalPluginRegistry, C as normalizeHttpWebhookUrl, Ct as createMessageCharEstimateCache, Dt as isToolResultMessage, E as parseAbsoluteTimeMs, Et as getToolResultText$1, F as resolveAgentMainSessionKey, Ft as sanitizeToolCallIdsForCloudCodeAssist, G as trimToUndefined, Gt as mergePromptContributions, H as writeJsonAtomic, Ht as hasHookForPlugin, J as drainPendingPrimaryWrites, Jt as buildPluginTurnIdentity, K as openDbSessionManager, Kt as toJsonValue$1, L as resolveMainSessionKey, Lt as hasInterSessionUserProvenance, M as resolveSessionResetType, Mt as sanitizeToolUseResultPairing, N as resolveThreadFlag, Nt as stripToolResultDetails, O as resolveSessionKey, Ot as guardSessionManager, P as canonicalizeMainSessionAlias, Pt as canonicalToolCallIdBase, Q as buildInboundMetaSystemPrompt, R as isPrimarySessionTranscriptFileName, Rt as normalizeInputProvenance, S as inferLegacyName, St as TOOL_RESULT_CHARS_PER_TOKEN_ESTIMATE, T as resolveDefaultCronStaggerMs, Tt as estimateMessageCharsCached, U as resolveGatewayCredentialsFromConfig, Ut as promptBuildResultToContribution, Vt as initializeGlobalHookRunner, Wt as createCurrentUserPromptEnvelope, X as sanitizeJsonb, Xt as resolveProviderRuntimeIdentity, Y as extractLegacyTranscriptEntryFields, Yt as resolveProviderPromptCacheKey, Z as sha256, _ as derivePromptTokens, _t as PREEMPTIVE_TOOL_RESULT_COMPACTION_PLACEHOLDER, a as resolveMirroredTranscriptText, at as stripMessageCarriers, b as makeZeroUsageSnapshot, bt as truncateToolResultToChars, c as createSessionStorageRuntimeFromConfig, ct as resolveTimezone, d as buildEqualityProjection, dt as eventOrder, et as renderInboundUserContext, ft as pickLeaf, g as sanitizeAppendEntry, gt as sessionLikelyHasOversizedToolResults, h as CREATE_CTX_STORAGE_OWNER_SQL, ht as HARD_MAX_TOOL_RESULT_CHARS, i as appendAssistantMessageToSessionTranscript, it as messageTime, j as resolveSessionResetPolicy, jt as sanitizeToolCallInputs, k as evaluateSessionFreshness, kt as openRawToolResultStash, l as resolveSessionStorageConfig, lt as resolveSenderLabel, m as deriveLegacyActorIdentity, mt as capToolResultContent, n as parseSessionThreadInfo, nt as getMessageIngress, o as parseInlineDirectives$1, ot as formatMessageStamp, pt as HIDDEN_HEARTBEAT_CUSTOM_TYPE, q as runSerializedBySession, qt as buildPluginRuntimeIdentity, r as resolveAndPersistSessionFile, rt as isRepresentableEpochMs, s as attachPgPoolErrorListeners, st as formatZonedTimestamp, t as extractDeliveryInfo, tt as attachMessageIngress, u as validateCtxStorage, ut as DB_SESSION_HYDRATION_LIMIT, v as deriveSessionTotalTokens, vt as TOOL_RESULT_TEXT_WEIGHT, w as normalizeCronStaggerMs, wt as estimateContextChars$1, x as normalizeUsage, xt as CHARS_PER_TOKEN_ESTIMATE$2, y as hasNonzeroUsage, yt as truncateTextHeadTail, z as isSessionArchiveArtifactName, zt as getGlobalHookRunner } from "./sessions-Bz8mUwgo.js";
|
|
11
11
|
import { n as onSessionTranscriptUpdate } from "./transcript-events-k21fdARq.js";
|
|
12
12
|
import { n as generateSecureUuid, t as generateSecureToken } from "./secure-random-CSsVRTTy.js";
|
|
13
|
-
import { _ as recordSystemPromptHashComparison, b as recordCommandPoll, d as logRunCompleted, f as logRunStarted, g as logToolExecutionStarted, h as logToolExecutionCompleted, l as logModelCallError, m as logToolExecutionBlocked, o as logMessageProcessed, p as logSessionStateChange, s as logMessageQueued, v as refreshRunProgress, x as resetCommandPollCount, y as boundDiagnosticContent } from "./diagnostic-
|
|
13
|
+
import { _ as recordSystemPromptHashComparison, b as recordCommandPoll, d as logRunCompleted, f as logRunStarted, g as logToolExecutionStarted, h as logToolExecutionCompleted, l as logModelCallError, m as logToolExecutionBlocked, o as logMessageProcessed, p as logSessionStateChange, s as logMessageQueued, v as refreshRunProgress, x as resetCommandPollCount, y as boundDiagnosticContent } from "./diagnostic-DJ11ZJIJ.js";
|
|
14
14
|
import { o as redactChannelCorrelation, r as getDiagnosticSessionState } from "./diagnostic-session-state-Di8oqY0E.js";
|
|
15
15
|
import { t as redactIdentifier } from "./redact-identifier-bNChjxxW.js";
|
|
16
|
-
import { t as redactSensitiveText } from "./redact-
|
|
16
|
+
import { t as redactSensitiveText } from "./redact-LOuk7TRy.js";
|
|
17
17
|
import { t as CommandLane } from "./lanes-D1Q3LLIs.js";
|
|
18
|
-
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-
|
|
19
|
-
import { S as MAX_IMAGE_BYTES, _ as getFileExtension, b as kindFromMime, d as MEDIA_MAX_BYTES, g as extensionForMime, h as detectMime, m as saveMediaBuffer, n as isSafeFenceBreak, p as getMediaDir, r as parseFenceSpans, s as getImageMetadata, t as findFenceSpanAt, u as resizeToJpeg, v as imageMimeFromFormat, w as mediaKindFromMime, x as normalizeMimeType$1, y as isAudioFileName } from "./fences-
|
|
20
|
-
import { n as discoverModels, t as discoverAuthStorage } from "./pi-model-discovery-
|
|
21
|
-
import { A as transcriptEntriesToMessages, B as resolveReplyToMode, C as extractToolCallNames, D as sleepWithAbort, E as computeBackoff, F as filterMessagingToolMediaDuplicates, G as resolveOutboundSessionId, H as normalizeChannelTargetInput, I as isRenderablePayload, J as resolveTeamRoster, K as ensureOpenClawModelsJson, L as shouldSuppressMessagingToolReplies, M as applyReplyTagsToPayload, N as applyReplyThreading, P as filterMessagingToolDuplicates, R as shouldSuppressReasoningPayload, S as countToolResults, T as resolveContextTokensForModel, U as normalizeTargetForProvider, V as buildTargetResolverSignature, W as buildOutboundSessionContext, _ as loadCombinedSessionStoreForGateway, b as throwIfAborted$1, c as createMessageSentEmitter, d as toInternalMessageReceivedContext, f as toInternalMessageTranscribedContext, g as stampReplyActivity, h as fireAndForgetHook, j as stripLeadingInboundMetadata, k as readFullTranscriptEntriesFromBackend, l as deriveInboundMessageHookContext, m as toPluginMessageReceivedEvent, o as normalizeReplyPayloadsForDelivery, p as toPluginMessageContext, q as resolveLedTeam, s as applyMessageSendingHook, t as deliverOutboundPayloads, u as toInternalMessagePreprocessedContext, v as capArrayByJsonBytes, w as lookupContextTokens, x as loadChannelOutboundAdapter, y as jsonUtf8Bytes, z as createReplyToModeFilterForChannel } from "./deliver-
|
|
22
|
-
import { B as DEFAULT_AI_SNAPSHOT_MAX_CHARS, C as ensureChromeExtensionRelayServer, M as DEFAULT_UPLOAD_DIR, N as resolveExistingPathsWithinRoot, s as resolveLsofCommandSync } from "./chrome-
|
|
23
|
-
import { r as isLoopbackHost } from "./ws-
|
|
24
|
-
import { a as readFileWithinRoot, c as writeFileWithinRoot, i as openFileWithinRoot, l as PATH_ALIAS_POLICIES, n as copyFileWithinRoot, r as createRootScopedReadFile, t as SafeOpenError } from "./fs-safe-
|
|
25
|
-
import { i as hasErrnoCode, o as readErrorName, r as formatErrorMessage } from "./errors-
|
|
26
|
-
import { a as isBlockedHostnameOrIp, l as normalizeHostname, n as SsrFBlockedError } from "./proxy-env-
|
|
18
|
+
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-AIWqKnVD.js";
|
|
19
|
+
import { S as MAX_IMAGE_BYTES, _ as getFileExtension, b as kindFromMime, d as MEDIA_MAX_BYTES, g as extensionForMime, h as detectMime, m as saveMediaBuffer, n as isSafeFenceBreak, p as getMediaDir, r as parseFenceSpans, s as getImageMetadata, t as findFenceSpanAt, u as resizeToJpeg, v as imageMimeFromFormat, w as mediaKindFromMime, x as normalizeMimeType$1, y as isAudioFileName } from "./fences-Z8d1dj8p.js";
|
|
20
|
+
import { n as discoverModels, t as discoverAuthStorage } from "./pi-model-discovery-CtfGh_up.js";
|
|
21
|
+
import { A as transcriptEntriesToMessages, B as resolveReplyToMode, C as extractToolCallNames, D as sleepWithAbort, E as computeBackoff, F as filterMessagingToolMediaDuplicates, G as resolveOutboundSessionId, H as normalizeChannelTargetInput, I as isRenderablePayload, J as resolveTeamRoster, K as ensureOpenClawModelsJson, L as shouldSuppressMessagingToolReplies, M as applyReplyTagsToPayload, N as applyReplyThreading, P as filterMessagingToolDuplicates, R as shouldSuppressReasoningPayload, S as countToolResults, T as resolveContextTokensForModel, U as normalizeTargetForProvider, V as buildTargetResolverSignature, W as buildOutboundSessionContext, _ as loadCombinedSessionStoreForGateway, b as throwIfAborted$1, c as createMessageSentEmitter, d as toInternalMessageReceivedContext, f as toInternalMessageTranscribedContext, g as stampReplyActivity, h as fireAndForgetHook, j as stripLeadingInboundMetadata, k as readFullTranscriptEntriesFromBackend, l as deriveInboundMessageHookContext, m as toPluginMessageReceivedEvent, o as normalizeReplyPayloadsForDelivery, p as toPluginMessageContext, q as resolveLedTeam, s as applyMessageSendingHook, t as deliverOutboundPayloads, u as toInternalMessagePreprocessedContext, v as capArrayByJsonBytes, w as lookupContextTokens, x as loadChannelOutboundAdapter, y as jsonUtf8Bytes, z as createReplyToModeFilterForChannel } from "./deliver-DsuMPE0S.js";
|
|
22
|
+
import { B as DEFAULT_AI_SNAPSHOT_MAX_CHARS, C as ensureChromeExtensionRelayServer, M as DEFAULT_UPLOAD_DIR, N as resolveExistingPathsWithinRoot, s as resolveLsofCommandSync } from "./chrome-CKy31bWh.js";
|
|
23
|
+
import { r as isLoopbackHost } from "./ws-Do6yaRWR.js";
|
|
24
|
+
import { a as readFileWithinRoot, c as writeFileWithinRoot, i as openFileWithinRoot, l as PATH_ALIAS_POLICIES, n as copyFileWithinRoot, r as createRootScopedReadFile, t as SafeOpenError } from "./fs-safe-DMWtsz4J.js";
|
|
25
|
+
import { i as hasErrnoCode, o as readErrorName, r as formatErrorMessage } from "./errors-0-at0aYV.js";
|
|
26
|
+
import { a as isBlockedHostnameOrIp, l as normalizeHostname, n as SsrFBlockedError } from "./proxy-env-D4WYaw6X.js";
|
|
27
27
|
import { t as resolveNetworkSsrFPolicy } from "./ssrf-config-CIKAlvUL.js";
|
|
28
|
-
import { A as issueDeviceBootstrapToken, C as callGatewayLeastPrivilege, D as gatewayErrorShapeOf, E as gatewayErrorReason, O as validateSecretsResolveResult, S as callGateway, T as resolveLeastPrivilegeOperatorScopesForMethod, _ as resolveSessionReference, a as buildAgentToAgentReplyContext, b as clearActiveCoordinationDepth, c as resolvePingPongTurns, d as createSessionVisibilityGuard, f as resolveEffectiveSessionToolsVisibility, g as resolveMainSessionAlias, h as resolveInternalSessionKey, i as buildAgentToAgentMessageContext, k as SESSION_LABEL_MAX_LENGTH, l as AuthorizationError, m as resolveDisplaySessionKey, n as requestAuthorizedNudge, o as isAnnounceSkip, p as resolveSandboxedSessionToolContext, r as buildAgentToAgentAnnounceContext, s as isReplySkip, u as createAgentToAgentPolicy, v as resolveVisibleSessionReference, w as randomIdempotencyKey, x as setActiveCoordinationDepth, y as shouldResolveSessionIdInput } from "./nudge-
|
|
29
|
-
import { A as formatToolSummary, C as extractAssistantThinking, D as stripDowngradedToolCallText, E as isAssistantMessage, M as stripReasoningTagsFromText, O as stripMinimaxToolCallXml, S as extractAssistantText$1, T as inferToolMetaFromArgs, _ as createInlineCodeState, a as isEmbeddedPiRunActive, b as onAgentEvent, d as handleMessageEnd, f as handleMessageStart, g as buildCodeSpanIndex, h as emitEmbeddedAgentEvent, i as endInFlightEmbeddedAttempt, j as resolveToolDisplay, k as stripThinkingTagsFromText, l as setActiveEmbeddedRun, m as endModelCall, n as beginInFlightEmbeddedAttempt, o as isEmbeddedPiRunStreaming, p as handleMessageUpdate, r as clearActiveEmbeddedRun, s as queueEmbeddedPiMessage, t as abortEmbeddedPiRun, u as waitForEmbeddedPiRunEnd, w as formatReasoningMessage, x as registerAgentRunContext, y as emitAgentEvent } from "./runs-
|
|
30
|
-
import { C as getDefaultMediaLocalRoots, S as getAgentScopedMediaLocalRoots, _ as resolveChunkNewlinePacking, a as resolveMarkdownTableMode, b as fetchRemoteMedia, c as loadWebMediaRaw, d as chunkMarkdownText, f as chunkMarkdownTextWithMode, g as resolveChunkMode, h as resolveChunkDelivery, l as chunkByNewline, m as chunkTextWithMode, o as getDefaultLocalRoots, p as chunkText, s as loadWebMedia, v as resolveTextChunkLimit, x as readResponseWithLimit, y as MediaFetchError } from "./outbound-attachment-
|
|
31
|
-
import { a as bindAbortRelay, i as resolveProxyFetchFromEnv, n as withStrictGuardedFetchMode, o as fetchWithTimeout, r as withTrustedEnvProxyGuardedFetchMode, t as fetchWithSsrFGuard } from "./fetch-guard-
|
|
32
|
-
import { i as executeWithApiKeyRotation, n as resolveMemorySearchConfig, r as collectProviderApiKeysForExecution } from "./manager-
|
|
33
|
-
import { i as AGENT_LANE_SUBAGENT, r as AGENT_LANE_NESTED, t as startUserSessionRun } from "./user-run-recording-
|
|
34
|
-
import { a as getGatewayInstanceId, n as deriveSessionRunId, o as resolveSessionRunStore, r as inferSessionRunKind, t as createSessionRunRecorder } from "./recorder-
|
|
35
|
-
import { c as enqueueAgentTurn, d as peekDelayedAgentTurn, f as setDelayedReleaseHold, i as AGENT_TURN_TOPIC, l as isClaimableAgentTurnWorkId, m as KeyedAsyncQueue, p as WORKSPACE_LANE_DENIED_REASON, r as tryGetAgentTurnRuntime, s as clearDelayedReleaseHold, u as mergeDelayedAgentTurn } from "./agent-turn-runner-
|
|
36
|
-
import { a as resolveSignalRpcContext, c as streamSignalEvents, n as sendReadReceiptSignal, o as signalCheck, r as sendTypingSignal, s as signalRpcRequest, t as sendMessageSignal, u as resolveFetch } from "./send-
|
|
37
|
-
import { a as DEFAULT_IMESSAGE_PROBE_TIMEOUT_MS, c as normalizeIMessageHandle, i as createIMessageRpcClient, l as parseIMessageTarget, o as formatIMessageChatTarget, r as convertMarkdownTables, s as isAllowedIMessageSender, t as sendMessageIMessage } from "./send-
|
|
38
|
-
import { m as normalizeExtraMemoryPaths, p as listMemoryFiles } from "./query-expansion-
|
|
39
|
-
import { t as isQmdScopeAllowed } from "./qmd-scope-
|
|
28
|
+
import { A as issueDeviceBootstrapToken, C as callGatewayLeastPrivilege, D as gatewayErrorShapeOf, E as gatewayErrorReason, O as validateSecretsResolveResult, S as callGateway, T as resolveLeastPrivilegeOperatorScopesForMethod, _ as resolveSessionReference, a as buildAgentToAgentReplyContext, b as clearActiveCoordinationDepth, c as resolvePingPongTurns, d as createSessionVisibilityGuard, f as resolveEffectiveSessionToolsVisibility, g as resolveMainSessionAlias, h as resolveInternalSessionKey, i as buildAgentToAgentMessageContext, k as SESSION_LABEL_MAX_LENGTH, l as AuthorizationError, m as resolveDisplaySessionKey, n as requestAuthorizedNudge, o as isAnnounceSkip, p as resolveSandboxedSessionToolContext, r as buildAgentToAgentAnnounceContext, s as isReplySkip, u as createAgentToAgentPolicy, v as resolveVisibleSessionReference, w as randomIdempotencyKey, x as setActiveCoordinationDepth, y as shouldResolveSessionIdInput } from "./nudge-DZuNGDE_.js";
|
|
29
|
+
import { A as formatToolSummary, C as extractAssistantThinking, D as stripDowngradedToolCallText, E as isAssistantMessage, M as stripReasoningTagsFromText, O as stripMinimaxToolCallXml, S as extractAssistantText$1, T as inferToolMetaFromArgs, _ as createInlineCodeState, a as isEmbeddedPiRunActive, b as onAgentEvent, d as handleMessageEnd, f as handleMessageStart, g as buildCodeSpanIndex, h as emitEmbeddedAgentEvent, i as endInFlightEmbeddedAttempt, j as resolveToolDisplay, k as stripThinkingTagsFromText, l as setActiveEmbeddedRun, m as endModelCall, n as beginInFlightEmbeddedAttempt, o as isEmbeddedPiRunStreaming, p as handleMessageUpdate, r as clearActiveEmbeddedRun, s as queueEmbeddedPiMessage, t as abortEmbeddedPiRun, u as waitForEmbeddedPiRunEnd, w as formatReasoningMessage, x as registerAgentRunContext, y as emitAgentEvent } from "./runs-BIabbRe5.js";
|
|
30
|
+
import { C as getDefaultMediaLocalRoots, S as getAgentScopedMediaLocalRoots, _ as resolveChunkNewlinePacking, a as resolveMarkdownTableMode, b as fetchRemoteMedia, c as loadWebMediaRaw, d as chunkMarkdownText, f as chunkMarkdownTextWithMode, g as resolveChunkMode, h as resolveChunkDelivery, l as chunkByNewline, m as chunkTextWithMode, o as getDefaultLocalRoots, p as chunkText, s as loadWebMedia, v as resolveTextChunkLimit, x as readResponseWithLimit, y as MediaFetchError } from "./outbound-attachment-BsEApkFu.js";
|
|
31
|
+
import { a as bindAbortRelay, i as resolveProxyFetchFromEnv, n as withStrictGuardedFetchMode, o as fetchWithTimeout, r as withTrustedEnvProxyGuardedFetchMode, t as fetchWithSsrFGuard } from "./fetch-guard-BaBd9ZVm.js";
|
|
32
|
+
import { i as executeWithApiKeyRotation, n as resolveMemorySearchConfig, r as collectProviderApiKeysForExecution } from "./manager-B4xc1xN6.js";
|
|
33
|
+
import { i as AGENT_LANE_SUBAGENT, r as AGENT_LANE_NESTED, t as startUserSessionRun } from "./user-run-recording-C1LRU5Lb.js";
|
|
34
|
+
import { a as getGatewayInstanceId, n as deriveSessionRunId, o as resolveSessionRunStore, r as inferSessionRunKind, t as createSessionRunRecorder } from "./recorder-dKE74HOC.js";
|
|
35
|
+
import { c as enqueueAgentTurn, d as peekDelayedAgentTurn, f as setDelayedReleaseHold, i as AGENT_TURN_TOPIC, l as isClaimableAgentTurnWorkId, m as KeyedAsyncQueue, p as WORKSPACE_LANE_DENIED_REASON, r as tryGetAgentTurnRuntime, s as clearDelayedReleaseHold, u as mergeDelayedAgentTurn } from "./agent-turn-runner-BfXiXNe2.js";
|
|
36
|
+
import { a as resolveSignalRpcContext, c as streamSignalEvents, n as sendReadReceiptSignal, o as signalCheck, r as sendTypingSignal, s as signalRpcRequest, t as sendMessageSignal, u as resolveFetch } from "./send-BQzswQlt.js";
|
|
37
|
+
import { a as DEFAULT_IMESSAGE_PROBE_TIMEOUT_MS, c as normalizeIMessageHandle, i as createIMessageRpcClient, l as parseIMessageTarget, o as formatIMessageChatTarget, r as convertMarkdownTables, s as isAllowedIMessageSender, t as sendMessageIMessage } from "./send-BTp_lz-m.js";
|
|
38
|
+
import { m as normalizeExtraMemoryPaths, p as listMemoryFiles } from "./query-expansion-GZKwviqQ.js";
|
|
39
|
+
import { t as isQmdScopeAllowed } from "./qmd-scope-DMUA3Vq9.js";
|
|
40
40
|
import { createRequire } from "node:module";
|
|
41
41
|
import * as path$1 from "node:path";
|
|
42
42
|
import path, { basename, isAbsolute, join } from "node:path";
|
|
43
|
-
import
|
|
43
|
+
import syncFs, { constants, existsSync, mkdirSync, mkdtempSync, promises, readFileSync, realpathSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
44
44
|
import os, { homedir } from "node:os";
|
|
45
|
-
import
|
|
46
|
-
import * as fs$
|
|
47
|
-
import fs
|
|
45
|
+
import json5 from "json5";
|
|
46
|
+
import * as fs$1 from "node:fs/promises";
|
|
47
|
+
import fs, { open } from "node:fs/promises";
|
|
48
48
|
import { isDeepStrictEqual, promisify } from "node:util";
|
|
49
49
|
import { execFile, execFileSync, spawn, spawnSync } from "node:child_process";
|
|
50
50
|
import process$1 from "node:process";
|
|
@@ -57,7 +57,7 @@ import { DefaultResourceLoader, SessionManager, SettingsManager, convertToLlm, c
|
|
|
57
57
|
import { EdgeTTS } from "node-edge-tts";
|
|
58
58
|
import MarkdownIt from "markdown-it";
|
|
59
59
|
import net from "node:net";
|
|
60
|
-
import WebSocket
|
|
60
|
+
import WebSocket from "ws";
|
|
61
61
|
import { Worker } from "node:worker_threads";
|
|
62
62
|
import { createJiti } from "jiti";
|
|
63
63
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
@@ -2742,7 +2742,7 @@ function setPromptSourceCacheEntry(key, entry) {
|
|
|
2742
2742
|
}
|
|
2743
2743
|
function readOpenFileUtf8(fd) {
|
|
2744
2744
|
return new Promise((resolve, reject) => {
|
|
2745
|
-
|
|
2745
|
+
syncFs.readFile(fd, "utf-8", (error, data) => {
|
|
2746
2746
|
if (error) {
|
|
2747
2747
|
reject(error);
|
|
2748
2748
|
return;
|
|
@@ -2753,7 +2753,7 @@ function readOpenFileUtf8(fd) {
|
|
|
2753
2753
|
}
|
|
2754
2754
|
function closeOpenFile(fd) {
|
|
2755
2755
|
return new Promise((resolve, reject) => {
|
|
2756
|
-
|
|
2756
|
+
syncFs.close(fd, (error) => {
|
|
2757
2757
|
if (error) {
|
|
2758
2758
|
reject(error);
|
|
2759
2759
|
return;
|
|
@@ -3162,7 +3162,7 @@ function resolveWorkspaceLane(params) {
|
|
|
3162
3162
|
}
|
|
3163
3163
|
async function pathExists(targetPath) {
|
|
3164
3164
|
try {
|
|
3165
|
-
await fs
|
|
3165
|
+
await fs.access(targetPath);
|
|
3166
3166
|
return true;
|
|
3167
3167
|
} catch {
|
|
3168
3168
|
return false;
|
|
@@ -3170,7 +3170,7 @@ async function pathExists(targetPath) {
|
|
|
3170
3170
|
}
|
|
3171
3171
|
async function getExistingPathState(targetPath) {
|
|
3172
3172
|
try {
|
|
3173
|
-
const stats = await fs
|
|
3173
|
+
const stats = await fs.lstat(targetPath);
|
|
3174
3174
|
if (stats.isSymbolicLink()) return "other";
|
|
3175
3175
|
return stats.isDirectory() ? "directory" : "other";
|
|
3176
3176
|
} catch {
|
|
@@ -3179,7 +3179,7 @@ async function getExistingPathState(targetPath) {
|
|
|
3179
3179
|
}
|
|
3180
3180
|
async function pathLexicallyExists(targetPath) {
|
|
3181
3181
|
try {
|
|
3182
|
-
await fs
|
|
3182
|
+
await fs.lstat(targetPath);
|
|
3183
3183
|
return true;
|
|
3184
3184
|
} catch {
|
|
3185
3185
|
return false;
|
|
@@ -3200,9 +3200,9 @@ async function copyIfMissing(params) {
|
|
|
3200
3200
|
if (!opened.ok) return opened.reason === "path" ? "missing-source" : "invalid";
|
|
3201
3201
|
let content;
|
|
3202
3202
|
try {
|
|
3203
|
-
content =
|
|
3203
|
+
content = syncFs.readFileSync(opened.fd);
|
|
3204
3204
|
} finally {
|
|
3205
|
-
|
|
3205
|
+
syncFs.closeSync(opened.fd);
|
|
3206
3206
|
}
|
|
3207
3207
|
await writeFileWithinRoot({
|
|
3208
3208
|
rootDir: params.targetRoot,
|
|
@@ -3244,9 +3244,9 @@ async function resolveWorkspaceLaneForTurn(params) {
|
|
|
3244
3244
|
const existed = pathState === "directory";
|
|
3245
3245
|
if (!existed) {
|
|
3246
3246
|
const parentDir = path.dirname(resolution.effectiveWorkspaceDir);
|
|
3247
|
-
await fs
|
|
3247
|
+
await fs.mkdir(parentDir, { recursive: true });
|
|
3248
3248
|
const tempDir = path.join(parentDir, `.${path.basename(resolution.effectiveWorkspaceDir)}.creating-${randomUUID()}`);
|
|
3249
|
-
await fs
|
|
3249
|
+
await fs.mkdir(tempDir);
|
|
3250
3250
|
try {
|
|
3251
3251
|
for (const file of config?.copiedOnCreate ?? DEFAULT_COPIED_ON_CREATE_FILES) {
|
|
3252
3252
|
const decision = await copyIfMissing({
|
|
@@ -3262,7 +3262,7 @@ async function resolveWorkspaceLaneForTurn(params) {
|
|
|
3262
3262
|
decision
|
|
3263
3263
|
});
|
|
3264
3264
|
}
|
|
3265
|
-
if (!await fs
|
|
3265
|
+
if (!await fs.rename(tempDir, resolution.effectiveWorkspaceDir).then(() => true, (err) => {
|
|
3266
3266
|
if (err.code === "EEXIST" || err.code === "ENOTEMPTY") return false;
|
|
3267
3267
|
throw err;
|
|
3268
3268
|
})) return {
|
|
@@ -3270,7 +3270,7 @@ async function resolveWorkspaceLaneForTurn(params) {
|
|
|
3270
3270
|
created: false
|
|
3271
3271
|
};
|
|
3272
3272
|
} finally {
|
|
3273
|
-
await fs
|
|
3273
|
+
await fs.rm(tempDir, {
|
|
3274
3274
|
recursive: true,
|
|
3275
3275
|
force: true
|
|
3276
3276
|
});
|
|
@@ -3545,7 +3545,7 @@ async function resolveOpenClawDocsPath(params) {
|
|
|
3545
3545
|
const workspaceDir = params.workspaceDir?.trim();
|
|
3546
3546
|
if (workspaceDir) {
|
|
3547
3547
|
const workspaceDocs = path.join(workspaceDir, "docs");
|
|
3548
|
-
if (
|
|
3548
|
+
if (syncFs.existsSync(workspaceDocs)) return workspaceDocs;
|
|
3549
3549
|
}
|
|
3550
3550
|
const packageRoot = await resolveOpenClawPackageRoot({
|
|
3551
3551
|
cwd: params.cwd,
|
|
@@ -3554,7 +3554,7 @@ async function resolveOpenClawDocsPath(params) {
|
|
|
3554
3554
|
});
|
|
3555
3555
|
if (packageRoot) {
|
|
3556
3556
|
const packageDocs = path.join(packageRoot, "docs");
|
|
3557
|
-
if (
|
|
3557
|
+
if (syncFs.existsSync(path.join(packageDocs, "docs.json"))) return packageDocs;
|
|
3558
3558
|
}
|
|
3559
3559
|
return DOCS_SITE_URL;
|
|
3560
3560
|
}
|
|
@@ -4414,7 +4414,7 @@ async function linkIdentity(params) {
|
|
|
4414
4414
|
const log$69 = createSubsystemLogger("model-catalog");
|
|
4415
4415
|
const modelCatalogPromiseState = resolveProcessScopedMap(Symbol.for("openclaw.agents.model-catalog.modelCatalogPromise"));
|
|
4416
4416
|
const hasLoggedModelCatalogErrorState = resolveProcessScopedMap(Symbol.for("openclaw.agents.model-catalog.hasLoggedModelCatalogError"));
|
|
4417
|
-
const defaultImportPiSdk = () => import("./pi-model-discovery-
|
|
4417
|
+
const defaultImportPiSdk = () => import("./pi-model-discovery-CtfGh_up.js").then((n) => n.r);
|
|
4418
4418
|
let importPiSdk = defaultImportPiSdk;
|
|
4419
4419
|
function getModelCatalogPromise() {
|
|
4420
4420
|
return modelCatalogPromiseState.get("value") ?? null;
|
|
@@ -4893,7 +4893,7 @@ var MediaAttachmentCache = class {
|
|
|
4893
4893
|
const size = await this.ensureLocalStat(entry);
|
|
4894
4894
|
if (entry.resolvedPath) {
|
|
4895
4895
|
if (size !== void 0 && size > params.maxBytes) throw new MediaUnderstandingSkipError("maxBytes", `Attachment ${params.attachmentIndex + 1} exceeds maxBytes ${params.maxBytes}`);
|
|
4896
|
-
const buffer = await fs
|
|
4896
|
+
const buffer = await fs.readFile(entry.resolvedPath);
|
|
4897
4897
|
entry.buffer = buffer;
|
|
4898
4898
|
entry.bufferMime = entry.bufferMime ?? entry.attachment.mime ?? await detectMime({
|
|
4899
4899
|
buffer,
|
|
@@ -4962,10 +4962,10 @@ var MediaAttachmentCache = class {
|
|
|
4962
4962
|
prefix: "openclaw-media",
|
|
4963
4963
|
extension: path.extname(bufferResult.fileName || "") || ""
|
|
4964
4964
|
});
|
|
4965
|
-
await fs
|
|
4965
|
+
await fs.writeFile(tmpPath, bufferResult.buffer);
|
|
4966
4966
|
entry.tempPath = tmpPath;
|
|
4967
4967
|
entry.tempCleanup = async () => {
|
|
4968
|
-
await fs
|
|
4968
|
+
await fs.unlink(tmpPath).catch(() => {});
|
|
4969
4969
|
};
|
|
4970
4970
|
return {
|
|
4971
4971
|
path: tmpPath,
|
|
@@ -5013,13 +5013,13 @@ var MediaAttachmentCache = class {
|
|
|
5013
5013
|
if (entry.statSize !== void 0) return entry.statSize;
|
|
5014
5014
|
try {
|
|
5015
5015
|
const currentPath = entry.resolvedPath;
|
|
5016
|
-
const stat = await fs
|
|
5016
|
+
const stat = await fs.stat(currentPath);
|
|
5017
5017
|
if (!stat.isFile()) {
|
|
5018
5018
|
entry.resolvedPath = void 0;
|
|
5019
5019
|
entry.localPathSecurityRejected = true;
|
|
5020
5020
|
return;
|
|
5021
5021
|
}
|
|
5022
|
-
const canonicalPath = await fs
|
|
5022
|
+
const canonicalPath = await fs.realpath(currentPath);
|
|
5023
5023
|
if (!isInboundPathAllowed({
|
|
5024
5024
|
filePath: canonicalPath,
|
|
5025
5025
|
roots: await this.getCanonicalLocalPathRoots()
|
|
@@ -5043,7 +5043,7 @@ var MediaAttachmentCache = class {
|
|
|
5043
5043
|
if (this.canonicalLocalPathRoots) return await this.canonicalLocalPathRoots;
|
|
5044
5044
|
this.canonicalLocalPathRoots = (async () => mergeInboundPathRoots(this.localPathRoots, await Promise.all(this.localPathRoots.map(async (root) => {
|
|
5045
5045
|
if (root.includes("*")) return root;
|
|
5046
|
-
return await fs
|
|
5046
|
+
return await fs.realpath(root).catch(() => root);
|
|
5047
5047
|
}))))();
|
|
5048
5048
|
return await this.canonicalLocalPathRoots;
|
|
5049
5049
|
}
|
|
@@ -5109,7 +5109,7 @@ function stripCarriedTranscriptFromBody(body, carried) {
|
|
|
5109
5109
|
async function fileExists(filePath) {
|
|
5110
5110
|
if (!filePath) return false;
|
|
5111
5111
|
try {
|
|
5112
|
-
await fs
|
|
5112
|
+
await fs.stat(filePath);
|
|
5113
5113
|
return true;
|
|
5114
5114
|
} catch {
|
|
5115
5115
|
return false;
|
|
@@ -5743,7 +5743,7 @@ async function resolveCliOutput(params) {
|
|
|
5743
5743
|
const commandId = commandBase(params.command);
|
|
5744
5744
|
const fileOutput = commandId === "whisper-cli" ? resolveWhisperCppOutputPath(params.args) : commandId === "whisper" ? resolveWhisperOutputPath(params.args, params.mediaPath) : commandId === "parakeet-mlx" ? resolveParakeetOutputPath(params.args, params.mediaPath) : null;
|
|
5745
5745
|
if (fileOutput && await fileExists(fileOutput)) try {
|
|
5746
|
-
const content = await fs
|
|
5746
|
+
const content = await fs.readFile(fileOutput, "utf8");
|
|
5747
5747
|
if (content.trim()) return content.trim();
|
|
5748
5748
|
} catch {}
|
|
5749
5749
|
if (commandId === "gemini") {
|
|
@@ -6080,10 +6080,10 @@ async function runCliEntry$1(params) {
|
|
|
6080
6080
|
timeoutMs
|
|
6081
6081
|
});
|
|
6082
6082
|
if (capability === "audio") assertMinAudioSize({
|
|
6083
|
-
size: (await fs
|
|
6083
|
+
size: (await fs.stat(pathResult.path)).size,
|
|
6084
6084
|
attachmentIndex: params.attachmentIndex
|
|
6085
6085
|
});
|
|
6086
|
-
const outputDir = await fs
|
|
6086
|
+
const outputDir = await fs.mkdtemp(path.join(resolvePreferredOpenClawTmpDir(), "openclaw-media-cli-"));
|
|
6087
6087
|
const mediaPath = pathResult.path;
|
|
6088
6088
|
const outputBase = path.join(outputDir, path.parse(mediaPath).name);
|
|
6089
6089
|
const templCtx = {
|
|
@@ -6117,7 +6117,7 @@ async function runCliEntry$1(params) {
|
|
|
6117
6117
|
model: command
|
|
6118
6118
|
};
|
|
6119
6119
|
} finally {
|
|
6120
|
-
await fs
|
|
6120
|
+
await fs.rm(outputDir, {
|
|
6121
6121
|
recursive: true,
|
|
6122
6122
|
force: true
|
|
6123
6123
|
}).catch(() => {});
|
|
@@ -6162,9 +6162,9 @@ function candidateBinaryNames(name) {
|
|
|
6162
6162
|
}
|
|
6163
6163
|
async function isExecutable(filePath) {
|
|
6164
6164
|
try {
|
|
6165
|
-
if (!(await fs
|
|
6165
|
+
if (!(await fs.stat(filePath)).isFile()) return false;
|
|
6166
6166
|
if (process.platform === "win32") return true;
|
|
6167
|
-
await fs
|
|
6167
|
+
await fs.access(filePath, constants.X_OK);
|
|
6168
6168
|
return true;
|
|
6169
6169
|
} catch {
|
|
6170
6170
|
return false;
|
|
@@ -9259,7 +9259,7 @@ async function resolveAgentSessionDirs(stateDir) {
|
|
|
9259
9259
|
const agentsDir = path.join(stateDir, "agents");
|
|
9260
9260
|
let entries = [];
|
|
9261
9261
|
try {
|
|
9262
|
-
entries = await fs
|
|
9262
|
+
entries = await fs.readdir(agentsDir, { withFileTypes: true });
|
|
9263
9263
|
} catch (err) {
|
|
9264
9264
|
if (err.code === "ENOENT") return [];
|
|
9265
9265
|
throw err;
|
|
@@ -12742,7 +12742,7 @@ async function routeReply(params) {
|
|
|
12742
12742
|
const resolvedReplyToId = replyToId ?? (channelId === "slack" && threadId != null && threadId !== "" ? String(threadId) : void 0);
|
|
12743
12743
|
const resolvedThreadId = channelId === "slack" ? null : threadId ?? null;
|
|
12744
12744
|
try {
|
|
12745
|
-
const { deliverOutboundPayloads } = await import("./deliver-
|
|
12745
|
+
const { deliverOutboundPayloads } = await import("./deliver-DsuMPE0S.js").then((n) => n.n);
|
|
12746
12746
|
const outboundSession = buildOutboundSessionContext({
|
|
12747
12747
|
cfg,
|
|
12748
12748
|
agentId: resolvedAgentId,
|
|
@@ -14787,7 +14787,7 @@ async function sendTranscriptEcho(params) {
|
|
|
14787
14787
|
}
|
|
14788
14788
|
const text = formatEchoTranscript(transcript, params.format ?? DEFAULT_ECHO_TRANSCRIPT_FORMAT);
|
|
14789
14789
|
try {
|
|
14790
|
-
const { deliverOutboundPayloads } = await import("./deliver-
|
|
14790
|
+
const { deliverOutboundPayloads } = await import("./deliver-DsuMPE0S.js").then((n) => n.n);
|
|
14791
14791
|
await deliverOutboundPayloads({
|
|
14792
14792
|
cfg,
|
|
14793
14793
|
channel: normalizedChannel,
|
|
@@ -17489,7 +17489,7 @@ function getPairingAdapter(channelId) {
|
|
|
17489
17489
|
//#region src/plugin-sdk/json-store.ts
|
|
17490
17490
|
async function readJsonFileWithFallback(filePath, fallback) {
|
|
17491
17491
|
try {
|
|
17492
|
-
const parsed = safeParseJson(await
|
|
17492
|
+
const parsed = safeParseJson(await syncFs.promises.readFile(filePath, "utf-8"));
|
|
17493
17493
|
if (parsed == null) return {
|
|
17494
17494
|
value: fallback,
|
|
17495
17495
|
exists: true
|
|
@@ -17576,7 +17576,7 @@ async function readPairingRequests(filePath) {
|
|
|
17576
17576
|
}
|
|
17577
17577
|
async function ensureJsonFile(filePath, fallback) {
|
|
17578
17578
|
try {
|
|
17579
|
-
await
|
|
17579
|
+
await syncFs.promises.access(filePath);
|
|
17580
17580
|
} catch {
|
|
17581
17581
|
await writeJsonFile(filePath, fallback);
|
|
17582
17582
|
}
|
|
@@ -17732,7 +17732,7 @@ function resolveAllowFromReadCacheOrMissing(filePath, stat) {
|
|
|
17732
17732
|
async function readAllowFromStateForPathWithExists(channel, filePath) {
|
|
17733
17733
|
let stat = null;
|
|
17734
17734
|
try {
|
|
17735
|
-
stat = await
|
|
17735
|
+
stat = await syncFs.promises.stat(filePath);
|
|
17736
17736
|
} catch (err) {
|
|
17737
17737
|
if (err.code !== "ENOENT") throw err;
|
|
17738
17738
|
}
|
|
@@ -17775,7 +17775,7 @@ async function writeAllowFromState(filePath, allowFrom) {
|
|
|
17775
17775
|
});
|
|
17776
17776
|
let stat = null;
|
|
17777
17777
|
try {
|
|
17778
|
-
stat = await
|
|
17778
|
+
stat = await syncFs.promises.stat(filePath);
|
|
17779
17779
|
} catch {}
|
|
17780
17780
|
setAllowFromReadCache(filePath, {
|
|
17781
17781
|
exists: true,
|
|
@@ -18942,7 +18942,7 @@ function mergeLegacyAgent(current, legacy) {
|
|
|
18942
18942
|
}
|
|
18943
18943
|
function ensureDir$1(filePath) {
|
|
18944
18944
|
const dir = path.dirname(filePath);
|
|
18945
|
-
|
|
18945
|
+
syncFs.mkdirSync(dir, { recursive: true });
|
|
18946
18946
|
}
|
|
18947
18947
|
function coerceAllowlistEntries(allowlist) {
|
|
18948
18948
|
if (!Array.isArray(allowlist) || allowlist.length === 0) return Array.isArray(allowlist) ? allowlist : void 0;
|
|
@@ -19012,11 +19012,11 @@ function generateToken() {
|
|
|
19012
19012
|
function loadExecApprovals() {
|
|
19013
19013
|
const filePath = resolveExecApprovalsPath();
|
|
19014
19014
|
try {
|
|
19015
|
-
if (!
|
|
19015
|
+
if (!syncFs.existsSync(filePath)) return normalizeExecApprovals({
|
|
19016
19016
|
version: 1,
|
|
19017
19017
|
agents: {}
|
|
19018
19018
|
});
|
|
19019
|
-
const raw =
|
|
19019
|
+
const raw = syncFs.readFileSync(filePath, "utf8");
|
|
19020
19020
|
const parsed = JSON.parse(raw);
|
|
19021
19021
|
if (parsed?.version !== 1) return normalizeExecApprovals({
|
|
19022
19022
|
version: 1,
|
|
@@ -19033,9 +19033,9 @@ function loadExecApprovals() {
|
|
|
19033
19033
|
function saveExecApprovals(file) {
|
|
19034
19034
|
const filePath = resolveExecApprovalsPath();
|
|
19035
19035
|
ensureDir$1(filePath);
|
|
19036
|
-
|
|
19036
|
+
syncFs.writeFileSync(filePath, `${JSON.stringify(file, null, 2)}\n`, { mode: 384 });
|
|
19037
19037
|
try {
|
|
19038
|
-
|
|
19038
|
+
syncFs.chmodSync(filePath, 384);
|
|
19039
19039
|
} catch {}
|
|
19040
19040
|
}
|
|
19041
19041
|
function ensureExecApprovals() {
|
|
@@ -19499,18 +19499,18 @@ function applyPathPrepend(env, prepend, options) {
|
|
|
19499
19499
|
function resolvePowerShellPath() {
|
|
19500
19500
|
const programFiles = process.env.ProgramFiles || process.env.PROGRAMFILES || "C:\\Program Files";
|
|
19501
19501
|
const pwsh7 = path.join(programFiles, "PowerShell", "7", "pwsh.exe");
|
|
19502
|
-
if (
|
|
19502
|
+
if (syncFs.existsSync(pwsh7)) return pwsh7;
|
|
19503
19503
|
const programW6432 = process.env.ProgramW6432;
|
|
19504
19504
|
if (programW6432 && programW6432 !== programFiles) {
|
|
19505
19505
|
const pwsh7Alt = path.join(programW6432, "PowerShell", "7", "pwsh.exe");
|
|
19506
|
-
if (
|
|
19506
|
+
if (syncFs.existsSync(pwsh7Alt)) return pwsh7Alt;
|
|
19507
19507
|
}
|
|
19508
19508
|
const pwshInPath = resolveShellFromPath("pwsh");
|
|
19509
19509
|
if (pwshInPath) return pwshInPath;
|
|
19510
19510
|
const systemRoot = process.env.SystemRoot || process.env.WINDIR;
|
|
19511
19511
|
if (systemRoot) {
|
|
19512
19512
|
const candidate = path.join(systemRoot, "System32", "WindowsPowerShell", "v1.0", "powershell.exe");
|
|
19513
|
-
if (
|
|
19513
|
+
if (syncFs.existsSync(candidate)) return candidate;
|
|
19514
19514
|
}
|
|
19515
19515
|
return "powershell.exe";
|
|
19516
19516
|
}
|
|
@@ -19548,7 +19548,7 @@ function resolveShellFromPath(name) {
|
|
|
19548
19548
|
for (const entry of entries) {
|
|
19549
19549
|
const candidate = path.join(entry, name);
|
|
19550
19550
|
try {
|
|
19551
|
-
|
|
19551
|
+
syncFs.accessSync(candidate, syncFs.constants.X_OK);
|
|
19552
19552
|
return candidate;
|
|
19553
19553
|
} catch {}
|
|
19554
19554
|
}
|
|
@@ -20486,7 +20486,7 @@ async function resolveSandboxWorkdir(params) {
|
|
|
20486
20486
|
cwd: process.cwd(),
|
|
20487
20487
|
root: params.sandbox.workspaceDir
|
|
20488
20488
|
});
|
|
20489
|
-
if (!(await fs
|
|
20489
|
+
if (!(await fs.stat(resolved.resolved)).isDirectory()) throw new Error("workdir is not a directory");
|
|
20490
20490
|
const relative = resolved.relative ? resolved.relative.split(path.sep).join(path.posix.sep) : "";
|
|
20491
20491
|
const containerWorkdir = relative ? path.posix.join(params.sandbox.containerWorkdir, relative) : params.sandbox.containerWorkdir;
|
|
20492
20492
|
return {
|
|
@@ -21071,7 +21071,7 @@ async function imageResult(params) {
|
|
|
21071
21071
|
}, params.label, params.imageSanitization);
|
|
21072
21072
|
}
|
|
21073
21073
|
async function imageResultFromFile(params) {
|
|
21074
|
-
const buf = await fs
|
|
21074
|
+
const buf = await fs.readFile(params.path);
|
|
21075
21075
|
const mimeType = await detectMime({ buffer: buf.slice(0, 256) }) ?? "image/png";
|
|
21076
21076
|
return await imageResult({
|
|
21077
21077
|
label: params.label,
|
|
@@ -22006,13 +22006,13 @@ async function validateScriptFileForShellBleed(params) {
|
|
|
22006
22006
|
cwd: params.workdir,
|
|
22007
22007
|
root: params.workdir
|
|
22008
22008
|
});
|
|
22009
|
-
stat = await fs
|
|
22009
|
+
stat = await fs.stat(absPath);
|
|
22010
22010
|
} catch {
|
|
22011
22011
|
return;
|
|
22012
22012
|
}
|
|
22013
22013
|
if (!stat.isFile()) return;
|
|
22014
22014
|
if (stat.size > 512 * 1024) return;
|
|
22015
|
-
const content = await fs
|
|
22015
|
+
const content = await fs.readFile(absPath, "utf-8");
|
|
22016
22016
|
const first = /\$[A-Z_][A-Z0-9_]{1,}/g.exec(content);
|
|
22017
22017
|
if (first) {
|
|
22018
22018
|
const idx = first.index;
|
|
@@ -23432,7 +23432,7 @@ function walkUpFrom(startDir, opts, resolveAtDir) {
|
|
|
23432
23432
|
function hasGitMarker(repoRoot) {
|
|
23433
23433
|
const gitPath = path.join(repoRoot, ".git");
|
|
23434
23434
|
try {
|
|
23435
|
-
const stat =
|
|
23435
|
+
const stat = syncFs.statSync(gitPath);
|
|
23436
23436
|
return stat.isDirectory() || stat.isFile();
|
|
23437
23437
|
} catch {
|
|
23438
23438
|
return false;
|
|
@@ -23444,10 +23444,10 @@ function findGitRoot(startDir, opts = {}) {
|
|
|
23444
23444
|
function resolveGitDirFromMarker(repoRoot) {
|
|
23445
23445
|
const gitPath = path.join(repoRoot, ".git");
|
|
23446
23446
|
try {
|
|
23447
|
-
const stat =
|
|
23447
|
+
const stat = syncFs.statSync(gitPath);
|
|
23448
23448
|
if (stat.isDirectory()) return gitPath;
|
|
23449
23449
|
if (!stat.isFile()) return null;
|
|
23450
|
-
const match =
|
|
23450
|
+
const match = syncFs.readFileSync(gitPath, "utf-8").match(/gitdir:\s*(.+)/i);
|
|
23451
23451
|
if (!match?.[1]) return null;
|
|
23452
23452
|
return path.resolve(repoRoot, match[1].trim());
|
|
23453
23453
|
} catch {
|
|
@@ -23514,7 +23514,7 @@ const resolveCommitHash = (options = {}) => {
|
|
|
23514
23514
|
cachedCommit = null;
|
|
23515
23515
|
return cachedCommit;
|
|
23516
23516
|
}
|
|
23517
|
-
const head =
|
|
23517
|
+
const head = syncFs.readFileSync(headPath, "utf-8").trim();
|
|
23518
23518
|
if (!head) {
|
|
23519
23519
|
cachedCommit = null;
|
|
23520
23520
|
return cachedCommit;
|
|
@@ -23522,7 +23522,7 @@ const resolveCommitHash = (options = {}) => {
|
|
|
23522
23522
|
if (head.startsWith("ref:")) {
|
|
23523
23523
|
const ref = head.replace(/^ref:\s*/i, "").trim();
|
|
23524
23524
|
const refPath = path.resolve(path.dirname(headPath), ref);
|
|
23525
|
-
cachedCommit = formatCommit(
|
|
23525
|
+
cachedCommit = formatCommit(syncFs.readFileSync(refPath, "utf-8").trim());
|
|
23526
23526
|
return cachedCommit;
|
|
23527
23527
|
}
|
|
23528
23528
|
cachedCommit = formatCommit(head);
|
|
@@ -27338,13 +27338,13 @@ function listSkillCommandsForAgents(params) {
|
|
|
27338
27338
|
const workspaceFilters = /* @__PURE__ */ new Map();
|
|
27339
27339
|
for (const agentId of agentIds) {
|
|
27340
27340
|
const workspaceDir = resolveAgentWorkspaceDir(params.cfg, agentId);
|
|
27341
|
-
if (!
|
|
27341
|
+
if (!syncFs.existsSync(workspaceDir)) {
|
|
27342
27342
|
logVerbose(`Skipping agent "${agentId}": workspace does not exist: ${workspaceDir}`);
|
|
27343
27343
|
continue;
|
|
27344
27344
|
}
|
|
27345
27345
|
let canonicalDir;
|
|
27346
27346
|
try {
|
|
27347
|
-
canonicalDir =
|
|
27347
|
+
canonicalDir = syncFs.realpathSync(workspaceDir);
|
|
27348
27348
|
} catch {
|
|
27349
27349
|
logVerbose(`Skipping agent "${agentId}": cannot resolve workspace: ${workspaceDir}`);
|
|
27350
27350
|
continue;
|
|
@@ -28534,7 +28534,7 @@ function resolveRepoRoot(params) {
|
|
|
28534
28534
|
const configured = params.config?.agents?.defaults?.repoRoot?.trim();
|
|
28535
28535
|
if (configured) try {
|
|
28536
28536
|
const resolved = path.resolve(configured);
|
|
28537
|
-
if (
|
|
28537
|
+
if (syncFs.statSync(resolved).isDirectory()) return resolved;
|
|
28538
28538
|
} catch {}
|
|
28539
28539
|
const candidates = [params.workspaceDir, params.cwd].map((value) => value?.trim()).filter(Boolean);
|
|
28540
28540
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -29053,7 +29053,7 @@ async function readForwardAndSort(query, sessionId) {
|
|
|
29053
29053
|
//#region src/auto-reply/reply/commands-export-session.ts
|
|
29054
29054
|
const EXPORT_HTML_DIR = path.join(path.dirname(fileURLToPath(import.meta.url)), "export-html");
|
|
29055
29055
|
function loadTemplate(fileName) {
|
|
29056
|
-
return
|
|
29056
|
+
return syncFs.readFileSync(path.join(EXPORT_HTML_DIR, fileName), "utf-8");
|
|
29057
29057
|
}
|
|
29058
29058
|
function generateHtml(sessionData) {
|
|
29059
29059
|
const template = loadTemplate("template.html");
|
|
@@ -29156,8 +29156,8 @@ async function buildExportSessionReply(params) {
|
|
|
29156
29156
|
const defaultFileName = `openclaw-session-${entry.sessionId.slice(0, 8)}-${timestamp}.html`;
|
|
29157
29157
|
const outputPath = args.outputPath ? path.resolve(args.outputPath.startsWith("~") ? args.outputPath.replace("~", process.env.HOME ?? "") : args.outputPath) : path.join(params.workspaceDir, defaultFileName);
|
|
29158
29158
|
const outputDir = path.dirname(outputPath);
|
|
29159
|
-
if (!
|
|
29160
|
-
|
|
29159
|
+
if (!syncFs.existsSync(outputDir)) syncFs.mkdirSync(outputDir, { recursive: true });
|
|
29160
|
+
syncFs.writeFileSync(outputPath, html, "utf-8");
|
|
29161
29161
|
const relativePath = path.relative(params.workspaceDir, outputPath);
|
|
29162
29162
|
return { text: [
|
|
29163
29163
|
"✅ Session exported!",
|
|
@@ -29332,8 +29332,8 @@ function resolveZaiApiKey() {
|
|
|
29332
29332
|
}
|
|
29333
29333
|
try {
|
|
29334
29334
|
const authPath = path.join(resolveRequiredHomeDir(process.env, os.homedir), ".pi", "agent", "auth.json");
|
|
29335
|
-
if (!
|
|
29336
|
-
const data = JSON.parse(
|
|
29335
|
+
if (!syncFs.existsSync(authPath)) return;
|
|
29336
|
+
const data = JSON.parse(syncFs.readFileSync(authPath, "utf-8"));
|
|
29337
29337
|
return data["z-ai"]?.access || data.zai?.access;
|
|
29338
29338
|
} catch {
|
|
29339
29339
|
return;
|
|
@@ -32752,8 +32752,8 @@ function normalizeSessionKey(value) {
|
|
|
32752
32752
|
}
|
|
32753
32753
|
function readSessionStore(storePath) {
|
|
32754
32754
|
try {
|
|
32755
|
-
const raw =
|
|
32756
|
-
const parsed =
|
|
32755
|
+
const raw = syncFs.readFileSync(storePath, "utf-8");
|
|
32756
|
+
const parsed = json5.parse(raw);
|
|
32757
32757
|
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) return parsed;
|
|
32758
32758
|
} catch {}
|
|
32759
32759
|
return {};
|
|
@@ -34465,7 +34465,7 @@ async function createModelSelectionState(params) {
|
|
|
34465
34465
|
}
|
|
34466
34466
|
}
|
|
34467
34467
|
if (sessionEntry && sessionStore && sessionKey && sessionEntry.authProfileOverride) {
|
|
34468
|
-
const { ensureAuthProfileStore } = await import("./model-selection-
|
|
34468
|
+
const { ensureAuthProfileStore } = await import("./model-selection-Ds5bEVQ2.js").then((n) => n.N);
|
|
34469
34469
|
const profile = ensureAuthProfileStore(void 0, { allowKeychainPrompt: false }).profiles[sessionEntry.authProfileOverride];
|
|
34470
34470
|
const providerKey = normalizeProviderId(provider);
|
|
34471
34471
|
if (!profile || normalizeProviderId(profile.provider) !== providerKey) await clearSessionAuthProfileOverride({
|
|
@@ -38063,7 +38063,7 @@ function asBoolean(value) {
|
|
|
38063
38063
|
}
|
|
38064
38064
|
function resolveTempPathParts(opts) {
|
|
38065
38065
|
const tmpDir = opts.tmpDir ?? resolvePreferredOpenClawTmpDir();
|
|
38066
|
-
if (!opts.tmpDir)
|
|
38066
|
+
if (!opts.tmpDir) syncFs.mkdirSync(tmpDir, {
|
|
38067
38067
|
recursive: true,
|
|
38068
38068
|
mode: 448
|
|
38069
38069
|
});
|
|
@@ -38149,7 +38149,7 @@ async function writeUrlToFile(filePath, url, opts) {
|
|
|
38149
38149
|
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}`);
|
|
38150
38150
|
const body = res.body;
|
|
38151
38151
|
if (!body) throw new Error(`failed to download ${url}: empty response body`);
|
|
38152
|
-
const fileHandle = await fs$
|
|
38152
|
+
const fileHandle = await fs$1.open(filePath, "w");
|
|
38153
38153
|
let thrown;
|
|
38154
38154
|
try {
|
|
38155
38155
|
const reader = body.getReader();
|
|
@@ -38167,7 +38167,7 @@ async function writeUrlToFile(filePath, url, opts) {
|
|
|
38167
38167
|
await fileHandle.close();
|
|
38168
38168
|
}
|
|
38169
38169
|
if (thrown) {
|
|
38170
|
-
await fs$
|
|
38170
|
+
await fs$1.unlink(filePath).catch(() => {});
|
|
38171
38171
|
throw thrown;
|
|
38172
38172
|
}
|
|
38173
38173
|
} finally {
|
|
@@ -38180,7 +38180,7 @@ async function writeUrlToFile(filePath, url, opts) {
|
|
|
38180
38180
|
}
|
|
38181
38181
|
async function writeBase64ToFile(filePath, base64) {
|
|
38182
38182
|
const buf = Buffer.from(base64, "base64");
|
|
38183
|
-
await fs$
|
|
38183
|
+
await fs$1.writeFile(filePath, buf);
|
|
38184
38184
|
return {
|
|
38185
38185
|
path: filePath,
|
|
38186
38186
|
bytes: buf.length
|
|
@@ -38265,7 +38265,7 @@ async function readJsonlFromPath(jsonlPath) {
|
|
|
38265
38265
|
if (shouldLogVerbose()) logVerbose(`Blocked canvas jsonlPath outside allowed roots: ${resolved}`);
|
|
38266
38266
|
throw new Error("jsonlPath outside allowed roots");
|
|
38267
38267
|
}
|
|
38268
|
-
const canonical = await fs
|
|
38268
|
+
const canonical = await fs.realpath(resolved).catch(() => resolved);
|
|
38269
38269
|
if (!isInboundPathAllowed({
|
|
38270
38270
|
filePath: canonical,
|
|
38271
38271
|
roots
|
|
@@ -38273,7 +38273,7 @@ async function readJsonlFromPath(jsonlPath) {
|
|
|
38273
38273
|
if (shouldLogVerbose()) logVerbose(`Blocked canvas jsonlPath outside allowed roots: ${canonical}`);
|
|
38274
38274
|
throw new Error("jsonlPath outside allowed roots");
|
|
38275
38275
|
}
|
|
38276
|
-
return await fs
|
|
38276
|
+
return await fs.readFile(canonical, "utf8");
|
|
38277
38277
|
}
|
|
38278
38278
|
const CanvasToolSchema = Type.Object({
|
|
38279
38279
|
action: stringEnum(CANVAS_ACTIONS),
|
|
@@ -39128,12 +39128,12 @@ function resolveRestartSentinelPath(env = process.env) {
|
|
|
39128
39128
|
}
|
|
39129
39129
|
async function writeRestartSentinel(payload, env = process.env) {
|
|
39130
39130
|
const filePath = resolveRestartSentinelPath(env);
|
|
39131
|
-
await fs
|
|
39131
|
+
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
|
39132
39132
|
const data = {
|
|
39133
39133
|
version: 1,
|
|
39134
39134
|
payload
|
|
39135
39135
|
};
|
|
39136
|
-
await fs
|
|
39136
|
+
await fs.writeFile(filePath, `${JSON.stringify(data, null, 2)}\n`, "utf-8");
|
|
39137
39137
|
return filePath;
|
|
39138
39138
|
}
|
|
39139
39139
|
|
|
@@ -41496,9 +41496,9 @@ function loadExternalCatalogEntries(options) {
|
|
|
41496
41496
|
const entries = [];
|
|
41497
41497
|
for (const rawPath of paths) {
|
|
41498
41498
|
const resolved = resolveUserPath(rawPath);
|
|
41499
|
-
if (!
|
|
41499
|
+
if (!syncFs.existsSync(resolved)) continue;
|
|
41500
41500
|
try {
|
|
41501
|
-
const payload = JSON.parse(
|
|
41501
|
+
const payload = JSON.parse(syncFs.readFileSync(resolved, "utf-8"));
|
|
41502
41502
|
entries.push(...parseCatalogEntries(payload));
|
|
41503
41503
|
} catch {}
|
|
41504
41504
|
}
|
|
@@ -50725,18 +50725,18 @@ function appendImagePathsToPrompt(prompt, paths) {
|
|
|
50725
50725
|
return `${trimmed}${trimmed ? "\n\n" : ""}${paths.join("\n")}`;
|
|
50726
50726
|
}
|
|
50727
50727
|
async function writeCliImages(images) {
|
|
50728
|
-
const tempDir = await fs
|
|
50728
|
+
const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-cli-images-"));
|
|
50729
50729
|
const paths = [];
|
|
50730
50730
|
for (let i = 0; i < images.length; i += 1) {
|
|
50731
50731
|
const image = images[i];
|
|
50732
50732
|
const ext = resolveImageExtension(image.mimeType);
|
|
50733
50733
|
const filePath = path.join(tempDir, `image-${i + 1}.${ext}`);
|
|
50734
50734
|
const buffer = Buffer.from(image.data, "base64");
|
|
50735
|
-
await fs
|
|
50735
|
+
await fs.writeFile(filePath, buffer, { mode: 384 });
|
|
50736
50736
|
paths.push(filePath);
|
|
50737
50737
|
}
|
|
50738
50738
|
const cleanup = async () => {
|
|
50739
|
-
await fs
|
|
50739
|
+
await fs.rm(tempDir, {
|
|
50740
50740
|
recursive: true,
|
|
50741
50741
|
force: true
|
|
50742
50742
|
});
|
|
@@ -52624,10 +52624,10 @@ function resolveCronStorePath(storePath) {
|
|
|
52624
52624
|
}
|
|
52625
52625
|
async function loadCronStore(storePath) {
|
|
52626
52626
|
try {
|
|
52627
|
-
const raw = await
|
|
52627
|
+
const raw = await syncFs.promises.readFile(storePath, "utf-8");
|
|
52628
52628
|
let parsed;
|
|
52629
52629
|
try {
|
|
52630
|
-
parsed =
|
|
52630
|
+
parsed = json5.parse(raw);
|
|
52631
52631
|
} catch (err) {
|
|
52632
52632
|
throw new Error(`Failed to parse cron store at ${storePath}: ${String(err)}`, { cause: err });
|
|
52633
52633
|
}
|
|
@@ -53195,9 +53195,9 @@ async function readPostCompactionContext(workspaceDir) {
|
|
|
53195
53195
|
if (!opened.ok) return null;
|
|
53196
53196
|
const sections = extractSections((() => {
|
|
53197
53197
|
try {
|
|
53198
|
-
return
|
|
53198
|
+
return syncFs.readFileSync(opened.fd, "utf-8");
|
|
53199
53199
|
} finally {
|
|
53200
|
-
|
|
53200
|
+
syncFs.closeSync(opened.fd);
|
|
53201
53201
|
}
|
|
53202
53202
|
})(), ["Session Startup", "Red Lines"]);
|
|
53203
53203
|
if (sections.length === 0) return null;
|
|
@@ -54246,7 +54246,7 @@ async function deliverSessionMaintenanceWarning(params) {
|
|
|
54246
54246
|
return;
|
|
54247
54247
|
}
|
|
54248
54248
|
try {
|
|
54249
|
-
const { deliverOutboundPayloads } = await import("./deliver-
|
|
54249
|
+
const { deliverOutboundPayloads } = await import("./deliver-DsuMPE0S.js").then((n) => n.n);
|
|
54250
54250
|
const outboundSession = buildOutboundSessionContext({
|
|
54251
54251
|
cfg: params.cfg,
|
|
54252
54252
|
sessionKey: params.sessionKey
|
|
@@ -55195,7 +55195,7 @@ async function stageSandboxMedia(params) {
|
|
|
55195
55195
|
const remoteMediaCacheDir = ctx.MediaRemoteHost ? path.join(workspaceDir, ".openclaw", "media", "remote-cache", sessionKey) : null;
|
|
55196
55196
|
const effectiveWorkspaceDir = sandbox?.workspaceDir ?? remoteMediaCacheDir;
|
|
55197
55197
|
if (!effectiveWorkspaceDir) return;
|
|
55198
|
-
await fs
|
|
55198
|
+
await fs.mkdir(effectiveWorkspaceDir, { recursive: true });
|
|
55199
55199
|
const remoteAttachmentRoots = resolveIMessageRemoteAttachmentRoots({
|
|
55200
55200
|
cfg,
|
|
55201
55201
|
accountId: ctx.AccountId
|
|
@@ -55254,8 +55254,8 @@ async function stageLocalFileIntoRoot(params) {
|
|
|
55254
55254
|
}
|
|
55255
55255
|
async function stageRemoteFileIntoRoot(params) {
|
|
55256
55256
|
const tmpRoot = resolvePreferredOpenClawTmpDir();
|
|
55257
|
-
await fs
|
|
55258
|
-
const tmpDir = await fs
|
|
55257
|
+
await fs.mkdir(tmpRoot, { recursive: true });
|
|
55258
|
+
const tmpDir = await fs.mkdtemp(path.join(tmpRoot, "stage-sandbox-media-"));
|
|
55259
55259
|
const tmpPath = path.join(tmpDir, "download");
|
|
55260
55260
|
try {
|
|
55261
55261
|
await scpFile(params.remoteHost, params.remotePath, tmpPath);
|
|
@@ -55266,7 +55266,7 @@ async function stageRemoteFileIntoRoot(params) {
|
|
|
55266
55266
|
maxBytes: params.maxBytes
|
|
55267
55267
|
});
|
|
55268
55268
|
} finally {
|
|
55269
|
-
await fs
|
|
55269
|
+
await fs.rm(tmpDir, {
|
|
55270
55270
|
recursive: true,
|
|
55271
55271
|
force: true
|
|
55272
55272
|
}).catch(() => {});
|
|
@@ -56284,7 +56284,7 @@ async function resolveHeartbeatPreflight(params) {
|
|
|
56284
56284
|
const workspaceDir = resolveAgentWorkspaceDir(params.cfg, params.agentId);
|
|
56285
56285
|
const heartbeatFilePath = path.join(workspaceDir, DEFAULT_HEARTBEAT_FILENAME);
|
|
56286
56286
|
try {
|
|
56287
|
-
if (isHeartbeatContentEffectivelyEmpty(await fs
|
|
56287
|
+
if (isHeartbeatContentEffectivelyEmpty(await fs.readFile(heartbeatFilePath, "utf-8"))) return {
|
|
56288
56288
|
...basePreflight,
|
|
56289
56289
|
skipReason: "empty-heartbeat-file"
|
|
56290
56290
|
};
|
|
@@ -56560,7 +56560,7 @@ async function runModelGate(spec, ctx) {
|
|
|
56560
56560
|
const isolatedSessionId = randomNonce;
|
|
56561
56561
|
const isolatedRunId = randomNonce;
|
|
56562
56562
|
const tmpBaseDir = resolvePreferredOpenClawTmpDir();
|
|
56563
|
-
tmpDir = await fs
|
|
56563
|
+
tmpDir = await fs.mkdtemp(path.join(tmpBaseDir, "wake-gate-"));
|
|
56564
56564
|
const workspaceDir = tmpDir;
|
|
56565
56565
|
const prompt = spec.prompt ?? DEFAULT_MODEL_PROMPT;
|
|
56566
56566
|
const timeoutMs = spec.timeoutMs ?? DEFAULT_MODEL_TIMEOUT_MS;
|
|
@@ -56618,7 +56618,7 @@ async function runModelGate(spec, ctx) {
|
|
|
56618
56618
|
log$35.warn("model gate error", { error: err instanceof Error ? err.message : String(err) });
|
|
56619
56619
|
return { wake: false };
|
|
56620
56620
|
} finally {
|
|
56621
|
-
if (tmpDir) await fs
|
|
56621
|
+
if (tmpDir) await fs.rm(tmpDir, {
|
|
56622
56622
|
recursive: true,
|
|
56623
56623
|
force: true
|
|
56624
56624
|
}).catch(() => void 0);
|
|
@@ -62939,7 +62939,7 @@ async function detectBinary(name) {
|
|
|
62939
62939
|
if (!isSafeExecutableValue(name)) return false;
|
|
62940
62940
|
const resolved = name.startsWith("~") ? resolveUserPath(name) : name;
|
|
62941
62941
|
if (path.isAbsolute(resolved) || resolved.startsWith(".") || resolved.includes("/") || resolved.includes("\\")) try {
|
|
62942
|
-
await fs
|
|
62942
|
+
await fs.access(resolved);
|
|
62943
62943
|
return true;
|
|
62944
62944
|
} catch {
|
|
62945
62945
|
return false;
|
|
@@ -63615,7 +63615,7 @@ function normalizeAllowList$1(list) {
|
|
|
63615
63615
|
async function detectRemoteHostFromCliPath(cliPath) {
|
|
63616
63616
|
try {
|
|
63617
63617
|
const expanded = cliPath.startsWith("~") ? cliPath.replace(/^~/, process.env.HOME ?? "") : cliPath;
|
|
63618
|
-
const content = await fs
|
|
63618
|
+
const content = await fs.readFile(expanded, "utf8");
|
|
63619
63619
|
const userHostMatch = content.match(/\bssh\b[^\n]*?\s+([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+)/);
|
|
63620
63620
|
if (userHostMatch) return userHostMatch[1];
|
|
63621
63621
|
return content.match(/\bssh\b[^\n]*?\s+([a-zA-Z][a-zA-Z0-9._-]*)\s+\S*\bimsg\b/)?.[1];
|
|
@@ -63983,7 +63983,7 @@ function getChannelActivity(params) {
|
|
|
63983
63983
|
function readFileIfExists(filePath) {
|
|
63984
63984
|
if (!filePath) return;
|
|
63985
63985
|
try {
|
|
63986
|
-
return
|
|
63986
|
+
return syncFs.readFileSync(filePath, "utf-8").trim();
|
|
63987
63987
|
} catch {
|
|
63988
63988
|
return;
|
|
63989
63989
|
}
|
|
@@ -64646,7 +64646,7 @@ async function downloadLineMedia(messageId, channelAccessToken, maxBytes = 10 *
|
|
|
64646
64646
|
prefix: "line-media",
|
|
64647
64647
|
extension: getExtensionForContentType(contentType)
|
|
64648
64648
|
});
|
|
64649
|
-
await
|
|
64649
|
+
await syncFs.promises.writeFile(filePath, buffer);
|
|
64650
64650
|
logVerbose(`line: downloaded media ${messageId} to ${filePath} (${buffer.length} bytes)`);
|
|
64651
64651
|
return {
|
|
64652
64652
|
path: filePath,
|
|
@@ -67521,7 +67521,7 @@ function createRuntimeChannel() {
|
|
|
67521
67521
|
reply: {
|
|
67522
67522
|
dispatchReplyWithBufferedBlockDispatcher,
|
|
67523
67523
|
dispatchInboundMessage,
|
|
67524
|
-
agentCommandFromIngress: async (...args) => (await import("./agent-
|
|
67524
|
+
agentCommandFromIngress: async (...args) => (await import("./agent-BW-Yan08.js").then((n) => n.n)).agentCommandFromIngress(...args),
|
|
67525
67525
|
dispatchReplyWithDispatcher,
|
|
67526
67526
|
createReplyDispatcherWithTyping,
|
|
67527
67527
|
resolveEffectiveMessagesConfig,
|
|
@@ -67950,7 +67950,7 @@ async function getMemorySearchManager(params) {
|
|
|
67950
67950
|
if (cached) return { manager: cached };
|
|
67951
67951
|
}
|
|
67952
67952
|
try {
|
|
67953
|
-
const { QmdMemoryManager } = await import("./qmd-manager-
|
|
67953
|
+
const { QmdMemoryManager } = await import("./qmd-manager-2dro3Ccn.js");
|
|
67954
67954
|
const primary = await QmdMemoryManager.create({
|
|
67955
67955
|
cfg: params.cfg,
|
|
67956
67956
|
agentId: params.agentId,
|
|
@@ -67962,7 +67962,7 @@ async function getMemorySearchManager(params) {
|
|
|
67962
67962
|
const wrapper = new FallbackMemoryManager({
|
|
67963
67963
|
primary,
|
|
67964
67964
|
fallbackFactory: async () => {
|
|
67965
|
-
const { MemoryIndexManager } = await import("./manager-
|
|
67965
|
+
const { MemoryIndexManager } = await import("./manager-B4xc1xN6.js").then((n) => n.t);
|
|
67966
67966
|
return await MemoryIndexManager.get(params);
|
|
67967
67967
|
}
|
|
67968
67968
|
}, () => {
|
|
@@ -67977,7 +67977,7 @@ async function getMemorySearchManager(params) {
|
|
|
67977
67977
|
}
|
|
67978
67978
|
}
|
|
67979
67979
|
try {
|
|
67980
|
-
const { MemoryIndexManager } = await import("./manager-
|
|
67980
|
+
const { MemoryIndexManager } = await import("./manager-B4xc1xN6.js").then((n) => n.t);
|
|
67981
67981
|
return { manager: await MemoryIndexManager.get(params) };
|
|
67982
67982
|
} catch (err) {
|
|
67983
67983
|
return {
|
|
@@ -68327,7 +68327,7 @@ const LEGACY_ARCHIVE_DEFAULT_RETENTION_MS = 720 * 60 * 60 * 1e3;
|
|
|
68327
68327
|
const log$25 = createSubsystemLogger("config/sessions/legacy-import/archive");
|
|
68328
68328
|
/** SHA-256 over the file's bytes; null when the file is gone (ENOENT). Other errors propagate. */
|
|
68329
68329
|
async function sourceIdentity(filePath) {
|
|
68330
|
-
const handle = await fs
|
|
68330
|
+
const handle = await fs.open(filePath, "r").catch((error) => {
|
|
68331
68331
|
if (error.code === "ENOENT") return null;
|
|
68332
68332
|
throw error;
|
|
68333
68333
|
});
|
|
@@ -68380,9 +68380,9 @@ function fallbackArchiveDest(source, archiveRoot) {
|
|
|
68380
68380
|
async function copyVerifiedTo(sourcePath, dest, expected) {
|
|
68381
68381
|
const tmp = `${dest}.tmp-${randomUUID()}`;
|
|
68382
68382
|
try {
|
|
68383
|
-
const handle = await fs
|
|
68383
|
+
const handle = await fs.open(tmp, "wx", 384);
|
|
68384
68384
|
try {
|
|
68385
|
-
const sourceHandle = await fs
|
|
68385
|
+
const sourceHandle = await fs.open(sourcePath, "r");
|
|
68386
68386
|
try {
|
|
68387
68387
|
const chunk = Buffer.allocUnsafe(256 * 1024);
|
|
68388
68388
|
let size = 0;
|
|
@@ -68399,18 +68399,18 @@ async function copyVerifiedTo(sourcePath, dest, expected) {
|
|
|
68399
68399
|
} finally {
|
|
68400
68400
|
await handle.close();
|
|
68401
68401
|
}
|
|
68402
|
-
await fs
|
|
68402
|
+
await fs.chmod(tmp, 384);
|
|
68403
68403
|
const copied = await identityOf(tmp);
|
|
68404
68404
|
if (!copied || copied.fingerprint !== expected.fingerprint) throw new Error(`legacy archive cross-device copy diverged from the imported bytes: ${dest}`);
|
|
68405
68405
|
try {
|
|
68406
|
-
await fs
|
|
68406
|
+
await fs.link(tmp, dest);
|
|
68407
68407
|
} catch (error) {
|
|
68408
68408
|
if (error.code !== "EEXIST") throw error;
|
|
68409
68409
|
const existing = await identityOf(dest);
|
|
68410
68410
|
if (!existing || existing.fingerprint !== expected.fingerprint) throw new Error(`legacy archive destination exists with different content: ${dest}`, { cause: error });
|
|
68411
68411
|
}
|
|
68412
68412
|
} finally {
|
|
68413
|
-
await fs
|
|
68413
|
+
await fs.rm(tmp, { force: true });
|
|
68414
68414
|
}
|
|
68415
68415
|
}
|
|
68416
68416
|
/**
|
|
@@ -68426,7 +68426,7 @@ async function planLegacyArchiveDest(source, archiveRoot, expected) {
|
|
|
68426
68426
|
const resolvedRoot = path.resolve(archiveRoot);
|
|
68427
68427
|
const { dir, dest } = archivePathsFor(source, resolvedRoot);
|
|
68428
68428
|
try {
|
|
68429
|
-
await fs
|
|
68429
|
+
await fs.mkdir(dir, {
|
|
68430
68430
|
recursive: true,
|
|
68431
68431
|
mode: 448
|
|
68432
68432
|
});
|
|
@@ -68466,7 +68466,7 @@ async function archiveLegacySource(source, archiveRoot, expected) {
|
|
|
68466
68466
|
*/
|
|
68467
68467
|
async function archiveLegacySourceTo(source, dest, archiveRoot, expected) {
|
|
68468
68468
|
const resolvedRoot = path.resolve(archiveRoot);
|
|
68469
|
-
await fs
|
|
68469
|
+
await fs.mkdir(path.dirname(dest), {
|
|
68470
68470
|
recursive: true,
|
|
68471
68471
|
mode: 448
|
|
68472
68472
|
});
|
|
@@ -68476,14 +68476,14 @@ async function archiveLegacySourceTo(source, dest, archiveRoot, expected) {
|
|
|
68476
68476
|
const expectedIdentity = expected ?? sourceIdentityValue;
|
|
68477
68477
|
if (sourceIdentityValue.fingerprint !== expectedIdentity.fingerprint) throw new Error(`legacy source changed after import; failing closed: ${source.path}`);
|
|
68478
68478
|
const destInodeVerified = async (destPath) => {
|
|
68479
|
-
const [sourceStat, destStat] = await Promise.all([fs
|
|
68479
|
+
const [sourceStat, destStat] = await Promise.all([fs.stat(source.path), fs.stat(destPath).catch(() => void 0)]);
|
|
68480
68480
|
return destStat !== void 0 && destStat.dev === sourceStat.dev && destStat.ino === sourceStat.ino;
|
|
68481
68481
|
};
|
|
68482
68482
|
const moveInto = async (destPath) => {
|
|
68483
68483
|
let moved = false;
|
|
68484
68484
|
let independentArchive = false;
|
|
68485
68485
|
try {
|
|
68486
|
-
await fs
|
|
68486
|
+
await fs.link(source.path, destPath);
|
|
68487
68487
|
moved = true;
|
|
68488
68488
|
} catch (error) {
|
|
68489
68489
|
const code = error.code;
|
|
@@ -68491,7 +68491,7 @@ async function archiveLegacySourceTo(source, dest, archiveRoot, expected) {
|
|
|
68491
68491
|
const existing = await identityOf(destPath);
|
|
68492
68492
|
if (existing && existing.fingerprint === expectedIdentity.fingerprint) {
|
|
68493
68493
|
moved = true;
|
|
68494
|
-
const [sourceStat, destStat] = await Promise.all([fs
|
|
68494
|
+
const [sourceStat, destStat] = await Promise.all([fs.stat(source.path), fs.stat(destPath)]);
|
|
68495
68495
|
independentArchive = sourceStat.dev !== destStat.dev || sourceStat.ino !== destStat.ino;
|
|
68496
68496
|
} else return {
|
|
68497
68497
|
moved: false,
|
|
@@ -68512,13 +68512,13 @@ async function archiveLegacySourceTo(source, dest, archiveRoot, expected) {
|
|
|
68512
68512
|
};
|
|
68513
68513
|
const outcome = await moveInto(dest);
|
|
68514
68514
|
if (outcome.divergent) throw new Error(`legacy archive destination exists with different content: ${dest}`);
|
|
68515
|
-
await fs
|
|
68515
|
+
await fs.chmod(dest, 384);
|
|
68516
68516
|
if (!await destInodeVerified(dest)) {
|
|
68517
68517
|
const archived = await identityOf(dest);
|
|
68518
68518
|
if (!archived || archived.fingerprint !== expectedIdentity.fingerprint) throw new Error(`legacy archive verification failed: ${dest}`);
|
|
68519
68519
|
}
|
|
68520
68520
|
if (outcome.moved) if (outcome.independentArchive) await unlinkSourceIfUnchanged(source.path, expectedIdentity);
|
|
68521
|
-
else await fs
|
|
68521
|
+
else await fs.unlink(source.path);
|
|
68522
68522
|
return dest;
|
|
68523
68523
|
}
|
|
68524
68524
|
/**
|
|
@@ -68532,12 +68532,12 @@ async function unlinkSourceIfUnchanged(sourcePath, expected) {
|
|
|
68532
68532
|
const current = await sourceIdentity(sourcePath);
|
|
68533
68533
|
if (!current) return;
|
|
68534
68534
|
if (current.fingerprint !== expected.fingerprint) throw new Error(`legacy source changed before removal; failing closed: ${sourcePath}`);
|
|
68535
|
-
await fs
|
|
68535
|
+
await fs.unlink(sourcePath);
|
|
68536
68536
|
}
|
|
68537
68537
|
async function chmodDirs(dir, stopAt) {
|
|
68538
68538
|
let current = dir;
|
|
68539
68539
|
while (current.startsWith(stopAt) && current !== stopAt) {
|
|
68540
|
-
await fs
|
|
68540
|
+
await fs.chmod(current, 448).catch(() => void 0);
|
|
68541
68541
|
const parent = path.dirname(current);
|
|
68542
68542
|
if (parent === current) return;
|
|
68543
68543
|
current = parent;
|
|
@@ -68566,11 +68566,11 @@ async function purgeExpiredLegacyArchives(runtime, opts) {
|
|
|
68566
68566
|
log$25.warn("skipping legacy archive outside the archive root", { sourcePath: receipt.sourcePath });
|
|
68567
68567
|
continue;
|
|
68568
68568
|
}
|
|
68569
|
-
if (!await fs
|
|
68569
|
+
if (!await fs.stat(archivePath).then(() => true).catch((error) => {
|
|
68570
68570
|
if (error.code === "ENOENT") return false;
|
|
68571
68571
|
throw error;
|
|
68572
68572
|
})) continue;
|
|
68573
|
-
await fs
|
|
68573
|
+
await fs.rm(archivePath, { force: true });
|
|
68574
68574
|
purged += 1;
|
|
68575
68575
|
await pruneEmptyArchiveDirs(path.dirname(archivePath), archiveRoot);
|
|
68576
68576
|
}
|
|
@@ -68581,12 +68581,12 @@ async function pruneEmptyArchiveDirs(dir, stopAt) {
|
|
|
68581
68581
|
while (current.startsWith(stopAt + path.sep)) {
|
|
68582
68582
|
let entries;
|
|
68583
68583
|
try {
|
|
68584
|
-
entries = await fs
|
|
68584
|
+
entries = await fs.readdir(current);
|
|
68585
68585
|
} catch {
|
|
68586
68586
|
return;
|
|
68587
68587
|
}
|
|
68588
68588
|
if (entries.length > 0) return;
|
|
68589
|
-
await fs
|
|
68589
|
+
await fs.rmdir(current).catch(() => void 0);
|
|
68590
68590
|
current = path.dirname(current);
|
|
68591
68591
|
}
|
|
68592
68592
|
}
|
|
@@ -68869,7 +68869,7 @@ function byPath(a, b) {
|
|
|
68869
68869
|
}
|
|
68870
68870
|
function readDirents(dirPath) {
|
|
68871
68871
|
try {
|
|
68872
|
-
return
|
|
68872
|
+
return syncFs.readdirSync(dirPath, { withFileTypes: true });
|
|
68873
68873
|
} catch {
|
|
68874
68874
|
return [];
|
|
68875
68875
|
}
|
|
@@ -68882,7 +68882,7 @@ function isUnderQuarantine(rootDir, candidatePath) {
|
|
|
68882
68882
|
}
|
|
68883
68883
|
function statSource(filePath) {
|
|
68884
68884
|
try {
|
|
68885
|
-
const stats =
|
|
68885
|
+
const stats = syncFs.statSync(filePath);
|
|
68886
68886
|
if (!stats.isFile()) return;
|
|
68887
68887
|
return {
|
|
68888
68888
|
mtimeMs: stats.mtimeMs,
|
|
@@ -69073,12 +69073,12 @@ async function censusLegacySources(cfg, env) {
|
|
|
69073
69073
|
for (const agentDir of readDirents(agentsRoot).filter((entry) => entry.isDirectory()).toSorted((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
|
|
69074
69074
|
const agentId = normalizeAgentId(agentDir.name);
|
|
69075
69075
|
const sessionsDir = path.join(agentsRoot, agentDir.name, LEGACY_SESSIONS_DIR_NAME);
|
|
69076
|
-
if (
|
|
69076
|
+
if (syncFs.existsSync(sessionsDir)) censusAgentDir(sessionsDir, agentId);
|
|
69077
69077
|
}
|
|
69078
69078
|
const legacyRoot = path.join(stateDir, LEGACY_SESSIONS_DIR_NAME);
|
|
69079
|
-
if (
|
|
69079
|
+
if (syncFs.existsSync(legacyRoot)) censusAgentDir(legacyRoot, defaultAgent);
|
|
69080
69080
|
const recoveryDir = path.join(stateDir, RECOVERY_DIR_NAME);
|
|
69081
|
-
if (
|
|
69081
|
+
if (syncFs.existsSync(recoveryDir)) censusRecoveryTree(sources, recoveryDir);
|
|
69082
69082
|
return sources.values();
|
|
69083
69083
|
}
|
|
69084
69084
|
/**
|
|
@@ -69162,7 +69162,7 @@ async function admitDurableKeyMappings(registry, listKeys, opts) {
|
|
|
69162
69162
|
await opts?.clearMappingSourcePath?.(mapping.agentId, mapping.sessionId).catch(() => void 0);
|
|
69163
69163
|
continue;
|
|
69164
69164
|
}
|
|
69165
|
-
const stats = await fs
|
|
69165
|
+
const stats = await fs.stat(mapping.sourcePath).catch(() => void 0);
|
|
69166
69166
|
if (!stats?.isFile()) continue;
|
|
69167
69167
|
registry.admit({
|
|
69168
69168
|
path: mapping.sourcePath,
|
|
@@ -69362,7 +69362,7 @@ function createLegacySourceRegistry() {
|
|
|
69362
69362
|
if (!isSettledReceipt(receipt, source.sizeBytes)) trackPendingPath(key, source);
|
|
69363
69363
|
return;
|
|
69364
69364
|
}
|
|
69365
|
-
const stats = await fs
|
|
69365
|
+
const stats = await fs.stat(key).catch(() => void 0);
|
|
69366
69366
|
if (!stats?.isFile() && receipt.status !== "imported") return;
|
|
69367
69367
|
admit({
|
|
69368
69368
|
path: key,
|
|
@@ -69602,12 +69602,12 @@ function canonicalSqliteIdentityPathSync(sqlitePath) {
|
|
|
69602
69602
|
for (let hops = 0; hops < MAX_SYMLINK_HOPS; hops += 1) {
|
|
69603
69603
|
let stats;
|
|
69604
69604
|
try {
|
|
69605
|
-
stats =
|
|
69605
|
+
stats = syncFs.lstatSync(current);
|
|
69606
69606
|
} catch {
|
|
69607
69607
|
return canonicalPathSync(current);
|
|
69608
69608
|
}
|
|
69609
69609
|
if (!stats.isSymbolicLink()) return canonicalPathSync(current);
|
|
69610
|
-
current = path.resolve(canonicalPathSync(path.dirname(current)),
|
|
69610
|
+
current = path.resolve(canonicalPathSync(path.dirname(current)), syncFs.readlinkSync(current));
|
|
69611
69611
|
}
|
|
69612
69612
|
return canonicalPathSync(sqlitePath);
|
|
69613
69613
|
}
|
|
@@ -69621,12 +69621,12 @@ function sleep$1(ms) {
|
|
|
69621
69621
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
69622
69622
|
}
|
|
69623
69623
|
function acquireKernelOwnerLock(lock) {
|
|
69624
|
-
|
|
69624
|
+
syncFs.mkdirSync(path.dirname(lock.lockPath), {
|
|
69625
69625
|
recursive: true,
|
|
69626
69626
|
mode: 448
|
|
69627
69627
|
});
|
|
69628
69628
|
try {
|
|
69629
|
-
|
|
69629
|
+
syncFs.closeSync(syncFs.openSync(lock.lockPath, "wx", 384));
|
|
69630
69630
|
} catch (err) {
|
|
69631
69631
|
if (err.code !== "EEXIST") throw err;
|
|
69632
69632
|
}
|
|
@@ -69660,7 +69660,7 @@ function closeSqliteQuietly(db) {
|
|
|
69660
69660
|
function releaseKernelOwnerLock(lock, db, info) {
|
|
69661
69661
|
try {
|
|
69662
69662
|
const current = readHolderSidecar(lock.sidecarPath);
|
|
69663
|
-
if (current !== void 0 && current.pid === info.pid && current.startedAt === info.startedAt)
|
|
69663
|
+
if (current !== void 0 && current.pid === info.pid && current.startedAt === info.startedAt) syncFs.rmSync(lock.sidecarPath, { force: true });
|
|
69664
69664
|
} finally {
|
|
69665
69665
|
closeSqliteQuietly(db);
|
|
69666
69666
|
}
|
|
@@ -69668,17 +69668,17 @@ function releaseKernelOwnerLock(lock, db, info) {
|
|
|
69668
69668
|
function writeHolderSidecar(sidecarPath, info) {
|
|
69669
69669
|
const temp = `${sidecarPath}.${process.pid}.tmp`;
|
|
69670
69670
|
try {
|
|
69671
|
-
const fd =
|
|
69671
|
+
const fd = syncFs.openSync(temp, "w", 384);
|
|
69672
69672
|
try {
|
|
69673
|
-
|
|
69674
|
-
|
|
69673
|
+
syncFs.writeFileSync(fd, `${JSON.stringify(info)}\n`);
|
|
69674
|
+
syncFs.fsyncSync(fd);
|
|
69675
69675
|
} finally {
|
|
69676
|
-
|
|
69676
|
+
syncFs.closeSync(fd);
|
|
69677
69677
|
}
|
|
69678
|
-
|
|
69678
|
+
syncFs.renameSync(temp, sidecarPath);
|
|
69679
69679
|
} catch (err) {
|
|
69680
69680
|
try {
|
|
69681
|
-
|
|
69681
|
+
syncFs.rmSync(temp, { force: true });
|
|
69682
69682
|
} catch {}
|
|
69683
69683
|
throw err;
|
|
69684
69684
|
}
|
|
@@ -69703,7 +69703,7 @@ function parseHolderSidecar(raw) {
|
|
|
69703
69703
|
function readHolderSidecar(sidecarPath) {
|
|
69704
69704
|
let raw;
|
|
69705
69705
|
try {
|
|
69706
|
-
raw =
|
|
69706
|
+
raw = syncFs.readFileSync(sidecarPath, "utf8");
|
|
69707
69707
|
} catch {
|
|
69708
69708
|
return;
|
|
69709
69709
|
}
|
|
@@ -69714,7 +69714,7 @@ async function readHolderSidecarBriefly(sidecarPath, timeoutMs = 1e3) {
|
|
|
69714
69714
|
for (;;) {
|
|
69715
69715
|
let raw;
|
|
69716
69716
|
try {
|
|
69717
|
-
raw =
|
|
69717
|
+
raw = syncFs.readFileSync(sidecarPath, "utf8");
|
|
69718
69718
|
} catch {
|
|
69719
69719
|
raw = void 0;
|
|
69720
69720
|
}
|
|
@@ -69878,7 +69878,7 @@ async function claimExclusivePartial(destPath) {
|
|
|
69878
69878
|
for (let attempt = 0; attempt < 3; attempt += 1) {
|
|
69879
69879
|
const candidate = `${destPath}.${process.pid}.${randomBytes(8).toString("hex")}.partial`;
|
|
69880
69880
|
try {
|
|
69881
|
-
await (await fs
|
|
69881
|
+
await (await fs.open(candidate, "wx", 384)).close();
|
|
69882
69882
|
return candidate;
|
|
69883
69883
|
} catch (err) {
|
|
69884
69884
|
if (err.code !== "EEXIST") throw err;
|
|
@@ -69897,7 +69897,7 @@ async function backupSqliteSessionDatabase(params) {
|
|
|
69897
69897
|
const dbPath = path.resolve(params.dbPath);
|
|
69898
69898
|
const destPath = path.resolve(params.destPath);
|
|
69899
69899
|
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");
|
|
69900
|
-
await fs
|
|
69900
|
+
await fs.mkdir(path.dirname(destPath), {
|
|
69901
69901
|
recursive: true,
|
|
69902
69902
|
mode: 448
|
|
69903
69903
|
});
|
|
@@ -69909,14 +69909,14 @@ async function backupSqliteSessionDatabase(params) {
|
|
|
69909
69909
|
gated: sqliteBackupTestHooks.holdWorkerAtGate === true,
|
|
69910
69910
|
writableSource: false
|
|
69911
69911
|
});
|
|
69912
|
-
await fs
|
|
69912
|
+
await fs.rename(partialPath, destPath);
|
|
69913
69913
|
} catch (err) {
|
|
69914
|
-
await fs
|
|
69914
|
+
await fs.rm(partialPath, { force: true }).catch(() => {});
|
|
69915
69915
|
throw err;
|
|
69916
69916
|
}
|
|
69917
69917
|
return {
|
|
69918
69918
|
path: destPath,
|
|
69919
|
-
bytes: (await fs
|
|
69919
|
+
bytes: (await fs.stat(destPath)).size
|
|
69920
69920
|
};
|
|
69921
69921
|
}
|
|
69922
69922
|
|
|
@@ -69938,7 +69938,7 @@ const INCARNATION_SELECT_SQL = "SELECT id FROM ctx_legacy_import_incarnation LIM
|
|
|
69938
69938
|
async function readDbIncarnationId(dbPath) {
|
|
69939
69939
|
let db;
|
|
69940
69940
|
try {
|
|
69941
|
-
await fs
|
|
69941
|
+
await fs.stat(dbPath);
|
|
69942
69942
|
db = new DatabaseSync(dbPath);
|
|
69943
69943
|
const row = db.prepare(INCARNATION_SELECT_SQL).get();
|
|
69944
69944
|
return typeof row?.id === "string" ? row.id : void 0;
|
|
@@ -69990,7 +69990,7 @@ async function takePreImportLegacySnapshot(params) {
|
|
|
69990
69990
|
const marked = await readSnapshotMarker(backupsDir, canonicalDbPath);
|
|
69991
69991
|
if (marked) return marked;
|
|
69992
69992
|
if ((await params.listReceipts()).length > 0) return;
|
|
69993
|
-
await fs
|
|
69993
|
+
await fs.mkdir(backupsDir, {
|
|
69994
69994
|
recursive: true,
|
|
69995
69995
|
mode: 448
|
|
69996
69996
|
});
|
|
@@ -70001,7 +70001,7 @@ async function takePreImportLegacySnapshot(params) {
|
|
|
70001
70001
|
dbPath,
|
|
70002
70002
|
destPath
|
|
70003
70003
|
});
|
|
70004
|
-
if (dbId !== void 0) await fs
|
|
70004
|
+
if (dbId !== void 0) await fs.writeFile(path.join(backupsDir, snapshotMarkerFile(canonicalDbPath)), `${JSON.stringify({
|
|
70005
70005
|
path: backup.path,
|
|
70006
70006
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
70007
70007
|
canonicalDbPath,
|
|
@@ -70019,17 +70019,17 @@ async function takePreImportLegacySnapshot(params) {
|
|
|
70019
70019
|
*/
|
|
70020
70020
|
async function cleanupPartialLegacyBackups(stateDir) {
|
|
70021
70021
|
const backupsDir = path.join(stateDir, "backups");
|
|
70022
|
-
const names = await fs
|
|
70022
|
+
const names = await fs.readdir(backupsDir).catch(() => []);
|
|
70023
70023
|
for (const name of names) {
|
|
70024
70024
|
if (!name.endsWith(".partial")) continue;
|
|
70025
|
-
await fs
|
|
70025
|
+
await fs.rm(path.join(backupsDir, name), { force: true }).catch(() => void 0);
|
|
70026
70026
|
}
|
|
70027
70027
|
}
|
|
70028
70028
|
async function readSnapshotMarker(backupsDir, canonicalDbPath) {
|
|
70029
70029
|
const currentIncarnationId = await readDbIncarnationId(canonicalDbPath);
|
|
70030
70030
|
const keyed = await readMarkerFile(path.join(backupsDir, snapshotMarkerFile(canonicalDbPath)), canonicalDbPath, currentIncarnationId);
|
|
70031
70031
|
if (keyed !== void 0) return keyed;
|
|
70032
|
-
const names = await fs
|
|
70032
|
+
const names = await fs.readdir(backupsDir).catch(() => []);
|
|
70033
70033
|
for (const name of names) {
|
|
70034
70034
|
if (!name.startsWith(SNAPSHOT_MARKER_PREFIX) || !name.endsWith(".json")) continue;
|
|
70035
70035
|
const found = await readMarkerFile(path.join(backupsDir, name), canonicalDbPath, currentIncarnationId);
|
|
@@ -70038,7 +70038,7 @@ async function readSnapshotMarker(backupsDir, canonicalDbPath) {
|
|
|
70038
70038
|
return readMarkerFile(path.join(backupsDir, SNAPSHOT_MARKER_FILE), canonicalDbPath, currentIncarnationId);
|
|
70039
70039
|
}
|
|
70040
70040
|
async function readMarkerFile(markerFile, canonicalDbPath, currentIncarnationId) {
|
|
70041
|
-
const raw = await fs
|
|
70041
|
+
const raw = await fs.readFile(markerFile, "utf8").catch(() => void 0);
|
|
70042
70042
|
if (!raw) return;
|
|
70043
70043
|
try {
|
|
70044
70044
|
const parsed = JSON.parse(raw);
|
|
@@ -70050,7 +70050,7 @@ async function readMarkerFile(markerFile, canonicalDbPath, currentIncarnationId)
|
|
|
70050
70050
|
if (currentIncarnationId !== void 0 && currentIncarnationId === markerId) return markerPath;
|
|
70051
70051
|
return;
|
|
70052
70052
|
}
|
|
70053
|
-
const [markerStat, dbStat] = await Promise.all([fs
|
|
70053
|
+
const [markerStat, dbStat] = await Promise.all([fs.stat(markerDbPath).catch(() => void 0), fs.stat(canonicalDbPath).catch(() => void 0)]);
|
|
70054
70054
|
if (markerStat !== void 0 && dbStat !== void 0 ? markerStat.dev === dbStat.dev && markerStat.ino === dbStat.ino : markerDbPath === canonicalDbPath) return markerPath;
|
|
70055
70055
|
}
|
|
70056
70056
|
} catch {}
|
|
@@ -70316,7 +70316,7 @@ const log$17 = createSubsystemLogger("config/sessions/legacy-import/index-import
|
|
|
70316
70316
|
async function readLegacyIndexStore(storePath) {
|
|
70317
70317
|
let raw;
|
|
70318
70318
|
try {
|
|
70319
|
-
raw = await fs
|
|
70319
|
+
raw = await fs.readFile(storePath, "utf8");
|
|
70320
70320
|
} catch (error) {
|
|
70321
70321
|
throw new Error(`legacy index source unreadable: ${storePath}`, { cause: error });
|
|
70322
70322
|
}
|
|
@@ -70555,7 +70555,7 @@ async function importLegacyIndex(runtime, source, opts = {}) {
|
|
|
70555
70555
|
actorExplicit: entry.actor !== void 0
|
|
70556
70556
|
}), opts.signal);
|
|
70557
70557
|
if (transcriptPath && opts.discoveredTranscripts && path.resolve(transcriptPath) !== path.resolve(source.path)) try {
|
|
70558
|
-
const stats = await fs
|
|
70558
|
+
const stats = await fs.stat(transcriptPath);
|
|
70559
70559
|
if (stats.isFile()) opts.discoveredTranscripts.push({
|
|
70560
70560
|
path: transcriptPath,
|
|
70561
70561
|
kind: "transcript",
|
|
@@ -70671,7 +70671,7 @@ async function loadSessionKeyOverrides(stateDir) {
|
|
|
70671
70671
|
const filePath = path.join(stateDir, "recovery", SESSION_KEY_OVERRIDES_FILENAME);
|
|
70672
70672
|
let raw;
|
|
70673
70673
|
try {
|
|
70674
|
-
raw = await fs
|
|
70674
|
+
raw = await fs.readFile(filePath, "utf8");
|
|
70675
70675
|
} catch (error) {
|
|
70676
70676
|
if (error.code !== "ENOENT") log$15.warn("session key overrides unreadable; ignoring", { error });
|
|
70677
70677
|
return /* @__PURE__ */ new Map();
|
|
@@ -72148,14 +72148,14 @@ function isGatewayArgv(args) {
|
|
|
72148
72148
|
}
|
|
72149
72149
|
function readLinuxCmdline(pid) {
|
|
72150
72150
|
try {
|
|
72151
|
-
return parseProcCmdline(
|
|
72151
|
+
return parseProcCmdline(syncFs.readFileSync(`/proc/${pid}/cmdline`, "utf8"));
|
|
72152
72152
|
} catch {
|
|
72153
72153
|
return null;
|
|
72154
72154
|
}
|
|
72155
72155
|
}
|
|
72156
72156
|
function readLinuxStartTime(pid) {
|
|
72157
72157
|
try {
|
|
72158
|
-
const raw =
|
|
72158
|
+
const raw = syncFs.readFileSync(`/proc/${pid}/stat`, "utf8").trim();
|
|
72159
72159
|
const closeParen = raw.lastIndexOf(")");
|
|
72160
72160
|
if (closeParen < 0) return null;
|
|
72161
72161
|
const fields = raw.slice(closeParen + 1).trim().split(/\s+/);
|
|
@@ -72209,7 +72209,7 @@ async function resolveGatewayOwnerStatus(pid, payload, platform, port) {
|
|
|
72209
72209
|
}
|
|
72210
72210
|
async function readLockPayload(lockPath) {
|
|
72211
72211
|
try {
|
|
72212
|
-
const raw = await fs
|
|
72212
|
+
const raw = await fs.readFile(lockPath, "utf8");
|
|
72213
72213
|
const parsed = JSON.parse(raw);
|
|
72214
72214
|
if (typeof parsed.pid !== "number") return null;
|
|
72215
72215
|
if (typeof parsed.createdAt !== "string") return null;
|
|
@@ -75142,7 +75142,7 @@ async function withMemoryManagerForAgent(params) {
|
|
|
75142
75142
|
}
|
|
75143
75143
|
async function checkReadableFile(pathname) {
|
|
75144
75144
|
try {
|
|
75145
|
-
await fs
|
|
75145
|
+
await fs.access(pathname, syncFs.constants.R_OK);
|
|
75146
75146
|
return { exists: true };
|
|
75147
75147
|
} catch (err) {
|
|
75148
75148
|
const code = err.code;
|
|
@@ -75177,7 +75177,7 @@ async function scanMemoryFiles(workspaceDir, extraPaths = []) {
|
|
|
75177
75177
|
if (alt.issue) issues.push(alt.issue);
|
|
75178
75178
|
const resolvedExtraPaths = normalizeExtraMemoryPaths(workspaceDir, extraPaths);
|
|
75179
75179
|
for (const extraPath of resolvedExtraPaths) try {
|
|
75180
|
-
if ((await fs
|
|
75180
|
+
if ((await fs.lstat(extraPath)).isSymbolicLink()) continue;
|
|
75181
75181
|
const extraCheck = await checkReadableFile(extraPath);
|
|
75182
75182
|
if (extraCheck.issue) issues.push(extraCheck.issue);
|
|
75183
75183
|
} catch (err) {
|
|
@@ -75187,7 +75187,7 @@ async function scanMemoryFiles(workspaceDir, extraPaths = []) {
|
|
|
75187
75187
|
}
|
|
75188
75188
|
let dirReadable = null;
|
|
75189
75189
|
try {
|
|
75190
|
-
await fs
|
|
75190
|
+
await fs.access(memoryDir, syncFs.constants.R_OK);
|
|
75191
75191
|
dirReadable = true;
|
|
75192
75192
|
} catch (err) {
|
|
75193
75193
|
const code = err.code;
|
|
@@ -75235,7 +75235,7 @@ async function summarizeQmdIndexArtifact(manager) {
|
|
|
75235
75235
|
if (!dbPath) return null;
|
|
75236
75236
|
let stat;
|
|
75237
75237
|
try {
|
|
75238
|
-
stat = await fs
|
|
75238
|
+
stat = await fs.stat(dbPath);
|
|
75239
75239
|
} catch (err) {
|
|
75240
75240
|
const code = err.code;
|
|
75241
75241
|
if (code === "ENOENT") throw new Error(`QMD index file not found: ${shortenHomePath(dbPath)}`, { cause: err });
|
|
@@ -75755,7 +75755,7 @@ function createPluginRuntime(options = {}) {
|
|
|
75755
75755
|
workStates: readTaskWorkStates
|
|
75756
75756
|
},
|
|
75757
75757
|
resolveLearningWorkspaceDir: (agentId) => resolveLearningWorkspaceDir(loadConfig(), agentId),
|
|
75758
|
-
sessions: { startUserRun: async (params) => (await import("./user-run-recording-
|
|
75758
|
+
sessions: { startUserRun: async (params) => (await import("./user-run-recording-C1LRU5Lb.js").then((n) => n.n)).startUserSessionRun(params) }
|
|
75759
75759
|
};
|
|
75760
75760
|
Object.defineProperty(runtime, "analysis", {
|
|
75761
75761
|
enumerable: true,
|
|
@@ -75779,7 +75779,7 @@ const resolvePluginSdkAliasFile = (params) => {
|
|
|
75779
75779
|
const srcCandidate = path.join(cursor, "src", "plugin-sdk", params.srcFile);
|
|
75780
75780
|
const distCandidate = path.join(cursor, "dist", "plugin-sdk", params.distFile);
|
|
75781
75781
|
const orderedCandidates = isDistRuntime ? [distCandidate, srcCandidate] : isTest ? [distCandidate, srcCandidate] : [distCandidate];
|
|
75782
|
-
for (const candidate of orderedCandidates) if (
|
|
75782
|
+
for (const candidate of orderedCandidates) if (syncFs.existsSync(candidate)) return candidate;
|
|
75783
75783
|
const parent = path.dirname(cursor);
|
|
75784
75784
|
if (parent === cursor) break;
|
|
75785
75785
|
cursor = parent;
|
|
@@ -76335,7 +76335,7 @@ function loadOpenClawPlugins(options = {}) {
|
|
|
76335
76335
|
continue;
|
|
76336
76336
|
}
|
|
76337
76337
|
const safeSource = opened.path;
|
|
76338
|
-
|
|
76338
|
+
syncFs.closeSync(opened.fd);
|
|
76339
76339
|
let mod = null;
|
|
76340
76340
|
try {
|
|
76341
76341
|
mod = getJiti()(safeSource);
|
|
@@ -76498,7 +76498,7 @@ function loadOpenClawPlugins(options = {}) {
|
|
|
76498
76498
|
}
|
|
76499
76499
|
function safeRealpathOrResolve(value) {
|
|
76500
76500
|
try {
|
|
76501
|
-
return
|
|
76501
|
+
return syncFs.realpathSync(value);
|
|
76502
76502
|
} catch {
|
|
76503
76503
|
return path.resolve(value);
|
|
76504
76504
|
}
|
|
@@ -76656,7 +76656,7 @@ function resolvePluginWebSearchProviders(params) {
|
|
|
76656
76656
|
//#endregion
|
|
76657
76657
|
//#region src/agents/apply-patch-update.ts
|
|
76658
76658
|
async function defaultReadFile(filePath) {
|
|
76659
|
-
return fs
|
|
76659
|
+
return fs.readFile(filePath, "utf8");
|
|
76660
76660
|
}
|
|
76661
76661
|
async function applyUpdateHunk(filePath, chunks, options) {
|
|
76662
76662
|
const originalLines = (await (options?.readFile ?? defaultReadFile)(filePath).catch((err) => {
|
|
@@ -76977,7 +76977,7 @@ function resolvePatchFileOps(options) {
|
|
|
76977
76977
|
const workspaceOnly = options.workspaceOnly !== false;
|
|
76978
76978
|
return {
|
|
76979
76979
|
readFile: async (filePath) => {
|
|
76980
|
-
if (!workspaceOnly) return await fs
|
|
76980
|
+
if (!workspaceOnly) return await fs.readFile(filePath, "utf8");
|
|
76981
76981
|
const opened = await openBoundaryFile({
|
|
76982
76982
|
absolutePath: filePath,
|
|
76983
76983
|
rootPath: options.cwd,
|
|
@@ -76985,14 +76985,14 @@ function resolvePatchFileOps(options) {
|
|
|
76985
76985
|
});
|
|
76986
76986
|
assertBoundaryRead(opened, filePath);
|
|
76987
76987
|
try {
|
|
76988
|
-
return
|
|
76988
|
+
return syncFs.readFileSync(opened.fd, "utf8");
|
|
76989
76989
|
} finally {
|
|
76990
|
-
|
|
76990
|
+
syncFs.closeSync(opened.fd);
|
|
76991
76991
|
}
|
|
76992
76992
|
},
|
|
76993
76993
|
writeFile: async (filePath, content) => {
|
|
76994
76994
|
if (!workspaceOnly) {
|
|
76995
|
-
await fs
|
|
76995
|
+
await fs.writeFile(filePath, content, "utf8");
|
|
76996
76996
|
return;
|
|
76997
76997
|
}
|
|
76998
76998
|
const relative = toRelativeSandboxPath(options.cwd, filePath);
|
|
@@ -77003,8 +77003,8 @@ function resolvePatchFileOps(options) {
|
|
|
77003
77003
|
encoding: "utf8"
|
|
77004
77004
|
});
|
|
77005
77005
|
},
|
|
77006
|
-
remove: (filePath) => fs
|
|
77007
|
-
mkdirp: (dir) => fs
|
|
77006
|
+
remove: (filePath) => fs.rm(filePath),
|
|
77007
|
+
mkdirp: (dir) => fs.mkdir(dir, { recursive: true }).then(() => {})
|
|
77008
77008
|
};
|
|
77009
77009
|
}
|
|
77010
77010
|
async function ensureDir(filePath, ops) {
|
|
@@ -77283,7 +77283,7 @@ async function recordLoopOutcome(args) {
|
|
|
77283
77283
|
if (!args.ctx?.sessionKey) return;
|
|
77284
77284
|
try {
|
|
77285
77285
|
const { getDiagnosticSessionState } = await import("./diagnostic-session-state-Di8oqY0E.js").then((n) => n.n);
|
|
77286
|
-
const { recordToolCallOutcome } = await import("./tool-loop-detection-
|
|
77286
|
+
const { recordToolCallOutcome } = await import("./tool-loop-detection-9fAxiikd.js");
|
|
77287
77287
|
recordToolCallOutcome(getDiagnosticSessionState({
|
|
77288
77288
|
sessionKey: args.ctx.sessionKey,
|
|
77289
77289
|
sessionId: args.ctx?.agentId
|
|
@@ -77310,8 +77310,8 @@ async function runBeforeToolCallHook(args) {
|
|
|
77310
77310
|
const params = args.params;
|
|
77311
77311
|
if (args.ctx?.sessionKey) {
|
|
77312
77312
|
const { getDiagnosticSessionState } = await import("./diagnostic-session-state-Di8oqY0E.js").then((n) => n.n);
|
|
77313
|
-
const { logToolLoopAction } = await import("./diagnostic-
|
|
77314
|
-
const { detectToolCallLoop, recordToolCall } = await import("./tool-loop-detection-
|
|
77313
|
+
const { logToolLoopAction } = await import("./diagnostic-DJ11ZJIJ.js").then((n) => n.n);
|
|
77314
|
+
const { detectToolCallLoop, recordToolCall } = await import("./tool-loop-detection-9fAxiikd.js");
|
|
77315
77315
|
const sessionState = getDiagnosticSessionState({
|
|
77316
77316
|
sessionKey: args.ctx.sessionKey,
|
|
77317
77317
|
sessionId: args.ctx?.agentId
|
|
@@ -77653,10 +77653,10 @@ function createWorkspaceDeleteTool(params) {
|
|
|
77653
77653
|
containWithinHostRoot: root
|
|
77654
77654
|
}).catch(async (error) => {
|
|
77655
77655
|
if (String(error).includes("No such file or directory")) throw Object.assign(/* @__PURE__ */ new Error(`Sandbox FS error (ENOENT): ${display}`), { code: "ENOENT" });
|
|
77656
|
-
if (await fs
|
|
77656
|
+
if (await fs.lstat(contained.resolved).then((stats) => stats.isDirectory() ? stats : null, () => null)) throw Object.assign(/* @__PURE__ */ new Error(`Sandbox FS error (EISDIR): ${display}`), { code: "EISDIR" });
|
|
77657
77657
|
throw error;
|
|
77658
77658
|
});
|
|
77659
|
-
else await fs
|
|
77659
|
+
else await fs.unlink(contained.resolved);
|
|
77660
77660
|
return {
|
|
77661
77661
|
content: [{
|
|
77662
77662
|
type: "text",
|
|
@@ -78051,14 +78051,14 @@ function createSandboxEditOperations(params) {
|
|
|
78051
78051
|
}
|
|
78052
78052
|
async function writeHostFile(absolutePath, content) {
|
|
78053
78053
|
const resolved = path.resolve(absolutePath);
|
|
78054
|
-
await fs
|
|
78055
|
-
await fs
|
|
78054
|
+
await fs.mkdir(path.dirname(resolved), { recursive: true });
|
|
78055
|
+
await fs.writeFile(resolved, content, "utf-8");
|
|
78056
78056
|
}
|
|
78057
78057
|
function createHostWriteOperations(root, options) {
|
|
78058
78058
|
if (!(options?.workspaceOnly ?? false)) return {
|
|
78059
78059
|
mkdir: async (dir) => {
|
|
78060
78060
|
const resolved = path.resolve(dir);
|
|
78061
|
-
await fs
|
|
78061
|
+
await fs.mkdir(resolved, { recursive: true });
|
|
78062
78062
|
},
|
|
78063
78063
|
writeFile: writeHostFile
|
|
78064
78064
|
};
|
|
@@ -78071,7 +78071,7 @@ function createHostWriteOperations(root, options) {
|
|
|
78071
78071
|
cwd: root,
|
|
78072
78072
|
root
|
|
78073
78073
|
});
|
|
78074
|
-
await fs
|
|
78074
|
+
await fs.mkdir(resolved, { recursive: true });
|
|
78075
78075
|
},
|
|
78076
78076
|
writeFile: async (absolutePath, content) => {
|
|
78077
78077
|
await writeFileWithinRoot({
|
|
@@ -78087,12 +78087,12 @@ function createHostEditOperations(root, options) {
|
|
|
78087
78087
|
if (!(options?.workspaceOnly ?? false)) return {
|
|
78088
78088
|
readFile: async (absolutePath) => {
|
|
78089
78089
|
const resolved = path.resolve(absolutePath);
|
|
78090
|
-
return await fs
|
|
78090
|
+
return await fs.readFile(resolved);
|
|
78091
78091
|
},
|
|
78092
78092
|
writeFile: writeHostFile,
|
|
78093
78093
|
access: async (absolutePath) => {
|
|
78094
78094
|
const resolved = path.resolve(absolutePath);
|
|
78095
|
-
await fs
|
|
78095
|
+
await fs.access(resolved);
|
|
78096
78096
|
}
|
|
78097
78097
|
};
|
|
78098
78098
|
return {
|
|
@@ -79271,9 +79271,9 @@ async function readWorkspaceContextForSummary() {
|
|
|
79271
79271
|
if (!opened.ok) return "";
|
|
79272
79272
|
const sections = extractSections((() => {
|
|
79273
79273
|
try {
|
|
79274
|
-
return
|
|
79274
|
+
return syncFs.readFileSync(opened.fd, "utf-8");
|
|
79275
79275
|
} finally {
|
|
79276
|
-
|
|
79276
|
+
syncFs.closeSync(opened.fd);
|
|
79277
79277
|
}
|
|
79278
79278
|
})(), ["Session Startup", "Red Lines"]);
|
|
79279
79279
|
if (sections.length === 0) return "";
|
|
@@ -80906,14 +80906,14 @@ async function compactEmbeddedPiSessionDirect(params) {
|
|
|
80906
80906
|
if (!apiKeyInfo.apiKey) {
|
|
80907
80907
|
if (apiKeyInfo.mode !== "aws-sdk") throw new Error(`No API key resolved for provider "${model.provider}" (auth mode: ${apiKeyInfo.mode}).`);
|
|
80908
80908
|
} else if (model.provider === "github-copilot") {
|
|
80909
|
-
const { resolveCopilotApiToken } = await import("./github-copilot-token-
|
|
80909
|
+
const { resolveCopilotApiToken } = await import("./github-copilot-token-C-29TbW-.js").then((n) => n.n);
|
|
80910
80910
|
const copilotToken = await resolveCopilotApiToken({ githubToken: apiKeyInfo.apiKey });
|
|
80911
80911
|
authStorage.setRuntimeApiKey(model.provider, copilotToken.token);
|
|
80912
80912
|
} else authStorage.setRuntimeApiKey(model.provider, apiKeyInfo.apiKey);
|
|
80913
80913
|
} catch (err) {
|
|
80914
80914
|
return fail(describeUnknownError(err));
|
|
80915
80915
|
}
|
|
80916
|
-
await fs
|
|
80916
|
+
await fs.mkdir(resolvedWorkspace, { recursive: true });
|
|
80917
80917
|
const sandboxSessionKey = params.sessionKey?.trim() || params.sessionId;
|
|
80918
80918
|
const sandbox = await resolveSandboxContext({
|
|
80919
80919
|
config: params.config,
|
|
@@ -80922,7 +80922,7 @@ async function compactEmbeddedPiSessionDirect(params) {
|
|
|
80922
80922
|
workspaceLane: params.workspaceLane
|
|
80923
80923
|
});
|
|
80924
80924
|
const effectiveWorkspace = sandbox?.enabled ? sandbox.workspaceAccess === "rw" ? resolvedWorkspace : sandbox.workspaceDir : resolvedWorkspace;
|
|
80925
|
-
await fs
|
|
80925
|
+
await fs.mkdir(effectiveWorkspace, { recursive: true });
|
|
80926
80926
|
let restoreSkillEnv;
|
|
80927
80927
|
const releaseWorkspaceCwd = acquireWorkspaceCwd(effectiveWorkspace);
|
|
80928
80928
|
try {
|
|
@@ -82141,7 +82141,7 @@ var OpenAIWebSocketManager = class extends EventEmitter {
|
|
|
82141
82141
|
* Throws if the connection is not open.
|
|
82142
82142
|
*/
|
|
82143
82143
|
send(event) {
|
|
82144
|
-
if (!this.ws || this.ws.readyState !== WebSocket
|
|
82144
|
+
if (!this.ws || this.ws.readyState !== WebSocket.OPEN) throw new Error(`OpenAIWebSocketManager: cannot send — connection is not open (readyState=${this.ws?.readyState ?? "no socket"})`);
|
|
82145
82145
|
this.ws.send(JSON.stringify(event));
|
|
82146
82146
|
}
|
|
82147
82147
|
/**
|
|
@@ -82158,7 +82158,7 @@ var OpenAIWebSocketManager = class extends EventEmitter {
|
|
|
82158
82158
|
* Returns true if the WebSocket is currently open and ready to send.
|
|
82159
82159
|
*/
|
|
82160
82160
|
isConnected() {
|
|
82161
|
-
return this.ws !== null && this.ws.readyState === WebSocket
|
|
82161
|
+
return this.ws !== null && this.ws.readyState === WebSocket.OPEN;
|
|
82162
82162
|
}
|
|
82163
82163
|
/**
|
|
82164
82164
|
* Permanently closes the WebSocket connection and disables auto-reconnect.
|
|
@@ -82168,7 +82168,7 @@ var OpenAIWebSocketManager = class extends EventEmitter {
|
|
|
82168
82168
|
this._cancelRetryTimer();
|
|
82169
82169
|
if (this.ws) {
|
|
82170
82170
|
this.ws.removeAllListeners();
|
|
82171
|
-
if (this.ws.readyState === WebSocket
|
|
82171
|
+
if (this.ws.readyState === WebSocket.OPEN || this.ws.readyState === WebSocket.CONNECTING) this.ws.close(1e3, "Client closed");
|
|
82172
82172
|
this.ws = null;
|
|
82173
82173
|
}
|
|
82174
82174
|
}
|
|
@@ -82178,7 +82178,7 @@ var OpenAIWebSocketManager = class extends EventEmitter {
|
|
|
82178
82178
|
reject(/* @__PURE__ */ new Error("OpenAIWebSocketManager: apiKey is required before connecting."));
|
|
82179
82179
|
return;
|
|
82180
82180
|
}
|
|
82181
|
-
const socket = new WebSocket
|
|
82181
|
+
const socket = new WebSocket(this.wsUrl, { headers: {
|
|
82182
82182
|
Authorization: `Bearer ${this.apiKey}`,
|
|
82183
82183
|
"OpenAI-Beta": "responses-websocket=v1"
|
|
82184
82184
|
} });
|
|
@@ -88419,7 +88419,7 @@ async function runEmbeddedAttempt(params) {
|
|
|
88419
88419
|
let embeddedAttemptBegun = false;
|
|
88420
88420
|
const runAbortController = new AbortController();
|
|
88421
88421
|
log$51.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"}`);
|
|
88422
|
-
await fs
|
|
88422
|
+
await fs.mkdir(resolvedWorkspace, { recursive: true });
|
|
88423
88423
|
const sandboxSessionKey = params.sessionKey?.trim() || params.sessionId;
|
|
88424
88424
|
const toolSessionKey = params.toolSessionKey?.trim() || sandboxSessionKey;
|
|
88425
88425
|
const sandbox = params.skipSandbox ? null : await resolveSandboxContext({
|
|
@@ -88429,7 +88429,7 @@ async function runEmbeddedAttempt(params) {
|
|
|
88429
88429
|
workspaceLane: params.workspaceLane
|
|
88430
88430
|
});
|
|
88431
88431
|
const effectiveWorkspace = sandbox?.enabled ? sandbox.workspaceAccess === "rw" ? resolvedWorkspace : sandbox.workspaceDir : resolvedWorkspace;
|
|
88432
|
-
await fs
|
|
88432
|
+
await fs.mkdir(effectiveWorkspace, { recursive: true });
|
|
88433
88433
|
let restoreSkillEnv;
|
|
88434
88434
|
const releaseWorkspaceCwd = params.skipCwdChange ? void 0 : acquireWorkspaceCwd(effectiveWorkspace);
|
|
88435
88435
|
const rawToolResultStash = openRawToolResultStash(params.sessionId);
|
|
@@ -89324,7 +89324,7 @@ async function runEmbeddedPiAgent(params) {
|
|
|
89324
89324
|
await copilotTokenState.refreshInFlight;
|
|
89325
89325
|
return;
|
|
89326
89326
|
}
|
|
89327
|
-
const { resolveCopilotApiToken } = await import("./github-copilot-token-
|
|
89327
|
+
const { resolveCopilotApiToken } = await import("./github-copilot-token-C-29TbW-.js").then((n) => n.n);
|
|
89328
89328
|
copilotTokenState.refreshInFlight = (async () => {
|
|
89329
89329
|
const githubToken = copilotTokenState.githubToken.trim();
|
|
89330
89330
|
if (!githubToken) throw new Error("Copilot refresh requires a GitHub token.");
|
|
@@ -89416,7 +89416,7 @@ async function runEmbeddedPiAgent(params) {
|
|
|
89416
89416
|
return;
|
|
89417
89417
|
}
|
|
89418
89418
|
if (model.provider === "github-copilot") {
|
|
89419
|
-
const { resolveCopilotApiToken } = await import("./github-copilot-token-
|
|
89419
|
+
const { resolveCopilotApiToken } = await import("./github-copilot-token-C-29TbW-.js").then((n) => n.n);
|
|
89420
89420
|
const copilotToken = await resolveCopilotApiToken({ githubToken: apiKeyInfo.apiKey });
|
|
89421
89421
|
authStorage.setRuntimeApiKey(model.provider, copilotToken.token);
|
|
89422
89422
|
if (copilotTokenState) {
|
|
@@ -89538,7 +89538,7 @@ async function runEmbeddedPiAgent(params) {
|
|
|
89538
89538
|
const copilotAuthRetry = authRetryPending;
|
|
89539
89539
|
authRetryPending = false;
|
|
89540
89540
|
attemptedThinking.add(thinkLevel);
|
|
89541
|
-
await fs
|
|
89541
|
+
await fs.mkdir(resolvedWorkspace, { recursive: true });
|
|
89542
89542
|
const prompt = provider === "anthropic" ? scrubAnthropicRefusalMagic(params.prompt) : params.prompt;
|
|
89543
89543
|
const attempt = await runEmbeddedAttempt({
|
|
89544
89544
|
sessionId: params.sessionId,
|