@instruments/materialgraph 0.24.0 → 0.26.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/association-types.d.ts +20 -20
- package/associations-client.d.ts +4 -4
- package/associations-client.js +3 -10
- package/attribution-types.d.ts +3 -3
- package/brand-most-sampled-types.d.ts +4 -4
- package/brand-types.d.ts +6 -6
- package/brands-client.d.ts +4 -4
- package/brands-client.js +9 -13
- package/browse-types.d.ts +8 -8
- package/by-colour-types.d.ts +18 -18
- package/by-spec-types.d.ts +14 -14
- package/catalog-discovery-types.d.ts +14 -14
- package/catalogue-client.d.ts +4 -4
- package/catalogue-client.js +38 -37
- package/catalogue-types.d.ts +4 -4
- package/citation-types.d.ts +4 -4
- package/client-browse.d.ts +4 -4
- package/client-browse.js +24 -25
- package/client-config.d.ts +2 -2
- package/client-exploration.d.ts +3 -3
- package/client-exploration.js +4 -6
- package/client-source-material-comments.d.ts +4 -4
- package/client-source-material-comments.js +4 -38
- package/client-vocabulary.d.ts +8 -8
- package/client-vocabulary.js +20 -30
- package/client.d.ts +11 -45
- package/client.js +143 -188
- package/codes-client.d.ts +2 -2
- package/codes-client.js +8 -8
- package/codes-types.d.ts +34 -34
- package/colour-aggregate-types.d.ts +24 -24
- package/colours-client.d.ts +2 -2
- package/colours-client.js +15 -15
- package/compare-types.d.ts +10 -10
- package/composition-client.d.ts +3 -3
- package/composition-client.js +8 -7
- package/composition-types.d.ts +12 -12
- package/coordinate-client.d.ts +2 -2
- package/coordinate-client.js +1 -13
- package/corpus-scope-types.d.ts +3 -3
- package/corpus-scope-types.js +1 -25
- package/correction-types.d.ts +10 -10
- package/demand-batch-types.d.ts +18 -18
- package/demand-types.d.ts +24 -24
- package/errors.d.ts +12 -12
- package/errors.js +53 -52
- package/exploration-types.d.ts +29 -22
- package/fan-deck-types.d.ts +6 -6
- package/http-transport.d.ts +13 -21
- package/http-transport.js +31 -28
- package/identify-types.d.ts +10 -10
- package/index.d.ts +0 -6
- package/index.js +0 -2
- package/match-rejection-types.d.ts +6 -6
- package/match-stream-types.d.ts +32 -32
- package/match-stream.d.ts +2 -2
- package/match-stream.js +55 -41
- package/match-types.d.ts +8 -8
- package/material-asset-types.d.ts +26 -26
- package/material-block-types.d.ts +6 -6
- package/material-query-plan-types.d.ts +26 -26
- package/material-resources-client.d.ts +5 -5
- package/material-resources-client.js +10 -20
- package/material-types.d.ts +12 -12
- package/ndjson.js +16 -8
- package/operations.d.ts +6 -6
- package/operations.js +9 -39
- package/package.json +2 -2
- package/palette-completion-types.d.ts +22 -22
- package/palette-search-types.d.ts +28 -28
- package/query-understanding-types.d.ts +43 -36
- package/render-assets-types.d.ts +8 -8
- package/resolve-client.d.ts +2 -2
- package/resolve-client.js +4 -6
- package/resolve-colour-types.d.ts +22 -6
- package/resolve-types.d.ts +10 -10
- package/run-types.d.ts +70 -70
- package/runs.d.ts +13 -26
- package/runs.js +77 -89
- package/samplize-catalogue-types.d.ts +18 -18
- package/samplize-colorvec.d.ts +20 -20
- package/samplize-colorvec.js +66 -42
- package/schema-resource-types.d.ts +38 -38
- package/schema-resource-types.js +5 -5
- package/search-card-types.d.ts +14 -5
- package/search-collapse-types.d.ts +4 -4
- package/search-mood-types.d.ts +2 -2
- package/search-refinement-types.d.ts +8 -8
- package/search-request-types.d.ts +6 -6
- package/search-response-receipt-types.d.ts +135 -34
- package/search-response-types.d.ts +2 -2
- package/search-result-validation.d.ts +3 -3
- package/search-result-validation.js +53 -36
- package/search-window-types.d.ts +2 -2
- package/slot-pool-types.d.ts +20 -20
- package/source-material-validation.d.ts +3 -3
- package/source-material-validation.js +35 -39
- package/spec-facet-types.d.ts +10 -10
- package/spec-types.d.ts +6 -6
- package/specifications.d.ts +9 -25
- package/specifications.js +15 -21
- package/sse.d.ts +2 -2
- package/sse.js +32 -16
- package/substitute-types.d.ts +22 -22
- package/suggest-types.d.ts +7 -7
- package/suggest-types.js +3 -3
- package/taxonomy-coverage-types.d.ts +8 -8
- package/types.d.ts +119 -119
- package/validation.d.ts +26 -26
- package/validation.js +97 -92
- package/webmcp.d.ts +2 -2
- package/webmcp.generated.js +94 -87
- package/project-types.d.ts +0 -79
- package/project-types.js +0 -9
- package/projects.d.ts +0 -13
- package/projects.js +0 -46
- package/run-events.d.ts +0 -106
- package/run-events.js +0 -32
- package/schedule-reference-types.d.ts +0 -46
- package/schedule-reference-types.js +0 -1
- package/schedule-references-client.d.ts +0 -14
- package/schedule-references-client.js +0 -26
- package/schedule-types.d.ts +0 -261
- package/schedule-types.js +0 -1
package/run-types.d.ts
CHANGED
|
@@ -32,27 +32,27 @@ export type FileInput = Blob | {
|
|
|
32
32
|
* classifies each file and assigns its receipt {@link SourceMaterialReceiptFile.role};
|
|
33
33
|
* the caller no longer pre-sorts a brief from its references.
|
|
34
34
|
*/
|
|
35
|
-
export
|
|
35
|
+
export type UploadSourceMaterialFilesInput = {
|
|
36
36
|
files: FileInput[];
|
|
37
|
-
}
|
|
37
|
+
};
|
|
38
38
|
/**
|
|
39
39
|
* The legacy pre-classified shape — a single PDF `brief` plus optional image
|
|
40
40
|
* `references` (multipart fields `brief` + `references`). Still accepted by the
|
|
41
41
|
* server, folded into the pile. Prefer {@link UploadSourceMaterialFilesInput}.
|
|
42
42
|
*/
|
|
43
|
-
export
|
|
43
|
+
export type UploadSourceMaterialLegacyInput = {
|
|
44
44
|
/** The single PDF brief for the batch (multipart field `brief`). */
|
|
45
45
|
brief: FileInput;
|
|
46
46
|
/** Up to 12 reference images (multipart field `references`, repeatable). */
|
|
47
47
|
references?: FileInput[];
|
|
48
|
-
}
|
|
48
|
+
};
|
|
49
49
|
/**
|
|
50
50
|
* Input for {@link MaterialGraphClient.uploadSourceMaterial} — either the
|
|
51
51
|
* pile-of-files shape or the legacy brief+references shape.
|
|
52
52
|
*/
|
|
53
53
|
export type UploadSourceMaterialInput = UploadSourceMaterialFilesInput | UploadSourceMaterialLegacyInput;
|
|
54
54
|
/** One stored file in an upload receipt. */
|
|
55
|
-
export
|
|
55
|
+
export type SourceMaterialReceiptFile = {
|
|
56
56
|
/** The stored file id (`smf_…`). Opaque — the prefix is a reading aid, not a contract. */
|
|
57
57
|
sourceId: SourceFileId;
|
|
58
58
|
/**
|
|
@@ -68,13 +68,13 @@ export interface SourceMaterialReceiptFile {
|
|
|
68
68
|
bytes: number;
|
|
69
69
|
/** PDF page count; null for images. */
|
|
70
70
|
pages: number | null;
|
|
71
|
-
}
|
|
71
|
+
};
|
|
72
72
|
/** The `201` receipt from `POST /api/v1/source-material`. */
|
|
73
|
-
export
|
|
73
|
+
export type SourceMaterialBatchReceipt = {
|
|
74
74
|
/** The stored batch id (`smb_…`). Opaque — hand it straight to a compose Run. */
|
|
75
75
|
batchId: BatchId;
|
|
76
76
|
sources: SourceMaterialReceiptFile[];
|
|
77
|
-
}
|
|
77
|
+
};
|
|
78
78
|
/**
|
|
79
79
|
* One analysis computed over an uploaded image's bytes.
|
|
80
80
|
*
|
|
@@ -84,7 +84,7 @@ export interface SourceMaterialBatchReceipt {
|
|
|
84
84
|
* sharing is by design and discloses nothing — you only ever see analyses of
|
|
85
85
|
* images you hold yourself.
|
|
86
86
|
*/
|
|
87
|
-
export
|
|
87
|
+
export type SourceImageAnalysis = {
|
|
88
88
|
/** The kind of read. {@link OpenEnum} keeps a newer server value type-checking. */
|
|
89
89
|
kind: OpenEnum<"scene_match">;
|
|
90
90
|
/** The model version that produced {@link SourceImageAnalysis.result}. */
|
|
@@ -104,9 +104,9 @@ export interface SourceImageAnalysis {
|
|
|
104
104
|
result: Record<string, JsonValue>;
|
|
105
105
|
/** ISO-8601 timestamp of the most recent analysis. */
|
|
106
106
|
analysedAt: string;
|
|
107
|
-
}
|
|
107
|
+
};
|
|
108
108
|
/** Who a comment is from, as you SUBMIT it. Not the API principal posting it. */
|
|
109
|
-
export
|
|
109
|
+
export type SourceMaterialCommentAuthorInput = {
|
|
110
110
|
/** Trimmed, 1–160 characters. Longer or blank is refused by the server. */
|
|
111
111
|
name: string;
|
|
112
112
|
/**
|
|
@@ -114,7 +114,7 @@ export interface SourceMaterialCommentAuthorInput {
|
|
|
114
114
|
* Trimmed, 1–160 characters when present. Nullable, not optional.
|
|
115
115
|
*/
|
|
116
116
|
organisation: string | null;
|
|
117
|
-
}
|
|
117
|
+
};
|
|
118
118
|
/**
|
|
119
119
|
* Who a comment is from, as you READ IT BACK.
|
|
120
120
|
*
|
|
@@ -122,28 +122,28 @@ export interface SourceMaterialCommentAuthorInput {
|
|
|
122
122
|
* "recorded as from X", never as a statement X signed — the identity that IS
|
|
123
123
|
* verified is {@link SourceMaterialCommentReply.recordedBy}.
|
|
124
124
|
*/
|
|
125
|
-
export
|
|
125
|
+
export type SourceMaterialCommentAuthor = {
|
|
126
126
|
/**
|
|
127
127
|
* How the name got here. `reported` means a caller typed it. {@link OpenEnum}
|
|
128
128
|
* keeps a newer server value type-checking; treat anything unfamiliar as
|
|
129
129
|
* unverified.
|
|
130
130
|
*/
|
|
131
131
|
attribution: OpenEnum<"reported">;
|
|
132
|
-
}
|
|
132
|
+
} & SourceMaterialCommentAuthorInput;
|
|
133
133
|
/** The authenticated principal that recorded a comment. */
|
|
134
|
-
export
|
|
134
|
+
export type SourceMaterialCommentRecorder = {
|
|
135
135
|
/**
|
|
136
136
|
* The principal that wrote the row. Comments can only be posted against a
|
|
137
137
|
* batch the poster owns, so on every comment you can read this is your own.
|
|
138
138
|
*/
|
|
139
139
|
principalId: string;
|
|
140
|
-
}
|
|
140
|
+
};
|
|
141
141
|
/**
|
|
142
142
|
* One reply on a source-material file. A reply carries no replies of its own:
|
|
143
143
|
* threads are one level deep because the database makes a reply-to-reply
|
|
144
144
|
* unstorable, and this type says so rather than implying a tree.
|
|
145
145
|
*/
|
|
146
|
-
export
|
|
146
|
+
export type SourceMaterialCommentReply = {
|
|
147
147
|
/** The stored comment id (`smc_…`). Opaque. */
|
|
148
148
|
commentId: string;
|
|
149
149
|
author: SourceMaterialCommentAuthor;
|
|
@@ -152,14 +152,14 @@ export interface SourceMaterialCommentReply {
|
|
|
152
152
|
body: string;
|
|
153
153
|
/** ISO-8601 timestamp of the posting. */
|
|
154
154
|
createdAt: string;
|
|
155
|
-
}
|
|
155
|
+
};
|
|
156
156
|
/** One root remark with the replies that answer it. */
|
|
157
|
-
export
|
|
157
|
+
export type SourceMaterialComment = {
|
|
158
158
|
/** ALWAYS an array. `[]` means nobody answered — never a missing field. */
|
|
159
159
|
replies: SourceMaterialCommentReply[];
|
|
160
|
-
}
|
|
160
|
+
} & SourceMaterialCommentReply;
|
|
161
161
|
/** The `200` body of `GET …/sources/{sourceId}/comments`. */
|
|
162
|
-
export
|
|
162
|
+
export type SourceMaterialCommentThread = {
|
|
163
163
|
/** The file the thread hangs off (`smf_…`). Opaque. */
|
|
164
164
|
sourceId: string;
|
|
165
165
|
/**
|
|
@@ -172,9 +172,9 @@ export interface SourceMaterialCommentThread {
|
|
|
172
172
|
* so `comments` is the oldest of them rather than all of them.
|
|
173
173
|
*/
|
|
174
174
|
truncated: boolean;
|
|
175
|
-
}
|
|
175
|
+
};
|
|
176
176
|
/** The body of `POST …/sources/{sourceId}/comments`. */
|
|
177
|
-
export
|
|
177
|
+
export type PostSourceMaterialCommentInput = {
|
|
178
178
|
author: SourceMaterialCommentAuthorInput;
|
|
179
179
|
/** Trimmed, 1–4000 characters. */
|
|
180
180
|
body: string;
|
|
@@ -189,17 +189,17 @@ export interface PostSourceMaterialCommentInput {
|
|
|
189
189
|
* rather than a permanent duplicate. Scoped to the file.
|
|
190
190
|
*/
|
|
191
191
|
idempotencyKey?: string | null;
|
|
192
|
-
}
|
|
192
|
+
};
|
|
193
193
|
/** A comment the server just stored, as a root. */
|
|
194
|
-
export
|
|
194
|
+
export type StoredSourceMaterialRootComment = {
|
|
195
195
|
kind: "root";
|
|
196
|
-
}
|
|
196
|
+
} & SourceMaterialComment;
|
|
197
197
|
/** A comment the server just stored, as a reply to a root. */
|
|
198
|
-
export
|
|
198
|
+
export type StoredSourceMaterialReplyComment = {
|
|
199
199
|
kind: "reply";
|
|
200
200
|
/** The root this answers. Present because a reply always has one. */
|
|
201
201
|
parentCommentId: string;
|
|
202
|
-
}
|
|
202
|
+
} & SourceMaterialCommentReply;
|
|
203
203
|
/**
|
|
204
204
|
* What a POST returns, discriminated on `kind`. Switch on it: a `root` carries
|
|
205
205
|
* an empty `replies`, a `reply` carries `parentCommentId` and no `replies` at
|
|
@@ -207,13 +207,13 @@ export interface StoredSourceMaterialReplyComment extends SourceMaterialCommentR
|
|
|
207
207
|
*/
|
|
208
208
|
export type StoredSourceMaterialComment = StoredSourceMaterialRootComment | StoredSourceMaterialReplyComment;
|
|
209
209
|
/** The `201` body of `POST …/sources/{sourceId}/comments`. */
|
|
210
|
-
export
|
|
210
|
+
export type PostSourceMaterialCommentResult = {
|
|
211
211
|
/** The file the comment hangs off (`smf_…`). Opaque. */
|
|
212
212
|
sourceId: string;
|
|
213
213
|
comment: StoredSourceMaterialComment;
|
|
214
|
-
}
|
|
214
|
+
};
|
|
215
215
|
/** One file as `GET /api/v1/source-material/{batchId}` returns it. */
|
|
216
|
-
export
|
|
216
|
+
export type SourceMaterialBatchFile = {
|
|
217
217
|
/** Fetchable URL for the stored bytes. */
|
|
218
218
|
url: string;
|
|
219
219
|
/**
|
|
@@ -234,38 +234,38 @@ export interface SourceMaterialBatchFile extends SourceMaterialReceiptFile {
|
|
|
234
234
|
* you have, including one nobody has commented on.
|
|
235
235
|
*/
|
|
236
236
|
commentsTruncated: boolean;
|
|
237
|
-
}
|
|
237
|
+
} & SourceMaterialReceiptFile;
|
|
238
238
|
/**
|
|
239
239
|
* The `200` body of `GET /api/v1/source-material/{batchId}` — the batch, every
|
|
240
240
|
* file it holds, and the analyses computed over each file's bytes.
|
|
241
241
|
*/
|
|
242
|
-
export
|
|
242
|
+
export type SourceMaterialBatchDetail = {
|
|
243
243
|
/** The stored batch id (`smb_…`). Opaque. */
|
|
244
244
|
batchId: BatchId;
|
|
245
245
|
/** ISO-8601 timestamp of the upload. */
|
|
246
246
|
createdAt: string;
|
|
247
247
|
sources: SourceMaterialBatchFile[];
|
|
248
|
-
}
|
|
248
|
+
};
|
|
249
249
|
export type CapabilityKind = OpenEnum<"agent" | "tool" | "workflow">;
|
|
250
250
|
export type CapabilityExposure = OpenEnum<"public" | "partner" | "internal">;
|
|
251
251
|
export type CapabilityScope = OpenEnum<"mg:read" | "mg:write" | "mg:ingest" | "mg:admin">;
|
|
252
252
|
export type CapabilitySideEffectClass = OpenEnum<"read_only" | "browser_local" | "external_read" | "writes_proposed" | "writes_persisted" | "planned_only">;
|
|
253
|
-
export
|
|
253
|
+
export type CapabilityRetryPolicy = {
|
|
254
254
|
maxAttempts: number;
|
|
255
255
|
backoff: OpenEnum<"none" | "fixed" | "exponential">;
|
|
256
|
-
}
|
|
257
|
-
export
|
|
256
|
+
};
|
|
257
|
+
export type CapabilityInvokeLink = {
|
|
258
258
|
href: string;
|
|
259
259
|
method: OpenEnum<"GET" | "POST">;
|
|
260
|
-
}
|
|
260
|
+
};
|
|
261
261
|
/** One human-input checkpoint exposed by a workflow capability. */
|
|
262
|
-
export
|
|
262
|
+
export type PublicCapabilitySuspension = {
|
|
263
263
|
stepId: string;
|
|
264
264
|
suspend: Record<string, unknown>;
|
|
265
265
|
resume: Record<string, unknown>;
|
|
266
|
-
}
|
|
266
|
+
};
|
|
267
267
|
/** One invocable capability from the governed public manifest. */
|
|
268
|
-
export
|
|
268
|
+
export type PublicCapabilityMetadata = {
|
|
269
269
|
publicId: string;
|
|
270
270
|
runtimeId: string;
|
|
271
271
|
kind: CapabilityKind;
|
|
@@ -285,28 +285,28 @@ export interface PublicCapabilityMetadata {
|
|
|
285
285
|
links: {
|
|
286
286
|
invoke: CapabilityInvokeLink;
|
|
287
287
|
};
|
|
288
|
-
}
|
|
288
|
+
};
|
|
289
289
|
/** The `GET /api/v1/capabilities` response envelope. */
|
|
290
|
-
export
|
|
290
|
+
export type CapabilityManifestResponse = {
|
|
291
291
|
capabilities: PublicCapabilityMetadata[];
|
|
292
|
-
}
|
|
292
|
+
};
|
|
293
293
|
export type PublicRunStatus = OpenEnum<"queued" | "claimed" | "running" | "suspended" | "succeeded" | "failed" | "canceled">;
|
|
294
|
-
export
|
|
294
|
+
export type PublicRunFailure = {
|
|
295
295
|
code: string;
|
|
296
296
|
message: string;
|
|
297
297
|
retryable: boolean;
|
|
298
298
|
detail?: Record<string, unknown>;
|
|
299
|
-
}
|
|
300
|
-
export
|
|
299
|
+
};
|
|
300
|
+
export type PublicRunArtifactRef = {
|
|
301
301
|
kind: string;
|
|
302
302
|
ref: string;
|
|
303
|
-
}
|
|
303
|
+
};
|
|
304
304
|
/**
|
|
305
305
|
* The caller-owned, redacted Run ledger record. Prompts, raw model messages,
|
|
306
306
|
* reasoning, credentials, provider payloads, and source-document contents are
|
|
307
307
|
* never returned — inputs and outputs are the `redacted*Json` projections.
|
|
308
308
|
*/
|
|
309
|
-
export
|
|
309
|
+
export type PublicRun = {
|
|
310
310
|
/** Opaque — round-trip verbatim into every other Run call. */
|
|
311
311
|
id: RunId;
|
|
312
312
|
capabilityKind: CapabilityKind;
|
|
@@ -338,9 +338,9 @@ export interface PublicRun {
|
|
|
338
338
|
completedAt: string | null;
|
|
339
339
|
createdAt: string;
|
|
340
340
|
updatedAt: string;
|
|
341
|
-
}
|
|
341
|
+
};
|
|
342
342
|
/** Body for `POST /api/v1/runs` ({@link MaterialGraphClient.createRun}). */
|
|
343
|
-
export
|
|
343
|
+
export type CreatePublicRunRequest = {
|
|
344
344
|
capabilityKind: CapabilityKind;
|
|
345
345
|
capabilityId: string;
|
|
346
346
|
/** The capability input, validated server-side against its live input schema. */
|
|
@@ -353,20 +353,20 @@ export interface CreatePublicRunRequest {
|
|
|
353
353
|
idempotencyKey?: string;
|
|
354
354
|
/** Free-form caller correlation reference, echoed back on the Run. */
|
|
355
355
|
clientReference?: string;
|
|
356
|
-
}
|
|
356
|
+
};
|
|
357
357
|
/** The `POST /api/v1/runs` response (`200` replay or `202` accepted). */
|
|
358
|
-
export
|
|
358
|
+
export type CreatePublicRunResponse = {
|
|
359
359
|
accepted: boolean;
|
|
360
360
|
replayed: boolean;
|
|
361
361
|
workflowRunId: string;
|
|
362
362
|
run: PublicRun;
|
|
363
|
-
}
|
|
363
|
+
};
|
|
364
364
|
/** The `GET /api/v1/runs/{runId}` and resume/cancel response envelope. */
|
|
365
|
-
export
|
|
365
|
+
export type PublicRunResponse = {
|
|
366
366
|
run: PublicRun;
|
|
367
|
-
}
|
|
367
|
+
};
|
|
368
368
|
/** Query for `GET /api/v1/runs` ({@link MaterialGraphClient.listRuns}). */
|
|
369
|
-
export
|
|
369
|
+
export type ListRunsOptions = {
|
|
370
370
|
/**
|
|
371
371
|
* Return only Runs in this status. `"suspended"` is the recovery question:
|
|
372
372
|
* which of my Runs is still waiting on an answer?
|
|
@@ -380,49 +380,49 @@ export interface ListRunsOptions {
|
|
|
380
380
|
*/
|
|
381
381
|
cursor?: string;
|
|
382
382
|
signal?: AbortSignal;
|
|
383
|
-
}
|
|
383
|
+
};
|
|
384
384
|
/** The `GET /api/v1/runs` response envelope — one page, newest first. */
|
|
385
|
-
export
|
|
385
|
+
export type PublicRunListResponse = {
|
|
386
386
|
runs: PublicRun[];
|
|
387
387
|
/**
|
|
388
388
|
* Pass as {@link ListRunsOptions.cursor} for the next page. ABSENT — not
|
|
389
389
|
* empty-string, not null — once the last page has been served.
|
|
390
390
|
*/
|
|
391
391
|
nextCursor?: string;
|
|
392
|
-
}
|
|
392
|
+
};
|
|
393
393
|
/** Body for `POST /api/v1/runs/{runId}/resume`. */
|
|
394
|
-
export
|
|
394
|
+
export type ResumePublicRunRequest = {
|
|
395
395
|
/** The resume payload, validated against the suspended step's resume schema. */
|
|
396
396
|
resumeData: unknown;
|
|
397
|
-
}
|
|
397
|
+
};
|
|
398
398
|
/**
|
|
399
399
|
* One redacted Run event, decoded from an SSE `data:` frame. The stream yields
|
|
400
400
|
* these in ascending {@link RunEvent.sequence} order. `payloadJson` is read
|
|
401
401
|
* structurally; use {@link parseRunEvent} to narrow the composition family.
|
|
402
402
|
*/
|
|
403
|
-
export
|
|
403
|
+
export type RunEvent = {
|
|
404
404
|
sequence: number;
|
|
405
405
|
type: string;
|
|
406
406
|
payloadJson: unknown;
|
|
407
|
-
}
|
|
407
|
+
};
|
|
408
408
|
/** Run event types that close the stream — a terminal event ends a drain. */
|
|
409
409
|
export declare const TERMINAL_RUN_EVENT_TYPES: ReadonlySet<string>;
|
|
410
410
|
/** Options for {@link MaterialGraphClient.streamRunEvents}. */
|
|
411
|
-
export
|
|
411
|
+
export type StreamRunEventsOptions = {
|
|
412
412
|
/** Resume the stream after this sequence (exclusive). Omitted starts at 0. */
|
|
413
413
|
after?: number;
|
|
414
414
|
/** Abort the stream; iteration stops cleanly. */
|
|
415
415
|
signal?: AbortSignal;
|
|
416
|
-
}
|
|
416
|
+
};
|
|
417
417
|
/** Options for {@link MaterialGraphClient.drainRunEvents}. */
|
|
418
|
-
export
|
|
418
|
+
export type DrainRunEventsOptions = {
|
|
419
419
|
/** Resume after this sequence (exclusive). */
|
|
420
420
|
after?: number;
|
|
421
421
|
/** Stop collecting after this many milliseconds even without a terminal event. */
|
|
422
422
|
deadlineMs: number;
|
|
423
|
-
}
|
|
423
|
+
};
|
|
424
424
|
/** Options for {@link MaterialGraphClient.resumeRun}. */
|
|
425
|
-
export
|
|
425
|
+
export type ResumeRunOptions = {
|
|
426
426
|
/**
|
|
427
427
|
* The step the caller believes is suspended. When it mismatches the run
|
|
428
428
|
* doc's live `suspensionStepId` the API answers RFC-7807 409 (MG-608) —
|
|
@@ -432,4 +432,4 @@ export interface ResumeRunOptions {
|
|
|
432
432
|
stepId?: string;
|
|
433
433
|
/** Abort the request. */
|
|
434
434
|
signal?: AbortSignal;
|
|
435
|
-
}
|
|
435
|
+
};
|
package/runs.d.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { HttpTransport } from "./http-transport.js";
|
|
2
|
-
import {
|
|
3
|
-
import type { FinishScheduleResponse, GetRunScheduleOptions } from "./schedule-types.js";
|
|
1
|
+
import type { HttpTransport } from "./http-transport.js";
|
|
2
|
+
import type { CapabilityManifestResponse, CreatePublicRunRequest, CreatePublicRunResponse, DrainRunEventsOptions, ListRunsOptions, PostSourceMaterialCommentInput, PostSourceMaterialCommentResult, PublicRunListResponse, PublicRunResponse, ResumeRunOptions, RunEvent, SourceMaterialBatchDetail, SourceMaterialBatchReceipt, SourceMaterialCommentThread, StreamRunEventsOptions, UploadSourceMaterialInput } from "./run-types.js";
|
|
4
3
|
/**
|
|
5
4
|
* Upload one atomic source-material batch (`POST /api/v1/source-material`).
|
|
6
5
|
* Accepts the pile-of-files shape (`{ files }` → repeatable `files` field) or
|
|
7
6
|
* the legacy `{ brief, references }` shape (→ `brief` + repeatable `references`
|
|
8
7
|
* fields). Both wire to multipart the server accepts.
|
|
9
8
|
*/
|
|
10
|
-
export declare
|
|
9
|
+
export declare const uploadSourceMaterial: (transport: HttpTransport, input: UploadSourceMaterialInput, signal?: AbortSignal) => Promise<SourceMaterialBatchReceipt>;
|
|
11
10
|
/**
|
|
12
11
|
* Read back one uploaded batch (`GET /api/v1/source-material/{batchId}`): every
|
|
13
12
|
* file with a fetchable `url`, and every analysis computed over its bytes
|
|
@@ -20,7 +19,7 @@ export declare function uploadSourceMaterial(transport: HttpTransport, input: Up
|
|
|
20
19
|
* the server's Zod contract so a malformed response fails here with a path into
|
|
21
20
|
* the payload rather than as an undefined three frames away in caller code.
|
|
22
21
|
*/
|
|
23
|
-
export declare
|
|
22
|
+
export declare const getSourceMaterialBatch: (transport: HttpTransport, batchId: string, signal?: AbortSignal) => Promise<SourceMaterialBatchDetail>;
|
|
24
23
|
/**
|
|
25
24
|
* Read one file's comment thread
|
|
26
25
|
* (`GET /api/v1/source-material/{batchId}/sources/{sourceId}/comments`).
|
|
@@ -38,7 +37,7 @@ export declare function getSourceMaterialBatch(transport: HttpTransport, batchId
|
|
|
38
37
|
* A file that is not in that batch, or a batch you do not own, raises the same
|
|
39
38
|
* 404 as a file that never existed.
|
|
40
39
|
*/
|
|
41
|
-
export declare
|
|
40
|
+
export declare const listSourceMaterialComments: (transport: HttpTransport, batchId: string, sourceId: string, signal?: AbortSignal) => Promise<SourceMaterialCommentThread>;
|
|
42
41
|
/**
|
|
43
42
|
* Add one remark to a file's thread
|
|
44
43
|
* (`POST /api/v1/source-material/{batchId}/sources/{sourceId}/comments`).
|
|
@@ -54,11 +53,11 @@ export declare function listSourceMaterialComments(transport: HttpTransport, bat
|
|
|
54
53
|
* The result is discriminated on `kind`: switch on it rather than reaching for
|
|
55
54
|
* `replies`, which a `reply` does not have.
|
|
56
55
|
*/
|
|
57
|
-
export declare
|
|
56
|
+
export declare const postSourceMaterialComment: (transport: HttpTransport, batchId: string, sourceId: string, input: PostSourceMaterialCommentInput, signal?: AbortSignal) => Promise<PostSourceMaterialCommentResult>;
|
|
58
57
|
/** List invocable agents, workflows, and tools (`GET /api/v1/capabilities`). */
|
|
59
|
-
export declare
|
|
58
|
+
export declare const capabilities: (transport: HttpTransport, signal?: AbortSignal) => Promise<CapabilityManifestResponse>;
|
|
60
59
|
/** Start an asynchronous capability Run (`POST /api/v1/runs`). */
|
|
61
|
-
export declare
|
|
60
|
+
export declare const createRun: (transport: HttpTransport, body: CreatePublicRunRequest, signal?: AbortSignal) => Promise<CreatePublicRunResponse>;
|
|
62
61
|
/**
|
|
63
62
|
* List your own Runs, newest first (`GET /api/v1/runs`).
|
|
64
63
|
*
|
|
@@ -72,21 +71,9 @@ export declare function createRun(transport: HttpTransport, body: CreatePublicRu
|
|
|
72
71
|
* Page by following `nextCursor` until it is ABSENT — a full page is not the
|
|
73
72
|
* signal to stop, and an absent cursor is the only one.
|
|
74
73
|
*/
|
|
75
|
-
export declare
|
|
74
|
+
export declare const listRuns: (transport: HttpTransport, options?: ListRunsOptions) => Promise<PublicRunListResponse>;
|
|
76
75
|
/** Get a Run's current state (`GET /api/v1/runs/{runId}`). */
|
|
77
|
-
export declare
|
|
78
|
-
/**
|
|
79
|
-
* Export a completed compose Run's scheme as a finish schedule — one row per
|
|
80
|
-
* slot, every attribute value carrying its source and verification state
|
|
81
|
-
* (`GET /api/v1/runs/{runId}/schedule`).
|
|
82
|
-
*
|
|
83
|
-
* The `.xlsx` form of the same export is deliberately NOT an SDK method: this
|
|
84
|
-
* transport parses every response as text/JSON and has no binary read path, so
|
|
85
|
-
* a bytes-returning method would mean a second transport surface for one file.
|
|
86
|
-
* Fetch `GET /api/v1/runs/{runId}/schedule.xlsx` directly with the same bearer
|
|
87
|
-
* key when you want the workbook.
|
|
88
|
-
*/
|
|
89
|
-
export declare function getRunSchedule(transport: HttpTransport, runId: string, options?: GetRunScheduleOptions): Promise<FinishScheduleResponse>;
|
|
76
|
+
export declare const getRun: (transport: HttpTransport, runId: string, signal?: AbortSignal) => Promise<PublicRunResponse>;
|
|
90
77
|
/**
|
|
91
78
|
* Resume a suspended Run (`POST /api/v1/runs/{runId}/resume`).
|
|
92
79
|
*
|
|
@@ -104,9 +91,9 @@ export declare function getRunSchedule(transport: HttpTransport, runId: string,
|
|
|
104
91
|
* `JSON.stringify` drops both — so the distinction here is construction
|
|
105
92
|
* intent, kept so the serialised body is provably unchanged for old callers.
|
|
106
93
|
*/
|
|
107
|
-
export declare
|
|
94
|
+
export declare const resumeRun: (transport: HttpTransport, runId: string, resumeData: unknown, signalOrOptions?: AbortSignal | ResumeRunOptions) => Promise<PublicRunResponse>;
|
|
108
95
|
/** Request durable Run cancellation (`POST /api/v1/runs/{runId}/cancel`). */
|
|
109
|
-
export declare
|
|
96
|
+
export declare const cancelRun: (transport: HttpTransport, runId: string, signal?: AbortSignal) => Promise<PublicRunResponse>;
|
|
110
97
|
/**
|
|
111
98
|
* Stream ordered Run events as an async iterator (`GET
|
|
112
99
|
* /api/v1/runs/{runId}/events`, SSE). Iterates until the stream ends or
|
|
@@ -129,4 +116,4 @@ export declare function streamRunEvents(transport: HttpTransport, runId: string,
|
|
|
129
116
|
* failure (a real 4xx/5xx or transport error) still propagates, keeping the
|
|
130
117
|
* fail-fast surface for genuine upstream problems.
|
|
131
118
|
*/
|
|
132
|
-
export declare
|
|
119
|
+
export declare const drainRunEvents: (transport: HttpTransport, runId: string, options: DrainRunEventsOptions) => Promise<RunEvent[]>;
|