openmeld 0.3.137 → 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.
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
 
3
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-NJH-sDDB.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-DYzU1lHC.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
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-B06nfwnD.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-BPmXnsr9.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$75(input.xdgDataHome ?? process.env.XDG_DATA_HOME) ?? join(input.homeDir, ".local", "share"), "opencode", "opencode.db");
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$75(value) {
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$74(homedir());
4664
- const TEMP_DIR = normalizeOptionalText$74(tmpdir());
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$74(input.configuredCommand);
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$74(input.preferredCommandPath);
4875
+ const preferredCommandPath = normalizeOptionalText$75(input.preferredCommandPath);
4876
4876
  const preferredCommandPaths = preferredCommandPath && isAbsolute(preferredCommandPath) ? [preferredCommandPath] : [];
4877
- const configuredCommand = normalizeOptionalText$74(input.configuredCommand);
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$74(commandName);
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$74(process.env.PATH);
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$74(input.commandName);
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$74(process.env.NVM_DIR) ?? join(home, ".nvm");
4942
- const pnpmHome = normalizeOptionalText$74(process.env.PNPM_HOME) ?? (process.platform === "darwin" ? join(home, "Library", "pnpm") : join(home, ".local", "share", "pnpm"));
4943
- const bunHome = normalizeOptionalText$74(process.env.BUN_INSTALL) ?? join(home, ".bun");
4944
- const voltaHome = normalizeOptionalText$74(process.env.VOLTA_HOME) ?? join(home, ".volta");
4945
- const asdfHome = normalizeOptionalText$74(process.env.ASDF_DIR) ?? join(home, ".asdf");
4946
- const fnmHome = normalizeOptionalText$74(process.env.FNM_DIR) ?? join(home, ".fnm");
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$74(process.env.NPM_CONFIG_PREFIX);
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$74(value);
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$74(commandName);
4970
+ const normalizedCommandName = normalizeOptionalText$75(commandName);
4971
4971
  if (!(normalizedCommandName && process.platform !== "win32")) return [];
4972
- const shell = normalizeOptionalText$74(process.env.SHELL);
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$74(line)).filter((line) => Boolean(line && isAbsolute(line) && pathLooksExecutable(line))));
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$74(value);
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$74(readFileSync(join(nvmDir, "alias", alias), "utf8"));
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$74(process.env.HOME) ?? homedir();
5058
+ return normalizeOptionalText$75(process.env.HOME) ?? homedir();
5059
5059
  }
5060
5060
  function resolveLoginShellLookupTimeoutMs() {
5061
- const raw = normalizeOptionalText$74(process.env.OPENMELD_EXECUTABLE_LOGIN_SHELL_TIMEOUT_MS);
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$74(input.commandName);
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$74(input.firstLine);
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$74(firstLine.slice(2));
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$74(value);
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$74(value) {
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$74(path.match(NODE_VERSION_PATH_RE)?.[1]);
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$74(firstLine)
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$74(input.firstLine)?.toLowerCase() ?? "";
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$73(error.message) ?? "ACP request failed";
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$73(value) {
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$72(update?.sessionUpdate);
5913
+ const updateType = normalizeOptionalText$73(update?.sessionUpdate);
5914
5914
  if (!(update && (updateType === "tool_call" || updateType === "tool_call_update"))) return null;
5915
- const toolCallId = normalizeOptionalText$72(update.toolCallId ?? update.tool_call_id);
5915
+ const toolCallId = normalizeOptionalText$73(update.toolCallId ?? update.tool_call_id);
5916
5916
  if (!toolCallId) return null;
5917
- const sessionId = normalizeOptionalText$72(params?.sessionId);
5917
+ const sessionId = normalizeOptionalText$73(params?.sessionId);
5918
5918
  return {
5919
5919
  ...Object.hasOwn(update, "rawInput") ? { providerInput: update.rawInput } : {},
5920
- providerKind: normalizeOptionalText$72(update.kind),
5920
+ providerKind: normalizeOptionalText$73(update.kind),
5921
5921
  ...Object.hasOwn(update, "locations") ? { providerLocations: update.locations } : {},
5922
- providerTitle: normalizeOptionalText$72(update.title ?? update.name),
5922
+ providerTitle: normalizeOptionalText$73(update.title ?? update.name),
5923
5923
  scopedToolCallId: sessionId ? `${sessionId}\0${toolCallId}` : toolCallId,
5924
- status: normalizeOptionalText$72(update.status)?.toLowerCase() ?? null,
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$72(candidate);
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$72(toRecord$16(change)?.path);
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$72(toRecord$16(location)?.path);
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$72(value) {
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$71(env?.[SPACE_ACTION_CONTEXT_PATH_ENV])) return null;
6076
- const command = normalizeOptionalText$71(env?.[USER_FACING_CLI_COMMAND_ENV]);
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$71(env?.[SPACE_ACTION_TOOL_COMMAND_PATH_ENV]);
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$71(env?.[name]);
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$71(value) {
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$70(value) !== null;
6157
+ return normalizeOptionalText$71(value) !== null;
6158
6158
  };
6159
- const normalizeOptionalText$70 = (value) => {
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$69(input.invokeRequest.agentControllerConversationId);
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$69(input.contextDelta?.agentControllerConversationId);
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$69(input.request.agentControllerConversationId);
6730
+ }) : normalizeOptionalText$70(input.request.agentControllerConversationId);
6731
6731
  return {
6732
6732
  ...input.request,
6733
6733
  agentControllerConversationId
6734
6734
  };
6735
6735
  };
6736
- const normalizeOptionalText$69 = (value) => {
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$68(process.env.OPENMELD_DAEMON_RUNTIME_CLAUDE_CODE_BIN),
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$68(process.env.OPENMELD_DAEMON_RUNTIME_REQUEST_TIMEOUT_MS);
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$68(process.env.HOME) ?? homedir(), ".local", "bin")];
6818
+ return [join(normalizeOptionalText$69(process.env.HOME) ?? homedir(), ".local", "bin")];
6819
6819
  }
