@kal-elsam/kairo-runtime 0.19.0 → 0.20.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/CHANGELOG.md CHANGED
@@ -5,6 +5,26 @@ Historical entries below may reference the legacy `@kal-elsam/harness` package n
5
5
 
6
6
  ## Unreleased
7
7
 
8
+ ## 0.20.0 — 2026-09-18 (Kairo Runtime)
9
+
10
+ Minor release. Promotes Cursor to a real automatic execution provider.
11
+
12
+ ### Changed
13
+
14
+ - Cursor's accessMode flips from "manual" to "automatic"
15
+ (`model-candidate-catalog.js`). Its own execution adapter already
16
+ builds a real, auditable non-interactive launch (`cursor-agent -p
17
+ --output-format stream-json`) and parses its structured event stream
18
+ — the same shape as Codex/Claude, and an officially documented,
19
+ supported use of the Cursor CLI. Real task routing now judges Cursor
20
+ by the exact same launchable/eligibility gate as Codex/Claude, for
21
+ both execution and recommendations — no more special-cased
22
+ manual-only rejection in `execution-router.js`'s `checkCandidate`.
23
+ - Cursor's own opaque "auto" router model still stays manual (its
24
+ identity is non-deterministic, unlike a named model). OpenCode Go is
25
+ unaffected — it remains manual for its own, real, already-confirmed
26
+ Go/Zen billing-attribution ambiguity.
27
+
8
28
  ## 0.19.0 — 2026-09-18 (Kairo Runtime)
9
29
 
10
30
  Patch-level polish on top of 0.18.0's PROJECT TEAM work: fixes the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kal-elsam/kairo-runtime",
3
- "version": "0.19.0",
3
+ "version": "0.20.0",
4
4
  "description": "Kairo Runtime — local agent operating system for Codex, Cursor, Claude, Pi, Engram, and Graphify.",
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/Kal-elSam/harness#readme",
@@ -1258,7 +1258,7 @@ export class CockpitView {
1258
1258
  `Claude ${claudeText}`,
1259
1259
  `Go ${goText}`,
1260
1260
  `Zen ${zenText}`,
1261
- `Cursor ${entry("Cursor", "MANUAL · usage unknown")}`
1261
+ `Cursor ${entry("Cursor", "READY · usage unknown")}`
1262
1262
  ];
1263
1263
  }
1264
1264
 
