car-runtime 0.42.0 → 0.44.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 +53 -5
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -34,6 +34,33 @@
34
34
  */
35
35
 
36
36
  /** Persistent runtime instance with state, memory, tools, and policies. */
37
+ /**
38
+ * Optional settings for `coderStart`. Every field is independently omittable;
39
+ * each falls back to the daemon's `~/.car/coder.toml`.
40
+ *
41
+ * **Breaking (v0.44.0):** replaced five trailing positional optionals — three
42
+ * of them numbers — which callers could silently mis-order.
43
+ */
44
+ export interface CoderStartOptions {
45
+ /** `"auto" | "native" | "external[:agent_id]" | "foreman[:agent_id]"`. */
46
+ engine?: string | undefined | null;
47
+ /** Contract-evaluation rounds before the native loop gives up. */
48
+ maxIterations?: number | undefined | null;
49
+ /** Per-session backbone pin, reaching whichever engine runs. */
50
+ model?: string | undefined | null;
51
+ /**
52
+ * External-engine hypothesis budget: fresh repair invocations after a red
53
+ * pass. Recurrence escalation needs >= 2 to reach the model at all.
54
+ */
55
+ repairInvokes?: number | undefined | null;
56
+ /**
57
+ * External-engine availability budget: re-invocations after the CLI process
58
+ * died mid-run. Separate from `repairInvokes` on purpose — one buys a
59
+ * hypothesis, the other buys a retry.
60
+ */
61
+ transientRetries?: number | undefined | null;
62
+ }
63
+
37
64
  export class CarRuntime {
38
65
  constructor();
39
66
 
@@ -845,9 +872,7 @@ export class CarRuntime {
845
872
  coderStart(
846
873
  repo: string,
847
874
  intent: string,
848
- engine?: string | undefined | null,
849
- maxIterations?: number | undefined | null,
850
- model?: string | undefined | null,
875
+ options?: CoderStartOptions | undefined | null,
851
876
  ): Promise<string>;
852
877
 
853
878
  /**
@@ -3266,9 +3291,27 @@ export function agentsTailLog(id: string, n?: number | null, stream?: string | n
3266
3291
  * installed AND ready to use" answer. Returns JSON
3267
3292
  * `[ExternalAgentSpec]` (empty array when nothing installed).
3268
3293
  *
3294
+ * `ExternalAgentSpec.execution` (car#746) is the authoritative answer to
3295
+ * "can this binary run at all":
3296
+ * { state: "runnable" }
3297
+ * | { state: "unusable", reason: string, checked_at: number }
3298
+ * Written by detection, never revised by a health refresh. `health`
3299
+ * answers a different question (is it authenticated) and is owned by
3300
+ * refreshers that may rewrite it. Prefer `execution` over
3301
+ * `health.status === "not_executable"`, which is still emitted for one
3302
+ * compatibility window. An absent `execution` reads as "runnable".
3303
+ *
3269
3304
  * `ExternalAgentSpec.health` shape (when populated):
3270
3305
  * { id, status, details, reason?, checked_at }
3271
- * status: "ready" | "not_configured" | "expired" | "network_error" | "unknown"
3306
+ * status: "ready" | "not_configured" | "expired" | "network_error"
3307
+ * | "not_executable" | "unknown"
3308
+ *
3309
+ * `health` is also populated **without** `includeHealth` in one case:
3310
+ * when detection finds the binary but proves it cannot be executed,
3311
+ * the spec comes back with `status: "not_executable"` and a `reason`
3312
+ * naming the path. Do not invoke a spec in that state — it will be
3313
+ * killed at exec. Typical cause on macOS is Gatekeeper quarantine on
3314
+ * a binary installed outside the App Store.
3272
3315
  *
3273
3316
  * The `auth_kind` field is **deprecated** (Phase 2 stage 1) — modern
3274
3317
  * builds keep credentials in OS keystores so the heuristic falls
@@ -3303,11 +3346,16 @@ export function agentsDetectExternal(
3303
3346
  * {
3304
3347
  * "id": "claude-code" | "codex" | "gemini",
3305
3348
  * "status": "ready" | "not_configured" | "expired" |
3306
- * "network_error" | "unknown",
3349
+ * "network_error" | "not_executable" | "unknown",
3307
3350
  * "details": <tool-specific JSON object>,
3308
3351
  * "reason": <human-readable string when not Ready>,
3309
3352
  * "checked_at": <unix-secs>
3310
3353
  * }
3354
+ *
3355
+ * `not_executable` is set by *detection*, not by an auth-status
3356
+ * command — a binary the OS won't run can't report its own auth
3357
+ * state. It means the install is broken, not that the user is signed
3358
+ * out, so don't prompt for a login flow.
3311
3359
  */
3312
3360
  export function agentsHealthExternal(
3313
3361
  id?: string | null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "car-runtime",
3
- "version": "0.42.0",
3
+ "version": "0.44.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",