Skip to content

armgit / hypit

Public Imported from GitHub
0

Clone any viral video with AI agents. Not just a script, the whole workflow: swap the face, the words, the B-roll, ship 100 variants in one command, and get your 100M views.

refactor: separate capability endpoints from runtime hosts

kashorinb7fa267d667c
diff --git a/README.md b/README.md
index 643b4940..fae9ae56 100644
--- a/README.md
+++ b/README.md
@@ -40,14 +40,14 @@
> this slice. `packages/elaborator` now compiles recursive Source Closures,
> while `packages/svs` implements a deliberately generic record-only Recipe Frontend; package-owned
> video Recipe validation remains undecided. `packages/compiler-node` now supplies the domain-free
-> registered-manifest resolver, root-confined/read-once filesystem Source Host and file-to-Graph/
+> registered-manifest resolver, injected Workspace compiler and file-to-Graph/
> BuildPlan facade; `packages/cli` assembles the first trusted Text + Script + SVS + Film + Render
> command-line prelude. `packages/validation` now supplies package-owned semantic Type admission: authored,
-> provided, Producer and Provider values use the same exact-Type validator gate while Core verifies
+> provided, Producer and Endpoint values use the same exact-Type validator gate while Core verifies
> only the locked receipt. `packages/runtime` now supplies the environment-neutral executor and
> BuildStore/OperationStore ports, static Runtime facets, sealed Profile/Closure resolution,
> in-memory CAS, and a queue-free local Scheduler whose concurrency lanes are shared across Builds
-> and independent commands inside one Build. Recoverable Provider Endpoints now journal a stable
+> and independent commands inside one Build. Recoverable Endpoints now journal a stable
> submission identity before `start`, persist pending checkpoints, and use `resume` after restart;
> completed operations are replayed into Core without another external call. Trusted installed
> author packages can now be activated from a byte-locked physical dependency closure without
@@ -56,7 +56,7 @@
> HyperFrames Endpoint adapters are not implemented yet. The first KIE generation Provider and its
> seven explicit model families are implemented. `@svml/store-sqlite`, `@svml/artifact-store-fs` and
> `@svml/local` now provide the durable zero-service developer assembly.
-> `@svml/provider-kit` and `@svml/credential-store-env` now bind static Provider identity,
+> `@svml/endpoint-kit` and `@svml/credential-store-env` now bind static Endpoint identity,
> non-secret configuration, exact credential slots and recoverable wake/retry/cancel behavior;
> `@svml/artifact-store-s3` plus bounded Lambda/process transports provide replaceable external
> execution plumbing without claiming any video capability;
diff --git a/docs/README.md b/docs/README.md
index 62151d83..b8167abd 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -66,7 +66,7 @@ application assembly.
and stores. The environment-neutral executor, sealed Runtime Profile/Closure, in-memory
BuildStore/OperationStore CAS, queue-free local Scheduler and recoverable Endpoint lifecycle are
implemented. SQLite Build/Operation stores, filesystem/S3 artifacts and the `@svml/local`
- developer assembly are now implemented together with Provider Kit, environment credential
+ developer assembly are now implemented together with Endpoint Kit, environment credential
injection, bounded Lambda/process transports, wake/follow, retry, status and cancellation, plus
local KIE/media/HyperFrames/WhisperX execution packages; distributed leases and production hosted
endpoints are not. Its older example package
diff --git a/packages/artifact-store-fs/src/manifest.ts b/packages/artifact-store-fs/src/manifest.ts
index 09c837be..b141cc8f 100644
--- a/packages/artifact-store-fs/src/manifest.ts
+++ b/packages/artifact-store-fs/src/manifest.ts
@@ -16,7 +16,7 @@ export const fileArtifactStoreImplementationDigest = digestOf(
);
export const fileArtifactStoreRuntimeManifest: RuntimeModuleManifest = {
- format: "svml.runtime-module@1",
+ format: "svml.runtime-module@2",
name: fileArtifactStoreModuleRef.name,
version: fileArtifactStoreModuleRef.version,
facets: [
diff --git a/packages/artifact-store-s3/README.md b/packages/artifact-store-s3/README.md
index 39f6a44e..cebe7221 100644
--- a/packages/artifact-store-s3/README.md
+++ b/packages/artifact-store-s3/README.md
@@ -26,7 +26,7 @@ export default createProjectLocalRuntime({
root: import.meta.dirname,
artifacts,
allowedPermissions: ["network:aws:s3"],
- providers: [],
+ endpoints: [],
});
```
diff --git a/packages/artifact-store-s3/src/manifest.ts b/packages/artifact-store-s3/src/manifest.ts
index cc8ca986..0270b5c4 100644
--- a/packages/artifact-store-s3/src/manifest.ts
+++ b/packages/artifact-store-s3/src/manifest.ts
@@ -16,7 +16,7 @@ export const s3ArtifactStoreImplementationDigest = digestOf(
);
export const s3ArtifactStoreRuntimeManifest: RuntimeModuleManifest = {
- format: "svml.runtime-module@1",
+ format: "svml.runtime-module@2",
name: s3ArtifactStoreModuleRef.name,
version: s3ArtifactStoreModuleRef.version,
facets: [{
diff --git a/packages/component-kit/README.md b/packages/component-kit/README.md
index 4da5b558..55535b68 100644
--- a/packages/component-kit/README.md
+++ b/packages/component-kit/README.md
@@ -8,7 +8,7 @@ Core command, Producer identity and immutable typed inputs.
They receive no ArtifactStore, credentials, network client, queue or Runtime service. Work that
needs those authorities must emit an explicit Need and be implemented by a separately selected
-Provider package. `@svml/driver-node` implements the structural registrar but is not part of this
+Endpoint package. `@svml/driver-node` implements the structural registrar but is not part of this
SDK.
This is dependency inversion, not a sandbox. Until components run in an isolated Worker, selected
diff --git a/packages/component-kit/src/index.ts b/packages/component-kit/src/index.ts
index b024f191..8a340954 100644
--- a/packages/component-kit/src/index.ts
+++ b/packages/component-kit/src/index.ts
@@ -33,7 +33,7 @@ export type ProducerHandler = (
context: ProducerHandlerContext,
) => Awaitable<ProducerHandlerResult>;
-/** Minimal structural port implemented by Node HostRegistry and any future compute Host. */
+/** Minimal structural port implemented by Node ProducerRegistry and any future compute Host. */
export interface ProducerRegistrar {
registerProducer(
producer: ProducerRef,
diff --git a/packages/credential-store-env/src/index.ts b/packages/credential-store-env/src/index.ts
index 2ed7b084..5257e206 100644
--- a/packages/credential-store-env/src/index.ts
+++ b/packages/credential-store-env/src/index.ts
@@ -22,7 +22,7 @@ export const environmentCredentialStoreImplementationDigest = digestOf(
);
export const environmentCredentialStoreRuntimeManifest: RuntimeModuleManifest = {
- format: "svml.runtime-module@1",
+ format: "svml.runtime-module@2",
name: environmentCredentialStoreModuleRef.name,
version: environmentCredentialStoreModuleRef.version,
facets: [{
diff --git a/packages/driver-node/README.md b/packages/driver-node/README.md
index 60ca0bc3..162eb138 100644
--- a/packages/driver-node/README.md
+++ b/packages/driver-node/README.md
@@ -6,38 +6,39 @@ Its Manifest helpers only read Node filesystem paths and construct a verified Cl
Manifest JSON parsing belongs to `@svml/protocol` and is re-exported here temporarily for callers of
the prototype API.
-- `HostRegistry` implements the host-neutral `@svml/component-kit` Producer registrar. Deterministic
+- `ProducerRegistry` implements the host-neutral `@svml/component-kit` Producer registrar. Deterministic
component packages depend on that tiny structural port, not on this Node Driver.
-- `ProviderRegistry` binds an already explicit external capability to endpoints that may use APIs, credentials, queues or local runtimes.
+- `EndpointRegistry` binds an already explicit external capability to implementations that may use
+ APIs, credentials, queues, local runtimes, devices or human services.
- Registrations may declare a scheduling lane and default concurrency. The environment-neutral
`@svml/runtime` Scheduler shares that lane across Builds; a Runtime Profile may override its limit.
- A Producer receives only its command identity and immutable typed inputs. It has no ArtifactStore,
credentials, network, queue or store handle; external work must be emitted as a typed `Need`.
-- Providers match the locked `CapabilityRef` and return `TypeRef`. Multiple exact endpoints require
+- Endpoints match the locked `CapabilityRef` and return `TypeRef`. Multiple exact endpoints require
`bind()`. The Registry never routes by return type alone.
- Production-style assembly uses `applyRuntimeClosure()`: Endpoint instance, exact capability and
return Type, implementation digest, non-secret configuration digest, declared credential slots
and Profile-owned scheduling must all match atomically.
Legacy direct `bind()` remains only as the low-level trusted test/embedding API.
-- Long-lived external work uses `registerProviderEndpoint()`, not an immediate Handler. The Driver
+- Long-lived external work uses `registerRecoverableEndpoint()`, not an immediate Handler. The Driver
creates a content-addressed Operation before `start()`, persists pending checkpoints, calls
`resume()` for an existing Operation, and replays a journaled completion without another external
call. A recoverable Endpoint is blocked unless both its locked Runtime Closure and an
`OperationStore` are present.
-- Provider credentials are resolved only for the slots declared by that locked endpoint, immediately
+- Endpoint credentials are resolved only for the slots declared by that locked endpoint, immediately
before `start/resume/cancel`; secret bytes never become Driver journal or Core state.
- A pending Endpoint may publish `wakeAt`. Retryable terminal failure creates a new attempt and
submission key under the endpoint's finite retry policy; cancellation becomes an explicit terminal
failure that Core accepts through its ordinary command-failed Event.
-- Preview, fallback and reuse are graph-level Candidates selected by BuildRequest, not Provider
+- Preview, fallback and reuse are graph-level Candidates selected by BuildRequest, not Endpoint
modes. A reused value is an Existing-Value Candidate; “Pin” is only the host UI action that selects
it. Candidate fidelity is sealed into the Core-derived plan before execution.
-- Provider identity becomes the Receipt fulfiller; handlers return only value, conformance, delivery and metadata.
+- Endpoint identity becomes the Receipt fulfiller; handlers return only value, conformance, delivery and metadata.
- `TypeValidatorRegistry` is a separate exact-Type registry. Before an Event exists, the Driver
structurally checks every result, executes the Type owner's digest-locked validator when declared,
- and attaches the resulting receipt. Producer and Provider handlers cannot self-assert validation.
+ and attaches the resulting receipt. Producer and Endpoint handlers cannot self-assert validation.
-Build state is serializable. Missing providers, generation latency and transient provider errors pause a
+Build state is serializable. Missing Endpoints, generation latency and transient endpoint errors pause a
build without replaying completed Producers.
`start()` and `resume()` receive the same stable submission key. `resume(undefined)` is intentional:
@@ -48,7 +49,7 @@ exactly-once semantics for an API that does not provide them.
`prepare()` regenerates and classifies the exact current Core commands. `executeCommand()` accepts
only one regenerated command id, so a Scheduler cannot smuggle modified serialized command content
into a paid Handler. `NodeDriver.run()` remains the simple serial convenience path; multi-Build and
-within-Build parallelism belong to `LocalBuildScheduler`, not to a Provider-specific queue.
+within-Build parallelism belong to `LocalBuildScheduler`, not to an Endpoint-specific queue.
Callers using a recoverable Endpoint through the serial path must pass a stable Build identity as
`run(state, { build })`; the Driver deliberately does not derive one from BuildRequest content,
because two identical requests may still be distinct Builds. The Scheduler always supplies its
diff --git a/packages/driver-node/package.json b/packages/driver-node/package.json
index aaa64182..d7075525 100644
--- a/packages/driver-node/package.json
+++ b/packages/driver-node/package.json
@@ -9,6 +9,7 @@
"dependencies": {
"@svml/component-kit": "workspace:*",
"@svml/core": "workspace:*",
+ "@svml/endpoint-kit": "workspace:*",
"@svml/protocol": "workspace:*",
"@svml/runtime": "workspace:*",
"@svml/validation": "workspace:*"
diff --git a/packages/driver-node/src/driver.ts b/packages/driver-node/src/driver.ts
index c9d009e9..44394dd5 100644
--- a/packages/driver-node/src/driver.ts
+++ b/packages/driver-node/src/driver.ts
@@ -1,5 +1,6 @@
import { digestOf, reduce, resolveProducer } from "@svml/core";
import type { ProducerHandlerResult } from "@svml/component-kit";
+import type { EndpointFulfillment } from "@svml/endpoint-kit";
import type {
BuildEvent,
BuildState,
@@ -31,24 +32,23 @@ import type {
import { MemoryArtifactStore } from "./artifacts.js";
import {
- HostRegistry,
- ProviderRegistry,
+ ProducerRegistry,
+ EndpointRegistry,
producerRegistryKey,
- providerCapabilityKey,
- providerReturnKey,
+ endpointCapabilityKey,
+ endpointReturnKey,
} from "./registry.js";
import type {
ArtifactStore,
BlockedCommand,
DriverJournalEntry,
DriverRunResult,
- ProviderRegistration,
- ProviderHandlerResult,
+ EndpointRegistration,
} from "./types.js";
export type NodeDriverOptions = {
- readonly registry?: HostRegistry;
- readonly providers?: ProviderRegistry;
+ readonly producers?: ProducerRegistry;
+ readonly endpoints?: EndpointRegistry;
readonly artifacts?: ArtifactStore;
readonly operations?: OperationStore;
readonly credentials?: CredentialStore;
@@ -66,15 +66,15 @@ type Executable =
}
| {
readonly command: FulfillNeedCommand;
- readonly providerId: string;
+ readonly endpointId: string;
readonly lane: string;
readonly maxConcurrency: number;
- readonly registration: ProviderRegistration;
+ readonly registration: EndpointRegistration;
};
export class NodeDriver {
- readonly registry: HostRegistry;
- readonly providers: ProviderRegistry;
+ readonly producers: ProducerRegistry;
+ readonly endpoints: EndpointRegistry;
readonly artifacts: ArtifactStore;
readonly operations: OperationStore | undefined;
readonly credentials: CredentialStore | undefined;
@@ -83,8 +83,8 @@ export class NodeDriver {
readonly implementationClosure: Digest | undefined;
constructor(options: NodeDriverOptions = {}) {
- this.registry = options.registry ?? new HostRegistry();
- this.providers = options.providers ?? new ProviderRegistry();
+ this.producers = options.producers ?? new ProducerRegistry();
+ this.endpoints = options.endpoints ?? new EndpointRegistry();
this.artifacts = options.artifacts ?? new MemoryArtifactStore();
this.operations = options.operations;
this.credentials = options.credentials;
@@ -105,20 +105,20 @@ export class NodeDriver {
}
}
- async #providerCredentials(
- registration: ProviderRegistration,
+ async #endpointCredentials(
+ registration: EndpointRegistration,
): Promise<Readonly<Record<string, CredentialValue>>> {
const requested = registration.credentials ?? {};
if (Object.keys(requested).length === 0) return {};
if (this.credentials === undefined) {
- throw new Error(`Provider ${registration.id} requires a CredentialStore`);
+ throw new Error(`Endpoint ${registration.id} requires a CredentialStore`);
}
const resolved: Record<string, CredentialValue> = {};
for (const slot of Object.keys(requested).sort()) {
const ref = requested[slot]!;
const value = await this.credentials.resolve(ref);
if (value === undefined) {
- throw new Error(`Provider ${registration.id} credential ${slot} is unavailable from ${ref.store}:${ref.key}`);
+ throw new Error(`Endpoint ${registration.id} credential ${slot} is unavailable from ${ref.store}:${ref.key}`);
}
resolved[slot] = value;
}
@@ -146,7 +146,7 @@ export class NodeDriver {
): { readonly executable?: Executable; readonly blocked?: BlockedCommand } {
if (command.kind === "complete") return {};
if (command.kind === "invoke-producer") {
- const registration = this.registry.producer(command.producer);
+ const registration = this.producers.producer(command.producer);
if (registration === undefined) {
return {
blocked: {
@@ -181,15 +181,15 @@ export class NodeDriver {
};
}
- const resolution = this.providers.resolve(command.need);
+ const resolution = this.endpoints.resolve(command.need);
if (resolution.status === "missing") {
return {
blocked: {
command: command.id,
- reason: "missing-provider",
- subject: resolution.providerId === undefined
- ? `${providerCapabilityKey(command.need.capability)} -> ${providerReturnKey(command.need.returns)}`
- : `${providerCapabilityKey(command.need.capability)} -> ${resolution.providerId}`,
+ reason: "missing-endpoint",
+ subject: resolution.endpointId === undefined
+ ? `${endpointCapabilityKey(command.need.capability)} -> ${endpointReturnKey(command.need.returns)}`
+ : `${endpointCapabilityKey(command.need.capability)} -> ${resolution.endpointId}`,
},
};
}
@@ -197,13 +197,13 @@ export class NodeDriver {
return {
blocked: {
command: command.id,
- reason: "ambiguous-provider",
- subject: `${providerCapabilityKey(command.need.capability)} -> ${resolution.providerIds.join(", ")}`,
+ reason: "ambiguous-endpoint",
+ subject: `${endpointCapabilityKey(command.need.capability)} -> ${resolution.endpointIds.join(", ")}`,
},
};
}
const registration = resolution.registration;
- if (registration.kind === "endpoint" && this.operations === undefined) {
+ if (registration.kind === "recoverable" && this.operations === undefined) {
return {
blocked: {
command: command.id,
@@ -212,7 +212,7 @@ export class NodeDriver {
},
};
}
- if (registration.kind === "endpoint" && this.providers.runtimeClosureDigest() === undefined) {
+ if (registration.kind === "recoverable" && this.endpoints.runtimeClosureDigest() === undefined) {
return {
blocked: {
command: command.id,
@@ -224,18 +224,18 @@ export class NodeDriver {
return {
executable: {
command,
- providerId: registration.id,
- lane: registration.scheduling?.lane ?? `provider:${registration.id}`,
+ endpointId: registration.id,
+ lane: registration.scheduling?.lane ?? `endpoint:${registration.id}`,
maxConcurrency: registration.scheduling?.maxConcurrency ?? 1,
registration,
},
};
}
- async #providerEvent(
+ async #endpointEvent(
state: BuildState,
- executable: Extract<Executable, { readonly providerId: string }>,
- result: ProviderHandlerResult,
+ executable: Extract<Executable, { readonly endpointId: string }>,
+ result: EndpointFulfillment,
): Promise<BuildEvent> {
const validation = await validateValue(
state.program.closure,
@@ -248,7 +248,7 @@ export class NodeDriver {
command: executable.command.id,
value: result.value,
requestDigest: executable.command.need.requestDigest,
- fulfiller: executable.providerId,
+ fulfiller: executable.endpointId,
conformance: result.conformance,
delivery: result.delivery,
metadata: result.metadata,
@@ -259,7 +259,7 @@ export class NodeDriver {
async #completedOperation(
state: BuildState,
- executable: Extract<Executable, { readonly providerId: string }>,
+ executable: Extract<Executable, { readonly endpointId: string }>,
snapshot: OperationSnapshot,
expectedOperation: string,
maxAttempts: number,
@@ -271,7 +271,7 @@ export class NodeDriver {
if (snapshot.status === "completed" && snapshot.completion !== undefined) {
return {
status: "completed",
- event: await this.#providerEvent(state, executable, snapshot.completion),
+ event: await this.#endpointEvent(state, executable, snapshot.completion),
};
}
if (snapshot.status === "failed") {
@@ -322,20 +322,20 @@ export class NodeDriver {
async #executeEndpoint(
state: BuildState,
- executable: Extract<Executable, { readonly providerId: string }>,
+ executable: Extract<Executable, { readonly endpointId: string }>,
context: RuntimeExecutionContext,
): Promise<RuntimeExecutionResult> {
- if (executable.registration.kind !== "endpoint") throw new Error("Provider is not a recoverable Endpoint");
+ if (executable.registration.kind !== "recoverable") throw new Error("Endpoint is not recoverable");
const operations = this.operations;
- if (operations === undefined) throw new Error("recoverable Provider Endpoint requires OperationStore");
- const runtimeClosure = this.providers.runtimeClosureDigest();
- if (runtimeClosure === undefined) throw new Error("recoverable Provider Endpoint requires Runtime Closure");
+ if (operations === undefined) throw new Error("recoverable Endpoint requires OperationStore");
+ const runtimeClosure = this.endpoints.runtimeClosureDigest();
+ if (runtimeClosure === undefined) throw new Error("recoverable Endpoint requires Runtime Closure");
const implementation = executable.registration.runtimeImplementation;
- if (implementation === undefined) throw new Error("recoverable Provider Endpoint has no implementation identity");
+ if (implementation === undefined) throw new Error("recoverable Endpoint has no implementation identity");
const base = {
build: context.build,
command: executable.command.id,
- endpoint: executable.providerId,
+ endpoint: executable.endpointId,
implementationDigest: implementation.digest,
runtimeClosure,
requestDigest: executable.command.need.requestDigest,
@@ -381,7 +381,7 @@ export class NodeDriver {
command: structuredClone(executable.command),
need: structuredClone(executable.command.need),
artifacts: this.artifacts,
- credentials: await this.#providerCredentials(executable.registration),
+ credentials: await this.#endpointCredentials(executable.registration),
operation: structuredClone(identity),
};
const outcome = created.status === "created"
@@ -417,7 +417,7 @@ export class NodeDriver {
maxAttempts,
);
}
- const result: ProviderHandlerResult = {
+ const result: EndpointFulfillment = {
...outcome.result,
metadata: {
endpoint: structuredClone(outcome.result.metadata),
@@ -447,7 +447,7 @@ export class NodeDriver {
executable: Executable,
context?: RuntimeExecutionContext,
): Promise<RuntimeExecutionResult> {
- if (!("providerId" in executable)) {
+ if (!("endpointId" in executable)) {
const result = (await executable.run()) as ProducerHandlerResult;
const producer = resolveProducer(state.program.closure, executable.command.producer);
const validations: Record<string, NonNullable<Awaited<ReturnType<typeof validateValue>>>> = {};
@@ -469,7 +469,7 @@ export class NodeDriver {
event: { ...content, id: `event:${digestOf(content)}` },
};
}
- if (executable.registration.kind === "endpoint") {
+ if (executable.registration.kind === "recoverable") {
if (context === undefined) throw new Error("recoverable Endpoint execution requires a stable Build id");
return await this.#executeEndpoint(state, executable, context);
}
@@ -477,9 +477,9 @@ export class NodeDriver {
command: structuredClone(executable.command),
need: structuredClone(executable.command.need),
artifacts: this.artifacts,
- credentials: await this.#providerCredentials(executable.registration),
+ credentials: await this.#endpointCredentials(executable.registration),
});
- return { status: "completed", event: await this.#providerEvent(state, executable, result) };
+ return { status: "completed", event: await this.#endpointEvent(state, executable, result) };
}
/** Regenerate Core commands, then classify only what this Host can execute. */
@@ -532,13 +532,13 @@ export class NodeDriver {
if (descriptor === undefined) throw new Error(`Operation ${operation.id} Command is not currently runnable`);
const classified = this.#classify(prepared.state, descriptor.command);
const executable = classified.executable;
- if (executable === undefined || !("providerId" in executable)
- || executable.providerId !== operation.endpoint
- || executable.registration.kind !== "endpoint") {
- throw new Error(`Operation ${operation.id} does not match the regenerated Provider Command`);
+ if (executable === undefined || !("endpointId" in executable)
+ || executable.endpointId !== operation.endpoint
+ || executable.registration.kind !== "recoverable") {
+ throw new Error(`Operation ${operation.id} does not match the regenerated Endpoint Command`);
}
if (executable.registration.endpoint.cancel === undefined) {
- throw new Error(`Provider ${executable.providerId} does not support cancellation`);
+ throw new Error(`Endpoint ${executable.endpointId} does not support cancellation`);
}
const identity: OperationIdentity = {
format: operation.format,
@@ -556,7 +556,7 @@ export class NodeDriver {
command: structuredClone(executable.command),
need: structuredClone(executable.command.need),
artifacts: this.artifacts,
- credentials: await this.#providerCredentials(executable.registration),
+ credentials: await this.#endpointCredentials(executable.registration),
operation: identity,
checkpoint: operation.status === "pending" ? structuredClone(operation.checkpoint) : undefined,
});
diff --git a/packages/driver-node/src/index.ts b/packages/driver-node/src/index.ts
index 7b9bda96..dc4c9d50 100644
--- a/packages/driver-node/src/index.ts
+++ b/packages/driver-node/src/index.ts
@@ -8,10 +8,10 @@ export {
} from "./manifest.js";
export { parseBuildState, serializeBuildState } from "./persistence.js";
export {
- HostRegistry,
- ProviderRegistry,
+ ProducerRegistry,
+ EndpointRegistry,
producerRegistryKey,
- providerCapabilityKey,
- providerReturnKey,
+ endpointCapabilityKey,
+ endpointReturnKey,
} from "./registry.js";
export type * from "./types.js";
diff --git a/packages/driver-node/src/registry.ts b/packages/driver-node/src/registry.ts
index 00cfd0ee..5ae79bc8 100644
--- a/packages/driver-node/src/registry.ts
+++ b/packages/driver-node/src/registry.ts
@@ -1,3 +1,9 @@
+import type {
+ EndpointRegistrar,
+ EndpointRegistrationOptions,
+ ImmediateEndpointHandler,
+ RecoverableEndpoint,
+} from "@svml/endpoint-kit";
import type {
ProducerRegistrar,
} from "@svml/component-kit";
@@ -11,7 +17,7 @@ import type {
import { isDigest } from "@svml/protocol";
import {
RuntimeModuleRegistry,
- runtimeProvider,
+ runtimeEndpoint,
verifyCredentialRef,
verifyRuntimeClosure,
} from "@svml/runtime";
@@ -20,11 +26,8 @@ import type { ResolveRuntimeProfileOptions, RuntimeClosure } from "@svml/runtime
import type {
ProducerHandler,
ProducerRegistration,
- ProviderEndpoint,
- ProviderHandler,
- ProviderRegistration,
- ProviderResolution,
- RuntimeProviderImplementation,
+ EndpointRegistration,
+ EndpointResolution,
SchedulingHint,
} from "./types.js";
@@ -56,15 +59,15 @@ export function producerRegistryKey(ref: ProducerRef): string {
return `${moduleKey(ref.module)}#${ref.name}`;
}
-export function providerCapabilityKey(ref: CapabilityRef): string {
+export function endpointCapabilityKey(ref: CapabilityRef): string {
return `${moduleKey(ref.module)}#${ref.name}`;
}
-export function providerReturnKey(ref: TypeRef): string {
+export function endpointReturnKey(ref: TypeRef): string {
return `${moduleKey(ref.module)}#${ref.name}`;
}
-export class HostRegistry implements ProducerRegistrar {
+export class ProducerRegistry implements ProducerRegistrar {
readonly #producers = new Map<string, ProducerRegistration>();
registerProducer(
@@ -84,95 +87,89 @@ export class HostRegistry implements ProducerRegistrar {
}
}
-type ProviderOptions = {
- readonly supports?: (need: Need) => boolean;
- readonly scheduling?: SchedulingHint;
- readonly runtimeImplementation?: RuntimeProviderImplementation;
- readonly credentials?: NonNullable<ProviderRegistration["credentials"]>;
- readonly retry?: NonNullable<ProviderRegistration["retry"]>;
-};
+type EndpointOptions = EndpointRegistrationOptions;
-function verifyProviderOptions(options: ProviderOptions): void {
+function verifyEndpointOptions(options: EndpointOptions): void {
verifyScheduling(options.scheduling);
for (const [slot, ref] of Object.entries(options.credentials ?? {})) {
- if (slot.trim().length === 0) throw new Error("Provider credential slot must not be empty");
+ if (slot.trim().length === 0) throw new Error("Endpoint credential slot must not be empty");
verifyCredentialRef(ref);
}
if (options.retry !== undefined
&& (!Number.isSafeInteger(options.retry.maxAttempts) || options.retry.maxAttempts < 1)) {
- throw new Error("Provider retry maxAttempts must be a positive safe integer");
+ throw new Error("Endpoint retry maxAttempts must be a positive safe integer");
}
}
-export class ProviderRegistry {
- readonly #registrations: ProviderRegistration[] = [];
+export class EndpointRegistry implements EndpointRegistrar {
+ readonly #registrations: EndpointRegistration[] = [];
readonly #bindings = new Map<string, string>();
readonly #runtimeScheduling = new Map<string, SchedulingHint>();
#runtimeClosure: Digest | undefined;
- registerProvider(
+ registerImmediateEndpoint(
id: string,
capability: CapabilityRef,
returns: TypeRef,
- handler: ProviderHandler,
- options: ProviderOptions = {},
+ handler: ImmediateEndpointHandler,
+ options: EndpointOptions = {},
): void {
- if (!id.trim()) throw new Error("provider id must not be empty");
- verifyProviderOptions(options);
+ if (!id.trim()) throw new Error("endpoint id must not be empty");
+ verifyEndpointOptions(options);
if (options.runtimeImplementation !== undefined) {
if (!isDigest(options.runtimeImplementation.digest)) {
- throw new Error("Provider runtime implementation digest is invalid");
+ throw new Error("Endpoint runtime implementation digest is invalid");
}
if (!isDigest(options.runtimeImplementation.configurationDigest)) {
- throw new Error("Provider runtime configuration digest is invalid");
+ throw new Error("Endpoint runtime configuration digest is invalid");
}
const facet = options.runtimeImplementation.facet;
if (!facet.name.trim() || !facet.module.name.trim() || !facet.module.version.trim()) {
- throw new Error("Provider runtime implementation facet is invalid");
+ throw new Error("Endpoint runtime implementation facet is invalid");
}
}
const duplicate = this.#registrations.some((candidate) =>
candidate.id === id && sameRef(candidate.capability, capability));
- if (duplicate) throw new Error(`provider ${id} already registers ${providerCapabilityKey(capability)}`);
- this.#registrations.push({ kind: "handler", id, capability, returns, handler, ...options });
+ if (duplicate) throw new Error(`endpoint ${id} already registers ${endpointCapabilityKey(capability)}`);
+ this.#registrations.push({ kind: "immediate", id, capability, returns, handler, ...options });
}
- registerProviderEndpoint(
+ registerRecoverableEndpoint(
id: string,
capability: CapabilityRef,
returns: TypeRef,
- endpoint: ProviderEndpoint,
- options: ProviderOptions = {},
+ endpoint: RecoverableEndpoint,
+ options: EndpointOptions = {},
): void {
- if (!id.trim()) throw new Error("provider id must not be empty");
- verifyProviderOptions(options);
+ if (!id.trim()) throw new Error("endpoint id must not be empty");
+ verifyEndpointOptions(options);
if (options.runtimeImplementation === undefined || !isDigest(options.runtimeImplementation.digest)) {
- throw new Error("recoverable Provider Endpoint requires a valid Runtime implementation identity");
+ throw new Error("recoverable Endpoint requires a valid Runtime implementation identity");
}
if (!isDigest(options.runtimeImplementation.configurationDigest)) {
- throw new Error("recoverable Provider Endpoint requires a valid Runtime configuration identity");
+ throw new Error("recoverable Endpoint requires a valid Runtime configuration identity");
}
const facet = options.runtimeImplementation.facet;
if (!facet.name.trim() || !facet.module.name.trim() || !facet.module.version.trim()) {
- throw new Error("Provider runtime implementation facet is invalid");
+ throw new Error("Endpoint runtime implementation facet is invalid");
}
const duplicate = this.#registrations.some((candidate) =>
candidate.id === id && sameRef(candidate.capability, capability));
- if (duplicate) throw new Error(`provider ${id} already registers ${providerCapabilityKey(capability)}`);
- this.#registrations.push({ kind: "endpoint", id, capability, returns, endpoint, ...options });
+ if (duplicate) throw new Error(`endpoint ${id} already registers ${endpointCapabilityKey(capability)}`);
+ this.#registrations.push({ kind: "recoverable", id, capability, returns, endpoint, ...options });
}
runtimeClosureDigest(): Digest | undefined {
return this.#runtimeClosure;
}
- bind(capability: CapabilityRef, providerId: string): void {
- const key = providerCapabilityKey(capability);
+ bind(capability: CapabilityRef, endpointId: string): void {
+ const key = endpointCapabilityKey(capability);
if (!this.#registrations.some((registration) =>
- registration.id === providerId && sameRef(registration.capability, capability))) {
- throw new Error(`provider ${providerId} does not register capability ${key}`);
+ registration.id === endpointId && sameRef(registration.capability, capability))) {
+ throw new Error(`endpoint ${endpointId} does not register capability ${key}`);
}
- this.#bindings.set(key, providerId);
+ this.#bindings.set(key, endpointId);
}
/** Bind only implementation-verified Endpoint instances from one locked Runtime Closure. */
@@ -184,36 +181,36 @@ export class ProviderRegistry {
verifyRuntimeClosure(closure);
modules.verifyClosure(closure, options);
if (this.#runtimeClosure !== undefined && this.#runtimeClosure !== closure.digest) {
- throw new Error("Provider Registry is already bound to another Runtime Closure");
+ throw new Error("Endpoint Registry is already bound to another Runtime Closure");
}
const pending: { readonly key: string; readonly endpoint: string; readonly scheduling: SchedulingHint }[] = [];
- for (const binding of closure.providers) {
- const endpoint = runtimeProvider(closure, binding.endpoint);
+ for (const binding of closure.endpoints) {
+ const endpoint = runtimeEndpoint(closure, binding.endpoint);
if (endpoint === undefined) throw new Error(`Runtime Endpoint ${binding.endpoint} is unavailable`);
const registration = this.#registrations.find((candidate) =>
candidate.id === endpoint.id
&& sameRef(candidate.capability, binding.capability)
&& sameRef(candidate.returns, binding.returns));
if (registration === undefined) {
- throw new Error(`Provider ${endpoint.id} is not registered for ${providerCapabilityKey(binding.capability)}`);
+ throw new Error(`Endpoint ${endpoint.id} is not registered for ${endpointCapabilityKey(binding.capability)}`);
}
- const expectedKind = endpoint.lifecycle === "recoverable" ? "endpoint" : "handler";
+ const expectedKind = endpoint.lifecycle;
if (registration.kind !== expectedKind) {
- throw new Error(`Provider ${endpoint.id} lifecycle does not match the Runtime Closure`);
+ throw new Error(`Endpoint ${endpoint.id} lifecycle does not match the Runtime Closure`);
}
const implementation = registration.runtimeImplementation;
if (implementation === undefined
|| implementation.digest !== endpoint.implementation.digest
|| implementation.configurationDigest !== endpoint.configurationDigest
|| !sameRef(implementation.facet, endpoint.facet)) {
- throw new Error(`Provider ${endpoint.id} implementation does not match the Runtime Closure`);
+ throw new Error(`Endpoint ${endpoint.id} implementation does not match the Runtime Closure`);
}
const credentialSlots = Object.keys(registration.credentials ?? {}).sort();
if (JSON.stringify(credentialSlots) !== JSON.stringify(endpoint.credentialSlots)) {
- throw new Error(`Provider ${endpoint.id} credential slots do not match the Runtime Closure`);
+ throw new Error(`Endpoint ${endpoint.id} credential slots do not match the Runtime Closure`);
}
pending.push({
- key: providerCapabilityKey(binding.capability),
+ key: endpointCapabilityKey(binding.capability),
endpoint: endpoint.id,
scheduling: { lane: endpoint.lane, maxConcurrency: endpoint.maxConcurrency },
});
@@ -225,8 +222,8 @@ export class ProviderRegistry {
this.#runtimeClosure = closure.digest;
}
- resolve(need: Need): ProviderResolution {
- const key = providerCapabilityKey(need.capability);
+ resolve(need: Need): EndpointResolution {
+ const key = endpointCapabilityKey(need.capability);
const bound = this.#bindings.get(key);
const registrations = this.#registrations.filter((registration) =>
sameRef(registration.capability, need.capability)
@@ -238,7 +235,7 @@ export class ProviderRegistry {
? undefined
: this.#runtimeScheduling.get(registration.id) ?? registration.scheduling;
return registration === undefined
- ? { status: "missing", providerId: bound }
+ ? { status: "missing", endpointId: bound }
: {
status: "resolved",
registration: scheduling === undefined ? registration : { ...registration, scheduling },
@@ -248,7 +245,7 @@ export class ProviderRegistry {
if (registrations.length > 1) {
return {
status: "ambiguous",
- providerIds: registrations.map((registration) => registration.id).sort(),
+ endpointIds: registrations.map((registration) => registration.id).sort(),
};
}
const registration = registrations[0]!;
@@ -259,7 +256,7 @@ export class ProviderRegistry {
};
}
- providers(capability: CapabilityRef): readonly ProviderRegistration[] {
+ endpoints(capability: CapabilityRef): readonly EndpointRegistration[] {
return this.#registrations.filter((registration) => sameRef(registration.capability, capability));
}
}
diff --git a/packages/driver-node/src/types.ts b/packages/driver-node/src/types.ts
index 6b6eace4..a1bd050d 100644
--- a/packages/driver-node/src/types.ts
+++ b/packages/driver-node/src/types.ts
@@ -1,28 +1,15 @@
import type {
BuildState,
- CanonicalValue,
- Conformance,
CoreCommand,
- Delivery,
Digest,
- FulfillNeedCommand,
- Need,
ProducerRef,
- StoredValue,
TypeRef,
CapabilityRef,
} from "@svml/protocol";
import type {
ProducerHandler,
} from "@svml/component-kit";
-import type {
- ArtifactStore,
- CredentialRef,
- CredentialValue,
- OperationIdentity,
- OperationFailure,
- RuntimeFacetRef,
-} from "@svml/runtime";
+import type { EndpointRegistrationOptions, EndpointScheduling, ImmediateEndpointHandler, RecoverableEndpoint } from "@svml/endpoint-kit";
export type { ArtifactStore } from "@svml/runtime";
@@ -33,45 +20,6 @@ export type {
ProducerRegistrar,
} from "@svml/component-kit";
-export type ProviderHandlerResult = {
- readonly value: StoredValue;
- readonly conformance: Conformance;
- readonly delivery: Delivery;
- readonly metadata: CanonicalValue;
-};
-
-export type ProviderHandlerContext = {
- readonly command: FulfillNeedCommand;
- readonly need: Need;
- readonly artifacts: ArtifactStore;
- /** Only slots explicitly declared by this configured Provider instance are present. */
- readonly credentials: Readonly<Record<string, CredentialValue>>;
-};
-
-export type ProviderHandler = (
- context: ProviderHandlerContext,
-) => ProviderHandlerResult | Promise<ProviderHandlerResult>;
-
-export type ProviderEndpointResult =
- | { readonly status: "pending"; readonly checkpoint: CanonicalValue; readonly wakeAt?: number }
- | { readonly status: "completed"; readonly result: ProviderHandlerResult }
- | { readonly status: "failed"; readonly failure: OperationFailure };
-
-export type ProviderEndpointStartContext = ProviderHandlerContext & {
- readonly operation: OperationIdentity;
-};
-
-export type ProviderEndpointResumeContext = ProviderEndpointStartContext & {
- /** Undefined means the process stopped after intent was journaled but before a checkpoint existed. */
- readonly checkpoint: CanonicalValue | undefined;
-};
-
-export type ProviderEndpoint = {
- start(context: ProviderEndpointStartContext): ProviderEndpointResult | Promise<ProviderEndpointResult>;
- resume(context: ProviderEndpointResumeContext): ProviderEndpointResult | Promise<ProviderEndpointResult>;
- cancel?(context: ProviderEndpointResumeContext): void | Promise<void>;
-};
-
export type DriverJournalEntry = {
readonly command: string;
readonly kind: CoreCommand["kind"];
@@ -87,8 +35,8 @@ export type BlockedCommand = {
readonly reason:
| "missing-producer"
| "implementation-mismatch"
- | "missing-provider"
- | "ambiguous-provider"
+ | "missing-endpoint"
+ | "ambiguous-endpoint"
| "missing-operation-store"
| "missing-runtime-closure";
readonly subject: string;
@@ -102,22 +50,7 @@ export type DriverRunResult = {
};
/** Endpoint/implementation scheduling metadata; it never changes Core demand or command identity. */
-export type SchedulingHint = {
- readonly lane?: string;
- readonly maxConcurrency?: number;
-};
-
-export type ProviderRetryPolicy = {
- /** Includes the first submission. A new attempt receives a new submission key. */
- readonly maxAttempts: number;
-};
-
-export type RuntimeProviderImplementation = {
- readonly facet: RuntimeFacetRef;
- readonly digest: Digest;
- /** Identity of the configured endpoint instance; secret values are never part of it. */
- readonly configurationDigest: Digest;
-};
+export type SchedulingHint = EndpointScheduling;
export type ProducerRegistration = {
readonly producer: ProducerRef;
@@ -126,23 +59,18 @@ export type ProducerRegistration = {
readonly scheduling?: SchedulingHint;
};
-type ProviderRegistrationBase = {
+type EndpointRegistrationBase = {
readonly id: string;
readonly capability: CapabilityRef;
readonly returns: TypeRef;
- readonly supports?: (need: Need) => boolean;
- readonly scheduling?: SchedulingHint;
- readonly runtimeImplementation?: RuntimeProviderImplementation;
- readonly credentials?: Readonly<Record<string, CredentialRef>>;
- readonly retry?: ProviderRetryPolicy;
-};
+} & EndpointRegistrationOptions;
-export type ProviderRegistration = ProviderRegistrationBase & (
- | { readonly kind: "handler"; readonly handler: ProviderHandler }
- | { readonly kind: "endpoint"; readonly endpoint: ProviderEndpoint }
+export type EndpointRegistration = EndpointRegistrationBase & (
+ | { readonly kind: "immediate"; readonly handler: ImmediateEndpointHandler }
+ | { readonly kind: "recoverable"; readonly endpoint: RecoverableEndpoint }
);
-export type ProviderResolution =
- | { readonly status: "resolved"; readonly registration: ProviderRegistration }
- | { readonly status: "missing"; readonly providerId?: string }
- | { readonly status: "ambiguous"; readonly providerIds: readonly string[] };
+export type EndpointResolution =
+ | { readonly status: "resolved"; readonly registration: EndpointRegistration }
+ | { readonly status: "missing"; readonly endpointId?: string }
+ | { readonly status: "ambiguous"; readonly endpointIds: readonly string[] };
diff --git a/packages/driver-node/test/driver.test.ts b/packages/driver-node/test/driver.test.ts
index f509240f..5a28822b 100644
--- a/packages/driver-node/test/driver.test.ts
+++ b/packages/driver-node/test/driver.test.ts
@@ -6,10 +6,10 @@ import test from "node:test";
import { digestOf, recordDigest, reduce } from "@svml/core";
import {
- HostRegistry,
+ ProducerRegistry,
MemoryArtifactStore,
NodeDriver,
- ProviderRegistry,
+ EndpointRegistry,
loadResolvedClosure,
parseBuildState,
serializeBuildState,
@@ -21,7 +21,7 @@ import {
createGreetingBuild,
implementationDigests,
manifest,
- producers,
+ producers as greetingProducers,
types,
} from "../../core/test/greeting-fixture.js";
@@ -38,15 +38,15 @@ type GreetingCalls = {
};
function configuredRegistry(): {
- registry: HostRegistry;
- providers: ProviderRegistry;
+ producers: ProducerRegistry;
+ endpoints: EndpointRegistry;
calls: GreetingCalls;
} {
- const registry = new HostRegistry();
- const providers = new ProviderRegistry();
+ const producers = new ProducerRegistry();
+ const endpoints = new EndpointRegistry();
const calls = { prompt: 0, request: 0, assemble: 0, fulfill: 0 };
- registry.registerProducer(producers.makePrompt, implementationDigests.makePrompt, ({ inputs }) => {
+ producers.registerProducer(greetingProducers.makePrompt, implementationDigests.makePrompt, ({ inputs }) => {
calls.prompt += 1;
const intent = inputs.intent;
if (intent?.value.kind !== "inline") throw new Error("intent must be inline");
@@ -61,7 +61,7 @@ function configuredRegistry(): {
};
});
- registry.registerProducer(producers.requestText, implementationDigests.requestText, ({ inputs }) => {
+ producers.registerProducer(greetingProducers.requestText, implementationDigests.requestText, ({ inputs }) => {
calls.request += 1;
const prompt = inputs.prompt;
assert.equal(prompt?.value.kind, "inline");
@@ -71,7 +71,7 @@ function configuredRegistry(): {
};
});
- registry.registerProducer(producers.assemble, implementationDigests.assemble, ({ inputs }) => {
+ producers.registerProducer(greetingProducers.assemble, implementationDigests.assemble, ({ inputs }) => {
calls.assemble += 1;
const generated = inputs.generated;
assert.equal(generated?.value.kind, "inline");
@@ -86,27 +86,27 @@ function configuredRegistry(): {
};
});
- return { registry, providers, calls };
+ return { producers, endpoints, calls };
}
test("Driver pauses at an unbound Need, serializes, then resumes without rerunning producers", async () => {
- const { registry, providers, calls } = configuredRegistry();
- const driver = new NodeDriver({ registry, providers });
+ const { producers, endpoints, calls } = configuredRegistry();
+ const driver = new NodeDriver({ producers, endpoints });
const paused = await driver.run(createGreetingBuild());
assert.equal(paused.status, "paused");
- assert.equal(paused.blocked[0]?.reason, "missing-provider");
+ assert.equal(paused.blocked[0]?.reason, "missing-endpoint");
assert.deepEqual(calls, { prompt: 1, request: 1, assemble: 0, fulfill: 0 });
const restored = parseBuildState(serializeBuildState(paused.state));
- providers.registerProvider("example:generation", capabilities.generation, types.generated, ({ need }) => {
+ endpoints.registerImmediateEndpoint("example:generation", capabilities.generation, types.generated, ({ need }) => {
calls.fulfill += 1;
assert.deepEqual(need.constraints, { prompt: "Greet Ada" });
return {
value: { kind: "inline", value: "Hello, Ada!" },
conformance: "exact",
delivery: "executed",
- metadata: { provider: "fixture" },
+ metadata: { endpoint: "fixture" },
};
});
@@ -118,28 +118,28 @@ test("Driver pauses at an unbound Need, serializes, then resumes without rerunni
assert.equal(completed.state.records.find((record) => record.id === "document:root")?.conformance, "exact");
});
-test("Provider Registry rejects ambiguity until the Runtime binds one provider", async () => {
- const { registry, providers } = configuredRegistry();
- providers.registerProvider("example:alpha", capabilities.generation, types.generated, () => ({
+test("Endpoint Registry rejects ambiguity until the Runtime binds one endpoint", async () => {
+ const { producers, endpoints } = configuredRegistry();
+ endpoints.registerImmediateEndpoint("example:alpha", capabilities.generation, types.generated, () => ({
value: { kind: "inline", value: "Alpha" },
conformance: "exact",
delivery: "executed",
metadata: {},
}));
- providers.registerProvider("example:beta", capabilities.generation, types.generated, () => ({
+ endpoints.registerImmediateEndpoint("example:beta", capabilities.generation, types.generated, () => ({
value: { kind: "inline", value: "Beta" },
conformance: "exact",
delivery: "executed",
metadata: {},
}));
- const driver = new NodeDriver({ registry, providers });
+ const driver = new NodeDriver({ producers, endpoints });
const ambiguous = await driver.run(createGreetingBuild());
assert.equal(ambiguous.status, "paused");
- assert.equal(ambiguous.blocked[0]?.reason, "ambiguous-provider");
+ assert.equal(ambiguous.blocked[0]?.reason, "ambiguous-endpoint");
assert.match(ambiguous.blocked[0]?.subject ?? "", /example:alpha, example:beta/u);
- providers.bind(capabilities.generation, "example:beta");
+ endpoints.bind(capabilities.generation, "example:beta");
const completed = await driver.run(ambiguous.state);
assert.equal(completed.status, "complete");
assert.equal(completed.state.receipts[0]?.fulfiller, "example:beta");
@@ -149,9 +149,9 @@ test("Provider Registry rejects ambiguity until the Runtime binds one provider",
);
});
-test("a Provider receives only declared credential slots and secrets never enter BuildState", async () => {
- const { registry, providers } = configuredRegistry();
- providers.registerProvider(
+test("an Endpoint receives only declared credential slots and secrets never enter BuildState", async () => {
+ const { producers, endpoints } = configuredRegistry();
+ endpoints.registerImmediateEndpoint(
"example:credentialed",
capabilities.generation,
types.generated,
@@ -165,14 +165,14 @@ test("a Provider receives only declared credential slots and secrets never enter
metadata: { authenticated: true },
};
},
- { credentials: { apiKey: credentialRef("test", "provider-key") } },
+ { credentials: { apiKey: credentialRef("test", "endpoint-key") } },
);
const driver = new NodeDriver({
- registry,
- providers,
+ producers,
+ endpoints,
credentials: {
async resolve(ref) {
- return ref.store === "test" && ref.key === "provider-key"
+ return ref.store === "test" && ref.key === "endpoint-key"
? { secret: "top-secret-value" }
: undefined;
},
@@ -183,12 +183,12 @@ test("a Provider receives only declared credential slots and secrets never enter
assert.equal(JSON.stringify(completed.state).includes("top-secret-value"), false);
});
-test("Provider capabilities may narrow themselves with typed Need constraints", async () => {
- const { registry, providers } = configuredRegistry();
- providers.registerProvider("example:wrong-model", capabilities.generation, types.generated, () => {
- throw new Error("unsupported provider must never run");
+test("Endpoint capabilities may narrow themselves with typed Need constraints", async () => {
+ const { producers, endpoints } = configuredRegistry();
+ endpoints.registerImmediateEndpoint("example:wrong-model", capabilities.generation, types.generated, () => {
+ throw new Error("unsupported endpoint must never run");
}, { supports: () => false });
- providers.registerProvider("example:compatible", capabilities.generation, types.generated, () => ({
+ endpoints.registerImmediateEndpoint("example:compatible", capabilities.generation, types.generated, () => ({
value: { kind: "inline", value: "Compatible" },
conformance: "exact",
delivery: "executed",
@@ -200,15 +200,15 @@ test("Provider capabilities may narrow themselves with typed Need constraints",
},
});
- const completed = await new NodeDriver({ registry, providers }).run(createGreetingBuild());
+ const completed = await new NodeDriver({ producers, endpoints }).run(createGreetingBuild());
assert.equal(completed.status, "complete");
assert.equal(completed.state.receipts[0]?.fulfiller, "example:compatible");
});
test("the same return Type cannot impersonate another exact capability", async () => {
- const { registry, providers } = configuredRegistry();
+ const { producers, endpoints } = configuredRegistry();
let calls = 0;
- providers.registerProvider(
+ endpoints.registerImmediateEndpoint(
"example:wrong-capability",
{ module: capabilities.generation.module, name: "different-text-operation" },
types.generated,
@@ -222,16 +222,16 @@ test("the same return Type cannot impersonate another exact capability", async (
};
},
);
- const result = await new NodeDriver({ registry, providers }).run(createGreetingBuild());
+ const result = await new NodeDriver({ producers, endpoints }).run(createGreetingBuild());
assert.equal(result.status, "paused");
- assert.equal(result.blocked[0]?.reason, "missing-provider");
+ assert.equal(result.blocked[0]?.reason, "missing-endpoint");
assert.equal(calls, 0);
});
-test("a substitute Candidate is explicitly selected by BuildRequest, never by Provider return Type", async () => {
- const { registry, providers } = configuredRegistry();
- registry.registerProducer(
- producers.placeholderText,
+test("a substitute Candidate is explicitly selected by BuildRequest, never by Endpoint return Type", async () => {
+ const { producers, endpoints } = configuredRegistry();
+ producers.registerProducer(
+ greetingProducers.placeholderText,
implementationDigests.placeholderText,
() => ({
outputs: { generated: { kind: "inline", value: "Compatible placeholder" } },
@@ -239,30 +239,30 @@ test("a substitute Candidate is explicitly selected by BuildRequest, never by Pr
}),
);
- const exact = await new NodeDriver({ registry, providers }).run(createGreetingBuild());
+ const exact = await new NodeDriver({ producers, endpoints }).run(createGreetingBuild());
assert.equal(exact.status, "paused");
- assert.equal(exact.blocked[0]?.reason, "missing-provider");
+ assert.equal(exact.blocked[0]?.reason, "missing-endpoint");
assert.throws(
() => createGreetingBuild({ generationRealization: "placeholder" }),
/selects a substitute path/u,
);
- const accepted = await new NodeDriver({ registry, providers }).run(
+ const accepted = await new NodeDriver({ producers, endpoints }).run(
createGreetingBuild({ generationRealization: "placeholder", goalAccepts: "substitute" }),
);
assert.equal(accepted.status, "complete");
- assert.equal(accepted.state.receipts.length, 0, "an Alternative Producer is not disguised as a Provider receipt");
+ assert.equal(accepted.state.receipts.length, 0, "an Alternative Producer is not disguised as an Endpoint receipt");
assert.equal(accepted.state.records.find((record) => record.id === "generated:placeholder")?.conformance, "substitute");
});
test("substitute conformance propagates through later producer outputs", async () => {
- const { registry, providers } = configuredRegistry();
- registry.registerProducer(
- producers.placeholderText,
+ const { producers, endpoints } = configuredRegistry();
+ producers.registerProducer(
+ greetingProducers.placeholderText,
implementationDigests.placeholderText,
() => ({ outputs: { generated: { kind: "inline", value: "Placeholder" } }, needs: {} }),
);
- const result = await new NodeDriver({ registry, providers }).run(
+ const result = await new NodeDriver({ producers, endpoints }).run(
createGreetingBuild({ generationRealization: "placeholder", goalAccepts: "substitute" }),
);
assert.equal(result.status, "complete");
@@ -271,12 +271,12 @@ test("substitute conformance propagates through later producer outputs", async (
});
test("Driver refuses a registered implementation whose digest differs from the locked closure", async () => {
- const registry = new HostRegistry();
- registry.registerProducer(producers.makePrompt, implementationDigests.assemble, () => ({
+ const producers = new ProducerRegistry();
+ producers.registerProducer(greetingProducers.makePrompt, implementationDigests.assemble, () => ({
outputs: { prompt: { kind: "inline", value: "wrong implementation" } },
needs: {},
}));
- const result = await new NodeDriver({ registry }).run(createGreetingBuild());
+ const result = await new NodeDriver({ producers }).run(createGreetingBuild());
assert.equal(result.status, "paused");
assert.equal(result.blocked[0]?.reason, "implementation-mismatch");
assert.equal(result.state.records.length, 1);
@@ -326,8 +326,8 @@ test("Driver reads static manifests without executing package code", async () =>
});
test("Core still owns scheduling when Driver has every implementation", async () => {
- const { registry, providers } = configuredRegistry();
- providers.registerProvider("example:cache", capabilities.generation, types.generated, () => ({
+ const { producers, endpoints } = configuredRegistry();
+ endpoints.registerImmediateEndpoint("example:cache", capabilities.generation, types.generated, () => ({
value: { kind: "inline", value: "Hello, Ada!" },
conformance: "exact",
delivery: "cache",
@@ -335,20 +335,20 @@ test("Core still owns scheduling when Driver has every implementation", async ()
}));
const start = createGreetingBuild();
assert.equal(reduce(start).commands[0]?.kind, "invoke-producer");
- const result = await new NodeDriver({ registry, providers }).run(start);
+ const result = await new NodeDriver({ producers, endpoints }).run(start);
assert.equal(result.status, "complete");
assert.equal(result.state.receipts[0]?.delivery, "cache");
});
test("receipt metadata is covered by its identity during resume validation", async () => {
- const { registry, providers } = configuredRegistry();
- providers.registerProvider("example:cache", capabilities.generation, types.generated, () => ({
+ const { producers, endpoints } = configuredRegistry();
+ endpoints.registerImmediateEndpoint("example:cache", capabilities.generation, types.generated, () => ({
value: { kind: "inline", value: "Hello, Ada!" },
conformance: "exact",
delivery: "cache",
metadata: { cacheKey: "stable" },
}));
- const result = await new NodeDriver({ registry, providers }).run(createGreetingBuild());
+ const result = await new NodeDriver({ producers, endpoints }).run(createGreetingBuild());
assert.equal(result.status, "complete");
const tampered = structuredClone(result.state);
const receipt = tampered.receipts[0];
@@ -358,14 +358,14 @@ test("receipt metadata is covered by its identity during resume validation", asy
});
test("derived output content is bound to the Derivation even if its Record digest is recomputed", async () => {
- const { registry, providers } = configuredRegistry();
- providers.registerProvider("example:cache", capabilities.generation, types.generated, () => ({
+ const { producers, endpoints } = configuredRegistry();
+ endpoints.registerImmediateEndpoint("example:cache", capabilities.generation, types.generated, () => ({
value: { kind: "inline", value: "Hello, Ada!" },
conformance: "exact",
delivery: "cache",
metadata: {},
}));
- const result = await new NodeDriver({ registry, providers }).run(createGreetingBuild());
+ const result = await new NodeDriver({ producers, endpoints }).run(createGreetingBuild());
assert.equal(result.status, "complete");
const tampered = structuredClone(result.state);
const document = tampered.records.find((record) => record.id === "document:root");
@@ -379,8 +379,8 @@ test("derived output content is bound to the Derivation even if its Record diges
});
test("resume discards serialized Commands and regenerates the exact request before any Handler runs", async () => {
- const { registry, providers } = configuredRegistry();
- const driver = new NodeDriver({ registry, providers });
+ const { producers, endpoints } = configuredRegistry();
+ const driver = new NodeDriver({ producers, endpoints });
const paused = await driver.run(createGreetingBuild());
assert.equal(paused.status, "paused");
const serialized = JSON.parse(serializeBuildState(paused.state)) as Record<string, unknown>;
@@ -393,7 +393,7 @@ test("resume discards serialized Commands and regenerates the exact request befo
const restored = parseBuildState(JSON.stringify(serialized));
assert.deepEqual(restored.outstanding, []);
- providers.registerProvider("example:generation", capabilities.generation, types.generated, ({ need }) => {
+ endpoints.registerImmediateEndpoint("example:generation", capabilities.generation, types.generated, ({ need }) => {
assert.deepEqual(need.constraints, { prompt: "Greet Ada" });
return {
value: { kind: "inline", value: "Hello, Ada!" },
@@ -407,9 +407,9 @@ test("resume discards serialized Commands and regenerates the exact request befo
});
test("a transient Handler failure pauses and can resume without replaying completed producers", async () => {
- const { registry, providers, calls } = configuredRegistry();
+ const { producers, endpoints, calls } = configuredRegistry();
let attempts = 0;
- providers.registerProvider("example:unstable", capabilities.generation, types.generated, () => {
+ endpoints.registerImmediateEndpoint("example:unstable", capabilities.generation, types.generated, () => {
calls.fulfill += 1;
attempts += 1;
if (attempts === 1) throw new Error("temporary outage");
@@ -421,7 +421,7 @@ test("a transient Handler failure pauses and can resume without replaying comple
};
});
- const driver = new NodeDriver({ registry, providers });
+ const driver = new NodeDriver({ producers, endpoints });
const paused = await driver.run(createGreetingBuild());
assert.equal(paused.status, "paused");
assert.match(paused.journal.at(-1)?.message ?? "", /temporary outage/u);
diff --git a/packages/driver-node/test/scheduler.test.ts b/packages/driver-node/test/scheduler.test.ts
index 0c5a9dd3..2e2c4761 100644
--- a/packages/driver-node/test/scheduler.test.ts
+++ b/packages/driver-node/test/scheduler.test.ts
@@ -2,16 +2,16 @@ import assert from "node:assert/strict";
import test from "node:test";
import {
- HostRegistry,
+ ProducerRegistry,
NodeDriver,
parseBuildState,
- ProviderRegistry,
+ EndpointRegistry,
serializeBuildState,
} from "@svml/driver-node";
import type {
- ProviderEndpoint,
- RuntimeProviderImplementation,
-} from "@svml/driver-node";
+ RecoverableEndpoint,
+ RuntimeEndpointImplementation,
+} from "@svml/endpoint-kit";
import {
LocalBuildScheduler,
MemoryBuildStore,
@@ -42,7 +42,7 @@ import {
createGreetingBuild,
implementationDigests,
manifest,
- producers,
+ producers as greetingProducers,
types,
} from "../../core/test/greeting-fixture.js";
@@ -112,13 +112,13 @@ function createParallelGreetingBuild() {
operations: [
{
id: "make-prompt",
- producer: producers.makePrompt,
+ producer: greetingProducers.makePrompt,
inputs: { intent: { kind: "record", id: "intent:root" } },
result: { kind: "output", name: "prompt", record: "prompt:root" },
},
{
id: "generate-a",
- producer: producers.requestText,
+ producer: greetingProducers.requestText,
inputs: { prompt: { kind: "logical-output", id: "prompt" } },
result: {
kind: "need",
@@ -130,7 +130,7 @@ function createParallelGreetingBuild() {
},
{
id: "generate-b",
- producer: producers.requestText,
+ producer: greetingProducers.requestText,
inputs: { prompt: { kind: "logical-output", id: "prompt" } },
result: {
kind: "need",
@@ -156,16 +156,16 @@ function configuredExecutor(options: {
readonly lane: string;
readonly defaultConcurrency: number;
readonly observe: (active: number) => void;
- readonly runtimeImplementation?: RuntimeProviderImplementation;
- readonly providerId?: string;
+ readonly runtimeImplementation?: RuntimeEndpointImplementation;
+ readonly endpointId?: string;
}) {
- const registry = new HostRegistry();
- const providers = new ProviderRegistry();
- registerGreetingProducers(registry);
+ const producers = new ProducerRegistry();
+ const endpoints = new EndpointRegistry();
+ registerGreetingProducers(producers);
let active = 0;
let calls = 0;
- providers.registerProvider(
- options.providerId ?? "fixture.seedance",
+ endpoints.registerImmediateEndpoint(
+ options.endpointId ?? "fixture.seedance",
capabilities.generation,
types.generated,
async () => {
@@ -191,22 +191,22 @@ function configuredExecutor(options: {
: { runtimeImplementation: options.runtimeImplementation }),
},
);
- return { executor: new NodeDriver({ registry, providers }), providers, getCalls: () => calls };
+ return { executor: new NodeDriver({ producers, endpoints }), endpoints, getCalls: () => calls };
}
-function registerGreetingProducers(registry: HostRegistry): void {
- registry.registerProducer(producers.makePrompt, implementationDigests.makePrompt, ({ inputs }) => {
+function registerGreetingProducers(producers: ProducerRegistry): void {
+ producers.registerProducer(greetingProducers.makePrompt, implementationDigests.makePrompt, ({ inputs }) => {
const intent = inputs.intent;
assert.equal(intent?.value.kind, "inline");
const name = (intent.value.value as { readonly name: string }).name;
return { outputs: { prompt: { kind: "inline", value: `Greet ${name}` } }, needs: {} };
});
- registry.registerProducer(producers.requestText, implementationDigests.requestText, ({ inputs }) => {
+ producers.registerProducer(greetingProducers.requestText, implementationDigests.requestText, ({ inputs }) => {
const prompt = inputs.prompt;
assert.equal(prompt?.value.kind, "inline");
return { outputs: {}, needs: { generation: { prompt: prompt.value.value } } };
});
- registry.registerProducer(producers.assemble, implementationDigests.assemble, ({ inputs }) => {
+ producers.registerProducer(greetingProducers.assemble, implementationDigests.assemble, ({ inputs }) => {
const generated = inputs.generated;
assert.equal(generated?.value.kind, "inline");
return {
@@ -222,7 +222,7 @@ const providerImplementationDigest = digestOf("example.scheduler-runtime/generat
function resolvedRuntime(laneLimit: number, lifecycle: "immediate" | "recoverable" = "immediate") {
const manifest: RuntimeModuleManifest = {
- format: "svml.runtime-module@1",
+ format: "svml.runtime-module@2",
name: runtimeModule.name,
version: runtimeModule.version,
facets: [
@@ -246,7 +246,7 @@ function resolvedRuntime(laneLimit: number, lifecycle: "immediate" | "recoverabl
},
{
name: providerFacet.name,
- role: "provider-endpoint",
+ role: "capability-endpoint",
implementation: {
locator: "example.scheduler-runtime/generation-endpoint",
digest: providerImplementationDigest,
@@ -265,33 +265,33 @@ function resolvedRuntime(laneLimit: number, lifecycle: "immediate" | "recoverabl
instances: [
{ id: "scheduler.local", facet: { module: runtimeModule, name: "scheduler" } },
{ id: "operations.memory", facet: { module: runtimeModule, name: "operations" } },
- { id: "generation.local", facet: providerFacet, lane: "provider:generation.local" },
+ { id: "generation.local", facet: providerFacet, lane: "endpoint:generation.local" },
],
scheduler: "scheduler.local",
stores: { operations: "operations.memory" },
- providers: [{
+ endpoints: [{
capability: capabilities.generation,
returns: types.generated,
endpoint: "generation.local",
}],
scheduling: {
maxConcurrency: 8,
- lanes: [{ name: "provider:generation.local", maxConcurrency: laneLimit }],
+ lanes: [{ name: "endpoint:generation.local", maxConcurrency: laneLimit }],
},
}));
return { closure, modules };
}
function recoverableExecutor(
- endpoint: ProviderEndpoint,
+ endpoint: RecoverableEndpoint,
operations: OperationStore,
runtime = resolvedRuntime(1, "recoverable"),
retry?: { readonly maxAttempts: number },
) {
- const registry = new HostRegistry();
- registerGreetingProducers(registry);
- const providers = new ProviderRegistry();
- providers.registerProviderEndpoint(
+ const producers = new ProducerRegistry();
+ registerGreetingProducers(producers);
+ const endpoints = new EndpointRegistry();
+ endpoints.registerRecoverableEndpoint(
"generation.local",
capabilities.generation,
types.generated,
@@ -305,14 +305,14 @@ function recoverableExecutor(
...(retry === undefined ? {} : { retry }),
},
);
- providers.applyRuntimeClosure(runtime.closure, runtime.modules);
+ endpoints.applyRuntimeClosure(runtime.closure, runtime.modules);
return {
- executor: new NodeDriver({ registry, providers, operations }),
+ executor: new NodeDriver({ producers, endpoints, operations }),
runtime,
};
}
-test("one local Scheduler shares a Provider lane across multiple Builds", async () => {
+test("one local Scheduler shares an Endpoint lane across multiple Builds", async () => {
let maximumActive = 0;
const { executor, getCalls } = configuredExecutor({
lane: "seedance:fixture.account",
@@ -376,14 +376,14 @@ test("independent paid commands inside one Build may fill the same lane without
assert.equal(result?.status, "complete");
assert.equal(getCalls(), 2);
assert.equal(maximumActive, 2);
- assert.equal(result?.state.derivations.filter((item) => item.producer.name === producers.makePrompt.name).length, 1);
+ assert.equal(result?.state.derivations.filter((item) => item.producer.name === greetingProducers.makePrompt.name).length, 1);
assert.equal(result?.state.receipts.length, 2);
});
-test("a locked Runtime Closure assembles exact Provider code and Scheduler policy without manual bind", async () => {
+test("a locked Runtime Closure assembles exact Endpoint code and Scheduler policy without manual bind", async () => {
let maximumActive = 0;
const { closure, modules } = resolvedRuntime(2);
- const { executor, providers } = configuredExecutor({
+ const { executor, endpoints } = configuredExecutor({
lane: "ignored-registration-lane",
defaultConcurrency: 1,
runtimeImplementation: {
@@ -391,12 +391,12 @@ test("a locked Runtime Closure assembles exact Provider code and Scheduler polic
digest: providerImplementationDigest,
configurationDigest: digestOf({}),
},
- providerId: "generation.local",
+ endpointId: "generation.local",
observe(active) {
maximumActive = Math.max(maximumActive, active);
},
});
- providers.applyRuntimeClosure(closure, modules);
+ endpoints.applyRuntimeClosure(closure, modules);
const results = await new LocalBuildScheduler(
executor,
localSchedulerOptionsFromClosure(closure),
@@ -410,54 +410,54 @@ test("a locked Runtime Closure assembles exact Provider code and Scheduler polic
assert.equal(results.every((result) => result.state.receipts[0]?.fulfiller === "generation.local"), true);
});
-test("a same-name Provider with different implementation bytes is rejected before execution", () => {
+test("a same-name Endpoint with different implementation bytes is rejected before execution", () => {
const { closure, modules } = resolvedRuntime(1);
- const { providers, getCalls } = configuredExecutor({
- lane: "provider:generation.local",
+ const { endpoints, getCalls } = configuredExecutor({
+ lane: "endpoint:generation.local",
defaultConcurrency: 1,
runtimeImplementation: {
facet: providerFacet,
- digest: digestOf("tampered-provider-implementation"),
+ digest: digestOf("tampered-endpoint-implementation"),
configurationDigest: digestOf({}),
},
- providerId: "generation.local",
+ endpointId: "generation.local",
observe() {},
});
- assert.throws(() => providers.applyRuntimeClosure(closure, modules), /implementation does not match/u);
+ assert.throws(() => endpoints.applyRuntimeClosure(closure, modules), /implementation does not match/u);
assert.equal(getCalls(), 0);
});
-test("a same-name Provider with different configured-instance identity is rejected", () => {
+test("a same-name Endpoint with different configured-instance identity is rejected", () => {
const { closure, modules } = resolvedRuntime(1);
- const { providers, getCalls } = configuredExecutor({
- lane: "provider:generation.local",
+ const { endpoints, getCalls } = configuredExecutor({
+ lane: "endpoint:generation.local",
defaultConcurrency: 1,
runtimeImplementation: {
facet: providerFacet,
digest: providerImplementationDigest,
configurationDigest: digestOf({ baseUrl: "https://another-endpoint.test" }),
},
- providerId: "generation.local",
+ endpointId: "generation.local",
observe() {},
});
- assert.throws(() => providers.applyRuntimeClosure(closure, modules), /implementation does not match/u);
+ assert.throws(() => endpoints.applyRuntimeClosure(closure, modules), /implementation does not match/u);
assert.equal(getCalls(), 0);
});
test("a recoverable Runtime facet cannot be activated by a one-shot Handler", () => {
const { closure, modules } = resolvedRuntime(1, "recoverable");
- const { providers, getCalls } = configuredExecutor({
- lane: "provider:generation.local",
+ const { endpoints, getCalls } = configuredExecutor({
+ lane: "endpoint:generation.local",
defaultConcurrency: 1,
runtimeImplementation: {
facet: providerFacet,
digest: providerImplementationDigest,
configurationDigest: digestOf({}),
},
- providerId: "generation.local",
+ endpointId: "generation.local",
observe() {},
});
- assert.throws(() => providers.applyRuntimeClosure(closure, modules), /lifecycle does not match/u);
+ assert.throws(() => endpoints.applyRuntimeClosure(closure, modules), /lifecycle does not match/u);
assert.equal(getCalls(), 0);
});
@@ -481,7 +481,7 @@ test("a recoverable Endpoint resumes its journaled Operation after restart witho
let starts = 0;
let resumes = 0;
let submissionKey: string | undefined;
- const endpoint: ProviderEndpoint = {
+ const endpoint: RecoverableEndpoint = {
start({ operation }) {
starts += 1;
submissionKey = operation.submissionKey;
@@ -550,7 +550,7 @@ test("a crash after Operation intent but before checkpoint resumes with the same
let resumes = 0;
let submissionKey: string | undefined;
let operationId: Digest | undefined;
- const endpoint: ProviderEndpoint = {
+ const endpoint: RecoverableEndpoint = {
start({ operation }) {
starts += 1;
submissionKey = operation.submissionKey;
@@ -617,7 +617,7 @@ test("a completion journaled before a crash is replayed into Core without callin
return result;
},
};
- const endpoint: ProviderEndpoint = {
+ const endpoint: RecoverableEndpoint = {
start() {
starts += 1;
return {
@@ -663,7 +663,7 @@ test("a retryable terminal failure creates a new attempt and submission key", as
const runtime = resolvedRuntime(1, "recoverable");
const attempts: number[] = [];
const keys: string[] = [];
- const endpoint: ProviderEndpoint = {
+ const endpoint: RecoverableEndpoint = {
start({ operation }) {
attempts.push(operation.attempt);
keys.push(operation.submissionKey);
@@ -712,7 +712,7 @@ test("wakeAt prevents early polling and Runtime cancellation becomes a terminal
let resumes = 0;
let cancels = 0;
const wakeAt = Date.now() + 60_000;
- const endpoint: ProviderEndpoint = {
+ const endpoint: RecoverableEndpoint = {
start() {
return { status: "pending", checkpoint: { remoteJob: "job-wait" }, wakeAt };
},
diff --git a/packages/driver-node/test/validation.test.ts b/packages/driver-node/test/validation.test.ts
index db8b675e..656e8fbe 100644
--- a/packages/driver-node/test/validation.test.ts
+++ b/packages/driver-node/test/validation.test.ts
@@ -14,9 +14,9 @@ import {
verifyRecord,
} from "@svml/core";
import {
- HostRegistry,
+ ProducerRegistry,
NodeDriver,
- ProviderRegistry,
+ EndpointRegistry,
parseBuildState,
parseModuleManifestText,
serializeBuildState,
@@ -231,8 +231,8 @@ function outputBuild(linked: LinkedProgram, graph = outputGraph(linked)) {
}));
}
-function hosts(measured: number): HostRegistry {
- const hosts = new HostRegistry();
+function hosts(measured: number): ProducerRegistry {
+ const hosts = new ProducerRegistry();
hosts.registerProducer(measureProducer, producerDigests.measure, () => ({
outputs: { measurement: { kind: "inline", value: { value: measured, unit: "ticks" } } },
needs: {},
@@ -252,7 +252,7 @@ function hosts(measured: number): HostRegistry {
test("three independent packages communicate through an owner-validated nominal Type", async () => {
const linked = program();
const result = await new NodeDriver({
- registry: hosts(4),
+ producers: hosts(4),
validators: registry(),
}).run(outputBuild(linked));
@@ -272,7 +272,7 @@ test("three independent packages communicate through an owner-validated nominal
test("a structurally valid but semantically invalid Producer value never enters BuildState", async () => {
const linked = program();
const result = await new NodeDriver({
- registry: hosts(3),
+ producers: hosts(3),
validators: registry(),
}).run(outputBuild(linked));
@@ -285,14 +285,14 @@ test("a structurally valid but semantically invalid Producer value never enters
test("missing or digest-mismatched validator implementations fail before record admission", async () => {
const linked = program();
const missing = await new NodeDriver({
- registry: hosts(4),
+ producers: hosts(4),
validators: new TypeValidatorRegistry(),
}).run(outputBuild(linked));
assert.equal(missing.status, "paused");
assert.match(missing.journal[0]?.message ?? "", /validator is not registered/u);
const mismatched = await new NodeDriver({
- registry: hosts(4),
+ producers: hosts(4),
validators: registry(digestOf("wrong-validator")),
}).run(outputBuild(linked));
assert.equal(mismatched.status, "paused");
@@ -323,7 +323,7 @@ function providerGraph(linked: LinkedProgram): CompiledGraph {
kind: "need",
name: "measurement",
id: "need:measurement",
- record: "measurement:provider",
+ record: "measurement:endpoint",
accepts: "exact",
},
}],
@@ -333,14 +333,14 @@ function providerGraph(linked: LinkedProgram): CompiledGraph {
async function providerBuild(measured: number) {
const linked = program();
const graph = providerGraph(linked);
- const hosts = new HostRegistry();
+ const hosts = new ProducerRegistry();
hosts.registerProducer(requestProducer, producerDigests.request, () => ({
outputs: {},
needs: { measurement: { sample: "latest" } },
}));
- const providers = new ProviderRegistry();
- providers.registerProvider(
- "example:measurement-provider",
+ const endpoints = new EndpointRegistry();
+ endpoints.registerImmediateEndpoint(
+ "example:measurement-endpoint",
measurementCapability,
measurementType,
() => ({
@@ -350,7 +350,7 @@ async function providerBuild(measured: number) {
metadata: {},
}),
);
- return await new NodeDriver({ registry: hosts, providers, validators: registry() }).run(start(
+ return await new NodeDriver({ producers: hosts, endpoints, validators: registry() }).run(start(
linked,
graph,
sealBuildRequest({
@@ -361,7 +361,7 @@ async function providerBuild(measured: number) {
));
}
-test("Provider results pass the same Type-owner validation gate as Producer results", async () => {
+test("Endpoint results pass the same Type-owner validation gate as Producer results", async () => {
const valid = await providerBuild(8);
assert.equal(valid.status, "complete");
assert.equal(valid.state.records[0]?.validation?.validatorDigest, validatorDigest);
@@ -369,7 +369,7 @@ test("Provider results pass the same Type-owner validation gate as Producer resu
const invalid = await providerBuild(7);
assert.equal(invalid.status, "paused");
assert.match(invalid.journal.at(-1)?.message ?? "", /measurement must be even/u);
- assert.equal(invalid.state.records.some((record) => record.id === "measurement:provider"), false);
+ assert.equal(invalid.state.records.some((record) => record.id === "measurement:endpoint"), false);
});
test("authored values require a receipt bound to their exact Type and content", async () => {
diff --git a/packages/endpoint-kit/README.md b/packages/endpoint-kit/README.md
new file mode 100644
index 00000000..7694bb21
--- /dev/null
+++ b/packages/endpoint-kit/README.md
@@ -0,0 +1,16 @@
+# `@svml/endpoint-kit`
+
+Host-neutral SDK for exact external capability endpoints.
+
+An Endpoint is any installed implementation that fulfills one declared `Need`: a vendor API, local
+process, Lambda function, human service or device. `defineEndpointPackage()` produces its static
+Runtime Manifest, configured instance, exact bindings and installation facet from one source of
+truth. It depends on no Driver, Node filesystem, queue or domain package.
+
+Concrete distributions may still be named after a real provider, such as `@svml/provider-kie`.
+Local WhisperX and HyperFrames use the same Endpoint contract without pretending to be vendors.
+Endpoint packages are trusted Host configuration and are never activated by author imports.
+
+The Runtime Scheduler owns readiness and concurrency. A recoverable Endpoint owns only one external
+operation's `start/resume/cancel` law. Process, Lambda and HTTP are lower-level Transports and do not
+register capabilities by themselves.
diff --git a/packages/provider-kit/package.json b/packages/endpoint-kit/package.json
similarity index 61%
rename from packages/provider-kit/package.json
rename to packages/endpoint-kit/package.json
index 4e77bef8..22001517 100644
--- a/packages/provider-kit/package.json
+++ b/packages/endpoint-kit/package.json
@@ -1,5 +1,5 @@
{
- "name": "@svml/provider-kit",
+ "name": "@svml/endpoint-kit",
"version": "0.0.0-dev",
"private": true,
"type": "module",
@@ -7,11 +7,7 @@
".": "./src/index.ts"
},
"dependencies": {
- "@svml/driver-node": "workspace:*",
"@svml/protocol": "workspace:*",
"@svml/runtime": "workspace:*"
- },
- "devDependencies": {
- "@svml/core": "workspace:*"
}
}
diff --git a/packages/provider-kit/src/index.ts b/packages/endpoint-kit/src/index.ts
similarity index 51%
rename from packages/provider-kit/src/index.ts
rename to packages/endpoint-kit/src/index.ts
index 8c264b1d..b095dfb8 100644
--- a/packages/provider-kit/src/index.ts
+++ b/packages/endpoint-kit/src/index.ts
@@ -1,9 +1,3 @@
-import type {
- ProviderEndpoint,
- ProviderHandler,
- ProviderRegistry,
- ProviderRetryPolicy,
-} from "@svml/driver-node";
import {
canonicalize,
digestOf,
@@ -12,54 +6,141 @@ import {
import type {
CanonicalValue,
CapabilityRef,
+ Conformance,
+ Delivery,
Digest,
+ FulfillNeedCommand,
ModuleRef,
Need,
+ StoredValue,
TypeRef,
} from "@svml/protocol";
import type {
+ ArtifactStore,
CredentialRef,
+ CredentialValue,
+ OperationFailure,
+ OperationIdentity,
+ RuntimeEndpointBinding,
+ RuntimeFacetRef,
RuntimeModuleManifest,
RuntimeProfileInstance,
- RuntimeProviderBinding,
} from "@svml/runtime";
import { verifyCredentialRef } from "@svml/runtime";
export type Awaitable<T> = T | Promise<T>;
-/** Small transport seam used by Provider packages; it has no capability-routing authority. */
-export type JsonInvoker = {
- invoke(request: CanonicalValue, options?: { readonly signal?: AbortSignal }): Promise<CanonicalValue>;
+export type EndpointFulfillment = {
+ readonly value: StoredValue;
+ readonly conformance: Conformance;
+ readonly delivery: Delivery;
+ readonly metadata: CanonicalValue;
+};
+
+export type EndpointInvocationContext = {
+ readonly command: FulfillNeedCommand;
+ readonly need: Need;
+ readonly artifacts: ArtifactStore;
+ /** Only slots explicitly declared by this configured Endpoint instance are present. */
+ readonly credentials: Readonly<Record<string, CredentialValue>>;
+};
+
+export type ImmediateEndpointHandler = (
+ context: EndpointInvocationContext,
+) => Awaitable<EndpointFulfillment>;
+
+export type EndpointOutcome =
+ | { readonly status: "pending"; readonly checkpoint: CanonicalValue; readonly wakeAt?: number }
+ | { readonly status: "completed"; readonly result: EndpointFulfillment }
+ | { readonly status: "failed"; readonly failure: OperationFailure };
+
+export type EndpointStartContext = EndpointInvocationContext & {
+ readonly operation: OperationIdentity;
};
-export type NodeProviderPackage = {
+export type EndpointResumeContext = EndpointStartContext & {
+ /** Undefined means the process stopped after intent was journaled but before a checkpoint existed. */
+ readonly checkpoint: CanonicalValue | undefined;
+};
+
+export type RecoverableEndpoint = {
+ start(context: EndpointStartContext): Awaitable<EndpointOutcome>;
+ resume(context: EndpointResumeContext): Awaitable<EndpointOutcome>;
+ cancel?(context: EndpointResumeContext): Awaitable<void>;
+};
+
+/** Endpoint/implementation scheduling metadata; it never changes Core demand or command identity. */
+export type EndpointScheduling = {
+ readonly lane?: string;
+ readonly maxConcurrency?: number;
+};
+
+export type EndpointRetryPolicy = {
+ /** Includes the first submission. A new attempt receives a new submission key. */
+ readonly maxAttempts: number;
+};
+
+export type RuntimeEndpointImplementation = {
+ readonly facet: RuntimeFacetRef;
+ readonly digest: Digest;
+ /** Identity of the configured endpoint instance; secret values are never part of it. */
+ readonly configurationDigest: Digest;
+};
+
+export type EndpointRegistrationOptions = {
+ readonly supports?: (need: Need) => boolean;
+ readonly scheduling?: EndpointScheduling;
+ readonly runtimeImplementation?: RuntimeEndpointImplementation;
+ readonly credentials?: Readonly<Record<string, CredentialRef>>;
+ readonly retry?: EndpointRetryPolicy;
+};
+
+/** Minimal structural port implemented by a trusted execution Host. */
+export interface EndpointRegistrar {
+ registerImmediateEndpoint(
+ id: string,
+ capability: CapabilityRef,
+ returns: TypeRef,
+ handler: ImmediateEndpointHandler,
+ options?: EndpointRegistrationOptions,
+ ): void;
+ registerRecoverableEndpoint(
+ id: string,
+ capability: CapabilityRef,
+ returns: TypeRef,
+ endpoint: RecoverableEndpoint,
+ options?: EndpointRegistrationOptions,
+ ): void;
+}
+
+export type EndpointPackage = {
readonly name: string;
readonly manifest: RuntimeModuleManifest;
readonly instance: RuntimeProfileInstance;
- readonly bindings: readonly RuntimeProviderBinding[];
- install(registry: ProviderRegistry): Awaitable<void>;
+ readonly bindings: readonly RuntimeEndpointBinding[];
+ install(registry: EndpointRegistrar): Awaitable<void>;
};
-type ProviderCapabilityBase = {
+type EndpointCapabilityBase = {
readonly capability: CapabilityRef;
readonly returns: TypeRef;
readonly supports?: (need: Need) => boolean;
};
-export type ImmediateProviderCapability = ProviderCapabilityBase & {
+export type ImmediateEndpointCapability = EndpointCapabilityBase & {
readonly lifecycle: "immediate";
- readonly handler: ProviderHandler;
+ readonly handler: ImmediateEndpointHandler;
};
-export type RecoverableProviderCapability = ProviderCapabilityBase & {
+export type RecoverableEndpointCapability = EndpointCapabilityBase & {
readonly lifecycle: "recoverable";
- readonly endpoint: ProviderEndpoint;
- readonly retry?: ProviderRetryPolicy;
+ readonly endpoint: RecoverableEndpoint;
+ readonly retry?: EndpointRetryPolicy;
};
-export type ProviderCapability = ImmediateProviderCapability | RecoverableProviderCapability;
+export type EndpointCapability = ImmediateEndpointCapability | RecoverableEndpointCapability;
-export type DefineProviderPackageOptions = {
+export type DefineEndpointPackageOptions = {
readonly module: ModuleRef;
readonly facet: string;
readonly instance: string;
@@ -73,7 +154,7 @@ export type DefineProviderPackageOptions = {
readonly configuration?: CanonicalValue;
readonly credentials?: Readonly<Record<string, CredentialRef>>;
readonly defaultConcurrency?: number;
- readonly capabilities: readonly ProviderCapability[];
+ readonly capabilities: readonly EndpointCapability[];
};
function assert(condition: unknown, message: string): asserts condition {
@@ -89,30 +170,27 @@ function positiveInteger(value: number, subject: string): number {
return value;
}
-/**
- * One fact source for static Manifest, configured instance, exact bindings and Node registration.
- * Provider packages call this once; application developers only select the returned package.
- */
-export function defineProviderPackage(options: DefineProviderPackageOptions): NodeProviderPackage {
+/** Build every static and executable fact for one configured Endpoint from one definition. */
+export function defineEndpointPackage(options: DefineEndpointPackageOptions): EndpointPackage {
assert(options.module.name.trim().length > 0 && options.module.version.trim().length > 0,
- "Provider module identity is invalid");
- assert(options.facet.trim().length > 0, "Provider facet is empty");
- assert(options.instance.trim().length > 0, "Provider instance is empty");
- if (options.lane !== undefined) assert(options.lane.trim().length > 0, "Provider lane is empty");
- assert(options.implementation.locator.trim().length > 0, "Provider implementation locator is empty");
- assert(isDigest(options.implementation.digest), "Provider implementation digest is invalid");
- assert(options.capabilities.length > 0, "Provider package declares no capability");
+ "Endpoint module identity is invalid");
+ assert(options.facet.trim().length > 0, "Endpoint facet is empty");
+ assert(options.instance.trim().length > 0, "Endpoint instance is empty");
+ if (options.lane !== undefined) assert(options.lane.trim().length > 0, "Endpoint lane is empty");
+ assert(options.implementation.locator.trim().length > 0, "Endpoint implementation locator is empty");
+ assert(isDigest(options.implementation.digest), "Endpoint implementation digest is invalid");
+ assert(options.capabilities.length > 0, "Endpoint package declares no capability");
const lifecycle = options.capabilities[0]!.lifecycle;
assert(options.capabilities.every((item) => item.lifecycle === lifecycle),
- "one Provider facet cannot mix immediate and recoverable lifecycles");
+ "one Endpoint facet cannot mix immediate and recoverable lifecycles");
const keys = options.capabilities.map((item) => refKey(item.capability));
- assert(new Set(keys).size === keys.length, "Provider package repeats a capability");
+ assert(new Set(keys).size === keys.length, "Endpoint package repeats a capability");
const permissions = [...(options.permissions ?? [])].sort();
- assert(new Set(permissions).size === permissions.length, "Provider package repeats a permission");
+ assert(new Set(permissions).size === permissions.length, "Endpoint package repeats a permission");
const credentials = Object.fromEntries(Object.entries(options.credentials ?? {})
.sort(([left], [right]) => left.localeCompare(right))
.map(([slot, ref]) => {
- assert(slot.trim().length > 0, "Provider credential slot is empty");
+ assert(slot.trim().length > 0, "Endpoint credential slot is empty");
verifyCredentialRef(ref);
return [slot, structuredClone(ref)];
}));
@@ -132,12 +210,12 @@ export function defineProviderPackage(options: DefineProviderPackageOptions): No
returns: structuredClone(item.returns),
}));
const manifest: RuntimeModuleManifest = {
- format: "svml.runtime-module@1",
+ format: "svml.runtime-module@2",
name: module.name,
version: module.version,
facets: [{
name: options.facet,
- role: "provider-endpoint",
+ role: "capability-endpoint",
implementation: { ...options.implementation },
permissions,
fulfills,
@@ -152,7 +230,7 @@ export function defineProviderPackage(options: DefineProviderPackageOptions): No
configurationDigest,
...(options.lane === undefined ? {} : { lane: options.lane }),
};
- const bindings: readonly RuntimeProviderBinding[] = fulfills.map((item) => ({
+ const bindings: readonly RuntimeEndpointBinding[] = fulfills.map((item) => ({
...item,
endpoint: options.instance,
}));
@@ -163,7 +241,7 @@ export function defineProviderPackage(options: DefineProviderPackageOptions): No
bindings,
install(registry) {
for (const capability of options.capabilities) {
- const common = {
+ const common: EndpointRegistrationOptions = {
...(capability.supports === undefined ? {} : { supports: capability.supports }),
runtimeImplementation: {
facet,
@@ -172,12 +250,15 @@ export function defineProviderPackage(options: DefineProviderPackageOptions): No
},
credentials,
scheduling: {
- lane: options.lane ?? `provider:${options.instance}`,
+ lane: options.lane ?? `endpoint:${options.instance}`,
maxConcurrency: options.defaultConcurrency ?? 1,
},
+ ...(capability.lifecycle === "recoverable" && capability.retry !== undefined
+ ? { retry: capability.retry }
+ : {}),
};
if (capability.lifecycle === "immediate") {
- registry.registerProvider(
+ registry.registerImmediateEndpoint(
options.instance,
capability.capability,
capability.returns,
@@ -185,12 +266,12 @@ export function defineProviderPackage(options: DefineProviderPackageOptions): No
common,
);
} else {
- registry.registerProviderEndpoint(
+ registry.registerRecoverableEndpoint(
options.instance,
capability.capability,
capability.returns,
capability.endpoint,
- { ...common, ...(capability.retry === undefined ? {} : { retry: capability.retry }) },
+ common,
);
}
}
diff --git a/packages/provider-kit/test/provider.test.ts b/packages/endpoint-kit/test/endpoint.test.ts
similarity index 52%
rename from packages/provider-kit/test/provider.test.ts
rename to packages/endpoint-kit/test/endpoint.test.ts
index dee98c24..cb7d4620 100644
--- a/packages/provider-kit/test/provider.test.ts
+++ b/packages/endpoint-kit/test/endpoint.test.ts
@@ -1,10 +1,19 @@
import assert from "node:assert/strict";
import test from "node:test";
-import { ProviderRegistry } from "@svml/driver-node";
-import { defineProviderPackage, wakeAfter } from "@svml/provider-kit";
-import { credentialRef } from "@svml/runtime";
+import {
+ defineEndpointPackage,
+ wakeAfter,
+} from "@svml/endpoint-kit";
+import type {
+ EndpointRegistrar,
+ EndpointRegistrationOptions,
+ ImmediateEndpointHandler,
+ RecoverableEndpoint,
+} from "@svml/endpoint-kit";
+import type { CapabilityRef, TypeRef } from "@svml/protocol";
import { digestOf } from "@svml/protocol";
+import { credentialRef } from "@svml/runtime";
import { capabilities, types } from "../../core/test/greeting-fixture.js";
@@ -13,8 +22,27 @@ const implementation = {
digest: digestOf("example.provider/http-json@1"),
} as const;
-test("one Provider definition generates Manifest, instance, bindings and registration", async () => {
- const provider = defineProviderPackage({
+type CapturedRegistration = {
+ readonly id: string;
+ readonly capability: CapabilityRef;
+ readonly returns: TypeRef;
+ readonly kind: "immediate" | "recoverable";
+ readonly options: EndpointRegistrationOptions;
+};
+
+function capturingRegistrar(registrations: CapturedRegistration[]): EndpointRegistrar {
+ return {
+ registerImmediateEndpoint(id, capability, returns, _handler: ImmediateEndpointHandler, options = {}) {
+ registrations.push({ id, capability, returns, kind: "immediate", options });
+ },
+ registerRecoverableEndpoint(id, capability, returns, _endpoint: RecoverableEndpoint, options = {}) {
+ registrations.push({ id, capability, returns, kind: "recoverable", options });
+ },
+ };
+}
+
+test("one Endpoint definition generates Manifest, instance, bindings and host-neutral registration", async () => {
+ const endpoint = defineEndpointPackage({
module: { name: "example.provider", version: "1" },
facet: "http-json",
instance: "example.personal",
@@ -35,32 +63,31 @@ test("one Provider definition generates Manifest, instance, bindings and registr
}),
}],
});
- assert.equal(provider.manifest.facets[0]?.role, "provider-endpoint");
- assert.equal(provider.manifest.facets[0]?.defaultConcurrency, 3);
- assert.deepEqual(provider.manifest.facets[0]?.credentialSlots, ["apiKey"]);
- assert.equal(provider.instance.id, "example.personal");
- assert.ok(provider.instance.configurationDigest);
- assert.deepEqual(provider.bindings, [{
+ assert.equal(endpoint.manifest.facets[0]?.role, "capability-endpoint");
+ assert.equal(endpoint.manifest.facets[0]?.defaultConcurrency, 3);
+ assert.deepEqual(endpoint.manifest.facets[0]?.credentialSlots, ["apiKey"]);
+ assert.equal(endpoint.instance.id, "example.personal");
+ assert.deepEqual(endpoint.bindings, [{
capability: capabilities.generation,
returns: types.generated,
endpoint: "example.personal",
}]);
- const registry = new ProviderRegistry();
- await provider.install(registry);
- const [registration] = registry.providers(capabilities.generation);
- assert.equal(registration?.id, "example.personal");
- assert.deepEqual(registration?.credentials, {
+ const registrations: CapturedRegistration[] = [];
+ await endpoint.install(capturingRegistrar(registrations));
+ assert.equal(registrations[0]?.id, "example.personal");
+ assert.equal(registrations[0]?.kind, "immediate");
+ assert.deepEqual(registrations[0]?.options.credentials, {
apiKey: credentialRef("env", "EXAMPLE_API_KEY"),
});
assert.equal(
- registration?.runtimeImplementation?.configurationDigest,
- provider.instance.configurationDigest,
+ registrations[0]?.options.runtimeImplementation?.configurationDigest,
+ endpoint.instance.configurationDigest,
);
});
-test("non-secret Provider configuration and credential references change instance identity", () => {
- const configured = (baseUrl: string, variable: string) => defineProviderPackage({
+test("non-secret Endpoint configuration and credential references change instance identity", () => {
+ const configured = (baseUrl: string, variable: string) => defineEndpointPackage({
module: { name: "example.provider", version: "1" },
facet: "http-json",
instance: "example.personal",
@@ -83,7 +110,7 @@ test("non-secret Provider configuration and credential references change instanc
assert.notEqual(configured("https://one.test", "KEY"), configured("https://one.test", "OTHER_KEY"));
});
-test("wakeAfter turns Provider polling policy into an explicit Runtime wake hint", () => {
+test("wakeAfter turns polling policy into an explicit Runtime wake hint", () => {
assert.deepEqual(wakeAfter({ job: "123" }, 5_000, 10_000), {
status: "pending",
checkpoint: { job: "123" },
diff --git a/packages/film/test/film.test.ts b/packages/film/test/film.test.ts
index 7539252c..8bcf20f6 100644
--- a/packages/film/test/film.test.ts
+++ b/packages/film/test/film.test.ts
@@ -20,7 +20,7 @@ import {
sealTypedModule,
start,
} from "@svml/core";
-import { HostRegistry, NodeDriver } from "@svml/driver-node";
+import { ProducerRegistry, NodeDriver } from "@svml/driver-node";
import {
bindAuthorFragment,
elaborateGraphFragment,
@@ -226,7 +226,7 @@ test("Film stops at Composition and Hyperframes remains an ordinary downstream F
});
test("the Driver folds peer Tracks, then independently compiles the Composition", async () => {
- const registry = new HostRegistry();
+ const registry = new ProducerRegistry();
registry.registerProducer(textTrackProducers.render, renderTextTrackImplementationDigest, ({ inputs }) => ({
outputs: { track: stored(renderTextTrack(inline(inputs.space) as typeof space, inline(inputs.program) as typeof textProgram)) },
needs: {},
@@ -252,7 +252,7 @@ test("the Driver folds peer Tracks, then independently compiles the Composition"
needs: {},
}));
- const result = await new NodeDriver({ registry, validators: validatorRegistry() }).run(build("main.document"));
+ const result = await new NodeDriver({ producers: registry, validators: validatorRegistry() }).run(build("main.document"));
assert.equal(result.status, "complete");
const documentRecord = result.state.records.find((record) => record.type.module.name === hyperframesTypes.document.module.name);
assert(documentRecord);
diff --git a/packages/hyperframes-render/test/render.test.ts b/packages/hyperframes-render/test/render.test.ts
index 18f3ef59..e6229861 100644
--- a/packages/hyperframes-render/test/render.test.ts
+++ b/packages/hyperframes-render/test/render.test.ts
@@ -27,9 +27,9 @@ import {
start,
} from "@svml/core";
import {
- HostRegistry,
+ ProducerRegistry,
NodeDriver,
- ProviderRegistry,
+ EndpointRegistry,
} from "@svml/driver-node";
import {
AuthorFrontendRegistry,
@@ -140,8 +140,8 @@ function build() {
}));
}
-function producerRegistry(): HostRegistry {
- const registry = new HostRegistry();
+function producerRegistry(): ProducerRegistry {
+ const registry = new ProducerRegistry();
registerProducerFacets(registry, mediaPipelineComponent.producers);
registerProducerFacets(registry, hyperframesComponent.producers);
registerProducerFacets(registry, hyperframesRenderComponent.producers);
@@ -167,7 +167,7 @@ test("HyperFrames rendering is an explicit exact Need after ordinary document co
mediaPipelineProducers.projectMuxed.name,
].sort());
- const result = await new NodeDriver({ registry: producerRegistry(), validators: validatorRegistry() }).run(build());
+ const result = await new NodeDriver({ producers: producerRegistry(), validators: validatorRegistry() }).run(build());
assert.equal(result.status, "paused");
assert.equal(result.state.needs.length, 2);
const visual = result.state.needs.find((need) => need.capability.name === hyperframesRenderCapabilities.renderVisual.name)!;
@@ -176,10 +176,10 @@ test("HyperFrames rendering is an explicit exact Need after ordinary document co
assert.deepEqual(visual.constraints, hyperframesVisualRequest(compileHyperframesDocument(composition)));
const audio = result.state.needs.find((need) => need.capability.name === "render-timeline-audio")!;
assert.equal(audio.returns.name, contractTypes.timelineAudio.name);
- assert.equal(result.blocked.every((item) => item.reason === "missing-provider"), true);
+ assert.equal(result.blocked.every((item) => item.reason === "missing-endpoint"), true);
});
-test("separate visual, audio and mux Providers complete one author-visible render", async () => {
+test("separate visual, audio and mux Endpoints complete one author-visible render", async () => {
const visualArtifact = {
kind: "blob" as const,
digest: digestOf("hyperframes-render:visual"),
@@ -198,8 +198,8 @@ test("separate visual, audio and mux Providers complete one author-visible rende
size: 16_441,
mediaType: "video/mp4",
};
- const providers = new ProviderRegistry();
- providers.registerProvider(
+ const endpoints = new EndpointRegistry();
+ endpoints.registerImmediateEndpoint(
"example.hyperframes.local",
hyperframesRenderCapabilities.renderVisual,
contractTypes.renderedVisual,
@@ -226,7 +226,7 @@ test("separate visual, audio and mux Providers complete one author-visible rende
};
},
);
- providers.registerProvider(
+ endpoints.registerImmediateEndpoint(
"example.media.audio-real",
mediaPipelineCapabilities.renderAudio,
contractTypes.timelineAudio,
@@ -250,7 +250,7 @@ test("separate visual, audio and mux Providers complete one author-visible rende
};
},
);
- providers.registerProvider(
+ endpoints.registerImmediateEndpoint(
"example.media.mux",
mediaPipelineCapabilities.mux,
contractTypes.muxedMedia,
@@ -274,13 +274,13 @@ test("separate visual, audio and mux Providers complete one author-visible rende
};
},
);
- providers.bind(hyperframesRenderCapabilities.renderVisual, "example.hyperframes.local");
- providers.bind(mediaPipelineCapabilities.renderAudio, "example.media.audio-real");
- providers.bind(mediaPipelineCapabilities.mux, "example.media.mux");
+ endpoints.bind(hyperframesRenderCapabilities.renderVisual, "example.hyperframes.local");
+ endpoints.bind(mediaPipelineCapabilities.renderAudio, "example.media.audio-real");
+ endpoints.bind(mediaPipelineCapabilities.mux, "example.media.mux");
const result = await new NodeDriver({
- registry: producerRegistry(),
- providers,
+ producers: producerRegistry(),
+ endpoints,
validators: validatorRegistry(),
}).run(build());
assert.equal(result.status, "complete");
@@ -297,8 +297,8 @@ test("separate visual, audio and mux Providers complete one author-visible rende
test("a render Product cannot claim another frame domain while keeping the requested document", async () => {
const document = compileHyperframesDocument(composition);
- const providers = new ProviderRegistry();
- providers.registerProvider(
+ const endpoints = new EndpointRegistry();
+ endpoints.registerImmediateEndpoint(
"example.hyperframes.wrong-domain",
hyperframesRenderCapabilities.renderVisual,
contractTypes.renderedVisual,
@@ -323,11 +323,11 @@ test("a render Product cannot claim another frame domain while keeping the reque
metadata: {},
}),
);
- providers.bind(hyperframesRenderCapabilities.renderVisual, "example.hyperframes.wrong-domain");
+ endpoints.bind(hyperframesRenderCapabilities.renderVisual, "example.hyperframes.wrong-domain");
const result = await new NodeDriver({
- registry: producerRegistry(),
- providers,
+ producers: producerRegistry(),
+ endpoints,
validators: validatorRegistry(),
}).run(build());
assert.equal(result.status, "paused");
diff --git a/packages/local/README.md b/packages/local/README.md
index 76f663fc..d52ebaf8 100644
--- a/packages/local/README.md
+++ b/packages/local/README.md
@@ -1,7 +1,7 @@
# `@svml/local`
The trusted, zero-service developer distribution. It keeps Core and the authoritative Build
-Scheduler in the current Node process while allowing every Provider Endpoint to run in a different
+Scheduler in the current Node process while allowing every capability Endpoint to run in a different
place.
The convenience assembly uses:
@@ -12,10 +12,10 @@ The convenience assembly uses:
`@svml/artifact-store-s3`;
- an in-process, queue-free Scheduler whose ready work always comes from Core;
- an exact implementation package lock for deterministic component packages;
-- separately selected external Provider packages.
+- separately selected external Endpoint packages.
Deterministic packages implement the host-neutral `@svml/component-kit` contract. `@svml/local`
-adapts them to `HostRegistry`; the component never imports the Node Driver or receives Runtime
+adapts them to `ProducerRegistry`; the component never imports the Node Driver or receives Runtime
services.
```ts
@@ -27,11 +27,11 @@ export default await createProjectLocalRuntime({
prefix: "development",
region: "us-east-1",
}),
- providers: [createKieProvider({ apiKey: credentialRef("env", "KIE_API_KEY") })],
+ endpoints: [createKieProvider({ apiKey: credentialRef("env", "KIE_API_KEY") })],
allowedPermissions: ["network:aws:s3", "network:api.kie.ai", "network:kieai.redpandaai.co"],
scheduling: {
maxConcurrency: 8,
- lanes: { "provider:kie.personal": 2 },
+ lanes: { "endpoint:kie.personal": 2 },
},
});
```
@@ -39,7 +39,7 @@ export default await createProjectLocalRuntime({
The implementation lock may contain `generationComponent`, exact-model components and media
pipeline Producers without adding imports to this deployment source. Its digest is bound into the
BuildRequest, so a persisted Build cannot resume under another deterministic component closure.
-The KIE Provider remains an independently selected privileged endpoint; swapping it changes an
+The KIE Endpoint remains an independently selected privileged endpoint; swapping it changes an
Endpoint implementation and lane, not the `.svml` author document.
`createProjectLocalRuntime` accepts a configured ArtifactStore package directly;
advanced hosts may call `createLocalRuntime` with Postgres or other implementations of the same
diff --git a/packages/local/package.json b/packages/local/package.json
index 6745554c..383a3c13 100644
--- a/packages/local/package.json
+++ b/packages/local/package.json
@@ -14,7 +14,7 @@
"@svml/driver-node": "workspace:*",
"@svml/package-loader-node": "workspace:*",
"@svml/protocol": "workspace:*",
- "@svml/provider-kit": "workspace:*",
+ "@svml/endpoint-kit": "workspace:*",
"@svml/runtime": "workspace:*",
"@svml/store-sqlite": "workspace:*",
"@svml/validation": "workspace:*"
diff --git a/packages/local/src/manifest.ts b/packages/local/src/manifest.ts
index 6627c414..6ee3ef48 100644
--- a/packages/local/src/manifest.ts
+++ b/packages/local/src/manifest.ts
@@ -14,7 +14,7 @@ export const localSchedulerFacet = {
export const localSchedulerImplementationDigest = digestOf("@svml/local/scheduler@1");
export const localRuntimeManifest: RuntimeModuleManifest = {
- format: "svml.runtime-module@1",
+ format: "svml.runtime-module@2",
name: localRuntimeModuleRef.name,
version: localRuntimeModuleRef.version,
facets: [
diff --git a/packages/local/src/runtime.ts b/packages/local/src/runtime.ts
index 9e175f34..dc037b39 100644
--- a/packages/local/src/runtime.ts
+++ b/packages/local/src/runtime.ts
@@ -15,9 +15,9 @@ import {
environmentCredentialStoreRuntimeManifest,
} from "@svml/credential-store-env";
import {
- HostRegistry,
+ ProducerRegistry,
NodeDriver,
- ProviderRegistry,
+ EndpointRegistry,
} from "@svml/driver-node";
import {
loadNodePackageSet,
@@ -52,7 +52,7 @@ import type {
LocalBuildRequest,
LocalRuntime,
NodeArtifactStorePackage,
- NodeProviderPackage,
+ EndpointPackage,
ProjectLocalRuntimeOptions,
} from "./types.js";
@@ -113,15 +113,15 @@ function registerManifests(
}
}
-function verifyProviderPackages(packages: readonly NodeProviderPackage[]): void {
+function verifyEndpointPackages(packages: readonly EndpointPackage[]): void {
const names = new Set<string>();
const instances = new Set<string>();
for (const item of packages) {
- assert(item.name.trim().length > 0, "Provider package name must not be empty");
- assert(!names.has(item.name), `Provider package ${item.name} is configured twice`);
+ assert(item.name.trim().length > 0, "Endpoint package name must not be empty");
+ assert(!names.has(item.name), `Endpoint package ${item.name} is configured twice`);
names.add(item.name);
- assert(item.instance.id.trim().length > 0, `${item.name} Provider instance id is empty`);
- assert(!instances.has(item.instance.id), `Provider instance ${item.instance.id} is configured twice`);
+ assert(item.instance.id.trim().length > 0, `${item.name} Endpoint instance id is empty`);
+ assert(!instances.has(item.instance.id), `Endpoint instance ${item.instance.id} is configured twice`);
instances.add(item.instance.id);
assert(item.manifest.name === item.instance.facet.module.name
&& item.manifest.version === item.instance.facet.module.version,
@@ -152,8 +152,8 @@ export async function createLocalRuntime(
|| options.scheduling?.laneLimits !== undefined)) {
throw new Error("a locked Runtime Closure owns maxConcurrency and lane limits");
}
- const hosts = new HostRegistry();
- const providers = new ProviderRegistry();
+ const producers = new ProducerRegistry();
+ const endpoints = new EndpointRegistry();
const validators = options.validators ?? new TypeValidatorRegistry();
const componentNames = new Set<string>();
for (const component of options.components ?? []) {
@@ -161,19 +161,19 @@ export async function createLocalRuntime(
assert(!componentNames.has(component.name), `Component package ${component.name} is configured twice`);
componentNames.add(component.name);
registerTypeValidatorFacets(validators, component.validators ?? []);
- registerProducerFacets(hosts, component.producers ?? []);
+ registerProducerFacets(producers, component.producers ?? []);
}
- for (const provider of options.providers ?? []) await provider.install(providers);
+ for (const endpoint of options.endpoints ?? []) await endpoint.install(endpoints);
if (options.closure !== undefined) {
- providers.applyRuntimeClosure(
+ endpoints.applyRuntimeClosure(
options.closure.value,
options.closure.modules,
{ allowedPermissions: options.closure.allowedPermissions ?? [] },
);
}
const driver = new NodeDriver({
- registry: hosts,
- providers,
+ producers,
+ endpoints,
artifacts: options.artifactStore,
...(options.credentialStore === undefined ? {} : { credentials: options.credentialStore }),
...(options.operationStore === undefined ? {} : { operations: options.operationStore }),
@@ -254,7 +254,7 @@ export async function createLocalRuntime(
/**
* Zero-service local distribution. The Runtime authority stays in this process while configured
- * Provider Endpoints may execute locally, in a vendor API, in Lambda, or on Hypit.
+ * Capability Endpoints may execute locally, in a vendor API, in Lambda, or on Hypit.
*/
export async function createProjectLocalRuntime(
options: ProjectLocalRuntimeOptions = {},
@@ -279,8 +279,8 @@ export async function createProjectLocalRuntime(
};
const artifacts = options.artifacts ?? defaultArtifacts;
verifyArtifactPackage(artifacts);
- const providerPackages = options.providers ?? [];
- verifyProviderPackages(providerPackages);
+ const endpointPackages = options.endpoints ?? [];
+ verifyEndpointPackages(endpointPackages);
try {
const modules = new RuntimeModuleRegistry();
@@ -289,7 +289,7 @@ export async function createProjectLocalRuntime(
sqliteStoreRuntimeManifest,
artifacts.manifest,
environmentCredentialStoreRuntimeManifest,
- ...providerPackages.map((item) => item.manifest),
+ ...endpointPackages.map((item) => item.manifest),
]);
const profile = sealRuntimeProfile({
name: "svml.local.project",
@@ -299,7 +299,7 @@ export async function createProjectLocalRuntime(
{ id: "operations.sqlite", facet: sqliteOperationStoreFacet },
artifacts.instance,
{ id: "credentials.env", facet: environmentCredentialStoreFacet },
- ...providerPackages.map((item) => item.instance),
+ ...endpointPackages.map((item) => item.instance),
],
scheduler: "scheduler.local",
stores: {
@@ -308,7 +308,7 @@ export async function createProjectLocalRuntime(
artifacts: artifacts.instance.id,
credentials: "credentials.env",
},
- providers: providerPackages.flatMap((item) => item.bindings),
+ endpoints: endpointPackages.flatMap((item) => item.bindings),
scheduling: {
maxConcurrency: options.scheduling?.maxConcurrency ?? 4,
lanes: Object.entries(options.scheduling?.lanes ?? {}).map(([name, maxConcurrency]) => ({
@@ -332,7 +332,7 @@ export async function createProjectLocalRuntime(
...(configuredComponents.length === 0
? {}
: { components: configuredComponents }),
- providers: providerPackages,
+ endpoints: endpointPackages,
closure: { modules, value: closure, allowedPermissions },
scheduling: {
...(options.scheduling?.maxEventsPerBuild === undefined
diff --git a/packages/local/src/types.ts b/packages/local/src/types.ts
index e76aeaa3..7e1e1a7d 100644
--- a/packages/local/src/types.ts
+++ b/packages/local/src/types.ts
@@ -1,6 +1,6 @@
import type { Awaitable, ComponentPackage } from "@svml/component-kit";
import type { ArtifactAttachment } from "@svml/host";
-import type { NodeProviderPackage } from "@svml/provider-kit";
+import type { EndpointPackage } from "@svml/endpoint-kit";
import type { BuildState } from "@svml/protocol";
import type {
ArtifactStore,
@@ -13,7 +13,6 @@ import type {
RuntimeModuleManifest,
RuntimeModuleRegistry,
RuntimeProfileInstance,
- RuntimeProviderBinding,
ScheduledBuildResult,
} from "@svml/runtime";
import type { TypeValidatorRegistrar, TypeValidatorRegistryLike } from "@svml/validation";
@@ -32,7 +31,7 @@ export type NodeArtifactStorePackage = {
readonly store: ArtifactStore;
};
-export type { NodeProviderPackage } from "@svml/provider-kit";
+export type { EndpointPackage } from "@svml/endpoint-kit";
export type LocalRuntimeClosureOptions = {
readonly modules: RuntimeModuleRegistry;
@@ -46,7 +45,7 @@ export type CreateLocalRuntimeOptions = {
readonly artifactStore: ArtifactStore;
readonly credentialStore?: CredentialStore;
readonly components?: readonly ComponentPackage[];
- readonly providers?: readonly NodeProviderPackage[];
+ readonly endpoints?: readonly EndpointPackage[];
readonly closure?: LocalRuntimeClosureOptions;
readonly scheduling?: Omit<LocalBuildSchedulerOptions, "buildStore" | "runtimeClosure">;
readonly validators?: LocalTypeValidatorRegistry;
@@ -64,7 +63,7 @@ export type ProjectLocalRuntimeOptions = {
/** Replaces the default project filesystem ArtifactStore without changing Scheduler/Core. */
readonly artifacts?: NodeArtifactStorePackage;
readonly components?: readonly ComponentPackage[];
- readonly providers?: readonly NodeProviderPackage[];
+ readonly endpoints?: readonly EndpointPackage[];
readonly allowedPermissions?: readonly string[];
readonly scheduling?: {
readonly maxConcurrency?: number;
diff --git a/packages/local/test/local.test.ts b/packages/local/test/local.test.ts
index d5e6763f..980b55cc 100644
--- a/packages/local/test/local.test.ts
+++ b/packages/local/test/local.test.ts
@@ -11,11 +11,11 @@ import { join } from "node:path";
import test from "node:test";
import { MemoryArtifactStore } from "@svml/driver-node";
-import type { ProviderEndpoint } from "@svml/driver-node";
+import type { RecoverableEndpoint } from "@svml/endpoint-kit";
import type {
NodeArtifactStorePackage,
NodeComponentPackage,
- NodeProviderPackage,
+ EndpointPackage,
} from "@svml/local";
import { createProjectLocalRuntime } from "@svml/local";
import { digestOf } from "@svml/core";
@@ -34,17 +34,17 @@ import {
types,
} from "../../core/test/greeting-fixture.js";
-const providerModule = { name: "example.local-provider", version: "1" } as const;
+const providerModule = { name: "example.local-endpoint", version: "1" } as const;
const providerFacet = { module: providerModule, name: "generation" } as const;
-const providerDigest = digestOf("example.local-provider/generation@1");
+const providerDigest = digestOf("example.local-endpoint/generation@1");
const providerManifest: RuntimeModuleManifest = {
- format: "svml.runtime-module@1",
+ format: "svml.runtime-module@2",
name: providerModule.name,
version: providerModule.version,
facets: [{
name: providerFacet.name,
- role: "provider-endpoint",
- implementation: { locator: "example.local-provider/generation", digest: providerDigest },
+ role: "capability-endpoint",
+ implementation: { locator: "example.local-endpoint/generation", digest: providerDigest },
permissions: [],
fulfills: [{ capability: capabilities.generation, returns: types.generated }],
lifecycle: "recoverable",
@@ -52,7 +52,7 @@ const providerManifest: RuntimeModuleManifest = {
}],
};
-test("project local runtime resumes durable work while component and provider packages stay replaceable", async () => {
+test("project local runtime resumes durable work while component and endpoint packages stay replaceable", async () => {
const directory = await mkdtemp(join(tmpdir(), "svml-local-"));
let promptCalls = 0;
let requestCalls = 0;
@@ -97,7 +97,7 @@ test("project local runtime resumes durable work while component and provider pa
},
],
};
- const endpoint: ProviderEndpoint = {
+ const recoverableEndpoint: RecoverableEndpoint = {
start({ operation }) {
starts += 1;
return { status: "pending", checkpoint: { remoteJob: operation.submissionKey } };
@@ -119,8 +119,8 @@ test("project local runtime resumes durable work while component and provider pa
cancels += 1;
},
};
- const provider: NodeProviderPackage = {
- name: "example.provider.personal",
+ const endpointPackage: EndpointPackage = {
+ name: "example.endpoint.personal",
manifest: providerManifest,
instance: { id: "generation.personal", facet: providerFacet },
bindings: [{
@@ -129,11 +129,11 @@ test("project local runtime resumes durable work while component and provider pa
endpoint: "generation.personal",
}],
install(registry) {
- registry.registerProviderEndpoint(
+ registry.registerRecoverableEndpoint(
"generation.personal",
capabilities.generation,
types.generated,
- endpoint,
+ recoverableEndpoint,
{
runtimeImplementation: {
facet: providerFacet,
@@ -149,7 +149,7 @@ test("project local runtime resumes durable work while component and provider pa
const firstRuntime = await createProjectLocalRuntime({
root: directory,
components: [components],
- providers: [provider],
+ endpoints: [endpointPackage],
});
const first = await firstRuntime.build({ id: "client-video", state: createGreetingBuild() });
assert.equal(first.status, "paused");
@@ -160,7 +160,7 @@ test("project local runtime resumes durable work while component and provider pa
const secondRuntime = await createProjectLocalRuntime({
root: directory,
components: [components],
- providers: [provider],
+ endpoints: [endpointPackage],
});
const second = await secondRuntime.build({ id: "client-video", state: createGreetingBuild() });
assert.equal(second.status, "complete");
@@ -279,7 +279,7 @@ test("project local runtime accepts a permission-checked replacement ArtifactSto
const artifacts: NodeArtifactStorePackage = {
name: "example.remote-artifacts",
manifest: {
- format: "svml.runtime-module@1",
+ format: "svml.runtime-module@2",
name: module.name,
version: module.version,
facets: [{
diff --git a/packages/provider-hyperframes-local/package.json b/packages/provider-hyperframes-local/package.json
index 91977b6c..ea96a517 100644
--- a/packages/provider-hyperframes-local/package.json
+++ b/packages/provider-hyperframes-local/package.json
@@ -8,14 +8,14 @@
},
"dependencies": {
"@svml/contracts": "workspace:*",
- "@svml/driver-node": "workspace:*",
+ "@svml/endpoint-kit": "workspace:*",
"@svml/hyperframes": "workspace:*",
"@svml/hyperframes-render": "workspace:*",
"@svml/protocol": "workspace:*",
- "@svml/provider-kit": "workspace:*",
"hyperframes": "0.7.84"
},
"devDependencies": {
- "@svml/core": "workspace:*"
+ "@svml/core": "workspace:*",
+ "@svml/driver-node": "workspace:*"
}
}
diff --git a/packages/provider-hyperframes-local/src/provider.ts b/packages/provider-hyperframes-local/src/provider.ts
index fb6f6e2c..8383aa81 100644
--- a/packages/provider-hyperframes-local/src/provider.ts
+++ b/packages/provider-hyperframes-local/src/provider.ts
@@ -6,13 +6,13 @@ import { dirname, join } from "node:path";
import { contractTypes, sealRenderedVisual } from "@svml/contracts";
import type { RenderedVisual } from "@svml/contracts";
-import type { ProviderHandlerContext, ProviderHandlerResult } from "@svml/driver-node";
+import type { EndpointInvocationContext, EndpointFulfillment } from "@svml/endpoint-kit";
import { assertHyperframesDocument, materializeHyperframesHtml } from "@svml/hyperframes";
import type { HyperframesDocument } from "@svml/hyperframes";
import { hyperframesRenderCapabilities } from "@svml/hyperframes-render";
import { canonicalize, digestOf } from "@svml/protocol";
import type { BlobRef, CanonicalValue } from "@svml/protocol";
-import { defineProviderPackage } from "@svml/provider-kit";
+import { defineEndpointPackage } from "@svml/endpoint-kit";
const HYPERFRAMES_VERSION = "0.7.84";
@@ -154,7 +154,7 @@ function extension(mediaType: string): string {
return result;
}
-async function artifactBytes(context: ProviderHandlerContext, artifact: BlobRef): Promise<Uint8Array> {
+async function artifactBytes(context: EndpointInvocationContext, artifact: BlobRef): Promise<Uint8Array> {
const bytes = await context.artifacts.get(artifact.digest);
assert(bytes !== undefined, `HyperFrames Artifact ${artifact.digest} is unavailable`);
assert(bytes.byteLength === artifact.size, `HyperFrames Artifact ${artifact.digest} size differs`);
@@ -229,7 +229,7 @@ function visualRequest(value: CanonicalValue): HyperframesDocument {
return item.document as HyperframesDocument;
}
-function result(value: CanonicalValue, metadata: CanonicalValue): ProviderHandlerResult {
+function result(value: CanonicalValue, metadata: CanonicalValue): EndpointFulfillment {
return {
value: { kind: "inline", value },
conformance: "exact",
@@ -267,7 +267,7 @@ export function createLocalHyperframesProvider(config: CreateLocalHyperframesPro
maxRenderedBytes,
});
- return defineProviderPackage({
+ return defineEndpointPackage({
module: localHyperframesProviderModuleRef,
facet: "render",
instance: config.instance ?? "hyperframes.local",
diff --git a/packages/provider-hyperframes-local/test/provider.test.ts b/packages/provider-hyperframes-local/test/provider.test.ts
index bba0a03c..e7d5fed2 100644
--- a/packages/provider-hyperframes-local/test/provider.test.ts
+++ b/packages/provider-hyperframes-local/test/provider.test.ts
@@ -10,8 +10,9 @@ import {
verifyRenderedVisual,
} from "@svml/contracts";
import type { RenderedVisual } from "@svml/contracts";
-import { MemoryArtifactStore, ProviderRegistry } from "@svml/driver-node";
-import type { ProviderHandler, ProviderRegistration } from "@svml/driver-node";
+import { MemoryArtifactStore, EndpointRegistry } from "@svml/driver-node";
+import type { EndpointRegistration } from "@svml/driver-node";
+import type { ImmediateEndpointHandler } from "@svml/endpoint-kit";
import { compileHyperframesDocument } from "@svml/hyperframes";
import { hyperframesRenderCapabilities, hyperframesVisualRequest } from "@svml/hyperframes-render";
import { canonicalize, digestOf } from "@svml/protocol";
@@ -97,10 +98,10 @@ function requestNeed(): Need {
}
async function handlerFor(request: Need): Promise<{
- readonly handler: ProviderHandler;
- readonly registration: ProviderRegistration;
+ readonly handler: ImmediateEndpointHandler;
+ readonly registration: EndpointRegistration;
}> {
- const registry = new ProviderRegistry();
+ const registry = new EndpointRegistry();
await createLocalHyperframesProvider({
workers: 2,
defaultConcurrency: 1,
@@ -108,7 +109,7 @@ async function handlerFor(request: Need): Promise<{
}).install(registry);
const resolution = registry.resolve(request);
assert.equal(resolution.status, "resolved");
- assert.equal(resolution.registration.kind, "handler");
+ assert.equal(resolution.registration.kind, "immediate");
return { handler: resolution.registration.handler, registration: resolution.registration };
}
@@ -116,8 +117,8 @@ test("local HyperFrames Provider exposes one exact visual capability and two sep
const provider = createLocalHyperframesProvider({ workers: 4, defaultConcurrency: 2 });
assert.equal(provider.name, "hyperframes.local");
const facet = provider.manifest.facets[0];
- assert.equal(facet?.role, "provider-endpoint");
- assert(facet?.role === "provider-endpoint");
+ assert.equal(facet?.role, "capability-endpoint");
+ assert(facet?.role === "capability-endpoint");
assert.deepEqual(facet.permissions, ["process:hyperframes"]);
assert.equal(facet.defaultConcurrency, 2);
assert.deepEqual(provider.bindings, [{
diff --git a/packages/provider-kie/README.md b/packages/provider-kie/README.md
index bd6d57ca..74047050 100644
--- a/packages/provider-kie/README.md
+++ b/packages/provider-kie/README.md
@@ -50,7 +50,7 @@ export default await createProjectLocalRuntime({
nanoBananaComponent,
seedreamComponent,
],
- providers: [createKieProvider({
+ endpoints: [createKieProvider({
instance: "kie.personal",
apiKey: credentialRef("env", "KIE_API_KEY"),
defaultConcurrency: 2,
diff --git a/packages/provider-kie/package.json b/packages/provider-kie/package.json
index c01108db..6928980c 100644
--- a/packages/provider-kie/package.json
+++ b/packages/provider-kie/package.json
@@ -7,7 +7,7 @@
".": "./src/index.ts"
},
"dependencies": {
- "@svml/driver-node": "workspace:*",
+ "@svml/endpoint-kit": "workspace:*",
"@svml/gemini-omni": "workspace:*",
"@svml/generation": "workspace:*",
"@svml/gpt-image": "workspace:*",
@@ -15,7 +15,6 @@
"@svml/minimax-h3": "workspace:*",
"@svml/nano-banana": "workspace:*",
"@svml/protocol": "workspace:*",
- "@svml/provider-kit": "workspace:*",
"@svml/runtime": "workspace:*",
"@svml/seedance": "workspace:*",
"@svml/seedream": "workspace:*"
@@ -24,6 +23,7 @@
"@svml/artifact-store-fs": "workspace:*",
"@svml/component-kit": "workspace:*",
"@svml/core": "workspace:*",
+ "@svml/driver-node": "workspace:*",
"@svml/elaborator": "workspace:*",
"@svml/local": "workspace:*",
"@svml/validation": "workspace:*"
diff --git a/packages/provider-kie/src/provider.ts b/packages/provider-kie/src/provider.ts
index 6e190381..f71bff57 100644
--- a/packages/provider-kie/src/provider.ts
+++ b/packages/provider-kie/src/provider.ts
@@ -1,9 +1,9 @@
import type {
- ProviderEndpoint,
- ProviderEndpointResumeContext,
- ProviderEndpointStartContext,
- ProviderEndpointResult,
-} from "@svml/driver-node";
+ RecoverableEndpoint,
+ EndpointResumeContext,
+ EndpointStartContext,
+ EndpointOutcome,
+} from "@svml/endpoint-kit";
import {
sealGeneratedImageSet,
sealGeneratedVideoSet,
@@ -19,9 +19,9 @@ import type {
Digest,
} from "@svml/protocol";
import {
- defineProviderPackage,
+ defineEndpointPackage,
wakeAfter,
-} from "@svml/provider-kit";
+} from "@svml/endpoint-kit";
import { credentialRef } from "@svml/runtime";
import type { ArtifactStore, CredentialRef } from "@svml/runtime";
@@ -121,7 +121,7 @@ function contentRequestDigest(value: unknown): Digest {
return request.requestDigest;
}
-function secret(context: ProviderEndpointStartContext | ProviderEndpointResumeContext): string {
+function secret(context: EndpointStartContext | EndpointResumeContext): string {
const value = context.credentials.apiKey?.secret;
if (value === undefined || value.length === 0) throw new KieError("KIE_MISSING_CREDENTIAL", "KIE API key is unavailable");
return value;
@@ -372,7 +372,7 @@ function resultUrls(data: Record<string, unknown>): string[] {
});
}
-function verifyCheckpoint(value: CanonicalValue | undefined, context: ProviderEndpointResumeContext): KieCheckpoint {
+function verifyCheckpoint(value: CanonicalValue | undefined, context: EndpointResumeContext): KieCheckpoint {
if (value === undefined) {
throw new KieError(
"KIE_SUBMISSION_CHECKPOINT_MISSING",
@@ -401,8 +401,8 @@ function endpoint(options: {
readonly pollIntervalMs: number;
readonly maxOperationMs: number;
readonly now: () => number;
-}): ProviderEndpoint {
- const failure = (error: unknown): ProviderEndpointResult => {
+}): RecoverableEndpoint {
+ const failure = (error: unknown): EndpointOutcome => {
const known = error instanceof KieError ? error : new KieError("KIE_INTERNAL_ERROR", error instanceof Error ? error.message : String(error));
return {
status: "failed",
@@ -414,7 +414,7 @@ function endpoint(options: {
},
};
};
- const pendingAfterError = (checkpoint: KieCheckpoint, error: unknown): ProviderEndpointResult => {
+ const pendingAfterError = (checkpoint: KieCheckpoint, error: unknown): EndpointOutcome => {
const failures = checkpoint.pollFailures + 1;
if (options.now() - checkpoint.startedAt >= options.maxOperationMs) {
return failure(new KieError("KIE_OPERATION_TIMEOUT", "KIE task did not become durably available before the deadline"));
@@ -590,7 +590,7 @@ export function createKieProvider(config: CreateKieProviderOptions = {}) {
maxOperationMs,
now,
});
- return defineProviderPackage({
+ return defineEndpointPackage({
module: kieProviderModuleRef,
facet: "market",
instance: config.instance ?? "kie.default",
diff --git a/packages/provider-kie/test/live-smoke.ts b/packages/provider-kie/test/live-smoke.ts
index 4ceed42f..06548c77 100644
--- a/packages/provider-kie/test/live-smoke.ts
+++ b/packages/provider-kie/test/live-smoke.ts
@@ -450,7 +450,7 @@ async function main(): Promise<void> {
generationComponent,
...[...new Map(selected.map((item) => [item.component.name, item.component])).values()],
],
- providers: [provider],
+ endpoints: [provider],
allowedPermissions: provider.manifest.facets.flatMap((facet) => facet.permissions),
});
const failures: string[] = [];
diff --git a/packages/provider-kie/test/provider.test.ts b/packages/provider-kie/test/provider.test.ts
index 72967c9e..f63590aa 100644
--- a/packages/provider-kie/test/provider.test.ts
+++ b/packages/provider-kie/test/provider.test.ts
@@ -3,9 +3,10 @@ import test from "node:test";
import {
MemoryArtifactStore,
- ProviderRegistry,
+ EndpointRegistry,
} from "@svml/driver-node";
-import type { ProviderEndpoint, ProviderRegistration } from "@svml/driver-node";
+import type { EndpointRegistration } from "@svml/driver-node";
+import type { RecoverableEndpoint } from "@svml/endpoint-kit";
import { seedanceEndpoints, sealSeedanceRequest } from "@svml/seedance";
import { digestOf } from "@svml/protocol";
import type { CanonicalValue, Need } from "@svml/protocol";
@@ -33,8 +34,8 @@ async function endpointFor(
request: Need,
fetch: typeof globalThis.fetch,
now = () => 1_000,
-): Promise<{ endpoint: ProviderEndpoint; registration: ProviderRegistration }> {
- const registry = new ProviderRegistry();
+): Promise<{ endpoint: RecoverableEndpoint; registration: EndpointRegistration }> {
+ const registry = new EndpointRegistry();
const provider = createKieProvider({
fetch,
fetchImplementationDigest: digestOf("provider-kie:test-fetch"),
@@ -47,7 +48,7 @@ async function endpointFor(
await provider.install(registry);
const resolution = registry.resolve(request);
assert.equal(resolution.status, "resolved");
- assert.equal(resolution.registration.kind, "endpoint");
+ assert.equal(resolution.registration.kind, "recoverable");
return { endpoint: resolution.registration.endpoint, registration: resolution.registration };
}
diff --git a/packages/provider-kit/README.md b/packages/provider-kit/README.md
deleted file mode 100644
index 7f2adef1..00000000
--- a/packages/provider-kit/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-# `@svml/provider-kit`
-
-Trusted Node SDK for defining one configured external-capability Provider from one source of truth.
-
-`defineProviderPackage()` produces all four facts consumed by the local Runtime:
-
-- a static Runtime Module Manifest that can be inspected before implementation code runs;
-- a configured endpoint instance and its non-secret `configurationDigest`;
-- exact capability/return bindings;
-- Driver registration for an immediate handler or recoverable `start/resume/cancel` endpoint.
-
-Provider packages are deployment packages. They are selected by `svml.runtime.ts`, never imported by
-author `.svml` source. A package is normally organized by real provider or execution environment,
-such as KIE, Volcengine, local WhisperX or AWS HyperFrames, and may expose several models supported
-by that provider. It may not infer a creative model from a generic output Type.
-
-```ts
-import { defineProviderPackage, wakeAfter } from "@svml/provider-kit";
-import { credentialRef } from "@svml/runtime";
-
-export function exampleProvider(options: { apiKeyVariable: string }) {
- return defineProviderPackage({
- module: { name: "@example/provider", version: "1" },
- facet: "generation",
- instance: "example.personal",
- implementation: {
- locator: "@example/provider/generation",
- digest: implementationDigest,
- },
- configuration: { baseUrl: "https://api.example.test" },
- credentials: { apiKey: credentialRef("env", options.apiKeyVariable) },
- permissions: ["network:api.example.test"],
- defaultConcurrency: 2,
- capabilities: [{
- lifecycle: "recoverable",
- capability: exampleCapability,
- returns: exampleProductType,
- retry: { maxAttempts: 3 },
- endpoint: {
- async start({ operation, need, credentials }) {
- const job = await submit(need.constraints, credentials.apiKey!.secret, operation.submissionKey);
- return wakeAfter({ job }, 2_000);
- },
- async resume({ checkpoint, credentials }) {
- return poll(checkpoint, credentials.apiKey!.secret);
- },
- async cancel({ checkpoint, credentials }) {
- await cancelRemote(checkpoint, credentials.apiKey!.secret);
- },
- },
- }],
- });
-}
-```
-
-Secrets are resolved immediately before invocation and never enter the Runtime Profile, Runtime
-Closure, BuildState or Operation journal. Credential slot names, references, retry policy and other
-non-secret instance configuration are identity-bound. Changing them creates another Runtime Closure.
-
-`wakeAfter()` is a convenience for a pending checkpoint with an explicit next poll time. Retry is
-attempt-level: a retryable terminal failure creates a new content-addressed Operation and submission
-key, subject to `maxAttempts`. Process recovery of the same attempt keeps the same submission key.
-
-The current SDK assumes trusted in-process Provider code and a truthful implementation digest.
-Community package byte verification and isolation are still future Host work.
diff --git a/packages/provider-media-local/README.md b/packages/provider-media-local/README.md
index 0f672c05..2192bfc0 100644
--- a/packages/provider-media-local/README.md
+++ b/packages/provider-media-local/README.md
@@ -9,12 +9,12 @@ import { createLocalMediaProvider } from "@svml/provider-media-local";
const runtime = await createProjectLocalRuntime({
packageLock: "./svml.packages.lock",
- providers: [createLocalMediaProvider({ defaultConcurrency: 1 })],
+ endpoints: [createLocalMediaProvider({ defaultConcurrency: 1 })],
allowedPermissions: ["process:media"],
});
```
-The Provider:
+The Endpoint:
- bounds subprocess duration and ffprobe JSON size;
- invokes binaries without a shell;
diff --git a/packages/provider-media-local/package.json b/packages/provider-media-local/package.json
index 1e3d6f45..3dc6f29a 100644
--- a/packages/provider-media-local/package.json
+++ b/packages/provider-media-local/package.json
@@ -8,14 +8,14 @@
},
"dependencies": {
"@svml/contracts": "workspace:*",
- "@svml/driver-node": "workspace:*",
+ "@svml/endpoint-kit": "workspace:*",
"@svml/media-pipeline": "workspace:*",
- "@svml/protocol": "workspace:*",
- "@svml/provider-kit": "workspace:*"
+ "@svml/protocol": "workspace:*"
},
"devDependencies": {
"@svml/artifact-store-fs": "workspace:*",
"@svml/core": "workspace:*",
+ "@svml/driver-node": "workspace:*",
"@svml/elaborator": "workspace:*",
"@svml/local": "workspace:*",
"@svml/validation": "workspace:*"
diff --git a/packages/provider-media-local/src/provider.ts b/packages/provider-media-local/src/provider.ts
index 4768c9de..a6d4121f 100644
--- a/packages/provider-media-local/src/provider.ts
+++ b/packages/provider-media-local/src/provider.ts
@@ -30,7 +30,7 @@ import type {
SpeechEvidenceAudio,
TimelineAudio,
} from "@svml/contracts";
-import type { ProviderHandlerContext, ProviderHandlerResult } from "@svml/driver-node";
+import type { EndpointInvocationContext, EndpointFulfillment } from "@svml/endpoint-kit";
import {
mediaPipelineCapabilities,
verifyAudioProgramPlan,
@@ -46,7 +46,7 @@ import {
digestOf,
} from "@svml/protocol";
import type { BlobRef, CanonicalValue } from "@svml/protocol";
-import { defineProviderPackage } from "@svml/provider-kit";
+import { defineEndpointPackage } from "@svml/endpoint-kit";
import { parseMediaInspection } from "./probe.js";
@@ -136,7 +136,7 @@ async function version(executable: string, timeoutMs: number): Promise<string> {
return line;
}
-async function sourceBytes(context: ProviderHandlerContext, source: BlobRef): Promise<Uint8Array> {
+async function sourceBytes(context: EndpointInvocationContext, source: BlobRef): Promise<Uint8Array> {
const bytes = await context.artifacts.get(source.digest);
assert(bytes !== undefined, `Media source ${source.digest} is unavailable`);
assert(bytes.byteLength === source.size, `Media source ${source.digest} size differs`);
@@ -144,7 +144,7 @@ async function sourceBytes(context: ProviderHandlerContext, source: BlobRef): Pr
}
async function stageArtifact(
- context: ProviderHandlerContext,
+ context: EndpointInvocationContext,
source: BlobRef,
path: string,
): Promise<void> {
@@ -329,7 +329,7 @@ async function outputInspection(args: {
timeoutMs: args.timeoutMs, maxProbeOutputBytes: args.maxProbeOutputBytes });
}
-function result(value: CanonicalValue, metadata: CanonicalValue): ProviderHandlerResult {
+function result(value: CanonicalValue, metadata: CanonicalValue): EndpointFulfillment {
return {
value: { kind: "inline", value },
conformance: "exact",
@@ -461,7 +461,7 @@ export function createLocalMediaProvider(config: CreateLocalMediaProviderOptions
const maxProbeOutputBytes = positiveInteger(config.maxProbeOutputBytes ?? 256 * 1024 * 1024,
"maxProbeOutputBytes");
const common = { ffmpegPath, ffprobePath, processTimeoutMs, maxProbeOutputBytes };
- return defineProviderPackage({
+ return defineEndpointPackage({
module: localMediaProviderModuleRef,
facet: "media",
instance: config.instance ?? "media.local",
diff --git a/packages/provider-media-local/test/provider.test.ts b/packages/provider-media-local/test/provider.test.ts
index b50f97c4..0d8650b0 100644
--- a/packages/provider-media-local/test/provider.test.ts
+++ b/packages/provider-media-local/test/provider.test.ts
@@ -24,9 +24,10 @@ import type {
} from "@svml/contracts";
import {
MemoryArtifactStore,
- ProviderRegistry,
+ EndpointRegistry,
} from "@svml/driver-node";
-import type { ProviderHandler, ProviderRegistration } from "@svml/driver-node";
+import type { EndpointRegistration } from "@svml/driver-node";
+import type { ImmediateEndpointHandler } from "@svml/endpoint-kit";
import {
mediaPipelineCapabilities,
sealAudioProgramPlan,
@@ -117,12 +118,12 @@ async function fulfillInline(artifacts: MemoryArtifactStore, request: Need): Pro
return result.value.kind === "inline" ? result.value.value : null;
}
-async function handlerFor(request: Need): Promise<{ handler: ProviderHandler; registration: ProviderRegistration }> {
- const registry = new ProviderRegistry();
+async function handlerFor(request: Need): Promise<{ handler: ImmediateEndpointHandler; registration: EndpointRegistration }> {
+ const registry = new EndpointRegistry();
await createLocalMediaProvider({ processTimeoutMs: 30_000 }).install(registry);
const resolution = registry.resolve(request);
assert.equal(resolution.status, "resolved");
- assert.equal(resolution.registration.kind, "handler");
+ assert.equal(resolution.registration.kind, "immediate");
return { handler: resolution.registration.handler, registration: resolution.registration };
}
diff --git a/packages/provider-whisperx-local/package.json b/packages/provider-whisperx-local/package.json
index 73d173bd..31969d4e 100644
--- a/packages/provider-whisperx-local/package.json
+++ b/packages/provider-whisperx-local/package.json
@@ -8,9 +8,11 @@
},
"dependencies": {
"@svml/contracts": "workspace:*",
- "@svml/driver-node": "workspace:*",
+ "@svml/endpoint-kit": "workspace:*",
"@svml/protocol": "workspace:*",
- "@svml/provider-kit": "workspace:*",
"@svml/whisperx": "workspace:*"
+ },
+ "devDependencies": {
+ "@svml/driver-node": "workspace:*"
}
}
diff --git a/packages/provider-whisperx-local/src/provider.ts b/packages/provider-whisperx-local/src/provider.ts
index f6cd9d09..9290dd7b 100644
--- a/packages/provider-whisperx-local/src/provider.ts
+++ b/packages/provider-whisperx-local/src/provider.ts
@@ -3,10 +3,10 @@ import { tmpdir } from "node:os";
import { join } from "node:path";
import type { AlignedTranscriptSegment, SpeechBasisSegment } from "@svml/contracts";
-import type { ProviderHandlerContext, ProviderHandlerResult } from "@svml/driver-node";
+import type { EndpointInvocationContext, EndpointFulfillment } from "@svml/endpoint-kit";
import { canonicalize, digestOf } from "@svml/protocol";
import type { CanonicalValue } from "@svml/protocol";
-import { defineProviderPackage } from "@svml/provider-kit";
+import { defineEndpointPackage } from "@svml/endpoint-kit";
import {
sealWhisperXAlignmentEvidence,
whisperXCapabilities,
@@ -224,7 +224,7 @@ async function limitedJson(response: Response, maxBytes: number, subject: string
}
}
-function result(value: CanonicalValue, metadata: CanonicalValue): ProviderHandlerResult {
+function result(value: CanonicalValue, metadata: CanonicalValue): EndpointFulfillment {
return {
value: { kind: "inline", value },
conformance: "exact",
@@ -254,7 +254,7 @@ export function createLocalWhisperXProvider(config: CreateLocalWhisperXProviderO
const requestTimeoutMs = positiveInteger(config.requestTimeoutMs ?? 10 * 60_000, "requestTimeoutMs");
const maxResponseBytes = positiveInteger(config.maxResponseBytes ?? 64 * 1024 * 1024, "maxResponseBytes");
- return defineProviderPackage({
+ return defineEndpointPackage({
module: localWhisperXProviderModuleRef,
facet: "alignment",
instance: config.instance ?? "whisperx.local",
@@ -284,7 +284,7 @@ export function createLocalWhisperXProvider(config: CreateLocalWhisperXProviderO
supports: (need) => need.constraints !== null && typeof need.constraints === "object"
&& !Array.isArray(need.constraints)
&& (need.constraints as { readonly contract?: unknown }).contract === "svml.whisperx-alignment-request@2",
- handler: async (context: ProviderHandlerContext) => {
+ handler: async (context: EndpointInvocationContext) => {
const request = alignmentRequest(context.need.constraints);
const audio = await context.artifacts.get(request.audio.digest);
assert(audio !== undefined && audio.byteLength === request.audio.size,
diff --git a/packages/provider-whisperx-local/test/provider.test.ts b/packages/provider-whisperx-local/test/provider.test.ts
index b1d3fef3..24823d12 100644
--- a/packages/provider-whisperx-local/test/provider.test.ts
+++ b/packages/provider-whisperx-local/test/provider.test.ts
@@ -7,7 +7,7 @@ import {
contractTypes,
sealSpeechEvidenceAudio,
} from "@svml/contracts";
-import { MemoryArtifactStore, ProviderRegistry } from "@svml/driver-node";
+import { MemoryArtifactStore, EndpointRegistry } from "@svml/driver-node";
import { digestOf } from "@svml/protocol";
import type { Need } from "@svml/protocol";
import {
@@ -53,8 +53,8 @@ test("local WhisperX Provider pins the complete sidecar runtime and is independe
const provider = createLocalWhisperXProvider({ expectedModel: "small", defaultConcurrency: 2 });
assert.equal(provider.name, "whisperx.local");
const facet = provider.manifest.facets[0];
- assert.equal(facet?.role, "provider-endpoint");
- assert(facet?.role === "provider-endpoint");
+ assert.equal(facet?.role, "capability-endpoint");
+ assert(facet?.role === "capability-endpoint");
assert.equal(facet.defaultConcurrency, 2);
assert.deepEqual(facet.permissions, ["filesystem:whisperx-staging", "network:whisperx-loopback"]);
assert.throws(
@@ -174,7 +174,7 @@ test("local Provider stages canonical evidence bytes unchanged and binds sidecar
constraints,
}),
};
- const registry = new ProviderRegistry();
+ const registry = new EndpointRegistry();
await createLocalWhisperXProvider({
baseUrl: `http://127.0.0.1:${address.port}`,
expectedModel: "small",
@@ -182,7 +182,7 @@ test("local Provider stages canonical evidence bytes unchanged and binds sidecar
}).install(registry);
const resolved = registry.resolve(need);
assert.equal(resolved.status, "resolved");
- assert.equal(resolved.registration.kind, "handler");
+ assert.equal(resolved.registration.kind, "immediate");
const output = await resolved.registration.handler({
command: { kind: "fulfill-need", id: "command:whisperx-loopback", need },
need,
diff --git a/packages/runtime/README.md b/packages/runtime/README.md
index b2f12b12..c4a83f3a 100644
--- a/packages/runtime/README.md
+++ b/packages/runtime/README.md
@@ -8,15 +8,15 @@ The first implementation contains:
- `LocalBuildScheduler`: one authoritative, queue-free scheduler shared by multiple Builds;
- named concurrency lanes with Runtime Profile overrides;
- static Runtime Module facets, sealed Profile resolution and a content-addressed Runtime Closure;
-- exact Provider capability/return bindings, implementation digests and permission allowlists;
+- exact Endpoint capability/return bindings, implementation digests and permission allowlists;
- `BuildStore` and `OperationStore` ports with compare-and-swap in-memory references;
-- a recoverable Provider Endpoint lifecycle that journals before `start`, checkpoints `pending`,
+- a recoverable Endpoint lifecycle that journals before `start`, checkpoints `pending`,
calls `resume` after a restart, and records wake, retry, failure and cancellation state;
- a narrow `CredentialStore`/`CredentialRef` port that keeps secrets out of framework facts.
The Scheduler does not traverse Graphs, choose Candidates, rewrite Needs or accept arbitrary
serialized commands. Core remains the sole source of readiness and the sole Event acceptance law.
-Lanes only limit how many already-authorized commands execute concurrently. A Provider's remote job
+Lanes only limit how many already-authorized commands execute concurrently. An Endpoint's remote job
queue is still internal to that Endpoint and cannot advance another Build step.
`MemoryBuildStore` stores verified BuildState only. `MemoryOperationStore` separately records a
@@ -28,8 +28,8 @@ accepts its Event, the next run reconstructs the same Event from the stored comp
call the Endpoint again.
This package is an environment-neutral reference, not a durable queue. SQLite/filesystem adapters,
-environment credentials, the local follow loop and the Provider SDK live in separate packages;
-distributed attempt leases and production Provider adapters remain future work. An Endpoint
+environment credentials, the local follow loop and `@svml/endpoint-kit` live in separate packages;
+distributed attempt leases and production Endpoint adapters remain future work. An Endpoint
whose upstream API cannot look up or deduplicate the supplied `submissionKey` cannot promise
exactly-once remote work across the crash window; its `resume(undefined)` must explicitly reconcile
that uncertainty.
diff --git a/packages/runtime/src/credentials.ts b/packages/runtime/src/credentials.ts
index 026827a5..c2878676 100644
--- a/packages/runtime/src/credentials.ts
+++ b/packages/runtime/src/credentials.ts
@@ -7,7 +7,7 @@ export type CredentialRef = {
};
export type CredentialValue = {
- /** Opaque secret revealed only to the selected Provider invocation. */
+ /** Opaque secret revealed only to the selected Endpoint invocation. */
readonly secret: string;
readonly expiresAt?: number;
};
diff --git a/packages/runtime/src/index.ts b/packages/runtime/src/index.ts
index e468297d..f6f204d2 100644
--- a/packages/runtime/src/index.ts
+++ b/packages/runtime/src/index.ts
@@ -16,7 +16,7 @@ export {
RuntimeModuleRegistry,
localSchedulerOptionsFromClosure,
resolveRuntimeProfile,
- runtimeProvider,
+ runtimeEndpoint,
sealRuntimeProfile,
verifyRuntimeClosure,
verifyRuntimeCoverage,
diff --git a/packages/runtime/src/profile.ts b/packages/runtime/src/profile.ts
index 52fc0753..a32ff8e2 100644
--- a/packages/runtime/src/profile.ts
+++ b/packages/runtime/src/profile.ts
@@ -14,7 +14,7 @@ export type RuntimeFacetRole =
| "operation-store"
| "artifact-store"
| "credential-store"
- | "provider-endpoint";
+ | "capability-endpoint";
export type RuntimeFacetRef = {
readonly module: ModuleRef;
@@ -33,14 +33,14 @@ export type RuntimeCapability = {
type RuntimeServiceFacet = {
readonly name: string;
- readonly role: Exclude<RuntimeFacetRole, "provider-endpoint">;
+ readonly role: Exclude<RuntimeFacetRole, "capability-endpoint">;
readonly implementation: RuntimeImplementation;
readonly permissions: readonly string[];
};
-export type RuntimeProviderFacet = {
+export type RuntimeEndpointFacet = {
readonly name: string;
- readonly role: "provider-endpoint";
+ readonly role: "capability-endpoint";
readonly implementation: RuntimeImplementation;
readonly permissions: readonly string[];
readonly fulfills: readonly RuntimeCapability[];
@@ -50,11 +50,11 @@ export type RuntimeProviderFacet = {
readonly credentialSlots?: readonly string[];
};
-export type RuntimeFacet = RuntimeServiceFacet | RuntimeProviderFacet;
+export type RuntimeFacet = RuntimeServiceFacet | RuntimeEndpointFacet;
/** Static package metadata. Reading it must never execute the implementation it describes. */
export type RuntimeModuleManifest = {
- readonly format: "svml.runtime-module@1";
+ readonly format: "svml.runtime-module@2";
readonly name: string;
readonly version: string;
readonly facets: readonly RuntimeFacet[];
@@ -63,18 +63,18 @@ export type RuntimeModuleManifest = {
export type RuntimeProfileInstance = {
readonly id: string;
readonly facet: RuntimeFacetRef;
- /** Optional authority-wide lane name. The default is provider:<instance id>. */
+ /** Optional authority-wide lane name. The default is endpoint:<instance id>. */
readonly lane?: string;
/** Digest of non-secret endpoint/store configuration. Secret bytes must never enter it. */
readonly configurationDigest?: Digest;
};
-export type RuntimeProviderBinding = RuntimeCapability & {
+export type RuntimeEndpointBinding = RuntimeCapability & {
readonly endpoint: string;
};
export type RuntimeProfile = {
- readonly format: "svml.runtime-profile@1";
+ readonly format: "svml.runtime-profile@2";
readonly digest: Digest;
readonly name: string;
readonly instances: readonly RuntimeProfileInstance[];
@@ -85,7 +85,7 @@ export type RuntimeProfile = {
readonly artifacts?: string;
readonly credentials?: string;
};
- readonly providers: readonly RuntimeProviderBinding[];
+ readonly endpoints: readonly RuntimeEndpointBinding[];
readonly scheduling: {
readonly maxConcurrency: number;
readonly lanes: readonly { readonly name: string; readonly maxConcurrency: number }[];
@@ -94,16 +94,16 @@ export type RuntimeProfile = {
export type ResolvedRuntimeService = {
readonly id: string;
- readonly role: Exclude<RuntimeFacetRole, "provider-endpoint">;
+ readonly role: Exclude<RuntimeFacetRole, "capability-endpoint">;
readonly facet: RuntimeFacetRef;
readonly implementation: RuntimeImplementation;
readonly configurationDigest: Digest;
readonly permissions: readonly string[];
};
-export type ResolvedRuntimeProvider = {
+export type ResolvedRuntimeEndpoint = {
readonly id: string;
- readonly role: "provider-endpoint";
+ readonly role: "capability-endpoint";
readonly facet: RuntimeFacetRef;
readonly implementation: RuntimeImplementation;
readonly configurationDigest: Digest;
@@ -115,17 +115,17 @@ export type ResolvedRuntimeProvider = {
readonly maxConcurrency: number;
};
-export type ResolvedRuntimeInstance = ResolvedRuntimeService | ResolvedRuntimeProvider;
+export type ResolvedRuntimeInstance = ResolvedRuntimeService | ResolvedRuntimeEndpoint;
export type RuntimeClosure = {
- readonly format: "svml.runtime-closure@1";
+ readonly format: "svml.runtime-closure@2";
readonly digest: Digest;
readonly profile: Digest;
readonly modules: readonly { readonly module: ModuleRef; readonly digest: Digest }[];
readonly instances: readonly ResolvedRuntimeInstance[];
readonly scheduler: string;
readonly stores: RuntimeProfile["stores"];
- readonly providers: readonly RuntimeProviderBinding[];
+ readonly endpoints: readonly RuntimeEndpointBinding[];
readonly scheduling: RuntimeProfile["scheduling"];
};
@@ -215,7 +215,7 @@ function normalizeFacet(facet: RuntimeFacet): RuntimeFacet {
implementation: normalizeImplementation(facet.implementation, facet.name),
permissions: sortedUniqueStrings(facet.permissions, `${facet.name} permissions`),
};
- if (facet.role !== "provider-endpoint") return { ...common, role: facet.role };
+ if (facet.role !== "capability-endpoint") return { ...common, role: facet.role };
const fulfills = facet.fulfills.map(normalizeCapability)
.sort((left, right) => bindingKey(left).localeCompare(bindingKey(right)));
assert(fulfills.length > 0, `${facet.name} must fulfill at least one exact capability`);
@@ -223,7 +223,7 @@ function normalizeFacet(facet: RuntimeFacet): RuntimeFacet {
assert(facet.lifecycle === "immediate" || facet.lifecycle === "recoverable", `${facet.name} lifecycle is invalid`);
return {
...common,
- role: "provider-endpoint",
+ role: "capability-endpoint",
fulfills,
lifecycle: facet.lifecycle,
defaultConcurrency: positiveInteger(facet.defaultConcurrency, `${facet.name} defaultConcurrency`),
@@ -232,12 +232,12 @@ function normalizeFacet(facet: RuntimeFacet): RuntimeFacet {
}
function normalizeManifest(manifest: RuntimeModuleManifest): RuntimeModuleManifest {
- assert(manifest.format === "svml.runtime-module@1", "unsupported Runtime Module Manifest format");
+ assert(manifest.format === "svml.runtime-module@2", "unsupported Runtime Module Manifest format");
assert(manifest.name.trim().length > 0 && manifest.version.trim().length > 0, "runtime module identity is invalid");
const facets = manifest.facets.map(normalizeFacet).sort((left, right) => left.name.localeCompare(right.name));
assert(new Set(facets.map((facet) => facet.name)).size === facets.length, `${manifest.name} repeats a Runtime facet`);
return {
- format: "svml.runtime-module@1",
+ format: "svml.runtime-module@2",
name: manifest.name,
version: manifest.version,
facets,
@@ -280,15 +280,15 @@ export class RuntimeModuleRegistry {
for (const permission of instance.permissions) {
assert(allowed.has(permission), `${instance.id} requires disallowed Runtime permission ${permission}`);
}
- if (instance.role === "provider-endpoint" && resolved.facet.role === "provider-endpoint") {
- assert(instance.lifecycle === resolved.facet.lifecycle, `${instance.id} Provider lifecycle differs`);
+ if (instance.role === "capability-endpoint" && resolved.facet.role === "capability-endpoint") {
+ assert(instance.lifecycle === resolved.facet.lifecycle, `${instance.id} Endpoint lifecycle differs`);
assert(JSON.stringify(instance.credentialSlots)
- === JSON.stringify(resolved.facet.credentialSlots ?? []), `${instance.id} Provider credential slots differ`);
+ === JSON.stringify(resolved.facet.credentialSlots ?? []), `${instance.id} Endpoint credential slots differ`);
assert(JSON.stringify(instance.fulfills.map(bindingKey))
- === JSON.stringify(resolved.facet.fulfills.map(bindingKey)), `${instance.id} Provider capabilities differ`);
+ === JSON.stringify(resolved.facet.fulfills.map(bindingKey)), `${instance.id} Endpoint capabilities differ`);
const override = closure.scheduling.lanes.find((lane) => lane.name === instance.lane)?.maxConcurrency;
assert(instance.maxConcurrency === (override ?? resolved.facet.defaultConcurrency),
- `${instance.id} Provider concurrency differs`);
+ `${instance.id} Endpoint concurrency differs`);
}
}
}
@@ -296,7 +296,7 @@ export class RuntimeModuleRegistry {
function profileContent(profile: RuntimeProfile): Omit<RuntimeProfile, "digest"> {
return {
- format: "svml.runtime-profile@1",
+ format: "svml.runtime-profile@2",
name: profile.name,
instances: [...profile.instances]
.map((instance) => ({
@@ -315,7 +315,7 @@ function profileContent(profile: RuntimeProfile): Omit<RuntimeProfile, "digest">
...(profile.stores.artifacts === undefined ? {} : { artifacts: profile.stores.artifacts }),
...(profile.stores.credentials === undefined ? {} : { credentials: profile.stores.credentials }),
},
- providers: [...profile.providers]
+ endpoints: [...profile.endpoints]
.map((binding) => ({ ...normalizeCapability(binding), endpoint: binding.endpoint }))
.sort((left, right) => bindingKey(left).localeCompare(bindingKey(right))),
scheduling: {
@@ -328,7 +328,7 @@ function profileContent(profile: RuntimeProfile): Omit<RuntimeProfile, "digest">
}
function verifyProfileShape(profile: RuntimeProfile): void {
- assert(profile.format === "svml.runtime-profile@1", "unsupported Runtime Profile format");
+ assert(profile.format === "svml.runtime-profile@2", "unsupported Runtime Profile format");
assert(profile.name.trim().length > 0, "Runtime Profile name is empty");
assert(profile.scheduler.trim().length > 0, "Runtime Profile scheduler is empty");
positiveInteger(profile.scheduling.maxConcurrency, "Runtime Profile maxConcurrency");
@@ -343,11 +343,11 @@ function verifyProfileShape(profile: RuntimeProfile): void {
return instance.id;
});
assert(new Set(ids).size === ids.length, "Runtime Profile repeats an instance id");
- const bindings = profile.providers.map((binding) => {
- assert(binding.endpoint.trim().length > 0, "Runtime Provider binding endpoint is empty");
+ const bindings = profile.endpoints.map((binding) => {
+ assert(binding.endpoint.trim().length > 0, "Runtime Endpoint binding endpoint is empty");
return bindingKey(normalizeCapability(binding));
});
- assert(new Set(bindings).size === bindings.length, "Runtime Profile repeats a Provider binding");
+ assert(new Set(bindings).size === bindings.length, "Runtime Profile repeats an Endpoint binding");
const laneNames = profile.scheduling.lanes.map((lane) => {
assert(lane.name.trim().length > 0, "Runtime Profile lane name is empty");
positiveInteger(lane.maxConcurrency, `Runtime lane ${lane.name}`);
@@ -360,7 +360,7 @@ export function sealRuntimeProfile(
value: Omit<RuntimeProfile, "format" | "digest">,
): RuntimeProfile {
const draft: RuntimeProfile = {
- format: "svml.runtime-profile@1",
+ format: "svml.runtime-profile@2",
digest: digestOf("unsealed-runtime-profile"),
...value,
};
@@ -376,7 +376,7 @@ export function verifyRuntimeProfile(profile: RuntimeProfile): void {
function closureContent(closure: RuntimeClosure): Omit<RuntimeClosure, "digest"> {
return {
- format: "svml.runtime-closure@1",
+ format: "svml.runtime-closure@2",
profile: closure.profile,
modules: [...closure.modules].map((item) => ({ module: { ...item.module }, digest: item.digest }))
.sort((left, right) => moduleKey(left.module).localeCompare(moduleKey(right.module))),
@@ -384,7 +384,7 @@ function closureContent(closure: RuntimeClosure): Omit<RuntimeClosure, "digest">
.sort((left, right) => left.id.localeCompare(right.id)),
scheduler: closure.scheduler,
stores: { ...closure.stores },
- providers: [...closure.providers].map((binding) => structuredClone(binding))
+ endpoints: [...closure.endpoints].map((binding) => structuredClone(binding))
.sort((left, right) => bindingKey(left).localeCompare(bindingKey(right))),
scheduling: {
maxConcurrency: closure.scheduling.maxConcurrency,
@@ -394,7 +394,7 @@ function closureContent(closure: RuntimeClosure): Omit<RuntimeClosure, "digest">
}
export function verifyRuntimeClosure(closure: RuntimeClosure): void {
- assert(closure.format === "svml.runtime-closure@1", "unsupported Runtime Closure format");
+ assert(closure.format === "svml.runtime-closure@2", "unsupported Runtime Closure format");
assert(isDigest(closure.profile), "Runtime Closure profile digest is invalid");
assert(isDigest(closure.digest) && closure.digest === digestOf(closureContent(closure)), "Runtime Closure digest differs");
positiveInteger(closure.scheduling.maxConcurrency, "Runtime Closure maxConcurrency");
@@ -417,13 +417,13 @@ export function verifyRuntimeClosure(closure: RuntimeClosure): void {
assert(isDigest(instance.configurationDigest), `${instance.id} configuration digest is invalid`);
assert(moduleKeys.includes(moduleKey(instance.facet.module)), `${instance.id} refers to an unlocked Runtime module`);
sortedUniqueStrings(instance.permissions, `${instance.id} permissions`);
- if (instance.role === "provider-endpoint") {
- assert(instance.lane.trim().length > 0, `${instance.id} Provider lane is empty`);
- positiveInteger(instance.maxConcurrency, `${instance.id} Provider maxConcurrency`);
- assert(instance.fulfills.length > 0, `${instance.id} Provider fulfills nothing`);
+ if (instance.role === "capability-endpoint") {
+ assert(instance.lane.trim().length > 0, `${instance.id} Endpoint lane is empty`);
+ positiveInteger(instance.maxConcurrency, `${instance.id} Endpoint maxConcurrency`);
+ assert(instance.fulfills.length > 0, `${instance.id} Endpoint fulfills nothing`);
assert(new Set(instance.fulfills.map(bindingKey)).size === instance.fulfills.length,
- `${instance.id} Provider repeats a capability`);
- sortedUniqueStrings(instance.credentialSlots, `${instance.id} Provider credential slots`);
+ `${instance.id} Endpoint repeats a capability`);
+ sortedUniqueStrings(instance.credentialSlots, `${instance.id} Endpoint credential slots`);
}
instances.set(instance.id, instance);
}
@@ -439,18 +439,18 @@ export function verifyRuntimeClosure(closure: RuntimeClosure): void {
const id = closure.stores[name];
if (id !== undefined) assert(instances.get(id)?.role === role, `Runtime Closure ${name} store has the wrong role`);
}
- for (const binding of closure.providers) {
+ for (const binding of closure.endpoints) {
const endpoint = instances.get(binding.endpoint);
- assert(endpoint?.role === "provider-endpoint", `${binding.endpoint} is not a Provider Endpoint`);
+ assert(endpoint?.role === "capability-endpoint", `${binding.endpoint} is not a capability Endpoint`);
assert(endpoint.fulfills.some((item) => sameCapability(item, binding)), `${binding.endpoint} does not fulfill ${bindingKey(binding)}`);
}
- assert(new Set(closure.providers.map(bindingKey)).size === closure.providers.length,
- "Runtime Closure repeats a Provider binding");
- if (closure.instances.some((instance) => instance.role === "provider-endpoint" && instance.lifecycle === "recoverable")) {
- assert(closure.stores.operations !== undefined, "recoverable Provider Endpoints require an OperationStore");
+ assert(new Set(closure.endpoints.map(bindingKey)).size === closure.endpoints.length,
+ "Runtime Closure repeats an Endpoint binding");
+ if (closure.instances.some((instance) => instance.role === "capability-endpoint" && instance.lifecycle === "recoverable")) {
+ assert(closure.stores.operations !== undefined, "recoverable Endpoints require an OperationStore");
}
- if (closure.instances.some((instance) => instance.role === "provider-endpoint" && instance.credentialSlots.length > 0)) {
- assert(closure.stores.credentials !== undefined, "credentialed Provider Endpoints require a CredentialStore");
+ if (closure.instances.some((instance) => instance.role === "capability-endpoint" && instance.credentialSlots.length > 0)) {
+ assert(closure.stores.credentials !== undefined, "credentialed Endpoints require a CredentialStore");
}
}
@@ -476,12 +476,12 @@ export function resolveRuntimeProfile(
configurationDigest: instance.configurationDigest ?? digestOf({}),
permissions: [...resolved.facet.permissions],
};
- if (resolved.facet.role !== "provider-endpoint") return { ...common, role: resolved.facet.role };
- const lane = instance.lane ?? `provider:${instance.id}`;
+ if (resolved.facet.role !== "capability-endpoint") return { ...common, role: resolved.facet.role };
+ const lane = instance.lane ?? `endpoint:${instance.id}`;
const override = profile.scheduling.lanes.find((candidate) => candidate.name === lane)?.maxConcurrency;
return {
...common,
- role: "provider-endpoint",
+ role: "capability-endpoint",
fulfills: resolved.facet.fulfills.map((item) => structuredClone(item)),
lifecycle: resolved.facet.lifecycle,
credentialSlots: [...(resolved.facet.credentialSlots ?? [])],
@@ -503,26 +503,26 @@ export function resolveRuntimeProfile(
const id = profile.stores[name];
if (id !== undefined) assert(byId.get(id)?.role === role, `Runtime Profile ${name} store ${id} has the wrong role`);
}
- for (const binding of profile.providers) {
+ for (const binding of profile.endpoints) {
const endpoint = byId.get(binding.endpoint);
- assert(endpoint?.role === "provider-endpoint", `${binding.endpoint} is not an active Provider Endpoint`);
+ assert(endpoint?.role === "capability-endpoint", `${binding.endpoint} is not an active capability Endpoint`);
assert(endpoint.fulfills.some((item) => sameCapability(item, binding)), `${binding.endpoint} does not fulfill ${bindingKey(binding)}`);
}
- if (instances.some((instance) => instance.role === "provider-endpoint" && instance.lifecycle === "recoverable")) {
- assert(profile.stores.operations !== undefined, "recoverable Provider Endpoints require an OperationStore");
+ if (instances.some((instance) => instance.role === "capability-endpoint" && instance.lifecycle === "recoverable")) {
+ assert(profile.stores.operations !== undefined, "recoverable Endpoints require an OperationStore");
}
- if (instances.some((instance) => instance.role === "provider-endpoint" && instance.credentialSlots.length > 0)) {
- assert(profile.stores.credentials !== undefined, "credentialed Provider Endpoints require a CredentialStore");
+ if (instances.some((instance) => instance.role === "capability-endpoint" && instance.credentialSlots.length > 0)) {
+ assert(profile.stores.credentials !== undefined, "credentialed Endpoints require a CredentialStore");
}
const draft: RuntimeClosure = {
- format: "svml.runtime-closure@1",
+ format: "svml.runtime-closure@2",
digest: digestOf("unsealed-runtime-closure"),
profile: profile.digest,
modules: [...modules.values()],
instances,
scheduler: profile.scheduler,
stores: { ...profile.stores },
- providers: profile.providers.map((binding) => structuredClone(binding)),
+ endpoints: profile.endpoints.map((binding) => structuredClone(binding)),
scheduling: structuredClone(profile.scheduling),
};
const content = closureContent(draft);
@@ -531,13 +531,13 @@ export function resolveRuntimeProfile(
return closure;
}
-export function runtimeProvider(
+export function runtimeEndpoint(
closure: RuntimeClosure,
id: string,
-): ResolvedRuntimeProvider | undefined {
+): ResolvedRuntimeEndpoint | undefined {
verifyRuntimeClosure(closure);
const instance = closure.instances.find((candidate) => candidate.id === id);
- return instance?.role === "provider-endpoint" ? instance : undefined;
+ return instance?.role === "capability-endpoint" ? instance : undefined;
}
/** Fail before execution if the selected finite BuildPlan has an unbound external requirement. */
@@ -553,7 +553,7 @@ export function verifyRuntimeCoverage(closure: RuntimeClosure, state: BuildState
}
for (const requirement of required.values()) {
assert(
- closure.providers.some((binding) => sameCapability(binding, requirement)),
+ closure.endpoints.some((binding) => sameCapability(binding, requirement)),
`Runtime Closure does not bind demanded capability ${bindingKey(requirement)}`,
);
}
diff --git a/packages/runtime/test/profile.test.ts b/packages/runtime/test/profile.test.ts
index 87e8ce3c..34431cfc 100644
--- a/packages/runtime/test/profile.test.ts
+++ b/packages/runtime/test/profile.test.ts
@@ -9,6 +9,7 @@ import {
sealRuntimeProfile,
verifyRuntimeClosure,
verifyRuntimeCoverage,
+ verifyRuntimeProfile,
} from "@svml/runtime";
import type { RuntimeModuleManifest } from "@svml/runtime";
@@ -24,7 +25,7 @@ const endpointImplementationDigest = digestOf("example.runtime-fixture/greeting-
function manifest(permissions: readonly string[] = []): RuntimeModuleManifest {
return {
- format: "svml.runtime-module@1",
+ format: "svml.runtime-module@2",
name: runtimeModule.name,
version: runtimeModule.version,
facets: [
@@ -57,7 +58,7 @@ function manifest(permissions: readonly string[] = []): RuntimeModuleManifest {
},
{
name: endpointFacet.name,
- role: "provider-endpoint",
+ role: "capability-endpoint",
implementation: {
locator: "example.runtime-fixture/greeting-endpoint",
digest: endpointImplementationDigest,
@@ -84,7 +85,7 @@ function profile(options: { readonly operations?: boolean; readonly lane?: numbe
{
id: "greeting.local",
facet: endpointFacet,
- lane: "provider:greeting.local",
+ lane: "endpoint:greeting.local",
},
],
scheduler: "scheduler.local",
@@ -92,14 +93,14 @@ function profile(options: { readonly operations?: boolean; readonly lane?: numbe
build: "build.memory",
...(options.operations === false ? {} : { operations: "operations.memory" }),
},
- providers: [{
+ endpoints: [{
capability: capabilities.generation,
returns: types.generated,
endpoint: "greeting.local",
}],
scheduling: {
maxConcurrency: 8,
- lanes: [{ name: "provider:greeting.local", maxConcurrency: options.lane ?? 2 }],
+ lanes: [{ name: "endpoint:greeting.local", maxConcurrency: options.lane ?? 2 }],
},
});
}
@@ -113,14 +114,14 @@ test("Runtime Profile resolves installed static facets into one deterministic lo
assert.equal(first.modules[0]?.digest, manifestDigest);
assert.equal(first.instances.filter((instance) => instance.role === "scheduler").length, 1);
const endpoint = first.instances.find((instance) => instance.id === "greeting.local");
- assert.equal(endpoint?.role, "provider-endpoint");
- if (endpoint?.role === "provider-endpoint") {
+ assert.equal(endpoint?.role, "capability-endpoint");
+ if (endpoint?.role === "capability-endpoint") {
assert.equal(endpoint.implementation.digest, endpointImplementationDigest);
- assert.equal(endpoint.lane, "provider:greeting.local");
+ assert.equal(endpoint.lane, "endpoint:greeting.local");
assert.equal(endpoint.maxConcurrency, 2);
}
assert.deepEqual(localSchedulerOptionsFromClosure(first).laneLimits, {
- "provider:greeting.local": 2,
+ "endpoint:greeting.local": 2,
});
assert.doesNotThrow(() => verifyRuntimeCoverage(first, createGreetingBuild()));
});
@@ -132,7 +133,7 @@ test("Profile order is not identity but an execution-policy change is", () => {
const reordered = sealRuntimeProfile({
...normal,
instances: [...normal.instances].reverse(),
- providers: [...normal.providers].reverse(),
+ endpoints: [...normal.endpoints].reverse(),
scheduling: { ...normal.scheduling, lanes: [...normal.scheduling.lanes].reverse() },
});
assert.equal(normal.digest, reordered.digest);
@@ -173,7 +174,7 @@ test("credentialed Endpoints require an explicitly selected CredentialStore", ()
const configured = manifest();
registry.register({
...configured,
- facets: configured.facets.map((facet) => facet.role === "provider-endpoint"
+ facets: configured.facets.map((facet) => facet.role === "capability-endpoint"
? { ...facet, credentialSlots: ["apiKey"] }
: facet),
});
@@ -196,7 +197,7 @@ test("Coverage rejects an unbound demanded Need before the Scheduler starts", ()
const registry = new RuntimeModuleRegistry();
registry.register(manifest());
const configured = profile();
- const unbound = sealRuntimeProfile({ ...configured, providers: [] });
+ const unbound = sealRuntimeProfile({ ...configured, endpoints: [] });
const closure = resolveRuntimeProfile(registry, unbound);
assert.throws(
() => verifyRuntimeCoverage(closure, createGreetingBuild()),
@@ -212,3 +213,24 @@ test("Runtime Closure content cannot be changed without invalidating its digest"
(tampered.scheduling as { maxConcurrency: number }).maxConcurrency = 999;
assert.throws(() => verifyRuntimeClosure(tampered), /digest differs/u);
});
+
+test("Runtime @1 facts are rejected instead of being reinterpreted as Endpoint bindings", () => {
+ const registry = new RuntimeModuleRegistry();
+ assert.throws(
+ () => registry.register({ ...manifest(), format: "svml.runtime-module@1" } as never),
+ /unsupported Runtime Module Manifest format/u,
+ );
+
+ const configured = profile();
+ assert.throws(
+ () => verifyRuntimeProfile({ ...configured, format: "svml.runtime-profile@1" } as never),
+ /unsupported Runtime Profile format/u,
+ );
+
+ registry.register(manifest());
+ const closure = resolveRuntimeProfile(registry, configured);
+ assert.throws(
+ () => verifyRuntimeClosure({ ...closure, format: "svml.runtime-closure@1" } as never),
+ /unsupported Runtime Closure format/u,
+ );
+});
diff --git a/packages/speech-program/test/video-pipeline.test.ts b/packages/speech-program/test/video-pipeline.test.ts
index 78d36d7e..334f964c 100644
--- a/packages/speech-program/test/video-pipeline.test.ts
+++ b/packages/speech-program/test/video-pipeline.test.ts
@@ -27,9 +27,9 @@ import type {
} from "@svml/contracts";
import { digestOf, sealBuildRequest, start } from "@svml/core";
import {
- HostRegistry,
+ ProducerRegistry,
NodeDriver,
- ProviderRegistry,
+ EndpointRegistry,
parseBuildState,
serializeBuildState,
} from "@svml/driver-node";
@@ -114,8 +114,8 @@ function producerCount(state: BuildState, producer: ProducerRef): number {
}
test("the Speech Program pipeline resumes without repeating paid calls", async () => {
- const host = new HostRegistry();
- const providers = new ProviderRegistry();
+ const host = new ProducerRegistry();
+ const endpoints = new EndpointRegistry();
const calls = {
estimate: 0,
seedance: 0,
@@ -279,22 +279,22 @@ test("the Speech Program pipeline resumes without repeating paid calls", async (
registerProducerFacets(host, speechAlignComponent.producers);
registerProducerFacets(host, captionComponent.producers);
- const driver = new NodeDriver({ registry: host, providers, validators: validatorRegistry() });
+ const driver = new NodeDriver({ producers: host, endpoints, validators: validatorRegistry() });
const atEstimate = await driver.run(createVideoBuild());
- assert.equal(atEstimate.blocked[0]?.reason, "missing-provider");
+ assert.equal(atEstimate.blocked[0]?.reason, "missing-endpoint");
assert.match(atEstimate.blocked[0]?.subject ?? "", /OfficialSpeechDurationEstimate/u);
- providers.registerProvider("runtime:official-estimate", videoCapabilities.estimate, videoTypes.estimate, () => ({
+ endpoints.registerImmediateEndpoint("runtime:official-estimate", videoCapabilities.estimate, videoTypes.estimate, () => ({
value: { kind: "inline", value: { durationSec: 1 } },
conformance: "exact",
delivery: "executed",
metadata: {},
}));
const atSeedance = await driver.run(parseBuildState(serializeBuildState(atEstimate.state)));
- assert.equal(atSeedance.blocked[0]?.reason, "missing-provider");
+ assert.equal(atSeedance.blocked[0]?.reason, "missing-endpoint");
assert.match(atSeedance.blocked[0]?.subject ?? "", /SeedanceMiniSpeechMedia/u);
- providers.registerProvider(
+ endpoints.registerImmediateEndpoint(
"runtime:kie-seedance-mini",
videoCapabilities.seedanceMini,
videoTypes.seedanceMiniMedia,
@@ -314,15 +314,15 @@ test("the Speech Program pipeline resumes without repeating paid calls", async (
} },
conformance: "exact",
delivery: "executed",
- metadata: { provider: "kie", model: "seedance-mini" },
+ metadata: { endpoint: "kie", model: "seedance-mini" },
};
},
);
const atEvidenceAudio = await driver.run(parseBuildState(serializeBuildState(atSeedance.state)));
- assert.equal(atEvidenceAudio.blocked[0]?.reason, "missing-provider");
+ assert.equal(atEvidenceAudio.blocked[0]?.reason, "missing-endpoint");
assert.match(atEvidenceAudio.blocked[0]?.subject ?? "", /SpeechEvidenceAudio/u);
- providers.registerProvider(
+ endpoints.registerImmediateEndpoint(
"runtime:media-local",
mediaPipelineCapabilities.projectSpeechEvidenceAudio,
contractTypes.speechEvidenceAudio,
@@ -365,11 +365,11 @@ test("the Speech Program pipeline resumes without repeating paid calls", async (
},
);
const atWhisperX = await driver.run(parseBuildState(serializeBuildState(atEvidenceAudio.state)));
- assert.equal(atWhisperX.blocked[0]?.reason, "missing-provider");
+ assert.equal(atWhisperX.blocked[0]?.reason, "missing-endpoint");
assert.match(atWhisperX.blocked[0]?.subject ?? "", /WhisperXAlignmentEvidence/u);
- const wrongBasisProviders = new ProviderRegistry();
- wrongBasisProviders.registerProvider(
+ const wrongBasisEndpoints = new EndpointRegistry();
+ wrongBasisEndpoints.registerImmediateEndpoint(
"runtime:wrong-basis-whisperx",
whisperXCapabilities.alignment,
whisperXTypes.alignmentEvidence,
@@ -394,8 +394,8 @@ test("the Speech Program pipeline resumes without repeating paid calls", async (
}),
);
const rejectedEvidence = await new NodeDriver({
- registry: host,
- providers: wrongBasisProviders,
+ producers: host,
+ endpoints: wrongBasisEndpoints,
validators: validatorRegistry(),
}).run(
parseBuildState(serializeBuildState(atWhisperX.state)),
@@ -412,7 +412,7 @@ test("the Speech Program pipeline resumes without repeating paid calls", async (
"Evidence for another same-duration audio projection must not enter BuildState",
);
- providers.registerProvider(
+ endpoints.registerImmediateEndpoint(
"runtime:whisperx-local",
whisperXCapabilities.alignment,
whisperXTypes.alignmentEvidence,
@@ -610,12 +610,12 @@ test("an Existing SpeechTake cuts generation while a visual substitute cuts the
assert.equal(preview.plan.initialValues.length, 1);
});
-test("an exact Provider result cannot wash a substitute input back to exact", async () => {
+test("an exact Endpoint result cannot wash a substitute input back to exact", async () => {
const initial = createVideoBuild({
estimateRealization: "placeholder",
goalAccepts: "substitute",
});
- const host = new HostRegistry();
+ const host = new ProducerRegistry();
host.registerProducer(
videoProducers.placeholderEstimate,
videoImplementations.placeholderEstimate,
@@ -625,8 +625,8 @@ test("an exact Provider result cannot wash a substitute input back to exact", as
outputs: {},
needs: { media: { model: "mini" } },
}));
- const providers = new ProviderRegistry();
- providers.registerProvider(
+ const endpoints = new EndpointRegistry();
+ endpoints.registerImmediateEndpoint(
"runtime:exact-seedance",
videoCapabilities.seedanceMini,
videoTypes.seedanceMiniMedia,
@@ -644,8 +644,8 @@ test("an exact Provider result cannot wash a substitute input back to exact", as
);
const result = await new NodeDriver({
- registry: host,
- providers,
+ producers: host,
+ endpoints,
validators: validatorRegistry(),
}).run(initial);
assert.equal(result.status, "paused", "the unregistered Basis assembler should pause after Seedance");
diff --git a/packages/speech-take/test/product.test.ts b/packages/speech-take/test/product.test.ts
index 786d2ccb..5b4b299c 100644
--- a/packages/speech-take/test/product.test.ts
+++ b/packages/speech-take/test/product.test.ts
@@ -27,7 +27,7 @@ import {
sealTypedModule,
start,
} from "@svml/core";
-import { HostRegistry, NodeDriver } from "@svml/driver-node";
+import { ProducerRegistry, NodeDriver } from "@svml/driver-node";
import type {
BuildRequest,
CompiledGraph,
@@ -345,13 +345,13 @@ test("selecting an Existing SpeechTake stops generation but keeps both projectio
test("the Build Machine executes one shared generation for both projected outputs", async () => {
let generations = 0;
- const registry = new HostRegistry();
+ const registry = new ProducerRegistry();
registry.registerProducer(generateProducer, generateImplementationDigest, () => {
generations += 1;
return { outputs: { take: { kind: "inline", value: sampleTake() } }, needs: {} };
});
registerProducerFacets(registry, speechTakeComponent.producers);
- const result = await new NodeDriver({ registry, validators: validatorRegistry() }).run(
+ const result = await new NodeDriver({ producers: registry, validators: validatorRegistry() }).run(
build({ "opening.audio": "exact", "opening.visual": "exact" }),
);
assert.equal(result.status, "complete");
diff --git a/packages/store-sqlite/src/manifest.ts b/packages/store-sqlite/src/manifest.ts
index 19ed21bc..63332b92 100644
--- a/packages/store-sqlite/src/manifest.ts
+++ b/packages/store-sqlite/src/manifest.ts
@@ -25,7 +25,7 @@ export const sqliteOperationStoreImplementationDigest = digestOf(
);
export const sqliteStoreRuntimeManifest: RuntimeModuleManifest = {
- format: "svml.runtime-module@1",
+ format: "svml.runtime-module@2",
name: sqliteStoreModuleRef.name,
version: sqliteStoreModuleRef.version,
facets: [
diff --git a/packages/transport-aws-lambda/README.md b/packages/transport-aws-lambda/README.md
index 3a98fee6..83cf5376 100644
--- a/packages/transport-aws-lambda/README.md
+++ b/packages/transport-aws-lambda/README.md
@@ -1,20 +1,20 @@
# `@svml/transport-aws-lambda`
-Low-level synchronous JSON invocation for Provider packages that execute work through AWS Lambda.
-It is deliberately not a Provider and declares no SVML capability.
+Low-level synchronous JSON invocation for Endpoint packages that execute work through AWS Lambda.
+It is deliberately not an Endpoint and declares no SVML capability.
-Provider-specific code owns:
+Endpoint-specific code owns:
- the request/response schema;
- whether one call completes work or returns a remote checkpoint;
-- conversion into `ProviderEndpointResult`;
+- conversion into `EndpointOutcome`;
- artifact locations and affinity validation;
-- the function name, version/alias and retry semantics included in Provider configuration identity.
+- the function name, version/alias and retry semantics included in Endpoint configuration identity.
The transport always uses `RequestResponse`. Lambda `Event` invocation has its own at-least-once
queue and no immediate result/checkpoint, so treating it as a recoverable SVML Endpoint would be
-misleading. A Provider may invoke a coordinator Lambda synchronously; that coordinator can submit
-long work and return a checkpoint which the Provider later polls through another synchronous call.
+misleading. An Endpoint may invoke a coordinator Lambda synchronously; that coordinator can submit
+long work and return a checkpoint which the Endpoint later polls through another synchronous call.
AWS authentication uses the SDK credential chain or an injected trusted client. Large media belongs
in ArtifactStore; JSON payloads are bounded by Lambda's synchronous payload limit.
diff --git a/packages/transport-aws-lambda/package.json b/packages/transport-aws-lambda/package.json
index 26041b73..41c42268 100644
--- a/packages/transport-aws-lambda/package.json
+++ b/packages/transport-aws-lambda/package.json
@@ -9,6 +9,6 @@
"dependencies": {
"@aws-sdk/client-lambda": "^3.1103.0",
"@svml/protocol": "workspace:*",
- "@svml/provider-kit": "workspace:*"
+ "@svml/transport": "workspace:*"
}
}
diff --git a/packages/transport-aws-lambda/src/index.ts b/packages/transport-aws-lambda/src/index.ts
index 5b0f7fb1..41d1b93f 100644
--- a/packages/transport-aws-lambda/src/index.ts
+++ b/packages/transport-aws-lambda/src/index.ts
@@ -7,7 +7,7 @@ import type {
} from "@aws-sdk/client-lambda";
import { canonicalize } from "@svml/protocol";
import type { CanonicalValue } from "@svml/protocol";
-import type { JsonInvoker } from "@svml/provider-kit";
+import type { JsonInvoker } from "@svml/transport";
export type LambdaInvocationInput = {
readonly functionName: string;
@@ -74,8 +74,8 @@ export class AwsSdkLambdaInvocationClient implements LambdaInvocationClient {
}
/**
- * Synchronous JSON transport. Provider-specific packages still own request shape, checkpoint law,
- * capability identity and conversion into ProviderEndpointResult.
+ * Synchronous JSON transport. Endpoint packages still own request shape, checkpoint law,
+ * capability identity and conversion into an Endpoint outcome.
*/
export class AwsLambdaJsonInvoker implements JsonInvoker {
readonly #client: LambdaInvocationClient;
diff --git a/packages/transport-aws-lambda/test/invoker.test.ts b/packages/transport-aws-lambda/test/invoker.test.ts
index 8f59d1ce..ed62e58f 100644
--- a/packages/transport-aws-lambda/test/invoker.test.ts
+++ b/packages/transport-aws-lambda/test/invoker.test.ts
@@ -6,7 +6,7 @@ import {
} from "@svml/transport-aws-lambda";
import type { LambdaInvocationClient } from "@svml/transport-aws-lambda";
-test("Lambda transport uses synchronous JSON and leaves Provider semantics to its caller", async () => {
+test("Lambda transport uses synchronous JSON and leaves Endpoint semantics to its caller", async () => {
let invocation: Parameters<LambdaInvocationClient["invoke"]>[0] | undefined;
const client: LambdaInvocationClient = {
async invoke(input) {
diff --git a/packages/transport-process/README.md b/packages/transport-process/README.md
index 75a8a016..00009086 100644
--- a/packages/transport-process/README.md
+++ b/packages/transport-process/README.md
@@ -1,7 +1,7 @@
# `@svml/transport-process`
-Least-authority JSON child-process transport for trusted local Provider packages. It is not a
-Provider and declares no capability.
+Least-authority JSON child-process transport for trusted local Endpoint packages. It is not an
+Endpoint and declares no capability.
- executable path must be absolute;
- `shell` is always disabled;
@@ -9,6 +9,6 @@ Provider and declares no capability.
- timeout and output size are mandatory/bounded;
- one canonical JSON document goes to stdin and one comes from stdout.
-A WhisperX-local or HyperFrames-local Provider may wrap this transport and own the actual request
-schema, artifact protocol and Provider lifecycle. Author source can never select an executable or
+A WhisperX-local or HyperFrames-local Endpoint may wrap this transport and own the actual request
+schema, artifact protocol and Endpoint lifecycle. Author source can never select an executable or
pass shell arguments through this API.
diff --git a/packages/transport-process/package.json b/packages/transport-process/package.json
index 81d3b780..e0e19dd2 100644
--- a/packages/transport-process/package.json
+++ b/packages/transport-process/package.json
@@ -8,6 +8,6 @@
},
"dependencies": {
"@svml/protocol": "workspace:*",
- "@svml/provider-kit": "workspace:*"
+ "@svml/transport": "workspace:*"
}
}
diff --git a/packages/transport-process/src/index.ts b/packages/transport-process/src/index.ts
index 1ff2e7fa..8a26ec12 100644
--- a/packages/transport-process/src/index.ts
+++ b/packages/transport-process/src/index.ts
@@ -3,7 +3,7 @@ import { isAbsolute, resolve } from "node:path";
import { canonicalize } from "@svml/protocol";
import type { CanonicalValue } from "@svml/protocol";
-import type { JsonInvoker } from "@svml/provider-kit";
+import type { JsonInvoker } from "@svml/transport";
export type ProcessJsonInvokerOptions = {
/** Must be absolute; shell lookup and shell interpolation are never used. */
diff --git a/packages/transport/README.md b/packages/transport/README.md
new file mode 100644
index 00000000..52c8853b
--- /dev/null
+++ b/packages/transport/README.md
@@ -0,0 +1,7 @@
+# `@svml/transport`
+
+Tiny transport contracts with no capability identity, scheduling or recovery authority.
+
+`JsonInvoker` carries one bounded canonical request/response exchange. Process, Lambda, HTTP or RPC
+adapters may implement it; an Endpoint package remains responsible for interpreting the request,
+persisting remote checkpoints and converting a response into an exact capability fulfillment.
diff --git a/packages/transport/package.json b/packages/transport/package.json
new file mode 100644
index 00000000..cb345f97
--- /dev/null
+++ b/packages/transport/package.json
@@ -0,0 +1,12 @@
+{
+ "name": "@svml/transport",
+ "version": "0.0.0-dev",
+ "private": true,
+ "type": "module",
+ "exports": {
+ ".": "./src/index.ts"
+ },
+ "dependencies": {
+ "@svml/protocol": "workspace:*"
+ }
+}
diff --git a/packages/transport/src/index.ts b/packages/transport/src/index.ts
new file mode 100644
index 00000000..5c66037d
--- /dev/null
+++ b/packages/transport/src/index.ts
@@ -0,0 +1,6 @@
+import type { CanonicalValue } from "@svml/protocol";
+
+/** One canonical JSON exchange; it owns no capability routing or operation semantics. */
+export interface JsonInvoker {
+ invoke(request: CanonicalValue, options?: { readonly signal?: AbortSignal }): Promise<CanonicalValue>;
+}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 7be0f854..69ee8ff0 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -163,6 +163,9 @@ importers:
'@svml/core':
specifier: workspace:*
version: link:../core
+ '@svml/endpoint-kit':
+ specifier: workspace:*
+ version: link:../endpoint-kit
'@svml/protocol':
specifier: workspace:*
version: link:../protocol
@@ -202,6 +205,15 @@ importers:
specifier: workspace:*
version: link:../speech-take
+ packages/endpoint-kit:
+ dependencies:
+ '@svml/protocol':
+ specifier: workspace:*
+ version: link:../protocol
+ '@svml/runtime':
+ specifier: workspace:*
+ version: link:../runtime
+
packages/film:
dependencies:
'@svml/contracts':
@@ -363,6 +375,9 @@ importers:
'@svml/driver-node':
specifier: workspace:*
version: link:../driver-node
+ '@svml/endpoint-kit':
+ specifier: workspace:*
+ version: link:../endpoint-kit
'@svml/host':
specifier: workspace:*
version: link:../host
@@ -372,9 +387,6 @@ importers:
'@svml/protocol':
specifier: workspace:*
version: link:../protocol
- '@svml/provider-kit':
- specifier: workspace:*
- version: link:../provider-kit
'@svml/runtime':
specifier: workspace:*
version: link:../runtime
@@ -518,9 +530,9 @@ importers:
'@svml/contracts':
specifier: workspace:*
version: link:../contracts
- '@svml/driver-node':
+ '@svml/endpoint-kit':
specifier: workspace:*
- version: link:../driver-node
+ version: link:../endpoint-kit
'@svml/hyperframes':
specifier: workspace:*
version: link:../hyperframes
@@ -530,9 +542,6 @@ importers:
'@svml/protocol':
specifier: workspace:*
version: link:../protocol
- '@svml/provider-kit':
- specifier: workspace:*
- version: link:../provider-kit
hyperframes:
specifier: 0.7.84
version: 0.7.84(@types/[email protected])
@@ -540,12 +549,15 @@ importers:
'@svml/core':
specifier: workspace:*
version: link:../core
+ '@svml/driver-node':
+ specifier: workspace:*
+ version: link:../driver-node
packages/provider-kie:
dependencies:
- '@svml/driver-node':
+ '@svml/endpoint-kit':
specifier: workspace:*
- version: link:../driver-node
+ version: link:../endpoint-kit
'@svml/gemini-omni':
specifier: workspace:*
version: link:../gemini-omni
@@ -567,9 +579,6 @@ importers:
'@svml/protocol':
specifier: workspace:*
version: link:../protocol
- '@svml/provider-kit':
- specifier: workspace:*
- version: link:../provider-kit
'@svml/runtime':
specifier: workspace:*
version: link:../runtime
@@ -589,6 +598,9 @@ importers:
'@svml/core':
specifier: workspace:*
version: link:../core
+ '@svml/driver-node':
+ specifier: workspace:*
+ version: link:../driver-node
'@svml/elaborator':
specifier: workspace:*
version: link:../elaborator
@@ -599,39 +611,20 @@ importers:
specifier: workspace:*
version: link:../validation
- packages/provider-kit:
- dependencies:
- '@svml/driver-node':
- specifier: workspace:*
- version: link:../driver-node
- '@svml/protocol':
- specifier: workspace:*
- version: link:../protocol
- '@svml/runtime':
- specifier: workspace:*
- version: link:../runtime
- devDependencies:
- '@svml/core':
- specifier: workspace:*
- version: link:../core
-
packages/provider-media-local:
dependencies:
'@svml/contracts':
specifier: workspace:*
version: link:../contracts
- '@svml/driver-node':
+ '@svml/endpoint-kit':
specifier: workspace:*
- version: link:../driver-node
+ version: link:../endpoint-kit
'@svml/media-pipeline':
specifier: workspace:*
version: link:../media-pipeline
'@svml/protocol':
specifier: workspace:*
version: link:../protocol
- '@svml/provider-kit':
- specifier: workspace:*
- version: link:../provider-kit
devDependencies:
'@svml/artifact-store-fs':
specifier: workspace:*
@@ -639,6 +632,9 @@ importers:
'@svml/core':
specifier: workspace:*
version: link:../core
+ '@svml/driver-node':
+ specifier: workspace:*
+ version: link:../driver-node
'@svml/elaborator':
specifier: workspace:*
version: link:../elaborator
@@ -654,18 +650,19 @@ importers:
'@svml/contracts':
specifier: workspace:*
version: link:../contracts
- '@svml/driver-node':
+ '@svml/endpoint-kit':
specifier: workspace:*
- version: link:../driver-node
+ version: link:../endpoint-kit
'@svml/protocol':
specifier: workspace:*
version: link:../protocol
- '@svml/provider-kit':
- specifier: workspace:*
- version: link:../provider-kit
'@svml/whisperx':
specifier: workspace:*
version: link:../whisperx
+ devDependencies:
+ '@svml/driver-node':
+ specifier: workspace:*
+ version: link:../driver-node
packages/realization:
dependencies:
@@ -875,6 +872,12 @@ importers:
specifier: workspace:*
version: link:../hyperframes
+ packages/transport:
+ dependencies:
+ '@svml/protocol':
+ specifier: workspace:*
+ version: link:../protocol
+
packages/transport-aws-lambda:
dependencies:
'@aws-sdk/client-lambda':
@@ -883,18 +886,18 @@ importers:
'@svml/protocol':
specifier: workspace:*
version: link:../protocol
- '@svml/provider-kit':
+ '@svml/transport':
specifier: workspace:*
- version: link:../provider-kit
+ version: link:../transport
packages/transport-process:
dependencies:
'@svml/protocol':
specifier: workspace:*
version: link:../protocol
- '@svml/provider-kit':
+ '@svml/transport':
specifier: workspace:*
- version: link:../provider-kit
+ version: link:../transport
packages/validation:
dependencies:
diff --git a/tsconfig.v2.json b/tsconfig.v2.json
index 69d0fce9..10d98f70 100644
--- a/tsconfig.v2.json
+++ b/tsconfig.v2.json
@@ -8,6 +8,7 @@
"@svml/protocol": ["packages/protocol/src/index.ts"],
"@svml/core": ["packages/core/src/index.ts"],
"@svml/component-kit": ["packages/component-kit/src/index.ts"],
+ "@svml/endpoint-kit": ["packages/endpoint-kit/src/index.ts"],
"@svml/contracts": ["packages/contracts/src/index.ts"],
"@svml/driver-node": ["packages/driver-node/src/index.ts"],
"@svml/script": ["packages/script/src/index.ts"],
@@ -24,7 +25,6 @@
"@svml/artifact-store-s3": ["packages/artifact-store-s3/src/index.ts"],
"@svml/credential-store-env": ["packages/credential-store-env/src/index.ts"],
"@svml/local": ["packages/local/src/index.ts"],
- "@svml/provider-kit": ["packages/provider-kit/src/index.ts"],
"@svml/generation": ["packages/generation/src/index.ts"],
"@svml/model-kit": ["packages/model-kit/src/index.ts"],
"@svml/seedance": ["packages/seedance/src/index.ts"],
@@ -41,6 +41,7 @@
"@svml/provider-whisperx-local": ["packages/provider-whisperx-local/src/index.ts"],
"@svml/transport-aws-lambda": ["packages/transport-aws-lambda/src/index.ts"],
"@svml/transport-process": ["packages/transport-process/src/index.ts"],
+ "@svml/transport": ["packages/transport/src/index.ts"],
"@svml/speech-program": ["packages/speech-program/src/index.ts"],
"@svml/hyperframes": ["packages/hyperframes/src/index.ts"],
"@svml/hyperframes-render": ["packages/hyperframes-render/src/index.ts"],