@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,141 @@
1
+ import { z } from 'zod';
2
+ export declare const InboxMessageSchema: z.ZodPreprocess<z.ZodDiscriminatedUnion<[z.ZodObject<{
3
+ id: z.core.$ZodBranded<z.ZodString, "InboxId", "out">;
4
+ message_type: z.ZodLiteral<"policy_update">;
5
+ policy: z.ZodObject<{
6
+ id: z.core.$ZodBranded<z.ZodString, "PolicyId", "out">;
7
+ message_type: z.ZodDefault<z.ZodEnum<{
8
+ policy_update: "policy_update";
9
+ claim_attribute_update: "claim_attribute_update";
10
+ }>>;
11
+ name: z.ZodString;
12
+ statement: z.ZodString;
13
+ scope: z.ZodString;
14
+ status: z.ZodEnum<{
15
+ active: "active";
16
+ deprecated: "deprecated";
17
+ }>;
18
+ created_at: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
19
+ updated_at: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
20
+ target_agents: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.core.$ZodBranded<z.ZodString, "AgentId", "out">>>>;
21
+ }, z.core.$strip>;
22
+ handled_at: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
23
+ }, z.core.$strip>, z.ZodObject<{
24
+ id: z.core.$ZodBranded<z.ZodString, "InboxId", "out">;
25
+ message_type: z.ZodLiteral<"claim_attribute_update">;
26
+ policy: z.ZodObject<{
27
+ id: z.core.$ZodBranded<z.ZodString, "PolicyId", "out">;
28
+ message_type: z.ZodDefault<z.ZodEnum<{
29
+ policy_update: "policy_update";
30
+ claim_attribute_update: "claim_attribute_update";
31
+ }>>;
32
+ name: z.ZodString;
33
+ statement: z.ZodString;
34
+ scope: z.ZodString;
35
+ status: z.ZodEnum<{
36
+ active: "active";
37
+ deprecated: "deprecated";
38
+ }>;
39
+ created_at: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
40
+ updated_at: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
41
+ target_agents: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.core.$ZodBranded<z.ZodString, "AgentId", "out">>>>;
42
+ }, z.core.$strip>;
43
+ arbitration_resolution: z.ZodPreprocess<z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
44
+ context_snapshot_hash: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
45
+ dispute_snapshot: z.ZodObject<{
46
+ id: z.core.$ZodBranded<z.ZodString, "DisputeId", "out">;
47
+ name: z.ZodString;
48
+ reporter_agent_id: z.ZodDefault<z.core.$ZodBranded<z.ZodString, "AgentId", "out">>;
49
+ claims: z.ZodArray<z.core.$ZodBranded<z.ZodString, "ClaimId", "out">>;
50
+ summary: z.ZodString;
51
+ status: z.ZodEnum<{
52
+ open: "open";
53
+ resolved: "resolved";
54
+ }>;
55
+ created_at: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
56
+ resolved_at: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
57
+ }, z.core.$strip>;
58
+ direct_claim_snapshots: z.ZodArray<z.ZodObject<{
59
+ id: z.core.$ZodBranded<z.ZodString, "ClaimId", "out">;
60
+ name: z.ZodString;
61
+ statement: z.ZodString;
62
+ scope: z.ZodString;
63
+ holder: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
64
+ confidence: z.ZodEnum<{
65
+ high: "high";
66
+ medium: "medium";
67
+ low: "low";
68
+ }>;
69
+ status: z.ZodEnum<{
70
+ active: "active";
71
+ stale: "stale";
72
+ deprecated: "deprecated";
73
+ }>;
74
+ created_at: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
75
+ updated_at: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
76
+ source_claim_ids: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ClaimId", "out">, z.core.$ZodBranded<z.ZodString, "PolicyId", "out">]>>>;
77
+ evidence_summary: z.ZodString;
78
+ }, z.core.$strip>>;
79
+ snapshot_source_resolution_id: z.ZodPreprocess<z.ZodOptional<z.core.$ZodBranded<z.ZodString, "ResolutionId", "out">>>;
80
+ resolution_id: z.core.$ZodBranded<z.ZodString, "ResolutionId", "out">;
81
+ resolved_by: z.ZodEnum<{
82
+ human: "human";
83
+ automatic: "automatic";
84
+ }>;
85
+ resolved_at: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
86
+ resolution_type: z.ZodPreprocess<z.ZodOptional<z.ZodEnum<{
87
+ coexist: "coexist";
88
+ lifecycle_update: "lifecycle_update";
89
+ conflict_resolved: "conflict_resolved";
90
+ unresolved: "unresolved";
91
+ }>>>;
92
+ resolution_basis: z.ZodPreprocess<z.ZodOptional<z.ZodEnum<{
93
+ evidence: "evidence";
94
+ insufficient_evidence: "insufficient_evidence";
95
+ direct_analysis: "direct_analysis";
96
+ prior_resolution: "prior_resolution";
97
+ policy: "policy";
98
+ }>>>;
99
+ conclusion: z.ZodString;
100
+ claim_assessments: z.ZodPipe<z.ZodDefault<z.ZodArray<z.ZodObject<{
101
+ claim_id: z.core.$ZodBranded<z.ZodString, "ClaimId", "out">;
102
+ recommended_status: z.ZodEnum<{
103
+ active: "active";
104
+ stale: "stale";
105
+ deprecated: "deprecated";
106
+ }>;
107
+ assessment: z.ZodString;
108
+ recommended_scope: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
109
+ recommended_statement: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
110
+ reason: z.ZodString;
111
+ }, z.core.$strip>>>, z.ZodTransform<{
112
+ claim_id: string & z.core.$brand<"ClaimId">;
113
+ recommended_status: "active" | "stale" | "deprecated";
114
+ assessment: string;
115
+ reason: string;
116
+ recommended_scope?: string | undefined;
117
+ recommended_statement?: string | undefined;
118
+ }[] | undefined, {
119
+ claim_id: string & z.core.$brand<"ClaimId">;
120
+ recommended_status: "active" | "stale" | "deprecated";
121
+ assessment: string;
122
+ reason: string;
123
+ recommended_scope?: string | undefined;
124
+ recommended_statement?: string | undefined;
125
+ }[]>>;
126
+ rejection_reason: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
127
+ dispute_id: z.core.$ZodBranded<z.ZodString, "DisputeId", "out">;
128
+ }, z.core.$loose>>>>;
129
+ handled_at: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
130
+ }, z.core.$strip>], "message_type">>;
131
+ export type InboxMessage = z.infer<typeof InboxMessageSchema>;
132
+ export declare const InboxAckRequestSchema: z.ZodObject<{
133
+ agent_id: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
134
+ inbox_ids: z.ZodArray<z.core.$ZodBranded<z.ZodString, "InboxId", "out">>;
135
+ }, z.core.$strip>;
136
+ export declare const InboxPullRequestSchema: z.ZodObject<{
137
+ agent_id: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
138
+ }, z.core.$strip>;
139
+ export type InboxAckRequest = z.infer<typeof InboxAckRequestSchema>;
140
+ export type InboxPullRequest = z.infer<typeof InboxPullRequestSchema>;
141
+ export declare const inboxEventAt: (message: InboxMessage) => string;
@@ -0,0 +1,11 @@
1
+ export * from './ids.js';
2
+ export * from './time.js';
3
+ export * from './claim.js';
4
+ export * from './trace.js';
5
+ export * from './dispute.js';
6
+ export * from './policy.js';
7
+ export * from './arbitration.js';
8
+ export * from './inbox.js';
9
+ export * from './router.js';
10
+ export * from './auth.js';
11
+ export * from './revision.js';
@@ -0,0 +1,21 @@
1
+ import { z } from 'zod';
2
+ export declare const PolicySchema: z.ZodObject<{
3
+ id: z.core.$ZodBranded<z.ZodString, "PolicyId", "out">;
4
+ message_type: z.ZodDefault<z.ZodEnum<{
5
+ policy_update: "policy_update";
6
+ claim_attribute_update: "claim_attribute_update";
7
+ }>>;
8
+ name: z.ZodString;
9
+ statement: z.ZodString;
10
+ scope: z.ZodString;
11
+ status: z.ZodEnum<{
12
+ active: "active";
13
+ deprecated: "deprecated";
14
+ }>;
15
+ created_at: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
16
+ updated_at: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
17
+ target_agents: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.core.$ZodBranded<z.ZodString, "AgentId", "out">>>>;
18
+ }, z.core.$strip>;
19
+ export type Policy = z.infer<typeof PolicySchema>;
20
+ export type PolicyMessageType = Policy['message_type'];
21
+ export type PolicyStatus = Policy['status'];
@@ -0,0 +1,2 @@
1
+ export declare function canonicalJson(value: unknown): string;
2
+ export declare function claimRevision(value: unknown): string;
@@ -0,0 +1,114 @@
1
+ import { z } from 'zod';
2
+ export declare const AgentQuerySchema: z.ZodObject<{
3
+ scope: z.ZodString;
4
+ semantic_query: z.ZodDefault<z.ZodNullable<z.ZodString>>;
5
+ }, z.core.$strip>;
6
+ export declare const CandidateClaimSchema: z.ZodObject<{
7
+ id: z.core.$ZodBranded<z.ZodString, "ClaimId", "out">;
8
+ name: z.ZodString;
9
+ statement: z.ZodString;
10
+ scope: z.ZodString;
11
+ holder: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
12
+ confidence: z.ZodEnum<{
13
+ high: "high";
14
+ medium: "medium";
15
+ low: "low";
16
+ }>;
17
+ status: z.ZodEnum<{
18
+ active: "active";
19
+ stale: "stale";
20
+ deprecated: "deprecated";
21
+ }>;
22
+ created_at: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
23
+ updated_at: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
24
+ source_claim_ids: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ClaimId", "out">, z.core.$ZodBranded<z.ZodString, "PolicyId", "out">]>>>;
25
+ evidence_summary: z.ZodString;
26
+ open_dispute_ids: z.ZodDefault<z.ZodArray<z.core.$ZodBranded<z.ZodString, "DisputeId", "out">>>;
27
+ resolved_dispute_ids: z.ZodDefault<z.ZodArray<z.core.$ZodBranded<z.ZodString, "DisputeId", "out">>>;
28
+ }, z.core.$strip>;
29
+ export declare const DisputeRefSchema: z.ZodObject<{
30
+ id: z.core.$ZodBranded<z.ZodString, "DisputeId", "out">;
31
+ name: z.ZodString;
32
+ claim_ids: z.ZodArray<z.core.$ZodBranded<z.ZodString, "ClaimId", "out">>;
33
+ summary: z.ZodString;
34
+ status: z.ZodEnum<{
35
+ open: "open";
36
+ resolved: "resolved";
37
+ }>;
38
+ }, z.core.$strip>;
39
+ export declare const RouterQueryResultSchema: z.ZodObject<{
40
+ candidate_claims: z.ZodArray<z.ZodObject<{
41
+ id: z.core.$ZodBranded<z.ZodString, "ClaimId", "out">;
42
+ name: z.ZodString;
43
+ statement: z.ZodString;
44
+ scope: z.ZodString;
45
+ holder: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
46
+ confidence: z.ZodEnum<{
47
+ high: "high";
48
+ medium: "medium";
49
+ low: "low";
50
+ }>;
51
+ status: z.ZodEnum<{
52
+ active: "active";
53
+ stale: "stale";
54
+ deprecated: "deprecated";
55
+ }>;
56
+ created_at: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
57
+ updated_at: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
58
+ source_claim_ids: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ClaimId", "out">, z.core.$ZodBranded<z.ZodString, "PolicyId", "out">]>>>;
59
+ evidence_summary: z.ZodString;
60
+ open_dispute_ids: z.ZodDefault<z.ZodArray<z.core.$ZodBranded<z.ZodString, "DisputeId", "out">>>;
61
+ resolved_dispute_ids: z.ZodDefault<z.ZodArray<z.core.$ZodBranded<z.ZodString, "DisputeId", "out">>>;
62
+ }, z.core.$strip>>;
63
+ disputes: z.ZodArray<z.ZodObject<{
64
+ id: z.core.$ZodBranded<z.ZodString, "DisputeId", "out">;
65
+ name: z.ZodString;
66
+ claim_ids: z.ZodArray<z.core.$ZodBranded<z.ZodString, "ClaimId", "out">>;
67
+ summary: z.ZodString;
68
+ status: z.ZodEnum<{
69
+ open: "open";
70
+ resolved: "resolved";
71
+ }>;
72
+ }, z.core.$strip>>;
73
+ retrieval_debug: z.ZodPreprocess<z.ZodOptional<z.ZodObject<{
74
+ mode: z.ZodString;
75
+ failed_paths: z.ZodDefault<z.ZodArray<z.ZodString>>;
76
+ error_summaries: z.ZodDefault<z.ZodArray<z.ZodString>>;
77
+ lexical_hits: z.ZodDefault<z.ZodNumber>;
78
+ vector_hits: z.ZodDefault<z.ZodNumber>;
79
+ rerank_fallback: z.ZodDefault<z.ZodBoolean>;
80
+ candidates: z.ZodDefault<z.ZodArray<z.ZodObject<{
81
+ claim_id: z.ZodString;
82
+ hit_sources: z.ZodString;
83
+ lexical_score: z.ZodDefault<z.ZodNumber>;
84
+ vector_score: z.ZodDefault<z.ZodNumber>;
85
+ rank_before_rerank: z.ZodDefault<z.ZodNumber>;
86
+ rank_after_rerank: z.ZodDefault<z.ZodNumber>;
87
+ vector_status: z.ZodString;
88
+ }, z.core.$strip>>>;
89
+ }, z.core.$strip>>>;
90
+ }, z.core.$strip>;
91
+ export declare const ScopeOverviewItemSchema: z.ZodObject<{
92
+ scope: z.ZodString;
93
+ active_claims: z.ZodNumber;
94
+ stale_claims: z.ZodNumber;
95
+ open_disputes: z.ZodNumber;
96
+ resolved_disputes: z.ZodNumber;
97
+ latest_claim_created_at: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
98
+ }, z.core.$strict>;
99
+ export declare const ScopesOverviewSnapshotSchema: z.ZodObject<{
100
+ scopes: z.ZodDefault<z.ZodArray<z.ZodObject<{
101
+ scope: z.ZodString;
102
+ active_claims: z.ZodNumber;
103
+ stale_claims: z.ZodNumber;
104
+ open_disputes: z.ZodNumber;
105
+ resolved_disputes: z.ZodNumber;
106
+ latest_claim_created_at: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
107
+ }, z.core.$strict>>>;
108
+ }, z.core.$strict>;
109
+ export type RouterQueryResult = z.infer<typeof RouterQueryResultSchema>;
110
+ export type AgentQuery = z.infer<typeof AgentQuerySchema>;
111
+ export type CandidateClaim = z.infer<typeof CandidateClaimSchema>;
112
+ export type DisputeRef = z.infer<typeof DisputeRefSchema>;
113
+ export type ScopeOverviewItem = z.infer<typeof ScopeOverviewItemSchema>;
114
+ export type ScopesOverviewSnapshot = z.infer<typeof ScopesOverviewSnapshotSchema>;
@@ -0,0 +1,4 @@
1
+ import { z } from 'zod';
2
+ export declare const TextSchema: z.ZodString;
3
+ export declare const optional: <T extends z.ZodType>(schema: T) => z.ZodPreprocess<z.ZodOptional<T>>;
4
+ export declare function withAliases<T extends z.ZodType>(schema: T, aliases: Readonly<Record<string, string>>): z.ZodPreprocess<T>;
@@ -0,0 +1,5 @@
1
+ import { z } from 'zod';
2
+ export declare function normalizeTimestamp(input: string): string;
3
+ export declare function timestampNanos(input: string): bigint;
4
+ export declare function nowSeconds(): string;
5
+ export declare const TimestampSchema: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+ export declare const TraceSchema: z.ZodObject<{
3
+ id: z.core.$ZodBranded<z.ZodString, "TraceId", "out">;
4
+ name: z.ZodString;
5
+ task: z.ZodString;
6
+ agent: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
7
+ input_claims: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ClaimId", "out">, z.core.$ZodBranded<z.ZodString, "PolicyId", "out">]>>>;
8
+ output_claims: z.ZodDefault<z.ZodArray<z.core.$ZodBranded<z.ZodString, "ClaimId", "out">>>;
9
+ created_at: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
10
+ }, z.core.$strip>;
11
+ export type Trace = z.infer<typeof TraceSchema>;
@@ -0,0 +1,8 @@
1
+ import type { StoreLogger } from './context.js';
2
+ export declare function writeTextAtomic(path: string, content: string, logger: StoreLogger): Promise<void>;
3
+ export declare function writeTextAtomicIfAbsent(path: string, content: string, logger: StoreLogger): Promise<boolean>;
4
+ export declare function removeFile(path: string, logger: StoreLogger): Promise<void>;
5
+ export declare function cleanupAtomicTemps(root: string, logger: StoreLogger, options?: {
6
+ olderThanMs?: number;
7
+ nowMs?: number;
8
+ }): Promise<number>;
@@ -0,0 +1,33 @@
1
+ import { z } from 'zod';
2
+ import type { StoreContext } from './context.js';
3
+ export declare const PendingClaimEditSchema: z.ZodObject<{
4
+ expected_revision: z.ZodString;
5
+ target: z.ZodObject<{
6
+ id: z.core.$ZodBranded<z.ZodString, "ClaimId", "out">;
7
+ name: z.ZodString;
8
+ statement: z.ZodString;
9
+ scope: z.ZodString;
10
+ holder: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
11
+ confidence: z.ZodEnum<{
12
+ high: "high";
13
+ medium: "medium";
14
+ low: "low";
15
+ }>;
16
+ status: z.ZodEnum<{
17
+ active: "active";
18
+ stale: "stale";
19
+ deprecated: "deprecated";
20
+ }>;
21
+ created_at: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
22
+ updated_at: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
23
+ source_claim_ids: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ClaimId", "out">, z.core.$ZodBranded<z.ZodString, "PolicyId", "out">]>>>;
24
+ evidence_summary: z.ZodString;
25
+ }, z.core.$strip>;
26
+ }, z.core.$strip>;
27
+ export declare class ClaimEditStore {
28
+ readonly context: StoreContext;
29
+ constructor(context: StoreContext);
30
+ write(record: unknown): Promise<void>;
31
+ recover(): Promise<'none' | 'discarded' | 'queued'>;
32
+ recoverLocked(): Promise<'none' | 'discarded' | 'queued'>;
33
+ }
@@ -0,0 +1,7 @@
1
+ import { type Claim } from '../protocol/claim.js';
2
+ import type { StoreContext } from './context.js';
3
+ import { EntityStore } from './entities.js';
4
+ export declare class ClaimStore extends EntityStore<Claim> {
5
+ constructor(context: StoreContext);
6
+ write(value: unknown): Promise<Claim>;
7
+ }
@@ -0,0 +1,13 @@
1
+ import type { AgentId } from '../protocol/ids.js';
2
+ import type { AgentPaths } from './paths.js';
3
+ export interface StoreLogger {
4
+ warn(message: string): void;
5
+ debug(message: string): void;
6
+ }
7
+ export interface StoreContext {
8
+ paths: AgentPaths;
9
+ agentId: AgentId;
10
+ mode: 'solo' | 'team';
11
+ logger: StoreLogger;
12
+ lockTimeoutMs?: number;
13
+ }
@@ -0,0 +1,48 @@
1
+ import { z } from 'zod';
2
+ import type { StoreContext } from './context.js';
3
+ export declare const DeliveryIssueSchema: z.ZodObject<{
4
+ kind: z.ZodEnum<{
5
+ claim: "claim";
6
+ dispute: "dispute";
7
+ }>;
8
+ id: z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ClaimId", "out">, z.core.$ZodBranded<z.ZodString, "DisputeId", "out">]>;
9
+ reason: z.ZodEnum<{
10
+ auth: "auth";
11
+ client: "client";
12
+ retryable: "retryable";
13
+ protocol: "protocol";
14
+ version: "version";
15
+ dependency: "dependency";
16
+ rejected: "rejected";
17
+ }>;
18
+ version: z.ZodOptional<z.ZodString>;
19
+ status: z.ZodOptional<z.ZodNumber>;
20
+ attempts: z.ZodDefault<z.ZodNumber>;
21
+ updatedAt: z.ZodNumber;
22
+ }, z.core.$strip>;
23
+ export type DeliveryIssue = z.infer<typeof DeliveryIssueSchema>;
24
+ export declare function deliveryTarget(endpoint: string): string;
25
+ export declare class DeliveryStatusStore {
26
+ readonly context: StoreContext;
27
+ constructor(context: StoreContext);
28
+ read(): Promise<{
29
+ schemaVersion: 1;
30
+ issues: Record<string, {
31
+ kind: "claim" | "dispute";
32
+ id: (string & z.core.$brand<"ClaimId">) | (string & z.core.$brand<"DisputeId">);
33
+ reason: "auth" | "client" | "retryable" | "protocol" | "version" | "dependency" | "rejected";
34
+ attempts: number;
35
+ updatedAt: number;
36
+ version?: string | undefined;
37
+ status?: number | undefined;
38
+ }>;
39
+ delivered: Record<string, {
40
+ version: string;
41
+ target: string;
42
+ updatedAt?: number | undefined;
43
+ }>;
44
+ }>;
45
+ acknowledge(kind: DeliveryIssue['kind'], id: string, version: string, endpoint: string): Promise<void>;
46
+ record(input: Omit<DeliveryIssue, 'updatedAt' | 'attempts'>): Promise<void>;
47
+ clear(kind: DeliveryIssue['kind'], id: string): Promise<void>;
48
+ }
@@ -0,0 +1,6 @@
1
+ import { type Dispute } from '../protocol/dispute.js';
2
+ import type { StoreContext } from './context.js';
3
+ import { EntityStore } from './entities.js';
4
+ export declare class DisputeStore extends EntityStore<Dispute> {
5
+ constructor(context: StoreContext);
6
+ }
@@ -0,0 +1,16 @@
1
+ import type { z } from 'zod';
2
+ import type { StoreContext } from './context.js';
3
+ export declare class EntityStore<T extends {
4
+ id: string;
5
+ }> {
6
+ readonly context: StoreContext;
7
+ readonly directory: string;
8
+ readonly schema: z.ZodType<T>;
9
+ private readonly idSchema;
10
+ constructor(context: StoreContext, directory: string, schema: z.ZodType<T>, idSchema: z.ZodType<string>);
11
+ path(id: string): string;
12
+ read(id: string): Promise<T>;
13
+ write(value: unknown): Promise<T>;
14
+ list(): Promise<T[]>;
15
+ create(makeId: () => string, makeValue: (id: string) => T): Promise<T>;
16
+ }
@@ -0,0 +1,8 @@
1
+ export declare class StoreError extends Error {
2
+ readonly kind: 'io' | 'decode' | 'encode' | 'conflict' | 'ownership' | 'lock_timeout' | 'lock_order' | 'lock_compromised';
3
+ constructor(kind: 'io' | 'decode' | 'encode' | 'conflict' | 'ownership' | 'lock_timeout' | 'lock_order' | 'lock_compromised', message: string, options?: ErrorOptions);
4
+ }
5
+ export declare class LockTimeoutError extends StoreError {
6
+ constructor(path: string);
7
+ }
8
+ export declare function hasCode(error: unknown, code: string): boolean;
@@ -0,0 +1,65 @@
1
+ import { z } from 'zod';
2
+ import type { StoreContext } from './context.js';
3
+ declare const Entity: z.ZodDiscriminatedUnion<[z.ZodObject<{
4
+ kind: z.ZodLiteral<"claim">;
5
+ value: z.ZodObject<{
6
+ id: z.core.$ZodBranded<z.ZodString, "ClaimId", "out">;
7
+ name: z.ZodString;
8
+ statement: z.ZodString;
9
+ scope: z.ZodString;
10
+ holder: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
11
+ confidence: z.ZodEnum<{
12
+ high: "high";
13
+ medium: "medium";
14
+ low: "low";
15
+ }>;
16
+ status: z.ZodEnum<{
17
+ active: "active";
18
+ stale: "stale";
19
+ deprecated: "deprecated";
20
+ }>;
21
+ created_at: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
22
+ updated_at: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
23
+ source_claim_ids: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ClaimId", "out">, z.core.$ZodBranded<z.ZodString, "PolicyId", "out">]>>>;
24
+ evidence_summary: z.ZodString;
25
+ }, z.core.$strip>;
26
+ }, z.core.$strip>, z.ZodObject<{
27
+ kind: z.ZodLiteral<"dispute">;
28
+ value: z.ZodObject<{
29
+ id: z.core.$ZodBranded<z.ZodString, "DisputeId", "out">;
30
+ name: z.ZodString;
31
+ reporter_agent_id: z.ZodDefault<z.core.$ZodBranded<z.ZodString, "AgentId", "out">>;
32
+ claims: z.ZodArray<z.core.$ZodBranded<z.ZodString, "ClaimId", "out">>;
33
+ summary: z.ZodString;
34
+ status: z.ZodEnum<{
35
+ open: "open";
36
+ resolved: "resolved";
37
+ }>;
38
+ created_at: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
39
+ resolved_at: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
40
+ }, z.core.$strip>;
41
+ }, z.core.$strip>], "kind">;
42
+ export interface HistoricalApplication {
43
+ id: string;
44
+ state: 'prepared' | 'applied' | 'cancelled';
45
+ kind: 'recap' | 'finalize' | 'history';
46
+ attempts: number;
47
+ updatedAt: number;
48
+ entityIds: string[];
49
+ claimCount: number;
50
+ disputeCount: number;
51
+ traceCount: number;
52
+ sessionId?: string;
53
+ }
54
+ export interface HistoricalKnowledge {
55
+ applications: HistoricalApplication[];
56
+ sources: Map<string, Set<string>>;
57
+ deliveries: {
58
+ entity: z.infer<typeof Entity>;
59
+ endpoint: string;
60
+ updatedAt: number;
61
+ sessionId: string;
62
+ }[];
63
+ }
64
+ export declare function historicalKnowledge(context: StoreContext): Promise<HistoricalKnowledge>;
65
+ export {};
@@ -0,0 +1,27 @@
1
+ import { type InboxMessage } from '../protocol/inbox.js';
2
+ import type { StoreContext } from './context.js';
3
+ export interface ClaimedInboxMessage {
4
+ message: InboxMessage;
5
+ leaseId: string;
6
+ }
7
+ export declare class InboxStore {
8
+ readonly context: StoreContext;
9
+ readonly processingStaleAfterSecs: number;
10
+ constructor(context: StoreContext, processingStaleAfterSecs?: number);
11
+ private locked;
12
+ private names;
13
+ private leasePath;
14
+ private exists;
15
+ acceptPulled(value: unknown): Promise<void>;
16
+ private pending;
17
+ listPending(): Promise<InboxMessage[]>;
18
+ hasUnfinished(): Promise<boolean>;
19
+ private recoverUnlocked;
20
+ recoverStale(nowMs?: number): Promise<number>;
21
+ recoverOrphans(): Promise<number>;
22
+ claimPending(limit?: number): Promise<ClaimedInboxMessage[]>;
23
+ validateSnapshotLocked(message: InboxMessage): Promise<string[]>;
24
+ completeSnapshotLocked(message: InboxMessage): Promise<void>;
25
+ complete(claimed: ClaimedInboxMessage): Promise<void>;
26
+ release(claimed: ClaimedInboxMessage): Promise<void>;
27
+ }
@@ -0,0 +1,16 @@
1
+ export * from './errors.js';
2
+ export * from './paths.js';
3
+ export * from './context.js';
4
+ export * from './atomic.js';
5
+ export * from './yaml.js';
6
+ export * from './lock.js';
7
+ export * from './entities.js';
8
+ export * from './claims.js';
9
+ export * from './traces.js';
10
+ export * from './disputes.js';
11
+ export * from './inbox.js';
12
+ export * from './uploads.js';
13
+ export * from './reported-sets.js';
14
+ export * from './claim-edits.js';
15
+ export * from './session-state.js';
16
+ export * from './jobs.js';
@@ -0,0 +1,5 @@
1
+ import type { StoreContext } from './context.js';
2
+ import { VersionedFileStore } from './session-state.js';
3
+ export declare class JobStore extends VersionedFileStore {
4
+ constructor(context: StoreContext);
5
+ }
@@ -0,0 +1,4 @@
1
+ import type { ResolvedConfig } from '../config.js';
2
+ import type { StoreLogger } from './context.js';
3
+ export declare function prepareLibraryDirectory(previous: Record<string, unknown>, next: Record<string, unknown>): Promise<Record<string, unknown>>;
4
+ export declare function syncLibraryIndex(config: ResolvedConfig, logger: StoreLogger): Promise<void>;
@@ -0,0 +1,11 @@
1
+ export interface LockOptions {
2
+ timeoutMs?: number | undefined;
3
+ staleMs?: number | undefined;
4
+ signal?: AbortSignal | undefined;
5
+ }
6
+ export declare function acquireFileLease(path: string, options?: LockOptions): Promise<{
7
+ check(): void;
8
+ release(): Promise<void>;
9
+ }>;
10
+ export declare function withFileLock<T>(path: string, action: () => Promise<T>, options?: LockOptions): Promise<T>;
11
+ export declare function withFileLocks<T>(paths: readonly string[], action: () => Promise<T>, options?: LockOptions): Promise<T>;
@@ -0,0 +1,2 @@
1
+ export declare function invalidStorageName(name: string, platform?: NodeJS.Platform): boolean;
2
+ export declare function assertStorageName(name: string): void;