openmeld 0.3.42
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/README.md +315 -0
- package/dist/add-me-membership-B9sBeKPr.js +11 -0
- package/dist/add-me-membership-B9sBeKPr.js.map +1 -0
- package/dist/api-client-foundation-BnsgZrnh.js +384 -0
- package/dist/api-client-foundation-BnsgZrnh.js.map +1 -0
- package/dist/auth-session-_ideKYyk.js +746 -0
- package/dist/auth-session-_ideKYyk.js.map +1 -0
- package/dist/base-url-Bdqmyw0D.js +2327 -0
- package/dist/base-url-Bdqmyw0D.js.map +1 -0
- package/dist/command-DAwIiSbe.js +102198 -0
- package/dist/command-DAwIiSbe.js.map +1 -0
- package/dist/daemon-runtime-lease-B9LdD-he.js +702 -0
- package/dist/daemon-runtime-lease-B9LdD-he.js.map +1 -0
- package/dist/dist-BvAAI13G.js +15925 -0
- package/dist/dist-BvAAI13G.js.map +1 -0
- package/dist/openmeld-dev.js +24 -0
- package/dist/openmeld-dev.js.map +1 -0
- package/dist/openmeld.js +32013 -0
- package/dist/openmeld.js.map +1 -0
- package/dist/runtime-transport-rv43yBPB.js +6391 -0
- package/dist/runtime-transport-rv43yBPB.js.map +1 -0
- package/dist/service-contract-DZWQdPz5.js +39 -0
- package/dist/service-contract-DZWQdPz5.js.map +1 -0
- package/package.json +86 -0
- package/skills/README.md +27 -0
- package/skills/openmeld-cli/SKILL.md +1012 -0
- package/skills/openmeld-cli/playbooks/agent-onboarding.md +185 -0
- package/skills/openmeld-cli/playbooks/space-ops.md +343 -0
- package/skills/openmeld-cli/references/commands.md +666 -0
- package/skills/openmeld-cli/references/runtime-resolution.md +80 -0
|
@@ -0,0 +1,702 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { H as acquireLock, Ht as resolveOpenMeldPresetOwnedPathInput, Jt as systemDir, K as readLockMeta, Q as tryCleanupStaleLock, Ut as resolveOpenMeldRootDir, Vt as resolveOpenMeldEnvPreset, Wt as runtimeDir, Z as runWithHeldLock, hn as __exportAll, q as releaseLock } from "./base-url-Bdqmyw0D.js";
|
|
4
|
+
import { n as daemonServiceControllerSchema } from "./service-contract-DZWQdPz5.js";
|
|
5
|
+
import { tmpdir } from "node:os";
|
|
6
|
+
import { z } from "zod/v4";
|
|
7
|
+
import { dirname, join } from "node:path";
|
|
8
|
+
import { createHash, randomBytes } from "node:crypto";
|
|
9
|
+
import { chmod, mkdir, readFile, rename, rm, stat, writeFile } from "node:fs/promises";
|
|
10
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
11
|
+
//#region ../../packages/schemas/dist/schemas/daemon/runtime-lease.js
|
|
12
|
+
const daemonRuntimeLeaseModeSchema = z.enum(["foreground", "background"]);
|
|
13
|
+
const daemonRuntimeLeaseSchema = z.strictObject({
|
|
14
|
+
schema: z.literal("openmeld-daemon-runtime-lease-v1"),
|
|
15
|
+
v: z.literal(1),
|
|
16
|
+
generation: z.int().nonnegative(),
|
|
17
|
+
bundleId: z.string().min(1),
|
|
18
|
+
pid: z.int().positive(),
|
|
19
|
+
mode: daemonRuntimeLeaseModeSchema,
|
|
20
|
+
startedAt: z.string().min(1),
|
|
21
|
+
updatedAt: z.string().min(1),
|
|
22
|
+
heartbeatAt: z.string().nullable(),
|
|
23
|
+
serviceController: daemonServiceControllerSchema,
|
|
24
|
+
managedBySystemService: z.boolean()
|
|
25
|
+
});
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/config/daemon-local-state-file.ts
|
|
28
|
+
async function readDaemonLocalStateFile(input) {
|
|
29
|
+
const raw = await readFile(input.path, "utf8").catch((error) => {
|
|
30
|
+
if (error && typeof error === "object" && "code" in error && error.code === "ENOENT") return null;
|
|
31
|
+
throw error;
|
|
32
|
+
});
|
|
33
|
+
if (raw === null) return null;
|
|
34
|
+
const parsedJson = safeParseJson(raw);
|
|
35
|
+
if (parsedJson === null) return null;
|
|
36
|
+
const parsed = input.schema.safeParse(parsedJson);
|
|
37
|
+
return parsed.success ? parsed.data : null;
|
|
38
|
+
}
|
|
39
|
+
async function writeDaemonLocalStateFile(input) {
|
|
40
|
+
const parsed = input.schema.safeParse(input.value);
|
|
41
|
+
if (!parsed.success) throw new Error(`invalid daemon local state for ${input.path}`);
|
|
42
|
+
await mkdir(dirname(input.path), { recursive: true });
|
|
43
|
+
const tempPath = `${input.path}.tmp-${process.pid}-${Date.now()}`;
|
|
44
|
+
let shouldCleanupTemp = true;
|
|
45
|
+
try {
|
|
46
|
+
await writeFile(tempPath, `${JSON.stringify(parsed.data, null, 2)}\n`, {
|
|
47
|
+
encoding: "utf8",
|
|
48
|
+
...typeof input.mode === "number" ? { mode: input.mode } : {}
|
|
49
|
+
});
|
|
50
|
+
await rename(tempPath, input.path);
|
|
51
|
+
if (typeof input.mode === "number") await chmod(input.path, input.mode);
|
|
52
|
+
shouldCleanupTemp = false;
|
|
53
|
+
} finally {
|
|
54
|
+
if (shouldCleanupTemp) await rm(tempPath, { force: true }).catch(() => void 0);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function safeParseJson(raw) {
|
|
58
|
+
try {
|
|
59
|
+
return JSON.parse(raw);
|
|
60
|
+
} catch {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region src/config/daemon-state.ts
|
|
66
|
+
const DAEMON_STATE_SCHEMA = "openmeld-daemon-install-v1";
|
|
67
|
+
const DAEMON_SERVICE_RUNTIME_STATE_SCHEMA = "openmeld-daemon-service-state-v1";
|
|
68
|
+
const DAEMON_SERVICE_RUNTIME_MODE_ENV = "OPENMELD_DAEMON_RUNTIME_MODE";
|
|
69
|
+
const DAEMON_SERVICE_RUNTIME_DETACHED_ENV = "OPENMELD_DAEMON_RUNTIME_DETACHED";
|
|
70
|
+
const DAEMON_SERVICE_RUNTIME_CONTROLLER_ENV = "OPENMELD_DAEMON_SERVICE_CONTROLLER";
|
|
71
|
+
const DAEMON_SERVICE_RUNTIME_AUTO_START_ENV = "OPENMELD_DAEMON_SERVICE_AUTO_START";
|
|
72
|
+
const DAEMON_SERVICE_RUNTIME_SYSTEM_SERVICE_ENV = "OPENMELD_DAEMON_RUNTIME_SYSTEM_SERVICE";
|
|
73
|
+
const DAEMON_TOKEN_SCHEMA = "openmeld-daemon-token-v1";
|
|
74
|
+
const DAEMON_TOKEN_ROTATE_MAX_AGE_MS = 1440 * 60 * 1e3;
|
|
75
|
+
const DAEMON_HEARTBEAT_STALE_MS = 180 * 1e3;
|
|
76
|
+
const DAEMON_ACTIVE_BUNDLE_STATE_FILENAME = "active-bundle.json";
|
|
77
|
+
const DAEMON_DISPATCH_JOURNAL_FILENAME = "daemon-dispatch-journal.jsonl";
|
|
78
|
+
const DAEMON_LIFECYCLE_JOURNAL_FILENAME = "daemon-lifecycle-journal.jsonl";
|
|
79
|
+
const DAEMON_REPAIR_JOURNAL_FILENAME = "repair-journal.json";
|
|
80
|
+
const DAEMON_SERVICE_LOCK_PROFILE = "daemon-service";
|
|
81
|
+
const DAEMON_SERVICE_LOCK_KEY = "daemon-service-run";
|
|
82
|
+
const daemonServiceLifecycleLockContext = new AsyncLocalStorage();
|
|
83
|
+
const DAEMON_STABLE_LAUNCHER_FILENAME = "daemon-service-launcher.mjs";
|
|
84
|
+
const DAEMON_SERVICE_EXECUTABLE_WRAPPER_FILENAME_BY_PRESET = {
|
|
85
|
+
prod: "OpenMeld Service",
|
|
86
|
+
"dev-local": "OpenMeld Service Dev",
|
|
87
|
+
canary: "OpenMeld Service Canary"
|
|
88
|
+
};
|
|
89
|
+
const DAEMON_SERVICE_LEGACY_EXECUTABLE_WRAPPER_FILENAME_BY_PRESET = {
|
|
90
|
+
prod: "openmeld-service",
|
|
91
|
+
"dev-local": "openmeld-dev-service",
|
|
92
|
+
canary: "openmeld-canary-service"
|
|
93
|
+
};
|
|
94
|
+
const DAEMON_SERVICE_LIFECYCLE_LOCK_PROFILE = DAEMON_SERVICE_LOCK_PROFILE;
|
|
95
|
+
const DAEMON_SERVICE_LIFECYCLE_LOCK_KEY = DAEMON_SERVICE_LOCK_KEY;
|
|
96
|
+
async function getDaemonStatus(pathInput = {}) {
|
|
97
|
+
const [state, runtimeExists] = await Promise.all([readDaemonInstallState(pathInput), pathExists(daemonRuntimeRootPath(pathInput))]);
|
|
98
|
+
if (state && runtimeExists) return {
|
|
99
|
+
installed: true,
|
|
100
|
+
state
|
|
101
|
+
};
|
|
102
|
+
return {
|
|
103
|
+
installed: false,
|
|
104
|
+
state: null
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
async function getDaemonRuntimeStatus(pathInput = {}) {
|
|
108
|
+
const state = await readDaemonServiceRuntimeState(pathInput);
|
|
109
|
+
if (!state) return {
|
|
110
|
+
status: "not_running",
|
|
111
|
+
mode: null,
|
|
112
|
+
pid: null,
|
|
113
|
+
startedAt: null,
|
|
114
|
+
updatedAt: null,
|
|
115
|
+
managedBySystemService: false,
|
|
116
|
+
serviceController: "unknown",
|
|
117
|
+
autoStart: false
|
|
118
|
+
};
|
|
119
|
+
if (!Number.isInteger(state.pid) || state.pid <= 0) return {
|
|
120
|
+
status: "stale",
|
|
121
|
+
mode: state.mode,
|
|
122
|
+
pid: state.pid,
|
|
123
|
+
startedAt: state.startedAt,
|
|
124
|
+
updatedAt: state.updatedAt,
|
|
125
|
+
managedBySystemService: state.managedBySystemService,
|
|
126
|
+
serviceController: state.serviceController,
|
|
127
|
+
autoStart: state.autoStart,
|
|
128
|
+
reason: "invalid_pid"
|
|
129
|
+
};
|
|
130
|
+
if (!isPidAlive(state.pid)) return {
|
|
131
|
+
status: "stale",
|
|
132
|
+
mode: state.mode,
|
|
133
|
+
pid: state.pid,
|
|
134
|
+
startedAt: state.startedAt,
|
|
135
|
+
updatedAt: state.updatedAt,
|
|
136
|
+
managedBySystemService: state.managedBySystemService,
|
|
137
|
+
serviceController: state.serviceController,
|
|
138
|
+
autoStart: state.autoStart,
|
|
139
|
+
reason: "process_not_alive"
|
|
140
|
+
};
|
|
141
|
+
if (isDaemonServiceRuntimeHeartbeatStale(state)) return {
|
|
142
|
+
status: "stale",
|
|
143
|
+
mode: state.mode,
|
|
144
|
+
pid: state.pid,
|
|
145
|
+
startedAt: state.startedAt,
|
|
146
|
+
updatedAt: state.updatedAt,
|
|
147
|
+
managedBySystemService: state.managedBySystemService,
|
|
148
|
+
serviceController: state.serviceController,
|
|
149
|
+
autoStart: state.autoStart,
|
|
150
|
+
reason: "heartbeat_stale"
|
|
151
|
+
};
|
|
152
|
+
return {
|
|
153
|
+
status: "running",
|
|
154
|
+
mode: state.mode,
|
|
155
|
+
pid: state.pid,
|
|
156
|
+
startedAt: state.startedAt,
|
|
157
|
+
updatedAt: state.updatedAt,
|
|
158
|
+
managedBySystemService: state.managedBySystemService,
|
|
159
|
+
serviceController: state.serviceController,
|
|
160
|
+
autoStart: state.autoStart
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
async function readDaemonServiceRuntimeSnapshot(pathInput = {}) {
|
|
164
|
+
return await readDaemonServiceRuntimeState(pathInput);
|
|
165
|
+
}
|
|
166
|
+
function resolveDaemonServiceRuntimeMetadata(input = {}) {
|
|
167
|
+
const env = input.env ?? process.env;
|
|
168
|
+
const managedBySystemService = input.managedBySystemService === true || env["OPENMELD_DAEMON_RUNTIME_SYSTEM_SERVICE"] === "1";
|
|
169
|
+
const serviceControllerInput = typeof input.serviceController === "string" && input.serviceController.length > 0 ? input.serviceController : env[DAEMON_SERVICE_RUNTIME_CONTROLLER_ENV];
|
|
170
|
+
const autoStart = input.autoStart === true || env["OPENMELD_DAEMON_SERVICE_AUTO_START"] === "1";
|
|
171
|
+
return {
|
|
172
|
+
managedBySystemService,
|
|
173
|
+
serviceController: parseDaemonServiceController(serviceControllerInput),
|
|
174
|
+
autoStart
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
async function setDaemonServiceRuntimeState(state, pathInput = {}) {
|
|
178
|
+
await writeDaemonServiceRuntimeState(state, pathInput);
|
|
179
|
+
}
|
|
180
|
+
async function clearDaemonServiceRuntimeState(pathInput = {}) {
|
|
181
|
+
const { clearDaemonRuntimeLease } = await Promise.resolve().then(() => daemon_runtime_lease_exports);
|
|
182
|
+
await Promise.all([rm(daemonServiceRuntimeStatePath(pathInput), { force: true }), clearDaemonRuntimeLease(pathInput)]);
|
|
183
|
+
}
|
|
184
|
+
function withDaemonServiceRunLock(callback, meta = {
|
|
185
|
+
intent: "run_background",
|
|
186
|
+
command: "openmeld service start"
|
|
187
|
+
}) {
|
|
188
|
+
return withDaemonServiceLifecycleLock(meta, callback);
|
|
189
|
+
}
|
|
190
|
+
async function acquireDaemonServiceLifecycleLock(meta = {
|
|
191
|
+
intent: "run_background",
|
|
192
|
+
command: "openmeld service start"
|
|
193
|
+
}, pathResolution = resolveOpenMeldPresetOwnedPathInput()) {
|
|
194
|
+
return await acquireLock({
|
|
195
|
+
openMeldProfileId: DAEMON_SERVICE_LIFECYCLE_LOCK_PROFILE,
|
|
196
|
+
key: DAEMON_SERVICE_LIFECYCLE_LOCK_KEY,
|
|
197
|
+
meta,
|
|
198
|
+
pathResolution
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
async function releaseDaemonServiceLifecycleLock(lock) {
|
|
202
|
+
await releaseLock(lock);
|
|
203
|
+
}
|
|
204
|
+
function withDaemonServiceStopLock(callback, meta = {
|
|
205
|
+
intent: "stop",
|
|
206
|
+
command: "openmeld service stop"
|
|
207
|
+
}) {
|
|
208
|
+
return withDaemonServiceLifecycleLock(meta, callback);
|
|
209
|
+
}
|
|
210
|
+
function withDaemonServiceReconcileLock(callback, meta = {
|
|
211
|
+
intent: "upgrade_reconcile",
|
|
212
|
+
command: "openmeld service update"
|
|
213
|
+
}) {
|
|
214
|
+
return withDaemonServiceLifecycleLock(meta, callback);
|
|
215
|
+
}
|
|
216
|
+
function withDaemonServiceRegistrationMutationLock(callback, meta) {
|
|
217
|
+
return withDaemonServiceLifecycleLock(meta, callback);
|
|
218
|
+
}
|
|
219
|
+
function withDaemonServiceLifecycleLock(meta, callback) {
|
|
220
|
+
const pathResolution = resolveOpenMeldPresetOwnedPathInput();
|
|
221
|
+
const ownerRoot = resolveOpenMeldRootDir(pathResolution);
|
|
222
|
+
const currentContext = daemonServiceLifecycleLockContext.getStore();
|
|
223
|
+
if (currentContext?.active && currentContext.ownerRoot === ownerRoot) {
|
|
224
|
+
let operation;
|
|
225
|
+
try {
|
|
226
|
+
operation = callback();
|
|
227
|
+
} catch (error) {
|
|
228
|
+
operation = Promise.reject(error);
|
|
229
|
+
}
|
|
230
|
+
let trackedOperation;
|
|
231
|
+
trackedOperation = operation.then(() => void 0, (error) => {
|
|
232
|
+
currentContext.failures.push(error);
|
|
233
|
+
}).finally(() => {
|
|
234
|
+
currentContext.pendingOperations.delete(trackedOperation);
|
|
235
|
+
});
|
|
236
|
+
currentContext.pendingOperations.add(trackedOperation);
|
|
237
|
+
return operation;
|
|
238
|
+
}
|
|
239
|
+
return withDaemonServiceLifecycleOwnerLock({
|
|
240
|
+
callback,
|
|
241
|
+
meta,
|
|
242
|
+
ownerRoot,
|
|
243
|
+
pathResolution
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
async function withDaemonServiceLifecycleOwnerLock(input) {
|
|
247
|
+
return await runWithHeldLock({
|
|
248
|
+
lock: await acquireDaemonServiceLifecycleLock(input.meta, input.pathResolution),
|
|
249
|
+
run: async () => {
|
|
250
|
+
const context = {
|
|
251
|
+
active: true,
|
|
252
|
+
failures: [],
|
|
253
|
+
ownerRoot: input.ownerRoot,
|
|
254
|
+
pendingOperations: /* @__PURE__ */ new Set()
|
|
255
|
+
};
|
|
256
|
+
let outcome;
|
|
257
|
+
try {
|
|
258
|
+
outcome = {
|
|
259
|
+
ok: true,
|
|
260
|
+
value: await daemonServiceLifecycleLockContext.run(context, input.callback)
|
|
261
|
+
};
|
|
262
|
+
} catch (error) {
|
|
263
|
+
outcome = {
|
|
264
|
+
ok: false,
|
|
265
|
+
error
|
|
266
|
+
};
|
|
267
|
+
} finally {
|
|
268
|
+
while (context.pendingOperations.size > 0) await Promise.all([...context.pendingOperations]);
|
|
269
|
+
context.active = false;
|
|
270
|
+
}
|
|
271
|
+
const failures = [...outcome.ok ? [] : [outcome.error], ...context.failures].filter((failure, index, allFailures) => allFailures.indexOf(failure) === index);
|
|
272
|
+
if (failures.length === 1) throw failures[0];
|
|
273
|
+
if (failures.length > 1) throw new AggregateError(failures, "daemon service lifecycle mutation failed in more than one operation");
|
|
274
|
+
if (!outcome.ok) throw outcome.error;
|
|
275
|
+
return outcome.value;
|
|
276
|
+
},
|
|
277
|
+
releaseContext: {
|
|
278
|
+
command: input.meta.command,
|
|
279
|
+
component: "daemon_service_lifecycle",
|
|
280
|
+
intent: input.meta.intent,
|
|
281
|
+
lockKey: DAEMON_SERVICE_LIFECYCLE_LOCK_KEY,
|
|
282
|
+
openMeldProfileId: DAEMON_SERVICE_LIFECYCLE_LOCK_PROFILE
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
async function readDaemonServiceLifecycleLockMeta() {
|
|
287
|
+
const meta = await readLockMeta({
|
|
288
|
+
openMeldProfileId: DAEMON_SERVICE_LIFECYCLE_LOCK_PROFILE,
|
|
289
|
+
key: DAEMON_SERVICE_LIFECYCLE_LOCK_KEY,
|
|
290
|
+
pathResolution: resolveOpenMeldPresetOwnedPathInput()
|
|
291
|
+
});
|
|
292
|
+
if (!meta) return null;
|
|
293
|
+
const intent = typeof meta.intent === "string" ? normalizeDaemonLifecycleIntent(meta.intent) : null;
|
|
294
|
+
const command = typeof meta.command === "string" ? meta.command.trim() : "";
|
|
295
|
+
if (!intent || command.length === 0) return null;
|
|
296
|
+
const pid = typeof meta.pid === "number" ? meta.pid : void 0;
|
|
297
|
+
const sessionId = typeof meta.sessionId === "string" && meta.sessionId.trim().length > 0 ? meta.sessionId.trim() : void 0;
|
|
298
|
+
const at = typeof meta.at === "string" && meta.at.trim().length > 0 ? meta.at.trim() : void 0;
|
|
299
|
+
return {
|
|
300
|
+
intent,
|
|
301
|
+
command,
|
|
302
|
+
...typeof pid === "number" ? { pid } : {},
|
|
303
|
+
...sessionId ? { sessionId } : {},
|
|
304
|
+
...at ? { at } : {}
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
async function readDaemonServiceLifecycleLockMetaWithCleanup() {
|
|
308
|
+
await tryCleanupStaleLock({
|
|
309
|
+
openMeldProfileId: DAEMON_SERVICE_LIFECYCLE_LOCK_PROFILE,
|
|
310
|
+
key: DAEMON_SERVICE_LIFECYCLE_LOCK_KEY,
|
|
311
|
+
pathResolution: resolveOpenMeldPresetOwnedPathInput()
|
|
312
|
+
});
|
|
313
|
+
return await readDaemonServiceLifecycleLockMeta();
|
|
314
|
+
}
|
|
315
|
+
async function installDaemon(input) {
|
|
316
|
+
const existingState = await readDaemonInstallState();
|
|
317
|
+
const runtimeExists = await pathExists(daemonRuntimeRootPath());
|
|
318
|
+
if (existingState && runtimeExists && existingState.daemonVersion === input.daemonVersion) {
|
|
319
|
+
await ensureDaemonTokenState();
|
|
320
|
+
return {
|
|
321
|
+
status: "already_installed",
|
|
322
|
+
state: existingState
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
await ensureDaemonRuntimeLayout();
|
|
326
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
327
|
+
const nextState = {
|
|
328
|
+
v: 1,
|
|
329
|
+
schema: DAEMON_STATE_SCHEMA,
|
|
330
|
+
daemonVersion: input.daemonVersion,
|
|
331
|
+
installSource: input.source,
|
|
332
|
+
installedAt: existingState?.installedAt ?? now,
|
|
333
|
+
updatedAt: now
|
|
334
|
+
};
|
|
335
|
+
await writeDaemonInstallState(nextState);
|
|
336
|
+
await ensureDaemonTokenState();
|
|
337
|
+
return {
|
|
338
|
+
status: "installed",
|
|
339
|
+
state: nextState
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
async function uninstallDaemon(pathInput = {}) {
|
|
343
|
+
const [hasState, hasRuntimeDir, hasToken] = await Promise.all([
|
|
344
|
+
pathExists(daemonStatePath(pathInput)),
|
|
345
|
+
pathExists(daemonRuntimeRootPath(pathInput)),
|
|
346
|
+
pathExists(daemonTokenPath(pathInput))
|
|
347
|
+
]);
|
|
348
|
+
await Promise.all([
|
|
349
|
+
rm(daemonStatePath(pathInput), { force: true }),
|
|
350
|
+
rm(daemonTokenPath(pathInput), { force: true }),
|
|
351
|
+
rm(daemonServiceRuntimeStatePath(pathInput), { force: true }),
|
|
352
|
+
rm(daemonRuntimeRootPath(pathInput), {
|
|
353
|
+
recursive: true,
|
|
354
|
+
force: true
|
|
355
|
+
})
|
|
356
|
+
]);
|
|
357
|
+
return { removed: hasState || hasRuntimeDir || hasToken };
|
|
358
|
+
}
|
|
359
|
+
function daemonStatePath(pathInput = {}) {
|
|
360
|
+
return join(systemDir(pathInput), "daemon-install.json");
|
|
361
|
+
}
|
|
362
|
+
function daemonRuntimeRootPath(pathInput = {}) {
|
|
363
|
+
return join(runtimeDir(pathInput), "daemon");
|
|
364
|
+
}
|
|
365
|
+
function daemonServiceRuntimeStatePath(pathInput = {}) {
|
|
366
|
+
return join(daemonRuntimeRootPath(pathInput), "service-runtime.json");
|
|
367
|
+
}
|
|
368
|
+
function daemonRuntimeDataPath(pathInput = {}) {
|
|
369
|
+
return join(daemonRuntimeRootPath(pathInput), "data");
|
|
370
|
+
}
|
|
371
|
+
function daemonRuntimeBundlesPath(pathInput = {}) {
|
|
372
|
+
return join(daemonRuntimeRootPath(pathInput), "bundles");
|
|
373
|
+
}
|
|
374
|
+
function daemonRuntimeStateRootPath(pathInput = {}) {
|
|
375
|
+
return join(daemonRuntimeRootPath(pathInput), "state");
|
|
376
|
+
}
|
|
377
|
+
function daemonLifecycleJournalPath(pathInput = {}) {
|
|
378
|
+
return join(daemonRuntimeRootPath(pathInput), "logs", DAEMON_LIFECYCLE_JOURNAL_FILENAME);
|
|
379
|
+
}
|
|
380
|
+
function daemonDispatchJournalPath(pathInput = {}) {
|
|
381
|
+
return join(daemonRuntimeRootPath(pathInput), "logs", DAEMON_DISPATCH_JOURNAL_FILENAME);
|
|
382
|
+
}
|
|
383
|
+
function daemonServiceActiveBundleStatePath(pathInput = {}) {
|
|
384
|
+
return join(daemonRuntimeStateRootPath(pathInput), DAEMON_ACTIVE_BUNDLE_STATE_FILENAME);
|
|
385
|
+
}
|
|
386
|
+
function daemonServiceRepairJournalPath(pathInput = {}) {
|
|
387
|
+
return join(daemonRuntimeStateRootPath(pathInput), DAEMON_REPAIR_JOURNAL_FILENAME);
|
|
388
|
+
}
|
|
389
|
+
function daemonRuntimeServiceManagerPath(pathInput = {}) {
|
|
390
|
+
return join(daemonRuntimeRootPath(pathInput), "service-manager");
|
|
391
|
+
}
|
|
392
|
+
function daemonServiceStableLauncherPath(pathInput = {}) {
|
|
393
|
+
return join(daemonRuntimeServiceManagerPath(pathInput), DAEMON_STABLE_LAUNCHER_FILENAME);
|
|
394
|
+
}
|
|
395
|
+
function daemonServiceStableExecutableWrapperPath(pathInput = {}) {
|
|
396
|
+
const preset = resolveOpenMeldEnvPreset(pathInput);
|
|
397
|
+
return join(daemonRuntimeServiceManagerPath(pathInput), DAEMON_SERVICE_EXECUTABLE_WRAPPER_FILENAME_BY_PRESET[preset]);
|
|
398
|
+
}
|
|
399
|
+
function daemonServiceLegacyExecutableWrapperPath(pathInput = {}) {
|
|
400
|
+
const preset = resolveOpenMeldEnvPreset(pathInput);
|
|
401
|
+
return join(daemonRuntimeServiceManagerPath(pathInput), DAEMON_SERVICE_LEGACY_EXECUTABLE_WRAPPER_FILENAME_BY_PRESET[preset]);
|
|
402
|
+
}
|
|
403
|
+
function daemonServiceRecognizedExecutableWrapperPaths(pathInput = {}) {
|
|
404
|
+
return [daemonServiceStableExecutableWrapperPath(pathInput), daemonServiceLegacyExecutableWrapperPath(pathInput)];
|
|
405
|
+
}
|
|
406
|
+
function daemonTokenPath(pathInput = {}) {
|
|
407
|
+
return join(systemDir(pathInput), "daemon-token.json");
|
|
408
|
+
}
|
|
409
|
+
async function restoreDaemonInstallStateSnapshot(snapshot, pathInput = {}) {
|
|
410
|
+
if (!snapshot) {
|
|
411
|
+
await rm(daemonStatePath(pathInput), { force: true });
|
|
412
|
+
return;
|
|
413
|
+
}
|
|
414
|
+
await writeDaemonInstallState(snapshot, pathInput);
|
|
415
|
+
}
|
|
416
|
+
function resolveDaemonControlPlaneEndpoint(pathInput = {}) {
|
|
417
|
+
const runtimeRoot = daemonRuntimeRootPath(pathInput);
|
|
418
|
+
const suffix = createHash("sha256").update(runtimeRoot).digest("hex").slice(0, 24);
|
|
419
|
+
if (process.platform === "win32") return `\\\\.\\pipe\\openmeld-daemon-control-${suffix}`;
|
|
420
|
+
return join(tmpdir(), `openmeld-daemon-control-${suffix}.sock`);
|
|
421
|
+
}
|
|
422
|
+
async function ensureDaemonControlPlaneToken(pathInput = {}) {
|
|
423
|
+
return (await ensureDaemonTokenState(pathInput)).token;
|
|
424
|
+
}
|
|
425
|
+
async function readDaemonControlPlaneToken(pathInput = {}) {
|
|
426
|
+
return (await readDaemonTokenState(pathInput))?.token ?? null;
|
|
427
|
+
}
|
|
428
|
+
function isPidAlive(pid) {
|
|
429
|
+
try {
|
|
430
|
+
process.kill(pid, 0);
|
|
431
|
+
return true;
|
|
432
|
+
} catch (error) {
|
|
433
|
+
return !(error instanceof Error && error.code === "ESRCH");
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
async function readDaemonServiceRuntimeState(pathInput = {}) {
|
|
437
|
+
const raw = await readFile(daemonServiceRuntimeStatePath(pathInput), "utf8").catch((error) => {
|
|
438
|
+
if (error && typeof error === "object" && "code" in error && error.code === "ENOENT") return null;
|
|
439
|
+
throw error;
|
|
440
|
+
});
|
|
441
|
+
if (raw === null) return null;
|
|
442
|
+
return parseDaemonServiceRuntimeState(raw);
|
|
443
|
+
}
|
|
444
|
+
function parseDaemonServiceRuntimeState(raw) {
|
|
445
|
+
try {
|
|
446
|
+
const parsed = JSON.parse(raw);
|
|
447
|
+
if (!isDaemonServiceRuntimeStateObject(parsed)) return null;
|
|
448
|
+
return {
|
|
449
|
+
v: 1,
|
|
450
|
+
schema: DAEMON_SERVICE_RUNTIME_STATE_SCHEMA,
|
|
451
|
+
status: "running",
|
|
452
|
+
pid: parsed.pid,
|
|
453
|
+
mode: parsed.mode,
|
|
454
|
+
command: parsed.command,
|
|
455
|
+
gatewayUrl: parseNullableString(parsed.gatewayUrl),
|
|
456
|
+
openMeldProfileId: resolveStoredDaemonServiceOpenMeldProfileId(parsed),
|
|
457
|
+
stopRequestedAt: parseNullableString(parsed.stopRequestedAt),
|
|
458
|
+
heartbeatAt: parseNullableString(parsed.heartbeatAt),
|
|
459
|
+
startedAt: parsed.startedAt,
|
|
460
|
+
updatedAt: parsed.updatedAt,
|
|
461
|
+
managedBySystemService: parsed.managedBySystemService === true,
|
|
462
|
+
serviceController: parseDaemonServiceController(parsed.serviceController),
|
|
463
|
+
autoStart: parsed.autoStart === true
|
|
464
|
+
};
|
|
465
|
+
} catch {
|
|
466
|
+
return null;
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
function isDaemonServiceRuntimeStateObject(value) {
|
|
470
|
+
if (!value || typeof value !== "object") return false;
|
|
471
|
+
const candidate = value;
|
|
472
|
+
return candidate.v === 1 && candidate.schema === "openmeld-daemon-service-state-v1" && candidate.status === "running" && typeof candidate.pid === "number" && candidate.pid > 0 && (candidate.mode === "foreground" || candidate.mode === "background") && typeof candidate.command === "string" && candidate.command.length > 0 && isValidNullableString(candidate.gatewayUrl) && isValidOptionalNullableString(candidate.openMeldProfileId) && isValidOptionalNullableString(candidate.profile) && isValidNullableString(candidate.stopRequestedAt) && isValidNullableString(candidate.heartbeatAt) && typeof candidate.startedAt === "string" && candidate.startedAt.length > 0 && typeof candidate.updatedAt === "string" && candidate.updatedAt.length > 0;
|
|
473
|
+
}
|
|
474
|
+
function parseDaemonServiceController(value) {
|
|
475
|
+
if (value === "launchd" || value === "systemd" || value === "windows-service" || value === "legacy-detached" || value === "unknown") return value;
|
|
476
|
+
return "unknown";
|
|
477
|
+
}
|
|
478
|
+
function isValidNullableString(value) {
|
|
479
|
+
return value === null || typeof value === "string";
|
|
480
|
+
}
|
|
481
|
+
function isValidOptionalNullableString(value) {
|
|
482
|
+
return value === void 0 || value === null || typeof value === "string";
|
|
483
|
+
}
|
|
484
|
+
function parseNullableString(value) {
|
|
485
|
+
if (value === null) return null;
|
|
486
|
+
if (typeof value !== "string") return null;
|
|
487
|
+
return value;
|
|
488
|
+
}
|
|
489
|
+
function resolveStoredDaemonServiceOpenMeldProfileId(input) {
|
|
490
|
+
const openMeldProfileId = parseNullableString(input.openMeldProfileId);
|
|
491
|
+
const legacyProfile = parseNullableString(input.profile);
|
|
492
|
+
if (openMeldProfileId && legacyProfile && openMeldProfileId !== legacyProfile) throw new Error("conflicting openMeldProfileId values");
|
|
493
|
+
return openMeldProfileId ?? legacyProfile;
|
|
494
|
+
}
|
|
495
|
+
function isDaemonServiceRuntimeHeartbeatStale(state) {
|
|
496
|
+
const latestSignalAt = Math.max(parseIsoTimestampOrZero(state.heartbeatAt), parseIsoTimestampOrZero(state.updatedAt));
|
|
497
|
+
if (latestSignalAt <= 0) return false;
|
|
498
|
+
return Date.now() - latestSignalAt > DAEMON_HEARTBEAT_STALE_MS;
|
|
499
|
+
}
|
|
500
|
+
function parseIsoTimestampOrZero(value) {
|
|
501
|
+
if (!value) return 0;
|
|
502
|
+
const parsed = Date.parse(value);
|
|
503
|
+
return Number.isFinite(parsed) ? parsed : 0;
|
|
504
|
+
}
|
|
505
|
+
async function writeDaemonServiceRuntimeState(state, pathInput = {}) {
|
|
506
|
+
const path = daemonServiceRuntimeStatePath(pathInput);
|
|
507
|
+
await mkdir(daemonRuntimeRootPath(pathInput), { recursive: true });
|
|
508
|
+
const tempPath = `${path}.tmp-${process.pid}-${Date.now()}`;
|
|
509
|
+
let shouldCleanupTemp = true;
|
|
510
|
+
try {
|
|
511
|
+
await writeFile(tempPath, `${JSON.stringify(state, null, 2)}\n`, {
|
|
512
|
+
encoding: "utf8",
|
|
513
|
+
mode: 384
|
|
514
|
+
});
|
|
515
|
+
await rename(tempPath, path);
|
|
516
|
+
await chmod(path, 384);
|
|
517
|
+
shouldCleanupTemp = false;
|
|
518
|
+
} finally {
|
|
519
|
+
if (shouldCleanupTemp) await rm(tempPath, { force: true }).catch(() => void 0);
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
async function ensureDaemonRuntimeLayout() {
|
|
523
|
+
await Promise.all([
|
|
524
|
+
mkdir(systemDir(), { recursive: true }),
|
|
525
|
+
mkdir(join(daemonRuntimeRootPath(), "bin"), { recursive: true }),
|
|
526
|
+
mkdir(daemonRuntimeBundlesPath(), { recursive: true }),
|
|
527
|
+
mkdir(join(daemonRuntimeRootPath(), "data"), { recursive: true }),
|
|
528
|
+
mkdir(join(daemonRuntimeRootPath(), "logs"), { recursive: true }),
|
|
529
|
+
mkdir(daemonRuntimeStateRootPath(), { recursive: true }),
|
|
530
|
+
mkdir(daemonRuntimeServiceManagerPath(), { recursive: true })
|
|
531
|
+
]);
|
|
532
|
+
}
|
|
533
|
+
function normalizeDaemonLifecycleIntent(value) {
|
|
534
|
+
switch (value) {
|
|
535
|
+
case "run_background":
|
|
536
|
+
case "run_foreground":
|
|
537
|
+
case "stop":
|
|
538
|
+
case "autostart":
|
|
539
|
+
case "status_cleanup":
|
|
540
|
+
case "startup_check":
|
|
541
|
+
case "start":
|
|
542
|
+
case "reinstall":
|
|
543
|
+
case "uninstall":
|
|
544
|
+
case "upgrade_reconcile": return value;
|
|
545
|
+
default: return null;
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
async function ensureDaemonTokenState(pathInput = {}) {
|
|
549
|
+
const current = await readDaemonTokenState(pathInput);
|
|
550
|
+
if (current && !isDaemonTokenExpired(current)) {
|
|
551
|
+
await chmod(daemonTokenPath(pathInput), 384).catch(() => void 0);
|
|
552
|
+
return current;
|
|
553
|
+
}
|
|
554
|
+
const nowIso = (/* @__PURE__ */ new Date()).toISOString();
|
|
555
|
+
const next = {
|
|
556
|
+
v: 1,
|
|
557
|
+
schema: DAEMON_TOKEN_SCHEMA,
|
|
558
|
+
token: createDaemonTokenValue(),
|
|
559
|
+
issuedAt: nowIso,
|
|
560
|
+
updatedAt: nowIso
|
|
561
|
+
};
|
|
562
|
+
await writeDaemonTokenState(next, pathInput);
|
|
563
|
+
return next;
|
|
564
|
+
}
|
|
565
|
+
async function readDaemonInstallState(pathInput = {}) {
|
|
566
|
+
const raw = await readFile(daemonStatePath(pathInput), "utf8").catch((error) => {
|
|
567
|
+
if (error && typeof error === "object" && "code" in error && error.code === "ENOENT") return null;
|
|
568
|
+
throw error;
|
|
569
|
+
});
|
|
570
|
+
if (raw === null) return null;
|
|
571
|
+
return parseDaemonInstallState(raw);
|
|
572
|
+
}
|
|
573
|
+
function parseDaemonInstallState(raw) {
|
|
574
|
+
try {
|
|
575
|
+
const parsed = JSON.parse(raw);
|
|
576
|
+
if (parsed.v !== 1) return null;
|
|
577
|
+
if (parsed.schema !== DAEMON_STATE_SCHEMA) return null;
|
|
578
|
+
if (typeof parsed.daemonVersion !== "string" || !parsed.daemonVersion) return null;
|
|
579
|
+
if (!isDaemonInstallSource(parsed.installSource)) return null;
|
|
580
|
+
if (typeof parsed.installedAt !== "string" || !parsed.installedAt) return null;
|
|
581
|
+
if (typeof parsed.updatedAt !== "string" || !parsed.updatedAt) return null;
|
|
582
|
+
return {
|
|
583
|
+
v: 1,
|
|
584
|
+
schema: DAEMON_STATE_SCHEMA,
|
|
585
|
+
daemonVersion: parsed.daemonVersion,
|
|
586
|
+
installSource: parsed.installSource,
|
|
587
|
+
installedAt: parsed.installedAt,
|
|
588
|
+
updatedAt: parsed.updatedAt
|
|
589
|
+
};
|
|
590
|
+
} catch {
|
|
591
|
+
return null;
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
function isDaemonInstallSource(value) {
|
|
595
|
+
return value === "cli.auto_check" || value === "daemon.command.install";
|
|
596
|
+
}
|
|
597
|
+
async function writeDaemonInstallState(state, pathInput = {}) {
|
|
598
|
+
const path = daemonStatePath(pathInput);
|
|
599
|
+
await mkdir(systemDir(pathInput), { recursive: true });
|
|
600
|
+
const tempPath = `${path}.tmp-${process.pid}-${Date.now()}`;
|
|
601
|
+
let shouldCleanupTemp = true;
|
|
602
|
+
try {
|
|
603
|
+
await writeFile(tempPath, `${JSON.stringify(state, null, 2)}\n`, "utf8");
|
|
604
|
+
await rename(tempPath, path);
|
|
605
|
+
shouldCleanupTemp = false;
|
|
606
|
+
} finally {
|
|
607
|
+
if (shouldCleanupTemp) await rm(tempPath, { force: true }).catch(() => void 0);
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
async function readDaemonTokenState(pathInput = {}) {
|
|
611
|
+
const raw = await readFile(daemonTokenPath(pathInput), "utf8").catch((error) => {
|
|
612
|
+
if (error && typeof error === "object" && "code" in error && error.code === "ENOENT") return null;
|
|
613
|
+
throw error;
|
|
614
|
+
});
|
|
615
|
+
if (raw === null) return null;
|
|
616
|
+
return parseDaemonTokenState(raw);
|
|
617
|
+
}
|
|
618
|
+
function parseDaemonTokenState(raw) {
|
|
619
|
+
try {
|
|
620
|
+
const parsed = JSON.parse(raw);
|
|
621
|
+
if (parsed.v !== 1 || parsed.schema !== DAEMON_TOKEN_SCHEMA) return null;
|
|
622
|
+
if (typeof parsed.token !== "string" || parsed.token.length < 16) return null;
|
|
623
|
+
if (typeof parsed.issuedAt !== "string" || !parsed.issuedAt) return null;
|
|
624
|
+
if (typeof parsed.updatedAt !== "string" || !parsed.updatedAt) return null;
|
|
625
|
+
return {
|
|
626
|
+
v: 1,
|
|
627
|
+
schema: DAEMON_TOKEN_SCHEMA,
|
|
628
|
+
token: parsed.token,
|
|
629
|
+
issuedAt: parsed.issuedAt,
|
|
630
|
+
updatedAt: parsed.updatedAt
|
|
631
|
+
};
|
|
632
|
+
} catch {
|
|
633
|
+
return null;
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
async function writeDaemonTokenState(state, pathInput = {}) {
|
|
637
|
+
const path = daemonTokenPath(pathInput);
|
|
638
|
+
await mkdir(systemDir(pathInput), { recursive: true });
|
|
639
|
+
const tempPath = `${path}.tmp-${process.pid}-${Date.now()}`;
|
|
640
|
+
let shouldCleanupTemp = true;
|
|
641
|
+
try {
|
|
642
|
+
await writeFile(tempPath, `${JSON.stringify(state, null, 2)}\n`, {
|
|
643
|
+
encoding: "utf8",
|
|
644
|
+
mode: 384
|
|
645
|
+
});
|
|
646
|
+
await rename(tempPath, path);
|
|
647
|
+
await chmod(path, 384);
|
|
648
|
+
shouldCleanupTemp = false;
|
|
649
|
+
} finally {
|
|
650
|
+
if (shouldCleanupTemp) await rm(tempPath, { force: true }).catch(() => void 0);
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
function isDaemonTokenExpired(state) {
|
|
654
|
+
const updatedAtMs = Date.parse(state.updatedAt);
|
|
655
|
+
if (!Number.isFinite(updatedAtMs)) return true;
|
|
656
|
+
return Date.now() - updatedAtMs >= DAEMON_TOKEN_ROTATE_MAX_AGE_MS;
|
|
657
|
+
}
|
|
658
|
+
function createDaemonTokenValue() {
|
|
659
|
+
return randomBytes(32).toString("base64url");
|
|
660
|
+
}
|
|
661
|
+
async function pathExists(path) {
|
|
662
|
+
try {
|
|
663
|
+
await stat(path);
|
|
664
|
+
return true;
|
|
665
|
+
} catch (error) {
|
|
666
|
+
if (error && typeof error === "object" && "code" in error && error.code === "ENOENT") return false;
|
|
667
|
+
throw error;
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
//#endregion
|
|
671
|
+
//#region src/config/daemon-runtime-lease.ts
|
|
672
|
+
var daemon_runtime_lease_exports = /* @__PURE__ */ __exportAll({
|
|
673
|
+
clearDaemonRuntimeLease: () => clearDaemonRuntimeLease,
|
|
674
|
+
daemonRuntimeLeasePath: () => daemonRuntimeLeasePath,
|
|
675
|
+
readDaemonRuntimeLease: () => readDaemonRuntimeLease,
|
|
676
|
+
writeDaemonRuntimeLease: () => writeDaemonRuntimeLease
|
|
677
|
+
});
|
|
678
|
+
const DAEMON_RUNTIME_LEASE_FILENAME = "runtime-lease.json";
|
|
679
|
+
function daemonRuntimeLeasePath(pathInput = {}) {
|
|
680
|
+
return join(daemonRuntimeStateRootPath(pathInput), DAEMON_RUNTIME_LEASE_FILENAME);
|
|
681
|
+
}
|
|
682
|
+
async function readDaemonRuntimeLease(pathInput = {}) {
|
|
683
|
+
return await readDaemonLocalStateFile({
|
|
684
|
+
path: daemonRuntimeLeasePath(pathInput),
|
|
685
|
+
schema: daemonRuntimeLeaseSchema
|
|
686
|
+
});
|
|
687
|
+
}
|
|
688
|
+
async function writeDaemonRuntimeLease(lease, pathInput = {}) {
|
|
689
|
+
await writeDaemonLocalStateFile({
|
|
690
|
+
path: daemonRuntimeLeasePath(pathInput),
|
|
691
|
+
schema: daemonRuntimeLeaseSchema,
|
|
692
|
+
value: lease,
|
|
693
|
+
mode: 384
|
|
694
|
+
});
|
|
695
|
+
}
|
|
696
|
+
async function clearDaemonRuntimeLease(pathInput = {}) {
|
|
697
|
+
await rm(daemonRuntimeLeasePath(pathInput), { force: true });
|
|
698
|
+
}
|
|
699
|
+
//#endregion
|
|
700
|
+
export { isDaemonServiceRuntimeHeartbeatStale as A, uninstallDaemon as B, daemonServiceStableExecutableWrapperPath as C, getDaemonRuntimeStatus as D, ensureDaemonControlPlaneToken as E, releaseDaemonServiceLifecycleLock as F, readDaemonLocalStateFile as G, withDaemonServiceRegistrationMutationLock as H, resolveDaemonControlPlaneEndpoint as I, writeDaemonLocalStateFile as K, resolveDaemonServiceRuntimeMetadata as L, readDaemonServiceLifecycleLockMeta as M, readDaemonServiceLifecycleLockMetaWithCleanup as N, getDaemonStatus as O, readDaemonServiceRuntimeSnapshot as P, restoreDaemonInstallStateSnapshot as R, daemonServiceRepairJournalPath as S, daemonStatePath as T, withDaemonServiceRunLock as U, withDaemonServiceReconcileLock as V, withDaemonServiceStopLock as W, daemonRuntimeServiceManagerPath as _, DAEMON_SERVICE_RUNTIME_CONTROLLER_ENV as a, daemonServiceLegacyExecutableWrapperPath as b, DAEMON_SERVICE_RUNTIME_STATE_SCHEMA as c, clearDaemonServiceRuntimeState as d, daemonDispatchJournalPath as f, daemonRuntimeRootPath as g, daemonRuntimeDataPath as h, DAEMON_SERVICE_RUNTIME_AUTO_START_ENV as i, readDaemonControlPlaneToken as j, installDaemon as k, DAEMON_SERVICE_RUNTIME_SYSTEM_SERVICE_ENV as l, daemonRuntimeBundlesPath as m, writeDaemonRuntimeLease as n, DAEMON_SERVICE_RUNTIME_DETACHED_ENV as o, daemonLifecycleJournalPath as p, DAEMON_HEARTBEAT_STALE_MS as r, DAEMON_SERVICE_RUNTIME_MODE_ENV as s, readDaemonRuntimeLease as t, acquireDaemonServiceLifecycleLock as u, daemonRuntimeStateRootPath as v, daemonServiceStableLauncherPath as w, daemonServiceRecognizedExecutableWrapperPaths as x, daemonServiceActiveBundleStatePath as y, setDaemonServiceRuntimeState as z };
|
|
701
|
+
|
|
702
|
+
//# sourceMappingURL=daemon-runtime-lease-B9LdD-he.js.map
|