openmeld 0.3.204 → 0.3.206

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.
Files changed (54) hide show
  1. package/dist/{add-me-membership-RRltMq3f.js → add-me-membership-BkHWMxE4.js} +2 -2
  2. package/dist/{add-me-membership-RRltMq3f.js.map → add-me-membership-BkHWMxE4.js.map} +1 -1
  3. package/dist/{agents-CQlCI9-A.js → agents-BOTlKiwS.js} +901 -499
  4. package/dist/agents-BOTlKiwS.js.map +1 -0
  5. package/dist/{api-client-foundation-DdImzphz.js → api-client-foundation-6ms5gSu8.js} +1 -1
  6. package/dist/{api-client-foundation-CStvOzAU.js → api-client-foundation-DpgDs0rw.js} +17 -7
  7. package/dist/api-client-foundation-DpgDs0rw.js.map +1 -0
  8. package/dist/{auth-session-BKtdaSHC.js → auth-session-BjSqMLTz.js} +187 -56
  9. package/dist/auth-session-BjSqMLTz.js.map +1 -0
  10. package/dist/auth-session-ahQ5VXiF.js +4 -0
  11. package/dist/{base-url-jWXPssF_.js → base-url-9A557X2K.js} +2 -2
  12. package/dist/{base-url-jWXPssF_.js.map → base-url-9A557X2K.js.map} +1 -1
  13. package/dist/{base-url-C89TOpPV.js → base-url-CRAYNW-4.js} +1 -1
  14. package/dist/{command-Bw24V9uI.js → command-CkbzbvXy.js} +10 -10
  15. package/dist/{command-Bw24V9uI.js.map → command-CkbzbvXy.js.map} +1 -1
  16. package/dist/{computer-setup-continuation-CHSesXzR.js → computer-setup-continuation-Cd9nhLQ-.js} +4 -4
  17. package/dist/{computer-setup-continuation-CHSesXzR.js.map → computer-setup-continuation-Cd9nhLQ-.js.map} +1 -1
  18. package/dist/dist-0boZRalP.js +4 -0
  19. package/dist/{dist-C2XTwHAi.js → dist-CxadJClH.js} +3692 -3557
  20. package/dist/dist-CxadJClH.js.map +1 -0
  21. package/dist/{elapsed-time-G3Sw-Sx-.js → elapsed-time-C7P-nWIO.js} +3 -3
  22. package/dist/{elapsed-time-G3Sw-Sx-.js.map → elapsed-time-C7P-nWIO.js.map} +1 -1
  23. package/dist/{installer-BtpNAUaE.js → installation-inventory-P49sTjhe.js} +359 -359
  24. package/dist/installation-inventory-P49sTjhe.js.map +1 -0
  25. package/dist/{openmeld-BnPEUym-.js → openmeld-ChOHuaqH.js} +20 -16
  26. package/dist/openmeld-ChOHuaqH.js.map +1 -0
  27. package/dist/openmeld-dev.js +1 -1
  28. package/dist/{openmeld-maintenance-worker-Jqau4x_b.js → openmeld-maintenance-worker-C7WykyDt.js} +5 -5
  29. package/dist/{openmeld-maintenance-worker-Jqau4x_b.js.map → openmeld-maintenance-worker-C7WykyDt.js.map} +1 -1
  30. package/dist/{openmeld-tools-update-coordinator-IT456QkB.js → openmeld-tools-update-coordinator-BBZhGo1A.js} +54 -50
  31. package/dist/openmeld-tools-update-coordinator-BBZhGo1A.js.map +1 -0
  32. package/dist/openmeld.js +3 -3
  33. package/dist/{prepare-session-executor-BU8LxDZW.js → prepare-session-executor-CLmDoHom.js} +9 -9
  34. package/dist/{prepare-session-executor-BU8LxDZW.js.map → prepare-session-executor-CLmDoHom.js.map} +1 -1
  35. package/dist/{profiles-B-d-Co3d.js → profiles-BCecj4Pj.js} +401 -397
  36. package/dist/profiles-BCecj4Pj.js.map +1 -0
  37. package/dist/upgrade-BKEAZKre.js +4 -0
  38. package/dist/{upgrade-DR54reUV.js → upgrade-l_5Tge_z.js} +4 -4
  39. package/dist/{upgrade-DR54reUV.js.map → upgrade-l_5Tge_z.js.map} +1 -1
  40. package/dist/{urls-4D7CaXe3.js → urls-CY2uzH2-.js} +2 -1
  41. package/dist/urls-CY2uzH2-.js.map +1 -0
  42. package/package.json +1 -1
  43. package/dist/agents-CQlCI9-A.js.map +0 -1
  44. package/dist/api-client-foundation-CStvOzAU.js.map +0 -1
  45. package/dist/auth-session-BKtdaSHC.js.map +0 -1
  46. package/dist/auth-session-Dz78zukO.js +0 -4
  47. package/dist/dist-BYU26WVn.js +0 -4
  48. package/dist/dist-C2XTwHAi.js.map +0 -1
  49. package/dist/installer-BtpNAUaE.js.map +0 -1
  50. package/dist/openmeld-BnPEUym-.js.map +0 -1
  51. package/dist/openmeld-tools-update-coordinator-IT456QkB.js.map +0 -1
  52. package/dist/profiles-B-d-Co3d.js.map +0 -1
  53. package/dist/upgrade-ByXRAj9S.js +0 -4
  54. package/dist/urls-4D7CaXe3.js.map +0 -1
@@ -1,20 +1,20 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { f as toSpaceMetaUrl, g as toSpaceUpdatesUrl } from "./urls-4D7CaXe3.js";
3
+ import { f as toSpaceMetaUrl, g as toSpaceUpdatesUrl } from "./urls-CY2uzH2-.js";
4
4
  import { t as isLoopbackHostname } from "./loopback-hostname-DHQPKq8N.js";
5
5
  import { A as formatLocalMachineIssueMessage, D as createServiceSpawnPendingIssue, G as isPublishedOpenMeldHome, I as accountsDir, J as normalizeAccountKey, K as legacyAccountProfileSpacesDir, N as accountProfileSpaceCacheDir, Q as openMeldManagedBinaryPath, Y as normalizeOpenMeldProfileId, _ as resolveCliContextId, b as resolveOpenMeldLaneDescriptor, dt as resolveOpenMeldServiceOwnedPathInput, j as OPENMELD_HOME_ENV_KEY, l as resolveOpenMeldOrphanedLockIssue, lt as resolveOpenMeldEnvPreset, r as isOpenMeldLockError, tt as openMeldRootDir, ut as resolveOpenMeldRootDir, w as assessLocalMachineFailure } from "./lock-CvBnBcFK.js";
6
6
  import { b as normalizeKnownBuiltinAgentControllerId, d as resolveBuiltinAgentControllerConversationKind, l as buildAgentControllerConversationRef } from "./controller-contract-pe3_Re-c.js";
