@kernlang/agon 0.1.0 → 0.1.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.
@@ -8,7 +8,7 @@ import {
8
8
  buildModel,
9
9
  convertMessagesForSdk,
10
10
  convertToolsForSdk
11
- } from "./chunk-ESSX7EFA.js";
11
+ } from "./chunk-5QMVQPHY.js";
12
12
  export {
13
13
  _formatHintEmitted,
14
14
  _modelCache,
@@ -19,4 +19,4 @@ export {
19
19
  convertMessagesForSdk,
20
20
  convertToolsForSdk
21
21
  };
22
- //# sourceMappingURL=dispatch-CJVPYWJJ.js.map
22
+ //# sourceMappingURL=dispatch-6LQSMMGI.js.map
@@ -12,10 +12,10 @@ import {
12
12
  repairOverbroadForbiddenLiterals,
13
13
  taskWantsRepositoryLinkCheck,
14
14
  validateFitnessCommandIntent
15
- } from "./chunk-YNZ4UHZI.js";
16
- import "./chunk-4HY7J7LY.js";
17
- import "./chunk-GCXVT7RP.js";
18
- import "./chunk-ESSX7EFA.js";
15
+ } from "./chunk-RSS3RL6Z.js";
16
+ import "./chunk-HVJTVOXT.js";
17
+ import "./chunk-7PMMOQZ7.js";
18
+ import "./chunk-5QMVQPHY.js";
19
19
  export {
20
20
  extractFitnessCommandFromCesarOutput,
21
21
  handleForge,
@@ -30,4 +30,4 @@ export {
30
30
  taskWantsRepositoryLinkCheck,
31
31
  validateFitnessCommandIntent
32
32
  };
33
- //# sourceMappingURL=forge-OWSOM4TQ.js.map
33
+ //# sourceMappingURL=forge-JWR2Z76K.js.map
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  runAgentTeam,
14
14
  runReviewCore,
15
15
  selectReviewEngine
16
- } from "./chunk-5J4XXR3J.js";
16
+ } from "./chunk-LVW723TJ.js";
17
17
  import {
18
18
  buildCheckpoint,
19
19
  createScoreboard,
@@ -27,7 +27,7 @@ import {
27
27
  scoreboardFailEngine,
28
28
  scoreboardFinishEngine,
29
29
  sessionResultStore
30
- } from "./chunk-YNZ4UHZI.js";
30
+ } from "./chunk-RSS3RL6Z.js";
31
31
  import {
32
32
  ENGINE_COLORS,
33
33
  bold,
@@ -97,7 +97,7 @@ import {
97
97
  warn,
98
98
  yellow,
99
99
  yieldToInk
100
- } from "./chunk-4HY7J7LY.js";
100
+ } from "./chunk-HVJTVOXT.js";
101
101
  import {
102
102
  CommandRegistry,
103
103
  DEFAULT_CONFIG,
@@ -227,11 +227,11 @@ import {
227
227
  worktreeRemoveBestEffort,
228
228
  writeProvenanceReport,
229
229
  writeRunStatus
230
- } from "./chunk-GCXVT7RP.js";
230
+ } from "./chunk-7PMMOQZ7.js";
231
231
  import {
232
232
  apiDispatch,
233
233
  apiStreamDispatch
234
- } from "./chunk-ESSX7EFA.js";
234
+ } from "./chunk-5QMVQPHY.js";
235
235
 
236
236
  // src/index.ts
237
237
  import { defineCommand as defineCommand30, runMain } from "citty";
