@phuetz/code-buddy 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (312) hide show
  1. package/README.md +160 -164
  2. package/dist/agent/autonomous/agentic-coding-contract.d.ts +6 -6
  3. package/dist/agent/codebuddy-agent.d.ts +1 -1
  4. package/dist/agent/codebuddy-agent.js +101 -13
  5. package/dist/agent/execution/agent-executor.js +122 -12
  6. package/dist/agent/execution/tool-dependency-graph.js +7 -0
  7. package/dist/agent/execution/tool-hooks.d.ts +6 -0
  8. package/dist/agent/execution/tool-hooks.js +13 -5
  9. package/dist/agent/execution/tool-selection-strategy.d.ts +11 -2
  10. package/dist/agent/execution/tool-selection-strategy.js +67 -10
  11. package/dist/agent/extended-thinking.d.ts +8 -0
  12. package/dist/agent/extended-thinking.js +27 -0
  13. package/dist/agent/hermes-browser-backends.js +151 -11
  14. package/dist/agent/hermes-claw-migrate.d.ts +59 -0
  15. package/dist/agent/hermes-claw-migrate.js +427 -26
  16. package/dist/agent/hermes-parity-manifest.js +78 -71
  17. package/dist/agent/hermes-runtime-lifecycle.d.ts +67 -0
  18. package/dist/agent/hermes-runtime-lifecycle.js +468 -0
  19. package/dist/agent/lesson-auto-proposer.js +10 -0
  20. package/dist/agent/middleware/index.d.ts +1 -0
  21. package/dist/agent/middleware/index.js +1 -0
  22. package/dist/agent/middleware/session-duration.d.ts +36 -0
  23. package/dist/agent/middleware/session-duration.js +78 -0
  24. package/dist/agent/middleware/visual-validation-middleware.d.ts +17 -0
  25. package/dist/agent/middleware/visual-validation-middleware.js +67 -0
  26. package/dist/agent/model-benchmark.d.ts +77 -0
  27. package/dist/agent/model-benchmark.js +309 -0
  28. package/dist/agent/model-tier.d.ts +14 -0
  29. package/dist/agent/model-tier.js +71 -0
  30. package/dist/agent/multi-agent/agents/orchestrator-agent.js +17 -6
  31. package/dist/agent/multi-agent/multi-agent-system.js +3 -1
  32. package/dist/agent/multi-agent/session-fleet-bridge.d.ts +2 -0
  33. package/dist/agent/multi-agent/session-fleet-bridge.js +9 -1
  34. package/dist/agent/multi-agent/session-tools.js +22 -5
  35. package/dist/agent/reasoning/mcts.js +20 -6
  36. package/dist/agent/session-end-flush.d.ts +71 -0
  37. package/dist/agent/session-end-flush.js +233 -0
  38. package/dist/agent/streaming/streaming-handler.d.ts +7 -0
  39. package/dist/agent/streaming/streaming-handler.js +8 -1
  40. package/dist/agent/tool-executor.js +1 -0
  41. package/dist/agent/tool-handler.d.ts +5 -0
  42. package/dist/agent/tool-handler.js +130 -4
  43. package/dist/browser-automation/browser-operator-executor.js +15 -0
  44. package/dist/browser-automation/browser-use-runner.d.ts +96 -0
  45. package/dist/browser-automation/browser-use-runner.js +492 -0
  46. package/dist/browser-automation/camofox-runner.d.ts +107 -0
  47. package/dist/browser-automation/camofox-runner.js +287 -0
  48. package/dist/channels/dingtalk/index.js +3 -0
  49. package/dist/channels/discord/client.d.ts +9 -0
  50. package/dist/channels/discord/client.js +12 -0
  51. package/dist/channels/feishu/index.d.ts +167 -1
  52. package/dist/channels/feishu/index.js +432 -7
  53. package/dist/channels/gateway-lifecycle.d.ts +132 -0
  54. package/dist/channels/gateway-lifecycle.js +219 -0
  55. package/dist/channels/google-chat/index.d.ts +5 -1
  56. package/dist/channels/google-chat/index.js +5 -1
  57. package/dist/channels/imessage/index.d.ts +14 -0
  58. package/dist/channels/imessage/index.js +64 -17
  59. package/dist/channels/index.d.ts +4 -0
  60. package/dist/channels/index.js +4 -0
  61. package/dist/channels/irc/index.d.ts +73 -3
  62. package/dist/channels/irc/index.js +446 -11
  63. package/dist/channels/line/index.js +3 -0
  64. package/dist/channels/mattermost/index.d.ts +51 -4
  65. package/dist/channels/mattermost/index.js +303 -20
  66. package/dist/channels/nextcloud-talk/index.d.ts +89 -8
  67. package/dist/channels/nextcloud-talk/index.js +367 -16
  68. package/dist/channels/nostr/index.d.ts +121 -1
  69. package/dist/channels/nostr/index.js +396 -8
  70. package/dist/channels/ntfy/index.js +3 -0
  71. package/dist/channels/qq/index.js +3 -0
  72. package/dist/channels/slash-parity.d.ts +117 -0
  73. package/dist/channels/slash-parity.js +185 -0
  74. package/dist/channels/synology-chat/index.js +3 -0
  75. package/dist/channels/teams/index.d.ts +3 -0
  76. package/dist/channels/teams/index.js +3 -0
  77. package/dist/channels/telegram/client.d.ts +9 -0
  78. package/dist/channels/telegram/client.js +12 -0
  79. package/dist/channels/twilio-voice/index.js +3 -0
  80. package/dist/channels/webchat/index.d.ts +7 -1
  81. package/dist/channels/webchat/index.js +7 -1
  82. package/dist/channels/wecom/index.js +3 -0
  83. package/dist/channels/weixin/index.js +3 -0
  84. package/dist/channels/zalo/index.js +3 -0
  85. package/dist/cli/config-loader.js +1 -1
  86. package/dist/codebuddy/client.d.ts +30 -1
  87. package/dist/codebuddy/client.js +167 -20
  88. package/dist/codebuddy/providers/provider-chatgpt-responses.d.ts +5 -0
  89. package/dist/codebuddy/providers/provider-chatgpt-responses.js +1 -0
  90. package/dist/codebuddy/providers/provider-gemini-native.js +1 -1
  91. package/dist/codebuddy/providers/provider-openai-compat.d.ts +5 -0
  92. package/dist/codebuddy/providers/provider-openai-compat.js +82 -2
  93. package/dist/codebuddy/tool-definitions/computer-control-tools.js +32 -2
  94. package/dist/codebuddy/tool-definitions/core-tools.js +3 -3
  95. package/dist/codebuddy/tool-definitions/index.d.ts +2 -1
  96. package/dist/codebuddy/tool-definitions/index.js +2 -1
  97. package/dist/codebuddy/tool-definitions/multimodal-tools.d.ts +1 -0
  98. package/dist/codebuddy/tool-definitions/multimodal-tools.js +44 -1
  99. package/dist/codebuddy/tool-definitions/windows-tools.d.ts +2 -0
  100. package/dist/codebuddy/tool-definitions/windows-tools.js +34 -0
  101. package/dist/codebuddy/tools.d.ts +1 -1
  102. package/dist/codebuddy/tools.js +27 -24
  103. package/dist/commands/cli/hermes-commands.js +108 -0
  104. package/dist/commands/cli/native-engine-commands.js +107 -3
  105. package/dist/commands/cli/utility-commands.js +45 -0
  106. package/dist/commands/enhanced-command-handler.js +5 -0
  107. package/dist/commands/goal-cli.d.ts +71 -0
  108. package/dist/commands/goal-cli.js +280 -0
  109. package/dist/commands/handlers/goal-handler.d.ts +34 -0
  110. package/dist/commands/handlers/goal-handler.js +155 -0
  111. package/dist/commands/handlers/index.d.ts +1 -0
  112. package/dist/commands/handlers/index.js +2 -0
  113. package/dist/commands/handlers/infra-handlers.js +36 -0
  114. package/dist/commands/handlers/memory-handlers.js +96 -1
  115. package/dist/commands/headless-slash.d.ts +2 -0
  116. package/dist/commands/headless-slash.js +12 -0
  117. package/dist/commands/llm-provider-resolution.d.ts +5 -3
  118. package/dist/commands/llm-provider-resolution.js +87 -33
  119. package/dist/commands/ollama.d.ts +25 -0
  120. package/dist/commands/ollama.js +100 -0
  121. package/dist/commands/provider.d.ts +5 -0
  122. package/dist/commands/provider.js +106 -55
  123. package/dist/commands/slash/builtin-commands.js +20 -0
  124. package/dist/commands/spec-next.js +2 -1
  125. package/dist/commands/spec-plan.js +5 -16
  126. package/dist/commands/tunnel.d.ts +2 -0
  127. package/dist/commands/tunnel.js +48 -0
  128. package/dist/config/config-resolver.d.ts +2 -1
  129. package/dist/config/config-resolver.js +54 -41
  130. package/dist/config/constants.d.ts +28 -0
  131. package/dist/config/constants.js +7 -0
  132. package/dist/config/env-schema.js +770 -0
  133. package/dist/config/feature-flags.js +7 -0
  134. package/dist/config/model-tools.js +4 -4
  135. package/dist/config/toml-config.d.ts +16 -0
  136. package/dist/config/toml-config.js +3 -0
  137. package/dist/context/context-manager-v2.d.ts +39 -0
  138. package/dist/context/context-manager-v2.js +91 -0
  139. package/dist/daemon/agent-task-executor.js +12 -1
  140. package/dist/daemon/autonomous-daemon.d.ts +1 -1
  141. package/dist/daemon/autonomous-daemon.js +5 -3
  142. package/dist/daemon/autonomous-loop.d.ts +21 -1
  143. package/dist/daemon/autonomous-loop.js +69 -0
  144. package/dist/daemon/colab-goal.d.ts +38 -0
  145. package/dist/daemon/colab-goal.js +81 -0
  146. package/dist/daemon/cron-agent-bridge.d.ts +12 -3
  147. package/dist/daemon/cron-agent-bridge.js +25 -9
  148. package/dist/desktop/codebuddy-engine-adapter.d.ts +32 -0
  149. package/dist/desktop/codebuddy-engine-adapter.js +257 -80
  150. package/dist/desktop/engine-adapter.d.ts +14 -0
  151. package/dist/desktop-automation/automation-manager.js +16 -0
  152. package/dist/desktop-automation/omniparser-runner.d.ts +63 -0
  153. package/dist/desktop-automation/omniparser-runner.js +115 -0
  154. package/dist/desktop-automation/smart-snapshot.d.ts +11 -0
  155. package/dist/desktop-automation/smart-snapshot.js +72 -5
  156. package/dist/doctor/index.js +40 -23
  157. package/dist/events/types.d.ts +11 -0
  158. package/dist/fleet/colab-store.d.ts +21 -0
  159. package/dist/fleet/colab-store.js +28 -0
  160. package/dist/fleet/peer-session-bridge.d.ts +1 -1
  161. package/dist/fleet/peer-session-bridge.js +243 -2
  162. package/dist/fleet/peer-session-store.d.ts +3 -0
  163. package/dist/fleet/peer-tool-bridge.js +14 -0
  164. package/dist/fleet/privacy-lint.d.ts +8 -0
  165. package/dist/fleet/privacy-lint.js +22 -0
  166. package/dist/goals/goal-decomposer.d.ts +27 -0
  167. package/dist/goals/goal-decomposer.js +293 -0
  168. package/dist/goals/goal-judge-client.d.ts +15 -0
  169. package/dist/goals/goal-judge-client.js +45 -0
  170. package/dist/goals/goal-judge.d.ts +38 -0
  171. package/dist/goals/goal-judge.js +158 -0
  172. package/dist/goals/goal-loop.d.ts +37 -0
  173. package/dist/goals/goal-loop.js +101 -0
  174. package/dist/goals/goal-manager.d.ts +77 -0
  175. package/dist/goals/goal-manager.js +289 -0
  176. package/dist/goals/goal-state.d.ts +99 -0
  177. package/dist/goals/goal-state.js +315 -0
  178. package/dist/goals/goal-store.d.ts +28 -0
  179. package/dist/goals/goal-store.js +87 -0
  180. package/dist/goals/index.d.ts +5 -0
  181. package/dist/goals/index.js +6 -0
  182. package/dist/hooks/use-input-handler.js +36 -1
  183. package/dist/hooks/user-hooks.js +17 -3
  184. package/dist/index.js +506 -25
  185. package/dist/input/text-to-speech.d.ts +2 -6
  186. package/dist/input/text-to-speech.js +2 -27
  187. package/dist/integrations/screenpipe/screenpipe-client.d.ts +10 -0
  188. package/dist/integrations/screenpipe/screenpipe-client.js +12 -2
  189. package/dist/integrations/tailscale.d.ts +13 -0
  190. package/dist/integrations/tailscale.js +87 -34
  191. package/dist/knowledge/workspace-indexer.js +53 -9
  192. package/dist/mcp/client.js +1 -0
  193. package/dist/mcp/mcp-desktop-tools.d.ts +23 -0
  194. package/dist/mcp/mcp-desktop-tools.js +158 -0
  195. package/dist/mcp/mcp-server.js +2 -0
  196. package/dist/memory/enhanced-memory.d.ts +10 -0
  197. package/dist/memory/enhanced-memory.js +33 -2
  198. package/dist/memory/index.d.ts +3 -1
  199. package/dist/memory/index.js +4 -1
  200. package/dist/memory/memory-auto-proposer.d.ts +23 -0
  201. package/dist/memory/memory-auto-proposer.js +308 -0
  202. package/dist/memory/memory-candidate-queue.d.ts +92 -0
  203. package/dist/memory/memory-candidate-queue.js +261 -0
  204. package/dist/memory/persistent-memory.d.ts +45 -2
  205. package/dist/memory/persistent-memory.js +236 -40
  206. package/dist/ml/bayesian-qualifier.d.ts +1 -1
  207. package/dist/ml/bayesian-qualifier.js +35 -2
  208. package/dist/observability/run-store.d.ts +1 -1
  209. package/dist/openclaw/gateway-bridge.js +5 -0
  210. package/dist/plugins/marketplace.d.ts +1 -0
  211. package/dist/plugins/marketplace.js +7 -0
  212. package/dist/prompts/execution-discipline.d.ts +14 -0
  213. package/dist/prompts/execution-discipline.js +29 -0
  214. package/dist/prompts/variation-injector.js +9 -2
  215. package/dist/protocols/acp/acp-agentic-runner.d.ts +7 -6
  216. package/dist/protocols/acp/acp-agentic-runner.js +115 -18
  217. package/dist/protocols/acp/acp-session-store.d.ts +23 -0
  218. package/dist/protocols/acp/acp-session-store.js +77 -0
  219. package/dist/protocols/acp/acp-stdio-server.d.ts +7 -0
  220. package/dist/protocols/acp/acp-stdio-server.js +71 -16
  221. package/dist/providers/active-llm-registry.d.ts +37 -0
  222. package/dist/providers/active-llm-registry.js +186 -0
  223. package/dist/providers/auxiliary-provider.d.ts +25 -0
  224. package/dist/providers/auxiliary-provider.js +192 -0
  225. package/dist/providers/codex-oauth.d.ts +1 -1
  226. package/dist/providers/codex-oauth.js +27 -4
  227. package/dist/providers/index.d.ts +3 -0
  228. package/dist/providers/index.js +4 -0
  229. package/dist/providers/provider-catalog.d.ts +70 -0
  230. package/dist/providers/provider-catalog.js +738 -0
  231. package/dist/providers/provider-fallback.d.ts +35 -0
  232. package/dist/providers/provider-fallback.js +171 -0
  233. package/dist/providers/xai-oauth.d.ts +128 -0
  234. package/dist/providers/xai-oauth.js +735 -0
  235. package/dist/scheduler/cron-scheduler.d.ts +15 -3
  236. package/dist/scheduler/cron-scheduler.js +53 -7
  237. package/dist/scheduler/script-runner.d.ts +2 -0
  238. package/dist/scheduler/script-runner.js +19 -4
  239. package/dist/scheduler/watchdog-handlers.js +7 -20
  240. package/dist/search/usearch-index.js +7 -2
  241. package/dist/security/tool-policy/tool-groups.js +2 -0
  242. package/dist/server/index.js +17 -2
  243. package/dist/server/routes/mobile.d.ts +12 -4
  244. package/dist/server/routes/mobile.js +116 -1
  245. package/dist/server/tls-config.d.ts +35 -0
  246. package/dist/server/tls-config.js +142 -0
  247. package/dist/server/tunnel-manager.d.ts +20 -0
  248. package/dist/server/tunnel-manager.js +58 -0
  249. package/dist/server/websocket/fleet-bridge.d.ts +13 -1
  250. package/dist/server/websocket/fleet-bridge.js +16 -0
  251. package/dist/services/prompt-builder.d.ts +1 -0
  252. package/dist/services/prompt-builder.js +49 -8
  253. package/dist/shared/engine-types.d.ts +15 -1
  254. package/dist/sidecar/sidecar-bridge.d.ts +1 -0
  255. package/dist/sidecar/sidecar-bridge.js +21 -10
  256. package/dist/spec/spec-store.js +8 -1
  257. package/dist/talk-mode/providers/audioreader-tts.d.ts +1 -1
  258. package/dist/talk-mode/providers/audioreader-tts.js +8 -8
  259. package/dist/templates/project-scaffolding.js +3 -2
  260. package/dist/themes/theme-schema.d.ts +10 -10
  261. package/dist/tools/application-profiles.js +38 -0
  262. package/dist/tools/bash/bash-tool.d.ts +1 -0
  263. package/dist/tools/bash/bash-tool.js +16 -2
  264. package/dist/tools/bash/command-validator.js +3 -0
  265. package/dist/tools/bash/rtk-rewrite.d.ts +16 -0
  266. package/dist/tools/bash/rtk-rewrite.js +100 -0
  267. package/dist/tools/bash/streaming-executor.js +14 -1
  268. package/dist/tools/computer-control-tool.d.ts +16 -1
  269. package/dist/tools/computer-control-tool.js +317 -5
  270. package/dist/tools/document-generator.d.ts +14 -0
  271. package/dist/tools/document-generator.js +79 -0
  272. package/dist/tools/execute-code-rpc-invoker.d.ts +26 -2
  273. package/dist/tools/execute-code-rpc-invoker.js +46 -5
  274. package/dist/tools/metadata.js +28 -0
  275. package/dist/tools/office-macro-tool.d.ts +10 -0
  276. package/dist/tools/office-macro-tool.js +93 -0
  277. package/dist/tools/registry/index.d.ts +2 -1
  278. package/dist/tools/registry/index.js +2 -1
  279. package/dist/tools/registry/memory-tools.d.ts +20 -0
  280. package/dist/tools/registry/memory-tools.js +225 -3
  281. package/dist/tools/registry/multimodal-tools.js +2 -2
  282. package/dist/tools/registry/vision-tools.d.ts +33 -0
  283. package/dist/tools/registry/vision-tools.js +308 -6
  284. package/dist/tools/registry/windows-tools.d.ts +2 -0
  285. package/dist/tools/registry/windows-tools.js +47 -0
  286. package/dist/tools/route-peer-tool.js +14 -0
  287. package/dist/tools/screenshot-tool.js +14 -2
  288. package/dist/tools/text-to-speech-tool.d.ts +1 -1
  289. package/dist/tools/text-to-speech-tool.js +2 -12
  290. package/dist/tools/tool-selector.js +3 -59
  291. package/dist/utils/config-validation/schema.d.ts +40 -7
  292. package/dist/utils/config-validation/schema.js +130 -1
  293. package/dist/utils/cost-tracker.js +21 -1
  294. package/dist/utils/disk-guard.d.ts +180 -0
  295. package/dist/utils/disk-guard.js +404 -0
  296. package/dist/utils/interactive-setup.js +35 -2
  297. package/dist/utils/model-utils.js +11 -2
  298. package/dist/utils/output-sanitizer.js +11 -0
  299. package/dist/utils/provider-detector.d.ts +8 -7
  300. package/dist/utils/provider-detector.js +19 -77
  301. package/dist/utils/settings-manager.d.ts +7 -0
  302. package/dist/utils/token-display.d.ts +3 -3
  303. package/dist/utils/token-display.js +22 -4
  304. package/dist/wizard/onboarding.d.ts +39 -0
  305. package/dist/wizard/onboarding.js +433 -21
  306. package/dist/wizard/provider-onboarding.d.ts +8 -23
  307. package/dist/wizard/provider-onboarding.js +39 -158
  308. package/package.json +4 -2
  309. package/dist/plugins/provider-onboarding.d.ts +0 -23
  310. package/dist/plugins/provider-onboarding.js +0 -116
  311. package/dist/utils/kokoro-tts.d.ts +0 -8
  312. package/dist/utils/kokoro-tts.js +0 -67