7
- import { $a as RUNTIME_STATE_PERSIST_MIN_INTERVAL_MS, $n as resolveRouteRegistrationReconcileDecision, $t as resolveProjectBindingForPath, A as resolveDaemonStatusSnapshot, Aa as normalizeNonNegativeInteger$1, Ai as readCurrentDaemonOwnerSnapshot, An as resolveSkillsAgentRegistry, Ar as seedLegacyAgentContext, B as formatDaemonServiceRefreshReliabilityMessage, Ba as CONTROLLED_SHUTDOWN_SOCKET_CLOSE_TIMEOUT_MS, Bi as waitForDaemonSystemServiceToStop, Bn as repairBuiltinControllerInstall, Br as buildWorkingLanguagePromptPlan, C as isSystemServiceStartupTimeoutError, Ca as ensureDaemonRuntimePaths, Ci as buildCliLaunchInvocation, Cn as removeAgentCustomTarget, Cr as buildRuntimeWorkspaceFingerprint, Ct as summarizeSkippedDaemonProfiles, D as captureDaemonServiceEvidence, Da as dirnamePath, Di as buildDaemonOwnerSnapshotFromObservedState, Dn as updateAgentRegistrations, Do as formatDaemonLifecycleOriginSummary, Dr as loadLedgerState, Ds as compareAgentControllerRefsForDisplay, Dt as resolveLocalController, E as startDaemonSystemServiceWithAutoRepair, Ea as asRecord, Ei as inspectDaemonServiceInventory, En as updateAgentCustomTarget, Eo as emitDaemonLifecycleEvent, Er as commitResolvedAgentContext, Es as resolveUserFacingCliEntryCommand, Et as readLocalEnabledControllers, F as buildDaemonServiceRefreshNextStep, Fa as warnDaemonEvent, Fi as getEffectiveDaemonRuntimeStatus, Fr as buildAgentContextLookupKey, G as buildDaemonServiceDependencyDetails, Ga as DEFAULT_RECONNECT_DELAY_MS, Gn as isNpmGlobalCommandPath, Gt as bindProject, Ha as DAEMON_STREAM_CONNECT_TIMEOUT_MS, Hi as listDaemonOwnedProcesses, Hn as resolveBuiltinAgentControllerDefinition, Ho as isDaemonServiceContractIdentityReusable, I as buildDaemonServiceRefreshPromptMessage, Ia as CATALOG_SYNC_RETRY_INTERVAL_MS, Ii as readCurrentDaemonRuntimeContext, In as normalizeAgentId, Ir as DEFAULT_TASK_LIFECYCLE_HEARTBEAT_INTERVAL_MS, It as readProfileWorkspaceConfigForAccount, J as buildDaemonServiceDependencySummary, Ja as PROVIDER_CONVERSATION_PROOF_SYNC_INTERVAL_MS, Ji as DaemonServiceRunError, Jn as normalizeDispatchThreadAction, Jr as parseAgentControllerRef, Jt as listProjectConnectionsWithStatus, K as buildDaemonServiceDependencyMeaning, Ka as HEARTBEAT_RESPONSE_TIMEOUT_MS, Ki as ensureDaemonRuntimeContractState, Kn as isPnpmGlobalCommandPath, Ko as compareSemver, Kt as isProjectBound, La as CATALOG_SYNC_SIGNAL_POLL_INTERVAL_MS, Li as readCurrentObservedDaemonRuntimeStatus, Ln as normalizeAgentIds, Lr as areAgentControllerInterfaceAccountsSame, M as resolveDaemonStatusAuthenticationAttention, Ma as normalizeText$2, Mi as resolveStoppedContractWriteBlockedReason, Mo as runDaemonServiceManagerAction, Mr as upsertConversationExecutionState, Mt as resolveProfileWorkspaceRuntime, N as resolveServiceReadiness, Na as nowIsoString, Ni as summarizeDaemonOwnerSnapshot, Nn as resolveRegistryRuntimeAdapterCapabilitySnapshot, No as runWithDaemonLifecycleCommandJournal, Nr as withLedgerStateTransaction, Nt as ensureOpenMeldManagedProfileWorkspace, O as captureDaemonServiceEvidenceBestEffort, Oa as emitRunLine, Oi as formatDaemonOwnerSummaryLabel, On as canManageRegistryAgentSkillTargets, Oo as readLatestDaemonLifecycleConnectionStateEvent, Or as removeConversationExecutionState, Ot as resolveLocalRuntimeControllerSupport, Pa as toErrorMessage$10, Pi as clearDaemonRuntimeStateIfDefinitelyStopped, Pn as resolveRegistryRuntimeAdapterContractByAgentControllerRef, Pr as buildAuthenticatedControlPlaneResponse, Qa as RUNTIME_AGENT_CONTROLLER_REPORT_SYNC_RETRY_INTERVAL_MS, Qn as isDaemonReconcileInProgressError, Qr as renderWorkingLanguagePrompt, Qt as removeProjectConnection, R as buildDaemonServiceStatusReadOnlyDetail, Ra as CONTROLLED_SHUTDOWN_REQUEST_TIMEOUT_MS, Ri as resolveDaemonRuntimeState, Rn as parseAgentEnabledOption, Rr as buildAgentControllerRef, Rt as resolveConfiguredProfileWorkspacePathForAccount, S as isDaemonInventoryRunningAndStartReady$1, Sa as buildLedgerPaths, So as resolveDaemonBundleEntryPathFromState, Sr as runRuntimeTask, Ss as formatOpenMeldCliTextBlock, St as loadDaemonRouteCatalog, T as waitForSystemServiceStartup$1, Ta as resolvePreferredDaemonDeviceId, Ti as createProviderOriginalError, Tn as setAgentRegistrationEnabled, Tr as appendLedgerHistoryEntry, Tt as buildRuntimeRouteTargets, U as clearDaemonStartFailureState, Ua as DAEMON_STREAM_KEEPALIVE_INTERVAL_MS, Un as isBunGlobalCommandPath, Uo as readDaemonServiceContract, Ut as ProjectBindingOperationError, V as formatDaemonServiceUpdateRequiredMessage, Va as DAEMON_RUNTIME_CONTRACT_EPOCH, Vi as cleanupLegacySharedDaemonServiceState, Vn as EMPTY_AGENT_CONTROLLER_INTERFACE_CAPABILITIES, Vo as clearDaemonServiceContract, Vr as createAgentControllerInterfaceDisplayRows, W as writeDaemonStartFailureState, Wa as DAEMON_STREAM_KEEPALIVE_PONG_TIMEOUT_MS, Wn as isHomebrewCommandPath, Wo as upsertDaemonServiceContract, Wt as ProjectBindingStoreUpdateRequiredError, X as resolveDaemonServiceDependencyDiagnostics, Xa as REGISTER_RESPONSE_TIMEOUT_MS, Xn as SPACE_ACTION_CONTEXT_GUIDANCE_LINES, Xt as removeAgentActivityBindingsWhileDeliveryLocked, Y as buildDaemonServiceDependencyTitle, Ya as PROVIDER_CONVERSATION_PROOF_SYNC_RETRY_INTERVAL_MS, Yi as resolveCurrentDaemonExpectedVersion, Yn as syncRuntimeEventToInflightTaskControlRegistry, Za as RUNTIME_AGENT_CONTROLLER_REPORT_SYNC_INTERVAL_MS, Zn as SPACE_ACTION_TARGET_GUIDANCE_LINES, Zr as renderInformationProtectionPrompt, Zt as removeMissingProjectConnections, _ as DaemonServiceLifecycleDrainTimeoutError, _a as DAEMON_SERVICE_FULL_ALIGNMENT_ANOMALIES, _i as forkCodexAppServerThread, _n as listAgentRegistrations, _o as OPENMELD_VERSION, _r as resolveDispatchQueueLogMeta, _s as resolveAuthenticationReasonFromState, _t as readDaemonRouteCatalogCache, a as resolveServiceUpdateUrgency, aa as resolveCurrentOpenMeldAccountContext, ai as resolveCatalogSyncSkippedProfilesLogState, an as withAgentActivityDeliveryLock, ar as createLocalTaskInterruptSender, ba as classifyDaemonServiceRunStartability, bi as createUnavailableProviderUsageLimits, bn as readAgentRuntimeConfigHealth, bo as readDaemonActiveBundleState, br as resolveCompatibleConversationExecutionState, bs as formatOpenMeldCliCommands, bt as createMutableRouteCatalogState, ca as ensureDaemonSystemServiceCommandFiles, ci as parseOpenCodeGoUsageResponse, cn as syncDeviceRuntimeStateProjection, co as resolveOpenMeldEnvironmentTarget, cr as createInflightTaskControlRegistry, da as isOpenMeldManagedBinaryPath, di as GrokBuildAcpTransportError, dn as emitReconcileStartedEvidence, dr as MIN_HEARTBEAT_INTERVAL_MS, ds as buildHumanAuthenticationCard, er as createSerialAgentInteractionCallback, fa as buildDaemonServiceTargetSpec, fi as probeGrokBuildAcpInterface, fo as requestLocalDaemonShutdown, fr as applyAcceptedLeases, fs as createAuthenticationError, g as scheduleDaemonServiceUpdate, ga as DAEMON_SERVICE_AUTO_HEAL_ANOMALIES, gi as resolveInstalledCodexLaunchCandidates, gn as listAgentCustomTargets, go as readManagedCliInstallation, gr as resolveCatalogSyncIntervalMs, gt as slugifyOpenClawNamePart, hi as resolveCodexTimeoutMs, hn as createRegistrationFromCatalogTarget, hr as resolveAdaptiveHeartbeatIntervalMs, ht as normalizeOpenClawSpaceIdPrefix, i as writeOpenMeldToolsMaintenancePolicy, in as resolveLocalProjectConnectionForPath, io as clearAllSelectedOpenMeldProfileIds, ir as mergeOpenClawGatewayVisibility, j as resolveDaemonStatusAttention, ja as normalizeOptionalText$13, ji as resolveDaemonStopStrategy, jo as resolveRecentDaemonSignalStopCause, jr as settleInflightTask, jt as resolveCurrentEffectiveProfileWorkingFolderRuntime, k as formatDaemonFailureContextText, ka as normalizeHeartbeatIntervalMs, ki as hasActiveDaemonOwners, ko as readLatestDaemonLifecycleOriginEvent, kr as resolveConversationExecutionStateByLookupKey, la as extractDaemonCommandEntryPath, li as forkOpenCodeServerSession, ln as emitDriftDetectedEvidence, lo as resolveAuthBaseUrl, lr as ADAPTIVE_HEARTBEAT_JITTER_RATIO, ls as buildAuthenticationStatusLabel, ma as isVersionDowngrade, mi as projectCodexUsageLimits, mn as addAgentCustomTarget, mr as pruneStaleLeases, ms as resolveAuthenticationGuidance, mt as buildOpenClawSpaceSessionKey, n as readOpenMeldToolsMaintenancePolicy, no as resolveOpenMeldProfileOrNull, nr as normalizeDispatchPostMessageAction, o as assessServerRequiredVersion, oa as writeDaemonServiceContract, oi as createLocalAdapterContainer, on as withAgentActivityLocalStateLock, or as buildLocalServiceDiagnosticsPayload, pa as resolveDaemonServiceAlignmentDecision, pi as resolveInstalledGrokBuildLaunchCandidates, pn as resolveAgentProfilePrimaryAgentControllerReport, po as sendLocalDaemonControlPlaneRequest, pr as applyIntervalJitterMs, ps as extractAuthenticationPromptAction, pt as prepareProviderRuntime, q as buildDaemonServiceDependencyNextStep, qa as MAX_RECONNECT_DELAY_MS, qi as readDaemonRuntimeContractRepairReport, qt as listProjectBindings, r as resolveOpenMeldToolsMaintenanceProjection, rr as createPendingAgentInteractionRegistry, s as describeServerRequiredVersionUnavailableReason, sa as buildDaemonSystemServiceCommandSpec, si as createLocalAdapterEntries, sr as createLocalExecutionSlots, ss as readDaemonCatalogSyncSignal, t as createOpenMeldToolsUpdateCoordinator, ta as resolveRuntimeContext, tn as setDefaultProjectConnection, to as requireOpenMeldProfile, tr as buildDispatchReplyContextSummary, u as assessCliUpdate, ua as resolveDaemonBundleIdFromEntryPath, ui as resolveInstalledOpenCodeLaunchCandidates, un as emitReconcileCompletedEvidence, uo as LocalDaemonControlPlaneClientError, ur as MAX_HEARTBEAT_INTERVAL_MS, us as buildCommandAuthenticationPromptMessage$1, v as runDaemonServiceLifecycle, va as DAEMON_SERVICE_REPAIR_ANOMALIES, vi as verifyCodexAppServerThread, vn as listAgentTargetStates, vo as cleanupInactiveDaemonServiceBundles, vr as resolveDispatchContinuityObservation, vs as formatInlineOpenMeldCliCommands, vt as writeDaemonRouteCatalogCache, w as resolveSystemServiceStartupWaitMs, wa as resolveDaemonDeviceId, wi as materializeCliLaunchCommand, wn as resolveAgentTargetState, wr as buildTaskResultEnvelope, wt as syncDaemonRouteCatalogState, x as uninstallDaemonServiceUpdateWorker, xa as classifyDaemonServiceWakeability, xi as createUnsupportedProviderUsageLimits, xn as reconcileNewRunnableBuiltinAgentRegistrations, xo as resolveAlignedDaemonActiveBundleEntryPath, xr as resolveLatestScopedConversationExecutionState, xt as createRouteCatalogFromMutableState, y as ensureDaemonServiceMaintenanceInstalled, ya as DAEMON_SERVICE_WAKEABILITY_ADVISORY_ANOMALIES, yi as resolveInstalledClaudeCodeLaunchCandidates, yn as manageAgentRegistrationInstallation, yo as prepareDaemonServiceBundle, yr as resolveCompatibleAgentContextMatch, ys as formatOpenMeldCliCommand, yt as resolveLocalServiceDemand, z as buildDaemonServiceUpdateRequiredNextStep, za as CONTROLLED_SHUTDOWN_RESULT_ACK_TIMEOUT_MS, zi as resolveDaemonServiceManagerForRuntimeState, zn as sortAgentRegistrations, zr as buildInformationProtectionPromptPlan, zt as setCustomProfileWorkspace } from "./openmeld-tools-update-coordinator-IT456QkB.js";
8
- import { $r as agentActivitySessionInventoryResponseSchema, Ar as updateCenterAgentRoutineResponseSchema, Br as localProjectControlDiscoverProjectsResponseSchema, Cr as submitFeedbackIssueResponseSchema, Dr as listCenterAgentRoutinesResponseSchema, Er as listCenterAgentRoutineRunsResponseSchema, Fn as OPENMELD_HEADER_SPACE_ADDRESSING_VERSION, Gr as spaceMemberAgentWakeAvailabilitySchema, Jr as spaceMemberDirectorySchema, Kr as spaceMemberDirectoryAllowedRelationsSchema, Lr as agentActivitySnapshotResponseSchema, Mr as AGENT_ACTIVITY_PRESENCE_TTL_MAX_MS, Nr as agentActivityEventSchema, Or as pauseCenterAgentRoutineResponseSchema, Pn as OPENMELD_HEADER_REQUEST_ID, Rn as getSpaceUpdatesResponseSchema, Rr as localProjectControlConnectionSchema, Sr as submitFeedbackIssueRequestSchema, Tn as DAEMON_STREAM_KEEPALIVE_PING, Tr as deleteCenterAgentRoutineResponseSchema, Tt as buildSpaceAttachmentDownloadPath, Vn as SPACE_DISPATCH_TRACE_PROMPT_PREVIEW_MAX_CHARS, Xn as submitAgentControllerTaskLifecycleEventItemSchema, Yr as spaceMemberKindSchema, _r as organizationSkillReleaseSummarySchema, ai as projectSchema, ar as OPENMELD_RUNTIME_CAPABILITIES_HEADER, br as organizationDirectoryResponseSchema, cr as computerFileAccessPolicySchema, di as toCompatibleSpaceAddressingRequestWireValue, fr as spaceCreatorSchema, hr as listOrganizationSkillsResponseSchema, ii as listProjectsResponseSchema, in as createSpaceApi, ir as COMPUTER_FILE_ACCESS_RUNTIME_CAPABILITY, jt as createAgentActivityApi, kr as resumeCenterAgentRoutineResponseSchema, mr as getOrganizationSkillResponseSchema, ni as archiveProjectResponseSchema, oi as updateProjectResponseSchema, or as computerFileAccessDaemonFrameSchema, pr as spaceMetaSchema, qr as spaceMemberDirectoryEntrySchema, ri as createProjectResponseSchema, rn as createRuntimeReportingApi, rr as gatewayErrorEnvelopeSchema, si as centerAgentToolSpeakerSchema, sr as computerFileAccessPolicyInputSchema, t as OpenMeldApiClientHttpError, ti as observedLocalAgentSessionSchema, ur as organizationSpaceDirectoryWithMemberCountsResponseSchema, vn as toStructuredApiClientFailure, vr as organizationSkillSummarySchema, wr as createCenterAgentRoutineResponseSchema, xr as organizationComputersResponseSchema, zn as spaceEntryTargetSchema, zr as localProjectControlDaemonFrameSchema } from "./dist-C2XTwHAi.js";
9
- import { A as runtimeTransportHeartbeatResponseSchema, B as runtimeTransportOpenMeldToolsControlResultFramePayloadSchema, Bt as AGENT_INTERACTION_DEFAULT_TIMEOUT_MS, C as runtimeTransportDispatchPreviewRequestSchema, Di as localAgentReasoningPreferencesSchema, E as runtimeTransportDispatchToolActivityRequestSchema, Ei as OPENMELD_REASONING_STREAM_HEADER, F as runtimeTransportLocalAgentControlRefreshCatalogFramePayloadSchema, G as runtimeTransportResumeControllerConversationResultFramePayloadSchema, Gn as sanitizeSignalTextPreview, Gt as formatLocalComponentsSummaryDescription, H as runtimeTransportRegisterSessionResponseSchema, Ht as agentInteractionRequestSchema, I as runtimeTransportLocalAgentControlSetEnabledFramePayloadSchema, Ii as normalizeOptionalWorkingDirectory, J as runtimeTransportSubmitTaskResultRequestSchema, Jr as boolean, Jt as formatLocalSetupActionLabel, K as runtimeTransportRouteCatalogChangedFramePayloadSchema, Kt as formatLocalComponentsSummaryLabel, L as runtimeTransportLocalAgentControlSetProfileWorkspaceFramePayloadSchema, Li as openMeldRuntimeProfileIdSchema, M as runtimeTransportLocalAgentControlForkSessionFramePayloadSchema, N as runtimeTransportLocalAgentControlInterruptFramePayloadSchema, O as runtimeTransportForkAgentSessionResultSchema, P as runtimeTransportLocalAgentControlManageInstallationFramePayloadSchema, Qr as enumFactory, S as runtimeTransportDispatchPreviewEndRequestSchema, T as runtimeTransportDispatchRuntimeEvidenceRequestSchema, Ti as LOCAL_AGENT_REASONING_MAX_CHARS, Tt as openMeldDaemonControlPlaneResponseSchema, V as runtimeTransportRegisterSessionRequestSchema, W as runtimeTransportResumeControllerConversationFramePayloadSchema, Xr as discriminatedUnion, Xt as localCliComponentUpdateProjectionSchema, Yi as resolvePublicAgentAvailabilityCopy, Yt as installedLocalComponentsSnapshotSchema, Zi as sanitizeDispatchErrorSummary, _ as runtimeTransportDeliverDispatchRequestSchema, _n as normalizeSpacePasswordText, ar as collectCanonicalMentionTextFragments, at as LOCAL_FOLDER_PICKER_RUNTIME_CAPABILITY, b as runtimeTransportDispatchInteractionResponseFramePayloadSchema, ct as localFolderPickerHelperProtocolResultSchema, d as CURRENT_DAEMON_EXECUTION_CONTRACT_EPOCH, ei as iso, en as localServiceComponentUpdateProjectionSchema, h as localWakeRouteWorkingFolderObservationSchema, hi as url, hr as resolveSpaceMentionLabels, ir as MESSAGE_MENTION_TYPE_VALUES, it as openMeldSpaceEgressActionSchema, j as runtimeTransportLocalAgentControlCancelFramePayloadSchema, k as runtimeTransportHeartbeatRequestSchema, ki as openMeldRequestContextSchema, li as strictObject, lr as normalizeMessageEnvelope, lt as localFolderPickerHelperResultSchema, mn as runtimeTransportDeliveryExecutionIdentitySchema, mr as resolveSingleSpaceMentionLabels, ni as literal, nt as openMeldDaemonTaskResultPayloadSchema, ot as OPENMELD_LOCAL_FOLDER_PICKER_CAPABILITY_HEADER, p as daemonStreamFrameSchema, pn as runtimeCoordinatorExecutionTokenEnvelopeSchema, qt as formatLocalSetupActionDescription, sr as getSpaceMessageAddressingRelationSupportForTargetKind, st as localFolderPickerDaemonFrameSchema, ui as string, ur as resolveMessageEnvelopeTargetField, v as runtimeTransportDispatchInteractionDeliveredRequestSchema, w as runtimeTransportDispatchReasoningRequestSchema, x as runtimeTransportDispatchLifecycleRequestSchema, y as runtimeTransportDispatchInteractionRequestSchema, z as runtimeTransportOpenMeldToolsControlFramePayloadSchema } from "./profiles-B-d-Co3d.js";
10
- import { b as hashBundledSkillAssets, f as ensureLocalSkills, g as loadSelectedSkillAssets, r as collectSkillsReadinessSnapshot, t as installSkillsToTargets, u as resolveSkillInstallStateForTarget, v as withSkillsInstallLock, x as OFFICIAL_CLI_SKILL_URL, y as computeDirectoryContentHash } from "./installer-BtpNAUaE.js";
7
+ import { $a as RUNTIME_STATE_PERSIST_MIN_INTERVAL_MS, $n as resolveRouteRegistrationReconcileDecision, $t as resolveProjectBindingForPath, A as resolveDaemonStatusSnapshot, Aa as normalizeNonNegativeInteger$1, Ai as readCurrentDaemonOwnerSnapshot, An as resolveSkillsAgentRegistry, Ar as seedLegacyAgentContext, B as formatDaemonServiceRefreshReliabilityMessage, Ba as CONTROLLED_SHUTDOWN_SOCKET_CLOSE_TIMEOUT_MS, Bi as waitForDaemonSystemServiceToStop, Bn as repairBuiltinControllerInstall, Br as buildWorkingLanguagePromptPlan, C as isSystemServiceStartupTimeoutError, Ca as ensureDaemonRuntimePaths, Ci as buildCliLaunchInvocation, Cn as removeAgentCustomTarget, Cr as buildRuntimeWorkspaceFingerprint, Ct as summarizeSkippedDaemonProfiles, D as captureDaemonServiceEvidence, Da as dirnamePath, Di as buildDaemonOwnerSnapshotFromObservedState, Dn as updateAgentRegistrations, Do as formatDaemonLifecycleOriginSummary, Dr as loadLedgerState, Ds as compareAgentControllerRefsForDisplay, Dt as resolveLocalController, E as startDaemonSystemServiceWithAutoRepair, Ea as asRecord, Ei as inspectDaemonServiceInventory, En as updateAgentCustomTarget, Eo as emitDaemonLifecycleEvent, Er as commitResolvedAgentContext, Es as resolveUserFacingCliEntryCommand, Et as readLocalEnabledControllers, F as buildDaemonServiceRefreshNextStep, Fa as warnDaemonEvent, Fi as getEffectiveDaemonRuntimeStatus, Fr as buildAgentContextLookupKey, G as buildDaemonServiceDependencyDetails, Ga as DEFAULT_RECONNECT_DELAY_MS, Gn as isNpmGlobalCommandPath, Gt as bindProject, Ha as DAEMON_STREAM_CONNECT_TIMEOUT_MS, Hi as listDaemonOwnedProcesses, Hn as resolveBuiltinAgentControllerDefinition, Ho as isDaemonServiceContractIdentityReusable, I as buildDaemonServiceRefreshPromptMessage, Ia as CATALOG_SYNC_RETRY_INTERVAL_MS, Ii as readCurrentDaemonRuntimeContext, In as normalizeAgentId, Ir as DEFAULT_TASK_LIFECYCLE_HEARTBEAT_INTERVAL_MS, It as readProfileWorkspaceConfigForAccount, J as buildDaemonServiceDependencySummary, Ja as PROVIDER_CONVERSATION_PROOF_SYNC_INTERVAL_MS, Ji as DaemonServiceRunError, Jn as normalizeDispatchThreadAction, Jr as parseAgentControllerRef, Jt as listProjectConnectionsWithStatus, K as buildDaemonServiceDependencyMeaning, Ka as HEARTBEAT_RESPONSE_TIMEOUT_MS, Ki as ensureDaemonRuntimeContractState, Kn as isPnpmGlobalCommandPath, Ko as compareSemver, Kt as isProjectBound, La as CATALOG_SYNC_SIGNAL_POLL_INTERVAL_MS, Li as readCurrentObservedDaemonRuntimeStatus, Ln as normalizeAgentIds, Lr as areAgentControllerInterfaceAccountsSame, M as resolveDaemonStatusAuthenticationAttention, Ma as normalizeText$2, Mi as resolveStoppedContractWriteBlockedReason, Mo as runDaemonServiceManagerAction, Mr as upsertConversationExecutionState, Mt as resolveProfileWorkspaceRuntime, N as resolveServiceReadiness, Na as nowIsoString, Ni as summarizeDaemonOwnerSnapshot, Nn as resolveRegistryRuntimeAdapterCapabilitySnapshot, No as runWithDaemonLifecycleCommandJournal, Nr as withLedgerStateTransaction, Nt as ensureOpenMeldManagedProfileWorkspace, O as captureDaemonServiceEvidenceBestEffort, Oa as emitRunLine, Oi as formatDaemonOwnerSummaryLabel, On as canManageRegistryAgentSkillTargets, Oo as readLatestDaemonLifecycleConnectionStateEvent, Or as removeConversationExecutionState, Ot as resolveLocalRuntimeControllerSupport, Pa as toErrorMessage$10, Pi as clearDaemonRuntimeStateIfDefinitelyStopped, Pn as resolveRegistryRuntimeAdapterContractByAgentControllerRef, Pr as buildAuthenticatedControlPlaneResponse, Qa as RUNTIME_AGENT_CONTROLLER_REPORT_SYNC_RETRY_INTERVAL_MS, Qn as isDaemonReconcileInProgressError, Qr as renderWorkingLanguagePrompt, Qt as removeProjectConnection, R as buildDaemonServiceStatusReadOnlyDetail, Ra as CONTROLLED_SHUTDOWN_REQUEST_TIMEOUT_MS, Ri as resolveDaemonRuntimeState, Rn as parseAgentEnabledOption, Rr as buildAgentControllerRef, Rt as resolveConfiguredProfileWorkspacePathForAccount, S as isDaemonInventoryRunningAndStartReady$1, Sa as buildLedgerPaths, So as resolveDaemonBundleEntryPathFromState, Sr as runRuntimeTask, Ss as formatOpenMeldCliTextBlock, St as loadDaemonRouteCatalog, T as waitForSystemServiceStartup$1, Ta as resolvePreferredDaemonDeviceId, Ti as createProviderOriginalError, Tn as setAgentRegistrationEnabled, Tr as appendLedgerHistoryEntry, Tt as buildRuntimeRouteTargets, U as clearDaemonStartFailureState, Ua as DAEMON_STREAM_KEEPALIVE_INTERVAL_MS, Un as isBunGlobalCommandPath, Uo as readDaemonServiceContract, Ut as ProjectBindingOperationError, V as formatDaemonServiceUpdateRequiredMessage, Va as DAEMON_RUNTIME_CONTRACT_EPOCH, Vi as cleanupLegacySharedDaemonServiceState, Vn as EMPTY_AGENT_CONTROLLER_INTERFACE_CAPABILITIES, Vo as clearDaemonServiceContract, Vr as createAgentControllerInterfaceDisplayRows, W as writeDaemonStartFailureState, Wa as DAEMON_STREAM_KEEPALIVE_PONG_TIMEOUT_MS, Wn as isHomebrewCommandPath, Wo as upsertDaemonServiceContract, Wt as ProjectBindingStoreUpdateRequiredError, X as resolveDaemonServiceDependencyDiagnostics, Xa as REGISTER_RESPONSE_TIMEOUT_MS, Xn as SPACE_ACTION_CONTEXT_GUIDANCE_LINES, Xt as removeAgentActivityBindingsWhileDeliveryLocked, Y as buildDaemonServiceDependencyTitle, Ya as PROVIDER_CONVERSATION_PROOF_SYNC_RETRY_INTERVAL_MS, Yi as resolveCurrentDaemonExpectedVersion, Yn as syncRuntimeEventToInflightTaskControlRegistry, Za as RUNTIME_AGENT_CONTROLLER_REPORT_SYNC_INTERVAL_MS, Zn as SPACE_ACTION_TARGET_GUIDANCE_LINES, Zr as renderInformationProtectionPrompt, Zt as removeMissingProjectConnections, _ as DaemonServiceLifecycleDrainTimeoutError, _a as DAEMON_SERVICE_FULL_ALIGNMENT_ANOMALIES, _i as forkCodexAppServerThread, _n as listAgentRegistrations, _o as OPENMELD_VERSION, _r as resolveDispatchQueueLogMeta, _s as resolveAuthenticationReasonFromState, _t as readDaemonRouteCatalogCache, a as resolveServiceUpdateUrgency, aa as resolveCurrentOpenMeldAccountContext, ai as resolveCatalogSyncSkippedProfilesLogState, an as withAgentActivityDeliveryLock, ar as createLocalTaskInterruptSender, ba as classifyDaemonServiceRunStartability, bi as createUnavailableProviderUsageLimits, bn as readAgentRuntimeConfigHealth, bo as readDaemonActiveBundleState, br as resolveCompatibleConversationExecutionState, bs as formatOpenMeldCliCommands, bt as createMutableRouteCatalogState, ca as ensureDaemonSystemServiceCommandFiles, ci as parseOpenCodeGoUsageResponse, cn as syncDeviceRuntimeStateProjection, co as resolveOpenMeldEnvironmentTarget, cr as createInflightTaskControlRegistry, da as isOpenMeldManagedBinaryPath, di as GrokBuildAcpTransportError, dn as emitReconcileStartedEvidence, dr as MIN_HEARTBEAT_INTERVAL_MS, ds as buildHumanAuthenticationCard, er as createSerialAgentInteractionCallback, fa as buildDaemonServiceTargetSpec, fi as probeGrokBuildAcpInterface, fo as requestLocalDaemonShutdown, fr as applyAcceptedLeases, fs as createAuthenticationError, g as scheduleDaemonServiceUpdate, ga as DAEMON_SERVICE_AUTO_HEAL_ANOMALIES, gi as resolveInstalledCodexLaunchCandidates, gn as listAgentCustomTargets, go as readManagedCliInstallation, gr as resolveCatalogSyncIntervalMs, gt as slugifyOpenClawNamePart, hi as resolveCodexTimeoutMs, hn as createRegistrationFromCatalogTarget, hr as resolveAdaptiveHeartbeatIntervalMs, ht as normalizeOpenClawSpaceIdPrefix, i as writeOpenMeldToolsMaintenancePolicy, in as resolveLocalProjectConnectionForPath, io as clearAllSelectedOpenMeldProfileIds, ir as mergeOpenClawGatewayVisibility, j as resolveDaemonStatusAttention, ja as normalizeOptionalText$13, ji as resolveDaemonStopStrategy, jo as resolveRecentDaemonSignalStopCause, jr as settleInflightTask, jt as resolveCurrentEffectiveProfileWorkingFolderRuntime, k as formatDaemonFailureContextText, ka as normalizeHeartbeatIntervalMs, ki as hasActiveDaemonOwners, ko as readLatestDaemonLifecycleOriginEvent, kr as resolveConversationExecutionStateByLookupKey, la as extractDaemonCommandEntryPath, li as forkOpenCodeServerSession, ln as emitDriftDetectedEvidence, lo as resolveAuthBaseUrl, lr as ADAPTIVE_HEARTBEAT_JITTER_RATIO, ls as buildAuthenticationStatusLabel, ma as isVersionDowngrade, mi as projectCodexUsageLimits, mn as addAgentCustomTarget, mr as pruneStaleLeases, ms as resolveAuthenticationGuidance, mt as buildOpenClawSpaceSessionKey, n as readOpenMeldToolsMaintenancePolicy, no as resolveOpenMeldProfileOrNull, nr as normalizeDispatchPostMessageAction, o as assessServerRequiredVersion, oa as writeDaemonServiceContract, oi as createLocalAdapterContainer, on as withAgentActivityLocalStateLock, or as buildLocalServiceDiagnosticsPayload, pa as resolveDaemonServiceAlignmentDecision, pi as resolveInstalledGrokBuildLaunchCandidates, pn as resolveAgentProfilePrimaryAgentControllerReport, po as sendLocalDaemonControlPlaneRequest, pr as applyIntervalJitterMs$1, ps as extractAuthenticationPromptAction, pt as prepareProviderRuntime, q as buildDaemonServiceDependencyNextStep, qa as MAX_RECONNECT_DELAY_MS, qi as readDaemonRuntimeContractRepairReport, qt as listProjectBindings, r as resolveOpenMeldToolsMaintenanceProjection, rr as createPendingAgentInteractionRegistry, s as describeServerRequiredVersionUnavailableReason, sa as buildDaemonSystemServiceCommandSpec, si as createLocalAdapterEntries, sr as createLocalExecutionSlots, ss as readDaemonCatalogSyncSignal, t as createOpenMeldToolsUpdateCoordinator, ta as resolveRuntimeContext, tn as setDefaultProjectConnection, to as requireOpenMeldProfile, tr as buildDispatchReplyContextSummary, u as assessCliUpdate, ua as resolveDaemonBundleIdFromEntryPath, ui as resolveInstalledOpenCodeLaunchCandidates, un as emitReconcileCompletedEvidence, uo as LocalDaemonControlPlaneClientError, ur as MAX_HEARTBEAT_INTERVAL_MS, us as buildCommandAuthenticationPromptMessage$1, v as runDaemonServiceLifecycle, va as DAEMON_SERVICE_REPAIR_ANOMALIES, vi as verifyCodexAppServerThread, vn as listAgentTargetStates, vo as cleanupInactiveDaemonServiceBundles, vr as resolveDispatchContinuityObservation, vs as formatInlineOpenMeldCliCommands, vt as writeDaemonRouteCatalogCache, w as resolveSystemServiceStartupWaitMs, wa as resolveDaemonDeviceId, wi as materializeCliLaunchCommand, wn as resolveAgentTargetState, wr as buildTaskResultEnvelope, wt as syncDaemonRouteCatalogState, x as uninstallDaemonServiceUpdateWorker, xa as classifyDaemonServiceWakeability, xi as createUnsupportedProviderUsageLimits, xn as reconcileNewRunnableBuiltinAgentRegistrations, xo as resolveAlignedDaemonActiveBundleEntryPath, xr as resolveLatestScopedConversationExecutionState, xt as createRouteCatalogFromMutableState, y as ensureDaemonServiceMaintenanceInstalled, ya as DAEMON_SERVICE_WAKEABILITY_ADVISORY_ANOMALIES, yi as resolveInstalledClaudeCodeLaunchCandidates, yn as manageAgentRegistrationInstallation, yo as prepareDaemonServiceBundle, yr as resolveCompatibleAgentContextMatch, ys as formatOpenMeldCliCommand, yt as resolveLocalServiceDemand, z as buildDaemonServiceUpdateRequiredNextStep, za as CONTROLLED_SHUTDOWN_RESULT_ACK_TIMEOUT_MS, zi as resolveDaemonServiceManagerForRuntimeState, zn as sortAgentRegistrations, zr as buildInformationProtectionPromptPlan, zt as setCustomProfileWorkspace } from "./openmeld-tools-update-coordinator-BBZhGo1A.js";
8
+ import { $r as serviceConnectionEvidenceEventSchema, Bn as spaceEntryTargetSchema, Br as spaceMemberDirectoryEntrySchema, Cr as listCenterAgentRoutinesResponseSchema, En as DAEMON_STREAM_KEEPALIVE_PING, Er as updateCenterAgentRoutineResponseSchema, Fn as OPENMELD_HEADER_REQUEST_ID, Hn as SPACE_DISPATCH_TRACE_PROMPT_PREVIEW_MAX_CHARS, Hr as spaceMemberKindSchema, In as OPENMELD_HEADER_SPACE_ADDRESSING_VERSION, Jr as observedLocalAgentSessionSchema, Kr as agentActivitySessionInventoryResponseSchema, Nr as agentActivitySnapshotResponseSchema, Or as AGENT_ACTIVITY_PRESENCE_TTL_MAX_MS, Rr as spaceMemberAgentWakeAvailabilitySchema, Sr as listCenterAgentRoutineRunsResponseSchema, Tr as resumeCenterAgentRoutineResponseSchema, Tt as buildSpaceAttachmentDownloadPath, Vr as spaceMemberDirectorySchema, Yr as centerAgentToolSpeakerSchema, Zn as submitAgentControllerTaskLifecycleEventItemSchema, _r as organizationComputersResponseSchema, ai as createProjectResponseSchema, an as createSpaceApi, br as createCenterAgentRoutineResponseSchema, ci as updateProjectResponseSchema, cr as spaceCreatorSchema, di as computerFileAccessDaemonFrameSchema, dr as listOrganizationSkillsResponseSchema, ei as serviceConnectionEvidenceJournalSchema, fi as computerFileAccessPolicyInputSchema, gr as organizationDirectoryResponseSchema, ii as archiveProjectResponseSchema, in as createServiceConnectionEvidenceApi, ir as gatewayErrorEnvelopeSchema, jt as createAgentActivityApi, kr as agentActivityEventSchema, li as COMPUTER_FILE_ACCESS_RUNTIME_CAPABILITY, lr as spaceMetaSchema, mi as toCompatibleSpaceAddressingRequestWireValue, mr as organizationSkillSummarySchema, ni as localProjectControlDaemonFrameSchema, oi as listProjectsResponseSchema, or as organizationSpaceDirectoryWithMemberCountsResponseSchema, pi as computerFileAccessPolicySchema, pr as organizationSkillReleaseSummarySchema, ri as localProjectControlDiscoverProjectsResponseSchema, rn as createRuntimeReportingApi, si as projectSchema, t as OpenMeldApiClientHttpError, ti as localProjectControlConnectionSchema, ui as OPENMELD_RUNTIME_CAPABILITIES_HEADER, ur as getOrganizationSkillResponseSchema, vr as submitFeedbackIssueRequestSchema, wr as pauseCenterAgentRoutineResponseSchema, xr as deleteCenterAgentRoutineResponseSchema, yn as toStructuredApiClientFailure, yr as submitFeedbackIssueResponseSchema, zn as getSpaceUpdatesResponseSchema, zr as spaceMemberDirectoryAllowedRelationsSchema } from "./dist-CxadJClH.js";
9
+ import { $ as runtimeTransportResumeControllerConversationResultFramePayloadSchema, A as runtimeTransportDispatchPreviewEndRequestSchema, An as localFolderPickerHelperResultSchema, B as runtimeTransportLocalAgentControlForkSessionFramePayloadSchema, Bt as AGENT_INTERACTION_DEFAULT_TIMEOUT_MS, C as localWakeRouteWorkingFolderObservationSchema, D as runtimeTransportDispatchInteractionRequestSchema, Di as localAgentReasoningPreferencesSchema, Dn as OPENMELD_LOCAL_FOLDER_PICKER_CAPABILITY_HEADER, E as runtimeTransportDispatchInteractionDeliveredRequestSchema, Ei as OPENMELD_REASONING_STREAM_HEADER, En as LOCAL_FOLDER_PICKER_RUNTIME_CAPABILITY, G as runtimeTransportLocalAgentControlSetProfileWorkspaceFramePayloadSchema, Gn as sanitizeSignalTextPreview, Gt as formatLocalComponentsSummaryDescription, H as runtimeTransportLocalAgentControlManageInstallationFramePayloadSchema, Ht as agentInteractionRequestSchema, I as runtimeTransportForkAgentSessionResultSchema, Ii as normalizeOptionalWorkingDirectory, J as runtimeTransportOpenMeldToolsControlResultFramePayloadSchema, Jr as boolean, Jt as formatLocalSetupActionLabel, Kt as formatLocalComponentsSummaryLabel, L as runtimeTransportHeartbeatRequestSchema, Li as openMeldRuntimeProfileIdSchema, M as runtimeTransportDispatchReasoningRequestSchema, N as runtimeTransportDispatchRuntimeEvidenceRequestSchema, O as runtimeTransportDispatchInteractionResponseFramePayloadSchema, On as localFolderPickerDaemonFrameSchema, P as runtimeTransportDispatchToolActivityRequestSchema, Q as runtimeTransportResumeControllerConversationFramePayloadSchema, Qr as enumFactory, R as runtimeTransportHeartbeatResponseSchema, T as runtimeTransportDeliverDispatchRequestSchema, Ti as LOCAL_AGENT_REASONING_MAX_CHARS, Tt as openMeldDaemonControlPlaneResponseSchema, U as runtimeTransportLocalAgentControlRefreshCatalogFramePayloadSchema, V as runtimeTransportLocalAgentControlInterruptFramePayloadSchema, W as runtimeTransportLocalAgentControlSetEnabledFramePayloadSchema, X as runtimeTransportRegisterSessionResponseSchema, Xr as discriminatedUnion, Xt as localCliComponentUpdateProjectionSchema, Y as runtimeTransportRegisterSessionRequestSchema, Yi as resolvePublicAgentAvailabilityCopy, Yt as installedLocalComponentsSnapshotSchema, Zi as sanitizeDispatchErrorSummary, _n as normalizeSpacePasswordText, ar as collectCanonicalMentionTextFragments, ei as iso, en as localServiceComponentUpdateProjectionSchema, et as runtimeTransportRouteCatalogChangedFramePayloadSchema, ft as openMeldSpaceEgressActionSchema, hi as url, hr as resolveSpaceMentionLabels, ir as MESSAGE_MENTION_TYPE_VALUES, j as runtimeTransportDispatchPreviewRequestSchema, k as runtimeTransportDispatchLifecycleRequestSchema, ki as openMeldRequestContextSchema, kn as localFolderPickerHelperProtocolResultSchema, li as strictObject, lr as normalizeMessageEnvelope, mn as runtimeTransportDeliveryExecutionIdentitySchema, mr as resolveSingleSpaceMentionLabels, ni as literal, nt as runtimeTransportSubmitTaskResultRequestSchema, pn as runtimeCoordinatorExecutionTokenEnvelopeSchema, q as runtimeTransportOpenMeldToolsControlFramePayloadSchema, qt as formatLocalSetupActionDescription, sr as getSpaceMessageAddressingRelationSupportForTargetKind, ui as string, ur as resolveMessageEnvelopeTargetField, ut as openMeldDaemonTaskResultPayloadSchema, x as daemonStreamFrameSchema, y as CURRENT_DAEMON_EXECUTION_CONTRACT_EPOCH, z as runtimeTransportLocalAgentControlCancelFramePayloadSchema } from "./profiles-BCecj4Pj.js";
10
+ import { b as withSkillsInstallLock, f as ensureLocalSkills, g as loadSelectedSkillAssets, l as installSkillsToTargets, n as collectSkillsReadinessSnapshot, u as resolveSkillInstallStateForTarget, v as hashBundledSkillAssets, x as OFFICIAL_CLI_SKILL_URL, y as computeDirectoryContentHash } from "./installation-inventory-P49sTjhe.js";
11
11
  import { r as daemonServiceLaneSchema } from "./service-contract-CRyDcIIf.js";
