@proxysoul/soulforge 2.2.1 → 2.4.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 (3) hide show
  1. package/README.md +343 -168
  2. package/dist/index.js +789 -682
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -39260,7 +39260,7 @@ var package_default;
39260
39260
  var init_package = __esm(() => {
39261
39261
  package_default = {
39262
39262
  name: "@proxysoul/soulforge",
39263
- version: "2.2.1",
39263
+ version: "2.4.0",
39264
39264
  description: "Graph-powered code intelligence \u2014 multi-agent coding with codebase-aware AI",
39265
39265
  repository: {
39266
39266
  type: "git",
@@ -39982,7 +39982,8 @@ function buildCustomProvider(config2) {
39982
39982
  id: config2.id,
39983
39983
  name: config2.name ?? config2.id,
39984
39984
  envVar,
39985
- icon: "\u25C7",
39985
+ icon: "\uF29F",
39986
+ asciiIcon: "\u25C7",
39986
39987
  custom: true,
39987
39988
  createModel(modelId) {
39988
39989
  const apiKey = envVar ? getProviderApiKey(envVar) ?? "" : "custom";
@@ -49575,6 +49576,75 @@ var init_llmgateway = __esm(() => {
49575
49576
  };
49576
49577
  });
49577
49578
 
49579
+ // src/core/llm/providers/lmstudio.ts
49580
+ function getBaseOrigin() {
49581
+ return (process.env.LM_STUDIO_URL ?? "http://localhost:1234").replace(/\/+$/, "");
49582
+ }
49583
+ function openaiBase() {
49584
+ return `${getBaseOrigin()}/v1`;
49585
+ }
49586
+ function restBase() {
49587
+ return `${getBaseOrigin()}/api/v0`;
49588
+ }
49589
+ function getApiToken() {
49590
+ return process.env.LM_API_TOKEN ?? "lm-studio";
49591
+ }
49592
+ function authHeaders() {
49593
+ const token = getApiToken();
49594
+ return token && token !== "lm-studio" ? {
49595
+ Authorization: `Bearer ${token}`
49596
+ } : {};
49597
+ }
49598
+ var lmstudio;
49599
+ var init_lmstudio = __esm(() => {
49600
+ init_dist6();
49601
+ lmstudio = {
49602
+ id: "lmstudio",
49603
+ name: "LM Studio",
49604
+ envVar: "LM_API_TOKEN",
49605
+ secretKey: "lm-api-token",
49606
+ icon: "\uEA79",
49607
+ asciiIcon: "L",
49608
+ description: "Local models via LM Studio \u2014 no key needed",
49609
+ createModel(modelId) {
49610
+ const client = createOpenAI({
49611
+ baseURL: openaiBase(),
49612
+ apiKey: getApiToken()
49613
+ });
49614
+ return client.chat(modelId);
49615
+ },
49616
+ async fetchModels() {
49617
+ const res = await fetch(`${restBase()}/models`, {
49618
+ headers: authHeaders(),
49619
+ signal: AbortSignal.timeout(3000)
49620
+ });
49621
+ if (!res.ok)
49622
+ throw new Error(`LM Studio API ${String(res.status)}`);
49623
+ const data = await res.json();
49624
+ if (!Array.isArray(data.data))
49625
+ return null;
49626
+ return data.data.filter((m) => m.type === "llm" || m.type === "vlm").map((m) => ({
49627
+ id: m.id,
49628
+ name: m.id,
49629
+ contextWindow: m.max_context_length
49630
+ }));
49631
+ },
49632
+ fallbackModels: [],
49633
+ async checkAvailability() {
49634
+ try {
49635
+ const res = await fetch(`${restBase()}/models`, {
49636
+ headers: authHeaders(),
49637
+ signal: AbortSignal.timeout(1000)
49638
+ });
49639
+ return res.ok;
49640
+ } catch {
49641
+ return false;
49642
+ }
49643
+ },
49644
+ contextWindows: []
49645
+ };
49646
+ });
49647
+
49578
49648
  // node_modules/vercel-minimax-ai-provider/node_modules/@ai-sdk/anthropic/node_modules/@ai-sdk/provider/dist/index.mjs
49579
49649
  function getErrorMessage4(error48) {
49580
49650
  if (error48 == null) {
@@ -58676,6 +58746,9 @@ var init_mistral = __esm(() => {
58676
58746
  });
58677
58747
 
58678
58748
  // src/core/llm/providers/ollama.ts
58749
+ function getOllamaHost() {
58750
+ return (process.env.OLLAMA_HOST ?? "http://localhost:11434").replace(/\/+$/, "");
58751
+ }
58679
58752
  var ollama;
58680
58753
  var init_ollama = __esm(() => {
58681
58754
  init_dist6();
@@ -58683,18 +58756,18 @@ var init_ollama = __esm(() => {
58683
58756
  id: "ollama",
58684
58757
  name: "Ollama",
58685
58758
  envVar: "",
58686
- icon: "\uD83E\uDD99",
58687
- asciiIcon: "\uD83E\uDD99",
58759
+ icon: "\uEBA2",
58760
+ asciiIcon: "O",
58688
58761
  description: "Local models \u2014 no key needed",
58689
58762
  createModel(modelId) {
58690
58763
  const client = createOpenAI({
58691
- baseURL: "http://localhost:11434/v1",
58764
+ baseURL: `${getOllamaHost()}/v1`,
58692
58765
  apiKey: "ollama"
58693
58766
  });
58694
58767
  return client.chat(modelId);
58695
58768
  },
58696
58769
  async fetchModels() {
58697
- const res = await fetch("http://localhost:11434/api/tags");
58770
+ const res = await fetch(`${getOllamaHost()}/api/tags`);
58698
58771
  if (!res.ok)
58699
58772
  throw new Error(`Ollama API ${String(res.status)}`);
58700
58773
  const data = await res.json();
@@ -58721,7 +58794,7 @@ var init_ollama = __esm(() => {
58721
58794
  }],
58722
58795
  async checkAvailability() {
58723
58796
  try {
58724
- const res = await fetch("http://localhost:11434/api/tags", {
58797
+ const res = await fetch(`${getOllamaHost()}/api/tags`, {
58725
58798
  signal: AbortSignal.timeout(1000)
58726
58799
  });
58727
58800
  return res.ok;
@@ -77730,9 +77803,11 @@ __export(exports_providers, {
77730
77803
  proxy: () => proxy2,
77731
77804
  openrouter: () => openrouter2,
77732
77805
  openai: () => openai2,
77806
+ onProvidersChanged: () => onProvidersChanged,
77733
77807
  ollama: () => ollama,
77734
77808
  mistral: () => mistral2,
77735
77809
  minimax: () => minimax2,
77810
+ lmstudio: () => lmstudio,
77736
77811
  llmgateway: () => llmgateway2,
77737
77812
  groq: () => groq2,
77738
77813
  google: () => google2,
@@ -77747,6 +77822,9 @@ __export(exports_providers, {
77747
77822
  bedrock: () => bedrock2,
77748
77823
  anthropic: () => anthropic2
77749
77824
  });
77825
+ function onProvidersChanged(fn) {
77826
+ changeListeners.push(fn);
77827
+ }
77750
77828
  function registerCustomProviders(configs) {
77751
77829
  const builtinIds = new Set(BUILTIN_PROVIDERS.map((p) => p.id));
77752
77830
  const seen = new Map;
@@ -77765,6 +77843,8 @@ function registerCustomProviders(configs) {
77765
77843
  }
77766
77844
  allProviders = [...BUILTIN_PROVIDERS, ...seen.values()];
77767
77845
  providerMap = new Map(allProviders.map((p) => [p.id, p]));
77846
+ for (const fn of changeListeners)
77847
+ fn();
77768
77848
  }
77769
77849
  function getProvider(id) {
77770
77850
  return providerMap.get(id);
@@ -77781,7 +77861,7 @@ function getProviderSecretEntries() {
77781
77861
  keyUrl: p.keyUrl
77782
77862
  }));
77783
77863
  }
77784
- var BUILTIN_PROVIDERS, allProviders, providerMap;
77864
+ var BUILTIN_PROVIDERS, allProviders, providerMap, changeListeners;
77785
77865
  var init_providers = __esm(() => {
77786
77866
  init_anthropic();
77787
77867
  init_bedrock();
@@ -77793,6 +77873,7 @@ var init_providers = __esm(() => {
77793
77873
  init_google();
77794
77874
  init_groq();
77795
77875
  init_llmgateway();
77876
+ init_lmstudio();
77796
77877
  init_minimax();
77797
77878
  init_mistral();
77798
77879
  init_ollama();
@@ -77811,6 +77892,7 @@ var init_providers = __esm(() => {
77811
77892
  init_google();
77812
77893
  init_groq();
77813
77894
  init_llmgateway();
77895
+ init_lmstudio();
77814
77896
  init_minimax();
77815
77897
  init_mistral();
77816
77898
  init_ollama();
@@ -77819,9 +77901,10 @@ var init_providers = __esm(() => {
77819
77901
  init_proxy();
77820
77902
  init_vercel_gateway();
77821
77903
  init_xai();
77822
- BUILTIN_PROVIDERS = [llmgateway2, anthropic2, proxy2, vercelGatewayProvider, openai2, xai2, google2, groq2, deepseek2, mistral2, bedrock2, fireworks2, minimax2, copilot, githubModels, openrouter2, ollama];
77904
+ BUILTIN_PROVIDERS = [llmgateway2, anthropic2, proxy2, vercelGatewayProvider, openai2, xai2, google2, groq2, deepseek2, mistral2, bedrock2, fireworks2, minimax2, copilot, githubModels, openrouter2, ollama, lmstudio];
77823
77905
  allProviders = [...BUILTIN_PROVIDERS];
77824
77906
  providerMap = new Map(allProviders.map((p) => [p.id, p]));
77907
+ changeListeners = [];
77825
77908
  });
77826
77909
 
77827
77910
  // src/headless/constants.ts
@@ -78895,6 +78978,15 @@ __export(exports_models, {
78895
78978
  ensureModelMetadata: () => ensureModelMetadata,
78896
78979
  PROVIDER_CONFIGS: () => PROVIDER_CONFIGS
78897
78980
  });
78981
+ function buildProviderConfigs() {
78982
+ return getAllProviders().map((p) => ({
78983
+ id: p.id,
78984
+ name: p.name,
78985
+ envVar: p.envVar,
78986
+ grouped: p.grouped,
78987
+ fallbackModels: p.fallbackModels
78988
+ }));
78989
+ }
78898
78990
  function getModelContextInfoSync(modelId) {
78899
78991
  const slashIdx = modelId.indexOf("/");
78900
78992
  const providerId = slashIdx >= 0 ? modelId.slice(0, slashIdx) : "";
@@ -79465,13 +79557,10 @@ var init_models = __esm(() => {
79465
79557
  init_lifecycle();
79466
79558
  init_secrets();
79467
79559
  init_providers();
79468
- PROVIDER_CONFIGS = getAllProviders().map((p) => ({
79469
- id: p.id,
79470
- name: p.name,
79471
- envVar: p.envVar,
79472
- grouped: p.grouped,
79473
- fallbackModels: p.fallbackModels
79474
- }));
79560
+ PROVIDER_CONFIGS = buildProviderConfigs();
79561
+ onProvidersChanged(() => {
79562
+ PROVIDER_CONFIGS.splice(0, PROVIDER_CONFIGS.length, ...buildProviderConfigs());
79563
+ });
79475
79564
  MODEL_CACHE_TTL = 30 * 60000;
79476
79565
  modelCache = new Map;
79477
79566
  groupedCache = new Map;
@@ -448981,6 +449070,12 @@ function matchCopilotPricing(model) {
448981
449070
  }
448982
449071
  return;
448983
449072
  }
449073
+ function isModelLocal(modelId) {
449074
+ const slash = modelId.indexOf("/");
449075
+ if (slash < 0)
449076
+ return false;
449077
+ return LOCAL_PROVIDERS.has(modelId.slice(0, slash).toLowerCase());
449078
+ }
448984
449079
  function isModelFree(modelId) {
448985
449080
  const id = modelId.toLowerCase();
448986
449081
  if (id.endsWith(":free") || id.endsWith("-free"))
@@ -448995,7 +449090,7 @@ function isModelFree(modelId) {
448995
449090
  }
448996
449091
  function matchPricing(modelId) {
448997
449092
  const id = modelId.toLowerCase();
448998
- if (isModelFree(modelId))
449093
+ if (isModelLocal(modelId) || isModelFree(modelId))
448999
449094
  return FREE_PRICING;
449000
449095
  if (id.startsWith("copilot/")) {
449001
449096
  const model = id.slice("copilot/".length);
@@ -449219,7 +449314,7 @@ function startMemoryPoll(intervalMs = 2000) {
449219
449314
  });
449220
449315
  }, intervalMs);
449221
449316
  }
449222
- var MODEL_PRICING, FREE_PRICING, DEFAULT_PRICING, FREE, M025, M033, M1, M32, M30, COPILOT_PRICING, ZERO_USAGE, ZERO_PROCESS_RSS, useStatusBarStore, memPollStarted = false, memPollTimer = null;
449317
+ var MODEL_PRICING, FREE_PRICING, DEFAULT_PRICING, FREE, M025, M033, M1, M32, M30, COPILOT_PRICING, LOCAL_PROVIDERS, ZERO_USAGE, ZERO_PROCESS_RSS, useStatusBarStore, memPollStarted = false, memPollTimer = null;
449223
449318
  var init_statusbar = __esm(() => {
449224
449319
  init_esm();
449225
449320
  init_middleware();
@@ -449619,6 +449714,7 @@ var init_statusbar = __esm(() => {
449619
449714
  "claude-opus-4.6": M32,
449620
449715
  "claude-opus-4.6-fast": M30
449621
449716
  };
449717
+ LOCAL_PROVIDERS = new Set(["ollama", "lmstudio"]);
449622
449718
  ZERO_USAGE = {
449623
449719
  prompt: 0,
449624
449720
  completion: 0,
@@ -463414,6 +463510,44 @@ var init_Markdown = __esm(async () => {
463414
463510
  });
463415
463511
  });
463416
463512
 
463513
+ // src/types/plan-schema.ts
463514
+ function parsePlanOutput(raw2) {
463515
+ if (raw2 == null || typeof raw2 !== "object")
463516
+ return null;
463517
+ const result = planOutputSchema.safeParse(raw2);
463518
+ if (!result.success)
463519
+ return null;
463520
+ return result.data;
463521
+ }
463522
+ var planSymbolChangeSchema, planFileChangeSchema, planOutputSchema;
463523
+ var init_plan_schema = __esm(() => {
463524
+ init_zod();
463525
+ planSymbolChangeSchema = exports_external.object({
463526
+ name: exports_external.string(),
463527
+ kind: exports_external.string(),
463528
+ action: exports_external.enum(["add", "modify", "remove", "rename"]),
463529
+ details: exports_external.string(),
463530
+ line: exports_external.number().nullable().optional().transform((v4) => v4 ?? undefined)
463531
+ });
463532
+ planFileChangeSchema = exports_external.object({
463533
+ path: exports_external.string(),
463534
+ action: exports_external.enum(["create", "modify", "delete"]),
463535
+ description: exports_external.string(),
463536
+ symbols: exports_external.array(planSymbolChangeSchema).nullable().optional().catch(undefined).transform((v4) => v4 ?? undefined)
463537
+ });
463538
+ planOutputSchema = exports_external.object({
463539
+ title: exports_external.string(),
463540
+ context: exports_external.string().catch(""),
463541
+ files: exports_external.array(planFileChangeSchema),
463542
+ steps: exports_external.array(exports_external.object({
463543
+ id: exports_external.string(),
463544
+ label: exports_external.string(),
463545
+ details: exports_external.string().optional()
463546
+ })),
463547
+ verification: exports_external.array(exports_external.string()).catch([])
463548
+ });
463549
+ });
463550
+
463417
463551
  // src/components/plan/StructuredPlanView.tsx
463418
463552
  function getActionColors(t2) {
463419
463553
  return {
@@ -463431,7 +463565,7 @@ function getSymbolActionColors(t2) {
463431
463565
  };
463432
463566
  }
463433
463567
  function StructuredPlanView(t0) {
463434
- const $5 = import_compiler_runtime14.c(124);
463568
+ const $5 = import_compiler_runtime14.c(105);
463435
463569
  const {
463436
463570
  plan,
463437
463571
  result,
@@ -463446,618 +463580,573 @@ function StructuredPlanView(t0) {
463446
463580
  const STEP_NUM_COLOR = t2.brandAlt;
463447
463581
  const TEXT_COLOR = t2.textSecondary;
463448
463582
  const CHECK_COLOR = t2.success;
463583
+ const {
463584
+ files,
463585
+ steps,
463586
+ verification,
463587
+ context: context2
463588
+ } = plan;
463589
+ let resolvedFile = planFile;
463590
+ if (!resolvedFile && result) {
463591
+ try {
463592
+ let t14;
463593
+ if ($5[0] !== result) {
463594
+ t14 = JSON.parse(result);
463595
+ $5[0] = result;
463596
+ $5[1] = t14;
463597
+ } else {
463598
+ t14 = $5[1];
463599
+ }
463600
+ const parsed = t14;
463601
+ if (typeof parsed.file === "string") {
463602
+ resolvedFile = parsed.file;
463603
+ }
463604
+ } catch {}
463605
+ }
463449
463606
  let t1;
463450
- let t10;
463607
+ if ($5[2] !== result) {
463608
+ t1 = result?.includes("cancelled by user");
463609
+ $5[2] = result;
463610
+ $5[3] = t1;
463611
+ } else {
463612
+ t1 = $5[3];
463613
+ }
463614
+ const isCancelled = t1;
463451
463615
  let t22;
463616
+ if ($5[4] !== result) {
463617
+ t22 = result?.startsWith("User wants changes to the plan:");
463618
+ $5[4] = result;
463619
+ $5[5] = t22;
463620
+ } else {
463621
+ t22 = $5[5];
463622
+ }
463623
+ const isRevised = t22;
463452
463624
  let t3;
463625
+ if ($5[6] !== isRevised || $5[7] !== result) {
463626
+ t3 = isRevised && result ? result.replace("User wants changes to the plan: ", "") : null;
463627
+ $5[6] = isRevised;
463628
+ $5[7] = result;
463629
+ $5[8] = t3;
463630
+ } else {
463631
+ t3 = $5[8];
463632
+ }
463633
+ const reviseFeedback = t3;
463634
+ const isRejected = isCancelled || isRevised;
463635
+ const borderColor = isRejected ? t2.textSubtle : BORDER;
463636
+ const titleColor = isRejected ? t2.textMuted : TITLE_COLOR;
463637
+ if (collapsed) {
463638
+ let t42;
463639
+ if ($5[9] !== plan.files) {
463640
+ t42 = plan.files ?? [];
463641
+ $5[9] = plan.files;
463642
+ $5[10] = t42;
463643
+ } else {
463644
+ t42 = $5[10];
463645
+ }
463646
+ const files_0 = t42;
463647
+ let t52;
463648
+ if ($5[11] !== plan.steps) {
463649
+ t52 = plan.steps ?? [];
463650
+ $5[11] = plan.steps;
463651
+ $5[12] = t52;
463652
+ } else {
463653
+ t52 = $5[12];
463654
+ }
463655
+ const steps_0 = t52;
463656
+ let t62;
463657
+ if ($5[13] !== CHECK_COLOR) {
463658
+ t62 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463659
+ fg: CHECK_COLOR,
463660
+ children: "\u2713 "
463661
+ }, undefined, false, undefined, this);
463662
+ $5[13] = CHECK_COLOR;
463663
+ $5[14] = t62;
463664
+ } else {
463665
+ t62 = $5[14];
463666
+ }
463667
+ let t72;
463668
+ if ($5[15] !== TITLE_COLOR || $5[16] !== plan.title) {
463669
+ t72 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463670
+ fg: TITLE_COLOR,
463671
+ attributes: TextAttributes.BOLD,
463672
+ children: plan.title
463673
+ }, undefined, false, undefined, this);
463674
+ $5[15] = TITLE_COLOR;
463675
+ $5[16] = plan.title;
463676
+ $5[17] = t72;
463677
+ } else {
463678
+ t72 = $5[17];
463679
+ }
463680
+ const t82 = t2.textMuted;
463681
+ const t92 = String(files_0.length);
463682
+ const t102 = files_0.length !== 1 ? "s" : "";
463683
+ const t112 = String(steps_0.length);
463684
+ const t122 = steps_0.length !== 1 ? "s" : "";
463685
+ let t132;
463686
+ if ($5[18] !== t2.textMuted || $5[19] !== t102 || $5[20] !== t112 || $5[21] !== t122 || $5[22] !== t92) {
463687
+ t132 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463688
+ fg: t82,
463689
+ children: [
463690
+ " ",
463691
+ "(",
463692
+ t92,
463693
+ " file",
463694
+ t102,
463695
+ ", ",
463696
+ t112,
463697
+ " step",
463698
+ t122,
463699
+ ")"
463700
+ ]
463701
+ }, undefined, true, undefined, this);
463702
+ $5[18] = t2.textMuted;
463703
+ $5[19] = t102;
463704
+ $5[20] = t112;
463705
+ $5[21] = t122;
463706
+ $5[22] = t92;
463707
+ $5[23] = t132;
463708
+ } else {
463709
+ t132 = $5[23];
463710
+ }
463711
+ let t14;
463712
+ if ($5[24] !== resolvedFile || $5[25] !== t2.textFaint || $5[26] !== t2.textMuted) {
463713
+ t14 = resolvedFile ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(import_jsx_dev_runtime2.Fragment, {
463714
+ children: [
463715
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463716
+ fg: t2.textFaint,
463717
+ children: " \u2500 "
463718
+ }, undefined, false, undefined, this),
463719
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463720
+ fg: t2.textMuted,
463721
+ children: resolvedFile
463722
+ }, undefined, false, undefined, this)
463723
+ ]
463724
+ }, undefined, true, undefined, this) : null;
463725
+ $5[24] = resolvedFile;
463726
+ $5[25] = t2.textFaint;
463727
+ $5[26] = t2.textMuted;
463728
+ $5[27] = t14;
463729
+ } else {
463730
+ t14 = $5[27];
463731
+ }
463732
+ let t15;
463733
+ if ($5[28] !== t132 || $5[29] !== t14 || $5[30] !== t62 || $5[31] !== t72) {
463734
+ t15 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
463735
+ height: 1,
463736
+ flexShrink: 0,
463737
+ children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
463738
+ truncate: true,
463739
+ children: [
463740
+ t62,
463741
+ t72,
463742
+ t132,
463743
+ t14
463744
+ ]
463745
+ }, undefined, true, undefined, this)
463746
+ }, undefined, false, undefined, this);
463747
+ $5[28] = t132;
463748
+ $5[29] = t14;
463749
+ $5[30] = t62;
463750
+ $5[31] = t72;
463751
+ $5[32] = t15;
463752
+ } else {
463753
+ t15 = $5[32];
463754
+ }
463755
+ return t15;
463756
+ }
463757
+ if (isRejected) {
463758
+ let t42;
463759
+ if ($5[33] !== titleColor) {
463760
+ t42 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463761
+ fg: titleColor,
463762
+ children: "\uF0CB"
463763
+ }, undefined, false, undefined, this);
463764
+ $5[33] = titleColor;
463765
+ $5[34] = t42;
463766
+ } else {
463767
+ t42 = $5[34];
463768
+ }
463769
+ let t52;
463770
+ if ($5[35] !== plan.title || $5[36] !== titleColor) {
463771
+ t52 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463772
+ fg: titleColor,
463773
+ attributes: TextAttributes.BOLD,
463774
+ children: plan.title
463775
+ }, undefined, false, undefined, this);
463776
+ $5[35] = plan.title;
463777
+ $5[36] = titleColor;
463778
+ $5[37] = t52;
463779
+ } else {
463780
+ t52 = $5[37];
463781
+ }
463782
+ let t62;
463783
+ if ($5[38] !== resolvedFile || $5[39] !== t2.textDim || $5[40] !== t2.textFaint) {
463784
+ t62 = resolvedFile ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(import_jsx_dev_runtime2.Fragment, {
463785
+ children: [
463786
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463787
+ fg: t2.textFaint,
463788
+ children: " \u2500 "
463789
+ }, undefined, false, undefined, this),
463790
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463791
+ fg: t2.textDim,
463792
+ children: resolvedFile
463793
+ }, undefined, false, undefined, this)
463794
+ ]
463795
+ }, undefined, true, undefined, this) : null;
463796
+ $5[38] = resolvedFile;
463797
+ $5[39] = t2.textDim;
463798
+ $5[40] = t2.textFaint;
463799
+ $5[41] = t62;
463800
+ } else {
463801
+ t62 = $5[41];
463802
+ }
463803
+ let t72;
463804
+ if ($5[42] !== t42 || $5[43] !== t52 || $5[44] !== t62) {
463805
+ t72 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
463806
+ truncate: true,
463807
+ children: [
463808
+ t42,
463809
+ " ",
463810
+ t52,
463811
+ t62
463812
+ ]
463813
+ }, undefined, true, undefined, this);
463814
+ $5[42] = t42;
463815
+ $5[43] = t52;
463816
+ $5[44] = t62;
463817
+ $5[45] = t72;
463818
+ } else {
463819
+ t72 = $5[45];
463820
+ }
463821
+ let t82;
463822
+ if ($5[46] !== t2.bgSecondary || $5[47] !== t72) {
463823
+ t82 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
463824
+ height: 1,
463825
+ flexShrink: 0,
463826
+ paddingX: 1,
463827
+ backgroundColor: t2.bgSecondary,
463828
+ alignSelf: "flex-start",
463829
+ marginTop: -1,
463830
+ children: t72
463831
+ }, undefined, false, undefined, this);
463832
+ $5[46] = t2.bgSecondary;
463833
+ $5[47] = t72;
463834
+ $5[48] = t82;
463835
+ } else {
463836
+ t82 = $5[48];
463837
+ }
463838
+ let t92;
463839
+ if ($5[49] !== isCancelled || $5[50] !== reviseFeedback || $5[51] !== t2.error || $5[52] !== t2.textSecondary || $5[53] !== t2.warning) {
463840
+ t92 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
463841
+ paddingX: 1,
463842
+ children: isCancelled ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
463843
+ fg: t2.error,
463844
+ children: "\u2717 Plan cancelled"
463845
+ }, undefined, false, undefined, this) : /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
463846
+ children: [
463847
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463848
+ fg: t2.warning,
463849
+ children: "\u21BB Revision requested: "
463850
+ }, undefined, false, undefined, this),
463851
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463852
+ fg: t2.textSecondary,
463853
+ children: reviseFeedback
463854
+ }, undefined, false, undefined, this)
463855
+ ]
463856
+ }, undefined, true, undefined, this)
463857
+ }, undefined, false, undefined, this);
463858
+ $5[49] = isCancelled;
463859
+ $5[50] = reviseFeedback;
463860
+ $5[51] = t2.error;
463861
+ $5[52] = t2.textSecondary;
463862
+ $5[53] = t2.warning;
463863
+ $5[54] = t92;
463864
+ } else {
463865
+ t92 = $5[54];
463866
+ }
463867
+ let t102;
463868
+ if ($5[55] !== borderColor || $5[56] !== t82 || $5[57] !== t92) {
463869
+ t102 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
463870
+ flexDirection: "column",
463871
+ flexShrink: 0,
463872
+ border: true,
463873
+ borderStyle: "rounded",
463874
+ borderColor,
463875
+ children: [
463876
+ t82,
463877
+ t92
463878
+ ]
463879
+ }, undefined, true, undefined, this);
463880
+ $5[55] = borderColor;
463881
+ $5[56] = t82;
463882
+ $5[57] = t92;
463883
+ $5[58] = t102;
463884
+ } else {
463885
+ t102 = $5[58];
463886
+ }
463887
+ return t102;
463888
+ }
463453
463889
  let t4;
