@empressaio/atom-contract 1.7.0

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 (251) hide show
  1. package/CHANGELOG.md +360 -0
  2. package/README.md +379 -0
  3. package/dist/composition.d.ts +112 -0
  4. package/dist/composition.d.ts.map +1 -0
  5. package/dist/composition.js +80 -0
  6. package/dist/composition.js.map +1 -0
  7. package/dist/conformance/common.d.ts +21 -0
  8. package/dist/conformance/common.d.ts.map +1 -0
  9. package/dist/conformance/common.js +29 -0
  10. package/dist/conformance/common.js.map +1 -0
  11. package/dist/conformance/fixtures.d.ts +13 -0
  12. package/dist/conformance/fixtures.d.ts.map +1 -0
  13. package/dist/conformance/fixtures.js +63 -0
  14. package/dist/conformance/fixtures.js.map +1 -0
  15. package/dist/conformance/index.d.ts +11 -0
  16. package/dist/conformance/index.d.ts.map +1 -0
  17. package/dist/conformance/index.js +11 -0
  18. package/dist/conformance/index.js.map +1 -0
  19. package/dist/conformance/validate.d.ts +49 -0
  20. package/dist/conformance/validate.d.ts.map +1 -0
  21. package/dist/conformance/validate.js +138 -0
  22. package/dist/conformance/validate.js.map +1 -0
  23. package/dist/conformance/verify-chain.d.ts +25 -0
  24. package/dist/conformance/verify-chain.d.ts.map +1 -0
  25. package/dist/conformance/verify-chain.js +76 -0
  26. package/dist/conformance/verify-chain.js.map +1 -0
  27. package/dist/context.d.ts +134 -0
  28. package/dist/context.d.ts.map +1 -0
  29. package/dist/context.js +110 -0
  30. package/dist/context.js.map +1 -0
  31. package/dist/encumbrances/administrative-rule.d.ts +128 -0
  32. package/dist/encumbrances/administrative-rule.d.ts.map +1 -0
  33. package/dist/encumbrances/administrative-rule.js +18 -0
  34. package/dist/encumbrances/administrative-rule.js.map +1 -0
  35. package/dist/encumbrances/common.d.ts +153 -0
  36. package/dist/encumbrances/common.d.ts.map +1 -0
  37. package/dist/encumbrances/common.js +124 -0
  38. package/dist/encumbrances/common.js.map +1 -0
  39. package/dist/encumbrances/constraint-resolution.d.ts +169 -0
  40. package/dist/encumbrances/constraint-resolution.d.ts.map +1 -0
  41. package/dist/encumbrances/constraint-resolution.js +41 -0
  42. package/dist/encumbrances/constraint-resolution.js.map +1 -0
  43. package/dist/encumbrances/fixtures.d.ts +16 -0
  44. package/dist/encumbrances/fixtures.d.ts.map +1 -0
  45. package/dist/encumbrances/fixtures.js +107 -0
  46. package/dist/encumbrances/fixtures.js.map +1 -0
  47. package/dist/encumbrances/index.d.ts +15 -0
  48. package/dist/encumbrances/index.d.ts.map +1 -0
  49. package/dist/encumbrances/index.js +15 -0
  50. package/dist/encumbrances/index.js.map +1 -0
  51. package/dist/encumbrances/recorded-instrument.d.ts +131 -0
  52. package/dist/encumbrances/recorded-instrument.d.ts.map +1 -0
  53. package/dist/encumbrances/recorded-instrument.js +19 -0
  54. package/dist/encumbrances/recorded-instrument.js.map +1 -0
  55. package/dist/encumbrances/restriction-clause.d.ts +120 -0
  56. package/dist/encumbrances/restriction-clause.d.ts.map +1 -0
  57. package/dist/encumbrances/restriction-clause.js +17 -0
  58. package/dist/encumbrances/restriction-clause.js.map +1 -0
  59. package/dist/encumbrances/restriction-corpus.d.ts +44 -0
  60. package/dist/encumbrances/restriction-corpus.d.ts.map +1 -0
  61. package/dist/encumbrances/restriction-corpus.js +14 -0
  62. package/dist/encumbrances/restriction-corpus.js.map +1 -0
  63. package/dist/export/downloadable-atom.d.ts +133 -0
  64. package/dist/export/downloadable-atom.d.ts.map +1 -0
  65. package/dist/export/downloadable-atom.js +115 -0
  66. package/dist/export/downloadable-atom.js.map +1 -0
  67. package/dist/export/index.d.ts +6 -0
  68. package/dist/export/index.d.ts.map +1 -0
  69. package/dist/export/index.js +6 -0
  70. package/dist/export/index.js.map +1 -0
  71. package/dist/history.d.ts +124 -0
  72. package/dist/history.d.ts.map +1 -0
  73. package/dist/history.js +170 -0
  74. package/dist/history.js.map +1 -0
  75. package/dist/index.d.ts +29 -0
  76. package/dist/index.d.ts.map +1 -0
  77. package/dist/index.js +20 -0
  78. package/dist/index.js.map +1 -0
  79. package/dist/inline-reference.d.ts +60 -0
  80. package/dist/inline-reference.d.ts.map +1 -0
  81. package/dist/inline-reference.js +73 -0
  82. package/dist/inline-reference.js.map +1 -0
  83. package/dist/obligation.d.ts +131 -0
  84. package/dist/obligation.d.ts.map +1 -0
  85. package/dist/obligation.js +55 -0
  86. package/dist/obligation.js.map +1 -0
  87. package/dist/og/common.d.ts +253 -0
  88. package/dist/og/common.d.ts.map +1 -0
  89. package/dist/og/common.js +195 -0
  90. package/dist/og/common.js.map +1 -0
  91. package/dist/og/completion.d.ts +70 -0
  92. package/dist/og/completion.d.ts.map +1 -0
  93. package/dist/og/completion.js +22 -0
  94. package/dist/og/completion.js.map +1 -0
  95. package/dist/og/equipment-state.d.ts +55 -0
  96. package/dist/og/equipment-state.d.ts.map +1 -0
  97. package/dist/og/equipment-state.js +25 -0
  98. package/dist/og/equipment-state.js.map +1 -0
  99. package/dist/og/fixtures.d.ts +40 -0
  100. package/dist/og/fixtures.d.ts.map +1 -0
  101. package/dist/og/fixtures.js +255 -0
  102. package/dist/og/fixtures.js.map +1 -0
  103. package/dist/og/index.d.ts +23 -0
  104. package/dist/og/index.d.ts.map +1 -0
  105. package/dist/og/index.js +23 -0
  106. package/dist/og/index.js.map +1 -0
  107. package/dist/og/mineral-lease.d.ts +150 -0
  108. package/dist/og/mineral-lease.d.ts.map +1 -0
  109. package/dist/og/mineral-lease.js +24 -0
  110. package/dist/og/mineral-lease.js.map +1 -0
  111. package/dist/og/ownership-interest.d.ts +163 -0
  112. package/dist/og/ownership-interest.d.ts.map +1 -0
  113. package/dist/og/ownership-interest.js +36 -0
  114. package/dist/og/ownership-interest.js.map +1 -0
  115. package/dist/og/pad.d.ts +101 -0
  116. package/dist/og/pad.d.ts.map +1 -0
  117. package/dist/og/pad.js +19 -0
  118. package/dist/og/pad.js.map +1 -0
  119. package/dist/og/production-timeseries.d.ts +154 -0
  120. package/dist/og/production-timeseries.d.ts.map +1 -0
  121. package/dist/og/production-timeseries.js +37 -0
  122. package/dist/og/production-timeseries.js.map +1 -0
  123. package/dist/og/revenue-allocation-unit.d.ts +762 -0
  124. package/dist/og/revenue-allocation-unit.d.ts.map +1 -0
  125. package/dist/og/revenue-allocation-unit.js +105 -0
  126. package/dist/og/revenue-allocation-unit.js.map +1 -0
  127. package/dist/og/rrc-lease.d.ts +124 -0
  128. package/dist/og/rrc-lease.d.ts.map +1 -0
  129. package/dist/og/rrc-lease.js +29 -0
  130. package/dist/og/rrc-lease.js.map +1 -0
  131. package/dist/og/tract.d.ts +88 -0
  132. package/dist/og/tract.d.ts.map +1 -0
  133. package/dist/og/tract.js +30 -0
  134. package/dist/og/tract.js.map +1 -0
  135. package/dist/og/well.d.ts +201 -0
  136. package/dist/og/well.d.ts.map +1 -0
  137. package/dist/og/well.js +40 -0
  138. package/dist/og/well.js.map +1 -0
  139. package/dist/og/wellbore.d.ts +61 -0
  140. package/dist/og/wellbore.d.ts.map +1 -0
  141. package/dist/og/wellbore.js +25 -0
  142. package/dist/og/wellbore.js.map +1 -0
  143. package/dist/og/zone.d.ts +45 -0
  144. package/dist/og/zone.d.ts.map +1 -0
  145. package/dist/og/zone.js +16 -0
  146. package/dist/og/zone.js.map +1 -0
  147. package/dist/read-contract/common.d.ts +74 -0
  148. package/dist/read-contract/common.d.ts.map +1 -0
  149. package/dist/read-contract/common.js +54 -0
  150. package/dist/read-contract/common.js.map +1 -0
  151. package/dist/read-contract/consequence.d.ts +99 -0
  152. package/dist/read-contract/consequence.d.ts.map +1 -0
  153. package/dist/read-contract/consequence.js +46 -0
  154. package/dist/read-contract/consequence.js.map +1 -0
  155. package/dist/read-contract/fixtures.d.ts +8 -0
  156. package/dist/read-contract/fixtures.d.ts.map +1 -0
  157. package/dist/read-contract/fixtures.js +44 -0
  158. package/dist/read-contract/fixtures.js.map +1 -0
  159. package/dist/read-contract/index.d.ts +14 -0
  160. package/dist/read-contract/index.d.ts.map +1 -0
  161. package/dist/read-contract/index.js +14 -0
  162. package/dist/read-contract/index.js.map +1 -0
  163. package/dist/read-contract/model-attribution.d.ts +85 -0
  164. package/dist/read-contract/model-attribution.d.ts.map +1 -0
  165. package/dist/read-contract/model-attribution.js +30 -0
  166. package/dist/read-contract/model-attribution.js.map +1 -0
  167. package/dist/read-contract/read-contract.d.ts +455 -0
  168. package/dist/read-contract/read-contract.d.ts.map +1 -0
  169. package/dist/read-contract/read-contract.js +46 -0
  170. package/dist/read-contract/read-contract.js.map +1 -0
  171. package/dist/registration.d.ts +192 -0
  172. package/dist/registration.d.ts.map +1 -0
  173. package/dist/registration.js +15 -0
  174. package/dist/registration.js.map +1 -0
  175. package/dist/registry.d.ts +128 -0
  176. package/dist/registry.d.ts.map +1 -0
  177. package/dist/registry.js +122 -0
  178. package/dist/registry.js.map +1 -0
  179. package/dist/render.d.ts +30 -0
  180. package/dist/render.d.ts.map +1 -0
  181. package/dist/render.js +44 -0
  182. package/dist/render.js.map +1 -0
  183. package/dist/scope.d.ts +46 -0
  184. package/dist/scope.d.ts.map +1 -0
  185. package/dist/scope.js +17 -0
  186. package/dist/scope.js.map +1 -0
  187. package/dist/temporal/anticipatory-atom.d.ts +123 -0
  188. package/dist/temporal/anticipatory-atom.d.ts.map +1 -0
  189. package/dist/temporal/anticipatory-atom.js +124 -0
  190. package/dist/temporal/anticipatory-atom.js.map +1 -0
  191. package/dist/temporal/common.d.ts +47 -0
  192. package/dist/temporal/common.d.ts.map +1 -0
  193. package/dist/temporal/common.js +100 -0
  194. package/dist/temporal/common.js.map +1 -0
  195. package/dist/temporal/fixtures.d.ts +7 -0
  196. package/dist/temporal/fixtures.d.ts.map +1 -0
  197. package/dist/temporal/fixtures.js +21 -0
  198. package/dist/temporal/fixtures.js.map +1 -0
  199. package/dist/temporal/index.d.ts +13 -0
  200. package/dist/temporal/index.d.ts.map +1 -0
  201. package/dist/temporal/index.js +13 -0
  202. package/dist/temporal/index.js.map +1 -0
  203. package/dist/temporal/interval-query.d.ts +42 -0
  204. package/dist/temporal/interval-query.d.ts.map +1 -0
  205. package/dist/temporal/interval-query.js +49 -0
  206. package/dist/temporal/interval-query.js.map +1 -0
  207. package/dist/temporal/node-id.d.ts +112 -0
  208. package/dist/temporal/node-id.d.ts.map +1 -0
  209. package/dist/temporal/node-id.js +208 -0
  210. package/dist/temporal/node-id.js.map +1 -0
  211. package/dist/temporal/would-affect-edge.d.ts +66 -0
  212. package/dist/temporal/would-affect-edge.d.ts.map +1 -0
  213. package/dist/temporal/would-affect-edge.js +113 -0
  214. package/dist/temporal/would-affect-edge.js.map +1 -0
  215. package/dist/testing/index.d.ts +98 -0
  216. package/dist/testing/index.d.ts.map +1 -0
  217. package/dist/testing/index.js +225 -0
  218. package/dist/testing/index.js.map +1 -0
  219. package/dist/vda.d.ts +46 -0
  220. package/dist/vda.d.ts.map +1 -0
  221. package/dist/vda.js +42 -0
  222. package/dist/vda.js.map +1 -0
  223. package/dist/workspace/brief-run.d.ts +104 -0
  224. package/dist/workspace/brief-run.d.ts.map +1 -0
  225. package/dist/workspace/brief-run.js +32 -0
  226. package/dist/workspace/brief-run.js.map +1 -0
  227. package/dist/workspace/common.d.ts +42 -0
  228. package/dist/workspace/common.d.ts.map +1 -0
  229. package/dist/workspace/common.js +26 -0
  230. package/dist/workspace/common.js.map +1 -0
  231. package/dist/workspace/fixtures.d.ts +10 -0
  232. package/dist/workspace/fixtures.d.ts.map +1 -0
  233. package/dist/workspace/fixtures.js +93 -0
  234. package/dist/workspace/fixtures.js.map +1 -0
  235. package/dist/workspace/index.d.ts +13 -0
  236. package/dist/workspace/index.d.ts.map +1 -0
  237. package/dist/workspace/index.js +13 -0
  238. package/dist/workspace/index.js.map +1 -0
  239. package/dist/workspace/property-workspace.d.ts +148 -0
  240. package/dist/workspace/property-workspace.d.ts.map +1 -0
  241. package/dist/workspace/property-workspace.js +21 -0
  242. package/dist/workspace/property-workspace.js.map +1 -0
  243. package/dist/workspace/workspace-attachment.d.ts +99 -0
  244. package/dist/workspace/workspace-attachment.d.ts.map +1 -0
  245. package/dist/workspace/workspace-attachment.js +35 -0
  246. package/dist/workspace/workspace-attachment.js.map +1 -0
  247. package/dist/workspace/workspace-share-edge.d.ts +115 -0
  248. package/dist/workspace/workspace-share-edge.d.ts.map +1 -0
  249. package/dist/workspace/workspace-share-edge.js +22 -0
  250. package/dist/workspace/workspace-share-edge.js.map +1 -0
  251. package/package.json +107 -0
