@agenticprimitives/ontology 1.0.0-alpha.4 → 1.0.0-alpha.40

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 (183) hide show
  1. package/README.md +59 -21
  2. package/cbox/agent-facet-shapes.shacl.ttl +130 -0
  3. package/cbox/capability-catalog-shapes.shacl.ttl +284 -0
  4. package/cbox/card-projection-shapes.shacl.ttl +216 -0
  5. package/cbox/consultation-shapes.shacl.ttl +85 -0
  6. package/cbox/content-vocabulary.ttl +52 -0
  7. package/cbox/controlled-vocabularies.ttl +224 -4
  8. package/cbox/discovery-graph-shapes.shacl.ttl +284 -0
  9. package/cbox/familyoffice-shapes.shacl.ttl +92 -0
  10. package/cbox/familyoffice-vocabulary.ttl +48 -0
  11. package/cbox/geo-vocabulary.ttl +36 -0
  12. package/cbox/guidance-vocabulary.ttl +22 -0
  13. package/cbox/interaction-shapes.shacl.ttl +218 -0
  14. package/cbox/interaction-vocabulary.ttl +159 -0
  15. package/cbox/judgment-shapes.shacl.ttl +83 -0
  16. package/cbox/naming-registry-shapes.shacl.ttl +272 -0
  17. package/cbox/org-team-shapes.shacl.ttl +184 -0
  18. package/cbox/privacy-credential-shapes.shacl.ttl +187 -0
  19. package/cbox/profile-facet-vocabulary.ttl +50 -0
  20. package/cbox/registry-vocabulary.ttl +86 -0
  21. package/cbox/run-measures-shapes.shacl.ttl +59 -0
  22. package/cbox/run-provenance-shapes.shacl.ttl +264 -0
  23. package/cbox/scope-vocabulary.ttl +112 -0
  24. package/cbox/skill-grounding-vocabulary.ttl +18 -0
  25. package/cbox/skill-vocabulary.ttl +50 -0
  26. package/context.jsonld +37 -1
  27. package/dist/arg-types.d.ts +60 -0
  28. package/dist/arg-types.d.ts.map +1 -0
  29. package/dist/arg-types.js +143 -0
  30. package/dist/arg-types.js.map +1 -0
  31. package/dist/artifacts.d.ts +9 -2
  32. package/dist/artifacts.d.ts.map +1 -1
  33. package/dist/artifacts.js +153 -2
  34. package/dist/artifacts.js.map +1 -1
  35. package/dist/contact-fields.d.ts +28 -0
  36. package/dist/contact-fields.d.ts.map +1 -0
  37. package/dist/contact-fields.js +38 -0
  38. package/dist/contact-fields.js.map +1 -0
  39. package/dist/decisions.d.ts +69 -0
  40. package/dist/decisions.d.ts.map +1 -0
  41. package/dist/decisions.js +98 -0
  42. package/dist/decisions.js.map +1 -0
  43. package/dist/evaluation-context.d.ts +134 -0
  44. package/dist/evaluation-context.d.ts.map +1 -0
  45. package/dist/evaluation-context.js +136 -0
  46. package/dist/evaluation-context.js.map +1 -0
  47. package/dist/governance.d.ts +84 -0
  48. package/dist/governance.d.ts.map +1 -0
  49. package/dist/governance.js +88 -0
  50. package/dist/governance.js.map +1 -0
  51. package/dist/grounded-vocabulary.d.ts +29 -0
  52. package/dist/grounded-vocabulary.d.ts.map +1 -0
  53. package/dist/grounded-vocabulary.js +110 -0
  54. package/dist/grounded-vocabulary.js.map +1 -0
  55. package/dist/household.d.ts +19 -0
  56. package/dist/household.d.ts.map +1 -0
  57. package/dist/household.js +41 -0
  58. package/dist/household.js.map +1 -0
  59. package/dist/index.d.ts +1091 -3
  60. package/dist/index.d.ts.map +1 -1
  61. package/dist/index.js +1323 -5
  62. package/dist/index.js.map +1 -1
  63. package/dist/outcomes.d.ts +47 -0
  64. package/dist/outcomes.d.ts.map +1 -0
  65. package/dist/outcomes.js +40 -0
  66. package/dist/outcomes.js.map +1 -0
  67. package/dist/participant-vocabulary.d.ts +57 -0
  68. package/dist/participant-vocabulary.d.ts.map +1 -0
  69. package/dist/participant-vocabulary.js +66 -0
  70. package/dist/participant-vocabulary.js.map +1 -0
  71. package/dist/party-roles.d.ts +115 -0
  72. package/dist/party-roles.d.ts.map +1 -0
  73. package/dist/party-roles.js +343 -0
  74. package/dist/party-roles.js.map +1 -0
  75. package/dist/payload-classes.d.ts +22 -0
  76. package/dist/payload-classes.d.ts.map +1 -0
  77. package/dist/payload-classes.js +30 -0
  78. package/dist/payload-classes.js.map +1 -0
  79. package/dist/plan-shapes.d.ts +18 -0
  80. package/dist/plan-shapes.d.ts.map +1 -0
  81. package/dist/plan-shapes.js +38 -0
  82. package/dist/plan-shapes.js.map +1 -0
  83. package/dist/principles.generated.d.ts +11 -0
  84. package/dist/principles.generated.d.ts.map +1 -0
  85. package/dist/principles.generated.js +293 -0
  86. package/dist/principles.generated.js.map +1 -0
  87. package/dist/published-works.d.ts +13 -0
  88. package/dist/published-works.d.ts.map +1 -0
  89. package/dist/published-works.js +18 -0
  90. package/dist/published-works.js.map +1 -0
  91. package/dist/relations.d.ts +44 -0
  92. package/dist/relations.d.ts.map +1 -0
  93. package/dist/relations.js +104 -0
  94. package/dist/relations.js.map +1 -0
  95. package/dist/run-measures-context.d.ts +74 -0
  96. package/dist/run-measures-context.d.ts.map +1 -0
  97. package/dist/run-measures-context.js +77 -0
  98. package/dist/run-measures-context.js.map +1 -0
  99. package/dist/run-provenance-context.d.ts +315 -0
  100. package/dist/run-provenance-context.d.ts.map +1 -0
  101. package/dist/run-provenance-context.js +323 -0
  102. package/dist/run-provenance-context.js.map +1 -0
  103. package/dist/transitions.d.ts +42 -0
  104. package/dist/transitions.d.ts.map +1 -0
  105. package/dist/transitions.js +100 -0
  106. package/dist/transitions.js.map +1 -0
  107. package/dist/vault-records.d.ts +74 -0
  108. package/dist/vault-records.d.ts.map +1 -0
  109. package/dist/vault-records.js +777 -0
  110. package/dist/vault-records.js.map +1 -0
  111. package/dist/versions.generated.d.ts +262 -0
  112. package/dist/versions.generated.d.ts.map +1 -0
  113. package/dist/versions.generated.js +318 -0
  114. package/dist/versions.generated.js.map +1 -0
  115. package/evaluation.jsonld +133 -0
  116. package/mappings/actor-context-standards.ttl +89 -0
  117. package/mappings/agent-discovery-standards.ttl +127 -0
  118. package/mappings/collaboration-crosswalk-actors.ttl +30 -0
  119. package/mappings/collaboration-crosswalk-authority.ttl +31 -0
  120. package/mappings/collaboration-crosswalk-guidance.ttl +29 -0
  121. package/mappings/collaboration-crosswalk-intent.ttl +29 -0
  122. package/mappings/collaboration-crosswalk-messaging.ttl +37 -0
  123. package/mappings/collaboration-crosswalk-organization.ttl +66 -0
  124. package/mappings/collaboration-crosswalk-protocols.ttl +49 -0
  125. package/mappings/collaboration-crosswalk-skills.ttl +50 -0
  126. package/mappings/collaboration-profile.ttl +82 -0
  127. package/mappings/commerce-engagement-crosswalk.ttl +83 -0
  128. package/mappings/spine-standards.ttl +83 -0
  129. package/package.json +31 -9
  130. package/run-measures.jsonld +34 -0
  131. package/run-provenance.jsonld +314 -0
  132. package/tbox/actor-context.ttl +145 -0
  133. package/tbox/agent-resolution.ttl +308 -0
  134. package/tbox/agreement.ttl +77 -0
  135. package/tbox/attestation.ttl +156 -0
  136. package/tbox/card-projection.ttl +350 -0
  137. package/tbox/constraints.ttl +150 -0
  138. package/tbox/contact.ttl +61 -0
  139. package/tbox/content.ttl +76 -0
  140. package/tbox/context.ttl +508 -0
  141. package/tbox/coordination.ttl +263 -0
  142. package/tbox/core.ttl +325 -7
  143. package/tbox/dcat-imports.ttl +19 -0
  144. package/tbox/discovery.ttl +273 -0
  145. package/tbox/dqv-imports.ttl +29 -0
  146. package/tbox/earl-imports.ttl +32 -0
  147. package/tbox/engagement.ttl +349 -0
  148. package/tbox/entitlement.ttl +41 -0
  149. package/tbox/estate.ttl +78 -0
  150. package/tbox/evaluation.ttl +330 -0
  151. package/tbox/execution.ttl +720 -0
  152. package/tbox/familyoffice.ttl +87 -0
  153. package/tbox/fulfillment.ttl +140 -0
  154. package/tbox/geo.ttl +28 -0
  155. package/tbox/governance.ttl +67 -0
  156. package/tbox/guidance.ttl +40 -0
  157. package/tbox/household.ttl +142 -0
  158. package/tbox/identity.ttl +133 -6
  159. package/tbox/inference.ttl +177 -0
  160. package/tbox/intents.ttl +241 -0
  161. package/tbox/interaction.ttl +297 -0
  162. package/tbox/messaging.ttl +244 -0
  163. package/tbox/naming.ttl +114 -0
  164. package/tbox/org.ttl +410 -0
  165. package/tbox/payload.ttl +94 -0
  166. package/tbox/payment.ttl +124 -0
  167. package/tbox/plan.ttl +169 -0
  168. package/tbox/principles.ttl +212 -0
  169. package/tbox/privacy-credential.ttl +436 -0
  170. package/tbox/profile.ttl +107 -0
  171. package/tbox/prov-imports.ttl +73 -0
  172. package/tbox/registry.ttl +382 -0
  173. package/tbox/resolution.ttl +108 -0
  174. package/tbox/scope.ttl +59 -0
  175. package/tbox/security-exposure.ttl +102 -0
  176. package/tbox/situation.ttl +56 -0
  177. package/tbox/skills.ttl +316 -0
  178. package/tbox/skos-imports.ttl +54 -0
  179. package/tbox/transition.ttl +63 -0
  180. package/tbox/trust.ttl +210 -0
  181. package/tbox/values.ttl +81 -0
  182. package/tbox/verification-receipt.ttl +134 -0
  183. package/versions.adoption.json +173 -0