463890
+ if ($5[59] !== TITLE_COLOR) {
463891
+ t4 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463892
+ fg: TITLE_COLOR,
463893
+ children: "\uF0CB"
463894
+ }, undefined, false, undefined, this);
463895
+ $5[59] = TITLE_COLOR;
463896
+ $5[60] = t4;
463897
+ } else {
463898
+ t4 = $5[60];
463899
+ }
463454
463900
  let t5;
463901
+ if ($5[61] !== TITLE_COLOR || $5[62] !== plan.title) {
463902
+ t5 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463903
+ fg: TITLE_COLOR,
463904
+ attributes: TextAttributes.BOLD,
463905
+ children: plan.title
463906
+ }, undefined, false, undefined, this);
463907
+ $5[61] = TITLE_COLOR;
463908
+ $5[62] = plan.title;
463909
+ $5[63] = t5;
463910
+ } else {
463911
+ t5 = $5[63];
463912
+ }
463455
463913
  let t6;
463914
+ if ($5[64] !== resolvedFile || $5[65] !== t2.textFaint || $5[66] !== t2.textMuted) {
463915
+ t6 = resolvedFile ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(import_jsx_dev_runtime2.Fragment, {
463916
+ children: [
463917
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463918
+ fg: t2.textFaint,
463919
+ children: " \u2500 "
463920
+ }, undefined, false, undefined, this),
463921
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463922
+ fg: t2.textMuted,
463923
+ children: resolvedFile
463924
+ }, undefined, false, undefined, this)
463925
+ ]
463926
+ }, undefined, true, undefined, this) : null;
463927
+ $5[64] = resolvedFile;
463928
+ $5[65] = t2.textFaint;
463929
+ $5[66] = t2.textMuted;
463930
+ $5[67] = t6;
463931
+ } else {
463932
+ t6 = $5[67];
463933
+ }
463456
463934
  let t7;