@@ -0,0 +1,120 @@
1
+ import { z } from "zod";
2
+ import type { WidthedConfidence } from "../read-contract/common.js";
3
+ import { STRUCTURED_FIELDS_SCHEMA } from "./common.js";
4
+ export interface RestrictionClauseAtomInstance {
5
+ entityType: "restriction-clause";
6
+ clauseDid: string;
7
+ parentInstrumentCid: string;
8
+ clausePath: string;
9
+ bodyText: string;
10
+ structuredFields?: z.infer<typeof STRUCTURED_FIELDS_SCHEMA>;
11
+ confidence: WidthedConfidence;
12
+ extractedBy: string;
13
+ humanVerifiedAt?: string;
14
+ verifiedByActorDid?: string;
15
+ accessPolicy: "tenant-private" | "tenant-shared";
16
+ legalWeight: "recorded";
17
+ reasoningSummary?: string;
18
+ sourceCitation: string;
19
+ evaluatedAt: string;
20
+ }
21
+ export declare const RESTRICTION_CLAUSE_SCHEMA: z.ZodObject<{
22
+ confidence: z.ZodReadonly<z.ZodObject<{
23
+ readonly estimate: z.ZodNumber;
24
+ readonly n: z.ZodNumber;
25
+ readonly intervalWidth: z.ZodNumber;
26
+ readonly provenance: z.ZodEnum<["asserted", "backtest", "seed", "live"]>;
27
+ }, "strip", z.ZodTypeAny, {
28
+ estimate: number;
29
+ n: number;
30
+ intervalWidth: number;
31
+ provenance: "asserted" | "backtest" | "seed" | "live";
32
+ }, {
33
+ estimate: number;
34
+ n: number;
35
+ intervalWidth: number;
36
+ provenance: "asserted" | "backtest" | "seed" | "live";
37
+ }>>;
38
+ evaluatedAt: z.ZodString;
39
+ reasoningSummary: z.ZodOptional<z.ZodString>;
40
+ sourceCitation: z.ZodString;
41
+ entityType: z.ZodLiteral<"restriction-clause">;
42
+ clauseDid: z.ZodString;
43
+ parentInstrumentCid: z.ZodString;
44
+ clausePath: z.ZodString;
45
+ bodyText: z.ZodString;
46
+ structuredFields: z.ZodOptional<z.ZodObject<{
47
+ maxHeightFt: z.ZodOptional<z.ZodNumber>;
48
+ prohibitedUses: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
49
+ setbackFt: z.ZodOptional<z.ZodNumber>;
50
+ materialAllowlist: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
51
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
52
+ maxHeightFt: z.ZodOptional<z.ZodNumber>;
53
+ prohibitedUses: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
54
+ setbackFt: z.ZodOptional<z.ZodNumber>;
55
+ materialAllowlist: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
56
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
57
+ maxHeightFt: z.ZodOptional<z.ZodNumber>;
58
+ prohibitedUses: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
59
+ setbackFt: z.ZodOptional<z.ZodNumber>;
60
+ materialAllowlist: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
61
+ }, z.ZodTypeAny, "passthrough">>>;
62
+ extractedBy: z.ZodString;
63
+ humanVerifiedAt: z.ZodOptional<z.ZodString>;
64
+ verifiedByActorDid: z.ZodOptional<z.ZodString>;
65
+ accessPolicy: z.ZodEnum<["tenant-private", "tenant-shared"]>;
66
+ legalWeight: z.ZodLiteral<"recorded">;
67
+ }, "strip", z.ZodTypeAny, {
68
+ accessPolicy: "tenant-private" | "tenant-shared";
69
+ entityType: "restriction-clause";
70
+ confidence: Readonly<{
71
+ estimate: number;
72
+ n: number;
73
+ intervalWidth: number;
74
+ provenance: "asserted" | "backtest" | "seed" | "live";
75
+ }>;
76
+ sourceCitation: string;
77
+ clauseDid: string;
78
+ parentInstrumentCid: string;
79
+ clausePath: string;
80
+ bodyText: string;
81
+ extractedBy: string;
82
+ legalWeight: "recorded";
83
+ evaluatedAt: string;
84
+ structuredFields?: z.objectOutputType<{
85
+ maxHeightFt: z.ZodOptional<z.ZodNumber>;
86
+ prohibitedUses: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
87
+ setbackFt: z.ZodOptional<z.ZodNumber>;
88
+ materialAllowlist: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
89
+ }, z.ZodTypeAny, "passthrough"> | undefined;
90
+ humanVerifiedAt?: string | undefined;
91
+ verifiedByActorDid?: string | undefined;
92
+ reasoningSummary?: string | undefined;
93
+ }, {
94
+ accessPolicy: "tenant-private" | "tenant-shared";
95
+ entityType: "restriction-clause";
96
+ confidence: Readonly<{
97
+ estimate: number;
98
+ n: number;
99
+ intervalWidth: number;
100
+ provenance: "asserted" | "backtest" | "seed" | "live";
101
+ }>;
102
+ sourceCitation: string;
103
+ clauseDid: string;
104
+ parentInstrumentCid: string;
105
+ clausePath: string;
106
+ bodyText: string;
107
+ extractedBy: string;
108
+ legalWeight: "recorded";
109
+ evaluatedAt: string;
110
+ structuredFields?: z.objectInputType<{
111
+ maxHeightFt: z.ZodOptional<z.ZodNumber>;
112
+ prohibitedUses: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
113
+ setbackFt: z.ZodOptional<z.ZodNumber>;
114
+ materialAllowlist: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
115
+ }, z.ZodTypeAny, "passthrough"> | undefined;
116
+ humanVerifiedAt?: string | undefined;
117
+ verifiedByActorDid?: string | undefined;
118
+ reasoningSummary?: string | undefined;
119
+ }>;
120
+ //# sourceMappingURL=restriction-clause.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"restriction-clause.d.ts","sourceRoot":"","sources":["../../src/encumbrances/restriction-clause.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAGL,wBAAwB,EACzB,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,6BAA6B;IAC5C,UAAU,EAAE,oBAAoB,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;IAC5D,UAAU,EAAE,iBAAiB,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,EAAE,gBAAgB,GAAG,eAAe,CAAC;IACjD,WAAW,EAAE,UAAU,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAapC,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { z } from "zod";
2
+ import { ENCUMBRANCE_ACCESS_POLICY_SCHEMA, QUALITY_GATE_FIELDS, STRUCTURED_FIELDS_SCHEMA, } from "./common.js";
3
+ export const RESTRICTION_CLAUSE_SCHEMA = z.object({
4
+ entityType: z.literal("restriction-clause"),
5
+ clauseDid: z.string().min(1),
6
+ parentInstrumentCid: z.string().min(1),
7
+ clausePath: z.string().min(1),
8
+ bodyText: z.string().min(1),
9
+ structuredFields: STRUCTURED_FIELDS_SCHEMA.optional(),
10
+ extractedBy: z.string().min(1),
11
+ humanVerifiedAt: z.string().min(1).optional(),
12
+ verifiedByActorDid: z.string().min(1).optional(),
13
+ accessPolicy: ENCUMBRANCE_ACCESS_POLICY_SCHEMA,
14
+ legalWeight: z.literal("recorded"),
15
+ ...QUALITY_GATE_FIELDS,
16
+ });
17
+ //# sourceMappingURL=restriction-clause.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"restriction-clause.js","sourceRoot":"","sources":["../../src/encumbrances/restriction-clause.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EACL,gCAAgC,EAChC,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,aAAa,CAAC;AAoBrB,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC;IAC3C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5B,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACtC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,gBAAgB,EAAE,wBAAwB,CAAC,QAAQ,EAAE;IACrD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC7C,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAChD,YAAY,EAAE,gCAAgC;IAC9C,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;IAClC,GAAG,mBAAmB;CACvB,CAAC,CAAC"}
@@ -0,0 +1,44 @@
1
+ import { z } from "zod";
2
+ export interface RestrictionCorpusAtomInstance {
3
+ entityType: "restriction-corpus";
4
+ corpusDid: string;
5
+ displayName: string;
6
+ platId?: string;
7
+ subdivisionName: string;
8
+ instrumentCids: ReadonlyArray<string>;
9
+ coverageParcelCount?: number;
10
+ lastRefreshedAt?: string;
11
+ accessPolicy: "tenant-private" | "tenant-shared";
12
+ }
13
+ export declare const RESTRICTION_CORPUS_SCHEMA: z.ZodObject<{
14
+ entityType: z.ZodLiteral<"restriction-corpus">;
15
+ corpusDid: z.ZodString;
16
+ displayName: z.ZodString;
17
+ platId: z.ZodOptional<z.ZodString>;
18
+ subdivisionName: z.ZodString;
19
+ instrumentCids: z.ZodArray<z.ZodString, "many">;
20
+ coverageParcelCount: z.ZodOptional<z.ZodNumber>;
21
+ lastRefreshedAt: z.ZodOptional<z.ZodString>;
22
+ accessPolicy: z.ZodEnum<["tenant-private", "tenant-shared"]>;
23
+ }, "strip", z.ZodTypeAny, {
24
+ accessPolicy: "tenant-private" | "tenant-shared";
25
+ entityType: "restriction-corpus";
26
+ corpusDid: string;
27
+ displayName: string;
28
+ subdivisionName: string;
29
+ instrumentCids: string[];
30
+ platId?: string | undefined;
31
+ coverageParcelCount?: number | undefined;
32
+ lastRefreshedAt?: string | undefined;
33
+ }, {
34
+ accessPolicy: "tenant-private" | "tenant-shared";
35
+ entityType: "restriction-corpus";
36
+ corpusDid: string;
37
+ displayName: string;
38
+ subdivisionName: string;
39
+ instrumentCids: string[];
40
+ platId?: string | undefined;
41
+ coverageParcelCount?: number | undefined;
42
+ lastRefreshedAt?: string | undefined;
43
+ }>;
44
+ //# sourceMappingURL=restriction-corpus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"restriction-corpus.d.ts","sourceRoot":"","sources":["../../src/encumbrances/restriction-corpus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,WAAW,6BAA6B;IAC5C,UAAU,EAAE,oBAAoB,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACtC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,gBAAgB,GAAG,eAAe,CAAC;CAClD;AAED,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUpC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { z } from "zod";
2
+ import { ENCUMBRANCE_ACCESS_POLICY_SCHEMA } from "./common.js";
3
+ export const RESTRICTION_CORPUS_SCHEMA = z.object({
4
+ entityType: z.literal("restriction-corpus"),
5
+ corpusDid: z.string().min(1),
6
+ displayName: z.string().min(1),
7
+ platId: z.string().min(1).optional(),
8
+ subdivisionName: z.string().min(1),
9
+ instrumentCids: z.array(z.string().min(1)).min(1),
10
+ coverageParcelCount: z.number().int().nonnegative().optional(),
11
+ lastRefreshedAt: z.string().min(1).optional(),
12
+ accessPolicy: ENCUMBRANCE_ACCESS_POLICY_SCHEMA,
13
+ });
14
+ //# sourceMappingURL=restriction-corpus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"restriction-corpus.js","sourceRoot":"","sources":["../../src/encumbrances/restriction-corpus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gCAAgC,EAAE,MAAM,aAAa,CAAC;AAc/D,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC;IAC3C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACpC,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAClC,cAAc,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACjD,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;IAC9D,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC7C,YAAY,EAAE,gCAAgC;CAC/C,CAAC,CAAC"}
@@ -0,0 +1,133 @@
1
+ /**
2
+ * Downloadable-atom export shape (architecture homes doc 02).
3
+ *
4
+ * The portable audit unit returned by the gate atom-export tool and
5
+ * rendered by the operator console. Self-contained and verifiable
6
+ * without trusting the hosting system.
7
+ */
8
+ import { z } from "zod";
9
+ import type { ContextSummary } from "../context.js";
10
+ import type { AtomEvent } from "../history.js";
11
+ import type { AccessPolicy, AtomReference } from "../registration.js";
12
+ import { ATOM_CONFORMANCE_TARGET_VERSION, type AtomTier, type VerifyChainResult } from "../conformance/index.js";
13
+ import type { ReadContract } from "../read-contract/read-contract.js";
14
+ export interface DownloadableAtomIdentity {
15
+ readonly entityType: string;
16
+ readonly entityId: string;
17
+ /** Stable content identifier (hash, edition key, or corpus row id). */
18
+ readonly contentId: string;
19
+ /** VDA reference for real-world data-level entities. */
20
+ readonly vdaRef?: string;
21
+ }
22
+ export interface DownloadableAtomCitation {
23
+ readonly citationDid: string;
24
+ readonly label?: string;
25
+ readonly sourceCitation?: string;
26
+ readonly citedAtom?: AtomReference;
27
+ }
28
+ export interface DownloadableAtom {
29
+ readonly exportVersion: typeof ATOM_CONFORMANCE_TARGET_VERSION;
30
+ readonly identity: DownloadableAtomIdentity;
31
+ readonly accessPolicy: AccessPolicy;
32
+ readonly contextSummary: ContextSummary;
33
+ readonly readContract: ReadContract;
34
+ readonly compositionReferences: ReadonlyArray<AtomReference>;
35
+ readonly citations: ReadonlyArray<DownloadableAtomCitation>;
36
+ readonly signedEventChain: ReadonlyArray<AtomEvent>;
37
+ readonly verifyChain: VerifyChainResult;
38
+ /** ISO-8601 when the export bundle was assembled. */
39
+ readonly exportedAt: string;
40
+ }
41
+ export declare const DOWNLOADABLE_ATOM_IDENTITY_SCHEMA: z.ZodReadonly<z.ZodObject<{
42
+ entityType: z.ZodString;
43
+ entityId: z.ZodString;
44
+ contentId: z.ZodString;
45
+ vdaRef: z.ZodOptional<z.ZodString>;
46
+ }, "strip", z.ZodTypeAny, {
47
+ entityId: string;
48
+ entityType: string;
49
+ contentId: string;
50
+ vdaRef?: string | undefined;
51
+ }, {
52
+ entityId: string;
53
+ entityType: string;
54
+ contentId: string;
55
+ vdaRef?: string | undefined;
56
+ }>>;
57
+ export declare const DOWNLOADABLE_ATOM_CITATION_SCHEMA: z.ZodReadonly<z.ZodObject<{
58
+ citationDid: z.ZodString;
59
+ label: z.ZodOptional<z.ZodString>;
60
+ sourceCitation: z.ZodOptional<z.ZodString>;
61
+ citedAtom: z.ZodOptional<z.ZodObject<{
62
+ kind: z.ZodLiteral<"atom">;
63
+ entityType: z.ZodString;
64
+ entityId: z.ZodString;
65
+ mode: z.ZodOptional<z.ZodEnum<["inline", "compact", "card", "expanded", "focus"]>>;
66
+ displayLabel: z.ZodOptional<z.ZodString>;
67
+ }, "strip", z.ZodTypeAny, {
68
+ entityId: string;
69
+ entityType: string;
70
+ kind: "atom";
71
+ displayLabel?: string | undefined;
72
+ mode?: "inline" | "compact" | "card" | "expanded" | "focus" | undefined;
73
+ }, {
74
+ entityId: string;
75
+ entityType: string;
76
+ kind: "atom";
77
+ displayLabel?: string | undefined;
78
+ mode?: "inline" | "compact" | "card" | "expanded" | "focus" | undefined;
79
+ }>>;
80
+ }, "strip", z.ZodTypeAny, {
81
+ citationDid: string;
82
+ sourceCitation?: string | undefined;
83
+ label?: string | undefined;
84
+ citedAtom?: {
85
+ entityId: string;
86
+ entityType: string;
87
+ kind: "atom";
88
+ displayLabel?: string | undefined;
89
+ mode?: "inline" | "compact" | "card" | "expanded" | "focus" | undefined;
90
+ } | undefined;
91
+ }, {
92
+ citationDid: string;
93
+ sourceCitation?: string | undefined;
94
+ label?: string | undefined;
95
+ citedAtom?: {
96
+ entityId: string;
97
+ entityType: string;
98
+ kind: "atom";
99
+ displayLabel?: string | undefined;
100
+ mode?: "inline" | "compact" | "card" | "expanded" | "focus" | undefined;
101
+ } | undefined;
102
+ }>>;
103
+ export interface CreateDownloadableAtomInput {
104
+ tier: AtomTier;
105
+ identity: DownloadableAtomIdentity;
106
+ accessPolicy: AccessPolicy;
107
+ contextSummary: ContextSummary;
108
+ readContract: ReadContract;
109
+ compositionReferences?: ReadonlyArray<AtomReference>;
110
+ citations?: ReadonlyArray<DownloadableAtomCitation>;
111
+ signedEventChain?: ReadonlyArray<AtomEvent>;
112
+ exportedAt?: string;
113
+ }
114
+ export interface CreateDownloadableAtomResult {
115
+ readonly ok: true;
116
+ readonly export: DownloadableAtom;
117
+ }
118
+ export interface CreateDownloadableAtomFailure {
119
+ readonly ok: false;
120
+ readonly errors: ReadonlyArray<{
121
+ path: string;
122
+ message: string;
123
+ }>;
124
+ }
125
+ export type CreateDownloadableAtomOutcome = CreateDownloadableAtomResult | CreateDownloadableAtomFailure;
126
+ /**
127
+ * Assemble a downloadable atom export bundle and run conformance +
128
+ * verify-chain checks before returning.
129
+ */
130
+ export declare function createDownloadableAtom(input: CreateDownloadableAtomInput): CreateDownloadableAtomOutcome;
131
+ /** Runtime guard for wire payloads (gate export tool, console download). */
132
+ export declare function isDownloadableAtom(value: unknown): value is DownloadableAtom;
133
+ //# sourceMappingURL=downloadable-atom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"downloadable-atom.d.ts","sourceRoot":"","sources":["../../src/export/downloadable-atom.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EACL,+BAA+B,EAG/B,KAAK,QAAQ,EACb,KAAK,iBAAiB,EACvB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAGtE,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,uEAAuE;IACvE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,wDAAwD;IACxD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,SAAS,CAAC,EAAE,aAAa,CAAC;CACpC;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,aAAa,EAAE,OAAO,+BAA+B,CAAC;IAC/D,QAAQ,CAAC,QAAQ,EAAE,wBAAwB,CAAC;IAC5C,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,QAAQ,CAAC,cAAc,EAAE,cAA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,MAAM,6BAA6B,GACrC,4BAA4B,GAC5B,6BAA6B,CAAC;AAElC;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,2BAA2B,GACjC,6BAA6B,CAsD/B;AAED,4EAA4E;AAC5E,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,gBAAgB,CAgB5E"}
@@ -0,0 +1,115 @@
1
+ /**
2
+ * Downloadable-atom export shape (architecture homes doc 02).
3
+ *
4
+ * The portable audit unit returned by the gate atom-export tool and
5
+ * rendered by the operator console. Self-contained and verifiable
6
+ * without trusting the hosting system.
7
+ */
8
+ import { z } from "zod";
9
+ import { ATOM_CONFORMANCE_TARGET_VERSION, validateAtomConformance, verifyEventChain, } from "../conformance/index.js";
10
+ import { READ_CONTRACT_SCHEMA } from "../read-contract/read-contract.js";
11
+ import { ACCESS_POLICY_SCHEMA } from "../conformance/common.js";
12
+ export const DOWNLOADABLE_ATOM_IDENTITY_SCHEMA = z
13
+ .object({
14
+ entityType: z.string().min(1),
15
+ entityId: z.string().min(1),
16
+ contentId: z.string().min(1),
17
+ vdaRef: z.string().min(1).optional(),
18
+ })
19
+ .readonly();
20
+ export const DOWNLOADABLE_ATOM_CITATION_SCHEMA = z
21
+ .object({
22
+ citationDid: z.string().min(1),
23
+ label: z.string().min(1).optional(),
24
+ sourceCitation: z.string().min(1).optional(),
25
+ citedAtom: z
26
+ .object({
27
+ kind: z.literal("atom"),
28
+ entityType: z.string().min(1),
29
+ entityId: z.string().min(1),
30
+ mode: z
31
+ .enum(["inline", "compact", "card", "expanded", "focus"])
32
+ .optional(),
33
+ displayLabel: z.string().optional(),
34
+ })
35
+ .optional(),
36
+ })
37
+ .readonly();
38
+ /**
39
+ * Assemble a downloadable atom export bundle and run conformance +
40
+ * verify-chain checks before returning.
41
+ */
42
+ export function createDownloadableAtom(input) {
43
+ const errors = [];
44
+ const identityParsed = DOWNLOADABLE_ATOM_IDENTITY_SCHEMA.safeParse(input.identity);
45
+ if (!identityParsed.success) {
46
+ errors.push({ path: "identity", message: identityParsed.error.message });
47
+ }
48
+ const readContractParsed = READ_CONTRACT_SCHEMA.safeParse(input.readContract);
49
+ if (!readContractParsed.success) {
50
+ errors.push({ path: "readContract", message: readContractParsed.error.message });
51
+ }
52
+ const accessPolicyParsed = ACCESS_POLICY_SCHEMA.safeParse(input.accessPolicy);
53
+ if (!accessPolicyParsed.success) {
54
+ errors.push({ path: "accessPolicy", message: accessPolicyParsed.error.message });
55
+ }
56
+ const signedEventChain = input.signedEventChain ?? [];
57
+ const verifyChain = verifyEventChain(signedEventChain);
58
+ const conformance = validateAtomConformance({
59
+ tier: input.tier,
60
+ readContract: input.readContract,
61
+ accessPolicy: input.accessPolicy,
62
+ signedHistory: input.tier === "data" ? { events: signedEventChain } : undefined,
63
+ });
64
+ if (!conformance.ok) {
65
+ for (const err of conformance.errors) {
66
+ errors.push({ path: err.path, message: err.message });
67
+ }
68
+ }
69
+ if (errors.length > 0) {
70
+ return { ok: false, errors };
71
+ }
72
+ return {
73
+ ok: true,
74
+ export: {
75
+ exportVersion: ATOM_CONFORMANCE_TARGET_VERSION,
76
+ identity: identityParsed.data,
77
+ accessPolicy: accessPolicyParsed.data,
78
+ contextSummary: input.contextSummary,
79
+ readContract: readContractParsed.data,
80
+ compositionReferences: input.compositionReferences ?? [],
81
+ citations: input.citations ?? [],
82
+ signedEventChain,
83
+ verifyChain,
84
+ exportedAt: input.exportedAt ?? new Date().toISOString(),
85
+ },
86
+ };
87
+ }
88
+ /** Runtime guard for wire payloads (gate export tool, console download). */
89
+ export function isDownloadableAtom(value) {
90
+ if (value === null || typeof value !== "object")
91
+ return false;
92
+ const record = value;
93
+ if (record.exportVersion !== ATOM_CONFORMANCE_TARGET_VERSION)
94
+ return false;
95
+ if (!DOWNLOADABLE_ATOM_IDENTITY_SCHEMA.safeParse(record.identity).success) {
96
+ return false;
97
+ }
98
+ if (!READ_CONTRACT_SCHEMA.safeParse(record.readContract).success)
99
+ return false;
100
+ if (!ACCESS_POLICY_SCHEMA.safeParse(record.accessPolicy).success)
101
+ return false;
102
+ if (!Array.isArray(record.compositionReferences))
103
+ return false;
104
+ if (!Array.isArray(record.citations))
105
+ return false;
106
+ if (!Array.isArray(record.signedEventChain))
107
+ return false;
108
+ if (typeof record.exportedAt !== "string")
109
+ return false;
110
+ const verify = record.verifyChain;
111
+ if (verify === null || typeof verify !== "object")
112
+ return false;
113
+ return typeof verify.ok === "boolean";
114
+ }
115
+ //# sourceMappingURL=downloadable-atom.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"downloadable-atom.js","sourceRoot":"","sources":["../../src/export/downloadable-atom.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EACL,+BAA+B,EAC/B,uBAAuB,EACvB,gBAAgB,GAGjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAgChE,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC;KAC/C,MAAM,CAAC;IACN,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CACrC,CAAC;KACD,QAAQ,EAAE,CAAC;AAEd,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC;KAC/C,MAAM,CAAC;IACN,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CA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K,CAAC;IAC1D,IAAI,OAAO,MAAM,CAAC,UAAU,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACxD,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC;IAClC,IAAI,MAAM,KAAK,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAChE,OAAO,OAAQ,MAA4B,CAAC,EAAE,KAAK,SAAS,CAAC;AAC/D,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Downloadable-atom export shape for gate and console portability.
3
+ */
4
+ export { createDownloadableAtom, isDownloadableAtom, DOWNLOADABLE_ATOM_CITATION_SCHEMA, DOWNLOADABLE_ATOM_IDENTITY_SCHEMA, type CreateDownloadableAtomFailure, type CreateDownloadableAtomInput, type CreateDownloadableAtomOutcome, type CreateDownloadableAtomResult, type DownloadableAtom, type DownloadableAtomCitation, type DownloadableAtomIdentity, } from "./downloadable-atom.js";
5
+ export { ATOM_CONFORMANCE_TARGET_VERSION } from "../conformance/common.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/export/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,iCAAiC,EACjC,iCAAiC,EACjC,KAAK,6BAA6B,EAClC,KAAK,2BAA2B,EAChC,KAAK,6BAA6B,EAClC,KAAK,4BAA4B,EACjC,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,GAC9B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Downloadable-atom export shape for gate and console portability.
3
+ */
4
+ export { createDownloadableAtom, isDownloadableAtom, DOWNLOADABLE_ATOM_CITATION_SCHEMA, DOWNLOADABLE_ATOM_IDENTITY_SCHEMA, } from "./downloadable-atom.js";
5
+ export { ATOM_CONFORMANCE_TARGET_VERSION } from "../conformance/common.js";
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/export/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,iCAAiC,EACjC,iCAAiC,GAQlC,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,124 @@
1
+ /**
2
+ * Event-anchored history for atoms.
3
+ *
4
+ * The `EventAnchoringService` interface every atom mutation flows through.
5
+ * Ships the interface verbatim plus a Postgres-backed implementation that
6
+ * writes deterministic SHA-256 `chainHash` values into the `atom_events`
7
+ * table. Cryptographic anchoring (Merkle root, external ledger anchor)
8
+ * lands later without changing the consumer interface — this is the
9
+ * central "interface-stable / implementation-evolves" promise.
10
+ *
11
+ * TODO(M2-C): replace deterministic chainHash with cryptographic anchor.
12
+ */
13
+ import type { AtomReference } from "./registration.js";
14
+ /**
15
+ * Identity of the actor that produced an event. `kind` is `"agent"` for
16
+ * AI/bot writes and `"user"` for human writes. `id` is opaque to the
17
+ * framework — application code chooses its identity scheme.
18
+ */
19
+ export interface EventActor {
20
+ kind: "user" | "agent" | "system";
21
+ id: string;
22
+ }
23
+ /**
24
+ * Input to {@link EventAnchoringService.appendEvent}. `payload` is the
25
+ * mutation payload as the atom recorded it; the framework does not
26
+ * interpret it and stores it verbatim as JSONB.
27
+ */
28
+ export interface AppendEventInput {
29
+ entityType: string;
30
+ entityId: string;
31
+ eventType: string;
32
+ actor: EventActor;
33
+ payload: Record<string, unknown>;
34
+ /** Defaults to "now" when omitted. */
35
+ occurredAt?: Date;
36
+ }
37
+ /**
38
+ * Materialized event row. `chainHash` is deterministic SHA-256;
39
+ * `prevHash` is the previous event's `chainHash` for the same
40
+ * `(entityType, entityId)` pair, or `null` for the first event.
41
+ */
42
+ export interface AtomEvent {
43
+ id: string;
44
+ entityType: string;
45
+ entityId: string;
46
+ eventType: string;
47
+ actor: EventActor;
48
+ payload: Record<string, unknown>;
49
+ prevHash: string | null;
50
+ chainHash: string;
51
+ occurredAt: Date;
52
+ recordedAt: Date;
53
+ }
54
+ /**
55
+ * Options accepted by {@link EventAnchoringService.readHistory}. Pagination
56
+ * is via `offset/limit` because the row count for a single entity is
57
+ * expected to be small; cursor pagination can be added later.
58
+ */
59
+ export interface ReadHistoryOptions {
60
+ limit?: number;
61
+ offset?: number;
62
+ /** When true, return rows newest-first instead of the default oldest-first. */
63
+ reverse?: boolean;
64
+ }
65
+ /**
66
+ * The history contract. Implementations must guarantee:
67
+ * - `appendEvent` is atomic with respect to its `(entityType, entityId)`
68
+ * chain — concurrent appends serialize and the resulting `chainHash`
69
+ * chain is gap-free.
70
+ * - `readHistory` returns events in stable order.
71
+ * - `latestEvent` returns the same row as `readHistory({ reverse: true,
72
+ * limit: 1 })[0] ?? null`.
73
+ */
74
+ export interface EventAnchoringService {
75
+ appendEvent(input: AppendEventInput): Promise<AtomEvent>;
76
+ readHistory(ref: AtomReference, opts?: ReadHistoryOptions): Promise<AtomEvent[]>;
77
+ latestEvent(ref: AtomReference): Promise<AtomEvent | null>;
78
+ }
79
+ declare function generateId(): string;
80
+ /**
81
+ * Compute the deterministic SHA-256 chain hash for an event. Inputs are
82
+ * stringified with stable key order so two callers computing the same
83
+ * event get the same hash. TODO(M2-C): swap for the real cryptographic
84
+ * anchor — same signature, no consumer change.
85
+ */
86
+ declare function computeChainHash(args: {
87
+ prevHash: string | null;
88
+ payload: Record<string, unknown>;
89
+ occurredAt: Date;
90
+ eventType: string;
91
+ actor: EventActor;
92
+ }): string;
93
+ /**
94
+ * Drizzle/node-postgres database surface this service needs. Declared
95
+ * structurally so we don't require a hard dep on `drizzle-orm`'s concrete
96
+ * `db` type (which varies by driver). The host application passes its
97
+ * own `db` instance.
98
+ */
99
+ export interface DrizzleLikeDb {
100
+ transaction: <T>(cb: (tx: DrizzleLikeDb) => Promise<T>) => Promise<T>;
101
+ execute: (query: unknown) => Promise<{
102
+ rows: Array<Record<string, unknown>>;
103
+ }>;
104
+ }
105
+ /**
106
+ * Postgres-backed {@link EventAnchoringService} implementation. Uses raw
107
+ * SQL via Drizzle's `sql` template so the boundary to the host db package
108
+ * stays minimal — we depend on the `atom_events` table existing but not
109
+ * on the driver flavor.
110
+ */
111
+ export declare class PostgresEventAnchoringService implements EventAnchoringService {
112
+ private readonly db;
113
+ constructor(db: DrizzleLikeDb);
114
+ appendEvent(input: AppendEventInput): Promise<AtomEvent>;
115
+ readHistory(ref: AtomReference, opts?: ReadHistoryOptions): Promise<AtomEvent[]>;
116
+ latestEvent(ref: AtomReference): Promise<AtomEvent | null>;
117
+ }
118
+ /** Re-exported for tests that want to assert the chain-hash formula. */
119
+ export declare const __internal: {
120
+ computeChainHash: typeof computeChainHash;
121
+ generateId: typeof generateId;
122
+ };
123
+ export {};
124
+ //# sourceMappingURL=history.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../src/history.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAWvD;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;IAClC,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,UAAU,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,sCAAsC;IACtC,UAAU,CAAC,EAAE,IAAI,CAAC;CACnB;AAED;;;;G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