@mindstudio-ai/remy 0.1.127 → 0.1.129

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/dist/index.js CHANGED
@@ -2535,10 +2535,12 @@ Current date: ${dateStr}`;
2535
2535
  const excludeToolsFromClearing = tools2.filter((t) => t.clearable === false).map((t) => t.name);
2536
2536
  let turns = 0;
2537
2537
  const run = async () => {
2538
+ const historyLen = (history ?? []).length;
2538
2539
  const messages = [
2539
2540
  ...history ?? [],
2540
2541
  { role: "user", content: task }
2541
2542
  ];
2543
+ const thisInvocation = () => messages.slice(historyLen);
2542
2544
  function getPartialText(blocks) {
2543
2545
  return blocks.filter((b) => b.type === "text").map((b) => b.text).join("");
2544
2546
  }
@@ -2549,10 +2551,10 @@ Current date: ${dateStr}`;
2549
2551
  text: partial ? `[INTERRUPTED - PARTIAL OUTPUT RETRIEVED] Note that partial output may include thinking text or other unfinalized decisions. It is NOT an authoritative response from this agent.
2550
2552
 
2551
2553
  ${partial}` : "[INTERRUPTED] Agent was interrupted before producing output.",
2552
- messages
2554
+ messages: thisInvocation()
2553
2555
  };
2554
2556
  }
2555
- return { text: "Error: cancelled", messages };
2557
+ return { text: "Error: cancelled", messages: thisInvocation() };
2556
2558
  }
2557
2559
  let lastToolResult = "";
