openmeld 0.3.136 → 0.3.138
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/{add-me-membership-BNNtDZYW.js → add-me-membership-BZ9GEg6y.js} +2 -2
- package/dist/{add-me-membership-BNNtDZYW.js.map → add-me-membership-BZ9GEg6y.js.map} +1 -1
- package/dist/{api-client-foundation-CabWpjFe.js → api-client-foundation-tvnD_7HW.js} +4 -7
- package/dist/api-client-foundation-tvnD_7HW.js.map +1 -0
- package/dist/{auth-session-Bj8n8YwV.js → auth-session-hdKG6Oqe.js} +3 -6
- package/dist/auth-session-hdKG6Oqe.js.map +1 -0
- package/dist/{base-url-BtqW4aLS.js → base-url-CY_j4bLH.js} +13 -6
- package/dist/base-url-CY_j4bLH.js.map +1 -0
- package/dist/{command-BGqFPMwd.js → command-BV6ylBgU.js} +920 -703
- package/dist/{command-BGqFPMwd.js.map → command-BV6ylBgU.js.map} +1 -1
- package/dist/{daemon-runtime-lease-D82uDZ5s.js → daemon-runtime-lease-6DIprlJy.js} +2 -2
- package/dist/{daemon-runtime-lease-D82uDZ5s.js.map → daemon-runtime-lease-6DIprlJy.js.map} +1 -1
- package/dist/{dist-0qM_CVk2.js → dist-DEiXhSkt.js} +217 -39
- package/dist/dist-DEiXhSkt.js.map +1 -0
- package/dist/openmeld-dev.js +1 -1
- package/dist/openmeld.js +462 -237
- package/dist/openmeld.js.map +1 -1
- package/dist/{runtime-transport-BiQfJGnw.js → runtime-transport-CFM93Yqy.js} +58 -22
- package/dist/runtime-transport-CFM93Yqy.js.map +1 -0
- package/package.json +2 -2
- package/skills/README.md +5 -2
- package/skills/openmeld-cli/SKILL.md +109 -1151
- package/skills/openmeld-cli/playbooks/space-ops.md +38 -16
- package/skills/openmeld-cli/playbooks/space-reads.md +123 -0
- package/skills/openmeld-cli/references/commands.md +19 -9
- package/skills/openmeld-cli/references/runtime-resolution.md +21 -2
- package/dist/api-client-foundation-CabWpjFe.js.map +0 -1
- package/dist/auth-session-Bj8n8YwV.js.map +0 -1
- package/dist/base-url-BtqW4aLS.js.map +0 -1
- package/dist/dist-0qM_CVk2.js.map +0 -1
- package/dist/runtime-transport-BiQfJGnw.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { $ as
|
|
4
|
-
import { A as MAX_TEXT_LENGTH, At as
|
|
5
|
-
import { $r as MAX_PROFILE_WORKING_DIRECTORY_LENGTH, A as runtimeTransportRegisterSessionResponseSchema, Bn as agentInteractionResolutionSchema, C as runtimeTransportLocalAgentControlRefreshCatalogFramePayloadSchema, Cn as MESSAGE_MENTION_TYPE_VALUES, D as runtimeTransportOpenMeldToolsControlFramePayloadSchema, Dr as url, E as runtimeTransportLookupRouteOwnerServiceEvidenceSchema, En as getSpaceMessageAddressingRelationSupportForTargetKind, Fr as runtimeCoordinatorExecutionTokenEnvelopeSchema, Gn as formatLocalSetupActionLabel, H as openMeldDaemonTaskResultEnvelopeWriteSchema, Hn as formatLocalComponentsSummaryDescription, Hr as resolveSpaceMentionLabels, I as runtimeTransportSubmitTaskResultRequestSchema, Ir as runtimeTransportDeliveryExecutionIdentitySchema, J as OPENMELD_LOCAL_FOLDER_PICKER_CAPABILITY_HEADER, K as openMeldSpaceEgressActionSchema, Kn as installedLocalComponentsSnapshotSchema, Kt as resolveSpaceFileMimeType, L as OPENMELD_ORIGINAL_ERROR_MAX_LENGTH, Ln as AGENT_INTERACTION_DEFAULT_TIMEOUT_MS, M as runtimeTransportResumeControllerConversationFramePayloadSchema, N as runtimeTransportResumeControllerConversationResultFramePayloadSchema, O as runtimeTransportOpenMeldToolsControlResultFramePayloadSchema, On as normalizeMessageEnvelope, P as runtimeTransportRouteCatalogChangedFramePayloadSchema, Qr as openMeldRequestContextSchema, R as isOriginalErrorSafeForMessageDetails, Rt as SPACE_FILE_MAX_SIZE_BYTES, S as runtimeTransportLocalAgentControlManageInstallationFramePayloadSchema, Si as resolveCommandAgentWorkActivity, Sr as string, St as sanitizeSignalTextPreview, T as runtimeTransportLocalAgentControlSetProfileWorkspaceFramePayloadSchema, Tn as formatCanonicalMentionLiteral, U as openMeldDaemonTaskResultOpenClawGatewayVisibilityStatusSchema, Un as formatLocalComponentsSummaryLabel, V as openMeldDaemonProviderAccessEvidenceSchema, Vr as resolveSingleSpaceMentionLabels, W as openMeldDaemonTaskResultPayloadSchema, Wn as formatLocalSetupActionDescription, X as localFolderPickerHelperProtocolResultSchema, Xt as spaceFileNameSchema, Y as localFolderPickerDaemonFrameSchema, Z as localFolderPickerHelperResultSchema, Zn as localServiceComponentUpdateProjectionSchema, _ as runtimeTransportHeartbeatRequestSchema, _i as sanitizeDispatchErrorSummary, a as runtimeTransportCapabilitiesSchema, b as runtimeTransportLocalAgentControlForkSessionFramePayloadSchema, bt as SPACE_MENTION_REJECT_NOTICE_PURPOSE, c as runtimeTransportDispatchInteractionRequestSchema, cn as conversationExecutionStateSchema, d as runtimeTransportDispatchPreviewEndRequestSchema, di as trimmedStringFromUnknown, dr as enumFactory, ei as agentProfileIdSchema, er as openMeldToolsUpdateAttemptSchema, f as runtimeTransportDispatchPreviewRequestSchema, fi as MAX_TEXT_LENGTH$1, g as runtimeTransportForkAgentSessionResultSchema, gi as resolvePublicAgentFailureRecovery, h as runtimeTransportErrorCodeSchema, hi as resolvePublicAgentAvailabilityCopy, i as localWakeRouteReportSchema, in as openMeldDaemonControlPlaneResponseSchema, ir as openMeldToolsUpdateRequestSourceSchema, j as runtimeTransportRejectedProfileRegistrationSchema, jr as parseOptionalClientMessageId, k as runtimeTransportRegisterSessionRequestSchema, kn as resolveMessageEnvelopeTargetField, l as runtimeTransportDispatchInteractionResponseFramePayloadSchema, lr as discriminatedUnion, m as runtimeTransportDispatchToolActivityRequestSchema, mi as resolveMappedPublicAgentFailureReason, mr as literal, mt as CONVERSATION_CONTINUITY_WARNING_PURPOSE, n as daemonExecutionCompatibilitySchema, ni as openMeldRuntimeProfileIdSchema, o as runtimeTransportDeliverDispatchRequestSchema, oi as profileWorkspaceModeSchema, on as skippedDaemonProfileSchema, p as runtimeTransportDispatchRuntimeEvidenceRequestSchema, pr as iso, q as LOCAL_FOLDER_PICKER_RUNTIME_CAPABILITY, qn as localCliComponentUpdateProjectionSchema, r as daemonStreamFrameSchema, rn as openMeldDaemonControlPlaneRequestSchema, s as runtimeTransportDispatchInteractionDeliveredRequestSchema, sn as providerDispatchRuntimeContextSchema, sr as boolean, t as CURRENT_DAEMON_EXECUTION_CONTRACT_EPOCH, ti as normalizeOptionalWorkingDirectory, tr as openMeldToolsUpdateOperationPhaseSchema, u as runtimeTransportDispatchLifecycleRequestSchema, v as runtimeTransportHeartbeatResponseSchema, vi as shouldPreferMappedPublicAgentFailureReason, vt as SPACE_MEMBER_JOIN_NOTICE_PURPOSE, w as runtimeTransportLocalAgentControlSetEnabledFramePayloadSchema, wn as collectCanonicalMentionTextFragments, x as runtimeTransportLocalAgentControlInterruptFramePayloadSchema, xr as strictObject, y as runtimeTransportLocalAgentControlCancelFramePayloadSchema, yt as SPACE_MEMBER_REMOVE_NOTICE_PURPOSE, zn as agentInteractionRequestSchema, zr as normalizeSpacePasswordText } from "./runtime-transport-
|
|
3
|
+
import { $ as resolveOpenMeldOrphanedLockIssue, $t as systemDir, At as legacyAccountProfileSpacesDir, B as toSpaceRemoveMembersUrl, C as updateConfiguredDeviceRuntimeState, Ct as accountProfileViewPath, D as normalizeBaseUrl, Dt as deviceOpenClawProfileDir, Et as deviceOpenClawProfileBootstrapPath, Ft as openMeldManagedBinaryPath, G as acquireLock, H as toSpaceUpdatesUrl, I as toSpaceLeaveUrl, It as openMeldManagedVersionBinaryPath, J as isOpenMeldOrphanedLockError, Jt as resolveOpenMeldRootDir, Kt as resolveOpenMeldEnvPreset, L as toSpaceMembersUrl, Lt as openMeldManagedVersionDir, M as toSpaceCursorUrl, Mt as normalizeOpenMeldProfileId, N as toSpaceDeleteUrl, Nt as openMeldBackupsDir, O as toDaemonRouteObservationUrl, Ot as deviceOpenClawProfileWorkspaceDir, Pt as openMeldBinDir, R as toSpaceMetaUrl, Rt as openMeldRootDir, S as setConfiguredSkillsConfig, St as accountProfileSpaceCacheDir, T as updateConfiguredSkillsConfig, Tt as accountsDir, U as toSpaceWsUrl, Ut as resolveDefaultOpenMeldHomeDirname, W as isLoopbackHostname, Wt as resolveExplicitOpenMeldEnvPreset, Xt as runtimeLogsDir, Yt as runtimeDir, Zt as skillsDir, _ as getConfiguredViewCustomization, _n as normalizeBuiltinAgentControllerId, a as resolveBaseUrl, an as runtimeStreamingModeSchema, at as readCliContextState, bt as OPENMELD_HOME_ENV_KEY, c as resolveExplicitGatewayUrlOrThrow, cn as buildAgentControllerConversationRef, ct as writeCliContextState, d as createDefaultRuntimeAgentControllerSettings, dn as HOSTED_CENTER_AGENT_CONTROLLER_REF, en as formatLocalMachineIssueMessage, et as runWithHeldLock, f as getConfiguredDaemonDispatchLimits, fn as HOSTED_CENTER_AGENT_CONTROLLER_REF_ID, ft as assessLocalMachineFailure, g as getConfiguredSkillsConfig, gn as canonicalizeBuiltinAgentControllerRef, h as getConfiguredOpenMeldToolsMaintenance, hn as canonicalizeAgentControllerRef, i as normalizeGatewayBaseUrlOrNull, it as listCliContextStates, j as toSpaceCreateUrl, jt as normalizeAccountKey, kt as isPublishedOpenMeldHome, l as DEFAULT_RUNTIME_AGENT_TRANSPORT_MODE, ln as conversationPolicySchema, mn as buildAgentControllerRoutingKey, mt as createBackgroundExecutionBlockedIssue, nn as runtimeAgentControllerConversationIdMappingSpecSchema, o as resolveBaseUrlOrNull, on as runtimeTransportModeSchema, ot as resolveCliContext, p as getConfiguredDeviceRuntimeState, q as isOpenMeldLockError, qt as resolveOpenMeldPresetOwnedPathInput, r as normalizeGatewayBaseUrl, rn as runtimeAgentControllerLaunchContractSchema, s as resolveDefaultGatewayBaseUrl, st as resolveCliContextId, un as resolveBuiltinAgentControllerConversationKind, ut as resolveOpenMeldLaneDescriptor, v as getRuntimeConfigReadHealth, vn as normalizeKnownBuiltinAgentControllerId, vt as CURRENT_PROCESS_START_IDENTITY, wt as accountProfileWorkspacePath, x as setConfiguredOpenMeldToolsMaintenance, xt as accountProfileLocalMetaPath, y as resolveRuntimeSkillsCustomTargetId, yn as parseAgentControllerRef$1, yt as isProcessIdentityAlive, z as toSpacePasswordUrl, zt as openMeldVersionsDir } from "./base-url-CY_j4bLH.js";
|
|
4
|
+
import { $ as submitAgentControllerTaskLifecycleEventItemSchema, $t as spaceMemberDirectorySchema, A as MAX_TEXT_LENGTH, At as submitFeedbackIssueRequestSchema, B as toErrorMessage$44, Bt as AGENT_ACTIVITY_PRESENCE_TTL_MAX_MS, C as createSpaceApi, Ct as ADDITIONAL_HUMAN_PROFILE_CREATION_DISABLED_CODE, D as toStructuredApiClientFailure, Dt as profileCapabilitiesResponseSchema, E as resolveProfileSpaceHistoryGatewayHost, Et as authProfileManagedRoleSchema, F as OPENMELD_HEADER_PROFILE_ID, Ft as listCenterAgentRoutinesResponseSchema, Gt as agentActivitySnapshotResponseSchema, H as toErrorMessage$43, It as pauseCenterAgentRoutineResponseSchema, Jt as localProjectControlDiscoverProjectsResponseSchema, Kt as localProjectControlConnectionSchema, L as OPENMELD_HEADER_REQUEST_ID, Lt as resumeCenterAgentRoutineResponseSchema, M as parseIncoming$1, Mt as createCenterAgentRoutineResponseSchema, N as parseServerErrorFrame$1, Nt as deleteCenterAgentRoutineResponseSchema, O as DAEMON_STREAM_KEEPALIVE_PING, Ot as profileErrorResponseSchema, P as resolveCustomMentionAliasOverride, Pt as listCenterAgentRoutineRunsResponseSchema, Qt as spaceMemberDirectoryEntrySchema, R as OPENMELD_HEADER_SPACE_ADDRESSING_VERSION, Rt as updateCenterAgentRoutineResponseSchema, S as createRuntimeReportingApi, St as organizationDirectoryResponseSchema, T as resolveAccountSpaceIndexGatewayHost, U as getSpaceUpdatesResponseSchema, V as sleep, Vt as agentActivityEventSchema, W as SPACE_DISPATCH_TRACE_PROMPT_PREVIEW_MAX_CHARS, Xt as postSpaceMembersResponseSchema, Yt as leaveSpaceResponseSchema, Zt as removeSpaceMembersResponseSchema, _t as listOrganizationSkillsResponseSchema, a as buildSpaceAttachmentDownloadPath, an as observedLocalAgentSessionSchema, at as gatewayErrorEnvelopeSchema, bn as agentControllerCollaborationModeSchema, bt as organizationSkillSummarySchema, c as createAgentProfileBindingApi, cn as listProjectsResponseSchema, ct as computerFileAccessDaemonFrameSchema, d as createCurrentDeviceApi, dn as centerAgentToolSpeakerSchema, dt as modelCatalogSchema, fn as openCodePermissionConfigSchema, ft as organizationSpaceDirectoryWithMemberCountsResponseSchema, g as createOrganizationApi, gt as getOrganizationSkillResponseSchema, h as createOpenMeldApiClient, ht as spaceMetaSchema, i as buildProfileSpaceHistoryUpsertPath, j as parseEnvelope$1, jt as submitFeedbackIssueResponseSchema, kt as organizationComputersResponseSchema, ln as projectSchema, lt as computerFileAccessPolicyInputSchema, m as createLocalRuntimeExpectedRoutesApi, mt as spaceCreatorSchema, n as OpenMeldApiClientInvalidResponseError, o as createAccountSpaceIndexApi, on as archiveProjectResponseSchema, ot as COMPUTER_FILE_ACCESS_RUNTIME_CAPABILITY, p as createFetchTransport, pt as resolveInitialSpaceAccessMode, qt as localProjectControlDaemonFrameSchema, r as buildProfileSpaceHistoryStatusPath, rn as agentActivitySessionInventoryResponseSchema, s as createAgentActivityApi, sn as createProjectResponseSchema, st as OPENMELD_RUNTIME_CAPABILITIES_HEADER, t as OpenMeldApiClientHttpError, un as updateProjectResponseSchema, ut as computerFileAccessPolicySchema, wt as ADDITIONAL_HUMAN_PROFILE_CREATION_DISABLED_MESSAGE, xn as toCompatibleSpaceAddressingRequestWireValue, y as createProfileSpaceHistoryApi, yn as agentControllerPermissionModeSchema, yt as organizationSkillReleaseSummarySchema } from "./dist-DEiXhSkt.js";
|
|
5
|
+
import { $r as MAX_PROFILE_WORKING_DIRECTORY_LENGTH, A as runtimeTransportRegisterSessionResponseSchema, Bn as agentInteractionResolutionSchema, C as runtimeTransportLocalAgentControlRefreshCatalogFramePayloadSchema, Cn as MESSAGE_MENTION_TYPE_VALUES, D as runtimeTransportOpenMeldToolsControlFramePayloadSchema, Dr as url, E as runtimeTransportLookupRouteOwnerServiceEvidenceSchema, En as getSpaceMessageAddressingRelationSupportForTargetKind, Fr as runtimeCoordinatorExecutionTokenEnvelopeSchema, Gn as formatLocalSetupActionLabel, H as openMeldDaemonTaskResultEnvelopeWriteSchema, Hn as formatLocalComponentsSummaryDescription, Hr as resolveSpaceMentionLabels, I as runtimeTransportSubmitTaskResultRequestSchema, Ir as runtimeTransportDeliveryExecutionIdentitySchema, J as OPENMELD_LOCAL_FOLDER_PICKER_CAPABILITY_HEADER, K as openMeldSpaceEgressActionSchema, Kn as installedLocalComponentsSnapshotSchema, Kt as resolveSpaceFileMimeType, L as OPENMELD_ORIGINAL_ERROR_MAX_LENGTH, Ln as AGENT_INTERACTION_DEFAULT_TIMEOUT_MS, M as runtimeTransportResumeControllerConversationFramePayloadSchema, N as runtimeTransportResumeControllerConversationResultFramePayloadSchema, O as runtimeTransportOpenMeldToolsControlResultFramePayloadSchema, On as normalizeMessageEnvelope, P as runtimeTransportRouteCatalogChangedFramePayloadSchema, Qr as openMeldRequestContextSchema, R as isOriginalErrorSafeForMessageDetails, Rt as SPACE_FILE_MAX_SIZE_BYTES, S as runtimeTransportLocalAgentControlManageInstallationFramePayloadSchema, Si as resolveCommandAgentWorkActivity, Sr as string, St as sanitizeSignalTextPreview, T as runtimeTransportLocalAgentControlSetProfileWorkspaceFramePayloadSchema, Tn as formatCanonicalMentionLiteral, U as openMeldDaemonTaskResultOpenClawGatewayVisibilityStatusSchema, Un as formatLocalComponentsSummaryLabel, V as openMeldDaemonProviderAccessEvidenceSchema, Vr as resolveSingleSpaceMentionLabels, W as openMeldDaemonTaskResultPayloadSchema, Wn as formatLocalSetupActionDescription, X as localFolderPickerHelperProtocolResultSchema, Xt as spaceFileNameSchema, Y as localFolderPickerDaemonFrameSchema, Z as localFolderPickerHelperResultSchema, Zn as localServiceComponentUpdateProjectionSchema, Zr as openMeldProfileIdSchema, _ as runtimeTransportHeartbeatRequestSchema, _i as sanitizeDispatchErrorSummary, a as runtimeTransportCapabilitiesSchema, b as runtimeTransportLocalAgentControlForkSessionFramePayloadSchema, bt as SPACE_MENTION_REJECT_NOTICE_PURPOSE, c as runtimeTransportDispatchInteractionRequestSchema, cn as conversationExecutionStateSchema, d as runtimeTransportDispatchPreviewEndRequestSchema, di as trimmedStringFromUnknown, dr as enumFactory, ei as agentProfileIdSchema, er as openMeldToolsUpdateAttemptSchema, f as runtimeTransportDispatchPreviewRequestSchema, fi as MAX_TEXT_LENGTH$1, g as runtimeTransportForkAgentSessionResultSchema, gi as resolvePublicAgentFailureRecovery, h as runtimeTransportErrorCodeSchema, hi as resolvePublicAgentAvailabilityCopy, i as localWakeRouteReportSchema, in as openMeldDaemonControlPlaneResponseSchema, ir as openMeldToolsUpdateRequestSourceSchema, j as runtimeTransportRejectedProfileRegistrationSchema, jr as parseOptionalClientMessageId, k as runtimeTransportRegisterSessionRequestSchema, kn as resolveMessageEnvelopeTargetField, l as runtimeTransportDispatchInteractionResponseFramePayloadSchema, lr as discriminatedUnion, m as runtimeTransportDispatchToolActivityRequestSchema, mi as resolveMappedPublicAgentFailureReason, mr as literal, mt as CONVERSATION_CONTINUITY_WARNING_PURPOSE, n as daemonExecutionCompatibilitySchema, ni as openMeldRuntimeProfileIdSchema, o as runtimeTransportDeliverDispatchRequestSchema, oi as profileWorkspaceModeSchema, on as skippedDaemonProfileSchema, p as runtimeTransportDispatchRuntimeEvidenceRequestSchema, pr as iso, q as LOCAL_FOLDER_PICKER_RUNTIME_CAPABILITY, qn as localCliComponentUpdateProjectionSchema, r as daemonStreamFrameSchema, rn as openMeldDaemonControlPlaneRequestSchema, s as runtimeTransportDispatchInteractionDeliveredRequestSchema, sn as providerDispatchRuntimeContextSchema, sr as boolean, t as CURRENT_DAEMON_EXECUTION_CONTRACT_EPOCH, ti as normalizeOptionalWorkingDirectory, tr as openMeldToolsUpdateOperationPhaseSchema, u as runtimeTransportDispatchLifecycleRequestSchema, v as runtimeTransportHeartbeatResponseSchema, vi as shouldPreferMappedPublicAgentFailureReason, vt as SPACE_MEMBER_JOIN_NOTICE_PURPOSE, w as runtimeTransportLocalAgentControlSetEnabledFramePayloadSchema, wn as collectCanonicalMentionTextFragments, x as runtimeTransportLocalAgentControlInterruptFramePayloadSchema, xr as strictObject, y as runtimeTransportLocalAgentControlCancelFramePayloadSchema, yt as SPACE_MEMBER_REMOVE_NOTICE_PURPOSE, zn as agentInteractionRequestSchema, zr as normalizeSpacePasswordText } from "./runtime-transport-CFM93Yqy.js";
|
|
6
6
|
import { r as daemonServiceLaneSchema, t as daemonServiceContractSchema } from "./service-contract-CRyDcIIf.js";
|
|
7
|
-
import { A as getDaemonRuntimeStatus, B as resolveDaemonServiceRuntimeMetadata, C as daemonServiceRepairJournalPath, D as daemonServiceUpdateWorkerBinaryExecutablePath, E as daemonServiceStableLauncherPath, F as readDaemonServiceLifecycleLockMeta, G as withDaemonServiceReconcileLock, H as rotateDaemonControlPlaneTokenIfExpired, I as readDaemonServiceLifecycleLockMetaWithCleanup, J as withDaemonServiceStopLock, K as withDaemonServiceRegistrationMutationLock, L as readDaemonServiceRuntimeSnapshot, M as installDaemon, N as isDaemonServiceRuntimeHeartbeatStale, O as daemonStatePath, P as readDaemonControlPlaneToken, R as releaseDaemonServiceLifecycleLock, S as daemonServiceRecognizedExecutablePaths$1, T as daemonServiceStableExecutableWrapperPath, U as setDaemonServiceRuntimeState, V as restoreDaemonInstallStateSnapshot, W as uninstallDaemon, X as writeDaemonLocalStateFile, Y as readDaemonLocalStateFile, _ as daemonRuntimeServiceManagerPath, a as DAEMON_SERVICE_RUNTIME_CONTROLLER_ENV, b as daemonServiceExecutableWrapperPaths$1, c as DAEMON_SERVICE_RUNTIME_STATE_SCHEMA, d as clearDaemonServiceRuntimeState, f as daemonDispatchJournalPath, g as daemonRuntimeRootPath, h as daemonRuntimeDataPath, i as DAEMON_SERVICE_RUNTIME_AUTO_START_ENV, j as getDaemonStatus, k as ensureDaemonControlPlaneToken, l as DAEMON_SERVICE_RUNTIME_SYSTEM_SERVICE_ENV, m as daemonRuntimeBundlesPath, n as writeDaemonRuntimeLease, o as DAEMON_SERVICE_RUNTIME_DETACHED_ENV, p as daemonLifecycleJournalPath, q as withDaemonServiceRunLock, r as DAEMON_HEARTBEAT_STALE_MS, s as DAEMON_SERVICE_RUNTIME_MODE_ENV, t as readDaemonRuntimeLease, u as acquireDaemonServiceLifecycleLock, v as daemonRuntimeStateRootPath, w as daemonServiceStableBinaryExecutablePath, x as daemonServiceLegacyExecutableWrapperPath, y as daemonServiceActiveBundleStatePath, z as resolveDaemonControlPlaneEndpoint } from "./daemon-runtime-lease-
|
|
8
|
-
import { A as HEARTBEAT_RESPONSE_TIMEOUT_MS$1, B as RUNTIME_AGENT_CONTROLLER_REPORT_SYNC_INTERVAL_MS$1, C as DAEMON_RUNTIME_CONTRACT_EPOCH$1, D as DEFAULT_GATEWAY_CHAIN_TIMEOUT_MS$1, E as DAEMON_STREAM_KEEPALIVE_PONG_TIMEOUT_MS$1, F as OPENCLAW_CLI_TIMEOUT_MS$1, H as RUNTIME_STATE_PERSIST_MIN_INTERVAL_MS$1, I as PROVIDER_CONVERSATION_PROOF_SYNC_INTERVAL_MS$1, L as PROVIDER_CONVERSATION_PROOF_SYNC_RETRY_INTERVAL_MS$1, N as MIN_HEARTBEAT_INTERVAL_MS$2, O as DEFAULT_HEARTBEAT_INTERVAL_MS$1, R as REGISTER_RESPONSE_TIMEOUT_MS$1, S as CATALOG_SYNC_SIGNAL_POLL_INTERVAL_MS$1, T as DAEMON_STREAM_KEEPALIVE_INTERVAL_MS$1, V as RUNTIME_AGENT_CONTROLLER_REPORT_SYNC_RETRY_INTERVAL_MS$1, a as beginAuthSessionTransition, h as setAuthSession, j as MAX_HEARTBEAT_INTERVAL_MS$2, l as getAuthSessionState, o as clearAuthSession, r as assertAuthSessionMutationAvailable, v as isBinaryDistribution, w as DAEMON_STREAM_CONNECT_TIMEOUT_MS$1, x as CATALOG_SYNC_RETRY_INTERVAL_MS$1, y as resolveOpenMeldDistribution } from "./auth-session-
|
|
9
|
-
import { a as AuthRequestCredentialError, c as buildOpenMeldRequestContextHeadersWithAuth, d as buildOpenMeldRequestContextFromProfile, f as buildOpenMeldRequestContextFromProfileIdentity, i as resolveSpaceRequestTimeoutMsForDiagnostics, l as buildRequestAuthHeaders, m as resolveAuthRequestCompatibility, n as createCliApiClientFoundation, o as buildOpenMeldProfileIdentityRequestHeadersWithAuth, p as deriveAuthBaseUrlFromGatewayUrl, r as fetchSpaceRequestWithTimeout, s as buildOpenMeldProfileRequestHeadersWithAuth, u as canAttachAuthTokenToRequest } from "./api-client-foundation-
|
|
7
|
+
import { A as getDaemonRuntimeStatus, B as resolveDaemonServiceRuntimeMetadata, C as daemonServiceRepairJournalPath, D as daemonServiceUpdateWorkerBinaryExecutablePath, E as daemonServiceStableLauncherPath, F as readDaemonServiceLifecycleLockMeta, G as withDaemonServiceReconcileLock, H as rotateDaemonControlPlaneTokenIfExpired, I as readDaemonServiceLifecycleLockMetaWithCleanup, J as withDaemonServiceStopLock, K as withDaemonServiceRegistrationMutationLock, L as readDaemonServiceRuntimeSnapshot, M as installDaemon, N as isDaemonServiceRuntimeHeartbeatStale, O as daemonStatePath, P as readDaemonControlPlaneToken, R as releaseDaemonServiceLifecycleLock, S as daemonServiceRecognizedExecutablePaths$1, T as daemonServiceStableExecutableWrapperPath, U as setDaemonServiceRuntimeState, V as restoreDaemonInstallStateSnapshot, W as uninstallDaemon, X as writeDaemonLocalStateFile, Y as readDaemonLocalStateFile, _ as daemonRuntimeServiceManagerPath, a as DAEMON_SERVICE_RUNTIME_CONTROLLER_ENV, b as daemonServiceExecutableWrapperPaths$1, c as DAEMON_SERVICE_RUNTIME_STATE_SCHEMA, d as clearDaemonServiceRuntimeState, f as daemonDispatchJournalPath, g as daemonRuntimeRootPath, h as daemonRuntimeDataPath, i as DAEMON_SERVICE_RUNTIME_AUTO_START_ENV, j as getDaemonStatus, k as ensureDaemonControlPlaneToken, l as DAEMON_SERVICE_RUNTIME_SYSTEM_SERVICE_ENV, m as daemonRuntimeBundlesPath, n as writeDaemonRuntimeLease, o as DAEMON_SERVICE_RUNTIME_DETACHED_ENV, p as daemonLifecycleJournalPath, q as withDaemonServiceRunLock, r as DAEMON_HEARTBEAT_STALE_MS, s as DAEMON_SERVICE_RUNTIME_MODE_ENV, t as readDaemonRuntimeLease, u as acquireDaemonServiceLifecycleLock, v as daemonRuntimeStateRootPath, w as daemonServiceStableBinaryExecutablePath, x as daemonServiceLegacyExecutableWrapperPath, y as daemonServiceActiveBundleStatePath, z as resolveDaemonControlPlaneEndpoint } from "./daemon-runtime-lease-6DIprlJy.js";
|
|
8
|
+
import { A as HEARTBEAT_RESPONSE_TIMEOUT_MS$1, B as RUNTIME_AGENT_CONTROLLER_REPORT_SYNC_INTERVAL_MS$1, C as DAEMON_RUNTIME_CONTRACT_EPOCH$1, D as DEFAULT_GATEWAY_CHAIN_TIMEOUT_MS$1, E as DAEMON_STREAM_KEEPALIVE_PONG_TIMEOUT_MS$1, F as OPENCLAW_CLI_TIMEOUT_MS$1, H as RUNTIME_STATE_PERSIST_MIN_INTERVAL_MS$1, I as PROVIDER_CONVERSATION_PROOF_SYNC_INTERVAL_MS$1, L as PROVIDER_CONVERSATION_PROOF_SYNC_RETRY_INTERVAL_MS$1, N as MIN_HEARTBEAT_INTERVAL_MS$2, O as DEFAULT_HEARTBEAT_INTERVAL_MS$1, R as REGISTER_RESPONSE_TIMEOUT_MS$1, S as CATALOG_SYNC_SIGNAL_POLL_INTERVAL_MS$1, T as DAEMON_STREAM_KEEPALIVE_INTERVAL_MS$1, V as RUNTIME_AGENT_CONTROLLER_REPORT_SYNC_RETRY_INTERVAL_MS$1, a as beginAuthSessionTransition, h as setAuthSession, j as MAX_HEARTBEAT_INTERVAL_MS$2, l as getAuthSessionState, o as clearAuthSession, r as assertAuthSessionMutationAvailable, v as isBinaryDistribution, w as DAEMON_STREAM_CONNECT_TIMEOUT_MS$1, x as CATALOG_SYNC_RETRY_INTERVAL_MS$1, y as resolveOpenMeldDistribution } from "./auth-session-hdKG6Oqe.js";
|
|
9
|
+
import { a as AuthRequestCredentialError, c as buildOpenMeldRequestContextHeadersWithAuth, d as buildOpenMeldRequestContextFromProfile, f as buildOpenMeldRequestContextFromProfileIdentity, i as resolveSpaceRequestTimeoutMsForDiagnostics, l as buildRequestAuthHeaders, m as resolveAuthRequestCompatibility, n as createCliApiClientFoundation, o as buildOpenMeldProfileIdentityRequestHeadersWithAuth, p as deriveAuthBaseUrlFromGatewayUrl, r as fetchSpaceRequestWithTimeout, s as buildOpenMeldProfileRequestHeadersWithAuth, u as canAttachAuthTokenToRequest } from "./api-client-foundation-tvnD_7HW.js";
|
|
10
10
|
import { createRequire } from "node:module";
|
|
11
11
|
import { homedir, tmpdir, userInfo } from "node:os";
|
|
12
12
|
import * as z$1 from "zod/v4";
|
|
@@ -3274,9 +3274,9 @@ function isSameContractState(current, candidate) {
|
|
|
3274
3274
|
//#endregion
|
|
3275
3275
|
//#region src/agent-activity/opencode-storage.ts
|
|
3276
3276
|
function resolveOpenCodeDatabasePath(input) {
|
|
3277
|
-
return join(normalizeOptionalText$
|
|
3277
|
+
return join(normalizeOptionalText$76(input.xdgDataHome ?? process.env.XDG_DATA_HOME) ?? join(input.homeDir, ".local", "share"), "opencode", "opencode.db");
|
|
3278
3278
|
}
|
|
3279
|
-
function normalizeOptionalText$
|
|
3279
|
+
function normalizeOptionalText$76(value) {
|
|
3280
3280
|
const normalized = value?.trim();
|
|
3281
3281
|
return normalized ? normalized : null;
|
|
3282
3282
|
}
|
|
@@ -4660,8 +4660,8 @@ const MACOS_TEMP_FOLDER_RE = /^\/var\/folders\/[^/]+\/[^/]+\/t(?:\/|$)/u;
|
|
|
4660
4660
|
const WRAPPER_PATH_SEGMENT_RE = /(?:^|[-_.])(?:shim|shims|wrapper|wrappers)(?:$|[-_.])/u;
|
|
4661
4661
|
const MAX_LAUNCH_SCRIPT_INSPECTION_BYTES = 64 * 1024;
|
|
4662
4662
|
const DEFAULT_LOGIN_SHELL_LOOKUP_TIMEOUT_MS = 1500;
|
|
4663
|
-
const HOME_DIR = normalizeOptionalText$
|
|
4664
|
-
const TEMP_DIR = normalizeOptionalText$
|
|
4663
|
+
const HOME_DIR = normalizeOptionalText$75(homedir());
|
|
4664
|
+
const TEMP_DIR = normalizeOptionalText$75(tmpdir());
|
|
4665
4665
|
const loginShellExecutablePathsCache = /* @__PURE__ */ new Map();
|
|
4666
4666
|
function buildExecutableLaunchContract(input) {
|
|
4667
4667
|
return {
|
|
@@ -4863,7 +4863,7 @@ function resolveInstalledCommandPath(input) {
|
|
|
4863
4863
|
return resolveInstalledCommandPaths(input)[0] ?? null;
|
|
4864
4864
|
}
|
|
4865
4865
|
function resolveInstalledCommandPaths(input) {
|
|
4866
|
-
const configuredCommand = normalizeOptionalText$
|
|
4866
|
+
const configuredCommand = normalizeOptionalText$75(input.configuredCommand);
|
|
4867
4867
|
if (configuredCommand) {
|
|
4868
4868
|
if (isAbsolute(configuredCommand)) return [configuredCommand];
|
|
4869
4869
|
if (configuredCommand.includes("/") || configuredCommand.includes("\\")) return [];
|
|
@@ -4872,9 +4872,9 @@ function resolveInstalledCommandPaths(input) {
|
|
|
4872
4872
|
return resolveExecutablePathsOnPath(input.commandName);
|
|
4873
4873
|
}
|
|
4874
4874
|
async function resolveInstalledCommandPathsForLaunch(input) {
|
|
4875
|
-
const preferredCommandPath = normalizeOptionalText$
|
|
4875
|
+
const preferredCommandPath = normalizeOptionalText$75(input.preferredCommandPath);
|
|
4876
4876
|
const preferredCommandPaths = preferredCommandPath && isAbsolute(preferredCommandPath) ? [preferredCommandPath] : [];
|
|
4877
|
-
const configuredCommand = normalizeOptionalText$
|
|
4877
|
+
const configuredCommand = normalizeOptionalText$75(input.configuredCommand);
|
|
4878
4878
|
if (configuredCommand) {
|
|
4879
4879
|
if (isAbsolute(configuredCommand)) return mergeUniquePaths(preferredCommandPaths, [configuredCommand]);
|
|
4880
4880
|
if (configuredCommand.includes("/") || configuredCommand.includes("\\")) return preferredCommandPaths;
|
|
@@ -4892,7 +4892,7 @@ function resolveExecutableOnPath(commandName) {
|
|
|
4892
4892
|
return resolveExecutablePathsOnPath(commandName)[0] ?? null;
|
|
4893
4893
|
}
|
|
4894
4894
|
function resolveExecutablePathsOnPath(commandName) {
|
|
4895
|
-
const normalizedCommandName = normalizeOptionalText$
|
|
4895
|
+
const normalizedCommandName = normalizeOptionalText$75(commandName);
|
|
4896
4896
|
if (!normalizedCommandName) return [];
|
|
4897
4897
|
const resolvedPaths = [];
|
|
4898
4898
|
for (const directory of resolvePathDirectories()) for (const candidateName of resolveCommandFileNameCandidates(normalizedCommandName)) {
|
|
@@ -4914,7 +4914,7 @@ async function resolveExecutablePathsFromSearchSurface(input) {
|
|
|
4914
4914
|
}
|
|
4915
4915
|
function resolvePathDirectories() {
|
|
4916
4916
|
const directories = [];
|
|
4917
|
-
const pathValue = normalizeOptionalText$
|
|
4917
|
+
const pathValue = normalizeOptionalText$75(process.env.PATH);
|
|
4918
4918
|
for (const pathEntry of pathValue?.split(delimiter) ?? []) addUniqueDirectory(directories, pathEntry);
|
|
4919
4919
|
return directories;
|
|
4920
4920
|
}
|
|
@@ -4925,7 +4925,7 @@ function resolveExecutablePathsFromKnownInstallDirectories(commandName) {
|
|
|
4925
4925
|
});
|
|
4926
4926
|
}
|
|
4927
4927
|
function resolveExecutablePathsFromDirectories(input) {
|
|
4928
|
-
const normalizedCommandName = normalizeOptionalText$
|
|
4928
|
+
const normalizedCommandName = normalizeOptionalText$75(input.commandName);
|
|
4929
4929
|
if (!normalizedCommandName) return [];
|
|
4930
4930
|
const resolvedPaths = [];
|
|
4931
4931
|
for (const directory of input.directories) for (const candidateName of resolveCommandFileNameCandidates(normalizedCommandName)) {
|
|
@@ -4938,12 +4938,12 @@ function resolveKnownInstallDirectories() {
|
|
|
4938
4938
|
const directories = [];
|
|
4939
4939
|
if (process.platform === "win32") return directories;
|
|
4940
4940
|
const home = resolveHomeDirectory();
|
|
4941
|
-
const nvmDir = normalizeOptionalText$
|
|
4942
|
-
const pnpmHome = normalizeOptionalText$
|
|
4943
|
-
const bunHome = normalizeOptionalText$
|
|
4944
|
-
const voltaHome = normalizeOptionalText$
|
|
4945
|
-
const asdfHome = normalizeOptionalText$
|
|
4946
|
-
const fnmHome = normalizeOptionalText$
|
|
4941
|
+
const nvmDir = normalizeOptionalText$75(process.env.NVM_DIR) ?? join(home, ".nvm");
|
|
4942
|
+
const pnpmHome = normalizeOptionalText$75(process.env.PNPM_HOME) ?? (process.platform === "darwin" ? join(home, "Library", "pnpm") : join(home, ".local", "share", "pnpm"));
|
|
4943
|
+
const bunHome = normalizeOptionalText$75(process.env.BUN_INSTALL) ?? join(home, ".bun");
|
|
4944
|
+
const voltaHome = normalizeOptionalText$75(process.env.VOLTA_HOME) ?? join(home, ".volta");
|
|
4945
|
+
const asdfHome = normalizeOptionalText$75(process.env.ASDF_DIR) ?? join(home, ".asdf");
|
|
4946
|
+
const fnmHome = normalizeOptionalText$75(process.env.FNM_DIR) ?? join(home, ".fnm");
|
|
4947
4947
|
addUniqueDirectory(directories, join(home, ".local", "bin"));
|
|
4948
4948
|
addUniqueDirectory(directories, "/usr/local/bin");
|
|
4949
4949
|
addUniqueDirectory(directories, "/opt/homebrew/bin");
|
|
@@ -4958,18 +4958,18 @@ function resolveKnownInstallDirectories() {
|
|
|
4958
4958
|
addUniqueDirectory(directories, join(home, ".local", "share", "fnm", "aliases", "default", "bin"));
|
|
4959
4959
|
addUniqueDirectory(directories, join(home, ".local", "share", "fnm", "current", "bin"));
|
|
4960
4960
|
for (const nvmBinDir of resolveNvmDefaultBinDirectories(nvmDir)) addUniqueDirectory(directories, nvmBinDir);
|
|
4961
|
-
const npmConfigPrefix = normalizeOptionalText$
|
|
4961
|
+
const npmConfigPrefix = normalizeOptionalText$75(process.env.NPM_CONFIG_PREFIX);
|
|
4962
4962
|
if (npmConfigPrefix) addUniqueDirectory(directories, join(npmConfigPrefix, "bin"));
|
|
4963
4963
|
return directories;
|
|
4964
4964
|
}
|
|
4965
4965
|
function addUniqueDirectory(directories, value) {
|
|
4966
|
-
const directory = normalizeOptionalText$
|
|
4966
|
+
const directory = normalizeOptionalText$75(value);
|
|
4967
4967
|
if (directory && !directories.includes(directory)) directories.push(directory);
|
|
4968
4968
|
}
|
|
4969
4969
|
async function resolveExecutablePathsFromLoginShell(commandName) {
|
|
4970
|
-
const normalizedCommandName = normalizeOptionalText$
|
|
4970
|
+
const normalizedCommandName = normalizeOptionalText$75(commandName);
|
|
4971
4971
|
if (!(normalizedCommandName && process.platform !== "win32")) return [];
|
|
4972
|
-
const shell = normalizeOptionalText$
|
|
4972
|
+
const shell = normalizeOptionalText$75(process.env.SHELL);
|
|
4973
4973
|
if (!(shell && isAbsolute(shell) && pathLooksExecutable(shell))) return [];
|
|
4974
4974
|
const cacheKey = [
|
|
4975
4975
|
shell,
|
|
@@ -5022,7 +5022,7 @@ async function runLoginShellExecutableLookup(input) {
|
|
|
5022
5022
|
finish([]);
|
|
5023
5023
|
return;
|
|
5024
5024
|
}
|
|
5025
|
-
finish(stdout.split(LOGIN_SHELL_OUTPUT_LINE_SPLIT_RE).map((line) => normalizeOptionalText$
|
|
5025
|
+
finish(stdout.split(LOGIN_SHELL_OUTPUT_LINE_SPLIT_RE).map((line) => normalizeOptionalText$75(line)).filter((line) => Boolean(line && isAbsolute(line) && pathLooksExecutable(line))));
|
|
5026
5026
|
});
|
|
5027
5027
|
});
|
|
5028
5028
|
}
|
|
@@ -5035,7 +5035,7 @@ function resolveNvmDefaultVersion(nvmDir) {
|
|
|
5035
5035
|
let value = readNvmAlias(nvmDir, "default");
|
|
5036
5036
|
const seenAliases = /* @__PURE__ */ new Set();
|
|
5037
5037
|
for (let depth = 0; depth < 4; depth += 1) {
|
|
5038
|
-
const normalizedValue = normalizeOptionalText$
|
|
5038
|
+
const normalizedValue = normalizeOptionalText$75(value);
|
|
5039
5039
|
if (!normalizedValue) return null;
|
|
5040
5040
|
if (isNvmVersionValue(normalizedValue)) return normalizedValue.startsWith("v") ? normalizedValue : `v${normalizedValue}`;
|
|
5041
5041
|
if (seenAliases.has(normalizedValue)) return null;
|
|
@@ -5046,7 +5046,7 @@ function resolveNvmDefaultVersion(nvmDir) {
|
|
|
5046
5046
|
}
|
|
5047
5047
|
function readNvmAlias(nvmDir, alias) {
|
|
5048
5048
|
try {
|
|
5049
|
-
return normalizeOptionalText$
|
|
5049
|
+
return normalizeOptionalText$75(readFileSync(join(nvmDir, "alias", alias), "utf8"));
|
|
5050
5050
|
} catch {
|
|
5051
5051
|
return null;
|
|
5052
5052
|
}
|
|
@@ -5055,10 +5055,10 @@ function isNvmVersionValue(value) {
|
|
|
5055
5055
|
return NVM_VERSION_VALUE_RE.test(value);
|
|
5056
5056
|
}
|
|
5057
5057
|
function resolveHomeDirectory() {
|
|
5058
|
-
return normalizeOptionalText$
|
|
5058
|
+
return normalizeOptionalText$75(process.env.HOME) ?? homedir();
|
|
5059
5059
|
}
|
|
5060
5060
|
function resolveLoginShellLookupTimeoutMs() {
|
|
5061
|
-
const raw = normalizeOptionalText$
|
|
5061
|
+
const raw = normalizeOptionalText$75(process.env.OPENMELD_EXECUTABLE_LOGIN_SHELL_TIMEOUT_MS);
|
|
5062
5062
|
if (!raw) return DEFAULT_LOGIN_SHELL_LOOKUP_TIMEOUT_MS;
|
|
5063
5063
|
const parsed = Number.parseInt(raw, 10);
|
|
5064
5064
|
return Number.isFinite(parsed) && parsed > 0 ? parsed : DEFAULT_LOGIN_SHELL_LOOKUP_TIMEOUT_MS;
|
|
@@ -5073,7 +5073,7 @@ function quotePosixShellToken$1(value) {
|
|
|
5073
5073
|
return `'${value.replaceAll("'", "'\\''")}'`;
|
|
5074
5074
|
}
|
|
5075
5075
|
function resolveSiblingCommandPath(input) {
|
|
5076
|
-
const normalizedCommandName = normalizeOptionalText$
|
|
5076
|
+
const normalizedCommandName = normalizeOptionalText$75(input.commandName);
|
|
5077
5077
|
if (!normalizedCommandName) return null;
|
|
5078
5078
|
const siblingDirectory = dirname(input.anchorPath);
|
|
5079
5079
|
for (const candidateName of resolveCommandFileNameCandidates(normalizedCommandName)) {
|
|
@@ -5083,7 +5083,7 @@ function resolveSiblingCommandPath(input) {
|
|
|
5083
5083
|
return null;
|
|
5084
5084
|
}
|
|
5085
5085
|
async function resolvePinnedNodePath(input) {
|
|
5086
|
-
const firstLine = normalizeOptionalText$
|
|
5086
|
+
const firstLine = normalizeOptionalText$75(input.firstLine);
|
|
5087
5087
|
if (!firstLine) return null;
|
|
5088
5088
|
if (firstLine === ENV_NODE_SHEBANG) {
|
|
5089
5089
|
const nodeSiblings = [join(dirname(input.commandPath), "node"), join(dirname(input.scriptPath), "node")].filter((candidate, index, candidates) => {
|
|
@@ -5093,7 +5093,7 @@ async function resolvePinnedNodePath(input) {
|
|
|
5093
5093
|
return null;
|
|
5094
5094
|
}
|
|
5095
5095
|
if (!firstLine.startsWith("#!")) return null;
|
|
5096
|
-
const interpreter = normalizeOptionalText$
|
|
5096
|
+
const interpreter = normalizeOptionalText$75(firstLine.slice(2));
|
|
5097
5097
|
if (!(interpreter && isAbsolute(interpreter))) return null;
|
|
5098
5098
|
const normalizedInterpreter = interpreter.split(SHEBANG_ARGS_SPLIT_RE, 1)[0] ?? interpreter;
|
|
5099
5099
|
try {
|
|
@@ -5141,11 +5141,11 @@ function resolveRunnablePathAccessMode() {
|
|
|
5141
5141
|
return process.platform === "win32" ? constants.F_OK : constants.X_OK;
|
|
5142
5142
|
}
|
|
5143
5143
|
function resolveWindowsPathExtensions(value) {
|
|
5144
|
-
const normalized = normalizeOptionalText$
|
|
5144
|
+
const normalized = normalizeOptionalText$75(value);
|
|
5145
5145
|
if (!normalized) return [...WINDOWS_PATHEXT];
|
|
5146
5146
|
return normalized.split(";").map((entry) => entry.trim().toLowerCase()).filter((entry, index, values) => entry && values.indexOf(entry) === index).map((entry) => entry.startsWith(".") ? entry : `.${entry}`);
|
|
5147
5147
|
}
|
|
5148
|
-
function normalizeOptionalText$
|
|
5148
|
+
function normalizeOptionalText$75(value) {
|
|
5149
5149
|
const normalized = String(value ?? "").trim();
|
|
5150
5150
|
return normalized.length > 0 ? normalized : null;
|
|
5151
5151
|
}
|
|
@@ -5239,7 +5239,7 @@ function shortenPathForDisplay(path) {
|
|
|
5239
5239
|
return `~${path.slice(HOME_DIR.length)}`;
|
|
5240
5240
|
}
|
|
5241
5241
|
function resolveNodeVersionFromPath(path) {
|
|
5242
|
-
return normalizeOptionalText$
|
|
5242
|
+
return normalizeOptionalText$75(path.match(NODE_VERSION_PATH_RE)?.[1]);
|
|
5243
5243
|
}
|
|
5244
5244
|
async function readLaunchScriptInspection(path) {
|
|
5245
5245
|
const file = await open(path, "r");
|
|
@@ -5254,7 +5254,7 @@ async function readLaunchScriptInspection(path) {
|
|
|
5254
5254
|
const firstLine = contents.split(FIRST_LINE_SPLIT_RE, 1)[0] ?? "";
|
|
5255
5255
|
return {
|
|
5256
5256
|
contents,
|
|
5257
|
-
firstLine: normalizeOptionalText$
|
|
5257
|
+
firstLine: normalizeOptionalText$75(firstLine)
|
|
5258
5258
|
};
|
|
5259
5259
|
}
|
|
5260
5260
|
function isTransientPathWrapper(input) {
|
|
@@ -5271,7 +5271,7 @@ function hasWrapperPathSegment(path) {
|
|
|
5271
5271
|
return normalizePathForDetection(path).split("/").filter((segment) => segment.length > 0).slice(-4).some((segment) => WRAPPER_PATH_SEGMENT_RE.test(segment));
|
|
5272
5272
|
}
|
|
5273
5273
|
function shellScriptLooksLikeWrapper(input) {
|
|
5274
|
-
const firstLine = normalizeOptionalText$
|
|
5274
|
+
const firstLine = normalizeOptionalText$75(input.firstLine)?.toLowerCase() ?? "";
|
|
5275
5275
|
if (!(firstLine.includes("bash") || firstLine.includes("/sh") || firstLine.includes("zsh"))) return false;
|
|
5276
5276
|
const contents = input.contents.toLowerCase();
|
|
5277
5277
|
return contents.includes("wrapper_shim") || contents.includes("shim_root") || contents.includes("\nexec ") && (contents.includes("wrapper") || contents.includes("shim"));
|
|
@@ -5640,7 +5640,7 @@ var AcpProcessSession = class {
|
|
|
5640
5640
|
let code = "protocol.request_failed";
|
|
5641
5641
|
if (error.code === -32601) code = "protocol.method_not_found";
|
|
5642
5642
|
else if (error.code === -32602) code = "protocol.invalid_params";
|
|
5643
|
-
const message = normalizeOptionalText$
|
|
5643
|
+
const message = normalizeOptionalText$74(error.message) ?? "ACP request failed";
|
|
5644
5644
|
return this.#error({
|
|
5645
5645
|
code,
|
|
5646
5646
|
errorType: "adapter",
|
|
@@ -5718,7 +5718,7 @@ var AcpProcessSession = class {
|
|
|
5718
5718
|
return this.#createError(input);
|
|
5719
5719
|
}
|
|
5720
5720
|
};
|
|
5721
|
-
function normalizeOptionalText$
|
|
5721
|
+
function normalizeOptionalText$74(value) {
|
|
5722
5722
|
const normalized = String(value ?? "").trim();
|
|
5723
5723
|
return normalized.length > 0 ? normalized : null;
|
|
5724
5724
|
}
|
|
@@ -5910,18 +5910,18 @@ function extractAcpToolActivityObservation(value) {
|
|
|
5910
5910
|
if (message?.method !== "session/update") return null;
|
|
5911
5911
|
const params = toRecord$16(message.params);
|
|
5912
5912
|
const update = toRecord$16(params?.update);
|
|
5913
|
-
const updateType = normalizeOptionalText$
|
|
5913
|
+
const updateType = normalizeOptionalText$73(update?.sessionUpdate);
|
|
5914
5914
|
if (!(update && (updateType === "tool_call" || updateType === "tool_call_update"))) return null;
|
|
5915
|
-
const toolCallId = normalizeOptionalText$
|
|
5915
|
+
const toolCallId = normalizeOptionalText$73(update.toolCallId ?? update.tool_call_id);
|
|
5916
5916
|
if (!toolCallId) return null;
|
|
5917
|
-
const sessionId = normalizeOptionalText$
|
|
5917
|
+
const sessionId = normalizeOptionalText$73(params?.sessionId);
|
|
5918
5918
|
return {
|
|
5919
5919
|
...Object.hasOwn(update, "rawInput") ? { providerInput: update.rawInput } : {},
|
|
5920
|
-
providerKind: normalizeOptionalText$
|
|
5920
|
+
providerKind: normalizeOptionalText$73(update.kind),
|
|
5921
5921
|
...Object.hasOwn(update, "locations") ? { providerLocations: update.locations } : {},
|
|
5922
|
-
providerTitle: normalizeOptionalText$
|
|
5922
|
+
providerTitle: normalizeOptionalText$73(update.title ?? update.name),
|
|
5923
5923
|
scopedToolCallId: sessionId ? `${sessionId}\0${toolCallId}` : toolCallId,
|
|
5924
|
-
status: normalizeOptionalText$
|
|
5924
|
+
status: normalizeOptionalText$73(update.status)?.toLowerCase() ?? null,
|
|
5925
5925
|
toolCallId
|
|
5926
5926
|
};
|
|
5927
5927
|
}
|
|
@@ -5964,11 +5964,11 @@ function readFilePath(value) {
|
|
|
5964
5964
|
value.filePath,
|
|
5965
5965
|
value.path
|
|
5966
5966
|
]) {
|
|
5967
|
-
const path = normalizeOptionalText$
|
|
5967
|
+
const path = normalizeOptionalText$73(candidate);
|
|
5968
5968
|
if (path) return path;
|
|
5969
5969
|
}
|
|
5970
5970
|
if (Array.isArray(value.changes)) for (const change of value.changes) {
|
|
5971
|
-
const path = normalizeOptionalText$
|
|
5971
|
+
const path = normalizeOptionalText$73(toRecord$16(change)?.path);
|
|
5972
5972
|
if (path) return path;
|
|
5973
5973
|
}
|
|
5974
5974
|
return null;
|
|
@@ -5976,7 +5976,7 @@ function readFilePath(value) {
|
|
|
5976
5976
|
function readLocationPath(value) {
|
|
5977
5977
|
if (!Array.isArray(value)) return null;
|
|
5978
5978
|
for (const location of value) {
|
|
5979
|
-
const path = normalizeOptionalText$
|
|
5979
|
+
const path = normalizeOptionalText$73(toRecord$16(location)?.path);
|
|
5980
5980
|
if (path) return path;
|
|
5981
5981
|
}
|
|
5982
5982
|
return null;
|
|
@@ -5997,7 +5997,7 @@ function resolveToolActivityState$1(current, status) {
|
|
|
5997
5997
|
if (status === "completed") return "output-available";
|
|
5998
5998
|
return "input-available";
|
|
5999
5999
|
}
|
|
6000
|
-
function normalizeOptionalText$
|
|
6000
|
+
function normalizeOptionalText$73(value) {
|
|
6001
6001
|
const normalized = typeof value === "string" ? value.trim() : "";
|
|
6002
6002
|
return normalized.length > 0 ? normalized : null;
|
|
6003
6003
|
}
|
|
@@ -6072,10 +6072,10 @@ const OPENMELD_CLI_COMMANDS = /* @__PURE__ */ new Set([
|
|
|
6072
6072
|
"openmeld-canary"
|
|
6073
6073
|
]);
|
|
6074
6074
|
function resolveDispatchSpaceActionMcpServer(env) {
|
|
6075
|
-
if (!normalizeOptionalText$
|
|
6076
|
-
const command = normalizeOptionalText$
|
|
6075
|
+
if (!normalizeOptionalText$72(env?.[SPACE_ACTION_CONTEXT_PATH_ENV])) return null;
|
|
6076
|
+
const command = normalizeOptionalText$72(env?.[USER_FACING_CLI_COMMAND_ENV]);
|
|
6077
6077
|
if (!(command && OPENMELD_CLI_COMMANDS.has(command))) throw new Error("OpenMeld cannot start the dispatch Space Action tool because the active CLI command is invalid.");
|
|
6078
|
-
const commandPath = normalizeOptionalText$
|
|
6078
|
+
const commandPath = normalizeOptionalText$72(env?.[SPACE_ACTION_TOOL_COMMAND_PATH_ENV]);
|
|
6079
6079
|
if (!(commandPath && isAbsolute(commandPath) && basename(commandPath) === command)) throw new Error("OpenMeld cannot start the dispatch Space Action tool because its dispatch-owned CLI path is invalid.");
|
|
6080
6080
|
return {
|
|
6081
6081
|
args: [
|
|
@@ -6086,7 +6086,7 @@ function resolveDispatchSpaceActionMcpServer(env) {
|
|
|
6086
6086
|
command,
|
|
6087
6087
|
commandPath,
|
|
6088
6088
|
env: Object.fromEntries(FORWARDED_ENV_NAMES.flatMap((name) => {
|
|
6089
|
-
const value = normalizeOptionalText$
|
|
6089
|
+
const value = normalizeOptionalText$72(env?.[name]);
|
|
6090
6090
|
return value ? [[name, value]] : [];
|
|
6091
6091
|
})),
|
|
6092
6092
|
id: OPENMELD_SPACE_ACTION_MCP_SERVER_ID,
|
|
@@ -6109,7 +6109,7 @@ function buildAcpDispatchSpaceActionMcpServers(env) {
|
|
|
6109
6109
|
name: config.id
|
|
6110
6110
|
}];
|
|
6111
6111
|
}
|
|
6112
|
-
function normalizeOptionalText$
|
|
6112
|
+
function normalizeOptionalText$72(value) {
|
|
6113
6113
|
const normalized = String(value ?? "").trim();
|
|
6114
6114
|
return normalized.length > 0 ? normalized : null;
|
|
6115
6115
|
}
|
|
@@ -6154,9 +6154,9 @@ const buildProviderExitError = (input) => {
|
|
|
6154
6154
|
};
|
|
6155
6155
|
};
|
|
6156
6156
|
const hasVisibleText = (value) => {
|
|
6157
|
-
return normalizeOptionalText$
|
|
6157
|
+
return normalizeOptionalText$71(value) !== null;
|
|
6158
6158
|
};
|
|
6159
|
-
const normalizeOptionalText$
|
|
6159
|
+
const normalizeOptionalText$71 = (value) => {
|
|
6160
6160
|
if (typeof value !== "string") return null;
|
|
6161
6161
|
const normalized = value.trim();
|
|
6162
6162
|
return normalized.length > 0 ? normalized : null;
|
|
@@ -6336,13 +6336,13 @@ var AdapterRepairConversationError = class extends Error {
|
|
|
6336
6336
|
};
|
|
6337
6337
|
const resolveRequiredRepairConversationId = (input) => {
|
|
6338
6338
|
if (input.policy !== "require_canonical" || input.request.executionMode !== "repair") return null;
|
|
6339
|
-
const canonicalConversationId = normalizeOptionalText$
|
|
6339
|
+
const canonicalConversationId = normalizeOptionalText$70(input.invokeRequest.agentControllerConversationId);
|
|
6340
6340
|
if (!canonicalConversationId) throw new AdapterRepairConversationMissingError();
|
|
6341
6341
|
return canonicalConversationId;
|
|
6342
6342
|
};
|
|
6343
6343
|
const requireCanonicalRepairConversation = (input) => {
|
|
6344
6344
|
if (!input.canonicalConversationId) return input.contextDelta;
|
|
6345
|
-
const observedConversationId = normalizeOptionalText$
|
|
6345
|
+
const observedConversationId = normalizeOptionalText$70(input.contextDelta?.agentControllerConversationId);
|
|
6346
6346
|
if (input.contextDelta?.refreshed === true || observedConversationId !== input.canonicalConversationId) throw new AdapterRepairConversationError();
|
|
6347
6347
|
return input.contextDelta;
|
|
6348
6348
|
};
|
|
@@ -6727,13 +6727,13 @@ const buildDefaultInvokeRequest = (input) => {
|
|
|
6727
6727
|
agentControllerConversationId: input.request.agentControllerConversationId,
|
|
6728
6728
|
bridgeSpec: input.bridgeSpec,
|
|
6729
6729
|
agentControllerConversation: input.request.agentControllerConversation
|
|
6730
|
-
}) : normalizeOptionalText$
|
|
6730
|
+
}) : normalizeOptionalText$70(input.request.agentControllerConversationId);
|
|
6731
6731
|
return {
|
|
6732
6732
|
...input.request,
|
|
6733
6733
|
agentControllerConversationId
|
|
6734
6734
|
};
|
|
6735
6735
|
};
|
|
6736
|
-
const normalizeOptionalText$
|
|
6736
|
+
const normalizeOptionalText$70 = (value) => {
|
|
6737
6737
|
if (typeof value !== "string") return null;
|
|
6738
6738
|
const normalized = value.trim();
|
|
6739
6739
|
return normalized.length > 0 ? normalized : null;
|
|
@@ -6776,7 +6776,7 @@ async function resolveInstalledClaudeCodeLaunchCandidates(input) {
|
|
|
6776
6776
|
const installedCandidates = await resolveInstalledNodeScriptLaunchCandidates({
|
|
6777
6777
|
additionalCommandDirectories: resolveClaudeCodeCommandDirectories(),
|
|
6778
6778
|
commandName: DEFAULT_CLAUDE_CODE_COMMAND,
|
|
6779
|
-
configuredCommand: normalizeOptionalText$
|
|
6779
|
+
configuredCommand: normalizeOptionalText$69(process.env.OPENMELD_DAEMON_RUNTIME_CLAUDE_CODE_BIN),
|
|
6780
6780
|
displayName: "Claude Code",
|
|
6781
6781
|
preferredLaunchContract: input?.preferredLaunchContract
|
|
6782
6782
|
});
|
|
@@ -6808,16 +6808,16 @@ async function verifyClaudeCodeLaunchContract(input) {
|
|
|
6808
6808
|
});
|
|
6809
6809
|
}
|
|
6810
6810
|
function resolveClaudeCodeTimeoutMs() {
|
|
6811
|
-
const raw = normalizeOptionalText$
|
|
6811
|
+
const raw = normalizeOptionalText$69(process.env.OPENMELD_DAEMON_RUNTIME_REQUEST_TIMEOUT_MS);
|
|
6812
6812
|
if (!raw) return null;
|
|
6813
6813
|
const parsed = Number.parseInt(raw, 10);
|
|
6814
6814
|
if (!Number.isFinite(parsed) || parsed <= 0) return null;
|
|
6815
6815
|
return parsed;
|
|
6816
6816
|
}
|
|
6817
6817
|
function resolveClaudeCodeCommandDirectories() {
|
|
6818
|
-
return [join(normalizeOptionalText$
|
|
6818
|
+
return [join(normalizeOptionalText$69(process.env.HOME) ?? homedir(), ".local", "bin")];
|
|
6819
6819
|
}
|
|
6820
|
-
function normalizeOptionalText$
|
|
6820
|
+
function normalizeOptionalText$69(value) {
|
|
6821
6821
|
const normalized = String(value ?? "").trim();
|
|
6822
6822
|
return normalized.length > 0 ? normalized : null;
|
|
6823
6823
|
}
|
|
@@ -6866,8 +6866,8 @@ function extractClaudeToolLifecycleObservations(message) {
|
|
|
6866
6866
|
const record = toRecord$15(message);
|
|
6867
6867
|
if (!record) return [];
|
|
6868
6868
|
if (record.type === "tool_progress") {
|
|
6869
|
-
const toolCallId = normalizeOptionalText$
|
|
6870
|
-
const providerToolName = normalizeOptionalText$
|
|
6869
|
+
const toolCallId = normalizeOptionalText$68(record.tool_use_id);
|
|
6870
|
+
const providerToolName = normalizeOptionalText$68(record.tool_name);
|
|
6871
6871
|
return toolCallId ? [{
|
|
6872
6872
|
providerToolInput: null,
|
|
6873
6873
|
providerToolName,
|
|
@@ -6878,11 +6878,11 @@ function extractClaudeToolLifecycleObservations(message) {
|
|
|
6878
6878
|
const content = readMessageContent(record.message);
|
|
6879
6879
|
if (record.type === "assistant") return content.flatMap((block) => {
|
|
6880
6880
|
if (block.type !== "tool_use") return [];
|
|
6881
|
-
const toolCallId = normalizeOptionalText$
|
|
6881
|
+
const toolCallId = normalizeOptionalText$68(block.id);
|
|
6882
6882
|
if (!toolCallId) return [];
|
|
6883
6883
|
return [{
|
|
6884
6884
|
providerToolInput: block.input,
|
|
6885
|
-
providerToolName: normalizeOptionalText$
|
|
6885
|
+
providerToolName: normalizeOptionalText$68(block.name),
|
|
6886
6886
|
state: "input-available",
|
|
6887
6887
|
toolCallId
|
|
6888
6888
|
}];
|
|
@@ -6890,7 +6890,7 @@ function extractClaudeToolLifecycleObservations(message) {
|
|
|
6890
6890
|
if (record.type !== "user") return [];
|
|
6891
6891
|
return content.flatMap((block) => {
|
|
6892
6892
|
if (block.type !== "tool_result") return [];
|
|
6893
|
-
const toolCallId = normalizeOptionalText$
|
|
6893
|
+
const toolCallId = normalizeOptionalText$68(block.tool_use_id);
|
|
6894
6894
|
if (!toolCallId) return [];
|
|
6895
6895
|
return [{
|
|
6896
6896
|
providerToolInput: null,
|
|
@@ -6911,7 +6911,7 @@ function readMessageContent(message) {
|
|
|
6911
6911
|
function toRecord$15(value) {
|
|
6912
6912
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
6913
6913
|
}
|
|
6914
|
-
function normalizeOptionalText$
|
|
6914
|
+
function normalizeOptionalText$68(value) {
|
|
6915
6915
|
const normalized = typeof value === "string" ? value.trim() : "";
|
|
6916
6916
|
return normalized.length > 0 ? normalized : null;
|
|
6917
6917
|
}
|
|
@@ -7350,8 +7350,8 @@ function parseClaudeOutputLine(line) {
|
|
|
7350
7350
|
}
|
|
7351
7351
|
const record = toObjectRecord(parsed);
|
|
7352
7352
|
if (!record) return null;
|
|
7353
|
-
const sessionId = normalizeOptionalText$
|
|
7354
|
-
const resultText = normalizeOptionalText$
|
|
7353
|
+
const sessionId = normalizeOptionalText$67(record.session_id);
|
|
7354
|
+
const resultText = normalizeOptionalText$67(record.result);
|
|
7355
7355
|
const isErrorResult = typeof record.is_error === "boolean" ? record.is_error : null;
|
|
7356
7356
|
if (record.type === "result") return {
|
|
7357
7357
|
errorMessage: isErrorResult ? resultText : null,
|
|
@@ -7362,7 +7362,7 @@ function parseClaudeOutputLine(line) {
|
|
|
7362
7362
|
terminal: true
|
|
7363
7363
|
};
|
|
7364
7364
|
if (record.type === "error") return {
|
|
7365
|
-
errorMessage: normalizeOptionalText$
|
|
7365
|
+
errorMessage: normalizeOptionalText$67(record.message),
|
|
7366
7366
|
isErrorResult: true,
|
|
7367
7367
|
previewDeltaText: null,
|
|
7368
7368
|
resultText: null,
|
|
@@ -7378,7 +7378,7 @@ function parseClaudeOutputLine(line) {
|
|
|
7378
7378
|
function parseClaudeStreamEvent(record, sessionId) {
|
|
7379
7379
|
const event = toObjectRecord(record.event);
|
|
7380
7380
|
if (!event) return null;
|
|
7381
|
-
const eventType = normalizeOptionalText$
|
|
7381
|
+
const eventType = normalizeOptionalText$67(event.type);
|
|
7382
7382
|
if (eventType === "message_start") return {
|
|
7383
7383
|
errorMessage: null,
|
|
7384
7384
|
isErrorResult: null,
|
|
@@ -7405,7 +7405,7 @@ function toObjectRecord(value) {
|
|
|
7405
7405
|
function normalizeText$13(value) {
|
|
7406
7406
|
return String(value ?? "").trim();
|
|
7407
7407
|
}
|
|
7408
|
-
function normalizeOptionalText$
|
|
7408
|
+
function normalizeOptionalText$67(value) {
|
|
7409
7409
|
const normalized = normalizeText$13(value);
|
|
7410
7410
|
return normalized.length > 0 ? normalized : null;
|
|
7411
7411
|
}
|
|
@@ -7416,16 +7416,16 @@ function preserveOptionalText$1(value) {
|
|
|
7416
7416
|
//#endregion
|
|
7417
7417
|
//#region ../../runtime/adapters/claude-code/dist/transport/claude-conversation-policy.js
|
|
7418
7418
|
function resolveClaudeConversationPolicyOptions(conversationPolicy) {
|
|
7419
|
-
const model = normalizeOptionalText$
|
|
7420
|
-
const fallbackModel = normalizeOptionalText$
|
|
7421
|
-
const reasoningLevel = normalizeOptionalText$
|
|
7419
|
+
const model = normalizeOptionalText$66(conversationPolicy?.model);
|
|
7420
|
+
const fallbackModel = normalizeOptionalText$66(conversationPolicy?.fallbackModel);
|
|
7421
|
+
const reasoningLevel = normalizeOptionalText$66(conversationPolicy?.reasoningLevel);
|
|
7422
7422
|
return {
|
|
7423
7423
|
...model ? { model } : {},
|
|
7424
7424
|
...fallbackModel && fallbackModel !== model ? { fallbackModel } : {},
|
|
7425
7425
|
...reasoningLevel ? { reasoningLevel } : {}
|
|
7426
7426
|
};
|
|
7427
7427
|
}
|
|
7428
|
-
function normalizeOptionalText$
|
|
7428
|
+
function normalizeOptionalText$66(value) {
|
|
7429
7429
|
const normalized = String(value ?? "").trim();
|
|
7430
7430
|
return normalized.length > 0 ? normalized : null;
|
|
7431
7431
|
}
|
|
@@ -7531,7 +7531,7 @@ var ClaudeCliTransportError = class extends Error {
|
|
|
7531
7531
|
}
|
|
7532
7532
|
};
|
|
7533
7533
|
async function invokeClaudeCliTransport(input) {
|
|
7534
|
-
const prompt = normalizeOptionalText$
|
|
7534
|
+
const prompt = normalizeOptionalText$65(input.prompt);
|
|
7535
7535
|
if (!prompt) throw new ClaudeCliTransportError({
|
|
7536
7536
|
code: "schema.invalid",
|
|
7537
7537
|
errorType: "config",
|
|
@@ -7544,16 +7544,16 @@ async function invokeClaudeCliTransport(input) {
|
|
|
7544
7544
|
executionMode: input.executionMode,
|
|
7545
7545
|
env: input.env,
|
|
7546
7546
|
prompt,
|
|
7547
|
-
sessionId: normalizeOptionalText$
|
|
7547
|
+
sessionId: normalizeOptionalText$65(input.sessionId),
|
|
7548
7548
|
streamingMode: input.streamingMode
|
|
7549
7549
|
}),
|
|
7550
7550
|
launchContract: input.launchContract
|
|
7551
7551
|
});
|
|
7552
7552
|
const invokedAtMs = Date.now();
|
|
7553
|
-
const canonicalRepairSessionId = input.executionMode === "repair" ? normalizeOptionalText$
|
|
7553
|
+
const canonicalRepairSessionId = input.executionMode === "repair" ? normalizeOptionalText$65(input.sessionId) : null;
|
|
7554
7554
|
let latestOutput = "";
|
|
7555
7555
|
let latestResultIsError = false;
|
|
7556
|
-
let resolvedSessionId = normalizeOptionalText$
|
|
7556
|
+
let resolvedSessionId = normalizeOptionalText$65(input.sessionId);
|
|
7557
7557
|
const providerErrorMessages = [];
|
|
7558
7558
|
const providerOriginalErrorMessages = [];
|
|
7559
7559
|
let firstStdoutAtMs = null;
|
|
@@ -7610,7 +7610,7 @@ async function invokeClaudeCliTransport(input) {
|
|
|
7610
7610
|
firstStdoutAtMs,
|
|
7611
7611
|
invokedAtMs,
|
|
7612
7612
|
previewEmitted: previewEmitter.emitted,
|
|
7613
|
-
resumedContext: normalizeOptionalText$
|
|
7613
|
+
resumedContext: normalizeOptionalText$65(input.sessionId) !== null,
|
|
7614
7614
|
streamingMode: input.streamingMode ?? "final"
|
|
7615
7615
|
});
|
|
7616
7616
|
const classifiedFailure = classifyClaudeFailure({
|
|
@@ -7629,7 +7629,7 @@ async function invokeClaudeCliTransport(input) {
|
|
|
7629
7629
|
telemetry
|
|
7630
7630
|
});
|
|
7631
7631
|
}
|
|
7632
|
-
const output = normalizeOptionalText$
|
|
7632
|
+
const output = normalizeOptionalText$65(latestOutput);
|
|
7633
7633
|
if (!output) throw new ClaudeCliTransportError({
|
|
7634
7634
|
code: "runtime.output.empty",
|
|
7635
7635
|
errorType: "adapter",
|
|
@@ -7640,20 +7640,20 @@ async function invokeClaudeCliTransport(input) {
|
|
|
7640
7640
|
firstStdoutAtMs,
|
|
7641
7641
|
invokedAtMs,
|
|
7642
7642
|
previewEmitted: previewEmitter.emitted,
|
|
7643
|
-
resumedContext: normalizeOptionalText$
|
|
7643
|
+
resumedContext: normalizeOptionalText$65(input.sessionId) !== null,
|
|
7644
7644
|
streamingMode: input.streamingMode ?? "final"
|
|
7645
7645
|
})
|
|
7646
7646
|
});
|
|
7647
7647
|
return {
|
|
7648
7648
|
output,
|
|
7649
|
-
sessionId: canonicalRepairSessionId ?? normalizeOptionalText$
|
|
7649
|
+
sessionId: canonicalRepairSessionId ?? normalizeOptionalText$65(resolvedSessionId),
|
|
7650
7650
|
telemetry: buildClaudeCliTelemetry({
|
|
7651
7651
|
driverResult,
|
|
7652
7652
|
firstOutputAtMs,
|
|
7653
7653
|
firstStdoutAtMs,
|
|
7654
7654
|
invokedAtMs,
|
|
7655
7655
|
previewEmitted: previewEmitter.emitted,
|
|
7656
|
-
resumedContext: normalizeOptionalText$
|
|
7656
|
+
resumedContext: normalizeOptionalText$65(input.sessionId) !== null,
|
|
7657
7657
|
streamingMode: input.streamingMode ?? "final"
|
|
7658
7658
|
})
|
|
7659
7659
|
};
|
|
@@ -7804,7 +7804,7 @@ const classifyClaudeFailure = (input) => {
|
|
|
7804
7804
|
errorType: "adapter",
|
|
7805
7805
|
message: `provider.process_terminated: claude process was terminated by ${input.exitSignal} before returning a result`
|
|
7806
7806
|
};
|
|
7807
|
-
const stderrText = normalizeOptionalText$
|
|
7807
|
+
const stderrText = normalizeOptionalText$65(input.stderrText);
|
|
7808
7808
|
if (stderrText) return {
|
|
7809
7809
|
code: "upstream_unreachable",
|
|
7810
7810
|
errorType: "adapter",
|
|
@@ -7867,13 +7867,13 @@ const resolveProviderFailureMessage$3 = (input) => {
|
|
|
7867
7867
|
const candidateMessages = [
|
|
7868
7868
|
...input.providerErrorMessages,
|
|
7869
7869
|
...extractErrorMessagesFromStdout$2(input.stdoutText),
|
|
7870
|
-
...normalizeOptionalText$
|
|
7870
|
+
...normalizeOptionalText$65(input.stderrText) ? [normalizeOptionalText$65(input.stderrText)] : []
|
|
7871
7871
|
].filter((value) => Boolean(value));
|
|
7872
7872
|
for (const candidate of candidateMessages) if (looksLikeProviderFailure$3(candidate)) return candidate;
|
|
7873
7873
|
return candidateMessages[0] ?? null;
|
|
7874
7874
|
};
|
|
7875
7875
|
const extractErrorMessagesFromStdout$2 = (value) => {
|
|
7876
|
-
const stdoutText = normalizeOptionalText$
|
|
7876
|
+
const stdoutText = normalizeOptionalText$65(value);
|
|
7877
7877
|
if (!stdoutText) return [];
|
|
7878
7878
|
const messages = [];
|
|
7879
7879
|
const lines = stdoutText.split("\n");
|
|
@@ -7884,7 +7884,7 @@ const extractErrorMessagesFromStdout$2 = (value) => {
|
|
|
7884
7884
|
return messages;
|
|
7885
7885
|
};
|
|
7886
7886
|
const collectProviderErrorMessage$2 = (line, messages) => {
|
|
7887
|
-
const normalizedLine = normalizeOptionalText$
|
|
7887
|
+
const normalizedLine = normalizeOptionalText$65(line);
|
|
7888
7888
|
if (!normalizedLine) return;
|
|
7889
7889
|
messages.push(normalizedLine);
|
|
7890
7890
|
};
|
|
@@ -7934,7 +7934,7 @@ const isProviderOverloadedFailure = (value) => {
|
|
|
7934
7934
|
function normalizeText$12(value) {
|
|
7935
7935
|
return String(value ?? "").trim();
|
|
7936
7936
|
}
|
|
7937
|
-
function normalizeOptionalText$
|
|
7937
|
+
function normalizeOptionalText$65(value) {
|
|
7938
7938
|
const normalized = normalizeText$12(value);
|
|
7939
7939
|
return normalized.length > 0 ? normalized : null;
|
|
7940
7940
|
}
|
|
@@ -7961,16 +7961,16 @@ function isFailedResultMessage(resultMessage) {
|
|
|
7961
7961
|
}
|
|
7962
7962
|
function resolveCanonicalRepairSessionId(input) {
|
|
7963
7963
|
if (input.executionMode !== "repair") return null;
|
|
7964
|
-
return normalizeOptionalText$
|
|
7964
|
+
return normalizeOptionalText$64(input.sessionId);
|
|
7965
7965
|
}
|
|
7966
7966
|
async function invokeClaudeAgentSdkTransport(input) {
|
|
7967
|
-
const prompt = normalizeOptionalText$
|
|
7967
|
+
const prompt = normalizeOptionalText$64(input.prompt);
|
|
7968
7968
|
if (!prompt) throw new ClaudeAgentSdkTransportError({
|
|
7969
7969
|
code: "schema.invalid",
|
|
7970
7970
|
errorType: "config",
|
|
7971
7971
|
message: "schema.invalid: prompt is required"
|
|
7972
7972
|
});
|
|
7973
|
-
const resumedContext = normalizeOptionalText$
|
|
7973
|
+
const resumedContext = normalizeOptionalText$64(input.sessionId) !== null;
|
|
7974
7974
|
const canonicalRepairSessionId = resolveCanonicalRepairSessionId(input);
|
|
7975
7975
|
const streamingMode = input.streamingMode ?? "final";
|
|
7976
7976
|
const resources = await createClaudeAgentSdkInvocationResources({
|
|
@@ -7991,7 +7991,7 @@ async function invokeClaudeAgentSdkTransport(input) {
|
|
|
7991
7991
|
let latestOutput = "";
|
|
7992
7992
|
let latestPlanDocument = "";
|
|
7993
7993
|
let resultMessage = null;
|
|
7994
|
-
let resolvedSessionId = normalizeOptionalText$
|
|
7994
|
+
let resolvedSessionId = normalizeOptionalText$64(input.sessionId);
|
|
7995
7995
|
let timeoutTriggeredAtMs = null;
|
|
7996
7996
|
let timeoutHandle = null;
|
|
7997
7997
|
let queryRuntime = null;
|
|
@@ -8019,7 +8019,7 @@ async function invokeClaudeAgentSdkTransport(input) {
|
|
|
8019
8019
|
},
|
|
8020
8020
|
pathToClaudeCodeExecutable: resources.executable.pathToClaudeCodeExecutable,
|
|
8021
8021
|
planDirectory: resources.planCapture.directory,
|
|
8022
|
-
sessionId: normalizeOptionalText$
|
|
8022
|
+
sessionId: normalizeOptionalText$64(input.sessionId),
|
|
8023
8023
|
streamingMode: input.streamingMode
|
|
8024
8024
|
}),
|
|
8025
8025
|
prompt: createSinglePrompt(input.instructionPrompt?.userPrompt ?? prompt)
|
|
@@ -8131,7 +8131,7 @@ async function invokeClaudeAgentSdkTransport(input) {
|
|
|
8131
8131
|
telemetry
|
|
8132
8132
|
});
|
|
8133
8133
|
}
|
|
8134
|
-
const output = normalizeOptionalText$
|
|
8134
|
+
const output = normalizeOptionalText$64(latestOutput);
|
|
8135
8135
|
if (!output) throw new ClaudeAgentSdkTransportError({
|
|
8136
8136
|
code: "runtime.output.empty",
|
|
8137
8137
|
errorType: "adapter",
|
|
@@ -8148,7 +8148,7 @@ async function invokeClaudeAgentSdkTransport(input) {
|
|
|
8148
8148
|
});
|
|
8149
8149
|
return {
|
|
8150
8150
|
output,
|
|
8151
|
-
sessionId: canonicalRepairSessionId ?? normalizeOptionalText$
|
|
8151
|
+
sessionId: canonicalRepairSessionId ?? normalizeOptionalText$64(resolvedSessionId),
|
|
8152
8152
|
telemetry: buildClaudeAgentSdkTelemetry({
|
|
8153
8153
|
firstOutputAtMs,
|
|
8154
8154
|
firstStderrAtMs,
|
|
@@ -8309,7 +8309,7 @@ function buildClaudeAgentSdkOptions(input) {
|
|
|
8309
8309
|
onElicitation: createClaudeOnElicitation({ onInteractionRequest: input.onInteractionRequest })
|
|
8310
8310
|
} : {}
|
|
8311
8311
|
};
|
|
8312
|
-
const sessionId = normalizeOptionalText$
|
|
8312
|
+
const sessionId = normalizeOptionalText$64(input.sessionId);
|
|
8313
8313
|
if (sessionId) {
|
|
8314
8314
|
options.resume = sessionId;
|
|
8315
8315
|
if (input.executionMode === "repair") options.forkSession = true;
|
|
@@ -8335,7 +8335,7 @@ async function readLatestClaudePlanDocument(planDirectory) {
|
|
|
8335
8335
|
planFiles.sort((left, right) => right.mtimeMs - left.mtimeMs);
|
|
8336
8336
|
const latestPlanFile = planFiles[0];
|
|
8337
8337
|
if (!latestPlanFile) return null;
|
|
8338
|
-
return normalizeOptionalText$
|
|
8338
|
+
return normalizeOptionalText$64((await readFile(latestPlanFile.path, "utf8")).slice(0, 64e3));
|
|
8339
8339
|
}
|
|
8340
8340
|
function createDefaultClaudeAgentSdkQuery(input) {
|
|
8341
8341
|
return query(input);
|
|
@@ -8359,7 +8359,7 @@ function handleClaudeAgentSdkMessage(input) {
|
|
|
8359
8359
|
let observedConversationId = null;
|
|
8360
8360
|
let resolvedSessionId = input.resolvedSessionId;
|
|
8361
8361
|
let resultMessage = input.resultMessage;
|
|
8362
|
-
const sessionId = normalizeOptionalText$
|
|
8362
|
+
const sessionId = normalizeOptionalText$64(input.message.session_id);
|
|
8363
8363
|
if (sessionId) observedConversationId = sessionId;
|
|
8364
8364
|
const previewDeltaText = extractPreviewDeltaText(input.message);
|
|
8365
8365
|
if (previewDeltaText) {
|
|
@@ -8412,7 +8412,7 @@ function extractAssistantMessageWrittenPlan(message) {
|
|
|
8412
8412
|
if (block.type !== "tool_use" || block.name !== "Write") continue;
|
|
8413
8413
|
const toolInput = block.input;
|
|
8414
8414
|
if (!toolInput || typeof toolInput !== "object" || Array.isArray(toolInput)) continue;
|
|
8415
|
-
const content = normalizeOptionalText$
|
|
8415
|
+
const content = normalizeOptionalText$64(toolInput.content);
|
|
8416
8416
|
if (content) writtenPlan = content.slice(0, 64e3);
|
|
8417
8417
|
}
|
|
8418
8418
|
return writtenPlan;
|
|
@@ -8453,7 +8453,7 @@ function toClaudeAgentSdkTransportError(input) {
|
|
|
8453
8453
|
const classifiedFailure = classifyClaudeFailure({
|
|
8454
8454
|
providerErrorMessages: input.providerErrorMessages,
|
|
8455
8455
|
providerOriginalErrorMessages: input.providerErrorMessages,
|
|
8456
|
-
stderrText: [fallbackMessage, input.stderrText].map(normalizeOptionalText$
|
|
8456
|
+
stderrText: [fallbackMessage, input.stderrText].map(normalizeOptionalText$64).filter((value) => value !== null).join("\n")
|
|
8457
8457
|
});
|
|
8458
8458
|
return new ClaudeAgentSdkTransportError({
|
|
8459
8459
|
code: classifiedFailure.code,
|
|
@@ -8503,7 +8503,7 @@ function shellQuote(value) {
|
|
|
8503
8503
|
function quoteWindowsArg$2(value) {
|
|
8504
8504
|
return `"${value.replaceAll("\"", "\"\"")}"`;
|
|
8505
8505
|
}
|
|
8506
|
-
function normalizeOptionalText$
|
|
8506
|
+
function normalizeOptionalText$64(value) {
|
|
8507
8507
|
const normalized = String(value ?? "").trim();
|
|
8508
8508
|
return normalized.length > 0 ? normalized : null;
|
|
8509
8509
|
}
|
|
@@ -8786,7 +8786,7 @@ const resolveDefaultClaudeCodeInvoke = (input) => {
|
|
|
8786
8786
|
...dispatchInput.onRuntimeEvent ? { onRuntimeEvent: dispatchInput.onRuntimeEvent } : {},
|
|
8787
8787
|
prompt: dispatchInput.prompt,
|
|
8788
8788
|
registerAgentSdkQuery,
|
|
8789
|
-
sessionId: normalizeOptionalText$
|
|
8789
|
+
sessionId: normalizeOptionalText$63(dispatchInput.agentControllerConversationId),
|
|
8790
8790
|
...dispatchInput.onPreview ? { onPreview: dispatchInput.onPreview } : {},
|
|
8791
8791
|
streamingMode: dispatchInput.streamingMode,
|
|
8792
8792
|
taskId: dispatchInput.taskId
|
|
@@ -8807,7 +8807,7 @@ const resolveDefaultClaudeCodeInvoke = (input) => {
|
|
|
8807
8807
|
};
|
|
8808
8808
|
};
|
|
8809
8809
|
async function resolveClaudeDispatchLaunchContract(input) {
|
|
8810
|
-
const explicitLaunchContract = input.inputLaunchContract ?? input.optionLaunchContract ?? (normalizeOptionalText$
|
|
8810
|
+
const explicitLaunchContract = input.inputLaunchContract ?? input.optionLaunchContract ?? (normalizeOptionalText$63(input.claudeBin) ? buildExecutableLaunchContract({ commandPath: normalizeOptionalText$63(input.claudeBin) }) : null);
|
|
8811
8811
|
if (explicitLaunchContract) {
|
|
8812
8812
|
const verification = await verifyClaudeCodeLaunchContract({ launchContract: explicitLaunchContract });
|
|
8813
8813
|
if (verification.ok) return explicitLaunchContract;
|
|
@@ -8821,7 +8821,7 @@ async function resolveClaudeDispatchLaunchContract(input) {
|
|
|
8821
8821
|
errorType: "config"
|
|
8822
8822
|
});
|
|
8823
8823
|
}
|
|
8824
|
-
const normalizeOptionalText$
|
|
8824
|
+
const normalizeOptionalText$63 = (value) => {
|
|
8825
8825
|
const normalized = String(value ?? "").trim();
|
|
8826
8826
|
return normalized.length > 0 ? normalized : null;
|
|
8827
8827
|
};
|
|
@@ -8858,7 +8858,7 @@ function isCodexSubscriptionAccessFailure(value) {
|
|
|
8858
8858
|
* changes behavior.
|
|
8859
8859
|
*/
|
|
8860
8860
|
function classifyCodexProviderAccountFailure(input) {
|
|
8861
|
-
if (normalizeOptionalText$
|
|
8861
|
+
if (normalizeOptionalText$62(input.codexErrorInfo)?.toLowerCase() === "usagelimitexceeded") return buildHardProviderFailure({
|
|
8862
8862
|
code: "usage_exhausted",
|
|
8863
8863
|
originalError: createProviderOriginalError(input.message),
|
|
8864
8864
|
reasonCode: "usage_exhausted"
|
|
@@ -8903,7 +8903,7 @@ function withOriginalError(classification, message) {
|
|
|
8903
8903
|
...originalError ? { originalError } : {}
|
|
8904
8904
|
};
|
|
8905
8905
|
}
|
|
8906
|
-
function normalizeOptionalText$
|
|
8906
|
+
function normalizeOptionalText$62(value) {
|
|
8907
8907
|
const normalized = String(value ?? "").trim();
|
|
8908
8908
|
return normalized.length > 0 ? normalized : null;
|
|
8909
8909
|
}
|
|
@@ -8935,7 +8935,7 @@ function extractCodexToolActivityEvent(value, fallbackObservedAtMs = Date.now())
|
|
|
8935
8935
|
const params = toRecord$12(record.params);
|
|
8936
8936
|
const item = toRecord$12(params?.item ?? record.item);
|
|
8937
8937
|
const itemType = normalizeCompactName(item?.type);
|
|
8938
|
-
const toolCallId = normalizeOptionalText$
|
|
8938
|
+
const toolCallId = normalizeOptionalText$61(item?.id);
|
|
8939
8939
|
if (!(item && toolCallId && CODEX_TOOL_ITEM_TYPES.has(itemType))) return null;
|
|
8940
8940
|
const work = resolveAdapterToolWorkActivity(itemType, item);
|
|
8941
8941
|
return {
|
|
@@ -8979,7 +8979,7 @@ function resolveObservedAtMs(input) {
|
|
|
8979
8979
|
function normalizeCompactName(value) {
|
|
8980
8980
|
return typeof value === "string" ? value.trim().toLowerCase() : "";
|
|
8981
8981
|
}
|
|
8982
|
-
function normalizeOptionalText$
|
|
8982
|
+
function normalizeOptionalText$61(value) {
|
|
8983
8983
|
const normalized = typeof value === "string" ? value.trim() : "";
|
|
8984
8984
|
return normalized.length > 0 ? normalized : null;
|
|
8985
8985
|
}
|
|
@@ -9316,7 +9316,7 @@ async function probeCodexAppServerAccount(input) {
|
|
|
9316
9316
|
}
|
|
9317
9317
|
async function invokeCodexAppServerTransport(input) {
|
|
9318
9318
|
throwIfCodexDispatchCancelled(input.cancellationSignal);
|
|
9319
|
-
const prompt = normalizeOptionalText$
|
|
9319
|
+
const prompt = normalizeOptionalText$60(input.prompt);
|
|
9320
9320
|
if (!prompt) throw new CodexAppServerTransportError({
|
|
9321
9321
|
code: "schema.invalid",
|
|
9322
9322
|
errorType: "config",
|
|
@@ -9357,7 +9357,7 @@ async function invokeCodexAppServerTransport(input) {
|
|
|
9357
9357
|
threadModel: threadContext.model
|
|
9358
9358
|
});
|
|
9359
9359
|
const executionThreadId = threadContext.threadId;
|
|
9360
|
-
const continuityThreadId = input.executionMode === "repair" ? normalizeOptionalText$
|
|
9360
|
+
const continuityThreadId = input.executionMode === "repair" ? normalizeOptionalText$60(input.threadId) ?? executionThreadId : executionThreadId;
|
|
9361
9361
|
const turnPrompt = resolveCodexTurnPrompt({
|
|
9362
9362
|
fallbackPrompt: prompt,
|
|
9363
9363
|
instructionPrompt: input.instructionPrompt,
|
|
@@ -9381,6 +9381,10 @@ async function invokeCodexAppServerTransport(input) {
|
|
|
9381
9381
|
operation: "turn/start"
|
|
9382
9382
|
}));
|
|
9383
9383
|
const turnId = readRequiredText(turn.id, "turn/start response turn.id");
|
|
9384
|
+
session.emitProviderTurnAccepted({
|
|
9385
|
+
threadId: executionThreadId,
|
|
9386
|
+
turnId
|
|
9387
|
+
});
|
|
9384
9388
|
const unregisterActiveTurn = session.registerActiveTurn({
|
|
9385
9389
|
onActiveTurn: input.onActiveTurn,
|
|
9386
9390
|
taskId: input.taskId,
|
|
@@ -9406,7 +9410,7 @@ async function invokeCodexAppServerTransport(input) {
|
|
|
9406
9410
|
errorType: "adapter",
|
|
9407
9411
|
message: interactionFailure.message
|
|
9408
9412
|
});
|
|
9409
|
-
const output = normalizeOptionalText$
|
|
9413
|
+
const output = normalizeOptionalText$60(readAgentMessageOutput(completedTurn) ?? session.readCollectedAgentMessageDeltaText());
|
|
9410
9414
|
requireSuccessfulCodexTurn(completedTurn);
|
|
9411
9415
|
if (output) session.markAgentOutputObserved();
|
|
9412
9416
|
await emitPreviewIfRequested({
|
|
@@ -9419,7 +9423,7 @@ async function invokeCodexAppServerTransport(input) {
|
|
|
9419
9423
|
telemetry: session.buildTelemetry({
|
|
9420
9424
|
invokedAtMs,
|
|
9421
9425
|
previewEmitted: input.streamingMode === "stream" && input.onPreview !== void 0,
|
|
9422
|
-
resumedContext: normalizeOptionalText$
|
|
9426
|
+
resumedContext: normalizeOptionalText$60(input.threadId) !== null,
|
|
9423
9427
|
streamingMode: input.streamingMode ?? "final"
|
|
9424
9428
|
}),
|
|
9425
9429
|
threadId: continuityThreadId
|
|
@@ -9456,7 +9460,7 @@ function requireSuccessfulCodexTurn(turn) {
|
|
|
9456
9460
|
});
|
|
9457
9461
|
}
|
|
9458
9462
|
async function verifyCodexAppServerThread(input) {
|
|
9459
|
-
const threadId = normalizeOptionalText$
|
|
9463
|
+
const threadId = normalizeOptionalText$60(input.threadId);
|
|
9460
9464
|
if (!threadId) throw new CodexAppServerTransportError({
|
|
9461
9465
|
code: "schema.invalid",
|
|
9462
9466
|
errorType: "config",
|
|
@@ -9479,7 +9483,7 @@ async function verifyCodexAppServerThread(input) {
|
|
|
9479
9483
|
});
|
|
9480
9484
|
}
|
|
9481
9485
|
async function forkCodexAppServerThread(input) {
|
|
9482
|
-
const sourceThreadId = normalizeOptionalText$
|
|
9486
|
+
const sourceThreadId = normalizeOptionalText$60(input.sourceThreadId);
|
|
9483
9487
|
if (!sourceThreadId) throw new CodexAppServerTransportError({
|
|
9484
9488
|
code: "schema.invalid",
|
|
9485
9489
|
errorType: "config",
|
|
@@ -9498,7 +9502,7 @@ async function forkCodexAppServerThread(input) {
|
|
|
9498
9502
|
code: "context.fork_timeout",
|
|
9499
9503
|
operation: "thread/fork"
|
|
9500
9504
|
}));
|
|
9501
|
-
const title = normalizeOptionalText$
|
|
9505
|
+
const title = normalizeOptionalText$60(input.title);
|
|
9502
9506
|
if (title) try {
|
|
9503
9507
|
await session.requestControl("thread/name/set", {
|
|
9504
9508
|
name: title,
|
|
@@ -9517,7 +9521,7 @@ async function forkCodexAppServerThread(input) {
|
|
|
9517
9521
|
});
|
|
9518
9522
|
}
|
|
9519
9523
|
async function resolveDispatchThreadContext(input) {
|
|
9520
|
-
const existingThreadId = normalizeOptionalText$
|
|
9524
|
+
const existingThreadId = normalizeOptionalText$60(input.threadId);
|
|
9521
9525
|
if (existingThreadId) {
|
|
9522
9526
|
if (input.executionMode === "repair") return await forkEphemeralCodexRepairThread({
|
|
9523
9527
|
conversationPolicyParams: input.conversationPolicyParams,
|
|
@@ -9594,7 +9598,7 @@ function buildOpenMeldCodexThreadSource(instructionEpoch) {
|
|
|
9594
9598
|
}
|
|
9595
9599
|
async function resolveCodexAppServerCollaborationMode(input) {
|
|
9596
9600
|
if (input.collaborationMode !== "plan") return null;
|
|
9597
|
-
const model = normalizeOptionalText$
|
|
9601
|
+
const model = normalizeOptionalText$60(input.model);
|
|
9598
9602
|
if (!model) throw new CodexAppServerTransportError({
|
|
9599
9603
|
code: "protocol.invalid",
|
|
9600
9604
|
errorType: "adapter",
|
|
@@ -9629,12 +9633,12 @@ async function resolveCodexAppServerTurnCollaborationMode(input) {
|
|
|
9629
9633
|
}
|
|
9630
9634
|
function readCodexAppServerCollaborationModePreset(value) {
|
|
9631
9635
|
const preset = toRecord$11(value);
|
|
9632
|
-
const mode = normalizeOptionalText$
|
|
9636
|
+
const mode = normalizeOptionalText$60(preset?.mode);
|
|
9633
9637
|
if (mode !== "default" && mode !== "plan") return null;
|
|
9634
9638
|
return {
|
|
9635
9639
|
mode,
|
|
9636
|
-
model: normalizeOptionalText$
|
|
9637
|
-
reasoningEffort: normalizeOptionalText$
|
|
9640
|
+
model: normalizeOptionalText$60(preset?.model),
|
|
9641
|
+
reasoningEffort: normalizeOptionalText$60(preset?.reasoning_effort)
|
|
9638
9642
|
};
|
|
9639
9643
|
}
|
|
9640
9644
|
function resolveCodexAppServerPermissionModeParams(value, executionMode, hasComputerFileAccessBoundary = false) {
|
|
@@ -9689,9 +9693,9 @@ function resolveCodexAgentControllerPermissionMode$1(value) {
|
|
|
9689
9693
|
}
|
|
9690
9694
|
function resolveCodexAppServerConversationPolicyParams(conversationPolicy) {
|
|
9691
9695
|
const params = {};
|
|
9692
|
-
const model = normalizeOptionalText$
|
|
9696
|
+
const model = normalizeOptionalText$60(conversationPolicy?.model);
|
|
9693
9697
|
if (model) params.model = model;
|
|
9694
|
-
const reasoningLevel = normalizeOptionalText$
|
|
9698
|
+
const reasoningLevel = normalizeOptionalText$60(conversationPolicy?.reasoningLevel);
|
|
9695
9699
|
if (reasoningLevel) params.effort = reasoningLevel;
|
|
9696
9700
|
return params;
|
|
9697
9701
|
}
|
|
@@ -10002,7 +10006,7 @@ var CodexAppServerSession = class {
|
|
|
10002
10006
|
if (candidate.method !== "turn/completed") return false;
|
|
10003
10007
|
const params = toRecord$11(candidate.params);
|
|
10004
10008
|
const turn = toRecord$11(params?.turn);
|
|
10005
|
-
return params?.threadId === input.threadId && normalizeOptionalText$
|
|
10009
|
+
return params?.threadId === input.threadId && normalizeOptionalText$60(turn?.id) === input.turnId;
|
|
10006
10010
|
})).params)?.turn);
|
|
10007
10011
|
if (!turn) throw new CodexAppServerTransportError({
|
|
10008
10012
|
code: "protocol.invalid",
|
|
@@ -10174,7 +10178,7 @@ var CodexAppServerSession = class {
|
|
|
10174
10178
|
#collectAgentMessageDelta(message) {
|
|
10175
10179
|
if (message.method !== "item/agentMessage/delta") return;
|
|
10176
10180
|
const params = toRecord$11(message.params);
|
|
10177
|
-
const itemId = normalizeOptionalText$
|
|
10181
|
+
const itemId = normalizeOptionalText$60(params?.itemId);
|
|
10178
10182
|
const delta = readAgentMessageDeltaText(params?.delta);
|
|
10179
10183
|
if (!(itemId && delta)) return;
|
|
10180
10184
|
this.markAgentOutputObserved();
|
|
@@ -10242,7 +10246,7 @@ var CodexAppServerSession = class {
|
|
|
10242
10246
|
return this.#interactionFailure;
|
|
10243
10247
|
}
|
|
10244
10248
|
emitProviderConversationObserved(threadId) {
|
|
10245
|
-
const agentControllerConversationId = normalizeOptionalText$
|
|
10249
|
+
const agentControllerConversationId = normalizeOptionalText$60(threadId);
|
|
10246
10250
|
if (!agentControllerConversationId) return;
|
|
10247
10251
|
this.#emitRuntimeEvent({
|
|
10248
10252
|
agentControllerConversationId,
|
|
@@ -10250,6 +10254,14 @@ var CodexAppServerSession = class {
|
|
|
10250
10254
|
tsMs: Date.now()
|
|
10251
10255
|
});
|
|
10252
10256
|
}
|
|
10257
|
+
emitProviderTurnAccepted(input) {
|
|
10258
|
+
this.#emitRuntimeEvent({
|
|
10259
|
+
agentControllerConversationId: input.threadId,
|
|
10260
|
+
phase: "provider_turn_accepted",
|
|
10261
|
+
tsMs: Date.now(),
|
|
10262
|
+
turnId: input.turnId
|
|
10263
|
+
});
|
|
10264
|
+
}
|
|
10253
10265
|
#emitRuntimeEvent(event) {
|
|
10254
10266
|
this.#onRuntimeEvent?.(event);
|
|
10255
10267
|
}
|
|
@@ -10260,9 +10272,9 @@ function readThreadIdFromResponse(value) {
|
|
|
10260
10272
|
function readThreadContextFromResponse(value) {
|
|
10261
10273
|
const response = toRecord$11(value);
|
|
10262
10274
|
return {
|
|
10263
|
-
model: normalizeOptionalText$
|
|
10275
|
+
model: normalizeOptionalText$60(response?.model),
|
|
10264
10276
|
threadId: readRequiredText(response?.thread?.id, "thread response thread.id"),
|
|
10265
|
-
threadSource: normalizeOptionalText$
|
|
10277
|
+
threadSource: normalizeOptionalText$60(response?.thread?.threadSource)
|
|
10266
10278
|
};
|
|
10267
10279
|
}
|
|
10268
10280
|
function readTurnStartResponse(value) {
|
|
@@ -10275,14 +10287,14 @@ function readTurnStartResponse(value) {
|
|
|
10275
10287
|
return turn;
|
|
10276
10288
|
}
|
|
10277
10289
|
function readAgentMessageOutput(turn) {
|
|
10278
|
-
const text = (Array.isArray(turn.items) ? turn.items : []).filter((item) => item.type === "agentMessage").map((item) => normalizeOptionalText$
|
|
10290
|
+
const text = (Array.isArray(turn.items) ? turn.items : []).filter((item) => item.type === "agentMessage").map((item) => normalizeOptionalText$60(item.text)).filter((item) => item !== null).join("\n").trim();
|
|
10279
10291
|
return text.length > 0 ? text : null;
|
|
10280
10292
|
}
|
|
10281
10293
|
function readTurnFailureMessage(turn) {
|
|
10282
|
-
return normalizeOptionalText$
|
|
10294
|
+
return normalizeOptionalText$60(turn.error?.message) ?? "codex app-server turn failed";
|
|
10283
10295
|
}
|
|
10284
10296
|
function readTurnFailureCodexErrorInfo(turn) {
|
|
10285
|
-
return normalizeOptionalText$
|
|
10297
|
+
return normalizeOptionalText$60(turn.error?.codexErrorInfo);
|
|
10286
10298
|
}
|
|
10287
10299
|
function readCodexTokenUsage(value) {
|
|
10288
10300
|
const usage = toRecord$11(value);
|
|
@@ -10740,7 +10752,7 @@ function convertCodexMcpElicitationValues(values, schema) {
|
|
|
10740
10752
|
return String(value);
|
|
10741
10753
|
}
|
|
10742
10754
|
function normalizeBoundedText$3(value, maxLength) {
|
|
10743
|
-
const text = normalizeOptionalText$
|
|
10755
|
+
const text = normalizeOptionalText$60(value);
|
|
10744
10756
|
return text ? text.slice(0, maxLength) : null;
|
|
10745
10757
|
}
|
|
10746
10758
|
function safeJsonStringify(value) {
|
|
@@ -10775,7 +10787,7 @@ function buildServerRequestDeclineResponse(method) {
|
|
|
10775
10787
|
}
|
|
10776
10788
|
}
|
|
10777
10789
|
function toJsonRpcTransportError$1(error) {
|
|
10778
|
-
const message = normalizeOptionalText$
|
|
10790
|
+
const message = normalizeOptionalText$60(error.message) ?? "codex app-server error";
|
|
10779
10791
|
const permissionDenial = classifyRuntimePermissionDenialMessage({
|
|
10780
10792
|
message,
|
|
10781
10793
|
source: "codex"
|
|
@@ -10830,7 +10842,7 @@ function toCodexAppServerTransportError(error, timeoutMs) {
|
|
|
10830
10842
|
});
|
|
10831
10843
|
}
|
|
10832
10844
|
function readRequiredText(value, label) {
|
|
10833
|
-
const text = normalizeOptionalText$
|
|
10845
|
+
const text = normalizeOptionalText$60(value);
|
|
10834
10846
|
if (text) return text;
|
|
10835
10847
|
throw new CodexAppServerTransportError({
|
|
10836
10848
|
code: "protocol.invalid",
|
|
@@ -10845,12 +10857,12 @@ function toRecord$11(value) {
|
|
|
10845
10857
|
function normalizeText$11(value) {
|
|
10846
10858
|
return String(value ?? "").trim();
|
|
10847
10859
|
}
|
|
10848
|
-
function normalizeOptionalText$
|
|
10860
|
+
function normalizeOptionalText$60(value) {
|
|
10849
10861
|
const normalized = normalizeText$11(value);
|
|
10850
10862
|
return normalized.length > 0 ? normalized : null;
|
|
10851
10863
|
}
|
|
10852
10864
|
function parseCodexAppServerVersion(response) {
|
|
10853
|
-
return normalizeOptionalText$
|
|
10865
|
+
return normalizeOptionalText$60(toRecord$11(response)?.userAgent)?.match(CODEX_APP_SERVER_VERSION_PATTERN)?.[1] ?? null;
|
|
10854
10866
|
}
|
|
10855
10867
|
function resolveCodexAppServerAuthStatus(input) {
|
|
10856
10868
|
if (input.account) return "authenticated";
|
|
@@ -10869,7 +10881,7 @@ async function resolveInstalledCodexLaunchCandidates(input) {
|
|
|
10869
10881
|
const installedCandidates = await resolveInstalledNodeScriptLaunchCandidates({
|
|
10870
10882
|
additionalCommandDirectories: resolveCodexAppBundleCommandDirectories(input?.appBundleRoots),
|
|
10871
10883
|
commandName: DEFAULT_CODEX_COMMAND,
|
|
10872
|
-
configuredCommand: normalizeOptionalText$
|
|
10884
|
+
configuredCommand: normalizeOptionalText$59(process.env.OPENMELD_DAEMON_RUNTIME_CODEX_BIN),
|
|
10873
10885
|
displayName: "Codex",
|
|
10874
10886
|
preferredLaunchContract: input?.preferredLaunchContract
|
|
10875
10887
|
});
|
|
@@ -10930,7 +10942,7 @@ async function verifyCodexCommandLaunchContract(input) {
|
|
|
10930
10942
|
});
|
|
10931
10943
|
}
|
|
10932
10944
|
function resolveCodexTimeoutMs() {
|
|
10933
|
-
const raw = normalizeOptionalText$
|
|
10945
|
+
const raw = normalizeOptionalText$59(process.env.OPENMELD_DAEMON_RUNTIME_REQUEST_TIMEOUT_MS);
|
|
10934
10946
|
if (!raw) return null;
|
|
10935
10947
|
const parsed = Number.parseInt(raw, 10);
|
|
10936
10948
|
if (!Number.isFinite(parsed) || parsed <= 0) return null;
|
|
@@ -10940,7 +10952,7 @@ function isCodexHostApplicationCommandPath(commandPath) {
|
|
|
10940
10952
|
return resolveCodexAppLabel(commandPath) !== null;
|
|
10941
10953
|
}
|
|
10942
10954
|
function resolveCodexAppBundleCommandDirectories(appBundleRoots) {
|
|
10943
|
-
const home = normalizeOptionalText$
|
|
10955
|
+
const home = normalizeOptionalText$59(process.env.HOME) ?? homedir();
|
|
10944
10956
|
return (appBundleRoots ?? ["/Applications", join(home, "Applications")]).flatMap((root) => CODEX_APP_BUNDLE_NAMES.map((appBundleName) => join(root, appBundleName, "Contents", "Resources")));
|
|
10945
10957
|
}
|
|
10946
10958
|
async function inspectCodexLaunchCandidate(input) {
|
|
@@ -11001,7 +11013,7 @@ function resolveCodexControlProbeTimeoutMs(timeoutMs) {
|
|
|
11001
11013
|
function toErrorMessage$38(error) {
|
|
11002
11014
|
return error instanceof Error ? error.message : String(error);
|
|
11003
11015
|
}
|
|
11004
|
-
function normalizeOptionalText$
|
|
11016
|
+
function normalizeOptionalText$59(value) {
|
|
11005
11017
|
const normalized = String(value ?? "").trim();
|
|
11006
11018
|
return normalized.length > 0 ? normalized : null;
|
|
11007
11019
|
}
|
|
@@ -11062,9 +11074,9 @@ function extractOutputFromCodexLine(line) {
|
|
|
11062
11074
|
const item = record.item && typeof record.item === "object" && !Array.isArray(record.item) ? record.item : null;
|
|
11063
11075
|
const response = record.response && typeof record.response === "object" && !Array.isArray(record.response) ? record.response : null;
|
|
11064
11076
|
if (record.type === "item.completed" && item?.type === "agent_message") {
|
|
11065
|
-
const phase = normalizeOptionalText$
|
|
11077
|
+
const phase = normalizeOptionalText$58(item.phase ?? record.phase);
|
|
11066
11078
|
if (phase && phase !== "final_answer") return null;
|
|
11067
|
-
const text = normalizeOptionalText$
|
|
11079
|
+
const text = normalizeOptionalText$58(item.text);
|
|
11068
11080
|
return text ? {
|
|
11069
11081
|
previewable: false,
|
|
11070
11082
|
terminal: true,
|
|
@@ -11072,7 +11084,7 @@ function extractOutputFromCodexLine(line) {
|
|
|
11072
11084
|
} : null;
|
|
11073
11085
|
}
|
|
11074
11086
|
if (record.type === "response.completed") {
|
|
11075
|
-
const text = normalizeOptionalText$
|
|
11087
|
+
const text = normalizeOptionalText$58(response?.output_text);
|
|
11076
11088
|
return text ? {
|
|
11077
11089
|
previewable: false,
|
|
11078
11090
|
terminal: true,
|
|
@@ -11102,12 +11114,12 @@ function extractThreadIdFromCodexLine(line) {
|
|
|
11102
11114
|
const record = parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : null;
|
|
11103
11115
|
if (!record) return null;
|
|
11104
11116
|
if (record.type !== "thread.started") return null;
|
|
11105
|
-
return normalizeOptionalText$
|
|
11117
|
+
return normalizeOptionalText$58(record.thread_id);
|
|
11106
11118
|
}
|
|
11107
11119
|
function normalizeText$10(value) {
|
|
11108
11120
|
return String(value ?? "").trim();
|
|
11109
11121
|
}
|
|
11110
|
-
function normalizeOptionalText$
|
|
11122
|
+
function normalizeOptionalText$58(value) {
|
|
11111
11123
|
const normalized = normalizeText$10(value);
|
|
11112
11124
|
return normalized.length > 0 ? normalized : null;
|
|
11113
11125
|
}
|
|
@@ -11128,7 +11140,7 @@ var CodexCliTransportError = class extends Error {
|
|
|
11128
11140
|
}
|
|
11129
11141
|
};
|
|
11130
11142
|
async function invokeCodexCliTransport(input) {
|
|
11131
|
-
const prompt = normalizeOptionalText$
|
|
11143
|
+
const prompt = normalizeOptionalText$57(input.prompt);
|
|
11132
11144
|
if (!prompt) throw new CodexCliTransportError({
|
|
11133
11145
|
code: "schema.invalid",
|
|
11134
11146
|
errorType: "config",
|
|
@@ -11221,7 +11233,7 @@ async function invokeCodexCliTransport(input) {
|
|
|
11221
11233
|
providerAccessEvidence: classifiedFailure.providerAccessEvidence
|
|
11222
11234
|
});
|
|
11223
11235
|
}
|
|
11224
|
-
const output = normalizeOptionalText$
|
|
11236
|
+
const output = normalizeOptionalText$57(latestOutput);
|
|
11225
11237
|
if (!output) {
|
|
11226
11238
|
if (providerErrorMessages.length > 0) {
|
|
11227
11239
|
const classifiedFailure = classifyCodexFailure({
|
|
@@ -11257,12 +11269,12 @@ async function invokeCodexCliTransport(input) {
|
|
|
11257
11269
|
previewEmitted: previewEmitter.emitted,
|
|
11258
11270
|
...driverResult.lifecycle.processId === null ? {} : { processId: driverResult.lifecycle.processId },
|
|
11259
11271
|
...driverResult.lifecycle.processSpawnedAtMs === null ? {} : { processSpawnedAtMs: driverResult.lifecycle.processSpawnedAtMs },
|
|
11260
|
-
resumedContext: normalizeOptionalText$
|
|
11272
|
+
resumedContext: normalizeOptionalText$57(input.threadId) !== null,
|
|
11261
11273
|
...driverResult.lifecycle.stdinClosedAtMs === null ? {} : { stdinClosedAtMs: driverResult.lifecycle.stdinClosedAtMs },
|
|
11262
11274
|
streamingMode: input.streamingMode ?? "final",
|
|
11263
11275
|
...driverResult.lifecycle.timeoutTriggeredAtMs === null ? {} : { timeoutTriggeredAtMs: driverResult.lifecycle.timeoutTriggeredAtMs }
|
|
11264
11276
|
},
|
|
11265
|
-
threadId: normalizeOptionalText$
|
|
11277
|
+
threadId: normalizeOptionalText$57(resolvedThreadId)
|
|
11266
11278
|
};
|
|
11267
11279
|
}
|
|
11268
11280
|
function extractCodexToolActivityEventFromLine(line) {
|
|
@@ -11364,9 +11376,9 @@ function resolveCodexAgentControllerPermissionMode(value) {
|
|
|
11364
11376
|
}
|
|
11365
11377
|
function buildCodexConversationPolicyArgs(conversationPolicy) {
|
|
11366
11378
|
const args = [];
|
|
11367
|
-
const model = normalizeOptionalText$
|
|
11379
|
+
const model = normalizeOptionalText$57(conversationPolicy?.model);
|
|
11368
11380
|
if (model) args.push("-m", model);
|
|
11369
|
-
const reasoningLevel = normalizeOptionalText$
|
|
11381
|
+
const reasoningLevel = normalizeOptionalText$57(conversationPolicy?.reasoningLevel);
|
|
11370
11382
|
if (reasoningLevel) args.push("-c", `model_reasoning_effort=${reasoningLevel}`);
|
|
11371
11383
|
return args;
|
|
11372
11384
|
}
|
|
@@ -11453,7 +11465,7 @@ const toCodexCliTransportError = (error, timeoutMs) => {
|
|
|
11453
11465
|
});
|
|
11454
11466
|
};
|
|
11455
11467
|
const collectCodexErrorMessage = (line, messages) => {
|
|
11456
|
-
const normalizedLine = normalizeOptionalText$
|
|
11468
|
+
const normalizedLine = normalizeOptionalText$57(line);
|
|
11457
11469
|
if (!normalizedLine) return;
|
|
11458
11470
|
const jsonMessage = readCodexJsonErrorMessage(normalizedLine);
|
|
11459
11471
|
if (jsonMessage) messages.push(jsonMessage);
|
|
@@ -11467,9 +11479,9 @@ const readCodexJsonErrorMessage = (line) => {
|
|
|
11467
11479
|
}
|
|
11468
11480
|
const record = parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : null;
|
|
11469
11481
|
if (!record) return null;
|
|
11470
|
-
const message = normalizeOptionalText$
|
|
11482
|
+
const message = normalizeOptionalText$57(record.message);
|
|
11471
11483
|
if (record.type === "error" && message) return message;
|
|
11472
|
-
const errorMessage = normalizeOptionalText$
|
|
11484
|
+
const errorMessage = normalizeOptionalText$57((record.error && typeof record.error === "object" && !Array.isArray(record.error) ? record.error : null)?.message);
|
|
11473
11485
|
if (record.type === "turn.failed" && errorMessage) return errorMessage;
|
|
11474
11486
|
return null;
|
|
11475
11487
|
};
|
|
@@ -11502,7 +11514,7 @@ const classifyCodexFailure = (input) => {
|
|
|
11502
11514
|
message: toConfigInvalidMessage(providerMessage)
|
|
11503
11515
|
};
|
|
11504
11516
|
}
|
|
11505
|
-
const stderrText = normalizeOptionalText$
|
|
11517
|
+
const stderrText = normalizeOptionalText$57(input.stderrText);
|
|
11506
11518
|
if (stderrText) return {
|
|
11507
11519
|
code: "upstream_unreachable",
|
|
11508
11520
|
errorType: "adapter",
|
|
@@ -11513,8 +11525,8 @@ const classifyCodexFailure = (input) => {
|
|
|
11513
11525
|
const resolveProviderFailureMessage$2 = (input) => {
|
|
11514
11526
|
const candidateMessages = [
|
|
11515
11527
|
...input.providerErrorMessages,
|
|
11516
|
-
...normalizeOptionalText$
|
|
11517
|
-
...normalizeOptionalText$
|
|
11528
|
+
...normalizeOptionalText$57(input.stderrText) ? [normalizeOptionalText$57(input.stderrText)] : [],
|
|
11529
|
+
...normalizeOptionalText$57(input.stdoutText) ? [normalizeOptionalText$57(input.stdoutText)] : []
|
|
11518
11530
|
].filter((value) => Boolean(value));
|
|
11519
11531
|
for (const candidate of candidateMessages) if (looksLikeProviderFailure$2(candidate)) return candidate;
|
|
11520
11532
|
return candidateMessages[0] ?? null;
|
|
@@ -11538,7 +11550,7 @@ const toControllerClientUpgradeRequiredMessage = (value) => {
|
|
|
11538
11550
|
function normalizeText$9(value) {
|
|
11539
11551
|
return String(value ?? "").trim();
|
|
11540
11552
|
}
|
|
11541
|
-
function normalizeOptionalText$
|
|
11553
|
+
function normalizeOptionalText$57(value) {
|
|
11542
11554
|
const normalized = normalizeText$9(value);
|
|
11543
11555
|
return normalized.length > 0 ? normalized : null;
|
|
11544
11556
|
}
|
|
@@ -12196,7 +12208,7 @@ const resolveDefaultCodexInvoke = (options) => {
|
|
|
12196
12208
|
...input.onRuntimeEvent ? { onRuntimeEvent: input.onRuntimeEvent } : {},
|
|
12197
12209
|
prompt: input.prompt,
|
|
12198
12210
|
streamingMode: input.streamingMode,
|
|
12199
|
-
threadId: normalizeOptionalText$
|
|
12211
|
+
threadId: normalizeOptionalText$56(input.agentControllerConversationId)
|
|
12200
12212
|
});
|
|
12201
12213
|
const agentControllerConversation = CODEX_CONVERSATION_BRIDGE_SPEC ? bridgeAgentControllerConversationRef({
|
|
12202
12214
|
bridgeSpec: CODEX_CONVERSATION_BRIDGE_SPEC,
|
|
@@ -12254,7 +12266,7 @@ const resolveDefaultCodexAppServerInvoke = (input) => {
|
|
|
12254
12266
|
prompt: dispatchInput.prompt,
|
|
12255
12267
|
streamingMode: dispatchInput.streamingMode,
|
|
12256
12268
|
taskId: dispatchInput.taskId,
|
|
12257
|
-
threadId: normalizeOptionalText$
|
|
12269
|
+
threadId: normalizeOptionalText$56(dispatchInput.agentControllerConversationId)
|
|
12258
12270
|
});
|
|
12259
12271
|
const agentControllerConversation = CODEX_CONVERSATION_BRIDGE_SPEC ? bridgeAgentControllerConversationRef({
|
|
12260
12272
|
bridgeSpec: CODEX_CONVERSATION_BRIDGE_SPEC,
|
|
@@ -12315,9 +12327,9 @@ async function resolveCodexDispatchLaunchContract(input) {
|
|
|
12315
12327
|
});
|
|
12316
12328
|
}
|
|
12317
12329
|
function resolveConfiguredCodexLaunchContract(input) {
|
|
12318
|
-
return input.inputLaunchContract ?? input.optionLaunchContract ?? (normalizeOptionalText$
|
|
12330
|
+
return input.inputLaunchContract ?? input.optionLaunchContract ?? (normalizeOptionalText$56(input.codexBin) ? buildExecutableLaunchContract({ commandPath: normalizeOptionalText$56(input.codexBin) }) : null);
|
|
12319
12331
|
}
|
|
12320
|
-
const normalizeOptionalText$
|
|
12332
|
+
const normalizeOptionalText$56 = (value) => {
|
|
12321
12333
|
const normalized = String(value ?? "").trim();
|
|
12322
12334
|
return normalized.length > 0 ? normalized : null;
|
|
12323
12335
|
};
|
|
@@ -12330,7 +12342,7 @@ async function resolveInstalledGrokBuildLaunchCandidates(input) {
|
|
|
12330
12342
|
const installedCandidates = await resolveInstalledNodeScriptLaunchCandidates({
|
|
12331
12343
|
additionalCommandDirectories: [join(resolveHome(), ".grok", "bin")],
|
|
12332
12344
|
commandName: DEFAULT_GROK_BUILD_COMMAND,
|
|
12333
|
-
configuredCommand: normalizeOptionalText$
|
|
12345
|
+
configuredCommand: normalizeOptionalText$55(process.env.OPENMELD_DAEMON_RUNTIME_GROK_BUILD_BIN),
|
|
12334
12346
|
displayName: "Grok Build",
|
|
12335
12347
|
preferredLaunchContract: input?.preferredLaunchContract
|
|
12336
12348
|
});
|
|
@@ -12363,15 +12375,15 @@ async function verifyGrokBuildLaunchContract(input) {
|
|
|
12363
12375
|
});
|
|
12364
12376
|
}
|
|
12365
12377
|
function resolveGrokBuildTimeoutMs() {
|
|
12366
|
-
const raw = normalizeOptionalText$
|
|
12378
|
+
const raw = normalizeOptionalText$55(process.env.OPENMELD_DAEMON_RUNTIME_REQUEST_TIMEOUT_MS);
|
|
12367
12379
|
if (!raw) return null;
|
|
12368
12380
|
const parsed = Number.parseInt(raw, 10);
|
|
12369
12381
|
return Number.isFinite(parsed) && parsed > 0 ? parsed : null;
|
|
12370
12382
|
}
|
|
12371
12383
|
function resolveHome() {
|
|
12372
|
-
return normalizeOptionalText$
|
|
12384
|
+
return normalizeOptionalText$55(process.env.HOME) ?? homedir();
|
|
12373
12385
|
}
|
|
12374
|
-
function normalizeOptionalText$
|
|
12386
|
+
function normalizeOptionalText$55(value) {
|
|
12375
12387
|
const normalized = String(value ?? "").trim();
|
|
12376
12388
|
return normalized.length > 0 ? normalized : null;
|
|
12377
12389
|
}
|
|
@@ -12646,7 +12658,7 @@ async function probeGrokBuildAcpInterface(input) {
|
|
|
12646
12658
|
}
|
|
12647
12659
|
}
|
|
12648
12660
|
async function invokeGrokBuildAcpTransport(input) {
|
|
12649
|
-
const prompt = normalizeOptionalText$
|
|
12661
|
+
const prompt = normalizeOptionalText$54(input.prompt);
|
|
12650
12662
|
if (!prompt) throw new GrokBuildAcpTransportError({
|
|
12651
12663
|
code: "schema.invalid",
|
|
12652
12664
|
errorType: "config",
|
|
@@ -12661,16 +12673,16 @@ async function invokeGrokBuildAcpTransport(input) {
|
|
|
12661
12673
|
try {
|
|
12662
12674
|
session.start();
|
|
12663
12675
|
await session.initialize({ collectUsageLimits: false });
|
|
12664
|
-
const existingSessionId = normalizeOptionalText$
|
|
12676
|
+
const existingSessionId = normalizeOptionalText$54(input.sessionId);
|
|
12665
12677
|
const descriptor = await session.openSession({
|
|
12666
|
-
requestedModelId: normalizeOptionalText$
|
|
12678
|
+
requestedModelId: normalizeOptionalText$54(input.conversationPolicy?.model),
|
|
12667
12679
|
sessionId: existingSessionId
|
|
12668
12680
|
});
|
|
12669
12681
|
session.emitProviderConversationObserved(descriptor.sessionId);
|
|
12670
12682
|
await session.applyModelSelection({
|
|
12671
12683
|
descriptor,
|
|
12672
|
-
reasoningEffort: normalizeOptionalText$
|
|
12673
|
-
requestedModelId: normalizeOptionalText$
|
|
12684
|
+
reasoningEffort: normalizeOptionalText$54(input.conversationPolicy?.reasoningLevel),
|
|
12685
|
+
requestedModelId: normalizeOptionalText$54(input.conversationPolicy?.model)
|
|
12674
12686
|
});
|
|
12675
12687
|
const unregisterActiveTurn = input.onActiveTurn?.({
|
|
12676
12688
|
cancel: () => session.cancelAndCloseSession(descriptor.sessionId),
|
|
@@ -12867,7 +12879,7 @@ var GrokBuildAcpSession = class {
|
|
|
12867
12879
|
throw error;
|
|
12868
12880
|
}
|
|
12869
12881
|
const record = toRecord$7(result);
|
|
12870
|
-
const sessionId = normalizeOptionalText$
|
|
12882
|
+
const sessionId = normalizeOptionalText$54(record?.sessionId) ?? input.sessionId ?? null;
|
|
12871
12883
|
if (!sessionId) throw new GrokBuildAcpTransportError({
|
|
12872
12884
|
code: "protocol.invalid",
|
|
12873
12885
|
errorType: "adapter",
|
|
@@ -12982,7 +12994,7 @@ var GrokBuildAcpSession = class {
|
|
|
12982
12994
|
if (toolActivity) this.#emitRuntimeEvent(toolActivity);
|
|
12983
12995
|
}
|
|
12984
12996
|
async #handleClientRequest(request) {
|
|
12985
|
-
const requestSessionId = normalizeOptionalText$
|
|
12997
|
+
const requestSessionId = normalizeOptionalText$54(toRecord$7(request.params)?.sessionId);
|
|
12986
12998
|
if (!(this.#turnActive && requestSessionId !== null && this.#sessionId !== null && requestSessionId === this.#sessionId)) {
|
|
12987
12999
|
this.#recordInteractionFailure("interaction.session_mismatch", "interaction.session_mismatch: Grok Build requested input for a different session");
|
|
12988
13000
|
return { error: {
|
|
@@ -13086,10 +13098,10 @@ function buildSessionDescriptor(input) {
|
|
|
13086
13098
|
}
|
|
13087
13099
|
function readModelState(value) {
|
|
13088
13100
|
const record = toRecord$7(value);
|
|
13089
|
-
const currentModelId = normalizeOptionalText$
|
|
13101
|
+
const currentModelId = normalizeOptionalText$54(record?.currentModelId);
|
|
13090
13102
|
const models = (Array.isArray(record?.availableModels) ? record.availableModels : []).flatMap((candidate) => {
|
|
13091
13103
|
const model = toRecord$7(candidate);
|
|
13092
|
-
const modelId = normalizeOptionalText$
|
|
13104
|
+
const modelId = normalizeOptionalText$54(model?.modelId);
|
|
13093
13105
|
if (!modelId) return [];
|
|
13094
13106
|
const meta = toRecord$7(model?._meta);
|
|
13095
13107
|
const efforts = Array.isArray(meta?.reasoningEfforts) ? uniqueStrings(meta.reasoningEfforts.map((effort) => {
|
|
@@ -13097,8 +13109,8 @@ function readModelState(value) {
|
|
|
13097
13109
|
return record?.value ?? record?.id;
|
|
13098
13110
|
})) : [];
|
|
13099
13111
|
return [{
|
|
13100
|
-
currentEffort: normalizeOptionalText$
|
|
13101
|
-
displayName: normalizeOptionalText$
|
|
13112
|
+
currentEffort: normalizeOptionalText$54(meta?.reasoningEffort),
|
|
13113
|
+
displayName: normalizeOptionalText$54(model?.name) ?? modelId,
|
|
13102
13114
|
efforts,
|
|
13103
13115
|
modelId
|
|
13104
13116
|
}];
|
|
@@ -13140,10 +13152,10 @@ function buildModelNegotiationDiagnostics$1(input) {
|
|
|
13140
13152
|
}
|
|
13141
13153
|
function resolveNonInteractiveAuthMethod(initializeResult) {
|
|
13142
13154
|
const authMethodIds = (Array.isArray(initializeResult.authMethods) ? initializeResult.authMethods : []).flatMap((method) => {
|
|
13143
|
-
const methodId = normalizeOptionalText$
|
|
13155
|
+
const methodId = normalizeOptionalText$54(toRecord$7(method)?.id);
|
|
13144
13156
|
return methodId ? [methodId] : [];
|
|
13145
13157
|
});
|
|
13146
|
-
const preferred = normalizeOptionalText$
|
|
13158
|
+
const preferred = normalizeOptionalText$54(toRecord$7(initializeResult._meta)?.defaultAuthMethodId);
|
|
13147
13159
|
if (preferred && (/* @__PURE__ */ new Set(["cached_token", "xai.api_key"])).has(preferred) && authMethodIds.includes(preferred)) return preferred;
|
|
13148
13160
|
if (authMethodIds.includes("cached_token")) return "cached_token";
|
|
13149
13161
|
if (authMethodIds.includes("xai.api_key")) return "xai.api_key";
|
|
@@ -13188,7 +13200,7 @@ async function resolveCanonicalDirectory(value) {
|
|
|
13188
13200
|
}
|
|
13189
13201
|
}
|
|
13190
13202
|
function assertSuccessfulStopReason$1(value) {
|
|
13191
|
-
const stopReason = normalizeOptionalText$
|
|
13203
|
+
const stopReason = normalizeOptionalText$54(toRecord$7(value)?.stopReason);
|
|
13192
13204
|
if (!stopReason) throw new GrokBuildAcpTransportError({
|
|
13193
13205
|
code: "protocol.invalid",
|
|
13194
13206
|
errorType: "adapter",
|
|
@@ -13206,7 +13218,7 @@ async function emitFinalPreviewIfRequested$1(input) {
|
|
|
13206
13218
|
await input.onPreview({ text: input.output });
|
|
13207
13219
|
}
|
|
13208
13220
|
function toGrokBuildTransportError(error, stderr, diagnostics) {
|
|
13209
|
-
const combined = [toErrorMessage$35(error), normalizeOptionalText$
|
|
13221
|
+
const combined = [toErrorMessage$35(error), normalizeOptionalText$54(stderr)].filter((value) => value !== null).join("\n");
|
|
13210
13222
|
const providerFailure = !(error instanceof GrokBuildAcpTransportError) || error.code.startsWith("protocol.") ? classifyGrokBuildProviderFailure({
|
|
13211
13223
|
message: combined,
|
|
13212
13224
|
originalError: error instanceof GrokBuildAcpTransportError ? error.originalError : void 0
|
|
@@ -13230,7 +13242,7 @@ function toGrokBuildTransportError(error, stderr, diagnostics) {
|
|
|
13230
13242
|
const classified = new GrokBuildAcpTransportError({
|
|
13231
13243
|
code: "upstream_unreachable",
|
|
13232
13244
|
errorType: "adapter",
|
|
13233
|
-
message: `upstream_unreachable: ${normalizeOptionalText$
|
|
13245
|
+
message: `upstream_unreachable: ${normalizeOptionalText$54(combined) ?? "Grok Build ACP error"}`
|
|
13234
13246
|
});
|
|
13235
13247
|
return diagnostics ? new GrokBuildAcpTransportError({
|
|
13236
13248
|
cause: error,
|
|
@@ -13248,7 +13260,7 @@ function toGrokBuildJsonRpcTransportError(error) {
|
|
|
13248
13260
|
code = "protocol.invalid_params";
|
|
13249
13261
|
errorType = "config";
|
|
13250
13262
|
}
|
|
13251
|
-
const message = normalizeOptionalText$
|
|
13263
|
+
const message = normalizeOptionalText$54(error.message) ?? "ACP request failed";
|
|
13252
13264
|
const originalError = createProviderOriginalError(message);
|
|
13253
13265
|
return new GrokBuildAcpTransportError({
|
|
13254
13266
|
code,
|
|
@@ -13258,7 +13270,7 @@ function toGrokBuildJsonRpcTransportError(error) {
|
|
|
13258
13270
|
});
|
|
13259
13271
|
}
|
|
13260
13272
|
function classifyGrokBuildProviderFailure(input) {
|
|
13261
|
-
const normalized = normalizeOptionalText$
|
|
13273
|
+
const normalized = normalizeOptionalText$54(input.message) ?? "Grok Build ACP error";
|
|
13262
13274
|
if (AUTH_FAILURE_RE.test(normalized)) return new GrokBuildAcpTransportError({
|
|
13263
13275
|
code: "auth.failed",
|
|
13264
13276
|
errorType: "auth",
|
|
@@ -13283,12 +13295,12 @@ function haveSameStrings(left, right) {
|
|
|
13283
13295
|
return left.length === right.length && left.every((value) => right.includes(value));
|
|
13284
13296
|
}
|
|
13285
13297
|
function uniqueStrings(values) {
|
|
13286
|
-
return [...new Set(values.map(normalizeOptionalText$
|
|
13298
|
+
return [...new Set(values.map(normalizeOptionalText$54).filter((value) => value !== null))];
|
|
13287
13299
|
}
|
|
13288
13300
|
function normalizeOutputText$2(value) {
|
|
13289
13301
|
return typeof value === "string" && value.length > 0 ? value : null;
|
|
13290
13302
|
}
|
|
13291
|
-
function normalizeOptionalText$
|
|
13303
|
+
function normalizeOptionalText$54(value) {
|
|
13292
13304
|
const normalized = typeof value === "string" ? value.trim() : "";
|
|
13293
13305
|
return normalized.length > 0 ? normalized : null;
|
|
13294
13306
|
}
|
|
@@ -13359,7 +13371,7 @@ function createDefaultGrokBuildInvoke(input) {
|
|
|
13359
13371
|
});
|
|
13360
13372
|
} : void 0;
|
|
13361
13373
|
const result = await invokeWithSingleContextHeal({
|
|
13362
|
-
contextId: normalizeOptionalText$
|
|
13374
|
+
contextId: normalizeOptionalText$53(dispatchInput.agentControllerConversationId),
|
|
13363
13375
|
contextLossPolicy: dispatchInput.executionMode === "repair" ? "fail" : "rebuild",
|
|
13364
13376
|
createRebuildFailedError: (error) => new GrokBuildAcpTransportError({
|
|
13365
13377
|
cause: error,
|
|
@@ -13413,7 +13425,7 @@ function createDefaultGrokBuildInvoke(input) {
|
|
|
13413
13425
|
};
|
|
13414
13426
|
}
|
|
13415
13427
|
async function resolveGrokBuildDispatchLaunchContract(input) {
|
|
13416
|
-
const commandPath = normalizeOptionalText$
|
|
13428
|
+
const commandPath = normalizeOptionalText$53(input.grokBuildBin);
|
|
13417
13429
|
const launchContract = input.inputLaunchContract ?? input.optionLaunchContract ?? (commandPath ? buildExecutableLaunchContract({ commandPath }) : null);
|
|
13418
13430
|
if (!launchContract) throw Object.assign(/* @__PURE__ */ new Error("Grok Build launch contract is required for runtime dispatch."), {
|
|
13419
13431
|
code: "controller.launch.needs_repair",
|
|
@@ -13472,7 +13484,7 @@ async function interruptActiveGrokBuildTurn(input) {
|
|
|
13472
13484
|
taskId: result.taskId
|
|
13473
13485
|
};
|
|
13474
13486
|
}
|
|
13475
|
-
function normalizeOptionalText$
|
|
13487
|
+
function normalizeOptionalText$53(value) {
|
|
13476
13488
|
const normalized = typeof value === "string" ? value.trim() : "";
|
|
13477
13489
|
return normalized.length > 0 ? normalized : null;
|
|
13478
13490
|
}
|
|
@@ -13486,7 +13498,7 @@ async function resolveInstalledOpenCodeLaunchCandidates(input) {
|
|
|
13486
13498
|
const installedCandidates = await resolveInstalledNodeScriptLaunchCandidates({
|
|
13487
13499
|
additionalCommandDirectories: resolveOpenCodeCommandDirectories(),
|
|
13488
13500
|
commandName: DEFAULT_OPENCODE_COMMAND,
|
|
13489
|
-
configuredCommand: normalizeOptionalText$
|
|
13501
|
+
configuredCommand: normalizeOptionalText$52(process.env.OPENMELD_DAEMON_RUNTIME_OPENCODE_BIN),
|
|
13490
13502
|
displayName: "OpenCode",
|
|
13491
13503
|
preferredLaunchContract: input?.preferredLaunchContract
|
|
13492
13504
|
});
|
|
@@ -13518,16 +13530,16 @@ async function verifyOpenCodeLaunchContract(input) {
|
|
|
13518
13530
|
});
|
|
13519
13531
|
}
|
|
13520
13532
|
function resolveOpenCodeTimeoutMs() {
|
|
13521
|
-
const raw = normalizeOptionalText$
|
|
13533
|
+
const raw = normalizeOptionalText$52(process.env.OPENMELD_DAEMON_RUNTIME_REQUEST_TIMEOUT_MS);
|
|
13522
13534
|
if (!raw) return null;
|
|
13523
13535
|
const parsed = Number.parseInt(raw, 10);
|
|
13524
13536
|
if (!Number.isFinite(parsed) || parsed <= 0) return null;
|
|
13525
13537
|
return parsed;
|
|
13526
13538
|
}
|
|
13527
13539
|
function resolveOpenCodeCommandDirectories() {
|
|
13528
|
-
return [join(normalizeOptionalText$
|
|
13540
|
+
return [join(normalizeOptionalText$52(process.env.HOME) ?? homedir(), ".opencode", "bin")];
|
|
13529
13541
|
}
|
|
13530
|
-
function normalizeOptionalText$
|
|
13542
|
+
function normalizeOptionalText$52(value) {
|
|
13531
13543
|
const normalized = String(value ?? "").trim();
|
|
13532
13544
|
return normalized.length > 0 ? normalized : null;
|
|
13533
13545
|
}
|
|
@@ -13653,7 +13665,7 @@ function parseOpenCodeOutputDocument(text) {
|
|
|
13653
13665
|
return {
|
|
13654
13666
|
errorMessage,
|
|
13655
13667
|
isErrorResult,
|
|
13656
|
-
outputText: normalizeOptionalText$
|
|
13668
|
+
outputText: normalizeOptionalText$51(outputText),
|
|
13657
13669
|
sessionId
|
|
13658
13670
|
};
|
|
13659
13671
|
}
|
|
@@ -13675,7 +13687,7 @@ function resolveIsErrorResult$1(record) {
|
|
|
13675
13687
|
if (typeof record.isError === "boolean") return record.isError;
|
|
13676
13688
|
if (typeof record.ok === "boolean") return !record.ok;
|
|
13677
13689
|
if (typeof record.success === "boolean") return !record.success;
|
|
13678
|
-
const status = normalizeOptionalText$
|
|
13690
|
+
const status = normalizeOptionalText$51(record.status)?.toLowerCase();
|
|
13679
13691
|
if (status === "error" || status === "failed" || status === "fail") return true;
|
|
13680
13692
|
if (status === "ok" || status === "success" || status === "completed") return false;
|
|
13681
13693
|
return null;
|
|
@@ -13711,13 +13723,13 @@ function resolveTextByPaths(record, paths) {
|
|
|
13711
13723
|
}
|
|
13712
13724
|
return null;
|
|
13713
13725
|
}
|
|
13714
|
-
function normalizeOptionalText$
|
|
13726
|
+
function normalizeOptionalText$51(value) {
|
|
13715
13727
|
const normalized = String(value ?? "").trim();
|
|
13716
13728
|
return normalized.length > 0 ? normalized : null;
|
|
13717
13729
|
}
|
|
13718
13730
|
function normalizeScalarText(value) {
|
|
13719
13731
|
if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") return null;
|
|
13720
|
-
return normalizeOptionalText$
|
|
13732
|
+
return normalizeOptionalText$51(value);
|
|
13721
13733
|
}
|
|
13722
13734
|
//#endregion
|
|
13723
13735
|
//#region ../../runtime/adapters/opencode/dist/transport/opencode-failure.js
|
|
@@ -13833,7 +13845,7 @@ var OpenCodeCliTransportError = class extends Error {
|
|
|
13833
13845
|
};
|
|
13834
13846
|
const STREAMING_PROVIDER_FAILURE_THRESHOLD = 3;
|
|
13835
13847
|
async function invokeOpenCodeCliTransport(input) {
|
|
13836
|
-
const prompt = normalizeOptionalText$
|
|
13848
|
+
const prompt = normalizeOptionalText$50(input.prompt);
|
|
13837
13849
|
if (!prompt) throw new OpenCodeCliTransportError({
|
|
13838
13850
|
code: "schema.invalid",
|
|
13839
13851
|
errorType: "config",
|
|
@@ -13843,14 +13855,14 @@ async function invokeOpenCodeCliTransport(input) {
|
|
|
13843
13855
|
args: buildOpenCodeArgs({
|
|
13844
13856
|
conversationPolicy: input.conversationPolicy,
|
|
13845
13857
|
prompt,
|
|
13846
|
-
sessionId: normalizeOptionalText$
|
|
13858
|
+
sessionId: normalizeOptionalText$50(input.sessionId),
|
|
13847
13859
|
workdir: input.openCodeWorkdir
|
|
13848
13860
|
}),
|
|
13849
13861
|
launchContract: input.launchContract
|
|
13850
13862
|
});
|
|
13851
13863
|
let latestOutput = "";
|
|
13852
13864
|
let latestResultIsError = false;
|
|
13853
|
-
let resolvedSessionId = normalizeOptionalText$
|
|
13865
|
+
let resolvedSessionId = normalizeOptionalText$50(input.sessionId);
|
|
13854
13866
|
const providerErrorMessages = [];
|
|
13855
13867
|
const invokedAtMs = Date.now();
|
|
13856
13868
|
let firstStdoutAtMs = null;
|
|
@@ -13955,7 +13967,7 @@ async function invokeOpenCodeCliTransport(input) {
|
|
|
13955
13967
|
});
|
|
13956
13968
|
}
|
|
13957
13969
|
}
|
|
13958
|
-
const output = normalizeOptionalText$
|
|
13970
|
+
const output = normalizeOptionalText$50(latestOutput);
|
|
13959
13971
|
if (!output) {
|
|
13960
13972
|
if (providerErrorMessages.length > 0) {
|
|
13961
13973
|
const classifiedFailure = classifyOpenCodeFailure({
|
|
@@ -13979,13 +13991,13 @@ async function invokeOpenCodeCliTransport(input) {
|
|
|
13979
13991
|
}
|
|
13980
13992
|
return {
|
|
13981
13993
|
output,
|
|
13982
|
-
sessionId: normalizeOptionalText$
|
|
13994
|
+
sessionId: normalizeOptionalText$50(resolvedSessionId),
|
|
13983
13995
|
telemetry: buildTransportTelemetry$1({
|
|
13984
13996
|
driverResult,
|
|
13985
13997
|
firstStderrAtMs,
|
|
13986
13998
|
firstStdoutAtMs,
|
|
13987
13999
|
invokedAtMs,
|
|
13988
|
-
resumedContext: normalizeOptionalText$
|
|
14000
|
+
resumedContext: normalizeOptionalText$50(input.sessionId) !== null
|
|
13989
14001
|
})
|
|
13990
14002
|
};
|
|
13991
14003
|
}
|
|
@@ -13999,9 +14011,9 @@ const buildOpenCodeArgs = (input) => {
|
|
|
13999
14011
|
input.workdir
|
|
14000
14012
|
];
|
|
14001
14013
|
if (input.sessionId) args.push("--session", input.sessionId);
|
|
14002
|
-
const model = normalizeOptionalText$
|
|
14014
|
+
const model = normalizeOptionalText$50(input.conversationPolicy?.model);
|
|
14003
14015
|
if (model) args.push("--model", model);
|
|
14004
|
-
const reasoningLevel = normalizeOptionalText$
|
|
14016
|
+
const reasoningLevel = normalizeOptionalText$50(input.conversationPolicy?.reasoningLevel);
|
|
14005
14017
|
if (reasoningLevel) args.push("--variant", reasoningLevel);
|
|
14006
14018
|
args.push(input.prompt);
|
|
14007
14019
|
return args;
|
|
@@ -14068,13 +14080,13 @@ const resolveProviderFailureMessage$1 = (input) => {
|
|
|
14068
14080
|
const candidateMessages = [
|
|
14069
14081
|
...input.providerErrorMessages,
|
|
14070
14082
|
...extractErrorMessagesFromStdout$1(input.stdoutText),
|
|
14071
|
-
...normalizeOptionalText$
|
|
14083
|
+
...normalizeOptionalText$50(input.stderrText) ? [normalizeOptionalText$50(input.stderrText)] : []
|
|
14072
14084
|
].filter((value) => Boolean(value));
|
|
14073
14085
|
for (const candidate of candidateMessages) if (looksLikeRuntimePermissionDenialMessage(candidate) || looksLikeProviderFailure$1(candidate)) return candidate;
|
|
14074
14086
|
return candidateMessages[0] ?? null;
|
|
14075
14087
|
};
|
|
14076
14088
|
const extractErrorMessagesFromStdout$1 = (value) => {
|
|
14077
|
-
const stdoutText = normalizeOptionalText$
|
|
14089
|
+
const stdoutText = normalizeOptionalText$50(value);
|
|
14078
14090
|
if (!stdoutText) return [];
|
|
14079
14091
|
const messages = [];
|
|
14080
14092
|
const lines = stdoutText.split("\n");
|
|
@@ -14085,13 +14097,13 @@ const extractErrorMessagesFromStdout$1 = (value) => {
|
|
|
14085
14097
|
return messages;
|
|
14086
14098
|
};
|
|
14087
14099
|
const collectProviderErrorMessage$1 = (line, output) => {
|
|
14088
|
-
const normalized = normalizeOptionalText$
|
|
14100
|
+
const normalized = normalizeOptionalText$50(line);
|
|
14089
14101
|
if (!normalized) return null;
|
|
14090
14102
|
output.push(normalized);
|
|
14091
14103
|
return normalized;
|
|
14092
14104
|
};
|
|
14093
14105
|
const collectRuntimePermissionDenialMessage$1 = (line, output) => {
|
|
14094
|
-
const normalized = normalizeOptionalText$
|
|
14106
|
+
const normalized = normalizeOptionalText$50(line);
|
|
14095
14107
|
if (!(normalized && looksLikeRuntimePermissionDenialMessage(normalized))) return;
|
|
14096
14108
|
output.push(normalized);
|
|
14097
14109
|
};
|
|
@@ -14103,7 +14115,7 @@ const looksLikeStreamingProviderFailure = (value) => {
|
|
|
14103
14115
|
const lowered = value.toLowerCase();
|
|
14104
14116
|
return lowered.includes("ai_apicallerror") || lowered.includes("bad gateway") || lowered.includes("gateway timeout") || lowered.includes("econnreset") || lowered.includes("etimedout") || lowered.includes("socket hang up");
|
|
14105
14117
|
};
|
|
14106
|
-
function normalizeOptionalText$
|
|
14118
|
+
function normalizeOptionalText$50(value) {
|
|
14107
14119
|
const normalized = String(value ?? "").trim();
|
|
14108
14120
|
return normalized.length > 0 ? normalized : null;
|
|
14109
14121
|
}
|
|
@@ -14311,7 +14323,7 @@ var OpenCodeServerTransportError = class extends Error {
|
|
|
14311
14323
|
}
|
|
14312
14324
|
};
|
|
14313
14325
|
async function invokeOpenCodeServerTransport(input) {
|
|
14314
|
-
const prompt = normalizeOptionalText$
|
|
14326
|
+
const prompt = normalizeOptionalText$49(input.prompt);
|
|
14315
14327
|
if (!prompt) throw new OpenCodeServerTransportError({
|
|
14316
14328
|
code: "schema.invalid",
|
|
14317
14329
|
errorType: "config",
|
|
@@ -14329,14 +14341,14 @@ async function invokeOpenCodeServerTransport(input) {
|
|
|
14329
14341
|
responseStyle: "data",
|
|
14330
14342
|
throwOnError: true
|
|
14331
14343
|
});
|
|
14332
|
-
const canonicalRepairSessionId = input.executionMode === "repair" ? normalizeOptionalText$
|
|
14344
|
+
const canonicalRepairSessionId = input.executionMode === "repair" ? normalizeOptionalText$49(input.sessionId) : null;
|
|
14333
14345
|
let result;
|
|
14334
14346
|
try {
|
|
14335
14347
|
const executionSessionId = canonicalRepairSessionId ? await forkOpenCodeSessionWithClient({
|
|
14336
14348
|
client,
|
|
14337
14349
|
openCodeWorkdir: input.openCodeWorkdir,
|
|
14338
14350
|
sourceSessionId: canonicalRepairSessionId
|
|
14339
|
-
}) : normalizeOptionalText$
|
|
14351
|
+
}) : normalizeOptionalText$49(input.sessionId);
|
|
14340
14352
|
result = await runOpenCodeServerTurn({
|
|
14341
14353
|
client,
|
|
14342
14354
|
conversationPolicy: input.conversationPolicy,
|
|
@@ -14366,13 +14378,13 @@ async function invokeOpenCodeServerTransport(input) {
|
|
|
14366
14378
|
telemetry: server.buildTelemetry({
|
|
14367
14379
|
invokedAtMs,
|
|
14368
14380
|
previewEmitted: result.previewEmitted,
|
|
14369
|
-
resumedContext: normalizeOptionalText$
|
|
14381
|
+
resumedContext: normalizeOptionalText$49(input.sessionId) !== null,
|
|
14370
14382
|
streamingMode: input.streamingMode ?? "final"
|
|
14371
14383
|
})
|
|
14372
14384
|
};
|
|
14373
14385
|
}
|
|
14374
14386
|
async function forkOpenCodeServerSession(input) {
|
|
14375
|
-
const sourceSessionId = normalizeOptionalText$
|
|
14387
|
+
const sourceSessionId = normalizeOptionalText$49(input.sourceSessionId);
|
|
14376
14388
|
if (!sourceSessionId) throw new OpenCodeServerTransportError({
|
|
14377
14389
|
code: "schema.invalid",
|
|
14378
14390
|
errorType: "config",
|
|
@@ -14395,7 +14407,7 @@ async function forkOpenCodeServerSession(input) {
|
|
|
14395
14407
|
openCodeWorkdir: input.openCodeWorkdir,
|
|
14396
14408
|
sourceSessionId
|
|
14397
14409
|
});
|
|
14398
|
-
const title = normalizeOptionalText$
|
|
14410
|
+
const title = normalizeOptionalText$49(input.title);
|
|
14399
14411
|
if (title) try {
|
|
14400
14412
|
await client.session.update({
|
|
14401
14413
|
directory: input.openCodeWorkdir,
|
|
@@ -14544,7 +14556,7 @@ function readRemainingTimeoutMs(deadlineMs) {
|
|
|
14544
14556
|
}
|
|
14545
14557
|
async function runOpenCodeServerTurn(input) {
|
|
14546
14558
|
const sessionId = await resolveOpenCodeSessionId(input);
|
|
14547
|
-
input.server.emitProviderConversationObserved(normalizeOptionalText$
|
|
14559
|
+
input.server.emitProviderConversationObserved(normalizeOptionalText$49(input.observedSessionId) ?? sessionId);
|
|
14548
14560
|
const interactionHandler = new OpenCodeInteractionHandler({
|
|
14549
14561
|
client: input.client,
|
|
14550
14562
|
directory: input.openCodeWorkdir,
|
|
@@ -14603,7 +14615,7 @@ async function runOpenCodeServerTurn(input) {
|
|
|
14603
14615
|
}],
|
|
14604
14616
|
sessionID: sessionId,
|
|
14605
14617
|
...input.instructionPrompt ? { system: input.instructionPrompt.developerInstructions } : {},
|
|
14606
|
-
...normalizeOptionalText$
|
|
14618
|
+
...normalizeOptionalText$49(input.conversationPolicy?.reasoningLevel) ? { variant: normalizeOptionalText$49(input.conversationPolicy?.reasoningLevel) } : {}
|
|
14607
14619
|
}, {
|
|
14608
14620
|
responseStyle: "data",
|
|
14609
14621
|
throwOnError: true
|
|
@@ -14732,27 +14744,27 @@ function detachOpenCodeEventTask(task, eventFailure) {
|
|
|
14732
14744
|
task.catch(eventFailure.reject);
|
|
14733
14745
|
}
|
|
14734
14746
|
function eventBelongsToTurn(properties, turnState) {
|
|
14735
|
-
const eventSessionId = normalizeOptionalText$
|
|
14747
|
+
const eventSessionId = normalizeOptionalText$49(properties.sessionID) ?? normalizeOptionalText$49(toRecord$6(properties.part)?.sessionID);
|
|
14736
14748
|
return eventSessionId === null || turnState.acceptedSessionIds.has(eventSessionId);
|
|
14737
14749
|
}
|
|
14738
14750
|
function observeOpenCodeSessionTree(turnState, eventType, properties) {
|
|
14739
14751
|
if (eventType !== "session.created" && eventType !== "session.updated") return;
|
|
14740
14752
|
const session = toRecord$6(properties.info);
|
|
14741
|
-
const sessionId = normalizeOptionalText$
|
|
14742
|
-
const parentId = normalizeOptionalText$
|
|
14753
|
+
const sessionId = normalizeOptionalText$49(properties.sessionID) ?? normalizeOptionalText$49(session?.id);
|
|
14754
|
+
const parentId = normalizeOptionalText$49(session?.parentID);
|
|
14743
14755
|
if (sessionId && parentId && turnState.acceptedSessionIds.has(parentId)) turnState.acceptedSessionIds.add(sessionId);
|
|
14744
14756
|
}
|
|
14745
14757
|
function observeOpenCodeTurnLifecycle(turnState, eventType, properties) {
|
|
14746
14758
|
if (eventType === "message.updated") {
|
|
14747
14759
|
const message = toRecord$6(properties.info);
|
|
14748
|
-
const messageId = normalizeOptionalText$
|
|
14749
|
-
const messageSessionId = normalizeOptionalText$
|
|
14760
|
+
const messageId = normalizeOptionalText$49(message?.id);
|
|
14761
|
+
const messageSessionId = normalizeOptionalText$49(message?.sessionID) ?? normalizeOptionalText$49(properties.sessionID);
|
|
14750
14762
|
if (turnState.promptDispatchStarted && turnState.promptMessageId === null && message?.role === "user" && messageSessionId === turnState.rootSessionId && messageId) turnState.promptMessageId = messageId;
|
|
14751
14763
|
if (messageId === turnState.promptMessageId) turnState.promptMessageObserved = true;
|
|
14752
|
-
if (message?.role === "assistant" && normalizeOptionalText$
|
|
14764
|
+
if (message?.role === "assistant" && normalizeOptionalText$49(message.parentID) === turnState.promptMessageId && messageId) turnState.assistantMessageIds.add(messageId);
|
|
14753
14765
|
return;
|
|
14754
14766
|
}
|
|
14755
|
-
const isRootSession = normalizeOptionalText$
|
|
14767
|
+
const isRootSession = normalizeOptionalText$49(properties.sessionID) === turnState.rootSessionId;
|
|
14756
14768
|
const status = toRecord$6(properties.status);
|
|
14757
14769
|
const isIdle = eventType === "session.idle" || eventType === "session.status" && status?.type === "idle";
|
|
14758
14770
|
if (isRootSession && isIdle && turnState.promptMessageObserved && turnState.assistantMessageIds.size > 0) {
|
|
@@ -14771,13 +14783,13 @@ function readOpenCodeTurnEventFailure(turnState, eventType, properties) {
|
|
|
14771
14783
|
if (eventType === "session.error") return readOpenCodeProviderFailure(properties.error) ?? "OpenCode reported a session error.";
|
|
14772
14784
|
if (eventType !== "message.updated") return null;
|
|
14773
14785
|
const message = toRecord$6(properties.info);
|
|
14774
|
-
if (message?.role !== "assistant" || normalizeOptionalText$
|
|
14786
|
+
if (message?.role !== "assistant" || normalizeOptionalText$49(message.parentID) !== turnState.promptMessageId) return null;
|
|
14775
14787
|
return readOpenCodeProviderFailure(message.error);
|
|
14776
14788
|
}
|
|
14777
14789
|
async function updateOpenCodePreview(input) {
|
|
14778
14790
|
const part = toRecord$6(input.part);
|
|
14779
|
-
const partId = normalizeOptionalText$
|
|
14780
|
-
const messageId = normalizeOptionalText$
|
|
14791
|
+
const partId = normalizeOptionalText$49(part?.id);
|
|
14792
|
+
const messageId = normalizeOptionalText$49(part?.messageID);
|
|
14781
14793
|
const text = part?.type === "text" && part?.ignored !== true ? normalizeOutputText$1(part.text) : null;
|
|
14782
14794
|
if (!(partId && messageId && input.assistantMessageIds.has(messageId) && text)) return;
|
|
14783
14795
|
input.textByPartId.set(partId, text);
|
|
@@ -14794,7 +14806,7 @@ async function readOpenCodeTurnOutput(input) {
|
|
|
14794
14806
|
}));
|
|
14795
14807
|
const reply = toRecord$6((Array.isArray(messages) ? messages.filter((value) => {
|
|
14796
14808
|
const info = toRecord$6(toRecord$6(value)?.info);
|
|
14797
|
-
return info?.role === "assistant" && normalizeOptionalText$
|
|
14809
|
+
return info?.role === "assistant" && normalizeOptionalText$49(info.parentID) === input.promptMessageId;
|
|
14798
14810
|
}) : []).at(-1));
|
|
14799
14811
|
const providerFailure = readOpenCodeProviderFailure(toRecord$6(reply?.info)?.error);
|
|
14800
14812
|
if (providerFailure) throw new Error(providerFailure);
|
|
@@ -14806,7 +14818,7 @@ async function readOpenCodeTurnOutput(input) {
|
|
|
14806
14818
|
function unwrapOpenCodeEvent(value) {
|
|
14807
14819
|
const record = toRecord$6(value);
|
|
14808
14820
|
const payload = toRecord$6(record?.payload) ?? record;
|
|
14809
|
-
const type = normalizeOptionalText$
|
|
14821
|
+
const type = normalizeOptionalText$49(payload?.type);
|
|
14810
14822
|
if (!type) return null;
|
|
14811
14823
|
return {
|
|
14812
14824
|
properties: payload?.properties ?? payload?.data,
|
|
@@ -14814,9 +14826,9 @@ function unwrapOpenCodeEvent(value) {
|
|
|
14814
14826
|
};
|
|
14815
14827
|
}
|
|
14816
14828
|
function readPermissionRequest(properties) {
|
|
14817
|
-
const id = normalizeOptionalText$
|
|
14818
|
-
const sessionID = normalizeOptionalText$
|
|
14819
|
-
const permission = normalizeOptionalText$
|
|
14829
|
+
const id = normalizeOptionalText$49(properties.id);
|
|
14830
|
+
const sessionID = normalizeOptionalText$49(properties.sessionID);
|
|
14831
|
+
const permission = normalizeOptionalText$49(properties.permission) ?? normalizeOptionalText$49(properties.action);
|
|
14820
14832
|
if (!(id && sessionID && permission)) return null;
|
|
14821
14833
|
return {
|
|
14822
14834
|
always: readStringArray(properties.always ?? properties.save),
|
|
@@ -14826,27 +14838,27 @@ function readPermissionRequest(properties) {
|
|
|
14826
14838
|
permission,
|
|
14827
14839
|
sessionID,
|
|
14828
14840
|
...toRecord$6(properties.tool) ? { tool: {
|
|
14829
|
-
callID: normalizeOptionalText$
|
|
14830
|
-
messageID: normalizeOptionalText$
|
|
14841
|
+
callID: normalizeOptionalText$49(toRecord$6(properties.tool)?.callID) ?? "",
|
|
14842
|
+
messageID: normalizeOptionalText$49(toRecord$6(properties.tool)?.messageID) ?? ""
|
|
14831
14843
|
} } : {}
|
|
14832
14844
|
};
|
|
14833
14845
|
}
|
|
14834
14846
|
function readQuestionRequest(properties) {
|
|
14835
|
-
const id = normalizeOptionalText$
|
|
14836
|
-
const sessionID = normalizeOptionalText$
|
|
14847
|
+
const id = normalizeOptionalText$49(properties.id);
|
|
14848
|
+
const sessionID = normalizeOptionalText$49(properties.sessionID);
|
|
14837
14849
|
const questions = Array.isArray(properties.questions) ? properties.questions.flatMap((value) => {
|
|
14838
14850
|
const question = toRecord$6(value);
|
|
14839
|
-
const prompt = normalizeOptionalText$
|
|
14851
|
+
const prompt = normalizeOptionalText$49(question?.question ?? question?.prompt);
|
|
14840
14852
|
if (!prompt) return [];
|
|
14841
14853
|
return [{
|
|
14842
14854
|
custom: question?.custom === true,
|
|
14843
|
-
header: normalizeOptionalText$
|
|
14855
|
+
header: normalizeOptionalText$49(question?.header) ?? "Question",
|
|
14844
14856
|
multiple: question?.multiple === true,
|
|
14845
14857
|
options: (Array.isArray(question?.options) ? question.options : []).flatMap((optionValue) => {
|
|
14846
14858
|
const option = toRecord$6(optionValue);
|
|
14847
|
-
const label = normalizeOptionalText$
|
|
14859
|
+
const label = normalizeOptionalText$49(option?.label);
|
|
14848
14860
|
return label ? [{
|
|
14849
|
-
description: normalizeOptionalText$
|
|
14861
|
+
description: normalizeOptionalText$49(option?.description) ?? "",
|
|
14850
14862
|
label
|
|
14851
14863
|
}] : [];
|
|
14852
14864
|
}),
|
|
@@ -15181,7 +15193,7 @@ async function reserveLocalPort() {
|
|
|
15181
15193
|
return port;
|
|
15182
15194
|
}
|
|
15183
15195
|
function parseOpenCodeModel(value) {
|
|
15184
|
-
const normalized = normalizeOptionalText$
|
|
15196
|
+
const normalized = normalizeOptionalText$49(value);
|
|
15185
15197
|
if (!normalized) return null;
|
|
15186
15198
|
const separator = normalized.indexOf("/");
|
|
15187
15199
|
if (separator <= 0 || separator === normalized.length - 1) throw new OpenCodeServerTransportError({
|
|
@@ -15197,7 +15209,7 @@ function parseOpenCodeModel(value) {
|
|
|
15197
15209
|
function parseOpenCodeSessionModel(policy) {
|
|
15198
15210
|
const model = parseOpenCodeModel(policy?.model);
|
|
15199
15211
|
if (!model) return null;
|
|
15200
|
-
const variant = normalizeOptionalText$
|
|
15212
|
+
const variant = normalizeOptionalText$49(policy?.reasoningLevel);
|
|
15201
15213
|
return {
|
|
15202
15214
|
id: model.modelID,
|
|
15203
15215
|
providerID: model.providerID,
|
|
@@ -15206,10 +15218,10 @@ function parseOpenCodeSessionModel(policy) {
|
|
|
15206
15218
|
}
|
|
15207
15219
|
function readOpenCodeProviderFailure(value) {
|
|
15208
15220
|
const error = toRecord$6(value);
|
|
15209
|
-
return normalizeOptionalText$
|
|
15221
|
+
return normalizeOptionalText$49(toRecord$6(error?.data)?.message) ?? normalizeOptionalText$49(error?.message) ?? normalizeOptionalText$49(value);
|
|
15210
15222
|
}
|
|
15211
15223
|
function readOpenCodeSessionId(value) {
|
|
15212
|
-
const sessionId = normalizeOptionalText$
|
|
15224
|
+
const sessionId = normalizeOptionalText$49(toRecord$6(unwrapSdkData(value))?.id);
|
|
15213
15225
|
if (!sessionId) throw new OpenCodeServerTransportError({
|
|
15214
15226
|
code: "protocol.invalid",
|
|
15215
15227
|
errorType: "adapter",
|
|
@@ -15225,7 +15237,7 @@ function toOpenCodeServerTransportError(error, stderr) {
|
|
|
15225
15237
|
if (error instanceof OpenCodeServerTransportError) return error;
|
|
15226
15238
|
return new OpenCodeServerTransportError(classifyOpenCodeFailureMessage({
|
|
15227
15239
|
isContextLost: isLikelyOpenCodeContextLostError,
|
|
15228
|
-
message: [error instanceof Error ? error.message : String(error), normalizeOptionalText$
|
|
15240
|
+
message: [error instanceof Error ? error.message : String(error), normalizeOptionalText$49(stderr)].filter((value) => Boolean(value)).join("\n")
|
|
15229
15241
|
}));
|
|
15230
15242
|
}
|
|
15231
15243
|
function timeoutAfter(delayMs, message) {
|
|
@@ -15240,12 +15252,12 @@ function timeoutAfter(delayMs, message) {
|
|
|
15240
15252
|
});
|
|
15241
15253
|
}
|
|
15242
15254
|
function readStringArray(value) {
|
|
15243
|
-
return Array.isArray(value) ? value.map(normalizeOptionalText$
|
|
15255
|
+
return Array.isArray(value) ? value.map(normalizeOptionalText$49).filter((entry) => entry !== null) : [];
|
|
15244
15256
|
}
|
|
15245
15257
|
function normalizeOutputText$1(value) {
|
|
15246
15258
|
return typeof value === "string" && value.length > 0 ? value : null;
|
|
15247
15259
|
}
|
|
15248
|
-
function normalizeOptionalText$
|
|
15260
|
+
function normalizeOptionalText$49(value) {
|
|
15249
15261
|
const normalized = typeof value === "string" ? value.trim() : "";
|
|
15250
15262
|
return normalized.length > 0 ? normalized : null;
|
|
15251
15263
|
}
|
|
@@ -15253,7 +15265,7 @@ function toRecord$6(value) {
|
|
|
15253
15265
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
15254
15266
|
}
|
|
15255
15267
|
function formatStderrSuffix(stderr) {
|
|
15256
|
-
const normalized = normalizeOptionalText$
|
|
15268
|
+
const normalized = normalizeOptionalText$49(stderr);
|
|
15257
15269
|
return normalized ? ` (${normalized})` : "";
|
|
15258
15270
|
}
|
|
15259
15271
|
//#endregion
|
|
@@ -15414,7 +15426,7 @@ const resolveDefaultOpenCodeInvoke = (options) => {
|
|
|
15414
15426
|
...onProcessControlEvent ? { onProcessControlEvent } : {},
|
|
15415
15427
|
...input.onRuntimeEvent ? { onRuntimeEvent: input.onRuntimeEvent } : {},
|
|
15416
15428
|
prompt: input.prompt,
|
|
15417
|
-
sessionId: normalizeOptionalText$
|
|
15429
|
+
sessionId: normalizeOptionalText$48(input.agentControllerConversationId),
|
|
15418
15430
|
streamingMode: input.streamingMode
|
|
15419
15431
|
});
|
|
15420
15432
|
const agentControllerConversation = OPENCODE_CONVERSATION_BRIDGE_SPEC ? bridgeAgentControllerConversationRef({
|
|
@@ -15472,7 +15484,7 @@ function buildOpenCodeEnv(input) {
|
|
|
15472
15484
|
};
|
|
15473
15485
|
}
|
|
15474
15486
|
function parseOpenCodeConfigContent(value) {
|
|
15475
|
-
const normalized = normalizeOptionalText$
|
|
15487
|
+
const normalized = normalizeOptionalText$48(value);
|
|
15476
15488
|
if (!normalized) return {};
|
|
15477
15489
|
let parsed;
|
|
15478
15490
|
try {
|
|
@@ -15508,7 +15520,7 @@ const resolveRuntimeProcessRegistrar$1 = (input) => {
|
|
|
15508
15520
|
});
|
|
15509
15521
|
};
|
|
15510
15522
|
};
|
|
15511
|
-
function normalizeOptionalText$
|
|
15523
|
+
function normalizeOptionalText$48(value) {
|
|
15512
15524
|
const normalized = String(value ?? "").trim();
|
|
15513
15525
|
return normalized.length > 0 ? normalized : null;
|
|
15514
15526
|
}
|
|
@@ -18466,7 +18478,7 @@ function resolveOpenMeldAccountContext(input) {
|
|
|
18466
18478
|
};
|
|
18467
18479
|
}
|
|
18468
18480
|
async function resolveCurrentOpenMeldAccountContext() {
|
|
18469
|
-
const { getAuthSessionMetadata } = await import("./auth-session-
|
|
18481
|
+
const { getAuthSessionMetadata } = await import("./auth-session-hdKG6Oqe.js").then((n) => n.i);
|
|
18470
18482
|
return resolveOpenMeldAccountContext({ session: await getAuthSessionMetadata().catch(() => null) });
|
|
18471
18483
|
}
|
|
18472
18484
|
function resolveHostKey(baseUrl) {
|
|
@@ -19295,7 +19307,7 @@ async function requireOpenMeldProfilesSession() {
|
|
|
19295
19307
|
}
|
|
19296
19308
|
function resolveOpenMeldProfilesApiTimeoutMs(endpoint) {
|
|
19297
19309
|
const url = parseUrlOrNull$1(endpoint);
|
|
19298
|
-
if (url && isLoopbackHostname
|
|
19310
|
+
if (url && isLoopbackHostname(url.hostname)) return LOOPBACK_OPENMELD_PROFILES_API_TIMEOUT_MS;
|
|
19299
19311
|
return DEFAULT_OPENMELD_PROFILES_API_TIMEOUT_MS;
|
|
19300
19312
|
}
|
|
19301
19313
|
function parseUrlOrNull$1(value) {
|
|
@@ -19305,9 +19317,6 @@ function parseUrlOrNull$1(value) {
|
|
|
19305
19317
|
return null;
|
|
19306
19318
|
}
|
|
19307
19319
|
}
|
|
19308
|
-
function isLoopbackHostname$2(hostname) {
|
|
19309
|
-
return hostname === "localhost" || hostname === "127.0.0.1" || hostname === "::1";
|
|
19310
|
-
}
|
|
19311
19320
|
function isSameStoredAuthSession(a, b) {
|
|
19312
19321
|
return a.authBaseUrl === b.authBaseUrl && a.clientId === b.clientId && a.tokenType === b.tokenType && a.accessToken === b.accessToken && (a.expiresAt ?? null) === (b.expiresAt ?? null);
|
|
19313
19322
|
}
|
|
@@ -19454,11 +19463,11 @@ async function findOpenMeldProfileByNameOrHandle(input) {
|
|
|
19454
19463
|
}
|
|
19455
19464
|
function isLoopbackProfileEndpoint(endpoint) {
|
|
19456
19465
|
const url = parseUrlOrNull$1(endpoint);
|
|
19457
|
-
return Boolean(url && isLoopbackHostname
|
|
19466
|
+
return Boolean(url && isLoopbackHostname(url.hostname) && url.pathname.startsWith("/v1/profiles"));
|
|
19458
19467
|
}
|
|
19459
19468
|
function isHostedProfilesEndpoint(endpoint) {
|
|
19460
19469
|
const url = parseUrlOrNull$1(endpoint);
|
|
19461
|
-
return Boolean(url && !isLoopbackHostname
|
|
19470
|
+
return Boolean(url && !isLoopbackHostname(url.hostname) && url.pathname.startsWith("/v1/profiles"));
|
|
19462
19471
|
}
|
|
19463
19472
|
function isRecord$5(value) {
|
|
19464
19473
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
@@ -19565,7 +19574,11 @@ function isProfileMissingError(error) {
|
|
|
19565
19574
|
//#region src/config/view-profile-key.ts
|
|
19566
19575
|
async function resolveViewProfileKey(inputProfile) {
|
|
19567
19576
|
const explicit = normalizeOptionalString$13(inputProfile);
|
|
19568
|
-
if (explicit)
|
|
19577
|
+
if (explicit) {
|
|
19578
|
+
const profileId = openMeldProfileIdSchema.safeParse(explicit);
|
|
19579
|
+
if (profileId.success) return profileId.data;
|
|
19580
|
+
return (await resolveOpenMeldProfileByIdOrName({ profileIdentifier: explicit }).catch(() => null))?.openMeldProfileId ?? explicit;
|
|
19581
|
+
}
|
|
19569
19582
|
const selected = await getSelectedOpenMeldProfileId();
|
|
19570
19583
|
if (selected) return selected;
|
|
19571
19584
|
return null;
|
|
@@ -19674,7 +19687,7 @@ const HUMAN_MESSAGES = {
|
|
|
19674
19687
|
"connect.closing": (params) => `Closing the connection (${String(params?.why ?? "")})...`,
|
|
19675
19688
|
"connect.watch_ready": () => "Watching the stream. Press Ctrl+C to quit.",
|
|
19676
19689
|
"connect.connected_no_stdio": (params) => formatConnectedNoStdioMessage("human", params),
|
|
19677
|
-
"connect.chat_mention_hint": () => "Press @ to insert
|
|
19690
|
+
"connect.chat_mention_hint": () => "Press @ to insert an Agent Wake, Agent Reference, or Human Mention.",
|
|
19678
19691
|
"connect.chat_ready": () => "Type your message and press Enter to send.",
|
|
19679
19692
|
"connect.chat_exit_hint": () => "Exit with '/quit', ':q', Ctrl+D, or Ctrl+C.",
|
|
19680
19693
|
"connect.chat_prompt_question": () => "What would you like to say in this space?",
|
|
@@ -19732,7 +19745,7 @@ const AGENT_MESSAGES = {
|
|
|
19732
19745
|
"connect.closing": (params) => `closing connection (${String(params?.why ?? "")})`,
|
|
19733
19746
|
"connect.watch_ready": () => "watch mode active; Ctrl+C to quit",
|
|
19734
19747
|
"connect.connected_no_stdio": (params) => formatConnectedNoStdioMessage("agent", params),
|
|
19735
|
-
"connect.chat_mention_hint": () => "use @Name(wake) or @Name(reference)
|
|
19748
|
+
"connect.chat_mention_hint": () => "use @Name(wake) or @Name(reference) for agents, and @Name(mention) for people",
|
|
19736
19749
|
"connect.chat_ready": () => "chat mode active; type a line to send",
|
|
19737
19750
|
"connect.chat_exit_hint": () => "enter sends; line ending with \\ continues draft; exit with /quit, :q, Ctrl+D, or Ctrl+C",
|
|
19738
19751
|
"connect.chat_prompt_question": () => "what would you like to say?",
|
|
@@ -20007,8 +20020,8 @@ function splitSentences(message) {
|
|
|
20007
20020
|
var package_default = {
|
|
20008
20021
|
$schema: "https://www.schemastore.org/package.json",
|
|
20009
20022
|
name: "openmeld",
|
|
20010
|
-
version: "0.3.
|
|
20011
|
-
openMeldReleaseDate: "2026-
|
|
20023
|
+
version: "0.3.138",
|
|
20024
|
+
openMeldReleaseDate: "2026-09-01",
|
|
20012
20025
|
description: "OpenMeld CLI - https://openmeld.ai",
|
|
20013
20026
|
license: "MIT",
|
|
20014
20027
|
type: "module",
|
|
@@ -20170,7 +20183,7 @@ function parseRuntimeTransportMode(value) {
|
|
|
20170
20183
|
function parseContextIdMappingSpec(value) {
|
|
20171
20184
|
const record = asRecord(value);
|
|
20172
20185
|
if (!record) return null;
|
|
20173
|
-
const sourceField = normalizeOptionalText$
|
|
20186
|
+
const sourceField = normalizeOptionalText$47(record.sourceField);
|
|
20174
20187
|
const mappingVersion = normalizePositiveInteger$1(record.mappingVersion);
|
|
20175
20188
|
if (!(sourceField && mappingVersion)) return null;
|
|
20176
20189
|
return {
|
|
@@ -20196,7 +20209,7 @@ function asRecord(value) {
|
|
|
20196
20209
|
function normalizeText$6(value) {
|
|
20197
20210
|
return String(value ?? "").trim();
|
|
20198
20211
|
}
|
|
20199
|
-
function normalizeOptionalText$
|
|
20212
|
+
function normalizeOptionalText$47(value) {
|
|
20200
20213
|
const normalized = normalizeText$6(value);
|
|
20201
20214
|
return normalized.length > 0 ? normalized : null;
|
|
20202
20215
|
}
|
|
@@ -20255,8 +20268,8 @@ const createRuntimeContractRepairReport = (input) => ({
|
|
|
20255
20268
|
const parseRuntimeContractMeta = (value) => {
|
|
20256
20269
|
if (!isRecord$4(value)) return null;
|
|
20257
20270
|
if (value.schema !== RUNTIME_CONTRACT_META_SCHEMA || value.v !== 1) return null;
|
|
20258
|
-
const contractEpoch = normalizeOptionalText$
|
|
20259
|
-
const updatedAt = normalizeOptionalText$
|
|
20271
|
+
const contractEpoch = normalizeOptionalText$47(value.contractEpoch);
|
|
20272
|
+
const updatedAt = normalizeOptionalText$47(value.updatedAt);
|
|
20260
20273
|
if (!(contractEpoch && updatedAt)) return null;
|
|
20261
20274
|
return {
|
|
20262
20275
|
schema: RUNTIME_CONTRACT_META_SCHEMA,
|
|
@@ -20271,8 +20284,8 @@ const parseRuntimeContractRepairReport = (value) => {
|
|
|
20271
20284
|
const status = value.status;
|
|
20272
20285
|
const reason = value.reason;
|
|
20273
20286
|
const fromEpochRaw = value.fromEpoch;
|
|
20274
|
-
const toEpoch = normalizeOptionalText$
|
|
20275
|
-
const appliedAt = normalizeOptionalText$
|
|
20287
|
+
const toEpoch = normalizeOptionalText$47(value.toEpoch);
|
|
20288
|
+
const appliedAt = normalizeOptionalText$47(value.appliedAt);
|
|
20276
20289
|
const cleanedPathsRaw = value.cleanedPaths;
|
|
20277
20290
|
const backupPathsRaw = value.backupPaths;
|
|
20278
20291
|
const errorMessageRaw = value.errorMessage;
|
|
@@ -20280,11 +20293,11 @@ const parseRuntimeContractRepairReport = (value) => {
|
|
|
20280
20293
|
if (reason !== "legacy_state_without_meta" && reason !== "contract_epoch_mismatch") return null;
|
|
20281
20294
|
if (!(toEpoch && appliedAt)) return null;
|
|
20282
20295
|
if (!(Array.isArray(cleanedPathsRaw) && Array.isArray(backupPathsRaw))) return null;
|
|
20283
|
-
const cleanedPaths = cleanedPathsRaw.map((item) => normalizeOptionalText$
|
|
20284
|
-
const backupPaths = backupPathsRaw.map((item) => normalizeOptionalText$
|
|
20285
|
-
const fromEpoch = fromEpochRaw === null ? null : normalizeOptionalText$
|
|
20296
|
+
const cleanedPaths = cleanedPathsRaw.map((item) => normalizeOptionalText$47(item)).filter((item) => item !== null);
|
|
20297
|
+
const backupPaths = backupPathsRaw.map((item) => normalizeOptionalText$47(item)).filter((item) => item !== null);
|
|
20298
|
+
const fromEpoch = fromEpochRaw === null ? null : normalizeOptionalText$47(fromEpochRaw);
|
|
20286
20299
|
if (fromEpochRaw !== null && fromEpoch === null) return null;
|
|
20287
|
-
const errorMessage = errorMessageRaw === null ? null : normalizeOptionalText$
|
|
20300
|
+
const errorMessage = errorMessageRaw === null ? null : normalizeOptionalText$47(errorMessageRaw);
|
|
20288
20301
|
if (errorMessageRaw !== null && errorMessage === null) return null;
|
|
20289
20302
|
return {
|
|
20290
20303
|
schema: RUNTIME_CONTRACT_REPAIR_REPORT_SCHEMA,
|
|
@@ -20425,8 +20438,8 @@ const backupAndCleanRuntimeState = async (input) => {
|
|
|
20425
20438
|
}
|
|
20426
20439
|
};
|
|
20427
20440
|
const ensureDaemonRuntimeContractState = async (input) => {
|
|
20428
|
-
const contractEpoch = normalizeOptionalText$
|
|
20429
|
-
const nowIso = normalizeOptionalText$
|
|
20441
|
+
const contractEpoch = normalizeOptionalText$47(input.contractEpoch) ?? DAEMON_RUNTIME_CONTRACT_EPOCH;
|
|
20442
|
+
const nowIso = normalizeOptionalText$47(input.nowIso) ?? (/* @__PURE__ */ new Date()).toISOString();
|
|
20430
20443
|
const stateFilePaths = getRuntimeStateFilePaths(input.runtimePaths);
|
|
20431
20444
|
const existingStatePaths = [];
|
|
20432
20445
|
for (const statePath of stateFilePaths) if (await fileExists(statePath)) existingStatePaths.push(statePath);
|
|
@@ -21443,7 +21456,7 @@ async function readDaemonActiveBundleState(pathInput = {}) {
|
|
|
21443
21456
|
sourceEntryScriptPath: parsed.sourceEntryScriptPath,
|
|
21444
21457
|
sourcePackageRootPath: parsed.sourcePackageRootPath,
|
|
21445
21458
|
sourceDistRootPath: parsed.sourceDistRootPath,
|
|
21446
|
-
sourceDistFingerprint: normalizeOptionalText$
|
|
21459
|
+
sourceDistFingerprint: normalizeOptionalText$46(parsed.sourceDistFingerprint),
|
|
21447
21460
|
sourceKind: parsed.sourceKind,
|
|
21448
21461
|
createdAt: parsed.createdAt,
|
|
21449
21462
|
updatedAt: parsed.updatedAt
|
|
@@ -22409,7 +22422,7 @@ function isPackageEntryResolutionError(error) {
|
|
|
22409
22422
|
const code = getErrorCode$3(error);
|
|
22410
22423
|
return code === "MODULE_NOT_FOUND" || code === "ERR_PACKAGE_PATH_NOT_EXPORTED";
|
|
22411
22424
|
}
|
|
22412
|
-
function normalizeOptionalText$
|
|
22425
|
+
function normalizeOptionalText$46(value) {
|
|
22413
22426
|
const normalized = String(value ?? "").trim();
|
|
22414
22427
|
return normalized.length > 0 ? normalized : null;
|
|
22415
22428
|
}
|
|
@@ -25156,20 +25169,20 @@ function resolveOpenMeldEnvironmentTargetFromEnv(input = {}) {
|
|
|
25156
25169
|
};
|
|
25157
25170
|
}
|
|
25158
25171
|
function resolveUserFacingCommandForPreset(input) {
|
|
25159
|
-
const explicitCommand = normalizeOptionalText$
|
|
25172
|
+
const explicitCommand = normalizeOptionalText$45(input.env[OPENMELD_USER_FACING_CLI_COMMAND_ENV$1]);
|
|
25160
25173
|
if (explicitCommand) return explicitCommand;
|
|
25161
25174
|
if (input.preset === "dev-local") return "openmeld-dev";
|
|
25162
25175
|
if (input.preset === "canary") return "openmeld-canary";
|
|
25163
25176
|
return resolveUserFacingCliEntryCommand({ env: input.env });
|
|
25164
25177
|
}
|
|
25165
25178
|
function resolveGatewayUrlFromEnvOnly(input) {
|
|
25166
|
-
const fromInput = normalizeOptionalText$
|
|
25179
|
+
const fromInput = normalizeOptionalText$45(input.gatewayUrl);
|
|
25167
25180
|
if (fromInput) return normalizeGatewayBaseUrl(fromInput);
|
|
25168
|
-
const fromEnv = normalizeOptionalText$
|
|
25181
|
+
const fromEnv = normalizeOptionalText$45(input.env.OPENMELD_GATEWAY_URL);
|
|
25169
25182
|
if (fromEnv) return normalizeGatewayBaseUrl(fromEnv);
|
|
25170
25183
|
return normalizeGatewayBaseUrl(resolveDefaultGatewayBaseUrl({ env: input.env }));
|
|
25171
25184
|
}
|
|
25172
|
-
function normalizeOptionalText$
|
|
25185
|
+
function normalizeOptionalText$45(value) {
|
|
25173
25186
|
const normalized = String(value ?? "").trim();
|
|
25174
25187
|
return normalized.length > 0 ? normalized : null;
|
|
25175
25188
|
}
|
|
@@ -25796,7 +25809,7 @@ async function resolveInstalledCursorLaunchCandidates(input) {
|
|
|
25796
25809
|
const installedCandidates = await resolveInstalledNodeScriptLaunchCandidates({
|
|
25797
25810
|
additionalCommandDirectories: resolveCursorCommandDirectories(),
|
|
25798
25811
|
commandName: DEFAULT_CURSOR_COMMAND,
|
|
25799
|
-
configuredCommand: normalizeOptionalText$
|
|
25812
|
+
configuredCommand: normalizeOptionalText$44(process.env.OPENMELD_DAEMON_RUNTIME_CURSOR_BIN),
|
|
25800
25813
|
displayName: "Cursor CLI",
|
|
25801
25814
|
preferredLaunchContract: input?.preferredLaunchContract
|
|
25802
25815
|
});
|
|
@@ -25819,7 +25832,7 @@ async function resolveInstalledCursorLaunchCandidates(input) {
|
|
|
25819
25832
|
};
|
|
25820
25833
|
}
|
|
25821
25834
|
async function refreshCursorPersistedLaunchContract(input) {
|
|
25822
|
-
const configuredCommand = normalizeOptionalText$
|
|
25835
|
+
const configuredCommand = normalizeOptionalText$44(process.env.OPENMELD_DAEMON_RUNTIME_CURSOR_BIN);
|
|
25823
25836
|
if (configuredCommand) {
|
|
25824
25837
|
const resolution = await resolveInstalledNodeScriptLaunchContract({
|
|
25825
25838
|
commandName: DEFAULT_CURSOR_COMMAND,
|
|
@@ -25833,7 +25846,7 @@ async function refreshCursorPersistedLaunchContract(input) {
|
|
|
25833
25846
|
}
|
|
25834
25847
|
if (input.launchContract.kind !== "node_script") return input.launchContract;
|
|
25835
25848
|
const persistedLaunchContract = input.launchContract;
|
|
25836
|
-
const home = normalizeOptionalText$
|
|
25849
|
+
const home = normalizeOptionalText$44(process.env.HOME) ?? homedir();
|
|
25837
25850
|
const managedVersionsRoot = join(home, ".local", "share", "cursor-agent", "versions");
|
|
25838
25851
|
const canonicalManagedVersionsRoot = await realpath(managedVersionsRoot).catch(() => managedVersionsRoot);
|
|
25839
25852
|
const canonicalPersistedScriptPath = await realpath(persistedLaunchContract.scriptPath).catch(() => persistedLaunchContract.scriptPath);
|
|
@@ -25873,7 +25886,7 @@ async function verifyCursorLaunchContract(input) {
|
|
|
25873
25886
|
});
|
|
25874
25887
|
}
|
|
25875
25888
|
function resolveCursorTimeoutMs() {
|
|
25876
|
-
const raw = normalizeOptionalText$
|
|
25889
|
+
const raw = normalizeOptionalText$44(process.env.OPENMELD_DAEMON_RUNTIME_REQUEST_TIMEOUT_MS);
|
|
25877
25890
|
if (!raw) return null;
|
|
25878
25891
|
const parsed = Number.parseInt(raw, 10);
|
|
25879
25892
|
if (!Number.isFinite(parsed) || parsed <= 0) return null;
|
|
@@ -25886,7 +25899,7 @@ function isIncompleteLaunchContractCheck(verification) {
|
|
|
25886
25899
|
return !verification.ok && verification.failureKind === "incomplete_check";
|
|
25887
25900
|
}
|
|
25888
25901
|
function resolveCursorCommandDirectories() {
|
|
25889
|
-
return resolveCursorCommandPaths(normalizeOptionalText$
|
|
25902
|
+
return resolveCursorCommandPaths(normalizeOptionalText$44(process.env.HOME) ?? homedir()).map(dirname);
|
|
25890
25903
|
}
|
|
25891
25904
|
function resolveCursorCommandPaths(home) {
|
|
25892
25905
|
return [join(home, ".local", "bin", DEFAULT_CURSOR_COMMAND), join(home, ".cursor", "bin", DEFAULT_CURSOR_COMMAND)];
|
|
@@ -25895,7 +25908,7 @@ function isManagedCursorVersionScript(input) {
|
|
|
25895
25908
|
const segments = relative(input.managedVersionsRoot, input.scriptPath).split(PATH_SEGMENT_SPLIT_RE);
|
|
25896
25909
|
return segments.length === 2 && segments[0] !== ".." && segments[0] !== "." && segments[1] === DEFAULT_CURSOR_COMMAND;
|
|
25897
25910
|
}
|
|
25898
|
-
function normalizeOptionalText$
|
|
25911
|
+
function normalizeOptionalText$44(value) {
|
|
25899
25912
|
const normalized = String(value ?? "").trim();
|
|
25900
25913
|
return normalized.length > 0 ? normalized : null;
|
|
25901
25914
|
}
|
|
@@ -26113,13 +26126,13 @@ var CursorAcpTransportError = class extends Error {
|
|
|
26113
26126
|
}
|
|
26114
26127
|
};
|
|
26115
26128
|
async function invokeCursorAcpTransport(input) {
|
|
26116
|
-
const prompt = normalizeOptionalText$
|
|
26129
|
+
const prompt = normalizeOptionalText$43(input.prompt);
|
|
26117
26130
|
if (!prompt) throw new CursorAcpTransportError({
|
|
26118
26131
|
code: "schema.invalid",
|
|
26119
26132
|
errorType: "config",
|
|
26120
26133
|
message: "schema.invalid: prompt is required"
|
|
26121
26134
|
});
|
|
26122
|
-
if (normalizeOptionalText$
|
|
26135
|
+
if (normalizeOptionalText$43(input.conversationPolicy?.reasoningLevel)) throw new CursorAcpTransportError({
|
|
26123
26136
|
code: "model.reasoning_unsupported",
|
|
26124
26137
|
errorType: "config",
|
|
26125
26138
|
message: "model.reasoning_unsupported: Cursor ACP does not expose reasoning strength as an independent session option; choose an exact Cursor ACP model variant instead"
|
|
@@ -26145,12 +26158,12 @@ async function invokeCursorAcpTransport(input) {
|
|
|
26145
26158
|
}
|
|
26146
26159
|
async function runCursorAcpTurn(input) {
|
|
26147
26160
|
await input.session.initialize();
|
|
26148
|
-
const existingSessionId = normalizeOptionalText$
|
|
26161
|
+
const existingSessionId = normalizeOptionalText$43(input.input.sessionId);
|
|
26149
26162
|
const initialDescriptor = await input.session.openSession({ sessionId: existingSessionId });
|
|
26150
26163
|
input.session.emitProviderConversationObserved(initialDescriptor.sessionId);
|
|
26151
26164
|
const modelResolution = await resolveCursorSessionModel({
|
|
26152
26165
|
descriptor: initialDescriptor,
|
|
26153
|
-
model: normalizeOptionalText$
|
|
26166
|
+
model: normalizeOptionalText$43(input.input.conversationPolicy?.model),
|
|
26154
26167
|
session: input.session
|
|
26155
26168
|
});
|
|
26156
26169
|
const { descriptor } = modelResolution;
|
|
@@ -26405,7 +26418,7 @@ var CursorAcpSession = class {
|
|
|
26405
26418
|
return readSessionDescriptor(result, input.sessionId, "load");
|
|
26406
26419
|
}
|
|
26407
26420
|
const result = await this.request("session/new", params);
|
|
26408
|
-
const sessionId = normalizeOptionalText$
|
|
26421
|
+
const sessionId = normalizeOptionalText$43(toRecord$4(result)?.sessionId);
|
|
26409
26422
|
if (!sessionId) throw new CursorAcpTransportError({
|
|
26410
26423
|
code: "protocol.invalid",
|
|
26411
26424
|
errorType: "adapter",
|
|
@@ -26541,8 +26554,8 @@ function readSessionDescriptor(value, sessionId, sessionOperation) {
|
|
|
26541
26554
|
const modelConfig = readConfigOption(record, "model");
|
|
26542
26555
|
const legacyAvailableModelIds = readLegacyAvailableModelIds(models);
|
|
26543
26556
|
const configAvailableModelIds = readConfigAvailableModelIds(modelConfig);
|
|
26544
|
-
const legacyCurrentModelId = normalizeOptionalText$
|
|
26545
|
-
const configCurrentModelId = normalizeOptionalText$
|
|
26557
|
+
const legacyCurrentModelId = normalizeOptionalText$43(models?.currentModelId);
|
|
26558
|
+
const configCurrentModelId = normalizeOptionalText$43(modelConfig?.currentValue);
|
|
26546
26559
|
const modelInventory = resolveModelInventory({
|
|
26547
26560
|
configAvailableModelIds,
|
|
26548
26561
|
configCurrentModelId,
|
|
@@ -26554,7 +26567,7 @@ function readSessionDescriptor(value, sessionId, sessionOperation) {
|
|
|
26554
26567
|
availableModelIds: modelInventory.availableModelIds,
|
|
26555
26568
|
configAvailableModelIds,
|
|
26556
26569
|
configCurrentModelId,
|
|
26557
|
-
currentModeId: normalizeOptionalText$
|
|
26570
|
+
currentModeId: normalizeOptionalText$43(modes?.currentModeId) ?? readCurrentConfigValue(record, "mode"),
|
|
26558
26571
|
currentModelId: modelInventory.currentModelId,
|
|
26559
26572
|
legacyAvailableModelIds,
|
|
26560
26573
|
legacyCurrentModelId,
|
|
@@ -26570,7 +26583,7 @@ function readConfigAvailableModelIds(modelConfig) {
|
|
|
26570
26583
|
return uniqueModelIds((Array.isArray(modelConfig?.options) ? modelConfig.options : []).map((option) => toRecord$4(option)?.value));
|
|
26571
26584
|
}
|
|
26572
26585
|
function uniqueModelIds(values) {
|
|
26573
|
-
return [...new Set(values.map(normalizeOptionalText$
|
|
26586
|
+
return [...new Set(values.map(normalizeOptionalText$43).filter((modelId) => modelId !== null))];
|
|
26574
26587
|
}
|
|
26575
26588
|
function resolveModelInventory(input) {
|
|
26576
26589
|
const currentModelId = input.configCurrentModelId ?? input.legacyCurrentModelId;
|
|
@@ -26642,10 +26655,10 @@ function sanitizeDiagnosticModelId(modelId) {
|
|
|
26642
26655
|
return modelId === null ? null : modelId.slice(0, MAX_MODEL_DIAGNOSTIC_ID_CHARS);
|
|
26643
26656
|
}
|
|
26644
26657
|
function readCurrentConfigValue(record, id) {
|
|
26645
|
-
return normalizeOptionalText$
|
|
26658
|
+
return normalizeOptionalText$43(readConfigOption(record, id)?.currentValue);
|
|
26646
26659
|
}
|
|
26647
26660
|
function readConfigOption(record, id) {
|
|
26648
|
-
return (Array.isArray(record?.configOptions) ? record.configOptions : []).map(toRecord$4).find((option) => (normalizeOptionalText$
|
|
26661
|
+
return (Array.isArray(record?.configOptions) ? record.configOptions : []).map(toRecord$4).find((option) => (normalizeOptionalText$43(option?.configId) ?? normalizeOptionalText$43(option?.id)) === id) ?? null;
|
|
26649
26662
|
}
|
|
26650
26663
|
function resolveCursorAcpMode(value) {
|
|
26651
26664
|
switch (resolveCursorPermissionMode(value)) {
|
|
@@ -26672,7 +26685,7 @@ function buildCursorAcpArgs(permissionMode) {
|
|
|
26672
26685
|
}
|
|
26673
26686
|
}
|
|
26674
26687
|
function assertSuccessfulStopReason(value) {
|
|
26675
|
-
const stopReason = normalizeOptionalText$
|
|
26688
|
+
const stopReason = normalizeOptionalText$43(toRecord$4(value)?.stopReason);
|
|
26676
26689
|
if (!stopReason) throw new CursorAcpTransportError({
|
|
26677
26690
|
code: "protocol.invalid",
|
|
26678
26691
|
errorType: "adapter",
|
|
@@ -26693,7 +26706,7 @@ async function emitFinalPreviewIfRequested(input) {
|
|
|
26693
26706
|
await input.onPreview({ text: input.output });
|
|
26694
26707
|
}
|
|
26695
26708
|
function toJsonRpcTransportError(error) {
|
|
26696
|
-
const message = normalizeOptionalText$
|
|
26709
|
+
const message = normalizeOptionalText$43(error.message) ?? "Cursor ACP error";
|
|
26697
26710
|
const originalError = createProviderOriginalError(message);
|
|
26698
26711
|
if (error.code === -32601) return new CursorAcpTransportError({
|
|
26699
26712
|
code: "protocol.method_not_found",
|
|
@@ -26717,7 +26730,7 @@ function toCursorAcpTransportError(error, stderr, diagnostics) {
|
|
|
26717
26730
|
message: error.message,
|
|
26718
26731
|
...error.originalError ? { originalError: error.originalError } : {}
|
|
26719
26732
|
});
|
|
26720
|
-
const classified = classifyCursorFailure([toErrorMessage$30(error), normalizeOptionalText$
|
|
26733
|
+
const classified = classifyCursorFailure([toErrorMessage$30(error), normalizeOptionalText$43(stderr)].filter((value) => value !== null).join("\n"));
|
|
26721
26734
|
return diagnostics ? new CursorAcpTransportError({
|
|
26722
26735
|
code: classified.code,
|
|
26723
26736
|
diagnostics,
|
|
@@ -26726,7 +26739,7 @@ function toCursorAcpTransportError(error, stderr, diagnostics) {
|
|
|
26726
26739
|
}) : classified;
|
|
26727
26740
|
}
|
|
26728
26741
|
function classifyCursorFailure(message, originalError = null) {
|
|
26729
|
-
const normalized = normalizeOptionalText$
|
|
26742
|
+
const normalized = normalizeOptionalText$43(message) ?? "Cursor ACP error";
|
|
26730
26743
|
const lowered = normalized.toLowerCase();
|
|
26731
26744
|
if (isCursorPlanUpgradeRequired(normalized)) return new CursorAcpTransportError({
|
|
26732
26745
|
code: "cursor.plan_upgrade_required",
|
|
@@ -26762,7 +26775,7 @@ function classifyCursorFailure(message, originalError = null) {
|
|
|
26762
26775
|
function normalizeOutputText(value) {
|
|
26763
26776
|
return typeof value === "string" && value.length > 0 ? value : null;
|
|
26764
26777
|
}
|
|
26765
|
-
function normalizeOptionalText$
|
|
26778
|
+
function normalizeOptionalText$43(value) {
|
|
26766
26779
|
const normalized = typeof value === "string" ? value.trim() : "";
|
|
26767
26780
|
return normalized.length > 0 ? normalized : null;
|
|
26768
26781
|
}
|
|
@@ -26863,7 +26876,7 @@ function createDefaultCursorInvoke(input) {
|
|
|
26863
26876
|
});
|
|
26864
26877
|
} : void 0;
|
|
26865
26878
|
const result = await invokeWithSingleContextHeal({
|
|
26866
|
-
contextId: normalizeOptionalText$
|
|
26879
|
+
contextId: normalizeOptionalText$42(dispatchInput.agentControllerConversationId),
|
|
26867
26880
|
contextLossPolicy: dispatchInput.executionMode === "repair" ? "fail" : "rebuild",
|
|
26868
26881
|
createRebuildFailedError: (error) => error instanceof CursorAcpTransportError && error.code === "cursor.plan_upgrade_required" ? error : new CursorAcpTransportError({
|
|
26869
26882
|
cause: error,
|
|
@@ -26917,7 +26930,7 @@ function createDefaultCursorInvoke(input) {
|
|
|
26917
26930
|
};
|
|
26918
26931
|
}
|
|
26919
26932
|
async function resolveCursorDispatchLaunchContract(input) {
|
|
26920
|
-
const launchContract = input.inputLaunchContract ?? input.optionLaunchContract ?? (normalizeOptionalText$
|
|
26933
|
+
const launchContract = input.inputLaunchContract ?? input.optionLaunchContract ?? (normalizeOptionalText$42(input.cursorBin) ? buildExecutableLaunchContract({ commandPath: normalizeOptionalText$42(input.cursorBin) }) : null);
|
|
26921
26934
|
if (!launchContract) throw Object.assign(/* @__PURE__ */ new Error("Cursor CLI launch contract is required for runtime dispatch."), {
|
|
26922
26935
|
code: "controller.launch.needs_repair",
|
|
26923
26936
|
errorType: "config"
|
|
@@ -26990,7 +27003,7 @@ async function interruptActiveCursorTurn(input) {
|
|
|
26990
27003
|
};
|
|
26991
27004
|
}
|
|
26992
27005
|
}
|
|
26993
|
-
function normalizeOptionalText$
|
|
27006
|
+
function normalizeOptionalText$42(value) {
|
|
26994
27007
|
const normalized = typeof value === "string" ? value.trim() : "";
|
|
26995
27008
|
return normalized.length > 0 ? normalized : null;
|
|
26996
27009
|
}
|
|
@@ -27030,7 +27043,7 @@ const DEFAULT_OPENCLAW_AGENT_ID = "main";
|
|
|
27030
27043
|
async function resolveInstalledOpenClawLaunchCandidates(input) {
|
|
27031
27044
|
const installedCandidates = await resolveInstalledNodeScriptLaunchCandidates({
|
|
27032
27045
|
commandName: DEFAULT_OPENCLAW_COMMAND,
|
|
27033
|
-
configuredCommand: normalizeOptionalText$
|
|
27046
|
+
configuredCommand: normalizeOptionalText$41(process.env.OPENMELD_DAEMON_RUNTIME_OPENCLAW_BIN),
|
|
27034
27047
|
displayName: "OpenClaw",
|
|
27035
27048
|
preferredLaunchContract: input?.preferredLaunchContract
|
|
27036
27049
|
});
|
|
@@ -27063,9 +27076,9 @@ async function verifyOpenClawLaunchContract(input) {
|
|
|
27063
27076
|
}
|
|
27064
27077
|
function resolveOpenClawBinCandidates(explicitOpenClawBin) {
|
|
27065
27078
|
const candidates = [];
|
|
27066
|
-
const explicitCandidate = normalizeOptionalText$
|
|
27079
|
+
const explicitCandidate = normalizeOptionalText$41(explicitOpenClawBin);
|
|
27067
27080
|
if (explicitCandidate) candidates.push(explicitCandidate);
|
|
27068
|
-
const configuredCandidate = normalizeOptionalText$
|
|
27081
|
+
const configuredCandidate = normalizeOptionalText$41(process.env.OPENMELD_DAEMON_RUNTIME_OPENCLAW_BIN);
|
|
27069
27082
|
if (configuredCandidate && !candidates.includes(configuredCandidate)) candidates.push(configuredCandidate);
|
|
27070
27083
|
const nodeSiblingCandidate = resolveSiblingCommandPath({
|
|
27071
27084
|
anchorPath: process.execPath,
|
|
@@ -27081,16 +27094,16 @@ function resolveOpenClawBinCandidates(explicitOpenClawBin) {
|
|
|
27081
27094
|
return candidates;
|
|
27082
27095
|
}
|
|
27083
27096
|
function resolveOpenClawTimeoutMs() {
|
|
27084
|
-
const raw = normalizeOptionalText$
|
|
27097
|
+
const raw = normalizeOptionalText$41(process.env.OPENMELD_DAEMON_RUNTIME_REQUEST_TIMEOUT_MS);
|
|
27085
27098
|
if (!raw) return null;
|
|
27086
27099
|
const parsed = Number.parseInt(raw, 10);
|
|
27087
27100
|
if (!Number.isFinite(parsed) || parsed <= 0) return null;
|
|
27088
27101
|
return parsed;
|
|
27089
27102
|
}
|
|
27090
27103
|
function resolveOpenClawAgentId$1() {
|
|
27091
|
-
return normalizeOptionalText$
|
|
27104
|
+
return normalizeOptionalText$41(process.env.OPENMELD_DAEMON_RUNTIME_OPENCLAW_AGENT_ID) ?? DEFAULT_OPENCLAW_AGENT_ID;
|
|
27092
27105
|
}
|
|
27093
|
-
function normalizeOptionalText$
|
|
27106
|
+
function normalizeOptionalText$41(value) {
|
|
27094
27107
|
const normalized = String(value ?? "").trim();
|
|
27095
27108
|
return normalized.length > 0 ? normalized : null;
|
|
27096
27109
|
}
|
|
@@ -27229,10 +27242,10 @@ function resolveIsErrorResult(record) {
|
|
|
27229
27242
|
if (typeof record.isError === "boolean") return record.isError;
|
|
27230
27243
|
if (typeof record.ok === "boolean") return !record.ok;
|
|
27231
27244
|
if (typeof record.success === "boolean") return !record.success;
|
|
27232
|
-
const status = normalizeOptionalText$
|
|
27245
|
+
const status = normalizeOptionalText$40(record.status)?.toLowerCase();
|
|
27233
27246
|
if (status === "error" || status === "failed" || status === "fail") return true;
|
|
27234
27247
|
if (status === "ok" || status === "success" || status === "completed") return false;
|
|
27235
|
-
const type = normalizeOptionalText$
|
|
27248
|
+
const type = normalizeOptionalText$40(record.type)?.toLowerCase();
|
|
27236
27249
|
if (type === "error" || type === "failure") return true;
|
|
27237
27250
|
if (type === "result" || type === "success") return false;
|
|
27238
27251
|
if (record.error !== void 0 || record.errors !== void 0) return true;
|
|
@@ -27281,7 +27294,7 @@ function normalizeCandidateValue(value) {
|
|
|
27281
27294
|
}
|
|
27282
27295
|
return null;
|
|
27283
27296
|
}
|
|
27284
|
-
function normalizeOptionalText$
|
|
27297
|
+
function normalizeOptionalText$40(value) {
|
|
27285
27298
|
const normalized = String(value ?? "").trim();
|
|
27286
27299
|
return normalized.length > 0 ? normalized : null;
|
|
27287
27300
|
}
|
|
@@ -27339,7 +27352,7 @@ function classifyOpenClawFailureMessage(input) {
|
|
|
27339
27352
|
});
|
|
27340
27353
|
}
|
|
27341
27354
|
function normalizeOpenClawFailureMessage(value) {
|
|
27342
|
-
const normalized = normalizeOptionalText$
|
|
27355
|
+
const normalized = normalizeOptionalText$39(value);
|
|
27343
27356
|
if (!normalized) return null;
|
|
27344
27357
|
return extractJsonFailureDetail(normalized) ?? normalized;
|
|
27345
27358
|
}
|
|
@@ -27348,7 +27361,7 @@ function extractJsonFailureDetail(value) {
|
|
|
27348
27361
|
const parsed = JSON.parse(value);
|
|
27349
27362
|
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return null;
|
|
27350
27363
|
const record = parsed;
|
|
27351
|
-
return normalizeOptionalText$
|
|
27364
|
+
return normalizeOptionalText$39(record.detail) ?? normalizeOptionalText$39(record.message) ?? (record.error && typeof record.error === "object" && !Array.isArray(record.error) ? normalizeOptionalText$39(record.error.message) : null);
|
|
27352
27365
|
} catch {
|
|
27353
27366
|
return null;
|
|
27354
27367
|
}
|
|
@@ -27368,7 +27381,7 @@ function isRateLimitFailure(value) {
|
|
|
27368
27381
|
function isInputSelectorFailure(value) {
|
|
27369
27382
|
return value.includes("pass --to") && value.includes("--session-id") && value.includes("--agent") || value.includes("unknown agent") || value.includes("agent not found");
|
|
27370
27383
|
}
|
|
27371
|
-
function normalizeOptionalText$
|
|
27384
|
+
function normalizeOptionalText$39(value) {
|
|
27372
27385
|
const normalized = typeof value === "string" ? value.trim() : "";
|
|
27373
27386
|
return normalized.length > 0 ? normalized : null;
|
|
27374
27387
|
}
|
|
@@ -27387,7 +27400,7 @@ var OpenClawCliTransportError = class extends Error {
|
|
|
27387
27400
|
}
|
|
27388
27401
|
};
|
|
27389
27402
|
async function invokeOpenClawCliTransport(input) {
|
|
27390
|
-
const prompt = normalizeOptionalText$
|
|
27403
|
+
const prompt = normalizeOptionalText$38(input.prompt);
|
|
27391
27404
|
if (!prompt) throw new OpenClawCliTransportError({
|
|
27392
27405
|
code: "schema.invalid",
|
|
27393
27406
|
errorType: "config",
|
|
@@ -27396,7 +27409,7 @@ async function invokeOpenClawCliTransport(input) {
|
|
|
27396
27409
|
const { args, sessionId: initialSessionId } = buildOpenClawArgs({
|
|
27397
27410
|
openClawAgentId: input.openClawAgentId,
|
|
27398
27411
|
prompt,
|
|
27399
|
-
sessionId: normalizeOptionalText$
|
|
27412
|
+
sessionId: normalizeOptionalText$38(input.sessionId)
|
|
27400
27413
|
});
|
|
27401
27414
|
const invocation = buildCliLaunchInvocation({
|
|
27402
27415
|
args,
|
|
@@ -27473,7 +27486,7 @@ async function invokeOpenClawCliTransport(input) {
|
|
|
27473
27486
|
stdoutText: driverResult.stdoutText
|
|
27474
27487
|
}));
|
|
27475
27488
|
}
|
|
27476
|
-
const output = normalizeOptionalText$
|
|
27489
|
+
const output = normalizeOptionalText$38(latestOutput);
|
|
27477
27490
|
if (!output) {
|
|
27478
27491
|
const fallbackOutput = resolveSuccessFallbackOutput(driverResult.stdoutText);
|
|
27479
27492
|
if (!fallbackOutput) {
|
|
@@ -27491,25 +27504,25 @@ async function invokeOpenClawCliTransport(input) {
|
|
|
27491
27504
|
}
|
|
27492
27505
|
return {
|
|
27493
27506
|
output: fallbackOutput,
|
|
27494
|
-
sessionId: normalizeOptionalText$
|
|
27507
|
+
sessionId: normalizeOptionalText$38(resolvedSessionId),
|
|
27495
27508
|
telemetry: buildTransportTelemetry({
|
|
27496
27509
|
driverResult,
|
|
27497
27510
|
firstStderrAtMs,
|
|
27498
27511
|
firstStdoutAtMs,
|
|
27499
27512
|
invokedAtMs,
|
|
27500
|
-
resumedContext: normalizeOptionalText$
|
|
27513
|
+
resumedContext: normalizeOptionalText$38(input.sessionId) !== null
|
|
27501
27514
|
})
|
|
27502
27515
|
};
|
|
27503
27516
|
}
|
|
27504
27517
|
return {
|
|
27505
27518
|
output,
|
|
27506
|
-
sessionId: normalizeOptionalText$
|
|
27519
|
+
sessionId: normalizeOptionalText$38(resolvedSessionId),
|
|
27507
27520
|
telemetry: buildTransportTelemetry({
|
|
27508
27521
|
driverResult,
|
|
27509
27522
|
firstStderrAtMs,
|
|
27510
27523
|
firstStdoutAtMs,
|
|
27511
27524
|
invokedAtMs,
|
|
27512
|
-
resumedContext: normalizeOptionalText$
|
|
27525
|
+
resumedContext: normalizeOptionalText$38(input.sessionId) !== null
|
|
27513
27526
|
})
|
|
27514
27527
|
};
|
|
27515
27528
|
}
|
|
@@ -27576,7 +27589,7 @@ const classifyOpenClawFailure = (input) => {
|
|
|
27576
27589
|
isContextLost: isLikelyOpenClawContextLostError,
|
|
27577
27590
|
message: providerMessage
|
|
27578
27591
|
});
|
|
27579
|
-
const stderrText = normalizeOptionalText$
|
|
27592
|
+
const stderrText = normalizeOptionalText$38(input.stderrText);
|
|
27580
27593
|
if (stderrText) return {
|
|
27581
27594
|
code: "upstream_unreachable",
|
|
27582
27595
|
errorType: "adapter",
|
|
@@ -27588,13 +27601,13 @@ const resolveProviderFailureMessage = (input) => {
|
|
|
27588
27601
|
const candidateMessages = [
|
|
27589
27602
|
...input.providerErrorMessages,
|
|
27590
27603
|
...extractErrorMessagesFromStdout(input.stdoutText),
|
|
27591
|
-
...normalizeOptionalText$
|
|
27604
|
+
...normalizeOptionalText$38(input.stderrText) ? [normalizeOptionalText$38(input.stderrText)] : []
|
|
27592
27605
|
].filter((value) => Boolean(value));
|
|
27593
27606
|
for (const candidate of candidateMessages) if (looksLikeRuntimePermissionDenialMessage(candidate) || looksLikeProviderFailure(candidate)) return candidate;
|
|
27594
27607
|
return candidateMessages[0] ?? null;
|
|
27595
27608
|
};
|
|
27596
27609
|
const extractErrorMessagesFromStdout = (value) => {
|
|
27597
|
-
const stdoutText = normalizeOptionalText$
|
|
27610
|
+
const stdoutText = normalizeOptionalText$38(value);
|
|
27598
27611
|
if (!stdoutText) return [];
|
|
27599
27612
|
const messages = [];
|
|
27600
27613
|
const lines = stdoutText.split("\n");
|
|
@@ -27605,7 +27618,7 @@ const extractErrorMessagesFromStdout = (value) => {
|
|
|
27605
27618
|
return messages;
|
|
27606
27619
|
};
|
|
27607
27620
|
const resolveSuccessFallbackOutput = (value) => {
|
|
27608
|
-
const stdoutText = normalizeOptionalText$
|
|
27621
|
+
const stdoutText = normalizeOptionalText$38(value);
|
|
27609
27622
|
if (!stdoutText) return null;
|
|
27610
27623
|
const lines = stdoutText.split("\n").map((line) => line.trim()).filter((line) => line.length > 0);
|
|
27611
27624
|
if (lines.length !== 1) return null;
|
|
@@ -27615,12 +27628,12 @@ const resolveSuccessFallbackOutput = (value) => {
|
|
|
27615
27628
|
return singleLine;
|
|
27616
27629
|
};
|
|
27617
27630
|
const collectProviderErrorMessage = (line, output) => {
|
|
27618
|
-
const normalized = normalizeOptionalText$
|
|
27631
|
+
const normalized = normalizeOptionalText$38(line);
|
|
27619
27632
|
if (!normalized) return;
|
|
27620
27633
|
output.push(normalized);
|
|
27621
27634
|
};
|
|
27622
27635
|
const collectRuntimePermissionDenialMessage = (line, output) => {
|
|
27623
|
-
const normalized = normalizeOptionalText$
|
|
27636
|
+
const normalized = normalizeOptionalText$38(line);
|
|
27624
27637
|
if (!(normalized && looksLikeRuntimePermissionDenialMessage(normalized))) return;
|
|
27625
27638
|
output.push(normalized);
|
|
27626
27639
|
};
|
|
@@ -27631,7 +27644,7 @@ const looksLikeProviderFailure = (value) => {
|
|
|
27631
27644
|
function normalizeText$4(value) {
|
|
27632
27645
|
return String(value ?? "").trim();
|
|
27633
27646
|
}
|
|
27634
|
-
function normalizeOptionalText$
|
|
27647
|
+
function normalizeOptionalText$38(value) {
|
|
27635
27648
|
const normalized = normalizeText$4(value);
|
|
27636
27649
|
return normalized.length > 0 ? normalized : null;
|
|
27637
27650
|
}
|
|
@@ -27763,15 +27776,15 @@ async function readSessionIndex(input) {
|
|
|
27763
27776
|
}
|
|
27764
27777
|
}
|
|
27765
27778
|
function resolveOpenClawStateDir(env) {
|
|
27766
|
-
const configuredStateDir = normalizeOptionalText$
|
|
27779
|
+
const configuredStateDir = normalizeOptionalText$37(env?.OPENCLAW_STATE_DIR);
|
|
27767
27780
|
if (configuredStateDir) return configuredStateDir;
|
|
27768
27781
|
return join(homedir(), ".openclaw");
|
|
27769
27782
|
}
|
|
27770
27783
|
function resolveSessionFilePath(input) {
|
|
27771
27784
|
const sessionsDir = join(resolveOpenClawStateDir(input.env), "agents", input.agentId, "sessions");
|
|
27772
|
-
const sessionFile = normalizeOptionalText$
|
|
27785
|
+
const sessionFile = normalizeOptionalText$37(input.sessionEntry.sessionFile);
|
|
27773
27786
|
if (sessionFile) return isAbsolute(sessionFile) ? sessionFile : join(sessionsDir, sessionFile);
|
|
27774
|
-
const sessionId = normalizeOptionalText$
|
|
27787
|
+
const sessionId = normalizeOptionalText$37(input.sessionEntry.sessionId);
|
|
27775
27788
|
if (!sessionId) return null;
|
|
27776
27789
|
return join(sessionsDir, `${sessionId}.jsonl`);
|
|
27777
27790
|
}
|
|
@@ -27792,11 +27805,11 @@ function parseSessionErrorRecord(line) {
|
|
|
27792
27805
|
const parsed = JSON.parse(line);
|
|
27793
27806
|
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return null;
|
|
27794
27807
|
const record = parsed;
|
|
27795
|
-
if (normalizeOptionalText$
|
|
27808
|
+
if (normalizeOptionalText$37(record.type) !== "message") return null;
|
|
27796
27809
|
const message = record.message && typeof record.message === "object" ? record.message : null;
|
|
27797
27810
|
if (!message) return null;
|
|
27798
|
-
if (normalizeOptionalText$
|
|
27799
|
-
const errorMessage = normalizeOptionalText$
|
|
27811
|
+
if (normalizeOptionalText$37(message.stopReason) !== "error") return null;
|
|
27812
|
+
const errorMessage = normalizeOptionalText$37(message.errorMessage);
|
|
27800
27813
|
if (!errorMessage) return null;
|
|
27801
27814
|
const messageTimestampMs = normalizeOptionalNumber(message.timestamp) ?? normalizeIsoTimestampMs(record.timestamp);
|
|
27802
27815
|
if (messageTimestampMs === null) return null;
|
|
@@ -27809,7 +27822,7 @@ function parseSessionErrorRecord(line) {
|
|
|
27809
27822
|
}
|
|
27810
27823
|
}
|
|
27811
27824
|
function normalizeIsoTimestampMs(value) {
|
|
27812
|
-
const normalized = normalizeOptionalText$
|
|
27825
|
+
const normalized = normalizeOptionalText$37(value);
|
|
27813
27826
|
if (!normalized) return null;
|
|
27814
27827
|
const parsed = Date.parse(normalized);
|
|
27815
27828
|
return Number.isFinite(parsed) ? parsed : null;
|
|
@@ -27817,7 +27830,7 @@ function normalizeIsoTimestampMs(value) {
|
|
|
27817
27830
|
function normalizeOptionalNumber(value) {
|
|
27818
27831
|
return typeof value === "number" && Number.isFinite(value) ? value : null;
|
|
27819
27832
|
}
|
|
27820
|
-
function normalizeOptionalText$
|
|
27833
|
+
function normalizeOptionalText$37(value) {
|
|
27821
27834
|
const normalized = typeof value === "string" ? value.trim() : "";
|
|
27822
27835
|
return normalized.length > 0 ? normalized : null;
|
|
27823
27836
|
}
|
|
@@ -27838,8 +27851,8 @@ var OpenClawGatewayTransportError = class extends Error {
|
|
|
27838
27851
|
}
|
|
27839
27852
|
};
|
|
27840
27853
|
async function invokeOpenClawGatewayTransport(input) {
|
|
27841
|
-
const prompt = normalizeOptionalText$
|
|
27842
|
-
const sessionKey = normalizeOptionalText$
|
|
27854
|
+
const prompt = normalizeOptionalText$36(input.prompt);
|
|
27855
|
+
const sessionKey = normalizeOptionalText$36(input.sessionKey);
|
|
27843
27856
|
if (!prompt) throw new OpenClawGatewayTransportError({
|
|
27844
27857
|
code: "schema.invalid",
|
|
27845
27858
|
errorType: "config",
|
|
@@ -27952,9 +27965,9 @@ function normalizeOpenClawGatewayAgentResult(result, expectedSessionKey) {
|
|
|
27952
27965
|
message: "upstream_unreachable: openclaw gateway returned a non-object payload for agent"
|
|
27953
27966
|
});
|
|
27954
27967
|
const record = result;
|
|
27955
|
-
const status = normalizeOptionalText$
|
|
27968
|
+
const status = normalizeOptionalText$36(record.status);
|
|
27956
27969
|
if (!status || status === "ok") return extractSuccessfulAgentResult(record.result, expectedSessionKey);
|
|
27957
|
-
throw classifyGatewayFailure(normalizeOptionalText$
|
|
27970
|
+
throw classifyGatewayFailure(normalizeOptionalText$36(record.summary) ?? normalizeOptionalText$36(record.error) ?? `openclaw gateway agent returned status '${status}'`, true);
|
|
27958
27971
|
}
|
|
27959
27972
|
function extractSuccessfulAgentResult(result, expectedSessionKey) {
|
|
27960
27973
|
if (!result || typeof result !== "object") throw new OpenClawGatewayTransportError({
|
|
@@ -27979,7 +27992,7 @@ function normalizeAgentMeta(meta, expectedSessionKey) {
|
|
|
27979
27992
|
const record = meta;
|
|
27980
27993
|
const systemPromptReport = record.systemPromptReport;
|
|
27981
27994
|
if (systemPromptReport && typeof systemPromptReport === "object") {
|
|
27982
|
-
const actualSessionKey = normalizeOptionalText$
|
|
27995
|
+
const actualSessionKey = normalizeOptionalText$36(systemPromptReport.sessionKey);
|
|
27983
27996
|
if (actualSessionKey && actualSessionKey !== expectedSessionKey) throw new OpenClawGatewayTransportError({
|
|
27984
27997
|
code: "upstream_unreachable",
|
|
27985
27998
|
errorType: "adapter",
|
|
@@ -27987,15 +28000,15 @@ function normalizeAgentMeta(meta, expectedSessionKey) {
|
|
|
27987
28000
|
});
|
|
27988
28001
|
}
|
|
27989
28002
|
const agentMeta = record.agentMeta;
|
|
27990
|
-
const agentSessionId = agentMeta && typeof agentMeta === "object" ? normalizeOptionalText$
|
|
27991
|
-
const reportSessionId = systemPromptReport && typeof systemPromptReport === "object" ? normalizeOptionalText$
|
|
28003
|
+
const agentSessionId = agentMeta && typeof agentMeta === "object" ? normalizeOptionalText$36(agentMeta.sessionId) : null;
|
|
28004
|
+
const reportSessionId = systemPromptReport && typeof systemPromptReport === "object" ? normalizeOptionalText$36(systemPromptReport.sessionId) : null;
|
|
27992
28005
|
return { sessionId: agentSessionId ?? reportSessionId };
|
|
27993
28006
|
}
|
|
27994
28007
|
function extractAgentPayloadText(payloads) {
|
|
27995
28008
|
if (!Array.isArray(payloads)) return null;
|
|
27996
28009
|
for (const payload of payloads) {
|
|
27997
28010
|
if (!payload || typeof payload !== "object") continue;
|
|
27998
|
-
const text = normalizeOptionalText$
|
|
28011
|
+
const text = normalizeOptionalText$36(payload.text);
|
|
27999
28012
|
if (text) return text;
|
|
28000
28013
|
}
|
|
28001
28014
|
return null;
|
|
@@ -28007,8 +28020,8 @@ function toOpenClawGatewayTransportError(error) {
|
|
|
28007
28020
|
errorType: "adapter",
|
|
28008
28021
|
message: "upstream_unreachable: openclaw is not installed or not on PATH"
|
|
28009
28022
|
});
|
|
28010
|
-
const stderr = normalizeOptionalText$
|
|
28011
|
-
const stdout = normalizeOptionalText$
|
|
28023
|
+
const stderr = normalizeOptionalText$36(error?.stderr);
|
|
28024
|
+
const stdout = normalizeOptionalText$36(error?.stdout);
|
|
28012
28025
|
return classifyGatewayFailure(stderr ?? stdout ?? toErrorMessage$27(error), false);
|
|
28013
28026
|
}
|
|
28014
28027
|
function classifyGatewayFailure(message, includeOriginalError) {
|
|
@@ -28017,7 +28030,7 @@ function classifyGatewayFailure(message, includeOriginalError) {
|
|
|
28017
28030
|
message
|
|
28018
28031
|
}));
|
|
28019
28032
|
}
|
|
28020
|
-
function normalizeOptionalText$
|
|
28033
|
+
function normalizeOptionalText$36(value) {
|
|
28021
28034
|
const normalized = String(value ?? "").trim();
|
|
28022
28035
|
return normalized.length > 0 ? normalized : null;
|
|
28023
28036
|
}
|
|
@@ -28112,9 +28125,9 @@ async function withOpenClawDispatchSpaceActionPlugin(input) {
|
|
|
28112
28125
|
}
|
|
28113
28126
|
}
|
|
28114
28127
|
function resolveOpenClawConfigPath(env) {
|
|
28115
|
-
const explicit = normalizeOptionalText$
|
|
28128
|
+
const explicit = normalizeOptionalText$35(env[OPENCLAW_CONFIG_PATH_ENV]);
|
|
28116
28129
|
if (explicit) return explicit;
|
|
28117
|
-
return join(normalizeOptionalText$
|
|
28130
|
+
return join(normalizeOptionalText$35(env[OPENCLAW_STATE_DIR_ENV]) ?? join(normalizeOptionalText$35(env.HOME) ?? homedir(), ".openclaw"), "openclaw.json");
|
|
28118
28131
|
}
|
|
28119
28132
|
function buildOpenClawSpaceActionPluginSource() {
|
|
28120
28133
|
return `import { spawn } from "node:child_process";
|
|
@@ -28229,6 +28242,7 @@ const plugin = {
|
|
|
28229
28242
|
additionalProperties: false,
|
|
28230
28243
|
properties: {
|
|
28231
28244
|
message: stringSchema,
|
|
28245
|
+
mentionTargets: stringArraySchema,
|
|
28232
28246
|
referenceTargets: stringArraySchema,
|
|
28233
28247
|
wakeTargets: stringArraySchema,
|
|
28234
28248
|
},
|
|
@@ -28238,9 +28252,11 @@ const plugin = {
|
|
|
28238
28252
|
const message = requiredText(params?.message, "Reply message");
|
|
28239
28253
|
const wakeTargets = optionalStringArray(params?.wakeTargets, "wakeTargets");
|
|
28240
28254
|
const referenceTargets = optionalStringArray(params?.referenceTargets, "referenceTargets");
|
|
28255
|
+
const mentionTargets = optionalStringArray(params?.mentionTargets, "mentionTargets");
|
|
28241
28256
|
const args = ["space", "action", "reply", "--message-file", "-"];
|
|
28242
28257
|
for (const target of wakeTargets) args.push("--wake", target);
|
|
28243
28258
|
for (const target of referenceTargets) args.push("--reference", target);
|
|
28259
|
+
for (const target of mentionTargets) args.push("--mention", target);
|
|
28244
28260
|
return await runAction(args, message);
|
|
28245
28261
|
},
|
|
28246
28262
|
});
|
|
@@ -28285,7 +28301,7 @@ const plugin = {
|
|
|
28285
28301
|
export default plugin;
|
|
28286
28302
|
`;
|
|
28287
28303
|
}
|
|
28288
|
-
function normalizeOptionalText$
|
|
28304
|
+
function normalizeOptionalText$35(value) {
|
|
28289
28305
|
const normalized = String(value ?? "").trim();
|
|
28290
28306
|
return normalized.length > 0 ? normalized : null;
|
|
28291
28307
|
}
|
|
@@ -28294,7 +28310,7 @@ function normalizeOptionalText$34(value) {
|
|
|
28294
28310
|
const OPENCLAW_CONVERSATION_BRIDGE_SPEC = resolveBuiltinAdapterConversationBridgeSpec("openclaw");
|
|
28295
28311
|
const resolveOpenClawSessionConversation = (agentControllerConversation) => {
|
|
28296
28312
|
if (!agentControllerConversation) return null;
|
|
28297
|
-
const agentControllerConversationId = normalizeOptionalText$
|
|
28313
|
+
const agentControllerConversationId = normalizeOptionalText$34(agentControllerConversation.agentControllerConversationId);
|
|
28298
28314
|
if (!agentControllerConversationId) throw new Error("conversation.bridge.agent_controller_conversation_id_missing: expected builtin:openclaw session agentControllerConversationId");
|
|
28299
28315
|
if (agentControllerConversation.agentControllerRef !== "builtin:openclaw" || agentControllerConversation.agentControllerConversationKind !== "session") throw new Error(`conversation.bridge.agent_controller_conversation_mismatch: expected builtin:openclaw session, received ${agentControllerConversation.agentControllerRef}/${agentControllerConversation.agentControllerConversationKind}`);
|
|
28300
28316
|
return buildAdapterAgentControllerConversationRef({
|
|
@@ -28307,7 +28323,7 @@ const resolveOpenClawInvokeRequest = (input) => {
|
|
|
28307
28323
|
const agentControllerConversation = resolveOpenClawSessionConversation(input.request.agentControllerConversation);
|
|
28308
28324
|
return {
|
|
28309
28325
|
...input.request,
|
|
28310
|
-
agentControllerConversationId: normalizeOptionalText$
|
|
28326
|
+
agentControllerConversationId: normalizeOptionalText$34(input.request.agentControllerConversationId),
|
|
28311
28327
|
...agentControllerConversation ? { agentControllerConversation } : {}
|
|
28312
28328
|
};
|
|
28313
28329
|
};
|
|
@@ -28398,7 +28414,7 @@ const resolveDefaultOpenClawInvoke = (options) => {
|
|
|
28398
28414
|
};
|
|
28399
28415
|
};
|
|
28400
28416
|
async function resolveOpenClawDispatchLaunchContract(input) {
|
|
28401
|
-
const explicitLaunchContract = input.inputLaunchContract ?? input.optionLaunchContract ?? (normalizeOptionalText$
|
|
28417
|
+
const explicitLaunchContract = input.inputLaunchContract ?? input.optionLaunchContract ?? (normalizeOptionalText$34(input.openClawBin) ? buildExecutableLaunchContract({ commandPath: normalizeOptionalText$34(input.openClawBin) }) : null);
|
|
28402
28418
|
if (explicitLaunchContract) {
|
|
28403
28419
|
const verification = await verifyOpenClawLaunchContract({ launchContract: explicitLaunchContract });
|
|
28404
28420
|
if (verification.ok) return explicitLaunchContract;
|
|
@@ -28418,8 +28434,8 @@ const resolveRuntimeProcessRegistrar = (input) => input.registerRuntimeProcess ?
|
|
|
28418
28434
|
taskId: input.taskId
|
|
28419
28435
|
});
|
|
28420
28436
|
} : void 0;
|
|
28421
|
-
const resolveOpenClawAgentId = (input) => normalizeOptionalText$
|
|
28422
|
-
const resolveOpenClawSessionKey = (input) => normalizeOptionalText$
|
|
28437
|
+
const resolveOpenClawAgentId = (input) => normalizeOptionalText$34(input.dispatchEnvAgentId) ?? normalizeOptionalText$34(input.optionAgentId) ?? resolveOpenClawAgentId$1();
|
|
28438
|
+
const resolveOpenClawSessionKey = (input) => normalizeOptionalText$34(input.agentControllerConversation?.agentControllerRef === "builtin:openclaw" && input.agentControllerConversation.agentControllerConversationKind === "session" ? input.agentControllerConversation.agentControllerConversationId : null);
|
|
28423
28439
|
const invokeOpenClawGatewayPath = async (input) => {
|
|
28424
28440
|
const gatewayResult = await invokeOpenClawGatewayTransport({
|
|
28425
28441
|
agentId: input.openClawAgentId,
|
|
@@ -28430,7 +28446,7 @@ const invokeOpenClawGatewayPath = async (input) => {
|
|
|
28430
28446
|
openClawTimeoutMs: input.openClawTimeoutMs,
|
|
28431
28447
|
openClawWorkdir: input.openClawWorkdir,
|
|
28432
28448
|
prompt: input.input.prompt,
|
|
28433
|
-
resumedContext: normalizeOptionalText$
|
|
28449
|
+
resumedContext: normalizeOptionalText$34(input.input.agentControllerConversationId) !== null,
|
|
28434
28450
|
sessionKey: input.sessionKey
|
|
28435
28451
|
});
|
|
28436
28452
|
return {
|
|
@@ -28457,7 +28473,7 @@ const invokeOpenClawLocalCliPath = async (input) => {
|
|
|
28457
28473
|
...input.onProcessControlEvent ? { onProcessControlEvent: input.onProcessControlEvent } : {},
|
|
28458
28474
|
...input.input.onRuntimeEvent ? { onRuntimeEvent: input.input.onRuntimeEvent } : {},
|
|
28459
28475
|
prompt: input.input.prompt,
|
|
28460
|
-
sessionId: normalizeOptionalText$
|
|
28476
|
+
sessionId: normalizeOptionalText$34(input.input.agentControllerConversationId)
|
|
28461
28477
|
});
|
|
28462
28478
|
const agentControllerConversation = OPENCLAW_CONVERSATION_BRIDGE_SPEC ? bridgeAgentControllerConversationRef({
|
|
28463
28479
|
bridgeSpec: OPENCLAW_CONVERSATION_BRIDGE_SPEC,
|
|
@@ -28476,7 +28492,7 @@ const invokeOpenClawLocalCliPath = async (input) => {
|
|
|
28476
28492
|
function normalizeText$3(value) {
|
|
28477
28493
|
return String(value ?? "").trim();
|
|
28478
28494
|
}
|
|
28479
|
-
function normalizeOptionalText$
|
|
28495
|
+
function normalizeOptionalText$34(value) {
|
|
28480
28496
|
const normalized = normalizeText$3(value);
|
|
28481
28497
|
return normalized.length > 0 ? normalized : null;
|
|
28482
28498
|
}
|
|
@@ -28755,7 +28771,7 @@ function formatAgentControllerStatus(snapshot) {
|
|
|
28755
28771
|
function formatAgentControllerAccount(snapshot) {
|
|
28756
28772
|
if (snapshot.check?.status === "failed") return "Not checked";
|
|
28757
28773
|
if (snapshot.auth.status === "authenticated") return resolveAgentControllerAuthDisplayLabel(snapshot) ?? "Authenticated";
|
|
28758
|
-
if (snapshot.auth.status === "unauthenticated") return "Not
|
|
28774
|
+
if (snapshot.auth.status === "unauthenticated") return "Not signed in";
|
|
28759
28775
|
return "Unknown";
|
|
28760
28776
|
}
|
|
28761
28777
|
function resolveAgentControllerAuthDisplayLabel(snapshot) {
|
|
@@ -28797,8 +28813,8 @@ function appendLocalInstallCount(parts, count) {
|
|
|
28797
28813
|
function formatLocalAgentLaunchStatus(status) {
|
|
28798
28814
|
switch (status) {
|
|
28799
28815
|
case "ready": return "Can launch";
|
|
28800
|
-
case "needs_choice": return "
|
|
28801
|
-
case "needs_repair": return "
|
|
28816
|
+
case "needs_choice": return "Choose an installation";
|
|
28817
|
+
case "needs_repair": return "Can’t start";
|
|
28802
28818
|
default: return "Not available";
|
|
28803
28819
|
}
|
|
28804
28820
|
}
|
|
@@ -30437,7 +30453,10 @@ var registry_default$1 = {
|
|
|
30437
30453
|
}]
|
|
30438
30454
|
},
|
|
30439
30455
|
"lifecycle": { "status": "active" },
|
|
30440
|
-
"originLaunch": {
|
|
30456
|
+
"originLaunch": {
|
|
30457
|
+
"commandTemplate": "cd {workingDirectory} && codex resume -m {model} {agentControllerConversationId}",
|
|
30458
|
+
"unselectedModelCommandTemplate": "cd {workingDirectory} && codex resume {agentControllerConversationId}"
|
|
30459
|
+
},
|
|
30441
30460
|
"notes": "Primary runnable agent in current environment.",
|
|
30442
30461
|
"transportModes": ["codex-app-server"],
|
|
30443
30462
|
"defaultTransportMode": "codex-app-server",
|
|
@@ -31269,13 +31288,19 @@ function resolveConversationPolicyFromModelSelection(input) {
|
|
|
31269
31288
|
status: "accepted",
|
|
31270
31289
|
conversationPolicy: {}
|
|
31271
31290
|
};
|
|
31272
|
-
if (!selection)
|
|
31273
|
-
|
|
31274
|
-
|
|
31275
|
-
|
|
31276
|
-
|
|
31277
|
-
|
|
31278
|
-
|
|
31291
|
+
if (!selection) {
|
|
31292
|
+
if (parsedRef.kind === "builtin" && parsedRef.id === "codex" && normalizeOptionalText$33(input.agentControllerConversationId)) return {
|
|
31293
|
+
status: "accepted",
|
|
31294
|
+
conversationPolicy: {}
|
|
31295
|
+
};
|
|
31296
|
+
return {
|
|
31297
|
+
status: "accepted",
|
|
31298
|
+
conversationPolicy: {
|
|
31299
|
+
fallbackModel: defaultModel.id,
|
|
31300
|
+
model: defaultModel.id
|
|
31301
|
+
}
|
|
31302
|
+
};
|
|
31303
|
+
}
|
|
31279
31304
|
const selectedModel = availableModels.find((model) => model.id === selection.modelId) ?? null;
|
|
31280
31305
|
const model = selectedModel ?? defaultModel;
|
|
31281
31306
|
const reasoningLevel = selectedModel && selection.reasoningLevel && selectedModel.supportedReasoningLevels.includes(selection.reasoningLevel) ? selection.reasoningLevel : null;
|
|
@@ -31288,6 +31313,10 @@ function resolveConversationPolicyFromModelSelection(input) {
|
|
|
31288
31313
|
}
|
|
31289
31314
|
};
|
|
31290
31315
|
}
|
|
31316
|
+
function normalizeOptionalText$33(value) {
|
|
31317
|
+
const normalized = String(value ?? "").trim();
|
|
31318
|
+
return normalized.length > 0 ? normalized : null;
|
|
31319
|
+
}
|
|
31291
31320
|
[.../* @__PURE__ */ new Set([
|
|
31292
31321
|
"bind_agent_profile",
|
|
31293
31322
|
"create_binding",
|
|
@@ -34201,13 +34230,20 @@ function createPendingAgentInteractionRegistry() {
|
|
|
34201
34230
|
}
|
|
34202
34231
|
//#endregion
|
|
34203
34232
|
//#region ../../runtime/local-service/src/post-message-envelope.ts
|
|
34204
|
-
const TARGET_VALIDATION_RULES = [
|
|
34205
|
-
|
|
34206
|
-
|
|
34207
|
-
|
|
34208
|
-
|
|
34209
|
-
|
|
34210
|
-
|
|
34233
|
+
const TARGET_VALIDATION_RULES = [
|
|
34234
|
+
{
|
|
34235
|
+
fieldName: "activationTargets",
|
|
34236
|
+
relationName: "wake"
|
|
34237
|
+
},
|
|
34238
|
+
{
|
|
34239
|
+
fieldName: "referenceTargets",
|
|
34240
|
+
relationName: "reference"
|
|
34241
|
+
},
|
|
34242
|
+
{
|
|
34243
|
+
fieldName: "mentionTargets",
|
|
34244
|
+
relationName: "mention"
|
|
34245
|
+
}
|
|
34246
|
+
];
|
|
34211
34247
|
function normalizeDispatchPostMessageAction(input) {
|
|
34212
34248
|
const normalizedEnvelope = normalizeMessageEnvelope(input.action.messageEnvelope);
|
|
34213
34249
|
const replyToSignalId = normalizeReplyToSignalId$1({
|
|
@@ -34231,6 +34267,7 @@ function normalizeDispatchPostMessageAction(input) {
|
|
|
34231
34267
|
activationTargetsCount: canonicalAction.messageEnvelope.activationTargets.length,
|
|
34232
34268
|
inputKind: input.inputKind,
|
|
34233
34269
|
memberDirectoryLoaded: input.sendTargetReference.status === "loaded",
|
|
34270
|
+
mentionTargetsCount: canonicalAction.messageEnvelope.mentionTargets?.length ?? 0,
|
|
34234
34271
|
referenceTargetsCount: canonicalAction.messageEnvelope.referenceTargets.length,
|
|
34235
34272
|
replyToSignalIdResolved: Boolean(canonicalAction.messageEnvelope.replyToSignalId)
|
|
34236
34273
|
}
|
|
@@ -34246,11 +34283,12 @@ function normalizeReplyToSignalId$1(input) {
|
|
|
34246
34283
|
}
|
|
34247
34284
|
function validateDispatchPostMessageTargets(input) {
|
|
34248
34285
|
const { activationTargets, referenceTargets } = input.action.messageEnvelope;
|
|
34249
|
-
|
|
34286
|
+
const mentionTargets = input.action.messageEnvelope.mentionTargets ?? [];
|
|
34287
|
+
if (activationTargets.length === 0 && referenceTargets.length === 0 && mentionTargets.length === 0) return;
|
|
34250
34288
|
if (input.sendTargetReference.status !== "loaded") throw new Error("post_message.messageEnvelope targets require a current Space member directory");
|
|
34251
34289
|
const targetByProfileId = new Map(input.sendTargetReference.projection.map((target) => [target.profileId, target]));
|
|
34252
34290
|
for (const rule of TARGET_VALIDATION_RULES) {
|
|
34253
|
-
const targets = input.action.messageEnvelope[rule.fieldName];
|
|
34291
|
+
const targets = input.action.messageEnvelope[rule.fieldName] ?? [];
|
|
34254
34292
|
for (const [index, targetProfileId] of targets.entries()) validateDispatchTargetProfileId({
|
|
34255
34293
|
fieldName: rule.fieldName,
|
|
34256
34294
|
index,
|
|
@@ -34266,6 +34304,7 @@ function validateDispatchTargetProfileId(input) {
|
|
|
34266
34304
|
if (!target) throw new Error(`${fieldPath} must reference an active profile in this space`);
|
|
34267
34305
|
if (input.relationName === "wake" && !target.allowedRelations.wake) throw new Error(`${fieldPath} must reference an agent profile in this space`);
|
|
34268
34306
|
if (input.relationName === "reference" && !target.allowedRelations.reference) throw new Error(`${fieldPath} must reference an active profile in this space`);
|
|
34307
|
+
if (input.relationName === "mention" && !target.allowedRelations.mention) throw new Error(`${fieldPath} must reference a human profile in this space`);
|
|
34269
34308
|
}
|
|
34270
34309
|
//#endregion
|
|
34271
34310
|
//#region ../../runtime/local-service/src/reply-context.ts
|
|
@@ -34367,12 +34406,13 @@ function isDaemonReconcileInProgressError(error) {
|
|
|
34367
34406
|
//#region ../../runtime/local-service/src/space-action-target-guidance.ts
|
|
34368
34407
|
const SPACE_ACTION_CONTEXT_GUIDANCE_LINES = ["- Keep private work, drafts, tool logs, and unauthorized sensitive context local. Treat this Wake as the current source; tie other context to the claims it supports, and reply in its current thread unless explicitly redirected.", "- A plain reply or bare @name does not hand off work; use Wake or Reply + Wake. Never wake another Agent Profile just to thank, acknowledge, or confirm receipt; wake only when new work moves the goal forward."];
|
|
34369
34408
|
const SPACE_ACTION_TARGET_GUIDANCE_LINES = [
|
|
34370
|
-
"Use OpenMeld Space Action target fields such as wakeTargets and
|
|
34409
|
+
"Use OpenMeld Space Action target fields such as wakeTargets, referenceTargets, and mentionTargets. With the CLI fallback, use --wake, --reference, and --mention.",
|
|
34371
34410
|
"Any @name text in the body is only prose in the agent path; it does not define OpenMeld targets.",
|
|
34372
34411
|
"activationTargets is only for waking another Agent Profile in this Space.",
|
|
34373
34412
|
"activationTargets must reference an active Agent Profile member in this Space.",
|
|
34374
34413
|
"Never put a Human Profile ID, sender ID, or reply recipient in activationTargets.",
|
|
34375
|
-
"
|
|
34414
|
+
"referenceTargets must reference active Agent Profile members; mentionTargets must reference active Human Profile members.",
|
|
34415
|
+
"For a normal reply to the current Wake, leave activationTargets, referenceTargets, and mentionTargets empty."
|
|
34376
34416
|
];
|
|
34377
34417
|
//#endregion
|
|
34378
34418
|
//#region ../../runtime/local-service/src/startup-command-capability.ts
|
|
@@ -35193,7 +35233,10 @@ var registry_default = {
|
|
|
35193
35233
|
}]
|
|
35194
35234
|
},
|
|
35195
35235
|
"lifecycle": { "status": "active" },
|
|
35196
|
-
"originLaunch": {
|
|
35236
|
+
"originLaunch": {
|
|
35237
|
+
"commandTemplate": "cd {workingDirectory} && codex resume -m {model} {agentControllerConversationId}",
|
|
35238
|
+
"unselectedModelCommandTemplate": "cd {workingDirectory} && codex resume {agentControllerConversationId}"
|
|
35239
|
+
},
|
|
35197
35240
|
"notes": "Primary runnable agent in current environment.",
|
|
35198
35241
|
"transportModes": ["codex-app-server"],
|
|
35199
35242
|
"defaultTransportMode": "codex-app-server",
|
|
@@ -35966,10 +36009,10 @@ var registry_default = {
|
|
|
35966
36009
|
//#region ../../release/vendor-models.json
|
|
35967
36010
|
var vendor_models_default = {
|
|
35968
36011
|
schemaVersion: 1,
|
|
35969
|
-
updatedAt: "2026-
|
|
36012
|
+
updatedAt: "2026-09-01T00:00:00.000Z",
|
|
35970
36013
|
agentControllers: {
|
|
35971
36014
|
"codex": {
|
|
35972
|
-
"defaultModelId": "gpt-5.
|
|
36015
|
+
"defaultModelId": "gpt-5.6-sol",
|
|
35973
36016
|
"models": [
|
|
35974
36017
|
{
|
|
35975
36018
|
"id": "gpt-5.6-sol",
|
|
@@ -36825,6 +36868,17 @@ var vendor_models_default = {
|
|
|
36825
36868
|
"supportedReasoningLevels": [],
|
|
36826
36869
|
"minCliVersion": null
|
|
36827
36870
|
},
|
|
36871
|
+
{
|
|
36872
|
+
"id": "opencode-go/qwen3.8-flash",
|
|
36873
|
+
"displayName": "Qwen3.8 Flash",
|
|
36874
|
+
"unavailable": false,
|
|
36875
|
+
"supportedReasoningLevels": [
|
|
36876
|
+
"low",
|
|
36877
|
+
"medium",
|
|
36878
|
+
"xhigh"
|
|
36879
|
+
],
|
|
36880
|
+
"minCliVersion": null
|
|
36881
|
+
},
|
|
36828
36882
|
{
|
|
36829
36883
|
"id": "opencode-go/qwen3.8-max",
|
|
36830
36884
|
"displayName": "Qwen3.8 Max",
|
|
@@ -37060,13 +37114,15 @@ function resolveRegistryOriginLaunchCommand(input) {
|
|
|
37060
37114
|
const runtimeAdapterMatch = resolveRegistryRuntimeAdapterByAgentControllerRef(agentControllerRef);
|
|
37061
37115
|
if (!runtimeAdapterMatch) return null;
|
|
37062
37116
|
const matchedBuiltinAgent = listBuiltinAgentsRegistryEntries().find((agent) => agent.id === runtimeAdapterMatch.agentId);
|
|
37063
|
-
const
|
|
37117
|
+
const explicitModel = normalizeOptionalRegistryOriginValue("model", input.model);
|
|
37118
|
+
const unselectedModelCommandTemplate = String(matchedBuiltinAgent?.originLaunch?.unselectedModelCommandTemplate ?? "").trim();
|
|
37119
|
+
const commandTemplate = String(!explicitModel && unselectedModelCommandTemplate ? unselectedModelCommandTemplate : matchedBuiltinAgent?.originLaunch?.commandTemplate ?? "").trim();
|
|
37064
37120
|
if (!commandTemplate) return null;
|
|
37065
37121
|
return renderRegistryOriginLaunchCommand({
|
|
37066
37122
|
commandTemplate,
|
|
37067
37123
|
originFacts: {
|
|
37068
37124
|
agentControllerConversationId: input.agentControllerConversationId,
|
|
37069
|
-
model:
|
|
37125
|
+
model: explicitModel ?? (unselectedModelCommandTemplate ? null : resolveDefaultOriginLaunchModel({ agentId: runtimeAdapterMatch.agentId })),
|
|
37070
37126
|
workingDirectory: input.workingDirectory
|
|
37071
37127
|
}
|
|
37072
37128
|
});
|
|
@@ -37256,14 +37312,23 @@ function parseOptionalTransportModes(value, context) {
|
|
|
37256
37312
|
}
|
|
37257
37313
|
function parseOptionalOriginLaunch(value, context) {
|
|
37258
37314
|
if (value === void 0 || value === null) return null;
|
|
37259
|
-
const
|
|
37315
|
+
const objectValue = readObjectValue(value, context);
|
|
37316
|
+
const commandTemplate = readStringValue(objectValue.commandTemplate, `${context}.commandTemplate`);
|
|
37317
|
+
const unselectedModelCommandTemplate = objectValue.unselectedModelCommandTemplate === void 0 ? null : readStringValue(objectValue.unselectedModelCommandTemplate, `${context}.unselectedModelCommandTemplate`);
|
|
37318
|
+
validateOriginLaunchCommandTemplate(commandTemplate, `${context}.commandTemplate`);
|
|
37319
|
+
if (unselectedModelCommandTemplate) validateOriginLaunchCommandTemplate(unselectedModelCommandTemplate, `${context}.unselectedModelCommandTemplate`);
|
|
37320
|
+
return {
|
|
37321
|
+
commandTemplate,
|
|
37322
|
+
...unselectedModelCommandTemplate ? { unselectedModelCommandTemplate } : {}
|
|
37323
|
+
};
|
|
37324
|
+
}
|
|
37325
|
+
function validateOriginLaunchCommandTemplate(commandTemplate, context) {
|
|
37260
37326
|
const placeholderMatches = [...commandTemplate.matchAll(ANY_BRACE_TOKEN_RE)];
|
|
37261
|
-
if (placeholderMatches.length === 0) throw new Error(`Expected origin launch placeholder token at ${context}
|
|
37327
|
+
if (placeholderMatches.length === 0) throw new Error(`Expected origin launch placeholder token at ${context}`);
|
|
37262
37328
|
for (const match of placeholderMatches) {
|
|
37263
37329
|
const token = match[1];
|
|
37264
|
-
if (!(token && isSupportedOriginLaunchToken(token))) throw new Error(`Unsupported origin launch token '${match[0]}' at ${context}
|
|
37330
|
+
if (!(token && isSupportedOriginLaunchToken(token))) throw new Error(`Unsupported origin launch token '${match[0]}' at ${context}`);
|
|
37265
37331
|
}
|
|
37266
|
-
return { commandTemplate };
|
|
37267
37332
|
}
|
|
37268
37333
|
function normalizeOptionalRegistryOriginValue(token, value) {
|
|
37269
37334
|
if (token === "workingDirectory") return normalizeOptionalWorkingDirectory(value) ?? null;
|
|
@@ -39321,9 +39386,9 @@ function createModelCatalogReadSession(input) {
|
|
|
39321
39386
|
async function readModelCatalogOnce(baseUrl) {
|
|
39322
39387
|
try {
|
|
39323
39388
|
const [apiClient, baseUrlModule, clientFoundationModule] = await Promise.all([
|
|
39324
|
-
import("./dist-
|
|
39325
|
-
import("./base-url-
|
|
39326
|
-
import("./api-client-foundation-
|
|
39389
|
+
import("./dist-DEiXhSkt.js").then((n) => n.w),
|
|
39390
|
+
import("./base-url-CY_j4bLH.js").then((n) => n.n),
|
|
39391
|
+
import("./api-client-foundation-tvnD_7HW.js").then((n) => n.t)
|
|
39327
39392
|
]);
|
|
39328
39393
|
if (typeof apiClient.createConfigApi !== "function") throw new Error("config api client is unavailable");
|
|
39329
39394
|
const resolvedBaseUrl = baseUrl ?? await baseUrlModule.resolveBaseUrl();
|
|
@@ -39617,9 +39682,9 @@ function resolveBoundProfileLocalRouteCandidate(input) {
|
|
|
39617
39682
|
const agentControllerCollaborationMode = resolveNativeAgentControllerCollaborationModeForController(binding.agentControllerCollaborationMode, { agentControllerRef: agentControllerRef.ref });
|
|
39618
39683
|
return {
|
|
39619
39684
|
agentControllerRef: agentControllerRef.ref,
|
|
39620
|
-
agentControllerConversationId: normalizeOptionalText$
|
|
39685
|
+
agentControllerConversationId: normalizeOptionalText$47(executionTarget.agentControllerConversationId),
|
|
39621
39686
|
openMeldServiceRuntimeId: executionTarget.openMeldServiceRuntimeId.value,
|
|
39622
|
-
bindingId: normalizeOptionalText$
|
|
39687
|
+
bindingId: normalizeOptionalText$47(binding.bindingId),
|
|
39623
39688
|
...agentControllerCollaborationMode ? { agentControllerCollaborationMode } : {},
|
|
39624
39689
|
...agentControllerPermissionMode ? { agentControllerPermissionMode } : {},
|
|
39625
39690
|
...binding.modelSelection ? { modelSelection: binding.modelSelection } : {},
|
|
@@ -39641,6 +39706,7 @@ function resolveIneligibleLocalRouteCandidate(input) {
|
|
|
39641
39706
|
function buildAcceptedLocalDaemonRouteCandidate(input) {
|
|
39642
39707
|
const defaults = createDefaultRuntimeAgentControllerSettings(input.agentControllerRef);
|
|
39643
39708
|
const conversationPolicyResolution = resolveConversationPolicyFromModelSelection({
|
|
39709
|
+
agentControllerConversationId: input.agentControllerConversationId,
|
|
39644
39710
|
agentControllerRef: input.agentControllerRef,
|
|
39645
39711
|
catalog: input.modelCatalog,
|
|
39646
39712
|
modelSelection: input.modelSelection
|
|
@@ -41346,7 +41412,7 @@ const DEFAULT_OPENCLAW_RUNTIME_PREPARATION_DEPS = {
|
|
|
41346
41412
|
fetchGatewayHealth: fetchOpenClawGatewayHealth
|
|
41347
41413
|
};
|
|
41348
41414
|
async function prepareOpenClawRuntime(input, deps = DEFAULT_OPENCLAW_RUNTIME_PREPARATION_DEPS) {
|
|
41349
|
-
const profileName = normalizeOptionalText$
|
|
41415
|
+
const profileName = normalizeOptionalText$47(input.profileName);
|
|
41350
41416
|
if (!profileName) throw new DaemonServiceRunError({
|
|
41351
41417
|
code: "controller.bootstrap.failed",
|
|
41352
41418
|
message: "controller.bootstrap.failed: OpenClaw bootstrap requires an OpenMeld profile name"
|
|
@@ -41409,12 +41475,12 @@ function buildOpenClawGatewayVisibilityFailure(error) {
|
|
|
41409
41475
|
}
|
|
41410
41476
|
function extractErrorCode$1(error) {
|
|
41411
41477
|
if (!(error && typeof error === "object" && "code" in error)) return;
|
|
41412
|
-
return normalizeOptionalText$
|
|
41478
|
+
return normalizeOptionalText$47(error.code) ?? void 0;
|
|
41413
41479
|
}
|
|
41414
41480
|
function resolveOpenClawGatewayVisibilityDiagnostics(error) {
|
|
41415
41481
|
if (!(error instanceof Error)) return;
|
|
41416
41482
|
const diagnostics = error.diagnostics;
|
|
41417
|
-
if (!diagnostics || typeof diagnostics !== "object" || !normalizeOptionalText$
|
|
41483
|
+
if (!diagnostics || typeof diagnostics !== "object" || !normalizeOptionalText$47(diagnostics.agentId)) return;
|
|
41418
41484
|
const parsedGatewayVisibility = openMeldDaemonTaskResultOpenClawGatewayVisibilityStatusSchema.safeParse(diagnostics.gatewayVisibility);
|
|
41419
41485
|
if (!parsedGatewayVisibility.success) return;
|
|
41420
41486
|
return {
|
|
@@ -43164,7 +43230,7 @@ async function writeDaemonStartFailureState(input) {
|
|
|
43164
43230
|
recordedAt: input.recordedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
43165
43231
|
reason: input.reason,
|
|
43166
43232
|
detail: input.detail,
|
|
43167
|
-
rawLogLine: normalizeOptionalText$
|
|
43233
|
+
rawLogLine: normalizeOptionalText$47(input.rawLogLine) ?? null,
|
|
43168
43234
|
dependencyIssues: normalizeDependencyIssues(input.dependencyIssues ?? []),
|
|
43169
43235
|
lane
|
|
43170
43236
|
};
|
|
@@ -43180,11 +43246,11 @@ async function clearDaemonStartFailureState(pathInput = {}) {
|
|
|
43180
43246
|
function parseDaemonStartFailureState(value) {
|
|
43181
43247
|
if (!isRecord$2(value)) return null;
|
|
43182
43248
|
if (value.schema !== DAEMON_START_FAILURE_STATE_SCHEMA || value.v !== 1) return null;
|
|
43183
|
-
const recordedAt = normalizeOptionalText$
|
|
43184
|
-
const detail = normalizeOptionalText$
|
|
43249
|
+
const recordedAt = normalizeOptionalText$47(value.recordedAt);
|
|
43250
|
+
const detail = normalizeOptionalText$47(value.detail);
|
|
43185
43251
|
const lane = value.lane;
|
|
43186
43252
|
const reason = value.reason;
|
|
43187
|
-
const rawLogLine = value.rawLogLine === null ? null : normalizeOptionalText$
|
|
43253
|
+
const rawLogLine = value.rawLogLine === null ? null : normalizeOptionalText$47(value.rawLogLine);
|
|
43188
43254
|
if (!(recordedAt && detail) || lane !== "prod" && lane !== "dev-local" && lane !== "canary" || reason !== "service_dependencies_unavailable" && reason !== "startup_failed") return null;
|
|
43189
43255
|
const dependencyIssues = normalizeDependencyIssues(Array.isArray(value.dependencyIssues) ? value.dependencyIssues : []);
|
|
43190
43256
|
return {
|
|
@@ -43205,8 +43271,8 @@ function normalizeDependencyIssues(issues) {
|
|
|
43205
43271
|
const kind = issue.kind;
|
|
43206
43272
|
const status = issue.status;
|
|
43207
43273
|
const scope = issue.scope;
|
|
43208
|
-
const baseUrl = normalizeOptionalText$
|
|
43209
|
-
const probeUrl = normalizeOptionalText$
|
|
43274
|
+
const baseUrl = normalizeOptionalText$47(issue.baseUrl);
|
|
43275
|
+
const probeUrl = normalizeOptionalText$47(issue.probeUrl);
|
|
43210
43276
|
const httpStatus = typeof issue.httpStatus === "number" ? issue.httpStatus : null;
|
|
43211
43277
|
if (kind !== "auth" && kind !== "gateway" || status !== "unhealthy_http" && status !== "unreachable" || scope !== "loopback" && scope !== "remote" || !baseUrl || !probeUrl) continue;
|
|
43212
43278
|
normalized.push({
|
|
@@ -44258,10 +44324,10 @@ function toErrorMessage$19(error) {
|
|
|
44258
44324
|
//#endregion
|
|
44259
44325
|
//#region src/local-service/state/daemon-device-id.ts
|
|
44260
44326
|
function resolvePreferredDaemonDeviceId(input) {
|
|
44261
|
-
return normalizeOptionalText$
|
|
44327
|
+
return normalizeOptionalText$47(input.explicitDeviceId) ?? normalizeOptionalText$47(input.contractDeviceId) ?? void 0;
|
|
44262
44328
|
}
|
|
44263
44329
|
async function resolveDaemonDeviceId(input) {
|
|
44264
|
-
const explicit = normalizeOptionalText$
|
|
44330
|
+
const explicit = normalizeOptionalText$47(input.deviceId);
|
|
44265
44331
|
if (explicit) {
|
|
44266
44332
|
await persistDaemonDeviceIdIfNeeded({
|
|
44267
44333
|
deviceId: explicit,
|
|
@@ -44269,7 +44335,7 @@ async function resolveDaemonDeviceId(input) {
|
|
|
44269
44335
|
});
|
|
44270
44336
|
return explicit;
|
|
44271
44337
|
}
|
|
44272
|
-
const persisted = normalizeOptionalText$
|
|
44338
|
+
const persisted = normalizeOptionalText$47(await readFile(input.deviceIdPath, "utf8").catch(() => ""));
|
|
44273
44339
|
if (persisted && !(input.shouldDiscardPersistedDeviceId?.(persisted) ?? false)) return persisted;
|
|
44274
44340
|
const generated = randomUUID();
|
|
44275
44341
|
await writeDaemonDeviceId({
|
|
@@ -44314,7 +44380,7 @@ function buildLedgerPaths(ledgerRootPath) {
|
|
|
44314
44380
|
};
|
|
44315
44381
|
}
|
|
44316
44382
|
async function persistDaemonDeviceIdIfNeeded(input) {
|
|
44317
|
-
if (normalizeOptionalText$
|
|
44383
|
+
if (normalizeOptionalText$47(await readFile(input.deviceIdPath, "utf8").catch(() => "")) === input.deviceId) return;
|
|
44318
44384
|
await writeDaemonDeviceId(input);
|
|
44319
44385
|
}
|
|
44320
44386
|
async function writeDaemonDeviceId(input) {
|
|
@@ -44322,8 +44388,8 @@ async function writeDaemonDeviceId(input) {
|
|
|
44322
44388
|
await writeFile(input.deviceIdPath, `${input.deviceId}\n`, "utf8");
|
|
44323
44389
|
}
|
|
44324
44390
|
async function migrateLegacyDaemonDeviceId(input) {
|
|
44325
|
-
if (normalizeOptionalText$
|
|
44326
|
-
const legacy = normalizeOptionalText$
|
|
44391
|
+
if (normalizeOptionalText$47(await readFile(input.deviceIdPath, "utf8").catch(() => ""))) return;
|
|
44392
|
+
const legacy = normalizeOptionalText$47(await readFile(input.legacyDeviceIdPath, "utf8").catch(() => ""));
|
|
44327
44393
|
if (!legacy) return;
|
|
44328
44394
|
await writeDaemonDeviceId({
|
|
44329
44395
|
deviceId: legacy,
|
|
@@ -45617,7 +45683,7 @@ async function resolveLifecycleCommandOptions(input) {
|
|
|
45617
45683
|
currentGatewayUrl: normalizeGatewayBaseUrlOrNull(currentContract?.gatewayUrl),
|
|
45618
45684
|
runtimeGatewayUrl: normalizeGatewayBaseUrlOrNull(runtimeSnapshot?.gatewayUrl)
|
|
45619
45685
|
});
|
|
45620
|
-
const openMeldProfileId = normalizeOptionalText$
|
|
45686
|
+
const openMeldProfileId = normalizeOptionalText$47(input.profile) ?? normalizeOptionalText$47(runtimeSnapshot?.openMeldProfileId) ?? fallbackProfile?.openMeldProfileId ?? reusableCurrentContract?.profileId;
|
|
45621
45687
|
const ownerUserId = await resolveLifecycleCommandOwnerUserId({
|
|
45622
45688
|
openMeldProfileId,
|
|
45623
45689
|
fallbackProfile,
|
|
@@ -45631,7 +45697,7 @@ async function resolveLifecycleCommandOptions(input) {
|
|
|
45631
45697
|
}),
|
|
45632
45698
|
deviceIdPath: runtimePaths.deviceIdPath,
|
|
45633
45699
|
...shouldDiscardPersistedDeviceId ? { shouldDiscardPersistedDeviceId } : {}
|
|
45634
|
-
}).catch(() => reusableCurrentContract?.deviceId ?? null) : normalizeOptionalText$
|
|
45700
|
+
}).catch(() => reusableCurrentContract?.deviceId ?? null) : normalizeOptionalText$47(input.deviceId) ?? reusableCurrentContract?.deviceId ?? null;
|
|
45635
45701
|
const heartbeatMs = normalizeHeartbeatIntervalMs(input.heartbeatMs ?? currentContract?.heartbeatMs);
|
|
45636
45702
|
return {
|
|
45637
45703
|
environmentTarget,
|
|
@@ -45650,10 +45716,10 @@ function resolveLifecycleGatewayUrl(input) {
|
|
|
45650
45716
|
return input.commandGatewayUrl;
|
|
45651
45717
|
}
|
|
45652
45718
|
async function resolveLifecycleCommandOwnerUserId(input) {
|
|
45653
|
-
const profileId = normalizeOptionalText$
|
|
45654
|
-
if (profileId && input.fallbackProfile?.openMeldProfileId === profileId) return normalizeOptionalText$
|
|
45719
|
+
const profileId = normalizeOptionalText$47(input.openMeldProfileId);
|
|
45720
|
+
if (profileId && input.fallbackProfile?.openMeldProfileId === profileId) return normalizeOptionalText$47(input.fallbackProfile.ownerUserId) ?? void 0;
|
|
45655
45721
|
if (profileId) {
|
|
45656
|
-
const fallbackFromResolved = normalizeOptionalText$
|
|
45722
|
+
const fallbackFromResolved = normalizeOptionalText$47((await resolveOpenMeldProfileOrNull({
|
|
45657
45723
|
openMeldProfileId: profileId,
|
|
45658
45724
|
allowDefaultFallback: false,
|
|
45659
45725
|
allowUnauthenticated: true,
|
|
@@ -45661,11 +45727,11 @@ async function resolveLifecycleCommandOwnerUserId(input) {
|
|
|
45661
45727
|
}).catch(() => null))?.ownerUserId);
|
|
45662
45728
|
if (fallbackFromResolved) return fallbackFromResolved;
|
|
45663
45729
|
}
|
|
45664
|
-
if (profileId && input.reusableCurrentContract?.profileId === profileId) return normalizeOptionalText$
|
|
45665
|
-
if (!profileId) return normalizeOptionalText$
|
|
45730
|
+
if (profileId && input.reusableCurrentContract?.profileId === profileId) return normalizeOptionalText$47(input.reusableCurrentContract.ownerUserId) ?? void 0;
|
|
45731
|
+
if (!profileId) return normalizeOptionalText$47(input.reusableCurrentContract?.ownerUserId) ?? void 0;
|
|
45666
45732
|
}
|
|
45667
45733
|
function shouldPreferCommandResolvedGatewayForLifecycle() {
|
|
45668
|
-
if (normalizeOptionalText$
|
|
45734
|
+
if (normalizeOptionalText$47(process$1.env.OPENMELD_GATEWAY_URL)) return true;
|
|
45669
45735
|
const preset = resolveOpenMeldEnvPreset();
|
|
45670
45736
|
return preset === "dev-local" || preset === "canary";
|
|
45671
45737
|
}
|
|
@@ -48984,7 +49050,7 @@ function createSpaceSendInputRequiredGuideError() {
|
|
|
48984
49050
|
notes: [
|
|
48985
49051
|
"Prefer --stdin/--text-file for multiline or shell-sensitive message text.",
|
|
48986
49052
|
"Use repeatable --file options to share up to 10 Space Files with or without message text.",
|
|
48987
|
-
"Use --plain only when @Name(wake) or @Name(
|
|
49053
|
+
"Use --plain only when @Name(wake), @Name(reference), or @Name(mention) should be sent as literal text."
|
|
48988
49054
|
]
|
|
48989
49055
|
}
|
|
48990
49056
|
});
|
|
@@ -49005,7 +49071,7 @@ function createSpaceSendInputConflictGuideError() {
|
|
|
49005
49071
|
notes: [
|
|
49006
49072
|
"Do not combine positional text with --stdin or --text-file.",
|
|
49007
49073
|
"A --file attachment may be combined with any one message text source.",
|
|
49008
|
-
"Use --plain only when @Name(wake) or @Name(
|
|
49074
|
+
"Use --plain only when @Name(wake), @Name(reference), or @Name(mention) should be sent as literal text."
|
|
49009
49075
|
]
|
|
49010
49076
|
}
|
|
49011
49077
|
});
|
|
@@ -51167,6 +51233,8 @@ function resolveBareMentionCandidateAt(input) {
|
|
|
51167
51233
|
function toBareMentionDiagnostic(input) {
|
|
51168
51234
|
const label = input.candidate.entry.primaryMentionLabel;
|
|
51169
51235
|
const suggestedWakeText = input.candidate.entry.profileKind === "agent" && input.candidate.entry.allowedRelations.wake ? `@${label}(wake)` : null;
|
|
51236
|
+
const suggestedReferenceText = input.candidate.entry.profileKind === "agent" && input.candidate.entry.allowedRelations.reference ? `@${label}(reference)` : null;
|
|
51237
|
+
const suggestedMentionText = input.candidate.entry.profileKind === "human" && input.candidate.entry.allowedRelations.mention ? `@${label}(mention)` : null;
|
|
51170
51238
|
return {
|
|
51171
51239
|
end: input.end,
|
|
51172
51240
|
mentionText: input.mentionText,
|
|
@@ -51174,7 +51242,8 @@ function toBareMentionDiagnostic(input) {
|
|
|
51174
51242
|
profileKind: input.candidate.entry.profileKind,
|
|
51175
51243
|
profileName: input.candidate.entry.profileName,
|
|
51176
51244
|
start: input.start,
|
|
51177
|
-
|
|
51245
|
+
suggestedMentionText,
|
|
51246
|
+
suggestedReferenceText,
|
|
51178
51247
|
suggestedWakeText
|
|
51179
51248
|
};
|
|
51180
51249
|
}
|
|
@@ -51187,19 +51256,19 @@ function isBareMentionBoundary(value) {
|
|
|
51187
51256
|
return BARE_MENTION_BOUNDARY_PATTERN.test(value);
|
|
51188
51257
|
}
|
|
51189
51258
|
function isCanonicalMentionRelationSuffix(value) {
|
|
51190
|
-
return value.startsWith("(wake)") || value.startsWith("(reference)") || value.startsWith("(cc)");
|
|
51259
|
+
return value.startsWith("(wake)") || value.startsWith("(reference)") || value.startsWith("(mention)") || value.startsWith("(cc)");
|
|
51191
51260
|
}
|
|
51192
51261
|
function normalizeLabel(value) {
|
|
51193
51262
|
const normalized = String(value ?? "").replaceAll(WHITESPACE_PATTERN, " ").trim();
|
|
51194
51263
|
return normalized.length > 0 ? normalized : null;
|
|
51195
51264
|
}
|
|
51196
51265
|
const CANONICAL_MENTION_TYPES = new Set(MESSAGE_MENTION_TYPE_VALUES);
|
|
51197
|
-
const DUPLICATE_TARGET_ISSUE_PATTERN = /^(activationTargets|referenceTargets) must not contain duplicate profileId$/u;
|
|
51198
|
-
const DISTINCT_TARGET_ISSUE_PATTERN = /^(activationTargets|referenceTargets) must not reuse profileId from (activationTargets|referenceTargets)$/u;
|
|
51266
|
+
const DUPLICATE_TARGET_ISSUE_PATTERN = /^(activationTargets|referenceTargets|mentionTargets) must not contain duplicate profileId$/u;
|
|
51267
|
+
const DISTINCT_TARGET_ISSUE_PATTERN = /^(activationTargets|referenceTargets|mentionTargets) must not reuse profileId from (activationTargets|referenceTargets|mentionTargets)$/u;
|
|
51199
51268
|
const REMOVED_CC_RELATION_SUFFIX_PATTERN = /\(cc\)$/u;
|
|
51200
51269
|
const INVALID_MENTION_GUIDANCE = "That mention is not valid. Type @ and choose a member from the list.";
|
|
51201
51270
|
const MISSING_MENTION_TARGET_GUIDANCE = "That mention does not match a current member. Type @ and choose a member from the list.";
|
|
51202
|
-
const INVALID_MENTION_ACTION_GUIDANCE = "Mention action must be Wake or
|
|
51271
|
+
const INVALID_MENTION_ACTION_GUIDANCE = "Mention action must be Wake, Reference, or Mention. Type @ and choose from the list.";
|
|
51203
51272
|
function formatRemovedCcRelationMessage(replacement) {
|
|
51204
51273
|
return `CC has been removed from Space Message Addressing. Use ${replacement} instead.`;
|
|
51205
51274
|
}
|
|
@@ -51230,6 +51299,7 @@ function prepareSpaceComposerSubmission(input) {
|
|
|
51230
51299
|
messageEnvelope: createMessageEnvelopeOrNull({
|
|
51231
51300
|
activationTargets: [],
|
|
51232
51301
|
referenceTargets: [],
|
|
51302
|
+
mentionTargets: [],
|
|
51233
51303
|
...replyToSignalId ? { replyToSignalId } : {},
|
|
51234
51304
|
text: normalizedText
|
|
51235
51305
|
}),
|
|
@@ -51378,6 +51448,7 @@ function createEnvelopeInput(text, replyToSignalId) {
|
|
|
51378
51448
|
return {
|
|
51379
51449
|
activationTargets: [],
|
|
51380
51450
|
referenceTargets: [],
|
|
51451
|
+
mentionTargets: [],
|
|
51381
51452
|
...replyToSignalId ? { replyToSignalId } : {},
|
|
51382
51453
|
text
|
|
51383
51454
|
};
|
|
@@ -51428,6 +51499,7 @@ function normalizePlainTextOrThrow(text) {
|
|
|
51428
51499
|
return normalizeEnvelopeOrThrow({
|
|
51429
51500
|
activationTargets: [],
|
|
51430
51501
|
referenceTargets: [],
|
|
51502
|
+
mentionTargets: [],
|
|
51431
51503
|
text
|
|
51432
51504
|
}).text;
|
|
51433
51505
|
}
|
|
@@ -51436,7 +51508,7 @@ function normalizeOptionalText$6$1(value) {
|
|
|
51436
51508
|
return normalized.length > 0 ? normalized : null;
|
|
51437
51509
|
}
|
|
51438
51510
|
function createMessageEnvelopeOrNull(input) {
|
|
51439
|
-
if (!(input.activationTargets.length > 0 || input.referenceTargets.length > 0 || input.replyToSignalId)) return null;
|
|
51511
|
+
if (!(input.activationTargets.length > 0 || input.referenceTargets.length > 0 || input.mentionTargets.length > 0 || input.replyToSignalId)) return null;
|
|
51440
51512
|
return normalizeEnvelopeOrThrow(input);
|
|
51441
51513
|
}
|
|
51442
51514
|
function buildInvalidCanonicalMentionSyntaxMessage(mentionText) {
|
|
@@ -51457,7 +51529,7 @@ function buildInvalidCanonicalMentionRelationMessage(input) {
|
|
|
51457
51529
|
}
|
|
51458
51530
|
function describeRelationSupport(relation) {
|
|
51459
51531
|
if (relation === "wake") return "agent targets";
|
|
51460
|
-
return "
|
|
51532
|
+
return relation === "reference" ? "agent targets" : "human targets";
|
|
51461
51533
|
}
|
|
51462
51534
|
function formatCanonicalMentionEnvelopeError(error) {
|
|
51463
51535
|
const issues = extractEnvelopeIssueMessages(error);
|
|
@@ -51467,7 +51539,7 @@ function formatCanonicalMentionEnvelopeError(error) {
|
|
|
51467
51539
|
const distinctMatch = issueMessage.match(DISTINCT_TARGET_ISSUE_PATTERN);
|
|
51468
51540
|
if (distinctMatch?.[1] && distinctMatch[2]) return `same target cannot appear in both ${toRelationName(distinctMatch[2])} and ${toRelationName(distinctMatch[1])}`;
|
|
51469
51541
|
}
|
|
51470
|
-
return (issues[0] ?? (error instanceof Error ? error.message.trim() : "Invalid message envelope.")).replaceAll("activationTargets", "wake").replaceAll("referenceTargets", "reference").replaceAll("profileId", "target");
|
|
51542
|
+
return (issues[0] ?? (error instanceof Error ? error.message.trim() : "Invalid message envelope.")).replaceAll("activationTargets", "wake").replaceAll("referenceTargets", "reference").replaceAll("mentionTargets", "mention").replaceAll("profileId", "target");
|
|
51471
51543
|
}
|
|
51472
51544
|
function resolveCanonicalMentionEnvelopeErrorCode(error) {
|
|
51473
51545
|
const issues = extractEnvelopeIssueMessages(error);
|
|
@@ -51596,7 +51668,11 @@ function listRecentMentionProfileIdsFromText(input) {
|
|
|
51596
51668
|
}
|
|
51597
51669
|
return recentProfileIds;
|
|
51598
51670
|
}
|
|
51599
|
-
const CANONICAL_MENTION_RELATIONS = [
|
|
51671
|
+
const CANONICAL_MENTION_RELATIONS = [
|
|
51672
|
+
"wake",
|
|
51673
|
+
"reference",
|
|
51674
|
+
"mention"
|
|
51675
|
+
];
|
|
51600
51676
|
function buildMentionRelationKey(mentionLabel, relation) {
|
|
51601
51677
|
return `${relation}:${mentionLabel}`;
|
|
51602
51678
|
}
|
|
@@ -51615,14 +51691,20 @@ function normalizeReasonText(value) {
|
|
|
51615
51691
|
const MAX_RECENT_MENTION_PROFILE_IDS = 20;
|
|
51616
51692
|
const MENTION_PREFIX_PATTERN = /^@+/;
|
|
51617
51693
|
const MULTI_SPACE_PATTERN$1 = /\s+/g;
|
|
51618
|
-
const MENTION_RELATION_ORDER = [
|
|
51694
|
+
const MENTION_RELATION_ORDER = [
|
|
51695
|
+
"wake",
|
|
51696
|
+
"reference",
|
|
51697
|
+
"mention"
|
|
51698
|
+
];
|
|
51619
51699
|
const RELATION_LABELS = {
|
|
51620
51700
|
wake: "Wake",
|
|
51621
|
-
reference: "Reference"
|
|
51701
|
+
reference: "Reference",
|
|
51702
|
+
mention: "Mention"
|
|
51622
51703
|
};
|
|
51623
51704
|
const RELATION_DESCRIPTIONS = {
|
|
51624
51705
|
wake: "Ask this agent to reply.",
|
|
51625
|
-
reference: "Add context without asking for a reply."
|
|
51706
|
+
reference: "Add context without asking for a reply.",
|
|
51707
|
+
mention: "Notify this person about the message."
|
|
51626
51708
|
};
|
|
51627
51709
|
function listSpaceMentionSuggestions(input) {
|
|
51628
51710
|
const snapshot = input.snapshot;
|
|
@@ -52092,6 +52174,7 @@ function buildSignalMessageReadProjection(input) {
|
|
|
52092
52174
|
threadRef: input.threadRef ?? null,
|
|
52093
52175
|
wakeTargets: resolveTargetRefs(envelope?.activationTargets, memberIdentityIndex),
|
|
52094
52176
|
referenceTargets: resolveTargetRefs(envelope?.referenceTargets, memberIdentityIndex),
|
|
52177
|
+
mentionTargets: resolveTargetRefs(envelope?.mentionTargets, memberIdentityIndex),
|
|
52095
52178
|
replyToSignalId,
|
|
52096
52179
|
replyToContext: resolveReplyToContext({
|
|
52097
52180
|
replyToSignalId,
|
|
@@ -52111,6 +52194,7 @@ function buildDispatchResultMessageReadProjection(input) {
|
|
|
52111
52194
|
threadRef: input.result.threadContext ?? null,
|
|
52112
52195
|
wakeTargets: resolveTargetRefs(envelope?.activationTargets, memberIdentityIndex),
|
|
52113
52196
|
referenceTargets: resolveTargetRefs(envelope?.referenceTargets, memberIdentityIndex),
|
|
52197
|
+
mentionTargets: resolveTargetRefs(envelope?.mentionTargets, memberIdentityIndex),
|
|
52114
52198
|
replyToSignalId,
|
|
52115
52199
|
replyToContext: resolveReplyToContext({
|
|
52116
52200
|
replyToSignalId,
|
|
@@ -52173,6 +52257,10 @@ function buildSpaceMessageReadRelationSummary(input) {
|
|
|
52173
52257
|
relation: "reference",
|
|
52174
52258
|
targets: input.referenceTargets
|
|
52175
52259
|
});
|
|
52260
|
+
if (input.mentionTargets.length > 0) summary.push({
|
|
52261
|
+
relation: "mention",
|
|
52262
|
+
targets: input.mentionTargets
|
|
52263
|
+
});
|
|
52176
52264
|
return summary;
|
|
52177
52265
|
}
|
|
52178
52266
|
function readSignalMessageEnvelope(signal) {
|
|
@@ -52194,7 +52282,8 @@ function buildSignalRelationSummary(input) {
|
|
|
52194
52282
|
if (!envelope) return null;
|
|
52195
52283
|
const summary = buildSpaceMessageReadRelationSummary({
|
|
52196
52284
|
wakeTargets: resolveTargetRefs(envelope.activationTargets, input.memberIdentityIndex),
|
|
52197
|
-
referenceTargets: resolveTargetRefs(envelope.referenceTargets, input.memberIdentityIndex)
|
|
52285
|
+
referenceTargets: resolveTargetRefs(envelope.referenceTargets, input.memberIdentityIndex),
|
|
52286
|
+
mentionTargets: resolveTargetRefs(envelope.mentionTargets, input.memberIdentityIndex)
|
|
52198
52287
|
});
|
|
52199
52288
|
return summary.length > 0 ? summary : null;
|
|
52200
52289
|
}
|
|
@@ -52286,15 +52375,23 @@ function buildSpaceRoundReadProjection(input) {
|
|
|
52286
52375
|
}
|
|
52287
52376
|
function buildInitialRoundTargets(sourceMessageReadProjection) {
|
|
52288
52377
|
if (!sourceMessageReadProjection) return [];
|
|
52289
|
-
return [
|
|
52290
|
-
|
|
52291
|
-
|
|
52292
|
-
|
|
52293
|
-
|
|
52294
|
-
|
|
52295
|
-
|
|
52296
|
-
|
|
52297
|
-
|
|
52378
|
+
return [
|
|
52379
|
+
...buildRelationTargets({
|
|
52380
|
+
dispatchState: null,
|
|
52381
|
+
relation: "wake",
|
|
52382
|
+
targets: sourceMessageReadProjection.wakeTargets
|
|
52383
|
+
}),
|
|
52384
|
+
...buildRelationTargets({
|
|
52385
|
+
dispatchState: "no_dispatch",
|
|
52386
|
+
relation: "reference",
|
|
52387
|
+
targets: sourceMessageReadProjection.referenceTargets
|
|
52388
|
+
}),
|
|
52389
|
+
...buildRelationTargets({
|
|
52390
|
+
dispatchState: "no_dispatch",
|
|
52391
|
+
relation: "mention",
|
|
52392
|
+
targets: sourceMessageReadProjection.mentionTargets
|
|
52393
|
+
})
|
|
52394
|
+
];
|
|
52298
52395
|
}
|
|
52299
52396
|
function buildRelationTargets(input) {
|
|
52300
52397
|
return input.targets.map((target) => ({
|
|
@@ -58682,7 +58779,10 @@ async function ensureCommandAuthenticationOrCancel(input) {
|
|
|
58682
58779
|
const currentState = getCurrentCommandCheckState();
|
|
58683
58780
|
if (isCurrentCommandCheckScopeActive() && currentState.signIn && currentState.signIn.status === "valid" && currentState.signIn.checkedGatewayUrl === normalizeOptionalString$6(input.gatewayUrl)) return true;
|
|
58684
58781
|
const auth = input.evaluated ?? await evaluateCommandAuthentication({ gatewayUrl: input.gatewayUrl });
|
|
58685
|
-
if (auth.status === "valid" && auth.session)
|
|
58782
|
+
if (auth.status === "valid" && auth.session) {
|
|
58783
|
+
input.onAuthenticatedSession?.(auth.session);
|
|
58784
|
+
return true;
|
|
58785
|
+
}
|
|
58686
58786
|
const canPrompt = input.allowPrompt ?? input.runtime.interactive;
|
|
58687
58787
|
const guidance = resolveAuthenticationGuidance({
|
|
58688
58788
|
reason: auth.status === "mismatch" ? "mismatch" : resolveAuthReason(auth),
|
|
@@ -58735,6 +58835,7 @@ async function ensureCommandAuthenticationOrCancel(input) {
|
|
|
58735
58835
|
cancel("Cancelled.");
|
|
58736
58836
|
return false;
|
|
58737
58837
|
}
|
|
58838
|
+
input.onAuthenticatedSession?.(afterLogin.session);
|
|
58738
58839
|
if (isCurrentCommandCheckScopeActive()) currentState.signIn = {
|
|
58739
58840
|
checkedGatewayUrl: normalizeOptionalString$6(input.gatewayUrl),
|
|
58740
58841
|
status: "valid"
|
|
@@ -59122,7 +59223,7 @@ async function resolveLocalProviderConversationProof(input) {
|
|
|
59122
59223
|
const checkedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
59123
59224
|
const providerId = normalizeKnownBuiltinAgentControllerId(input.profileAgentControllerRef);
|
|
59124
59225
|
const provider = resolveProviderConversationProofProvider(providerId);
|
|
59125
|
-
const agentControllerConversationId = normalizeOptionalText$
|
|
59226
|
+
const agentControllerConversationId = normalizeOptionalText$47(input.agentControllerConversationId);
|
|
59126
59227
|
const base = {
|
|
59127
59228
|
agentControllerConversationId,
|
|
59128
59229
|
checkedAt,
|
|
@@ -59669,7 +59770,7 @@ function sendDispatchPreviewEndFrame(input) {
|
|
|
59669
59770
|
});
|
|
59670
59771
|
}
|
|
59671
59772
|
function resolveDispatchResultPayload(input) {
|
|
59672
|
-
const contextId = normalizeOptionalText$
|
|
59773
|
+
const contextId = normalizeOptionalText$47(input.contextDelta?.agentControllerConversationId) ?? normalizeOptionalText$47(input.existingContextId);
|
|
59673
59774
|
const agentControllerConversation = input.contextDelta?.agentControllerConversation ?? input.contextResolution?.agentControllerConversation ?? input.agentControllerConversationForDispatch;
|
|
59674
59775
|
const effectiveRuntimeWorkingDirectory = normalizeOptionalWorkingDirectory(input.workingDirectory) ?? null;
|
|
59675
59776
|
const runtimeWorkspaceFingerprint = effectiveRuntimeWorkingDirectory ? buildRuntimeWorkspaceFingerprint(effectiveRuntimeWorkingDirectory) : null;
|
|
@@ -59773,7 +59874,7 @@ function buildFailedTaskResultPayload(input) {
|
|
|
59773
59874
|
return payload.data;
|
|
59774
59875
|
}
|
|
59775
59876
|
function sendDaemonFrame$1(inputSocket, input) {
|
|
59776
|
-
inputSocket.send(JSON.stringify(
|
|
59877
|
+
inputSocket.send(JSON.stringify(toCompatibleSpaceAddressingRequestWireValue({
|
|
59777
59878
|
v: 1,
|
|
59778
59879
|
code: input.code,
|
|
59779
59880
|
payload: input.payload
|
|
@@ -60121,10 +60222,10 @@ function parseDispatchTask(input) {
|
|
|
60121
60222
|
payload
|
|
60122
60223
|
});
|
|
60123
60224
|
if (!requiredFields) return null;
|
|
60124
|
-
const mentionSourceProfileId = normalizeOptionalText$
|
|
60225
|
+
const mentionSourceProfileId = normalizeOptionalText$47(payload.sourceSignal.profileId) ?? normalizeOptionalText$47(payload.sourceSignalSnapshot?.profileId);
|
|
60125
60226
|
const mentionSourceProfileKind = payload.sourceSignal.profileKind ?? payload.sourceSignalSnapshot?.profileKind ?? null;
|
|
60126
|
-
const mentionSourceProfileMentionLabel = normalizeOptionalText$
|
|
60127
|
-
const rawPrompt = normalizeOptionalText$
|
|
60227
|
+
const mentionSourceProfileMentionLabel = normalizeOptionalText$47(payload.sourceSignal.profileMentionLabel) ?? normalizeOptionalText$47(payload.sourceSignalSnapshot?.profileMentionLabel);
|
|
60228
|
+
const rawPrompt = normalizeOptionalText$47(payload.sourceSignal.text) ?? normalizeOptionalText$47(payload.sourceSignalSnapshot?.text);
|
|
60128
60229
|
const sourceMessageEnvelope = payload.sourceMessageEnvelope ?? null;
|
|
60129
60230
|
const prompt = resolveDispatchPrompt({
|
|
60130
60231
|
rawPrompt,
|
|
@@ -60144,7 +60245,7 @@ function parseDispatchTask(input) {
|
|
|
60144
60245
|
});
|
|
60145
60246
|
if (!(prompt && controllerSelection)) return null;
|
|
60146
60247
|
const fallbackControllerSettings = createDefaultRuntimeAgentControllerSettings(controllerSelection.agentControllerRef);
|
|
60147
|
-
const agentControllerConversationId = normalizeOptionalText$
|
|
60248
|
+
const agentControllerConversationId = normalizeOptionalText$47(payload.agentControllerConversationId) ?? null;
|
|
60148
60249
|
const deliveryRecoveryReason = resolveDeliveryRecoveryReason(payload);
|
|
60149
60250
|
const executionTokenEcho = resolveExecutionTokenEcho(payload);
|
|
60150
60251
|
if (!executionTokenEcho) return null;
|
|
@@ -60157,7 +60258,7 @@ function parseDispatchTask(input) {
|
|
|
60157
60258
|
...resolveDispatchSourceFiles(payload),
|
|
60158
60259
|
...controllerSelection,
|
|
60159
60260
|
deliveryRecoveryReason,
|
|
60160
|
-
defaultProjectId: normalizeOptionalText$
|
|
60261
|
+
defaultProjectId: normalizeOptionalText$47(payload.defaultProjectId) ?? null,
|
|
60161
60262
|
executionIdentity: payload.executionIdentity,
|
|
60162
60263
|
executionTokenEcho,
|
|
60163
60264
|
mentionSourceProfileId,
|
|
@@ -60177,7 +60278,7 @@ function parseDispatchTask(input) {
|
|
|
60177
60278
|
}),
|
|
60178
60279
|
spaceContractSnapshot: spaceContext.spaceContractSnapshot,
|
|
60179
60280
|
spaceNameSnapshot: spaceContext.spaceNameSnapshot,
|
|
60180
|
-
spacePassword: normalizeOptionalText$
|
|
60281
|
+
spacePassword: normalizeOptionalText$47(payload.spacePassword) ?? null,
|
|
60181
60282
|
sourceMessageEnvelope,
|
|
60182
60283
|
threadContext: spaceContext.threadContext,
|
|
60183
60284
|
streamingMode,
|
|
@@ -60198,16 +60299,16 @@ function resolveDispatchTaskWorkingLanguage(payload) {
|
|
|
60198
60299
|
return payload.workingLanguage ?? null;
|
|
60199
60300
|
}
|
|
60200
60301
|
function resolveDispatchTaskOrganizationProtectedInformation(payload) {
|
|
60201
|
-
return normalizeOptionalText$
|
|
60302
|
+
return normalizeOptionalText$47(payload.organizationProtectedInformation) ?? null;
|
|
60202
60303
|
}
|
|
60203
60304
|
function resolveDispatchTaskTargetProfileDisplayFacts(payload) {
|
|
60204
60305
|
return {
|
|
60205
|
-
targetProfileMentionLabel: normalizeOptionalText$
|
|
60206
|
-
targetProfileName: normalizeOptionalText$
|
|
60306
|
+
targetProfileMentionLabel: normalizeOptionalText$47(payload.targetProfileMentionLabel) ?? null,
|
|
60307
|
+
targetProfileName: normalizeOptionalText$47(payload.targetProfileName) ?? null
|
|
60207
60308
|
};
|
|
60208
60309
|
}
|
|
60209
60310
|
function resolveDispatchPrompt(input) {
|
|
60210
|
-
const prompt = normalizeOptionalText$
|
|
60311
|
+
const prompt = normalizeOptionalText$47(input.rawPrompt);
|
|
60211
60312
|
if (!prompt) return null;
|
|
60212
60313
|
if ((input.sourceMessageEnvelope?.activationTargets.length ?? 0) === 0) return prompt;
|
|
60213
60314
|
const wakeMentionFragments = collectCanonicalMentionTextFragments(prompt).filter((fragment) => fragment.parsedLiteral?.type === "wake");
|
|
@@ -60219,14 +60320,14 @@ function resolveDispatchPrompt(input) {
|
|
|
60219
60320
|
cursor = fragment.end;
|
|
60220
60321
|
}
|
|
60221
60322
|
parts.push(prompt.slice(cursor));
|
|
60222
|
-
return normalizeOptionalText$
|
|
60323
|
+
return normalizeOptionalText$47(parts.join(" ").replace(/\s+/gu, " ")) ?? prompt;
|
|
60223
60324
|
}
|
|
60224
60325
|
function resolveDispatchTaskSpaceContext(payload) {
|
|
60225
60326
|
return {
|
|
60226
60327
|
continuitySnapshot: payload.continuitySnapshot ?? null,
|
|
60227
60328
|
replyToSnapshot: payload.replyToSnapshot ?? null,
|
|
60228
60329
|
spaceContractSnapshot: payload.spaceContractSnapshot ?? null,
|
|
60229
|
-
spaceNameSnapshot: normalizeOptionalText$
|
|
60330
|
+
spaceNameSnapshot: normalizeOptionalText$47(payload.spaceNameSnapshot) ?? null,
|
|
60230
60331
|
threadContext: payload.threadContext ?? null
|
|
60231
60332
|
};
|
|
60232
60333
|
}
|
|
@@ -60241,7 +60342,7 @@ function isRecipientExplicitlyAddressedByActivationTargets(input) {
|
|
|
60241
60342
|
return input.sourceMessageEnvelope?.activationTargets.includes(normalizedTargetProfileId) ?? false;
|
|
60242
60343
|
}
|
|
60243
60344
|
function resolveDeliveryRecoveryReason(payload) {
|
|
60244
|
-
const normalized = normalizeOptionalText$
|
|
60345
|
+
const normalized = normalizeOptionalText$47(payload.deliveryRecoveryReason);
|
|
60245
60346
|
if (normalized === "connection_replaced" || normalized === "route_lost") return normalized;
|
|
60246
60347
|
return null;
|
|
60247
60348
|
}
|
|
@@ -60259,12 +60360,12 @@ function resolveDispatchTaskPayload(request) {
|
|
|
60259
60360
|
return request.payload;
|
|
60260
60361
|
}
|
|
60261
60362
|
function resolveDispatchTaskRequiredFields(input) {
|
|
60262
|
-
const dispatchId = normalizeOptionalText$
|
|
60263
|
-
const attemptId = normalizeOptionalText$
|
|
60264
|
-
const taskId = normalizeOptionalText$
|
|
60265
|
-
const sourceEventId = normalizeOptionalText$
|
|
60266
|
-
const spaceId = normalizeOptionalText$
|
|
60267
|
-
const targetProfileId = normalizeOptionalText$
|
|
60363
|
+
const dispatchId = normalizeOptionalText$47(input.payload.dispatchId) ?? input.deliverRequest.dispatchId;
|
|
60364
|
+
const attemptId = normalizeOptionalText$47(input.payload.attemptId) ?? normalizeOptionalText$47(input.deliverRequest.attemptId);
|
|
60365
|
+
const taskId = normalizeOptionalText$47(input.payload.taskId);
|
|
60366
|
+
const sourceEventId = normalizeOptionalText$47(input.payload.sourceEventId);
|
|
60367
|
+
const spaceId = normalizeOptionalText$47(input.payload.spaceId);
|
|
60368
|
+
const targetProfileId = normalizeOptionalText$47(input.payload.targetProfileId) ?? normalizeOptionalText$47(input.deliverRequest.profileId);
|
|
60268
60369
|
if (!(attemptId && dispatchId && taskId && sourceEventId && spaceId && targetProfileId)) return null;
|
|
60269
60370
|
return {
|
|
60270
60371
|
attemptId,
|
|
@@ -60276,7 +60377,7 @@ function resolveDispatchTaskRequiredFields(input) {
|
|
|
60276
60377
|
};
|
|
60277
60378
|
}
|
|
60278
60379
|
function resolveDispatchTaskControllerSelection(input) {
|
|
60279
|
-
const parsedAgentControllerRef = parseAgentControllerRef(normalizeOptionalText$
|
|
60380
|
+
const parsedAgentControllerRef = parseAgentControllerRef(normalizeOptionalText$47(input.payload.controllerSnapshot.agentControllerRef) ?? input.fallbackAgentControllerRef);
|
|
60280
60381
|
if (!parsedAgentControllerRef) return null;
|
|
60281
60382
|
return { agentControllerRef: parsedAgentControllerRef.ref };
|
|
60282
60383
|
}
|
|
@@ -60332,7 +60433,7 @@ function renderDispatchPrompt(input) {
|
|
|
60332
60433
|
function renderSharedSpaceFilesSection(input) {
|
|
60333
60434
|
const files = input.spaceFiles ?? [];
|
|
60334
60435
|
if (files.length === 0) return null;
|
|
60335
|
-
const cliEntry = normalizeOptionalText$
|
|
60436
|
+
const cliEntry = normalizeOptionalText$47(input.cliEntry) ?? "openmeld";
|
|
60336
60437
|
return [
|
|
60337
60438
|
"Files shared with this message (canonical Space Files):",
|
|
60338
60439
|
...files.map((file) => `- ${JSON.stringify(file.name)} — fileId=${file.fileId}, revision=${file.revision}, type=${file.mimeType}, size=${file.sizeBytes} bytes.`),
|
|
@@ -60415,9 +60516,9 @@ function renderDispatchBriefSection(input) {
|
|
|
60415
60516
|
function buildCurrentWakeContextLines(input) {
|
|
60416
60517
|
const targetProfileIds = (input.sourceMessageEnvelope?.activationTargets ?? []).map((profileId) => profileId.trim()).filter(Boolean);
|
|
60417
60518
|
const targetCount = targetProfileIds.length;
|
|
60418
|
-
const sourceSignalId = normalizeOptionalText$
|
|
60519
|
+
const sourceSignalId = normalizeOptionalText$47(input.sourceSignalId);
|
|
60419
60520
|
if (targetCount <= 1 || !sourceSignalId) return [];
|
|
60420
|
-
const updatesCommand = `${normalizeOptionalText$
|
|
60521
|
+
const updatesCommand = `${normalizeOptionalText$47(input.cliEntry) ?? "openmeld"} space updates ${normalizeOptionalText$47(input.spaceId) ?? "<space-id>"} --after-signal ${sourceSignalId} --view agent --json`;
|
|
60421
60522
|
return [`- Current Wake: ${String(targetCount)} Agent Profiles were activated by this source message, including you. Exact participant profile IDs: ${JSON.stringify(targetProfileIds)}. Activation is not evidence that any Agent has contributed.`, `- Current Wake outcomes: run \`${updatesCommand}\` only if your final reply depends on another participant's current outcome. It reports exact replies, failures, stopped outcomes, and silent outcomes for this source message.`];
|
|
60422
60523
|
}
|
|
60423
60524
|
function renderMandatoryCompletionSection(input) {
|
|
@@ -60441,15 +60542,15 @@ function buildServiceFreshnessWarningLines(input) {
|
|
|
60441
60542
|
return input.serviceFreshnessWarningLines?.filter(Boolean) ?? [];
|
|
60442
60543
|
}
|
|
60443
60544
|
function buildTargetProfileIdentityLine(input) {
|
|
60444
|
-
const profileName = normalizeOptionalText$
|
|
60445
|
-
const role = normalizeOptionalText$
|
|
60545
|
+
const profileName = normalizeOptionalText$47(input.targetProfileName) ?? normalizeOptionalText$47(input.targetProfileMentionLabel) ?? "unknown";
|
|
60546
|
+
const role = normalizeOptionalText$47(input.targetProfileRole);
|
|
60446
60547
|
const identityParts = [profileName, `Profile ID: ${normalizeText$6(input.targetProfileId) || "unknown"}`];
|
|
60447
60548
|
if (role) identityParts.push(`Role: ${role}`);
|
|
60448
60549
|
return identityParts.join(", ");
|
|
60449
60550
|
}
|
|
60450
60551
|
function buildThisSpaceLine(input) {
|
|
60451
|
-
const spaceName = normalizeOptionalText$
|
|
60452
|
-
const spacePurpose = normalizeOptionalText$
|
|
60552
|
+
const spaceName = normalizeOptionalText$47(input.spaceName);
|
|
60553
|
+
const spacePurpose = normalizeOptionalText$47(input.spacePurpose);
|
|
60453
60554
|
if (spaceName && spacePurpose) return `"${spaceName}" — ${spacePurpose}`;
|
|
60454
60555
|
if (spacePurpose) return spacePurpose;
|
|
60455
60556
|
if (spaceName) return `"${spaceName}"`;
|
|
@@ -60477,15 +60578,15 @@ function buildSendTargetReferenceLines(input) {
|
|
|
60477
60578
|
return ["- Send target reference:", ...input.sendTargetReferenceLines.map((line) => ` ${line}`)];
|
|
60478
60579
|
}
|
|
60479
60580
|
function buildSpaceHistoryCommand(input) {
|
|
60480
|
-
const cliEntry = normalizeOptionalText$
|
|
60481
|
-
const normalizedSpaceId = normalizeOptionalText$
|
|
60581
|
+
const cliEntry = normalizeOptionalText$47(input.cliEntry) ?? "openmeld";
|
|
60582
|
+
const normalizedSpaceId = normalizeOptionalText$47(input.spaceId);
|
|
60482
60583
|
return normalizedSpaceId ? `${cliEntry} space history ${normalizedSpaceId} --kind text --limit 20` : `${cliEntry} space history <space-id> --kind text --limit 20`;
|
|
60483
60584
|
}
|
|
60484
60585
|
function buildSpaceThreadCommand(input) {
|
|
60485
|
-
return `${normalizeOptionalText$
|
|
60586
|
+
return `${normalizeOptionalText$47(input.cliEntry) ?? "openmeld"} space thread ${normalizeOptionalText$47(input.spaceId) ?? "<space-id>"} ${input.threadId} --view agent`;
|
|
60486
60587
|
}
|
|
60487
60588
|
function buildSpaceContextWindowCommand(input) {
|
|
60488
|
-
return `${normalizeOptionalText$
|
|
60589
|
+
return `${normalizeOptionalText$47(input.cliEntry) ?? "openmeld"} space history ${input.spaceId} --around-signal ${input.sourceSignalId} --before 20 --after 0 --kind text`;
|
|
60489
60590
|
}
|
|
60490
60591
|
function buildProgressiveContextGuidanceLines(input) {
|
|
60491
60592
|
const lines = [];
|
|
@@ -60497,9 +60598,9 @@ function buildProgressiveContextGuidanceLines(input) {
|
|
|
60497
60598
|
return lines;
|
|
60498
60599
|
}
|
|
60499
60600
|
function buildActivatedByLine(input) {
|
|
60500
|
-
const mentionSourceProfileName = normalizeOptionalText$
|
|
60601
|
+
const mentionSourceProfileName = normalizeOptionalText$47(input.mentionSourceProfileName);
|
|
60501
60602
|
if (mentionSourceProfileName) return mentionSourceProfileName;
|
|
60502
|
-
const mentionSourceProfileId = normalizeOptionalText$
|
|
60603
|
+
const mentionSourceProfileId = normalizeOptionalText$47(input.mentionSourceProfileId);
|
|
60503
60604
|
if (mentionSourceProfileId) return mentionSourceProfileId;
|
|
60504
60605
|
return "system";
|
|
60505
60606
|
}
|
|
@@ -60529,7 +60630,7 @@ function renderContinuityLine(input) {
|
|
|
60529
60630
|
if (input.messagesSinceThen > 0) parts.push(`${String(input.messagesSinceThen)} new ${input.messagesSinceThen === 1 ? "message" : "messages"}`);
|
|
60530
60631
|
if (input.higherAuthorityUpdates) parts.push("higher-authority updates: yes");
|
|
60531
60632
|
if (parts.length === 0) return null;
|
|
60532
|
-
const sourceSignalId = normalizeOptionalText$
|
|
60633
|
+
const sourceSignalId = normalizeOptionalText$47(input.sourceSignalId);
|
|
60533
60634
|
if (!sourceSignalId) return `- Since your last public reply: ${parts.join("; ")} (run \`${buildSpaceHistoryCommand(input)}\` for content)`;
|
|
60534
60635
|
const readCommand = buildSpaceContextWindowCommand({
|
|
60535
60636
|
cliEntry: input.cliEntry,
|
|
@@ -60539,7 +60640,7 @@ function renderContinuityLine(input) {
|
|
|
60539
60640
|
return `- Since your last public reply: ${parts.join("; ")} (run \`${readCommand}\` for bounded context)`;
|
|
60540
60641
|
}
|
|
60541
60642
|
function shouldRenderReplyTargetLine(replyTarget) {
|
|
60542
|
-
return normalizeOptionalText$
|
|
60643
|
+
return normalizeOptionalText$47(replyTarget) !== "the current source message";
|
|
60543
60644
|
}
|
|
60544
60645
|
function collapseWhitespace(value, maxLength) {
|
|
60545
60646
|
const normalized = normalizeText$6(value).replace(/\s+/gu, " ");
|
|
@@ -60559,11 +60660,11 @@ async function resolveBootstrapSpaceOwnerProfileId(input) {
|
|
|
60559
60660
|
const spaceFacts = projectSpaceFacts(spaceConfigResult.value);
|
|
60560
60661
|
if (!spaceFacts.creator || typeof spaceFacts.creator !== "object") return null;
|
|
60561
60662
|
const creator = spaceFacts.creator;
|
|
60562
|
-
return normalizeOptionalText$
|
|
60663
|
+
return normalizeOptionalText$47(typeof creator.profile === "string" ? creator.profile : creator.profileId) ?? null;
|
|
60563
60664
|
}
|
|
60564
60665
|
async function resolveBootstrapTargetProfileContext(input) {
|
|
60565
|
-
const preferredMentionLabel = normalizeOptionalText$
|
|
60566
|
-
const preferredProfileName = normalizeOptionalText$
|
|
60666
|
+
const preferredMentionLabel = normalizeOptionalText$47(input.preferredMentionLabel) ?? null;
|
|
60667
|
+
const preferredProfileName = normalizeOptionalText$47(input.preferredProfileName) ?? null;
|
|
60567
60668
|
const targetSpaceConfigResult = await readSpaceConfig({
|
|
60568
60669
|
openMeldProfileId: input.targetProfileId,
|
|
60569
60670
|
space: input.spaceId
|
|
@@ -60573,9 +60674,9 @@ async function resolveBootstrapTargetProfileContext(input) {
|
|
|
60573
60674
|
result: targetSpaceConfigResult
|
|
60574
60675
|
});
|
|
60575
60676
|
const targetProfileCache = targetSpaceConfigResult.kind === "ok" ? projectSpaceProfileCache(targetSpaceConfigResult.value) : null;
|
|
60576
|
-
const spaceProfileName = normalizeOptionalText$
|
|
60577
|
-
const spaceMentionAlias = normalizeOptionalText$
|
|
60578
|
-
const spaceRole = normalizeOptionalText$
|
|
60677
|
+
const spaceProfileName = normalizeOptionalText$47(targetProfileCache?.profileName) ?? null;
|
|
60678
|
+
const spaceMentionAlias = normalizeOptionalText$47(targetProfileCache?.mentionAlias) ?? null;
|
|
60679
|
+
const spaceRole = normalizeOptionalText$47(targetProfileCache?.role) ?? null;
|
|
60579
60680
|
const targetProfileName = spaceProfileName ?? preferredProfileName;
|
|
60580
60681
|
if (spaceProfileName || spaceMentionAlias) return {
|
|
60581
60682
|
targetProfileMentionLabel: preferredMentionLabel ?? resolvePrimaryMentionLabel({
|
|
@@ -60601,7 +60702,7 @@ async function resolveDispatchMentionSourceContext(input) {
|
|
|
60601
60702
|
mentionSourceProfileName: null,
|
|
60602
60703
|
mentionSourceMentionLabel: null
|
|
60603
60704
|
};
|
|
60604
|
-
const preferredMentionLabel = normalizeOptionalText$
|
|
60705
|
+
const preferredMentionLabel = normalizeOptionalText$47(input.preferredMentionLabel) ?? null;
|
|
60605
60706
|
const sourceSpaceConfigResult = await readSpaceConfig({
|
|
60606
60707
|
openMeldProfileId: input.mentionSourceProfileId,
|
|
60607
60708
|
space: input.spaceId
|
|
@@ -60611,14 +60712,14 @@ async function resolveDispatchMentionSourceContext(input) {
|
|
|
60611
60712
|
result: sourceSpaceConfigResult
|
|
60612
60713
|
});
|
|
60613
60714
|
const sourceProfileCache = sourceSpaceConfigResult.kind === "ok" ? projectSpaceProfileCache(sourceSpaceConfigResult.value) : null;
|
|
60614
|
-
const sourceProfileHandle = normalizeOptionalText$
|
|
60615
|
-
const sourceMentionAlias = normalizeOptionalText$
|
|
60715
|
+
const sourceProfileHandle = normalizeOptionalText$47(sourceProfileCache?.profileHandle) ?? null;
|
|
60716
|
+
const sourceMentionAlias = normalizeOptionalText$47(sourceProfileCache?.mentionAlias) ?? null;
|
|
60616
60717
|
if (sourceMentionAlias || sourceProfileCache?.profileName || sourceProfileHandle) return {
|
|
60617
|
-
mentionSourceProfileName: normalizeOptionalText$
|
|
60718
|
+
mentionSourceProfileName: normalizeOptionalText$47(sourceProfileCache?.profileName) ?? null,
|
|
60618
60719
|
mentionSourceMentionLabel: preferredMentionLabel ?? resolvePrimaryMentionLabel({
|
|
60619
60720
|
mentionAlias: sourceMentionAlias,
|
|
60620
60721
|
profileId: input.mentionSourceProfileId,
|
|
60621
|
-
profileName: normalizeOptionalText$
|
|
60722
|
+
profileName: normalizeOptionalText$47(sourceProfileCache?.profileName) ?? null
|
|
60622
60723
|
})
|
|
60623
60724
|
};
|
|
60624
60725
|
return {
|
|
@@ -60640,12 +60741,12 @@ function resolvePrimaryMentionLabel(input) {
|
|
|
60640
60741
|
function buildDispatchCorrelation(input) {
|
|
60641
60742
|
const payload = input.deliverRequest.payload;
|
|
60642
60743
|
return {
|
|
60643
|
-
attemptId: input.parsedTask?.attemptId ?? normalizeOptionalText$
|
|
60644
|
-
agentControllerRef: input.parsedTask?.agentControllerRef ?? normalizeOptionalText$
|
|
60645
|
-
dispatchId: input.parsedTask?.dispatchId ?? normalizeOptionalText$
|
|
60646
|
-
sourceEventId: input.parsedTask?.sourceEventId ?? normalizeOptionalText$
|
|
60647
|
-
targetProfileId: input.parsedTask?.targetProfileId ?? normalizeOptionalText$
|
|
60648
|
-
taskId: input.parsedTask?.taskId ?? normalizeOptionalText$
|
|
60744
|
+
attemptId: input.parsedTask?.attemptId ?? normalizeOptionalText$47(payload.attemptId) ?? normalizeOptionalText$47(input.deliverRequest.attemptId) ?? "unknown-attempt",
|
|
60745
|
+
agentControllerRef: input.parsedTask?.agentControllerRef ?? normalizeOptionalText$47(payload.controllerSnapshot.agentControllerRef),
|
|
60746
|
+
dispatchId: input.parsedTask?.dispatchId ?? normalizeOptionalText$47(payload.dispatchId) ?? input.deliverRequest.dispatchId,
|
|
60747
|
+
sourceEventId: input.parsedTask?.sourceEventId ?? normalizeOptionalText$47(payload.sourceEventId) ?? "unknown-source-event",
|
|
60748
|
+
targetProfileId: input.parsedTask?.targetProfileId ?? normalizeOptionalText$47(payload.targetProfileId) ?? input.deliverRequest.profileId,
|
|
60749
|
+
taskId: input.parsedTask?.taskId ?? normalizeOptionalText$47(payload.taskId) ?? "unknown-task"
|
|
60649
60750
|
};
|
|
60650
60751
|
}
|
|
60651
60752
|
//#endregion
|
|
@@ -62267,8 +62368,8 @@ async function loadContextStore(contextStorePath) {
|
|
|
62267
62368
|
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return /* @__PURE__ */ new Map();
|
|
62268
62369
|
const contextStore = /* @__PURE__ */ new Map();
|
|
62269
62370
|
for (const [key, value] of Object.entries(parsed)) {
|
|
62270
|
-
const normalizedKey = normalizeOptionalText$
|
|
62271
|
-
const normalizedValue = normalizeOptionalText$
|
|
62371
|
+
const normalizedKey = normalizeOptionalText$47(key);
|
|
62372
|
+
const normalizedValue = normalizeOptionalText$47(value);
|
|
62272
62373
|
if (!(normalizedKey && normalizedValue)) continue;
|
|
62273
62374
|
contextStore.set(normalizedKey, normalizedValue);
|
|
62274
62375
|
}
|
|
@@ -66949,7 +67050,7 @@ function renderDaemonStartNeedsAttention(input) {
|
|
|
66949
67050
|
//#region src/local-components/manifest.ts
|
|
66950
67051
|
const OPENMELD_CLI_COMMAND_CONTRACT_VERSION = "openmeld-cli-command-contract-2026-05-local-components-v1";
|
|
66951
67052
|
const OPENMELD_SKILLS_CONTRACT_VERSION = "openmeld-skills-contract-2026-08-tool-owned-actions-v2";
|
|
66952
|
-
const OPENMELD_SERVICE_CONTRACT_VERSION = "openmeld-service-contract-2026-
|
|
67053
|
+
const OPENMELD_SERVICE_CONTRACT_VERSION = "openmeld-service-contract-2026-09-codex-thread-model-v1";
|
|
66953
67054
|
const LOCAL_COMPONENTS_SNAPSHOT_FILE = "local-components.json";
|
|
66954
67055
|
const SERVICE_COMPONENT_UPDATE_CODES = /* @__PURE__ */ new Set([
|
|
66955
67056
|
"version_outdated",
|
|
@@ -69328,11 +69429,14 @@ async function fetchSpaceUpdates(input) {
|
|
|
69328
69429
|
const raw = await readGatewayTextResponse({ response: await fetchSpaceRequestWithTimeout({
|
|
69329
69430
|
url: endpoint.toString(),
|
|
69330
69431
|
operation: "space.updates.read",
|
|
69331
|
-
init: { headers:
|
|
69332
|
-
|
|
69333
|
-
|
|
69334
|
-
|
|
69335
|
-
|
|
69432
|
+
init: { headers: {
|
|
69433
|
+
...await buildOpenMeldRequestContextHeadersWithAuth({
|
|
69434
|
+
requestUrl: endpoint.toString(),
|
|
69435
|
+
requestContext: input.requestContext,
|
|
69436
|
+
spacePassword: input.password
|
|
69437
|
+
}),
|
|
69438
|
+
[OPENMELD_HEADER_SPACE_ADDRESSING_VERSION]: "1"
|
|
69439
|
+
} }
|
|
69336
69440
|
}) });
|
|
69337
69441
|
const parsed = getSpaceUpdatesResponseSchema.safeParse(parseJsonResponse$1(raw));
|
|
69338
69442
|
if (!parsed.success) throw new Error("invalid space updates response");
|
|
@@ -70040,6 +70144,18 @@ function emitProviderRuntimePhaseLine(input) {
|
|
|
70040
70144
|
}
|
|
70041
70145
|
});
|
|
70042
70146
|
return;
|
|
70147
|
+
case "provider_turn_accepted":
|
|
70148
|
+
emitRunLine({
|
|
70149
|
+
presenter: input.presenter,
|
|
70150
|
+
code: "daemon.run.provider_turn_accepted",
|
|
70151
|
+
text: `provider turn accepted for task ${input.taskId}`,
|
|
70152
|
+
payload: {
|
|
70153
|
+
...basePayload,
|
|
70154
|
+
agentControllerConversationId: input.event.agentControllerConversationId,
|
|
70155
|
+
turnId: input.event.turnId
|
|
70156
|
+
}
|
|
70157
|
+
});
|
|
70158
|
+
return;
|
|
70043
70159
|
case "provider_usage_limits_observed":
|
|
70044
70160
|
emitRunLine({
|
|
70045
70161
|
presenter: input.presenter,
|
|
@@ -70213,7 +70329,7 @@ function buildStructuredActionRepairPrompt$1(input) {
|
|
|
70213
70329
|
"Call exactly one dispatch-scoped OpenMeld Space Action tool now.",
|
|
70214
70330
|
publicationRequirement.repairRequirementLine,
|
|
70215
70331
|
...SPACE_ACTION_TARGET_GUIDANCE_LINES,
|
|
70216
|
-
...normalizeOptionalText$
|
|
70332
|
+
...normalizeOptionalText$47(input.currentReplyToSignalId) ? [`post_message.messageEnvelope.replyToSignalId must match the current dispatch reply target: ${normalizeOptionalText$47(input.currentReplyToSignalId)}.`] : [],
|
|
70217
70333
|
...publicationRequirement.actionGuidanceLines,
|
|
70218
70334
|
...buildStructuredActionRepairSendTargetReferenceLines(input.sendTargetReferenceLines),
|
|
70219
70335
|
"Use the official `openmeld-cli` skill for future OpenMeld work.",
|
|
@@ -70229,7 +70345,7 @@ function buildStructuredActionRepairCompletionLines(input) {
|
|
|
70229
70345
|
}
|
|
70230
70346
|
const REPAIR_OUTPUT_PREVIEW_MAX_CHARS = 1200;
|
|
70231
70347
|
function buildBoundedRepairOutputPreview(value) {
|
|
70232
|
-
const normalized = normalizeOptionalText$
|
|
70348
|
+
const normalized = normalizeOptionalText$47(value);
|
|
70233
70349
|
if (!normalized) return null;
|
|
70234
70350
|
if (normalized.length <= REPAIR_OUTPUT_PREVIEW_MAX_CHARS) return normalized;
|
|
70235
70351
|
return `${normalized.slice(0, REPAIR_OUTPUT_PREVIEW_MAX_CHARS).trimEnd()}\n[truncated; reuse the complete answer already in this conversation]`;
|
|
@@ -70247,7 +70363,7 @@ function buildStructuredActionRepairSendTargetReferenceLines(sendTargetReference
|
|
|
70247
70363
|
function resolveStructuredActionRepairPreviousOutput(runtimeResult) {
|
|
70248
70364
|
const payload = runtimeResult.resultPayload;
|
|
70249
70365
|
if (payload.status !== "success" && payload.status !== "partial_success") return null;
|
|
70250
|
-
return normalizeOptionalText$
|
|
70366
|
+
return normalizeOptionalText$47(payload.output);
|
|
70251
70367
|
}
|
|
70252
70368
|
function resolveStructuredActionRepairContinuation$1(input) {
|
|
70253
70369
|
const contextDelta = resolveDispatchContextDeltaFromRuntimeResult(input.runtimeResult.dispatchResult);
|
|
@@ -70259,7 +70375,7 @@ function resolveStructuredActionRepairContinuation$1(input) {
|
|
|
70259
70375
|
function buildInvalidStructuredActionOutputPreview(runtimeResult) {
|
|
70260
70376
|
const payload = runtimeResult.resultPayload;
|
|
70261
70377
|
if (payload.status !== "success" && payload.status !== "partial_success") return null;
|
|
70262
|
-
const normalizedOutput = normalizeOptionalText$
|
|
70378
|
+
const normalizedOutput = normalizeOptionalText$47(payload.output);
|
|
70263
70379
|
if (!normalizedOutput) return null;
|
|
70264
70380
|
if (normalizedOutput.length <= 180) return normalizedOutput;
|
|
70265
70381
|
return `${normalizedOutput.slice(0, 177).trimEnd()}...`;
|
|
@@ -70268,7 +70384,7 @@ function coerceRuntimeResultToStructuredActionFailure$1(input) {
|
|
|
70268
70384
|
const payload = input.runtimeResult.resultPayload;
|
|
70269
70385
|
const normalizedDiagnostics = input.diagnostics ? {
|
|
70270
70386
|
...input.diagnostics,
|
|
70271
|
-
publicFailureReason: input.diagnostics.publicFailureReason ?? normalizeOptionalText$
|
|
70387
|
+
publicFailureReason: input.diagnostics.publicFailureReason ?? normalizeOptionalText$47(input.failureReason)
|
|
70272
70388
|
} : null;
|
|
70273
70389
|
const normalizedPayload = openMeldDaemonTaskResultPayloadSchema.safeParse({
|
|
70274
70390
|
status: "failed",
|
|
@@ -70416,6 +70532,7 @@ function formatAllowedRelations(target) {
|
|
|
70416
70532
|
const relations = [];
|
|
70417
70533
|
if (target.allowedRelations.wake) relations.push("wake");
|
|
70418
70534
|
if (target.allowedRelations.reference) relations.push("reference");
|
|
70535
|
+
if (target.allowedRelations.mention) relations.push("mention");
|
|
70419
70536
|
return relations.join(" | ");
|
|
70420
70537
|
}
|
|
70421
70538
|
function normalizeTargetProfileName(value) {
|
|
@@ -70819,21 +70936,21 @@ function resolveInvalidDeliverRequestIdentity(input) {
|
|
|
70819
70936
|
const taskPayload = toRecord(input.payload.payload);
|
|
70820
70937
|
const controllerSnapshot = toRecord(taskPayload?.controllerSnapshot);
|
|
70821
70938
|
const executionIdentity = runtimeTransportDeliveryExecutionIdentitySchema.safeParse(taskPayload?.executionIdentity);
|
|
70822
|
-
const attemptId = normalizeOptionalText$
|
|
70939
|
+
const attemptId = normalizeOptionalText$47(input.payload.attemptId) ?? normalizeOptionalText$47(taskPayload?.attemptId);
|
|
70823
70940
|
const connectionGeneration = normalizePositiveInteger(input.payload.connectionGeneration);
|
|
70824
|
-
const daemonSessionId = normalizeOptionalText$
|
|
70825
|
-
const dispatchId = normalizeOptionalText$
|
|
70941
|
+
const daemonSessionId = normalizeOptionalText$47(input.payload.daemonSessionId) ?? input.fallbackDaemonSessionId;
|
|
70942
|
+
const dispatchId = normalizeOptionalText$47(input.payload.dispatchId) ?? normalizeOptionalText$47(taskPayload?.dispatchId);
|
|
70826
70943
|
const leaseEpoch = normalizePositiveInteger(input.payload.leaseEpoch);
|
|
70827
|
-
const sourceEventId = normalizeOptionalText$
|
|
70828
|
-
const targetProfileId = normalizeOptionalText$
|
|
70829
|
-
const taskId = normalizeOptionalText$
|
|
70830
|
-
const runtimeCoordinatorExecutionId = normalizeOptionalText$
|
|
70944
|
+
const sourceEventId = normalizeOptionalText$47(taskPayload?.sourceEventId);
|
|
70945
|
+
const targetProfileId = normalizeOptionalText$47(taskPayload?.targetProfileId) ?? normalizeOptionalText$47(input.payload.profileId);
|
|
70946
|
+
const taskId = normalizeOptionalText$47(taskPayload?.taskId);
|
|
70947
|
+
const runtimeCoordinatorExecutionId = normalizeOptionalText$47(taskPayload?.runtimeCoordinatorExecutionId);
|
|
70831
70948
|
const executionTokenEcho = resolveRuntimeCoordinatorExecutionTokenEchoFromRaw(taskPayload?.executionToken);
|
|
70832
70949
|
if (!(attemptId && connectionGeneration && daemonSessionId && dispatchId && executionIdentity.success && leaseEpoch && sourceEventId && targetProfileId && taskId)) return null;
|
|
70833
70950
|
return {
|
|
70834
70951
|
attemptId,
|
|
70835
70952
|
connectionGeneration,
|
|
70836
|
-
agentControllerRef: normalizeOptionalText$
|
|
70953
|
+
agentControllerRef: normalizeOptionalText$47(controllerSnapshot?.agentControllerRef) ?? null,
|
|
70837
70954
|
daemonSessionId,
|
|
70838
70955
|
dispatchId,
|
|
70839
70956
|
executionIdentityEcho: toRuntimeTransportResultIdentityEchoFromDeliveryIdentity(executionIdentity.data),
|
|
@@ -70967,7 +71084,9 @@ async function handleDispatchDeliverFrame(input) {
|
|
|
70967
71084
|
let runtimePromptPlan = null;
|
|
70968
71085
|
let runtimePromptTrace = null;
|
|
70969
71086
|
let settledResultSummary = null;
|
|
70970
|
-
|
|
71087
|
+
const providerAdmissionOwnsRunningLifecycle = resolveBuiltinAgentControllerDefinition(runtimeControllerSupport.runtimeAdapterMatch.agentId)?.conversationOccupancy.mode === "official_atomic_admission_and_release_signal";
|
|
71088
|
+
let runtimeLifecyclePhase = resolveInitialDispatchLifecyclePhase({ providerAdmissionOwnsRunningLifecycle });
|
|
71089
|
+
const lifecycleKeepalive = { stop: null };
|
|
70971
71090
|
let firstOutputEvidenceSent = false;
|
|
70972
71091
|
input.inflightTaskControlRegistry.registerTask({
|
|
70973
71092
|
adapterId: runtimeControllerSupport.runtimeAdapterMatch.adapterId,
|
|
@@ -71195,32 +71314,39 @@ async function handleDispatchDeliverFrame(input) {
|
|
|
71195
71314
|
phase: "runtime_started",
|
|
71196
71315
|
presenter: input.presenter
|
|
71197
71316
|
});
|
|
71198
|
-
|
|
71199
|
-
|
|
71200
|
-
|
|
71201
|
-
|
|
71202
|
-
|
|
71203
|
-
|
|
71204
|
-
|
|
71205
|
-
|
|
71206
|
-
|
|
71207
|
-
|
|
71208
|
-
|
|
71209
|
-
|
|
71210
|
-
|
|
71211
|
-
|
|
71212
|
-
|
|
71213
|
-
|
|
71214
|
-
|
|
71215
|
-
|
|
71216
|
-
|
|
71217
|
-
|
|
71218
|
-
|
|
71219
|
-
|
|
71220
|
-
|
|
71221
|
-
|
|
71222
|
-
|
|
71223
|
-
|
|
71317
|
+
const transitionDispatchLifecycle = (inputLifecycle) => {
|
|
71318
|
+
runtimeLifecyclePhase = inputLifecycle.phase;
|
|
71319
|
+
lifecycleKeepalive.stop?.();
|
|
71320
|
+
emitDispatchLifecycleTransition({
|
|
71321
|
+
agentControllerConversationOccupancy: inputLifecycle.agentControllerConversationOccupancy ?? null,
|
|
71322
|
+
attemptId: parsedTask.attemptId,
|
|
71323
|
+
connectionGeneration: input.deliverRequest.connectionGeneration,
|
|
71324
|
+
currentSocketRef,
|
|
71325
|
+
daemonSessionId: input.daemonSessionId,
|
|
71326
|
+
dispatchId: parsedTask.dispatchId,
|
|
71327
|
+
leaseEpoch: input.deliverRequest.leaseEpoch,
|
|
71328
|
+
phase: runtimeLifecyclePhase,
|
|
71329
|
+
presenter: input.presenter,
|
|
71330
|
+
executionTokenEcho: parsedTask.executionTokenEcho,
|
|
71331
|
+
runtimeCoordinatorExecutionId: parsedTask.runtimeCoordinatorExecutionId,
|
|
71332
|
+
taskId: parsedTask.taskId
|
|
71333
|
+
});
|
|
71334
|
+
lifecycleKeepalive.stop = startDispatchLifecycleKeepalive({
|
|
71335
|
+
agentControllerConversationOccupancy: inputLifecycle.agentControllerConversationOccupancy ?? null,
|
|
71336
|
+
attemptId: parsedTask.attemptId,
|
|
71337
|
+
connectionGeneration: input.deliverRequest.connectionGeneration,
|
|
71338
|
+
currentSocketRef,
|
|
71339
|
+
daemonSessionId: input.daemonSessionId,
|
|
71340
|
+
dispatchId: parsedTask.dispatchId,
|
|
71341
|
+
leaseEpoch: input.deliverRequest.leaseEpoch,
|
|
71342
|
+
phase: runtimeLifecyclePhase,
|
|
71343
|
+
presenter: input.presenter,
|
|
71344
|
+
executionTokenEcho: parsedTask.executionTokenEcho,
|
|
71345
|
+
runtimeCoordinatorExecutionId: parsedTask.runtimeCoordinatorExecutionId,
|
|
71346
|
+
taskId: parsedTask.taskId
|
|
71347
|
+
});
|
|
71348
|
+
};
|
|
71349
|
+
transitionDispatchLifecycle({ phase: runtimeLifecyclePhase });
|
|
71224
71350
|
emitDispatchLocalPhaseJournalEvent({
|
|
71225
71351
|
deliverRequest: input.deliverRequest,
|
|
71226
71352
|
metadata: {
|
|
@@ -71312,34 +71438,23 @@ async function handleDispatchDeliverFrame(input) {
|
|
|
71312
71438
|
contractVersion: event.contractVersion,
|
|
71313
71439
|
state: event.phase === "agent_controller_conversation_occupied" ? "occupied" : "available"
|
|
71314
71440
|
};
|
|
71315
|
-
|
|
71316
|
-
emitDispatchLifecycleTransition({
|
|
71441
|
+
transitionDispatchLifecycle({
|
|
71317
71442
|
agentControllerConversationOccupancy: occupancy,
|
|
71318
|
-
|
|
71319
|
-
connectionGeneration: input.deliverRequest.connectionGeneration,
|
|
71320
|
-
currentSocketRef,
|
|
71321
|
-
daemonSessionId: input.daemonSessionId,
|
|
71322
|
-
dispatchId: parsedTask.dispatchId,
|
|
71323
|
-
leaseEpoch: input.deliverRequest.leaseEpoch,
|
|
71324
|
-
phase: "running",
|
|
71325
|
-
presenter: input.presenter,
|
|
71326
|
-
executionTokenEcho: parsedTask.executionTokenEcho,
|
|
71327
|
-
runtimeCoordinatorExecutionId: parsedTask.runtimeCoordinatorExecutionId,
|
|
71328
|
-
taskId: parsedTask.taskId
|
|
71443
|
+
phase: runtimeLifecyclePhase
|
|
71329
71444
|
});
|
|
71330
|
-
|
|
71331
|
-
|
|
71332
|
-
|
|
71333
|
-
|
|
71334
|
-
|
|
71335
|
-
|
|
71336
|
-
|
|
71337
|
-
|
|
71338
|
-
|
|
71339
|
-
|
|
71340
|
-
|
|
71341
|
-
|
|
71342
|
-
|
|
71445
|
+
};
|
|
71446
|
+
const syncProviderTurnAcceptedLifecycle = (event) => {
|
|
71447
|
+
if (event.phase !== "provider_turn_accepted") return;
|
|
71448
|
+
if (providerAdmissionOwnsRunningLifecycle && runtimeLifecyclePhase !== "running") transitionDispatchLifecycle({ phase: "running" });
|
|
71449
|
+
emitDispatchLocalPhaseJournalEvent({
|
|
71450
|
+
deliverRequest: input.deliverRequest,
|
|
71451
|
+
metadata: {
|
|
71452
|
+
agentControllerConversationId: event.agentControllerConversationId,
|
|
71453
|
+
turnId: event.turnId
|
|
71454
|
+
},
|
|
71455
|
+
parsedTask,
|
|
71456
|
+
phase: "provider_turn_accepted",
|
|
71457
|
+
result: "accepted"
|
|
71343
71458
|
});
|
|
71344
71459
|
};
|
|
71345
71460
|
const runtimeExecutionPromise = Promise.resolve(runDispatchRuntimeExecution({
|
|
@@ -71364,6 +71479,7 @@ async function handleDispatchDeliverFrame(input) {
|
|
|
71364
71479
|
},
|
|
71365
71480
|
onRuntimeEvent: (event) => {
|
|
71366
71481
|
syncAgentControllerConversationOccupancyLifecycle(event);
|
|
71482
|
+
syncProviderTurnAcceptedLifecycle(event);
|
|
71367
71483
|
if (event.phase === "tool_activity") {
|
|
71368
71484
|
agentToolActivitySequence += 1;
|
|
71369
71485
|
emitDispatchAgentToolActivityFrame({
|
|
@@ -71761,8 +71877,8 @@ async function handleDispatchDeliverFrame(input) {
|
|
|
71761
71877
|
}
|
|
71762
71878
|
});
|
|
71763
71879
|
} finally {
|
|
71764
|
-
|
|
71765
|
-
|
|
71880
|
+
lifecycleKeepalive.stop?.();
|
|
71881
|
+
lifecycleKeepalive.stop = null;
|
|
71766
71882
|
input.inflightDispatchMetaByTaskId.delete(parsedTask.taskId);
|
|
71767
71883
|
input.inflightTaskControlRegistry.removeTask(parsedTask.taskId);
|
|
71768
71884
|
pendingAgentInteractionRegistry.removeTask(parsedTask.taskId);
|
|
@@ -72094,9 +72210,9 @@ async function resolveDispatchSpaceMetaContext(input) {
|
|
|
72094
72210
|
});
|
|
72095
72211
|
return {
|
|
72096
72212
|
status: "loaded",
|
|
72097
|
-
spaceGuide: normalizeOptionalText$
|
|
72098
|
-
spaceName: normalizeOptionalText$
|
|
72099
|
-
spacePurpose: normalizeOptionalText$
|
|
72213
|
+
spaceGuide: normalizeOptionalText$47(meta.guide),
|
|
72214
|
+
spaceName: normalizeOptionalText$47(meta.name),
|
|
72215
|
+
spacePurpose: normalizeOptionalText$47(meta.purpose)
|
|
72100
72216
|
};
|
|
72101
72217
|
} catch (error) {
|
|
72102
72218
|
return {
|
|
@@ -72754,7 +72870,7 @@ async function coordinateConcurrentAgentReply(input) {
|
|
|
72754
72870
|
};
|
|
72755
72871
|
}
|
|
72756
72872
|
};
|
|
72757
|
-
const observation = await readObservation(normalizeOptionalText$
|
|
72873
|
+
const observation = await readObservation(normalizeOptionalText$47(input.agentReplyObservationCursor) ?? input.parsedTask.sourceEventId);
|
|
72758
72874
|
const coordinated = await coordinateDispatchAgentReply({
|
|
72759
72875
|
action: input.resolvedSpaceAction,
|
|
72760
72876
|
currentValue: {
|
|
@@ -72924,6 +73040,7 @@ function normalizeResolvedPostMessageAction(input) {
|
|
|
72924
73040
|
failureReason,
|
|
72925
73041
|
inputKind: "direct_payload",
|
|
72926
73042
|
memberDirectoryLoaded: input.sendTargetReference.status === "loaded",
|
|
73043
|
+
mentionTargetsCount: action.messageEnvelope.mentionTargets?.length ?? 0,
|
|
72927
73044
|
referenceTargetsCount: action.messageEnvelope.referenceTargets.length,
|
|
72928
73045
|
replyToSignalIdResolved: Boolean(action.messageEnvelope.replyToSignalId),
|
|
72929
73046
|
targetProfileId: input.parsedTask.targetProfileId,
|
|
@@ -73155,10 +73272,10 @@ function resolveStructuredActionFailureDiagnostics(input) {
|
|
|
73155
73272
|
return {
|
|
73156
73273
|
carrierKind: input.carrierKind,
|
|
73157
73274
|
invalidOutputPreview: buildInvalidStructuredActionOutputPreview(input.runtimeResult),
|
|
73158
|
-
publicFailureReason: normalizeOptionalText$
|
|
73275
|
+
publicFailureReason: normalizeOptionalText$47(input.publicFailureReason),
|
|
73159
73276
|
repairMode: input.repairMode,
|
|
73160
73277
|
spaceActionCandidatePresent: input.carrierKind !== "none",
|
|
73161
|
-
spaceActionParseError: normalizeOptionalText$
|
|
73278
|
+
spaceActionParseError: normalizeOptionalText$47(input.parseError)
|
|
73162
73279
|
};
|
|
73163
73280
|
}
|
|
73164
73281
|
function maybeRejectDispatchPreflight(input) {
|
|
@@ -73580,7 +73697,7 @@ async function settleAgentReplyProposals(input) {
|
|
|
73580
73697
|
message: `OpenMeld rejected the Agent reply proposal: ${settlement.reasonCode}`
|
|
73581
73698
|
});
|
|
73582
73699
|
const observedThroughSignalId = resultPayload.spaceAction?.type === "post_message" ? resultPayload.spaceAction.observedThroughSignalId : null;
|
|
73583
|
-
resultPayload = await input.reconsider(normalizeOptionalText$
|
|
73700
|
+
resultPayload = await input.reconsider(normalizeOptionalText$47(observedThroughSignalId) ?? resultPayload.sourceEventId);
|
|
73584
73701
|
}
|
|
73585
73702
|
return {
|
|
73586
73703
|
resultPayload,
|
|
@@ -73843,7 +73960,7 @@ function resolveRuntimeEvidenceResultPhase(payload) {
|
|
|
73843
73960
|
}
|
|
73844
73961
|
function resolveRuntimeEvidenceResultReasonCode(payload) {
|
|
73845
73962
|
if (payload.status !== "failed") return null;
|
|
73846
|
-
return normalizeOptionalText$
|
|
73963
|
+
return normalizeOptionalText$47(payload.errorCode) ?? null;
|
|
73847
73964
|
}
|
|
73848
73965
|
function toRuntimeTransportDispatchLocalQueueDiagnostics(input) {
|
|
73849
73966
|
return {
|
|
@@ -73931,6 +74048,9 @@ function emitDispatchLifecycleTransition(input) {
|
|
|
73931
74048
|
}
|
|
73932
74049
|
});
|
|
73933
74050
|
}
|
|
74051
|
+
function resolveInitialDispatchLifecyclePhase(input) {
|
|
74052
|
+
return input.providerAdmissionOwnsRunningLifecycle ? "accepted_local" : "running";
|
|
74053
|
+
}
|
|
73934
74054
|
function startDispatchLifecycleKeepalive(input) {
|
|
73935
74055
|
let intervalCount = 0;
|
|
73936
74056
|
let lastOccupancyConnectionGeneration = null;
|
|
@@ -76364,7 +76484,7 @@ async function resolveDaemonServiceOwnerContext(input) {
|
|
|
76364
76484
|
const authOwnerUserId = normalizeText$6(authSession?.user?.id);
|
|
76365
76485
|
if (authOwnerUserId) return {
|
|
76366
76486
|
ownerUserId: authOwnerUserId,
|
|
76367
|
-
ownerName: normalizeOptionalText$
|
|
76487
|
+
ownerName: normalizeOptionalText$47(authSession?.user?.name),
|
|
76368
76488
|
openMeldProfile: null
|
|
76369
76489
|
};
|
|
76370
76490
|
const fallbackProfile = await resolveOpenMeldProfileOrNull({
|
|
@@ -77154,7 +77274,7 @@ function resolveDaemonServiceOwnerContextFromProfile(openMeldProfile, ownerMissi
|
|
|
77154
77274
|
});
|
|
77155
77275
|
return {
|
|
77156
77276
|
ownerUserId,
|
|
77157
|
-
ownerName: normalizeOptionalText$
|
|
77277
|
+
ownerName: normalizeOptionalText$47(openMeldProfile.ownerName),
|
|
77158
77278
|
openMeldProfile
|
|
77159
77279
|
};
|
|
77160
77280
|
}
|
|
@@ -79782,7 +79902,7 @@ async function probeLocalDaemonControlPlaneReachability() {
|
|
|
79782
79902
|
}
|
|
79783
79903
|
function buildDaemonControlRejectedError(input) {
|
|
79784
79904
|
const targetLabel = input.payload.target.by === "dispatch" ? `dispatch ${input.payload.target.dispatchId}` : `task ${input.payload.target.taskId}`;
|
|
79785
|
-
const note = normalizeOptionalText$
|
|
79905
|
+
const note = normalizeOptionalText$47(input.payload.note);
|
|
79786
79906
|
const detail = note ? ` (${note})` : "";
|
|
79787
79907
|
return /* @__PURE__ */ new Error(`daemon.control.rejected: ${input.command} request was not accepted for ${targetLabel}${detail}`);
|
|
79788
79908
|
}
|
|
@@ -79852,8 +79972,8 @@ function emitDaemonControlResult(input) {
|
|
|
79852
79972
|
return;
|
|
79853
79973
|
}
|
|
79854
79974
|
const targetLabel = input.payload.target.by === "dispatch" ? `dispatch ${input.payload.target.dispatchId}` : `task ${input.payload.target.taskId}`;
|
|
79855
|
-
const resolvedDispatchId = normalizeOptionalText$
|
|
79856
|
-
const resolvedTaskId = normalizeOptionalText$
|
|
79975
|
+
const resolvedDispatchId = normalizeOptionalText$47(input.payload.resolvedDispatchId);
|
|
79976
|
+
const resolvedTaskId = normalizeOptionalText$47(input.payload.resolvedTaskId);
|
|
79857
79977
|
const acceptedVerb = capitalizeDaemonControlCommand(input.command);
|
|
79858
79978
|
const acceptedText = [
|
|
79859
79979
|
`${acceptedVerb} request accepted for ${targetLabel}.`,
|
|
@@ -82134,7 +82254,7 @@ function emitDaemonRunServiceDependenciesUnavailable(input) {
|
|
|
82134
82254
|
}
|
|
82135
82255
|
async function resolveDaemonStartFailure(input) {
|
|
82136
82256
|
const startupDiagnostic = input.cursor ? await readDaemonStartFailureLogDiagnostic({ cursor: input.cursor }).catch(() => null) : null;
|
|
82137
|
-
const rawLogLine = normalizeOptionalText$
|
|
82257
|
+
const rawLogLine = normalizeOptionalText$47(startupDiagnostic?.rawLine) ?? normalizeOptionalText$47(input.fallbackRawLine) ?? null;
|
|
82138
82258
|
if (rawLogLine && isDaemonStartFailureLikelyDependencyRequestFailure(rawLogLine)) {
|
|
82139
82259
|
const dependencyDiagnostics = await resolveDaemonServiceDependencyDiagnostics({
|
|
82140
82260
|
gatewayUrl: input.gatewayUrl,
|
|
@@ -82154,7 +82274,7 @@ async function resolveDaemonStartFailure(input) {
|
|
|
82154
82274
|
dependencyDiagnostics
|
|
82155
82275
|
};
|
|
82156
82276
|
}
|
|
82157
|
-
const detail = normalizeOptionalText$
|
|
82277
|
+
const detail = normalizeOptionalText$47(startupDiagnostic?.detail) ?? (rawLogLine ? summarizeDaemonStartFailureLogLine(rawLogLine) : null);
|
|
82158
82278
|
if (!detail) return null;
|
|
82159
82279
|
return {
|
|
82160
82280
|
reason: "startup_failed",
|
|
@@ -83254,11 +83374,11 @@ function emitDaemonRecoveredStartedState(input) {
|
|
|
83254
83374
|
});
|
|
83255
83375
|
}
|
|
83256
83376
|
function resolveDaemonServiceOpenMeldProfileId(input) {
|
|
83257
|
-
const explicitOpenMeldProfileId = normalizeOptionalText$
|
|
83377
|
+
const explicitOpenMeldProfileId = normalizeOptionalText$47(input.explicitOpenMeldProfileId);
|
|
83258
83378
|
if (explicitOpenMeldProfileId) return explicitOpenMeldProfileId;
|
|
83259
|
-
const sessionOpenMeldProfileId = normalizeOptionalText$
|
|
83379
|
+
const sessionOpenMeldProfileId = normalizeOptionalText$47(input.runtime.openMeldProfileId);
|
|
83260
83380
|
if (sessionOpenMeldProfileId) return sessionOpenMeldProfileId;
|
|
83261
|
-
const selectedOpenMeldProfileId = normalizeOptionalText$
|
|
83381
|
+
const selectedOpenMeldProfileId = normalizeOptionalText$47(getCurrentCommandCheckState().selectedProfile?.openMeldProfileId);
|
|
83262
83382
|
if (selectedOpenMeldProfileId) return selectedOpenMeldProfileId;
|
|
83263
83383
|
}
|
|
83264
83384
|
async function resolveDaemonServiceContractGatewayUrl(input) {
|
|
@@ -83298,8 +83418,8 @@ async function maybeWriteDaemonServiceContract(input) {
|
|
|
83298
83418
|
contractDeviceId: reusableCurrentContract?.deviceId
|
|
83299
83419
|
}),
|
|
83300
83420
|
deviceIdPath: runtimePaths.deviceIdPath
|
|
83301
|
-
}).catch(() => reusableCurrentContract?.deviceId ?? null) : normalizeOptionalText$
|
|
83302
|
-
const resolvedProfileId = normalizeOptionalText$
|
|
83421
|
+
}).catch(() => reusableCurrentContract?.deviceId ?? null) : normalizeOptionalText$47(input.deviceId) ?? reusableCurrentContract?.deviceId ?? null;
|
|
83422
|
+
const resolvedProfileId = normalizeOptionalText$47(input.contractProfileId);
|
|
83303
83423
|
const resolvedOwnerUserId = await resolveDaemonServiceContractOwnerUserId({
|
|
83304
83424
|
currentContract,
|
|
83305
83425
|
openMeldProfileId: resolvedProfileId
|
|
@@ -83321,20 +83441,20 @@ async function maybeWriteDaemonServiceContract(input) {
|
|
|
83321
83441
|
return writeResult.contract;
|
|
83322
83442
|
}
|
|
83323
83443
|
async function resolveDaemonServiceContractOwnerUserId(input) {
|
|
83324
|
-
const profileId = normalizeOptionalText$
|
|
83444
|
+
const profileId = normalizeOptionalText$47(input.openMeldProfileId);
|
|
83325
83445
|
if (profileId) {
|
|
83326
83446
|
const selectedProfile = getCurrentCommandCheckState().selectedProfile;
|
|
83327
|
-
if (selectedProfile?.openMeldProfileId === profileId) return normalizeOptionalText$
|
|
83328
|
-
return normalizeOptionalText$
|
|
83447
|
+
if (selectedProfile?.openMeldProfileId === profileId) return normalizeOptionalText$47(selectedProfile.profile.ownerUserId) ?? void 0;
|
|
83448
|
+
return normalizeOptionalText$47((await resolveOpenMeldProfileOrNull({
|
|
83329
83449
|
openMeldProfileId: profileId,
|
|
83330
83450
|
allowDefaultFallback: false,
|
|
83331
83451
|
allowUnauthenticated: true,
|
|
83332
83452
|
persistSelection: false
|
|
83333
83453
|
}).catch(() => null))?.ownerUserId) ?? void 0;
|
|
83334
83454
|
}
|
|
83335
|
-
const authOwnerUserId = normalizeOptionalText$
|
|
83455
|
+
const authOwnerUserId = normalizeOptionalText$47((await Promise.resolve(getAuthSessionState({ validateRemote: false })).catch(() => null))?.session?.user?.id);
|
|
83336
83456
|
if (authOwnerUserId) return authOwnerUserId;
|
|
83337
|
-
return normalizeOptionalText$
|
|
83457
|
+
return normalizeOptionalText$47(input.currentContract?.ownerUserId) ?? void 0;
|
|
83338
83458
|
}
|
|
83339
83459
|
async function stageDaemonBackgroundServiceContract(input) {
|
|
83340
83460
|
const previousContract = await readDaemonServiceContract().catch(() => null);
|
|
@@ -84388,14 +84508,10 @@ function buildSpaceWebUrl(baseUrl, organizationSlug, spaceId, options) {
|
|
|
84388
84508
|
}
|
|
84389
84509
|
function resolveGatewayWebOrigin(baseUrl) {
|
|
84390
84510
|
const url = new URL(baseUrl);
|
|
84391
|
-
if (isLoopbackHostname
|
|
84392
|
-
|
|
84393
|
-
|
|
84394
|
-
url.
|
|
84395
|
-
url.protocol = "https:";
|
|
84396
|
-
}
|
|
84397
|
-
if (url.hostname === "gateway.openmeld.invalid") {
|
|
84398
|
-
url.hostname = "openmeld.invalid";
|
|
84511
|
+
if (isLoopbackHostname(url.hostname) && url.port === LOCAL_GATEWAY_PORT) url.port = LOCAL_WEB_PORT;
|
|
84512
|
+
const pair = OPENMELD_ORIGIN_HOST_PAIRS.find(({ gateway }) => gateway === url.hostname);
|
|
84513
|
+
if (pair) {
|
|
84514
|
+
url.hostname = pair.web;
|
|
84399
84515
|
url.port = "";
|
|
84400
84516
|
url.protocol = "https:";
|
|
84401
84517
|
}
|
|
@@ -84404,8 +84520,18 @@ function resolveGatewayWebOrigin(baseUrl) {
|
|
|
84404
84520
|
url.hash = "";
|
|
84405
84521
|
return url.origin;
|
|
84406
84522
|
}
|
|
84407
|
-
function
|
|
84408
|
-
|
|
84523
|
+
function resolveSpaceWebGatewayOrigin(spaceUrl) {
|
|
84524
|
+
const url = new URL(spaceUrl.toString());
|
|
84525
|
+
const pair = OPENMELD_ORIGIN_HOST_PAIRS.find(({ web }) => web === url.hostname);
|
|
84526
|
+
if (pair) {
|
|
84527
|
+
if (url.protocol !== "https:" || url.port.length > 0) throw new Error(TRUSTED_SPACE_WEB_ORIGIN_ERROR);
|
|
84528
|
+
url.hostname = pair.gateway;
|
|
84529
|
+
} else if (isLoopbackHostname(url.hostname) && (url.protocol === "http:" || url.protocol === "https:") && url.port === LOCAL_WEB_PORT) url.port = LOCAL_GATEWAY_PORT;
|
|
84530
|
+
else throw new Error(TRUSTED_SPACE_WEB_ORIGIN_ERROR);
|
|
84531
|
+
url.pathname = "";
|
|
84532
|
+
url.search = "";
|
|
84533
|
+
url.hash = "";
|
|
84534
|
+
return url.origin;
|
|
84409
84535
|
}
|
|
84410
84536
|
function normalizeOptionalText$6(value) {
|
|
84411
84537
|
const normalized = String(value ?? "").trim();
|
|
@@ -84416,6 +84542,23 @@ function requireOrganizationSlug(value) {
|
|
|
84416
84542
|
if (!normalized) throw new Error("Active organization slug is required to build a Space URL.");
|
|
84417
84543
|
return normalized;
|
|
84418
84544
|
}
|
|
84545
|
+
const OPENMELD_ORIGIN_HOST_PAIRS = [
|
|
84546
|
+
{
|
|
84547
|
+
gateway: "gateway.openmeld.ai",
|
|
84548
|
+
web: "openmeld.ai"
|
|
84549
|
+
},
|
|
84550
|
+
{
|
|
84551
|
+
gateway: "gateway.staging.openmeld.ai",
|
|
84552
|
+
web: "staging.openmeld.ai"
|
|
84553
|
+
},
|
|
84554
|
+
{
|
|
84555
|
+
gateway: "gateway.openmeld.invalid",
|
|
84556
|
+
web: "openmeld.invalid"
|
|
84557
|
+
}
|
|
84558
|
+
];
|
|
84559
|
+
const LOCAL_GATEWAY_PORT = "8080";
|
|
84560
|
+
const LOCAL_WEB_PORT = "3000";
|
|
84561
|
+
const TRUSTED_SPACE_WEB_ORIGIN_ERROR = "Space URL must use a trusted OpenMeld Web origin. For a custom local environment, pass --gateway-url explicitly.";
|
|
84419
84562
|
//#endregion
|
|
84420
84563
|
//#region src/ui/brand.ts
|
|
84421
84564
|
const ANSI_RESET = "\x1B[0m";
|
|
@@ -89050,60 +89193,11 @@ function buildAgentPreparationPromptMessage(profiles) {
|
|
|
89050
89193
|
return `${String(profiles.length)} local agent profiles still need setup on this device before they can wake or reply in the background. Set them up now?`;
|
|
89051
89194
|
}
|
|
89052
89195
|
//#endregion
|
|
89053
|
-
//#region src/ui/
|
|
89054
|
-
const
|
|
89055
|
-
function
|
|
89056
|
-
switch (input.accessMode) {
|
|
89057
|
-
case "public": return "anyone_can_join";
|
|
89058
|
-
case "public_view_join_password": return "anyone_can_view";
|
|
89059
|
-
case "members_only":
|
|
89060
|
-
case "protected": return null;
|
|
89061
|
-
default: return input.passwordProtected === false ? "anyone_can_join" : null;
|
|
89062
|
-
}
|
|
89063
|
-
}
|
|
89064
|
-
function buildPublicSpaceWarningLines(exposure) {
|
|
89065
|
-
return [exposure === "anyone_can_join" ? "Anyone with this Space link can read what is shared here and join." : "Anyone with this Space link can read what is shared here. A password is required to join.", "Only bring an agent if you're comfortable sharing anything it posts with people who have the link."];
|
|
89066
|
-
}
|
|
89067
|
-
function buildPublicSpaceJoinConfirmPromptConfig(input) {
|
|
89068
|
-
return {
|
|
89069
|
-
active: "Yes, join this Space",
|
|
89070
|
-
inactive: "No, go back",
|
|
89071
|
-
message: buildPublicSpacePromptMessage("Do you want to join this Space?", input.exposure),
|
|
89072
|
-
vertical: true
|
|
89073
|
-
};
|
|
89074
|
-
}
|
|
89075
|
-
function buildPublicSpaceBringAgentsConfirmPromptConfig(input) {
|
|
89076
|
-
const singular = input.agentCount === 1;
|
|
89077
|
-
return {
|
|
89078
|
-
active: singular ? "Yes, bring this agent" : "Yes, bring these agents",
|
|
89079
|
-
inactive: singular ? "No, join without this agent" : "No, join without these agents",
|
|
89080
|
-
message: buildPublicSpacePromptMessage(singular ? "Bring this agent into a Space that anyone with the link can read?" : "Bring these agents into a Space that anyone with the link can read?", input.exposure),
|
|
89081
|
-
vertical: true
|
|
89082
|
-
};
|
|
89083
|
-
}
|
|
89084
|
-
function buildPublicSpacePasswordPromptConfig(input) {
|
|
89085
|
-
return {
|
|
89086
|
-
message: buildPublicSpacePromptCardMessage({
|
|
89087
|
-
lines: [
|
|
89088
|
-
"Without a password, anyone with this Space link can read what is shared here and join.",
|
|
89089
|
-
"With a password, only people who have it can open and join the Space.",
|
|
89090
|
-
`Passwords must be at least ${input.minimumLength} characters.`
|
|
89091
|
-
],
|
|
89092
|
-
question: "Require a password to open and join?"
|
|
89093
|
-
}),
|
|
89094
|
-
setPasswordLabel: "Yes, require a password to open and join",
|
|
89095
|
-
skipPasswordLabel: "No, anyone with the link can join"
|
|
89096
|
-
};
|
|
89097
|
-
}
|
|
89098
|
-
function buildPublicSpacePromptMessage(question, exposure) {
|
|
89099
|
-
return buildPublicSpacePromptCardMessage({
|
|
89100
|
-
lines: buildPublicSpaceWarningLines(exposure),
|
|
89101
|
-
question
|
|
89102
|
-
});
|
|
89103
|
-
}
|
|
89104
|
-
function buildPublicSpacePromptCardMessage(input) {
|
|
89196
|
+
//#region src/ui/space-access-prompt-card.ts
|
|
89197
|
+
const SPACE_ACCESS_WARNING_TITLE = "⚠️ Check Before You Continue";
|
|
89198
|
+
function buildSpaceAccessPromptCardMessage(input) {
|
|
89105
89199
|
const frame = buildUnifiedCardFrame({
|
|
89106
|
-
title:
|
|
89200
|
+
title: SPACE_ACCESS_WARNING_TITLE,
|
|
89107
89201
|
rowTextList: input.lines,
|
|
89108
89202
|
minContentWidth: 76
|
|
89109
89203
|
});
|
|
@@ -89117,6 +89211,25 @@ function buildPublicSpacePromptCardMessage(input) {
|
|
|
89117
89211
|
].join("\n");
|
|
89118
89212
|
}
|
|
89119
89213
|
//#endregion
|
|
89214
|
+
//#region src/ui/space-create-password-prompt.ts
|
|
89215
|
+
function buildSpaceCreatePasswordPromptConfig(input) {
|
|
89216
|
+
return {
|
|
89217
|
+
message: buildSpaceAccessPromptCardMessage({
|
|
89218
|
+
lines: [
|
|
89219
|
+
resolveSpaceCreatePasswordlessAccessText(input.accessMode),
|
|
89220
|
+
"With a password, only people who have it can open and join the Space.",
|
|
89221
|
+
`Passwords must be at least ${input.minimumLength} characters.`
|
|
89222
|
+
],
|
|
89223
|
+
question: "Require a password to open and join?"
|
|
89224
|
+
}),
|
|
89225
|
+
setPasswordLabel: "Yes, require a password to open and join",
|
|
89226
|
+
skipPasswordLabel: input.accessMode === "public" ? "No, anyone with the link can join" : "No, keep access members-only"
|
|
89227
|
+
};
|
|
89228
|
+
}
|
|
89229
|
+
function resolveSpaceCreatePasswordlessAccessText(accessMode) {
|
|
89230
|
+
return accessMode === "public" ? "Without a password, anyone with this Space link can read what is shared here and join." : "Without a password, only current members can open this Space. New participants must be added explicitly.";
|
|
89231
|
+
}
|
|
89232
|
+
//#endregion
|
|
89120
89233
|
//#region src/space/command-context.ts
|
|
89121
89234
|
const SPACE_ID_HEX_REGEX$1 = /^[0-9a-f]{64}$/i;
|
|
89122
89235
|
const SIGNAL_ID_UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
@@ -91317,7 +91430,8 @@ function parseSpaceCursorResponse(input) {
|
|
|
91317
91430
|
function makeHello(profile) {
|
|
91318
91431
|
return {
|
|
91319
91432
|
type: "hello",
|
|
91320
|
-
profile
|
|
91433
|
+
profile,
|
|
91434
|
+
capabilities: { spaceMessageAddressing: true }
|
|
91321
91435
|
};
|
|
91322
91436
|
}
|
|
91323
91437
|
function makeTextSignal(text, options) {
|
|
@@ -91543,7 +91657,8 @@ function buildHumanMessageRelationLines(projection) {
|
|
|
91543
91657
|
if (!projection) return [];
|
|
91544
91658
|
return buildSpaceMessageReadRelationSummary({
|
|
91545
91659
|
wakeTargets: projection.wakeTargets,
|
|
91546
|
-
referenceTargets: projection.referenceTargets
|
|
91660
|
+
referenceTargets: projection.referenceTargets,
|
|
91661
|
+
mentionTargets: projection.mentionTargets
|
|
91547
91662
|
}).map(formatHumanRelationSummaryLine);
|
|
91548
91663
|
}
|
|
91549
91664
|
function buildHumanReplyContextLine(replyContext) {
|
|
@@ -91617,6 +91732,43 @@ function renderPositiveAccentText(text) {
|
|
|
91617
91732
|
return `\u001B[38;2;${String(POSITIVE_ACCENT_RGB.r)};${String(POSITIVE_ACCENT_RGB.g)};${String(POSITIVE_ACCENT_RGB.b)}m${text}\u001B[39m`;
|
|
91618
91733
|
}
|
|
91619
91734
|
//#endregion
|
|
91735
|
+
//#region src/ui/public-space-warning.ts
|
|
91736
|
+
function resolvePublicSpaceExposure(input) {
|
|
91737
|
+
switch (input.accessMode) {
|
|
91738
|
+
case "public": return "anyone_can_join";
|
|
91739
|
+
case "public_view_join_password": return "anyone_can_view";
|
|
91740
|
+
case "members_only":
|
|
91741
|
+
case "protected": return null;
|
|
91742
|
+
default: return input.passwordProtected === false ? "anyone_can_join" : null;
|
|
91743
|
+
}
|
|
91744
|
+
}
|
|
91745
|
+
function buildPublicSpaceWarningLines(exposure) {
|
|
91746
|
+
return [exposure === "anyone_can_join" ? "Anyone with this Space link can read what is shared here and join." : "Anyone with this Space link can read what is shared here. A password is required to join.", "Only bring an agent if you're comfortable sharing anything it posts with people who have the link."];
|
|
91747
|
+
}
|
|
91748
|
+
function buildPublicSpaceJoinConfirmPromptConfig(input) {
|
|
91749
|
+
return {
|
|
91750
|
+
active: "Yes, join this Space",
|
|
91751
|
+
inactive: "No, go back",
|
|
91752
|
+
message: buildPublicSpacePromptMessage("Do you want to join this Space?", input.exposure),
|
|
91753
|
+
vertical: true
|
|
91754
|
+
};
|
|
91755
|
+
}
|
|
91756
|
+
function buildPublicSpaceBringAgentsConfirmPromptConfig(input) {
|
|
91757
|
+
const singular = input.agentCount === 1;
|
|
91758
|
+
return {
|
|
91759
|
+
active: singular ? "Yes, bring this agent" : "Yes, bring these agents",
|
|
91760
|
+
inactive: singular ? "No, join without this agent" : "No, join without these agents",
|
|
91761
|
+
message: buildPublicSpacePromptMessage(singular ? "Bring this agent into a Space that anyone with the link can read?" : "Bring these agents into a Space that anyone with the link can read?", input.exposure),
|
|
91762
|
+
vertical: true
|
|
91763
|
+
};
|
|
91764
|
+
}
|
|
91765
|
+
function buildPublicSpacePromptMessage(question, exposure) {
|
|
91766
|
+
return buildSpaceAccessPromptCardMessage({
|
|
91767
|
+
lines: buildPublicSpaceWarningLines(exposure),
|
|
91768
|
+
question
|
|
91769
|
+
});
|
|
91770
|
+
}
|
|
91771
|
+
//#endregion
|
|
91620
91772
|
//#region src/ui/space-mention-highlight.ts
|
|
91621
91773
|
function buildSpaceMentionHighlightIndex(snapshot) {
|
|
91622
91774
|
return buildSpaceMentionProfileIndex(snapshot);
|
|
@@ -93036,11 +93188,56 @@ async function prepareCliSpaceComposerSubmission(input) {
|
|
|
93036
93188
|
snapshot: membersSnapshot,
|
|
93037
93189
|
text: input.text
|
|
93038
93190
|
});
|
|
93191
|
+
const publishedMessage = resolvePublishedMessage({
|
|
93192
|
+
membersSnapshot,
|
|
93193
|
+
preparedSubmission
|
|
93194
|
+
});
|
|
93195
|
+
const outboundText = publishedMessage.text;
|
|
93196
|
+
const outboundMessageEnvelope = preparedSubmission.messageEnvelope ? {
|
|
93197
|
+
...preparedSubmission.messageEnvelope,
|
|
93198
|
+
text: outboundText
|
|
93199
|
+
} : void 0;
|
|
93039
93200
|
return {
|
|
93040
|
-
...
|
|
93201
|
+
...outboundMessageEnvelope ? { outboundMessageEnvelope } : {},
|
|
93041
93202
|
...preparedSubmission.replyTo ? { outboundReplyTo: preparedSubmission.replyTo } : {},
|
|
93042
|
-
outboundText
|
|
93043
|
-
preparedSubmission
|
|
93203
|
+
outboundText,
|
|
93204
|
+
preparedSubmission,
|
|
93205
|
+
resolvedAddressingTargets: publishedMessage.resolvedAddressingTargets
|
|
93206
|
+
};
|
|
93207
|
+
}
|
|
93208
|
+
function resolvePublishedMessage(input) {
|
|
93209
|
+
const text = input.preparedSubmission.text;
|
|
93210
|
+
const canonicalMentions = collectCanonicalMentionTextFragments(text).flatMap((fragment) => fragment.parsedLiteral ? [{
|
|
93211
|
+
...fragment,
|
|
93212
|
+
parsedLiteral: fragment.parsedLiteral
|
|
93213
|
+
}] : []);
|
|
93214
|
+
if (canonicalMentions.length === 0) return {
|
|
93215
|
+
resolvedAddressingTargets: [],
|
|
93216
|
+
text
|
|
93217
|
+
};
|
|
93218
|
+
if (!input.membersSnapshot) throw new Error("Space message addressing invariant failed: resolved mentions require the current members snapshot.");
|
|
93219
|
+
const targetCatalog = createSpaceTargetCatalog(input.membersSnapshot);
|
|
93220
|
+
let cursor = 0;
|
|
93221
|
+
const parts = [];
|
|
93222
|
+
for (const mention of canonicalMentions) {
|
|
93223
|
+
const target = targetCatalog.byExactMentionLabel.get(mention.parsedLiteral.name);
|
|
93224
|
+
if (!target) throw new Error(`Space message addressing invariant failed: resolved target ${mention.parsedLiteral.name} is not in the current members snapshot.`);
|
|
93225
|
+
parts.push(text.slice(cursor, mention.start));
|
|
93226
|
+
parts.push(`@${target.primaryMentionLabel}`);
|
|
93227
|
+
cursor = mention.end;
|
|
93228
|
+
}
|
|
93229
|
+
parts.push(text.slice(cursor));
|
|
93230
|
+
return {
|
|
93231
|
+
resolvedAddressingTargets: input.preparedSubmission.canonicalMentionsInTextOrder.map((mention) => {
|
|
93232
|
+
const target = targetCatalog.byProfileId.get(mention.profileId);
|
|
93233
|
+
if (!target) throw new Error(`Space message addressing invariant failed: resolved profile ${mention.profileId} is not in the current members snapshot.`);
|
|
93234
|
+
return {
|
|
93235
|
+
primaryMentionLabel: target.primaryMentionLabel,
|
|
93236
|
+
profileId: target.profileId,
|
|
93237
|
+
relation: mention.type
|
|
93238
|
+
};
|
|
93239
|
+
}),
|
|
93240
|
+
text: parts.join("")
|
|
93044
93241
|
};
|
|
93045
93242
|
}
|
|
93046
93243
|
//#endregion
|
|
@@ -97377,7 +97574,7 @@ var SpaceSessionRuntime = class {
|
|
|
97377
97574
|
}
|
|
97378
97575
|
const clientMessageId = crypto.randomUUID();
|
|
97379
97576
|
try {
|
|
97380
|
-
this.#ws.send(JSON.stringify(
|
|
97577
|
+
this.#ws.send(JSON.stringify(toCompatibleSpaceAddressingRequestWireValue(makeTextSignal(text, {
|
|
97381
97578
|
...input.messageEnvelope ? { messageEnvelope: input.messageEnvelope } : {},
|
|
97382
97579
|
meta: { clientMessageId }
|
|
97383
97580
|
}))));
|
|
@@ -101919,7 +102116,7 @@ async function runConnect(input) {
|
|
|
101919
102116
|
const outboundText = preparedOutboundText.text;
|
|
101920
102117
|
const clientMessageId = crypto.randomUUID();
|
|
101921
102118
|
try {
|
|
101922
|
-
ws.send(JSON.stringify(
|
|
102119
|
+
ws.send(JSON.stringify(toCompatibleSpaceAddressingRequestWireValue(makeTextSignal(outboundText, {
|
|
101923
102120
|
...preparedOutboundText.messageEnvelope ? { messageEnvelope: preparedOutboundText.messageEnvelope } : {},
|
|
101924
102121
|
meta: { clientMessageId }
|
|
101925
102122
|
}))));
|
|
@@ -103918,6 +104115,7 @@ function buildSpaceHistoryBriefMessage(input) {
|
|
|
103918
104115
|
replyTo: messageReadProjection?.replyToSignalId ?? null,
|
|
103919
104116
|
wakeTargets: messageReadProjection?.wakeTargets ?? [],
|
|
103920
104117
|
referenceTargets: messageReadProjection?.referenceTargets ?? [],
|
|
104118
|
+
mentionTargets: messageReadProjection?.mentionTargets ?? [],
|
|
103921
104119
|
thread: input.thread ?? null
|
|
103922
104120
|
};
|
|
103923
104121
|
}
|
|
@@ -105664,9 +105862,10 @@ async function runSend(input) {
|
|
|
105664
105862
|
summary: input.plainText ? "Preparing message text without Space mention parsing." : "Preparing message text and canonical Space mentions.",
|
|
105665
105863
|
spaceId: space
|
|
105666
105864
|
});
|
|
105667
|
-
const { outboundMessageEnvelope, outboundText } = text.value.length === 0 ? {
|
|
105865
|
+
const { outboundMessageEnvelope, outboundText, resolvedAddressingTargets } = text.value.length === 0 ? {
|
|
105668
105866
|
outboundMessageEnvelope: void 0,
|
|
105669
|
-
outboundText: ""
|
|
105867
|
+
outboundText: "",
|
|
105868
|
+
resolvedAddressingTargets: []
|
|
105670
105869
|
} : await resolveOutboundSubmission({
|
|
105671
105870
|
openMeldProfile,
|
|
105672
105871
|
password: input.password,
|
|
@@ -105680,6 +105879,7 @@ async function runSend(input) {
|
|
|
105680
105879
|
emitSendAddressingSummary({
|
|
105681
105880
|
outboundMessageEnvelope,
|
|
105682
105881
|
presenter,
|
|
105882
|
+
resolvedAddressingTargets,
|
|
105683
105883
|
resolvedView: runtime.resolvedView
|
|
105684
105884
|
});
|
|
105685
105885
|
presenter.line({
|
|
@@ -105776,7 +105976,8 @@ async function postReplyIntoThread(input) {
|
|
|
105776
105976
|
async function resolveOutboundSubmission(input) {
|
|
105777
105977
|
if (input.plainText) return {
|
|
105778
105978
|
bareMentionDiagnostics: [],
|
|
105779
|
-
outboundText: input.text
|
|
105979
|
+
outboundText: input.text,
|
|
105980
|
+
resolvedAddressingTargets: []
|
|
105780
105981
|
};
|
|
105781
105982
|
let loadedMembersSnapshot = null;
|
|
105782
105983
|
const preparedSubmission = await prepareCliSpaceComposerSubmission({
|
|
@@ -105823,7 +106024,8 @@ async function resolveOutboundSubmission(input) {
|
|
|
105823
106024
|
return {
|
|
105824
106025
|
bareMentionDiagnostics,
|
|
105825
106026
|
outboundMessageEnvelope: preparedSubmission.outboundMessageEnvelope,
|
|
105826
|
-
outboundText: preparedSubmission.outboundText
|
|
106027
|
+
outboundText: preparedSubmission.outboundText,
|
|
106028
|
+
resolvedAddressingTargets: preparedSubmission.resolvedAddressingTargets
|
|
105827
106029
|
};
|
|
105828
106030
|
}
|
|
105829
106031
|
async function resolveBareMentionDiagnostics(input) {
|
|
@@ -105879,11 +106081,14 @@ function emitSendAddressingSummary(input) {
|
|
|
105879
106081
|
const envelope = input.outboundMessageEnvelope;
|
|
105880
106082
|
const wakeCount = envelope?.activationTargets.length ?? 0;
|
|
105881
106083
|
const referenceCount = envelope?.referenceTargets.length ?? 0;
|
|
106084
|
+
const mentionCount = envelope?.mentionTargets?.length ?? 0;
|
|
105882
106085
|
input.presenter.line({
|
|
105883
106086
|
code: "space.send.addressing_summary",
|
|
105884
|
-
text: `Space Message Addressing: wake=${wakeCount}, reference=${referenceCount}.`,
|
|
106087
|
+
text: `Space Message Addressing: wake=${wakeCount}, reference=${referenceCount}, mention=${mentionCount}.`,
|
|
105885
106088
|
data: {
|
|
106089
|
+
mentionTargetCount: mentionCount,
|
|
105886
106090
|
referenceTargetCount: referenceCount,
|
|
106091
|
+
...input.resolvedAddressingTargets.length > 0 ? { targets: input.resolvedAddressingTargets } : {},
|
|
105887
106092
|
wakeTargetCount: wakeCount
|
|
105888
106093
|
}
|
|
105889
106094
|
});
|
|
@@ -105892,7 +106097,8 @@ function emitBareMentionDiagnostics(input) {
|
|
|
105892
106097
|
if (input.diagnostics.length === 0) return;
|
|
105893
106098
|
const first = input.diagnostics[0];
|
|
105894
106099
|
if (!first) return;
|
|
105895
|
-
const suggestion = first.suggestedWakeText ?? first.suggestedReferenceText;
|
|
106100
|
+
const suggestion = first.suggestedWakeText ?? first.suggestedReferenceText ?? first.suggestedMentionText;
|
|
106101
|
+
if (!suggestion) return;
|
|
105896
106102
|
const text = `Bare mention ${first.mentionText} is plain text and does not create a Wake. Use ${suggestion} when you want OpenMeld to address that profile.`;
|
|
105897
106103
|
if (input.resolvedView === "agent") {
|
|
105898
106104
|
input.presenter.line({
|
|
@@ -105903,6 +106109,7 @@ function emitBareMentionDiagnostics(input) {
|
|
|
105903
106109
|
profileId: diagnostic.profileId,
|
|
105904
106110
|
profileKind: diagnostic.profileKind,
|
|
105905
106111
|
profileName: diagnostic.profileName,
|
|
106112
|
+
suggestedMentionText: diagnostic.suggestedMentionText,
|
|
105906
106113
|
suggestedReferenceText: diagnostic.suggestedReferenceText,
|
|
105907
106114
|
suggestedWakeText: diagnostic.suggestedWakeText
|
|
105908
106115
|
})) }
|
|
@@ -106281,11 +106488,13 @@ async function resolveSpaceCreateInput(input) {
|
|
|
106281
106488
|
openMeldProfileId: input.openMeldProfile.openMeldProfileId,
|
|
106282
106489
|
resolvedView: input.runtime.resolvedView,
|
|
106283
106490
|
providedPassword: input.providedPassword,
|
|
106284
|
-
interactive: input.interactive
|
|
106491
|
+
interactive: input.interactive,
|
|
106492
|
+
visibility
|
|
106285
106493
|
});
|
|
106286
106494
|
const password = await resolveCreateSpacePasswordInput({
|
|
106287
106495
|
providedPassword: input.providedPassword,
|
|
106288
|
-
interactive: input.interactive
|
|
106496
|
+
interactive: input.interactive,
|
|
106497
|
+
visibility
|
|
106289
106498
|
});
|
|
106290
106499
|
if (password === null) return { status: "cancelled" };
|
|
106291
106500
|
const normalizedGuide = normalizeGuideInput(input.providedGuide);
|
|
@@ -106589,9 +106798,6 @@ function parseUrlOrNull(value) {
|
|
|
106589
106798
|
return null;
|
|
106590
106799
|
}
|
|
106591
106800
|
}
|
|
106592
|
-
function isLoopbackHostname(hostname) {
|
|
106593
|
-
return hostname === "localhost" || hostname === "127.0.0.1" || hostname === "::1";
|
|
106594
|
-
}
|
|
106595
106801
|
function requireActiveOrganizationSlug(organization) {
|
|
106596
106802
|
const slug = normalizeOptionalString$1(organization?.slug);
|
|
106597
106803
|
if (!slug) throw new Error("Active organization slug is required to build a Space URL.");
|
|
@@ -106687,7 +106893,7 @@ async function resolveCreateSpacePasswordInput(input) {
|
|
|
106687
106893
|
if (typeof input.providedPassword === "string") return normalizeSpacePasswordText(input.providedPassword);
|
|
106688
106894
|
if (!input.interactive) return;
|
|
106689
106895
|
const shouldSetPassword = await confirm({
|
|
106690
|
-
message: buildCreateSpacePasswordPromptMessage(),
|
|
106896
|
+
message: buildCreateSpacePasswordPromptMessage(input.visibility),
|
|
106691
106897
|
initialValue: false
|
|
106692
106898
|
});
|
|
106693
106899
|
if (isCancel(shouldSetPassword)) {
|
|
@@ -106717,7 +106923,10 @@ async function promptInteractiveSpaceCreateFlow(input) {
|
|
|
106717
106923
|
while (stepIndex < steps.length) {
|
|
106718
106924
|
const step = steps[stepIndex];
|
|
106719
106925
|
if (!step) break;
|
|
106720
|
-
const result = await promptInteractiveSpaceCreateFlowStep(
|
|
106926
|
+
const result = await promptInteractiveSpaceCreateFlowStep({
|
|
106927
|
+
state,
|
|
106928
|
+
step
|
|
106929
|
+
});
|
|
106721
106930
|
const navigation = resolveSpaceCreateFlowStepNavigation({
|
|
106722
106931
|
stepIndex,
|
|
106723
106932
|
result
|
|
@@ -106762,7 +106971,8 @@ function normalizePromptedSpaceGuide(value) {
|
|
|
106762
106971
|
const normalized = value.trim();
|
|
106763
106972
|
return normalized.length > 0 ? normalized : void 0;
|
|
106764
106973
|
}
|
|
106765
|
-
async function promptInteractiveSpaceCreateFlowStep(
|
|
106974
|
+
async function promptInteractiveSpaceCreateFlowStep(input) {
|
|
106975
|
+
const { step } = input;
|
|
106766
106976
|
if (step === "name") {
|
|
106767
106977
|
const result = await promptRequiredInteractiveSpaceName();
|
|
106768
106978
|
return result.status === "submitted" ? {
|
|
@@ -106788,7 +106998,8 @@ async function promptInteractiveSpaceCreateFlowStep(step) {
|
|
|
106788
106998
|
} : result;
|
|
106789
106999
|
}
|
|
106790
107000
|
if (step === "password") {
|
|
106791
|
-
|
|
107001
|
+
if (!input.state.visibility) throw new Error("Space create password prompt requires a selected visibility.");
|
|
107002
|
+
const result = await promptInteractiveSpaceCreatePassword(input.state.visibility);
|
|
106792
107003
|
return result.status === "submitted" ? {
|
|
106793
107004
|
status: "submitted",
|
|
106794
107005
|
step,
|
|
@@ -106897,9 +107108,9 @@ function promptInteractiveSpaceGuide() {
|
|
|
106897
107108
|
backLabel: "Back"
|
|
106898
107109
|
});
|
|
106899
107110
|
}
|
|
106900
|
-
async function promptInteractiveSpaceCreatePassword() {
|
|
107111
|
+
async function promptInteractiveSpaceCreatePassword(visibility) {
|
|
106901
107112
|
for (;;) {
|
|
106902
|
-
const promptConfig = buildCreateSpacePasswordPromptConfig();
|
|
107113
|
+
const promptConfig = buildCreateSpacePasswordPromptConfig(visibility);
|
|
106903
107114
|
const action = await select({
|
|
106904
107115
|
message: promptConfig.message,
|
|
106905
107116
|
options: [
|
|
@@ -106966,7 +107177,7 @@ function emitSpaceCreatePasswordOptionalHint(input) {
|
|
|
106966
107177
|
if (input.interactive) return;
|
|
106967
107178
|
input.presenter.line({
|
|
106968
107179
|
code: "space.create.password.optional_hint",
|
|
106969
|
-
text:
|
|
107180
|
+
text: buildSpaceCreatePasswordOptionalHintText(input.visibility),
|
|
106970
107181
|
data: {
|
|
106971
107182
|
optional: true,
|
|
106972
107183
|
requirements: {
|
|
@@ -106980,11 +107191,17 @@ function emitSpaceCreatePasswordOptionalHint(input) {
|
|
|
106980
107191
|
}
|
|
106981
107192
|
});
|
|
106982
107193
|
}
|
|
106983
|
-
function
|
|
106984
|
-
return
|
|
107194
|
+
function buildSpaceCreatePasswordOptionalHintText(visibility) {
|
|
107195
|
+
return `Password is optional. ${resolveSpaceCreatePasswordlessAccessText(resolveInitialSpaceAccessMode(visibility))} To require a password to open and join, use --password <value>. Password rule: ` + buildSpacePasswordRequirementsText();
|
|
106985
107196
|
}
|
|
106986
|
-
function
|
|
106987
|
-
return
|
|
107197
|
+
function buildCreateSpacePasswordPromptMessage(visibility) {
|
|
107198
|
+
return buildCreateSpacePasswordPromptConfig(visibility).message;
|
|
107199
|
+
}
|
|
107200
|
+
function buildCreateSpacePasswordPromptConfig(visibility) {
|
|
107201
|
+
return buildSpaceCreatePasswordPromptConfig({
|
|
107202
|
+
accessMode: resolveInitialSpaceAccessMode(visibility),
|
|
107203
|
+
minimumLength: 6
|
|
107204
|
+
});
|
|
106988
107205
|
}
|
|
106989
107206
|
function resolveCancelledSpacePasswordPromptResult(input) {
|
|
106990
107207
|
if (input.allowBack) return { status: "back" };
|
|
@@ -110856,6 +111073,6 @@ function isHumanInteractiveSpaceRuntime(runtime) {
|
|
|
110856
111073
|
return runtime.resolvedView === "human" && canUseInteractivePrompts(runtime);
|
|
110857
111074
|
}
|
|
110858
111075
|
//#endregion
|
|
110859
|
-
export { runAgentsManage as $, LocalProjectConnectionError as $a, resetCurrentCommandCheckState as $i, isCliUpdateCheckApplicable as $n, cliJsonOutputEnvelopeSchema as $o, resolveServiceReadinessFromServiceStatus as $r, ensureLocalSkills as $t, parseEnvelope as A, resolveViewProfileKey as Aa, getAgentControllerPermissionModeFieldLabel as Ai, submitProfileRuntimeAgentControllerReport as An, enqueueAgentActivityHookEvent as Ao, registerSpaceMemberSelectionOptions as Ar, createDelayedSpinner as At, resolveHumanControllerDisplayName as B, updateOpenMeldProfile as Ba, buildOnboardingPlan as Bi, buildDispatchResultMessageReadProjection as Bn, setDefaultProjectConnection as Bo, buildDualViewGuideMessage as Br, toStructuredGatewayFailure as Bt, toSpaceMetaUpsertInput as C, buildHumanErrorCopy as Ca, reconcileNewRunnableBuiltinAgentsForSetup as Ci, resolveCreateProfileName as Cn, upsertDaemonServiceContract as Co, createSpaceTargetGuideError as Cr, runDaemonStop as Ct, formatHumanReadTargetList as D, formatMessage as Da, buildAgentControllerRef as Di, resolveServiceParticipationReadiness as Dn, resolveObservedAgentActivityBinding as Do, createUpgradeConfirmationGuideError as Dr, buildProfileWorkspaceRows as Dt, buildHumanReplyContextSummary as E, createPresenter as Ea, resolveLocalRegistryAgentIdFromAgentControllerRef as Ei, formatServiceParticipationReadinessLabel as En, buildAgentActivityEvent as Eo, createStartAuthenticationGuideError as Er, buildProfileWorkspacePresentation as Et, resolveOpenMeldProfileForSpaceCommand as F, createOpenMeldHumanProfile as Fa, resolveAgentProfileEditCapabilities as Fi, resolveLocalAgentControllerLaunchability as Fn, listProjectBindings as Fo, registerAuthLoginRequestOptions as Fr, createCliSpaceApi as Ft, runAgentsCustomAdd as G, buildAgentAuthenticationGuide as Ga, classifyDaemonServiceWakeability as Gi, buildUpdatesReplyWorkflowProjection as Gn, renderInfoCard as Go, buildAgentFacingPublicationModeGuideLines as Gr, runDaemonServiceParticipationGate as Gt, resolveAgentProfileSetup as H, clearSelectedOpenMeldProfileId as Ha, buildDaemonServiceTargetSpec as Hi, buildSignalIndex as Hn, canonicalizeLocalProjectPath as Ho, OPENMELD_AGENT_MENTAL_MODEL_LINES as Hr, resolveLocalComponentsStatus as Ht, emitSpaceAgentOverview as I, deleteOpenMeldProfile as Ia, resolveEvidenceSyncHealth as Ii, resolveLocalAgentControllerReportDecision as In, listProjectConnectionsWithStatus as Io, registerBuiltinAgentSelectionOptions as Ir, fetchSpaceMeta as It, runAgentsCustomUpdate as J, resolveAuthenticationGuidance as Ja, resolveOpenMeldEnvironmentTarget as Ji, promptSearchMultiselect as Jn, emitCliJsonEnvelope as Jo, runPendingDaemonServiceUpdate as Jr, runSkillsCheck as Jt, runAgentsCustomList as K, buildHumanAuthenticationCard as Ka, resolveServiceUpdateUrgency as Ki, createSpaceMemberIdentityIndex as Kn, renderTextInfoCard as Ko, canonicalizeAllowedActions as Kr, runDaemonStartDecisionPrompt as Kt, emitSpaceCliAgentOverview as L, listOpenMeldProfiles as La, resolveNativeAgentControllerPermissionModeForController as Li, inspectSpaceCacheFile as Ln, migrateProjectBindingStore as Lo, buildAgentOverviewFromContract as Lr, updateSpaceMeta as Lt, assertFullSignalIdArgument as M, requireOpenMeldProfile as Ma, parseAgentControllerRef as Mi, submitRuntimeAgentControllerReports as Mn, readAgentActivityOutboxHealth as Mo, registerSkillsTargetSelectionOptions as Mr, runDaemonStartupPreflight as Mt, assertValidSpaceIdTarget as N, resolveOpenMeldProfileOrNull as Na, resolveAgentControllerPermissionModeForController as Ni, collectLocalAgentControllerInventory as Nn, removeProjectOutbox as No, getCliVersionInfo as Nr, readDaemonStartFailureLogTailLines as Nt, resolveLinkAccessLabel as O, parseCliViewMode as Oa, createAgentExecutionStatusDisplayRows as Oi, assessActionParticipationCandidate as On, normalizeSharedSessionTitle as Oo, getCommandEntryContract as Or, reconcileCliVersionView as Ot, prepareAuthenticatedSpaceCommandContext as P, createOpenMeldAgentProfile as Pa, resolveAgentExecutionStatus as Pi, resolveLocalAgentControllerBlockerReasonCodes as Pn, bindProject as Po, registerDaemonControlTargetOptions as Pr, fetchSpaceUpdates as Pt, runAgentsList as Q, setProfileDefaultView as Qa, isCurrentCommandCheckScopeActive as Qi, assessCliUpdate as Qn, cliBinaryDeltaPatchSchema as Qo, formatDaemonFailureContextText as Qr, runSkillsUpdate as Qt, prepareLocalAgentReadiness as R, primeOpenMeldProfilesSessionCache as Ra, PREPARE_SESSION_RECONNECT_GRACE_MS as Ri, upsertSpaceConfig as Rn, removeProjectConnection as Ro, DualViewGuideError as Rr, readGatewayJsonResponse as Rt, loadSpaceSignalIndexOrNull as S, OPENMELD_VERSION as Sa, listAgentTargetStates as Si, resolveCreateProfileKind as Sn, readDaemonServiceContract as So, createSpaceSubcommandTargetGuideError as Sr, runDaemonStatusFlow as St, buildFormalSignalReadPayload as T, renderHumanTextErrorCard as Ta, notifyDaemonRouteCatalogChanged as Ti, ensureAgentProfileRuntimeBinding as Tn, removeAgentActivityContextCache as To, createStartAgentIdentityGuideError as Tr, runDaemonUninstall as Tt, runAgents as U, getSelectedOpenMeldProfileId as Ua, resolveDaemonServiceAlignmentDecision as Ui, buildSignalMessageReadProjection as Un, enqueueControllerTaskLifecycleEventWhileLocked as Uo, SPACE_CONTRACT_ALLOWED_ACTION_ORDER as Ur, writeInstalledLocalComponentsSnapshot as Ut, persistAgentTransportSelection as V, alignSelectedOpenMeldProfileStorage as Va, getSetupFlowCopy as Vi, buildDispatchResultReplyWorkflowProjection as Vn, unbindProject as Vo, formatAgentOverviewPayload as Vr, parseJsonResponse$1 as Vt, runAgentsConfig as W, setSelectedOpenMeldProfileId as Wa, classifyDaemonServiceRunStartability as Wi, buildSpaceRoundReadProjection as Wn, readControllerTaskLifecycleOutboxHealth as Wo, areAllowedActionsEquivalent as Wr, resolveDaemonServiceParticipationStatus as Wt, runAgentsDisable as X, resolveAuthenticationGuidanceFromMessage as Xa, finishCurrentCommandCheckScope as Xi, isReturnKeypress as Xn, outJsonLine as Xo, ensureDaemonRuntimePaths as Xr, runSkillsInstall as Xt, runAgentsDetect as Y, resolveAuthenticationGuidanceFromError as Ya, resolveAuthBaseUrl as Yi, promptSearchSelect as Yn, errLine as Yo, scheduleDaemonServiceUpdate as Yr, runSkillsEnsure as Yt, runAgentsEnable as Z, getProfileDefaultView as Za, getCurrentCommandCheckState as Zi, runInteractivePrompt as Zn, outLine as Zo, resolveDaemonDeviceId as Zr, runSkillsUninstall as Zt, runSpaceWriteWithPasswordRetry as _, readVersionState as _a, validateCustomProfileWorkspacePath as _i, requestDeviceToken as _n, formatOpenMeldCliTextBlock as _o, createSpaceLeaveGuideError as _r, runDaemonInstall as _t, runSpaceDelete as a, getDaemonSystemServiceLogPath as aa, mapAgentReplyReadinessToLegacyAutoReply as ai, ensureCommandAuthenticationOrCancel as an, resolveAgentActivityRouteForPath as ao, resolveElapsedTimeMs as ar, revokeOrganizationJoinLinkResponseSchema as as, printOpenMeldBanner as at, buildIdentityOnlyMembersSnapshotForReadProjection as b, toStartBackgroundHelperExecutionCompatibility as ba, createPrimaryBindingReadSession as bi, revokeAuthAccessToken as bn, resolveUserFacingCliEntryCommand as bo, createSpaceRemoveMembersGuideError as br, runDaemonRunAfterEntryChecks as bt, runSpaceLeave as c, resolveDaemonServiceManager as ca, syncProfileWorkspaceState as ci, runAuthLogout as cn, defaultManagedIntegrationPaths as co, canUseInteractivePrompts as cr, renderOpenMeldLogo as ct, runSpaceRemoveMembers as d, performManagedInstall as da, ensureOpenMeldManagedProfileWorkspace as di, exchangeOneTimeTokenAuthSession as dn, resolveAgentActivityDispatcherCommand as do, createProfileCreateGuideError as dr, resolveSpaceSendText as dt, startCurrentCommandCheckScope as ea, resolveDaemonServiceFreshnessWarning as ei, readBundledOpenMeldCliSkillDocumentByPath as en, validateLocalProjectConnectionPath as eo, assertDispatchOwnedRuntimePublicWriteAllowed as er, cliJsonSkillsListEnvelopeSchema as es, runAgentsRepair as et, runSpaceSend as f, buildNextVersionState as fa, normalizeCustomProfileWorkspacePath as fi, buildAuthStatusRows as fn, uninstallAgentActivityIntegrations as fo, createProfileMenuGuideError as fr, bestEffortStopCurrentLaneDaemonService as ft, runSpaceReadWithPasswordRetry as g, fetchLatestPackageInfo as ga, setOpenMeldManagedProfileWorkspace as gi, fetchAuthUserSnapshot as gn, formatOpenMeldCliLine as go, createSpaceContractSetGuideError as gr, runDaemonCancel as gt, uploadPreparedSpaceFiles as h, fetchLatestCliBinaryRelease as ha, setCustomProfileWorkspace as hi, extractAuthApiErrorMessage as hn, formatOpenMeldCliCommands as ho, createSpaceAliasTargetGuideError as hr, runDaemonBackgroundStartForDecision as ht, runSpaceCreate as i, readCurrentObservedDaemonRuntimeStatus as ia, formatHumanReplyReadinessReason as ii, buildCommandAuthenticationPromptMessage as in, registerAgentActivityRoute as io, formatElapsedTime as ir, organizationJoinLinkErrorResponseSchema as is, colorizeDisplayProfileLabel as it, isSpaceCommandOutputHandledError as j, isSelectedOpenMeldProfileRequiredError as ja, listAgentControllerPermissionModeOptions as ji, submitRuntimeAgentControllerReport as jn, removeProjectInbox as jo, SPACE_ADD_MEMBERS_PROGRESS_HEARTBEAT_MS as jr, shouldEmitAgentOverview as jt, resolveOrganizationVisibilityLabel as k, resolveRuntimeContext as ka, getAgentControllerPermissionModeDisplayMetadata as ki, computeRetryDelayMs as kn, readCodexSessionTitles as ko, getCommandHintsFromContract as kr, emitDaemonAgentOverview as kt, runSpaceList as l, readRecentDaemonLifecycleEvents as la, createModelCatalogReadSession as li, runAuthMenu as ln, installAgentActivityIntegrations as lo, createDoctorFailedGuideError as lr, renderOpenMeldTagline as lt, prepareRequestedSpaceSendFiles as m, ensureVersionStateReady as ma, resolveConfiguredProfileWorkspacePath as mi, formatActiveOrganizationLabel as mn, formatOpenMeldCliCommand as mo, createSpaceAddMembersGuideError as mr, runDaemonAutostart as mt, promptAndConfirmSpacePassword as n, resolveVersionChangeDirection as na, formatAgentReplyReadinessLabel as ni, readRecentDaemonDispatchJournalEvents as nn, requestLocalAgentActivitySync as no, readDispatchSpaceActionContextFromEnv as nr, cliJsonSkillsShowEnvelopeSchema as ns, formatTransportModeDisplay as nt, runSpaceHistory as o, isDaemonServiceJobNeverSpawned as oa, resolveGatewayChainReadiness as oi, evaluateCommandAuthentication as on, unregisterAgentActivityRoute as oo, formatDaemonServiceDowngradeBlockedRecommendation as or, compareAgentControllerRefsForDisplay as os, renderOpenMeldBrandBlockLines as ot, runSpaceWatch as p, compareSemver as pa, readProfileWorkspaceConfig as pi, buildAuthStatusSnapshot as pn, formatInlineOpenMeldCliCommands as po, createResetConfirmationGuideError as pr, runDaemon as pt, runAgentsCustomRemove as q, createAuthenticationError as qa, assessServerRequiredVersion as qi, formatRemovedCcRelationMessage as qn, sanitizeTerminalDisplayText as qo, readOpenMeldToolsUpdateContextFromEnv as qr, collectSkillsReadinessSnapshot as qt, runSpaceAddMembers as r, readCurrentDaemonRuntimeContext as ra, formatDeviceReplyReadinessLabel as ri, connectWebSocket as rn, isAgentActivityRouteRegistered as ro, writeDispatchSpaceActionRecord as rr, getOrganizationJoinLinkResponseSchema as rs, colorizeAgentLabel as rt, runSpaceJoin as s, readDaemonServiceJobCrashExitCode as sa, resolveOpenClawLocalDiagnosticsValue as si, runAuthLogin as sn, AGENT_ACTIVITY_INTEGRATION_OWNER as so, formatDaemonServiceMissingRecommendation as sr, renderOpenMeldHeader as st, buildCreateSpacePasswordPromptConfig as t, inspectDaemonServiceInventory as ta, resolveCurrentReplyReadinessSnapshot as ti, readRuntimeReportingHealthState as tn, LocalDaemonControlPlaneClientError as to, readDispatchOwnedRuntimeGuard as tr, cliJsonSkillsLoadEnvelopeSchema as ts, runAgentsShow as tt, runSpacePassword as u, buildInstallSelfJsonPayload as ua, resolveProfileWorkspaceRuntime as ui, runAuthStatus as un, readAgentActivityIntegrationStatus as uo, createProfileActionGuideError as ur, resolveGatewayWebOrigin as ut, buildHumanReadSignalsTranscriptItems as v, writeVersionState as va, describeProfileWorkspacePathValidationFailure as vi, resolveDeviceAuthClientId as vn, formatProfileAwareOpenMeldCliCommands as vo, createSpaceMenuGuideError as vr, runDaemonInterrupt as vt, buildFormalDispatchResultReadPayload as w, renderHumanErrorCard as wa, listBuiltinAgentsRegistryEntries as wi, promptTextEntry as wn, readAgentActivityContextForPath as wo, createSpaceUpdatesGuideError as wr, runDaemonTeardownStrict as wt, loadSpaceIdentityDirectoryOrNull as x, resolveCurrentDaemonExpectedVersion as xa, resolveAgentProfilePrimaryAgentControllerReport as xi, createProfileByKind as xn, syncLocalAgentActivity as xo, createSpaceResultGuideError as xr, runDaemonSnapshot as xt, emitHumanReadSignalsTextProjection as y, resolveDaemonRuntimeContractCompatibility as ya, syncDeviceRuntimeStateProjection as yi, resolveDeviceTokenExpiresAt as yn, resolveSetupFollowUpCliEntryCommand as yo, createSpacePublicationSetGuideError as yr, runDaemonReinstall as yt, buildReplyReadinessGuidance as z, resolveOpenMeldProfile as za, buildDaemonRouteObservationPresentation as zi, assertNoRemovedCcSpaceAddressingSyntax as zn, runIfAgentActivityBindingGenerationIsCurrent as zo, formatDualViewGuideForDisplay as zr, readGatewayTextResponse as zt };
|
|
111076
|
+
export { runAgentsManage as $, setProfileDefaultView as $a, isCurrentCommandCheckScopeActive as $i, assessCliUpdate as $n, cliBinaryDeltaPatchSchema as $o, formatDaemonFailureContextText as $r, runSkillsUpdate as $t, parseEnvelope as A, resolveRuntimeContext as Aa, getAgentControllerPermissionModeDisplayMetadata as Ai, computeRetryDelayMs as An, readCodexSessionTitles as Ao, getCommandHintsFromContract as Ar, emitDaemonAgentOverview as At, resolveHumanControllerDisplayName as B, resolveOpenMeldProfile as Ba, buildDaemonRouteObservationPresentation as Bi, assertNoRemovedCcSpaceAddressingSyntax as Bn, runIfAgentActivityBindingGenerationIsCurrent as Bo, formatDualViewGuideForDisplay as Br, readGatewayTextResponse as Bt, toSpaceMetaUpsertInput as C, OPENMELD_VERSION as Ca, listAgentTargetStates as Ci, resolveCreateProfileKind as Cn, readDaemonServiceContract as Co, createSpaceSubcommandTargetGuideError as Cr, runDaemonStatusFlow as Ct, formatHumanReadTargetList as D, createPresenter as Da, resolveLocalRegistryAgentIdFromAgentControllerRef as Di, formatServiceParticipationReadinessLabel as Dn, buildAgentActivityEvent as Do, createStartAuthenticationGuideError as Dr, buildProfileWorkspacePresentation as Dt, buildHumanReplyContextSummary as E, renderHumanTextErrorCard as Ea, notifyDaemonRouteCatalogChanged as Ei, ensureAgentProfileRuntimeBinding as En, removeAgentActivityContextCache as Eo, createStartAgentIdentityGuideError as Er, runDaemonUninstall as Et, resolveOpenMeldProfileForSpaceCommand as F, createOpenMeldAgentProfile as Fa, resolveAgentExecutionStatus as Fi, resolveLocalAgentControllerBlockerReasonCodes as Fn, bindProject as Fo, registerDaemonControlTargetOptions as Fr, fetchSpaceUpdates as Ft, runAgentsCustomAdd as G, setSelectedOpenMeldProfileId as Ga, classifyDaemonServiceRunStartability as Gi, buildSpaceRoundReadProjection as Gn, readControllerTaskLifecycleOutboxHealth as Go, areAllowedActionsEquivalent as Gr, resolveDaemonServiceParticipationStatus as Gt, resolveAgentProfileSetup as H, alignSelectedOpenMeldProfileStorage as Ha, getSetupFlowCopy as Hi, buildDispatchResultReplyWorkflowProjection as Hn, unbindProject as Ho, formatAgentOverviewPayload as Hr, parseJsonResponse$1 as Ht, emitSpaceAgentOverview as I, createOpenMeldHumanProfile as Ia, resolveAgentProfileEditCapabilities as Ii, resolveLocalAgentControllerLaunchability as In, listProjectBindings as Io, registerAuthLoginRequestOptions as Ir, createCliSpaceApi as It, runAgentsCustomUpdate as J, createAuthenticationError as Ja, assessServerRequiredVersion as Ji, formatRemovedCcRelationMessage as Jn, sanitizeTerminalDisplayText as Jo, readOpenMeldToolsUpdateContextFromEnv as Jr, collectSkillsReadinessSnapshot as Jt, runAgentsCustomList as K, buildAgentAuthenticationGuide as Ka, classifyDaemonServiceWakeability as Ki, buildUpdatesReplyWorkflowProjection as Kn, renderInfoCard as Ko, buildAgentFacingPublicationModeGuideLines as Kr, runDaemonServiceParticipationGate as Kt, emitSpaceCliAgentOverview as L, deleteOpenMeldProfile as La, resolveEvidenceSyncHealth as Li, resolveLocalAgentControllerReportDecision as Ln, listProjectConnectionsWithStatus as Lo, registerBuiltinAgentSelectionOptions as Lr, fetchSpaceMeta as Lt, assertFullSignalIdArgument as M, isSelectedOpenMeldProfileRequiredError as Ma, listAgentControllerPermissionModeOptions as Mi, submitRuntimeAgentControllerReport as Mn, removeProjectInbox as Mo, SPACE_ADD_MEMBERS_PROGRESS_HEARTBEAT_MS as Mr, shouldEmitAgentOverview as Mt, assertValidSpaceIdTarget as N, requireOpenMeldProfile as Na, parseAgentControllerRef as Ni, submitRuntimeAgentControllerReports as Nn, readAgentActivityOutboxHealth as No, registerSkillsTargetSelectionOptions as Nr, runDaemonStartupPreflight as Nt, resolveLinkAccessLabel as O, formatMessage as Oa, buildAgentControllerRef as Oi, resolveServiceParticipationReadiness as On, resolveObservedAgentActivityBinding as Oo, createUpgradeConfirmationGuideError as Or, buildProfileWorkspaceRows as Ot, prepareAuthenticatedSpaceCommandContext as P, resolveOpenMeldProfileOrNull as Pa, resolveAgentControllerPermissionModeForController as Pi, collectLocalAgentControllerInventory as Pn, removeProjectOutbox as Po, getCliVersionInfo as Pr, readDaemonStartFailureLogTailLines as Pt, runAgentsList as Q, getProfileDefaultView as Qa, getCurrentCommandCheckState as Qi, runInteractivePrompt as Qn, outLine as Qo, resolveDaemonDeviceId as Qr, runSkillsUninstall as Qt, prepareLocalAgentReadiness as R, listOpenMeldProfiles as Ra, resolveNativeAgentControllerPermissionModeForController as Ri, inspectSpaceCacheFile as Rn, migrateProjectBindingStore as Ro, buildAgentOverviewFromContract as Rr, updateSpaceMeta as Rt, loadSpaceSignalIndexOrNull as S, resolveCurrentDaemonExpectedVersion as Sa, resolveAgentProfilePrimaryAgentControllerReport as Si, createProfileByKind as Sn, syncLocalAgentActivity as So, createSpaceResultGuideError as Sr, runDaemonSnapshot as St, buildFormalSignalReadPayload as T, renderHumanErrorCard as Ta, listBuiltinAgentsRegistryEntries as Ti, promptTextEntry as Tn, readAgentActivityContextForPath as To, createSpaceUpdatesGuideError as Tr, runDaemonTeardownStrict as Tt, runAgents as U, clearSelectedOpenMeldProfileId as Ua, buildDaemonServiceTargetSpec as Ui, buildSignalIndex as Un, canonicalizeLocalProjectPath as Uo, OPENMELD_AGENT_MENTAL_MODEL_LINES as Ur, resolveLocalComponentsStatus as Ut, persistAgentTransportSelection as V, updateOpenMeldProfile as Va, buildOnboardingPlan as Vi, buildDispatchResultMessageReadProjection as Vn, setDefaultProjectConnection as Vo, buildDualViewGuideMessage as Vr, toStructuredGatewayFailure as Vt, runAgentsConfig as W, getSelectedOpenMeldProfileId as Wa, resolveDaemonServiceAlignmentDecision as Wi, buildSignalMessageReadProjection as Wn, enqueueControllerTaskLifecycleEventWhileLocked as Wo, SPACE_CONTRACT_ALLOWED_ACTION_ORDER as Wr, writeInstalledLocalComponentsSnapshot as Wt, runAgentsDisable as X, resolveAuthenticationGuidanceFromError as Xa, resolveAuthBaseUrl as Xi, promptSearchSelect as Xn, errLine as Xo, scheduleDaemonServiceUpdate as Xr, runSkillsEnsure as Xt, runAgentsDetect as Y, resolveAuthenticationGuidance as Ya, resolveOpenMeldEnvironmentTarget as Yi, promptSearchMultiselect as Yn, emitCliJsonEnvelope as Yo, runPendingDaemonServiceUpdate as Yr, runSkillsCheck as Yt, runAgentsEnable as Z, resolveAuthenticationGuidanceFromMessage as Za, finishCurrentCommandCheckScope as Zi, isReturnKeypress as Zn, outJsonLine as Zo, ensureDaemonRuntimePaths as Zr, runSkillsInstall as Zt, runSpaceWriteWithPasswordRetry as _, fetchLatestPackageInfo as _a, setOpenMeldManagedProfileWorkspace as _i, fetchAuthUserSnapshot as _n, formatOpenMeldCliLine as _o, createSpaceContractSetGuideError as _r, runDaemonCancel as _t, runSpaceDelete as a, readCurrentObservedDaemonRuntimeStatus as aa, formatHumanReplyReadinessReason as ai, buildCommandAuthenticationPromptMessage as an, registerAgentActivityRoute as ao, formatElapsedTime as ar, organizationJoinLinkErrorResponseSchema as as, printOpenMeldBanner as at, buildIdentityOnlyMembersSnapshotForReadProjection as b, resolveDaemonRuntimeContractCompatibility as ba, syncDeviceRuntimeStateProjection as bi, resolveDeviceTokenExpiresAt as bn, resolveSetupFollowUpCliEntryCommand as bo, createSpacePublicationSetGuideError as br, runDaemonReinstall as bt, runSpaceLeave as c, readDaemonServiceJobCrashExitCode as ca, resolveOpenClawLocalDiagnosticsValue as ci, runAuthLogin as cn, AGENT_ACTIVITY_INTEGRATION_OWNER as co, formatDaemonServiceMissingRecommendation as cr, renderOpenMeldLogo as ct, runSpaceRemoveMembers as d, buildInstallSelfJsonPayload as da, resolveProfileWorkspaceRuntime as di, runAuthStatus as dn, readAgentActivityIntegrationStatus as do, createProfileActionGuideError as dr, resolveSpaceWebGatewayOrigin as dt, resetCurrentCommandCheckState as ea, resolveServiceReadinessFromServiceStatus as ei, ensureLocalSkills as en, LocalProjectConnectionError as eo, isCliUpdateCheckApplicable as er, cliJsonOutputEnvelopeSchema as es, runAgentsRepair as et, runSpaceSend as f, performManagedInstall as fa, ensureOpenMeldManagedProfileWorkspace as fi, exchangeOneTimeTokenAuthSession as fn, resolveAgentActivityDispatcherCommand as fo, createProfileCreateGuideError as fr, resolveSpaceSendText as ft, runSpaceReadWithPasswordRetry as g, fetchLatestCliBinaryRelease as ga, setCustomProfileWorkspace as gi, extractAuthApiErrorMessage as gn, formatOpenMeldCliCommands as go, createSpaceAliasTargetGuideError as gr, runDaemonBackgroundStartForDecision as gt, uploadPreparedSpaceFiles as h, ensureVersionStateReady as ha, resolveConfiguredProfileWorkspacePath as hi, formatActiveOrganizationLabel as hn, formatOpenMeldCliCommand as ho, createSpaceAddMembersGuideError as hr, runDaemonAutostart as ht, runSpaceCreate as i, readCurrentDaemonRuntimeContext as ia, formatDeviceReplyReadinessLabel as ii, connectWebSocket as in, isAgentActivityRouteRegistered as io, writeDispatchSpaceActionRecord as ir, getOrganizationJoinLinkResponseSchema as is, colorizeDisplayProfileLabel as it, isSpaceCommandOutputHandledError as j, resolveViewProfileKey as ja, getAgentControllerPermissionModeFieldLabel as ji, submitProfileRuntimeAgentControllerReport as jn, enqueueAgentActivityHookEvent as jo, registerSpaceMemberSelectionOptions as jr, createDelayedSpinner as jt, resolveOrganizationVisibilityLabel as k, parseCliViewMode as ka, createAgentExecutionStatusDisplayRows as ki, assessActionParticipationCandidate as kn, normalizeSharedSessionTitle as ko, getCommandEntryContract as kr, reconcileCliVersionView as kt, runSpaceList as l, resolveDaemonServiceManager as la, syncProfileWorkspaceState as li, runAuthLogout as ln, defaultManagedIntegrationPaths as lo, canUseInteractivePrompts as lr, renderOpenMeldTagline as lt, prepareRequestedSpaceSendFiles as m, compareSemver as ma, readProfileWorkspaceConfig as mi, buildAuthStatusSnapshot as mn, formatInlineOpenMeldCliCommands as mo, createResetConfirmationGuideError as mr, runDaemon as mt, promptAndConfirmSpacePassword as n, inspectDaemonServiceInventory as na, resolveCurrentReplyReadinessSnapshot as ni, readRuntimeReportingHealthState as nn, LocalDaemonControlPlaneClientError as no, readDispatchOwnedRuntimeGuard as nr, cliJsonSkillsLoadEnvelopeSchema as ns, formatTransportModeDisplay as nt, runSpaceHistory as o, getDaemonSystemServiceLogPath as oa, mapAgentReplyReadinessToLegacyAutoReply as oi, ensureCommandAuthenticationOrCancel as on, resolveAgentActivityRouteForPath as oo, resolveElapsedTimeMs as or, revokeOrganizationJoinLinkResponseSchema as os, renderOpenMeldBrandBlockLines as ot, runSpaceWatch as p, buildNextVersionState as pa, normalizeCustomProfileWorkspacePath as pi, buildAuthStatusRows as pn, uninstallAgentActivityIntegrations as po, createProfileMenuGuideError as pr, bestEffortStopCurrentLaneDaemonService as pt, runAgentsCustomRemove as q, buildHumanAuthenticationCard as qa, resolveServiceUpdateUrgency as qi, createSpaceMemberIdentityIndex as qn, renderTextInfoCard as qo, canonicalizeAllowedActions as qr, runDaemonStartDecisionPrompt as qt, runSpaceAddMembers as r, resolveVersionChangeDirection as ra, formatAgentReplyReadinessLabel as ri, readRecentDaemonDispatchJournalEvents as rn, requestLocalAgentActivitySync as ro, readDispatchSpaceActionContextFromEnv as rr, cliJsonSkillsShowEnvelopeSchema as rs, colorizeAgentLabel as rt, runSpaceJoin as s, isDaemonServiceJobNeverSpawned as sa, resolveGatewayChainReadiness as si, evaluateCommandAuthentication as sn, unregisterAgentActivityRoute as so, formatDaemonServiceDowngradeBlockedRecommendation as sr, compareAgentControllerRefsForDisplay as ss, renderOpenMeldHeader as st, buildCreateSpacePasswordPromptConfig as t, startCurrentCommandCheckScope as ta, resolveDaemonServiceFreshnessWarning as ti, readBundledOpenMeldCliSkillDocumentByPath as tn, validateLocalProjectConnectionPath as to, assertDispatchOwnedRuntimePublicWriteAllowed as tr, cliJsonSkillsListEnvelopeSchema as ts, runAgentsShow as tt, runSpacePassword as u, readRecentDaemonLifecycleEvents as ua, createModelCatalogReadSession as ui, runAuthMenu as un, installAgentActivityIntegrations as uo, createDoctorFailedGuideError as ur, resolveGatewayWebOrigin as ut, buildHumanReadSignalsTranscriptItems as v, readVersionState as va, validateCustomProfileWorkspacePath as vi, requestDeviceToken as vn, formatOpenMeldCliTextBlock as vo, createSpaceLeaveGuideError as vr, runDaemonInstall as vt, buildFormalDispatchResultReadPayload as w, buildHumanErrorCopy as wa, reconcileNewRunnableBuiltinAgentsForSetup as wi, resolveCreateProfileName as wn, upsertDaemonServiceContract as wo, createSpaceTargetGuideError as wr, runDaemonStop as wt, loadSpaceIdentityDirectoryOrNull as x, toStartBackgroundHelperExecutionCompatibility as xa, createPrimaryBindingReadSession as xi, revokeAuthAccessToken as xn, resolveUserFacingCliEntryCommand as xo, createSpaceRemoveMembersGuideError as xr, runDaemonRunAfterEntryChecks as xt, emitHumanReadSignalsTextProjection as y, writeVersionState as ya, describeProfileWorkspacePathValidationFailure as yi, resolveDeviceAuthClientId as yn, formatProfileAwareOpenMeldCliCommands as yo, createSpaceMenuGuideError as yr, runDaemonInterrupt as yt, buildReplyReadinessGuidance as z, primeOpenMeldProfilesSessionCache as za, PREPARE_SESSION_RECONNECT_GRACE_MS as zi, upsertSpaceConfig as zn, removeProjectConnection as zo, DualViewGuideError as zr, readGatewayJsonResponse as zt };
|
|
110860
111077
|
|
|
110861
|
-
//# sourceMappingURL=command-
|
|
111078
|
+
//# sourceMappingURL=command-BV6ylBgU.js.map
|