opc-agent 4.1.2 → 4.1.4

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 (745) hide show
  1. package/dist/analytics/index.d.ts.map +1 -0
  2. package/dist/analytics/index.js.map +1 -0
  3. package/dist/channels/dingtalk.d.ts.map +1 -0
  4. package/dist/channels/dingtalk.js.map +1 -0
  5. package/dist/channels/discord.d.ts.map +1 -0
  6. package/dist/channels/discord.js.map +1 -0
  7. package/dist/channels/email.d.ts.map +1 -0
  8. package/dist/channels/email.js.map +1 -0
  9. package/dist/channels/feishu.d.ts.map +1 -0
  10. package/dist/channels/feishu.js.map +1 -0
  11. package/dist/channels/googlechat.d.ts.map +1 -0
  12. package/dist/channels/googlechat.js.map +1 -0
  13. package/dist/channels/imessage.d.ts.map +1 -0
  14. package/dist/channels/imessage.js.map +1 -0
  15. package/dist/channels/index.d.ts.map +1 -0
  16. package/dist/channels/index.js.map +1 -0
  17. package/dist/channels/irc.d.ts.map +1 -0
  18. package/dist/channels/irc.js.map +1 -0
  19. package/dist/channels/line.d.ts.map +1 -0
  20. package/dist/channels/line.js.map +1 -0
  21. package/dist/channels/matrix.d.ts.map +1 -0
  22. package/dist/channels/matrix.js.map +1 -0
  23. package/dist/channels/mattermost.d.ts.map +1 -0
  24. package/dist/channels/mattermost.js.map +1 -0
  25. package/dist/channels/msteams.d.ts.map +1 -0
  26. package/dist/channels/msteams.js.map +1 -0
  27. package/dist/channels/nostr.d.ts.map +1 -0
  28. package/dist/channels/nostr.js.map +1 -0
  29. package/dist/channels/qq.d.ts.map +1 -0
  30. package/dist/channels/qq.js.map +1 -0
  31. package/dist/channels/signal.d.ts.map +1 -0
  32. package/dist/channels/signal.js.map +1 -0
  33. package/dist/channels/slack.d.ts.map +1 -0
  34. package/dist/channels/slack.js.map +1 -0
  35. package/dist/channels/sms.d.ts.map +1 -0
  36. package/dist/channels/sms.js.map +1 -0
  37. package/dist/channels/telegram.d.ts.map +1 -0
  38. package/dist/channels/telegram.js.map +1 -0
  39. package/dist/channels/twitch.d.ts.map +1 -0
  40. package/dist/channels/twitch.js.map +1 -0
  41. package/dist/channels/voice-call.d.ts.map +1 -0
  42. package/dist/channels/voice-call.js.map +1 -0
  43. package/dist/channels/voice.d.ts.map +1 -0
  44. package/dist/channels/voice.js.map +1 -0
  45. package/dist/channels/web.d.ts.map +1 -0
  46. package/dist/channels/web.js.map +1 -0
  47. package/dist/channels/webhook.d.ts.map +1 -0
  48. package/dist/channels/webhook.js.map +1 -0
  49. package/dist/channels/websocket.d.ts.map +1 -0
  50. package/dist/channels/websocket.js.map +1 -0
  51. package/dist/channels/wechat.d.ts.map +1 -0
  52. package/dist/channels/wechat.js.map +1 -0
  53. package/dist/channels/whatsapp.d.ts.map +1 -0
  54. package/dist/channels/whatsapp.js.map +1 -0
  55. package/dist/cli/chat.d.ts.map +1 -0
  56. package/dist/cli/chat.js.map +1 -0
  57. package/dist/cli/setup.d.ts.map +1 -0
  58. package/dist/cli/setup.js.map +1 -0
  59. package/dist/cli.d.ts.map +1 -0
  60. package/dist/cli.js +108 -11
  61. package/dist/cli.js.map +1 -0
  62. package/dist/core/a2a.d.ts.map +1 -0
  63. package/dist/core/a2a.js.map +1 -0
  64. package/dist/core/agent.d.ts.map +1 -0
  65. package/dist/core/agent.js.map +1 -0
  66. package/dist/core/analytics-engine.d.ts.map +1 -0
  67. package/dist/core/analytics-engine.js.map +1 -0
  68. package/dist/core/api-server.d.ts.map +1 -0
  69. package/dist/core/api-server.js.map +1 -0
  70. package/dist/core/audio.d.ts.map +1 -0
  71. package/dist/core/audio.js.map +1 -0
  72. package/dist/core/auth.d.ts.map +1 -0
  73. package/dist/core/auth.js.map +1 -0
  74. package/dist/core/cache.d.ts.map +1 -0
  75. package/dist/core/cache.js.map +1 -0
  76. package/dist/core/collaboration.d.ts.map +1 -0
  77. package/dist/core/collaboration.js.map +1 -0
  78. package/dist/core/compose.d.ts.map +1 -0
  79. package/dist/core/compose.js.map +1 -0
  80. package/dist/core/config.d.ts.map +1 -0
  81. package/dist/core/config.js.map +1 -0
  82. package/dist/core/context-discovery.d.ts.map +1 -0
  83. package/dist/core/context-discovery.js.map +1 -0
  84. package/dist/core/context-refs.d.ts.map +1 -0
  85. package/dist/core/context-refs.js.map +1 -0
  86. package/dist/core/errors.d.ts.map +1 -0
  87. package/dist/core/errors.js.map +1 -0
  88. package/dist/core/gateway.d.ts.map +1 -0
  89. package/dist/core/gateway.js.map +1 -0
  90. package/dist/core/heartbeat.d.ts.map +1 -0
  91. package/dist/core/heartbeat.js.map +1 -0
  92. package/dist/core/hitl.d.ts.map +1 -0
  93. package/dist/core/hitl.js.map +1 -0
  94. package/dist/core/hooks.d.ts.map +1 -0
  95. package/dist/core/hooks.js.map +1 -0
  96. package/dist/core/ide-bridge.d.ts.map +1 -0
  97. package/dist/core/ide-bridge.js.map +1 -0
  98. package/dist/core/knowledge.d.ts.map +1 -0
  99. package/dist/core/knowledge.js.map +1 -0
  100. package/dist/core/logger.d.ts.map +1 -0
  101. package/dist/core/logger.js.map +1 -0
  102. package/dist/core/model-recommender.d.ts +40 -0
  103. package/dist/core/model-recommender.d.ts.map +1 -0
  104. package/dist/core/model-recommender.js +186 -0
  105. package/dist/core/model-recommender.js.map +1 -0
  106. package/dist/core/node-network.d.ts.map +1 -0
  107. package/dist/core/node-network.js.map +1 -0
  108. package/dist/core/orchestrator.d.ts.map +1 -0
  109. package/dist/core/orchestrator.js.map +1 -0
  110. package/dist/core/performance.d.ts.map +1 -0
  111. package/dist/core/performance.js.map +1 -0
  112. package/dist/core/profiles.d.ts.map +1 -0
  113. package/dist/core/profiles.js.map +1 -0
  114. package/dist/core/rate-limiter.d.ts.map +1 -0
  115. package/dist/core/rate-limiter.js.map +1 -0
  116. package/dist/core/room.d.ts.map +1 -0
  117. package/dist/core/room.js.map +1 -0
  118. package/dist/core/runtime.d.ts.map +1 -0
  119. package/dist/core/runtime.js.map +1 -0
  120. package/dist/core/sandbox.d.ts.map +1 -0
  121. package/dist/core/sandbox.js.map +1 -0
  122. package/dist/core/scheduler.d.ts.map +1 -0
  123. package/dist/core/scheduler.js.map +1 -0
  124. package/dist/core/security.d.ts.map +1 -0
  125. package/dist/core/security.js.map +1 -0
  126. package/dist/core/session-manager.d.ts.map +1 -0
  127. package/dist/core/session-manager.js.map +1 -0
  128. package/dist/core/streaming.d.ts.map +1 -0
  129. package/dist/core/streaming.js.map +1 -0
  130. package/dist/core/subagent.d.ts.map +1 -0
  131. package/dist/core/subagent.js.map +1 -0
  132. package/dist/core/types.d.ts.map +1 -0
  133. package/dist/core/types.js.map +1 -0
  134. package/dist/core/versioning.d.ts.map +1 -0
  135. package/dist/core/versioning.js.map +1 -0
  136. package/dist/core/vision.d.ts.map +1 -0
  137. package/dist/core/vision.js.map +1 -0
  138. package/dist/core/watch.d.ts.map +1 -0
  139. package/dist/core/watch.js.map +1 -0
  140. package/dist/core/workflow-graph.d.ts.map +1 -0
  141. package/dist/core/workflow-graph.js.map +1 -0
  142. package/dist/core/workflow.d.ts.map +1 -0
  143. package/dist/core/workflow.js.map +1 -0
  144. package/dist/daemon.d.ts.map +1 -0
  145. package/dist/daemon.js.map +1 -0
  146. package/dist/deploy/hermes.d.ts.map +1 -0
  147. package/dist/deploy/hermes.js.map +1 -0
  148. package/dist/deploy/index.d.ts.map +1 -0
  149. package/dist/deploy/index.js.map +1 -0
  150. package/dist/deploy/openclaw.d.ts.map +1 -0
  151. package/dist/deploy/openclaw.js.map +1 -0
  152. package/dist/doctor.d.ts.map +1 -0
  153. package/dist/doctor.js.map +1 -0
  154. package/dist/eval/index.d.ts.map +1 -0
  155. package/dist/eval/index.js.map +1 -0
  156. package/dist/hub/brain-seed.d.ts.map +1 -0
  157. package/dist/hub/brain-seed.js.map +1 -0
  158. package/dist/hub/client.d.ts.map +1 -0
  159. package/dist/hub/client.js.map +1 -0
  160. package/dist/i18n/index.d.ts.map +1 -0
  161. package/dist/i18n/index.js.map +1 -0
  162. package/dist/index.d.ts +2 -0
  163. package/dist/index.d.ts.map +1 -0
  164. package/dist/index.js +11 -5
  165. package/dist/index.js.map +1 -0
  166. package/dist/mcp/servers/calculator-mcp.d.ts.map +1 -0
  167. package/dist/mcp/servers/calculator-mcp.js.map +1 -0
  168. package/dist/mcp/servers/crypto-mcp.d.ts.map +1 -0
  169. package/dist/mcp/servers/crypto-mcp.js.map +1 -0
  170. package/dist/mcp/servers/database-mcp.d.ts.map +1 -0
  171. package/dist/mcp/servers/database-mcp.js.map +1 -0
  172. package/dist/mcp/servers/datetime-mcp.d.ts.map +1 -0
  173. package/dist/mcp/servers/datetime-mcp.js.map +1 -0
  174. package/dist/mcp/servers/filesystem.d.ts.map +1 -0
  175. package/dist/mcp/servers/filesystem.js.map +1 -0
  176. package/dist/mcp/servers/github-mcp.d.ts.map +1 -0
  177. package/dist/mcp/servers/github-mcp.js.map +1 -0
  178. package/dist/mcp/servers/index.d.ts.map +1 -0
  179. package/dist/mcp/servers/index.js.map +1 -0
  180. package/dist/mcp/servers/json-mcp.d.ts.map +1 -0
  181. package/dist/mcp/servers/json-mcp.js.map +1 -0
  182. package/dist/mcp/servers/memory-mcp.d.ts.map +1 -0
  183. package/dist/mcp/servers/memory-mcp.js.map +1 -0
  184. package/dist/mcp/servers/regex-mcp.d.ts.map +1 -0
  185. package/dist/mcp/servers/regex-mcp.js.map +1 -0
  186. package/dist/mcp/servers/web-mcp.d.ts.map +1 -0
  187. package/dist/mcp/servers/web-mcp.js.map +1 -0
  188. package/dist/memory/context-compressor.d.ts.map +1 -0
  189. package/dist/memory/context-compressor.js.map +1 -0
  190. package/dist/memory/deepbrain.d.ts.map +1 -0
  191. package/dist/memory/deepbrain.js.map +1 -0
  192. package/dist/memory/index.d.ts.map +1 -0
  193. package/dist/memory/index.js.map +1 -0
  194. package/dist/memory/seed-loader.d.ts.map +1 -0
  195. package/dist/memory/seed-loader.js.map +1 -0
  196. package/dist/memory/user-profiler.d.ts.map +1 -0
  197. package/dist/memory/user-profiler.js.map +1 -0
  198. package/dist/plugins/content-filter.d.ts.map +1 -0
  199. package/dist/plugins/content-filter.js.map +1 -0
  200. package/dist/plugins/index.d.ts.map +1 -0
  201. package/dist/plugins/index.js.map +1 -0
  202. package/dist/plugins/logger.d.ts.map +1 -0
  203. package/dist/plugins/logger.js.map +1 -0
  204. package/dist/plugins/rate-limiter.d.ts.map +1 -0
  205. package/dist/plugins/rate-limiter.js.map +1 -0
  206. package/dist/protocols/a2a/client.d.ts.map +1 -0
  207. package/dist/protocols/a2a/client.js.map +1 -0
  208. package/dist/protocols/a2a/index.d.ts.map +1 -0
  209. package/dist/protocols/a2a/index.js.map +1 -0
  210. package/dist/protocols/a2a/server.d.ts.map +1 -0
  211. package/dist/protocols/a2a/server.js.map +1 -0
  212. package/dist/protocols/a2a/types.d.ts.map +1 -0
  213. package/dist/protocols/a2a/types.js.map +1 -0
  214. package/dist/protocols/a2a/utils.d.ts.map +1 -0
  215. package/dist/protocols/a2a/utils.js.map +1 -0
  216. package/dist/protocols/agui/client.d.ts.map +1 -0
  217. package/dist/protocols/agui/client.js.map +1 -0
  218. package/dist/protocols/agui/index.d.ts.map +1 -0
  219. package/dist/protocols/agui/index.js.map +1 -0
  220. package/dist/protocols/agui/server.d.ts.map +1 -0
  221. package/dist/protocols/agui/server.js.map +1 -0
  222. package/dist/protocols/agui/types.d.ts.map +1 -0
  223. package/dist/protocols/agui/types.js.map +1 -0
  224. package/dist/protocols/index.d.ts.map +1 -0
  225. package/dist/protocols/index.js.map +1 -0
  226. package/dist/protocols/mcp/agent-tools.d.ts.map +1 -0
  227. package/dist/protocols/mcp/agent-tools.js.map +1 -0
  228. package/dist/protocols/mcp/index.d.ts.map +1 -0
  229. package/dist/protocols/mcp/index.js.map +1 -0
  230. package/dist/protocols/mcp/server.d.ts.map +1 -0
  231. package/dist/protocols/mcp/server.js.map +1 -0
  232. package/dist/protocols/mcp/types.d.ts.map +1 -0
  233. package/dist/protocols/mcp/types.js.map +1 -0
  234. package/dist/providers/index.d.ts.map +1 -0
  235. package/dist/providers/index.js.map +1 -0
  236. package/dist/publish/index.d.ts.map +1 -0
  237. package/dist/publish/index.js.map +1 -0
  238. package/dist/scheduler/cron-engine.d.ts.map +1 -0
  239. package/dist/scheduler/cron-engine.js.map +1 -0
  240. package/dist/scheduler/index.d.ts.map +1 -0
  241. package/dist/scheduler/index.js.map +1 -0
  242. package/dist/schema/oad.d.ts.map +1 -0
  243. package/dist/schema/oad.js.map +1 -0
  244. package/dist/security/approval.d.ts.map +1 -0
  245. package/dist/security/approval.js.map +1 -0
  246. package/dist/security/approvals.d.ts.map +1 -0
  247. package/dist/security/approvals.js.map +1 -0
  248. package/dist/security/elevated.d.ts.map +1 -0
  249. package/dist/security/elevated.js.map +1 -0
  250. package/dist/security/guardrails.d.ts.map +1 -0
  251. package/dist/security/guardrails.js.map +1 -0
  252. package/dist/security/index.d.ts.map +1 -0
  253. package/dist/security/index.js.map +1 -0
  254. package/dist/security/keys.d.ts.map +1 -0
  255. package/dist/security/keys.js.map +1 -0
  256. package/dist/security/secrets.d.ts.map +1 -0
  257. package/dist/security/secrets.js.map +1 -0
  258. package/dist/skills/auto-learn.d.ts.map +1 -0
  259. package/dist/skills/auto-learn.js.map +1 -0
  260. package/dist/skills/base.d.ts.map +1 -0
  261. package/dist/skills/base.js.map +1 -0
  262. package/dist/skills/builtin/index.d.ts.map +1 -0
  263. package/dist/skills/builtin/index.js.map +1 -0
  264. package/dist/skills/document.d.ts.map +1 -0
  265. package/dist/skills/document.js.map +1 -0
  266. package/dist/skills/http.d.ts.map +1 -0
  267. package/dist/skills/http.js.map +1 -0
  268. package/dist/skills/index.d.ts.map +1 -0
  269. package/dist/skills/index.js.map +1 -0
  270. package/dist/skills/marketplace.d.ts.map +1 -0
  271. package/dist/skills/marketplace.js.map +1 -0
  272. package/dist/skills/scheduler.d.ts.map +1 -0
  273. package/dist/skills/scheduler.js.map +1 -0
  274. package/dist/skills/types.d.ts.map +1 -0
  275. package/dist/skills/types.js.map +1 -0
  276. package/dist/skills/webhook-trigger.d.ts.map +1 -0
  277. package/dist/skills/webhook-trigger.js.map +1 -0
  278. package/dist/studio/server.d.ts.map +1 -0
  279. package/dist/studio/server.js.map +1 -0
  280. package/dist/studio/templates-data.d.ts.map +1 -0
  281. package/dist/studio/templates-data.js.map +1 -0
  282. package/dist/telemetry/index.d.ts.map +1 -0
  283. package/dist/telemetry/index.js.map +1 -0
  284. package/dist/templates/code-reviewer.d.ts.map +1 -0
  285. package/dist/templates/code-reviewer.js.map +1 -0
  286. package/dist/templates/content-writer.d.ts.map +1 -0
  287. package/dist/templates/content-writer.js.map +1 -0
  288. package/dist/templates/customer-service.d.ts.map +1 -0
  289. package/dist/templates/customer-service.js.map +1 -0
  290. package/dist/templates/data-analyst.d.ts.map +1 -0
  291. package/dist/templates/data-analyst.js.map +1 -0
  292. package/dist/templates/executive-assistant.d.ts.map +1 -0
  293. package/dist/templates/executive-assistant.js.map +1 -0
  294. package/dist/templates/financial-advisor.d.ts.map +1 -0
  295. package/dist/templates/financial-advisor.js.map +1 -0
  296. package/dist/templates/hr-recruiter.d.ts.map +1 -0
  297. package/dist/templates/hr-recruiter.js.map +1 -0
  298. package/dist/templates/knowledge-base.d.ts.map +1 -0
  299. package/dist/templates/knowledge-base.js.map +1 -0
  300. package/dist/templates/legal-assistant.d.ts.map +1 -0
  301. package/dist/templates/legal-assistant.js.map +1 -0
  302. package/dist/templates/project-manager.d.ts.map +1 -0
  303. package/dist/templates/project-manager.js.map +1 -0
  304. package/dist/templates/sales-assistant.d.ts.map +1 -0
  305. package/dist/templates/sales-assistant.js.map +1 -0
  306. package/dist/templates/teacher.d.ts.map +1 -0
  307. package/dist/templates/teacher.js.map +1 -0
  308. package/dist/testing/index.d.ts.map +1 -0
  309. package/dist/testing/index.js.map +1 -0
  310. package/dist/tools/builtin/browser.d.ts.map +1 -0
  311. package/dist/tools/builtin/browser.js.map +1 -0
  312. package/dist/tools/builtin/datetime.d.ts.map +1 -0
  313. package/dist/tools/builtin/datetime.js.map +1 -0
  314. package/dist/tools/builtin/file.d.ts.map +1 -0
  315. package/dist/tools/builtin/file.js.map +1 -0
  316. package/dist/tools/builtin/home-assistant.d.ts.map +1 -0
  317. package/dist/tools/builtin/home-assistant.js.map +1 -0
  318. package/dist/tools/builtin/index.d.ts.map +1 -0
  319. package/dist/tools/builtin/index.js.map +1 -0
  320. package/dist/tools/builtin/rl-tools.d.ts.map +1 -0
  321. package/dist/tools/builtin/rl-tools.js.map +1 -0
  322. package/dist/tools/builtin/shell.d.ts.map +1 -0
  323. package/dist/tools/builtin/shell.js.map +1 -0
  324. package/dist/tools/builtin/vision.d.ts.map +1 -0
  325. package/dist/tools/builtin/vision.js.map +1 -0
  326. package/dist/tools/builtin/web-search.d.ts.map +1 -0
  327. package/dist/tools/builtin/web-search.js.map +1 -0
  328. package/dist/tools/builtin/web.d.ts.map +1 -0
  329. package/dist/tools/builtin/web.js.map +1 -0
  330. package/dist/tools/calculator.d.ts.map +1 -0
  331. package/dist/tools/calculator.js.map +1 -0
  332. package/dist/tools/datetime.d.ts.map +1 -0
  333. package/dist/tools/datetime.js.map +1 -0
  334. package/dist/tools/document-processor.d.ts.map +1 -0
  335. package/dist/tools/document-processor.js.map +1 -0
  336. package/dist/tools/gateway.d.ts.map +1 -0
  337. package/dist/tools/gateway.js.map +1 -0
  338. package/dist/tools/image-generator.d.ts.map +1 -0
  339. package/dist/tools/image-generator.js.map +1 -0
  340. package/dist/tools/integrations/calendar.d.ts.map +1 -0
  341. package/dist/tools/integrations/calendar.js.map +1 -0
  342. package/dist/tools/integrations/code-exec.d.ts.map +1 -0
  343. package/dist/tools/integrations/code-exec.js.map +1 -0
  344. package/dist/tools/integrations/csv-analyzer.d.ts.map +1 -0
  345. package/dist/tools/integrations/csv-analyzer.js.map +1 -0
  346. package/dist/tools/integrations/database.d.ts.map +1 -0
  347. package/dist/tools/integrations/database.js.map +1 -0
  348. package/dist/tools/integrations/email-send.d.ts.map +1 -0
  349. package/dist/tools/integrations/email-send.js.map +1 -0
  350. package/dist/tools/integrations/git-tool.d.ts.map +1 -0
  351. package/dist/tools/integrations/git-tool.js.map +1 -0
  352. package/dist/tools/integrations/github-tool.d.ts.map +1 -0
  353. package/dist/tools/integrations/github-tool.js.map +1 -0
  354. package/dist/tools/integrations/image-gen.d.ts.map +1 -0
  355. package/dist/tools/integrations/image-gen.js.map +1 -0
  356. package/dist/tools/integrations/index.d.ts.map +1 -0
  357. package/dist/tools/integrations/index.js.map +1 -0
  358. package/dist/tools/integrations/jira.d.ts.map +1 -0
  359. package/dist/tools/integrations/jira.js.map +1 -0
  360. package/dist/tools/integrations/notion.d.ts.map +1 -0
  361. package/dist/tools/integrations/notion.js.map +1 -0
  362. package/dist/tools/integrations/npm-tool.d.ts.map +1 -0
  363. package/dist/tools/integrations/npm-tool.js.map +1 -0
  364. package/dist/tools/integrations/pdf-reader.d.ts.map +1 -0
  365. package/dist/tools/integrations/pdf-reader.js.map +1 -0
  366. package/dist/tools/integrations/slack.d.ts.map +1 -0
  367. package/dist/tools/integrations/slack.js.map +1 -0
  368. package/dist/tools/integrations/summarizer.d.ts.map +1 -0
  369. package/dist/tools/integrations/summarizer.js.map +1 -0
  370. package/dist/tools/integrations/translator.d.ts.map +1 -0
  371. package/dist/tools/integrations/translator.js.map +1 -0
  372. package/dist/tools/integrations/trello.d.ts.map +1 -0
  373. package/dist/tools/integrations/trello.js.map +1 -0
  374. package/dist/tools/integrations/vector-search.d.ts.map +1 -0
  375. package/dist/tools/integrations/vector-search.js.map +1 -0
  376. package/dist/tools/integrations/web-scraper.d.ts.map +1 -0
  377. package/dist/tools/integrations/web-scraper.js.map +1 -0
  378. package/dist/tools/integrations/web-search.d.ts.map +1 -0
  379. package/dist/tools/integrations/web-search.js.map +1 -0
  380. package/dist/tools/integrations/webhook.d.ts.map +1 -0
  381. package/dist/tools/integrations/webhook.js.map +1 -0
  382. package/dist/tools/json-transform.d.ts.map +1 -0
  383. package/dist/tools/json-transform.js.map +1 -0
  384. package/dist/tools/mcp-client.d.ts.map +1 -0
  385. package/dist/tools/mcp-client.js.map +1 -0
  386. package/dist/tools/mcp.d.ts.map +1 -0
  387. package/dist/tools/mcp.js.map +1 -0
  388. package/dist/tools/text-analysis.d.ts.map +1 -0
  389. package/dist/tools/text-analysis.js.map +1 -0
  390. package/dist/tools/web-scraper.d.ts.map +1 -0
  391. package/dist/tools/web-scraper.js.map +1 -0
  392. package/dist/tools/web-search.d.ts.map +1 -0
  393. package/dist/tools/web-search.js.map +1 -0
  394. package/dist/traces/index.d.ts.map +1 -0
  395. package/dist/traces/index.js.map +1 -0
  396. package/dist/ui/components.d.ts.map +1 -0
  397. package/dist/ui/components.js.map +1 -0
  398. package/models.json +164 -0
  399. package/package.json +1 -1
  400. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -20
  401. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -14
  402. package/.github/PULL_REQUEST_TEMPLATE.md +0 -13
  403. package/.github/workflows/ci.yml +0 -24
  404. package/USABILITY-ISSUES.md +0 -73
  405. package/docs/.vitepress/config.ts +0 -103
  406. package/docs/api/cli.md +0 -48
  407. package/docs/api/oad-schema.md +0 -64
  408. package/docs/api/sdk.md +0 -80
  409. package/docs/guide/concepts.md +0 -51
  410. package/docs/guide/configuration.md +0 -79
  411. package/docs/guide/deployment.md +0 -42
  412. package/docs/guide/getting-started.md +0 -44
  413. package/docs/guide/templates.md +0 -28
  414. package/docs/guide/testing.md +0 -84
  415. package/docs/index.md +0 -27
  416. package/docs/zh/api/cli.md +0 -54
  417. package/docs/zh/api/oad-schema.md +0 -87
  418. package/docs/zh/api/sdk.md +0 -102
  419. package/docs/zh/guide/concepts.md +0 -104
  420. package/docs/zh/guide/configuration.md +0 -135
  421. package/docs/zh/guide/deployment.md +0 -81
  422. package/docs/zh/guide/getting-started.md +0 -82
  423. package/docs/zh/guide/templates.md +0 -84
  424. package/docs/zh/guide/testing.md +0 -88
  425. package/docs/zh/index.md +0 -27
  426. package/fix-sidebar.mjs +0 -188
  427. package/serve-studio.js +0 -13
  428. package/serve-test.js +0 -25
  429. package/src/analytics/index.ts +0 -66
  430. package/src/channels/dingtalk.ts +0 -46
  431. package/src/channels/discord.ts +0 -192
  432. package/src/channels/email.ts +0 -351
  433. package/src/channels/feishu.ts +0 -349
  434. package/src/channels/googlechat.ts +0 -42
  435. package/src/channels/imessage.ts +0 -32
  436. package/src/channels/index.ts +0 -15
  437. package/src/channels/irc.ts +0 -82
  438. package/src/channels/line.ts +0 -33
  439. package/src/channels/matrix.ts +0 -34
  440. package/src/channels/mattermost.ts +0 -57
  441. package/src/channels/msteams.ts +0 -33
  442. package/src/channels/nostr.ts +0 -33
  443. package/src/channels/qq.ts +0 -34
  444. package/src/channels/signal.ts +0 -33
  445. package/src/channels/slack.ts +0 -217
  446. package/src/channels/sms.ts +0 -34
  447. package/src/channels/telegram.ts +0 -616
  448. package/src/channels/twitch.ts +0 -65
  449. package/src/channels/voice-call.ts +0 -100
  450. package/src/channels/voice.ts +0 -471
  451. package/src/channels/web.ts +0 -638
  452. package/src/channels/webhook.ts +0 -199
  453. package/src/channels/websocket.ts +0 -399
  454. package/src/channels/wechat.ts +0 -329
  455. package/src/channels/whatsapp.ts +0 -33
  456. package/src/cli/chat.ts +0 -99
  457. package/src/cli/setup.ts +0 -314
  458. package/src/cli.ts +0 -2826
  459. package/src/core/a2a.ts +0 -203
  460. package/src/core/agent.ts +0 -476
  461. package/src/core/analytics-engine.ts +0 -186
  462. package/src/core/api-server.ts +0 -277
  463. package/src/core/audio.ts +0 -98
  464. package/src/core/auth.ts +0 -57
  465. package/src/core/cache.ts +0 -141
  466. package/src/core/collaboration.ts +0 -275
  467. package/src/core/compose.ts +0 -77
  468. package/src/core/config.ts +0 -14
  469. package/src/core/context-discovery.ts +0 -85
  470. package/src/core/context-refs.ts +0 -140
  471. package/src/core/errors.ts +0 -148
  472. package/src/core/gateway.ts +0 -106
  473. package/src/core/heartbeat.ts +0 -51
  474. package/src/core/hitl.ts +0 -138
  475. package/src/core/hooks.ts +0 -105
  476. package/src/core/ide-bridge.ts +0 -133
  477. package/src/core/knowledge.ts +0 -255
  478. package/src/core/logger.ts +0 -57
  479. package/src/core/node-network.ts +0 -86
  480. package/src/core/orchestrator.ts +0 -215
  481. package/src/core/performance.ts +0 -187
  482. package/src/core/profiles.ts +0 -122
  483. package/src/core/rate-limiter.ts +0 -128
  484. package/src/core/room.ts +0 -109
  485. package/src/core/runtime.ts +0 -435
  486. package/src/core/sandbox.ts +0 -344
  487. package/src/core/scheduler.ts +0 -187
  488. package/src/core/security.ts +0 -171
  489. package/src/core/session-manager.ts +0 -137
  490. package/src/core/streaming.ts +0 -195
  491. package/src/core/subagent.ts +0 -98
  492. package/src/core/types.ts +0 -68
  493. package/src/core/versioning.ts +0 -106
  494. package/src/core/vision.ts +0 -180
  495. package/src/core/watch.ts +0 -178
  496. package/src/core/workflow-graph.ts +0 -365
  497. package/src/core/workflow.ts +0 -235
  498. package/src/daemon.ts +0 -96
  499. package/src/deploy/hermes.ts +0 -156
  500. package/src/deploy/index.ts +0 -255
  501. package/src/deploy/openclaw.ts +0 -190
  502. package/src/doctor.ts +0 -243
  503. package/src/eval/index.ts +0 -211
  504. package/src/eval/suites/basic.json +0 -16
  505. package/src/eval/suites/memory.json +0 -12
  506. package/src/eval/suites/safety.json +0 -14
  507. package/src/hub/brain-seed.ts +0 -54
  508. package/src/hub/client.ts +0 -60
  509. package/src/i18n/index.ts +0 -216
  510. package/src/index.ts +0 -283
  511. package/src/mcp/servers/calculator-mcp.ts +0 -65
  512. package/src/mcp/servers/crypto-mcp.ts +0 -73
  513. package/src/mcp/servers/database-mcp.ts +0 -72
  514. package/src/mcp/servers/datetime-mcp.ts +0 -69
  515. package/src/mcp/servers/filesystem.ts +0 -66
  516. package/src/mcp/servers/github-mcp.ts +0 -58
  517. package/src/mcp/servers/index.ts +0 -63
  518. package/src/mcp/servers/json-mcp.ts +0 -102
  519. package/src/mcp/servers/memory-mcp.ts +0 -56
  520. package/src/mcp/servers/regex-mcp.ts +0 -53
  521. package/src/mcp/servers/web-mcp.ts +0 -49
  522. package/src/memory/context-compressor.ts +0 -189
  523. package/src/memory/deepbrain.ts +0 -202
  524. package/src/memory/index.ts +0 -41
  525. package/src/memory/seed-loader.ts +0 -212
  526. package/src/memory/user-profiler.ts +0 -215
  527. package/src/plugins/content-filter.ts +0 -23
  528. package/src/plugins/index.ts +0 -339
  529. package/src/plugins/logger.ts +0 -18
  530. package/src/plugins/rate-limiter.ts +0 -38
  531. package/src/protocols/a2a/client.ts +0 -132
  532. package/src/protocols/a2a/index.ts +0 -8
  533. package/src/protocols/a2a/server.ts +0 -333
  534. package/src/protocols/a2a/types.ts +0 -88
  535. package/src/protocols/a2a/utils.ts +0 -50
  536. package/src/protocols/agui/client.ts +0 -83
  537. package/src/protocols/agui/index.ts +0 -4
  538. package/src/protocols/agui/server.ts +0 -218
  539. package/src/protocols/agui/types.ts +0 -153
  540. package/src/protocols/index.ts +0 -2
  541. package/src/protocols/mcp/agent-tools.ts +0 -134
  542. package/src/protocols/mcp/index.ts +0 -8
  543. package/src/protocols/mcp/server.ts +0 -262
  544. package/src/protocols/mcp/types.ts +0 -69
  545. package/src/providers/index.ts +0 -632
  546. package/src/publish/index.ts +0 -376
  547. package/src/scheduler/cron-engine.ts +0 -191
  548. package/src/scheduler/index.ts +0 -2
  549. package/src/schema/oad.ts +0 -217
  550. package/src/security/approval.ts +0 -131
  551. package/src/security/approvals.ts +0 -143
  552. package/src/security/elevated.ts +0 -105
  553. package/src/security/guardrails.ts +0 -248
  554. package/src/security/index.ts +0 -9
  555. package/src/security/keys.ts +0 -87
  556. package/src/security/secrets.ts +0 -129
  557. package/src/skills/auto-learn.ts +0 -262
  558. package/src/skills/base.ts +0 -16
  559. package/src/skills/builtin/index.ts +0 -408
  560. package/src/skills/document.ts +0 -100
  561. package/src/skills/http.ts +0 -35
  562. package/src/skills/index.ts +0 -27
  563. package/src/skills/marketplace.ts +0 -113
  564. package/src/skills/scheduler.ts +0 -80
  565. package/src/skills/types.ts +0 -42
  566. package/src/skills/webhook-trigger.ts +0 -59
  567. package/src/studio/server.ts +0 -1791
  568. package/src/studio/templates-data.ts +0 -178
  569. package/src/studio-ui/index.html +0 -3076
  570. package/src/telemetry/index.ts +0 -324
  571. package/src/templates/code-reviewer.ts +0 -30
  572. package/src/templates/content-writer.ts +0 -58
  573. package/src/templates/customer-service.ts +0 -76
  574. package/src/templates/data-analyst.ts +0 -66
  575. package/src/templates/executive-assistant.ts +0 -71
  576. package/src/templates/financial-advisor.ts +0 -60
  577. package/src/templates/hr-recruiter.ts +0 -58
  578. package/src/templates/knowledge-base.ts +0 -27
  579. package/src/templates/legal-assistant.ts +0 -71
  580. package/src/templates/project-manager.ts +0 -58
  581. package/src/templates/sales-assistant.ts +0 -75
  582. package/src/templates/teacher.ts +0 -75
  583. package/src/testing/index.ts +0 -181
  584. package/src/tools/builtin/browser.ts +0 -299
  585. package/src/tools/builtin/datetime.ts +0 -41
  586. package/src/tools/builtin/file.ts +0 -107
  587. package/src/tools/builtin/home-assistant.ts +0 -116
  588. package/src/tools/builtin/index.ts +0 -37
  589. package/src/tools/builtin/rl-tools.ts +0 -243
  590. package/src/tools/builtin/shell.ts +0 -43
  591. package/src/tools/builtin/vision.ts +0 -64
  592. package/src/tools/builtin/web-search.ts +0 -126
  593. package/src/tools/builtin/web.ts +0 -35
  594. package/src/tools/calculator.ts +0 -73
  595. package/src/tools/datetime.ts +0 -149
  596. package/src/tools/document-processor.ts +0 -213
  597. package/src/tools/gateway.ts +0 -220
  598. package/src/tools/image-generator.ts +0 -150
  599. package/src/tools/integrations/calendar.ts +0 -73
  600. package/src/tools/integrations/code-exec.ts +0 -39
  601. package/src/tools/integrations/csv-analyzer.ts +0 -92
  602. package/src/tools/integrations/database.ts +0 -44
  603. package/src/tools/integrations/email-send.ts +0 -76
  604. package/src/tools/integrations/git-tool.ts +0 -42
  605. package/src/tools/integrations/github-tool.ts +0 -76
  606. package/src/tools/integrations/image-gen.ts +0 -56
  607. package/src/tools/integrations/index.ts +0 -92
  608. package/src/tools/integrations/jira.ts +0 -83
  609. package/src/tools/integrations/notion.ts +0 -71
  610. package/src/tools/integrations/npm-tool.ts +0 -48
  611. package/src/tools/integrations/pdf-reader.ts +0 -58
  612. package/src/tools/integrations/slack.ts +0 -65
  613. package/src/tools/integrations/summarizer.ts +0 -49
  614. package/src/tools/integrations/translator.ts +0 -48
  615. package/src/tools/integrations/trello.ts +0 -60
  616. package/src/tools/integrations/vector-search.ts +0 -42
  617. package/src/tools/integrations/web-scraper.ts +0 -47
  618. package/src/tools/integrations/web-search.ts +0 -58
  619. package/src/tools/integrations/webhook.ts +0 -38
  620. package/src/tools/json-transform.ts +0 -187
  621. package/src/tools/mcp-client.ts +0 -131
  622. package/src/tools/mcp.ts +0 -76
  623. package/src/tools/text-analysis.ts +0 -116
  624. package/src/tools/web-scraper.ts +0 -179
  625. package/src/tools/web-search.ts +0 -180
  626. package/src/traces/index.ts +0 -132
  627. package/src/types/agent-workstation.d.ts +0 -2
  628. package/src/ui/components.ts +0 -127
  629. package/srv-err.txt +0 -0
  630. package/srv-out.txt +0 -1
  631. package/test-agent/Dockerfile +0 -9
  632. package/test-agent/README.md +0 -50
  633. package/test-agent/agent.yaml +0 -23
  634. package/test-agent/docker-compose.yml +0 -11
  635. package/test-agent/oad.yaml +0 -31
  636. package/test-agent/package-lock.json +0 -1492
  637. package/test-agent/package.json +0 -18
  638. package/test-agent/src/index.ts +0 -24
  639. package/test-agent/src/skills/echo.ts +0 -15
  640. package/test-agent/tsconfig.json +0 -25
  641. package/test-full.js +0 -43
  642. package/test-sidebar.js +0 -22
  643. package/test-studio3.js +0 -75
  644. package/test-studio4.js +0 -41
  645. package/tests/a2a-protocol.test.ts +0 -285
  646. package/tests/a2a.test.ts +0 -66
  647. package/tests/agent.test.ts +0 -72
  648. package/tests/agui-protocol.test.ts +0 -246
  649. package/tests/analytics.test.ts +0 -50
  650. package/tests/api-server.test.ts +0 -148
  651. package/tests/approvals.test.ts +0 -89
  652. package/tests/audio.test.ts +0 -40
  653. package/tests/auto-learn.test.ts +0 -105
  654. package/tests/brain-seed-extended.test.ts +0 -490
  655. package/tests/brain-seed.test.ts +0 -239
  656. package/tests/browser.test.ts +0 -179
  657. package/tests/builtin-tools.test.ts +0 -83
  658. package/tests/channel.test.ts +0 -39
  659. package/tests/channels/discord.test.ts +0 -79
  660. package/tests/channels/email.test.ts +0 -148
  661. package/tests/channels/feishu.test.ts +0 -123
  662. package/tests/channels/telegram.test.ts +0 -129
  663. package/tests/channels/websocket.test.ts +0 -53
  664. package/tests/channels/wechat.test.ts +0 -170
  665. package/tests/channels-extra.test.ts +0 -45
  666. package/tests/chat-cli.test.ts +0 -160
  667. package/tests/cli.test.ts +0 -46
  668. package/tests/collaboration.test.ts +0 -319
  669. package/tests/context-compressor.test.ts +0 -172
  670. package/tests/context-refs.test.ts +0 -121
  671. package/tests/cron-engine.test.ts +0 -101
  672. package/tests/daemon.test.ts +0 -135
  673. package/tests/deepbrain-wire.test.ts +0 -234
  674. package/tests/deploy-and-dag.test.ts +0 -196
  675. package/tests/doctor.test.ts +0 -38
  676. package/tests/document-processor.test.ts +0 -69
  677. package/tests/e2e-nocode.test.ts +0 -442
  678. package/tests/e2e.test.ts +0 -134
  679. package/tests/elevated.test.ts +0 -69
  680. package/tests/errors.test.ts +0 -83
  681. package/tests/eval.test.ts +0 -173
  682. package/tests/gateway.test.ts +0 -63
  683. package/tests/guardrails.test.ts +0 -177
  684. package/tests/hitl.test.ts +0 -71
  685. package/tests/home-assistant.test.ts +0 -40
  686. package/tests/hooks.test.ts +0 -79
  687. package/tests/i18n.test.ts +0 -41
  688. package/tests/ide-bridge.test.ts +0 -38
  689. package/tests/image-generator.test.ts +0 -84
  690. package/tests/init-role.test.ts +0 -124
  691. package/tests/integrations.test.ts +0 -249
  692. package/tests/mcp-client.test.ts +0 -92
  693. package/tests/mcp-server.test.ts +0 -178
  694. package/tests/mcp-servers.test.ts +0 -260
  695. package/tests/mcp.test.ts +0 -54
  696. package/tests/node-network.test.ts +0 -74
  697. package/tests/oad.test.ts +0 -68
  698. package/tests/performance.test.ts +0 -115
  699. package/tests/plugin-a2a-enhanced.test.ts +0 -230
  700. package/tests/plugin.test.ts +0 -74
  701. package/tests/profiles.test.ts +0 -61
  702. package/tests/publish.test.ts +0 -231
  703. package/tests/rl-tools.test.ts +0 -93
  704. package/tests/room.test.ts +0 -106
  705. package/tests/runtime.test.ts +0 -42
  706. package/tests/sandbox-manager.test.ts +0 -46
  707. package/tests/sandbox.test.ts +0 -46
  708. package/tests/scheduler.test.ts +0 -200
  709. package/tests/secrets.test.ts +0 -107
  710. package/tests/security-enhanced.test.ts +0 -233
  711. package/tests/security.test.ts +0 -60
  712. package/tests/settings-api.test.ts +0 -148
  713. package/tests/setup.test.ts +0 -73
  714. package/tests/skill-learner.test.ts +0 -161
  715. package/tests/streaming.test.ts +0 -109
  716. package/tests/studio.test.ts +0 -402
  717. package/tests/subagent.test.ts +0 -193
  718. package/tests/telegram-discord.test.ts +0 -60
  719. package/tests/telemetry.test.ts +0 -186
  720. package/tests/templates.test.ts +0 -77
  721. package/tests/tools/builtin-extended.test.ts +0 -138
  722. package/tests/user-profiler.test.ts +0 -169
  723. package/tests/v070.test.ts +0 -76
  724. package/tests/v090-features.test.ts +0 -254
  725. package/tests/versioning.test.ts +0 -75
  726. package/tests/vision.test.ts +0 -61
  727. package/tests/voice-call.test.ts +0 -47
  728. package/tests/voice-enhanced.test.ts +0 -169
  729. package/tests/voice-interaction.test.ts +0 -38
  730. package/tests/voice.test.ts +0 -61
  731. package/tests/web-search.test.ts +0 -155
  732. package/tests/webhook.test.ts +0 -29
  733. package/tests/workflow-graph.test.ts +0 -279
  734. package/tests/workflow.test.ts +0 -143
  735. package/tmp-js-test.js +0 -1532
  736. package/tmp-sc.js +0 -1716
  737. package/tutorial/customer-service-agent/README.md +0 -612
  738. package/tutorial/customer-service-agent/SOUL.md +0 -26
  739. package/tutorial/customer-service-agent/agent.yaml +0 -63
  740. package/tutorial/customer-service-agent/package.json +0 -19
  741. package/tutorial/customer-service-agent/src/index.ts +0 -69
  742. package/tutorial/customer-service-agent/src/skills/faq.ts +0 -27
  743. package/tutorial/customer-service-agent/src/skills/ticket.ts +0 -22
  744. package/tutorial/customer-service-agent/tsconfig.json +0 -14
  745. package/vitest.config.ts +0 -9
