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.
TypeScript agentic-aiaiai-agentsai-videocompilerdslffmpeggenerative-aillmmarkup-languagemonorepoplugin-systemprogramming-languagetext-to-videotypescriptvideovideo-automationvideo-clonevideo-editingvideo-generation
refactor(runtime): model shared limits as capacity, not queues
kashorin293ccd177ddc
diff --git a/docs/guide/runtime.md b/docs/guide/runtime.mdindex 896f4191..10ff9cf3 100644--- a/docs/guide/runtime.md+++ b/docs/guide/runtime.md@@ -169,8 +169,10 @@ Runtime pointer, or the entry source directory. Runtime configuration cannot widthe Worker materializes its state only while advancing it and writes accepted facts back immediately.There is no Build concurrency setting and Build identity is not a capacity resource.-The Profile names each Endpoint's pool; the Endpoint package declares the model lanes inside it. Those are the two actual execution queues.-Work from separate Builds shares those exact external capacities. Each resource has one limit: an+Each Endpoint instance is its own capacity pool by default. A Profile may give several Endpoint+instances the same `pool` only when they truly share one account, deployment or compute quota;+Endpoint packages may also apply a narrower exact-model limit. These are capacity claims, not queues.+Work from separate Builds shares only those exact resources. Each resource has one limit: animmediate call releases its slot when it returns, while an asynchronous Operation keeps the same slotuntil it becomes terminal. Unrelated Builds and Commands may advance together.diff --git a/examples/interview/hypit.runtime.json b/examples/interview/hypit.runtime.jsonindex bd2f463b..175f8149 100644--- a/examples/interview/hypit.runtime.json+++ b/examples/interview/hypit.runtime.json@@ -9,7 +9,6 @@"endpoints": {"hypihub.default": {"use": "@hypit/provider-hypihub",- "pool": "generation","config": {"baseUrl": "https://hypit.ai","apiKey": {@@ -22,14 +21,12 @@},"media.local": {"use": "@hypit/provider-media-local",- "pool": "media","config": {"defaultConcurrency": 2}},"hyperframes.local": {"use": "@hypit/provider-hyperframes-local",- "pool": "render","config": {"workers": 2,"quality": "standard",diff --git a/examples/podcast/hypit.runtime.json b/examples/podcast/hypit.runtime.jsonindex 6ab53279..c10b40e7 100644--- a/examples/podcast/hypit.runtime.json+++ b/examples/podcast/hypit.runtime.json@@ -12,7 +12,6 @@"endpoints": {"hypihub.default": {"use": "@hypit/provider-hypihub",- "pool": "generation","config": {"baseUrl": "https://hypit.ai","apiKey": {@@ -25,14 +24,12 @@},"media.local": {"use": "@hypit/provider-media-local",- "pool": "media","config": {"defaultConcurrency": 2}},"hyperframes.local": {"use": "@hypit/provider-hyperframes-local",- "pool": "render","config": {"workers": 2,"quality": "standard",diff --git a/examples/ranking-football/hypit.runtime.json b/examples/ranking-football/hypit.runtime.jsonindex bd2f463b..175f8149 100644--- a/examples/ranking-football/hypit.runtime.json+++ b/examples/ranking-football/hypit.runtime.json@@ -9,7 +9,6 @@"endpoints": {"hypihub.default": {"use": "@hypit/provider-hypihub",- "pool": "generation","config": {"baseUrl": "https://hypit.ai","apiKey": {@@ -22,14 +21,12 @@},"media.local": {"use": "@hypit/provider-media-local",- "pool": "media","config": {"defaultConcurrency": 2}},"hyperframes.local": {"use": "@hypit/provider-hyperframes-local",- "pool": "render","config": {"workers": 2,"quality": "standard",diff --git a/examples/ranking-football/reference-banana-from-swap/hypit.runtime.json b/examples/ranking-football/reference-banana-from-swap/hypit.runtime.jsonindex b16f09b5..581b0c04 100644--- a/examples/ranking-football/reference-banana-from-swap/hypit.runtime.json+++ b/examples/ranking-football/reference-banana-from-swap/hypit.runtime.json@@ -12,7 +12,6 @@"endpoints": {"kie.default": {"use": "@hypit/provider-kie",- "pool": "generation","config": {"apiKey": {"store": "env",@@ -23,21 +22,18 @@},"media.local": {"use": "@hypit/provider-media-local",- "pool": "media","config": {"defaultConcurrency": 2}},"whisperx.local": {"use": "@hypit/provider-whisperx-local",- "pool": "alignment","config": {"defaultConcurrency": 1}},"hyperframes.local": {"use": "@hypit/provider-hyperframes-local",- "pool": "render","config": {"workers": 2,"quality": "standard",diff --git a/examples/ranking-football/reference-banana/hypit.runtime.json b/examples/ranking-football/reference-banana/hypit.runtime.jsonindex 68d09bc0..a2b83a11 100644--- a/examples/ranking-football/reference-banana/hypit.runtime.json+++ b/examples/ranking-football/reference-banana/hypit.runtime.json@@ -9,7 +9,6 @@"endpoints": {"kie.default": {"use": "@hypit/provider-kie",- "pool": "generation","config": {"apiKey": {"store": "os",@@ -20,21 +19,18 @@},"media.local": {"use": "@hypit/provider-media-local",- "pool": "media","config": {"defaultConcurrency": 2}},"whisperx.local": {"use": "@hypit/provider-whisperx-local",- "pool": "alignment","config": {"defaultConcurrency": 1}},"hyperframes.local": {"use": "@hypit/provider-hyperframes-local",- "pool": "render","config": {"workers": 2,"quality": "standard",diff --git a/examples/ranking-football/swap-effect-banana-reference-sync/hypit.runtime.json b/examples/ranking-football/swap-effect-banana-reference-sync/hypit.runtime.jsonindex b16f09b5..581b0c04 100644--- a/examples/ranking-football/swap-effect-banana-reference-sync/hypit.runtime.json+++ b/examples/ranking-football/swap-effect-banana-reference-sync/hypit.runtime.json@@ -12,7 +12,6 @@"endpoints": {"kie.default": {"use": "@hypit/provider-kie",- "pool": "generation","config": {"apiKey": {"store": "env",@@ -23,21 +22,18 @@},"media.local": {"use": "@hypit/provider-media-local",- "pool": "media","config": {"defaultConcurrency": 2}},"whisperx.local": {"use": "@hypit/provider-whisperx-local",- "pool": "alignment","config": {"defaultConcurrency": 1}},"hyperframes.local": {"use": "@hypit/provider-hyperframes-local",- "pool": "render","config": {"workers": 2,"quality": "standard",diff --git a/examples/ranking-football/swap-effect-banana/hypit.runtime.json b/examples/ranking-football/swap-effect-banana/hypit.runtime.jsonindex b16f09b5..581b0c04 100644--- a/examples/ranking-football/swap-effect-banana/hypit.runtime.json+++ b/examples/ranking-football/swap-effect-banana/hypit.runtime.json@@ -12,7 +12,6 @@"endpoints": {"kie.default": {"use": "@hypit/provider-kie",- "pool": "generation","config": {"apiKey": {"store": "env",@@ -23,21 +22,18 @@},"media.local": {"use": "@hypit/provider-media-local",- "pool": "media","config": {"defaultConcurrency": 2}},"whisperx.local": {"use": "@hypit/provider-whisperx-local",- "pool": "alignment","config": {"defaultConcurrency": 1}},"hyperframes.local": {"use": "@hypit/provider-hyperframes-local",- "pool": "render","config": {"workers": 2,"quality": "standard",diff --git a/packages/cli/src/commands/environment.ts b/packages/cli/src/commands/environment.tsindex 78cfcd77..6d02ffb1 100644--- a/packages/cli/src/commands/environment.ts+++ b/packages/cli/src/commands/environment.ts@@ -11,7 +11,6 @@ import { writeCliOutput } from "../output.js";import type { CliIo } from "../output.js";import { hypitHostStateRoot, hypitProjectStateRoot } from "../paths.js";import type { CliRuntimeController } from "../runtime-port.js";-import { queueLaneLines, summarizeQueueLanes } from "../runtime-view.js";import type { OperationalWriter } from "./types.js";export function isEnvironmentCommand(args: CliCommand): args is EnvironmentCommand {@@ -258,7 +257,6 @@ export async function runEnvironmentCommand(input: {item.activity === "ready" || item.activity === "running" || item.activity === "waiting").length],["savingResult", activity.builds.filter((item) => item.activity === "saving-result").length],]);- const lanes = summarizeQueueLanes(activity.capacity);const ready = worker.state === "running"&& external.programs.every((item) => item.state.state === "ready");const active = activity.builds.length;@@ -280,7 +278,6 @@ export async function runEnvironmentCommand(input: {},capacity: {active: activity.capacity.length,- ...(args.presentation.verbose ? { lanes: lanes.slice(0, args.limit) } : {}),},};write(machine, attention@@ -298,7 +295,6 @@ export async function runEnvironmentCommand(input: {] : []),], [...unavailable.slice(0, args.limit).map((item) => `${item.id}: ${item.state.state}`),- ...(args.presentation.verbose ? queueLaneLines(lanes.slice(0, args.limit)) : []),]);} finally {if (runtime !== undefined) await runtime.close();diff --git a/packages/cli/src/commands/execution.ts b/packages/cli/src/commands/execution.tsindex 3cdc642d..4d83be7c 100644--- a/packages/cli/src/commands/execution.ts+++ b/packages/cli/src/commands/execution.ts@@ -5,7 +5,7 @@ import type { CliCommand, ExecutionCommand } from "../command.js";import { activityObservationKey, buildProgressLines, observeBuildView } from "../observation.js";import type { CliIo } from "../output.js";import type { CliRuntimeController } from "../runtime-port.js";-import { formatOperationProgress, queueLaneLines, summarizeQueueLanes } from "../runtime-view.js";+import { formatOperationProgress } from "../runtime-view.js";import { buildStatusView } from "../view.js";import type { OperationalWriter } from "./types.js";@@ -102,7 +102,6 @@ export async function runExecutionCommand(input: {...(status.attention === undefined ? {} : { attention: status.attention }),};});- const lanes = args.presentation.verbose ? summarizeQueueLanes(activity.capacity).slice(0, args.limit) : undefined;const currentView = activityObservationKey(worker.state, activity.builds);if (args.watch && currentView === previous) return;previous = currentView;@@ -113,7 +112,6 @@ export async function runExecutionCommand(input: {builds,...(activity.builds.length <= args.limit ? {} : { omittedBuilds: activity.builds.length - args.limit }),activeRequests: activity.capacity.length,- ...(lanes === undefined ? {} : { lanes }),};const buildLines = activity.builds.slice(0, args.limit).map((item) => {const requestProgress = item.requests === undefined || item.requests.total === 0@@ -139,7 +137,6 @@ export async function runExecutionCommand(input: {], [...buildLines,...(operationLines.length === 0 ? [] : ["Operations:", ...operationLines]),- ...(args.presentation.verbose ? queueLaneLines(lanes ?? []) : []),]);};if (!args.watch) await writeActivity();diff --git a/packages/cli/src/machine-view.ts b/packages/cli/src/machine-view.tsindex a56d70d1..07df77a4 100644--- a/packages/cli/src/machine-view.ts+++ b/packages/cli/src/machine-view.ts@@ -12,7 +12,7 @@ export type OperationalMachineView =| { readonly format: "hypit.cli-runtime-up@2"; readonly ready: boolean; readonly worker: string; readonly preparedPackages: number; readonly programs: { readonly total: number; readonly ready: number } }| { readonly format: "hypit.cli-runtime-logs@2"; readonly lines: readonly string[]; readonly totalLines: number; readonly omittedLines: number; readonly path?: string }| { readonly format: "hypit.cli-runtime-down@2"; readonly worker: string }- | { readonly format: "hypit.cli-runtime-status@2"; readonly ready: boolean; readonly attention: boolean; readonly worker: { readonly state: string; readonly configuration?: string }; readonly builds: Readonly<Record<string, number>>; readonly programs: { readonly total: number; readonly ready: number; readonly unavailable: readonly ProgramStateView[] }; readonly capacity: { readonly active: number; readonly lanes?: readonly { readonly pool: string; readonly lane: string; readonly inFlight: number }[] } }+ | { readonly format: "hypit.cli-runtime-status@2"; readonly ready: boolean; readonly attention: boolean; readonly worker: { readonly state: string; readonly configuration?: string }; readonly builds: Readonly<Record<string, number>>; readonly programs: { readonly total: number; readonly ready: number; readonly unavailable: readonly ProgramStateView[] }; readonly capacity: { readonly active: number } }| { readonly format: "hypit.cli-auth-status@2"; readonly endpoint: string; readonly credentials: readonly { readonly endpoint: string; readonly slot: string; readonly label: string; readonly kind: string; readonly configured: boolean; readonly writable: boolean }[]; readonly omittedCredentials?: number }| { readonly format: "hypit.cli-auth-change@2"; readonly endpoint: string; readonly slot: string; readonly configured: boolean; readonly changed?: boolean }| { readonly format: "hypit.cli-builds@3"; readonly builds: readonly { readonly id: string; readonly createdAt: string; readonly title?: string; readonly outcome: string; readonly run?: string; readonly targetCount: number; readonly targets?: readonly string[]; readonly omittedTargets?: number; readonly outputCount: number }[]; readonly next?: string }@@ -21,7 +21,7 @@ export type OperationalMachineView =| { readonly format: "hypit.cli-result-edit@3"; readonly build: string; readonly title: string | null; readonly note: string | null; readonly highlightedOutputCount: number; readonly highlightedOutputs: readonly string[]; readonly omittedHighlightedOutputs?: number }| { readonly format: "hypit.cli-get@4"; readonly build: string; readonly output: string; readonly type: string; readonly kind: "scalar" | "resource" | "composite"; readonly path: string }| { readonly format: "hypit.cli-status@3"; readonly build: CliBuildStatusView | null }- | { readonly format: "hypit.cli-activity@2"; readonly at: number; readonly worker: string; readonly builds: readonly { readonly id: string; readonly work: CliBuildStatusView["work"]; readonly outcome?: string; readonly attention?: AttentionView }[]; readonly omittedBuilds?: number; readonly activeRequests: number; readonly lanes?: readonly { readonly pool: string; readonly lane: string; readonly inFlight: number }[] }+ | { readonly format: "hypit.cli-activity@2"; readonly at: number; readonly worker: string; readonly builds: readonly { readonly id: string; readonly work: CliBuildStatusView["work"]; readonly outcome?: string; readonly attention?: AttentionView }[]; readonly omittedBuilds?: number; readonly activeRequests: number }| { readonly format: "hypit.cli-result-discard@2"; readonly build: string; readonly discarded: boolean }| { readonly format: "hypit.cli-result-finish@2"; readonly build: string; readonly found?: false; readonly outcome?: string; readonly attention?: AttentionView }| { readonly format: "hypit.cli-cancel@3"; readonly requested: boolean; readonly build: CliBuildStatusView | null }diff --git a/packages/cli/src/runtime-view.ts b/packages/cli/src/runtime-view.tsindex fb5cb36f..6fc14d72 100644--- a/packages/cli/src/runtime-view.ts+++ b/packages/cli/src/runtime-view.ts@@ -1,10 +1,4 @@-import type { CapacityReservation, OperationProgress } from "@hypit/runtime";--export type QueueLaneSummary = {- readonly pool: string;- readonly lane: string;- readonly inFlight: number;-};+import type { OperationProgress } from "@hypit/runtime";export function formatOperationProgress(progress: OperationProgress): string {if (progress.completed === undefined) return progress.phase;@@ -14,36 +8,6 @@ export function formatOperationProgress(progress: OperationProgress): string {return `${progress.phase} · ${amount}${progress.unit === undefined ? "" : ` ${progress.unit}`}`;}-/** Derive the Provider → capability view from generic capacity tickets. */-export function summarizeQueueLanes(capacity: readonly CapacityReservation[]): readonly QueueLaneSummary[] {- const groups = new Map<string, QueueLaneSummary>();- for (const ticket of capacity) {- if (ticket.queue === undefined) continue;- const key = `${ticket.queue.pool}\u0000${ticket.queue.lane}`;- const previous = groups.get(key);- groups.set(key, {- pool: ticket.queue.pool,- lane: ticket.queue.lane,- inFlight: (previous?.inFlight ?? 0) + 1,- });- }- return [...groups.values()].sort((left, right) =>- left.pool.localeCompare(right.pool) || left.lane.localeCompare(right.lane));-}--export function queueLaneLines(groups: readonly QueueLaneSummary[]): readonly string[] {- const lines: string[] = [];- let pool: string | undefined;- for (const group of groups) {- if (group.pool !== pool) {- pool = group.pool;- lines.push(pool);- }- lines.push(` ${group.lane}: ${group.inFlight} remote`);- }- return lines;-}-export function inlineValuePreview(value: unknown, limit = 240): string {const encoded = JSON.stringify(value);if (encoded.length <= limit) return encoded;diff --git a/packages/driver-node/src/driver.ts b/packages/driver-node/src/driver.tsindex e50b475c..f6d10b6d 100644--- a/packages/driver-node/src/driver.ts+++ b/packages/driver-node/src/driver.ts@@ -65,7 +65,6 @@ type Executable =readonly command: FulfillNeedCommand;readonly endpointId: string;readonly resources: readonly import("@hypit/runtime").RuntimeResourceClaim[];- readonly queue?: import("@hypit/runtime").RuntimeQueueLane;readonly registration: EndpointRegistration;};@@ -214,7 +213,6 @@ export class NodeDriver {id: `endpoint:${registration.id}`,limit: 1,}],- ...(registration.scheduling?.queue === undefined ? {} : { queue: registration.scheduling.queue }),registration,},};@@ -294,13 +292,10 @@ export class NodeDriver {if (executable.registration.kind !== "asynchronous") throw new Error("Endpoint is not asynchronous");const operations = this.operations;if (operations === undefined) throw new Error("asynchronous Endpoint requires OperationStore");- if (executable.queue === undefined) throw new Error("asynchronous Endpoint has no Provider pool/lane");const base = {build: context.build,command: executable.command.id,endpoint: executable.endpointId,- pool: executable.queue.pool,- lane: executable.queue.lane,} as const;const history = await operations.list({build: base.build,@@ -481,7 +476,6 @@ export class NodeDriver {runnable: classifications.flatMap(({ executable }) => executable === undefined ? [] : [{command: executable.command,resources: executable.resources,- ...(("queue" in executable && executable.queue !== undefined) ? { queue: executable.queue } : {}),capacityMode: "endpointId" in executable && executable.registration.kind === "asynchronous"? "asynchronous": "active",diff --git a/packages/driver-node/src/registry.ts b/packages/driver-node/src/registry.tsindex 4c9e5014..1eecbf54 100644--- a/packages/driver-node/src/registry.ts+++ b/packages/driver-node/src/registry.ts@@ -47,10 +47,6 @@ function verifyScheduling(scheduling: EndpointScheduling | undefined): void {return resource.id;});if (new Set(ids).size !== ids.length) throw new Error("scheduling resources contain duplicate ids");- if (scheduling.queue !== undefined- && (scheduling.queue.pool.trim().length === 0 || scheduling.queue.lane.trim().length === 0)) {- throw new Error("scheduling queue pool and lane must not be empty");- }}export function producerRegistryKey(ref: ProducerRef): string {diff --git a/packages/driver-node/test/scheduler.test.ts b/packages/driver-node/test/scheduler.test.tsindex 0fd3ed24..fb17225d 100644--- a/packages/driver-node/test/scheduler.test.ts+++ b/packages/driver-node/test/scheduler.test.ts@@ -48,8 +48,6 @@ function memoryOperations(): OperationStore {build: current.build,command: current.command,endpoint: current.endpoint,- pool: current.pool,- lane: current.lane,...structuredClone(update),} as OperationSnapshot;values.set(id, next);@@ -193,7 +191,6 @@ function asyncExecutor(endpoint,{scheduling: {- queue: { pool: "fixture.account", lane: "generation" },resources: [{ id: "pool:fixture.account", limit: 1 },{ id: "lane:fixture.account/generation", limit: 1 },diff --git a/packages/endpoint-kit/README.md b/packages/endpoint-kit/README.mdindex 6502bb2f..f2ad77b0 100644--- a/packages/endpoint-kit/README.md+++ b/packages/endpoint-kit/README.md@@ -7,9 +7,9 @@ endpoint package declares the capabilities it fulfills, its result types, credenlimits, then installs handlers into a Host registrar.Immediate endpoints return a result directly. Asynchronous endpoints implement `start`, `poll` and-optional best effort `cancel`. Provider pool and capability lane limits control concurrency without-changing Core demand. Each resource declares one limit; asynchronous work retains that slot until+optional best effort `cancel`. Provider-total and exact-capability resource limits control concurrency+without changing Core demand. Each resource declares one limit; asynchronous work retains that slot untilits persisted Operation is terminal.Endpoint packages are selected by a Runtime Profile, never activated by author imports. This package-depends on no Node filesystem, queue implementation or video domain.+depends on no Node filesystem, scheduler implementation or video domain.diff --git a/packages/endpoint-kit/src/index.ts b/packages/endpoint-kit/src/index.tsindex 82706c56..da76c5e7 100644--- a/packages/endpoint-kit/src/index.ts+++ b/packages/endpoint-kit/src/index.ts@@ -79,10 +79,6 @@ export type EndpointScheduling = {/** Maximum Commands occupying this active Provider resource across Builds. */readonly limit: number;}[];- readonly queue?: {- readonly pool: string;- readonly lane: string;- };};export type EndpointRegistrationOptions = {@@ -150,9 +146,9 @@ type EndpointCapabilityBase = {readonly capability: CapabilityRef;readonly returns: TypeRef;readonly supports?: (need: Need) => boolean;- /** Stable Provider-local queue lane. Defaults to the capability name. */+ /** Stable Provider-local capacity class. Defaults to the capability name. */readonly lane?: string;- /** Lane capacity; the Provider pool keeps its independent total capacity. */+ /** Exact-capability capacity; the Provider pool keeps its independent total capacity. */readonly maxConcurrency?: number;};@@ -180,7 +176,7 @@ export type DefineEndpointPackageOptions = {readonly kind?: "secret" | "json";readonly acquisition?: CredentialAcquisition;}>>;- /** Total capacity shared by every lane under this configured Provider pool. */+ /** Total capacity shared by every capability under this configured Provider pool. */readonly defaultConcurrency?: number;/** The Provider's own price page, or `local` for work that runs on this machine without a charge. */readonly pricing?: EndpointPricing;@@ -285,7 +281,6 @@ export function defineEndpointPackage(options: DefineEndpointPackageOptions): En...(capability.supports === undefined ? {} : { supports: capability.supports }),credentials,scheduling: {- queue: { pool: options.pool, lane },resources: [{id: `pool:${options.pool}`,diff --git a/packages/endpoint-kit/test/endpoint.test.ts b/packages/endpoint-kit/test/endpoint.test.tsindex 3c486772..6f1b221d 100644--- a/packages/endpoint-kit/test/endpoint.test.ts+++ b/packages/endpoint-kit/test/endpoint.test.ts@@ -70,7 +70,6 @@ test("one Endpoint definition generates one configured instance and host-neutralapiKey: credentialRef("env", "EXAMPLE_API_KEY"),});assert.deepEqual(registrations[0]?.options.scheduling, {- queue: { pool: "example.personal", lane: "text-generation" },resources: [{ id: "pool:example.personal", limit: 3 },{ id: "lane:example.personal/text-generation", limit: 1 },diff --git a/packages/provider-hyperframes-local/README.md b/packages/provider-hyperframes-local/README.mdindex 222a1e05..507fc2ac 100644--- a/packages/provider-hyperframes-local/README.md+++ b/packages/provider-hyperframes-local/README.md@@ -9,7 +9,7 @@ content identity or hidden output metadata.There are deliberately two concurrency controls:-- `defaultConcurrency` limits whole render requests admitted by Runtime pool/lane resources.+- `defaultConcurrency` limits whole render requests admitted by the Endpoint's Runtime capacity resource.- `workers` controls HyperFrames' parallel Chrome frame workers inside one admitted render.The Provider owns both controls because they are deployment policy, not author intent. It neverdiff --git a/packages/provider-image-opencv-local/README.md b/packages/provider-image-opencv-local/README.mdindex 12e474a1..9e1a9904 100644--- a/packages/provider-image-opencv-local/README.md+++ b/packages/provider-image-opencv-local/README.md@@ -13,4 +13,4 @@ Adapter's declared configuration, `programs up` installs it only when the machinhealthy environment; the Endpoint, program probe and doctor all resolve the shared `.venv`interpreter. An explicit `pythonExecutable` selects an operator-managed compatible environment andsuppresses the managed installation. The Endpoint call and-inner image work share the configured pool/lane resources; no separate queue is hidden in this package.+inner image work share the configured capacity resources; no separate scheduler is hidden in this package.diff --git a/packages/provider-kie/README.md b/packages/provider-kie/README.mdindex 901b4015..abd97b69 100644--- a/packages/provider-kie/README.md+++ b/packages/provider-kie/README.md@@ -44,7 +44,6 @@ Declarative activation names an ordinary CredentialRef, not an environment-speci```json"kie.personal": {"use": "@hypit/provider-kie",- "pool": "generation","config": {"apiKey": { "store": "os", "key": "kie.api-key" },"defaultConcurrency": 8,@@ -75,11 +74,13 @@ const kie = createKieProvider({});```-`defaultConcurrency` is the total KIE pool capacity shared by all Builds. Each optional-`laneConcurrency` entry limits one exact KIE model lane inside that total. There is no cross-Provider-`seedance` family queue: another Provider owns another pool and its own independently named-lanes. A task acquires its pool and lane capacity together, so it is queued once rather than-copied between parent and child queues.+`defaultConcurrency` is the total capacity of this configured KIE Endpoint across all Builds. Each+optional `laneConcurrency` entry narrows the capacity of one exact KIE model inside that total. By+default the Endpoint instance is the shared-resource identity. Set Profile `pool` only when multiple+Endpoint instances really use the same account or deployment quota. Another Provider is independent+unless the Profile explicitly gives it that same real-resource identity.+One task acquires its total and model-specific capacity claims atomically. These are shared-resource+limits, not parent and child queues.An advanced embedding adds `kie` to its Endpoint list beside a complete, explicit set of Runtimeservice packages and selections. The `.svml` Module Closure separately contains only the model@@ -96,8 +97,8 @@ Manifests actually imported by the author document; installing KIE does not add4. Successful result URLs are converted to short-lived download URLs, bounded while streaming,immediately written into that Build's working byte area, and removed from durableresult metadata.-5. The selected Runtime Execution Store owns shared Build capacity. This Provider contributes one KIE- pool plus exact capability lanes and a conservative create-task interval; it does not introduce Redis or another source of+5. The selected Runtime Execution Store owns shared capacity across Builds. This Provider contributes+ one KIE-total claim plus narrower exact-capability claims and a conservative create-task interval; it does not introduce Redis or another source ofBuild truth.The automated suite uses an adversarial fake KIE service. It covers submission ambiguity,diff --git a/packages/provider-kie/test/provider.test.ts b/packages/provider-kie/test/provider.test.tsindex 4ac407b7..7afacff4 100644--- a/packages/provider-kie/test/provider.test.ts+++ b/packages/provider-kie/test/provider.test.ts@@ -56,7 +56,7 @@ function operation(_request: Need): string {return "operation:kie-test";}-test("all KIE capabilities share one asynchronous task engine and differ only by Lane", async () => {+test("all KIE capabilities share one asynchronous task engine and use exact-model capacity", async () => {const provider = createKieProvider({fetch: async () => { throw new Error("no request expected"); },defaultConcurrency: 8,@@ -78,7 +78,6 @@ test("all KIE capabilities share one asynchronous task engine and differ only byassert.equal(removalResolution.registration.kind, "asynchronous");assert.equal(seedResolution.registration.endpoint, removalResolution.registration.endpoint);assert.deepEqual(seedResolution.registration.scheduling, {- queue: { pool: "kie.default", lane: "seedance-2-mini" },resources: [{ id: "pool:kie.default", limit: 8 },{ id: "lane:kie.default/seedance-2-mini", limit: 4 },diff --git a/packages/provider-vertex/README.md b/packages/provider-vertex/README.mdindex ff64a77e..58c5a22f 100644--- a/packages/provider-vertex/README.md+++ b/packages/provider-vertex/README.md@@ -14,7 +14,6 @@ owns the Google GenAI client, credential parsing and the Vertex model ids."endpoints": {"vertex.default": {"use": "@hypit/provider-vertex",- "pool": "generation","config": {"project": { "store": "env", "key": "GOOGLE_CLOUD_PROJECT" },"credentials": { "store": "env", "key": "GOOGLE_APPLICATION_CREDENTIALS_JSON" },diff --git a/packages/provider-xiaomi-mimo/README.md b/packages/provider-xiaomi-mimo/README.mdindex 9ccac1cd..602d9dce 100644--- a/packages/provider-xiaomi-mimo/README.md+++ b/packages/provider-xiaomi-mimo/README.md@@ -27,5 +27,5 @@ The Provider always requests final WAV bytes. Streaming is a service transport onot part of the author model.Selecting the Provider in the Runtime Profile activates it independently from author model syntax.-It declares default concurrency on its pool and exact capability lanes. The shared-Scheduler owns queuing across Builds; this package does not create a private queue.+It declares total and exact-capability concurrency resources. The shared Runtime coordinates those+claims across Builds; this package does not create a private scheduler.diff --git a/packages/runtime-local/README.md b/packages/runtime-local/README.mdindex 03c5dbfc..d550a4a0 100644--- a/packages/runtime-local/README.md+++ b/packages/runtime-local/README.md@@ -46,9 +46,10 @@ A project that wants a non-default Result repository owns a separate `hypit.resu```Submitting a Build stores it and returns. The Worker may advance unrelated Builds together; only the-resources declared by their Commands constrain execution. The Profile names each Endpoint's-pool; Endpoint packages declare the model lanes inside it, and those limits govern actual external work. Build identity is not a capacity-resource and creates no second queue.+resources declared by their Commands constrain execution. An Endpoint instance owns its capacity by+default. A Profile `pool` is only for instances that really share one account, deployment or compute+quota; exact-model limits may narrow it further. Build identity is not a capacity resource and creates+no second queue.Cancellation prevents new work and makes a best effort to cancel an external operation already submitted;completed output is never rolled back.diff --git a/packages/runtime-local/src/worker.ts b/packages/runtime-local/src/worker.tsindex daadaa5a..8f07f8de 100644--- a/packages/runtime-local/src/worker.ts+++ b/packages/runtime-local/src/worker.ts@@ -147,7 +147,6 @@ class CapacityExecutor implements RuntimeCommandExecutor {build: context.build,command: descriptor.command.id,resources,- ...(descriptor.queue === undefined ? {} : { queue: descriptor.queue }),now: Date.now(),});if (acquired.status === "blocked") {diff --git a/packages/runtime/src/capacity.ts b/packages/runtime/src/capacity.tsindex 46bb0348..0f3bcfd5 100644--- a/packages/runtime/src/capacity.ts+++ b/packages/runtime/src/capacity.ts@@ -9,10 +9,6 @@ export type CapacityReservation = {readonly build: string;readonly command: string;readonly resources: readonly CapacityResourceClaim[];- readonly queue?: {- readonly pool: string;- readonly lane: string;- };readonly createdAt: number;};@@ -20,7 +16,6 @@ export type CapacityAcquireRequest = {readonly build: string;readonly command: string;readonly resources: readonly CapacityResourceClaim[];- readonly queue?: CapacityReservation["queue"];readonly now: number;};diff --git a/packages/runtime/src/operations.ts b/packages/runtime/src/operations.tsindex b4e3943c..24e1a30b 100644--- a/packages/runtime/src/operations.ts+++ b/packages/runtime/src/operations.ts@@ -8,8 +8,6 @@ export type OperationIdentity = {readonly build: string;readonly command: string;readonly endpoint: string;- readonly pool: string;- readonly lane: string;};export type OperationCompletion = {diff --git a/packages/runtime/src/types.ts b/packages/runtime/src/types.tsindex 88d6ec91..87281268 100644--- a/packages/runtime/src/types.ts+++ b/packages/runtime/src/types.ts@@ -19,7 +19,6 @@ export type RuntimeRunnableCommand = {readonly command: CoreCommand;/** Every resource is acquired atomically before the command can cause a side effect. */readonly resources: readonly RuntimeResourceClaim[];- readonly queue?: RuntimeQueueLane;/** Asynchronous work retains one shared in-flight reservation while polling. */readonly capacityMode?: "active" | "asynchronous";};@@ -29,11 +28,6 @@ export type RuntimeResourceClaim = {readonly limit: number;};-export type RuntimeQueueLane = {- readonly pool: string;- readonly lane: string;-};-export type RuntimeWorkerRunOptions = {readonly idlePollMs: number;readonly signal?: AbortSignal;diff --git a/packages/store-sqlite/README.md b/packages/store-sqlite/README.mdindex 663f89ad..a4bbab23 100644--- a/packages/store-sqlite/README.md+++ b/packages/store-sqlite/README.md@@ -2,7 +2,7 @@Private durable state used by `@hypit/runtime-local`.-One SQLite file stores Build facts, external Operations, the Build queue, active capacity reservations+One SQLite file stores Build facts, external Operations, the active Build work set, capacity reservationsand a small output catalog. No ready-command queue is stored: Core derives ready work from the savedBuild facts whenever the Worker advances it.diff --git a/packages/store-sqlite/src/store.ts b/packages/store-sqlite/src/store.tsindex 01b3faab..210b087d 100644--- a/packages/store-sqlite/src/store.ts+++ b/packages/store-sqlite/src/store.ts@@ -89,13 +89,11 @@ function operationIdentityFrom(snapshot: OperationSnapshot): OperationIdentity {build: snapshot.build,command: snapshot.command,endpoint: snapshot.endpoint,- pool: snapshot.pool,- lane: snapshot.lane,};}function parseOperationSnapshot(row: Row): OperationSnapshot {- for (const field of ["operation_id", "build_id", "command_id", "endpoint_id", "pool_id", "lane_id"] as const) {+ for (const field of ["operation_id", "build_id", "command_id", "endpoint_id"] as const) {assert(typeof row[field] === "string", `SQLite Operation row has no ${field}`);}assert(typeof row.status === "string", "SQLite Operation row has no status");@@ -121,8 +119,6 @@ function parseOperationSnapshot(row: Row): OperationSnapshot {build: row.build_id,command: row.command_id,endpoint: row.endpoint_id,- pool: row.pool_id,- lane: row.lane_id,status: row.status,...mutable,} as OperationSnapshot;@@ -371,18 +367,17 @@ class SqliteOperationStore implements OperationStore {: operation.status === "failed" ? JSON.stringify(operation.failure) : null;const result = this.#database.prepare(`INSERT INTO hypit_operations (- operation_id, build_id, command_id, endpoint_id, pool_id, lane_id, status,+ operation_id, build_id, command_id, endpoint_id, status,payload_json- ) VALUES (?, ?, ?, ?, ?, ?, ?, ?)- `).run(identity.id, identity.build, identity.command, identity.endpoint, identity.pool, identity.lane,- operation.status, payload);+ ) VALUES (?, ?, ?, ?, ?, ?)+ `).run(identity.id, identity.build, identity.command, identity.endpoint, operation.status, payload);if (result.changes !== 1) throw new Error(`Operation ${identity.id} was not created`);return copy(operation);}async read(id: string): Promise<OperationSnapshot | undefined> {const row = this.#database.prepare(`- SELECT operation_id, build_id, command_id, endpoint_id, pool_id, lane_id,+ SELECT operation_id, build_id, command_id, endpoint_id,status, payload_jsonFROM hypit_operationsWHERE operation_id = ?@@ -407,7 +402,7 @@ class SqliteOperationStore implements OperationStore {values.push(value);}const rows = this.#database.prepare(`- SELECT operation_id, build_id, command_id, endpoint_id, pool_id, lane_id,+ SELECT operation_id, build_id, command_id, endpoint_id,status, payload_jsonFROM hypit_operations${predicates.length === 0 ? "" : `WHERE ${predicates.join(" AND ")}`}@@ -896,7 +891,6 @@ class SqliteBuildExecutionStore implements BuildExecutionStore {build: request.build,command: request.command,resources,- ...(request.queue === undefined ? {} : { queue: request.queue }),createdAt: request.now,};return transaction(this.#database, () => {@@ -924,13 +918,12 @@ class SqliteBuildExecutionStore implements BuildExecutionStore {}this.#database.prepare(`INSERT INTO hypit_capacity (- build_id, command_id, resources_json, queue_json, created_at- ) VALUES (?, ?, ?, ?, ?)+ build_id, command_id, resources_json, created_at+ ) VALUES (?, ?, ?, ?)`).run(reservation.build,reservation.command,JSON.stringify(reservation.resources),- reservation.queue === undefined ? null : JSON.stringify(reservation.queue),reservation.createdAt,);return { status: "acquired", reservation };@@ -990,9 +983,6 @@ function parseCapacityReservation(row: Row): CapacityReservation {build: row.build_id,command: row.command_id,resources,- ...(typeof row.queue_json === "string"- ? { queue: JSON.parse(row.queue_json) as NonNullable<CapacityReservation["queue"]> }- : {}),createdAt: row.created_at,};return value;@@ -1044,8 +1034,6 @@ export class SqliteRuntimeState {build_id TEXT NOT NULL,command_id TEXT NOT NULL,endpoint_id TEXT NOT NULL,- pool_id TEXT NOT NULL,- lane_id TEXT NOT NULL,status TEXT NOT NULL CHECK (status IN ('pending', 'completed', 'failed', 'cancelled')),payload_json TEXT) STRICT;@@ -1095,7 +1083,6 @@ export class SqliteRuntimeState {build_id TEXT NOT NULL,command_id TEXT NOT NULL,resources_json TEXT NOT NULL,- queue_json TEXT,created_at INTEGER NOT NULL,PRIMARY KEY (build_id, command_id)) STRICT;diff --git a/packages/store-sqlite/test/store.test.ts b/packages/store-sqlite/test/store.test.tsindex 64f30e3e..0106280d 100644--- a/packages/store-sqlite/test/store.test.ts+++ b/packages/store-sqlite/test/store.test.ts@@ -61,8 +61,6 @@ test("SQLite stores verified Build facts and Operation handles across reopen", abuild: "video",command: "command:generation",endpoint: "kie.personal",- pool: "kie.personal",- lane: "fixture.generation",};const pending = await first.operations.create({ ...operation,status: "pending",@@ -104,8 +102,6 @@ test("SQLite Operation updates preserve a terminal completion", async () => {build: "video",command: "command:render",endpoint: "hyperframes.lambda",- pool: "hyperframes.lambda",- lane: "fixture.render",};const completed = await state.operations.create({ ...identity,status: "completed",@@ -254,7 +250,7 @@ test("a new Worker reclaims abandoned turns and Result-writer leases without ext}});-test("Pool and Lane limits count only asynchronous Operations still in flight", async () => {+test("shared capacity resources are acquired atomically across Builds", async () => {const directory = await mkdtemp(join(tmpdir(), "hypit-sqlite-hierarchy-"));try {const state = new SqliteRuntimeState(join(directory, "runtime.sqlite"));@@ -266,7 +262,6 @@ test("Pool and Lane limits count only asynchronous Operations still in flight",build: "seedance-a",command: "generate:a",resources: [pool, seedance],- queue: { pool: "kie.main", lane: "seedance-2-mini" },now: 100,});assert.equal(first.status, "acquired");@@ -275,7 +270,6 @@ test("Pool and Lane limits count only asynchronous Operations still in flight",build: "seedance-b",command: "generate:b",resources: [pool, seedance],- queue: { pool: "kie.main", lane: "seedance-2-mini" },now: 102,});assert.deepEqual(sameRoute, {@@ -289,11 +283,18 @@ test("Pool and Lane limits count only asynchronous Operations still in flight",build: "minimax-a",command: "generate:c",resources: [pool, minimax],- queue: { pool: "kie.main", lane: "minimax-h3" },now: 103,});assert.equal(otherRoute.status, "acquired");+ const independentProvider = await state.execution.acquireCapacity({+ build: "vertex-a",+ command: "observe:a",+ resources: [{ id: "pool:vertex.main", limit: 1 }],+ now: 103,+ });+ assert.equal(independentProvider.status, "acquired");+if (first.status === "acquired") {await state.execution.releaseCapacity(first.reservation.build, first.reservation.command);}@@ -301,7 +302,6 @@ test("Pool and Lane limits count only asynchronous Operations still in flight",build: "seedance-b",command: "generate:b",resources: [pool, seedance],- queue: { pool: "kie.main", lane: "seedance-2-mini" },now: 104,});assert.equal(retried.status, "acquired");diff --git a/packages/video-cli/src/distribution.ts b/packages/video-cli/src/distribution.tsindex 9e39ff56..820458ce 100644--- a/packages/video-cli/src/distribution.ts+++ b/packages/video-cli/src/distribution.ts@@ -28,7 +28,6 @@ export const videoCliDistribution: CliDistribution = {endpoints: {"hypihub.default": {use: "@hypit/provider-hypihub",- pool: "generation",config: {baseUrl: "https://hypit.ai",apiKey: { store: "os", key: "hypihub.oauth" },@@ -36,11 +35,9 @@ export const videoCliDistribution: CliDistribution = {},"media.local": {use: "@hypit/provider-media-local",- pool: "media",},"hyperframes.local": {use: "@hypit/provider-hyperframes-local",- pool: "render",},},},