@independo/inderun-web 0.3.0-dev.12 → 0.3.0-dev.13
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/README.md +2 -0
- package/dist/index.d.ts +63 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +47 -2
- package/dist/onnx.d.ts +21 -0
- package/dist/onnx.d.ts.map +1 -1
- package/dist/onnx.js +15 -0
- package/dist/openai.d.ts +7 -0
- package/dist/openai.d.ts.map +1 -1
- package/dist/openai.js +7 -0
- package/dist/system-model.d.ts +13 -0
- package/dist/system-model.d.ts.map +1 -1
- package/dist/system-model.js +13 -0
- package/package.json +10 -6
- package/src/core/browser-host.ts +339 -0
- package/src/core/engine.ts +540 -0
- package/src/core/errors.ts +220 -0
- package/src/core/event-gate.ts +71 -0
- package/src/core/generated/inderun-api.ts +19 -0
- package/src/core/host.ts +15 -0
- package/src/core/provider.ts +231 -0
- package/src/core/registry.ts +48 -0
- package/src/core/route-planner.ts +261 -0
- package/src/core/router.ts +149 -0
- package/src/core/sse.ts +134 -0
- package/src/core/telemetry.ts +20 -0
- package/src/index.ts +147 -0
- package/src/onnx.ts +57 -0
- package/src/openai.ts +21 -0
- package/src/providers/onnx/provider.ts +300 -0
- package/src/providers/onnx/runtime.ts +188 -0
- package/src/providers/onnx/transformers-runtime.ts +345 -0
- package/src/providers/openai/provider.ts +765 -0
- package/src/providers/system-model/chrome-runtime.ts +221 -0
- package/src/providers/system-model/provider.ts +260 -0
- package/src/providers/system-model/runtime.ts +202 -0
- package/src/system-model.ts +49 -0
- package/src/web-sdk.ts +114 -0
package/README.md
CHANGED
|
@@ -10,6 +10,8 @@ TypeScript/Web SDK for IndeRun.
|
|
|
10
10
|
|
|
11
11
|
This package provides the Web SDK entrypoint, the engine core, routing, telemetry, error normalization, the OpenAI-compatible cloud provider, the Web ONNX Runtime provider for developer-supplied local models, and the Web system-model provider for browser-managed on-device models.
|
|
12
12
|
|
|
13
|
+
The contract types this SDK's own signatures take and return — `TaskRequest`, `TaskResult`, `StreamEvent`, `StreamRunHandle`, `StreamTerminalOutcome`, `IndeRunError`, the host-service and telemetry interfaces, and (from the `/onnx` subpath) `ModelPackage` — are re-exported here, so a fully typed app does not need to depend on `@independo/inderun-contracts` separately. Import that package directly only if you want the JSON Schemas or the `get*ValidationIssues` validators.
|
|
14
|
+
|
|
13
15
|
## Basic Usage
|
|
14
16
|
|
|
15
17
|
```ts
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified entry point for the IndeRun Web SDK (`@independo/inderun-web`).
|
|
3
|
+
*
|
|
4
|
+
* Everything a browser app needs to run and stream tasks is exported from here:
|
|
5
|
+
* the engine, the routing and provider seams, host services, error and telemetry
|
|
6
|
+
* types, and the contract types the SDK's own signatures use. Provider adapters
|
|
7
|
+
* are the deliberate exception — each ships from its own subpath
|
|
8
|
+
* (`/openai`, `/onnx`, `/system-model`) so this surface stays provider-agnostic.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Host services: the platform capabilities the engine reads and calls through,
|
|
12
|
+
* and the seams an embedder overrides to supply its own (custom transport,
|
|
13
|
+
* credential storage, clock).
|
|
14
|
+
*/
|
|
1
15
|
export { type AbortSignalLike, type ConnectivityService, type DeviceConstraintsService, type SecureStorageService, type ClockService, type HttpClientService, type HttpRequest, type HttpResponse, type HttpStreamResponse, type HttpStreamingClientService, type HostServices, type ThermalState } from "./core/host.js";
|
|
16
|
+
/**
|
|
17
|
+
* The provider contract. Implement `ProviderAdapter` for a Mode 1 backend and add
|
|
18
|
+
* a `stream` for Mode 2; the descriptor and dynamic capability check are what the
|
|
19
|
+
* router plans against.
|
|
20
|
+
*/
|
|
2
21
|
export { type ProviderDescriptor, type ProviderDynamicCapabilities, type ProviderCapabilitySnapshot, type RunContext, type ProviderAdapter, type ProviderStreamContext, type ProviderStreamEvent, type StreamRun } from "./core/provider.js";
|
|
22
|
+
/**
|
|
23
|
+
* Per-run gatekeeper for a Mode 2 stream: assigns the sequence numbers callers
|
|
24
|
+
* order by, and enforces that exactly one terminal outcome is produced with
|
|
25
|
+
* nothing admitted after it. Exported for embedders driving a stream themselves.
|
|
26
|
+
*/
|
|
3
27
|
export { EventGate } from "./core/event-gate.js";
|
|
28
|
+
/** Holds the provider adapters a given engine instance can route to. */
|
|
4
29
|
export { ProviderRegistry } from "./core/registry.js";
|
|
30
|
+
/**
|
|
31
|
+
* Route selection. `Router` turns a request plus a host capability snapshot into
|
|
32
|
+
* a provider chain; `WasmRoutePlanner` is the shared Rust planner behind it, and
|
|
33
|
+
* the only planner the Web SDK has — there is no JavaScript fallback.
|
|
34
|
+
*/
|
|
5
35
|
export { type RouteSelection, Router } from "./core/router.js";
|
|
6
36
|
export { type RoutePlanner, type PlannerOutcome, type WasmUnavailableReason, type SharedPlannerInput, type SharedPlannerRoutePlan, WasmRoutePlanner } from "./core/route-planner.js";
|
|
37
|
+
/**
|
|
38
|
+
* The normalized error taxonomy. Every failure the SDK surfaces is an
|
|
39
|
+
* `IndeRunException` in one of these classes, whatever the provider raised.
|
|
40
|
+
*/
|
|
7
41
|
export { type IndeRunExceptionParams, IndeRunException, createCapabilityMismatch, createOffline, createAuthError, createRateLimited, createTimeout, createUnavailable, createInternal, toIndeRunException } from "./core/errors.js";
|
|
42
|
+
/** The engine itself, and the app-facing API surface it implements. */
|
|
8
43
|
export { IndeRun, type StreamHandleResult } from "./core/engine.js";
|
|
9
44
|
export type { IndeRunApi } from "./core/generated/inderun-api.js";
|
|
45
|
+
/**
|
|
46
|
+
* The contract types this SDK's own signatures take and return.
|
|
47
|
+
*
|
|
48
|
+
* Re-exported so a typed app needs only the one dependency the README tells it to
|
|
49
|
+
* install. `@independo/inderun-contracts` is ours transitively, and under pnpm's
|
|
50
|
+
* isolated `node_modules` an undeclared import of it does not resolve at all.
|
|
51
|
+
* This is the npm counterpart of Gradle `api(...)` on Android and `@_exported
|
|
52
|
+
* import` on Swift — see
|
|
53
|
+
* {@link https://github.com/independo-gmbh/inderun/issues/189 | #189}. The
|
|
54
|
+
* host-service and telemetry blocks in this file re-export their halves of the
|
|
55
|
+
* same contract surface for the same reason.
|
|
56
|
+
*
|
|
57
|
+
* Depend on `@independo/inderun-contracts` directly only for what is not
|
|
58
|
+
* re-exported here: the JSON Schemas and the `get*ValidationIssues` validators.
|
|
59
|
+
*/
|
|
60
|
+
export type { IndeRunError, IndeRunErrorClass, StreamEvent, StreamRunHandle, StreamTerminalOutcome, TaskRequest, TaskResult } from "@independo/inderun-contracts";
|
|
61
|
+
/**
|
|
62
|
+
* Telemetry. Pass a `TelemetryService` to observe routing decisions and attempt
|
|
63
|
+
* outcomes; the engine defaults to `NoOpTelemetryService`.
|
|
64
|
+
*/
|
|
10
65
|
export { type TelemetryEventType, type TelemetryEvent, type TelemetryService, NoOpTelemetryService } from "./core/telemetry.js";
|
|
66
|
+
/**
|
|
67
|
+
* The browser implementations of the host services above, and the factory that
|
|
68
|
+
* assembles them. Use these directly only when constructing `IndeRun` by hand.
|
|
69
|
+
*/
|
|
11
70
|
export { BrowserConnectivityService, FetchHttpClient, FetchStreamingHttpClient, SystemClockService, createBrowserHostServices, type CreateBrowserHostServicesOptions, type FetchHttpClientOptions } from "./core/browser-host.js";
|
|
71
|
+
/**
|
|
72
|
+
* The recommended way in: builds host services, registers the providers named in
|
|
73
|
+
* the options, and returns a ready engine.
|
|
74
|
+
*/
|
|
12
75
|
export { createIndeRunWeb, type CreateIndeRunWebOptions } from "./web-sdk.js";
|
|
13
76
|
//# 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,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,K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uEAAuE;AACvE,OAAO,EAAE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACpE,YAAY,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAElE;;;;;;;;;;;;;;GAcG;AACH,YAAY,EACV,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,WAAW,EACX,UAAU,EACX,MAAM,8BAA8B,CAAC;AAEtC;;;GAGG;AACH,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,oBAAoB,EACrB,MAAM,qBAAqB,CAAC;AAE7B;;;GAGG;AACH,OAAO,EACL,0BAA0B,EAC1B,eAAe,EACf,wBAAwB,EACxB,kBAAkB,EAClB,yBAAyB,EACzB,KAAK,gCAAgC,EACrC,KAAK,sBAAsB,EAC5B,MAAM,wBAAwB,CAAC;AAEhC;;;GAGG;AACH,OAAO,EAAE,gBAAgB,EAAE,KAAK,uBAAuB,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified entry point for the IndeRun Web SDK (`@independo/inderun-web`).
|
|
3
|
+
*
|
|
4
|
+
* Everything a browser app needs to run and stream tasks is exported from here:
|
|
5
|
+
* the engine, the routing and provider seams, host services, error and telemetry
|
|
6
|
+
* types, and the contract types the SDK's own signatures use. Provider adapters
|
|
7
|
+
* are the deliberate exception — each ships from its own subpath
|
|
8
|
+
* (`/openai`, `/onnx`, `/system-model`) so this surface stays provider-agnostic.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Host services: the platform capabilities the engine reads and calls through,
|
|
12
|
+
* and the seams an embedder overrides to supply its own (custom transport,
|
|
13
|
+
* credential storage, clock).
|
|
14
|
+
*/
|
|
1
15
|
export {} from "./core/host.js";
|
|
16
|
+
/**
|
|
17
|
+
* The provider contract. Implement `ProviderAdapter` for a Mode 1 backend and add
|
|
18
|
+
* a `stream` for Mode 2; the descriptor and dynamic capability check are what the
|
|
19
|
+
* router plans against.
|
|
20
|
+
*/
|
|
2
21
|
export {} from "./core/provider.js";
|
|
22
|
+
/**
|
|
23
|
+
* Per-run gatekeeper for a Mode 2 stream: assigns the sequence numbers callers
|
|
24
|
+
* order by, and enforces that exactly one terminal outcome is produced with
|
|
25
|
+
* nothing admitted after it. Exported for embedders driving a stream themselves.
|
|
26
|
+
*/
|
|
3
27
|
export { EventGate } from "./core/event-gate.js";
|
|
28
|
+
/** Holds the provider adapters a given engine instance can route to. */
|
|
4
29
|
export { ProviderRegistry } from "./core/registry.js";
|
|
30
|
+
/**
|
|
31
|
+
* Route selection. `Router` turns a request plus a host capability snapshot into
|
|
32
|
+
* a provider chain; `WasmRoutePlanner` is the shared Rust planner behind it, and
|
|
33
|
+
* the only planner the Web SDK has — there is no JavaScript fallback.
|
|
34
|
+
*/
|
|
5
35
|
export { Router } from "./core/router.js";
|
|
6
36
|
export { WasmRoutePlanner } from "./core/route-planner.js";
|
|
37
|
+
/**
|
|
38
|
+
* The normalized error taxonomy. Every failure the SDK surfaces is an
|
|
39
|
+
* `IndeRunException` in one of these classes, whatever the provider raised.
|
|
40
|
+
*/
|
|
7
41
|
export { IndeRunException, createCapabilityMismatch, createOffline, createAuthError, createRateLimited, createTimeout, createUnavailable, createInternal, toIndeRunException } from "./core/errors.js";
|
|
42
|
+
/** The engine itself, and the app-facing API surface it implements. */
|
|
8
43
|
export { IndeRun } from "./core/engine.js";
|
|
44
|
+
/**
|
|
45
|
+
* Telemetry. Pass a `TelemetryService` to observe routing decisions and attempt
|
|
46
|
+
* outcomes; the engine defaults to `NoOpTelemetryService`.
|
|
47
|
+
*/
|
|
9
48
|
export { NoOpTelemetryService } from "./core/telemetry.js";
|
|
49
|
+
/**
|
|
50
|
+
* The browser implementations of the host services above, and the factory that
|
|
51
|
+
* assembles them. Use these directly only when constructing `IndeRun` by hand.
|
|
52
|
+
*/
|
|
10
53
|
export { BrowserConnectivityService, FetchHttpClient, FetchStreamingHttpClient, SystemClockService, createBrowserHostServices } from "./core/browser-host.js";
|
|
54
|
+
/**
|
|
55
|
+
* The recommended way in: builds host services, registers the providers named in
|
|
56
|
+
* the options, and returns a ready engine.
|
|
57
|
+
*/
|
|
11
58
|
export { createIndeRunWeb } from "./web-sdk.js";
|
|
12
|
-
// The OpenAI Responses adapter is provider-specific and intentionally excluded
|
|
13
|
-
// from this unified index. Import it from "@independo/inderun-web/openai".
|
package/dist/onnx.d.ts
CHANGED
|
@@ -6,8 +6,29 @@
|
|
|
6
6
|
* when registering the adapter manually or when implementing a custom
|
|
7
7
|
* `OnnxTextGenerationRuntime`; most browser apps should pass `onnx` to
|
|
8
8
|
* `createIndeRunWeb` from the main entry point instead.
|
|
9
|
+
*
|
|
10
|
+
* See {@link https://github.com/independo-gmbh/inderun/blob/main/docs/architecture/onnx-runtime-provider-family.md | the ONNX Runtime provider family doc}
|
|
11
|
+
* for the model IO contract, supported source types, and error mapping.
|
|
9
12
|
*/
|
|
13
|
+
/** The adapter itself, plus the source types and default id the router plans against. */
|
|
10
14
|
export { OnnxRuntimeWebProvider, DEFAULT_ONNX_WEB_PROVIDER_ID, SUPPORTED_WEB_MODEL_SOURCE_TYPES, type OnnxProviderOptions } from "./providers/onnx/provider.js";
|
|
15
|
+
/**
|
|
16
|
+
* The runtime seam. The provider does no inference itself: it delegates to an
|
|
17
|
+
* `OnnxTextGenerationRuntime`, so an app can swap in its own engine, or
|
|
18
|
+
* `createFixtureOnnxRuntime()` for demos and tests without shipping a model.
|
|
19
|
+
*/
|
|
11
20
|
export { OnnxRuntimeError, createFixtureOnnxRuntime, type FixtureOnnxRuntimeOptions, type OnnxGenerationInput, type OnnxGenerationMessage, type OnnxGenerationOutput, type OnnxRuntimeAvailability, type OnnxRuntimeErrorKind, type OnnxTextGenerationRuntime } from "./providers/onnx/runtime.js";
|
|
21
|
+
/**
|
|
22
|
+
* The model-description contract types this entry point's options take.
|
|
23
|
+
* Re-exported for the same reason as the contract types on the SDK index — see
|
|
24
|
+
* the note there.
|
|
25
|
+
*/
|
|
26
|
+
export type { ModelPackage, ModelSourceType } from "@independo/inderun-contracts";
|
|
27
|
+
/**
|
|
28
|
+
* The default runtime, backed by `@huggingface/transformers`. That package is an
|
|
29
|
+
* optional peer dependency and is reached structurally through
|
|
30
|
+
* `TransformersModule`, so nothing here forces it on apps that supply their own
|
|
31
|
+
* runtime.
|
|
32
|
+
*/
|
|
12
33
|
export { createTransformersJsRuntime, type TransformersJsRuntimeOptions, type TransformersModule, type TransformersTextGenerator } from "./providers/onnx/transformers-runtime.js";
|
|
13
34
|
//# sourceMappingURL=onnx.d.ts.map
|
package/dist/onnx.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onnx.d.ts","sourceRoot":"","sources":["../src/onnx.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"onnx.d.ts","sourceRoot":"","sources":["../src/onnx.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,yFAAyF;AACzF,OAAO,EACL,sBAAsB,EACtB,4BAA4B,EAC5B,gCAAgC,EAChC,KAAK,mBAAmB,EACzB,MAAM,8BAA8B,CAAC;AAEtC;;;;GAIG;AACH,OAAO,EACL,gBAAgB,EAChB,wBAAwB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC/B,MAAM,6BAA6B,CAAC;AAErC;;;;GAIG;AACH,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAElF;;;;;GAKG;AACH,OAAO,EACL,2BAA2B,EAC3B,KAAK,4BAA4B,EACjC,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC/B,MAAM,0CAA0C,CAAC"}
|
package/dist/onnx.js
CHANGED
|
@@ -6,7 +6,22 @@
|
|
|
6
6
|
* when registering the adapter manually or when implementing a custom
|
|
7
7
|
* `OnnxTextGenerationRuntime`; most browser apps should pass `onnx` to
|
|
8
8
|
* `createIndeRunWeb` from the main entry point instead.
|
|
9
|
+
*
|
|
10
|
+
* See {@link https://github.com/independo-gmbh/inderun/blob/main/docs/architecture/onnx-runtime-provider-family.md | the ONNX Runtime provider family doc}
|
|
11
|
+
* for the model IO contract, supported source types, and error mapping.
|
|
9
12
|
*/
|
|
13
|
+
/** The adapter itself, plus the source types and default id the router plans against. */
|
|
10
14
|
export { OnnxRuntimeWebProvider, DEFAULT_ONNX_WEB_PROVIDER_ID, SUPPORTED_WEB_MODEL_SOURCE_TYPES } from "./providers/onnx/provider.js";
|
|
15
|
+
/**
|
|
16
|
+
* The runtime seam. The provider does no inference itself: it delegates to an
|
|
17
|
+
* `OnnxTextGenerationRuntime`, so an app can swap in its own engine, or
|
|
18
|
+
* `createFixtureOnnxRuntime()` for demos and tests without shipping a model.
|
|
19
|
+
*/
|
|
11
20
|
export { OnnxRuntimeError, createFixtureOnnxRuntime } from "./providers/onnx/runtime.js";
|
|
21
|
+
/**
|
|
22
|
+
* The default runtime, backed by `@huggingface/transformers`. That package is an
|
|
23
|
+
* optional peer dependency and is reached structurally through
|
|
24
|
+
* `TransformersModule`, so nothing here forces it on apps that supply their own
|
|
25
|
+
* runtime.
|
|
26
|
+
*/
|
|
12
27
|
export { createTransformersJsRuntime } from "./providers/onnx/transformers-runtime.js";
|
package/dist/openai.d.ts
CHANGED
|
@@ -5,6 +5,13 @@
|
|
|
5
5
|
* surface stays provider-agnostic. Import from `@independo/inderun-web/openai`
|
|
6
6
|
* when registering the adapter manually; most browser apps should use
|
|
7
7
|
* `createIndeRunWeb` from the main entry point instead.
|
|
8
|
+
*
|
|
9
|
+
* Browser apps must point `endpointUrl` at a same-origin proxy that holds the
|
|
10
|
+
* API key server-side. Provider credentials must never reach the browser.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* The adapter and its options. Runs Mode 1 and Mode 2 against any
|
|
14
|
+
* OpenAI-Responses-compatible endpoint, not just OpenAI's own.
|
|
8
15
|
*/
|
|
9
16
|
export { OpenAIResponsesProvider, type OpenAIProviderOptions, DEFAULT_OPENAI_RESPONSES_ENDPOINT } from "./providers/openai/provider.js";
|
|
10
17
|
//# sourceMappingURL=openai.d.ts.map
|
package/dist/openai.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openai.d.ts","sourceRoot":"","sources":["../src/openai.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"openai.d.ts","sourceRoot":"","sources":["../src/openai.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;GAGG;AACH,OAAO,EACL,uBAAuB,EACvB,KAAK,qBAAqB,EAC1B,iCAAiC,EAClC,MAAM,gCAAgC,CAAC"}
|
package/dist/openai.js
CHANGED
|
@@ -5,5 +5,12 @@
|
|
|
5
5
|
* surface stays provider-agnostic. Import from `@independo/inderun-web/openai`
|
|
6
6
|
* when registering the adapter manually; most browser apps should use
|
|
7
7
|
* `createIndeRunWeb` from the main entry point instead.
|
|
8
|
+
*
|
|
9
|
+
* Browser apps must point `endpointUrl` at a same-origin proxy that holds the
|
|
10
|
+
* API key server-side. Provider credentials must never reach the browser.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* The adapter and its options. Runs Mode 1 and Mode 2 against any
|
|
14
|
+
* OpenAI-Responses-compatible endpoint, not just OpenAI's own.
|
|
8
15
|
*/
|
|
9
16
|
export { OpenAIResponsesProvider, DEFAULT_OPENAI_RESPONSES_ENDPOINT } from "./providers/openai/provider.js";
|
package/dist/system-model.d.ts
CHANGED
|
@@ -6,8 +6,21 @@
|
|
|
6
6
|
* when registering the adapter manually or when implementing a custom
|
|
7
7
|
* `SystemModelRuntime`; most browser apps should pass `systemModel` to
|
|
8
8
|
* `createIndeRunWeb` from the main entry point instead.
|
|
9
|
+
*
|
|
10
|
+
* "System model" means a model the browser itself manages, so availability is a
|
|
11
|
+
* richer answer than a boolean: it may be present, downloadable, mid-download, or
|
|
12
|
+
* blocked for a browser, device, or policy reason. The provider flattens every
|
|
13
|
+
* non-available state into one route rejection and carries the detail as text.
|
|
9
14
|
*/
|
|
15
|
+
/** The adapter itself, plus the default id the router plans against. */
|
|
10
16
|
export { DEFAULT_SYSTEM_MODEL_WEB_PROVIDER_ID, SystemModelWebProvider, type SystemModelProviderOptions } from "./providers/system-model/provider.js";
|
|
17
|
+
/**
|
|
18
|
+
* The runtime seam. The provider delegates generation to a `SystemModelRuntime`,
|
|
19
|
+
* so an app can target a different browser API, or use
|
|
20
|
+
* `createFixtureSystemModelRuntime()` in demos and tests where no system model
|
|
21
|
+
* exists.
|
|
22
|
+
*/
|
|
11
23
|
export { SystemModelRuntimeError, createFixtureSystemModelRuntime, type FixtureSystemModelRuntimeOptions, type SystemModelAvailability, type SystemModelAvailabilityKind, type SystemModelGenerationInput, type SystemModelGenerationOutput, type SystemModelPromptMessage, type SystemModelRuntime, type SystemModelRuntimeErrorKind } from "./providers/system-model/runtime.js";
|
|
24
|
+
/** The default runtime, backed by Chrome's built-in Prompt API. */
|
|
12
25
|
export { createChromePromptApiRuntime, type ChromePromptApiGenerationOptions, type ChromePromptApiRuntimeOptions, type PromptApiLanguageModel, type PromptApiSession } from "./providers/system-model/chrome-runtime.js";
|
|
13
26
|
//# sourceMappingURL=system-model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-model.d.ts","sourceRoot":"","sources":["../src/system-model.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"system-model.d.ts","sourceRoot":"","sources":["../src/system-model.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,wEAAwE;AACxE,OAAO,EACL,oCAAoC,EACpC,sBAAsB,EACtB,KAAK,0BAA0B,EAChC,MAAM,sCAAsC,CAAC;AAE9C;;;;;GAKG;AACH,OAAO,EACL,uBAAuB,EACvB,+BAA+B,EAC/B,KAAK,gCAAgC,EACrC,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EACjC,MAAM,qCAAqC,CAAC;AAE7C,mEAAmE;AACnE,OAAO,EACL,4BAA4B,EAC5B,KAAK,gCAAgC,EACrC,KAAK,6BAA6B,EAClC,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACtB,MAAM,4CAA4C,CAAC"}
|
package/dist/system-model.js
CHANGED
|
@@ -6,7 +6,20 @@
|
|
|
6
6
|
* when registering the adapter manually or when implementing a custom
|
|
7
7
|
* `SystemModelRuntime`; most browser apps should pass `systemModel` to
|
|
8
8
|
* `createIndeRunWeb` from the main entry point instead.
|
|
9
|
+
*
|
|
10
|
+
* "System model" means a model the browser itself manages, so availability is a
|
|
11
|
+
* richer answer than a boolean: it may be present, downloadable, mid-download, or
|
|
12
|
+
* blocked for a browser, device, or policy reason. The provider flattens every
|
|
13
|
+
* non-available state into one route rejection and carries the detail as text.
|
|
9
14
|
*/
|
|
15
|
+
/** The adapter itself, plus the default id the router plans against. */
|
|
10
16
|
export { DEFAULT_SYSTEM_MODEL_WEB_PROVIDER_ID, SystemModelWebProvider } from "./providers/system-model/provider.js";
|
|
17
|
+
/**
|
|
18
|
+
* The runtime seam. The provider delegates generation to a `SystemModelRuntime`,
|
|
19
|
+
* so an app can target a different browser API, or use
|
|
20
|
+
* `createFixtureSystemModelRuntime()` in demos and tests where no system model
|
|
21
|
+
* exists.
|
|
22
|
+
*/
|
|
11
23
|
export { SystemModelRuntimeError, createFixtureSystemModelRuntime } from "./providers/system-model/runtime.js";
|
|
24
|
+
/** The default runtime, backed by Chrome's built-in Prompt API. */
|
|
12
25
|
export { createChromePromptApiRuntime } from "./providers/system-model/chrome-runtime.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@independo/inderun-web",
|
|
3
|
-
"version": "0.3.0-dev.
|
|
3
|
+
"version": "0.3.0-dev.13",
|
|
4
4
|
"description": "TypeScript/Web SDK for IndeRun.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"bugs": "https://github.com/independo-gmbh/inderun/issues",
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
14
|
-
"url": "https://github.com/independo-gmbh/inderun.git",
|
|
14
|
+
"url": "git+https://github.com/independo-gmbh/inderun.git",
|
|
15
15
|
"directory": "packages/inderun-web"
|
|
16
16
|
},
|
|
17
17
|
"publishConfig": {
|
|
@@ -52,11 +52,14 @@
|
|
|
52
52
|
},
|
|
53
53
|
"files": [
|
|
54
54
|
"dist",
|
|
55
|
+
"src",
|
|
56
|
+
"!src/**/*.test.ts",
|
|
57
|
+
"!src/test",
|
|
55
58
|
"README.md"
|
|
56
59
|
],
|
|
57
60
|
"dependencies": {
|
|
58
|
-
"@independo/inderun-contracts": "^0.3.0-dev.
|
|
59
|
-
"@independo/inderun-route-core-wasm": "^0.3.0-dev.
|
|
61
|
+
"@independo/inderun-contracts": "^0.3.0-dev.13",
|
|
62
|
+
"@independo/inderun-route-core-wasm": "^0.3.0-dev.13"
|
|
60
63
|
},
|
|
61
64
|
"peerDependencies": {
|
|
62
65
|
"@huggingface/transformers": "^4.0.0"
|
|
@@ -67,12 +70,13 @@
|
|
|
67
70
|
}
|
|
68
71
|
},
|
|
69
72
|
"devDependencies": {
|
|
70
|
-
"@types/node": "^26.4.
|
|
73
|
+
"@types/node": "^26.4.1",
|
|
71
74
|
"typescript": "^6.0.3",
|
|
72
75
|
"vitest": "^4.1.11"
|
|
73
76
|
},
|
|
74
77
|
"scripts": {
|
|
75
78
|
"build": "tsc -p tsconfig.json",
|
|
76
|
-
"test": "vitest run"
|
|
79
|
+
"test": "vitest run",
|
|
80
|
+
"verify:packaging": "publint && attw --pack . --profile esm-only"
|
|
77
81
|
}
|
|
78
82
|
}
|