@cat-factory/contracts 0.348.0 → 0.350.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.
@@ -0,0 +1,419 @@
1
+ import * as v from 'valibot';
2
+ /**
3
+ * The actions the assistant can perform. CLOSED, and deliberately small.
4
+ *
5
+ * Each member is an operation the board already offers behind a form, so the assistant adds a
6
+ * way to ASK for it rather than a capability nobody could otherwise reach. Adding a member means
7
+ * adding its result variant below and its executor in the engine catalog, both of which fail to
8
+ * compile until they exist.
9
+ */
10
+ export declare const assistantActionIdSchema: v.PicklistSchema<["declare-service-dependency", "add-service-from-repo", "create-task-from-issue"], undefined>;
11
+ export type AssistantActionId = v.InferOutput<typeof assistantActionIdSchema>;
12
+ /** Every action the assistant knows, in the order the SPA lists them as suggestions. */
13
+ export declare const ASSISTANT_ACTION_IDS: readonly ["declare-service-dependency", "add-service-from-repo", "create-task-from-issue"];
14
+ /** A board service the turn touched: enough to name it and to link to it. */
15
+ export declare const assistantServiceRefSchema: v.ObjectSchema<{
16
+ /** The service FRAME's block id. */
17
+ readonly blockId: v.StringSchema<undefined>;
18
+ /** The frame's title, as it stands after the turn. */
19
+ readonly title: v.StringSchema<undefined>;
20
+ }, undefined>;
21
+ export type AssistantServiceRef = v.InferOutput<typeof assistantServiceRefSchema>;
22
+ /**
23
+ * A declared dependency edge.
24
+ *
25
+ * `created` is false when the edge was already on the board. The turn still SUCCEEDED (the board
26
+ * is in the state that was asked for), and saying so is what stops the SPA from reporting an
27
+ * idempotent re-declaration as a fresh one.
28
+ */
29
+ export declare const assistantDependencyDeclaredSchema: v.ObjectSchema<{
30
+ readonly actionId: v.LiteralSchema<"declare-service-dependency", undefined>;
31
+ /** The service that DEPENDS on the other (the edge is stored on this one). */
32
+ readonly consumer: v.ObjectSchema<{
33
+ /** The service FRAME's block id. */
34
+ readonly blockId: v.StringSchema<undefined>;
35
+ /** The frame's title, as it stands after the turn. */
36
+ readonly title: v.StringSchema<undefined>;
37
+ }, undefined>;
38
+ /** The service depended ON, spun up alongside the consumer when it is tested. */
39
+ readonly provider: v.ObjectSchema<{
40
+ /** The service FRAME's block id. */
41
+ readonly blockId: v.StringSchema<undefined>;
42
+ /** The frame's title, as it stands after the turn. */
43
+ readonly title: v.StringSchema<undefined>;
44
+ }, undefined>;
45
+ /** Whether this turn added the edge (false ⇒ it was already declared). */
46
+ readonly created: v.BooleanSchema<undefined>;
47
+ }, undefined>;
48
+ /**
49
+ * A service frame backed by a repository.
50
+ *
51
+ * `created` distinguishes a new frame from an existing account service this board now MOUNTS,
52
+ * the deduplication `addServiceFromRepo` performs for a whole-repo service the org already runs.
53
+ * The two are different facts about the board, and a caller told only "here is your service"
54
+ * would read the second as the first.
55
+ */
56
+ export declare const assistantServiceAddedSchema: v.ObjectSchema<{
57
+ readonly actionId: v.LiteralSchema<"add-service-from-repo", undefined>;
58
+ readonly service: v.ObjectSchema<{
59
+ /** The service FRAME's block id. */
60
+ readonly blockId: v.StringSchema<undefined>;
61
+ /** The frame's title, as it stands after the turn. */
62
+ readonly title: v.StringSchema<undefined>;
63
+ }, undefined>;
64
+ /** The repository the frame is backed by. */
65
+ readonly repo: v.ObjectSchema<{
66
+ readonly owner: v.StringSchema<undefined>;
67
+ readonly name: v.StringSchema<undefined>;
68
+ /** The monorepo subdirectory the service lives in, or null for a whole-repo service. */
69
+ readonly directory: v.NullableSchema<v.StringSchema<undefined>, undefined>;
70
+ }, undefined>;
71
+ /** Whether this turn created the frame (false ⇒ an existing org service was mounted here). */
72
+ readonly created: v.BooleanSchema<undefined>;
73
+ }, undefined>;
74
+ /** A board task filed from a tracker issue. */
75
+ export declare const assistantTaskCreatedSchema: v.ObjectSchema<{
76
+ readonly actionId: v.LiteralSchema<"create-task-from-issue", undefined>;
77
+ readonly task: v.ObjectSchema<{
78
+ readonly blockId: v.StringSchema<undefined>;
79
+ readonly title: v.StringSchema<undefined>;
80
+ }, undefined>;
81
+ /** The service frame the task was filed under. */
82
+ readonly service: v.ObjectSchema<{
83
+ /** The service FRAME's block id. */
84
+ readonly blockId: v.StringSchema<undefined>;
85
+ /** The frame's title, as it stands after the turn. */
86
+ readonly title: v.StringSchema<undefined>;
87
+ }, undefined>;
88
+ readonly issue: v.ObjectSchema<{
89
+ readonly source: v.UnionSchema<[v.PicklistSchema<readonly ["jira", "github", "linear", "gitlab"], undefined>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "Consumer id must be <namespace>:<name> (lowercase a-z0-9, dash-separated)">]>], undefined>;
90
+ /** The source's canonical key (`owner/repo#12`, `PROJ-7`). */
91
+ readonly externalId: v.StringSchema<undefined>;
92
+ readonly url: v.StringSchema<undefined>;
93
+ }, undefined>;
94
+ }, undefined>;
95
+ /** What a performed turn did, discriminated by the action that did it. */
96
+ export declare const assistantActionResultSchema: v.VariantSchema<"actionId", [v.ObjectSchema<{
97
+ readonly actionId: v.LiteralSchema<"declare-service-dependency", undefined>;
98
+ /** The service that DEPENDS on the other (the edge is stored on this one). */
99
+ readonly consumer: v.ObjectSchema<{
100
+ /** The service FRAME's block id. */
101
+ readonly blockId: v.StringSchema<undefined>;
102
+ /** The frame's title, as it stands after the turn. */
103
+ readonly title: v.StringSchema<undefined>;
104
+ }, undefined>;
105
+ /** The service depended ON, spun up alongside the consumer when it is tested. */
106
+ readonly provider: v.ObjectSchema<{
107
+ /** The service FRAME's block id. */
108
+ readonly blockId: v.StringSchema<undefined>;
109
+ /** The frame's title, as it stands after the turn. */
110
+ readonly title: v.StringSchema<undefined>;
111
+ }, undefined>;
112
+ /** Whether this turn added the edge (false ⇒ it was already declared). */
113
+ readonly created: v.BooleanSchema<undefined>;
114
+ }, undefined>, v.ObjectSchema<{
115
+ readonly actionId: v.LiteralSchema<"add-service-from-repo", undefined>;
116
+ readonly service: v.ObjectSchema<{
117
+ /** The service FRAME's block id. */
118
+ readonly blockId: v.StringSchema<undefined>;
119
+ /** The frame's title, as it stands after the turn. */
120
+ readonly title: v.StringSchema<undefined>;
121
+ }, undefined>;
122
+ /** The repository the frame is backed by. */
123
+ readonly repo: v.ObjectSchema<{
124
+ readonly owner: v.StringSchema<undefined>;
125
+ readonly name: v.StringSchema<undefined>;
126
+ /** The monorepo subdirectory the service lives in, or null for a whole-repo service. */
127
+ readonly directory: v.NullableSchema<v.StringSchema<undefined>, undefined>;
128
+ }, undefined>;
129
+ /** Whether this turn created the frame (false ⇒ an existing org service was mounted here). */
130
+ readonly created: v.BooleanSchema<undefined>;
131
+ }, undefined>, v.ObjectSchema<{
132
+ readonly actionId: v.LiteralSchema<"create-task-from-issue", undefined>;
133
+ readonly task: v.ObjectSchema<{
134
+ readonly blockId: v.StringSchema<undefined>;
135
+ readonly title: v.StringSchema<undefined>;
136
+ }, undefined>;
137
+ /** The service frame the task was filed under. */
138
+ readonly service: v.ObjectSchema<{
139
+ /** The service FRAME's block id. */
140
+ readonly blockId: v.StringSchema<undefined>;
141
+ /** The frame's title, as it stands after the turn. */
142
+ readonly title: v.StringSchema<undefined>;
143
+ }, undefined>;
144
+ readonly issue: v.ObjectSchema<{
145
+ readonly source: v.UnionSchema<[v.PicklistSchema<readonly ["jira", "github", "linear", "gitlab"], undefined>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "Consumer id must be <namespace>:<name> (lowercase a-z0-9, dash-separated)">]>], undefined>;
146
+ /** The source's canonical key (`owner/repo#12`, `PROJ-7`). */
147
+ readonly externalId: v.StringSchema<undefined>;
148
+ readonly url: v.StringSchema<undefined>;
149
+ }, undefined>;
150
+ }, undefined>], undefined>;
151
+ export type AssistantActionResult = v.InferOutput<typeof assistantActionResultSchema>;
152
+ /**
153
+ * Why the platform could not resolve one argument to something on the board.
154
+ *
155
+ * Each member names a DIFFERENT next move for the person, which is why they are not one
156
+ * "could not resolve" value: an unknown name is retyped, an ambiguous one is picked from the
157
+ * candidates, a missing argument is supplied, and an unconnected repository or tracker is a trip
158
+ * to the integrations panel before the same sentence works.
159
+ */
160
+ export declare const assistantClarificationReasonSchema: v.PicklistSchema<["missing_argument", "invalid_argument", "unknown_service", "ambiguous_service", "unknown_repository", "unreadable_repository_url", "unknown_issue_source", "ambiguous_issue_source", "unresolved_issue_service"], undefined>;
161
+ export type AssistantClarificationReason = v.InferOutput<typeof assistantClarificationReasonSchema>;
162
+ /**
163
+ * One action's arguments on the wire: declared keys, string values.
164
+ *
165
+ * Capped per value at the same length as a prompt, because they come back INTO the platform when a
166
+ * clarification is answered, and an unbounded value there would be a bigger input than the sentence
167
+ * that produced it.
168
+ */
169
+ export declare const assistantArgumentsSchema: v.RecordSchema<v.StringSchema<undefined>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>]>, undefined>;
170
+ export type AssistantArguments = v.InferOutput<typeof assistantArgumentsSchema>;
171
+ /** Why no action ran at all. */
172
+ export declare const assistantDeclineReasonSchema: v.PicklistSchema<["no_matching_action"], undefined>;
173
+ export type AssistantDeclineReason = v.InferOutput<typeof assistantDeclineReasonSchema>;
174
+ /**
175
+ * The outcome of one turn.
176
+ *
177
+ * `needs_input` carries the action it was HEADING for, so the SPA can say what it was about to do
178
+ * rather than only what it could not find, and `candidates` is the shortlist the platform was
179
+ * choosing between (empty when there was nothing to choose from, since an unknown name has no
180
+ * near-misses to offer).
181
+ */
182
+ export declare const assistantOutcomeSchema: v.VariantSchema<"status", [v.ObjectSchema<{
183
+ readonly status: v.LiteralSchema<"performed", undefined>;
184
+ readonly result: v.VariantSchema<"actionId", [v.ObjectSchema<{
185
+ readonly actionId: v.LiteralSchema<"declare-service-dependency", undefined>;
186
+ /** The service that DEPENDS on the other (the edge is stored on this one). */
187
+ readonly consumer: v.ObjectSchema<{
188
+ /** The service FRAME's block id. */
189
+ readonly blockId: v.StringSchema<undefined>;
190
+ /** The frame's title, as it stands after the turn. */
191
+ readonly title: v.StringSchema<undefined>;
192
+ }, undefined>;
193
+ /** The service depended ON, spun up alongside the consumer when it is tested. */
194
+ readonly provider: v.ObjectSchema<{
195
+ /** The service FRAME's block id. */
196
+ readonly blockId: v.StringSchema<undefined>;
197
+ /** The frame's title, as it stands after the turn. */
198
+ readonly title: v.StringSchema<undefined>;
199
+ }, undefined>;
200
+ /** Whether this turn added the edge (false ⇒ it was already declared). */
201
+ readonly created: v.BooleanSchema<undefined>;
202
+ }, undefined>, v.ObjectSchema<{
203
+ readonly actionId: v.LiteralSchema<"add-service-from-repo", undefined>;
204
+ readonly service: v.ObjectSchema<{
205
+ /** The service FRAME's block id. */
206
+ readonly blockId: v.StringSchema<undefined>;
207
+ /** The frame's title, as it stands after the turn. */
208
+ readonly title: v.StringSchema<undefined>;
209
+ }, undefined>;
210
+ /** The repository the frame is backed by. */
211
+ readonly repo: v.ObjectSchema<{
212
+ readonly owner: v.StringSchema<undefined>;
213
+ readonly name: v.StringSchema<undefined>;
214
+ /** The monorepo subdirectory the service lives in, or null for a whole-repo service. */
215
+ readonly directory: v.NullableSchema<v.StringSchema<undefined>, undefined>;
216
+ }, undefined>;
217
+ /** Whether this turn created the frame (false ⇒ an existing org service was mounted here). */
218
+ readonly created: v.BooleanSchema<undefined>;
219
+ }, undefined>, v.ObjectSchema<{
220
+ readonly actionId: v.LiteralSchema<"create-task-from-issue", undefined>;
221
+ readonly task: v.ObjectSchema<{
222
+ readonly blockId: v.StringSchema<undefined>;
223
+ readonly title: v.StringSchema<undefined>;
224
+ }, undefined>;
225
+ /** The service frame the task was filed under. */
226
+ readonly service: v.ObjectSchema<{
227
+ /** The service FRAME's block id. */
228
+ readonly blockId: v.StringSchema<undefined>;
229
+ /** The frame's title, as it stands after the turn. */
230
+ readonly title: v.StringSchema<undefined>;
231
+ }, undefined>;
232
+ readonly issue: v.ObjectSchema<{
233
+ readonly source: v.UnionSchema<[v.PicklistSchema<readonly ["jira", "github", "linear", "gitlab"], undefined>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "Consumer id must be <namespace>:<name> (lowercase a-z0-9, dash-separated)">]>], undefined>;
234
+ /** The source's canonical key (`owner/repo#12`, `PROJ-7`). */
235
+ readonly externalId: v.StringSchema<undefined>;
236
+ readonly url: v.StringSchema<undefined>;
237
+ }, undefined>;
238
+ }, undefined>], undefined>;
239
+ }, undefined>, v.ObjectSchema<{
240
+ readonly status: v.LiteralSchema<"needs_input", undefined>;
241
+ readonly actionId: v.PicklistSchema<["declare-service-dependency", "add-service-from-repo", "create-task-from-issue"], undefined>;
242
+ readonly reason: v.PicklistSchema<["missing_argument", "invalid_argument", "unknown_service", "ambiguous_service", "unknown_repository", "unreadable_repository_url", "unknown_issue_source", "ambiguous_issue_source", "unresolved_issue_service"], undefined>;
243
+ /** The argument key that could not be resolved (`consumer`, `repoUrl`, `source`, …). */
244
+ readonly field: v.StringSchema<undefined>;
245
+ /**
246
+ * What the platform was choosing between, at most a handful. Empty ⇒ nothing matched.
247
+ *
248
+ * Every entry is a legal VALUE for {@link field}, not a label describing one, because the
249
+ * clarification is answered by putting a candidate in that field (see
250
+ * {@link assistantAnswerSchema}). An action offering a candidate its own next turn would
251
+ * refuse is a question with no acceptable answer, which is why the near-misses an unknown
252
+ * repository reports are `owner/name` slugs and the trackers an ambiguous reference reports
253
+ * are source ids.
254
+ */
255
+ readonly candidates: v.ArraySchema<v.StringSchema<undefined>, undefined>;
256
+ /**
257
+ * The arguments the turn resolved, so the answer can be a RESUMPTION rather than a retyped
258
+ * sentence. Declared keys only, already validated, and the person's own words either way.
259
+ */
260
+ readonly arguments: v.RecordSchema<v.StringSchema<undefined>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>]>, undefined>;
261
+ }, undefined>, v.ObjectSchema<{
262
+ readonly status: v.LiteralSchema<"declined", undefined>;
263
+ readonly reason: v.PicklistSchema<["no_matching_action"], undefined>;
264
+ }, undefined>], undefined>;
265
+ export type AssistantOutcome = v.InferOutput<typeof assistantOutcomeSchema>;
266
+ /** One turn: what the platform did, and which model read the prompt to decide it. */
267
+ export declare const assistantTurnSchema: v.ObjectSchema<{
268
+ readonly outcome: v.VariantSchema<"status", [v.ObjectSchema<{
269
+ readonly status: v.LiteralSchema<"performed", undefined>;
270
+ readonly result: v.VariantSchema<"actionId", [v.ObjectSchema<{
271
+ readonly actionId: v.LiteralSchema<"declare-service-dependency", undefined>;
272
+ /** The service that DEPENDS on the other (the edge is stored on this one). */
273
+ readonly consumer: v.ObjectSchema<{
274
+ /** The service FRAME's block id. */
275
+ readonly blockId: v.StringSchema<undefined>;
276
+ /** The frame's title, as it stands after the turn. */
277
+ readonly title: v.StringSchema<undefined>;
278
+ }, undefined>;
279
+ /** The service depended ON, spun up alongside the consumer when it is tested. */
280
+ readonly provider: v.ObjectSchema<{
281
+ /** The service FRAME's block id. */
282
+ readonly blockId: v.StringSchema<undefined>;
283
+ /** The frame's title, as it stands after the turn. */
284
+ readonly title: v.StringSchema<undefined>;
285
+ }, undefined>;
286
+ /** Whether this turn added the edge (false ⇒ it was already declared). */
287
+ readonly created: v.BooleanSchema<undefined>;
288
+ }, undefined>, v.ObjectSchema<{
289
+ readonly actionId: v.LiteralSchema<"add-service-from-repo", undefined>;
290
+ readonly service: v.ObjectSchema<{
291
+ /** The service FRAME's block id. */
292
+ readonly blockId: v.StringSchema<undefined>;
293
+ /** The frame's title, as it stands after the turn. */
294
+ readonly title: v.StringSchema<undefined>;
295
+ }, undefined>;
296
+ /** The repository the frame is backed by. */
297
+ readonly repo: v.ObjectSchema<{
298
+ readonly owner: v.StringSchema<undefined>;
299
+ readonly name: v.StringSchema<undefined>;
300
+ /** The monorepo subdirectory the service lives in, or null for a whole-repo service. */
301
+ readonly directory: v.NullableSchema<v.StringSchema<undefined>, undefined>;
302
+ }, undefined>;
303
+ /** Whether this turn created the frame (false ⇒ an existing org service was mounted here). */
304
+ readonly created: v.BooleanSchema<undefined>;
305
+ }, undefined>, v.ObjectSchema<{
306
+ readonly actionId: v.LiteralSchema<"create-task-from-issue", undefined>;
307
+ readonly task: v.ObjectSchema<{
308
+ readonly blockId: v.StringSchema<undefined>;
309
+ readonly title: v.StringSchema<undefined>;
310
+ }, undefined>;
311
+ /** The service frame the task was filed under. */
312
+ readonly service: v.ObjectSchema<{
313
+ /** The service FRAME's block id. */
314
+ readonly blockId: v.StringSchema<undefined>;
315
+ /** The frame's title, as it stands after the turn. */
316
+ readonly title: v.StringSchema<undefined>;
317
+ }, undefined>;
318
+ readonly issue: v.ObjectSchema<{
319
+ readonly source: v.UnionSchema<[v.PicklistSchema<readonly ["jira", "github", "linear", "gitlab"], undefined>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "Consumer id must be <namespace>:<name> (lowercase a-z0-9, dash-separated)">]>], undefined>;
320
+ /** The source's canonical key (`owner/repo#12`, `PROJ-7`). */
321
+ readonly externalId: v.StringSchema<undefined>;
322
+ readonly url: v.StringSchema<undefined>;
323
+ }, undefined>;
324
+ }, undefined>], undefined>;
325
+ }, undefined>, v.ObjectSchema<{
326
+ readonly status: v.LiteralSchema<"needs_input", undefined>;
327
+ readonly actionId: v.PicklistSchema<["declare-service-dependency", "add-service-from-repo", "create-task-from-issue"], undefined>;
328
+ readonly reason: v.PicklistSchema<["missing_argument", "invalid_argument", "unknown_service", "ambiguous_service", "unknown_repository", "unreadable_repository_url", "unknown_issue_source", "ambiguous_issue_source", "unresolved_issue_service"], undefined>;
329
+ /** The argument key that could not be resolved (`consumer`, `repoUrl`, `source`, …). */
330
+ readonly field: v.StringSchema<undefined>;
331
+ /**
332
+ * What the platform was choosing between, at most a handful. Empty ⇒ nothing matched.
333
+ *
334
+ * Every entry is a legal VALUE for {@link field}, not a label describing one, because the
335
+ * clarification is answered by putting a candidate in that field (see
336
+ * {@link assistantAnswerSchema}). An action offering a candidate its own next turn would
337
+ * refuse is a question with no acceptable answer, which is why the near-misses an unknown
338
+ * repository reports are `owner/name` slugs and the trackers an ambiguous reference reports
339
+ * are source ids.
340
+ */
341
+ readonly candidates: v.ArraySchema<v.StringSchema<undefined>, undefined>;
342
+ /**
343
+ * The arguments the turn resolved, so the answer can be a RESUMPTION rather than a retyped
344
+ * sentence. Declared keys only, already validated, and the person's own words either way.
345
+ */
346
+ readonly arguments: v.RecordSchema<v.StringSchema<undefined>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>]>, undefined>;
347
+ }, undefined>, v.ObjectSchema<{
348
+ readonly status: v.LiteralSchema<"declined", undefined>;
349
+ readonly reason: v.PicklistSchema<["no_matching_action"], undefined>;
350
+ }, undefined>], undefined>;
351
+ /**
352
+ * The model that chose the action, so a turn can be traced to the route that produced it.
353
+ *
354
+ * NULL for an ANSWERED clarification, which runs no model at all. Reporting the model the
355
+ * previous turn used would attribute a deterministic re-run to a call that never happened, and
356
+ * an absent value is the only honest way to say a turn spent nothing.
357
+ */
358
+ readonly model: v.NullableSchema<v.ObjectSchema<{
359
+ readonly provider: v.StringSchema<undefined>;
360
+ readonly model: v.StringSchema<undefined>;
361
+ }, undefined>, undefined>;
362
+ }, undefined>;
363
+ export type AssistantTurn = v.InferOutput<typeof assistantTurnSchema>;
364
+ /**
365
+ * Answering a question a previous turn asked, as DATA rather than as more prose.
366
+ *
367
+ * This is what makes a clarification terminate. The alternative the surface started with was to
368
+ * append the chosen candidate to the sentence and route it through the model again, and that
369
+ * cannot converge: the original words are still in the prompt (a repository under the wrong owner
370
+ * stays there beside the right one), and a candidate the model has no declared argument to put it
371
+ * in is simply dropped. Re-running the same action with the same arguments and the one field
372
+ * replaced is exact, terminates in one step, and bills nothing.
373
+ *
374
+ * It grants no authority the prompt path does not. The arguments are re-validated by the same
375
+ * descriptor rules, undeclared keys are dropped exactly as they are for a model's reply, every
376
+ * name is re-resolved against the board, and the action is the same one a button performs under
377
+ * the caller's own tier.
378
+ */
379
+ export declare const assistantAnswerSchema: v.ObjectSchema<{
380
+ /** The action the question was asked on behalf of, as its outcome named it. */
381
+ readonly actionId: v.PicklistSchema<["declare-service-dependency", "add-service-from-repo", "create-task-from-issue"], undefined>;
382
+ /** That turn's arguments, with the answered field replaced by the value the person chose. */
383
+ readonly arguments: v.RecordSchema<v.StringSchema<undefined>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>]>, undefined>;
384
+ }, undefined>;
385
+ export type AssistantAnswer = v.InferOutput<typeof assistantAnswerSchema>;
386
+ /**
387
+ * What a turn runs on: a sentence to route, or the answer to the question the last one asked.
388
+ *
389
+ * Discriminated rather than "a prompt plus an optional answer", because the two share no field: an
390
+ * answered turn has no sentence to read and never reaches a model, and a shape carrying a required
391
+ * prompt beside it would make every answer invent one.
392
+ */
393
+ export declare const assistantTurnInputSchema: v.VariantSchema<"kind", [v.ObjectSchema<{
394
+ readonly kind: v.LiteralSchema<"prompt", undefined>;
395
+ readonly prompt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
396
+ }, undefined>, v.ObjectSchema<{
397
+ readonly kind: v.LiteralSchema<"answer", undefined>;
398
+ readonly answer: v.ObjectSchema<{
399
+ /** The action the question was asked on behalf of, as its outcome named it. */
400
+ readonly actionId: v.PicklistSchema<["declare-service-dependency", "add-service-from-repo", "create-task-from-issue"], undefined>;
401
+ /** That turn's arguments, with the answered field replaced by the value the person chose. */
402
+ readonly arguments: v.RecordSchema<v.StringSchema<undefined>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>]>, undefined>;
403
+ }, undefined>;
404
+ }, undefined>], undefined>;
405
+ export type AssistantTurnInput = v.InferOutput<typeof assistantTurnInputSchema>;
406
+ /**
407
+ * What this deployment's assistant can do, read before the prompt box is offered.
408
+ *
409
+ * `available` is about the MODEL, not about permissions: a deployment that wired no provider
410
+ * cannot answer a prompt, and hiding the box is a better answer than a 503 on every submission.
411
+ * The action list is published rather than assumed so a deployment that narrows the catalog
412
+ * narrows the suggestions with it, instead of advertising an action the engine would decline.
413
+ */
414
+ export declare const assistantCapabilitySchema: v.ObjectSchema<{
415
+ readonly available: v.BooleanSchema<undefined>;
416
+ readonly actions: v.ArraySchema<v.PicklistSchema<["declare-service-dependency", "add-service-from-repo", "create-task-from-issue"], undefined>, undefined>;
417
+ }, undefined>;
418
+ export type AssistantCapability = v.InferOutput<typeof assistantCapabilitySchema>;
419
+ //# sourceMappingURL=assistant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assistant.d.ts","sourceRoot":"","sources":["../src/assistant.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAqC5B;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,gHAOlC,CAAA;AACF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAE7E,wFAAwF;AACxF,eAAO,MAAM,oBAAoB,4FAIgB,CAAA;AAEjD,6EAA6E;AAC7E,eAAO,MAAM,yBAAyB;IACpC,oCAAoC;;IAEpC,sDAAsD;;aAEtD,CAAA;AACF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAIjF;;;;;;GAMG;AACH,eAAO,MAAM,iCAAiC;;IAE5C,8EAA8E;;QAlB9E,oCAAoC;;QAEpC,sDAAsD;;;IAkBtD,iFAAiF;;QApBjF,oCAAoC;;QAEpC,sDAAsD;;;IAoBtD,0EAA0E;;aAE1E,CAAA;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,2BAA2B;;;QAlCtC,oCAAoC;;QAEpC,sDAAsD;;;IAmCtD,6CAA6C;;;;QAI3C,wFAAwF;;;IAG1F,8FAA8F;;aAE9F,CAAA;AAEF,+CAA+C;AAC/C,eAAO,MAAM,0BAA0B;;;;;;IAGrC,kDAAkD;;QApDlD,oCAAoC;;QAEpC,sDAAsD;;;;;QAsDpD,8DAA8D;;;;aAIhE,CAAA;AAEF,0EAA0E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