463935
+ if ($5[68] !== t4 || $5[69] !== t5 || $5[70] !== t6) {
463936
+ t7 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
463937
+ truncate: true,
463938
+ children: [
463939
+ t4,
463940
+ " ",
463941
+ t5,
463942
+ t6
463943
+ ]
463944
+ }, undefined, true, undefined, this);
463945
+ $5[68] = t4;
463946
+ $5[69] = t5;
463947
+ $5[70] = t6;
463948
+ $5[71] = t7;
463949
+ } else {
463950
+ t7 = $5[71];
463951
+ }
463457
463952
  let t8;
463953
+ if ($5[72] !== t2.bgSecondary || $5[73] !== t7) {
463954
+ t8 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
463955
+ height: 1,
463956
+ flexShrink: 0,
463957
+ paddingX: 1,
463958
+ backgroundColor: t2.bgSecondary,
463959
+ alignSelf: "flex-start",
463960
+ marginTop: -1,
463961
+ children: t7
463962
+ }, undefined, false, undefined, this);
463963
+ $5[72] = t2.bgSecondary;
463964
+ $5[73] = t7;
463965
+ $5[74] = t8;
463966
+ } else {
463967
+ t8 = $5[74];
463968
+ }
463458
463969
  let t9;
463459
- let verification;
463460
- if ($5[0] !== BORDER || $5[1] !== CHECK_COLOR || $5[2] !== FILE_PATH_COLOR || $5[3] !== SECTION_COLOR || $5[4] !== STEP_NUM_COLOR || $5[5] !== TEXT_COLOR || $5[6] !== TITLE_COLOR || $5[7] !== collapsed || $5[8] !== plan.context || $5[9] !== plan.files || $5[10] !== plan.steps || $5[11] !== plan.title || $5[12] !== plan.verification || $5[13] !== planFile || $5[14] !== result || $5[15] !== t2) {
463461
- t10 = Symbol.for("react.early_return_sentinel");
463462
- bb0: {
463463
- const files = plan.files ?? [];
463464
- const steps = plan.steps ?? [];
463465
- let t112;
463466
- if ($5[27] !== plan.verification) {
463467
- t112 = plan.verification ?? [];
463468
- $5[27] = plan.verification;
463469
- $5[28] = t112;
463470
- } else {
463471
- t112 = $5[28];
463472
- }
463473
- verification = t112;
463474
- const context2 = plan.context ?? "";
463475
- let resolvedFile = planFile;
463476
- if (!resolvedFile && result) {
463477
- try {
463478
- let t123;
463479
- if ($5[29] !== result) {
463480
- t123 = JSON.parse(result);
463481
- $5[29] = result;
463482
- $5[30] = t123;
463483
- } else {
463484
- t123 = $5[30];
463485
- }
463486
- const parsed = t123;
463487
- if (typeof parsed.file === "string") {
463488
- resolvedFile = parsed.file;
463489
- }
463490
- } catch {}
463491
- }
463492
- let t122;
463493
- if ($5[31] !== result) {
463494
- t122 = result?.includes("cancelled by user");
463495
- $5[31] = result;
463496
- $5[32] = t122;
463497
- } else {
463498
- t122 = $5[32];
463499
- }
463500
- const isCancelled = t122;
463501
- let t13;
463502
- if ($5[33] !== result) {
463503
- t13 = result?.startsWith("User wants changes to the plan:");
463504
- $5[33] = result;
463505
- $5[34] = t13;
463506
- } else {
463507
- t13 = $5[34];
463508
- }
463509
- const isRevised = t13;
463510
- let t14;
463511
- if ($5[35] !== isRevised || $5[36] !== result) {
463512
- t14 = isRevised && result ? result.replace("User wants changes to the plan: ", "") : null;
463513
- $5[35] = isRevised;
463514
- $5[36] = result;
463515
- $5[37] = t14;
463516
- } else {
463517
- t14 = $5[37];
463518
- }
463519
- const reviseFeedback = t14;
463520
- const isRejected = isCancelled || isRevised;
463521
- const borderColor = isRejected ? t2.textSubtle : BORDER;
463522
- const titleColor = isRejected ? t2.textMuted : TITLE_COLOR;
463523
- if (collapsed) {
463524
- let t152;
463525
- if ($5[38] !== plan.files) {
463526
- t152 = plan.files ?? [];
463527
- $5[38] = plan.files;
463528
- $5[39] = t152;
463529
- } else {
463530
- t152 = $5[39];
463531
- }
463532
- const files_0 = t152;
463533
- let t162;
463534
- if ($5[40] !== plan.steps) {
463535
- t162 = plan.steps ?? [];
463536
- $5[40] = plan.steps;
463537
- $5[41] = t162;
463538
- } else {
463539
- t162 = $5[41];
463540
- }
463541
- const steps_0 = t162;
463542
- let t172;
463543
- if ($5[42] !== CHECK_COLOR) {
463544
- t172 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463545
- fg: CHECK_COLOR,
463546
- children: "\u2713 "
463547
- }, undefined, false, undefined, this);
463548
- $5[42] = CHECK_COLOR;
463549
- $5[43] = t172;
463550
- } else {
463551
- t172 = $5[43];
463552
- }
463553
- let t182;
463554
- if ($5[44] !== TITLE_COLOR || $5[45] !== plan.title) {
463555
- t182 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463556
- fg: TITLE_COLOR,
463557
- attributes: TextAttributes.BOLD,
463558
- children: plan.title
463559
- }, undefined, false, undefined, this);
463560
- $5[44] = TITLE_COLOR;
463561
- $5[45] = plan.title;
463562
- $5[46] = t182;
463563
- } else {
463564
- t182 = $5[46];
463565
- }
463566
- const t19 = t2.textMuted;
463567
- const t20 = String(files_0.length);
463568
- const t21 = files_0.length !== 1 ? "s" : "";
463569
- const t222 = String(steps_0.length);
463570
- const t23 = steps_0.length !== 1 ? "s" : "";
463571
- let t24;
463572
- if ($5[47] !== t2.textMuted || $5[48] !== t20 || $5[49] !== t21 || $5[50] !== t222 || $5[51] !== t23) {
463573
- t24 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463574
- fg: t19,
463575
- children: [
463576
- " ",
463577
- "(",
463578
- t20,
463579
- " file",
463580
- t21,
463581
- ", ",
463582
- t222,
463583
- " step",
463584
- t23,
463585
- ")"
463586
- ]
463587
- }, undefined, true, undefined, this);
463588
- $5[47] = t2.textMuted;
463589
- $5[48] = t20;
463590
- $5[49] = t21;
463591
- $5[50] = t222;
463592
- $5[51] = t23;
463593
- $5[52] = t24;
463594
- } else {
463595
- t24 = $5[52];
463596
- }
463597
- let t25;
463598
- if ($5[53] !== resolvedFile || $5[54] !== t2.textFaint || $5[55] !== t2.textMuted) {
463599
- t25 = resolvedFile ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(import_jsx_dev_runtime2.Fragment, {
463600
- children: [
463601
- /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463602
- fg: t2.textFaint,
463603
- children: " \u2500 "
463604
- }, undefined, false, undefined, this),
463605
- /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463606
- fg: t2.textMuted,
463607
- children: resolvedFile
463608
- }, undefined, false, undefined, this)
463609
- ]
463610
- }, undefined, true, undefined, this) : null;
463611
- $5[53] = resolvedFile;
463612
- $5[54] = t2.textFaint;
463613
- $5[55] = t2.textMuted;
463614
- $5[56] = t25;
463615
- } else {
463616
- t25 = $5[56];
463617
- }
463618
- let t26;
463619
- if ($5[57] !== t172 || $5[58] !== t182 || $5[59] !== t24 || $5[60] !== t25) {
463620
- t26 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
463621
- height: 1,
463622
- flexShrink: 0,
463623
- children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
463624
- truncate: true,
463970
+ if ($5[75] !== SECTION_COLOR || $5[76] !== TEXT_COLOR || $5[77] !== context2) {
463971
+ t9 = context2 && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
463972
+ flexDirection: "column",
463973
+ paddingX: 1,
463974
+ children: [
463975
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
463976
+ fg: SECTION_COLOR,
463977
+ attributes: TextAttributes.BOLD,
463978
+ children: "Context"
463979
+ }, undefined, false, undefined, this),
463980
+ context2.split(`
463981
+ `).map((line2, i4) => /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
463982
+ fg: TEXT_COLOR,
463983
+ children: line2
463984
+ }, `ctx-${String(i4)}`, false, undefined, this))
463985
+ ]
463986
+ }, undefined, true, undefined, this);
463987
+ $5[75] = SECTION_COLOR;
463988
+ $5[76] = TEXT_COLOR;
463989
+ $5[77] = context2;
463990
+ $5[78] = t9;
463991
+ } else {
463992
+ t9 = $5[78];
463993
+ }
463994
+ let t10;
463995
+ if ($5[79] !== FILE_PATH_COLOR || $5[80] !== SECTION_COLOR || $5[81] !== context2 || $5[82] !== files || $5[83] !== t2) {
463996
+ t10 = files.length > 0 && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
463997
+ flexDirection: "column",
463998
+ paddingX: 1,
463999
+ marginTop: context2 ? 1 : 0,
464000
+ children: [
464001
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
464002
+ children: [
464003
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
464004
+ fg: SECTION_COLOR,
464005
+ attributes: TextAttributes.BOLD,
464006
+ children: "Files"
464007
+ }, undefined, false, undefined, this),
464008
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
464009
+ fg: t2.textMuted,
463625
464010
  children: [
463626
- t172,
463627
- t182,
463628
- t24,
463629
- t25
464011
+ " (",
464012
+ String(files.length),
464013
+ ")"
463630
464014
  ]
463631
464015
  }, undefined, true, undefined, this)
