car-runtime 0.39.1 → 0.40.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.
Files changed (2) hide show
  1. package/index.d.ts +27 -16
  2. 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).
@@ -804,7 +825,7 @@ export class CarRuntime {
804
825
  * Coder — built-in coding agent (`coder.*` daemon namespace). Sessions
805
826
  * live in the daemon and are visible in CarHost. Live `coder.event`
806
827
  * streaming is WebSocket-only: call `coder.subscribe` on the daemon's
807
- * WS directly (same contract as `infer.stream`).
828
+ * WS directly (same contract as `infer_stream`).
808
829
  *
809
830
  * Start a session: provisions an isolated git worktree of `repo` and
810
831
  * derives a verifiable outcome contract from `intent`. `engine` is
@@ -1375,26 +1396,16 @@ export function executeProposal(
1375
1396
  ): Promise<string>;
1376
1397
 
1377
1398
  /**
1378
- * Stream inference events in real time via a callback.
1379
- * Callback receives event JSON strings:
1380
- * `{"type":"text","data":"..."}`
1381
- * `{"type":"tool_start","name":"...","index":N}`
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.
1399
+ * @deprecated Unsupported ABI-compatibility stub. This function always
1400
+ * rejects and never calls `onEvent`. Connect to `car-server` directly and use
1401
+ * the `infer_stream` JSON-RPC method plus `inference.stream.event`
1402
+ * notifications. See `docs/websocket-protocol.md`.
1392
1403
  */
1393
1404
  export function inferStream(
1394
1405
  rt: CarRuntime,
1395
1406
  requestJson: string,
1396
1407
  onEvent: (eventJson: string) => void,
1397
- ): Promise<string>;
1408
+ ): Promise<never>;
1398
1409
 
1399
1410
  // --- Caller-facing routing intent (parslee-ai/car-releases#18) ---
1400
1411
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "car-runtime",
3
- "version": "0.39.1",
3
+ "version": "0.40.0",
4
4
  "description": "Common Agent Runtime — a deterministic execution layer for AI agents",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",