2558
2560
  while (true) {
@@ -2659,7 +2661,10 @@ ${partial}` : "[INTERRUPTED] Agent was interrupted before producing output.",
2659
2661
  stopReason = event.stopReason;
2660
2662
  break;
2661
2663
  case "error":
2662
- return { text: `Error: ${event.error}`, messages };
2664
+ return {
2665
+ text: `Error: ${event.error}`,
2666
+ messages: thisInvocation()
2667
+ };
2663
2668
  }
2664
2669
  }
2665
2670
  } catch (err) {
@@ -2681,7 +2686,7 @@ ${partial}` : "[INTERRUPTED] Agent was interrupted before producing output.",
2681
2686
  if (stopReason !== "tool_use" || toolCalls.length === 0) {
2682
2687
  statusWatcher.stop();
2683
2688
  const text = getPartialText(contentBlocks);
2684
- return { text, messages };
2689
+ return { text, messages: thisInvocation() };
2685
2690
  }
2686
2691
  log3.info("Tools executing", {
2687
2692
  requestId,
@@ -3313,6 +3318,98 @@ var init_screenshot2 = __esm({
3313
3318
  }
3314
3319
  });
3315
3320
 
3321
+ // src/subagents/common/tools.ts
3322
+ var COMMON_READ_TOOLS, COMMON_READ_TOOL_NAMES;
3323
+ var init_tools2 = __esm({
3324
+ "src/subagents/common/tools.ts"() {
3325
+ "use strict";
3326
+ COMMON_READ_TOOLS = [
3327
+ {
3328
+ name: "readFile",
3329
+ description: "Read a file's contents with line numbers. Always read a file before editing it \u2014 never guess at contents. For large files, consider using symbols first to identify the relevant section, then use offset and maxLines to read just that section. Line numbers in the output correspond to what editFile expects. Defaults to first 500 lines. Use a negative offset to read from the end of the file (e.g., offset: -50 reads the last 50 lines).",
3330
+ inputSchema: {
3331
+ type: "object",
3332
+ properties: {
3333
+ path: {
3334
+ type: "string",
3335
+ description: "The file path to read, relative to the project root."
3336
+ },
3337
+ offset: {
3338
+ type: "number",
3339
+ description: "Line number to start reading from (1-indexed). Use a negative number to read from the end (e.g., -50 reads the last 50 lines). Defaults to 1."
3340
+ },
3341
+ maxLines: {
3342
+ type: "number",
3343
+ description: "Maximum number of lines to return. Defaults to 500. Set to 0 for no limit."
3344
+ }
3345
+ },
3346
+ required: ["path"]
3347
+ }
3348
+ },
3349
+ {
3350
+ name: "listDir",
3351
+ description: "List the contents of a directory with one level of subdirectory expansion. Shows file sizes and collapses single-child directory chains (a/b/c/ shown as one entry). Use this for a quick overview of a directory's structure. For finding files across the whole project, use glob instead.",
3352
+ inputSchema: {
3353
+ type: "object",
3354
+ properties: {
3355
+ path: {
3356
+ type: "string",
3357
+ description: 'Directory path to list, relative to project root. Defaults to ".".'
3358
+ }
3359
+ }
3360
+ }
3361
+ },
3362
+ {
3363
+ name: "grep",
3364
+ description: "Search file contents for a regex pattern. Returns matching lines with file paths and line numbers (default 50 results). Use this to find where something is used, locate function definitions, or search for patterns across the codebase. For finding a symbol's definition precisely, prefer the definition tool if LSP is available. Automatically excludes node_modules and .git.",
3365
+ inputSchema: {
3366
+ type: "object",
3367
+ properties: {
3368
+ pattern: {
3369
+ type: "string",
3370
+ description: "The search pattern (regex supported)."
3371
+ },
3372
+ path: {
3373
+ type: "string",
3374
+ description: "Directory or file to search in. Defaults to current directory."
3375
+ },
3376
+ glob: {
3377
+ type: "string",
3378
+ description: 'File glob to filter (e.g., "*.ts"). Only used with ripgrep.'
3379
+ },
3380
+ maxResults: {
3381
+ type: "number",
3382
+ description: "Maximum number of matching lines to return. Defaults to 50. Increase if you need more comprehensive results."
3383
+ }
3384
+ },
3385
+ required: ["pattern"]
3386
+ }
3387
+ },
3388
+ {
3389
+ name: "glob",
3390
+ description: 'Find files matching a glob pattern. Returns matching file paths sorted alphabetically (default 200 results). Use this to discover project structure, find files by name or extension, or check if a file exists. Common patterns: "**/*.ts" (all TypeScript files), "src/**/*.tsx" (React components in src), "*.json" (root-level JSON files). Automatically excludes node_modules and .git.',
3391
+ inputSchema: {
3392
+ type: "object",
3393
+ properties: {
3394
+ pattern: {
3395
+ type: "string",
3396
+ description: 'Glob pattern (e.g., "**/*.ts", "src/**/*.tsx", "*.json").'
3397
+ },
3398
+ maxResults: {
3399
+ type: "number",
3400
+ description: "Maximum number of file paths to return. Defaults to 200. Increase if you need the complete list."
3401
+ }
3402
+ },
3403
+ required: ["pattern"]
3404
+ }
3405
+ }
3406
+ ];
3407
+ COMMON_READ_TOOL_NAMES = new Set(
3408
+ COMMON_READ_TOOLS.map((t) => t.name)
3409
+ );
3410
+ }
3411
+ });
3412
+
3316
3413
  // src/subagents/designExpert/tools/searchGoogle.ts
3317
3414
  var searchGoogle_exports = {};
3318
3415
  __export(searchGoogle_exports, {
@@ -3876,10 +3973,11 @@ async function executeDesignExpertTool(name, input, context, toolCallId, onLog)
3876
3973
  return tool.execute(input, onLog, childContext);
3877
3974
  }
3878
3975
  var tools, DESIGN_EXPERT_TOOLS;
3879
- var init_tools2 = __esm({
3976
+ var init_tools3 = __esm({
3880
3977
  "src/subagents/designExpert/tools/index.ts"() {
3881
3978
  "use strict";
3882
- init_tools5();
3979
+ init_tools6();
3980
+ init_tools2();
3883
3981
  init_searchGoogle2();
3884
3982
  init_scrapeWebUrl();
3885
3983
  init_analyzeDesign();
@@ -3896,9 +3994,10 @@ var init_tools2 = __esm({
3896
3994
  generateImages: generateImages_exports,
3897
3995
  editImages: editImages_exports
3898
3996
  };
3899
- DESIGN_EXPERT_TOOLS = Object.values(tools).map(
3900
- (t) => t.definition
3901
- );
3997
+ DESIGN_EXPERT_TOOLS = [
3998
+ ...COMMON_READ_TOOLS,
3999
+ ...Object.values(tools).map((t) => t.definition)
4000
+ ];
3902
4001
  }
3903
4002
  });
3904
4003
 
@@ -3920,32 +4019,101 @@ function walkMdFiles(dir, skip) {
3920
4019
  }
3921
4020
  } catch {
3922
4021
  }
3923
- return files;
4022
+ return files.sort();
4023
+ }
4024
+ function parseFrontmatter(filePath) {
4025
+ try {
4026
+ const content = fs12.readFileSync(filePath, "utf-8");
4027
+ const match = content.match(/^---\n([\s\S]*?)\n---/);
4028
+ if (!match) {
4029
+ return {};
4030
+ }
4031
+ const fm = {};
4032
+ for (const line of match[1].split("\n")) {
4033
+ const sep = line.indexOf(":");
4034
+ if (sep > 0) {
4035
+ const key = line.slice(0, sep).trim();
4036
+ const val = line.slice(sep + 1).trim();
4037
+ fm[key] = val;
4038
+ }
4039
+ }
4040
+ return fm;
4041
+ } catch {
4042
+ return {};
4043
+ }
3924
4044
  }
3925
- function loadFilesAsXml(dir, tag, skip) {
3926
- const files = walkMdFiles(dir, skip);
4045
+ function loadSpecIndex() {
4046
+ const files = walkMdFiles("src", /* @__PURE__ */ new Set(["roadmap"]));
3927
4047
  if (files.length === 0) {
3928
4048
  return "";
3929
4049
  }
3930
- const sections = files.map((f) => {
3931
- try {
3932
- const content = fs12.readFileSync(f, "utf-8").trim();
3933
- return `<file path="${f}">
3934
- ${content}
3935
- </file>`;
3936
- } catch {
3937
- return "";
4050
+ const lines = files.map((f) => {
4051
+ const fm = parseFrontmatter(f);
4052
+ let line = `- ${f}`;
4053
+ if (fm.name) {
4054
+ line += ` \u2014 "${fm.name}"`;
3938
4055
  }
3939
- }).filter(Boolean);
3940
- return `<${tag}>
3941
- ${sections.join("\n\n")}
3942
- </${tag}>`;
3943
- }
3944
- function loadSpecContext() {
3945
- return loadFilesAsXml("src", "spec_files", /* @__PURE__ */ new Set(["roadmap"]));
4056
+ if (fm.description) {
4057
+ line += ` \u2014 ${fm.description}`;
4058
+ }
4059
+ return line;
4060
+ });
4061
+ return `<spec_files>
4062
+ ## Project Spec Files
4063
+ Use readFile to access full contents.
4064
+
4065
+ ${lines.join("\n")}
4066
+ </spec_files>`;
3946
4067
  }
3947
- function loadRoadmapContext() {
3948
- return loadFilesAsXml("src/roadmap", "current_roadmap");
4068
+ function loadRoadmapIndex() {
4069
+ const parts = [];
4070
+ try {
4071
+ const indexJson = JSON.parse(
4072
+ fs12.readFileSync("src/roadmap/index.json", "utf-8")
4073
+ );
4074
+ if (indexJson.lanes?.length > 0) {
4075
+ const laneLines = indexJson.lanes.map(
4076
+ (l) => `- **${l.name}**: ${l.narrative || ""} (${l.items?.length || 0} items)`
4077
+ );
4078
+ parts.push(`### Lanes
4079
+ ${laneLines.join("\n")}`);
4080
+ }
4081
+ if (indexJson.standalone?.length > 0) {
4082
+ parts.push(
4083
+ `### Standalone
4084
+ ${indexJson.standalone.map((s) => `- ${s}`).join("\n")}`
4085
+ );
4086
+ }
4087
+ } catch {
4088
+ }
4089
+ const files = walkMdFiles("src/roadmap");
4090
+ if (files.length > 0) {
4091
+ const lines = files.map((f) => {
4092
+ const fm = parseFrontmatter(f);
4093
+ let line = `- ${f}`;
4094
+ if (fm.name) {
4095
+ line += ` \u2014 "${fm.name}"`;
4096
+ }
4097
+ if (fm.status) {
4098
+ line += ` (${fm.status})`;
4099
+ }
4100
+ if (fm.description) {
4101
+ line += ` \u2014 ${fm.description}`;
4102
+ }
4103
+ return line;
4104
+ });
4105
+ parts.push(`### Items
4106
+ ${lines.join("\n")}`);
4107
+ }
4108
+ if (parts.length === 0) {
4109
+ return "";
4110
+ }
4111
+ return `<current_roadmap>
4112
+ ## Roadmap
4113
+ Use readFile to access full contents.
4114
+
4115
+ ${parts.join("\n\n")}
4116
+ </current_roadmap>`;
3949
4117
  }
3950
4118
  function loadPlatformBrief() {
3951
4119
  return `<platform_brief>
@@ -4171,7 +4339,7 @@ var init_getUiInspirationSample = __esm({
4171
4339
 
4172
4340
  // src/subagents/designExpert/prompt.ts
4173
4341
  function getDesignExpertPrompt(onboardingState) {
4174
- const specContext = loadSpecContext();
4342
+ const specContext = loadSpecIndex();
4175
4343
  const indices = getSampleIndices(
4176
4344
  {
4177
4345
  uiInspiration: uiScreens.length,
@@ -4287,7 +4455,9 @@ var DESCRIPTION, designExpertTool;
4287
4455
  var init_designExpert = __esm({
4288
4456
  "src/subagents/designExpert/index.ts"() {
4289
4457
  "use strict";
4458
+ init_tools6();
4290
4459
  init_runner();
4460
+ init_tools3();
4291
4461
  init_tools2();
4292
4462
  init_prompt2();
4293
4463
  init_history();
@@ -4325,7 +4495,13 @@ Visual design expert. Describe the situation and what you need \u2014 the agent
4325
4495
  history: history.length > 0 ? history : void 0,
4326
4496
  tools: DESIGN_EXPERT_TOOLS,
4327
4497
  externalTools: /* @__PURE__ */ new Set(),
4328
- executeTool: (name, input2, toolCallId, onLog) => executeDesignExpertTool(name, input2, context, toolCallId, onLog),
4498
+ executeTool: (name, input2, toolCallId, onLog) => {
4499
+ if (COMMON_READ_TOOL_NAMES.has(name)) {
4500
+ const childCtx = toolCallId ? deriveContext(context, toolCallId) : context;
4501
+ return executeTool(name, input2, childCtx);
4502
+ }
4503
+ return executeDesignExpertTool(name, input2, context, toolCallId, onLog);
4504
+ },
4329
4505
  apiConfig: context.apiConfig,
4330
4506
  model: context.model,
4331
4507
  subAgentId: "visualDesignExpert",
@@ -4354,32 +4530,12 @@ Visual design expert. Describe the situation and what you need \u2014 the agent
4354
4530
 
4355
4531
  // src/subagents/productVision/tools.ts
4356
4532
  var VISION_TOOLS;
4357
- var init_tools3 = __esm({
4533
+ var init_tools4 = __esm({
4358
4534
  "src/subagents/productVision/tools.ts"() {
4359
4535
  "use strict";
4536
+ init_tools2();
4360
4537
  VISION_TOOLS = [
4361
- {
4362
- name: "listDir",
4363
- description: "List files in src/roadmap/.",
4364
- inputSchema: {
4365
- type: "object",
4366
- properties: {}
4367
- }
4368
- },
4369
- {
4370
- name: "readFile",
4371
- description: 'Read a file from src/roadmap/. Path is relative to src/roadmap/ (e.g. "index.json", "mute.md").',
4372
- inputSchema: {
4373
- type: "object",
4374
- properties: {
4375
- path: {
4376
- type: "string",
4377
- description: "File path relative to src/roadmap/."
4378
- }
4379
- },
4380
- required: ["path"]
4381
- }
4382
- },
4538
+ ...COMMON_READ_TOOLS,
4383
4539
  {
4384
4540
  name: "writeFile",
4385
4541
  description: 'Create or overwrite a file in src/roadmap/. Path is relative to src/roadmap/ (e.g. "index.json", "ai-weekly-digest.md").',
@@ -4438,37 +4594,6 @@ function resolve(filePath) {
4438
4594
  }
4439
4595
  async function executeVisionTool(name, input, context) {
4440
4596
  switch (name) {
4441
- case "listDir": {
4442
- try {
4443
- fs14.mkdirSync(ROADMAP_DIR, { recursive: true });
4444
- const entries = fs14.readdirSync(ROADMAP_DIR, { withFileTypes: true });
4445
- const lines = [];
4446
- const dirs = entries.filter((e) => e.isDirectory()).sort((a, b) => a.name.localeCompare(b.name));
4447
- const files = entries.filter((e) => !e.isDirectory()).sort((a, b) => a.name.localeCompare(b.name));
4448
- for (const d of dirs) {
4449
- lines.push(`${d.name}/`);
4450
- }
4451
- for (const f of files) {
4452
- const stat = fs14.statSync(resolve(f.name));
4453
- const size = stat.size < 1024 ? `${stat.size}B` : `${(stat.size / 1024).toFixed(1)}KB`;
4454
- lines.push(`${f.name} (${size})`);
4455
- }
4456
- return lines.length > 0 ? lines.join("\n") : "(empty)";
4457
- } catch (err) {
4458
- return `Error: ${err.message}`;
4459
- }
4460
- }
4461
- case "readFile": {
4462
- const filePath = resolve(input.path);
4463
- try {
4464
- const content = fs14.readFileSync(filePath, "utf-8");
4465
- const lines = content.split("\n");
4466
- const numbered = lines.map((line, i) => `${String(i + 1).padStart(4)} ${line}`).join("\n");
4467
- return numbered;
4468
- } catch (err) {
4469
- return `Error reading ${filePath}: ${err.message}`;
4470
- }
4471
- }
4472
4597
  case "writeFile": {
4473
4598
  const filePath = resolve(input.path);
4474
4599
  try {
@@ -4508,31 +4633,26 @@ ${unifiedDiff(filePath, oldContent, "")}`;
4508
4633
  const filePath = resolve("pitch.html");
4509
4634
  try {
4510
4635
  fs14.mkdirSync(ROADMAP_DIR, { recursive: true });
4511
- const existingHtml = fs14.existsSync(filePath) ? fs14.readFileSync(filePath, "utf-8").trim() : "";
4512
- let task = `
4636
+ const existing = fs14.existsSync(filePath) ? fs14.readFileSync(filePath, "utf-8").trim() : "";
4637
+ const currentDeck = existing || PITCH_DECK_SHELL;
4638
+ const task = `
4513
4639
  <pitch_content>${input.task}</pitch_content>
4514
4640
 
4515
- We are building the pitch deck for the app. Using the provided <pitch_content>, as well as the app's spec data, think about what would make a compelling, interactive, self-contained horizontally-scrolling HTML slide deck for this product. Keep it simple, clean, powerful. Giant text, large logo, big, bold stats and claims. Edit the content as necessary to create the most impactful, bold, and beautiful slides. This should not feel text heavy, and it should not feel like a landing page - it should feel like a modern interactive presentation that leaves the user wowed by the product.
4641
+ <current_deck>${currentDeck}</current_deck>
4516
4642
 
4517
- ### Rules
4518
- - The deck must be a single HTML file - it will be rendered in an iFrame.
4519
- - Keep it simple: 100svh 100vw slides that scroll horizontally using browser scrolling. Must look beautiful on desktop and mobile - use all the principles you know about designing effective landing pages to make a beautiful deck.
4520
- - The deck must support keyboard navigation left and right, and big clickable arrows to transition.
4521
- - Animation between slides must be seamless, no flicker or flashing.
4522
- - Be bold and impactful. Do not be wordy or verbose, no one reads decks with too many words.
4523
- - Keep it simple: 5-7 slides max. No fluff, just imapct.
4524
- - Code must be clean, bug free, and easy-to-parse. Use GSAP for animations.
4525
- `;
4526
- if (existingHtml) {
4527
- task += `
4643
+ We are building the pitch deck for the app. Using the provided <pitch_content>, as well as the app's spec data, think about what would make a compelling, interactive, self-contained horizontally-scrolling HTML slide deck for this product. Keep it simple, clean, powerful. Giant text, large logo, big, bold stats and claims. Edit the content as necessary to create the most impactful, bold, and beautiful slides. This should not feel like an essay, and it should not feel like a landing page \u2014 it should feel like a modern interactive presentation that leaves the user wowed by the product and excited about its future.
4528
4644
 
4529
- The current pitch deck HTML is below. Refine and update it rather than starting from scratch \u2014 preserve the existing design and structure where it still works, and update the content and slides to reflect the new pitch.
4645
+ Use <current_deck> as your starting point and replace or update the content as needed, maintaining the bones of the presentation scaffolding.
4530
4646
 
4531
- <existing_pitch_html>${existingHtml}</existing_pitch_html>`;
4532
- }
4533
- task += `
4647
+ ### Rules
4648
+ - The deck must be a single HTML file \u2014 it will be rendered in an iframe.
4649
+ - Must look beautiful on desktop and mobile.
4650
+ - Animation between slides must be seamless, no flicker or flashing.
4651
+ - Be bold and impactful.
4652
+ - 6-8 slides max. No fluff, just impact.
4653
+ - Code must be clean, bug free, and easy to parse. Use GSAP for animations.
4534
4654
 
4535
- Respond only with the HTML of the deck as a single fenced markdown block and absolutely no other text - your response will be written directly to a file.`;
4655
+ Respond only with the complete HTML file and absolutely no other text. Your response will be written directly to an html file.`;
4536
4656
  const result = await designExpertTool.execute({ task }, context);
4537
4657
  const htmlMatch = result.match(
4538
4658
  /```(?:html|wireframe)\n([\s\S]*?)```/
@@ -4552,28 +4672,33 @@ ${unifiedDiff(filePath, oldContent, html)}`;
4552
4672
  return `Error: unknown tool "${name}"`;
4553
4673
  }
4554
4674
  }
4555
- var ROADMAP_DIR;
4675
+ var ROADMAP_DIR, PITCH_DECK_SHELL;
4556
4676
  var init_executor = __esm({
4557
4677
  "src/subagents/productVision/executor.ts"() {
4558
4678
  "use strict";
4559
4679
  init_diff();
4560
4680
  init_designExpert();
4681
+ init_assets();
4561
4682
  init_context();
4562
4683
  ROADMAP_DIR = "src/roadmap";
4684
+ PITCH_DECK_SHELL = readAsset(
4685
+ "subagents/productVision",
4686
+ "pitch-deck-shell.html"
4687
+ );
4563
4688
  }
4564
4689
  });
4565
4690
 
4566
4691
  // src/subagents/productVision/prompt.ts
4567
4692
  function getProductVisionPrompt() {
4568
- const specContext = loadSpecContext();
4569
- const roadmapContext = loadRoadmapContext();
4693
+ const specIndex = loadSpecIndex();
4694
+ const roadmapIndex = loadRoadmapIndex();
4570
4695
  const parts = [BASE_PROMPT2, loadPlatformBrief()];
4571
4696
  parts.push("<!-- cache_breakpoint -->");
4572
- if (specContext) {
4573
- parts.push(specContext);
4697
+ if (specIndex) {
4698
+ parts.push(specIndex);
4574
4699
  }
4575
- if (roadmapContext) {
4576
- parts.push(roadmapContext);
4700
+ if (roadmapIndex) {
4701
+ parts.push(roadmapIndex);
4577
4702
  }
4578
4703
  return parts.join("\n\n");
4579
4704
  }
@@ -4593,9 +4718,10 @@ var productVisionTool;
4593
4718
  var init_productVision = __esm({
4594
4719
  "src/subagents/productVision/index.ts"() {
4595
4720
  "use strict";
4596
- init_tools5();
4721
+ init_tools6();
4597
4722
  init_runner();
4598
- init_tools3();
4723
+ init_tools4();
4724
+ init_tools2();
4599
4725
  init_executor();
4600
4726
  init_prompt3();
4601
4727
  init_history();
@@ -4630,11 +4756,13 @@ var init_productVision = __esm({
4630
4756
  history: history.length > 0 ? history : void 0,
4631
4757
  tools: VISION_TOOLS,
4632
4758
  externalTools: /* @__PURE__ */ new Set(),
4633
- executeTool: (name, input2, toolCallId) => executeVisionTool(
4634
- name,
4635
- input2,
4636
- toolCallId ? deriveContext(context, toolCallId) : context
4637
- ),
4759
+ executeTool: (name, input2, toolCallId) => {
4760
+ const childCtx = toolCallId ? deriveContext(context, toolCallId) : context;
4761
+ if (COMMON_READ_TOOL_NAMES.has(name)) {
4762
+ return executeTool(name, input2, childCtx);
4763
+ }
4764
+ return executeVisionTool(name, input2, childCtx);
4765
+ },
4638
4766
  apiConfig: context.apiConfig,
4639
4767
  model: context.model,
4640
4768
  subAgentId: "productVision",
@@ -4663,53 +4791,12 @@ var init_productVision = __esm({
4663
4791
 
4664
4792
  // src/subagents/codeSanityCheck/tools.ts
4665
4793
  var SANITY_CHECK_TOOLS;
4666
- var init_tools4 = __esm({
4794
+ var init_tools5 = __esm({
4667
4795
  "src/subagents/codeSanityCheck/tools.ts"() {
4668
4796
  "use strict";
4797
+ init_tools2();
4669
4798
  SANITY_CHECK_TOOLS = [
4670
- {
4671
- name: "readFile",
4672
- description: "Read a file from the project.",
4673
- inputSchema: {
4674
- type: "object",
4675
- properties: {
4676
- path: {
4677
- type: "string",
4678
- description: "File path relative to project root."
4679
- }
4680
- },
4681
- required: ["path"]
4682
- }
4683
- },
4684
- {
4685
- name: "grep",
4686
- description: "Search file contents for a pattern.",
4687
- inputSchema: {
4688
- type: "object",
4689
- properties: {
4690
- pattern: { type: "string", description: "Search pattern (regex)." },
4691
- path: {
4692
- type: "string",
4693
- description: "Directory or file to search in."
4694
- }
4695
- },
4696
- required: ["pattern"]
4697
- }
4698
- },
4699
- {
4700
- name: "glob",
4701
- description: "Find files by glob pattern.",
4702
- inputSchema: {
4703
- type: "object",
4704
- properties: {
4705
- pattern: {
4706
- type: "string",
4707
- description: 'Glob pattern (e.g., "src/**/*.ts").'
4708
- }
4709
- },
4710
- required: ["pattern"]
4711
- }
4712
- },
4799
+ ...COMMON_READ_TOOLS,
4713
4800
  {
4714
4801
  name: "searchGoogle",
4715
4802
  description: "Search the web. Use to verify packages are current or find alternatives.",
@@ -4766,8 +4853,8 @@ var init_codeSanityCheck = __esm({
4766
4853
  init_assets();
4767
4854
  init_runner();
4768
4855
  init_context();
4856
+ init_tools6();
4769
4857
  init_tools5();
4770
- init_tools4();
4771
4858
  BASE_PROMPT3 = readAsset("subagents/codeSanityCheck", "prompt.md");
4772
4859
  codeSanityCheckTool = {
4773
4860
  clearable: false,
@@ -4789,11 +4876,11 @@ var init_codeSanityCheck = __esm({
4789
4876
  if (!context) {
4790
4877
  return "Error: code sanity check requires execution context";
4791
4878
  }
4792
- const specContext = loadSpecContext();
4879
+ const specIndex = loadSpecIndex();
4793
4880
  const parts = [BASE_PROMPT3, loadPlatformBrief()];
4794
4881
  parts.push("<!-- cache_breakpoint -->");
4795
- if (specContext) {
4796
- parts.push(specContext);
4882
+ if (specIndex) {
4883
+ parts.push(specIndex);
4797
4884
  }
4798
4885
  const system = parts.join("\n\n");
4799
4886
  const result = await runSubAgent({
@@ -4879,7 +4966,7 @@ function executeTool(name, input, context) {
4879
4966
  return tool.execute(input, context);
4880
4967
  }
4881
4968
  var ALL_TOOLS, CLEARABLE_TOOLS;
4882
- var init_tools5 = __esm({
4969
+ var init_tools6 = __esm({
4883
4970
  "src/tools/index.ts"() {
4884
4971
  "use strict";
4885
4972
  init_readSpec();
@@ -5736,14 +5823,14 @@ var init_agent = __esm({
5736
5823
  "src/agent.ts"() {
5737
5824
  "use strict";
5738
5825
  init_api();
5739
- init_tools5();
5826
+ init_tools6();
5740
5827
  init_session();
5741
5828
  init_logger();
5742
5829
  init_parsePartialJson();
5743
5830
  init_statusWatcher();
5744
5831
  init_errors();
5745
5832
  init_cleanMessages();
5746
- init_tools5();
5833
+ init_tools6();
5747
5834
  log6 = createLogger("agent");
5748
5835
  EXTERNAL_TOOLS = /* @__PURE__ */ new Set([
5749
5836
  "promptUser",
@@ -5799,7 +5886,7 @@ function loadSpecFileMetadata() {
5799
5886
  }
5800
5887
  const entries = [];
5801
5888
  for (const filePath of files) {
5802
- const { name, description, type } = parseFrontmatter(filePath);
5889
+ const { name, description, type } = parseFrontmatter2(filePath);
5803
5890
  let line = `- ${filePath}`;
5804
5891
  if (name) {
5805
5892
  line += ` \u2014 "${name}"`;
@@ -5835,7 +5922,7 @@ function walkMdFiles2(dir) {
5835
5922
  }
5836
5923
  return results.sort();
5837
5924
  }
5838
- function parseFrontmatter(filePath) {
5925
+ function parseFrontmatter2(filePath) {
5839
5926
  try {
5840
5927
  const content = fs16.readFileSync(filePath, "utf-8");
5841
5928
  const match = content.match(/^---\n([\s\S]*?)\n---/);
@@ -6987,7 +7074,7 @@ var init_headless = __esm({
6987
7074
  init_config();
6988
7075
  init_prompt4();
6989
7076
  init_compaction();
6990
- init_tools5();
7077
+ init_tools6();
6991
7078
  init_lsp();
6992
7079
  init_agent();
6993
7080
  init_session();