openmeld 0.3.240 → 0.3.241

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 (93) hide show
  1. package/dist/{add-me-membership-7tGVrYxL.js → add-me-membership-BU2dHctF.js} +2 -2
  2. package/dist/{add-me-membership-7tGVrYxL.js.map → add-me-membership-BU2dHctF.js.map} +1 -1
  3. package/dist/{agents-DBYRT3tv.js → agents-BCbxo9ej.js} +9 -9
  4. package/dist/{agents-DBYRT3tv.js.map → agents-BCbxo9ej.js.map} +1 -1
  5. package/dist/{api-client-foundation-BawOr_Me.js → api-client-foundation-Dbc5MXyW.js} +3 -3
  6. package/dist/{api-client-foundation-BawOr_Me.js.map → api-client-foundation-Dbc5MXyW.js.map} +1 -1
  7. package/dist/{api-client-foundation-D4d0zKkj.js → api-client-foundation-uYxH6diU.js} +1 -1
  8. package/dist/{auth-session-BTRu2Kc5.js → auth-session-Injt39gv.js} +2 -2
  9. package/dist/{auth-session-BTRu2Kc5.js.map → auth-session-Injt39gv.js.map} +1 -1
  10. package/dist/auth-session-j1EhJkpg2.js +4 -0
  11. package/dist/{channel-BxlX3o3i.js → channel-CxgYezuw.js} +3 -3
  12. package/dist/{channel-BxlX3o3i.js.map → channel-CxgYezuw.js.map} +1 -1
  13. package/dist/{command-De0etxkZ.js → command-BEWvHfNy.js} +15 -15
  14. package/dist/{command-De0etxkZ.js.map → command-BEWvHfNy.js.map} +1 -1
  15. package/dist/{computer-connection-Sntn_-XO.js → computer-connection-CSa8O0op.js} +2 -2
  16. package/dist/{computer-connection-Sntn_-XO.js.map → computer-connection-CSa8O0op.js.map} +1 -1
  17. package/dist/{computer-connection-review-7dITXNrp.js → computer-connection-review-B3jM81-q.js} +5 -5
  18. package/dist/{computer-connection-review-7dITXNrp.js.map → computer-connection-review-B3jM81-q.js.map} +1 -1
  19. package/dist/{computer-disconnect-D4KjKURR.js → computer-disconnect-De7aDtz9.js} +7 -7
  20. package/dist/{computer-disconnect-D4KjKURR.js.map → computer-disconnect-De7aDtz9.js.map} +1 -1
  21. package/dist/{computer-setup-continuation-Wrw13eZn.js → computer-setup-continuation-DUDXeWyZ.js} +3 -3
  22. package/dist/{computer-setup-continuation-Wrw13eZn.js.map → computer-setup-continuation-DUDXeWyZ.js.map} +1 -1
  23. package/dist/{daemon-device-id-D7lbw6c4.js → daemon-device-id-CAKHWLK9.js} +4 -4
  24. package/dist/{daemon-device-id-D7lbw6c4.js.map → daemon-device-id-CAKHWLK9.js.map} +1 -1
  25. package/dist/{daemon-lifecycle-journal-DGJEfJJV.js → daemon-lifecycle-journal-txRGG09R.js} +3 -3
  26. package/dist/{daemon-lifecycle-journal-DGJEfJJV.js.map → daemon-lifecycle-journal-txRGG09R.js.map} +1 -1
  27. package/dist/{daemon-service-runtime-C1JWxsWw.js → daemon-service-runtime-DVou-9gk.js} +2 -2
  28. package/dist/{daemon-service-runtime-C1JWxsWw.js.map → daemon-service-runtime-DVou-9gk.js.map} +1 -1
  29. package/dist/{daemon-service-update-coordinator-BTLSv327.js → daemon-service-update-coordinator-j-NJ6SG6.js} +9 -9
  30. package/dist/{daemon-service-update-coordinator-BTLSv327.js.map → daemon-service-update-coordinator-j-NJ6SG6.js.map} +1 -1
  31. package/dist/{dispatch-owned-runtime-BAvm8fPb.js → dispatch-owned-runtime-Ds0NjZbf.js} +10 -6
  32. package/dist/dispatch-owned-runtime-Ds0NjZbf.js.map +1 -0
  33. package/dist/{dist-BytcJRwx.js → dist-BE0dKSoc.js} +1225 -802
  34. package/dist/dist-BE0dKSoc.js.map +1 -0
  35. package/dist/{dist-GOicky_R.js → dist-D4nEGVsQ.js} +1 -1
  36. package/dist/{dual-view-guide-catalog-Cpu4NNXt.js → dual-view-guide-catalog-Bm3heywF.js} +3 -3
  37. package/dist/{dual-view-guide-catalog-Cpu4NNXt.js.map → dual-view-guide-catalog-Bm3heywF.js.map} +1 -1
  38. package/dist/{elapsed-time-Db-ZMRoB.js → elapsed-time-8Z_hiMHG.js} +3 -3
  39. package/dist/{elapsed-time-Db-ZMRoB.js.map → elapsed-time-8Z_hiMHG.js.map} +1 -1
  40. package/dist/{entry-DBhL4ZRa.js → entry-CRNdcPn2.js} +6 -6
  41. package/dist/{entry-DBhL4ZRa.js.map → entry-CRNdcPn2.js.map} +1 -1
  42. package/dist/{installation-inventory-zfLJh479.js → installation-inventory-C2gqd8Ui.js} +3 -3
  43. package/dist/{installation-inventory-zfLJh479.js.map → installation-inventory-C2gqd8Ui.js.map} +1 -1
  44. package/dist/{installer-7vF9Vexz.js → installer-C5wRsjRo.js} +2 -2
  45. package/dist/{installer-7vF9Vexz.js.map → installer-C5wRsjRo.js.map} +1 -1
  46. package/dist/{meta-api-BADovRJo.js → meta-api-f30I0cYW.js} +5 -5
  47. package/dist/{meta-api-BADovRJo.js.map → meta-api-f30I0cYW.js.map} +1 -1
  48. package/dist/{openmeld-maintenance-worker-Bk8iJrZe.js → openmeld-maintenance-worker-DO2-9bPr.js} +9 -9
  49. package/dist/{openmeld-maintenance-worker-Bk8iJrZe.js.map → openmeld-maintenance-worker-DO2-9bPr.js.map} +1 -1
  50. package/dist/{openmeld-BxJZzTQQ.js → openmeld-pa6CFD0L.js} +101 -35
  51. package/dist/openmeld-pa6CFD0L.js.map +1 -0
  52. package/dist/{openmeld-tools-update-join-QLXJ0nhz.js → openmeld-tools-update-join-7k8F3WoX.js} +4 -4
  53. package/dist/{openmeld-tools-update-join-QLXJ0nhz.js.map → openmeld-tools-update-join-7k8F3WoX.js.map} +1 -1
  54. package/dist/openmeld.js +4 -4
  55. package/dist/{prepare-provider-runtime-BMV0ay2U.js → prepare-provider-runtime-CRKT1qfE.js} +23 -15
  56. package/dist/prepare-provider-runtime-CRKT1qfE.js.map +1 -0
  57. package/dist/{prepare-session-executor-DqKiH0W-.js → prepare-session-executor-HgLhIpBN.js} +18 -18
  58. package/dist/{prepare-session-executor-DqKiH0W-.js.map → prepare-session-executor-HgLhIpBN.js.map} +1 -1
  59. package/dist/{process-channel-QRugdtrY.js → process-channel-Ceb-ha2V.js} +2 -2
  60. package/dist/{process-channel-QRugdtrY.js.map → process-channel-Ceb-ha2V.js.map} +1 -1
  61. package/dist/{runtime-krIc08XW.js → runtime-DMlmaA44.js} +20 -18
  62. package/dist/{runtime-krIc08XW.js.map → runtime-DMlmaA44.js.map} +1 -1
  63. package/dist/{runtime-agent-controller-reporting-submission-B5oPP2LR.js → runtime-agent-controller-reporting-submission-BYU0eXKb.js} +8 -8
  64. package/dist/{runtime-agent-controller-reporting-submission-B5oPP2LR.js.map → runtime-agent-controller-reporting-submission-BYU0eXKb.js.map} +1 -1
  65. package/dist/{runtime-transport-BVCHi4qM.js → runtime-transport-BPK70mkB.js} +65 -7
  66. package/dist/runtime-transport-BPK70mkB.js.map +1 -0
  67. package/dist/{service-D-9aXzla.js → service-BLA4eCyA.js} +19 -18
  68. package/dist/service-BLA4eCyA.js.map +1 -0
  69. package/dist/{service-account-authorization-C1CdX1P3.js → service-account-authorization-C6wZHidB.js} +2 -2
  70. package/dist/{service-account-authorization-C1CdX1P3.js.map → service-account-authorization-C6wZHidB.js.map} +1 -1
  71. package/dist/{service-account-control-DcTdeEqI.js → service-account-control-xIDWMYp7.js} +8 -8
  72. package/dist/{service-account-control-DcTdeEqI.js.map → service-account-control-xIDWMYp7.js.map} +1 -1
  73. package/dist/{service-control-capabilities-B-VAPKAy.js → service-control-capabilities-9SQY-44h.js} +3 -3
  74. package/dist/{service-control-capabilities-B-VAPKAy.js.map → service-control-capabilities-9SQY-44h.js.map} +1 -1
  75. package/dist/{service-control-capabilities-DxF7oTYb.js → service-control-capabilities-C4rpfc9B.js} +1 -1
  76. package/dist/{state-DddjOWBm.js → state-BNcCVukg.js} +2 -2
  77. package/dist/{state-DddjOWBm.js.map → state-BNcCVukg.js.map} +1 -1
  78. package/dist/{updates-api-TVlrczrO.js → updates-api-CTf05SZn.js} +162 -36
  79. package/dist/updates-api-CTf05SZn.js.map +1 -0
  80. package/dist/{upgrade-Bb8Mv01-.js → upgrade-B17yGEBC.js} +8 -8
  81. package/dist/{upgrade-Bb8Mv01-.js.map → upgrade-B17yGEBC.js.map} +1 -1
  82. package/dist/upgrade-BoX1y1zH.js +4 -0
  83. package/package.json +12 -12
  84. package/skills/openmeld-cli/playbooks/plugins.md +11 -3
  85. package/dist/auth-session-D2f7Lud02.js +0 -4
  86. package/dist/dispatch-owned-runtime-BAvm8fPb.js.map +0 -1
  87. package/dist/dist-BytcJRwx.js.map +0 -1
  88. package/dist/openmeld-BxJZzTQQ.js.map +0 -1
  89. package/dist/prepare-provider-runtime-BMV0ay2U.js.map +0 -1
  90. package/dist/runtime-transport-BVCHi4qM.js.map +0 -1
  91. package/dist/service-D-9aXzla.js.map +0 -1
  92. package/dist/updates-api-TVlrczrO.js.map +0 -1
  93. package/dist/upgrade-n4gQvHoE.js +0 -4
