erosolar-cli 2.1.172 → 2.1.173

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 (213) hide show
  1. package/README.md +1 -1
  2. package/agents/erosolar-code.rules.json +2 -2
  3. package/agents/general.rules.json +21 -3
  4. package/dist/capabilities/askUserCapability.js +1 -1
  5. package/dist/capabilities/askUserCapability.js.map +1 -1
  6. package/dist/capabilities/statusCapability.js +2 -2
  7. package/dist/capabilities/statusCapability.js.map +1 -1
  8. package/dist/codex/capabilities/codexCoreCapability.d.ts +6 -0
  9. package/dist/codex/capabilities/codexCoreCapability.d.ts.map +1 -0
  10. package/dist/codex/capabilities/codexCoreCapability.js +516 -0
  11. package/dist/codex/capabilities/codexCoreCapability.js.map +1 -0
  12. package/dist/codex/fs.d.ts +4 -0
  13. package/dist/codex/fs.d.ts.map +1 -0
  14. package/dist/codex/fs.js +25 -0
  15. package/dist/codex/fs.js.map +1 -0
  16. package/dist/codex/persistence/planStore.d.ts +4 -0
  17. package/dist/codex/persistence/planStore.d.ts.map +1 -0
  18. package/dist/codex/persistence/planStore.js +59 -0
  19. package/dist/codex/persistence/planStore.js.map +1 -0
  20. package/dist/codex/pluginAllowlist.d.ts +4 -0
  21. package/dist/codex/pluginAllowlist.d.ts.map +1 -0
  22. package/dist/codex/pluginAllowlist.js +14 -0
  23. package/dist/codex/pluginAllowlist.js.map +1 -0
  24. package/dist/codex/types.d.ts +21 -0
  25. package/dist/codex/types.d.ts.map +1 -0
  26. package/dist/codex/types.js +62 -0
  27. package/dist/codex/types.js.map +1 -0
  28. package/dist/contracts/agent-schemas.json +5 -5
  29. package/dist/core/agent.d.ts +83 -24
  30. package/dist/core/agent.d.ts.map +1 -1
  31. package/dist/core/agent.js +499 -248
  32. package/dist/core/agent.js.map +1 -1
  33. package/dist/core/preferences.d.ts +1 -0
  34. package/dist/core/preferences.d.ts.map +1 -1
  35. package/dist/core/preferences.js +8 -1
  36. package/dist/core/preferences.js.map +1 -1
  37. package/dist/core/reliabilityPrompt.d.ts +9 -0
  38. package/dist/core/reliabilityPrompt.d.ts.map +1 -0
  39. package/dist/core/reliabilityPrompt.js +31 -0
  40. package/dist/core/reliabilityPrompt.js.map +1 -0
  41. package/dist/core/schemaValidator.js +3 -3
  42. package/dist/core/schemaValidator.js.map +1 -1
  43. package/dist/core/toolPreconditions.d.ts +0 -11
  44. package/dist/core/toolPreconditions.d.ts.map +1 -1
  45. package/dist/core/toolPreconditions.js +33 -164
  46. package/dist/core/toolPreconditions.js.map +1 -1
  47. package/dist/core/toolRuntime.d.ts.map +1 -1
  48. package/dist/core/toolRuntime.js +9 -114
  49. package/dist/core/toolRuntime.js.map +1 -1
  50. package/dist/core/updateChecker.d.ts +61 -1
  51. package/dist/core/updateChecker.d.ts.map +1 -1
  52. package/dist/core/updateChecker.js +147 -3
  53. package/dist/core/updateChecker.js.map +1 -1
  54. package/dist/headless/evalMode.d.ts.map +1 -1
  55. package/dist/headless/evalMode.js +6 -0
  56. package/dist/headless/evalMode.js.map +1 -1
  57. package/dist/headless/headlessApp.d.ts.map +1 -1
  58. package/dist/headless/headlessApp.js +6 -39
  59. package/dist/headless/headlessApp.js.map +1 -1
  60. package/dist/mcp/sseClient.d.ts +4 -1
  61. package/dist/mcp/sseClient.d.ts.map +1 -1
  62. package/dist/mcp/sseClient.js +36 -2
  63. package/dist/mcp/sseClient.js.map +1 -1
  64. package/dist/mcp/stdioClient.d.ts +4 -1
  65. package/dist/mcp/stdioClient.d.ts.map +1 -1
  66. package/dist/mcp/stdioClient.js +41 -1
  67. package/dist/mcp/stdioClient.js.map +1 -1
  68. package/dist/mcp/toolBridge.d.ts +3 -0
  69. package/dist/mcp/toolBridge.d.ts.map +1 -1
  70. package/dist/mcp/toolBridge.js +2 -2
  71. package/dist/mcp/toolBridge.js.map +1 -1
  72. package/dist/mcp/types.d.ts +18 -0
  73. package/dist/mcp/types.d.ts.map +1 -1
  74. package/dist/plugins/tools/nodeDefaults.d.ts.map +1 -1
  75. package/dist/plugins/tools/nodeDefaults.js +0 -2
  76. package/dist/plugins/tools/nodeDefaults.js.map +1 -1
  77. package/dist/providers/openaiResponsesProvider.d.ts.map +1 -1
  78. package/dist/providers/openaiResponsesProvider.js +79 -74
  79. package/dist/providers/openaiResponsesProvider.js.map +1 -1
  80. package/dist/runtime/agentController.d.ts.map +1 -1
  81. package/dist/runtime/agentController.js +6 -3
  82. package/dist/runtime/agentController.js.map +1 -1
  83. package/dist/runtime/agentSession.d.ts +0 -2
  84. package/dist/runtime/agentSession.d.ts.map +1 -1
  85. package/dist/runtime/agentSession.js +2 -2
  86. package/dist/runtime/agentSession.js.map +1 -1
  87. package/dist/shell/interactiveShell.d.ts +25 -18
  88. package/dist/shell/interactiveShell.d.ts.map +1 -1
  89. package/dist/shell/interactiveShell.js +345 -291
  90. package/dist/shell/interactiveShell.js.map +1 -1
  91. package/dist/shell/shellApp.d.ts.map +1 -1
  92. package/dist/shell/shellApp.js +15 -8
  93. package/dist/shell/shellApp.js.map +1 -1
  94. package/dist/shell/systemPrompt.d.ts.map +1 -1
  95. package/dist/shell/systemPrompt.js +4 -15
  96. package/dist/shell/systemPrompt.js.map +1 -1
  97. package/dist/subagents/taskRunner.js +2 -1
  98. package/dist/subagents/taskRunner.js.map +1 -1
  99. package/dist/tools/bashTools.d.ts.map +1 -1
  100. package/dist/tools/bashTools.js +101 -8
  101. package/dist/tools/bashTools.js.map +1 -1
  102. package/dist/tools/diffUtils.d.ts +8 -2
  103. package/dist/tools/diffUtils.d.ts.map +1 -1
  104. package/dist/tools/diffUtils.js +72 -13
  105. package/dist/tools/diffUtils.js.map +1 -1
  106. package/dist/tools/grepTools.d.ts.map +1 -1
  107. package/dist/tools/grepTools.js +10 -2
  108. package/dist/tools/grepTools.js.map +1 -1
  109. package/dist/tools/planningTools.d.ts +0 -10
  110. package/dist/tools/planningTools.d.ts.map +1 -1
  111. package/dist/tools/planningTools.js +0 -16
  112. package/dist/tools/planningTools.js.map +1 -1
  113. package/dist/tools/searchTools.d.ts.map +1 -1
  114. package/dist/tools/searchTools.js +4 -2
  115. package/dist/tools/searchTools.js.map +1 -1
  116. package/dist/ui/PromptController.d.ts +7 -4
  117. package/dist/ui/PromptController.d.ts.map +1 -1
  118. package/dist/ui/PromptController.js +4 -7
  119. package/dist/ui/PromptController.js.map +1 -1
  120. package/dist/ui/ShellUIAdapter.d.ts +286 -28
  121. package/dist/ui/ShellUIAdapter.d.ts.map +1 -1
  122. package/dist/ui/ShellUIAdapter.js +1485 -121
  123. package/dist/ui/ShellUIAdapter.js.map +1 -1
  124. package/dist/ui/UnifiedUIController.d.ts +80 -0
  125. package/dist/ui/UnifiedUIController.d.ts.map +1 -0
  126. package/dist/ui/UnifiedUIController.js +211 -0
  127. package/dist/ui/UnifiedUIController.js.map +1 -0
  128. package/dist/ui/UnifiedUIRenderer.d.ts +102 -46
  129. package/dist/ui/UnifiedUIRenderer.d.ts.map +1 -1
  130. package/dist/ui/UnifiedUIRenderer.js +680 -610
  131. package/dist/ui/UnifiedUIRenderer.js.map +1 -1
  132. package/dist/ui/animatedStatus.d.ts +128 -6
  133. package/dist/ui/animatedStatus.d.ts.map +1 -1
  134. package/dist/ui/animatedStatus.js +383 -50
  135. package/dist/ui/animatedStatus.js.map +1 -1
  136. package/dist/ui/animation/AnimationScheduler.d.ts +192 -0
  137. package/dist/ui/animation/AnimationScheduler.d.ts.map +1 -0
  138. package/dist/ui/animation/AnimationScheduler.js +432 -0
  139. package/dist/ui/animation/AnimationScheduler.js.map +1 -0
  140. package/dist/ui/display.d.ts +179 -25
  141. package/dist/ui/display.d.ts.map +1 -1
  142. package/dist/ui/display.js +678 -96
  143. package/dist/ui/display.js.map +1 -1
  144. package/dist/ui/inPlaceUpdater.d.ts +181 -0
  145. package/dist/ui/inPlaceUpdater.d.ts.map +1 -0
  146. package/dist/ui/inPlaceUpdater.js +515 -0
  147. package/dist/ui/inPlaceUpdater.js.map +1 -0
  148. package/dist/ui/interrupts/InterruptManager.d.ts +142 -0
  149. package/dist/ui/interrupts/InterruptManager.d.ts.map +1 -0
  150. package/dist/ui/interrupts/InterruptManager.js +439 -0
  151. package/dist/ui/interrupts/InterruptManager.js.map +1 -0
  152. package/dist/ui/layout.d.ts +0 -1
  153. package/dist/ui/layout.d.ts.map +1 -1
  154. package/dist/ui/layout.js +0 -12
  155. package/dist/ui/layout.js.map +1 -1
  156. package/dist/ui/orchestration/StatusOrchestrator.d.ts +1 -1
  157. package/dist/ui/orchestration/StatusOrchestrator.js +1 -1
  158. package/dist/ui/orchestration/UIUpdateCoordinator.d.ts +61 -7
  159. package/dist/ui/orchestration/UIUpdateCoordinator.d.ts.map +1 -1
  160. package/dist/ui/orchestration/UIUpdateCoordinator.js +232 -20
  161. package/dist/ui/orchestration/UIUpdateCoordinator.js.map +1 -1
  162. package/dist/ui/shortcutsHelp.d.ts.map +1 -1
  163. package/dist/ui/shortcutsHelp.js +0 -1
  164. package/dist/ui/shortcutsHelp.js.map +1 -1
  165. package/dist/ui/telemetry/ResponseTracker.d.ts +22 -0
  166. package/dist/ui/telemetry/ResponseTracker.d.ts.map +1 -0
  167. package/dist/ui/telemetry/ResponseTracker.js +60 -0
  168. package/dist/ui/telemetry/ResponseTracker.js.map +1 -0
  169. package/dist/ui/telemetry/UITelemetry.d.ts +181 -0
  170. package/dist/ui/telemetry/UITelemetry.d.ts.map +1 -0
  171. package/dist/ui/telemetry/UITelemetry.js +446 -0
  172. package/dist/ui/telemetry/UITelemetry.js.map +1 -0
  173. package/dist/ui/unified/index.d.ts +28 -1
  174. package/dist/ui/unified/index.d.ts.map +1 -1
  175. package/dist/ui/unified/index.js +41 -2
  176. package/dist/ui/unified/index.js.map +1 -1
  177. package/dist/ui/unified/layout.d.ts +12 -0
  178. package/dist/ui/unified/layout.d.ts.map +1 -0
  179. package/dist/ui/unified/layout.js +96 -0
  180. package/dist/ui/unified/layout.js.map +1 -0
  181. package/package.json +1 -2
  182. package/dist/StringUtils.d.ts +0 -8
  183. package/dist/StringUtils.d.ts.map +0 -1
  184. package/dist/StringUtils.js +0 -11
  185. package/dist/StringUtils.js.map +0 -1
  186. package/dist/core/aiFlowSupervisor.d.ts +0 -44
  187. package/dist/core/aiFlowSupervisor.d.ts.map +0 -1
  188. package/dist/core/aiFlowSupervisor.js +0 -299
  189. package/dist/core/aiFlowSupervisor.js.map +0 -1
  190. package/dist/core/cliTestHarness.d.ts +0 -200
  191. package/dist/core/cliTestHarness.d.ts.map +0 -1
  192. package/dist/core/cliTestHarness.js +0 -549
  193. package/dist/core/cliTestHarness.js.map +0 -1
  194. package/dist/core/testUtils.d.ts +0 -121
  195. package/dist/core/testUtils.d.ts.map +0 -1
  196. package/dist/core/testUtils.js +0 -235
  197. package/dist/core/testUtils.js.map +0 -1
  198. package/dist/core/toolValidation.d.ts +0 -116
  199. package/dist/core/toolValidation.d.ts.map +0 -1
  200. package/dist/core/toolValidation.js +0 -282
  201. package/dist/core/toolValidation.js.map +0 -1
  202. package/dist/ui/planOverlay.d.ts +0 -28
  203. package/dist/ui/planOverlay.d.ts.map +0 -1
  204. package/dist/ui/planOverlay.js +0 -156
  205. package/dist/ui/planOverlay.js.map +0 -1
  206. package/dist/ui/streamingFormatter.d.ts +0 -30
  207. package/dist/ui/streamingFormatter.d.ts.map +0 -1
  208. package/dist/ui/streamingFormatter.js +0 -91
  209. package/dist/ui/streamingFormatter.js.map +0 -1
  210. package/dist/utils/errorUtils.d.ts +0 -16
  211. package/dist/utils/errorUtils.d.ts.map +0 -1
  212. package/dist/utils/errorUtils.js +0 -66
  213. package/dist/utils/errorUtils.js.map +0 -1
