openmeld 0.3.244 → 0.3.247

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.
Files changed (116) hide show
  1. package/dist/{add-me-membership-CWS97GK8.js → add-me-membership-DUeJA9q4.js} +2 -2
  2. package/dist/{add-me-membership-CWS97GK8.js.map → add-me-membership-DUeJA9q4.js.map} +1 -1
  3. package/dist/{agents-BoapsuRq.js → agents-woAcH0O6.js} +10 -10
  4. package/dist/{agents-BoapsuRq.js.map → agents-woAcH0O6.js.map} +1 -1
  5. package/dist/{api-client-foundation-BYTxVhem.js → api-client-foundation-DMEfIARh.js} +3 -3
  6. package/dist/{api-client-foundation-BYTxVhem.js.map → api-client-foundation-DMEfIARh.js.map} +1 -1
  7. package/dist/{api-client-foundation-DDdQCc2T.js → api-client-foundation-mqLjUunz.js} +1 -1
  8. package/dist/{auth-session-CpKxiYC2.js → auth-session-D7hlE-47.js} +3 -3
  9. package/dist/{auth-session-CpKxiYC2.js.map → auth-session-D7hlE-47.js.map} +1 -1
  10. package/dist/auth-session-DXxmGll1.js +4 -0
  11. package/dist/{channel-BXovlRXN.js → channel-BeUv2bLR.js} +4 -4
  12. package/dist/{channel-BXovlRXN.js.map → channel-BeUv2bLR.js.map} +1 -1
  13. package/dist/{cli-binary-manifest-ETxqCzfS.js → cli-binary-manifest-ChuzORh3.js} +2 -2
  14. package/dist/{cli-binary-manifest-ETxqCzfS.js.map → cli-binary-manifest-ChuzORh3.js.map} +1 -1
  15. package/dist/{cloud-computer-D2VuZov1.js → cloud-computer-C81_vVOV.js} +4 -4
  16. package/dist/{cloud-computer-D2VuZov1.js.map → cloud-computer-C81_vVOV.js.map} +1 -1
  17. package/dist/{command-BZvpjGWe.js → command-qNknO9gl.js} +16 -16
  18. package/dist/{command-BZvpjGWe.js.map → command-qNknO9gl.js.map} +1 -1
  19. package/dist/{computer-connection-Cd5R-jnA.js → computer-connection-WpsIQfkh.js} +2 -2
  20. package/dist/{computer-connection-Cd5R-jnA.js.map → computer-connection-WpsIQfkh.js.map} +1 -1
  21. package/dist/{computer-connection-review-lBDHLC0c.js → computer-connection-review-Df2G8VWY.js} +5 -5
  22. package/dist/{computer-connection-review-lBDHLC0c.js.map → computer-connection-review-Df2G8VWY.js.map} +1 -1
  23. package/dist/{computer-disconnect-C6OH3940.js → computer-disconnect-ttAH9WgN.js} +7 -7
  24. package/dist/{computer-disconnect-C6OH3940.js.map → computer-disconnect-ttAH9WgN.js.map} +1 -1
  25. package/dist/{computer-setup-continuation-BsSM1pzW.js → computer-setup-continuation-tbuUZSe5.js} +3 -3
  26. package/dist/{computer-setup-continuation-BsSM1pzW.js.map → computer-setup-continuation-tbuUZSe5.js.map} +1 -1
  27. package/dist/{context-BbodhIFX.js → context-x0T_qTHp.js} +4 -4
  28. package/dist/{context-BbodhIFX.js.map → context-x0T_qTHp.js.map} +1 -1
  29. package/dist/{control-plane-TOfZ-veG.js → control-plane-B93wmVS6.js} +2 -2
  30. package/dist/{control-plane-TOfZ-veG.js.map → control-plane-B93wmVS6.js.map} +1 -1
  31. package/dist/{daemon-device-id-DwMFWGI5.js → daemon-device-id-DgwvQllt.js} +5 -5
  32. package/dist/{daemon-device-id-DwMFWGI5.js.map → daemon-device-id-DgwvQllt.js.map} +1 -1
  33. package/dist/{daemon-lifecycle-journal-NJaimyPD.js → daemon-lifecycle-journal-C32I8p4n.js} +7 -6
  34. package/dist/{daemon-lifecycle-journal-NJaimyPD.js.map → daemon-lifecycle-journal-C32I8p4n.js.map} +1 -1
  35. package/dist/{daemon-service-runtime-COC1JtWX.js → daemon-service-runtime-DVqzJKke.js} +4 -4
  36. package/dist/{daemon-service-runtime-COC1JtWX.js.map → daemon-service-runtime-DVqzJKke.js.map} +1 -1
  37. package/dist/{daemon-service-update-coordinator-BmZHGGiO.js → daemon-service-update-coordinator-BTlVzU-7.js} +17 -17
  38. package/dist/daemon-service-update-coordinator-BTlVzU-7.js.map +1 -0
  39. package/dist/{dispatch-owned-runtime-dLHDTL7f.js → dispatch-owned-runtime-g2lLeYtx.js} +211 -65
  40. package/dist/dispatch-owned-runtime-g2lLeYtx.js.map +1 -0
  41. package/dist/dist-CXB_bdSS.js +4 -0
  42. package/dist/{dist-Cu_yzOuS.js → dist-DGeoVaIx.js} +521 -288
  43. package/dist/dist-DGeoVaIx.js.map +1 -0
  44. package/dist/{dual-view-guide-catalog-8Pr5QO_z.js → dual-view-guide-catalog-CkcY09Kh.js} +4 -4
  45. package/dist/{dual-view-guide-catalog-8Pr5QO_z.js.map → dual-view-guide-catalog-CkcY09Kh.js.map} +1 -1
  46. package/dist/{elapsed-time-DCufUrLA.js → elapsed-time-BMG1CU23.js} +4 -4
  47. package/dist/{elapsed-time-DCufUrLA.js.map → elapsed-time-BMG1CU23.js.map} +1 -1
  48. package/dist/{entry-CJ289WR7.js → entry-CP7_Vgs4.js} +7 -7
  49. package/dist/{entry-CJ289WR7.js.map → entry-CP7_Vgs4.js.map} +1 -1
  50. package/dist/{installation-inventory-dvcGmUBg.js → installation-inventory-7JOtUjyG.js} +3 -3
  51. package/dist/{installation-inventory-dvcGmUBg.js.map → installation-inventory-7JOtUjyG.js.map} +1 -1
  52. package/dist/{installer-D0fh4fzg.js → installer-BRpAz1X_.js} +2 -2
  53. package/dist/{installer-D0fh4fzg.js.map → installer-BRpAz1X_.js.map} +1 -1
  54. package/dist/{local-components-DJiMS67S.js → local-components-jXECvlEY.js} +3 -2
  55. package/dist/local-components-jXECvlEY.js.map +1 -0
  56. package/dist/{meta-api-BdH7IJMv.js → meta-api-QskBmfuf.js} +5 -5
  57. package/dist/{meta-api-BdH7IJMv.js.map → meta-api-QskBmfuf.js.map} +1 -1
  58. package/dist/{open-code-permission-DHFJYc_o.js → open-code-permission-B5f1e5an.js} +2 -31
  59. package/dist/open-code-permission-B5f1e5an.js.map +1 -0
  60. package/dist/{openmeld-DQPDws0E.js → openmeld-BxTCCHMn.js} +224 -69
  61. package/dist/openmeld-BxTCCHMn.js.map +1 -0
  62. package/dist/{openmeld-maintenance-worker-ALfbSMyQ.js → openmeld-maintenance-worker-BQ2YbwA9.js} +9 -9
  63. package/dist/{openmeld-maintenance-worker-ALfbSMyQ.js.map → openmeld-maintenance-worker-BQ2YbwA9.js.map} +1 -1
  64. package/dist/{openmeld-tools-update-join-Cezc7ARc.js → openmeld-tools-update-join-Dj-MEQW_.js} +4 -4
  65. package/dist/{openmeld-tools-update-join-Cezc7ARc.js.map → openmeld-tools-update-join-Dj-MEQW_.js.map} +1 -1
  66. package/dist/{openmeld-tools-update-process-frame-YLOS82E3.js → openmeld-tools-update-process-frame-BtYOlJXu.js} +2 -2
  67. package/dist/{openmeld-tools-update-process-frame-YLOS82E3.js.map → openmeld-tools-update-process-frame-BtYOlJXu.js.map} +1 -1
  68. package/dist/{openmeld-tools-update-process-frame-Csy2XKUf.js → openmeld-tools-update-process-frame-CINV6Qt3.js} +1 -1
  69. package/dist/openmeld.js +5 -5
  70. package/dist/{prepare-provider-runtime-Cko0dLXN.js → prepare-provider-runtime-B6_dfpiZ.js} +1679 -1018
  71. package/dist/prepare-provider-runtime-B6_dfpiZ.js.map +1 -0
  72. package/dist/{prepare-session-executor-B-TWlSSd.js → prepare-session-executor-DA9saGAk.js} +19 -19
  73. package/dist/{prepare-session-executor-B-TWlSSd.js.map → prepare-session-executor-DA9saGAk.js.map} +1 -1
  74. package/dist/{process-channel-z_4u04-k.js → process-channel-HthE5ehS.js} +2 -2
  75. package/dist/{process-channel-z_4u04-k.js.map → process-channel-HthE5ehS.js.map} +1 -1
  76. package/dist/{runtime-C6SS6jm6.js → runtime-C7lY_Z2r.js} +104 -21
  77. package/dist/{runtime-C6SS6jm6.js.map → runtime-C7lY_Z2r.js.map} +1 -1
  78. package/dist/{runtime-agent-controller-reporting-submission-Cyb5OuVp.js → runtime-agent-controller-reporting-submission-IhxMO4UA.js} +80 -19
  79. package/dist/runtime-agent-controller-reporting-submission-IhxMO4UA.js.map +1 -0
  80. package/dist/{runtime-transport-DYbpUYBL.js → runtime-transport-DRb5__yP.js} +214 -37
  81. package/dist/runtime-transport-DRb5__yP.js.map +1 -0
  82. package/dist/{service-DjqXdt6p.js → service-DveGEdh3.js} +315 -24
  83. package/dist/service-DveGEdh3.js.map +1 -0
  84. package/dist/{service-account-authorization-BZFLy1E7.js → service-account-authorization-CAVkiKSF.js} +2 -2
  85. package/dist/{service-account-authorization-BZFLy1E7.js.map → service-account-authorization-CAVkiKSF.js.map} +1 -1
  86. package/dist/{service-account-control-CsXtCjRi.js → service-account-control-BtE73wcO.js} +9 -9
  87. package/dist/{service-account-control-CsXtCjRi.js.map → service-account-control-BtE73wcO.js.map} +1 -1
  88. package/dist/{service-control-capabilities-Ck-KcBXg.js → service-control-capabilities-BQrqIGBP.js} +3 -3
  89. package/dist/{service-control-capabilities-Ck-KcBXg.js.map → service-control-capabilities-BQrqIGBP.js.map} +1 -1
  90. package/dist/{service-control-capabilities-C4SOrFHN.js → service-control-capabilities-adDptMIH.js} +1 -1
  91. package/dist/{state-BmiyrHe4.js → state-DWwNdCy5.js} +2 -2
  92. package/dist/{state-BmiyrHe4.js.map → state-DWwNdCy5.js.map} +1 -1
  93. package/dist/{updates-api-DD3p5dx5.js → updates-api-9midbUU1.js} +71 -167
  94. package/dist/updates-api-9midbUU1.js.map +1 -0
  95. package/dist/upgrade-BvpBhL0U.js +4 -0
  96. package/dist/{upgrade-DIt6nkyo.js → upgrade-H-_QW75e.js} +9 -9
  97. package/dist/{upgrade-DIt6nkyo.js.map → upgrade-H-_QW75e.js.map} +1 -1
  98. package/package.json +13 -12
  99. package/skills/openmeld-cli/SKILL.md +5 -2
  100. package/skills/openmeld-cli/playbooks/computer.md +55 -0
  101. package/skills/openmeld-cli/playbooks/plugins.md +37 -0
  102. package/skills/openmeld-cli/references/commands.md +20 -0
  103. package/dist/auth-session-EhHX7q2K.js +0 -4
  104. package/dist/daemon-service-update-coordinator-BmZHGGiO.js.map +0 -1
  105. package/dist/dispatch-owned-runtime-dLHDTL7f.js.map +0 -1
  106. package/dist/dist-BDix0nxy.js +0 -4
  107. package/dist/dist-Cu_yzOuS.js.map +0 -1
  108. package/dist/local-components-DJiMS67S.js.map +0 -1
  109. package/dist/open-code-permission-DHFJYc_o.js.map +0 -1
  110. package/dist/openmeld-DQPDws0E.js.map +0 -1
  111. package/dist/prepare-provider-runtime-Cko0dLXN.js.map +0 -1
  112. package/dist/runtime-agent-controller-reporting-submission-Cyb5OuVp.js.map +0 -1
  113. package/dist/runtime-transport-DYbpUYBL.js.map +0 -1
  114. package/dist/service-DjqXdt6p.js.map +0 -1
  115. package/dist/updates-api-DD3p5dx5.js.map +0 -1
  116. package/dist/upgrade-3z755G8g.js +0 -4
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { Cr as renderInformationProtectionPrompt, Ct as resolveLocalProjectConnectionForPath, Kt as SPACE_ACTION_CONTEXT_GUIDANCE_LINES, Mn as DaemonServiceRunError, Tr as renderWorkingLanguagePrompt, Tt as withAgentActivityLocalStateLock, Xt as buildDispatchReplyContextSummary, br as parseAgentControllerRef, cr as buildInformationProtectionPromptPlan, dt as isProjectBound, ft as listProjectBindings, gr as isAgentControllerUsageAccountUnavailable, lr as buildWorkingLanguagePromptPlan, or as areAgentControllerInterfaceAccountsSame } from "./prepare-provider-runtime-Cko0dLXN.js";
3
+ import { Cr as parseAgentControllerRef, Ct as resolveLocalProjectConnectionForPath, Er as renderInformationProtectionPrompt, Fn as DaemonServiceRunError, Kt as SPACE_ACTION_CONTEXT_GUIDANCE_LINES, Or as renderWorkingLanguagePrompt, Tt as withAgentActivityLocalStateLock, Xt as buildDispatchReplyContextSummary, dr as buildInformationProtectionPromptPlan, dt as isProjectBound, er as buildCliLaunchInvocation, fr as buildWorkingLanguagePromptPlan, ft as listProjectBindings, lr as areAgentControllerInterfaceAccountsSame, yr as isAgentControllerUsageAccountUnavailable } from "./prepare-provider-runtime-B6_dfpiZ.js";
4
4
  import { F as resolveOpenMeldRootDir, P as resolveOpenMeldEnvPreset, b as normalizeOpenMeldProfileId, g as legacyAccountProfileSpacesDir, r as accountProfileSpaceCacheDir, w as openMeldManagedBinaryPath } from "./paths-De9xdA2h.js";