@@ -1,15 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { $n as resolveExecutablePathsOnPath, On as resolveInstalledClaudeCodeLaunchCandidates, Tt as withAgentActivityLocalStateLock, Xn as resolveDispatchSpaceActionMcpServer, Zn as buildCliLaunchInvocation, er as listAgentControllerSupervisedProcessIds, ft as listProjectBindings, hn as resolveInstalledOpenCodeLaunchCandidates, ht as removeAgentActivityBindingsWhileDeliveryLocked, rr as isDispatchSpaceActionDeliveryOnly, vn as resolveInstalledGrokBuildLaunchCandidates, vt as resolveProjectBindingForPath, wt as withAgentActivityDeliveryLock, xn as resolveInstalledCodexLaunchCandidates } from "./prepare-provider-runtime-BMV0ay2U.js";
3
+ import { $n as resolveExecutablePathsOnPath, On as resolveInstalledClaudeCodeLaunchCandidates, Tt as withAgentActivityLocalStateLock, Xn as resolveDispatchSpaceActionMcpServer, Zn as buildCliLaunchInvocation, er as listAgentControllerSupervisedProcessIds, ft as listProjectBindings, hn as resolveInstalledOpenCodeLaunchCandidates, ht as removeAgentActivityBindingsWhileDeliveryLocked, rr as isDispatchSpaceActionDeliveryOnly, vn as resolveInstalledGrokBuildLaunchCandidates, vt as resolveProjectBindingForPath, wt as withAgentActivityDeliveryLock, xn as resolveInstalledCodexLaunchCandidates } from "./prepare-provider-runtime-CRKT1qfE.js";
4
4
  import { g as toSpaceUpdatesUrl } from "./urls-CY2uzH2-.js";
