openmeld 0.3.212 → 0.3.214

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 (109) hide show
  1. package/dist/{add-me-membership-BwPpVKtA.js → add-me-membership-BaqG9F5c.js} +2 -2
  2. package/dist/{add-me-membership-BwPpVKtA.js.map → add-me-membership-BaqG9F5c.js.map} +1 -1
  3. package/dist/{agents-Y-UJ74By.js → agents-y9C8FCyv.js} +8 -8
  4. package/dist/{agents-Y-UJ74By.js.map → agents-y9C8FCyv.js.map} +1 -1
  5. package/dist/{api-client-foundation-CrQN8_-N.js → api-client-foundation-BYnU1pbS.js} +1 -1
  6. package/dist/{api-client-foundation-DjbtuE52.js → api-client-foundation-CKRP7Ymg.js} +3 -3
  7. package/dist/{api-client-foundation-DjbtuE52.js.map → api-client-foundation-CKRP7Ymg.js.map} +1 -1
  8. package/dist/auth-session-BWKfXWxl.js +4 -0
  9. package/dist/{auth-session-Dqz9X4F0.js → auth-session-gaLjWIKR.js} +67 -8
  10. package/dist/auth-session-gaLjWIKR.js.map +1 -0
  11. package/dist/{base-url-C6sHRNGu.js → base-url-BczddvzH.js} +2 -2
  12. package/dist/{base-url-C6sHRNGu.js.map → base-url-BczddvzH.js.map} +1 -1
  13. package/dist/{base-url-BE3pFiOZ.js → base-url-CfyKRz89.js} +1 -1
  14. package/dist/{command-jgHbP21v.js → command-C72QNhjP.js} +13 -13
  15. package/dist/{command-jgHbP21v.js.map → command-C72QNhjP.js.map} +1 -1
  16. package/dist/computer-connection-Dv9kex7h.js +120 -0
  17. package/dist/computer-connection-Dv9kex7h.js.map +1 -0
  18. package/dist/{computer-connection-review-CzSpaHE0.js → computer-connection-review-_ZLPsdE_.js} +6 -6
  19. package/dist/{computer-connection-review-CzSpaHE0.js.map → computer-connection-review-_ZLPsdE_.js.map} +1 -1
  20. package/dist/{computer-disconnect-DNM7jvda.js → computer-disconnect-BJ-Tl-7q.js} +9 -9
  21. package/dist/{computer-disconnect-DNM7jvda.js.map → computer-disconnect-BJ-Tl-7q.js.map} +1 -1
  22. package/dist/{computer-setup-continuation-BqdhIAjT.js → computer-setup-continuation-CN383Vvy.js} +4 -4
  23. package/dist/{computer-setup-continuation-BqdhIAjT.js.map → computer-setup-continuation-CN383Vvy.js.map} +1 -1
  24. package/dist/{control-plane-PxntAyDq.js → control-plane-Bpu7g9Av.js} +2 -2
  25. package/dist/{control-plane-PxntAyDq.js.map → control-plane-Bpu7g9Av.js.map} +1 -1
  26. package/dist/{daemon-runtime-lease-Dd4hdHNo.js → daemon-runtime-lease-CIzOT1zx.js} +2 -2
  27. package/dist/{daemon-runtime-lease-Dd4hdHNo.js.map → daemon-runtime-lease-CIzOT1zx.js.map} +1 -1
  28. package/dist/{daemon-runtime-lease-y3n1K0-C.js → daemon-runtime-lease-_M6hW8Mg.js} +1 -1
  29. package/dist/{daemon-service-manager-GiMCiTmu.js → daemon-service-manager-DxS5eH_N.js} +4 -4
  30. package/dist/{daemon-service-manager-GiMCiTmu.js.map → daemon-service-manager-DxS5eH_N.js.map} +1 -1
  31. package/dist/{daemon-service-manager-Bh0LoLed.js → daemon-service-manager-fPpyIyrU.js} +1 -1
  32. package/dist/{daemon-service-runtime-CWTlAhZY.js → daemon-service-runtime-CGT3yVOs.js} +113 -26
  33. package/dist/daemon-service-runtime-CGT3yVOs.js.map +1 -0
  34. package/dist/{daemon-service-update-coordinator-DcjOzGu1.js → daemon-service-update-coordinator--xLHNqDT.js} +966 -210
  35. package/dist/daemon-service-update-coordinator--xLHNqDT.js.map +1 -0
  36. package/dist/{daemon-state-C37ZtIZK.js → daemon-state-CoAZLwpi.js} +3 -3
  37. package/dist/{daemon-state-C37ZtIZK.js.map → daemon-state-CoAZLwpi.js.map} +1 -1
  38. package/dist/dist-CABuqfdH.js +4 -0
  39. package/dist/{dist-jsWwS864.js → dist-Dj3TOx03.js} +548 -223
  40. package/dist/dist-Dj3TOx03.js.map +1 -0
  41. package/dist/distribution-BDQT2ilb.js +20 -0
  42. package/dist/distribution-BDQT2ilb.js.map +1 -0
  43. package/dist/{elapsed-time-iFOSSUJo.js → elapsed-time-CCFWbCC8.js} +9 -7
  44. package/dist/{elapsed-time-iFOSSUJo.js.map → elapsed-time-CCFWbCC8.js.map} +1 -1
  45. package/dist/{installation-inventory-B0cbVLun.js → installation-inventory-C4WKcVEj.js} +6 -6
  46. package/dist/{installation-inventory-B0cbVLun.js.map → installation-inventory-C4WKcVEj.js.map} +1 -1
  47. package/dist/{local-components-H3SkJMC1.js → local-components-B6SCXZf9.js} +10 -2
  48. package/dist/local-components-B6SCXZf9.js.map +1 -0
  49. package/dist/{lock-Dxp6o_t_.js → lock-CAt9uTnZ.js} +5 -48
  50. package/dist/lock-CAt9uTnZ.js.map +1 -0
  51. package/dist/{openmeld-B4gQCCex.js → openmeld-DpV9lAF-.js} +325 -190
  52. package/dist/openmeld-DpV9lAF-.js.map +1 -0
  53. package/dist/openmeld-dev.js +1 -1
  54. package/dist/{openmeld-environment-target-NtJYJe1D.js → openmeld-environment-target-BWI2adGw.js} +3 -3
  55. package/dist/{openmeld-environment-target-NtJYJe1D.js.map → openmeld-environment-target-BWI2adGw.js.map} +1 -1
  56. package/dist/{openmeld-maintenance-worker-DtY_H7Bv.js → openmeld-maintenance-worker-Blfu_oOo.js} +9 -9
  57. package/dist/{openmeld-maintenance-worker-DtY_H7Bv.js.map → openmeld-maintenance-worker-Blfu_oOo.js.map} +1 -1
  58. package/dist/{openmeld-tools-update-join-DS_EIL5q.js → openmeld-tools-update-join-BpLwmowQ.js} +6 -4
  59. package/dist/{openmeld-tools-update-join-DS_EIL5q.js.map → openmeld-tools-update-join-BpLwmowQ.js.map} +1 -1
  60. package/dist/{openmeld-tools-update-process-frame-CbZPpc7D.js → openmeld-tools-update-process-frame-0X-t0Kjv.js} +2 -2
  61. package/dist/{openmeld-tools-update-process-frame-CbZPpc7D.js.map → openmeld-tools-update-process-frame-0X-t0Kjv.js.map} +1 -1
  62. package/dist/{openmeld-tools-update-process-frame-CcPLrSsw.js → openmeld-tools-update-process-frame-DX1Dc8VI.js} +1 -1
  63. package/dist/openmeld.js +4 -4
  64. package/dist/{prepare-session-executor-CWKqfuse.js → prepare-session-executor-Cfm3EvXl.js} +176 -23
  65. package/dist/prepare-session-executor-Cfm3EvXl.js.map +1 -0
  66. package/dist/process-identity-Clby123a.js +145 -0
  67. package/dist/process-identity-Clby123a.js.map +1 -0
  68. package/dist/{runtime-transport-BQAmcHwF.js → runtime-transport-D8G8sANa.js} +113 -10
  69. package/dist/runtime-transport-D8G8sANa.js.map +1 -0
  70. package/dist/{service-CTG3_X0o.js → service-Cl_Ge6oJ.js} +949 -75
  71. package/dist/service-Cl_Ge6oJ.js.map +1 -0
  72. package/dist/{distribution-DY2fBeSW.js → service-account-admission-Dy2W3n3_.js} +9 -19
  73. package/dist/service-account-admission-Dy2W3n3_.js.map +1 -0
  74. package/dist/{service-account-authorization-Dq4LcAVa.js → service-account-authorization-4oZuo8sT.js} +6 -6
  75. package/dist/{service-account-authorization-Dq4LcAVa.js.map → service-account-authorization-4oZuo8sT.js.map} +1 -1
  76. package/dist/{service-account-control-BTR_X7QM.js → service-account-control-CTXv3924.js} +11 -12
  77. package/dist/service-account-control-CTXv3924.js.map +1 -0
  78. package/dist/{service-control-capabilities-ChRe8hkw.js → service-control-capabilities-B-vCQoBV.js} +1 -1
  79. package/dist/service-control-capabilities-ptf0u8n5.js +70 -0
  80. package/dist/service-control-capabilities-ptf0u8n5.js.map +1 -0
  81. package/dist/service-control-carrier-capability-hvpD7hGf.js +24 -0
  82. package/dist/service-control-carrier-capability-hvpD7hGf.js.map +1 -0
  83. package/dist/upgrade-EWdIdoHm.js +4 -0
  84. package/dist/{upgrade-DAVEeo8B.js → upgrade-vuPM1iX3.js} +12 -9
  85. package/dist/{upgrade-DAVEeo8B.js.map → upgrade-vuPM1iX3.js.map} +1 -1
  86. package/dist/{windows-user-task-DxPN7TzK.js → windows-user-task-FdycoSb4.js} +1 -1
  87. package/dist/{windows-user-task-DqJWtlAm.js → windows-user-task-i0oHCBc0.js} +49 -19
  88. package/dist/windows-user-task-i0oHCBc0.js.map +1 -0
  89. package/package.json +2 -2
  90. package/dist/auth-session-Dqz9X4F0.js.map +0 -1
  91. package/dist/auth-session-bRzDGlXy.js +0 -4
  92. package/dist/computer-connection-DvqsgYls.js +0 -81
  93. package/dist/computer-connection-DvqsgYls.js.map +0 -1
  94. package/dist/daemon-service-runtime-CWTlAhZY.js.map +0 -1
  95. package/dist/daemon-service-update-coordinator-DcjOzGu1.js.map +0 -1
  96. package/dist/dist--pb6JxqG.js +0 -4
  97. package/dist/dist-jsWwS864.js.map +0 -1
  98. package/dist/distribution-DY2fBeSW.js.map +0 -1
  99. package/dist/local-components-H3SkJMC1.js.map +0 -1
  100. package/dist/lock-Dxp6o_t_.js.map +0 -1
  101. package/dist/openmeld-B4gQCCex.js.map +0 -1
  102. package/dist/prepare-session-executor-CWKqfuse.js.map +0 -1
  103. package/dist/runtime-transport-BQAmcHwF.js.map +0 -1
  104. package/dist/service-CTG3_X0o.js.map +0 -1
  105. package/dist/service-account-control-BTR_X7QM.js.map +0 -1
  106. package/dist/service-control-capabilities-C5SxnBg2.js +0 -54
  107. package/dist/service-control-capabilities-C5SxnBg2.js.map +0 -1
  108. package/dist/upgrade-DKXu-1wO.js +0 -4
  109. package/dist/windows-user-task-DqJWtlAm.js.map +0 -1
@@ -2,39 +2,41 @@
2
2
 
3
3
  import { n as toDaemonRouteObservationUrl } from "./urls-CY2uzH2-.js";
4
4
  import { t as isLoopbackHostname } from "./loopback-hostname-DHQPKq8N.js";
5
- import { B as deviceOpenClawProfileBootstrapPath, C as isProcessIdentityAlive, H as deviceOpenClawProfileWorkspaceDir, I as accountProfileViewPath, L as accountProfileWorkspacePath, N as OPENMELD_HOME_ENV_KEY, P as accountProfileLocalMetaPath, Q as openMeldBackupsDir, S as CURRENT_PROCESS_START_IDENTITY, V as deviceOpenClawProfileDir, X as normalizeAccountKey, Z as normalizeOpenMeldProfileId, _ as resolveCliContext, a as isOpenMeldOrphanedLockError, d as runWithHeldLock, dt as resolveOpenMeldEnvPreset, ft as resolveOpenMeldRootDir, g as readCliContextState, h as listCliContextStates, ht as runtimeDir, i as isOpenMeldLockError, q as isPublishedOpenMeldHome, rt as openMeldRootDir, t as acquireLock, tt as openMeldManagedVersionBinaryPath, y as writeCliContextState, yt as systemDir } from "./lock-Dxp6o_t_.js";
6
- import { Ar as modelCatalogSchema, Ci as agentControllerCollaborationModeSchema, Gn as OPENMELD_HEADER_PROFILE_ID, Kt as createLocalRuntimeExpectedRoutesApi, Mt as createAgentProfileBindingApi, Si as agentControllerPermissionModeSchema, Xn as toErrorMessage$24, jn as toStructuredApiClientFailure, t as OpenMeldApiClientHttpError, xi as openCodePermissionConfigSchema, zt as createCurrentDeviceApi } from "./dist-jsWwS864.js";
5
+ import { A as OPENMELD_HOME_ENV_KEY, J as normalizeOpenMeldProfileId, L as deviceOpenClawProfileBootstrapPath, N as accountProfileViewPath, P as accountProfileWorkspacePath, Q as openMeldManagedVersionBinaryPath, R as deviceOpenClawProfileDir, W as isPublishedOpenMeldHome, Y as openMeldBackupsDir, _ as resolveCliContext, a as isOpenMeldOrphanedLockError, ct as resolveOpenMeldEnvPreset, d as runWithHeldLock, et as openMeldRootDir, ft as runtimeDir, g as readCliContextState, gt as systemDir, h as listCliContextStates, i as isOpenMeldLockError, j as accountProfileLocalMetaPath, lt as resolveOpenMeldRootDir, q as normalizeAccountKey, t as acquireLock, y as writeCliContextState, z as deviceOpenClawProfileWorkspaceDir } from "./lock-CAt9uTnZ.js";
6
+ import { Ci as openCodePermissionConfigSchema, Kt as createLocalRuntimeExpectedRoutesApi, Mr as modelCatalogSchema, Mt as createAgentProfileBindingApi, Nn as toStructuredApiClientFailure, Qn as toErrorMessage$24, Ti as agentControllerCollaborationModeSchema, qn as OPENMELD_HEADER_PROFILE_ID, t as OpenMeldApiClientHttpError, wi as agentControllerPermissionModeSchema, zt as createCurrentDeviceApi } from "./dist-Dj3TOx03.js";
7
7
  import { _ as canonicalizeAgentControllerRef, b as normalizeKnownBuiltinAgentControllerId, d as resolveBuiltinAgentControllerConversationKind, f as HOSTED_CENTER_AGENT_CONTROLLER_REF, g as buildAgentControllerRoutingKey, l as buildAgentControllerConversationRef, m as HOSTED_REMOTE_AGENT_CONTROLLER_REF, n as runtimeAgentControllerConversationIdMappingSpecSchema, o as runtimeStreamingModeSchema, p as HOSTED_CENTER_AGENT_CONTROLLER_REF_ID, r as runtimeAgentControllerLaunchContractSchema, s as runtimeTransportModeSchema, u as conversationPolicySchema, v as canonicalizeBuiltinAgentControllerRef, x as parseAgentControllerRef$1 } from "./controller-contract-pe3_Re-c.js";
8
- import { An as normalizeMessageEnvelope, B as isOriginalErrorSafeForMessageDetails, Br as ADDITIONAL_HUMAN_PROFILE_CREATION_DISABLED_MESSAGE, Dn as formatCanonicalMentionLiteral, G as openMeldDaemonTaskResultOpenClawGatewayVisibilityStatusSchema, Gr as profileErrorResponseSchema, Hr as authProfileManagedRoleSchema, Jn as agentInteractionResolutionSchema, Lr as localAgentCatalogSchema, N as runtimeTransportRejectedProfileRegistrationSchema, O as runtimeTransportLookupRouteOwnerServiceEvidenceSchema, Qr as resolveCommandAgentWorkActivity, U as openMeldDaemonProviderAccessEvidenceSchema, W as openMeldDaemonTaskResultEnvelopeWriteSchema, Wr as profileCapabilitiesResponseSchema, X as resolvePublicAgentAvailabilityCopy, Yr as openMeldProfileIdSchema, Z as resolvePublicAgentFailureRecovery, _ as runtimeTransportErrorCodeSchema, i as localWakeRouteReportSchema, n as daemonExecutionCompatibilitySchema, o as runtimeTransportCapabilitiesSchema, t as CURRENT_DAEMON_EXECUTION_CONTRACT_EPOCH, z as OPENMELD_ORIGINAL_ERROR_MAX_LENGTH, zr as ADDITIONAL_HUMAN_PROFILE_CREATION_DISABLED_CODE } from "./runtime-transport-BQAmcHwF.js";
9
- import { A as profileWorkspaceModeSchema, C as normalizeOptionalWorkingDirectory, S as agentProfileIdSchema, _ as providerDispatchRuntimeContextSchema, a as openMeldDaemonControlPlaneResponseSchema, g as skippedDaemonProfileSchema, i as openMeldDaemonControlPlaneRequestSchema, x as MAX_PROFILE_WORKING_DIRECTORY_LENGTH, y as conversationExecutionStateSchema } from "./control-plane-PxntAyDq.js";
10
- import { v as openMeldToolsUpdateAttemptSchema, w as openMeldToolsUpdateRequestSourceSchema } from "./local-components-H3SkJMC1.js";
8
+ import { B as isOriginalErrorSafeForMessageDetails, G as openMeldDaemonTaskResultOpenClawGatewayVisibilityStatusSchema, Kr as ADDITIONAL_HUMAN_PROFILE_CREATION_DISABLED_CODE, Ln as normalizeMessageEnvelope, N as runtimeTransportRejectedProfileRegistrationSchema, O as runtimeTransportLookupRouteOwnerServiceEvidenceSchema, Pn as formatCanonicalMentionLiteral, Qr as profileErrorResponseSchema, U as openMeldDaemonProviderAccessEvidenceSchema, W as openMeldDaemonTaskResultEnvelopeWriteSchema, Wr as localAgentCatalogSchema, X as resolvePublicAgentAvailabilityCopy, Yr as authProfileManagedRoleSchema, Z as resolvePublicAgentFailureRecovery, Zr as profileCapabilitiesResponseSchema, _ as runtimeTransportErrorCodeSchema, ai as resolveCommandAgentWorkActivity, i as localWakeRouteReportSchema, n as daemonExecutionCompatibilitySchema, ni as openMeldProfileIdSchema, o as runtimeTransportCapabilitiesSchema, qr as ADDITIONAL_HUMAN_PROFILE_CREATION_DISABLED_MESSAGE, t as CURRENT_DAEMON_EXECUTION_CONTRACT_EPOCH, tr as agentInteractionResolutionSchema, z as OPENMELD_ORIGINAL_ERROR_MAX_LENGTH } from "./runtime-transport-D8G8sANa.js";
9
+ import { $ as RUNTIME_AGENT_CONTROLLER_REPORT_SYNC_RETRY_INTERVAL_MS$1, B as DEFAULT_HEARTBEAT_INTERVAL_MS$1, F as DAEMON_RUNTIME_CONTRACT_EPOCH$1, G as MIN_HEARTBEAT_INTERVAL_MS$2, H as HEARTBEAT_RESPONSE_TIMEOUT_MS$1, I as DAEMON_STREAM_CONNECT_TIMEOUT_MS$1, J as PROVIDER_CONVERSATION_PROOF_SYNC_INTERVAL_MS$1, L as DAEMON_STREAM_KEEPALIVE_INTERVAL_MS$1, N as CATALOG_SYNC_RETRY_INTERVAL_MS$1, P as CATALOG_SYNC_SIGNAL_POLL_INTERVAL_MS$1, Q as RUNTIME_AGENT_CONTROLLER_REPORT_SYNC_INTERVAL_MS$1, R as DAEMON_STREAM_KEEPALIVE_PONG_TIMEOUT_MS$1, U as MAX_HEARTBEAT_INTERVAL_MS$2, X as REGISTER_RESPONSE_TIMEOUT_MS$1, Y as PROVIDER_CONVERSATION_PROOF_SYNC_RETRY_INTERVAL_MS$1, d as getAuthSessionState, et as RUNTIME_STATE_PERSIST_MIN_INTERVAL_MS$1, m as hasPendingComputerSetupContinuation, q as OPENCLAW_CLI_TIMEOUT_MS$1, z as DEFAULT_GATEWAY_CHAIN_TIMEOUT_MS$1 } from "./auth-session-gaLjWIKR.js";
10
+ import { A as profileWorkspaceModeSchema, C as normalizeOptionalWorkingDirectory, S as agentProfileIdSchema, _ as providerDispatchRuntimeContextSchema, a as openMeldDaemonControlPlaneResponseSchema, g as skippedDaemonProfileSchema, i as openMeldDaemonControlPlaneRequestSchema, x as MAX_PROFILE_WORKING_DIRECTORY_LENGTH, y as conversationExecutionStateSchema } from "./control-plane-Bpu7g9Av.js";
11
+ import { v as openMeldToolsUpdateAttemptSchema, w as openMeldToolsUpdateRequestSourceSchema } from "./local-components-B6SCXZf9.js";
11
12
  import { r as daemonServiceLaneSchema } from "./service-contract-CRyDcIIf.js";
