car-runtime 0.39.1 → 0.42.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 +36 -17
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -170,6 +170,27 @@ export class CarRuntime {
|
|
|
170
170
|
sessionId?: string | null,
|
|
171
171
|
): Promise<void>;
|
|
172
172
|
|
|
173
|
+
/**
|
|
174
|
+
* Remove a global policy by name. Resolves to how many were removed —
|
|
175
|
+
* `0` means nothing matched, which is not an error, so cleanup can call
|
|
176
|
+
* this unconditionally.
|
|
177
|
+
*
|
|
178
|
+
* Counterpart to `registerPolicy`, which had none: a policy registered
|
|
179
|
+
* over the wire could only be cleared by restarting the daemon
|
|
180
|
+
* (Parslee-ai/car#623). Session-scoped policies stay WS-only, mirroring
|
|
181
|
+
* `registerPolicy`'s own `sessionId` restriction — close the session to
|
|
182
|
+
* drop them.
|
|
183
|
+
*/
|
|
184
|
+
unregisterPolicy(name: string): Promise<number>;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Global policies in force, as a JSON array of `{ name, description }`.
|
|
188
|
+
* Without this a caller could register a policy but never ask what was
|
|
189
|
+
* enforced, so an action rejection could not be explained beyond its own
|
|
190
|
+
* message.
|
|
191
|
+
*/
|
|
192
|
+
listPolicies(): Promise<string>;
|
|
193
|
+
|
|
173
194
|
/**
|
|
174
195
|
* Set replan configuration on this runtime.
|
|
175
196
|
* `maxReplans` = 0 disables replanning (default).
|
|
@@ -652,7 +673,15 @@ export class CarRuntime {
|
|
|
652
673
|
|
|
653
674
|
// --- Speech ---
|
|
654
675
|
|
|
655
|
-
/**
|
|
676
|
+
/**
|
|
677
|
+
* Provision the managed speech runtime and return its root path — the same
|
|
678
|
+
* root `speechHealth()` / `car speech doctor` report. The first call on a
|
|
679
|
+
* fresh machine builds a Python venv and can take minutes; afterwards it is
|
|
680
|
+
* a no-op. The returned path is not a success signal: on Apple Silicon the
|
|
681
|
+
* runtime is a fallback behind the native MLX backends, so a bootstrap that
|
|
682
|
+
* cannot run degrades instead of failing. Read
|
|
683
|
+
* `speechHealth().runtime.installed` for the real state.
|
|
684
|
+
*/
|
|
656
685
|
prepareSpeechRuntime(): Promise<string>;
|
|
657
686
|
|
|
658
687
|
/** Transcribe a local audio file. Returns JSON `{text, model_used, language, ...}`. */
|
|
@@ -804,7 +833,7 @@ export class CarRuntime {
|
|
|
804
833
|
* Coder — built-in coding agent (`coder.*` daemon namespace). Sessions
|
|
805
834
|
* live in the daemon and are visible in CarHost. Live `coder.event`
|
|
806
835
|
* streaming is WebSocket-only: call `coder.subscribe` on the daemon's
|
|
807
|
-
* WS directly (same contract as `
|
|
836
|
+
* WS directly (same contract as `infer_stream`).
|
|
808
837
|
*
|
|
809
838
|
* Start a session: provisions an isolated git worktree of `repo` and
|
|
810
839
|
* derives a verifiable outcome contract from `intent`. `engine` is
|
|
@@ -1375,26 +1404,16 @@ export function executeProposal(
|
|
|
1375
1404
|
): Promise<string>;
|
|
1376
1405
|
|
|
1377
1406
|
/**
|
|
1378
|
-
*
|
|
1379
|
-
*
|
|
1380
|
-
*
|
|
1381
|
-
*
|
|
1382
|
-
* `{"type":"tool_delta","index":N,"data":"..."}`
|
|
1383
|
-
* `{"type":"done","text":"...","tool_calls":[...]}`
|
|
1384
|
-
*
|
|
1385
|
-
* **Breaking change in 0.5.x:** the prior 9-positional signature
|
|
1386
|
-
* has been replaced with an options-object form. Migration: build
|
|
1387
|
-
* the request object and `JSON.stringify` it as `requestJson`. The
|
|
1388
|
-
* options object exposes every `GenerateRequest` field including
|
|
1389
|
-
* `intent` (closes #107). The replacement (rather than addition of
|
|
1390
|
-
* a sibling) is forced by napi-rs's 3-standalone-TSF cap — see the
|
|
1391
|
-
* project rules for the rationale.
|
|
1407
|
+
* @deprecated Unsupported ABI-compatibility stub. This function always
|
|
1408
|
+
* rejects and never calls `onEvent`. Connect to `car-server` directly and use
|
|
1409
|
+
* the `infer_stream` JSON-RPC method plus `inference.stream.event`
|
|
1410
|
+
* notifications. See `docs/websocket-protocol.md`.
|
|
1392
1411
|
*/
|
|
1393
1412
|
export function inferStream(
|
|
1394
1413
|
rt: CarRuntime,
|
|
1395
1414
|
requestJson: string,
|
|
1396
1415
|
onEvent: (eventJson: string) => void,
|
|
1397
|
-
): Promise<
|
|
1416
|
+
): Promise<never>;
|
|
1398
1417
|
|
|
1399
1418
|
// --- Caller-facing routing intent (parslee-ai/car-releases#18) ---
|
|
1400
1419
|
|