5
5
  import { F as resolveOpenMeldRootDir, k as organizationSkillReleaseDir, t as OPENMELD_HOME_ENV_KEY } from "./paths-De9xdA2h.js";
6
- import { Cr as mutateSpaceTaskBodySchema, Kt as createDirectMessageApi, Li as signalTextEnvelopeSchema, Lt as createAgentActivityApi, Sr as createSpaceTaskBodySchema, Tr as spaceTaskMutationReceiptSchema, Wr as organizationSkillBundleSchema, Xr as stringifyOrganizationSkillBundleCanonicalJson, fn as createRuntimeReportingApi, gi as observedLocalAgentSessionSchema, ir as OPENMELD_HEADER_SPACE_ADDRESSING_VERSION, lr as openDirectMessageSpaceBodySchema, nn as createOrganizationDocumentsApi, oi as submitAgentControllerTaskLifecycleEventItemSchema, rn as createOrganizationSkillsApi, sr as getSpaceUpdatesResponseSchema, t as OpenMeldApiClientHttpError, wr as spaceTaskIdSchema } from "./dist-BytcJRwx.js";
7
- import { Cr as executionContextTaskSchema, In as spaceFileRevisionNumberSchema, Mn as spaceFileEntryIdSchema, an as SPACE_WORK_MAX_BYTES, bn as readSpaceFileTextResponseSchema, cn as spaceWorkSelectionSchema, ln as spaceWorkingCopyResultSchema, sn as spaceWorkRelativePathSchema, xr as executionContextAssignmentSchema, zn as spaceMessageFileReferenceSchema } from "./runtime-transport-BVCHi4qM.js";
6
+ import { $r as stringifyOrganizationSkillBundleCanonicalJson, Bi as signalTextEnvelopeSchema, Dr as spaceTaskMutationReceiptSchema, Er as spaceTaskIdSchema, Kt as createDirectMessageApi, Lt as createAgentActivityApi, Mr as spaceThreadEvidenceResponseSchema, Qn as buildSpaceThreadEvidence, Tr as mutateSpaceTaskBodySchema, Zn as buildSpaceMessageEvidence, dr as openDirectMessageSpaceBodySchema, fn as createRuntimeReportingApi, li as submitAgentControllerTaskLifecycleEventItemSchema, lr as getSpaceUpdatesResponseSchema, nn as createOrganizationDocumentsApi, or as OPENMELD_HEADER_SPACE_ADDRESSING_VERSION, qr as organizationSkillBundleSchema, rn as createOrganizationSkillsApi, t as OpenMeldApiClientHttpError, wr as createSpaceTaskBodySchema, yi as observedLocalAgentSessionSchema } from "./dist-BE0dKSoc.js";
7
+ import { Er as executionContextTaskSchema, In as spaceFileRevisionNumberSchema, Mn as spaceFileEntryIdSchema, an as SPACE_WORK_MAX_BYTES, bn as readSpaceFileTextResponseSchema, cn as spaceWorkSelectionSchema, ln as spaceWorkingCopyResultSchema, qn as spaceThreadEvidenceRequestSchema, sn as spaceWorkRelativePathSchema, wr as executionContextAssignmentSchema, zn as spaceMessageFileReferenceSchema } from "./runtime-transport-BPK70mkB.js";
8
8
  import { O as openMeldRuntimeProfileIdSchema } from "./control-plane-QqGL-jtT.js";
