lumiverse-spindle-types 0.6.1 → 0.6.2
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/package.json +1 -1
- package/src/api.ts +1 -1
- package/src/spindle-api.ts +16 -2
package/package.json
CHANGED
package/src/api.ts
CHANGED
|
@@ -2824,7 +2824,7 @@ export type WorkerToHost =
|
|
|
2824
2824
|
keys: string[];
|
|
2825
2825
|
}
|
|
2826
2826
|
| { type: "cors_request"; requestId: string; url: string; options: RequestInitDTO }
|
|
2827
|
-
| { type: "register_context_handler"; priority?: number }
|
|
2827
|
+
| { type: "register_context_handler"; priority?: number; timeoutMs?: number }
|
|
2828
2828
|
| {
|
|
2829
2829
|
type: "context_handler_result";
|
|
2830
2830
|
requestId: string;
|
package/src/spindle-api.ts
CHANGED
|
@@ -1287,12 +1287,26 @@ export interface SpindleAPI {
|
|
|
1287
1287
|
/** Make a CORS-proxied HTTP request */
|
|
1288
1288
|
cors(url: string, options?: RequestInitDTO): Promise<unknown>;
|
|
1289
1289
|
|
|
1290
|
-
/**
|
|
1290
|
+
/**
|
|
1291
|
+
* Register a context handler for enriching generation context, awaited
|
|
1292
|
+
* before prompt assembly. The context carries `chatId`, `generationType`,
|
|
1293
|
+
* `dryRun` (tokenize/preview assemblies) and `userId`, returning it with
|
|
1294
|
+
* `cancelGeneration: true` stops the generation, and `opts.timeoutMs`
|
|
1295
|
+
* overrides the default 10s wall-clock budget (clamped to 1s-120s).
|
|
1296
|
+
*/
|
|
1291
1297
|
registerContextHandler(
|
|
1292
1298
|
handler: (context: unknown) => Promise<unknown>,
|
|
1293
|
-
priority?: number
|
|
1299
|
+
priority?: number,
|
|
1300
|
+
opts?: { timeoutMs?: number }
|
|
1294
1301
|
): void;
|
|
1295
1302
|
|
|
1303
|
+
/**
|
|
1304
|
+
* Host contract versions for feature detection, keyed by contract name.
|
|
1305
|
+
* `preAssemblyGenerationContext >= 1`: generation contexts carry
|
|
1306
|
+
* `dryRun`/`userId` and `cancelGeneration` is honored.
|
|
1307
|
+
*/
|
|
1308
|
+
contracts?: Readonly<Record<string, number>>;
|
|
1309
|
+
|
|
1296
1310
|
/**
|
|
1297
1311
|
* Register a macro interceptor (permission: `macro_interceptor`).
|
|
1298
1312
|
*
|