@travisennis/acai 0.0.10 → 0.0.11

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 (112) hide show
  1. package/README.md +5 -1
  2. package/dist/agent/index.d.ts.map +1 -1
  3. package/dist/agent/index.js +29 -27
  4. package/dist/cli/stdin.d.ts +2 -1
  5. package/dist/cli/stdin.d.ts.map +1 -1
  6. package/dist/commands/generate-rules/service.d.ts +3 -2
  7. package/dist/commands/generate-rules/service.d.ts.map +1 -1
  8. package/dist/commands/health/utils.d.ts +3 -2
  9. package/dist/commands/health/utils.d.ts.map +1 -1
  10. package/dist/commands/init-project/utils.d.ts +2 -1
  11. package/dist/commands/init-project/utils.d.ts.map +1 -1
  12. package/dist/commands/review/utils.d.ts +6 -1
  13. package/dist/commands/review/utils.d.ts.map +1 -1
  14. package/dist/index.js +1 -1
  15. package/dist/models/opencode-go-provider.d.ts +25 -0
  16. package/dist/models/opencode-go-provider.d.ts.map +1 -0
  17. package/dist/models/opencode-go-provider.js +78 -0
  18. package/dist/models/opencode-zen-provider.d.ts +3 -3
  19. package/dist/models/opencode-zen-provider.js +17 -17
  20. package/dist/models/openrouter-provider.d.ts +4 -1
  21. package/dist/models/openrouter-provider.d.ts.map +1 -1
  22. package/dist/models/openrouter-provider.js +39 -0
  23. package/dist/models/providers.d.ts +3 -3
  24. package/dist/models/providers.d.ts.map +1 -1
  25. package/dist/models/providers.js +6 -0
  26. package/dist/modes/manager.d.ts +2 -1
  27. package/dist/modes/manager.d.ts.map +1 -1
  28. package/dist/modes/prompts.d.ts +1 -1
  29. package/dist/modes/prompts.d.ts.map +1 -1
  30. package/dist/modes/prompts.js +1 -2
  31. package/dist/prompts/mentions.d.ts.map +1 -1
  32. package/dist/prompts/mentions.js +35 -6
  33. package/dist/repl/index.d.ts.map +1 -1
  34. package/dist/repl/index.js +9 -1
  35. package/dist/sessions/manager.d.ts +3 -3
  36. package/dist/sessions/manager.d.ts.map +1 -1
  37. package/dist/sessions/manager.js +1 -1
  38. package/dist/skills/index.d.ts +2 -1
  39. package/dist/skills/index.d.ts.map +1 -1
  40. package/dist/subagents/index.d.ts +2 -1
  41. package/dist/subagents/index.d.ts.map +1 -1
  42. package/dist/terminal/table/utils.d.ts +1 -1
  43. package/dist/terminal/table/utils.d.ts.map +1 -1
  44. package/dist/terminal/wrap-ansi.js +2 -2
  45. package/dist/tools/agent.js +1 -1
  46. package/dist/tools/apply-patch.d.ts +62 -0
  47. package/dist/tools/apply-patch.d.ts.map +1 -0
  48. package/dist/tools/apply-patch.js +377 -0
  49. package/dist/tools/bash.d.ts.map +1 -1
  50. package/dist/tools/bash.js +28 -7
  51. package/dist/tools/directory-tree.d.ts.map +1 -1
  52. package/dist/tools/directory-tree.js +1 -1
  53. package/dist/tools/dynamic-tool-loader.d.ts +1 -1
  54. package/dist/tools/dynamic-tool-loader.d.ts.map +1 -1
  55. package/dist/tools/edit-file.d.ts.map +1 -1
  56. package/dist/tools/edit-file.js +188 -79
  57. package/dist/tools/glob.d.ts.map +1 -1
  58. package/dist/tools/glob.js +22 -15
  59. package/dist/tools/grep.d.ts.map +1 -1
  60. package/dist/tools/grep.js +43 -29
  61. package/dist/tools/index.d.ts +15 -48
  62. package/dist/tools/index.d.ts.map +1 -1
  63. package/dist/tools/index.js +4 -4
  64. package/dist/tools/ls.d.ts.map +1 -1
  65. package/dist/tools/ls.js +1 -1
  66. package/dist/tools/read-file.d.ts +1 -3
  67. package/dist/tools/read-file.d.ts.map +1 -1
  68. package/dist/tools/read-file.js +21 -16
  69. package/dist/tools/save-file.d.ts.map +1 -1
  70. package/dist/tools/save-file.js +26 -21
  71. package/dist/tools/web-fetch.d.ts +0 -12
  72. package/dist/tools/web-fetch.d.ts.map +1 -1
  73. package/dist/tools/web-fetch.js +18 -1
  74. package/dist/tools/web-search.d.ts +0 -18
  75. package/dist/tools/web-search.d.ts.map +1 -1
  76. package/dist/tui/autocomplete/file-search-provider.js +1 -1
  77. package/dist/tui/autocomplete/utils.d.ts +2 -1
  78. package/dist/tui/autocomplete/utils.d.ts.map +1 -1
  79. package/dist/tui/autocomplete/utils.js +25 -23
  80. package/dist/tui/components/editor.d.ts +2 -1
  81. package/dist/tui/components/editor.d.ts.map +1 -1
  82. package/dist/tui/components/editor.js +1 -1
  83. package/dist/tui/components/markdown.d.ts +2 -2
  84. package/dist/tui/components/markdown.d.ts.map +1 -1
  85. package/dist/tui/components/welcome.d.ts +2 -1
  86. package/dist/tui/components/welcome.d.ts.map +1 -1
  87. package/dist/tui/editor-launcher.d.ts +3 -2
  88. package/dist/tui/editor-launcher.d.ts.map +1 -1
  89. package/dist/tui/index.d.ts +0 -1
  90. package/dist/tui/index.d.ts.map +1 -1
  91. package/dist/tui/tui.d.ts +1 -0
  92. package/dist/tui/tui.d.ts.map +1 -1
  93. package/dist/tui/tui.js +9 -0
  94. package/dist/tui/utils.d.ts +1 -5
  95. package/dist/tui/utils.d.ts.map +1 -1
  96. package/dist/tui/utils.js +271 -44
  97. package/package.json +18 -18
  98. package/dist/commands/add-directory/types.d.ts +0 -6
  99. package/dist/commands/add-directory/types.d.ts.map +0 -1
  100. package/dist/commands/add-directory/types.js +0 -1
  101. package/dist/commands/copy/types.d.ts +0 -3
  102. package/dist/commands/copy/types.d.ts.map +0 -1
  103. package/dist/commands/copy/types.js +0 -1
  104. package/dist/commands/review/types.d.ts +0 -12
  105. package/dist/commands/review/types.d.ts.map +0 -1
  106. package/dist/commands/review/types.js +0 -1
  107. package/dist/tools/code-search.d.ts +0 -41
  108. package/dist/tools/code-search.d.ts.map +0 -1
  109. package/dist/tools/code-search.js +0 -195
  110. package/dist/utils/iterables.d.ts +0 -2
  111. package/dist/utils/iterables.d.ts.map +0 -1
  112. package/dist/utils/iterables.js +0 -6