9
- import { d as getAuthSessionState } from "./auth-session-BTRu2Kc5.js";
10
- import { B as resolveRuntimeContext, U as requireOpenMeldProfile, o as dirnamePath } from "./daemon-device-id-D7lbw6c4.js";
11
- import { A as AgentActivitySubmissionResultsMismatchError, At as buildPublicSpaceEntryPath, D as drainAgentActivityHookInbox, F as removeProjectOutbox, I as readRecentAgentActivityHookStatus, L as createServiceGitEnvironment, M as deferAgentActivityOutbox, N as readAgentActivityOutboxHealth, P as readDueAgentActivityOutbox, S as resolveOpenCodeDatabasePath, T as normalizeSharedSessionTitle, a as DispatchSpaceActionClosedError, b as readOpenCodeSessionRows, d as readDispatchSpaceActionRecord, i as readDispatchOwnedRuntimeGuard, j as applyAgentActivitySubmissionResults, k as removeProjectInbox, l as readDispatchSpaceActionContextForReceiptFromEnv, mn as cliJsonErrorEnvelopeSchema, o as DispatchSpaceActionRejectedError, p as writeDispatchSpaceActionRecord, s as OPENMELD_SPACE_ACTION_CONTEXT_PATH_ENV, u as readDispatchSpaceActionContextFromEnv, v as scanLocalAgentActivity, w as resolveObservedAgentActivityBinding, y as startAgentActivityTranscriptWatchers } from "./dispatch-owned-runtime-BAvm8fPb.js";
12
- import { f as prepareRequestedSpaceSendFiles, h as spaceSendRequestReceiptSchema, l as parseJsonResponse, m as createCliSpaceApi, p as uploadPreparedSpaceFiles, s as readGatewayTextResponse, t as fetchSpaceMeta, u as resolveSpaceSendText } from "./meta-api-BADovRJo.js";
9
+ import { d as getAuthSessionState } from "./auth-session-Injt39gv.js";
10
+ import { B as resolveRuntimeContext, U as requireOpenMeldProfile, o as dirnamePath } from "./daemon-device-id-CAKHWLK9.js";
11
+ import { A as AgentActivitySubmissionResultsMismatchError, At as buildPublicSpaceEntryPath, D as drainAgentActivityHookInbox, F as removeProjectOutbox, I as readRecentAgentActivityHookStatus, L as createServiceGitEnvironment, M as deferAgentActivityOutbox, N as readAgentActivityOutboxHealth, P as readDueAgentActivityOutbox, S as resolveOpenCodeDatabasePath, T as normalizeSharedSessionTitle, a as DispatchSpaceActionClosedError, b as readOpenCodeSessionRows, d as readDispatchSpaceActionRecord, i as readDispatchOwnedRuntimeGuard, j as applyAgentActivitySubmissionResults, k as removeProjectInbox, l as readDispatchSpaceActionContextForReceiptFromEnv, mn as cliJsonErrorEnvelopeSchema, o as DispatchSpaceActionRejectedError, p as writeDispatchSpaceActionRecord, s as OPENMELD_SPACE_ACTION_CONTEXT_PATH_ENV, u as readDispatchSpaceActionContextFromEnv, v as scanLocalAgentActivity, w as resolveObservedAgentActivityBinding, y as startAgentActivityTranscriptWatchers } from "./dispatch-owned-runtime-Ds0NjZbf.js";
12
+ import { f as prepareRequestedSpaceSendFiles, h as spaceSendRequestReceiptSchema, l as parseJsonResponse, m as createCliSpaceApi, p as uploadPreparedSpaceFiles, s as readGatewayTextResponse, t as fetchSpaceMeta, u as resolveSpaceSendText } from "./meta-api-f30I0cYW.js";
13
13
  import { d as runWithHeldLock, s as releaseLock, t as acquireLock } from "./lock-BMI00i2F.js";