@@ -0,0 +1,69 @@
1
+ /** A T-box property IRI. A string, checked by `check:ontology-bindings` rather than by the type system. */
2
+ export type PropertyIri = string;
3
+ /** How many facts of the basis must hold for the rule to answer. `exactly-one` is the honest default:
4
+ * two marked accounts is ambiguity, and answering it by picking one is the failure this prevents. */
5
+ export type BasisCardinality = 'exactly-one' | 'at-least-one';
6
+ export interface DecisionRuleV1 {
7
+ /** Stable id — appears in the receipt, so a run can be audited for its DECISIONS. */
8
+ id: string;
9
+ /** The modelled fact this rule reads. Checked against the T-box by `check:ontology-bindings`. */
10
+ basis: {
11
+ property: PropertyIri;
12
+ cardinality: BasisCardinality;
13
+ };
14
+ /** What the person is told when this rule decided — RENDERED, never composed by a model. */
15
+ because: string;
16
+ /** Whether saying otherwise in the same request wins. Always true today, and stated rather than
17
+ * assumed: a preference that cannot be overridden in the moment is a constraint, and this is not one. */
18
+ overridable: true;
19
+ }
20
+ export interface DecisionPointV1 {
21
+ /** What is being decided. */
22
+ id: string;
23
+ /** The question a person is asked when no rule answers — their words, not ours. */
24
+ question: string;
25
+ /** Ordered. The FIRST rule whose basis holds answers; none ⇒ ask. */
26
+ rules: readonly DecisionRuleV1[];
27
+ /** Fail-closed, always. There is no `guess`, and there will not be one. */
28
+ fallback: 'ask';
29
+ }
30
+ /**
31
+ * WHICH ACCOUNT PAYS.
32
+ *
33
+ * The incident: a person holding eighteen treasuries was offered all eighteen as a list of addresses,
34
+ * every time, because the ontology could say which account should RECEIVE (`ap:primaryPayee`, so a
35
+ * stranger's agent stops asking) and nothing at all about which one SPENDS. The owner — the only person
36
+ * who knows — was asked most often.
37
+ */
38
+ export declare const PAYMENT_SOURCE_ACCOUNT: DecisionPointV1;
39
+ /**
40
+ * WHO A BARE NAME MEANS.
41
+ *
42
+ * "Send sarah 20" — the directory holds four Sarahs and the person meant the one they live with. A
43
+ * household is the asker's OWN private record (ADR-0025), so consulting it first is both the better
44
+ * answer and the more private one: nothing leaves their tier, and no directory learns who they asked
45
+ * about. A person outside the household is not excluded — they are simply not the first reading of a
46
+ * first name, which is how first names work.
47
+ */
48
+ export declare const PAYMENT_RECIPIENT: DecisionPointV1;
49
+ export declare const DECISION_POINTS: readonly DecisionPointV1[];
50
+ /** The decision point for an id, or undefined. A caller with no point defined ASKS — absence is the
51
+ * fail-closed state, never a licence to decide unmodelled. */
52
+ export declare function decisionPoint(id: string): DecisionPointV1 | undefined;
53
+ /**
54
+ * Apply a decision point to candidates that carry which bases they satisfy.
55
+ *
56
+ * The caller does the READING (it knows where the facts live — a chain role, a vault record); this does
57
+ * the DECIDING, so the rule order and the fail-closed default live in one place and are the same for
58
+ * every caller. Returns the chosen candidate WITH the sentence that says why, or nothing — and nothing
59
+ * means ask, in the point's own words.
60
+ */
61
+ export declare function decide<T>(point: DecisionPointV1, candidates: ReadonlyArray<{
62
+ value: T;
63
+ satisfies: readonly PropertyIri[];
64
+ }>): {
65
+ value: T;
66
+ ruleId: string;
67
+ because: string;
68
+ } | null;
69
+ //# sourceMappingURL=decisions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decisions.d.ts","sourceRoot":"","sources":["../src/decisions.ts"],"names":[],"mappings":"AA8BA,2GAA2G;AAC3G,MAAM,MAAM,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+ //
3
+ // The T-box says what things ARE. `party-roles` says what an argument's party MAY BE. Neither says what
4
+ // to DO when the world underdetermines the act: which of your six accounts pays, whether a first name
5
+ // means the person in your household or the one in the directory, when an agent may answer instead of
6
+ // asking. Those are DECISIONS, and there are about a hundred and eighty of them improvised across two
7
+ // files — defensible one at a time, unreadable together, and citable by nobody.
8
+ //
9
+ // WHY NOT OWL. "If exactly one of your accounts is marked, pay from it" is not an entailment: it is a
10
+ // default with exceptions, overridable in the same sentence. OWL is monotonic — asserting it there would
11
+ // make it a fact, and the first exception would make the ontology wrong. Why not SHACL rules: their home
12
+ // is a triple store, and a resolver runs inside a request (spec 355 §1).
13
+ //
14
+ // SO: a small typed table, grounded in T-box terms BY IRI (the same gate checks it), evaluated
15
+ // in-process, ORDERED and first-match, and fail-closed onto asking the person.
16
+ //
17
+ // THREE PROPERTIES ARE LOAD-BEARING:
18
+ // · Ordered, first-match, fail-closed — no scoring. A ranking function that picks between unmodelled
19
+ // options is the string-similarity heuristic spec 355 was written to end, wearing a percentage.
20
+ // · Every answer carries its citation. A decision that cannot say why is indistinguishable from a
21
+ // guess, and the person cannot correct it.
22
+ // · A rule NEVER grants. It narrows, orders, defaults and explains; the mandate decides what may
23
+ // happen, and no verifier reads this table (spec 353 §4 / spec 354 §1).
24
+ // The namespace is INLINED for the same reason `party-roles` inlines it: `index.ts` re-exports both, so
25
+ // importing the constant back reads it in TDZ and every IRI here becomes `undefined#primaryPayer`.
26
+ const AP_NS = 'https://agenticprimitives.dev/ns/core#';
27
+ const AP = (local) => `${AP_NS}${local}`;
28
+ const AP_HH_NS = 'https://agenticprimitives.dev/ns/household#';
29
+ const AP_HH = (local) => `${AP_HH_NS}${local}`;
30
+ /**
31
+ * WHICH ACCOUNT PAYS.
32
+ *
33
+ * The incident: a person holding eighteen treasuries was offered all eighteen as a list of addresses,
34
+ * every time, because the ontology could say which account should RECEIVE (`ap:primaryPayee`, so a
35
+ * stranger's agent stops asking) and nothing at all about which one SPENDS. The owner — the only person
36
+ * who knows — was asked most often.
37
+ */
38
+ export const PAYMENT_SOURCE_ACCOUNT = {
39
+ id: 'payment.sourceAccount',
40
+ question: 'Which of your accounts should pay?',
41
+ rules: [
42
+ {
43
+ id: 'marked-primary-payer',
44
+ basis: { property: AP('primaryPayer'), cardinality: 'exactly-one' },
45
+ because: 'you marked it as the account you pay from',
46
+ overridable: true,
47
+ },
48
+ ],
49
+ fallback: 'ask',
50
+ };
51
+ /**
52
+ * WHO A BARE NAME MEANS.
53
+ *
54
+ * "Send sarah 20" — the directory holds four Sarahs and the person meant the one they live with. A
55
+ * household is the asker's OWN private record (ADR-0025), so consulting it first is both the better
56
+ * answer and the more private one: nothing leaves their tier, and no directory learns who they asked
57
+ * about. A person outside the household is not excluded — they are simply not the first reading of a
58
+ * first name, which is how first names work.
59
+ */
60
+ export const PAYMENT_RECIPIENT = {
61
+ id: 'payment.recipient',
62
+ question: 'Who do you mean?',
63
+ rules: [
64
+ {
65
+ id: 'household-member',
66
+ basis: { property: AP_HH('householdMember'), cardinality: 'exactly-one' },
67
+ because: 'they are in your household',
68
+ overridable: true,
69
+ },
70
+ ],
71
+ fallback: 'ask',
72
+ };
73
+ export const DECISION_POINTS = [PAYMENT_SOURCE_ACCOUNT, PAYMENT_RECIPIENT];
74
+ /** The decision point for an id, or undefined. A caller with no point defined ASKS — absence is the
75
+ * fail-closed state, never a licence to decide unmodelled. */
76
+ export function decisionPoint(id) {
77
+ return DECISION_POINTS.find((d) => d.id === id);
78
+ }
79
+ /**
80
+ * Apply a decision point to candidates that carry which bases they satisfy.
81
+ *
82
+ * The caller does the READING (it knows where the facts live — a chain role, a vault record); this does
83
+ * the DECIDING, so the rule order and the fail-closed default live in one place and are the same for
84
+ * every caller. Returns the chosen candidate WITH the sentence that says why, or nothing — and nothing
85
+ * means ask, in the point's own words.
86
+ */
87
+ export function decide(point, candidates) {
88
+ for (const rule of point.rules) {
89
+ const hits = candidates.filter((c) => c.satisfies.includes(rule.basis.property));
90
+ if (rule.basis.cardinality === 'exactly-one' && hits.length !== 1)
91
+ continue;
92
+ if (rule.basis.cardinality === 'at-least-one' && hits.length === 0)
93
+ continue;
94
+ return { value: hits[0].value, ruleId: rule.id, because: rule.because };
95
+ }
96
+ return null;
97
+ }
98
+ //# sourceMappingURL=decisions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decisions.js","sourceRoot":"","sources":["../src/decisions.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,EAAE;AACF,wGAAwG;AACxG,sGAAsG;AACtG,sGAAsG;AACtG,sGAAsG;AACtG,gFAAgF;AAChF,EAAE;AACF,sGAAsG;AACtG,yGAAyG;AACzG,yGAAyG;AACzG,yEAAyE;AACzE,EAAE;AACF,+FAA+F;AAC/F,+EAA+E;AAC/E,EAAE;AACF,qCAAqC;AACrC,uGAAuG;AACvG,oGAAoG;AACpG,oGAAoG;AACpG,+CAA+C;AAC/C,mGAAmG;AACnG,4EAA4E;AAC5E,wGAAwG;AACxG,mGAAmG;AACnG,MAAM,KAAK,GAAG,wCAAwC,CAAC;AACvD,MAAM,EAAE,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,GAAG,KAAK,GAAG,KAAK,EAAE,CAAC;AACzD,MAAM,QAAQ,GAAG,6CAA6C,CAAC;AAC/D,MAAM,KAAK,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,GAAG,QAAQ,GAAG,KAAK,EAAE,CAAC;AAgC/D;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAoB;IACrD,EAAE,EAAE,uBAAuB;IAC3B,QAAQ,EAAE,oCAAoC;IAC9C,KAAK,EAAE;QACL;YACE,EAAE,EAAE,sBAAsB;YAC1B,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE;YACnE,OAAO,EAAE,2CAA2C;YACpD,WAAW,EAAE,IAAI;SAClB;KACF;IACD,QAAQ,EAAE,KAAK;CAChB,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,IAAI,CAAC,OAAO,EAAE,CAAC;IAC3E,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,134 @@
1
+ export declare const EVALUATION_CONTEXT: {
2
+ readonly "@context": {
3
+ readonly "@version": 1.1;
4
+ readonly "@base": "urn:ap:prov:";
5
+ readonly prov: "http://www.w3.org/ns/prov#";
6
+ readonly dcat: "http://www.w3.org/ns/dcat#";
7
+ readonly earl: "http://www.w3.org/ns/earl#";
8
+ readonly apeval: "https://agenticprimitives.dev/ns/evaluation#";
9
+ readonly xsd: "http://www.w3.org/2001/XMLSchema#";
10
+ readonly id: "@id";
11
+ readonly type: "@type";
12
+ readonly graph: "@graph";
13
+ readonly used: {
14
+ readonly "@id": "prov:used";
15
+ readonly "@type": "@id";
16
+ readonly "@container": "@set";
17
+ };
18
+ readonly generated: {
19
+ readonly "@id": "prov:generated";
20
+ readonly "@type": "@id";
21
+ readonly "@container": "@set";
22
+ };
23
+ readonly wasAssociatedWith: {
24
+ readonly "@id": "prov:wasAssociatedWith";
25
+ readonly "@type": "@id";
26
+ };
27
+ readonly wasGeneratedBy: {
28
+ readonly "@id": "prov:wasGeneratedBy";
29
+ readonly "@type": "@id";
30
+ };
31
+ readonly startedAtTime: {
32
+ readonly "@id": "prov:startedAtTime";
33
+ readonly "@type": "xsd:dateTime";
34
+ };
35
+ readonly endedAtTime: {
36
+ readonly "@id": "prov:endedAtTime";
37
+ readonly "@type": "xsd:dateTime";
38
+ };
39
+ readonly criterionDigest: "apeval:criterionDigest";
40
+ readonly judgeKind: "apeval:judgeKind";
41
+ readonly assertedBy: {
42
+ readonly "@id": "earl:assertedBy";
43
+ readonly "@type": "@id";
44
+ };
45
+ readonly subject: {
46
+ readonly "@id": "earl:subject";
47
+ readonly "@type": "@id";
48
+ };
49
+ readonly test: {
50
+ readonly "@id": "earl:test";
51
+ readonly "@type": "@id";
52
+ };
53
+ readonly mode: {
54
+ readonly "@id": "earl:mode";
55
+ readonly "@type": "@id";
56
+ };
57
+ readonly result: {
58
+ readonly "@id": "earl:result";
59
+ readonly "@type": "@id";
60
+ };
61
+ readonly outcome: {
62
+ readonly "@id": "earl:outcome";
63
+ readonly "@type": "@id";
64
+ };
65
+ readonly selectionOutcome: {
66
+ readonly "@id": "apeval:selectionOutcome";
67
+ readonly "@type": "@id";
68
+ };
69
+ readonly evidenceKind: "apeval:evidenceKind";
70
+ readonly chargedTo: {
71
+ readonly "@id": "apeval:chargedTo";
72
+ readonly "@container": "@set";
73
+ };
74
+ readonly version: "dcat:version";
75
+ readonly setDigest: "apeval:setDigest";
76
+ readonly distribution: {
77
+ readonly "@id": "dcat:distribution";
78
+ readonly "@type": "@id";
79
+ };
80
+ readonly downloadURL: {
81
+ readonly "@id": "dcat:downloadURL";
82
+ readonly "@type": "@id";
83
+ };
84
+ readonly hasIntent: {
85
+ readonly "@id": "apeval:hasIntent";
86
+ readonly "@type": "@id";
87
+ readonly "@container": "@set";
88
+ };
89
+ readonly split: "apeval:split";
90
+ readonly bucket: "apeval:bucket";
91
+ readonly replaySetDigest: "apeval:replaySetDigest";
92
+ readonly variantDigest: "apeval:variantDigest";
93
+ readonly thresholdsDigest: "apeval:thresholdsDigest";
94
+ readonly planDigest: "apeval:planDigest";
95
+ readonly repeats: "apeval:repeats";
96
+ readonly confounded: "apeval:confounded";
97
+ readonly captureLevel: "apeval:captureLevel";
98
+ readonly roster: {
99
+ readonly "@id": "apeval:roster";
100
+ readonly "@container": "@set";
101
+ };
102
+ readonly estate: "apeval:estate";
103
+ readonly hasRun: {
104
+ readonly "@id": "apeval:hasRun";
105
+ readonly "@type": "@id";
106
+ readonly "@container": "@set";
107
+ };
108
+ readonly refusedCount: {
109
+ readonly "@id": "apeval:refusedCount";
110
+ readonly "@container": "@set";
111
+ };
112
+ readonly wasInformedBy: {
113
+ readonly "@id": "prov:wasInformedBy";
114
+ readonly "@type": "@id";
115
+ readonly "@container": "@set";
116
+ };
117
+ readonly Activity: "prov:Activity";
118
+ readonly Agent: "prov:Agent";
119
+ readonly Entity: "prov:Entity";
120
+ readonly Dataset: "dcat:Dataset";
121
+ readonly Distribution: "dcat:Distribution";
122
+ readonly ReplaySet: "apeval:ReplaySet";
123
+ readonly ReplayIntent: "apeval:ReplayIntent";
124
+ readonly Judgment: "apeval:Judgment";
125
+ readonly ExperimentPlan: "apeval:ExperimentPlan";
126
+ readonly Experiment: "apeval:Experiment";
127
+ readonly CaptureWindow: "apeval:CaptureWindow";
128
+ readonly Plan: "prov:Plan";
129
+ readonly Judge: "apeval:Judge";
130
+ readonly Assertion: "earl:Assertion";
131
+ readonly TestResult: "earl:TestResult";
132
+ };
133
+ };
134
+ //# sourceMappingURL=evaluation-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evaluation-context.d.ts","sourceRoot":"","sources":["../src/evaluation-context.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoIrB,CAAC"}
@@ -0,0 +1,136 @@
1
+ // THE EVALUATION CONTEXT, AS A CONSTANT — spec 415 S0/SEL-1: replay sets (DCAT) and judgments (EARL). The published
2
+ // artifact is `evaluation.jsonld`; the ontology suite asserts the two are equal and every term is a declared T-box IRI.
3
+ export const EVALUATION_CONTEXT = {
4
+ "@context": {
5
+ "@version": 1.1,
6
+ "@base": "urn:ap:prov:",
7
+ "prov": "http://www.w3.org/ns/prov#",
8
+ "dcat": "http://www.w3.org/ns/dcat#",
9
+ "earl": "http://www.w3.org/ns/earl#",
10
+ "apeval": "https://agenticprimitives.dev/ns/evaluation#",
11
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
12
+ "id": "@id",
13
+ "type": "@type",
14
+ "graph": "@graph",
15
+ "used": {
16
+ "@id": "prov:used",
17
+ "@type": "@id",
18
+ "@container": "@set"
19
+ },
20
+ "generated": {
21
+ "@id": "prov:generated",
22
+ "@type": "@id",
23
+ "@container": "@set"
24
+ },
25
+ "wasAssociatedWith": {
26
+ "@id": "prov:wasAssociatedWith",
27
+ "@type": "@id"
28
+ },
29
+ "wasGeneratedBy": {
30
+ "@id": "prov:wasGeneratedBy",
31
+ "@type": "@id"
32
+ },
33
+ "startedAtTime": {
34
+ "@id": "prov:startedAtTime",
35
+ "@type": "xsd:dateTime"
36
+ },
37
+ "endedAtTime": {
38
+ "@id": "prov:endedAtTime",
39
+ "@type": "xsd:dateTime"
40
+ },
41
+ "criterionDigest": "apeval:criterionDigest",
42
+ "judgeKind": "apeval:judgeKind",
43
+ "assertedBy": {
44
+ "@id": "earl:assertedBy",
45
+ "@type": "@id"
46
+ },
47
+ "subject": {
48
+ "@id": "earl:subject",
49
+ "@type": "@id"
50
+ },
51
+ "test": {
52
+ "@id": "earl:test",
53
+ "@type": "@id"
54
+ },
55
+ "mode": {
56
+ "@id": "earl:mode",
57
+ "@type": "@id"
58
+ },
59
+ "result": {
60
+ "@id": "earl:result",
61
+ "@type": "@id"
62
+ },
63
+ "outcome": {
64
+ "@id": "earl:outcome",
65
+ "@type": "@id"
66
+ },
67
+ "selectionOutcome": {
68
+ "@id": "apeval:selectionOutcome",
69
+ "@type": "@id"
70
+ },
71
+ "evidenceKind": "apeval:evidenceKind",
72
+ "chargedTo": {
73
+ "@id": "apeval:chargedTo",
74
+ "@container": "@set"
75
+ },
76
+ "version": "dcat:version",
77
+ "setDigest": "apeval:setDigest",
78
+ "distribution": {
79
+ "@id": "dcat:distribution",
80
+ "@type": "@id"
81
+ },
82
+ "downloadURL": {
83
+ "@id": "dcat:downloadURL",
84
+ "@type": "@id"
85
+ },
86
+ "hasIntent": {
87
+ "@id": "apeval:hasIntent",
88
+ "@type": "@id",
89
+ "@container": "@set"
90
+ },
91
+ "split": "apeval:split",
92
+ "bucket": "apeval:bucket",
93
+ "replaySetDigest": "apeval:replaySetDigest",
94
+ "variantDigest": "apeval:variantDigest",
95
+ "thresholdsDigest": "apeval:thresholdsDigest",
96
+ "planDigest": "apeval:planDigest",
97
+ "repeats": "apeval:repeats",
98
+ "confounded": "apeval:confounded",
99
+ "captureLevel": "apeval:captureLevel",
100
+ "roster": {
101
+ "@id": "apeval:roster",
102
+ "@container": "@set"
103
+ },
104
+ "estate": "apeval:estate",
105
+ "hasRun": {
106
+ "@id": "apeval:hasRun",
107
+ "@type": "@id",
108
+ "@container": "@set"
109
+ },
110
+ "refusedCount": {
111
+ "@id": "apeval:refusedCount",
112
+ "@container": "@set"
113
+ },
114
+ "wasInformedBy": {
115
+ "@id": "prov:wasInformedBy",
116
+ "@type": "@id",
117
+ "@container": "@set"
118
+ },
119
+ "Activity": "prov:Activity",
120
+ "Agent": "prov:Agent",
121
+ "Entity": "prov:Entity",
122
+ "Dataset": "dcat:Dataset",
123
+ "Distribution": "dcat:Distribution",
124
+ "ReplaySet": "apeval:ReplaySet",
125
+ "ReplayIntent": "apeval:ReplayIntent",
126
+ "Judgment": "apeval:Judgment",
127
+ "ExperimentPlan": "apeval:ExperimentPlan",
128
+ "Experiment": "apeval:Experiment",
129
+ "CaptureWindow": "apeval:CaptureWindow",
130
+ "Plan": "prov:Plan",
131
+ "Judge": "apeval:Judge",
132
+ "Assertion": "earl:Assertion",
133
+ "TestResult": "earl:TestResult"
134
+ }
135
+ };
136
+ //# sourceMappingURL=evaluation-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evaluation-context.js","sourceRoot":"","sources":["../src/evaluation-context.ts"],"names":[],"mappings":"AAAA,oHAAoH;AACpH,wHAAwH;AACxH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,UAAU,EAAE;QACV,UAAU,EAAE,GAAG;QACf,OAAO,EAAE,cAAc;QACvB,MAAM,EAAE,4BAA4B;QACpC,MAAM,EAAE,4BAA4B;QACpC,MAAM,EAAE,4BAA4B;QACpC,QAAQ,EAAE,8CAA8C;QAC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WAAW,EAAE,gBAAgB;QAC7B,YAAY,EAAE,iBAAiB;KAChC;CACO,CAAC"}
@@ -0,0 +1,84 @@
1
+ export declare const GOVERNANCE_TERMS: {
2
+ readonly AdoptedVersion: "https://agenticprimitives.dev/ns/governance#AdoptedVersion";
3
+ readonly manifestDigest: "https://agenticprimitives.dev/ns/governance#manifestDigest";
4
+ readonly adoptedAt: "https://agenticprimitives.dev/ns/governance#adoptedAt";
5
+ readonly proposalRef: "https://agenticprimitives.dev/ns/governance#proposalRef";
6
+ readonly LocalMeaning: "https://agenticprimitives.dev/ns/governance#LocalMeaning";
7
+ readonly ofTerm: "https://agenticprimitives.dev/ns/governance#ofTerm";
8
+ readonly heldBy: "https://agenticprimitives.dev/ns/governance#heldBy";
9
+ readonly mappingRelation: "https://agenticprimitives.dev/ns/governance#mappingRelation";
10
+ readonly Steward: "https://agenticprimitives.dev/ns/governance#Steward";
11
+ readonly stewards: "https://agenticprimitives.dev/ns/governance#stewards";
12
+ readonly stewardAgent: "https://agenticprimitives.dev/ns/governance#stewardAgent";
13
+ readonly charterRef: "https://agenticprimitives.dev/ns/governance#charterRef";
14
+ };
15
+ /** One published manifest, and who stewarded the change that produced it. The ledger is `versions.adoption.json`. */
16
+ export interface ManifestEntryV1 {
17
+ manifestDigest: `0x${string}`;
18
+ /** The steward's Smart Agent (an address) or, before the estate names one, the maintainer's handle. */
19
+ steward: string;
20
+ publishedAt: string;
21
+ note: string;
22
+ }
23
+ /** An estate's adoption of a manifest — a vault record on the estate's registry agent, anchored in its projection. */
24
+ export interface AdoptedVersionV1 {
25
+ type: 'ap.adopted-version.v1';
26
+ estateId: `0x${string}`;
27
+ manifestDigest: `0x${string}`;
28
+ adoptedAt: string;
29
+ proposalRef: string;
30
+ }
31
+ export type SkosMapping = 'narrowMatch' | 'broadMatch' | 'relatedMatch';
32
+ /** An organization's own meaning of a common term. Never `exactMatch` (that is no local meaning), never a new class. */
33
+ export interface LocalMeaningV1 {
34
+ type: 'ap.local-meaning.v1';
35
+ /** The organization whose meaning it is (its Smart Agent). */
36
+ organization: `0x${string}`;
37
+ /** The COMMON term (a shared T-box IRI, e.g. aporg:member's IRI). */
38
+ term: string;
39
+ /** The organization's own concept IRI (under its own namespace). */
40
+ localTerm: string;
41
+ relation: SkosMapping;
42
+ /** What differs, in the organization's words ("a member is a baptized adult"). */
43
+ scopeNote: string;
44
+ since: string;
45
+ }
46
+ /** The reference a grant carries for a local meaning it used: the organization and the term, resolvable to the record. */
47
+ export declare const meaningRef: (m: Pick<LocalMeaningV1, "organization" | "term">) => string;
48
+ export declare const LOCAL_MEANING_PREFIX: "ontology.meaning:";
49
+ export declare const localMeaningRecordType: (term: string) => string;
50
+ export interface StewardRecordV1 {
51
+ type: 'ap.steward.v1';
52
+ /** The term or module IRI stewarded. */
53
+ subject: string;
54
+ stewardAgent: `0x${string}`;
55
+ since: string;
56
+ charterRef?: `0x${string}`;
57
+ }
58
+ export declare const STEWARD_TERM_DATATYPE: "ap:steward";
59
+ export declare const STEWARD_TERM_PREFIX: "apgov:steward:";
60
+ /** The curie a steward record is registered under: `apgov:steward:<subject>`; the subject as written (an IRI or a curie). */
61
+ export declare const stewardTermCurie: (subject: string) => string;
62
+ /** The registry row for a steward record: `registerTerm(keccak256(curie), curie, uri, label, datatype)`'s four strings. */
63
+ export declare function encodeStewardTerm(r: StewardRecordV1): {
64
+ curie: string;
65
+ uri: string;
66
+ label: string;
67
+ datatype: typeof STEWARD_TERM_DATATYPE;
68
+ };
69
+ /** A registry row back into a steward record; null when the row is not one (any other datatype, a malformed label). */
70
+ export declare function decodeStewardTerm(term: {
71
+ curie: string;
72
+ uri: string;
73
+ label: string;
74
+ datatype: string;
75
+ active?: boolean;
76
+ }): StewardRecordV1 | null;
77
+ export declare function validateLocalMeaning(v: unknown): {
78
+ ok: true;
79
+ meaning: LocalMeaningV1;
80
+ } | {
81
+ ok: false;
82
+ errors: string[];
83
+ };
84
+ //# sourceMappingURL=governance.d.ts.map
@@ -0,0 +1 @@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,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,KAAK,MAAM,EAAE,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,KAAK,MAAM,EAAE,CAAC;CAC5B;AASD,eAAO,MAAM,qBAAqB,EAAG,YAAqB,CAAC;AAC3D,eAAO,MAAM,mBAAmB,EAAG,gBAAyB,CAAC;AAC7D,6HAA6H;AAC7H,eAAO,MAAM,gBAAgB,YAAa,MAAM,KAAG,MAAmD,CAAC;AACvG,2HAA2H;AAC3H,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,eAAe,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,qBAAqB,CAAA;CAAE,CAW3I;AACD,uHAAuH;AACvH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,eAAe,GAAG,IAAI,CAMjJ;AAED,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,OAAO,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,cAAc,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAYxH"}
@@ -0,0 +1,88 @@
1
+ // GOVERNANCE OF THE COMMON MODEL — spec 410 §10 (THESIS-10). The tooling under the twelfth principle, bound by IRI
2
+ // to `tbox/governance.ttl` and checked by `check:ontology-bindings`:
3
+ //
4
+ // 1. VERSIONING AND ADOPTION. `versions.adoption.json` is the ledger of every manifest digest this package has
5
+ // published, each entry naming its STEWARD; `check:ontology-version-adoption` refuses a T-box change whose new
6
+ // manifest digest has no entry naming who stewarded it. An ESTATE adopts one entry (`AdoptedVersionV1`) by a
7
+ // governance proposal and anchors it; its verifiers bind THAT digest (spec 410 §5), never the package's latest.
8
+ // 2. TWO MEANINGS, BOTH NAMED. `LocalMeaningV1` — an organization's own meaning of a common term, a SKOS mapping
9
+ // (narrowMatch / broadMatch / relatedMatch) onto the common IRI with a scope note, published on its Smart Agent.
10
+ // The common T-box is untouched (ADR-0054). A grant issued by the organization names its meanings in the intent
11
+ // preimage (`meaningRefs`), so a third party reading the receipt sees which meaning it used.
12
+ // 3. A DISPUTE PATH — the `dispute/1.0.0` interaction profile (`@agenticprimitives/fabric`), a determination by a
13
+ // named steward that the provenance links (`apexec:disputedBy`) and that reverses nothing.
14
+ // 4. WHO STEWARDS WHAT — `StewardRecordV1`, public by construction.
15
+ //
16
+ // None of this is authority. A steward grants nothing; an adopted version is what a verifier binds, not who may act.
17
+ const APGOV = 'https://agenticprimitives.dev/ns/governance#';
18
+ export const GOVERNANCE_TERMS = {
19
+ AdoptedVersion: `${APGOV}AdoptedVersion`, manifestDigest: `${APGOV}manifestDigest`, adoptedAt: `${APGOV}adoptedAt`, proposalRef: `${APGOV}proposalRef`,
20
+ LocalMeaning: `${APGOV}LocalMeaning`, ofTerm: `${APGOV}ofTerm`, heldBy: `${APGOV}heldBy`, mappingRelation: `${APGOV}mappingRelation`,
21
+ Steward: `${APGOV}Steward`, stewards: `${APGOV}stewards`, stewardAgent: `${APGOV}stewardAgent`, charterRef: `${APGOV}charterRef`,
22
+ };
23
+ /** The reference a grant carries for a local meaning it used: the organization and the term, resolvable to the record. */
24
+ export const meaningRef = (m) => `meaning:${m.organization.toLowerCase()}:${m.term}`;
25
+ export const LOCAL_MEANING_PREFIX = 'ontology.meaning:';
26
+ export const localMeaningRecordType = (term) => `${LOCAL_MEANING_PREFIX}${term}`;
27
+ // ─── The public record of who stewards what — as a TERM of the OntologyTermRegistry (spec 410 §10.2 item 4) ─────────
28
+ // The registry holds terms (curie, uri, label, datatype) under the estate's governance and is readable by anyone
29
+ // (`getTerm(id)`, no session). A steward record is registered THROUGH it: the curie names the subject, the uri IS the
30
+ // subject IRI, the datatype says this row is a steward record, and the label carries the steward's address, the date
31
+ // and the charter hash in one fixed form. Registered by a governance proposal (the registry's `governor` is the
32
+ // timelock, spec 410 §9); the term id is `keccak256(utf8(curie))`, the registry's own convention, computed by the
33
+ // caller that holds a hashing library — this module encodes and decodes, and depends on nothing.
34
+ export const STEWARD_TERM_DATATYPE = 'ap:steward';
35
+ export const STEWARD_TERM_PREFIX = 'apgov:steward:';
36
+ /** The curie a steward record is registered under: `apgov:steward:<subject>`; the subject as written (an IRI or a curie). */
37
+ export const stewardTermCurie = (subject) => `${STEWARD_TERM_PREFIX}${subject.trim()}`;
38
+ /** The registry row for a steward record: `registerTerm(keccak256(curie), curie, uri, label, datatype)`'s four strings. */
39
+ export function encodeStewardTerm(r) {
40
+ if (r.type !== 'ap.steward.v1')
41
+ throw new Error('not a steward record');
42
+ if (!/^0x[0-9a-fA-F]{40}$/.test(r.stewardAgent))
43
+ throw new Error('stewardAgent must be an address');
44
+ if (!/^\d{4}-\d{2}-\d{2}/.test(r.since))
45
+ throw new Error('since must be an ISO date');
46
+ if (r.charterRef !== undefined && !/^0x[0-9a-fA-F]{64}$/.test(r.charterRef))
47
+ throw new Error('charterRef must be a bytes32 hash');
48
+ return {
49
+ curie: stewardTermCurie(r.subject),
50
+ uri: r.subject.trim(),
51
+ label: `steward ${r.stewardAgent.toLowerCase()} since ${r.since}${r.charterRef ? ` charter ${r.charterRef.toLowerCase()}` : ''}`,
52
+ datatype: STEWARD_TERM_DATATYPE,
53
+ };
54
+ }
55
+ /** A registry row back into a steward record; null when the row is not one (any other datatype, a malformed label). */
56
+ export function decodeStewardTerm(term) {
57
+ if (term.datatype !== STEWARD_TERM_DATATYPE || !term.curie.startsWith(STEWARD_TERM_PREFIX))
58
+ return null;
59
+ const m = term.label.match(/^steward (0x[0-9a-f]{40}) since (\S+)(?: charter (0x[0-9a-f]{64}))?$/);
60
+ if (!m)
61
+ return null;
62
+ const subject = term.uri || term.curie.slice(STEWARD_TERM_PREFIX.length);
63
+ return { type: 'ap.steward.v1', subject, stewardAgent: m[1], since: m[2], ...(m[3] ? { charterRef: m[3] } : {}) };
64
+ }
65
+ export function validateLocalMeaning(v) {
66
+ const m = v;
67
+ const errors = [];
68
+ if (!m || typeof m !== 'object')
69
+ return { ok: false, errors: ['not an object'] };
70
+ if (m.type !== 'ap.local-meaning.v1')
71
+ errors.push('type must be ap.local-meaning.v1');
72
+ if (!/^0x[0-9a-fA-F]{40}$/.test(String(m.organization ?? '')))
73
+ errors.push('organization must be a Smart Agent address');
74
+ if (!/^https?:\/\/\S+#\S+$/.test(String(m.term ?? '')))
75
+ errors.push('term must be a full IRI of the common T-box');
76
+ if (!/^https?:\/\/\S+#\S+$/.test(String(m.localTerm ?? '')))
77
+ errors.push('localTerm must be a full IRI under the organization\'s own namespace');
78
+ if (m.term && m.localTerm && m.term === m.localTerm)
79
+ errors.push('a local meaning is not the common term itself');
80
+ if (!['narrowMatch', 'broadMatch', 'relatedMatch'].includes(String(m.relation)))
81
+ errors.push('relation must be narrowMatch | broadMatch | relatedMatch (never exactMatch, never a new class)');
82
+ if (typeof m.scopeNote !== 'string' || !m.scopeNote.trim())
83
+ errors.push('scopeNote must say what differs');
84
+ if (typeof m.since !== 'string' || !m.since)
85
+ errors.push('since is required');
86
+ return errors.length ? { ok: false, errors } : { ok: true, meaning: m };
87
+ }
88
+ //# sourceMappingURL=governance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"governance.js","sourceRoot":"","sources":["../src/governance.ts"],"names":[],"mappings":"AAAA,mHAAmH;AACnH,qEAAqE;AACrE,EAAE;AACF,iHAAiH;AACjH,oHAAoH;AACpH,kHAAkH;AAClH,qHAAqH;AACrH,mHAAmH;AACnH,sHAAsH;AACtH,qHAAqH;AACrH,kGAAkG;AAClG,oHAAoH;AACpH,gGAA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