openmeld 0.3.134 → 0.3.136

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 runWithHeldLock, $t as formatLocalMachineIssueMessage, At as normalizeAccountKey, B as toSpaceRemoveMembersUrl, C as updateConfiguredDeviceRuntimeState, Ct as accountProfileWorkspacePath, D as normalizeBaseUrl, Dt as deviceOpenClawProfileWorkspaceDir, Et as deviceOpenClawProfileDir, Ft as openMeldManagedVersionBinaryPath, Gt as resolveOpenMeldEnvPreset, H as toSpaceUpdatesUrl, Ht as resolveDefaultOpenMeldHomeDirname, I as toSpaceLeaveUrl, It as openMeldManagedVersionDir, Jt as runtimeDir, K as isOpenMeldLockError, Kt as resolveOpenMeldPresetOwnedPathInput, L as toSpaceMembersUrl, Lt as openMeldRootDir, M as toSpaceCursorUrl, Mt as openMeldBackupsDir, N as toSpaceDeleteUrl, Nt as openMeldBinDir, O as toDaemonRouteObservationUrl, Ot as isPublishedOpenMeldHome, Pt as openMeldManagedBinaryPath, Q as resolveOpenMeldOrphanedLockIssue, Qt as systemDir, R as toSpaceMetaUrl, Rt as openMeldVersionsDir, S as setConfiguredSkillsConfig, St as accountProfileViewPath, T as updateConfiguredSkillsConfig, Tt as deviceOpenClawProfileBootstrapPath, U as toSpaceWsUrl, Ut as resolveExplicitOpenMeldEnvPreset, W as acquireLock, Xt as skillsDir, Yt as runtimeLogsDir, _ as getConfiguredViewCustomization, _n as normalizeKnownBuiltinAgentControllerId, _t as CURRENT_PROCESS_START_IDENTITY, a as resolveBaseUrl, an as runtimeTransportModeSchema, at as resolveCliContext, bt as accountProfileLocalMetaPath, c as resolveExplicitGatewayUrlOrThrow, cn as conversationPolicySchema, d as createDefaultRuntimeAgentControllerSettings, dn as HOSTED_CENTER_AGENT_CONTROLLER_REF_ID, dt as assessLocalMachineFailure, f as getConfiguredDaemonDispatchLimits, g as getConfiguredSkillsConfig, gn as normalizeBuiltinAgentControllerId, h as getConfiguredOpenMeldToolsMaintenance, hn as canonicalizeBuiltinAgentControllerRef, i as normalizeGatewayBaseUrlOrNull, in as runtimeStreamingModeSchema, it as readCliContextState, j as toSpaceCreateUrl, jt as normalizeOpenMeldProfileId, kt as legacyAccountProfileSpacesDir, l as DEFAULT_RUNTIME_AGENT_TRANSPORT_MODE, ln as resolveBuiltinAgentControllerConversationKind, lt as resolveOpenMeldLaneDescriptor, mn as canonicalizeAgentControllerRef, nn as runtimeAgentControllerLaunchContractSchema, o as resolveBaseUrlOrNull, ot as resolveCliContextId, p as getConfiguredDeviceRuntimeState, pn as buildAgentControllerRoutingKey, pt as createBackgroundExecutionBlockedIssue, q as isOpenMeldOrphanedLockError, qt as resolveOpenMeldRootDir, r as normalizeGatewayBaseUrl, rt as listCliContextStates, s as resolveDefaultGatewayBaseUrl, sn as buildAgentControllerConversationRef, st as writeCliContextState, tn as runtimeAgentControllerConversationIdMappingSpecSchema, un as HOSTED_CENTER_AGENT_CONTROLLER_REF, v as getRuntimeConfigReadHealth, vn as parseAgentControllerRef$1, vt as isProcessIdentityAlive, wt as accountsDir, x as setConfiguredOpenMeldToolsMaintenance, xt as accountProfileSpaceCacheDir, y as resolveRuntimeSkillsCustomTargetId, yt as OPENMELD_HOME_ENV_KEY, z as toSpacePasswordUrl } from "./base-url-BtqW4aLS.js";
4
- import { A as MAX_TEXT_LENGTH, At as createCenterAgentRoutineResponseSchema, B as sleep, C as createSpaceApi, D as toStructuredApiClientFailure, Dt as organizationComputersResponseSchema, E as resolveProfileSpaceHistoryGatewayHost, Et as profileErrorResponseSchema, F as OPENMELD_HEADER_PROFILE_ID, Ft as resumeCenterAgentRoutineResponseSchema, Gt as localProjectControlDaemonFrameSchema, H as getSpaceUpdatesResponseSchema, It as updateCenterAgentRoutineResponseSchema, Jt as postSpaceMembersResponseSchema, Kt as localProjectControlDiscoverProjectsResponseSchema, L as OPENMELD_HEADER_REQUEST_ID, M as parseIncoming$1, Mt as listCenterAgentRoutineRunsResponseSchema, N as parseServerErrorFrame$1, Nt as listCenterAgentRoutinesResponseSchema, O as DAEMON_STREAM_KEEPALIVE_PING, Ot as submitFeedbackIssueRequestSchema, P as resolveCustomMentionAliasOverride, Pt as pauseCenterAgentRoutineResponseSchema, Q as submitAgentControllerTaskLifecycleEventItemSchema, Rt as AGENT_ACTIVITY_PRESENCE_TTL_MAX_MS, S as createRuntimeReportingApi, St as ADDITIONAL_HUMAN_PROFILE_CREATION_DISABLED_MESSAGE, T as resolveAccountSpaceIndexGatewayHost, Tt as profileCapabilitiesResponseSchema, U as SPACE_DISPATCH_TRACE_PROMPT_PREVIEW_MAX_CHARS, Ut as agentActivitySnapshotResponseSchema, V as toErrorMessage$43, Wt as localProjectControlConnectionSchema, Xt as spaceMemberDirectoryEntrySchema, Yt as removeSpaceMembersResponseSchema, Zt as spaceMemberDirectorySchema, _n as agentControllerPermissionModeSchema, _t as organizationSkillReleaseSummarySchema, a as buildSpaceAttachmentDownloadPath, an as createProjectResponseSchema, at as COMPUTER_FILE_ACCESS_RUNTIME_CAPABILITY, bt as organizationDirectoryResponseSchema, c as createAgentProfileBindingApi, cn as updateProjectResponseSchema, ct as computerFileAccessPolicyInputSchema, d as createCurrentDeviceApi, dt as organizationSpaceDirectoryWithMemberCountsResponseSchema, ft as spaceCreatorSchema, g as createOrganizationApi, h as createOpenMeldApiClient, ht as listOrganizationSkillsResponseSchema, i as buildProfileSpaceHistoryUpsertPath, in as archiveProjectResponseSchema, it as gatewayErrorEnvelopeSchema, j as parseEnvelope$1, jt as deleteCenterAgentRoutineResponseSchema, kt as submitFeedbackIssueResponseSchema, ln as centerAgentToolSpeakerSchema, lt as computerFileAccessPolicySchema, m as createLocalRuntimeExpectedRoutesApi, mt as getOrganizationSkillResponseSchema, n as OpenMeldApiClientInvalidResponseError, o as createAccountSpaceIndexApi, on as listProjectsResponseSchema, ot as OPENMELD_RUNTIME_CAPABILITIES_HEADER, p as createFetchTransport, pt as spaceMetaSchema, qt as leaveSpaceResponseSchema, r as buildProfileSpaceHistoryStatusPath, rn as observedLocalAgentSessionSchema, s as createAgentActivityApi, sn as projectSchema, st as computerFileAccessDaemonFrameSchema, t as OpenMeldApiClientHttpError, tn as agentActivitySessionInventoryResponseSchema, un as openCodePermissionConfigSchema, ut as modelCatalogSchema, vn as agentControllerCollaborationModeSchema, vt as organizationSkillSummarySchema, wt as authProfileManagedRoleSchema, xt as ADDITIONAL_HUMAN_PROFILE_CREATION_DISABLED_CODE, y as createProfileSpaceHistoryApi, yn as toLegacySpaceAddressingWireValue, z as toErrorMessage$44, zt as agentActivityEventSchema } from "./dist-Fj_YSHkO.js";
5
- import { $r as openMeldRuntimeProfileIdSchema, A as runtimeTransportRegisterSessionResponseSchema, B as openMeldDaemonTaskResultOpenClawGatewayVisibilityStatusSchema, Bn as formatLocalComponentsSummaryLabel, C as runtimeTransportLocalAgentControlRefreshCatalogFramePayloadSchema, Cn as getSpaceMessageAddressingRelationSupportForTargetKind, D as runtimeTransportOpenMeldToolsControlFramePayloadSchema, E as runtimeTransportLookupRouteOwnerServiceEvidenceSchema, En as resolveMessageEnvelopeTargetField, Ft as SPACE_FILE_MAX_SIZE_BYTES, G as OPENMELD_LOCAL_FOLDER_PICKER_CAPABILITY_HEADER, Hn as formatLocalSetupActionLabel, I as runtimeTransportSubmitTaskResultRequestSchema, In as agentInteractionRequestSchema, Ir as normalizeSpacePasswordText, J as localFolderPickerHelperResultSchema, Jn as localServiceComponentUpdateProjectionSchema, K as localFolderPickerDaemonFrameSchema, Ln as agentInteractionResolutionSchema, M as runtimeTransportResumeControllerConversationFramePayloadSchema, Mr as runtimeCoordinatorExecutionTokenEnvelopeSchema, N as runtimeTransportResumeControllerConversationResultFramePayloadSchema, Nr as runtimeTransportDeliveryExecutionIdentitySchema, O as runtimeTransportOpenMeldToolsControlResultFramePayloadSchema, Or as parseOptionalClientMessageId, P as runtimeTransportRouteCatalogChangedFramePayloadSchema, Pn as AGENT_INTERACTION_DEFAULT_TIMEOUT_MS, Qn as openMeldToolsUpdateOperationPhaseSchema, Qr as normalizeOptionalWorkingDirectory, R as openMeldDaemonProviderAccessEvidenceSchema, Rr as resolveSingleSpaceMentionLabels, S as runtimeTransportLocalAgentControlManageInstallationFramePayloadSchema, Sn as formatCanonicalMentionLiteral, T as runtimeTransportLocalAgentControlSetProfileWorkspaceFramePayloadSchema, Tn as normalizeMessageEnvelope, U as openMeldSpaceEgressActionSchema, Un as installedLocalComponentsSnapshotSchema, Ut as resolveSpaceFileMimeType, V as openMeldDaemonTaskResultPayloadSchema, Vn as formatLocalSetupActionDescription, W as LOCAL_FOLDER_PICKER_RUNTIME_CAPABILITY, Wn as localCliComponentUpdateProjectionSchema, Xr as MAX_PROFILE_WORKING_DIRECTORY_LENGTH, Yr as openMeldRequestContextSchema, Zn as openMeldToolsUpdateAttemptSchema, Zr as agentProfileIdSchema, _ as runtimeTransportHeartbeatRequestSchema, _t as SPACE_MENTION_REJECT_NOTICE_PURPOSE, a as runtimeTransportCapabilitiesSchema, an as conversationExecutionStateSchema, b as runtimeTransportLocalAgentControlForkSessionFramePayloadSchema, bn as MESSAGE_MENTION_TYPE_VALUES, c as runtimeTransportDispatchInteractionRequestSchema, ci as trimmedStringFromUnknown, cr as enumFactory, d as runtimeTransportDispatchPreviewEndRequestSchema, di as resolveMappedPublicAgentFailureReason, dr as literal, dt as CONVERSATION_CONTINUITY_WARNING_PURPOSE, en as openMeldDaemonControlPlaneRequestSchema, f as runtimeTransportDispatchPreviewRequestSchema, fi as resolvePublicAgentAvailabilityCopy, g as runtimeTransportForkAgentSessionResultSchema, gt as SPACE_MEMBER_REMOVE_NOTICE_PURPOSE, h as runtimeTransportErrorCodeSchema, hi as shouldPreferMappedPublicAgentFailureReason, ht as SPACE_MEMBER_JOIN_NOTICE_PURPOSE, i as localWakeRouteReportSchema, in as providerDispatchRuntimeContextSchema, ir as boolean, j as runtimeTransportRejectedProfileRegistrationSchema, k as runtimeTransportRegisterSessionRequestSchema, l as runtimeTransportDispatchInteractionResponseFramePayloadSchema, li as MAX_TEXT_LENGTH$1, m as runtimeTransportDispatchToolActivityRequestSchema, mi as sanitizeDispatchErrorSummary, n as daemonExecutionCompatibilitySchema, o as runtimeTransportDeliverDispatchRequestSchema, or as discriminatedUnion, p as runtimeTransportDispatchRuntimeEvidenceRequestSchema, pi as resolvePublicAgentFailureRecovery, q as localFolderPickerHelperProtocolResultSchema, qt as spaceFileNameSchema, r as daemonStreamFrameSchema, ri as profileWorkspaceModeSchema, rn as skippedDaemonProfileSchema, s as runtimeTransportDispatchInteractionDeliveredRequestSchema, t as CURRENT_DAEMON_EXECUTION_CONTRACT_EPOCH, tn as openMeldDaemonControlPlaneResponseSchema, tr as openMeldToolsUpdateRequestSourceSchema, u as runtimeTransportDispatchLifecycleRequestSchema, ui as resolveDetailedPublicAgentFailureReason$1, ur as iso, v as runtimeTransportHeartbeatResponseSchema, vr as strictObject, w as runtimeTransportLocalAgentControlSetEnabledFramePayloadSchema, wr as url, x as runtimeTransportLocalAgentControlInterruptFramePayloadSchema, xn as collectCanonicalMentionTextFragments, y as runtimeTransportLocalAgentControlCancelFramePayloadSchema, yi as resolveCommandAgentWorkActivity, yr as string, yt as sanitizeSignalTextPreview, z as openMeldDaemonTaskResultEnvelopeWriteSchema, zn as formatLocalComponentsSummaryDescription, zr as resolveSpaceMentionLabels } from "./runtime-transport-D4_-d5Yb.js";
4
+ import { A as MAX_TEXT_LENGTH, At as createCenterAgentRoutineResponseSchema, B as sleep, C as createSpaceApi, D as toStructuredApiClientFailure, Dt as organizationComputersResponseSchema, E as resolveProfileSpaceHistoryGatewayHost, Et as profileErrorResponseSchema, F as OPENMELD_HEADER_PROFILE_ID, Ft as resumeCenterAgentRoutineResponseSchema, Gt as localProjectControlDaemonFrameSchema, H as getSpaceUpdatesResponseSchema, It as updateCenterAgentRoutineResponseSchema, Jt as postSpaceMembersResponseSchema, Kt as localProjectControlDiscoverProjectsResponseSchema, L as OPENMELD_HEADER_REQUEST_ID, M as parseIncoming$1, Mt as listCenterAgentRoutineRunsResponseSchema, N as parseServerErrorFrame$1, Nt as listCenterAgentRoutinesResponseSchema, O as DAEMON_STREAM_KEEPALIVE_PING, Ot as submitFeedbackIssueRequestSchema, P as resolveCustomMentionAliasOverride, Pt as pauseCenterAgentRoutineResponseSchema, Q as submitAgentControllerTaskLifecycleEventItemSchema, Rt as AGENT_ACTIVITY_PRESENCE_TTL_MAX_MS, S as createRuntimeReportingApi, St as ADDITIONAL_HUMAN_PROFILE_CREATION_DISABLED_MESSAGE, T as resolveAccountSpaceIndexGatewayHost, Tt as profileCapabilitiesResponseSchema, U as SPACE_DISPATCH_TRACE_PROMPT_PREVIEW_MAX_CHARS, Ut as agentActivitySnapshotResponseSchema, V as toErrorMessage$43, Wt as localProjectControlConnectionSchema, Xt as spaceMemberDirectoryEntrySchema, Yt as removeSpaceMembersResponseSchema, Zt as spaceMemberDirectorySchema, _n as agentControllerPermissionModeSchema, _t as organizationSkillReleaseSummarySchema, a as buildSpaceAttachmentDownloadPath, an as createProjectResponseSchema, at as COMPUTER_FILE_ACCESS_RUNTIME_CAPABILITY, bt as organizationDirectoryResponseSchema, c as createAgentProfileBindingApi, cn as updateProjectResponseSchema, ct as computerFileAccessPolicyInputSchema, d as createCurrentDeviceApi, dt as organizationSpaceDirectoryWithMemberCountsResponseSchema, ft as spaceCreatorSchema, g as createOrganizationApi, h as createOpenMeldApiClient, ht as listOrganizationSkillsResponseSchema, i as buildProfileSpaceHistoryUpsertPath, in as archiveProjectResponseSchema, it as gatewayErrorEnvelopeSchema, j as parseEnvelope$1, jt as deleteCenterAgentRoutineResponseSchema, kt as submitFeedbackIssueResponseSchema, ln as centerAgentToolSpeakerSchema, lt as computerFileAccessPolicySchema, m as createLocalRuntimeExpectedRoutesApi, mt as getOrganizationSkillResponseSchema, n as OpenMeldApiClientInvalidResponseError, o as createAccountSpaceIndexApi, on as listProjectsResponseSchema, ot as OPENMELD_RUNTIME_CAPABILITIES_HEADER, p as createFetchTransport, pt as spaceMetaSchema, qt as leaveSpaceResponseSchema, r as buildProfileSpaceHistoryStatusPath, rn as observedLocalAgentSessionSchema, s as createAgentActivityApi, sn as projectSchema, st as computerFileAccessDaemonFrameSchema, t as OpenMeldApiClientHttpError, tn as agentActivitySessionInventoryResponseSchema, un as openCodePermissionConfigSchema, ut as modelCatalogSchema, vn as agentControllerCollaborationModeSchema, vt as organizationSkillSummarySchema, wt as authProfileManagedRoleSchema, xt as ADDITIONAL_HUMAN_PROFILE_CREATION_DISABLED_CODE, y as createProfileSpaceHistoryApi, yn as toLegacySpaceAddressingWireValue, z as toErrorMessage$44, zt as agentActivityEventSchema } from "./dist-0qM_CVk2.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, _ 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-BiQfJGnw.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-D82uDZ5s.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-BbrUVaZd.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-DNnxEYcg.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-Bj8n8YwV.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-CabWpjFe.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";
@@ -3921,6 +3921,14 @@ function text$2(value) {
3921
3921
  return typeof value === "string" && value.trim() ? value.trim() : null;
3922
3922
  }
3923
3923
  //#endregion
3924
+ //#region ../../runtime/adapters/core/dist/provider-original-error.js
3925
+ function createProviderOriginalError(value) {
3926
+ if (typeof value !== "string") return null;
3927
+ const normalized = value.trim();
3928
+ if (normalized.length === 0 || !isOriginalErrorSafeForMessageDetails(normalized)) return null;
3929
+ return normalized.slice(0, OPENMELD_ORIGINAL_ERROR_MAX_LENGTH);
3930
+ }
3931
+ //#endregion
3924
3932
  //#region ../../runtime/adapters/core/dist/agent-controller-process.js
3925
3933
  const PROCESS_TABLE_COLUMN_SEPARATOR = /\s+/u;
3926
3934
  const PROCESS_TABLE_LINE_SEPARATOR = /\r?\n/u;
@@ -6248,8 +6256,6 @@ function normalizePermissionKind(value) {
6248
6256
  const normalized = String(value ?? "").trim().toLowerCase().replace(UNSAFE_PERMISSION_KIND_CHARACTER_RE, "_").replace(EDGE_UNDERSCORE_RE, "");
6249
6257
  return normalized.length > 0 ? normalized : null;
6250
6258
  }
6251
- //#endregion
6252
- //#region ../../runtime/adapters/core/dist/index.js
6253
6259
  const DEFAULT_GRACEFUL_INTERRUPT_TIMEOUT_MS = 1e4;
6254
6260
  const DEFAULT_INTERRUPT_REASON = "service.interrupt";
6255
6261
  const DEFAULT_CANCEL_REASON = "service.cancel";
@@ -6488,20 +6494,41 @@ const buildAdapterCancelRequest = (input) => ({
6488
6494
  });