12
- import { _ as setAuthSession, a as beginAuthSessionTransition, b as isBinaryDistribution, i as assertAuthSessionMutationAvailable, l as getAuthSessionState, o as clearAuthSession, x as resolveOpenMeldDistribution } from "./auth-session-BKtdaSHC.js";
12
+ import { C as resolveOpenMeldDistribution, S as isBinaryDistribution, a as beginAuthSessionTransition, g as onAuthSessionCredentialObservation, h as onAuthSessionCredentialAvailable, i as assertAuthSessionMutationAvailable, l as getAuthSessionState, o as clearAuthSession, y as setAuthSession } from "./auth-session-BjSqMLTz.js";
13
13
  import { a as readDaemonLocalStateFile, i as writeDaemonRuntimeLease, o as writeDaemonLocalStateFile } from "./daemon-runtime-lease-CXlGR-iA.js";
14
- import { $ as buildAgentFacingMentalModelLines, At as validateDaemonControlTargetInput, Ft as getBuiltinAgentSelectionRequiredArguments, Gt as waitForOpenMeldToolsUpdateCompletion, Ht as formatAgentOverviewPayload, Jt as sanitizeTerminalDisplayText, Kt as resolveOpenMeldToolsUpdateOperation, Lt as validateBuiltinAgentSelectionInput, Mt as buildBuiltinAgentSelectionCommand, Nt as buildBuiltinAgentSelectionExamples, Pt as getBuiltinAgentSelectionOptionalArguments, Qt as outLine, Rt as buildAgentOverviewFromContract, Y as SPACE_COLLABORATION_CONTEXT_RULE, Z as SPACE_PERSONAL_CONTRIBUTION_RULE, Zt as outJsonLine, a as formatDaemonServiceDowngradeBlockedRecommendation, at as buildSpaceWakeParticipantLines, ct as deriveContinuity, d as formatDaemonServiceMissingStatus, dt as resolvePublicAgentFailureReason, f as getDaemonDowngradeBlockedTitle, ft as resolveSpacePublicationRequirement, h as createAuthLoginGuideError, i as formatDaemonInstallFailedMessage, it as buildSpaceEntryBriefNeedMoreLine, l as formatDaemonServiceMissingRunStepOne, lt as isSelfWakeSpaceAction, m as canUseInteractivePrompts, n as resolveElapsedTimeMs, nt as buildCompactDispatchActionGuidanceLines, o as formatDaemonServiceMissingAction, p as runDaemonInstallDecisionPrompt, pt as getCommandEntryContract, qt as createPresenter, r as formatDaemonDowngradeBlockedNextStep, rt as buildSpaceAgentIdentityLine, s as formatDaemonServiceMissingMeaning, st as composeDispatchBrief, t as formatElapsedTime, tt as buildCenterAgentRoleTemplateText, u as formatDaemonServiceMissingRunStepTwo, ut as renderSpaceEntryBrief } from "./elapsed-time-G3Sw-Sx-.js";
15
- import { a as resolveBaseUrl, c as resolveExplicitGatewayUrlOrThrow, d as createDefaultRuntimeAgentControllerSettings, f as getConfiguredDaemonDispatchLimits, g as getConfiguredSkillsConfig, i as normalizeGatewayBaseUrlOrNull, l as DEFAULT_RUNTIME_AGENT_TRANSPORT_MODE, o as resolveBaseUrlOrNull, r as normalizeGatewayBaseUrl } from "./base-url-jWXPssF_.js";
14
+ import { $ as buildAgentFacingMentalModelLines, At as validateDaemonControlTargetInput, Ft as getBuiltinAgentSelectionRequiredArguments, Gt as waitForOpenMeldToolsUpdateCompletion, Ht as formatAgentOverviewPayload, Jt as sanitizeTerminalDisplayText, Kt as resolveOpenMeldToolsUpdateOperation, Lt as validateBuiltinAgentSelectionInput, Mt as buildBuiltinAgentSelectionCommand, Nt as buildBuiltinAgentSelectionExamples, Pt as getBuiltinAgentSelectionOptionalArguments, Qt as outLine, Rt as buildAgentOverviewFromContract, Y as SPACE_COLLABORATION_CONTEXT_RULE, Z as SPACE_PERSONAL_CONTRIBUTION_RULE, Zt as outJsonLine, a as formatDaemonServiceDowngradeBlockedRecommendation, at as buildSpaceWakeParticipantLines, ct as deriveContinuity, d as formatDaemonServiceMissingStatus, dt as resolvePublicAgentFailureReason, f as getDaemonDowngradeBlockedTitle, ft as resolveSpacePublicationRequirement, h as createAuthLoginGuideError, i as formatDaemonInstallFailedMessage, it as buildSpaceEntryBriefNeedMoreLine, l as formatDaemonServiceMissingRunStepOne, lt as isSelfWakeSpaceAction, m as canUseInteractivePrompts, n as resolveElapsedTimeMs, nt as buildCompactDispatchActionGuidanceLines, o as formatDaemonServiceMissingAction, p as runDaemonInstallDecisionPrompt, pt as getCommandEntryContract, qt as createPresenter, r as formatDaemonDowngradeBlockedNextStep, rt as buildSpaceAgentIdentityLine, s as formatDaemonServiceMissingMeaning, st as composeDispatchBrief, t as formatElapsedTime, tt as buildCenterAgentRoleTemplateText, u as formatDaemonServiceMissingRunStepTwo, ut as renderSpaceEntryBrief } from "./elapsed-time-C7P-nWIO.js";
15
+ import { a as resolveBaseUrl, c as resolveExplicitGatewayUrlOrThrow, d as createDefaultRuntimeAgentControllerSettings, f as getConfiguredDaemonDispatchLimits, g as getConfiguredSkillsConfig, i as normalizeGatewayBaseUrlOrNull, l as DEFAULT_RUNTIME_AGENT_TRANSPORT_MODE, o as resolveBaseUrlOrNull, r as normalizeGatewayBaseUrl } from "./base-url-9A557X2K.js";
16
16
  import { n as toErrorMessage$11, t as sleep } from "./dist-o3UL1EGQ.js";
17
- import { a as buildOpenMeldProfileIdentityRequestHeadersWithAuth, c as buildRequestAuthHeaders, d as buildOpenMeldRequestContextFromProfileIdentity, f as deriveAuthBaseUrlFromGatewayUrl, i as AuthRequestCredentialError, l as canAttachAuthTokenToRequest, n as fetchSpaceRequestWithTimeout, o as buildOpenMeldProfileRequestHeadersWithAuth, s as buildOpenMeldRequestContextHeadersWithAuth, t as createCliApiClientFoundation } from "./api-client-foundation-CStvOzAU.js";
17
+ import { a as buildOpenMeldProfileIdentityRequestHeadersWithAuth, c as buildRequestAuthHeaders, f as buildOpenMeldRequestContextFromProfileIdentity, i as AuthRequestCredentialError, l as canAttachAuthTokenToRequest, n as fetchSpaceRequestWithTimeout, o as buildOpenMeldProfileRequestHeadersWithAuth, p as deriveAuthBaseUrlFromGatewayUrl, s as buildOpenMeldRequestContextHeadersWithAuth, t as createCliApiClientFoundation, u as fingerprintRequestAuthorization } from "./api-client-foundation-DpgDs0rw.js";
18
18
  import { A as installDaemon, D as ensureDaemonControlPlaneToken, F as readDaemonServiceRuntimeSnapshot, G as withDaemonServiceRunLock, H as uninstallDaemon, I as releaseDaemonServiceLifecycleLock, K as withDaemonServiceStopLock, L as resolveDaemonControlPlaneEndpoint, R as resolveDaemonServiceRuntimeMetadata, U as withDaemonServiceReconcileLock, V as setDaemonServiceRuntimeState, W as withDaemonServiceRegistrationMutationLock, a as DAEMON_SERVICE_RUNTIME_MODE_ENV, c as acquireDaemonServiceLifecycleLock, d as daemonLifecycleJournalPath, g as daemonRuntimeStateRootPath, i as DAEMON_SERVICE_RUNTIME_DETACHED_ENV, j as isDaemonServiceRuntimeHeartbeatStale, k as getDaemonStatus, l as clearDaemonServiceRuntimeState, m as daemonRuntimeRootPath, o as DAEMON_SERVICE_RUNTIME_STATE_SCHEMA, u as daemonDispatchJournalPath, x as daemonServiceRepairJournalPath } from "./daemon-state-BwIoDq7_.js";
19
19
  import { S as resolveDaemonServiceManager, _ as readDaemonServiceJobCrashExitCode, a as disableDaemonServiceAutostartIfConfigured, c as getDaemonSystemServiceLogPath, f as isDaemonServiceJobSpawnPending, o as formatDaemonServiceJobDiagnosticsEvidence, s as getDaemonServiceLaunchdLabel } from "./daemon-service-manager-BVipiZwK.js";
20
20
  import { createHash, randomUUID } from "node:crypto";
@@ -37,6 +37,10 @@ import stringWidth from "string-width";
37
37
  import { Worker } from "node:worker_threads";
38
38
  import { createInterface } from "node:readline";
39
39
  import WebSocket from "ws";
40
+ //#region ../../packages/schemas/dist/schemas/daemon/service-connection-correlation.js
41
+ const SERVICE_CONNECTION_ID_QUERY_PARAMETER = "connectionId";
42
+ z$1.uuid();
43
+ //#endregion
40
44
  //#region ../../packages/schemas/dist/schemas/cli/daemon-status-server-requirement.js
