@tanstack/ai 0.53.0 → 0.55.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -13
- package/dist/esm/activities/chat/index.js +22 -4
- package/dist/esm/activities/chat/index.js.map +1 -1
- package/dist/esm/activities/chat/messages.d.ts +21 -1
- package/dist/esm/activities/chat/messages.js +50 -1
- package/dist/esm/activities/chat/messages.js.map +1 -1
- package/dist/esm/activities/chat/stream/processor.d.ts +17 -0
- package/dist/esm/activities/chat/stream/processor.js +27 -0
- package/dist/esm/activities/chat/stream/processor.js.map +1 -1
- package/dist/esm/activities/generateLiveVideo/adapter.d.ts +69 -0
- package/dist/esm/activities/generateLiveVideo/adapter.js +23 -0
- package/dist/esm/activities/generateLiveVideo/adapter.js.map +1 -0
- package/dist/esm/activities/generateLiveVideo/index.d.ts +99 -0
- package/dist/esm/activities/generateLiveVideo/index.js +162 -0
- package/dist/esm/activities/generateLiveVideo/index.js.map +1 -0
- package/dist/esm/activities/generateVideo/index.js +3 -1
- package/dist/esm/activities/generateVideo/index.js.map +1 -1
- package/dist/esm/activities/generateWorld/adapter.d.ts +69 -0
- package/dist/esm/activities/generateWorld/adapter.js +23 -0
- package/dist/esm/activities/generateWorld/adapter.js.map +1 -0
- package/dist/esm/activities/generateWorld/index.d.ts +99 -0
- package/dist/esm/activities/generateWorld/index.js +162 -0
- package/dist/esm/activities/generateWorld/index.js.map +1 -0
- package/dist/esm/activities/index.d.ts +8 -2
- package/dist/esm/activities/index.js +11 -7
- package/dist/esm/activities/middleware/types.d.ts +1 -1
- package/dist/esm/client.d.ts +4 -2
- package/dist/esm/client.js +3 -1
- package/dist/esm/client.js.map +1 -1
- package/dist/esm/index.d.ts +4 -2
- package/dist/esm/index.js +3 -1
- package/dist/esm/middlewares/otel.js +3 -1
- package/dist/esm/middlewares/otel.js.map +1 -1
- package/dist/esm/types.d.ts +112 -0
- package/package.json +3 -3
- package/skills/ai-core/adapter-configuration/SKILL.md +91 -43
- package/skills/ai-core/adapter-configuration/references/anthropic-adapter.md +39 -21
- package/skills/ai-core/adapter-configuration/references/byteplus-adapter.md +5 -0
- package/skills/ai-core/adapter-configuration/references/gemini-adapter.md +14 -6
- package/skills/ai-core/adapter-configuration/references/grok-adapter.md +33 -25
- package/skills/ai-core/adapter-configuration/references/groq-adapter.md +7 -2
- package/skills/ai-core/adapter-configuration/references/ollama-adapter.md +25 -12
- package/skills/ai-core/adapter-configuration/references/openai-adapter.md +19 -9
- package/skills/ai-core/adapter-configuration/references/openrouter-adapter.md +34 -21
- package/skills/ai-core/ag-ui-protocol/SKILL.md +16 -10
- package/skills/ai-core/chat-experience/SKILL.md +228 -108
- package/skills/ai-core/client-persistence/SKILL.md +21 -9
- package/skills/ai-core/custom-backend-integration/SKILL.md +86 -52
- package/skills/ai-core/debug-logging/SKILL.md +100 -18
- package/skills/ai-core/locks/SKILL.md +35 -7
- package/skills/ai-core/media-generation/SKILL.md +136 -61
- package/skills/ai-core/middleware/SKILL.md +174 -69
- package/skills/ai-core/structured-outputs/SKILL.md +98 -49
- package/skills/ai-core/tool-calling/SKILL.md +245 -158
- package/src/activities/chat/index.ts +29 -7
- package/src/activities/chat/messages.ts +60 -0
- package/src/activities/chat/stream/processor.ts +31 -0
- package/src/activities/generateLiveVideo/adapter.ts +99 -0
- package/src/activities/generateLiveVideo/index.ts +339 -0
- package/src/activities/generateVideo/index.ts +3 -4
- package/src/activities/generateWorld/adapter.ts +96 -0
- package/src/activities/generateWorld/index.ts +339 -0
- package/src/activities/index.ts +44 -0
- package/src/activities/middleware/types.ts +2 -0
- package/src/client.ts +8 -0
- package/src/index.ts +8 -0
- package/src/middlewares/otel.ts +2 -0
- package/src/types.ts +128 -0
package/src/types.ts
CHANGED
|
@@ -2218,6 +2218,134 @@ export interface VideoUrlResult {
|
|
|
2218
2218
|
artifacts?: Array<PersistedArtifactRef>
|
|
2219
2219
|
}
|
|
2220
2220
|
|
|
2221
|
+
// ============================================================================
|
|
2222
|
+
// World Generation Types (Experimental)
|
|
2223
|
+
// ============================================================================
|
|
2224
|
+
|
|
2225
|
+
/**
|
|
2226
|
+
* Options for world generation (live, prompt-steerable sessions).
|
|
2227
|
+
*
|
|
2228
|
+
* @experimental World generation is an experimental feature and may change.
|
|
2229
|
+
*/
|
|
2230
|
+
export interface WorldGenerationOptions<
|
|
2231
|
+
TProviderOptions extends object = object,
|
|
2232
|
+
> {
|
|
2233
|
+
/** The model to use for world generation */
|
|
2234
|
+
model: string
|
|
2235
|
+
/** Natural-language description of the world or scene */
|
|
2236
|
+
prompt: string
|
|
2237
|
+
/**
|
|
2238
|
+
* Provider mint options. Reactor resolution/seed/audio are browser
|
|
2239
|
+
* `sendCommand` fields, not token-mint fields.
|
|
2240
|
+
*/
|
|
2241
|
+
modelOptions?: TProviderOptions
|
|
2242
|
+
/**
|
|
2243
|
+
* Internal logger threaded from the generateWorld() entry point. Adapters
|
|
2244
|
+
* must call logger.request() before the SDK call and logger.errors() in
|
|
2245
|
+
* catch blocks.
|
|
2246
|
+
*/
|
|
2247
|
+
logger: InternalLogger
|
|
2248
|
+
/**
|
|
2249
|
+
* Effective abort signal composed by the activity from caller `abortSignal`
|
|
2250
|
+
* and/or `timeout`. Adapters should forward this to the provider SDK when
|
|
2251
|
+
* supported. Request-specific — never store on a global client config.
|
|
2252
|
+
*/
|
|
2253
|
+
abortSignal?: AbortSignal
|
|
2254
|
+
}
|
|
2255
|
+
|
|
2256
|
+
/**
|
|
2257
|
+
* Result of world generation. JSON-serializable so a server route can return
|
|
2258
|
+
* it to a browser. The browser uses `token` + `model` to open the live
|
|
2259
|
+
* session (set the prompt, start streaming, steer mid-run).
|
|
2260
|
+
*
|
|
2261
|
+
* @experimental World generation is an experimental feature and may change.
|
|
2262
|
+
*/
|
|
2263
|
+
export interface WorldGenerationResult {
|
|
2264
|
+
/** Unique identifier for this generation */
|
|
2265
|
+
id: string
|
|
2266
|
+
/** Model used for generation (provider connect slug) */
|
|
2267
|
+
model: string
|
|
2268
|
+
/** Short-lived session token for the client connection */
|
|
2269
|
+
token: string
|
|
2270
|
+
/** Token expiry as milliseconds since epoch */
|
|
2271
|
+
expiresAt: number
|
|
2272
|
+
/** Prompt the client should send when it starts the session */
|
|
2273
|
+
prompt: string
|
|
2274
|
+
/** Session status after the server half finishes */
|
|
2275
|
+
status: 'ready' | 'waiting'
|
|
2276
|
+
/** Provider session id, when the adapter created one */
|
|
2277
|
+
sessionId?: string
|
|
2278
|
+
/** Token usage / billing, when the adapter can report it */
|
|
2279
|
+
usage?: TokenUsage
|
|
2280
|
+
}
|
|
2281
|
+
|
|
2282
|
+
// ============================================================================
|
|
2283
|
+
// Live Generation Types (Experimental)
|
|
2284
|
+
// ============================================================================
|
|
2285
|
+
|
|
2286
|
+
/**
|
|
2287
|
+
* Options for live generation (prompt-steerable video sessions).
|
|
2288
|
+
*
|
|
2289
|
+
* @experimental Live generation is an experimental feature and may change.
|
|
2290
|
+
*/
|
|
2291
|
+
export interface LiveVideoGenerationOptions<
|
|
2292
|
+
TProviderOptions extends object = object,
|
|
2293
|
+
> {
|
|
2294
|
+
/** The model to use for live generation */
|
|
2295
|
+
model: string
|
|
2296
|
+
/** Natural-language description of the shot or scene */
|
|
2297
|
+
prompt: string
|
|
2298
|
+
/**
|
|
2299
|
+
* Provider mint options. For fal live this is `tokenDuration`. Reactor
|
|
2300
|
+
* resolution/seed/audio are browser `sendCommand` fields.
|
|
2301
|
+
*/
|
|
2302
|
+
modelOptions?: TProviderOptions
|
|
2303
|
+
/**
|
|
2304
|
+
* Internal logger threaded from the generateLiveVideo() entry point. Adapters
|
|
2305
|
+
* must call logger.request() before the SDK call and logger.errors() in
|
|
2306
|
+
* catch blocks.
|
|
2307
|
+
*/
|
|
2308
|
+
logger: InternalLogger
|
|
2309
|
+
/**
|
|
2310
|
+
* Effective abort signal composed by the activity from caller `abortSignal`
|
|
2311
|
+
* and/or `timeout`. Adapters should forward this to the provider SDK when
|
|
2312
|
+
* supported. Request-specific — never store on a global client config.
|
|
2313
|
+
*/
|
|
2314
|
+
abortSignal?: AbortSignal
|
|
2315
|
+
}
|
|
2316
|
+
|
|
2317
|
+
/**
|
|
2318
|
+
* Result of live generation. JSON-serializable so a server route can return
|
|
2319
|
+
* it to a browser.
|
|
2320
|
+
*
|
|
2321
|
+
* Reactor: connect with `token` and `model` (the connect slug).
|
|
2322
|
+
* fal: `model` is the WMA app id. Open `wma(model)` through a server proxy
|
|
2323
|
+
* that attaches `FAL_KEY`. Do not send `token` as Key credentials.
|
|
2324
|
+
*
|
|
2325
|
+
* @experimental Live generation is an experimental feature and may change.
|
|
2326
|
+
*/
|
|
2327
|
+
export interface LiveVideoGenerationResult {
|
|
2328
|
+
/** Unique identifier for this generation */
|
|
2329
|
+
id: string
|
|
2330
|
+
/**
|
|
2331
|
+
* Connect id for the browser client. Reactor: `reactor/helios`.
|
|
2332
|
+
* fal: WMA app id `fal-ai/minimax-h3-max-director`.
|
|
2333
|
+
*/
|
|
2334
|
+
model: string
|
|
2335
|
+
/** Short-lived session token. Reactor uses this to connect. fal does not. */
|
|
2336
|
+
token: string
|
|
2337
|
+
/** Token expiry as milliseconds since epoch */
|
|
2338
|
+
expiresAt: number
|
|
2339
|
+
/** Prompt the client should send when it starts the session */
|
|
2340
|
+
prompt: string
|
|
2341
|
+
/** Session status after the server half finishes */
|
|
2342
|
+
status: 'ready' | 'waiting'
|
|
2343
|
+
/** Provider session id, when the adapter created one */
|
|
2344
|
+
sessionId?: string
|
|
2345
|
+
/** Token usage / billing, when the adapter can report it */
|
|
2346
|
+
usage?: TokenUsage
|
|
2347
|
+
}
|
|
2348
|
+
|
|
2221
2349
|
// ============================================================================
|
|
2222
2350
|
// Text-to-Speech (TTS) Types
|
|
2223
2351
|
// ============================================================================
|