463632
- }, undefined, false, undefined, this);
463633
- $5[57] = t172;
463634
- $5[58] = t182;
463635
- $5[59] = t24;
463636
- $5[60] = t25;
463637
- $5[61] = t26;
463638
- } else {
463639
- t26 = $5[61];
463640
- }
463641
- t10 = t26;
463642
- break bb0;
463643
- }
463644
- if (isRejected) {
463645
- let t152;
463646
- if ($5[62] !== titleColor) {
463647
- t152 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463648
- fg: titleColor,
463649
- children: "\uF0CB"
463650
- }, undefined, false, undefined, this);
463651
- $5[62] = titleColor;
463652
- $5[63] = t152;
463653
- } else {
463654
- t152 = $5[63];
463655
- }
463656
- let t162;
463657
- if ($5[64] !== plan.title || $5[65] !== titleColor) {
463658
- t162 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463659
- fg: titleColor,
463660
- attributes: TextAttributes.BOLD,
463661
- children: plan.title
463662
- }, undefined, false, undefined, this);
463663
- $5[64] = plan.title;
463664
- $5[65] = titleColor;
463665
- $5[66] = t162;
463666
- } else {
463667
- t162 = $5[66];
463668
- }
463669
- let t172;
463670
- if ($5[67] !== resolvedFile || $5[68] !== t2.textDim || $5[69] !== t2.textFaint) {
463671
- t172 = resolvedFile ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(import_jsx_dev_runtime2.Fragment, {
463672
- children: [
463673
- /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463674
- fg: t2.textFaint,
463675
- children: " \u2500 "
463676
- }, undefined, false, undefined, this),
463677
- /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463678
- fg: t2.textDim,
463679
- children: resolvedFile
463680
- }, undefined, false, undefined, this)
463681
- ]
463682
- }, undefined, true, undefined, this) : null;
463683
- $5[67] = resolvedFile;
463684
- $5[68] = t2.textDim;
463685
- $5[69] = t2.textFaint;
463686
- $5[70] = t172;
463687
- } else {
463688
- t172 = $5[70];
463689
- }
463690
- let t182;
463691
- if ($5[71] !== t152 || $5[72] !== t162 || $5[73] !== t172) {
463692
- t182 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
463693
- truncate: true,
463694
- children: [
463695
- t152,
463696
- " ",
463697
- t162,
463698
- t172
463699
- ]
463700
- }, undefined, true, undefined, this);
463701
- $5[71] = t152;
463702
- $5[72] = t162;
463703
- $5[73] = t172;
463704
- $5[74] = t182;
463705
- } else {
463706
- t182 = $5[74];
463707
- }
463708
- let t19;
463709
- if ($5[75] !== t2.bgSecondary || $5[76] !== t182) {
463710
- t19 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
463711
- height: 1,
463712
- flexShrink: 0,
463713
- paddingX: 1,
463714
- backgroundColor: t2.bgSecondary,
463715
- alignSelf: "flex-start",
463716
- marginTop: -1,
463717
- children: t182
463718
- }, undefined, false, undefined, this);
463719
- $5[75] = t2.bgSecondary;
463720
- $5[76] = t182;
463721
- $5[77] = t19;
463722
- } else {
463723
- t19 = $5[77];
463724
- }
463725
- let t20;
463726
- if ($5[78] !== isCancelled || $5[79] !== reviseFeedback || $5[80] !== t2.error || $5[81] !== t2.textSecondary || $5[82] !== t2.warning) {
463727
- t20 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
463728
- paddingX: 1,
463729
- children: isCancelled ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
463730
- fg: t2.error,
463731
- children: "\u2717 Plan cancelled"
463732
- }, undefined, false, undefined, this) : /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
464016
+ ]
464017
+ }, undefined, true, undefined, this),
464018
+ files.slice(0, MAX_VISIBLE2).map((f3) => /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
464019
+ flexDirection: "column",
464020
+ children: [
464021
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
464022
+ children: [
464023
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
464024
+ fg: getActionColors(t2)[f3.action] ?? t2.textSecondary,
464025
+ children: [
464026
+ ACTION_ICONS[f3.action] ?? "?",
464027
+ " "
464028
+ ]
464029
+ }, undefined, true, undefined, this),
464030
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
464031
+ fg: FILE_PATH_COLOR,
464032
+ children: f3.path
464033
+ }, undefined, false, undefined, this)
464034
+ ]
464035
+ }, undefined, true, undefined, this),
464036
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
464037
+ fg: t2.textMuted,
464038
+ children: [
464039
+ " ",
464040
+ f3.description
464041
+ ]
464042
+ }, undefined, true, undefined, this),
464043
+ f3.symbols?.map((s2, si) => /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
464044
+ fg: t2.textMuted,
463733
464045
  children: [
464046
+ " ",
463734
464047
  /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463735
- fg: t2.warning,
463736
- children: "\u21BB Revision requested: "
464048
+ fg: getSymbolActionColors(t2)[s2.action] ?? t2.textSecondary,
464049
+ children: s2.action
463737
464050
  }, undefined, false, undefined, this),