41
45
  const cliVersionVerdictKindSchema = z$1.enum([
42
46
  "aligned",
@@ -7171,6 +7175,18 @@ const MAX_UPGRADE_REJECTION_BODY_BYTES = 2048;
7171
7175
  const UPGRADE_REJECTION_BODY_READ_TIMEOUT_MS = 1e3;
7172
7176
  const OPENMELD_REQUEST_ID_HEADER = "x-openmeld-request-id";
7173
7177
  const CLOUDFLARE_RAY_HEADER = "cf-ray";
7178
+ var WebSocketConnectionError = class extends Error {
7179
+ kind;
7180
+ status;
7181
+ requestId;
7182
+ constructor(message, kind, status, requestId) {
7183
+ super(message);
7184
+ this.name = "WebSocketConnectionError";
7185
+ this.kind = kind;
7186
+ this.status = status;
7187
+ this.requestId = requestId;
7188
+ }
7189
+ };
7174
7190
  async function connectWebSocket(url, input) {
7175
7191
  return await new Promise((resolve, reject) => {
7176
7192
  let settled = false;
@@ -7180,7 +7196,7 @@ async function connectWebSocket(url, input) {
7180
7196
  if (settled) return;
7181
7197
  settled = true;
7182
7198
  ws.terminate();
7183
- reject(/* @__PURE__ */ new Error(`websocket open timeout after ${openTimeoutMs}ms`));
7199
+ reject(new WebSocketConnectionError(`websocket open timeout after ${openTimeoutMs}ms`, "open_timeout"));
7184
7200
  }, openTimeoutMs);
7185
7201
  const closePromise = new Promise((r) => {
7186
7202
  ws.on("close", () => r());
@@ -7190,7 +7206,7 @@ async function connectWebSocket(url, input) {
7190
7206
  if (settled) return;
7191
7207
  settled = true;
7192
7208
  if (openTimeout) clearTimeout(openTimeout);
7193
- reject(/* @__PURE__ */ new Error(`websocket closed before open (code=${String(code)}, reason=${reason.toString("utf8")})`));
7209
+ reject(new WebSocketConnectionError(`websocket closed before open (code=${String(code)}, reason=${reason.toString("utf8")})`, "closed_before_open"));
7194
7210
  });
7195
7211
  if (!isBunRuntime()) ws.on("unexpected-response", (_request, response) => {
7196
7212
  if (settled) return;
@@ -7244,14 +7260,13 @@ async function buildWebSocketUpgradeRejectedError(response) {
7244
7260
  const body = await readBodyExcerpt(response);
7245
7261
  const requestId = readHeaderValue(response, OPENMELD_REQUEST_ID_HEADER) ?? readRequestIdFromJsonBody(body.excerpt);
7246
7262
  const cfRay = readHeaderValue(response, CLOUDFLARE_RAY_HEADER);
7247
- const fields = [
7263
+ return new WebSocketConnectionError(`daemon stream upgrade rejected (${[
7248
7264
  `status=${String(response.statusCode ?? "unknown")}`,
7249
7265
  ...response.statusMessage ? [`statusText=${JSON.stringify(response.statusMessage)}`] : [],
7250
7266
  ...requestId ? [`requestId=${JSON.stringify(requestId)}`] : [],
7251
7267
  ...cfRay ? [`cfRay=${JSON.stringify(cfRay)}`] : [],
7252
7268
  ...body.excerpt ? [`bodyExcerpt=${JSON.stringify(body.excerpt)}${body.truncated ? " bodyTruncated=true" : ""}`] : []
7253
- ];
7254
- return /* @__PURE__ */ new Error(`daemon stream upgrade rejected (${fields.join(", ")})`);
7269
+ ].join(", ")})`, "upgrade_rejected", response.statusCode, requestId ?? void 0);
7255
7270
  }
7256
7271
  function readBodyExcerpt(response) {
7257
7272
  return new Promise((resolve) => {
@@ -7778,6 +7793,7 @@ function resolveControlPlaneErrorCode(error) {
7778
7793
  const DAEMON_DISPATCH_EVENT_TYPES = [
7779
7794
  "dispatch.deliver.received",
7780
7795
  "dispatch.local.phase",
7796
+ "dispatch.reply_reconsideration",
7781
7797
  "dispatch.lifecycle.sent",
7782
7798
  "dispatch.lifecycle.send_failed",
7783
7799
  "dispatch.result.queued",
@@ -12831,6 +12847,275 @@ function collectErrorMessages(error) {
12831
12847
  return [...new Set(messages)];
12832
12848
  }
12833
12849
  //#endregion
12850
+ //#region src/local-service/lifecycle/service-connection-evidence.ts
12851
+ const LOCAL_RETENTION_MS = 10080 * 6e4;
12852
+ const MAX_JOURNAL_BYTES = 1024 * 1024;
12853
+ const MAX_PENDING_EVENT_WRITES = 128;
12854
+ function createServiceConnectionEvidenceRecorder(input) {
12855
+ const ownerKey = createHash("sha256").update(input.ownerUserId).digest("hex");
12856
+ const path = join(daemonRuntimeStateRootPath(), `connection-evidence-${ownerKey}.json`);
12857
+ const send = input.sendIncident ?? createServiceConnectionEvidenceApi(createCliApiClientFoundation(input.gatewayUrl, { expectedOwnerUserId: input.ownerUserId })).report;
12858
+ let journal = null;
12859
+ let writes = Promise.resolve();
12860
+ let prelude = [];
12861
+ let online = false;
12862
+ let disposed = false;
12863
+ let uploading = false;
12864
+ let failureCount = 0;
12865
+ let uploadTimer = null;
12866
+ let pendingEventWrites = 0;
12867
+ const truncatedRecoveryIds = /* @__PURE__ */ new Set();
12868
+ let writeFailureReported = false;
12869
+ function mutate(update) {
12870
+ writes = writes.then(async () => {
12871
+ journal ??= await readDaemonLocalStateFile({
12872
+ path,
12873
+ schema: serviceConnectionEvidenceJournalSchema
12874
+ }) ?? {
12875
+ v: 1,
12876
+ entries: []
12877
+ };
12878
+ update(journal);
12879
+ journal.entries = journal.entries.filter((entry) => entry.incident.endedAtMs >= Date.now() - LOCAL_RETENTION_MS);
12880
+ while (journal.entries.length > 32 || Buffer.byteLength(JSON.stringify(journal, null, 2), "utf8") + 1 > MAX_JOURNAL_BYTES) journal.entries.shift();
12881
+ await writeDaemonLocalStateFile({
12882
+ path,
12883
+ value: journal,
12884
+ schema: serviceConnectionEvidenceJournalSchema,
12885
+ mode: 384
12886
+ });
12887
+ writeFailureReported = false;
12888
+ }).catch(() => {
12889
+ if (!writeFailureReported) {
12890
+ writeFailureReported = true;
12891
+ console.warn("[openmeld:connection-evidence] Local connection history could not be saved.");
12892
+ }
12893
+ });
12894
+ return writes;
12895
+ }
12896
+ function scheduleUpload(delayMs = 0) {
12897
+ if (disposed || !online || uploading || uploadTimer) return;
12898
+ uploadTimer = setTimeout(() => {
12899
+ uploadTimer = null;
12900
+ uploadPending().catch(() => void 0);
12901
+ }, delayMs);
12902
+ uploadTimer.unref();
12903
+ }
12904
+ async function uploadPending() {
12905
+ if (!online || disposed || uploading) return;
12906
+ uploading = true;
12907
+ try {
12908
+ await mutate(() => void 0);
12909
+ const entry = journal?.entries.find((item) => item.uploadedAtMs === null && (item.incident.outcome === "recovered" || item.incident.serviceSessionId !== input.identity.serviceSessionId));
12910
+ if (!entry) return;
12911
+ const receipt = await send({
12912
+ uploaderServiceSessionId: input.identity.serviceSessionId,
12913
+ incident: entry.incident
12914
+ });
12915
+ if (receipt.incidentId !== entry.incident.incidentId) throw new Error("connection_incident_receipt_mismatch");
12916
+ await mutate((state) => {
12917
+ const saved = state.entries.find((item) => item.incident.incidentId === receipt.incidentId);
12918
+ if (saved) saved.uploadedAtMs = receipt.receivedAtMs;
12919
+ });
12920
+ failureCount = 0;
12921
+ } catch {
12922
+ failureCount += 1;
12923
+ } finally {
12924
+ uploading = false;
12925
+ if (journal?.entries.some((item) => item.uploadedAtMs === null && (item.incident.outcome === "recovered" || item.incident.serviceSessionId !== input.identity.serviceSessionId))) scheduleUpload(failureCount ? Math.min(15 * 6e4, 3e4 * 2 ** Math.min(failureCount - 1, 5)) : 1e3);
12926
+ }
12927
+ }
12928
+ function record(inputEvent) {
12929
+ if (disposed) return;
12930
+ const parsed = serviceConnectionEvidenceEventSchema.safeParse(inputEvent.event);
12931
+ if (!parsed.success) return;
12932
+ const event = parsed.data;
12933
+ if (!inputEvent.recovery) {
12934
+ prelude = [...prelude, event].filter((item) => item.lastAtMs >= event.lastAtMs - 5 * 6e4).slice(-10);
12935
+ return;
12936
+ }
12937
+ const recovery = inputEvent.recovery;
12938
+ if (pendingEventWrites >= MAX_PENDING_EVENT_WRITES) {
12939
+ if (truncatedRecoveryIds.size < 32) truncatedRecoveryIds.add(recovery.recoveryId);
12940
+ return;
12941
+ }
12942
+ const precedingEvents = prelude;
12943
+ prelude = [];
12944
+ pendingEventWrites += 1;
12945
+ mutate((state) => {
12946
+ let entry = state.entries.find((item) => item.incident.incidentId === recovery.recoveryId);
12947
+ if (!entry) {
12948
+ entry = {
12949
+ uploadedAtMs: null,
12950
+ incident: {
12951
+ v: 1,
12952
+ ...input.identity,
12953
+ incidentId: recovery.recoveryId,
12954
+ startedAtMs: recovery.disconnectedAt,
12955
+ endedAtMs: Math.max(recovery.disconnectedAt, event.lastAtMs),
12956
+ outcome: "interrupted",
12957
+ evidenceTruncated: false,
12958
+ events: precedingEvents
12959
+ }
12960
+ };
12961
+ state.entries.push(entry);
12962
+ }
12963
+ const incident = entry.incident;
12964
+ if (truncatedRecoveryIds.delete(recovery.recoveryId)) incident.evidenceTruncated = true;
12965
+ appendEvent(incident, event);
12966
+ incident.endedAtMs = Math.max(incident.endedAtMs, event.lastAtMs);
12967
+ if (event.kind === "registered" && event.reason === "recovered") incident.outcome = "recovered";
12968
+ }).then(() => scheduleUpload()).finally(() => {
12969
+ pendingEventWrites -= 1;
12970
+ }).catch(() => void 0);
12971
+ }
12972
+ return {
12973
+ record,
12974
+ setOnline(value) {
12975
+ if (online === value) return;
12976
+ online = value;
12977
+ if (uploadTimer) {
12978
+ clearTimeout(uploadTimer);
12979
+ uploadTimer = null;
12980
+ }
12981
+ if (value) scheduleUpload();
12982
+ },
12983
+ flush: () => writes,
12984
+ dispose() {
12985
+ disposed = true;
12986
+ online = false;
12987
+ if (uploadTimer) {
12988
+ clearTimeout(uploadTimer);
12989
+ uploadTimer = null;
12990
+ }
12991
+ }
12992
+ };
12993
+ }
12994
+ function appendEvent(incident, event) {
12995
+ const previous = incident.events.at(-1);
12996
+ if (previous && previous.kind === event.kind && previous.reason === event.reason && previous.phase === event.phase && previous.connectionId === event.connectionId && previous.nativeErrorCode === event.nativeErrorCode && previous.closeCode === event.closeCode) incident.events[incident.events.length - 1] = {
12997
+ ...event,
12998
+ firstAtMs: previous.firstAtMs,
12999
+ count: Math.min(1e7, previous.count + event.count)
13000
+ };
13001
+ else incident.events.push(event);
13002
+ if (incident.events.length > 100) {
13003
+ incident.events.splice(10, incident.events.length - 100);
13004
+ incident.evidenceTruncated = true;
13005
+ }
13006
+ }
13007
+ function readServiceConnectionFailureEvidence(error) {
13008
+ const code = typeof error === "object" && error !== null && "code" in error ? error.code : void 0;
13009
+ const nativeCode = serviceConnectionEvidenceEventSchema.shape.nativeErrorCode.safeParse(code);
13010
+ const requestId = serviceConnectionEvidenceEventSchema.shape.requestId.safeParse(error instanceof WebSocketConnectionError ? error.requestId : void 0);
13011
+ let reason = "unknown";
13012
+ if (error instanceof WebSocketConnectionError) {
13013
+ if (error.kind === "open_timeout") reason = "open_timeout";
13014
+ else if (error.kind === "closed_before_open") reason = "socket_closed";
13015
+ else if (error.status === 401) reason = "auth_rejected";
13016
+ }
13017
+ return {
13018
+ reason,
13019
+ ...nativeCode.success && nativeCode.data ? { nativeErrorCode: nativeCode.data } : {},
13020
+ ...requestId.success && requestId.data ? { requestId: requestId.data } : {}
13021
+ };
13022
+ }
13023
+ //#endregion
13024
+ //#region src/local-service/lifecycle/service-connection-evidence-observer.ts
13025
+ function createServiceConnectionEvidenceObserver(input) {
13026
+ const recorder = createServiceConnectionEvidenceRecorder(input);
13027
+ let connectionId = randomUUID();
13028
+ let phase = "credentials";
13029
+ let lastHeartbeatAckAtMs;
13030
+ let attemptStartedAtMs = Date.now();
13031
+ let retryDueAtMs;
13032
+ const record = (event) => {
13033
+ const atMs = Date.now();
13034
+ recorder.record({
13035
+ recovery: input.getRecovery(),
13036
+ event: {
13037
+ ...event,
13038
+ connectionId,
13039
+ phase,
13040
+ firstAtMs: atMs,
13041
+ lastAtMs: atMs,
13042
+ count: 1,
13043
+ ...lastHeartbeatAckAtMs === void 0 ? {} : { lastHeartbeatAckAtMs }
13044
+ }
13045
+ });
13046
+ };
13047
+ return {
13048
+ get connectionDiagnosticId() {
13049
+ return connectionId;
13050
+ },
13051
+ beginAttempt() {
13052
+ connectionId = randomUUID();
13053
+ phase = "credentials";
13054
+ attemptStartedAtMs = Date.now();
13055
+ record({
13056
+ kind: "connecting",
13057
+ reason: "unknown",
13058
+ ...retryDueAtMs === void 0 ? {} : { eventLoopDelayMs: Math.max(0, attemptStartedAtMs - retryDueAtMs) }
13059
+ });
13060
+ retryDueAtMs = void 0;
13061
+ },
13062
+ opening() {
13063
+ phase = "opening";
13064
+ },
13065
+ opened(socket) {
13066
+ phase = "registering";
13067
+ record({
13068
+ kind: "transport_open",
13069
+ reason: "unknown"
13070
+ });
13071
+ const openedId = connectionId;
13072
+ socket.onClose((closeCode) => {
13073
+ if (openedId === connectionId) record({
13074
+ kind: "disconnected",
13075
+ reason: input.isStopping() ? "stopped" : "socket_closed",
13076
+ closeCode
13077
+ });
13078
+ });
13079
+ },
13080
+ acknowledged(heartbeatAt, transitioned) {
13081
+ const timestamp = Date.parse(heartbeatAt);
13082
+ if (Number.isFinite(timestamp)) lastHeartbeatAckAtMs = timestamp;
13083
+ phase = "online";
13084
+ if (transitioned) record({
13085
+ kind: "registered",
13086
+ reason: "recovered",
13087
+ durationMs: Math.max(0, Date.now() - (input.getRecovery()?.disconnectedAt ?? attemptStartedAtMs))
13088
+ });
13089
+ recorder.setOnline(true);
13090
+ },
13091
+ retry(error, connectionReason, backoffMs) {
13092
+ recorder.setOnline(false);
13093
+ const evidence = readServiceConnectionFailureEvidence(error);
13094
+ const reason = connectionReason === "auth_unavailable" || connectionReason === "auth_rejected" ? connectionReason : evidence.reason;
13095
+ record({
13096
+ kind: "disconnected",
13097
+ ...evidence,
13098
+ reason,
13099
+ durationMs: Math.max(0, Date.now() - attemptStartedAtMs)
13100
+ });
13101
+ phase = "waiting";
13102
+ retryDueAtMs = Date.now() + backoffMs;
13103
+ record({
13104
+ kind: "retry_scheduled",
13105
+ reason,
13106
+ retryAtMs: retryDueAtMs
13107
+ });
13108
+ },
13109
+ credential(reason) {
13110
+ record({
13111
+ kind: "credential_cache",
13112
+ reason
13113
+ });
13114
+ },
13115
+ dispose: recorder.dispose
13116
+ };
13117
+ }
13118
+ //#endregion
12834
13119
  //#region src/agents/controller-version-channel.ts
12835
13120
  const LATEST_VERSION_TIMEOUT_MS = 4e3;
12836
13121
  const LATEST_VERSION_CACHE_TTL_MS = 3600 * 1e3;
@@ -14979,8 +15264,7 @@ async function submitRuntimeAgentControllerReports(input) {
14979
15264
  failure: {
14980
15265
  authenticationRejected: false,
14981
15266
  message: "OpenMeld Service contract is unavailable.",
14982
- reasonCode: "runtime.reporting.service_contract_unavailable",
14983
- requiresCarrierHandshake: false
15267
+ reasonCode: "runtime.reporting.service_contract_unavailable"
14984
15268
  },
14985
15269
  onAttempt: input.onAttempt,
14986
15270
  submissions: unavailableSubmissions({
@@ -14991,13 +15275,12 @@ async function submitRuntimeAgentControllerReports(input) {
14991
15275
  });
14992
15276
  const authCompatibility = await resolveRuntimeReportingAuthCompatibility(serviceContract.gatewayUrl);
14993
15277
  if (authCompatibility.status === "unavailable") {
14994
- const reasonCode = `runtime.reporting.auth_${authCompatibility.authState}`;
15278
+ const reasonCode = `runtime.reporting.${authCompatibility.reasonCode ?? `auth_${authCompatibility.authState}`}`;
14995
15279
  return await finishRuntimeAgentControllerReportingAttempt({
14996
15280
  failure: {
14997
15281
  authenticationRejected: false,
14998
15282
  message: `Local authentication is ${authCompatibility.authState}.`,
14999
- reasonCode,
15000
- requiresCarrierHandshake: authCompatibility.authState !== "error"
15283
+ reasonCode
15001
15284
  },
15002
15285
  onAttempt: input.onAttempt,
15003
15286
  submissions: failedSubmissions({
@@ -15012,8 +15295,7 @@ async function submitRuntimeAgentControllerReports(input) {
15012
15295
  failure: {
15013
15296
  authenticationRejected: false,
15014
15297
  message: "The local authentication session does not match the reporting Gateway.",
15015
- reasonCode: "runtime.reporting.auth_gateway_mismatch",
15016
- requiresCarrierHandshake: false
15298
+ reasonCode: "runtime.reporting.auth_gateway_mismatch"
15017
15299
  },
15018
15300
  onAttempt: input.onAttempt,
15019
15301
  submissions: failedSubmissions({
@@ -15025,8 +15307,11 @@ async function submitRuntimeAgentControllerReports(input) {
15025
15307
  reasonCode: "runtime.reporting.auth_gateway_mismatch"
15026
15308
  })
15027
15309
  });
15310
+ let credentialFingerprint;
15028
15311
  try {
15029
- const api = createRuntimeReportingApi(createCliApiClientFoundation(serviceContract.gatewayUrl));
15312
+ const api = createRuntimeReportingApi(createCliApiClientFoundation(serviceContract.gatewayUrl, { onAuthHeadersResolved: (headers) => {
15313
+ credentialFingerprint = headers.Authorization ? fingerprintRequestAuthorization(headers.Authorization) : void 0;
15314
+ } }));
15030
15315
  const registration = await api.submitRegistration({
15031
15316
  deviceId: serviceContract.deviceId,
15032
15317
  lane: serviceContract.lane
@@ -15037,8 +15322,7 @@ async function submitRuntimeAgentControllerReports(input) {
15037
15322
  failure: {
15038
15323
  authenticationRejected: false,
15039
15324
  message: `Runtime registration was rejected: ${registration.reason ?? "rejected"}.`,
15040
- reasonCode,
15041
- requiresCarrierHandshake: false
15325
+ reasonCode
15042
15326
  },
15043
15327
  onAttempt: input.onAttempt,
15044
15328
  submissions: failedSubmissions({
@@ -15075,6 +15359,7 @@ async function submitRuntimeAgentControllerReports(input) {
15075
15359
  });
15076
15360
  } catch (error) {
15077
15361
  const failure = resolveRuntimeReportingWriteFailure({
15362
+ credentialFingerprint,
15078
15363
  error,
15079
15364
  reasonCodePrefix: "runtime.reporting"
15080
15365
  });
@@ -15104,8 +15389,7 @@ async function submitRuntimeProviderConversationProofs(input) {
15104
15389
  failure: {
15105
15390
  authenticationRejected: false,
15106
15391
  message: "OpenMeld Service contract is unavailable.",
15107
- reasonCode,
15108
- requiresCarrierHandshake: false
15392
+ reasonCode
15109
15393
  },
15110
15394
  onAttempt: input.onAttempt,
15111
15395
  submissions: unavailableProviderConversationProofSubmissions({
@@ -15117,13 +15401,12 @@ async function submitRuntimeProviderConversationProofs(input) {
15117
15401
  }
15118
15402
  const authCompatibility = await resolveRuntimeReportingAuthCompatibility(serviceContract.gatewayUrl);
15119
15403
  if (authCompatibility.status === "unavailable") {
15120
- const reasonCode = `provider_conversation.runtime_reporting.auth_${authCompatibility.authState}`;
15404
+ const reasonCode = `provider_conversation.runtime_reporting.${authCompatibility.reasonCode ?? `auth_${authCompatibility.authState}`}`;
15121
15405
  return await finishProviderConversationProofReportingAttempt({
15122
15406
  failure: {
15123
15407
  authenticationRejected: false,
15124
15408
  message: `Local authentication is ${authCompatibility.authState}.`,
15125
- reasonCode,
15126
- requiresCarrierHandshake: authCompatibility.authState !== "error"
15409
+ reasonCode
15127
15410
  },
15128
15411
  onAttempt: input.onAttempt,
15129
15412
  submissions: failedProviderConversationProofSubmissions({
@@ -15140,8 +15423,7 @@ async function submitRuntimeProviderConversationProofs(input) {
15140
15423
  failure: {
15141
15424
  authenticationRejected: false,
15142
15425
  message: "The local authentication session does not match the reporting Gateway.",
15143
- reasonCode,
15144
- requiresCarrierHandshake: false
15426
+ reasonCode
15145
15427
  },
15146
15428
  onAttempt: input.onAttempt,
15147
15429
  submissions: failedProviderConversationProofSubmissions({
@@ -15154,8 +15436,11 @@ async function submitRuntimeProviderConversationProofs(input) {
15154
15436
  })
15155
15437
  });
15156
15438
  }
15439
+ let credentialFingerprint;
15157
15440
  try {
15158
- const api = createRuntimeReportingApi(createCliApiClientFoundation(serviceContract.gatewayUrl));
15441
+ const api = createRuntimeReportingApi(createCliApiClientFoundation(serviceContract.gatewayUrl, { onAuthHeadersResolved: (headers) => {
15442
+ credentialFingerprint = headers.Authorization ? fingerprintRequestAuthorization(headers.Authorization) : void 0;
15443
+ } }));
15159
15444
  const registration = await api.submitRegistration({
15160
15445
  deviceId: serviceContract.deviceId,
15161
15446
  lane: serviceContract.lane
@@ -15166,8 +15451,7 @@ async function submitRuntimeProviderConversationProofs(input) {
15166
15451
  failure: {
15167
15452
  authenticationRejected: false,
15168
15453
  message: `Runtime registration was rejected: ${registration.reason ?? "rejected"}.`,
15169
- reasonCode,
15170
- requiresCarrierHandshake: false
15454
+ reasonCode
15171
15455
  },
15172
15456
  onAttempt: input.onAttempt,
15173
15457
  submissions: failedProviderConversationProofSubmissions({
@@ -15196,6 +15480,7 @@ async function submitRuntimeProviderConversationProofs(input) {
15196
15480
  });
15197
15481
  } catch (error) {
15198
15482
  const failure = resolveRuntimeReportingWriteFailure({
15483
+ credentialFingerprint,
15199
15484
  error,
15200
15485
  reasonCodePrefix: "provider_conversation.runtime_reporting"
15201
15486
  });
@@ -15223,11 +15508,11 @@ async function finishRuntimeAgentControllerReportingAttempt(input) {
15223
15508
  reasonCodes: failedSubmission.reasonCodes
15224
15509
  }) : null);
15225
15510
  await notifyRuntimeReportingAttemptObserver(input.onAttempt, {
15511
+ ...failure?.credentialFingerprint ? { credentialFingerprint: failure.credentialFingerprint } : {},
15226
15512
  authenticationRejected: failure?.authenticationRejected ?? false,
15227
15513
  family: "runtime_agent_controller",
15228
15514
  message: failure?.message ?? null,
15229
15515
  reasonCode: failure?.reasonCode ?? null,
15230
- requiresCarrierHandshake: failure?.requiresCarrierHandshake ?? false,
15231
15516
  status: failure ? "failed" : "succeeded"
15232
15517
  });
15233
15518
  return input.submissions;
@@ -15239,11 +15524,11 @@ async function finishProviderConversationProofReportingAttempt(input) {
15239
15524
  reasonCodes: failedSubmission.reasonCodes
15240
15525
  }) : null);
15241
15526
  await notifyRuntimeReportingAttemptObserver(input.onAttempt, {
15527
+ ...failure?.credentialFingerprint ? { credentialFingerprint: failure.credentialFingerprint } : {},
15242
15528
  authenticationRejected: failure?.authenticationRejected ?? false,
15243
15529
  family: "provider_conversation_proof",
15244
15530
  message: failure?.message ?? null,
15245
15531
  reasonCode: failure?.reasonCode ?? null,
15246
- requiresCarrierHandshake: failure?.requiresCarrierHandshake ?? false,
15247
15532
  status: failure ? "failed" : "succeeded"
15248
15533
  });
15249
15534
  return input.submissions;
@@ -15253,22 +15538,21 @@ function buildSubmissionFailure(input) {
15253
15538
  return {
15254
15539
  authenticationRejected: false,
15255
15540
  message: `Runtime reporting failed: ${reasonCode}.`,
15256
- reasonCode,
15257
- requiresCarrierHandshake: false
15541
+ reasonCode
15258
15542
  };
15259
15543
  }
15260
15544
  function resolveRuntimeReportingWriteFailure(input) {
15261
15545
  const failure = toStructuredApiClientFailure(input.error);
15262
- const authenticationRejected = failure.status === 401 || failure.code === "auth.unauthenticated" || failure.message.toLowerCase().includes("authentication required");
15546
+ const authenticationRejected = failure.status === 401 || failure.status === null && failure.code === "auth.unauthenticated";
15263
15547
  return {
15548
+ ...authenticationRejected && input.credentialFingerprint ? { credentialFingerprint: input.credentialFingerprint } : {},
15264
15549
  authenticationRejected,
15265
15550
  message: resolveSafeRuntimeReportingFailureMessage({
15266
15551
  authenticationRejected,
15267
15552
  message: failure.message,
15268
15553
  status: failure.status
15269
15554
  }),
15270
- reasonCode: `${input.reasonCodePrefix}.${authenticationRejected ? "authentication_required" : "write_failed"}`,
15271
- requiresCarrierHandshake: false
15555
+ reasonCode: `${input.reasonCodePrefix}.${authenticationRejected ? "authentication_required" : "write_failed"}`
15272
15556
  };
15273
15557
  }
15274
15558
  function resolveSafeRuntimeReportingFailureMessage(input) {
@@ -15290,7 +15574,6 @@ async function notifyRuntimeReportingAttemptObserver(observer, attempt) {
15290
15574
  event: "cli.runtime_reporting.attempt_observer_failed",
15291
15575
  family: attempt.family,
15292
15576
  reasonCode: attempt.reasonCode,
15293
- requiresCarrierHandshake: attempt.requiresCarrierHandshake,
15294
15577
  status: attempt.status
15295
15578
  });
15296
15579
  }
@@ -15513,12 +15796,13 @@ function failedProviderConversationProofSubmissions(input) {
15513
15796
  }));
15514
15797
  }
15515
15798
  async function resolveRuntimeReportingAuthCompatibility(gatewayUrl) {
15516
- const authState = await getAuthSessionState().catch(() => null);
15799
+ const authState = await getAuthSessionState({ refreshExpired: true }).catch(() => null);
15517
15800
  if (!authState) return {
15518
15801
  authState: "error",
15519
15802
  status: "unavailable"
15520
15803
  };
15521
15804
  if (!(authState.state === "valid" && authState.session)) return {
15805
+ reasonCode: authState.reasonCode,
15522
15806
  authState: authState.state === "expired" || authState.state === "invalid" ? authState.state : "missing",
15523
15807
  status: "unavailable"
15524
15808
  };
@@ -15599,7 +15883,6 @@ async function syncLocalServiceRuntimeAgentControllerReports(input) {
15599
15883
  family: "runtime_agent_controller",
15600
15884
  message: "Local agent inventory collection failed.",
15601
15885
  reasonCode: "runtime.reporting.inventory_failed",
15602
- requiresCarrierHandshake: false,
15603
15886
  status: "failed"
15604
15887
  });
15605
15888
  throw error;
@@ -15621,7 +15904,6 @@ async function syncLocalServiceRuntimeAgentControllerReports(input) {
15621
15904
  family: "runtime_agent_controller",
15622
15905
  message: "No local controllers are installed on this computer.",
15623
15906
  reasonCode: "runtime.agent_controller_report.no_local_controllers",
15624
- requiresCarrierHandshake: false,
15625
15907
  status: "not_applicable"
15626
15908
  });
15627
15909
  return {
@@ -15775,7 +16057,8 @@ function isSameServiceIdentity(left, right) {
15775
16057
  function createRuntimeReportingAttemptObserver(input) {
15776
16058
  return async (attempt) => {
15777
16059
  await persistRuntimeReportingAttempt(attempt, input.serviceIdentity);
15778
- if (attempt.status === "failed" && (attempt.authenticationRejected || attempt.requiresCarrierHandshake) && attempt.reasonCode && attempt.message) await input.onAuthenticationFailure?.({
16060
+ if (attempt.status === "failed" && attempt.authenticationRejected && attempt.reasonCode && attempt.message) await input.onAuthenticationFailure?.({
16061
+ ...attempt.credentialFingerprint ? { credentialFingerprint: attempt.credentialFingerprint } : {},
15779
16062
  message: attempt.message,
15780
16063
  reasonCode: attempt.reasonCode
15781
16064
  });
@@ -16019,7 +16302,6 @@ function classifyConnectionFailureReason(message) {
16019
16302
  const lowered = message.toLowerCase();
16020
16303
  const upgradeRejectionStatus = readDaemonStreamUpgradeRejectionStatus(lowered);
16021
16304
  if (upgradeRejectionStatus !== null) return upgradeRejectionStatus === 401 ? "auth_rejected" : "internal";
16022
- if (lowered.includes("authentication required") || lowered.includes("unauthorized")) return "auth_rejected";
16023
16305
  if (lowered.includes("fetch failed") || lowered.includes("timed out") || lowered.includes("timeout") || lowered.includes("econn") || lowered.includes("enotfound") || lowered.includes("socket") || lowered.includes("network")) return "network_unreachable";
16024
16306
  return "internal";
16025
16307
  }
@@ -16398,355 +16680,6 @@ function createDaemonLocalExecutionSlots(input) {
16398
16680
  });
16399
16681
  }
16400
16682
  //#endregion
16401
- //#region src/local-service/status/service-participation-status.ts
16402
- async function resolveDaemonServiceParticipationStatus(input) {
16403
- const expectedVersion = input?.expectedVersion ?? await resolveCurrentDaemonExpectedVersion();
16404
- const inventory = await inspectDaemonServiceInventory({ expectedVersion });
16405
- if (!(inventory.installStatus.installed && inventory.installStatus.state)) return {
16406
- kind: "missing",
16407
- expectedVersion
16408
- };
16409
- const installedVersion = inventory.installStatus.state.daemonVersion;
16410
- const wakeability = classifyDaemonServiceWakeability({ inventory });
16411
- const blockingServiceDriftCodes = wakeability.blockingCodes;
16412
- const runBlockingServiceDriftCodes = classifyDaemonServiceRunStartability({ inventory }).blockingCodes;
16413
- const repairAnomalies = inventory.anomalies.filter((anomaly) => [...blockingServiceDriftCodes, ...runBlockingServiceDriftCodes].includes(anomaly.code));
16414
- if (repairAnomalies.length > 0) return {
16415
- kind: "needs_repair",
16416
- expectedVersion,
16417
- installedVersion,
16418
- runtimeStatus: inventory.runtimeStatus.status,
16419
- detail: repairAnomalies[0]?.message ?? "OpenMeld found conflicting local service state on this device.",
16420
- anomalyCodes: inventory.anomalies.map((anomaly) => anomaly.code)
16421
- };
16422
- if (inventory.runtimeStatus.status !== "running") return {
16423
- kind: "not_running",
16424
- expectedVersion,
16425
- installedVersion,
16426
- runtimeStatus: inventory.runtimeStatus.status
16427
- };
16428
- return {
16429
- kind: "ready",
16430
- expectedVersion,
16431
- installedVersion,
16432
- runtimeStatus: inventory.runtimeStatus.status,
16433
- advisoryAnomalyCodes: wakeability.advisoryCodes
16434
- };
16435
- }
16436
- //#endregion
16437
- //#region src/local-components/manifest.ts
16438
- const OPENMELD_CLI_COMMAND_CONTRACT_VERSION = "openmeld-cli-command-contract-2026-09-large-space-files-v1";
16439
- const OPENMELD_SKILLS_CONTRACT_VERSION = "openmeld-skills-contract-2026-09-explicit-space-recipients-v1";
16440
- const OPENMELD_SERVICE_CONTRACT_VERSION = "openmeld-service-contract-2026-09-space-access-and-large-files-v1";
16441
- const LOCAL_COMPONENTS_SNAPSHOT_FILE = "local-components.json";
16442
- const SERVICE_COMPONENT_UPDATE_CODES = /* @__PURE__ */ new Set([
16443
- "version_outdated",
16444
- "downgrade_blocked",
16445
- "runtime_contract_missing",
16446
- "runtime_contract_mismatch",
16447
- "runtime_contract_unavailable",
16448
- "bundle_missing",
16449
- "bundle_content_drift",
16450
- "bundle_id_drift",
16451
- "bundle_version_drift",
16452
- "bundle_lane_drift",
16453
- "bundle_strategy_legacy",
16454
- "bundle_provenance_drift",
16455
- "bundle_path_invalid"
16456
- ]);
16457
- function localComponentsSnapshotPath() {
16458
- return join(openMeldRootDir(), LOCAL_COMPONENTS_SNAPSHOT_FILE);
16459
- }
16460
- async function buildExpectedLocalComponentsManifest() {
16461
- const skills = await resolveExpectedSkillsManifest();
16462
- return {
16463
- schemaVersion: 1,
16464
- openMeldReleaseVersion: OPENMELD_VERSION,
16465
- cli: {
16466
- packageVersion: OPENMELD_VERSION,
16467
- commandContractVersion: OPENMELD_CLI_COMMAND_CONTRACT_VERSION
16468
- },
16469
- service: {
16470
- bundleHash: null,
16471
- bundleVersion: await resolveCurrentDaemonExpectedVersion(),
16472
- runtimeContractEpoch: CURRENT_DAEMON_EXECUTION_CONTRACT_EPOCH,
16473
- serviceContractVersion: OPENMELD_SERVICE_CONTRACT_VERSION
16474
- },
16475
- skills
16476
- };
16477
- }
16478
- async function readInstalledLocalComponentsSnapshot() {
16479
- const raw = await readFile(localComponentsSnapshotPath(), "utf8").catch(() => null);
16480
- if (!raw) return null;
16481
- const parsed = JSON.parse(raw);
16482
- const result = installedLocalComponentsSnapshotSchema.safeParse(parsed);
16483
- return result.success ? result.data : null;
16484
- }
16485
- async function writeInstalledLocalComponentsSnapshot(input) {
16486
- const snapshot = {
16487
- schemaVersion: 1,
16488
- installedAt: (/* @__PURE__ */ new Date()).toISOString(),
16489
- source: input.source,
16490
- manifest: await buildExpectedLocalComponentsManifest()
16491
- };
16492
- const installed = isBinaryDistribution() ? await readManagedCliInstallation() : null;
16493
- if (installed && installed.version !== OPENMELD_VERSION) {
16494
- const previous = await readInstalledLocalComponentsSnapshot();
16495
- if (previous?.manifest.cli.packageVersion === installed.version) snapshot.manifest.cli = previous.manifest.cli;
16496
- }
16497
- const snapshotPath = localComponentsSnapshotPath();
16498
- await mkdir(dirname(snapshotPath), { recursive: true });
16499
- const temporaryPath = `${snapshotPath}.${crypto.randomUUID()}.tmp`;
16500
- try {
16501
- await writeFile(temporaryPath, `${JSON.stringify(snapshot, null, 2)}\n`);
16502
- await rename(temporaryPath, snapshotPath);
16503
- } finally {
16504
- await rm(temporaryPath, { force: true });
16505
- }
16506
- return snapshot;
16507
- }
16508
- async function resolveLocalComponentsStatus(input = {}) {
16509
- const [expectedManifest, service, skills, maintenance, updateOperation] = await Promise.all([
16510
- buildExpectedLocalComponentsManifest(),
16511
- resolveServiceComponentState(),
16512
- resolveSkillsComponentState(),
16513
- resolveOpenMeldToolsMaintenanceProjection(),
16514
- resolveOpenMeldToolsUpdateOperation()
16515
- ]);
16516
- const cli = await resolveCliComponentStatus(input);
16517
- const selectedSkill = await loadSelectedSkillAssets();
16518
- const setupAction = resolveLocalComponentsSetupAction({
16519
- cliStatus: cli.status,
16520
- serviceKind: service.kind,
16521
- serviceStatus: service.status,
16522
- skillsStatus: skills.status
16523
- });
16524
- return {
16525
- schemaVersion: 1,
16526
- generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
16527
- entrypoint: "setup",
16528
- summaryLabel: formatLocalComponentsSummaryLabel({
16529
- cliStatus: cli.status,
16530
- setupAction
16531
- }),
16532
- summaryDescription: formatLocalComponentsSummaryDescription({
16533
- cliStatus: cli.status,
16534
- setupAction
16535
- }),
16536
- setupAction,
16537
- setupActionLabel: formatLocalSetupActionLabel(setupAction),
16538
- setupActionDescription: formatLocalSetupActionDescription(setupAction),
16539
- maintenance,
16540
- ...updateOperation ? { updateOperation } : {},
16541
- cli,
16542
- service: {
16543
- expectedBundleHash: expectedManifest.service.bundleHash,
16544
- expectedBundleVersion: expectedManifest.service.bundleVersion,
16545
- installedBundleHash: service.installedBundleHash,
16546
- installedBundleVersion: service.installedBundleVersion,
16547
- reasonCodes: service.reasonCodes,
16548
- runtimeContractEpoch: expectedManifest.service.runtimeContractEpoch,
16549
- serviceContractVersion: expectedManifest.service.serviceContractVersion,
16550
- status: service.status
16551
- },
16552
- skills: {
16553
- ...selectedSkill.contentRelease ? { contentRelease: selectedSkill.contentRelease } : {},
16554
- expectedBundleHash: expectedManifest.skills.bundleHash,
16555
- installedBundleHash: skills.installedBundleHash,
16556
- reasonCodes: skills.reasonCodes,
16557
- skillContractVersion: expectedManifest.skills.skillContractVersion,
16558
- status: skills.status,
16559
- targetCount: skills.targetCount
16560
- }
16561
- };
16562
- }
16563
- function resolveLocalComponentsSetupAction(input) {
16564
- if (input.cliStatus === "update_required") return "update_cli";
16565
- if (input.serviceStatus === "update_required") return "update_service";
16566
- if (input.skillsStatus === "update_required") return "update_skills";
16567
- if (input.serviceKind === "missing") return "connect_service";
16568
- if (input.serviceKind === "not_running" || input.serviceKind === "inspection_failed") return "reconnect_service";
16569
- return "none";
16570
- }
16571
- async function resolveCliComponentStatus(input) {
16572
- const installed = isBinaryDistribution() ? await readManagedCliInstallation() : null;
16573
- const packageVersion = installed?.version ?? OPENMELD_VERSION;
16574
- const snapshot = installed && installed.version !== OPENMELD_VERSION ? await readInstalledLocalComponentsSnapshot() : null;
16575
- let commandContractVersion = OPENMELD_CLI_COMMAND_CONTRACT_VERSION;
16576
- if (packageVersion !== OPENMELD_VERSION) commandContractVersion = snapshot?.manifest.cli.packageVersion === packageVersion ? snapshot.manifest.cli.commandContractVersion : "unknown";
16577
- const latestPackageVersion = normalizeOptionalString$1(input.latestPackageVersion);
16578
- const requiredCommandContractVersion = normalizeOptionalString$1(input.requiredCommandContractVersion);
16579
- const reasonCodes = [];
16580
- let status = "ok";
16581
- if (commandContractVersion === "unknown" || requiredCommandContractVersion && requiredCommandContractVersion !== commandContractVersion) {
16582
- status = "update_required";
16583
- reasonCodes.push("cli.command_contract_mismatch");
16584
- } else if (latestPackageVersion && compareSemver(packageVersion, latestPackageVersion) < 0) {
16585
- status = "update_available";
16586
- reasonCodes.push("cli.package_update_available");
16587
- }
16588
- return {
16589
- commandContractVersion,
16590
- latestPackageVersion,
16591
- packageVersion,
16592
- reasonCodes,
16593
- requiredCommandContractVersion,
16594
- status
16595
- };
16596
- }
16597
- async function resolveServiceComponentState() {
16598
- const expectedVersion = await resolveCurrentDaemonExpectedVersion();
16599
- try {
16600
- const [participation, inventory, activeBundle] = await Promise.all([
16601
- resolveDaemonServiceParticipationStatus({ expectedVersion }),
16602
- inspectDaemonServiceInventory({ expectedVersion }),
16603
- readDaemonActiveBundleState().catch(() => null)
16604
- ]);
16605
- const installedBundleVersion = resolveInstalledServiceVersion(participation);
16606
- const serviceUpdateReasonCodes = collectServiceUpdateReasonCodes({
16607
- anomalyCodes: inventory.anomalies.map((anomaly) => anomaly.code),
16608
- participation
16609
- });
16610
- if (serviceUpdateReasonCodes.length > 0) return {
16611
- installedBundleHash: resolveInstalledServiceBundleHash(activeBundle),
16612
- installedBundleVersion,
16613
- kind: "update_required",
16614
- reasonCodes: serviceUpdateReasonCodes,
16615
- status: "update_required"
16616
- };
16617
- if (participation.kind === "missing") return {
16618
- installedBundleHash: null,
16619
- installedBundleVersion: null,
16620
- kind: "missing",
16621
- reasonCodes: ["service.not_installed"],
16622
- status: "ok"
16623
- };
16624
- if (participation.kind === "not_running") return {
16625
- installedBundleHash: resolveInstalledServiceBundleHash(activeBundle),
16626
- installedBundleVersion,
16627
- kind: "not_running",
16628
- reasonCodes: ["service.not_running"],
16629
- status: "ok"
16630
- };
16631
- return {
16632
- installedBundleHash: resolveInstalledServiceBundleHash(activeBundle),
16633
- installedBundleVersion,
16634
- kind: "ok",
16635
- reasonCodes: [],
16636
- status: "ok"
16637
- };
16638
- } catch (error) {
16639
- return {
16640
- installedBundleHash: null,
16641
- installedBundleVersion: null,
16642
- kind: "inspection_failed",
16643
- reasonCodes: [`service.inspection_failed:${error instanceof Error ? error.message : "unknown"}`],
16644
- status: "ok"
16645
- };
16646
- }
16647
- }
16648
- function resolveInstalledServiceBundleHash(activeBundle) {
16649
- if (activeBundle?.bundleFormat === "binary_v1") return null;
16650
- return activeBundle?.sourceDistFingerprint ?? null;
16651
- }
16652
- async function resolveSkillsComponentState() {
16653
- const [installed, snapshot] = await Promise.all([resolveInstalledSkillsManifest(), collectSkillsReadinessSnapshot().catch(() => null)]);
16654
- if (!snapshot) return {
16655
- installedBundleHash: installed?.bundleHash ?? null,
16656
- reasonCodes: ["skills.status_unavailable"],
16657
- status: "update_required",
16658
- targetCount: 0
16659
- };
16660
- if (!installed) return {
16661
- installedBundleHash: null,
16662
- reasonCodes: ["skills.bundle_hash_unavailable"],
16663
- status: "update_required",
16664
- targetCount: snapshot.targetCount
16665
- };
16666
- if (snapshot.status === "action_required") return {
16667
- installedBundleHash: installed.bundleHash,
16668
- reasonCodes: ["skills.update_required"],
16669
- status: "update_required",
16670
- targetCount: snapshot.targetCount
16671
- };
16672
- return {
16673
- installedBundleHash: installed.bundleHash,
16674
- reasonCodes: snapshot.status === "no_targets" ? ["skills.no_targets"] : [],
16675
- status: "ok",
16676
- targetCount: snapshot.targetCount
16677
- };
16678
- }
16679
- async function resolveExpectedSkillsManifest() {
16680
- return await resolveBundledSkillsManifest() ?? buildUnavailableSkillsManifest();
16681
- }
16682
- async function resolveInstalledSkillsManifest() {
16683
- const bundled = await resolveBundledSkillsManifest();
16684
- if (bundled) return bundled;
16685
- const activeBundleSource = await resolveActiveBundleSourceSkillsManifest();
16686
- if (activeBundleSource) return activeBundleSource;
16687
- return (await readInstalledLocalComponentsSnapshot())?.manifest.skills ?? null;
16688
- }
16689
- async function resolveBundledSkillsManifest() {
16690
- const assets = await loadSelectedSkillAssets().then((selected) => selected.assets).catch(() => null);
16691
- if (!assets || assets.length === 0) return null;
16692
- return {
16693
- bundleHash: hashBundledSkillAssets(assets),
16694
- skillContractVersion: OPENMELD_SKILLS_CONTRACT_VERSION,
16695
- skillIds: ["openmeld-cli"]
16696
- };
16697
- }
16698
- async function resolveActiveBundleSourceSkillsManifest() {
16699
- const sourcePackageRootPath = normalizeOptionalString$1((await readDaemonActiveBundleState().catch(() => null))?.sourcePackageRootPath);
16700
- if (!sourcePackageRootPath) return null;
16701
- const skillsRootDir = join(sourcePackageRootPath, "skills");
16702
- if (!await pathExists(skillsRootDir)) return null;
16703
- return await buildSkillsManifestFromRoot(skillsRootDir);
16704
- }
16705
- async function buildSkillsManifestFromRoot(skillsRootDir) {
16706
- return {
16707
- bundleHash: await computeDirectoryContentHash({
16708
- rootDir: skillsRootDir,
16709
- ignoredNames: [".openmeld-skill.json"]
16710
- }).catch(() => null),
16711
- skillContractVersion: OPENMELD_SKILLS_CONTRACT_VERSION,
16712
- skillIds: ["openmeld-cli"]
16713
- };
16714
- }
16715
- function buildUnavailableSkillsManifest() {
16716
- return {
16717
- bundleHash: null,
16718
- skillContractVersion: OPENMELD_SKILLS_CONTRACT_VERSION,
16719
- skillIds: []
16720
- };
16721
- }
16722
- async function pathExists(path) {
16723
- try {
16724
- await access(path);
16725
- return true;
16726
- } catch {
16727
- return false;
16728
- }
16729
- }
16730
- function collectServiceUpdateReasonCodes(input) {
16731
- const reasonCodes = input.anomalyCodes.filter((code) => SERVICE_COMPONENT_UPDATE_CODES.has(code));
16732
- if (input.participation.kind === "outdated") reasonCodes.push("version_outdated");
16733
- if (input.participation.kind === "needs_repair") reasonCodes.push(...input.participation.anomalyCodes.filter((code) => SERVICE_COMPONENT_UPDATE_CODES.has(code)));
16734
- return [...new Set(reasonCodes.map((code) => `service.${code}`))];
16735
- }
16736
- function resolveInstalledServiceVersion(participation) {
16737
- switch (participation.kind) {
16738
- case "ready":
16739
- case "not_running":
16740
- case "needs_repair":
16741
- case "outdated": return participation.installedVersion;
16742
- default: return null;
16743
- }
16744
- }
16745
- function normalizeOptionalString$1(value) {
16746
- const normalized = String(value ?? "").trim();
16747
- return normalized.length > 0 ? normalized : null;
16748
- }
16749
- //#endregion
16750
16683
  //#region src/local-service/adapters/resolve-daemon-capabilities.ts
16751
16684
  function resolveDaemonCapabilities(input) {
16752
16685
  const runtimeAdapters = input.localAdapterContainer.listAdapters().map((entry) => resolveRegistryRuntimeAdapterCapabilitySnapshot(entry.adapterId)).filter((entry) => entry !== null).sort((left, right) => left.adapterId.localeCompare(right.adapterId));
@@ -18386,7 +18319,6 @@ async function syncLocalServiceProviderConversationProofs(input) {
18386
18319
  family: "provider_conversation_proof",
18387
18320
  message: "Provider conversation proof collection failed.",
18388
18321
  reasonCode: "provider_conversation.runtime_reporting.collection_failed",
18389
- requiresCarrierHandshake: false,
18390
18322
  status: "failed"
18391
18323
  });
18392
18324
  throw error;
@@ -18397,7 +18329,6 @@ async function syncLocalServiceProviderConversationProofs(input) {
18397
18329
  family: "provider_conversation_proof",
18398
18330
  message: null,
18399
18331
  reasonCode: "provider_conversation.proof.no_applicable_routes",
18400
- requiresCarrierHandshake: false,
18401
18332
  status: "not_applicable"
18402
18333
  });
18403
18334
  return {
@@ -23321,95 +23252,116 @@ async function coordinateConcurrentAgentReply(input) {
23321
23252
  },
23322
23253
  observation,
23323
23254
  reconsider: async (prompt, currentObservation) => {
23324
- const continuation = resolveStructuredActionRepairContinuation({
23325
- agentControllerConversationOverride: input.agentControllerConversationOverride,
23326
- runtimeResult: input.runtimeResult
23327
- });
23328
- if (!(continuation.contextId || continuation.agentControllerConversationOverride)) throw new DaemonServiceRunError({
23329
- code: "dispatch.agent_reply_reconsideration.conversation_unavailable",
23330
- message: "The Space changed, but the exact Agent conversation is unavailable for reply reconsideration."
23331
- });
23332
- await input.controllerTurnCompletion;
23333
- const activeTask = input.inflightTaskControlRegistry.getTask(input.parsedTask.taskId);
23334
- if (activeTask?.dispatchId !== input.parsedTask.dispatchId || activeTask.runtimeCoordinatorExecutionId !== input.parsedTask.runtimeCoordinatorExecutionId) throw new DaemonServiceRunError({
23335
- code: "dispatch.agent_reply_reconsideration.execution_inactive",
23336
- message: "The Wake stopped before the Agent could reconsider its reply."
23337
- });
23338
- if (input.dispatchSpaceActionContext) supersedeDispatchSpaceActionRecordForReconsideration({ context: input.dispatchSpaceActionContext });
23339
- emitRunLine({
23340
- presenter: input.presenter,
23341
- code: "daemon.run.agent_reply_reconsideration_started",
23342
- text: `Agent reply reconsideration started for task ${input.parsedTask.taskId}`,
23343
- payload: {
23344
- dispatchId: input.parsedTask.dispatchId,
23255
+ const reconsiderationStartedAtMs = Date.now();
23256
+ const recordReconsideration = (result) => emitDaemonDispatchJournalEvent({
23257
+ type: "dispatch.reply_reconsideration",
23258
+ dispatchId: input.parsedTask.dispatchId,
23259
+ profileId: input.parsedTask.targetProfileId,
23260
+ taskId: input.parsedTask.taskId,
23261
+ result,
23262
+ metadata: {
23263
+ reason: "new_relevant_space_signal",
23345
23264
  newerSignalCount: currentObservation.relevantSignals.length,
23346
23265
  observedThroughSignalId: currentObservation.observedThroughSignalId,
23347
- targetProfileId: input.parsedTask.targetProfileId,
23348
- taskId: input.parsedTask.taskId
23266
+ triggeringSignalIds: currentObservation.relevantSignals.map((signal) => signal.id),
23267
+ startedAtMs: reconsiderationStartedAtMs,
23268
+ durationMs: Math.max(0, Date.now() - reconsiderationStartedAtMs)
23349
23269
  }
23350
23270
  });
23351
- let runtimeResult = await runDispatchRuntimeExecution({
23352
- agentControllerConversationOverride: continuation.agentControllerConversationOverride,
23353
- computerFileAccessBoundary: input.computerFileAccessBoundary,
23354
- contextId: continuation.contextId,
23355
- executionMode: "repair",
23356
- instructionPrompt: input.instructionPrompt ? {
23357
- ...input.instructionPrompt,
23358
- userPrompt: prompt
23359
- } : void 0,
23360
- io: input.ledgerIo,
23361
- ledgerPaths: input.ledgerPaths,
23362
- parsedTask: input.parsedTask,
23363
- prompt,
23364
- routeConfig: input.routeConfig,
23365
- runtimeContext: input.runtimeContext,
23366
- runtimeEnvOverrides: input.runtimeEnvOverrides,
23367
- runtimeControllerSupport: input.runtimeControllerSupport,
23368
- streamingModeOverride: "final"
23369
- });
23370
- runtimeResult = await applyCliSpaceActionRecordIfPresent({
23371
- dispatchSpaceActionContext: input.dispatchSpaceActionContext,
23372
- parsedTask: input.parsedTask,
23373
- presenter: input.presenter,
23374
- runtimeResult
23375
- });
23376
- const reconsidered = await resolveRuntimeResultStructuredSpaceAction({
23377
- ...input,
23378
- agentControllerConversationOverride: continuation.agentControllerConversationOverride,
23379
- allowConcurrentReplyReconsideration: false,
23380
- runtimeResult
23381
- });
23382
- if (!reconsidered.resolvedSpaceAction) {
23383
- if (reconsidered.runtimeResult.resultPayload.status === "failed") return {
23384
- action: void 0,
23271
+ recordReconsideration("started");
23272
+ try {
23273
+ const continuation = resolveStructuredActionRepairContinuation({
23274
+ agentControllerConversationOverride: input.agentControllerConversationOverride,
23275
+ runtimeResult: input.runtimeResult
23276
+ });
23277
+ if (!(continuation.contextId || continuation.agentControllerConversationOverride)) throw new DaemonServiceRunError({
23278
+ code: "dispatch.agent_reply_reconsideration.conversation_unavailable",
23279
+ message: "The Space changed, but the exact Agent conversation is unavailable for reply reconsideration."
23280
+ });
23281
+ await input.controllerTurnCompletion;
23282
+ const activeTask = input.inflightTaskControlRegistry.getTask(input.parsedTask.taskId);
23283
+ if (activeTask?.dispatchId !== input.parsedTask.dispatchId || activeTask.runtimeCoordinatorExecutionId !== input.parsedTask.runtimeCoordinatorExecutionId) throw new DaemonServiceRunError({
23284
+ code: "dispatch.agent_reply_reconsideration.execution_inactive",
23285
+ message: "The Wake stopped before the Agent could reconsider its reply."
23286
+ });
23287
+ if (input.dispatchSpaceActionContext) supersedeDispatchSpaceActionRecordForReconsideration({ context: input.dispatchSpaceActionContext });
23288
+ emitRunLine({
23289
+ presenter: input.presenter,
23290
+ code: "daemon.run.agent_reply_reconsideration_started",
23291
+ text: `Agent reply reconsideration started for task ${input.parsedTask.taskId}`,
23292
+ payload: {
23293
+ dispatchId: input.parsedTask.dispatchId,
23294
+ newerSignalCount: currentObservation.relevantSignals.length,
23295
+ observedThroughSignalId: currentObservation.observedThroughSignalId,
23296
+ targetProfileId: input.parsedTask.targetProfileId,
23297
+ taskId: input.parsedTask.taskId
23298
+ }
23299
+ });
23300
+ let runtimeResult = await runDispatchRuntimeExecution({
23301
+ agentControllerConversationOverride: continuation.agentControllerConversationOverride,
23302
+ computerFileAccessBoundary: input.computerFileAccessBoundary,
23303
+ contextId: continuation.contextId,
23304
+ executionMode: "repair",
23305
+ instructionPrompt: input.instructionPrompt ? {
23306
+ ...input.instructionPrompt,
23307
+ userPrompt: prompt
23308
+ } : void 0,
23309
+ io: input.ledgerIo,
23310
+ ledgerPaths: input.ledgerPaths,
23311
+ parsedTask: input.parsedTask,
23312
+ prompt,
23313
+ routeConfig: input.routeConfig,
23314
+ runtimeContext: input.runtimeContext,
23315
+ runtimeEnvOverrides: input.runtimeEnvOverrides,
23316
+ runtimeControllerSupport: input.runtimeControllerSupport,
23317
+ streamingModeOverride: "final"
23318
+ });
23319
+ runtimeResult = await applyCliSpaceActionRecordIfPresent({
23320
+ dispatchSpaceActionContext: input.dispatchSpaceActionContext,
23321
+ parsedTask: input.parsedTask,
23322
+ presenter: input.presenter,
23323
+ runtimeResult
23324
+ });
23325
+ const reconsidered = await resolveRuntimeResultStructuredSpaceAction({
23326
+ ...input,
23327
+ agentControllerConversationOverride: continuation.agentControllerConversationOverride,
23328
+ allowConcurrentReplyReconsideration: false,
23329
+ runtimeResult
23330
+ });
23331
+ if (!reconsidered.resolvedSpaceAction) {
23332
+ if (reconsidered.runtimeResult.resultPayload.status === "failed") return {
23333
+ action: void 0,
23334
+ value: {
23335
+ provenance: void 0,
23336
+ runtimeResult: reconsidered.runtimeResult
23337
+ }
23338
+ };
23339
+ throw new DaemonServiceRunError({
23340
+ code: "dispatch.agent_reply_reconsideration.action_missing",
23341
+ message: "The Agent did not return a valid Space action after reviewing newer messages."
23342
+ });
23343
+ }
23344
+ emitRunLine({
23345
+ presenter: input.presenter,
23346
+ code: "daemon.run.agent_reply_reconsideration_completed",
23347
+ text: `Agent reply reconsideration completed for task ${input.parsedTask.taskId}`,
23348
+ payload: {
23349
+ dispatchId: input.parsedTask.dispatchId,
23350
+ observedThroughSignalId: currentObservation.observedThroughSignalId,
23351
+ targetProfileId: input.parsedTask.targetProfileId,
23352
+ taskId: input.parsedTask.taskId
23353
+ }
23354
+ });
23355
+ return {
23356
+ action: reconsidered.resolvedSpaceAction,
23385
23357
  value: {
23386
- provenance: void 0,
23358
+ provenance: "controller_repair",
23387
23359
  runtimeResult: reconsidered.runtimeResult
23388
23360
  }
23389
23361
  };
23390
- throw new DaemonServiceRunError({
23391
- code: "dispatch.agent_reply_reconsideration.action_missing",
23392
- message: "The Agent did not return a valid Space action after reviewing newer messages."
23393
- });
23362
+ } finally {
23363
+ recordReconsideration("finished");
23394
23364
  }
23395
- emitRunLine({
23396
- presenter: input.presenter,
23397
- code: "daemon.run.agent_reply_reconsideration_completed",
23398
- text: `Agent reply reconsideration completed for task ${input.parsedTask.taskId}`,
23399
- payload: {
23400
- dispatchId: input.parsedTask.dispatchId,
23401
- observedThroughSignalId: currentObservation.observedThroughSignalId,
23402
- targetProfileId: input.parsedTask.targetProfileId,
23403
- taskId: input.parsedTask.taskId
23404
- }
23405
- });
23406
- return {
23407
- action: reconsidered.resolvedSpaceAction,
23408
- value: {
23409
- provenance: "controller_repair",
23410
- runtimeResult: reconsidered.runtimeResult
23411
- }
23412
- };
23413
23365
  },
23414
23366
  refreshObservation: readObservation,
23415
23367
  spaceId: input.parsedTask.spaceId
@@ -25443,7 +25395,7 @@ async function runDaemonSocketSession(input) {
25443
25395
  profileId,
25444
25396
  leaseEpoch
25445
25397
  })).sort((left, right) => left.profileId.localeCompare(right.profileId));
25446
- const localComponentsStatus = await resolveSessionLocalComponentsStatus();
25398
+ const localComponentsStatus = readSessionLocalComponentsStatus();
25447
25399
  const heartbeatRequest = runtimeTransportHeartbeatRequestSchema.safeParse({
25448
25400
  v: 1,
25449
25401
  ownerUserId: input.ownerUserId,
@@ -25511,7 +25463,7 @@ async function runDaemonSocketSession(input) {
25511
25463
  reason: heartbeatSchedule.reason
25512
25464
  });
25513
25465
  scheduleHeartbeat({
25514
- delayMs: applyIntervalJitterMs({
25466
+ delayMs: applyIntervalJitterMs$1({
25515
25467
  baseIntervalMs: currentHeartbeatIntervalMs,
25516
25468
  jitterRatio: ADAPTIVE_HEARTBEAT_JITTER_RATIO,
25517
25469
  maxIntervalMs: MAX_HEARTBEAT_INTERVAL_MS,
@@ -25637,21 +25589,15 @@ async function runDaemonSocketSession(input) {
25637
25589
  };
25638
25590
  let hasLoggedWaitingForProfiles = (input.isRouteCatalogResolved?.() ?? true) && input.routeCatalogState.profileIds.length === 0;
25639
25591
  const serviceVersion = OPENMELD_VERSION;
25640
- const resolveSessionLocalComponentsStatus = async () => {
25641
- try {
25642
- return await resolveLocalComponentsStatus();
25643
- } catch (error) {
25644
- emitRunLine({
25645
- presenter: input.presenter,
25646
- code: "daemon.run.local_components_status_failed",
25647
- text: `local components status unavailable: ${toErrorMessage$10(error)}`
25648
- });
25649
- return null;
25650
- }
25651
- };
25592
+ const readSessionLocalComponentsStatus = () => input.localComponentsObservation.read(() => {
25593
+ if (lastHeartbeatSentAtMs !== null) scheduleHeartbeat({
25594
+ delayMs: 0,
25595
+ reason: "local_components_refreshed"
25596
+ });
25597
+ });
25652
25598
  const registerDaemonSession = async (routeCatalog) => {
25653
25599
  const connectionGeneration = Math.max(1, input.reconnectAttempt + 1);
25654
- const localComponentsStatus = await resolveSessionLocalComponentsStatus();
25600
+ const localComponentsStatus = readSessionLocalComponentsStatus();
25655
25601
  const registerPayload = runtimeTransportRegisterSessionRequestSchema.safeParse({
25656
25602
  v: 1,
25657
25603
  ownerUserId: input.ownerUserId,
@@ -26909,11 +26855,401 @@ function resolveProfileWorkspaceControlErrorCode(error) {
26909
26855
  return "profile.workspace.update_failed";
26910
26856
  }
26911
26857
  //#endregion
26858
+ //#region src/local-service/status/service-participation-status.ts
26859
+ async function resolveDaemonServiceParticipationStatus(input) {
26860
+ const expectedVersion = input?.expectedVersion ?? await resolveCurrentDaemonExpectedVersion();
26861
+ const inventory = await inspectDaemonServiceInventory({ expectedVersion });
26862
+ if (!(inventory.installStatus.installed && inventory.installStatus.state)) return {
26863
+ kind: "missing",
26864
+ expectedVersion
26865
+ };
26866
+ const installedVersion = inventory.installStatus.state.daemonVersion;
26867
+ const wakeability = classifyDaemonServiceWakeability({ inventory });
26868
+ const blockingServiceDriftCodes = wakeability.blockingCodes;
26869
+ const runBlockingServiceDriftCodes = classifyDaemonServiceRunStartability({ inventory }).blockingCodes;
26870
+ const repairAnomalies = inventory.anomalies.filter((anomaly) => [...blockingServiceDriftCodes, ...runBlockingServiceDriftCodes].includes(anomaly.code));
26871
+ if (repairAnomalies.length > 0) return {
26872
+ kind: "needs_repair",
26873
+ expectedVersion,
26874
+ installedVersion,
26875
+ runtimeStatus: inventory.runtimeStatus.status,
26876
+ detail: repairAnomalies[0]?.message ?? "OpenMeld found conflicting local service state on this device.",
26877
+ anomalyCodes: inventory.anomalies.map((anomaly) => anomaly.code)
26878
+ };
26879
+ if (inventory.runtimeStatus.status !== "running") return {
26880
+ kind: "not_running",
26881
+ expectedVersion,
26882
+ installedVersion,
26883
+ runtimeStatus: inventory.runtimeStatus.status
26884
+ };
26885
+ return {
26886
+ kind: "ready",
26887
+ expectedVersion,
26888
+ installedVersion,
26889
+ runtimeStatus: inventory.runtimeStatus.status,
26890
+ advisoryAnomalyCodes: wakeability.advisoryCodes
26891
+ };
26892
+ }
26893
+ //#endregion
26894
+ //#region src/local-components/manifest.ts
26895
+ const OPENMELD_CLI_COMMAND_CONTRACT_VERSION = "openmeld-cli-command-contract-2026-09-large-space-files-v1";
26896
+ const OPENMELD_SKILLS_CONTRACT_VERSION = "openmeld-skills-contract-2026-09-explicit-space-recipients-v1";
26897
+ const OPENMELD_SERVICE_CONTRACT_VERSION = "openmeld-service-contract-2026-09-space-access-and-large-files-v1";
26898
+ const LOCAL_COMPONENTS_SNAPSHOT_FILE = "local-components.json";
26899
+ const SERVICE_COMPONENT_UPDATE_CODES = /* @__PURE__ */ new Set([
26900
+ "version_outdated",
26901
+ "downgrade_blocked",
26902
+ "runtime_contract_missing",
26903
+ "runtime_contract_mismatch",
26904
+ "runtime_contract_unavailable",
26905
+ "bundle_missing",
26906
+ "bundle_content_drift",
26907
+ "bundle_id_drift",
26908
+ "bundle_version_drift",
26909
+ "bundle_lane_drift",
26910
+ "bundle_strategy_legacy",
26911
+ "bundle_provenance_drift",
26912
+ "bundle_path_invalid"
26913
+ ]);
26914
+ function localComponentsSnapshotPath() {
26915
+ return join(openMeldRootDir(), LOCAL_COMPONENTS_SNAPSHOT_FILE);
26916
+ }
26917
+ async function buildExpectedLocalComponentsManifest() {
26918
+ const skills = await resolveExpectedSkillsManifest();
26919
+ return {
26920
+ schemaVersion: 1,
26921
+ openMeldReleaseVersion: OPENMELD_VERSION,
26922
+ cli: {
26923
+ packageVersion: OPENMELD_VERSION,
26924
+ commandContractVersion: OPENMELD_CLI_COMMAND_CONTRACT_VERSION
26925
+ },
26926
+ service: {
26927
+ bundleHash: null,
26928
+ bundleVersion: await resolveCurrentDaemonExpectedVersion(),
26929
+ runtimeContractEpoch: CURRENT_DAEMON_EXECUTION_CONTRACT_EPOCH,
26930
+ serviceContractVersion: OPENMELD_SERVICE_CONTRACT_VERSION
26931
+ },
26932
+ skills
26933
+ };
26934
+ }
26935
+ async function readInstalledLocalComponentsSnapshot() {
26936
+ const raw = await readFile(localComponentsSnapshotPath(), "utf8").catch(() => null);
26937
+ if (!raw) return null;
26938
+ const parsed = JSON.parse(raw);
26939
+ const result = installedLocalComponentsSnapshotSchema.safeParse(parsed);
26940
+ return result.success ? result.data : null;
26941
+ }
26942
+ async function writeInstalledLocalComponentsSnapshot(input) {
26943
+ const snapshot = {
26944
+ schemaVersion: 1,
26945
+ installedAt: (/* @__PURE__ */ new Date()).toISOString(),
26946
+ source: input.source,
26947
+ manifest: await buildExpectedLocalComponentsManifest()
26948
+ };
26949
+ const installed = isBinaryDistribution() ? await readManagedCliInstallation() : null;
26950
+ if (installed && installed.version !== OPENMELD_VERSION) {
26951
+ const previous = await readInstalledLocalComponentsSnapshot();
26952
+ if (previous?.manifest.cli.packageVersion === installed.version) snapshot.manifest.cli = previous.manifest.cli;
26953
+ }
26954
+ const snapshotPath = localComponentsSnapshotPath();
26955
+ await mkdir(dirname(snapshotPath), { recursive: true });
26956
+ const temporaryPath = `${snapshotPath}.${crypto.randomUUID()}.tmp`;
26957
+ try {
26958
+ await writeFile(temporaryPath, `${JSON.stringify(snapshot, null, 2)}\n`);
26959
+ await rename(temporaryPath, snapshotPath);
26960
+ } finally {
26961
+ await rm(temporaryPath, { force: true });
26962
+ }
26963
+ return snapshot;
26964
+ }
26965
+ async function resolveLocalComponentsStatus(input = {}) {
26966
+ const [expectedManifest, service, skills, maintenance, updateOperation] = await Promise.all([
26967
+ buildExpectedLocalComponentsManifest(),
26968
+ resolveServiceComponentState(),
26969
+ resolveSkillsComponentState(),
26970
+ resolveOpenMeldToolsMaintenanceProjection(),
26971
+ resolveOpenMeldToolsUpdateOperation()
26972
+ ]);
26973
+ const cli = await resolveCliComponentStatus(input);
26974
+ const selectedSkill = await loadSelectedSkillAssets();
26975
+ const setupAction = resolveLocalComponentsSetupAction({
26976
+ cliStatus: cli.status,
26977
+ serviceKind: service.kind,
26978
+ serviceStatus: service.status,
26979
+ skillsStatus: skills.status
26980
+ });
26981
+ return {
26982
+ schemaVersion: 1,
26983
+ generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
26984
+ entrypoint: "setup",
26985
+ summaryLabel: formatLocalComponentsSummaryLabel({
26986
+ cliStatus: cli.status,
26987
+ setupAction
26988
+ }),
26989
+ summaryDescription: formatLocalComponentsSummaryDescription({
26990
+ cliStatus: cli.status,
26991
+ setupAction
26992
+ }),
26993
+ setupAction,
26994
+ setupActionLabel: formatLocalSetupActionLabel(setupAction),
26995
+ setupActionDescription: formatLocalSetupActionDescription(setupAction),
26996
+ maintenance,
26997
+ ...updateOperation ? { updateOperation } : {},
26998
+ cli,
26999
+ service: {
27000
+ expectedBundleHash: expectedManifest.service.bundleHash,
27001
+ expectedBundleVersion: expectedManifest.service.bundleVersion,
27002
+ installedBundleHash: service.installedBundleHash,
27003
+ installedBundleVersion: service.installedBundleVersion,
27004
+ reasonCodes: service.reasonCodes,
27005
+ runtimeContractEpoch: expectedManifest.service.runtimeContractEpoch,
27006
+ serviceContractVersion: expectedManifest.service.serviceContractVersion,
27007
+ status: service.status
27008
+ },
27009
+ skills: {
27010
+ ...selectedSkill.contentRelease ? { contentRelease: selectedSkill.contentRelease } : {},
27011
+ expectedBundleHash: expectedManifest.skills.bundleHash,
27012
+ installedBundleHash: skills.installedBundleHash,
27013
+ reasonCodes: skills.reasonCodes,
27014
+ skillContractVersion: expectedManifest.skills.skillContractVersion,
27015
+ status: skills.status,
27016
+ targetCount: skills.targetCount
27017
+ }
27018
+ };
27019
+ }
27020
+ function resolveLocalComponentsSetupAction(input) {
27021
+ if (input.cliStatus === "update_required") return "update_cli";
27022
+ if (input.serviceStatus === "update_required") return "update_service";
27023
+ if (input.skillsStatus === "update_required") return "update_skills";
27024
+ if (input.serviceKind === "missing") return "connect_service";
27025
+ if (input.serviceKind === "not_running" || input.serviceKind === "inspection_failed") return "reconnect_service";
27026
+ return "none";
27027
+ }
27028
+ async function resolveCliComponentStatus(input) {
27029
+ const installed = isBinaryDistribution() ? await readManagedCliInstallation() : null;
27030
+ const packageVersion = installed?.version ?? OPENMELD_VERSION;
27031
+ const snapshot = installed && installed.version !== OPENMELD_VERSION ? await readInstalledLocalComponentsSnapshot() : null;
27032
+ let commandContractVersion = OPENMELD_CLI_COMMAND_CONTRACT_VERSION;
27033
+ if (packageVersion !== OPENMELD_VERSION) commandContractVersion = snapshot?.manifest.cli.packageVersion === packageVersion ? snapshot.manifest.cli.commandContractVersion : "unknown";
27034
+ const latestPackageVersion = normalizeOptionalString$1(input.latestPackageVersion);
27035
+ const requiredCommandContractVersion = normalizeOptionalString$1(input.requiredCommandContractVersion);
27036
+ const reasonCodes = [];
27037
+ let status = "ok";
27038
+ if (commandContractVersion === "unknown" || requiredCommandContractVersion && requiredCommandContractVersion !== commandContractVersion) {
27039
+ status = "update_required";
27040
+ reasonCodes.push("cli.command_contract_mismatch");
27041
+ } else if (latestPackageVersion && compareSemver(packageVersion, latestPackageVersion) < 0) {
27042
+ status = "update_available";
27043
+ reasonCodes.push("cli.package_update_available");
27044
+ }
27045
+ return {
27046
+ commandContractVersion,
27047
+ latestPackageVersion,
27048
+ packageVersion,
27049
+ reasonCodes,
27050
+ requiredCommandContractVersion,
27051
+ status
27052
+ };
27053
+ }
27054
+ async function resolveServiceComponentState() {
27055
+ const expectedVersion = await resolveCurrentDaemonExpectedVersion();
27056
+ try {
27057
+ const [participation, inventory, activeBundle] = await Promise.all([
27058
+ resolveDaemonServiceParticipationStatus({ expectedVersion }),
27059
+ inspectDaemonServiceInventory({ expectedVersion }),
27060
+ readDaemonActiveBundleState().catch(() => null)
27061
+ ]);
27062
+ const installedBundleVersion = resolveInstalledServiceVersion(participation);
27063
+ const serviceUpdateReasonCodes = collectServiceUpdateReasonCodes({
27064
+ anomalyCodes: inventory.anomalies.map((anomaly) => anomaly.code),
27065
+ participation
27066
+ });
27067
+ if (serviceUpdateReasonCodes.length > 0) return {
27068
+ installedBundleHash: resolveInstalledServiceBundleHash(activeBundle),
27069
+ installedBundleVersion,
27070
+ kind: "update_required",
27071
+ reasonCodes: serviceUpdateReasonCodes,
27072
+ status: "update_required"
27073
+ };
27074
+ if (participation.kind === "missing") return {
27075
+ installedBundleHash: null,
27076
+ installedBundleVersion: null,
27077
+ kind: "missing",
27078
+ reasonCodes: ["service.not_installed"],
27079
+ status: "ok"
27080
+ };
27081
+ if (participation.kind === "not_running") return {
27082
+ installedBundleHash: resolveInstalledServiceBundleHash(activeBundle),
27083
+ installedBundleVersion,
27084
+ kind: "not_running",
27085
+ reasonCodes: ["service.not_running"],
27086
+ status: "ok"
27087
+ };
27088
+ return {
27089
+ installedBundleHash: resolveInstalledServiceBundleHash(activeBundle),
27090
+ installedBundleVersion,
27091
+ kind: "ok",
27092
+ reasonCodes: [],
27093
+ status: "ok"
27094
+ };
27095
+ } catch (error) {
27096
+ return {
27097
+ installedBundleHash: null,
27098
+ installedBundleVersion: null,
27099
+ kind: "inspection_failed",
27100
+ reasonCodes: [`service.inspection_failed:${error instanceof Error ? error.message : "unknown"}`],
27101
+ status: "ok"
27102
+ };
27103
+ }
27104
+ }
27105
+ function resolveInstalledServiceBundleHash(activeBundle) {
27106
+ if (activeBundle?.bundleFormat === "binary_v1") return null;
27107
+ return activeBundle?.sourceDistFingerprint ?? null;
27108
+ }
27109
+ async function resolveSkillsComponentState() {
27110
+ const [installed, snapshot] = await Promise.all([resolveInstalledSkillsManifest(), collectSkillsReadinessSnapshot().catch(() => null)]);
27111
+ if (!snapshot) return {
27112
+ installedBundleHash: installed?.bundleHash ?? null,
27113
+ reasonCodes: ["skills.status_unavailable"],
27114
+ status: "update_required",
27115
+ targetCount: 0
27116
+ };
27117
+ if (!installed) return {
27118
+ installedBundleHash: null,
27119
+ reasonCodes: ["skills.bundle_hash_unavailable"],
27120
+ status: "update_required",
27121
+ targetCount: snapshot.targetCount
27122
+ };
27123
+ if (snapshot.status === "action_required") return {
27124
+ installedBundleHash: installed.bundleHash,
27125
+ reasonCodes: ["skills.update_required"],
27126
+ status: "update_required",
27127
+ targetCount: snapshot.targetCount
27128
+ };
27129
+ return {
27130
+ installedBundleHash: installed.bundleHash,
27131
+ reasonCodes: snapshot.status === "no_targets" ? ["skills.no_targets"] : [],
27132
+ status: "ok",
27133
+ targetCount: snapshot.targetCount
27134
+ };
27135
+ }
27136
+ async function resolveExpectedSkillsManifest() {
27137
+ return await resolveBundledSkillsManifest() ?? buildUnavailableSkillsManifest();
27138
+ }
27139
+ async function resolveInstalledSkillsManifest() {
27140
+ const bundled = await resolveBundledSkillsManifest();
27141
+ if (bundled) return bundled;
27142
+ const activeBundleSource = await resolveActiveBundleSourceSkillsManifest();
27143
+ if (activeBundleSource) return activeBundleSource;
27144
+ return (await readInstalledLocalComponentsSnapshot())?.manifest.skills ?? null;
27145
+ }
27146
+ async function resolveBundledSkillsManifest() {
27147
+ const assets = await loadSelectedSkillAssets().then((selected) => selected.assets).catch(() => null);
27148
+ if (!assets || assets.length === 0) return null;
27149
+ return {
27150
+ bundleHash: hashBundledSkillAssets(assets),
27151
+ skillContractVersion: OPENMELD_SKILLS_CONTRACT_VERSION,
27152
+ skillIds: ["openmeld-cli"]
27153
+ };
27154
+ }
27155
+ async function resolveActiveBundleSourceSkillsManifest() {
27156
+ const sourcePackageRootPath = normalizeOptionalString$1((await readDaemonActiveBundleState().catch(() => null))?.sourcePackageRootPath);
27157
+ if (!sourcePackageRootPath) return null;
27158
+ const skillsRootDir = join(sourcePackageRootPath, "skills");
27159
+ if (!await pathExists(skillsRootDir)) return null;
27160
+ return await buildSkillsManifestFromRoot(skillsRootDir);
27161
+ }
27162
+ async function buildSkillsManifestFromRoot(skillsRootDir) {
27163
+ return {
27164
+ bundleHash: await computeDirectoryContentHash({
27165
+ rootDir: skillsRootDir,
27166
+ ignoredNames: [".openmeld-skill.json"]
27167
+ }).catch(() => null),
27168
+ skillContractVersion: OPENMELD_SKILLS_CONTRACT_VERSION,
27169
+ skillIds: ["openmeld-cli"]
27170
+ };
27171
+ }
27172
+ function buildUnavailableSkillsManifest() {
27173
+ return {
27174
+ bundleHash: null,
27175
+ skillContractVersion: OPENMELD_SKILLS_CONTRACT_VERSION,
27176
+ skillIds: []
27177
+ };
27178
+ }
27179
+ async function pathExists(path) {
27180
+ try {
27181
+ await access(path);
27182
+ return true;
27183
+ } catch {
27184
+ return false;
27185
+ }
27186
+ }
27187
+ function collectServiceUpdateReasonCodes(input) {
27188
+ const reasonCodes = input.anomalyCodes.filter((code) => SERVICE_COMPONENT_UPDATE_CODES.has(code));
27189
+ if (input.participation.kind === "outdated") reasonCodes.push("version_outdated");
27190
+ if (input.participation.kind === "needs_repair") reasonCodes.push(...input.participation.anomalyCodes.filter((code) => SERVICE_COMPONENT_UPDATE_CODES.has(code)));
27191
+ return [...new Set(reasonCodes.map((code) => `service.${code}`))];
27192
+ }
27193
+ function resolveInstalledServiceVersion(participation) {
27194
+ switch (participation.kind) {
27195
+ case "ready":
27196
+ case "not_running":
27197
+ case "needs_repair":
27198
+ case "outdated": return participation.installedVersion;
27199
+ default: return null;
27200
+ }
27201
+ }
27202
+ function normalizeOptionalString$1(value) {
27203
+ const normalized = String(value ?? "").trim();
27204
+ return normalized.length > 0 ? normalized : null;
27205
+ }
27206
+ //#endregion
27207
+ //#region src/local-service/carrier/service-local-components-observation.ts
27208
+ function createServiceLocalComponentsObservation(input) {
27209
+ let observation = null;
27210
+ let pending = null;
27211
+ let onRefresh;
27212
+ let disposed = false;
27213
+ return {
27214
+ read(notify) {
27215
+ if (disposed) return null;
27216
+ onRefresh = notify;
27217
+ if (observation && Date.now() - observation.observedAtMs < 3e4) return observation.value;
27218
+ if (!pending) pending = (input.inspect ?? resolveLocalComponentsStatus)().then((value) => {
27219
+ observation = {
27220
+ value,
27221
+ observedAtMs: Date.now()
27222
+ };
27223
+ if (!disposed) onRefresh?.();
27224
+ }).catch((error) => {
27225
+ observation = {
27226
+ value: null,
27227
+ observedAtMs: Date.now()
27228
+ };
27229
+ if (!disposed) input.onError(error);
27230
+ }).finally(() => {
27231
+ pending = null;
27232
+ });
27233
+ return null;
27234
+ },
27235
+ dispose() {
27236
+ disposed = true;
27237
+ onRefresh = void 0;
27238
+ }
27239
+ };
27240
+ }
27241
+ //#endregion
26912
27242
  //#region src/local-service/carrier/stop-aware-delay.ts
26913
27243
  function createStopAwareDelay() {
26914
27244
  let interrupted = false;
27245
+ let wakePending = false;
26915
27246
  const pendingInterruptNotifiers = /* @__PURE__ */ new Set();
26916
27247
  return {
27248
+ wake: () => {
27249
+ wakePending = pendingInterruptNotifiers.size === 0;
27250
+ for (const notify of pendingInterruptNotifiers) notify();
27251
+ pendingInterruptNotifiers.clear();
27252
+ },
26917
27253
  interrupt: () => {
26918
27254
  if (interrupted) return;
26919
27255
  interrupted = true;
@@ -26922,6 +27258,10 @@ function createStopAwareDelay() {
26922
27258
  },
26923
27259
  wait: (delayMs) => {
26924
27260
  if (interrupted) return Promise.resolve("interrupted");
27261
+ if (wakePending) {
27262
+ wakePending = false;
27263
+ return Promise.resolve("interrupted");
27264
+ }
26925
27265
  return new Promise((resolve) => {
26926
27266
  let timer = null;
26927
27267
  const notifyInterrupted = () => {
@@ -26959,6 +27299,9 @@ var DaemonStreamAuthenticationRequiredError = class extends Error {
26959
27299
  this.name = "DaemonStreamAuthenticationRequiredError";
26960
27300
  }
26961
27301
  };
27302
+ function applyIntervalJitterMs(input) {
27303
+ return applyIntervalJitterMs$1(input);
27304
+ }
26962
27305
  async function resolveDaemonServiceOwnerContext(input) {
26963
27306
  const explicitOpenMeldProfileId = normalizeText$2(input.openMeldProfileId);
26964
27307
  if (explicitOpenMeldProfileId) return resolveDaemonServiceOwnerContextFromProfile(await requireOpenMeldProfile({
@@ -27017,6 +27360,7 @@ async function resolveDaemonStreamAuthContext(input) {
27017
27360
  };
27018
27361
  return {
27019
27362
  authState: "valid",
27363
+ credentialFingerprint: fingerprintRequestAuthorization(headers.Authorization),
27020
27364
  headers,
27021
27365
  status: "ready"
27022
27366
  };
@@ -27028,6 +27372,7 @@ function resolveCredentialFailureAuthState(reason) {
27028
27372
  }
27029
27373
  function toDaemonStreamCredentialFailure(error) {
27030
27374
  return {
27375
+ ...error.retryAfterMs !== void 0 ? { retryAfterMs: error.retryAfterMs } : {},
27031
27376
  authHost: error.authHost,
27032
27377
  expectedGatewayHost: error.expectedGatewayHost,
27033
27378
  reason: error.reason,
@@ -27183,11 +27528,29 @@ const runDaemonServiceLoop = async (input) => {
27183
27528
  leaseDescriptor: await resolveDaemonRuntimeLeaseDescriptor({ command: daemonRuntimeState.command })
27184
27529
  });
27185
27530
  let recovery = null;
27531
+ const connectionEvidence = createServiceConnectionEvidenceObserver({
27532
+ ownerUserId: ownerContext.ownerUserId,
27533
+ gatewayUrl: baseUrl,
27534
+ identity: {
27535
+ deviceId,
27536
+ runtimeLane: daemonServiceLaneSchema.parse(lane),
27537
+ serviceSessionId: daemonSessionId,
27538
+ serviceVersion: OPENMELD_VERSION
27539
+ },
27540
+ getRecovery: () => recovery,
27541
+ isStopping: () => stopRequested
27542
+ });
27186
27543
  const recoveryMetadata = () => ({
27187
27544
  ...describeConnectionRecovery(recovery),
27545
+ connectionDiagnosticId: connectionEvidence.connectionDiagnosticId,
27188
27546
  attempt: reconnectAttempt
27189
27547
  });
27190
27548
  const connectionState = createRunLoopConnectionStateTracker(input.presenter, recoveryMetadata);
27549
+ const localComponentsObservation = createServiceLocalComponentsObservation({ onError: (error) => emitRunLine({
27550
+ presenter: input.presenter,
27551
+ code: "daemon.run.local_components_status_failed",
27552
+ text: `local components status unavailable: ${toErrorMessage$10(error)}`
27553
+ }) });
27191
27554
  const localAdapterContainer = createLocalAdapterContainer(createLocalAdapterEntries({
27192
27555
  registerRuntimeProcess: (event) => {
27193
27556
  const nextProcessId = event.phase === "process_exit" ? null : event.processId;
@@ -27245,6 +27608,7 @@ const runDaemonServiceLoop = async (input) => {
27245
27608
  const reconnectBackoffDelay = createStopAwareDelay();
27246
27609
  let reconnectAttempt = 0;
27247
27610
  let activeSocket = null;
27611
+ let activeCredentialFingerprint = null;
27248
27612
  const recoverRuntimeReportingAuthentication = createRuntimeReportingAuthenticationRecovery({ requestCarrierHandshake: () => {
27249
27613
  activeSocket?.close(1012, "runtime_reporting_auth_recovery");
27250
27614
  } });
@@ -27257,6 +27621,7 @@ const runDaemonServiceLoop = async (input) => {
27257
27621
  });
27258
27622
  return;
27259
27623
  }
27624
+ if (input.failure.credentialFingerprint !== activeCredentialFingerprint) return;
27260
27625
  const recovery = await recoverRuntimeReportingAuthentication(input.failure);
27261
27626
  warnDaemonEvent("[openmeld.runtime_reporting.auth_recovery]", {
27262
27627
  event: "cli.runtime_reporting.auth_recovery",
@@ -27476,6 +27841,10 @@ const runDaemonServiceLoop = async (input) => {
27476
27841
  });
27477
27842
  agentActivityIntegrationRefresh.request();
27478
27843
  };
27844
+ const unsubscribeCredentialAvailability = onAuthSessionCredentialAvailable(() => {
27845
+ if (connectionState.get().reason === "auth_unavailable") reconnectBackoffDelay.wake();
27846
+ });
27847
+ const unsubscribeCredentialObservation = onAuthSessionCredentialObservation((reason) => connectionEvidence.credential(reason));
27479
27848
  try {
27480
27849
  emitRunLine({
27481
27850
  presenter: input.presenter,
@@ -27503,8 +27872,11 @@ const runDaemonServiceLoop = async (input) => {
27503
27872
  }
27504
27873
  });
27505
27874
  while (!stopRequested) try {
27875
+ connectionEvidence.beginAttempt();
27506
27876
  connectionState.set("connecting", { reason: resolveConnectingReason(reconnectAttempt) });
27507
- const wsUrl = toDaemonStreamUrl(baseUrl);
27877
+ const connectionUrl = new URL(toDaemonStreamUrl(baseUrl));
27878
+ connectionUrl.searchParams.set(SERVICE_CONNECTION_ID_QUERY_PARAMETER, connectionEvidence.connectionDiagnosticId);
27879
+ const wsUrl = connectionUrl.toString();
27508
27880
  const authContext = await resolveDaemonStreamAuthContext({
27509
27881
  requestUrl: wsUrl,
27510
27882
  selectedOpenMeldProfile
@@ -27514,6 +27886,7 @@ const runDaemonServiceLoop = async (input) => {
27514
27886
  connectionState,
27515
27887
  credentialFailure: authContext.credentialFailure ?? null
27516
27888
  });
27889
+ connectionEvidence.opening();
27517
27890
  const ws = await connectWebSocket(wsUrl, {
27518
27891
  headers: {
27519
27892
  ...authContext.headers,
@@ -27526,6 +27899,8 @@ const runDaemonServiceLoop = async (input) => {
27526
27899
  break;
27527
27900
  }
27528
27901
  activeSocket = ws;
27902
+ activeCredentialFingerprint = authContext.credentialFingerprint;
27903
+ connectionEvidence.opened(ws);
27529
27904
  emitRunLine({
27530
27905
  presenter: input.presenter,
27531
27906
  code: "daemon.run.connected",
@@ -27553,6 +27928,7 @@ const runDaemonServiceLoop = async (input) => {
27553
27928
  ledgerPaths,
27554
27929
  loadRouteCatalog: routeCatalogLoader.load,
27555
27930
  localAdapterContainer,
27931
+ localComponentsObservation,
27556
27932
  localExecutionSlots,
27557
27933
  onRuntimeReportingAuthenticationFailure: async (failure) => {
27558
27934
  await requestRuntimeReportingAuthenticationRecovery({
@@ -27581,6 +27957,7 @@ const runDaemonServiceLoop = async (input) => {
27581
27957
  socket: ws,
27582
27958
  touchRuntimeState: async (updates) => {
27583
27959
  if (typeof updates.heartbeatAt === "string") {
27960
+ connectionEvidence.acknowledged(updates.heartbeatAt, connectionState.get().state !== "online");
27584
27961
  connectionState.set("online");
27585
27962
  reconnectAttempt = 0;
27586
27963
  recovery = null;
@@ -27613,9 +27990,14 @@ const runDaemonServiceLoop = async (input) => {
27613
27990
  presenter: input.presenter,
27614
27991
  reconnectAttempt
27615
27992
  });
27993
+ connectionEvidence.retry(error, connectionState.get().reason, backoffMs);
27616
27994
  await reconnectBackoffDelay.wait(backoffMs);
27617
27995
  }
27618
27996
  } finally {
27997
+ connectionEvidence.dispose();
27998
+ localComponentsObservation.dispose();
27999
+ unsubscribeCredentialObservation();
28000
+ unsubscribeCredentialAvailability();
27619
28001
  controlledShutdown.failOutstanding();
27620
28002
  process.off("SIGINT", onSigint);
27621
28003
  process.off("SIGTERM", onSigterm);
@@ -27951,12 +28333,25 @@ function createRunLoopConnectionStateTracker(presenter, recoveryMetadata) {
27951
28333
  }
27952
28334
  function noteRunLoopReconnectScheduled(input) {
27953
28335
  const errorMessage = toErrorMessage$10(input.error);
27954
- const failureReason = classifyConnectionFailureReason(errorMessage);
27955
- const authState = input.error instanceof DaemonStreamAuthenticationRequiredError ? input.error.authState : null;
27956
- const backoffMs = resolveServiceConnectionReconnectBackoffMs({
28336
+ const credentialFailure = input.error instanceof DaemonStreamAuthenticationRequiredError ? input.error.credentialFailure : null;
28337
+ let failureReason = classifyConnectionFailureReason(errorMessage);
28338
+ if (credentialFailure?.reason === "session_token_unavailable") failureReason = "auth_unavailable";
28339
+ else if (input.error instanceof DaemonStreamAuthenticationRequiredError || input.error instanceof WebSocketConnectionError && input.error.status === 401) failureReason = "auth_rejected";
28340
+ let authState = input.error instanceof DaemonStreamAuthenticationRequiredError ? input.error.authState : null;
28341
+ if (failureReason === "auth_unavailable") authState = null;
28342
+ const policyBackoffMs = resolveServiceConnectionReconnectBackoffMs({
27957
28343
  attempt: input.reconnectAttempt,
27958
28344
  reason: failureReason
27959
28345
  });
28346
+ const credentialRetryAfterMs = credentialFailure?.retryAfterMs ?? 0;
28347
+ let backoffMs = policyBackoffMs;
28348
+ if (failureReason === "auth_unavailable" && credentialRetryAfterMs > 0) backoffMs = credentialRetryAfterMs;
28349
+ else if (failureReason !== "auth_rejected") backoffMs = applyIntervalJitterMs({
28350
+ baseIntervalMs: policyBackoffMs,
28351
+ minIntervalMs: DEFAULT_RECONNECT_DELAY_MS,
28352
+ maxIntervalMs: MAX_RECONNECT_DELAY_MS,
28353
+ jitterRatio: .2
28354
+ });
27960
28355
  noteReconnectFailureState({
27961
28356
  authState,
27962
28357
  connectionState: input.connectionState,
@@ -28045,6 +28440,13 @@ function throwDaemonStreamAuthenticationRequired(input) {
28045
28440
  }
28046
28441
  function noteAuthenticationRequiredState(input) {
28047
28442
  const detail = input.credentialFailure ? `stored credentials are not attachable to the daemon stream (${input.credentialFailure.reason}: requestHost=${input.credentialFailure.requestHost ?? "unknown"}, authHost=${input.credentialFailure.authHost ?? "unknown"}, expectedGatewayHost=${input.credentialFailure.expectedGatewayHost ?? "unknown"})` : `connecting without credentials, session=${input.authState}`;
28443
+ if (input.credentialFailure?.reason === "session_token_unavailable") {
28444
+ input.connectionState.set("degraded", {
28445
+ detail,
28446
+ reason: "auth_unavailable"
28447
+ });
28448
+ return;
28449
+ }
28048
28450
  input.connectionState.set("authentication_required", {
28049
28451
  authState: input.authState,
28050
28452
  detail,
@@ -39527,6 +39929,6 @@ async function emitAgentsConfigParseFallbackSignal(input) {
39527
39929
  });
39528
39930
  }
39529
39931
  //#endregion
39530
- export { renderHumanTextErrorCard as $, ensureCommandAuthenticationOrCancel as $n, buildSignalMessageReadProjection as $t, runDaemonBackgroundStartForDecision as A, buildAgentActivityEvent as An, cliJsonSkillsShowEnvelopeSchema as Ar, resolveLocalAgentControllerLaunchability as At, runDaemonUninstall as B, enqueueControllerTaskLifecycleEventWhileLocked as Bn, readSpaceRecentMentionProfileIds as Bt, resolveGatewayWebOrigin as C, returnToTargetPickerState as Cn, isCurrentCommandCheckScopeActive as Cr, resolveDaemonServiceParticipationStatus as Ct, isManagedSystemServiceBootstrapRun as D, readRecentDaemonDispatchJournalEvents as Dn, cliJsonOutputEnvelopeSchema as Dr, submitRuntimeAgentControllerReports as Dt, bestEffortStopCurrentLaneDaemonService as E, OPENMELD_DISPATCH_RUNTIME_MODE_ENV as En, cliJsonErrorEnvelopeSchema as Er, submitRuntimeAgentControllerReport as Et, runDaemonRunAfterEntryChecks as F, removeAgentActivityContextCache as Fn, revokeOrganizationJoinLinkResponseSchema as Fr, isLocalSpaceStateCorruptResult as Ft, buildProfileWorkspaceRows as G, unregisterAgentActivityRoute as Gn, upsertSpaceConfig as Gt, formatServiceRuntimeHeadline as H, isAgentActivityRouteRegistered as Hn, toLocalSpaceStateIntegrityError as Ht, runDaemonSnapshot as I, enqueueAgentActivityHookEvent as In, listSpaceConfigs as It, createDelayedSpinner as J, installAgentActivityIntegrations as Jn, SpaceComposerSubmissionError as Jt, reconcileCliVersionView as K, AGENT_ACTIVITY_INTEGRATION_OWNER as Kn, writeSpaceCacheDeletionNoticeState as Kt, runDaemonStatusFlow as L, removeProjectInbox as Ln, readSpaceCacheDeletionNoticeState as Lt, runDaemonInstall as M, normalizeSharedSessionTitle as Mn, getOrganizationJoinLinkResponseSchema as Mr, projectSpaceProfileCache as Mt, runDaemonInterrupt as N, readCodexSessionTitles as Nn, organizationJoinLinkErrorResponseSchema as Nr, LocalSpaceStateIntegrityError as Nt, runDaemon as O, connectWebSocket as On, cliJsonSkillsListEnvelopeSchema as Or, collectLocalAgentControllerInventory as Ot, runDaemonReinstall as P, readAgentActivityContextForPath as Pn, organizationJoinLinkManagementQuerySchema as Pr, inspectSpaceCacheFile as Pt, renderHumanErrorCard as Q, buildCommandAuthenticationPromptMessage as Qn, buildSignalIndex as Qt, runDaemonStop as R, readAgentActivityOutboxHealth as Rn, readSpaceConfig as Rt, buildSpaceWebUrl as S, resolveSpaceMemberAgentOwnerWakeDiagnosticsView as Sn, getCurrentCommandCheckState as Sr, writeInstalledLocalComponentsSnapshot as St, runDaemonServiceParticipationGate as T, DISPATCH_OWNED_RUNTIME_MODE as Tn, startCurrentCommandCheckScope as Tr, submitProfileRuntimeAgentControllerReport as Tt, resolveServiceParticipationReadiness as U, registerAgentActivityRoute as Un, toSpaceConfigListIntegrityError as Ut, formatServiceParticipationReadinessLabel as V, readControllerTaskLifecycleOutboxHealth as Vn, removeSpaceConfig as Vt, buildProfileWorkspacePresentation as W, resolveAgentActivityRouteForPath as Wn, updateSpaceLastSeenTs as Wt, runDaemonStartDecisionPrompt as X, resolveAgentActivityDispatcherCommand as Xn, buildDispatchResultReplyWorkflowProjection as Xt, shouldEmitAgentOverview as Y, readAgentActivityIntegrationStatus as Yn, buildDispatchResultMessageReadProjection as Yt, buildHumanErrorCopy as Z, uninstallAgentActivityIntegrations as Zn, buildPublicSpaceEntryUrl as Zt, promptSearchSelect as _, listSpaceMentionSuggestions as _n, revokeAuthAccessToken as _r, readDispatchSpaceActionContextFromEnv as _t, runAgentsCustomRemove as a, buildSpaceRoundReadProjection as an, exchangeOneTimeTokenAuthSession as ar, fetchSpaceMeta as at, resolveOffsetVisibleWindow as b, prepareSpaceFileOnlySubmission as bn, runInteractivePrompt as br, validateLocalProjectConnectionPath as bt, runAgentsDisable as c, collectResolvedSpaceMentions as cn, formatActiveOrganizationLabel as cr, parseSpaceMetaResponse as ct, runAgentsManage as d, enterRelationPickerState as dn, buildUnifiedCardFrame as dr, readGatewayTextResponse as dt, buildSignalReplyWorkflowProjection as en, evaluateCommandAuthentication as er, emitCliJsonEnvelope as et, runAgentsRepair as f, extractMentionAuthoringPrefix as fn, extractAuthApiErrorMessage as fr, toStructuredGatewayFailure as ft, promptSearchMultiselectWorkbench as g, listSpaceMentionRelationChoices as gn, resolveDeviceTokenExpiresAt as gr, OPENMELD_SPACE_ACTION_CONTEXT_PATH_ENV as gt, promptSearchMultiselect as h, isTargetPickerState as hn, resolveDeviceAuthClientId as hr, readDispatchOwnedRuntimeGuard as ht, runAgentsCustomList as i, buildSpaceProfileAddPlan as in, runAuthStatus as ir, createCliSpaceApi as it, runDaemonCancel as j, resolveObservedAgentActivityBinding as jn, acceptOrganizationJoinLinkBodySchema as jr, resolveLocalAgentControllerReportDecision as jt, runDaemonAutostart as k, syncLocalAgentActivity as kn, cliJsonSkillsLoadEnvelopeSchema as kr, resolveLocalAgentControllerBlockerReasonCodes as kt, runAgentsEnable as l, createSpaceMemberIdentityIndex as ln, renderInfoCard as lr, GatewayHttpError as lt, formatTransportModeDisplay as m, isRelationPickerState as mn, requestDeviceToken as mr, assertDispatchOwnedRuntimePublicWriteAllowed as mt, runAgentsConfig as n, buildSpaceMentionProfileIndex as nn, runAuthLogout as nr, readDaemonIncidentLogTail as nt, runAgentsCustomUpdate as o, buildUpdatesReplyWorkflowProjection as on, buildAuthStatusRows as or, updateSpaceMeta as ot, runAgentsShow as p, formatRemovedCcRelationMessage as pn, fetchAuthUserSnapshot as pr, parseJsonResponse as pt, emitDaemonAgentOverview as q, defaultManagedIntegrationPaths as qn, writeSpaceRecentMentionProfileIds as qt, runAgentsCustomAdd as r, buildSpaceMessageReadRelationSummary as rn, runAuthMenu as rr, fetchSpaceUpdates as rt, runAgentsDetect as s, closeMentionPickerState as sn, buildAuthStatusSnapshot as sr, parseSpaceMetaPayload as st, runAgents as t, buildSpaceMemberAgentPresencePresentation as tn, runAuthLogin as tr, runDaemonStartupPreflight as tt, runAgentsList as u, createSpaceTargetCatalog as un, renderTextInfoCard as ur, readGatewayJsonResponse as ut, clampNumber as v, openTargetPickerState as vn, promptTextEntry as vr, writeDispatchSpaceActionRecord as vt, resolveSpaceWebGatewayOrigin as w, updateAuthoredMentionRanges as wn, resetCurrentCommandCheckState as wr, readRuntimeReportingHealthState as wt, computeRetryDelayMs as x, resolveNextRecentMentionProfileIdsForQueuedText as xn, finishCurrentCommandCheckScope as xr, resolveLocalComponentsStatus as xt, resolveAnchoredVisibleWindow as y, prepareSpaceComposerSubmission as yn, isReturnKeypress as yr, LocalProjectConnectionError as yt, runDaemonTeardownStrict as z, removeProjectOutbox as zn, readSpaceLastSeenTs as zt };
39932
+ export { renderHumanTextErrorCard as $, ensureCommandAuthenticationOrCancel as $n, buildSignalMessageReadProjection as $t, runDaemonBackgroundStartForDecision as A, buildAgentActivityEvent as An, cliJsonSkillsShowEnvelopeSchema as Ar, resolveLocalAgentControllerLaunchability as At, runDaemonUninstall as B, enqueueControllerTaskLifecycleEventWhileLocked as Bn, readSpaceRecentMentionProfileIds as Bt, resolveGatewayWebOrigin as C, returnToTargetPickerState as Cn, isCurrentCommandCheckScopeActive as Cr, validateLocalProjectConnectionPath as Ct, isManagedSystemServiceBootstrapRun as D, readRecentDaemonDispatchJournalEvents as Dn, cliJsonOutputEnvelopeSchema as Dr, submitRuntimeAgentControllerReports as Dt, bestEffortStopCurrentLaneDaemonService as E, OPENMELD_DISPATCH_RUNTIME_MODE_ENV as En, cliJsonErrorEnvelopeSchema as Er, submitRuntimeAgentControllerReport as Et, runDaemonRunAfterEntryChecks as F, removeAgentActivityContextCache as Fn, revokeOrganizationJoinLinkResponseSchema as Fr, isLocalSpaceStateCorruptResult as Ft, buildProfileWorkspaceRows as G, unregisterAgentActivityRoute as Gn, upsertSpaceConfig as Gt, formatServiceRuntimeHeadline as H, isAgentActivityRouteRegistered as Hn, toLocalSpaceStateIntegrityError as Ht, runDaemonSnapshot as I, enqueueAgentActivityHookEvent as In, listSpaceConfigs as It, createDelayedSpinner as J, installAgentActivityIntegrations as Jn, SpaceComposerSubmissionError as Jt, reconcileCliVersionView as K, AGENT_ACTIVITY_INTEGRATION_OWNER as Kn, writeSpaceCacheDeletionNoticeState as Kt, runDaemonStatusFlow as L, removeProjectInbox as Ln, readSpaceCacheDeletionNoticeState as Lt, runDaemonInstall as M, normalizeSharedSessionTitle as Mn, getOrganizationJoinLinkResponseSchema as Mr, projectSpaceProfileCache as Mt, runDaemonInterrupt as N, readCodexSessionTitles as Nn, organizationJoinLinkErrorResponseSchema as Nr, LocalSpaceStateIntegrityError as Nt, runDaemon as O, connectWebSocket as On, cliJsonSkillsListEnvelopeSchema as Or, collectLocalAgentControllerInventory as Ot, runDaemonReinstall as P, readAgentActivityContextForPath as Pn, organizationJoinLinkManagementQuerySchema as Pr, inspectSpaceCacheFile as Pt, renderHumanErrorCard as Q, buildCommandAuthenticationPromptMessage as Qn, buildSignalIndex as Qt, runDaemonStop as R, readAgentActivityOutboxHealth as Rn, readSpaceConfig as Rt, buildSpaceWebUrl as S, resolveSpaceMemberAgentOwnerWakeDiagnosticsView as Sn, getCurrentCommandCheckState as Sr, LocalProjectConnectionError as St, runDaemonServiceParticipationGate as T, DISPATCH_OWNED_RUNTIME_MODE as Tn, startCurrentCommandCheckScope as Tr, submitProfileRuntimeAgentControllerReport as Tt, resolveServiceParticipationReadiness as U, registerAgentActivityRoute as Un, toSpaceConfigListIntegrityError as Ut, formatServiceParticipationReadinessLabel as V, readControllerTaskLifecycleOutboxHealth as Vn, removeSpaceConfig as Vt, buildProfileWorkspacePresentation as W, resolveAgentActivityRouteForPath as Wn, updateSpaceLastSeenTs as Wt, runDaemonStartDecisionPrompt as X, resolveAgentActivityDispatcherCommand as Xn, buildDispatchResultReplyWorkflowProjection as Xt, shouldEmitAgentOverview as Y, readAgentActivityIntegrationStatus as Yn, buildDispatchResultMessageReadProjection as Yt, buildHumanErrorCopy as Z, uninstallAgentActivityIntegrations as Zn, buildPublicSpaceEntryUrl as Zt, promptSearchSelect as _, listSpaceMentionSuggestions as _n, revokeAuthAccessToken as _r, assertDispatchOwnedRuntimePublicWriteAllowed as _t, runAgentsCustomRemove as a, buildSpaceRoundReadProjection as an, exchangeOneTimeTokenAuthSession as ar, resolveDaemonServiceParticipationStatus as at, resolveOffsetVisibleWindow as b, prepareSpaceFileOnlySubmission as bn, runInteractivePrompt as br, readDispatchSpaceActionContextFromEnv as bt, runAgentsDisable as c, collectResolvedSpaceMentions as cn, formatActiveOrganizationLabel as cr, fetchSpaceMeta as ct, runAgentsManage as d, enterRelationPickerState as dn, buildUnifiedCardFrame as dr, parseSpaceMetaResponse as dt, buildSignalReplyWorkflowProjection as en, evaluateCommandAuthentication as er, emitCliJsonEnvelope as et, runAgentsRepair as f, extractMentionAuthoringPrefix as fn, extractAuthApiErrorMessage as fr, GatewayHttpError as ft, promptSearchMultiselectWorkbench as g, listSpaceMentionRelationChoices as gn, resolveDeviceTokenExpiresAt as gr, parseJsonResponse as gt, promptSearchMultiselect as h, isTargetPickerState as hn, resolveDeviceAuthClientId as hr, toStructuredGatewayFailure as ht, runAgentsCustomList as i, buildSpaceProfileAddPlan as in, runAuthStatus as ir, writeInstalledLocalComponentsSnapshot as it, runDaemonCancel as j, resolveObservedAgentActivityBinding as jn, acceptOrganizationJoinLinkBodySchema as jr, resolveLocalAgentControllerReportDecision as jt, runDaemonAutostart as k, syncLocalAgentActivity as kn, cliJsonSkillsLoadEnvelopeSchema as kr, resolveLocalAgentControllerBlockerReasonCodes as kt, runAgentsEnable as l, createSpaceMemberIdentityIndex as ln, renderInfoCard as lr, updateSpaceMeta as lt, formatTransportModeDisplay as m, isRelationPickerState as mn, requestDeviceToken as mr, readGatewayTextResponse as mt, runAgentsConfig as n, buildSpaceMentionProfileIndex as nn, runAuthLogout as nr, readDaemonIncidentLogTail as nt, runAgentsCustomUpdate as o, buildUpdatesReplyWorkflowProjection as on, buildAuthStatusRows as or, fetchSpaceUpdates as ot, runAgentsShow as p, formatRemovedCcRelationMessage as pn, fetchAuthUserSnapshot as pr, readGatewayJsonResponse as pt, emitDaemonAgentOverview as q, defaultManagedIntegrationPaths as qn, writeSpaceRecentMentionProfileIds as qt, runAgentsCustomAdd as r, buildSpaceMessageReadRelationSummary as rn, runAuthMenu as rr, resolveLocalComponentsStatus as rt, runAgentsDetect as s, closeMentionPickerState as sn, buildAuthStatusSnapshot as sr, createCliSpaceApi as st, runAgents as t, buildSpaceMemberAgentPresencePresentation as tn, runAuthLogin as tr, runDaemonStartupPreflight as tt, runAgentsList as u, createSpaceTargetCatalog as un, renderTextInfoCard as ur, parseSpaceMetaPayload as ut, clampNumber as v, openTargetPickerState as vn, promptTextEntry as vr, readDispatchOwnedRuntimeGuard as vt, resolveSpaceWebGatewayOrigin as w, updateAuthoredMentionRanges as wn, resetCurrentCommandCheckState as wr, readRuntimeReportingHealthState as wt, computeRetryDelayMs as x, resolveNextRecentMentionProfileIdsForQueuedText as xn, finishCurrentCommandCheckScope as xr, writeDispatchSpaceActionRecord as xt, resolveAnchoredVisibleWindow as y, prepareSpaceComposerSubmission as yn, isReturnKeypress as yr, OPENMELD_SPACE_ACTION_CONTEXT_PATH_ENV as yt, runDaemonTeardownStrict as z, removeProjectOutbox as zn, readSpaceLastSeenTs as zt };
39531
39933
 
39532
- //# sourceMappingURL=agents-CQlCI9-A.js.map
39934
+ //# sourceMappingURL=agents-BOTlKiwS.js.map