| Entrypoint | Purpose |
|---|---|
aigc-provider-runtime-kit |
Combined runtime exports |
aigc-provider-runtime-kit/core |
Provider, model, schema, and request body helpers |
aigc-provider-runtime-kit/runninghub |
RunningHub catalog, descriptor, client, and key-pool helpers |
aigc-provider-runtime-kit/runtime |
Explicit combined runtime exports |
Returns a practical default parameter schema for image, video, audio, or chat models.
Accepts an object or JSON string and returns a safe model parameter schema. Invalid input returns an empty object.
Combines default model parameters with user or admin supplied overrides.
Converts a parameter schema into UI-friendly metadata such as aspect ratios, default size, duration options, reference support, and input capability flags.
Expands a duration range into sorted duration options.
Checks whether a provider request mode should be treated as multipart form data.
Builds a FormData request body from scalar fields and file URL or data URL fields.
Return structured validation results with field paths, issue codes, and messages for provider or model configuration.
Creates an immutable provider/model registry after validating URLs, protocols, capabilities, duplicate IDs, and provider references. Invalid input throws ProviderRegistryValidationError with an issues array.
Runs an asynchronous operation with bounded exponential backoff, optional jitter, cancellation, custom retry decisions, and retry callbacks.
Creates a dependency-free JSON client for OpenAI-compatible APIs. It exposes request(path, body), createChatCompletion(body), and createImage(body). Request timeout, cancellation, custom headers, and opt-in retry policy are supported.
Failures use OpenAICompatibleError; isOpenAICompatibleError(value) safely narrows unknown errors.
Converts RunningHub field definitions into reusable host-app input slot definitions.
Builds a host-app execution descriptor for RunningHub App or Workflow entries.
Normalizes a source catalog record into a complete RunningHub catalog item.
Creates a minimal RunningHub submit/poll client. Host applications should wrap this client with their own permission, quota, credential, and audit layers.
Client options include requestTimeoutMs for individual HTTP requests and taskTimeoutMs for the complete polling lifecycle. Both have bounded defaults. runTask also accepts a per-task timeoutMs and an AbortSignal through signal.
RunningHub failures use a typed error with code, stage, optional HTTP status, and a retryable hint. Codes distinguish invalid configuration/input, cancellation, request or response failures, upstream rejection, task failure/timeout, unknown status, and missing output.
Extracts image, video, and audio URLs from nested RunningHub result payloads.
Provide key-pool concurrency helpers against a Redis-like runtime interface.
acquireRunningHubKey accepts an optional leaseSeconds value between 30 seconds and 24 hours. Successful acquisitions refresh the counter lease.
Orders enabled keys by preferred key, default key, then other enabled keys.
Creates the unified execution entrypoint. It resolves enabled provider/model records, validates model input, selects the first supporting adapter, propagates cancellation and timeout signals, emits lifecycle events, and normalizes provider/model identity in the result.
Adapters implement supports(provider, model) and execute(context). Adapter context includes provider/model definitions, validated input, cancellation signal, timeout, metadata, and a progress emitter.
Adapts the OpenAI-compatible client to unified runtime results. Chat text, image URLs/base64 data, and token usage are normalized automatically. Video/audio endpoints can be supplied through endpoints.
Adapts a RunningHub client to the unified runtime. It supports a custom resolveRunInput function or model advancedConfig.runninghub with target IDs and an input fieldMap.
Validates required fields, scalar/array types, allowed options, numeric ranges, list maximums, and declared input capabilities.
Distinguish missing/disabled configuration, provider-model mismatch, invalid input, missing adapters, adapter failures, and aborted/timed-out executions.
An optional hooks.onEvent handler receives started, validated, adapter-selected, progress, success, and failure events. Hook failures are isolated and never change execution behavior.
This is a 0.2.x pre-1.0 API. The unified runtime is ready for application integration, but breaking improvements remain possible before 1.0.