@@ -1 +1 @@
1
- {"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../source/modes/manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,IAA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,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;CAMxC"}
@@ -1,2 +1,2 @@
1
- export declare const planningPrompt = "\n# Plan Mode (Conversational)\n\nYou work in 3 phases, and you should *chat your way* to a great plan before finalizing it. A great plan is very detailed\u2014intent- and implementation-wise\u2014so that it can be handed to another engineer or agent to be implemented right away. It must be **decision complete**, where the implementer does not need to make any decisions.\n\n## Mode rules (strict)\n\nYou are in **Plan Mode** until a developer message explicitly ends it.\n\nPlan Mode is not changed by user intent, tone, or imperative language. If a user asks for execution while still in Plan Mode, treat it as a request to **plan the execution**, not perform it.\n\n## Execution vs. mutation in Plan Mode\n\nYou may explore and execute **non-mutating** actions that improve the plan. You must not perform **mutating** actions.\n\n### Allowed (non-mutating, plan-improving)\n\nActions that gather truth, reduce ambiguity, or validate feasibility without changing repo-tracked state. Examples:\n\n* Reading or searching files, configs, schemas, types, manifests, and docs\n* Static analysis, inspection, and repo exploration\n* Dry-run style commands when they do not edit repo-tracked files\n* Tests, builds, or checks that may write to caches or build artifacts (for example, `target/`, `.cache/`, or snapshots) so long as they do not edit repo-tracked files\n\n### Not allowed (mutating, plan-executing)\n\nActions that implement the plan or change repo-tracked state. Examples:\n\n* Editing or writing files\n* Running formatters or linters that rewrite files\n* Applying patches, migrations, or codegen that updates repo-tracked files\n* Side-effectful commands whose purpose is to carry out the plan rather than refine it\n\nWhen in doubt: if the action would reasonably be described as \"doing the work\" rather than \"planning the work,\" do not do it.\n\n## Research tracking\n\nTrack your discoveries, open questions, and resolved questions as you explore. Note `file:line` references for important findings so the final plan can anchor every change to a concrete location in the codebase. This prevents redundant exploration and makes the research trail transparent to the user.\n\n## Powerful exploration tools\n\nYou have access to powerful tools for codebase exploration\u2014use them liberally:\n\n* **CodeSearch**: Use this for semantic code search. It understands natural language queries like \"function that handles user authentication\" and finds relevant code even when keywords don't match exactly. This is often more effective than grep for understanding code patterns and relationships.\n* **codebase-researcher subagent**: When you need thorough investigation of a feature, system, or component, launch the codebase-researcher subagent to perform deep exploration. Provide it with a detailed brief and it will comprehensively investigate the codebase, returning findings that you can synthesize into your plan.\n\nFor complex tasks, consider: (1) launching the codebase-researcher in parallel while you explore other areas, (2) using CodeSearch to find related patterns across the codebase, then (3) synthesizing findings into your plan.\n\n## PHASE 1 \u2014 Ground in the environment (explore first, ask second)\n\nBegin by grounding yourself in the actual environment. Eliminate unknowns in the prompt by discovering facts, not by asking the user. Resolve all questions that can be answered through exploration or inspection. Identify missing or ambiguous details only if they cannot be derived from the environment. Silent exploration between turns is allowed and encouraged.\n\nBefore asking the user any question, perform at least one targeted non-mutating exploration pass (for example: search relevant files, inspect likely entrypoints/configs, confirm current implementation shape), unless no local environment/repo is available.\n\nException: you may ask clarifying questions about the user's prompt before exploring, ONLY if there are obvious ambiguities or contradictions in the prompt itself. However, if ambiguity might be resolved by exploring, always prefer exploring first.\n\nDo not ask questions that can be answered from the repo or system (for example, \"where is this struct?\" or \"which UI component should we use?\" when exploration can make it clear). Only ask once you have exhausted reasonable non-mutating exploration.\n\n## PHASE 2 \u2014 Intent chat (what they actually want)\n\n* Keep asking until you can clearly state: goal + success criteria, audience, in/out of scope, constraints, current state, and the key preferences/tradeoffs.\n* Require an explicit **\"Out of Scope\"** statement \u2014 what we are NOT doing. This prevents scope creep and sets clear expectations.\n* Be skeptical: actively challenge vague requirements, identify issues early, and verify assumptions against code rather than accepting them at face value.\n* Bias toward questions over guessing: if any high-impact ambiguity remains, do NOT plan yet\u2014ask.\n\n## PHASE 3 \u2014 Implementation chat (what/how we\u2019ll build)\n\n* Once intent is stable, keep asking until the spec is decision complete: approach, interfaces (APIs/schemas/I/O), data flow, edge cases/failure modes, testing + acceptance criteria, rollout/monitoring, and any migrations/compat constraints.\n* **Propose a plan outline first**: before writing the full detailed plan, present a high-level outline of implementation phases \u2014 each with a name and what it accomplishes. Get user feedback on structure before filling in details.\n* **Migration, rollback, and backwards compatibility**: when applicable, give these dedicated attention. They are often the hardest parts of implementation and must not be an afterthought.\n* **Common implementation sequencing** \u2014 use these as reference when ordering phases:\n * Database changes: schema/migration \u2192 store methods \u2192 business logic \u2192 API \u2192 clients\n * New features: research existing patterns \u2192 data model \u2192 backend logic \u2192 API endpoints \u2192 UI\n * Refactoring: document current behavior \u2192 plan incremental changes \u2192 maintain backwards compatibility \u2192 migration strategy\n\n## Asking questions\n\nCritical rules:\n\n* Offer meaningful multiple\u2011choice options when possible; don\u2019t include filler choices that are obviously wrong or irrelevant.\n\nYou SHOULD ask many questions, but each question must:\n\n* materially change the spec/plan, OR\n* confirm/lock an assumption, OR\n* choose between meaningful tradeoffs.\n* not be answerable by non-mutating commands.\n\n## Two kinds of unknowns (treat differently)\n\n1. **Discoverable facts** (repo/system truth): explore first.\n\n * Before asking, run targeted searches and check likely sources of truth (configs/manifests/entrypoints/schemas/types/constants).\n * Ask only if: multiple plausible candidates; nothing found but you need a missing identifier/context; or ambiguity is actually product intent.\n * If asking, present concrete candidates (paths/service names) + recommend one.\n * Never ask questions you can answer from your environment (e.g., \u201Cwhere is this struct\u201D).\n\n2. **Preferences/tradeoffs** (not discoverable): ask early.\n\n * These are intent or implementation preferences that cannot be derived from exploration.\n * Provide 2\u20134 mutually exclusive options + a recommended default.\n * If unanswered, proceed with the recommended option and record it as an assumption in the final plan.\n\n## Finalization rule\n\nOnly output the final plan when it is decision complete and leaves no decisions to the implementer.\n\nWhen you present the official plan, wrap it in a `<proposed_plan>` block so the client can render it specially:\n\n1) The opening tag must be on its own line.\n2) Start the plan content on the next line (no text on the same line as the tag).\n3) The closing tag must be on its own line.\n4) Use Markdown inside the block.\n5) Keep the tags exactly as `<proposed_plan>` and `</proposed_plan>` (do not translate or rename them), even if the plan content is in another language.\n\nExample:\n\n<proposed_plan>\nplan content\n</proposed_plan>\n\nplan content should be human and agent digestible. The final plan must be plan-only and include:\n\n* A clear title\n* A brief summary section\n* Important changes or additions to public APIs/interfaces/types\n* Specific `file:line` references for all code locations the plan touches\n* An explicit **\"Out of Scope\"** section\n* **Success criteria** separated into two categories:\n * **Automated verification** \u2014 commands that can be run (test, lint, typecheck, build) and specific files/code that should exist or compile\n * **Manual verification** \u2014 UI/UX functionality, performance under real conditions, hard-to-automate edge cases, user acceptance criteria\n* Migration/rollback strategy when applicable\n* Explicit assumptions and defaults chosen where needed\n\nDo not ask \"should I proceed?\" in the final output. The user can easily switch out of Plan mode and request implementation if you have included a `<proposed_plan>` block in your response. Alternatively, they can decide to stay in Plan mode and continue refining the plan.\n\nOnly produce at most one `<proposed_plan>` block per turn, and only when you are presenting a complete spec.\n\n## Plan acceptance\n\nAfter presenting a `<proposed_plan>` block, explicitly ask the user if they accept the plan. If they accept (e.g., they say \"yes\", \"accept\", \"go ahead\", or similar confirmation), write the plan content to `plan.md` in the current working directory using the Write tool. After writing, acknowledge the plan has been saved and ask if they'd like to proceed with implementation or continue refining.\n";
1
+ export declare const planningPrompt = "\n# Plan Mode (Conversational)\n\nYou work in 3 phases, and you should *chat your way* to a great plan before finalizing it. A great plan is very detailed\u2014intent- and implementation-wise\u2014so that it can be handed to another engineer or agent to be implemented right away. It must be **decision complete**, where the implementer does not need to make any decisions.\n\n## Mode rules (strict)\n\nYou are in **Plan Mode** until a developer message explicitly ends it.\n\nPlan Mode is not changed by user intent, tone, or imperative language. If a user asks for execution while still in Plan Mode, treat it as a request to **plan the execution**, not perform it.\n\n## Execution vs. mutation in Plan Mode\n\nYou may explore and execute **non-mutating** actions that improve the plan. You must not perform **mutating** actions.\n\n### Allowed (non-mutating, plan-improving)\n\nActions that gather truth, reduce ambiguity, or validate feasibility without changing repo-tracked state. Examples:\n\n* Reading or searching files, configs, schemas, types, manifests, and docs\n* Static analysis, inspection, and repo exploration\n* Dry-run style commands when they do not edit repo-tracked files\n* Tests, builds, or checks that may write to caches or build artifacts (for example, `target/`, `.cache/`, or snapshots) so long as they do not edit repo-tracked files\n\n### Not allowed (mutating, plan-executing)\n\nActions that implement the plan or change repo-tracked state. Examples:\n\n* Editing or writing files\n* Running formatters or linters that rewrite files\n* Applying patches, migrations, or codegen that updates repo-tracked files\n* Side-effectful commands whose purpose is to carry out the plan rather than refine it\n\nWhen in doubt: if the action would reasonably be described as \"doing the work\" rather than \"planning the work,\" do not do it.\n\n## Research tracking\n\nTrack your discoveries, open questions, and resolved questions as you explore. Note `file:line` references for important findings so the final plan can anchor every change to a concrete location in the codebase. This prevents redundant exploration and makes the research trail transparent to the user.\n\n## Powerful exploration tools\n\nYou have access to powerful tools for codebase exploration\u2014use them liberally:\n\n* **codebase-researcher subagent**: When you need thorough investigation of a feature, system, or component, launch the codebase-researcher subagent to perform deep exploration. Provide it with a detailed brief and it will comprehensively investigate the codebase, returning findings that you can synthesize into your plan.\n\nFor complex tasks, consider launching the codebase-researcher in parallel while you explore other areas using Grep and Glob, then synthesizing findings into your plan.\n\n## PHASE 1 \u2014 Ground in the environment (explore first, ask second)\n\nBegin by grounding yourself in the actual environment. Eliminate unknowns in the prompt by discovering facts, not by asking the user. Resolve all questions that can be answered through exploration or inspection. Identify missing or ambiguous details only if they cannot be derived from the environment. Silent exploration between turns is allowed and encouraged.\n\nBefore asking the user any question, perform at least one targeted non-mutating exploration pass (for example: search relevant files, inspect likely entrypoints/configs, confirm current implementation shape), unless no local environment/repo is available.\n\nException: you may ask clarifying questions about the user's prompt before exploring, ONLY if there are obvious ambiguities or contradictions in the prompt itself. However, if ambiguity might be resolved by exploring, always prefer exploring first.\n\nDo not ask questions that can be answered from the repo or system (for example, \"where is this struct?\" or \"which UI component should we use?\" when exploration can make it clear). Only ask once you have exhausted reasonable non-mutating exploration.\n\n## PHASE 2 \u2014 Intent chat (what they actually want)\n\n* Keep asking until you can clearly state: goal + success criteria, audience, in/out of scope, constraints, current state, and the key preferences/tradeoffs.\n* Require an explicit **\"Out of Scope\"** statement \u2014 what we are NOT doing. This prevents scope creep and sets clear expectations.\n* Be skeptical: actively challenge vague requirements, identify issues early, and verify assumptions against code rather than accepting them at face value.\n* Bias toward questions over guessing: if any high-impact ambiguity remains, do NOT plan yet\u2014ask.\n\n## PHASE 3 \u2014 Implementation chat (what/how we\u2019ll build)\n\n* Once intent is stable, keep asking until the spec is decision complete: approach, interfaces (APIs/schemas/I/O), data flow, edge cases/failure modes, testing + acceptance criteria, rollout/monitoring, and any migrations/compat constraints.\n* **Propose a plan outline first**: before writing the full detailed plan, present a high-level outline of implementation phases \u2014 each with a name and what it accomplishes. Get user feedback on structure before filling in details.\n* **Migration, rollback, and backwards compatibility**: when applicable, give these dedicated attention. They are often the hardest parts of implementation and must not be an afterthought.\n* **Common implementation sequencing** \u2014 use these as reference when ordering phases:\n * Database changes: schema/migration \u2192 store methods \u2192 business logic \u2192 API \u2192 clients\n * New features: research existing patterns \u2192 data model \u2192 backend logic \u2192 API endpoints \u2192 UI\n * Refactoring: document current behavior \u2192 plan incremental changes \u2192 maintain backwards compatibility \u2192 migration strategy\n\n## Asking questions\n\nCritical rules:\n\n* Offer meaningful multiple\u2011choice options when possible; don\u2019t include filler choices that are obviously wrong or irrelevant.\n\nYou SHOULD ask many questions, but each question must:\n\n* materially change the spec/plan, OR\n* confirm/lock an assumption, OR\n* choose between meaningful tradeoffs.\n* not be answerable by non-mutating commands.\n\n## Two kinds of unknowns (treat differently)\n\n1. **Discoverable facts** (repo/system truth): explore first.\n\n * Before asking, run targeted searches and check likely sources of truth (configs/manifests/entrypoints/schemas/types/constants).\n * Ask only if: multiple plausible candidates; nothing found but you need a missing identifier/context; or ambiguity is actually product intent.\n * If asking, present concrete candidates (paths/service names) + recommend one.\n * Never ask questions you can answer from your environment (e.g., \u201Cwhere is this struct\u201D).\n\n2. **Preferences/tradeoffs** (not discoverable): ask early.\n\n * These are intent or implementation preferences that cannot be derived from exploration.\n * Provide 2\u20134 mutually exclusive options + a recommended default.\n * If unanswered, proceed with the recommended option and record it as an assumption in the final plan.\n\n## Finalization rule\n\nOnly output the final plan when it is decision complete and leaves no decisions to the implementer.\n\nWhen you present the official plan, wrap it in a `<proposed_plan>` block so the client can render it specially:\n\n1) The opening tag must be on its own line.\n2) Start the plan content on the next line (no text on the same line as the tag).\n3) The closing tag must be on its own line.\n4) Use Markdown inside the block.\n5) Keep the tags exactly as `<proposed_plan>` and `</proposed_plan>` (do not translate or rename them), even if the plan content is in another language.\n\nExample:\n\n<proposed_plan>\nplan content\n</proposed_plan>\n\nplan content should be human and agent digestible. The final plan must be plan-only and include:\n\n* A clear title\n* A brief summary section\n* Important changes or additions to public APIs/interfaces/types\n* Specific `file:line` references for all code locations the plan touches\n* An explicit **\"Out of Scope\"** section\n* **Success criteria** separated into two categories:\n * **Automated verification** \u2014 commands that can be run (test, lint, typecheck, build) and specific files/code that should exist or compile\n * **Manual verification** \u2014 UI/UX functionality, performance under real conditions, hard-to-automate edge cases, user acceptance criteria\n* Migration/rollback strategy when applicable\n* Explicit assumptions and defaults chosen where needed\n\nDo not ask \"should I proceed?\" in the final output. The user can easily switch out of Plan mode and request implementation if you have included a `<proposed_plan>` block in your response. Alternatively, they can decide to stay in Plan mode and continue refining the plan.\n\nOnly produce at most one `<proposed_plan>` block per turn, and only when you are presenting a complete spec.\n\n## Plan acceptance\n\nAfter presenting a `<proposed_plan>` block, explicitly ask the user if they accept the plan. If they accept (e.g., they say \"yes\", \"accept\", \"go ahead\", or similar confirmation), write the plan content to `plan.md` in the current working directory using the Write tool. After writing, acknowledge the plan has been saved and ask if they'd like to proceed with implementation or continue refining.\n";
2
2
  //# sourceMappingURL=prompts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../source/modes/prompts.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,cAAc,ykTA6I1B,CAAC"}