@@ -496,8 +496,8 @@ export function createConversationService(deps = {}) {
496
496
  // scoredAllRaw directly, so an old generation Cursor still
497
497
  // re-exposes (e.g. Claude Sonnet 4) naturally stops competing
498
498
  // without buildAiTeam/buildEfficientTeam's own ranking logic
499
- // needing to know why. Manual-only real candidates (Cursor,
500
- // OpenCode Go) stay in it — this is "what Kairo can honestly
499
+ // needing to know why. Manual-only real candidates (OpenCode Go,
500
+ // and Cursor's own opaque "auto" router model) stay in it — this is "what Kairo can honestly
501
501
  // recommend", not "what Kairo can launch by itself".
502
502
  const scoredAll = buildRecommendationPool(scoredAllRaw, completeCandidateCatalog);
503
503
  // The Automatic Execution Pool: the real subset of scoredAll
@@ -156,40 +156,32 @@ export const LOW_QUOTA_WARN_PERCENT = 20;
156
156
  * have the model via the Go subscription — without claiming Kairo can
157
157
  * safely auto-execute through it yet (see opencode.js's checkAvailability
158
158
  * for why: no per-event way to prove a run didn't silently bill Zen).
159
- * It also lets Cursor be named as a real recommendation (e.g. Builder ->
160
- * Cursor Composer 2.5) even though Kairo never auto-executes through it —
161
- * the user continues that work manually inside the Cursor IDE; this is
162
- * permanent for Cursor, not a temporary safety gap like opencode-go's.
163
- * Real task routing (selectExecutionProvider/selectAskProvider) always
164
- * uses the default `true` — it must never pick something guaranteed to
165
- * fail at launch (run-manager.js's own launchable gate would reject it).
159
+ * Cursor no longer needs this exemption: its own execution adapter
160
+ * (execution-adapters/cursor.js) builds a real, auditable non-interactive
161
+ * launch and Cursor's own docs support headless/CI use, so real task
162
+ * routing now judges it exactly like Codex/Claude same launchable gate,
163
+ * no special case. Real task routing (selectExecutionProvider/
164
+ * selectAskProvider) always uses the default `true` — it must never pick
165
+ * something guaranteed to fail at launch (run-manager.js's own
166
+ * launchable gate would reject it).
166
167
  */
167
168
  export function checkCandidate(adapterId, { adapters, codexUsage, claudeUsage, opencodeGoUsage, cursorManualQuota }, { requireLaunchable = true } = {}) {
168
169
  // Zen carries real PAYG/billing risk (see conversation/service.js's
169
170
  // capabilities.openCodeExecution) — never an automatic pick, regardless
170
171
  // of what its real catalog/benchmarks might otherwise say.
171
172
  if (adapterId === "opencode-zen") return { ok: false, reason: "OpenCode Zen is excluded from automatic routing (PAYG risk)" };
172
- // Cursor is a deliberate manual-only destination for real task
173
- // execution — recommendation and execution are different capabilities
174
- // (see model-intelligence.js's role assignments): Kairo can genuinely
175
- // recommend a real Cursor model for a role (Builder -> Cursor Composer
176
- // 2.5, say), the same requireLaunchable:false exception opencode-go
177
- // already gets below, but real task routing (requireLaunchable: true,
178
- // the default) always refuses it — the user continues that work
179
- // manually inside the Cursor IDE, never an automatic Kairo-launched run.
180
- if (adapterId === "cursor" && requireLaunchable) {
181
- return { ok: false, reason: "Cursor is manual-only — continue the work in the Cursor IDE, never auto-executed by Kairo" };
182
- }
183
173
 
184
174
  const adapter = findAdapter(adapterId, adapters);
185
175
  if (!adapter) return { ok: false, reason: `${adapterId}: no adapter found` };
186
176
  if (!adapter.available) return { ok: false, reason: adapter.reason ?? `${adapterId}: not available` };
187
177
  // "launchable" means safe for Kairo to invoke programmatically — not the
188
- // bar a manual recommendation needs. Cursor gets the same exemption
189
- // opencode-go already has: real availability is enough to recommend it,
190
- // even though (unlike opencode-go) it's exempt from launchable for a
191
- // structurally different reason it will NEVER be launchable, by design.
192
- const launchableRequired = requireLaunchable || (adapterId !== "opencode-go" && adapterId !== "cursor");
178
+ // bar a manual recommendation needs. OpenCode Go alone keeps the
179
+ // exemption: real availability is enough to recommend it, even though
180
+ // Kairo can't safely auto-execute through it yet (unresolved Go/Zen
181
+ // billing-attribution gapsee opencode.js). Cursor no longer needs
182
+ // this exemption its real launchability is judged the same way for
183
+ // both recommendation and execution now.
184
+ const launchableRequired = requireLaunchable || adapterId !== "opencode-go";
193
185
  if (launchableRequired && !adapter.launchable) return { ok: false, reason: adapter.reason ?? `${adapterId}: not launchable yet` };
194
186
 
195
187
  if (adapterId === "codex") {
@@ -209,11 +201,10 @@ export function checkCandidate(adapterId, { adapters, codexUsage, claudeUsage, o
209
201
  if (limited) return { ok: false, reason: `OpenCode Go ${limited.name} window is rate-limited` };
210
202
  }
211
203
  // Cursor: only ever the human's own last word (see this function's own
212
- // doc) — never fabricated from a guess. Checked here, after the
213
- // requireLaunchable-gated manual-only return above, so it only ever
214
- // takes effect on the recommendation path (requireLaunchable: false)
215
- // real task routing already refuses Cursor unconditionally regardless
216
- // of quota.
204
+ // doc) — never fabricated from a guess. Applies to BOTH the
205
+ // recommendation path AND real task routing now that Cursor is a real
206
+ // automatic candidate a human-reported "out of credits" must block
207
+ // an actual launch, not just a suggestion.
217
208
  if (adapterId === "cursor" && cursorManualQuota?.manualExhausted) {
218
209
  return { ok: false, reason: cursorManualQuota.reason ?? "Cursor marked out of credits (manual, via /project cursor exhausted)" };
219
210
  }
@@ -39,7 +39,7 @@ import { matchArtificialAnalysisScore } from "./model-intelligence.js";
39
39
  * @property {string} modelName - human-readable clean name, with real effort/context/privacy variant tokens stripped (see stripDisplayVariant). Never invented — always derived from the provider's own real displayName.
40
40
  * @property {string} rawDisplayName - the provider's own displayName, completely unmodified — the real evidence modelName was derived from. Whatever stripDisplayVariant peeled off (effort/context/privacy tokens) to produce modelName is still visible here, never a separate field: /models --evidence's own "technical detail" is just this string.
41
41
  * @property {string} adapterId - "codex" | "claude" | "cursor" | "opencode-go".
42
- * @property {"automatic"|"manual"} accessMode - whether Kairo can actually launch this candidate itself right now, or whether it's a real, recommendable option the human runs manually (Cursor always; OpenCode Go until its own empirical automatic-execution proof lands — see this module's own doc).
42
+ * @property {"automatic"|"manual"} accessMode - whether Kairo can actually launch this candidate itself right now, or whether it's a real, recommendable option the human runs manually (Cursor's own "auto" router model always; OpenCode Go until its own empirical automatic-execution proof lands — see this module's own doc). Named Cursor models are automatic.
43
43
  * @property {"scored"|"partial"|"unscored"} evidenceStatus - "scored": AA matched this exact model AND reports at least one of intelligenceIndex/codingIndex. "partial": AA matched it but both composite indices are null (real match, thin evidence). "unscored": no confident AA match at all. Never role-specific — see this module's own doc for why.
44
44
  * @property {string|null} lineageKey - real, recognized model family/lineage (see LINEAGE_PARSERS) — null when the modelId doesn't match any recognized, conservative pattern. Never guessed.
45
45
  * @property {number|null} generation - a real, comparable version number within that lineage — null whenever lineageKey is null.
@@ -285,12 +285,22 @@ function applyLifecycle(catalog) {
285
285
  // automatic-execution proof this session's plan calls for
286
286
  // (`opencode run -m opencode-go/<model>`, verifying real provider
287
287
  // attribution and Go-only consumption) actually runs and passes — see
288
- // this module's own doc. Cursor is permanently "manual" by design (see
289
- // execution-router.js's own checkCandidate: real task execution always
290
- // refuses it, recommendation never does).
291
- const ACCESS_MODE_BY_ADAPTER = { codex: "automatic", claude: "automatic", cursor: "manual", "opencode-go": "manual" };
288
+ // this module's own doc. Cursor is "automatic": its own execution
289
+ // adapter (execution-adapters/cursor.js) already builds a real,
290
+ // auditable non-interactive launch (`cursor-agent -p --output-format
291
+ // stream-json`) and parses its structured event stream, the exact same
292
+ // shape as Codex/Claude — Cursor's own docs explicitly support this
293
+ // (headless/CI use is an intended, documented capability, not a hack).
294
+ // The earlier "permanent manual" policy predated this adapter being
295
+ // finished and had no technical or billing reason behind it (unlike
296
+ // OpenCode Go's real, confirmed Go/Zen billing-attribution gap above).
297
+ const ACCESS_MODE_BY_ADAPTER = { codex: "automatic", claude: "automatic", cursor: "automatic", "opencode-go": "manual" };
292
298
 
293
299
  function resolveAccessMode(adapterId, modelId) {
300
+ // Cursor's own "auto" router picks whichever underlying model it wants
301
+ // per request — an opaque, non-deterministic identity Kairo can't
302
+ // attribute to a real scored model, so THIS one candidate stays manual
303
+ // even though named Cursor models are now real automatic candidates.
294
304
  if (adapterId === "cursor" && modelId === "auto") return "manual";
295
305
  return ACCESS_MODE_BY_ADAPTER[adapterId] ?? "manual";
296
306
  }
@@ -437,8 +447,9 @@ export function buildRecommendationPool(scoredAll, completeCatalog) {
437
447
  * The Automatic Execution Pool: the subset of the Recommendation Pool
438
448
  * Kairo can actually launch itself, right now — real routing's own
439
449
  * candidate source, never QUALITY/EFFICIENT TEAM's. Requires BOTH a real
440
- * accessMode of "automatic" (Cursor/OpenCode Go are permanently or
441
- * currently manual see ModelCandidateIdentity's own doc) AND real,
450
+ * accessMode of "automatic" (OpenCode Go is currently manual, and
451
+ * Cursor's own "auto" router model stays manual see
452
+ * ModelCandidateIdentity's own doc) AND real,
442
453
  * current eligibility (adapter availability, quota, launchability — the
443
454
  * exact same `eligibility` object checkCandidate/execution-router.js
444
455
  * already compute, reused here rather than reimplemented). Never
@@ -89,7 +89,7 @@ export async function readCodexModels({
89
89
  child.once?.("close", () => { if (!finished) finish(unknown("codex app-server closed before model list")); });
90
90
 
91
91
  writeRequest(child, 1, "initialize", {
92
- clientInfo: { name: "kairo", title: "Kairo", version: "0.19.0" },
92
+ clientInfo: { name: "kairo", title: "Kairo", version: "0.20.0" },
93
93
  capabilities: {}
94
94
  });
95
95
  });
@@ -151,7 +151,7 @@ export async function readCodexUsage({
151
151
  child.once?.("close", () => { if (!finished) finish(unknown("codex app-server closed before rate limits")); });
152
152
 
153
153
  writeRequest(child, 1, "initialize", {
154
- clientInfo: { name: "kairo", title: "Kairo", version: "0.19.0" },
154
+ clientInfo: { name: "kairo", title: "Kairo", version: "0.20.0" },
155
155
  capabilities: {}
156
156
  });
157
157
  });