openmeld 0.3.231 → 0.3.232
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-0KyMk1wi.js → add-me-membership-ChntsjGm.js} +2 -2
- package/dist/{add-me-membership-0KyMk1wi.js.map → add-me-membership-ChntsjGm.js.map} +1 -1
- package/dist/{agents-Bkx6ldpV.js → agents-DruPcNSg.js} +11 -11
- package/dist/{agents-Bkx6ldpV.js.map → agents-DruPcNSg.js.map} +1 -1
- package/dist/{api-client-foundation-d4E5XWdJ.js → api-client-foundation-CDj_9Rks.js} +1 -1
- package/dist/{api-client-foundation-DgTXf3Gb.js → api-client-foundation-EZpFLGVC.js} +3 -3
- package/dist/{api-client-foundation-DgTXf3Gb.js.map → api-client-foundation-EZpFLGVC.js.map} +1 -1
- package/dist/auth-session-BOG3gV2K2.js +4 -0
- package/dist/{auth-session-pLaN5cnC.js → auth-session-DhSHCYvl.js} +4 -4
- package/dist/{auth-session-pLaN5cnC.js.map → auth-session-DhSHCYvl.js.map} +1 -1
- package/dist/auth-url-6Bb6YdNm.js +24 -0
- package/dist/auth-url-6Bb6YdNm.js.map +1 -0
- package/dist/{base-url-eck31vC8.js → base-url-0AoeTi3w.js} +3 -3
- package/dist/{base-url-eck31vC8.js.map → base-url-0AoeTi3w.js.map} +1 -1
- package/dist/{base-url-B8eWb2md.js → base-url-Bdjp-5vy.js} +1 -1
- package/dist/{channel-DppbHxHw.js → channel-tvFZSSVr.js} +24 -4
- package/dist/channel-tvFZSSVr.js.map +1 -0
- package/dist/{command-CBWv24uj.js → command-0yoZa1GT.js} +18 -18
- package/dist/{command-CBWv24uj.js.map → command-0yoZa1GT.js.map} +1 -1
- package/dist/{computer-connection-DMkamVpB.js → computer-connection-CoBDorh6.js} +2 -2
- package/dist/{computer-connection-DMkamVpB.js.map → computer-connection-CoBDorh6.js.map} +1 -1
- package/dist/{computer-connection-review-BSPMGVhN.js → computer-connection-review-Dy7p1LXZ.js} +6 -6
- package/dist/{computer-connection-review-BSPMGVhN.js.map → computer-connection-review-Dy7p1LXZ.js.map} +1 -1
- package/dist/{computer-disconnect-BQ_MDeeA.js → computer-disconnect-4Ks_DVXV.js} +9 -9
- package/dist/{computer-disconnect-BQ_MDeeA.js.map → computer-disconnect-4Ks_DVXV.js.map} +1 -1
- package/dist/{computer-setup-continuation-Cd293Yzi.js → computer-setup-continuation-ZcQb7MvI.js} +3 -3
- package/dist/{computer-setup-continuation-Cd293Yzi.js.map → computer-setup-continuation-ZcQb7MvI.js.map} +1 -1
- package/dist/{context-qbQXVLF5.js → context-BPIoofMa.js} +5 -5
- package/dist/{context-qbQXVLF5.js.map → context-BPIoofMa.js.map} +1 -1
- package/dist/{daemon-device-id-B6iDyQEs.js → daemon-device-id-DDazRZUV.js} +7 -7
- package/dist/{daemon-device-id-B6iDyQEs.js.map → daemon-device-id-DDazRZUV.js.map} +1 -1
- package/dist/{daemon-lifecycle-journal-DrwEygzu.js → daemon-lifecycle-journal-CRxQL9m6.js} +7 -7
- package/dist/{daemon-lifecycle-journal-DrwEygzu.js.map → daemon-lifecycle-journal-CRxQL9m6.js.map} +1 -1
- package/dist/{daemon-runtime-lease-C1wkT4Bi.js → daemon-runtime-lease-Bv6vhqOe.js} +2 -2
- package/dist/{daemon-runtime-lease-C1wkT4Bi.js.map → daemon-runtime-lease-Bv6vhqOe.js.map} +1 -1
- package/dist/{daemon-runtime-lease-DAQyRUc5.js → daemon-runtime-lease-ZjP0urJt.js} +1 -1
- package/dist/{daemon-service-contract-DhEfbzHt.js → daemon-service-contract-COPKbCy_.js} +4 -4
- package/dist/{daemon-service-contract-DhEfbzHt.js.map → daemon-service-contract-COPKbCy_.js.map} +1 -1
- package/dist/{daemon-service-manager-CRnFxPKA.js → daemon-service-manager-BXAp21GH.js} +6 -6
- package/dist/{daemon-service-manager-CRnFxPKA.js.map → daemon-service-manager-BXAp21GH.js.map} +1 -1
- package/dist/{daemon-service-manager-l0unaDGa.js → daemon-service-manager-C_ny0JhB.js} +1 -1
- package/dist/{daemon-service-runtime-B4nWB2Qx.js → daemon-service-runtime-BTzL0w6s.js} +14 -13
- package/dist/{daemon-service-runtime-B4nWB2Qx.js.map → daemon-service-runtime-BTzL0w6s.js.map} +1 -1
- package/dist/{daemon-service-update-coordinator-C8cW7Vn_.js → daemon-service-update-coordinator-BDs0p4bA.js} +26 -21
- package/dist/daemon-service-update-coordinator-BDs0p4bA.js.map +1 -0
- package/dist/{daemon-state-B6G5xe7f.js → daemon-state-Dte9re5V.js} +4 -4
- package/dist/{daemon-state-B6G5xe7f.js.map → daemon-state-Dte9re5V.js.map} +1 -1
- package/dist/{daemon-frame-transport-xQnNyg6E.js → dispatch-owned-runtime-CK2YJ2Oo.js} +547 -50
- package/dist/dispatch-owned-runtime-CK2YJ2Oo.js.map +1 -0
- package/dist/{dist-DFhd6JmQ.js → dist--TaSMxQz.js} +2 -2
- package/dist/{dist-DFhd6JmQ.js.map → dist--TaSMxQz.js.map} +1 -1
- package/dist/{dist-olOaAWkl.js → dist-B12upl5l.js} +1 -1
- package/dist/{dist-CAypwFRu.js → dist-Bw6OBFYo.js} +195 -185
- package/dist/dist-Bw6OBFYo.js.map +1 -0
- package/dist/{elapsed-time-COv3bjEl.js → elapsed-time-C3nfbdd9.js} +5 -5
- package/dist/{elapsed-time-COv3bjEl.js.map → elapsed-time-C3nfbdd9.js.map} +1 -1
- package/dist/{entry-DIjUKIep.js → entry-De__5RVq.js} +81 -17
- package/dist/entry-De__5RVq.js.map +1 -0
- package/dist/{installation-inventory-DllgoKT1.js → installation-inventory-Bq8iZfSa.js} +5 -5
- package/dist/{installation-inventory-DllgoKT1.js.map → installation-inventory-Bq8iZfSa.js.map} +1 -1
- package/dist/{installer-Sc79LhuA.js → installer-C7iSAOSz.js} +2 -2
- package/dist/{installer-Sc79LhuA.js.map → installer-C7iSAOSz.js.map} +1 -1
- package/dist/{lock-CMH9eoS7.js → lock-BMI00i2F.js} +2 -2
- package/dist/{lock-CMH9eoS7.js.map → lock-BMI00i2F.js.map} +1 -1
- package/dist/meta-api-BpwJWE22.js +371 -0
- package/dist/meta-api-BpwJWE22.js.map +1 -0
- package/dist/{openmeld-BUYFXSyY.js → openmeld-C0OSZJtn.js} +40 -38
- package/dist/{openmeld-BUYFXSyY.js.map → openmeld-C0OSZJtn.js.map} +1 -1
- package/dist/openmeld-dev.js +17 -9
- package/dist/openmeld-dev.js.map +1 -1
- package/dist/{openmeld-environment-target-Cw3V0WnE.js → openmeld-environment-target-BgYR6ozy.js} +8 -25
- package/dist/openmeld-environment-target-BgYR6ozy.js.map +1 -0
- package/dist/{openmeld-maintenance-worker-Br6WIhhe.js → openmeld-maintenance-worker-DY90mkWW.js} +14 -14
- package/dist/{openmeld-maintenance-worker-Br6WIhhe.js.map → openmeld-maintenance-worker-DY90mkWW.js.map} +1 -1
- package/dist/{openmeld-tools-update-join-B1l6RER6.js → openmeld-tools-update-join-DgzNuaDy.js} +4 -4
- package/dist/{openmeld-tools-update-join-B1l6RER6.js.map → openmeld-tools-update-join-DgzNuaDy.js.map} +1 -1
- package/dist/openmeld.js +5 -5
- package/dist/{paths-DSkUuEu3.js → paths-De9xdA2h.js} +11 -6
- package/dist/paths-De9xdA2h.js.map +1 -0
- package/dist/{prepare-provider-runtime-DfsSj_N_.js → prepare-provider-runtime-BGdfbFyZ.js} +20 -15
- package/dist/prepare-provider-runtime-BGdfbFyZ.js.map +1 -0
- package/dist/{prepare-session-executor-CrYpWljb.js → prepare-session-executor-CA1gq8dR.js} +25 -25
- package/dist/{prepare-session-executor-CrYpWljb.js.map → prepare-session-executor-CA1gq8dR.js.map} +1 -1
- package/dist/{process-channel-DmTb_kO4.js → process-channel-C1wRGUmk.js} +2 -2
- package/dist/{process-channel-DmTb_kO4.js.map → process-channel-C1wRGUmk.js.map} +1 -1
- package/dist/{published-production-safety-CgXxtdMK.js → published-production-safety-zANGAGDI.js} +5 -6
- package/dist/published-production-safety-zANGAGDI.js.map +1 -0
- package/dist/{runtime-ZLBVtFFY.js → runtime-DFlEdls4.js} +76 -22
- package/dist/runtime-DFlEdls4.js.map +1 -0
- package/dist/{runtime-agent-controller-reporting-submission-CbaUsNTF.js → runtime-agent-controller-reporting-submission-C_xD2A-P.js} +15 -12
- package/dist/runtime-agent-controller-reporting-submission-C_xD2A-P.js.map +1 -0
- package/dist/{runtime-reporting-health-state-DOg9iwwO.js → runtime-reporting-health-state-_bvJcV1y.js} +116 -22
- package/dist/runtime-reporting-health-state-_bvJcV1y.js.map +1 -0
- package/dist/{runtime-transport-D4x8_AmR.js → runtime-transport-DH8Ks-AU.js} +86 -6
- package/dist/runtime-transport-DH8Ks-AU.js.map +1 -0
- package/dist/{service-B9y1SQlB.js → service-KHA_Yv8q.js} +61 -28
- package/dist/service-KHA_Yv8q.js.map +1 -0
- package/dist/{service-account-authorization-Di59Cjth.js → service-account-authorization-BHWs8cRP.js} +6 -6
- package/dist/{service-account-authorization-Di59Cjth.js.map → service-account-authorization-BHWs8cRP.js.map} +1 -1
- package/dist/{service-account-control-DALO1USM.js → service-account-control-BcHjpVid.js} +13 -13
- package/dist/{service-account-control-DALO1USM.js.map → service-account-control-BcHjpVid.js.map} +1 -1
- package/dist/{service-control-capabilities-CKwU9Er5.js → service-control-capabilities-B4433dGT.js} +5 -5
- package/dist/{service-control-capabilities-CKwU9Er5.js.map → service-control-capabilities-B4433dGT.js.map} +1 -1
- package/dist/{service-control-capabilities-B9ZxDPOJ.js → service-control-capabilities-DTKD2-o0.js} +1 -1
- package/dist/{state-CdSbKM0J.js → state-iJqU2XWw.js} +3 -3
- package/dist/{state-CdSbKM0J.js.map → state-iJqU2XWw.js.map} +1 -1
- package/dist/upgrade-CuzsgsKh.js +4 -0
- package/dist/{upgrade-DLJJlkbf.js → upgrade-DlBDEvs4.js} +8 -8
- package/dist/{upgrade-DLJJlkbf.js.map → upgrade-DlBDEvs4.js.map} +1 -1
- package/dist/{windows-preview-channel-DPrYuLyY.js → windows-preview-channel-BPhfSwji.js} +2 -2
- package/dist/{windows-preview-channel-DPrYuLyY.js.map → windows-preview-channel-BPhfSwji.js.map} +1 -1
- package/dist/{windows-user-task-BR-WB7hr.js → windows-user-task-CTsMnmD4.js} +3 -3
- package/dist/{windows-user-task-BR-WB7hr.js.map → windows-user-task-CTsMnmD4.js.map} +1 -1
- package/dist/{windows-user-task-m9eMEUEq.js → windows-user-task-DnxKO3oB.js} +1 -1
- package/package.json +11 -11
- package/dist/auth-session-DExyUwLo.js +0 -4
- package/dist/channel-DppbHxHw.js.map +0 -1
- package/dist/daemon-frame-transport-xQnNyg6E.js.map +0 -1
- package/dist/daemon-service-update-coordinator-C8cW7Vn_.js.map +0 -1
- package/dist/dist-CAypwFRu.js.map +0 -1
- package/dist/entry-DIjUKIep.js.map +0 -1
- package/dist/meta-api-CEw8eOeN.js +0 -845
- package/dist/meta-api-CEw8eOeN.js.map +0 -1
- package/dist/openmeld-environment-target-Cw3V0WnE.js.map +0 -1
- package/dist/paths-DSkUuEu3.js.map +0 -1
- package/dist/prepare-provider-runtime-DfsSj_N_.js.map +0 -1
- package/dist/published-production-safety-CgXxtdMK.js.map +0 -1
- package/dist/runtime-ZLBVtFFY.js.map +0 -1
- package/dist/runtime-agent-controller-reporting-submission-CbaUsNTF.js.map +0 -1
- package/dist/runtime-reporting-health-state-DOg9iwwO.js.map +0 -1
- package/dist/runtime-transport-D4x8_AmR.js.map +0 -1
- package/dist/service-B9y1SQlB.js.map +0 -1
- package/dist/upgrade-BFWUxFpJ.js +0 -4
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { F as
|
|
4
|
-
import { $r as spaceMemberDirectoryAllowedRelationsSchema, Bi as createProjectResponseSchema, Br as getOrganizationSkillResponseSchema, Ci as updateCenterAgentRoutineResponseSchema, Di as agentActivityEventSchema, Dr as submitFeedbackIssueResponseSchema, Ei as AGENT_ACTIVITY_PRESENCE_TTL_MAX_MS, Er as submitFeedbackIssueRequestSchema, Gr as organizationSkillReleaseSummarySchema, Hi as projectSchema, Ii as localProjectControlConnectionSchema, Ji as computerFileAccessPolicyInputSchema, Kr as organizationSkillSummarySchema, Mi as centerAgentToolSpeakerSchema, Qr as spaceMemberAgentWakeAvailabilitySchema, Si as resumeCenterAgentRoutineResponseSchema, Tr as organizationDirectoryResponseSchema, Ui as updateProjectResponseSchema, Vi as listProjectsResponseSchema, Vr as listOrganizationSkillsResponseSchema, Wr as organizationSkillGitHubRepositoryPreviewSchema, Yi as computerFileAccessPolicySchema, Zi as toCompatibleSpaceAddressingRequestWireValue, _i as createCenterAgentRoutineResponseSchema, bi as listCenterAgentRoutinesResponseSchema, di as agentActivitySessionInventoryResponseSchema, hi as spaceCreatorSchema, ji as agentActivitySnapshotResponseSchema, ni as spaceMemberKindSchema, si as organizationComputersResponseSchema, sr as spaceEntryTargetSchema, ti as spaceMemberDirectorySchema, vi as deleteCenterAgentRoutineResponseSchema, wr as organizationSpaceDirectoryWithMemberCountsResponseSchema, xi as pauseCenterAgentRoutineResponseSchema, yi as listCenterAgentRoutineRunsResponseSchema, zi as archiveProjectResponseSchema } from "./dist-
|
|
5
|
-
import { Ct as resolveLocalProjectConnectionForPath, Kt as SPACE_ACTION_CONTEXT_GUIDANCE_LINES, Mn as buildTaskResultEnvelope, Tt as withAgentActivityLocalStateLock, Xt as buildDispatchReplyContextSummary, _r as renderWorkingLanguagePrompt, ar as buildWorkingLanguagePromptPlan, dt as isProjectBound, ft as listProjectBindings, gr as renderInformationProtectionPrompt, ir as buildInformationProtectionPromptPlan, jn as buildRuntimeWorkspaceFingerprint, kn as DaemonServiceRunError, nr as areAgentControllerInterfaceAccountsSame, pr as parseAgentControllerRef } from "./prepare-provider-runtime-
|
|
6
|
-
import {
|
|
3
|
+
import { F as resolveOpenMeldRootDir, P as resolveOpenMeldEnvPreset, b as normalizeOpenMeldProfileId, g as legacyAccountProfileSpacesDir, r as accountProfileSpaceCacheDir, w as openMeldManagedBinaryPath } from "./paths-De9xdA2h.js";
|
|
4
|
+
import { $r as spaceMemberDirectoryAllowedRelationsSchema, Bi as createProjectResponseSchema, Br as getOrganizationSkillResponseSchema, Ci as updateCenterAgentRoutineResponseSchema, Di as agentActivityEventSchema, Dr as submitFeedbackIssueResponseSchema, Ei as AGENT_ACTIVITY_PRESENCE_TTL_MAX_MS, Er as submitFeedbackIssueRequestSchema, Gr as organizationSkillReleaseSummarySchema, Hi as projectSchema, Ii as localProjectControlConnectionSchema, Ji as computerFileAccessPolicyInputSchema, Kr as organizationSkillSummarySchema, Mi as centerAgentToolSpeakerSchema, Qr as spaceMemberAgentWakeAvailabilitySchema, Si as resumeCenterAgentRoutineResponseSchema, Tr as organizationDirectoryResponseSchema, Ui as updateProjectResponseSchema, Vi as listProjectsResponseSchema, Vr as listOrganizationSkillsResponseSchema, Wr as organizationSkillGitHubRepositoryPreviewSchema, Yi as computerFileAccessPolicySchema, Zi as toCompatibleSpaceAddressingRequestWireValue, _i as createCenterAgentRoutineResponseSchema, bi as listCenterAgentRoutinesResponseSchema, di as agentActivitySessionInventoryResponseSchema, ei as spaceMemberDirectoryEntrySchema, hi as spaceCreatorSchema, ji as agentActivitySnapshotResponseSchema, ni as spaceMemberKindSchema, si as organizationComputersResponseSchema, sr as spaceEntryTargetSchema, ti as spaceMemberDirectorySchema, vi as deleteCenterAgentRoutineResponseSchema, wr as organizationSpaceDirectoryWithMemberCountsResponseSchema, xi as pauseCenterAgentRoutineResponseSchema, yi as listCenterAgentRoutineRunsResponseSchema, zi as archiveProjectResponseSchema } from "./dist-Bw6OBFYo.js";
|
|
5
|
+
import { Ct as resolveLocalProjectConnectionForPath, Kt as SPACE_ACTION_CONTEXT_GUIDANCE_LINES, Mn as buildTaskResultEnvelope, Tt as withAgentActivityLocalStateLock, Xt as buildDispatchReplyContextSummary, _r as renderWorkingLanguagePrompt, ar as buildWorkingLanguagePromptPlan, dt as isProjectBound, ft as listProjectBindings, gr as renderInformationProtectionPrompt, ir as buildInformationProtectionPromptPlan, jn as buildRuntimeWorkspaceFingerprint, kn as DaemonServiceRunError, nr as areAgentControllerInterfaceAccountsSame, pr as parseAgentControllerRef } from "./prepare-provider-runtime-BGdfbFyZ.js";
|
|
6
|
+
import { $ as openMeldSpaceEgressActionSchema, $n as resolveMessageEnvelopeTargetField, Dt as sanitizeSignalTextPreview, Fr as resolveSingleSpaceMentionLabels, Ir as resolveSpaceMentionLabels, Jn as collectCanonicalMentionTextFragments, L as runtimeTransportRegisterSessionResponseSchema, Nr as normalizeSpacePasswordText, Qn as normalizeMessageEnvelope, U as runtimeTransportSubmitTaskResultRequestSchema, Xn as getSpaceMessageAddressingRelationSupportForTargetKind, Z as openMeldDaemonTaskResultPayloadSchema, _ as runtimeTransportDispatchProgressRequestSchema, a as daemonStreamFrameSchema, b as runtimeTransportDispatchToolActivityRequestSchema, d as runtimeTransportDispatchInteractionRequestSchema, g as runtimeTransportDispatchPreviewRequestSchema, h as runtimeTransportDispatchPreviewEndRequestSchema, m as runtimeTransportDispatchLifecycleRequestSchema, or as executionContextAssignmentSchema, qn as MESSAGE_MENTION_TYPE_VALUES, v as runtimeTransportDispatchReasoningRequestSchema, w as runtimeTransportHeartbeatResponseSchema, wi as openMeldRequestContextSchema, y as runtimeTransportDispatchRuntimeEvidenceRequestSchema } from "./runtime-transport-DH8Ks-AU.js";
|
|
7
7
|
import { D as normalizeOptionalWorkingDirectory, O as openMeldRuntimeProfileIdSchema } from "./control-plane-rTE2rHZ5.js";
|
|
8
8
|
import { F as iso, G as string, L as literal, N as enumFactory, W as strictObject, X as url, f as localServiceComponentUpdateProjectionSchema, j as discriminatedUnion, k as boolean, s as localCliComponentUpdateProjectionSchema } from "./local-components-DleLEzSU.js";
|
|
9
9
|
import { i as serviceControlCapabilitiesSchema } from "./service-account-admission-BfdJ-kKR.js";
|
|
10
|
-
import { _ as toErrorMessage, a as asRecord, d as normalizeText, ht as resolveCurrentOpenMeldAccountContext, l as normalizeNonNegativeInteger$1, s as emitRunLine, u as normalizeOptionalText$8 } from "./daemon-device-id-
|
|
11
|
-
import { v as resolveCliContextId } from "./lock-
|
|
12
|
-
import { a as buildAgentFacingMentalModelLines, c as buildCompactDispatchActionGuidanceLines, d as buildSpaceWakeParticipantLines, g as renderSpaceEntryBrief, l as buildSpaceAgentIdentityLine, m as deriveContinuity, n as SPACE_COLLABORATION_CONTEXT_RULE, p as composeDispatchBrief, s as buildCenterAgentRoleTemplateText, u as buildSpaceEntryBriefNeedMoreLine, v as resolveSpacePublicationRequirement } from "./dist
|
|
13
|
-
import { d as createDefaultRuntimeAgentControllerSettings } from "./base-url-
|
|
14
|
-
import {
|
|
10
|
+
import { _ as toErrorMessage, a as asRecord, d as normalizeText, ht as resolveCurrentOpenMeldAccountContext, l as normalizeNonNegativeInteger$1, s as emitRunLine, u as normalizeOptionalText$8 } from "./daemon-device-id-DDazRZUV.js";
|
|
11
|
+
import { v as resolveCliContextId } from "./lock-BMI00i2F.js";
|
|
12
|
+
import { a as buildAgentFacingMentalModelLines, c as buildCompactDispatchActionGuidanceLines, d as buildSpaceWakeParticipantLines, g as renderSpaceEntryBrief, h as isSelfWakeSpaceAction, l as buildSpaceAgentIdentityLine, m as deriveContinuity, n as SPACE_COLLABORATION_CONTEXT_RULE, p as composeDispatchBrief, s as buildCenterAgentRoleTemplateText, u as buildSpaceEntryBriefNeedMoreLine, v as resolveSpacePublicationRequirement } from "./dist--TaSMxQz.js";
|
|
13
|
+
import { d as createDefaultRuntimeAgentControllerSettings } from "./base-url-0AoeTi3w.js";
|
|
14
|
+
import { n as resolveOpenMeldDistribution } from "./distribution-BDQT2ilb.js";
|
|
15
|
+
import { a as DAEMON_SERVICE_RUNTIME_MODE_ENV, d as daemonDispatchJournalPath, h as daemonRuntimeRootPath, i as DAEMON_SERVICE_RUNTIME_DETACHED_ENV, n as DAEMON_SERVICE_RUNTIME_AUTO_START_ENV, r as DAEMON_SERVICE_RUNTIME_CONTROLLER_ENV, s as DAEMON_SERVICE_RUNTIME_SYSTEM_SERVICE_ENV } from "./daemon-state-Dte9re5V.js";
|
|
15
16
|
import { a as formatOpenMeldCliTextBlock } from "./cli-entry-command-CR_9QU1i.js";
|
|
16
17
|
import { createHash, randomUUID } from "node:crypto";
|
|
17
18
|
import { homedir } from "node:os";
|
|
18
|
-
import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
19
|
+
import { basename, delimiter, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
19
20
|
import { access, chmod, link, mkdir, open, readFile, readdir, realpath, rename, rm, stat, unlink, writeFile } from "node:fs/promises";
|
|
20
21
|
import * as z$1 from "zod/v4";
|
|
21
22
|
import { z } from "zod/v4";
|
|
22
|
-
import { appendFileSync, constants, existsSync, mkdirSync, readFileSync, renameSync, watch, writeFileSync } from "node:fs";
|
|
23
|
+
import { appendFileSync, chmodSync, constants, existsSync, mkdirSync, readFileSync, renameSync, watch, writeFileSync } from "node:fs";
|
|
23
24
|
import process$1 from "node:process";
|
|
25
|
+
import { isDeepStrictEqual } from "node:util";
|
|
24
26
|
import { Worker } from "node:worker_threads";
|
|
25
27
|
//#region ../../packages/schemas/dist/schemas/cli/daemon-status-server-requirement.js
|
|
26
28
|
const cliVersionVerdictKindSchema = z$1.enum([
|
|
@@ -2079,7 +2081,7 @@ function addDispatchOnlyWakeTarget(input) {
|
|
|
2079
2081
|
const target = {
|
|
2080
2082
|
profileId: input.targetDispatch.targetProfileId,
|
|
2081
2083
|
profileKind: null,
|
|
2082
|
-
displayName: normalizeOptionalText$2(input.targetDispatch.targetDisplayName) ?? input.targetDispatch.targetProfileId,
|
|
2084
|
+
displayName: normalizeOptionalText$2$1(input.targetDispatch.targetDisplayName) ?? input.targetDispatch.targetProfileId,
|
|
2083
2085
|
relation: "wake",
|
|
2084
2086
|
dispatchState: null,
|
|
2085
2087
|
dispatchId: null,
|
|
@@ -2140,7 +2142,7 @@ function buildSignalPublicationFact(signal) {
|
|
|
2140
2142
|
return {
|
|
2141
2143
|
...publication,
|
|
2142
2144
|
finalPreview: readSignalFinalPreview(signal),
|
|
2143
|
-
publishedSignalId: normalizeOptionalText$2(signal.id),
|
|
2145
|
+
publishedSignalId: normalizeOptionalText$2$1(signal.id),
|
|
2144
2146
|
publishedSignalType: resolveSignalPublishedSignalType$1(signal),
|
|
2145
2147
|
rank: rankPublicOutcome(publication.publicOutcome),
|
|
2146
2148
|
resultRef: readSignalResultRef(signal)
|
|
@@ -2158,15 +2160,15 @@ function buildSpaceRoundSignalPublication(signal) {
|
|
|
2158
2160
|
}
|
|
2159
2161
|
function buildDispatchResultPublicationFact(result) {
|
|
2160
2162
|
return {
|
|
2161
|
-
actorProfileId: normalizeOptionalText$2(result.actorProfileId),
|
|
2162
|
-
dispatchId: normalizeOptionalText$2(result.dispatchId),
|
|
2163
|
+
actorProfileId: normalizeOptionalText$2$1(result.actorProfileId),
|
|
2164
|
+
dispatchId: normalizeOptionalText$2$1(result.dispatchId),
|
|
2163
2165
|
finalPreview: sanitizeSignalTextPreview(result.previewText ?? result.finalText ?? result.statusType),
|
|
2164
2166
|
publicOutcome: result.publicOutcome,
|
|
2165
|
-
publishedSignalId: normalizeOptionalText$2(result.publishedSignalId),
|
|
2167
|
+
publishedSignalId: normalizeOptionalText$2$1(result.publishedSignalId),
|
|
2166
2168
|
publishedSignalType: resolveDispatchResultPublishedSignalType$1(result),
|
|
2167
2169
|
rank: rankPublicOutcome(result.publicOutcome) + 10,
|
|
2168
|
-
replyToSignalId: normalizeOptionalText$2(result.replyToSignalId),
|
|
2169
|
-
resultRef: normalizeOptionalText$2(result.resultRef)
|
|
2170
|
+
replyToSignalId: normalizeOptionalText$2$1(result.replyToSignalId),
|
|
2171
|
+
resultRef: normalizeOptionalText$2$1(result.resultRef)
|
|
2170
2172
|
};
|
|
2171
2173
|
}
|
|
2172
2174
|
function resolveSignalPublicOutcome$1(signal) {
|
|
@@ -2197,9 +2199,9 @@ function resolveDispatchResultPublishedSignalType$1(result) {
|
|
|
2197
2199
|
}
|
|
2198
2200
|
function readSignalActorProfileId(signal) {
|
|
2199
2201
|
switch (signal.type) {
|
|
2200
|
-
case "signal.text": return normalizeOptionalText$2(signal.profile?.profileId);
|
|
2201
|
-
case "signal.status": return normalizeOptionalText$2(signal.data.actorProfileId);
|
|
2202
|
-
case "signal.system_notice": return normalizeOptionalText$2(signal.data.actorProfileId) ?? normalizeOptionalText$2(signal.profile?.profileId);
|
|
2202
|
+
case "signal.text": return normalizeOptionalText$2$1(signal.profile?.profileId);
|
|
2203
|
+
case "signal.status": return normalizeOptionalText$2$1(signal.data.actorProfileId);
|
|
2204
|
+
case "signal.system_notice": return normalizeOptionalText$2$1(signal.data.actorProfileId) ?? normalizeOptionalText$2$1(signal.profile?.profileId);
|
|
2203
2205
|
default: return null;
|
|
2204
2206
|
}
|
|
2205
2207
|
}
|
|
@@ -2207,14 +2209,14 @@ function readSignalDispatchId$1(signal) {
|
|
|
2207
2209
|
switch (signal.type) {
|
|
2208
2210
|
case "signal.text": return readSignalTextMetaDispatchId(signal);
|
|
2209
2211
|
case "signal.status":
|
|
2210
|
-
case "signal.system_notice": return normalizeOptionalText$2(signal.data.dispatchId);
|
|
2212
|
+
case "signal.system_notice": return normalizeOptionalText$2$1(signal.data.dispatchId);
|
|
2211
2213
|
default: return null;
|
|
2212
2214
|
}
|
|
2213
2215
|
}
|
|
2214
2216
|
function readSignalTextMetaDispatchId(signal) {
|
|
2215
2217
|
const meta = signal.data.meta;
|
|
2216
2218
|
if (!meta || typeof meta !== "object" || Array.isArray(meta)) return null;
|
|
2217
|
-
return normalizeOptionalText$2(meta.dispatchId);
|
|
2219
|
+
return normalizeOptionalText$2$1(meta.dispatchId);
|
|
2218
2220
|
}
|
|
2219
2221
|
function readSignalFinalPreview(signal) {
|
|
2220
2222
|
switch (signal.type) {
|
|
@@ -2226,16 +2228,16 @@ function readSignalFinalPreview(signal) {
|
|
|
2226
2228
|
}
|
|
2227
2229
|
function readSignalReplyToSignalId(signal) {
|
|
2228
2230
|
switch (signal.type) {
|
|
2229
|
-
case "signal.text": return normalizeOptionalText$2(signal.data.messageEnvelope?.replyToSignalId ?? signal.data.replyTo?.signalId);
|
|
2231
|
+
case "signal.text": return normalizeOptionalText$2$1(signal.data.messageEnvelope?.replyToSignalId ?? signal.data.replyTo?.signalId);
|
|
2230
2232
|
case "signal.status":
|
|
2231
|
-
case "signal.system_notice": return normalizeOptionalText$2(signal.data.replyTo?.signalId);
|
|
2233
|
+
case "signal.system_notice": return normalizeOptionalText$2$1(signal.data.replyTo?.signalId);
|
|
2232
2234
|
default: return null;
|
|
2233
2235
|
}
|
|
2234
2236
|
}
|
|
2235
2237
|
function readSignalResultRef(signal) {
|
|
2236
2238
|
switch (signal.type) {
|
|
2237
2239
|
case "signal.status":
|
|
2238
|
-
case "signal.system_notice": return normalizeOptionalText$2(signal.data.resultRef);
|
|
2240
|
+
case "signal.system_notice": return normalizeOptionalText$2$1(signal.data.resultRef);
|
|
2239
2241
|
default: return null;
|
|
2240
2242
|
}
|
|
2241
2243
|
}
|
|
@@ -2255,7 +2257,7 @@ function normalizeRequiredText(value) {
|
|
|
2255
2257
|
if (normalized.length === 0) throw new Error("sourceSignalId is required");
|
|
2256
2258
|
return normalized;
|
|
2257
2259
|
}
|
|
2258
|
-
function normalizeOptionalText$2(value) {
|
|
2260
|
+
function normalizeOptionalText$2$1(value) {
|
|
2259
2261
|
const normalized = String(value ?? "").trim();
|
|
2260
2262
|
return normalized.length > 0 ? normalized : null;
|
|
2261
2263
|
}
|
|
@@ -2266,12 +2268,12 @@ function buildDispatchResultReplyWorkflowProjection(input) {
|
|
|
2266
2268
|
signalIndex: input.signalIndex ?? null
|
|
2267
2269
|
});
|
|
2268
2270
|
return {
|
|
2269
|
-
sourceSignalId: normalizeOptionalText$1(input.dispatchExecution?.sourceSignalId) ?? normalizeOptionalText$1(messageReadProjection.replyToSignalId),
|
|
2271
|
+
sourceSignalId: normalizeOptionalText$1$1(input.dispatchExecution?.sourceSignalId) ?? normalizeOptionalText$1$1(messageReadProjection.replyToSignalId),
|
|
2270
2272
|
replyToSignalId: messageReadProjection.replyToSignalId,
|
|
2271
2273
|
publicOutcome: input.result.publicOutcome,
|
|
2272
|
-
publishedSignalId: normalizeOptionalText$1(input.result.publishedSignalId),
|
|
2274
|
+
publishedSignalId: normalizeOptionalText$1$1(input.result.publishedSignalId),
|
|
2273
2275
|
publishedSignalType: resolveDispatchResultPublishedSignalType(input.result),
|
|
2274
|
-
hasPublicSignal: normalizeOptionalText$1(input.result.publishedSignalId) !== null,
|
|
2276
|
+
hasPublicSignal: normalizeOptionalText$1$1(input.result.publishedSignalId) !== null,
|
|
2275
2277
|
hasPublicAgentReplyText: dispatchResultHasPublicAgentReplyText(input.result),
|
|
2276
2278
|
dispatchExecution: input.dispatchExecution ?? null,
|
|
2277
2279
|
replyToContext: messageReadProjection.replyToContext
|
|
@@ -2311,7 +2313,7 @@ function buildSignalReplyWorkflowProjection(input) {
|
|
|
2311
2313
|
sourceSignalId: replyToSignalId,
|
|
2312
2314
|
replyToSignalId,
|
|
2313
2315
|
publicOutcome,
|
|
2314
|
-
publishedSignalId: normalizeOptionalText$1(input.signal.id),
|
|
2316
|
+
publishedSignalId: normalizeOptionalText$1$1(input.signal.id),
|
|
2315
2317
|
publishedSignalType,
|
|
2316
2318
|
hasPublicSignal: true,
|
|
2317
2319
|
hasPublicAgentReplyText: input.signal.type === "signal.text",
|
|
@@ -2335,20 +2337,20 @@ function selectBestPublishedReplyWorkflowCandidate(input) {
|
|
|
2335
2337
|
if (!candidate) continue;
|
|
2336
2338
|
const dispatchId = readSignalDispatchId(signal);
|
|
2337
2339
|
const matchesDispatch = dispatchId !== null && dispatchIds.has(dispatchId);
|
|
2338
|
-
const matchesAnchor = !hasDispatchEvidence && candidate.replyToSignalId === normalizeOptionalText$1(input.afterSignalId);
|
|
2340
|
+
const matchesAnchor = !hasDispatchEvidence && candidate.replyToSignalId === normalizeOptionalText$1$1(input.afterSignalId);
|
|
2339
2341
|
if (!(matchesDispatch || matchesAnchor)) continue;
|
|
2340
2342
|
const candidateRank = rankReplyWorkflowCandidate(candidate);
|
|
2341
2343
|
if (candidateRank < bestRank) continue;
|
|
2342
2344
|
bestCandidate = {
|
|
2343
2345
|
...candidate,
|
|
2344
|
-
sourceSignalId: normalizeOptionalText$1(input.afterSignalId) ?? candidate.sourceSignalId
|
|
2346
|
+
sourceSignalId: normalizeOptionalText$1$1(input.afterSignalId) ?? candidate.sourceSignalId
|
|
2345
2347
|
};
|
|
2346
2348
|
bestRank = candidateRank;
|
|
2347
2349
|
}
|
|
2348
2350
|
return bestCandidate;
|
|
2349
2351
|
}
|
|
2350
2352
|
function buildPendingReplyWorkflowProjection(input) {
|
|
2351
|
-
const sourceSignalId = normalizeOptionalText$1(input.afterSignalId);
|
|
2353
|
+
const sourceSignalId = normalizeOptionalText$1$1(input.afterSignalId);
|
|
2352
2354
|
const replyToContext = sourceSignalId === null ? null : resolveReplyToContext({
|
|
2353
2355
|
replyToSignalId: sourceSignalId,
|
|
2354
2356
|
signalIndex: input.signalIndex,
|
|
@@ -2408,9 +2410,9 @@ function rankReplyWorkflowCandidate(projection) {
|
|
|
2408
2410
|
}
|
|
2409
2411
|
function readSignalDispatchId(signal) {
|
|
2410
2412
|
switch (signal.type) {
|
|
2411
|
-
case "signal.text": return normalizeOptionalText$1(readSignalTextMeta(signal)?.dispatchId);
|
|
2413
|
+
case "signal.text": return normalizeOptionalText$1$1(readSignalTextMeta(signal)?.dispatchId);
|
|
2412
2414
|
case "signal.status":
|
|
2413
|
-
case "signal.system_notice": return normalizeOptionalText$1(signal.data.dispatchId);
|
|
2415
|
+
case "signal.system_notice": return normalizeOptionalText$1$1(signal.data.dispatchId);
|
|
2414
2416
|
default: return null;
|
|
2415
2417
|
}
|
|
2416
2418
|
}
|
|
@@ -2421,9 +2423,9 @@ function readSignalTextMeta(signal) {
|
|
|
2421
2423
|
return meta;
|
|
2422
2424
|
}
|
|
2423
2425
|
function readSystemNoticeType(signal) {
|
|
2424
|
-
return normalizeOptionalText$1(signal.data.noticeType);
|
|
2426
|
+
return normalizeOptionalText$1$1(signal.data.noticeType);
|
|
2425
2427
|
}
|
|
2426
|
-
function normalizeOptionalText$1(value) {
|
|
2428
|
+
function normalizeOptionalText$1$1(value) {
|
|
2427
2429
|
const normalized = String(value ?? "").trim();
|
|
2428
2430
|
return normalized.length > 0 ? normalized : null;
|
|
2429
2431
|
}
|
|
@@ -2748,7 +2750,7 @@ async function readSpaceCacheFile(input) {
|
|
|
2748
2750
|
try {
|
|
2749
2751
|
raw = await readFile(input.path, "utf8");
|
|
2750
2752
|
} catch (error) {
|
|
2751
|
-
if (isNodeErrorCode(error, "ENOENT")) return {
|
|
2753
|
+
if (isNodeErrorCode$1(error, "ENOENT")) return {
|
|
2752
2754
|
kind: "missing",
|
|
2753
2755
|
fileKind: input.fileKind,
|
|
2754
2756
|
path: input.path
|
|
@@ -2788,7 +2790,7 @@ async function readDirectoryEntries(path) {
|
|
|
2788
2790
|
entries: await readdir(path, { withFileTypes: true })
|
|
2789
2791
|
};
|
|
2790
2792
|
} catch (error) {
|
|
2791
|
-
if (isNodeErrorCode(error, "ENOENT")) return { kind: "missing" };
|
|
2793
|
+
if (isNodeErrorCode$1(error, "ENOENT")) return { kind: "missing" };
|
|
2792
2794
|
return {
|
|
2793
2795
|
kind: "read_error",
|
|
2794
2796
|
detail: error instanceof Error ? error.message : null
|
|
@@ -3255,7 +3257,7 @@ function resolveSpaceCacheFileKind(path) {
|
|
|
3255
3257
|
if (filename.endsWith(".json")) return "space_config";
|
|
3256
3258
|
return null;
|
|
3257
3259
|
}
|
|
3258
|
-
function isNodeErrorCode(error, code) {
|
|
3260
|
+
function isNodeErrorCode$1(error, code) {
|
|
3259
3261
|
return !!error && typeof error === "object" && "code" in error && error.code === code;
|
|
3260
3262
|
}
|
|
3261
3263
|
function compareIsoDateDesc(left, right) {
|
|
@@ -3737,10 +3739,14 @@ function buildWhatYouCanDoNowLine(input) {
|
|
|
3737
3739
|
}
|
|
3738
3740
|
function buildActionGuidanceLines(input) {
|
|
3739
3741
|
const publicationRequirement = resolveSpacePublicationRequirement(input.spaceContractSnapshot);
|
|
3740
|
-
return [
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3742
|
+
return [
|
|
3743
|
+
...buildCompactDispatchActionGuidanceLines({
|
|
3744
|
+
allowedActions: publicationRequirement.allowedActions,
|
|
3745
|
+
allowsRawReplyWithoutAction: publicationRequirement.allowsRawReplyWithoutAction
|
|
3746
|
+
}).slice(1).map((line) => `- ${line}`),
|
|
3747
|
+
"- In shared Spaces, reply in the triggering message's thread by default. Choose placement=conversation only when the user requests the main conversation or your conclusion, decision, or blocker matters to the whole Space. Direct messages remain direct.",
|
|
3748
|
+
...SPACE_ACTION_CONTEXT_GUIDANCE_LINES
|
|
3749
|
+
];
|
|
3744
3750
|
}
|
|
3745
3751
|
function buildSpaceActionCommand(action) {
|
|
3746
3752
|
return `${DISPATCH_SPACE_ACTION_CLI_FALLBACK_COMMAND} space action ${action}`;
|
|
@@ -4351,6 +4357,18 @@ function sendDispatchReasoningFrame(input) {
|
|
|
4351
4357
|
payload: parsed.data
|
|
4352
4358
|
});
|
|
4353
4359
|
}
|
|
4360
|
+
function sendDispatchProgressFrame(input) {
|
|
4361
|
+
const { socket, ...payload } = input;
|
|
4362
|
+
const parsed = runtimeTransportDispatchProgressRequestSchema.safeParse({
|
|
4363
|
+
...payload,
|
|
4364
|
+
v: 1
|
|
4365
|
+
});
|
|
4366
|
+
if (!parsed.success) return;
|
|
4367
|
+
sendDaemonFrame$1(socket, {
|
|
4368
|
+
code: "daemon.dispatch.progress",
|
|
4369
|
+
payload: parsed.data
|
|
4370
|
+
});
|
|
4371
|
+
}
|
|
4354
4372
|
function sendDispatchToolActivityFrame(input) {
|
|
4355
4373
|
const request = runtimeTransportDispatchToolActivityRequestSchema.safeParse({
|
|
4356
4374
|
v: 1,
|
|
@@ -5882,12 +5900,12 @@ async function readOpenCodeSessionRows(databasePath, nativeSessionId) {
|
|
|
5882
5900
|
}
|
|
5883
5901
|
}
|
|
5884
5902
|
function resolveOpenCodeDatabasePath(input) {
|
|
5885
|
-
return join(normalizeOptionalText(input.xdgDataHome ?? process.env.XDG_DATA_HOME) ?? join(input.homeDir, ".local", "share"), "opencode", "opencode.db");
|
|
5903
|
+
return join(normalizeOptionalText$2(input.xdgDataHome ?? process.env.XDG_DATA_HOME) ?? join(input.homeDir, ".local", "share"), "opencode", "opencode.db");
|
|
5886
5904
|
}
|
|
5887
5905
|
function resolveOpenCodeAuthPath(input) {
|
|
5888
|
-
return join(normalizeOptionalText(input.xdgDataHome ?? process.env.XDG_DATA_HOME) ?? join(input.homeDir, ".local", "share"), "opencode", "auth.json");
|
|
5906
|
+
return join(normalizeOptionalText$2(input.xdgDataHome ?? process.env.XDG_DATA_HOME) ?? join(input.homeDir, ".local", "share"), "opencode", "auth.json");
|
|
5889
5907
|
}
|
|
5890
|
-
function normalizeOptionalText(value) {
|
|
5908
|
+
function normalizeOptionalText$2(value) {
|
|
5891
5909
|
const normalized = value?.trim();
|
|
5892
5910
|
return normalized ? normalized : null;
|
|
5893
5911
|
}
|
|
@@ -6666,6 +6684,485 @@ function sendDaemonFrame(sink, input) {
|
|
|
6666
6684
|
}));
|
|
6667
6685
|
}
|
|
6668
6686
|
//#endregion
|
|
6669
|
-
|
|
6687
|
+
//#region src/runtime/dispatch-space-action-context.ts
|
|
6688
|
+
const OPENMELD_SPACE_ACTION_CONTEXT_PATH_ENV = "OPENMELD_SPACE_ACTION_CONTEXT_PATH";
|
|
6689
|
+
/** The local action context is known expired/closed/mismatched: a new ordinary action must be rejected, never recorded. */
|
|
6690
|
+
var DispatchSpaceActionClosedError = class extends Error {
|
|
6691
|
+
receipt = "rejected_closed";
|
|
6692
|
+
reasonCode;
|
|
6693
|
+
constructor(reasonCode, message) {
|
|
6694
|
+
super(message);
|
|
6695
|
+
this.name = "DispatchSpaceActionClosedError";
|
|
6696
|
+
this.reasonCode = reasonCode;
|
|
6697
|
+
}
|
|
6698
|
+
};
|
|
6699
|
+
/** Use only at a boundary that has positively rejected this call before recording. */
|
|
6700
|
+
var DispatchSpaceActionRejectedError = class extends Error {
|
|
6701
|
+
reasonCode;
|
|
6702
|
+
constructor(reasonCode, message) {
|
|
6703
|
+
super(message);
|
|
6704
|
+
this.name = "DispatchSpaceActionRejectedError";
|
|
6705
|
+
this.reasonCode = reasonCode;
|
|
6706
|
+
}
|
|
6707
|
+
};
|
|
6708
|
+
const DISPATCH_SPACE_ACTION_CONTEXT_VERSION = 1;
|
|
6709
|
+
const DISPATCH_SPACE_ACTION_RECORD_VERSION = 1;
|
|
6710
|
+
const DEFAULT_CONTEXT_TTL_MS = 720 * 60 * 1e3;
|
|
6711
|
+
function createDispatchSpaceActionContext(input) {
|
|
6712
|
+
const contextId = randomUUID();
|
|
6713
|
+
const nonce = randomUUID();
|
|
6714
|
+
const contextDir = join(daemonRuntimeRootPath(input.pathInput ?? { env: input.env }), "dispatch-space-actions", `${Date.now().toString(36)}-${contextId}`);
|
|
6715
|
+
mkdirSync(contextDir, {
|
|
6716
|
+
recursive: true,
|
|
6717
|
+
mode: 448
|
|
6718
|
+
});
|
|
6719
|
+
chmodSync(contextDir, 448);
|
|
6720
|
+
const contextPath = join(contextDir, "context.json");
|
|
6721
|
+
const actionRecordPath = join(contextDir, "action.json");
|
|
6722
|
+
const context = {
|
|
6723
|
+
...input.projectShell ? { projectShell: input.projectShell } : {},
|
|
6724
|
+
...input.workingCopyId ? { workingCopyId: input.workingCopyId } : {},
|
|
6725
|
+
version: DISPATCH_SPACE_ACTION_CONTEXT_VERSION,
|
|
6726
|
+
actionRecordPath,
|
|
6727
|
+
attemptId: input.attemptId,
|
|
6728
|
+
contextId,
|
|
6729
|
+
dispatchId: input.dispatchId,
|
|
6730
|
+
expiresAtMs: Date.now() + (input.ttlMs ?? DEFAULT_CONTEXT_TTL_MS),
|
|
6731
|
+
nonce,
|
|
6732
|
+
replyToSignalId: normalizeOptionalText$1(input.replyToSignalId),
|
|
6733
|
+
sendTargetReference: input.sendTargetReference,
|
|
6734
|
+
sourceEventId: input.sourceEventId,
|
|
6735
|
+
spaceContractSnapshot: input.spaceContractSnapshot ? {
|
|
6736
|
+
allowedActions: input.spaceContractSnapshot.allowedActions,
|
|
6737
|
+
publicationMode: input.spaceContractSnapshot.publicationMode
|
|
6738
|
+
} : null,
|
|
6739
|
+
spaceId: input.spaceId,
|
|
6740
|
+
targetProfileId: input.targetProfileId,
|
|
6741
|
+
taskId: input.taskId
|
|
6742
|
+
};
|
|
6743
|
+
writeJsonFileExclusive(contextPath, context);
|
|
6744
|
+
return {
|
|
6745
|
+
context,
|
|
6746
|
+
contextPath
|
|
6747
|
+
};
|
|
6748
|
+
}
|
|
6749
|
+
function readDispatchSpaceActionContextFromEnv(env = process.env) {
|
|
6750
|
+
const context = readDispatchSpaceActionContextForReceiptFromEnv(env);
|
|
6751
|
+
assertContextActive(context, Date.now());
|
|
6752
|
+
return context;
|
|
6753
|
+
}
|
|
6754
|
+
function readDispatchSpaceActionContextForReceiptFromEnv(env = process.env) {
|
|
6755
|
+
const contextPath = normalizeOptionalText$1(env[OPENMELD_SPACE_ACTION_CONTEXT_PATH_ENV]);
|
|
6756
|
+
if (!contextPath) throw new Error("No active OpenMeld Space Action dispatch context was found. Use this command inside an OpenMeld Space Wake dispatch.");
|
|
6757
|
+
const context = readDispatchSpaceActionContext(contextPath);
|
|
6758
|
+
assertDispatchRuntimeEnvMatchesContext({
|
|
6759
|
+
context,
|
|
6760
|
+
env
|
|
6761
|
+
});
|
|
6762
|
+
return context;
|
|
6763
|
+
}
|
|
6764
|
+
function readDispatchSpaceActionContext(contextPath) {
|
|
6765
|
+
return parseDispatchSpaceActionContext(readJsonFile(contextPath));
|
|
6766
|
+
}
|
|
6767
|
+
function writeDispatchSpaceActionRecord(input) {
|
|
6768
|
+
const parsedAction = openMeldSpaceEgressActionSchema.safeParse(input.action);
|
|
6769
|
+
if (!parsedAction.success) throw new DispatchSpaceActionRejectedError("space_action.invalid_input", parsedAction.error.message);
|
|
6770
|
+
if (isSelfWakeSpaceAction(parsedAction.data, input.context.targetProfileId)) throw new DispatchSpaceActionRejectedError("space_action.invalid_input", "An Agent cannot Wake itself. To reply to the current message, omit wakeTargets (CLI: --wake) and submit the reply again. No action was recorded.");
|
|
6771
|
+
const existing = readDispatchSpaceActionRecord({ context: input.context });
|
|
6772
|
+
if (existing.status === "invalid") throw new Error(existing.errorMessage);
|
|
6773
|
+
if (existing.status === "loaded" && isDeepStrictEqual(existing.record.action, parsedAction.data)) return existing.record;
|
|
6774
|
+
assertContextActive(input.context, input.nowMs ?? Date.now());
|
|
6775
|
+
const record = {
|
|
6776
|
+
version: DISPATCH_SPACE_ACTION_RECORD_VERSION,
|
|
6777
|
+
action: parsedAction.data,
|
|
6778
|
+
command: input.command,
|
|
6779
|
+
contextId: input.context.contextId,
|
|
6780
|
+
createdAtMs: input.nowMs ?? Date.now(),
|
|
6781
|
+
nonce: input.context.nonce
|
|
6782
|
+
};
|
|
6783
|
+
try {
|
|
6784
|
+
writeJsonFileExclusive(input.context.actionRecordPath, record);
|
|
6785
|
+
} catch (error) {
|
|
6786
|
+
if (isNodeErrorCode(error, "EEXIST")) {
|
|
6787
|
+
const existing = readDispatchSpaceActionRecord({ context: input.context });
|
|
6788
|
+
if (existing.status === "loaded" && isDeepStrictEqual(existing.record.action, parsedAction.data)) return existing.record;
|
|
6789
|
+
throw new DispatchSpaceActionRejectedError("space_action.already_recorded", "An OpenMeld Space Action has already been recorded for this dispatch. A Wake can only have one final Space action. Recover its receipt with the exact original arguments; do not replace it with a different action.");
|
|
6790
|
+
}
|
|
6791
|
+
throw error;
|
|
6792
|
+
}
|
|
6793
|
+
return record;
|
|
6794
|
+
}
|
|
6795
|
+
function readDispatchSpaceActionRecord(input) {
|
|
6796
|
+
if (!existsSync(input.context.actionRecordPath)) return { status: "missing" };
|
|
6797
|
+
try {
|
|
6798
|
+
const record = parseDispatchSpaceActionRecord(readJsonFile(input.context.actionRecordPath));
|
|
6799
|
+
if (record.contextId !== input.context.contextId || record.nonce !== input.context.nonce) return {
|
|
6800
|
+
status: "invalid",
|
|
6801
|
+
errorMessage: "OpenMeld Space Action record does not match the active dispatch context."
|
|
6802
|
+
};
|
|
6803
|
+
if (record.createdAtMs > input.context.expiresAtMs) return {
|
|
6804
|
+
status: "invalid",
|
|
6805
|
+
errorMessage: "OpenMeld Space Action record was created after the active dispatch context expired."
|
|
6806
|
+
};
|
|
6807
|
+
return {
|
|
6808
|
+
status: "loaded",
|
|
6809
|
+
record
|
|
6810
|
+
};
|
|
6811
|
+
} catch (error) {
|
|
6812
|
+
return {
|
|
6813
|
+
status: "invalid",
|
|
6814
|
+
errorMessage: error instanceof Error ? error.message : String(error)
|
|
6815
|
+
};
|
|
6816
|
+
}
|
|
6817
|
+
}
|
|
6818
|
+
function supersedeDispatchSpaceActionRecordForReconsideration(input) {
|
|
6819
|
+
const readResult = readDispatchSpaceActionRecord(input);
|
|
6820
|
+
if (readResult.status === "missing") return null;
|
|
6821
|
+
if (readResult.status === "invalid") throw new Error(readResult.errorMessage);
|
|
6822
|
+
const archivedPath = `${input.context.actionRecordPath}.superseded-${String(input.nowMs ?? Date.now())}-${randomUUID()}`;
|
|
6823
|
+
renameSync(input.context.actionRecordPath, archivedPath);
|
|
6824
|
+
return {
|
|
6825
|
+
archivedPath,
|
|
6826
|
+
record: readResult.record
|
|
6827
|
+
};
|
|
6828
|
+
}
|
|
6829
|
+
function parseDispatchSpaceActionContext(value) {
|
|
6830
|
+
const record = toRecord(value, "OpenMeld Space Action context");
|
|
6831
|
+
const version = record.version;
|
|
6832
|
+
if (version !== DISPATCH_SPACE_ACTION_CONTEXT_VERSION) throw new Error("Unsupported OpenMeld Space Action context version.");
|
|
6833
|
+
const sendTargetReference = parseSendTargetReference(record.sendTargetReference);
|
|
6834
|
+
return {
|
|
6835
|
+
...record.projectShell ? { projectShell: parseProjectShell(record.projectShell) } : {},
|
|
6836
|
+
version,
|
|
6837
|
+
actionRecordPath: requiredString(record.actionRecordPath, "actionRecordPath"),
|
|
6838
|
+
attemptId: requiredString(record.attemptId, "attemptId"),
|
|
6839
|
+
contextId: requiredString(record.contextId, "contextId"),
|
|
6840
|
+
dispatchId: requiredString(record.dispatchId, "dispatchId"),
|
|
6841
|
+
expiresAtMs: requiredFiniteNumber(record.expiresAtMs, "expiresAtMs"),
|
|
6842
|
+
nonce: requiredString(record.nonce, "nonce"),
|
|
6843
|
+
replyToSignalId: optionalString(record.replyToSignalId),
|
|
6844
|
+
sendTargetReference,
|
|
6845
|
+
sourceEventId: requiredString(record.sourceEventId, "sourceEventId"),
|
|
6846
|
+
spaceContractSnapshot: parseSpaceContractSnapshot(record.spaceContractSnapshot),
|
|
6847
|
+
spaceId: requiredString(record.spaceId, "spaceId"),
|
|
6848
|
+
targetProfileId: requiredString(record.targetProfileId, "targetProfileId"),
|
|
6849
|
+
taskId: requiredString(record.taskId, "taskId"),
|
|
6850
|
+
...record.workingCopyId ? { workingCopyId: requiredString(record.workingCopyId, "workingCopyId") } : {}
|
|
6851
|
+
};
|
|
6852
|
+
}
|
|
6853
|
+
function parseProjectShell(value) {
|
|
6854
|
+
const record = toRecord(value, "OpenMeld project shell context");
|
|
6855
|
+
const runtime = toRecord(record.runtime, "OpenMeld project shell runtime");
|
|
6856
|
+
const kind = runtime.kind;
|
|
6857
|
+
if (kind !== "docker" && kind !== "podman") throw new Error("OpenMeld project shell runtime is invalid.");
|
|
6858
|
+
const executionContextId = requiredString(record.executionContextId, "executionContextId");
|
|
6859
|
+
const workspacePath = requiredString(record.workspacePath, "workspacePath");
|
|
6860
|
+
const boundaryRoot = requiredString(record.boundaryRoot, "boundaryRoot");
|
|
6861
|
+
const ledgerRootPath = requiredString(record.ledgerRootPath, "ledgerRootPath");
|
|
6862
|
+
const binary = requiredString(runtime.binary, "binary");
|
|
6863
|
+
const validContextId = executionContextAssignmentSchema.shape.id.safeParse(executionContextId).success;
|
|
6864
|
+
const validPaths = [
|
|
6865
|
+
workspacePath,
|
|
6866
|
+
boundaryRoot,
|
|
6867
|
+
ledgerRootPath,
|
|
6868
|
+
binary
|
|
6869
|
+
].every(isAbsolute);
|
|
6870
|
+
if (!(validContextId && validPaths)) throw new Error("OpenMeld project shell context is invalid.");
|
|
6871
|
+
return {
|
|
6872
|
+
boundaryRoot,
|
|
6873
|
+
executionContextId,
|
|
6874
|
+
ledgerRootPath,
|
|
6875
|
+
workspacePath,
|
|
6876
|
+
runtime: {
|
|
6877
|
+
binary,
|
|
6878
|
+
engineIdentity: requiredString(runtime.engineIdentity, "engineIdentity"),
|
|
6879
|
+
kind
|
|
6880
|
+
}
|
|
6881
|
+
};
|
|
6882
|
+
}
|
|
6883
|
+
function assertDispatchRuntimeEnvMatchesContext(input) {
|
|
6884
|
+
if (normalizeOptionalText$1(input.env["OPENMELD_DISPATCH_RUNTIME_MODE"]) !== "dispatch-owned-runtime") return;
|
|
6885
|
+
const envDispatchId = normalizeOptionalText$1(input.env[OPENMELD_DISPATCH_RUNTIME_DISPATCH_ID_ENV]);
|
|
6886
|
+
if (!envDispatchId) throw new Error("OpenMeld Space Action dispatch runtime is missing the active dispatch ID.");
|
|
6887
|
+
if (envDispatchId !== input.context.dispatchId) throw new DispatchSpaceActionClosedError("space_action.context_mismatch", "OpenMeld Space Action dispatch context does not match the active dispatch runtime.");
|
|
6888
|
+
const envTargetProfileId = normalizeOptionalText$1(input.env[OPENMELD_DISPATCH_RUNTIME_TARGET_PROFILE_ID_ENV]);
|
|
6889
|
+
if (!envTargetProfileId) throw new Error("OpenMeld Space Action dispatch runtime is missing the active target profile ID.");
|
|
6890
|
+
if (envTargetProfileId !== input.context.targetProfileId) throw new DispatchSpaceActionClosedError("space_action.context_mismatch", "OpenMeld Space Action target profile does not match the active dispatch runtime.");
|
|
6891
|
+
}
|
|
6892
|
+
function parseDispatchSpaceActionRecord(value) {
|
|
6893
|
+
const record = toRecord(value, "OpenMeld Space Action record");
|
|
6894
|
+
const version = record.version;
|
|
6895
|
+
if (version !== DISPATCH_SPACE_ACTION_RECORD_VERSION) throw new Error("Unsupported OpenMeld Space Action record version.");
|
|
6896
|
+
const parsedAction = openMeldSpaceEgressActionSchema.safeParse(record.action);
|
|
6897
|
+
if (!parsedAction.success) throw parsedAction.error;
|
|
6898
|
+
return {
|
|
6899
|
+
version,
|
|
6900
|
+
action: parsedAction.data,
|
|
6901
|
+
command: requiredString(record.command, "command"),
|
|
6902
|
+
contextId: requiredString(record.contextId, "contextId"),
|
|
6903
|
+
createdAtMs: requiredFiniteNumber(record.createdAtMs, "createdAtMs"),
|
|
6904
|
+
nonce: requiredString(record.nonce, "nonce")
|
|
6905
|
+
};
|
|
6906
|
+
}
|
|
6907
|
+
function parseSendTargetReference(value) {
|
|
6908
|
+
const record = toRecord(value, "sendTargetReference");
|
|
6909
|
+
if (record.status === "loaded") {
|
|
6910
|
+
if (!Array.isArray(record.projection)) throw new Error("OpenMeld Space Action send target projection must be an array.");
|
|
6911
|
+
return {
|
|
6912
|
+
status: "loaded",
|
|
6913
|
+
projection: record.projection.map(parseSendTargetProjectionEntry),
|
|
6914
|
+
referenceLines: parseStringArray(record.referenceLines)
|
|
6915
|
+
};
|
|
6916
|
+
}
|
|
6917
|
+
if (record.status === "failed") return {
|
|
6918
|
+
status: "failed",
|
|
6919
|
+
errorMessage: requiredString(record.errorMessage, "errorMessage"),
|
|
6920
|
+
projection: null,
|
|
6921
|
+
referenceLines: []
|
|
6922
|
+
};
|
|
6923
|
+
throw new Error("Invalid OpenMeld Space Action send target reference status.");
|
|
6924
|
+
}
|
|
6925
|
+
function parseSendTargetProjectionEntry(value, index) {
|
|
6926
|
+
const parsed = spaceMemberDirectoryEntrySchema.safeParse(value);
|
|
6927
|
+
if (!parsed.success) throw new Error(`OpenMeld Space Action target projection entry ${index} is not a valid Space member directory entry.`);
|
|
6928
|
+
return parsed.data;
|
|
6929
|
+
}
|
|
6930
|
+
function parseSpaceContractSnapshot(value) {
|
|
6931
|
+
if (value === null || value === void 0) return null;
|
|
6932
|
+
const record = toRecord(value, "spaceContractSnapshot");
|
|
6933
|
+
return {
|
|
6934
|
+
allowedActions: Array.isArray(record.allowedActions) ? record.allowedActions : [],
|
|
6935
|
+
publicationMode: record.publicationMode === "raw_context_sharing" ? "raw_context_sharing" : "collaboration"
|
|
6936
|
+
};
|
|
6937
|
+
}
|
|
6938
|
+
function assertContextActive(context, nowMs) {
|
|
6939
|
+
if (nowMs > context.expiresAtMs) throw new DispatchSpaceActionClosedError("space_action.context_expired", "The OpenMeld Space Action dispatch context has expired.");
|
|
6940
|
+
}
|
|
6941
|
+
function readJsonFile(path) {
|
|
6942
|
+
return JSON.parse(readFileSync(path, "utf8"));
|
|
6943
|
+
}
|
|
6944
|
+
function writeJsonFileExclusive(path, value) {
|
|
6945
|
+
writeFileSync(path, `${JSON.stringify(value, null, 2)}\n`, {
|
|
6946
|
+
encoding: "utf8",
|
|
6947
|
+
flag: "wx",
|
|
6948
|
+
mode: 384
|
|
6949
|
+
});
|
|
6950
|
+
chmodSync(path, 384);
|
|
6951
|
+
}
|
|
6952
|
+
function toRecord(value, label) {
|
|
6953
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error(`${label} must be a JSON object.`);
|
|
6954
|
+
return value;
|
|
6955
|
+
}
|
|
6956
|
+
function requiredString(value, fieldName) {
|
|
6957
|
+
const normalized = normalizeOptionalText$1(value);
|
|
6958
|
+
if (!normalized) throw new Error(`${fieldName} must be a non-empty string.`);
|
|
6959
|
+
return normalized;
|
|
6960
|
+
}
|
|
6961
|
+
function requiredFiniteNumber(value, fieldName) {
|
|
6962
|
+
if (typeof value !== "number" || !Number.isFinite(value)) throw new Error(`${fieldName} must be a finite number.`);
|
|
6963
|
+
return value;
|
|
6964
|
+
}
|
|
6965
|
+
function optionalString(value) {
|
|
6966
|
+
if (value === null || value === void 0) return null;
|
|
6967
|
+
return normalizeOptionalText$1(value);
|
|
6968
|
+
}
|
|
6969
|
+
function parseStringArray(value) {
|
|
6970
|
+
if (!Array.isArray(value)) return [];
|
|
6971
|
+
return value.map((item) => normalizeOptionalText$1(item)).filter((item) => Boolean(item));
|
|
6972
|
+
}
|
|
6973
|
+
function normalizeOptionalText$1(value) {
|
|
6974
|
+
const normalized = String(value ?? "").trim();
|
|
6975
|
+
return normalized.length > 0 ? normalized : null;
|
|
6976
|
+
}
|
|
6977
|
+
function isNodeErrorCode(error, code) {
|
|
6978
|
+
return typeof error === "object" && error !== null && "code" in error && error.code === code;
|
|
6979
|
+
}
|
|
6980
|
+
//#endregion
|
|
6981
|
+
//#region src/runtime/dispatch-owned-runtime.ts
|
|
6982
|
+
const DISPATCH_OWNED_RUNTIME_CLI_SHIM_DIRNAME = "dispatch-owned-cli";
|
|
6983
|
+
const DISPATCH_SPACE_ACTION_CLI_SHIM_DIRNAME = "bin";
|
|
6984
|
+
const OPENMELD_ENV_PRESET_ENV = "OPENMELD_ENV_PRESET";
|
|
6985
|
+
const DISPATCH_OWNED_RUNTIME_CLI_COMMAND_NAMES = [
|
|
6986
|
+
"openmeld",
|
|
6987
|
+
"openmeld-dev",
|
|
6988
|
+
"openmeld-canary"
|
|
6989
|
+
];
|
|
6990
|
+
function buildDispatchOwnedRuntimeEnv(input) {
|
|
6991
|
+
const env = {
|
|
6992
|
+
OPENMELD_HOME: process.env.OPENMELD_HOME,
|
|
6993
|
+
OPENMELD_ENV_PRESET: process.env.OPENMELD_ENV_PRESET,
|
|
6994
|
+
...input.env ?? {}
|
|
6995
|
+
};
|
|
6996
|
+
const currentPath = normalizeOptionalText(input.env?.PATH ?? process.env.PATH);
|
|
6997
|
+
const actionCommand = resolveDispatchOwnedRuntimeActionCliEntryCommand({ env });
|
|
6998
|
+
const actionCommandPath = (input.platform ?? process.platform) === "win32" && (input.distribution ?? resolveOpenMeldDistribution()) === "binary" ? resolveDispatchOwnedRuntimeBinaryCliEntryPath({
|
|
6999
|
+
cliEntryPath: input.cliEntryPath,
|
|
7000
|
+
env
|
|
7001
|
+
}) : join(ensureDispatchOwnedRuntimeCliShims({
|
|
7002
|
+
cliEntryPath: input.cliEntryPath,
|
|
7003
|
+
dispatchId: input.dispatchId,
|
|
7004
|
+
distribution: input.distribution,
|
|
7005
|
+
env,
|
|
7006
|
+
spaceActionContextPath: input.spaceActionContextPath,
|
|
7007
|
+
targetProfileId: input.targetProfileId
|
|
7008
|
+
}), actionCommand);
|
|
7009
|
+
return {
|
|
7010
|
+
...env,
|
|
7011
|
+
[DAEMON_SERVICE_RUNTIME_MODE_ENV]: void 0,
|
|
7012
|
+
[DAEMON_SERVICE_RUNTIME_DETACHED_ENV]: void 0,
|
|
7013
|
+
[DAEMON_SERVICE_RUNTIME_CONTROLLER_ENV]: void 0,
|
|
7014
|
+
[DAEMON_SERVICE_RUNTIME_AUTO_START_ENV]: void 0,
|
|
7015
|
+
[DAEMON_SERVICE_RUNTIME_SYSTEM_SERVICE_ENV]: void 0,
|
|
7016
|
+
PATH: prependPathEntry({
|
|
7017
|
+
currentPath,
|
|
7018
|
+
nextEntry: dirname(actionCommandPath)
|
|
7019
|
+
}),
|
|
7020
|
+
[OPENMELD_DISPATCH_RUNTIME_MODE_ENV]: DISPATCH_OWNED_RUNTIME_MODE,
|
|
7021
|
+
[OPENMELD_DISPATCH_RUNTIME_DISPATCH_ID_ENV]: input.dispatchId,
|
|
7022
|
+
[OPENMELD_DISPATCH_RUNTIME_TARGET_PROFILE_ID_ENV]: input.targetProfileId,
|
|
7023
|
+
[OPENMELD_USER_FACING_CLI_COMMAND_ENV]: actionCommand,
|
|
7024
|
+
[OPENMELD_SPACE_ACTION_TOOL_COMMAND_PATH_ENV]: actionCommandPath,
|
|
7025
|
+
[OPENMELD_ENV_PRESET_ENV]: resolveDispatchOwnedRuntimeEnvPreset({ env }),
|
|
7026
|
+
...input.spaceActionContextPath ? { [OPENMELD_SPACE_ACTION_CONTEXT_PATH_ENV]: input.spaceActionContextPath } : {}
|
|
7027
|
+
};
|
|
7028
|
+
}
|
|
7029
|
+
function resolveDispatchOwnedRuntimeActionCliEntryCommand(input = {}) {
|
|
7030
|
+
const preset = resolveOpenMeldEnvPreset(input);
|
|
7031
|
+
if (preset === "dev-local") return "openmeld-dev";
|
|
7032
|
+
if (preset === "canary") return "openmeld-canary";
|
|
7033
|
+
return "openmeld";
|
|
7034
|
+
}
|
|
7035
|
+
function resolveDispatchOwnedRuntimeCliShimDir(input = {}) {
|
|
7036
|
+
const spaceActionContextPath = normalizeOptionalText(input.spaceActionContextPath);
|
|
7037
|
+
if (spaceActionContextPath) return join(dirname(spaceActionContextPath), DISPATCH_SPACE_ACTION_CLI_SHIM_DIRNAME);
|
|
7038
|
+
return join(daemonRuntimeRootPath(input), "bin", DISPATCH_OWNED_RUNTIME_CLI_SHIM_DIRNAME);
|
|
7039
|
+
}
|
|
7040
|
+
function ensureDispatchOwnedRuntimeCliShims(input) {
|
|
7041
|
+
const distribution = input?.distribution ?? resolveOpenMeldDistribution();
|
|
7042
|
+
const cliEntryPath = distribution === "binary" ? resolveDispatchOwnedRuntimeBinaryCliEntryPath({
|
|
7043
|
+
cliEntryPath: input?.cliEntryPath,
|
|
7044
|
+
env: input?.env
|
|
7045
|
+
}) : resolveDispatchOwnedRuntimeCliEntryPath(input?.cliEntryPath);
|
|
7046
|
+
const shimDir = resolveDispatchOwnedRuntimeCliShimDir({
|
|
7047
|
+
env: input?.env,
|
|
7048
|
+
spaceActionContextPath: input?.spaceActionContextPath
|
|
7049
|
+
});
|
|
7050
|
+
mkdirSync(shimDir, { recursive: true });
|
|
7051
|
+
for (const commandName of DISPATCH_OWNED_RUNTIME_CLI_COMMAND_NAMES) {
|
|
7052
|
+
const shimPath = join(shimDir, commandName);
|
|
7053
|
+
const shimSource = buildDispatchOwnedRuntimeCliShimSource({
|
|
7054
|
+
cliEntryPath,
|
|
7055
|
+
commandName,
|
|
7056
|
+
dispatchId: input?.dispatchId,
|
|
7057
|
+
distribution,
|
|
7058
|
+
nodePath: process.execPath,
|
|
7059
|
+
spaceActionContextPath: input?.spaceActionContextPath,
|
|
7060
|
+
targetProfileId: input?.targetProfileId
|
|
7061
|
+
});
|
|
7062
|
+
if (existsSync(shimPath)) {
|
|
7063
|
+
if (safeReadTextFile(shimPath) === shimSource) {
|
|
7064
|
+
chmodSync(shimPath, 493);
|
|
7065
|
+
continue;
|
|
7066
|
+
}
|
|
7067
|
+
}
|
|
7068
|
+
writeFileSync(shimPath, shimSource, {
|
|
7069
|
+
encoding: "utf8",
|
|
7070
|
+
mode: 493
|
|
7071
|
+
});
|
|
7072
|
+
chmodSync(shimPath, 493);
|
|
7073
|
+
}
|
|
7074
|
+
return shimDir;
|
|
7075
|
+
}
|
|
7076
|
+
function readDispatchOwnedRuntimeGuard(env = process.env) {
|
|
7077
|
+
if (normalizeOptionalText(env["OPENMELD_DISPATCH_RUNTIME_MODE"]) !== "dispatch-owned-runtime") return {
|
|
7078
|
+
active: false,
|
|
7079
|
+
dispatchId: null,
|
|
7080
|
+
targetProfileId: null
|
|
7081
|
+
};
|
|
7082
|
+
return {
|
|
7083
|
+
active: true,
|
|
7084
|
+
dispatchId: normalizeOptionalText(env[OPENMELD_DISPATCH_RUNTIME_DISPATCH_ID_ENV]),
|
|
7085
|
+
targetProfileId: normalizeOptionalText(env[OPENMELD_DISPATCH_RUNTIME_TARGET_PROFILE_ID_ENV])
|
|
7086
|
+
};
|
|
7087
|
+
}
|
|
7088
|
+
function assertDispatchOwnedRuntimePublicWriteAllowed(input) {
|
|
7089
|
+
const guard = readDispatchOwnedRuntimeGuard(input.env);
|
|
7090
|
+
if (!guard.active) return;
|
|
7091
|
+
const dispatchIdSuffix = guard.dispatchId ? ` (dispatch ${guard.dispatchId})` : "";
|
|
7092
|
+
throw new Error(`${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.`);
|
|
7093
|
+
}
|
|
7094
|
+
function assertDispatchOwnedRuntimeServiceMutationAllowed(input) {
|
|
7095
|
+
const env = input.env ?? process.env;
|
|
7096
|
+
const guard = readDispatchOwnedRuntimeGuard(env);
|
|
7097
|
+
if (!guard.active || resolveOpenMeldEnvPreset({ env }) !== "prod") return;
|
|
7098
|
+
const dispatchIdSuffix = guard.dispatchId ? ` (dispatch ${guard.dispatchId})` : "";
|
|
7099
|
+
throw new Error(`${input.commandLabel} is blocked inside a dispatch-owned runtime${dispatchIdSuffix} because it could stop or replace the production OpenMeld Service carrying this Agent. Use a confirmed dev lane for isolated service testing.`);
|
|
7100
|
+
}
|
|
7101
|
+
function normalizeOptionalText(value) {
|
|
7102
|
+
const normalized = String(value ?? "").trim();
|
|
7103
|
+
return normalized.length > 0 ? normalized : null;
|
|
7104
|
+
}
|
|
7105
|
+
function resolveDispatchOwnedRuntimeCliEntryPath(cliEntryPath) {
|
|
7106
|
+
const normalizedCliEntryPath = normalizeOptionalText(cliEntryPath) ?? normalizeOptionalText(process.argv[1]) ?? null;
|
|
7107
|
+
if (!normalizedCliEntryPath) throw new Error("dispatch-owned runtime CLI shim requires a current CLI entry path");
|
|
7108
|
+
return resolve(normalizedCliEntryPath);
|
|
7109
|
+
}
|
|
7110
|
+
function resolveDispatchOwnedRuntimeBinaryCliEntryPath(input) {
|
|
7111
|
+
const normalizedCliEntryPath = normalizeOptionalText(input.cliEntryPath) ?? normalizeOptionalText(openMeldManagedBinaryPath({ env: input.env })) ?? null;
|
|
7112
|
+
if (!normalizedCliEntryPath) throw new Error("dispatch-owned runtime CLI shim requires a current binary CLI path");
|
|
7113
|
+
return resolve(normalizedCliEntryPath);
|
|
7114
|
+
}
|
|
7115
|
+
function buildDispatchOwnedRuntimeCliShimSource(input) {
|
|
7116
|
+
const embeddedEnv = {
|
|
7117
|
+
[OPENMELD_DISPATCH_RUNTIME_MODE_ENV]: DISPATCH_OWNED_RUNTIME_MODE,
|
|
7118
|
+
[OPENMELD_ENV_PRESET_ENV]: resolveEnvPresetForCommandName(input.commandName),
|
|
7119
|
+
[OPENMELD_USER_FACING_CLI_COMMAND_ENV]: input.commandName,
|
|
7120
|
+
...normalizeOptionalText(input.dispatchId) ? { [OPENMELD_DISPATCH_RUNTIME_DISPATCH_ID_ENV]: normalizeOptionalText(input.dispatchId) } : {},
|
|
7121
|
+
...normalizeOptionalText(input.targetProfileId) ? { [OPENMELD_DISPATCH_RUNTIME_TARGET_PROFILE_ID_ENV]: normalizeOptionalText(input.targetProfileId) } : {},
|
|
7122
|
+
...normalizeOptionalText(input.spaceActionContextPath) ? { [OPENMELD_SPACE_ACTION_CONTEXT_PATH_ENV]: normalizeOptionalText(input.spaceActionContextPath) } : {}
|
|
7123
|
+
};
|
|
7124
|
+
if (input.distribution === "binary") return `#!/bin/sh
|
|
7125
|
+
${Object.entries(embeddedEnv).map(([key, value]) => `export ${key}=${quoteShellValue(value)}`).join("\n")}
|
|
7126
|
+
exec ${quoteShellValue(input.cliEntryPath)} "$@"
|
|
7127
|
+
`;
|
|
7128
|
+
return `#!/usr/bin/env node
|
|
7129
|
+
import { spawnSync } from "node:child_process";
|
|
7130
|
+
|
|
7131
|
+
const result = spawnSync(${JSON.stringify(input.nodePath)}, [${JSON.stringify(input.cliEntryPath)}, ...process.argv.slice(2)], {
|
|
7132
|
+
env: { ...process.env, ...${JSON.stringify(embeddedEnv)} },
|
|
7133
|
+
stdio: "inherit",
|
|
7134
|
+
});
|
|
7135
|
+
|
|
7136
|
+
if (result.error) {
|
|
7137
|
+
throw result.error;
|
|
7138
|
+
}
|
|
7139
|
+
|
|
7140
|
+
process.exit(result.status ?? 1);
|
|
7141
|
+
`;
|
|
7142
|
+
}
|
|
7143
|
+
function resolveDispatchOwnedRuntimeEnvPreset(input) {
|
|
7144
|
+
return resolveEnvPresetForCommandName(resolveDispatchOwnedRuntimeActionCliEntryCommand({ env: input.env }));
|
|
7145
|
+
}
|
|
7146
|
+
function resolveEnvPresetForCommandName(commandName) {
|
|
7147
|
+
if (commandName === "openmeld-dev") return "dev-local";
|
|
7148
|
+
if (commandName === "openmeld-canary") return "canary";
|
|
7149
|
+
return "prod";
|
|
7150
|
+
}
|
|
7151
|
+
function quoteShellValue(value) {
|
|
7152
|
+
return `'${value.replaceAll("'", "'\\''")}'`;
|
|
7153
|
+
}
|
|
7154
|
+
function safeReadTextFile(path) {
|
|
7155
|
+
try {
|
|
7156
|
+
return readFileSync(path, "utf8");
|
|
7157
|
+
} catch {
|
|
7158
|
+
return null;
|
|
7159
|
+
}
|
|
7160
|
+
}
|
|
7161
|
+
function prependPathEntry(input) {
|
|
7162
|
+
const dedupedEntries = (input.currentPath ?? "").split(delimiter).map((entry) => entry.trim()).filter((entry) => entry.length > 0).filter((entry) => entry !== input.nextEntry);
|
|
7163
|
+
return [input.nextEntry, ...dedupedEntries].join(delimiter);
|
|
7164
|
+
}
|
|
7165
|
+
//#endregion
|
|
7166
|
+
export { enqueueDispatchResultOutboxRecord as $, buildSpaceMessageReadRelationSummary as $t, drainAgentActivityHookInbox as A, cliJsonErrorEnvelopeSchema as An, inspectSpaceCacheFile as At, buildAgentControllerInterfaceKeeperKey as B, getOrganizationJoinLinkResponseSchema as Bn, updateSpaceLastSeenTs as Bt, readOpenCodeSessionRows as C, resolveNextRecentMentionProfileIdsForQueuedText as Cn, buildDispatchSessionTitle as Ct, resolveObservedAgentActivityBinding as D, DISPATCH_OWNED_RUNTIME_MODE as Dn, resolveDispatchMentionSourceContext as Dt, buildAgentActivityEvent as E, updateAuthoredMentionRanges as En, resolveBootstrapTargetProfileContext as Et, deferAgentActivityOutbox as F, cliJsonSkillsListEnvelopeSchema as Fn, readSpaceLastSeenTs as Ft, readLastSuccessfulAgentControllerInterfaceCheckAt as G, buildDispatchResultMessageReadProjection as Gt, didAgentControllerCommandFingerprintRemainStable as H, organizationJoinLinkManagementQuerySchema as Hn, writeSpaceCacheDeletionNoticeState as Ht, readAgentActivityOutboxHealth as I, cliJsonSkillsLoadEnvelopeSchema as In, readSpaceRecentMentionProfileIds as It, recordAgentControllerInterfaceProbeSuccess as J, buildSignalIndex as Jt, readReusableAgentControllerInterfaceSnapshot as K, buildDispatchResultReplyWorkflowProjection as Kt, readDueAgentActivityOutbox as L, cliJsonSkillsScanEnvelopeSchema as Ln, removeSpaceConfig as Lt, removeProjectInbox as M, cliJsonSkillsAddAllEnvelopeSchema as Mn, listSpaceConfigs as Mt, AgentActivitySubmissionResultsMismatchError as N, cliJsonSkillsAddEnvelopeSchema as Nn, readSpaceCacheDeletionNoticeState as Nt, normalizeSharedSessionTitle as O, DISPATCH_SPACE_ACTION_CLI_FALLBACK_COMMAND as On, projectSpaceProfileCache as Ot, applyAgentActivitySubmissionResults as P, cliJsonSkillsAddPreviewEnvelopeSchema as Pn, readSpaceConfig as Pt, acknowledgeDispatchResultOutboxRecord as Q, buildSpaceMentionProfileIndex as Qt, removeProjectOutbox as R, cliJsonSkillsShowEnvelopeSchema as Rn, toLocalSpaceStateIntegrityError as Rt, startAgentActivityTranscriptWatchers as S, prepareSpaceFileOnlySubmission as Sn, buildDispatchPromptPlan as St, resolveOpenCodeDatabasePath as T, returnToTargetPickerState as Tn, resolveBootstrapSpaceOwnerProfileId as Tt, readLastKnownAgentControllerAuthSnapshot as U, revokeOrganizationJoinLinkResponseSchema as Un, writeSpaceRecentMentionProfileIds as Ut, consumeArmedAgentControllerInterfaceReprobe as V, organizationJoinLinkErrorResponseSchema as Vn, upsertSpaceConfig as Vt, readLastKnownAgentControllerUsageLimits as W, SpaceComposerSubmissionError as Wt, resolveAgentControllerCommandFingerprint as X, buildSignalReplyWorkflowProjection as Xt, recordAgentControllerUsageLimitsObservation as Y, buildSignalMessageReadProjection as Yt, resolveNextRuntimeAgentControllerReportSyncAtMs as Z, buildSpaceMemberAgentPresencePresentation as Zt, resolveHeartbeatResponseFrame as _, listSpaceMemberDirectorySendTargets as _n, resolveComputerFileAccessStorePath as _t, DispatchSpaceActionClosedError as a, collectResolvedSpaceMentions as an, sendDispatchInteractionRequestFrame as at, collectObservedSessionWorkingDirectories as b, openTargetPickerState as bn, buildDispatchBootstrapTemplateFacts as bt, createDispatchSpaceActionContext as c, createSpaceTargetCatalog as cn, sendDispatchPreviewFrame as ct, readDispatchSpaceActionRecord as d, formatRemovedCcRelationMessage as dn, sendDispatchRuntimeEvidenceFrame as dt, buildSpaceProfileAddPlan as en, flushDispatchResultOutbox as et, supersedeDispatchSpaceActionRecordForReconsideration as f, getSpaceAccessPassword as fn, sendDispatchToolActivityFrame as ft, parseDaemonFrame as g, isWakeClosingSystemNoticeType as gn, readComputerFileAccessPolicy as gt, handleDaemonTransportFrame as h, isTargetPickerState as hn, ComputerFileAccessStoreError as ht, readDispatchOwnedRuntimeGuard as i, closeMentionPickerState as in, resolveDispatchResultPayload as it, enqueueAgentActivityHookEvent as j, cliJsonOutputEnvelopeSchema as jn, isLocalSpaceStateCorruptResult as jt, readCodexSessionTitles as k, OPENMELD_DISPATCH_RUNTIME_MODE_ENV as kn, LocalSpaceStateIntegrityError as kt, readDispatchSpaceActionContextForReceiptFromEnv as l, enterRelationPickerState as ln, sendDispatchProgressFrame as lt, emitDaemonErrorFrame as m, isRelationPickerState as mn, readRecentDaemonDispatchJournalEvents as mt, assertDispatchOwnedRuntimeServiceMutationAllowed as n, buildSpaceRoundSignalPublication as nn, waitForDispatchResultOutboxAcknowledgement as nt, DispatchSpaceActionRejectedError as o, createDispatchContinuationSpaceAccessContext as on, sendDispatchLifecycleFrame as ot, writeDispatchSpaceActionRecord as p, getSpaceAccessRequestContext as pn, emitDaemonDispatchJournalEvent as pt, recordAgentControllerInterfaceProbeFailure as q, buildPublicSpaceEntryUrl as qt, buildDispatchOwnedRuntimeEnv as r, buildUpdatesReplyWorkflowProjection as rn, buildFailedTaskResultPayload as rt, OPENMELD_SPACE_ACTION_CONTEXT_PATH_ENV as s, createSpaceMemberIdentityIndex as sn, sendDispatchPreviewEndFrame as st, assertDispatchOwnedRuntimePublicWriteAllowed as t, buildSpaceRoundReadProjection as tn, listDispatchResultOutboxPendingAcknowledgementKeys as tt, readDispatchSpaceActionContextFromEnv as u, extractMentionAuthoringPrefix as un, sendDispatchReasoningFrame as ut, resolveRegisterResponseFrame as v, listSpaceMentionRelationChoices as vn, updateComputerFileAccessPolicy as vt, resolveOpenCodeAuthPath as w, resolveSpaceMemberAgentOwnerWakeDiagnosticsView as wn, parseDispatchTask as wt, scanLocalAgentActivity as x, prepareSpaceComposerSubmission as xn, buildDispatchCorrelation as xt, sendDaemonFrame as y, listSpaceMentionSuggestions as yn, isSameOrDescendantPath as yt, readRecentAgentActivityHookStatus as z, acceptOrganizationJoinLinkBodySchema as zn, toSpaceConfigListIntegrityError as zt };
|
|
6670
7167
|
|
|
6671
|
-
//# sourceMappingURL=
|
|
7168
|
+
//# sourceMappingURL=dispatch-owned-runtime-CK2YJ2Oo.js.map
|