@ftai/dsh-plugin-acn 0.0.0-stage → 0.1.1

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 (276) hide show
  1. package/CHANGELOG.md +90 -0
  2. package/LICENSE-APACHE +201 -0
  3. package/LICENSE-MIT +19 -0
  4. package/README.md +82 -2
  5. package/README_EN.md +83 -0
  6. package/cordis.patch.yml +29 -0
  7. package/docs/acn-compat.md +33 -0
  8. package/docs/architecture.md +130 -0
  9. package/docs/assets/acn-claim-reuse.png +0 -0
  10. package/docs/assets/activity-view.png +0 -0
  11. package/docs/assets/install-package.png +0 -0
  12. package/docs/assets/knowledge-model.png +0 -0
  13. package/docs/assets/knowledge-view.png +0 -0
  14. package/docs/assets/personal-configuration.png +0 -0
  15. package/docs/assets/session-upstream.png +0 -0
  16. package/docs/assets/upstream-settings.png +0 -0
  17. package/docs/assets/upstream-team.png +0 -0
  18. package/docs/command-reference.md +201 -0
  19. package/docs/config.md +253 -0
  20. package/docs/development.md +197 -0
  21. package/docs/dsh-compat.md +59 -0
  22. package/docs/index.md +16 -0
  23. package/docs/outstanding-issues.md +61 -0
  24. package/docs/user_guide.md +185 -0
  25. package/icon.svg +8 -0
  26. package/lib/activities-B8U-iW4-.js +407 -0
  27. package/lib/alignment-CwH0nBf-.js +80 -0
  28. package/lib/auth-DFI9yowX.js +71 -0
  29. package/lib/checkpoint-CPFPOxBM.js +188 -0
  30. package/lib/checkpoint-c7aI4D-X.js +318 -0
  31. package/lib/claim-DOAGe8ZK.js +168 -0
  32. package/lib/client.js +18417 -0
  33. package/lib/deliver-C-dmhkfm.js +168 -0
  34. package/lib/delivery-status-M7-Rwoyj.js +89 -0
  35. package/lib/dispute-CtrInHzf.js +20 -0
  36. package/lib/disputes-ByEmi43j.js +51 -0
  37. package/lib/dream-agent-BVqxbKFc.js +249 -0
  38. package/lib/dream.js +4 -0
  39. package/lib/effects-DX1iy6FM.js +268 -0
  40. package/lib/errors-Bp_2WXBr.js +19 -0
  41. package/lib/errors-pPumDOGD.js +18 -0
  42. package/lib/evidence-store-DW7kj20i.js +1030 -0
  43. package/lib/formation-D4LO31WW.js +187 -0
  44. package/lib/formation-replay-Bf4TSBiz.js +87 -0
  45. package/lib/formation.js +9 -0
  46. package/lib/history-DPMHX3ZE.js +214 -0
  47. package/lib/inbox-2CugZZQm.js +188 -0
  48. package/lib/inbox-DFtE2fOp.js +71 -0
  49. package/lib/inbox.js +3 -0
  50. package/lib/index.js +1373 -0
  51. package/lib/lock-DbmlKOoX.js +332 -0
  52. package/lib/pages-BEWC3kmZ.js +51 -0
  53. package/lib/paths-B7NI9Ano.js +157 -0
  54. package/lib/plugins/commands.js +590 -0
  55. package/lib/plugins/dream.js +66 -0
  56. package/lib/plugins/formation.js +66 -0
  57. package/lib/plugins/inbox.js +53 -0
  58. package/lib/plugins/knowledge.js +1109 -0
  59. package/lib/plugins/prompt.js +102 -0
  60. package/lib/plugins/tools.js +280 -0
  61. package/lib/policy-DnyHh7Bl.js +16 -0
  62. package/lib/prepare-CGXwBEcu.js +134 -0
  63. package/lib/protocol.js +8 -0
  64. package/lib/queue-M917xHPS.js +153 -0
  65. package/lib/regular-file-BFpqMoub.js +136 -0
  66. package/lib/render-CJaVcKKC.js +48 -0
  67. package/lib/reported-sets-DdEKdeVb.js +122 -0
  68. package/lib/revision-DeoL_IUN.js +11 -0
  69. package/lib/scheduler-BfJSY1eq.js +64 -0
  70. package/lib/service-BPwaZzFF.js +1106 -0
  71. package/lib/service-BQaszW_v.js +344 -0
  72. package/lib/service-BhniAHLo.js +305 -0
  73. package/lib/service-C2lXoygJ.js +505 -0
  74. package/lib/session-binding-zCSuizHs.js +342 -0
  75. package/lib/session-state-CYqUhC95.js +38 -0
  76. package/lib/sessions-C2xuPFQv.js +218 -0
  77. package/lib/store.js +16 -0
  78. package/lib/structured-C9byFuzm.js +453 -0
  79. package/lib/subagent-yJsFxHmH.js +9 -0
  80. package/lib/team.js +3 -0
  81. package/lib/tool-schema-3b4gH1zf.js +28 -0
  82. package/lib/trace-Da0RnL5R.js +14 -0
  83. package/lib/traces-CHBo8y1z.js +11 -0
  84. package/lib/types/activities.d.ts +73 -0
  85. package/lib/types/advanced-configuration.d.ts +11 -0
  86. package/lib/types/client/ActivityCard.d.ts +14 -0
  87. package/lib/types/client/ActivityDetails.d.ts +18 -0
  88. package/lib/types/client/AdvancedPreferences.d.ts +8 -0
  89. package/lib/types/client/BlankCommandFeedback.d.ts +10 -0
  90. package/lib/types/client/ComposerMenu.d.ts +24 -0
  91. package/lib/types/client/ConfigurationPage.d.ts +11 -0
  92. package/lib/types/client/ConnectionCheckDialog.d.ts +12 -0
  93. package/lib/types/client/KnowledgeDetail.d.ts +6 -0
  94. package/lib/types/client/KnowledgeDirectoryField.d.ts +11 -0
  95. package/lib/types/client/KnowledgePanel.d.ts +12 -0
  96. package/lib/types/client/KnowledgeReference.d.ts +13 -0
  97. package/lib/types/client/SessionToolbar.d.ts +16 -0
  98. package/lib/types/client/SettingsToast.d.ts +3 -0
  99. package/lib/types/client/SourceSessionLink.d.ts +16 -0
  100. package/lib/types/client/TeamCredentialField.d.ts +16 -0
  101. package/lib/types/client/TeamSettingsPage.d.ts +28 -0
  102. package/lib/types/client/configuration-errors.d.ts +2 -0
  103. package/lib/types/client/interaction-styles.d.ts +1 -0
  104. package/lib/types/client/interaction-ui.d.ts +30 -0
  105. package/lib/types/client/knowledge-labels.d.ts +5 -0
  106. package/lib/types/client/locales.d.ts +51 -0
  107. package/lib/types/commands/claim.d.ts +4 -0
  108. package/lib/types/commands/import.d.ts +10 -0
  109. package/lib/types/commands/status.d.ts +5 -0
  110. package/lib/types/config.d.ts +111 -0
  111. package/lib/types/configuration.d.ts +235 -0
  112. package/lib/types/credentials.d.ts +59 -0
  113. package/lib/types/dream/audit.d.ts +4 -0
  114. package/lib/types/dream/autonomous.d.ts +185 -0
  115. package/lib/types/dream/candidates.d.ts +34 -0
  116. package/lib/types/dream/checkpoint.d.ts +35 -0
  117. package/lib/types/dream/evidence-files.d.ts +10 -0
  118. package/lib/types/dream/evidence-store.d.ts +103 -0
  119. package/lib/types/dream/evidence.d.ts +30 -0
  120. package/lib/types/dream/index.d.ts +10 -0
  121. package/lib/types/dream/plan.d.ts +18 -0
  122. package/lib/types/dream/preservation.d.ts +6 -0
  123. package/lib/types/dream/review.d.ts +10 -0
  124. package/lib/types/dream/schema.d.ts +1475 -0
  125. package/lib/types/dream/service.d.ts +56 -0
  126. package/lib/types/dream/sync.d.ts +147 -0
  127. package/lib/types/dsh-adapter/configuration-remote.d.ts +1 -0
  128. package/lib/types/dsh-adapter/configuration-service.d.ts +28 -0
  129. package/lib/types/dsh-adapter/dream-agent.d.ts +4 -0
  130. package/lib/types/dsh-adapter/dream-evidence.d.ts +3 -0
  131. package/lib/types/dsh-adapter/formation-archive.d.ts +3 -0
  132. package/lib/types/dsh-adapter/formation-replay.d.ts +5 -0
  133. package/lib/types/dsh-adapter/formation.d.ts +4 -0
  134. package/lib/types/dsh-adapter/interaction-service.d.ts +13 -0
  135. package/lib/types/dsh-adapter/knowledge-paths.d.ts +3 -0
  136. package/lib/types/dsh-adapter/llm.d.ts +10 -0
  137. package/lib/types/dsh-adapter/project-upstream.d.ts +4 -0
  138. package/lib/types/dsh-adapter/runtime-pool.d.ts +110 -0
  139. package/lib/types/dsh-adapter/session-binding.d.ts +43 -0
  140. package/lib/types/dsh-adapter/source-sessions.d.ts +3 -0
  141. package/lib/types/dsh-adapter/team-credentials.d.ts +5 -0
  142. package/lib/types/dsh-adapter/tool-schema.d.ts +4 -0
  143. package/lib/types/dsh-adapter/tools.d.ts +5 -0
  144. package/lib/types/formation/capture.d.ts +19 -0
  145. package/lib/types/formation/checkpoint.d.ts +136 -0
  146. package/lib/types/formation/index.d.ts +10 -0
  147. package/lib/types/formation/prepare.d.ts +16 -0
  148. package/lib/types/formation/schema.d.ts +45 -0
  149. package/lib/types/formation/service.d.ts +58 -0
  150. package/lib/types/formation/transcript.d.ts +75 -0
  151. package/lib/types/formation/triggers.d.ts +3 -0
  152. package/lib/types/inbox/cascade.d.ts +3 -0
  153. package/lib/types/inbox/effects.d.ts +275 -0
  154. package/lib/types/inbox/index.d.ts +5 -0
  155. package/lib/types/inbox/prepare.d.ts +380 -0
  156. package/lib/types/inbox/service.d.ts +26 -0
  157. package/lib/types/inbox/sync.d.ts +9 -0
  158. package/lib/types/index.d.ts +1 -0
  159. package/lib/types/interaction-messages.d.ts +69 -0
  160. package/lib/types/interaction.d.ts +541 -0
  161. package/lib/types/knowledge/alignment.d.ts +49 -0
  162. package/lib/types/knowledge/catalog.d.ts +5 -0
  163. package/lib/types/knowledge/changes.d.ts +32 -0
  164. package/lib/types/knowledge/disputes.d.ts +3 -0
  165. package/lib/types/knowledge/errors.d.ts +9 -0
  166. package/lib/types/knowledge/ordering.d.ts +7 -0
  167. package/lib/types/knowledge/pages.d.ts +7 -0
  168. package/lib/types/knowledge/safety.d.ts +2 -0
  169. package/lib/types/knowledge/service.d.ts +52 -0
  170. package/lib/types/knowledge/sessions.d.ts +59 -0
  171. package/lib/types/knowledge/sources.d.ts +2 -0
  172. package/lib/types/knowledge/timestamps.d.ts +1 -0
  173. package/lib/types/knowledge/types.d.ts +84 -0
  174. package/lib/types/llm/response.d.ts +1 -0
  175. package/lib/types/llm/structured.d.ts +27 -0
  176. package/lib/types/local-name.d.ts +1 -0
  177. package/lib/types/plugins/client.d.ts +9 -0
  178. package/lib/types/plugins/commands.d.ts +11 -0
  179. package/lib/types/plugins/configuration.d.ts +8 -0
  180. package/lib/types/plugins/dream.d.ts +16 -0
  181. package/lib/types/plugins/formation.d.ts +16 -0
  182. package/lib/types/plugins/inbox.d.ts +16 -0
  183. package/lib/types/plugins/knowledge.d.ts +19 -0
  184. package/lib/types/plugins/prompt.d.ts +17 -0
  185. package/lib/types/plugins/tools.d.ts +10 -0
  186. package/lib/types/prompt/render.d.ts +2 -0
  187. package/lib/types/protocol/arbitration.d.ts +154 -0
  188. package/lib/types/protocol/auth.d.ts +31 -0
  189. package/lib/types/protocol/claim.d.ts +36 -0
  190. package/lib/types/protocol/dispute.d.ts +17 -0
  191. package/lib/types/protocol/ids.d.ts +20 -0
  192. package/lib/types/protocol/inbox.d.ts +141 -0
  193. package/lib/types/protocol/index.d.ts +11 -0
  194. package/lib/types/protocol/policy.d.ts +21 -0
  195. package/lib/types/protocol/revision.d.ts +2 -0
  196. package/lib/types/protocol/router.d.ts +114 -0
  197. package/lib/types/protocol/schema.d.ts +4 -0
  198. package/lib/types/protocol/time.d.ts +5 -0
  199. package/lib/types/protocol/trace.d.ts +11 -0
  200. package/lib/types/store/atomic.d.ts +8 -0
  201. package/lib/types/store/claim-edits.d.ts +33 -0
  202. package/lib/types/store/claims.d.ts +7 -0
  203. package/lib/types/store/context.d.ts +13 -0
  204. package/lib/types/store/delivery-status.d.ts +48 -0
  205. package/lib/types/store/disputes.d.ts +6 -0
  206. package/lib/types/store/entities.d.ts +16 -0
  207. package/lib/types/store/errors.d.ts +8 -0
  208. package/lib/types/store/history.d.ts +65 -0
  209. package/lib/types/store/inbox.d.ts +27 -0
  210. package/lib/types/store/index.d.ts +16 -0
  211. package/lib/types/store/jobs.d.ts +5 -0
  212. package/lib/types/store/library-directory.d.ts +4 -0
  213. package/lib/types/store/lock.d.ts +11 -0
  214. package/lib/types/store/path-names.d.ts +2 -0
  215. package/lib/types/store/paths.d.ts +45 -0
  216. package/lib/types/store/presentation.d.ts +13 -0
  217. package/lib/types/store/regular-file.d.ts +2 -0
  218. package/lib/types/store/rejected-disputes.d.ts +18 -0
  219. package/lib/types/store/rename.d.ts +1 -0
  220. package/lib/types/store/reported-sets.d.ts +24 -0
  221. package/lib/types/store/session-state.d.ts +17 -0
  222. package/lib/types/store/traces.d.ts +6 -0
  223. package/lib/types/store/uploads.d.ts +312 -0
  224. package/lib/types/store/yaml.d.ts +8 -0
  225. package/lib/types/team/errors.d.ts +10 -0
  226. package/lib/types/team/http.d.ts +20 -0
  227. package/lib/types/team/index.d.ts +5 -0
  228. package/lib/types/team/maintainer-client.d.ts +18 -0
  229. package/lib/types/team/router-client.d.ts +14 -0
  230. package/lib/types/team/service.d.ts +28 -0
  231. package/lib/types/team/system-proxy.d.ts +9 -0
  232. package/lib/types/tools/claim.d.ts +63 -0
  233. package/lib/types/tools/consult-router.d.ts +11 -0
  234. package/lib/types/tools/subagent.d.ts +8 -0
  235. package/lib/types/tools/validation.d.ts +2 -0
  236. package/lib/types/upload/consolidation.d.ts +63 -0
  237. package/lib/types/upload/deliver.d.ts +15 -0
  238. package/lib/types/upload/index.d.ts +2 -0
  239. package/lib/types/upload/scheduler.d.ts +19 -0
  240. package/lib/types/upstreams.d.ts +5 -0
  241. package/lib/types/worker/queue.d.ts +17 -0
  242. package/lib/types/worker/types.d.ts +51 -0
  243. package/lib/types/worker/worker.d.ts +39 -0
  244. package/lib/types-C2ST2Zdg.js +17 -0
  245. package/lib/upload.js +3 -0
  246. package/lib/uploads-BCA2p92b.js +210 -0
  247. package/lib/upstreams-DEi-56tD.js +495 -0
  248. package/lib/worker-HMGzJFWd.js +185 -0
  249. package/locale/commands/en.json +1 -0
  250. package/locale/commands/zh.json +1 -0
  251. package/locale/dream/en.json +1 -0
  252. package/locale/dream/zh.json +1 -0
  253. package/locale/en.json +7 -0
  254. package/locale/formation/en.json +1 -0
  255. package/locale/formation/zh.json +1 -0
  256. package/locale/inbox/en.json +1 -0
  257. package/locale/inbox/zh.json +1 -0
  258. package/locale/knowledge/en.json +1 -0
  259. package/locale/knowledge/zh.json +1 -0
  260. package/locale/prompt/en.json +1 -0
  261. package/locale/prompt/zh.json +1 -0
  262. package/locale/tools/en.json +1 -0
  263. package/locale/tools/zh.json +1 -0
  264. package/locale/zh.json +7 -0
  265. package/package.json +262 -3
  266. package/prompts/claim_dream.j2 +77 -0
  267. package/prompts/claim_dream_legacy.j2 +63 -0
  268. package/prompts/dream_compaction.j2 +11 -0
  269. package/prompts/dream_evidence.j2 +5 -0
  270. package/prompts/inbox_claim_attribute_update_internalize.j2 +112 -0
  271. package/prompts/inbox_policy_update_internalize.j2 +87 -0
  272. package/prompts/knowledge.j2 +38 -0
  273. package/prompts/session_recap.j2 +113 -0
  274. package/prompts/what_is_claim.j2 +51 -0
  275. package/prompts/what_is_dispute.j2 +21 -0
  276. package/prompts/what_is_policy.j2 +22 -0