12
- import { $ as RUNTIME_AGENT_CONTROLLER_REPORT_SYNC_RETRY_INTERVAL_MS$1, B as DEFAULT_HEARTBEAT_INTERVAL_MS$1, F as DAEMON_RUNTIME_CONTRACT_EPOCH$1, G as MIN_HEARTBEAT_INTERVAL_MS$2, H as HEARTBEAT_RESPONSE_TIMEOUT_MS$1, I as DAEMON_STREAM_CONNECT_TIMEOUT_MS$1, J as PROVIDER_CONVERSATION_PROOF_SYNC_INTERVAL_MS$1, L as DAEMON_STREAM_KEEPALIVE_INTERVAL_MS$1, N as CATALOG_SYNC_RETRY_INTERVAL_MS$1, P as CATALOG_SYNC_SIGNAL_POLL_INTERVAL_MS$1, Q as RUNTIME_AGENT_CONTROLLER_REPORT_SYNC_INTERVAL_MS$1, R as DAEMON_STREAM_KEEPALIVE_PONG_TIMEOUT_MS$1, U as MAX_HEARTBEAT_INTERVAL_MS$2, X as REGISTER_RESPONSE_TIMEOUT_MS$1, Y as PROVIDER_CONVERSATION_PROOF_SYNC_RETRY_INTERVAL_MS$1, d as getAuthSessionState, et as RUNTIME_STATE_PERSIST_MIN_INTERVAL_MS$1, m as hasPendingComputerSetupContinuation, q as OPENCLAW_CLI_TIMEOUT_MS$1, z as DEFAULT_GATEWAY_CHAIN_TIMEOUT_MS$1 } from "./auth-session-Dqz9X4F0.js";
13
- import { n as resolveOpenMeldDistribution, t as isBinaryDistribution } from "./distribution-DY2fBeSW.js";
14
- import { r as readDaemonRuntimeLease } from "./daemon-runtime-lease-Dd4hdHNo.js";
15
- import { $ as readManagedCliInstallation, A as prepareDaemonServiceBundle, B as resolveDaemonServiceArtifact, Bt as isUnsafeProductionDeviceId, C as daemonServiceExecutableWrapperPath, Ct as resolveDaemonServiceUpdateWorkerLaunchdPlistPath, D as ensureDaemonServiceStableBinaryExecutable, Dt as resolveDaemonServiceUpdateWorkerWindowsScriptPath, E as discardPreparedDaemonServiceBundle, Et as resolveDaemonServiceUpdateWorkerSystemdUnitPath, F as restoreDaemonActiveBundleStateSnapshot, Ft as requestLocalDaemonShutdown, Ht as upsertDaemonServiceContract, I as runAuditedServiceManagerCarrierMutation, It as requestLocalSyncRouteCatalog, L as verifyDaemonActiveBundleIntegrity, Mt as LocalDaemonControlPlaneClientError, N as resolveDaemonBundleEntryPathFromState, O as ensureDaemonServiceUpdateWorkerBinaryExecutable, P as resolveInstalledDaemonBundleFingerprint, Pt as requestLocalDaemonServiceUpdateReadiness, Q as pruneManagedInstallVersions, R as writeDaemonServiceExecutableWrapper, Rt as clearDaemonServiceContract, S as daemonServiceBinaryExecutablePath, St as resolveDaemonServiceUpdateWorkerIdentity, T as daemonServiceUpdateWorkerBinaryPath, Tt as resolveDaemonServiceUpdateWorkerSystemdTimerUnitPath, U as readLatestDaemonLifecycleConnectionStateEvent, V as emitDaemonLifecycleEvent, Vt as readDaemonServiceContract, W as readLatestDaemonLifecycleOriginEvent, _ as matchesExpectedDaemonServiceManagerDefinition, a as resolveDaemonRuntimeState, at as persistPendingDaemonServiceUpdate, bt as daemonServiceUpdateWorkerNpmEntryPath, c as resolveObservedDaemonRuntimeStatus, ct as buildNextVersionState, d as inspectLegacySharedDaemonService, et as resolveCliSelfVersion, f as listDaemonOwnedProcesses, ft as fetchLatestPackageInfo, g as assertDaemonMaintenanceInstallationOwnership, gt as resolveBundledServiceRelease, ht as writeVersionState, i as readCurrentObservedDaemonRuntimeStatus, it as completePendingDaemonServiceUpdate, j as readDaemonActiveBundleState, k as isDaemonBundleSourceAllowedForLane, l as resolveObservedRuntimeCommandEntryPath, lt as compareSemver, m as normalizeDaemonCommandPath, mt as readVersionState, n as getEffectiveDaemonRuntimeStatus, nt as OPENMELD_VERSION, o as resolveDaemonServiceManagerForRuntimeState, pt as isPlainReleaseVersion, q as runDaemonServiceManagerAction, r as readCurrentDaemonRuntimeContext, rt as DAEMON_SERVICE_UPDATE_JOB_SCHEMA, s as waitForDaemonSystemServiceToStop, st as readPendingDaemonServiceUpdate, t as clearDaemonRuntimeStateIfDefinitelyStopped, tt as withManagedInstallTransaction, u as cleanupLegacySharedDaemonServiceState, vt as INDEPENDENT_MAINTENANCE_REGISTRATION, w as daemonServiceLauncherPath, wt as resolveDaemonServiceUpdateWorkerSystemdPathUnitPath, x as clearDaemonServiceUpdateWorkerBinaryExecutable, xt as hasIndependentMaintenanceRegistration, y as activateDaemonServiceBundle, yt as configureDaemonMaintenanceEnvironment, z as writeDaemonServiceLauncher, zt as isDaemonServiceContractIdentityReusable } from "./daemon-service-runtime-CWTlAhZY.js";
16
- import { i as windowsTaskActionArguments, n as runWindowsUserTask, r as windowsPowerShellPath } from "./windows-user-task-DqJWtlAm.js";
17
- import { C as updateConfiguredDeviceRuntimeState, T as updateConfiguredSkillsConfig, _ as getConfiguredViewCustomization, a as resolveBaseUrl, c as resolveExplicitGatewayUrlOrThrow, d as createDefaultRuntimeAgentControllerSettings, g as getConfiguredSkillsConfig, h as getConfiguredOpenMeldToolsMaintenance, i as normalizeGatewayBaseUrlOrNull, o as resolveBaseUrlOrNull, p as getConfiguredDeviceRuntimeState, v as getRuntimeConfigReadHealth, x as setConfiguredOpenMeldToolsMaintenance, y as resolveRuntimeSkillsCustomTargetId } from "./base-url-C6sHRNGu.js";
13
+ import { r as readDaemonRuntimeLease } from "./daemon-runtime-lease-CIzOT1zx.js";
14
+ import { $ as readManagedCliInstallation, A as prepareDaemonServiceBundle, B as resolveDaemonServiceArtifact, Bt as isUnsafeProductionDeviceId, C as daemonServiceExecutableWrapperPath, Ct as resolveDaemonServiceUpdateWorkerLaunchdPlistPath, D as ensureDaemonServiceStableBinaryExecutable, Dt as resolveDaemonServiceUpdateWorkerWindowsScriptPath, E as discardPreparedDaemonServiceBundle, Et as resolveDaemonServiceUpdateWorkerSystemdUnitPath, F as restoreDaemonActiveBundleStateSnapshot, Ft as requestLocalDaemonShutdown, Ht as upsertDaemonServiceContract, I as runAuditedServiceManagerCarrierMutation, It as requestLocalSyncRouteCatalog, L as verifyDaemonActiveBundleIntegrity, Mt as LocalDaemonControlPlaneClientError, N as resolveDaemonBundleEntryPathFromState, O as ensureDaemonServiceUpdateWorkerBinaryExecutable, P as resolveInstalledDaemonBundleFingerprint, Pt as requestLocalDaemonServiceUpdateReadiness, Q as pruneManagedInstallVersions, R as writeDaemonServiceExecutableWrapper, Rt as clearDaemonServiceContract, S as daemonServiceBinaryExecutablePath, St as resolveDaemonServiceUpdateWorkerIdentity, T as daemonServiceUpdateWorkerBinaryPath, Tt as resolveDaemonServiceUpdateWorkerSystemdTimerUnitPath, U as readLatestDaemonLifecycleConnectionStateEvent, V as emitDaemonLifecycleEvent, Vt as readDaemonServiceContract, W as readLatestDaemonLifecycleOriginEvent, _ as matchesExpectedDaemonServiceManagerDefinition, a as resolveDaemonRuntimeState, at as persistPendingDaemonServiceUpdate, bt as daemonServiceUpdateWorkerNpmEntryPath, c as resolveObservedDaemonRuntimeStatus, ct as buildNextVersionState, d as inspectLegacySharedDaemonService, et as resolveCliSelfVersion, f as listDaemonOwnedProcesses, ft as fetchLatestPackageInfo, g as assertDaemonMaintenanceInstallationOwnership, gt as resolveBundledServiceRelease, ht as writeVersionState, i as readCurrentObservedDaemonRuntimeStatus, it as completePendingDaemonServiceUpdate, j as readDaemonActiveBundleState, k as isDaemonBundleSourceAllowedForLane, l as resolveObservedRuntimeCommandEntryPath, lt as compareSemver, m as normalizeDaemonCommandPath, mt as readVersionState, n as getEffectiveDaemonRuntimeStatus, nt as OPENMELD_VERSION, o as resolveDaemonServiceManagerForRuntimeState, pt as isPlainReleaseVersion, q as runDaemonServiceManagerAction, r as readCurrentDaemonRuntimeContext, rt as DAEMON_SERVICE_UPDATE_JOB_SCHEMA, s as waitForDaemonSystemServiceToStop, st as readPendingDaemonServiceUpdate, t as clearDaemonRuntimeStateIfDefinitelyStopped, tt as withManagedInstallTransaction, u as cleanupLegacySharedDaemonServiceState, vt as INDEPENDENT_MAINTENANCE_REGISTRATION, w as daemonServiceLauncherPath, wt as resolveDaemonServiceUpdateWorkerSystemdPathUnitPath, x as clearDaemonServiceUpdateWorkerBinaryExecutable, xt as hasIndependentMaintenanceRegistration, y as activateDaemonServiceBundle, yt as configureDaemonMaintenanceEnvironment, z as writeDaemonServiceLauncher, zt as isDaemonServiceContractIdentityReusable } from "./daemon-service-runtime-CGT3yVOs.js";
15
+ import { i as windowsTaskActionArguments, n as runWindowsUserTask, r as windowsPowerShellPath } from "./windows-user-task-i0oHCBc0.js";
16
+ import { C as updateConfiguredDeviceRuntimeState, T as updateConfiguredSkillsConfig, _ as getConfiguredViewCustomization, a as resolveBaseUrl, c as resolveExplicitGatewayUrlOrThrow, d as createDefaultRuntimeAgentControllerSettings, g as getConfiguredSkillsConfig, h as getConfiguredOpenMeldToolsMaintenance, i as normalizeGatewayBaseUrlOrNull, o as resolveBaseUrlOrNull, p as getConfiguredDeviceRuntimeState, v as getRuntimeConfigReadHealth, x as setConfiguredOpenMeldToolsMaintenance, y as resolveRuntimeSkillsCustomTargetId } from "./base-url-BczddvzH.js";
17
+ import { a as powerShellEncodedArguments, c as WINDOWS_RUNTIME_ENV_KEYS, l as normalizeCommandEnvironment, o as readWindowsProcessStartFileTime, r as isProcessIdentityAlive, s as resolveWindowsPowerShellPath, t as CURRENT_PROCESS_START_IDENTITY } from "./process-identity-Clby123a.js";
18
18
  import { n as writeDaemonLocalStateFile, t as readDaemonLocalStateFile } from "./daemon-local-state-file-jOXuXrky.js";
19
- import { A as getDaemonStatus, B as restoreDaemonInstallStateSnapshot, F as readDaemonServiceLifecycleLockMetaWithCleanup, I as readDaemonServiceRuntimeSnapshot, V as rotateDaemonControlPlaneTokenIfExpired, W as withDaemonServiceReconcileLock, _ as daemonRuntimeStateRootPath, a as DAEMON_SERVICE_RUNTIME_MODE_ENV, f as daemonLifecycleJournalPath, h as daemonRuntimeRootPath, i as DAEMON_SERVICE_RUNTIME_DETACHED_ENV, j as installDaemon, m as daemonRuntimeDataPath, n as DAEMON_SERVICE_RUNTIME_AUTO_START_ENV, r as DAEMON_SERVICE_RUNTIME_CONTROLLER_ENV, s as DAEMON_SERVICE_RUNTIME_SYSTEM_SERVICE_ENV } from "./daemon-state-C37ZtIZK.js";
20
- import { O as assertSafePublishedProductionServiceRegistrationMutation, S as resolveDaemonServiceManager, T as waitForLaunchdJobUnloaded, a as disableDaemonServiceAutostartIfConfigured, c as getDaemonSystemServiceLogPath, o as formatDaemonServiceJobDiagnosticsEvidence, s as getDaemonServiceLaunchdLabel, v as readDaemonServiceStartupPolicyCurrent, w as startLaunchdService } from "./daemon-service-manager-GiMCiTmu.js";
21
- import { a as formatOpenMeldCliCommand, c as formatOpenMeldCliTextBlock, i as formatInlineOpenMeldCliCommands, n as resolveOpenMeldEnvironmentTargetFromEnv, o as formatOpenMeldCliCommands, r as resolveAuthBaseUrl, t as resolveOpenMeldEnvironmentTarget } from "./openmeld-environment-target-NtJYJe1D.js";
19
+ import { n as resolveOpenMeldDistribution, t as isBinaryDistribution } from "./distribution-BDQT2ilb.js";
20
+ import { A as getDaemonStatus, B as restoreDaemonInstallStateSnapshot, F as readDaemonServiceLifecycleLockMetaWithCleanup, I as readDaemonServiceRuntimeSnapshot, V as rotateDaemonControlPlaneTokenIfExpired, W as withDaemonServiceReconcileLock, _ as daemonRuntimeStateRootPath, a as DAEMON_SERVICE_RUNTIME_MODE_ENV, f as daemonLifecycleJournalPath, h as daemonRuntimeRootPath, i as DAEMON_SERVICE_RUNTIME_DETACHED_ENV, j as installDaemon, m as daemonRuntimeDataPath, n as DAEMON_SERVICE_RUNTIME_AUTO_START_ENV, r as DAEMON_SERVICE_RUNTIME_CONTROLLER_ENV, s as DAEMON_SERVICE_RUNTIME_SYSTEM_SERVICE_ENV } from "./daemon-state-CoAZLwpi.js";
21
+ import { O as assertSafePublishedProductionServiceRegistrationMutation, S as resolveDaemonServiceManager, T as waitForLaunchdJobUnloaded, a as disableDaemonServiceAutostartIfConfigured, c as getDaemonSystemServiceLogPath, o as formatDaemonServiceJobDiagnosticsEvidence, s as getDaemonServiceLaunchdLabel, v as readDaemonServiceStartupPolicyCurrent, w as startLaunchdService } from "./daemon-service-manager-DxS5eH_N.js";
22
+ import { a as formatOpenMeldCliCommand, c as formatOpenMeldCliTextBlock, i as formatInlineOpenMeldCliCommands, n as resolveOpenMeldEnvironmentTargetFromEnv, o as formatOpenMeldCliCommands, r as resolveAuthBaseUrl, t as resolveOpenMeldEnvironmentTarget } from "./openmeld-environment-target-BWI2adGw.js";
22
23
  import { n as toErrorMessage$25, t as sleep } from "./dist-o3UL1EGQ.js";
23
- import { c as buildRequestAuthHeaders, d as buildOpenMeldRequestContextFromProfile, n as fetchSpaceRequestWithTimeout, s as buildOpenMeldRequestContextHeadersWithAuth, t as createCliApiClientFoundation } from "./api-client-foundation-DjbtuE52.js";
24
- import { a as encodePersistedOpenMeldToolsUpdateFailure, i as OpenMeldToolsUpdateFailureError, o as resolveOpenMeldToolsUpdateFailure, r as parseOpenMeldToolsUpdateFailureFrame, t as appendBoundedOpenMeldToolsUpdateProcessOutput } from "./openmeld-tools-update-process-frame-CbZPpc7D.js";
24
+ import { c as buildRequestAuthHeaders, d as buildOpenMeldRequestContextFromProfile, n as fetchSpaceRequestWithTimeout, s as buildOpenMeldRequestContextHeadersWithAuth, t as createCliApiClientFoundation } from "./api-client-foundation-CKRP7Ymg.js";
25
+ import { a as encodePersistedOpenMeldToolsUpdateFailure, i as OpenMeldToolsUpdateFailureError, o as resolveOpenMeldToolsUpdateFailure, r as parseOpenMeldToolsUpdateFailureFrame, t as appendBoundedOpenMeldToolsUpdateProcessOutput } from "./openmeld-tools-update-process-frame-0X-t0Kjv.js";
25
26
  import { createRequire } from "node:module";
26
27
  import { createHash, randomUUID } from "node:crypto";
27
28
  import { homedir, loadavg, tmpdir, userInfo } from "node:os";
28
- import { basename, delimiter, dirname, extname, isAbsolute, join, normalize, parse, relative, resolve, sep } from "node:path";
29
+ import { basename, delimiter, dirname, extname, isAbsolute, join, normalize, parse, relative, resolve, sep, win32 } from "node:path";
29
30
  import { access, chmod, copyFile, cp, mkdir, mkdtemp, open, readFile, readdir, realpath, rename, rm, stat, writeFile } from "node:fs/promises";
30
31
  import * as z$1 from "zod/v4";
31
- import { accessSync, constants, existsSync, readFileSync, realpathSync, statSync, watch, write } from "node:fs";
32
+ import { accessSync, closeSync, constants, existsSync, openSync, readFileSync, readSync, realpathSync, statSync, watch, write } from "node:fs";
32
33
  import process$1 from "node:process";
33
34
  import { execFile, spawn } from "node:child_process";
34
35
  import { setTimeout as setTimeout$1 } from "node:timers/promises";
35
36
  import { fileURLToPath, pathToFileURL } from "node:url";
36
37
  import { promisify } from "node:util";
37
38
  import { connect, createServer } from "node:net";
39
+ import { gzipSync } from "node:zlib";
38
40
  import { query } from "@anthropic-ai/claude-agent-sdk";
39
41
  import { createOpencodeClient } from "@opencode-ai/sdk/v2";
40
42
  //#region ../../packages/schemas/dist/agent-controller-brand.js
@@ -177,6 +179,22 @@ const daemonRouteCatalogCacheSchema = z$1.discriminatedUnion("v", [
177
179
  });
178
180
  });
179
181
  //#endregion
