@independo/inderun-contracts 0.2.2 → 0.3.0-dev.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/index.d.ts +3 -0
- package/dist/generated/index.d.ts.map +1 -1
- package/dist/generated/schemas.d.ts +540 -1
- package/dist/generated/schemas.d.ts.map +1 -1
- package/dist/generated/schemas.js +681 -1
- package/dist/generated/stream-event.d.ts +139 -0
- package/dist/generated/stream-event.d.ts.map +1 -0
- package/dist/generated/stream-event.js +2 -0
- package/dist/generated/stream-run.d.ts +31 -0
- package/dist/generated/stream-run.d.ts.map +1 -0
- package/dist/generated/stream-run.js +2 -0
- package/dist/generated/stream-terminal-outcome.d.ts +165 -0
- package/dist/generated/stream-terminal-outcome.d.ts.map +1 -0
- package/dist/generated/stream-terminal-outcome.js +2 -0
- package/dist/generated/telemetry-event.d.ts +1 -1
- package/dist/generated/telemetry-event.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/validators.d.ts +9 -0
- package/dist/validators.d.ts.map +1 -1
- package/dist/validators.js +26 -1
- package/package.json +1 -1
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The canonical Mode 2 streaming event union, discriminated by 'type'. Every variant shares
|
|
3
|
+
* an envelope of schemaVersion, runId, sequence, timestamp, and type. 'sequence' is the
|
|
4
|
+
* ordering authority for events within a run (a monotonically increasing integer starting
|
|
5
|
+
* at 0 per runId) — consumers must order by 'sequence', not by arrival order, since a
|
|
6
|
+
* bridge hop (e.g. a future Capacitor bridge) could reorder delivery. Known event types are
|
|
7
|
+
* split into user-visible content ('content_delta', 'content_snapshot') and
|
|
8
|
+
* mechanical/diagnostic types ('lifecycle', 'diagnostic', 'terminal') so SDKs can
|
|
9
|
+
* distinguish what belongs in a chat UI from what is orchestration detail. Forward
|
|
10
|
+
* compatibility: this union closes with an open 'unknown_event' branch so a consumer built
|
|
11
|
+
* against an older revision of this schema does not hard-fail when a newer, additive minor
|
|
12
|
+
* revision introduces a new known type; per contracts/README.md's schema evolution policy,
|
|
13
|
+
* SDKs must treat an unrecognized 'type' as ignore-or-pass-through-for-diagnostics, never
|
|
14
|
+
* as a hard error. Design seam only; no engine or provider implementation exists yet (see
|
|
15
|
+
* docs/architecture/architecture.md).
|
|
16
|
+
*/
|
|
17
|
+
export type StreamEvent = {
|
|
18
|
+
/**
|
|
19
|
+
* Event-specific diagnostic metadata. It must not contain prompt payloads or raw secrets,
|
|
20
|
+
* matching the same guardrail as TelemetryEvent.payload.
|
|
21
|
+
*
|
|
22
|
+
* Structurally identical to StreamTerminalOutcome
|
|
23
|
+
* (contracts/schemas/stream-terminal-outcome.schema.json), duplicated by value here rather
|
|
24
|
+
* than by $ref, matching this repo's schema convention of no cross-file references. Keep
|
|
25
|
+
* both shapes in sync; a cross-check test asserts a shared fixture validates against both
|
|
26
|
+
* schemas.
|
|
27
|
+
*
|
|
28
|
+
* Optional event-specific payload for the unrecognized type. It must not contain prompt
|
|
29
|
+
* payloads or raw secrets.
|
|
30
|
+
*/
|
|
31
|
+
payload?: Payload;
|
|
32
|
+
/**
|
|
33
|
+
* Opaque run identifier this event belongs to, matching StreamRunHandle.runId.
|
|
34
|
+
*/
|
|
35
|
+
runId: string;
|
|
36
|
+
/**
|
|
37
|
+
* Contract schema version used to interpret this event payload.
|
|
38
|
+
*/
|
|
39
|
+
schemaVersion: "1.0";
|
|
40
|
+
/**
|
|
41
|
+
* Zero-based, monotonically increasing event index within this run. The ordering authority;
|
|
42
|
+
* do not rely on delivery/arrival order.
|
|
43
|
+
*
|
|
44
|
+
* Zero-based, monotonically increasing event index within this run. This is always the
|
|
45
|
+
* highest sequence number for the run: the terminal event.
|
|
46
|
+
*/
|
|
47
|
+
sequence: number;
|
|
48
|
+
/**
|
|
49
|
+
* Wall-clock event timestamp in Unix epoch milliseconds.
|
|
50
|
+
*/
|
|
51
|
+
timestamp: number;
|
|
52
|
+
/**
|
|
53
|
+
* User-visible content: an incremental text increment since the previous content_delta or
|
|
54
|
+
* content_snapshot event. Mirrors ProviderDescriptor.streamingStyle 'tokens'/'chunks'
|
|
55
|
+
* (packages/inderun-web/src/core/provider.ts) — providers reporting either style normalize
|
|
56
|
+
* to content_delta.
|
|
57
|
+
*
|
|
58
|
+
* User-visible content: the full cumulative text produced so far. Mirrors
|
|
59
|
+
* ProviderDescriptor.streamingStyle 'snapshots' (packages/inderun-web/src/core/provider.ts)
|
|
60
|
+
* — providers reporting that style normalize to content_snapshot rather than
|
|
61
|
+
* content_delta.
|
|
62
|
+
*
|
|
63
|
+
* Mechanical/diagnostic: a run lifecycle transition (e.g. provider selection, execution
|
|
64
|
+
* start). Not user-visible content; not part of the generated text.
|
|
65
|
+
*
|
|
66
|
+
* Mechanical/diagnostic: free-form orchestration or provider diagnostic detail. Not
|
|
67
|
+
* user-visible content.
|
|
68
|
+
*
|
|
69
|
+
* Terminal: the last event of the run, carrying the mutually-exclusive
|
|
70
|
+
* completion/error/cancellation outcome. No further StreamEvent is delivered for this runId
|
|
71
|
+
* after this event.
|
|
72
|
+
*
|
|
73
|
+
* Forward-compatibility catch-all: any event type not among the known constants above.
|
|
74
|
+
* Exists so a consumer validating against this revision of the schema does not hard-fail
|
|
75
|
+
* when a future additive revision introduces a new known event type; SDKs must ignore or
|
|
76
|
+
* pass through such events for diagnostics rather than treating them as an error.
|
|
77
|
+
*/
|
|
78
|
+
type: string;
|
|
79
|
+
[property: string]: unknown;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Event-specific diagnostic metadata. It must not contain prompt payloads or raw secrets,
|
|
83
|
+
* matching the same guardrail as TelemetryEvent.payload.
|
|
84
|
+
*
|
|
85
|
+
* Optional event-specific payload for the unrecognized type. It must not contain prompt
|
|
86
|
+
* payloads or raw secrets.
|
|
87
|
+
*/
|
|
88
|
+
export type Payload = {
|
|
89
|
+
/**
|
|
90
|
+
* The incremental text produced since the previous content event.
|
|
91
|
+
*
|
|
92
|
+
* The full cumulative text produced by the run so far.
|
|
93
|
+
*/
|
|
94
|
+
text?: string;
|
|
95
|
+
/**
|
|
96
|
+
* The lifecycle phase reached.
|
|
97
|
+
*/
|
|
98
|
+
phase?: Phase;
|
|
99
|
+
finalText?: string;
|
|
100
|
+
outcome?: Outcome;
|
|
101
|
+
runId?: string;
|
|
102
|
+
schemaVersion?: "1.0";
|
|
103
|
+
telemetry?: Telemetry;
|
|
104
|
+
usage?: Usage;
|
|
105
|
+
error?: Error;
|
|
106
|
+
partialText?: string;
|
|
107
|
+
reason?: string;
|
|
108
|
+
[property: string]: unknown;
|
|
109
|
+
};
|
|
110
|
+
export type Error = {
|
|
111
|
+
details?: {
|
|
112
|
+
[key: string]: unknown;
|
|
113
|
+
};
|
|
114
|
+
errorClass: ErrorClass;
|
|
115
|
+
message: string;
|
|
116
|
+
providerId?: string;
|
|
117
|
+
retryable?: boolean;
|
|
118
|
+
retryAfterMs?: number;
|
|
119
|
+
schemaVersion: "1.0";
|
|
120
|
+
[property: string]: unknown;
|
|
121
|
+
};
|
|
122
|
+
export type ErrorClass = "CapabilityMismatch" | "Offline" | "AuthError" | "RateLimited" | "Timeout" | "Unavailable" | "Internal";
|
|
123
|
+
export type Outcome = "completed" | "error" | "cancelled";
|
|
124
|
+
/**
|
|
125
|
+
* The lifecycle phase reached.
|
|
126
|
+
*/
|
|
127
|
+
export type Phase = "provider_selected" | "started";
|
|
128
|
+
export type Telemetry = {
|
|
129
|
+
providerUsed: string;
|
|
130
|
+
totalMs: number;
|
|
131
|
+
[property: string]: unknown;
|
|
132
|
+
};
|
|
133
|
+
export type Usage = {
|
|
134
|
+
inputTokens?: number;
|
|
135
|
+
outputTokens?: number;
|
|
136
|
+
totalTokens?: number;
|
|
137
|
+
[property: string]: unknown;
|
|
138
|
+
};
|
|
139
|
+
//# sourceMappingURL=stream-event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"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;IACtB,SAAS,CAAC,EAAK,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,KAAK,CAAC;IACrB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B,CAAA;AAED,MAAM,MAAM,UAAU,GAAG,oBAAoB,GAAG,SAAS,GAAG,WAAW,GAAG,aAAa,GAAG,SAAS,GAAG,aAAa,GAAG,UAAU,CAAC;AAEjI,MAAM,MAAM,OAAO,GAAG,WAAW,GAAG,OAAO,GAAG,WAAW,CAAC;AAE1D;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG,mBAAmB,GAAG,SAAS,CAAC;AAEpD,MAAM,MAAM,SAAS,GAAG;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAO,MAAM,CAAC;IACrB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B,CAAA;AAED,MAAM,MAAM,KAAK,GAAG;IAChB,WAAW,CAAC,EAAG,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAG,MAAM,CAAC;IACtB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The serializable acknowledgment returned when a Mode 2 stream is opened, before any
|
|
3
|
+
* StreamEvent has arrived. This is the identity/correlation contract only: the live,
|
|
4
|
+
* consumable stream itself is a platform-idiomatic construct (an AsyncIterable<StreamEvent>
|
|
5
|
+
* in TypeScript, a Flow<StreamEvent> in Kotlin, an AsyncThrowingStream<StreamEvent, Error>
|
|
6
|
+
* in Swift) that is never serialized and is out of scope for this schema. Design seam only;
|
|
7
|
+
* no engine or provider implementation exists yet (see docs/architecture/architecture.md).
|
|
8
|
+
*/
|
|
9
|
+
export type StreamRunHandle = {
|
|
10
|
+
/**
|
|
11
|
+
* Identifier of the provider selected to service this stream, if routing has completed by
|
|
12
|
+
* the time the handle is returned. Absent while route selection is still pending.
|
|
13
|
+
*/
|
|
14
|
+
providerId?: string;
|
|
15
|
+
/**
|
|
16
|
+
* A unique, opaque identifier assigned by the engine for this stream run. Every StreamEvent
|
|
17
|
+
* and the terminal StreamTerminalOutcome for this run carry the same runId, matching the
|
|
18
|
+
* identity convention used by TaskResult.runId and IndeRunError.runId.
|
|
19
|
+
*/
|
|
20
|
+
runId: string;
|
|
21
|
+
/**
|
|
22
|
+
* Contract schema version used to interpret this handle payload.
|
|
23
|
+
*/
|
|
24
|
+
schemaVersion: "1.0";
|
|
25
|
+
/**
|
|
26
|
+
* Wall-clock time the stream run was opened, in Unix epoch milliseconds.
|
|
27
|
+
*/
|
|
28
|
+
startedAt: number;
|
|
29
|
+
[property: string]: unknown;
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=stream-run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream-run.d.ts","sourceRoot":"","sources":["../../src/generated/stream-run.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,GAAG;IAC1B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,aAAa,EAAE,KAAK,CAAC;IACrB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B,CAAA"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a Mode 2 stream run ended. Completion, error, and cancellation are mutually exclusive
|
|
3
|
+
* terminal outcomes, enforced here as a closed set of three oneOf branches discriminated by
|
|
4
|
+
* 'outcome' (unlike StreamEvent.type, this set is not open-ended: the three-way terminal
|
|
5
|
+
* outcome is a fixed architectural guarantee, not something new outcome kinds get added
|
|
6
|
+
* to). Exactly one StreamTerminalOutcome is produced per run, and no further StreamEvent is
|
|
7
|
+
* delivered after it (see docs/architecture/architecture.md, 'Cancellation And Fallback').
|
|
8
|
+
* This shape is also embedded by value as the payload of the terminal StreamEvent
|
|
9
|
+
* (stream-event.schema.json) so it can additionally be exposed standalone, e.g. as a
|
|
10
|
+
* completion future/promise a stream handle resolves independently of consuming the full
|
|
11
|
+
* event sequence; the two copies must stay structurally identical. Note on
|
|
12
|
+
* additionalProperties: per this repo's forward-compatible convention every branch permits
|
|
13
|
+
* unknown extra fields, so mutual exclusivity is enforced via the required 'outcome'
|
|
14
|
+
* discriminator plus each branch's own required peer field (finalText/error/partialText)
|
|
15
|
+
* being present, not by forbidding a payload from also carrying an unrelated stray field
|
|
16
|
+
* from another branch's vocabulary.
|
|
17
|
+
*/
|
|
18
|
+
export type StreamTerminalOutcome = {
|
|
19
|
+
/**
|
|
20
|
+
* The full, cumulative text produced by the run. Equivalent in role to
|
|
21
|
+
* TaskResult.output.text for Mode 1.
|
|
22
|
+
*/
|
|
23
|
+
finalText?: string;
|
|
24
|
+
/**
|
|
25
|
+
* The stream completed normally: every provider-generated event was delivered before this
|
|
26
|
+
* outcome was produced.
|
|
27
|
+
*
|
|
28
|
+
* The stream ended in failure: validation, routing (no eligible provider), or every
|
|
29
|
+
* attempted provider failing.
|
|
30
|
+
*
|
|
31
|
+
* The stream was cancelled. No further StreamEvent is delivered after this outcome, and no
|
|
32
|
+
* further fallback attempt is made, per the engine's cancellation guarantee.
|
|
33
|
+
*/
|
|
34
|
+
outcome: Outcome;
|
|
35
|
+
/**
|
|
36
|
+
* The stream run this outcome terminates, matching StreamRunHandle.runId and every
|
|
37
|
+
* StreamEvent.runId for the run.
|
|
38
|
+
*/
|
|
39
|
+
runId: string;
|
|
40
|
+
/**
|
|
41
|
+
* Contract schema version used to interpret this outcome payload.
|
|
42
|
+
*/
|
|
43
|
+
schemaVersion: "1.0";
|
|
44
|
+
/**
|
|
45
|
+
* Required metadata providing an overview of the execution result and performance metrics.
|
|
46
|
+
* Same shape as TaskResult.telemetry.
|
|
47
|
+
*/
|
|
48
|
+
telemetry?: Telemetry;
|
|
49
|
+
/**
|
|
50
|
+
* Optional metadata regarding the quantity of tokens processed by the provider. Same shape
|
|
51
|
+
* as TaskResult.usage.
|
|
52
|
+
*/
|
|
53
|
+
usage?: Usage;
|
|
54
|
+
/**
|
|
55
|
+
* The normalized error for this failure. Structurally identical to IndeRunError
|
|
56
|
+
* (contracts/schemas/inderun-error.schema.json), duplicated by value here rather than by
|
|
57
|
+
* $ref, matching this repo's schema convention of no cross-file references. Keep both
|
|
58
|
+
* shapes in sync; a cross-check test asserts a shared fixture validates against both
|
|
59
|
+
* schemas.
|
|
60
|
+
*/
|
|
61
|
+
error?: Error;
|
|
62
|
+
/**
|
|
63
|
+
* Whatever cumulative text had already been delivered via content_delta/content_snapshot
|
|
64
|
+
* StreamEvents before the cancellation point. May be empty if cancellation occurred before
|
|
65
|
+
* any content was produced.
|
|
66
|
+
*/
|
|
67
|
+
partialText?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Optional human-readable reason the run was cancelled (e.g. caller-initiated abort). Not a
|
|
70
|
+
* machine-taxonomy field; use errorClass on the 'error' outcome branch for failure
|
|
71
|
+
* classification.
|
|
72
|
+
*/
|
|
73
|
+
reason?: string;
|
|
74
|
+
[property: string]: unknown;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* The normalized error for this failure. Structurally identical to IndeRunError
|
|
78
|
+
* (contracts/schemas/inderun-error.schema.json), duplicated by value here rather than by
|
|
79
|
+
* $ref, matching this repo's schema convention of no cross-file references. Keep both
|
|
80
|
+
* shapes in sync; a cross-check test asserts a shared fixture validates against both
|
|
81
|
+
* schemas.
|
|
82
|
+
*/
|
|
83
|
+
export type Error = {
|
|
84
|
+
/**
|
|
85
|
+
* Optional structured diagnostic details. It must not contain raw secrets.
|
|
86
|
+
*/
|
|
87
|
+
details?: {
|
|
88
|
+
[key: string]: unknown;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Normalized error taxonomy, identical to IndeRunError.errorClass: CapabilityMismatch
|
|
92
|
+
* (request needs something no eligible provider supports), Offline/Unavailable (provider
|
|
93
|
+
* unreachable or not ready), AuthError (credential/auth failure), RateLimited (provider
|
|
94
|
+
* throttled the request), Timeout (provider exceeded its execution budget), Internal
|
|
95
|
+
* (unexpected engine-side failure).
|
|
96
|
+
*/
|
|
97
|
+
errorClass: ErrorClass;
|
|
98
|
+
/**
|
|
99
|
+
* Human-readable error message suitable for logs and developer diagnostics.
|
|
100
|
+
*/
|
|
101
|
+
message: string;
|
|
102
|
+
/**
|
|
103
|
+
* Identifier of the provider associated with the failure, if execution reached a provider.
|
|
104
|
+
*/
|
|
105
|
+
providerId?: string;
|
|
106
|
+
/**
|
|
107
|
+
* Whether retrying the same request may succeed.
|
|
108
|
+
*/
|
|
109
|
+
retryable?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Optional suggested delay before retrying, in milliseconds.
|
|
112
|
+
*/
|
|
113
|
+
retryAfterMs?: number;
|
|
114
|
+
/**
|
|
115
|
+
* Contract schema version used to interpret the error payload.
|
|
116
|
+
*/
|
|
117
|
+
schemaVersion: "1.0";
|
|
118
|
+
[property: string]: unknown;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Normalized error taxonomy, identical to IndeRunError.errorClass: CapabilityMismatch
|
|
122
|
+
* (request needs something no eligible provider supports), Offline/Unavailable (provider
|
|
123
|
+
* unreachable or not ready), AuthError (credential/auth failure), RateLimited (provider
|
|
124
|
+
* throttled the request), Timeout (provider exceeded its execution budget), Internal
|
|
125
|
+
* (unexpected engine-side failure).
|
|
126
|
+
*/
|
|
127
|
+
export type ErrorClass = "CapabilityMismatch" | "Offline" | "AuthError" | "RateLimited" | "Timeout" | "Unavailable" | "Internal";
|
|
128
|
+
export type Outcome = "completed" | "error" | "cancelled";
|
|
129
|
+
/**
|
|
130
|
+
* Required metadata providing an overview of the execution result and performance metrics.
|
|
131
|
+
* Same shape as TaskResult.telemetry.
|
|
132
|
+
*/
|
|
133
|
+
export type Telemetry = {
|
|
134
|
+
/**
|
|
135
|
+
* The identifier for the specific provider that handled the request (e.g.,
|
|
136
|
+
* 'openai_compatible_cloud').
|
|
137
|
+
*/
|
|
138
|
+
providerUsed: string;
|
|
139
|
+
/**
|
|
140
|
+
* Measured execution duration in milliseconds, including route selection and result
|
|
141
|
+
* processing.
|
|
142
|
+
*/
|
|
143
|
+
totalMs: number;
|
|
144
|
+
[property: string]: unknown;
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* Optional metadata regarding the quantity of tokens processed by the provider. Same shape
|
|
148
|
+
* as TaskResult.usage.
|
|
149
|
+
*/
|
|
150
|
+
export type Usage = {
|
|
151
|
+
/**
|
|
152
|
+
* Number of input tokens consumed, as reported by the provider.
|
|
153
|
+
*/
|
|
154
|
+
inputTokens?: number;
|
|
155
|
+
/**
|
|
156
|
+
* Number of output tokens generated, as reported by the provider.
|
|
157
|
+
*/
|
|
158
|
+
outputTokens?: number;
|
|
159
|
+
/**
|
|
160
|
+
* Aggregated token count for this request, as reported by the provider.
|
|
161
|
+
*/
|
|
162
|
+
totalTokens?: number;
|
|
163
|
+
[property: string]: unknown;
|
|
164
|
+
};
|
|
165
|
+
//# sourceMappingURL=stream-terminal-outcome.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream-terminal-outcome.d.ts","sourceRoot":"","sources":["../../src/generated/stream-terminal-outcome.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAChC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;;;OASG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,aAAa,EAAE,KAAK,CAAC;IACrB;;;OAGG;IACH,SAAS,CAA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AE,MAAM,CAAC;IACrB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B,CAAA"}
|
|
@@ -25,5 +25,5 @@ export type TelemetryEvent = {
|
|
|
25
25
|
/**
|
|
26
26
|
* Telemetry event kind emitted by the orchestrator or provider integration.
|
|
27
27
|
*/
|
|
28
|
-
export type Type = "route_decided" | "attempt_succeeded" | "attempt_failed";
|
|
28
|
+
export type Type = "route_decided" | "attempt_succeeded" | "attempt_failed" | "stream_attempt_started" | "stream_attempt_succeeded" | "stream_attempt_failed" | "stream_completed" | "stream_failed" | "stream_cancelled";
|
|
29
29
|
//# sourceMappingURL=telemetry-event.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry-event.d.ts","sourceRoot":"","sources":["../../src/generated/telemetry-event.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IACzB;;OAEG;IACH,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IACpC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,IAAI,EAAE,IAAI,CAAC;IACX,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,IAAI,GAAG,eAAe,GAAG,mBAAmB,GAAG,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"telemetry-event.d.ts","sourceRoot":"","sources":["../../src/generated/telemetry-event.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IACzB;;OAEG;IACH,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IACpC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,IAAI,EAAE,IAAI,CAAC;IACX,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,IAAI,GAAG,eAAe,GAAG,mBAAmB,GAAG,gBAAgB,GAAG,wBAAwB,GAAG,0BAA0B,GAAG,uBAAuB,GAAG,kBAAkB,GAAG,eAAe,GAAG,kBAAkB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type * from "./generated/index.js";
|
|
2
|
-
export { httpRequestSchema, httpResponseSchema, inderunErrorSchema, modelPackageSchema, routePlanSchema, routePlannerInputSchema, taskRequestSchema, taskResultSchema, telemetryEventSchema } from "./generated/index.js";
|
|
3
|
-
export { getHttpRequestValidationIssues, getHttpResponseValidationIssues, getIndeRunErrorValidationIssues, getModelPackageValidationIssues, getRoutePlanValidationIssues, getRoutePlannerInputValidationIssues, getTaskRequestValidationIssues, getTaskResultValidationIssues, getTelemetryEventValidationIssues, validateHttpRequest, validateHttpResponse, validateIndeRunError, validateModelPackage, validateRoutePlan, validateRoutePlannerInput, validateTaskRequest, validateTaskResult, validateTelemetryEvent, type ValidationIssue } from "./validators.js";
|
|
2
|
+
export { httpRequestSchema, httpResponseSchema, inderunErrorSchema, modelPackageSchema, routePlanSchema, routePlannerInputSchema, streamEventSchema, streamRunSchema, streamTerminalOutcomeSchema, taskRequestSchema, taskResultSchema, telemetryEventSchema } from "./generated/index.js";
|
|
3
|
+
export { getHttpRequestValidationIssues, getHttpResponseValidationIssues, getIndeRunErrorValidationIssues, getModelPackageValidationIssues, getRoutePlanValidationIssues, getRoutePlannerInputValidationIssues, getStreamEventValidationIssues, getStreamRunHandleValidationIssues, getStreamTerminalOutcomeValidationIssues, getTaskRequestValidationIssues, getTaskResultValidationIssues, getTelemetryEventValidationIssues, validateHttpRequest, validateHttpResponse, validateIndeRunError, validateModelPackage, validateRoutePlan, validateRoutePlannerInput, validateStreamEvent, validateStreamRunHandle, validateStreamTerminalOutcome, validateTaskRequest, validateTaskResult, validateTelemetryEvent, type ValidationIssue } from "./validators.js";
|
|
4
4
|
export type { FinishReason, IndeRunErrorClass, ModelPackageFormat, ModelSourceType, SchemaVersion, SharedRoutePlan, SharedRoutePlannerInput, TaskKind, RoutingConstraints, RoutingPreferences } from "./types.js";
|
|
5
5
|
export type { ConnectivityService, ThermalState, DeviceConstraintsService, SecureStorageService, ClockService, HttpClientService, TelemetryEventType, TelemetryService, HostServices } from "./host.js";
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,sBAAsB,CAAC;AAC1C,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,uBAAuB,EACvB,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,8BAA8B,EAC9B,+BAA+B,EAC/B,+BAA+B,EAC/B,+BAA+B,EAC/B,4BAA4B,EAC5B,oCAAoC,EACpC,8BAA8B,EAC9B,6BAA6B,EAC7B,iCAAiC,EACjC,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,KAAK,eAAe,EACrB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,eAAe,EACf,uBAAuB,EACvB,QAAQ,EACR,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,mBAAmB,EACnB,YAAY,EACZ,wBAAwB,EACxB,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACb,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,sBAAsB,CAAC;AAC1C,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,uBAAuB,EACvB,iBAAiB,EACjB,eAAe,EACf,2BAA2B,EAC3B,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,8BAA8B,EAC9B,+BAA+B,EAC/B,+BAA+B,EAC/B,+BAA+B,EAC/B,4BAA4B,EAC5B,oCAAoC,EACpC,8BAA8B,EAC9B,kCAAkC,EAClC,wCAAwC,EACxC,8BAA8B,EAC9B,6BAA6B,EAC7B,iCAAiC,EACjC,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,mBAAmB,EACnB,uBAAuB,EACvB,6BAA6B,EAC7B,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,KAAK,eAAe,EACrB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,eAAe,EACf,uBAAuB,EACvB,QAAQ,EACR,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,mBAAmB,EACnB,YAAY,EACZ,wBAAwB,EACxB,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACb,MAAM,WAAW,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { httpRequestSchema, httpResponseSchema, inderunErrorSchema, modelPackageSchema, routePlanSchema, routePlannerInputSchema, taskRequestSchema, taskResultSchema, telemetryEventSchema } from "./generated/index.js";
|
|
2
|
-
export { getHttpRequestValidationIssues, getHttpResponseValidationIssues, getIndeRunErrorValidationIssues, getModelPackageValidationIssues, getRoutePlanValidationIssues, getRoutePlannerInputValidationIssues, getTaskRequestValidationIssues, getTaskResultValidationIssues, getTelemetryEventValidationIssues, validateHttpRequest, validateHttpResponse, validateIndeRunError, validateModelPackage, validateRoutePlan, validateRoutePlannerInput, validateTaskRequest, validateTaskResult, validateTelemetryEvent } from "./validators.js";
|
|
1
|
+
export { httpRequestSchema, httpResponseSchema, inderunErrorSchema, modelPackageSchema, routePlanSchema, routePlannerInputSchema, streamEventSchema, streamRunSchema, streamTerminalOutcomeSchema, taskRequestSchema, taskResultSchema, telemetryEventSchema } from "./generated/index.js";
|
|
2
|
+
export { getHttpRequestValidationIssues, getHttpResponseValidationIssues, getIndeRunErrorValidationIssues, getModelPackageValidationIssues, getRoutePlanValidationIssues, getRoutePlannerInputValidationIssues, getStreamEventValidationIssues, getStreamRunHandleValidationIssues, getStreamTerminalOutcomeValidationIssues, getTaskRequestValidationIssues, getTaskResultValidationIssues, getTelemetryEventValidationIssues, validateHttpRequest, validateHttpResponse, validateIndeRunError, validateModelPackage, validateRoutePlan, validateRoutePlannerInput, validateStreamEvent, validateStreamRunHandle, validateStreamTerminalOutcome, validateTaskRequest, validateTaskResult, validateTelemetryEvent } from "./validators.js";
|
package/dist/validators.d.ts
CHANGED
|
@@ -4,6 +4,9 @@ import type { HttpResponse } from "./generated/http-response.js";
|
|
|
4
4
|
import type { ModelPackage } from "./generated/model-package.js";
|
|
5
5
|
import type { RoutePlan } from "./generated/route-plan.js";
|
|
6
6
|
import type { RoutePlannerInput } from "./generated/route-planner-input.js";
|
|
7
|
+
import type { StreamEvent } from "./generated/stream-event.js";
|
|
8
|
+
import type { StreamRunHandle } from "./generated/stream-run.js";
|
|
9
|
+
import type { StreamTerminalOutcome } from "./generated/stream-terminal-outcome.js";
|
|
7
10
|
import type { TaskRequest } from "./generated/task-request.js";
|
|
8
11
|
import type { TaskResult } from "./generated/task-result.js";
|
|
9
12
|
import type { TelemetryEvent } from "./generated/telemetry-event.js";
|
|
@@ -21,6 +24,9 @@ export declare function validateTelemetryEvent(value: unknown): value is Telemet
|
|
|
21
24
|
export declare function validateRoutePlannerInput(value: unknown): value is RoutePlannerInput;
|
|
22
25
|
export declare function validateRoutePlan(value: unknown): value is RoutePlan;
|
|
23
26
|
export declare function validateModelPackage(value: unknown): value is ModelPackage;
|
|
27
|
+
export declare function validateStreamRunHandle(value: unknown): value is StreamRunHandle;
|
|
28
|
+
export declare function validateStreamEvent(value: unknown): value is StreamEvent;
|
|
29
|
+
export declare function validateStreamTerminalOutcome(value: unknown): value is StreamTerminalOutcome;
|
|
24
30
|
export declare function getTaskRequestValidationIssues(value: unknown): ValidationIssue[];
|
|
25
31
|
export declare function getTaskResultValidationIssues(value: unknown): ValidationIssue[];
|
|
26
32
|
export declare function getIndeRunErrorValidationIssues(value: unknown): ValidationIssue[];
|
|
@@ -30,4 +36,7 @@ export declare function getTelemetryEventValidationIssues(value: unknown): Valid
|
|
|
30
36
|
export declare function getRoutePlannerInputValidationIssues(value: unknown): ValidationIssue[];
|
|
31
37
|
export declare function getRoutePlanValidationIssues(value: unknown): ValidationIssue[];
|
|
32
38
|
export declare function getModelPackageValidationIssues(value: unknown): ValidationIssue[];
|
|
39
|
+
export declare function getStreamRunHandleValidationIssues(value: unknown): ValidationIssue[];
|
|
40
|
+
export declare function getStreamEventValidationIssues(value: unknown): ValidationIssue[];
|
|
41
|
+
export declare function getStreamTerminalOutcomeValidationIssues(value: unknown): ValidationIssue[];
|
|
33
42
|
//# sourceMappingURL=validators.d.ts.map
|
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,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,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;AAe5E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAIrE,MAAM,MAAM,eAAe,GAAG;IA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,EAAE,CAIjF;AAED,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,EAAE,CAEhF;AAED,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,EAAE,CAEjF;AAED,wBAAgB,iCAAiC,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,EAAE,CAInF;AAED,wBAAgB,oCAAoC,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,EAAE,CAEtF;AAED,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,EAAE,CAE9E;AAED,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,EAAE,CAIjF;AAED,wBAAgB,kCAAkC,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,EAAE,CAEpF;AAED,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,EAAE,CAIhF;AAED,wBAAgB,wCAAwC,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,EAAE,CAI1F"}
|
package/dist/validators.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Ajv2020 from "ajv/dist/2020.js";
|
|
2
|
-
import { httpRequestSchema, httpResponseSchema, inderunErrorSchema, modelPackageSchema, routePlanSchema, routePlannerInputSchema, taskRequestSchema, taskResultSchema, telemetryEventSchema } from "./generated/index.js";
|
|
2
|
+
import { httpRequestSchema, httpResponseSchema, inderunErrorSchema, modelPackageSchema, routePlanSchema, routePlannerInputSchema, streamEventSchema, streamRunSchema, streamTerminalOutcomeSchema, taskRequestSchema, taskResultSchema, telemetryEventSchema } from "./generated/index.js";
|
|
3
3
|
const Ajv2020Constructor = Ajv2020;
|
|
4
4
|
const ajv = new Ajv2020Constructor({
|
|
5
5
|
allErrors: true,
|
|
@@ -16,6 +16,9 @@ const validateTelemetryEventSchema = ajv.compile(telemetryEventSchema);
|
|
|
16
16
|
const validateRoutePlannerInputSchema = ajv.compile(routePlannerInputSchema);
|
|
17
17
|
const validateRoutePlanSchema = ajv.compile(routePlanSchema);
|
|
18
18
|
const validateModelPackageSchema = ajv.compile(modelPackageSchema);
|
|
19
|
+
const validateStreamRunHandleSchema = ajv.compile(streamRunSchema);
|
|
20
|
+
const validateStreamEventSchema = ajv.compile(streamEventSchema);
|
|
21
|
+
const validateStreamTerminalOutcomeSchema = ajv.compile(streamTerminalOutcomeSchema);
|
|
19
22
|
export function validateTaskRequest(value) {
|
|
20
23
|
return getTaskRequestValidationIssues(value).length === 0;
|
|
21
24
|
}
|
|
@@ -43,6 +46,15 @@ export function validateRoutePlan(value) {
|
|
|
43
46
|
export function validateModelPackage(value) {
|
|
44
47
|
return getModelPackageValidationIssues(value).length === 0;
|
|
45
48
|
}
|
|
49
|
+
export function validateStreamRunHandle(value) {
|
|
50
|
+
return getStreamRunHandleValidationIssues(value).length === 0;
|
|
51
|
+
}
|
|
52
|
+
export function validateStreamEvent(value) {
|
|
53
|
+
return getStreamEventValidationIssues(value).length === 0;
|
|
54
|
+
}
|
|
55
|
+
export function validateStreamTerminalOutcome(value) {
|
|
56
|
+
return getStreamTerminalOutcomeValidationIssues(value).length === 0;
|
|
57
|
+
}
|
|
46
58
|
export function getTaskRequestValidationIssues(value) {
|
|
47
59
|
const issues = getValidationIssues(validateTaskRequestSchema, value, {
|
|
48
60
|
forbidInlineSecrets: true
|
|
@@ -82,6 +94,19 @@ export function getModelPackageValidationIssues(value) {
|
|
|
82
94
|
forbidInlineSecrets: true
|
|
83
95
|
});
|
|
84
96
|
}
|
|
97
|
+
export function getStreamRunHandleValidationIssues(value) {
|
|
98
|
+
return getValidationIssues(validateStreamRunHandleSchema, value);
|
|
99
|
+
}
|
|
100
|
+
export function getStreamEventValidationIssues(value) {
|
|
101
|
+
return getValidationIssues(validateStreamEventSchema, value, {
|
|
102
|
+
forbidInlineSecrets: true
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
export function getStreamTerminalOutcomeValidationIssues(value) {
|
|
106
|
+
return getValidationIssues(validateStreamTerminalOutcomeSchema, value, {
|
|
107
|
+
forbidInlineSecrets: true
|
|
108
|
+
});
|
|
109
|
+
}
|
|
85
110
|
function getValidationIssues(validateSchema, value, options = {}) {
|
|
86
111
|
const issues = [];
|
|
87
112
|
if (!validateSchema(value)) {
|