@cellarnode/ui 0.201.1 → 0.203.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.
- package/dist/agent/composer.d.ts +6 -1
- package/dist/agent/composer.d.ts.map +1 -1
- package/dist/agent/composer.js +43 -9
- package/dist/agent/composer.js.map +1 -1
- package/dist/agent/conversation.d.ts +20 -2
- package/dist/agent/conversation.d.ts.map +1 -1
- package/dist/agent/conversation.js +39 -5
- package/dist/agent/conversation.js.map +1 -1
- package/dist/agent/copy.d.ts +7 -0
- package/dist/agent/copy.d.ts.map +1 -1
- package/dist/agent/copy.js +9 -0
- package/dist/agent/copy.js.map +1 -1
- package/dist/agent/fixtures.d.ts +34 -0
- package/dist/agent/fixtures.d.ts.map +1 -1
- package/dist/agent/fixtures.js +83 -0
- package/dist/agent/fixtures.js.map +1 -1
- package/dist/agent/index.d.ts +18 -1
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +18 -1
- package/dist/agent/index.js.map +1 -1
- package/dist/agent/markdown.d.ts +64 -0
- package/dist/agent/markdown.d.ts.map +1 -0
- package/dist/agent/markdown.js +338 -0
- package/dist/agent/markdown.js.map +1 -0
- package/dist/agent/masked-value.d.ts +1 -0
- package/dist/agent/masked-value.d.ts.map +1 -1
- package/dist/agent/masked-value.js +4 -1
- package/dist/agent/masked-value.js.map +1 -1
- package/dist/agent/message.d.ts +26 -6
- package/dist/agent/message.d.ts.map +1 -1
- package/dist/agent/message.js +47 -11
- package/dist/agent/message.js.map +1 -1
- package/dist/agent/panel-frame.js +1 -1
- package/dist/agent/panel-frame.js.map +1 -1
- package/dist/agent/role-cards/card-kit.d.ts +111 -0
- package/dist/agent/role-cards/card-kit.d.ts.map +1 -0
- package/dist/agent/role-cards/card-kit.js +68 -0
- package/dist/agent/role-cards/card-kit.js.map +1 -0
- package/dist/agent/role-cards/data-table-card.d.ts +80 -0
- package/dist/agent/role-cards/data-table-card.d.ts.map +1 -0
- package/dist/agent/role-cards/data-table-card.js +214 -0
- package/dist/agent/role-cards/data-table-card.js.map +1 -0
- package/dist/agent/role-cards/fixtures.d.ts +124 -0
- package/dist/agent/role-cards/fixtures.d.ts.map +1 -0
- package/dist/agent/role-cards/fixtures.js +401 -0
- package/dist/agent/role-cards/fixtures.js.map +1 -0
- package/dist/agent/role-cards/host-contract.d.ts +214 -0
- package/dist/agent/role-cards/host-contract.d.ts.map +1 -0
- package/dist/agent/role-cards/host-contract.js +348 -0
- package/dist/agent/role-cards/host-contract.js.map +1 -0
- package/dist/agent/role-cards/inspector-drawer.d.ts +42 -0
- package/dist/agent/role-cards/inspector-drawer.d.ts.map +1 -0
- package/dist/agent/role-cards/inspector-drawer.js +68 -0
- package/dist/agent/role-cards/inspector-drawer.js.map +1 -0
- package/dist/agent/role-cards/inspector-fixtures.d.ts +84 -0
- package/dist/agent/role-cards/inspector-fixtures.d.ts.map +1 -0
- package/dist/agent/role-cards/inspector-fixtures.js +162 -0
- package/dist/agent/role-cards/inspector-fixtures.js.map +1 -0
- package/dist/agent/role-cards/inspector-record.d.ts +109 -0
- package/dist/agent/role-cards/inspector-record.d.ts.map +1 -0
- package/dist/agent/role-cards/inspector-record.js +346 -0
- package/dist/agent/role-cards/inspector-record.js.map +1 -0
- package/dist/agent/role-cards/inspector-view.d.ts +137 -0
- package/dist/agent/role-cards/inspector-view.d.ts.map +1 -0
- package/dist/agent/role-cards/inspector-view.js +261 -0
- package/dist/agent/role-cards/inspector-view.js.map +1 -0
- package/dist/agent/role-cards/match-card.d.ts +21 -0
- package/dist/agent/role-cards/match-card.d.ts.map +1 -0
- package/dist/agent/role-cards/match-card.js +30 -0
- package/dist/agent/role-cards/match-card.js.map +1 -0
- package/dist/agent/role-cards/offer-card.d.ts +27 -0
- package/dist/agent/role-cards/offer-card.d.ts.map +1 -0
- package/dist/agent/role-cards/offer-card.js +68 -0
- package/dist/agent/role-cards/offer-card.js.map +1 -0
- package/dist/agent/role-cards/opportunity-card.d.ts +26 -0
- package/dist/agent/role-cards/opportunity-card.d.ts.map +1 -0
- package/dist/agent/role-cards/opportunity-card.js +50 -0
- package/dist/agent/role-cards/opportunity-card.js.map +1 -0
- package/dist/agent/role-cards/product-card.d.ts +32 -0
- package/dist/agent/role-cards/product-card.d.ts.map +1 -0
- package/dist/agent/role-cards/product-card.js +50 -0
- package/dist/agent/role-cards/product-card.js.map +1 -0
- package/dist/agent/role-cards/proposal-diff.d.ts +38 -0
- package/dist/agent/role-cards/proposal-diff.d.ts.map +1 -0
- package/dist/agent/role-cards/proposal-diff.js +74 -0
- package/dist/agent/role-cards/proposal-diff.js.map +1 -0
- package/dist/agent/role-cards/registry.d.ts +43 -0
- package/dist/agent/role-cards/registry.d.ts.map +1 -0
- package/dist/agent/role-cards/registry.js +46 -0
- package/dist/agent/role-cards/registry.js.map +1 -0
- package/dist/agent/role-cards/score-meter.d.ts +12 -0
- package/dist/agent/role-cards/score-meter.d.ts.map +1 -0
- package/dist/agent/role-cards/score-meter.js +17 -0
- package/dist/agent/role-cards/score-meter.js.map +1 -0
- package/dist/agent/role-cards/surface-links.d.ts +54 -0
- package/dist/agent/role-cards/surface-links.d.ts.map +1 -0
- package/dist/agent/role-cards/surface-links.js +149 -0
- package/dist/agent/role-cards/surface-links.js.map +1 -0
- package/dist/agent/role-cards/text-safety.d.ts +27 -0
- package/dist/agent/role-cards/text-safety.d.ts.map +1 -0
- package/dist/agent/role-cards/text-safety.js +77 -0
- package/dist/agent/role-cards/text-safety.js.map +1 -0
- package/dist/agent/schema.d.ts +10 -0
- package/dist/agent/schema.d.ts.map +1 -1
- package/dist/agent/schema.js +31 -3
- package/dist/agent/schema.js.map +1 -1
- package/dist/agent/states.d.ts +1 -0
- package/dist/agent/states.d.ts.map +1 -1
- package/dist/agent/states.js +1 -1
- package/dist/agent/states.js.map +1 -1
- package/dist/agent/thinking.d.ts +13 -4
- package/dist/agent/thinking.d.ts.map +1 -1
- package/dist/agent/thinking.js +15 -6
- package/dist/agent/thinking.js.map +1 -1
- package/dist/agent/thread-list.d.ts +45 -2
- package/dist/agent/thread-list.d.ts.map +1 -1
- package/dist/agent/thread-list.js +175 -8
- package/dist/agent/thread-list.js.map +1 -1
- package/dist/agent/thread-title.d.ts +46 -0
- package/dist/agent/thread-title.d.ts.map +1 -0
- package/dist/agent/thread-title.js +99 -0
- package/dist/agent/thread-title.js.map +1 -0
- package/dist/agent/tool-activity-model.d.ts +136 -0
- package/dist/agent/tool-activity-model.d.ts.map +1 -0
- package/dist/agent/tool-activity-model.js +288 -0
- package/dist/agent/tool-activity-model.js.map +1 -0
- package/dist/agent/tool-activity.d.ts +61 -0
- package/dist/agent/tool-activity.d.ts.map +1 -0
- package/dist/agent/tool-activity.js +199 -0
- package/dist/agent/tool-activity.js.map +1 -0
- package/dist/agent/tool-call-card.d.ts +11 -1
- package/dist/agent/tool-call-card.d.ts.map +1 -1
- package/dist/agent/tool-call-card.js +19 -4
- package/dist/agent/tool-call-card.js.map +1 -1
- package/dist/agent/ui.js +1 -1
- package/dist/agent/ui.js.map +1 -1
- package/dist/agent/use-motion.d.ts +15 -0
- package/dist/agent/use-motion.d.ts.map +1 -0
- package/dist/agent/use-motion.js +52 -0
- package/dist/agent/use-motion.js.map +1 -0
- package/dist/chat/use-stick-to-bottom.d.ts +5 -0
- package/dist/chat/use-stick-to-bottom.d.ts.map +1 -1
- package/dist/chat/use-stick-to-bottom.js +11 -1
- package/dist/chat/use-stick-to-bottom.js.map +1 -1
- package/dist/components/sheet.d.ts +3 -1
- package/dist/components/sheet.d.ts.map +1 -1
- package/dist/components/sheet.js +2 -2
- package/dist/components/sheet.js.map +1 -1
- package/dist/portfolio-import/import-job-panels.d.ts +6 -0
- package/dist/portfolio-import/import-job-panels.d.ts.map +1 -1
- package/dist/portfolio-import/import-job-panels.js +11 -4
- package/dist/portfolio-import/import-job-panels.js.map +1 -1
- package/dist/portfolio-import/job-error-copy.d.ts +62 -0
- package/dist/portfolio-import/job-error-copy.d.ts.map +1 -0
- package/dist/portfolio-import/job-error-copy.js +78 -0
- package/dist/portfolio-import/job-error-copy.js.map +1 -0
- package/dist/realtime/organisation-events/schemas.d.ts +2 -2
- package/package.json +4 -1
- package/src/theme/tokens.css +66 -0
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** @internal Story and test fixtures for the role cards. Plain data, no behaviour. */
|
|
3
|
+
const MASKED = { masked: true, display: "b***@buyer.example" };
|
|
4
|
+
export const offerFull = {
|
|
5
|
+
offerId: "11111111-1111-4111-8111-111111111111",
|
|
6
|
+
status: "in_negotiation",
|
|
7
|
+
viewerRole: "producer",
|
|
8
|
+
product: "Riesling Spatlese 2022",
|
|
9
|
+
opportunity: "Nordic red wine tender, autumn 2026",
|
|
10
|
+
counterparty: "Nordic Wine Imports AB",
|
|
11
|
+
price: "9.40",
|
|
12
|
+
priceType: "per bottle",
|
|
13
|
+
currency: "EUR",
|
|
14
|
+
volume: "6,000 bottles",
|
|
15
|
+
validThrough: "2026-12-01",
|
|
16
|
+
round: 2,
|
|
17
|
+
awaiting: "you",
|
|
18
|
+
counts: { messages: 14, attachments: 2 },
|
|
19
|
+
link: "/offers/11111111-1111-4111-8111-111111111111",
|
|
20
|
+
detail: {
|
|
21
|
+
kind: "offer",
|
|
22
|
+
id: "11111111-1111-4111-8111-111111111111",
|
|
23
|
+
focus: ["terms.price"],
|
|
24
|
+
},
|
|
25
|
+
actions: [
|
|
26
|
+
{
|
|
27
|
+
id: "open-thread",
|
|
28
|
+
label: "Open the thread",
|
|
29
|
+
kind: "navigate",
|
|
30
|
+
href: "/offers/11111111-1111-4111-8111-111111111111/chat",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: "counter",
|
|
34
|
+
label: "Counter this offer",
|
|
35
|
+
kind: "propose",
|
|
36
|
+
tool: "counter_received_offer",
|
|
37
|
+
args: { offerId: "11111111-1111-4111-8111-111111111111" },
|
|
38
|
+
tier: "reversible",
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
};
|
|
42
|
+
export const offerMinimal = { offerId: "o-2", status: "draft" };
|
|
43
|
+
export const offerMasked = {
|
|
44
|
+
...offerFull,
|
|
45
|
+
counterparty: MASKED,
|
|
46
|
+
status: "awaiting_counterparty_acceptance",
|
|
47
|
+
awaiting: "counterparty",
|
|
48
|
+
actions: undefined,
|
|
49
|
+
};
|
|
50
|
+
export const offerAccepted = {
|
|
51
|
+
...offerFull,
|
|
52
|
+
status: "accepted",
|
|
53
|
+
awaiting: "none",
|
|
54
|
+
actions: undefined,
|
|
55
|
+
};
|
|
56
|
+
export const offerRejected = {
|
|
57
|
+
...offerFull,
|
|
58
|
+
status: "rejected",
|
|
59
|
+
awaiting: "none",
|
|
60
|
+
actions: undefined,
|
|
61
|
+
};
|
|
62
|
+
export const offerLongText = {
|
|
63
|
+
...offerFull,
|
|
64
|
+
product: "Gewurztraminer Grand Cru Vendanges Tardives Cuvee Reserve de la Famille 2019 magnum in individual wooden gift box",
|
|
65
|
+
counterparty: "Internationale Weinhandelsgesellschaft fur Spezialitaten und Raritaten mbH & Co. KG",
|
|
66
|
+
};
|
|
67
|
+
export const offerProposal = {
|
|
68
|
+
...offerFull,
|
|
69
|
+
actions: undefined,
|
|
70
|
+
proposal: {
|
|
71
|
+
kind: "offer",
|
|
72
|
+
id: "11111111-1111-4111-8111-111111111111",
|
|
73
|
+
changes: [
|
|
74
|
+
{ path: "terms.price", before: "9.40", after: "9.10" },
|
|
75
|
+
{ path: "terms.paymentTerms", before: null, after: "30 days" },
|
|
76
|
+
],
|
|
77
|
+
tool: "counter_received_offer",
|
|
78
|
+
tier: "reversible",
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
export const productFull = {
|
|
82
|
+
name: "Riesling Spatlese",
|
|
83
|
+
producer: "Weingut Sonnenhang",
|
|
84
|
+
category: "wine",
|
|
85
|
+
subtype: "white",
|
|
86
|
+
vintage: 2022,
|
|
87
|
+
abv: "12.5%",
|
|
88
|
+
volume: "750 ml",
|
|
89
|
+
packaging: "bottle",
|
|
90
|
+
certifications: ["organic", "sustainable"],
|
|
91
|
+
variantCount: 3,
|
|
92
|
+
matchCount: 2,
|
|
93
|
+
validation: "pending_review",
|
|
94
|
+
readiness: {
|
|
95
|
+
percent: 80,
|
|
96
|
+
canApprove: false,
|
|
97
|
+
blockers: 1,
|
|
98
|
+
recommendations: 2,
|
|
99
|
+
acknowledgements: 1,
|
|
100
|
+
},
|
|
101
|
+
link: "/portfolio/p1",
|
|
102
|
+
detail: { kind: "variant", id: "v1", focus: ["readiness.blockers"] },
|
|
103
|
+
actions: [
|
|
104
|
+
{
|
|
105
|
+
id: "fix",
|
|
106
|
+
label: "Fix what is missing",
|
|
107
|
+
kind: "edit",
|
|
108
|
+
tool: "update_variant",
|
|
109
|
+
args: { variantId: "v1" },
|
|
110
|
+
tier: "reversible",
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
};
|
|
114
|
+
export const productReady = {
|
|
115
|
+
...productFull,
|
|
116
|
+
validation: "approved",
|
|
117
|
+
readiness: { percent: 100, canApprove: true },
|
|
118
|
+
actions: undefined,
|
|
119
|
+
};
|
|
120
|
+
export const productMinimal = { name: "Lager" };
|
|
121
|
+
export const productProposal = {
|
|
122
|
+
...productFull,
|
|
123
|
+
actions: undefined,
|
|
124
|
+
proposal: {
|
|
125
|
+
kind: "variant",
|
|
126
|
+
id: "v1",
|
|
127
|
+
changes: [
|
|
128
|
+
{ path: "abv", before: "12.5", after: "13" },
|
|
129
|
+
{ path: "productionVolume", before: null, after: 12000 },
|
|
130
|
+
],
|
|
131
|
+
tool: "update_variant",
|
|
132
|
+
tier: "reversible",
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
export const opportunityOpen = {
|
|
136
|
+
name: "Red wine for the Nordic monopoly, autumn 2026",
|
|
137
|
+
buyer: MASKED,
|
|
138
|
+
market: "Sweden",
|
|
139
|
+
country: "SE",
|
|
140
|
+
category: "wine",
|
|
141
|
+
subtype: "red",
|
|
142
|
+
volume: "20,000 bottles",
|
|
143
|
+
priceRange: "8 to 11 EUR",
|
|
144
|
+
deadline: "2026-11-30",
|
|
145
|
+
daysRemaining: 49,
|
|
146
|
+
status: "open",
|
|
147
|
+
requirements: ["organic", "screw cap", "750 ml", "vintage 2023 or newer"],
|
|
148
|
+
link: "/opportunities/o1",
|
|
149
|
+
detail: { kind: "opportunity", id: "o1" },
|
|
150
|
+
actions: [
|
|
151
|
+
{
|
|
152
|
+
id: "match",
|
|
153
|
+
label: "See my matches",
|
|
154
|
+
kind: "navigate",
|
|
155
|
+
href: "/matches",
|
|
156
|
+
},
|
|
157
|
+
],
|
|
158
|
+
};
|
|
159
|
+
export const opportunityExpired = {
|
|
160
|
+
...opportunityOpen,
|
|
161
|
+
buyer: "Systembolaget",
|
|
162
|
+
status: "expired",
|
|
163
|
+
daysRemaining: -3,
|
|
164
|
+
actions: undefined,
|
|
165
|
+
};
|
|
166
|
+
export const opportunityMinimal = { name: "Tender" };
|
|
167
|
+
export const matchStrong = {
|
|
168
|
+
matchId: "m-1",
|
|
169
|
+
score: 4.5,
|
|
170
|
+
label: "Strong fit",
|
|
171
|
+
product: { name: "Riesling Spatlese 2022", link: "/portfolio/p1" },
|
|
172
|
+
opportunity: {
|
|
173
|
+
name: "Nordic red wine tender",
|
|
174
|
+
buyer: "Buyer AB",
|
|
175
|
+
country: "SE",
|
|
176
|
+
link: "/opportunities/o1",
|
|
177
|
+
},
|
|
178
|
+
explanation: "Category, volume and price all sit inside what the buyer asked for; the organic certificate is on file.",
|
|
179
|
+
volume: "6,000 bottles",
|
|
180
|
+
price: "9 EUR",
|
|
181
|
+
deadline: "2026-11-30",
|
|
182
|
+
daysRemaining: 49,
|
|
183
|
+
link: "/matches/m-1",
|
|
184
|
+
detail: { kind: "match", id: "m-1" },
|
|
185
|
+
actions: [
|
|
186
|
+
{
|
|
187
|
+
id: "interested",
|
|
188
|
+
label: "Mark interested",
|
|
189
|
+
kind: "propose",
|
|
190
|
+
tool: "mark_match_interested",
|
|
191
|
+
args: { matchId: "m-1" },
|
|
192
|
+
tier: "reversible",
|
|
193
|
+
},
|
|
194
|
+
],
|
|
195
|
+
};
|
|
196
|
+
export const matchWeak = {
|
|
197
|
+
...matchStrong,
|
|
198
|
+
score: 1.8,
|
|
199
|
+
label: "Weak fit",
|
|
200
|
+
explanation: "Price is above the buyer's range.",
|
|
201
|
+
actions: undefined,
|
|
202
|
+
};
|
|
203
|
+
export const matchMid = {
|
|
204
|
+
...matchStrong,
|
|
205
|
+
score: 3,
|
|
206
|
+
label: "Possible fit",
|
|
207
|
+
actions: undefined,
|
|
208
|
+
};
|
|
209
|
+
export const matchDeclined = {
|
|
210
|
+
...matchStrong,
|
|
211
|
+
declined: true,
|
|
212
|
+
actions: undefined,
|
|
213
|
+
};
|
|
214
|
+
export const matchMasked = {
|
|
215
|
+
...matchStrong,
|
|
216
|
+
opportunity: { name: "Private tender", buyer: MASKED },
|
|
217
|
+
actions: undefined,
|
|
218
|
+
};
|
|
219
|
+
export const matchMinimal = { matchId: "m-3", score: 0 };
|
|
220
|
+
/**
|
|
221
|
+
* The tables the cellarnode-mcp agents emit for the link tools (`agents/src/role-result-cards.ts`, CEL-2447), as they shape them:
|
|
222
|
+
* a `link` that is the surface's own internal path, null for a field the tool did not have, a last row that says a list was cut
|
|
223
|
+
* short, and a file column keyed by who wrote it (`counterpartyFile`: the other side's offer file; `producerFile` and
|
|
224
|
+
* `producerBeverage`: a producer's public documents and beverages as an importer sees them; `file`: the caller's own).
|
|
225
|
+
*/
|
|
226
|
+
const fileColumns = (fileKey) => [
|
|
227
|
+
{ key: fileKey, label: "File" },
|
|
228
|
+
{ key: "type", label: "Type" },
|
|
229
|
+
];
|
|
230
|
+
const OFFER_ID = "11111111-1111-4111-8111-111111111111";
|
|
231
|
+
const ORG_ID = "22222222-2222-4222-8222-222222222222";
|
|
232
|
+
/** `get_offer_file_link`: the offer page, where the file opens. The file came from the other side of the offer. */
|
|
233
|
+
export const tableOfferFile = {
|
|
234
|
+
columns: fileColumns("counterpartyFile"),
|
|
235
|
+
rows: [{ counterpartyFile: "Spec sheet Riesling 2022.pdf", type: "application/pdf" }],
|
|
236
|
+
link: `/offers/${OFFER_ID}`,
|
|
237
|
+
};
|
|
238
|
+
/** `get_org_document_link`, as the producer's agent draws it. The caller's own document. */
|
|
239
|
+
export const tableOrgDocument = {
|
|
240
|
+
columns: fileColumns("file"),
|
|
241
|
+
rows: [{ file: "Certificate of registration", type: "registration" }],
|
|
242
|
+
link: "/organisation/profile",
|
|
243
|
+
};
|
|
244
|
+
/** `get_org_document_link`, as the importer's agent draws it: the importer has the same organisation profile page. */
|
|
245
|
+
export const tableImporterOrgDocument = {
|
|
246
|
+
columns: fileColumns("file"),
|
|
247
|
+
rows: [{ file: "Company registration extract.pdf", type: "registration" }],
|
|
248
|
+
link: "/organisation/profile",
|
|
249
|
+
};
|
|
250
|
+
/** `get_attachment_link`, as the producer's agent draws it: where the file is shown (a product gallery). */
|
|
251
|
+
export const tableAttachment = {
|
|
252
|
+
columns: fileColumns("file"),
|
|
253
|
+
rows: [{ file: "Front label.png", type: null }],
|
|
254
|
+
link: "/portfolio/p1/products/v1/gallery",
|
|
255
|
+
};
|
|
256
|
+
/** `list_producer_documents`, as the importer's agent draws it: three columns and the row that says the list was cut short. */
|
|
257
|
+
export const tableProducerDocuments = {
|
|
258
|
+
columns: [...fileColumns("producerFile"), { key: "uploaded", label: "Uploaded" }],
|
|
259
|
+
rows: [
|
|
260
|
+
{ producerFile: "Organic certificate 2026.pdf", type: "certificate", uploaded: "2026-08-02" },
|
|
261
|
+
{ producerFile: "Price list autumn.xlsx", type: "price_list", uploaded: "2026-09-14" },
|
|
262
|
+
{ producerFile: "Tasting notes.pdf", type: null, uploaded: null },
|
|
263
|
+
{ producerFile: "More documents not shown", type: null, uploaded: null },
|
|
264
|
+
],
|
|
265
|
+
link: `/producers/${ORG_ID}`,
|
|
266
|
+
};
|
|
267
|
+
/** `get_producer_showcase`, as the importer's agent draws it: a version count at the tool's cap on a cut list reads "20+". */
|
|
268
|
+
export const tableProducerShowcase = {
|
|
269
|
+
columns: [
|
|
270
|
+
{ key: "producerBeverage", label: "Beverage" },
|
|
271
|
+
{ key: "category", label: "Category" },
|
|
272
|
+
{ key: "country", label: "Country" },
|
|
273
|
+
{ key: "versions", label: "Versions" },
|
|
274
|
+
],
|
|
275
|
+
rows: [
|
|
276
|
+
{ producerBeverage: "Riesling Spatlese", category: "wine", country: "DE", versions: 3 },
|
|
277
|
+
{ producerBeverage: "Pinot Noir Reserve", category: "wine", country: "DE", versions: "20+" },
|
|
278
|
+
{ producerBeverage: "Apfelschorle", category: null, country: "DE", versions: 1 },
|
|
279
|
+
{
|
|
280
|
+
producerBeverage: "More beverages or versions not shown",
|
|
281
|
+
category: null,
|
|
282
|
+
country: null,
|
|
283
|
+
versions: null,
|
|
284
|
+
},
|
|
285
|
+
],
|
|
286
|
+
link: `/producers/${ORG_ID}`,
|
|
287
|
+
};
|
|
288
|
+
/** An e-label producer's attachment: the e-label app keeps its producer area under `/app`. */
|
|
289
|
+
export const tableElabelAttachment = {
|
|
290
|
+
columns: fileColumns("file"),
|
|
291
|
+
rows: [{ file: "Lab report 2026-03.pdf", type: "lab_report" }],
|
|
292
|
+
link: "/app/portfolio/p1/products/v1",
|
|
293
|
+
};
|
|
294
|
+
export const tableEmpty = {
|
|
295
|
+
columns: fileColumns("file"),
|
|
296
|
+
rows: [],
|
|
297
|
+
link: "/offers/o1",
|
|
298
|
+
};
|
|
299
|
+
/** A file name that fills the card: it wraps inside its cell, and a table wider than the card scrolls inside the card. */
|
|
300
|
+
export const tableLongText = {
|
|
301
|
+
columns: [...fileColumns("counterpartyFile"), { key: "uploaded", label: "Uploaded" }],
|
|
302
|
+
rows: [
|
|
303
|
+
{
|
|
304
|
+
counterpartyFile: "Gewurztraminer_Grand_Cru_Vendanges_Tardives_Cuvee_Reserve_de_la_Famille_2019_magnum_in_individual_wooden_gift_box_final_approved_v7.pdf",
|
|
305
|
+
type: "A very long description of what kind of document this is, written by the other side and run on well past any sensible length for a table cell",
|
|
306
|
+
uploaded: "2026-09-14",
|
|
307
|
+
},
|
|
308
|
+
],
|
|
309
|
+
link: `/offers/${OFFER_ID}`,
|
|
310
|
+
};
|
|
311
|
+
/** A masked column, a masked cell in an open column, and a plain value the server forgot to mask. */
|
|
312
|
+
export const tableMasked = {
|
|
313
|
+
columns: [
|
|
314
|
+
{ key: "name", label: "Contact" },
|
|
315
|
+
{ key: "email", label: "Email", masked: true },
|
|
316
|
+
{ key: "phone", label: "Phone" },
|
|
317
|
+
],
|
|
318
|
+
rows: [
|
|
319
|
+
{
|
|
320
|
+
name: "Anna Berg",
|
|
321
|
+
email: { masked: true, display: "a***@buyer.example" },
|
|
322
|
+
phone: { masked: true, display: "+46 ** *** 12" },
|
|
323
|
+
},
|
|
324
|
+
{ name: "Karl Holm", email: "karl.holm@buyer.example", phone: null },
|
|
325
|
+
],
|
|
326
|
+
};
|
|
327
|
+
/** Paths the story and test hosts accept. */
|
|
328
|
+
export const allowFixtureLink = (path) => /^\/(offers|portfolio|opportunities|matches)(\/|$)/.test(path);
|
|
329
|
+
const argsByLastSegment = (changes, id, idArg) => ({
|
|
330
|
+
[idArg]: id,
|
|
331
|
+
...Object.fromEntries(changes.map((c) => [c.path.split(".").pop(), c.after])),
|
|
332
|
+
});
|
|
333
|
+
/** A host tool catalog for stories and tests. Tiers, titles and target kinds live HERE, never on a card. */
|
|
334
|
+
export const fixtureCatalog = {
|
|
335
|
+
counter_received_offer: {
|
|
336
|
+
name: "counter_received_offer",
|
|
337
|
+
title: "Counter the received offer",
|
|
338
|
+
tier: "reversible",
|
|
339
|
+
inputSchema: z.object({
|
|
340
|
+
offerId: z.string().min(1),
|
|
341
|
+
price: z.string().optional(),
|
|
342
|
+
paymentTerms: z.string().optional(),
|
|
343
|
+
}),
|
|
344
|
+
targetArg: "offerId",
|
|
345
|
+
targetKind: "offer",
|
|
346
|
+
argsFromChanges: (changes, id) => argsByLastSegment(changes, id, "offerId"),
|
|
347
|
+
},
|
|
348
|
+
update_variant: {
|
|
349
|
+
name: "update_variant",
|
|
350
|
+
title: "Update product version",
|
|
351
|
+
tier: "reversible",
|
|
352
|
+
inputSchema: z.object({
|
|
353
|
+
variantId: z.string(),
|
|
354
|
+
abv: z.string().optional(),
|
|
355
|
+
productionVolume: z.number().optional(),
|
|
356
|
+
}),
|
|
357
|
+
targetArg: "variantId",
|
|
358
|
+
targetKind: "variant",
|
|
359
|
+
argsFromChanges: (changes, id) => argsByLastSegment(changes, id, "variantId"),
|
|
360
|
+
},
|
|
361
|
+
mark_match_interested: {
|
|
362
|
+
name: "mark_match_interested",
|
|
363
|
+
title: "Mark the match as interested",
|
|
364
|
+
tier: "reversible",
|
|
365
|
+
inputSchema: z.object({ matchId: z.string() }),
|
|
366
|
+
targetArg: "matchId",
|
|
367
|
+
targetKind: "match",
|
|
368
|
+
},
|
|
369
|
+
discard_offer: {
|
|
370
|
+
name: "discard_offer",
|
|
371
|
+
title: "Discard the offer",
|
|
372
|
+
tier: "destructive",
|
|
373
|
+
inputSchema: z.object({ offerId: z.string() }),
|
|
374
|
+
targetArg: "offerId",
|
|
375
|
+
targetKind: "offer",
|
|
376
|
+
},
|
|
377
|
+
delete_product: {
|
|
378
|
+
name: "delete_product",
|
|
379
|
+
title: "Delete the product",
|
|
380
|
+
tier: "destructive",
|
|
381
|
+
inputSchema: z.object({ productId: z.string() }),
|
|
382
|
+
targetArg: "productId",
|
|
383
|
+
targetKind: "product",
|
|
384
|
+
},
|
|
385
|
+
get_offer: {
|
|
386
|
+
name: "get_offer",
|
|
387
|
+
title: "Read an offer",
|
|
388
|
+
tier: "read",
|
|
389
|
+
inputSchema: z.object({ offerId: z.string() }),
|
|
390
|
+
},
|
|
391
|
+
};
|
|
392
|
+
/** The records a story host would fetch for a proposal's Apply, keyed `kind:id`. */
|
|
393
|
+
export const fixtureRecords = {
|
|
394
|
+
"offer:11111111-1111-4111-8111-111111111111": {
|
|
395
|
+
name: "Riesling Spatlese 2022 for Nordic Wine Imports",
|
|
396
|
+
terms: { price: "9.40", paymentTerms: null },
|
|
397
|
+
},
|
|
398
|
+
"variant:v1": { name: "Riesling Spatlese 2022", abv: "12.5", productionVolume: null },
|
|
399
|
+
};
|
|
400
|
+
export const fixtureFetchRecord = async (kind, id) => fixtureRecords[`${kind}:${id}`] ?? null;
|
|
401
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixtures.js","sourceRoot":"","sources":["../../../src/agent/role-cards/fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,sFAAsF;AACtF,MAAM,MAAM,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,oBAAoB,EAAW,CAAC;AAExE,MAAM,CAAC,MAAM,SAAS,GAAkB;IACtC,OAAO,EAAE,sCAAsC;IAC/C,MAAM,EAAE,gBAAgB;IACxB,UAAU,EAAE,UAAU;IACtB,OAAO,EAAE,wBAAwB;IACjC,WAAW,EAAE,qCAAqC;IAClD,YAAY,EAAE,wBAAwB;IACtC,KAAK,EAAE,MAAM;IACb,SAAS,EAAE,YAAY;IACvB,QAAQ,EAAE,KAAK;IACf,MAAM,EAAE,eAAe;IACvB,YAAY,EAAE,YAAY;IAC1B,KAAK,EAAE,CAAC;IACR,QAAQ,EAAE,KAAK;IACf,MAAM,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE;IACxC,IAAI,EAAE,8CAA8C;IACpD,MAAM,EAAE;QACN,IAAI,EAAE,OAAO;QACb,EAAE,EAAE,sCAAsC;QAC1C,KAAK,EAAE,CAAC,aAAa,CAAC;KACvB;IACD,OAAO,EAAE;QACP;YACE,EAAE,EAAE,aAAa;YACjB,KAAK,EAAE,iBAAiB;YACxB,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,mDAAm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K,EAAE,oBAAoB;QAC3B,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;QAChD,SAAS,EAAE,WAAW;QACtB,UAAU,EAAE,SAAS;KACtB;IACD,SAAS,EAAE;QACT,IAAI,EAAE,WAAW;QACjB,KAAK,EAAE,eAAe;QACtB,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;KAC/C;CACO,CAAC;AAEX,oFAAoF;AACpF,MAAM,CAAC,MAAM,cAAc,GAA4B;IACrD,4CAA4C,EAAE;QAC5C,IAAI,EAAE,gDAAgD;QACtD,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE;KAC7C;IACD,YAAY,EAAE,EAAE,IAAI,EAAE,wBAAwB,EAAE,GAAG,EAAE,MAAM,EAAE,gBAAgB,EAAE,IAAI,EAAE;CACtF,CAAC;AACF,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,EAAE,IAAY,EAAE,EAAU,EAAoB,EAAE,CACrF,cAAc,CAAC,GAAG,IAAI,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC"}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import type { CardAction, CardDetail, CardProposal, DataTableData, MatchCardData, OfferCardData, OpportunityCardData, ProductCardData } from "@cellarnode/agent-cards/zod4";
|
|
2
|
+
/**
|
|
3
|
+
* @internal The HOST side of the card contract (CEL-2445, `@cellarnode/agent-cards` README "Host contract (MUST)").
|
|
4
|
+
* A card's `actions` and `proposal` are claims by the model. These pure helpers are where a host turns a claim into
|
|
5
|
+
* something it may act on, or refuses. The card composites call them THEMSELVES, so the safe path is the only path:
|
|
6
|
+
* `AgentCardActions` hands the host a `CardConfirmPlan` (never the raw action) and `AgentProposalDiff` hands it the result of
|
|
7
|
+
* `planProposalApply` (never the raw proposal).
|
|
8
|
+
*
|
|
9
|
+
* 1. the tier comes ONLY from the host catalog, by `tool` (`card.tier` is advisory; a mismatch or unknown tool drops the action);
|
|
10
|
+
* 2. the confirm plan is built from the catalog's tool title and the ACTUAL validated args, never the model's `label`;
|
|
11
|
+
* 3. `open` and `navigate` never run a tool;
|
|
12
|
+
* 4. a proposal's Apply re-fetches the record, diffs server truth against `after`, binds the tool's target-id arg to `proposal.id`,
|
|
13
|
+
* and binds the proposal to the card's subject (`expected`) and to the tool's `targetKind`;
|
|
14
|
+
* 5. args go through the tool's own input schema.
|
|
15
|
+
*
|
|
16
|
+
* No I/O except the host-supplied `fetchRecord`; nothing here runs a tool.
|
|
17
|
+
*/
|
|
18
|
+
export type CatalogTier = "read" | "reversible" | "destructive" | "costly";
|
|
19
|
+
export type DetailKind = CardProposal["kind"];
|
|
20
|
+
export interface AgentToolCatalogEntry {
|
|
21
|
+
name: string;
|
|
22
|
+
/** What the confirm UI calls the tool. Comes from the catalog, never from a card. */
|
|
23
|
+
title: string;
|
|
24
|
+
tier: CatalogTier;
|
|
25
|
+
/** The tool's own input schema (any zod 3.25 or 4 schema, or anything with `safeParse`). */
|
|
26
|
+
inputSchema: {
|
|
27
|
+
safeParse: (value: unknown) => {
|
|
28
|
+
success: true;
|
|
29
|
+
data: unknown;
|
|
30
|
+
} | {
|
|
31
|
+
success: false;
|
|
32
|
+
error?: unknown;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
/** The argument that carries the id of the record the tool acts on. Required for any tool a proposal may name. */
|
|
36
|
+
targetArg?: string;
|
|
37
|
+
/** The kind of record the tool acts on. Required for any tool a proposal may name; a proposal of another kind is refused. */
|
|
38
|
+
targetKind?: DetailKind;
|
|
39
|
+
/** How a proposal's changes become this tool's args. Default: one arg per change path. `targetArg` is bound to `proposal.id` AFTER this runs. */
|
|
40
|
+
argsFromChanges?: (changes: CardProposal["changes"], id: string) => Record<string, unknown>;
|
|
41
|
+
/** The human label of a fetched record for the confirm title. Default: its `name`, `title` or `label` string. */
|
|
42
|
+
recordLabel?: (record: Record<string, unknown>) => string | undefined;
|
|
43
|
+
}
|
|
44
|
+
export type AgentToolCatalog = Readonly<Record<string, AgentToolCatalogEntry>>;
|
|
45
|
+
export type DropReason = "unknown_tool" | "tier_mismatch" | "tool_on_navigation" | "tool_missing";
|
|
46
|
+
export interface DroppedAction {
|
|
47
|
+
id: string;
|
|
48
|
+
reason: DropReason;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Rules 1 and 3 over a card's actions. Keeps an action only when it is safe to offer: an `open`/`navigate` carries no tool,
|
|
52
|
+
* an `edit`/`propose` names a tool the catalog knows, and a declared `tier` equals the catalog's. Everything else is dropped
|
|
53
|
+
* (never "corrected"), and the reasons are returned for logging.
|
|
54
|
+
*/
|
|
55
|
+
export declare function resolveCardActions(actions: readonly CardAction[] | undefined, catalog: AgentToolCatalog): {
|
|
56
|
+
actions: CardAction[];
|
|
57
|
+
dropped: DroppedAction[];
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* `resolveCardActions`, then what the person SEES comes from the catalog, not the model: a write is labelled with the catalog
|
|
61
|
+
* title ("Tidy up" cannot front a delete) and its `tier` is stamped from the catalog, so danger styling and the confirm hint
|
|
62
|
+
* never depend on what the model declared. A read tool keeps the model's caption and carries no tier.
|
|
63
|
+
*/
|
|
64
|
+
export declare function actionsForDisplay(actions: readonly CardAction[] | undefined, catalog: AgentToolCatalog | undefined): CardAction[];
|
|
65
|
+
/**
|
|
66
|
+
* The actions a card actually OFFERS the person: what `actionsForDisplay` accepts, and then only what the host can act on. A tool
|
|
67
|
+
* action needs the host's `onAction` (`canRunTools`); a link needs the host's `allowLink` to accept its `href`. The one rule behind
|
|
68
|
+
* both the action row and anything that decides whether to draw a row at all.
|
|
69
|
+
*/
|
|
70
|
+
export declare function offeredActions(actions: readonly CardAction[] | undefined, catalog: AgentToolCatalog | undefined, host: {
|
|
71
|
+
canRunTools: boolean;
|
|
72
|
+
allowLink?: (path: string) => boolean;
|
|
73
|
+
}): CardAction[];
|
|
74
|
+
export interface ConfirmRow {
|
|
75
|
+
/** The argument name. */
|
|
76
|
+
label: string;
|
|
77
|
+
value: string;
|
|
78
|
+
}
|
|
79
|
+
export interface CardConfirmPlan {
|
|
80
|
+
tool: string;
|
|
81
|
+
/** The catalog's title for the tool, followed by the fetched record's name when there is one. NEVER the card's `label`. */
|
|
82
|
+
title: string;
|
|
83
|
+
/** The catalog's tier. */
|
|
84
|
+
tier: CatalogTier;
|
|
85
|
+
/** Every non-read tool confirms. */
|
|
86
|
+
requiresConfirm: boolean;
|
|
87
|
+
/** The validated arguments the tool would receive. */
|
|
88
|
+
args: Record<string, unknown>;
|
|
89
|
+
/** The same arguments, one row each, for the confirm UI. */
|
|
90
|
+
rows: ConfirmRow[];
|
|
91
|
+
/** The fetched record's label (a proposal's subject), when it has one. */
|
|
92
|
+
subject?: string;
|
|
93
|
+
}
|
|
94
|
+
export type BuildConfirmFailure = "not_a_tool_action" | "unknown_tool" | "tier_mismatch" | "invalid_args";
|
|
95
|
+
/**
|
|
96
|
+
* Rules 1, 2, 3 and 5 for one action: the plan the confirm UI renders. Its title, tier and rows come from the catalog and
|
|
97
|
+
* the tool's validated args; the action's `label` is not read.
|
|
98
|
+
*/
|
|
99
|
+
export declare function buildConfirm(action: CardAction, catalog: AgentToolCatalog): {
|
|
100
|
+
ok: true;
|
|
101
|
+
plan: CardConfirmPlan;
|
|
102
|
+
} | {
|
|
103
|
+
ok: false;
|
|
104
|
+
reason: BuildConfirmFailure;
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Find a dotted or bracketed path (`a.b[0].c`) in a record. `found` is false for a missing key, so "absent" is not confused with
|
|
108
|
+
* a present `null`. Refuses prototype keys and array `length`.
|
|
109
|
+
*/
|
|
110
|
+
export declare function lookupPath(record: unknown, path: string): {
|
|
111
|
+
found: boolean;
|
|
112
|
+
value: unknown;
|
|
113
|
+
};
|
|
114
|
+
/** The value at a path, or `undefined` when absent. */
|
|
115
|
+
export declare function readPath(record: unknown, path: string): unknown;
|
|
116
|
+
/** The record's own name: the first of `name`, `title`, `label` that is a string. Not yet cleaned. */
|
|
117
|
+
export declare const recordName: (record: Record<string, unknown>) => string | undefined;
|
|
118
|
+
/**
|
|
119
|
+
* The host's own label for a fetched record, when its catalog has one: the `recordLabel` of a tool that acts on this kind of record
|
|
120
|
+
* (the tools a card names come first). Cleaned like a confirm title. `undefined` when no tool has one or it yields nothing. A
|
|
121
|
+
* `recordLabel` is host code: one that throws is skipped, never allowed to take the drawer down.
|
|
122
|
+
*/
|
|
123
|
+
export declare function catalogRecordLabel(catalog: AgentToolCatalog | undefined, kind: DetailKind, record: Record<string, unknown>, toolsNamedByCard?: readonly (string | undefined)[]): string | undefined;
|
|
124
|
+
export interface ProposalDiffRow {
|
|
125
|
+
path: string;
|
|
126
|
+
/** What the SERVER has now (from the re-fetched record). The model's `before` is never shown as truth. */
|
|
127
|
+
before: unknown;
|
|
128
|
+
after: CardProposal["changes"][number]["after"];
|
|
129
|
+
/** What the model claimed `before` was ("proposed from"); kept so a stale refusal can show the mismatch. */
|
|
130
|
+
claimedBefore: CardProposal["changes"][number]["before"];
|
|
131
|
+
/** `already_applied`: the server already has `after`. `pending`: the server still has what the model said. */
|
|
132
|
+
state: "pending" | "already_applied";
|
|
133
|
+
}
|
|
134
|
+
export type ApplyProposalFailure = "unknown_tool" | "tier_mismatch" | "no_target_arg" | "no_target_kind" | "kind_mismatch" | "subject_mismatch" | "target_override" | "record_unavailable" | "unknown_path" | "stale" | "nothing_to_apply" | "invalid_args";
|
|
135
|
+
export interface ProposalApplyPlan {
|
|
136
|
+
plan: CardConfirmPlan;
|
|
137
|
+
/** Server truth against `after`, one row per change (already-applied rows included, marked). */
|
|
138
|
+
diff: ProposalDiffRow[];
|
|
139
|
+
/** The proposal this plan was built for. */
|
|
140
|
+
proposal: CardProposal;
|
|
141
|
+
}
|
|
142
|
+
export type PlanProposalResult = ({
|
|
143
|
+
ok: true;
|
|
144
|
+
} & ProposalApplyPlan) | {
|
|
145
|
+
ok: false;
|
|
146
|
+
reason: ApplyProposalFailure;
|
|
147
|
+
conflicts?: ProposalDiffRow[];
|
|
148
|
+
paths?: string[];
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* Rule 4 (with 1, 2 and 5): what a proposal's Apply may do. `expected` is the subject the CARD is about (its `detail`, or its
|
|
152
|
+
* offerId or matchId): a proposal for any other record is refused, as is one whose `kind` is not the tool's `targetKind`.
|
|
153
|
+
* Re-fetches the record by `kind` + `id`; a change whose path is absent from it is refused, a change whose `before` no longer
|
|
154
|
+
* matches is STALE and refuses the whole proposal, one already at `after` is skipped; the tool's `targetArg` is bound to
|
|
155
|
+
* `proposal.id` (a change that tries to set it is refused); the args go through the tool's input schema; the plan title names
|
|
156
|
+
* the fetched record.
|
|
157
|
+
*/
|
|
158
|
+
export declare function planProposalApply(proposal: CardProposal, catalog: AgentToolCatalog, fetchRecord: (kind: DetailKind, id: string) => Promise<unknown>, expected: Pick<CardDetail, "kind" | "id">): Promise<PlanProposalResult>;
|
|
159
|
+
/** The subject a card is about: its `detail` pointer. Cards that carry an id of their own (offer, match) pass it explicitly. */
|
|
160
|
+
export declare const subjectOf: (detail: CardDetail | undefined, fallback?: Pick<CardDetail, "kind" | "id">) => Pick<CardDetail, "kind" | "id"> | undefined;
|
|
161
|
+
/**
|
|
162
|
+
* Rules 1 and 3 over a whole parsed card: keeps only the actions `actionsForDisplay` accepts and drops a `proposal` whose tool is
|
|
163
|
+
* unknown, whose tier differs from the catalog's or whose tool lacks a `targetArg` or `targetKind`. With NO catalog every
|
|
164
|
+
* tool-bearing action and every proposal is dropped (secure default): only `open`/`navigate`/tool-less actions remain.
|
|
165
|
+
*/
|
|
166
|
+
export declare function sanitizeCardForHost<T extends {
|
|
167
|
+
actions?: CardAction[];
|
|
168
|
+
proposal?: CardProposal;
|
|
169
|
+
}>(card: T, catalog: AgentToolCatalog | undefined): T;
|
|
170
|
+
export declare const ROLE_AGENT_CARD_TYPES: readonly ["OfferCard", "ProductCard", "OpportunityCard", "MatchCard", "DataTable"];
|
|
171
|
+
export type RoleAgentCardType = (typeof ROLE_AGENT_CARD_TYPES)[number];
|
|
172
|
+
/** The cards that are about ONE record. A `DataTable` is a list: it has no subject, and `readRoleCard` drops any pointer it carries. */
|
|
173
|
+
type RecordCardType = Exclude<RoleAgentCardType, "DataTable">;
|
|
174
|
+
/**
|
|
175
|
+
* Does the card's `detail` pointer name what the card is about? An offer's or a match's must name its own id, a product's must be a
|
|
176
|
+
* product or a variant, an opportunity's an opportunity. A card with no pointer agrees (nothing to disagree with). The cards and
|
|
177
|
+
* `readRoleCard` both call this, so a disagreeing card is refused the same way everywhere, never reconciled.
|
|
178
|
+
*/
|
|
179
|
+
export declare function detailAgrees(cardType: RecordCardType, data: {
|
|
180
|
+
detail?: CardDetail;
|
|
181
|
+
offerId?: string;
|
|
182
|
+
matchId?: string;
|
|
183
|
+
}): boolean;
|
|
184
|
+
type Subject = Pick<CardDetail, "kind" | "id">;
|
|
185
|
+
export type RoleCardRead = {
|
|
186
|
+
cardType: "OfferCard";
|
|
187
|
+
data: OfferCardData;
|
|
188
|
+
subject: Subject;
|
|
189
|
+
} | {
|
|
190
|
+
cardType: "MatchCard";
|
|
191
|
+
data: MatchCardData;
|
|
192
|
+
subject: Subject;
|
|
193
|
+
} | {
|
|
194
|
+
cardType: "ProductCard";
|
|
195
|
+
data: ProductCardData;
|
|
196
|
+
subject: Subject | undefined;
|
|
197
|
+
} | {
|
|
198
|
+
cardType: "OpportunityCard";
|
|
199
|
+
data: OpportunityCardData;
|
|
200
|
+
subject: Subject | undefined;
|
|
201
|
+
} | {
|
|
202
|
+
cardType: "DataTable";
|
|
203
|
+
data: DataTableData;
|
|
204
|
+
subject: undefined;
|
|
205
|
+
};
|
|
206
|
+
/**
|
|
207
|
+
* The ONE way a host turns what an agent sent into a role card it may draw: parse against the agent-cards schema, refuse a card
|
|
208
|
+
* whose `detail` disagrees with it (`detailAgrees`), then `sanitizeCardForHost` against the host catalog. `null` for an unknown
|
|
209
|
+
* type, data that fails the schema, or a disagreeing card. `subject` is the record THIS card is about (its offerId or matchId, or its
|
|
210
|
+
* `detail`), what a proposal is bound to. `renderRoleAgentCard` and the inspector drawer both read through here.
|
|
211
|
+
*/
|
|
212
|
+
export declare function readRoleCard(cardType: string, data: unknown, catalog: AgentToolCatalog | undefined): RoleCardRead | null;
|
|
213
|
+
export {};
|
|
214
|
+
//# sourceMappingURL=host-contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-contract.d.ts","sourceRoot":"","sources":["../../../src/agent/role-cards/host-contract.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,YAAY,EACZ,aAAa,EACb,aAAa,EACb,aAAa,EACb,mBAAmB,EACnB,eAAe,EAChB,MAAM,8BAA8B,CAAC;AAGtC;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,YAAY,GAAG,aAAa,GAAG,QAAQ,CAAC;AAC3E,MAAM,MAAM,UAAU,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;AAE9C,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,qFAAqF;IACrF,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,WAAW,CAAC;IAClB,4FAA4F;IAC5F,WAAW,EAAE;QACX,SAAS,EAAE,CACT,KAAK,EAAE,OAAO,KACX;YAAE,OAAO,EAAE,IAAI,CAAC;YAAC,IAAI,EAAE,OAAO,CAAA;SAAE,GAAG;YAAE,OAAO,EAAE,KAAK,CAAC;YAAC,KAAK,CAAC,EAAE,OAAO,CAAA;SAAE,CAAC;KAC7E,CAAC;IACF,kHAAkH;IAClH,SAAS,CAAC,EAAE,MAAM,CA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