@@ -1,243 +0,0 @@
1
- import type { MCPTool, MCPToolResult } from '../mcp';
2
-
3
- // In-memory storage fallback
4
- interface Trajectory {
5
- id: string;
6
- taskType: string;
7
- actions: Array<{ action: string; timestamp: number; reward?: number }>;
8
- outcome?: 'success' | 'partial' | 'failure';
9
- totalReward: number;
10
- }
11
-
12
- interface PolicyEntry {
13
- taskType: string;
14
- preferredActions: string[];
15
- weights: Record<string, number>;
16
- }
17
-
18
- const trajectories: Trajectory[] = [];
19
- const policies = new Map<string, PolicyEntry>();
20
- let currentEpisode: Trajectory | null = null;
21
-
22
- function getOrCreateEpisode(taskType: string): Trajectory {
23
- if (!currentEpisode || currentEpisode.taskType !== taskType) {
24
- currentEpisode = {
25
- id: `ep_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`,
26
- taskType,
27
- actions: [],
28
- totalReward: 0,
29
- };
30
- trajectories.push(currentEpisode);
31
- }
32
- return currentEpisode;
33
- }
34
-
35
- export const rlRecordTrajectory: MCPTool = {
36
- name: 'rl_record_trajectory',
37
- description: 'Record action sequences and outcomes for RL training',
38
- inputSchema: {
39
- type: 'object',
40
- properties: {
41
- taskType: { type: 'string' },
42
- action: { type: 'string' },
43
- outcome: { type: 'string', enum: ['success', 'partial', 'failure'] },
44
- },
45
- required: ['taskType', 'action'],
46
- },
47
- async execute(input): Promise<MCPToolResult> {
48
- const ep = getOrCreateEpisode(input.taskType as string);
49
- ep.actions.push({ action: input.action as string, timestamp: Date.now() });
50
- if (input.outcome) ep.outcome = input.outcome as Trajectory['outcome'];
51
- return { content: JSON.stringify({ episodeId: ep.id, actionsRecorded: ep.actions.length }) };
52
- },
53
- };
54
-
55
- export const rlEvaluateOutcome: MCPTool = {
56
- name: 'rl_evaluate_outcome',
57
- description: "Score an action's outcome (success/partial/failure)",
58
- inputSchema: {
59
- type: 'object',
60
- properties: {
61
- episodeId: { type: 'string' },
62
- outcome: { type: 'string', enum: ['success', 'partial', 'failure'] },
63
- },
64
- required: ['outcome'],
65
- },
66
- async execute(input): Promise<MCPToolResult> {
67
- const ep = input.episodeId
68
- ? trajectories.find(t => t.id === input.episodeId)
69
- : currentEpisode;
70
- if (!ep) return { content: 'No active episode found', isError: true };
71
- ep.outcome = input.outcome as Trajectory['outcome'];
72
- const score = ep.outcome === 'success' ? 1 : ep.outcome === 'partial' ? 0.5 : 0;
73
- return { content: JSON.stringify({ episodeId: ep.id, outcome: ep.outcome, score }) };
74
- },
75
- };
76
-
77
- export const rlGetBestStrategy: MCPTool = {
78
- name: 'rl_get_best_strategy',
79
- description: 'Retrieve best-performing strategy for a task type',
80
- inputSchema: {
81
- type: 'object',
82
- properties: { taskType: { type: 'string' } },
83
- required: ['taskType'],
84
- },
85
- async execute(input): Promise<MCPToolResult> {
86
- const taskType = input.taskType as string;
87
- const relevant = trajectories.filter(t => t.taskType === taskType && t.outcome === 'success');
88
- if (relevant.length === 0) return { content: JSON.stringify({ strategy: null, message: 'No successful strategies found' }) };
89
- const best = relevant.reduce((a, b) => a.totalReward >= b.totalReward ? a : b);
90
- return { content: JSON.stringify({ strategy: best.actions.map(a => a.action), totalReward: best.totalReward }) };
91
- },
92
- };
93
-
94
- export const rlCompareStrategies: MCPTool = {
95
- name: 'rl_compare_strategies',
96
- description: 'Compare multiple strategies by success rate',
97
- inputSchema: {
98
- type: 'object',
99
- properties: { taskType: { type: 'string' } },
100
- required: ['taskType'],
101
- },
102
- async execute(input): Promise<MCPToolResult> {
103
- const taskType = input.taskType as string;
104
- const relevant = trajectories.filter(t => t.taskType === taskType && t.outcome);
105
- const total = relevant.length;
106
- const successes = relevant.filter(t => t.outcome === 'success').length;
107
- const partials = relevant.filter(t => t.outcome === 'partial').length;
108
- const failures = relevant.filter(t => t.outcome === 'failure').length;
109
- return {
110
- content: JSON.stringify({
111
- taskType, total, successRate: total ? successes / total : 0,
112
- breakdown: { successes, partials, failures },
113
- }),
114
- };
115
- },
116
- };
117
-
118
- export const rlGenerateTrainingData: MCPTool = {
119
- name: 'rl_generate_training_data',
120
- description: 'Export trajectories as fine-tuning JSONL',
121
- inputSchema: {
122
- type: 'object',
123
- properties: { taskType: { type: 'string' }, minReward: { type: 'number' } },
124
- },
125
- async execute(input): Promise<MCPToolResult> {
126
- let data = trajectories;
127
- if (input.taskType) data = data.filter(t => t.taskType === input.taskType);
128
- if (input.minReward != null) data = data.filter(t => t.totalReward >= (input.minReward as number));
129
- const jsonl = data.map(t => JSON.stringify({
130
- messages: [
131
- { role: 'system', content: `Task: ${t.taskType}` },
132
- ...t.actions.map(a => ({ role: 'assistant', content: a.action })),
133
- ],
134
- outcome: t.outcome,
135
- reward: t.totalReward,
136
- })).join('\n');
137
- return { content: jsonl || '(no data)' };
138
- },
139
- };
140
-
141
- export const rlRewardSignal: MCPTool = {
142
- name: 'rl_reward_signal',
143
- description: 'Record positive/negative reward for last action',
144
- inputSchema: {
145
- type: 'object',
146
- properties: { reward: { type: 'number' }, reason: { type: 'string' } },
147
- required: ['reward'],
148
- },
149
- async execute(input): Promise<MCPToolResult> {
150
- if (!currentEpisode || currentEpisode.actions.length === 0) {
151
- return { content: 'No current episode or actions to reward', isError: true };
152
- }
153
- const lastAction = currentEpisode.actions[currentEpisode.actions.length - 1];
154
- lastAction.reward = input.reward as number;
155
- currentEpisode.totalReward += input.reward as number;
156
- return { content: JSON.stringify({ action: lastAction.action, reward: input.reward, totalReward: currentEpisode.totalReward }) };
157
- },
158
- };
159
-
160
- export const rlExplorationSuggest: MCPTool = {
161
- name: 'rl_exploration_suggest',
162
- description: 'Suggest alternative approaches (exploration)',
163
- inputSchema: {
164
- type: 'object',
165
- properties: { taskType: { type: 'string' }, currentAction: { type: 'string' } },
166
- required: ['taskType'],
167
- },
168
- async execute(input): Promise<MCPToolResult> {
169
- const taskType = input.taskType as string;
170
- const allActions = new Set<string>();
171
- trajectories.filter(t => t.taskType === taskType).forEach(t => t.actions.forEach(a => allActions.add(a.action)));
172
- const suggestions = Array.from(allActions).filter(a => a !== input.currentAction).slice(0, 5);
173
- if (suggestions.length === 0) {
174
- return { content: JSON.stringify({ suggestions: [], message: 'No alternative actions found. Try a completely new approach.' }) };
175
- }
176
- return { content: JSON.stringify({ suggestions }) };
177
- },
178
- };
179
-
180
- export const rlUpdatePolicy: MCPTool = {
181
- name: 'rl_update_policy',
182
- description: "Update agent's action preferences based on rewards",
183
- inputSchema: {
184
- type: 'object',
185
- properties: { taskType: { type: 'string' }, action: { type: 'string' }, weight: { type: 'number' } },
186
- required: ['taskType', 'action', 'weight'],
187
- },
188
- async execute(input): Promise<MCPToolResult> {
189
- const taskType = input.taskType as string;
190
- let policy = policies.get(taskType);
191
- if (!policy) {
192
- policy = { taskType, preferredActions: [], weights: {} };
193
- policies.set(taskType, policy);
194
- }
195
- const action = input.action as string;
196
- policy.weights[action] = (policy.weights[action] || 0) + (input.weight as number);
197
- policy.preferredActions = Object.entries(policy.weights)
198
- .sort(([, a], [, b]) => b - a)
199
- .map(([k]) => k);
200
- return { content: JSON.stringify({ taskType, preferredActions: policy.preferredActions.slice(0, 5), weights: policy.weights }) };
201
- },
202
- };
203
-
204
- export const rlGetStatistics: MCPTool = {
205
- name: 'rl_get_statistics',
206
- description: 'Get success/failure stats by task type',
207
- inputSchema: {
208
- type: 'object',
209
- properties: { taskType: { type: 'string' } },
210
- },
211
- async execute(input): Promise<MCPToolResult> {
212
- let data = trajectories;
213
- if (input.taskType) data = data.filter(t => t.taskType === input.taskType);
214
- const stats: Record<string, { total: number; success: number; partial: number; failure: number; avgReward: number }> = {};
215
- for (const t of data) {
216
- if (!stats[t.taskType]) stats[t.taskType] = { total: 0, success: 0, partial: 0, failure: 0, avgReward: 0 };
217
- const s = stats[t.taskType];
218
- s.total++;
219
- if (t.outcome === 'success') s.success++;
220
- else if (t.outcome === 'partial') s.partial++;
221
- else if (t.outcome === 'failure') s.failure++;
222
- s.avgReward = (s.avgReward * (s.total - 1) + t.totalReward) / s.total;
223
- }
224
- return { content: JSON.stringify(stats) };
225
- },
226
- };
227
-
228
- export const rlResetEpisode: MCPTool = {
229
- name: 'rl_reset_episode',
230
- description: 'Clear current episode state',
231
- inputSchema: { type: 'object', properties: {} },
232
- async execute(): Promise<MCPToolResult> {
233
- const had = currentEpisode != null;
234
- currentEpisode = null;
235
- return { content: JSON.stringify({ reset: true, hadActiveEpisode: had }) };
236
- },
237
- };
238
-
239
- export const rlTools: MCPTool[] = [
240
- rlRecordTrajectory, rlEvaluateOutcome, rlGetBestStrategy, rlCompareStrategies,
241
- rlGenerateTrainingData, rlRewardSignal, rlExplorationSuggest, rlUpdatePolicy,
242
- rlGetStatistics, rlResetEpisode,
243
- ];
@@ -1,43 +0,0 @@
1
- import { execSync } from 'child_process';
2
- import * as path from 'path';
3
- import type { MCPTool, MCPToolResult } from '../mcp';
4
-
5
- export const shellTool: MCPTool = {
6
- name: 'shell_exec',
7
- description: 'Execute a shell command (sandboxed to workspace)',
8
- inputSchema: {
9
- type: 'object',
10
- properties: {
11
- command: { type: 'string' },
12
- timeout: { type: 'number', default: 30000 },
13
- },
14
- required: ['command'],
15
- },
16
- async execute(input: Record<string, unknown>): Promise<MCPToolResult> {
17
- const command = input.command as string;
18
- const timeout = (input.timeout as number) || 30000;
19
- const workspace = process.cwd();
20
-
21
- // Block path traversal attempts
22
- if (command.includes('..')) {
23
- return { content: 'Commands with ".." are not allowed for security', isError: true };
24
- }
25
-
26
- try {
27
- const output = execSync(command, {
28
- cwd: workspace,
29
- timeout,
30
- encoding: 'utf-8',
31
- maxBuffer: 1024 * 1024,
32
- stdio: ['pipe', 'pipe', 'pipe'],
33
- });
34
- const result = (output || '').slice(0, 5000);
35
- return { content: result || '(no output)', isError: false };
36
- } catch (err: any) {
37
- const stderr = err.stderr ? String(err.stderr).slice(0, 2500) : '';
38
- const stdout = err.stdout ? String(err.stdout).slice(0, 2500) : '';
39
- const output = [stdout, stderr].filter(Boolean).join('\n') || err.message;
40
- return { content: `Command failed: ${output.slice(0, 5000)}`, isError: true };
41
- }
42
- },
43
- };
@@ -1,64 +0,0 @@
1
- import type { MCPTool, MCPToolResult } from '../mcp';
2
- import { VisionManager } from '../../core/vision';
3
- import type { ImageInput } from '../../core/vision';
4
-
5
- const manager = new VisionManager();
6
-
7
- export const visionAnalyzeTool: MCPTool = {
8
- name: 'vision_analyze',
9
- description: 'Analyze an image using vision AI. Provide image as URL or base64.',
10
- inputSchema: {
11
- type: 'object',
12
- properties: {
13
- image_url: { type: 'string', description: 'URL of the image to analyze' },
14
- image_base64: { type: 'string', description: 'Base64-encoded image data' },
15
- prompt: { type: 'string', description: 'Optional prompt for analysis' },
16
- },
17
- },
18
- async execute(input: Record<string, unknown>): Promise<MCPToolResult> {
19
- const imgInput: ImageInput = input.image_url
20
- ? { type: 'url', data: input.image_url as string }
21
- : { type: 'base64', data: input.image_base64 as string };
22
- const result = await manager.analyze(imgInput, input.prompt as string | undefined);
23
- return { content: JSON.stringify(result) };
24
- },
25
- };
26
-
27
- export const visionExtractTextTool: MCPTool = {
28
- name: 'vision_extract_text',
29
- description: 'Extract text (OCR) from an image.',
30
- inputSchema: {
31
- type: 'object',
32
- properties: {
33
- image_url: { type: 'string', description: 'URL of the image' },
34
- image_base64: { type: 'string', description: 'Base64-encoded image data' },
35
- },
36
- },
37
- async execute(input: Record<string, unknown>): Promise<MCPToolResult> {
38
- const imgInput: ImageInput = input.image_url
39
- ? { type: 'url', data: input.image_url as string }
40
- : { type: 'base64', data: input.image_base64 as string };
41
- const text = await manager.extractText(imgInput);
42
- return { content: text };
43
- },
44
- };
45
-
46
- export const visionCompareTool: MCPTool = {
47
- name: 'vision_compare',
48
- description: 'Compare multiple images.',
49
- inputSchema: {
50
- type: 'object',
51
- properties: {
52
- image_urls: { type: 'array', items: { type: 'string' }, description: 'URLs of images to compare' },
53
- prompt: { type: 'string', description: 'Optional comparison prompt' },
54
- },
55
- },
56
- async execute(input: Record<string, unknown>): Promise<MCPToolResult> {
57
- const urls = input.image_urls as string[];
58
- const images: ImageInput[] = urls.map(url => ({ type: 'url' as const, data: url }));
59
- const result = await manager.compareImages(images, input.prompt as string | undefined);
60
- return { content: result };
61
- },
62
- };
63
-
64
- export const visionTools: MCPTool[] = [visionAnalyzeTool, visionExtractTextTool, visionCompareTool];
@@ -1,126 +0,0 @@
1
- /**
2
- * Web Search & Read Built-in Tools - v0.10.0
3
- * Registers web_search and web_read as agent-callable tools.
4
- */
5
-
6
- import type { MCPTool, MCPToolResult } from '../mcp';
7
- import { webSearch, DEFAULT_SEARCH_CONFIG, type WebSearchConfig, type SearchEngine } from '../web-search';
8
- import { scrapeUrl } from '../web-scraper';
9
- import { existsSync, readFileSync } from 'fs';
10
- import { join } from 'path';
11
- import * as os from 'os';
12
-
13
- function loadSearchConfig(): WebSearchConfig {
14
- try {
15
- const cfgPath = join(os.homedir(), '.opc', 'config.json');
16
- if (existsSync(cfgPath)) {
17
- const cfg = JSON.parse(readFileSync(cfgPath, 'utf-8'));
18
- if (cfg.webSearch) {
19
- return { ...DEFAULT_SEARCH_CONFIG, ...cfg.webSearch };
20
- }
21
- }
22
- } catch { /* ignore */ }
23
- return DEFAULT_SEARCH_CONFIG;
24
- }
25
-
26
- export const webSearchTool: MCPTool = {
27
- name: 'web_search',
28
- description: 'Search the internet for information. Returns titles, URLs, and snippets from search results. Use when you need current information or facts you\'re unsure about.',
29
- inputSchema: {
30
- type: 'object',
31
- properties: {
32
- query: {
33
- type: 'string',
34
- description: 'Search query string',
35
- },
36
- maxResults: {
37
- type: 'number',
38
- description: 'Maximum number of results to return (default: 5)',
39
- },
40
- engine: {
41
- type: 'string',
42
- enum: ['duckduckgo', 'brave', 'searxng', 'google'],
43
- description: 'Search engine to use (default: configured engine)',
44
- },
45
- },
46
- required: ['query'],
47
- },
48
-
49
- async execute(input: Record<string, unknown>): Promise<MCPToolResult> {
50
- const query = String(input.query ?? '');
51
- if (!query.trim()) {
52
- return { content: 'Error: empty search query', isError: true };
53
- }
54
-
55
- const config = loadSearchConfig();
56
- if (!config.enabled) {
57
- return { content: 'Web search is disabled in settings.', isError: true };
58
- }
59
-
60
- try {
61
- const results = await webSearch(query, config, {
62
- maxResults: (input.maxResults as number) || 5,
63
- engine: input.engine as SearchEngine | undefined,
64
- });
65
-
66
- if (results.length === 0) {
67
- return { content: `No results found for: ${query}` };
68
- }
69
-
70
- const formatted = results.map((r, i) =>
71
- `${i + 1}. **${r.title}**\n ${r.url}\n ${r.snippet}`
72
- ).join('\n\n');
73
-
74
- return {
75
- content: `Search results for "${query}":\n\n${formatted}`,
76
- metadata: { resultCount: results.length, query },
77
- };
78
- } catch (err) {
79
- return {
80
- content: `Search error: ${err instanceof Error ? err.message : String(err)}`,
81
- isError: true,
82
- };
83
- }
84
- },
85
- };
86
-
87
- export const webReadTool: MCPTool = {
88
- name: 'web_read',
89
- description: 'Read and extract the main content from a web page URL. Returns clean markdown text. Use to get detailed information from a specific page.',
90
- inputSchema: {
91
- type: 'object',
92
- properties: {
93
- url: {
94
- type: 'string',
95
- description: 'URL of the web page to read',
96
- },
97
- maxLength: {
98
- type: 'number',
99
- description: 'Maximum content length in characters (default: 5000)',
100
- },
101
- },
102
- required: ['url'],
103
- },
104
-
105
- async execute(input: Record<string, unknown>): Promise<MCPToolResult> {
106
- const url = String(input.url ?? '');
107
- if (!url.trim()) {
108
- return { content: 'Error: empty URL', isError: true };
109
- }
110
-
111
- try {
112
- const result = await scrapeUrl(url, (input.maxLength as number) || 5000);
113
- return {
114
- content: `# ${result.title}\n\nSource: ${result.url}\nWords: ${result.wordCount}\n\n---\n\n${result.content}`,
115
- metadata: { title: result.title, url: result.url, wordCount: result.wordCount },
116
- };
117
- } catch (err) {
118
- return {
119
- content: `Scrape error: ${err instanceof Error ? err.message : String(err)}`,
120
- isError: true,
121
- };
122
- }
123
- },
124
- };
125
-
126
- export const webSearchTools: MCPTool[] = [webSearchTool, webReadTool];
@@ -1,35 +0,0 @@
1
- import type { MCPTool, MCPToolResult } from '../mcp';
2
-
3
- export const webTool: MCPTool = {
4
- name: 'web_fetch',
5
- description: 'Fetch content from a URL',
6
- inputSchema: {
7
- type: 'object',
8
- properties: {
9
- url: { type: 'string' },
10
- method: { type: 'string', enum: ['GET', 'POST'], default: 'GET' },
11
- maxLength: { type: 'number', default: 5000 },
12
- },
13
- required: ['url'],
14
- },
15
- async execute(input: Record<string, unknown>): Promise<MCPToolResult> {
16
- const url = input.url as string;
17
- const method = (input.method as string) || 'GET';
18
- const maxLength = (input.maxLength as number) || 5000;
19
-
20
- try {
21
- const response = await fetch(url, { method, signal: AbortSignal.timeout(15000) });
22
- const text = await response.text();
23
- const truncated = text.length > maxLength ? text.slice(0, maxLength) + '\n...[truncated]' : text;
24
- return {
25
- content: `Status: ${response.status}\n\n${truncated}`,
26
- isError: false,
27
- };
28
- } catch (err) {
29
- return {
30
- content: `Fetch error: ${err instanceof Error ? err.message : String(err)}`,
31
- isError: true,
32
- };
33
- }
34
- },
35
- };
@@ -1,73 +0,0 @@
1
- import type { MCPTool, MCPToolResult } from './mcp';
2
-
3
- /**
4
- * Calculator Tool — v0.8.0
5
- * Safe math expression evaluation as an LLM function tool.
6
- */
7
- export const CalculatorTool: MCPTool = {
8
- name: 'calculator',
9
- description: 'Evaluate a mathematical expression. Supports basic arithmetic, powers, sqrt, abs, min, max, round, ceil, floor, PI, E.',
10
- inputSchema: {
11
- type: 'object',
12
- properties: {
13
- expression: {
14
- type: 'string',
15
- description: 'Mathematical expression to evaluate, e.g. "2 + 3 * 4" or "sqrt(144) + PI"',
16
- },
17
- },
18
- required: ['expression'],
19
- },
20
-
21
- async execute(input: Record<string, unknown>): Promise<MCPToolResult> {
22
- const expr = String(input.expression ?? '');
23
- try {
24
- const result = safeEval(expr);
25
- return { content: String(result) };
26
- } catch (err) {
27
- return { content: `Error: ${(err as Error).message}`, isError: true };
28
- }
29
- },
30
- };
31
-
32
- /** Safe math evaluator — no eval(), no arbitrary code */
33
- function safeEval(expr: string): number {
34
- // Whitelist: digits, operators, parens, dots, commas, spaces, and known functions
35
- const sanitized = expr.replace(/\s+/g, '');
36
- const allowed = /^[0-9+\-*/().,%^a-zA-Z_]+$/;
37
- if (!allowed.test(sanitized)) {
38
- throw new Error('Invalid characters in expression');
39
- }
40
-
41
- // Replace known math functions/constants
42
- const prepared = sanitized
43
- .replace(/\bPI\b/gi, String(Math.PI))
44
- .replace(/\bE\b/g, String(Math.E))
45
- .replace(/\bsqrt\b/gi, 'Math.sqrt')
46
- .replace(/\babs\b/gi, 'Math.abs')
47
- .replace(/\bmin\b/gi, 'Math.min')
48
- .replace(/\bmax\b/gi, 'Math.max')
49
- .replace(/\bround\b/gi, 'Math.round')
50
- .replace(/\bceil\b/gi, 'Math.ceil')
51
- .replace(/\bfloor\b/gi, 'Math.floor')
52
- .replace(/\bpow\b/gi, 'Math.pow')
53
- .replace(/\blog\b/gi, 'Math.log')
54
- .replace(/\blog10\b/gi, 'Math.log10')
55
- .replace(/\bsin\b/gi, 'Math.sin')
56
- .replace(/\bcos\b/gi, 'Math.cos')
57
- .replace(/\btan\b/gi, 'Math.tan')
58
- .replace(/\^/g, '**');
59
-
60
- // Block anything that isn't math
61
- if (/[a-zA-Z_]/.test(prepared.replace(/Math\.\w+/g, ''))) {
62
- throw new Error('Unsupported function or variable in expression');
63
- }
64
-
65
- // Use Function constructor with restricted scope
66
- const fn = new Function('Math', `"use strict"; return (${prepared});`);
67
- const result = fn(Math);
68
-
69
- if (typeof result !== 'number' || !isFinite(result)) {
70
- throw new Error('Expression did not evaluate to a finite number');
71
- }
72
- return result;
73
- }