5
- import { $ as openMeldSpaceEgressActionSchema, At as sanitizeSignalTextPreview, Cn as normalizeMessageEnvelope, L as runtimeTransportRegisterSessionResponseSchema, Wi as openMeldRequestContextSchema, a as daemonStreamFrameSchema, ar as normalizeSpacePasswordText, cr as resolveSpaceMentionLabels, er as runtimeCoordinatorExecutionTokenEchoSchema, ji as centerAgentToolSpeakerSchema, jn as executionContextAssignmentSchema, sr as resolveSingleSpaceMentionLabels, vn as MESSAGE_MENTION_TYPE_VALUES, w as runtimeTransportHeartbeatResponseSchema, wn as resolveMessageEnvelopeTargetField, xn as getSpaceMessageAddressingRelationSupportForTargetKind, yn as collectCanonicalMentionTextFragments } from "./runtime-transport-DYbpUYBL.js";
6
- import { O as openMeldRuntimeProfileIdSchema } from "./control-plane-TOfZ-veG.js";
7
- import { A as boolean, G as strictObject, I as iso, K as string, M as discriminatedUnion, P as enumFactory, R as literal, Z as url, p as localServiceComponentUpdateProjectionSchema, s as localCliComponentUpdateProjectionSchema } from "./local-components-DJiMS67S.js";
8
- import { $r as organizationSkillRuntimeReleaseSelectionSchema, Ai as resumeCenterAgentRoutineResponseSchema, Ar as organizationSpaceDirectoryWithMemberCountsResponseSchema, Ci as spaceCreatorSchema, Di as listCenterAgentRoutineRunsResponseSchema, Ei as deleteCenterAgentRoutineResponseSchema, Fi as agentActivityEventSchema, Ji as listProjectsResponseSchema, Jr as listOrganizationSkillsResponseSchema, Ki as archiveProjectResponseSchema, Mr as submitFeedbackIssueRequestSchema, Nr as submitFeedbackIssueResponseSchema, Oi as listCenterAgentRoutinesResponseSchema, Pi as AGENT_ACTIVITY_PRESENCE_TTL_MAX_MS, Qr as organizationSkillReleaseSummarySchema, Ti as createCenterAgentRoutineResponseSchema, Ui as localProjectControlConnectionSchema, Xi as updateProjectResponseSchema, Yi as projectSchema, Zr as organizationSkillGitHubRepositoryPreviewSchema, ci as spaceMemberDirectoryEntrySchema, ei as organizationSkillSummarySchema, fr as spaceEntryTargetSchema, hi as organizationComputersResponseSchema, ji as updateCenterAgentRoutineResponseSchema, jr as organizationDirectoryResponseSchema, ki as pauseCenterAgentRoutineResponseSchema, li as spaceMemberDirectorySchema, na as computerFileAccessPolicySchema, oi as spaceMemberAgentWakeAvailabilitySchema, qi as createProjectResponseSchema, qr as getOrganizationSkillResponseSchema, si as spaceMemberDirectoryAllowedRelationsSchema, ta as computerFileAccessPolicyInputSchema, ui as spaceMemberKindSchema, yi as agentActivitySessionInventoryResponseSchema, zi as agentActivitySnapshotResponseSchema } from "./dist-Cu_yzOuS.js";
9
- import { a as asRecord, d as normalizeText, l as normalizeNonNegativeInteger$1, s as emitRunLine, u as normalizeOptionalText$8 } from "./daemon-device-id-DwMFWGI5.js";
5
+ import { $ as openMeldSpaceEgressActionSchema, At as sanitizeSignalTextPreview, Fn as executionContextAssignmentSchema, Ii as centerAgentToolSpeakerSchema, L as runtimeTransportRegisterSessionResponseSchema, Sn as getSpaceMessageAddressingRelationSupportForTargetKind, Tn as resolveMessageEnvelopeTargetField, Yi as openMeldRequestContextSchema, a as daemonStreamFrameSchema, ar as runtimeCoordinatorExecutionTokenEchoSchema, bn as collectCanonicalMentionTextFragments, fr as resolveSingleSpaceMentionLabels, pr as resolveSpaceMentionLabels, ur as normalizeSpacePasswordText, w as runtimeTransportHeartbeatResponseSchema, wn as normalizeMessageEnvelope, yn as MESSAGE_MENTION_TYPE_VALUES } from "./runtime-transport-DRb5__yP.js";
6
+ import { O as openMeldRuntimeProfileIdSchema } from "./control-plane-B93wmVS6.js";
7
+ import { A as boolean, I as iso, K as strictObject, M as discriminatedUnion, P as enumFactory, Q as url, p as localServiceComponentUpdateProjectionSchema, q as string, s as localCliComponentUpdateProjectionSchema, z as literal } from "./local-components-jXECvlEY.js";
8
+ import { $i as agentActivitySnapshotResponseSchema, Bi as listRoutineManagementResponseSchema, Fi as centerAgentRoutineSchema, Gi as updateCenterAgentRoutineResponseSchema, Hi as resumeCenterAgentRoutineResponseSchema, Ii as createCenterAgentRoutineResponseSchema, Ji as AGENT_ACTIVITY_PRESENCE_TTL_MAX_MS, Li as deleteCenterAgentRoutineResponseSchema, Mr as organizationDirectoryResponseSchema, Ni as spaceCreatorSchema, Nr as submitFeedbackIssueRequestSchema, Pr as submitFeedbackIssueResponseSchema, Ri as listCenterAgentRoutineRunsResponseSchema, Rr as sessionHistoryPageSchema, Ti as organizationComputersResponseSchema, Ui as routineManagementSchema, Vi as pauseCenterAgentRoutineResponseSchema, Yi as agentActivityEventSchema, _i as spaceMemberDirectoryAllowedRelationsSchema, bi as spaceMemberKindSchema, ca as listProjectsResponseSchema, ci as organizationSkillReleaseSummarySchema, ga as computerFileAccessPolicySchema, gi as spaceMemberAgentWakeAvailabilitySchema, ha as computerFileAccessPolicyInputSchema, ii as listOrganizationSkillsResponseSchema, jr as organizationSpaceDirectoryWithMemberCountsResponseSchema, ki as agentActivitySessionInventoryResponseSchema, la as projectSchema, li as organizationSkillRuntimeReleaseSelectionSchema, oa as archiveProjectResponseSchema, pr as spaceEntryTargetSchema, ra as localProjectControlConnectionSchema, ri as getOrganizationSkillResponseSchema, sa as createProjectResponseSchema, si as organizationSkillGitHubRepositoryPreviewSchema, ua as updateProjectResponseSchema, ui as organizationSkillSummarySchema, vi as spaceMemberDirectoryEntrySchema, yi as spaceMemberDirectorySchema, zi as listCenterAgentRoutinesResponseSchema } from "./dist-DGeoVaIx.js";
9
+ import { a as asRecord, d as normalizeText, l as normalizeNonNegativeInteger$1, s as emitRunLine, u as normalizeOptionalText$8 } from "./daemon-device-id-DgwvQllt.js";
10
10
  import { i as serviceControlCapabilitiesSchema } from "./service-account-admission-BfdJ-kKR.js";