14
14
  import { a as resolveBaseUrl } from "./base-url-0AoeTi3w.js";
15
15
  import { n as writeDaemonLocalStateFile, t as readDaemonLocalStateFile } from "./daemon-local-state-file-jOXuXrky.js";
@@ -17,7 +17,7 @@ import { _ as daemonRuntimeStateRootPath } from "./daemon-state-Dte9re5V.js";
17
17
  import { i as readDaemonServiceContract } from "./daemon-service-contract-COPKbCy_.js";
18
18
  import { l as resolveUserFacingCliEntryCommand, n as formatOpenMeldCliCommand } from "./cli-entry-command-CR_9QU1i.js";
19
19
  import { o as outLine, t as createPresenter } from "./presenter-BcxiQyJg.js";
20
- import { d as buildOpenMeldRequestContextFromProfile, l as canAttachAuthTokenToRequest, n as fetchSpaceRequestWithTimeout, s as buildOpenMeldRequestContextHeadersWithAuth, t as createCliApiClientFoundation } from "./api-client-foundation-BawOr_Me.js";
20
+ import { d as buildOpenMeldRequestContextFromProfile, l as canAttachAuthTokenToRequest, n as fetchSpaceRequestWithTimeout, s as buildOpenMeldRequestContextHeadersWithAuth, t as createCliApiClientFoundation } from "./api-client-foundation-Dbc5MXyW.js";
21
21
  import { createHash, randomBytes, randomUUID } from "node:crypto";
22
22
  import { homedir } from "node:os";
23
23
  import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
@@ -83,6 +83,13 @@ const runtimeReportingHealthStateSchema = z$1.strictObject({
83
83
  providerConversationProof: runtimeReportingChannelHealthSchema
84
84
  });
85
85
  //#endregion
86
+ //#region ../../packages/schemas/dist/schemas/space-mesh/space-message-evidence.js
87
+ const spaceMessageEvidenceRequestSchema = z$1.strictObject({
88
+ sourceSignalId: z$1.string().trim().min(1).max(256),
89
+ version: z$1.string().regex(/^sha256:[0-9a-f]{64}$/u).optional(),
90
+ offset: z$1.int().nonnegative().max(1e6).optional()
91
+ }).refine((value) => !value.offset || value.version !== void 0, { message: "A continuation must retain the source version." });
92
+ //#endregion
86
93
  //#region ../../packages/schemas/dist/schemas/space-mesh/dispatch-project-shell.js
87
94
  const dispatchProjectShellInputSchema = z$1.strictObject({ command: z$1.string().trim().min(1).max(16e3) });