464051
+ " ",
463738
464052
  /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463739
464053
  fg: t2.textSecondary,
463740
- children: reviseFeedback
463741
- }, undefined, false, undefined, this)
464054
+ children: s2.name
464055
+ }, undefined, false, undefined, this),
464056
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
464057
+ fg: t2.textMuted,
464058
+ children: [
464059
+ " (",
464060
+ s2.kind,
464061
+ ")"
464062
+ ]
464063
+ }, undefined, true, undefined, this)
463742
464064
  ]
463743
- }, undefined, true, undefined, this)
463744
- }, undefined, false, undefined, this);
463745
- $5[78] = isCancelled;
463746
- $5[79] = reviseFeedback;
463747
- $5[80] = t2.error;
463748
- $5[81] = t2.textSecondary;
463749
- $5[82] = t2.warning;
463750
- $5[83] = t20;
463751
- } else {
463752
- t20 = $5[83];
463753
- }
463754
- let t21;
463755
- if ($5[84] !== borderColor || $5[85] !== t19 || $5[86] !== t20) {
463756
- t21 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
463757
- flexDirection: "column",
463758
- flexShrink: 0,
463759
- border: true,
463760
- borderStyle: "rounded",
463761
- borderColor,
463762
- children: [
463763
- t19,
463764
- t20
463765
- ]
463766
- }, undefined, true, undefined, this);
463767
- $5[84] = borderColor;
463768
- $5[85] = t19;
463769
- $5[86] = t20;
463770
- $5[87] = t21;
463771
- } else {
463772
- t21 = $5[87];
463773
- }
463774
- t10 = t21;
463775
- break bb0;
463776
- }
463777
- t1 = "column";
463778
- t22 = 0;
463779
- t3 = true;
463780
- t4 = "rounded";
463781
- t5 = BORDER;
463782
- let t15;
463783
- if ($5[88] !== TITLE_COLOR) {
463784
- t15 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463785
- fg: TITLE_COLOR,
463786
- children: "\uF0CB"
463787
- }, undefined, false, undefined, this);
463788
- $5[88] = TITLE_COLOR;
463789
- $5[89] = t15;
463790
- } else {
463791
- t15 = $5[89];
463792
- }
463793
- let t16;
463794
- if ($5[90] !== TITLE_COLOR || $5[91] !== plan.title) {
463795
- t16 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463796
- fg: TITLE_COLOR,
463797
- attributes: TextAttributes.BOLD,
463798
- children: plan.title
463799
- }, undefined, false, undefined, this);
463800
- $5[90] = TITLE_COLOR;
463801
- $5[91] = plan.title;
463802
- $5[92] = t16;
463803
- } else {
463804
- t16 = $5[92];
463805
- }
463806
- let t17;
463807
- if ($5[93] !== resolvedFile || $5[94] !== t2.textFaint || $5[95] !== t2.textMuted) {
463808
- t17 = resolvedFile ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(import_jsx_dev_runtime2.Fragment, {
464065
+ }, `${f3.path}-s${String(si)}`, true, undefined, this))
464066
+ ]
464067
+ }, f3.path, true, undefined, this)),
464068
+ files.length > MAX_VISIBLE2 && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
464069
+ fg: t2.textMuted,
464070
+ children: [
464071
+ "+",
464072
+ String(files.length - MAX_VISIBLE2),
464073
+ " more"
464074
+ ]
464075
+ }, undefined, true, undefined, this)
464076
+ ]
464077
+ }, undefined, true, undefined, this);
464078
+ $5[79] = FILE_PATH_COLOR;
464079
+ $5[80] = SECTION_COLOR;
464080
+ $5[81] = context2;
464081
+ $5[82] = files;
464082
+ $5[83] = t2;
464083
+ $5[84] = t10;
464084
+ } else {
464085
+ t10 = $5[84];
464086
+ }
464087
+ let t11;
464088
+ if ($5[85] !== SECTION_COLOR || $5[86] !== STEP_NUM_COLOR || $5[87] !== TEXT_COLOR || $5[88] !== context2 || $5[89] !== files.length || $5[90] !== steps || $5[91] !== t2.textMuted) {
464089
+ t11 = steps.length > 0 && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
464090
+ flexDirection: "column",
464091
+ paddingX: 1,
464092
+ marginTop: files.length > 0 || context2 ? 1 : 0,
464093
+ children: [
464094
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
463809
464095
  children: [
463810
464096
  /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463811
- fg: t2.textFaint,
463812
- children: " \u2500 "
464097
+ fg: SECTION_COLOR,
464098
+ attributes: TextAttributes.BOLD,
464099
+ children: "Steps"
463813
464100
  }, undefined, false, undefined, this),
463814
464101
  /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463815
464102
  fg: t2.textMuted,
463816
- children: resolvedFile
463817
- }, undefined, false, undefined, this)
464103
+ children: [
464104
+ " (",
464105
+ String(steps.length),
464106
+ ")"
464107
+ ]
464108
+ }, undefined, true, undefined, this)
463818
464109
  ]
463819
- }, undefined, true, undefined, this) : null;
463820
- $5[93] = resolvedFile;
463821
- $5[94] = t2.textFaint;
463822
- $5[95] = t2.textMuted;
463823
- $5[96] = t17;
463824
- } else {
463825
- t17 = $5[96];
463826
- }
463827
- let t18;
463828
- if ($5[97] !== t15 || $5[98] !== t16 || $5[99] !== t17) {
463829
- t18 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
463830
- truncate: true,
464110
+ }, undefined, true, undefined, this),
464111
+ steps.slice(0, MAX_VISIBLE2).map((s_0, i_0) => /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
463831
464112
  children: [
463832
- t15,
463833
- " ",
463834
- t16,
463835
- t17
464113
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
464114
+ fg: STEP_NUM_COLOR,
464115
+ children: [
464116
+ String(i_0 + 1),
464117
+ ". "
464118
+ ]
464119
+ }, undefined, true, undefined, this),
464120
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
464121
+ fg: TEXT_COLOR,
464122
+ children: s_0.label
464123
+ }, undefined, false, undefined, this)
463836
464124
  ]
