@independo/inderun-web 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.
Files changed (43) hide show
  1. package/dist/core/artifacts.d.ts +110 -0
  2. package/dist/core/artifacts.d.ts.map +1 -0
  3. package/dist/core/artifacts.js +190 -0
  4. package/dist/core/engine.d.ts +28 -1
  5. package/dist/core/engine.d.ts.map +1 -1
  6. package/dist/core/engine.js +232 -28
  7. package/dist/core/generated/inderun-api.d.ts +12 -4
  8. package/dist/core/generated/inderun-api.d.ts.map +1 -1
  9. package/dist/core/host.d.ts +1 -1
  10. package/dist/core/host.d.ts.map +1 -1
  11. package/dist/core/provenance.d.ts +5 -2
  12. package/dist/core/provenance.d.ts.map +1 -1
  13. package/dist/core/provenance.js +6 -2
  14. package/dist/core/provider.d.ts +50 -130
  15. package/dist/core/provider.d.ts.map +1 -1
  16. package/dist/core/route-planner.d.ts +5 -5
  17. package/dist/core/route-planner.d.ts.map +1 -1
  18. package/dist/core/route-planner.js +15 -29
  19. package/dist/core/router.d.ts +16 -0
  20. package/dist/core/router.d.ts.map +1 -1
  21. package/dist/core/router.js +14 -5
  22. package/dist/core/task-profiles.d.ts +54 -0
  23. package/dist/core/task-profiles.d.ts.map +1 -0
  24. package/dist/core/task-profiles.js +92 -0
  25. package/dist/facade/text.d.ts.map +1 -1
  26. package/dist/facade/text.js +5 -3
  27. package/dist/index.d.ts +1 -1
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/providers/onnx/runtime.d.ts +2 -2
  30. package/dist/providers/onnx/runtime.d.ts.map +1 -1
  31. package/package.json +3 -3
  32. package/src/core/artifacts.ts +280 -0
  33. package/src/core/engine.ts +281 -27
  34. package/src/core/generated/inderun-api.ts +12 -4
  35. package/src/core/host.ts +1 -0
  36. package/src/core/provenance.ts +7 -2
  37. package/src/core/provider.ts +64 -135
  38. package/src/core/route-planner.ts +20 -36
  39. package/src/core/router.ts +30 -7
  40. package/src/core/task-profiles.ts +145 -0
  41. package/src/facade/text.ts +5 -3
  42. package/src/index.ts +6 -1
  43. package/src/providers/onnx/runtime.ts +2 -2
@@ -1,136 +1,15 @@
1
- import type { StreamEvent, StreamRunHandle, TaskRequest, TaskResult } from "@independo/inderun-contracts";
1
+ import type { ProviderDescriptor, ProviderDynamicCapabilities, SharedRoutePlan, StreamEvent, StreamRunHandle, TaskOutput, TaskRequest, TaskResult } from "@independo/inderun-contracts";
2
2
  import type { HostServices } from "./host.js";
3
+ import type { ArtifactSink } from "./artifacts.js";
4
+ export type { ArtifactChunk, ArtifactLimits, ArtifactSink, ArtifactSpec, ArtifactWriter } from "./artifacts.js";
3
5
  /**
4
- * Static metadata descriptor defining the capabilities, requirements, and constraints
5
- * of a provider. This is used by the routing engine and Router to select candidate providers.
6
+ * A provider's static declaration, live capability check, and the pair as
7
+ * `checkCapabilities()` returns it. All three are schema-backed contracts
8
+ * (`contracts/schemas/provider-*.schema.json`), shared with the Swift and Kotlin
9
+ * SDKs and with the route planner, so they are re-exported here rather than
10
+ * declared.
6
11
  */