11
11
  import { v as resolveCliContextId } from "./lock-BMI00i2F.js";
12
- import { B as buildCenterAgentRoleTemplateText, F as SPACE_COLLABORATION_CONTEXT_RULE, H as buildSpaceAgentIdentityLine, J as isSelfWakeSpaceAction, K as composeDispatchBrief, R as buildAgentFacingMentalModelLines, U as buildSpaceEntryBriefNeedMoreLine, V as buildCompactDispatchActionGuidanceLines, W as buildSpaceWakeParticipantLines, Y as renderSpaceEntryBrief, Z as resolveSpacePublicationRequirement, q as deriveContinuity } from "./dual-view-guide-catalog-8Pr5QO_z.js";
12
+ import { B as buildCenterAgentRoleTemplateText, F as SPACE_COLLABORATION_CONTEXT_RULE, H as buildSpaceAgentIdentityLine, J as isSelfWakeSpaceAction, K as composeDispatchBrief, R as buildAgentFacingMentalModelLines, U as buildSpaceEntryBriefNeedMoreLine, V as buildCompactDispatchActionGuidanceLines, W as buildSpaceWakeParticipantLines, Y as renderSpaceEntryBrief, Z as resolveSpacePublicationRequirement, q as deriveContinuity } from "./dual-view-guide-catalog-CkcY09Kh.js";
13
13
  import { d as createDefaultRuntimeAgentControllerSettings } from "./base-url-0AoeTi3w.js";
14
- import { F as resolveCurrentOpenMeldAccountContext } from "./context-BbodhIFX.js";
14
+ import { F as resolveCurrentOpenMeldAccountContext } from "./context-x0T_qTHp.js";
15
15
  import { a as formatOpenMeldCliTextBlock } from "./cli-entry-command-CR_9QU1i.js";
16
16
  import { n as resolveOpenMeldDistribution } from "./distribution-BDQT2ilb.js";
17
17
  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";
@@ -23,6 +23,7 @@ import * as z$1 from "zod/v4";
23
23
  import { z } from "zod/v4";
24
24
  import { appendFileSync, chmodSync, constants, existsSync, mkdirSync, readFileSync, renameSync, watch, writeFileSync } from "node:fs";
25
25
  import process$1 from "node:process";
26
+ import { spawn } from "node:child_process";
26
27
  import { isDeepStrictEqual } from "node:util";
27
28
  import { Worker } from "node:worker_threads";
28
29
  //#region ../../packages/schemas/dist/schemas/cli/daemon-status-server-requirement.js
@@ -347,6 +348,7 @@ const cliJsonProjectsConnectionsRemoveEnvelopeSchema = defineStrictSuccessEnvelo
347
348
  });
348
349
  const cliJsonAgentActivityReadEnvelopeSchema = defineStrictSuccessEnvelope("activity.read", agentActivitySnapshotResponseSchema.shape);
349
350
  const cliJsonAgentActivitySessionsEnvelopeSchema = defineStrictSuccessEnvelope("activity.sessions", agentActivitySessionInventoryResponseSchema.shape);
351
+ const cliJsonAgentActivityHistoryEnvelopeSchema = defineStrictSuccessEnvelope("activity.history", sessionHistoryPageSchema.shape);
350
352
  const cliJsonAgentActivityIntegrationStatusSchema = z$1.strictObject({
351
353
  claude: z$1.boolean(),
352
354
  codex: z$1.boolean(),
@@ -416,9 +418,13 @@ const cliJsonAgentActivitySyncEnvelopeSchema = defineStrictSuccessEnvelope("acti
416
418
  submittedCount: z$1.number().int().nonnegative()
417
419
  }) });
418
420
  const cliJsonAgentActivityContextEnvelopeSchema = defineStrictSuccessEnvelope("activity.context", { context: z$1.string().min(1).max(300).nullable() });
419
- const cliJsonRoutinesListEnvelopeSchema = defineStrictSuccessEnvelope("routines.list", listCenterAgentRoutinesResponseSchema.shape);
421
+ const cliJsonRoutinesListEnvelopeSchema = defineStrictSuccessEnvelope("routines.list", {
422
+ ...listCenterAgentRoutinesResponseSchema.shape,
423
+ routines: z$1.array(z$1.union([routineManagementSchema, centerAgentRoutineSchema])),
424
+ executors: listRoutineManagementResponseSchema.shape.executors.optional()
425
+ });
420
426
  const cliJsonRoutinesCreateEnvelopeSchema = defineStrictSuccessEnvelope("routines.create", createCenterAgentRoutineResponseSchema.shape);
