@independo/inderun-contracts 0.4.0 → 0.5.0-rc.2
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/generated/artifact-read-request.d.ts +24 -0
- package/dist/generated/artifact-read-request.d.ts.map +1 -0
- package/dist/generated/artifact-read-request.js +2 -0
- package/dist/generated/execution-provenance.d.ts +8 -1
- package/dist/generated/execution-provenance.d.ts.map +1 -1
- package/dist/generated/inderun-error.d.ts +8 -1
- package/dist/generated/inderun-error.d.ts.map +1 -1
- package/dist/generated/index.d.ts +6 -0
- package/dist/generated/index.d.ts.map +1 -1
- package/dist/generated/media-artifact.d.ts +53 -0
- package/dist/generated/media-artifact.d.ts.map +1 -0
- package/dist/generated/media-artifact.js +2 -0
- package/dist/generated/provider-capability-snapshot.d.ts +370 -0
- package/dist/generated/provider-capability-snapshot.d.ts.map +1 -0
- package/dist/generated/provider-capability-snapshot.js +2 -0
- package/dist/generated/provider-descriptor.d.ts +264 -0
- package/dist/generated/provider-descriptor.d.ts.map +1 -0
- package/dist/generated/provider-descriptor.js +2 -0
- package/dist/generated/provider-dynamic-capabilities.d.ts +99 -0
- package/dist/generated/provider-dynamic-capabilities.d.ts.map +1 -0
- package/dist/generated/provider-dynamic-capabilities.js +2 -0
- package/dist/generated/route-plan.d.ts +47 -3
- package/dist/generated/route-plan.d.ts.map +1 -1
- package/dist/generated/route-planner-input.d.ts +417 -32
- package/dist/generated/route-planner-input.d.ts.map +1 -1
- package/dist/generated/schemas.d.ts +833 -115
- package/dist/generated/schemas.d.ts.map +1 -1
- package/dist/generated/schemas.js +1038 -160
- package/dist/generated/stream-event.d.ts +136 -1
- package/dist/generated/stream-event.d.ts.map +1 -1
- package/dist/generated/stream-terminal-outcome.d.ts +182 -18
- package/dist/generated/stream-terminal-outcome.d.ts.map +1 -1
- package/dist/generated/task-output.d.ts +128 -0
- package/dist/generated/task-output.d.ts.map +1 -0
- package/dist/generated/task-output.js +2 -0
- package/dist/generated/task-request.d.ts +116 -11
- package/dist/generated/task-request.d.ts.map +1 -1
- package/dist/generated/task-result.d.ts +139 -15
- package/dist/generated/task-result.d.ts.map +1 -1
- package/dist/generated/telemetry-event.d.ts +2 -2
- package/dist/generated/telemetry-event.d.ts.map +1 -1
- package/dist/host.d.ts +24 -1
- package/dist/host.d.ts.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/types.d.ts +46 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/validators.d.ts +18 -0
- package/dist/validators.d.ts.map +1 -1
- package/dist/validators.js +49 -1
- package/package.json +1 -1
- package/src/generated/artifact-read-request.ts +25 -0
- package/src/generated/execution-provenance.ts +8 -1
- package/src/generated/inderun-error.ts +8 -1
- package/src/generated/index.ts +6 -0
- package/src/generated/media-artifact.ts +56 -0
- package/src/generated/provider-capability-snapshot.ts +388 -0
- package/src/generated/provider-descriptor.ts +278 -0
- package/src/generated/provider-dynamic-capabilities.ts +103 -0
- package/src/generated/route-plan.ts +49 -3
- package/src/generated/route-planner-input.ts +437 -36
- package/src/generated/schemas.ts +1044 -160
- package/src/generated/stream-event.ts +145 -1
- package/src/generated/stream-terminal-outcome.ts +191 -18
- package/src/generated/task-output.ts +137 -0
- package/src/generated/task-request.ts +124 -11
- package/src/generated/task-result.ts +147 -15
- package/src/generated/telemetry-event.ts +2 -2
- package/src/host.ts +30 -1
- package/src/index.ts +28 -1
- package/src/types.ts +38 -1
- package/src/validators.ts +76 -0
package/dist/validators.d.ts
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
|
+
import type { ArtifactReadRequest } from "./generated/artifact-read-request.js";
|
|
1
2
|
import type { ExecutionProvenance } from "./generated/execution-provenance.js";
|
|
2
3
|
import type { IndeRunError } from "./generated/inderun-error.js";
|
|
4
|
+
import type { MediaArtifact } from "./generated/media-artifact.js";
|
|
3
5
|
import type { HttpRequest } from "./generated/http-request.js";
|
|
4
6
|
import type { HttpResponse } from "./generated/http-response.js";
|
|
5
7
|
import type { ModelPackage } from "./generated/model-package.js";
|
|
8
|
+
import type { ProviderCapabilitySnapshot } from "./generated/provider-capability-snapshot.js";
|
|
9
|
+
import type { ProviderDescriptor } from "./generated/provider-descriptor.js";
|
|
10
|
+
import type { ProviderDynamicCapabilities } from "./generated/provider-dynamic-capabilities.js";
|
|
6
11
|
import type { RoutePlan } from "./generated/route-plan.js";
|
|
7
12
|
import type { RoutePlannerInput } from "./generated/route-planner-input.js";
|
|
8
13
|
import type { StreamEvent } from "./generated/stream-event.js";
|
|
9
14
|
import type { StreamRunHandle } from "./generated/stream-run.js";
|
|
10
15
|
import type { StreamTerminalOutcome } from "./generated/stream-terminal-outcome.js";
|
|
16
|
+
import type { TaskOutput } from "./generated/task-output.js";
|
|
11
17
|
import type { TaskRequest } from "./generated/task-request.js";
|
|
12
18
|
import type { TaskResult } from "./generated/task-result.js";
|
|
13
19
|
import type { TelemetryEvent } from "./generated/telemetry-event.js";
|
|
@@ -18,6 +24,9 @@ export type ValidationIssue = {
|
|
|
18
24
|
};
|
|
19
25
|
export declare function validateTaskRequest(value: unknown): value is TaskRequest;
|
|
20
26
|
export declare function validateTaskResult(value: unknown): value is TaskResult;
|
|
27
|
+
export declare function validateTaskOutput(value: unknown): value is TaskOutput;
|
|
28
|
+
export declare function validateMediaArtifact(value: unknown): value is MediaArtifact;
|
|
29
|
+
export declare function validateArtifactReadRequest(value: unknown): value is ArtifactReadRequest;
|
|
21
30
|
export declare function validateIndeRunError(value: unknown): value is IndeRunError;
|
|
22
31
|
export declare function validateHttpRequest(value: unknown): value is HttpRequest;
|
|
23
32
|
export declare function validateHttpResponse(value: unknown): value is HttpResponse;
|
|
@@ -25,11 +34,17 @@ export declare function validateTelemetryEvent(value: unknown): value is Telemet
|
|
|
25
34
|
export declare function validateRoutePlannerInput(value: unknown): value is RoutePlannerInput;
|
|
26
35
|
export declare function validateRoutePlan(value: unknown): value is RoutePlan;
|
|
27
36
|
export declare function validateModelPackage(value: unknown): value is ModelPackage;
|
|
37
|
+
export declare function validateProviderDescriptor(value: unknown): value is ProviderDescriptor;
|
|
38
|
+
export declare function validateProviderDynamicCapabilities(value: unknown): value is ProviderDynamicCapabilities;
|
|
39
|
+
export declare function validateProviderCapabilitySnapshot(value: unknown): value is ProviderCapabilitySnapshot;
|
|
28
40
|
export declare function validateStreamRunHandle(value: unknown): value is StreamRunHandle;
|
|
29
41
|
export declare function validateStreamEvent(value: unknown): value is StreamEvent;
|
|
30
42
|
export declare function validateStreamTerminalOutcome(value: unknown): value is StreamTerminalOutcome;
|
|
31
43
|
export declare function getTaskRequestValidationIssues(value: unknown): ValidationIssue[];
|
|
32
44
|
export declare function getTaskResultValidationIssues(value: unknown): ValidationIssue[];
|
|
45
|
+
export declare function getTaskOutputValidationIssues(value: unknown): ValidationIssue[];
|
|
46
|
+
export declare function getMediaArtifactValidationIssues(value: unknown): ValidationIssue[];
|
|
47
|
+
export declare function getArtifactReadRequestValidationIssues(value: unknown): ValidationIssue[];
|
|
33
48
|
export declare function getIndeRunErrorValidationIssues(value: unknown): ValidationIssue[];
|
|
34
49
|
export declare function validateExecutionProvenance(value: unknown): value is ExecutionProvenance;
|
|
35
50
|
export declare function getExecutionProvenanceValidationIssues(value: unknown): ValidationIssue[];
|
|
@@ -39,6 +54,9 @@ export declare function getTelemetryEventValidationIssues(value: unknown): Valid
|
|
|
39
54
|
export declare function getRoutePlannerInputValidationIssues(value: unknown): ValidationIssue[];
|
|
40
55
|
export declare function getRoutePlanValidationIssues(value: unknown): ValidationIssue[];
|
|
41
56
|
export declare function getModelPackageValidationIssues(value: unknown): ValidationIssue[];
|
|
57
|
+
export declare function getProviderDescriptorValidationIssues(value: unknown): ValidationIssue[];
|
|
58
|
+
export declare function getProviderDynamicCapabilitiesValidationIssues(value: unknown): ValidationIssue[];
|
|
59
|
+
export declare function getProviderCapabilitySnapshotValidationIssues(value: unknown): ValidationIssue[];
|
|
42
60
|
export declare function getStreamRunHandleValidationIssues(value: unknown): ValidationIssue[];
|
|
43
61
|
export declare function getStreamEventValidationIssues(value: unknown): ValidationIssue[];
|
|
44
62
|
export declare function getStreamTerminalOutcomeValidationIssues(value: unknown): ValidationIssue[];
|
package/dist/validators.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../src/validators.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../src/validators.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AAC9F,OAAO,KAAK,EAAE,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Schema, httpResponseSchema, inderunErrorSchema, modelPackageSchema, routePlanSchema, routePlannerInputSchema, streamEventSchema, streamRunSchema, streamTerminalOutcomeSchema, taskRequestSchema, taskResultSchema, telemetryEventSchema } from "./generated/index.js";
|
|
2
|
+
import { artifactReadRequestSchema, executionProvenanceSchema, httpRequestSchema, httpResponseSchema, inderunErrorSchema, mediaArtifactSchema, modelPackageSchema, providerCapabilitySnapshotSchema, providerDescriptorSchema, providerDynamicCapabilitiesSchema, routePlanSchema, routePlannerInputSchema, streamEventSchema, streamRunSchema, streamTerminalOutcomeSchema, taskOutputSchema, taskRequestSchema, taskResultSchema, telemetryEventSchema } from "./generated/index.js";
|
|
3
3
|
const Ajv2020Constructor = Ajv2020;
|
|
4
4
|
const ajv = new Ajv2020Constructor({
|
|
5
5
|
allErrors: true,
|
|
@@ -10,6 +10,16 @@ const ajv = new Ajv2020Constructor({
|
|
|
10
10
|
// Referenced by `$ref` from every schema that carries provenance, so it has to be known
|
|
11
11
|
// to Ajv before any of them compiles. Compiling it registers it under its `$id`.
|
|
12
12
|
const validateExecutionProvenanceSchema = ajv.compile(executionProvenanceSchema);
|
|
13
|
+
// Likewise, the provider descriptor and dynamic capabilities are referenced from the
|
|
14
|
+
// capability snapshot and the route-planner input.
|
|
15
|
+
const validateProviderDescriptorSchema = ajv.compile(providerDescriptorSchema);
|
|
16
|
+
const validateProviderDynamicCapabilitiesSchema = ajv.compile(providerDynamicCapabilitiesSchema);
|
|
17
|
+
const validateProviderCapabilitySnapshotSchema = ajv.compile(providerCapabilitySnapshotSchema);
|
|
18
|
+
// The normalized output (and the media artifact it references) is shared by the result
|
|
19
|
+
// and both terminal-outcome copies.
|
|
20
|
+
const validateMediaArtifactSchema = ajv.compile(mediaArtifactSchema);
|
|
21
|
+
const validateTaskOutputSchema = ajv.compile(taskOutputSchema);
|
|
22
|
+
const validateArtifactReadRequestSchema = ajv.compile(artifactReadRequestSchema);
|
|
13
23
|
const validateTaskRequestSchema = ajv.compile(taskRequestSchema);
|
|
14
24
|
const validateTaskResultSchema = ajv.compile(taskResultSchema);
|
|
15
25
|
const validateIndeRunErrorSchema = ajv.compile(inderunErrorSchema);
|
|
@@ -28,6 +38,15 @@ export function validateTaskRequest(value) {
|
|
|
28
38
|
export function validateTaskResult(value) {
|
|
29
39
|
return getTaskResultValidationIssues(value).length === 0;
|
|
30
40
|
}
|
|
41
|
+
export function validateTaskOutput(value) {
|
|
42
|
+
return getTaskOutputValidationIssues(value).length === 0;
|
|
43
|
+
}
|
|
44
|
+
export function validateMediaArtifact(value) {
|
|
45
|
+
return getMediaArtifactValidationIssues(value).length === 0;
|
|
46
|
+
}
|
|
47
|
+
export function validateArtifactReadRequest(value) {
|
|
48
|
+
return getArtifactReadRequestValidationIssues(value).length === 0;
|
|
49
|
+
}
|
|
31
50
|
export function validateIndeRunError(value) {
|
|
32
51
|
return getIndeRunErrorValidationIssues(value).length === 0;
|
|
33
52
|
}
|
|
@@ -49,6 +68,15 @@ export function validateRoutePlan(value) {
|
|
|
49
68
|
export function validateModelPackage(value) {
|
|
50
69
|
return getModelPackageValidationIssues(value).length === 0;
|
|
51
70
|
}
|
|
71
|
+
export function validateProviderDescriptor(value) {
|
|
72
|
+
return getProviderDescriptorValidationIssues(value).length === 0;
|
|
73
|
+
}
|
|
74
|
+
export function validateProviderDynamicCapabilities(value) {
|
|
75
|
+
return getProviderDynamicCapabilitiesValidationIssues(value).length === 0;
|
|
76
|
+
}
|
|
77
|
+
export function validateProviderCapabilitySnapshot(value) {
|
|
78
|
+
return getProviderCapabilitySnapshotValidationIssues(value).length === 0;
|
|
79
|
+
}
|
|
52
80
|
export function validateStreamRunHandle(value) {
|
|
53
81
|
return getStreamRunHandleValidationIssues(value).length === 0;
|
|
54
82
|
}
|
|
@@ -70,6 +98,17 @@ export function getTaskResultValidationIssues(value) {
|
|
|
70
98
|
forbidInlineSecrets: true
|
|
71
99
|
});
|
|
72
100
|
}
|
|
101
|
+
export function getTaskOutputValidationIssues(value) {
|
|
102
|
+
return getValidationIssues(validateTaskOutputSchema, value, {
|
|
103
|
+
forbidInlineSecrets: true
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
export function getMediaArtifactValidationIssues(value) {
|
|
107
|
+
return getValidationIssues(validateMediaArtifactSchema, value);
|
|
108
|
+
}
|
|
109
|
+
export function getArtifactReadRequestValidationIssues(value) {
|
|
110
|
+
return getValidationIssues(validateArtifactReadRequestSchema, value);
|
|
111
|
+
}
|
|
73
112
|
export function getIndeRunErrorValidationIssues(value) {
|
|
74
113
|
return getValidationIssues(validateIndeRunErrorSchema, value, {
|
|
75
114
|
forbidInlineSecrets: true
|
|
@@ -105,6 +144,15 @@ export function getModelPackageValidationIssues(value) {
|
|
|
105
144
|
forbidInlineSecrets: true
|
|
106
145
|
});
|
|
107
146
|
}
|
|
147
|
+
export function getProviderDescriptorValidationIssues(value) {
|
|
148
|
+
return getValidationIssues(validateProviderDescriptorSchema, value);
|
|
149
|
+
}
|
|
150
|
+
export function getProviderDynamicCapabilitiesValidationIssues(value) {
|
|
151
|
+
return getValidationIssues(validateProviderDynamicCapabilitiesSchema, value);
|
|
152
|
+
}
|
|
153
|
+
export function getProviderCapabilitySnapshotValidationIssues(value) {
|
|
154
|
+
return getValidationIssues(validateProviderCapabilitySnapshotSchema, value);
|
|
155
|
+
}
|
|
108
156
|
export function getStreamRunHandleValidationIssues(value) {
|
|
109
157
|
return getValidationIssues(validateStreamRunHandleSchema, value);
|
|
110
158
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@independo/inderun-contracts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0-rc.2",
|
|
4
4
|
"description": "Canonical JSON Schemas, generated TypeScript types, and validators for the IndeRun task, streaming, error, and routing contracts.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/* This file was generated from JSON Schema using quicktype. Do not edit by hand. */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A ranged read of an engine-owned media artifact through IndeRunApi.readArtifact (ADR
|
|
5
|
+
* 017). Reads are repeatable until the artifact is disposed; each returns at most the
|
|
6
|
+
* engine's configured maximum read size, which bounds what one call -- and one bridge
|
|
7
|
+
* message -- carries.
|
|
8
|
+
*/
|
|
9
|
+
export type ArtifactReadRequest = {
|
|
10
|
+
/**
|
|
11
|
+
* MediaArtifact.id of the artifact to read.
|
|
12
|
+
*/
|
|
13
|
+
artifactId: string;
|
|
14
|
+
/**
|
|
15
|
+
* Most bytes to return. Absent, or larger than the engine's maximum read size, means that
|
|
16
|
+
* maximum.
|
|
17
|
+
*/
|
|
18
|
+
maxBytes?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Byte offset to read from. Absent means 0. An offset equal to the artifact's size returns
|
|
21
|
+
* an empty, final chunk; a larger one is rejected.
|
|
22
|
+
*/
|
|
23
|
+
offset?: number;
|
|
24
|
+
[property: string]: unknown;
|
|
25
|
+
}
|
|
@@ -62,6 +62,13 @@ export type ExecutionProvenance = {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
export type ExecutionProvenanceAttempt = {
|
|
65
|
+
/**
|
|
66
|
+
* Whether the run committed to this provider during the attempt: its first content was
|
|
67
|
+
* delivered, it signalled the first possible audible effect, or it handed over an artifact.
|
|
68
|
+
* After commit a failure ends the run instead of falling back. Absent means the attempt did
|
|
69
|
+
* not commit.
|
|
70
|
+
*/
|
|
71
|
+
committed?: boolean;
|
|
65
72
|
/**
|
|
66
73
|
* Normalized error class of a failed attempt.
|
|
67
74
|
*/
|
|
@@ -99,4 +106,4 @@ export type ExecutionProvenanceRouteRejection = {
|
|
|
99
106
|
[property: string]: unknown;
|
|
100
107
|
}
|
|
101
108
|
|
|
102
|
-
export type Code = "task_not_supported" | "run_not_supported" | "streaming_not_supported" | "streaming_unavailable" | "privacy_constraint" | "cloud_constraint" | "offline" | "capability_unavailable" | "not_in_model_profile";
|
|
109
|
+
export type Code = "task_not_supported" | "run_not_supported" | "streaming_not_supported" | "streaming_unavailable" | "privacy_constraint" | "cloud_constraint" | "offline" | "capability_unavailable" | "not_in_model_profile" | "input_not_supported" | "output_delivery_not_supported" | "output_format_not_supported" | "locale_not_supported" | "voice_not_available";
|
|
@@ -128,6 +128,13 @@ export type ExecutionProvenance = {
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
export type ExecutionProvenanceAttempt = {
|
|
131
|
+
/**
|
|
132
|
+
* Whether the run committed to this provider during the attempt: its first content was
|
|
133
|
+
* delivered, it signalled the first possible audible effect, or it handed over an artifact.
|
|
134
|
+
* After commit a failure ends the run instead of falling back. Absent means the attempt did
|
|
135
|
+
* not commit.
|
|
136
|
+
*/
|
|
137
|
+
committed?: boolean;
|
|
131
138
|
/**
|
|
132
139
|
* Normalized error class of a failed attempt.
|
|
133
140
|
*/
|
|
@@ -160,4 +167,4 @@ export type ExecutionProvenanceRouteRejection = {
|
|
|
160
167
|
[property: string]: unknown;
|
|
161
168
|
}
|
|
162
169
|
|
|
163
|
-
export type Code = "task_not_supported" | "run_not_supported" | "streaming_not_supported" | "streaming_unavailable" | "privacy_constraint" | "cloud_constraint" | "offline" | "capability_unavailable" | "not_in_model_profile";
|
|
170
|
+
export type Code = "task_not_supported" | "run_not_supported" | "streaming_not_supported" | "streaming_unavailable" | "privacy_constraint" | "cloud_constraint" | "offline" | "capability_unavailable" | "not_in_model_profile" | "input_not_supported" | "output_delivery_not_supported" | "output_format_not_supported" | "locale_not_supported" | "voice_not_available";
|
package/src/generated/index.ts
CHANGED
|
@@ -12,5 +12,11 @@ export type { ModelPackage } from "./model-package.js";
|
|
|
12
12
|
export type { StreamRunHandle } from "./stream-run.js";
|
|
13
13
|
export type { StreamEvent } from "./stream-event.js";
|
|
14
14
|
export type { StreamTerminalOutcome } from "./stream-terminal-outcome.js";
|
|
15
|
+
export type { ProviderCapabilitySnapshot } from "./provider-capability-snapshot.js";
|
|
16
|
+
export type { ProviderDescriptor } from "./provider-descriptor.js";
|
|
17
|
+
export type { ProviderDynamicCapabilities } from "./provider-dynamic-capabilities.js";
|
|
18
|
+
export type { ArtifactReadRequest } from "./artifact-read-request.js";
|
|
19
|
+
export type { TaskOutput } from "./task-output.js";
|
|
20
|
+
export type { MediaArtifact } from "./media-artifact.js";
|
|
15
21
|
export type { ExecutionProvenance } from "./execution-provenance.js";
|
|
16
22
|
export * from "./schemas.js";
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/* This file was generated from JSON Schema using quicktype. Do not edit by hand. */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A reference to retrievable media a run produced (ADR 017). It carries no bytes and no
|
|
5
|
+
* location: an engine-owned artifact is read through the engine by id, and an
|
|
6
|
+
* application-owned one was written to an application destination. Media-neutral: audio,
|
|
7
|
+
* images and video share this shape and differ only in mediaType.
|
|
8
|
+
*/
|
|
9
|
+
export type MediaArtifact = {
|
|
10
|
+
/**
|
|
11
|
+
* Size of the media in bytes. Always set for an artifact the engine materialized.
|
|
12
|
+
*/
|
|
13
|
+
byteLength?: number;
|
|
14
|
+
/**
|
|
15
|
+
* The request's delivery.destinationRef the bytes were written to. Set exactly when owner
|
|
16
|
+
* is 'application'.
|
|
17
|
+
*/
|
|
18
|
+
destinationRef?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Duration of time-based media in milliseconds, where the producer knows it.
|
|
21
|
+
*/
|
|
22
|
+
durationMs?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Opaque, engine-issued identifier. Never a path, URL or provider identifier.
|
|
25
|
+
*/
|
|
26
|
+
id: string;
|
|
27
|
+
/**
|
|
28
|
+
* How long the engine keeps the bytes. 'until_disposed': until the application disposes the
|
|
29
|
+
* artifact or the process ends; the artifact outlives the run that produced it.
|
|
30
|
+
*/
|
|
31
|
+
lifetime: "until_disposed";
|
|
32
|
+
/**
|
|
33
|
+
* IANA media type of the bytes, e.g. 'audio/wav'. Encoding parameters ride on the media
|
|
34
|
+
* type (e.g. 'audio/L16;rate=22050').
|
|
35
|
+
*/
|
|
36
|
+
mediaType: string;
|
|
37
|
+
/**
|
|
38
|
+
* 'engine': the engine holds the bytes and the application reads them by id until it
|
|
39
|
+
* disposes the artifact. 'application': the bytes were written to the application
|
|
40
|
+
* destination named by destinationRef and the engine holds nothing.
|
|
41
|
+
*/
|
|
42
|
+
owner: ArtifactOwner;
|
|
43
|
+
[property: string]: unknown;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* How long the engine keeps the bytes. 'until_disposed': until the application disposes the
|
|
48
|
+
* artifact or the process ends; the artifact outlives the run that produced it.
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* 'engine': the engine holds the bytes and the application reads them by id until it
|
|
53
|
+
* disposes the artifact. 'application': the bytes were written to the application
|
|
54
|
+
* destination named by destinationRef and the engine holds nothing.
|
|
55
|
+
*/
|
|
56
|
+
export type ArtifactOwner = "engine" | "application";
|