openmeld 0.3.131 → 0.3.133

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-BnHChh7U.js";
5
- import { $r as profileWorkspaceModeSchema, $t as skippedDaemonProfileSchema, A as runtimeTransportRegisterSessionResponseSchema, An as AGENT_INTERACTION_DEFAULT_TIMEOUT_MS, B as openMeldDaemonTaskResultPayloadSchema, Bn as localCliComponentUpdateProjectionSchema, Bt as resolveSpaceFileMimeType, C as runtimeTransportLocalAgentControlRefreshCatalogFramePayloadSchema, D as runtimeTransportOpenMeldToolsControlFramePayloadSchema, E as runtimeTransportLookupRouteOwnerServiceEvidenceSchema, Fn as formatLocalComponentsSummaryDescription, Fr as resolveSpaceMentionLabels, G as localFolderPickerDaemonFrameSchema, Gr as openMeldRequestContextSchema, H as openMeldSpaceEgressActionSchema, I as runtimeTransportSubmitTaskResultRequestSchema, In as formatLocalComponentsSummaryLabel, Jn as openMeldToolsUpdateOperationPhaseSchema, Jr as normalizeOptionalWorkingDirectory, K as localFolderPickerHelperProtocolResultSchema, Kr as MAX_PROFILE_WORKING_DIRECTORY_LENGTH, Ln as formatLocalSetupActionDescription, M as runtimeTransportResumeControllerConversationFramePayloadSchema, Mn as agentInteractionRequestSchema, Mr as normalizeSpacePasswordText, N as runtimeTransportResumeControllerConversationResultFramePayloadSchema, Nn as agentInteractionResolutionSchema, O as runtimeTransportOpenMeldToolsControlResultFramePayloadSchema, Or as runtimeCoordinatorExecutionTokenEnvelopeSchema, P as runtimeTransportRouteCatalogChangedFramePayloadSchema, Pr as resolveSingleSpaceMentionLabels, Pt as SPACE_FILE_MAX_SIZE_BYTES, R as openMeldDaemonTaskResultEnvelopeWriteSchema, Rn as formatLocalSetupActionLabel, S as runtimeTransportLocalAgentControlManageInstallationFramePayloadSchema, Sn as resolveMessageEnvelopeTargetField, T as runtimeTransportLocalAgentControlSetProfileWorkspaceFramePayloadSchema, U as LOCAL_FOLDER_PICKER_RUNTIME_CAPABILITY, W as OPENMELD_LOCAL_FOLDER_PICKER_CAPABILITY_HEADER, Wn as localServiceComponentUpdateProjectionSchema, Wt as spaceFileNameSchema, Xt as openMeldDaemonControlPlaneRequestSchema, Yr as openMeldRuntimeProfileIdSchema, Zn as openMeldToolsUpdateRequestSourceSchema, Zt as openMeldDaemonControlPlaneResponseSchema, _ as runtimeTransportHeartbeatRequestSchema, _n as collectCanonicalMentionTextFragments, a as runtimeTransportCapabilitiesSchema, ai as MAX_TEXT_LENGTH$1, b as runtimeTransportLocalAgentControlForkSessionFramePayloadSchema, br as url, c as runtimeTransportDispatchInteractionRequestSchema, ci as resolvePublicAgentAvailabilityCopy, d as runtimeTransportDispatchPreviewEndRequestSchema, di as shouldPreferMappedPublicAgentFailureReason, en as providerDispatchRuntimeContextSchema, er as boolean, f as runtimeTransportDispatchPreviewRequestSchema, g as runtimeTransportForkAgentSessionResultSchema, gn as MESSAGE_MENTION_TYPE_VALUES, gt as SPACE_MENTION_REJECT_NOTICE_PURPOSE, h as runtimeTransportErrorCodeSchema, hi as resolveCommandAgentWorkActivity, hr as string, ht as SPACE_MEMBER_REMOVE_NOTICE_PURPOSE, i as localWakeRouteReportSchema, ii as trimmedStringFromUnknown, ir as enumFactory, j as runtimeTransportRejectedProfileRegistrationSchema, k as runtimeTransportRegisterSessionRequestSchema, kr as runtimeTransportDeliveryExecutionIdentitySchema, l as runtimeTransportDispatchInteractionResponseFramePayloadSchema, li as resolvePublicAgentFailureRecovery, m as runtimeTransportDispatchToolActivityRequestSchema, mr as strictObject, mt as SPACE_MEMBER_JOIN_NOTICE_PURPOSE, n as daemonExecutionCompatibilitySchema, nr as discriminatedUnion, o as runtimeTransportDeliverDispatchRequestSchema, oi as resolveDetailedPublicAgentFailureReason$1, or as iso, p as runtimeTransportDispatchRuntimeEvidenceRequestSchema, q as localFolderPickerHelperResultSchema, qn as openMeldToolsUpdateAttemptSchema, qr as agentProfileIdSchema, r as daemonStreamFrameSchema, s as runtimeTransportDispatchInteractionDeliveredRequestSchema, si as resolveMappedPublicAgentFailureReason, sr as literal, t as CURRENT_DAEMON_EXECUTION_CONTRACT_EPOCH, tn as conversationExecutionStateSchema, u as runtimeTransportDispatchLifecycleRequestSchema, ui as sanitizeDispatchErrorSummary, ut as CONVERSATION_CONTINUITY_WARNING_PURPOSE, v as runtimeTransportHeartbeatResponseSchema, vn as formatCanonicalMentionLiteral, vt as sanitizeSignalTextPreview, w as runtimeTransportLocalAgentControlSetEnabledFramePayloadSchema, wr as parseOptionalClientMessageId, x as runtimeTransportLocalAgentControlInterruptFramePayloadSchema, xn as normalizeMessageEnvelope, y as runtimeTransportLocalAgentControlCancelFramePayloadSchema, yn as getSpaceMessageAddressingRelationSupportForTargetKind, z as openMeldDaemonTaskResultOpenClawGatewayVisibilityStatusSchema, zn as installedLocalComponentsSnapshotSchema } from "./runtime-transport-CHbXitKu.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-xeL9hjwh.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-C_9yu9UB.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 MAX_HEARTBEAT_INTERVAL_MS$2, B as RUNTIME_AGENT_CONTROLLER_REPORT_SYNC_RETRY_INTERVAL_MS$1, C as DAEMON_STREAM_CONNECT_TIMEOUT_MS$1, D as DEFAULT_HEARTBEAT_INTERVAL_MS$1, E as DEFAULT_GATEWAY_CHAIN_TIMEOUT_MS$1, F as PROVIDER_CONVERSATION_PROOF_SYNC_INTERVAL_MS$1, I as PROVIDER_CONVERSATION_PROOF_SYNC_RETRY_INTERVAL_MS$1, L as REGISTER_RESPONSE_TIMEOUT_MS$1, M as MIN_HEARTBEAT_INTERVAL_MS$2, P as OPENCLAW_CLI_TIMEOUT_MS$1, S as DAEMON_RUNTIME_CONTRACT_EPOCH$1, T as DAEMON_STREAM_KEEPALIVE_PONG_TIMEOUT_MS$1, V as RUNTIME_STATE_PERSIST_MIN_INTERVAL_MS$1, _ as isBinaryDistribution, a as clearAuthSession, b as CATALOG_SYNC_RETRY_INTERVAL_MS$1, c as getAuthSessionState, i as beginAuthSessionTransition, k as HEARTBEAT_RESPONSE_TIMEOUT_MS$1, m as setAuthSession, n as assertAuthSessionMutationAvailable, v as resolveOpenMeldDistribution, w as DAEMON_STREAM_KEEPALIVE_INTERVAL_MS$1, x as CATALOG_SYNC_SIGNAL_POLL_INTERVAL_MS$1, z as RUNTIME_AGENT_CONTROLLER_REPORT_SYNC_INTERVAL_MS$1 } from "./auth-session-BDvmoUjQ.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-DD1YOgfr.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-JRLGSU3U.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-DAqpgdEd.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";
@@ -6669,17 +6669,8 @@ const extractProviderAccessEvidence = (error) => {
6669
6669
  if (!error || typeof error !== "object") return null;
6670
6670
  const evidence = error.providerAccessEvidence;
6671
6671
  if (!evidence || typeof evidence !== "object") return null;
6672
- const candidate = evidence;
6673
- if (candidate.provider !== "claude-code" || candidate.source !== "wake_failure") return null;
6674
- if (candidate.reasonCode !== "provider_account.organization_access_disabled" && candidate.reasonCode !== "provider_account.subscription_access_unavailable") return null;
6675
- const observedAtMs = candidate.observedAtMs;
6676
- if (typeof observedAtMs !== "number" || !Number.isInteger(observedAtMs) || observedAtMs < 0) return null;
6677
- return {
6678
- observedAtMs,
6679
- provider: candidate.provider,
6680
- reasonCode: candidate.reasonCode,
6681
- source: candidate.source
6682
- };
6672
+ const parsed = openMeldDaemonProviderAccessEvidenceSchema.safeParse(evidence);
6673
+ return parsed.success ? parsed.data : null;
6683
6674
  };
