openmeld 0.3.261 → 0.3.263
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 +7 -0
- package/dist/{add-me-membership-erEkzelq.js → add-me-membership-C_t_Mg-Z.js} +2 -2
- package/dist/{add-me-membership-erEkzelq.js.map → add-me-membership-C_t_Mg-Z.js.map} +1 -1
- package/dist/{agents-BGpftZJo.js → agents-DFHWtOt8.js} +13 -13
- package/dist/{agents-BGpftZJo.js.map → agents-DFHWtOt8.js.map} +1 -1
- package/dist/{api-client-foundation-DBl_OaMj.js → api-client-foundation-6MeNwklv.js} +4 -4
- package/dist/{api-client-foundation-DBl_OaMj.js.map → api-client-foundation-6MeNwklv.js.map} +1 -1
- package/dist/{api-client-foundation-DgQRzwbJ.js → api-client-foundation-BPJBWsRD.js} +1 -1
- package/dist/{auth-session-RQOVI0Gb.js → auth-session-B0J2UwSR.js} +5 -5
- package/dist/{auth-session-RQOVI0Gb.js.map → auth-session-B0J2UwSR.js.map} +1 -1
- package/dist/auth-session-DkDdLUPZ.js +4 -0
- package/dist/{auth-url-BH-9HTpn.js → auth-url-BheLcWg9.js} +2 -2
- package/dist/{auth-url-BH-9HTpn.js.map → auth-url-BheLcWg9.js.map} +1 -1
- package/dist/{base-url-B9NwMjEF.js → base-url-CLMqlF1w.js} +3 -3
- package/dist/{base-url-B9NwMjEF.js.map → base-url-CLMqlF1w.js.map} +1 -1
- package/dist/{base-url-DO0hjUUk.js → base-url-D84aBKXK.js} +1 -1
- package/dist/{channel-fUczwp7l.js → channel-7iF6DSp4.js} +2 -2
- package/dist/{channel-fUczwp7l.js.map → channel-7iF6DSp4.js.map} +1 -1
- package/dist/{cloud-computer-CCxIrSZU.js → cloud-computer-BddlwRAk.js} +6 -6
- package/dist/{cloud-computer-CCxIrSZU.js.map → cloud-computer-BddlwRAk.js.map} +1 -1
- package/dist/{command-BgBsh9xU.js → command-7ZoDO_Hy.js} +77 -21
- package/dist/command-7ZoDO_Hy.js.map +1 -0
- package/dist/{computer-connection-review-D4iW1JS7.js → computer-connection-review-vYYCtG_l.js} +6 -6
- package/dist/{computer-connection-review-D4iW1JS7.js.map → computer-connection-review-vYYCtG_l.js.map} +1 -1
- package/dist/{computer-disconnect-CZalrKK7.js → computer-disconnect-C0n2IGfR.js} +9 -9
- package/dist/{computer-disconnect-CZalrKK7.js.map → computer-disconnect-C0n2IGfR.js.map} +1 -1
- package/dist/{computer-setup-continuation-B4JriFmR.js → computer-setup-continuation-DiT88kEQ.js} +3 -3
- package/dist/{computer-setup-continuation-B4JriFmR.js.map → computer-setup-continuation-DiT88kEQ.js.map} +1 -1
- package/dist/{context-DqkwGCKj.js → context-DFf16i-C.js} +7 -7
- package/dist/{context-DqkwGCKj.js.map → context-DFf16i-C.js.map} +1 -1
- package/dist/{daemon-device-id-BmL_1aHE.js → daemon-device-id-C3UTBv9T.js} +4 -4
- package/dist/{daemon-device-id-BmL_1aHE.js.map → daemon-device-id-C3UTBv9T.js.map} +1 -1
- package/dist/{daemon-lifecycle-journal-D4Xupqhp.js → daemon-lifecycle-journal-DoAQ-E6K.js} +7 -7
- package/dist/{daemon-lifecycle-journal-D4Xupqhp.js.map → daemon-lifecycle-journal-DoAQ-E6K.js.map} +1 -1
- package/dist/{daemon-runtime-lease-Cvssoa6x.js → daemon-runtime-lease-CACGRuZ3.js} +1 -1
- package/dist/{daemon-runtime-lease-B--QbOlQ.js → daemon-runtime-lease-D5f4zLXB.js} +3 -3
- package/dist/{daemon-runtime-lease-B--QbOlQ.js.map → daemon-runtime-lease-D5f4zLXB.js.map} +1 -1
- package/dist/{daemon-service-contract-DGPRa_PH.js → daemon-service-contract-D9gUVdhc.js} +3 -3
- package/dist/{daemon-service-contract-DGPRa_PH.js.map → daemon-service-contract-D9gUVdhc.js.map} +1 -1
- package/dist/{daemon-service-manager-CDBNfjOu.js → daemon-service-manager-BDIsfrfx.js} +5 -5
- package/dist/{daemon-service-manager-CDBNfjOu.js.map → daemon-service-manager-BDIsfrfx.js.map} +1 -1
- package/dist/{daemon-service-manager-DW6ySNEe.js → daemon-service-manager-k9IJJuqv.js} +1 -1
- package/dist/{daemon-service-runtime-BMUXKr64.js → daemon-service-runtime-LFoUNQQu.js} +14 -14
- package/dist/{daemon-service-runtime-BMUXKr64.js.map → daemon-service-runtime-LFoUNQQu.js.map} +1 -1
- package/dist/{daemon-service-update-coordinator-ef1RLL_R.js → daemon-service-update-coordinator-4WJr8-5_.js} +21 -23
- package/dist/daemon-service-update-coordinator-4WJr8-5_.js.map +1 -0
- package/dist/{daemon-state-e0klzRsC.js → daemon-state-C09DaALw.js} +3 -3
- package/dist/{daemon-state-e0klzRsC.js.map → daemon-state-C09DaALw.js.map} +1 -1
- package/dist/{dispatch-owned-runtime-D5J7omXK.js → dispatch-owned-runtime-BTK0uuOV.js} +10 -10
- package/dist/{dispatch-owned-runtime-D5J7omXK.js.map → dispatch-owned-runtime-BTK0uuOV.js.map} +1 -1
- package/dist/{dist-DGZXxIvJ.js → dist-DRfPWuFM.js} +1 -1
- package/dist/{dist-Dip3sgFz.js → dist-DY8oLAop.js} +21 -2
- package/dist/dist-DY8oLAop.js.map +1 -0
- package/dist/dist-Df2Qywqr.js +4 -0
- package/dist/{dist-CMBBVJVE.js → dist-YSbIHBnl.js} +52 -3
- package/dist/dist-YSbIHBnl.js.map +1 -0
- package/dist/{dual-view-guide-catalog-DkoOcvAt.js → dual-view-guide-catalog-3LaB18SR.js} +3 -3
- package/dist/{dual-view-guide-catalog-DkoOcvAt.js.map → dual-view-guide-catalog-3LaB18SR.js.map} +1 -1
- package/dist/{elapsed-time-COLGQWPQ.js → elapsed-time-CGeKqTzX.js} +4 -4
- package/dist/{elapsed-time-COLGQWPQ.js.map → elapsed-time-CGeKqTzX.js.map} +1 -1
- package/dist/{entry-agrfgBQh.js → entry-CMDScEVO.js} +12 -12
- package/dist/{entry-agrfgBQh.js.map → entry-CMDScEVO.js.map} +1 -1
- package/dist/{installation-inventory-Bxelkj89.js → installation-inventory-CvtmIZj8.js} +4 -4
- package/dist/{installation-inventory-Bxelkj89.js.map → installation-inventory-CvtmIZj8.js.map} +1 -1
- package/dist/{installer-BZfDlcZI.js → installer-CwK5uV4Q.js} +2 -2
- package/dist/{installer-BZfDlcZI.js.map → installer-CwK5uV4Q.js.map} +1 -1
- package/dist/{lock-CqozgAXC.js → lock-Cz8h_yJh.js} +3 -3
- package/dist/{lock-CqozgAXC.js.map → lock-Cz8h_yJh.js.map} +1 -1
- package/dist/{meta-api-BPhaiMmU.js → meta-api-B01L3fo4.js} +7 -7
- package/dist/{meta-api-BPhaiMmU.js.map → meta-api-B01L3fo4.js.map} +1 -1
- package/dist/{openmeld-CiLo42M9.js → openmeld-RoIfH4iG.js} +43 -41
- package/dist/{openmeld-CiLo42M9.js.map → openmeld-RoIfH4iG.js.map} +1 -1
- package/dist/{openmeld-dev-environment-Dt_yVZn2.js → openmeld-dev-environment-POXQHtTN.js} +3 -3
- package/dist/{openmeld-dev-environment-Dt_yVZn2.js.map → openmeld-dev-environment-POXQHtTN.js.map} +1 -1
- package/dist/openmeld-dev.js +1 -1
- package/dist/{openmeld-environment-target-BjcRwYW3.js → openmeld-environment-target-B0Z7eI6O.js} +3 -3
- package/dist/{openmeld-environment-target-BjcRwYW3.js.map → openmeld-environment-target-B0Z7eI6O.js.map} +1 -1
- package/dist/{openmeld-maintenance-worker-pgUSH8PK.js → openmeld-maintenance-worker--ucPEftH.js} +14 -14
- package/dist/{openmeld-maintenance-worker-pgUSH8PK.js.map → openmeld-maintenance-worker--ucPEftH.js.map} +1 -1
- package/dist/{openmeld-tools-update-join-BuJ6DCqG.js → openmeld-tools-update-join-gps19byt.js} +4 -4
- package/dist/{openmeld-tools-update-join-BuJ6DCqG.js.map → openmeld-tools-update-join-gps19byt.js.map} +1 -1
- package/dist/{openmeld-tools-update-process-frame-CMSbyGR2.js → openmeld-tools-update-process-frame-C9hDfFXg.js} +1 -1
- package/dist/{openmeld-tools-update-process-frame-CwO6rIba.js → openmeld-tools-update-process-frame-Ctim4GrA.js} +2 -2
- package/dist/{openmeld-tools-update-process-frame-CwO6rIba.js.map → openmeld-tools-update-process-frame-Ctim4GrA.js.map} +1 -1
- package/dist/openmeld.js +23 -7
- package/dist/openmeld.js.map +1 -1
- package/dist/{prepare-provider-runtime-CkW7c9bF.js → prepare-provider-runtime-CyIGaDTC.js} +786 -490
- package/dist/prepare-provider-runtime-CyIGaDTC.js.map +1 -0
- package/dist/{prepare-session-executor-BExa01B_.js → prepare-session-executor-BesIXfWv.js} +25 -25
- package/dist/{prepare-session-executor-BExa01B_.js.map → prepare-session-executor-BesIXfWv.js.map} +1 -1
- package/dist/{process-channel-BCIgC7jM.js → process-channel-DILzf1ek.js} +2 -2
- package/dist/{process-channel-BCIgC7jM.js.map → process-channel-DILzf1ek.js.map} +1 -1
- package/dist/{process-identity-e30Hp6t3.js → process-identity-D_VPVruT.js} +2 -2
- package/dist/{process-identity-e30Hp6t3.js.map → process-identity-D_VPVruT.js.map} +1 -1
- package/dist/{runtime-DoIazDNu.js → runtime-BsLzW985.js} +174 -24
- package/dist/runtime-BsLzW985.js.map +1 -0
- package/dist/{runtime-agent-controller-reporting-submission-ZLj8H7TM.js → runtime-agent-controller-reporting-submission-Dtvml_vt.js} +10 -10
- package/dist/runtime-agent-controller-reporting-submission-Dtvml_vt.js.map +1 -0
- package/dist/{service-8ReqDsOx.js → service-BNpxWxYQ.js} +31 -30
- package/dist/service-BNpxWxYQ.js.map +1 -0
- package/dist/{service-account-authorization-CznmJjXZ.js → service-account-authorization-CJv1vZzm.js} +5 -5
- package/dist/{service-account-authorization-CznmJjXZ.js.map → service-account-authorization-CJv1vZzm.js.map} +1 -1
- package/dist/{service-account-control-DhU1ulXB.js → service-account-control-f9-hQZzW.js} +15 -15
- package/dist/{service-account-control-DhU1ulXB.js.map → service-account-control-f9-hQZzW.js.map} +1 -1
- package/dist/{service-control-capabilities-BVarsj7B.js → service-control-capabilities-D2-b-23n.js} +1 -1
- package/dist/{service-control-capabilities-DWOxjL2z.js → service-control-capabilities-DyX9foHw.js} +6 -6
- package/dist/{service-control-capabilities-DWOxjL2z.js.map → service-control-capabilities-DyX9foHw.js.map} +1 -1
- package/dist/{service-control-carrier-capability-DsHkOLJ6.js → service-control-carrier-capability-B8-5s0Z4.js} +3 -3
- package/dist/{service-control-carrier-capability-DsHkOLJ6.js.map → service-control-carrier-capability-B8-5s0Z4.js.map} +1 -1
- package/dist/setup-node-runtime-n0iHzmDA.js +19 -0
- package/dist/setup-node-runtime-n0iHzmDA.js.map +1 -0
- package/dist/{state-6y71kBCo.js → state-BlZXA4Rd.js} +3 -3
- package/dist/{state-6y71kBCo.js.map → state-BlZXA4Rd.js.map} +1 -1
- package/dist/{updates-api-DluYmth3.js → updates-api-BpuVusi5.js} +14 -14
- package/dist/{updates-api-DluYmth3.js.map → updates-api-BpuVusi5.js.map} +1 -1
- package/dist/{upgrade-BARBtyld.js → upgrade-CII-Xiab.js} +9 -9
- package/dist/{upgrade-BARBtyld.js.map → upgrade-CII-Xiab.js.map} +1 -1
- package/dist/upgrade-D3f82xoM.js +4 -0
- package/dist/windows/openmeld-windows-process.exe +0 -0
- package/dist/{windows-managed-install-q2TxKIIe.js → windows-managed-install-Db8X1tQ4.js} +2 -2
- package/dist/{windows-managed-install-q2TxKIIe.js.map → windows-managed-install-Db8X1tQ4.js.map} +1 -1
- package/dist/{windows-preview-channel-CqHp94Vp.js → windows-preview-channel-BJfMRixx.js} +3 -3
- package/dist/{windows-preview-channel-CqHp94Vp.js.map → windows-preview-channel-BJfMRixx.js.map} +1 -1
- package/dist/{windows-task-command-67Zb0gGt.js → windows-task-command-BGrlQDFJ.js} +2 -2
- package/dist/{windows-task-command-67Zb0gGt.js.map → windows-task-command-BGrlQDFJ.js.map} +1 -1
- package/dist/{windows-task-entry-ufpxSuX_.js → windows-task-entry-bzn-6mTB.js} +3 -3
- package/dist/{windows-task-entry-ufpxSuX_.js.map → windows-task-entry-bzn-6mTB.js.map} +1 -1
- package/dist/{windows-user-task-jz44qH1q.js → windows-user-task-GqNzbzc9.js} +1 -1
- package/dist/{windows-user-task-QsSEzkhv.js → windows-user-task-bkBjpShZ.js} +6 -6
- package/dist/{windows-user-task-QsSEzkhv.js.map → windows-user-task-bkBjpShZ.js.map} +1 -1
- package/package.json +8 -8
- package/skills/openmeld-cli/SKILL.md +6 -0
- package/skills/openmeld-cli/playbooks/agent-onboarding.md +8 -0
- package/skills/openmeld-cli/playbooks/computer.md +6 -0
- package/skills/openmeld-cli/playbooks/plugins.md +6 -0
- package/skills/openmeld-cli/playbooks/space-ops.md +20 -0
- package/skills/openmeld-cli/playbooks/space-reads.md +6 -0
- package/skills/openmeld-cli/references/commands.md +6 -0
- package/skills/openmeld-cli/references/runtime-resolution.md +6 -0
- package/dist/auth-session-CNPe3mUj.js +0 -4
- package/dist/command-BgBsh9xU.js.map +0 -1
- package/dist/daemon-service-update-coordinator-ef1RLL_R.js.map +0 -1
- package/dist/dist-CMBBVJVE.js.map +0 -1
- package/dist/dist-Dip3sgFz.js.map +0 -1
- package/dist/dist-qVdtMWpW.js +0 -4
- package/dist/prepare-provider-runtime-CkW7c9bF.js.map +0 -1
- package/dist/runtime-DoIazDNu.js.map +0 -1
- package/dist/runtime-agent-controller-reporting-submission-ZLj8H7TM.js.map +0 -1
- package/dist/service-8ReqDsOx.js.map +0 -1
- package/dist/upgrade-CshMPPlp.js +0 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { t as ExecutionHostError } from "./channel-
|
|
3
|
+
import { t as ExecutionHostError } from "./channel-7iF6DSp4.js";
|
|
4
4
|
//#region src/local-service/execution-host/process-channel.ts
|
|
5
5
|
function childExecutionHostChannel(child) {
|
|
6
6
|
return {
|
|
@@ -61,4 +61,4 @@ function parentExecutionHostChannel() {
|
|
|
61
61
|
//#endregion
|
|
62
62
|
export { parentExecutionHostChannel as n, childExecutionHostChannel as t };
|
|
63
63
|
|
|
64
|
-
//# sourceMappingURL=process-channel-
|
|
64
|
+
//# sourceMappingURL=process-channel-DILzf1ek.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-channel-
|
|
1
|
+
{"version":3,"file":"process-channel-DILzf1ek.js","names":[],"sources":["../src/local-service/execution-host/process-channel.ts"],"sourcesContent":["import type { ChildProcess } from \"node:child_process\";\nimport type { ExecutionHostChannel } from \"./channel\";\nimport { ExecutionHostError } from \"./channel\";\n\n// Use inherited Node-compatible IPC with JSON serialization. Provider stdout is\n// not a protocol channel; ordinary logs cannot become control messages.\nexport function childExecutionHostChannel(\n child: ChildProcess\n): ExecutionHostChannel {\n return {\n connected: () => child.connected,\n send: (message, completed) => {\n child.send(message, (error) => completed(error ?? null));\n },\n onMessage: (listener) => {\n child.on(\"message\", listener);\n return () => {\n child.off(\"message\", listener);\n };\n },\n onDisconnect: (listener) => {\n let observed = false;\n const finish = (error?: Error) => {\n if (!observed) {\n observed = true;\n listener(error);\n }\n };\n const exited = (code: number | null, signal: NodeJS.Signals | null) => {\n finish(\n new Error(`Host process exited (${signal ?? code ?? \"unknown\"})`)\n );\n };\n child.on(\"disconnect\", finish);\n child.on(\"exit\", exited);\n // Spawn/send failures must not become unhandled EventEmitter errors.\n child.on(\"error\", finish);\n return () => {\n child.off(\"disconnect\", finish);\n child.off(\"exit\", exited);\n child.off(\"error\", finish);\n };\n },\n };\n}\n\nexport function parentExecutionHostChannel(): ExecutionHostChannel {\n const send = process.send?.bind(process);\n if (!(send && process.connected)) {\n throw new ExecutionHostError(\n \"host.inherited_channel_required\",\n \"The execution host requires its supervisor's inherited IPC channel.\"\n );\n }\n return {\n connected: () => process.connected === true,\n send: (message, completed) => {\n send(message, undefined, undefined, (error) => completed(error ?? null));\n },\n onMessage: (listener) => {\n process.on(\"message\", listener);\n return () => {\n process.off(\"message\", listener);\n };\n },\n onDisconnect: (listener) => {\n process.on(\"disconnect\", listener);\n return () => {\n process.off(\"disconn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6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { Pa as windowsNativeProcessRequestSchema,
|
|
3
|
+
import { Pa as windowsNativeProcessRequestSchema, wF as WINDOWS_PROCESS_HELPER_FILENAME } from "./dist-YSbIHBnl.js";
|
|
4
4
|
import { n as normalizeCommandEnvironment } from "./process-environment-BWSFeUu6.js";
|
|
5
5
|
import { win32 } from "node:path";
|
|
6
6
|
import { execFile, execFileSync, spawn } from "node:child_process";
|
|
@@ -169,4 +169,4 @@ function isNodeError(error, code) {
|
|
|
169
169
|
//#endregion
|
|
170
170
|
export { activateWindowsManagedCommand as a, readWindowsProcessStartFileTime as c, WINDOWS_NATIVE_PROCESS_REQUEST_ENV as d, resolveWindowsNativeProcessHelper as f, readProcessStartIdentity as i, resolveWindowsPowerShellPath as l, isPreciseProcessStartIdentity as n, powerShellEncodedArguments as o, isProcessIdentityAlive as r, pruneWindowsBinaryBundle as s, CURRENT_PROCESS_START_IDENTITY as t, startWindowsIdleSleepBlocker as u };
|
|
171
171
|
|
|
172
|
-
//# sourceMappingURL=process-identity-
|
|
172
|
+
//# sourceMappingURL=process-identity-D_VPVruT.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-identity-e30Hp6t3.js","names":[],"sources":["../../../runtime/adapters/core/dist/windows-native-process.js","../../../runtime/adapters/core/dist/windows-system.js","../src/system/process-identity.ts"],"sourcesContent":["import { dirname, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { WINDOWS_PROCESS_HELPER_FILENAME } from \"@openmeld/schemas\";\nexport const WINDOWS_NATIVE_PROCESS_REQUEST_ENV = \"OPENMELD_NATIVE_JOB_REQUEST\";\nexport function resolveWindowsNativeProcessHelper() {\n const binary = typeof __OPENMELD_DISTRIBUTION__ !== \"undefined\" &&\n __OPENMELD_DISTRIBUTION__ === \"binary\";\n return binary\n ? join(dirname(process.execPath), WINDOWS_PROCESS_HELPER_FILENAME)\n : fileURLToPath(\n // Both src/ (workspace tests) and dist/ (installed code) share this\n // package-owned build output. Never search another installation.\n new URL(`../dist/windows/${WINDOWS_PROCESS_HELPER_FILENAME}`, import.meta.url));\n}\n","import { execFile, execFileSync, spawn } from \"node:child_process\";\nimport { win32 } from \"node:path\";\nimport { promisify } from \"node:util\";\nimport { windowsNativeProcessRequestSchema } from \"@openmeld/schemas\";\nimport { normalizeCommandEnvironment } from \"./process-environment.js\";\nimport { resolveWindowsNativeProcessHelper, WINDOWS_NATIVE_PROCESS_REQUEST_ENV, } from \"./windows-native-process.js\";\nexport function resolveWindowsPowerShellPath(env = process.env) {\n const source = normalizeCommandEnvironment(env, \"win32\");\n const root = source.SystemRoot ?? source.WINDIR;\n if (!(root && win32.isAbsolute(root))) {\n throw new Error(\"Windows system directory is unavailable.\");\n }\n return win32.join(root, \"System32\", \"WindowsPowerShell\", \"v1.0\", \"powershell.exe\");\n}\nexport function powerShellEncodedArguments(script) {\n return [\n \"-NoLogo\",\n \"-NoProfile\",\n \"-NonInteractive\",\n \"-EncodedCommand\",\n Buffer.from(script, \"utf16le\").toString(\"base64\"),\n ];\n}\nconst FILE_TIME_PATTERN = /^\\d{10,20}$/u;\n// Keep native identity reads bounded; an unavailable identity fails admission.\nconst PROCESS_IDENTITY_TIMEOUT_MS = 15_000;\nlet currentProcessFileTime;\nexport async function activateWindowsManagedCommand(binDirectory) {\n const request = windowsNativeProcessRequestSchema.parse({\n operation: \"activate-managed-command\",\n binDirectory,\n });\n const { stdout } = await promisify(execFile)(resolveWindowsNativeProcessHelper(), [], {\n env: {\n ...process.env,\n [WINDOWS_NATIVE_PROCESS_REQUEST_ENV]: Buffer.from(JSON.stringify(request), \"utf8\").toString(\"base64\"),\n },\n encoding: \"utf8\",\n windowsHide: true,\n timeout: 15_000,\n maxBuffer: 4096,\n });\n const result = stdout.trim();\n if (result !== \"activated\" && result !== \"already_active\") {\n throw new Error(\"Windows returned an invalid command activation receipt.\");\n }\n return result;\n}\n/** Kernel sharing rules keep a live CLI and its helper together during pruning. */\nexport async function pruneWindowsBinaryBundle(directory) {\n const request = windowsNativeProcessRequestSchema.parse({\n operation: \"prune-binary-bundle\",\n directory,\n });\n const { stdout } = await promisify(execFile)(resolveWindowsNativeProcessHelper(), [], {\n env: {\n ...process.env,\n [WINDOWS_NATIVE_PROCESS_REQUEST_ENV]: Buffer.from(JSON.stringify(request), \"utf8\").toString(\"base64\"),\n },\n encoding: \"utf8\",\n windowsHide: true,\n timeout: 15_000,\n maxBuffer: 4096,\n });\n const result = stdout.trim();\n if (result !== \"removed\" &&\n result !== \"absent\" &&\n result !== \"in_use\" &&\n result !== \"unrecognized\") {\n throw new Error(\"Windows returned an invalid managed-version cleanup receipt.\");\n }\n return result;\n}\n/** An opened process handle binds the observation to the actual instance, not a reused PID. */\nexport function readWindowsProcessStartFileTime(pid) {\n if (!(Number.isSafeInteger(pid) && pid > 0)) {\n return null;\n }\n if (pid === process.pid && currentProcessFileTime) {\n return currentProcessFileTime;\n }\n const request = windowsNativeProcessRequestSchema.parse({\n operation: \"identity\",\n pid,\n });\n try {\n const output = execFileSync(resolveWindowsNativeProcessHelper(), [], {\n env: {\n ...process.env,\n [WINDOWS_NATIVE_PROCESS_REQUEST_ENV]: Buffer.from(JSON.stringify(request), \"utf8\").toString(\"base64\"),\n },\n encoding: \"utf8\",\n windowsHide: true,\n timeout: PROCESS_IDENTITY_TIMEOUT_MS,\n maxBuffer: 1024,\n stdio: [\"ignore\", \"pipe\", \"ignore\"],\n }).trim();\n if (!FILE_TIME_PATTERN.test(output)) {\n return null;\n }\n if (pid === process.pid) {\n currentProcessFileTime = output;\n }\n return output;\n }\n catch {\n return null;\n }\n}\nexport function startWindowsIdleSleepBlocker() {\n return spawn(resolveWindowsNativeProcessHelper(), [], {\n env: {\n ...process.env,\n [WINDOWS_NATIVE_PROCESS_REQUEST_ENV]: Buffer.from(JSON.stringify(windowsNativeProcessRequestSchema.parse({\n operation: \"prevent-idle-sleep\",\n }))).toString(\"base64\"),\n },\n windowsHide: true,\n stdio: [\"pipe\", \"pipe\", \"pipe\"],\n });\n}\n","import { execFileSync } from \"node:child_process\";\nimport { readWindowsProcessStartFileTime } from \"@openmeld/adapter-core/windows-system\";\n\nconst WINDOWS_PROCESS_IDENTITY_PATTERN = /^win32:\\d{10,20}$/u;\n\nexport function isPreciseProcessStartIdentity(value: unknown): value is string {\n return (\n typeof value === \"string\" &&\n ((value.startsWith(\"ps:\") && value.length > 3) ||\n WINDOWS_PROCESS_IDENTITY_PATTERN.test(value))\n );\n}\n\nexport const CURRENT_PROCESS_START_IDENTITY =\n readProcessStartIdentity(process.pid) ??\n `fallback:${process.pid}:${Math.floor(Date.now() - process.uptime() * 1000)}`;\n\nexport function isProcessIdentityAlive(\n input: { ownerPid: number; ownerProcessStartedAt: string },\n platform: NodeJS.Platform = process.platform\n): boolean {\n if (!isProcessAlive(input.ownerPid)) {\n return false;\n }\n const observedIdentity = readProcessStartIdentity(input.ownerPid, platform);\n if (\n isPreciseProcessStartIdentity(observedIdentity) &&\n isPreciseProcessStartIdentity(input.ownerProcessStartedAt) &&\n observedIdentity.split(\":\", 1)[0] ===\n input.ownerProcessStartedAt.split(\":\", 1)[0]\n ) {\n return observedIdentity === input.ownerProcessStartedAt;\n }\n // Fail closed when a live process cannot be identified precisely. A caller\n // may recover only after it can prove that the transition owner has exited.\n return true;\n}\n\nexport function readProcessStartIdentity(\n pid: number,\n platform: NodeJS.Platform = process.platform\n): string | null {\n if (!(Number.isSafeInteger(pid) && pid > 0)) {\n return null;\n }\n if (platform === \"win32\") {\n const created = readWindowsProcessStartFileTime(pid);\n return created === null ? null : `win32:${created}`;\n }\n try {\n const output = execFileSync(\"ps\", [\"-o\", \"lstart=\", \"-p\", String(pid)], {\n encoding: \"utf8\",\n stdio: [\"ignore\", \"pipe\", \"ignore\"],\n timeout: 1000,\n windowsHide: true,\n }).trim();\n return output.length > 0 ? `ps:${output}` : null;\n } catch {\n return null;\n }\n}\n\nfunction isProcessAlive(pid: number): boolean {\n try {\n process.kill(pid, 0);\n return true;\n } catch (error) {\n return !isNodeError(error, \"ESRCH\");\n }\n}\n\nfunction isNodeError(error: unknown, code: string): boolean {\n return (\n error instanceof Error && \"code\" in error && String(error.code) === code\n );\n}\n"],"mappings":";;;;;;;;;AAGA,MAAa,qCAAqC;AAClD,SAAgB,oCAAoC;CAGhD,OAEM,cAGF,IAAI,IAAI,mBAAmB,mCAAmC,OAAO,KAAK,GAAG,CAAC;AACtF;;;ACPA,SAAgB,6BAA6B,MAAM,QAAQ,KAAK;CAC5D,MAAM,SAAS,4BAA4B,KAAK,OAAO;CACvD,MAAM,OAAO,OAAO,cAAc,OAAO;CACzC,IAAI,EAAE,QAAQ,MAAM,WAAW,IAAI,IAC/B,MAAM,IAAI,MAAM,0CAA0C;CAE9D,OAAO,MAAM,KAAK,MAAM,YAAY,qBAAqB,QAAQ,gBAAgB;AACrF;AACA,SAAgB,2BAA2B,QAAQ;CAC/C,OAAO;EACH;EACA;EACA;EACA;EACA,OAAO,KAAK,QAAQ,SAAS,CAAC,CAAC,SAAS,QAAQ;CACpD;AACJ;AACA,MAAM,oBAAoB;AAE1B,MAAM,8BAA8B;AACpC,IAAI;AACJ,eAAsB,8BAA8B,cAAc;CAC9D,MAAM,UAAU,kCAAkC,MAAM;EACpD,WAAW;EACX;CACJ,CAAC;CACD,MAAM,EAAE,WAAW,MAAM,UAAU,QAAQ,CAAC,CAAC,kCAAkC,GAAG,CAAC,GAAG;EAClF,KAAK;GACD,GAAG,QAAQ;IACV,qCAAqC,OAAO,KAAK,KAAK,UAAU,OAAO,GAAG,MAAM,CAAC,CAAC,SAAS,QAAQ;EACxG;EACA,UAAU;EACV,aAAa;EACb,SAAS;EACT,WAAW;CACf,CAAC;CACD,MAAM,SAAS,OAAO,KAAK;CAC3B,IAAI,WAAW,eAAe,WAAW,kBACrC,MAAM,IAAI,MAAM,yDAAyD;CAE7E,OAAO;AACX;;AAEA,eAAsB,yBAAyB,WAAW;CACtD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AI;EACF,QAAQ,KAAK,KAAK,CAAC;EACnB,OAAO;CACT,SAAS,OAAO;EACd,OAAO,CAAC,YAAY,OAAO,OAAO;CACpC;AACF;AAEA,SAAS,YAAY,OAAgB,MAAuB;CAC1D,OACE,iBAAiB,SAAS,UAAU,SAAS,OAAO,MAAM,IAAI,MAAM;AAExE"}
|
|
1
|
+
{"version":3,"file":"process-identity-D_VPVruT.js","names":[],"sources":["../../../runtime/adapters/core/dist/windows-native-process.js","../../../runtime/adapters/core/dist/windows-system.js","../src/system/process-identity.ts"],"sourcesContent":["import { dirname, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { WINDOWS_PROCESS_HELPER_FILENAME } from \"@openmeld/schemas\";\nexport const WINDOWS_NATIVE_PROCESS_REQUEST_ENV = \"OPENMELD_NATIVE_JOB_REQUEST\";\nexport function resolveWindowsNativeProcessHelper() {\n const binary = typeof __OPENMELD_DISTRIBUTION__ !== \"undefined\" &&\n __OPENMELD_DISTRIBUTION__ === \"binary\";\n return binary\n ? join(dirname(process.execPath), WINDOWS_PROCESS_HELPER_FILENAME)\n : fileURLToPath(\n // Both src/ (workspace tests) and dist/ (installed code) share this\n // package-owned build output. Never search another installation.\n new URL(`../dist/windows/${WINDOWS_PROCESS_HELPER_FILENAME}`, import.meta.url));\n}\n","import { execFile, execFileSync, spawn } from \"node:child_process\";\nimport { win32 } from \"node:path\";\nimport { promisify } from \"node:util\";\nimport { windowsNativeProcessRequestSchema } from \"@openmeld/schemas\";\nimport { normalizeCommandEnvironment } from \"./process-environment.js\";\nimport { resolveWindowsNativeProcessHelper, WINDOWS_NATIVE_PROCESS_REQUEST_ENV, } from \"./windows-native-process.js\";\nexport function resolveWindowsPowerShellPath(env = process.env) {\n const source = normalizeCommandEnvironment(env, \"win32\");\n const root = source.SystemRoot ?? source.WINDIR;\n if (!(root && win32.isAbsolute(root))) {\n throw new Error(\"Windows system directory is unavailable.\");\n }\n return win32.join(root, \"System32\", \"WindowsPowerShell\", \"v1.0\", \"powershell.exe\");\n}\nexport function powerShellEncodedArguments(script) {\n return [\n \"-NoLogo\",\n \"-NoProfile\",\n \"-NonInteractive\",\n \"-EncodedCommand\",\n Buffer.from(script, \"utf16le\").toString(\"base64\"),\n ];\n}\nconst FILE_TIME_PATTERN = /^\\d{10,20}$/u;\n// Keep native identity reads bounded; an unavailable identity fails admission.\nconst PROCESS_IDENTITY_TIMEOUT_MS = 15_000;\nlet currentProcessFileTime;\nexport async function activateWindowsManagedCommand(binDirectory) {\n const request = windowsNativeProcessRequestSchema.parse({\n operation: \"activate-managed-command\",\n binDirectory,\n });\n const { stdout } = await promisify(execFile)(resolveWindowsNativeProcessHelper(), [], {\n env: {\n ...process.env,\n [WINDOWS_NATIVE_PROCESS_REQUEST_ENV]: Buffer.from(JSON.stringify(request), \"utf8\").toString(\"base64\"),\n },\n encoding: \"utf8\",\n windowsHide: true,\n timeout: 15_000,\n maxBuffer: 4096,\n });\n const result = stdout.trim();\n if (result !== \"activated\" && result !== \"already_active\") {\n throw new Error(\"Windows returned an invalid command activation receipt.\");\n }\n return result;\n}\n/** Kernel sharing rules keep a live CLI and its helper together during pruning. */\nexport async function pruneWindowsBinaryBundle(directory) {\n const request = windowsNativeProcessRequestSchema.parse({\n operation: \"prune-binary-bundle\",\n directory,\n });\n const { stdout } = await promisify(execFile)(resolveWindowsNativeProcessHelper(), [], {\n env: {\n ...process.env,\n [WINDOWS_NATIVE_PROCESS_REQUEST_ENV]: Buffer.from(JSON.stringify(request), \"utf8\").toString(\"base64\"),\n },\n encoding: \"utf8\",\n windowsHide: true,\n timeout: 15_000,\n maxBuffer: 4096,\n });\n const result = stdout.trim();\n if (result !== \"removed\" &&\n result !== \"absent\" &&\n result !== \"in_use\" &&\n result !== \"unrecognized\") {\n throw new Error(\"Windows returned an invalid managed-version cleanup receipt.\");\n }\n return result;\n}\n/** An opened process handle binds the observation to the actual instance, not a reused PID. */\nexport function readWindowsProcessStartFileTime(pid) {\n if (!(Number.isSafeInteger(pid) && pid > 0)) {\n return null;\n }\n if (pid === process.pid && currentProcessFileTime) {\n return currentProcessFileTime;\n }\n const request = windowsNativeProcessRequestSchema.parse({\n operation: \"identity\",\n pid,\n });\n try {\n const output = execFileSync(resolveWindowsNativeProcessHelper(), [], {\n env: {\n ...process.env,\n [WINDOWS_NATIVE_PROCESS_REQUEST_ENV]: Buffer.from(JSON.stringify(request), \"utf8\").toString(\"base64\"),\n },\n encoding: \"utf8\",\n windowsHide: true,\n timeout: PROCESS_IDENTITY_TIMEOUT_MS,\n maxBuffer: 1024,\n stdio: [\"ignore\", \"pipe\", \"ignore\"],\n }).trim();\n if (!FILE_TIME_PATTERN.test(output)) {\n return null;\n }\n if (pid === process.pid) {\n currentProcessFileTime = output;\n }\n return output;\n }\n catch {\n return null;\n }\n}\nexport function startWindowsIdleSleepBlocker() {\n return spawn(resolveWindowsNativeProcessHelper(), [], {\n env: {\n ...process.env,\n [WINDOWS_NATIVE_PROCESS_REQUEST_ENV]: Buffer.from(JSON.stringify(windowsNativeProcessRequestSchema.parse({\n operation: \"prevent-idle-sleep\",\n }))).toString(\"base64\"),\n },\n windowsHide: true,\n stdio: [\"pipe\", \"pipe\", \"pipe\"],\n });\n}\n","import { execFileSync } from \"node:child_process\";\nimport { readWindowsProcessStartFileTime } from \"@openmeld/adapter-core/windows-system\";\n\nconst WINDOWS_PROCESS_IDENTITY_PATTERN = /^win32:\\d{10,20}$/u;\n\nexport function isPreciseProcessStartIdentity(value: unknown): value is string {\n return (\n typeof value === \"string\" &&\n ((value.startsWith(\"ps:\") && value.length > 3) ||\n WINDOWS_PROCESS_IDENTITY_PATTERN.test(value))\n );\n}\n\nexport const CURRENT_PROCESS_START_IDENTITY =\n readProcessStartIdentity(process.pid) ??\n `fallback:${process.pid}:${Math.floor(Date.now() - process.uptime() * 1000)}`;\n\nexport function isProcessIdentityAlive(\n input: { ownerPid: number; ownerProcessStartedAt: string },\n platform: NodeJS.Platform = process.platform\n): boolean {\n if (!isProcessAlive(input.ownerPid)) {\n return false;\n }\n const observedIdentity = readProcessStartIdentity(input.ownerPid, platform);\n if (\n isPreciseProcessStartIdentity(observedIdentity) &&\n isPreciseProcessStartIdentity(input.ownerProcessStartedAt) &&\n observedIdentity.split(\":\", 1)[0] ===\n input.ownerProcessStartedAt.split(\":\", 1)[0]\n ) {\n return observedIdentity === input.ownerProcessStartedAt;\n }\n // Fail closed when a live process cannot be identified precisely. A caller\n // may recover only after it can prove that the transition owner has exited.\n return true;\n}\n\nexport function readProcessStartIdentity(\n pid: number,\n platform: NodeJS.Platform = process.platform\n): string | null {\n if (!(Number.isSafeInteger(pid) && pid > 0)) {\n return null;\n }\n if (platform === \"win32\") {\n const created = readWindowsProcessStartFileTime(pid);\n return created === null ? null : `win32:${created}`;\n }\n try {\n const output = execFileSync(\"ps\", [\"-o\", \"lstart=\", \"-p\", String(pid)], {\n encoding: \"utf8\",\n stdio: [\"ignore\", \"pipe\", \"ignore\"],\n timeout: 1000,\n windowsHide: true,\n }).trim();\n return output.length > 0 ? `ps:${output}` : null;\n } catch {\n return null;\n }\n}\n\nfunction isProcessAlive(pid: number): boolean {\n try {\n process.kill(pid, 0);\n return true;\n } catch (error) {\n return !isNodeError(error, \"ESRCH\");\n }\n}\n\nfunction isNodeError(error: unknown, code: string): boolean {\n return (\n error instanceof Error && \"code\" in error && String(error.code) === code\n );\n}\n"],"mappings":";;;;;;;;;AAGA,MAAa,qCAAqC;AAClD,SAAgB,oCAAoC;CAGhD,OAEM,cAGF,IAAI,IAAI,mBAAmB,mCAAmC,OAAO,KAAK,GAAG,CAAC;AACtF;;;ACPA,SAAgB,6BAA6B,MAAM,QAAQ,KAAK;CAC5D,MAAM,SAAS,4BAA4B,KAAK,OAAO;CACvD,MAAM,OAAO,OAAO,cAAc,OAAO;CACzC,IAAI,EAAE,QAAQ,MAAM,WAAW,IAAI,IAC/B,MAAM,IAAI,MAAM,0CAA0C;CAE9D,OAAO,MAAM,KAAK,MAAM,YAAY,qBAAqB,QAAQ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,gBAAgB,KAC9C,8BAA8B,MAAM,qBAAqB,KACzD,iBAAiB,MAAM,KAAK,CAAC,CAAC,CAAC,OAC7B,MAAM,sBAAsB,MAAM,KAAK,CAAC,CAAC,CAAC,IAE5C,OAAO,qBAAqB,MAAM;CAIpC,OAAO;AACT;AAEA,SAAgB,yBACd,KACA,WAA4B,QAAQ,UACrB;CACf,IAAI,EAAE,OAAO,cAAc,GAAG,KAAK,MAAM,IACvC,OAAO;CAET,IAAI,aAAa,SAAS;EACxB,MAAM,UAAU,gCAAgC,GAAG;EACnD,OAAO,YAAY,OAAO,OAAO,SAAS;CAC5C;CACA,IAAI;EACF,MAAM,SAAS,aAAa,MAAM;GAAC;GAAM;GAAW;GAAM,OAAO,GAAG;EAAC,GAAG;GACtE,UAAU;GACV,OAAO;IAAC;IAAU;IAAQ;GAAQ;GAClC,SAAS;GACT,aAAa;EACf,CAAC,CAAC,CAAC,KAAK;EACR,OAAO,OAAO,SAAS,IAAI,MAAM,WAAW;CAC9C,QAAQ;EACN,OAAO;CACT;AACF;AAEA,SAAS,eAAe,KAAsB;CAC5C,IAAI;EACF,QAAQ,KAAK,KAAK,CAAC;EACnB,OAAO;CACT,SAAS,OAAO;EACd,OAAO,CAAC,YAAY,OAAO,OAAO;CACpC;AACF;AAEA,SAAS,YAAY,OAAgB,MAAuB;CAC1D,OACE,iBAAiB,SAAS,UAAU,SAAS,OAAO,MAAM,IAAI,MAAM;AAExE"}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { $
|
|
4
|
-
import { a as resolveBaseUrl, f as getConfiguredDaemonDispatchLimits, g as getConfiguredSkillsConfig } from "./base-url-
|
|
3
|
+
import { $ as canManageRegistryAgentSkillTargets, $n as loadLedgerState, An as resolveInstalledCodexLaunchCandidates, At as resolveRegistryRuntimeAdapterContractByAgentControllerRef, Bn as updateClaudeNativeInstallation, Cn as installGrokBotTools, Dn as supportsGrokBotSetup, E as resolveProfileWorkspaceRuntime, En as readManagedGrokBotCandidate, H as resolveAgentTargetState, Ht as createMutableRouteCatalogState, I as listAgentTargetStates, Jn as runRuntimeTask, Jr as supportsSpaceWorkHandoff, Jt as syncRuntimeEventToInflightTaskControlRegistry, L as manageAgentRegistrationInstallation, Nn as resolveCodexAppServerCompletedTurn, Pn as verifyCodexAppServerThread, Qn as commitResolvedAgentContext, Qt as createSerialAgentInteractionCallback, Rn as readClaudeNativeVersion, Tn as loginManagedGrokBot, U as setAgentRegistrationEnabled, Ut as createRouteCatalogFromMutableState, Wt as replaceMutableRouteCatalogState, Xn as buildTaskResultEnvelope, Xt as SPACE_ACTION_TARGET_GUIDANCE_LINES, Yn as buildRuntimeWorkspaceFingerprint, Yt as SPACE_ACTION_CONTEXT_GUIDANCE_LINES, Zn as appendLedgerHistoryEntry, _ as loadDaemonRouteCatalog, _n as forkOpenCodeServerSession, _r as DISPATCH_SPACE_ACTION_DELIVERY_ONLY_ENV, a as buildOpenClawSpaceSessionKey, an as createLocalExecutionSlots, ar as withLedgerStateTransaction, b as resolveLocalController, br as TASK_KNOWLEDGE_GUIDANCE, cn as resolveDispatchContinuityObservation, cr as buildAgentContextLookupKey, dn as resolveLatestScopedConversationExecutionState, en as normalizeDispatchPostMessageAction, er as removeConversationExecutionState, g as writeDaemonRouteCatalogCache, h as readDaemonRouteCatalogCache, ir as upsertConversationExecutionState, jn as forkCodexAppServerThread, kn as resolveCodexTimeoutMs, ln as resolveCompatibleAgentContextMatch, mn as createLocalAdapterEntries, mt as listProjectConnectionsWithStatus, nn as mergeOpenClawGatewayVisibility, nr as seedLegacyAgentContext, o as normalizeOpenClawSpaceIdPrefix, on as createInflightTaskControlRegistry, pn as createLocalAdapterContainer, pt as listProjectBindings, qn as DaemonServiceRunError, qt as normalizeDispatchThreadAction, rn as createLocalTaskInterruptSender, rr as settleInflightTask, rt as resolveBuiltinAgentControllerDefinition, s as slugifyOpenClawNamePart, sn as resolveDispatchQueueLogMeta, sr as assertLegacyAgentContextAssociation, t as prepareProviderRuntime, tn as createPendingAgentInteractionRegistry, tr as resolveConversationExecutionStateByLookupKey, tt as resolveSkillsAgentRegistry, un as resolveCompatibleConversationExecutionState, v as buildRuntimeRouteTargets, w as resolveCurrentEffectiveProfileWorkingFolderRuntime, wn as isManagedGrokBotSignedIn, x as resolveLocalRuntimeControllerSupport, y as readLocalEnabledControllers, yn as resolveInstalledOpenCodeLaunchCandidates, yr as DEFAULT_TASK_LIFECYCLE_HEARTBEAT_INTERVAL_MS, z as reconcileNewRunnableBuiltinAgentRegistrations, zn as resolveClaudeNativeUpdateCommand, zr as renderTaskKnowledgeIndex } from "./prepare-provider-runtime-CyIGaDTC.js";
|
|
4
|
+
import { a as resolveBaseUrl, f as getConfiguredDaemonDispatchLimits, g as getConfiguredSkillsConfig } from "./base-url-CLMqlF1w.js";
|
|
5
5
|
import { F as resolveOpenMeldRootDir } from "./paths-De9xdA2h.js";
|
|
6
|
-
import { $b as runtimeTransportDispatchInteractionRequestSchema, Cv as agentExecutionSteerResponseSchema,
|
|
7
|
-
import { u as startWindowsIdleSleepBlocker } from "./process-identity-
|
|
8
|
-
import { Nt as buildSpaceAttachmentDownloadPath, ln as createOrganizationSkillsApi, xn as createSpaceApi } from "./dist-
|
|
9
|
-
import { d as getAuthSessionState } from "./auth-session-
|
|
10
|
-
import { a as buildOpenMeldProfileIdentityRequestHeadersWithAuth, f as buildOpenMeldRequestContextFromProfileIdentity, n as fetchSpaceRequestWithTimeout, t as createCliApiClientFoundation } from "./api-client-foundation-
|
|
11
|
-
import { t as emitDaemonLifecycleEvent } from "./daemon-lifecycle-journal-
|
|
12
|
-
import { S as CONTROLLED_SHUTDOWN_RESULT_ACK_TIMEOUT_MS, _ as toErrorMessage$2, n as ensureDaemonRuntimePaths, s as emitRunLine, t as buildLedgerPaths, u as normalizeOptionalText$3, v as warnDaemonEvent } from "./daemon-device-id-
|
|
13
|
-
import { F as SPACE_COLLABORATION_CONTEXT_RULE, I as SPACE_PERSONAL_CONTRIBUTION_RULE, X as resolvePublicAgentFailureReason, Z as resolveSpacePublicationRequirement } from "./dual-view-guide-catalog-
|
|
14
|
-
import { $t as createDispatchContinuationSpaceAccessContext, C as recordOpenMeldCreatedLocalAgentSession, D as readOpenCodeSessionRows, J as consumeArmedAgentControllerInterfaceReprobe, Yt as buildSpaceRoundSignalPublication, _ as sendDaemonFrame$1, _t as resolveBootstrapSpaceOwnerProfileId, an as getSpaceAccessPassword, at as emitDaemonDispatchJournalEvent, c as createDispatchSpaceActionContext, ct as readComputerFileAccessPolicy, d as readDispatchSpaceActionRecord, dt as isSameOrDescendantPath, f as supersedeDispatchSpaceActionRecordForReconsideration, ft as buildDispatchBootstrapTemplateFacts, g as parseDaemonFrame, gt as parseDispatchTask, ht as buildDispatchSessionTitle, k as resolveOpenCodeDatabasePath, l as readDispatchSpaceActionContextForReceiptFromEnv, ln as isWakeClosingSystemNoticeType, lt as resolveComputerFileAccessStorePath, mt as buildDispatchPromptPlan, on as getSpaceAccessRequestContext, pt as buildDispatchCorrelation, r as buildDispatchOwnedRuntimeEnv, s as OPENMELD_SPACE_ACTION_CONTEXT_PATH_ENV, un as listSpaceMemberDirectorySendTargets, vt as resolveBootstrapTargetProfileContext, xn as DISPATCH_SPACE_ACTION_CLI_FALLBACK_COMMAND, yt as resolveDispatchMentionSourceContext } from "./dispatch-owned-runtime-
|
|
15
|
-
import { t as ExecutionHostError } from "./channel-
|
|
16
|
-
import { f as withSkillsInstallLock, r as ensureLocalSkills, t as resolveSkillInstallStateForTarget } from "./state-
|
|
17
|
-
import { a as submitRuntimeProviderConversationProofs, f as recordRuntimeProviderUsageLimits, i as submitRuntimeAgentControllerReports, l as resolveLocalAgentControllerReportDecision, o as collectLocalAgentControllerInventory, t as notifyRuntimeReportingAttemptObserver, u as probeAgentControllerUsageObservationAuth } from "./runtime-agent-controller-reporting-submission-
|
|
18
|
-
import { t as installSkillsToTargets } from "./installer-
|
|
19
|
-
import { B as installAgentActivityIntegrations, C as recordRuntimeReportingFailure, D as startLocalAgentActivitySyncLoop, E as createLedgerIo, F as registerAgentActivityRoute, T as recordRuntimeReportingSuccess, _ as markExecutionContextWorkspaceInUse, a as createDispatchSpaceTools, b as releaseExecutionContextWorkspace, g as deriveExecutionContextComputerFileAccessPolicy, h as startDispatchSpaceProgressRelay, i as materializeOrganizationSkillRelease, k as discoverLocalAgentSessionProviders, n as createSpaceWorkingCopies, r as downloadWorkingCopyFile, s as readTaskKnowledge, t as fetchSpaceUpdates, v as prepareExecutionContextWorkspace, w as recordRuntimeReportingNotApplicable, x as prepareClaudeProjectContainer, y as readExecutionContextWorkspace, z as defaultManagedIntegrationPaths } from "./updates-api-
|
|
20
|
-
import { h as createCliSpaceApi } from "./meta-api-
|
|
6
|
+
import { $T as localAgentSetupOperationSchema, $b as runtimeTransportDispatchInteractionRequestSchema, Cv as agentExecutionSteerResponseSchema, DE as resolveBuiltinAgentControllerConversationKind, Dk as LOCAL_AGENT_REASONING_MAX_CHARS, GA as COMPUTER_FILE_ACCESS_OWNER_CANCELLED_REASON_CODE, Nx as runtimeTransportResumeControllerConversationFramePayloadSchema, PI as normalizeKnownBuiltinAgentControllerId, Px as runtimeTransportResumeControllerConversationResultFramePayloadSchema, Qb as runtimeTransportDispatchInteractionDeliveredRequestSchema, TE as buildAgentControllerConversationRef, TO as agentInteractionResolutionSchema, Uw as spaceWorkSelectionSchema, VR as normalizeOptionalWorkingDirectory, XT as localAgentUpdateOperationSchema, Xw as OPENMELD_DAEMON_CANCEL_WITHDRAWN_BEFORE_START_REASON_CODE, YT as providerDispatchRuntimeContextSchema, Yw as OPENMELD_DAEMON_CANCEL_STOP_REQUESTED_AFTER_START_REASON_CODE, ZO as runtimeCoordinatorExecutionTokenEnvelopeSchema, Zb as runtimeTransportDeliverDispatchRequestSchema, ax as runtimeTransportDispatchPreviewEndRequestSchema, bu as SPACE_DISPATCH_TRACE_PROMPT_PREVIEW_MAX_CHARS, bx as runtimeTransportLocalAgentControlInterruptFramePayloadSchema, cx as runtimeTransportDispatchReasoningRequestSchema, d as SERVICE_EXECUTION_HOST_PROTOCOL, dk as runtimeTransportDeliveryExecutionIdentitySchema, ex as runtimeTransportDispatchInteractionResponseFramePayloadSchema, fj as computerPowerRequestFrameSchema, fx as runtimeTransportDispatchToolActivityRequestSchema, hO as AGENT_INTERACTION_DEFAULT_TIMEOUT_MS, iF as toCompatibleSpaceAddressingRequestWireValue, kk as localAgentReasoningPreferencesSchema, mx as runtimeTransportForkAgentSessionResultSchema, ox as runtimeTransportDispatchPreviewRequestSchema, p as serviceExecutionHostCatalogSchema, pS as openMeldDaemonTaskResultPayloadSchema, pj as computerPowerRequestSchema, pv as OFFICIAL_CLI_SKILL_URL, r as buildWorkingFolderRecoveryQuestion, rx as runtimeTransportDispatchLifecycleRequestSchema, sx as runtimeTransportDispatchProgressRequestSchema, t as WORKING_FOLDER_RECOVERY_DECLINED, tS as runtimeTransportSubmitTaskResultRequestSchema, tx as runtimeTransportDispatchLifecycleAcknowledgementSchema, ux as runtimeTransportDispatchRuntimeEvidenceRequestSchema, vx as runtimeTransportLocalAgentControlCancelFramePayloadSchema, wO as agentInteractionRequestSchema, wx as runtimeTransportLocalAgentControlSetEnabledFramePayloadSchema, xx as runtimeTransportLocalAgentControlManageInstallationFramePayloadSchema, yx as runtimeTransportLocalAgentControlForkSessionFramePayloadSchema } from "./dist-YSbIHBnl.js";
|
|
7
|
+
import { u as startWindowsIdleSleepBlocker } from "./process-identity-D_VPVruT.js";
|
|
8
|
+
import { Nt as buildSpaceAttachmentDownloadPath, ln as createOrganizationSkillsApi, xn as createSpaceApi } from "./dist-DY8oLAop.js";
|
|
9
|
+
import { d as getAuthSessionState } from "./auth-session-B0J2UwSR.js";
|
|
10
|
+
import { a as buildOpenMeldProfileIdentityRequestHeadersWithAuth, f as buildOpenMeldRequestContextFromProfileIdentity, n as fetchSpaceRequestWithTimeout, t as createCliApiClientFoundation } from "./api-client-foundation-6MeNwklv.js";
|
|
11
|
+
import { t as emitDaemonLifecycleEvent } from "./daemon-lifecycle-journal-DoAQ-E6K.js";
|
|
12
|
+
import { S as CONTROLLED_SHUTDOWN_RESULT_ACK_TIMEOUT_MS, _ as toErrorMessage$2, n as ensureDaemonRuntimePaths, s as emitRunLine, t as buildLedgerPaths, u as normalizeOptionalText$3, v as warnDaemonEvent } from "./daemon-device-id-C3UTBv9T.js";
|
|
13
|
+
import { F as SPACE_COLLABORATION_CONTEXT_RULE, I as SPACE_PERSONAL_CONTRIBUTION_RULE, X as resolvePublicAgentFailureReason, Z as resolveSpacePublicationRequirement } from "./dual-view-guide-catalog-3LaB18SR.js";
|
|
14
|
+
import { $t as createDispatchContinuationSpaceAccessContext, C as recordOpenMeldCreatedLocalAgentSession, D as readOpenCodeSessionRows, J as consumeArmedAgentControllerInterfaceReprobe, Yt as buildSpaceRoundSignalPublication, _ as sendDaemonFrame$1, _t as resolveBootstrapSpaceOwnerProfileId, an as getSpaceAccessPassword, at as emitDaemonDispatchJournalEvent, c as createDispatchSpaceActionContext, ct as readComputerFileAccessPolicy, d as readDispatchSpaceActionRecord, dt as isSameOrDescendantPath, f as supersedeDispatchSpaceActionRecordForReconsideration, ft as buildDispatchBootstrapTemplateFacts, g as parseDaemonFrame, gt as parseDispatchTask, ht as buildDispatchSessionTitle, k as resolveOpenCodeDatabasePath, l as readDispatchSpaceActionContextForReceiptFromEnv, ln as isWakeClosingSystemNoticeType, lt as resolveComputerFileAccessStorePath, mt as buildDispatchPromptPlan, on as getSpaceAccessRequestContext, pt as buildDispatchCorrelation, r as buildDispatchOwnedRuntimeEnv, s as OPENMELD_SPACE_ACTION_CONTEXT_PATH_ENV, un as listSpaceMemberDirectorySendTargets, vt as resolveBootstrapTargetProfileContext, xn as DISPATCH_SPACE_ACTION_CLI_FALLBACK_COMMAND, yt as resolveDispatchMentionSourceContext } from "./dispatch-owned-runtime-BTK0uuOV.js";
|
|
15
|
+
import { t as ExecutionHostError } from "./channel-7iF6DSp4.js";
|
|
16
|
+
import { f as withSkillsInstallLock, r as ensureLocalSkills, t as resolveSkillInstallStateForTarget } from "./state-BlZXA4Rd.js";
|
|
17
|
+
import { a as submitRuntimeProviderConversationProofs, f as recordRuntimeProviderUsageLimits, i as submitRuntimeAgentControllerReports, l as resolveLocalAgentControllerReportDecision, o as collectLocalAgentControllerInventory, t as notifyRuntimeReportingAttemptObserver, u as probeAgentControllerUsageObservationAuth } from "./runtime-agent-controller-reporting-submission-Dtvml_vt.js";
|
|
18
|
+
import { t as installSkillsToTargets } from "./installer-CwK5uV4Q.js";
|
|
19
|
+
import { B as installAgentActivityIntegrations, C as recordRuntimeReportingFailure, D as startLocalAgentActivitySyncLoop, E as createLedgerIo, F as registerAgentActivityRoute, T as recordRuntimeReportingSuccess, _ as markExecutionContextWorkspaceInUse, a as createDispatchSpaceTools, b as releaseExecutionContextWorkspace, g as deriveExecutionContextComputerFileAccessPolicy, h as startDispatchSpaceProgressRelay, i as materializeOrganizationSkillRelease, k as discoverLocalAgentSessionProviders, n as createSpaceWorkingCopies, r as downloadWorkingCopyFile, s as readTaskKnowledge, t as fetchSpaceUpdates, v as prepareExecutionContextWorkspace, w as recordRuntimeReportingNotApplicable, x as prepareClaudeProjectContainer, y as readExecutionContextWorkspace, z as defaultManagedIntegrationPaths } from "./updates-api-BpuVusi5.js";
|
|
20
|
+
import { h as createCliSpaceApi } from "./meta-api-B01L3fo4.js";
|
|
21
21
|
import { createHash, randomUUID } from "node:crypto";
|
|
22
22
|
import { homedir } from "node:os";
|
|
23
23
|
import { basename, dirname, extname, join } from "node:path";
|
|
@@ -2551,6 +2551,130 @@ function stableJson(value) {
|
|
|
2551
2551
|
return JSON.stringify(value) ?? "null";
|
|
2552
2552
|
}
|
|
2553
2553
|
//#endregion
|
|
2554
|
+
//#region src/local-service/execution-host/local-agent-setup.ts
|
|
2555
|
+
function createLocalAgentSetup(input) {
|
|
2556
|
+
const directory = join(input.rootDir, "connection-tools", "grok-bot");
|
|
2557
|
+
const receipt = join(directory, "setup.json");
|
|
2558
|
+
let active = null;
|
|
2559
|
+
let tail = Promise.resolve();
|
|
2560
|
+
const serialize = (fn) => {
|
|
2561
|
+
const next = tail.then(fn, fn);
|
|
2562
|
+
tail = next.catch(() => void 0);
|
|
2563
|
+
return next;
|
|
2564
|
+
};
|
|
2565
|
+
async function readAll() {
|
|
2566
|
+
try {
|
|
2567
|
+
return localAgentSetupOperationSchema.array().parse(JSON.parse(await readFile(receipt, "utf8")));
|
|
2568
|
+
} catch (error) {
|
|
2569
|
+
if (error.code === "ENOENT") return [];
|
|
2570
|
+
throw new Error("Connection setup history could not be read. Check Service diagnostics.");
|
|
2571
|
+
}
|
|
2572
|
+
}
|
|
2573
|
+
async function read() {
|
|
2574
|
+
return (await readAll()).at(-1) ?? null;
|
|
2575
|
+
}
|
|
2576
|
+
async function save(operation) {
|
|
2577
|
+
const records = await readAll();
|
|
2578
|
+
const index = records.findIndex((entry) => entry.operationId === operation.operationId);
|
|
2579
|
+
if (index < 0) records.push(operation);
|
|
2580
|
+
else records[index] = operation;
|
|
2581
|
+
await mkdir(directory, {
|
|
2582
|
+
recursive: true,
|
|
2583
|
+
mode: 448
|
|
2584
|
+
});
|
|
2585
|
+
await writeFile(`${receipt}.tmp`, JSON.stringify(records), { mode: 384 });
|
|
2586
|
+
await rename(`${receipt}.tmp`, receipt);
|
|
2587
|
+
}
|
|
2588
|
+
async function state(recordedOperation) {
|
|
2589
|
+
const operation = recordedOperation ?? await read();
|
|
2590
|
+
const installed = Boolean(await readManagedGrokBotCandidate(input.rootDir));
|
|
2591
|
+
return {
|
|
2592
|
+
supported: supportsGrokBotSetup(),
|
|
2593
|
+
installed,
|
|
2594
|
+
signedIn: installed && active === null && await isManagedGrokBotSignedIn(input.rootDir),
|
|
2595
|
+
operation: operation?.status === "running" && active !== operation.operationId ? {
|
|
2596
|
+
...operation,
|
|
2597
|
+
status: "outcome_unknown",
|
|
2598
|
+
message: "Setup could not be confirmed after Service restarted. Use manual setup in the guide, then select that installation in Computer settings."
|
|
2599
|
+
} : operation
|
|
2600
|
+
};
|
|
2601
|
+
}
|
|
2602
|
+
function start(request) {
|
|
2603
|
+
return serialize(async () => {
|
|
2604
|
+
const records = await readAll();
|
|
2605
|
+
const repeated = records.find((entry) => entry.operationId === request.operationId);
|
|
2606
|
+
const existing = records.at(-1);
|
|
2607
|
+
if (repeated) {
|
|
2608
|
+
if (repeated.action !== request.action) throw new Error("This request belongs to a different setup action.");
|
|
2609
|
+
return state(repeated);
|
|
2610
|
+
}
|
|
2611
|
+
if (existing?.status === "running" || existing?.status === "outcome_unknown") throw new Error("Earlier setup has not finished. Check its status before starting again.");
|
|
2612
|
+
if (!supportsGrokBotSetup()) throw new Error("Use the setup guide on this platform.");
|
|
2613
|
+
if (request.action === "login" && !await readManagedGrokBotCandidate(input.rootDir)) throw new Error("Install connection tools first.");
|
|
2614
|
+
let accepted;
|
|
2615
|
+
let rejected;
|
|
2616
|
+
const ready = new Promise((resolve, reject) => {
|
|
2617
|
+
accepted = resolve;
|
|
2618
|
+
rejected = reject;
|
|
2619
|
+
});
|
|
2620
|
+
input.slots.runAdapterOperationIfIdle("grok-bot", async () => {
|
|
2621
|
+
const operation = {
|
|
2622
|
+
operationId: request.operationId,
|
|
2623
|
+
action: request.action,
|
|
2624
|
+
status: "running",
|
|
2625
|
+
message: request.action === "install" ? "Installing connection tools. You can keep using OpenMeld." : "Finish sign-in in the browser on this computer. You can close this dialog."
|
|
2626
|
+
};
|
|
2627
|
+
active = request.operationId;
|
|
2628
|
+
try {
|
|
2629
|
+
await save(operation);
|
|
2630
|
+
accepted();
|
|
2631
|
+
if (request.action === "install") await installGrokBotTools(input.rootDir);
|
|
2632
|
+
else await loginManagedGrokBot(input.rootDir);
|
|
2633
|
+
await reconcileNewRunnableBuiltinAgentRegistrations({ states: (await listAgentTargetStates()).filter((item) => item.agentId === "grok-bot") });
|
|
2634
|
+
await manageAgentRegistrationInstallation({
|
|
2635
|
+
agentId: "grok-bot",
|
|
2636
|
+
operation: "select",
|
|
2637
|
+
installationId: "openmeld-managed-grok-bot"
|
|
2638
|
+
});
|
|
2639
|
+
await setAgentRegistrationEnabled({
|
|
2640
|
+
agentId: "grok-bot",
|
|
2641
|
+
enabled: true
|
|
2642
|
+
});
|
|
2643
|
+
await save({
|
|
2644
|
+
...operation,
|
|
2645
|
+
status: "succeeded",
|
|
2646
|
+
message: request.action === "install" ? "Connection tools installed. Sign in to connect your Bot." : "Signed in. Continue connecting your Bot."
|
|
2647
|
+
});
|
|
2648
|
+
} catch (error) {
|
|
2649
|
+
rejected(error);
|
|
2650
|
+
await save({
|
|
2651
|
+
...operation,
|
|
2652
|
+
status: "failed",
|
|
2653
|
+
message: error instanceof Error ? error.message.slice(0, 1024) : "Setup failed. Try again."
|
|
2654
|
+
});
|
|
2655
|
+
} finally {
|
|
2656
|
+
active = null;
|
|
2657
|
+
}
|
|
2658
|
+
}).then(async (result) => {
|
|
2659
|
+
if (!result.accepted) {
|
|
2660
|
+
rejected(/* @__PURE__ */ new Error("Grok Bot has work or setup in progress. Wait for it to finish."));
|
|
2661
|
+
return;
|
|
2662
|
+
}
|
|
2663
|
+
await input.refresh();
|
|
2664
|
+
}).catch((error) => {
|
|
2665
|
+
rejected(error);
|
|
2666
|
+
input.log("Connection setup could not complete. Check Service diagnostics.");
|
|
2667
|
+
});
|
|
2668
|
+
await ready;
|
|
2669
|
+
return state();
|
|
2670
|
+
});
|
|
2671
|
+
}
|
|
2672
|
+
return {
|
|
2673
|
+
state,
|
|
2674
|
+
start
|
|
2675
|
+
};
|
|
2676
|
+
}
|
|
2677
|
+
//#endregion
|
|
2554
2678
|
//#region src/local-service/execution-host/local-agent-update.ts
|
|
2555
2679
|
function createLocalAgentUpdater(input) {
|
|
2556
2680
|
const active = /* @__PURE__ */ new Set();
|
|
@@ -2715,6 +2839,15 @@ function createExecutionHostControls(input) {
|
|
|
2715
2839
|
},
|
|
2716
2840
|
log: (message) => log("daemon.local_agent_update", message)
|
|
2717
2841
|
});
|
|
2842
|
+
const setup = createLocalAgentSetup({
|
|
2843
|
+
rootDir: resolveOpenMeldRootDir(),
|
|
2844
|
+
slots: input.localExecutionSlots,
|
|
2845
|
+
refresh: async () => {
|
|
2846
|
+
await refreshReports();
|
|
2847
|
+
input.invalidate("routes");
|
|
2848
|
+
},
|
|
2849
|
+
log: (message) => log("daemon.local_agent_setup", message)
|
|
2850
|
+
});
|
|
2718
2851
|
async function refreshReports() {
|
|
2719
2852
|
try {
|
|
2720
2853
|
const result = await input.refreshReports();
|
|
@@ -2755,8 +2888,25 @@ function createExecutionHostControls(input) {
|
|
|
2755
2888
|
};
|
|
2756
2889
|
}
|
|
2757
2890
|
}
|
|
2891
|
+
async function selectInstallation(control) {
|
|
2892
|
+
const guarded = await input.localExecutionSlots.runAdapterOperationIfIdle(control.agentId, () => manageAgentRegistrationInstallation(control));
|
|
2893
|
+
if (!guarded.accepted) throw new Error(guarded.status === "operation_in_progress" ? "agents.installation_change_in_progress: this installation is already being changed; check again in a moment" : "agents.installation_change_blocked_by_work: this agent has work in progress; wait until it finishes before changing installations");
|
|
2894
|
+
return guarded.value;
|
|
2895
|
+
}
|
|
2758
2896
|
async function manageInstallation(control) {
|
|
2759
2897
|
try {
|
|
2898
|
+
if (control.operation === "setup") return {
|
|
2899
|
+
accepted: true,
|
|
2900
|
+
agentId: "grok-bot",
|
|
2901
|
+
status: "setup_state",
|
|
2902
|
+
setup: await setup.start(control)
|
|
2903
|
+
};
|
|
2904
|
+
if (control.operation === "read_setup") return {
|
|
2905
|
+
accepted: true,
|
|
2906
|
+
agentId: "grok-bot",
|
|
2907
|
+
status: "setup_state",
|
|
2908
|
+
setup: await setup.state()
|
|
2909
|
+
};
|
|
2760
2910
|
if (control.operation === "update" || control.operation === "read_update") {
|
|
2761
2911
|
const update = control.operation === "update" ? await updater.start(control.agentId, control) : await updater.state(control.agentId);
|
|
2762
2912
|
return {
|
|
@@ -2767,11 +2917,8 @@ function createExecutionHostControls(input) {
|
|
|
2767
2917
|
};
|
|
2768
2918
|
}
|
|
2769
2919
|
let result;
|
|
2770
|
-
if (control.operation === "select")
|
|
2771
|
-
|
|
2772
|
-
if (!guarded.accepted) throw new Error(guarded.status === "operation_in_progress" ? "agents.installation_change_in_progress: this installation is already being changed; check again in a moment" : "agents.installation_change_blocked_by_work: this agent has work in progress; wait until it finishes before changing installations");
|
|
2773
|
-
result = guarded.value;
|
|
2774
|
-
} else result = await manageAgentRegistrationInstallation({
|
|
2920
|
+
if (control.operation === "select") result = await selectInstallation(control);
|
|
2921
|
+
else result = await manageAgentRegistrationInstallation({
|
|
2775
2922
|
agentId: control.agentId,
|
|
2776
2923
|
operation: "list"
|
|
2777
2924
|
});
|
|
@@ -9537,7 +9684,10 @@ function createExecutionHostRuntime(input) {
|
|
|
9537
9684
|
localExecutionSlots,
|
|
9538
9685
|
presenter: input.presenter,
|
|
9539
9686
|
routeCatalogState,
|
|
9540
|
-
refreshReports: () =>
|
|
9687
|
+
refreshReports: async () => {
|
|
9688
|
+
await Promise.allSettled([controllerReport]);
|
|
9689
|
+
return reportControllers("fresh");
|
|
9690
|
+
},
|
|
9541
9691
|
invalidate
|
|
9542
9692
|
});
|
|
9543
9693
|
const activity = startLocalAgentActivitySyncLoop({
|
|
@@ -9873,4 +10023,4 @@ function createExecutionHostRuntime(input) {
|
|
|
9873
10023
|
//#endregion
|
|
9874
10024
|
export { createExecutionHostResources, createExecutionHostRuntime };
|
|
9875
10025
|
|
|
9876
|
-
//# sourceMappingURL=runtime-
|
|
10026
|
+
//# sourceMappingURL=runtime-BsLzW985.js.map
|