@agenticprimitives/ontology 1.0.0-alpha.21 → 1.0.0-alpha.23

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 (74) hide show
  1. package/README.md +11 -0
  2. package/cbox/card-projection-shapes.shacl.ttl +216 -0
  3. package/cbox/controlled-vocabularies.ttl +172 -4
  4. package/cbox/naming-registry-shapes.shacl.ttl +272 -0
  5. package/cbox/org-team-shapes.shacl.ttl +184 -0
  6. package/cbox/registry-vocabulary.ttl +86 -0
  7. package/cbox/run-provenance-shapes.shacl.ttl +172 -0
  8. package/context.jsonld +7 -1
  9. package/dist/arg-types.d.ts +60 -0
  10. package/dist/arg-types.d.ts.map +1 -0
  11. package/dist/arg-types.js +143 -0
  12. package/dist/arg-types.js.map +1 -0
  13. package/dist/artifacts.d.ts +4 -2
  14. package/dist/artifacts.d.ts.map +1 -1
  15. package/dist/artifacts.js +22 -0
  16. package/dist/artifacts.js.map +1 -1
  17. package/dist/contact-fields.d.ts +28 -0
  18. package/dist/contact-fields.d.ts.map +1 -0
  19. package/dist/contact-fields.js +38 -0
  20. package/dist/contact-fields.js.map +1 -0
  21. package/dist/decisions.d.ts +69 -0
  22. package/dist/decisions.d.ts.map +1 -0
  23. package/dist/decisions.js +98 -0
  24. package/dist/decisions.js.map +1 -0
  25. package/dist/household.d.ts +19 -0
  26. package/dist/household.d.ts.map +1 -0
  27. package/dist/household.js +41 -0
  28. package/dist/household.js.map +1 -0
  29. package/dist/index.d.ts +230 -0
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +275 -1
  32. package/dist/index.js.map +1 -1
  33. package/dist/party-roles.d.ts +106 -0
  34. package/dist/party-roles.d.ts.map +1 -0
  35. package/dist/party-roles.js +305 -0
  36. package/dist/party-roles.js.map +1 -0
  37. package/dist/plan-shapes.d.ts +18 -0
  38. package/dist/plan-shapes.d.ts.map +1 -0
  39. package/dist/plan-shapes.js +38 -0
  40. package/dist/plan-shapes.js.map +1 -0
  41. package/dist/relations.d.ts +44 -0
  42. package/dist/relations.d.ts.map +1 -0
  43. package/dist/relations.js +104 -0
  44. package/dist/relations.js.map +1 -0
  45. package/dist/run-provenance-context.d.ts +211 -0
  46. package/dist/run-provenance-context.d.ts.map +1 -0
  47. package/dist/run-provenance-context.js +219 -0
  48. package/dist/run-provenance-context.js.map +1 -0
  49. package/dist/vault-records.d.ts +74 -0
  50. package/dist/vault-records.d.ts.map +1 -0
  51. package/dist/vault-records.js +330 -0
  52. package/dist/vault-records.js.map +1 -0
  53. package/mappings/agent-discovery-standards.ttl +24 -3
  54. package/mappings/collaboration-crosswalk-organization.ttl +22 -0
  55. package/mappings/collaboration-crosswalk-skills.ttl +5 -0
  56. package/package.json +4 -2
  57. package/run-provenance.jsonld +106 -0
  58. package/tbox/actor-context.ttl +11 -0
  59. package/tbox/agent-resolution.ttl +6 -6
  60. package/tbox/card-projection.ttl +350 -0
  61. package/tbox/contact.ttl +61 -0
  62. package/tbox/context.ttl +114 -0
  63. package/tbox/coordination.ttl +17 -0
  64. package/tbox/core.ttl +232 -12
  65. package/tbox/execution.ttl +168 -0
  66. package/tbox/household.ttl +142 -0
  67. package/tbox/interaction.ttl +13 -0
  68. package/tbox/naming.ttl +114 -0
  69. package/tbox/org.ttl +188 -4
  70. package/tbox/profile.ttl +7 -0
  71. package/tbox/prov-imports.ttl +65 -0
  72. package/tbox/registry.ttl +159 -4
  73. package/tbox/skills.ttl +62 -0
  74. package/tbox/values.ttl +81 -0