1
+ {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../source/modes/prompts.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,cAAc,suSA4I1B,CAAC"}
@@ -42,10 +42,9 @@ Track your discoveries, open questions, and resolved questions as you explore. N
42
42
 
43
43
  You have access to powerful tools for codebase exploration—use them liberally:
44
44
 
45
- * **CodeSearch**: Use this for semantic code search. It understands natural language queries like "function that handles user authentication" and finds relevant code even when keywords don't match exactly. This is often more effective than grep for understanding code patterns and relationships.
46
45
  * **codebase-researcher subagent**: When you need thorough investigation of a feature, system, or component, launch the codebase-researcher subagent to perform deep exploration. Provide it with a detailed brief and it will comprehensively investigate the codebase, returning findings that you can synthesize into your plan.
47
46
 
48
- For complex tasks, consider: (1) launching the codebase-researcher in parallel while you explore other areas, (2) using CodeSearch to find related patterns across the codebase, then (3) synthesizing findings into your plan.
47
+ For complex tasks, consider launching the codebase-researcher in parallel while you explore other areas using Grep and Glob, then synthesizing findings into your plan.
49
48
 
50
49
  ## PHASE 1 — Ground in the environment (explore first, ask second)
51
50
 
@@ -1 +1 @@
1
- {"version":3,"file":"mentions.d.ts","sourceRoot":"","sources":["../../source/prompts/mentions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAG5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAwGhD,wBAAsB,aAAa,CACjC,OAAO,EAAE,MAAM,EACf,EACE,OAAO,EACP,KAAK,EACL,UAAU,GACX,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,aAAa,CAAC;IACrB,UAAU,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC,GACA,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,WAAW,EAAE,CAAA;CAAE,CAAC,CAwDtD"}
1
+ {"version":3,"file":"mentions.d.ts","sourceRoot":"","sources":["../../source/prompts/mentions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAG5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAwGhD,wBAAsB,aAAa,CACjC,OAAO,EAAE,MAAM,EACf,EACE,OAAO,EACP,KAAK,EACL,UAAU,GACX,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,aAAa,CAAC;IACrB,UAAU,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC,GACA,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,WAAW,EAAE,CAAA;CAAE,CAAC,CAwFtD"}
@@ -75,20 +75,31 @@ async function processFileCommand(context) {
75
75
  }
76
76
  }
77
77
  export async function processPrompt(message, { baseDir, model, pasteStore, }) {
78
- const fileRegex = /(?<![a-zA-Z0-9_-])#([a-zA-Z_][^\s#]*?(?:\.[a-zA-Z0-9]+)?)(?![^\s#]*#[\d.]+)/g;
78
+ // Regex matches # followed by a file path:
79
+ // - Can start with . (relative paths like ./file or .hidden)
80
+ // - Can start with / (absolute paths)
81
+ // - Can start with ~ (home directory)
82
+ // - Can start with alphanumeric/underscore (simple filenames)
83
+ // - Path continues with non-whitespace, non-# characters
84
+ // - Does NOT match # followed by just digits (paste placeholder format like [Paste #1])
85
+ // - Does NOT match # followed by digits and dots (version numbers like #1.2.3)
86
+ // - Does NOT match issue references like #123
87
+ const fileRegex = /(?<![a-zA-Z0-9_-])#(?![\d.]+(?:[\s,\]]|$))([./~]?[a-zA-Z0-9_][a-zA-Z0-9_./~-]*|[./~][a-zA-Z0-9_./~-]+)/g;
79
88
  // Collect all matches for files
80
89
  const fileMatches = Array.from(message.matchAll(fileRegex));
81
90
  const mentionProcessingPromises = [];
91
+ const matchStrings = [];
82
92
  // Process file references - collect promises
83
93
  for (const match of fileMatches) {
84
- const firstMatch = match[1];
85
- if (firstMatch) {
94
+ const filePath = match[1];
95
+ if (filePath) {
86
96
  const context = {
87
97
  model,
88
98
  baseDir,
89
- match: firstMatch,
99
+ match: filePath,
90
100
  };
91
101
  mentionProcessingPromises.push(processFileCommand(context));
102
+ matchStrings.push(match[0]); // Store the full match including #
92
103
  }
93
104
  }
94
105
  let processedMessage = message;
@@ -110,9 +121,27 @@ export async function processPrompt(message, { baseDir, model, pasteStore, }) {
110
121
  // Wait for all mentions to be processed
111
122
  const mentionResults = await Promise.all(mentionProcessingPromises);
112
123
  const context = [];
113
- for (const mention of mentionResults) {
114
- context.push(mention);
124
+ // Remove file references from message and add contents to context
125
+ for (let i = 0; i < mentionResults.length; i++) {
126
+ const fileContent = mentionResults[i];
127
+ const matchString = matchStrings[i];
128
+ // Add file content to context
129
+ context.push(fileContent);
130
+ // Remove the #filepath reference from the message
131
+ processedMessage = processedMessage.replace(matchString, "");
115
132
  }
133
+ // Clean up multiple spaces left by removals, but preserve newlines
134
+ // First, normalize line endings to \n
135
+ processedMessage = processedMessage
136
+ .replace(/\r\n/g, "\n")
137
+ .replace(/\r/g, "\n");
138
+ // Replace multiple spaces with a single space (but not newlines)
139
+ processedMessage = processedMessage.replace(/[ \t]+/g, " ");
140
+ // Trim whitespace from each line while preserving empty lines
141
+ processedMessage = processedMessage
142
+ .split("\n")
143
+ .map((line) => line.trim())
144
+ .join("\n");
116
145
  return {
117
146
  message: processedMessage,
118
147
  context,
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/repl/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,UAAU,EACV,UAAU,EAEX,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG7D,OAAO,KAAK,EAAU,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAShF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAs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;IACG,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC;CAG7C"}
@@ -393,7 +393,15 @@ export class Repl {
393
393
  });
394
394
  this.thinkingBlockComponent = component;
395
395
  this.allThinkingBlocks.push(component);
396
- this.addComponentWithSpacing(component);
396
+ // If a streaming message component already exists (text came before thinking),
397
+ // insert the thinking block BEFORE it to ensure correct visual order
398
+ if (this.streamingComponent) {
399
+ this.chatContainer.insertChildBefore(this.streamingComponent, component);
400
+ this.chatContainer.insertChildBefore(this.streamingComponent, new Spacer(1));
401
+ }
402
+ else {
403
+ this.addComponentWithSpacing(component);
404
+ }
397
405
  this.thinkingBlockComponent.updateContent(event);
398
406
  this.tui.requestRender();
399
407
  break;
@@ -16,7 +16,7 @@ type ResponseMessage = AssistantModelMessage | ToolModelMessage;
16
16
  * Only stores total aggregated usage and last turn's usage
17
17
  * to minimize session file size while maintaining necessary information.
18
18
  */
19
- export type SessionTokenUsage = {
19
+ type SessionTokenUsage = {
20
20
  /** Aggregated total for entire session */
21
21
  total: {
22
22
  inputTokens: number;
@@ -40,7 +40,7 @@ export type SessionTokenUsage = {
40
40
  * @deprecated Use SessionTokenUsage instead. Kept for backward compatibility
41
41
  * with older session files that may have the old format.
42
42
  */
43
- export type TokenUsageTurn = {
43
+ type TokenUsageTurn = {
44
44
  stepIndex: number;
45
45
  inputTokens: number;
46
46
  outputTokens: number;
@@ -59,7 +59,7 @@ export type TokenUsageTurn = {
59
59
  timestamp: number;
60
60
  estimatedCost: number;
61
61
  };
62
- export type SavedMessageHistory = {
62
+ type SavedMessageHistory = {
63
63
  project: string;
64
64
  sessionId: string;
65
65
  modelId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../source/sessions/manager.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,aAAa,CAAC;AAYvC,OAAO,EACL,KAAK,qBAAqB,EAE1B,KAAK,SAAS,EAAE,kBAAkB;AAClC,KAAK,YAAY,EAEjB,KAAK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AAE;QACrB,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;QACrB,WAAW,EAAE,MAAM,CAAC;QACpB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,eAAe,EAAE,MAAM,CAAC;QACxB,iBAAiB,EAAE;YACjB,aAAa,EAAE,MAAM,CAAC;YACtB,eAAe,EAAE,MAAM,CAAC;YACxB,gBAAgB,EAAE,MAAM,CAAC;SAC1B,CAAC;QACF,kBAAkB,EAAE;YAClB,UAAU,EAAE,MAAM,CAAC;YACnB,eAAe,EAAE,MAAM,CAAC;SACzB,CAAC;KACH,GAAG,IAAI;IA4BR;;;OAGG;IACH,aAAa,IAAI,cAAc,EAAE;IAMjC,kBAAkB,IAAI;QACpB,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;QACrB,WAAW,EAAE,MAAM,CAAC;QACpB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,eAAe,EAAE,MAAM,CAAC;QACxB,aAAa,EAAE,MAAM,CAAC;KACvB;IAcD,wBAAwB,IAAI,MAAM;IAOlC,eAAe,IAAI,IAAI;CAGxB"}
@@ -177,7 +177,7 @@ export class SessionManager extends EventEmitter {
177
177
  }
178
178
  get() {
179
179
  const history = [...this.history].filter(this.validMessage);
180
- if (this.transientMessages.length > 0) {
180
+ if (this.transientMessages.length > 0 && history.length > 0) {
181
181
  const lastIndex = history.length - 1;
182
182
  return [
183
183
  ...history.slice(0, lastIndex),
@@ -10,7 +10,7 @@ export interface Skill {
10
10
  arguments?: string;
11
11
  examples?: string[];
12
12
  }
13
- export interface LoadSkillsFromDirOptions {
13
+ interface LoadSkillsFromDirOptions {
14
14
  dir: string;
15
15
  source: string;
16
16
  useColonPath?: boolean;
@@ -25,4 +25,5 @@ export declare class Skills {
25
25
  }
26
26
  export declare function loadSkills(): Promise<Skills>;
27
27
  export declare function formatSkillsForPrompt(skills: Skill[]): string;
28
+ export {};
28
29
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/skills/index.ts"],"names":[],"mappings":"AAoBA,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,OAAO,CAAC;IACvB,sBAAsB,EAAE,OAAO,CAAC;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,wBAAwB;IACvC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAqRD,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,wBAAwB,EACjC,MAAM,SAAK,GACV,OAAO,CAAC,KAAK,EAAE,CAAC,CASlB;AAED,qBAAa,MAAM;IACjB,OAAO,CAAC,MAAM,CAAU;gBAEZ,MAAM,EAAE,KAAK,EAAE;IAI3B,MAAM,IAAI,KAAK,EAAE;IAIjB,gBAAgB,IAAI,KAAK,EAAE;IAI3B,iBAAiB,IAAI,KAAK,EAAE;CAG7B;AAED,wBAAsB,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAsFlD;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAgC7D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/skills/index.ts"],"names":[],"mappings":"AAoBA,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,OAAO,CAAC;IACvB,sBAAsB,EAAE,OAAO,CAAC;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,UAAU,wBAAwB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAqRD,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,wBAAwB,EACjC,MAAM,SAAK,GACV,OAAO,CAAC,KAAK,EAAE,CAAC,CASlB;AAED,qBAAa,MAAM;IACjB,OAAO,CAAC,MAAM,CAAU;gBAEZ,MAAM,EAAE,KAAK,EAAE;IAI3B,MAAM,IAAI,KAAK,EAAE;IAIjB,gBAAgB,IAAI,KAAK,EAAE;IAI3B,iBAAiB,IAAI,KAAK,EAAE;CAG7B;AAED,wBAAsB,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAsFlD;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAgC7D"}
@@ -1,4 +1,4 @@
1
- export interface Subagent {
1
+ interface Subagent {
2
2
  name: string;
3
3
  description: string;
4
4
  model?: string;
@@ -12,4 +12,5 @@ export declare function loadSubagents(): Promise<Subagent[]>;
12
12
  export declare function getSubagent(name: string): Promise<Subagent | undefined>;
13
13
  export declare function formatSubagentsForDescription(subagents: Subagent[]): string;
14
14
  export declare function formatSubagentsForPrompt(subagents: Subagent[]): string;
15
+ export {};
15
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/subagents/index.ts"],"names":[],"mappings":"AAeA,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAkND,wBAAsB,aAAa,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC,CAgBzD;AAED,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,CAG7E;AAED,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,QAAQ,EAAE,GAAG,MAAM,CAa3E;AAED,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,QAAQ,EAAE,GAAG,MAAM,CA6CtE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/subagents/index.ts"],"names":[],"mappings":"AAeA,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAkND,wBAAsB,aAAa,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC,CAgBzD;AAED,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,CAG7E;AAED,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,QAAQ,EAAE,GAAG,MAAM,CAa3E;AAED,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,QAAQ,EAAE,GAAG,MAAM,CA6CtE"}
@@ -59,5 +59,5 @@ export declare function colorizeLines(input: string[]): string[];
59
59
  * Credit: Matheus Sampaio https://github.com/matheussampaio
60
60
  */
61
61
  export declare function hyperlink(url: string, text: string): string;
62
- export type { CharName, HorizontalAlignment, VerticalAlignment, TableInstanceOptions, TableConstructorOptions, CellOptions, Cell, };
62
+ export type { Cell, CellOptions, CharName, HorizontalAlignment, TableConstructorOptions, TableInstanceOptions, VerticalAlignment, };
63
63
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../source/terminal/table/utils.ts"],"names":[],"mappings":"AAEA,KAAK,QAAQ,GACT,KAAK,GACL,QAAQ,GACR,SAAS,GACT,UAAU,GACV,QAAQ,GACR,WAAW,GACX,YAAY,GACZ,aAAa,GACb,MAAM,GACN,SAAS,GACT,KAAK,GACL,QAAQ,GACR,OAAO,GACP,UAAU,GACV,QAAQ,CAAC;AAEb,KAAK,mBAAmB,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AACvD,KAAK,iBAAiB,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAErD,UAAU,YAAY;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAChC,UAAU,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACjC,SAAS,EAAE,mBAAmB,EAAE,CAAC;IACjC,SAAS,EAAE,iBAAiB,EAAE,CAAC;IAC/B,IAAI,EAAE,IAAI,EAAE,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,UAAU,oBAAqB,SAAQ,YAAY;IACjD,KAAK,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAChC,KAAK,EAAE;QACL,cAAc,EAAE,MAAM,CAAC;QACvB,eAAe,EAAE,MAAM,CAAC;QACxB,IAAI,EAAE,MAAM,EAAE,CA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B,MAAM,EAAE,CAQV;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAUvD;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAmB3D;AAED,YAAY,EACV,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,mBAAmB,EACnB,uBAAuB,EACvB,oBAAoB,EACpB,iBAAiB,GAClB,CAAC"}
@@ -1,9 +1,9 @@
1
1
  import { ansiStyles } from "./ansi-styles.js";
2
2
  import stringWidth from "./string-width.js";
3
3
  import stripAnsi from "./strip-ansi.js";
4
- const ESCAPES = new Set(["\\u001B", "\\u009B"]);
4
+ const ESCAPES = new Set(["\u001B", "\u009B"]);
5
5
  const END_CODE = 39;
6
- const ANSI_ESCAPE_BELL = "\\u0007";
6
+ const ANSI_ESCAPE_BELL = "\u0007";
7
7
  const ANSI_CSI = "[";
8
8
  const ANSI_OSC = "]";
9
9
  const ANSI_SGR_TERMINATOR = "m";
@@ -53,7 +53,7 @@ ${await environmentInfo(options.workspace.primaryDir, options.workspace.allowedD
53
53
  const effectiveTimeout = timeout ?? defaultTimeout;
54
54
  try {
55
55
  const result = await subagent.execute({
56
- model: isSupportedModel(model) ? model : "opencode:minimax-m2.5-free",
56
+ model: isSupportedModel(model) ? model : "opencode:minimax-m2.5",
57
57
  system: systemPrompt,
58
58
  prompt,
59
59
  abortSignal,
@@ -0,0 +1,62 @@
1
+ import { z } from "zod";
2
+ import type { WorkspaceContext } from "../index.ts";
3
+ import type { ToolExecutionOptions } from "./types.ts";
4
+ export declare const ApplyPatchTool: {
5
+ name: "ApplyPatch";
6
+ };
7
+ declare const inputSchema: z.ZodObject<{
8
+ patchText: z.ZodString;
9
+ }, z.core.$strip>;
10
+ type ApplyPatchInputSchema = z.infer<typeof inputSchema>;
11
+ export type Hunk = {
12
+ type: "add";
13
+ path: string;
14
+ contents: string;
15
+ } | {
16
+ type: "delete";
17
+ path: string;
18
+ } | {
19
+ type: "update";
20
+ path: string;
21
+ movePath?: string;
22
+ chunks: UpdateFileChunk[];
23
+ };
24
+ export interface UpdateFileChunk {
25
+ oldLines: string[];
26
+ newLines: string[];
27
+ changeContext?: string;
28
+ isEndOfFile?: boolean;
29
+ }
30
+ export type ApplyPatchFileChange = {
31
+ type: "add";
32
+ path: string;
33
+ content: string;
34
+ } | {
35
+ type: "delete";
36
+ path: string;
37
+ content?: string;
38
+ } | {
39
+ type: "update";
40
+ path: string;
41
+ unifiedDiff: string;
42
+ movePath?: string;
43
+ newContent: string;
44
+ };
45
+ export interface ParsedApplyPatch {
46
+ hunks: Hunk[];
47
+ }
48
+ export declare function parsePatch(patchText: string): ParsedApplyPatch;
49
+ export declare const createApplyPatchTool: (options: {
50
+ workspace: WorkspaceContext;
51
+ }) => Promise<{
52
+ toolDef: {
53
+ description: string;
54
+ inputSchema: z.ZodObject<{
55
+ patchText: z.ZodString;
56
+ }, z.core.$strip>;
57
+ };
58
+ display({ patchText }: ApplyPatchInputSchema): string;
59
+ execute({ patchText }: ApplyPatchInputSchema, { abortSignal }: ToolExecutionOptions): Promise<string>;
60
+ }>;
61
+ export {};
62
+ //# sourceMappingURL=apply-patch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apply-patch.d.ts","sourceRoot":"","sources":["../../source/tools/apply-patch.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAOpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD,eAAO,MAAM,cAAc;;CAE1B,CAAC;AAEF,QAAA,MAAM,WAAW;;iBAMf,CAAC;AAEH,KAAK,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAGzD,MAAM,MAAM,IAAI,GACZ;IAAE,I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