463837
- }, undefined, true, undefined, this);
463838
- $5[97] = t15;
463839
- $5[98] = t16;
463840
- $5[99] = t17;
463841
- $5[100] = t18;
463842
- } else {
463843
- t18 = $5[100];
463844
- }
463845
- if ($5[101] !== t2.bgSecondary || $5[102] !== t18) {
463846
- t6 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
463847
- height: 1,
463848
- flexShrink: 0,
463849
- paddingX: 1,
463850
- backgroundColor: t2.bgSecondary,
463851
- alignSelf: "flex-start",
463852
- marginTop: -1,
463853
- children: t18
463854
- }, undefined, false, undefined, this);
463855
- $5[101] = t2.bgSecondary;
463856
- $5[102] = t18;
463857
- $5[103] = t6;
463858
- } else {
463859
- t6 = $5[103];
463860
- }
463861
- if ($5[104] !== SECTION_COLOR || $5[105] !== TEXT_COLOR || $5[106] !== context2) {
463862
- t7 = context2 && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
463863
- flexDirection: "column",
463864
- paddingX: 1,
464125
+ }, s_0.id, true, undefined, this)),
464126
+ steps.length > MAX_VISIBLE2 && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
464127
+ fg: t2.textMuted,
463865
464128
  children: [
463866
- /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
463867
- fg: SECTION_COLOR,
463868
- attributes: TextAttributes.BOLD,
463869
- children: "Context"
463870
- }, undefined, false, undefined, this),
463871
- context2.split(`
463872
- `).map((line2, i4) => /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
463873
- fg: TEXT_COLOR,
463874
- children: line2
463875
- }, `ctx-${String(i4)}`, false, undefined, this))
464129
+ "+",
464130
+ String(steps.length - MAX_VISIBLE2),
464131
+ " more"
463876
464132
  ]
463877
- }, undefined, true, undefined, this);
463878
- $5[104] = SECTION_COLOR;
463879
- $5[105] = TEXT_COLOR;
463880
- $5[106] = context2;
463881
- $5[107] = t7;
463882
- } else {
463883
- t7 = $5[107];
463884
- }
463885
- t8 = files.length > 0 && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
463886
- flexDirection: "column",
463887
- paddingX: 1,
463888
- marginTop: context2 ? 1 : 0,
463889
- children: [
463890
- /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
463891
- children: [
463892
- /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463893
- fg: SECTION_COLOR,
463894
- attributes: TextAttributes.BOLD,
463895
- children: "Files"
463896
- }, undefined, false, undefined, this),
463897
- /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463898
- fg: t2.textMuted,
463899
- children: [
463900
- " (",
463901
- String(files.length),
463902
- ")"
463903
- ]
463904
- }, undefined, true, undefined, this)
463905
- ]
463906
- }, undefined, true, undefined, this),
463907
- files.slice(0, MAX_VISIBLE2).map((f3) => /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
463908
- flexDirection: "column",
463909
- children: [
463910
- /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
463911
- children: [
463912
- /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463913
- fg: getActionColors(t2)[f3.action] ?? t2.textSecondary,
463914
- children: [
463915
- ACTION_ICONS[f3.action] ?? "?",
463916
- " "
463917
- ]
463918
- }, undefined, true, undefined, this),
463919
- /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463920
- fg: FILE_PATH_COLOR,
463921
- children: f3.path
463922
- }, undefined, false, undefined, this)
463923
- ]
463924
- }, undefined, true, undefined, this),
463925
- /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
463926
- fg: t2.textMuted,
463927
- children: [
463928
- " ",
463929
- f3.description
463930
- ]
463931
- }, undefined, true, undefined, this),
463932
- f3.symbols?.map((s2, si) => /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
463933
- fg: t2.textMuted,
463934
- children: [
463935
- " ",
463936
- /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463937
- fg: getSymbolActionColors(t2)[s2.action] ?? t2.textSecondary,
463938
- children: s2.action
463939
- }, undefined, false, undefined, this),
463940
- " ",
463941
- /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463942
- fg: t2.textSecondary,
463943
- children: s2.name
463944
- }, undefined, false, undefined, this),
463945
- /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463946
- fg: t2.textMuted,
463947
- children: [
463948
- " (",
463949
- s2.kind,
463950
- ")"
463951
- ]
463952
- }, undefined, true, undefined, this)
463953
- ]
463954
- }, `${f3.path}-s${String(si)}`, true, undefined, this))
463955
- ]
463956
- }, f3.path, true, undefined, this)),
463957
- files.length > MAX_VISIBLE2 && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
463958
- fg: t2.textMuted,
463959
- children: [
463960
- "+",
463961
- String(files.length - MAX_VISIBLE2),
463962
- " more"
463963
- ]
463964
- }, undefined, true, undefined, this)
463965
- ]
463966
- }, undefined, true, undefined, this);
463967
- t9 = steps.length > 0 && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
463968
- flexDirection: "column",
463969
- paddingX: 1,
463970
- marginTop: files.length > 0 || context2 ? 1 : 0,
463971
- children: [
463972
- /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
463973
- children: [
463974
- /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463975
- fg: SECTION_COLOR,
463976
- attributes: TextAttributes.BOLD,
463977
- children: "Steps"
463978
- }, undefined, false, undefined, this),
463979
- /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463980
- fg: t2.textMuted,
463981
- children: [
463982
- " (",
463983
- String(steps.length),
463984
- ")"
463985
- ]
463986
- }, undefined, true, undefined, this)
463987
- ]
463988
- }, undefined, true, undefined, this),
463989
- steps.slice(0, MAX_VISIBLE2).map((s_0, i_0) => /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
463990
- children: [
463991
- /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463992
- fg: STEP_NUM_COLOR,
463993
- children: [
463994
- String(i_0 + 1),
463995
- ". "
463996
- ]
463997
- }, undefined, true, undefined, this),
463998
- /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
463999
- fg: TEXT_COLOR,
464000
- children: s_0.label
464001
- }, undefined, false, undefined, this)
464002
- ]
464003
- }, s_0.id, true, undefined, this)),
464004
- steps.length > MAX_VISIBLE2 && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
464005
- fg: t2.textMuted,
464006
- children: [
464007
- "+",
464008
- String(steps.length - MAX_VISIBLE2),
464009
- " more"
464010
- ]
464011
- }, undefined, true, undefined, this)
464012
- ]
464013
- }, undefined, true, undefined, this);
464014
- }
464015
- $5[0] = BORDER;
464016
- $5[1] = CHECK_COLOR;
464017
- $5[2] = FILE_PATH_COLOR;
464018
- $5[3] = SECTION_COLOR;
464019
- $5[4] = STEP_NUM_COLOR;
464020
- $5[5] = TEXT_COLOR;
464021
- $5[6] = TITLE_COLOR;
464022
- $5[7] = collapsed;
464023
- $5[8] = plan.context;
464024
- $5[9] = plan.files;
464025
- $5[10] = plan.steps;
464026
- $5[11] = plan.title;
464027
- $5[12] = plan.verification;
464028
- $5[13] = planFile;
464029
- $5[14] = result;
464030
- $5[15] = t2;
464031
- $5[16] = t1;
464032
- $5[17] = t10;
464033
- $5[18] = t22;
464034
- $5[19] = t3;
464035
- $5[20] = t4;
464036
- $5[21] = t5;
464037
- $5[22] = t6;
464038
- $5[23] = t7;
464039
- $5[24] = t8;
464040
- $5[25] = t9;
464041
- $5[26] = verification;
464133
+ }, undefined, true, undefined, this)
464134
+ ]
464135
+ }, undefined, true, undefined, this);
464136
+ $5[85] = SECTION_COLOR;
464137
+ $5[86] = STEP_NUM_COLOR;
464138
+ $5[87] = TEXT_COLOR;
464139
+ $5[88] = context2;
464140
+ $5[89] = files.length;
464141
+ $5[90] = steps;
464142
+ $5[91] = t2.textMuted;
464143
+ $5[92] = t11;
464042
464144
  } else {
464043
- t1 = $5[16];
464044
- t10 = $5[17];
464045
- t22 = $5[18];
464046
- t3 = $5[19];
464047
- t4 = $5[20];
464048
- t5 = $5[21];
464049
- t6 = $5[22];
464050
- t7 = $5[23];
464051
- t8 = $5[24];
464052
- t9 = $5[25];
464053
- verification = $5[26];
464054
- }
464055
- if (t10 !== Symbol.for("react.early_return_sentinel")) {
464056
- return t10;
464145
+ t11 = $5[92];
464057
464146
  }
464058
- let t11;
464059
- if ($5[108] !== CHECK_COLOR || $5[109] !== SECTION_COLOR || $5[110] !== TEXT_COLOR || $5[111] !== verification) {
464060
- t11 = verification.length > 0 && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
464147
+ let t12;
464148
+ if ($5[93] !== CHECK_COLOR || $5[94] !== SECTION_COLOR || $5[95] !== TEXT_COLOR || $5[96] !== verification) {
464149
+ t12 = verification.length > 0 && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
464061
464150
  flexDirection: "column",
464062
464151
  paddingX: 1,
464063
464152
  marginTop: 1,
@@ -464081,45 +464170,41 @@ function StructuredPlanView(t0) {
464081
464170
  }, `v-${String(i_1)}`, true, undefined, this))
464082
464171
  ]
464083
464172
  }, undefined, true, undefined, this);
464084
- $5[108] = CHECK_COLOR;
464085
- $5[109] = SECTION_COLOR;
464086
- $5[110] = TEXT_COLOR;
464087
- $5[111] = verification;
464088
- $5[112] = t11;
464173
+ $5[93] = CHECK_COLOR;
464174
+ $5[94] = SECTION_COLOR;
464175
+ $5[95] = TEXT_COLOR;
464176
+ $5[96] = verification;
464177
+ $5[97] = t12;
464089
464178
  } else {
464090
- t11 = $5[112];
464179
+ t12 = $5[97];
464091
464180
  }
464092
- let t12;
464093
- if ($5[113] !== t1 || $5[114] !== t11 || $5[115] !== t22 || $5[116] !== t3 || $5[117] !== t4 || $5[118] !== t5 || $5[119] !== t6 || $5[120] !== t7 || $5[121] !== t8 || $5[122] !== t9) {
464094
- t12 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
464095
- flexDirection: t1,
464096
- flexShrink: t22,
464097
- border: t3,
464098
- borderStyle: t4,
464099
- borderColor: t5,
464181
+ let t13;
464182
+ if ($5[98] !== BORDER || $5[99] !== t10 || $5[100] !== t11 || $5[101] !== t12 || $5[102] !== t8 || $5[103] !== t9) {
464183
+ t13 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
464184
+ flexDirection: "column",
464185
+ flexShrink: 0,
464186
+ border: true,
464187
+ borderStyle: "rounded",
464188
+ borderColor: BORDER,
464100
464189
  children: [
464101
- t6,
464102
- t7,
464103
464190
  t8,
464104
464191
  t9,
464105
- t11
464192
+ t10,
464193
+ t11,
464194
+ t12
464106
464195
  ]
464107
464196
  }, undefined, true, undefined, this);
