car-runtime 0.9.0 → 0.10.1

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 +16 -6
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -642,8 +642,11 @@ export class CarRuntime {
642
642
 
643
643
  /**
644
644
  * Execute a proposal through a CarRuntime with a JS tool callback.
645
- * The callback receives `{"tool":"name","params":{...}}` as a JSON string
646
- * and must return a JSON string.
645
+ * The callback receives
646
+ * `{"tool":"name","params":{...},"action_id":"<id>"}` as a JSON
647
+ * string and must return a JSON string. `action_id` is the
648
+ * originating `Action.id` from the proposal — useful for routing
649
+ * when the same callback closes over multiple in-flight calls.
647
650
  *
648
651
  * `sessionId`, when provided, scopes per-action policy validation to
649
652
  * the named session opened via `CarRuntime.openSession()`. Global
@@ -844,10 +847,17 @@ export function registerVoiceEventHandler(
844
847
  * proposal carrying host-owned tools, every tool routes through
845
848
  * this handler.
846
849
  *
847
- * `handlerFn(callJson)` receives `{"tool":"name","params":{...}}`
848
- * as a JSON string and MUST return a Promise resolving to the
849
- * tool's JSON-encoded result. Throwing rejects the daemon-side
850
- * action with a -32000 JSON-RPC error.
850
+ * `handlerFn(callJson)` receives
851
+ * `{"tool":"name","params":{...},"action_id":"<id>"}` as a JSON
852
+ * string and MUST return a Promise resolving to the tool's
853
+ * JSON-encoded result. Throwing rejects the daemon-side action
854
+ * with a -32000 JSON-RPC error.
855
+ *
856
+ * `action_id` carries the originating `Action.id` from the
857
+ * proposal so process-wide handlers can route concurrent
858
+ * callbacks back to the right per-call closure. Empty string when
859
+ * the daemon's `tools.execute` payload omits it (legacy daemons;
860
+ * not expected on >=0.9.x).
851
861
  *
852
862
  * Process-wide setter — re-calling overwrites the previous
853
863
  * handler. Pair with `unregisterToolHandler` to clear. Symmetric
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "car-runtime",
3
- "version": "0.9.0",
3
+ "version": "0.10.1",
4
4
  "description": "Common Agent Runtime — a deterministic execution layer for AI agents",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",