@classic-homes/agent-contracts 0.11.0 → 0.12.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/api.d.ts +3 -0
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +5 -0
- package/dist/api.js.map +1 -1
- package/dist/chat.d.ts +115 -0
- package/dist/chat.d.ts.map +1 -1
- package/dist/chat.js +10 -0
- package/dist/chat.js.map +1 -1
- package/dist/client-tools.d.ts +519 -0
- package/dist/client-tools.d.ts.map +1 -0
- package/dist/client-tools.js +57 -0
- package/dist/client-tools.js.map +1 -0
- package/dist/context.d.ts +325 -3
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +47 -3
- package/dist/context.js.map +1 -1
- package/dist/events.d.ts +50 -6
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +27 -2
- package/dist/events.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/limits.d.ts +16 -0
- package/dist/limits.d.ts.map +1 -1
- package/dist/limits.js +16 -0
- package/dist/limits.js.map +1 -1
- package/package.json +1 -1
package/dist/context.d.ts
CHANGED
|
@@ -121,9 +121,123 @@ export declare const AgentContextTarget: z.ZodObject<{
|
|
|
121
121
|
}, z.core.$strip>;
|
|
122
122
|
export type AgentContextTarget = z.infer<typeof AgentContextTarget>;
|
|
123
123
|
/**
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
124
|
+
* What the page is showing right now, as the page itself describes it: the state of a list
|
|
125
|
+
* (search, filters, sort, selection) or a form (which fields have unsaved edits). Structured and
|
|
126
|
+
* page-chosen; never rows, and never unsaved values.
|
|
127
|
+
*/
|
|
128
|
+
export declare const AppView: z.ZodObject<{
|
|
129
|
+
kind: z.ZodEnum<{
|
|
130
|
+
list: "list";
|
|
131
|
+
detail: "detail";
|
|
132
|
+
form: "form";
|
|
133
|
+
dashboard: "dashboard";
|
|
134
|
+
other: "other";
|
|
135
|
+
}>;
|
|
136
|
+
search: z.ZodOptional<z.ZodString>;
|
|
137
|
+
filters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
138
|
+
sort: z.ZodOptional<z.ZodString>;
|
|
139
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
140
|
+
selected: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
141
|
+
kind: z.ZodEnum<{
|
|
142
|
+
home: "home";
|
|
143
|
+
lot: "lot";
|
|
144
|
+
community: "community";
|
|
145
|
+
filing: "filing";
|
|
146
|
+
floorplan: "floorplan";
|
|
147
|
+
elevation: "elevation";
|
|
148
|
+
district: "district";
|
|
149
|
+
user: "user";
|
|
150
|
+
vendor: "vendor";
|
|
151
|
+
sign: "sign";
|
|
152
|
+
"slide-deck": "slide-deck";
|
|
153
|
+
survey: "survey";
|
|
154
|
+
workspace: "workspace";
|
|
155
|
+
walk: "walk";
|
|
156
|
+
permit: "permit";
|
|
157
|
+
incentive: "incentive";
|
|
158
|
+
}>;
|
|
159
|
+
id: z.ZodString;
|
|
160
|
+
label: z.ZodString;
|
|
161
|
+
path: z.ZodOptional<z.ZodString>;
|
|
162
|
+
}, z.core.$strip>>>;
|
|
163
|
+
dirty: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
164
|
+
}, z.core.$strip>;
|
|
165
|
+
export type AppView = z.infer<typeof AppView>;
|
|
166
|
+
/** A dialog or drawer open above the page; when present it is what the user is focused on. */
|
|
167
|
+
export declare const AppOverlay: z.ZodObject<{
|
|
168
|
+
kind: z.ZodEnum<{
|
|
169
|
+
dialog: "dialog";
|
|
170
|
+
drawer: "drawer";
|
|
171
|
+
}>;
|
|
172
|
+
title: z.ZodString;
|
|
173
|
+
record: z.ZodOptional<z.ZodObject<{
|
|
174
|
+
kind: z.ZodEnum<{
|
|
175
|
+
home: "home";
|
|
176
|
+
lot: "lot";
|
|
177
|
+
community: "community";
|
|
178
|
+
filing: "filing";
|
|
179
|
+
floorplan: "floorplan";
|
|
180
|
+
elevation: "elevation";
|
|
181
|
+
district: "district";
|
|
182
|
+
user: "user";
|
|
183
|
+
vendor: "vendor";
|
|
184
|
+
sign: "sign";
|
|
185
|
+
"slide-deck": "slide-deck";
|
|
186
|
+
survey: "survey";
|
|
187
|
+
workspace: "workspace";
|
|
188
|
+
walk: "walk";
|
|
189
|
+
permit: "permit";
|
|
190
|
+
incentive: "incentive";
|
|
191
|
+
}>;
|
|
192
|
+
id: z.ZodString;
|
|
193
|
+
label: z.ZodString;
|
|
194
|
+
path: z.ZodOptional<z.ZodString>;
|
|
195
|
+
}, z.core.$strip>>;
|
|
196
|
+
}, z.core.$strip>;
|
|
197
|
+
export type AppOverlay = z.infer<typeof AppOverlay>;
|
|
198
|
+
/** One recent user action on the app. A label, never a payload. */
|
|
199
|
+
export declare const AppActivity: z.ZodObject<{
|
|
200
|
+
at: z.ZodISODateTime;
|
|
201
|
+
type: z.ZodEnum<{
|
|
202
|
+
filter: "filter";
|
|
203
|
+
navigate: "navigate";
|
|
204
|
+
tab: "tab";
|
|
205
|
+
select: "select";
|
|
206
|
+
save: "save";
|
|
207
|
+
open: "open";
|
|
208
|
+
close: "close";
|
|
209
|
+
}>;
|
|
210
|
+
label: z.ZodString;
|
|
211
|
+
record: z.ZodOptional<z.ZodObject<{
|
|
212
|
+
kind: z.ZodEnum<{
|
|
213
|
+
home: "home";
|
|
214
|
+
lot: "lot";
|
|
215
|
+
community: "community";
|
|
216
|
+
filing: "filing";
|
|
217
|
+
floorplan: "floorplan";
|
|
218
|
+
elevation: "elevation";
|
|
219
|
+
district: "district";
|
|
220
|
+
user: "user";
|
|
221
|
+
vendor: "vendor";
|
|
222
|
+
sign: "sign";
|
|
223
|
+
"slide-deck": "slide-deck";
|
|
224
|
+
survey: "survey";
|
|
225
|
+
workspace: "workspace";
|
|
226
|
+
walk: "walk";
|
|
227
|
+
permit: "permit";
|
|
228
|
+
incentive: "incentive";
|
|
229
|
+
}>;
|
|
230
|
+
id: z.ZodString;
|
|
231
|
+
label: z.ZodString;
|
|
232
|
+
path: z.ZodOptional<z.ZodString>;
|
|
233
|
+
}, z.core.$strip>>;
|
|
234
|
+
}, z.core.$strip>;
|
|
235
|
+
export type AppActivity = z.infer<typeof AppActivity>;
|
|
236
|
+
/**
|
|
237
|
+
* Context a Classic App page attaches to a turn: where the user is, which record they are
|
|
238
|
+
* looking at, how the page is currently set up and what they just did. Sent per turn, only when
|
|
239
|
+
* the user keeps the context toggle on. Never the page's whole data set; `facts` are a
|
|
240
|
+
* page-chosen whitelist.
|
|
127
241
|
*/
|
|
128
242
|
export declare const AppContext: z.ZodObject<{
|
|
129
243
|
host: z.ZodLiteral<"app">;
|
|
@@ -165,6 +279,110 @@ export declare const AppContext: z.ZodObject<{
|
|
|
165
279
|
}, z.core.$strip>>;
|
|
166
280
|
facts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
167
281
|
selection: z.ZodOptional<z.ZodString>;
|
|
282
|
+
breadcrumb: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
283
|
+
view: z.ZodOptional<z.ZodObject<{
|
|
284
|
+
kind: z.ZodEnum<{
|
|
285
|
+
list: "list";
|
|
286
|
+
detail: "detail";
|
|
287
|
+
form: "form";
|
|
288
|
+
dashboard: "dashboard";
|
|
289
|
+
other: "other";
|
|
290
|
+
}>;
|
|
291
|
+
search: z.ZodOptional<z.ZodString>;
|
|
292
|
+
filters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
293
|
+
sort: z.ZodOptional<z.ZodString>;
|
|
294
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
295
|
+
selected: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
296
|
+
kind: z.ZodEnum<{
|
|
297
|
+
home: "home";
|
|
298
|
+
lot: "lot";
|
|
299
|
+
community: "community";
|
|
300
|
+
filing: "filing";
|
|
301
|
+
floorplan: "floorplan";
|
|
302
|
+
elevation: "elevation";
|
|
303
|
+
district: "district";
|
|
304
|
+
user: "user";
|
|
305
|
+
vendor: "vendor";
|
|
306
|
+
sign: "sign";
|
|
307
|
+
"slide-deck": "slide-deck";
|
|
308
|
+
survey: "survey";
|
|
309
|
+
workspace: "workspace";
|
|
310
|
+
walk: "walk";
|
|
311
|
+
permit: "permit";
|
|
312
|
+
incentive: "incentive";
|
|
313
|
+
}>;
|
|
314
|
+
id: z.ZodString;
|
|
315
|
+
label: z.ZodString;
|
|
316
|
+
path: z.ZodOptional<z.ZodString>;
|
|
317
|
+
}, z.core.$strip>>>;
|
|
318
|
+
dirty: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
319
|
+
}, z.core.$strip>>;
|
|
320
|
+
overlay: z.ZodOptional<z.ZodObject<{
|
|
321
|
+
kind: z.ZodEnum<{
|
|
322
|
+
dialog: "dialog";
|
|
323
|
+
drawer: "drawer";
|
|
324
|
+
}>;
|
|
325
|
+
title: z.ZodString;
|
|
326
|
+
record: z.ZodOptional<z.ZodObject<{
|
|
327
|
+
kind: z.ZodEnum<{
|
|
328
|
+
home: "home";
|
|
329
|
+
lot: "lot";
|
|
330
|
+
community: "community";
|
|
331
|
+
filing: "filing";
|
|
332
|
+
floorplan: "floorplan";
|
|
333
|
+
elevation: "elevation";
|
|
334
|
+
district: "district";
|
|
335
|
+
user: "user";
|
|
336
|
+
vendor: "vendor";
|
|
337
|
+
sign: "sign";
|
|
338
|
+
"slide-deck": "slide-deck";
|
|
339
|
+
survey: "survey";
|
|
340
|
+
workspace: "workspace";
|
|
341
|
+
walk: "walk";
|
|
342
|
+
permit: "permit";
|
|
343
|
+
incentive: "incentive";
|
|
344
|
+
}>;
|
|
345
|
+
id: z.ZodString;
|
|
346
|
+
label: z.ZodString;
|
|
347
|
+
path: z.ZodOptional<z.ZodString>;
|
|
348
|
+
}, z.core.$strip>>;
|
|
349
|
+
}, z.core.$strip>>;
|
|
350
|
+
recent: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
351
|
+
at: z.ZodISODateTime;
|
|
352
|
+
type: z.ZodEnum<{
|
|
353
|
+
filter: "filter";
|
|
354
|
+
navigate: "navigate";
|
|
355
|
+
tab: "tab";
|
|
356
|
+
select: "select";
|
|
357
|
+
save: "save";
|
|
358
|
+
open: "open";
|
|
359
|
+
close: "close";
|
|
360
|
+
}>;
|
|
361
|
+
label: z.ZodString;
|
|
362
|
+
record: z.ZodOptional<z.ZodObject<{
|
|
363
|
+
kind: z.ZodEnum<{
|
|
364
|
+
home: "home";
|
|
365
|
+
lot: "lot";
|
|
366
|
+
community: "community";
|
|
367
|
+
filing: "filing";
|
|
368
|
+
floorplan: "floorplan";
|
|
369
|
+
elevation: "elevation";
|
|
370
|
+
district: "district";
|
|
371
|
+
user: "user";
|
|
372
|
+
vendor: "vendor";
|
|
373
|
+
sign: "sign";
|
|
374
|
+
"slide-deck": "slide-deck";
|
|
375
|
+
survey: "survey";
|
|
376
|
+
workspace: "workspace";
|
|
377
|
+
walk: "walk";
|
|
378
|
+
permit: "permit";
|
|
379
|
+
incentive: "incentive";
|
|
380
|
+
}>;
|
|
381
|
+
id: z.ZodString;
|
|
382
|
+
label: z.ZodString;
|
|
383
|
+
path: z.ZodOptional<z.ZodString>;
|
|
384
|
+
}, z.core.$strip>>;
|
|
385
|
+
}, z.core.$strip>>>;
|
|
168
386
|
}, z.core.$strip>;
|
|
169
387
|
export type AppContext = z.infer<typeof AppContext>;
|
|
170
388
|
/**
|
|
@@ -235,6 +453,110 @@ export declare const DocumentContext: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
235
453
|
}, z.core.$strip>>;
|
|
236
454
|
facts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
237
455
|
selection: z.ZodOptional<z.ZodString>;
|
|
456
|
+
breadcrumb: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
457
|
+
view: z.ZodOptional<z.ZodObject<{
|
|
458
|
+
kind: z.ZodEnum<{
|
|
459
|
+
list: "list";
|
|
460
|
+
detail: "detail";
|
|
461
|
+
form: "form";
|
|
462
|
+
dashboard: "dashboard";
|
|
463
|
+
other: "other";
|
|
464
|
+
}>;
|
|
465
|
+
search: z.ZodOptional<z.ZodString>;
|
|
466
|
+
filters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
467
|
+
sort: z.ZodOptional<z.ZodString>;
|
|
468
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
469
|
+
selected: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
470
|
+
kind: z.ZodEnum<{
|
|
471
|
+
home: "home";
|
|
472
|
+
lot: "lot";
|
|
473
|
+
community: "community";
|
|
474
|
+
filing: "filing";
|
|
475
|
+
floorplan: "floorplan";
|
|
476
|
+
elevation: "elevation";
|
|
477
|
+
district: "district";
|
|
478
|
+
user: "user";
|
|
479
|
+
vendor: "vendor";
|
|
480
|
+
sign: "sign";
|
|
481
|
+
"slide-deck": "slide-deck";
|
|
482
|
+
survey: "survey";
|
|
483
|
+
workspace: "workspace";
|
|
484
|
+
walk: "walk";
|
|
485
|
+
permit: "permit";
|
|
486
|
+
incentive: "incentive";
|
|
487
|
+
}>;
|
|
488
|
+
id: z.ZodString;
|
|
489
|
+
label: z.ZodString;
|
|
490
|
+
path: z.ZodOptional<z.ZodString>;
|
|
491
|
+
}, z.core.$strip>>>;
|
|
492
|
+
dirty: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
493
|
+
}, z.core.$strip>>;
|
|
494
|
+
overlay: z.ZodOptional<z.ZodObject<{
|
|
495
|
+
kind: z.ZodEnum<{
|
|
496
|
+
dialog: "dialog";
|
|
497
|
+
drawer: "drawer";
|
|
498
|
+
}>;
|
|
499
|
+
title: z.ZodString;
|
|
500
|
+
record: z.ZodOptional<z.ZodObject<{
|
|
501
|
+
kind: z.ZodEnum<{
|
|
502
|
+
home: "home";
|
|
503
|
+
lot: "lot";
|
|
504
|
+
community: "community";
|
|
505
|
+
filing: "filing";
|
|
506
|
+
floorplan: "floorplan";
|
|
507
|
+
elevation: "elevation";
|
|
508
|
+
district: "district";
|
|
509
|
+
user: "user";
|
|
510
|
+
vendor: "vendor";
|
|
511
|
+
sign: "sign";
|
|
512
|
+
"slide-deck": "slide-deck";
|
|
513
|
+
survey: "survey";
|
|
514
|
+
workspace: "workspace";
|
|
515
|
+
walk: "walk";
|
|
516
|
+
permit: "permit";
|
|
517
|
+
incentive: "incentive";
|
|
518
|
+
}>;
|
|
519
|
+
id: z.ZodString;
|
|
520
|
+
label: z.ZodString;
|
|
521
|
+
path: z.ZodOptional<z.ZodString>;
|
|
522
|
+
}, z.core.$strip>>;
|
|
523
|
+
}, z.core.$strip>>;
|
|
524
|
+
recent: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
525
|
+
at: z.ZodISODateTime;
|
|
526
|
+
type: z.ZodEnum<{
|
|
527
|
+
filter: "filter";
|
|
528
|
+
navigate: "navigate";
|
|
529
|
+
tab: "tab";
|
|
530
|
+
select: "select";
|
|
531
|
+
save: "save";
|
|
532
|
+
open: "open";
|
|
533
|
+
close: "close";
|
|
534
|
+
}>;
|
|
535
|
+
label: z.ZodString;
|
|
536
|
+
record: z.ZodOptional<z.ZodObject<{
|
|
537
|
+
kind: z.ZodEnum<{
|
|
538
|
+
home: "home";
|
|
539
|
+
lot: "lot";
|
|
540
|
+
community: "community";
|
|
541
|
+
filing: "filing";
|
|
542
|
+
floorplan: "floorplan";
|
|
543
|
+
elevation: "elevation";
|
|
544
|
+
district: "district";
|
|
545
|
+
user: "user";
|
|
546
|
+
vendor: "vendor";
|
|
547
|
+
sign: "sign";
|
|
548
|
+
"slide-deck": "slide-deck";
|
|
549
|
+
survey: "survey";
|
|
550
|
+
workspace: "workspace";
|
|
551
|
+
walk: "walk";
|
|
552
|
+
permit: "permit";
|
|
553
|
+
incentive: "incentive";
|
|
554
|
+
}>;
|
|
555
|
+
id: z.ZodString;
|
|
556
|
+
label: z.ZodString;
|
|
557
|
+
path: z.ZodOptional<z.ZodString>;
|
|
558
|
+
}, z.core.$strip>>;
|
|
559
|
+
}, z.core.$strip>>>;
|
|
238
560
|
}, z.core.$strip>], "host">;
|
|
239
561
|
export type DocumentContext = z.infer<typeof DocumentContext>;
|
|
240
562
|
export type ExcelContext = z.infer<typeof ExcelContext>;
|
package/dist/context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,+EAA+E;AAC/E,eAAO,MAAM,SAAS,0EAKpB,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAElD,eAAO,MAAM,IAAI,kGAA8B,CAAC;AAChD,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,8DAA8D;AAC9D,eAAO,MAAM,SAAS,aAIK,CAAC;AAE5B,6DAA6D;AAC7D,eAAO,MAAM,SAAS,aAIyE,CAAC;AAEhG,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,SAAS,OAAO,EAAE,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAKxF;AAED,4EAA4E;AAC5E,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,SAAS,CAAC,SAAS,OAAO,EAAE,CAAC,EAAE,EACrC,OAAO,EAAE,MAAM,GACd,OAAO,CAIT;AAED,eAAO,MAAM,cAAc;;;;;iBAwBvB,CAAC;AACL,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D;;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AAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEtD,8FAA8F;AAC9F,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,WAAW,CAAC;AACvD,wBAAgB,eAAe,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,IAAI,aAAa,CAElF"}
|
package/dist/context.js
CHANGED
|
@@ -135,10 +135,48 @@ export const AgentContextTarget = z
|
|
|
135
135
|
message: 'at most one scope key',
|
|
136
136
|
});
|
|
137
137
|
const FactValue = z.union([z.string().max(LIMITS.appFactChars), z.number(), z.boolean(), z.null()]);
|
|
138
|
+
const filterText = z.string().max(LIMITS.appFilterChars);
|
|
138
139
|
/**
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
140
|
+
* What the page is showing right now, as the page itself describes it: the state of a list
|
|
141
|
+
* (search, filters, sort, selection) or a form (which fields have unsaved edits). Structured and
|
|
142
|
+
* page-chosen; never rows, and never unsaved values.
|
|
143
|
+
*/
|
|
144
|
+
export const AppView = z.object({
|
|
145
|
+
kind: z.enum(['list', 'detail', 'form', 'dashboard', 'other']),
|
|
146
|
+
search: filterText.optional(),
|
|
147
|
+
/** Active filters by display name, e.g. `{ Community: 'Monument Ridge' }`. */
|
|
148
|
+
filters: z
|
|
149
|
+
.record(z.string().min(1).max(40), filterText)
|
|
150
|
+
.refine((f) => Object.keys(f).length <= LIMITS.appFilters, {
|
|
151
|
+
message: `at most ${LIMITS.appFilters} filters`,
|
|
152
|
+
})
|
|
153
|
+
.optional(),
|
|
154
|
+
/** Display form, e.g. `Close date, descending`. */
|
|
155
|
+
sort: filterText.optional(),
|
|
156
|
+
/** Rows matching the current search and filters, when the page knows it. */
|
|
157
|
+
total: z.number().int().nonnegative().optional(),
|
|
158
|
+
selected: z.array(AppRecordRef).max(LIMITS.appSelected).optional(),
|
|
159
|
+
/** Display names of fields with unsaved edits. Names only. */
|
|
160
|
+
dirty: z.array(z.string().min(1).max(60)).max(LIMITS.appDirtyFields).optional(),
|
|
161
|
+
});
|
|
162
|
+
/** A dialog or drawer open above the page; when present it is what the user is focused on. */
|
|
163
|
+
export const AppOverlay = z.object({
|
|
164
|
+
kind: z.enum(['dialog', 'drawer']),
|
|
165
|
+
title: z.string().max(200),
|
|
166
|
+
record: AppRecordRef.optional(),
|
|
167
|
+
});
|
|
168
|
+
/** One recent user action on the app. A label, never a payload. */
|
|
169
|
+
export const AppActivity = z.object({
|
|
170
|
+
at: z.iso.datetime(),
|
|
171
|
+
type: z.enum(['navigate', 'tab', 'filter', 'select', 'save', 'open', 'close']),
|
|
172
|
+
label: z.string().min(1).max(LIMITS.appActivityLabelChars),
|
|
173
|
+
record: AppRecordRef.optional(),
|
|
174
|
+
});
|
|
175
|
+
/**
|
|
176
|
+
* Context a Classic App page attaches to a turn: where the user is, which record they are
|
|
177
|
+
* looking at, how the page is currently set up and what they just did. Sent per turn, only when
|
|
178
|
+
* the user keeps the context toggle on. Never the page's whole data set; `facts` are a
|
|
179
|
+
* page-chosen whitelist.
|
|
142
180
|
*/
|
|
143
181
|
export const AppContext = z.object({
|
|
144
182
|
host: z.literal('app'),
|
|
@@ -157,6 +195,12 @@ export const AppContext = z.object({
|
|
|
157
195
|
.optional(),
|
|
158
196
|
/** Text the user highlighted on the page, if any. */
|
|
159
197
|
selection: z.string().max(LIMITS.appSelectionChars).optional(),
|
|
198
|
+
/** Navigation trail to this page, outermost first, e.g. `['Sales', 'Homes']`. */
|
|
199
|
+
breadcrumb: z.array(z.string().min(1).max(80)).max(LIMITS.appBreadcrumbs).optional(),
|
|
200
|
+
view: AppView.optional(),
|
|
201
|
+
overlay: AppOverlay.optional(),
|
|
202
|
+
/** The user's latest actions, oldest first. Rides the same toggle as the rest. */
|
|
203
|
+
recent: z.array(AppActivity).max(LIMITS.appRecent).optional(),
|
|
160
204
|
});
|
|
161
205
|
/**
|
|
162
206
|
* Explicitly serialized context for one turn: an Office selection or a Classic App page.
|
package/dist/context.js.map
CHANGED
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CAAC,OAAwB;IACtD,OAAO,OAAO,CAAC,IAAI,KAAK,OAAO,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,CAAC;AAC7D,CAAC"}
|
package/dist/events.d.ts
CHANGED
|
@@ -142,8 +142,8 @@ export declare const ToolCallEvent: z.ZodObject<{
|
|
|
142
142
|
}, z.core.$strip>;
|
|
143
143
|
export declare const ToolResultStatus: z.ZodEnum<{
|
|
144
144
|
error: "error";
|
|
145
|
-
unauthenticated: "unauthenticated";
|
|
146
145
|
ok: "ok";
|
|
146
|
+
unauthenticated: "unauthenticated";
|
|
147
147
|
refused: "refused";
|
|
148
148
|
}>;
|
|
149
149
|
export type ToolResultStatus = z.infer<typeof ToolResultStatus>;
|
|
@@ -151,8 +151,8 @@ export declare const ToolResultEvent: z.ZodObject<{
|
|
|
151
151
|
callId: z.ZodString;
|
|
152
152
|
status: z.ZodEnum<{
|
|
153
153
|
error: "error";
|
|
154
|
-
unauthenticated: "unauthenticated";
|
|
155
154
|
ok: "ok";
|
|
155
|
+
unauthenticated: "unauthenticated";
|
|
156
156
|
refused: "refused";
|
|
157
157
|
}>;
|
|
158
158
|
durationMs: z.ZodNumber;
|
|
@@ -196,9 +196,9 @@ export type ArtifactMediaType = z.infer<typeof ArtifactMediaType>;
|
|
|
196
196
|
export declare const ArtifactEvent: z.ZodObject<{
|
|
197
197
|
artifactId: z.ZodString;
|
|
198
198
|
op: z.ZodEnum<{
|
|
199
|
-
delta: "delta";
|
|
200
199
|
open: "open";
|
|
201
200
|
close: "close";
|
|
201
|
+
delta: "delta";
|
|
202
202
|
}>;
|
|
203
203
|
mediaType: z.ZodOptional<z.ZodEnum<{
|
|
204
204
|
"text/markdown": "text/markdown";
|
|
@@ -259,9 +259,34 @@ export declare const UsageEvent: z.ZodObject<{
|
|
|
259
259
|
seq: z.ZodNumber;
|
|
260
260
|
type: z.ZodLiteral<"usage">;
|
|
261
261
|
}, z.core.$strip>;
|
|
262
|
+
/**
|
|
263
|
+
* The agent asked the client to run a read-only client tool against the live page. The client
|
|
264
|
+
* answers with `POST /api/chat/:requestId/client-result`; a client that does not know this event
|
|
265
|
+
* ignores it and the runtime times the call out. Sent only to clients that declared the
|
|
266
|
+
* matching capability.
|
|
267
|
+
*/
|
|
268
|
+
export declare const ClientCallEvent: z.ZodObject<{
|
|
269
|
+
callId: z.ZodString;
|
|
270
|
+
call: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
271
|
+
tool: z.ZodLiteral<"read_page">;
|
|
272
|
+
input: z.ZodObject<{
|
|
273
|
+
includeText: z.ZodOptional<z.ZodBoolean>;
|
|
274
|
+
}, z.core.$strip>;
|
|
275
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
276
|
+
tool: z.ZodLiteral<"read_selection">;
|
|
277
|
+
input: z.ZodObject<{}, z.core.$strip>;
|
|
278
|
+
}, z.core.$strip>], "tool">;
|
|
279
|
+
agent: z.ZodString;
|
|
280
|
+
runId: z.ZodString;
|
|
281
|
+
parentRunId: z.ZodOptional<z.ZodString>;
|
|
282
|
+
requestId: z.ZodUUID;
|
|
283
|
+
seq: z.ZodNumber;
|
|
284
|
+
type: z.ZodLiteral<"client_call">;
|
|
285
|
+
}, z.core.$strip>;
|
|
262
286
|
/**
|
|
263
287
|
* Streamed chat events. A well-formed stream is `start`, then any number of `delta`,
|
|
264
|
-
* `proposal`, `tool_call`, `tool_result`, `delegation`, `artifact`, `ui`, `file` and
|
|
288
|
+
* `proposal`, `tool_call`, `tool_result`, `delegation`, `artifact`, `ui`, `file`, `usage` and
|
|
289
|
+
* `client_call`,
|
|
265
290
|
* then optionally one `error`, then exactly one `done`.
|
|
266
291
|
*/
|
|
267
292
|
export declare const ChatEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -371,8 +396,8 @@ export declare const ChatEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
371
396
|
callId: z.ZodString;
|
|
372
397
|
status: z.ZodEnum<{
|
|
373
398
|
error: "error";
|
|
374
|
-
unauthenticated: "unauthenticated";
|
|
375
399
|
ok: "ok";
|
|
400
|
+
unauthenticated: "unauthenticated";
|
|
376
401
|
refused: "refused";
|
|
377
402
|
}>;
|
|
378
403
|
durationMs: z.ZodNumber;
|
|
@@ -400,9 +425,9 @@ export declare const ChatEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
400
425
|
}, z.core.$strip>, z.ZodObject<{
|
|
401
426
|
artifactId: z.ZodString;
|
|
402
427
|
op: z.ZodEnum<{
|
|
403
|
-
delta: "delta";
|
|
404
428
|
open: "open";
|
|
405
429
|
close: "close";
|
|
430
|
+
delta: "delta";
|
|
406
431
|
}>;
|
|
407
432
|
mediaType: z.ZodOptional<z.ZodEnum<{
|
|
408
433
|
"text/markdown": "text/markdown";
|
|
@@ -456,6 +481,23 @@ export declare const ChatEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
456
481
|
requestId: z.ZodUUID;
|
|
457
482
|
seq: z.ZodNumber;
|
|
458
483
|
type: z.ZodLiteral<"usage">;
|
|
484
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
485
|
+
callId: z.ZodString;
|
|
486
|
+
call: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
487
|
+
tool: z.ZodLiteral<"read_page">;
|
|
488
|
+
input: z.ZodObject<{
|
|
489
|
+
includeText: z.ZodOptional<z.ZodBoolean>;
|
|
490
|
+
}, z.core.$strip>;
|
|
491
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
492
|
+
tool: z.ZodLiteral<"read_selection">;
|
|
493
|
+
input: z.ZodObject<{}, z.core.$strip>;
|
|
494
|
+
}, z.core.$strip>], "tool">;
|
|
495
|
+
agent: z.ZodString;
|
|
496
|
+
runId: z.ZodString;
|
|
497
|
+
parentRunId: z.ZodOptional<z.ZodString>;
|
|
498
|
+
requestId: z.ZodUUID;
|
|
499
|
+
seq: z.ZodNumber;
|
|
500
|
+
type: z.ZodLiteral<"client_call">;
|
|
459
501
|
}, z.core.$strip>], "type">;
|
|
460
502
|
export type ChatEvent = z.infer<typeof ChatEvent>;
|
|
461
503
|
export type ChatEventType = ChatEvent['type'];
|
|
@@ -471,6 +513,7 @@ export type ArtifactEvent = z.infer<typeof ArtifactEvent>;
|
|
|
471
513
|
export type UiEvent = z.infer<typeof UiEvent>;
|
|
472
514
|
export type FileEvent = z.infer<typeof FileEvent>;
|
|
473
515
|
export type UsageEvent = z.infer<typeof UsageEvent>;
|
|
516
|
+
export type ClientCallEvent = z.infer<typeof ClientCallEvent>;
|
|
474
517
|
/** Event types every client must handle; the rest may be ignored by a client that cannot render them. */
|
|
475
518
|
export declare const CORE_EVENT_TYPES: readonly ["start", "delta", "proposal", "error", "done"];
|
|
476
519
|
/**
|
|
@@ -509,6 +552,7 @@ export declare const ApiError: z.ZodObject<{
|
|
|
509
552
|
}>;
|
|
510
553
|
message: z.ZodString;
|
|
511
554
|
correlationId: z.ZodOptional<z.ZodString>;
|
|
555
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
512
556
|
}, z.core.$strip>;
|
|
513
557
|
}, z.core.$strip>;
|
|
514
558
|
export type ApiError = z.infer<typeof ApiError>;
|
package/dist/events.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAKL,SAAS,EAGV,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAKL,SAAS,EAGV,MAAM,UAAU,CAAC;AAKlB,kFAAkF;AAClF,eAAO,MAAM,WAAW;;;EAA2B,CAAC;AACpD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC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AAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAC1D,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAC;AAC9C,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAClD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AACpD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D,yGAAyG;AACzG,eAAO,MAAM,gBAAgB,0DAMgB,CAAC;AAE9C;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;iBAA8D,CAAC;AACzF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAE1D,qFAAqF;AACrF,MAAM,MAAM,YAAY,GAAG;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,SAAS,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AACnG,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,YAAY,CAAC;AAExD,6DAA6D;AAC7D,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;iBAYnB,CAAC;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC"}
|
package/dist/events.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { AgentKey, ArtifactId, ConversationId, FileId, RequestId, RunId, ToolCallId, } from './ids.js';
|
|
3
|
+
import { ClientCall } from './client-tools.js';
|
|
3
4
|
import { LIMITS } from './limits.js';
|
|
4
5
|
import { ProposedOperation } from './operations.js';
|
|
5
6
|
/** Which backend produced a stream. `mock` must always be visible to the user. */
|
|
@@ -139,9 +140,22 @@ export const UsageEvent = z.object({
|
|
|
139
140
|
outputTokens: z.number().int().nonnegative(),
|
|
140
141
|
cacheReadTokens: z.number().int().nonnegative().optional(),
|
|
141
142
|
});
|
|
143
|
+
/**
|
|
144
|
+
* The agent asked the client to run a read-only client tool against the live page. The client
|
|
145
|
+
* answers with `POST /api/chat/:requestId/client-result`; a client that does not know this event
|
|
146
|
+
* ignores it and the runtime times the call out. Sent only to clients that declared the
|
|
147
|
+
* matching capability.
|
|
148
|
+
*/
|
|
149
|
+
export const ClientCallEvent = z.object({
|
|
150
|
+
type: z.literal('client_call'),
|
|
151
|
+
...scoped,
|
|
152
|
+
callId: ToolCallId,
|
|
153
|
+
call: ClientCall,
|
|
154
|
+
});
|
|
142
155
|
/**
|
|
143
156
|
* Streamed chat events. A well-formed stream is `start`, then any number of `delta`,
|
|
144
|
-
* `proposal`, `tool_call`, `tool_result`, `delegation`, `artifact`, `ui`, `file` and
|
|
157
|
+
* `proposal`, `tool_call`, `tool_result`, `delegation`, `artifact`, `ui`, `file`, `usage` and
|
|
158
|
+
* `client_call`,
|
|
145
159
|
* then optionally one `error`, then exactly one `done`.
|
|
146
160
|
*/
|
|
147
161
|
export const ChatEvent = z.discriminatedUnion('type', [
|
|
@@ -157,6 +171,7 @@ export const ChatEvent = z.discriminatedUnion('type', [
|
|
|
157
171
|
UiEvent,
|
|
158
172
|
FileEvent,
|
|
159
173
|
UsageEvent,
|
|
174
|
+
ClientCallEvent,
|
|
160
175
|
]);
|
|
161
176
|
/** Event types every client must handle; the rest may be ignored by a client that cannot render them. */
|
|
162
177
|
export const CORE_EVENT_TYPES = [
|
|
@@ -173,6 +188,16 @@ export const CORE_EVENT_TYPES = [
|
|
|
173
188
|
export const EventEnvelope = z.object({ type: z.string().min(1).max(64), ...eventBase });
|
|
174
189
|
/** Non-stream JSON error body used for 4xx/5xx responses. */
|
|
175
190
|
export const ApiError = z.object({
|
|
176
|
-
error: z.object({
|
|
191
|
+
error: z.object({
|
|
192
|
+
code: ErrorCode,
|
|
193
|
+
message: z.string(),
|
|
194
|
+
correlationId: z.string().optional(),
|
|
195
|
+
/**
|
|
196
|
+
* Native runtime: why a chat request was refused, beyond its code (e.g. `busy`,
|
|
197
|
+
* `agent_mismatch`, `not_latest_turn`, `not_continuable` with `bad_request`). Optional and
|
|
198
|
+
* open-ended: clients must treat an unknown or missing reason as the code alone.
|
|
199
|
+
*/
|
|
200
|
+
reason: z.string().optional(),
|
|
201
|
+
}),
|
|
177
202
|
});
|
|
178
203
|
//# sourceMappingURL=events.js.map
|