464108
- $5[113] = t1;
464109
- $5[114] = t11;
464110
- $5[115] = t22;
464111
- $5[116] = t3;
464112
- $5[117] = t4;
464113
- $5[118] = t5;
464114
- $5[119] = t6;
464115
- $5[120] = t7;
464116
- $5[121] = t8;
464117
- $5[122] = t9;
464118
- $5[123] = t12;
464119
- } else {
464120
- t12 = $5[123];
464197
+ $5[98] = BORDER;
464198
+ $5[99] = t10;
464199
+ $5[100] = t11;
464200
+ $5[101] = t12;
464201
+ $5[102] = t8;
464202
+ $5[103] = t9;
464203
+ $5[104] = t13;
464204
+ } else {
464205
+ t13 = $5[104];
464121
464206
  }
464122
- return t12;
464207
+ return t13;
464123
464208
  }
464124
464209
  var import_compiler_runtime14, ACTION_ICONS, MAX_VISIBLE2 = 5;
464125
464210
  var init_StructuredPlanView = __esm(async () => {
@@ -465433,6 +465518,9 @@ var init_dispatch_display = __esm(async () => {
465433
465518
  });
465434
465519
 
465435
465520
  // src/components/chat/ToolCallDisplay.tsx
465521
+ function isObj(v4) {
465522
+ return v4 != null && typeof v4 === "object" && !Array.isArray(v4);
465523
+ }
465436
465524
  function useElapsedTimers(calls) {
465437
465525
  const startTimes = import_react41.useRef(new Map);
465438
465526
  const callsRef = import_react41.useRef(calls);
@@ -465538,8 +465626,8 @@ function extractPath(args2) {
465538
465626
  function renderToolCall2(tc, seconds, diffStyle, t2, connector) {
465539
465627
  if ((tc.toolName === "write_plan" || tc.toolName === "plan") && tc.args) {
465540
465628
  try {
465541
- const plan = JSON.parse(tc.args);
465542
- if (plan.title && Array.isArray(plan.steps) && Array.isArray(plan.files)) {
465629
+ const plan = parsePlanOutput(JSON.parse(tc.args));
465630
+ if (plan) {
465543
465631
  const planContent = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(import_jsx_dev_runtime2.Fragment, {
465544
465632
  children: [
465545
465633
  /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(StructuredPlanView, {
@@ -465648,6 +465736,7 @@ var init_ToolCallDisplay = __esm(async () => {
465648
465736
  init_icons();
465649
465737
  init_theme();
465650
465738
  init_tool_display();
465739
+ init_plan_schema();
465651
465740
  init_shared2();
465652
465741
  init_multi_agent_display();
465653
465742
  init_jsx_dev_runtime();
@@ -466495,14 +466584,18 @@ var init_ToolCallDisplay = __esm(async () => {
466495
466584
  try {
466496
466585
  const parsed = JSON.parse(tc.args);
466497
466586
  if (Array.isArray(parsed.tasks) && parsed.tasks.length >= 1) {
466498
- const tasks = parsed.tasks.map((entry, i4) => ({
466499
- agentId: entry.id ?? entry.agentId ?? `agent-${String(i4 + 1)}`,
466500
- role: entry.role,
466501
- task: entry.task,
466502
- dependsOn: entry.dependsOn
466503
- }));
466587
+ const rawTasks = parsed.tasks;
466588
+ const tasks = rawTasks.map((entry, i4) => {
466589
+ const e = isObj(entry) ? entry : {};
466590
+ return {
466591
+ agentId: String(e.id ?? e.agentId ?? `agent-${String(i4 + 1)}`),
466592
+ role: typeof e.role === "string" ? e.role : undefined,
466593
+ task: typeof e.task === "string" ? e.task : undefined,
466594
+ dependsOn: Array.isArray(e.dependsOn) ? e.dependsOn.map(String) : undefined
466595
+ };
466596
+ });
466504
466597
  return {
466505
- totalAgents: parsed.tasks.length,
466598
+ totalAgents: rawTasks.length,
466506
466599
  tasks
466507
466600
  };
466508
466601
  }
@@ -466860,6 +466953,9 @@ var init_ToolCallDisplay = __esm(async () => {
466860
466953
 
466861
466954
  // src/components/chat/tool-formatters.ts
466862
466955
  import { resolve as resolve36 } from "path";
466956
+ function isObj2(v4) {
466957
+ return v4 != null && typeof v4 === "object" && !Array.isArray(v4);
466958
+ }
466863
466959
  function formatArgs(toolName, args2) {
466864
466960
  if (!args2)
466865
466961
  return "";
@@ -466868,7 +466964,7 @@ function formatArgs(toolName, args2) {
466868
466964
  if (toolName === "read") {
466869
466965
  const files = Array.isArray(parsed.files) ? parsed.files : parsed.files ? [parsed.files] : [];
466870
466966
  if (files.length === 0 && parsed.path)
466871
- return parsed.path;
466967
+ return String(parsed.path);
466872
466968
  if (files.length === 1) {
466873
466969
  const f3 = files[0];
466874
466970
  const hasRanges = f3.ranges && f3.ranges.length > 0;
@@ -466890,18 +466986,18 @@ function formatArgs(toolName, args2) {
466890
466986
  return "";
466891
466987
  }
466892
466988
  if (toolName === "edit_file" && parsed.path)
466893
- return parsed.path;
466989
+ return String(parsed.path);
466894
466990
  if (toolName === "multi_edit" && parsed.path)
466895
- return parsed.path;
466991
+ return String(parsed.path);
466896
466992
  if (toolName === "undo_edit" && parsed.path)
466897
- return parsed.path;
466993
+ return String(parsed.path);
466898
466994
  if (toolName === "list_dir" && parsed.path) {
466899
466995
  if (Array.isArray(parsed.path)) {
466900
- const paths = parsed.path;
466996
+ const paths = parsed.path.map(String);
466901
466997
  const label = paths.join(", ");
466902
466998
  return label.length > 60 ? `${String(paths.length)} dirs` : label;
466903
466999
  }
466904
- return parsed.path;
467000
+ return String(parsed.path);
466905
467001
  }
466906
467002
  if (toolName === "rename_file") {
466907
467003
  if (parsed.from && parsed.to) {
@@ -466919,9 +467015,9 @@ function formatArgs(toolName, args2) {
466919
467015
  return cmd.length > 60 ? `${cmd.slice(0, 57)}...` : cmd;
466920
467016
  }
466921
467017
  if (toolName === "grep" && parsed.pattern)
466922
- return `/${parsed.pattern}/`;
467018
+ return `/${String(parsed.pattern)}/`;
466923
467019
  if (toolName === "glob" && parsed.pattern)
466924
- return parsed.pattern;
467020
+ return String(parsed.pattern);
466925
467021
  if (toolName === "web_search" && parsed.query) {
466926
467022
  const q4 = String(parsed.query);
466927
467023
  return q4.length > 50 ? `${q4.slice(0, 47)}...` : q4;
@@ -466935,13 +467031,18 @@ function formatArgs(toolName, args2) {
466935
467031
  return `search: ${String(parsed.query)}`;
466936
467032
  return String(parsed.action);
466937
467033
  }
466938
- if (toolName === "dispatch" && parsed.tasks) {
467034
+ if (toolName === "dispatch" && Array.isArray(parsed.tasks)) {
466939
467035
  const tasks = parsed.tasks;
466940
- const roles = new Set(tasks.map((t2) => t2.role ?? "explore"));
467036
+ const roles = new Set(tasks.map((t2) => {
467037
+ if (isObj2(t2))
467038
+ return String(t2.role ?? "explore");
467039
+ return "explore";
467040
+ }));
466941
467041
  const roleTags = [...roles].map((r4) => `[${r4}]`).join("");
466942
467042
  if (tasks.length === 1 && tasks[0]) {
466943
- const t2 = String(tasks[0].task);
466944
- const trimmed2 = t2.length > 45 ? `${t2.slice(0, 42)}...` : t2;
467043
+ const task0 = tasks[0];
467044
+ const taskStr = isObj2(task0) ? String(task0.task ?? "") : "";
467045
+ const trimmed2 = taskStr.length > 45 ? `${taskStr.slice(0, 42)}...` : taskStr;
466945
467046
  return `${roleTags} ${trimmed2}`;
466946
467047
  }
466947
467048
  const obj = parsed.objective ? String(parsed.objective) : `${String(tasks.length)} agents`;
@@ -467088,7 +467189,7 @@ function formatResult2(toolName, result) {
467088
467189
  if (p2.repoMapHit && p2.output) {
467089
467190
  const out2 = String(p2.output);
467090
467191
  const match2 = out2.match(/indexed at ([^\s]+)/);
467091
- return match2 ? `\u2192 ${match2[1]}` : out2.slice(0, 40);
467192
+ return match2?.[1] ? `\u2192 ${match2[1]}` : out2.slice(0, 40);
467092
467193
  }
467093
467194
  if (p2.output && typeof p2.output === "string" && p2.output.startsWith("[from dispatch cache]")) {
467094
467195
  const lines2 = p2.output.split(`
@@ -467213,7 +467314,8 @@ function formatResult2(toolName, result) {
467213
467314
  if (Array.isArray(p2.reads) || Array.isArray(p2.filesEdited)) {
467214
467315
  const parts2 = [];
467215
467316
  if (Array.isArray(p2.reads)) {
467216
- const paths = new Set(p2.reads.map((r4) => r4.path));
467317
+ const reads = p2.reads;
467318
+ const paths = new Set(reads.map((r4) => isObj2(r4) ? String(r4.path) : ""));
467217
467319
  if (paths.size > 0)
467218
467320
  parts2.push(`${String(paths.size)} files read`);
467219
467321
  }
@@ -467260,7 +467362,7 @@ function formatResult2(toolName, result) {
467260
467362
  if (parsed.error)
467261
467363
  return String(parsed.error).slice(0, 50);
467262
467364
  if (parsed.branch !== undefined) {
467263
- const parts2 = [parsed.branch];
467365
+ const parts2 = [String(parsed.branch)];
467264
467366
  const counts = [];
467265
467367
  if (Array.isArray(parsed.staged) && parsed.staged.length > 0)
467266
467368
  counts.push(`${String(parsed.staged.length)} staged`);
@@ -467978,13 +468080,13 @@ function cleanErrorDetail(msg) {
467978
468080
  }
467979
468081
  function extractErrorCode(raw2) {
467980
468082
  const statusMatch = raw2.match(/\b(4\d{2}|5\d{2})\b/);
467981
- if (statusMatch)
468083
+ if (statusMatch?.[1])
467982
468084
  return statusMatch[1];
467983
468085
  const typeMatch = raw2.match(/"type"\s*:\s*"([^"]+)"/);
467984
- if (typeMatch)
468086
+ if (typeMatch?.[1])
467985
468087
  return typeMatch[1];
467986
468088
  const codeMatch = raw2.match(/\b(ECONNREFUSED|ETIMEDOUT|INTERNAL_ERROR)\b/);
467987
- if (codeMatch)
468089
+ if (codeMatch?.[1])
467988
468090
  return codeMatch[1];
467989
468091
  return null;
467990
468092
  }
@@ -468042,7 +468144,7 @@ function categorizeError(msg) {
468042
468144
  }
468043
468145
  function parseRetry(text3) {
468044
468146
  const match2 = text3.match(/^Retry (\d+\/\d+): (.+?) \[delay:(\d+)s\]$/);
468045
- if (!match2)
468147
+ if (!match2?.[1] || !match2[2] || !match2[3])
468046
468148
  return null;
468047
468149
  return {
468048
468150
  attempt: match2[1],
@@ -468635,11 +468737,7 @@ function _temp35(tc) {
468635
468737
  function parsePlanFromArgs(tc) {
468636
468738
  if (tc.name !== "write_plan" && tc.name !== "plan")
468637
468739
  return null;
468638
- const a2 = tc.args;
468639
- if (typeof a2.title === "string" && Array.isArray(a2.files) && Array.isArray(a2.steps)) {
468640
- return a2;
468641
- }
468642
- return null;
468740
+ return parsePlanOutput(tc.args);
468643
468741
  }
468644
468742
  function parsePlanResult(tc) {
468645
468743
  if (!tc.result?.output)
@@ -469245,6 +469343,7 @@ var init_MessageList = __esm(async () => {
469245
469343
  init_theme();
469246
469344
  init_tool_display();
469247
469345
  init_useElapsed();
469346
+ init_plan_schema();
469248
469347
  init_shared2();
469249
469348
  init_ReasoningBlock();
469250
469349
  init_tool_grouping();
@@ -475094,8 +475193,10 @@ function fmtCost(usd) {
475094
475193
  return `$${usd.toFixed(3)}`;
475095
475194
  return `$${usd.toFixed(2)}`;
475096
475195
  }
475097
- function buildContent2(costCents, cacheHitPct, free) {
475196
+ function buildContent2(costCents, cacheHitPct, free, local) {
475098
475197
  const tk = getThemeTokens();
475198
+ if (local)
475199
+ return new StyledText([fg(tk.success)("Local")]);
475099
475200
  if (free)
475100
475201
  return new StyledText([fg(tk.success)("FREE")]);
475101
475202
  const cost = costCents / 100;
@@ -475110,11 +475211,13 @@ function TokenDisplay() {
475110
475211
  const cacheHitRef = import_react59.useRef(0);
475111
475212
  const currentCostRef = import_react59.useRef(0);
475112
475213
  const freeRef = import_react59.useRef(false);
475214
+ const localRef = import_react59.useRef(false);
475113
475215
  import_react59.useEffect(() => useStatusBarStore.subscribe((state) => {
475114
475216
  const usage = state.tokenUsage;
475115
475217
  const breakdown = usage.modelBreakdown;
475116
475218
  const modelIds = Object.keys(breakdown);
475117
- freeRef.current = modelIds.length > 0 && modelIds.every((mid) => isModelFree(mid));
475219
+ localRef.current = modelIds.length > 0 && modelIds.every((mid) => isModelLocal(mid));
475220
+ freeRef.current = !localRef.current && modelIds.length > 0 && modelIds.every((mid_0) => isModelFree(mid_0));
475118
475221
  const rawCost = breakdown && modelIds.length > 0 ? computeTotalCostFromBreakdown(breakdown) : 0;
475119
475222
  costRef.current = Math.round(rawCost * 100);
475120
475223
  const totalInput = usage.prompt + usage.subagentInput + usage.cacheRead + usage.cacheWrite;
@@ -475128,7 +475231,7 @@ function TokenDisplay() {
475128
475231
  currentCostRef.current = approach2(currentCostRef.current, target);
475129
475232
  try {
475130
475233
  if (textRef.current)
475131
- textRef.current.content = buildContent2(currentCostRef.current, cacheHitRef.current, freeRef.current);
475234
+ textRef.current.content = buildContent2(currentCostRef.current, cacheHitRef.current, freeRef.current, localRef.current);
475132
475235
  } catch {}
475133
475236
  }, STEP_MS2);
475134
475237
  return () => clearInterval(timer);
@@ -475136,7 +475239,7 @@ function TokenDisplay() {
475136
475239
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
475137
475240
  ref: textRef,
475138
475241
  truncate: true,
475139
- content: buildContent2(currentCostRef.current, cacheHitRef.current, freeRef.current)
475242
+ content: buildContent2(currentCostRef.current, cacheHitRef.current, freeRef.current, localRef.current)
475140
475243
  }, undefined, false, undefined, this);
475141
475244
  }
475142
475245
  var import_react59, STEP_MS2 = 50, EASE2 = 0.35;
@@ -491963,9 +492066,10 @@ function StatusDashboard({
491963
492066
  innerW
491964
492067
  }, "t-total", false, undefined, this));
491965
492068
  const sortedBd = Object.entries(su.modelBreakdown ?? {}).sort(([midA, a2], [midB, b5]) => computeModelCost(midB, b5) - computeModelCost(midA, a2));
491966
- const allFree = sortedBd.length > 0 && sortedBd.every(([mid_0]) => isModelFree(mid_0));
492069
+ const allLocal = sortedBd.length > 0 && sortedBd.every(([mid_0]) => isModelLocal(mid_0));
492070
+ const allFree = !allLocal && sortedBd.length > 0 && sortedBd.every(([mid_1]) => isModelFree(mid_1));
491967
492071
  const totalCost = sortedBd.length > 0 ? computeTotalCostFromBreakdown(su.modelBreakdown ?? {}) : 0;
491968
- if (totalCost > 0 || allFree) {
492072
+ if (totalCost > 0 || allFree || allLocal) {
491969
492073
  const fmtCost2 = (c) => c < 0.01 ? `${c.toFixed(3)}` : `${c.toFixed(2)}`;
491970
492074
  lines.push(/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(Spacer, {
491971
492075
  innerW
@@ -491976,27 +492080,28 @@ function StatusDashboard({
491976
492080
  innerW
491977
492081
  }, "h-cost", false, undefined, this));
491978
492082
  const costLabelW = Math.min(30, innerW - 20);
491979
- for (const [mid_1, usage_0] of sortedBd) {
491980
- const free = isModelFree(mid_1);
491981
- const c_0 = computeModelCost(mid_1, usage_0);
491982
- if (c_0 <= 0 && !free)
492083
+ for (const [mid_2, usage_0] of sortedBd) {
492084
+ const local = isModelLocal(mid_2);
492085
+ const free = !local && isModelFree(mid_2);
492086
+ const c_0 = computeModelCost(mid_2, usage_0);
492087
+ if (c_0 <= 0 && !free && !local)
491983
492088
  continue;
491984
492089
  const pct = totalCost > 0 ? Math.round(c_0 / totalCost * 100) : 0;
491985
492090
  const maxModelW = costLabelW - 4;
491986
- const shortId = mid_1.length > maxModelW ? `${mid_1.slice(0, maxModelW - 1)}\u2026` : mid_1;
492091
+ const shortId = mid_2.length > maxModelW ? `${mid_2.slice(0, maxModelW - 1)}\u2026` : mid_2;
491987
492092
  lines.push(/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(EntryRow, {
491988
492093
  label: ` ${shortId}`,
491989
- value: free ? "FREE" : `${fmtCost2(c_0)} (${String(pct)}%)`,
491990
- valueColor: free ? t2.success : t2.textPrimary,
492094
+ value: local ? "Local" : free ? "FREE" : `${fmtCost2(c_0)} (${String(pct)}%)`,
492095
+ valueColor: local || free ? t2.success : t2.textPrimary,
491991
492096
  labelW: costLabelW,
491992
492097
  rightAlign: true,
491993
492098
  innerW
491994
- }, `cost-${mid_1}`, false, undefined, this));
492099
+ }, `cost-${mid_2}`, false, undefined, this));
491995
492100
  }
491996
492101
  lines.push(/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(EntryRow, {
491997
492102
  label: " Total",
491998
- value: allFree ? "FREE" : fmtCost2(totalCost),
491999
- valueColor: allFree ? t2.success : t2.warning,
492103
+ value: allLocal ? "Local" : allFree ? "FREE" : fmtCost2(totalCost),
492104
+ valueColor: allLocal || allFree ? t2.success : t2.warning,
492000
492105
  labelW: costLabelW,
492001
492106
  rightAlign: true,
492002
492107
  innerW
@@ -492012,7 +492117,9 @@ function StatusDashboard({
492012
492117
  innerW
492013
492118
  }, "h-tabs", false, undefined, this));
492014
492119
  const fmtCost_0 = (c_1, modelIds) => {
492015
- if (modelIds && modelIds.length > 0 && modelIds.every((mid_2) => isModelFree(mid_2)))
492120
+ if (modelIds && modelIds.length > 0 && modelIds.every((mid_3) => isModelLocal(mid_3)))
492121
+ return "Local";
492122
+ if (modelIds && modelIds.length > 0 && modelIds.every((mid_4) => isModelFree(mid_4)))
492016
492123
  return "FREE";
492017
492124
  return c_1 <= 0 ? "\u2014" : c_1 < 0.01 ? `$${c_1.toFixed(3)}` : `$${c_1.toFixed(2)}`;
492018
492125
  };