@crossworks/client-types 0.700.2 → 0.702.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crossworks/client-types",
3
- "version": "0.700.2",
3
+ "version": "0.702.0",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -15,8 +15,10 @@
15
15
  *
16
16
  * A pipeline is a built-in or an own one (`source`). A reader reads a file into its database; an
17
17
  * `after` pipeline adds tabs to a database a reader made; a router names the
18
- * kind of a file, and the reader that claims the kind reads it. The counts
19
- * are numbers only: no file name and no id.
18
+ * kind of a file, and the reader that claims the kind reads it. An agent
19
+ * asks an AI model about a file, and the core writes its
20
+ * answers into one tab of the file's database. The counts are numbers only:
21
+ * no file name and no id.
20
22
  */
21
23
 
22
24
  /** One option, as a manifest declares it. A copy of the contract's type
@@ -63,8 +65,11 @@ export type PipelineRow = {
63
65
  * database; a router names the kind of a file and writes no tabs. A
64
66
  * router has no options, no workspace list, no run and no re-read. A
65
67
  * later server may add a word: show an unknown one as a plain row.
66
- * People read `after` as Transformer. */
67
- kind: 'reader' | 'after' | 'router';
68
+ * People read `after` as Transformer. An `agent` asks an AI model about
69
+ * a file and the core writes its answers into one tab: it runs after a
70
+ * file's upload and on demand (the run on a file or a folder), and it
71
+ * has no re-read of the whole box. */
72
+ kind: 'reader' | 'after' | 'router' | 'agent';
68
73
  /** The file extensions it reads (a router: the file types it names a
69
74
  * kind for). */
70
75
  reads: string[];
@@ -81,6 +86,17 @@ export type PipelineRow = {
81
86
  shapes: string[];
82
87
  /** The AI worker kinds it may ask. */
83
88
  workers: string[];
89
+ /** The most asks of each AI worker for one file. Empty for a pipeline
90
+ * that asks nothing. A server before this field sends none: read a
91
+ * missing one as empty. */
92
+ asks?: { worker: string; max: number }[];
93
+ /** An agent: the paid asks of all agents of this box in the last 24
94
+ * hours, and the most the box allows in 24 hours (`dayCap`). At the cap
95
+ * no agent asks until the count falls. Null for a pipeline that is no
96
+ * agent; missing from a server before these fields, and on the row a
97
+ * set or an install gives back. */
98
+ asksToday?: number | null;
99
+ dayCap?: number | null;
84
100
  /** The brain tools it may call. */
85
101
  tools: string[];
86
102
  /** Always 'all' since the server of milestone WO: a pipeline is on in
@@ -92,7 +108,7 @@ export type PipelineRow = {
92
108
  offIn: string[];
93
109
  /** For an `after` pipeline: the shape it reads. Null for a reader. */
94
110
  after: string | null;
95
- /** The tabs an `after` pipeline writes. */
111
+ /** The tabs an `after` pipeline writes; the one tab of an agent. */
96
112
  tabs: string[];
97
113
  /** Each declared option, its spec, and the value in force on this box. */
98
114
  options: { name: string; spec: PipelineOptionSpec; value: unknown }[];
@@ -153,7 +169,7 @@ export type PipelineSetBody = {
153
169
  };
154
170
 
155
171
  /** Why a run on demand did not take a file: the extension or the tabs do
156
- * not match, no database for an `after` pipeline, `not-attached`: the
172
+ * not match, no database for an `after` pipeline or an agent, `not-attached`: the
157
173
  * pipeline is off in the file's home workspace (the word is older than
158
174
  * the off list, and stays), no checksum, a private file, or the reader of a
159
175
  * PDF drawing: `pdf`, which no server gives since MV5 (the word stays).
@@ -195,8 +211,18 @@ export type PipelineRunAnswer = {
195
211
  busy: boolean;
196
212
  /** The pipelines that can run on these files, with the count each takes.
197
213
  * `refused`: always null since MV5 (the field stays; an older server
198
- * gave 'pdf' for the reader of a PDF drawing). */
199
- choices: { pipeline: string; name: string; files: number; refused: string | null }[];
214
+ * gave 'pdf' for the reader of a PDF drawing). `asksMax`: for an agent,
215
+ * the most paid asks of an AI model a run of these files can make (the
216
+ * files times the most asks for one file); a file asked before pays
217
+ * nothing again. Null for a pipeline that asks no model; missing from a
218
+ * server before this field. */
219
+ choices: {
220
+ pipeline: string;
221
+ name: string;
222
+ files: number;
223
+ refused: string | null;
224
+ asksMax?: number | null;
225
+ }[];
200
226
  /** The files queued. Each one's stamp shows the run when it is done. */
201
227
  queued: number;
202
228
  /** The files the named pipeline does not take, by PipelineRunSkip word. */
@@ -255,6 +281,22 @@ export type PipelineTestResult = {
255
281
  warnings: string[];
256
282
  /** The calls it would make, shown and not done. For a built-in: ['file_tabs_write']. */
257
283
  writes: string[];
284
+ /** An agent: what it would ask an AI model about this file, shown and
285
+ * not asked. For each ask its key, the worker, the field names, and the
286
+ * picture's size in bytes and its type. Missing for any other pipeline,
287
+ * and from a server before this field. */
288
+ asks?: {
289
+ key: string;
290
+ worker: string;
291
+ fields: string[];
292
+ bytes: number;
293
+ mime: string;
294
+ /** The ask wants the list part too (docs/pipelines.md, "The list part
295
+ * of an ask"), and the page of its picture. Missing: no list part, no
296
+ * page, or a server before them. */
297
+ list?: true;
298
+ page?: number;
299
+ }[];
258
300
  /** A Reader that gives a file's text (an own Reader with `produces.text`,
259
301
  * for a format the core has no text reader for): the length of the text
260
302
  * its run gave, in characters. Missing for any other pipeline, and from