6684
6675
  const normalizeControlReason = (reason, fallback) => {
6685
6676
  if (typeof reason !== "string") return fallback;
@@ -8785,12 +8776,18 @@ const normalizeOptionalText$62 = (value) => {
8785
8776
  function isCodexQuotaFailure(value) {
8786
8777
  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");
8787
8778
  }
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
+ }
8788
8782
  function isCodexRateLimitFailure(value) {
8789
8783
  return value.includes("429") || value.includes("rate limit") || value.includes("too many requests");
8790
8784
  }
8791
8785
  function isCodexAuthFailure(value) {
8792
8786
  return value.includes("401") || value.includes("unauthorized") || value.includes("missing bearer") || value.includes("not logged in") || value.includes("authentication");
8793
8787
  }
8788
+ function isCodexSubscriptionAccessFailure(value) {
8789
+ return value.includes("not included in your subscription") || value.includes("not available on your plan") || value.includes("subscription does not include") || value.includes("subscription access") || value.includes("upgrade your plan");
8790
+ }
8794
8791
  /**
8795
8792
  * Classify a Codex provider-account failure from the failure message and, when
8796
8793
  * available, the app-server structured `codexErrorInfo` enum. Only enum values
@@ -8799,25 +8796,45 @@ function isCodexAuthFailure(value) {
8799
8796
  * changes behavior.
8800
8797
  */
8801
8798
  function classifyCodexProviderAccountFailure(input) {
8802
- if (normalizeOptionalText$61(input.codexErrorInfo)?.toLowerCase() === "usagelimitexceeded") return {
8799
+ if (normalizeOptionalText$61(input.codexErrorInfo)?.toLowerCase() === "usagelimitexceeded") return buildHardProviderFailure({
8803
8800
  code: "quota.exceeded",
8804
- errorType: "adapter"
8805
- };
8801
+ reasonCode: "provider_account.capacity_exhausted"
8802
+ });
8806
8803
  const lowered = input.message.toLowerCase();
8807
- if (isCodexQuotaFailure(lowered)) return {
8804
+ if (isDefinitiveCodexCapacityFailure(lowered)) return buildHardProviderFailure({
8808
8805
  code: "quota.exceeded",
8806
+ reasonCode: "provider_account.capacity_exhausted"
8807
+ });
8808
+ if (isCodexRateLimitFailure(lowered)) return {
8809
+ code: "rate_limited",
8809
8810
  errorType: "adapter"
8810
8811
  };
8812
+ if (isCodexSubscriptionAccessFailure(lowered)) return buildHardProviderFailure({
8813
+ code: "provider.subscription_access_unavailable",
8814
+ reasonCode: "provider_account.subscription_access_unavailable"
8815
+ });
8816
+ if (isCodexQuotaFailure(lowered)) return buildHardProviderFailure({
8817
+ code: "quota.exceeded",
8818
+ reasonCode: "provider_account.capacity_exhausted"
8819
+ });
8811
8820
  if (isCodexAuthFailure(lowered)) return {
8812
8821
  code: "auth.required",
8813
8822
  errorType: "auth"
8814
8823
  };
8815
- if (isCodexRateLimitFailure(lowered)) return {
8816
- code: "rate_limited",
8817
- errorType: "adapter"
8818
- };
8819
8824
  return null;
8820
8825
  }
8826
+ function buildHardProviderFailure(input) {
8827
+ return {
8828
+ code: input.code,
8829
+ errorType: "adapter",
8830
+ providerAccessEvidence: {
8831
+ observedAtMs: Date.now(),
8832
+ provider: "codex",
8833
+ reasonCode: input.reasonCode,
8834
+ source: "wake_failure"
8835
+ }
8836
+ };
8837
+ }
8821
8838
  function normalizeOptionalText$61(value) {
8822
8839
  const normalized = String(value ?? "").trim();
8823
8840
  return normalized.length > 0 ? normalized : null;
@@ -9179,11 +9196,13 @@ const DEFAULT_APP_SERVER_STARTUP_TIMEOUT_MS = 15e3;
9179
9196
  var CodexAppServerTransportError = class extends Error {
9180
9197
  code;
9181
9198
  errorType;
9199
+ providerAccessEvidence;
9182
9200
  constructor(input) {
9183
9201
  super(input.message);
9184
9202
  this.name = "CodexAppServerTransportError";
9185
9203
  this.code = input.code;
9186
9204
  this.errorType = input.errorType;
9205
+ this.providerAccessEvidence = input.providerAccessEvidence;
9187
9206
  }
9188
9207
  };
9189
9208
  async function probeCodexAppServerAccount(input) {
@@ -9327,7 +9346,8 @@ function requireSuccessfulCodexTurn(turn) {
9327
9346
  if (providerFailure) throw new CodexAppServerTransportError({
9328
9347
  code: providerFailure.code,
9329
9348
  errorType: providerFailure.errorType,
9330
- message: failureMessage
9349
+ message: failureMessage,
9350
+ providerAccessEvidence: providerFailure.providerAccessEvidence
9331
9351
  });
9332
9352
  throw new CodexAppServerTransportError({
9333
9353
  code: "runtime.turn.failed",
@@ -10648,7 +10668,8 @@ function toJsonRpcTransportError$1(error) {
10648
10668
  if (providerFailure) return new CodexAppServerTransportError({
10649
10669
  code: providerFailure.code,
10650
10670
  errorType: providerFailure.errorType,
10651
- message
10671
+ message,
10672
+ providerAccessEvidence: providerFailure.providerAccessEvidence
10652
10673
  });
10653
10674
  const lowered = message.toLowerCase();
10654
10675
  if (lowered.includes("not logged in") || lowered.includes("unauthorized") || lowered.includes("authentication") || lowered.includes("401")) return new CodexAppServerTransportError({
@@ -10972,11 +10993,13 @@ function normalizeOptionalText$57(value) {
10972
10993
  var CodexCliTransportError = class extends Error {
10973
10994
  code;
10974
10995
  errorType;
10996
+ providerAccessEvidence;
10975
10997
  constructor(input) {
10976
10998
  super(input.message);
10977
10999
  this.name = "CodexCliTransportError";
10978
11000
  this.code = input.code;
10979
11001
  this.errorType = input.errorType;
11002
+ this.providerAccessEvidence = input.providerAccessEvidence;
10980
11003
  }
10981
11004
  };
10982
11005
  async function invokeCodexCliTransport(input) {
@@ -11068,7 +11091,8 @@ async function invokeCodexCliTransport(input) {
11068
11091
  throw new CodexCliTransportError({
11069
11092
  code: classifiedFailure.code,
11070
11093
  errorType: classifiedFailure.errorType,
11071
- message: classifiedFailure.message
11094
+ message: classifiedFailure.message,
11095
+ providerAccessEvidence: classifiedFailure.providerAccessEvidence
11072
11096
  });
11073
11097
  }
11074
11098
  const output = normalizeOptionalText$56(latestOutput);
@@ -11082,7 +11106,8 @@ async function invokeCodexCliTransport(input) {
11082
11106
  throw new CodexCliTransportError({
11083
11107
  code: classifiedFailure.code,
11084
11108
  errorType: classifiedFailure.errorType,
11085
- message: classifiedFailure.message
11109
+ message: classifiedFailure.message,
11110
+ providerAccessEvidence: classifiedFailure.providerAccessEvidence
11086
11111
  });
11087
11112
  }
11088
11113
  throw new CodexCliTransportError({
@@ -11288,7 +11313,8 @@ const toCodexCliTransportError = (error, timeoutMs) => {
11288
11313
  return new CodexCliTransportError({
11289
11314
  code: classifiedFailure.code,
11290
11315
  errorType: classifiedFailure.errorType,
11291
- message: classifiedFailure.message
11316
+ message: classifiedFailure.message,
11317
+ providerAccessEvidence: classifiedFailure.providerAccessEvidence
11292
11318
  });
11293
11319
  }
11294
11320
  }
@@ -11337,19 +11363,9 @@ const classifyCodexFailure = (input) => {
11337
11363
  errorType: "config",
11338
11364
  message: toControllerClientUpgradeRequiredMessage(providerMessage)
11339
11365
  };
11340
- if (isCodexQuotaFailure(lowered)) return {
11341
- code: "quota.exceeded",
11342
- errorType: "adapter",
11343
- message: providerMessage
11344
- };
11345
- if (isCodexAuthFailure(lowered)) return {
11346
- code: "auth.required",
11347
- errorType: "auth",
11348
- message: providerMessage
11349
- };
11350
- if (isCodexRateLimitFailure(lowered)) return {
11351
- code: "rate_limited",
11352
- errorType: "adapter",
11366
+ const providerFailure = classifyCodexProviderAccountFailure({ message: providerMessage });
11367
+ if (providerFailure) return {
11368
+ ...providerFailure,
11353
11369
  message: providerMessage
11354
11370
  };
11355
11371
  if (isConfigFailure(lowered)) return {
@@ -11377,7 +11393,7 @@ const resolveProviderFailureMessage$2 = (input) => {
11377
11393
  };
11378
11394
  const looksLikeProviderFailure$2 = (value) => {
11379
11395
  const normalized = value.toLowerCase();
11380
- return looksLikeRuntimePermissionDenialMessage(value) || isCodexAuthFailure(normalized) || isCodexQuotaFailure(normalized) || isCodexRateLimitFailure(normalized);
11396
+ return looksLikeRuntimePermissionDenialMessage(value) || classifyCodexProviderAccountFailure({ message: normalized }) !== null;
11381
11397
  };
11382
11398
  const isConfigFailure = (value) => {
11383
11399
  return value.includes("model_not_found") || value.includes("requested model") || value.includes("unknown model") || value.includes("invalid model") || value.includes("does not exist") && value.includes("model") || value.includes("invalid_request_error") && value.includes("model") || value.includes("\"param\": \"model\"");
@@ -11403,11 +11419,13 @@ function normalizeOptionalText$56(value) {
11403
11419
  var CodexRuntimeError = class extends Error {
11404
11420
  code;
11405
11421
  errorType;
11422
+ providerAccessEvidence;
11406
11423
  constructor(input) {
11407
11424
  super(input.message);
11408
11425
  this.name = "CodexRuntimeError";
11409
11426
  this.code = input.code;
11410
11427
  this.errorType = input.errorType;
11428
+ this.providerAccessEvidence = input.providerAccessEvidence;
11411
11429
  }
11412
11430
  };
11413
11431
  async function invokeCodexWithSingleContextHeal(input) {
@@ -11515,7 +11533,8 @@ function toCodexRuntimeError(error) {
11515
11533
  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({
11516
11534
  code: error.code,
11517
11535
  errorType: error.errorType,
11518
- message: error.message
11536
+ message: error.message,
11537
+ providerAccessEvidence: error.providerAccessEvidence
11519
11538
  });
11520
11539
  return new CodexRuntimeError({
11521
11540
  code: "upstream_unreachable",
@@ -13332,17 +13351,36 @@ function classifyOpenCodeFailureMessage(input) {
13332
13351
  if (isInsufficientBalanceFailure(lowered)) return {
13333
13352
  code: "provider.insufficient_balance",
13334
13353
  errorType: "adapter",
13335
- message: `provider.insufficient_balance: ${normalized}`
13354
+ message: `provider.insufficient_balance: ${normalized}`,
13355
+ providerAccessEvidence: buildProviderAccessEvidence("provider_account.capacity_exhausted")
13356
+ };
13357
+ if (isDefinitiveHardQuotaFailure(lowered)) return {
13358
+ code: "quota.exceeded",
13359
+ errorType: "adapter",
13360
+ message: `quota.exceeded: ${normalized}`,
13361
+ providerAccessEvidence: buildProviderAccessEvidence("provider_account.capacity_exhausted")
13362
+ };
13363
+ if (isTransientRateLimitFailure(lowered)) return {
13364
+ code: "provider.rate_limited",
13365
+ errorType: "network",
13366
+ message: `provider.rate_limited: ${normalized}`
13367
+ };
13368
+ if (isSubscriptionAccessFailure(lowered)) return {
13369
+ code: "provider.subscription_access_unavailable",
13370
+ errorType: "adapter",
13371
+ message: `provider.subscription_access_unavailable: ${normalized}`,
13372
+ providerAccessEvidence: buildProviderAccessEvidence("provider_account.subscription_access_unavailable")
13336
13373
  };
13337
13374
  if (isProviderUnavailableFailure(lowered)) return {
13338
13375
  code: "provider.unavailable",
13339
13376
  errorType: "network",
13340
13377
  message: `provider.unavailable: ${normalized}`
13341
13378
  };
13342
- if (lowered.includes("rate") || lowered.includes("quota")) return {
13343
- code: "provider.rate_limited",
13344
- errorType: "network",
13345
- message: `provider.rate_limited: ${normalized}`
13379
+ if (isHardQuotaFailure(lowered)) return {
13380
+ code: "quota.exceeded",
13381
+ errorType: "adapter",
13382
+ message: `quota.exceeded: ${normalized}`,
13383
+ providerAccessEvidence: buildProviderAccessEvidence("provider_account.capacity_exhausted")
13346
13384
  };
13347
13385
  return {
13348
13386
  code: "upstream_unreachable",
@@ -13350,6 +13388,26 @@ function classifyOpenCodeFailureMessage(input) {
13350
13388
  message: `upstream_unreachable: ${normalized}`
13351
13389
  };
13352
13390
  }
13391
+ function buildProviderAccessEvidence(reasonCode) {
13392
+ return {
13393
+ observedAtMs: Date.now(),
13394
+ provider: "opencode",
13395
+ reasonCode,
13396
+ source: "wake_failure"
13397
+ };
13398
+ }
13399
+ function isHardQuotaFailure(value) {
13400
+ return isDefinitiveHardQuotaFailure(value) || value.includes("usage limit") || value.includes("usage_limit");
13401
+ }
13402
+ function isDefinitiveHardQuotaFailure(value) {
13403
+ return value.includes("insufficient quota") || value.includes("insufficient_quota") || value.includes("quota exceeded") || value.includes("exceeded your current quota");
13404
+ }
13405
+ function isSubscriptionAccessFailure(value) {
13406
+ return value.includes("not included in your subscription") || value.includes("not available on your plan") || value.includes("subscription does not include") || value.includes("subscription access") || value.includes("upgrade your plan");
13407
+ }
13408
+ function isTransientRateLimitFailure(value) {
13409
+ return value.includes("429") || value.includes("rate limit") || value.includes("too many requests");
13410
+ }
13353
13411
  function isInsufficientBalanceFailure(value) {
13354
13412
  return value.includes("insufficient balance") || value.includes("insufficient_balance") || value.includes("not enough credits") || value.includes("out of credits") || value.includes("credits exhausted") || value.includes("credit balance") || value.includes("account balance") || value.includes("balance is too low") || value.includes("payment required");
13355
13413
  }
@@ -13361,11 +13419,13 @@ function isProviderUnavailableFailure(value) {
13361
13419
  var OpenCodeCliTransportError = class extends Error {
13362
13420
  code;
13363
13421
  errorType;
13422
+ providerAccessEvidence;
13364
13423
  constructor(input) {
13365
13424
  super(input.message);
13366
13425
  this.name = "OpenCodeCliTransportError";
13367
13426
  this.code = input.code;
13368
13427
  this.errorType = input.errorType;
13428
+ this.providerAccessEvidence = input.providerAccessEvidence;
13369
13429
  }
13370
13430
  };
13371
13431
  const STREAMING_PROVIDER_FAILURE_THRESHOLD = 3;
@@ -13453,7 +13513,8 @@ async function invokeOpenCodeCliTransport(input) {
13453
13513
  throw new OpenCodeCliTransportError({
13454
13514
  code: classifiedFailure.code,
13455
13515
  errorType: classifiedFailure.errorType,
13456
- message: classifiedFailure.message
13516
+ message: classifiedFailure.message,
13517
+ providerAccessEvidence: classifiedFailure.providerAccessEvidence
13457
13518
  });
13458
13519
  }
13459
13520
  if (driverResult.exitCode !== 0 || latestResultIsError) {
@@ -13465,7 +13526,8 @@ async function invokeOpenCodeCliTransport(input) {
13465
13526
  throw new OpenCodeCliTransportError({
13466
13527
  code: classifiedFailure.code,
13467
13528
  errorType: classifiedFailure.errorType,
13468
- message: classifiedFailure.message
13529
+ message: classifiedFailure.message,
13530
+ providerAccessEvidence: classifiedFailure.providerAccessEvidence
13469
13531
  });
13470
13532
  }
13471
13533
  const documentParsed = parseOpenCodeOutputDocument(driverResult.stdoutText);
@@ -13482,7 +13544,8 @@ async function invokeOpenCodeCliTransport(input) {
13482
13544
  throw new OpenCodeCliTransportError({
13483
13545
  code: classifiedFailure.code,
13484
13546
  errorType: classifiedFailure.errorType,
13485
- message: classifiedFailure.message
13547
+ message: classifiedFailure.message,
13548
+ providerAccessEvidence: classifiedFailure.providerAccessEvidence
13486
13549
  });
13487
13550
  }
13488
13551
  }
@@ -13497,7 +13560,8 @@ async function invokeOpenCodeCliTransport(input) {
13497
13560
  throw new OpenCodeCliTransportError({
13498
13561
  code: classifiedFailure.code,
13499
13562
  errorType: classifiedFailure.errorType,
13500
- message: classifiedFailure.message
13563
+ message: classifiedFailure.message,
13564
+ providerAccessEvidence: classifiedFailure.providerAccessEvidence
13501
13565
  });
13502
13566
  }
13503
13567
  throw new OpenCodeCliTransportError({
@@ -13571,7 +13635,8 @@ const toOpenCodeCliTransportError = (error, timeoutMs) => {
13571
13635
  return new OpenCodeCliTransportError({
13572
13636
  code: classifiedFailure.code,
13573
13637
  errorType: classifiedFailure.errorType,
13574
- message: classifiedFailure.message
13638
+ message: classifiedFailure.message,
13639
+ providerAccessEvidence: classifiedFailure.providerAccessEvidence
13575
13640
  });
13576
13641
  }
13577
13642
  }
@@ -13824,11 +13889,13 @@ const SERVER_READY_LINE_PATTERN = /^opencode server listening on (https?:\/\/[^\
13824
13889
  var OpenCodeServerTransportError = class extends Error {
13825
13890
  code;
13826
13891
  errorType;
13892
+ providerAccessEvidence;
13827
13893
  constructor(input) {
13828
13894
  super(input.message);
13829
13895
  this.name = "OpenCodeServerTransportError";
13830
13896
  this.code = input.code;
13831
13897
  this.errorType = input.errorType;
13898
+ this.providerAccessEvidence = input.providerAccessEvidence;
13832
13899
  }
13833
13900
  };
13834
13901
  async function invokeOpenCodeServerTransport(input) {
@@ -14778,11 +14845,13 @@ function formatStderrSuffix(stderr) {
14778
14845
  var OpenCodeRuntimeError = class extends Error {
14779
14846
  code;
14780
14847
  errorType;
14848
+ providerAccessEvidence;
14781
14849
  constructor(input) {
14782
14850
  super(input.message);
14783
14851
  this.name = "OpenCodeRuntimeError";
14784
14852
  this.code = input.code;
14785
14853
  this.errorType = input.errorType;
14854
+ this.providerAccessEvidence = input.providerAccessEvidence;
14786
14855
  }
14787
14856
  };
14788
14857
  async function invokeOpenCodeWithSingleContextHeal(input) {
@@ -14858,7 +14927,8 @@ async function invokeOpenCodeOnce(input) {
14858
14927
  if (error && typeof error === "object" && "code" in error && typeof error.code === "string" && "errorType" in error && typeof error.errorType === "string" && error instanceof Error) throw new OpenCodeRuntimeError({
14859
14928
  code: error.code,
14860
14929
  errorType: error.errorType,
14861
- message: error.message
14930
+ message: error.message,
14931
+ providerAccessEvidence: error.providerAccessEvidence
14862
14932
  });
14863
14933
  throw new OpenCodeRuntimeError({
14864
14934
  code: "upstream_unreachable",
@@ -17977,7 +18047,7 @@ function resolveOpenMeldAccountContext(input) {
17977
18047
  };
17978
18048
  }
17979
18049
  async function resolveCurrentOpenMeldAccountContext() {
17980
- const { getAuthSessionMetadata } = await import("./auth-session-BDvmoUjQ.js").then((n) => n.r);
18050
+ const { getAuthSessionMetadata } = await import("./auth-session-JRLGSU3U.js").then((n) => n.i);
17981
18051
  return resolveOpenMeldAccountContext({ session: await getAuthSessionMetadata().catch(() => null) });
17982
18052
  }
17983
18053
  function resolveHostKey(baseUrl) {
@@ -19518,7 +19588,7 @@ function splitSentences(message) {
19518
19588
  var package_default = {
19519
19589
  $schema: "https://www.schemastore.org/package.json",
19520
19590
  name: "openmeld",
19521
- version: "0.3.131",
19591
+ version: "0.3.133",
19522
19592
  openMeldReleaseDate: "2026-08-29",
19523
19593
  description: "OpenMeld CLI - https://openmeld.ai",
19524
19594
  license: "MIT",
@@ -20050,6 +20120,7 @@ function toStartBackgroundHelperExecutionCompatibility(input) {
20050
20120
  //#endregion
20051
20121
  //#region src/config/daemon-service-update-worker-registration.ts
20052
20122
  const MANAGED_VERSION_FROM_EXECUTABLE_PATTERN = /[\\/]versions[\\/](v?(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?)[\\/]openmeld(?:\.exe)?/gu;
20123
+ const SELF_CONTAINED_BUNDLE_FROM_EXECUTABLE_PATTERN = /[\\/]runtime[\\/]daemon[\\/]bundles[\\/]([0-9A-Za-z._-]+)[\\/]/gu;
20053
20124
  function resolveDaemonServiceUpdateWorkerIdentity(pathInput = {}) {
20054
20125
  const preset = resolveOpenMeldEnvPreset(pathInput);
20055
20126
  const suffix = preset === "prod" ? "" : `-${preset}`;
@@ -20073,14 +20144,13 @@ function resolveDaemonServiceUpdateWorkerWindowsScriptPath(pathInput = {}) {
20073
20144
  return join(daemonRuntimeRootPath(pathInput), "service-update-worker.bat");
20074
20145
  }
20075
20146
  async function readDaemonServiceUpdateWorkerProtectedManagedVersions(pathInput = {}, platform = process$1.platform) {
20076
- const registrationPath = resolveDaemonServiceUpdateWorkerRegistrationPath(pathInput, platform);
20077
- if (registrationPath === null) return /* @__PURE__ */ new Set();
20078
- const contents = await readFile(registrationPath, "utf8").catch((error) => {
20079
- if (getErrorCode$5(error) === "ENOENT") return null;
20080
- throw error;
20081
- });
20147
+ const contents = await readDaemonServiceUpdateWorkerRegistration(pathInput, platform);
20082
20148
  return contents === null ? /* @__PURE__ */ new Set() : readManagedVersionsFromUpdateWorkerRegistration(contents);
20083
20149
  }
20150
+ async function readDaemonServiceUpdateWorkerProtectedBundleIds(pathInput = {}, platform = process$1.platform) {
20151
+ const contents = await readDaemonServiceUpdateWorkerRegistration(pathInput, platform);
20152
+ return contents === null ? /* @__PURE__ */ new Set() : readBundleIdsFromUpdateWorkerRegistration(contents);
20153
+ }
20084
20154
  function readManagedVersionsFromUpdateWorkerRegistration(contents) {
20085
20155
  const versions = /* @__PURE__ */ new Set();
20086
20156
  for (const match of contents.matchAll(MANAGED_VERSION_FROM_EXECUTABLE_PATTERN)) {
@@ -20089,12 +20159,28 @@ function readManagedVersionsFromUpdateWorkerRegistration(contents) {
20089
20159
  }
20090
20160
  return versions;
20091
20161
  }
20162
+ function readBundleIdsFromUpdateWorkerRegistration(contents) {
20163
+ const bundleIds = /* @__PURE__ */ new Set();
20164
+ for (const match of contents.matchAll(SELF_CONTAINED_BUNDLE_FROM_EXECUTABLE_PATTERN)) {
20165
+ const bundleId = match[1];
20166
+ if (bundleId) bundleIds.add(bundleId);
20167
+ }
20168
+ return bundleIds;
20169
+ }
20092
20170
  function resolveDaemonServiceUpdateWorkerRegistrationPath(pathInput, platform) {
20093
20171
  if (platform === "darwin") return resolveDaemonServiceUpdateWorkerLaunchdPlistPath(pathInput);
20094
20172
  if (platform === "linux") return resolveDaemonServiceUpdateWorkerSystemdUnitPath(pathInput);
20095
20173
  if (platform === "win32") return resolveDaemonServiceUpdateWorkerWindowsScriptPath(pathInput);
20096
20174
  return null;
20097
20175
  }
20176
+ async function readDaemonServiceUpdateWorkerRegistration(pathInput, platform) {
20177
+ const registrationPath = resolveDaemonServiceUpdateWorkerRegistrationPath(pathInput, platform);
20178
+ if (registrationPath === null) return null;
20179
+ return await readFile(registrationPath, "utf8").catch((error) => {
20180
+ if (getErrorCode$5(error) === "ENOENT") return null;
20181
+ throw error;
20182
+ });
20183
+ }
20098
20184
  function getErrorCode$5(error) {
20099
20185
  return error && typeof error === "object" && "code" in error ? String(error.code) : null;
20100
20186
  }
@@ -20348,6 +20434,70 @@ function toErrorMessage$31(error) {
20348
20434
  return String(error);
20349
20435
  }
20350
20436
  //#endregion
20437
+ //#region src/local-service/lifecycle/daemon-service-update-state.ts
20438
+ const DAEMON_SERVICE_UPDATE_JOB_SCHEMA = OPENMELD_DAEMON_SERVICE_UPDATE_JOB_SCHEMA;
20439
+ function daemonServicePendingUpdatePath(pathInput = {}) {
20440
+ return join(daemonRuntimeStateRootPath(pathInput), "service-update.json");
20441
+ }
20442
+ function daemonServiceLastUpdatePath(pathInput = {}) {
20443
+ return join(daemonRuntimeStateRootPath(pathInput), "service-update-last.json");
20444
+ }
20445
+ async function readPendingDaemonServiceUpdate(pathInput = {}) {
20446
+ return await readDaemonServiceUpdateJob(daemonServicePendingUpdatePath(pathInput));
20447
+ }
20448
+ async function readLastDaemonServiceUpdate(pathInput = {}) {
20449
+ return await readDaemonServiceUpdateJob(daemonServiceLastUpdatePath(pathInput));
20450
+ }
20451
+ async function persistPendingDaemonServiceUpdate(job, pathInput = {}) {
20452
+ await writeUpdateJobAtomically({
20453
+ job,
20454
+ path: daemonServicePendingUpdatePath(pathInput)
20455
+ });
20456
+ }
20457
+ async function completePendingDaemonServiceUpdate(job, pathInput = {}) {
20458
+ await writeUpdateJobAtomically({
20459
+ job,
20460
+ path: daemonServiceLastUpdatePath(pathInput)
20461
+ });
20462
+ await rm(daemonServicePendingUpdatePath(pathInput), { force: true });
20463
+ }
20464
+ async function readDaemonServiceUpdateJob(path) {
20465
+ const raw = await readFile(path, "utf8").catch((error) => {
20466
+ if (error.code === "ENOENT") return null;
20467
+ throw error;
20468
+ });
20469
+ if (raw === null) return null;
20470
+ const parsed = storedDaemonServiceUpdateJobSchema.safeParse(JSON.parse(raw));
20471
+ if (!parsed.success) throw new Error("OpenMeld Service update state is invalid.");
20472
+ if (parsed.data.v === 2) return parsed.data;
20473
+ const { status, ...legacyJob } = parsed.data;
20474
+ return daemonServiceUpdateJobSchema.parse({
20475
+ ...legacyJob,
20476
+ v: 2,
20477
+ schema: DAEMON_SERVICE_UPDATE_JOB_SCHEMA,
20478
+ phase: migrateLegacyPhase(status),
20479
+ requestSource: "cli"
20480
+ });
20481
+ }
20482
+ function migrateLegacyPhase(status) {
20483
+ switch (status) {
20484
+ case "scheduled": return "waiting_for_work";
20485
+ case "running": return "updating";
20486
+ case "completed": return "updated";
20487
+ case "failed": return "needs_help";
20488
+ default: return status;
20489
+ }
20490
+ }
20491
+ async function writeUpdateJobAtomically(input) {
20492
+ const temporaryPath = `${input.path}.${String(process.pid)}.tmp`;
20493
+ await mkdir(dirname(input.path), { recursive: true });
20494
+ await writeFile(temporaryPath, `${JSON.stringify(input.job, null, 2)}\n`, {
20495
+ encoding: "utf8",
20496
+ mode: 384
20497
+ });
20498
+ await rename(temporaryPath, input.path);
20499
+ }
20500
+ //#endregion
20351
20501
  //#region src/local-components/managed-version-pruning.ts
20352
20502
  const MANAGED_VERSION_DIRECTORY_PATTERN = /^v?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-(?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*)(?:\.(?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*))*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;
20353
20503
  async function pruneManagedVersions(input) {
@@ -20401,9 +20551,12 @@ async function isUsableManagedBinary(target) {
20401
20551
  throw error;
20402
20552
  });
20403
20553
  }
20404
- async function readCurrentPointerVersion() {
20405
- const pointerPath = openMeldManagedBinaryPath();
20406
- const target = await readlink(pointerPath).catch(() => null);
20554
+ async function readCurrentPointerVersion(pathInput = {}) {
20555
+ const pointerPath = openMeldManagedBinaryPath(pathInput);
20556
+ const target = await readlink(pointerPath).catch((error) => {
20557
+ if (isErrorWithCode(error, "ENOENT") || isErrorWithCode(error, "EINVAL")) return null;
20558
+ throw error;
20559
+ });
20407
20560
  if (!target) return null;
20408
20561
  const resolved = path.isAbsolute(target) ? target : path.resolve(path.dirname(pointerPath), target);
20409
20562
  const version = path.basename(path.dirname(resolved));
@@ -20417,7 +20570,49 @@ async function readCurrentPointerVersion() {
20417
20570
  * atomically via a temp name + rename.
20418
20571
  */
20419
20572
  async function performManagedInstall(input) {
20420
- return await withManagedInstallLock(async () => performManagedInstallLocked(input));
20573
+ return await withManagedInstallTransaction(async () => performManagedInstallLocked(input));
20574
+ }
20575
+ async function withManagedInstallTransaction(run, pathInput = {}) {
20576
+ const startedAtMs = Date.now();
20577
+ for (;;) try {
20578
+ return await runWithHeldLock({
20579
+ lock: await acquireLock({
20580
+ openMeldProfileId: MANAGED_INSTALL_LOCK_PROFILE,
20581
+ key: MANAGED_INSTALL_LOCK_KEY,
20582
+ meta: { component: "managed_cli.install" },
20583
+ pathResolution: pathInput
20584
+ }),
20585
+ run,
20586
+ releaseContext: {
20587
+ component: "managed_cli.install",
20588
+ lockKey: MANAGED_INSTALL_LOCK_KEY,
20589
+ openMeldProfileId: MANAGED_INSTALL_LOCK_PROFILE
20590
+ }
20591
+ });
20592
+ } catch (error) {
20593
+ if (!isOpenMeldLockError(error) || isOpenMeldOrphanedLockError(error) || Date.now() - startedAtMs >= MANAGED_INSTALL_LOCK_TIMEOUT_MS) throw error;
20594
+ await setTimeout$1(MANAGED_INSTALL_LOCK_RETRY_DELAY_MS);
20595
+ }
20596
+ }
20597
+ /**
20598
+ * Prune managed CLI versions only while holding the install transaction lock.
20599
+ * The current pointer and every durable Service update target are re-read in
20600
+ * the lock, so cleanup cannot race an install or use a stale pending snapshot.
20601
+ */
20602
+ async function pruneManagedInstallVersions(input) {
20603
+ const pathInput = input.pathInput;
20604
+ assertNoPublishedProductionMutationDuringTests(pathInput, "managed CLI versions");
20605
+ await withManagedInstallTransaction(async () => {
20606
+ const currentVersion = await readCurrentPointerVersion(pathInput);
20607
+ if (currentVersion === null) return;
20608
+ const protectedVersions = await readManagedInstallProtectedVersions(pathInput);
20609
+ await pruneManagedVersions({
20610
+ currentVersion,
20611
+ pathInput,
20612
+ preferredRollbackVersion: input.preferredRollbackVersion,
20613
+ protectedVersions
20614
+ });
20615
+ }, pathInput);
20421
20616
  }
20422
20617
  async function performManagedInstallLocked(input) {
20423
20618
  const force = input?.force ?? false;
@@ -20426,7 +20621,7 @@ async function performManagedInstallLocked(input) {
20426
20621
  const currentPointerPath = openMeldManagedBinaryPath();
20427
20622
  const managedBinaryPath = openMeldManagedVersionBinaryPath(version);
20428
20623
  const previousVersion = await readCurrentPointerVersion();
20429
- const protectedVersions = await readDaemonServiceUpdateWorkerProtectedManagedVersions();
20624
+ const protectedVersions = await readManagedInstallProtectedVersions();
20430
20625
  const baseOutcome = {
20431
20626
  version,
20432
20627
  platform,
@@ -20472,26 +20667,10 @@ async function performManagedInstallLocked(input) {
20472
20667
  result: "installed"
20473
20668
  };
20474
20669
  }
20475
- async function withManagedInstallLock(run) {
20476
- const startedAtMs = Date.now();
20477
- for (;;) try {
20478
- return await runWithHeldLock({
20479
- lock: await acquireLock({
20480
- openMeldProfileId: MANAGED_INSTALL_LOCK_PROFILE,
20481
- key: MANAGED_INSTALL_LOCK_KEY,
20482
- meta: { component: "managed_cli.install" }
20483
- }),
20484
- run,
20485
- releaseContext: {
20486
- component: "managed_cli.install",
20487
- lockKey: MANAGED_INSTALL_LOCK_KEY,
20488
- openMeldProfileId: MANAGED_INSTALL_LOCK_PROFILE
20489
- }
20490
- });
20491
- } catch (error) {
20492
- if (!isOpenMeldLockError(error) || isOpenMeldOrphanedLockError(error) || Date.now() - startedAtMs >= MANAGED_INSTALL_LOCK_TIMEOUT_MS) throw error;
20493
- await setTimeout$1(MANAGED_INSTALL_LOCK_RETRY_DELAY_MS);
20494
- }
20670
+ async function readManagedInstallProtectedVersions(pathInput = {}) {
20671
+ const [protectedVersions, pendingServiceUpdate] = await Promise.all([readDaemonServiceUpdateWorkerProtectedManagedVersions(pathInput), readPendingDaemonServiceUpdate(pathInput)]);
20672
+ if (pendingServiceUpdate?.preparedBundle.bundleFormat === "binary_v1") protectedVersions.add(pendingServiceUpdate.preparedBundle.daemonVersion);
20673
+ return protectedVersions;
20495
20674
  }
20496
20675
  async function placeVersionedBinary(sourceBinary, version, managedBinaryPath) {
20497
20676
  await mkdir(openMeldManagedVersionDir(version), { recursive: true });
@@ -20825,8 +21004,8 @@ function isDaemonBundleSourceAllowedForLane(input) {
20825
21004
  if (input.sourceKind !== DAEMON_BUNDLE_SOURCE_KIND_WORKSPACE) return true;
20826
21005
  return resolveOpenMeldEnvPreset(input.pathInput) === "dev-local";
20827
21006
  }
20828
- async function readDaemonActiveBundleState() {
20829
- const raw = await readFile(daemonServiceActiveBundlePath(), "utf8").catch((error) => {
21007
+ async function readDaemonActiveBundleState(pathInput = {}) {
21008
+ const raw = await readFile(daemonServiceActiveBundlePath(pathInput), "utf8").catch((error) => {
20830
21009
  if (getErrorCode$3(error) === "ENOENT") return null;
20831
21010
  throw error;
20832
21011
  });
@@ -21247,15 +21426,19 @@ async function restoreDaemonActiveBundleStateSnapshot(snapshot, pathInput = {})
21247
21426
  });
21248
21427
  }
21249
21428
  async function cleanupInactiveDaemonServiceBundles(input = {}) {
21250
- const [active, serviceContract, runtimeLease] = await Promise.all([
21429
+ const [active, serviceContract, runtimeLease, registeredWorkerBundleIds, pendingUpdate] = await Promise.all([
21251
21430
  readDaemonActiveBundleState(),
21252
21431
  readDaemonServiceContract().catch(() => null),
21253
- readDaemonRuntimeLease().catch(() => null)
21432
+ readDaemonRuntimeLease().catch(() => null),
21433
+ readDaemonServiceUpdateWorkerProtectedBundleIds(),
21434
+ readPendingDaemonServiceUpdate()
21254
21435
  ]);
21255
21436
  const retain = /* @__PURE__ */ new Set([
21256
21437
  ...active ? [active.bundleId] : [],
21257
21438
  ...serviceContract?.bundleId ? [serviceContract.bundleId] : [],
21258
21439
  ...runtimeLease?.bundleId ? [runtimeLease.bundleId] : [],
21440
+ ...registeredWorkerBundleIds,
21441
+ ...pendingUpdate?.preparedBundle.bundleFormat === "self_contained_v1" ? [pendingUpdate.preparedBundle.bundleId] : [],
21259
21442
  ...input.retainBundleIds ?? []
21260
21443
  ]);
21261
21444
  const bundleEntries = await readDirectoryNames(daemonRuntimeBundlesPath());
@@ -38592,9 +38775,9 @@ function createModelCatalogReadSession(input) {
38592
38775
  async function readModelCatalogOnce(baseUrl) {
38593
38776
  try {
38594
38777
  const [apiClient, baseUrlModule, clientFoundationModule] = await Promise.all([
38595
- import("./dist-BnHChh7U.js").then((n) => n.w),
38778
+ import("./dist-xeL9hjwh.js").then((n) => n.w),
38596
38779
  import("./base-url-BtqW4aLS.js").then((n) => n.n),
38597
- import("./api-client-foundation-DD1YOgfr.js").then((n) => n.t)
38780
+ import("./api-client-foundation-DAqpgdEd.js").then((n) => n.t)
38598
38781
  ]);
38599
38782
  if (typeof apiClient.createConfigApi !== "function") throw new Error("config api client is unavailable");
38600
38783
  const resolvedBaseUrl = baseUrl ?? await baseUrlModule.resolveBaseUrl();
@@ -45250,78 +45433,16 @@ async function writeLifecycleEvidenceEvent(input) {
45250
45433
  }, null, 2)}\n`, "utf8").catch(() => void 0);
45251
45434
  }
45252
45435
  //#endregion
45253
- //#region src/local-service/lifecycle/daemon-service-update-state.ts
45254
- const DAEMON_SERVICE_UPDATE_JOB_SCHEMA = OPENMELD_DAEMON_SERVICE_UPDATE_JOB_SCHEMA;
45255
- function daemonServicePendingUpdatePath(pathInput = {}) {
45256
- return join(daemonRuntimeStateRootPath(pathInput), "service-update.json");
45257
- }
45258
- function daemonServiceLastUpdatePath(pathInput = {}) {
45259
- return join(daemonRuntimeStateRootPath(pathInput), "service-update-last.json");
45260
- }
45261
- async function readPendingDaemonServiceUpdate(pathInput = {}) {
45262
- return await readDaemonServiceUpdateJob(daemonServicePendingUpdatePath(pathInput));
45263
- }
45264
- async function readLastDaemonServiceUpdate(pathInput = {}) {
45265
- return await readDaemonServiceUpdateJob(daemonServiceLastUpdatePath(pathInput));
45266
- }
45267
- async function persistPendingDaemonServiceUpdate(job, pathInput = {}) {
45268
- await writeUpdateJobAtomically({
45269
- job,
45270
- path: daemonServicePendingUpdatePath(pathInput)
45271
- });
45272
- }
45273
- async function completePendingDaemonServiceUpdate(job, pathInput = {}) {
45274
- await writeUpdateJobAtomically({
45275
- job,
45276
- path: daemonServiceLastUpdatePath(pathInput)
45277
- });
45278
- await rm(daemonServicePendingUpdatePath(pathInput), { force: true });
45279
- }
45280
- async function readDaemonServiceUpdateJob(path) {
45281
- const raw = await readFile(path, "utf8").catch((error) => {
45282
- if (error.code === "ENOENT") return null;
45283
- throw error;
45284
- });
45285
- if (raw === null) return null;
45286
- const parsed = storedDaemonServiceUpdateJobSchema.safeParse(JSON.parse(raw));
45287
- if (!parsed.success) throw new Error("OpenMeld Service update state is invalid.");
45288
- if (parsed.data.v === 2) return parsed.data;
45289
- const { status, ...legacyJob } = parsed.data;
45290
- return daemonServiceUpdateJobSchema.parse({
45291
- ...legacyJob,
45292
- v: 2,
45293
- schema: DAEMON_SERVICE_UPDATE_JOB_SCHEMA,
45294
- phase: migrateLegacyPhase(status),
45295
- requestSource: "cli"
45296
- });
45297
- }
45298
- function migrateLegacyPhase(status) {
45299
- switch (status) {
45300
- case "scheduled": return "waiting_for_work";
45301
- case "running": return "updating";
45302
- case "completed": return "updated";
45303
- case "failed": return "needs_help";
45304
- default: return status;
45305
- }
45306
- }
45307
- async function writeUpdateJobAtomically(input) {
45308
- const temporaryPath = `${input.path}.${String(process.pid)}.tmp`;
45309
- await mkdir(dirname(input.path), { recursive: true });
45310
- await writeFile(temporaryPath, `${JSON.stringify(input.job, null, 2)}\n`, {
45311
- encoding: "utf8",
45312
- mode: 384
45313
- });
45314
- await rename(temporaryPath, input.path);
45315
- }
45316
- //#endregion
45317
45436
  //#region src/local-service/lifecycle/daemon-service-update-worker-manager.ts
45318
45437
  const UPDATE_WORKER_RESTART_BACKOFF_SECONDS = 30;
45319
45438
  const WINDOWS_SERVICE_ALREADY_RUNNING_PATTERN = /already running|1056/i;
45320
45439
  const SYSTEMD_QUOTING_PATTERN = /[\s"\\]/u;
45321
45440
  async function installDaemonServiceUpdateWorker(job, pathInput = {}) {
45441
+ await prepareDaemonServiceUpdateWorkerCarrier(job, pathInput);
45442
+ await registerDaemonServiceUpdateWorker(job, pathInput);
45443
+ }
45444
+ async function registerDaemonServiceUpdateWorker(job, pathInput = {}) {
45322
45445
  assertSafePublishedProductionServiceRegistrationMutation("install the OpenMeld Service update worker for", pathInput);
45323
- const previousActiveBundle = job.preparedBundle.bundleFormat === "binary_v1" ? await readDaemonActiveBundleState().catch(() => null) : null;
45324
- if (job.preparedBundle.bundleFormat === "binary_v1") await ensureDaemonServiceUpdateWorkerBinaryExecutable(job.preparedBundle, pathInput);
45325
45446
  const spec = await buildDaemonServiceUpdateWorkerSpec(job, pathInput);
45326
45447
  const identity = resolveDaemonServiceUpdateWorkerIdentity(pathInput);
45327
45448
  if (process$1.platform === "darwin") {
@@ -45354,11 +45475,6 @@ async function installDaemonServiceUpdateWorker(job, pathInput = {}) {
45354
45475
  command: "launchctl",
45355
45476
  args: ["enable", serviceKey]
45356
45477
  });
45357
- await pruneVersionsAfterStableWorkerRegistration({
45358
- job,
45359
- pathInput,
45360
- previousActiveVersion: previousActiveBundle?.daemonVersion ?? null
45361
- });
45362
45478
  return;
45363
45479
  }
45364
45480
  if (process$1.platform === "linux") {
@@ -45388,11 +45504,6 @@ async function installDaemonServiceUpdateWorker(job, pathInput = {}) {
45388
45504
  `${identity.serviceName}.path`
45389
45505
  ]
45390
45506
  });
45391
- await pruneVersionsAfterStableWorkerRegistration({
45392
- job,
45393
- pathInput,
45394
- previousActiveVersion: previousActiveBundle?.daemonVersion ?? null
45395
- });
45396
45507
  return;
45397
45508
  }
45398
45509
  if (process$1.platform === "win32") {
@@ -45429,15 +45540,20 @@ async function installDaemonServiceUpdateWorker(job, pathInput = {}) {
45429
45540
  "restart/30000/restart/30000/restart/30000"
45430
45541
  ]
45431
45542
  });
45432
- await pruneVersionsAfterStableWorkerRegistration({
45433
- job,
45434
- pathInput,
45435
- previousActiveVersion: previousActiveBundle?.daemonVersion ?? null
45436
- });
45437
45543
  return;
45438
45544
  }
45439
45545
  throw new Error(`OpenMeld cannot install its background update worker on ${process$1.platform}.`);
45440
45546
  }
45547
+ async function prepareDaemonServiceUpdateWorkerCarrier(job, pathInput = {}) {
45548
+ if (job.preparedBundle.bundleFormat === "binary_v1") await ensureDaemonServiceUpdateWorkerBinaryExecutable(job.preparedBundle, pathInput);
45549
+ }
45550
+ async function pruneDaemonServiceUpdateWorkerManagedVersions(job, pathInput = {}) {
45551
+ if (job.preparedBundle.bundleFormat !== "binary_v1") return;
45552
+ await pruneManagedInstallVersions({
45553
+ pathInput,
45554
+ preferredRollbackVersion: (await readDaemonActiveBundleState(pathInput))?.daemonVersion ?? null
45555
+ });
45556
+ }
45441
45557
  async function startDaemonServiceUpdateWorker(_job, pathInput = {}) {
45442
45558
  assertSafePublishedProductionServiceRegistrationMutation("start the OpenMeld Service update worker for", pathInput);
45443
45559
  const identity = resolveDaemonServiceUpdateWorkerIdentity(pathInput);
@@ -45613,14 +45729,6 @@ WantedBy=default.target
45613
45729
  function resolveUpdateWorkerLogPath(pathInput) {
45614
45730
  return join(daemonRuntimeRootPath(pathInput), "logs", "service-update-worker.log");
45615
45731
  }
45616
- async function pruneVersionsAfterStableWorkerRegistration(input) {
45617
- if (input.job.preparedBundle.bundleFormat !== "binary_v1") return;
45618
- await pruneManagedVersions({
45619
- currentVersion: input.job.targetVersion,
45620
- pathInput: input.pathInput,
45621
- preferredRollbackVersion: input.previousActiveVersion
45622
- });
45623
- }
45624
45732
  function buildWindowsUpdateWorkerScript(spec) {
45625
45733
  const env = Object.entries(spec.env).map(([key, value]) => `set "${key}=${value.replaceAll("\"", "\\\"")}"`);
45626
45734
  const command = [spec.executable, ...spec.args].map(quoteWindowsArg).join(" ");
@@ -45686,11 +45794,10 @@ async function runCommand$1(input) {
45686
45794
  //#region src/local-service/lifecycle/daemon-service-update-coordinator.ts
45687
45795
  const MAX_BACKGROUND_UPDATE_ATTEMPTS = 5;
45688
45796
  async function scheduleDaemonServiceUpdate(input, overrides = {}) {
45689
- if (Object.keys(overrides).length === 0) return await withDaemonServiceReconcileLock(async () => await scheduleDaemonServiceUpdate(input, defaultScheduleOverrides()), {
45690
- command: "openmeld service update",
45691
- intent: "upgrade_reconcile"
45692
- });
45693
- const deps = resolveScheduleDependencies(overrides);
45797
+ const deps = resolveScheduleDependencies(overrides, { useDefaultLock: Object.keys(overrides).length === 0 });
45798
+ return await deps.withReconcileLock(async () => await scheduleDaemonServiceUpdateLocked(input, deps));
45799
+ }
45800
+ async function scheduleDaemonServiceUpdateLocked(input, deps) {
45694
45801
  const pending = await deps.readPendingJob();
45695
45802
  if (pending) return await reschedulePendingDaemonServiceUpdate({
45696
45803
  dependencies: deps,
@@ -45718,9 +45825,16 @@ async function scheduleDaemonServiceUpdate(input, overrides = {}) {
45718
45825
  updatedAt: now,
45719
45826
  urgency: input.urgency
45720
45827
  };
45721
- await deps.installWorker(job);
45722
- await deps.persistPendingJob(job);
45828
+ await deps.withManagedInstallTransaction(async () => {
45829
+ await deps.prepareWorkerCarrier(job);
45830
+ await deps.installWorker(job);
45831
+ await deps.persistPendingJob(job);
45832
+ });
45723
45833
  await deps.startWorker(job);
45834
+ await pruneWorkerVersionsBestEffort({
45835
+ dependencies: deps,
45836
+ job
45837
+ });
45724
45838
  return {
45725
45839
  job,
45726
45840
  status: "scheduled"
@@ -45746,39 +45860,44 @@ async function reschedulePendingDaemonServiceUpdate(input) {
45746
45860
  updatedAt: input.dependencies.now(),
45747
45861
  urgency: escalateUrgency ? "required" : input.pending.urgency
45748
45862
  } : input.pending;
45749
- await input.dependencies.installWorker(retained);
45750
- if (retained !== input.pending) await input.dependencies.persistPendingJob(retained);
45863
+ if (retained !== input.pending) await input.dependencies.withManagedInstallTransaction(async () => {
45864
+ await input.dependencies.prepareWorkerCarrier(retained);
45865
+ await input.dependencies.persistPendingJob(retained);
45866
+ });
45751
45867
  await input.dependencies.startWorker(retained);
45752
- if (replaceTarget) await discardReplacedBundleBestEffort({
45868
+ if (retained !== input.pending) await pruneWorkerVersionsBestEffort({
45753
45869
  dependencies: input.dependencies,
45754
- pending: input.pending
45870
+ job: retained
45755
45871
  });
45756
45872
  return {
45757
45873
  job: retained,
45758
45874
  status: "already_scheduled"
45759
45875
  };
45760
45876
  }
45761
- async function discardReplacedBundleBestEffort(input) {
45762
- await input.dependencies.discardBundle(input.pending.preparedBundle).catch((error) => {
45763
- console.warn("[openmeld.daemon_service.update_bundle_cleanup_failed]", {
45764
- bundleId: input.pending.preparedBundle.bundleId,
45877
+ async function pruneWorkerVersionsBestEffort(input) {
45878
+ await input.dependencies.pruneWorkerVersions(input.job).catch((error) => {
45879
+ console.warn("[openmeld.daemon_service.update_worker_prune_failed]", {
45765
45880
  errorMessage: toErrorMessage$43(error),
45766
- operationId: input.pending.jobId
45881
+ operationId: input.job.jobId,
45882
+ targetVersion: input.job.targetVersion
45767
45883
  });
45768
45884
  });
45769
45885
  }
45770
45886
  async function runPendingDaemonServiceUpdate(overrides = {}) {
45771
- if (Object.keys(overrides).length === 0) {
45772
- const deps = resolveRunDependencies(defaultRunOverrides());
45773
- if (!await preparePendingUpdateForSwitch(deps)) return null;
45774
- return await withDaemonServiceReconcileLock(async () => await runPreparedPendingUpdate(deps), {
45775
- command: "openmeld service update-worker",
45776
- intent: "upgrade_reconcile"
45777
- });
45887
+ const deps = resolveRunDependencies(overrides, { useDefaultLock: Object.keys(overrides).length === 0 });
45888
+ const pending = await deps.withReconcileLock(async () => await preparePendingUpdateForSwitch(deps));
45889
+ if (!pending) return null;
45890
+ if (pending.urgency === "available") try {
45891
+ await deps.waitUntilSafeToSwitch(pending);
45892
+ } catch (waitError) {
45893
+ try {
45894
+ await deps.withReconcileLock(async () => await recordSafeSwitchWaitFailure(deps, pending, waitError));
45895
+ } catch (recordError) {
45896
+ throw new AggregateError([waitError, recordError], "OpenMeld could not safely switch the Service or record the failure.");
45897
+ }
45898
+ throw waitError;
45778
45899
  }
45779
- const deps = resolveRunDependencies(overrides);
45780
- if (!await preparePendingUpdateForSwitch(deps)) return null;
45781
- return await runPreparedPendingUpdate(deps);
45900
+ return await deps.withReconcileLock(async () => await runPreparedPendingUpdate(deps));
45782
45901
  }
45783
45902
  async function preparePendingUpdateForSwitch(deps) {
45784
45903
  const pending = await deps.readPendingJob();
@@ -45791,20 +45910,22 @@ async function preparePendingUpdateForSwitch(deps) {
45791
45910
  updatedAt: deps.now()
45792
45911
  };
45793
45912
  await deps.persistPendingJob(waiting);
45794
- try {
45795
- await deps.waitUntilSafeToSwitch(waiting);
45796
- } catch (error) {
45797
- await deps.persistPendingJob({
45798
- ...waiting,
45799
- errorMessage: toErrorMessage$43(error),
45800
- updatedAt: deps.now()
45801
- });
45802
- throw error;
45803
- }
45804
45913
  return waiting;
45805
45914
  }
45806
45915
  return pending;
45807
45916
  }
45917
+ async function recordSafeSwitchWaitFailure(deps, waiting, error) {
45918
+ const current = await deps.readPendingJob();
45919
+ if (!(current && isSameWaitingUpdate(current, waiting))) return;
45920
+ await deps.persistPendingJob({
45921
+ ...current,
45922
+ errorMessage: toErrorMessage$43(error),
45923
+ updatedAt: deps.now()
45924
+ });
45925
+ }
45926
+ function isSameWaitingUpdate(current, waiting) {
45927
+ return current.jobId === waiting.jobId && current.targetVersion === waiting.targetVersion && current.preparedBundle.bundleId === waiting.preparedBundle.bundleId && current.urgency === waiting.urgency && current.phase === "waiting_for_work" && current.attempts === waiting.attempts;
45928
+ }
45808
45929
  async function runPreparedPendingUpdate(deps) {
45809
45930
  const pending = await deps.readPendingJob();
45810
45931
  if (!pending) return null;
@@ -45864,52 +45985,48 @@ async function runPreparedPendingUpdate(deps) {
45864
45985
  return failed;
45865
45986
  }
45866
45987
  }
45867
- function defaultScheduleOverrides() {
45868
- return {
45869
- createJobId: randomUUID,
45870
- discardBundle: discardPreparedDaemonServiceBundle,
45871
- installWorker: installDaemonServiceUpdateWorker,
45872
- now: () => (/* @__PURE__ */ new Date()).toISOString(),
45873
- persistPendingJob: persistPendingDaemonServiceUpdate,
45874
- prepareBundle: prepareDaemonServiceBundle,
45875
- readPendingJob: readPendingDaemonServiceUpdate,
45876
- resolveDesiredState: resolveCurrentDaemonDesiredState,
45877
- startWorker: startDaemonServiceUpdateWorker
45878
- };
45879
- }
45880
- function defaultRunOverrides() {
45881
- return {
45882
- completePendingJob: completePendingDaemonServiceUpdate,
45883
- now: () => (/* @__PURE__ */ new Date()).toISOString(),
45884
- persistPendingJob: persistPendingDaemonServiceUpdate,
45885
- readPendingJob: readPendingDaemonServiceUpdate,
45886
- runLifecycle: runDaemonServiceLifecycle,
45887
- waitUntilSafeToSwitch: waitUntilDaemonServiceSafeSwitch
45888
- };
45889
- }
45890
- function resolveScheduleDependencies(overrides) {
45988
+ function resolveScheduleDependencies(overrides, options) {
45891
45989
  return {
45892
45990
  createJobId: overrides.createJobId ?? randomUUID,
45893
- discardBundle: overrides.discardBundle ?? discardPreparedDaemonServiceBundle,
45894
- installWorker: overrides.installWorker ?? installDaemonServiceUpdateWorker,
45991
+ installWorker: overrides.installWorker ?? (options.useDefaultLock ? registerDaemonServiceUpdateWorker : installDaemonServiceUpdateWorker),
45895
45992
  now: overrides.now ?? (() => (/* @__PURE__ */ new Date()).toISOString()),
45896
45993
  persistPendingJob: overrides.persistPendingJob ?? persistPendingDaemonServiceUpdate,
45897
45994
  prepareBundle: overrides.prepareBundle ?? prepareDaemonServiceBundle,
45995
+ prepareWorkerCarrier: overrides.prepareWorkerCarrier ?? (options.useDefaultLock ? prepareDaemonServiceUpdateWorkerCarrier : async () => void 0),
45996
+ pruneWorkerVersions: overrides.pruneWorkerVersions ?? pruneDaemonServiceUpdateWorkerManagedVersions,
45898
45997
  readPendingJob: overrides.readPendingJob ?? readPendingDaemonServiceUpdate,
45899
45998
  resolveDesiredState: overrides.resolveDesiredState ?? resolveCurrentDaemonDesiredState,
45900
- startWorker: overrides.startWorker ?? startDaemonServiceUpdateWorker
45999
+ startWorker: overrides.startWorker ?? startDaemonServiceUpdateWorker,
46000
+ withReconcileLock: overrides.withReconcileLock ?? (options.useDefaultLock ? withDaemonServiceUpdateScheduleLock : runWithoutReconcileLock),
46001
+ withManagedInstallTransaction: overrides.withManagedInstallTransaction ?? (options.useDefaultLock ? withManagedInstallTransaction : runWithoutReconcileLock)
45901
46002
  };
45902
46003
  }
45903
- function resolveRunDependencies(overrides) {
46004
+ function resolveRunDependencies(overrides, options) {
45904
46005
  return {
45905
46006
  completePendingJob: overrides.completePendingJob ?? completePendingDaemonServiceUpdate,
45906
46007
  now: overrides.now ?? (() => (/* @__PURE__ */ new Date()).toISOString()),
45907
46008
  persistPendingJob: overrides.persistPendingJob ?? persistPendingDaemonServiceUpdate,
45908
46009
  readPendingJob: overrides.readPendingJob ?? readPendingDaemonServiceUpdate,
45909
46010
  runLifecycle: overrides.runLifecycle ?? runDaemonServiceLifecycle,
45910
- waitUntilSafeToSwitch: overrides.waitUntilSafeToSwitch ?? waitUntilDaemonServiceSafeSwitch
46011
+ waitUntilSafeToSwitch: overrides.waitUntilSafeToSwitch ?? waitUntilDaemonServiceSafeSwitch,
46012
+ withReconcileLock: overrides.withReconcileLock ?? (options.useDefaultLock ? withDaemonServiceUpdateWorkerLock : runWithoutReconcileLock)
45911
46013
  };
45912
46014
  }
46015
+ async function withDaemonServiceUpdateScheduleLock(run) {
46016
+ return await withDaemonServiceReconcileLock(run, {
46017
+ command: "openmeld service update",
46018
+ intent: "upgrade_reconcile"
46019
+ });
46020
+ }
46021
+ async function withDaemonServiceUpdateWorkerLock(run) {
46022
+ return await withDaemonServiceReconcileLock(run, {
46023
+ command: "openmeld service update-worker",
46024
+ intent: "upgrade_reconcile"
46025
+ });
46026
+ }
46027
+ async function runWithoutReconcileLock(run) {
46028
+ return await run();
46029
+ }
45913
46030
  async function waitUntilDaemonServiceSafeSwitch(job) {
45914
46031
  while (true) {
45915
46032
  const pending = await readPendingDaemonServiceUpdate();
@@ -50556,7 +50673,7 @@ function prepareSpaceComposerSubmission(input) {
50556
50673
  });
50557
50674
  const replyToSignalId = normalizeReplyToSignalId(input.replyTo);
50558
50675
  const replyTo = replyToSignalId ? { signalId: replyToSignalId } : null;
50559
- if (canonicalFragments.length === 0 && authoredMentionsInTextOrder.length === 0) {
50676
+ if (hasNoAuthoredMentions(canonicalFragments, authoredMentionsInTextOrder)) {
50560
50677
  const normalizedText = normalizePlainTextOrThrow(input.text);
50561
50678
  return {
50562
50679
  authoredMentionsInTextOrder: [],
@@ -50580,6 +50697,8 @@ function prepareSpaceComposerSubmission(input) {
50580
50697
  const envelopeInput = createEnvelopeInput(input.text, replyToSignalId);
50581
50698
  const canonicalMentionsInTextOrder = [];
50582
50699
  const profileIdsInTextOrder = [];
50700
+ const structuredTargetProfileIds = /* @__PURE__ */ new Set();
50701
+ const structuredMentionCandidates = [];
50583
50702
  for (const fragment of canonicalFragments) {
50584
50703
  const parsedLiteral = fragment.parsedLiteral;
50585
50704
  if (!parsedLiteral) throw createSubmissionError("addressing.invalid_canonical_mention_syntax", buildInvalidCanonicalMentionSyntaxMessage(fragment.text));
@@ -50589,12 +50708,19 @@ function prepareSpaceComposerSubmission(input) {
50589
50708
  mentionText: fragment.text,
50590
50709
  relation: parsedLiteral.type
50591
50710
  }));
50592
- envelopeInput[resolveMessageEnvelopeTargetField(parsedLiteral.type)].push(target.profileId);
50593
- profileIdsInTextOrder.push(target.profileId);
50594
- canonicalMentionsInTextOrder.push({
50711
+ const canonicalMention = {
50595
50712
  profileId: target.profileId,
50596
50713
  text: fragment.text,
50597
50714
  type: parsedLiteral.type
50715
+ };
50716
+ canonicalMentionsInTextOrder.push(canonicalMention);
50717
+ structuredMentionCandidates.push({
50718
+ canonicalMention,
50719
+ profileId: target.profileId,
50720
+ relation: parsedLiteral.type,
50721
+ sequence: structuredMentionCandidates.length,
50722
+ sourcePriority: 0,
50723
+ start: fragment.start
50598
50724
  });
50599
50725
  }
50600
50726
  for (const authoredMention of authoredMentionsInTextOrder) {
@@ -50604,9 +50730,20 @@ function prepareSpaceComposerSubmission(input) {
50604
50730
  mentionText: authoredMention.text,
50605
50731
  relation: authoredMention.relation
50606
50732
  }));
50607
- envelopeInput[resolveMessageEnvelopeTargetField(authoredMention.relation)].push(target.profileId);
50608
- profileIdsInTextOrder.push(target.profileId);
50733
+ structuredMentionCandidates.push({
50734
+ profileId: target.profileId,
50735
+ relation: authoredMention.relation,
50736
+ sequence: structuredMentionCandidates.length,
50737
+ sourcePriority: 1,
50738
+ start: authoredMention.start
50739
+ });
50609
50740
  }
50741
+ const resolvedCanonicalMentionsInTextOrder = appendStructuredMentionCandidates({
50742
+ candidates: structuredMentionCandidates,
50743
+ envelopeInput,
50744
+ profileIdsInTextOrder,
50745
+ structuredTargetProfileIds
50746
+ });
50610
50747
  const messageEnvelope = createMessageEnvelopeOrNull(envelopeInput);
50611
50748
  return {
50612
50749
  authoredMentionsInTextOrder,
@@ -50615,25 +50752,56 @@ function prepareSpaceComposerSubmission(input) {
50615
50752
  messageEnvelope,
50616
50753
  replyTo,
50617
50754
  resolvedStructuredTargets: {
50618
- canonicalMentionsInTextOrder,
50755
+ canonicalMentionsInTextOrder: resolvedCanonicalMentionsInTextOrder,
50619
50756
  profileIdsInTextOrder
50620
50757
  },
50621
50758
  text: messageEnvelope?.text ?? normalizePlainTextOrThrow(input.text)
50622
50759
  };
50623
50760
  }
50761
+ function hasNoAuthoredMentions(canonicalFragments, authoredMentions) {
50762
+ return canonicalFragments.length === 0 && authoredMentions.length === 0;
50763
+ }
50764
+ function appendStructuredTarget(input) {
50765
+ if (input.structuredTargetProfileIds.has(input.profileId)) return false;
50766
+ input.structuredTargetProfileIds.add(input.profileId);
50767
+ const fieldName = resolveMessageEnvelopeTargetField(input.relation);
50768
+ input.envelopeInput[fieldName].push(input.profileId);
50769
+ input.profileIdsInTextOrder.push(input.profileId);
50770
+ return true;
50771
+ }
50772
+ function compareStructuredMentionCandidates(left, right) {
50773
+ return left.start - right.start || left.sourcePriority - right.sourcePriority || left.sequence - right.sequence;
50774
+ }
50775
+ function appendStructuredMentionCandidates(input) {
50776
+ const resolvedCanonicalMentionsInTextOrder = [];
50777
+ input.candidates.sort(compareStructuredMentionCandidates);
50778
+ for (const candidate of input.candidates) if (appendStructuredTarget({
50779
+ envelopeInput: input.envelopeInput,
50780
+ profileId: candidate.profileId,
50781
+ profileIdsInTextOrder: input.profileIdsInTextOrder,
50782
+ relation: candidate.relation,
50783
+ structuredTargetProfileIds: input.structuredTargetProfileIds
50784
+ }) && candidate.canonicalMention) resolvedCanonicalMentionsInTextOrder.push(candidate.canonicalMention);
50785
+ return resolvedCanonicalMentionsInTextOrder;
50786
+ }
50624
50787
  function normalizeAuthoredMentionsInTextOrder(input) {
50625
50788
  const normalizedMentions = [];
50789
+ let searchStart = 0;
50626
50790
  for (const mention of input.mentions ?? []) {
50627
50791
  const profileId = normalizeOptionalText$6$1(mention.profileId);
50628
50792
  const text = normalizeOptionalText$6$1(mention.text);
50629
50793
  if (!(profileId && text)) throw createSubmissionError("addressing.invalid_message_envelope", "Authored mention target must include a profile and visible mention text.");
50630
50794
  if (!CANONICAL_MENTION_TYPES.has(mention.relation)) throw createSubmissionError("addressing.invalid_message_envelope", INVALID_MENTION_ACTION_GUIDANCE);
50631
- if (!input.text.includes(text)) continue;
50795
+ const declaredStart = mention.start;
50796
+ const start = Number.isInteger(declaredStart) && (declaredStart ?? -1) >= searchStart && input.text.slice(declaredStart, (declaredStart ?? 0) + text.length) === text ? declaredStart : input.text.indexOf(text, searchStart);
50797
+ if (start < 0) continue;
50632
50798
  normalizedMentions.push({
50633
50799
  profileId,
50634
50800
  relation: mention.relation,
50801
+ start,
50635
50802
  text
50636
50803
  });
50804
+ searchStart = start + text.length;
50637
50805
  }
50638
50806
  return normalizedMentions;
50639
50807
  }
@@ -53453,7 +53621,7 @@ async function probeOpenCodeReadiness(input) {
53453
53621
  message: `OpenCode is installed, but OpenMeld could not confirm a connected OpenCode provider: ${toErrorMessage$18(error)}`,
53454
53622
  models: [],
53455
53623
  probeCompleted: auth.status === "unauthenticated",
53456
- status: "error"
53624
+ status: auth.status === "unauthenticated" ? "unavailable" : "unknown"
53457
53625
  };
53458
53626
  } finally {
53459
53627
  if (server) await stopOpenCodeProbeServer(server.child);
@@ -53607,11 +53775,14 @@ function resolveOpenCodeReadinessFromProviderList(providerList) {
53607
53775
  };
53608
53776
  const connectedProviders = new Set(providerList.connected.map((providerId) => normalizeOptionalText$16(providerId)).filter((providerId) => Boolean(providerId)));
53609
53777
  if (connectedProviders.size === 0) return {
53610
- auth: { status: "unknown" },
53778
+ auth: {
53779
+ status: "unauthenticated",
53780
+ type: "opencode"
53781
+ },
53611
53782
  message: "OpenCode is installed, but no connected provider was reported. Open OpenCode and sign in to a provider before OpenMeld can launch it.",
53612
53783
  models: [],
53613
53784
  probeCompleted: true,
53614
- status: "error"
53785
+ status: "unavailable"
53615
53786
  };
53616
53787
  const models = parseOpenCodeProviderModels({
53617
53788
  connectedProviders,
@@ -54084,7 +54255,7 @@ async function resolveClaudeCodeInterfaceSnapshot(input) {
54084
54255
  let status = input.baseSnapshot.status;
54085
54256
  if (auth.status === "unauthenticated") {
54086
54257
  message = "Claude Code is installed, but this computer is not signed in to Claude Code.";
54087
- status = "error";
54258
+ status = "unavailable";
54088
54259
  } else if (auth.status === "unknown") {
54089
54260
  message = "OpenMeld could not read Claude Code authentication status.";
54090
54261
  status = "warning";
@@ -54125,7 +54296,7 @@ async function resolveCursorInterfaceSnapshot(input) {
54125
54296
  let status = input.baseSnapshot.status;
54126
54297
  if (auth.status === "unauthenticated") {
54127
54298
  message = requireControllerSignInInterfaceDescription("cursor");
54128
- status = "error";
54299
+ status = "unavailable";
54129
54300
  } else if (auth.status === "unknown") {
54130
54301
  message = "OpenMeld could not read Cursor CLI authentication status.";
54131
54302
  status = "warning";
@@ -54192,7 +54363,7 @@ async function resolveGrokBuildInterfaceSnapshot(input) {
54192
54363
  ...input.baseSnapshot,
54193
54364
  auth: { status: unauthenticated ? "unauthenticated" : "unknown" },
54194
54365
  message: unauthenticated ? requireControllerSignInInterfaceDescription("grok-build") : `OpenMeld could not read Grok Build's ACP status: ${toErrorMessage$17(interfaceProbe.error)}`,
54195
- status: unauthenticated ? "error" : "warning",
54366
+ status: unauthenticated ? "unavailable" : "warning",
54196
54367
  version,
54197
54368
  versionAdvisory: await resolveControllerVersionAdvisory({
54198
54369
  checkedAt: input.baseSnapshot.checkedAt,
@@ -54222,13 +54393,16 @@ async function resolveOpenClawInterfaceSnapshot(input) {
54222
54393
  let message = input.baseSnapshot.message;
54223
54394
  if (!authResult.probeCompleted) message = "OpenMeld could not read OpenClaw model provider authentication status. Check OpenClaw configuration and update OpenClaw if this command is unavailable.";
54224
54395
  if (authResult.auth.status === "unauthenticated") message = "OpenClaw is installed, but its model provider credentials are missing or expired. Re-authenticate the model provider in OpenClaw before OpenMeld can launch it.";
54396
+ let status = input.baseSnapshot.status;
54397
+ if (!authResult.probeCompleted) status = "unknown";
54398
+ if (authResult.auth.status === "unauthenticated") status = "unavailable";
54225
54399
  return {
54226
54400
  probeCompleted: authResult.probeCompleted,
54227
54401
  snapshot: {
54228
54402
  ...input.baseSnapshot,
54229
54403
  auth: authResult.auth,
54230
54404
  message,
54231
- status: authResult.auth.status === "unauthenticated" || !authResult.probeCompleted ? "error" : input.baseSnapshot.status,
54405
+ status,
54232
54406
  version
54233
54407
  }
54234
54408
  };
@@ -54488,7 +54662,7 @@ async function runCodexAppServerProbeRequests(input) {
54488
54662
  models: parseCodexModels(models),
54489
54663
  ok: true,
54490
54664
  skills: parseCodexSkills(skills),
54491
- status: auth.status === "unauthenticated" ? "error" : "ready",
54665
+ status: auth.status === "unauthenticated" ? "unavailable" : "ready",
54492
54666
  usageLimits,
54493
54667
  version: parseCodexUserAgentVersion(initialized)
54494
54668
  });
@@ -88270,18 +88444,6 @@ function resolvePublicSpaceExposure(input) {
88270
88444
  function buildPublicSpaceWarningLines(exposure) {
88271
88445
  return [exposure === "anyone_can_join" ? "Anyone with this Space link can read what is shared here and join." : "Anyone with this Space link can read what is shared here. A password is required to join.", "Only bring an agent if you're comfortable sharing anything it posts with people who have the link."];
88272
88446
  }
88273
- function resolveSpaceAccessLabel(input) {
88274
- switch (input.accessMode) {
88275
- case "members_only": return "members only";
88276
- case "public": return "anyone with the link";
88277
- case "public_view_join_password": return "anyone can view; password required to join";
88278
- case "protected": return "password required to view and join";
88279
- default:
88280
- if (input.passwordProtected === true) return "password required";
88281
- if (input.passwordProtected === false) return "anyone with the link";
88282
- return "unknown";
88283
- }
88284
- }
88285
88447
  function buildPublicSpaceJoinConfirmPromptConfig(input) {
88286
88448
  return {
88287
88449
  active: "Yes, join this Space",
@@ -90578,6 +90740,23 @@ function isCliIgnoredIncomingFrame(parsed) {
90578
90740
  return "error" in parsed || parsed.type === "space.agent_stream_delta" || parsed.type === "space.agent_stream_part" || parsed.type === "space.agent_stream_terminal" || parsed.type === "space.signal" || parsed.type === "space.members.changed" || parsed.type === "space.meta.changed" || parsed.type === "agent.readiness.invalidated";
90579
90741
  }
90580
90742
  //#endregion
90743
+ //#region src/space/access-presentation.ts
90744
+ function resolveOrganizationVisibilityLabel(visibility) {
90745
+ return visibility === "public" ? "discoverable; Organization members can join" : "invite only";
90746
+ }
90747
+ function resolveLinkAccessLabel(input) {
90748
+ switch (input.accessMode) {
90749
+ case "members_only": return "members only";
90750
+ case "public": return "anyone with the link";
90751
+ case "public_view_join_password": return "anyone can view; password required to join";
90752
+ case "protected": return "password required to view and join";
90753
+ default:
90754
+ if (input.passwordProtected === true) return "password required";
90755
+ if (input.passwordProtected === false) return "anyone with the link";
90756
+ return "unknown";
90757
+ }
90758
+ }
90759
+ //#endregion
90581
90760
  //#region src/space/agent-output-contract.ts
90582
90761
  function normalizeOptionalText$1(value) {
90583
90762
  if (typeof value !== "string") return null;
@@ -90649,7 +90828,7 @@ function normalizeAgentOutputMembersSnapshot(snapshot) {
90649
90828
  };
90650
90829
  }
90651
90830
  function buildAgentSessionMetaPayload(input) {
90652
- const access = resolveSpaceAccessLabel(input);
90831
+ const access = resolveLinkAccessLabel(input);
90653
90832
  let security = "Unknown";
90654
90833
  if (input.passwordProtected === true) security = "Secure";
90655
90834
  else if (input.passwordProtected === false) security = "Public";
@@ -90958,8 +91137,8 @@ function buildSpaceInfoData(input) {
90958
91137
  },
90959
91138
  ...metadataFacts,
90960
91139
  {
90961
- label: "Access",
90962
- value: resolveSpaceAccessLabel(accessFacts)
91140
+ label: "Link access",
91141
+ value: resolveLinkAccessLabel(accessFacts)
90963
91142
  },
90964
91143
  {
90965
91144
  label: "Gateway URL",
@@ -97151,7 +97330,7 @@ function selectSpaceSummarySegments(input) {
97151
97330
  return segments;
97152
97331
  }
97153
97332
  function resolveSpaceSummaryAccessLabel(session) {
97154
- const label = resolveSpaceAccessLabel({
97333
+ const label = resolveLinkAccessLabel({
97155
97334
  accessMode: session.accessMode ?? void 0,
97156
97335
  passwordProtected: session.passwordProtected ?? void 0,
97157
97336
  visibility: session.visibility ?? void 0
@@ -104733,9 +104912,23 @@ async function uploadPreparedSpaceFiles(input) {
104733
104912
  });
104734
104913
  } catch (error) {
104735
104914
  const failure = toStructuredApiClientFailure(error);
104915
+ const cleanupFailures = await moveUploadedFilesToTrash({
104916
+ files: uploaded,
104917
+ password: input.password,
104918
+ requestContext: input.requestContext,
104919
+ spaceApi: input.spaceApi,
104920
+ spaceId: input.spaceId
104921
+ });
104922
+ let cleanupMessage = "";
104923
+ if (uploaded.length > 0) cleanupMessage = cleanupFailures.length === 0 ? " Files added earlier in this send were moved to Trash." : ` ${formatCleanupFailures({
104924
+ failures: cleanupFailures,
104925
+ passwordProtected: input.password !== void 0,
104926
+ profileId: input.requestContext.actorContext.openMeldProfileId,
104927
+ spaceId: input.spaceId
104928
+ })}`;
104736
104929
  throw new SpaceSendFileError({
104737
104930
  code: failure.code ?? "space.file.upload_failed",
104738
- message: `Could not add file "${file.name}" to this Space. The message was not sent. ${failure.message}`,
104931
+ message: `Could not add file "${file.name}" to this Space. The message was not sent. ${failure.message}${cleanupMessage}`,
104739
104932
  cause: error,
104740
104933
  requestId: failure.requestId,
104741
104934
  status: failure.status,
@@ -104744,6 +104937,30 @@ async function uploadPreparedSpaceFiles(input) {
104744
104937
  }
104745
104938
  return uploaded;
104746
104939
  }
104940
+ async function moveUploadedFilesToTrash(input) {
104941
+ const failures = [];
104942
+ for (const file of input.files) try {
104943
+ await input.spaceApi.trashFileEntry({
104944
+ clientMutationId: crypto.randomUUID(),
104945
+ entryId: file.fileId,
104946
+ requestContext: input.requestContext,
104947
+ spaceId: input.spaceId,
104948
+ ...input.password === void 0 ? {} : { spacePassword: input.password }
104949
+ });
104950
+ } catch (error) {
104951
+ failures.push({
104952
+ failure: toStructuredApiClientFailure(error),
104953
+ fileId: file.fileId
104954
+ });
104955
+ }
104956
+ return failures;
104957
+ }
104958
+ function formatCleanupFailures(input) {
104959
+ return `${input.failures.map(({ failure, fileId }) => {
104960
+ const evidence = [failure.code ? `code ${failure.code}` : null, failure.requestId ? `request ${failure.requestId}` : null].filter((value) => value !== null).join(", ");
104961
+ return `Could not move file ${fileId} to Trash${evidence ? ` (${evidence})` : ""}: ${failure.message} Run \`openmeld space files trash ${input.spaceId} ${fileId} --profile ${input.profileId}\` to finish cleanup.`;
104962
+ }).join(" ")}${input.passwordProtected ? " This Space is password protected. Add `--password` with the same Space password you used for this send; OpenMeld does not include the password in this message." : ""}`;
104963
+ }
104747
104964
  async function prepareSpaceSendFile(sourcePath) {
104748
104965
  let bytes;
104749
104966
  try {
@@ -110019,6 +110236,6 @@ function isHumanInteractiveSpaceRuntime(runtime) {
110019
110236
  return runtime.resolvedView === "human" && canUseInteractivePrompts(runtime);
110020
110237
  }
110021
110238
  //#endregion
110022
- export { runAgentsRepair as $, validateLocalProjectConnectionPath as $a, startCurrentCommandCheckScope as $i, assertDispatchOwnedRuntimePublicWriteAllowed as $n, cliJsonSkillsListEnvelopeSchema as $o, resolveDaemonServiceFreshnessWarning as $r, readBundledOpenMeldCliSkillDocumentByPath as $t, assertFullSignalIdArgument as A, isSelectedOpenMeldProfileRequiredError as Aa, listAgentControllerPermissionModeOptions as Ai, submitRuntimeAgentControllerReport as An, removeProjectInbox as Ao, SPACE_ADD_MEMBERS_PROGRESS_HEARTBEAT_MS as Ar, shouldEmitAgentOverview as At, persistAgentTransportSelection as B, alignSelectedOpenMeldProfileStorage as Ba, getSetupFlowCopy as Bi, buildDispatchResultReplyWorkflowProjection as Bn, unbindProject as Bo, formatAgentOverviewPayload as Br, parseJsonResponse$1 as Bt, toSpaceMetaUpsertInput as C, renderHumanErrorCard as Ca, listBuiltinAgentsRegistryEntries as Ci, promptTextEntry as Cn, readAgentActivityContextForPath as Co, createSpaceUpdatesGuideError as Cr, runDaemonTeardownStrict as Ct, formatHumanReadTargetList as D, parseCliViewMode as Da, createAgentExecutionStatusDisplayRows as Di, assessActionParticipationCandidate as Dn, normalizeSharedSessionTitle as Do, getCommandEntryContract as Dr, reconcileCliVersionView as Dt, buildHumanReplyContextSummary as E, formatMessage as Ea, buildAgentControllerRef as Ei, resolveServiceParticipationReadiness as En, resolveObservedAgentActivityBinding as Eo, createUpgradeConfirmationGuideError as Er, buildProfileWorkspaceRows as Et, emitSpaceAgentOverview as F, deleteOpenMeldProfile as Fa, resolveEvidenceSyncHealth as Fi, resolveLocalAgentControllerReportDecision as Fn, listProjectConnectionsWithStatus as Fo, registerBuiltinAgentSelectionOptions as Fr, fetchSpaceMeta as Ft, runAgentsCustomList as G, buildHumanAuthenticationCard as Ga, resolveServiceUpdateUrgency as Gi, createSpaceMemberIdentityIndex as Gn, renderTextInfoCard as Go, canonicalizeAllowedActions as Gr, runDaemonStartDecisionPrompt as Gt, runAgents as H, getSelectedOpenMeldProfileId as Ha, resolveDaemonServiceAlignmentDecision as Hi, buildSignalMessageReadProjection as Hn, enqueueControllerTaskLifecycleEventWhileLocked as Ho, SPACE_CONTRACT_ALLOWED_ACTION_ORDER as Hr, writeInstalledLocalComponentsSnapshot as Ht, emitSpaceCliAgentOverview as I, listOpenMeldProfiles as Ia, resolveNativeAgentControllerPermissionModeForController as Ii, inspectSpaceCacheFile as In, migrateProjectBindingStore as Io, buildAgentOverviewFromContract as Ir, updateSpaceMeta as It, runAgentsDetect as J, resolveAuthenticationGuidanceFromError as Ja, resolveAuthBaseUrl as Ji, promptSearchSelect as Jn, errLine as Jo, scheduleDaemonServiceUpdate as Jr, runSkillsEnsure as Jt, runAgentsCustomRemove as K, createAuthenticationError as Ka, assessServerRequiredVersion as Ki, formatRemovedCcRelationMessage as Kn, sanitizeTerminalDisplayText as Ko, readOpenMeldToolsUpdateContextFromEnv as Kr, collectSkillsReadinessSnapshot as Kt, prepareLocalAgentReadiness as L, primeOpenMeldProfilesSessionCache as La, PREPARE_SESSION_RECONNECT_GRACE_MS as Li, upsertSpaceConfig as Ln, removeProjectConnection as Lo, DualViewGuideError as Lr, readGatewayJsonResponse as Lt, prepareAuthenticatedSpaceCommandContext as M, resolveOpenMeldProfileOrNull as Ma, resolveAgentControllerPermissionModeForController as Mi, collectLocalAgentControllerInventory as Mn, removeProjectOutbox as Mo, getCliVersionInfo as Mr, readDaemonStartFailureLogTailLines as Mt, resolveOpenMeldProfileForSpaceCommand as N, createOpenMeldAgentProfile as Na, resolveAgentExecutionStatus as Ni, resolveLocalAgentControllerBlockerReasonCodes as Nn, bindProject as No, registerDaemonControlTargetOptions as Nr, fetchSpaceUpdates as Nt, parseEnvelope as O, resolveRuntimeContext as Oa, getAgentControllerPermissionModeDisplayMetadata as Oi, computeRetryDelayMs as On, readCodexSessionTitles as Oo, getCommandHintsFromContract as Or, emitDaemonAgentOverview as Ot, resolveSpaceAccessLabel as P, createOpenMeldHumanProfile as Pa, resolveAgentProfileEditCapabilities as Pi, resolveLocalAgentControllerLaunchability as Pn, listProjectBindings as Po, registerAuthLoginRequestOptions as Pr, createCliSpaceApi as Pt, runAgentsManage as Q, LocalProjectConnectionError as Qa, resetCurrentCommandCheckState as Qi, isCliUpdateCheckApplicable as Qn, cliJsonOutputEnvelopeSchema as Qo, resolveServiceReadinessFromServiceStatus as Qr, ensureLocalSkills as Qt, buildReplyReadinessGuidance as R, resolveOpenMeldProfile as Ra, buildDaemonRouteObservationPresentation as Ri, assertNoRemovedCcSpaceAddressingSyntax as Rn, runIfAgentActivityBindingGenerationIsCurrent as Ro, formatDualViewGuideForDisplay as Rr, readGatewayTextResponse as Rt, loadSpaceSignalIndexOrNull as S, buildHumanErrorCopy as Sa, reconcileNewRunnableBuiltinAgentsForSetup as Si, resolveCreateProfileName as Sn, upsertDaemonServiceContract as So, createSpaceTargetGuideError as Sr, runDaemonStop as St, buildFormalSignalReadPayload as T, createPresenter as Ta, resolveLocalRegistryAgentIdFromAgentControllerRef as Ti, formatServiceParticipationReadinessLabel as Tn, buildAgentActivityEvent as To, createStartAuthenticationGuideError as Tr, buildProfileWorkspacePresentation as Tt, runAgentsConfig as U, setSelectedOpenMeldProfileId as Ua, classifyDaemonServiceRunStartability as Ui, buildSpaceRoundReadProjection as Un, readControllerTaskLifecycleOutboxHealth as Uo, areAllowedActionsEquivalent as Ur, resolveDaemonServiceParticipationStatus as Ut, resolveAgentProfileSetup as V, clearSelectedOpenMeldProfileId as Va, buildDaemonServiceTargetSpec as Vi, buildSignalIndex as Vn, canonicalizeLocalProjectPath as Vo, OPENMELD_AGENT_MENTAL_MODEL_LINES as Vr, resolveLocalComponentsStatus as Vt, runAgentsCustomAdd as W, buildAgentAuthenticationGuide as Wa, classifyDaemonServiceWakeability as Wi, buildUpdatesReplyWorkflowProjection as Wn, renderInfoCard as Wo, buildAgentFacingPublicationModeGuideLines as Wr, runDaemonServiceParticipationGate as Wt, runAgentsEnable as X, getProfileDefaultView as Xa, getCurrentCommandCheckState as Xi, runInteractivePrompt as Xn, outLine as Xo, resolveDaemonDeviceId as Xr, runSkillsUninstall as Xt, runAgentsDisable as Y, resolveAuthenticationGuidanceFromMessage as Ya, finishCurrentCommandCheckScope as Yi, isReturnKeypress as Yn, outJsonLine as Yo, ensureDaemonRuntimePaths as Yr, runSkillsInstall as Yt, runAgentsList as Z, setProfileDefaultView as Za, isCurrentCommandCheckScopeActive as Zi, assessCliUpdate as Zn, cliBinaryDeltaPatchSchema as Zo, formatDaemonFailureContextText as Zr, runSkillsUpdate as Zt, runSpaceWriteWithPasswordRetry as _, writeVersionState as _a, describeProfileWorkspacePathValidationFailure as _i, resolveDeviceAuthClientId as _n, formatProfileAwareOpenMeldCliCommands as _o, createSpaceMenuGuideError as _r, runDaemonInterrupt as _t, runSpaceDelete as a, isDaemonServiceJobNeverSpawned as aa, resolveGatewayChainReadiness as ai, evaluateCommandAuthentication as an, unregisterAgentActivityRoute as ao, formatDaemonServiceDowngradeBlockedRecommendation as ar, compareAgentControllerRefsForDisplay as as, renderOpenMeldBrandBlockLines as at, buildIdentityOnlyMembersSnapshotForReadProjection as b, resolveCurrentDaemonExpectedVersion as ba, resolveAgentProfilePrimaryAgentControllerReport as bi, createProfileByKind as bn, syncLocalAgentActivity as bo, createSpaceResultGuideError as br, runDaemonSnapshot as bt, runSpaceLeave as c, readRecentDaemonLifecycleEvents as ca, createModelCatalogReadSession as ci, runAuthMenu as cn, installAgentActivityIntegrations as co, createDoctorFailedGuideError as cr, renderOpenMeldTagline as ct, runSpaceRemoveMembers as d, buildNextVersionState as da, normalizeCustomProfileWorkspacePath as di, buildAuthStatusRows as dn, uninstallAgentActivityIntegrations as do, createProfileMenuGuideError as dr, bestEffortStopCurrentLaneDaemonService as dt, inspectDaemonServiceInventory as ea, resolveCurrentReplyReadinessSnapshot as ei, readRuntimeReportingHealthState as en, LocalDaemonControlPlaneClientError as eo, readDispatchOwnedRuntimeGuard as er, cliJsonSkillsLoadEnvelopeSchema as es, runAgentsShow as et, runSpaceSend as f, compareSemver as fa, readProfileWorkspaceConfig as fi, buildAuthStatusSnapshot as fn, formatInlineOpenMeldCliCommands as fo, createResetConfirmationGuideError as fr, runDaemon as ft, runSpaceReadWithPasswordRetry as g, readVersionState as ga, validateCustomProfileWorkspacePath as gi, requestDeviceToken as gn, formatOpenMeldCliTextBlock as go, createSpaceLeaveGuideError as gr, runDaemonInstall as gt, uploadPreparedSpaceFiles as h, fetchLatestPackageInfo as ha, setOpenMeldManagedProfileWorkspace as hi, fetchAuthUserSnapshot as hn, formatOpenMeldCliLine as ho, createSpaceContractSetGuideError as hr, runDaemonCancel as ht, runSpaceCreate as i, getDaemonSystemServiceLogPath as ia, mapAgentReplyReadinessToLegacyAutoReply as ii, ensureCommandAuthenticationOrCancel as in, resolveAgentActivityRouteForPath as io, resolveElapsedTimeMs as ir, revokeOrganizationJoinLinkResponseSchema as is, printOpenMeldBanner as it, assertValidSpaceIdTarget as j, requireOpenMeldProfile as ja, parseAgentControllerRef as ji, submitRuntimeAgentControllerReports as jn, readAgentActivityOutboxHealth as jo, registerSkillsTargetSelectionOptions as jr, runDaemonStartupPreflight as jt, isSpaceCommandOutputHandledError as k, resolveViewProfileKey as ka, getAgentControllerPermissionModeFieldLabel as ki, submitProfileRuntimeAgentControllerReport as kn, enqueueAgentActivityHookEvent as ko, registerSpaceMemberSelectionOptions as kr, createDelayedSpinner as kt, runSpaceList as l, buildInstallSelfJsonPayload as la, resolveProfileWorkspaceRuntime as li, runAuthStatus as ln, readAgentActivityIntegrationStatus as lo, createProfileActionGuideError as lr, resolveGatewayWebOrigin as lt, prepareRequestedSpaceSendFiles as m, fetchLatestCliBinaryRelease as ma, setCustomProfileWorkspace as mi, extractAuthApiErrorMessage as mn, formatOpenMeldCliCommands as mo, createSpaceAliasTargetGuideError as mr, runDaemonBackgroundStartForDecision as mt, promptAndConfirmSpacePassword as n, readCurrentDaemonRuntimeContext as na, formatDeviceReplyReadinessLabel as ni, connectWebSocket as nn, isAgentActivityRouteRegistered as no, writeDispatchSpaceActionRecord as nr, getOrganizationJoinLinkResponseSchema as ns, colorizeAgentLabel as nt, runSpaceHistory as o, readDaemonServiceJobCrashExitCode as oa, resolveOpenClawLocalDiagnosticsValue as oi, runAuthLogin as on, AGENT_ACTIVITY_INTEGRATION_OWNER as oo, formatDaemonServiceMissingRecommendation as or, renderOpenMeldHeader as ot, runSpaceWatch as p, ensureVersionStateReady as pa, resolveConfiguredProfileWorkspacePath as pi, formatActiveOrganizationLabel as pn, formatOpenMeldCliCommand as po, createSpaceAddMembersGuideError as pr, runDaemonAutostart as pt, runAgentsCustomUpdate as q, resolveAuthenticationGuidance as qa, resolveOpenMeldEnvironmentTarget as qi, promptSearchMultiselect as qn, emitCliJsonEnvelope as qo, runPendingDaemonServiceUpdate as qr, runSkillsCheck as qt, runSpaceAddMembers as r, readCurrentObservedDaemonRuntimeStatus as ra, formatHumanReplyReadinessReason as ri, buildCommandAuthenticationPromptMessage as rn, registerAgentActivityRoute as ro, formatElapsedTime as rr, organizationJoinLinkErrorResponseSchema as rs, colorizeDisplayProfileLabel as rt, runSpaceJoin as s, resolveDaemonServiceManager as sa, syncProfileWorkspaceState as si, runAuthLogout as sn, defaultManagedIntegrationPaths as so, canUseInteractivePrompts as sr, renderOpenMeldLogo as st, buildCreateSpacePasswordPromptConfig as t, resolveVersionChangeDirection as ta, formatAgentReplyReadinessLabel as ti, readRecentDaemonDispatchJournalEvents as tn, requestLocalAgentActivitySync as to, readDispatchSpaceActionContextFromEnv as tr, cliJsonSkillsShowEnvelopeSchema as ts, formatTransportModeDisplay as tt, runSpacePassword as u, performManagedInstall as ua, ensureOpenMeldManagedProfileWorkspace as ui, exchangeOneTimeTokenAuthSession as un, resolveAgentActivityDispatcherCommand as uo, createProfileCreateGuideError as ur, resolveSpaceSendText as ut, buildHumanReadSignalsTranscriptItems as v, resolveDaemonRuntimeContractCompatibility as va, syncDeviceRuntimeStateProjection as vi, resolveDeviceTokenExpiresAt as vn, resolveSetupFollowUpCliEntryCommand as vo, createSpacePublicationSetGuideError as vr, runDaemonReinstall as vt, buildFormalDispatchResultReadPayload as w, renderHumanTextErrorCard as wa, notifyDaemonRouteCatalogChanged as wi, ensureAgentProfileRuntimeBinding as wn, removeAgentActivityContextCache as wo, createStartAgentIdentityGuideError as wr, runDaemonUninstall as wt, loadSpaceIdentityDirectoryOrNull as x, OPENMELD_VERSION as xa, listAgentTargetStates as xi, resolveCreateProfileKind as xn, readDaemonServiceContract as xo, createSpaceSubcommandTargetGuideError as xr, runDaemonStatusFlow as xt, emitHumanReadSignalsTextProjection as y, toStartBackgroundHelperExecutionCompatibility as ya, createPrimaryBindingReadSession as yi, revokeAuthAccessToken as yn, resolveUserFacingCliEntryCommand as yo, createSpaceRemoveMembersGuideError as yr, runDaemonRunAfterEntryChecks as yt, resolveHumanControllerDisplayName as z, updateOpenMeldProfile as za, buildOnboardingPlan as zi, buildDispatchResultMessageReadProjection as zn, setDefaultProjectConnection as zo, buildDualViewGuideMessage as zr, toStructuredGatewayFailure as zt };
110239
+ 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 };
110023
110240
 
110024
- //# sourceMappingURL=command-CBkGZaPc.js.map
110241
+ //# sourceMappingURL=command-DaGkOPI0.js.map