car-runtime 0.17.0 → 0.18.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/index.d.ts +21 -37
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1204,11 +1204,23 @@ export function a2aServerStatus(): string;
|
|
|
1204
1204
|
|
|
1205
1205
|
// --- Verification (stateless) ---
|
|
1206
1206
|
|
|
1207
|
+
/**
|
|
1208
|
+
* Statically verify a proposal.
|
|
1209
|
+
*
|
|
1210
|
+
* `toolNames` checks tool existence only. To also validate each
|
|
1211
|
+
* `tool_call`'s parameters against the tool's JSON Schema — catching
|
|
1212
|
+
* type mismatches (`{path: 42}` for a `string`) and missing required
|
|
1213
|
+
* fields — pass `toolSchemasJson`: a JSON array of tool schemas, e.g.
|
|
1214
|
+
* `JSON.stringify([{ name: "echo", parameters: { type: "object",
|
|
1215
|
+
* properties: { msg: { type: "string" } }, required: ["msg"] } }])`.
|
|
1216
|
+
* When both are given, `toolSchemasJson` takes precedence.
|
|
1217
|
+
*/
|
|
1207
1218
|
export function verify(
|
|
1208
1219
|
proposalJson: string,
|
|
1209
1220
|
initialStateJson?: string | null,
|
|
1210
1221
|
toolNames?: string[] | null,
|
|
1211
1222
|
maxActions?: number | null,
|
|
1223
|
+
toolSchemasJson?: string | null,
|
|
1212
1224
|
): string;
|
|
1213
1225
|
|
|
1214
1226
|
export function simulate(
|
|
@@ -1232,43 +1244,15 @@ export function registerAgentRunner(
|
|
|
1232
1244
|
agentFn: (specJson: string, taskJson: string) => Promise<string>,
|
|
1233
1245
|
): Promise<void>;
|
|
1234
1246
|
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
* provider via `inferenceRunnerEmitEvent(callId, eventJson)`, then
|
|
1245
|
-
* resolves the promise with the final aggregated result JSON
|
|
1246
|
-
* (`{text: string, tool_calls: ToolCall[]}`).
|
|
1247
|
-
*
|
|
1248
|
-
* Idempotent — re-calling overwrites the previous runner. Only one
|
|
1249
|
-
* runner can be registered per process (matches `registerAgentRunner`).
|
|
1250
|
-
*
|
|
1251
|
-
* Event JSON shapes match `inferStream`'s event taxonomy:
|
|
1252
|
-
* `{type: "text", data: string}`
|
|
1253
|
-
* `{type: "tool_start", name: string, index: number, id?: string}`
|
|
1254
|
-
* `{type: "tool_delta", index: number, data: string}`
|
|
1255
|
-
* `{type: "usage", input_tokens: number, output_tokens: number}`
|
|
1256
|
-
* `{type: "done", text: string, tool_calls: ToolCall[]}`
|
|
1257
|
-
*/
|
|
1258
|
-
export function registerInferenceRunner(
|
|
1259
|
-
runnerFn: (requestJson: string, callId: string) => Promise<string>,
|
|
1260
|
-
): void;
|
|
1261
|
-
|
|
1262
|
-
/**
|
|
1263
|
-
* Emit a stream event from inside the inference runner callback.
|
|
1264
|
-
* `callId` is the second argument the runner received; `eventJson`
|
|
1265
|
-
* is one of the shapes documented on `registerInferenceRunner`.
|
|
1266
|
-
*
|
|
1267
|
-
* Silently no-ops if `callId` is unknown (call already completed or
|
|
1268
|
-
* the runner emitted after returning) — racing the normal completion
|
|
1269
|
-
* path shouldn't error.
|
|
1270
|
-
*/
|
|
1271
|
-
export function inferenceRunnerEmitEvent(callId: string, eventJson: string): void;
|
|
1247
|
+
// --- Inference runner (delegated inference, closes car-releases#24) ---
|
|
1248
|
+
//
|
|
1249
|
+
// In-process registration is not exposed in the FFI bindings (car-releases#55).
|
|
1250
|
+
// The v0.8+ daemon-only architecture moves delegated inference to the
|
|
1251
|
+
// WebSocket protocol: a runner client connects to car-server and calls
|
|
1252
|
+
// `inference.register_runner`; the daemon then sends
|
|
1253
|
+
// `inference.runner.invoke` notifications for every delegated call.
|
|
1254
|
+
// See docs/websocket-protocol.md §"Inference runner" for the wire shape.
|
|
1255
|
+
// `car-server` is shipped as a binary in this npm package (`bin/car-server`).
|
|
1272
1256
|
|
|
1273
1257
|
/** Run a Swarm pattern. `mode` is "parallel", "sequential", or "debate". */
|
|
1274
1258
|
export function runSwarm(
|