421
- const cliJsonRoutinesShowEnvelopeSchema = defineStrictSuccessEnvelope("routines.show", createCenterAgentRoutineResponseSchema.shape);
427
+ const cliJsonRoutinesShowEnvelopeSchema = defineStrictSuccessEnvelope("routines.show", { routine: z$1.union([routineManagementSchema, centerAgentRoutineSchema]) });
422
428
  const cliJsonRoutinesUpdateEnvelopeSchema = defineStrictSuccessEnvelope("routines.update", updateCenterAgentRoutineResponseSchema.shape);
423
429
  const cliJsonRoutinesPauseEnvelopeSchema = defineStrictSuccessEnvelope("routines.pause", pauseCenterAgentRoutineResponseSchema.shape);
424
430
  const cliJsonRoutinesResumeEnvelopeSchema = defineStrictSuccessEnvelope("routines.resume", resumeCenterAgentRoutineResponseSchema.shape);
@@ -542,6 +548,7 @@ const cliJsonOutputEnvelopeSchema = z$1.discriminatedUnion("type", [
542
548
  cliJsonProjectsConnectionsRemoveEnvelopeSchema,
543
549
  cliJsonAgentActivityReadEnvelopeSchema,
544
550
  cliJsonAgentActivitySessionsEnvelopeSchema,
551
+ cliJsonAgentActivityHistoryEnvelopeSchema,
545
552
  cliJsonAgentActivityInstallEnvelopeSchema,
546
553
  cliJsonAgentActivityUninstallEnvelopeSchema,
547
554
  cliJsonAgentActivityStatusEnvelopeSchema,
@@ -2829,7 +2836,7 @@ function storeNewestSpaceConfig(list, candidate) {
2829
2836
  if (!existing || compareIsoDateDesc(candidate.updatedAt, existing.updatedAt) < 0) list.set(candidate.space, candidate);
2830
2837
  }
2831
2838
  function normalizeSpaceConfig(value) {
2832
- if (!isRecord$2(value)) return null;
2839
+ if (!isRecord$3(value)) return null;
2833
2840
  if (value.v === 2) return normalizeCurrentSpaceConfig(value);
2834
2841
  if (value.v === 1) return normalizeLegacySpaceConfig(value);
2835
2842
  return null;
@@ -2858,7 +2865,7 @@ function normalizeCurrentSpaceConfig(parsed) {
2858
2865
  });
2859
2866
  }
2860
2867
  function normalizeSpaceCacheMaintenanceState(value) {
2861
- if (!isRecord$2(value)) return null;
2868
+ if (!isRecord$3(value)) return null;
2862
2869
  const lastRunAt = resolveIsoTimestamp(value.lastRunAt);
2863
2870
  const lastRemovedByRemote = resolveOptionalNonNegativeInteger(value.lastRemovedByRemote);
2864
2871
  const lastRemovedByTtl = resolveOptionalNonNegativeInteger(value.lastRemovedByTtl);
@@ -2873,8 +2880,8 @@ function normalizeSpaceCacheMaintenanceState(value) {
2873
2880
  };
2874
2881
  }
2875
2882
  function normalizeSpaceCacheDeletionNoticeState(value) {
2876
- if (!isRecord$2(value)) return null;
2877
- if (value.v !== SPACE_CACHE_DELETION_NOTICE_SCHEMA_VERSION || !isRecord$2(value.seen)) return null;
2883
+ if (!isRecord$3(value)) return null;
2884
+ if (value.v !== SPACE_CACHE_DELETION_NOTICE_SCHEMA_VERSION || !isRecord$3(value.seen)) return null;
2878
2885
  const seen = {};
2879
2886
  for (const [rawKey, rawValue] of Object.entries(value.seen)) {
2880
2887
  const key = normalizeTrimmedOptionalString(rawKey);
@@ -2975,7 +2982,7 @@ function hasInvalidLegacySpaceConfigPrimitives(parsed) {
2975
2982
  hasInvalidOptionalStringEntry(parsed, "role"),
2976
2983
  hasInvalidOptionalStringEntry(parsed, "mentionAlias"),
2977
2984
  hasInvalidOptionalStringEntry(parsed, "guide"),
2978
- hasOwn(parsed, "permissions") && !isRecord$2(parsed.permissions),
2985
+ hasOwn(parsed, "permissions") && !isRecord$3(parsed.permissions),
2979
2986
  hasInvalidOptionalBooleanEntry(parsed, "passwordProtected"),
2980
2987
  hasInvalidOptionalStringEntry(parsed, "spacePurpose"),
2981
2988
  hasInvalidOptionalNonNegativeIntegerEntry(parsed, "activeAgentCount"),
@@ -3060,7 +3067,7 @@ function areStringListsEqual(left, right) {
3060
3067
  for (let index = 0; index < left.length; index += 1) if (left[index] !== right[index]) return false;
3061
3068
  return true;
3062
3069
  }
3063
- function isRecord$2(value) {
3070
+ function isRecord$3(value) {
3064
3071
  return !!value && typeof value === "object" && !Array.isArray(value);
3065
3072
  }
3066
3073
  function hasOwn(value, key) {
@@ -3357,6 +3364,16 @@ const OPENMELD_WAKE_WORKFLOW = `OpenMeld Wake workflow:
3357
3364
  - Follow the current Wake's completion contract. When a Space Action is required, a private answer is insufficient. OpenMeld validates and publishes the proposal.`;
3358
3365
  const COMPACT_DISPATCH_BOOTSTRAP_TEMPLATE_VERSION = "space-mesh-entry-brief-v2";
3359
3366
  const LOCAL_AGENT_INSTRUCTION_CONTRACT_VERSION = "openmeld-native-instructions-v1";
3367
+ const SPACE_ACTION_COMPLETION_RULES = [
3368
+ "- Plain text is not a Space reply.",
3369
+ "- Use supplied context first. Discover read_history for this Wake's bounded Space text, or read_file with a file ID and revision. Both dispatch tools read as you without local login files; neither completes the Wake.",
3370
+ "- Use the Space Action tool first. If your harness offers tool search or discovery, look up the required action before declaring it unavailable. A tool missing from the initial list is not proof of unavailability. Do not read setup or onboarding guides merely to submit this result.",
3371
+ "- For a plain reply, omit wakeTargets and referenceTargets. Add targets only for an intentional handoff or reference to another Agent; never copy incoming activation targets or wake yourself.",
3372
+ "- Submit the actual result and inspect the tool response before ending this turn.",
3373
+ "- After one successful acknowledgement, stop submitting. It confirms a recorded proposal, not publication.",
3374
+ "- If a Space Action submission is confirmed rejected before recording, follow its correction guidance. If its submission outcome is unknown, submit no further Space Action in this turn, including an error-report reply. End with the diagnostic; OpenMeld owns recovery. Do not switch tools to retry the submission.",
3375
+ "- A failed context read or business tool is not a Space Action submission. If no Space Action has been submitted, use the required completion action to report the blocker honestly; do not invent results from unread material."
3376
+ ];
3360
3377
  const TRAILING_TITLE_SURROGATE = /\p{Surrogate}$/u;
3361
3378
  function buildDispatchSessionTitle(input) {
3362
3379
  const clean = (value) => value.slice(0, 256).replace(/[\p{Cc}\p{Cf}\s]+/gu, " ").trim();
@@ -3565,6 +3582,7 @@ function buildDispatchPromptPlan(input) {
3565
3582
  "OpenMeld local agent contract:",
3566
3583
  OPENMELD_SPACE_DEFINITION,
3567
3584
  OPENMELD_WAKE_WORKFLOW,
3585
+ ["OpenMeld Space Action rules (apply only when the current Wake's Mandatory completion section requires a Space Action; they do not authorize an action):", ...SPACE_ACTION_COMPLETION_RULES].join("\n"),
3568
3586
  informationProtectionPlan.developerInstructions,
3569
3587
  workingLanguagePlan.developerInstructions
3570
3588
  ].join("\n\n");
@@ -3574,6 +3592,7 @@ function buildDispatchPromptPlan(input) {
3574
3592
  fallbackPrompt: buildDispatchPromptWithBootstrap(input),
3575
3593
  instructionEpoch: `${LOCAL_AGENT_INSTRUCTION_CONTRACT_VERSION}:${contentFingerprint}`,
3576
3594
  userPrompt: renderDispatchPrompt({
3595
+ nativeInstructions: true,
3577
3596
  informationProtectionPrompt: informationProtectionPlan.perTurnPrompt,
3578
3597
  workingLanguagePrompt: workingLanguagePlan.perTurnPrompt,
3579
3598
  input
@@ -3604,7 +3623,7 @@ function renderDispatchPrompt(input) {
3604
3623
  if (promptInput.imageAttachmentPromptSection) sections.push(promptInput.imageAttachmentPromptSection);
3605
3624
  const spaceFilesSection = renderSharedSpaceFilesSection(promptInput);
3606
3625
  if (spaceFilesSection) sections.push(spaceFilesSection);
3607
- const completionSection = renderMandatoryCompletionSection(promptInput);
3626
+ const completionSection = renderMandatoryCompletionSection(promptInput, input.nativeInstructions === true);
3608
3627
  if (completionSection) sections.push(completionSection);
3609
3628
  return sections.filter(Boolean).join("\n\n");
3610
3629
  }
@@ -3703,21 +3722,14 @@ function buildCurrentWakeContextLines(input) {
3703
3722
  readOutcomesInstruction: `run \`${updatesCommand}\``
3704
3723
  });
3705
3724
  }
3706
- function renderMandatoryCompletionSection(input) {
3725
+ function renderMandatoryCompletionSection(input, nativeInstructions) {
3707
3726
  const publicationRequirement = resolveSpacePublicationRequirement(input.spaceContractSnapshot);
3708
3727
  if (publicationRequirement.allowsRawReplyWithoutAction) return null;
3709
3728
  if (!publicationRequirement.allowedActions.some((action) => action === "post_message" || action === "stay_silent")) return ["Mandatory completion:", ...publicationRequirement.actionGuidanceLines].join("\n");
3710
3729
  return [
3711
3730
  "Mandatory completion:",
3712
- "- Plain text is not a Space reply.",
3713
- "- Use supplied context first. Discover read_history for this Wake's bounded Space text, or read_file with a file ID and revision. Both dispatch tools read as you without local login files; neither completes the Wake.",
3714
- buildMandatoryCompletionActionLine(publicationRequirement),
3715
- "- Use the Space Action tool first. If your harness offers tool search or discovery, look up the required action before declaring it unavailable. A tool missing from the initial list is not proof of unavailability. Do not read setup or onboarding guides merely to submit this result.",
3716
- ...publicationRequirement.allowedActions.includes("post_message") ? ["- For a plain reply, omit wakeTargets and referenceTargets. Add targets only for an intentional handoff or reference to another Agent; never copy incoming activation targets or wake yourself."] : [],
3717
- "- Submit the actual result and inspect the tool response before ending this turn.",
3718
- "- After one successful acknowledgement, stop submitting. It confirms a recorded proposal, not publication.",
3719
- "- If a Space Action submission is confirmed rejected before recording, follow its correction guidance. If its submission outcome is unknown, submit no further Space Action in this turn, including an error-report reply. End with the diagnostic; OpenMeld owns recovery. Do not switch tools to retry the submission.",
3720
- "- A failed context read or business tool is not a Space Action submission. If no Space Action has been submitted, use the required completion action to report the blocker honestly; do not invent results from unread material."
3731
+ ...nativeInstructions ? [] : SPACE_ACTION_COMPLETION_RULES,
3732
+ buildMandatoryCompletionActionLine(publicationRequirement)
3721
3733
  ].join("\n");
3722
3734
  }
3723
3735
  function buildMandatoryCompletionActionLine(publicationRequirement) {
@@ -5002,8 +5014,8 @@ async function readCodexSessionTitles(input) {
5002
5014
  if (!line.trim()) continue;
5003
5015
  try {
5004
5016
  const record = JSON.parse(line);
5005
- if (!isRecord$1(record)) continue;
5006
- const sessionId = text$2(record.id);
5017
+ if (!isRecord$2(record)) continue;
5018
+ const sessionId = text$3(record.id);
5007
5019
  const title = normalizeSharedSessionTitle(record.thread_name);
5008
5020
  if (sessionId && title) titles.set(sessionId, title);
5009
5021
  } catch {}
@@ -5011,13 +5023,13 @@ async function readCodexSessionTitles(input) {
5011
5023
  return titles;
5012
5024
  }
5013
5025
  function normalizeSharedSessionTitle(value) {
5014
- const normalized = text$2(value);
5026
+ const normalized = text$3(value);
5015
5027
  return normalized && normalized.length <= 240 ? normalized : null;
5016
5028
  }
5017
- function text$2(value) {
5029
+ function text$3(value) {
5018
5030
  return typeof value === "string" && value.trim() ? value.trim() : null;
5019
5031
  }
5020
- function isRecord$1(value) {
5032
+ function isRecord$2(value) {
5021
5033
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
5022
5034
  }
5023
5035
  function isNodeError(error) {
@@ -5027,12 +5039,12 @@ function isNodeError(error) {
5027
5039
  //#region src/agent-activity/observer-adapters.ts
5028
5040
  const ACTIVE_WINDOW_MS = 2 * 6e4;
5029
5041
  function parseCodexRolloutSnapshot(input) {
5030
- const meta = input.lines.find((line) => isRecord(line) && line.type === "session_meta" && isRecord(line.payload));
5031
- if (!(isRecord(meta) && isRecord(meta.payload))) return null;
5032
- const sessionId = text$1(meta.payload.id);
5033
- const cwd = text$1(meta.payload.cwd);
5042
+ const meta = input.lines.find((line) => isRecord$1(line) && line.type === "session_meta" && isRecord$1(line.payload));
5043
+ if (!(isRecord$1(meta) && isRecord$1(meta.payload))) return null;
5044
+ const sessionId = text$2(meta.payload.id);
5045
+ const cwd = text$2(meta.payload.cwd);
5034
5046
  if (!(sessionId && cwd)) return null;
5035
- const safeEvidence = input.lines.filter((line) => isRecord(line)).map((line) => ({
5047
+ const safeEvidence = input.lines.filter((line) => isRecord$1(line)).map((line) => ({
5036
5048
  line,
5037
5049
  observedAtMs: timestamp(line.timestamp)
5038
5050
  })).filter((entry) => entry.observedAtMs !== null).sort((left, right) => Number(left.observedAtMs) - Number(right.observedAtMs));
@@ -5040,17 +5052,17 @@ function parseCodexRolloutSnapshot(input) {
5040
5052
  const latestTurn = [...safeEvidence].reverse().find((entry) => entry.line.type === "turn_context");
5041
5053
  const observedAtMs = latest?.observedAtMs ?? timestamp(meta.timestamp);
5042
5054
  if (observedAtMs === null) return null;
5043
- const turnPayload = isRecord(latestTurn?.line.payload) ? latestTurn.line.payload : {};
5055
+ const turnPayload = isRecord$1(latestTurn?.line.payload) ? latestTurn.line.payload : {};
5044
5056
  const originator = normalizeCodexOriginator(meta.payload);
5045
5057
  const status = resolveObservedStatus({
5046
5058
  explicitIdle: safeEvidence.slice(-4).some((entry) => {
5047
- const payload = isRecord(entry.line.payload) ? entry.line.payload : null;
5059
+ const payload = isRecord$1(entry.line.payload) ? entry.line.payload : null;
5048
5060
  return entry.line.type === "event_msg" && (payload?.type === "task_complete" || payload?.type === "turn_aborted");
5049
5061
  }),
5050
5062
  nowMs: input.nowMs,
5051
5063
  observedAtMs
5052
5064
  });
5053
- const git = isRecord(meta.payload.git) ? meta.payload.git : {};
5065
+ const git = isRecord$1(meta.payload.git) ? meta.payload.git : {};
5054
5066
  return {
5055
5067
  clientKind: resolveCodexClientKind(originator),
5056
5068
  cwd,
@@ -5068,7 +5080,7 @@ function parseCodexRolloutSnapshot(input) {
5068
5080
  "never"
5069
5081
  ]),
5070
5082
  cliVersion: nullableText(meta.payload.cli_version),
5071
- contextWindow: positiveInteger(isRecord(turnPayload.summary) ? turnPayload.summary.model_context_window : void 0),
5083
+ contextWindow: positiveInteger(isRecord$1(turnPayload.summary) ? turnPayload.summary.model_context_window : void 0),
5072
5084
  modelProvider: nullableText(meta.payload.model_provider),
5073
5085
  originator,
5074
5086
  reasoningEffort: enumValue(turnPayload.effort, [
@@ -5079,7 +5091,7 @@ function parseCodexRolloutSnapshot(input) {
5079
5091
  "xhigh",
5080
5092
  "ultra"
5081
5093
  ]),
5082
- sandboxMode: enumValue(isRecord(turnPayload.sandbox_policy) ? turnPayload.sandbox_policy.type : turnPayload.sandbox_policy, [
5094
+ sandboxMode: enumValue(isRecord$1(turnPayload.sandbox_policy) ? turnPayload.sandbox_policy.type : turnPayload.sandbox_policy, [
5083
5095
  "read-only",
5084
5096
  "workspace-write",
5085
5097
  "danger-full-access"
@@ -5097,11 +5109,11 @@ function resolveCodexClientKind(originator) {
5097
5109
  return originator === "cli" ? "codex-cli" : "unknown";
5098
5110
  }
5099
5111
  function parseClaudeTranscriptSnapshot(input) {
5100
- const records = input.lines.filter((line) => isRecord(line));
5101
- const identity = records.find((line) => text$1(line.sessionId) && text$1(line.cwd));
5112
+ const records = input.lines.filter((line) => isRecord$1(line));
5113
+ const identity = records.find((line) => text$2(line.sessionId) && text$2(line.cwd));
5102
5114
  if (!identity) return null;
5103
- const providerSessionId = text$1(identity.sessionId);
5104
- const cwd = text$1(identity.cwd);
5115
+ const providerSessionId = text$2(identity.sessionId);
5116
+ const cwd = text$2(identity.cwd);
5105
5117
  if (!(providerSessionId && cwd)) return null;
5106
5118
  const timed = records.map((line) => ({
5107
5119
  line,
@@ -5109,7 +5121,7 @@ function parseClaudeTranscriptSnapshot(input) {
5109
5121
  })).filter((entry) => entry.observedAtMs !== null).sort((left, right) => left.observedAtMs - right.observedAtMs);
5110
5122
  const latest = timed.at(-1);
5111
5123
  if (!latest) return null;
5112
- const latestWithModel = [...timed].reverse().find((entry) => isRecord(entry.line.message) && text$1(entry.line.message.model));
5124
+ const latestWithModel = [...timed].reverse().find((entry) => isRecord$1(entry.line.message) && text$2(entry.line.message.model));
5113
5125
  const customTitle = [...records].reverse().find((line) => line.type === "custom-title");
5114
5126
  const status = resolveObservedStatus({
5115
5127
  explicitIdle: false,
@@ -5122,7 +5134,7 @@ function parseClaudeTranscriptSnapshot(input) {
5122
5134
  eventType: status === "active" ? "heartbeat" : statusEventType(status),
5123
5135
  gitBranch: nullableText(latest.line.gitBranch ?? identity.gitBranch),
5124
5136
  gitCommit: null,
5125
- model: isRecord(latestWithModel?.line.message) ? nullableText(latestWithModel.line.message.model) : null,
5137
+ model: isRecord$1(latestWithModel?.line.message) ? nullableText(latestWithModel.line.message.model) : null,
5126
5138
  observedAtMs: latest.observedAtMs,
5127
5139
  provider: "claude-code",
5128
5140
  providerMetadata: compact({
@@ -5148,8 +5160,8 @@ function parseClaudeTranscriptSnapshot(input) {
5148
5160
  };
5149
5161
  }
5150
5162
  function parseOpenCodeSessionRow(input) {
5151
- const providerSessionId = text$1(input.row.id);
5152
- const cwd = text$1(input.row.directory);
5163
+ const providerSessionId = text$2(input.row.id);
5164
+ const cwd = text$2(input.row.directory);
5153
5165
  const observedAtMs = timestamp(input.row.time_updated);
5154
5166
  if (!(providerSessionId && cwd && observedAtMs !== null)) return null;
5155
5167
  const model = parseJsonRecord(input.row.model);
@@ -5248,13 +5260,13 @@ function resolveObservedStatus(input) {
5248
5260
  return !input.explicitIdle && input.nowMs - input.observedAtMs <= ACTIVE_WINDOW_MS ? "active" : "idle";
5249
5261
  }
5250
5262
  function normalizeCodexOriginator(meta) {
5251
- if (text$1(meta.originator) === "Codex Desktop") return "desktop";
5252
- if (isRecord(meta.source) && "subagent" in meta.source) return "subagent";
5253
- const originator = text$1(meta.originator)?.toLowerCase();
5263
+ if (text$2(meta.originator) === "Codex Desktop") return "desktop";
5264
+ if (isRecord$1(meta.source) && "subagent" in meta.source) return "subagent";
5265
+ const originator = text$2(meta.originator)?.toLowerCase();
5254
5266
  return originator === "codex cli" || originator === "codex_cli" ? "cli" : void 0;
5255
5267
  }
5256
5268
  function normalizeClaudeEntrypoint(value) {
5257
- const normalized = text$1(value);
5269
+ const normalized = text$2(value);
5258
5270
  if (normalized === "claude-desktop") return "desktop";
5259
5271
  return normalized === "cli" ? "cli" : void 0;
5260
5272
  }
@@ -5266,7 +5278,7 @@ function compact(value) {
5266
5278
  return Object.fromEntries(Object.entries(value).filter(([, entry]) => entry !== void 0));
5267
5279
  }
5268
5280
  function enumValue(value, allowed) {
5269
- const normalized = text$1(value);
5281
+ const normalized = text$2(value);
5270
5282
  return normalized && allowed.includes(normalized) ? normalized : void 0;
5271
5283
  }
5272
5284
  function positiveInteger(value) {
@@ -5287,23 +5299,23 @@ function timestamp(value) {
5287
5299
  return Number.isFinite(parsed) ? parsed : null;
5288
5300
  }
5289
5301
  function nullableText(value) {
5290
- const normalized = text$1(value);
5302
+ const normalized = text$2(value);
5291
5303
  return normalized && normalized.length <= 512 ? normalized : null;
5292
5304
  }
5293
- function text$1(value) {
5305
+ function text$2(value) {
5294
5306
  return typeof value === "string" && value.trim() ? value.trim() : null;
5295
5307
  }
5296
5308
  function parseJsonRecord(value) {
5297
- if (isRecord(value)) return value;
5309
+ if (isRecord$1(value)) return value;
5298
5310
  if (typeof value !== "string") return null;
5299
5311
  try {
5300
5312
  const parsed = JSON.parse(value);
5301
- return isRecord(parsed) ? parsed : null;
5313
+ return isRecord$1(parsed) ? parsed : null;
5302
5314
  } catch {
5303
5315
  return null;
5304
5316
  }
5305
5317
  }
5306
- function isRecord(value) {
5318
+ function isRecord$1(value) {
5307
5319
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
5308
5320
  }
5309
5321
  //#endregion
@@ -5759,8 +5771,8 @@ function reportCandidateReadDiagnostic(input, diagnostic) {
5759
5771
  }
5760
5772
  async function processOpenCodeIdentityRows(input, database, identityRows, result) {
5761
5773
  for (const identity of identityRows) {
5762
- const id = text(identity.id);
5763
- const directory = text(identity.directory);
5774
+ const id = text$1(identity.id);
5775
+ const directory = text$1(identity.directory);
5764
5776
  const updatedAtMs = Number(identity.time_updated) || 0;
5765
5777
  input.state.openCodeCursor = {
5766
5778
  id: id ?? "",
@@ -5982,7 +5994,7 @@ async function writeObserverState(input, state) {
5982
5994
  function observerStatePath(input) {
5983
5995
  return join(input.rootDir ?? resolveOpenMeldRootDir(), "device", "agent-activity", "observer-state.json");
5984
5996
  }
5985
- function text(value) {
5997
+ function text$1(value) {
5986
5998
  return typeof value === "string" && value.trim() ? value.trim() : null;
5987
5999
  }
5988
6000
  //#endregion
@@ -6120,6 +6132,140 @@ function sendDaemonFrame(sink, input) {
6120
6132
  }));
6121
6133
  }
6122
6134
  //#endregion
6135
+ //#region src/agent-activity/codex-read-client.ts
6136
+ const PROVIDER_DISCOVERY_TIMEOUT_MS = 3e4;
6137
+ const MAX_JSON_RPC_LINE_BYTES = 8 * 1024 * 1024;
6138
+ function createCodexJsonRpcClient(launchContract) {
6139
+ const invocation = buildCliLaunchInvocation({
6140
+ args: [
6141
+ "app-server",
6142
+ "--listen",
6143
+ "stdio://"
6144
+ ],
6145
+ launchContract
6146
+ });
6147
+ const child = spawn(invocation.bin, invocation.args, {
6148
+ env: process.env,
6149
+ shell: invocation.shell ?? false,
6150
+ stdio: [
6151
+ "pipe",
6152
+ "pipe",
6153
+ "ignore"
6154
+ ],
6155
+ windowsHide: true
6156
+ });
6157
+ let nextId = 1;
6158
+ let buffer = "";
6159
+ let closed = false;
6160
+ const pending = /* @__PURE__ */ new Map();
6161
+ const rejectPending = (error) => {
6162
+ for (const request of pending.values()) {
6163
+ clearTimeout(request.timer);
6164
+ request.reject(error);
6165
+ }
6166
+ pending.clear();
6167
+ };
6168
+ child.stdout.setEncoding("utf8");
6169
+ child.stdout.on("data", (chunk) => {
6170
+ buffer = consumeCodexJsonRpcChunk({
6171
+ buffer,
6172
+ chunk,
6173
+ kill: () => child.kill("SIGTERM"),
6174
+ pending,
6175
+ rejectPending
6176
+ });
6177
+ });
6178
+ child.on("error", (error) => rejectPending(error));
6179
+ child.on("close", () => {
6180
+ closed = true;
6181
+ rejectPending(/* @__PURE__ */ new Error("Codex app-server closed during discovery."));
6182
+ });
6183
+ return {
6184
+ close: async () => {
6185
+ if (closed) return;
6186
+ child.kill("SIGTERM");
6187
+ await new Promise((resolveClose) => {
6188
+ const timer = setTimeout(resolveClose, 1e3);
6189
+ child.once("close", () => {
6190
+ clearTimeout(timer);
6191
+ resolveClose();
6192
+ });
6193
+ });
6194
+ },
6195
+ notify: (method, params) => {
6196
+ child.stdin.write(`${JSON.stringify({
6197
+ jsonrpc: "2.0",
6198
+ method,
6199
+ params
6200
+ })}\n`);
6201
+ },
6202
+ request: (method, params) => {
6203
+ if (closed) return Promise.reject(/* @__PURE__ */ new Error("Codex app-server is closed."));
6204
+ const id = nextId;
6205
+ nextId += 1;
6206
+ return new Promise((resolveRequest, rejectRequest) => {
6207
+ const timer = setTimeout(() => {
6208
+ pending.delete(id);
6209
+ rejectRequest(/* @__PURE__ */ new Error(`Codex ${method} timed out.`));
6210
+ }, PROVIDER_DISCOVERY_TIMEOUT_MS);
6211
+ pending.set(id, {
6212
+ reject: rejectRequest,
6213
+ resolve: resolveRequest,
6214
+ timer
6215
+ });
6216
+ child.stdin.write(`${JSON.stringify({
6217
+ id,
6218
+ jsonrpc: "2.0",
6219
+ method,
6220
+ params
6221
+ })}\n`);
6222
+ });
6223
+ }
6224
+ };
6225
+ }
6226
+ function consumeCodexJsonRpcChunk(input) {
6227
+ let buffer = input.buffer + input.chunk;
6228
+ if (Buffer.byteLength(buffer) > MAX_JSON_RPC_LINE_BYTES) {
6229
+ input.rejectPending(/* @__PURE__ */ new Error("Codex app-server response exceeded its bound."));
6230
+ input.kill();
6231
+ return "";
6232
+ }
6233
+ while (true) {
6234
+ const newline = buffer.indexOf("\n");
6235
+ if (newline < 0) return buffer;
6236
+ const line = buffer.slice(0, newline).trim();
6237
+ buffer = buffer.slice(newline + 1);
6238
+ if (!line) continue;
6239
+ let message;
6240
+ try {
6241
+ message = JSON.parse(line);
6242
+ } catch {
6243
+ input.rejectPending(/* @__PURE__ */ new Error("Codex app-server returned invalid JSON."));
6244
+ input.kill();
6245
+ return "";
6246
+ }
6247
+ settleCodexJsonRpcResponse(message, input.pending);
6248
+ }
6249
+ }
6250
+ function settleCodexJsonRpcResponse(message, pending) {
6251
+ if (!isRecord(message) || typeof message.id !== "number") return;
6252
+ const request = pending.get(message.id);
6253
+ if (!request) return;
6254
+ pending.delete(message.id);
6255
+ clearTimeout(request.timer);
6256
+ if (isRecord(message.error)) {
6257
+ request.reject(new Error(text(message.error.message) ?? "Codex app-server request failed."));
6258
+ return;
6259
+ }
6260
+ request.resolve(message.result);
6261
+ }
6262
+ function isRecord(value) {
6263
+ return Boolean(value && typeof value === "object" && !Array.isArray(value));
6264
+ }
6265
+ function text(value) {
6266
+ return typeof value === "string" && value.trim() ? value.trim() : null;
6267
+ }
6268
+ //#endregion
6123
6269
  //#region src/runtime/dispatch-space-action-context.ts
6124
6270
  const OPENMELD_SPACE_ACTION_CONTEXT_PATH_ENV = "OPENMELD_SPACE_ACTION_CONTEXT_PATH";
6125
6271
  /** The local action context is known expired/closed/mismatched: a new ordinary action must be rejected, never recorded. */
@@ -6603,6 +6749,6 @@ function prependPathEntry(input) {
6603
6749
  return [input.nextEntry, ...dedupedEntries].join(delimiter);
6604
6750
  }
6605
6751
  //#endregion
6606
- export { readComputerFileAccessPolicy as $, isTargetPickerState as $t, AgentActivitySubmissionResultsMismatchError as A, buildPublicSpaceEntryPath as At, didAgentControllerCommandFingerprintRemainStable as B, buildSpaceRoundSignalPublication as Bt, buildAgentActivityEvent as C, acceptOrganizationJoinLinkBodySchema as Cn, updateSpaceLastSeenTs as Ct, drainAgentActivityHookInbox as D, revokeOrganizationJoinLinkResponseSchema as Dn, SpaceComposerSubmissionError as Dt, readCodexSessionTitles as E, organizationJoinLinkManagementQuerySchema as En, writeSpaceRecentMentionProfileIds as Et, removeProjectOutbox as F, buildSpaceMemberAgentPresencePresentation as Ft, recordAgentControllerInterfaceProbeFailure as G, createSpaceMemberIdentityIndex as Gt, readLastKnownAgentControllerUsageLimits as H, closeMentionPickerState as Ht, readRecentAgentActivityHookStatus as I, buildSpaceMentionProfileIndex as It, resolveAgentControllerCommandFingerprint as J, extractMentionAuthoringPrefix as Jt, recordAgentControllerInterfaceProbeSuccess as K, createSpaceTargetCatalog as Kt, createServiceGitEnvironment as L, buildSpaceMessageReadRelationSummary as Lt, deferAgentActivityOutbox as M, buildSignalIndex as Mt, readAgentActivityOutboxHealth as N, buildSignalMessageReadProjection as Nt, enqueueAgentActivityHookEvent as O, buildDispatchResultMessageReadProjection as Ot, readDueAgentActivityOutbox as P, buildSignalReplyWorkflowProjection as Pt, ComputerFileAccessStoreError as Q, isRelationPickerState as Qt, buildAgentControllerInterfaceKeeperKey as R, buildSpaceProfileAddPlan as Rt, resolveOpenCodeDatabasePath as S, cliJsonSkillsShowEnvelopeSchema as Sn, toSpaceConfigListIntegrityError as St, normalizeSharedSessionTitle as T, organizationJoinLinkErrorResponseSchema as Tn, writeSpaceCacheDeletionNoticeState as Tt, readLastSuccessfulAgentControllerInterfaceCheckAt as U, collectResolvedSpaceMentions as Ut, readLastKnownAgentControllerAuthSnapshot as V, buildUpdatesReplyWorkflowProjection as Vt, readReusableAgentControllerInterfaceSnapshot as W, createDispatchContinuationSpaceAccessContext as Wt, emitDaemonDispatchJournalEvent as X, getSpaceAccessPassword as Xt, resolveNextRuntimeAgentControllerReportSyncAtMs as Y, formatRemovedCcRelationMessage as Yt, readRecentDaemonDispatchJournalEvents as Z, getSpaceAccessRequestContext as Zt, collectObservedSessionWorkingDirectories as _, cliJsonSkillsAddEnvelopeSchema as _n, readSpaceConfig as _t, DispatchSpaceActionClosedError as a, prepareSpaceComposerSubmission as an, buildDispatchPromptPlan as at, readOpenCodeSessionRows as b, cliJsonSkillsLoadEnvelopeSchema as bn, removeSpaceConfig as bt, createDispatchSpaceActionContext as c, resolveSpaceMemberAgentOwnerWakeDiagnosticsView as cn, resolveBootstrapSpaceOwnerProfileId as ct, readDispatchSpaceActionRecord as d, DISPATCH_OWNED_RUNTIME_MODE as dn, projectSpaceProfileCache as dt, isWakeClosingSystemNoticeType as en, resolveComputerFileAccessStorePath as et, supersedeDispatchSpaceActionRecordForReconsideration as f, DISPATCH_SPACE_ACTION_CLI_FALLBACK_COMMAND as fn, LocalSpaceStateIntegrityError as ft, sendDaemonFrame as g, cliJsonSkillsAddAllEnvelopeSchema as gn, readSpaceCacheDeletionNoticeState as gt, parseDaemonFrame as h, cliJsonOutputEnvelopeSchema as hn, listSpaceConfigs as ht, readDispatchOwnedRuntimeGuard as i, openTargetPickerState as in, buildDispatchCorrelation as it, applyAgentActivitySubmissionResults as j, buildPublicSpaceEntryUrl as jt, removeProjectInbox as k, buildDispatchResultReplyWorkflowProjection as kt, readDispatchSpaceActionContextForReceiptFromEnv as l, returnToTargetPickerState as ln, resolveBootstrapTargetProfileContext as lt, handleDaemonTransportFrame as m, cliJsonErrorEnvelopeSchema as mn, isLocalSpaceStateCorruptResult as mt, assertDispatchOwnedRuntimeServiceMutationAllowed as n, listSpaceMentionRelationChoices as nn, isSameOrDescendantPath as nt, DispatchSpaceActionRejectedError as o, prepareSpaceFileOnlySubmission as on, buildDispatchSessionTitle as ot, writeDispatchSpaceActionRecord as p, OPENMELD_DISPATCH_RUNTIME_MODE_ENV as pn, inspectSpaceCacheFile as pt, recordAgentControllerUsageLimitsObservation as q, enterRelationPickerState as qt, buildDispatchOwnedRuntimeEnv as r, listSpaceMentionSuggestions as rn, buildDispatchBootstrapTemplateFacts as rt, OPENMELD_SPACE_ACTION_CONTEXT_PATH_ENV as s, resolveNextRecentMentionProfileIdsForQueuedText as sn, parseDispatchTask as st, assertDispatchOwnedRuntimePublicWriteAllowed as t, listSpaceMemberDirectorySendTargets as tn, updateComputerFileAccessPolicy as tt, readDispatchSpaceActionContextFromEnv as u, updateAuthoredMentionRanges as un, resolveDispatchMentionSourceContext as ut, scanLocalAgentActivity as v, cliJsonSkillsAddPreviewEnvelopeSchema as vn, readSpaceLastSeenTs as vt, resolveObservedAgentActivityBinding as w, getOrganizationJoinLinkResponseSchema as wn, upsertSpaceConfig as wt, resolveOpenCodeAuthPath as x, cliJsonSkillsScanEnvelopeSchema as xn, toLocalSpaceStateIntegrityError as xt, startAgentActivityTranscriptWatchers as y, cliJsonSkillsListEnvelopeSchema as yn, readSpaceRecentMentionProfileIds as yt, consumeArmedAgentControllerInterfaceReprobe as z, buildSpaceRoundReadProjection as zt };
6752
+ export { ComputerFileAccessStoreError as $, isRelationPickerState as $t, removeProjectInbox as A, buildDispatchResultReplyWorkflowProjection as At, consumeArmedAgentControllerInterfaceReprobe as B, buildSpaceRoundReadProjection as Bt, resolveOpenCodeDatabasePath as C, cliJsonSkillsShowEnvelopeSchema as Cn, toSpaceConfigListIntegrityError as Ct, readCodexSessionTitles as D, organizationJoinLinkManagementQuerySchema as Dn, writeSpaceRecentMentionProfileIds as Dt, normalizeSharedSessionTitle as E, organizationJoinLinkErrorResponseSchema as En, writeSpaceCacheDeletionNoticeState as Et, readDueAgentActivityOutbox as F, buildSignalReplyWorkflowProjection as Ft, readReusableAgentControllerInterfaceSnapshot as G, createDispatchContinuationSpaceAccessContext as Gt, readLastKnownAgentControllerAuthSnapshot as H, buildUpdatesReplyWorkflowProjection as Ht, removeProjectOutbox as I, buildSpaceMemberAgentPresencePresentation as It, recordAgentControllerUsageLimitsObservation as J, enterRelationPickerState as Jt, recordAgentControllerInterfaceProbeFailure as K, createSpaceMemberIdentityIndex as Kt, readRecentAgentActivityHookStatus as L, buildSpaceMentionProfileIndex as Lt, applyAgentActivitySubmissionResults as M, buildPublicSpaceEntryUrl as Mt, deferAgentActivityOutbox as N, buildSignalIndex as Nt, drainAgentActivityHookInbox as O, revokeOrganizationJoinLinkResponseSchema as On, SpaceComposerSubmissionError as Ot, readAgentActivityOutboxHealth as P, buildSignalMessageReadProjection as Pt, readRecentDaemonDispatchJournalEvents as Q, getSpaceAccessRequestContext as Qt, createServiceGitEnvironment as R, buildSpaceMessageReadRelationSummary as Rt, resolveOpenCodeAuthPath as S, cliJsonSkillsScanEnvelopeSchema as Sn, toLocalSpaceStateIntegrityError as St, resolveObservedAgentActivityBinding as T, getOrganizationJoinLinkResponseSchema as Tn, upsertSpaceConfig as Tt, readLastKnownAgentControllerUsageLimits as U, closeMentionPickerState as Ut, didAgentControllerCommandFingerprintRemainStable as V, buildSpaceRoundSignalPublication as Vt, readLastSuccessfulAgentControllerInterfaceCheckAt as W, collectResolvedSpaceMentions as Wt, resolveNextRuntimeAgentControllerReportSyncAtMs as X, formatRemovedCcRelationMessage as Xt, resolveAgentControllerCommandFingerprint as Y, extractMentionAuthoringPrefix as Yt, emitDaemonDispatchJournalEvent as Z, getSpaceAccessPassword as Zt, sendDaemonFrame as _, cliJsonSkillsAddAllEnvelopeSchema as _n, readSpaceCacheDeletionNoticeState as _t, DispatchSpaceActionClosedError as a, openTargetPickerState as an, buildDispatchCorrelation as at, startAgentActivityTranscriptWatchers as b, cliJsonSkillsListEnvelopeSchema as bn, readSpaceRecentMentionProfileIds as bt, createDispatchSpaceActionContext as c, resolveNextRecentMentionProfileIdsForQueuedText as cn, parseDispatchTask as ct, readDispatchSpaceActionRecord as d, updateAuthoredMentionRanges as dn, resolveDispatchMentionSourceContext as dt, isTargetPickerState as en, readComputerFileAccessPolicy as et, supersedeDispatchSpaceActionRecordForReconsideration as f, DISPATCH_OWNED_RUNTIME_MODE as fn, projectSpaceProfileCache as ft, parseDaemonFrame as g, cliJsonOutputEnvelopeSchema as gn, listSpaceConfigs as gt, handleDaemonTransportFrame as h, cliJsonErrorEnvelopeSchema as hn, isLocalSpaceStateCorruptResult as ht, readDispatchOwnedRuntimeGuard as i, listSpaceMentionSuggestions as in, buildDispatchBootstrapTemplateFacts as it, AgentActivitySubmissionResultsMismatchError as j, buildPublicSpaceEntryPath as jt, enqueueAgentActivityHookEvent as k, buildDispatchResultMessageReadProjection as kt, readDispatchSpaceActionContextForReceiptFromEnv as l, resolveSpaceMemberAgentOwnerWakeDiagnosticsView as ln, resolveBootstrapSpaceOwnerProfileId as lt, createCodexJsonRpcClient as m, OPENMELD_DISPATCH_RUNTIME_MODE_ENV as mn, inspectSpaceCacheFile as mt, assertDispatchOwnedRuntimeServiceMutationAllowed as n, listSpaceMemberDirectorySendTargets as nn, updateComputerFileAccessPolicy as nt, DispatchSpaceActionRejectedError as o, prepareSpaceComposerSubmission as on, buildDispatchPromptPlan as ot, writeDispatchSpaceActionRecord as p, DISPATCH_SPACE_ACTION_CLI_FALLBACK_COMMAND as pn, LocalSpaceStateIntegrityError as pt, recordAgentControllerInterfaceProbeSuccess as q, createSpaceTargetCatalog as qt, buildDispatchOwnedRuntimeEnv as r, listSpaceMentionRelationChoices as rn, isSameOrDescendantPath as rt, OPENMELD_SPACE_ACTION_CONTEXT_PATH_ENV as s, prepareSpaceFileOnlySubmission as sn, buildDispatchSessionTitle as st, assertDispatchOwnedRuntimePublicWriteAllowed as t, isWakeClosingSystemNoticeType as tn, resolveComputerFileAccessStorePath as tt, readDispatchSpaceActionContextFromEnv as u, returnToTargetPickerState as un, resolveBootstrapTargetProfileContext as ut, collectObservedSessionWorkingDirectories as v, cliJsonSkillsAddEnvelopeSchema as vn, readSpaceConfig as vt, buildAgentActivityEvent as w, acceptOrganizationJoinLinkBodySchema as wn, updateSpaceLastSeenTs as wt, readOpenCodeSessionRows as x, cliJsonSkillsLoadEnvelopeSchema as xn, removeSpaceConfig as xt, scanLocalAgentActivity as y, cliJsonSkillsAddPreviewEnvelopeSchema as yn, readSpaceLastSeenTs as yt, buildAgentControllerInterfaceKeeperKey as z, buildSpaceProfileAddPlan as zt };
6607
6753
 
6608
- //# sourceMappingURL=dispatch-owned-runtime-dLHDTL7f.js.map
6754
+ //# sourceMappingURL=dispatch-owned-runtime-g2lLeYtx.js.map