6489
6495
  const toAdapterDispatchFailure = (error, defaultErrorType = "adapter") => {
6490
6496
  const errorCode = extractErrorCode$2(error);
6497
+ const agentControllerConversationOccupancy = extractAgentControllerConversationOccupancy(error);
6491
6498
  const errorType = extractErrorType(error) ?? defaultErrorType;
6492
6499
  const diagnostics = extractDispatchDiagnostics(error);
6493
6500
  const providerAccessEvidence = extractProviderAccessEvidence(error);
6501
+ const originalError = extractProviderOriginalError(error);
6494
6502
  const telemetry = extractDispatchTelemetry(error);
6495
6503
  return {
6504
+ ...agentControllerConversationOccupancy ? { agentControllerConversationOccupancy } : {},
6496
6505
  ...diagnostics ? { diagnostics } : {},
6497
6506
  ...errorCode ? { errorCode } : {},
6498
6507
  errorMessage: error instanceof Error ? error.message : "adapter dispatch failed",
6499
6508
  errorType,
6509
+ ...originalError ? { originalError } : {},
6500
6510
  ...providerAccessEvidence ? { providerAccessEvidence } : {},
6501
6511
  status: "failed",
6502
6512
  ...telemetry ? { telemetry } : {}
6503
6513
  };
6504
6514
  };