@@ -58,11 +58,11 @@ export declare const themeColorsSchema: z.ZodObject<{
58
58
  primary: string;
59
59
  toolResult: string;
60
60
  secondary: string;
61
+ border: string;
61
62
  userMessage: string;
62
63
  accent: string;
63
64
  textMuted: string;
64
65
  textDim: string;
65
- border: string;
66
66
  borderActive: string;
67
67
  borderBusy: string;
68
68
  assistantMessage: string;
@@ -81,11 +81,11 @@ export declare const themeColorsSchema: z.ZodObject<{
81
81
  primary: string;
82
82
  toolResult: string;
83
83
  secondary: string;
84
+ border: string;
84
85
  userMessage: string;
85
86
  accent: string;
86
87
  textMuted: string;
87
88
  textDim: string;
88
- border: string;
89
89
  borderActive: string;
90
90
  borderBusy: string;
91
91
  assistantMessage: string;
@@ -135,11 +135,11 @@ export declare const themeSchema: z.ZodObject<{
135
135
  primary: string;
136
136
  toolResult: string;
137
137
  secondary: string;
138
+ border: string;
138
139
  userMessage: string;
139
140
  accent: string;
140
141
  textMuted: string;
141
142
  textDim: string;
142
- border: string;
143
143
  borderActive: string;
144
144
  borderBusy: string;
145
145
  assistantMessage: string;
@@ -158,11 +158,11 @@ export declare const themeSchema: z.ZodObject<{
158
158
  primary: string;
159
159
  toolResult: string;
160
160
  secondary: string;
161
+ border: string;
161
162
  userMessage: string;
162
163
  accent: string;
163
164
  textMuted: string;
164
165
  textDim: string;
165
- border: string;
166
166
  borderActive: string;
167
167
  borderBusy: string;
168
168
  assistantMessage: string;
@@ -206,11 +206,11 @@ export declare const themeSchema: z.ZodObject<{
206
206
  primary: string;
207
207
  toolResult: string;
208
208
  secondary: string;
209
+ border: string;
209
210
  userMessage: string;
210
211
  accent: string;
211
212
  textMuted: string;
212
213
  textDim: string;
213
- border: string;
214
214
  borderActive: string;
215
215
  borderBusy: string;
216
216
  assistantMessage: string;
@@ -243,11 +243,11 @@ export declare const themeSchema: z.ZodObject<{
243
243
  primary: string;
244
244
  toolResult: string;
245
245
  secondary: string;
246
+ border: string;
246
247
  userMessage: string;
247
248
  accent: string;
248
249
  textMuted: string;
249
250
  textDim: string;
250
- border: string;
251
251
  borderActive: string;
252
252
  borderBusy: string;
253
253
  assistantMessage: string;
@@ -320,13 +320,13 @@ export declare const themePreferencesSchema: z.ZodObject<{
320
320
  primary?: string | undefined;
321
321
  toolResult?: string | undefined;
322
322
  secondary?: string | undefined;
323
+ border?: string | undefined;
323
324
  userMessage?: string | undefined;
324
325
  accent?: string | undefined;
325
326
  textMuted?: string | undefined;
326
327
  textDim?: string | undefined;
327
328
  background?: string | undefined;
328
329
  backgroundAlt?: string | undefined;
329
- border?: string | undefined;
330
330
  borderActive?: string | undefined;
331
331
  borderBusy?: string | undefined;
332
332
  assistantMessage?: string | undefined;
@@ -343,13 +343,13 @@ export declare const themePreferencesSchema: z.ZodObject<{
343
343
  primary?: string | undefined;
344
344
  toolResult?: string | undefined;
345
345
  secondary?: string | undefined;
346
+ border?: string | undefined;
346
347
  userMessage?: string | undefined;
347
348
  accent?: string | undefined;
348
349
  textMuted?: string | undefined;
349
350
  textDim?: string | undefined;
350
351
  background?: string | undefined;
351
352
  backgroundAlt?: string | undefined;
352
- border?: string | undefined;
353
353
  borderActive?: string | undefined;
354
354
  borderBusy?: string | undefined;
355
355
  assistantMessage?: string | undefined;
@@ -375,13 +375,13 @@ export declare const themePreferencesSchema: z.ZodObject<{
375
375
  primary?: string | undefined;
376
376
  toolResult?: string | undefined;
377
377
  secondary?: string | undefined;
378
+ border?: string | undefined;
378
379
  userMessage?: string | undefined;
379
380
  accent?: string | undefined;
380
381
  textMuted?: string | undefined;
381
382
  textDim?: string | undefined;
382
383
  background?: string | undefined;
383
384
  backgroundAlt?: string | undefined;
384
- border?: string | undefined;
385
385
  borderActive?: string | undefined;
386
386
  borderBusy?: string | undefined;
387
387
  assistantMessage?: string | undefined;
@@ -407,13 +407,13 @@ export declare const themePreferencesSchema: z.ZodObject<{
407
407
  primary?: string | undefined;
408
408
  toolResult?: string | undefined;
409
409
  secondary?: string | undefined;
410
+ border?: string | undefined;
410
411
  userMessage?: string | undefined;
411
412
  accent?: string | undefined;
412
413
  textMuted?: string | undefined;
413
414
  textDim?: string | undefined;
414
415
  background?: string | undefined;
415
416
  backgroundAlt?: string | undefined;
416
- border?: string | undefined;
417
417
  borderActive?: string | undefined;
418
418
  borderBusy?: string | undefined;
419
419
  assistantMessage?: string | undefined;
@@ -19,6 +19,41 @@ export const APPLICATION_PROFILES = [
19
19
  ],
20
20
  notes: 'Uses Windows COM automation when Excel is installed, then falls back to desktop control. Cell writes and saves require explicit confirmation for live runs.',
21
21
  },
22
+ {
23
+ id: 'powerpoint',
24
+ aliases: ['ppt', 'pptx', 'microsoft powerpoint', 'presentation', 'slides'],
25
+ name: 'Microsoft PowerPoint',
26
+ riskLevel: 'high',
27
+ defaultPolicy: 'confirm',
28
+ processNames: ['POWERPNT'],
29
+ titleHints: ['PowerPoint'],
30
+ launchCommand: 'powerpnt.exe',
31
+ executableCandidates: ['powerpnt.exe'],
32
+ capabilities: [
33
+ 'open presentation',
34
+ 'add slide',
35
+ 'set text via COM',
36
+ 'save presentation',
37
+ ],
38
+ notes: 'Uses Windows COM automation when PowerPoint is installed.',
39
+ },
40
+ {
41
+ id: 'word',
42
+ aliases: ['doc', 'docx', 'microsoft word', 'word processor'],
43
+ name: 'Microsoft Word',
44
+ riskLevel: 'high',
45
+ defaultPolicy: 'confirm',
46
+ processNames: ['WINWORD'],
47
+ titleHints: ['Word'],
48
+ launchCommand: 'winword.exe',
49
+ executableCandidates: ['winword.exe'],
50
+ capabilities: [
51
+ 'open document',
52
+ 'type text via COM',
53
+ 'save document',
54
+ ],
55
+ notes: 'Uses Windows COM automation when Word is installed.',
56
+ },
22
57
  {
23
58
  id: 'notepad',
24
59
  aliases: ['bloc-notes', 'notepad.exe', 'text editor'],
@@ -99,6 +134,9 @@ export const APPLICATION_PROFILES = [
99
134
  },
100
135
  ];
101
136
  export function listApplicationProfiles() {
137
+ // The Office profiles (excel/powerpoint/word) are advertised on every platform
138
+ // for a consistent catalog; their COM-backed actions fail closed with a clear
139
+ // "requires Windows COM" error off-Windows, so listing them cross-platform is safe.
102
140
  return APPLICATION_PROFILES;
103
141
  }
104
142
  export function resolveApplicationProfile(appName) {
@@ -72,6 +72,7 @@ export declare class BashTool implements Disposable {
72
72
  * await bash.execute('npm install', 120000);
73
73
  */
74
74
  execute(command: string, timeout?: number): Promise<ToolResult>;
75
+ private resolveRtkCommand;
75
76
  /**
76
77
  * Checkpoint files that would be affected by destructive commands.
77
78
  * Parses command arguments to identify file targets of rm, mv, etc.
@@ -28,6 +28,7 @@ import { SafeBinariesChecker } from '../../security/safe-binaries.js';
28
28
  import { getCheckpointManager } from '../../checkpoints/checkpoint-manager.js';
29
29
  import { auditLogger } from '../../security/audit-logger.js';
30
30
  import { buildBashEnvPrelude, CONTROLLED_SUBPROCESS_ENV } from './env-overrides.js';
31
+ import { rewriteCommandWithRtk } from './rtk-rewrite.js';
31
32
  export class BashTool {
32
33
  currentDirectory = process.cwd();
33
34
  confirmationService = ConfirmationService.getInstance();
@@ -331,8 +332,9 @@ export class BashTool {
331
332
  };
332
333
  }
333
334
  }
335
+ const executionCommand = await this.resolveRtkCommand(command);
334
336
  // Execute using spawn (safer than exec)
335
- const result = await this.executeWithSpawn(command, {
337
+ const result = await this.executeWithSpawn(executionCommand, {
336
338
  timeout,
337
339
  cwd: this.currentDirectory,
338
340
  });
@@ -340,7 +342,7 @@ export class BashTool {
340
342
  const errorMessage = result.stderr || `Command exited with code ${result.exitCode}`;
341
343
  // Attempt self-healing if enabled
342
344
  if (this.selfHealingEnabled) {
343
- const healingResult = await this.selfHealingEngine.attemptHealing(command, errorMessage, async (fixCmd) => {
345
+ const healingResult = await this.selfHealingEngine.attemptHealing(executionCommand, errorMessage, async (fixCmd) => {
344
346
  // Execute fix command without self-healing to avoid recursion
345
347
  const fixResult = await this.executeWithSpawn(fixCmd, {
346
348
  timeout: timeout * 2, // Give more time for fix commands
@@ -405,6 +407,18 @@ export class BashTool {
405
407
  };
406
408
  }
407
409
  }
410
+ async resolveRtkCommand(command) {
411
+ const rewrite = await rewriteCommandWithRtk(command);
412
+ if (!rewrite.rewritten)
413
+ return command;
414
+ const safetyValidation = validateCommandSafety(rewrite.command);
415
+ if (!safetyValidation.valid)
416
+ return command;
417
+ const validation = this.validateCommand(rewrite.command);
418
+ if (!validation.valid)
419
+ return command;
420
+ return rewrite.command;
421
+ }
408
422
  /**
409
423
  * Checkpoint files that would be affected by destructive commands.
410
424
  * Parses command arguments to identify file targets of rm, mv, etc.
@@ -17,6 +17,9 @@ import { auditLogger } from '../../security/audit-logger.js';
17
17
  * Handles paths, env var prefixes, and common shell constructs
18
18
  */
19
19
  export function extractBaseCommand(command) {
20
+ // Defensive: a malformed tool call can pass a non-string command.
21
+ if (typeof command !== 'string')
22
+ return null;
20
23
  // Trim and handle empty
21
24
  const trimmed = command.trim();
22
25
  if (!trimmed)
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Optional RTK command rewriting.
3
+ *
4
+ * RTK is a CLI proxy, not a TypeScript library. We integrate through its
5
+ * stable `rtk rewrite <command>` interface and fail open: when RTK is absent,
6
+ * disabled, times out, or proposes no rewrite, the original command is used.
7
+ */
8
+ export interface RtkRewriteResult {
9
+ originalCommand: string;
10
+ command: string;
11
+ rewritten: boolean;
12
+ reason?: string;
13
+ }
14
+ export declare function isRtkRewriteEnabled(env?: NodeJS.ProcessEnv): boolean;
15
+ export declare function getRtkRewriteTimeoutMs(env?: NodeJS.ProcessEnv): number;
16
+ export declare function rewriteCommandWithRtk(command: string): Promise<RtkRewriteResult>;
@@ -0,0 +1,100 @@
1
+ /**
2
+ * Optional RTK command rewriting.
3
+ *
4
+ * RTK is a CLI proxy, not a TypeScript library. We integrate through its
5
+ * stable `rtk rewrite <command>` interface and fail open: when RTK is absent,
6
+ * disabled, times out, or proposes no rewrite, the original command is used.
7
+ */
8
+ import { spawn } from 'child_process';
9
+ import { getShellEnvPolicy } from '../../security/shell-env-policy.js';
10
+ import { getFilteredEnv } from './command-validator.js';
11
+ import { CONTROLLED_SUBPROCESS_ENV } from './env-overrides.js';
12
+ const DEFAULT_RTK_TIMEOUT_MS = 1000;
13
+ const MAX_REWRITE_OUTPUT_BYTES = 64 * 1024;
14
+ export function isRtkRewriteEnabled(env = process.env) {
15
+ const raw = (env.CODEBUDDY_RTK_REWRITE ?? env.CODEBUDDY_RTK ?? '').trim().toLowerCase();
16
+ return raw === '1' || raw === 'true' || raw === 'yes' || raw === 'on' || raw === 'auto';
17
+ }
18
+ export function getRtkRewriteTimeoutMs(env = process.env) {
19
+ const raw = Number(env.CODEBUDDY_RTK_TIMEOUT_MS);
20
+ if (Number.isFinite(raw) && raw >= 50 && raw <= 10000) {
21
+ return Math.trunc(raw);
22
+ }
23
+ return DEFAULT_RTK_TIMEOUT_MS;
24
+ }
25
+ export async function rewriteCommandWithRtk(command) {
26
+ const originalCommand = command;
27
+ // Defensive: a malformed tool call can pass a non-string command.
28
+ if (typeof command !== 'string') {
29
+ return { originalCommand, command, rewritten: false, reason: 'invalid-command' };
30
+ }
31
+ if (!isRtkRewriteEnabled()) {
32
+ return { originalCommand, command, rewritten: false, reason: 'disabled' };
33
+ }
34
+ const trimmed = command.trim();
35
+ if (!trimmed) {
36
+ return { originalCommand, command, rewritten: false, reason: 'empty-command' };
37
+ }
38
+ if (/^rtk(?:\s|$)/.test(trimmed)) {
39
+ return { originalCommand, command, rewritten: false, reason: 'already-rtk' };
40
+ }
41
+ return new Promise((resolve) => {
42
+ let stdout = '';
43
+ let settled = false;
44
+ const finish = (result) => {
45
+ if (settled)
46
+ return;
47
+ settled = true;
48
+ resolve(result);
49
+ };
50
+ const filteredEnv = getFilteredEnv();
51
+ const env = {
52
+ ...getShellEnvPolicy().buildEnv(filteredEnv),
53
+ ...CONTROLLED_SUBPROCESS_ENV,
54
+ };
55
+ const proc = spawn('rtk', ['rewrite', command], {
56
+ shell: false,
57
+ env,
58
+ stdio: ['ignore', 'pipe', 'pipe'],
59
+ });
60
+ const timer = setTimeout(() => {
61
+ try {
62
+ proc.kill('SIGTERM');
63
+ }
64
+ catch {
65
+ // Process already exited.
66
+ }
67
+ finish({ originalCommand, command, rewritten: false, reason: 'timeout' });
68
+ }, getRtkRewriteTimeoutMs());
69
+ proc.stdout?.on('data', (data) => {
70
+ if (stdout.length >= MAX_REWRITE_OUTPUT_BYTES)
71
+ return;
72
+ stdout += data.toString();
73
+ if (stdout.length > MAX_REWRITE_OUTPUT_BYTES) {
74
+ stdout = stdout.slice(0, MAX_REWRITE_OUTPUT_BYTES);
75
+ }
76
+ });
77
+ proc.on('error', () => {
78
+ clearTimeout(timer);
79
+ finish({ originalCommand, command, rewritten: false, reason: 'spawn-error' });
80
+ });
81
+ proc.on('close', () => {
82
+ clearTimeout(timer);
83
+ const rewritten = stdout.trim();
84
+ if (!rewritten) {
85
+ finish({ originalCommand, command, rewritten: false, reason: 'no-rewrite' });
86
+ return;
87
+ }
88
+ if (rewritten === trimmed) {
89
+ finish({ originalCommand, command, rewritten: false, reason: 'unchanged' });
90
+ return;
91
+ }
92
+ if (rewritten.includes('\n')) {
93
+ finish({ originalCommand, command, rewritten: false, reason: 'multiline-rewrite' });
94
+ return;
95
+ }
96
+ finish({ originalCommand, command: rewritten, rewritten: true });
97
+ });
98
+ });
99
+ }
100
+ //# sourceMappingURL=rtk-rewrite.js.map
@@ -11,6 +11,7 @@ import { validateCommand } from './command-validator.js';
11
11
  import { getFilteredEnv } from './command-validator.js';
12
12
  import { getShellEnvPolicy } from '../../security/shell-env-policy.js';
13
13
  import { buildBashEnvPrelude, CONTROLLED_SUBPROCESS_ENV } from './env-overrides.js';
14
+ import { rewriteCommandWithRtk } from './rtk-rewrite.js';
14
15
  /**
15
16
  * Execute a command with streaming output.
16
17
  * Yields each line of stdout/stderr as it arrives.
@@ -45,6 +46,18 @@ export async function* executeStreaming(command, timeout = 30000, deps) {
45
46
  return { success: false, error: confirmationResult.feedback || 'Cancelled by user' };
46
47
  }
47
48
  }
49
+ const rewrite = await rewriteCommandWithRtk(command);
50
+ let executionCommand = command;
51
+ if (rewrite.rewritten) {
52
+ const rewrittenValidation = validateCommand(rewrite.command);
53
+ const rewrittenSandboxValidation = deps.getSandboxManager().validateCommand(rewrite.command);
54
+ const rewrittenSafetyValidation = validateCommandSafety(rewrite.command);
55
+ if (rewrittenValidation.valid &&
56
+ rewrittenSandboxValidation.valid &&
57
+ rewrittenSafetyValidation.valid) {
58
+ executionCommand = rewrite.command;
59
+ }
60
+ }
48
61
  // Spawn the process
49
62
  const isWindows = process.platform === 'win32';
50
63
  const policyEnv = getShellEnvPolicy().buildEnv(getFilteredEnv());
@@ -52,7 +65,7 @@ export async function* executeStreaming(command, timeout = 30000, deps) {
52
65
  ...policyEnv,
53
66
  ...CONTROLLED_SUBPROCESS_ENV,
54
67
  };
55
- const proc = spawn('bash', ['-c', `${buildBashEnvPrelude()}\n${command}`], {
68
+ const proc = spawn('bash', ['-c', `${buildBashEnvPrelude()}\n${executionCommand}`], {
56
69
  shell: false,
57
70
  cwd: deps.getCurrentDirectory(),
58
71
  env: controlledEnv,
@@ -41,7 +41,7 @@ export declare function resolveGroundingCoordinatesToAbsolute(rel: {
41
41
  x: number;
42
42
  y: number;
43
43
  } | null;
44
- export type ComputerAction = 'snapshot' | 'snapshot_with_screenshot' | 'get_element' | 'find_elements' | 'click_element_by_name' | 'click_button' | 'click_link' | 'fill_text_field' | 'clear_and_type' | 'select_dropdown_option' | 'select_radio' | 'activate_tab' | 'select_list_item' | 'open_menu_item' | 'toggle_checkbox' | 'set_slider_value' | 'select_tree_item' | 'expand_tree_item' | 'collapse_tree_item' | 'assert_text_visible' | 'assert_element_visible' | 'inspect_dialog' | 'click_dialog_button' | 'handle_dialog' | 'list_app_profiles' | 'get_app_profile' | 'open_app' | 'focus_app' | 'read_app_text' | 'save_app_document' | 'excel_open_workbook' | 'excel_set_cell' | 'excel_get_cell' | 'excel_save_workbook' | 'use_app_workflow' | 'macro' | 'click_text' | 'save_macro' | 'play_macro' | 'list_macros' | 'delete_macro' | 'wait_for_text' | 'speak' | 'click' | 'left_click' | 'middle_click' | 'double_click' | 'right_click' | 'move_mouse' | 'drag' | 'scroll' | 'cursor_position' | 'wait' | 'type' | 'key' | 'key_down' | 'key_up' | 'hotkey' | 'get_windows' | 'get_window' | 'list_window_matches' | 'wait_for_window' | 'focus_window' | 'close_window' | 'get_active_window' | 'minimize_window' | 'maximize_window' | 'restore_window' | 'move_window' | 'resize_window' | 'set_window' | 'act_on_best_window' | 'get_audit_log' | 'clear_audit_log' | 'export_audit_log' | 'set_pilot_mode' | 'get_pilot_mode' | 'get_volume' | 'set_volume' | 'get_brightness' | 'set_brightness' | 'notify' | 'lock' | 'sleep' | 'start_recording' | 'stop_recording' | 'recording_status' | 'system_info' | 'battery_info' | 'network_info' | 'check_permission';
44
+ export type ComputerAction = 'snapshot' | 'snapshot_with_screenshot' | 'get_element' | 'find_elements' | 'click_element_by_name' | 'click_button' | 'click_link' | 'fill_text_field' | 'clear_and_type' | 'select_dropdown_option' | 'select_radio' | 'activate_tab' | 'select_list_item' | 'open_menu_item' | 'toggle_checkbox' | 'set_slider_value' | 'select_tree_item' | 'expand_tree_item' | 'collapse_tree_item' | 'assert_text_visible' | 'assert_element_visible' | 'inspect_dialog' | 'click_dialog_button' | 'handle_dialog' | 'list_app_profiles' | 'get_app_profile' | 'open_app' | 'focus_app' | 'read_app_text' | 'save_app_document' | 'excel_open_workbook' | 'excel_set_cell' | 'excel_get_cell' | 'excel_save_workbook' | 'powerpoint_open_presentation' | 'powerpoint_add_slide' | 'powerpoint_set_text' | 'powerpoint_save_presentation' | 'word_open_document' | 'word_type_text' | 'word_save_document' | 'use_app_workflow' | 'macro' | 'click_text' | 'save_macro' | 'play_macro' | 'list_macros' | 'delete_macro' | 'wait_for_text' | 'speak' | 'click' | 'left_click' | 'middle_click' | 'double_click' | 'right_click' | 'move_mouse' | 'drag' | 'scroll' | 'cursor_position' | 'wait' | 'type' | 'key' | 'key_down' | 'key_up' | 'hotkey' | 'get_windows' | 'get_window' | 'list_window_matches' | 'wait_for_window' | 'focus_window' | 'close_window' | 'get_active_window' | 'minimize_window' | 'maximize_window' | 'restore_window' | 'move_window' | 'resize_window' | 'set_window' | 'act_on_best_window' | 'get_audit_log' | 'clear_audit_log' | 'export_audit_log' | 'set_pilot_mode' | 'get_pilot_mode' | 'get_volume' | 'set_volume' | 'get_brightness' | 'set_brightness' | 'notify' | 'lock' | 'sleep' | 'start_recording' | 'stop_recording' | 'recording_status' | 'system_info' | 'battery_info' | 'network_info' | 'check_permission';
45
45
  export interface ComputerControlInput {
46
46
  action: ComputerAction;
47
47
  pilotMode?: 'cautious' | 'normal' | 'fast';
@@ -52,6 +52,7 @@ export interface ComputerControlInput {
52
52
  exportAuditPath?: string;
53
53
  policyOverrides?: Record<string, 'allow' | 'block' | 'confirm'>;
54
54
  interactiveOnly?: boolean;
55
+ useOmniParser?: boolean;
55
56
  ref?: number;
56
57
  role?: string;
57
58
  name?: string;
@@ -61,6 +62,9 @@ export interface ComputerControlInput {
61
62
  sheetName?: string;
62
63
  cell?: string;
63
64
  value?: string | number | boolean | null;
65
+ slideIndex?: number;
66
+ shapeIndex?: number;
67
+ layoutIndex?: number;
64
68
  x?: number;
65
69
  y?: number;
66
70
  width?: number;
@@ -116,6 +120,7 @@ export declare class ComputerControlTool {
116
120
  private systemControl;
117
121
  private snapshotManager;
118
122
  private screenRecorder;
123
+ private omniParser;
119
124
  private lastTargetFocusProof;
120
125
  private lastVisualContextProof;
121
126
  /**
@@ -169,10 +174,18 @@ export declare class ComputerControlTool {
169
174
  private readAppText;
170
175
  private saveAppDocument;
171
176
  private withDerivedTextDocumentTarget;
177
+ private basenameForWindowTitle;
172
178
  private excelOpenWorkbook;
173
179
  private excelSetCell;
174
180
  private excelGetCell;
175
181
  private excelSaveWorkbook;
182
+ private powerpointOpenPresentation;
183
+ private powerpointAddSlide;
184
+ private powerpointSetText;
185
+ private powerpointSavePresentation;
186
+ private wordOpenDocument;
187
+ private wordTypeText;
188
+ private wordSaveDocument;
176
189
  private click;
177
190
  private doubleClick;
178
191
  private rightClick;
@@ -228,6 +241,8 @@ export declare class ComputerControlTool {
228
241
  private buildStartProcessScript;
229
242
  private runPowerShellEncoded;
230
243
  private runExcelAutomation;
244
+ private runPowerpointAutomation;
245
+ private runWordAutomation;
231
246
  private tryWindowsSelectDropdownOption;
232
247
  private tryWindowsActivateNamedRole;
233
248
  private tryWindowsSetRangeValue;