@@ -0,0 +1,106 @@
1
+ /** An ontology class an agent must be an instance of, by IRI. */
2
+ export type ClassIri = string;
3
+ /** The T-box classes a party role may require. Names mirror `tbox/core.ttl` exactly. */
4
+ export declare const AGENT_CLASS: {
5
+ readonly Agent: string;
6
+ readonly PersonAgent: string;
7
+ readonly OrganizationAgent: string;
8
+ readonly TeamAgent: string;
9
+ readonly WorkspaceAgent: string;
10
+ readonly ServiceAgent: string;
11
+ readonly Treasury: string;
12
+ readonly RegistryAgent: string;
13
+ readonly ChurchAgent: string;
14
+ readonly CircleAgent: string;
15
+ /** Spec 368 — the family's own agent: an organization-class agent chartered under a person. */
16
+ readonly HouseholdAgent: string;
17
+ };
18
+ /** The relationship a resolver may traverse to get from one agent to another. */
19
+ /**
20
+ * THE VALUE RAIL — the classes that can be an end of a value move (spec 373).
21
+ *
22
+ * Money moves between ACCOUNTS. A person is who it is for; a treasury is where it goes; an organization
23
+ * pays from and is paid into the treasury it charters. This is the whole rule, said once, and
24
+ * `check:ontology-bindings` holds every `movesValue: true` role to it — so widening one back is a build
25
+ * failure rather than a payment that lands on somebody's person agent.
26
+ *
27
+ * It is a DECLARATION, and a declaration authorizes nothing. The gate that cannot be bypassed reads the
28
+ * payee's on-chain `atl:agentType` at the moment of acting (ADR-0061: the record is the authority, the
29
+ * typed name is a claim) and refuses when it is not a treasury.
30
+ */
31
+ export declare const VALUE_HOLDING_CLASSES: readonly ClassIri[];
32
+ /** May this class hold value — that is, be an end of a transfer? */
33
+ export declare const holdsValue: (iri: string) => boolean;
34
+ export declare const AGENT_RELATION: {
35
+ /** Child → the agent it was created under and belongs to. NEVER authority. */
36
+ readonly charteredUnder: string;
37
+ /** Parent → the agents created under it. The direction "what does alice hold" traverses. */
38
+ readonly charters: string;
39
+ };
40
+ /**
41
+ * The typed name suffix that names each class (ADR-0061). A suffix is a CLAIM about the derived type; the
42
+ * on-chain `ap:agentType` record is the authority and a mismatch fails closed. This map exists so a
43
+ * resolver can read a name's suffix as a class rather than as a magic string.
44
+ */
45
+ export declare const CLASS_FOR_SUFFIX: Readonly<Record<string, ClassIri>>;
46
+ export declare const SUFFIX_FOR_CLASS: Readonly<Record<ClassIri, string>>;
47
+ /** The typed-name suffixes the rail admits (`treasury`), derived from the classes so the two cannot drift. */
48
+ export declare const VALUE_HOLDING_SUFFIXES: readonly string[];
49
+ /** Which side of the exchange a party is. */
50
+ export type PartySide =
51
+ /** The agent whose authority the step spends. Defaults to the asker; never the counterparty. */
52
+ 'acting'
53
+ /** The agent the step acts toward. Never the asker by default — "pay me" is not what "pay alice" means. */
54
+ | 'counterparty'
55
+ /** The agent the step acts WITHIN — a parent an agent is chartered under. */
56
+ | 'context';
57
+ export interface PartyRoleV1 {
58
+ /** The capability this role belongs to (`ap:capability` id, e.g. `treasury.payment.execute`). */
59
+ capability: string;
60
+ /** The argument that carries it. */
61
+ arg: string;
62
+ /** What it is called when a person is asked about it. */
63
+ word: string;
64
+ side: PartySide;
65
+ /**
66
+ * The classes this party may be, in the order a person means them. A resolver takes the first class
67
+ * anything answers to. ORDER IS SEMANTICS, not ranking: "an organization pays from its own balance"
68
+ * is why `OrganizationAgent` follows `Treasury` for a payer, and it is not a fallback.
69
+ */
70
+ requires: readonly ClassIri[];
71
+ /**
72
+ * The relationship to follow when the agent that WAS resolved is not one of `requires` — from the
73
+ * person you named to the thing of theirs the capability needs. Omitted ⇒ no traversal: the answer is
74
+ * the agent itself or a question.
75
+ */
76
+ traverse?: (typeof AGENT_RELATION)[keyof typeof AGENT_RELATION];
77
+ /**
78
+ * True when getting this party wrong cannot be undone. Such a party is never SUBSTITUTED silently: if
79
+ * nothing of the first required class answers, the person is asked, with what was found.
80
+ */
81
+ movesValue?: boolean;
82
+ /**
83
+ * A party that may be named by a CONTACT FACET rather than an agent — today, an email address. The
84
+ * person behind it has no agent yet; the resolver binds the agent their Home WILL deploy for that
85
+ * email (a counterfactual address, deterministic from the custodian derivation), and the act carries
86
+ * the address so the invitation can reach them. Declared per role: an email is a way to reach a
87
+ * person, so it names a PersonAgent party and nothing else.
88
+ */
89
+ alsoAccepts?: readonly ('email')[];
90
+ }
91
+ /**
92
+ * Every capability's parties. The Ask reads this to resolve names; the harness reads `side: 'acting'` to
93
+ * know whose authority a step spends.
94
+ */
95
+ export declare const PARTY_ROLES: readonly PartyRoleV1[];
96
+ /** The role for one capability argument, or undefined when the capability declares none. */
97
+ export declare function partyRole(capability: string, arg: string): PartyRoleV1 | undefined;
98
+ /** The typed-name suffixes a party may be, in order — what a name-based resolver filters on. */
99
+ export declare function suffixesFor(role: PartyRoleV1 | undefined): readonly string[];
100
+ /** Every argument whose party is the one acting — the authority a step spends. */
101
+ export declare const ACTING_ARGS: ReadonlySet<string>;
102
+ /** Arguments that are never the asker: you do not pay, message or invite yourself by saying someone's name. */
103
+ export declare const COUNTERPARTY_ARGS: ReadonlySet<string>;
104
+ /** Arguments where a wrong answer cannot be undone. */
105
+ export declare const VALUE_ARGS: ReadonlySet<string>;
106
+ //# sourceMappingURL=party-roles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"party-roles.d.ts","sourceRoot":"","sources":["../src/party-roles.ts"],"names":[],"mappings":"AAuBA,iEAAiE;AACjE,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAQ9B,wFAAwF;AACxF,eAAO,MAAM,WAAW;;;;;;;;;;;IAWtB,+FAA+F;;CAEvF,CAAC;AAEX,iFAAiF;AACjF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qBAAqB,EAAE,SAAS,QAAQ,EAA2B,CAAC;AAEjF,oEAAoE;AACpE,eAAO,MAAM,UAAU,QAAS,MAAM,KAAG,OAAqE,CAAC;AAG/G,eAAO,MAAM,cAAc;IACzB,8EAA8E;;IAE9E,4FAA4F;;CAEpF,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAW/D,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAE/D,CAAC;AAEF,8GAA8G;AAC9G,eAAO,MAAM,sBAAsB,EAAE,SAAS,MAAM,EAEA,CAAC;AAErD,6CAA6C;AAC7C,MAAM,MAAM,SAAS;AACnB,gGAAgG;AAC9F,QAAQ;AACV,2GAA2G;GACzG,cAAc;AAChB,6EAA6E;GAC3E,SAAS,CAAC;AAEd,MAAM,WAAW,WAAW;IAC1B,iGAAiG;IACjG,UAAU,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,yDAAyD;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;IAChB;;;;OAIG;IACH,QAAQ,EAAE,SAAS,QAAQ,EAAE,CAAC;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;IAChE;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;CACpC;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,SAAS,WAAW,EAuN7C,CAAC;AAEF,4FAA4F;AAC5F,wBAAgB,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAElF;AAED,gGAAgG;AAChG,wBAAgB,WAAW,CAAC,IAAI,EAAE,WAAW,GAAG,SAAS,GAAG,SAAS,MAAM,EAAE,CAM5E;AAED,kFAAkF;AAClF,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,MAAM,CAA6E,CAAC;AAC1H,+GAA+G;AAC/G,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAAmF,CAAC;AACtI,uDAAuD;AACvD,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC,MAAM,CAAsE,CAAC"}
@@ -0,0 +1,305 @@
1
+ // Namespace base INLINED, not imported from ./index — index.ts re-exports this file, so importing NS back
2
+ // reads it in TDZ and every IRI here becomes `undefined#Treasury` at module-eval. Identical to `NS.ap`,
3
+ // and identical to the reason `grounded-vocabulary.ts` inlines the same constant.
4
+ const AP_NS = 'https://agenticprimitives.dev/ns/core#';
5
+ const AP = (local) => `${AP_NS}${local}`;
6
+ /** The T-box classes a party role may require. Names mirror `tbox/core.ttl` exactly. */
7
+ export const AGENT_CLASS = {
8
+ Agent: AP('Agent'),
9
+ PersonAgent: AP('PersonAgent'),
10
+ OrganizationAgent: AP('OrganizationAgent'),
11
+ TeamAgent: AP('TeamAgent'),
12
+ WorkspaceAgent: AP('WorkspaceAgent'),
13
+ ServiceAgent: AP('ServiceAgent'),
14
+ Treasury: AP('Treasury'),
15
+ RegistryAgent: AP('RegistryAgent'),
16
+ ChurchAgent: AP('ChurchAgent'),
17
+ CircleAgent: AP('CircleAgent'),
18
+ /** Spec 368 — the family's own agent: an organization-class agent chartered under a person. */
19
+ HouseholdAgent: AP('HouseholdAgent'),
20
+ };
21
+ /** The relationship a resolver may traverse to get from one agent to another. */
22
+ /**
23
+ * THE VALUE RAIL — the classes that can be an end of a value move (spec 373).
24
+ *
25
+ * Money moves between ACCOUNTS. A person is who it is for; a treasury is where it goes; an organization
26
+ * pays from and is paid into the treasury it charters. This is the whole rule, said once, and
27
+ * `check:ontology-bindings` holds every `movesValue: true` role to it — so widening one back is a build
28
+ * failure rather than a payment that lands on somebody's person agent.
29
+ *
30
+ * It is a DECLARATION, and a declaration authorizes nothing. The gate that cannot be bypassed reads the
31
+ * payee's on-chain `atl:agentType` at the moment of acting (ADR-0061: the record is the authority, the
32
+ * typed name is a claim) and refuses when it is not a treasury.
33
+ */
34
+ export const VALUE_HOLDING_CLASSES = [AGENT_CLASS.Treasury];
35
+ /** May this class hold value — that is, be an end of a transfer? */
36
+ export const holdsValue = (iri) => VALUE_HOLDING_CLASSES.includes(iri);
37
+ export const AGENT_RELATION = {
38
+ /** Child → the agent it was created under and belongs to. NEVER authority. */
39
+ charteredUnder: AP('charteredUnder'),
40
+ /** Parent → the agents created under it. The direction "what does alice hold" traverses. */
41
+ charters: AP('charters'),
42
+ };
43
+ /**
44
+ * The typed name suffix that names each class (ADR-0061). A suffix is a CLAIM about the derived type; the
45
+ * on-chain `ap:agentType` record is the authority and a mismatch fails closed. This map exists so a
46
+ * resolver can read a name's suffix as a class rather than as a magic string.
47
+ */
48
+ export const CLASS_FOR_SUFFIX = {
49
+ me: AGENT_CLASS.PersonAgent,
50
+ org: AGENT_CLASS.OrganizationAgent,
51
+ team: AGENT_CLASS.TeamAgent,
52
+ workspace: AGENT_CLASS.WorkspaceAgent,
53
+ treasury: AGENT_CLASS.Treasury,
54
+ svc: AGENT_CLASS.ServiceAgent,
55
+ registry: AGENT_CLASS.RegistryAgent,
56
+ church: AGENT_CLASS.ChurchAgent,
57
+ circle: AGENT_CLASS.CircleAgent,
58
+ household: AGENT_CLASS.HouseholdAgent,
59
+ };
60
+ export const SUFFIX_FOR_CLASS = Object.fromEntries(Object.entries(CLASS_FOR_SUFFIX).map(([suffix, iri]) => [iri, suffix]));
61
+ /** The typed-name suffixes the rail admits (`treasury`), derived from the classes so the two cannot drift. */
62
+ export const VALUE_HOLDING_SUFFIXES = VALUE_HOLDING_CLASSES
63
+ .map((c) => SUFFIX_FOR_CLASS[c])
64
+ .filter((s) => typeof s === 'string');
65
+ /**
66
+ * Every capability's parties. The Ask reads this to resolve names; the harness reads `side: 'acting'` to
67
+ * know whose authority a step spends.
68
+ */
69
+ export const PARTY_ROLES = [
70
+ {
71
+ capability: 'treasury.payment.execute', arg: 'payer', word: 'paying from', side: 'acting',
72
+ // THE VALUE RAIL (spec 373): an account pays. An organization is no exception — it pays from the
73
+ // treasury it charters, which `traverse` finds, and that is one hop, not a different kind of payer.
74
+ requires: VALUE_HOLDING_CLASSES,
75
+ traverse: AGENT_RELATION.charters,
76
+ movesValue: true,
77
+ },
78
+ {
79
+ capability: 'treasury.payment.execute', arg: 'payee', word: 'being paid', side: 'counterparty',
80
+ // AND AN ACCOUNT IS PAID. This read `[Treasury, OrganizationAgent, PersonAgent]` with the comment
81
+ // "paying a person directly is ordinary", and on 2026-09-08 it paid `carol.me` — a person, not an
82
+ // account — because the `aphh:householdPayee` chain landed on nothing and the resolver fell through to
83
+ // her. A person is who money is FOR; a treasury is where it GOES. "Send alice 20 USDC" means her
84
+ // treasury, and when she has marked none that is a question, never a payment to her.
85
+ requires: VALUE_HOLDING_CLASSES,
86
+ traverse: AGENT_RELATION.charters,
87
+ movesValue: true,
88
+ },
89
+ {
90
+ // CREDITED, NOT ACTING. The authority a funding spends is the FUNDER's (the next entry); the treasury
91
+ // is the account the act is about, inside the person's own tree. It read `acting` until
92
+ // `treasury.primary.declare` declared the same word `context` and the one-word-one-side gate made the
93
+ // disagreement visible — two honest local readings of one word is exactly the drift this table ends.
94
+ capability: 'treasury.fund', arg: 'treasury', word: 'the treasury', side: 'context',
95
+ requires: [AGENT_CLASS.Treasury],
96
+ traverse: AGENT_RELATION.charters,
97
+ movesValue: true,
98
+ },
99
+ {
100
+ // WHOSE AUTHORITY A FUNDING SPENDS. The tool declares `authorityArg: 'funder'`, and the word for it
101
+ // lived in a hand-kept map in the app — which is precisely the duplication this table exists to end.
102
+ // A faucet mint debits nobody, so this moves no value; it is still the party the mandate is read from.
103
+ capability: 'treasury.fund', arg: 'funder', word: 'funding it', side: 'acting',
104
+ requires: [AGENT_CLASS.Agent],
105
+ movesValue: false,
106
+ },
107
+ {
108
+ // "WHEN SOMEONE PAYS ME, IT GOES HERE" — the `ap:primaryPayee` role on the public charteredUnder
109
+ // edge (spec 355). The treasury is the party being MARKED, not one spending anything: declaring a
110
+ // preference moves no value and lets nobody spend. It must still be one of the owner's treasuries,
111
+ // which is what `requires` says and what a wrong answer is refused against.
112
+ // The treasury is the agent this statement is ABOUT and the one it is made WITHIN — your own tree,
113
+ // never someone else's. Not `counterparty`: a counterparty is somebody else, and "mark my treasury"
114
+ // is not an exchange with anyone.
115
+ capability: 'treasury.primary.declare', arg: 'treasury', word: 'to receive payments', side: 'context',
116
+ requires: [AGENT_CLASS.Treasury],
117
+ traverse: AGENT_RELATION.charters,
118
+ movesValue: false,
119
+ },
120
+ {
121
+ // WHOSE PREFERENCE IT IS. The holder is the object side of the edge, which is the only party the
122
+ // contract lets set a role on it — saying where your money should go is your say and nobody else's.
123
+ //
124
+ // NOT `owner`: that argument is already declared a COUNTERPARTY by `resolution.invitation.request`
125
+ // ("the person to ask"), and the derived sets are keyed by argument NAME across capabilities — so
126
+ // reusing it would have made this step's acting party one the resolver refuses to let be the asker.
127
+ // One word, one side, estate-wide; `check:ontology-bindings` now fails when that is broken.
128
+ capability: 'treasury.primary.declare', arg: 'holder', word: 'whose preference this is', side: 'acting',
129
+ requires: [AGENT_CLASS.Agent],
130
+ movesValue: false,
131
+ },
132
+ {
133
+ // WHO IS BEING RECORDED as living with you. Their own agent — a household member is a person, and a
134
+ // record naming an address nobody holds is a note to nobody.
135
+ capability: 'household.member.record', arg: 'member', word: 'in your household', side: 'context',
136
+ requires: [AGENT_CLASS.PersonAgent],
137
+ movesValue: false,
138
+ },
139
+ {
140
+ capability: 'messaging.direct.send', arg: 'sender', word: 'sending it', side: 'acting',
141
+ // Sending as you is acting as you. No traversal: a person's inbox is their own.
142
+ requires: [AGENT_CLASS.Agent],
143
+ },
144
+ {
145
+ capability: 'messaging.direct.send', arg: 'recipient', word: 'the person to message', side: 'counterparty',
146
+ // An inbox belongs to a person first. Someone who means the organization says so.
147
+ requires: [
148
+ AGENT_CLASS.PersonAgent, AGENT_CLASS.OrganizationAgent, AGENT_CLASS.TeamAgent,
149
+ AGENT_CLASS.CircleAgent, AGENT_CLASS.ChurchAgent, AGENT_CLASS.HouseholdAgent, AGENT_CLASS.ServiceAgent,
150
+ ],
151
+ },
152
+ {
153
+ // A STANDING INSTRUCTION IS THE OWNER'S OWN NOTE (spec 394): who declares it is the person asking — the
154
+ // record is theirs and nobody else's to write. Self-acting like the household record.
155
+ capability: 'context.instruction.declare', arg: 'holder', word: 'whose instruction this is', side: 'acting',
156
+ requires: [AGENT_CLASS.Agent],
157
+ movesValue: false,
158
+ },
159
+ {
160
+ // WHAT THE DEFAULT IS — an agent of theirs (a treasury to pay from, an organization to act as). Any agent:
161
+ // the role's kind is the CAPABILITY's to say, and the resolver revalidates at every use.
162
+ capability: 'context.instruction.declare', arg: 'value', word: 'the default', side: 'context',
163
+ requires: [AGENT_CLASS.Agent],
164
+ movesValue: false,
165
+ },
166
+ {
167
+ // A REQUEST IS THE REQUESTER'S OWN ACT (spec 393 W2 tail). Any agent may ask an organization to take on a
168
+ // goal; the organization is the CONTEXT (`org`, the resource) — "asking as you is an act of yours".
169
+ capability: 'coordination.endeavor.request', arg: 'requester', word: 'asking', side: 'acting',
170
+ requires: [AGENT_CLASS.Agent],
171
+ },
172
+ {
173
+ // AN OFFER IS THE OFFERER'S OWN ACT (spec 393 W2). Any agent may offer; the organization is the CONTEXT
174
+ // (`org`, the resource), never the party spending authority — a steward asked "I'll take the flyer step"
175
+ // at their organization offers as themselves, not as it.
176
+ capability: 'coordination.contribution.propose', arg: 'proposer', word: 'offering', side: 'acting',
177
+ requires: [AGENT_CLASS.Agent],
178
+ },
179
+ {
180
+ capability: 'resolution.invitation.request', arg: 'requester', word: 'asking', side: 'acting',
181
+ // Asking is an act of yours, bounded like any other. Any agent may ask.
182
+ requires: [AGENT_CLASS.Agent],
183
+ },
184
+ {
185
+ capability: 'resolution.invitation.request', arg: 'owner', word: 'the person to ask', side: 'counterparty',
186
+ // You ask the AGENT THAT HOLDS the thing you cannot reach — a person, or the organization whose
187
+ // treasury it is. Not the unlisted agent itself: if you could name that, you would not be asking.
188
+ requires: [AGENT_CLASS.PersonAgent, AGENT_CLASS.OrganizationAgent, AGENT_CLASS.TeamAgent],
189
+ },
190
+ {
191
+ capability: 'organization.membership.invite', arg: 'org', word: 'the organization', side: 'acting',
192
+ requires: [
193
+ AGENT_CLASS.OrganizationAgent, AGENT_CLASS.TeamAgent, AGENT_CLASS.WorkspaceAgent,
194
+ AGENT_CLASS.CircleAgent, AGENT_CLASS.ChurchAgent, AGENT_CLASS.HouseholdAgent,
195
+ ],
196
+ },
197
+ {
198
+ capability: 'organization.membership.invite', arg: 'invitee', word: 'being invited', side: 'counterparty',
199
+ // A member is ordinarily a person — and, spec 372 S3, may be a SERVICE agent: the identity an outside
200
+ // runtime acts as joins an organization the way anyone does, by invitation its steward signs, and what
201
+ // it may then do is the scoped grant that invitation carries. Order is semantics: inviting a person is
202
+ // the ordinary reading of a name, and a runtime is named by its typed `.svc` name.
203
+ requires: [AGENT_CLASS.PersonAgent, AGENT_CLASS.ServiceAgent],
204
+ // An invitation may go to someone with no agent yet: their email names the person, and the agent
205
+ // their Home will deploy for it is bound in its place (spec 315/321 email invite, now one flow).
206
+ alsoAccepts: ['email'],
207
+ },
208
+ {
209
+ // WHOSE ROSTER IS BEING READ. A read spends no authority, but it names a subject, and the subject is
210
+ // resolved like every other party: in the asker's PRIVATE tier ("Missio Nexus" is a name in their own
211
+ // links), or asked. Before this row the tool resolved its own argument — a naming-service lookup with
212
+ // the ADDRESSEE as the fallback — so a display name the naming service does not know silently became
213
+ // "the agent being asked", and a person asking about an organization was answered with their own
214
+ // (empty) roster. `acting`, not `context`: the arg NAME `org` is declared `acting` by the invite
215
+ // capability, and one word carries one side estate-wide (`check:ontology-bindings`).
216
+ capability: 'organization.membership.list', arg: 'org', word: 'the organization', side: 'acting',
217
+ requires: [
218
+ AGENT_CLASS.OrganizationAgent, AGENT_CLASS.TeamAgent, AGENT_CLASS.WorkspaceAgent,
219
+ AGENT_CLASS.CircleAgent, AGENT_CLASS.ChurchAgent, AGENT_CLASS.HouseholdAgent,
220
+ ],
221
+ },
222
+ {
223
+ // Spec 380 — WHOSE MEMBERS ARE CONSULTED. The organization is the acting side (its own roster, its own
224
+ // consult wire); resolved in the asker's private tier like the roster read above.
225
+ capability: 'organization.member.consult', arg: 'org', word: 'the organization', side: 'acting',
226
+ requires: [
227
+ AGENT_CLASS.OrganizationAgent, AGENT_CLASS.TeamAgent, AGENT_CLASS.WorkspaceAgent,
228
+ AGENT_CLASS.CircleAgent, AGENT_CLASS.ChurchAgent, AGENT_CLASS.HouseholdAgent,
229
+ ],
230
+ },
231
+ {
232
+ // Spec 380 — THE MEMBER ASKED. A person, answering through their own agent under their own opt-in;
233
+ // it arrives as an address from the roster's fan-out, never as a name to resolve.
234
+ capability: 'organization.member.consult', arg: 'respondent', word: 'the member being asked', side: 'counterparty',
235
+ requires: [AGENT_CLASS.PersonAgent],
236
+ },
237
+ // ── Spec 370 P4 — Work & Planning (specs 332–334) bound thinly onto the Endeavor substrate. ────────
238
+ // WHOSE WORK. Every coordination capability names the organization whose endeavors these are — the same
239
+ // word, the same side and the same classes as the roster read, so a display name resolves in the
240
+ // asker's private tier or is asked, never guessed from the addressee. The realm you stand in fills it
241
+ // (spec 367 §7) because these roles admit the organization classes.
242
+ ...['coordination.endeavor.list', 'coordination.endeavor.get', 'coordination.endeavor.request', 'coordination.contribution.propose', 'coordination.contribution.allocate', 'coordination.endeavor.satisfy'].map((capability) => ({
243
+ capability, arg: 'org', word: 'the organization', side: 'acting',
244
+ requires: [
245
+ AGENT_CLASS.OrganizationAgent, AGENT_CLASS.TeamAgent, AGENT_CLASS.WorkspaceAgent,
246
+ AGENT_CLASS.CircleAgent, AGENT_CLASS.ChurchAgent, AGENT_CLASS.HouseholdAgent,
247
+ ],
248
+ })),
249
+ {
250
+ // Spec 371 — WHOSE BALANCE. A treasury or an organization (an organization pays from its own balance —
251
+ // the same classes the payer role admits); unnamed ⇒ the asker's own treasuries, decided by the read.
252
+ capability: 'treasury.balance.read', arg: 'account', word: 'the account', side: 'acting',
253
+ requires: [AGENT_CLASS.Treasury, AGENT_CLASS.OrganizationAgent, AGENT_CLASS.TeamAgent, AGENT_CLASS.ChurchAgent, AGENT_CLASS.CircleAgent, AGENT_CLASS.HouseholdAgent],
254
+ },
255
+ {
256
+ // WHO IS ALLOCATED. A person — resolved among the asker's own links or the organization's roster.
257
+ capability: 'coordination.contribution.allocate', arg: 'participant', word: 'being allocated', side: 'counterparty',
258
+ requires: [AGENT_CLASS.PersonAgent],
259
+ },
260
+ {
261
+ // Spec 368 — a household is chartered under a PERSON, never inside an organization: it is the family's
262
+ // own agent, and the person who charters it is its first steward.
263
+ capability: 'household.create', arg: 'parent', word: 'the parent', side: 'context',
264
+ requires: [AGENT_CLASS.PersonAgent],
265
+ },
266
+ {
267
+ capability: 'organization.team.create', arg: 'parent', word: 'the parent', side: 'context',
268
+ requires: [AGENT_CLASS.WorkspaceAgent, AGENT_CLASS.OrganizationAgent],
269
+ },
270
+ {
271
+ capability: 'organization.create', arg: 'parent', word: 'the parent', side: 'context',
272
+ requires: [AGENT_CLASS.WorkspaceAgent, AGENT_CLASS.OrganizationAgent, AGENT_CLASS.PersonAgent],
273
+ },
274
+ {
275
+ capability: 'treasury.create', arg: 'parent', word: 'the parent', side: 'context',
276
+ requires: [AGENT_CLASS.PersonAgent, AGENT_CLASS.OrganizationAgent, AGENT_CLASS.TeamAgent, AGENT_CLASS.HouseholdAgent],
277
+ },
278
+ {
279
+ // Spec 372 S3 — a service agent (the identity an outside runtime acts as) belongs to the person or the
280
+ // organization that chartered it; a team or household charters none (their parent does).
281
+ capability: 'service.create', arg: 'parent', word: 'the parent', side: 'context',
282
+ requires: [AGENT_CLASS.PersonAgent, AGENT_CLASS.OrganizationAgent],
283
+ },
284
+ ];
285
+ /** The role for one capability argument, or undefined when the capability declares none. */
286
+ export function partyRole(capability, arg) {
287
+ return PARTY_ROLES.find((r) => r.capability === capability && r.arg === arg);
288
+ }
289
+ /** The typed-name suffixes a party may be, in order — what a name-based resolver filters on. */
290
+ export function suffixesFor(role) {
291
+ if (!role)
292
+ return [];
293
+ // `ap:Agent` means "any agent", which narrows nothing — an empty list, not every suffix, because a
294
+ // resolver reads empty as "no constraint" and a full list as "these nine and no others".
295
+ if (role.requires.includes(AGENT_CLASS.Agent))
296
+ return [];
297
+ return role.requires.map((iri) => SUFFIX_FOR_CLASS[iri]).filter((s) => !!s);
298
+ }
299
+ /** Every argument whose party is the one acting — the authority a step spends. */
300
+ export const ACTING_ARGS = new Set(PARTY_ROLES.filter((r) => r.side === 'acting').map((r) => r.arg));
301
+ /** Arguments that are never the asker: you do not pay, message or invite yourself by saying someone's name. */
302
+ export const COUNTERPARTY_ARGS = new Set(PARTY_ROLES.filter((r) => r.side === 'counterparty').map((r) => r.arg));
303
+ /** Arguments where a wrong answer cannot be undone. */
304
+ export const VALUE_ARGS = new Set(PARTY_ROLES.filter((r) => r.movesValue).map((r) => r.arg));
305
+ //# sourceMappingURL=party-roles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"party-roles.js","sourceRoot":"","sources":["../src/party-roles.ts"],"names":[],"mappings":"AA0BA,0GAA0G;AAC1G,wGAAwG;AACxG,kFAAkF;AAClF,MAAM,KAAK,GAAG,wCAAwC,CAAC;AACvD,MAAM,EAAE,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,GAAG,KAAK,GAAG,KAAK,EAAE,CAAC;AAEzD,wFAAwF;AACxF,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC;IAClB,WAAW,EAAE,EAAE,CAAC,aAAa,CAAC;IAC9B,iBAAiB,EAAE,EAAE,CAAC,mBAAmB,CAAC;IAC1C,SAAS,EAAE,EAAE,CAAC,WAAW,CAAC;IAC1B,cAAc,EAAE,EAAE,CAAC,gBAAgB,CAAC;IACpC,YAAY,EAAE,EAAE,CAAC,cAAc,CAAC;IAChC,QAAQ,EAAE,EAAE,CAAC,UAAU,CAAC;IACxB,aAAa,EAAE,EAAE,CAAC,eAAe,CAAC;IAClC,WAAW,EAAE,EAAE,CAAC,aAAa,CAAC;IAC9B,WAAW,EAAE,EAAE,CAAC,aAAa,CAAC;IAC9B,+FAA+F;IAC/F,cAAc,EAAE,EAAE,CAAC,gBAAgB,CAAC;CAC5B,CAAC;AAEX,iFAAiF;AACjF;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAwB,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;AAEjF,oEAAoE;AACpE,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,GAAW,EAAW,EAAE,CAAE,qBAA2C,CAAC,QAAQ,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,CAAC,WAAW,CAAC,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACzD,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3F,CAAC;AAED,kFAAkF;AAClF,MAAM,CAAC,MAAM,WAAW,GAAwB,IAAI,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAC1H,+GAA+G;AAC/G,MAAM,CAAC,MAAM,iBAAiB,GAAwB,IAAI,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,cAAc,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AACtI,uDAAuD;AACvD,MAAM,CAAC,MAAM,UAAU,GAAwB,IAAI,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC"}
@@ -0,0 +1,18 @@
1
+ export interface FanOutRelation {
2
+ /** The relation whose object set may be enumerated — an ObjectProperty the T-box declares. */
3
+ relation: string;
4
+ /** Why this one is safe to fan out over, in a sentence a refusal can quote. */
5
+ because: string;
6
+ /** The most items one sentence may become. A cap is part of the meaning: "every member" of a
7
+ * 25-person org is a plan; of a 10,000-row search result it is an incident. */
8
+ maxItems: number;
9
+ }
10
+ /** Relations a plan step may fan out over. Everything else is refused BY NAME — absence is a decision
11
+ * here, not an oversight, because an unlisted relation fails closed in the loop. */
12
+ export declare const FAN_OUT_RELATIONS: readonly FanOutRelation[];
13
+ /** Relations that resolve to ONE object by their meaning. A plan that fans out over one of these has
14
+ * misread the domain — `primaryPayee` is "the one they want paid", and iterating it is a bug. */
15
+ export declare const RESOLVE_TO_ONE_RELATIONS: readonly string[];
16
+ /** The binding for a relation, or null — and null must FAIL CLOSED in the consumer. */
17
+ export declare function fanOutBindingFor(relation: string): FanOutRelation | null;
18
+ //# sourceMappingURL=plan-shapes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan-shapes.d.ts","sourceRoot":"","sources":["../src/plan-shapes.ts"],"names":[],"mappings":"AAkBA,MAAM,WAAW,cAAc;IAC7B,8FAA8F;IAC9F,QAAQ,EAAE,MAAM,CAAC;IACjB,+EAA+E;IAC/E,OAAO,EAAE,MAAM,CAAC;IAChB;oFACgF;IAChF,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;qFACqF;AACrF,eAAO,MAAM,iBAAiB,EAAE,SAAS,cAAc,EAWtD,CAAC;AAEF;kGACkG;AAClG,eAAO,MAAM,wBAAwB,EAAE,SAAS,MAAM,EAA0B,CAAC;AAEjF,uFAAuF;AACvF,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAExE"}
@@ -0,0 +1,38 @@
1
+ // WHAT A PLAN MAY FAN OUT OVER — spec 358 W4, in spec 355's discipline: the shape of the domain lives
2
+ // here, bound by IRI, and the code that composes plans binds to it rather than knowing it.
3
+ //
4
+ // "Pay every member of the team 5 USDC" is one sentence and N acts. Whether the N is even ENUMERABLE is
5
+ // a fact about the relation, not about the planner: a membership names a bounded, owner-recorded set an
6
+ // organization can answer for; a public search result is an unbounded list of strangers and is not a
7
+ // payee list, however array-shaped it arrives. Before this binding existed the difference lived nowhere,
8
+ // and a planner that improvised a fan-out had nothing to refuse it.
9
+ //
10
+ // THE INVARIANT THIS SERVES (spec 351 §2.4.7): each fanned-out item re-enters the verifier as its own
11
+ // step — a mandate per payment, judged alone. The binding never grants: it says which relations a plan
12
+ // may ENUMERATE, and caps how many items one sentence may become. What each item may DO stays with the
13
+ // mandate, exactly as if the person had asked N times.
14
+ // Namespaces inlined for the same TDZ reason as every sibling binding in this package.
15
+ const APORG = 'https://agenticprimitives.dev/ns/org#';
16
+ const AP = 'https://agenticprimitives.dev/ns/core#';
17
+ /** Relations a plan step may fan out over. Everything else is refused BY NAME — absence is a decision
18
+ * here, not an oversight, because an unlisted relation fails closed in the loop. */
19
+ export const FAN_OUT_RELATIONS = [
20
+ {
21
+ relation: `${APORG}memberAgent`,
22
+ because: 'a membership names a bounded, owner-recorded set the organization itself can answer for',
23
+ maxItems: 25,
24
+ },
25
+ {
26
+ relation: `${AP}charters`,
27
+ because: "the agents chartered under an owner are that owner's own bounded estate, recorded at genesis",
28
+ maxItems: 12,
29
+ },
30
+ ];
31
+ /** Relations that resolve to ONE object by their meaning. A plan that fans out over one of these has
32
+ * misread the domain — `primaryPayee` is "the one they want paid", and iterating it is a bug. */
33
+ export const RESOLVE_TO_ONE_RELATIONS = [`${AP}primaryPayee`];
34
+ /** The binding for a relation, or null — and null must FAIL CLOSED in the consumer. */
35
+ export function fanOutBindingFor(relation) {
36
+ return FAN_OUT_RELATIONS.find((r) => r.relation === relation) ?? null;
37
+ }
38
+ //# sourceMappingURL=plan-shapes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan-shapes.js","sourceRoot":"","sources":["../src/plan-shapes.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,2FAA2F;AAC3F,EAAE;AACF,wGAAwG;AACxG,wGAAwG;AACxG,qGAAqG;AACrG,yGAAyG;AACzG,oEAAoE;AACpE,EAAE;AACF,sGAAsG;AACtG,uGAAuG;AACvG,uGAAuG;AACvG,uDAAuD;AAEvD,uFAAuF;AACvF,MAAM,KAAK,GAAG,uCAAuC,CAAC;AACtD,MAAM,EAAE,GAAG,wCAAwC,CAAC;AAYpD;qFACqF;AACrF,MAAM,CAAC,MAAM,iBAAiB,GAA8B;IAC1D;QACE,QAAQ,EAAE,GAAG,KAAK,aAAa;QAC/B,OAAO,EAAE,yFAAyF;QAClG,QAAQ,EAAE,EAAE;KACb;IACD;QACE,QAAQ,EAAE,GAAG,EAAE,UAAU;QACzB,OAAO,EAAE,8FAA8F;QACvG,QAAQ,EAAE,EAAE;KACb;CACF,CAAC;AAEF;kGACkG;AAClG,MAAM,CAAC,MAAM,wBAAwB,GAAsB,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;AAEjF,uFAAuF;AACvF,MAAM,UAAU,gBAAgB,CAAC,QAAgB;IAC/C,OAAO,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,IAAI,IAAI,CAAC;AACxE,CAAC"}
@@ -0,0 +1,44 @@
1
+ export type RelationIri = string;
2
+ export interface RelationAxiomV1 {
3
+ /** The relation, by IRI — the T-box must declare it as a property. */
4
+ iri: RelationIri;
5
+ /** Its inverse, when it has one. Declared `owl:inverseOf` in the T-box; both directions appear here
6
+ * because a resolver walks whichever way the question is asked. */
7
+ inverseOf?: RelationIri;
8
+ /**
9
+ * The links this relation IS, in order, when it is a composition (`owl:propertyChainAxiom`).
10
+ *
11
+ * A chain is walked by following each link in turn. It is not a query language and will not become
12
+ * one: two links is what the domain has needed, the walker refuses a longer one than the axiom
13
+ * declares, and a relation that needs branching is a capability, not a cleverer chain.
14
+ */
15
+ chain?: readonly RelationIri[];
16
+ /** What the relation means in one line — for a person reading a trace, not for a reasoner. */
17
+ says: string;
18
+ }
19
+ /**
20
+ * Every relation a resolver may traverse.
21
+ *
22
+ * ONLY WHAT IS ACTUALLY WALKED. This is not a mirror of the ontology's properties — most of them are
23
+ * facts nobody follows at request time. A relation earns a row here when some capability's resolution
24
+ * depends on following it, which is also what makes the gate's demand reasonable.
25
+ */
26
+ export declare const RELATION_AXIOMS: readonly RelationAxiomV1[];
27
+ export declare function relationAxiom(iri: RelationIri): RelationAxiomV1 | undefined;
28
+ /** The inverse of a relation, or undefined — undefined means "one direction only", not "unknown". */
29
+ export declare function inverseOf(iri: RelationIri): RelationIri | undefined;
30
+ /** The links a composed relation is, or null when it is primitive (which is most of them). */
31
+ export declare function chainOf(iri: RelationIri): readonly RelationIri[] | null;
32
+ /**
33
+ * Walk a declared chain from a subject, using a caller-supplied reader for each link.
34
+ *
35
+ * THE CALLER READS, THIS COMPOSES — the same split the decision plane uses. Only the caller knows where
36
+ * a link lives (a chain role, a vault record, a contract edge); only the axiom knows which links a
37
+ * relation is and in what order, and keeping that here is what stops a second capability writing its own
38
+ * two-step by hand.
39
+ *
40
+ * FAIL-CLOSED: a relation with no declared chain returns nothing rather than falling back to "just follow
41
+ * something" — an undeclared traversal is exactly the guess this table exists to remove.
42
+ */
43
+ export declare function walkChain(iri: RelationIri, subject: string, follow: (link: RelationIri, from: string) => Promise<readonly string[]>): Promise<string[]>;
44
+ //# sourceMappingURL=relations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relations.d.ts","sourceRoot":"","sources":["../src/relations.ts"],"names":[],"mappings":"AAyBA,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AAEjC,MAAM,WAAW,eAAe;IAC9B,sEAAsE;IACtE,GAAG,EAAE,WAAW,CAAC;IACjB;wEACoE;IACpE,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;IAC/B,8FAA8F;IAC9F,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,eAAe,EAoCrD,CAAC;AAEF,wBAAgB,aAAa,CAAC,GAAG,EAAE,WAAW,GAAG,eAAe,GAAG,SAAS,CAE3E;AAED,qGAAqG;AACrG,wBAAgB,SAAS,CAAC,GAAG,EAAE,WAAW,GAAG,WAAW,GAAG,SAAS,CAEnE;AAED,8FAA8F;AAC9F,wBAAgB,OAAO,CAAC,GAAG,EAAE,WAAW,GAAG,SAAS,WAAW,EAAE,GAAG,IAAI,CAGvE;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,SAAS,CAC7B,GAAG,EAAE,WAAW,EAChB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,GACtE,OAAO,CAAC,MAAM,EAAE,CAAC,CAUnB"}