6515
+ const extractAgentControllerConversationOccupancy = (error) => {
6516
+ if (!(error && typeof error === "object")) return null;
6517
+ const value = error.agentControllerConversationOccupancy;
6518
+ if (!(value && typeof value === "object")) return null;
6519
+ const occupancy = value;
6520
+ const agentControllerConversationId = typeof occupancy.agentControllerConversationId === "string" ? occupancy.agentControllerConversationId.trim() : "";
6521
+ if (!agentControllerConversationId || occupancy.contractVersion !== 1 || occupancy.state !== "occupied") return null;
6522
+ return {
6523
+ agentControllerConversationId,
6524
+ contractVersion: 1,
6525
+ state: "occupied"
6526
+ };
6527
+ };
6528
+ const extractProviderOriginalError = (error) => {
6529
+ if (!(error && typeof error === "object")) return null;
6530
+ return createProviderOriginalError(error.originalError);
6531
+ };
6505
6532
  const extractDispatchTelemetry = (error) => {
6506
6533
  if (!error || typeof error !== "object") return null;
6507
6534
  const telemetry = toUnknownRecord(error.telemetry);
@@ -7490,6 +7517,7 @@ const countVisibleLines$1 = (value) => {
7490
7517
  var ClaudeCliTransportError = class extends Error {
7491
7518
  code;
7492
7519
  errorType;
7520
+ originalError;
7493
7521
  providerAccessEvidence;
7494
7522
  telemetry;
7495
7523
  constructor(input) {
@@ -7497,6 +7525,7 @@ var ClaudeCliTransportError = class extends Error {
7497
7525
  this.name = "ClaudeCliTransportError";
7498
7526
  this.code = input.code;
7499
7527
  this.errorType = input.errorType;
7528
+ if (input.originalError) this.originalError = input.originalError;
7500
7529
  if (input.providerAccessEvidence) this.providerAccessEvidence = input.providerAccessEvidence;
7501
7530
  if (input.telemetry) this.telemetry = input.telemetry;
7502
7531
  }
@@ -7526,6 +7555,7 @@ async function invokeClaudeCliTransport(input) {
7526
7555
  let latestResultIsError = false;
7527
7556
  let resolvedSessionId = normalizeOptionalText$64(input.sessionId);
7528
7557
  const providerErrorMessages = [];
7558
+ const providerOriginalErrorMessages = [];
7529
7559
  let firstStdoutAtMs = null;
7530
7560
  let firstOutputAtMs = null;
7531
7561
  const previewEmitter = createClaudePreviewEmitter({
@@ -7554,6 +7584,7 @@ async function invokeClaudeCliTransport(input) {
7554
7584
  latestResultIsError,
7555
7585
  previewEmitter,
7556
7586
  providerErrorMessages,
7587
+ providerOriginalErrorMessages,
7557
7588
  resolvedSessionId
7558
7589
  });
7559
7590
  firstOutputAtMs = nextState.firstOutputAtMs;
@@ -7585,6 +7616,7 @@ async function invokeClaudeCliTransport(input) {
7585
7616
  const classifiedFailure = classifyClaudeFailure({
7586
7617
  exitSignal: driverResult.signal,
7587
7618
  providerErrorMessages,
7619
+ providerOriginalErrorMessages,
7588
7620
  stderrText: driverResult.stderrText,
7589
7621
  stdoutText: driverResult.stdoutText
7590
7622
  });
@@ -7592,6 +7624,7 @@ async function invokeClaudeCliTransport(input) {
7592
7624
  code: classifiedFailure.code,
7593
7625
  errorType: classifiedFailure.errorType,
7594
7626
  message: classifiedFailure.message,
7627
+ ...classifiedFailure.originalError ? { originalError: classifiedFailure.originalError } : {},
7595
7628
  ...classifiedFailure.providerAccessEvidence ? { providerAccessEvidence: classifiedFailure.providerAccessEvidence } : {},
7596
7629
  telemetry
7597
7630
  });
@@ -7706,7 +7739,10 @@ const handleClaudeStdoutLine = (input) => {
7706
7739
  latestOutput = parsedLine.resultText;
7707
7740
  if (firstOutputAtMs === null) firstOutputAtMs = Date.now();
7708
7741
  }
7709
- if (parsedLine.errorMessage) input.providerErrorMessages.push(parsedLine.errorMessage);
7742
+ if (parsedLine.errorMessage) {
7743
+ input.providerErrorMessages.push(parsedLine.errorMessage);
7744
+ input.providerOriginalErrorMessages.push(parsedLine.errorMessage);
7745
+ }
7710
7746
  if (parsedLine.isErrorResult === true) latestResultIsError = true;
7711
7747
  else {
7712
7748
  latestResultIsError = false;
@@ -7745,6 +7781,7 @@ const toClaudeCliTransportError = (error, timeoutMs) => {
7745
7781
  code: classifiedFailure.code,
7746
7782
  errorType: classifiedFailure.errorType,
7747
7783
  message: classifiedFailure.message,
7784
+ ...classifiedFailure.originalError ? { originalError: classifiedFailure.originalError } : {},
7748
7785
  ...classifiedFailure.providerAccessEvidence ? { providerAccessEvidence: classifiedFailure.providerAccessEvidence } : {}
7749
7786
  });
7750
7787
  }
@@ -7756,9 +7793,10 @@ const toClaudeCliTransportError = (error, timeoutMs) => {
7756
7793
  });
7757
7794
  };
7758
7795
  const classifyClaudeFailure = (input) => {
7796
+ const trustedProviderMessages = /* @__PURE__ */ new Set([...input.providerOriginalErrorMessages ?? [], ...extractErrorMessagesFromStdout$2(input.stdoutText)]);
7759
7797
  const providerMessage = resolveProviderFailureMessage$3(input);
7760
7798
  if (providerMessage) {
7761
- const classified = classifyProviderMessageFailure(providerMessage);
7799
+ const classified = classifyProviderMessageFailure(providerMessage, trustedProviderMessages.has(providerMessage));
7762
7800
  if (classified) return classified;
7763
7801
  }
7764
7802
  if (input.exitSignal) return {
@@ -7774,50 +7812,55 @@ const classifyClaudeFailure = (input) => {
7774
7812
  };
7775
7813
  return { ...buildProviderExitError({ providerLabel: "claude" }) };
7776
7814
  };
7777
- const classifyProviderMessageFailure = (providerMessage) => {
7815
+ const classifyProviderMessageFailure = (providerMessage, includeOriginalError) => {
7778
7816
  const lowered = providerMessage.toLowerCase();
7817
+ const originalError = includeOriginalError ? createProviderOriginalError(providerMessage) : null;
7818
+ const withOriginalError = (value) => ({
7819
+ ...value,
7820
+ ...originalError ? { originalError } : {}
7821
+ });
7779
7822
  const providerAccessEvidence = buildClaudeCodeProviderAccessEvidence(lowered);
7780
7823
  const permissionDenial = classifyRuntimePermissionDenialMessage({
7781
7824
  message: providerMessage,
7782
7825
  source: "claude-code"
7783
7826
  });
7784
- if (permissionDenial) return {
7827
+ if (permissionDenial) return withOriginalError({
7785
7828
  code: permissionDenial.code,
7786
7829
  errorType: permissionDenial.errorType,
7787
7830
  message: permissionDenial.message
7788
- };
7789
- if (isAuthFailure$1(lowered)) return {
7831
+ });
7832
+ if (isAuthFailure$1(lowered)) return withOriginalError({
7790
7833
  code: "auth.required",
7791
7834
  errorType: "auth",
7792
7835
  message: providerMessage,
7793
7836
  ...providerAccessEvidence ? { providerAccessEvidence } : {}
7794
- };
7795
- if (isQuotaFailure$1(lowered)) return {
7837
+ });
7838
+ if (isQuotaFailure$1(lowered)) return withOriginalError({
7796
7839
  code: "quota.exceeded",
7797
7840
  errorType: "adapter",
7798
7841
  message: providerMessage,
7799
7842
  ...providerAccessEvidence ? { providerAccessEvidence } : {}
7800
- };
7801
- if (isRateLimitFailure$1(lowered)) return {
7843
+ });
7844
+ if (isRateLimitFailure$1(lowered)) return withOriginalError({
7802
7845
  code: "rate_limited",
7803
7846
  errorType: "adapter",
7804
7847
  message: providerMessage
7805
- };
7806
- if (isProviderOverloadedFailure(lowered)) return {
7848
+ });
7849
+ if (isProviderOverloadedFailure(lowered)) return withOriginalError({
7807
7850
  code: "provider.unavailable",
7808
7851
  errorType: "adapter",
7809
7852
  message: providerMessage
7810
- };
7811
- if (isModelConfigFailure(lowered)) return {
7853
+ });
7854
+ if (isModelConfigFailure(lowered)) return withOriginalError({
7812
7855
  code: "config.invalid",
7813
7856
  errorType: "config",
7814
7857
  message: toConfigInvalidMessage$1(providerMessage)
7815
- };
7816
- if (isLikelyClaudeContextLostError(providerMessage)) return {
7858
+ });
7859
+ if (isLikelyClaudeContextLostError(providerMessage)) return withOriginalError({
7817
7860
  code: "context.lost",
7818
7861
  errorType: "adapter",
7819
7862
  message: providerMessage
7820
- };
7863
+ });
7821
7864
  return null;
7822
7865
  };
7823
7866
  const resolveProviderFailureMessage$3 = (input) => {
@@ -7900,6 +7943,7 @@ function normalizeOptionalText$64(value) {
7900
7943
  var ClaudeAgentSdkTransportError = class extends Error {
7901
7944
  code;
7902
7945
  errorType;
7946
+ originalError;
7903
7947
  providerAccessEvidence;
7904
7948
  telemetry;
7905
7949
  constructor(input) {
@@ -7907,6 +7951,7 @@ var ClaudeAgentSdkTransportError = class extends Error {
7907
7951
  this.name = "ClaudeAgentSdkTransportError";
7908
7952
  this.code = input.code;
7909
7953
  this.errorType = input.errorType;
7954
+ if (input.originalError) this.originalError = input.originalError;
7910
7955
  if (input.providerAccessEvidence) this.providerAccessEvidence = input.providerAccessEvidence;
7911
7956
  if (input.telemetry) this.telemetry = input.telemetry;
7912
7957
  }
@@ -8050,12 +8095,14 @@ async function invokeClaudeAgentSdkTransport(input) {
8050
8095
  });
8051
8096
  const classifiedFailure = classifyClaudeFailure({
8052
8097
  providerErrorMessages,
8098
+ providerOriginalErrorMessages: providerErrorMessages,
8053
8099
  stderrText: stderrChunks.join("")
8054
8100
  });
8055
8101
  throw new ClaudeAgentSdkTransportError({
8056
8102
  code: classifiedFailure.code,
8057
8103
  errorType: classifiedFailure.errorType,
8058
8104
  message: classifiedFailure.message,
8105
+ ...projectClaudeOriginalError(classifiedFailure),
8059
8106
  ...classifiedFailure.providerAccessEvidence ? { providerAccessEvidence: classifiedFailure.providerAccessEvidence } : {},
8060
8107
  telemetry
8061
8108
  });
@@ -8072,12 +8119,14 @@ async function invokeClaudeAgentSdkTransport(input) {
8072
8119
  });
8073
8120
  const classifiedFailure = classifyClaudeFailure({
8074
8121
  providerErrorMessages,
8122
+ providerOriginalErrorMessages: providerErrorMessages,
8075
8123
  stderrText: stderrChunks.join("")
8076
8124
  });
8077
8125
  throw new ClaudeAgentSdkTransportError({
8078
8126
  code: classifiedFailure.code,
8079
8127
  errorType: classifiedFailure.errorType,
8080
8128
  message: classifiedFailure.message,
8129
+ ...projectClaudeOriginalError(classifiedFailure),
8081
8130
  ...classifiedFailure.providerAccessEvidence ? { providerAccessEvidence: classifiedFailure.providerAccessEvidence } : {},
8082
8131
  telemetry
8083
8132
  });
@@ -8402,13 +8451,15 @@ function toClaudeAgentSdkTransportError(input) {
8402
8451
  }
8403
8452
  const fallbackMessage = input.error instanceof Error ? input.error.message : String(input.error);
8404
8453
  const classifiedFailure = classifyClaudeFailure({
8405
- providerErrorMessages: [...input.providerErrorMessages, normalizeOptionalText$63(fallbackMessage) ?? ""],
8406
- stderrText: input.stderrText
8454
+ providerErrorMessages: input.providerErrorMessages,
8455
+ providerOriginalErrorMessages: input.providerErrorMessages,
8456
+ stderrText: [fallbackMessage, input.stderrText].map(normalizeOptionalText$63).filter((value) => value !== null).join("\n")
8407
8457
  });
8408
8458
  return new ClaudeAgentSdkTransportError({
8409
8459
  code: classifiedFailure.code,
8410
8460
  errorType: classifiedFailure.errorType,
8411
8461
  message: classifiedFailure.message,
8462
+ ...projectClaudeOriginalError(classifiedFailure),
8412
8463
  ...classifiedFailure.providerAccessEvidence ? { providerAccessEvidence: classifiedFailure.providerAccessEvidence } : {},
8413
8464
  telemetry: buildClaudeAgentSdkTelemetry({
8414
8465
  firstOutputAtMs: input.firstOutputAtMs,
@@ -8421,6 +8472,9 @@ function toClaudeAgentSdkTransportError(input) {
8421
8472
  })
8422
8473
  });
8423
8474
  }
8475
+ function projectClaudeOriginalError(input) {
8476
+ return input.originalError ? { originalError: input.originalError } : {};
8477
+ }
8424
8478
  function buildPosixWrapperScript(input) {
8425
8479
  return [
8426
8480
  "#!/bin/sh",
@@ -8458,6 +8512,7 @@ function normalizeOptionalText$63(value) {
8458
8512
  var ClaudeRuntimeError = class extends Error {
8459
8513
  code;
8460
8514
  errorType;
8515
+ originalError;
8461
8516
  providerAccessEvidence;
8462
8517
  telemetry;
8463
8518
  constructor(input) {
@@ -8465,6 +8520,7 @@ var ClaudeRuntimeError = class extends Error {
8465
8520
  this.name = "ClaudeRuntimeError";
8466
8521
  this.code = input.code;
8467
8522
  this.errorType = input.errorType;
8523
+ if (input.originalError) this.originalError = input.originalError;
8468
8524
  if (input.providerAccessEvidence) this.providerAccessEvidence = input.providerAccessEvidence;
8469
8525
  if (input.telemetry) this.telemetry = input.telemetry;
8470
8526
  }
@@ -8475,11 +8531,13 @@ async function invokeClaudeWithSingleContextHeal(input) {
8475
8531
  contextLossPolicy: input.executionMode === "repair" ? "fail" : "rebuild",
8476
8532
  createRebuildFailedError: (error) => {
8477
8533
  const providerAccessEvidence = getClaudeProviderAccessEvidence(error);
8534
+ const originalError = getClaudeOriginalError(error);
8478
8535
  const telemetry = getClaudeTelemetry(error);
8479
8536
  return new ClaudeRuntimeError({
8480
8537
  code: "context.rebuild_failed",
8481
8538
  errorType: "adapter",
8482
8539
  message: `context.rebuild_failed: ${toErrorMessage$40(error)}`,
8540
+ ...originalError ? { originalError } : {},
8483
8541
  ...providerAccessEvidence ? { providerAccessEvidence } : {},
8484
8542
  ...telemetry ? { telemetry } : {}
8485
8543
  });
@@ -8527,11 +8585,13 @@ async function invokeClaudeOnce(input) {
8527
8585
  if (error instanceof ClaudeRuntimeError) throw error;
8528
8586
  if (error && typeof error === "object" && "code" in error && typeof error.code === "string" && "errorType" in error && typeof error.errorType === "string" && error instanceof Error) {
8529
8587
  const providerAccessEvidence = getClaudeProviderAccessEvidence(error);
8588
+ const originalError = getClaudeOriginalError(error);
8530
8589
  const telemetry = getClaudeTelemetry(error);
8531
8590
  throw new ClaudeRuntimeError({
8532
8591
  code: error.code,
8533
8592
  errorType: error.errorType,
8534
8593
  message: error.message,
8594
+ ...originalError ? { originalError } : {},
8535
8595
  ...providerAccessEvidence ? { providerAccessEvidence } : {},
8536
8596
  ...telemetry ? { telemetry } : {}
8537
8597
  });
@@ -8587,6 +8647,11 @@ function getClaudeProviderAccessEvidence(error) {
8587
8647
  if (!evidence || typeof evidence !== "object") return null;
8588
8648
  return evidence;
8589
8649
  }
8650
+ function getClaudeOriginalError(error) {
8651
+ if (!(error && typeof error === "object")) return null;
8652
+ const originalError = error.originalError;
8653
+ return typeof originalError === "string" ? originalError : null;
8654
+ }
8590
8655
  function getClaudeTelemetry(error) {
8591
8656
  if (!(error && typeof error === "object" && "telemetry" in error)) return null;
8592
8657
  const telemetry = error.telemetry;
@@ -8764,7 +8829,7 @@ const normalizeOptionalText$62 = (value) => {
8764
8829
  //#region ../../runtime/adapters/codex/dist/output/codex-provider-failure.js
8765
8830
  /**
8766
8831
  * Codex provider-account failure classification shared by the CLI and
8767
- * app-server transports so both surface the same `quota.exceeded` /
8832
+ * app-server transports so both surface the same `usage_exhausted` /
8768
8833
  * `rate_limited` / `auth.required` codes for the same provider failure.
8769
8834
  *
8770
8835
  * Wording covers both the ChatGPT-subscription Codex ("You've hit your usage
@@ -8773,12 +8838,9 @@ const normalizeOptionalText$62 = (value) => {
8773
8838
  * - app-server turn.error: `{ message: "You've hit your usage limit. …", codexErrorInfo: "usageLimitExceeded" }`
8774
8839
  * - exec turn.failed: `{ error: { message: "You've hit your usage limit. …" } }`
8775
8840
  */
8776
- function isCodexQuotaFailure(value) {
8841
+ function isCodexUsageExhaustedFailure(value) {
8777
8842
  return value.includes("usage limit") || value.includes("purchase more credits") || value.includes("insufficient_quota") || value.includes("insufficient balance") || value.includes("insufficient_balance") || value.includes("quota exceeded") || value.includes("exceeded your current quota") || value.includes("not enough credits") || value.includes("out of credits") || value.includes("credits exhausted") || value.includes("balance is too low") || value.includes("payment required") || value.includes("billing");
8778
8843
  }
8779
- function isDefinitiveCodexCapacityFailure(value) {
8780
- return value.includes("purchase more credits") || value.includes("insufficient_quota") || value.includes("insufficient balance") || value.includes("insufficient_balance") || value.includes("quota exceeded") || value.includes("exceeded your current quota") || value.includes("not enough credits") || value.includes("out of credits") || value.includes("credits exhausted") || value.includes("balance is too low") || value.includes("payment required");
8781
- }
8782
8844
  function isCodexRateLimitFailure(value) {
8783
8845
  return value.includes("429") || value.includes("rate limit") || value.includes("too many requests");
8784
8846
  }
@@ -8797,36 +8859,35 @@ function isCodexSubscriptionAccessFailure(value) {
8797
8859
  */
8798
8860
  function classifyCodexProviderAccountFailure(input) {
8799
8861
  if (normalizeOptionalText$61(input.codexErrorInfo)?.toLowerCase() === "usagelimitexceeded") return buildHardProviderFailure({
8800
- code: "quota.exceeded",
8801
- reasonCode: "provider_account.capacity_exhausted"
8862
+ code: "usage_exhausted",
8863
+ originalError: createProviderOriginalError(input.message),
8864
+ reasonCode: "usage_exhausted"
8802
8865
  });
8803
8866
  const lowered = input.message.toLowerCase();
8804
- if (isDefinitiveCodexCapacityFailure(lowered)) return buildHardProviderFailure({
8805
- code: "quota.exceeded",
8806
- reasonCode: "provider_account.capacity_exhausted"
8807
- });
8808
- if (isCodexRateLimitFailure(lowered)) return {
8867
+ if (isCodexRateLimitFailure(lowered)) return withOriginalError({
8809
8868
  code: "rate_limited",
8810
8869
  errorType: "adapter"
8811
- };
8870
+ }, input.message);
8812
8871
  if (isCodexSubscriptionAccessFailure(lowered)) return buildHardProviderFailure({
8813
8872
  code: "provider.subscription_access_unavailable",
8873
+ originalError: createProviderOriginalError(input.message),
8814
8874
  reasonCode: "provider_account.subscription_access_unavailable"
8815
8875
  });
8816
- if (isCodexQuotaFailure(lowered)) return buildHardProviderFailure({
8817
- code: "quota.exceeded",
8818
- reasonCode: "provider_account.capacity_exhausted"
8819
- });
8820
- if (isCodexAuthFailure(lowered)) return {
8876
+ if (isCodexUsageExhaustedFailure(lowered)) return withOriginalError({
8877
+ code: "usage_exhausted",
8878
+ errorType: "adapter"
8879
+ }, input.message);
8880
+ if (isCodexAuthFailure(lowered)) return withOriginalError({
8821
8881
  code: "auth.required",
8822
8882
  errorType: "auth"
8823
- };
8883
+ }, input.message);
8824
8884
  return null;
8825
8885
  }
8826
8886
  function buildHardProviderFailure(input) {
8827
8887
  return {
8828
8888
  code: input.code,
8829
8889
  errorType: "adapter",
8890
+ ...input.originalError ? { originalError: input.originalError } : {},
8830
8891
  providerAccessEvidence: {
8831
8892
  observedAtMs: Date.now(),
8832
8893
  provider: "codex",
@@ -8835,6 +8896,13 @@ function buildHardProviderFailure(input) {
8835
8896
  }
8836
8897
  };
8837
8898
  }
8899
+ function withOriginalError(classification, message) {
8900
+ const originalError = createProviderOriginalError(message);
8901
+ return {
8902
+ ...classification,
8903
+ ...originalError ? { originalError } : {}
8904
+ };
8905
+ }
8838
8906
  function normalizeOptionalText$61(value) {
8839
8907
  const normalized = String(value ?? "").trim();
8840
8908
  return normalized.length > 0 ? normalized : null;
@@ -9194,17 +9262,40 @@ const CODEX_APP_SERVER_VERSION_PATTERN = /\/([^\s]+)/u;
9194
9262
  const APP_SERVER_PROCESS_KILL_GRACE_MS = 1e3;
9195
9263
  const DEFAULT_APP_SERVER_STARTUP_TIMEOUT_MS = 15e3;
9196
9264
  var CodexAppServerTransportError = class extends Error {
9265
+ agentControllerConversationOccupancy;
9197
9266
  code;
9198
9267
  errorType;
9268
+ originalError;
9199
9269
  providerAccessEvidence;
9270
+ rpcErrorCode;
9200
9271
  constructor(input) {
9201
9272
  super(input.message);
9202
9273
  this.name = "CodexAppServerTransportError";
9274
+ this.agentControllerConversationOccupancy = input.agentControllerConversationOccupancy;
9203
9275
  this.code = input.code;
9204
9276
  this.errorType = input.errorType;
9277
+ this.originalError = input.originalError;
9205
9278
  this.providerAccessEvidence = input.providerAccessEvidence;
9279
+ this.rpcErrorCode = input.rpcErrorCode;
9206
9280
  }
9207
9281
  };
9282
+ function throwIfCodexDispatchCancelled(signal) {
9283
+ if (!signal?.aborted) return;
9284
+ throw new CodexAppServerTransportError({
9285
+ code: "runtime.turn.cancelled",
9286
+ errorType: "adapter",
9287
+ message: "runtime.turn.cancelled: Codex was stopped before starting a turn"
9288
+ });
9289
+ }
9290
+ function classifyCodexThreadWriterConflict(input) {
9291
+ const agentControllerConversationId = input.agentControllerConversationId.trim();
9292
+ if (!agentControllerConversationId || input.operation !== "thread/resume" || input.rpcErrorCode !== -32600 || input.rpcErrorMessage !== `thread ${agentControllerConversationId} already has an active writer`) return null;
9293
+ return {
9294
+ agentControllerConversationId,
9295
+ contractVersion: 1,
9296
+ state: "occupied"
9297
+ };
9298
+ }
9208
9299
  async function probeCodexAppServerAccount(input) {
9209
9300
  const timeoutMs = input.timeoutMs ?? DEFAULT_APP_SERVER_STARTUP_TIMEOUT_MS;
9210
9301
  return await withCodexAppServerSession({
@@ -9224,6 +9315,7 @@ async function probeCodexAppServerAccount(input) {
9224
9315
  });
9225
9316
  }
9226
9317
  async function invokeCodexAppServerTransport(input) {
9318
+ throwIfCodexDispatchCancelled(input.cancellationSignal);
9227
9319
  const prompt = normalizeOptionalText$59(input.prompt);
9228
9320
  if (!prompt) throw new CodexAppServerTransportError({
9229
9321
  code: "schema.invalid",
@@ -9247,7 +9339,9 @@ async function invokeCodexAppServerTransport(input) {
9247
9339
  onRuntimeEvent: input.onRuntimeEvent,
9248
9340
  startupTimeoutMs: input.startupTimeoutMs
9249
9341
  }, async (session) => {
9342
+ throwIfCodexDispatchCancelled(input.cancellationSignal);
9250
9343
  const threadContext = await resolveDispatchThreadContext({
9344
+ cancellationSignal: input.cancellationSignal,
9251
9345
  conversationPolicyParams,
9252
9346
  codexWorkdir: input.codexWorkdir,
9253
9347
  executionMode: input.executionMode,
@@ -9270,6 +9364,7 @@ async function invokeCodexAppServerTransport(input) {
9270
9364
  threadSource: threadContext.threadSource
9271
9365
  });
9272
9366
  session.emitProviderConversationObserved(continuityThreadId);
9367
+ throwIfCodexDispatchCancelled(input.cancellationSignal);
9273
9368
  const turn = readTurnStartResponse(await session.requestControl("turn/start", {
9274
9369
  ...permissionModeParams.turn,
9275
9370
  ...collaborationMode ? { collaborationMode } : {},
@@ -9292,6 +9387,10 @@ async function invokeCodexAppServerTransport(input) {
9292
9387
  threadId: executionThreadId,
9293
9388
  turnId
9294
9389
  });
9390
+ if (input.cancellationSignal?.aborted && turn.status !== "completed") await session.request("turn/interrupt", {
9391
+ threadId: executionThreadId,
9392
+ turnId
9393
+ });
9295
9394
  let completedTurn;
9296
9395
  try {
9297
9396
  completedTurn = turn.status === "completed" ? turn : await session.waitForTurnCompleted({
@@ -9347,6 +9446,7 @@ function requireSuccessfulCodexTurn(turn) {
9347
9446
  code: providerFailure.code,
9348
9447
  errorType: providerFailure.errorType,
9349
9448
  message: failureMessage,
9449
+ originalError: providerFailure.originalError,
9350
9450
  providerAccessEvidence: providerFailure.providerAccessEvidence
9351
9451
  });
9352
9452
  throw new CodexAppServerTransportError({
@@ -9426,16 +9526,37 @@ async function resolveDispatchThreadContext(input) {
9426
9526
  session: input.session,
9427
9527
  sourceThreadId: existingThreadId
9428
9528
  });
9429
- return readThreadContextFromResponse(await input.session.requestControl("thread/resume", {
9430
- ...input.conversationPolicyParams.model ? { model: input.conversationPolicyParams.model } : {},
9431
- ...input.permissionModeParams,
9432
- cwd: input.codexWorkdir,
9433
- excludeTurns: true,
9434
- threadId: existingThreadId
9435
- }, {
9436
- code: "context.resume_timeout",
9437
- operation: "thread/resume"
9438
- }));
9529
+ let response;
9530
+ try {
9531
+ throwIfCodexDispatchCancelled(input.cancellationSignal);
9532
+ response = await input.session.requestControl("thread/resume", {
9533
+ ...input.conversationPolicyParams.model ? { model: input.conversationPolicyParams.model } : {},
9534
+ ...input.permissionModeParams,
9535
+ cwd: input.codexWorkdir,
9536
+ excludeTurns: true,
9537
+ threadId: existingThreadId
9538
+ }, {
9539
+ code: "context.resume_timeout",
9540
+ operation: "thread/resume"
9541
+ });
9542
+ } catch (error) {
9543
+ const transportError = error instanceof CodexAppServerTransportError ? error : null;
9544
+ const occupancy = transportError ? classifyCodexThreadWriterConflict({
9545
+ agentControllerConversationId: existingThreadId,
9546
+ operation: "thread/resume",
9547
+ rpcErrorCode: transportError.rpcErrorCode,
9548
+ rpcErrorMessage: transportError.message
9549
+ }) : null;
9550
+ if (!occupancy) throw error;
9551
+ throw new CodexAppServerTransportError({
9552
+ agentControllerConversationOccupancy: occupancy,
9553
+ code: "agent_controller.conversation_occupied",
9554
+ errorType: "adapter",
9555
+ message: transportError?.message ?? "Codex thread writer is occupied",
9556
+ rpcErrorCode: transportError?.rpcErrorCode
9557
+ });
9558
+ }
9559
+ return readThreadContextFromResponse(response);
9439
9560
  }
9440
9561
  return readThreadContextFromResponse(await input.session.requestControl("thread/start", {
9441
9562
  ...input.conversationPolicyParams.model ? { model: input.conversationPolicyParams.model } : {},
@@ -10669,6 +10790,7 @@ function toJsonRpcTransportError$1(error) {
10669
10790
  code: providerFailure.code,
10670
10791
  errorType: providerFailure.errorType,
10671
10792
  message,
10793
+ originalError: providerFailure.originalError,
10672
10794
  providerAccessEvidence: providerFailure.providerAccessEvidence
10673
10795
  });
10674
10796
  const lowered = message.toLowerCase();
@@ -10685,7 +10807,8 @@ function toJsonRpcTransportError$1(error) {
10685
10807
  return new CodexAppServerTransportError({
10686
10808
  code: "upstream_unreachable",
10687
10809
  errorType: "adapter",
10688
- message
10810
+ message,
10811
+ ...typeof error.code === "number" ? { rpcErrorCode: error.code } : {}
10689
10812
  });
10690
10813
  }
10691
10814
  function toCodexAppServerTransportError(error, timeoutMs) {
@@ -10993,12 +11116,14 @@ function normalizeOptionalText$57(value) {
10993
11116
  var CodexCliTransportError = class extends Error {
10994
11117
  code;
10995
11118
  errorType;
11119
+ originalError;
10996
11120
  providerAccessEvidence;
10997
11121
  constructor(input) {
10998
11122
  super(input.message);
10999
11123
  this.name = "CodexCliTransportError";
11000
11124
  this.code = input.code;
11001
11125
  this.errorType = input.errorType;
11126
+ this.originalError = input.originalError;
11002
11127
  this.providerAccessEvidence = input.providerAccessEvidence;
11003
11128
  }
11004
11129
  };
@@ -11092,6 +11217,7 @@ async function invokeCodexCliTransport(input) {
11092
11217
  code: classifiedFailure.code,
11093
11218
  errorType: classifiedFailure.errorType,
11094
11219
  message: classifiedFailure.message,
11220
+ originalError: classifiedFailure.originalError,
11095
11221
  providerAccessEvidence: classifiedFailure.providerAccessEvidence
11096
11222
  });
11097
11223
  }
@@ -11107,6 +11233,7 @@ async function invokeCodexCliTransport(input) {
11107
11233
  code: classifiedFailure.code,
11108
11234
  errorType: classifiedFailure.errorType,
11109
11235
  message: classifiedFailure.message,
11236
+ originalError: classifiedFailure.originalError,
11110
11237
  providerAccessEvidence: classifiedFailure.providerAccessEvidence
11111
11238
  });
11112
11239
  }
@@ -11314,6 +11441,7 @@ const toCodexCliTransportError = (error, timeoutMs) => {
11314
11441
  code: classifiedFailure.code,
11315
11442
  errorType: classifiedFailure.errorType,
11316
11443
  message: classifiedFailure.message,
11444
+ originalError: classifiedFailure.originalError,
11317
11445
  providerAccessEvidence: classifiedFailure.providerAccessEvidence
11318
11446
  });
11319
11447
  }
@@ -11417,14 +11545,18 @@ function normalizeOptionalText$56(value) {
11417
11545
  //#endregion
11418
11546
  //#region ../../runtime/adapters/codex/dist/invoke/codex-invoke.js
11419
11547
  var CodexRuntimeError = class extends Error {
11548
+ agentControllerConversationOccupancy;
11420
11549
  code;
11421
11550
  errorType;
11551
+ originalError;
11422
11552
  providerAccessEvidence;
11423
11553
  constructor(input) {
11424
11554
  super(input.message);
11425
11555
  this.name = "CodexRuntimeError";
11556
+ this.agentControllerConversationOccupancy = input.agentControllerConversationOccupancy;
11426
11557
  this.code = input.code;
11427
11558
  this.errorType = input.errorType;
11559
+ this.originalError = input.originalError;
11428
11560
  this.providerAccessEvidence = input.providerAccessEvidence;
11429
11561
  }
11430
11562
  };
@@ -11531,9 +11663,11 @@ function isCodexAppServerContextLostError(error) {
11531
11663
  function toCodexRuntimeError(error) {
11532
11664
  if (error instanceof CodexRuntimeError) return error;
11533
11665
  if (error && typeof error === "object" && "code" in error && typeof error.code === "string" && "errorType" in error && typeof error.errorType === "string" && error instanceof Error) return new CodexRuntimeError({
11666
+ agentControllerConversationOccupancy: error.agentControllerConversationOccupancy,
11534
11667
  code: error.code,
11535
11668
  errorType: error.errorType,
11536
11669
  message: error.message,
11670
+ originalError: error.originalError,
11537
11671
  providerAccessEvidence: error.providerAccessEvidence
11538
11672
  });
11539
11673
  return new CodexRuntimeError({
@@ -11579,6 +11713,89 @@ function toErrorMessage$37(error) {
11579
11713
  return String(error);
11580
11714
  }
11581
11715
  //#endregion
11716
+ //#region ../../runtime/adapters/codex/dist/transport/codex-thread-writer-availability.js
11717
+ const CODEX_THREAD_WRITER_RECOVERY_RETRY_MS = 3e4;
11718
+ const CODEX_THREAD_WRITER_MISSING_LOCK_RETRY_MS = 500;
11719
+ const MIN_MISSING_LOCK_RETRY_MS = 100;
11720
+ const MAX_MISSING_LOCK_RETRY_MS = 2e3;
11721
+ async function waitForCodexThreadWriterAvailability(input) {
11722
+ if (input.signal?.aborted) return "aborted";
11723
+ const lockDirectory = join(input.env?.CODEX_HOME?.trim() || process.env.CODEX_HOME?.trim() || join(homedir(), ".codex"), "thread-writer-locks");
11724
+ const lockFileName = `${input.occupancy.agentControllerConversationId}.lock`;
11725
+ const lockPath = join(lockDirectory, lockFileName);
11726
+ const lockExists = await pathExists$6(lockPath);
11727
+ if (input.signal?.aborted) return "aborted";
11728
+ if (!lockExists) return await waitForRetryOrAbort({
11729
+ delayMs: normalizeMissingLockRetryMs(input.missingLockRetryMs),
11730
+ signal: input.signal
11731
+ });
11732
+ return await new Promise((resolve) => {
11733
+ let settled = false;
11734
+ let recoveryTimer = null;
11735
+ let watcher = null;
11736
+ const finish = (result) => {
11737
+ if (settled) return;
11738
+ settled = true;
11739
+ if (recoveryTimer) {
11740
+ clearTimeout(recoveryTimer);
11741
+ recoveryTimer = null;
11742
+ }
11743
+ watcher?.close();
11744
+ input.signal?.removeEventListener("abort", handleAbort);
11745
+ resolve(result);
11746
+ };
11747
+ const handleAbort = () => finish("aborted");
11748
+ const observeAvailability = () => {
11749
+ pathExists$6(lockPath).then((exists) => {
11750
+ if (!exists) finish("release_observed");
11751
+ }).catch(() => {});
11752
+ };
11753
+ input.signal?.addEventListener("abort", handleAbort, { once: true });
11754
+ recoveryTimer = setTimeout(() => finish("retry_due"), input.recoveryRetryMs ?? CODEX_THREAD_WRITER_RECOVERY_RETRY_MS);
11755
+ recoveryTimer.unref?.();
11756
+ try {
11757
+ watcher = watch(lockDirectory, (_eventType, fileName) => {
11758
+ if (fileName === null || String(fileName) === lockFileName) observeAvailability();
11759
+ });
11760
+ watcher.on("error", () => {});
11761
+ } catch {}
11762
+ observeAvailability();
11763
+ });
11764
+ }
11765
+ async function waitForRetryOrAbort(input) {
11766
+ if (input.signal?.aborted) return "aborted";
11767
+ return await new Promise((resolve) => {
11768
+ let settled = false;
11769
+ let timer = null;
11770
+ const finish = (result) => {
11771
+ if (settled) return;
11772
+ settled = true;
11773
+ if (timer) {
11774
+ clearTimeout(timer);
11775
+ timer = null;
11776
+ }
11777
+ input.signal?.removeEventListener("abort", handleAbort);
11778
+ resolve(result);
11779
+ };
11780
+ const handleAbort = () => finish("aborted");
11781
+ input.signal?.addEventListener("abort", handleAbort, { once: true });
11782
+ timer = setTimeout(() => finish("retry_due"), input.delayMs);
11783
+ timer.unref?.();
11784
+ });
11785
+ }
11786
+ function normalizeMissingLockRetryMs(value) {
11787
+ if (!(typeof value === "number" && Number.isFinite(value))) return CODEX_THREAD_WRITER_MISSING_LOCK_RETRY_MS;
11788
+ return Math.min(MAX_MISSING_LOCK_RETRY_MS, Math.max(MIN_MISSING_LOCK_RETRY_MS, Math.trunc(value)));
11789
+ }
11790
+ async function pathExists$6(path) {
11791
+ try {
11792
+ await access(path);
11793
+ return true;
11794
+ } catch {
11795
+ return false;
11796
+ }
11797
+ }
11798
+ //#endregion
11582
11799
  //#region ../../runtime/adapters/codex/dist/usage/codex-usage-limits.js
11583
11800
  const DEFAULT_LIMIT_ID = "codex";
11584
11801
  const MAX_LIMIT_ID_LENGTH = 160;
@@ -11676,6 +11893,7 @@ const MAX_COMPUTER_FILE_ACCESS_ATTESTATIONS = 32;
11676
11893
  const createCodexAdapter = (options) => {
11677
11894
  const activeAppServerTurns = /* @__PURE__ */ new Map();
11678
11895
  const computerFileAccessAttestations = /* @__PURE__ */ new Map();
11896
+ const occupiedDispatches = /* @__PURE__ */ new Map();
11679
11897
  const registerAppServerTurn = (registration) => {
11680
11898
  const activeTurn = {
11681
11899
  interrupt: registration.interrupt,
@@ -11705,6 +11923,43 @@ const createCodexAdapter = (options) => {
11705
11923
  sendInterrupt,
11706
11924
  waitForMs: options.waitForMs
11707
11925
  });
11926
+ const fallbackCancel = controlShell.cancel;
11927
+ const cancel = async (request) => {
11928
+ if (abortOccupiedCodexDispatch({
11929
+ occupiedDispatches,
11930
+ request
11931
+ }) && !activeAppServerTurns.has(request.taskId)) return {
11932
+ accepted: true,
11933
+ deliveryPath: "cancel",
11934
+ reasonCode: "accepted",
11935
+ signalDelivery: "sent",
11936
+ taskId: request.taskId
11937
+ };
11938
+ if (!fallbackCancel) return {
11939
+ accepted: false,
11940
+ reasonCode: "adapter.unsupported",
11941
+ signalDelivery: "not_sent",
11942
+ taskId: request.taskId
11943
+ };
11944
+ return await fallbackCancel(request);
11945
+ };
11946
+ const interrupt = async (request) => {
11947
+ if (abortOccupiedCodexDispatch({
11948
+ occupiedDispatches,
11949
+ request
11950
+ }) && !activeAppServerTurns.has(request.taskId)) return {
11951
+ accepted: true,
11952
+ plan: buildInterruptPlan(request),
11953
+ reasonCode: "accepted",
11954
+ signalDelivery: "sent",
11955
+ taskId: request.taskId
11956
+ };
11957
+ return await interruptCodexActiveAppServerTurn({
11958
+ activeAppServerTurns,
11959
+ request,
11960
+ fallbackInterrupt: controlShell.interrupt
11961
+ });
11962
+ };
11708
11963
  const sharedDispatch = createSharedDispatchShell({
11709
11964
  adapterId: "codex",
11710
11965
  bridgeSpec: CODEX_CONVERSATION_BRIDGE_SPEC,
@@ -11717,20 +11972,17 @@ const createCodexAdapter = (options) => {
11717
11972
  resolveDefaultInvoke: () => resolveDefaultCodexInvoke(options),
11718
11973
  runtimeOptions: options
11719
11974
  });
11720
- const dispatch = async (request) => {
11721
- const result = await sharedDispatch(request);
11722
- if (result.status === "failed" && request.computerFileAccessBoundary !== void 0) return redactCodexFileAccessBoundaryDispatchFailure(result);
11723
- return result;
11724
- };
11975
+ const dispatch = (request) => dispatchCodexWithConversationOccupancy({
11976
+ occupiedDispatches,
11977
+ request,
11978
+ sharedDispatch,
11979
+ waitForThreadWriterAvailability: options.waitForThreadWriterAvailability ?? waitForCodexThreadWriterAvailability
11980
+ });
11725
11981
  return {
11726
11982
  adapterId: "codex",
11727
- cancel: controlShell.cancel,
11983
+ cancel,
11728
11984
  dispatch,
11729
- interrupt: (request) => interruptCodexActiveAppServerTurn({
11730
- activeAppServerTurns,
11731
- request,
11732
- fallbackInterrupt: controlShell.interrupt
11733
- }),
11985
+ interrupt,
11734
11986
  verifyComputerFileAccessBoundary: async (request) => {
11735
11987
  if (request.agentControllerPermissionMode === "codex:customConfig" || request.transportMode !== "codex-app-server" && request.transportMode !== "local-cli") return {
11736
11988
  reasonCode: "computer.file_access.controller_unsupported",
@@ -11795,6 +12047,32 @@ const createCodexAdapter = (options) => {
11795
12047
  }
11796
12048
  };
11797
12049
  };
12050
+ function readCodexConversationOccupancy(result, request) {
12051
+ if (result.status !== "failed" || request.transportMode !== "codex-app-server" || !result.agentControllerConversationOccupancy) return null;
12052
+ return result.agentControllerConversationOccupancy;
12053
+ }
12054
+ function abortOccupiedCodexDispatch(input) {
12055
+ const occupiedDispatch = input.occupiedDispatches.get(input.request.taskId);
12056
+ if (!occupiedDispatch) return false;
12057
+ occupiedDispatch.abortController.abort();
12058
+ return true;
12059
+ }
12060
+ function buildCodexWriterWaitCancelledResult() {
12061
+ return {
12062
+ errorCode: "runtime.turn.cancelled",
12063
+ errorMessage: "runtime.turn.cancelled: Codex was stopped while waiting for the Agent Controller conversation",
12064
+ errorType: "adapter",
12065
+ status: "failed"
12066
+ };
12067
+ }
12068
+ async function emitCodexConversationAvailable(input) {
12069
+ await input.request.onRuntimeEvent?.({
12070
+ agentControllerConversationId: input.occupancy.agentControllerConversationId,
12071
+ contractVersion: input.occupancy.contractVersion,
12072
+ phase: "agent_controller_conversation_available",
12073
+ tsMs: Date.now()
12074
+ });
12075
+ }
11798
12076
  function rememberComputerFileAccessAttestation(input) {
11799
12077
  while (input.attestations.size >= MAX_COMPUTER_FILE_ACCESS_ATTESTATIONS) {
11800
12078
  const oldestKey = input.attestations.keys().next().value;
@@ -11803,6 +12081,93 @@ function rememberComputerFileAccessAttestation(input) {
11803
12081
  }
11804
12082
  input.attestations.set(input.cacheKey, input.value);
11805
12083
  }
12084
+ async function dispatchCodexWithConversationOccupancy(input) {
12085
+ const state = {
12086
+ occupancy: null,
12087
+ registration: null
12088
+ };
12089
+ try {
12090
+ while (true) {
12091
+ const cancellationSignal = state.registration?.abortController.signal ?? void 0;
12092
+ if (cancellationSignal?.aborted) return buildCodexWriterWaitCancelledResult();
12093
+ const result = await input.sharedDispatch({
12094
+ ...input.request,
12095
+ ...cancellationSignal ? { cancellationSignal } : {}
12096
+ });
12097
+ if (state.registration?.abortController.signal.aborted) return buildCodexWriterWaitCancelledResult();
12098
+ const occupancy = readCodexConversationOccupancy(result, input.request);
12099
+ if (occupancy) {
12100
+ if (await waitForOccupiedCodexConversation({
12101
+ ...input,
12102
+ occupancy,
12103
+ state
12104
+ }) === "cancelled") return buildCodexWriterWaitCancelledResult();
12105
+ continue;
12106
+ }
12107
+ if (state.occupancy) {
12108
+ await emitCodexConversationAvailable({
12109
+ occupancy: state.occupancy,
12110
+ request: input.request
12111
+ });
12112
+ state.occupancy = null;
12113
+ }
12114
+ return finalizeCodexDispatchResult({
12115
+ request: input.request,
12116
+ result
12117
+ });
12118
+ }
12119
+ } finally {
12120
+ removeOccupiedCodexDispatchRegistration({
12121
+ occupiedDispatches: input.occupiedDispatches,
12122
+ state,
12123
+ taskId: input.request.taskId
12124
+ });
12125
+ }
12126
+ }
12127
+ async function waitForOccupiedCodexConversation(input) {
12128
+ const registration = ensureOccupiedCodexDispatchRegistration(input);
12129
+ if (!input.state.occupancy) {
12130
+ await input.request.onRuntimeEvent?.({
12131
+ agentControllerConversationId: input.occupancy.agentControllerConversationId,
12132
+ contractVersion: input.occupancy.contractVersion,
12133
+ phase: "agent_controller_conversation_occupied",
12134
+ tsMs: Date.now()
12135
+ });
12136
+ input.state.occupancy = input.occupancy;
12137
+ }
12138
+ const waitResult = await input.waitForThreadWriterAvailability({
12139
+ env: input.request.env,
12140
+ occupancy: input.occupancy,
12141
+ signal: registration.abortController.signal
12142
+ });
12143
+ if (waitResult === "aborted" || registration.abortController.signal.aborted) return "cancelled";
12144
+ if (waitResult === "release_observed") {
12145
+ await emitCodexConversationAvailable({
12146
+ occupancy: input.occupancy,
12147
+ request: input.request
12148
+ });
12149
+ input.state.occupancy = null;
12150
+ }
12151
+ return registration.abortController.signal.aborted ? "cancelled" : "retry";
12152
+ }
12153
+ function ensureOccupiedCodexDispatchRegistration(input) {
12154
+ if (input.state.registration) return input.state.registration;
12155
+ const registration = {
12156
+ abortController: new AbortController(),
12157
+ taskId: input.request.taskId
12158
+ };
12159
+ input.state.registration = registration;
12160
+ input.occupiedDispatches.set(input.request.taskId, registration);
12161
+ return registration;
12162
+ }
12163
+ function finalizeCodexDispatchResult(input) {
12164
+ if (input.result.status === "failed" && input.request.computerFileAccessBoundary !== void 0) return redactCodexFileAccessBoundaryDispatchFailure(input.result);
12165
+ return input.result;
12166
+ }
12167
+ function removeOccupiedCodexDispatchRegistration(input) {
12168
+ const registration = input.state.registration;
12169
+ if (registration && input.occupiedDispatches.get(input.taskId) === registration) input.occupiedDispatches.delete(input.taskId);
12170
+ }
11806
12171
  const resolveDefaultCodexInvoke = (options) => {
11807
12172
  const codexTimeoutMs = options.codexTimeoutMs ?? resolveCodexTimeoutMs();
11808
12173
  return async (input) => {
@@ -11872,6 +12237,7 @@ const resolveDefaultCodexAppServerInvoke = (input) => {
11872
12237
  } : void 0;
11873
12238
  const result = await invokeCodexAppServer({
11874
12239
  agentControllerPermissionMode: dispatchInput.agentControllerPermissionMode,
12240
+ cancellationSignal: dispatchInput.cancellationSignal,
11875
12241
  computerFileAccessBoundary: dispatchInput.computerFileAccessBoundary,
11876
12242
  launchContract,
11877
12243
  codexTimeoutMs,
@@ -12254,12 +12620,14 @@ var GrokBuildAcpTransportError = class extends Error {
12254
12620
  code;
12255
12621
  diagnostics;
12256
12622
  errorType;
12623
+ originalError;
12257
12624
  constructor(input) {
12258
12625
  super(input.message, input.cause === void 0 ? void 0 : { cause: input.cause });
12259
12626
  this.name = "GrokBuildAcpTransportError";
12260
12627
  this.code = input.code;
12261
12628
  this.diagnostics = input.diagnostics;
12262
12629
  this.errorType = input.errorType;
12630
+ this.originalError = input.originalError;
12263
12631
  }
12264
12632
  };
12265
12633
  async function probeGrokBuildAcpInterface(input) {
@@ -12367,7 +12735,8 @@ function upgradePromptProtocolFailureWithExhaustedUsage(classified, usageLimits)
12367
12735
  cause: classified,
12368
12736
  code: PROVIDER_USAGE_EXHAUSTED_ERROR_CODE,
12369
12737
  errorType: "auth",
12370
- message: "grok-build.quota_or_entitlement: the provider account has used all of its included credits for this period"
12738
+ message: "grok-build.quota_or_entitlement: the provider account has used all of its included credits for this period",
12739
+ ...classified.originalError ? { originalError: classified.originalError } : {}
12371
12740
  });
12372
12741
  }
12373
12742
  async function toPromptWakeFailureError(error, session) {
@@ -12403,6 +12772,7 @@ var GrokBuildAcpSession = class {
12403
12772
  GROK_DISABLE_AUTOUPDATER: "1"
12404
12773
  },
12405
12774
  launchContract: input.launchContract,
12775
+ mapJsonRpcError: toGrokBuildJsonRpcTransportError,
12406
12776
  onClientRequest: (request) => this.#handleClientRequest(request),
12407
12777
  onLifecycleEvent: (event) => this.#emitRuntimeEvent(event),
12408
12778
  onNotification: (notification) => this.#handleNotification(notification),
@@ -12491,7 +12861,8 @@ var GrokBuildAcpSession = class {
12491
12861
  cause: error,
12492
12862
  code: "context_not_found",
12493
12863
  errorType: "adapter",
12494
- message: "context_not_found: Grok Build could not resume the persisted conversation"
12864
+ message: "context_not_found: Grok Build could not resume the persisted conversation",
12865
+ ...error instanceof GrokBuildAcpTransportError && error.originalError ? { originalError: error.originalError } : {}
12495
12866
  });
12496
12867
  throw error;
12497
12868
  }
@@ -12542,7 +12913,8 @@ var GrokBuildAcpSession = class {
12542
12913
  code: "model.unavailable",
12543
12914
  diagnostics: { modelNegotiation: input.descriptor.diagnostics },
12544
12915
  errorType: "config",
12545
- message: `model.unavailable: Grok Build rejected model '${modelId}' or its reasoning effort for this session`
12916
+ message: `model.unavailable: Grok Build rejected model '${modelId}' or its reasoning effort for this session`,
12917
+ ...error.originalError ? { originalError: error.originalError } : {}
12546
12918
  });
12547
12919
  throw error;
12548
12920
  }
@@ -12835,20 +13207,25 @@ async function emitFinalPreviewIfRequested$1(input) {
12835
13207
  }
12836
13208
  function toGrokBuildTransportError(error, stderr, diagnostics) {
12837
13209
  const combined = [toErrorMessage$35(error), normalizeOptionalText$53(stderr)].filter((value) => value !== null).join("\n");
12838
- const providerFailure = !(error instanceof GrokBuildAcpTransportError) || error.code.startsWith("protocol.") ? classifyGrokBuildProviderFailure(combined) : null;
13210
+ const providerFailure = !(error instanceof GrokBuildAcpTransportError) || error.code.startsWith("protocol.") ? classifyGrokBuildProviderFailure({
13211
+ message: combined,
13212
+ originalError: error instanceof GrokBuildAcpTransportError ? error.originalError : void 0
13213
+ }) : null;
12839
13214
  if (providerFailure) return diagnostics ? new GrokBuildAcpTransportError({
12840
13215
  cause: error,
12841
13216
  code: providerFailure.code,
12842
13217
  diagnostics,
12843
13218
  errorType: providerFailure.errorType,
12844
- message: providerFailure.message
13219
+ message: providerFailure.message,
13220
+ ...providerFailure.originalError ? { originalError: providerFailure.originalError } : {}
12845
13221
  }) : providerFailure;
12846
13222
  if (error instanceof GrokBuildAcpTransportError) return error.diagnostics || !diagnostics ? error : new GrokBuildAcpTransportError({
12847
13223
  cause: error,
12848
13224
  code: error.code,
12849
13225
  diagnostics,
12850
13226
  errorType: error.errorType,
12851
- message: error.message
13227
+ message: error.message,
13228
+ ...error.originalError ? { originalError: error.originalError } : {}
12852
13229
  });
12853
13230
  const classified = new GrokBuildAcpTransportError({
12854
13231
  code: "upstream_unreachable",
@@ -12863,12 +13240,30 @@ function toGrokBuildTransportError(error, stderr, diagnostics) {
12863
13240
  message: classified.message
12864
13241
  }) : classified;
12865
13242
  }
12866
- function classifyGrokBuildProviderFailure(message) {
12867
- const normalized = normalizeOptionalText$53(message) ?? "Grok Build ACP error";
13243
+ function toGrokBuildJsonRpcTransportError(error) {
13244
+ let code = "protocol.request_failed";
13245
+ let errorType = "adapter";
13246
+ if (error.code === -32601) code = "protocol.method_not_found";
13247
+ else if (error.code === -32602) {
13248
+ code = "protocol.invalid_params";
13249
+ errorType = "config";
13250
+ }
13251
+ const message = normalizeOptionalText$53(error.message) ?? "ACP request failed";
13252
+ const originalError = createProviderOriginalError(message);
13253
+ return new GrokBuildAcpTransportError({
13254
+ code,
13255
+ errorType,
13256
+ message: `${code}: ${message}`,
13257
+ ...originalError ? { originalError } : {}
13258
+ });
13259
+ }
13260
+ function classifyGrokBuildProviderFailure(input) {
13261
+ const normalized = normalizeOptionalText$53(input.message) ?? "Grok Build ACP error";
12868
13262
  if (AUTH_FAILURE_RE.test(normalized)) return new GrokBuildAcpTransportError({
12869
13263
  code: "auth.failed",
12870
13264
  errorType: "auth",
12871
- message: `auth.failed: ${normalized}`
13265
+ message: `auth.failed: ${normalized}`,
13266
+ ...input.originalError ? { originalError: input.originalError } : {}
12872
13267
  });
12873
13268
  return null;
12874
13269
  }
@@ -12970,6 +13365,7 @@ function createDefaultGrokBuildInvoke(input) {
12970
13365
  cause: error,
12971
13366
  code: "context.rebuild_failed",
12972
13367
  ...error instanceof GrokBuildAcpTransportError && error.diagnostics ? { diagnostics: error.diagnostics } : {},
13368
+ ...error instanceof GrokBuildAcpTransportError && error.originalError ? { originalError: error.originalError } : {},
12973
13369
  errorType: "adapter",
12974
13370
  message: `context.rebuild_failed: ${toErrorMessage$34(error)}`
12975
13371
  }),
@@ -13328,65 +13724,70 @@ function normalizeScalarText(value) {
13328
13724
  function classifyOpenCodeFailureMessage(input) {
13329
13725
  const normalized = input.message.trim();
13330
13726
  const lowered = normalized.toLowerCase();
13727
+ const originalError = input.includeOriginalError ? createProviderOriginalError(normalized) : null;
13728
+ const withOriginalError = (value) => ({
13729
+ ...value,
13730
+ ...originalError ? { originalError } : {}
13731
+ });
13331
13732
  const permissionDenial = classifyRuntimePermissionDenialMessage({
13332
13733
  message: normalized,
13333
13734
  source: "opencode"
13334
13735
  });
13335
- if (permissionDenial) return permissionDenial;
13336
- if (input.isContextLost(normalized)) return {
13736
+ if (permissionDenial) return withOriginalError(permissionDenial);
13737
+ if (input.isContextLost(normalized)) return withOriginalError({
13337
13738
  code: "context.lost",
13338
13739
  errorType: "adapter",
13339
13740
  message: `context.lost: ${normalized}`
13340
- };
13341
- if (lowered.includes("not logged in") || lowered.includes("unauthorized") || lowered.includes("authentication") || lowered.includes("credentials")) return {
13741
+ });
13742
+ if (lowered.includes("not logged in") || lowered.includes("unauthorized") || lowered.includes("authentication") || lowered.includes("credentials")) return withOriginalError({
13342
13743
  code: "auth.required",
13343
13744
  errorType: "auth",
13344
13745
  message: `auth.required: ${normalized}`
13345
- };
13346
- if (lowered.includes("unsupported model") || lowered.includes("model is not supported") || lowered.includes("invalid model") || lowered.includes("model not found")) return {
13746
+ });
13747
+ if (lowered.includes("unsupported model") || lowered.includes("model is not supported") || lowered.includes("invalid model") || lowered.includes("model not found")) return withOriginalError({
13347
13748
  code: "model.unsupported",
13348
13749
  errorType: "config",
13349
13750
  message: `model.unsupported: ${normalized}`
13350
- };
13351
- if (isInsufficientBalanceFailure(lowered)) return {
13751
+ });
13752
+ if (isInsufficientBalanceFailure(lowered)) return withOriginalError({
13352
13753
  code: "provider.insufficient_balance",
13353
13754
  errorType: "adapter",
13354
13755
  message: `provider.insufficient_balance: ${normalized}`,
13355
13756
  providerAccessEvidence: buildProviderAccessEvidence("provider_account.capacity_exhausted")
13356
- };
13357
- if (isDefinitiveHardQuotaFailure(lowered)) return {
13757
+ });
13758
+ if (isDefinitiveHardQuotaFailure(lowered)) return withOriginalError({
13358
13759
  code: "quota.exceeded",
13359
13760
  errorType: "adapter",
13360
13761
  message: `quota.exceeded: ${normalized}`,
13361
13762
  providerAccessEvidence: buildProviderAccessEvidence("provider_account.capacity_exhausted")
13362
- };
13363
- if (isTransientRateLimitFailure(lowered)) return {
13763
+ });
13764
+ if (isTransientRateLimitFailure(lowered)) return withOriginalError({
13364
13765
  code: "provider.rate_limited",
13365
13766
  errorType: "network",
13366
13767
  message: `provider.rate_limited: ${normalized}`
13367
- };
13368
- if (isSubscriptionAccessFailure(lowered)) return {
13768
+ });
13769
+ if (isSubscriptionAccessFailure(lowered)) return withOriginalError({
13369
13770
  code: "provider.subscription_access_unavailable",
13370
13771
  errorType: "adapter",
13371
13772
  message: `provider.subscription_access_unavailable: ${normalized}`,
13372
13773
  providerAccessEvidence: buildProviderAccessEvidence("provider_account.subscription_access_unavailable")
13373
- };
13374
- if (isProviderUnavailableFailure(lowered)) return {
13774
+ });
13775
+ if (isProviderUnavailableFailure(lowered)) return withOriginalError({
13375
13776
  code: "provider.unavailable",
13376
13777
  errorType: "network",
13377
13778
  message: `provider.unavailable: ${normalized}`
13378
- };
13379
- if (isHardQuotaFailure(lowered)) return {
13779
+ });
13780
+ if (isHardQuotaFailure(lowered)) return withOriginalError({
13380
13781
  code: "quota.exceeded",
13381
13782
  errorType: "adapter",
13382
13783
  message: `quota.exceeded: ${normalized}`,
13383
13784
  providerAccessEvidence: buildProviderAccessEvidence("provider_account.capacity_exhausted")
13384
- };
13385
- return {
13785
+ });
13786
+ return withOriginalError({
13386
13787
  code: "upstream_unreachable",
13387
13788
  errorType: "adapter",
13388
13789
  message: `upstream_unreachable: ${normalized}`
13389
- };
13790
+ });
13390
13791
  }
13391
13792
  function buildProviderAccessEvidence(reasonCode) {
13392
13793
  return {
@@ -13419,12 +13820,14 @@ function isProviderUnavailableFailure(value) {
13419
13820
  var OpenCodeCliTransportError = class extends Error {
13420
13821
  code;
13421
13822
  errorType;
13823
+ originalError;
13422
13824
  providerAccessEvidence;
13423
13825
  constructor(input) {
13424
13826
  super(input.message);
13425
13827
  this.name = "OpenCodeCliTransportError";
13426
13828
  this.code = input.code;
13427
13829
  this.errorType = input.errorType;
13830
+ this.originalError = input.originalError;
13428
13831
  this.providerAccessEvidence = input.providerAccessEvidence;
13429
13832
  }
13430
13833
  };
@@ -13514,6 +13917,7 @@ async function invokeOpenCodeCliTransport(input) {
13514
13917
  code: classifiedFailure.code,
13515
13918
  errorType: classifiedFailure.errorType,
13516
13919
  message: classifiedFailure.message,
13920
+ originalError: classifiedFailure.originalError,
13517
13921
  providerAccessEvidence: classifiedFailure.providerAccessEvidence
13518
13922
  });
13519
13923
  }
@@ -13527,6 +13931,7 @@ async function invokeOpenCodeCliTransport(input) {
13527
13931
  code: classifiedFailure.code,
13528
13932
  errorType: classifiedFailure.errorType,
13529
13933
  message: classifiedFailure.message,
13934
+ originalError: classifiedFailure.originalError,
13530
13935
  providerAccessEvidence: classifiedFailure.providerAccessEvidence
13531
13936
  });
13532
13937
  }
@@ -13545,6 +13950,7 @@ async function invokeOpenCodeCliTransport(input) {
13545
13950
  code: classifiedFailure.code,
13546
13951
  errorType: classifiedFailure.errorType,
13547
13952
  message: classifiedFailure.message,
13953
+ originalError: classifiedFailure.originalError,
13548
13954
  providerAccessEvidence: classifiedFailure.providerAccessEvidence
13549
13955
  });
13550
13956
  }
@@ -13561,6 +13967,7 @@ async function invokeOpenCodeCliTransport(input) {
13561
13967
  code: classifiedFailure.code,
13562
13968
  errorType: classifiedFailure.errorType,
13563
13969
  message: classifiedFailure.message,
13970
+ originalError: classifiedFailure.originalError,
13564
13971
  providerAccessEvidence: classifiedFailure.providerAccessEvidence
13565
13972
  });
13566
13973
  }
@@ -13636,6 +14043,7 @@ const toOpenCodeCliTransportError = (error, timeoutMs) => {
13636
14043
  code: classifiedFailure.code,
13637
14044
  errorType: classifiedFailure.errorType,
13638
14045
  message: classifiedFailure.message,
14046
+ originalError: classifiedFailure.originalError,
13639
14047
  providerAccessEvidence: classifiedFailure.providerAccessEvidence
13640
14048
  });
13641
14049
  }
@@ -13647,8 +14055,10 @@ const toOpenCodeCliTransportError = (error, timeoutMs) => {
13647
14055
  });
13648
14056
  };
13649
14057
  const classifyOpenCodeFailure = (input) => {
14058
+ const hasProviderOwnedMessage = input.providerErrorMessages.length > 0 || extractErrorMessagesFromStdout$1(input.stdoutText).length > 0;
13650
14059
  const providerMessage = resolveProviderFailureMessage$1(input);
13651
14060
  if (providerMessage) return classifyOpenCodeFailureMessage({
14061
+ includeOriginalError: hasProviderOwnedMessage,
13652
14062
  isContextLost: isLikelyOpenCodeContextLostError,
13653
14063
  message: providerMessage
13654
14064
  });
@@ -13889,12 +14299,14 @@ const SERVER_READY_LINE_PATTERN = /^opencode server listening on (https?:\/\/[^\
13889
14299
  var OpenCodeServerTransportError = class extends Error {
13890
14300
  code;
13891
14301
  errorType;
14302
+ originalError;
13892
14303
  providerAccessEvidence;
13893
14304
  constructor(input) {
13894
14305
  super(input.message);
13895
14306
  this.name = "OpenCodeServerTransportError";
13896
14307
  this.code = input.code;
13897
14308
  this.errorType = input.errorType;
14309
+ this.originalError = input.originalError;
13898
14310
  this.providerAccessEvidence = input.providerAccessEvidence;
13899
14311
  }
13900
14312
  };
@@ -14292,7 +14704,11 @@ function dispatchOpenCodeEvent(input, event) {
14292
14704
  observeOpenCodeTurnLifecycle(input.turnState, event.type, properties);
14293
14705
  const eventFailure = readOpenCodeTurnEventFailure(input.turnState, event.type, properties);
14294
14706
  if (eventFailure) {
14295
- input.eventFailure.reject(new Error(eventFailure));
14707
+ input.eventFailure.reject(new OpenCodeServerTransportError(classifyOpenCodeFailureMessage({
14708
+ includeOriginalError: true,
14709
+ isContextLost: isLikelyOpenCodeContextLostError,
14710
+ message: eventFailure
14711
+ })));
14296
14712
  return;
14297
14713
  }
14298
14714
  if (event.type === "permission.asked" || event.type === "permission.v2.asked") {
@@ -14845,12 +15261,14 @@ function formatStderrSuffix(stderr) {
14845
15261
  var OpenCodeRuntimeError = class extends Error {
14846
15262
  code;
14847
15263
  errorType;
15264
+ originalError;
14848
15265
  providerAccessEvidence;
14849
15266
  constructor(input) {
14850
15267
  super(input.message);
14851
15268
  this.name = "OpenCodeRuntimeError";
14852
15269
  this.code = input.code;
14853
15270
  this.errorType = input.errorType;
15271
+ this.originalError = input.originalError;
14854
15272
  this.providerAccessEvidence = input.providerAccessEvidence;
14855
15273
  }
14856
15274
  };
@@ -14928,6 +15346,7 @@ async function invokeOpenCodeOnce(input) {
14928
15346
  code: error.code,
14929
15347
  errorType: error.errorType,
14930
15348
  message: error.message,
15349
+ originalError: error.originalError,
14931
15350
  providerAccessEvidence: error.providerAccessEvidence
14932
15351
  });
14933
15352
  throw new OpenCodeRuntimeError({
@@ -18047,7 +18466,7 @@ function resolveOpenMeldAccountContext(input) {
18047
18466
  };
18048
18467
  }
18049
18468
  async function resolveCurrentOpenMeldAccountContext() {
18050
- const { getAuthSessionMetadata } = await import("./auth-session-BbrUVaZd.js").then((n) => n.i);
18469
+ const { getAuthSessionMetadata } = await import("./auth-session-Bj8n8YwV.js").then((n) => n.i);
18051
18470
  return resolveOpenMeldAccountContext({ session: await getAuthSessionMetadata().catch(() => null) });
18052
18471
  }
18053
18472
  function resolveHostKey(baseUrl) {
@@ -19588,8 +20007,8 @@ function splitSentences(message) {
19588
20007
  var package_default = {
19589
20008
  $schema: "https://www.schemastore.org/package.json",
19590
20009
  name: "openmeld",
19591
- version: "0.3.134",
19592
- openMeldReleaseDate: "2026-08-29",
20010
+ version: "0.3.136",
20011
+ openMeldReleaseDate: "2026-08-31",
19593
20012
  description: "OpenMeld CLI - https://openmeld.ai",
19594
20013
  license: "MIT",
19595
20014
  type: "module",
@@ -22298,6 +22717,16 @@ function resolveDaemonServiceIdentity(input = {}) {
22298
22717
  }
22299
22718
  //#endregion
22300
22719
  //#region src/local-service/lifecycle/daemon-service-manager.ts
22720
+ /**
22721
+ * Disables autostart only when the OS definition is already committed.
22722
+ * Setup can run a candidate Service from its stable carrier before that
22723
+ * definition exists; the process can still be stopped without toggling it.
22724
+ */
22725
+ async function disableDaemonServiceAutostartIfConfigured(input) {
22726
+ if (!(input.status?.installed === true && input.status.enabled === true)) return false;
22727
+ await input.manager.disableAutostart();
22728
+ return true;
22729
+ }
22301
22730
  const SHELL_QUOTING_PATTERN = /[\s"\\]/g;
22302
22731
  const SHELL_BACKSLASH_PATTERN = /\\/g;
22303
22732
  const SHELL_DOUBLE_QUOTE_PATTERN = /"/g;
@@ -25673,12 +26102,14 @@ var CursorAcpTransportError = class extends Error {
25673
26102
  code;
25674
26103
  diagnostics;
25675
26104
  errorType;
26105
+ originalError;
25676
26106
  constructor(input) {
25677
26107
  super(input.message, input.cause === void 0 ? void 0 : { cause: input.cause });
25678
26108
  this.name = "CursorAcpTransportError";
25679
26109
  this.code = input.code;
25680
26110
  this.diagnostics = input.diagnostics;
25681
26111
  this.errorType = input.errorType;
26112
+ this.originalError = input.originalError;
25682
26113
  }
25683
26114
  };
25684
26115
  async function invokeCursorAcpTransport(input) {
@@ -25850,7 +26281,8 @@ async function applyCursorSessionModel(input) {
25850
26281
  code: "model.unavailable",
25851
26282
  diagnostics: { modelNegotiation: input.diagnostics },
25852
26283
  errorType: "config",
25853
- message: `model.unavailable: Cursor ACP rejected model '${model}' for this session`
26284
+ message: `model.unavailable: Cursor ACP rejected model '${model}' for this session`,
26285
+ ...error.originalError ? { originalError: error.originalError } : {}
25854
26286
  });
25855
26287
  throw error;
25856
26288
  }
@@ -25866,7 +26298,8 @@ async function applyLegacyCursorSessionModel(input) {
25866
26298
  code: "model.unavailable",
25867
26299
  diagnostics: { modelNegotiation: input.diagnostics },
25868
26300
  errorType: "config",
25869
- message: `model.unavailable: Cursor ACP rejected model '${input.model}' for this session`
26301
+ message: `model.unavailable: Cursor ACP rejected model '${input.model}' for this session`,
26302
+ ...error.originalError ? { originalError: error.originalError } : {}
25870
26303
  });
25871
26304
  throw error;
25872
26305
  }
@@ -25964,7 +26397,8 @@ var CursorAcpSession = class {
25964
26397
  cause: error,
25965
26398
  code: "context_not_found",
25966
26399
  errorType: "adapter",
25967
- message: "context_not_found: Cursor ACP could not load the persisted conversation"
26400
+ message: "context_not_found: Cursor ACP could not load the persisted conversation",
26401
+ ...error.originalError ? { originalError: error.originalError } : {}
25968
26402
  });
25969
26403
  throw error;
25970
26404
  }
@@ -26260,24 +26694,28 @@ async function emitFinalPreviewIfRequested(input) {
26260
26694
  }
26261
26695
  function toJsonRpcTransportError(error) {
26262
26696
  const message = normalizeOptionalText$42(error.message) ?? "Cursor ACP error";
26697
+ const originalError = createProviderOriginalError(message);
26263
26698
  if (error.code === -32601) return new CursorAcpTransportError({
26264
26699
  code: "protocol.method_not_found",
26265
26700
  errorType: "adapter",
26266
- message
26701
+ message,
26702
+ ...originalError ? { originalError } : {}
26267
26703
  });
26268
26704
  if (error.code === -32602) return new CursorAcpTransportError({
26269
26705
  code: "protocol.invalid_params",
26270
26706
  errorType: "config",
26271
- message
26707
+ message,
26708
+ ...originalError ? { originalError } : {}
26272
26709
  });
26273
- return classifyCursorFailure(message);
26710
+ return classifyCursorFailure(message, originalError);
26274
26711
  }
26275
26712
  function toCursorAcpTransportError(error, stderr, diagnostics) {
26276
26713
  if (error instanceof CursorAcpTransportError) return error.diagnostics || !diagnostics ? error : new CursorAcpTransportError({
26277
26714
  code: error.code,
26278
26715
  diagnostics,
26279
26716
  errorType: error.errorType,
26280
- message: error.message
26717
+ message: error.message,
26718
+ ...error.originalError ? { originalError: error.originalError } : {}
26281
26719
  });
26282
26720
  const classified = classifyCursorFailure([toErrorMessage$30(error), normalizeOptionalText$42(stderr)].filter((value) => value !== null).join("\n"));
26283
26721
  return diagnostics ? new CursorAcpTransportError({
@@ -26287,33 +26725,38 @@ function toCursorAcpTransportError(error, stderr, diagnostics) {
26287
26725
  message: classified.message
26288
26726
  }) : classified;
26289
26727
  }
26290
- function classifyCursorFailure(message) {
26728
+ function classifyCursorFailure(message, originalError = null) {
26291
26729
  const normalized = normalizeOptionalText$42(message) ?? "Cursor ACP error";
26292
26730
  const lowered = normalized.toLowerCase();
26293
26731
  if (isCursorPlanUpgradeRequired(normalized)) return new CursorAcpTransportError({
26294
26732
  code: "cursor.plan_upgrade_required",
26295
26733
  errorType: "adapter",
26296
- message: normalized
26734
+ message: normalized,
26735
+ ...originalError ? { originalError } : {}
26297
26736
  });
26298
26737
  if (lowered.includes("network") || lowered.includes("fetch failed") || lowered.includes("connection") || lowered.includes("econn") || lowered.includes("dns")) return new CursorAcpTransportError({
26299
26738
  code: "network.unavailable",
26300
26739
  errorType: "network",
26301
- message: normalized
26740
+ message: normalized,
26741
+ ...originalError ? { originalError } : {}
26302
26742
  });
26303
26743
  if (lowered.includes("not logged in") || lowered.includes("unauthorized") || lowered.includes("authentication") || lowered.includes("invalid api key") || lowered.includes("401")) return new CursorAcpTransportError({
26304
26744
  code: "auth.required",
26305
26745
  errorType: "auth",
26306
- message: normalized
26746
+ message: normalized,
26747
+ ...originalError ? { originalError } : {}
26307
26748
  });
26308
26749
  if (lowered.includes("session not found") || lowered.includes("unknown session")) return new CursorAcpTransportError({
26309
26750
  code: "context_not_found",
26310
26751
  errorType: "config",
26311
- message: normalized
26752
+ message: normalized,
26753
+ ...originalError ? { originalError } : {}
26312
26754
  });
26313
26755
  return new CursorAcpTransportError({
26314
26756
  code: "upstream_unreachable",
26315
26757
  errorType: "adapter",
26316
- message: normalized
26758
+ message: normalized,
26759
+ ...originalError ? { originalError } : {}
26317
26760
  });
26318
26761
  }
26319
26762
  function normalizeOutputText(value) {
@@ -26426,6 +26869,7 @@ function createDefaultCursorInvoke(input) {
26426
26869
  cause: error,
26427
26870
  code: "context.rebuild_failed",
26428
26871
  ...error instanceof CursorAcpTransportError && error.diagnostics ? { diagnostics: error.diagnostics } : {},
26872
+ ...error instanceof CursorAcpTransportError && error.originalError ? { originalError: error.originalError } : {},
26429
26873
  errorType: "adapter",
26430
26874
  message: `context.rebuild_failed: ${toErrorMessage$29(error)}`
26431
26875
  }),
@@ -26848,46 +27292,51 @@ const HTTP_429_TOKEN_RE = /\b429\b/;
26848
27292
  function classifyOpenClawFailureMessage(input) {
26849
27293
  const normalizedMessage = normalizeOpenClawFailureMessage(input.message) ?? "openclaw command failed";
26850
27294
  const lowered = normalizedMessage.toLowerCase();
27295
+ const originalError = input.includeOriginalError ? createProviderOriginalError(normalizedMessage) : null;
27296
+ const withOriginalError = (value) => ({
27297
+ ...value,
27298
+ ...originalError ? { originalError } : {}
27299
+ });
26851
27300
  const permissionDenial = classifyRuntimePermissionDenialMessage({
26852
27301
  message: normalizedMessage,
26853
27302
  source: "openclaw"
26854
27303
  });
26855
- if (permissionDenial) return permissionDenial;
26856
- if (isUnsupportedModelFailure(lowered)) return {
27304
+ if (permissionDenial) return withOriginalError(permissionDenial);
27305
+ if (isUnsupportedModelFailure(lowered)) return withOriginalError({
26857
27306
  code: "model.unsupported",
26858
27307
  errorType: "config",
26859
27308
  message: normalizedMessage
26860
- };
26861
- if (isAuthFailure(lowered)) return {
27309
+ });
27310
+ if (isAuthFailure(lowered)) return withOriginalError({
26862
27311
  code: "auth.required",
26863
27312
  errorType: "auth",
26864
27313
  message: normalizedMessage
26865
- };
26866
- if (isQuotaFailure(lowered)) return {
27314
+ });
27315
+ if (isQuotaFailure(lowered)) return withOriginalError({
26867
27316
  code: "quota.exceeded",
26868
27317
  errorType: "adapter",
26869
27318
  message: normalizedMessage
26870
- };
26871
- if (isRateLimitFailure(lowered)) return {
27319
+ });
27320
+ if (isRateLimitFailure(lowered)) return withOriginalError({
26872
27321
  code: "rate_limited",
26873
27322
  errorType: "adapter",
26874
27323
  message: normalizedMessage
26875
- };
26876
- if (input.isContextLost?.(normalizedMessage)) return {
27324
+ });
27325
+ if (input.isContextLost?.(normalizedMessage)) return withOriginalError({
26877
27326
  code: "context.lost",
26878
27327
  errorType: "adapter",
26879
27328
  message: normalizedMessage
26880
- };
26881
- if (isInputSelectorFailure(lowered)) return {
27329
+ });
27330
+ if (isInputSelectorFailure(lowered)) return withOriginalError({
26882
27331
  code: "schema.invalid",
26883
27332
  errorType: "config",
26884
27333
  message: normalizedMessage
26885
- };
26886
- return {
27334
+ });
27335
+ return withOriginalError({
26887
27336
  code: "upstream_unreachable",
26888
27337
  errorType: "adapter",
26889
27338
  message: normalizedMessage
26890
- };
27339
+ });
26891
27340
  }
26892
27341
  function normalizeOpenClawFailureMessage(value) {
26893
27342
  const normalized = normalizeOptionalText$38(value);
@@ -26928,11 +27377,13 @@ function normalizeOptionalText$38(value) {
26928
27377
  var OpenClawCliTransportError = class extends Error {
26929
27378
  code;
26930
27379
  errorType;
27380
+ originalError;
26931
27381
  constructor(input) {
26932
27382
  super(input.message);
26933
27383
  this.name = "OpenClawCliTransportError";
26934
27384
  this.code = input.code;
26935
27385
  this.errorType = input.errorType;
27386
+ this.originalError = input.originalError;
26936
27387
  }
26937
27388
  };
26938
27389
  async function invokeOpenClawCliTransport(input) {
@@ -26955,6 +27406,7 @@ async function invokeOpenClawCliTransport(input) {
26955
27406
  let latestResultIsError = false;
26956
27407
  let resolvedSessionId = initialSessionId;
26957
27408
  const providerErrorMessages = [];
27409
+ const providerOriginalErrorMessages = [];
26958
27410
  const invokedAtMs = Date.now();
26959
27411
  let firstStdoutAtMs = null;
26960
27412
  let firstStderrAtMs = null;
@@ -26980,7 +27432,10 @@ async function invokeOpenClawCliTransport(input) {
26980
27432
  return;
26981
27433
  }
26982
27434
  if (parsedLine.resultText) latestOutput = parsedLine.resultText;
26983
- if (parsedLine.errorMessage) providerErrorMessages.push(parsedLine.errorMessage);
27435
+ if (parsedLine.errorMessage) {
27436
+ providerErrorMessages.push(parsedLine.errorMessage);
27437
+ providerOriginalErrorMessages.push(parsedLine.errorMessage);
27438
+ }
26984
27439
  if (parsedLine.isErrorResult === true) {
26985
27440
  latestResultIsError = true;
26986
27441
  return;
@@ -26997,52 +27452,37 @@ async function invokeOpenClawCliTransport(input) {
26997
27452
  } catch (error) {
26998
27453
  throw toOpenClawCliTransportError(error, input.openClawTimeoutMs);
26999
27454
  }
27000
- if (driverResult.exitCode !== 0 || latestResultIsError) {
27001
- const classifiedFailure = classifyOpenClawFailure({
27002
- providerErrorMessages,
27003
- stderrText: driverResult.stderrText,
27004
- stdoutText: driverResult.stdoutText
27005
- });
27006
- throw new OpenClawCliTransportError({
27007
- code: classifiedFailure.code,
27008
- errorType: classifiedFailure.errorType,
27009
- message: classifiedFailure.message
27010
- });
27011
- }
27455
+ if (driverResult.exitCode !== 0 || latestResultIsError) throw new OpenClawCliTransportError(classifyOpenClawFailure({
27456
+ providerErrorMessages,
27457
+ providerOriginalErrorMessages,
27458
+ stderrText: driverResult.stderrText,
27459
+ stdoutText: driverResult.stdoutText
27460
+ }));
27012
27461
  const documentParsed = parseOpenClawOutputDocument(driverResult.stdoutText);
27013
27462
  if (documentParsed) {
27014
27463
  if (documentParsed.outputText) latestOutput = documentParsed.outputText;
27015
27464
  if (documentParsed.sessionId) resolvedSessionId = documentParsed.sessionId;
27016
- if (documentParsed.errorMessage) providerErrorMessages.push(documentParsed.errorMessage);
27017
- if (documentParsed.isErrorResult === true) {
27018
- const classifiedFailure = classifyOpenClawFailure({
27019
- providerErrorMessages,
27020
- stderrText: driverResult.stderrText,
27021
- stdoutText: driverResult.stdoutText
27022
- });
27023
- throw new OpenClawCliTransportError({
27024
- code: classifiedFailure.code,
27025
- errorType: classifiedFailure.errorType,
27026
- message: classifiedFailure.message
27027
- });
27465
+ if (documentParsed.errorMessage) {
27466
+ providerErrorMessages.push(documentParsed.errorMessage);
27467
+ providerOriginalErrorMessages.push(documentParsed.errorMessage);
27028
27468
  }
27469
+ if (documentParsed.isErrorResult === true) throw new OpenClawCliTransportError(classifyOpenClawFailure({
27470
+ providerErrorMessages,
27471
+ providerOriginalErrorMessages,
27472
+ stderrText: driverResult.stderrText,
27473
+ stdoutText: driverResult.stdoutText
27474
+ }));
27029
27475
  }
27030
27476
  const output = normalizeOptionalText$37(latestOutput);
27031
27477
  if (!output) {
27032
27478
  const fallbackOutput = resolveSuccessFallbackOutput(driverResult.stdoutText);
27033
27479
  if (!fallbackOutput) {
27034
- if (providerErrorMessages.length > 0) {
27035
- const classifiedFailure = classifyOpenClawFailure({
27036
- providerErrorMessages,
27037
- stderrText: driverResult.stderrText,
27038
- stdoutText: driverResult.stdoutText
27039
- });
27040
- throw new OpenClawCliTransportError({
27041
- code: classifiedFailure.code,
27042
- errorType: classifiedFailure.errorType,
27043
- message: classifiedFailure.message
27044
- });
27045
- }
27480
+ if (providerErrorMessages.length > 0) throw new OpenClawCliTransportError(classifyOpenClawFailure({
27481
+ providerErrorMessages,
27482
+ providerOriginalErrorMessages,
27483
+ stderrText: driverResult.stderrText,
27484
+ stdoutText: driverResult.stdoutText
27485
+ }));
27046
27486
  throw new OpenClawCliTransportError({
27047
27487
  code: "runtime.output.empty",
27048
27488
  errorType: "adapter",
@@ -27115,18 +27555,12 @@ const toOpenClawCliTransportError = (error, timeoutMs) => {
27115
27555
  errorType: "adapter",
27116
27556
  message: `upstream_unreachable: failed to spawn openclaw (${error.message})`
27117
27557
  });
27118
- if (error.code === "process.non_zero_exit") {
27119
- const classifiedFailure = classifyOpenClawFailure({
27120
- providerErrorMessages: [],
27121
- stderrText: error.stderrText,
27122
- stdoutText: error.stdoutText
27123
- });
27124
- return new OpenClawCliTransportError({
27125
- code: classifiedFailure.code,
27126
- errorType: classifiedFailure.errorType,
27127
- message: classifiedFailure.message
27128
- });
27129
- }
27558
+ if (error.code === "process.non_zero_exit") return new OpenClawCliTransportError(classifyOpenClawFailure({
27559
+ providerErrorMessages: [],
27560
+ providerOriginalErrorMessages: [],
27561
+ stderrText: error.stderrText,
27562
+ stdoutText: error.stdoutText
27563
+ }));
27130
27564
  }
27131
27565
  return new OpenClawCliTransportError({
27132
27566
  code: "upstream_unreachable",
@@ -27135,8 +27569,10 @@ const toOpenClawCliTransportError = (error, timeoutMs) => {
27135
27569
  });
27136
27570
  };
27137
27571
  const classifyOpenClawFailure = (input) => {
27572
+ const trustedProviderMessages = /* @__PURE__ */ new Set([...input.providerOriginalErrorMessages ?? [], ...extractErrorMessagesFromStdout(input.stdoutText)]);
27138
27573
  const providerMessage = resolveProviderFailureMessage(input);
27139
27574
  if (providerMessage) return classifyOpenClawFailureMessage({
27575
+ includeOriginalError: trustedProviderMessages.has(providerMessage),
27140
27576
  isContextLost: isLikelyOpenClawContextLostError,
27141
27577
  message: providerMessage
27142
27578
  });
@@ -27204,11 +27640,13 @@ function normalizeOptionalText$37(value) {
27204
27640
  var OpenClawRuntimeError = class extends Error {
27205
27641
  code;
27206
27642
  errorType;
27643
+ originalError;
27207
27644
  constructor(input) {
27208
27645
  super(input.message);
27209
27646
  this.name = "OpenClawRuntimeError";
27210
27647
  this.code = input.code;
27211
27648
  this.errorType = input.errorType;
27649
+ this.originalError = input.originalError;
27212
27650
  }
27213
27651
  };
27214
27652
  async function invokeOpenClawWithSingleContextHeal(input) {
@@ -27264,7 +27702,8 @@ async function invokeOpenClawOnce(input) {
27264
27702
  if (error && typeof error === "object" && "code" in error && typeof error.code === "string" && "errorType" in error && typeof error.errorType === "string" && error instanceof Error) throw new OpenClawRuntimeError({
27265
27703
  code: error.code,
27266
27704
  errorType: error.errorType,
27267
- message: error.message
27705
+ message: error.message,
27706
+ ..."originalError" in error && typeof error.originalError === "string" ? { originalError: error.originalError } : {}
27268
27707
  });
27269
27708
  throw new OpenClawRuntimeError({
27270
27709
  code: "upstream_unreachable",
@@ -27389,10 +27828,12 @@ const OPENCLAW_GATEWAY_MAX_BUFFER_BYTES = 10 * 1024 * 1024;
27389
27828
  var OpenClawGatewayTransportError = class extends Error {
27390
27829
  code;
27391
27830
  errorType;
27831
+ originalError;
27392
27832
  constructor(input) {
27393
27833
  super(input.message);
27394
27834
  this.code = input.code;
27395
27835
  this.errorType = input.errorType;
27836
+ this.originalError = input.originalError;
27396
27837
  this.name = "OpenClawGatewayTransportError";
27397
27838
  }
27398
27839
  };
@@ -27474,7 +27915,10 @@ async function promoteGatewayFailureFromSessionStore(input) {
27474
27915
  sessionKey: input.sessionKey
27475
27916
  });
27476
27917
  if (!sessionErrorMessage) return fallbackError;
27477
- const classified = classifyOpenClawFailureMessage({ message: sessionErrorMessage });
27918
+ const classified = classifyOpenClawFailureMessage({
27919
+ includeOriginalError: true,
27920
+ message: sessionErrorMessage
27921
+ });
27478
27922
  const normalizedFallbackMessage = normalizeOpenClawFailureMessage(fallbackError.message) ?? fallbackError.message.trim();
27479
27923
  const normalizedClassifiedMessage = normalizeOpenClawFailureMessage(classified.message) ?? classified.message.trim();
27480
27924
  if (classified.code === fallbackError.code && normalizedClassifiedMessage === normalizedFallbackMessage) return fallbackError;
@@ -27510,7 +27954,7 @@ function normalizeOpenClawGatewayAgentResult(result, expectedSessionKey) {
27510
27954
  const record = result;
27511
27955
  const status = normalizeOptionalText$35(record.status);
27512
27956
  if (!status || status === "ok") return extractSuccessfulAgentResult(record.result, expectedSessionKey);
27513
- throw classifyGatewayFailure(normalizeOptionalText$35(record.summary) ?? normalizeOptionalText$35(record.error) ?? `openclaw gateway agent returned status '${status}'`);
27957
+ throw classifyGatewayFailure(normalizeOptionalText$35(record.summary) ?? normalizeOptionalText$35(record.error) ?? `openclaw gateway agent returned status '${status}'`, true);
27514
27958
  }
27515
27959
  function extractSuccessfulAgentResult(result, expectedSessionKey) {
27516
27960
  if (!result || typeof result !== "object") throw new OpenClawGatewayTransportError({
@@ -27565,10 +28009,13 @@ function toOpenClawGatewayTransportError(error) {
27565
28009
  });
27566
28010
  const stderr = normalizeOptionalText$35(error?.stderr);
27567
28011
  const stdout = normalizeOptionalText$35(error?.stdout);
27568
- return classifyGatewayFailure(stderr ?? stdout ?? toErrorMessage$27(error));
28012
+ return classifyGatewayFailure(stderr ?? stdout ?? toErrorMessage$27(error), false);
27569
28013
  }
27570
- function classifyGatewayFailure(message) {
27571
- return new OpenClawGatewayTransportError(classifyOpenClawFailureMessage({ message }));
28014
+ function classifyGatewayFailure(message, includeOriginalError) {
28015
+ return new OpenClawGatewayTransportError(classifyOpenClawFailureMessage({
28016
+ includeOriginalError,
28017
+ message
28018
+ }));
27572
28019
  }
27573
28020
  function normalizeOptionalText$35(value) {
27574
28021
  const normalized = String(value ?? "").trim();
@@ -28607,6 +29054,19 @@ function resolveControllerOptions(agentControllerRef) {
28607
29054
  function isAgentControllerPermissionModeControllerId(value) {
28608
29055
  return Object.hasOwn(AGENT_CONTROLLER_PERMISSION_MODE_OPTIONS_BY_CONTROLLER_ID, value);
28609
29056
  }
29057
+ const AGENT_CONTROLLER_USAGE_LIMIT_SUPPORT_MATRIX = {
29058
+ "claude-code": "passive",
29059
+ codex: "native",
29060
+ cursor: "unsupported",
29061
+ "grok-build": "native",
29062
+ opencode: "unsupported",
29063
+ openclaw: "not_evaluated"
29064
+ };
29065
+ function resolveAgentControllerUsageLimitSupport(agentControllerRef) {
29066
+ const parsedRef = parseAgentControllerRef(agentControllerRef);
29067
+ if (parsedRef?.kind !== "builtin") return "not_evaluated";
29068
+ return AGENT_CONTROLLER_USAGE_LIMIT_SUPPORT_MATRIX[parsedRef.id] ?? "not_evaluated";
29069
+ }
28610
29070
  const DUPLICATE_REPLY_CONVERSATION_REASON = "This agent shares a reply conversation with another Agent Profile.";
28611
29071
  function resolveAgentExecutionStatus(input) {
28612
29072
  const executionFamily = input.executionFamily ?? "workstation";
@@ -28939,6 +29399,7 @@ function resolveServicePrimaryAction(input) {
28939
29399
  function resolveRuntimeRoutePrimaryAction(input) {
28940
29400
  if (!(input.localService.reachable || input.route.online)) return "run_prepare";
28941
29401
  if (input.providerAccount.blocked) return "fix_provider_account";
29402
+ if (input.runtime.reasonCodes.includes("usage_exhausted")) return "check_status";
28942
29403
  if (!input.runtime.ready) return resolveRuntimeNotReadyPrimaryAction({
28943
29404
  localService: input.localService,
28944
29405
  runtime: input.runtime
@@ -28979,7 +29440,7 @@ function resolveRuntimeNotReadyPrimaryAction(input) {
28979
29440
  return "run_prepare";
28980
29441
  }
28981
29442
  function hasRuntimeAgentControllerReportRefreshReason(reasonCodes) {
28982
- return reasonCodes.some((reasonCode) => reasonCode === "controller.interface.check_failed" || reasonCode === "runtime.agent_controller_report_stale" || reasonCode === "runtime.agent_controller_report_missing" || reasonCode === "runtime.projection_missing" || reasonCode === "claim_eligibility.agent_controller_report_missing" || reasonCode === "claim_eligibility.agent_controller_report_stale");
29443
+ return reasonCodes.some((reasonCode) => reasonCode === "controller.interface.check_failed" || reasonCode === "usage_checking" || reasonCode === "runtime.agent_controller_report_stale" || reasonCode === "runtime.agent_controller_report_missing" || reasonCode === "runtime.projection_missing" || reasonCode === "claim_eligibility.agent_controller_report_missing" || reasonCode === "claim_eligibility.agent_controller_report_stale");
28983
29444
  }
28984
29445
  function isAgentExecutionReadyOrConnecting(readiness) {
28985
29446
  return readiness.displayState === "ready";
@@ -32271,7 +32732,8 @@ function buildTaskResultCommonFields(input) {
32271
32732
  function buildTaskResultErrorFields(input) {
32272
32733
  return {
32273
32734
  ...input.errorCode ? { errorCode: input.errorCode } : {},
32274
- ...input.errorMessage ? { errorMessage: input.errorMessage } : {}
32735
+ ...input.errorMessage ? { errorMessage: input.errorMessage } : {},
32736
+ ...input.originalError ? { originalError: input.originalError } : {}
32275
32737
  };
32276
32738
  }
32277
32739
  //#endregion
@@ -32494,6 +32956,7 @@ const resolveTaskOutcome = (input) => {
32494
32956
  ...input.dispatchResult.adapterResult.errorCode ? { errorCode: input.dispatchResult.adapterResult.errorCode } : {},
32495
32957
  errorMessage: input.dispatchResult.adapterResult.errorMessage,
32496
32958
  errorType: mapAdapterErrorType(input.dispatchResult.adapterResult.errorType),
32959
+ ...input.dispatchResult.adapterResult.originalError ? { originalError: input.dispatchResult.adapterResult.originalError } : {},
32497
32960
  ...input.dispatchResult.adapterResult.providerAccessEvidence ? { providerAccessEvidence: input.dispatchResult.adapterResult.providerAccessEvidence } : {},
32498
32961
  ...input.dispatchResult.adapterResult.telemetry ? { telemetry: input.dispatchResult.adapterResult.telemetry } : {}
32499
32962
  };
@@ -32750,6 +33213,7 @@ const resolveRuntimeTaskOutcomeResult = (input) => {
32750
33213
  ...outcome.errorMessage ? { errorMessage: outcome.errorMessage } : {},
32751
33214
  ...outcome.errorType ? { errorType: outcome.errorType } : {},
32752
33215
  ...outcome.output ? { output: outcome.output } : {},
33216
+ ...outcome.originalError ? { originalError: outcome.originalError } : {},
32753
33217
  ...outcome.providerAccessEvidence ? { providerAccessEvidence: outcome.providerAccessEvidence } : {},
32754
33218
  ...outcome.telemetry ? { telemetry: outcome.telemetry } : {},
32755
33219
  sourceEventId: input.sourceEventId,
@@ -34079,12 +34543,16 @@ const BUILTIN_AGENT_CONTROLLER_DEFINITIONS = [
34079
34543
  permissionModes: true,
34080
34544
  structuredUserInput: false
34081
34545
  },
34546
+ conversationOccupancy: {
34547
+ contractVersion: 1,
34548
+ mode: "unsupported"
34549
+ },
34082
34550
  installResolver: {
34083
34551
  resolveInstalledLaunchCandidates: resolveInstalledClaudeCodeLaunchCandidates,
34084
34552
  verifyLaunchContract: verifyClaudeCodeLaunchContract
34085
34553
  },
34086
34554
  nativeInterface: "claude-agent-sdk",
34087
- usageLimitSupport: "passive",
34555
+ usageLimitSupport: resolveAgentControllerUsageLimitSupport("builtin:claude-code"),
34088
34556
  versionMaintenance: {
34089
34557
  homebrewPackage: {
34090
34558
  kind: "cask",
@@ -34110,12 +34578,16 @@ const BUILTIN_AGENT_CONTROLLER_DEFINITIONS = [
34110
34578
  permissionModes: true,
34111
34579
  structuredUserInput: false
34112
34580
  },
34581
+ conversationOccupancy: {
34582
+ contractVersion: 1,
34583
+ mode: "official_atomic_admission_and_release_signal"
34584
+ },
34113
34585
  installResolver: {
34114
34586
  resolveInstalledLaunchCandidates: resolveInstalledCodexLaunchCandidates,
34115
34587
  verifyLaunchContract: verifyCodexLaunchContract
34116
34588
  },
34117
34589
  nativeInterface: "codex-app-server",
34118
- usageLimitSupport: "native",
34590
+ usageLimitSupport: resolveAgentControllerUsageLimitSupport("builtin:codex"),
34119
34591
  versionMaintenance: {
34120
34592
  homebrewPackage: {
34121
34593
  kind: "cask",
@@ -34129,12 +34601,16 @@ const BUILTIN_AGENT_CONTROLLER_DEFINITIONS = [
34129
34601
  adapterId: "openclaw",
34130
34602
  agentId: "openclaw",
34131
34603
  capabilities: EMPTY_AGENT_CONTROLLER_INTERFACE_CAPABILITIES,
34604
+ conversationOccupancy: {
34605
+ contractVersion: 1,
34606
+ mode: "unsupported"
34607
+ },
34132
34608
  installResolver: {
34133
34609
  resolveInstalledLaunchCandidates: resolveInstalledOpenClawLaunchCandidates,
34134
34610
  verifyLaunchContract: verifyOpenClawLaunchContract
34135
34611
  },
34136
34612
  nativeInterface: "local-cli",
34137
- usageLimitSupport: "not_evaluated"
34613
+ usageLimitSupport: resolveAgentControllerUsageLimitSupport("builtin:openclaw")
34138
34614
  },
34139
34615
  {
34140
34616
  adapterId: "cursor",
@@ -34148,13 +34624,17 @@ const BUILTIN_AGENT_CONTROLLER_DEFINITIONS = [
34148
34624
  permissionModes: true,
34149
34625
  structuredUserInput: false
34150
34626
  },
34627
+ conversationOccupancy: {
34628
+ contractVersion: 1,
34629
+ mode: "unsupported"
34630
+ },
34151
34631
  installResolver: {
34152
34632
  refreshPersistedLaunchContract: refreshCursorPersistedLaunchContract,
34153
34633
  resolveInstalledLaunchCandidates: resolveInstalledCursorLaunchCandidates,
34154
34634
  verifyLaunchContract: verifyCursorLaunchContract
34155
34635
  },
34156
34636
  nativeInterface: "acp",
34157
- usageLimitSupport: "unsupported",
34637
+ usageLimitSupport: resolveAgentControllerUsageLimitSupport("builtin:cursor"),
34158
34638
  versionMaintenance: {
34159
34639
  homebrewPackage: {
34160
34640
  kind: "cask",
@@ -34179,12 +34659,16 @@ const BUILTIN_AGENT_CONTROLLER_DEFINITIONS = [
34179
34659
  permissionModes: true,
34180
34660
  structuredUserInput: true
34181
34661
  },
34662
+ conversationOccupancy: {
34663
+ contractVersion: 1,
34664
+ mode: "unsupported"
34665
+ },
34182
34666
  installResolver: {
34183
34667
  resolveInstalledLaunchCandidates: resolveInstalledGrokBuildLaunchCandidates,
34184
34668
  verifyLaunchContract: verifyGrokBuildLaunchContract
34185
34669
  },
34186
34670
  nativeInterface: "acp",
34187
- usageLimitSupport: "native",
34671
+ usageLimitSupport: resolveAgentControllerUsageLimitSupport("builtin:grok-build"),
34188
34672
  versionMaintenance: { officialChannels: [{
34189
34673
  latest: {
34190
34674
  kind: "http-text",
@@ -34206,12 +34690,16 @@ const BUILTIN_AGENT_CONTROLLER_DEFINITIONS = [
34206
34690
  permissionModes: false,
34207
34691
  structuredUserInput: false
34208
34692
  },
34693
+ conversationOccupancy: {
34694
+ contractVersion: 1,
34695
+ mode: "unsupported"
34696
+ },
34209
34697
  installResolver: {
34210
34698
  resolveInstalledLaunchCandidates: resolveInstalledOpenCodeLaunchCandidates,
34211
34699
  verifyLaunchContract: verifyOpenCodeLaunchContract
34212
34700
  },
34213
34701
  nativeInterface: "local-cli",
34214
- usageLimitSupport: "unsupported",
34702
+ usageLimitSupport: resolveAgentControllerUsageLimitSupport("builtin:opencode"),
34215
34703
  versionMaintenance: {
34216
34704
  homebrewPackage: {
34217
34705
  kind: "formula",
@@ -38833,9 +39321,9 @@ function createModelCatalogReadSession(input) {
38833
39321
  async function readModelCatalogOnce(baseUrl) {
38834
39322
  try {
38835
39323
  const [apiClient, baseUrlModule, clientFoundationModule] = await Promise.all([
38836
- import("./dist-Fj_YSHkO.js").then((n) => n.w),
39324
+ import("./dist-0qM_CVk2.js").then((n) => n.w),
38837
39325
  import("./base-url-BtqW4aLS.js").then((n) => n.n),
38838
- import("./api-client-foundation-DNnxEYcg.js").then((n) => n.t)
39326
+ import("./api-client-foundation-CabWpjFe.js").then((n) => n.t)
38839
39327
  ]);
38840
39328
  if (typeof apiClient.createConfigApi !== "function") throw new Error("config api client is unavailable");
38841
39329
  const resolvedBaseUrl = baseUrl ?? await baseUrlModule.resolveBaseUrl();
@@ -41797,7 +42285,8 @@ async function resolveAgentReplyReadinessStatus(input) {
41797
42285
  const localAgentId = executionTarget?.localAgentId ?? null;
41798
42286
  const deviceReasonCodes = resolveAgentDeviceReasonCodes({
41799
42287
  coreWakeRouteOnline: input.coreWakeRouteOnline === true,
41800
- deviceReasonCodes: deviceReplyReadiness.reasonCodes
42288
+ deviceReasonCodes: deviceReplyReadiness.reasonCodes,
42289
+ serviceWakeability: deviceReplyReadiness.serviceWakeability
41801
42290
  });
41802
42291
  const reasonCodes = collectAgentReplyReadinessReasonCodes({
41803
42292
  bindingReady: executionTarget?.bindingState === "enabled_primary" && executionTarget.routable,
@@ -41852,7 +42341,11 @@ async function resolveAgentReplyReadinessStatus(input) {
41852
42341
  }
41853
42342
  function resolveAgentDeviceReasonCodes(input) {
41854
42343
  if (!input.coreWakeRouteOnline) return [...input.deviceReasonCodes];
41855
- return input.deviceReasonCodes.filter((reasonCode) => reasonCode !== "service.not_running" && reasonCode !== "route.offline" && reasonCode !== "route.not_registered");
42344
+ return input.deviceReasonCodes.filter((reasonCode) => reasonCode !== "service.not_running" && reasonCode !== "route.offline" && reasonCode !== "route.not_registered" && !(reasonCode === "service.drifted" && isConditionalServiceDrift(input.serviceWakeability)));
42345
+ }
42346
+ function isConditionalServiceDrift(serviceWakeability) {
42347
+ if (!serviceWakeability || serviceWakeability.blockingCodes.length === 0) return false;
42348
+ return serviceWakeability.blockingCodes.every((code) => DAEMON_SERVICE_WAKEABILITY_CONDITIONAL_ANOMALIES.has(code));
41856
42349
  }
41857
42350
  async function resolveAgentPrimaryRuntimeContext(input) {
41858
42351
  const executionTarget = input.primaryAgentControllerReport !== void 0 ? input.primaryAgentControllerReport : await resolveAgentProfilePrimaryAgentControllerReport({
@@ -42038,6 +42531,7 @@ async function resolveReplyReadinessRuntimeProjection() {
42038
42531
  return await syncDeviceRuntimeStateProjection({ mode: "check" }).catch(() => null);
42039
42532
  }
42040
42533
  async function resolveDeviceReplyReadinessFromServiceState(input) {
42534
+ const wakeability = classifyDaemonServiceWakeability({ inventory: input.inventory });
42041
42535
  const effectiveRuntimeStatus = await resolveEffectiveRuntimeStatus({
42042
42536
  inventory: input.inventory,
42043
42537
  runtimeStatus: input.runtimeStatus,
@@ -42055,17 +42549,15 @@ async function resolveDeviceReplyReadinessFromServiceState(input) {
42055
42549
  replyReadiness: effectiveRuntimeStatus === "unknown" ? "unknown" : "blocked",
42056
42550
  wakeableRouteCount: input.localDemand?.localExecutionRouteCount ?? 0
42057
42551
  });
42058
- if (hasServiceDrift(input.inventory)) return createDeviceReplyReadinessStatus({
42552
+ if (wakeability.blocksWake) return createDeviceReplyReadinessStatus({
42059
42553
  reasonCode: "service.drifted",
42060
42554
  reasonText: resolveReplyReadinessAvailabilityReasonCopy("service.drifted"),
42061
42555
  replyReadiness: "blocked",
42556
+ serviceWakeability: wakeability,
42062
42557
  wakeableRouteCount: input.localDemand?.localExecutionRouteCount ?? 0
42063
42558
  });
42064
42559
  return null;
42065
42560
  }
42066
- function hasServiceDrift(inventory) {
42067
- return classifyDaemonServiceWakeability({ inventory }).blocksWake;
42068
- }
42069
42561
  function resolveDeviceReplyReadinessFromRuntimeProjection(runtimeProjection) {
42070
42562
  if (runtimeProjection?.status !== "degraded") return null;
42071
42563
  if (runtimeProjection.missingControllerIds.length > 0) return createDeviceReplyReadinessStatus({
@@ -42112,6 +42604,7 @@ function createDeviceReplyReadinessStatus(input) {
42112
42604
  reasonCodes: sortReplyReadinessReasonCodes(input.reasonCode ? [input.reasonCode] : []),
42113
42605
  reasonText: input.reasonText,
42114
42606
  replyReadiness: input.replyReadiness,
42607
+ ...input.serviceWakeability ? { serviceWakeability: input.serviceWakeability } : {},
42115
42608
  updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
42116
42609
  wakeableRouteCount: input.wakeableRouteCount
42117
42610
  };
@@ -44889,8 +45382,10 @@ async function stopLifecycleRuntime(input) {
44889
45382
  if (!(await forceKillStalledDaemonAfterStopTimeout({ stage: "stop_or_drain" })).killed) throw new DaemonServiceLifecycleDrainTimeoutError(input.drainWaitMs);
44890
45383
  }
44891
45384
  async function stopLifecycleSystemServiceRuntime(input) {
44892
- const restoreAutostartOnDrainFailure = input.inventory.serviceManagerStatus?.enabled === true;
44893
- await input.serviceManager.disableAutostart();
45385
+ const restoreAutostartOnDrainFailure = await disableDaemonServiceAutostartIfConfigured({
45386
+ manager: input.serviceManager,
45387
+ status: input.inventory.serviceManagerStatus
45388
+ });
44894
45389
  let drained = false;
44895
45390
  try {
44896
45391
  drained = hasActiveLifecycleRuntimeEvidence(input.inventory) && !input.forceKillAfterDrainTimeout && await requestControlledSystemServiceDrain({
@@ -46150,15 +46645,10 @@ function normalize$1(value) {
46150
46645
  function resolvePublicAgentFailureReason(input) {
46151
46646
  const errorCode = normalizeOptionalText$3$2(input.errorCode)?.toLowerCase();
46152
46647
  const mappedReason = resolveMappedPublicAgentFailureReason(input.errorCode, input.targetLabel);
46153
- const detailedReason = resolveDetailedPublicAgentFailureReason(input.errorMessage);
46154
46648
  if (shouldPreferMappedPublicAgentFailureReason(errorCode, input.errorMessage)) return mappedReason ?? normalizeOptionalText$3$2(input.defaultReason);
46155
- if (detailedReason) return detailedReason;
46156
46649
  if (!errorCode) return normalizeOptionalText$3$2(input.defaultReason);
46157
46650
  return mappedReason ?? normalizeOptionalText$3$2(input.defaultReason);
46158
46651
  }
46159
- function resolveDetailedPublicAgentFailureReason(errorMessage) {
46160
- return resolveDetailedPublicAgentFailureReason$1(errorMessage);
46161
- }
46162
46652
  function normalizeOptionalText$3$2(value) {
46163
46653
  const normalized = typeof value === "string" ? value.trim() : "";
46164
46654
  return normalized.length > 0 ? normalized : null;
@@ -55150,6 +55640,7 @@ function projectAgentControllerInterfaceForCloud(snapshot) {
55150
55640
  skills: [],
55151
55641
  status: snapshot.status,
55152
55642
  ...snapshot.usageLimits ? { usageLimits: snapshot.usageLimits.map((limit) => ({ ...limit })) } : {},
55643
+ usageLimitsSupportMatrixVersion: 1,
55153
55644
  version: snapshot.version,
55154
55645
  ...snapshot.versionAdvisory ? { versionAdvisory: {
55155
55646
  checkedAt: snapshot.versionAdvisory.checkedAt,
@@ -55554,7 +56045,7 @@ async function submitAgentControllerReportsWithCompatibilityRetry(input) {
55554
56045
  let compatibilityError = error;
55555
56046
  if (shouldRetryWithoutUsageLimits({
55556
56047
  error,
55557
- requestedReports: input.requestedReports
56048
+ submittedReports: input.initialInput.reports
55558
56049
  })) {
55559
56050
  warnDaemonEvent("[openmeld.runtime_reporting.usage_limits_downgraded]", {
55560
56051
  error: toErrorMessage$16(error),
@@ -55588,8 +56079,8 @@ function omitUsageLimitsFromReports(input) {
55588
56079
  return {
55589
56080
  ...input,
55590
56081
  reports: input.reports.map((report) => {
55591
- if (!report.agentControllerInterface?.usageLimits) return report;
55592
- const { usageLimits: _usageLimits, ...agentControllerInterface } = report.agentControllerInterface;
56082
+ if (!(report.agentControllerInterface?.usageLimits || report.agentControllerInterface?.usageLimitsSupportMatrixVersion)) return report;
56083
+ const { usageLimits: _usageLimits, usageLimitsSupportMatrixVersion: _usageLimitsSupportMatrixVersion, ...agentControllerInterface } = report.agentControllerInterface;
55593
56084
  return {
55594
56085
  ...report,
55595
56086
  agentControllerInterface
@@ -55598,7 +56089,7 @@ function omitUsageLimitsFromReports(input) {
55598
56089
  };
55599
56090
  }
55600
56091
  function shouldRetryWithoutUsageLimits(input) {
55601
- if (!input.requestedReports.some((report) => report.agentControllerInterface?.usageLimits)) return false;
56092
+ if (!input.submittedReports.some((report) => report.agentControllerInterface?.usageLimits || report.agentControllerInterface?.usageLimitsSupportMatrixVersion)) return false;
55602
56093
  const failure = toStructuredApiClientFailure(input.error);
55603
56094
  if (failure.status !== 400) return false;
55604
56095
  return collectCompatibilityDiagnosticText(failure).includes("usagelimits");
@@ -59052,6 +59543,7 @@ function sendDispatchLifecycleFrame(input) {
59052
59543
  leaseEpoch: input.leaseEpoch,
59053
59544
  phase: input.phase,
59054
59545
  lifecycleAtMs: Date.now(),
59546
+ ...input.agentControllerConversationOccupancy === void 0 || input.agentControllerConversationOccupancy === null ? {} : { agentControllerConversationOccupancy: input.agentControllerConversationOccupancy },
59055
59547
  ...input.localQueue === void 0 || input.localQueue === null ? {} : { localQueue: input.localQueue }
59056
59548
  });
59057
59549
  if (!lifecycleRequest.success) throw new DaemonServiceRunError({
@@ -69943,6 +70435,7 @@ const resolveStructuredActionRequirementFailure = resolveStructuredActionRequire
69943
70435
  const CLI_SPACE_ACTION_RECORD_POLL_INTERVAL_MS = 25;
69944
70436
  const CLI_SPACE_ACTION_RECORD_RUNTIME_COMPLETION_GRACE_MS = 1500;
69945
70437
  const CLI_SPACE_ACTION_PROVIDER_CONVERSATION_GRACE_MS = 1500;
70438
+ const AGENT_CONTROLLER_OCCUPANCY_KEEPALIVE_REASSERT_INTERVALS = 4;
69946
70439
  function enqueueDispatchDeliverFrame(input) {
69947
70440
  const currentSocketRef = input.currentSocketRef ?? {
69948
70441
  connectionGeneration: normalizePositiveInteger(input.payload.connectionGeneration),
@@ -70812,6 +71305,43 @@ async function handleDispatchDeliverFrame(input) {
70812
71305
  };
70813
71306
  let agentToolActivitySequence = 0;
70814
71307
  let usageObservationAuthPromise = null;
71308
+ const syncAgentControllerConversationOccupancyLifecycle = (event) => {
71309
+ if (event.phase !== "agent_controller_conversation_available" && event.phase !== "agent_controller_conversation_occupied") return;
71310
+ const occupancy = {
71311
+ agentControllerConversationId: event.agentControllerConversationId,
71312
+ contractVersion: event.contractVersion,
71313
+ state: event.phase === "agent_controller_conversation_occupied" ? "occupied" : "available"
71314
+ };
71315
+ stopRunningKeepalive?.();
71316
+ emitDispatchLifecycleTransition({
71317
+ agentControllerConversationOccupancy: occupancy,
71318
+ attemptId: parsedTask.attemptId,
71319
+ connectionGeneration: input.deliverRequest.connectionGeneration,
71320
+ currentSocketRef,
71321
+ daemonSessionId: input.daemonSessionId,
71322
+ dispatchId: parsedTask.dispatchId,
71323
+ leaseEpoch: input.deliverRequest.leaseEpoch,
71324
+ phase: "running",
71325
+ presenter: input.presenter,
71326
+ executionTokenEcho: parsedTask.executionTokenEcho,
71327
+ runtimeCoordinatorExecutionId: parsedTask.runtimeCoordinatorExecutionId,
71328
+ taskId: parsedTask.taskId
71329
+ });
71330
+ stopRunningKeepalive = startDispatchLifecycleKeepalive({
71331
+ agentControllerConversationOccupancy: occupancy,
71332
+ attemptId: parsedTask.attemptId,
71333
+ connectionGeneration: input.deliverRequest.connectionGeneration,
71334
+ currentSocketRef,
71335
+ daemonSessionId: input.daemonSessionId,
71336
+ dispatchId: parsedTask.dispatchId,
71337
+ leaseEpoch: input.deliverRequest.leaseEpoch,
71338
+ phase: "running",
71339
+ presenter: input.presenter,
71340
+ executionTokenEcho: parsedTask.executionTokenEcho,
71341
+ runtimeCoordinatorExecutionId: parsedTask.runtimeCoordinatorExecutionId,
71342
+ taskId: parsedTask.taskId
71343
+ });
71344
+ };
70815
71345
  const runtimeExecutionPromise = Promise.resolve(runDispatchRuntimeExecution({
70816
71346
  computerFileAccessBoundary,
70817
71347
  contextId: contextIdForDispatch,
@@ -70833,6 +71363,7 @@ async function handleDispatchDeliverFrame(input) {
70833
71363
  });
70834
71364
  },
70835
71365
  onRuntimeEvent: (event) => {
71366
+ syncAgentControllerConversationOccupancyLifecycle(event);
70836
71367
  if (event.phase === "tool_activity") {
70837
71368
  agentToolActivitySequence += 1;
70838
71369
  emitDispatchAgentToolActivityFrame({
@@ -73329,6 +73860,7 @@ function toRuntimeTransportDispatchLocalQueueDiagnostics(input) {
73329
73860
  function emitDispatchLifecycleTransition(input) {
73330
73861
  try {
73331
73862
  sendCurrentDispatchLifecycleFrame({
73863
+ agentControllerConversationOccupancy: input.agentControllerConversationOccupancy ?? null,
73332
73864
  attemptId: input.attemptId,
73333
73865
  connectionGeneration: input.connectionGeneration,
73334
73866
  currentSocketRef: input.currentSocketRef,
@@ -73400,9 +73932,19 @@ function emitDispatchLifecycleTransition(input) {
73400
73932
  });
73401
73933
  }
73402
73934
  function startDispatchLifecycleKeepalive(input) {
73935
+ let intervalCount = 0;
73936
+ let lastOccupancyConnectionGeneration = null;
73403
73937
  const intervalId = setInterval(() => {
73404
73938
  try {
73939
+ const currentConnectionGeneration = resolveCurrentConnectionGeneration({
73940
+ currentSocketRef: input.currentSocketRef,
73941
+ fallbackConnectionGeneration: input.connectionGeneration
73942
+ });
73943
+ const shouldReassertOccupancy = Boolean(input.agentControllerConversationOccupancy && (intervalCount % AGENT_CONTROLLER_OCCUPANCY_KEEPALIVE_REASSERT_INTERVALS === 0 || lastOccupancyConnectionGeneration !== currentConnectionGeneration));
73944
+ intervalCount += 1;
73945
+ if (shouldReassertOccupancy) lastOccupancyConnectionGeneration = currentConnectionGeneration;
73405
73946
  sendCurrentDispatchLifecycleFrame({
73947
+ agentControllerConversationOccupancy: shouldReassertOccupancy ? input.agentControllerConversationOccupancy ?? null : null,
73406
73948
  attemptId: input.attemptId,
73407
73949
  connectionGeneration: input.connectionGeneration,
73408
73950
  currentSocketRef: input.currentSocketRef,
@@ -73434,6 +73976,7 @@ function startDispatchLifecycleKeepalive(input) {
73434
73976
  }
73435
73977
  function sendCurrentDispatchLifecycleFrame(input) {
73436
73978
  sendDispatchLifecycleFrame({
73979
+ agentControllerConversationOccupancy: input.agentControllerConversationOccupancy ?? null,
73437
73980
  attemptId: input.attemptId,
73438
73981
  connectionGeneration: resolveCurrentConnectionGeneration({
73439
73982
  currentSocketRef: input.currentSocketRef,
@@ -75830,10 +76373,17 @@ async function resolveDaemonServiceOwnerContext(input) {
75830
76373
  persistSelection: false
75831
76374
  }).catch(() => null);
75832
76375
  if (fallbackProfile) return resolveDaemonServiceOwnerContextFromProfile(fallbackProfile, "resolved OpenMeld profile is missing owner user id");
75833
- if (authState?.state !== "valid" || authSession === null) throw new DaemonServiceRunError({
75834
- code: "daemon.run.auth_required",
75835
- message: "authentication required before starting OpenMeld Service"
75836
- });
76376
+ if (authState?.state !== "valid" || authSession === null) {
76377
+ console.warn("[openmeld.daemon.owner_auth_not_ready]", {
76378
+ error: authState?.errorMessage,
76379
+ reasonCode: authState?.reasonCode ?? "session_state_unavailable",
76380
+ state: authState?.state ?? "unavailable"
76381
+ });
76382
+ throw new DaemonServiceRunError({
76383
+ code: "daemon.run.auth_required",
76384
+ message: "authentication required before starting OpenMeld Service"
76385
+ });
76386
+ }
75837
76387
  throw new DaemonServiceRunError({
75838
76388
  code: "daemon.run.owner_missing",
75839
76389
  message: "authenticated session is missing user id and no OpenMeld profile could be resolved"
@@ -79978,8 +80528,10 @@ async function stopManagedCurrentLaneDaemonService(input) {
79978
80528
  async function prepareManagedDaemonServiceForStop(input) {
79979
80529
  const serviceManager = input.ownerSnapshot.serviceManager;
79980
80530
  if (!serviceManager) return null;
79981
- const shouldRestoreAutostart = input.ownerSnapshot.serviceManagerStatus?.enabled === true;
79982
- await serviceManager.disableAutostart();
80531
+ const shouldRestoreAutostart = await disableDaemonServiceAutostartIfConfigured({
80532
+ manager: serviceManager,
80533
+ status: input.ownerSnapshot.serviceManagerStatus
80534
+ });
79983
80535
  if (input.force === true) return null;
79984
80536
  try {
79985
80537
  const shutdown = await requestLocalDaemonShutdown({
@@ -81457,17 +82009,27 @@ async function runDaemonStatusFlow(input) {
81457
82009
  return "completed";
81458
82010
  }
81459
82011
  async function resolveDaemonRunAuthReadiness(input) {
81460
- const authState = await Promise.resolve(getAuthSessionState({ validateRemote: false })).catch(() => null);
82012
+ const authState = await Promise.resolve(getAuthSessionState({ validateRemote: false })).catch((error) => {
82013
+ console.warn("[openmeld.service.auth_session_read_failed]", { error: toErrorMessage$43(error) });
82014
+ return null;
82015
+ });
81461
82016
  const session = authState?.session ?? null;
81462
- if (authState?.state !== "valid" || !session) return {
81463
- ready: false,
81464
- reason: "authentication_required",
81465
- guidance: resolveAuthenticationGuidance({
81466
- reason: "required",
81467
- action: "starting OpenMeld Service"
81468
- }),
81469
- nextSteps: [formatInlineOpenMeldCliCommands("Run `openmeld login` in an interactive terminal."), formatInlineOpenMeldCliCommands("After sign-in succeeds, run `openmeld service start` again.")]
81470
- };
82017
+ if (authState?.state !== "valid" || !session) {
82018
+ console.warn("[openmeld.service.auth_session_not_ready]", {
82019
+ error: authState?.errorMessage,
82020
+ reasonCode: authState?.reasonCode ?? "session_state_unavailable",
82021
+ state: authState?.state ?? "unavailable"
82022
+ });
82023
+ return {
82024
+ ready: false,
82025
+ reason: "authentication_required",
82026
+ guidance: resolveAuthenticationGuidance({
82027
+ reason: "required",
82028
+ action: "starting OpenMeld Service"
82029
+ }),
82030
+ nextSteps: [formatInlineOpenMeldCliCommands("Run `openmeld login` in an interactive terminal."), formatInlineOpenMeldCliCommands("After sign-in succeeds, run `openmeld service start` again.")]
82031
+ };
82032
+ }
81471
82033
  const resolvedGatewayUrl = await resolveBaseUrlOrNull(input.gatewayUrl);
81472
82034
  if (resolvedGatewayUrl && !canAttachAuthTokenToRequest(session, resolvedGatewayUrl)) {
81473
82035
  const authBaseUrl = String(session.authBaseUrl ?? "").trim();
@@ -110296,4 +110858,4 @@ function isHumanInteractiveSpaceRuntime(runtime) {
110296
110858
  //#endregion
110297
110859
  export { runAgentsManage as $, LocalProjectConnectionError as $a, resetCurrentCommandCheckState as $i, isCliUpdateCheckApplicable as $n, cliJsonOutputEnvelopeSchema as $o, resolveServiceReadinessFromServiceStatus as $r, ensureLocalSkills as $t, parseEnvelope as A, resolveViewProfileKey as Aa, getAgentControllerPermissionModeFieldLabel as Ai, submitProfileRuntimeAgentControllerReport as An, enqueueAgentActivityHookEvent as Ao, registerSpaceMemberSelectionOptions as Ar, createDelayedSpinner as At, resolveHumanControllerDisplayName as B, updateOpenMeldProfile as Ba, buildOnboardingPlan as Bi, buildDispatchResultMessageReadProjection as Bn, setDefaultProjectConnection as Bo, buildDualViewGuideMessage as Br, toStructuredGatewayFailure as Bt, toSpaceMetaUpsertInput as C, buildHumanErrorCopy as Ca, reconcileNewRunnableBuiltinAgentsForSetup as Ci, resolveCreateProfileName as Cn, upsertDaemonServiceContract as Co, createSpaceTargetGuideError as Cr, runDaemonStop as Ct, formatHumanReadTargetList as D, formatMessage as Da, buildAgentControllerRef as Di, resolveServiceParticipationReadiness as Dn, resolveObservedAgentActivityBinding as Do, createUpgradeConfirmationGuideError as Dr, buildProfileWorkspaceRows as Dt, buildHumanReplyContextSummary as E, createPresenter as Ea, resolveLocalRegistryAgentIdFromAgentControllerRef as Ei, formatServiceParticipationReadinessLabel as En, buildAgentActivityEvent as Eo, createStartAuthenticationGuideError as Er, buildProfileWorkspacePresentation as Et, resolveOpenMeldProfileForSpaceCommand as F, createOpenMeldHumanProfile as Fa, resolveAgentProfileEditCapabilities as Fi, resolveLocalAgentControllerLaunchability as Fn, listProjectBindings as Fo, registerAuthLoginRequestOptions as Fr, createCliSpaceApi as Ft, runAgentsCustomAdd as G, buildAgentAuthenticationGuide as Ga, classifyDaemonServiceWakeability as Gi, buildUpdatesReplyWorkflowProjection as Gn, renderInfoCard as Go, buildAgentFacingPublicationModeGuideLines as Gr, runDaemonServiceParticipationGate as Gt, resolveAgentProfileSetup as H, clearSelectedOpenMeldProfileId as Ha, buildDaemonServiceTargetSpec as Hi, buildSignalIndex as Hn, canonicalizeLocalProjectPath as Ho, OPENMELD_AGENT_MENTAL_MODEL_LINES as Hr, resolveLocalComponentsStatus as Ht, emitSpaceAgentOverview as I, deleteOpenMeldProfile as Ia, resolveEvidenceSyncHealth as Ii, resolveLocalAgentControllerReportDecision as In, listProjectConnectionsWithStatus as Io, registerBuiltinAgentSelectionOptions as Ir, fetchSpaceMeta as It, runAgentsCustomUpdate as J, resolveAuthenticationGuidance as Ja, resolveOpenMeldEnvironmentTarget as Ji, promptSearchMultiselect as Jn, emitCliJsonEnvelope as Jo, runPendingDaemonServiceUpdate as Jr, runSkillsCheck as Jt, runAgentsCustomList as K, buildHumanAuthenticationCard as Ka, resolveServiceUpdateUrgency as Ki, createSpaceMemberIdentityIndex as Kn, renderTextInfoCard as Ko, canonicalizeAllowedActions as Kr, runDaemonStartDecisionPrompt as Kt, emitSpaceCliAgentOverview as L, listOpenMeldProfiles as La, resolveNativeAgentControllerPermissionModeForController as Li, inspectSpaceCacheFile as Ln, migrateProjectBindingStore as Lo, buildAgentOverviewFromContract as Lr, updateSpaceMeta as Lt, assertFullSignalIdArgument as M, requireOpenMeldProfile as Ma, parseAgentControllerRef as Mi, submitRuntimeAgentControllerReports as Mn, readAgentActivityOutboxHealth as Mo, registerSkillsTargetSelectionOptions as Mr, runDaemonStartupPreflight as Mt, assertValidSpaceIdTarget as N, resolveOpenMeldProfileOrNull as Na, resolveAgentControllerPermissionModeForController as Ni, collectLocalAgentControllerInventory as Nn, removeProjectOutbox as No, getCliVersionInfo as Nr, readDaemonStartFailureLogTailLines as Nt, resolveLinkAccessLabel as O, parseCliViewMode as Oa, createAgentExecutionStatusDisplayRows as Oi, assessActionParticipationCandidate as On, normalizeSharedSessionTitle as Oo, getCommandEntryContract as Or, reconcileCliVersionView as Ot, prepareAuthenticatedSpaceCommandContext as P, createOpenMeldAgentProfile as Pa, resolveAgentExecutionStatus as Pi, resolveLocalAgentControllerBlockerReasonCodes as Pn, bindProject as Po, registerDaemonControlTargetOptions as Pr, fetchSpaceUpdates as Pt, runAgentsList as Q, setProfileDefaultView as Qa, isCurrentCommandCheckScopeActive as Qi, assessCliUpdate as Qn, cliBinaryDeltaPatchSchema as Qo, formatDaemonFailureContextText as Qr, runSkillsUpdate as Qt, prepareLocalAgentReadiness as R, primeOpenMeldProfilesSessionCache as Ra, PREPARE_SESSION_RECONNECT_GRACE_MS as Ri, upsertSpaceConfig as Rn, removeProjectConnection as Ro, DualViewGuideError as Rr, readGatewayJsonResponse as Rt, loadSpaceSignalIndexOrNull as S, OPENMELD_VERSION as Sa, listAgentTargetStates as Si, resolveCreateProfileKind as Sn, readDaemonServiceContract as So, createSpaceSubcommandTargetGuideError as Sr, runDaemonStatusFlow as St, buildFormalSignalReadPayload as T, renderHumanTextErrorCard as Ta, notifyDaemonRouteCatalogChanged as Ti, ensureAgentProfileRuntimeBinding as Tn, removeAgentActivityContextCache as To, createStartAgentIdentityGuideError as Tr, runDaemonUninstall as Tt, runAgents as U, getSelectedOpenMeldProfileId as Ua, resolveDaemonServiceAlignmentDecision as Ui, buildSignalMessageReadProjection as Un, enqueueControllerTaskLifecycleEventWhileLocked as Uo, SPACE_CONTRACT_ALLOWED_ACTION_ORDER as Ur, writeInstalledLocalComponentsSnapshot as Ut, persistAgentTransportSelection as V, alignSelectedOpenMeldProfileStorage as Va, getSetupFlowCopy as Vi, buildDispatchResultReplyWorkflowProjection as Vn, unbindProject as Vo, formatAgentOverviewPayload as Vr, parseJsonResponse$1 as Vt, runAgentsConfig as W, setSelectedOpenMeldProfileId as Wa, classifyDaemonServiceRunStartability as Wi, buildSpaceRoundReadProjection as Wn, readControllerTaskLifecycleOutboxHealth as Wo, areAllowedActionsEquivalent as Wr, resolveDaemonServiceParticipationStatus as Wt, runAgentsDisable as X, resolveAuthenticationGuidanceFromMessage as Xa, finishCurrentCommandCheckScope as Xi, isReturnKeypress as Xn, outJsonLine as Xo, ensureDaemonRuntimePaths as Xr, runSkillsInstall as Xt, runAgentsDetect as Y, resolveAuthenticationGuidanceFromError as Ya, resolveAuthBaseUrl as Yi, promptSearchSelect as Yn, errLine as Yo, scheduleDaemonServiceUpdate as Yr, runSkillsEnsure as Yt, runAgentsEnable as Z, getProfileDefaultView as Za, getCurrentCommandCheckState as Zi, runInteractivePrompt as Zn, outLine as Zo, resolveDaemonDeviceId as Zr, runSkillsUninstall as Zt, runSpaceWriteWithPasswordRetry as _, readVersionState as _a, validateCustomProfileWorkspacePath as _i, requestDeviceToken as _n, formatOpenMeldCliTextBlock as _o, createSpaceLeaveGuideError as _r, runDaemonInstall as _t, runSpaceDelete as a, getDaemonSystemServiceLogPath as aa, mapAgentReplyReadinessToLegacyAutoReply as ai, ensureCommandAuthenticationOrCancel as an, resolveAgentActivityRouteForPath as ao, resolveElapsedTimeMs as ar, revokeOrganizationJoinLinkResponseSchema as as, printOpenMeldBanner as at, buildIdentityOnlyMembersSnapshotForReadProjection as b, toStartBackgroundHelperExecutionCompatibility as ba, createPrimaryBindingReadSession as bi, revokeAuthAccessToken as bn, resolveUserFacingCliEntryCommand as bo, createSpaceRemoveMembersGuideError as br, runDaemonRunAfterEntryChecks as bt, runSpaceLeave as c, resolveDaemonServiceManager as ca, syncProfileWorkspaceState as ci, runAuthLogout as cn, defaultManagedIntegrationPaths as co, canUseInteractivePrompts as cr, renderOpenMeldLogo as ct, runSpaceRemoveMembers as d, performManagedInstall as da, ensureOpenMeldManagedProfileWorkspace as di, exchangeOneTimeTokenAuthSession as dn, resolveAgentActivityDispatcherCommand as do, createProfileCreateGuideError as dr, resolveSpaceSendText as dt, startCurrentCommandCheckScope as ea, resolveDaemonServiceFreshnessWarning as ei, readBundledOpenMeldCliSkillDocumentByPath as en, validateLocalProjectConnectionPath as eo, assertDispatchOwnedRuntimePublicWriteAllowed as er, cliJsonSkillsListEnvelopeSchema as es, runAgentsRepair as et, runSpaceSend as f, buildNextVersionState as fa, normalizeCustomProfileWorkspacePath as fi, buildAuthStatusRows as fn, uninstallAgentActivityIntegrations as fo, createProfileMenuGuideError as fr, bestEffortStopCurrentLaneDaemonService as ft, runSpaceReadWithPasswordRetry as g, fetchLatestPackageInfo as ga, setOpenMeldManagedProfileWorkspace as gi, fetchAuthUserSnapshot as gn, formatOpenMeldCliLine as go, createSpaceContractSetGuideError as gr, runDaemonCancel as gt, uploadPreparedSpaceFiles as h, fetchLatestCliBinaryRelease as ha, setCustomProfileWorkspace as hi, extractAuthApiErrorMessage as hn, formatOpenMeldCliCommands as ho, createSpaceAliasTargetGuideError as hr, runDaemonBackgroundStartForDecision as ht, runSpaceCreate as i, readCurrentObservedDaemonRuntimeStatus as ia, formatHumanReplyReadinessReason as ii, buildCommandAuthenticationPromptMessage as in, registerAgentActivityRoute as io, formatElapsedTime as ir, organizationJoinLinkErrorResponseSchema as is, colorizeDisplayProfileLabel as it, isSpaceCommandOutputHandledError as j, isSelectedOpenMeldProfileRequiredError as ja, listAgentControllerPermissionModeOptions as ji, submitRuntimeAgentControllerReport as jn, removeProjectInbox as jo, SPACE_ADD_MEMBERS_PROGRESS_HEARTBEAT_MS as jr, shouldEmitAgentOverview as jt, resolveOrganizationVisibilityLabel as k, resolveRuntimeContext as ka, getAgentControllerPermissionModeDisplayMetadata as ki, computeRetryDelayMs as kn, readCodexSessionTitles as ko, getCommandHintsFromContract as kr, emitDaemonAgentOverview as kt, runSpaceList as l, readRecentDaemonLifecycleEvents as la, createModelCatalogReadSession as li, runAuthMenu as ln, installAgentActivityIntegrations as lo, createDoctorFailedGuideError as lr, renderOpenMeldTagline as lt, prepareRequestedSpaceSendFiles as m, ensureVersionStateReady as ma, resolveConfiguredProfileWorkspacePath as mi, formatActiveOrganizationLabel as mn, formatOpenMeldCliCommand as mo, createSpaceAddMembersGuideError as mr, runDaemonAutostart as mt, promptAndConfirmSpacePassword as n, resolveVersionChangeDirection as na, formatAgentReplyReadinessLabel as ni, readRecentDaemonDispatchJournalEvents as nn, requestLocalAgentActivitySync as no, readDispatchSpaceActionContextFromEnv as nr, cliJsonSkillsShowEnvelopeSchema as ns, formatTransportModeDisplay as nt, runSpaceHistory as o, isDaemonServiceJobNeverSpawned as oa, resolveGatewayChainReadiness as oi, evaluateCommandAuthentication as on, unregisterAgentActivityRoute as oo, formatDaemonServiceDowngradeBlockedRecommendation as or, compareAgentControllerRefsForDisplay as os, renderOpenMeldBrandBlockLines as ot, runSpaceWatch as p, compareSemver as pa, readProfileWorkspaceConfig as pi, buildAuthStatusSnapshot as pn, formatInlineOpenMeldCliCommands as po, createResetConfirmationGuideError as pr, runDaemon as pt, runAgentsCustomRemove as q, createAuthenticationError as qa, assessServerRequiredVersion as qi, formatRemovedCcRelationMessage as qn, sanitizeTerminalDisplayText as qo, readOpenMeldToolsUpdateContextFromEnv as qr, collectSkillsReadinessSnapshot as qt, runSpaceAddMembers as r, readCurrentDaemonRuntimeContext as ra, formatDeviceReplyReadinessLabel as ri, connectWebSocket as rn, isAgentActivityRouteRegistered as ro, writeDispatchSpaceActionRecord as rr, getOrganizationJoinLinkResponseSchema as rs, colorizeAgentLabel as rt, runSpaceJoin as s, readDaemonServiceJobCrashExitCode as sa, resolveOpenClawLocalDiagnosticsValue as si, runAuthLogin as sn, AGENT_ACTIVITY_INTEGRATION_OWNER as so, formatDaemonServiceMissingRecommendation as sr, renderOpenMeldHeader as st, buildCreateSpacePasswordPromptConfig as t, inspectDaemonServiceInventory as ta, resolveCurrentReplyReadinessSnapshot as ti, readRuntimeReportingHealthState as tn, LocalDaemonControlPlaneClientError as to, readDispatchOwnedRuntimeGuard as tr, cliJsonSkillsLoadEnvelopeSchema as ts, runAgentsShow as tt, runSpacePassword as u, buildInstallSelfJsonPayload as ua, resolveProfileWorkspaceRuntime as ui, runAuthStatus as un, readAgentActivityIntegrationStatus as uo, createProfileActionGuideError as ur, resolveGatewayWebOrigin as ut, buildHumanReadSignalsTranscriptItems as v, writeVersionState as va, describeProfileWorkspacePathValidationFailure as vi, resolveDeviceAuthClientId as vn, formatProfileAwareOpenMeldCliCommands as vo, createSpaceMenuGuideError as vr, runDaemonInterrupt as vt, buildFormalDispatchResultReadPayload as w, renderHumanErrorCard as wa, listBuiltinAgentsRegistryEntries as wi, promptTextEntry as wn, readAgentActivityContextForPath as wo, createSpaceUpdatesGuideError as wr, runDaemonTeardownStrict as wt, loadSpaceIdentityDirectoryOrNull as x, resolveCurrentDaemonExpectedVersion as xa, resolveAgentProfilePrimaryAgentControllerReport as xi, createProfileByKind as xn, syncLocalAgentActivity as xo, createSpaceResultGuideError as xr, runDaemonSnapshot as xt, emitHumanReadSignalsTextProjection as y, resolveDaemonRuntimeContractCompatibility as ya, syncDeviceRuntimeStateProjection as yi, resolveDeviceTokenExpiresAt as yn, resolveSetupFollowUpCliEntryCommand as yo, createSpacePublicationSetGuideError as yr, runDaemonReinstall as yt, buildReplyReadinessGuidance as z, resolveOpenMeldProfile as za, buildDaemonRouteObservationPresentation as zi, assertNoRemovedCcSpaceAddressingSyntax as zn, runIfAgentActivityBindingGenerationIsCurrent as zo, formatDualViewGuideForDisplay as zr, readGatewayTextResponse as zt };
110298
110860
 
110299
- //# sourceMappingURL=command-CTQlQSYV.js.map
110861
+ //# sourceMappingURL=command-BGqFPMwd.js.map