@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,56 @@
1
+ import { DreamSession } from './autonomous.js';
2
+ import type { Claim } from '../protocol/claim.js';
3
+ import type { ResolvedConfig } from '../config.js';
4
+ import type { Route } from '../formation/transcript.js';
5
+ import type { AcnKnowledge } from '../knowledge/service.js';
6
+ import type { StructuredBackend } from '../llm/structured.js';
7
+ import type { Job } from '../worker/types.js';
8
+ import { EvidenceStore } from './evidence-store.js';
9
+ export type EvidenceExplorer = (input: {
10
+ store: EvidenceStore;
11
+ claims: readonly Claim[];
12
+ route: Route;
13
+ config: ResolvedConfig['llm'];
14
+ signal: AbortSignal;
15
+ }) => Promise<void>;
16
+ export type AutonomousDreamRunner = (input: {
17
+ session: DreamSession;
18
+ route: Route;
19
+ config: ResolvedConfig['llm'];
20
+ system: string;
21
+ signal: AbortSignal;
22
+ }) => Promise<void>;
23
+ export interface DreamOptions {
24
+ workspace?: () => Promise<string>;
25
+ explore?: EvidenceExplorer;
26
+ run?: AutonomousDreamRunner;
27
+ }
28
+ export declare class AcnDream {
29
+ readonly knowledge: AcnKnowledge;
30
+ private readonly backend;
31
+ private readonly render;
32
+ private readonly beforeCall?;
33
+ private readonly options;
34
+ private readonly unregister;
35
+ private readonly timers;
36
+ private eligibilityRetry;
37
+ private pending;
38
+ private stopped;
39
+ private closed;
40
+ private active;
41
+ constructor(knowledge: AcnKnowledge, backend: StructuredBackend, render: (name: string, context: object) => string, beforeCall?: (() => Promise<void>) | undefined, options?: DreamOptions);
42
+ start(): Promise<void>;
43
+ private schedule;
44
+ trigger(): void;
45
+ flush(): Promise<void>;
46
+ check(): Promise<void>;
47
+ private eligible;
48
+ private workspace;
49
+ request(workspace?: string, sessionId?: string): Promise<Job>;
50
+ stop(): Promise<number>;
51
+ private boundary;
52
+ private call;
53
+ private run;
54
+ private compact;
55
+ close(): Promise<void>;
56
+ }
@@ -0,0 +1,147 @@
1
+ import { z } from 'zod';
2
+ import type { StoreContext } from '../store/context.js';
3
+ import type { ClaimId } from '../protocol/ids.js';
4
+ import type { SemanticReview } from './schema.js';
5
+ export declare const SyncValidationSchema: z.ZodObject<{
6
+ validation_id: z.ZodString;
7
+ input: z.ZodObject<{
8
+ before: z.ZodObject<{
9
+ id: z.core.$ZodBranded<z.ZodString, "ClaimId", "out">;
10
+ name: z.ZodString;
11
+ statement: z.ZodString;
12
+ scope: z.ZodString;
13
+ holder: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
14
+ confidence: z.ZodEnum<{
15
+ high: "high";
16
+ medium: "medium";
17
+ low: "low";
18
+ }>;
19
+ status: z.ZodEnum<{
20
+ active: "active";
21
+ stale: "stale";
22
+ deprecated: "deprecated";
23
+ }>;
24
+ created_at: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
25
+ updated_at: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
26
+ source_claim_ids: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ClaimId", "out">, z.core.$ZodBranded<z.ZodString, "PolicyId", "out">]>>>;
27
+ evidence_summary: z.ZodString;
28
+ }, z.core.$strip>;
29
+ carriers: z.ZodArray<z.ZodObject<{
30
+ id: z.core.$ZodBranded<z.ZodString, "ClaimId", "out">;
31
+ name: z.ZodString;
32
+ statement: z.ZodString;
33
+ scope: z.ZodString;
34
+ holder: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
35
+ confidence: z.ZodEnum<{
36
+ high: "high";
37
+ medium: "medium";
38
+ low: "low";
39
+ }>;
40
+ status: z.ZodEnum<{
41
+ active: "active";
42
+ stale: "stale";
43
+ deprecated: "deprecated";
44
+ }>;
45
+ created_at: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
46
+ updated_at: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
47
+ source_claim_ids: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ClaimId", "out">, z.core.$ZodBranded<z.ZodString, "PolicyId", "out">]>>>;
48
+ evidence_summary: z.ZodString;
49
+ }, z.core.$strip>>;
50
+ previous_dependency: z.ZodObject<{
51
+ before: z.ZodObject<{
52
+ id: z.core.$ZodBranded<z.ZodString, "ClaimId", "out">;
53
+ name: z.ZodString;
54
+ statement: z.ZodString;
55
+ scope: z.ZodString;
56
+ holder: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
57
+ confidence: z.ZodEnum<{
58
+ high: "high";
59
+ medium: "medium";
60
+ low: "low";
61
+ }>;
62
+ status: z.ZodEnum<{
63
+ active: "active";
64
+ stale: "stale";
65
+ deprecated: "deprecated";
66
+ }>;
67
+ created_at: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
68
+ updated_at: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
69
+ source_claim_ids: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ClaimId", "out">, z.core.$ZodBranded<z.ZodString, "PolicyId", "out">]>>>;
70
+ evidence_summary: z.ZodString;
71
+ }, z.core.$strip>;
72
+ retired: z.ZodObject<{
73
+ id: z.core.$ZodBranded<z.ZodString, "ClaimId", "out">;
74
+ name: z.ZodString;
75
+ statement: z.ZodString;
76
+ scope: z.ZodString;
77
+ holder: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
78
+ confidence: z.ZodEnum<{
79
+ high: "high";
80
+ medium: "medium";
81
+ low: "low";
82
+ }>;
83
+ status: z.ZodEnum<{
84
+ active: "active";
85
+ stale: "stale";
86
+ deprecated: "deprecated";
87
+ }>;
88
+ created_at: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
89
+ updated_at: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
90
+ source_claim_ids: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ClaimId", "out">, z.core.$ZodBranded<z.ZodString, "PolicyId", "out">]>>>;
91
+ evidence_summary: z.ZodString;
92
+ }, z.core.$strip>;
93
+ carriers: z.ZodArray<z.ZodObject<{
94
+ id: z.core.$ZodBranded<z.ZodString, "ClaimId", "out">;
95
+ name: z.ZodString;
96
+ statement: z.ZodString;
97
+ scope: z.ZodString;
98
+ holder: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
99
+ confidence: z.ZodEnum<{
100
+ high: "high";
101
+ medium: "medium";
102
+ low: "low";
103
+ }>;
104
+ status: z.ZodEnum<{
105
+ active: "active";
106
+ stale: "stale";
107
+ deprecated: "deprecated";
108
+ }>;
109
+ created_at: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
110
+ updated_at: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
111
+ source_claim_ids: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ClaimId", "out">, z.core.$ZodBranded<z.ZodString, "PolicyId", "out">]>>>;
112
+ evidence_summary: z.ZodString;
113
+ }, z.core.$strip>>;
114
+ }, z.core.$strip>;
115
+ current_source: z.ZodObject<{
116
+ id: z.core.$ZodBranded<z.ZodString, "ClaimId", "out">;
117
+ name: z.ZodString;
118
+ statement: z.ZodString;
119
+ scope: z.ZodString;
120
+ holder: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
121
+ confidence: z.ZodEnum<{
122
+ high: "high";
123
+ medium: "medium";
124
+ low: "low";
125
+ }>;
126
+ status: z.ZodEnum<{
127
+ active: "active";
128
+ stale: "stale";
129
+ deprecated: "deprecated";
130
+ }>;
131
+ created_at: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
132
+ updated_at: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
133
+ source_claim_ids: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ClaimId", "out">, z.core.$ZodBranded<z.ZodString, "PolicyId", "out">]>>>;
134
+ evidence_summary: z.ZodString;
135
+ }, z.core.$strip>;
136
+ }, z.core.$strict>;
137
+ }, z.core.$strict>;
138
+ export type SyncValidation = z.infer<typeof SyncValidationSchema>;
139
+ export declare class DreamSync {
140
+ readonly context: StoreContext;
141
+ private readonly semanticReview;
142
+ constructor(context: StoreContext, semanticReview?: boolean);
143
+ resume(jobId: string, sourceId: ClaimId, signal: AbortSignal): Promise<boolean>;
144
+ prepare(sourceId: ClaimId, carrierIds: readonly ClaimId[], signal?: AbortSignal): Promise<SyncValidation>;
145
+ private prepareLocked;
146
+ apply(jobId: string, validation: SyncValidation, review: SemanticReview, signal: AbortSignal): Promise<void>;
147
+ }
@@ -0,0 +1 @@
1
+ export declare const configurationRemote: import("@deepseek-ai/dsh-typert-protocol").TypertRemoteInfo<Readonly<Record<string, import("@deepseek-ai/dsh-typert-protocol").TypertRemoteMethod<object, unknown, "unary", never, unknown> | import("@deepseek-ai/dsh-typert-protocol").TypertRemoteMethod<object, unknown, "stream", unknown, unknown>>>>;
@@ -0,0 +1,28 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
3
+ import type { ConfigurationSnapshot, ConfigurationResult, SaveConfiguration } from '../configuration.js';
4
+ import type { InteractionRequest, InteractionResult } from '../interaction.js';
5
+ import type { CredentialRequest, CredentialResult } from '../credentials.js';
6
+ declare module '@deepseek-ai/cordis' {
7
+ interface Context {
8
+ acnConfiguration: ConfigurationService;
9
+ }
10
+ }
11
+ export declare function configurationRevision(raw: Record<string, unknown>): string;
12
+ export declare class ConfigurationService extends TypertRemoteService {
13
+ pending: number;
14
+ private mutationTail;
15
+ private readonly stagedCredentials;
16
+ private protectCredentials;
17
+ private serialize;
18
+ credential(request: CredentialRequest, signal?: AbortSignal): Promise<CredentialResult>;
19
+ private credentialOperation;
20
+ interact(request: InteractionRequest, signal?: AbortSignal): Promise<InteractionResult>;
21
+ constructor(ctx: Context);
22
+ private checkIdle;
23
+ private entry;
24
+ private models;
25
+ read(): Promise<ConfigurationSnapshot>;
26
+ save(request: SaveConfiguration): Promise<ConfigurationResult>;
27
+ private saveOperation;
28
+ }
@@ -0,0 +1,4 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import type { AutonomousDreamRunner } from '../dream/service.js';
3
+ export declare function dreamToolGuard(name: string, args: unknown): string | undefined;
4
+ export declare function autonomousDreamRunner(ctx: Context): AutonomousDreamRunner;
@@ -0,0 +1,3 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import type { EvidenceExplorer } from '../dream/service.js';
3
+ export declare function restrictedExplorer(ctx: Context, system: string): EvidenceExplorer;
@@ -0,0 +1,3 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import type { AcnFormation } from '../formation/service.js';
3
+ export declare function connectArchives(ctx: Context, formation: Pick<AcnFormation, 'beginArchive' | 'cancelArchive' | 'archived' | 'reconcileArchives'>, owns?: (id: string) => Promise<boolean>): Promise<void>;
@@ -0,0 +1,5 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import type { ResolvedConfig } from '../config.js';
3
+ import type { ProjectionReplay } from '../formation/capture.js';
4
+ export declare function formationOwnership(ctx: Context, config: ResolvedConfig): (id: string) => Promise<boolean>;
5
+ export declare function formationReplay(ctx: Context, config: ResolvedConfig): ProjectionReplay;
@@ -0,0 +1,4 @@
1
+ import type { SessionEvent } from '@deepseek-ai/dsh-session';
2
+ import type { Projection } from '../formation/transcript.js';
3
+ export declare function projectEvent(event: SessionEvent): Projection;
4
+ export declare function compactionEnd(event: unknown): number | undefined;
@@ -0,0 +1,13 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import type { InteractionRequest, InteractionResult, KnowledgeView } from '../interaction.js';
3
+ import type { ActivityPage } from '../activities.js';
4
+ import type { RuntimePool } from './runtime-pool.js';
5
+ import type { CredentialResolver } from '../team/http.js';
6
+ export declare function checkTeamConnection(ctx: Context, connection: Extract<InteractionRequest, {
7
+ action: 'check';
8
+ }>['connection'], credential?: CredentialResolver, signal?: AbortSignal): Promise<InteractionResult>;
9
+ export declare function readKnowledge(pool: RuntimePool, key: string, kind: 'claim' | 'dispute' | 'trace', query: string, offset: number, entities?: boolean, activityOptions?: ActivityPage, filters?: {
10
+ status?: string;
11
+ delivery?: string;
12
+ }): Promise<KnowledgeView>;
13
+ export declare function executeInteraction(ctx: Context, input: InteractionRequest, runtimePool?: RuntimePool, signal?: AbortSignal): Promise<InteractionResult>;
@@ -0,0 +1,3 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import type { AcnKnowledge } from '../knowledge/service.js';
3
+ export declare function protectKnowledgePaths(ctx: Context, knowledge: AcnKnowledge): void;
@@ -0,0 +1,10 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import type { StructuredBackend } from '../llm/structured.js';
3
+ declare module '@deepseek-ai/dsh-llm' {
4
+ interface MessageSourceMap {
5
+ 'acn-formation': {
6
+ kind: 'acn-formation';
7
+ };
8
+ }
9
+ }
10
+ export declare function structuredBackend(ctx: Context): StructuredBackend;
@@ -0,0 +1,4 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import type { SessionHeader } from '@deepseek-ai/dsh-session';
3
+ import type { SessionSelection } from './session-binding.js';
4
+ export declare function recentProjectSelection(ctx: Context, current: SessionHeader): Promise<SessionSelection | undefined>;
@@ -0,0 +1,110 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import type { SessionHeader, SessionEvent } from '@deepseek-ai/dsh-session';
3
+ import { z } from 'zod';
4
+ import type { ResolvedConfig } from '../config.js';
5
+ import { AcnKnowledge } from '../knowledge/service.js';
6
+ import { KnowledgeSessions } from '../knowledge/sessions.js';
7
+ import { AcnFormation } from '../formation/service.js';
8
+ import { AcnInbox } from '../inbox/service.js';
9
+ import { AcnDream } from '../dream/service.js';
10
+ import { UploadScheduler } from '../upload/scheduler.js';
11
+ import type { SessionView } from '../interaction.js';
12
+ export interface Runtime {
13
+ knowledge: AcnKnowledge;
14
+ formation: AcnFormation;
15
+ inbox: AcnInbox;
16
+ dream: AcnDream;
17
+ catalog: KnowledgeSessions;
18
+ uploads: UploadScheduler;
19
+ components: Set<RuntimeComponent>;
20
+ setComponent(component: RuntimeComponent, enabled: boolean): Promise<void>;
21
+ close(): Promise<void>;
22
+ }
23
+ export type RuntimeComponent = 'prompt' | 'formation' | 'inbox' | 'dream';
24
+ declare module '@deepseek-ai/cordis' {
25
+ interface Context {
26
+ acnRuntime: RuntimePool;
27
+ }
28
+ }
29
+ export declare class RuntimePool {
30
+ private readonly owner;
31
+ readonly base: AcnKnowledge;
32
+ private readonly runtimes;
33
+ private readonly ready;
34
+ private readonly workers;
35
+ private readonly preferredWorkers;
36
+ private readonly retiredWorkers;
37
+ private starting;
38
+ private readonly instructions;
39
+ private render;
40
+ private readonly syncs;
41
+ private readonly syncTasks;
42
+ private readonly baselines;
43
+ private readonly baselineRenderers;
44
+ private readonly admissions;
45
+ private readonly resumed;
46
+ private readonly attached;
47
+ private readonly unboundTools;
48
+ private readonly components;
49
+ private pending;
50
+ private closed;
51
+ get preparing(): boolean;
52
+ private host;
53
+ get ctx(): Context;
54
+ constructor(owner: Context, base: AcnKnowledge);
55
+ component(name: RuntimeComponent): () => Promise<void>;
56
+ supportsJob(key: string, kind: import('../worker/types.js').JobKind): boolean;
57
+ private enabled;
58
+ choices(): {
59
+ key: string;
60
+ name: string;
61
+ agentId: string & z.core.$brand<"AgentId">;
62
+ enabled: boolean;
63
+ mode: "team" | "solo";
64
+ }[];
65
+ config(key: string, includeDisabled?: boolean): ResolvedConfig | undefined;
66
+ private forSession;
67
+ private runtimeId;
68
+ private prefer;
69
+ private readyFor;
70
+ backgroundSelection(config: ResolvedConfig): {
71
+ schemaVersion: 1;
72
+ key: string;
73
+ identity: string;
74
+ prepared: boolean;
75
+ } | undefined;
76
+ private selected;
77
+ private defaultFor;
78
+ sessionView(header: SessionHeader, events?: readonly SessionEvent[]): Promise<SessionView>;
79
+ key(header: SessionHeader): string;
80
+ isBase(key: string): boolean;
81
+ allowed(header: SessionHeader): boolean;
82
+ unbound(header: SessionHeader, events?: readonly SessionEvent[]): boolean;
83
+ chatAllowed(header: SessionHeader): boolean;
84
+ knowledge(header: SessionHeader): Promise<AcnKnowledge>;
85
+ service(header: SessionHeader): Promise<{
86
+ knowledge: AcnKnowledge;
87
+ formation: AcnFormation | undefined;
88
+ inbox: AcnInbox | undefined;
89
+ dream: AcnDream | undefined;
90
+ }>;
91
+ activate(key: string): Promise<AcnKnowledge>;
92
+ dreamService(key: string): Promise<AcnDream | undefined>;
93
+ registerBaseline(refresh: (id: string, fetchOverview?: boolean) => Promise<void>, render: (header: SessionHeader) => Record<string, string>): () => void;
94
+ private hasUser;
95
+ private selectionLocked;
96
+ view(header: SessionHeader, events?: readonly SessionEvent[]): SessionView;
97
+ select(header: SessionHeader, key: string): Promise<SessionView>;
98
+ cancel(header: SessionHeader): Promise<void>;
99
+ sync(header: SessionHeader): Promise<void>;
100
+ private synchronize;
101
+ private ensure;
102
+ private create;
103
+ private freezeInstructions;
104
+ private bind;
105
+ private attach;
106
+ private prepareSession;
107
+ private install;
108
+ private schedule;
109
+ close(): Promise<void>;
110
+ }
@@ -0,0 +1,43 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import type { SessionHeader, SessionEvent } from '@deepseek-ai/dsh-session';
3
+ import { z } from 'zod';
4
+ import { type ResolvedConfig } from '../config.js';
5
+ declare const BindingSchema: z.ZodObject<{
6
+ schemaVersion: z.ZodLiteral<1>;
7
+ identity: z.ZodString;
8
+ }, z.core.$strict>;
9
+ declare const EligibilitySchema: z.ZodObject<{
10
+ schemaVersion: z.ZodLiteral<1>;
11
+ }, z.core.$strict>;
12
+ export declare const SelectionSchema: z.ZodObject<{
13
+ schemaVersion: z.ZodLiteral<1>;
14
+ key: z.ZodString;
15
+ identity: z.ZodString;
16
+ prepared: z.ZodOptional<z.ZodBoolean>;
17
+ }, z.core.$strict>;
18
+ export type SessionSelection = z.infer<typeof SelectionSchema>;
19
+ declare module '@deepseek-ai/dsh-session' {
20
+ interface PluginRecordMap {
21
+ 'plugin:acn/session-binding': z.infer<typeof BindingSchema>;
22
+ 'plugin:acn/team-selection': SessionSelection;
23
+ 'plugin:acn/session-eligibility': z.infer<typeof EligibilitySchema>;
24
+ }
25
+ }
26
+ export declare const identityOf: (config: ResolvedConfig) => string;
27
+ export declare const configurationActivation: (header: SessionHeader) => number;
28
+ export declare function runningConfiguration(header: SessionHeader): ResolvedConfig | undefined;
29
+ export declare function rememberConfiguration(header: SessionHeader, config: ResolvedConfig): void;
30
+ export declare function forgetConfiguration(header: SessionHeader): void;
31
+ export declare function observeSelection(header: SessionHeader, event: SessionEvent): void;
32
+ export declare function restoreSessionBinding(header: SessionHeader, events: readonly SessionEvent[]): void;
33
+ export declare function sessionSelection(ctx: Context, header: SessionHeader): SessionSelection | undefined;
34
+ export declare function sessionHasWork(events: readonly SessionEvent[]): boolean;
35
+ export declare function sessionEligible(ctx: Context, header: SessionHeader, events?: readonly SessionEvent[] | undefined): boolean;
36
+ export declare function markSessionEligible(ctx: Context, header: SessionHeader): void;
37
+ export declare function sessionUnbound(ctx: Context, header: SessionHeader, events?: readonly SessionEvent[]): boolean;
38
+ export declare function bindSession(ctx: Context, config: ResolvedConfig, header: SessionHeader): void;
39
+ export declare const sessionChanged = "ACN \u4F1A\u8BDD\u8EAB\u4EFD\u4E0E\u5F53\u524D\u914D\u7F6E\u4E0D\u4E00\u81F4\uFF0C\u6216\u7F3A\u5C11\u53EF\u9A8C\u8BC1\u7684\u5386\u53F2\u8EAB\u4EFD\u8BB0\u5F55\uFF0C\u8BF7\u65B0\u5EFA\u4F1A\u8BDD\u3002\u65E7\u4F1A\u8BDD\u4E0D\u80FD\u8BBF\u95EE\u5F53\u524D\u8EAB\u4EFD\u7684\u77E5\u8BC6\u3002";
40
+ export declare const configurationBusy = "ACN \u914D\u7F6E\u6B63\u5728\u5E94\u7528\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002";
41
+ export declare const unboundSession = "\u672C\u4F1A\u8BDD\u672A\u542F\u7528 ACN\uFF0C\u804A\u5929\u4ECD\u53EF\u7EE7\u7EED\u3002\u53EA\u6709\u5B89\u88C5\u63D2\u4EF6\u540E\u65B0\u5EFA\u4E14\u5C1A\u672A\u53D1\u9001\u6D88\u606F\u7684\u4F1A\u8BDD\u53EF\u9009\u62E9\u5DE5\u4F5C\u914D\u7F6E\uFF1B\u5982\u9700\u4F7F\u7528 ACN\uFF0C\u8BF7\u65B0\u5EFA\u4F1A\u8BDD\u3002";
42
+ export declare function sessionAllowed(ctx: Context, config: ResolvedConfig, header: SessionHeader): boolean;
43
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import type { SourceSession } from '../interaction.js';
3
+ export declare function sourceSession(ctx: Context, id: string, signal?: AbortSignal): Promise<SourceSession>;
@@ -0,0 +1,5 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import type { CredentialRef } from '@deepseek-ai/dsh-credentials/types';
3
+ import type { CredentialResolver } from '../team/http.js';
4
+ export declare function credentialReference(reference: string): CredentialRef;
5
+ export declare function teamCredentials(ctx: Context): CredentialResolver;
@@ -0,0 +1,4 @@
1
+ import { z } from 'zod';
2
+ declare const JsonObject: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
3
+ export declare function toolParameters(schema: z.ZodType): z.infer<typeof JsonObject>;
4
+ export {};
@@ -0,0 +1,5 @@
1
+ import type { ToolDefinition } from '@deepseek-ai/dsh-tools';
2
+ import type { AcnKnowledge } from '../knowledge/service.js';
3
+ import type { SessionHeader } from '@deepseek-ai/dsh-session';
4
+ export declare function claimTool(knowledge: AcnKnowledge, resolve?: (header: SessionHeader) => Promise<AcnKnowledge>): ToolDefinition;
5
+ export declare function consultRouterTool(knowledge: AcnKnowledge, resolve?: (header: SessionHeader) => Promise<AcnKnowledge>): ToolDefinition;
@@ -0,0 +1,19 @@
1
+ import { JobError } from '../worker/types.js';
2
+ import type { TranscriptStore, Projection } from './transcript.js';
3
+ export type ProjectionReplay = (id: string) => Promise<readonly Projection[]>;
4
+ export type FormationStage = 'projection' | 'replay' | 'route' | 'scan' | 'enqueue';
5
+ export declare function formationFault(error: unknown): string;
6
+ export declare function retryFormation<T>(action: () => Promise<T>): Promise<T>;
7
+ export declare function projectionError(error: unknown, stage: 'projection' | 'replay', seq?: number): JobError;
8
+ export declare class FormationCapture {
9
+ private readonly transcript;
10
+ private readonly replay?;
11
+ private readonly buffers;
12
+ private readonly blocked;
13
+ private readonly restored;
14
+ constructor(transcript: TranscriptStore, replay?: ProjectionReplay | undefined);
15
+ add(id: string, projection: Projection): void;
16
+ drain(id: string, retry?: boolean): Promise<void>;
17
+ prepare(id: string): Promise<void>;
18
+ ids(): string[];
19
+ }
@@ -0,0 +1,136 @@
1
+ import { z } from 'zod';
2
+ import type { StoreContext } from '../store/context.js';
3
+ import type { Claim } from '../protocol/claim.js';
4
+ import type { JobControl } from '../worker/worker.js';
5
+ import type { PreparedFormation } from './prepare.js';
6
+ import { TranscriptStore } from './transcript.js';
7
+ export declare const CheckpointSchema: z.ZodObject<{
8
+ schemaVersion: z.ZodLiteral<1>;
9
+ sessionId: z.ZodString;
10
+ jobId: z.ZodString;
11
+ kind: z.ZodEnum<{
12
+ finalize: "finalize";
13
+ recap: "recap";
14
+ }>;
15
+ fromSeq: z.ZodNumber;
16
+ untilSeq: z.ZodNumber;
17
+ status: z.ZodEnum<{
18
+ prepared: "prepared";
19
+ applied: "applied";
20
+ }>;
21
+ analysisClaims: z.ZodNullable<z.ZodArray<z.ZodObject<{
22
+ id: z.core.$ZodBranded<z.ZodString, "ClaimId", "out">;
23
+ name: z.ZodString;
24
+ statement: z.ZodString;
25
+ scope: z.ZodString;
26
+ holder: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
27
+ confidence: z.ZodEnum<{
28
+ high: "high";
29
+ medium: "medium";
30
+ low: "low";
31
+ }>;
32
+ status: z.ZodEnum<{
33
+ active: "active";
34
+ stale: "stale";
35
+ deprecated: "deprecated";
36
+ }>;
37
+ created_at: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
38
+ updated_at: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
39
+ source_claim_ids: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ClaimId", "out">, z.core.$ZodBranded<z.ZodString, "PolicyId", "out">]>>>;
40
+ evidence_summary: z.ZodString;
41
+ }, z.core.$strip>>>;
42
+ preparedClaims: z.ZodArray<z.ZodObject<{
43
+ id: z.core.$ZodBranded<z.ZodString, "ClaimId", "out">;
44
+ name: z.ZodString;
45
+ statement: z.ZodString;
46
+ scope: z.ZodString;
47
+ holder: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
48
+ confidence: z.ZodEnum<{
49
+ high: "high";
50
+ medium: "medium";
51
+ low: "low";
52
+ }>;
53
+ status: z.ZodEnum<{
54
+ active: "active";
55
+ stale: "stale";
56
+ deprecated: "deprecated";
57
+ }>;
58
+ created_at: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
59
+ updated_at: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
60
+ source_claim_ids: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ClaimId", "out">, z.core.$ZodBranded<z.ZodString, "PolicyId", "out">]>>>;
61
+ evidence_summary: z.ZodString;
62
+ }, z.core.$strip>>;
63
+ appliedClaims: z.ZodArray<z.ZodObject<{
64
+ id: z.core.$ZodBranded<z.ZodString, "ClaimId", "out">;
65
+ name: z.ZodString;
66
+ statement: z.ZodString;
67
+ scope: z.ZodString;
68
+ holder: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
69
+ confidence: z.ZodEnum<{
70
+ high: "high";
71
+ medium: "medium";
72
+ low: "low";
73
+ }>;
74
+ status: z.ZodEnum<{
75
+ active: "active";
76
+ stale: "stale";
77
+ deprecated: "deprecated";
78
+ }>;
79
+ created_at: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
80
+ updated_at: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
81
+ source_claim_ids: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ClaimId", "out">, z.core.$ZodBranded<z.ZodString, "PolicyId", "out">]>>>;
82
+ evidence_summary: z.ZodString;
83
+ }, z.core.$strip>>;
84
+ teamAuthorized: z.ZodOptional<z.ZodBoolean>;
85
+ disputes: z.ZodArray<z.ZodObject<{
86
+ id: z.core.$ZodBranded<z.ZodString, "DisputeId", "out">;
87
+ name: z.ZodString;
88
+ reporter_agent_id: z.ZodDefault<z.core.$ZodBranded<z.ZodString, "AgentId", "out">>;
89
+ claims: z.ZodArray<z.core.$ZodBranded<z.ZodString, "ClaimId", "out">>;
90
+ summary: z.ZodString;
91
+ status: z.ZodEnum<{
92
+ open: "open";
93
+ resolved: "resolved";
94
+ }>;
95
+ created_at: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
96
+ resolved_at: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
97
+ }, z.core.$strip>>;
98
+ trace: z.ZodNullable<z.ZodObject<{
99
+ id: z.core.$ZodBranded<z.ZodString, "TraceId", "out">;
100
+ name: z.ZodString;
101
+ task: z.ZodString;
102
+ agent: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
103
+ input_claims: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ClaimId", "out">, z.core.$ZodBranded<z.ZodString, "PolicyId", "out">]>>>;
104
+ output_claims: z.ZodDefault<z.ZodArray<z.core.$ZodBranded<z.ZodString, "ClaimId", "out">>>;
105
+ created_at: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
106
+ }, z.core.$strip>>;
107
+ warnings: z.ZodArray<z.ZodString>;
108
+ }, z.core.$strict>;
109
+ export type FormationCheckpoint = z.infer<typeof CheckpointSchema>;
110
+ export declare class FormationStore {
111
+ readonly context: StoreContext;
112
+ readonly transcript: TranscriptStore;
113
+ constructor(context: StoreContext);
114
+ read(sessionId: string): Promise<FormationCheckpoint | null>;
115
+ private write;
116
+ recover(): Promise<void>;
117
+ recoverLocked(): Promise<void>;
118
+ commit(input: {
119
+ sessionId: string;
120
+ jobId: string;
121
+ kind: 'recap' | 'finalize';
122
+ fromSeq: number;
123
+ untilSeq: number;
124
+ analysisClaims: Claim[];
125
+ prepared: PreparedFormation;
126
+ task: string;
127
+ }, control: JobControl): Promise<{
128
+ applied: boolean;
129
+ warnings: string[];
130
+ claimCount: number;
131
+ disputeCount: number;
132
+ traceCount: number;
133
+ entityIds?: string[];
134
+ }>;
135
+ private applyLocked;
136
+ }
@@ -0,0 +1,10 @@
1
+ export * from './schema.js';
2
+ export * from './prepare.js';
3
+ export * from './transcript.js';
4
+ export * from './checkpoint.js';
5
+ export * from './service.js';
6
+ export * from '../worker/types.js';
7
+ export * from '../worker/queue.js';
8
+ export * from '../worker/worker.js';
9
+ export * from '../llm/structured.js';
10
+ export * from '../knowledge/alignment.js';