6820
- function normalizeOptionalText$68(value) {
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$67(record.tool_use_id);
6870
- const providerToolName = normalizeOptionalText$67(record.tool_name);
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$67(block.id);
6881
+ const toolCallId = normalizeOptionalText$68(block.id);
6882
6882
  if (!toolCallId) return [];
6883
6883
  return [{
6884
6884
  providerToolInput: block.input,
6885
- providerToolName: normalizeOptionalText$67(block.name),
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$67(block.tool_use_id);
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$67(value) {
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$66(record.session_id);
7354
- const resultText = normalizeOptionalText$66(record.result);
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$66(record.message),
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$66(event.type);
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$66(value) {
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$65(conversationPolicy?.model);
7420
- const fallbackModel = normalizeOptionalText$65(conversationPolicy?.fallbackModel);
7421
- const reasoningLevel = normalizeOptionalText$65(conversationPolicy?.reasoningLevel);
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$65(value) {
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$64(input.prompt);
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$64(input.sessionId),
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$64(input.sessionId) : null;
7553
+ const canonicalRepairSessionId = input.executionMode === "repair" ? normalizeOptionalText$65(input.sessionId) : null;
7554
7554
  let latestOutput = "";
7555
7555
  let latestResultIsError = false;
7556
- let resolvedSessionId = normalizeOptionalText$64(input.sessionId);
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$64(input.sessionId) !== null,
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$64(latestOutput);
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$64(input.sessionId) !== null,
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$64(resolvedSessionId),
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$64(input.sessionId) !== null,
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$64(input.stderrText);
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$64(input.stderrText) ? [normalizeOptionalText$64(input.stderrText)] : []
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$64(value);
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$64(line);
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$64(value) {
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$63(input.sessionId);
7964
+ return normalizeOptionalText$64(input.sessionId);
7965
7965
  }
7966
7966
  async function invokeClaudeAgentSdkTransport(input) {
7967
- const prompt = normalizeOptionalText$63(input.prompt);
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$63(input.sessionId) !== null;
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$63(input.sessionId);
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$63(input.sessionId),
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$63(latestOutput);
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$63(resolvedSessionId),
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$63(input.sessionId);
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$63((await readFile(latestPlanFile.path, "utf8")).slice(0, 64e3));
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$63(input.message.session_id);
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$63(toolInput.content);
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$63).filter((value) => value !== null).join("\n")
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$63(value) {
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$62(dispatchInput.agentControllerConversationId),
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$62(input.claudeBin) ? buildExecutableLaunchContract({ commandPath: normalizeOptionalText$62(input.claudeBin) }) : null);
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$62 = (value) => {
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$61(input.codexErrorInfo)?.toLowerCase() === "usagelimitexceeded") return buildHardProviderFailure({
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$61(value) {
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$60(item?.id);
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$60(value) {
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$59(input.prompt);
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$59(input.threadId) ?? executionThreadId : executionThreadId;
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$59(readAgentMessageOutput(completedTurn) ?? session.readCollectedAgentMessageDeltaText());
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$59(input.threadId) !== null,
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$59(input.threadId);
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$59(input.sourceThreadId);
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$59(input.title);
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$59(input.threadId);
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$59(input.model);
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$59(preset?.mode);
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$59(preset?.model),
9637
- reasoningEffort: normalizeOptionalText$59(preset?.reasoning_effort)
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$59(conversationPolicy?.model);
9696
+ const model = normalizeOptionalText$60(conversationPolicy?.model);
9693
9697
  if (model) params.model = model;
9694
- const reasoningLevel = normalizeOptionalText$59(conversationPolicy?.reasoningLevel);
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$59(turn?.id) === input.turnId;
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$59(params?.itemId);
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$59(threadId);
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$59(response?.model),
10275
+ model: normalizeOptionalText$60(response?.model),
10264
10276
  threadId: readRequiredText(response?.thread?.id, "thread response thread.id"),
10265
- threadSource: normalizeOptionalText$59(response?.thread?.threadSource)
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$59(item.text)).filter((item) => item !== null).join("\n").trim();
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$59(turn.error?.message) ?? "codex app-server turn failed";
10294
+ return normalizeOptionalText$60(turn.error?.message) ?? "codex app-server turn failed";
10283
10295
  }
10284
10296
  function readTurnFailureCodexErrorInfo(turn) {
10285
- return normalizeOptionalText$59(turn.error?.codexErrorInfo);
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$59(value);
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$59(error.message) ?? "codex app-server error";
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$59(value);
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$59(value) {
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$59(toRecord$11(response)?.userAgent)?.match(CODEX_APP_SERVER_VERSION_PATTERN)?.[1] ?? null;
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$58(process.env.OPENMELD_DAEMON_RUNTIME_CODEX_BIN),
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$58(process.env.OPENMELD_DAEMON_RUNTIME_REQUEST_TIMEOUT_MS);
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$58(process.env.HOME) ?? homedir();
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$58(value) {
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$57(item.phase ?? record.phase);
11077
+ const phase = normalizeOptionalText$58(item.phase ?? record.phase);
11066
11078
  if (phase && phase !== "final_answer") return null;
11067
- const text = normalizeOptionalText$57(item.text);
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$57(response?.output_text);
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$57(record.thread_id);
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$57(value) {
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$56(input.prompt);
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$56(latestOutput);
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$56(input.threadId) !== null,
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$56(resolvedThreadId)
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$56(conversationPolicy?.model);
11379
+ const model = normalizeOptionalText$57(conversationPolicy?.model);
11368
11380
  if (model) args.push("-m", model);
11369
- const reasoningLevel = normalizeOptionalText$56(conversationPolicy?.reasoningLevel);
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$56(line);
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$56(record.message);
11482
+ const message = normalizeOptionalText$57(record.message);
11471
11483
  if (record.type === "error" && message) return message;
11472
- const errorMessage = normalizeOptionalText$56((record.error && typeof record.error === "object" && !Array.isArray(record.error) ? record.error : null)?.message);
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$56(input.stderrText);
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$56(input.stderrText) ? [normalizeOptionalText$56(input.stderrText)] : [],
11517
- ...normalizeOptionalText$56(input.stdoutText) ? [normalizeOptionalText$56(input.stdoutText)] : []
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$56(value) {
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$55(input.agentControllerConversationId)
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$55(dispatchInput.agentControllerConversationId)
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$55(input.codexBin) ? buildExecutableLaunchContract({ commandPath: normalizeOptionalText$55(input.codexBin) }) : null);
12330
+ return input.inputLaunchContract ?? input.optionLaunchContract ?? (normalizeOptionalText$56(input.codexBin) ? buildExecutableLaunchContract({ commandPath: normalizeOptionalText$56(input.codexBin) }) : null);
12319
12331
  }
12320
- const normalizeOptionalText$55 = (value) => {
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$54(process.env.OPENMELD_DAEMON_RUNTIME_GROK_BUILD_BIN),
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$54(process.env.OPENMELD_DAEMON_RUNTIME_REQUEST_TIMEOUT_MS);
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$54(process.env.HOME) ?? homedir();
12384
+ return normalizeOptionalText$55(process.env.HOME) ?? homedir();
12373
12385
  }
12374
- function normalizeOptionalText$54(value) {
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$53(input.prompt);
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$53(input.sessionId);
12676
+ const existingSessionId = normalizeOptionalText$54(input.sessionId);
12665
12677
  const descriptor = await session.openSession({
12666
- requestedModelId: normalizeOptionalText$53(input.conversationPolicy?.model),
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$53(input.conversationPolicy?.reasoningLevel),
12673
- requestedModelId: normalizeOptionalText$53(input.conversationPolicy?.model)
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$53(record?.sessionId) ?? input.sessionId ?? null;
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$53(toRecord$7(request.params)?.sessionId);
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$53(record?.currentModelId);
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$53(model?.modelId);
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$53(meta?.reasoningEffort),
13101
- displayName: normalizeOptionalText$53(model?.name) ?? modelId,
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$53(toRecord$7(method)?.id);
13155
+ const methodId = normalizeOptionalText$54(toRecord$7(method)?.id);
13144
13156
  return methodId ? [methodId] : [];
13145
13157
  });
13146
- const preferred = normalizeOptionalText$53(toRecord$7(initializeResult._meta)?.defaultAuthMethodId);
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$53(toRecord$7(value)?.stopReason);
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$53(stderr)].filter((value) => value !== null).join("\n");
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$53(combined) ?? "Grok Build ACP error"}`
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$53(error.message) ?? "ACP request failed";
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$53(input.message) ?? "Grok Build ACP error";
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$53).filter((value) => value !== null))];
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$53(value) {
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$52(dispatchInput.agentControllerConversationId),
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$52(input.grokBuildBin);
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$52(value) {
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$51(process.env.OPENMELD_DAEMON_RUNTIME_OPENCODE_BIN),
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$51(process.env.OPENMELD_DAEMON_RUNTIME_REQUEST_TIMEOUT_MS);
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$51(process.env.HOME) ?? homedir(), ".opencode", "bin")];
13540
+ return [join(normalizeOptionalText$52(process.env.HOME) ?? homedir(), ".opencode", "bin")];
13529
13541
  }
13530
- function normalizeOptionalText$51(value) {
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$50(outputText),
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$50(record.status)?.toLowerCase();
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$50(value) {
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$50(value);
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$49(input.prompt);
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$49(input.sessionId),
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$49(input.sessionId);
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$49(latestOutput);
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$49(resolvedSessionId),
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$49(input.sessionId) !== null
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$49(input.conversationPolicy?.model);
14014
+ const model = normalizeOptionalText$50(input.conversationPolicy?.model);
14003
14015
  if (model) args.push("--model", model);
14004
- const reasoningLevel = normalizeOptionalText$49(input.conversationPolicy?.reasoningLevel);
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$49(input.stderrText) ? [normalizeOptionalText$49(input.stderrText)] : []
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$49(value);
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$49(line);
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$49(line);
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$49(value) {
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$48(input.prompt);
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$48(input.sessionId) : null;
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$48(input.sessionId);
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$48(input.sessionId) !== null,
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$48(input.sourceSessionId);
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$48(input.title);
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$48(input.observedSessionId) ?? sessionId);
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$48(input.conversationPolicy?.reasoningLevel) ? { variant: normalizeOptionalText$48(input.conversationPolicy?.reasoningLevel) } : {}
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$48(properties.sessionID) ?? normalizeOptionalText$48(toRecord$6(properties.part)?.sessionID);
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$48(properties.sessionID) ?? normalizeOptionalText$48(session?.id);
14742
- const parentId = normalizeOptionalText$48(session?.parentID);
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$48(message?.id);
14749
- const messageSessionId = normalizeOptionalText$48(message?.sessionID) ?? normalizeOptionalText$48(properties.sessionID);
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$48(message.parentID) === turnState.promptMessageId && messageId) turnState.assistantMessageIds.add(messageId);
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$48(properties.sessionID) === turnState.rootSessionId;
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$48(message.parentID) !== turnState.promptMessageId) return null;
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$48(part?.id);
14780
- const messageId = normalizeOptionalText$48(part?.messageID);
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$48(info.parentID) === input.promptMessageId;
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$48(payload?.type);
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$48(properties.id);
14818
- const sessionID = normalizeOptionalText$48(properties.sessionID);
14819
- const permission = normalizeOptionalText$48(properties.permission) ?? normalizeOptionalText$48(properties.action);
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$48(toRecord$6(properties.tool)?.callID) ?? "",
14830
- messageID: normalizeOptionalText$48(toRecord$6(properties.tool)?.messageID) ?? ""
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$48(properties.id);
14836
- const sessionID = normalizeOptionalText$48(properties.sessionID);
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$48(question?.question ?? question?.prompt);
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$48(question?.header) ?? "Question",
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$48(option?.label);
14859
+ const label = normalizeOptionalText$49(option?.label);
14848
14860
  return label ? [{
14849
- description: normalizeOptionalText$48(option?.description) ?? "",
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$48(value);
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$48(policy?.reasoningLevel);
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$48(toRecord$6(error?.data)?.message) ?? normalizeOptionalText$48(error?.message) ?? normalizeOptionalText$48(value);
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$48(toRecord$6(unwrapSdkData(value))?.id);
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$48(stderr)].filter((value) => Boolean(value)).join("\n")
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$48).filter((entry) => entry !== null) : [];
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$48(value) {
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$48(stderr);
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$47(input.agentControllerConversationId),
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$47(value);
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$47(value) {
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-B06nfwnD.js").then((n) => n.i);
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) {
@@ -20008,7 +20020,7 @@ function splitSentences(message) {
20008
20020
  var package_default = {
20009
20021
  $schema: "https://www.schemastore.org/package.json",
20010
20022
  name: "openmeld",
20011
- version: "0.3.137",
20023
+ version: "0.3.138",
20012
20024
  openMeldReleaseDate: "2026-09-01",
20013
20025
  description: "OpenMeld CLI - https://openmeld.ai",
20014
20026
  license: "MIT",
@@ -20171,7 +20183,7 @@ function parseRuntimeTransportMode(value) {
20171
20183
  function parseContextIdMappingSpec(value) {
20172
20184
  const record = asRecord(value);
20173
20185
  if (!record) return null;
20174
- const sourceField = normalizeOptionalText$46(record.sourceField);
20186
+ const sourceField = normalizeOptionalText$47(record.sourceField);
20175
20187
  const mappingVersion = normalizePositiveInteger$1(record.mappingVersion);
20176
20188
  if (!(sourceField && mappingVersion)) return null;
20177
20189
  return {
@@ -20197,7 +20209,7 @@ function asRecord(value) {
20197
20209
  function normalizeText$6(value) {
20198
20210
  return String(value ?? "").trim();
20199
20211
  }
20200
- function normalizeOptionalText$46(value) {
20212
+ function normalizeOptionalText$47(value) {
20201
20213
  const normalized = normalizeText$6(value);
20202
20214
  return normalized.length > 0 ? normalized : null;
20203
20215
  }
@@ -20256,8 +20268,8 @@ const createRuntimeContractRepairReport = (input) => ({
20256
20268
  const parseRuntimeContractMeta = (value) => {
20257
20269
  if (!isRecord$4(value)) return null;
20258
20270
  if (value.schema !== RUNTIME_CONTRACT_META_SCHEMA || value.v !== 1) return null;
20259
- const contractEpoch = normalizeOptionalText$46(value.contractEpoch);
20260
- const updatedAt = normalizeOptionalText$46(value.updatedAt);
20271
+ const contractEpoch = normalizeOptionalText$47(value.contractEpoch);
20272
+ const updatedAt = normalizeOptionalText$47(value.updatedAt);
20261
20273
  if (!(contractEpoch && updatedAt)) return null;
20262
20274
  return {
20263
20275
  schema: RUNTIME_CONTRACT_META_SCHEMA,
@@ -20272,8 +20284,8 @@ const parseRuntimeContractRepairReport = (value) => {
20272
20284
  const status = value.status;
20273
20285
  const reason = value.reason;
20274
20286
  const fromEpochRaw = value.fromEpoch;
20275
- const toEpoch = normalizeOptionalText$46(value.toEpoch);
20276
- const appliedAt = normalizeOptionalText$46(value.appliedAt);
20287
+ const toEpoch = normalizeOptionalText$47(value.toEpoch);
20288
+ const appliedAt = normalizeOptionalText$47(value.appliedAt);
20277
20289
  const cleanedPathsRaw = value.cleanedPaths;
20278
20290
  const backupPathsRaw = value.backupPaths;
20279
20291
  const errorMessageRaw = value.errorMessage;
@@ -20281,11 +20293,11 @@ const parseRuntimeContractRepairReport = (value) => {
20281
20293
  if (reason !== "legacy_state_without_meta" && reason !== "contract_epoch_mismatch") return null;
20282
20294
  if (!(toEpoch && appliedAt)) return null;
20283
20295
  if (!(Array.isArray(cleanedPathsRaw) && Array.isArray(backupPathsRaw))) return null;
20284
- const cleanedPaths = cleanedPathsRaw.map((item) => normalizeOptionalText$46(item)).filter((item) => item !== null);
20285
- const backupPaths = backupPathsRaw.map((item) => normalizeOptionalText$46(item)).filter((item) => item !== null);
20286
- const fromEpoch = fromEpochRaw === null ? null : normalizeOptionalText$46(fromEpochRaw);
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);
20287
20299
  if (fromEpochRaw !== null && fromEpoch === null) return null;
20288
- const errorMessage = errorMessageRaw === null ? null : normalizeOptionalText$46(errorMessageRaw);
20300
+ const errorMessage = errorMessageRaw === null ? null : normalizeOptionalText$47(errorMessageRaw);
20289
20301
  if (errorMessageRaw !== null && errorMessage === null) return null;
20290
20302
  return {
20291
20303
  schema: RUNTIME_CONTRACT_REPAIR_REPORT_SCHEMA,
@@ -20426,8 +20438,8 @@ const backupAndCleanRuntimeState = async (input) => {
20426
20438
  }
20427
20439
  };
20428
20440
  const ensureDaemonRuntimeContractState = async (input) => {
20429
- const contractEpoch = normalizeOptionalText$46(input.contractEpoch) ?? DAEMON_RUNTIME_CONTRACT_EPOCH;
20430
- const nowIso = normalizeOptionalText$46(input.nowIso) ?? (/* @__PURE__ */ new Date()).toISOString();
20441
+ const contractEpoch = normalizeOptionalText$47(input.contractEpoch) ?? DAEMON_RUNTIME_CONTRACT_EPOCH;
20442
+ const nowIso = normalizeOptionalText$47(input.nowIso) ?? (/* @__PURE__ */ new Date()).toISOString();
20431
20443
  const stateFilePaths = getRuntimeStateFilePaths(input.runtimePaths);
20432
20444
  const existingStatePaths = [];
20433
20445
  for (const statePath of stateFilePaths) if (await fileExists(statePath)) existingStatePaths.push(statePath);
@@ -21444,7 +21456,7 @@ async function readDaemonActiveBundleState(pathInput = {}) {
21444
21456
  sourceEntryScriptPath: parsed.sourceEntryScriptPath,
21445
21457
  sourcePackageRootPath: parsed.sourcePackageRootPath,
21446
21458
  sourceDistRootPath: parsed.sourceDistRootPath,
21447
- sourceDistFingerprint: normalizeOptionalText$45(parsed.sourceDistFingerprint),
21459
+ sourceDistFingerprint: normalizeOptionalText$46(parsed.sourceDistFingerprint),
21448
21460
  sourceKind: parsed.sourceKind,
21449
21461
  createdAt: parsed.createdAt,
21450
21462
  updatedAt: parsed.updatedAt
@@ -22410,7 +22422,7 @@ function isPackageEntryResolutionError(error) {
22410
22422
  const code = getErrorCode$3(error);
22411
22423
  return code === "MODULE_NOT_FOUND" || code === "ERR_PACKAGE_PATH_NOT_EXPORTED";
22412
22424
  }
22413
- function normalizeOptionalText$45(value) {
22425
+ function normalizeOptionalText$46(value) {
22414
22426
  const normalized = String(value ?? "").trim();
22415
22427
  return normalized.length > 0 ? normalized : null;
22416
22428
  }
@@ -25157,20 +25169,20 @@ function resolveOpenMeldEnvironmentTargetFromEnv(input = {}) {
25157
25169
  };
25158
25170
  }
25159
25171
  function resolveUserFacingCommandForPreset(input) {
25160
- const explicitCommand = normalizeOptionalText$44(input.env[OPENMELD_USER_FACING_CLI_COMMAND_ENV$1]);
25172
+ const explicitCommand = normalizeOptionalText$45(input.env[OPENMELD_USER_FACING_CLI_COMMAND_ENV$1]);
25161
25173
  if (explicitCommand) return explicitCommand;
25162
25174
  if (input.preset === "dev-local") return "openmeld-dev";
25163
25175
  if (input.preset === "canary") return "openmeld-canary";
25164
25176
  return resolveUserFacingCliEntryCommand({ env: input.env });
25165
25177
  }
25166
25178
  function resolveGatewayUrlFromEnvOnly(input) {
25167
- const fromInput = normalizeOptionalText$44(input.gatewayUrl);
25179
+ const fromInput = normalizeOptionalText$45(input.gatewayUrl);
25168
25180
  if (fromInput) return normalizeGatewayBaseUrl(fromInput);
25169
- const fromEnv = normalizeOptionalText$44(input.env.OPENMELD_GATEWAY_URL);
25181
+ const fromEnv = normalizeOptionalText$45(input.env.OPENMELD_GATEWAY_URL);
25170
25182
  if (fromEnv) return normalizeGatewayBaseUrl(fromEnv);
25171
25183
  return normalizeGatewayBaseUrl(resolveDefaultGatewayBaseUrl({ env: input.env }));
25172
25184
  }
25173
- function normalizeOptionalText$44(value) {
25185
+ function normalizeOptionalText$45(value) {
25174
25186
  const normalized = String(value ?? "").trim();
25175
25187
  return normalized.length > 0 ? normalized : null;
25176
25188
  }
@@ -25797,7 +25809,7 @@ async function resolveInstalledCursorLaunchCandidates(input) {
25797
25809
  const installedCandidates = await resolveInstalledNodeScriptLaunchCandidates({
25798
25810
  additionalCommandDirectories: resolveCursorCommandDirectories(),
25799
25811
  commandName: DEFAULT_CURSOR_COMMAND,
25800
- configuredCommand: normalizeOptionalText$43(process.env.OPENMELD_DAEMON_RUNTIME_CURSOR_BIN),
25812
+ configuredCommand: normalizeOptionalText$44(process.env.OPENMELD_DAEMON_RUNTIME_CURSOR_BIN),
25801
25813
  displayName: "Cursor CLI",
25802
25814
  preferredLaunchContract: input?.preferredLaunchContract
25803
25815
  });
@@ -25820,7 +25832,7 @@ async function resolveInstalledCursorLaunchCandidates(input) {
25820
25832
  };
25821
25833
  }
25822
25834
  async function refreshCursorPersistedLaunchContract(input) {
25823
- const configuredCommand = normalizeOptionalText$43(process.env.OPENMELD_DAEMON_RUNTIME_CURSOR_BIN);
25835
+ const configuredCommand = normalizeOptionalText$44(process.env.OPENMELD_DAEMON_RUNTIME_CURSOR_BIN);
25824
25836
  if (configuredCommand) {
25825
25837
  const resolution = await resolveInstalledNodeScriptLaunchContract({
25826
25838
  commandName: DEFAULT_CURSOR_COMMAND,
@@ -25834,7 +25846,7 @@ async function refreshCursorPersistedLaunchContract(input) {
25834
25846
  }
25835
25847
  if (input.launchContract.kind !== "node_script") return input.launchContract;
25836
25848
  const persistedLaunchContract = input.launchContract;
25837
- const home = normalizeOptionalText$43(process.env.HOME) ?? homedir();
25849
+ const home = normalizeOptionalText$44(process.env.HOME) ?? homedir();
25838
25850
  const managedVersionsRoot = join(home, ".local", "share", "cursor-agent", "versions");
25839
25851
  const canonicalManagedVersionsRoot = await realpath(managedVersionsRoot).catch(() => managedVersionsRoot);
25840
25852
  const canonicalPersistedScriptPath = await realpath(persistedLaunchContract.scriptPath).catch(() => persistedLaunchContract.scriptPath);
@@ -25874,7 +25886,7 @@ async function verifyCursorLaunchContract(input) {
25874
25886
  });
25875
25887
  }
25876
25888
  function resolveCursorTimeoutMs() {
25877
- const raw = normalizeOptionalText$43(process.env.OPENMELD_DAEMON_RUNTIME_REQUEST_TIMEOUT_MS);
25889
+ const raw = normalizeOptionalText$44(process.env.OPENMELD_DAEMON_RUNTIME_REQUEST_TIMEOUT_MS);
25878
25890
  if (!raw) return null;
25879
25891
  const parsed = Number.parseInt(raw, 10);
25880
25892
  if (!Number.isFinite(parsed) || parsed <= 0) return null;
@@ -25887,7 +25899,7 @@ function isIncompleteLaunchContractCheck(verification) {
25887
25899
  return !verification.ok && verification.failureKind === "incomplete_check";
25888
25900
  }
25889
25901
  function resolveCursorCommandDirectories() {
25890
- return resolveCursorCommandPaths(normalizeOptionalText$43(process.env.HOME) ?? homedir()).map(dirname);
25902
+ return resolveCursorCommandPaths(normalizeOptionalText$44(process.env.HOME) ?? homedir()).map(dirname);
25891
25903
  }
25892
25904
  function resolveCursorCommandPaths(home) {
25893
25905
  return [join(home, ".local", "bin", DEFAULT_CURSOR_COMMAND), join(home, ".cursor", "bin", DEFAULT_CURSOR_COMMAND)];
@@ -25896,7 +25908,7 @@ function isManagedCursorVersionScript(input) {
25896
25908
  const segments = relative(input.managedVersionsRoot, input.scriptPath).split(PATH_SEGMENT_SPLIT_RE);
25897
25909
  return segments.length === 2 && segments[0] !== ".." && segments[0] !== "." && segments[1] === DEFAULT_CURSOR_COMMAND;
25898
25910
  }
25899
- function normalizeOptionalText$43(value) {
25911
+ function normalizeOptionalText$44(value) {
25900
25912
  const normalized = String(value ?? "").trim();
25901
25913
  return normalized.length > 0 ? normalized : null;
25902
25914
  }
@@ -26114,13 +26126,13 @@ var CursorAcpTransportError = class extends Error {
26114
26126
  }
26115
26127
  };
26116
26128
  async function invokeCursorAcpTransport(input) {
26117
- const prompt = normalizeOptionalText$42(input.prompt);
26129
+ const prompt = normalizeOptionalText$43(input.prompt);
26118
26130
  if (!prompt) throw new CursorAcpTransportError({
26119
26131
  code: "schema.invalid",
26120
26132
  errorType: "config",
26121
26133
  message: "schema.invalid: prompt is required"
26122
26134
  });
26123
- if (normalizeOptionalText$42(input.conversationPolicy?.reasoningLevel)) throw new CursorAcpTransportError({
26135
+ if (normalizeOptionalText$43(input.conversationPolicy?.reasoningLevel)) throw new CursorAcpTransportError({
26124
26136
  code: "model.reasoning_unsupported",
26125
26137
  errorType: "config",
26126
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"
@@ -26146,12 +26158,12 @@ async function invokeCursorAcpTransport(input) {
26146
26158
  }
26147
26159
  async function runCursorAcpTurn(input) {
26148
26160
  await input.session.initialize();
26149
- const existingSessionId = normalizeOptionalText$42(input.input.sessionId);
26161
+ const existingSessionId = normalizeOptionalText$43(input.input.sessionId);
26150
26162
  const initialDescriptor = await input.session.openSession({ sessionId: existingSessionId });
26151
26163
  input.session.emitProviderConversationObserved(initialDescriptor.sessionId);
26152
26164
  const modelResolution = await resolveCursorSessionModel({
26153
26165
  descriptor: initialDescriptor,
26154
- model: normalizeOptionalText$42(input.input.conversationPolicy?.model),
26166
+ model: normalizeOptionalText$43(input.input.conversationPolicy?.model),
26155
26167
  session: input.session
26156
26168
  });
26157
26169
  const { descriptor } = modelResolution;
@@ -26406,7 +26418,7 @@ var CursorAcpSession = class {
26406
26418
  return readSessionDescriptor(result, input.sessionId, "load");
26407
26419
  }
26408
26420
  const result = await this.request("session/new", params);
26409
- const sessionId = normalizeOptionalText$42(toRecord$4(result)?.sessionId);
26421
+ const sessionId = normalizeOptionalText$43(toRecord$4(result)?.sessionId);
26410
26422
  if (!sessionId) throw new CursorAcpTransportError({
26411
26423
  code: "protocol.invalid",
26412
26424
  errorType: "adapter",
@@ -26542,8 +26554,8 @@ function readSessionDescriptor(value, sessionId, sessionOperation) {
26542
26554
  const modelConfig = readConfigOption(record, "model");
26543
26555
  const legacyAvailableModelIds = readLegacyAvailableModelIds(models);
26544
26556
  const configAvailableModelIds = readConfigAvailableModelIds(modelConfig);
26545
- const legacyCurrentModelId = normalizeOptionalText$42(models?.currentModelId);
26546
- const configCurrentModelId = normalizeOptionalText$42(modelConfig?.currentValue);
26557
+ const legacyCurrentModelId = normalizeOptionalText$43(models?.currentModelId);
26558
+ const configCurrentModelId = normalizeOptionalText$43(modelConfig?.currentValue);
26547
26559
  const modelInventory = resolveModelInventory({
26548
26560
  configAvailableModelIds,
26549
26561
  configCurrentModelId,
@@ -26555,7 +26567,7 @@ function readSessionDescriptor(value, sessionId, sessionOperation) {
26555
26567
  availableModelIds: modelInventory.availableModelIds,
26556
26568
  configAvailableModelIds,
26557
26569
  configCurrentModelId,
26558
- currentModeId: normalizeOptionalText$42(modes?.currentModeId) ?? readCurrentConfigValue(record, "mode"),
26570
+ currentModeId: normalizeOptionalText$43(modes?.currentModeId) ?? readCurrentConfigValue(record, "mode"),
26559
26571
  currentModelId: modelInventory.currentModelId,
26560
26572
  legacyAvailableModelIds,
26561
26573
  legacyCurrentModelId,
@@ -26571,7 +26583,7 @@ function readConfigAvailableModelIds(modelConfig) {
26571
26583
  return uniqueModelIds((Array.isArray(modelConfig?.options) ? modelConfig.options : []).map((option) => toRecord$4(option)?.value));
26572
26584
  }
26573
26585
  function uniqueModelIds(values) {
26574
- return [...new Set(values.map(normalizeOptionalText$42).filter((modelId) => modelId !== null))];
26586
+ return [...new Set(values.map(normalizeOptionalText$43).filter((modelId) => modelId !== null))];
26575
26587
  }
26576
26588
  function resolveModelInventory(input) {
26577
26589
  const currentModelId = input.configCurrentModelId ?? input.legacyCurrentModelId;
@@ -26643,10 +26655,10 @@ function sanitizeDiagnosticModelId(modelId) {
26643
26655
  return modelId === null ? null : modelId.slice(0, MAX_MODEL_DIAGNOSTIC_ID_CHARS);
26644
26656
  }
26645
26657
  function readCurrentConfigValue(record, id) {
26646
- return normalizeOptionalText$42(readConfigOption(record, id)?.currentValue);
26658
+ return normalizeOptionalText$43(readConfigOption(record, id)?.currentValue);
26647
26659
  }
26648
26660
  function readConfigOption(record, id) {
26649
- return (Array.isArray(record?.configOptions) ? record.configOptions : []).map(toRecord$4).find((option) => (normalizeOptionalText$42(option?.configId) ?? normalizeOptionalText$42(option?.id)) === id) ?? null;
26661
+ return (Array.isArray(record?.configOptions) ? record.configOptions : []).map(toRecord$4).find((option) => (normalizeOptionalText$43(option?.configId) ?? normalizeOptionalText$43(option?.id)) === id) ?? null;
26650
26662
  }
26651
26663
  function resolveCursorAcpMode(value) {
26652
26664
  switch (resolveCursorPermissionMode(value)) {
@@ -26673,7 +26685,7 @@ function buildCursorAcpArgs(permissionMode) {
26673
26685
  }
26674
26686
  }
26675
26687
  function assertSuccessfulStopReason(value) {
26676
- const stopReason = normalizeOptionalText$42(toRecord$4(value)?.stopReason);
26688
+ const stopReason = normalizeOptionalText$43(toRecord$4(value)?.stopReason);
26677
26689
  if (!stopReason) throw new CursorAcpTransportError({
26678
26690
  code: "protocol.invalid",
26679
26691
  errorType: "adapter",
@@ -26694,7 +26706,7 @@ async function emitFinalPreviewIfRequested(input) {
26694
26706
  await input.onPreview({ text: input.output });
26695
26707
  }
26696
26708
  function toJsonRpcTransportError(error) {
26697
- const message = normalizeOptionalText$42(error.message) ?? "Cursor ACP error";
26709
+ const message = normalizeOptionalText$43(error.message) ?? "Cursor ACP error";
26698
26710
  const originalError = createProviderOriginalError(message);
26699
26711
  if (error.code === -32601) return new CursorAcpTransportError({
26700
26712
  code: "protocol.method_not_found",
@@ -26718,7 +26730,7 @@ function toCursorAcpTransportError(error, stderr, diagnostics) {
26718
26730
  message: error.message,
26719
26731
  ...error.originalError ? { originalError: error.originalError } : {}
26720
26732
  });
26721
- const classified = classifyCursorFailure([toErrorMessage$30(error), normalizeOptionalText$42(stderr)].filter((value) => value !== null).join("\n"));
26733
+ const classified = classifyCursorFailure([toErrorMessage$30(error), normalizeOptionalText$43(stderr)].filter((value) => value !== null).join("\n"));
26722
26734
  return diagnostics ? new CursorAcpTransportError({
26723
26735
  code: classified.code,
26724
26736
  diagnostics,
@@ -26727,7 +26739,7 @@ function toCursorAcpTransportError(error, stderr, diagnostics) {
26727
26739
  }) : classified;
26728
26740
  }
26729
26741
  function classifyCursorFailure(message, originalError = null) {
26730
- const normalized = normalizeOptionalText$42(message) ?? "Cursor ACP error";
26742
+ const normalized = normalizeOptionalText$43(message) ?? "Cursor ACP error";
26731
26743
  const lowered = normalized.toLowerCase();
26732
26744
  if (isCursorPlanUpgradeRequired(normalized)) return new CursorAcpTransportError({
26733
26745
  code: "cursor.plan_upgrade_required",
@@ -26763,7 +26775,7 @@ function classifyCursorFailure(message, originalError = null) {
26763
26775
  function normalizeOutputText(value) {
26764
26776
  return typeof value === "string" && value.length > 0 ? value : null;
26765
26777
  }
26766
- function normalizeOptionalText$42(value) {
26778
+ function normalizeOptionalText$43(value) {
26767
26779
  const normalized = typeof value === "string" ? value.trim() : "";
26768
26780
  return normalized.length > 0 ? normalized : null;
26769
26781
  }
@@ -26864,7 +26876,7 @@ function createDefaultCursorInvoke(input) {
26864
26876
  });
26865
26877
  } : void 0;
26866
26878
  const result = await invokeWithSingleContextHeal({
26867
- contextId: normalizeOptionalText$41(dispatchInput.agentControllerConversationId),
26879
+ contextId: normalizeOptionalText$42(dispatchInput.agentControllerConversationId),
26868
26880
  contextLossPolicy: dispatchInput.executionMode === "repair" ? "fail" : "rebuild",
26869
26881
  createRebuildFailedError: (error) => error instanceof CursorAcpTransportError && error.code === "cursor.plan_upgrade_required" ? error : new CursorAcpTransportError({
26870
26882
  cause: error,
@@ -26918,7 +26930,7 @@ function createDefaultCursorInvoke(input) {
26918
26930
  };
26919
26931
  }
26920
26932
  async function resolveCursorDispatchLaunchContract(input) {
26921
- const launchContract = input.inputLaunchContract ?? input.optionLaunchContract ?? (normalizeOptionalText$41(input.cursorBin) ? buildExecutableLaunchContract({ commandPath: normalizeOptionalText$41(input.cursorBin) }) : null);
26933
+ const launchContract = input.inputLaunchContract ?? input.optionLaunchContract ?? (normalizeOptionalText$42(input.cursorBin) ? buildExecutableLaunchContract({ commandPath: normalizeOptionalText$42(input.cursorBin) }) : null);
26922
26934
  if (!launchContract) throw Object.assign(/* @__PURE__ */ new Error("Cursor CLI launch contract is required for runtime dispatch."), {
26923
26935
  code: "controller.launch.needs_repair",
26924
26936
  errorType: "config"
@@ -26991,7 +27003,7 @@ async function interruptActiveCursorTurn(input) {
26991
27003
  };
26992
27004
  }
26993
27005
  }
26994
- function normalizeOptionalText$41(value) {
27006
+ function normalizeOptionalText$42(value) {
26995
27007
  const normalized = typeof value === "string" ? value.trim() : "";
26996
27008
  return normalized.length > 0 ? normalized : null;
26997
27009
  }
@@ -27031,7 +27043,7 @@ const DEFAULT_OPENCLAW_AGENT_ID = "main";
27031
27043
  async function resolveInstalledOpenClawLaunchCandidates(input) {
27032
27044
  const installedCandidates = await resolveInstalledNodeScriptLaunchCandidates({
27033
27045
  commandName: DEFAULT_OPENCLAW_COMMAND,
27034
- configuredCommand: normalizeOptionalText$40(process.env.OPENMELD_DAEMON_RUNTIME_OPENCLAW_BIN),
27046
+ configuredCommand: normalizeOptionalText$41(process.env.OPENMELD_DAEMON_RUNTIME_OPENCLAW_BIN),
27035
27047
  displayName: "OpenClaw",
27036
27048
  preferredLaunchContract: input?.preferredLaunchContract
27037
27049
  });
@@ -27064,9 +27076,9 @@ async function verifyOpenClawLaunchContract(input) {
27064
27076
  }
27065
27077
  function resolveOpenClawBinCandidates(explicitOpenClawBin) {
27066
27078
  const candidates = [];
27067
- const explicitCandidate = normalizeOptionalText$40(explicitOpenClawBin);
27079
+ const explicitCandidate = normalizeOptionalText$41(explicitOpenClawBin);
27068
27080
  if (explicitCandidate) candidates.push(explicitCandidate);
27069
- const configuredCandidate = normalizeOptionalText$40(process.env.OPENMELD_DAEMON_RUNTIME_OPENCLAW_BIN);
27081
+ const configuredCandidate = normalizeOptionalText$41(process.env.OPENMELD_DAEMON_RUNTIME_OPENCLAW_BIN);
27070
27082
  if (configuredCandidate && !candidates.includes(configuredCandidate)) candidates.push(configuredCandidate);
27071
27083
  const nodeSiblingCandidate = resolveSiblingCommandPath({
27072
27084
  anchorPath: process.execPath,
@@ -27082,16 +27094,16 @@ function resolveOpenClawBinCandidates(explicitOpenClawBin) {
27082
27094
  return candidates;
27083
27095
  }
27084
27096
  function resolveOpenClawTimeoutMs() {
27085
- const raw = normalizeOptionalText$40(process.env.OPENMELD_DAEMON_RUNTIME_REQUEST_TIMEOUT_MS);
27097
+ const raw = normalizeOptionalText$41(process.env.OPENMELD_DAEMON_RUNTIME_REQUEST_TIMEOUT_MS);
27086
27098
  if (!raw) return null;
27087
27099
  const parsed = Number.parseInt(raw, 10);
27088
27100
  if (!Number.isFinite(parsed) || parsed <= 0) return null;
27089
27101
  return parsed;
27090
27102
  }
27091
27103
  function resolveOpenClawAgentId$1() {
27092
- return normalizeOptionalText$40(process.env.OPENMELD_DAEMON_RUNTIME_OPENCLAW_AGENT_ID) ?? DEFAULT_OPENCLAW_AGENT_ID;
27104
+ return normalizeOptionalText$41(process.env.OPENMELD_DAEMON_RUNTIME_OPENCLAW_AGENT_ID) ?? DEFAULT_OPENCLAW_AGENT_ID;
27093
27105
  }
27094
- function normalizeOptionalText$40(value) {
27106
+ function normalizeOptionalText$41(value) {
27095
27107
  const normalized = String(value ?? "").trim();
27096
27108
  return normalized.length > 0 ? normalized : null;
27097
27109
  }
@@ -27230,10 +27242,10 @@ function resolveIsErrorResult(record) {
27230
27242
  if (typeof record.isError === "boolean") return record.isError;
27231
27243
  if (typeof record.ok === "boolean") return !record.ok;
27232
27244
  if (typeof record.success === "boolean") return !record.success;
27233
- const status = normalizeOptionalText$39(record.status)?.toLowerCase();
27245
+ const status = normalizeOptionalText$40(record.status)?.toLowerCase();
27234
27246
  if (status === "error" || status === "failed" || status === "fail") return true;
27235
27247
  if (status === "ok" || status === "success" || status === "completed") return false;
27236
- const type = normalizeOptionalText$39(record.type)?.toLowerCase();
27248
+ const type = normalizeOptionalText$40(record.type)?.toLowerCase();
27237
27249
  if (type === "error" || type === "failure") return true;
27238
27250
  if (type === "result" || type === "success") return false;
27239
27251
  if (record.error !== void 0 || record.errors !== void 0) return true;
@@ -27282,7 +27294,7 @@ function normalizeCandidateValue(value) {
27282
27294
  }
27283
27295
  return null;
27284
27296
  }
27285
- function normalizeOptionalText$39(value) {
27297
+ function normalizeOptionalText$40(value) {
27286
27298
  const normalized = String(value ?? "").trim();
27287
27299
  return normalized.length > 0 ? normalized : null;
27288
27300
  }
@@ -27340,7 +27352,7 @@ function classifyOpenClawFailureMessage(input) {
27340
27352
  });
27341
27353
  }
27342
27354
  function normalizeOpenClawFailureMessage(value) {
27343
- const normalized = normalizeOptionalText$38(value);
27355
+ const normalized = normalizeOptionalText$39(value);
27344
27356
  if (!normalized) return null;
27345
27357
  return extractJsonFailureDetail(normalized) ?? normalized;
27346
27358
  }
@@ -27349,7 +27361,7 @@ function extractJsonFailureDetail(value) {
27349
27361
  const parsed = JSON.parse(value);
27350
27362
  if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return null;
27351
27363
  const record = parsed;
27352
- return normalizeOptionalText$38(record.detail) ?? normalizeOptionalText$38(record.message) ?? (record.error && typeof record.error === "object" && !Array.isArray(record.error) ? normalizeOptionalText$38(record.error.message) : null);
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);
27353
27365
  } catch {
27354
27366
  return null;
27355
27367
  }
@@ -27369,7 +27381,7 @@ function isRateLimitFailure(value) {
27369
27381
  function isInputSelectorFailure(value) {
27370
27382
  return value.includes("pass --to") && value.includes("--session-id") && value.includes("--agent") || value.includes("unknown agent") || value.includes("agent not found");
27371
27383
  }
27372
- function normalizeOptionalText$38(value) {
27384
+ function normalizeOptionalText$39(value) {
27373
27385
  const normalized = typeof value === "string" ? value.trim() : "";
27374
27386
  return normalized.length > 0 ? normalized : null;
27375
27387
  }
@@ -27388,7 +27400,7 @@ var OpenClawCliTransportError = class extends Error {
27388
27400
  }
27389
27401
  };
27390
27402
  async function invokeOpenClawCliTransport(input) {
27391
- const prompt = normalizeOptionalText$37(input.prompt);
27403
+ const prompt = normalizeOptionalText$38(input.prompt);
27392
27404
  if (!prompt) throw new OpenClawCliTransportError({
27393
27405
  code: "schema.invalid",
27394
27406
  errorType: "config",
@@ -27397,7 +27409,7 @@ async function invokeOpenClawCliTransport(input) {
27397
27409
  const { args, sessionId: initialSessionId } = buildOpenClawArgs({
27398
27410
  openClawAgentId: input.openClawAgentId,
27399
27411
  prompt,
27400
- sessionId: normalizeOptionalText$37(input.sessionId)
27412
+ sessionId: normalizeOptionalText$38(input.sessionId)
27401
27413
  });
27402
27414
  const invocation = buildCliLaunchInvocation({
27403
27415
  args,
@@ -27474,7 +27486,7 @@ async function invokeOpenClawCliTransport(input) {
27474
27486
  stdoutText: driverResult.stdoutText
27475
27487
  }));
27476
27488
  }
27477
- const output = normalizeOptionalText$37(latestOutput);
27489
+ const output = normalizeOptionalText$38(latestOutput);
27478
27490
  if (!output) {
27479
27491
  const fallbackOutput = resolveSuccessFallbackOutput(driverResult.stdoutText);
27480
27492
  if (!fallbackOutput) {
@@ -27492,25 +27504,25 @@ async function invokeOpenClawCliTransport(input) {
27492
27504
  }
27493
27505
  return {
27494
27506
  output: fallbackOutput,
27495
- sessionId: normalizeOptionalText$37(resolvedSessionId),
27507
+ sessionId: normalizeOptionalText$38(resolvedSessionId),
27496
27508
  telemetry: buildTransportTelemetry({
27497
27509
  driverResult,
27498
27510
  firstStderrAtMs,
27499
27511
  firstStdoutAtMs,
27500
27512
  invokedAtMs,
27501
- resumedContext: normalizeOptionalText$37(input.sessionId) !== null
27513
+ resumedContext: normalizeOptionalText$38(input.sessionId) !== null
27502
27514
  })
27503
27515
  };
27504
27516
  }
27505
27517
  return {
27506
27518
  output,
27507
- sessionId: normalizeOptionalText$37(resolvedSessionId),
27519
+ sessionId: normalizeOptionalText$38(resolvedSessionId),
27508
27520
  telemetry: buildTransportTelemetry({
27509
27521
  driverResult,
27510
27522
  firstStderrAtMs,
27511
27523
  firstStdoutAtMs,
27512
27524
  invokedAtMs,
27513
- resumedContext: normalizeOptionalText$37(input.sessionId) !== null
27525
+ resumedContext: normalizeOptionalText$38(input.sessionId) !== null
27514
27526
  })
27515
27527
  };
27516
27528
  }
@@ -27577,7 +27589,7 @@ const classifyOpenClawFailure = (input) => {
27577
27589
  isContextLost: isLikelyOpenClawContextLostError,
27578
27590
  message: providerMessage
27579
27591
  });
27580
- const stderrText = normalizeOptionalText$37(input.stderrText);
27592
+ const stderrText = normalizeOptionalText$38(input.stderrText);
27581
27593
  if (stderrText) return {
27582
27594
  code: "upstream_unreachable",
27583
27595
  errorType: "adapter",
@@ -27589,13 +27601,13 @@ const resolveProviderFailureMessage = (input) => {
27589
27601
  const candidateMessages = [
27590
27602
  ...input.providerErrorMessages,
27591
27603
  ...extractErrorMessagesFromStdout(input.stdoutText),
27592
- ...normalizeOptionalText$37(input.stderrText) ? [normalizeOptionalText$37(input.stderrText)] : []
27604
+ ...normalizeOptionalText$38(input.stderrText) ? [normalizeOptionalText$38(input.stderrText)] : []
27593
27605
  ].filter((value) => Boolean(value));
27594
27606
  for (const candidate of candidateMessages) if (looksLikeRuntimePermissionDenialMessage(candidate) || looksLikeProviderFailure(candidate)) return candidate;
27595
27607
  return candidateMessages[0] ?? null;
27596
27608
  };
27597
27609
  const extractErrorMessagesFromStdout = (value) => {
27598
- const stdoutText = normalizeOptionalText$37(value);
27610
+ const stdoutText = normalizeOptionalText$38(value);
27599
27611
  if (!stdoutText) return [];
27600
27612
  const messages = [];
27601
27613
  const lines = stdoutText.split("\n");
@@ -27606,7 +27618,7 @@ const extractErrorMessagesFromStdout = (value) => {
27606
27618
  return messages;
27607
27619
  };
27608
27620
  const resolveSuccessFallbackOutput = (value) => {
27609
- const stdoutText = normalizeOptionalText$37(value);
27621
+ const stdoutText = normalizeOptionalText$38(value);
27610
27622
  if (!stdoutText) return null;
27611
27623
  const lines = stdoutText.split("\n").map((line) => line.trim()).filter((line) => line.length > 0);
27612
27624
  if (lines.length !== 1) return null;
@@ -27616,12 +27628,12 @@ const resolveSuccessFallbackOutput = (value) => {
27616
27628
  return singleLine;
27617
27629
  };
27618
27630
  const collectProviderErrorMessage = (line, output) => {
27619
- const normalized = normalizeOptionalText$37(line);
27631
+ const normalized = normalizeOptionalText$38(line);
27620
27632
  if (!normalized) return;
27621
27633
  output.push(normalized);
27622
27634
  };
27623
27635
  const collectRuntimePermissionDenialMessage = (line, output) => {
27624
- const normalized = normalizeOptionalText$37(line);
27636
+ const normalized = normalizeOptionalText$38(line);
27625
27637
  if (!(normalized && looksLikeRuntimePermissionDenialMessage(normalized))) return;
27626
27638
  output.push(normalized);
27627
27639
  };
@@ -27632,7 +27644,7 @@ const looksLikeProviderFailure = (value) => {
27632
27644
  function normalizeText$4(value) {
27633
27645
  return String(value ?? "").trim();
27634
27646
  }
27635
- function normalizeOptionalText$37(value) {
27647
+ function normalizeOptionalText$38(value) {
27636
27648
  const normalized = normalizeText$4(value);
27637
27649
  return normalized.length > 0 ? normalized : null;
27638
27650
  }
@@ -27764,15 +27776,15 @@ async function readSessionIndex(input) {
27764
27776
  }
27765
27777
  }
27766
27778
  function resolveOpenClawStateDir(env) {
27767
- const configuredStateDir = normalizeOptionalText$36(env?.OPENCLAW_STATE_DIR);
27779
+ const configuredStateDir = normalizeOptionalText$37(env?.OPENCLAW_STATE_DIR);
27768
27780
  if (configuredStateDir) return configuredStateDir;
27769
27781
  return join(homedir(), ".openclaw");
27770
27782
  }
27771
27783
  function resolveSessionFilePath(input) {
27772
27784
  const sessionsDir = join(resolveOpenClawStateDir(input.env), "agents", input.agentId, "sessions");
27773
- const sessionFile = normalizeOptionalText$36(input.sessionEntry.sessionFile);
27785
+ const sessionFile = normalizeOptionalText$37(input.sessionEntry.sessionFile);
27774
27786
  if (sessionFile) return isAbsolute(sessionFile) ? sessionFile : join(sessionsDir, sessionFile);
27775
- const sessionId = normalizeOptionalText$36(input.sessionEntry.sessionId);
27787
+ const sessionId = normalizeOptionalText$37(input.sessionEntry.sessionId);
27776
27788
  if (!sessionId) return null;
27777
27789
  return join(sessionsDir, `${sessionId}.jsonl`);
27778
27790
  }
@@ -27793,11 +27805,11 @@ function parseSessionErrorRecord(line) {
27793
27805
  const parsed = JSON.parse(line);
27794
27806
  if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return null;
27795
27807
  const record = parsed;
27796
- if (normalizeOptionalText$36(record.type) !== "message") return null;
27808
+ if (normalizeOptionalText$37(record.type) !== "message") return null;
27797
27809
  const message = record.message && typeof record.message === "object" ? record.message : null;
27798
27810
  if (!message) return null;
27799
- if (normalizeOptionalText$36(message.stopReason) !== "error") return null;
27800
- const errorMessage = normalizeOptionalText$36(message.errorMessage);
27811
+ if (normalizeOptionalText$37(message.stopReason) !== "error") return null;
27812
+ const errorMessage = normalizeOptionalText$37(message.errorMessage);
27801
27813
  if (!errorMessage) return null;
27802
27814
  const messageTimestampMs = normalizeOptionalNumber(message.timestamp) ?? normalizeIsoTimestampMs(record.timestamp);
27803
27815
  if (messageTimestampMs === null) return null;
@@ -27810,7 +27822,7 @@ function parseSessionErrorRecord(line) {
27810
27822
  }
27811
27823
  }
27812
27824
  function normalizeIsoTimestampMs(value) {
27813
- const normalized = normalizeOptionalText$36(value);
27825
+ const normalized = normalizeOptionalText$37(value);
27814
27826
  if (!normalized) return null;
27815
27827
  const parsed = Date.parse(normalized);
27816
27828
  return Number.isFinite(parsed) ? parsed : null;
@@ -27818,7 +27830,7 @@ function normalizeIsoTimestampMs(value) {
27818
27830
  function normalizeOptionalNumber(value) {
27819
27831
  return typeof value === "number" && Number.isFinite(value) ? value : null;
27820
27832
  }
27821
- function normalizeOptionalText$36(value) {
27833
+ function normalizeOptionalText$37(value) {
27822
27834
  const normalized = typeof value === "string" ? value.trim() : "";
27823
27835
  return normalized.length > 0 ? normalized : null;
27824
27836
  }
@@ -27839,8 +27851,8 @@ var OpenClawGatewayTransportError = class extends Error {
27839
27851
  }
27840
27852
  };
27841
27853
  async function invokeOpenClawGatewayTransport(input) {
27842
- const prompt = normalizeOptionalText$35(input.prompt);
27843
- const sessionKey = normalizeOptionalText$35(input.sessionKey);
27854
+ const prompt = normalizeOptionalText$36(input.prompt);
27855
+ const sessionKey = normalizeOptionalText$36(input.sessionKey);
27844
27856
  if (!prompt) throw new OpenClawGatewayTransportError({
27845
27857
  code: "schema.invalid",
27846
27858
  errorType: "config",
@@ -27953,9 +27965,9 @@ function normalizeOpenClawGatewayAgentResult(result, expectedSessionKey) {
27953
27965
  message: "upstream_unreachable: openclaw gateway returned a non-object payload for agent"
27954
27966
  });
27955
27967
  const record = result;
27956
- const status = normalizeOptionalText$35(record.status);
27968
+ const status = normalizeOptionalText$36(record.status);
27957
27969
  if (!status || status === "ok") return extractSuccessfulAgentResult(record.result, expectedSessionKey);
27958
- throw classifyGatewayFailure(normalizeOptionalText$35(record.summary) ?? normalizeOptionalText$35(record.error) ?? `openclaw gateway agent returned status '${status}'`, true);
27970
+ throw classifyGatewayFailure(normalizeOptionalText$36(record.summary) ?? normalizeOptionalText$36(record.error) ?? `openclaw gateway agent returned status '${status}'`, true);
27959
27971
  }
27960
27972
  function extractSuccessfulAgentResult(result, expectedSessionKey) {
27961
27973
  if (!result || typeof result !== "object") throw new OpenClawGatewayTransportError({
@@ -27980,7 +27992,7 @@ function normalizeAgentMeta(meta, expectedSessionKey) {
27980
27992
  const record = meta;
27981
27993
  const systemPromptReport = record.systemPromptReport;
27982
27994
  if (systemPromptReport && typeof systemPromptReport === "object") {
27983
- const actualSessionKey = normalizeOptionalText$35(systemPromptReport.sessionKey);
27995
+ const actualSessionKey = normalizeOptionalText$36(systemPromptReport.sessionKey);
27984
27996
  if (actualSessionKey && actualSessionKey !== expectedSessionKey) throw new OpenClawGatewayTransportError({
27985
27997
  code: "upstream_unreachable",
27986
27998
  errorType: "adapter",
@@ -27988,15 +28000,15 @@ function normalizeAgentMeta(meta, expectedSessionKey) {
27988
28000
  });
27989
28001
  }
27990
28002
  const agentMeta = record.agentMeta;
27991
- const agentSessionId = agentMeta && typeof agentMeta === "object" ? normalizeOptionalText$35(agentMeta.sessionId) : null;
27992
- const reportSessionId = systemPromptReport && typeof systemPromptReport === "object" ? normalizeOptionalText$35(systemPromptReport.sessionId) : null;
28003
+ const agentSessionId = agentMeta && typeof agentMeta === "object" ? normalizeOptionalText$36(agentMeta.sessionId) : null;
28004
+ const reportSessionId = systemPromptReport && typeof systemPromptReport === "object" ? normalizeOptionalText$36(systemPromptReport.sessionId) : null;
27993
28005
  return { sessionId: agentSessionId ?? reportSessionId };
27994
28006
  }
27995
28007
  function extractAgentPayloadText(payloads) {
27996
28008
  if (!Array.isArray(payloads)) return null;
27997
28009
  for (const payload of payloads) {
27998
28010
  if (!payload || typeof payload !== "object") continue;
27999
- const text = normalizeOptionalText$35(payload.text);
28011
+ const text = normalizeOptionalText$36(payload.text);
28000
28012
  if (text) return text;
28001
28013
  }
28002
28014
  return null;
@@ -28008,8 +28020,8 @@ function toOpenClawGatewayTransportError(error) {
28008
28020
  errorType: "adapter",
28009
28021
  message: "upstream_unreachable: openclaw is not installed or not on PATH"
28010
28022
  });
28011
- const stderr = normalizeOptionalText$35(error?.stderr);
28012
- const stdout = normalizeOptionalText$35(error?.stdout);
28023
+ const stderr = normalizeOptionalText$36(error?.stderr);
28024
+ const stdout = normalizeOptionalText$36(error?.stdout);
28013
28025
  return classifyGatewayFailure(stderr ?? stdout ?? toErrorMessage$27(error), false);
28014
28026
  }
28015
28027
  function classifyGatewayFailure(message, includeOriginalError) {
@@ -28018,7 +28030,7 @@ function classifyGatewayFailure(message, includeOriginalError) {
28018
28030
  message
28019
28031
  }));
28020
28032
  }
28021
- function normalizeOptionalText$35(value) {
28033
+ function normalizeOptionalText$36(value) {
28022
28034
  const normalized = String(value ?? "").trim();
28023
28035
  return normalized.length > 0 ? normalized : null;
28024
28036
  }
@@ -28113,9 +28125,9 @@ async function withOpenClawDispatchSpaceActionPlugin(input) {
28113
28125
  }
28114
28126
  }
28115
28127
  function resolveOpenClawConfigPath(env) {
28116
- const explicit = normalizeOptionalText$34(env[OPENCLAW_CONFIG_PATH_ENV]);
28128
+ const explicit = normalizeOptionalText$35(env[OPENCLAW_CONFIG_PATH_ENV]);
28117
28129
  if (explicit) return explicit;
28118
- return join(normalizeOptionalText$34(env[OPENCLAW_STATE_DIR_ENV]) ?? join(normalizeOptionalText$34(env.HOME) ?? homedir(), ".openclaw"), "openclaw.json");
28130
+ return join(normalizeOptionalText$35(env[OPENCLAW_STATE_DIR_ENV]) ?? join(normalizeOptionalText$35(env.HOME) ?? homedir(), ".openclaw"), "openclaw.json");
28119
28131
  }
28120
28132
  function buildOpenClawSpaceActionPluginSource() {
28121
28133
  return `import { spawn } from "node:child_process";
@@ -28289,7 +28301,7 @@ const plugin = {
28289
28301
  export default plugin;
28290
28302
  `;
28291
28303
  }
28292
- function normalizeOptionalText$34(value) {
28304
+ function normalizeOptionalText$35(value) {
28293
28305
  const normalized = String(value ?? "").trim();
28294
28306
  return normalized.length > 0 ? normalized : null;
28295
28307
  }
@@ -28298,7 +28310,7 @@ function normalizeOptionalText$34(value) {
28298
28310
  const OPENCLAW_CONVERSATION_BRIDGE_SPEC = resolveBuiltinAdapterConversationBridgeSpec("openclaw");
28299
28311
  const resolveOpenClawSessionConversation = (agentControllerConversation) => {
28300
28312
  if (!agentControllerConversation) return null;
28301
- const agentControllerConversationId = normalizeOptionalText$33(agentControllerConversation.agentControllerConversationId);
28313
+ const agentControllerConversationId = normalizeOptionalText$34(agentControllerConversation.agentControllerConversationId);
28302
28314
  if (!agentControllerConversationId) throw new Error("conversation.bridge.agent_controller_conversation_id_missing: expected builtin:openclaw session agentControllerConversationId");
28303
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}`);
28304
28316
  return buildAdapterAgentControllerConversationRef({
@@ -28311,7 +28323,7 @@ const resolveOpenClawInvokeRequest = (input) => {
28311
28323
  const agentControllerConversation = resolveOpenClawSessionConversation(input.request.agentControllerConversation);
28312
28324
  return {
28313
28325
  ...input.request,
28314
- agentControllerConversationId: normalizeOptionalText$33(input.request.agentControllerConversationId),
28326
+ agentControllerConversationId: normalizeOptionalText$34(input.request.agentControllerConversationId),
28315
28327
  ...agentControllerConversation ? { agentControllerConversation } : {}
28316
28328
  };
28317
28329
  };
@@ -28402,7 +28414,7 @@ const resolveDefaultOpenClawInvoke = (options) => {
28402
28414
  };
28403
28415
  };
28404
28416
  async function resolveOpenClawDispatchLaunchContract(input) {
28405
- const explicitLaunchContract = input.inputLaunchContract ?? input.optionLaunchContract ?? (normalizeOptionalText$33(input.openClawBin) ? buildExecutableLaunchContract({ commandPath: normalizeOptionalText$33(input.openClawBin) }) : null);
28417
+ const explicitLaunchContract = input.inputLaunchContract ?? input.optionLaunchContract ?? (normalizeOptionalText$34(input.openClawBin) ? buildExecutableLaunchContract({ commandPath: normalizeOptionalText$34(input.openClawBin) }) : null);
28406
28418
  if (explicitLaunchContract) {
28407
28419
  const verification = await verifyOpenClawLaunchContract({ launchContract: explicitLaunchContract });
28408
28420
  if (verification.ok) return explicitLaunchContract;
@@ -28422,8 +28434,8 @@ const resolveRuntimeProcessRegistrar = (input) => input.registerRuntimeProcess ?
28422
28434
  taskId: input.taskId
28423
28435
  });
28424
28436
  } : void 0;
28425
- const resolveOpenClawAgentId = (input) => normalizeOptionalText$33(input.dispatchEnvAgentId) ?? normalizeOptionalText$33(input.optionAgentId) ?? resolveOpenClawAgentId$1();
28426
- const resolveOpenClawSessionKey = (input) => normalizeOptionalText$33(input.agentControllerConversation?.agentControllerRef === "builtin:openclaw" && input.agentControllerConversation.agentControllerConversationKind === "session" ? input.agentControllerConversation.agentControllerConversationId : null);
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);
28427
28439
  const invokeOpenClawGatewayPath = async (input) => {
28428
28440
  const gatewayResult = await invokeOpenClawGatewayTransport({
28429
28441
  agentId: input.openClawAgentId,
@@ -28434,7 +28446,7 @@ const invokeOpenClawGatewayPath = async (input) => {
28434
28446
  openClawTimeoutMs: input.openClawTimeoutMs,
28435
28447
  openClawWorkdir: input.openClawWorkdir,
28436
28448
  prompt: input.input.prompt,
28437
- resumedContext: normalizeOptionalText$33(input.input.agentControllerConversationId) !== null,
28449
+ resumedContext: normalizeOptionalText$34(input.input.agentControllerConversationId) !== null,
28438
28450
  sessionKey: input.sessionKey
28439
28451
  });
28440
28452
  return {
@@ -28461,7 +28473,7 @@ const invokeOpenClawLocalCliPath = async (input) => {
28461
28473
  ...input.onProcessControlEvent ? { onProcessControlEvent: input.onProcessControlEvent } : {},
28462
28474
  ...input.input.onRuntimeEvent ? { onRuntimeEvent: input.input.onRuntimeEvent } : {},
28463
28475
  prompt: input.input.prompt,
28464
- sessionId: normalizeOptionalText$33(input.input.agentControllerConversationId)
28476
+ sessionId: normalizeOptionalText$34(input.input.agentControllerConversationId)
28465
28477
  });
28466
28478
  const agentControllerConversation = OPENCLAW_CONVERSATION_BRIDGE_SPEC ? bridgeAgentControllerConversationRef({
28467
28479
  bridgeSpec: OPENCLAW_CONVERSATION_BRIDGE_SPEC,
@@ -28480,7 +28492,7 @@ const invokeOpenClawLocalCliPath = async (input) => {
28480
28492
  function normalizeText$3(value) {
28481
28493
  return String(value ?? "").trim();
28482
28494
  }
28483
- function normalizeOptionalText$33(value) {
28495
+ function normalizeOptionalText$34(value) {
28484
28496
  const normalized = normalizeText$3(value);
28485
28497
  return normalized.length > 0 ? normalized : null;
28486
28498
  }
@@ -28759,7 +28771,7 @@ function formatAgentControllerStatus(snapshot) {
28759
28771
  function formatAgentControllerAccount(snapshot) {
28760
28772
  if (snapshot.check?.status === "failed") return "Not checked";
28761
28773
  if (snapshot.auth.status === "authenticated") return resolveAgentControllerAuthDisplayLabel(snapshot) ?? "Authenticated";
28762
- if (snapshot.auth.status === "unauthenticated") return "Not authenticated";
28774
+ if (snapshot.auth.status === "unauthenticated") return "Not signed in";
28763
28775
  return "Unknown";
28764
28776
  }
28765
28777
  function resolveAgentControllerAuthDisplayLabel(snapshot) {
@@ -28801,8 +28813,8 @@ function appendLocalInstallCount(parts, count) {
28801
28813
  function formatLocalAgentLaunchStatus(status) {
28802
28814
  switch (status) {
28803
28815
  case "ready": return "Can launch";
28804
- case "needs_choice": return "Needs install choice";
28805
- case "needs_repair": return "Needs repair";
28816
+ case "needs_choice": return "Choose an installation";
28817
+ case "needs_repair": return "Can’t start";
28806
28818
  default: return "Not available";
28807
28819
  }
28808
28820
  }
@@ -30441,7 +30453,10 @@ var registry_default$1 = {
30441
30453
  }]
30442
30454
  },
30443
30455
  "lifecycle": { "status": "active" },
30444
- "originLaunch": { "commandTemplate": "cd {workingDirectory} && codex resume -m {model} {agentControllerConversationId}" },
30456
+ "originLaunch": {
30457
+ "commandTemplate": "cd {workingDirectory} && codex resume -m {model} {agentControllerConversationId}",
30458
+ "unselectedModelCommandTemplate": "cd {workingDirectory} && codex resume {agentControllerConversationId}"
30459
+ },
30445
30460
  "notes": "Primary runnable agent in current environment.",
30446
30461
  "transportModes": ["codex-app-server"],
30447
30462
  "defaultTransportMode": "codex-app-server",
@@ -31273,13 +31288,19 @@ function resolveConversationPolicyFromModelSelection(input) {
31273
31288
  status: "accepted",
31274
31289
  conversationPolicy: {}
31275
31290
  };
31276
- if (!selection) return {
31277
- status: "accepted",
31278
- conversationPolicy: {
31279
- fallbackModel: defaultModel.id,
31280
- model: defaultModel.id
31281
- }
31282
- };
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
+ }
31283
31304
  const selectedModel = availableModels.find((model) => model.id === selection.modelId) ?? null;
31284
31305
  const model = selectedModel ?? defaultModel;
31285
31306
  const reasoningLevel = selectedModel && selection.reasoningLevel && selectedModel.supportedReasoningLevels.includes(selection.reasoningLevel) ? selection.reasoningLevel : null;
@@ -31292,6 +31313,10 @@ function resolveConversationPolicyFromModelSelection(input) {
31292
31313
  }
31293
31314
  };
31294
31315
  }
31316
+ function normalizeOptionalText$33(value) {
31317
+ const normalized = String(value ?? "").trim();
31318
+ return normalized.length > 0 ? normalized : null;
31319
+ }
31295
31320
  [.../* @__PURE__ */ new Set([
31296
31321
  "bind_agent_profile",
31297
31322
  "create_binding",
@@ -35208,7 +35233,10 @@ var registry_default = {
35208
35233
  }]
35209
35234
  },
35210
35235
  "lifecycle": { "status": "active" },
35211
- "originLaunch": { "commandTemplate": "cd {workingDirectory} && codex resume -m {model} {agentControllerConversationId}" },
35236
+ "originLaunch": {
35237
+ "commandTemplate": "cd {workingDirectory} && codex resume -m {model} {agentControllerConversationId}",
35238
+ "unselectedModelCommandTemplate": "cd {workingDirectory} && codex resume {agentControllerConversationId}"
35239
+ },
35212
35240
  "notes": "Primary runnable agent in current environment.",
35213
35241
  "transportModes": ["codex-app-server"],
35214
35242
  "defaultTransportMode": "codex-app-server",
@@ -35981,10 +36009,10 @@ var registry_default = {
35981
36009
  //#region ../../release/vendor-models.json
35982
36010
  var vendor_models_default = {
35983
36011
  schemaVersion: 1,
35984
- updatedAt: "2026-08-27T00:00:00.000Z",
36012
+ updatedAt: "2026-09-01T00:00:00.000Z",
35985
36013
  agentControllers: {
35986
36014
  "codex": {
35987
- "defaultModelId": "gpt-5.5",
36015
+ "defaultModelId": "gpt-5.6-sol",
35988
36016
  "models": [
35989
36017
  {
35990
36018
  "id": "gpt-5.6-sol",
@@ -36840,6 +36868,17 @@ var vendor_models_default = {
36840
36868
  "supportedReasoningLevels": [],
36841
36869
  "minCliVersion": null
36842
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
+ },
36843
36882
  {
36844
36883
  "id": "opencode-go/qwen3.8-max",
36845
36884
  "displayName": "Qwen3.8 Max",
@@ -37075,13 +37114,15 @@ function resolveRegistryOriginLaunchCommand(input) {
37075
37114
  const runtimeAdapterMatch = resolveRegistryRuntimeAdapterByAgentControllerRef(agentControllerRef);
37076
37115
  if (!runtimeAdapterMatch) return null;
37077
37116
  const matchedBuiltinAgent = listBuiltinAgentsRegistryEntries().find((agent) => agent.id === runtimeAdapterMatch.agentId);
37078
- const commandTemplate = String(matchedBuiltinAgent?.originLaunch?.commandTemplate ?? "").trim();
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();
37079
37120
  if (!commandTemplate) return null;
37080
37121
  return renderRegistryOriginLaunchCommand({
37081
37122
  commandTemplate,
37082
37123
  originFacts: {
37083
37124
  agentControllerConversationId: input.agentControllerConversationId,
37084
- model: input.model ?? resolveDefaultOriginLaunchModel({ agentId: runtimeAdapterMatch.agentId }),
37125
+ model: explicitModel ?? (unselectedModelCommandTemplate ? null : resolveDefaultOriginLaunchModel({ agentId: runtimeAdapterMatch.agentId })),
37085
37126
  workingDirectory: input.workingDirectory
37086
37127
  }
37087
37128
  });
@@ -37271,14 +37312,23 @@ function parseOptionalTransportModes(value, context) {
37271
37312
  }
37272
37313
  function parseOptionalOriginLaunch(value, context) {
37273
37314
  if (value === void 0 || value === null) return null;
37274
- const commandTemplate = readStringValue(readObjectValue(value, context).commandTemplate, `${context}.commandTemplate`);
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) {
37275
37326
  const placeholderMatches = [...commandTemplate.matchAll(ANY_BRACE_TOKEN_RE)];
37276
- if (placeholderMatches.length === 0) throw new Error(`Expected origin launch placeholder token at ${context}.commandTemplate`);
37327
+ if (placeholderMatches.length === 0) throw new Error(`Expected origin launch placeholder token at ${context}`);
37277
37328
  for (const match of placeholderMatches) {
37278
37329
  const token = match[1];
37279
- if (!(token && isSupportedOriginLaunchToken(token))) throw new Error(`Unsupported origin launch token '${match[0]}' at ${context}.commandTemplate`);
37330
+ if (!(token && isSupportedOriginLaunchToken(token))) throw new Error(`Unsupported origin launch token '${match[0]}' at ${context}`);
37280
37331
  }
37281
- return { commandTemplate };
37282
37332
  }
37283
37333
  function normalizeOptionalRegistryOriginValue(token, value) {
37284
37334
  if (token === "workingDirectory") return normalizeOptionalWorkingDirectory(value) ?? null;
@@ -39336,9 +39386,9 @@ function createModelCatalogReadSession(input) {
39336
39386
  async function readModelCatalogOnce(baseUrl) {
39337
39387
  try {
39338
39388
  const [apiClient, baseUrlModule, clientFoundationModule] = await Promise.all([
39339
- import("./dist-NJH-sDDB.js").then((n) => n.w),
39389
+ import("./dist-DEiXhSkt.js").then((n) => n.w),
39340
39390
  import("./base-url-CY_j4bLH.js").then((n) => n.n),
39341
- import("./api-client-foundation-BPmXnsr9.js").then((n) => n.t)
39391
+ import("./api-client-foundation-tvnD_7HW.js").then((n) => n.t)
39342
39392
  ]);
39343
39393
  if (typeof apiClient.createConfigApi !== "function") throw new Error("config api client is unavailable");
39344
39394
  const resolvedBaseUrl = baseUrl ?? await baseUrlModule.resolveBaseUrl();
@@ -39632,9 +39682,9 @@ function resolveBoundProfileLocalRouteCandidate(input) {
39632
39682
  const agentControllerCollaborationMode = resolveNativeAgentControllerCollaborationModeForController(binding.agentControllerCollaborationMode, { agentControllerRef: agentControllerRef.ref });
39633
39683
  return {
39634
39684
  agentControllerRef: agentControllerRef.ref,
39635
- agentControllerConversationId: normalizeOptionalText$46(executionTarget.agentControllerConversationId),
39685
+ agentControllerConversationId: normalizeOptionalText$47(executionTarget.agentControllerConversationId),
39636
39686
  openMeldServiceRuntimeId: executionTarget.openMeldServiceRuntimeId.value,
39637
- bindingId: normalizeOptionalText$46(binding.bindingId),
39687
+ bindingId: normalizeOptionalText$47(binding.bindingId),
39638
39688
  ...agentControllerCollaborationMode ? { agentControllerCollaborationMode } : {},
39639
39689
  ...agentControllerPermissionMode ? { agentControllerPermissionMode } : {},
39640
39690
  ...binding.modelSelection ? { modelSelection: binding.modelSelection } : {},
@@ -39656,6 +39706,7 @@ function resolveIneligibleLocalRouteCandidate(input) {
39656
39706
  function buildAcceptedLocalDaemonRouteCandidate(input) {
39657
39707
  const defaults = createDefaultRuntimeAgentControllerSettings(input.agentControllerRef);
39658
39708
  const conversationPolicyResolution = resolveConversationPolicyFromModelSelection({
39709
+ agentControllerConversationId: input.agentControllerConversationId,
39659
39710
  agentControllerRef: input.agentControllerRef,
39660
39711
  catalog: input.modelCatalog,
39661
39712
  modelSelection: input.modelSelection
@@ -41361,7 +41412,7 @@ const DEFAULT_OPENCLAW_RUNTIME_PREPARATION_DEPS = {
41361
41412
  fetchGatewayHealth: fetchOpenClawGatewayHealth
41362
41413
  };
41363
41414
  async function prepareOpenClawRuntime(input, deps = DEFAULT_OPENCLAW_RUNTIME_PREPARATION_DEPS) {
41364
- const profileName = normalizeOptionalText$46(input.profileName);
41415
+ const profileName = normalizeOptionalText$47(input.profileName);
41365
41416
  if (!profileName) throw new DaemonServiceRunError({
41366
41417
  code: "controller.bootstrap.failed",
41367
41418
  message: "controller.bootstrap.failed: OpenClaw bootstrap requires an OpenMeld profile name"
@@ -41424,12 +41475,12 @@ function buildOpenClawGatewayVisibilityFailure(error) {
41424
41475
  }
41425
41476
  function extractErrorCode$1(error) {
41426
41477
  if (!(error && typeof error === "object" && "code" in error)) return;
41427
- return normalizeOptionalText$46(error.code) ?? void 0;
41478
+ return normalizeOptionalText$47(error.code) ?? void 0;
41428
41479
  }
41429
41480
  function resolveOpenClawGatewayVisibilityDiagnostics(error) {
41430
41481
  if (!(error instanceof Error)) return;
41431
41482
  const diagnostics = error.diagnostics;
41432
- if (!diagnostics || typeof diagnostics !== "object" || !normalizeOptionalText$46(diagnostics.agentId)) return;
41483
+ if (!diagnostics || typeof diagnostics !== "object" || !normalizeOptionalText$47(diagnostics.agentId)) return;
41433
41484
  const parsedGatewayVisibility = openMeldDaemonTaskResultOpenClawGatewayVisibilityStatusSchema.safeParse(diagnostics.gatewayVisibility);
41434
41485
  if (!parsedGatewayVisibility.success) return;
41435
41486
  return {
@@ -43179,7 +43230,7 @@ async function writeDaemonStartFailureState(input) {
43179
43230
  recordedAt: input.recordedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
43180
43231
  reason: input.reason,
43181
43232
  detail: input.detail,
43182
- rawLogLine: normalizeOptionalText$46(input.rawLogLine) ?? null,
43233
+ rawLogLine: normalizeOptionalText$47(input.rawLogLine) ?? null,
43183
43234
  dependencyIssues: normalizeDependencyIssues(input.dependencyIssues ?? []),
43184
43235
  lane
43185
43236
  };
@@ -43195,11 +43246,11 @@ async function clearDaemonStartFailureState(pathInput = {}) {
43195
43246
  function parseDaemonStartFailureState(value) {
43196
43247
  if (!isRecord$2(value)) return null;
43197
43248
  if (value.schema !== DAEMON_START_FAILURE_STATE_SCHEMA || value.v !== 1) return null;
43198
- const recordedAt = normalizeOptionalText$46(value.recordedAt);
43199
- const detail = normalizeOptionalText$46(value.detail);
43249
+ const recordedAt = normalizeOptionalText$47(value.recordedAt);
43250
+ const detail = normalizeOptionalText$47(value.detail);
43200
43251
  const lane = value.lane;
43201
43252
  const reason = value.reason;
43202
- const rawLogLine = value.rawLogLine === null ? null : normalizeOptionalText$46(value.rawLogLine);
43253
+ const rawLogLine = value.rawLogLine === null ? null : normalizeOptionalText$47(value.rawLogLine);
43203
43254
  if (!(recordedAt && detail) || lane !== "prod" && lane !== "dev-local" && lane !== "canary" || reason !== "service_dependencies_unavailable" && reason !== "startup_failed") return null;
43204
43255
  const dependencyIssues = normalizeDependencyIssues(Array.isArray(value.dependencyIssues) ? value.dependencyIssues : []);
43205
43256
  return {
@@ -43220,8 +43271,8 @@ function normalizeDependencyIssues(issues) {
43220
43271
  const kind = issue.kind;
43221
43272
  const status = issue.status;
43222
43273
  const scope = issue.scope;
43223
- const baseUrl = normalizeOptionalText$46(issue.baseUrl);
43224
- const probeUrl = normalizeOptionalText$46(issue.probeUrl);
43274
+ const baseUrl = normalizeOptionalText$47(issue.baseUrl);
43275
+ const probeUrl = normalizeOptionalText$47(issue.probeUrl);
43225
43276
  const httpStatus = typeof issue.httpStatus === "number" ? issue.httpStatus : null;
43226
43277
  if (kind !== "auth" && kind !== "gateway" || status !== "unhealthy_http" && status !== "unreachable" || scope !== "loopback" && scope !== "remote" || !baseUrl || !probeUrl) continue;
43227
43278
  normalized.push({
@@ -44273,10 +44324,10 @@ function toErrorMessage$19(error) {
44273
44324
  //#endregion
44274
44325
  //#region src/local-service/state/daemon-device-id.ts
44275
44326
  function resolvePreferredDaemonDeviceId(input) {
44276
- return normalizeOptionalText$46(input.explicitDeviceId) ?? normalizeOptionalText$46(input.contractDeviceId) ?? void 0;
44327
+ return normalizeOptionalText$47(input.explicitDeviceId) ?? normalizeOptionalText$47(input.contractDeviceId) ?? void 0;
44277
44328
  }
44278
44329
  async function resolveDaemonDeviceId(input) {
44279
- const explicit = normalizeOptionalText$46(input.deviceId);
44330
+ const explicit = normalizeOptionalText$47(input.deviceId);
44280
44331
  if (explicit) {
44281
44332
  await persistDaemonDeviceIdIfNeeded({
44282
44333
  deviceId: explicit,
@@ -44284,7 +44335,7 @@ async function resolveDaemonDeviceId(input) {
44284
44335
  });
44285
44336
  return explicit;
44286
44337
  }
44287
- const persisted = normalizeOptionalText$46(await readFile(input.deviceIdPath, "utf8").catch(() => ""));
44338
+ const persisted = normalizeOptionalText$47(await readFile(input.deviceIdPath, "utf8").catch(() => ""));
44288
44339
  if (persisted && !(input.shouldDiscardPersistedDeviceId?.(persisted) ?? false)) return persisted;
44289
44340
  const generated = randomUUID();
44290
44341
  await writeDaemonDeviceId({
@@ -44329,7 +44380,7 @@ function buildLedgerPaths(ledgerRootPath) {
44329
44380
  };
44330
44381
  }
44331
44382
  async function persistDaemonDeviceIdIfNeeded(input) {
44332
- if (normalizeOptionalText$46(await readFile(input.deviceIdPath, "utf8").catch(() => "")) === input.deviceId) return;
44383
+ if (normalizeOptionalText$47(await readFile(input.deviceIdPath, "utf8").catch(() => "")) === input.deviceId) return;
44333
44384
  await writeDaemonDeviceId(input);
44334
44385
  }
44335
44386
  async function writeDaemonDeviceId(input) {
@@ -44337,8 +44388,8 @@ async function writeDaemonDeviceId(input) {
44337
44388
  await writeFile(input.deviceIdPath, `${input.deviceId}\n`, "utf8");
44338
44389
  }
44339
44390
  async function migrateLegacyDaemonDeviceId(input) {
44340
- if (normalizeOptionalText$46(await readFile(input.deviceIdPath, "utf8").catch(() => ""))) return;
44341
- const legacy = normalizeOptionalText$46(await readFile(input.legacyDeviceIdPath, "utf8").catch(() => ""));
44391
+ if (normalizeOptionalText$47(await readFile(input.deviceIdPath, "utf8").catch(() => ""))) return;
44392
+ const legacy = normalizeOptionalText$47(await readFile(input.legacyDeviceIdPath, "utf8").catch(() => ""));
44342
44393
  if (!legacy) return;
44343
44394
  await writeDaemonDeviceId({
44344
44395
  deviceId: legacy,
@@ -45632,7 +45683,7 @@ async function resolveLifecycleCommandOptions(input) {
45632
45683
  currentGatewayUrl: normalizeGatewayBaseUrlOrNull(currentContract?.gatewayUrl),
45633
45684
  runtimeGatewayUrl: normalizeGatewayBaseUrlOrNull(runtimeSnapshot?.gatewayUrl)
45634
45685
  });
45635
- const openMeldProfileId = normalizeOptionalText$46(input.profile) ?? normalizeOptionalText$46(runtimeSnapshot?.openMeldProfileId) ?? fallbackProfile?.openMeldProfileId ?? reusableCurrentContract?.profileId;
45686
+ const openMeldProfileId = normalizeOptionalText$47(input.profile) ?? normalizeOptionalText$47(runtimeSnapshot?.openMeldProfileId) ?? fallbackProfile?.openMeldProfileId ?? reusableCurrentContract?.profileId;
45636
45687
  const ownerUserId = await resolveLifecycleCommandOwnerUserId({
45637
45688
  openMeldProfileId,
45638
45689
  fallbackProfile,
@@ -45646,7 +45697,7 @@ async function resolveLifecycleCommandOptions(input) {
45646
45697
  }),
45647
45698
  deviceIdPath: runtimePaths.deviceIdPath,
45648
45699
  ...shouldDiscardPersistedDeviceId ? { shouldDiscardPersistedDeviceId } : {}
45649
- }).catch(() => reusableCurrentContract?.deviceId ?? null) : normalizeOptionalText$46(input.deviceId) ?? reusableCurrentContract?.deviceId ?? null;
45700
+ }).catch(() => reusableCurrentContract?.deviceId ?? null) : normalizeOptionalText$47(input.deviceId) ?? reusableCurrentContract?.deviceId ?? null;
45650
45701
  const heartbeatMs = normalizeHeartbeatIntervalMs(input.heartbeatMs ?? currentContract?.heartbeatMs);
45651
45702
  return {
45652
45703
  environmentTarget,
@@ -45665,10 +45716,10 @@ function resolveLifecycleGatewayUrl(input) {
45665
45716
  return input.commandGatewayUrl;
45666
45717
  }
45667
45718
  async function resolveLifecycleCommandOwnerUserId(input) {
45668
- const profileId = normalizeOptionalText$46(input.openMeldProfileId);
45669
- if (profileId && input.fallbackProfile?.openMeldProfileId === profileId) return normalizeOptionalText$46(input.fallbackProfile.ownerUserId) ?? void 0;
45719
+ const profileId = normalizeOptionalText$47(input.openMeldProfileId);
45720
+ if (profileId && input.fallbackProfile?.openMeldProfileId === profileId) return normalizeOptionalText$47(input.fallbackProfile.ownerUserId) ?? void 0;
45670
45721
  if (profileId) {
45671
- const fallbackFromResolved = normalizeOptionalText$46((await resolveOpenMeldProfileOrNull({
45722
+ const fallbackFromResolved = normalizeOptionalText$47((await resolveOpenMeldProfileOrNull({
45672
45723
  openMeldProfileId: profileId,
45673
45724
  allowDefaultFallback: false,
45674
45725
  allowUnauthenticated: true,
@@ -45676,11 +45727,11 @@ async function resolveLifecycleCommandOwnerUserId(input) {
45676
45727
  }).catch(() => null))?.ownerUserId);
45677
45728
  if (fallbackFromResolved) return fallbackFromResolved;
45678
45729
  }
45679
- if (profileId && input.reusableCurrentContract?.profileId === profileId) return normalizeOptionalText$46(input.reusableCurrentContract.ownerUserId) ?? void 0;
45680
- if (!profileId) return normalizeOptionalText$46(input.reusableCurrentContract?.ownerUserId) ?? void 0;
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;
45681
45732
  }
45682
45733
  function shouldPreferCommandResolvedGatewayForLifecycle() {
45683
- if (normalizeOptionalText$46(process$1.env.OPENMELD_GATEWAY_URL)) return true;
45734
+ if (normalizeOptionalText$47(process$1.env.OPENMELD_GATEWAY_URL)) return true;
45684
45735
  const preset = resolveOpenMeldEnvPreset();
45685
45736
  return preset === "dev-local" || preset === "canary";
45686
45737
  }
@@ -59172,7 +59223,7 @@ async function resolveLocalProviderConversationProof(input) {
59172
59223
  const checkedAt = (/* @__PURE__ */ new Date()).toISOString();
59173
59224
  const providerId = normalizeKnownBuiltinAgentControllerId(input.profileAgentControllerRef);
59174
59225
  const provider = resolveProviderConversationProofProvider(providerId);
59175
- const agentControllerConversationId = normalizeOptionalText$46(input.agentControllerConversationId);
59226
+ const agentControllerConversationId = normalizeOptionalText$47(input.agentControllerConversationId);
59176
59227
  const base = {
59177
59228
  agentControllerConversationId,
59178
59229
  checkedAt,
@@ -59719,7 +59770,7 @@ function sendDispatchPreviewEndFrame(input) {
59719
59770
  });
59720
59771
  }
59721
59772
  function resolveDispatchResultPayload(input) {
59722
- const contextId = normalizeOptionalText$46(input.contextDelta?.agentControllerConversationId) ?? normalizeOptionalText$46(input.existingContextId);
59773
+ const contextId = normalizeOptionalText$47(input.contextDelta?.agentControllerConversationId) ?? normalizeOptionalText$47(input.existingContextId);
59723
59774
  const agentControllerConversation = input.contextDelta?.agentControllerConversation ?? input.contextResolution?.agentControllerConversation ?? input.agentControllerConversationForDispatch;
59724
59775
  const effectiveRuntimeWorkingDirectory = normalizeOptionalWorkingDirectory(input.workingDirectory) ?? null;
59725
59776
  const runtimeWorkspaceFingerprint = effectiveRuntimeWorkingDirectory ? buildRuntimeWorkspaceFingerprint(effectiveRuntimeWorkingDirectory) : null;
@@ -60171,10 +60222,10 @@ function parseDispatchTask(input) {
60171
60222
  payload
60172
60223
  });
60173
60224
  if (!requiredFields) return null;
60174
- const mentionSourceProfileId = normalizeOptionalText$46(payload.sourceSignal.profileId) ?? normalizeOptionalText$46(payload.sourceSignalSnapshot?.profileId);
60225
+ const mentionSourceProfileId = normalizeOptionalText$47(payload.sourceSignal.profileId) ?? normalizeOptionalText$47(payload.sourceSignalSnapshot?.profileId);
60175
60226
  const mentionSourceProfileKind = payload.sourceSignal.profileKind ?? payload.sourceSignalSnapshot?.profileKind ?? null;
60176
- const mentionSourceProfileMentionLabel = normalizeOptionalText$46(payload.sourceSignal.profileMentionLabel) ?? normalizeOptionalText$46(payload.sourceSignalSnapshot?.profileMentionLabel);
60177
- const rawPrompt = normalizeOptionalText$46(payload.sourceSignal.text) ?? normalizeOptionalText$46(payload.sourceSignalSnapshot?.text);
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);
60178
60229
  const sourceMessageEnvelope = payload.sourceMessageEnvelope ?? null;
60179
60230
  const prompt = resolveDispatchPrompt({
60180
60231
  rawPrompt,
@@ -60194,7 +60245,7 @@ function parseDispatchTask(input) {
60194
60245
  });
60195
60246
  if (!(prompt && controllerSelection)) return null;
60196
60247
  const fallbackControllerSettings = createDefaultRuntimeAgentControllerSettings(controllerSelection.agentControllerRef);
60197
- const agentControllerConversationId = normalizeOptionalText$46(payload.agentControllerConversationId) ?? null;
60248
+ const agentControllerConversationId = normalizeOptionalText$47(payload.agentControllerConversationId) ?? null;
60198
60249
  const deliveryRecoveryReason = resolveDeliveryRecoveryReason(payload);
60199
60250
  const executionTokenEcho = resolveExecutionTokenEcho(payload);
60200
60251
  if (!executionTokenEcho) return null;
@@ -60207,7 +60258,7 @@ function parseDispatchTask(input) {
60207
60258
  ...resolveDispatchSourceFiles(payload),
60208
60259
  ...controllerSelection,
60209
60260
  deliveryRecoveryReason,
60210
- defaultProjectId: normalizeOptionalText$46(payload.defaultProjectId) ?? null,
60261
+ defaultProjectId: normalizeOptionalText$47(payload.defaultProjectId) ?? null,
60211
60262
  executionIdentity: payload.executionIdentity,
60212
60263
  executionTokenEcho,
60213
60264
  mentionSourceProfileId,
@@ -60227,7 +60278,7 @@ function parseDispatchTask(input) {
60227
60278
  }),
60228
60279
  spaceContractSnapshot: spaceContext.spaceContractSnapshot,
60229
60280
  spaceNameSnapshot: spaceContext.spaceNameSnapshot,
60230
- spacePassword: normalizeOptionalText$46(payload.spacePassword) ?? null,
60281
+ spacePassword: normalizeOptionalText$47(payload.spacePassword) ?? null,
60231
60282
  sourceMessageEnvelope,
60232
60283
  threadContext: spaceContext.threadContext,
60233
60284
  streamingMode,
@@ -60248,16 +60299,16 @@ function resolveDispatchTaskWorkingLanguage(payload) {
60248
60299
  return payload.workingLanguage ?? null;
60249
60300
  }
60250
60301
  function resolveDispatchTaskOrganizationProtectedInformation(payload) {
60251
- return normalizeOptionalText$46(payload.organizationProtectedInformation) ?? null;
60302
+ return normalizeOptionalText$47(payload.organizationProtectedInformation) ?? null;
60252
60303
  }
60253
60304
  function resolveDispatchTaskTargetProfileDisplayFacts(payload) {
60254
60305
  return {
60255
- targetProfileMentionLabel: normalizeOptionalText$46(payload.targetProfileMentionLabel) ?? null,
60256
- targetProfileName: normalizeOptionalText$46(payload.targetProfileName) ?? null
60306
+ targetProfileMentionLabel: normalizeOptionalText$47(payload.targetProfileMentionLabel) ?? null,
60307
+ targetProfileName: normalizeOptionalText$47(payload.targetProfileName) ?? null
60257
60308
  };
60258
60309
  }
60259
60310
  function resolveDispatchPrompt(input) {
60260
- const prompt = normalizeOptionalText$46(input.rawPrompt);
60311
+ const prompt = normalizeOptionalText$47(input.rawPrompt);
60261
60312
  if (!prompt) return null;
60262
60313
  if ((input.sourceMessageEnvelope?.activationTargets.length ?? 0) === 0) return prompt;
60263
60314
  const wakeMentionFragments = collectCanonicalMentionTextFragments(prompt).filter((fragment) => fragment.parsedLiteral?.type === "wake");
@@ -60269,14 +60320,14 @@ function resolveDispatchPrompt(input) {
60269
60320
  cursor = fragment.end;
60270
60321
  }
60271
60322
  parts.push(prompt.slice(cursor));
60272
- return normalizeOptionalText$46(parts.join(" ").replace(/\s+/gu, " ")) ?? prompt;
60323
+ return normalizeOptionalText$47(parts.join(" ").replace(/\s+/gu, " ")) ?? prompt;
60273
60324
  }
60274
60325
  function resolveDispatchTaskSpaceContext(payload) {
60275
60326
  return {
60276
60327
  continuitySnapshot: payload.continuitySnapshot ?? null,
60277
60328
  replyToSnapshot: payload.replyToSnapshot ?? null,
60278
60329
  spaceContractSnapshot: payload.spaceContractSnapshot ?? null,
60279
- spaceNameSnapshot: normalizeOptionalText$46(payload.spaceNameSnapshot) ?? null,
60330
+ spaceNameSnapshot: normalizeOptionalText$47(payload.spaceNameSnapshot) ?? null,
60280
60331
  threadContext: payload.threadContext ?? null
60281
60332
  };
60282
60333
  }
@@ -60291,7 +60342,7 @@ function isRecipientExplicitlyAddressedByActivationTargets(input) {
60291
60342
  return input.sourceMessageEnvelope?.activationTargets.includes(normalizedTargetProfileId) ?? false;
60292
60343
  }
60293
60344
  function resolveDeliveryRecoveryReason(payload) {
60294
- const normalized = normalizeOptionalText$46(payload.deliveryRecoveryReason);
60345
+ const normalized = normalizeOptionalText$47(payload.deliveryRecoveryReason);
60295
60346
  if (normalized === "connection_replaced" || normalized === "route_lost") return normalized;
60296
60347
  return null;
60297
60348
  }
@@ -60309,12 +60360,12 @@ function resolveDispatchTaskPayload(request) {
60309
60360
  return request.payload;
60310
60361
  }
60311
60362
  function resolveDispatchTaskRequiredFields(input) {
60312
- const dispatchId = normalizeOptionalText$46(input.payload.dispatchId) ?? input.deliverRequest.dispatchId;
60313
- const attemptId = normalizeOptionalText$46(input.payload.attemptId) ?? normalizeOptionalText$46(input.deliverRequest.attemptId);
60314
- const taskId = normalizeOptionalText$46(input.payload.taskId);
60315
- const sourceEventId = normalizeOptionalText$46(input.payload.sourceEventId);
60316
- const spaceId = normalizeOptionalText$46(input.payload.spaceId);
60317
- const targetProfileId = normalizeOptionalText$46(input.payload.targetProfileId) ?? normalizeOptionalText$46(input.deliverRequest.profileId);
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);
60318
60369
  if (!(attemptId && dispatchId && taskId && sourceEventId && spaceId && targetProfileId)) return null;
60319
60370
  return {
60320
60371
  attemptId,
@@ -60326,7 +60377,7 @@ function resolveDispatchTaskRequiredFields(input) {
60326
60377
  };
60327
60378
  }
60328
60379
  function resolveDispatchTaskControllerSelection(input) {
60329
- const parsedAgentControllerRef = parseAgentControllerRef(normalizeOptionalText$46(input.payload.controllerSnapshot.agentControllerRef) ?? input.fallbackAgentControllerRef);
60380
+ const parsedAgentControllerRef = parseAgentControllerRef(normalizeOptionalText$47(input.payload.controllerSnapshot.agentControllerRef) ?? input.fallbackAgentControllerRef);
60330
60381
  if (!parsedAgentControllerRef) return null;
60331
60382
  return { agentControllerRef: parsedAgentControllerRef.ref };
60332
60383
  }
@@ -60382,7 +60433,7 @@ function renderDispatchPrompt(input) {
60382
60433
  function renderSharedSpaceFilesSection(input) {
60383
60434
  const files = input.spaceFiles ?? [];
60384
60435
  if (files.length === 0) return null;
60385
- const cliEntry = normalizeOptionalText$46(input.cliEntry) ?? "openmeld";
60436
+ const cliEntry = normalizeOptionalText$47(input.cliEntry) ?? "openmeld";
60386
60437
  return [
60387
60438
  "Files shared with this message (canonical Space Files):",
60388
60439
  ...files.map((file) => `- ${JSON.stringify(file.name)} — fileId=${file.fileId}, revision=${file.revision}, type=${file.mimeType}, size=${file.sizeBytes} bytes.`),
@@ -60465,9 +60516,9 @@ function renderDispatchBriefSection(input) {
60465
60516
  function buildCurrentWakeContextLines(input) {
60466
60517
  const targetProfileIds = (input.sourceMessageEnvelope?.activationTargets ?? []).map((profileId) => profileId.trim()).filter(Boolean);
60467
60518
  const targetCount = targetProfileIds.length;
60468
- const sourceSignalId = normalizeOptionalText$46(input.sourceSignalId);
60519
+ const sourceSignalId = normalizeOptionalText$47(input.sourceSignalId);
60469
60520
  if (targetCount <= 1 || !sourceSignalId) return [];
60470
- const updatesCommand = `${normalizeOptionalText$46(input.cliEntry) ?? "openmeld"} space updates ${normalizeOptionalText$46(input.spaceId) ?? "<space-id>"} --after-signal ${sourceSignalId} --view agent --json`;
60521
+ const updatesCommand = `${normalizeOptionalText$47(input.cliEntry) ?? "openmeld"} space updates ${normalizeOptionalText$47(input.spaceId) ?? "<space-id>"} --after-signal ${sourceSignalId} --view agent --json`;
60471
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.`];
60472
60523
  }
60473
60524
  function renderMandatoryCompletionSection(input) {
@@ -60491,15 +60542,15 @@ function buildServiceFreshnessWarningLines(input) {
60491
60542
  return input.serviceFreshnessWarningLines?.filter(Boolean) ?? [];
60492
60543
  }
60493
60544
  function buildTargetProfileIdentityLine(input) {
60494
- const profileName = normalizeOptionalText$46(input.targetProfileName) ?? normalizeOptionalText$46(input.targetProfileMentionLabel) ?? "unknown";
60495
- const role = normalizeOptionalText$46(input.targetProfileRole);
60545
+ const profileName = normalizeOptionalText$47(input.targetProfileName) ?? normalizeOptionalText$47(input.targetProfileMentionLabel) ?? "unknown";
60546
+ const role = normalizeOptionalText$47(input.targetProfileRole);
60496
60547
  const identityParts = [profileName, `Profile ID: ${normalizeText$6(input.targetProfileId) || "unknown"}`];
60497
60548
  if (role) identityParts.push(`Role: ${role}`);
60498
60549
  return identityParts.join(", ");
60499
60550
  }
60500
60551
  function buildThisSpaceLine(input) {
60501
- const spaceName = normalizeOptionalText$46(input.spaceName);
60502
- const spacePurpose = normalizeOptionalText$46(input.spacePurpose);
60552
+ const spaceName = normalizeOptionalText$47(input.spaceName);
60553
+ const spacePurpose = normalizeOptionalText$47(input.spacePurpose);
60503
60554
  if (spaceName && spacePurpose) return `"${spaceName}" — ${spacePurpose}`;
60504
60555
  if (spacePurpose) return spacePurpose;
60505
60556
  if (spaceName) return `"${spaceName}"`;
@@ -60527,15 +60578,15 @@ function buildSendTargetReferenceLines(input) {
60527
60578
  return ["- Send target reference:", ...input.sendTargetReferenceLines.map((line) => ` ${line}`)];
60528
60579
  }
60529
60580
  function buildSpaceHistoryCommand(input) {
60530
- const cliEntry = normalizeOptionalText$46(input.cliEntry) ?? "openmeld";
60531
- const normalizedSpaceId = normalizeOptionalText$46(input.spaceId);
60581
+ const cliEntry = normalizeOptionalText$47(input.cliEntry) ?? "openmeld";
60582
+ const normalizedSpaceId = normalizeOptionalText$47(input.spaceId);
60532
60583
  return normalizedSpaceId ? `${cliEntry} space history ${normalizedSpaceId} --kind text --limit 20` : `${cliEntry} space history <space-id> --kind text --limit 20`;
60533
60584
  }
60534
60585
  function buildSpaceThreadCommand(input) {
60535
- return `${normalizeOptionalText$46(input.cliEntry) ?? "openmeld"} space thread ${normalizeOptionalText$46(input.spaceId) ?? "<space-id>"} ${input.threadId} --view agent`;
60586
+ return `${normalizeOptionalText$47(input.cliEntry) ?? "openmeld"} space thread ${normalizeOptionalText$47(input.spaceId) ?? "<space-id>"} ${input.threadId} --view agent`;
60536
60587
  }
60537
60588
  function buildSpaceContextWindowCommand(input) {
60538
- return `${normalizeOptionalText$46(input.cliEntry) ?? "openmeld"} space history ${input.spaceId} --around-signal ${input.sourceSignalId} --before 20 --after 0 --kind text`;
60589
+ return `${normalizeOptionalText$47(input.cliEntry) ?? "openmeld"} space history ${input.spaceId} --around-signal ${input.sourceSignalId} --before 20 --after 0 --kind text`;
60539
60590
  }
60540
60591
  function buildProgressiveContextGuidanceLines(input) {
60541
60592
  const lines = [];
@@ -60547,9 +60598,9 @@ function buildProgressiveContextGuidanceLines(input) {
60547
60598
  return lines;
60548
60599
  }
60549
60600
  function buildActivatedByLine(input) {
60550
- const mentionSourceProfileName = normalizeOptionalText$46(input.mentionSourceProfileName);
60601
+ const mentionSourceProfileName = normalizeOptionalText$47(input.mentionSourceProfileName);
60551
60602
  if (mentionSourceProfileName) return mentionSourceProfileName;
60552
- const mentionSourceProfileId = normalizeOptionalText$46(input.mentionSourceProfileId);
60603
+ const mentionSourceProfileId = normalizeOptionalText$47(input.mentionSourceProfileId);
60553
60604
  if (mentionSourceProfileId) return mentionSourceProfileId;
60554
60605
  return "system";
60555
60606
  }
@@ -60579,7 +60630,7 @@ function renderContinuityLine(input) {
60579
60630
  if (input.messagesSinceThen > 0) parts.push(`${String(input.messagesSinceThen)} new ${input.messagesSinceThen === 1 ? "message" : "messages"}`);
60580
60631
  if (input.higherAuthorityUpdates) parts.push("higher-authority updates: yes");
60581
60632
  if (parts.length === 0) return null;
60582
- const sourceSignalId = normalizeOptionalText$46(input.sourceSignalId);
60633
+ const sourceSignalId = normalizeOptionalText$47(input.sourceSignalId);
60583
60634
  if (!sourceSignalId) return `- Since your last public reply: ${parts.join("; ")} (run \`${buildSpaceHistoryCommand(input)}\` for content)`;
60584
60635
  const readCommand = buildSpaceContextWindowCommand({
60585
60636
  cliEntry: input.cliEntry,
@@ -60589,7 +60640,7 @@ function renderContinuityLine(input) {
60589
60640
  return `- Since your last public reply: ${parts.join("; ")} (run \`${readCommand}\` for bounded context)`;
60590
60641
  }
60591
60642
  function shouldRenderReplyTargetLine(replyTarget) {
60592
- return normalizeOptionalText$46(replyTarget) !== "the current source message";
60643
+ return normalizeOptionalText$47(replyTarget) !== "the current source message";
60593
60644
  }
60594
60645
  function collapseWhitespace(value, maxLength) {
60595
60646
  const normalized = normalizeText$6(value).replace(/\s+/gu, " ");
@@ -60609,11 +60660,11 @@ async function resolveBootstrapSpaceOwnerProfileId(input) {
60609
60660
  const spaceFacts = projectSpaceFacts(spaceConfigResult.value);
60610
60661
  if (!spaceFacts.creator || typeof spaceFacts.creator !== "object") return null;
60611
60662
  const creator = spaceFacts.creator;
60612
- return normalizeOptionalText$46(typeof creator.profile === "string" ? creator.profile : creator.profileId) ?? null;
60663
+ return normalizeOptionalText$47(typeof creator.profile === "string" ? creator.profile : creator.profileId) ?? null;
60613
60664
  }
60614
60665
  async function resolveBootstrapTargetProfileContext(input) {
60615
- const preferredMentionLabel = normalizeOptionalText$46(input.preferredMentionLabel) ?? null;
60616
- const preferredProfileName = normalizeOptionalText$46(input.preferredProfileName) ?? null;
60666
+ const preferredMentionLabel = normalizeOptionalText$47(input.preferredMentionLabel) ?? null;
60667
+ const preferredProfileName = normalizeOptionalText$47(input.preferredProfileName) ?? null;
60617
60668
  const targetSpaceConfigResult = await readSpaceConfig({
60618
60669
  openMeldProfileId: input.targetProfileId,
60619
60670
  space: input.spaceId
@@ -60623,9 +60674,9 @@ async function resolveBootstrapTargetProfileContext(input) {
60623
60674
  result: targetSpaceConfigResult
60624
60675
  });
60625
60676
  const targetProfileCache = targetSpaceConfigResult.kind === "ok" ? projectSpaceProfileCache(targetSpaceConfigResult.value) : null;
60626
- const spaceProfileName = normalizeOptionalText$46(targetProfileCache?.profileName) ?? null;
60627
- const spaceMentionAlias = normalizeOptionalText$46(targetProfileCache?.mentionAlias) ?? null;
60628
- const spaceRole = normalizeOptionalText$46(targetProfileCache?.role) ?? null;
60677
+ const spaceProfileName = normalizeOptionalText$47(targetProfileCache?.profileName) ?? null;
60678
+ const spaceMentionAlias = normalizeOptionalText$47(targetProfileCache?.mentionAlias) ?? null;
60679
+ const spaceRole = normalizeOptionalText$47(targetProfileCache?.role) ?? null;
60629
60680
  const targetProfileName = spaceProfileName ?? preferredProfileName;
60630
60681
  if (spaceProfileName || spaceMentionAlias) return {
60631
60682
  targetProfileMentionLabel: preferredMentionLabel ?? resolvePrimaryMentionLabel({
@@ -60651,7 +60702,7 @@ async function resolveDispatchMentionSourceContext(input) {
60651
60702
  mentionSourceProfileName: null,
60652
60703
  mentionSourceMentionLabel: null
60653
60704
  };
60654
- const preferredMentionLabel = normalizeOptionalText$46(input.preferredMentionLabel) ?? null;
60705
+ const preferredMentionLabel = normalizeOptionalText$47(input.preferredMentionLabel) ?? null;
60655
60706
  const sourceSpaceConfigResult = await readSpaceConfig({
60656
60707
  openMeldProfileId: input.mentionSourceProfileId,
60657
60708
  space: input.spaceId
@@ -60661,14 +60712,14 @@ async function resolveDispatchMentionSourceContext(input) {
60661
60712
  result: sourceSpaceConfigResult
60662
60713
  });
60663
60714
  const sourceProfileCache = sourceSpaceConfigResult.kind === "ok" ? projectSpaceProfileCache(sourceSpaceConfigResult.value) : null;
60664
- const sourceProfileHandle = normalizeOptionalText$46(sourceProfileCache?.profileHandle) ?? null;
60665
- const sourceMentionAlias = normalizeOptionalText$46(sourceProfileCache?.mentionAlias) ?? null;
60715
+ const sourceProfileHandle = normalizeOptionalText$47(sourceProfileCache?.profileHandle) ?? null;
60716
+ const sourceMentionAlias = normalizeOptionalText$47(sourceProfileCache?.mentionAlias) ?? null;
60666
60717
  if (sourceMentionAlias || sourceProfileCache?.profileName || sourceProfileHandle) return {
60667
- mentionSourceProfileName: normalizeOptionalText$46(sourceProfileCache?.profileName) ?? null,
60718
+ mentionSourceProfileName: normalizeOptionalText$47(sourceProfileCache?.profileName) ?? null,
60668
60719
  mentionSourceMentionLabel: preferredMentionLabel ?? resolvePrimaryMentionLabel({
60669
60720
  mentionAlias: sourceMentionAlias,
60670
60721
  profileId: input.mentionSourceProfileId,
60671
- profileName: normalizeOptionalText$46(sourceProfileCache?.profileName) ?? null
60722
+ profileName: normalizeOptionalText$47(sourceProfileCache?.profileName) ?? null
60672
60723
  })
60673
60724
  };
60674
60725
  return {
@@ -60690,12 +60741,12 @@ function resolvePrimaryMentionLabel(input) {
60690
60741
  function buildDispatchCorrelation(input) {
60691
60742
  const payload = input.deliverRequest.payload;
60692
60743
  return {
60693
- attemptId: input.parsedTask?.attemptId ?? normalizeOptionalText$46(payload.attemptId) ?? normalizeOptionalText$46(input.deliverRequest.attemptId) ?? "unknown-attempt",
60694
- agentControllerRef: input.parsedTask?.agentControllerRef ?? normalizeOptionalText$46(payload.controllerSnapshot.agentControllerRef),
60695
- dispatchId: input.parsedTask?.dispatchId ?? normalizeOptionalText$46(payload.dispatchId) ?? input.deliverRequest.dispatchId,
60696
- sourceEventId: input.parsedTask?.sourceEventId ?? normalizeOptionalText$46(payload.sourceEventId) ?? "unknown-source-event",
60697
- targetProfileId: input.parsedTask?.targetProfileId ?? normalizeOptionalText$46(payload.targetProfileId) ?? input.deliverRequest.profileId,
60698
- taskId: input.parsedTask?.taskId ?? normalizeOptionalText$46(payload.taskId) ?? "unknown-task"
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"
60699
60750
  };
60700
60751
  }
60701
60752
  //#endregion
@@ -62317,8 +62368,8 @@ async function loadContextStore(contextStorePath) {
62317
62368
  if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return /* @__PURE__ */ new Map();
62318
62369
  const contextStore = /* @__PURE__ */ new Map();
62319
62370
  for (const [key, value] of Object.entries(parsed)) {
62320
- const normalizedKey = normalizeOptionalText$46(key);
62321
- const normalizedValue = normalizeOptionalText$46(value);
62371
+ const normalizedKey = normalizeOptionalText$47(key);
62372
+ const normalizedValue = normalizeOptionalText$47(value);
62322
62373
  if (!(normalizedKey && normalizedValue)) continue;
62323
62374
  contextStore.set(normalizedKey, normalizedValue);
62324
62375
  }
@@ -66999,7 +67050,7 @@ function renderDaemonStartNeedsAttention(input) {
66999
67050
  //#region src/local-components/manifest.ts
67000
67051
  const OPENMELD_CLI_COMMAND_CONTRACT_VERSION = "openmeld-cli-command-contract-2026-05-local-components-v1";
67001
67052
  const OPENMELD_SKILLS_CONTRACT_VERSION = "openmeld-skills-contract-2026-08-tool-owned-actions-v2";
67002
- const OPENMELD_SERVICE_CONTRACT_VERSION = "openmeld-service-contract-2026-08-agent-answers-content-v1";
67053
+ const OPENMELD_SERVICE_CONTRACT_VERSION = "openmeld-service-contract-2026-09-codex-thread-model-v1";
67003
67054
  const LOCAL_COMPONENTS_SNAPSHOT_FILE = "local-components.json";
67004
67055
  const SERVICE_COMPONENT_UPDATE_CODES = /* @__PURE__ */ new Set([
67005
67056
  "version_outdated",
@@ -70093,6 +70144,18 @@ function emitProviderRuntimePhaseLine(input) {
70093
70144
  }
70094
70145
  });
70095
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;
70096
70159
  case "provider_usage_limits_observed":
70097
70160
  emitRunLine({
70098
70161
  presenter: input.presenter,
@@ -70266,7 +70329,7 @@ function buildStructuredActionRepairPrompt$1(input) {
70266
70329
  "Call exactly one dispatch-scoped OpenMeld Space Action tool now.",
70267
70330
  publicationRequirement.repairRequirementLine,
70268
70331
  ...SPACE_ACTION_TARGET_GUIDANCE_LINES,
70269
- ...normalizeOptionalText$46(input.currentReplyToSignalId) ? [`post_message.messageEnvelope.replyToSignalId must match the current dispatch reply target: ${normalizeOptionalText$46(input.currentReplyToSignalId)}.`] : [],
70332
+ ...normalizeOptionalText$47(input.currentReplyToSignalId) ? [`post_message.messageEnvelope.replyToSignalId must match the current dispatch reply target: ${normalizeOptionalText$47(input.currentReplyToSignalId)}.`] : [],
70270
70333
  ...publicationRequirement.actionGuidanceLines,
70271
70334
  ...buildStructuredActionRepairSendTargetReferenceLines(input.sendTargetReferenceLines),
70272
70335
  "Use the official `openmeld-cli` skill for future OpenMeld work.",
@@ -70282,7 +70345,7 @@ function buildStructuredActionRepairCompletionLines(input) {
70282
70345
  }
70283
70346
  const REPAIR_OUTPUT_PREVIEW_MAX_CHARS = 1200;
70284
70347
  function buildBoundedRepairOutputPreview(value) {
70285
- const normalized = normalizeOptionalText$46(value);
70348
+ const normalized = normalizeOptionalText$47(value);
70286
70349
  if (!normalized) return null;
70287
70350
  if (normalized.length <= REPAIR_OUTPUT_PREVIEW_MAX_CHARS) return normalized;
70288
70351
  return `${normalized.slice(0, REPAIR_OUTPUT_PREVIEW_MAX_CHARS).trimEnd()}\n[truncated; reuse the complete answer already in this conversation]`;
@@ -70300,7 +70363,7 @@ function buildStructuredActionRepairSendTargetReferenceLines(sendTargetReference
70300
70363
  function resolveStructuredActionRepairPreviousOutput(runtimeResult) {
70301
70364
  const payload = runtimeResult.resultPayload;
70302
70365
  if (payload.status !== "success" && payload.status !== "partial_success") return null;
70303
- return normalizeOptionalText$46(payload.output);
70366
+ return normalizeOptionalText$47(payload.output);
70304
70367
  }
70305
70368
  function resolveStructuredActionRepairContinuation$1(input) {
70306
70369
  const contextDelta = resolveDispatchContextDeltaFromRuntimeResult(input.runtimeResult.dispatchResult);
@@ -70312,7 +70375,7 @@ function resolveStructuredActionRepairContinuation$1(input) {
70312
70375
  function buildInvalidStructuredActionOutputPreview(runtimeResult) {
70313
70376
  const payload = runtimeResult.resultPayload;
70314
70377
  if (payload.status !== "success" && payload.status !== "partial_success") return null;
70315
- const normalizedOutput = normalizeOptionalText$46(payload.output);
70378
+ const normalizedOutput = normalizeOptionalText$47(payload.output);
70316
70379
  if (!normalizedOutput) return null;
70317
70380
  if (normalizedOutput.length <= 180) return normalizedOutput;
70318
70381
  return `${normalizedOutput.slice(0, 177).trimEnd()}...`;
@@ -70321,7 +70384,7 @@ function coerceRuntimeResultToStructuredActionFailure$1(input) {
70321
70384
  const payload = input.runtimeResult.resultPayload;
70322
70385
  const normalizedDiagnostics = input.diagnostics ? {
70323
70386
  ...input.diagnostics,
70324
- publicFailureReason: input.diagnostics.publicFailureReason ?? normalizeOptionalText$46(input.failureReason)
70387
+ publicFailureReason: input.diagnostics.publicFailureReason ?? normalizeOptionalText$47(input.failureReason)
70325
70388
  } : null;
70326
70389
  const normalizedPayload = openMeldDaemonTaskResultPayloadSchema.safeParse({
70327
70390
  status: "failed",
@@ -70873,21 +70936,21 @@ function resolveInvalidDeliverRequestIdentity(input) {
70873
70936
  const taskPayload = toRecord(input.payload.payload);
70874
70937
  const controllerSnapshot = toRecord(taskPayload?.controllerSnapshot);
70875
70938
  const executionIdentity = runtimeTransportDeliveryExecutionIdentitySchema.safeParse(taskPayload?.executionIdentity);
70876
- const attemptId = normalizeOptionalText$46(input.payload.attemptId) ?? normalizeOptionalText$46(taskPayload?.attemptId);
70939
+ const attemptId = normalizeOptionalText$47(input.payload.attemptId) ?? normalizeOptionalText$47(taskPayload?.attemptId);
70877
70940
  const connectionGeneration = normalizePositiveInteger(input.payload.connectionGeneration);
70878
- const daemonSessionId = normalizeOptionalText$46(input.payload.daemonSessionId) ?? input.fallbackDaemonSessionId;
70879
- const dispatchId = normalizeOptionalText$46(input.payload.dispatchId) ?? normalizeOptionalText$46(taskPayload?.dispatchId);
70941
+ const daemonSessionId = normalizeOptionalText$47(input.payload.daemonSessionId) ?? input.fallbackDaemonSessionId;
70942
+ const dispatchId = normalizeOptionalText$47(input.payload.dispatchId) ?? normalizeOptionalText$47(taskPayload?.dispatchId);
70880
70943
  const leaseEpoch = normalizePositiveInteger(input.payload.leaseEpoch);
70881
- const sourceEventId = normalizeOptionalText$46(taskPayload?.sourceEventId);
70882
- const targetProfileId = normalizeOptionalText$46(taskPayload?.targetProfileId) ?? normalizeOptionalText$46(input.payload.profileId);
70883
- const taskId = normalizeOptionalText$46(taskPayload?.taskId);
70884
- const runtimeCoordinatorExecutionId = normalizeOptionalText$46(taskPayload?.runtimeCoordinatorExecutionId);
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);
70885
70948
  const executionTokenEcho = resolveRuntimeCoordinatorExecutionTokenEchoFromRaw(taskPayload?.executionToken);
70886
70949
  if (!(attemptId && connectionGeneration && daemonSessionId && dispatchId && executionIdentity.success && leaseEpoch && sourceEventId && targetProfileId && taskId)) return null;
70887
70950
  return {
70888
70951
  attemptId,
70889
70952
  connectionGeneration,
70890
- agentControllerRef: normalizeOptionalText$46(controllerSnapshot?.agentControllerRef) ?? null,
70953
+ agentControllerRef: normalizeOptionalText$47(controllerSnapshot?.agentControllerRef) ?? null,
70891
70954
  daemonSessionId,
70892
70955
  dispatchId,
70893
70956
  executionIdentityEcho: toRuntimeTransportResultIdentityEchoFromDeliveryIdentity(executionIdentity.data),
@@ -71021,7 +71084,9 @@ async function handleDispatchDeliverFrame(input) {
71021
71084
  let runtimePromptPlan = null;
71022
71085
  let runtimePromptTrace = null;
71023
71086
  let settledResultSummary = null;
71024
- let stopRunningKeepalive = null;
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 };
71025
71090
  let firstOutputEvidenceSent = false;
71026
71091
  input.inflightTaskControlRegistry.registerTask({
71027
71092
  adapterId: runtimeControllerSupport.runtimeAdapterMatch.adapterId,
@@ -71249,32 +71314,39 @@ async function handleDispatchDeliverFrame(input) {
71249
71314
  phase: "runtime_started",
71250
71315
  presenter: input.presenter
71251
71316
  });
71252
- emitDispatchLifecycleTransition({
71253
- attemptId: parsedTask.attemptId,
71254
- connectionGeneration: input.deliverRequest.connectionGeneration,
71255
- currentSocketRef,
71256
- daemonSessionId: input.daemonSessionId,
71257
- dispatchId: parsedTask.dispatchId,
71258
- leaseEpoch: input.deliverRequest.leaseEpoch,
71259
- phase: "running",
71260
- presenter: input.presenter,
71261
- executionTokenEcho: parsedTask.executionTokenEcho,
71262
- runtimeCoordinatorExecutionId: parsedTask.runtimeCoordinatorExecutionId,
71263
- taskId: parsedTask.taskId
71264
- });
71265
- stopRunningKeepalive = startDispatchLifecycleKeepalive({
71266
- attemptId: parsedTask.attemptId,
71267
- connectionGeneration: input.deliverRequest.connectionGeneration,
71268
- currentSocketRef,
71269
- daemonSessionId: input.daemonSessionId,
71270
- dispatchId: parsedTask.dispatchId,
71271
- leaseEpoch: input.deliverRequest.leaseEpoch,
71272
- phase: "running",
71273
- presenter: input.presenter,
71274
- executionTokenEcho: parsedTask.executionTokenEcho,
71275
- runtimeCoordinatorExecutionId: parsedTask.runtimeCoordinatorExecutionId,
71276
- taskId: parsedTask.taskId
71277
- });
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 });
71278
71350
  emitDispatchLocalPhaseJournalEvent({
71279
71351
  deliverRequest: input.deliverRequest,
71280
71352
  metadata: {
@@ -71366,34 +71438,23 @@ async function handleDispatchDeliverFrame(input) {
71366
71438
  contractVersion: event.contractVersion,
71367
71439
  state: event.phase === "agent_controller_conversation_occupied" ? "occupied" : "available"
71368
71440
  };
71369
- stopRunningKeepalive?.();
71370
- emitDispatchLifecycleTransition({
71441
+ transitionDispatchLifecycle({
71371
71442
  agentControllerConversationOccupancy: occupancy,
71372
- attemptId: parsedTask.attemptId,
71373
- connectionGeneration: input.deliverRequest.connectionGeneration,
71374
- currentSocketRef,
71375
- daemonSessionId: input.daemonSessionId,
71376
- dispatchId: parsedTask.dispatchId,
71377
- leaseEpoch: input.deliverRequest.leaseEpoch,
71378
- phase: "running",
71379
- presenter: input.presenter,
71380
- executionTokenEcho: parsedTask.executionTokenEcho,
71381
- runtimeCoordinatorExecutionId: parsedTask.runtimeCoordinatorExecutionId,
71382
- taskId: parsedTask.taskId
71443
+ phase: runtimeLifecyclePhase
71383
71444
  });
71384
- stopRunningKeepalive = startDispatchLifecycleKeepalive({
71385
- agentControllerConversationOccupancy: occupancy,
71386
- attemptId: parsedTask.attemptId,
71387
- connectionGeneration: input.deliverRequest.connectionGeneration,
71388
- currentSocketRef,
71389
- daemonSessionId: input.daemonSessionId,
71390
- dispatchId: parsedTask.dispatchId,
71391
- leaseEpoch: input.deliverRequest.leaseEpoch,
71392
- phase: "running",
71393
- presenter: input.presenter,
71394
- executionTokenEcho: parsedTask.executionTokenEcho,
71395
- runtimeCoordinatorExecutionId: parsedTask.runtimeCoordinatorExecutionId,
71396
- taskId: parsedTask.taskId
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"
71397
71458
  });
71398
71459
  };
71399
71460
  const runtimeExecutionPromise = Promise.resolve(runDispatchRuntimeExecution({
@@ -71418,6 +71479,7 @@ async function handleDispatchDeliverFrame(input) {
71418
71479
  },
71419
71480
  onRuntimeEvent: (event) => {
71420
71481
  syncAgentControllerConversationOccupancyLifecycle(event);
71482
+ syncProviderTurnAcceptedLifecycle(event);
71421
71483
  if (event.phase === "tool_activity") {
71422
71484
  agentToolActivitySequence += 1;
71423
71485
  emitDispatchAgentToolActivityFrame({
@@ -71815,8 +71877,8 @@ async function handleDispatchDeliverFrame(input) {
71815
71877
  }
71816
71878
  });
71817
71879
  } finally {
71818
- stopRunningKeepalive?.();
71819
- stopRunningKeepalive = null;
71880
+ lifecycleKeepalive.stop?.();
71881
+ lifecycleKeepalive.stop = null;
71820
71882
  input.inflightDispatchMetaByTaskId.delete(parsedTask.taskId);
71821
71883
  input.inflightTaskControlRegistry.removeTask(parsedTask.taskId);
71822
71884
  pendingAgentInteractionRegistry.removeTask(parsedTask.taskId);
@@ -72148,9 +72210,9 @@ async function resolveDispatchSpaceMetaContext(input) {
72148
72210
  });
72149
72211
  return {
72150
72212
  status: "loaded",
72151
- spaceGuide: normalizeOptionalText$46(meta.guide),
72152
- spaceName: normalizeOptionalText$46(meta.name),
72153
- spacePurpose: normalizeOptionalText$46(meta.purpose)
72213
+ spaceGuide: normalizeOptionalText$47(meta.guide),
72214
+ spaceName: normalizeOptionalText$47(meta.name),
72215
+ spacePurpose: normalizeOptionalText$47(meta.purpose)
72154
72216
  };
72155
72217
  } catch (error) {
72156
72218
  return {
@@ -72808,7 +72870,7 @@ async function coordinateConcurrentAgentReply(input) {
72808
72870
  };
72809
72871
  }
72810
72872
  };
72811
- const observation = await readObservation(normalizeOptionalText$46(input.agentReplyObservationCursor) ?? input.parsedTask.sourceEventId);
72873
+ const observation = await readObservation(normalizeOptionalText$47(input.agentReplyObservationCursor) ?? input.parsedTask.sourceEventId);
72812
72874
  const coordinated = await coordinateDispatchAgentReply({
72813
72875
  action: input.resolvedSpaceAction,
72814
72876
  currentValue: {
@@ -73210,10 +73272,10 @@ function resolveStructuredActionFailureDiagnostics(input) {
73210
73272
  return {
73211
73273
  carrierKind: input.carrierKind,
73212
73274
  invalidOutputPreview: buildInvalidStructuredActionOutputPreview(input.runtimeResult),
73213
- publicFailureReason: normalizeOptionalText$46(input.publicFailureReason),
73275
+ publicFailureReason: normalizeOptionalText$47(input.publicFailureReason),
73214
73276
  repairMode: input.repairMode,
73215
73277
  spaceActionCandidatePresent: input.carrierKind !== "none",
73216
- spaceActionParseError: normalizeOptionalText$46(input.parseError)
73278
+ spaceActionParseError: normalizeOptionalText$47(input.parseError)
73217
73279
  };
73218
73280
  }
73219
73281
  function maybeRejectDispatchPreflight(input) {
@@ -73635,7 +73697,7 @@ async function settleAgentReplyProposals(input) {
73635
73697
  message: `OpenMeld rejected the Agent reply proposal: ${settlement.reasonCode}`
73636
73698
  });
73637
73699
  const observedThroughSignalId = resultPayload.spaceAction?.type === "post_message" ? resultPayload.spaceAction.observedThroughSignalId : null;
73638
- resultPayload = await input.reconsider(normalizeOptionalText$46(observedThroughSignalId) ?? resultPayload.sourceEventId);
73700
+ resultPayload = await input.reconsider(normalizeOptionalText$47(observedThroughSignalId) ?? resultPayload.sourceEventId);
73639
73701
  }
73640
73702
  return {
73641
73703
  resultPayload,
@@ -73898,7 +73960,7 @@ function resolveRuntimeEvidenceResultPhase(payload) {
73898
73960
  }
73899
73961
  function resolveRuntimeEvidenceResultReasonCode(payload) {
73900
73962
  if (payload.status !== "failed") return null;
73901
- return normalizeOptionalText$46(payload.errorCode) ?? null;
73963
+ return normalizeOptionalText$47(payload.errorCode) ?? null;
73902
73964
  }
73903
73965
  function toRuntimeTransportDispatchLocalQueueDiagnostics(input) {
73904
73966
  return {
@@ -73986,6 +74048,9 @@ function emitDispatchLifecycleTransition(input) {
73986
74048
  }
73987
74049
  });
73988
74050
  }
74051
+ function resolveInitialDispatchLifecyclePhase(input) {
74052
+ return input.providerAdmissionOwnsRunningLifecycle ? "accepted_local" : "running";
74053
+ }
73989
74054
  function startDispatchLifecycleKeepalive(input) {
73990
74055
  let intervalCount = 0;
73991
74056
  let lastOccupancyConnectionGeneration = null;
@@ -76419,7 +76484,7 @@ async function resolveDaemonServiceOwnerContext(input) {
76419
76484
  const authOwnerUserId = normalizeText$6(authSession?.user?.id);
76420
76485
  if (authOwnerUserId) return {
76421
76486
  ownerUserId: authOwnerUserId,
76422
- ownerName: normalizeOptionalText$46(authSession?.user?.name),
76487
+ ownerName: normalizeOptionalText$47(authSession?.user?.name),
76423
76488
  openMeldProfile: null
76424
76489
  };
76425
76490
  const fallbackProfile = await resolveOpenMeldProfileOrNull({
@@ -77209,7 +77274,7 @@ function resolveDaemonServiceOwnerContextFromProfile(openMeldProfile, ownerMissi
77209
77274
  });
77210
77275
  return {
77211
77276
  ownerUserId,
77212
- ownerName: normalizeOptionalText$46(openMeldProfile.ownerName),
77277
+ ownerName: normalizeOptionalText$47(openMeldProfile.ownerName),
77213
77278
  openMeldProfile
77214
77279
  };
77215
77280
  }
@@ -79837,7 +79902,7 @@ async function probeLocalDaemonControlPlaneReachability() {
79837
79902
  }
79838
79903
  function buildDaemonControlRejectedError(input) {
79839
79904
  const targetLabel = input.payload.target.by === "dispatch" ? `dispatch ${input.payload.target.dispatchId}` : `task ${input.payload.target.taskId}`;
79840
- const note = normalizeOptionalText$46(input.payload.note);
79905
+ const note = normalizeOptionalText$47(input.payload.note);
79841
79906
  const detail = note ? ` (${note})` : "";
79842
79907
  return /* @__PURE__ */ new Error(`daemon.control.rejected: ${input.command} request was not accepted for ${targetLabel}${detail}`);
79843
79908
  }
@@ -79907,8 +79972,8 @@ function emitDaemonControlResult(input) {
79907
79972
  return;
79908
79973
  }
79909
79974
  const targetLabel = input.payload.target.by === "dispatch" ? `dispatch ${input.payload.target.dispatchId}` : `task ${input.payload.target.taskId}`;
79910
- const resolvedDispatchId = normalizeOptionalText$46(input.payload.resolvedDispatchId);
79911
- const resolvedTaskId = normalizeOptionalText$46(input.payload.resolvedTaskId);
79975
+ const resolvedDispatchId = normalizeOptionalText$47(input.payload.resolvedDispatchId);
79976
+ const resolvedTaskId = normalizeOptionalText$47(input.payload.resolvedTaskId);
79912
79977
  const acceptedVerb = capitalizeDaemonControlCommand(input.command);
79913
79978
  const acceptedText = [
79914
79979
  `${acceptedVerb} request accepted for ${targetLabel}.`,
@@ -82189,7 +82254,7 @@ function emitDaemonRunServiceDependenciesUnavailable(input) {
82189
82254
  }
82190
82255
  async function resolveDaemonStartFailure(input) {
82191
82256
  const startupDiagnostic = input.cursor ? await readDaemonStartFailureLogDiagnostic({ cursor: input.cursor }).catch(() => null) : null;
82192
- const rawLogLine = normalizeOptionalText$46(startupDiagnostic?.rawLine) ?? normalizeOptionalText$46(input.fallbackRawLine) ?? null;
82257
+ const rawLogLine = normalizeOptionalText$47(startupDiagnostic?.rawLine) ?? normalizeOptionalText$47(input.fallbackRawLine) ?? null;
82193
82258
  if (rawLogLine && isDaemonStartFailureLikelyDependencyRequestFailure(rawLogLine)) {
82194
82259
  const dependencyDiagnostics = await resolveDaemonServiceDependencyDiagnostics({
82195
82260
  gatewayUrl: input.gatewayUrl,
@@ -82209,7 +82274,7 @@ async function resolveDaemonStartFailure(input) {
82209
82274
  dependencyDiagnostics
82210
82275
  };
82211
82276
  }
82212
- const detail = normalizeOptionalText$46(startupDiagnostic?.detail) ?? (rawLogLine ? summarizeDaemonStartFailureLogLine(rawLogLine) : null);
82277
+ const detail = normalizeOptionalText$47(startupDiagnostic?.detail) ?? (rawLogLine ? summarizeDaemonStartFailureLogLine(rawLogLine) : null);
82213
82278
  if (!detail) return null;
82214
82279
  return {
82215
82280
  reason: "startup_failed",
@@ -83309,11 +83374,11 @@ function emitDaemonRecoveredStartedState(input) {
83309
83374
  });
83310
83375
  }
83311
83376
  function resolveDaemonServiceOpenMeldProfileId(input) {
83312
- const explicitOpenMeldProfileId = normalizeOptionalText$46(input.explicitOpenMeldProfileId);
83377
+ const explicitOpenMeldProfileId = normalizeOptionalText$47(input.explicitOpenMeldProfileId);
83313
83378
  if (explicitOpenMeldProfileId) return explicitOpenMeldProfileId;
83314
- const sessionOpenMeldProfileId = normalizeOptionalText$46(input.runtime.openMeldProfileId);
83379
+ const sessionOpenMeldProfileId = normalizeOptionalText$47(input.runtime.openMeldProfileId);
83315
83380
  if (sessionOpenMeldProfileId) return sessionOpenMeldProfileId;
83316
- const selectedOpenMeldProfileId = normalizeOptionalText$46(getCurrentCommandCheckState().selectedProfile?.openMeldProfileId);
83381
+ const selectedOpenMeldProfileId = normalizeOptionalText$47(getCurrentCommandCheckState().selectedProfile?.openMeldProfileId);
83317
83382
  if (selectedOpenMeldProfileId) return selectedOpenMeldProfileId;
83318
83383
  }
83319
83384
  async function resolveDaemonServiceContractGatewayUrl(input) {
@@ -83353,8 +83418,8 @@ async function maybeWriteDaemonServiceContract(input) {
83353
83418
  contractDeviceId: reusableCurrentContract?.deviceId
83354
83419
  }),
83355
83420
  deviceIdPath: runtimePaths.deviceIdPath
83356
- }).catch(() => reusableCurrentContract?.deviceId ?? null) : normalizeOptionalText$46(input.deviceId) ?? reusableCurrentContract?.deviceId ?? null;
83357
- const resolvedProfileId = normalizeOptionalText$46(input.contractProfileId);
83421
+ }).catch(() => reusableCurrentContract?.deviceId ?? null) : normalizeOptionalText$47(input.deviceId) ?? reusableCurrentContract?.deviceId ?? null;
83422
+ const resolvedProfileId = normalizeOptionalText$47(input.contractProfileId);
83358
83423
  const resolvedOwnerUserId = await resolveDaemonServiceContractOwnerUserId({
83359
83424
  currentContract,
83360
83425
  openMeldProfileId: resolvedProfileId
@@ -83376,20 +83441,20 @@ async function maybeWriteDaemonServiceContract(input) {
83376
83441
  return writeResult.contract;
83377
83442
  }
83378
83443
  async function resolveDaemonServiceContractOwnerUserId(input) {
83379
- const profileId = normalizeOptionalText$46(input.openMeldProfileId);
83444
+ const profileId = normalizeOptionalText$47(input.openMeldProfileId);
83380
83445
  if (profileId) {
83381
83446
  const selectedProfile = getCurrentCommandCheckState().selectedProfile;
83382
- if (selectedProfile?.openMeldProfileId === profileId) return normalizeOptionalText$46(selectedProfile.profile.ownerUserId) ?? void 0;
83383
- return normalizeOptionalText$46((await resolveOpenMeldProfileOrNull({
83447
+ if (selectedProfile?.openMeldProfileId === profileId) return normalizeOptionalText$47(selectedProfile.profile.ownerUserId) ?? void 0;
83448
+ return normalizeOptionalText$47((await resolveOpenMeldProfileOrNull({
83384
83449
  openMeldProfileId: profileId,
83385
83450
  allowDefaultFallback: false,
83386
83451
  allowUnauthenticated: true,
83387
83452
  persistSelection: false
83388
83453
  }).catch(() => null))?.ownerUserId) ?? void 0;
83389
83454
  }
83390
- const authOwnerUserId = normalizeOptionalText$46((await Promise.resolve(getAuthSessionState({ validateRemote: false })).catch(() => null))?.session?.user?.id);
83455
+ const authOwnerUserId = normalizeOptionalText$47((await Promise.resolve(getAuthSessionState({ validateRemote: false })).catch(() => null))?.session?.user?.id);
83391
83456
  if (authOwnerUserId) return authOwnerUserId;
83392
- return normalizeOptionalText$46(input.currentContract?.ownerUserId) ?? void 0;
83457
+ return normalizeOptionalText$47(input.currentContract?.ownerUserId) ?? void 0;
83393
83458
  }
83394
83459
  async function stageDaemonBackgroundServiceContract(input) {
83395
83460
  const previousContract = await readDaemonServiceContract().catch(() => null);
@@ -111010,4 +111075,4 @@ function isHumanInteractiveSpaceRuntime(runtime) {
111010
111075
  //#endregion
111011
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 };
111012
111077
 
111013
- //# sourceMappingURL=command-CU_3raCS.js.map
111078
+ //# sourceMappingURL=command-BV6ylBgU.js.map