7
- export interface ProviderDescriptor {
8
- /**
9
- * Unique identifier of the provider (e.g., 'openai', 'apple-foundation-models').
10
- */
11
- id: string;
12
- /**
13
- * Execution target type: 'local' (on-device), 'edge', or 'cloud'.
14
- */
15
- type: "local" | "edge" | "cloud";
16
- /**
17
- * The model this provider instance is bound to, when it can name one. A provider
18
- * instance bound to one model is a *target* that model profiles list by `id`.
19
- * Cloud providers report the model id they send; platform-managed models report
20
- * an opaque platform alias rather than a guessed weight name. Absent means the
21
- * provider cannot name its model.
22
- */
23
- model?: string;
24
- /**
25
- * Connection transport layer protocol.
26
- */
27
- transport: "in_process" | "system_service" | "http" | "sse" | "realtime";
28
- /**
29
- * Optional streaming style, if token or chunk streaming is supported.
30
- */
31
- streamingStyle?: "tokens" | "chunks" | "snapshots";
32
- /**
33
- * Flags representing the features and modes supported by this provider.
34
- */
35
- supports: {
36
- /** Whether the provider supports Mode 1 run (request/response). */
37
- run: boolean;
38
- /** Whether the provider supports Mode 2 stream. */
39
- streaming: boolean;
40
- /** Whether the provider supports Mode 3 realtime session. */
41
- realtime: boolean;
42
- /** Whether the provider supports tool calling definition. */
43
- tools: boolean;
44
- /** Whether the provider outputs reasoning events alongside contents. */
45
- reasoningEvents: boolean;
46
- /** Whether the provider supports structured outputs (JSON schema constraints). */
47
- structuredOutput: boolean;
48
- /** Whether the provider supports multimodal inputs (images, audio, etc.). */
49
- multimodal: boolean;
50
- };
51
- /**
52
- * Cancellation capabilities support:
53
- * - 'hard': fully stops processing and interrupts remote operations.
54
- * - 'soft': stops reading the stream locally, but the remote execution continues.
55
- * - 'none': cancellation is unsupported.
56
- */
57
- cancel: "hard" | "soft" | "none";
58
- /**
59
- * List of supported task kinds (e.g., 'text_to_text', 'embeddings').
60
- */
61
- tasks: string[];
62
- /**
63
- * Optional input/output resource boundaries.
64
- */
65
- limits?: {
66
- maxInputTokens?: number;
67
- maxOutputTokens?: number;
68
- maxImageBytes?: number;
69
- maxAudioSeconds?: number;
70
- };
71
- /**
72
- * Privacy settings regarding data egress.
73
- */
74
- privacy?: {
75
- /** Set to true if the model input leaves the host device. */
76
- dataLeavesDevice: boolean;
77
- /** Geographic regions where the cloud service executes. */
78
- regions?: string[];
79
- };
80
- }
81
- /**
82
- * Dynamic capability snapshot evaluated at runtime.
83
- */
84
- export interface ProviderDynamicCapabilities {
85
- /**
86
- * Whether the provider is available and functional on the host device now.
87
- */
88
- available: boolean;
89
- /**
90
- * Detail message if availability check fails.
91
- */
92
- reason?: string;
93
- /**
94
- * Whether the provider can stream (Mode 2) right now on this host. Leave
95
- * undefined to inherit the static `descriptor.supports.streaming` value —
96
- * only set it when the runtime environment can take streaming away from a
97
- * provider that otherwise declares it (e.g. the host has no chunked HTTP
98
- * capability).
99
- */
100
- streamingAvailable?: boolean;
101
- /**
102
- * Detail message used when `streamingAvailable` is false. Omit to let the
103
- * route planner synthesize a generic message.
104
- */
105
- streamingUnavailableReason?: string;
106
- /**
107
- * Whether cancellation is honored right now on this host. Leave undefined to
108
- * inherit the static `descriptor.cancel` value (anything other than `"none"`
109
- * means available).
110
- */
111
- cancellationAvailable?: boolean;
112
- }
113
- /**
114
- * One registered provider's identity, fixed capabilities, and live availability,
115
- * as of the moment checkCapabilities() was called.
116
- */
117
- export interface ProviderCapabilitySnapshot {
118
- /**
119
- * Stable identifier for this provider, matching the value used in routing
120
- * preferences/constraints.
121
- */
122
- providerId: string;
123
- /**
124
- * The provider's static, unchanging capability declaration (supported modes,
125
- * privacy posture, model info).
126
- */
127
- descriptor: ProviderDescriptor;
128
- /**
129
- * The provider's current dynamic availability (e.g. whether it's reachable/loaded
130
- * right now) — this is the part that can change between calls.
131
- */
132
- capabilities: ProviderDynamicCapabilities;
133
- }
12
+ export type { ProviderCapabilitySnapshot, ProviderDescriptor, ProviderDynamicCapabilities } from "@independo/inderun-contracts";
134
13
  /**
135
14
  * Execution context passed to provider run commands.
136
15
  */
@@ -144,6 +23,37 @@ export interface RunContext {
144
23
  * resolve authContextRef through secure storage and dispatch HTTP requests.
145
24
  */
146
25
  hostServices: HostServices;
26
+ /**
27
+ * The voice the route plan bound this provider to for a speech task: provider-neutral
28
+ * traits the provider must honour when it picks the voice that speaks. Absent for tasks
29
+ * without a voice and for providers that do not list their voices, which then choose
30
+ * under the same rule (ADR 016 §4). The engine has re-checked it against the request's
31
+ * privacy policy immediately before the attempt.
32
+ */
33
+ voice?: NonNullable<SharedRoutePlan["candidates"][number]["voice"]>;
34
+ /**
35
+ * Commits the run to this provider. Call it immediately before the attempt's first
36
+ * externally observable effect — for managed playback, no later than the first moment
37
+ * sound may reach the user. After commit, a failure ends the run instead of falling back
38
+ * to another provider, because a second provider would repeat what the user may already
39
+ * have heard.
40
+ *
41
+ * Returns `false` when the run can no longer commit (it was cancelled or has already
42
+ * ended) and when this attempt is over, e.g. a late callback after the engine fell back to
43
+ * another provider; the provider must then not start the effect and should end the attempt.
44
+ * Idempotent: calling it again after a successful commit returns `true`.
45
+ *
46
+ * Providers whose output is only delivered at the end (text from `run()`) need not call
47
+ * it. Text streams commit implicitly on their first content event.
48
+ */
49
+ commit(): boolean;
50
+ /**
51
+ * Where the provider writes retrievable media for an `artifact` request (ADR 017). The
52
+ * engine holds the bytes; the provider returns the reference `finish()` gives it in an
53
+ * `artifact` output. Finishing commits the run. Artifacts this attempt does not return,
54
+ * or that a failed or cancelled attempt wrote, are discarded by the engine.
55
+ */
56
+ artifacts: ArtifactSink;
147
57
  }