@@ -0,0 +1,168 @@
1
+ import { x as nowSeconds } from "./claim-DOAGe8ZK.js";
2
+ import { n as claimRevision } from "./revision-DeoL_IUN.js";
3
+ import { S as LockTimeoutError, n as withFileLock, t as acquireFileLease } from "./lock-DbmlKOoX.js";
4
+ import { l as sameClaim, r as KnowledgeBusy, s as ensureKnowledgeReady } from "./alignment-CwH0nBf-.js";
5
+ import { i as ClaimStore, r as reportedClaimSetKey, t as ReportedSetStore } from "./reported-sets-DdEKdeVb.js";
6
+ import { a as disputeVersion, i as RejectedDisputeStore, o as consolidationReady, r as UploadStore, s as relatedIds } from "./uploads-BCA2p92b.js";
7
+ import { t as DeliveryStatusStore } from "./delivery-status-M7-Rwoyj.js";
8
+ import { t as TeamError } from "./errors-pPumDOGD.js";
9
+ //#region src/upload/deliver.ts
10
+ var UploadDelivery = class {
11
+ context;
12
+ team;
13
+ constructor(context, team) {
14
+ this.context = context;
15
+ this.team = team;
16
+ }
17
+ async deliver(signal) {
18
+ const report = {
19
+ deliveredClaims: 0,
20
+ deliveredDisputes: 0,
21
+ pendingClaims: 0,
22
+ pendingDisputes: 0,
23
+ warnings: []
24
+ };
25
+ const team = this.team;
26
+ if (team === null || this.context.mode === "solo") return report;
27
+ const queue = new UploadStore(this.context);
28
+ const status = new DeliveryStatusStore(this.context);
29
+ let snapshot = await queue.read();
30
+ if (snapshot.claims.length === 0 && snapshot.disputes.length === 0) return report;
31
+ let lease;
32
+ try {
33
+ lease = await acquireFileLease(this.context.paths.deliveryLock, { timeoutMs: 0 });
34
+ } catch (error) {
35
+ if (error instanceof LockTimeoutError) return {
36
+ ...report,
37
+ pendingClaims: snapshot.claims.length,
38
+ pendingDisputes: snapshot.disputes.length
39
+ };
40
+ throw error;
41
+ }
42
+ try {
43
+ snapshot = await queue.read();
44
+ const initialIds = new Set(snapshot.claims.map((claim) => claim.id));
45
+ const attempted = /* @__PURE__ */ new Set();
46
+ let stopped = false;
47
+ for (let round = 0; round <= initialIds.size && !stopped; round += 1) {
48
+ let progressed = false;
49
+ for (const queued of (await queue.read()).claims.filter((claim) => initialIds.has(claim.id))) {
50
+ signal?.throwIfAborted();
51
+ lease.check();
52
+ let current;
53
+ try {
54
+ current = await withFileLock(this.context.paths.knowledgeLock, async () => {
55
+ await ensureKnowledgeReady(this.context.paths.root);
56
+ return new ClaimStore(this.context).list();
57
+ }, { timeoutMs: 0 });
58
+ } catch (error) {
59
+ if (!(error instanceof LockTimeoutError || error instanceof KnowledgeBusy)) throw error;
60
+ continue;
61
+ }
62
+ const pending = await queue.read();
63
+ const claim = pending.claims.find((claim) => claim.id === queued.id);
64
+ if (claim === void 0) continue;
65
+ if (attempted.has(claim.id)) continue;
66
+ if (!current.some((value) => sameClaim(value, claim))) {
67
+ await status.record({
68
+ kind: "claim",
69
+ id: claim.id,
70
+ reason: "version"
71
+ });
72
+ report.warnings.push(`Claim ${claim.id} 的待上传版本与本地不一致,已暂停该项;请在团队模式确认修订后重试。`);
73
+ continue;
74
+ }
75
+ if (relatedIds(pending.consolidations ?? []).has(claim.id) && !consolidationReady(claim, pending.consolidations ?? [], pending.acknowledgements ?? [], current)) {
76
+ await status.record({
77
+ kind: "claim",
78
+ id: claim.id,
79
+ reason: "dependency"
80
+ });
81
+ continue;
82
+ }
83
+ attempted.add(claim.id);
84
+ progressed = true;
85
+ try {
86
+ await team.request("maintainer", () => team.maintainer.upload(claim, signal));
87
+ lease.check();
88
+ await status.acknowledge("claim", claim.id, claimRevision(claim), team.maintainer.http.endpoint);
89
+ await queue.removeDeliveredClaims([claim]);
90
+ report.deliveredClaims += 1;
91
+ } catch (error) {
92
+ if (!(error instanceof TeamError)) throw error;
93
+ if (error.kind !== "cancelled") await status.record({
94
+ kind: "claim",
95
+ id: claim.id,
96
+ reason: error.kind === "legacy_route" ? "client" : error.kind,
97
+ ...error.status === void 0 ? {} : { status: error.status }
98
+ });
99
+ report.warnings.push(error.message);
100
+ if (error.kind === "auth" || error.kind === "cancelled") {
101
+ stopped = true;
102
+ break;
103
+ }
104
+ }
105
+ }
106
+ if (!progressed) break;
107
+ }
108
+ const ledger = new ReportedSetStore(this.context);
109
+ const rejected = new RejectedDisputeStore(this.context);
110
+ for (const dispute of snapshot.disputes) {
111
+ signal?.throwIfAborted();
112
+ lease.check();
113
+ if (await rejected.contains(dispute)) {
114
+ await queue.removeDeliveredDisputes([dispute]);
115
+ continue;
116
+ }
117
+ try {
118
+ if ((await ledger.read()).reported_claim_sets[reportedClaimSetKey(dispute.claims)] === void 0) {
119
+ await team.request("maintainer", () => team.maintainer.report(dispute, signal));
120
+ lease.check();
121
+ await status.acknowledge("dispute", dispute.id, disputeVersion(dispute), team.maintainer.http.endpoint);
122
+ await ledger.record(dispute.claims, dispute.id, nowSeconds());
123
+ report.deliveredDisputes += 1;
124
+ }
125
+ await queue.removeDeliveredDisputes([dispute]);
126
+ await status.clear("dispute", dispute.id);
127
+ } catch (error) {
128
+ if (!(error instanceof TeamError)) throw error;
129
+ if (error.kind === "client" && error.status === 409) {
130
+ lease.check();
131
+ const previous = (await status.read()).issues[`dispute-${dispute.id}`];
132
+ await rejected.record(dispute, (previous?.version === disputeVersion(dispute) ? previous.attempts : 0) + 1);
133
+ await status.record({
134
+ kind: "dispute",
135
+ id: dispute.id,
136
+ version: disputeVersion(dispute),
137
+ reason: "rejected",
138
+ status: 409
139
+ });
140
+ const warning = `Dispute ${dispute.id} 被团队服务以 409 拒绝,已停止自动重试;本地记录保留,请核对当前 Claim。`;
141
+ report.warnings.push(warning);
142
+ this.context.logger.warn(warning);
143
+ await queue.removeDeliveredDisputes([dispute]);
144
+ } else {
145
+ if (error.kind !== "cancelled") await status.record({
146
+ kind: "dispute",
147
+ id: dispute.id,
148
+ version: disputeVersion(dispute),
149
+ reason: error.kind === "legacy_route" ? "client" : error.kind,
150
+ ...error.status === void 0 ? {} : { status: error.status }
151
+ });
152
+ report.warnings.push(error.message);
153
+ }
154
+ if (error.kind === "auth" || error.kind === "cancelled") break;
155
+ }
156
+ }
157
+ const pending = await queue.read();
158
+ report.pendingClaims = pending.claims.length;
159
+ report.pendingDisputes = pending.disputes.length;
160
+ report.warnings = [...new Set(report.warnings)];
161
+ return report;
162
+ } finally {
163
+ await lease.release();
164
+ }
165
+ }
166
+ };
167
+ //#endregion
168
+ export { UploadDelivery as t };
@@ -0,0 +1,89 @@
1
+ import { l as ClaimIdSchema, u as DisputeIdSchema } from "./claim-DOAGe8ZK.js";
2
+ import { c as readYamlOr, l as writeYamlAtomic, n as withFileLock } from "./lock-DbmlKOoX.js";
3
+ import { z } from "zod";
4
+ import { createHash } from "node:crypto";
5
+ //#region src/store/delivery-status.ts
6
+ const DeliveryIssueSchema = z.object({
7
+ kind: z.enum(["claim", "dispute"]),
8
+ id: z.union([ClaimIdSchema, DisputeIdSchema]),
9
+ reason: z.enum([
10
+ "auth",
11
+ "retryable",
12
+ "client",
13
+ "protocol",
14
+ "version",
15
+ "dependency",
16
+ "rejected"
17
+ ]),
18
+ version: z.string().regex(/^[0-9a-f]{64}$/).optional(),
19
+ status: z.number().int().optional(),
20
+ attempts: z.number().int().nonnegative().default(0),
21
+ updatedAt: z.number().int().nonnegative()
22
+ });
23
+ const Receipt = z.object({
24
+ version: z.string(),
25
+ target: z.string().regex(/^[0-9a-f]{64}$/),
26
+ updatedAt: z.number().int().nonnegative().optional()
27
+ });
28
+ const State = z.object({
29
+ schemaVersion: z.literal(1),
30
+ issues: z.record(z.string(), DeliveryIssueSchema),
31
+ delivered: z.record(z.string(), Receipt).default({})
32
+ });
33
+ function deliveryTarget(endpoint) {
34
+ return createHash("sha256").update(new URL(endpoint).href.replace(/\/+$/, "")).digest("hex");
35
+ }
36
+ var DeliveryStatusStore = class {
37
+ context;
38
+ constructor(context) {
39
+ this.context = context;
40
+ }
41
+ read() {
42
+ return readYamlOr(this.context.paths.deliveryStatus, State, () => State.parse({
43
+ schemaVersion: 1,
44
+ issues: {}
45
+ }));
46
+ }
47
+ async acknowledge(kind, id, version, endpoint) {
48
+ if (this.context.mode !== "team") return;
49
+ await withFileLock(`${this.context.paths.deliveryStatus}.lock`, async () => {
50
+ const state = await this.read();
51
+ const key = `${kind}-${id}`;
52
+ state.delivered[key] = {
53
+ version,
54
+ target: deliveryTarget(endpoint),
55
+ updatedAt: Date.now()
56
+ };
57
+ delete state.issues[key];
58
+ await writeYamlAtomic(this.context.paths.deliveryStatus, state, State, this.context.logger);
59
+ }, { timeoutMs: this.context.lockTimeoutMs });
60
+ }
61
+ async record(input) {
62
+ if (this.context.mode !== "team") return;
63
+ await withFileLock(`${this.context.paths.deliveryStatus}.lock`, async () => {
64
+ const state = await this.read();
65
+ const key = `${input.kind}-${input.id}`;
66
+ const previous = state.issues[key];
67
+ const attempted = !["version", "dependency"].includes(input.reason);
68
+ if (!attempted && previous?.reason === input.reason && previous.status === input.status) return;
69
+ state.issues[key] = {
70
+ ...input,
71
+ attempts: (previous?.version === input.version ? previous?.attempts ?? 0 : 0) + Number(attempted),
72
+ updatedAt: Date.now()
73
+ };
74
+ await writeYamlAtomic(this.context.paths.deliveryStatus, state, State, this.context.logger);
75
+ }, { timeoutMs: this.context.lockTimeoutMs });
76
+ }
77
+ async clear(kind, id) {
78
+ if (this.context.mode !== "team") return;
79
+ await withFileLock(`${this.context.paths.deliveryStatus}.lock`, async () => {
80
+ const state = await this.read();
81
+ const key = `${kind}-${id}`;
82
+ if (state.issues[key] === void 0) return;
83
+ delete state.issues[key];
84
+ await writeYamlAtomic(this.context.paths.deliveryStatus, state, State, this.context.logger);
85
+ }, { timeoutMs: this.context.lockTimeoutMs });
86
+ }
87
+ };
88
+ //#endregion
89
+ export { deliveryTarget as n, DeliveryStatusStore as t };
@@ -0,0 +1,20 @@
1
+ import { a as TextSchema, c as AgentIdSchema, l as ClaimIdSchema, o as optional, u as DisputeIdSchema, y as TimestampSchema } from "./claim-DOAGe8ZK.js";
2
+ import { z } from "zod";
3
+ //#region src/protocol/dispute.ts
4
+ const DisputeSchema = z.object({
5
+ id: DisputeIdSchema,
6
+ name: TextSchema,
7
+ reporter_agent_id: AgentIdSchema.default(AgentIdSchema.parse("legacy-agent")),
8
+ claims: z.array(ClaimIdSchema),
9
+ summary: TextSchema,
10
+ status: z.enum(["open", "resolved"]),
11
+ created_at: TimestampSchema,
12
+ resolved_at: optional(TimestampSchema)
13
+ });
14
+ function validateAgentReport(value) {
15
+ const dispute = DisputeSchema.parse(value);
16
+ if (dispute.status !== "open" || dispute.resolved_at !== void 0) throw new Error("An agent report must be open without resolved_at.");
17
+ return dispute;
18
+ }
19
+ //#endregion
20
+ export { validateAgentReport as n, DisputeSchema as t };
@@ -0,0 +1,51 @@
1
+ import { t as ClaimSchema, u as DisputeIdSchema } from "./claim-DOAGe8ZK.js";
2
+ import { n as claimRevision } from "./revision-DeoL_IUN.js";
3
+ import { C as StoreError, c as readYamlOr, d as removeFile, l as writeYamlAtomic, n as withFileLock } from "./lock-DbmlKOoX.js";
4
+ import { a as EntityStore, i as ClaimStore } from "./reported-sets-DdEKdeVb.js";
5
+ import { t as DisputeSchema } from "./dispute-CtrInHzf.js";
6
+ import { r as UploadStore } from "./uploads-BCA2p92b.js";
7
+ import { z } from "zod";
8
+ //#region src/store/claim-edits.ts
9
+ const PendingClaimEditSchema = z.object({
10
+ expected_revision: z.string().regex(/^sha256-v1:[0-9a-f]{64}$/),
11
+ target: ClaimSchema
12
+ });
13
+ var ClaimEditStore = class {
14
+ context;
15
+ constructor(context) {
16
+ this.context = context;
17
+ }
18
+ async write(record) {
19
+ if (this.context.mode === "solo") return;
20
+ const parsed = PendingClaimEditSchema.parse(record);
21
+ if (parsed.target.holder !== this.context.agentId) throw new StoreError("ownership", "Pending edit belongs to another agent.");
22
+ await writeYamlAtomic(this.context.paths.claimEditPending, parsed, PendingClaimEditSchema, this.context.logger);
23
+ }
24
+ async recover() {
25
+ if (this.context.mode === "solo") return "none";
26
+ const load = () => readYamlOr(this.context.paths.claimEditPending, PendingClaimEditSchema, () => null);
27
+ if (await load() === null) return "none";
28
+ return withFileLock(this.context.paths.knowledgeLock, () => this.recoverLocked(), { timeoutMs: this.context.lockTimeoutMs });
29
+ }
30
+ async recoverLocked() {
31
+ if (this.context.mode === "solo") return "none";
32
+ const pending = await readYamlOr(this.context.paths.claimEditPending, PendingClaimEditSchema, () => null);
33
+ if (pending === null) return "none";
34
+ const current = await new ClaimStore(this.context).read(pending.target.id);
35
+ if (current.holder !== this.context.agentId) throw new StoreError("ownership", "Cannot recover another agent’s Claim.");
36
+ const landed = claimRevision(current) === claimRevision(pending.target);
37
+ if (landed) await new UploadStore(this.context).enqueue([current], [], true);
38
+ else if (claimRevision(current) !== pending.expected_revision) this.context.logger.warn(`Claim ${current.id} 的编辑日志已被其他版本取代,未自动加入团队上传。`);
39
+ await removeFile(this.context.paths.claimEditPending, this.context.logger);
40
+ return landed ? "queued" : "discarded";
41
+ }
42
+ };
43
+ //#endregion
44
+ //#region src/store/disputes.ts
45
+ var DisputeStore = class extends EntityStore {
46
+ constructor(context) {
47
+ super(context, context.paths.disputes, DisputeSchema, DisputeIdSchema);
48
+ }
49
+ };
50
+ //#endregion
51
+ export { ClaimEditStore as n, PendingClaimEditSchema as r, DisputeStore as t };
@@ -0,0 +1,249 @@
1
+ import { i as transportError, t as abortable } from "./structured-C9byFuzm.js";
2
+ import { q as DreamValidationError } from "./evidence-store-DW7kj20i.js";
3
+ import { _ as JobError } from "./lock-DbmlKOoX.js";
4
+ import { n as DreamTools, r as isDreamTool } from "./service-BPwaZzFF.js";
5
+ import { t as toolParameters } from "./tool-schema-3b4gH1zf.js";
6
+ import { z } from "zod";
7
+ import { randomUUID } from "node:crypto";
8
+ import { SessionId, appendPluginRecord } from "@deepseek-ai/dsh-session";
9
+ import { createUserMessage } from "@deepseek-ai/dsh-llm";
10
+ import { defineTool } from "@deepseek-ai/dsh-tools";
11
+ //#region src/dsh-adapter/dream-agent.ts
12
+ const descriptions = {
13
+ dream_record_candidates: "整批验证后登记候选;按 candidate_progress.current 逐项处理。当前组可保留原目标并扩展或调整种类,不能与其他待处理组重叠。",
14
+ dream_stage_group: "暂存完整操作组,不写 Claim。纯 A 废弃可简写 id/action/reason;其他修改遵循 schema。group:null 撤回草稿但不撤销候选。",
15
+ dream_validate: "校验当前草稿,返回 before/after、实际证据和 validation_id,随后逐 Claim 语义复核。",
16
+ dream_apply_group: "提交当前 validation_id 与逐 Claim 语义复核;先持久记录再写 Claim,返回真实执行结果。",
17
+ dream_keep_candidate: "明确保留当前候选,说明具体原因;不改变 Claim。",
18
+ dream_read_draft: "查看已接受草稿、当前候选和剩余模型轮数。",
19
+ dream_read_history: "分页读取本轮持久执行记录;回执不是独立事实证据。",
20
+ dream_review_sync: "读取已有整合的同步依赖;确认后用同一 validation_id 和简洁语义 review 提交。",
21
+ dream_finish: "提交 ABC 实际覆盖总结并结束;额度收尾时尚未完成的候选会标为未完成,不强求修改。",
22
+ read_claim: "完整读取本轮自有 Claim;目录和摘要不授予修改权限。",
23
+ read_trace: "先用 claim_id 分页查找已读自有 Claim 的关联 Trace(offset/limit 按条,默认 20、最多 100),再提供 claim_id 和 trace_id 分页读正文(offset/limit 按字符,默认 4000、最多 8000)。旧 id 仍可单独读取。Trace 是来源线索,不能单独证明事实。",
24
+ file_read: "读取当前候选的工作区直接材料,绑定 claim_ids,返回插件生成的证据 ID 与文件版本。",
25
+ file_glob: "在工作区按路径字面片段发现文件;只用于定位,再 file_read 才产生证据。",
26
+ file_grep: "在工作区按字面内容搜索;只用于定位,再 file_read 才产生证据。"
27
+ };
28
+ function dreamToolGuard(name, args) {
29
+ if (!isDreamTool(name)) return "Dream 只能调用声明的领域工具与工作区只读工具。";
30
+ const parsed = DreamTools[name].safeParse(args);
31
+ if (parsed.success) return void 0;
32
+ return `Dream 参数不合法,请按工具 schema 修复:${parsed.error.issues.slice(0, 8).map((issue) => `${issue.path.join(".") || "$"}: ${issue.code}${issue.code === "unrecognized_keys" ? `;删除多余字段 ${JSON.stringify(issue.keys.slice(0, 8)).slice(0, 400)}` : issue.code === "invalid_type" ? `;期望 ${issue.expected}` : ""}`).join("; ")}`;
33
+ }
34
+ function autonomousDreamRunner(ctx) {
35
+ return async ({ session, route, config, system, signal }) => {
36
+ const requestDeadline = new AbortController();
37
+ const bounded = AbortSignal.any([signal, requestDeadline.signal]);
38
+ let stepError;
39
+ let completed = false;
40
+ let clearRequestTimeout = () => {};
41
+ let toolJsonRetries = 0;
42
+ let toolJsonFeedback = "";
43
+ const binding = ctx.get("acnRuntime")?.backgroundSelection(session.knowledge.config);
44
+ const handle = await ctx.agents.create({
45
+ sessionId: SessionId(`acn-dream-${randomUUID()}`),
46
+ meta: {
47
+ cwd: session.workspace,
48
+ origin: "subagent",
49
+ delegationDepth: 1,
50
+ agentPreset: "acn-dream"
51
+ },
52
+ agentOptions: {
53
+ ...route,
54
+ maxTokens: config.maxOutputTokens
55
+ },
56
+ signal: bounded,
57
+ setup: (child, agent) => {
58
+ if (binding !== void 0) appendPluginRecord(agent.session, "plugin:acn/team-selection", binding);
59
+ child.tools.restrict({ allow: [] });
60
+ child.tools.presentAs("native");
61
+ child.tools.guard((execution) => dreamToolGuard(execution.name, execution.arguments));
62
+ for (const name of Object.keys(DreamTools).filter(isDreamTool)) {
63
+ const tool = defineTool({
64
+ name,
65
+ description: descriptions[name],
66
+ parameters: {},
67
+ output: {
68
+ schema: { type: "json" },
69
+ render: (_args, result) => [{
70
+ type: "text",
71
+ text: JSON.stringify(result)
72
+ }]
73
+ },
74
+ execute: async (args, execution) => {
75
+ bounded.throwIfAborted();
76
+ execution.signal.throwIfAborted();
77
+ try {
78
+ return z.json().parse(await session.execute(name, args, AbortSignal.any([bounded, execution.signal])));
79
+ } catch (error) {
80
+ bounded.throwIfAborted();
81
+ if (error instanceof DreamValidationError || error instanceof z.ZodError) return {
82
+ error: error.message,
83
+ executed: false
84
+ };
85
+ throw error;
86
+ }
87
+ }
88
+ });
89
+ child.tools.register({
90
+ ...tool,
91
+ parameters: toolParameters(DreamTools[name])
92
+ });
93
+ }
94
+ child.systemPrompt.suppressRuntimeContext();
95
+ child.systemPrompt.section({
96
+ name: "acn-dream-only",
97
+ order: 0,
98
+ text: system,
99
+ interpolate: false,
100
+ complete: true
101
+ });
102
+ const budgetContext = "acn-dream-budget";
103
+ child.systemPrompt.context({
104
+ name: budgetContext,
105
+ order: 0,
106
+ text: () => session.budgetNotice(),
107
+ interpolate: false,
108
+ required: true
109
+ });
110
+ const toolErrorContext = "acn-dream-tool-error";
111
+ child.systemPrompt.context({
112
+ name: toolErrorContext,
113
+ order: 1,
114
+ text: () => toolJsonFeedback,
115
+ interpolate: false,
116
+ required: true
117
+ });
118
+ const allowedContexts = /* @__PURE__ */ new Set([budgetContext, toolErrorContext]);
119
+ const shadowed = /* @__PURE__ */ new Set();
120
+ child.on("system-prompt/assemble", async (_assembly, _context, next) => {
121
+ const assembly = await next();
122
+ for (const context of assembly.contexts) if (!allowedContexts.has(context.name) && !shadowed.has(context.name)) {
123
+ child.systemPrompt.context({
124
+ name: context.name,
125
+ order: 0,
126
+ text: "",
127
+ interpolate: false
128
+ });
129
+ shadowed.add(context.name);
130
+ }
131
+ return {
132
+ ...assembly,
133
+ contexts: assembly.contexts.filter((context) => allowedContexts.has(context.name)),
134
+ variables: {},
135
+ tools: assembly.tools.filter((tool) => isDreamTool(tool.name))
136
+ };
137
+ });
138
+ child.on("agent/pre-step", async (_payload, next) => {
139
+ if (session.finished) throw new JobError("dream_finished", "Dream 已完成。");
140
+ bounded.throwIfAborted();
141
+ return next();
142
+ });
143
+ child.on("agent/request", async (payload, next) => {
144
+ try {
145
+ await session.admitStep(AbortSignal.any([bounded, payload.signal]));
146
+ } catch (error) {
147
+ stepError = error instanceof Error ? error : new JobError("dream_step", "Dream 模型请求准入失败。");
148
+ throw stepError;
149
+ }
150
+ clearRequestTimeout();
151
+ const timeout = AbortSignal.timeout(config.timeoutMs);
152
+ const expire = () => {
153
+ requestDeadline.abort(timeout.reason);
154
+ };
155
+ timeout.addEventListener("abort", expire, { once: true });
156
+ clearRequestTimeout = () => {
157
+ timeout.removeEventListener("abort", expire);
158
+ };
159
+ return next();
160
+ });
161
+ child.on("agent/assistant-stream", ({ frame }) => {
162
+ if (frame.type !== "end") return;
163
+ clearRequestTimeout();
164
+ if (frame.outcome.kind === "committed" && frame.outcome.eventType === "assistant/message") toolJsonFeedback = "";
165
+ });
166
+ child.on("agent/request-error", async (payload, next) => {
167
+ clearRequestTimeout();
168
+ if (payload.failure.code !== "MALFORMED_RESPONSE" || !/(?:^|: )tool input is invalid JSON$/u.test(payload.failure.message)) return next();
169
+ bounded.throwIfAborted();
170
+ payload.signal.throwIfAborted();
171
+ if (toolJsonRetries < 2) {
172
+ toolJsonRetries += 1;
173
+ toolJsonFeedback = "工具参数 JSON 解析失败(MALFORMED_RESPONSE)。上一条模型响应未被接纳,该响应中的工具调用均未执行。请重新发出需要的工具调用,参数必须是完整合法的 JSON 对象,正确闭合并使用双引号和转义,同时遵守工具 schema。不要只输出解释或将失败调用视为已执行。已接受的进度保留,修复请求仍计入现有探索与收尾额度;按当前阶段和剩余额度行动。";
174
+ return { kind: "retry" };
175
+ }
176
+ stepError = new JobError("dream_tool_json", "模型返回的工具参数格式无效(MALFORMED_RESPONSE),自动重试两次后仍失败;进度和已用额度已保留,可稍后重试或更换知识模型。");
177
+ }, { prepend: true });
178
+ child.on("session/event", (_session, event) => {
179
+ if (event.type !== "turn/end") return;
180
+ clearRequestTimeout();
181
+ const reason = event.data.reason;
182
+ completed = reason.kind === "completed";
183
+ if (stepError !== void 0) return;
184
+ if (reason.kind === "error") {
185
+ const failure = transportError(reason.error);
186
+ stepError = new JobError(failure.kind, `Dream 模型调用失败:${failure.message} 已有进度和已用额度保留。`);
187
+ }
188
+ if (reason.kind === "max-tokens") stepError = new JobError("dream_output_limit", "Dream 模型输出达到 token 上限(MAX_TOKENS);进度和已用额度保留,请精简整理范围或调整输出上限后重试。");
189
+ });
190
+ }
191
+ });
192
+ const cancel = () => {
193
+ handle.agent.cancel({ kind: "parent" });
194
+ };
195
+ bounded.addEventListener("abort", cancel, { once: true });
196
+ const waitForTurn = async () => {
197
+ await abortable(handle.agent.whenIdle(), bounded);
198
+ bounded.throwIfAborted();
199
+ if (!session.finished && !completed) throw stepError ?? new JobError("dream_incomplete", "Dream 子会话未正常结束;已有进度和额度保留,可通过 /acn-status retry 重试。");
200
+ };
201
+ try {
202
+ bounded.throwIfAborted();
203
+ handle.agent.followup(createUserMessage({
204
+ content: [{
205
+ type: "text",
206
+ text: JSON.stringify(await session.input())
207
+ }],
208
+ source: { kind: "acn-formation" }
209
+ }));
210
+ await waitForTurn();
211
+ for (let repairs = 0; !session.finished && !session.exhausted && repairs < 2; repairs += 1) {
212
+ completed = false;
213
+ handle.agent.followup(createUserMessage({
214
+ content: [{
215
+ type: "text",
216
+ text: "上一条总结没有完成 Dream。不要重复普通文本收尾。继续使用工具修复;逐组 dream_validate、dream_apply_group,然后 dream_finish。无变化也必须调用 dream_finish;已经接受的草稿和复核仍保留。"
217
+ }],
218
+ source: { kind: "acn-formation" }
219
+ }));
220
+ await waitForTurn();
221
+ }
222
+ if (!session.finished && session.exhausted && !session.wrappingUp) {
223
+ completed = false;
224
+ handle.agent.followup(createUserMessage({
225
+ content: [{
226
+ type: "text",
227
+ text: "探索额度已用尽,请完成本次 Dream 收尾并调用 dream_finish。"
228
+ }],
229
+ source: { kind: "acn-formation" }
230
+ }));
231
+ await waitForTurn();
232
+ }
233
+ if (!session.finished && session.exhausted) await session.finishBudget(bounded);
234
+ if (session.finished) return;
235
+ if (stepError !== void 0) throw stepError;
236
+ throw new JobError("dream_incomplete", "Dream 未调用 dream_finish;已有进度已保留,可通过 /acn-status retry 重试。");
237
+ } catch (error) {
238
+ signal.throwIfAborted();
239
+ if (requestDeadline.signal.aborted) throw new JobError("dream_timeout", "Dream 单次模型请求超时,子会话已停止,已用轮数和进度保留。", true);
240
+ throw error;
241
+ } finally {
242
+ clearRequestTimeout();
243
+ bounded.removeEventListener("abort", cancel);
244
+ await handle.dispose();
245
+ }
246
+ };
247
+ }
248
+ //#endregion
249
+ export { autonomousDreamRunner as t };
package/lib/dream.js ADDED
@@ -0,0 +1,4 @@
1
+ import { $ as OperationSchema, A as valueHash, B as CandidateSchema, C as expandDraft, D as sameIds, E as reviewInput, F as evidenceBody, G as DraftResponseSchema, H as CoverageSchema, I as independentReceipt, J as GroupSchema, K as DreamStateSchema, L as requireEvidenceIds, N as ReceiptSchema, O as validateCandidates, P as directEvidence, Q as KindSchema, S as contentHash, T as reaches, U as DiscoverySchema, V as CheckpointSchema, W as DraftGroupSchema, X as KeepReasonSchema, Y as HashSchema, Z as KeySchema, _ as dreamEligible, a as GlobArgs, at as ReviewInputSchema, b as validateSelfReview, c as privateDataHome, ct as ReviewSummarySchema, d as readEvidenceFile, dt as UpdateSchema, et as OriginSchema, f as receiptCurrent, ft as ValidationSchema, g as conservativeTokens, h as claimInput, i as EvidenceTools, it as QuoteSchema, k as validateConsolidationSources, l as authorizeFile, lt as SelfReviewSchema, m as INPUT_TOKENS, mt as text, n as EvidenceManifestSchema, nt as PreparedGroupSchema, o as GrepArgs, ot as ReviewRecordSchema, p as within, pt as requireDream, q as DreamValidationError, r as EvidenceStore, rt as ProgressSchema, s as ReadArgs, st as ReviewResponseSchema, t as ClaimArgs, tt as PlanSchema, u as discoverable, ut as SemanticReviewSchema, v as versions, w as prepareGroup, x as validateSemanticReview, y as coverageGaps, z as BasisSchema } from "./evidence-store-DW7kj20i.js";
2
+ import { t as DreamStore } from "./checkpoint-c7aI4D-X.js";
3
+ import { a as SyncValidationSchema, i as DreamSync, t as AcnDream } from "./service-BPwaZzFF.js";
4
+ export { AcnDream, BasisSchema, CandidateSchema, CheckpointSchema, ClaimArgs, CoverageSchema, DiscoverySchema, DraftGroupSchema, DraftResponseSchema, DreamStateSchema, DreamStore, DreamSync, DreamValidationError, EvidenceManifestSchema, EvidenceStore, EvidenceTools, GlobArgs, GrepArgs, GroupSchema, HashSchema, INPUT_TOKENS, KeepReasonSchema, KeySchema, KindSchema, OperationSchema, OriginSchema, PlanSchema, PreparedGroupSchema, ProgressSchema, QuoteSchema, ReadArgs, ReceiptSchema, ReviewInputSchema, ReviewRecordSchema, ReviewResponseSchema, ReviewSummarySchema, SelfReviewSchema, SemanticReviewSchema, SyncValidationSchema, UpdateSchema, ValidationSchema, authorizeFile, claimInput, conservativeTokens, contentHash, coverageGaps, directEvidence, discoverable, dreamEligible, evidenceBody, expandDraft, independentReceipt, prepareGroup, privateDataHome, reaches, readEvidenceFile, receiptCurrent, requireDream, requireEvidenceIds, reviewInput, sameIds, text, validateCandidates, validateConsolidationSources, validateSelfReview, validateSemanticReview, valueHash, versions, within };