package/README.md CHANGED
@@ -4,7 +4,7 @@ Unified command-line agent with a single, persistent chat box pinned to the bott
4
4
 
5
5
  ## Highlights
6
6
  - One chat box, always on the bottom during the entire session (idle or streaming).
7
- - Shared control bar for status, verify/build toggle, auto-continue, and context gauge.
7
+ - Shared control bar for status, verification/build toggles, and context gauge.
8
8
  - Works with OpenAI, Anthropic, Google, xAI, DeepSeek, and local Ollama using the same UI contract.
9
9
  - Multi-agent Task tool with built-in general-purpose, explore (read-only), and plan subagents; add custom agents from `.claude/agents`, `~/.claude/agents`, or `--agents` JSON.
10
10
 
@@ -7,8 +7,8 @@
7
7
  "description": "Lean, aggressive coding agent. Act first, ask only when blocked.",
8
8
  "globalPrinciples": [
9
9
  {
10
- "id": "core.act",
11
- "summary": "ACT by default. Execute tools immediately. Only ask if genuinely blocked or request is unsafe.",
10
+ "id": "core.act_first",
11
+ "summary": "Every response MUST include tool calls. Brief explanation is optional. Text-only responses are not allowed during investigation.",
12
12
  "severity": "critical"
13
13
  },
14
14
  {
@@ -8,9 +8,9 @@
8
8
  "globalPrinciples": [
9
9
  {
10
10
  "id": "guardrail.clarify_ambiguous",
11
- "summary": "CRITICAL: If user request is vague, single-word, or ambiguous (e.g., 'typing', 'fix it', 'help'), ASK for clarification FIRST. Do NOT explore or guess.",
12
- "detail": "Respond with: 'Could you clarify what you mean by [X]? For example: [option A], [option B], or [option C]?' Only proceed after clarification.",
13
- "severity": "critical"
11
+ "summary": "Only ask for clarification when the request is truly uninterpretable (single words like 'typing' with no context). For requests with reasonable interpretations (like 'find junk code'), act on the most likely interpretation first.",
12
+ "detail": "If a request could mean multiple things but has a reasonable default interpretation, take action. Only ask when you genuinely cannot determine what the user wants. 'Got any junk code to remove?' search for unused code. 'Fix it' → if context exists, fix it; if not, ask what to fix.",
13
+ "severity": "recommended"
14
14
  },
15
15
  {
16
16
  "id": "guardrail.concise_responses",
@@ -42,11 +42,29 @@
42
42
  "detail": "Keep tool usage auditable by narrating the intent before running them and summarizing their output afterward.",
43
43
  "severity": "required"
44
44
  },
45
+ {
46
+ "id": "guardrail.bias_to_action",
47
+ "summary": "CRITICAL: Act first, ask later. When the user makes a request, immediately use tools to investigate and accomplish it. NEVER ask clarifying questions when you can take reasonable action instead.",
48
+ "detail": "For 'find junk code' or 'cleanup': 1) search_files for 'TODO|FIXME|HACK|XXX', 2) grep for unused exports 'export.*(?!.*import)', 3) find empty/stub files, 4) look for commented-out code blocks. For 'fix bug' or 'debug': 1) search for error messages, 2) trace the code path, 3) read relevant files, 4) propose a fix. NEVER respond with just 'What would you like me to do?' when you can investigate.",
49
+ "severity": "critical"
50
+ },
45
51
  {
46
52
  "id": "guardrail.continuous_execution",
47
53
  "summary": "CRITICAL: Continue using tools until the task is complete. Do NOT stop after reading files—immediately proceed to make the requested edits. Do NOT describe what you WILL do—just DO it by calling the appropriate tools. After each tool call, continue with the next step until the task is fully accomplished.",
48
54
  "severity": "critical"
49
55
  },
56
+ {
57
+ "id": "guardrail.smart_narration",
58
+ "summary": "CRITICAL: Narrate meaningfully. Share key insights and discoveries, not mechanical step descriptions. Say what you FOUND, not what you're DOING.",
59
+ "detail": "Good: 'Found the bug: processInput clears suggestions before Enter is handled (line 234)'. Bad: 'Let me trace processInput... Let me check the suggestions... I see it now, let me look at...'. For complex debugging, provide progress updates on discoveries, not tool invocations.",
60
+ "severity": "critical"
61
+ },
62
+ {
63
+ "id": "guardrail.deep_investigation",
64
+ "summary": "For ANY exploratory request, perform thorough multi-step investigation using 5-10+ tool calls. Do NOT stop after 2 tools.",
65
+ "detail": "When exploring: 1) list_files to get overview, 2) search_files for patterns, 3) read_file on suspicious files, 4) grep for related patterns, 5) check imports/exports, 6) look for test files, 7) check for duplicates. Report findings as you discover them. A proper investigation uses MANY tools, not just 1-2.",
66
+ "severity": "critical"
67
+ },
50
68
  {
51
69
  "id": "guardrail.manual_loop_supervision",
52
70
  "summary": "Humans supervise the loop manually—escalate when you lack evidence or stall.",
@@ -95,7 +95,7 @@ Examples:
95
95
  const input = await display.captureUserInput({ trim: true, resetBuffer: true });
96
96
  return input.trim();
97
97
  };
98
- // Display the question and options inside the chat overlay (no scrollback printing)
98
+ // Display the question and options inline (no extra scrollback noise)
99
99
  const { lines, displayOptions } = formatAskUserPrompt(question, { maxOptions: MAX_ASK_USER_OPTIONS });
100
100
  display.showInlinePanel(lines);
101
101
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"askUserCapability.js","sourceRoot":"","sources":["../../src/capabilities/askUserCapability.ts"],"names":[],"mappings":"AACA,OAAO,EACL,mBAAmB,EACnB,oBAAoB,GAGrB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AASvC,MAAM,OAAO,iBAAiB;IAC5B,EAAE,GAAG,qBAAqB,CAAC;IAC3B,WAAW,GAAG,0CAA0C,CAAC;IAEzD,KAAK,CAAC,MAAM,CAAC,QAA2B;QACtC,OAAO;YACL,EAAE,EAAE,gBAAgB;YACpB,WAAW,EAAE,qCAAqC;YAClD,SAAS,EAAE;gBACT,EAAE,EAAE,UAAU;gBACd,KAAK,EAAE;oBACL;wBACE,IAAI,EAAE,mBAAmB;wBACzB,WAAW,EAAE;;;;;;;;;;;uEAW8C;wBAC3D,UAAU,EAAE;4BACV,IAAI,EAAE,QAAQ;4BACd,UAAU,EAAE;gCACV,SAAS,EAAE;oCACT,IAAI,EAAE,OAAO;oCACb,WAAW,EAAE,2CAA2C;oCACxD,KAAK,EAAE;wCACL,IAAI,EAAE,QAAQ;wCACd,UAAU,EAAE;4CACV,QAAQ,EAAE;gDACR,IAAI,EAAE,QAAQ;gDACd,WAAW,EAAE,gEAAgE;6CAC9E;4CACD,MAAM,EAAE;gDACN,IAAI,EAAE,QAAQ;gDACd,WAAW,EAAE,iFAAiF;6CAC/F;4CACD,OAAO,EAAE;gDACP,IAAI,EAAE,OAAO;gDACb,WAAW,EAAE,iCAAiC;gDAC9C,QAAQ,EAAE,CAAC;gDACX,QAAQ,EAAE,oBAAoB;gDAC9B,KAAK,EAAE;oDACL,IAAI,EAAE,QAAQ;oDACd,UAAU,EAAE;wDACV,KAAK,EAAE;4DACL,IAAI,EAAE,QAAQ;4DACd,WAAW,EAAE,0BAA0B;yDACxC;wDACD,WAAW,EAAE;4DACX,IAAI,EAAE,QAAQ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E,CAAC;gBAC9E,OAAO,cAAc,CAAC,MAAM,GAAG,CAAC,CAAE,CAAC,KAAK,CAAC;YAC3C,CAAC;YAED,OAAO,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QACnE,CAAC;gBAAS,CAAC;YACT,OAAO,CAAC,gBAAgB,EAAE,CAAC;QAC7B,CAAC;IACH,CAAC;CACF"}
@@ -30,8 +30,8 @@ export function createStatusCapability(statusTracker) {
30
30
  tools: [
31
31
  {
32
32
  name: 'set_status',
33
- description: 'Update the live status bar with a short, present-tense note about what you are doing. ' +
34
- 'Use an empty message to clear it.',
33
+ description: 'RARELY NEEDED. Only use for long-running operations. Do NOT use to narrate what you plan to do. ' +
34
+ 'Call actual tools (list_files, read_file, search_files) instead of setting status.',
35
35
  parameters: {
36
36
  type: 'object',
37
37
  properties: {
@@ -1 +1 @@
1
- {"version":3,"file":"statusCapability.js","sourceRoot":"","sources":["../../src/capabilities/statusCapability.ts"],"names":[],"mappings":"AAUA,MAAM,UAAU,sBAAsB,CAAC,aAAgC;IACrE,MAAM,UAAU,GAAG,cAAc,CAAC;IAClC,MAAM,MAAM,GAAG,IAAI,GAAG,EAA0B,CAAC;IAEjD,MAAM,UAAU,GAAG,CAAC,EAAU,EAAQ,EAAE;QACtC,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChC,IAAI,QAAQ,EAAE,CAAC;YACb,YAAY,CAAC,QAAQ,CAAC,CAAC;YACvB,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACpB,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,aAAa,GAAG,CAAC,KAAc,EAA8B,EAAE;QACnE,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,OAAO,SAAS,CAAC;QAChD,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC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M,EAAE,IAAI,EAAE,CAAC,CAAC;gCAElE,IAAI,GAAG,EAAE,CAAC;oCACR,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;wCAC5B,aAAa,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;wCACxC,UAAU,CAAC,UAAU,CAAC,CAAC;oCACzB,CAAC,EAAE,GAAG,CAAC,CAAC;oCACR,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;gCAChC,CAAC;gCAED,OAAO,eAAe,OAAO,EAAE,CAAC;4BAClC,CAAC;yBACF;qBACF;iBACF;gBACD,OAAO;oBACL,UAAU,CAAC,UAAU,CAAC,CAAC;oBACvB,aAAa,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;gBAC1C,CAAC;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { CapabilityContribution, CapabilityContext, CapabilityModule } from '../../runtime/agentHost.js';
2
+ export declare class CodexCoreCapabilityModule implements CapabilityModule {
3
+ readonly id = "capability.codex.core";
4
+ create(context: CapabilityContext): Promise<CapabilityContribution>;
5
+ }
6
+ //# sourceMappingURL=codexCoreCapability.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codexCoreCapability.d.ts","sourceRoot":"","sources":["../../../src/codex/capabilities/codexCoreCapability.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAmB9G,qBAAa,yBAA0B,YAAW,gBAAgB;IAChE,QAAQ,CAAC,EAAE,2BAA2B;IAEhC,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,sBAAsB,CAAC;CAiB1E"}
@@ -0,0 +1,516 @@
1
+ import { promisify } from 'node:util';
2
+ import { exec as execCallback, spawn } from 'node:child_process';
3
+ import { readFile } from 'node:fs/promises';
4
+ import path from 'node:path';
5
+ import { resolveCodexContext } from '../types.js';
6
+ import { resolveWorkingPath, isPathInside } from '../fs.js';
7
+ import { updatePlan } from '../persistence/planStore.js';
8
+ import { loadMcpServers } from '../../mcp/config.js';
9
+ import { McpStdioClient } from '../../mcp/stdioClient.js';
10
+ import { McpSseClient } from '../../mcp/sseClient.js';
11
+ import { formatContentBlock } from '../../mcp/toolBridge.js';
12
+ const exec = promisify(execCallback);
13
+ export class CodexCoreCapabilityModule {
14
+ id = 'capability.codex.core';
15
+ async create(context) {
16
+ const codexContext = resolveCodexContext(context.env, context.workingDir);
17
+ return {
18
+ id: 'codex.core',
19
+ description: 'Codex-compatible core tools (shell_command, apply_patch, update_plan, MCP helpers, view_image).',
20
+ toolSuite: {
21
+ id: 'codex-core',
22
+ description: 'Codex CLI core tools',
23
+ tools: createCodexTools(codexContext),
24
+ },
25
+ metadata: {
26
+ sandboxMode: codexContext.sandboxMode,
27
+ networkAccess: codexContext.networkAccess,
28
+ approvalPolicy: codexContext.approvalPolicy,
29
+ },
30
+ };
31
+ }
32
+ }
33
+ function createCodexTools(context) {
34
+ return [
35
+ {
36
+ name: 'shell_command',
37
+ description: 'Execute a shell command within the workspace. Respects sandbox restrictions and enforces workspace scoping.',
38
+ parameters: {
39
+ type: 'object',
40
+ properties: {
41
+ command: { type: 'string' },
42
+ workdir: { type: 'string', description: 'Optional working directory relative to workspace.' },
43
+ timeout_ms: { type: 'number', description: 'Optional timeout in milliseconds.' },
44
+ with_escalated_permissions: { type: 'boolean' },
45
+ justification: { type: 'string' },
46
+ },
47
+ required: ['command'],
48
+ },
49
+ handler: async (args) => runShellCommand(context, args),
50
+ },
51
+ {
52
+ name: 'apply_patch',
53
+ description: 'Apply a unified diff patch within the workspace (guarded).',
54
+ parameters: {
55
+ type: 'object',
56
+ properties: {
57
+ patch: { type: 'string' },
58
+ workdir: { type: 'string', description: 'Optional working directory relative to workspace.' },
59
+ },
60
+ required: ['patch'],
61
+ },
62
+ handler: async (args) => applyPatch(context, args),
63
+ },
64
+ {
65
+ name: 'update_plan',
66
+ description: 'Persist plan steps with Codex semantics (one in_progress at a time).',
67
+ parameters: {
68
+ type: 'object',
69
+ properties: {
70
+ explanation: { type: 'string' },
71
+ plan: {
72
+ type: 'array',
73
+ items: {
74
+ type: 'object',
75
+ required: ['step', 'status'],
76
+ properties: {
77
+ step: { type: 'string' },
78
+ status: { type: 'string', enum: ['pending', 'in_progress', 'completed'] },
79
+ },
80
+ },
81
+ },
82
+ },
83
+ required: ['plan'],
84
+ },
85
+ handler: async (args) => updatePlanState(context, args),
86
+ },
87
+ {
88
+ name: 'list_mcp_resources',
89
+ description: 'List resources exposed by configured MCP servers.',
90
+ parameters: {
91
+ type: 'object',
92
+ properties: {},
93
+ },
94
+ handler: async () => listMcpResources(context),
95
+ },
96
+ {
97
+ name: 'read_mcp_resource',
98
+ description: 'Read a resource from an MCP server and return its content.',
99
+ parameters: {
100
+ type: 'object',
101
+ properties: {
102
+ server: { type: 'string' },
103
+ uri: { type: 'string' },
104
+ },
105
+ required: ['server', 'uri'],
106
+ },
107
+ handler: async (args) => readMcpResource(context, args),
108
+ },
109
+ {
110
+ name: 'list_mcp_resource_templates',
111
+ description: 'List MCP resource templates from configured servers.',
112
+ parameters: {
113
+ type: 'object',
114
+ properties: {},
115
+ },
116
+ handler: async () => listMcpResourceTemplates(context),
117
+ },
118
+ {
119
+ name: 'view_image',
120
+ description: 'Load an image from disk and return base64 metadata for display.',
121
+ parameters: {
122
+ type: 'object',
123
+ properties: {
124
+ path: { type: 'string' },
125
+ },
126
+ required: ['path'],
127
+ },
128
+ handler: async (args) => viewImage(context, args),
129
+ },
130
+ ];
131
+ }
132
+ async function runShellCommand(context, args) {
133
+ const command = typeof args['command'] === 'string' ? args['command'].trim() : '';
134
+ if (!command) {
135
+ return 'Error: command must be a non-empty string.';
136
+ }
137
+ const escalationRequested = args['with_escalated_permissions'] === true;
138
+ if (escalationRequested && (context.approvalPolicy === 'never' || context.approvalPolicy === 'untrusted')) {
139
+ return `Blocked: escalated permissions are disabled by approval policy (${context.approvalPolicy}).`;
140
+ }
141
+ const escalationNotice = escalationRequested && context.approvalPolicy !== 'on-failure'
142
+ ? `Note: escalation requested but running under "${context.approvalPolicy}" policy within current sandbox.`
143
+ : null;
144
+ // Basic sandbox guardrail: prevent escape from workspace
145
+ const cwd = resolveSafeCwd(context, args['workdir']);
146
+ if (context.sandboxMode === 'read-only' && isPotentiallyMutating(command)) {
147
+ return 'Blocked: sandbox is read-only.';
148
+ }
149
+ // Optional: respect restricted network flag (best-effort, advisory)
150
+ if (context.networkAccess === 'restricted' && isNetworkCommand(command)) {
151
+ return 'Blocked: network access is restricted in this sandbox.';
152
+ }
153
+ try {
154
+ const timeout = typeof args['timeout_ms'] === 'number' ? Math.max(1, Math.floor(args['timeout_ms'])) : undefined;
155
+ const { stdout, stderr } = await exec(command, { cwd, timeout });
156
+ if (stderr && stderr.trim()) {
157
+ const payload = [stdout.trim(), stderr.trim()].filter(Boolean).join('\n');
158
+ return escalationNotice ? [escalationNotice, payload].filter(Boolean).join('\n') : payload;
159
+ }
160
+ const payload = stdout.trim();
161
+ return escalationNotice ? [escalationNotice, payload].filter(Boolean).join('\n') : payload;
162
+ }
163
+ catch (error) {
164
+ const err = error;
165
+ const stderr = typeof err?.stderr === 'string' ? err.stderr.trim() : '';
166
+ const stdout = typeof err?.stdout === 'string' ? err.stdout.trim() : '';
167
+ const message = err?.message ? String(err.message) : 'Shell command failed.';
168
+ const payload = [stdout, stderr, message].filter(Boolean).join('\n');
169
+ return escalationNotice ? [escalationNotice, payload].filter(Boolean).join('\n') : payload;
170
+ }
171
+ }
172
+ async function applyPatch(context, args) {
173
+ const patch = typeof args['patch'] === 'string' ? args['patch'] : '';
174
+ if (!patch.trim()) {
175
+ return 'Error: patch must be a non-empty string.';
176
+ }
177
+ if (context.sandboxMode === 'read-only') {
178
+ return 'Blocked: sandbox is read-only.';
179
+ }
180
+ const cwd = resolveSafeCwd(context, args['workdir']);
181
+ const violations = findPatchViolations(context.workingDir, patch);
182
+ if (violations.length) {
183
+ return `Rejected patch: paths escape workspace:\n${violations.join('\n')}`;
184
+ }
185
+ try {
186
+ const output = await applyPatchWithBinary(patch, cwd);
187
+ return output;
188
+ }
189
+ catch (error) {
190
+ const message = error instanceof Error ? error.message : String(error);
191
+ return `Failed to apply patch: ${message}`;
192
+ }
193
+ }
194
+ async function applyPatchWithBinary(patch, cwd) {
195
+ return new Promise((resolve, reject) => {
196
+ const child = spawn('patch', ['-p0', '-u', '-N', '--binary'], { cwd });
197
+ let stdout = '';
198
+ let stderr = '';
199
+ child.stdout.on('data', (data) => {
200
+ stdout += data.toString();
201
+ });
202
+ child.stderr.on('data', (data) => {
203
+ stderr += data.toString();
204
+ });
205
+ child.on('error', (error) => {
206
+ reject(error);
207
+ });
208
+ child.on('close', (code) => {
209
+ if (code === 0) {
210
+ resolve([stdout.trim(), stderr.trim()].filter(Boolean).join('\n') || 'Patch applied.');
211
+ return;
212
+ }
213
+ reject(new Error(stderr.trim() || `patch exited with code ${code}`));
214
+ });
215
+ child.stdin.write(patch);
216
+ child.stdin.end();
217
+ });
218
+ }
219
+ async function updatePlanState(context, args) {
220
+ const explanation = typeof args['explanation'] === 'string' ? args['explanation'] : undefined;
221
+ const planArg = Array.isArray(args['plan']) ? args['plan'] : [];
222
+ const nextPlan = planArg
223
+ .map((entry) => ({
224
+ step: typeof entry?.step === 'string' ? entry.step : '',
225
+ status: entry?.status,
226
+ }))
227
+ .filter((entry) => Boolean(entry.step));
228
+ const state = await updatePlan(context.workingDir, { plan: nextPlan, explanation });
229
+ return formatPlan(state);
230
+ }
231
+ async function listMcpResources(context) {
232
+ const servers = await loadMcpServers({ workingDir: context.workingDir, env: context.env });
233
+ if (!servers.length) {
234
+ return 'No MCP servers configured.';
235
+ }
236
+ const records = [];
237
+ for (const server of servers) {
238
+ const client = createMcpClient(server, context.workingDir);
239
+ try {
240
+ const resources = await client.listResources();
241
+ records.push({
242
+ server: server.id,
243
+ type: server.type,
244
+ description: server.description,
245
+ location: server.type === 'sse' ? server.url : server.command,
246
+ resources,
247
+ });
248
+ }
249
+ catch (error) {
250
+ records.push({
251
+ server: server.id,
252
+ type: server.type,
253
+ description: server.description,
254
+ location: server.type === 'sse' ? server.url : server.command,
255
+ error: formatMcpError(error),
256
+ });
257
+ }
258
+ finally {
259
+ await client.dispose();
260
+ }
261
+ }
262
+ return JSON.stringify(records, null, 2);
263
+ }
264
+ async function readMcpResource(context, args) {
265
+ const serverId = typeof args['server'] === 'string' ? args['server'].trim() : '';
266
+ const uri = typeof args['uri'] === 'string' ? args['uri'].trim() : '';
267
+ if (!serverId || !uri) {
268
+ return 'Error: server and uri are required.';
269
+ }
270
+ const server = await findMcpServer(context, serverId);
271
+ if (!server) {
272
+ return `Server "${serverId}" is not configured.`;
273
+ }
274
+ const client = createMcpClient(server, context.workingDir);
275
+ try {
276
+ const result = await client.readResource(uri);
277
+ const blocks = normalizeContentBlocks(result);
278
+ const formatted = blocks
279
+ .map((block) => formatContentBlock(block))
280
+ .filter((line) => Boolean(line?.trim()));
281
+ const lines = [];
282
+ lines.push(`Server: ${serverId}`);
283
+ const label = result.resource?.name || result.resource?.uri;
284
+ lines.push(`Resource: ${label && label !== uri ? `${uri} (${label})` : uri}`);
285
+ if (result.resource?.mimeType) {
286
+ lines.push(`MIME: ${result.resource.mimeType}`);
287
+ }
288
+ if (result.resource?.description) {
289
+ lines.push(result.resource.description);
290
+ }
291
+ if (formatted.length) {
292
+ lines.push('', ...formatted);
293
+ }
294
+ else {
295
+ lines.push('No content returned for this resource.');
296
+ }
297
+ return lines.join('\n');
298
+ }
299
+ catch (error) {
300
+ return `Failed to read ${serverId}:${uri}: ${formatMcpError(error)}`;
301
+ }
302
+ finally {
303
+ await client.dispose();
304
+ }
305
+ }
306
+ async function listMcpResourceTemplates(context) {
307
+ const servers = await loadMcpServers({ workingDir: context.workingDir, env: context.env });
308
+ if (!servers.length) {
309
+ return 'No MCP servers configured.';
310
+ }
311
+ const records = [];
312
+ for (const server of servers) {
313
+ const client = createMcpClient(server, context.workingDir);
314
+ try {
315
+ const templates = await client.listResourceTemplates();
316
+ records.push({
317
+ server: server.id,
318
+ type: server.type,
319
+ description: server.description,
320
+ location: server.type === 'sse' ? server.url : server.command,
321
+ templates,
322
+ });
323
+ }
324
+ catch (error) {
325
+ records.push({
326
+ server: server.id,
327
+ type: server.type,
328
+ description: server.description,
329
+ location: server.type === 'sse' ? server.url : server.command,
330
+ error: formatMcpError(error),
331
+ });
332
+ }
333
+ finally {
334
+ await client.dispose();
335
+ }
336
+ }
337
+ return JSON.stringify(records, null, 2);
338
+ }
339
+ function createMcpClient(config, workingDir) {
340
+ return config.type === 'sse' ? new McpSseClient(config) : new McpStdioClient(config, workingDir);
341
+ }
342
+ async function findMcpServer(context, id) {
343
+ const servers = await loadMcpServers({ workingDir: context.workingDir, env: context.env });
344
+ return servers.find((server) => server.id === id) ?? null;
345
+ }
346
+ function normalizeContentBlocks(result) {
347
+ if (!result) {
348
+ return [];
349
+ }
350
+ if (Array.isArray(result.content)) {
351
+ return result.content;
352
+ }
353
+ if (Array.isArray(result.contents)) {
354
+ return result.contents;
355
+ }
356
+ return [];
357
+ }
358
+ function formatMcpError(error) {
359
+ if (error instanceof Error) {
360
+ return error.message;
361
+ }
362
+ return String(error);
363
+ }
364
+ async function viewImage(context, args) {
365
+ const targetPath = typeof args['path'] === 'string' ? args['path'] : '';
366
+ if (!targetPath.trim()) {
367
+ return 'Error: path is required.';
368
+ }
369
+ const resolved = resolveWorkingPath(context.workingDir, targetPath);
370
+ try {
371
+ const data = await readFile(resolved);
372
+ const size = data.byteLength;
373
+ if (size > 1024 * 1024) {
374
+ return `Image too large to inline (${size} bytes). Path: ${resolved}`;
375
+ }
376
+ const base64 = data.toString('base64');
377
+ const ext = path.extname(resolved).replace(/^\./, '') || 'octet-stream';
378
+ return JSON.stringify({ path: resolved, size, encoding: 'base64', mediaType: `image/${ext}`, data: base64 }, null, 2);
379
+ }
380
+ catch (error) {
381
+ const message = error instanceof Error ? error.message : String(error);
382
+ return `Failed to read image: ${message}`;
383
+ }
384
+ }
385
+ function resolveSafeCwd(context, workdir) {
386
+ const base = context.workingDir;
387
+ const cwd = resolveWorkingPath(base, typeof workdir === 'string' ? workdir : undefined);
388
+ if (context.sandboxMode === 'read-only') {
389
+ return base;
390
+ }
391
+ return cwd;
392
+ }
393
+ function findPatchViolations(baseDir, patch) {
394
+ const violations = [];
395
+ const lines = patch.split('\n');
396
+ const paths = new Set();
397
+ for (const line of lines) {
398
+ const diffMatch = line.match(/^diff --git a\/(\S+) b\/(\S+)/);
399
+ if (diffMatch && diffMatch[1] && diffMatch[2]) {
400
+ paths.add(diffMatch[1]);
401
+ paths.add(diffMatch[2]);
402
+ continue;
403
+ }
404
+ const plusMatch = line.match(/^\+\+\+ ([^\t]+)/);
405
+ if (plusMatch && plusMatch[1]) {
406
+ paths.add(plusMatch[1]);
407
+ continue;
408
+ }
409
+ const minusMatch = line.match(/^\-\-\- ([^\t]+)/);
410
+ if (minusMatch && minusMatch[1]) {
411
+ paths.add(minusMatch[1]);
412
+ }
413
+ }
414
+ for (const candidate of paths) {
415
+ if (candidate === '/dev/null') {
416
+ continue;
417
+ }
418
+ const cleaned = candidate.replace(/^[ab]\//, '');
419
+ const resolved = path.resolve(baseDir, cleaned);
420
+ if (!isPathInside(baseDir, resolved)) {
421
+ violations.push(`${candidate} -> ${resolved}`);
422
+ }
423
+ }
424
+ return violations;
425
+ }
426
+ function isPotentiallyMutating(command) {
427
+ const normalized = command.toLowerCase();
428
+ if (/>|>>/.test(command)) {
429
+ return true;
430
+ }
431
+ if (/\bsudo\b/.test(normalized)) {
432
+ return true;
433
+ }
434
+ const directMutators = [
435
+ 'rm',
436
+ 'rmdir',
437
+ 'mv',
438
+ 'cp',
439
+ 'ln',
440
+ 'mkdir',
441
+ 'touch',
442
+ 'chmod',
443
+ 'chown',
444
+ 'truncate',
445
+ 'dd',
446
+ 'mkfs',
447
+ 'mount',
448
+ 'umount',
449
+ 'tee',
450
+ 'docker',
451
+ 'kubectl',
452
+ 'helm',
453
+ ];
454
+ for (const token of directMutators) {
455
+ const pattern = new RegExp(`\\b${token}\\b`);
456
+ if (pattern.test(normalized)) {
457
+ return true;
458
+ }
459
+ }
460
+ const packageManagers = /\b(npm|yarn|pnpm|pip|pip3|brew|apt(-get)?|yum|dnf|pacman|apk|cargo|go\s+install|go\s+get|bundle|gem|composer|dotnet|nuget|conda|mamba)\b/;
461
+ if (packageManagers.test(normalized)) {
462
+ return true;
463
+ }
464
+ if (/\bsed\b[^\n]*\s-i\b/.test(normalized) || /\bperl\b[^\n]*\s-i\b/.test(normalized)) {
465
+ return true;
466
+ }
467
+ const gitMutations = /\bgit\s+(commit|push|pull|merge|rebase|reset|checkout|clean|apply|am|cherry-pick|fetch|clone|init|switch)\b/;
468
+ if (gitMutations.test(normalized)) {
469
+ return true;
470
+ }
471
+ return false;
472
+ }
473
+ function isNetworkCommand(command) {
474
+ const normalized = command.toLowerCase();
475
+ const checks = [
476
+ /\bcurl\b/i,
477
+ /\bwget\b/i,
478
+ /\bhttp(s)?:\/\//i,
479
+ /\bgit\s+(clone|fetch|pull)\b/i,
480
+ /\bssh\b(?!-keygen)/i,
481
+ /\bscp\b/i,
482
+ /\bsftp\b/i,
483
+ /\bftp\b/i,
484
+ /\brsync\b/i,
485
+ /\bnc\b\s+/i,
486
+ /\bdocker\s+(pull|run|build)\b/i,
487
+ ];
488
+ if (checks.some((pattern) => pattern.test(command))) {
489
+ return true;
490
+ }
491
+ const packageNetwork = [
492
+ /\b(npm|yarn|pnpm)\s+(install|add|update|upgrade|ci|publish|link)\b/i,
493
+ /\b(pip|pip3)\s+(install|download)\b/i,
494
+ /\bcargo\b\s+(install|update)\b/i,
495
+ /\bgo\s+(get|install)\b/i,
496
+ /\bbundle\b\s+install\b/i,
497
+ /\bgem\b\s+(install|update)\b/i,
498
+ /\bcomposer\b\s+(install|update|require)\b/i,
499
+ /\b(brew|apt-get|apt|yum|dnf|pacman|apk)\b/i,
500
+ /\b(conda|mamba)\b\s+(install|update|create)\b/i,
501
+ ];
502
+ if (packageNetwork.some((pattern) => pattern.test(normalized))) {
503
+ return true;
504
+ }
505
+ return false;
506
+ }
507
+ function formatPlan(state) {
508
+ const header = state.explanation ? `${state.explanation.trim()}\n\n` : '';
509
+ const body = state.plan.length === 0
510
+ ? 'Plan is empty.'
511
+ : state.plan
512
+ .map((item, index) => `${index + 1}. [${item.status}] ${item.step}`)
513
+ .join('\n');
514
+ return `${header}${body}`;
515
+ }
516
+ //# sourceMappingURL=codexCoreCapability.js.map