148
58
  /**
149
59
  * Execution context passed to provider stream commands. Extends RunContext with the
@@ -188,6 +98,16 @@ export type ProviderStreamEvent = {
188
98
  * one. Carried into the terminal outcome's provenance; never inferred from configuration.
189
99
  */
190
100
  reportedModel?: string;
101
+ } | {
102
+ /**
103
+ * The run's normalized output, for tasks whose output is not streamed text
104
+ * (playback completion, a media artifact). Ends the stream like `done`; handing it
105
+ * over commits the run if the provider has not already called `commit()`.
106
+ */
107
+ kind: "result";
108
+ output: TaskOutput;
109
+ finishReason?: TaskResult["finishReason"];
110
+ reportedModel?: string;
191
111
  } | {
192
112
  kind: "error";
193
113
  error: unknown;
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/core/provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,eAAe,EACf,WAAW,EACX,UAAU,EACX,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE9C;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;IACjC;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,SAAS,EAAE,YAAY,GAAG,gBAAgB,GAAG,MAAM,GAAG,KAAK,GAAG,UAAU,CAAC;IACzE;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CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B"}
@@ -1,6 +1,6 @@
1
1
  import type { RoutePlan as SharedPlannerRoutePlan, RoutePlannerInput as SharedPlannerInput, TaskRequest } from "@independo/inderun-contracts";
2
2
  import type { HostServices } from "./host.js";
3
- import type { ProviderAdapter } from "./provider.js";
3
+ import type { ProviderAdapter, ProviderDescriptor, ProviderDynamicCapabilities } from "./provider.js";
4
4
  export type { SharedPlannerInput, SharedPlannerRoutePlan };
5
5
  /**
6
6
  * Interaction mode the caller is requesting a route for. Passed to the shared
@@ -39,13 +39,13 @@ export interface RoutePlanner {
39
39
  planRoute(input: SharedPlannerInput): Promise<PlannerOutcome>;
40
40
  }
41
41
  /**
42
- * A provider paired with the descriptor/capability projection the shared route
43
- * planner consumes.
42
+ * A provider paired with its descriptor and the dynamic capabilities the shared
43
+ * route planner consumes (already folded by {@link toSharedPlannerCapabilities}).
44
44
  */
45
45
  export interface ProviderRuntimeSnapshot {
46
46
  provider: ProviderAdapter;
47
- descriptor: SharedPlannerInput["providers"][number]["descriptor"];
48
- capabilities: SharedPlannerInput["providers"][number]["capabilities"];
47
+ descriptor: ProviderDescriptor;
48
+ capabilities: ProviderDynamicCapabilities;
49
49
  }
50
50
  /**
51
51
  * {@link RoutePlanner} backed by the Rust route core compiled to WASM. The
@@ -1 +1 @@
1
- {"version":3,"file":"route-planner.d.ts","sourceRoot":"","sources":["../../src/core/route-planner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,IAAI,sBAAsB,EACnC,iBAAiB,IAAI,kBAAkB,EACvC,WAAW,EACZ,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EACV,eAAe,EAGhB,MAAM,eAAe,CAAC;AAEvB,YAAY,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,CAAC;AAE3D;;;GAGG;AACH,MAAM,MAAM,eAAe,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AC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CAC/D;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,eAAe,CAAC;IAC1B,UAAU,EAAE,kBAAkB,CAAC;IAC/B,YAAY,EAAE,2BAA2B,CAAC;CAC3C;AAED;;;;;;;;;;GAUG;AACH,qBAAa,gBAAiB,YAAW,YAAY;IACnD,OAAO,CAAC,aAAa,CAAC,CAAsC;IAC5D,OAAO,CAAC,WAAW,CAAC,CAAqD;IACzE,OAAO,CAAC,SAAS,CAAS;IAEpB,SAAS,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,cAAc,CAAC;YAoBrD,UAAU;YAOV,YAAY;IA0B1B,OAAO,CAAC,QAAQ;CAOjB;AAED;;;;;;;GAOG;AACH,wBAAsB,+BAA+B,CACnD,iBAAiB,EAAE,eAAe,EAAE,EACpC,YAAY,EAAE,YAAY,GACzB,OAAO,CAAC,uBAAuB,EAAE,CAAC,CAapC;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,uBAAuB,EAAE,EACpC,aAAa,EAAE,OAAO,EACtB,eAAe,GAAE,eAAuB,EACxC,YAAY,CAAC,EAAE,kBAAkB,CAAC,cAAc,CAAC,GAChD,kBAAkB,CAsBpB"}
@@ -1,3 +1,4 @@
1
+ import { taskProfileFor } from "./task-profiles.js";
1
2
  /**
2
3
  * {@link RoutePlanner} backed by the Rust route core compiled to WASM. The
3
4
  * module specifier is a static literal (not configurable) so bundlers such as
@@ -84,7 +85,7 @@ export async function collectProviderRuntimeSnapshots(registryProviders, hostSer
84
85
  const capabilities = await provider.capabilities(hostServices);
85
86
  return {
86
87
  provider,
87
- descriptor: toSharedPlannerDescriptor(descriptor),
88
+ descriptor,
88
89
  capabilities: toSharedPlannerCapabilities(capabilities, descriptor, provider)
89
90
  };
90
91
  }));
@@ -98,9 +99,7 @@ export function buildSharedPlannerInput(request, snapshots, networkOnline, inter
98
99
  const constraints = request.constraints ?? {};
99
100
  const preferences = request.preferences ?? {};
100
101
  return {
101
- task: {
102
- kind: request.task.kind
103
- },
102
+ task: plannerTask(request),
104
103
  interactionMode,
105
104
  constraints: {
106
105
  privacy: constraints.privacy ?? "cloud_allowed",
@@ -118,25 +117,13 @@ export function buildSharedPlannerInput(request, snapshots, networkOnline, inter
118
117
  }))
119
118
  };
120
119
  }
121
- function toSharedPlannerDescriptor(descriptor) {
122
- return {
123
- id: descriptor.id,
124
- type: descriptor.type,
125
- supports: {
126
- run: descriptor.supports.run,
127
- streaming: descriptor.supports.streaming
128
- },
129
- cancel: descriptor.cancel,
130
- tasks: descriptor.tasks,
131
- ...(descriptor.privacy
132
- ? {
133
- privacy: {
134
- dataLeavesDevice: descriptor.privacy.dataLeavesDevice,
135
- ...(descriptor.privacy.regions ? { regions: descriptor.privacy.regions } : {})
136
- }
137
- }
138
- : {})
139
- };
120
+ /**
121
+ * Projects the request's task onto the requirements the planner can check, through the
122
+ * kind's task profile. A kind without a profile carries the kind alone, which the planner
123
+ * matches against declarations and nothing else.
124
+ */
125
+ function plannerTask(request) {
126
+ return taskProfileFor(request.task.kind)?.plannerTask(request) ?? { kind: request.task.kind };
140
127
  }
141
128
  /**
142
129
  * Projects the dynamic capability snapshot for the planner.
@@ -155,13 +142,12 @@ function toSharedPlannerCapabilities(capabilities, descriptor, provider) {
155
142
  (declaresStreaming && !implementsStream
156
143
  ? `Provider '${descriptor.id}' declares streaming but does not implement stream().`
157
144
  : undefined);
145
+ // Spread rather than pick, so a field added to the schema reaches the planner
146
+ // without touching this function.
147
+ const { streamingUnavailableReason: _declaredReason, ...rest } = capabilities;
158
148
  return {
159
- available: capabilities.available,
160
- ...(capabilities.reason ? { reason: capabilities.reason } : {}),
149
+ ...rest,
161
150
  streamingAvailable,
162
- ...(!streamingAvailable && streamingUnavailableReason ? { streamingUnavailableReason } : {}),
163
- ...(capabilities.cancellationAvailable !== undefined
164
- ? { cancellationAvailable: capabilities.cancellationAvailable }
165
- : {})
151
+ ...(!streamingAvailable && streamingUnavailableReason ? { streamingUnavailableReason } : {})
166
152
  };
167
153
  }
@@ -2,7 +2,19 @@ import type { TaskRequest } from "@independo/inderun-contracts";
2
2
  import type { HostServices } from "./host.js";
3
3
  import type { ProviderAdapter } from "./provider.js";
4
4
  import type { ProviderRegistry } from "./registry.js";
5
+ import type { BoundVoice } from "./task-profiles.js";
5
6
  import { type InteractionMode, type RoutePlanner, type SharedPlannerInput, type SharedPlannerRoutePlan } from "./route-planner.js";
7
+ /**
8
+ * One provider in the planned chain, with the voice the plan bound it to (speech only).
9
+ */
10
+ export interface RouteCandidate {
11
+ provider: ProviderAdapter;
12
+ /**
13
+ * The voice this provider must use, chosen by the planner within the request's privacy
14
+ * policy. Absent when the task has no voice or the provider does not list its voices.
15
+ */
16
+ voice?: BoundVoice;
17
+ }
6
18
  /**
7
19
  * Output structure from the Router containing the chosen provider and a route selection description.
8
20
  */
@@ -15,6 +27,10 @@ export interface RouteSelection {
15
27
  * Ordered fallback providers to try if the primary provider fails before producing a final result.
16
28
  */
17
29
  fallbackProviders: ProviderAdapter[];
30
+ /**
31
+ * The whole chain in attempt order (`provider` first), each with its bound voice.
32
+ */
33
+ candidates: RouteCandidate[];
18
34
  /**
19
35
  * The shared route plan used to select this provider chain.
20
36
  */
@@ -1 +1 @@
1
- {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/core/router.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAOtD,OAAO,EAGL,KAAK,eAAe,EAEpB,KAAK,YAAY,EACjB,KAAK,kBAAk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Q,EAAE,eAAe,CAAC;IAC1B;;;OAGG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,QAAQ,EAAE,eAAe,CAAC;IAC1B;;OAEG;IACH,iBAAiB,EAAE,eAAe,EAAE,CAAC;IACrC;;OAEG;IACH,UAAU,EAAE,cAAc,EAAE,CAAC;IAC7B;;OAEG;IACH,SAAS,EAAE,sBAAsB,CAAC;IAClC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,qBAAa,MAAM;IAEf,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,OAAO;gBADP,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,GAAE,YAAqC;IAGxD;;;;;;;;;;;;;;OAcG;IACG,WAAW,CACf,OAAO,EAAE,WAAW,EACpB,YAAY,EAAE,YAAY,EAC1B,eAAe,GAAE,eAAuB,EACxC,YAAY,CAAC,EAAE,kBAAkB,CAAC,cAAc,CAAC,GAChD,OAAO,CAAC,cAAc,CAAC;IA0B1B,OAAO,CAAC,oBAAoB;IAW5B,OAAO,CAAC,2BAA2B;IA6BnC;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;CAkBzB"}
@@ -50,16 +50,25 @@ export class Router {
50
50
  return this.buildSelectionFromRoutePlan(snapshots, routePlan);
51
51
  }
52
52
  buildSelectionFromRoutePlan(snapshots, routePlan) {
53
- const orderedProviders = routePlan.candidates
54
- .map((candidate) => snapshots.find((snapshot) => snapshot.descriptor.id === candidate.providerId))
55
- .filter((snapshot) => snapshot !== undefined);
56
- const selected = orderedProviders[0];
53
+ const candidates = routePlan.candidates.flatMap((candidate) => {
54
+ const snapshot = snapshots.find((s) => s.descriptor.id === candidate.providerId);
55
+ if (snapshot === undefined)
56
+ return [];
57
+ return [
58
+ {
59
+ provider: snapshot.provider,
60
+ ...(candidate.voice !== undefined ? { voice: candidate.voice } : {})
61
+ }
62
+ ];
63
+ });
64
+ const selected = candidates[0];
57
65
  if (!selected) {
58
66
  throw createInternal("Route plan selected a provider that is no longer registered.");
59
67
  }
60
68
  return {
61
69
  provider: selected.provider,
62
- fallbackProviders: orderedProviders.slice(1).map((snapshot) => snapshot.provider),
70
+ fallbackProviders: candidates.slice(1).map((candidate) => candidate.provider),
71
+ candidates,
63
72
  routePlan,
64
73
  explanation: routePlan.explanation.summary
65
74
  };
@@ -0,0 +1,54 @@
1
+ import type { SharedRoutePlan, SharedRoutePlannerInput, TaskOutput, TaskRequest } from "@independo/inderun-contracts";
2
+ import { type IndeRunException } from "./errors.js";
3
+ /** How a task's result reaches the application: `inline`, `playback` or `artifact`. */
4
+ export type OutputDelivery = NonNullable<TaskRequest["delivery"]>["mode"];
5
+ /** The provider-neutral voice a route candidate is bound to. */
6
+ export type BoundVoice = NonNullable<SharedRoutePlan["candidates"][number]["voice"]>;
7
+ /**
8
+ * What the engine needs to know about one task kind (ADR 016). This table is the only
9
+ * place the engine branches on `task.kind`: which kinds it executes, the projection onto
10
+ * the planner's task requirements, and the output delivery a result must have. (Per-kind
11
+ * request requirements are the schema's `if`/`then` branches, checked by the validator.) Everything else — routing, fallback, cancellation, provenance — is task-agnostic,
12
+ * so a new task adds an entry here rather than a second execution path.
13
+ *
14
+ * The Swift (`TaskProfiles.swift`) and Kotlin (`TaskProfiles.kt`) engines keep the same
15
+ * table; `contracts/fixtures/task-contracts/` holds the planner projection all three must
16
+ * produce for each request.
17
+ */
18
+ export interface TaskProfile {
19
+ /** The `task.kind` this profile describes. */
20
+ readonly kind: string;
21
+ /** Projects the request onto the requirements the shared planner can check. */
22
+ plannerTask(request: TaskRequest): SharedRoutePlannerInput["task"];
23
+ /** The output delivery the request asks for: `inline` for text, else `delivery.mode`. */
24
+ delivery(request: TaskRequest): OutputDelivery;
25
+ }
26
+ /**
27
+ * Adds a task profile. Internal and not exported from the package: a real task needs its
28
+ * schema kind and payload first (ADR 016). It exists so a test can prove a third task runs
29
+ * through routing, execution and output normalization without changing the engine.
30
+ * @internal
31
+ */
32
+ export declare function registerTaskProfile(profile: TaskProfile): void;
33
+ /** The profile for `kind`, or `undefined` when this engine cannot execute the task. */
34
+ export declare function taskProfileFor(kind: string): TaskProfile | undefined;
35
+ /**
36
+ * Re-checks, immediately before an attempt, that the voice the plan bound for this
37
+ * provider still satisfies the request's privacy policy. The planner already chose the
38
+ * voice inside that policy; repeating the check here keeps privacy enforceable at the
39
+ * last point before data reaches the provider, independent of how the plan was produced.
40
+ * A violation fails the attempt before commit, so the run may fall back.
41
+ *
42
+ * @returns The exception to fail the attempt with, or `undefined` when the voice is allowed.
43
+ */
44
+ export declare function recheckBoundVoice(request: TaskRequest, providerId: string, voice: BoundVoice | undefined): IndeRunException | undefined;
45
+ /**
46
+ * Checks a provider's output against the delivery the request asked for: inline text for
47
+ * `inline`, a playback completion for `playback`, a media artifact for `artifact` whose
48
+ * media type is one the request accepts. A provider never substitutes one for another
49
+ * (ADR 016 §4), so a mismatch is a provider fault, not a result.
50
+ *
51
+ * @returns The exception to fail the attempt with, or `undefined` when the output matches.
52
+ */
53
+ export declare function checkOutput(request: TaskRequest, delivery: OutputDelivery, output: TaskOutput | undefined, providerId: string): IndeRunException | undefined;
54
+ //# sourceMappingURL=task-profiles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-profiles.d.ts","sourceRoot":"","sources":["../../src/core/task-profiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,uBAAuB,EACvB,UAAU,EACV,WAAW,EACZ,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAA4C,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE9F,uFAAuF;AACvF,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAC1E,gEAAgE;AAChE,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AAErF;;;;;;;;;;GAUG;AACH,MAAM,WAAW,WAAW;IAC1B,8CAA8C;IAC9C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,+EAA+E;IAC/E,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,uBAAuB,CAAC,MAAM,CAAC,CAAC;IACnE,yFAAyF;IACzF,QAAQ,CAAC,OAAO,EAAE,WAAW,GAAG,cAAc,CAAC;CAChD;AAwCD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAE9D;AAED,uFAAuF;AACvF,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAEpE;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,WAAW,EACpB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,UAAU,GAAG,SAAS,GAC5B,gBAAgB,GAAG,SAAS,CAQ9B;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,cAAc,EACxB,MAAM,EAAE,UAAU,GAAG,SAAS,EAC9B,UAAU,EAAE,MAAM,GACjB,gBAAgB,GAAG,SAAS,CAc9B"}
@@ -0,0 +1,92 @@
1
+ import { createCapabilityMismatch, createInternal } from "./errors.js";
2
+ const textToText = {
3
+ kind: "text_to_text",
4
+ plannerTask: () => ({ kind: "text_to_text", inputs: ["text"] }),
5
+ delivery: () => "inline"
6
+ };
7
+ const textToSpeech = {
8
+ kind: "text_to_speech",
9
+ plannerTask: (request) => {
10
+ // The schema requires both for this kind; validation runs before projection.
11
+ const speech = request.speech;
12
+ const delivery = request.delivery;
13
+ return {
14
+ kind: "text_to_speech",
15
+ inputs: ["text"],
16
+ delivery: {
17
+ mode: delivery.mode,
18
+ ...(delivery.mediaTypes !== undefined ? { mediaTypes: [...delivery.mediaTypes] } : {})
19
+ },
20
+ locale: { tag: speech.locale, match: speech.localeMatch ?? "language" },
21
+ ...(speech.voice !== undefined
22
+ ? {
23
+ voice: {
24
+ ...(speech.voice.gender !== undefined ? { gender: speech.voice.gender } : {}),
25
+ requirement: speech.voice.requirement ?? "preferred"
26
+ }
27
+ }
28
+ : {})
29
+ };
30
+ },
31
+ delivery: (request) => request.delivery.mode
32
+ };
33
+ const taskProfiles = new Map([
34
+ [textToText.kind, textToText],
35
+ [textToSpeech.kind, textToSpeech]
36
+ ]);
37
+ /**
38
+ * Adds a task profile. Internal and not exported from the package: a real task needs its
39
+ * schema kind and payload first (ADR 016). It exists so a test can prove a third task runs
40
+ * through routing, execution and output normalization without changing the engine.
41
+ * @internal
42
+ */
43
+ export function registerTaskProfile(profile) {
44
+ taskProfiles.set(profile.kind, profile);
45
+ }
46
+ /** The profile for `kind`, or `undefined` when this engine cannot execute the task. */
47
+ export function taskProfileFor(kind) {
48
+ return taskProfiles.get(kind);
49
+ }
50
+ /**
51
+ * Re-checks, immediately before an attempt, that the voice the plan bound for this
52
+ * provider still satisfies the request's privacy policy. The planner already chose the
53
+ * voice inside that policy; repeating the check here keeps privacy enforceable at the
54
+ * last point before data reaches the provider, independent of how the plan was produced.
55
+ * A violation fails the attempt before commit, so the run may fall back.
56
+ *
57
+ * @returns The exception to fail the attempt with, or `undefined` when the voice is allowed.
58
+ */
59
+ export function recheckBoundVoice(request, providerId, voice) {
60
+ if (voice?.networkRequired !== true || request.constraints?.privacy !== "local_required") {
61
+ return undefined;
62
+ }
63
+ return createCapabilityMismatch(`Provider '${providerId}' was bound to a voice that sends data off the device, which privacy=local_required forbids.`, { providerId, details: { code: "privacy_recheck_failed" } });
64
+ }
65
+ /**
66
+ * Checks a provider's output against the delivery the request asked for: inline text for
67
+ * `inline`, a playback completion for `playback`, a media artifact for `artifact` whose
68
+ * media type is one the request accepts. A provider never substitutes one for another
69
+ * (ADR 016 §4), so a mismatch is a provider fault, not a result.
70
+ *
71
+ * @returns The exception to fail the attempt with, or `undefined` when the output matches.
72
+ */
73
+ export function checkOutput(request, delivery, output, providerId) {
74
+ const expected = { inline: "text", playback: "playback", artifact: "artifact" }[delivery];
75
+ const matches = output?.type === expected &&
76
+ (expected === "text"
77
+ ? typeof output.text === "string"
78
+ : expected === "playback"
79
+ ? output.playback !== undefined
80
+ : output.artifact !== undefined && acceptsMediaType(request, output.artifact.mediaType));
81
+ if (matches)
82
+ return undefined;
83
+ return createInternal(`Provider '${providerId}' returned ${output === undefined ? "no output" : `a '${output.type}' output`} for a '${delivery}' request.`, { providerId, details: { code: "output_mismatch" } });
84
+ }
85
+ /** Whether `mediaType` (parameters ignored, case-insensitive) is one the request accepts. */
86
+ function acceptsMediaType(request, mediaType) {
87
+ const accepted = request.delivery?.mediaTypes;
88
+ if (accepted === undefined)
89
+ return true;
90
+ const base = (type) => type.split(";")[0].trim().toLowerCase();
91
+ return accepted.some((type) => base(type) === base(mediaType));
92
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/facade/text.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,WAAW,EACX,qBAAqB,EACrB,WAAW,EACX,UAAU,EACX,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAGnE;;;;;;;;;GASG;AAEH,KAAK,OAAO,GAAG,WAAW,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5D;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,+EAA+E;IAC/E,OAAO,CAAC,EAAE,WAAW,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC7D,wEAAwE;IACxE,KAAK,CAAC,EAAE,WAAW,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IACzD,+B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gB,aAAa,CAAC,OAAO,EAAE,qBAAqB,GAAG,WAAW,CA0CzE;AAED;;;;GAIG;AACH,wBAAsB,YAAY,CAChC,OAAO,EAAE,UAAU,EACnB,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,aAAa,CAAC,CAYxB;AAED;;;;;;GAMG;AACH,wBAAsB,UAAU,CAC9B,OAAO,EAAE,UAAU,EACnB,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,UAAU,CAAC,CA2CrB"}
@@ -72,7 +72,9 @@ export function toTaskRequest(options) {
72
72
  export async function generateText(inderun, options) {
73
73
  const taskResult = await inderun.run(toTaskRequest(options));
74
74
  return {
75
- text: taskResult.output.text,
75
+ // A text run always produces text output; the generated type is optional only because
76
+ // TaskOutput also describes playback and artifacts (ADR 016).
77
+ text: taskResult.output.text ?? "",
76
78
  finishReason: taskResult.finishReason,
77
79
  ...(taskResult.usage !== undefined ? { usage: taskResult.usage } : {}),
78
80
  runId: taskResult.runId,
@@ -135,7 +137,7 @@ function settle(outcome) {
135
137
  switch (outcome.outcome) {
136
138
  case "completed":
137
139
  return {
138
- text: outcome.finalText ?? "",
140
+ text: outcome.finalText ?? outcome.output?.text ?? "",
139
141
  ...(outcome.finishReason !== undefined ? { finishReason: outcome.finishReason } : {}),
140
142
  ...(outcome.usage !== undefined ? { usage: outcome.usage } : {}),
141
143
  runId: outcome.runId,
@@ -144,7 +146,7 @@ function settle(outcome) {
144
146
  };
145
147
  case "cancelled":
146
148
  return {
147
- text: outcome.partialText ?? "",
149
+ text: outcome.partialText ?? outcome.output?.text ?? "",
148
150
  finishReason: "cancelled",
149
151
  runId: outcome.runId,
150
152
  ...provenance,
package/dist/index.d.ts CHANGED
@@ -36,7 +36,7 @@ export { AUTO_MODEL_PROFILE, type ModelProfiles } from "./core/model-profiles.js
36
36
  */
37
37
  export { IndeRun, type IndeRunOptions, type StreamHandleResult } from "./core/engine.js";
38
38
  export type { IndeRunApi } from "./core/generated/inderun-api.js";
39
- export type { ProviderCapabilitySnapshot, StreamRun } from "./core/provider.js";
39
+ export type { ArtifactChunk, ArtifactLimits, ProviderCapabilitySnapshot, StreamRun } from "./core/provider.js";
40
40
  /**
41
41
  * The contract types this SDK's own signatures take and return.
42
42
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;GAEG;AACH,OAAO,EACL,YAAY,EACZ,UAAU,EACV,aAAa,EACb,wBAAwB,EACxB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,UAAU,EAChB,MAAM,kBAAkB,CAAC;AAE1B;;;GAGG;AACH,OAAO,EACL,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EAC1B,MAAM,cAAc,CAAC;AAEtB;;;GAGG;AACH,OAAO,EAAE,kBAAkB,EAAE,KAAK,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAElF;;;;GAIG;AACH,OAAO,EAAE,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACzF,YAAY,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,YAAY,EAAE,0BAA0B,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEhF;;;;;;;;;;;;;;GAcG;AACH,YAAY,EACV,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,WAAW,EACX,UAAU,EACX,MAAM,8BAA8B,CAAC;AAEtC;;;;GAIG;AACH,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAExE;;;GAGG;AACH,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,oBAAoB,EACrB,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;GAEG;AACH,OAAO,EACL,YAAY,EACZ,UAAU,EACV,aAAa,EACb,wBAAwB,EACxB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,UAAU,EAChB,MAAM,kBAAkB,CAAC;AAE1B;;;GAGG;AACH,OAAO,EACL,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EAC1B,MAAM,cAAc,CAAC;AAEtB;;;GAGG;AACH,OAAO,EAAE,kBAAkB,EAAE,KAAK,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAElF;;;;GAIG;AACH,OAAO,EAAE,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACzF,YAAY,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,YAAY,EACV,aAAa,EACb,cAAc,EACd,0BAA0B,EAC1B,SAAS,EACV,MAAM,oBAAoB,CAAC;AAE5B;;;;;;;;;;;;;;GAcG;AACH,YAAY,EACV,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,WAAW,EACX,UAAU,EACX,MAAM,8BAA8B,CAAC;AAEtC;;;;GAIG;AACH,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAExE;;;GAGG;AACH,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,oBAAoB,EACrB,MAAM,qBAAqB,CAAC"}
@@ -7,12 +7,12 @@ import type { ModelPackage, TaskRequest, TaskResult } from "@independo/inderun-c
7
7
  * flattens every failure into a single `capability_unavailable` route rejection and carries the
8
8
  * reason as human-readable text.
9
9
  */
10
- export interface OnnxRuntimeAvailability {
10
+ export type OnnxRuntimeAvailability = {
11
11
  /** Whether the runtime can execute the given model package on this host right now. */
12
12
  available: boolean;
13
13
  /** Human-readable detail describing why the runtime is unavailable. */
14
14
  reason?: string;
15
- }
15
+ };
16
16
  /**
17
17
  * Normalized conversation turn handed to an ONNX text generation runtime.
18
18
  */
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/providers/onnx/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1F;;;;;;;GAOG;AACH,MAAM,WAAW,uBAAuB;IACtC,sFAAsF;IACtF,SAAS,EAAE,OAAO,CAAC;IACnB,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,2CAA2C;IAC3C,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAC;IACtC,uCAAuC;IACvC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,0DAA0D;IAC1D,YAAY,EAAE,YAAY,CAAC;IAC3B,kFAAkF;IAClF,QAAQ,EAAE,qBAAqB,EAAE,CAAC;IAClC,iEAAiE;IACjE,UAAU,CAAC,EAAE,WAAW,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC;CACrD;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,0EAA0E;IAC1E,YAAY,CAAC,EAAE,UAAU,CAAC,cAAc,CAAC,CAAC;IAC1C,8DAA8D;IAC9D,KAAK,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;CAC7B;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,oBAAoB,GAAG,YAAY,GAAG,aAAa,G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