182
+ //#region ../../packages/schemas/dist/schemas/daemon/windows-process-job.js
183
+ const jobName = z$1.string().regex(/^Local\\OpenMeld-Process-[a-f0-9-]{36}$/u);
184
+ const text = z$1.string().min(1).refine((value) => !value.includes("\0"));
185
+ const windowsProcessJobRequestSchema = z$1.discriminatedUnion("operation", [z$1.strictObject({
186
+ operation: z$1.literal("launch"),
187
+ jobName,
188
+ executable: text,
189
+ commandLine: text.max(32766),
190
+ workingDirectory: text,
191
+ ownerPid: z$1.number().int().positive(),
192
+ ownerStartedAt: z$1.string().regex(/^\d{10,20}$/u)
193
+ }), z$1.strictObject({
194
+ operation: z$1.literal("drain"),
195
+ jobName
196
+ })]);
197
+ //#endregion
180
198
  //#region ../../packages/schemas/dist/schemas/http/daemon-route-observation.js
181
199
  const daemonRouteObservationRouteSchema = z$1.discriminatedUnion("online", [z$1.strictObject({
182
200
  online: z$1.literal(true),
@@ -231,7 +249,7 @@ function resolveOpenMeldAccountContext(input) {
231
249
  };
232
250
  }
233
251
  async function resolveCurrentOpenMeldAccountContext() {
234
- const { getAuthSessionMetadata } = await import("./auth-session-bRzDGlXy.js");
252
+ const { getAuthSessionMetadata } = await import("./auth-session-BWKfXWxl.js");
235
253
  return resolveOpenMeldAccountContext({ session: await getAuthSessionMetadata().catch(() => null) });
236
254
  }
237
255
  function resolveHostKey(baseUrl) {
@@ -1511,7 +1529,7 @@ async function ensureDaemonSystemServiceCommandFiles(input) {
1511
1529
  function buildSystemServiceEnvironment() {
1512
1530
  const env = {};
1513
1531
  const runtimeUser = userInfo().username;
1514
- for (const [key, value] of Object.entries(process$1.env)) {
1532
+ for (const [key, value] of Object.entries(normalizeCommandEnvironment(process$1.env))) {
1515
1533
  if (typeof value !== "string" || value.length === 0 || !isDaemonServiceEnvironmentKey(key)) continue;
1516
1534
  env[key] = sanitizeDaemonServiceEnvironmentValue(value);
1517
1535
  }
@@ -1522,7 +1540,7 @@ function buildSystemServiceEnvironment() {
1522
1540
  return env;
1523
1541
  }
1524
1542
  function isDaemonServiceEnvironmentKey(key) {
1525
- return DAEMON_SERVICE_ENV_KEY_WHITELIST.has(key);
1543
+ return DAEMON_SERVICE_ENV_KEY_WHITELIST.has(key) || process$1.platform === "win32" && WINDOWS_RUNTIME_ENV_KEYS.some((candidate) => candidate === key);
1526
1544
  }
1527
1545
  function sanitizeDaemonServiceEnvironmentValue(value) {
1528
1546
  let sanitized = "";
@@ -1947,6 +1965,460 @@ function createProviderOriginalError(value) {
1947
1965
  return normalized.slice(0, OPENMELD_ORIGINAL_ERROR_MAX_LENGTH);
1948
1966
  }
1949
1967
  //#endregion
1968
+ //#region ../../runtime/adapters/core/dist/process-launch.js
1969
+ const CMD_META_CHARACTERS = /* @__PURE__ */ new Set("()[]%!^\"`<>&|;, *?");
1970
+ const BATCH_PATH_PATTERN = /\.(?:cmd|bat)$/iu;
1971
+ const NODE_SCRIPT_PATTERN = /\.(?:cjs|mjs|js)$/iu;
1972
+ const INVALID_BATCH_TEXT = /[\r\n\0]/u;
1973
+ const SCRIPT_LINES = /\r?\n/u;
1974
+ const NPM_NODE_SHIM_PREFIX = [
1975
+ "@echo off",
1976
+ "goto start",
1977
+ ":find_dp0",
1978
+ "set dp0=%~dp0",
1979
+ "exit /b",
1980
+ ":start",
1981
+ "setlocal",
1982
+ "call :find_dp0",
1983
+ "if exist \"%dp0%\\node.exe\" (",
1984
+ "set \"_prog=%dp0%\\node.exe\"",
1985
+ ") else (",
1986
+ "set \"_prog=node\"",
1987
+ "set pathext=%pathext:;.js;=;%",
1988
+ ")"
1989
+ ];
1990
+ const NPM_NODE_SHIM_LAUNCH = /^endlocal & goto #_undefined_# 2>nul \|\| title %comspec% & "%_prog%"\s+"%dp0%[\\/]([^"\r\n]+)" %\*$/iu;
1991
+ /** Native argv at the process boundary; callers never interpolate args into a shell. */
1992
+ function resolvePlatformCommand(file, args, source = process.env, platform = process.platform) {
1993
+ if (platform !== "win32") return {
1994
+ bin: file,
1995
+ args: [...args]
1996
+ };
1997
+ const env = normalizeCommandEnvironment(source, platform);
1998
+ const command = resolveWindowsCommandPath(file, env);
1999
+ const nodeScript = NODE_SCRIPT_PATTERN.test(command) ? command : readNpmNodeShimTarget(command);
2000
+ if (nodeScript) return {
2001
+ bin: resolveWindowsNodeExecutable(dirname(command), env),
2002
+ args: [nodeScript, ...args]
2003
+ };
2004
+ if (!BATCH_PATH_PATTERN.test(command)) return {
2005
+ bin: command,
2006
+ args: [...args]
2007
+ };
2008
+ if ([command, ...args].some((value) => INVALID_BATCH_TEXT.test(value))) throw Object.assign(/* @__PURE__ */ new Error("This Windows batch wrapper cannot preserve multiline arguments. Select the native executable or Node script for this command."), { code: "WINDOWS_BATCH_ARGUMENT_UNSUPPORTED" });
2009
+ const escapedArgs = args.map((value) => {
2010
+ return escapeCmdText(escapeCmdText(quoteWindowsProcessArgument(value)));
2011
+ });
2012
+ const statement = [escapeCmdText(win32.normalize(command)), ...escapedArgs].join(" ");
2013
+ if (statement.length > 8e3) throw Object.assign(/* @__PURE__ */ new Error("This Windows batch command is too long. Select its native executable or Node script instead."), { code: "WINDOWS_BATCH_ARGUMENT_UNSUPPORTED" });
2014
+ const root = env.SystemRoot ?? env.WINDIR;
2015
+ if (!(root && win32.isAbsolute(root))) throw new Error("Windows system directory is unavailable.");
2016
+ return {
2017
+ bin: win32.join(root, "System32", "cmd.exe"),
2018
+ args: [
2019
+ "/d",
2020
+ "/v:off",
2021
+ "/s",
2022
+ "/c",
2023
+ `"${statement}"`
2024
+ ],
2025
+ windowsVerbatimArguments: true
2026
+ };
2027
+ }
2028
+ /** Windows CRT argv quoting, also used when CreateProcessW receives native argv. */
2029
+ function quoteWindowsProcessArgument(value) {
2030
+ if (value.includes("\0")) throw new Error("Process arguments must not contain a null byte.");
2031
+ let quoted = "\"";
2032
+ let slashes = 0;
2033
+ for (const char of value) {
2034
+ if (char === "\\") {
2035
+ slashes += 1;
2036
+ continue;
2037
+ }
2038
+ quoted += "\\".repeat(char === "\"" ? slashes * 2 + 1 : slashes) + char;
2039
+ slashes = 0;
2040
+ }
2041
+ return `${quoted}${"\\".repeat(slashes * 2)}"`;
2042
+ }
2043
+ function escapeCmdText(value) {
2044
+ return [...value].map((char) => CMD_META_CHARACTERS.has(char) ? `^${char}` : char).join("");
2045
+ }
2046
+ function isFile(path) {
2047
+ try {
2048
+ return statSync(path).isFile();
2049
+ } catch {
2050
+ return false;
2051
+ }
2052
+ }
2053
+ function resolveWindowsCommandPath(file, source = process.env) {
2054
+ if (file.includes("/") || file.includes("\\") || win32.isAbsolute(file)) return file;
2055
+ const env = normalizeCommandEnvironment(source, "win32");
2056
+ const extensions = (env.PATHEXT ?? ".COM;.EXE;.BAT;.CMD").split(";").filter(Boolean).map((item) => item.toLowerCase());
2057
+ const names = extname(file) ? [file] : [...extensions.map((extension) => `${file}${extension}`), file];
2058
+ for (const directory of (env.PATH ?? "").split(";").filter(Boolean)) for (const name of names) {
2059
+ const candidate = join(directory, name);
2060
+ if (isFile(candidate)) return candidate;
2061
+ }
2062
+ return file;
2063
+ }
2064
+ function resolveWindowsNodeExecutable(directory, env) {
2065
+ const sibling = join(directory, "node.exe");
2066
+ if (isFile(sibling)) return sibling;
2067
+ const onPath = resolveWindowsCommandPath("node.exe", env);
2068
+ if (onPath !== "node.exe" && isFile(onPath)) return onPath;
2069
+ if (!process.versions.electron && basename(process.execPath).toLowerCase() === "node.exe") return process.execPath;
2070
+ throw Object.assign(/* @__PURE__ */ new Error("Node.js is required to run this Windows CLI. Install the supported Node.js release, then try again."), { code: "NODE_RUNTIME_NOT_FOUND" });
2071
+ }
2072
+ function readNpmNodeShimTarget(file) {
2073
+ if (!BATCH_PATH_PATTERN.test(file)) return null;
2074
+ let descriptor;
2075
+ try {
2076
+ descriptor = openSync(file, "r");
2077
+ const buffer = Buffer.alloc(65537);
2078
+ const size = readSync(descriptor, buffer, 0, buffer.length, 0);
2079
+ if (size > 65536) return null;
2080
+ const lines = buffer.subarray(0, size).toString("utf8").split(SCRIPT_LINES).map((line) => line.trim()).filter(Boolean);
2081
+ if (lines.length !== NPM_NODE_SHIM_PREFIX.length + 1 || !NPM_NODE_SHIM_PREFIX.every((line, index) => lines[index]?.toLowerCase() === line)) return null;
2082
+ const target = lines.at(-1)?.match(NPM_NODE_SHIM_LAUNCH)?.[1];
2083
+ if (!(target && NODE_SCRIPT_PATTERN.test(target)) || target.includes("%")) return null;
2084
+ return resolve(dirname(file), target.replaceAll("\\", sep));
2085
+ } catch {
2086
+ return null;
2087
+ } finally {
2088
+ if (descriptor !== void 0) closeSync(descriptor);
2089
+ }
2090
+ }
2091
+ function executePlatformFile(file, args, options, callback) {
2092
+ try {
2093
+ const env = normalizeCommandEnvironment(options.env ?? process.env);
2094
+ const invocation = resolvePlatformCommand(file, args, env);
2095
+ return execFile(invocation.bin, invocation.args, {
2096
+ ...options,
2097
+ encoding: "utf8",
2098
+ env,
2099
+ ...process.platform === "win32" ? {
2100
+ shell: false,
2101
+ windowsHide: true,
2102
+ windowsVerbatimArguments: invocation.windowsVerbatimArguments ?? false
2103
+ } : {}
2104
+ }, callback);
2105
+ } catch (error) {
2106
+ const failure = error instanceof Error ? error : /* @__PURE__ */ new Error("The native command could not be prepared.");
2107
+ queueMicrotask(() => callback(failure, "", ""));
2108
+ return;
2109
+ }
2110
+ }
2111
+ function executePlatformFileAsync(file, args, options = {}) {
2112
+ if (process.platform !== "win32") return promisify(execFile)(file, [...args], {
2113
+ ...options,
2114
+ encoding: "utf8"
2115
+ });
2116
+ return new Promise((resolveResult, reject) => {
2117
+ executePlatformFile(file, args, options, (error, stdout, stderr) => {
2118
+ if (error) reject(Object.assign(error, {
2119
+ stdout,
2120
+ stderr
2121
+ }));
2122
+ else resolveResult({
2123
+ stdout,
2124
+ stderr
2125
+ });
2126
+ });
2127
+ });
2128
+ }
2129
+ const execPlatformFile = Object.assign(executePlatformFile, { [promisify.custom]: executePlatformFileAsync });
2130
+ //#endregion
2131
+ //#region ../../runtime/adapters/core/dist/windows-process-job-native.js
2132
+ const WINDOWS_PROCESS_JOB_NATIVE_SOURCE = `
2133
+ using System;
2134
+ using System.ComponentModel;
2135
+ using System.Diagnostics;
2136
+ using System.Globalization;
2137
+ using System.Runtime.InteropServices;
2138
+ using System.Text;
2139
+ using System.Threading;
2140
+
2141
+ public static class OpenMeldProcessJobV1 {
2142
+ const uint WaitTimeout = 258;
2143
+ const uint WaitFailed = 0xffffffff;
2144
+ const uint KillOnClose = 0x2000;
2145
+ const uint ExtendedStartup = 0x00080000;
2146
+ const uint NoWindow = 0x08000000;
2147
+ const uint UnicodeEnvironment = 0x00000400;
2148
+
2149
+ [StructLayout(LayoutKind.Sequential)] struct BasicLimits {
2150
+ public long ProcessTime, JobTime;
2151
+ public uint Flags;
2152
+ public UIntPtr MinWorkingSet, MaxWorkingSet;
2153
+ public uint ActiveProcessLimit;
2154
+ public UIntPtr Affinity;
2155
+ public uint PriorityClass, SchedulingClass;
2156
+ }
2157
+ [StructLayout(LayoutKind.Sequential)] struct IoCounters {
2158
+ public ulong ReadOperations, WriteOperations, OtherOperations;
2159
+ public ulong ReadBytes, WriteBytes, OtherBytes;
2160
+ }
2161
+ [StructLayout(LayoutKind.Sequential)] struct ExtendedLimits {
2162
+ public BasicLimits Basic;
2163
+ public IoCounters Io;
2164
+ public UIntPtr ProcessMemory, JobMemory, PeakProcessMemory, PeakJobMemory;
2165
+ }
2166
+ [StructLayout(LayoutKind.Sequential)] struct Accounting {
2167
+ public long UserTime, KernelTime, PeriodUserTime, PeriodKernelTime;
2168
+ public uint PageFaults, TotalProcesses, ActiveProcesses, TerminatedProcesses;
2169
+ }
2170
+ [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)] struct StartupInfo {
2171
+ public uint Size;
2172
+ public string Reserved, Desktop, Title;
2173
+ public uint X, Y, XSize, YSize, XCountChars, YCountChars, FillAttribute, Flags;
2174
+ public ushort ShowWindow, ReservedBytes;
2175
+ public IntPtr ReservedPointer, StandardInput, StandardOutput, StandardError;
2176
+ }
2177
+ [StructLayout(LayoutKind.Sequential)] struct StartupInfoEx {
2178
+ public StartupInfo Startup;
2179
+ public IntPtr Attributes;
2180
+ }
2181
+ [StructLayout(LayoutKind.Sequential)] struct ProcessInfo {
2182
+ public IntPtr Process, Thread;
2183
+ public uint ProcessId, ThreadId;
2184
+ }
2185
+
2186
+ [DllImport("kernel32.dll", CharSet=CharSet.Unicode, SetLastError=true)] static extern IntPtr CreateJobObjectW(IntPtr attributes, string name);
2187
+ [DllImport("kernel32.dll", CharSet=CharSet.Unicode, SetLastError=true)] static extern IntPtr OpenJobObjectW(uint access, bool inherit, string name);
2188
+ [DllImport("kernel32.dll", SetLastError=true)] static extern bool SetInformationJobObject(IntPtr job, int kind, ref ExtendedLimits limits, uint size);
2189
+ [DllImport("kernel32.dll", SetLastError=true)] static extern bool QueryInformationJobObject(IntPtr job, int kind, out Accounting info, uint size, IntPtr length);
2190
+ [DllImport("kernel32.dll", SetLastError=true)] static extern bool TerminateJobObject(IntPtr job, uint code);
2191
+ [DllImport("kernel32.dll", SetLastError=true)] static extern bool InitializeProcThreadAttributeList(IntPtr list, int count, uint flags, ref IntPtr size);
2192
+ [DllImport("kernel32.dll", SetLastError=true)] static extern bool UpdateProcThreadAttribute(IntPtr list, uint flags, IntPtr attribute, IntPtr value, IntPtr size, IntPtr previous, IntPtr returnedSize);
2193
+ [DllImport("kernel32.dll")] static extern void DeleteProcThreadAttributeList(IntPtr list);
2194
+ [DllImport("kernel32.dll", CharSet=CharSet.Unicode, SetLastError=true)] static extern bool CreateProcessW(string application, StringBuilder command, IntPtr processAttributes, IntPtr threadAttributes, bool inherit, uint flags, IntPtr environment, string cwd, ref StartupInfoEx startup, out ProcessInfo process);
2195
+ [DllImport("kernel32.dll", SetLastError=true)] static extern bool GetExitCodeProcess(IntPtr process, out uint code);
2196
+ [DllImport("kernel32.dll", SetLastError=true)] static extern IntPtr OpenProcess(uint access, bool inherit, int pid);
2197
+ [DllImport("kernel32.dll", SetLastError=true)] static extern bool GetProcessTimes(IntPtr process, out long created, out long exited, out long kernel, out long user);
2198
+ [DllImport("kernel32.dll", SetLastError=true)] static extern uint WaitForSingleObject(IntPtr handle, uint timeout);
2199
+ [DllImport("kernel32.dll")] static extern IntPtr GetCurrentProcess();
2200
+ [DllImport("kernel32.dll", SetLastError=true)] static extern IntPtr GetStdHandle(int kind);
2201
+ [DllImport("kernel32.dll", SetLastError=true)] static extern bool DuplicateHandle(IntPtr sourceProcess, IntPtr source, IntPtr targetProcess, out IntPtr target, uint access, bool inherit, uint options);
2202
+ [DllImport("kernel32.dll", SetLastError=true)] static extern bool CloseHandle(IntPtr handle);
2203
+
2204
+ static void Check(bool ok, string operation) {
2205
+ if (!ok) throw new Win32Exception(Marshal.GetLastWin32Error(), operation);
2206
+ }
2207
+ static IntPtr DuplicateStandard(int kind) {
2208
+ IntPtr original = GetStdHandle(kind), copied;
2209
+ if (original == IntPtr.Zero || original == new IntPtr(-1)) throw new InvalidOperationException("Standard stream unavailable");
2210
+ Check(DuplicateHandle(GetCurrentProcess(), original, GetCurrentProcess(), out copied, 0, true, 2), "DuplicateHandle");
2211
+ return copied;
2212
+ }
2213
+ static void WaitUntilEmpty(IntPtr job, bool terminate) {
2214
+ if (terminate) Check(TerminateJobObject(job, 1223), "TerminateJobObject");
2215
+ Stopwatch clock = Stopwatch.StartNew();
2216
+ while (true) {
2217
+ Accounting state;
2218
+ Check(QueryInformationJobObject(job, 1, out state, (uint)Marshal.SizeOf(typeof(Accounting)), IntPtr.Zero), "QueryInformationJobObject");
2219
+ if (state.ActiveProcesses == 0) return;
2220
+ if (clock.ElapsedMilliseconds > 10000) throw new TimeoutException("Windows process cleanup was not confirmed");
2221
+ Thread.Sleep(25);
2222
+ }
2223
+ }
2224
+ public static void VerifyDrained(string name) {
2225
+ IntPtr job = OpenJobObjectW(4, false, name);
2226
+ if (job == IntPtr.Zero) {
2227
+ int error = Marshal.GetLastWin32Error();
2228
+ // After the supervisor exits, absence means no owner or associated process
2229
+ // remains. No delayed launcher can subsequently create this Job.
2230
+ if (error == 2) return;
2231
+ throw new Win32Exception(error, "OpenJobObjectW");
2232
+ }
2233
+ try { WaitUntilEmpty(job, false); } finally { CloseHandle(job); }
2234
+ }
2235
+ public static int Run(string name, string executable, string command, string cwd, int ownerPid, string ownerStartedAt) {
2236
+ IntPtr owner = IntPtr.Zero, job = IntPtr.Zero, attributes = IntPtr.Zero;
2237
+ IntPtr jobs = IntPtr.Zero, handles = IntPtr.Zero;
2238
+ IntPtr input = IntPtr.Zero, output = IntPtr.Zero, errorOutput = IntPtr.Zero;
2239
+ ProcessInfo child = new ProcessInfo();
2240
+ bool attributesInitialized = false;
2241
+ try {
2242
+ owner = OpenProcess(0x00101000, false, ownerPid);
2243
+ Check(owner != IntPtr.Zero, "Open owner process");
2244
+ long started, exited, kernel, user;
2245
+ Check(GetProcessTimes(owner, out started, out exited, out kernel, out user), "GetProcessTimes");
2246
+ if (started.ToString(CultureInfo.InvariantCulture) != ownerStartedAt || WaitForSingleObject(owner, 0) != WaitTimeout)
2247
+ throw new InvalidOperationException("The launch owner is no longer alive");
2248
+ job = CreateJobObjectW(IntPtr.Zero, name);
2249
+ int createError = Marshal.GetLastWin32Error();
2250
+ Check(job != IntPtr.Zero, "CreateJobObjectW");
2251
+ if (createError == 183) throw new InvalidOperationException("Job identity collision");
2252
+ ExtendedLimits limits = new ExtendedLimits();
2253
+ limits.Basic.Flags = KillOnClose;
2254
+ Check(SetInformationJobObject(job, 9, ref limits, (uint)Marshal.SizeOf(typeof(ExtendedLimits))), "SetInformationJobObject");
2255
+
2256
+ IntPtr size = IntPtr.Zero;
2257
+ InitializeProcThreadAttributeList(IntPtr.Zero, 2, 0, ref size);
2258
+ if (size == IntPtr.Zero) throw new Win32Exception(Marshal.GetLastWin32Error(), "Attribute list size");
2259
+ attributes = Marshal.AllocHGlobal(size);
2260
+ Check(InitializeProcThreadAttributeList(attributes, 2, 0, ref size), "InitializeProcThreadAttributeList");
2261
+ attributesInitialized = true;
2262
+ jobs = Marshal.AllocHGlobal(IntPtr.Size);
2263
+ Marshal.WriteIntPtr(jobs, job);
2264
+ // PROC_THREAD_ATTRIBUTE_JOB_LIST: no attach-after-spawn race, no breakaway.
2265
+ Check(UpdateProcThreadAttribute(attributes, 0, new IntPtr(0x0002000d), jobs, new IntPtr(IntPtr.Size), IntPtr.Zero, IntPtr.Zero), "Set atomic Job assignment");
2266
+ input = DuplicateStandard(-10); output = DuplicateStandard(-11); errorOutput = DuplicateStandard(-12);
2267
+ handles = Marshal.AllocHGlobal(IntPtr.Size * 3);
2268
+ Marshal.WriteIntPtr(handles, 0, input); Marshal.WriteIntPtr(handles, IntPtr.Size, output); Marshal.WriteIntPtr(handles, IntPtr.Size * 2, errorOutput);
2269
+ Check(UpdateProcThreadAttribute(attributes, 0, new IntPtr(0x00020002), handles, new IntPtr(IntPtr.Size * 3), IntPtr.Zero, IntPtr.Zero), "Set inherited streams");
2270
+ StartupInfoEx startup = new StartupInfoEx();
2271
+ startup.Startup.Size = (uint)Marshal.SizeOf(typeof(StartupInfoEx));
2272
+ startup.Startup.Flags = 0x100;
2273
+ startup.Startup.StandardInput = input; startup.Startup.StandardOutput = output; startup.Startup.StandardError = errorOutput;
2274
+ startup.Attributes = attributes;
2275
+ Check(CreateProcessW(executable, new StringBuilder(command), IntPtr.Zero, IntPtr.Zero, true, ExtendedStartup | NoWindow | UnicodeEnvironment, IntPtr.Zero, cwd, ref startup, out child), "CreateProcessW in Job");
2276
+ CloseHandle(input); input = IntPtr.Zero; CloseHandle(output); output = IntPtr.Zero; CloseHandle(errorOutput); errorOutput = IntPtr.Zero;
2277
+ while (true) {
2278
+ uint wait = WaitForSingleObject(child.Process, 100);
2279
+ if (wait == 0) break;
2280
+ Check(wait != WaitFailed, "Wait for controller");
2281
+ if (WaitForSingleObject(owner, 0) != WaitTimeout) {
2282
+ WaitUntilEmpty(job, true);
2283
+ return 1223;
2284
+ }
2285
+ }
2286
+ uint exitCode;
2287
+ Check(GetExitCodeProcess(child.Process, out exitCode), "GetExitCodeProcess");
2288
+ CloseHandle(child.Thread); child.Thread = IntPtr.Zero;
2289
+ CloseHandle(child.Process); child.Process = IntPtr.Zero;
2290
+ WaitUntilEmpty(job, true);
2291
+ return unchecked((int)exitCode);
2292
+ } finally {
2293
+ if (child.Thread != IntPtr.Zero) CloseHandle(child.Thread);
2294
+ if (child.Process != IntPtr.Zero) CloseHandle(child.Process);
2295
+ if (job != IntPtr.Zero) CloseHandle(job);
2296
+ if (owner != IntPtr.Zero) CloseHandle(owner);
2297
+ if (input != IntPtr.Zero) CloseHandle(input);
2298
+ if (output != IntPtr.Zero) CloseHandle(output);
2299
+ if (errorOutput != IntPtr.Zero) CloseHandle(errorOutput);
2300
+ if (attributesInitialized) DeleteProcThreadAttributeList(attributes);
2301
+ if (attributes != IntPtr.Zero) Marshal.FreeHGlobal(attributes);
2302
+ if (jobs != IntPtr.Zero) Marshal.FreeHGlobal(jobs);
2303
+ if (handles != IntPtr.Zero) Marshal.FreeHGlobal(handles);
2304
+ }
2305
+ }
2306
+ }
2307
+ `;
2308
+ //#endregion
2309
+ //#region ../../runtime/adapters/core/dist/windows-process-job.js
2310
+ const REQUEST_ENV = "OPENMELD_NATIVE_JOB_REQUEST";
2311
+ const DRAIN_RECEIPT = "openmeld-windows-job-drained-v1";
2312
+ const CLEANUP_TIMEOUT_MS = 15e3;
2313
+ const WINDOWS_PROCESS_JOB_SCRIPT = `
2314
+ $ErrorActionPreference = 'Stop'
2315
+ $ProgressPreference = 'SilentlyContinue'
2316
+ $WarningPreference = 'SilentlyContinue'
2317
+ try {
2318
+ $raw = [Environment]::GetEnvironmentVariable('${REQUEST_ENV}', 'Process')
2319
+ [Environment]::SetEnvironmentVariable('${REQUEST_ENV}', $null, 'Process')
2320
+ $r = ConvertFrom-Json ([Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($raw)))
2321
+ $compressed = New-Object IO.MemoryStream(,([Convert]::FromBase64String('${gzipSync(Buffer.from(WINDOWS_PROCESS_JOB_NATIVE_SOURCE, "utf8")).toString("base64")}')))
2322
+ $gzip = New-Object IO.Compression.GZipStream($compressed, [IO.Compression.CompressionMode]::Decompress)
2323
+ $reader = New-Object IO.StreamReader($gzip, [Text.Encoding]::UTF8)
2324
+ try { $source = $reader.ReadToEnd() } finally { $reader.Dispose(); $compressed.Dispose() }
2325
+ Add-Type -TypeDefinition $source -ErrorAction Stop
2326
+ if ($r.operation -eq 'drain') {
2327
+ [OpenMeldProcessJobV1]::VerifyDrained($r.jobName)
2328
+ [Console]::Write('${DRAIN_RECEIPT}')
2329
+ exit 0
2330
+ }
2331
+ if ($r.operation -ne 'launch') { throw 'Unknown process operation' }
2332
+ $exitCode = [OpenMeldProcessJobV1]::Run($r.jobName, $r.executable, $r.commandLine, $r.workingDirectory, $r.ownerPid, $r.ownerStartedAt)
2333
+ exit $exitCode
2334
+ } catch {
2335
+ $cause = $_.Exception.GetBaseException()
2336
+ $code = $(if ($cause -is [ComponentModel.Win32Exception]) { $cause.NativeErrorCode } else { $cause.GetType().Name })
2337
+ [Console]::Error.WriteLine('openmeld.windows_process.failed: ' + $code)
2338
+ exit 125
2339
+ }
2340
+ `;
2341
+ function spawnWindowsJobProcess(input) {
2342
+ const env = normalizeCommandEnvironment(input.env, "win32");
2343
+ const executable = resolveWindowsCommandPath(input.invocation.bin, env);
2344
+ if (!(win32.isAbsolute(executable) && win32.isAbsolute(input.cwd))) throw Object.assign(/* @__PURE__ */ new Error("The selected Windows controller needs an absolute executable and working directory."), { code: "ENOENT" });
2345
+ const ownerStartedAt = readWindowsProcessStartFileTime(process.pid);
2346
+ if (!ownerStartedAt) throw new Error("Windows could not verify the process that owns this invocation.");
2347
+ const jobName = `Local\\OpenMeld-Process-${randomUUID()}`;
2348
+ const commandLine = [quoteWindowsProcessArgument(executable), ...input.invocation.args.map((arg) => input.invocation.windowsVerbatimArguments ? arg : quoteWindowsProcessArgument(arg))].join(" ");
2349
+ const request = windowsProcessJobRequestSchema.parse({
2350
+ operation: "launch",
2351
+ jobName,
2352
+ executable,
2353
+ commandLine,
2354
+ workingDirectory: input.cwd,
2355
+ ownerPid: process.pid,
2356
+ ownerStartedAt
2357
+ });
2358
+ const payload = Buffer.from(JSON.stringify(request), "utf8").toString("base64");
2359
+ if (payload.length > 32e3) throw new Error("The Windows controller arguments exceed the native launch envelope. Send large input through stdin instead.");
2360
+ const powershell = resolveWindowsPowerShellPath(env);
2361
+ const child = spawn(powershell, powerShellEncodedArguments(WINDOWS_PROCESS_JOB_SCRIPT), {
2362
+ cwd: input.cwd,
2363
+ env: {
2364
+ ...env,
2365
+ [REQUEST_ENV]: payload
2366
+ },
2367
+ stdio: [
2368
+ "pipe",
2369
+ "pipe",
2370
+ "pipe"
2371
+ ],
2372
+ windowsHide: true
2373
+ });
2374
+ const closed = new Promise((resolve) => child.once("close", () => resolve()));
2375
+ const terminate = (signal) => {
2376
+ if (child.exitCode !== null || child.signalCode !== null || child.pid === void 0) return false;
2377
+ return child.kill(signal);
2378
+ };
2379
+ return {
2380
+ child,
2381
+ terminate,
2382
+ async cleanup() {
2383
+ let timer;
2384
+ let signalSent = false;
2385
+ try {
2386
+ signalSent = terminate("SIGKILL");
2387
+ await Promise.race([closed, new Promise((_resolve, reject) => {
2388
+ timer = setTimeout(() => reject(/* @__PURE__ */ new Error("Windows supervisor exit could not be confirmed.")), CLEANUP_TIMEOUT_MS);
2389
+ })]);
2390
+ const drain = windowsProcessJobRequestSchema.parse({
2391
+ operation: "drain",
2392
+ jobName
2393
+ });
2394
+ const { stdout } = await promisify(execFile)(powershell, powerShellEncodedArguments(WINDOWS_PROCESS_JOB_SCRIPT), {
2395
+ env: {
2396
+ ...env,
2397
+ [REQUEST_ENV]: Buffer.from(JSON.stringify(drain), "utf8").toString("base64")
2398
+ },
2399
+ encoding: "utf8",
2400
+ windowsHide: true,
2401
+ timeout: CLEANUP_TIMEOUT_MS,
2402
+ maxBuffer: 4096
2403
+ });
2404
+ if (stdout !== DRAIN_RECEIPT) throw new Error("Windows returned an invalid process cleanup receipt.");
2405
+ return {
2406
+ ok: true,
2407
+ signalSent
2408
+ };
2409
+ } catch (error) {
2410
+ return {
2411
+ ok: false,
2412
+ signalSent,
2413
+ error
2414
+ };
2415
+ } finally {
2416
+ if (timer) clearTimeout(timer);
2417
+ }
2418
+ }
2419
+ };
2420
+ }
2421
+ //#endregion
1950
2422
  //#region ../../runtime/adapters/core/dist/agent-controller-process.js
1951
2423
  const PROCESS_TABLE_COLUMN_SEPARATOR = /\s+/u;
1952
2424
  const PROCESS_TABLE_LINE_SEPARATOR = /\r?\n/u;
@@ -2048,14 +2520,36 @@ const processDiscoveryDiagnostics = createAgentControllerProcessDiscoveryDiagnos
2048
2520
  function spawnAgentControllerProcess(input) {
2049
2521
  const signalTarget = resolveAgentControllerProcessSignalTarget();
2050
2522
  const supervisionId = input.supervisionId ?? randomUUID();
2051
- const child = spawn(input.bin, input.args, {
2523
+ const env = {
2524
+ ...normalizeCommandEnvironment(input.env),
2525
+ [PROCESS_SUPERVISION_ENV_KEY]: supervisionId
2526
+ };
2527
+ const invocation = resolvePlatformCommand(input.bin, input.args, env);
2528
+ if (process.platform === "win32") {
2529
+ const job = spawnWindowsJobProcess({
2530
+ invocation,
2531
+ env,
2532
+ cwd: input.cwd
2533
+ });
2534
+ return {
2535
+ child: job.child,
2536
+ processId: job.child.pid ?? null,
2537
+ signalTarget,
2538
+ supervisionId,
2539
+ terminate: job.terminate,
2540
+ terminateRemainingDescendants: job.cleanup
2541
+ };
2542
+ }
2543
+ const child = spawn(invocation.bin, invocation.args, {
2052
2544
  cwd: input.cwd,
2053
2545
  detached: signalTarget === "process_group",
2054
2546
  env: {
2055
- ...input.env,
2547
+ ...env,
2056
2548
  [PROCESS_SUPERVISION_ENV_KEY]: supervisionId
2057
2549
  },
2058
2550
  shell: input.shell,
2551
+ windowsVerbatimArguments: invocation.windowsVerbatimArguments,
2552
+ windowsHide: true,
2059
2553
  stdio: [
2060
2554
  "pipe",
2061
2555
  "pipe",
@@ -4095,6 +4589,7 @@ const USER_FACING_CLI_COMMAND_ENV = "OPENMELD_USER_FACING_CLI_COMMAND";
4095
4589
  const SPACE_ACTION_TOOL_COMMAND_PATH_ENV = "OPENMELD_SPACE_ACTION_TOOL_COMMAND_PATH";
4096
4590
  const OPENMELD_SPACE_ACTION_MCP_SERVER_ID = "openmeld_internal_dispatch_space_action";
4097
4591
  const OPENMELD_SPACE_ACTION_MCP_TOOL_NAMES = [
4592
+ "working_copy",
4098
4593
  "read_file",
4099
4594
  "read_history",
4100
4595
  "list_tasks",
@@ -6020,6 +6515,67 @@ function normalizeOptionalText$40(value) {
6020
6515
  return normalized.length > 0 ? normalized : null;
6021
6516
  }
6022
6517
  //#endregion
6518
+ //#region ../../runtime/adapters/claude-code/dist/transport/claude-windows-process.js
6519
+ /** Use the SDK's public spawn contract; its forwarded abort follows stdin-EOF grace. */
6520
+ function createClaudeWindowsProcessLauncher(command) {
6521
+ const active = /* @__PURE__ */ new Map();
6522
+ return {
6523
+ spawn(options, onStderr) {
6524
+ if (options.command !== command.bin) throw new Error("Claude SDK changed the selected controller executable.");
6525
+ if (options.signal.aborted) throw new DOMException("Claude invocation was cancelled before launch.", "AbortError");
6526
+ const runtime = spawnAgentControllerProcess({
6527
+ bin: command.bin,
6528
+ args: [...command.argsPrefix, ...options.args],
6529
+ cwd: options.cwd ?? process.cwd(),
6530
+ env: options.env,
6531
+ shell: false
6532
+ });
6533
+ const { child } = runtime;
6534
+ let killed = false;
6535
+ const kill = (signal) => {
6536
+ const sent = runtime.terminate(signal);
6537
+ killed ||= sent;
6538
+ return sent;
6539
+ };
6540
+ const abort = () => kill("SIGKILL");
6541
+ const closed = new Promise((resolve) => {
6542
+ child.once("close", () => {
6543
+ options.signal.removeEventListener("abort", abort);
6544
+ resolve();
6545
+ });
6546
+ });
6547
+ active.set(runtime, closed);
6548
+ child.stderr.setEncoding("utf8");
6549
+ child.stderr.on("data", onStderr);
6550
+ options.signal.addEventListener("abort", abort, { once: true });
6551
+ if (options.signal.aborted) abort();
6552
+ return {
6553
+ stdin: child.stdin,
6554
+ stdout: child.stdout,
6555
+ get killed() {
6556
+ return killed;
6557
+ },
6558
+ get exitCode() {
6559
+ return child.exitCode;
6560
+ },
6561
+ kill,
6562
+ on: child.on.bind(child),
6563
+ once: child.once.bind(child),
6564
+ off: child.off.bind(child)
6565
+ };
6566
+ },
6567
+ async cleanup() {
6568
+ await Promise.all([...active].map(async ([runtime, closed]) => {
6569
+ runtime.terminate("SIGKILL");
6570
+ const result = await runtime.terminateRemainingDescendants();
6571
+ if (!result.ok) throw result.error;
6572
+ await closed;
6573
+ active.delete(runtime);
6574
+ }));
6575
+ }
6576
+ };
6577
+ }
6578
+ //#endregion
6023
6579
  //#region ../../runtime/adapters/claude-code/dist/transport/claude-agent-sdk-transport.js
6024
6580
  var ClaudeAgentSdkTransportError = class extends Error {
6025
6581
  code;
@@ -6114,6 +6670,7 @@ async function invokeClaudeAgentSdkTransport(input) {
6114
6670
  stderrChunks.push(chunk);
6115
6671
  },
6116
6672
  pathToClaudeCodeExecutable: resources.executable.pathToClaudeCodeExecutable,
6673
+ spawnProcess: resources.executable.spawnProcess,
6117
6674
  planDirectory: resources.planCapture.directory,
6118
6675
  sessionId: normalizeOptionalText$39(input.sessionId),
6119
6676
  streamingMode: input.streamingMode
@@ -6335,20 +6892,30 @@ async function createClaudePlanCapture(enabled) {
6335
6892
  }
6336
6893
  async function resolveClaudeAgentSdkExecutable(input) {
6337
6894
  const launchCommand = materializeCliLaunchCommand({ launchContract: input.launchContract });
6895
+ if (process.platform === "win32") {
6896
+ const invocation = resolvePlatformCommand(launchCommand.bin, launchCommand.argsPrefix);
6897
+ const selected = invocation.windowsVerbatimArguments ? launchCommand : {
6898
+ bin: invocation.bin,
6899
+ argsPrefix: invocation.args
6900
+ };
6901
+ const launcher = createClaudeWindowsProcessLauncher(selected);
6902
+ return {
6903
+ cleanup: launcher.cleanup,
6904
+ pathToClaudeCodeExecutable: selected.bin,
6905
+ spawnProcess: launcher.spawn
6906
+ };
6907
+ }
6338
6908
  if (launchCommand.argsPrefix.length === 0 && launchCommand.shell !== true) return {
6339
6909
  cleanup: async () => void 0,
6340
6910
  pathToClaudeCodeExecutable: launchCommand.bin
6341
6911
  };
6342
6912
  const wrapperDir = await mkdtemp(join(tmpdir(), "openmeld-claude-sdk-"));
6343
- const wrapperPath = process.platform === "win32" ? join(wrapperDir, "claude-code-wrapper.cmd") : join(wrapperDir, "claude-code-wrapper");
6344
- await writeFile(wrapperPath, process.platform === "win32" ? buildWindowsWrapperScript({
6345
- argsPrefix: launchCommand.argsPrefix,
6346
- bin: launchCommand.bin
6347
- }) : buildPosixWrapperScript({
6913
+ const wrapperPath = join(wrapperDir, "claude-code-wrapper");
6914
+ await writeFile(wrapperPath, buildPosixWrapperScript({
6348
6915
  argsPrefix: launchCommand.argsPrefix,
6349
6916
  bin: launchCommand.bin
6350
6917
  }), "utf8");
6351
- if (process.platform !== "win32") await chmod(wrapperPath, 493);
6918
+ await chmod(wrapperPath, 493);
6352
6919
  return {
6353
6920
  cleanup: async () => {
6354
6921
  await rm(wrapperDir, {
@@ -6360,6 +6927,7 @@ async function resolveClaudeAgentSdkExecutable(input) {
6360
6927
  };
6361
6928
  }
6362
6929
  function buildClaudeAgentSdkOptions(input) {
6930
+ const spawnProcess = input.spawnProcess;
6363
6931
  const spaceActionMcpServer = resolveDispatchSpaceActionMcpServer(input.env);
6364
6932
  if (input.executionContext && input.executionContext.access !== "space_context") throw new Error("execution_context.file_access_unsupported");
6365
6933
  const permissionMode = resolveClaudePermissionMode({
@@ -6378,6 +6946,7 @@ function buildClaudeAgentSdkOptions(input) {
6378
6946
  },
6379
6947
  includePartialMessages: input.onRuntimeEvent !== void 0 || input.streamingMode === "stream" || input.onInteractionRequest !== void 0,
6380
6948
  pathToClaudeCodeExecutable: input.pathToClaudeCodeExecutable,
6949
+ ...spawnProcess ? { spawnClaudeCodeProcess: (options) => spawnProcess(options, input.onStderr) } : {},
6381
6950
  ...spaceActionMcpServer ? { mcpServers: { [spaceActionMcpServer.id]: {
6382
6951
  args: [...spaceActionMcpServer.args],
6383
6952
  command: spaceActionMcpServer.commandPath,
@@ -6593,23 +7162,9 @@ function buildPosixWrapperScript(input) {
6593
7162
  ""
6594
7163
  ].join("\n");
6595
7164
  }
6596
- function buildWindowsWrapperScript(input) {
6597
- return [
6598
- "@echo off",
6599
- [
6600
- quoteWindowsArg(input.bin),
6601
- ...input.argsPrefix.map(quoteWindowsArg),
6602
- "%*"
6603
- ].join(" "),
6604
- ""
6605
- ].join("\r\n");
6606
- }
6607
7165
  function shellQuote(value) {
6608
7166
  return `'${value.replaceAll("'", "'\\''")}'`;
6609
7167
  }
6610
- function quoteWindowsArg(value) {
6611
- return `"${value.replaceAll("\"", "\"\"")}"`;
6612
- }
6613
7168
  function normalizeOptionalText$39(value) {
6614
7169
  const normalized = String(value ?? "").trim();
6615
7170
  return normalized.length > 0 ? normalized : null;
@@ -7125,6 +7680,7 @@ const CONTROL_REQUEST_TIMEOUT_MS_BY_OPERATION = {
7125
7680
  "collaborationMode/list": FAST_METADATA_ADMISSION_TIMEOUT_MS,
7126
7681
  "thread/fork": COLD_CONTROLLER_ADMISSION_TIMEOUT_MS,
7127
7682
  "thread/name/set": FAST_METADATA_ADMISSION_TIMEOUT_MS,
7683
+ "thread/read": FAST_METADATA_ADMISSION_TIMEOUT_MS,
7128
7684
  "thread/resume": COLD_CONTROLLER_ADMISSION_TIMEOUT_MS,
7129
7685
  "thread/start": COLD_CONTROLLER_ADMISSION_TIMEOUT_MS,
7130
7686
  "turn/start": COLD_CONTROLLER_ADMISSION_TIMEOUT_MS
@@ -7325,7 +7881,8 @@ function isCodexExecutionContextFileAccessConfirmed(value, boundary, workingDire
7325
7881
  return sandbox?.type === "workspaceWrite" && sandbox.excludeTmpdirEnvVar === true && sandbox.excludeSlashTmp === true && Array.isArray(sandbox.writableRoots) && sandbox.writableRoots.every((root) => typeof root === "string" && boundary.folders.includes(root));
7326
7882
  }
7327
7883
  function resolveCodexExecutionContextAccess(boundary, executionMode) {
7328
- return executionMode === "repair" && boundary.executionContextAccess === "workspace" ? "read_only" : boundary.executionContextAccess;
7884
+ const access = boundary.executionContextAccess === "space_context" && boundary.workingCopyId ? "workspace" : boundary.executionContextAccess;
7885
+ return executionMode === "repair" && access === "workspace" ? "read_only" : access;
7329
7886
  }
7330
7887
  function recordValue(value) {
7331
7888
  return typeof value === "object" && value !== null && !Array.isArray(value) ? value : null;
@@ -7406,7 +7963,7 @@ function tomlString(value) {
7406
7963
  }
7407
7964
  //#endregion
7408
7965
  //#region ../../runtime/adapters/codex/dist/transport/codex-scoped-mcp.js
7409
- const execFileAsync$2 = promisify(execFile);
7966
+ const execFileAsync$2 = promisify(execPlatformFile);
7410
7967
  const MCP_INVENTORY_TIMEOUT_MS = 15e3;
7411
7968
  const MCP_INVENTORY_MAX_BYTES = 1024 * 1024;
7412
7969
  const MCP_AUTH_STATUSES = /* @__PURE__ */ new Set([
@@ -7545,7 +8102,7 @@ printf '%s:%s:%s:%s' "$outside_read" "$outside_write" "$inside_read" "$inside_wr
7545
8102
  async function verifyCodexWorkspaceAccess(input) {
7546
8103
  if (!input.boundary.executionContextAccess) return;
7547
8104
  const boundaryRoot = input.boundary.folders[0];
7548
- if (process.platform === "win32" || input.boundary.folders.length !== 1 || !boundaryRoot) throw new Error("execution_context.workspace_probe_unsupported");
8105
+ if (input.boundary.folders.length !== 1 || !boundaryRoot) throw new Error("execution_context.workspace_probe_unsupported");
7549
8106
  const outsideDirectory = await mkdtemp(join(dirname(boundaryRoot), ".openmeld-access-probe-"));
7550
8107
  const outsidePath = join(outsideDirectory, "sentinel");
7551
8108
  const insidePath = join(input.workingDirectory, `.openmeld-access-probe-${randomUUID()}`);
@@ -7559,14 +8116,7 @@ async function verifyCodexWorkspaceAccess(input) {
7559
8116
  mode: 384
7560
8117
  });
7561
8118
  const result = await input.execute({
7562
- command: [
7563
- "/bin/sh",
7564
- "-c",
7565
- PROBE_SCRIPT,
7566
- "openmeld-probe",
7567
- outsidePath,
7568
- insidePath
7569
- ],
8119
+ command: buildCodexWorkspaceProbeCommand(outsidePath, insidePath),
7570
8120
  cwd: input.workingDirectory,
7571
8121
  permissionProfile: CODEX_FILE_ACCESS_PERMISSION_PROFILE,
7572
8122
  timeoutMs: 5e3,
@@ -7582,6 +8132,27 @@ async function verifyCodexWorkspaceAccess(input) {
7582
8132
  });
7583
8133
  }
7584
8134
  }
8135
+ function buildCodexWorkspaceProbeCommand(outsidePath, insidePath, platform = process.platform, env = process.env) {
8136
+ if (platform !== "win32") return [
8137
+ "/bin/sh",
8138
+ "-c",
8139
+ PROBE_SCRIPT,
8140
+ "openmeld-probe",
8141
+ outsidePath,
8142
+ insidePath
8143
+ ];
8144
+ const script = `
8145
+ $ErrorActionPreference = 'Stop'
8146
+ $paths = ConvertFrom-Json ([Text.Encoding]::UTF8.GetString([Convert]::FromBase64String('${Buffer.from(JSON.stringify([outsidePath, insidePath]), "utf8").toString("base64")}')))
8147
+ $results = @()
8148
+ foreach ($path in $paths) {
8149
+ try { $null = [IO.File]::ReadAllText($path); $results += 'allowed' } catch { $results += 'denied' }
8150
+ try { [IO.File]::WriteAllText($path, ('changed' + [char]10)); $results += 'allowed' } catch { $results += 'denied' }
8151
+ }
8152
+ [Console]::Write(($results -join ':'))
8153
+ `;
8154
+ return [resolveWindowsPowerShellPath(env), ...powerShellEncodedArguments(script)];
8155
+ }
7585
8156
  //#endregion
7586
8157
  //#region ../../runtime/adapters/codex/dist/transport/codex-app-server-transport.js
7587
8158
  const CODEX_APP_SERVER_VERSION_PATTERN = /\/([^\s]+)/u;
@@ -7697,52 +8268,22 @@ async function invokeCodexAppServerTransport(input) {
7697
8268
  session.emitProviderConversationObserved(continuityThreadId);
7698
8269
  session.observeReasoningForThread(executionThreadId);
7699
8270
  throwIfCodexDispatchCancelled(input.cancellationSignal);
7700
- const turn = readTurnStartResponse(await session.requestControl("turn/start", {
7701
- ...permissionModeParams.turn,
7702
- ...collaborationMode ? { collaborationMode } : {},
7703
- cwd: input.codexWorkdir,
7704
- ...conversationPolicyParams,
7705
- ...reasoningSummary,
7706
- input: [{
7707
- text: turnPrompt,
7708
- text_elements: [],
7709
- type: "text"
7710
- }],
7711
- threadId: executionThreadId
7712
- }, {
7713
- code: "runtime.turn_start_timeout",
7714
- operation: "turn/start"
7715
- }));
7716
- const turnId = readRequiredText(turn.id, "turn/start response turn.id");
7717
- session.emitProviderTurnAccepted({
7718
- threadId: executionThreadId,
7719
- turnId
7720
- });
7721
- session.setNewSessionTitleInBackground({
7722
- existingThreadId: input.threadId,
8271
+ const completedTurn = await startAndAwaitAppServerTurn({
8272
+ cancellationSignal: input.cancellationSignal,
8273
+ collaborationMode,
8274
+ conversationPolicyParams,
8275
+ codexWorkdir: input.codexWorkdir,
7723
8276
  executionMode: input.executionMode,
7724
- threadId: executionThreadId,
7725
- title: input.newSessionTitle
7726
- });
7727
- const unregisterActiveTurn = session.registerActiveTurn({
8277
+ executionThreadId,
8278
+ existingThreadId: input.threadId,
8279
+ newSessionTitle: input.newSessionTitle,
7728
8280
  onActiveTurn: input.onActiveTurn,
8281
+ permissionModeParams: permissionModeParams.turn,
8282
+ reasoningSummary,
8283
+ session,
7729
8284
  taskId: input.taskId,
7730
- threadId: executionThreadId,
7731
- turnId
7732
- });
7733
- if (input.cancellationSignal?.aborted && turn.status !== "completed") await session.request("turn/interrupt", {
7734
- threadId: executionThreadId,
7735
- turnId
8285
+ turnPrompt
7736
8286
  });
7737
- let completedTurn;
7738
- try {
7739
- completedTurn = turn.status === "completed" ? turn : await session.waitForTurnCompleted({
7740
- threadId: executionThreadId,
7741
- turnId
7742
- });
7743
- } finally {
7744
- unregisterActiveTurn?.();
7745
- }
7746
8287
  const interactionFailure = session.readInteractionFailure();
7747
8288
  if (interactionFailure) throw new CodexAppServerTransportError({
7748
8289
  code: interactionFailure.code,
@@ -7769,6 +8310,69 @@ async function invokeCodexAppServerTransport(input) {
7769
8310
  };
7770
8311
  });
7771
8312
  }
8313
+ async function startAndAwaitAppServerTurn(input) {
8314
+ const { session, executionThreadId } = input;
8315
+ let activeTurnId = null;
8316
+ let interruptRequested = false;
8317
+ let interruptSent = false;
8318
+ const sendInterruptIfActive = async (targetTurnId) => {
8319
+ if (interruptSent) return;
8320
+ interruptSent = true;
8321
+ try {
8322
+ await session.request("turn/interrupt", {
8323
+ threadId: executionThreadId,
8324
+ turnId: targetTurnId
8325
+ });
8326
+ } catch {}
8327
+ };
8328
+ const unregisterActiveTurn = session.registerActiveTurn({
8329
+ interrupt: async () => {
8330
+ interruptRequested = true;
8331
+ if (activeTurnId) await sendInterruptIfActive(activeTurnId);
8332
+ },
8333
+ onActiveTurn: input.onActiveTurn,
8334
+ taskId: input.taskId,
8335
+ threadId: executionThreadId,
8336
+ turnId: null
8337
+ });
8338
+ try {
8339
+ const turn = readTurnStartResponse(await session.requestControl("turn/start", {
8340
+ ...input.permissionModeParams,
8341
+ ...input.collaborationMode ? { collaborationMode: input.collaborationMode } : {},
8342
+ cwd: input.codexWorkdir,
8343
+ ...input.conversationPolicyParams,
8344
+ ...input.reasoningSummary,
8345
+ input: [{
8346
+ text: input.turnPrompt,
8347
+ text_elements: [],
8348
+ type: "text"
8349
+ }],
8350
+ threadId: executionThreadId
8351
+ }, {
8352
+ code: "runtime.turn_start_timeout",
8353
+ operation: "turn/start"
8354
+ }));
8355
+ const turnId = readRequiredText(turn.id, "turn/start response turn.id");
8356
+ activeTurnId = turnId;
8357
+ session.emitProviderTurnAccepted({
8358
+ threadId: executionThreadId,
8359
+ turnId
8360
+ });
8361
+ session.setNewSessionTitleInBackground({
8362
+ existingThreadId: input.existingThreadId ?? null,
8363
+ executionMode: input.executionMode,
8364
+ threadId: executionThreadId,
8365
+ title: input.newSessionTitle ?? void 0
8366
+ });
8367
+ if ((interruptRequested || input.cancellationSignal?.aborted) && turn.status !== "completed") await sendInterruptIfActive(turnId);
8368
+ return turn.status === "completed" ? turn : await session.waitForTurnCompleted({
8369
+ threadId: executionThreadId,
8370
+ turnId
8371
+ });
8372
+ } finally {
8373
+ unregisterActiveTurn?.();
8374
+ }
8375
+ }
7772
8376
  function requireSuccessfulCodexTurn(turn) {
7773
8377
  if (turn.status !== "failed") return;
7774
8378
  const failureMessage = readTurnFailureMessage(turn);
@@ -7824,6 +8428,38 @@ async function verifyCodexAppServerThread(input) {
7824
8428
  })) };
7825
8429
  });
7826
8430
  }
8431
+ async function resolveCodexAppServerCompletedTurn(input) {
8432
+ const threadId = normalizeOptionalText$35(input.threadId);
8433
+ if (!threadId) throw new CodexAppServerTransportError({
8434
+ code: "schema.invalid",
8435
+ errorType: "config",
8436
+ message: "schema.invalid: threadId is required"
8437
+ });
8438
+ return await withCodexAppServerSession({
8439
+ codexTimeoutMs: input.codexTimeoutMs,
8440
+ codexWorkdir: input.codexWorkdir,
8441
+ env: input.env,
8442
+ launchContract: input.launchContract,
8443
+ onRuntimeEvent: input.onRuntimeEvent
8444
+ }, async (session) => {
8445
+ const completedTurnId = readLastCompletedTurnId(await session.requestControl("thread/read", {
8446
+ includeTurns: true,
8447
+ threadId
8448
+ }, {
8449
+ code: "execution_context.history_unavailable",
8450
+ operation: "thread/read"
8451
+ }));
8452
+ if (!completedTurnId) throw new CodexAppServerTransportError({
8453
+ code: "execution_context.fork_checkpoint_unavailable",
8454
+ errorType: "config",
8455
+ message: "execution_context.fork_checkpoint_unavailable: thread/read found no completed turn on the source thread"
8456
+ });
8457
+ return {
8458
+ completedTurnId,
8459
+ threadId
8460
+ };
8461
+ });
8462
+ }
7827
8463
  async function forkCodexAppServerThread(input) {
7828
8464
  const sourceThreadId = normalizeOptionalText$35(input.sourceThreadId);
7829
8465
  if (!sourceThreadId) throw new CodexAppServerTransportError({
@@ -7831,10 +8467,17 @@ async function forkCodexAppServerThread(input) {
7831
8467
  errorType: "config",
7832
8468
  message: "schema.invalid: sourceThreadId is required"
7833
8469
  });
7834
- if (input.computerFileAccessBoundary?.executionContextAccess && !normalizeOptionalText$35(input.sourceCompletedTurnId)) throw new CodexAppServerTransportError({
8470
+ const sourceCompletedTurnId = normalizeOptionalText$35(input.sourceCompletedTurnId);
8471
+ const executionContextScoped = input.computerFileAccessBoundary?.executionContextAccess !== void 0;
8472
+ if (sourceCompletedTurnId && input.forkFullHistory) throw new CodexAppServerTransportError({
8473
+ code: "schema.invalid",
8474
+ errorType: "config",
8475
+ message: "schema.invalid: a fork takes either sourceCompletedTurnId or forkFullHistory, not both"
8476
+ });
8477
+ if (!(sourceCompletedTurnId || input.forkFullHistory)) throw new CodexAppServerTransportError({
7835
8478
  code: "execution_context.fork_checkpoint_unavailable",
7836
8479
  errorType: "config",
7837
- message: "execution_context.fork_checkpoint_unavailable: a completed turn is required for a scoped fork"
8480
+ message: executionContextScoped ? "execution_context.fork_checkpoint_unavailable: a completed turn is required for a scoped fork" : "execution_context.fork_checkpoint_unavailable: a completed turn is required, or forkFullHistory must be set to fork the source's entire history"
7838
8481
  });
7839
8482
  return await withCodexAppServerSession({
7840
8483
  codexTimeoutMs: input.codexTimeoutMs,
@@ -7852,7 +8495,7 @@ async function forkCodexAppServerThread(input) {
7852
8495
  approvalPolicy: "never",
7853
8496
  runtimeWorkspaceRoots: [input.targetWorkingDirectory ?? input.codexWorkdir]
7854
8497
  } : {},
7855
- ...input.sourceCompletedTurnId ? { lastTurnId: input.sourceCompletedTurnId } : {},
8498
+ ...sourceCompletedTurnId ? { lastTurnId: sourceCompletedTurnId } : {},
7856
8499
  ...input.targetWorkingDirectory ? { cwd: input.targetWorkingDirectory } : {}
7857
8500
  }, {
7858
8501
  code: "context.fork_timeout",
@@ -8452,13 +9095,13 @@ var CodexAppServerSession = class {
8452
9095
  return input.onActiveTurn({
8453
9096
  taskId: input.taskId,
8454
9097
  threadId: input.threadId,
8455
- turnId: input.turnId,
8456
- interrupt: async () => {
8457
- await this.request("turn/interrupt", {
9098
+ turnId: input.turnId ?? "",
9099
+ interrupt: input.interrupt ?? (async () => {
9100
+ if (input.turnId) await this.request("turn/interrupt", {
8458
9101
  threadId: input.threadId,
8459
9102
  turnId: input.turnId
8460
9103
  });
8461
- }
9104
+ })
8462
9105
  });
8463
9106
  }
8464
9107
  buildTelemetry(input) {
@@ -8729,6 +9372,17 @@ function readThreadContextFromResponse(value) {
8729
9372
  threadSource: normalizeOptionalText$35(response?.thread?.threadSource)
8730
9373
  };
8731
9374
  }
9375
+ function readLastCompletedTurnId(value) {
9376
+ const response = toRecord$8(value);
9377
+ const turns = Array.isArray(response?.thread?.turns) ? response.thread.turns : [];
9378
+ for (let index = turns.length - 1; index >= 0; index -= 1) {
9379
+ const turn = turns[index];
9380
+ if (normalizeOptionalText$35(turn?.status) !== "completed") continue;
9381
+ const turnId = normalizeOptionalText$35(turn?.id);
9382
+ if (turnId) return turnId;
9383
+ }
9384
+ return null;
9385
+ }
8732
9386
  function readTurnStartResponse(value) {
8733
9387
  const turn = toRecord$8(value)?.turn;
8734
9388
  if (!turn || typeof turn !== "object") throw new CodexAppServerTransportError({
@@ -10378,12 +11032,25 @@ function toRecord$7(value) {
10378
11032
  //#region ../../runtime/adapters/codex/dist/index.js
10379
11033
  const CODEX_CONVERSATION_BRIDGE_SPEC = resolveBuiltinAdapterConversationBridgeSpec("codex");
10380
11034
  const TEST_DISABLE_DEFAULT_INVOKE = Symbol.for("openmeld.test.disableDefaultInvoke");
11035
+ /**
11036
+ * Reader for {@link CodexDispatchStopEvidence}, keyed off the adapter object the
11037
+ * way {@link TEST_DISABLE_DEFAULT_INVOKE} keys off runtime options.
11038
+ *
11039
+ * {@link RuntimeAdapter} is the adapter's whole surface, and the stop evidence
11040
+ * has to travel out of a `cancel` or `interrupt` call into the Core path that
11041
+ * decides whether a successor may take an occupied reservation. Widening that
11042
+ * shared type for one adapter's control-plane bookkeeping would put a Codex-only
11043
+ * field on every adapter, so the reader rides along as a symbol-keyed property
11044
+ * that only a caller holding this symbol can find.
11045
+ */
11046
+ const READ_CODEX_DISPATCH_STOP_EVIDENCE = Symbol.for("openmeld.codex.readDispatchStopEvidence");
10381
11047
  const COMPUTER_FILE_ACCESS_ATTESTATION_TTL_MS = 300 * 1e3;
10382
11048
  const MAX_COMPUTER_FILE_ACCESS_ATTESTATIONS = 32;
10383
11049
  const createCodexAdapter = (options) => {
10384
11050
  const activeAppServerTurns = /* @__PURE__ */ new Map();
10385
11051
  const computerFileAccessAttestations = /* @__PURE__ */ new Map();
10386
11052
  const occupiedDispatches = /* @__PURE__ */ new Map();
11053
+ const stoppedDispatches = /* @__PURE__ */ new Map();
10387
11054
  const registerAppServerTurn = (registration) => {
10388
11055
  const activeTurn = {
10389
11056
  interrupt: registration.interrupt,
@@ -10415,40 +11082,69 @@ const createCodexAdapter = (options) => {
10415
11082
  });
10416
11083
  const fallbackCancel = controlShell.cancel;
10417
11084
  const cancel = async (request) => {
10418
- if (abortOccupiedCodexDispatch({
11085
+ const occupiedDispatchAborted = abortOccupiedCodexDispatch({
10419
11086
  occupiedDispatches,
10420
11087
  request
10421
- }) && !activeAppServerTurns.has(request.taskId)) return {
10422
- accepted: true,
10423
- deliveryPath: "cancel",
10424
- reasonCode: "accepted",
10425
- signalDelivery: "sent",
10426
- taskId: request.taskId
10427
- };
10428
- if (!fallbackCancel) return {
11088
+ });
11089
+ if (occupiedDispatchAborted && !activeAppServerTurns.has(request.taskId)) {
11090
+ recordStoppedCodexDispatch({
11091
+ request,
11092
+ stoppedDispatches,
11093
+ turnWasRunning: false
11094
+ });
11095
+ return {
11096
+ accepted: true,
11097
+ deliveryPath: "cancel",
11098
+ reasonCode: "accepted",
11099
+ signalDelivery: "sent",
11100
+ taskId: request.taskId
11101
+ };
11102
+ }
11103
+ const turnWasRunning = activeAppServerTurns.has(request.taskId);
11104
+ const result = fallbackCancel ? await fallbackCancel(request) : {
10429
11105
  accepted: false,
10430
11106
  reasonCode: "adapter.unsupported",
10431
11107
  signalDelivery: "not_sent",
10432
11108
  taskId: request.taskId
10433
11109
  };
10434
- return await fallbackCancel(request);
11110
+ if (occupiedDispatchAborted || turnWasRunning) recordStoppedCodexDispatch({
11111
+ request,
11112
+ stoppedDispatches,
11113
+ turnWasRunning
11114
+ });
11115
+ return result;
10435
11116
  };
10436
11117
  const interrupt = async (request) => {
10437
- if (abortOccupiedCodexDispatch({
11118
+ const occupiedDispatchAborted = abortOccupiedCodexDispatch({
10438
11119
  occupiedDispatches,
10439
11120
  request
10440
- }) && !activeAppServerTurns.has(request.taskId)) return {
10441
- accepted: true,
10442
- plan: buildInterruptPlan(request),
10443
- reasonCode: "accepted",
10444
- signalDelivery: "sent",
10445
- taskId: request.taskId
10446
- };
10447
- return await interruptCodexActiveAppServerTurn({
11121
+ });
11122
+ if (occupiedDispatchAborted && !activeAppServerTurns.has(request.taskId)) {
11123
+ recordStoppedCodexDispatch({
11124
+ request,
11125
+ stoppedDispatches,
11126
+ turnWasRunning: false
11127
+ });
11128
+ return {
11129
+ accepted: true,
11130
+ plan: buildInterruptPlan(request),
11131
+ reasonCode: "accepted",
11132
+ signalDelivery: "sent",
11133
+ taskId: request.taskId
11134
+ };
11135
+ }
11136
+ const turnWasRunning = activeAppServerTurns.has(request.taskId);
11137
+ const result = await interruptCodexActiveAppServerTurn({
10448
11138
  activeAppServerTurns,
10449
11139
  request,
10450
11140
  fallbackInterrupt: controlShell.interrupt
10451
11141
  });
11142
+ if (occupiedDispatchAborted || turnWasRunning) recordStoppedCodexDispatch({
11143
+ request,
11144
+ stoppedDispatches,
11145
+ turnWasRunning
11146
+ });
11147
+ return result;
10452
11148
  };
10453
11149
  const sharedDispatch = createSharedDispatchShell({
10454
11150
  adapterId: "codex",
@@ -10466,76 +11162,78 @@ const createCodexAdapter = (options) => {
10466
11162
  occupiedDispatches,
10467
11163
  request,
10468
11164
  sharedDispatch,
11165
+ stoppedDispatches,
10469
11166
  waitForThreadWriterAvailability: options.waitForThreadWriterAvailability ?? waitForCodexThreadWriterAvailability
10470
11167
  });
10471
- return {
10472
- adapterId: "codex",
10473
- cancel,
10474
- dispatch,
10475
- interrupt,
10476
- verifyComputerFileAccessBoundary: async (request) => {
10477
- if (request.agentControllerPermissionMode === "codex:customConfig" || request.transportMode !== "codex-app-server" && request.transportMode !== "local-cli") return {
10478
- reasonCode: "computer.file_access.controller_unsupported",
11168
+ const verifyComputerFileAccessBoundary = async (request) => {
11169
+ if (request.agentControllerPermissionMode === "codex:customConfig" || request.transportMode !== "codex-app-server" && request.transportMode !== "local-cli") return {
11170
+ reasonCode: "computer.file_access.controller_unsupported",
11171
+ supported: false
11172
+ };
11173
+ try {
11174
+ const configuredLaunchContract = resolveConfiguredCodexLaunchContract({
11175
+ codexBin: options.codexBin,
11176
+ inputLaunchContract: request.launchContract,
11177
+ optionLaunchContract: options.launchContract
11178
+ });
11179
+ if (!configuredLaunchContract) return {
11180
+ reasonCode: "computer.file_access.capability_unverified",
11181
+ supported: false
11182
+ };
11183
+ const probeArgs = [...buildCodexFileAccessBoundaryGlobalArgs({
11184
+ boundary: request.boundary,
11185
+ executionMode: request.executionMode,
11186
+ permissionMode: request.agentControllerPermissionMode
11187
+ }), "--version"];
11188
+ const cacheKey = JSON.stringify({
11189
+ launchContract: configuredLaunchContract,
11190
+ probeArgs,
11191
+ workingDirectory: request.workingDirectory
11192
+ });
11193
+ const nowMs = Date.now();
11194
+ const cached = computerFileAccessAttestations.get(cacheKey);
11195
+ if (cached && cached.expiresAtMs > nowMs) return await cached.result;
11196
+ if (cached) computerFileAccessAttestations.delete(cacheKey);
11197
+ const result = resolveCodexDispatchLaunchContract({
11198
+ codexBin: options.codexBin,
11199
+ inputLaunchContract: request.launchContract,
11200
+ optionLaunchContract: options.launchContract
11201
+ }).then((launchContract) => verifyCliLaunchContract({
11202
+ cwd: request.workingDirectory,
11203
+ displayName: "Codex file access boundary",
11204
+ launchContract,
11205
+ probeArgs,
11206
+ timeoutMs: 5e3
11207
+ })).then((verification) => verification.ok ? { supported: true } : {
11208
+ reasonCode: "computer.file_access.capability_unverified",
11209
+ supported: false
11210
+ }).catch(() => ({
11211
+ reasonCode: "computer.file_access.capability_unverified",
11212
+ supported: false
11213
+ }));
11214
+ rememberComputerFileAccessAttestation({
11215
+ attestations: computerFileAccessAttestations,
11216
+ cacheKey,
11217
+ value: {
11218
+ expiresAtMs: nowMs + COMPUTER_FILE_ACCESS_ATTESTATION_TTL_MS,
11219
+ result
11220
+ }
11221
+ });
11222
+ return await result;
11223
+ } catch {
11224
+ return {
11225
+ reasonCode: "computer.file_access.capability_unverified",
10479
11226
  supported: false
10480
11227
  };
10481
- try {
10482
- const configuredLaunchContract = resolveConfiguredCodexLaunchContract({
10483
- codexBin: options.codexBin,
10484
- inputLaunchContract: request.launchContract,
10485
- optionLaunchContract: options.launchContract
10486
- });
10487
- if (!configuredLaunchContract) return {
10488
- reasonCode: "computer.file_access.capability_unverified",
10489
- supported: false
10490
- };
10491
- const probeArgs = [...buildCodexFileAccessBoundaryGlobalArgs({
10492
- boundary: request.boundary,
10493
- executionMode: request.executionMode,
10494
- permissionMode: request.agentControllerPermissionMode
10495
- }), "--version"];
10496
- const cacheKey = JSON.stringify({
10497
- launchContract: configuredLaunchContract,
10498
- probeArgs,
10499
- workingDirectory: request.workingDirectory
10500
- });
10501
- const nowMs = Date.now();
10502
- const cached = computerFileAccessAttestations.get(cacheKey);
10503
- if (cached && cached.expiresAtMs > nowMs) return await cached.result;
10504
- if (cached) computerFileAccessAttestations.delete(cacheKey);
10505
- const result = resolveCodexDispatchLaunchContract({
10506
- codexBin: options.codexBin,
10507
- inputLaunchContract: request.launchContract,
10508
- optionLaunchContract: options.launchContract
10509
- }).then((launchContract) => verifyCliLaunchContract({
10510
- cwd: request.workingDirectory,
10511
- displayName: "Codex file access boundary",
10512
- launchContract,
10513
- probeArgs,
10514
- timeoutMs: 5e3
10515
- })).then((verification) => verification.ok ? { supported: true } : {
10516
- reasonCode: "computer.file_access.capability_unverified",
10517
- supported: false
10518
- }).catch(() => ({
10519
- reasonCode: "computer.file_access.capability_unverified",
10520
- supported: false
10521
- }));
10522
- rememberComputerFileAccessAttestation({
10523
- attestations: computerFileAccessAttestations,
10524
- cacheKey,
10525
- value: {
10526
- expiresAtMs: nowMs + COMPUTER_FILE_ACCESS_ATTESTATION_TTL_MS,
10527
- result
10528
- }
10529
- });
10530
- return await result;
10531
- } catch {
10532
- return {
10533
- reasonCode: "computer.file_access.capability_unverified",
10534
- supported: false
10535
- };
10536
- }
10537
11228
  }
10538
11229
  };
11230
+ return Object.assign({
11231
+ adapterId: "codex",
11232
+ cancel,
11233
+ dispatch,
11234
+ interrupt,
11235
+ verifyComputerFileAccessBoundary
11236
+ }, { [READ_CODEX_DISPATCH_STOP_EVIDENCE]: (taskId) => stoppedDispatches.get(taskId) ?? null });
10539
11237
  };
10540
11238
  function readCodexConversationOccupancy(result, request) {
10541
11239
  if (result.status !== "failed" || request.transportMode !== "codex-app-server" || !result.agentControllerConversationOccupancy) return null;
@@ -10547,6 +11245,25 @@ function abortOccupiedCodexDispatch(input) {
10547
11245
  occupiedDispatch.abortController.abort();
10548
11246
  return true;
10549
11247
  }
11248
+ /**
11249
+ * Records that a Stop ended a task, so no later attempt for it resumes the
11250
+ * thread.
11251
+ *
11252
+ * `turnWasRunning` is the part a caller must not drop: a Stop the adapter answers
11253
+ * without interrupting a native turn is evidence that nothing else in this
11254
+ * process holds the writer, while a Stop that lands on a running turn is only a
11255
+ * request. Both are recorded, because a record that hid the second kind would let
11256
+ * a later attempt read a running turn as a stopped one.
11257
+ */
11258
+ function recordStoppedCodexDispatch(input) {
11259
+ const existing = input.stoppedDispatches.get(input.request.taskId);
11260
+ const turnWasRunning = existing ? existing.turnWasRunning || input.turnWasRunning : input.turnWasRunning;
11261
+ input.stoppedDispatches.set(input.request.taskId, {
11262
+ stoppedAtMs: existing?.stoppedAtMs ?? Date.now(),
11263
+ taskId: input.request.taskId,
11264
+ turnWasRunning
11265
+ });
11266
+ }
10550
11267
  function buildCodexDispatchCancelledResult() {
10551
11268
  return {
10552
11269
  errorCode: "runtime.turn.cancelled",
@@ -10555,6 +11272,20 @@ function buildCodexDispatchCancelledResult() {
10555
11272
  status: "failed"
10556
11273
  };
10557
11274
  }
11275
+ /**
11276
+ * Whether a dispatch result proves the attempt never reached a native turn.
11277
+ *
11278
+ * A Stop that lands while a dispatch is in flight must not be reported as
11279
+ * `runtime.turn.cancelled`: the transport uses that code for "Codex was stopped
11280
+ * before starting a turn", so claiming it for an attempt that may have won the
11281
+ * thread writer lock would tell Core nothing ran while a turn is running, and
11282
+ * invite a second execution of the same work. Only the transport's own pre-turn
11283
+ * cancellation and a refused `thread/resume` prove nothing started; every other
11284
+ * result is reported exactly as it came back, output included.
11285
+ */
11286
+ function codexDispatchStoppedBeforeTurn(result) {
11287
+ return result.status === "failed" && (result.errorCode === "runtime.turn.cancelled" || result.agentControllerConversationOccupancy !== void 0);
11288
+ }
10558
11289
  async function emitCodexConversationAvailable(input) {
10559
11290
  await input.request.onRuntimeEvent?.({
10560
11291
  agentControllerConversationId: input.occupancy.agentControllerConversationId,
@@ -10578,13 +11309,14 @@ async function dispatchCodexWithConversationOccupancy(input) {
10578
11309
  };
10579
11310
  try {
10580
11311
  while (true) {
11312
+ if (input.stoppedDispatches.has(input.request.taskId)) return buildCodexDispatchCancelledResult();
10581
11313
  const cancellationSignal = state.registration?.abortController.signal ?? void 0;
10582
11314
  if (cancellationSignal?.aborted) return buildCodexDispatchCancelledResult();
10583
11315
  const result = await input.sharedDispatch({
10584
11316
  ...input.request,
10585
11317
  ...cancellationSignal ? { cancellationSignal } : {}
10586
11318
  });
10587
- if (state.registration?.abortController.signal.aborted) return buildCodexDispatchCancelledResult();
11319
+ if (state.registration?.abortController.signal.aborted && codexDispatchStoppedBeforeTurn(result)) return buildCodexDispatchCancelledResult();
10588
11320
  const occupancy = readCodexConversationOccupancy(result, input.request);
10589
11321
  if (occupancy) {
10590
11322
  if (await waitForOccupiedCodexConversation({
@@ -20269,6 +21001,7 @@ async function buildControlPlaneResponse(input) {
20269
21001
  });
20270
21002
  case "shutdown": return await buildShutdownControlPlaneResponse({
20271
21003
  context: input.context,
21004
+ lifecycle: input.lifecycle,
20272
21005
  payload: request.payload,
20273
21006
  requestMeta
20274
21007
  });
@@ -20387,7 +21120,7 @@ async function buildShutdownControlPlaneResponse(input) {
20387
21120
  mode: "graceful",
20388
21121
  gracePeriodMs: 5e3
20389
21122
  };
20390
- const payload = input.context.shutdownHandler ? await input.context.shutdownHandler(resolvedShutdownPayload) : {
21123
+ const payload = input.context.shutdownHandler ? await input.context.shutdownHandler(resolvedShutdownPayload, input.lifecycle?.onShutdownAdmitted ? { onAdmitted: input.lifecycle.onShutdownAdmitted } : void 0) : {
20391
21124
  accepted: false,
20392
21125
  mode: resolvedShutdownPayload.mode,
20393
21126
  gracePeriodMs: resolvedShutdownPayload.gracePeriodMs
@@ -20462,8 +21195,10 @@ const buildAuthenticatedControlPlaneResponse = async (input) => {
20462
21195
  expectedToken: input.expectedToken,
20463
21196
  providedToken: request.authToken
20464
21197
  })) throw new Error("auth.unauthenticated");
21198
+ input.lifecycle?.onAuthenticated?.();
20465
21199
  return await buildControlPlaneResponse({
20466
21200
  context: input.context,
21201
+ lifecycle: input.lifecycle,
20467
21202
  request
20468
21203
  });
20469
21204
  };
@@ -29984,24 +30719,32 @@ async function writeAttempt(path, attempt) {
29984
30719
  const OPERATION_ID_ENV = "OPENMELD_INTERNAL_TOOLS_UPDATE_OPERATION_ID";
29985
30720
  const REQUESTED_AT_ENV = "OPENMELD_INTERNAL_TOOLS_UPDATE_REQUESTED_AT";
29986
30721
  const REQUEST_SOURCE_ENV = "OPENMELD_INTERNAL_TOOLS_UPDATE_REQUEST_SOURCE";
30722
+ const TARGET_CLI_VERSION_ENV = "OPENMELD_INTERNAL_TOOLS_UPDATE_TARGET_CLI_VERSION";
30723
+ const TARGET_SERVICE_VERSION_ENV = "OPENMELD_INTERNAL_TOOLS_UPDATE_TARGET_SERVICE_VERSION";
29987
30724
  function buildOpenMeldToolsUpdateContextEnv(context) {
29988
30725
  return {
29989
30726
  [OPERATION_ID_ENV]: context.operationId,
29990
30727
  [REQUESTED_AT_ENV]: context.requestedAt,
29991
- [REQUEST_SOURCE_ENV]: context.requestSource
30728
+ [REQUEST_SOURCE_ENV]: context.requestSource,
30729
+ ...context.targetCliVersion ? { [TARGET_CLI_VERSION_ENV]: context.targetCliVersion } : {},
30730
+ ...context.targetServiceVersion ? { [TARGET_SERVICE_VERSION_ENV]: context.targetServiceVersion } : {}
29992
30731
  };
29993
30732
  }
29994
30733
  function readOpenMeldToolsUpdateContextFromEnv(env = process.env) {
29995
30734
  const operationId = normalize$1(env[OPERATION_ID_ENV]);
29996
30735
  const requestedAt = normalize$1(env[REQUESTED_AT_ENV]);
29997
30736
  const requestSource = openMeldToolsUpdateRequestSourceSchema.safeParse(env[REQUEST_SOURCE_ENV]);
30737
+ const targetCliVersion = normalize$1(env[TARGET_CLI_VERSION_ENV]);
30738
+ const targetServiceVersion = normalize$1(env[TARGET_SERVICE_VERSION_ENV]);
29998
30739
  if (!(operationId && requestedAt && requestSource.success)) return null;
29999
30740
  const requestedAtMs = Date.parse(requestedAt);
30000
30741
  if (!Number.isFinite(requestedAtMs)) return null;
30001
30742
  return {
30002
30743
  operationId,
30003
30744
  requestedAt: new Date(requestedAtMs).toISOString(),
30004
- requestSource: requestSource.data
30745
+ requestSource: requestSource.data,
30746
+ ...targetCliVersion ? { targetCliVersion } : {},
30747
+ ...targetServiceVersion ? { targetServiceVersion } : {}
30005
30748
  };
30006
30749
  }
30007
30750
  function normalize$1(value) {
@@ -30151,7 +30894,7 @@ function createOpenMeldToolsUpdateCoordinator(overrides = {}, options = {}) {
30151
30894
  }
30152
30895
  const assessment = await deps.assessUpdate({ forceRefresh: true });
30153
30896
  if (!(assessment.checked && assessment.latestVersion)) return { status: "unavailable" };
30154
- const serviceVersion = assessment.serviceVersion ?? assessment.currentVersion;
30897
+ const serviceVersion = assessment.serviceVersion ?? assessment.latestVersion;
30155
30898
  if (!(assessment.updateAvailable || await deps.serviceNeedsAlignment(serviceVersion))) return {
30156
30899
  currentVersion: assessment.currentVersion,
30157
30900
  status: "current"
@@ -30166,6 +30909,8 @@ function createOpenMeldToolsUpdateCoordinator(overrides = {}, options = {}) {
30166
30909
  phase: "updating",
30167
30910
  requestSource,
30168
30911
  requestedAt: now,
30912
+ targetCliVersion: assessment.latestVersion,
30913
+ targetServiceVersion: serviceVersion,
30169
30914
  targetVersion: assessment.updateAvailable ? assessment.latestVersion : serviceVersion,
30170
30915
  updatedAt: now,
30171
30916
  urgency: assessment.floorBreached ? "required" : await deps.resolveUrgency()
@@ -30203,7 +30948,9 @@ async function runAttempt(attempt, deps) {
30203
30948
  const result = await deps.runUpgrade({
30204
30949
  operationId: running.operation.operationId,
30205
30950
  requestedAt: running.operation.requestedAt,
30206
- requestSource: running.operation.requestSource
30951
+ requestSource: running.operation.requestSource,
30952
+ targetCliVersion: running.operation.targetCliVersion,
30953
+ targetServiceVersion: running.operation.targetServiceVersion
30207
30954
  });
30208
30955
  if (result.exitCode !== 0) {
30209
30956
  const fallbackMessage = `OpenMeld update process exited with status ${String(result.exitCode)}.`;
@@ -30284,6 +31031,8 @@ function projectServiceJob(job) {
30284
31031
  requestSource: job.requestSource,
30285
31032
  requestedAt: job.requestedAt,
30286
31033
  targetVersion: job.targetVersion,
31034
+ ...job.targetCliVersion ? { targetCliVersion: job.targetCliVersion } : {},
31035
+ ...job.targetServiceVersion ? { targetServiceVersion: job.targetServiceVersion } : {},
30287
31036
  updatedAt: job.updatedAt,
30288
31037
  urgency: job.urgency
30289
31038
  };
@@ -30959,9 +31708,9 @@ function createModelCatalogReadSession(input) {
30959
31708
  async function readModelCatalogOnce(baseUrl) {
30960
31709
  try {
30961
31710
  const [apiClient, baseUrlModule, clientFoundationModule] = await Promise.all([
30962
- import("./dist--pb6JxqG.js"),
30963
- import("./base-url-BE3pFiOZ.js"),
30964
- import("./api-client-foundation-CrQN8_-N.js")
31711
+ import("./dist-CABuqfdH.js"),
31712
+ import("./base-url-CfyKRz89.js"),
31713
+ import("./api-client-foundation-BYnU1pbS.js")
30965
31714
  ]);
30966
31715
  if (typeof apiClient.createConfigApi !== "function") throw new Error("config api client is unavailable");
30967
31716
  const resolvedBaseUrl = baseUrl ?? await baseUrlModule.resolveBaseUrl();
@@ -37617,6 +38366,8 @@ async function scheduleDaemonServiceUpdateLocked(input, deps) {
37617
38366
  requestedAt: input.requestedAt ?? now,
37618
38367
  phase: "waiting_for_work",
37619
38368
  requestSource: input.requestSource ?? "cli",
38369
+ ...input.targetCliVersion ? { targetCliVersion: input.targetCliVersion } : {},
38370
+ ...input.targetServiceVersion ? { targetServiceVersion: input.targetServiceVersion } : {},
37620
38371
  targetVersion: input.targetVersion,
37621
38372
  updatedAt: now,
37622
38373
  urgency: input.urgency
@@ -37641,19 +38392,7 @@ async function reschedulePendingDaemonServiceUpdate(input) {
37641
38392
  const escalateUrgency = input.pending.phase !== "updated" && input.request.urgency === "required" && input.pending.urgency === "available";
37642
38393
  const retained = replaceTarget || escalateUrgency ? {
37643
38394
  ...input.pending,
37644
- ...replaceTarget ? {
37645
- attempts: 0,
37646
- errorMessage: null,
37647
- phase: "waiting_for_work",
37648
- preparedBundle: await input.dependencies.prepareBundle({
37649
- activate: false,
37650
- daemonVersion: input.request.targetVersion,
37651
- ...input.request.binaryRelease ? { binaryRelease: input.request.binaryRelease } : {},
37652
- ...input.request.cliScriptPath ? { cliScriptPath: input.request.cliScriptPath } : {}
37653
- }),
37654
- requestSource: input.request.requestSource ?? "cli",
37655
- targetVersion: input.request.targetVersion
37656
- } : {},
38395
+ ...replaceTarget ? await prepareReplacementJobFields(input) : {},
37657
38396
  updatedAt: input.dependencies.now(),
37658
38397
  urgency: escalateUrgency ? "required" : input.pending.urgency
37659
38398
  } : input.pending;
@@ -37671,6 +38410,23 @@ async function reschedulePendingDaemonServiceUpdate(input) {
37671
38410
  status: "already_scheduled"
37672
38411
  };
37673
38412
  }
38413
+ async function prepareReplacementJobFields(input) {
38414
+ return {
38415
+ attempts: 0,
38416
+ errorMessage: null,
38417
+ phase: "waiting_for_work",
38418
+ preparedBundle: await input.dependencies.prepareBundle({
38419
+ activate: false,
38420
+ daemonVersion: input.request.targetVersion,
38421
+ ...input.request.binaryRelease ? { binaryRelease: input.request.binaryRelease } : {},
38422
+ ...input.request.cliScriptPath ? { cliScriptPath: input.request.cliScriptPath } : {}
38423
+ }),
38424
+ requestSource: input.request.requestSource ?? "cli",
38425
+ ...input.request.targetCliVersion ? { targetCliVersion: input.request.targetCliVersion } : {},
38426
+ ...input.request.targetServiceVersion ? { targetServiceVersion: input.request.targetServiceVersion } : {},
38427
+ targetVersion: input.request.targetVersion
38428
+ };
38429
+ }
37674
38430
  async function pruneWorkerVersionsBestEffort(input) {
37675
38431
  await input.dependencies.pruneWorkerVersions(input.job).catch((error) => {
37676
38432
  console.warn("[openmeld.daemon_service.update_worker_prune_failed]", {
@@ -37883,6 +38639,6 @@ function isNewerTargetVersion(candidate, current) {
37883
38639
  return compareSemver(candidate, current) > 0;
37884
38640
  }
37885
38641
  //#endregion
37886
- export { buildDaemonServiceDependencyTitle as $, alignSelectedOpenMeldProfileStorage as $a, buildLocalAgentCatalogFromReadiness as $i, ProjectBindingStoreUpdateRequiredError as $n, settleInflightTask as $r, resolveCurrentDaemonExpectedVersion as $t, formatDeviceReplyReadinessLabel as A, MAX_RECONNECT_DELAY_MS as Aa, createLocalAdapterEntries as Ai, setAgentRegistrationEnabled as An, createInflightTaskControlRegistry as Ar, uninstallDaemonServiceUpdateWorker as At, resolveGatewayChainReadiness as B, isSelectedOpenMeldProfileRequiredError as Ba, forkCodexAppServerThread as Bi, resolveSkillsAgentRegistry as Bn, resolveDispatchContinuityObservation as Br, toStartBackgroundHelperExecutionCompatibility as Bt, formatDaemonServiceRefreshReliabilityMessage as C, CONTROLLED_SHUTDOWN_SOCKET_CLOSE_TIMEOUT_MS as Ca, resolveAgentExecutionStatus as Ci, listAgentTargetStates as Cn, buildDispatchReplyContextSummary as Cr, readLastOpenMeldToolsUpdateAttempt as Ct, writeDaemonStartFailureState as D, DAEMON_STREAM_KEEPALIVE_PONG_TIMEOUT_MS as Da, resolveSelectableCandidates as Di, reconcileNewRunnableBuiltinAgentsForSetup as Dn, createLocalTaskInterruptSender as Dr, writeOpenMeldToolsMaintenancePolicy as Dt, clearDaemonStartFailureState as E, DAEMON_STREAM_KEEPALIVE_INTERVAL_MS as Ea, resolveNativeAgentControllerPermissionModeForController as Ei, reconcileNewRunnableBuiltinAgentRegistrations as En, mergeOpenClawGatewayVisibility as Er, resolveOpenMeldToolsMaintenanceProjection as Et, formatSpaceMemberCommandRecoveryCopy as F, RUNTIME_AGENT_CONTROLLER_REPORT_SYNC_RETRY_INTERVAL_MS as Fa, probeGrokBuildAcpInterface as Fi, parseAgentEnabledOption as Fn, applyIntervalJitterMs as Fr, readCurrentDaemonOwnerSnapshot as Ft, PREPARE_SESSION_RECONNECT_GRACE_MS as G, deleteOpenMeldProfile as Ga, resolveDispatchSpaceActionMcpServer as Gi, EMPTY_AGENT_CONTROLLER_INTERFACE_CAPABILITIES as Gn, buildRuntimeWorkspaceFingerprint as Gr, isVersionDowngrade as Gt, resolveGatewayChainRetryGuidance as H, resolveOpenMeldProfileOrNull as Ha, resolveInstalledClaudeCodeLaunchCandidates as Hi, resolveRegistryOriginLaunchCommand as Hn, resolveCompatibleConversationExecutionState as Hr, readDaemonRuntimeContractRepairReport as Ht, resolveReplyReadinessAvailabilityReasonCopy as I, RUNTIME_STATE_PERSIST_MIN_INTERVAL_MS as Ia, resolveInstalledGrokBuildLaunchCandidates as Ii, sortAgentRegistrations as In, pruneStaleLeases as Ir, resolveDaemonStopStrategy as It, getSetupFlowCopy as J, primeOpenMeldProfilesSessionCache as Ja, listAgentControllerSupervisedProcessIds as Ji, isHomebrewCommandPath as Jn, commitResolvedAgentContext as Jr, DAEMON_SERVICE_FULL_ALIGNMENT_ANOMALIES as Jt, buildDaemonRouteObservationPresentation as K, getOpenMeldProfileCapabilities as Ka, buildCliLaunchInvocation as Ki, resolveBuiltinAgentControllerDefinition as Kn, buildTaskResultEnvelope as Kr, resolveVersionChangeDirection as Kt, resolveReplyReadinessGuidanceSummaryCopy as L, parseCliViewMode as La, projectCodexUsageLimits as Li, repairBuiltinControllerInstall as Ln, resolveAdaptiveHeartbeatIntervalMs as Lr, resolveStoppedContractWriteBlockedReason as Lt, formatReplyReadinessSummary as M, PROVIDER_CONVERSATION_PROOF_SYNC_RETRY_INTERVAL_MS as Ma, forkOpenCodeServerSession as Mi, updateAgentRegistrations as Mn, MAX_HEARTBEAT_INTERVAL_MS as Mr, buildDaemonOwnerSnapshotFromObservedState as Mt, mapAgentReplyReadinessToLegacyAutoReply as N, REGISTER_RESPONSE_TIMEOUT_MS as Na, resolveInstalledOpenCodeLaunchCandidates as Ni, normalizeAgentId as Nn, MIN_HEARTBEAT_INTERVAL_MS as Nr, formatDaemonOwnerSummaryLabel as Nt, resolveCurrentReplyReadinessSnapshot as O, DEFAULT_RECONNECT_DELAY_MS as Oa, resolveCatalogSyncSkippedProfilesLogState as Oi, removeAgentCustomTarget as On, buildLocalServiceDiagnosticsPayload as Or, ensureDaemonServiceMaintenanceInstalled as Ot, REPLY_READINESS_COPY as P, RUNTIME_AGENT_CONTROLLER_REPORT_SYNC_INTERVAL_MS as Pa, GrokBuildAcpTransportError as Pi, normalizeAgentIds as Pn, applyAcceptedLeases as Pr, hasActiveDaemonOwners as Pt, buildDaemonServiceDependencySummary as Q, readDaemonCatalogSyncSignal as Qa, describeServerRequiredVersionUnavailableReason as Qi, ProjectBindingOperationError as Qn, seedLegacyAgentContext as Qr, classifyDaemonServiceWakeability as Qt, resolveOpenClawDiagnosticsGuidance as R, resolveRuntimeContext as Ra, resolveCodexTimeoutMs as Ri, canManageRegistryAgentSkillTargets as Rn, resolveCatalogSyncIntervalMs as Rr, summarizeDaemonOwnerSnapshot as Rt, buildDaemonServiceUpdateRequiredNextStep as S, CONTROLLED_SHUTDOWN_RESULT_ACK_TIMEOUT_MS as Sa, resolveAgentControllerPermissionModeForController as Si, listAgentRegistrations as Sn, createSerialAgentInteractionCallback as Sr, readOpenMeldToolsUpdateContextFromEnv as St, resolveDaemonServiceFreshnessWarning as T, DAEMON_STREAM_CONNECT_TIMEOUT_MS as Ta, resolveEvidenceSyncHealth as Ti, readAgentRuntimeConfigHealth as Tn, createPendingAgentInteractionRegistry as Tr, readOpenMeldToolsMaintenancePolicy as Tt, resolveOpenClawLocalDiagnosticsValue as U, createOpenMeldAgentProfile as Ua, createUnavailableProviderUsageLimits as Ui, resolveRegistryRuntimeAdapterCapabilitySnapshot as Un, resolveLatestScopedConversationExecutionState as Ur, buildDaemonServiceTargetSpec as Ut, resolveGatewayChainRepairGuidance as V, requireOpenMeldProfile as Va, verifyCodexAppServerThread as Vi, listBuiltinAgentsRegistryEntries as Vn, resolveCompatibleAgentContextMatch as Vr, ensureDaemonRuntimeContractState as Vt, resolveLocalServiceDemand as W, createOpenMeldHumanProfile as Wa, createUnsupportedProviderUsageLimits as Wi, resolveRegistryRuntimeAdapterContractByAgentControllerRef as Wn, runRuntimeTask as Wr, resolveDaemonServiceAlignmentDecision as Wt, buildDaemonServiceDependencyMeaning as X, updateOpenMeldProfile as Xa, resolveServiceUpdateUrgency as Xi, isPnpmGlobalCommandPath as Xn, removeConversationExecutionState as Xr, DAEMON_SERVICE_WAKEABILITY_ADVISORY_ANOMALIES as Xt, buildDaemonServiceDependencyDetails as Y, resolveOpenMeldProfile as Ya, createProviderOriginalError as Yi, isNpmGlobalCommandPath as Yn, loadLedgerState as Yr, DAEMON_SERVICE_REPAIR_ANOMALIES as Yt, buildDaemonServiceDependencyNextStep as Z, assertAdditionalHumanProfileCreationEnabled as Za, assessServerRequiredVersion as Zi, notifyDaemonRouteCatalogChanged as Zn, resolveConversationExecutionStateByLookupKey as Zr, classifyDaemonServiceRunStartability as Zt, resolveServiceReadinessFromServiceStatus as _, buildDaemonSystemServiceCommandSpec as _a, parseAgentControllerRef as _i, validateCustomProfileWorkspacePath as _n, compareAgentControllerRefsForDisplay as _o, syncRuntimeEventToInflightTaskControlRegistry as _r, syncDeviceRuntimeStateProjection as _t, isDaemonInventoryRunningAndStartReady as a, asRecord as aa, DEFAULT_TASK_LIFECYCLE_HEARTBEAT_INTERVAL_MS as ai, readLocalEnabledControllers as an, buildAuthenticationStatusLabel as ao, removeAgentActivityBindingsWhileDeliveryLocked as ar, slugifyOpenClawNamePart as at, buildDaemonServiceRepairGuidance as b, CATALOG_SYNC_SIGNAL_POLL_INTERVAL_MS as ba, renderInformationProtectionPrompt as bi, createRegistrationFromCatalogTarget as bn, isDaemonReconcileInProgressError as br, resolveLocalRegistryAgentIdFromAgentControllerRef as bt, waitForSystemServiceStartup as c, normalizeHeartbeatIntervalMs as ca, buildInformationProtectionPromptPlan as ci, resolveProfileWorkspaceRuntime as cn, createAuthenticationError as co, resolveProjectBindingForPath as cr, createMutableRouteCatalogState as ct, captureDaemonServiceEvidenceBestEffort as d, normalizeText$11 as da, createAgentExecutionStatusDisplayRows as di, readProfileWorkspaceConfig as dn, resolveAuthenticationGuidanceFromError as do, unbindProject as dr, summarizeSkippedDaemonProfiles as dt, readCurrentLocalDeviceId as ea, upsertConversationExecutionState as ei, emitDriftDetectedEvidence as en, clearAllSelectedOpenMeldProfileIds as eo, bindProject as er, resolveDaemonServiceDependencyDiagnostics as et, formatDaemonFailureContextText as f, nowIsoString as fa, createAuthorityOpenMeldServiceRuntimeId as fi, readProfileWorkspaceConfigForAccount as fn, resolveAuthenticationGuidanceFromMessage as fo, canonicalizeLocalProjectPath as fr, syncDaemonRouteCatalogState as ft, resolveServiceReadiness as g, isCliUpdateCheckApplicable as ga, listAgentControllerPermissionModeOptions as gi, setOpenMeldManagedProfileWorkspace as gn, resolveCurrentOpenMeldAccountContext as go, normalizeDispatchThreadAction as gr, NO_LOCAL_AGENTS_NEED_OPENMELD_SERVICE_REASON as gt, resolveDaemonStatusAuthenticationAttention as h, assessCliUpdate as ha, isAgentExecutionReadyOrConnecting as hi, setCustomProfileWorkspace as hn, setProfileDefaultView as ho, withAgentActivityLocalStateLock as hr, resolveCurrentEffectiveProfileWorkingFolderRuntime as ht, runDaemonServiceLifecycle as i, resolvePreferredDaemonDeviceId as ia, buildAgentContextLookupKey as ii, buildRuntimeRouteTargets as in, buildAgentAuthenticationGuide as io, migrateProjectBindingStore as ir, normalizeOpenClawSpaceIdPrefix as it, formatHumanReplyReadinessReason as j, PROVIDER_CONVERSATION_PROOF_SYNC_INTERVAL_MS as ja, parseOpenCodeGoUsageResponse as ji, updateAgentCustomTarget as jn, ADAPTIVE_HEARTBEAT_JITTER_RATIO as jr, inspectDaemonServiceInventory as jt, formatAgentReplyReadinessLabel as k, HEARTBEAT_RESPONSE_TIMEOUT_MS as ka, createLocalAdapterContainer as ki, resolveAgentTargetState as kn, createLocalExecutionSlots as kr, prepareDaemonServiceUpdateWorkerCarrier as kt, startDaemonSystemServiceWithAutoRepair as l, normalizeNonNegativeInteger as la, buildWorkingLanguagePromptPlan as li, ensureOpenMeldManagedProfileWorkspace as ln, extractAuthenticationPromptAction as lo, runIfAgentActivityBindingGenerationIsCurrent as lr, createRouteCatalogFromMutableState as lt, resolveDaemonStatusAttention as m, warnDaemonEvent as ma, getAgentControllerPermissionModeFieldLabel as mi, resolveConfiguredProfileWorkspacePathForAccount as mn, getProfileDefaultView as mo, withAgentActivityDeliveryLock as mr, createModelCatalogReadSession as mt, scheduleDaemonServiceUpdate as n, ensureDaemonRuntimePaths as na, buildAuthenticatedControlPlaneResponse as ni, emitReconcileStartedEvidence as nn, getSelectedOpenMeldProfileId as no, listProjectBindings as nr, prepareProviderRuntime as nt, isSystemServiceStartupTimeoutError as o, dirnamePath as oa, areAgentControllerInterfaceAccountsSame as oi, resolveLocalController as on, buildCommandAuthenticationPromptMessage as oo, removeMissingProjectConnections as or, readDaemonRouteCatalogCache as ot, resolveDaemonStatusSnapshot as p, toErrorMessage$23 as pa, getAgentControllerPermissionModeDisplayMetadata as pi, resolveConfiguredProfileWorkspacePath as pn, resolveAuthenticationReasonFromState as po, resolveLocalProjectConnectionForPath as pr, syncProfileWorkspaceState as pt, buildOnboardingPlan as q, listOpenMeldProfiles as qa, materializeCliLaunchCommand as qi, isBunGlobalCommandPath as qn, appendLedgerHistoryEntry as qr, DAEMON_SERVICE_AUTO_HEAL_ANOMALIES as qt, DaemonServiceLifecycleDrainTimeoutError as r, resolveDaemonDeviceId as ra, assertLegacyAgentContextAssociation as ri, DaemonServiceRunError as rn, setSelectedOpenMeldProfileId as ro, listProjectConnectionsWithStatus as rr, buildOpenClawSpaceSessionKey as rt, resolveSystemServiceStartupWaitMs as s, emitRunLine as sa, buildAgentControllerRef as si, resolveLocalRuntimeControllerSupport as sn, buildHumanAuthenticationCard as so, removeProjectConnection as sr, writeDaemonRouteCatalogCache as st, runPendingDaemonServiceUpdate as t, buildLedgerPaths as ta, withLedgerStateTransaction as ti, emitReconcileCompletedEvidence as tn, clearSelectedOpenMeldProfileId as to, isProjectBound as tr, writeDaemonServiceContract as tt, captureDaemonServiceEvidence as u, normalizeOptionalText$51 as ua, createAgentControllerInterfaceDisplayRows as ui, normalizeCustomProfileWorkspacePath as un, resolveAuthenticationGuidance as uo, setDefaultProjectConnection as ur, loadDaemonRouteCatalog as ut, buildDaemonServiceRefreshNextStep as v, ensureDaemonSystemServiceCommandFiles as va, peopleComputerContainsDevice as vi, describeProfileWorkspacePathValidationFailure as vn, resolveBuiltinAgentControllerBrand as vo, SPACE_ACTION_CONTEXT_GUIDANCE_LINES as vr, createPrimaryBindingReadSession as vt, formatDaemonServiceUpdateRequiredMessage as w, DAEMON_RUNTIME_CONTRACT_EPOCH as wa, resolveAgentProfileEditCapabilities as wi, manageAgentRegistrationInstallation as wn, normalizeDispatchPostMessageAction as wr, readPendingOpenMeldToolsUpdateAttempt as wt, buildDaemonServiceStatusReadOnlyDetail as x, CONTROLLED_SHUTDOWN_REQUEST_TIMEOUT_MS as xa, renderWorkingLanguagePrompt as xi, listAgentCustomTargets as xn, resolveRouteRegistrationReconcileDecision as xr, createOpenMeldToolsUpdateCoordinator as xt, buildDaemonServiceRefreshPromptMessage as y, CATALOG_SYNC_RETRY_INTERVAL_MS as ya, projectPeopleComputersToLegacyLocalRuntimes as yi, addAgentCustomTarget as yn, SPACE_ACTION_TARGET_GUIDANCE_LINES as yr, resolveAgentProfilePrimaryAgentControllerReport as yt, classifyGatewayChainFailure as z, resolveViewProfileKey as za, resolveInstalledCodexLaunchCandidates as zi, detectInstalledSkillsAgents as zn, resolveDispatchQueueLogMeta as zr, resolveDaemonRuntimeContractCompatibility as zt };
38642
+ export { buildDaemonServiceDependencyTitle as $, readDaemonCatalogSyncSignal as $a, describeServerRequiredVersionUnavailableReason as $i, ProjectBindingStoreUpdateRequiredError as $n, settleInflightTask as $r, resolveCurrentDaemonExpectedVersion as $t, formatDeviceReplyReadinessLabel as A, HEARTBEAT_RESPONSE_TIMEOUT_MS as Aa, createLocalAdapterEntries as Ai, setAgentRegistrationEnabled as An, createInflightTaskControlRegistry as Ar, uninstallDaemonServiceUpdateWorker as At, resolveGatewayChainReadiness as B, resolveViewProfileKey as Ba, forkCodexAppServerThread as Bi, resolveSkillsAgentRegistry as Bn, resolveDispatchContinuityObservation as Br, toStartBackgroundHelperExecutionCompatibility as Bt, formatDaemonServiceRefreshReliabilityMessage as C, CONTROLLED_SHUTDOWN_RESULT_ACK_TIMEOUT_MS as Ca, resolveAgentExecutionStatus as Ci, listAgentTargetStates as Cn, buildDispatchReplyContextSummary as Cr, readLastOpenMeldToolsUpdateAttempt as Ct, writeDaemonStartFailureState as D, DAEMON_STREAM_KEEPALIVE_INTERVAL_MS as Da, resolveSelectableCandidates as Di, reconcileNewRunnableBuiltinAgentsForSetup as Dn, createLocalTaskInterruptSender as Dr, writeOpenMeldToolsMaintenancePolicy as Dt, clearDaemonStartFailureState as E, DAEMON_STREAM_CONNECT_TIMEOUT_MS as Ea, resolveNativeAgentControllerPermissionModeForController as Ei, reconcileNewRunnableBuiltinAgentRegistrations as En, mergeOpenClawGatewayVisibility as Er, resolveOpenMeldToolsMaintenanceProjection as Et, formatSpaceMemberCommandRecoveryCopy as F, RUNTIME_AGENT_CONTROLLER_REPORT_SYNC_INTERVAL_MS as Fa, probeGrokBuildAcpInterface as Fi, parseAgentEnabledOption as Fn, applyIntervalJitterMs as Fr, readCurrentDaemonOwnerSnapshot as Ft, PREPARE_SESSION_RECONNECT_GRACE_MS as G, createOpenMeldHumanProfile as Ga, createUnsupportedProviderUsageLimits as Gi, EMPTY_AGENT_CONTROLLER_INTERFACE_CAPABILITIES as Gn, buildRuntimeWorkspaceFingerprint as Gr, isVersionDowngrade as Gt, resolveGatewayChainRetryGuidance as H, requireOpenMeldProfile as Ha, verifyCodexAppServerThread as Hi, resolveRegistryOriginLaunchCommand as Hn, resolveCompatibleConversationExecutionState as Hr, readDaemonRuntimeContractRepairReport as Ht, resolveReplyReadinessAvailabilityReasonCopy as I, RUNTIME_AGENT_CONTROLLER_REPORT_SYNC_RETRY_INTERVAL_MS as Ia, resolveInstalledGrokBuildLaunchCandidates as Ii, sortAgentRegistrations as In, pruneStaleLeases as Ir, resolveDaemonStopStrategy as It, getSetupFlowCopy as J, listOpenMeldProfiles as Ja, materializeCliLaunchCommand as Ji, isHomebrewCommandPath as Jn, commitResolvedAgentContext as Jr, DAEMON_SERVICE_FULL_ALIGNMENT_ANOMALIES as Jt, buildDaemonRouteObservationPresentation as K, deleteOpenMeldProfile as Ka, resolveDispatchSpaceActionMcpServer as Ki, resolveBuiltinAgentControllerDefinition as Kn, buildTaskResultEnvelope as Kr, resolveVersionChangeDirection as Kt, resolveReplyReadinessGuidanceSummaryCopy as L, RUNTIME_STATE_PERSIST_MIN_INTERVAL_MS as La, projectCodexUsageLimits as Li, repairBuiltinControllerInstall as Ln, resolveAdaptiveHeartbeatIntervalMs as Lr, resolveStoppedContractWriteBlockedReason as Lt, formatReplyReadinessSummary as M, PROVIDER_CONVERSATION_PROOF_SYNC_INTERVAL_MS as Ma, forkOpenCodeServerSession as Mi, updateAgentRegistrations as Mn, MAX_HEARTBEAT_INTERVAL_MS as Mr, buildDaemonOwnerSnapshotFromObservedState as Mt, mapAgentReplyReadinessToLegacyAutoReply as N, PROVIDER_CONVERSATION_PROOF_SYNC_RETRY_INTERVAL_MS as Na, resolveInstalledOpenCodeLaunchCandidates as Ni, normalizeAgentId as Nn, MIN_HEARTBEAT_INTERVAL_MS as Nr, formatDaemonOwnerSummaryLabel as Nt, resolveCurrentReplyReadinessSnapshot as O, DAEMON_STREAM_KEEPALIVE_PONG_TIMEOUT_MS as Oa, resolveCatalogSyncSkippedProfilesLogState as Oi, removeAgentCustomTarget as On, buildLocalServiceDiagnosticsPayload as Or, ensureDaemonServiceMaintenanceInstalled as Ot, REPLY_READINESS_COPY as P, REGISTER_RESPONSE_TIMEOUT_MS as Pa, GrokBuildAcpTransportError as Pi, normalizeAgentIds as Pn, applyAcceptedLeases as Pr, hasActiveDaemonOwners as Pt, buildDaemonServiceDependencySummary as Q, assertAdditionalHumanProfileCreationEnabled as Qa, assessServerRequiredVersion as Qi, ProjectBindingOperationError as Qn, seedLegacyAgentContext as Qr, classifyDaemonServiceWakeability as Qt, resolveOpenClawDiagnosticsGuidance as R, parseCliViewMode as Ra, resolveCodexTimeoutMs as Ri, canManageRegistryAgentSkillTargets as Rn, resolveCatalogSyncIntervalMs as Rr, summarizeDaemonOwnerSnapshot as Rt, buildDaemonServiceUpdateRequiredNextStep as S, CONTROLLED_SHUTDOWN_REQUEST_TIMEOUT_MS as Sa, resolveAgentControllerPermissionModeForController as Si, listAgentRegistrations as Sn, createSerialAgentInteractionCallback as Sr, readOpenMeldToolsUpdateContextFromEnv as St, resolveDaemonServiceFreshnessWarning as T, DAEMON_RUNTIME_CONTRACT_EPOCH as Ta, resolveEvidenceSyncHealth as Ti, readAgentRuntimeConfigHealth as Tn, createPendingAgentInteractionRegistry as Tr, readOpenMeldToolsMaintenancePolicy as Tt, resolveOpenClawLocalDiagnosticsValue as U, resolveOpenMeldProfileOrNull as Ua, resolveInstalledClaudeCodeLaunchCandidates as Ui, resolveRegistryRuntimeAdapterCapabilitySnapshot as Un, resolveLatestScopedConversationExecutionState as Ur, buildDaemonServiceTargetSpec as Ut, resolveGatewayChainRepairGuidance as V, isSelectedOpenMeldProfileRequiredError as Va, resolveCodexAppServerCompletedTurn as Vi, listBuiltinAgentsRegistryEntries as Vn, resolveCompatibleAgentContextMatch as Vr, ensureDaemonRuntimeContractState as Vt, resolveLocalServiceDemand as W, createOpenMeldAgentProfile as Wa, createUnavailableProviderUsageLimits as Wi, resolveRegistryRuntimeAdapterContractByAgentControllerRef as Wn, runRuntimeTask as Wr, resolveDaemonServiceAlignmentDecision as Wt, buildDaemonServiceDependencyMeaning as X, resolveOpenMeldProfile as Xa, createProviderOriginalError as Xi, isPnpmGlobalCommandPath as Xn, removeConversationExecutionState as Xr, DAEMON_SERVICE_WAKEABILITY_ADVISORY_ANOMALIES as Xt, buildDaemonServiceDependencyDetails as Y, primeOpenMeldProfilesSessionCache as Ya, listAgentControllerSupervisedProcessIds as Yi, isNpmGlobalCommandPath as Yn, loadLedgerState as Yr, DAEMON_SERVICE_REPAIR_ANOMALIES as Yt, buildDaemonServiceDependencyNextStep as Z, updateOpenMeldProfile as Za, resolveServiceUpdateUrgency as Zi, notifyDaemonRouteCatalogChanged as Zn, resolveConversationExecutionStateByLookupKey as Zr, classifyDaemonServiceRunStartability as Zt, resolveServiceReadinessFromServiceStatus as _, isCliUpdateCheckApplicable as _a, parseAgentControllerRef as _i, validateCustomProfileWorkspacePath as _n, resolveCurrentOpenMeldAccountContext as _o, syncRuntimeEventToInflightTaskControlRegistry as _r, syncDeviceRuntimeStateProjection as _t, isDaemonInventoryRunningAndStartReady as a, resolvePreferredDaemonDeviceId as aa, DEFAULT_TASK_LIFECYCLE_HEARTBEAT_INTERVAL_MS as ai, readLocalEnabledControllers as an, buildAgentAuthenticationGuide as ao, removeAgentActivityBindingsWhileDeliveryLocked as ar, slugifyOpenClawNamePart as at, buildDaemonServiceRepairGuidance as b, CATALOG_SYNC_RETRY_INTERVAL_MS as ba, renderInformationProtectionPrompt as bi, createRegistrationFromCatalogTarget as bn, isDaemonReconcileInProgressError as br, resolveLocalRegistryAgentIdFromAgentControllerRef as bt, waitForSystemServiceStartup as c, emitRunLine as ca, buildInformationProtectionPromptPlan as ci, resolveProfileWorkspaceRuntime as cn, buildHumanAuthenticationCard as co, resolveProjectBindingForPath as cr, createMutableRouteCatalogState as ct, captureDaemonServiceEvidenceBestEffort as d, normalizeOptionalText$51 as da, createAgentExecutionStatusDisplayRows as di, readProfileWorkspaceConfig as dn, resolveAuthenticationGuidance as do, unbindProject as dr, summarizeSkippedDaemonProfiles as dt, buildLocalAgentCatalogFromReadiness as ea, upsertConversationExecutionState as ei, emitDriftDetectedEvidence as en, alignSelectedOpenMeldProfileStorage as eo, bindProject as er, resolveDaemonServiceDependencyDiagnostics as et, formatDaemonFailureContextText as f, normalizeText$11 as fa, createAuthorityOpenMeldServiceRuntimeId as fi, readProfileWorkspaceConfigForAccount as fn, resolveAuthenticationGuidanceFromError as fo, canonicalizeLocalProjectPath as fr, syncDaemonRouteCatalogState as ft, resolveServiceReadiness as g, assessCliUpdate as ga, listAgentControllerPermissionModeOptions as gi, setOpenMeldManagedProfileWorkspace as gn, setProfileDefaultView as go, normalizeDispatchThreadAction as gr, NO_LOCAL_AGENTS_NEED_OPENMELD_SERVICE_REASON as gt, resolveDaemonStatusAuthenticationAttention as h, warnDaemonEvent as ha, isAgentExecutionReadyOrConnecting as hi, setCustomProfileWorkspace as hn, getProfileDefaultView as ho, withAgentActivityLocalStateLock as hr, resolveCurrentEffectiveProfileWorkingFolderRuntime as ht, runDaemonServiceLifecycle as i, resolveDaemonDeviceId as ia, buildAgentContextLookupKey as ii, buildRuntimeRouteTargets as in, setSelectedOpenMeldProfileId as io, migrateProjectBindingStore as ir, normalizeOpenClawSpaceIdPrefix as it, formatHumanReplyReadinessReason as j, MAX_RECONNECT_DELAY_MS as ja, parseOpenCodeGoUsageResponse as ji, updateAgentCustomTarget as jn, ADAPTIVE_HEARTBEAT_JITTER_RATIO as jr, inspectDaemonServiceInventory as jt, formatAgentReplyReadinessLabel as k, DEFAULT_RECONNECT_DELAY_MS as ka, createLocalAdapterContainer as ki, resolveAgentTargetState as kn, createLocalExecutionSlots as kr, prepareDaemonServiceUpdateWorkerCarrier as kt, startDaemonSystemServiceWithAutoRepair as l, normalizeHeartbeatIntervalMs as la, buildWorkingLanguagePromptPlan as li, ensureOpenMeldManagedProfileWorkspace as ln, createAuthenticationError as lo, runIfAgentActivityBindingGenerationIsCurrent as lr, createRouteCatalogFromMutableState as lt, resolveDaemonStatusAttention as m, toErrorMessage$23 as ma, getAgentControllerPermissionModeFieldLabel as mi, resolveConfiguredProfileWorkspacePathForAccount as mn, resolveAuthenticationReasonFromState as mo, withAgentActivityDeliveryLock as mr, createModelCatalogReadSession as mt, scheduleDaemonServiceUpdate as n, buildLedgerPaths as na, buildAuthenticatedControlPlaneResponse as ni, emitReconcileStartedEvidence as nn, clearSelectedOpenMeldProfileId as no, listProjectBindings as nr, prepareProviderRuntime as nt, isSystemServiceStartupTimeoutError as o, asRecord as oa, areAgentControllerInterfaceAccountsSame as oi, resolveLocalController as on, buildAuthenticationStatusLabel as oo, removeMissingProjectConnections as or, readDaemonRouteCatalogCache as ot, resolveDaemonStatusSnapshot as p, nowIsoString as pa, getAgentControllerPermissionModeDisplayMetadata as pi, resolveConfiguredProfileWorkspacePath as pn, resolveAuthenticationGuidanceFromMessage as po, resolveLocalProjectConnectionForPath as pr, syncProfileWorkspaceState as pt, buildOnboardingPlan as q, getOpenMeldProfileCapabilities as qa, buildCliLaunchInvocation as qi, isBunGlobalCommandPath as qn, appendLedgerHistoryEntry as qr, DAEMON_SERVICE_AUTO_HEAL_ANOMALIES as qt, DaemonServiceLifecycleDrainTimeoutError as r, ensureDaemonRuntimePaths as ra, assertLegacyAgentContextAssociation as ri, DaemonServiceRunError as rn, getSelectedOpenMeldProfileId as ro, listProjectConnectionsWithStatus as rr, buildOpenClawSpaceSessionKey as rt, resolveSystemServiceStartupWaitMs as s, dirnamePath as sa, buildAgentControllerRef as si, resolveLocalRuntimeControllerSupport as sn, buildCommandAuthenticationPromptMessage as so, removeProjectConnection as sr, writeDaemonRouteCatalogCache as st, runPendingDaemonServiceUpdate as t, readCurrentLocalDeviceId as ta, withLedgerStateTransaction as ti, emitReconcileCompletedEvidence as tn, clearAllSelectedOpenMeldProfileIds as to, isProjectBound as tr, writeDaemonServiceContract as tt, captureDaemonServiceEvidence as u, normalizeNonNegativeInteger as ua, createAgentControllerInterfaceDisplayRows as ui, normalizeCustomProfileWorkspacePath as un, extractAuthenticationPromptAction as uo, setDefaultProjectConnection as ur, loadDaemonRouteCatalog as ut, buildDaemonServiceRefreshNextStep as v, buildDaemonSystemServiceCommandSpec as va, peopleComputerContainsDevice as vi, describeProfileWorkspacePathValidationFailure as vn, compareAgentControllerRefsForDisplay as vo, SPACE_ACTION_CONTEXT_GUIDANCE_LINES as vr, createPrimaryBindingReadSession as vt, formatDaemonServiceUpdateRequiredMessage as w, CONTROLLED_SHUTDOWN_SOCKET_CLOSE_TIMEOUT_MS as wa, resolveAgentProfileEditCapabilities as wi, manageAgentRegistrationInstallation as wn, normalizeDispatchPostMessageAction as wr, readPendingOpenMeldToolsUpdateAttempt as wt, buildDaemonServiceStatusReadOnlyDetail as x, CATALOG_SYNC_SIGNAL_POLL_INTERVAL_MS as xa, renderWorkingLanguagePrompt as xi, listAgentCustomTargets as xn, resolveRouteRegistrationReconcileDecision as xr, createOpenMeldToolsUpdateCoordinator as xt, buildDaemonServiceRefreshPromptMessage as y, ensureDaemonSystemServiceCommandFiles as ya, projectPeopleComputersToLegacyLocalRuntimes as yi, addAgentCustomTarget as yn, resolveBuiltinAgentControllerBrand as yo, SPACE_ACTION_TARGET_GUIDANCE_LINES as yr, resolveAgentProfilePrimaryAgentControllerReport as yt, classifyGatewayChainFailure as z, resolveRuntimeContext as za, resolveInstalledCodexLaunchCandidates as zi, detectInstalledSkillsAgents as zn, resolveDispatchQueueLogMeta as zr, resolveDaemonRuntimeContractCompatibility as zt };
37887
38643
 
37888
- //# sourceMappingURL=daemon-service-update-coordinator-DcjOzGu1.js.map
38644
+ //# sourceMappingURL=daemon-service-update-coordinator--xLHNqDT.js.map