openmeld 0.3.221 → 0.3.223
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.
- package/dist/{add-me-membership-DpckwGof.js → add-me-membership-AWArQHSP.js} +2 -2
- package/dist/{add-me-membership-DpckwGof.js.map → add-me-membership-AWArQHSP.js.map} +1 -1
- package/dist/{agents-2TzCubpV.js → agents-PsEPfW3B.js} +12 -12
- package/dist/{agents-2TzCubpV.js.map → agents-PsEPfW3B.js.map} +1 -1
- package/dist/{api-client-foundation-CGImd4c8.js → api-client-foundation-CbbeqtJY.js} +1 -1
- package/dist/{api-client-foundation-D-Cb6EVg.js → api-client-foundation-D2lqqEZK.js} +3 -3
- package/dist/{api-client-foundation-D-Cb6EVg.js.map → api-client-foundation-D2lqqEZK.js.map} +1 -1
- package/dist/auth-session-8GEdTCmT.js +4 -0
- package/dist/{auth-session-CDhQANWx.js → auth-session-BDEv3tou.js} +8 -8
- package/dist/auth-session-BDEv3tou.js.map +1 -0
- package/dist/{base-url-CMBApK1J.js → base-url-DXrUiSMI.js} +1 -1
- package/dist/{base-url-D7uE_xTo.js → base-url-DvjOkKPs.js} +2 -2
- package/dist/{base-url-D7uE_xTo.js.map → base-url-DvjOkKPs.js.map} +1 -1
- package/dist/{channel-D5ABuavH.js → channel-CDXD7Bfv.js} +4 -4
- package/dist/{channel-D5ABuavH.js.map → channel-CDXD7Bfv.js.map} +1 -1
- package/dist/{cli-binary-manifest-DiUulkp0.js → cli-binary-manifest-CT5X05lk.js} +30 -4
- package/dist/cli-binary-manifest-CT5X05lk.js.map +1 -0
- package/dist/{command-MlrjQYq5.js → command-CUNcwWww.js} +22 -165
- package/dist/command-CUNcwWww.js.map +1 -0
- package/dist/{computer-connection-DYnof5Xw.js → computer-connection-NCM-EnCu.js} +2 -2
- package/dist/{computer-connection-DYnof5Xw.js.map → computer-connection-NCM-EnCu.js.map} +1 -1
- package/dist/{computer-connection-review-mO6vn3C3.js → computer-connection-review-DATbh3kD.js} +6 -6
- package/dist/{computer-connection-review-mO6vn3C3.js.map → computer-connection-review-DATbh3kD.js.map} +1 -1
- package/dist/{computer-disconnect-CLtQwKDS.js → computer-disconnect-Cd1YvKu7.js} +10 -10
- package/dist/{computer-disconnect-CLtQwKDS.js.map → computer-disconnect-Cd1YvKu7.js.map} +1 -1
- package/dist/{computer-setup-continuation-PVwPXc5i.js → computer-setup-continuation-TU09jiWA.js} +4 -4
- package/dist/{computer-setup-continuation-PVwPXc5i.js.map → computer-setup-continuation-TU09jiWA.js.map} +1 -1
- package/dist/context-BUmQsG9U.js +162 -0
- package/dist/context-BUmQsG9U.js.map +1 -0
- package/dist/{control-plane-BDS63N7Y.js → control-plane-rTE2rHZ5.js} +4 -2
- package/dist/control-plane-rTE2rHZ5.js.map +1 -0
- package/dist/{daemon-device-id-YnLMx1kN.js → daemon-device-id-BOqTgR9G.js} +344 -36
- package/dist/daemon-device-id-BOqTgR9G.js.map +1 -0
- package/dist/{daemon-frame-transport-D-4StENt.js → daemon-frame-transport-C3SOtG8a.js} +519 -12
- package/dist/daemon-frame-transport-C3SOtG8a.js.map +1 -0
- package/dist/{daemon-lifecycle-journal-DcrVY0xb.js → daemon-lifecycle-journal-D4uZ-Ykq.js} +10 -10
- package/dist/daemon-lifecycle-journal-D4uZ-Ykq.js.map +1 -0
- package/dist/{daemon-runtime-lease-BUr4qsLo.js → daemon-runtime-lease-1LMeZ6IS.js} +2 -2
- package/dist/{daemon-runtime-lease-BUr4qsLo.js.map → daemon-runtime-lease-1LMeZ6IS.js.map} +1 -1
- package/dist/{daemon-runtime-lease-C9X8xV_F.js → daemon-runtime-lease-Bz0ucJj3.js} +1 -1
- package/dist/{daemon-service-contract-BpOBMGX0.js → daemon-service-contract-GLmAxsq-.js} +4 -4
- package/dist/{daemon-service-contract-BpOBMGX0.js.map → daemon-service-contract-GLmAxsq-.js.map} +1 -1
- package/dist/{daemon-service-manager-HL4VKbIU.js → daemon-service-manager-C8RUCMDo.js} +9 -7
- package/dist/daemon-service-manager-C8RUCMDo.js.map +1 -0
- package/dist/{daemon-service-manager-B-QrDe5p.js → daemon-service-manager-CU-79a4z.js} +1 -1
- package/dist/{daemon-service-runtime-Kr6Bs2J2.js → daemon-service-runtime-BEfMD5jb.js} +397 -51
- package/dist/daemon-service-runtime-BEfMD5jb.js.map +1 -0
- package/dist/{daemon-service-update-coordinator-RJO997me.js → daemon-service-update-coordinator-uQW-Ib66.js} +48 -33
- package/dist/daemon-service-update-coordinator-uQW-Ib66.js.map +1 -0
- package/dist/{daemon-state-B44aq2nm.js → daemon-state-Ca0WK5x0.js} +3 -3
- package/dist/{daemon-state-B44aq2nm.js.map → daemon-state-Ca0WK5x0.js.map} +1 -1
- package/dist/{dist-BewA9srP.js → dist-B0OGOBKB.js} +81 -15
- package/dist/dist-B0OGOBKB.js.map +1 -0
- package/dist/dist-BMJ6nTd6.js +4 -0
- package/dist/{dist-ChS52b_E.js → dist-CkSuMZyq.js} +16 -12
- package/dist/dist-CkSuMZyq.js.map +1 -0
- package/dist/{elapsed-time-Cw6b9rYy.js → elapsed-time-DmXBSBLX.js} +6 -6
- package/dist/{elapsed-time-Cw6b9rYy.js.map → elapsed-time-DmXBSBLX.js.map} +1 -1
- package/dist/{entry-BE8uqbkD.js → entry-DbA--kpf.js} +12 -12
- package/dist/{entry-BE8uqbkD.js.map → entry-DbA--kpf.js.map} +1 -1
- package/dist/{installation-inventory-Dwn8FoKT.js → installation-inventory-B50K5Nme.js} +5 -5
- package/dist/{installation-inventory-Dwn8FoKT.js.map → installation-inventory-B50K5Nme.js.map} +1 -1
- package/dist/{installer-CsQ4vNjT.js → installer-BSByDtli.js} +2 -2
- package/dist/{installer-CsQ4vNjT.js.map → installer-BSByDtli.js.map} +1 -1
- package/dist/io-DT66typ4.js +16 -0
- package/dist/io-DT66typ4.js.map +1 -0
- package/dist/{local-components-B6SCXZf9.js → local-components-DleLEzSU.js} +2 -1
- package/dist/local-components-DleLEzSU.js.map +1 -0
- package/dist/{lock-Bsl_ElWy.js → lock-iue1J2xy.js} +8 -5
- package/dist/lock-iue1J2xy.js.map +1 -0
- package/dist/{cli-space-api-B2l1xMPn.js → meta-api-C4_z3Ins.js} +203 -19
- package/dist/meta-api-C4_z3Ins.js.map +1 -0
- package/dist/{openmeld-Tkp17vPg.js → openmeld-BloctT8R.js} +101 -1026
- package/dist/openmeld-BloctT8R.js.map +1 -0
- package/dist/openmeld-dev.js +1 -1
- package/dist/{openmeld-environment-target-B6HqY0_a.js → openmeld-environment-target-BBn5Ko6p.js} +3 -3
- package/dist/{openmeld-environment-target-B6HqY0_a.js.map → openmeld-environment-target-BBn5Ko6p.js.map} +1 -1
- package/dist/{openmeld-maintenance-worker-C1J_ISOh.js → openmeld-maintenance-worker-BgA89k58.js} +15 -14
- package/dist/openmeld-maintenance-worker-BgA89k58.js.map +1 -0
- package/dist/{openmeld-tools-update-join-ZLpRTHO3.js → openmeld-tools-update-join-B4sRZFfU.js} +4 -4
- package/dist/{openmeld-tools-update-join-ZLpRTHO3.js.map → openmeld-tools-update-join-B4sRZFfU.js.map} +1 -1
- package/dist/{openmeld-tools-update-process-frame-B-XB4dmO.js → openmeld-tools-update-process-frame-BtFKp70p.js} +2 -2
- package/dist/{openmeld-tools-update-process-frame-B-XB4dmO.js.map → openmeld-tools-update-process-frame-BtFKp70p.js.map} +1 -1
- package/dist/{openmeld-tools-update-process-frame-j-RXwFsK.js → openmeld-tools-update-process-frame-DbEZ3fEh.js} +1 -1
- package/dist/openmeld.js +9 -5
- package/dist/openmeld.js.map +1 -1
- package/dist/{prepare-provider-runtime-CD5ZI-ct.js → prepare-provider-runtime-L84g7H_Q.js} +3395 -1346
- package/dist/prepare-provider-runtime-L84g7H_Q.js.map +1 -0
- package/dist/{prepare-session-executor-C2nNM2yb.js → prepare-session-executor-uQHhdNg8.js} +29 -28
- package/dist/prepare-session-executor-uQHhdNg8.js.map +1 -0
- package/dist/{presenter-BcxiQyJg.js → presenter-MJ5YgsOT.js} +3 -13
- package/dist/presenter-MJ5YgsOT.js.map +1 -0
- package/dist/{process-channel-B2BU2X7x.js → process-channel-D71P1C32.js} +2 -2
- package/dist/{process-channel-B2BU2X7x.js.map → process-channel-D71P1C32.js.map} +1 -1
- package/dist/process-environment-BWSFeUu6.js +49 -0
- package/dist/process-environment-BWSFeUu6.js.map +1 -0
- package/dist/process-identity-BQLdaZdB.js +190 -0
- package/dist/process-identity-BQLdaZdB.js.map +1 -0
- package/dist/process-launch-B0pHlkV_.js +173 -0
- package/dist/process-launch-B0pHlkV_.js.map +1 -0
- package/dist/{published-production-safety-dp-fOmmB.js → published-production-safety-C40hKrBA.js} +2 -2
- package/dist/{published-production-safety-dp-fOmmB.js.map → published-production-safety-C40hKrBA.js.map} +1 -1
- package/dist/{runtime-DMYoB5_x.js → runtime-Pwc12DeY.js} +155 -702
- package/dist/runtime-Pwc12DeY.js.map +1 -0
- package/dist/{runtime-agent-controller-reporting-submission-DGm8O4q_.js → runtime-agent-controller-reporting-submission-AmSxt3Z1.js} +11 -10
- package/dist/{runtime-agent-controller-reporting-submission-DGm8O4q_.js.map → runtime-agent-controller-reporting-submission-AmSxt3Z1.js.map} +1 -1
- package/dist/{runtime-reporting-health-state-BWZgy4pF.js → runtime-reporting-health-state-DwlV1Fsv.js} +2210 -60
- package/dist/runtime-reporting-health-state-DwlV1Fsv.js.map +1 -0
- package/dist/{runtime-transport-0F5E6So6.js → runtime-transport-CivtwW1A.js} +104 -15
- package/dist/runtime-transport-CivtwW1A.js.map +1 -0
- package/dist/{service-C72KhNft.js → service-DYid1j4Y.js} +124 -548
- package/dist/service-DYid1j4Y.js.map +1 -0
- package/dist/{service-account-admission-Dy2W3n3_.js → service-account-admission-BfdJ-kKR.js} +18 -10
- package/dist/service-account-admission-BfdJ-kKR.js.map +1 -0
- package/dist/{service-account-authorization-DAPQy2yP.js → service-account-authorization-Cx6KEfvI.js} +6 -6
- package/dist/{service-account-authorization-DAPQy2yP.js.map → service-account-authorization-Cx6KEfvI.js.map} +1 -1
- package/dist/{service-account-control-DZjUR3I_.js → service-account-control-NTVNuQbb.js} +16 -16
- package/dist/service-account-control-NTVNuQbb.js.map +1 -0
- package/dist/{service-control-capabilities-Y4CGrchz.js → service-control-capabilities-CkKw-5l7.js} +1 -1
- package/dist/{service-control-capabilities-C2MF5FUD.js → service-control-capabilities-D0qUygFh.js} +19 -15
- package/dist/service-control-capabilities-D0qUygFh.js.map +1 -0
- package/dist/{service-control-carrier-capability-DDNyE5cB.js → service-control-carrier-capability-gMk5gMKU.js} +11 -4
- package/dist/service-control-carrier-capability-gMk5gMKU.js.map +1 -0
- package/dist/{state-CK1WXIsI.js → state-CZHAuQRD.js} +4 -4
- package/dist/{state-CK1WXIsI.js.map → state-CZHAuQRD.js.map} +1 -1
- package/dist/upgrade-DBdUgOXy.js +4 -0
- package/dist/{upgrade-BTIKVek7.js → upgrade-ym-rbiAR.js} +52 -32
- package/dist/upgrade-ym-rbiAR.js.map +1 -0
- package/dist/windows/openmeld-windows-process.exe +0 -0
- package/dist/windows-artifact-DJ9DKjfc.js +16 -0
- package/dist/windows-artifact-DJ9DKjfc.js.map +1 -0
- package/dist/windows-task-command-COu_6Ke3.js +74 -0
- package/dist/windows-task-command-COu_6Ke3.js.map +1 -0
- package/dist/windows-task-entry-CtRpUbiK.js +50 -0
- package/dist/windows-task-entry-CtRpUbiK.js.map +1 -0
- package/dist/{windows-user-task-Bx2yYnOM.js → windows-user-task-B8NcRg_u.js} +1 -1
- package/dist/{windows-user-task-CRGbKggi.js → windows-user-task-Io5QuEVR.js} +108 -51
- package/dist/windows-user-task-Io5QuEVR.js.map +1 -0
- package/package.json +11 -11
- package/skills/openmeld-cli/playbooks/space-ops.md +9 -3
- package/skills/openmeld-cli/references/commands.md +0 -1
- package/dist/auth-session-CDhQANWx.js.map +0 -1
- package/dist/auth-session-DsBkEFct.js +0 -4
- package/dist/cli-binary-manifest-DiUulkp0.js.map +0 -1
- package/dist/cli-space-api-B2l1xMPn.js.map +0 -1
- package/dist/command-MlrjQYq5.js.map +0 -1
- package/dist/context-D9Ebb5wl.js +0 -473
- package/dist/context-D9Ebb5wl.js.map +0 -1
- package/dist/control-plane-BDS63N7Y.js.map +0 -1
- package/dist/daemon-device-id-YnLMx1kN.js.map +0 -1
- package/dist/daemon-frame-transport-D-4StENt.js.map +0 -1
- package/dist/daemon-lifecycle-journal-DcrVY0xb.js.map +0 -1
- package/dist/daemon-service-manager-HL4VKbIU.js.map +0 -1
- package/dist/daemon-service-runtime-Kr6Bs2J2.js.map +0 -1
- package/dist/daemon-service-update-coordinator-RJO997me.js.map +0 -1
- package/dist/dist-B6VsppM7.js +0 -4
- package/dist/dist-BewA9srP.js.map +0 -1
- package/dist/dist-ChS52b_E.js.map +0 -1
- package/dist/local-components-B6SCXZf9.js.map +0 -1
- package/dist/lock-Bsl_ElWy.js.map +0 -1
- package/dist/openmeld-Tkp17vPg.js.map +0 -1
- package/dist/openmeld-maintenance-worker-C1J_ISOh.js.map +0 -1
- package/dist/prepare-provider-runtime-CD5ZI-ct.js.map +0 -1
- package/dist/prepare-session-executor-C2nNM2yb.js.map +0 -1
- package/dist/presenter-BcxiQyJg.js.map +0 -1
- package/dist/process-identity-CNus0e6E.js +0 -146
- package/dist/process-identity-CNus0e6E.js.map +0 -1
- package/dist/runtime-DMYoB5_x.js.map +0 -1
- package/dist/runtime-reporting-health-state-BWZgy4pF.js.map +0 -1
- package/dist/runtime-transport-0F5E6So6.js.map +0 -1
- package/dist/service-C72KhNft.js.map +0 -1
- package/dist/service-account-admission-Dy2W3n3_.js.map +0 -1
- package/dist/service-account-control-DZjUR3I_.js.map +0 -1
- package/dist/service-control-capabilities-C2MF5FUD.js.map +0 -1
- package/dist/service-control-carrier-capability-DDNyE5cB.js.map +0 -1
- package/dist/upgrade-BTIKVek7.js.map +0 -1
- package/dist/upgrade-DTB0ZmxI.js +0 -4
- package/dist/windows-user-task-CRGbKggi.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { _t as systemDir, d as runWithHeldLock, dt as resolveOpenMeldServiceOwnedPathInput, f as tryCleanupStaleLock, lt as resolveOpenMeldEnvPreset, o as readLockMeta, pt as runtimeDir, s as releaseLock, t as acquireLock, ut as resolveOpenMeldRootDir } from "./lock-iue1J2xy.js";
|
|
4
4
|
import { createHash, randomBytes } from "node:crypto";
|
|
5
5
|
import { tmpdir } from "node:os";
|
|
6
6
|
import { join } from "node:path";
|
|
@@ -136,7 +136,7 @@ async function setDaemonServiceRuntimeState(state, pathInput = {}) {
|
|
|
136
136
|
await writeDaemonServiceRuntimeState(state, pathInput);
|
|
137
137
|
}
|
|
138
138
|
async function clearDaemonServiceRuntimeState(pathInput = {}) {
|
|
139
|
-
const { clearDaemonRuntimeLease } = await import("./daemon-runtime-lease-
|
|
139
|
+
const { clearDaemonRuntimeLease } = await import("./daemon-runtime-lease-Bz0ucJj3.js");
|
|
140
140
|
await Promise.all([rm(daemonServiceRuntimeStatePath(pathInput), { force: true }), clearDaemonRuntimeLease(pathInput)]);
|
|
141
141
|
}
|
|
142
142
|
function withDaemonServiceRunLock(callback, meta = {
|
|
@@ -652,4 +652,4 @@ async function pathExists(path) {
|
|
|
652
652
|
//#endregion
|
|
653
653
|
export { getDaemonStatus as A, restoreDaemonInstallStateSnapshot as B, daemonServiceStableBinaryExecutablePath as C, daemonStatePath as D, daemonServiceUpdateWorkerBinaryExecutablePath as E, readDaemonServiceLifecycleLockMetaWithCleanup as F, withDaemonServiceRegistrationMutationLock as G, setDaemonServiceRuntimeState as H, readDaemonServiceRuntimeSnapshot as I, withDaemonServiceRunLock as K, releaseDaemonServiceLifecycleLock as L, isDaemonServiceRuntimeHeartbeatStale as M, readDaemonControlPlaneToken as N, ensureDaemonControlPlaneToken as O, readDaemonServiceLifecycleLockMeta as P, resolveDaemonControlPlaneEndpoint as R, daemonServiceRepairJournalPath as S, daemonServiceStableLauncherPath as T, uninstallDaemon as U, rotateDaemonControlPlaneTokenIfExpired as V, withDaemonServiceReconcileLock as W, daemonRuntimeStateRootPath as _, DAEMON_SERVICE_RUNTIME_MODE_ENV as a, daemonServiceLegacyExecutableWrapperPath as b, acquireDaemonServiceLifecycleLock as c, daemonDispatchJournalPath as d, daemonLifecycleJournalPath as f, daemonRuntimeServiceManagerPath as g, daemonRuntimeRootPath as h, DAEMON_SERVICE_RUNTIME_DETACHED_ENV as i, installDaemon as j, getDaemonRuntimeStatus as k, clearDaemonServiceRuntimeState as l, daemonRuntimeDataPath as m, DAEMON_SERVICE_RUNTIME_AUTO_START_ENV as n, DAEMON_SERVICE_RUNTIME_STATE_SCHEMA as o, daemonRuntimeBundlesPath as p, withDaemonServiceStopLock as q, DAEMON_SERVICE_RUNTIME_CONTROLLER_ENV as r, DAEMON_SERVICE_RUNTIME_SYSTEM_SERVICE_ENV as s, DAEMON_HEARTBEAT_STALE_MS as t, currentDaemonServiceLifecycleLock as u, daemonServiceActiveBundleStatePath as v, daemonServiceStableExecutableWrapperPath as w, daemonServiceRecognizedExecutablePaths as x, daemonServiceExecutableWrapperPaths as y, resolveDaemonServiceRuntimeMetadata as z };
|
|
654
654
|
|
|
655
|
-
//# sourceMappingURL=daemon-state-
|
|
655
|
+
//# sourceMappingURL=daemon-state-Ca0WK5x0.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daemon-state-B44aq2nm.js","names":[],"sources":["../src/config/daemon-state.ts"],"sourcesContent":["import { AsyncLocalStorage } from \"node:async_hooks\";\nimport { createHash, randomBytes } from \"node:crypto\";\nimport {\n chmod,\n mkdir,\n readFile,\n rename,\n rm,\n stat,\n writeFile,\n} from \"node:fs/promises\";\nimport { tmpdir } from \"node:os\";\nimport { join } from \"node:path\";\nimport {\n acquireLock,\n type OpenMeldLock,\n readLockMeta,\n releaseLock,\n runWithHeldLock,\n tryCleanupStaleLock,\n} from \"./lock\";\nimport type { OpenMeldEnvPreset, OpenMeldPathResolutionInput } from \"./paths\";\nimport {\n resolveOpenMeldEnvPreset,\n resolveOpenMeldRootDir,\n resolveOpenMeldServiceOwnedPathInput,\n runtimeDir,\n systemDir,\n} from \"./paths\";\n\nconst DAEMON_STATE_SCHEMA = \"openmeld-daemon-install-v1\";\nexport const DAEMON_SERVICE_RUNTIME_STATE_SCHEMA =\n \"openmeld-daemon-service-state-v1\";\nexport const DAEMON_SERVICE_RUNTIME_MODE_ENV = \"OPENMELD_DAEMON_RUNTIME_MODE\";\nexport const DAEMON_SERVICE_RUNTIME_DETACHED_ENV =\n \"OPENMELD_DAEMON_RUNTIME_DETACHED\";\nexport const DAEMON_SERVICE_RUNTIME_CONTROLLER_ENV =\n \"OPENMELD_DAEMON_SERVICE_CONTROLLER\";\nexport const DAEMON_SERVICE_RUNTIME_AUTO_START_ENV =\n \"OPENMELD_DAEMON_SERVICE_AUTO_START\";\nexport const DAEMON_SERVICE_RUNTIME_SYSTEM_SERVICE_ENV =\n \"OPENMELD_DAEMON_RUNTIME_SYSTEM_SERVICE\";\nconst DAEMON_TOKEN_SCHEMA = \"openmeld-daemon-token-v1\";\nconst DAEMON_TOKEN_ROTATE_MAX_AGE_MS = 24 * 60 * 60 * 1000;\nexport const DAEMON_HEARTBEAT_STALE_MS = 3 * 60 * 1000;\nconst DAEMON_ACTIVE_BUNDLE_STATE_FILENAME = \"active-bundle.json\";\nconst DAEMON_DISPATCH_JOURNAL_FILENAME = \"daemon-dispatch-journal.jsonl\";\nconst DAEMON_LIFECYCLE_JOURNAL_FILENAME = \"daemon-lifecycle-journal.jsonl\";\nconst DAEMON_REPAIR_JOURNAL_FILENAME = \"repair-journal.json\";\nconst DAEMON_SERVICE_LOCK_PROFILE = \"daemon-service\";\nconst DAEMON_SERVICE_LOCK_KEY = \"daemon-service-run\";\ntype DaemonServiceLifecycleLockContext = {\n lock: OpenMeldLock;\n active: boolean;\n failures: unknown[];\n ownerRoot: string;\n pendingOperations: Set<Promise<void>>;\n};\nconst daemonServiceLifecycleLockContext =\n new AsyncLocalStorage<DaemonServiceLifecycleLockContext>();\n\nexport function currentDaemonServiceLifecycleLock(): OpenMeldLock | null {\n const context = daemonServiceLifecycleLockContext.getStore();\n return context?.active &&\n context.ownerRoot ===\n resolveOpenMeldRootDir(resolveOpenMeldServiceOwnedPathInput())\n ? context.lock\n : null;\n}\nconst DAEMON_STABLE_LAUNCHER_FILENAME = \"daemon-service-launcher.mjs\";\nconst DAEMON_SERVICE_EXECUTABLE_WRAPPER_FILENAME_BY_PRESET = {\n prod: \"OpenMeld Service\",\n \"dev-local\": \"OpenMeld Service Dev\",\n canary: \"OpenMeld Service Canary\",\n} as const satisfies Record<OpenMeldEnvPreset, string>;\nconst DAEMON_SERVICE_BINARY_EXECUTABLE_FILENAME_BY_PRESET = {\n prod: \"OpenMeld Service Binary\",\n \"dev-local\": \"OpenMeld Service Binary Dev\",\n canary: \"OpenMeld Service Binary Canary\",\n} as const satisfies Record<OpenMeldEnvPreset, string>;\nconst DAEMON_SERVICE_UPDATE_WORKER_BINARY_FILENAME_BY_PRESET = {\n prod: \"OpenMeld Update Worker Binary\",\n \"dev-local\": \"OpenMeld Update Worker Binary Dev\",\n canary: \"OpenMeld Update Worker Binary Canary\",\n} as const satisfies Record<OpenMeldEnvPreset, string>;\nconst DAEMON_SERVICE_LEGACY_EXECUTABLE_WRAPPER_FILENAME_BY_PRESET = {\n prod: \"openmeld-service\",\n \"dev-local\": \"openmeld-dev-service\",\n canary: \"openmeld-canary-service\",\n} as const satisfies Record<OpenMeldEnvPreset, string>;\nexport const DAEMON_SERVICE_LIFECYCLE_LOCK_PROFILE =\n DAEMON_SERVICE_LOCK_PROFILE;\nexport const DAEMON_SERVICE_LIFECYCLE_LOCK_KEY = DAEMON_SERVICE_LOCK_KEY;\nexport type DaemonServiceLifecycleLock = OpenMeldLock;\n\nexport type DaemonLifecycleIntent =\n | \"run_background\"\n | \"run_foreground\"\n | \"stop\"\n | \"autostart\"\n | \"status_cleanup\"\n | \"startup_check\"\n | \"start\"\n | \"reinstall\"\n | \"uninstall\"\n | \"upgrade_reconcile\";\n\nexport type DaemonLifecycleLockMeta = {\n intent: DaemonLifecycleIntent;\n command: string;\n pid?: number;\n sessionId?: string;\n at?: string;\n};\n\nexport type DaemonInstallSource = \"cli.auto_check\" | \"daemon.command.install\";\nexport type DaemonRunMode = \"foreground\" | \"background\";\nexport type DaemonServiceController =\n | \"launchd\"\n | \"systemd\"\n | \"windows-service\"\n | \"legacy-detached\"\n | \"unknown\";\n\ntype BaseDaemonServiceRuntimeState = {\n mode: DaemonRunMode;\n command: string;\n gatewayUrl: string | null;\n openMeldProfileId: string | null;\n stopRequestedAt: string | null;\n startedAt: string;\n updatedAt: string;\n heartbeatAt: string | null;\n managedBySystemService: boolean;\n serviceController: DaemonServiceController;\n autoStart: boolean;\n};\n\nexport type DaemonServiceRuntimeState = BaseDaemonServiceRuntimeState & {\n v: 1;\n schema: typeof DAEMON_SERVICE_RUNTIME_STATE_SCHEMA;\n status: \"running\";\n pid: number;\n};\n\nexport type DaemonServiceRuntimeStatus = {\n status: \"running\" | \"stale\" | \"not_running\" | \"unknown\";\n mode: DaemonRunMode | null;\n pid: number | null;\n startedAt: string | null;\n updatedAt: string | null;\n managedBySystemService: boolean;\n serviceController: DaemonServiceRuntimeState[\"serviceController\"];\n autoStart: boolean;\n reason?: string;\n};\n\nexport type DaemonServiceRuntimeMetadataInput = {\n managedBySystemService?: boolean;\n serviceController?: string;\n autoStart?: boolean;\n env?: NodeJS.ProcessEnv;\n};\n\nexport type DaemonServiceRuntimeMetadata = {\n managedBySystemService: boolean;\n serviceController: DaemonServiceController;\n autoStart: boolean;\n};\n\nexport type DaemonInstallState = {\n v: 1;\n schema: typeof DAEMON_STATE_SCHEMA;\n daemonVersion: string;\n installSource: DaemonInstallSource;\n installedAt: string;\n updatedAt: string;\n};\n\nexport type DaemonTokenState = {\n v: 1;\n schema: typeof DAEMON_TOKEN_SCHEMA;\n token: string;\n issuedAt: string;\n updatedAt: string;\n};\n\nexport type DaemonInstallResult = {\n status: \"installed\" | \"already_installed\";\n state: DaemonInstallState;\n};\n\nexport type DaemonUninstallResult = {\n removed: boolean;\n};\n\nexport type DaemonStatus =\n | {\n installed: true;\n state: DaemonInstallState;\n }\n | {\n installed: false;\n state: null;\n };\n\nexport async function getDaemonStatus(\n pathInput: OpenMeldPathResolutionInput = {}\n): Promise<DaemonStatus> {\n const [state, runtimeExists] = await Promise.all([\n readDaemonInstallState(pathInput),\n pathExists(daemonRuntimeRootPath(pathInput)),\n ]);\n if (state && runtimeExists) {\n return {\n installed: true,\n state,\n };\n }\n return {\n installed: false,\n state: null,\n };\n}\n\nexport async function getDaemonRuntimeStatus(\n pathInput: OpenMeldPathResolutionInput = {}\n): Promise<DaemonServiceRuntimeStatus> {\n const state = await readDaemonServiceRuntimeState(pathInput);\n if (!state) {\n return {\n status: \"not_running\",\n mode: null,\n pid: null,\n startedAt: null,\n updatedAt: null,\n managedBySystemService: false,\n serviceController: \"unknown\",\n autoStart: false,\n };\n }\n if (!Number.isInteger(state.pid) || state.pid <= 0) {\n return {\n status: \"stale\",\n mode: state.mode,\n pid: state.pid,\n startedAt: state.startedAt,\n updatedAt: state.updatedAt,\n managedBySystemService: state.managedBySystemService,\n serviceController: state.serviceController,\n autoStart: state.autoStart,\n reason: \"invalid_pid\",\n };\n }\n if (!isPidAlive(state.pid)) {\n return {\n status: \"stale\",\n mode: state.mode,\n pid: state.pid,\n startedAt: state.startedAt,\n updatedAt: state.updatedAt,\n managedBySystemService: state.managedBySystemService,\n serviceController: state.serviceController,\n autoStart: state.autoStart,\n reason: \"process_not_alive\",\n };\n }\n if (isDaemonServiceRuntimeHeartbeatStale(state)) {\n return {\n status: \"stale\",\n mode: state.mode,\n pid: state.pid,\n startedAt: state.startedAt,\n updatedAt: state.updatedAt,\n managedBySystemService: state.managedBySystemService,\n serviceController: state.serviceController,\n autoStart: state.autoStart,\n reason: \"heartbeat_stale\",\n };\n }\n return {\n status: \"running\",\n mode: state.mode,\n pid: state.pid,\n startedAt: state.startedAt,\n updatedAt: state.updatedAt,\n managedBySystemService: state.managedBySystemService,\n serviceController: state.serviceController,\n autoStart: state.autoStart,\n };\n}\n\nexport async function readDaemonServiceRuntimeSnapshot(\n pathInput: OpenMeldPathResolutionInput = {}\n): Promise<DaemonServiceRuntimeState | null> {\n return await readDaemonServiceRuntimeState(pathInput);\n}\n\nexport function resolveDaemonServiceRuntimeMetadata(\n input: DaemonServiceRuntimeMetadataInput = {}\n): DaemonServiceRuntimeMetadata {\n const env = input.env ?? process.env;\n const managedBySystemService =\n input.managedBySystemService === true ||\n env[DAEMON_SERVICE_RUNTIME_SYSTEM_SERVICE_ENV] === \"1\";\n const serviceControllerInput =\n typeof input.serviceController === \"string\" &&\n input.serviceController.length > 0\n ? input.serviceController\n : env[DAEMON_SERVICE_RUNTIME_CONTROLLER_ENV];\n const autoStart =\n input.autoStart === true ||\n env[DAEMON_SERVICE_RUNTIME_AUTO_START_ENV] === \"1\";\n\n return {\n managedBySystemService,\n serviceController: parseDaemonServiceController(serviceControllerInput),\n autoStart,\n };\n}\n\nexport async function setDaemonServiceRuntimeState(\n state: DaemonServiceRuntimeState,\n pathInput: OpenMeldPathResolutionInput = {}\n): Promise<void> {\n await writeDaemonServiceRuntimeState(state, pathInput);\n}\n\nexport async function clearDaemonServiceRuntimeState(\n pathInput: OpenMeldPathResolutionInput = {}\n): Promise<void> {\n const { clearDaemonRuntimeLease } = await import(\"./daemon-runtime-lease\");\n await Promise.all([\n rm(daemonServiceRuntimeStatePath(pathInput), { force: true }),\n clearDaemonRuntimeLease(pathInput),\n ]);\n}\n\nexport function withDaemonServiceRunLock<T>(\n callback: () => Promise<T>,\n meta: DaemonLifecycleLockMeta = {\n intent: \"run_background\",\n command: \"openmeld service start\",\n }\n): Promise<T> {\n return withDaemonServiceLifecycleLock(meta, callback);\n}\n\nexport async function acquireDaemonServiceLifecycleLock(\n meta: DaemonLifecycleLockMeta = {\n intent: \"run_background\",\n command: \"openmeld service start\",\n },\n pathResolution: OpenMeldPathResolutionInput = resolveOpenMeldServiceOwnedPathInput()\n): Promise<DaemonServiceLifecycleLock> {\n return await acquireLock({\n openMeldProfileId: DAEMON_SERVICE_LIFECYCLE_LOCK_PROFILE,\n key: DAEMON_SERVICE_LIFECYCLE_LOCK_KEY,\n meta,\n pathResolution,\n });\n}\n\nexport async function releaseDaemonServiceLifecycleLock(\n lock: DaemonServiceLifecycleLock\n): Promise<void> {\n await releaseLock(lock);\n}\n\nexport function withDaemonServiceStopLock<T>(\n callback: () => Promise<T>,\n meta: DaemonLifecycleLockMeta = {\n intent: \"stop\",\n command: \"openmeld service stop\",\n }\n): Promise<T> {\n return withDaemonServiceLifecycleLock(meta, callback);\n}\n\nexport function withDaemonServiceReconcileLock<T>(\n callback: () => Promise<T>,\n meta: DaemonLifecycleLockMeta = {\n intent: \"upgrade_reconcile\",\n command: \"openmeld service update\",\n }\n): Promise<T> {\n return withDaemonServiceLifecycleLock(meta, callback);\n}\n\nexport function withDaemonServiceRegistrationMutationLock<T>(\n callback: () => Promise<T>,\n meta: DaemonLifecycleLockMeta\n): Promise<T> {\n return withDaemonServiceLifecycleLock(meta, callback);\n}\n\nexport function withDaemonServiceLifecycleLock<T>(\n meta: DaemonLifecycleLockMeta,\n callback: () => Promise<T>\n): Promise<T> {\n const pathResolution = resolveOpenMeldServiceOwnedPathInput();\n const ownerRoot = resolveOpenMeldRootDir(pathResolution);\n const currentContext = daemonServiceLifecycleLockContext.getStore();\n if (currentContext?.active && currentContext.ownerRoot === ownerRoot) {\n let operation: Promise<T>;\n try {\n operation = callback();\n } catch (error) {\n operation = Promise.reject(error);\n }\n let trackedOperation: Promise<void>;\n trackedOperation = operation\n .then(\n () => undefined,\n (error: unknown) => {\n currentContext.failures.push(error);\n }\n )\n .finally(() => {\n currentContext.pendingOperations.delete(trackedOperation);\n });\n currentContext.pendingOperations.add(trackedOperation);\n return operation;\n }\n return withDaemonServiceLifecycleOwnerLock({\n callback,\n meta,\n ownerRoot,\n pathResolution,\n });\n}\n\nasync function withDaemonServiceLifecycleOwnerLock<T>(input: {\n callback: () => Promise<T>;\n meta: DaemonLifecycleLockMeta;\n ownerRoot: string;\n pathResolution: OpenMeldPathResolutionInput;\n}): Promise<T> {\n const lock = await acquireDaemonServiceLifecycleLock(\n input.meta,\n input.pathResolution\n );\n return await runWithHeldLock({\n lock,\n run: async () => {\n const context: DaemonServiceLifecycleLockContext = {\n lock,\n active: true,\n failures: [],\n ownerRoot: input.ownerRoot,\n pendingOperations: new Set(),\n };\n let outcome: { ok: true; value: T } | { ok: false; error: unknown };\n try {\n outcome = {\n ok: true,\n value: await daemonServiceLifecycleLockContext.run(\n context,\n input.callback\n ),\n };\n } catch (error) {\n outcome = { ok: false, error };\n } finally {\n while (context.pendingOperations.size > 0) {\n await Promise.all([...context.pendingOperations]);\n }\n context.active = false;\n }\n const failures = [\n ...(outcome.ok ? [] : [outcome.error]),\n ...context.failures,\n ].filter(\n (failure, index, allFailures) => allFailures.indexOf(failure) === index\n );\n if (failures.length === 1) {\n throw failures[0];\n }\n if (failures.length > 1) {\n throw new AggregateError(\n failures,\n \"daemon service lifecycle mutation failed in more than one operation\"\n );\n }\n if (!outcome.ok) {\n throw outcome.error;\n }\n return outcome.value;\n },\n releaseContext: {\n command: input.meta.command,\n component: \"daemon_service_lifecycle\",\n intent: input.meta.intent,\n lockKey: DAEMON_SERVICE_LIFECYCLE_LOCK_KEY,\n openMeldProfileId: DAEMON_SERVICE_LIFECYCLE_LOCK_PROFILE,\n },\n });\n}\n\nexport async function readDaemonServiceLifecycleLockMeta(): Promise<DaemonLifecycleLockMeta | null> {\n const meta = await readLockMeta({\n openMeldProfileId: DAEMON_SERVICE_LIFECYCLE_LOCK_PROFILE,\n key: DAEMON_SERVICE_LIFECYCLE_LOCK_KEY,\n pathResolution: resolveOpenMeldServiceOwnedPathInput(),\n });\n if (!meta) {\n return null;\n }\n const intent =\n typeof meta.intent === \"string\"\n ? normalizeDaemonLifecycleIntent(meta.intent)\n : null;\n const command = typeof meta.command === \"string\" ? meta.command.trim() : \"\";\n if (!intent || command.length === 0) {\n return null;\n }\n const pid = typeof meta.pid === \"number\" ? meta.pid : undefined;\n const sessionId =\n typeof meta.sessionId === \"string\" && meta.sessionId.trim().length > 0\n ? meta.sessionId.trim()\n : undefined;\n const at =\n typeof meta.at === \"string\" && meta.at.trim().length > 0\n ? meta.at.trim()\n : undefined;\n return {\n intent,\n command,\n ...(typeof pid === \"number\" ? { pid } : {}),\n ...(sessionId ? { sessionId } : {}),\n ...(at ? { at } : {}),\n };\n}\n\nexport async function readDaemonServiceLifecycleLockMetaWithCleanup(): Promise<DaemonLifecycleLockMeta | null> {\n await tryCleanupStaleLock({\n openMeldProfileId: DAEMON_SERVICE_LIFECYCLE_LOCK_PROFILE,\n key: DAEMON_SERVICE_LIFECYCLE_LOCK_KEY,\n pathResolution: resolveOpenMeldServiceOwnedPathInput(),\n });\n return await readDaemonServiceLifecycleLockMeta();\n}\n\nexport async function installDaemon(input: {\n daemonVersion: string;\n source: DaemonInstallSource;\n}): Promise<DaemonInstallResult> {\n const existingState = await readDaemonInstallState();\n const runtimeExists = await pathExists(daemonRuntimeRootPath());\n if (\n existingState &&\n runtimeExists &&\n existingState.daemonVersion === input.daemonVersion\n ) {\n await ensureDaemonTokenState();\n return {\n status: \"already_installed\",\n state: existingState,\n };\n }\n\n await ensureDaemonRuntimeLayout();\n const now = new Date().toISOString();\n const nextState: DaemonInstallState = {\n v: 1,\n schema: DAEMON_STATE_SCHEMA,\n daemonVersion: input.daemonVersion,\n installSource: input.source,\n installedAt: existingState?.installedAt ?? now,\n updatedAt: now,\n };\n await writeDaemonInstallState(nextState);\n await ensureDaemonTokenState();\n\n return {\n status: \"installed\",\n state: nextState,\n };\n}\n\nexport async function uninstallDaemon(\n pathInput: OpenMeldPathResolutionInput = {}\n): Promise<DaemonUninstallResult> {\n const [hasState, hasRuntimeDir, hasToken] = await Promise.all([\n pathExists(daemonStatePath(pathInput)),\n pathExists(daemonRuntimeRootPath(pathInput)),\n pathExists(daemonTokenPath(pathInput)),\n ]);\n\n await Promise.all([\n rm(daemonStatePath(pathInput), { force: true }),\n rm(daemonTokenPath(pathInput), { force: true }),\n rm(daemonServiceRuntimeStatePath(pathInput), { force: true }),\n rm(daemonRuntimeRootPath(pathInput), { recursive: true, force: true }),\n ]);\n\n return {\n removed: hasState || hasRuntimeDir || hasToken,\n };\n}\n\nexport function daemonStatePath(\n pathInput: OpenMeldPathResolutionInput = {}\n): string {\n return join(systemDir(pathInput), \"daemon-install.json\");\n}\n\nexport function daemonRuntimeRootPath(\n pathInput: OpenMeldPathResolutionInput = {}\n): string {\n return join(runtimeDir(pathInput), \"daemon\");\n}\n\nexport function daemonServiceRuntimeStatePath(\n pathInput: OpenMeldPathResolutionInput = {}\n): string {\n return join(daemonRuntimeRootPath(pathInput), \"service-runtime.json\");\n}\n\nexport function daemonRuntimeDataPath(\n pathInput: OpenMeldPathResolutionInput = {}\n): string {\n return join(daemonRuntimeRootPath(pathInput), \"data\");\n}\n\nexport function daemonRuntimeBundlesPath(\n pathInput: OpenMeldPathResolutionInput = {}\n): string {\n return join(daemonRuntimeRootPath(pathInput), \"bundles\");\n}\n\nexport function daemonRuntimeStateRootPath(\n pathInput: OpenMeldPathResolutionInput = {}\n): string {\n return join(daemonRuntimeRootPath(pathInput), \"state\");\n}\n\nexport function daemonLifecycleJournalPath(\n pathInput: OpenMeldPathResolutionInput = {}\n): string {\n return join(\n daemonRuntimeRootPath(pathInput),\n \"logs\",\n DAEMON_LIFECYCLE_JOURNAL_FILENAME\n );\n}\n\nexport function daemonDispatchJournalPath(\n pathInput: OpenMeldPathResolutionInput = {}\n): string {\n return join(\n daemonRuntimeRootPath(pathInput),\n \"logs\",\n DAEMON_DISPATCH_JOURNAL_FILENAME\n );\n}\n\nexport function daemonServiceActiveBundleStatePath(\n pathInput: OpenMeldPathResolutionInput = {}\n): string {\n return join(\n daemonRuntimeStateRootPath(pathInput),\n DAEMON_ACTIVE_BUNDLE_STATE_FILENAME\n );\n}\n\nexport function daemonServiceRepairJournalPath(\n pathInput: OpenMeldPathResolutionInput = {}\n): string {\n return join(\n daemonRuntimeStateRootPath(pathInput),\n DAEMON_REPAIR_JOURNAL_FILENAME\n );\n}\n\nexport function daemonRuntimeServiceManagerPath(\n pathInput: OpenMeldPathResolutionInput = {}\n): string {\n return join(daemonRuntimeRootPath(pathInput), \"service-manager\");\n}\n\nexport function daemonServiceStableLauncherPath(\n pathInput: OpenMeldPathResolutionInput = {}\n): string {\n return join(\n daemonRuntimeServiceManagerPath(pathInput),\n DAEMON_STABLE_LAUNCHER_FILENAME\n );\n}\n\nexport function daemonServiceStableExecutableWrapperPath(\n pathInput: OpenMeldPathResolutionInput = {}\n): string {\n const preset = resolveOpenMeldEnvPreset(pathInput);\n return join(\n daemonRuntimeServiceManagerPath(pathInput),\n DAEMON_SERVICE_EXECUTABLE_WRAPPER_FILENAME_BY_PRESET[preset]\n );\n}\n\nexport function daemonServiceStableBinaryExecutablePath(\n pathInput: OpenMeldPathResolutionInput = {}\n): string {\n const preset = resolveOpenMeldEnvPreset(pathInput);\n return join(\n daemonRuntimeServiceManagerPath(pathInput),\n DAEMON_SERVICE_BINARY_EXECUTABLE_FILENAME_BY_PRESET[preset]\n );\n}\n\nexport function daemonServiceUpdateWorkerBinaryExecutablePath(\n pathInput: OpenMeldPathResolutionInput = {}\n): string {\n const preset = resolveOpenMeldEnvPreset(pathInput);\n return join(\n daemonRuntimeServiceManagerPath(pathInput),\n DAEMON_SERVICE_UPDATE_WORKER_BINARY_FILENAME_BY_PRESET[preset]\n );\n}\n\nexport function daemonServiceLegacyExecutableWrapperPath(\n pathInput: OpenMeldPathResolutionInput = {}\n): string {\n const preset = resolveOpenMeldEnvPreset(pathInput);\n return join(\n daemonRuntimeServiceManagerPath(pathInput),\n DAEMON_SERVICE_LEGACY_EXECUTABLE_WRAPPER_FILENAME_BY_PRESET[preset]\n );\n}\n\nexport function daemonServiceExecutableWrapperPaths(\n pathInput: OpenMeldPathResolutionInput = {}\n): string[] {\n return [\n daemonServiceStableExecutableWrapperPath(pathInput),\n daemonServiceLegacyExecutableWrapperPath(pathInput),\n ];\n}\n\nexport function daemonServiceRecognizedExecutablePaths(\n pathInput: OpenMeldPathResolutionInput = {}\n): string[] {\n return [\n daemonServiceStableBinaryExecutablePath(pathInput),\n ...daemonServiceExecutableWrapperPaths(pathInput),\n ];\n}\n\nexport function daemonTokenPath(\n pathInput: OpenMeldPathResolutionInput = {}\n): string {\n return join(systemDir(pathInput), \"daemon-token.json\");\n}\n\nexport async function restoreDaemonInstallStateSnapshot(\n snapshot: DaemonInstallState | null,\n pathInput: OpenMeldPathResolutionInput = {}\n): Promise<void> {\n if (!snapshot) {\n await rm(daemonStatePath(pathInput), { force: true });\n return;\n }\n await writeDaemonInstallState(snapshot, pathInput);\n}\n\nexport function resolveDaemonControlPlaneEndpoint(\n pathInput: OpenMeldPathResolutionInput = {}\n): string {\n const runtimeRoot = daemonRuntimeRootPath(pathInput);\n const suffix = createHash(\"sha256\")\n .update(runtimeRoot)\n .digest(\"hex\")\n .slice(0, 24);\n if (process.platform === \"win32\") {\n return `\\\\\\\\.\\\\pipe\\\\openmeld-daemon-control-${suffix}`;\n }\n return join(tmpdir(), `openmeld-daemon-control-${suffix}.sock`);\n}\n\nexport async function ensureDaemonControlPlaneToken(\n pathInput: OpenMeldPathResolutionInput = {}\n): Promise<string> {\n const state = await ensureDaemonTokenState(pathInput);\n return state.token;\n}\n\nexport async function rotateDaemonControlPlaneTokenIfExpired(\n pathInput: OpenMeldPathResolutionInput = {}\n): Promise<DaemonTokenState> {\n const current = await readDaemonTokenState(pathInput);\n if (current && !isDaemonTokenExpired(current)) {\n await chmod(daemonTokenPath(pathInput), 0o600).catch(() => undefined);\n return current;\n }\n\n return await writeNewDaemonTokenState(pathInput);\n}\n\nexport async function readDaemonControlPlaneToken(\n pathInput: OpenMeldPathResolutionInput = {}\n): Promise<string | null> {\n const state = await readDaemonTokenState(pathInput);\n return state?.token ?? null;\n}\n\nfunction isPidAlive(pid: number): boolean {\n try {\n process.kill(pid, 0);\n return true;\n } catch (error) {\n return !(\n error instanceof Error &&\n (error as NodeJS.ErrnoException).code === \"ESRCH\"\n );\n }\n}\n\nasync function readDaemonServiceRuntimeState(\n pathInput: OpenMeldPathResolutionInput = {}\n): Promise<DaemonServiceRuntimeState | null> {\n const raw = await readFile(\n daemonServiceRuntimeStatePath(pathInput),\n \"utf8\"\n ).catch((error) => {\n if (\n error &&\n typeof error === \"object\" &&\n \"code\" in error &&\n error.code === \"ENOENT\"\n ) {\n return null;\n }\n throw error;\n });\n if (raw === null) {\n return null;\n }\n return parseDaemonServiceRuntimeState(raw);\n}\n\nfunction parseDaemonServiceRuntimeState(\n raw: string\n): DaemonServiceRuntimeState | null {\n try {\n const parsed = JSON.parse(raw);\n if (!isDaemonServiceRuntimeStateObject(parsed)) {\n return null;\n }\n\n return {\n v: 1,\n schema: DAEMON_SERVICE_RUNTIME_STATE_SCHEMA,\n status: \"running\",\n pid: parsed.pid,\n mode: parsed.mode,\n command: parsed.command,\n gatewayUrl: parseNullableString(parsed.gatewayUrl),\n openMeldProfileId: resolveStoredDaemonServiceOpenMeldProfileId(parsed),\n stopRequestedAt: parseNullableString(parsed.stopRequestedAt),\n heartbeatAt: parseNullableString(parsed.heartbeatAt),\n startedAt: parsed.startedAt,\n updatedAt: parsed.updatedAt,\n managedBySystemService: parsed.managedBySystemService === true,\n serviceController: parseDaemonServiceController(parsed.serviceController),\n autoStart: parsed.autoStart === true,\n };\n } catch {\n return null;\n }\n}\n\nfunction isDaemonServiceRuntimeStateObject(value: unknown): value is {\n v: 1;\n schema: string;\n status: \"running\";\n pid: number;\n mode: DaemonRunMode;\n command: string;\n gatewayUrl: string | null;\n openMeldProfileId?: string | null;\n profile?: string | null;\n stopRequestedAt: string | null;\n heartbeatAt: string | null;\n startedAt: string;\n updatedAt: string;\n managedBySystemService?: boolean;\n serviceController?: string;\n autoStart?: boolean;\n} {\n if (!value || typeof value !== \"object\") {\n return false;\n }\n const candidate = value as Record<string, unknown>;\n return (\n candidate.v === 1 &&\n candidate.schema === DAEMON_SERVICE_RUNTIME_STATE_SCHEMA &&\n candidate.status === \"running\" &&\n typeof candidate.pid === \"number\" &&\n candidate.pid > 0 &&\n (candidate.mode === \"foreground\" || candidate.mode === \"background\") &&\n typeof candidate.command === \"string\" &&\n candidate.command.length > 0 &&\n isValidNullableString(candidate.gatewayUrl) &&\n isValidOptionalNullableString(candidate.openMeldProfileId) &&\n isValidOptionalNullableString(candidate.profile) &&\n isValidNullableString(candidate.stopRequestedAt) &&\n isValidNullableString(candidate.heartbeatAt) &&\n typeof candidate.startedAt === \"string\" &&\n candidate.startedAt.length > 0 &&\n typeof candidate.updatedAt === \"string\" &&\n candidate.updatedAt.length > 0\n );\n}\n\nexport function parseDaemonServiceController(\n value: unknown\n): DaemonServiceController {\n if (\n value === \"launchd\" ||\n value === \"systemd\" ||\n value === \"windows-service\" ||\n value === \"legacy-detached\" ||\n value === \"unknown\"\n ) {\n return value;\n }\n return \"unknown\";\n}\n\nfunction isValidNullableString(value: unknown): value is string | null {\n return value === null || typeof value === \"string\";\n}\n\nfunction isValidOptionalNullableString(\n value: unknown\n): value is string | null | undefined {\n return value === undefined || value === null || typeof value === \"string\";\n}\n\nfunction parseNullableString(value: unknown): string | null {\n if (value === null) {\n return null;\n }\n if (typeof value !== \"string\") {\n return null;\n }\n return value;\n}\n\nfunction resolveStoredDaemonServiceOpenMeldProfileId(input: {\n openMeldProfileId?: unknown;\n profile?: unknown;\n}): string | null {\n const openMeldProfileId = parseNullableString(input.openMeldProfileId);\n const legacyProfile = parseNullableString(input.profile);\n if (\n openMeldProfileId &&\n legacyProfile &&\n openMeldProfileId !== legacyProfile\n ) {\n throw new Error(\"conflicting openMeldProfileId values\");\n }\n return openMeldProfileId ?? legacyProfile;\n}\n\nexport function isDaemonServiceRuntimeHeartbeatStale(\n state: DaemonServiceRuntimeState\n): boolean {\n const latestSignalAt = Math.max(\n parseIsoTimestampOrZero(state.heartbeatAt),\n parseIsoTimestampOrZero(state.updatedAt)\n );\n if (latestSignalAt <= 0) {\n return false;\n }\n return Date.now() - latestSignalAt > DAEMON_HEARTBEAT_STALE_MS;\n}\n\nfunction parseIsoTimestampOrZero(value: string | null): number {\n if (!value) {\n return 0;\n }\n const parsed = Date.parse(value);\n return Number.isFinite(parsed) ? parsed : 0;\n}\n\nasync function writeDaemonServiceRuntimeState(\n state: DaemonServiceRuntimeState,\n pathInput: OpenMeldPathResolutionInput = {}\n): Promise<void> {\n const path = daemonServiceRuntimeStatePath(pathInput);\n const runtimeRootPath = daemonRuntimeRootPath(pathInput);\n await mkdir(runtimeRootPath, { recursive: true });\n const tempPath = `${path}.tmp-${process.pid}-${Date.now()}`;\n let shouldCleanupTemp = true;\n\n try {\n await writeFile(tempPath, `${JSON.stringify(state, null, 2)}\\n`, {\n encoding: \"utf8\",\n mode: 0o600,\n });\n await rename(tempPath, path);\n await chmod(path, 0o600);\n shouldCleanupTemp = false;\n } finally {\n if (shouldCleanupTemp) {\n await rm(tempPath, { force: true }).catch(() => undefined);\n }\n }\n}\n\nasync function ensureDaemonRuntimeLayout(): Promise<void> {\n await Promise.all([\n mkdir(systemDir(), { recursive: true }),\n mkdir(join(daemonRuntimeRootPath(), \"bin\"), { recursive: true }),\n mkdir(daemonRuntimeBundlesPath(), { recursive: true }),\n mkdir(join(daemonRuntimeRootPath(), \"data\"), { recursive: true }),\n mkdir(join(daemonRuntimeRootPath(), \"logs\"), { recursive: true }),\n mkdir(daemonRuntimeStateRootPath(), { recursive: true }),\n mkdir(daemonRuntimeServiceManagerPath(), { recursive: true }),\n ]);\n}\n\nfunction normalizeDaemonLifecycleIntent(\n value: string\n): DaemonLifecycleIntent | null {\n switch (value) {\n case \"run_background\":\n case \"run_foreground\":\n case \"stop\":\n case \"autostart\":\n case \"status_cleanup\":\n case \"startup_check\":\n case \"start\":\n case \"reinstall\":\n case \"uninstall\":\n case \"upgrade_reconcile\":\n return value;\n default:\n return null;\n }\n}\n\nasync function ensureDaemonTokenState(\n pathInput: OpenMeldPathResolutionInput = {}\n): Promise<DaemonTokenState> {\n const current = await readDaemonTokenState(pathInput);\n if (current) {\n await chmod(daemonTokenPath(pathInput), 0o600).catch(() => undefined);\n return current;\n }\n\n return await writeNewDaemonTokenState(pathInput);\n}\n\nasync function writeNewDaemonTokenState(\n pathInput: OpenMeldPathResolutionInput\n): Promise<DaemonTokenState> {\n const nowIso = new Date().toISOString();\n const next: DaemonTokenState = {\n v: 1,\n schema: DAEMON_TOKEN_SCHEMA,\n token: createDaemonTokenValue(),\n issuedAt: nowIso,\n updatedAt: nowIso,\n };\n await writeDaemonTokenState(next, pathInput);\n return next;\n}\n\nasync function readDaemonInstallState(\n pathInput: OpenMeldPathResolutionInput = {}\n): Promise<DaemonInstallState | null> {\n const raw = await readFile(daemonStatePath(pathInput), \"utf8\").catch(\n (error) => {\n if (\n error &&\n typeof error === \"object\" &&\n \"code\" in error &&\n error.code === \"ENOENT\"\n ) {\n return null;\n }\n throw error;\n }\n );\n if (raw === null) {\n return null;\n }\n return parseDaemonInstallState(raw);\n}\n\nfunction parseDaemonInstallState(raw: string): DaemonInstallState | null {\n try {\n const parsed = JSON.parse(raw) as Partial<DaemonInstallState>;\n if (parsed.v !== 1) {\n return null;\n }\n if (parsed.schema !== DAEMON_STATE_SCHEMA) {\n return null;\n }\n if (typeof parsed.daemonVersion !== \"string\" || !parsed.daemonVersion) {\n return null;\n }\n if (!isDaemonInstallSource(parsed.installSource)) {\n return null;\n }\n if (typeof parsed.installedAt !== \"string\" || !parsed.installedAt) {\n return null;\n }\n if (typeof parsed.updatedAt !== \"string\" || !parsed.updatedAt) {\n return null;\n }\n return {\n v: 1,\n schema: DAEMON_STATE_SCHEMA,\n daemonVersion: parsed.daemonVersion,\n installSource: parsed.installSource,\n installedAt: parsed.installedAt,\n updatedAt: parsed.updatedAt,\n };\n } catch {\n return null;\n }\n}\n\nfunction isDaemonInstallSource(value: unknown): value is DaemonInstallSource {\n return value === \"cli.auto_check\" || value === \"daemon.command.install\";\n}\n\nasync function writeDaemonInstallState(\n state: DaemonInstallState,\n pathInput: OpenMeldPathResolutionInput = {}\n): Promise<void> {\n const path = daemonStatePath(pathInput);\n await mkdir(systemDir(pathInput), { recursive: true });\n const tempPath = `${path}.tmp-${process.pid}-${Date.now()}`;\n let shouldCleanupTemp = true;\n\n try {\n await writeFile(tempPath, `${JSON.stringify(state, null, 2)}\\n`, \"utf8\");\n await rename(tempPath, path);\n shouldCleanupTemp = false;\n } finally {\n if (shouldCleanupTemp) {\n await rm(tempPath, { force: true }).catch(() => undefined);\n }\n }\n}\n\nasync function readDaemonTokenState(\n pathInput: OpenMeldPathResolutionInput = {}\n): Promise<DaemonTokenState | null> {\n const raw = await readFile(daemonTokenPath(pathInput), \"utf8\").catch(\n (error) => {\n if (\n error &&\n typeof error === \"object\" &&\n \"code\" in error &&\n error.code === \"ENOENT\"\n ) {\n return null;\n }\n throw error;\n }\n );\n if (raw === null) {\n return null;\n }\n return parseDaemonTokenState(raw);\n}\n\nfunction parseDaemonTokenState(raw: string): DaemonTokenState | null {\n try {\n const parsed = JSON.parse(raw) as Partial<DaemonTokenState>;\n if (parsed.v !== 1 || parsed.schema !== DAEMON_TOKEN_SCHEMA) {\n return null;\n }\n if (typeof parsed.token !== \"string\" || parsed.token.length < 16) {\n return null;\n }\n if (typeof parsed.issuedAt !== \"string\" || !parsed.issuedAt) {\n return null;\n }\n if (typeof parsed.updatedAt !== \"string\" || !parsed.updatedAt) {\n return null;\n }\n return {\n v: 1,\n schema: DAEMON_TOKEN_SCHEMA,\n token: parsed.token,\n issuedAt: parsed.issuedAt,\n updatedAt: parsed.updatedAt,\n };\n } catch {\n return null;\n }\n}\n\nasync function writeDaemonTokenState(\n state: DaemonTokenState,\n pathInput: OpenMeldPathResolutionInput = {}\n): Promise<void> {\n const path = daemonTokenPath(pathInput);\n await mkdir(systemDir(pathInput), { recursive: true });\n const tempPath = `${path}.tmp-${process.pid}-${Date.now()}`;\n let shouldCleanupTemp = true;\n\n try {\n await writeFile(tempPath, `${JSON.stringify(state, null, 2)}\\n`, {\n encoding: \"utf8\",\n mode: 0o600,\n });\n await rename(tempPath, path);\n await chmod(path, 0o600);\n shouldCleanupTemp = false;\n } finally {\n if (shouldCleanupTemp) {\n await rm(tempPath, { force: true }).catch(() => undefined);\n }\n }\n}\n\nfunction isDaemonTokenExpired(state: DaemonTokenState): boolean {\n const updatedAtMs = Date.parse(state.updatedAt);\n if (!Number.isFinite(updatedAtMs)) {\n return true;\n }\n return Date.now() - updatedAtMs >= DAEMON_TOKEN_ROTATE_MAX_AGE_MS;\n}\n\nfunction createDaemonTokenValue(): string {\n return randomBytes(32).toString(\"base64url\");\n}\n\nasync function pathExists(path: string): Promise<boolean> {\n try {\n await stat(path);\n return true;\n } catch (error) {\n if (\n error &&\n typeof error === \"object\" &&\n \"code\" in error &&\n error.code === \"ENOENT\"\n ) {\n return false;\n }\n throw error;\n }\n}\n"],"mappings":";;;;;;;;;AA8BA,MAAM,sBAAsB;AAC5B,MAAa,sCACX;AACF,MAAa,kCAAkC;AAC/C,MAAa,sCACX;AACF,MAAa,wCACX;AACF,MAAa,wCACX;AACF,MAAa,4CACX;AACF,MAAM,sBAAsB;AAC5B,MAAM,iCAAiC,OAAU,KAAK;AACtD,MAAa,4BAA4B,MAAS;AAClD,MAAM,sCAAsC;AAC5C,MAAM,mCAAmC;AACzC,MAAM,oCAAoC;AAC1C,MAAM,iCAAiC;AACvC,MAAM,8BAA8B;AACpC,MAAM,0BAA0B;AAQhC,MAAM,oCACJ,IAAI,kBAAqD;AAE3D,SAAgB,oCAAyD;CACvE,MAAM,UAAU,kCAAkC,SAAS;CAC3D,OAAO,SAAS,UACd,QAAQ,cACN,uBAAuB,qCAAqC,CAAC,IAC7D,QAAQ,OACR;AACN;AACA,MAAM,kCAAkC;AACxC,MAAM,uDAAuD;CAC3D,MAAM;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3,"file":"daemon-state-Ca0WK5x0.js","names":[],"sources":["../src/config/daemon-state.ts"],"sourcesContent":["import { AsyncLocalStorage } from \"node:async_hooks\";\nimport { createHash, randomBytes } from \"node:crypto\";\nimport {\n chmod,\n mkdir,\n readFile,\n rename,\n rm,\n stat,\n writeFile,\n} from \"node:fs/promises\";\nimport { tmpdir } from \"node:os\";\nimport { join } from \"node:path\";\nimport {\n acquireLock,\n type OpenMeldLock,\n readLockMeta,\n releaseLock,\n runWithHeldLock,\n tryCleanupStaleLock,\n} from \"./lock\";\nimport type { OpenMeldEnvPreset, OpenMeldPathResolutionInput } from \"./paths\";\nimport {\n resolveOpenMeldEnvPreset,\n resolveOpenMeldRootDir,\n resolveOpenMeldServiceOwnedPathInput,\n runtimeDir,\n systemDir,\n} from \"./paths\";\n\nconst DAEMON_STATE_SCHEMA = \"openmeld-daemon-install-v1\";\nexport const DAEMON_SERVICE_RUNTIME_STATE_SCHEMA =\n \"openmeld-daemon-service-state-v1\";\nexport const DAEMON_SERVICE_RUNTIME_MODE_ENV = \"OPENMELD_DAEMON_RUNTIME_MODE\";\nexport const DAEMON_SERVICE_RUNTIME_DETACHED_ENV =\n \"OPENMELD_DAEMON_RUNTIME_DETACHED\";\nexport const DAEMON_SERVICE_RUNTIME_CONTROLLER_ENV =\n \"OPENMELD_DAEMON_SERVICE_CONTROLLER\";\nexport const DAEMON_SERVICE_RUNTIME_AUTO_START_ENV =\n \"OPENMELD_DAEMON_SERVICE_AUTO_START\";\nexport const DAEMON_SERVICE_RUNTIME_SYSTEM_SERVICE_ENV =\n \"OPENMELD_DAEMON_RUNTIME_SYSTEM_SERVICE\";\nconst DAEMON_TOKEN_SCHEMA = \"openmeld-daemon-token-v1\";\nconst DAEMON_TOKEN_ROTATE_MAX_AGE_MS = 24 * 60 * 60 * 1000;\nexport const DAEMON_HEARTBEAT_STALE_MS = 3 * 60 * 1000;\nconst DAEMON_ACTIVE_BUNDLE_STATE_FILENAME = \"active-bundle.json\";\nconst DAEMON_DISPATCH_JOURNAL_FILENAME = \"daemon-dispatch-journal.jsonl\";\nconst DAEMON_LIFECYCLE_JOURNAL_FILENAME = \"daemon-lifecycle-journal.jsonl\";\nconst DAEMON_REPAIR_JOURNAL_FILENAME = \"repair-journal.json\";\nconst DAEMON_SERVICE_LOCK_PROFILE = \"daemon-service\";\nconst DAEMON_SERVICE_LOCK_KEY = \"daemon-service-run\";\ntype DaemonServiceLifecycleLockContext = {\n lock: OpenMeldLock;\n active: boolean;\n failures: unknown[];\n ownerRoot: string;\n pendingOperations: Set<Promise<void>>;\n};\nconst daemonServiceLifecycleLockContext =\n new AsyncLocalStorage<DaemonServiceLifecycleLockContext>();\n\nexport function currentDaemonServiceLifecycleLock(): OpenMeldLock | null {\n const context = daemonServiceLifecycleLockContext.getStore();\n return context?.active &&\n context.ownerRoot ===\n resolveOpenMeldRootDir(resolveOpenMeldServiceOwnedPathInput())\n ? context.lock\n : null;\n}\nconst DAEMON_STABLE_LAUNCHER_FILENAME = \"daemon-service-launcher.mjs\";\nconst DAEMON_SERVICE_EXECUTABLE_WRAPPER_FILENAME_BY_PRESET = {\n prod: \"OpenMeld Service\",\n \"dev-local\": \"OpenMeld Service Dev\",\n canary: \"OpenMeld Service Canary\",\n} as const satisfies Record<OpenMeldEnvPreset, string>;\nconst DAEMON_SERVICE_BINARY_EXECUTABLE_FILENAME_BY_PRESET = {\n prod: \"OpenMeld Service Binary\",\n \"dev-local\": \"OpenMeld Service Binary Dev\",\n canary: \"OpenMeld Service Binary Canary\",\n} as const satisfies Record<OpenMeldEnvPreset, string>;\nconst DAEMON_SERVICE_UPDATE_WORKER_BINARY_FILENAME_BY_PRESET = {\n prod: \"OpenMeld Update Worker Binary\",\n \"dev-local\": \"OpenMeld Update Worker Binary Dev\",\n canary: \"OpenMeld Update Worker Binary Canary\",\n} as const satisfies Record<OpenMeldEnvPreset, string>;\nconst DAEMON_SERVICE_LEGACY_EXECUTABLE_WRAPPER_FILENAME_BY_PRESET = {\n prod: \"openmeld-service\",\n \"dev-local\": \"openmeld-dev-service\",\n canary: \"openmeld-canary-service\",\n} as const satisfies Record<OpenMeldEnvPreset, string>;\nexport const DAEMON_SERVICE_LIFECYCLE_LOCK_PROFILE =\n DAEMON_SERVICE_LOCK_PROFILE;\nexport const DAEMON_SERVICE_LIFECYCLE_LOCK_KEY = DAEMON_SERVICE_LOCK_KEY;\nexport type DaemonServiceLifecycleLock = OpenMeldLock;\n\nexport type DaemonLifecycleIntent =\n | \"run_background\"\n | \"run_foreground\"\n | \"stop\"\n | \"autostart\"\n | \"status_cleanup\"\n | \"startup_check\"\n | \"start\"\n | \"reinstall\"\n | \"uninstall\"\n | \"upgrade_reconcile\";\n\nexport type DaemonLifecycleLockMeta = {\n intent: DaemonLifecycleIntent;\n command: string;\n pid?: number;\n sessionId?: string;\n at?: string;\n};\n\nexport type DaemonInstallSource = \"cli.auto_check\" | \"daemon.command.install\";\nexport type DaemonRunMode = \"foreground\" | \"background\";\nexport type DaemonServiceController =\n | \"launchd\"\n | \"systemd\"\n | \"windows-service\"\n | \"legacy-detached\"\n | \"unknown\";\n\ntype BaseDaemonServiceRuntimeState = {\n mode: DaemonRunMode;\n command: string;\n gatewayUrl: string | null;\n openMeldProfileId: string | null;\n stopRequestedAt: string | null;\n startedAt: string;\n updatedAt: string;\n heartbeatAt: string | null;\n managedBySystemService: boolean;\n serviceController: DaemonServiceController;\n autoStart: boolean;\n};\n\nexport type DaemonServiceRuntimeState = BaseDaemonServiceRuntimeState & {\n v: 1;\n schema: typeof DAEMON_SERVICE_RUNTIME_STATE_SCHEMA;\n status: \"running\";\n pid: number;\n};\n\nexport type DaemonServiceRuntimeStatus = {\n status: \"running\" | \"stale\" | \"not_running\" | \"unknown\";\n mode: DaemonRunMode | null;\n pid: number | null;\n startedAt: string | null;\n updatedAt: string | null;\n managedBySystemService: boolean;\n serviceController: DaemonServiceRuntimeState[\"serviceController\"];\n autoStart: boolean;\n reason?: string;\n};\n\nexport type DaemonServiceRuntimeMetadataInput = {\n managedBySystemService?: boolean;\n serviceController?: string;\n autoStart?: boolean;\n env?: NodeJS.ProcessEnv;\n};\n\nexport type DaemonServiceRuntimeMetadata = {\n managedBySystemService: boolean;\n serviceController: DaemonServiceController;\n autoStart: boolean;\n};\n\nexport type DaemonInstallState = {\n v: 1;\n schema: typeof DAEMON_STATE_SCHEMA;\n daemonVersion: string;\n installSource: DaemonInstallSource;\n installedAt: string;\n updatedAt: string;\n};\n\nexport type DaemonTokenState = {\n v: 1;\n schema: typeof DAEMON_TOKEN_SCHEMA;\n token: string;\n issuedAt: string;\n updatedAt: string;\n};\n\nexport type DaemonInstallResult = {\n status: \"installed\" | \"already_installed\";\n state: DaemonInstallState;\n};\n\nexport type DaemonUninstallResult = {\n removed: boolean;\n};\n\nexport type DaemonStatus =\n | {\n installed: true;\n state: DaemonInstallState;\n }\n | {\n installed: false;\n state: null;\n };\n\nexport async function getDaemonStatus(\n pathInput: OpenMeldPathResolutionInput = {}\n): Promise<DaemonStatus> {\n const [state, runtimeExists] = await Promise.all([\n readDaemonInstallState(pathInput),\n pathExists(daemonRuntimeRootPath(pathInput)),\n ]);\n if (state && runtimeExists) {\n return {\n installed: true,\n state,\n };\n }\n return {\n installed: false,\n state: null,\n };\n}\n\nexport async function getDaemonRuntimeStatus(\n pathInput: OpenMeldPathResolutionInput = {}\n): Promise<DaemonServiceRuntimeStatus> {\n const state = await readDaemonServiceRuntimeState(pathInput);\n if (!state) {\n return {\n status: \"not_running\",\n mode: null,\n pid: null,\n startedAt: null,\n updatedAt: null,\n managedBySystemService: false,\n serviceController: \"unknown\",\n autoStart: false,\n };\n }\n if (!Number.isInteger(state.pid) || state.pid <= 0) {\n return {\n status: \"stale\",\n mode: state.mode,\n pid: state.pid,\n startedAt: state.startedAt,\n updatedAt: state.updatedAt,\n managedBySystemService: state.managedBySystemService,\n serviceController: state.serviceController,\n autoStart: state.autoStart,\n reason: \"invalid_pid\",\n };\n }\n if (!isPidAlive(state.pid)) {\n return {\n status: \"stale\",\n mode: state.mode,\n pid: state.pid,\n startedAt: state.startedAt,\n updatedAt: state.updatedAt,\n managedBySystemService: state.managedBySystemService,\n serviceController: state.serviceController,\n autoStart: state.autoStart,\n reason: \"process_not_alive\",\n };\n }\n if (isDaemonServiceRuntimeHeartbeatStale(state)) {\n return {\n status: \"stale\",\n mode: state.mode,\n pid: state.pid,\n startedAt: state.startedAt,\n updatedAt: state.updatedAt,\n managedBySystemService: state.managedBySystemService,\n serviceController: state.serviceController,\n autoStart: state.autoStart,\n reason: \"heartbeat_stale\",\n };\n }\n return {\n status: \"running\",\n mode: state.mode,\n pid: state.pid,\n startedAt: state.startedAt,\n updatedAt: state.updatedAt,\n managedBySystemService: state.managedBySystemService,\n serviceController: state.serviceController,\n autoStart: state.autoStart,\n };\n}\n\nexport async function readDaemonServiceRuntimeSnapshot(\n pathInput: OpenMeldPathResolutionInput = {}\n): Promise<DaemonServiceRuntimeState | null> {\n return await readDaemonServiceRuntimeState(pathInput);\n}\n\nexport function resolveDaemonServiceRuntimeMetadata(\n input: DaemonServiceRuntimeMetadataInput = {}\n): DaemonServiceRuntimeMetadata {\n const env = input.env ?? process.env;\n const managedBySystemService =\n input.managedBySystemService === true ||\n env[DAEMON_SERVICE_RUNTIME_SYSTEM_SERVICE_ENV] === \"1\";\n const serviceControllerInput =\n typeof input.serviceController === \"string\" &&\n input.serviceController.length > 0\n ? input.serviceController\n : env[DAEMON_SERVICE_RUNTIME_CONTROLLER_ENV];\n const autoStart =\n input.autoStart === true ||\n env[DAEMON_SERVICE_RUNTIME_AUTO_START_ENV] === \"1\";\n\n return {\n managedBySystemService,\n serviceController: parseDaemonServiceController(serviceControllerInput),\n autoStart,\n };\n}\n\nexport async function setDaemonServiceRuntimeState(\n state: DaemonServiceRuntimeState,\n pathInput: OpenMeldPathResolutionInput = {}\n): Promise<void> {\n await writeDaemonServiceRuntimeState(state, pathInput);\n}\n\nexport async function clearDaemonServiceRuntimeState(\n pathInput: OpenMeldPathResolutionInput = {}\n): Promise<void> {\n const { clearDaemonRuntimeLease } = await import(\"./daemon-runtime-lease\");\n await Promise.all([\n rm(daemonServiceRuntimeStatePath(pathInput), { force: true }),\n clearDaemonRuntimeLease(pathInput),\n ]);\n}\n\nexport function withDaemonServiceRunLock<T>(\n callback: () => Promise<T>,\n meta: DaemonLifecycleLockMeta = {\n intent: \"run_background\",\n command: \"openmeld service start\",\n }\n): Promise<T> {\n return withDaemonServiceLifecycleLock(meta, callback);\n}\n\nexport async function acquireDaemonServiceLifecycleLock(\n meta: DaemonLifecycleLockMeta = {\n intent: \"run_background\",\n command: \"openmeld service start\",\n },\n pathResolution: OpenMeldPathResolutionInput = resolveOpenMeldServiceOwnedPathInput()\n): Promise<DaemonServiceLifecycleLock> {\n return await acquireLock({\n openMeldProfileId: DAEMON_SERVICE_LIFECYCLE_LOCK_PROFILE,\n key: DAEMON_SERVICE_LIFECYCLE_LOCK_KEY,\n meta,\n pathResolution,\n });\n}\n\nexport async function releaseDaemonServiceLifecycleLock(\n lock: DaemonServiceLifecycleLock\n): Promise<void> {\n await releaseLock(lock);\n}\n\nexport function withDaemonServiceStopLock<T>(\n callback: () => Promise<T>,\n meta: DaemonLifecycleLockMeta = {\n intent: \"stop\",\n command: \"openmeld service stop\",\n }\n): Promise<T> {\n return withDaemonServiceLifecycleLock(meta, callback);\n}\n\nexport function withDaemonServiceReconcileLock<T>(\n callback: () => Promise<T>,\n meta: DaemonLifecycleLockMeta = {\n intent: \"upgrade_reconcile\",\n command: \"openmeld service update\",\n }\n): Promise<T> {\n return withDaemonServiceLifecycleLock(meta, callback);\n}\n\nexport function withDaemonServiceRegistrationMutationLock<T>(\n callback: () => Promise<T>,\n meta: DaemonLifecycleLockMeta\n): Promise<T> {\n return withDaemonServiceLifecycleLock(meta, callback);\n}\n\nexport function withDaemonServiceLifecycleLock<T>(\n meta: DaemonLifecycleLockMeta,\n callback: () => Promise<T>\n): Promise<T> {\n const pathResolution = resolveOpenMeldServiceOwnedPathInput();\n const ownerRoot = resolveOpenMeldRootDir(pathResolution);\n const currentContext = daemonServiceLifecycleLockContext.getStore();\n if (currentContext?.active && currentContext.ownerRoot === ownerRoot) {\n let operation: Promise<T>;\n try {\n operation = callback();\n } catch (error) {\n operation = Promise.reject(error);\n }\n let trackedOperation: Promise<void>;\n trackedOperation = operation\n .then(\n () => undefined,\n (error: unknown) => {\n currentContext.failures.push(error);\n }\n )\n .finally(() => {\n currentContext.pendingOperations.delete(trackedOperation);\n });\n currentContext.pendingOperations.add(trackedOperation);\n return operation;\n }\n return withDaemonServiceLifecycleOwnerLock({\n callback,\n meta,\n ownerRoot,\n pathResolution,\n });\n}\n\nasync function withDaemonServiceLifecycleOwnerLock<T>(input: {\n callback: () => Promise<T>;\n meta: DaemonLifecycleLockMeta;\n ownerRoot: string;\n pathResolution: OpenMeldPathResolutionInput;\n}): Promise<T> {\n const lock = await acquireDaemonServiceLifecycleLock(\n input.meta,\n input.pathResolution\n );\n return await runWithHeldLock({\n lock,\n run: async () => {\n const context: DaemonServiceLifecycleLockContext = {\n lock,\n active: true,\n failures: [],\n ownerRoot: input.ownerRoot,\n pendingOperations: new Set(),\n };\n let outcome: { ok: true; value: T } | { ok: false; error: unknown };\n try {\n outcome = {\n ok: true,\n value: await daemonServiceLifecycleLockContext.run(\n context,\n input.callback\n ),\n };\n } catch (error) {\n outcome = { ok: false, error };\n } finally {\n while (context.pendingOperations.size > 0) {\n await Promise.all([...context.pendingOperations]);\n }\n context.active = false;\n }\n const failures = [\n ...(outcome.ok ? [] : [outcome.error]),\n ...context.failures,\n ].filter(\n (failure, index, allFailures) => allFailures.indexOf(failure) === index\n );\n if (failures.length === 1) {\n throw failures[0];\n }\n if (failures.length > 1) {\n throw new AggregateError(\n failures,\n \"daemon service lifecycle mutation failed in more than one operation\"\n );\n }\n if (!outcome.ok) {\n throw outcome.error;\n }\n return outcome.value;\n },\n releaseContext: {\n command: input.meta.command,\n component: \"daemon_service_lifecycle\",\n intent: input.meta.intent,\n lockKey: DAEMON_SERVICE_LIFECYCLE_LOCK_KEY,\n openMeldProfileId: DAEMON_SERVICE_LIFECYCLE_LOCK_PROFILE,\n },\n });\n}\n\nexport async function readDaemonServiceLifecycleLockMeta(): Promise<DaemonLifecycleLockMeta | null> {\n const meta = await readLockMeta({\n openMeldProfileId: DAEMON_SERVICE_LIFECYCLE_LOCK_PROFILE,\n key: DAEMON_SERVICE_LIFECYCLE_LOCK_KEY,\n pathResolution: resolveOpenMeldServiceOwnedPathInput(),\n });\n if (!meta) {\n return null;\n }\n const intent =\n typeof meta.intent === \"string\"\n ? normalizeDaemonLifecycleIntent(meta.intent)\n : null;\n const command = typeof meta.command === \"string\" ? meta.command.trim() : \"\";\n if (!intent || command.length === 0) {\n return null;\n }\n const pid = typeof meta.pid === \"number\" ? meta.pid : undefined;\n const sessionId =\n typeof meta.sessionId === \"string\" && meta.sessionId.trim().length > 0\n ? meta.sessionId.trim()\n : undefined;\n const at =\n typeof meta.at === \"string\" && meta.at.trim().length > 0\n ? meta.at.trim()\n : undefined;\n return {\n intent,\n command,\n ...(typeof pid === \"number\" ? { pid } : {}),\n ...(sessionId ? { sessionId } : {}),\n ...(at ? { at } : {}),\n };\n}\n\nexport async function readDaemonServiceLifecycleLockMetaWithCleanup(): Promise<DaemonLifecycleLockMeta | null> {\n await tryCleanupStaleLock({\n openMeldProfileId: DAEMON_SERVICE_LIFECYCLE_LOCK_PROFILE,\n key: DAEMON_SERVICE_LIFECYCLE_LOCK_KEY,\n pathResolution: resolveOpenMeldServiceOwnedPathInput(),\n });\n return await readDaemonServiceLifecycleLockMeta();\n}\n\nexport async function installDaemon(input: {\n daemonVersion: string;\n source: DaemonInstallSource;\n}): Promise<DaemonInstallResult> {\n const existingState = await readDaemonInstallState();\n const runtimeExists = await pathExists(daemonRuntimeRootPath());\n if (\n existingState &&\n runtimeExists &&\n existingState.daemonVersion === input.daemonVersion\n ) {\n await ensureDaemonTokenState();\n return {\n status: \"already_installed\",\n state: existingState,\n };\n }\n\n await ensureDaemonRuntimeLayout();\n const now = new Date().toISOString();\n const nextState: DaemonInstallState = {\n v: 1,\n schema: DAEMON_STATE_SCHEMA,\n daemonVersion: input.daemonVersion,\n installSource: input.source,\n installedAt: existingState?.installedAt ?? now,\n updatedAt: now,\n };\n await writeDaemonInstallState(nextState);\n await ensureDaemonTokenState();\n\n return {\n status: \"installed\",\n state: nextState,\n };\n}\n\nexport async function uninstallDaemon(\n pathInput: OpenMeldPathResolutionInput = {}\n): Promise<DaemonUninstallResult> {\n const [hasState, hasRuntimeDir, hasToken] = await Promise.all([\n pathExists(daemonStatePath(pathInput)),\n pathExists(daemonRuntimeRootPath(pathInput)),\n pathExists(daemonTokenPath(pathInput)),\n ]);\n\n await Promise.all([\n rm(daemonStatePath(pathInput), { force: true }),\n rm(daemonTokenPath(pathInput), { force: true }),\n rm(daemonServiceRuntimeStatePath(pathInput), { force: true }),\n rm(daemonRuntimeRootPath(pathInput), { recursive: true, force: true }),\n ]);\n\n return {\n removed: hasState || hasRuntimeDir || hasToken,\n };\n}\n\nexport function daemonStatePath(\n pathInput: OpenMeldPathResolutionInput = {}\n): string {\n return join(systemDir(pathInput), \"daemon-install.json\");\n}\n\nexport function daemonRuntimeRootPath(\n pathInput: OpenMeldPathResolutionInput = {}\n): string {\n return join(runtimeDir(pathInput), \"daemon\");\n}\n\nexport function daemonServiceRuntimeStatePath(\n pathInput: OpenMeldPathResolutionInput = {}\n): string {\n return join(daemonRuntimeRootPath(pathInput), \"service-runtime.json\");\n}\n\nexport function daemonRuntimeDataPath(\n pathInput: OpenMeldPathResolutionInput = {}\n): string {\n return join(daemonRuntimeRootPath(pathInput), \"data\");\n}\n\nexport function daemonRuntimeBundlesPath(\n pathInput: OpenMeldPathResolutionInput = {}\n): string {\n return join(daemonRuntimeRootPath(pathInput), \"bundles\");\n}\n\nexport function daemonRuntimeStateRootPath(\n pathInput: OpenMeldPathResolutionInput = {}\n): string {\n return join(daemonRuntimeRootPath(pathInput), \"state\");\n}\n\nexport function daemonLifecycleJournalPath(\n pathInput: OpenMeldPathResolutionInput = {}\n): string {\n return join(\n daemonRuntimeRootPath(pathInput),\n \"logs\",\n DAEMON_LIFECYCLE_JOURNAL_FILENAME\n );\n}\n\nexport function daemonDispatchJournalPath(\n pathInput: OpenMeldPathResolutionInput = {}\n): string {\n return join(\n daemonRuntimeRootPath(pathInput),\n \"logs\",\n DAEMON_DISPATCH_JOURNAL_FILENAME\n );\n}\n\nexport function daemonServiceActiveBundleStatePath(\n pathInput: OpenMeldPathResolutionInput = {}\n): string {\n return join(\n daemonRuntimeStateRootPath(pathInput),\n DAEMON_ACTIVE_BUNDLE_STATE_FILENAME\n );\n}\n\nexport function daemonServiceRepairJournalPath(\n pathInput: OpenMeldPathResolutionInput = {}\n): string {\n return join(\n daemonRuntimeStateRootPath(pathInput),\n DAEMON_REPAIR_JOURNAL_FILENAME\n );\n}\n\nexport function daemonRuntimeServiceManagerPath(\n pathInput: OpenMeldPathResolutionInput = {}\n): string {\n return join(daemonRuntimeRootPath(pathInput), \"service-manager\");\n}\n\nexport function daemonServiceStableLauncherPath(\n pathInput: OpenMeldPathResolutionInput = {}\n): string {\n return join(\n daemonRuntimeServiceManagerPath(pathInput),\n DAEMON_STABLE_LAUNCHER_FILENAME\n );\n}\n\nexport function daemonServiceStableExecutableWrapperPath(\n pathInput: OpenMeldPathResolutionInput = {}\n): string {\n const preset = resolveOpenMeldEnvPreset(pathInput);\n return join(\n daemonRuntimeServiceManagerPath(pathInput),\n DAEMON_SERVICE_EXECUTABLE_WRAPPER_FILENAME_BY_PRESET[preset]\n );\n}\n\nexport function daemonServiceStableBinaryExecutablePath(\n pathInput: OpenMeldPathResolutionInput = {}\n): string {\n const preset = resolveOpenMeldEnvPreset(pathInput);\n return join(\n daemonRuntimeServiceManagerPath(pathInput),\n DAEMON_SERVICE_BINARY_EXECUTABLE_FILENAME_BY_PRESET[preset]\n );\n}\n\nexport function daemonServiceUpdateWorkerBinaryExecutablePath(\n pathInput: OpenMeldPathResolutionInput = {}\n): string {\n const preset = resolveOpenMeldEnvPreset(pathInput);\n return join(\n daemonRuntimeServiceManagerPath(pathInput),\n DAEMON_SERVICE_UPDATE_WORKER_BINARY_FILENAME_BY_PRESET[preset]\n );\n}\n\nexport function daemonServiceLegacyExecutableWrapperPath(\n pathInput: OpenMeldPathResolutionInput = {}\n): string {\n const preset = resolveOpenMeldEnvPreset(pathInput);\n return join(\n daemonRuntimeServiceManagerPath(pathInput),\n DAEMON_SERVICE_LEGACY_EXECUTABLE_WRAPPER_FILENAME_BY_PRESET[preset]\n );\n}\n\nexport function daemonServiceExecutableWrapperPaths(\n pathInput: OpenMeldPathResolutionInput = {}\n): string[] {\n return [\n daemonServiceStableExecutableWrapperPath(pathInput),\n daemonServiceLegacyExecutableWrapperPath(pathInput),\n ];\n}\n\nexport function daemonServiceRecognizedExecutablePaths(\n pathInput: OpenMeldPathResolutionInput = {}\n): string[] {\n return [\n daemonServiceStableBinaryExecutablePath(pathInput),\n ...daemonServiceExecutableWrapperPaths(pathInput),\n ];\n}\n\nexport function daemonTokenPath(\n pathInput: OpenMeldPathResolutionInput = {}\n): string {\n return join(systemDir(pathInput), \"daemon-token.json\");\n}\n\nexport async function restoreDaemonInstallStateSnapshot(\n snapshot: DaemonInstallState | null,\n pathInput: OpenMeldPathResolutionInput = {}\n): Promise<void> {\n if (!snapshot) {\n await rm(daemonStatePath(pathInput), { force: true });\n return;\n }\n await writeDaemonInstallState(snapshot, pathInput);\n}\n\nexport function resolveDaemonControlPlaneEndpoint(\n pathInput: OpenMeldPathResolutionInput = {}\n): string {\n const runtimeRoot = daemonRuntimeRootPath(pathInput);\n const suffix = createHash(\"sha256\")\n .update(runtimeRoot)\n .digest(\"hex\")\n .slice(0, 24);\n if (process.platform === \"win32\") {\n return `\\\\\\\\.\\\\pipe\\\\openmeld-daemon-control-${suffix}`;\n }\n return join(tmpdir(), `openmeld-daemon-control-${suffix}.sock`);\n}\n\nexport async function ensureDaemonControlPlaneToken(\n pathInput: OpenMeldPathResolutionInput = {}\n): Promise<string> {\n const state = await ensureDaemonTokenState(pathInput);\n return state.token;\n}\n\nexport async function rotateDaemonControlPlaneTokenIfExpired(\n pathInput: OpenMeldPathResolutionInput = {}\n): Promise<DaemonTokenState> {\n const current = await readDaemonTokenState(pathInput);\n if (current && !isDaemonTokenExpired(current)) {\n await chmod(daemonTokenPath(pathInput), 0o600).catch(() => undefined);\n return current;\n }\n\n return await writeNewDaemonTokenState(pathInput);\n}\n\nexport async function readDaemonControlPlaneToken(\n pathInput: OpenMeldPathResolutionInput = {}\n): Promise<string | null> {\n const state = await readDaemonTokenState(pathInput);\n return state?.token ?? null;\n}\n\nfunction isPidAlive(pid: number): boolean {\n try {\n process.kill(pid, 0);\n return true;\n } catch (error) {\n return !(\n error instanceof Error &&\n (error as NodeJS.ErrnoException).code === \"ESRCH\"\n );\n }\n}\n\nasync function readDaemonServiceRuntimeState(\n pathInput: OpenMeldPathResolutionInput = {}\n): Promise<DaemonServiceRuntimeState | null> {\n const raw = await readFile(\n daemonServiceRuntimeStatePath(pathInput),\n \"utf8\"\n ).catch((error) => {\n if (\n error &&\n typeof error === \"object\" &&\n \"code\" in error &&\n error.code === \"ENOENT\"\n ) {\n return null;\n }\n throw error;\n });\n if (raw === null) {\n return null;\n }\n return parseDaemonServiceRuntimeState(raw);\n}\n\nfunction parseDaemonServiceRuntimeState(\n raw: string\n): DaemonServiceRuntimeState | null {\n try {\n const parsed = JSON.parse(raw);\n if (!isDaemonServiceRuntimeStateObject(parsed)) {\n return null;\n }\n\n return {\n v: 1,\n schema: DAEMON_SERVICE_RUNTIME_STATE_SCHEMA,\n status: \"running\",\n pid: parsed.pid,\n mode: parsed.mode,\n command: parsed.command,\n gatewayUrl: parseNullableString(parsed.gatewayUrl),\n openMeldProfileId: resolveStoredDaemonServiceOpenMeldProfileId(parsed),\n stopRequestedAt: parseNullableString(parsed.stopRequestedAt),\n heartbeatAt: parseNullableString(parsed.heartbeatAt),\n startedAt: parsed.startedAt,\n updatedAt: parsed.updatedAt,\n managedBySystemService: parsed.managedBySystemService === true,\n serviceController: parseDaemonServiceController(parsed.serviceController),\n autoStart: parsed.autoStart === true,\n };\n } catch {\n return null;\n }\n}\n\nfunction isDaemonServiceRuntimeStateObject(value: unknown): value is {\n v: 1;\n schema: string;\n status: \"running\";\n pid: number;\n mode: DaemonRunMode;\n command: string;\n gatewayUrl: string | null;\n openMeldProfileId?: string | null;\n profile?: string | null;\n stopRequestedAt: string | null;\n heartbeatAt: string | null;\n startedAt: string;\n updatedAt: string;\n managedBySystemService?: boolean;\n serviceController?: string;\n autoStart?: boolean;\n} {\n if (!value || typeof value !== \"object\") {\n return false;\n }\n const candidate = value as Record<string, unknown>;\n return (\n candidate.v === 1 &&\n candidate.schema === DAEMON_SERVICE_RUNTIME_STATE_SCHEMA &&\n candidate.status === \"running\" &&\n typeof candidate.pid === \"number\" &&\n candidate.pid > 0 &&\n (candidate.mode === \"foreground\" || candidate.mode === \"background\") &&\n typeof candidate.command === \"string\" &&\n candidate.command.length > 0 &&\n isValidNullableString(candidate.gatewayUrl) &&\n isValidOptionalNullableString(candidate.openMeldProfileId) &&\n isValidOptionalNullableString(candidate.profile) &&\n isValidNullableString(candidate.stopRequestedAt) &&\n isValidNullableString(candidate.heartbeatAt) &&\n typeof candidate.startedAt === \"string\" &&\n candidate.startedAt.length > 0 &&\n typeof candidate.updatedAt === \"string\" &&\n candidate.updatedAt.length > 0\n );\n}\n\nexport function parseDaemonServiceController(\n value: unknown\n): DaemonServiceController {\n if (\n value === \"launchd\" ||\n value === \"systemd\" ||\n value === \"windows-service\" ||\n value === \"legacy-detached\" ||\n value === \"unknown\"\n ) {\n return value;\n }\n return \"unknown\";\n}\n\nfunction isValidNullableString(value: unknown): value is string | null {\n return value === null || typeof value === \"string\";\n}\n\nfunction isValidOptionalNullableString(\n value: unknown\n): value is string | null | undefined {\n return value === undefined || value === null || typeof value === \"string\";\n}\n\nfunction parseNullableString(value: unknown): string | null {\n if (value === null) {\n return null;\n }\n if (typeof value !== \"string\") {\n return null;\n }\n return value;\n}\n\nfunction resolveStoredDaemonServiceOpenMeldProfileId(input: {\n openMeldProfileId?: unknown;\n profile?: unknown;\n}): string | null {\n const openMeldProfileId = parseNullableString(input.openMeldProfileId);\n const legacyProfile = parseNullableString(input.profile);\n if (\n openMeldProfileId &&\n legacyProfile &&\n openMeldProfileId !== legacyProfile\n ) {\n throw new Error(\"conflicting openMeldProfileId values\");\n }\n return openMeldProfileId ?? legacyProfile;\n}\n\nexport function isDaemonServiceRuntimeHeartbeatStale(\n state: DaemonServiceRuntimeState\n): boolean {\n const latestSignalAt = Math.max(\n parseIsoTimestampOrZero(state.heartbeatAt),\n parseIsoTimestampOrZero(state.updatedAt)\n );\n if (latestSignalAt <= 0) {\n return false;\n }\n return Date.now() - latestSignalAt > DAEMON_HEARTBEAT_STALE_MS;\n}\n\nfunction parseIsoTimestampOrZero(value: string | null): number {\n if (!value) {\n return 0;\n }\n const parsed = Date.parse(value);\n return Number.isFinite(parsed) ? parsed : 0;\n}\n\nasync function writeDaemonServiceRuntimeState(\n state: DaemonServiceRuntimeState,\n pathInput: OpenMeldPathResolutionInput = {}\n): Promise<void> {\n const path = daemonServiceRuntimeStatePath(pathInput);\n const runtimeRootPath = daemonRuntimeRootPath(pathInput);\n await mkdir(runtimeRootPath, { recursive: true });\n const tempPath = `${path}.tmp-${process.pid}-${Date.now()}`;\n let shouldCleanupTemp = true;\n\n try {\n await writeFile(tempPath, `${JSON.stringify(state, null, 2)}\\n`, {\n encoding: \"utf8\",\n mode: 0o600,\n });\n await rename(tempPath, path);\n await chmod(path, 0o600);\n shouldCleanupTemp = false;\n } finally {\n if (shouldCleanupTemp) {\n await rm(tempPath, { force: true }).catch(() => undefined);\n }\n }\n}\n\nasync function ensureDaemonRuntimeLayout(): Promise<void> {\n await Promise.all([\n mkdir(systemDir(), { recursive: true }),\n mkdir(join(daemonRuntimeRootPath(), \"bin\"), { recursive: true }),\n mkdir(daemonRuntimeBundlesPath(), { recursive: true }),\n mkdir(join(daemonRuntimeRootPath(), \"data\"), { recursive: true }),\n mkdir(join(daemonRuntimeRootPath(), \"logs\"), { recursive: true }),\n mkdir(daemonRuntimeStateRootPath(), { recursive: true }),\n mkdir(daemonRuntimeServiceManagerPath(), { recursive: true }),\n ]);\n}\n\nfunction normalizeDaemonLifecycleIntent(\n value: string\n): DaemonLifecycleIntent | null {\n switch (value) {\n case \"run_background\":\n case \"run_foreground\":\n case \"stop\":\n case \"autostart\":\n case \"status_cleanup\":\n case \"startup_check\":\n case \"start\":\n case \"reinstall\":\n case \"uninstall\":\n case \"upgrade_reconcile\":\n return value;\n default:\n return null;\n }\n}\n\nasync function ensureDaemonTokenState(\n pathInput: OpenMeldPathResolutionInput = {}\n): Promise<DaemonTokenState> {\n const current = await readDaemonTokenState(pathInput);\n if (current) {\n await chmod(daemonTokenPath(pathInput), 0o600).catch(() => undefined);\n return current;\n }\n\n return await writeNewDaemonTokenState(pathInput);\n}\n\nasync function writeNewDaemonTokenState(\n pathInput: OpenMeldPathResolutionInput\n): Promise<DaemonTokenState> {\n const nowIso = new Date().toISOString();\n const next: DaemonTokenState = {\n v: 1,\n schema: DAEMON_TOKEN_SCHEMA,\n token: createDaemonTokenValue(),\n issuedAt: nowIso,\n updatedAt: nowIso,\n };\n await writeDaemonTokenState(next, pathInput);\n return next;\n}\n\nasync function readDaemonInstallState(\n pathInput: OpenMeldPathResolutionInput = {}\n): Promise<DaemonInstallState | null> {\n const raw = await readFile(daemonStatePath(pathInput), \"utf8\").catch(\n (error) => {\n if (\n error &&\n typeof error === \"object\" &&\n \"code\" in error &&\n error.code === \"ENOENT\"\n ) {\n return null;\n }\n throw error;\n }\n );\n if (raw === null) {\n return null;\n }\n return parseDaemonInstallState(raw);\n}\n\nfunction parseDaemonInstallState(raw: string): DaemonInstallState | null {\n try {\n const parsed = JSON.parse(raw) as Partial<DaemonInstallState>;\n if (parsed.v !== 1) {\n return null;\n }\n if (parsed.schema !== DAEMON_STATE_SCHEMA) {\n return null;\n }\n if (typeof parsed.daemonVersion !== \"string\" || !parsed.daemonVersion) {\n return null;\n }\n if (!isDaemonInstallSource(parsed.installSource)) {\n return null;\n }\n if (typeof parsed.installedAt !== \"string\" || !parsed.installedAt) {\n return null;\n }\n if (typeof parsed.updatedAt !== \"string\" || !parsed.updatedAt) {\n return null;\n }\n return {\n v: 1,\n schema: DAEMON_STATE_SCHEMA,\n daemonVersion: parsed.daemonVersion,\n installSource: parsed.installSource,\n installedAt: parsed.installedAt,\n updatedAt: parsed.updatedAt,\n };\n } catch {\n return null;\n }\n}\n\nfunction isDaemonInstallSource(value: unknown): value is DaemonInstallSource {\n return value === \"cli.auto_check\" || value === \"daemon.command.install\";\n}\n\nasync function writeDaemonInstallState(\n state: DaemonInstallState,\n pathInput: OpenMeldPathResolutionInput = {}\n): Promise<void> {\n const path = daemonStatePath(pathInput);\n await mkdir(systemDir(pathInput), { recursive: true });\n const tempPath = `${path}.tmp-${process.pid}-${Date.now()}`;\n let shouldCleanupTemp = true;\n\n try {\n await writeFile(tempPath, `${JSON.stringify(state, null, 2)}\\n`, \"utf8\");\n await rename(tempPath, path);\n shouldCleanupTemp = false;\n } finally {\n if (shouldCleanupTemp) {\n await rm(tempPath, { force: true }).catch(() => undefined);\n }\n }\n}\n\nasync function readDaemonTokenState(\n pathInput: OpenMeldPathResolutionInput = {}\n): Promise<DaemonTokenState | null> {\n const raw = await readFile(daemonTokenPath(pathInput), \"utf8\").catch(\n (error) => {\n if (\n error &&\n typeof error === \"object\" &&\n \"code\" in error &&\n error.code === \"ENOENT\"\n ) {\n return null;\n }\n throw error;\n }\n );\n if (raw === null) {\n return null;\n }\n return parseDaemonTokenState(raw);\n}\n\nfunction parseDaemonTokenState(raw: string): DaemonTokenState | null {\n try {\n const parsed = JSON.parse(raw) as Partial<DaemonTokenState>;\n if (parsed.v !== 1 || parsed.schema !== DAEMON_TOKEN_SCHEMA) {\n return null;\n }\n if (typeof parsed.token !== \"string\" || parsed.token.length < 16) {\n return null;\n }\n if (typeof parsed.issuedAt !== \"string\" || !parsed.issuedAt) {\n return null;\n }\n if (typeof parsed.updatedAt !== \"string\" || !parsed.updatedAt) {\n return null;\n }\n return {\n v: 1,\n schema: DAEMON_TOKEN_SCHEMA,\n token: parsed.token,\n issuedAt: parsed.issuedAt,\n updatedAt: parsed.updatedAt,\n };\n } catch {\n return null;\n }\n}\n\nasync function writeDaemonTokenState(\n state: DaemonTokenState,\n pathInput: OpenMeldPathResolutionInput = {}\n): Promise<void> {\n const path = daemonTokenPath(pathInput);\n await mkdir(systemDir(pathInput), { recursive: true });\n const tempPath = `${path}.tmp-${process.pid}-${Date.now()}`;\n let shouldCleanupTemp = true;\n\n try {\n await writeFile(tempPath, `${JSON.stringify(state, null, 2)}\\n`, {\n encoding: \"utf8\",\n mode: 0o600,\n });\n await rename(tempPath, path);\n await chmod(path, 0o600);\n shouldCleanupTemp = false;\n } finally {\n if (shouldCleanupTemp) {\n await rm(tempPath, { force: true }).catch(() => undefined);\n }\n }\n}\n\nfunction isDaemonTokenExpired(state: DaemonTokenState): boolean {\n const updatedAtMs = Date.parse(state.updatedAt);\n if (!Number.isFinite(updatedAtMs)) {\n return true;\n }\n return Date.now() - updatedAtMs >= DAEMON_TOKEN_ROTATE_MAX_AGE_MS;\n}\n\nfunction createDaemonTokenValue(): string {\n return randomBytes(32).toString(\"base64url\");\n}\n\nasync function pathExists(path: string): Promise<boolean> {\n try {\n await stat(path);\n return true;\n } catch (error) {\n if (\n error &&\n typeof error === \"object\" &&\n \"code\" in error &&\n error.code === \"ENOENT\"\n ) {\n return false;\n }\n throw error;\n }\n}\n"],"mappings":";;;;;;;;;AA8BA,MAAM,sBAAsB;AAC5B,MAAa,sCACX;AACF,MAAa,kCAAkC;AAC/C,MAAa,sCACX;AACF,MAAa,wCACX;AACF,MAAa,wCACX;AACF,MAAa,4CACX;AACF,MAAM,sBAAsB;AAC5B,MAAM,iCAAiC,OAAU,KAAK;AACtD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AAM,SAAS;CAC9C,IAAI,CAAC,OAAO,SAAS,WAAW,GAC9B,OAAO;CAET,OAAO,KAAK,IAAI,IAAI,eAAe;AACrC;AAEA,SAAS,yBAAiC;CACxC,OAAO,YAAY,EAAE,CAAC,CAAC,SAAS,WAAW;AAC7C;AAEA,eAAe,WAAW,MAAgC;CACxD,IAAI;EACF,MAAM,KAAK,IAAI;EACf,OAAO;CACT,SAAS,OAAO;EACd,IACE,SACA,OAAO,UAAU,YACjB,UAAU,SACV,MAAM,SAAS,UAEf,OAAO;EAET,MAAM;CACR;AACF"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { C as resolveBuiltinAgentControllerConversationCapability, S as agentControllerConversationCapabilitySchema, b as normalizeKnownBuiltinAgentControllerId, h as agentControllerRefSchema, s as runtimeTransportModeSchema } from "./controller-contract-DAOCaefz.js";
|
|
4
|
-
import { $n as
|
|
5
|
-
import {
|
|
6
|
-
import { A as profileKindSchema, E as agentProfileIdSchema, F as uuidProfileIdSchema, I as finiteIntegerNumber, L as nonEmptyTrimmedStringFromUnknown, M as profileSchema, N as profileWorkingDirectorySchema, O as openMeldRuntimeProfileIdSchema, P as profileWorkspaceModeSchema, R as optionalBooleanQuerySchema, r as localAgentInstallationOptionSchema, v as openMeldDaemonSyncRouteCatalogPayloadSchema, w as dispatchExecutionSchema, z as trimmedStringFromUnknown } from "./control-plane-
|
|
7
|
-
import { A as coerce, B as number, C as openMeldToolsUpdateRequestResultSchema, E as NEVER, F as iso, G as string, H as preprocess, I as lazySchema, J as union, K as tuple, L as literal, M as email, N as enumFactory, O as array, P as int, R as neverFactory, U as record, V as object, W as strictObject, X as url, Y as unknown, _ as openMeldToolsMaintenanceProjectionSchema, c as localComponentUpdatePolicySchema, g as openMeldToolsMaintenanceMutationResultSchema, j as discriminatedUnion, k as boolean, l as localComponentUpdateProjectionSchema, q as undefinedFactory, u as localComponentUpdateStatusSchema, x as openMeldToolsUpdateOperationSchema, z as nullFactory } from "./local-components-
|
|
4
|
+
import { $n as agentStreamToolPartSchema, $r as localAgentCatalogWithLifecycleSchema, Ar as updateOrganizationInformationProtectionPolicyBodySchema, At as wakeDeviceWaitTargetSchema, Bt as centerAgentInteractionSourceSchema, Cr as spacePasswordSchema, Dn as spaceThreadSchema, Dr as spaceMentionLabelSourceSchema, Dt as signalSystemNoticeDataSchema, En as spaceThreadEventSchema, Er as spaceMentionLabelSchema, Et as signalStatusDataSchema, Fn as workingLanguageGuidanceSchema, Fr as executeExecutionRecoveryResponseSchema, Ft as spaceAttachmentSizeBytesSchema, G as openMeldDaemonOriginalErrorSchema, Gr as localFolderPathSchema, In as workingLanguageTagSchema, Ir as inspectExecutionRecoveryResponseSchema, It as spaceMessageAttachmentSchema, Jn as openMeldWebUrlSchema, Jt as SPACE_FILE_MAX_SIZE_BYTES, K as openMeldDaemonProviderAccessEvidenceProviderSchema, Kn as computerSetupModeSchema, Kr as START_BOUNDED_ID_SCHEMA, Lr as agentProfileWorkRecoveryActionKindSchema, Lt as spaceMessageAttachmentsSchema, Mn as spaceAllowedActionsSchema, Mt as spaceAttachmentDimensionSchema, Nn as spacePublicationModeSchema, Nr as localAgentReasoningPreferencesSchema, Nt as spaceAttachmentFileNameSchema, On as spaceThreadSignalPlacementSchema, Or as organizationInformationProtectionPolicyResponseSchema, Ot as signalTextDataSchema, Pn as spaceDispatchPolicySchema, Pr as executeExecutionRecoveryBodySchema, Pt as spaceAttachmentMimeTypeSchema, Qn as AGENT_STREAM_SNAPSHOT_MAX_CHARS, Qt as getSpaceFileResponseSchema, Rn as targetWakeLifecycleIdentitySchema, Rt as conversationCompactionMarkerSchema, Sn as uploadSpaceFileResponseSchema, Sr as normalizeSpacePasswordText, Tn as spaceThreadContextSchema, Un as messageEnvelopeSchema, Ur as localFolderPickerRequestSchema, Ut as spaceWorkHandoffSchema, V as runtimeTransportRuntimeCoordinatorRespondInteractionResponseSchema, Wr as localFolderPickerResultSchema, Xt as createSpaceFolderResponseSchema, Z as openMeldDaemonTaskResultProjectFailureContextSchema, Zr as localAgentCatalogLaunchStatusSchema, Zt as discardSpaceComposerUploadResponseSchema, an as restoreSpaceFileEntryResponseSchema, at as agentDelegationSnapshotSchema, bn as trashSpaceFileEntryResponseSchema, br as spaceTraceExecutionIdentityProjectionSchema, ci as updateAgentProfileDefaultProjectResponseSchema, cn as spaceComposerUploadIdSchema, ct as agentTaskHandleSchema, di as openMeldRequestContextSchema, dn as spaceFileDescriptorSchema, dr as postSpaceWakeStopResponseSchema, dt as buildAgentTaskKey, en as listSpaceFileRevisionsResponseSchema, er as spaceAgentStreamDeltaFrameSchema, fi as MAX_TEXT_LENGTH$1, fn as spaceFileEntryIdSchema, fr as clientMessageIdSchema$1, ft as controllerAgentTaskHandleSchema, gr as runtimeCoordinatorExecutionRecordSchema, hn as spaceFileOriginSchema, hr as runtimeCoordinatorExecutionEventSchema, i as daemonExecutionCompatibilitySchema, ii as authProfileViewSchema, ir as spaceAgentStreamTerminalFrameSchema, it as spaceCallerContextSchema, jn as resultArchivePolicySchema, jt as spaceAttachmentDescriptorSchema, kr as organizationProtectedInformationSchema, kt as signalTextSchema, li as updateProfileResponseSchema, ln as spaceFileActorSchema, lr as agentInteractionResponseSchema, lt as agentTaskTerminalOutcomeSchema, mn as spaceFileNameSchema, mr as runtimeCoordinatorExecutionCreationDiagnosticSchema, nn as publishSpaceComposerUploadResponseSchema, nr as spaceAgentStreamPresenceSchema, on as restoreSpaceFileRevisionResponseSchema, or as agentInteractionPendingSummarySchema, ot as agentTaskCompletionConditionSchema, pn as spaceFileMimeTypeSchema, pt as spaceWakeAgentTaskHandleSchema, qn as openMeldNavigationTargetSchema, qt as SPACE_FILE_ERROR_CODES, ri as authProfileManagedRoleSchema, rr as spaceAgentStreamSnapshotSchema, si as updateAgentProfileDefaultProjectBodySchema, sn as spaceComposerUploadDescriptorSchema, st as agentTaskCompletionObservationSchema, tn as listSpaceFilesResponseSchema, tr as spaceAgentStreamPartFrameSchema, un as spaceFileClientMutationIdSchema, ur as postSpaceWakeStopBodySchema, ut as areAgentTaskTerminalOutcomesEqual, vn as spaceMessageFileReferencesSchema, wn as computerCareObservationSchema, xn as updateSpaceFileEntryResponseSchema, xr as SPACE_PASSWORD_RATE_LIMITED_ERROR_CODE, yn as stageSpaceComposerUploadResponseSchema } from "./runtime-transport-CivtwW1A.js";
|
|
5
|
+
import { i as cliBinaryManifestSchema } from "./cli-binary-manifest-CT5X05lk.js";
|
|
6
|
+
import { A as profileKindSchema, E as agentProfileIdSchema, F as uuidProfileIdSchema, I as finiteIntegerNumber, L as nonEmptyTrimmedStringFromUnknown, M as profileSchema, N as profileWorkingDirectorySchema, O as openMeldRuntimeProfileIdSchema, P as profileWorkspaceModeSchema, R as optionalBooleanQuerySchema, r as localAgentInstallationOptionSchema, v as openMeldDaemonSyncRouteCatalogPayloadSchema, w as dispatchExecutionSchema, z as trimmedStringFromUnknown } from "./control-plane-rTE2rHZ5.js";
|
|
7
|
+
import { A as coerce, B as number, C as openMeldToolsUpdateRequestResultSchema, E as NEVER, F as iso, G as string, H as preprocess, I as lazySchema, J as union, K as tuple, L as literal, M as email, N as enumFactory, O as array, P as int, R as neverFactory, U as record, V as object, W as strictObject, X as url, Y as unknown, _ as openMeldToolsMaintenanceProjectionSchema, c as localComponentUpdatePolicySchema, g as openMeldToolsMaintenanceMutationResultSchema, j as discriminatedUnion, k as boolean, l as localComponentUpdateProjectionSchema, q as undefinedFactory, u as localComponentUpdateStatusSchema, x as openMeldToolsUpdateOperationSchema, z as nullFactory } from "./local-components-DleLEzSU.js";
|
|
8
8
|
import { r as daemonServiceLaneSchema } from "./service-contract-CRyDcIIf.js";
|
|
9
9
|
import { n as agentControllerPermissionModeSchema, r as agentControllerCollaborationModeSchema, t as openCodePermissionConfigSchema } from "./open-code-permission-DHFJYc_o.js";
|
|
10
10
|
import { n as toErrorMessage$3 } from "./dist-BLuEEVHh.js";
|
|
@@ -2343,6 +2343,8 @@ const CENTER_AGENT_ANONYMOUS_MEMBER_TOOL_NAMES = [
|
|
|
2343
2343
|
"openmeld_list_connected_apps",
|
|
2344
2344
|
"openmeld_list_app_actions",
|
|
2345
2345
|
"openmeld_execute_app_action",
|
|
2346
|
+
"github_execute_action",
|
|
2347
|
+
"github_list_actions",
|
|
2346
2348
|
"github_get_current_user",
|
|
2347
2349
|
"github_list_my_repositories",
|
|
2348
2350
|
"github_get_repository",
|
|
@@ -2890,8 +2892,10 @@ strictObject({
|
|
|
2890
2892
|
...agentActivitySnapshotQueryShape,
|
|
2891
2893
|
speakerMember: centerAgentToolSpeakerSchema
|
|
2892
2894
|
});
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
+
z$1.strictObject({
|
|
2896
|
+
retirement: z$1.boolean().optional(),
|
|
2897
|
+
personalRemoteAgentDefault: z$1.boolean().optional()
|
|
2898
|
+
});
|
|
2895
2899
|
const boundedIdentifierSchema$7 = z$1.string().trim().min(1).max(256);
|
|
2896
2900
|
const boundedDisplayNameSchema = z$1.string().trim().min(1).max(256);
|
|
2897
2901
|
const nullableBoundedIdentifierSchema = boundedIdentifierSchema$7.nullable();
|
|
@@ -2903,7 +2907,8 @@ const hostedModelReasoningLevelSchema = z$1.enum([
|
|
|
2903
2907
|
"low",
|
|
2904
2908
|
"medium",
|
|
2905
2909
|
"high",
|
|
2906
|
-
"xhigh"
|
|
2910
|
+
"xhigh",
|
|
2911
|
+
"max"
|
|
2907
2912
|
]);
|
|
2908
2913
|
const modelCatalogHostedRuntimeSchema = z$1.strictObject({
|
|
2909
2914
|
provider: z$1.literal("openrouter"),
|
|
@@ -2912,10 +2917,26 @@ const modelCatalogHostedRuntimeSchema = z$1.strictObject({
|
|
|
2912
2917
|
maxOutputTokens: z$1.number().int().positive(),
|
|
2913
2918
|
reasoningLevel: hostedModelReasoningLevelSchema
|
|
2914
2919
|
});
|
|
2920
|
+
/** Reviewed facts only. A date never changes model availability. */
|
|
2921
|
+
const modelRetirementNoticeSchema = z$1.strictObject({
|
|
2922
|
+
status: z$1.enum(["announced", "withdrawn"]),
|
|
2923
|
+
date: z$1.strictObject({
|
|
2924
|
+
value: z$1.iso.date(),
|
|
2925
|
+
kind: z$1.enum(["on", "not_before"])
|
|
2926
|
+
}).nullable(),
|
|
2927
|
+
scope: z$1.strictObject({
|
|
2928
|
+
controllerRef: boundedIdentifierSchema$7,
|
|
2929
|
+
providerId: boundedIdentifierSchema$7.optional(),
|
|
2930
|
+
authType: boundedIdentifierSchema$7.optional()
|
|
2931
|
+
}),
|
|
2932
|
+
sourceUrl: z$1.url().refine((url) => url.startsWith("https://"), { message: "retirement sources must use HTTPS" }),
|
|
2933
|
+
verifiedAt: z$1.iso.datetime({ offset: true })
|
|
2934
|
+
});
|
|
2915
2935
|
const modelCatalogModelSchema = z$1.strictObject({
|
|
2916
2936
|
id: boundedIdentifierSchema$7,
|
|
2917
2937
|
displayName: boundedDisplayNameSchema,
|
|
2918
2938
|
badgeLabel: modelCatalogBadgeLabelSchema.optional(),
|
|
2939
|
+
retirement: modelRetirementNoticeSchema.optional(),
|
|
2919
2940
|
hostedRuntime: modelCatalogHostedRuntimeSchema.optional(),
|
|
2920
2941
|
unavailable: z$1.boolean(),
|
|
2921
2942
|
supportedReasoningLevels: z$1.array(boundedIdentifierSchema$7),
|
|
@@ -2923,7 +2944,8 @@ const modelCatalogModelSchema = z$1.strictObject({
|
|
|
2923
2944
|
});
|
|
2924
2945
|
const modelCatalogHostedRuntimePolicySchema = z$1.strictObject({
|
|
2925
2946
|
automaticModelFallback: z$1.literal(false),
|
|
2926
|
-
imageUnderstandingModelId: boundedIdentifierSchema$7
|
|
2947
|
+
imageUnderstandingModelId: boundedIdentifierSchema$7,
|
|
2948
|
+
personalRemoteAgentDefaultModelId: boundedIdentifierSchema$7.optional()
|
|
2927
2949
|
});
|
|
2928
2950
|
const modelCatalogAgentControllerSchema = z$1.strictObject({
|
|
2929
2951
|
defaultModelId: boundedIdentifierSchema$7,
|
|
@@ -2946,6 +2968,10 @@ const modelCatalogAgentControllerSchema = z$1.strictObject({
|
|
|
2946
2968
|
]
|
|
2947
2969
|
});
|
|
2948
2970
|
modelIds.add(model.id);
|
|
2971
|
+
for (const issue of hostedReasoningIssues(model, index)) context.addIssue({
|
|
2972
|
+
code: "custom",
|
|
2973
|
+
...issue
|
|
2974
|
+
});
|
|
2949
2975
|
const reasoningLevels = /* @__PURE__ */ new Set();
|
|
2950
2976
|
for (const [reasoningLevelIndex, reasoningLevel] of model.supportedReasoningLevels.entries()) {
|
|
2951
2977
|
if (!reasoningLevels.has(reasoningLevel)) {
|
|
@@ -2994,6 +3020,14 @@ const modelCatalogAgentControllerSchema = z$1.strictObject({
|
|
|
2994
3020
|
});
|
|
2995
3021
|
}
|
|
2996
3022
|
if (!value.hostedRuntimePolicy) return;
|
|
3023
|
+
if (value.hostedRuntimePolicy.personalRemoteAgentDefaultModelId) {
|
|
3024
|
+
const remoteDefaultModel = value.models.find((model) => model.id === value.hostedRuntimePolicy?.personalRemoteAgentDefaultModelId);
|
|
3025
|
+
if (!remoteDefaultModel?.hostedRuntime || remoteDefaultModel.unavailable) context.addIssue({
|
|
3026
|
+
code: "custom",
|
|
3027
|
+
message: "personalRemoteAgentDefaultModelId must reference an available hosted model",
|
|
3028
|
+
path: ["hostedRuntimePolicy", "personalRemoteAgentDefaultModelId"]
|
|
3029
|
+
});
|
|
3030
|
+
}
|
|
2997
3031
|
for (const [index, model] of value.models.entries()) {
|
|
2998
3032
|
if (model.hostedRuntime) continue;
|
|
2999
3033
|
context.addIssue({
|
|
@@ -3026,6 +3060,29 @@ const modelCatalogAgentControllerSchema = z$1.strictObject({
|
|
|
3026
3060
|
path: ["hostedRuntimePolicy", "imageUnderstandingModelId"]
|
|
3027
3061
|
});
|
|
3028
3062
|
});
|
|
3063
|
+
function hostedReasoningIssues(model, index) {
|
|
3064
|
+
if (!model.hostedRuntime) return [];
|
|
3065
|
+
const issues = [];
|
|
3066
|
+
for (const [levelIndex, level] of model.supportedReasoningLevels.entries()) if (!hostedModelReasoningLevelSchema.safeParse(level).success) issues.push({
|
|
3067
|
+
message: "hosted reasoning levels must be valid efforts",
|
|
3068
|
+
path: [
|
|
3069
|
+
"models",
|
|
3070
|
+
index,
|
|
3071
|
+
"supportedReasoningLevels",
|
|
3072
|
+
levelIndex
|
|
3073
|
+
]
|
|
3074
|
+
});
|
|
3075
|
+
if (!model.supportedReasoningLevels.includes(model.hostedRuntime.reasoningLevel)) issues.push({
|
|
3076
|
+
message: "hosted default reasoning must be supported by its model",
|
|
3077
|
+
path: [
|
|
3078
|
+
"models",
|
|
3079
|
+
index,
|
|
3080
|
+
"hostedRuntime",
|
|
3081
|
+
"reasoningLevel"
|
|
3082
|
+
]
|
|
3083
|
+
});
|
|
3084
|
+
return issues;
|
|
3085
|
+
}
|
|
3029
3086
|
const modelCatalogSchema = z$1.strictObject({
|
|
3030
3087
|
schemaVersion: z$1.literal(1),
|
|
3031
3088
|
updatedAt: z$1.iso.datetime({ offset: true }),
|
|
@@ -3073,9 +3130,11 @@ const centerAgentModelSummarySchema = z$1.strictObject({
|
|
|
3073
3130
|
});
|
|
3074
3131
|
const centerAgentModelChoiceSchema = z$1.strictObject({
|
|
3075
3132
|
badgeLabel: modelCatalogBadgeLabelSchema.nullable().optional(),
|
|
3133
|
+
defaultReasoningLevel: hostedModelReasoningLevelSchema.optional(),
|
|
3076
3134
|
displayName: boundedIdentifierSchema$6,
|
|
3077
3135
|
effectiveModelDisplayName: boundedIdentifierSchema$6,
|
|
3078
3136
|
preference: centerAgentModelPreferenceSchema,
|
|
3137
|
+
supportedReasoningLevels: z$1.array(hostedModelReasoningLevelSchema).optional(),
|
|
3079
3138
|
supportsImageInput: z$1.boolean()
|
|
3080
3139
|
});
|
|
3081
3140
|
const centerAgentHostedModelRouteSchema = z$1.strictObject({
|
|
@@ -9408,12 +9467,15 @@ const centerAgentModelConfigurationResponseSchema = strictObject({
|
|
|
9408
9467
|
choices: array(centerAgentModelChoiceSchema).min(1),
|
|
9409
9468
|
configurationRevision: number().int().nonnegative(),
|
|
9410
9469
|
effectiveModel: centerAgentModelSummarySchema,
|
|
9470
|
+
effectiveReasoningLevel: hostedModelReasoningLevelSchema.optional(),
|
|
9411
9471
|
organizationId: trimmedNonEmptyStringSchema$8,
|
|
9412
|
-
preference: centerAgentModelPreferenceSchema
|
|
9472
|
+
preference: centerAgentModelPreferenceSchema,
|
|
9473
|
+
reasoningLevel: hostedModelReasoningLevelSchema.nullable().optional()
|
|
9413
9474
|
});
|
|
9414
9475
|
const updateCenterAgentModelBodySchema = strictObject({
|
|
9415
9476
|
expectedConfigurationRevision: number().int().nonnegative(),
|
|
9416
|
-
preference: centerAgentModelPreferenceSchema
|
|
9477
|
+
preference: centerAgentModelPreferenceSchema,
|
|
9478
|
+
reasoningLevel: hostedModelReasoningLevelSchema.nullable().optional()
|
|
9417
9479
|
});
|
|
9418
9480
|
const updateCenterAgentModelResponseSchema = centerAgentModelConfigurationResponseSchema.extend({ changed: boolean() });
|
|
9419
9481
|
const centerAgentRemoteRuntimeAvailabilityReasonCodeSchema = enumFactory([
|
|
@@ -12488,13 +12550,17 @@ const completeAgentProfileCreationConfigurationSchema = agentProfileCreationPref
|
|
|
12488
12550
|
"defaultProjectId",
|
|
12489
12551
|
"agentControllerCollaborationMode",
|
|
12490
12552
|
"agentControllerPermissionMode",
|
|
12491
|
-
"openCodePermission"
|
|
12492
|
-
"reasoningLevel"
|
|
12553
|
+
"openCodePermission"
|
|
12493
12554
|
]) if (configuration[key] != null) context.addIssue({
|
|
12494
12555
|
code: "custom",
|
|
12495
12556
|
message: "Remote Agents do not use local agent settings.",
|
|
12496
12557
|
path: [key]
|
|
12497
12558
|
});
|
|
12559
|
+
if (configuration.reasoningLevel && !configuration.modelId) context.addIssue({
|
|
12560
|
+
code: "custom",
|
|
12561
|
+
message: "reasoningLevel requires modelId.",
|
|
12562
|
+
path: ["reasoningLevel"]
|
|
12563
|
+
});
|
|
12498
12564
|
return;
|
|
12499
12565
|
}
|
|
12500
12566
|
if (hasController !== hasComputer) context.addIssue({
|
|
@@ -15771,7 +15837,7 @@ const createConfigApi = (client) => {
|
|
|
15771
15837
|
};
|
|
15772
15838
|
async function getModelCatalog(client) {
|
|
15773
15839
|
return await client.requestJson({
|
|
15774
|
-
url: buildModelCatalogPath()
|
|
15840
|
+
url: `${buildModelCatalogPath()}?retirement=1&personalRemoteAgentDefault=1`,
|
|
15775
15841
|
operation: "config.model_catalog.read",
|
|
15776
15842
|
method: "GET",
|
|
15777
15843
|
schema: getModelCatalogResponseSchema,
|
|
@@ -20014,6 +20080,6 @@ function shouldWrapNetworkRequestError(error) {
|
|
|
20014
20080
|
return message.includes("fetch failed") || message.includes("failed to fetch") || message.includes("network request failed");
|
|
20015
20081
|
}
|
|
20016
20082
|
//#endregion
|
|
20017
|
-
export { buildLocalFolderPickerPath as $,
|
|
20083
|
+
export { buildLocalFolderPickerPath as $, toErrorMessage$2 as $n, agentActivityInventorySessionStatusSchema as $r, createPluginsApi as $t, buildCurrentOrganizationDirectoryPath as A, createProjectResponseSchema as Ai, readOrUpdateSpaceMessagePins as An, observabilityWakeTraceSelectorSchema as Ar, buildSpaceInboxUnreadTargetsPath as At, buildCurrentOrganizationMessageChannelsPath as B, toLegacySpaceImageGeometryWireValue as Bi, uploadSpaceFile as Bn, removeSpaceMembersResponseSchema as Br, createCurrentDeviceApi as Bt, buildCenterAgentSessionPath as C, serviceConnectionEvidenceEventSchema as Ci, normalizeApiBaseUrl as Cn, SPACE_DISPATCH_TRACE_RESPONSE_CONTRACT_VERSION_HEADER as Cr, buildRoutineTargetSpacesPath as Ct, buildCurrentAgentProfileSessionRoute as D, localProjectControlDaemonFrameSchema as Di, readAccountSession as Dn, spaceDispatchTraceAttemptStatusSchema as Dr, buildSpaceFileContentPath as Dt, buildComputerFileAccessUpdatePath as E, localProjectControlConnectionSchema as Ei, readAccountOrganizationContext as En, resolveSpaceDispatchTraceRootCause as Er, buildSpaceBootstrapReadPath as Et, buildCurrentOrganizationMessageChannelPath as F, COMPUTER_FILE_ACCESS_RUNTIME_CAPABILITY as Fi, trashSpaceFileEntry as Fn, organizationSkillReleaseSummarySchema as Fr, createAgentProfileWorkRecoveryApi as Ft, buildFeedbackIssueSubmissionPath as G, parseIncoming as Gn, spaceMemberDirectorySchema as Gr, createLocalFolderPickerApi as Gt, buildCurrentOrganizationSpacesWithMemberCountsPath as H, DAEMON_STREAM_KEEPALIVE_PONG as Hn, spaceMemberAgentWakeAvailabilitySchema as Hr, createFeedbackApi as Ht, buildCurrentOrganizationMessageChannelRegistrationPath as I, OPENMELD_RUNTIME_CAPABILITIES_HEADER as Ii, updateSpaceFileContent as In, organizationSkillSummarySchema as Ir, createCenterAgentApi as It, buildInboxItemReadPath as J, OPENMELD_HEADER_PROFILE_ID as Jn, ownerComputerDiagnosticsSchema as Jr, createOpenMeldApiClient as Jt, buildInboxItemDismissPath as K, parseServerErrorFrame as Kn, spaceMemberKindSchema as Kr, createLocalProjectControlApi as Kt, buildCurrentOrganizationMessageChannelRegistrationPollPath as L, computerFileAccessDaemonFrameSchema as Li, updateSpaceFileEntry as Ln, stringifyOrganizationSkillBundleCanonicalJson as Lr, createComputerAuthorizationGrant as Lt, buildCurrentOrganizationInformationProtectionPath as M, projectSchema as Mi, resolveProfileSpaceHistoryGatewayHost as Mn, getOrganizationSkillResponseSchema as Mr, createAgentActivityApi as Mt, buildCurrentOrganizationLogoPath as N, updateProjectResponseSchema as Ni, setSpaceAccessMode as Nn, listOrganizationSkillsResponseSchema as Nr, createAgentProfileBindingApi as Nt, buildCurrentOrganizationCenterAgentMemoryWipeSelfPath as O, localProjectControlDiscoverProjectsResponseSchema as Oi, readCliRelease as On, spaceDispatchTraceDispatchStatusSchema as Or, buildSpaceInboxReadThroughPath as Ot, buildCurrentOrganizationMemberOpenMeldServiceStatusesPath as P, COMPUTER_FILE_ACCESS_OWNER_CANCELLED_REASON_CODE as Pi, toStructuredApiClientFailure as Pn, organizationSkillBundleSchema as Pr, createAgentProfileExecutionModeApi as Pt, buildInboxSummaryPath as Q, buildOpenMeldRequestContextHeaders as Qn, agentActivityInventorySessionOriginSchema as Qr, createOrganizationUsageApi as Qt, buildCurrentOrganizationMessageChannelRegistrationsPath as R, computerFileAccessPolicyInputSchema as Ri, updateSpaceMeta as Rn, leaveSpaceResponseSchema as Rr, createComputerFileAccessApi as Rt, buildCenterAgentProfilePath as S, centerAgentToolSpeakerSchema as Si, mutateSpaceTask as Sn, SPACE_DISPATCH_TRACE_PROMPT_PREVIEW_MAX_CHARS as Sr, buildRoutineRunsPath as St, buildComputerFileAccessReadPath as T, signalTextEnvelopeSchema as Ti, publicSpaceUrls as Tn, resolveRuntimeCoordinatorHeadStatusRootCause as Tr, buildSpaceAttachmentDownloadPath as Tt, buildDirectMessageConversionPath as U, MAX_TEXT_LENGTH as Un, spaceMemberDirectoryAllowedRelationsSchema as Ur, createFetchTransport as Ut, buildCurrentOrganizationSpacesPath as V, toCompatibleSpaceAddressingRequestWireValue as Vi, DAEMON_STREAM_KEEPALIVE_PING as Vn, resolvedSpaceMemberProfileSchema as Vr, createDirectMessageApi as Vt, buildDirectMessageSpacePath as W, parseEnvelope as Wn, spaceMemberDirectoryEntrySchema as Wr, createInboxApi as Wt, buildInboxPath as X, OPENMELD_HEADER_REQUEST_ID as Xn, summarizeComputerFileAccessPolicy as Xr, createOrganizationDocumentsApi as Xt, buildInboxMarkAllReadPath as Y, OPENMELD_HEADER_REQUESTED_ORGANIZATION_ID as Yn, projectOwnerComputerLocalRuntimes as Yr, createOrganizationApi as Yt, buildInboxPreferencesPath as Z, OPENMELD_HEADER_SPACE_ADDRESSING_VERSION as Zn, organizationComputersResponseSchema as Zr, createOrganizationSkillsApi as Zt, buildCenterAgentDirectMessageSpacePath as _, agentActivityEventSchema as _i, isInboxItemVisibleConversation as _n, spaceTaskMutationReceiptSchema as _r, buildProjectPath as _t, buildAgentActivitySessionsPath as a, spaceCreatorSchema as ai, createRoutinesApi as an, betterAuthDeviceAuthorizationCodeResponseSchema as ar, buildOrganizationDocumentsPath as at, buildCenterAgentMemberResearchPath as b, agentActivitySnapshotQuerySchema as bi, listSpaceFiles as bn, submitFeedbackIssueRequestSchema as br, buildRoutinePausePath as bt, buildAgentProfileCreationApprovalPreferencePath as c, deleteCenterAgentRoutineResponseSchema as ci, createSpaceApi as cn, betterAuthDeviceAuthorizationTokenResponseSchema as cr, buildOrganizationSkillGitHubPreviewPath as ct, buildAgentProfileCreationRequestDecisionPath as d, pauseCenterAgentRoutineResponseSchema as di, downloadSpaceFileContent as dn, agentProfileCreationConfigurationSchema as dr, buildOrganizationSkillsPath as dt, agentActivitySessionInventoryQuerySchema as ei, createPrepareReadinessApi as en, getSpaceUpdatesResponseSchema as er, buildLocalProjectControlPath as et, buildAgentProfileCreationRequestRetryPath as f, resumeCenterAgentRoutineResponseSchema as fi, getModelCatalog as fn, createAgentProfileCreationRequestBodySchema as fr, buildOrganizationUsageOverviewPath as ft, buildCenterAgentDesignationPath as g, AGENT_ACTIVITY_PRESENCE_TTL_MAX_MS as gi, isInboxItemInOrganizationScope as gn, spaceTaskIdSchema as gr, buildProfileSpaceHistoryUpsertPath as gt, buildCenterAgentAuditJournalPath as h, AGENT_ACTIVITY_EVENT_MAX_BYTES as hi, inboxMessageNotificationSpaceId as hn, mutateSpaceTaskBodySchema as hr, buildProfileSpaceHistoryStatusPath as ht, buildAccountSpaceIndexPath as i, resolveInitialSpaceAccessMode as ii, createReasoningStreamApi as in, betterAuthDeviceAuthorizationCodeRequestSchema as ir, buildOrganizationDocumentPath as it, buildCurrentOrganizationFeedbackReportingPolicyPath as j, listProjectsResponseSchema as ji, resolveAccountSpaceIndexGatewayHost as jn, projectObservabilityWakeCorrelation as jr, createAccountSpaceIndexApi as jt, buildCurrentOrganizationComputersPath as k, archiveProjectResponseSchema as ki, readOrUpdateSpaceFilePins as kn, spaceDispatchTraceResponseSchema as kr, buildSpaceInboxSummaryPath as kt, buildAgentProfileCreationDefaultsPath as l, listCenterAgentRoutineRunsResponseSchema as li, createSpaceFolder as ln, betterAuthSessionSnapshotResponseSchema as lr, buildOrganizationSkillMaintainersPath as lt, buildAgentProfileWorkRecoveryRoute as m, modelCatalogSchema as mi, getSpaceTask as mn, createSpaceTaskBodySchema as mr, buildProfileSpaceHistoryListPath as mt, OpenMeldApiClientInvalidResponseError as n, localAgentSessionProviderSchema as ni, createProfilesApi as nn, pluginActionRequestSchema as nr, buildOrganizationDocumentApproveDraftPath as nt, buildAgentActivitySnapshotPath as o, spaceMetaSchema as oi, createRuntimeReportingApi as on, betterAuthDeviceAuthorizationErrorResponseSchema as or, buildOrganizationSkillEnabledPath as ot, buildAgentProfileCreationRequestsPath as p, updateCenterAgentRoutineResponseSchema as pi, getSpaceFile as pn, gatewayErrorEnvelopeSchema as pr, buildProfileRoute as pt, buildInboxItemPath as q, resolveCustomMentionAliasOverride as qn, submitAgentControllerTaskLifecycleEventItemSchema as qr, createLocalRuntimeExpectedRoutesApi as qt, buildAccountSpaceActiveWakeSummaryPath as r, observedLocalAgentSessionSchema as ri, createProjectsApi as rn, BETTER_AUTH_DEVICE_AUTHORIZATION_GRANT_TYPE as rr, buildOrganizationDocumentDiscardDraftPath as rt, buildAgentActivityStatsPath as s, createCenterAgentRoutineResponseSchema as si, createServiceConnectionEvidenceApi as sn, betterAuthDeviceAuthorizationTokenRequestSchema as sr, buildOrganizationSkillGitHubImportPath as st, OpenMeldApiClientHttpError as t, agentActivitySessionInventoryResponseSchema as ti, createProfileSpaceHistoryApi as tn, spaceEntryTargetSchema as tr, buildModelCatalogPath as tt, buildAgentProfileCreationRequestCancelPath as u, listCenterAgentRoutinesResponseSchema as ui, createSpaceTask as un, DEFAULT_AGENT_PROFILE_CREATION_CONFIGURATION as ur, buildOrganizationSkillPath as ut, buildCenterAgentInboxReadThroughPath as v, agentActivityProviderSchema as vi, isInboxNotificationEligible as vn, organizationSpaceDirectoryWithMemberCountsResponseSchema as vr, buildProjectsPath as vt, buildCenterAgentSessionsPath as w, serviceConnectionEvidenceJournalSchema as wi, postSpaceWorkHandoff as wn, projectSpaceDispatchTraceFinalVisibleOutcome as wr, buildRoutinesPath as wt, buildCenterAgentOperatingStatePath as x, agentActivitySnapshotResponseSchema as xi, listSpaceTasks as xn, submitFeedbackIssueResponseSchema as xr, buildRoutineResumePath as xt, buildCenterAgentInboxSummaryPath as y, agentActivitySessionStatusSchema as yi, listSpaceFileRevisions as yn, organizationDirectoryResponseSchema as yr, buildRoutinePath as yt, buildCurrentOrganizationMessageChannelSetupRequestsPath as z, computerFileAccessPolicySchema as zi, uploadSpaceAttachment as zn, postSpaceMembersResponseSchema as zr, createConfigApi as zt };
|
|
20018
20084
|
|
|
20019
|
-
//# sourceMappingURL=dist-
|
|
20085
|
+
//# sourceMappingURL=dist-B0OGOBKB.js.map
|