openmeld 0.3.221 → 0.3.223
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{add-me-membership-DpckwGof.js → add-me-membership-AWArQHSP.js} +2 -2
- package/dist/{add-me-membership-DpckwGof.js.map → add-me-membership-AWArQHSP.js.map} +1 -1
- package/dist/{agents-2TzCubpV.js → agents-PsEPfW3B.js} +12 -12
- package/dist/{agents-2TzCubpV.js.map → agents-PsEPfW3B.js.map} +1 -1
- package/dist/{api-client-foundation-CGImd4c8.js → api-client-foundation-CbbeqtJY.js} +1 -1
- package/dist/{api-client-foundation-D-Cb6EVg.js → api-client-foundation-D2lqqEZK.js} +3 -3
- package/dist/{api-client-foundation-D-Cb6EVg.js.map → api-client-foundation-D2lqqEZK.js.map} +1 -1
- package/dist/auth-session-8GEdTCmT.js +4 -0
- package/dist/{auth-session-CDhQANWx.js → auth-session-BDEv3tou.js} +8 -8
- package/dist/auth-session-BDEv3tou.js.map +1 -0
- package/dist/{base-url-CMBApK1J.js → base-url-DXrUiSMI.js} +1 -1
- package/dist/{base-url-D7uE_xTo.js → base-url-DvjOkKPs.js} +2 -2
- package/dist/{base-url-D7uE_xTo.js.map → base-url-DvjOkKPs.js.map} +1 -1
- package/dist/{channel-D5ABuavH.js → channel-CDXD7Bfv.js} +4 -4
- package/dist/{channel-D5ABuavH.js.map → channel-CDXD7Bfv.js.map} +1 -1
- package/dist/{cli-binary-manifest-DiUulkp0.js → cli-binary-manifest-CT5X05lk.js} +30 -4
- package/dist/cli-binary-manifest-CT5X05lk.js.map +1 -0
- package/dist/{command-MlrjQYq5.js → command-CUNcwWww.js} +22 -165
- package/dist/command-CUNcwWww.js.map +1 -0
- package/dist/{computer-connection-DYnof5Xw.js → computer-connection-NCM-EnCu.js} +2 -2
- package/dist/{computer-connection-DYnof5Xw.js.map → computer-connection-NCM-EnCu.js.map} +1 -1
- package/dist/{computer-connection-review-mO6vn3C3.js → computer-connection-review-DATbh3kD.js} +6 -6
- package/dist/{computer-connection-review-mO6vn3C3.js.map → computer-connection-review-DATbh3kD.js.map} +1 -1
- package/dist/{computer-disconnect-CLtQwKDS.js → computer-disconnect-Cd1YvKu7.js} +10 -10
- package/dist/{computer-disconnect-CLtQwKDS.js.map → computer-disconnect-Cd1YvKu7.js.map} +1 -1
- package/dist/{computer-setup-continuation-PVwPXc5i.js → computer-setup-continuation-TU09jiWA.js} +4 -4
- package/dist/{computer-setup-continuation-PVwPXc5i.js.map → computer-setup-continuation-TU09jiWA.js.map} +1 -1
- package/dist/context-BUmQsG9U.js +162 -0
- package/dist/context-BUmQsG9U.js.map +1 -0
- package/dist/{control-plane-BDS63N7Y.js → control-plane-rTE2rHZ5.js} +4 -2
- package/dist/control-plane-rTE2rHZ5.js.map +1 -0
- package/dist/{daemon-device-id-YnLMx1kN.js → daemon-device-id-BOqTgR9G.js} +344 -36
- package/dist/daemon-device-id-BOqTgR9G.js.map +1 -0
- package/dist/{daemon-frame-transport-D-4StENt.js → daemon-frame-transport-C3SOtG8a.js} +519 -12
- package/dist/daemon-frame-transport-C3SOtG8a.js.map +1 -0
- package/dist/{daemon-lifecycle-journal-DcrVY0xb.js → daemon-lifecycle-journal-D4uZ-Ykq.js} +10 -10
- package/dist/daemon-lifecycle-journal-D4uZ-Ykq.js.map +1 -0
- package/dist/{daemon-runtime-lease-BUr4qsLo.js → daemon-runtime-lease-1LMeZ6IS.js} +2 -2
- package/dist/{daemon-runtime-lease-BUr4qsLo.js.map → daemon-runtime-lease-1LMeZ6IS.js.map} +1 -1
- package/dist/{daemon-runtime-lease-C9X8xV_F.js → daemon-runtime-lease-Bz0ucJj3.js} +1 -1
- package/dist/{daemon-service-contract-BpOBMGX0.js → daemon-service-contract-GLmAxsq-.js} +4 -4
- package/dist/{daemon-service-contract-BpOBMGX0.js.map → daemon-service-contract-GLmAxsq-.js.map} +1 -1
- package/dist/{daemon-service-manager-HL4VKbIU.js → daemon-service-manager-C8RUCMDo.js} +9 -7
- package/dist/daemon-service-manager-C8RUCMDo.js.map +1 -0
- package/dist/{daemon-service-manager-B-QrDe5p.js → daemon-service-manager-CU-79a4z.js} +1 -1
- package/dist/{daemon-service-runtime-Kr6Bs2J2.js → daemon-service-runtime-BEfMD5jb.js} +397 -51
- package/dist/daemon-service-runtime-BEfMD5jb.js.map +1 -0
- package/dist/{daemon-service-update-coordinator-RJO997me.js → daemon-service-update-coordinator-uQW-Ib66.js} +48 -33
- package/dist/daemon-service-update-coordinator-uQW-Ib66.js.map +1 -0
- package/dist/{daemon-state-B44aq2nm.js → daemon-state-Ca0WK5x0.js} +3 -3
- package/dist/{daemon-state-B44aq2nm.js.map → daemon-state-Ca0WK5x0.js.map} +1 -1
- package/dist/{dist-BewA9srP.js → dist-B0OGOBKB.js} +81 -15
- package/dist/dist-B0OGOBKB.js.map +1 -0
- package/dist/dist-BMJ6nTd6.js +4 -0
- package/dist/{dist-ChS52b_E.js → dist-CkSuMZyq.js} +16 -12
- package/dist/dist-CkSuMZyq.js.map +1 -0
- package/dist/{elapsed-time-Cw6b9rYy.js → elapsed-time-DmXBSBLX.js} +6 -6
- package/dist/{elapsed-time-Cw6b9rYy.js.map → elapsed-time-DmXBSBLX.js.map} +1 -1
- package/dist/{entry-BE8uqbkD.js → entry-DbA--kpf.js} +12 -12
- package/dist/{entry-BE8uqbkD.js.map → entry-DbA--kpf.js.map} +1 -1
- package/dist/{installation-inventory-Dwn8FoKT.js → installation-inventory-B50K5Nme.js} +5 -5
- package/dist/{installation-inventory-Dwn8FoKT.js.map → installation-inventory-B50K5Nme.js.map} +1 -1
- package/dist/{installer-CsQ4vNjT.js → installer-BSByDtli.js} +2 -2
- package/dist/{installer-CsQ4vNjT.js.map → installer-BSByDtli.js.map} +1 -1
- package/dist/io-DT66typ4.js +16 -0
- package/dist/io-DT66typ4.js.map +1 -0
- package/dist/{local-components-B6SCXZf9.js → local-components-DleLEzSU.js} +2 -1
- package/dist/local-components-DleLEzSU.js.map +1 -0
- package/dist/{lock-Bsl_ElWy.js → lock-iue1J2xy.js} +8 -5
- package/dist/lock-iue1J2xy.js.map +1 -0
- package/dist/{cli-space-api-B2l1xMPn.js → meta-api-C4_z3Ins.js} +203 -19
- package/dist/meta-api-C4_z3Ins.js.map +1 -0
- package/dist/{openmeld-Tkp17vPg.js → openmeld-BloctT8R.js} +101 -1026
- package/dist/openmeld-BloctT8R.js.map +1 -0
- package/dist/openmeld-dev.js +1 -1
- package/dist/{openmeld-environment-target-B6HqY0_a.js → openmeld-environment-target-BBn5Ko6p.js} +3 -3
- package/dist/{openmeld-environment-target-B6HqY0_a.js.map → openmeld-environment-target-BBn5Ko6p.js.map} +1 -1
- package/dist/{openmeld-maintenance-worker-C1J_ISOh.js → openmeld-maintenance-worker-BgA89k58.js} +15 -14
- package/dist/openmeld-maintenance-worker-BgA89k58.js.map +1 -0
- package/dist/{openmeld-tools-update-join-ZLpRTHO3.js → openmeld-tools-update-join-B4sRZFfU.js} +4 -4
- package/dist/{openmeld-tools-update-join-ZLpRTHO3.js.map → openmeld-tools-update-join-B4sRZFfU.js.map} +1 -1
- package/dist/{openmeld-tools-update-process-frame-B-XB4dmO.js → openmeld-tools-update-process-frame-BtFKp70p.js} +2 -2
- package/dist/{openmeld-tools-update-process-frame-B-XB4dmO.js.map → openmeld-tools-update-process-frame-BtFKp70p.js.map} +1 -1
- package/dist/{openmeld-tools-update-process-frame-j-RXwFsK.js → openmeld-tools-update-process-frame-DbEZ3fEh.js} +1 -1
- package/dist/openmeld.js +9 -5
- package/dist/openmeld.js.map +1 -1
- package/dist/{prepare-provider-runtime-CD5ZI-ct.js → prepare-provider-runtime-L84g7H_Q.js} +3395 -1346
- package/dist/prepare-provider-runtime-L84g7H_Q.js.map +1 -0
- package/dist/{prepare-session-executor-C2nNM2yb.js → prepare-session-executor-uQHhdNg8.js} +29 -28
- package/dist/prepare-session-executor-uQHhdNg8.js.map +1 -0
- package/dist/{presenter-BcxiQyJg.js → presenter-MJ5YgsOT.js} +3 -13
- package/dist/presenter-MJ5YgsOT.js.map +1 -0
- package/dist/{process-channel-B2BU2X7x.js → process-channel-D71P1C32.js} +2 -2
- package/dist/{process-channel-B2BU2X7x.js.map → process-channel-D71P1C32.js.map} +1 -1
- package/dist/process-environment-BWSFeUu6.js +49 -0
- package/dist/process-environment-BWSFeUu6.js.map +1 -0
- package/dist/process-identity-BQLdaZdB.js +190 -0
- package/dist/process-identity-BQLdaZdB.js.map +1 -0
- package/dist/process-launch-B0pHlkV_.js +173 -0
- package/dist/process-launch-B0pHlkV_.js.map +1 -0
- package/dist/{published-production-safety-dp-fOmmB.js → published-production-safety-C40hKrBA.js} +2 -2
- package/dist/{published-production-safety-dp-fOmmB.js.map → published-production-safety-C40hKrBA.js.map} +1 -1
- package/dist/{runtime-DMYoB5_x.js → runtime-Pwc12DeY.js} +155 -702
- package/dist/runtime-Pwc12DeY.js.map +1 -0
- package/dist/{runtime-agent-controller-reporting-submission-DGm8O4q_.js → runtime-agent-controller-reporting-submission-AmSxt3Z1.js} +11 -10
- package/dist/{runtime-agent-controller-reporting-submission-DGm8O4q_.js.map → runtime-agent-controller-reporting-submission-AmSxt3Z1.js.map} +1 -1
- package/dist/{runtime-reporting-health-state-BWZgy4pF.js → runtime-reporting-health-state-DwlV1Fsv.js} +2210 -60
- package/dist/runtime-reporting-health-state-DwlV1Fsv.js.map +1 -0
- package/dist/{runtime-transport-0F5E6So6.js → runtime-transport-CivtwW1A.js} +104 -15
- package/dist/runtime-transport-CivtwW1A.js.map +1 -0
- package/dist/{service-C72KhNft.js → service-DYid1j4Y.js} +124 -548
- package/dist/service-DYid1j4Y.js.map +1 -0
- package/dist/{service-account-admission-Dy2W3n3_.js → service-account-admission-BfdJ-kKR.js} +18 -10
- package/dist/service-account-admission-BfdJ-kKR.js.map +1 -0
- package/dist/{service-account-authorization-DAPQy2yP.js → service-account-authorization-Cx6KEfvI.js} +6 -6
- package/dist/{service-account-authorization-DAPQy2yP.js.map → service-account-authorization-Cx6KEfvI.js.map} +1 -1
- package/dist/{service-account-control-DZjUR3I_.js → service-account-control-NTVNuQbb.js} +16 -16
- package/dist/service-account-control-NTVNuQbb.js.map +1 -0
- package/dist/{service-control-capabilities-Y4CGrchz.js → service-control-capabilities-CkKw-5l7.js} +1 -1
- package/dist/{service-control-capabilities-C2MF5FUD.js → service-control-capabilities-D0qUygFh.js} +19 -15
- package/dist/service-control-capabilities-D0qUygFh.js.map +1 -0
- package/dist/{service-control-carrier-capability-DDNyE5cB.js → service-control-carrier-capability-gMk5gMKU.js} +11 -4
- package/dist/service-control-carrier-capability-gMk5gMKU.js.map +1 -0
- package/dist/{state-CK1WXIsI.js → state-CZHAuQRD.js} +4 -4
- package/dist/{state-CK1WXIsI.js.map → state-CZHAuQRD.js.map} +1 -1
- package/dist/upgrade-DBdUgOXy.js +4 -0
- package/dist/{upgrade-BTIKVek7.js → upgrade-ym-rbiAR.js} +52 -32
- package/dist/upgrade-ym-rbiAR.js.map +1 -0
- package/dist/windows/openmeld-windows-process.exe +0 -0
- package/dist/windows-artifact-DJ9DKjfc.js +16 -0
- package/dist/windows-artifact-DJ9DKjfc.js.map +1 -0
- package/dist/windows-task-command-COu_6Ke3.js +74 -0
- package/dist/windows-task-command-COu_6Ke3.js.map +1 -0
- package/dist/windows-task-entry-CtRpUbiK.js +50 -0
- package/dist/windows-task-entry-CtRpUbiK.js.map +1 -0
- package/dist/{windows-user-task-Bx2yYnOM.js → windows-user-task-B8NcRg_u.js} +1 -1
- package/dist/{windows-user-task-CRGbKggi.js → windows-user-task-Io5QuEVR.js} +108 -51
- package/dist/windows-user-task-Io5QuEVR.js.map +1 -0
- package/package.json +11 -11
- package/skills/openmeld-cli/playbooks/space-ops.md +9 -3
- package/skills/openmeld-cli/references/commands.md +0 -1
- package/dist/auth-session-CDhQANWx.js.map +0 -1
- package/dist/auth-session-DsBkEFct.js +0 -4
- package/dist/cli-binary-manifest-DiUulkp0.js.map +0 -1
- package/dist/cli-space-api-B2l1xMPn.js.map +0 -1
- package/dist/command-MlrjQYq5.js.map +0 -1
- package/dist/context-D9Ebb5wl.js +0 -473
- package/dist/context-D9Ebb5wl.js.map +0 -1
- package/dist/control-plane-BDS63N7Y.js.map +0 -1
- package/dist/daemon-device-id-YnLMx1kN.js.map +0 -1
- package/dist/daemon-frame-transport-D-4StENt.js.map +0 -1
- package/dist/daemon-lifecycle-journal-DcrVY0xb.js.map +0 -1
- package/dist/daemon-service-manager-HL4VKbIU.js.map +0 -1
- package/dist/daemon-service-runtime-Kr6Bs2J2.js.map +0 -1
- package/dist/daemon-service-update-coordinator-RJO997me.js.map +0 -1
- package/dist/dist-B6VsppM7.js +0 -4
- package/dist/dist-BewA9srP.js.map +0 -1
- package/dist/dist-ChS52b_E.js.map +0 -1
- package/dist/local-components-B6SCXZf9.js.map +0 -1
- package/dist/lock-Bsl_ElWy.js.map +0 -1
- package/dist/openmeld-Tkp17vPg.js.map +0 -1
- package/dist/openmeld-maintenance-worker-C1J_ISOh.js.map +0 -1
- package/dist/prepare-provider-runtime-CD5ZI-ct.js.map +0 -1
- package/dist/prepare-session-executor-C2nNM2yb.js.map +0 -1
- package/dist/presenter-BcxiQyJg.js.map +0 -1
- package/dist/process-identity-CNus0e6E.js +0 -146
- package/dist/process-identity-CNus0e6E.js.map +0 -1
- package/dist/runtime-DMYoB5_x.js.map +0 -1
- package/dist/runtime-reporting-health-state-BWZgy4pF.js.map +0 -1
- package/dist/runtime-transport-0F5E6So6.js.map +0 -1
- package/dist/service-C72KhNft.js.map +0 -1
- package/dist/service-account-admission-Dy2W3n3_.js.map +0 -1
- package/dist/service-account-control-DZjUR3I_.js.map +0 -1
- package/dist/service-control-capabilities-C2MF5FUD.js.map +0 -1
- package/dist/service-control-carrier-capability-DDNyE5cB.js.map +0 -1
- package/dist/upgrade-BTIKVek7.js.map +0 -1
- package/dist/upgrade-DTB0ZmxI.js +0 -4
- package/dist/windows-user-task-CRGbKggi.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli-binary-manifest-DiUulkp0.js","names":[],"sources":["../../../packages/schemas/dist/schemas/http/cli-binary-manifest.js"],"sourcesContent":["import * as z$1 from \"zod/v4\";\n//#region src/schemas/http/cli-binary-manifest.ts\nconst SHA256_HEX_PATTERN = /^[a-f0-9]{64}$/u;\nfunction isBase64(value) {\n\tif (value.length === 0 || value.length % 4 !== 0) return false;\n\tlet contentEnd = value.length;\n\tif (value.endsWith(\"==\")) contentEnd -= 2;\n\telse if (value.endsWith(\"=\")) contentEnd -= 1;\n\tfor (let index = 0; index < contentEnd; index += 1) {\n\t\tconst code = value.charCodeAt(index);\n\t\tif (!(code >= 65 && code <= 90 || code >= 97 && code <= 122 || code >= 48 && code <= 57 || code === 43 || code === 47)) return false;\n\t}\n\treturn true;\n}\nconst cliBinaryArtifactSchema = z$1.object({\n\tsha256: z$1.string().regex(SHA256_HEX_PATTERN),\n\tsizeBytes: z$1.number().int().positive(),\n\turl: z$1.url()\n});\nconst cliBinaryArchiveTransportSchema = z$1.object({\n\tarchiveFormat: z$1.literal(\"gzip\"),\n\tarchiveSha256: z$1.string().regex(SHA256_HEX_PATTERN),\n\tarchiveSizeBytes: z$1.number().int().positive(),\n\tarchiveUrl: z$1.url()\n});\nconst cliBinaryCompressedReleaseSchema = cliBinaryArtifactSchema.extend(cliBinaryArchiveTransportSchema.shape);\nconst cliBinaryDeltaPatchSchema = z$1.object({\n\tbaseSha256: z$1.string().regex(SHA256_HEX_PATTERN),\n\tbaseSizeBytes: z$1.number().int().positive(),\n\tblockSizeBytes: z$1.literal(4096),\n\tpatchFormat: z$1.literal(\"block-ranges-v1\"),\n\tschemaVersion: z$1.literal(1),\n\tsegments: z$1.array(z$1.object({\n\t\tdataBase64: z$1.string().min(4).refine(isBase64, \"invalid base64\"),\n\t\toffset: z$1.number().int().nonnegative()\n\t})).max(1e5),\n\ttargetSha256: z$1.string().regex(SHA256_HEX_PATTERN),\n\ttargetSizeBytes: z$1.number().int().positive()\n});\nconst cliBinaryDeltaTransportSchema = z$1.object({\n\tfromSha256: z$1.string().regex(SHA256_HEX_PATTERN),\n\tfromSizeBytes: z$1.number().int().positive(),\n\tfromVersion: z$1.string().trim().min(1),\n\tpatchCompression: z$1.literal(\"gzip\"),\n\tpatchFormat: z$1.literal(\"block-ranges-v1\"),\n\tpatchPayloadSizeBytes: z$1.number().int().positive(),\n\tpatchSha256: z$1.string().regex(SHA256_HEX_PATTERN),\n\tpatchSizeBytes: z$1.number().int().positive(),\n\tpatchUrl: z$1.url()\n});\nconst cliBinaryReleaseSchema = cliBinaryArtifactSchema.extend({\n\tarchiveFormat: cliBinaryArchiveTransportSchema.shape.archiveFormat.optional(),\n\tarchiveSha256: cliBinaryArchiveTransportSchema.shape.archiveSha256.optional(),\n\tarchiveSizeBytes: cliBinaryArchiveTransportSchema.shape.archiveSizeBytes.optional(),\n\tarchiveUrl: cliBinaryArchiveTransportSchema.shape.archiveUrl.optional(),\n\tcodeIdentifier: z$1.string().trim().min(1).optional(),\n\tdeltas: z$1.array(cliBinaryDeltaTransportSchema).max(8).optional(),\n\tteamIdentifier: z$1.string().trim().min(1).optional()\n}).superRefine((release, context) => {\n\tconst archiveFields = [\n\t\trelease.archiveFormat,\n\t\trelease.archiveSha256,\n\t\trelease.archiveSizeBytes,\n\t\trelease.archiveUrl\n\t];\n\tif (!(archiveFields.every((value) => value === void 0) || archiveFields.every((value) => value !== void 0))) context.addIssue({\n\t\tcode: \"custom\",\n\t\tmessage: \"compressed transport fields must be provided together\"\n\t});\n\tif (release.codeIdentifier === void 0 !== (release.teamIdentifier === void 0)) context.addIssue({\n\t\tcode: \"custom\",\n\t\tmessage: \"signature identity fields must be provided together\"\n\t});\n\tconst deltaBases = /* @__PURE__ */ new Set();\n\tfor (const delta of release.deltas ?? []) {\n\t\tconst baseKey = `${delta.fromVersion}:${delta.fromSha256}`;\n\t\tif (deltaBases.has(baseKey)) {\n\t\t\tcontext.addIssue({\n\t\t\t\tcode: \"custom\",\n\t\t\t\tmessage: \"delta base records must be unique\"\n\t\t\t});\n\t\t\tbreak;\n\t\t}\n\t\tdeltaBases.add(baseKey);\n\t}\n});\nconst binaryPlatformsSchema = z$1.record(z$1.string().trim().min(1), cliBinaryReleaseSchema).refine((platforms) => Object.keys(platforms).length > 0, { message: \"at least one platform is required\" });\nconst cliBinaryServiceReleaseSchema = z$1.object({\n\tplatforms: binaryPlatformsSchema,\n\tversion: z$1.string().trim().min(1)\n});\nconst cliBinaryManifestSchema = z$1.object({\n\tchannels: z$1.object({ stable: z$1.object({\n\t\tminRequiredCliVersion: z$1.string().trim().min(1).nullable().optional(),\n\t\tplatforms: binaryPlatformsSchema,\n\t\tservice: cliBinaryServiceReleaseSchema.optional(),\n\t\tversion: z$1.string().trim().min(1)\n\t}).superRefine((stable, context) => {\n\t\tif (!stable.service) return;\n\t\tfor (const platform of Object.keys(stable.platforms)) if (!stable.service.platforms[platform]) context.addIssue({\n\t\t\tcode: \"custom\",\n\t\t\tpath: [\n\t\t\t\t\"service\",\n\t\t\t\t\"platforms\",\n\t\t\t\tplatform\n\t\t\t],\n\t\t\tmessage: \"a Service artifact is required for every CLI platform\"\n\t\t});\n\t}) }),\n\tschemaVersion: z$1.literal(1)\n});\n//#endregion\nexport { cliBinaryCompressedReleaseSchema, cliBinaryDeltaPatchSchema, cliBinaryDeltaTransportSchema, cliBinaryManifestSchema, cliBinaryReleaseSchema, cliBinaryServiceReleaseSchema };\n\n//# sourceMappingURL=cli-binary-manifest.js.map"],"mappings":";;;;AAEA,MAAM,qBAAqB;AAC3B,SAAS,SAAS,OAAO;CACxB,IAAI,MAAM,WAAW,KAAK,MAAM,SAAS,MAAM,GAAG,OAAO;CACzD,IAAI,aAAa,MAAM;CACvB,IAAI,MAAM,SAAS,IAAI,GAAG,cAAc;MACnC,IAAI,MAAM,SAAS,GAAG,GAAG,cAAc;CAC5C,KAAK,IAAI,QAAQ,GAAG,QAAQ,YAAY,SAAS,GAAG;EACnD,MAAM,OAAO,MAAM,WAAW,KAA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 @@
|
|
|
1
|
-
{"version":3,"file":"cli-space-api-B2l1xMPn.js","names":["normalizeOptionalText","normalizeOptionalText","record"],"sources":["../src/runtime/dispatch-space-action-context.ts","../src/runtime/dispatch-owned-runtime.ts","../src/space/api-json.ts","../src/space/gateway-response.ts","../src/space/space-meta-response.ts","../src/space/meta-api.ts","../src/space/cli-space-api.ts"],"sourcesContent":["import { randomUUID } from \"node:crypto\";\nimport {\n chmodSync,\n existsSync,\n mkdirSync,\n readFileSync,\n renameSync,\n writeFileSync,\n} from \"node:fs\";\nimport { join } from \"node:path\";\nimport { isDeepStrictEqual } from \"node:util\";\nimport {\n openMeldSpaceEgressActionSchema,\n spaceMemberDirectoryEntrySchema,\n} from \"@openmeld/schemas\";\nimport type {\n DispatchSpaceActionClosedReasonCode,\n OpenMeldSpaceEgressAction,\n SpaceContract,\n SpaceMemberDirectoryEntry,\n} from \"@openmeld/schemas/types\";\nimport { isSelfWakeSpaceAction } from \"@openmeld/space-mesh\";\nimport { daemonRuntimeRootPath } from \"../config/daemon-state\";\nimport type { OpenMeldPathResolutionInput } from \"../config/paths\";\nimport {\n DISPATCH_OWNED_RUNTIME_MODE,\n OPENMELD_DISPATCH_RUNTIME_DISPATCH_ID_ENV,\n OPENMELD_DISPATCH_RUNTIME_MODE_ENV,\n OPENMELD_DISPATCH_RUNTIME_TARGET_PROFILE_ID_ENV,\n} from \"./dispatch-runtime-env\";\n\nexport const OPENMELD_SPACE_ACTION_CONTEXT_PATH_ENV =\n \"OPENMELD_SPACE_ACTION_CONTEXT_PATH\";\n\n/** The local action context is known expired/closed/mismatched: a new ordinary action must be rejected, never recorded. */\nexport class DispatchSpaceActionClosedError extends Error {\n readonly receipt = \"rejected_closed\" as const;\n readonly reasonCode: DispatchSpaceActionClosedReasonCode;\n constructor(\n reasonCode: DispatchSpaceActionClosedReasonCode,\n message: string\n ) {\n super(message);\n this.name = \"DispatchSpaceActionClosedError\";\n this.reasonCode = reasonCode;\n }\n}\n\nconst DISPATCH_SPACE_ACTION_CONTEXT_VERSION = 1 as const;\nconst DISPATCH_SPACE_ACTION_RECORD_VERSION = 1 as const;\nconst DEFAULT_CONTEXT_TTL_MS = 12 * 60 * 60 * 1000;\n\nexport type DispatchSpaceActionSendTargetReference =\n | {\n status: \"loaded\";\n projection: SpaceMemberDirectoryEntry[];\n referenceLines: string[];\n }\n | {\n status: \"failed\";\n errorMessage: string;\n projection: null;\n referenceLines: [];\n };\n\nexport type DispatchSpaceActionContext = {\n workingCopyId?: string;\n version: typeof DISPATCH_SPACE_ACTION_CONTEXT_VERSION;\n actionRecordPath: string;\n attemptId: string;\n contextId: string;\n dispatchId: string;\n expiresAtMs: number;\n nonce: string;\n replyToSignalId: string | null;\n sendTargetReference: DispatchSpaceActionSendTargetReference;\n sourceEventId: string;\n spaceContractSnapshot: Pick<\n SpaceContract,\n \"allowedActions\" | \"publicationMode\"\n > | null;\n spaceId: string;\n targetProfileId: string;\n taskId: string;\n};\n\nexport type DispatchSpaceActionRecord = {\n version: typeof DISPATCH_SPACE_ACTION_RECORD_VERSION;\n action: OpenMeldSpaceEgressAction;\n command: string;\n contextId: string;\n createdAtMs: number;\n nonce: string;\n};\n\nexport type DispatchSpaceActionRecordReadResult =\n | {\n status: \"missing\";\n }\n | {\n errorMessage: string;\n status: \"invalid\";\n }\n | {\n record: DispatchSpaceActionRecord;\n status: \"loaded\";\n };\n\nexport function createDispatchSpaceActionContext(input: {\n workingCopyId?: string;\n attemptId: string;\n dispatchId: string;\n env?: Record<string, string | undefined>;\n pathInput?: OpenMeldPathResolutionInput;\n replyToSignalId?: string | null;\n sendTargetReference: DispatchSpaceActionSendTargetReference;\n sourceEventId: string;\n spaceContractSnapshot:\n | Pick<SpaceContract, \"allowedActions\" | \"publicationMode\">\n | null\n | undefined;\n spaceId: string;\n targetProfileId: string;\n taskId: string;\n ttlMs?: number;\n}): {\n context: DispatchSpaceActionContext;\n contextPath: string;\n} {\n const contextId = randomUUID();\n const nonce = randomUUID();\n const contextDir = join(\n daemonRuntimeRootPath(input.pathInput ?? { env: input.env }),\n \"dispatch-space-actions\",\n `${Date.now().toString(36)}-${contextId}`\n );\n mkdirSync(contextDir, { recursive: true, mode: 0o700 });\n chmodSync(contextDir, 0o700);\n\n const contextPath = join(contextDir, \"context.json\");\n const actionRecordPath = join(contextDir, \"action.json\");\n const context: DispatchSpaceActionContext = {\n ...(input.workingCopyId ? { workingCopyId: input.workingCopyId } : {}),\n version: DISPATCH_SPACE_ACTION_CONTEXT_VERSION,\n actionRecordPath,\n attemptId: input.attemptId,\n contextId,\n dispatchId: input.dispatchId,\n expiresAtMs: Date.now() + (input.ttlMs ?? DEFAULT_CONTEXT_TTL_MS),\n nonce,\n replyToSignalId: normalizeOptionalText(input.replyToSignalId),\n sendTargetReference: input.sendTargetReference,\n sourceEventId: input.sourceEventId,\n spaceContractSnapshot: input.spaceContractSnapshot\n ? {\n allowedActions: input.spaceContractSnapshot.allowedActions,\n publicationMode: input.spaceContractSnapshot.publicationMode,\n }\n : null,\n spaceId: input.spaceId,\n targetProfileId: input.targetProfileId,\n taskId: input.taskId,\n };\n\n writeJsonFileExclusive(contextPath, context);\n return { context, contextPath };\n}\n\nexport function readDispatchSpaceActionContextFromEnv(\n env: NodeJS.ProcessEnv = process.env\n): DispatchSpaceActionContext {\n const context = readDispatchSpaceActionContextForReceiptFromEnv(env);\n assertContextActive(context, Date.now());\n return context;\n}\n\n// Expiry does not erase a prior receipt. Callers may use this context to compare\n// an exact existing action; writeDispatchSpaceActionRecord still rejects new\n// actions after expiry. File reads/uploads and target listing use the active\n// context reader instead.\nexport function readDispatchSpaceActionContextForReceiptFromEnv(\n env: NodeJS.ProcessEnv = process.env\n): DispatchSpaceActionContext {\n const contextPath = normalizeOptionalText(\n env[OPENMELD_SPACE_ACTION_CONTEXT_PATH_ENV]\n );\n if (!contextPath) {\n throw new Error(\n \"No active OpenMeld Space Action dispatch context was found. Use this command inside an OpenMeld Space Wake dispatch.\"\n );\n }\n const context = readDispatchSpaceActionContext(contextPath);\n assertDispatchRuntimeEnvMatchesContext({ context, env });\n return context;\n}\n\nexport function readDispatchSpaceActionContext(\n contextPath: string\n): DispatchSpaceActionContext {\n return parseDispatchSpaceActionContext(readJsonFile(contextPath));\n}\n\nexport function writeDispatchSpaceActionRecord(input: {\n action: OpenMeldSpaceEgressAction;\n command: string;\n context: DispatchSpaceActionContext;\n nowMs?: number;\n}): DispatchSpaceActionRecord {\n const parsedAction = openMeldSpaceEgressActionSchema.safeParse(input.action);\n if (!parsedAction.success) {\n throw parsedAction.error;\n }\n if (isSelfWakeSpaceAction(parsedAction.data, input.context.targetProfileId)) {\n throw new Error(\n \"An Agent cannot Wake itself. To reply to the current message, omit wakeTargets (CLI: --wake) and submit the reply again. No action was recorded.\"\n );\n }\n\n const existing = readDispatchSpaceActionRecord({ context: input.context });\n if (existing.status === \"invalid\") {\n throw new Error(existing.errorMessage);\n }\n if (\n existing.status === \"loaded\" &&\n isDeepStrictEqual(existing.record.action, parsedAction.data)\n ) {\n return existing.record;\n }\n assertContextActive(input.context, input.nowMs ?? Date.now());\n\n const record: DispatchSpaceActionRecord = {\n version: DISPATCH_SPACE_ACTION_RECORD_VERSION,\n action: parsedAction.data,\n command: input.command,\n contextId: input.context.contextId,\n createdAtMs: input.nowMs ?? Date.now(),\n nonce: input.context.nonce,\n };\n try {\n writeJsonFileExclusive(input.context.actionRecordPath, record);\n } catch (error) {\n if (isNodeErrorCode(error, \"EEXIST\")) {\n const existing = readDispatchSpaceActionRecord({\n context: input.context,\n });\n // A lost acknowledgement may cause the same proposal to be submitted\n // again. Acknowledge that record, never replace it or accept a new action.\n if (\n existing.status === \"loaded\" &&\n isDeepStrictEqual(existing.record.action, parsedAction.data)\n ) {\n return existing.record;\n }\n throw new Error(\n \"An OpenMeld Space Action has already been recorded for this dispatch. A Wake can only have one final Space action.\"\n );\n }\n throw error;\n }\n return record;\n}\n\nexport function readDispatchSpaceActionRecord(input: {\n context: DispatchSpaceActionContext;\n nowMs?: number;\n}): DispatchSpaceActionRecordReadResult {\n if (!existsSync(input.context.actionRecordPath)) {\n return { status: \"missing\" };\n }\n try {\n const record = parseDispatchSpaceActionRecord(\n readJsonFile(input.context.actionRecordPath)\n );\n if (\n record.contextId !== input.context.contextId ||\n record.nonce !== input.context.nonce\n ) {\n return {\n status: \"invalid\",\n errorMessage:\n \"OpenMeld Space Action record does not match the active dispatch context.\",\n };\n }\n if (record.createdAtMs > input.context.expiresAtMs) {\n return {\n status: \"invalid\",\n errorMessage:\n \"OpenMeld Space Action record was created after the active dispatch context expired.\",\n };\n }\n return { status: \"loaded\", record };\n } catch (error) {\n return {\n status: \"invalid\",\n errorMessage: error instanceof Error ? error.message : String(error),\n };\n }\n}\n\nexport function supersedeDispatchSpaceActionRecordForReconsideration(input: {\n context: DispatchSpaceActionContext;\n nowMs?: number;\n}): { archivedPath: string; record: DispatchSpaceActionRecord } | null {\n const readResult = readDispatchSpaceActionRecord(input);\n if (readResult.status === \"missing\") {\n return null;\n }\n if (readResult.status === \"invalid\") {\n throw new Error(readResult.errorMessage);\n }\n const archivedPath = `${input.context.actionRecordPath}.superseded-${String(input.nowMs ?? Date.now())}-${randomUUID()}`;\n renameSync(input.context.actionRecordPath, archivedPath);\n return { archivedPath, record: readResult.record };\n}\n\nfunction parseDispatchSpaceActionContext(\n value: unknown\n): DispatchSpaceActionContext {\n const record = toRecord(value, \"OpenMeld Space Action context\");\n const version = record.version;\n if (version !== DISPATCH_SPACE_ACTION_CONTEXT_VERSION) {\n throw new Error(\"Unsupported OpenMeld Space Action context version.\");\n }\n const sendTargetReference = parseSendTargetReference(\n record.sendTargetReference\n );\n return {\n version,\n actionRecordPath: requiredString(\n record.actionRecordPath,\n \"actionRecordPath\"\n ),\n attemptId: requiredString(record.attemptId, \"attemptId\"),\n contextId: requiredString(record.contextId, \"contextId\"),\n dispatchId: requiredString(record.dispatchId, \"dispatchId\"),\n expiresAtMs: requiredFiniteNumber(record.expiresAtMs, \"expiresAtMs\"),\n nonce: requiredString(record.nonce, \"nonce\"),\n replyToSignalId: optionalString(record.replyToSignalId),\n sendTargetReference,\n sourceEventId: requiredString(record.sourceEventId, \"sourceEventId\"),\n spaceContractSnapshot: parseSpaceContractSnapshot(\n record.spaceContractSnapshot\n ),\n spaceId: requiredString(record.spaceId, \"spaceId\"),\n targetProfileId: requiredString(record.targetProfileId, \"targetProfileId\"),\n taskId: requiredString(record.taskId, \"taskId\"),\n ...(record.workingCopyId\n ? { workingCopyId: requiredString(record.workingCopyId, \"workingCopyId\") }\n : {}),\n };\n}\n\nfunction assertDispatchRuntimeEnvMatchesContext(input: {\n context: DispatchSpaceActionContext;\n env: NodeJS.ProcessEnv;\n}): void {\n const mode = normalizeOptionalText(\n input.env[OPENMELD_DISPATCH_RUNTIME_MODE_ENV]\n );\n if (mode !== DISPATCH_OWNED_RUNTIME_MODE) {\n return;\n }\n\n const envDispatchId = normalizeOptionalText(\n input.env[OPENMELD_DISPATCH_RUNTIME_DISPATCH_ID_ENV]\n );\n if (!envDispatchId) {\n throw new Error(\n \"OpenMeld Space Action dispatch runtime is missing the active dispatch ID.\"\n );\n }\n if (envDispatchId !== input.context.dispatchId) {\n throw new DispatchSpaceActionClosedError(\n \"space_action.context_mismatch\",\n \"OpenMeld Space Action dispatch context does not match the active dispatch runtime.\"\n );\n }\n\n const envTargetProfileId = normalizeOptionalText(\n input.env[OPENMELD_DISPATCH_RUNTIME_TARGET_PROFILE_ID_ENV]\n );\n if (!envTargetProfileId) {\n throw new Error(\n \"OpenMeld Space Action dispatch runtime is missing the active target profile ID.\"\n );\n }\n if (envTargetProfileId !== input.context.targetProfileId) {\n throw new DispatchSpaceActionClosedError(\n \"space_action.context_mismatch\",\n \"OpenMeld Space Action target profile does not match the active dispatch runtime.\"\n );\n }\n}\n\nfunction parseDispatchSpaceActionRecord(\n value: unknown\n): DispatchSpaceActionRecord {\n const record = toRecord(value, \"OpenMeld Space Action record\");\n const version = record.version;\n if (version !== DISPATCH_SPACE_ACTION_RECORD_VERSION) {\n throw new Error(\"Unsupported OpenMeld Space Action record version.\");\n }\n const parsedAction = openMeldSpaceEgressActionSchema.safeParse(record.action);\n if (!parsedAction.success) {\n throw parsedAction.error;\n }\n return {\n version,\n action: parsedAction.data,\n command: requiredString(record.command, \"command\"),\n contextId: requiredString(record.contextId, \"contextId\"),\n createdAtMs: requiredFiniteNumber(record.createdAtMs, \"createdAtMs\"),\n nonce: requiredString(record.nonce, \"nonce\"),\n };\n}\n\nfunction parseSendTargetReference(\n value: unknown\n): DispatchSpaceActionSendTargetReference {\n const record = toRecord(value, \"sendTargetReference\");\n if (record.status === \"loaded\") {\n if (!Array.isArray(record.projection)) {\n throw new Error(\n \"OpenMeld Space Action send target projection must be an array.\"\n );\n }\n return {\n status: \"loaded\",\n projection: record.projection.map(parseSendTargetProjectionEntry),\n referenceLines: parseStringArray(record.referenceLines),\n };\n }\n if (record.status === \"failed\") {\n return {\n status: \"failed\",\n errorMessage: requiredString(record.errorMessage, \"errorMessage\"),\n projection: null,\n referenceLines: [],\n };\n }\n throw new Error(\n \"Invalid OpenMeld Space Action send target reference status.\"\n );\n}\n\nfunction parseSendTargetProjectionEntry(\n value: unknown,\n index: number\n): SpaceMemberDirectoryEntry {\n const parsed = spaceMemberDirectoryEntrySchema.safeParse(value);\n if (!parsed.success) {\n throw new Error(\n `OpenMeld Space Action target projection entry ${index} is not a valid Space member directory entry.`\n );\n }\n return parsed.data;\n}\n\nfunction parseSpaceContractSnapshot(\n value: unknown\n): Pick<SpaceContract, \"allowedActions\" | \"publicationMode\"> | null {\n if (value === null || value === undefined) {\n return null;\n }\n const record = toRecord(value, \"spaceContractSnapshot\");\n return {\n allowedActions: Array.isArray(record.allowedActions)\n ? (record.allowedActions as SpaceContract[\"allowedActions\"])\n : [],\n publicationMode:\n record.publicationMode === \"raw_context_sharing\"\n ? \"raw_context_sharing\"\n : \"collaboration\",\n };\n}\n\nfunction assertContextActive(\n context: DispatchSpaceActionContext,\n nowMs: number\n): void {\n if (nowMs > context.expiresAtMs) {\n throw new DispatchSpaceActionClosedError(\n \"space_action.context_expired\",\n \"The OpenMeld Space Action dispatch context has expired.\"\n );\n }\n}\n\nfunction readJsonFile(path: string): unknown {\n return JSON.parse(readFileSync(path, \"utf8\")) as unknown;\n}\n\nfunction writeJsonFileExclusive(path: string, value: unknown): void {\n writeFileSync(path, `${JSON.stringify(value, null, 2)}\\n`, {\n encoding: \"utf8\",\n flag: \"wx\",\n mode: 0o600,\n });\n chmodSync(path, 0o600);\n}\n\nfunction toRecord(value: unknown, label: string): Record<string, unknown> {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n throw new Error(`${label} must be a JSON object.`);\n }\n return value as Record<string, unknown>;\n}\n\nfunction requiredString(value: unknown, fieldName: string): string {\n const normalized = normalizeOptionalText(value);\n if (!normalized) {\n throw new Error(`${fieldName} must be a non-empty string.`);\n }\n return normalized;\n}\n\nfunction requiredFiniteNumber(value: unknown, fieldName: string): number {\n if (typeof value !== \"number\" || !Number.isFinite(value)) {\n throw new Error(`${fieldName} must be a finite number.`);\n }\n return value;\n}\n\nfunction optionalString(value: unknown): string | null {\n if (value === null || value === undefined) {\n return null;\n }\n return normalizeOptionalText(value);\n}\n\nfunction parseStringArray(value: unknown): string[] {\n if (!Array.isArray(value)) {\n return [];\n }\n return value\n .map((item) => normalizeOptionalText(item))\n .filter((item): item is string => Boolean(item));\n}\n\nfunction normalizeOptionalText(value: unknown): string | null {\n const normalized = String(value ?? \"\").trim();\n return normalized.length > 0 ? normalized : null;\n}\n\nfunction isNodeErrorCode(error: unknown, code: string): boolean {\n return (\n typeof error === \"object\" &&\n error !== null &&\n \"code\" in error &&\n (error as { code?: unknown }).code === code\n );\n}\n","import {\n chmodSync,\n existsSync,\n mkdirSync,\n readFileSync,\n writeFileSync,\n} from \"node:fs\";\nimport { delimiter, dirname, join, resolve } from \"node:path\";\nimport { daemonRuntimeRootPath } from \"../config/daemon-state\";\nimport {\n type OpenMeldPathResolutionInput,\n openMeldManagedBinaryPath,\n resolveOpenMeldEnvPreset,\n} from \"../config/paths\";\nimport {\n DISPATCH_OWNED_RUNTIME_MODE,\n OPENMELD_DISPATCH_RUNTIME_DISPATCH_ID_ENV,\n OPENMELD_DISPATCH_RUNTIME_MODE_ENV,\n OPENMELD_DISPATCH_RUNTIME_TARGET_PROFILE_ID_ENV,\n OPENMELD_SPACE_ACTION_TOOL_COMMAND_PATH_ENV,\n OPENMELD_USER_FACING_CLI_COMMAND_ENV,\n} from \"./dispatch-runtime-env\";\nimport { OPENMELD_SPACE_ACTION_CONTEXT_PATH_ENV } from \"./dispatch-space-action-context\";\nimport {\n type OpenMeldDistribution,\n resolveOpenMeldDistribution,\n} from \"./distribution\";\n\nconst DISPATCH_OWNED_RUNTIME_CLI_SHIM_DIRNAME = \"dispatch-owned-cli\";\nconst DISPATCH_SPACE_ACTION_CLI_SHIM_DIRNAME = \"bin\";\nconst OPENMELD_ENV_PRESET_ENV = \"OPENMELD_ENV_PRESET\";\nconst DISPATCH_OWNED_RUNTIME_CLI_COMMAND_NAMES = [\n \"openmeld\",\n \"openmeld-dev\",\n \"openmeld-canary\",\n] as const;\n\nexport type DispatchOwnedRuntimeGuard = {\n active: boolean;\n dispatchId: string | null;\n targetProfileId: string | null;\n};\n\nexport function buildDispatchOwnedRuntimeEnv(input: {\n dispatchId: string;\n targetProfileId: string;\n distribution?: OpenMeldDistribution;\n env?: Record<string, string | undefined>;\n cliEntryPath?: string;\n spaceActionContextPath?: string | null;\n}): Record<string, string | undefined> {\n // Provider overrides are not a replacement for the carrier's lane. Keep\n // these non-secret installation selectors without copying unrelated Service\n // credentials into the provider environment.\n const env = {\n OPENMELD_HOME: process.env.OPENMELD_HOME,\n OPENMELD_ENV_PRESET: process.env.OPENMELD_ENV_PRESET,\n ...(input.env ?? {}),\n };\n const currentPath = normalizeOptionalText(\n input.env?.PATH ?? process.env.PATH\n );\n const shimDir = ensureDispatchOwnedRuntimeCliShims({\n cliEntryPath: input.cliEntryPath,\n dispatchId: input.dispatchId,\n distribution: input.distribution,\n env,\n spaceActionContextPath: input.spaceActionContextPath,\n targetProfileId: input.targetProfileId,\n });\n const actionCommand = resolveDispatchOwnedRuntimeActionCliEntryCommand({\n env,\n });\n return {\n ...env,\n PATH: prependPathEntry({\n currentPath,\n nextEntry: shimDir,\n }),\n [OPENMELD_DISPATCH_RUNTIME_MODE_ENV]: DISPATCH_OWNED_RUNTIME_MODE,\n [OPENMELD_DISPATCH_RUNTIME_DISPATCH_ID_ENV]: input.dispatchId,\n [OPENMELD_DISPATCH_RUNTIME_TARGET_PROFILE_ID_ENV]: input.targetProfileId,\n [OPENMELD_USER_FACING_CLI_COMMAND_ENV]: actionCommand,\n [OPENMELD_SPACE_ACTION_TOOL_COMMAND_PATH_ENV]: join(shimDir, actionCommand),\n [OPENMELD_ENV_PRESET_ENV]: resolveDispatchOwnedRuntimeEnvPreset({\n env,\n }),\n ...(input.spaceActionContextPath\n ? {\n [OPENMELD_SPACE_ACTION_CONTEXT_PATH_ENV]:\n input.spaceActionContextPath,\n }\n : {}),\n };\n}\n\nexport function resolveDispatchOwnedRuntimeActionCliEntryCommand(\n input: OpenMeldPathResolutionInput = {}\n): \"openmeld\" | \"openmeld-dev\" | \"openmeld-canary\" {\n const preset = resolveOpenMeldEnvPreset(input);\n if (preset === \"dev-local\") {\n return \"openmeld-dev\";\n }\n if (preset === \"canary\") {\n return \"openmeld-canary\";\n }\n return \"openmeld\";\n}\n\nexport function resolveDispatchOwnedRuntimeCliShimDir(\n input: OpenMeldPathResolutionInput & {\n spaceActionContextPath?: string | null;\n } = {}\n): string {\n const spaceActionContextPath = normalizeOptionalText(\n input.spaceActionContextPath\n );\n if (spaceActionContextPath) {\n return join(\n dirname(spaceActionContextPath),\n DISPATCH_SPACE_ACTION_CLI_SHIM_DIRNAME\n );\n }\n return join(\n daemonRuntimeRootPath(input),\n \"bin\",\n DISPATCH_OWNED_RUNTIME_CLI_SHIM_DIRNAME\n );\n}\n\nexport function ensureDispatchOwnedRuntimeCliShims(input?: {\n cliEntryPath?: string;\n distribution?: OpenMeldDistribution;\n dispatchId?: string;\n env?: Record<string, string | undefined>;\n spaceActionContextPath?: string | null;\n targetProfileId?: string;\n}): string {\n const distribution = input?.distribution ?? resolveOpenMeldDistribution();\n const cliEntryPath =\n distribution === \"binary\"\n ? resolveDispatchOwnedRuntimeBinaryCliEntryPath({\n cliEntryPath: input?.cliEntryPath,\n env: input?.env,\n })\n : resolveDispatchOwnedRuntimeCliEntryPath(input?.cliEntryPath);\n const shimDir = resolveDispatchOwnedRuntimeCliShimDir({\n env: input?.env,\n spaceActionContextPath: input?.spaceActionContextPath,\n });\n mkdirSync(shimDir, { recursive: true });\n\n for (const commandName of DISPATCH_OWNED_RUNTIME_CLI_COMMAND_NAMES) {\n const shimPath = join(shimDir, commandName);\n const shimSource = buildDispatchOwnedRuntimeCliShimSource({\n cliEntryPath,\n commandName,\n dispatchId: input?.dispatchId,\n distribution,\n nodePath: process.execPath,\n spaceActionContextPath: input?.spaceActionContextPath,\n targetProfileId: input?.targetProfileId,\n });\n if (existsSync(shimPath)) {\n const currentSource = safeReadTextFile(shimPath);\n if (currentSource === shimSource) {\n chmodSync(shimPath, 0o755);\n continue;\n }\n }\n writeFileSync(shimPath, shimSource, {\n encoding: \"utf8\",\n mode: 0o755,\n });\n chmodSync(shimPath, 0o755);\n }\n\n return shimDir;\n}\n\nexport function readDispatchOwnedRuntimeGuard(\n env: NodeJS.ProcessEnv = process.env\n): DispatchOwnedRuntimeGuard {\n const mode = normalizeOptionalText(env[OPENMELD_DISPATCH_RUNTIME_MODE_ENV]);\n if (mode !== DISPATCH_OWNED_RUNTIME_MODE) {\n return {\n active: false,\n dispatchId: null,\n targetProfileId: null,\n };\n }\n\n return {\n active: true,\n dispatchId: normalizeOptionalText(\n env[OPENMELD_DISPATCH_RUNTIME_DISPATCH_ID_ENV]\n ),\n targetProfileId: normalizeOptionalText(\n env[OPENMELD_DISPATCH_RUNTIME_TARGET_PROFILE_ID_ENV]\n ),\n };\n}\n\nexport function assertDispatchOwnedRuntimePublicWriteAllowed(input: {\n commandLabel: string;\n env?: NodeJS.ProcessEnv;\n}): void {\n const guard = readDispatchOwnedRuntimeGuard(input.env);\n if (!guard.active) {\n return;\n }\n\n const dispatchIdSuffix = guard.dispatchId\n ? ` (dispatch ${guard.dispatchId})`\n : \"\";\n throw new Error(\n `${input.commandLabel} is blocked inside a dispatch-owned runtime${dispatchIdSuffix}. Public space writes must be returned through OpenMeld Space structured actions: post_message, post_status, or stay_silent.`\n );\n}\n\nfunction normalizeOptionalText(value: unknown): string | null {\n const normalized = String(value ?? \"\").trim();\n return normalized.length > 0 ? normalized : null;\n}\n\nfunction resolveDispatchOwnedRuntimeCliEntryPath(\n cliEntryPath?: string\n): string {\n const normalizedCliEntryPath =\n normalizeOptionalText(cliEntryPath) ??\n normalizeOptionalText(process.argv[1]) ??\n null;\n if (!normalizedCliEntryPath) {\n throw new Error(\n \"dispatch-owned runtime CLI shim requires a current CLI entry path\"\n );\n }\n return resolve(normalizedCliEntryPath);\n}\n\nfunction resolveDispatchOwnedRuntimeBinaryCliEntryPath(input: {\n cliEntryPath?: string;\n env?: Record<string, string | undefined>;\n}): string {\n // A background Service may keep running from an executable path that an\n // upgrade later replaces with a launcher. The lane-owned managed CLI is the\n // stable command authority for new Space Action subprocesses.\n const normalizedCliEntryPath =\n normalizeOptionalText(input.cliEntryPath) ??\n normalizeOptionalText(openMeldManagedBinaryPath({ env: input.env })) ??\n null;\n if (!normalizedCliEntryPath) {\n throw new Error(\n \"dispatch-owned runtime CLI shim requires a current binary CLI path\"\n );\n }\n return resolve(normalizedCliEntryPath);\n}\n\nfunction buildDispatchOwnedRuntimeCliShimSource(input: {\n cliEntryPath: string;\n commandName: (typeof DISPATCH_OWNED_RUNTIME_CLI_COMMAND_NAMES)[number];\n distribution: OpenMeldDistribution;\n dispatchId?: string;\n nodePath: string;\n spaceActionContextPath?: string | null;\n targetProfileId?: string;\n}): string {\n const embeddedEnv = {\n [OPENMELD_DISPATCH_RUNTIME_MODE_ENV]: DISPATCH_OWNED_RUNTIME_MODE,\n [OPENMELD_ENV_PRESET_ENV]: resolveEnvPresetForCommandName(\n input.commandName\n ),\n [OPENMELD_USER_FACING_CLI_COMMAND_ENV]: input.commandName,\n ...(normalizeOptionalText(input.dispatchId)\n ? {\n [OPENMELD_DISPATCH_RUNTIME_DISPATCH_ID_ENV]: normalizeOptionalText(\n input.dispatchId\n ) as string,\n }\n : {}),\n ...(normalizeOptionalText(input.targetProfileId)\n ? {\n [OPENMELD_DISPATCH_RUNTIME_TARGET_PROFILE_ID_ENV]:\n normalizeOptionalText(input.targetProfileId) as string,\n }\n : {}),\n ...(normalizeOptionalText(input.spaceActionContextPath)\n ? {\n [OPENMELD_SPACE_ACTION_CONTEXT_PATH_ENV]: normalizeOptionalText(\n input.spaceActionContextPath\n ) as string,\n }\n : {}),\n };\n if (input.distribution === \"binary\") {\n const exportRows = Object.entries(embeddedEnv).map(\n ([key, value]) => `export ${key}=${quoteShellValue(value)}`\n );\n return `#!/bin/sh\n${exportRows.join(\"\\n\")}\nexec ${quoteShellValue(input.cliEntryPath)} \"$@\"\n`;\n }\n return `#!/usr/bin/env node\nimport { spawnSync } from \"node:child_process\";\n\nconst result = spawnSync(${JSON.stringify(input.nodePath)}, [${JSON.stringify(\n input.cliEntryPath\n )}, ...process.argv.slice(2)], {\n env: { ...process.env, ...${JSON.stringify(embeddedEnv)} },\n stdio: \"inherit\",\n});\n\nif (result.error) {\n throw result.error;\n}\n\nprocess.exit(result.status ?? 1);\n`;\n}\n\nfunction resolveDispatchOwnedRuntimeEnvPreset(input: {\n env?: Record<string, string | undefined>;\n}): \"prod\" | \"dev-local\" | \"canary\" {\n return resolveEnvPresetForCommandName(\n resolveDispatchOwnedRuntimeActionCliEntryCommand({\n env: input.env,\n })\n );\n}\n\nfunction resolveEnvPresetForCommandName(\n commandName: (typeof DISPATCH_OWNED_RUNTIME_CLI_COMMAND_NAMES)[number]\n): \"prod\" | \"dev-local\" | \"canary\" {\n if (commandName === \"openmeld-dev\") {\n return \"dev-local\";\n }\n if (commandName === \"openmeld-canary\") {\n return \"canary\";\n }\n return \"prod\";\n}\n\nfunction quoteShellValue(value: string): string {\n return `'${value.replaceAll(\"'\", \"'\\\\''\")}'`;\n}\n\nfunction safeReadTextFile(path: string): string | null {\n try {\n return readFileSync(path, \"utf8\");\n } catch {\n return null;\n }\n}\n\nfunction prependPathEntry(input: {\n currentPath: string | null;\n nextEntry: string;\n}): string {\n const currentEntries = (input.currentPath ?? \"\")\n .split(delimiter)\n .map((entry) => entry.trim())\n .filter((entry) => entry.length > 0);\n const dedupedEntries = currentEntries.filter(\n (entry) => entry !== input.nextEntry\n );\n return [input.nextEntry, ...dedupedEntries].join(delimiter);\n}\n","export function parseJsonResponse(raw: string): unknown {\n if (!raw.trim()) {\n return null;\n }\n try {\n return JSON.parse(raw);\n } catch {\n return null;\n }\n}\n","import { OpenMeldApiClientHttpError } from \"@openmeld/api-client\";\nimport { OPENMELD_HEADER_REQUEST_ID } from \"@openmeld/gateway-contract\";\nimport { gatewayErrorEnvelopeSchema } from \"@openmeld/schemas\";\nimport type { GatewayErrorCode } from \"@openmeld/schemas/types\";\nimport { parseJsonResponse } from \"./api-json\";\n\nconst FALLBACK_GATEWAY_HTTP_ERROR_CODE = \"gateway.http_error\" as const;\nconst GENERIC_NETWORK_ERROR_CODES = [\n \"network.timeout\",\n \"network.request_failed\",\n] as const;\n\ntype SafeParseResult<T> = { success: true; data: T } | { success: false };\n\ntype GatewayResponseSchema<T> = {\n safeParse: (value: unknown) => SafeParseResult<T>;\n};\n\nexport type GatewayResponseErrorCode =\n | GatewayErrorCode\n | typeof FALLBACK_GATEWAY_HTTP_ERROR_CODE\n | (typeof GENERIC_NETWORK_ERROR_CODES)[number]\n | string;\n\nexport type StructuredGatewayFailure = {\n code: GatewayResponseErrorCode | null;\n message: string;\n requestId: string | null;\n status: number | null;\n upstreamCode: string | null;\n};\n\nexport class GatewayHttpError extends Error {\n readonly code: GatewayResponseErrorCode;\n readonly requestId: string | null;\n readonly status: number;\n readonly rawBody: string;\n readonly upstreamCode: string | null;\n\n constructor(input: {\n code: GatewayResponseErrorCode;\n message: string;\n requestId?: string | null;\n status: number;\n rawBody: string;\n upstreamCode?: string | null;\n }) {\n super(input.message);\n this.name = \"GatewayHttpError\";\n this.code = input.code;\n this.requestId = normalizeOptionalText(input.requestId);\n this.status = input.status;\n this.rawBody = input.rawBody;\n this.upstreamCode = normalizeOptionalText(input.upstreamCode);\n }\n}\n\nexport async function readGatewayJsonResponse<T>(input: {\n response: Response;\n schema: GatewayResponseSchema<T>;\n invalidMessage: string;\n}): Promise<T> {\n const raw = await input.response.text();\n assertGatewayResponseOk({\n response: input.response,\n raw,\n });\n\n const parsed = input.schema.safeParse(parseJsonResponse(raw));\n if (!parsed.success) {\n throw new Error(input.invalidMessage);\n }\n return parsed.data;\n}\n\nexport async function readGatewayTextResponse(input: {\n response: Response;\n}): Promise<string> {\n const raw = await input.response.text();\n assertGatewayResponseOk({\n response: input.response,\n raw,\n });\n return raw;\n}\n\nexport function assertGatewayResponseOk(input: {\n response: Response;\n raw: string;\n}): void {\n if (input.response.ok) {\n return;\n }\n throw parseGatewayErrorResponse(input);\n}\n\nexport function parseGatewayErrorResponse(input: {\n response: Pick<Response, \"headers\" | \"status\">;\n raw: string;\n}): GatewayHttpError {\n const payload = parseJsonResponse(input.raw);\n const parsed = gatewayErrorEnvelopeSchema.safeParse(payload);\n const headerRequestId = normalizeOptionalText(\n input.response.headers.get(OPENMELD_HEADER_REQUEST_ID)\n );\n\n if (parsed.success) {\n return new GatewayHttpError({\n code: parsed.data.error.code,\n message: parsed.data.error.message,\n requestId: parsed.data.error.requestId || headerRequestId,\n status: input.response.status,\n rawBody: input.raw,\n upstreamCode: parsed.data.error.upstreamCode ?? null,\n });\n }\n\n const looseEnvelope = readLooseGatewayErrorEnvelope(payload);\n if (looseEnvelope) {\n return new GatewayHttpError({\n code: looseEnvelope.code ?? FALLBACK_GATEWAY_HTTP_ERROR_CODE,\n message:\n looseEnvelope.message ??\n `Gateway request failed with HTTP ${input.response.status}.`,\n requestId: looseEnvelope.requestId ?? headerRequestId,\n status: input.response.status,\n rawBody: input.raw,\n upstreamCode: looseEnvelope.upstreamCode,\n });\n }\n\n return new GatewayHttpError({\n code: FALLBACK_GATEWAY_HTTP_ERROR_CODE,\n message:\n normalizeOptionalText(input.raw) ??\n `Gateway request failed with HTTP ${input.response.status}.`,\n requestId: headerRequestId,\n status: input.response.status,\n rawBody: input.raw,\n upstreamCode: null,\n });\n}\n\nexport function toStructuredGatewayFailure(\n error: unknown\n): StructuredGatewayFailure {\n if (error instanceof OpenMeldApiClientHttpError) {\n return {\n code: error.code,\n message: normalizeFailureMessage(error.message),\n requestId: error.requestId,\n status: error.status,\n upstreamCode: error.upstreamCode,\n };\n }\n\n if (error instanceof GatewayHttpError) {\n return {\n code: error.code,\n message: normalizeFailureMessage(error.message),\n requestId: error.requestId,\n status: error.status,\n upstreamCode: error.upstreamCode,\n };\n }\n\n const genericErrorCode = readGenericErrorCode(error);\n if (genericErrorCode) {\n return {\n code: genericErrorCode,\n message: normalizeFailureMessage(\n error instanceof Error ? error.message : String(error)\n ),\n requestId: null,\n status: null,\n upstreamCode: null,\n };\n }\n\n return {\n code: null,\n message: normalizeFailureMessage(\n error instanceof Error ? error.message : String(error)\n ),\n requestId: null,\n status: null,\n upstreamCode: null,\n };\n}\n\nfunction normalizeOptionalText(value: unknown): string | null {\n const normalized = String(value ?? \"\").trim();\n return normalized.length > 0 ? normalized : null;\n}\n\nfunction normalizeFailureMessage(value: unknown): string {\n return normalizeOptionalText(value) ?? \"Unknown error.\";\n}\n\nfunction readGenericErrorCode(value: unknown): GatewayResponseErrorCode | null {\n if (!value || typeof value !== \"object\" || !(\"code\" in value)) {\n return null;\n }\n\n const normalized = normalizeOptionalText(\n (value as { code?: unknown }).code ?? null\n );\n return normalized as GatewayResponseErrorCode | null;\n}\n\nfunction readLooseGatewayErrorEnvelope(value: unknown): {\n code: string | null;\n message: string | null;\n requestId: string | null;\n upstreamCode: string | null;\n} | null {\n if (!value || typeof value !== \"object\") {\n return null;\n }\n\n const record = value as {\n error?: {\n code?: unknown;\n message?: unknown;\n requestId?: unknown;\n upstreamCode?: unknown;\n } | null;\n };\n const error = record.error;\n if (!error || typeof error !== \"object\") {\n return null;\n }\n\n const code = normalizeOptionalText(error.code);\n const message = normalizeOptionalText(error.message);\n const requestId = normalizeOptionalText(error.requestId);\n const upstreamCode = normalizeOptionalText(error.upstreamCode);\n if (!(code || message || requestId || upstreamCode)) {\n return null;\n }\n\n return {\n code,\n message,\n requestId,\n upstreamCode,\n };\n}\n","import type { SpaceMeta } from \"@openmeld/protocol\";\nimport { spaceMetaSchema } from \"@openmeld/schemas\";\n\ntype SpaceMetaParseOperation =\n | \"createSpaceMeta\"\n | \"fetchSpaceMeta\"\n | \"updateSpaceMeta\";\n\nexport function parseSpaceMetaPayload(input: {\n data: unknown;\n endpoint: string;\n operation: SpaceMetaParseOperation;\n}): SpaceMeta {\n try {\n const validation = spaceMetaSchema.safeParse(input.data);\n if (!validation.success) {\n const reason =\n validation.error.issues[0]?.message ??\n \"space meta payload does not match schema\";\n throw new Error(reason);\n }\n return validation.data;\n } catch (error) {\n const reason = error instanceof Error ? error.message : String(error);\n throw new Error(\n `${input.operation} received invalid response payload from ${input.endpoint}: ${reason}; raw=${JSON.stringify(input.data)}`\n );\n }\n}\n\nexport function parseSpaceMetaResponse(input: {\n raw: string;\n endpoint: string;\n operation: Extract<\n SpaceMetaParseOperation,\n \"fetchSpaceMeta\" | \"updateSpaceMeta\"\n >;\n}): SpaceMeta {\n try {\n return parseSpaceMetaPayload({\n data: JSON.parse(input.raw) as unknown,\n endpoint: input.endpoint,\n operation: input.operation,\n });\n } catch (error) {\n const reason = error instanceof Error ? error.message : String(error);\n throw new Error(\n `${input.operation} received invalid response payload from ${input.endpoint}: ${reason}; raw=${input.raw}`\n );\n }\n}\n","import type { SpaceMeta } from \"@openmeld/protocol\";\nimport type { OpenMeldRequestContext } from \"@openmeld/schemas/types\";\nimport { buildOpenMeldRequestContextHeadersWithAuth } from \"../config/request-headers\";\nimport { toSpaceMetaUrl } from \"../protocol/urls\";\nimport { fetchSpaceRequestWithTimeout } from \"./fetch-with-timeout\";\nimport { readGatewayTextResponse } from \"./gateway-response\";\nimport { parseSpaceMetaResponse } from \"./space-meta-response\";\n\ntype SpaceMetaApiInput = {\n requestContext: OpenMeldRequestContext;\n baseUrl: string;\n space: string;\n password?: string;\n};\n\nexport async function fetchSpaceMeta(\n input: SpaceMetaApiInput\n): Promise<SpaceMeta> {\n const endpoint = toSpaceMetaUrl(input.baseUrl, input.space);\n const response = await fetchSpaceRequestWithTimeout({\n url: endpoint,\n operation: \"space.fetch_meta\",\n init: {\n method: \"GET\",\n headers: await buildOpenMeldRequestContextHeadersWithAuth({\n requestUrl: endpoint,\n requestContext: input.requestContext,\n spacePassword: input.password,\n }),\n },\n });\n const raw = await readGatewayTextResponse({ response });\n\n return parseSpaceMetaResponse({\n raw,\n endpoint,\n operation: \"fetchSpaceMeta\",\n });\n}\n\nexport async function updateSpaceMeta(\n input: SpaceMetaApiInput & {\n purpose?: string;\n guide?: string;\n }\n): Promise<SpaceMeta> {\n const endpoint = toSpaceMetaUrl(input.baseUrl, input.space);\n const headers = await buildOpenMeldRequestContextHeadersWithAuth({\n requestUrl: endpoint,\n requestContext: input.requestContext,\n spacePassword: input.password,\n });\n headers[\"content-type\"] = \"application/json\";\n\n const response = await fetchSpaceRequestWithTimeout({\n url: endpoint,\n operation: \"space.update_meta\",\n init: {\n method: \"PATCH\",\n headers,\n body: JSON.stringify({\n ...(input.purpose === undefined ? {} : { purpose: input.purpose }),\n ...(input.guide === undefined ? {} : { guide: input.guide }),\n }),\n },\n });\n const raw = await readGatewayTextResponse({ response });\n\n return parseSpaceMetaResponse({\n raw,\n endpoint,\n operation: \"updateSpaceMeta\",\n });\n}\n","import { createSpaceApi, type SpaceApi } from \"@openmeld/api-client\";\nimport { createCliApiClientFoundation } from \"./api-client-foundation\";\n\nexport type {\n SpaceApi,\n SpaceSignalsReadQuery,\n} from \"@openmeld/api-client\";\n\nexport function createCliSpaceApi(\n baseUrl: string,\n options: Parameters<typeof createCliApiClientFoundation>[1] = {}\n): SpaceApi {\n return createSpaceApi(createCliApiClientFoundation(baseUrl, options));\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA+BA,MAAa,yCACX;;AAGF,IAAa,iCAAb,cAAoD,MAAM;CACxD,UAAmB;CACnB;CACA,YACE,YACA,SACA;EACA,MAAM,OAAO;EACb,KAAK,OAAO;EACZ,KAAK,aAAa;CACpB;AACF;AAEA,MAAM,wCAAwC;AAC9C,MAAM,uCAAuC;AAC7C,MAAM,yBAAyB,MAAU,KAAK;AA0D9C,SAAgB,iCAAiC,OAoB/C;CACA,MAAM,YAAY,WAAW;CAC7B,MAAM,QAAQ,WAAW;CACzB,MAAM,aAAa,KACjB,sBAAsB,MAAM,aAAa,EAAE,KAAK,MAAM,IAAI,CAAC,GAC3D,0BACA,GAAG,KAAK,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,GAAG,WAChC;CACA,UAAU,YAAY;EAAE,WAAW;EAAM,MAAM;CAAM,CAAC;CACtD,UAAU,YAAY,GAAK;CAE3B,MAAM,cAAc,KAAK,YAAY,cAAc;CACnD,MAAM,mBAAmB,KAAK,YAAY,aAAa;CACvD,MAAM,UAAsC;EAC1C,GAAI,MAAM,gBAAgB,EAAE,eAAe,MAAM,cAAc,IAAI,CAAC;EACpE,SAAS;EACT;EACA,WAAW,MAAM;EACjB;EACA,YAAY,MAAM;EAClB,aAAa,KAAK,IAAI,KAAK,MAAM,SAAS;EAC1C;EACA,iBAAiBA,wBAAsB,MAAM,eAAe;EAC5D,qBAAqB,MAAM;EAC3B,eAAe,MAAM;EACrB,uBAAuB,MAAM,wBACzB;GACE,gBAAgB,MAAM,sBAAsB;GAC5C,iBAAiB,MAAM,sBA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