88
95
  const dispatchProjectShellResultSchema = z$1.strictObject({
@@ -4714,26 +4721,12 @@ async function readDispatchSpaceFile(input) {
4714
4721
  //#region src/space/dispatch-history-read.ts
4715
4722
  /** Read the current Wake's bounded Space history through the existing member API. */
4716
4723
  async function readDispatchSpaceHistory(env = process.env) {
4717
- if (env["OPENMELD_DISPATCH_RUNTIME_MODE"] !== "dispatch-owned-runtime") throw new Error("Space history tools require an active OpenMeld dispatch runtime.");
4718
- const context = readDispatchSpaceActionContextFromEnv(env);
4719
- const profile = await requireOpenMeldProfile({
4720
- openMeldProfileId: context.targetProfileId,
4721
- persistSelection: false,
4722
- authAction: "reading the current Wake's Space history"
4723
- });
4724
- if (profile.openMeldProfileId !== context.targetProfileId || profile.profileKind !== "agent") throw new Error("The Space history reader does not match the current Agent.");
4725
- const result = await createCliSpaceApi(await resolveBaseUrl()).listSignals({
4726
- spaceId: context.spaceId,
4727
- requestContext: buildOpenMeldRequestContextFromProfile({ openMeldProfile: profile }),
4728
- query: {
4729
- aroundSignalId: context.sourceEventId,
4730
- beforeCount: 20,
4731
- afterCount: 0,
4732
- kinds: ["text"]
4733
- }
4734
- });
4735
- const current = readDispatchSpaceActionContextFromEnv(env);
4736
- if (current.contextId !== context.contextId || current.nonce !== context.nonce || current.spaceId !== context.spaceId || current.sourceEventId !== context.sourceEventId || current.targetProfileId !== context.targetProfileId) throw new Error("The dispatch context changed during the Space history read.");
4724
+ const { context, result } = await readDispatchSignals(env, (sourceSignalId) => ({
4725
+ aroundSignalId: sourceSignalId,
4726
+ beforeCount: 20,
4727
+ afterCount: 0,
4728
+ kinds: ["text"]
4729
+ }));
4737
4730
  const output = dispatchSpaceHistoryResultSchema.parse({
4738
4731
  spaceId: context.spaceId,
4739
4732
  sourceSignalId: context.sourceEventId,
@@ -4743,12 +4736,83 @@ async function readDispatchSpaceHistory(env = process.env) {
4743
4736
  nextCursor: result.nextCursor
4744
4737
  });
4745
4738
  const signals = output.signals.map((signal) => signalTextEnvelopeSchema.parse(signal));
4746
- if (signals.some((signal) => signal.spaceId !== context.spaceId)) throw new Error("The Space history response does not match the current Space.");
4747
4739
  return {
4748
4740
  ...output,
4749
4741
  signals
4750
4742
  };
4751
4743
  }
4744
+ async function readDispatchSpaceEvidence(input, env = process.env) {
4745
+ const request = spaceMessageEvidenceRequestSchema.parse(input);
4746
+ const { context, result } = await readDispatchSignals(env, () => ({
4747
+ aroundSignalId: request.sourceSignalId,
4748
+ beforeCount: 0,
4749
+ afterCount: 0,
4750
+ kinds: ["text"]
4751
+ }));
4752
+ const signal = result.signals.find((candidate) => candidate.id === request.sourceSignalId);
4753
+ if (!signal || signal.type !== "signal.text") throw new Error("space.evidence_unavailable: The requested message is unavailable.");
4754
+ return await buildSpaceMessageEvidence({
4755
+ ...request,
4756
+ spaceId: context.spaceId,
4757
+ signal: signalTextEnvelopeSchema.parse(signal)
4758
+ });
4759
+ }
4760
+ async function readDispatchSignals(env, query) {
4761
+ return await readDispatchSource(env, async ({ api, context, requestContext }) => {
4762
+ const result = await api.listSignals({
4763
+ spaceId: context.spaceId,
4764
+ requestContext,
4765
+ query: query(context.sourceEventId)
4766
+ });
4767
+ const signals = result.signals.map((signal) => signalTextEnvelopeSchema.parse(signal));
4768
+ if (signals.some((signal) => signal.spaceId !== context.spaceId)) throw new Error("The Space history response does not match the current Space.");
4769
+ return {
4770
+ ...result,
4771
+ signals
4772
+ };
4773
+ });
4774
+ }
4775
+ async function readDispatchSpaceThreadEvidence(value, env = process.env) {
4776
+ const input = spaceThreadEvidenceRequestSchema.parse(value);
4777
+ const { result } = await readDispatchSource(env, async ({ api, context, requestContext }) => {
4778
+ const selection = {
4779
+ spaceId: context.spaceId,
4780
+ requestContext,
4781
+ threadId: input.threadId
4782
+ };
4783
+ const thread = await api.getThread(selection);
4784
+ if (thread.thread.spaceId !== context.spaceId || thread.thread.threadId !== input.threadId) throw new Error("space.evidence_source_mismatch");
4785
+ const page = await api.listThreadSignals(selection);
4786
+ if (page.placements.some((placement) => placement.threadId !== input.threadId)) throw new Error("space.evidence_source_mismatch");
4787
+ return await buildSpaceThreadEvidence({
4788
+ ...input,
4789
+ thread: thread.thread,
4790
+ signals: page.signals
4791
+ });
4792
+ });
4793
+ return spaceThreadEvidenceResponseSchema.parse(result);
4794
+ }
4795
+ async function readDispatchSource(env, read) {
4796
+ if (env["OPENMELD_DISPATCH_RUNTIME_MODE"] !== "dispatch-owned-runtime") throw new Error("Space history tools require an active OpenMeld dispatch runtime.");
4797
+ const context = readDispatchSpaceActionContextFromEnv(env);
4798
+ const profile = await requireOpenMeldProfile({
4799
+ openMeldProfileId: context.targetProfileId,
4800
+ persistSelection: false,
4801
+ authAction: "reading the current Wake's Space history"
4802
+ });
4803
+ if (profile.openMeldProfileId !== context.targetProfileId || profile.profileKind !== "agent") throw new Error("The Space history reader does not match the current Agent.");
4804
+ const result = await read({
4805
+ api: createCliSpaceApi(await resolveBaseUrl()),
4806
+ context,
4807
+ requestContext: buildOpenMeldRequestContextFromProfile({ openMeldProfile: profile })
4808
+ });
4809
+ const current = readDispatchSpaceActionContextFromEnv(env);
4810
+ if (current.contextId !== context.contextId || current.nonce !== context.nonce || current.spaceId !== context.spaceId || current.sourceEventId !== context.sourceEventId || current.targetProfileId !== context.targetProfileId) throw new Error("The dispatch context changed during the Space history read.");
4811
+ return {
4812
+ context,
4813
+ result
4814
+ };
4815
+ }
4752
4816
  //#endregion
4753
4817
  //#region src/space/dispatch-knowledge-read.ts
4754
4818
  /** Existing member API, with the Agent identity and the Space's Organization. */
@@ -4826,9 +4890,9 @@ const SNAPSHOT_COUNT = 4;
4826
4890
  var DispatchReadResults = class {
4827
4891
  #snapshots = /* @__PURE__ */ new Map();
4828
4892
  #bytes = 0;
4829
- wrap(result) {
4893
+ wrap(result, revalidate) {
4830
4894
  if (result.isError) return result;
4831
- const value = result.structuredContent ?? JSON.parse(result.content.map((item) => item.text).join("\n"));
4895
+ const value = readValue(result);
4832
4896
  const complete = dispatchSpaceReadResultSchema.parse({ result: value });
4833
4897
  if (Buffer.byteLength(JSON.stringify(complete)) <= PAGE_BYTES) return this.#result(complete);
4834
4898
  const bytes = Buffer.from(JSON.stringify(value));
@@ -4842,14 +4906,29 @@ var DispatchReadResults = class {
4842
4906
  const resultId = randomUUID();
4843
4907
  this.#snapshots.set(resultId, {
4844
4908
  bytes,
4845
- offsets: /* @__PURE__ */ new Set([0])
4909
+ offsets: /* @__PURE__ */ new Set([0]),
4910
+ revalidate
4846
4911
  });
4847
4912
  this.#bytes += bytes.length;
4848
- return this.read(resultId, 0);
4913
+ return this.#page(resultId, 0);
4914
+ }
4915
+ async read(resultId, offset) {
4916
+ const snapshot = this.#requireSnapshot(resultId, offset);
4917
+ const current = await snapshot.revalidate();
4918
+ if (current.isError || !Buffer.from(JSON.stringify(readValue(current))).equals(snapshot.bytes)) {
4919
+ this.#bytes -= snapshot.bytes.length;
4920
+ this.#snapshots.delete(resultId);
4921
+ throw new Error("The source is no longer accessible or its selected version changed. No cached page was disclosed. Read the source again.");
4922
+ }
4923
+ return this.#page(resultId, offset);
4849
4924
  }
4850
- read(resultId, offset) {
4925
+ #requireSnapshot(resultId, offset) {
4851
4926
  const snapshot = this.#snapshots.get(resultId);
4852
4927
  if (!snapshot?.offsets.has(offset)) throw new Error("This result or offset is unavailable in the current tool invocation. Use a returned nextOffset, or read the source again; do not open a local file.");
4928
+ return snapshot;
4929
+ }
4930
+ #page(resultId, offset) {
4931
+ const snapshot = this.#requireSnapshot(resultId, offset);
4853
4932
  const { bytes } = snapshot;
4854
4933
  let end = Math.min(offset + PAGE_BYTES, bytes.length);
4855
4934
  while (true) {
@@ -4883,6 +4962,9 @@ var DispatchReadResults = class {
4883
4962
  };
4884
4963
  }
4885
4964
  };
4965
+ function readValue(result) {
4966
+ return result.structuredContent ?? JSON.parse(result.content.map((item) => item.text).join("\n"));
4967
+ }
4886
4968
  function isUtf8Continuation(byte) {
4887
4969
  return byte !== void 0 && byte >= 128 && byte < 192;
4888
4970
  }
@@ -5008,6 +5090,8 @@ var DispatchSpaceTools = class {
5008
5090
  const inputSchema = config.inputSchema instanceof z.ZodObject ? config.inputSchema : z.strictObject(config.inputSchema);
5009
5091
  const pagedRead = [
5010
5092
  "read_history",
5093
+ "read_evidence",
5094
+ "read_thread",
5011
5095
  "read_file",
5012
5096
  "list_tasks",
5013
5097
  "read_documents",
@@ -5041,6 +5125,8 @@ var DispatchSpaceTools = class {
5041
5125
  }, this.#env);
5042
5126
  const pagedRead = [
5043
5127
  "read_history",
5128
+ "read_evidence",
5129
+ "read_thread",
5044
5130
  "read_file",
5045
5131
  "list_tasks",
5046
5132
  "read_documents",
@@ -5051,7 +5137,7 @@ var DispatchSpaceTools = class {
5051
5137
  const result = await handler(args);
5052
5138
  const active = readDispatchSpaceActionContextFromEnv(this.#env);
5053
5139
  if (this.#closed || active.contextId !== this.#context.contextId || active.nonce !== this.#context.nonce) throw new Error("The Wake changed or closed during this read. No result is available.");
5054
- return pagedRead ? this.#readResults.wrap(result) : result;
5140
+ return pagedRead ? this.#readResults.wrap(result, () => handler(args)) : result;
5055
5141
  } catch (error) {
5056
5142
  return {
5057
5143
  isError: true,
@@ -5191,6 +5277,46 @@ function createDispatchSpaceTools(input = {}) {
5191
5277
  };
5192
5278
  }
5193
5279
  });
5280
+ server.registerTool("read_evidence", {
5281
+ title: "Read an exact Space message version",
5282
+ description: "Read one selected message in the current Space, up to 4,000 characters per source page. Use its sourceSignalId and version; continue with the returned nextOffset and the same version. Every read checks current source access. An unavailable version fails explicitly.",
5283
+ inputSchema: spaceMessageEvidenceRequestSchema,
5284
+ annotations: {
5285
+ readOnlyHint: true,
5286
+ destructiveHint: false,
5287
+ idempotentHint: true,
5288
+ openWorldHint: false
5289
+ }
5290
+ }, async (input) => {
5291
+ const result = await readDispatchSpaceEvidence(input, env);
5292
+ return {
5293
+ structuredContent: result,
5294
+ content: [{
5295
+ type: "text",
5296
+ text: JSON.stringify(result)
5297
+ }]
5298
+ };
5299
+ });
5300
+ server.registerTool("read_thread", {
5301
+ title: "Read an exact Space thread version",
5302
+ description: "Read up to 20 messages and 4,000 characters from a named thread in this Space. Continue with nextOffset and the same sourceRef.version; changed or inaccessible versions fail explicitly. Read truncated messages with read_evidence using their exact sourceRef. Every page checks current access.",
5303
+ inputSchema: spaceThreadEvidenceRequestSchema,
5304
+ annotations: {
5305
+ readOnlyHint: true,
5306
+ destructiveHint: false,
5307
+ idempotentHint: true,
5308
+ openWorldHint: false
5309
+ }
5310
+ }, async (input) => {
5311
+ const result = await readDispatchSpaceThreadEvidence(input, env);
5312
+ return {
5313
+ structuredContent: result,
5314
+ content: [{
5315
+ type: "text",
5316
+ text: JSON.stringify(result)
5317
+ }]
5318
+ };
5319
+ });
5194
5320
  server.registerTool("read_file", {
5195
5321
  title: "Read a file in the current OpenMeld Space",
5196
5322
  description: "Read a shared text file as the Agent in the current Wake. Use this for attached CSV, text, Markdown, or JSON files instead of running the CLI in a terminal. Pass the attachment's file ID and revision. This is a context read; it does not submit a reply or close the Wake.",
@@ -6168,4 +6294,4 @@ async function fetchSpaceUpdates(input) {
6168
6294
  //#endregion
6169
6295
  export { recordOpenMeldCreatedLocalAgentSession as A, defaultManagedIntegrationPaths as B, recordRuntimeReportingFailure as C, startLocalAgentActivitySyncLoop as D, createLedgerIo as E, isAgentActivityRouteRegistered as F, readAgentActivityIntegrationStatus as H, registerAgentActivityRoute as I, resolveAgentActivityRouteForPath as L, removeAgentActivityContextCache as M, enqueueControllerTaskLifecycleEventWhileLocked as N, syncLocalAgentActivity as O, readControllerTaskLifecycleOutboxHealth as P, unregisterAgentActivityRoute as R, readRuntimeReportingHealthState as S, recordRuntimeReportingSuccess as T, resolveAgentActivityDispatcherCommand as U, installAgentActivityIntegrations as V, uninstallAgentActivityIntegrations as W, prepareExecutionContextWorkspace as _, createDispatchSpaceTools as a, prepareClaudeProjectContainer as b, readTaskSkillSelections as c, runSpaceActionReply as d, runSpaceActionSilent as f, markExecutionContextWorkspaceInUse as g, runSpaceActionWake as h, materializeOrganizationSkillRelease as i, readAgentActivityContextForPath as j, discoverLocalAgentSessionProviders as k, runDirectMessage as l, runSpaceActionTargets as m, createSpaceWorkingCopies as n, runSpaceActionMcpServer as o, runSpaceActionStatus as p, downloadWorkingCopyFile as r, readTaskDocuments as s, fetchSpaceUpdates as t, runSpaceActionHelp as u, readExecutionContextWorkspace as v, recordRuntimeReportingNotApplicable as w, startDispatchSpaceProgressRelay as x, releaseExecutionContextWorkspace as y, AGENT_ACTIVITY_INTEGRATION_OWNER as z };
6170
6296
 
6171
- //# sourceMappingURL=updates-api-TVlrczrO.js.map
6297
+ //# sourceMappingURL=updates-api-CTf05SZn.js.map