@@ -3730,7 +3730,7 @@ var providerCommand = defineCommand16({
3730
3730
  fail(`No stored credentials matching "${providerQuery}"`);
3731
3731
  break;
3732
3732
  }
3733
- const { removeAuthKey: removeKey } = await import("./src-HKGB6OYR.js");
3733
+ const { removeAuthKey: removeKey } = await import("./src-U2AWRNRL.js");
3734
3734
  removeKey(match.envVar);
3735
3735
  delete process.env[match.envVar];
3736
3736
  success(`Removed credentials for ${match.provider ?? match.envVar}`);
@@ -9329,7 +9329,7 @@ async function handlePlanShow(dispatch, ctx, planId) {
9329
9329
  savePlan(approved);
9330
9330
  dispatch({ type: "success", message: "Plan approved." });
9331
9331
  if (approved.action.type === "forge") {
9332
- const { handleForge: handleForge2 } = await import("./forge-OWSOM4TQ.js");
9332
+ const { handleForge: handleForge2 } = await import("./forge-JWR2Z76K.js");
9333
9333
  await handleForge2(approved.action.task, approved.action.fitnessCmd ?? null, dispatch, ctx, approved, approved.action.hardened);
9334
9334
  } else {
9335
9335
  dispatch({ type: "info", message: "Run the build again to execute." });
@@ -9355,7 +9355,7 @@ async function handleApprove(dispatch, ctx) {
9355
9355
  savePlan(plan);
9356
9356
  dispatch({ type: "success", message: "Plan approved." });
9357
9357
  if (plan.action.type === "forge") {
9358
- const { handleForge: handleForge2 } = await import("./forge-OWSOM4TQ.js");
9358
+ const { handleForge: handleForge2 } = await import("./forge-JWR2Z76K.js");
9359
9359
  await handleForge2(plan.action.task, plan.action.fitnessCmd ?? null, dispatch, ctx, plan, plan.action.hardened);
9360
9360
  } else {
9361
9361
  dispatch({ type: "info", message: "Run the build again to execute." });
@@ -9383,7 +9383,7 @@ async function handleRetry(dispatch, ctx) {
9383
9383
  plan = startPlan(plan);
9384
9384
  ctx.setCurrentPlan(plan);
9385
9385
  savePlan(plan);
9386
- const { handleForge: handleForge2 } = await import("./forge-OWSOM4TQ.js");
9386
+ const { handleForge: handleForge2 } = await import("./forge-JWR2Z76K.js");
9387
9387
  await handleForge2(plan.action.task, plan.action.fitnessCmd ?? null, dispatch, ctx, plan, plan.action.hardened);
9388
9388
  } else {
9389
9389
  dispatch({ type: "info", message: "Plan reset to approved. Run the build again to execute." });
@@ -12275,14 +12275,14 @@ Summarize the verdict and continue the original task.`, cb, continuationEpoch, c
12275
12275
  }
12276
12276
  return false;
12277
12277
  }
12278
- async function runCesarBrainFallback(input, cb, crashDel) {
12278
+ async function runCesarBrainFallback(input, cb, crashDel, priorDeterministic) {
12279
12279
  const cesarConfig = cb.ctx.config;
12280
12280
  const cesarId = cesarConfig.cesarEngine ?? "claude";
12281
12281
  const _silentMode = normalizeCesarActingFallbackMode(cesarConfig.cesarActingFallback) === "auto";
12282
12282
  const resolvedBackend = resolveCesarBackend(cb.ctx, cesarId);
12283
12283
  const cesarEngineDef = resolvedBackend.engine;
12284
12284
  const usingApiBackend = resolvedBackend.backend === "api";
12285
- if (usingApiBackend) {
12285
+ if (usingApiBackend && !priorDeterministic) {
12286
12286
  try {
12287
12287
  const retried = await handleCesarBrain(input, cb.dispatch, cb.ctx, []);
12288
12288
  const retriedPlan = cb.ctx.cesar?.proposedPlan;
@@ -12328,7 +12328,7 @@ async function runCesarBrainFallback(input, cb, crashDel) {
12328
12328
  const cesarEngine = cesarEngineDef ?? cb.ctx.registry.get(cesarId);
12329
12329
  const { join: join47 } = await import("path");
12330
12330
  const { mkdirSync: mkdirSync29 } = await import("fs");
12331
- const { resolveWorkingDir: resolveWorkingDir3, RUNS_DIR: RUNS_DIR3, appendMessage: appendMessage3 } = await import("./src-HKGB6OYR.js");
12331
+ const { resolveWorkingDir: resolveWorkingDir3, RUNS_DIR: RUNS_DIR3, appendMessage: appendMessage3 } = await import("./src-U2AWRNRL.js");
12332
12332
  const outDir = join47(RUNS_DIR3, `cesar-fallback-${Date.now()}`);
12333
12333
  mkdirSync29(outDir, { recursive: true });
12334
12334
  if (!_silentMode) cb.dispatch({ type: "warning", message: formatCesarRecoveryStatus("retry", cesarId, `log: ${outDir}`) });
@@ -12509,7 +12509,7 @@ ${historyContext}
12509
12509
  ` : ""}## USER MESSAGE
12510
12510
  ${input}`;
12511
12511
  try {
12512
- const { resolveWorkingDir: resolveWorkingDir3, RUNS_DIR: RUNS_DIR3, appendMessage: appendMessage3 } = await import("./src-HKGB6OYR.js");
12512
+ const { resolveWorkingDir: resolveWorkingDir3, RUNS_DIR: RUNS_DIR3, appendMessage: appendMessage3 } = await import("./src-U2AWRNRL.js");
12513
12513
  const { join: join47 } = await import("path");
12514
12514
  const { mkdirSync: mkdirSync29 } = await import("fs");
12515
12515
  const actingEngine = cb.ctx.registry.get(actingCesar);
@@ -12528,7 +12528,8 @@ ${input}`;
12528
12528
  if (actingResult.stdout.trim()) {
12529
12529
  const actingText = actingResult.stdout.trim().replace(/<think>[\s\S]*?<\/think>\s*/gi, "").trim();
12530
12530
  const attributedEngineId = _silentMode ? cesarId : actingCesar;
12531
- cb.dispatch({ type: "engine-block", engineId: attributedEngineId, color: 208, content: actingText });
12531
+ const actingNote = _silentMode && actingCesar !== cesarId ? `acting: ${actingCesar}` : void 0;
12532
+ cb.dispatch({ type: "engine-block", engineId: attributedEngineId, color: 208, content: actingText, actingNote });
12532
12533
  appendUserTurnIfAbsent(cb.ctx.chatSession, input);
12533
12534
  appendMessage3(cb.ctx.chatSession, {
12534
12535
  role: "engine",
@@ -12546,6 +12547,7 @@ ${input}`;
12546
12547
  }
12547
12548
  async function routeWithCesar(input, images, cb) {
12548
12549
  cb.setPendingImages(() => []);
12550
+ let priorDeterministic = false;
12549
12551
  try {
12550
12552
  const routingHints = deriveRoutingHints(input, cb.ctx);
12551
12553
  const recapStartedFiles = listFiles();
@@ -12555,6 +12557,7 @@ async function routeWithCesar(input, images, cb) {
12555
12557
  cb.dispatch(event);
12556
12558
  };
12557
12559
  const result = await handleCesarBrain(input, cesarDispatch, cb.ctx, images);
12560
+ priorDeterministic = result.deterministicFailure === true;
12558
12561
  const emitRecap = () => {
12559
12562
  const recapEvent = buildCesarTurnRecapEvent(recapCapture, result, recapStartedFiles, listFiles());
12560
12563
  const changedFiles = Array.isArray(recapEvent.files) ? recapEvent.files.filter((file) => String(file?.status ?? "") !== "read").slice(0, 4) : [];
@@ -12635,7 +12638,7 @@ async function routeWithCesar(input, images, cb) {
12635
12638
  if (cb.ctx.cesar) cb.ctx.cesar.pendingDelegation = null;
12636
12639
  if (await handleRecoveredDelegation(crashDel, input, cb)) return true;
12637
12640
  }
12638
- return runCesarBrainFallback(input, cb, crashDel);
12641
+ return runCesarBrainFallback(input, cb, crashDel, priorDeterministic);
12639
12642
  }
12640
12643
 
12641
12644
  // src/generated/signals/dispatch/intent-orchestration.ts
@@ -13386,7 +13389,7 @@ async function dispatchSessionInfoIntent(intent, input, cb) {
13386
13389
  cb.setModelPickerTitle?.("Select model");
13387
13390
  cb.setModelPickerLoading(true);
13388
13391
  cb.setModelPickerOpen(true);
13389
- import("./src-HKGB6OYR.js").then(({ fetchModelsRegistry: fetchModelsRegistry2, buildModelEntries: buildModelEntries2, buildCliGroupsImmediate, refreshCliGroup }) => {
13392
+ import("./src-U2AWRNRL.js").then(({ fetchModelsRegistry: fetchModelsRegistry2, buildModelEntries: buildModelEntries2, buildCliGroupsImmediate, refreshCliGroup }) => {
13390
13393
  let cliGroups = buildCliGroupsImmediate();
13391
13394
  cb.setModelPickerCliGroups?.(cliGroups);
13392
13395
  for (const g of cliGroups) {
@@ -13435,7 +13438,7 @@ async function dispatchSessionInfoIntent(intent, input, cb) {
13435
13438
  await handlePlanShow(cb.dispatch, cb.ctx, intent.planId);
13436
13439
  break;
13437
13440
  case "plan-task": {
13438
- const { createCesarPlan } = await import("./src-HKGB6OYR.js");
13441
+ const { createCesarPlan } = await import("./src-U2AWRNRL.js");
13439
13442
  const cesarPlan = createCesarPlan(intent.task, []);
13440
13443
  cb.setActivePlan(cesarPlan);
13441
13444
  if (!cb.ctx.cesar) {
@@ -16053,7 +16056,7 @@ function EngineProgressView({ engines, mode }) {
16053
16056
  /* @__PURE__ */ jsx4(Text4, { dimColor: true, children: engine.status })
16054
16057
  ] }, engine.id)) });
16055
16058
  }
16056
- var EngineBlock = React4.memo(function EngineBlock2({ engineId, color, content }) {
16059
+ var EngineBlock = React4.memo(function EngineBlock2({ engineId, color, content, actingNote }) {
16057
16060
  const wrapWidth = contentWidth(8);
16058
16061
  const cleaned = cleanEngineOutput(content);
16059
16062
  const hexColor = color256toHex(color);
@@ -16061,7 +16064,12 @@ var EngineBlock = React4.memo(function EngineBlock2({ engineId, color, content }
16061
16064
  return /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", marginY: 0, paddingLeft: 2, children: [
16062
16065
  /* @__PURE__ */ jsxs4(Text4, { color: hexColor, children: [
16063
16066
  "\u250C\u2500\u2500 ",
16064
- /* @__PURE__ */ jsx4(Text4, { bold: true, children: engineId })
16067
+ /* @__PURE__ */ jsx4(Text4, { bold: true, children: engineId }),
16068
+ actingNote ? /* @__PURE__ */ jsxs4(Text4, { dimColor: true, children: [
16069
+ " (",
16070
+ actingNote,
16071
+ ")"
16072
+ ] }) : null
16065
16073
  ] }),
16066
16074
  /* @__PURE__ */ jsxs4(Text4, { color: hexColor, children: [
16067
16075
  "\u2502 ",
@@ -16074,24 +16082,36 @@ var EngineBlock = React4.memo(function EngineBlock2({ engineId, color, content }
16074
16082
  return /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", marginY: 1, paddingLeft: 2, children: [
16075
16083
  /* @__PURE__ */ jsxs4(Text4, { color: hexColor, children: [
16076
16084
  "\u250C\u2500\u2500 ",
16077
- /* @__PURE__ */ jsx4(Text4, { bold: true, color: hexColor, children: engineId })
16085
+ /* @__PURE__ */ jsx4(Text4, { bold: true, color: hexColor, children: engineId }),
16086
+ actingNote ? /* @__PURE__ */ jsxs4(Text4, { dimColor: true, children: [
16087
+ " (",
16088
+ actingNote,
16089
+ ")"
16090
+ ] }) : null
16078
16091
  ] }),
16079
16092
  /* @__PURE__ */ jsx4(Text4, { color: hexColor, children: "\u2502" }),
16080
16093
  /* @__PURE__ */ jsx4(RenderedSegments, { segments, borderColor: hexColor, wrapWidth }),
16081
16094
  /* @__PURE__ */ jsx4(Text4, { color: hexColor, children: "\u2514\u2500\u2500" })
16082
16095
  ] });
16083
16096
  });
16084
- var ConversationalResponse = React4.memo(function ConversationalResponse2({ engineId, content }) {
16097
+ var ConversationalResponse = React4.memo(function ConversationalResponse2({ engineId, content, actingNote }) {
16085
16098
  const wrapWidth = contentWidth(2);
16086
16099
  const cleaned = cleanEngineOutput(content);
16087
16100
  if (!cleaned.trim()) return null;
16088
16101
  const segments = parseMarkdownBlocks(cleaned);
16089
16102
  const accentColor = color256toHex(ENGINE_COLORS[engineId] ?? 124);
16090
16103
  return /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", marginTop: 1, marginBottom: 0, paddingLeft: 1, children: [
16091
- /* @__PURE__ */ jsx4(Text4, { children: /* @__PURE__ */ jsxs4(Text4, { color: accentColor, bold: true, children: [
16092
- icons().dotOn + " ",
16093
- engineId
16094
- ] }) }),
16104
+ /* @__PURE__ */ jsxs4(Text4, { children: [
16105
+ /* @__PURE__ */ jsxs4(Text4, { color: accentColor, bold: true, children: [
16106
+ icons().dotOn + " ",
16107
+ engineId
16108
+ ] }),
16109
+ actingNote ? /* @__PURE__ */ jsxs4(Text4, { dimColor: true, children: [
16110
+ " (",
16111
+ actingNote,
16112
+ ")"
16113
+ ] }) : null
16114
+ ] }),
16095
16115
  /* @__PURE__ */ jsx4(Text4, { children: " " }),
16096
16116
  /* @__PURE__ */ jsx4(RenderedSegments, { segments, borderColor: "", wrapWidth })
16097
16117
  ] });
@@ -16328,7 +16348,7 @@ var OutputBlockView = React4.memo(function OutputBlockView2({ event, mode, toolO
16328
16348
  /* @__PURE__ */ jsx4(Text4, { bold: true, children: event.content })
16329
16349
  ] });
16330
16350
  case "engine-block":
16331
- return mode === "chat" ? /* @__PURE__ */ jsx4(ConversationalResponse, { engineId: event.engineId, content: event.content }) : /* @__PURE__ */ jsx4(EngineBlock, { engineId: event.engineId, color: event.color, content: event.content });
16351
+ return mode === "chat" ? /* @__PURE__ */ jsx4(ConversationalResponse, { engineId: event.engineId, content: event.content, actingNote: event.actingNote }) : /* @__PURE__ */ jsx4(EngineBlock, { engineId: event.engineId, color: event.color, content: event.content, actingNote: event.actingNote });
16332
16352
  case "separator":
16333
16353
  return /* @__PURE__ */ jsx4(Text4, { children: " " });
16334
16354
  case "header":
@@ -17399,8 +17419,8 @@ function resolvePackageVersion(resolveSpecifier, wantName, fallback) {
17399
17419
  }
17400
17420
  return fallback;
17401
17421
  }
17402
- var VERSION = resolvePackageVersion(null, "@kernlang/agon", "0.1.0");
17403
- var KERN_VERSION = resolvePackageVersion("@kernlang/terminal/runtime", "@kernlang/terminal", "3.5.5");
17422
+ var VERSION = resolvePackageVersion(null, "@kernlang/agon", "0.1.1");
17423
+ var KERN_VERSION = resolvePackageVersion("@kernlang/terminal/runtime", "@kernlang/terminal", "3.5.7");
17404
17424
 
17405
17425
  // src/generated/blocks/todo-list.tsx
17406
17426
  import React5 from "react";
@@ -23788,7 +23808,7 @@ function App() {
23788
23808
  setEnginePickerOpen(false);
23789
23809
  setModelPickerOpen(true);
23790
23810
  setModelPickerCliGroups([]);
23791
- import("./src-HKGB6OYR.js").then(({ fetchModelsRegistry: fetchModelsRegistry2, buildModelEntries: buildModelEntries2, buildCliGroupsImmediate, refreshCliGroup }) => {
23811
+ import("./src-U2AWRNRL.js").then(({ fetchModelsRegistry: fetchModelsRegistry2, buildModelEntries: buildModelEntries2, buildCliGroupsImmediate, refreshCliGroup }) => {
23792
23812
  let cliGroups = buildCliGroupsImmediate();
23793
23813
  setModelPickerCliGroups(cliGroups);
23794
23814
  for (const g of cliGroups) {