natureco-cli 5.18.3 → 5.20.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 (346) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/package.json +1 -1
  3. package/skills/a-b-testing/SKILL.md +34 -0
  4. package/skills/accessibility-audit/SKILL.md +34 -0
  5. package/skills/agent-memory/SKILL.md +34 -0
  6. package/skills/agent-orchestration/SKILL.md +34 -0
  7. package/skills/airunway-aks-setup/SKILL.md +73 -0
  8. package/skills/algorithmic-art/SKILL.md +405 -0
  9. package/skills/analytics-setup/SKILL.md +34 -0
  10. package/skills/api-design/SKILL.md +34 -0
  11. package/skills/api-versioning/SKILL.md +34 -0
  12. package/skills/appinsights-instrumentation/SKILL.md +76 -0
  13. package/skills/audio-transcription/SKILL.md +34 -0
  14. package/skills/authentication-patterns/SKILL.md +34 -0
  15. package/skills/authorization-rbac/SKILL.md +34 -0
  16. package/skills/azure-ai/SKILL.md +71 -0
  17. package/skills/azure-aigateway/SKILL.md +129 -0
  18. package/skills/azure-cloud-migrate/SKILL.md +52 -0
  19. package/skills/azure-compliance/SKILL.md +108 -0
  20. package/skills/azure-compute/SKILL.md +46 -0
  21. package/skills/azure-cost/SKILL.md +45 -0
  22. package/skills/azure-deploy/SKILL.md +97 -0
  23. package/skills/azure-diagnostics/SKILL.md +151 -0
  24. package/skills/azure-enterprise-infra-planner/SKILL.md +54 -0
  25. package/skills/azure-hosted-copilot-sdk/SKILL.md +89 -0
  26. package/skills/azure-kubernetes/SKILL.md +153 -0
  27. package/skills/azure-kusto/SKILL.md +231 -0
  28. package/skills/azure-messaging/SKILL.md +57 -0
  29. package/skills/azure-prepare/SKILL.md +165 -0
  30. package/skills/azure-quotas/SKILL.md +276 -0
  31. package/skills/azure-rbac/SKILL.md +17 -0
  32. package/skills/azure-reliability/SKILL.md +387 -0
  33. package/skills/azure-resource-lookup/SKILL.md +108 -0
  34. package/skills/azure-resource-visualizer/SKILL.md +183 -0
  35. package/skills/azure-storage/SKILL.md +100 -0
  36. package/skills/azure-upgrade/SKILL.md +91 -0
  37. package/skills/azure-validate/SKILL.md +72 -0
  38. package/skills/backup-strategy/SKILL.md +34 -0
  39. package/skills/bash-scripting/SKILL.md +34 -0
  40. package/skills/batch-api-calls/SKILL.md +34 -0
  41. package/skills/batch-processing/SKILL.md +34 -0
  42. package/skills/brainstorming/SKILL.md +159 -0
  43. package/skills/brand-guidelines/SKILL.md +73 -0
  44. package/skills/brandkit/SKILL.md +798 -0
  45. package/skills/brutalist-skill/SKILL.md +92 -0
  46. package/skills/bulk-file-operations/SKILL.md +34 -0
  47. package/skills/cache-responses/SKILL.md +34 -0
  48. package/skills/caching-strategy/SKILL.md +34 -0
  49. package/skills/calendar-optimization/SKILL.md +34 -0
  50. package/skills/canvas-design/SKILL.md +130 -0
  51. package/skills/cavecrew/SKILL.md +82 -0
  52. package/skills/caveman-commit/SKILL.md +65 -0
  53. package/skills/caveman-help/SKILL.md +63 -0
  54. package/skills/caveman-review/SKILL.md +55 -0
  55. package/skills/caveman-stats/SKILL.md +10 -0
  56. package/skills/changelog-generation/SKILL.md +34 -0
  57. package/skills/chat-bot-design/SKILL.md +34 -0
  58. package/skills/chunking-strategy/SKILL.md +34 -0
  59. package/skills/ci-cd-pipeline/SKILL.md +34 -0
  60. package/skills/classification-pipeline/SKILL.md +34 -0
  61. package/skills/claude-api/SKILL.md +356 -0
  62. package/skills/clipboard-master/SKILL.md +34 -0
  63. package/skills/code-explanation/SKILL.md +34 -0
  64. package/skills/code-generation/SKILL.md +34 -0
  65. package/skills/code-migration/SKILL.md +34 -0
  66. package/skills/code-review-checklist/SKILL.md +34 -0
  67. package/skills/composition-patterns/SKILL.md +89 -0
  68. package/skills/contact-management/SKILL.md +34 -0
  69. package/skills/content-generation/SKILL.md +34 -0
  70. package/skills/context-pruning/SKILL.md +34 -0
  71. package/skills/context-window-management/SKILL.md +34 -0
  72. package/skills/continuous-improvement/SKILL.md +34 -0
  73. package/skills/cron-scheduling/SKILL.md +34 -0
  74. package/skills/cross-platform-compat/SKILL.md +34 -0
  75. package/skills/csv-processing/SKILL.md +34 -0
  76. package/skills/daily-journal/SKILL.md +34 -0
  77. package/skills/data-analysis/SKILL.md +34 -0
  78. package/skills/data-backup/SKILL.md +34 -0
  79. package/skills/data-cleaning/SKILL.md +34 -0
  80. package/skills/data-extraction/SKILL.md +34 -0
  81. package/skills/data-validation/SKILL.md +34 -0
  82. package/skills/database-migrations/SKILL.md +34 -0
  83. package/skills/database-schema-design/SKILL.md +34 -0
  84. package/skills/decision-mapping/SKILL.md +84 -0
  85. package/skills/decision-matrix/SKILL.md +34 -0
  86. package/skills/dependency-management/SKILL.md +34 -0
  87. package/skills/deploy-to-vercel/SKILL.md +296 -0
  88. package/skills/design-an-interface/SKILL.md +94 -0
  89. package/skills/design-doc-mermaid/SKILL.md +498 -0
  90. package/skills/dev-environment-setup/SKILL.md +34 -0
  91. package/skills/develop-userscripts/SKILL.md +84 -0
  92. package/skills/distraction-blocker/SKILL.md +34 -0
  93. package/skills/doc-coauthoring/SKILL.md +375 -0
  94. package/skills/docker-optimization/SKILL.md +34 -0
  95. package/skills/document-template/SKILL.md +34 -0
  96. package/skills/documentation/SKILL.md +109 -0
  97. package/skills/documentation-gen/SKILL.md +34 -0
  98. package/skills/docx/SKILL.md +590 -0
  99. package/skills/edit-article/SKILL.md +15 -0
  100. package/skills/efficient-formatting/SKILL.md +34 -0
  101. package/skills/email-management/SKILL.md +34 -0
  102. package/skills/email-service/SKILL.md +34 -0
  103. package/skills/embedding-generation/SKILL.md +34 -0
  104. package/skills/entity-extraction/SKILL.md +34 -0
  105. package/skills/entra-agent-id/SKILL.md +356 -0
  106. package/skills/entra-app-registration/SKILL.md +191 -0
  107. package/skills/environment-config/SKILL.md +34 -0
  108. package/skills/error-handling/SKILL.md +34 -0
  109. package/skills/estimation-techniques/SKILL.md +34 -0
  110. package/skills/event-driven-architecture/SKILL.md +34 -0
  111. package/skills/excel-automation/SKILL.md +34 -0
  112. package/skills/execution-monitoring/SKILL.md +34 -0
  113. package/skills/expense-tracking/SKILL.md +34 -0
  114. package/skills/faceless-explainer/SKILL.md +202 -0
  115. package/skills/fastify/SKILL.md +75 -0
  116. package/skills/feature-engineering/SKILL.md +34 -0
  117. package/skills/feature-flags/SKILL.md +34 -0
  118. package/skills/file-conversion/SKILL.md +34 -0
  119. package/skills/file-upload-handling/SKILL.md +34 -0
  120. package/skills/fine-tuning-prep/SKILL.md +34 -0
  121. package/skills/focus-mode/SKILL.md +34 -0
  122. package/skills/form-validation/SKILL.md +34 -0
  123. package/skills/function-calling/SKILL.md +34 -0
  124. package/skills/general-video/SKILL.md +143 -0
  125. package/skills/git-guardrails-claude-code/SKILL.md +95 -0
  126. package/skills/git-workflow/SKILL.md +34 -0
  127. package/skills/github-actions-docs/SKILL.md +98 -0
  128. package/skills/goal-setting/SKILL.md +34 -0
  129. package/skills/gpt-tasteskill/SKILL.md +74 -0
  130. package/skills/graphql-design/SKILL.md +34 -0
  131. package/skills/grill-me/SKILL.md +7 -0
  132. package/skills/grilling/SKILL.md +10 -0
  133. package/skills/habit-tracker/SKILL.md +34 -0
  134. package/skills/hallucination-detection/SKILL.md +34 -0
  135. package/skills/handoff/SKILL.md +16 -0
  136. package/skills/hyperframes/SKILL.md +152 -0
  137. package/skills/hyperframes-animation/SKILL.md +82 -0
  138. package/skills/hyperframes-cli/SKILL.md +109 -0
  139. package/skills/hyperframes-core/SKILL.md +78 -0
  140. package/skills/hyperframes-creative/SKILL.md +68 -0
  141. package/skills/hyperframes-media/SKILL.md +97 -0
  142. package/skills/image-processing/SKILL.md +34 -0
  143. package/skills/image-to-code-skill/SKILL.md +1228 -0
  144. package/skills/imagegen-frontend-mobile/SKILL.md +1465 -0
  145. package/skills/imagegen-frontend-web/SKILL.md +987 -0
  146. package/skills/implement/SKILL.md +15 -0
  147. package/skills/init/SKILL.md +91 -0
  148. package/skills/internal-comms/SKILL.md +32 -0
  149. package/skills/json-transformation/SKILL.md +34 -0
  150. package/skills/keyboard-shortcuts/SKILL.md +34 -0
  151. package/skills/knowledge-base/SKILL.md +34 -0
  152. package/skills/knowledge-graph/SKILL.md +34 -0
  153. package/skills/kubernetes-deployment/SKILL.md +34 -0
  154. package/skills/language-translation/SKILL.md +34 -0
  155. package/skills/lark-approval/SKILL.md +56 -0
  156. package/skills/lark-base/SKILL.md +157 -0
  157. package/skills/lark-doc/SKILL.md +81 -0
  158. package/skills/lark-shared/SKILL.md +168 -0
  159. package/skills/lark-workflow-meeting-summary/SKILL.md +122 -0
  160. package/skills/linting-neostandard-eslint9/SKILL.md +64 -0
  161. package/skills/llm-chaining/SKILL.md +34 -0
  162. package/skills/localization-i18n/SKILL.md +34 -0
  163. package/skills/logging-best-practices/SKILL.md +34 -0
  164. package/skills/loop-me/SKILL.md +32 -0
  165. package/skills/machine-learning-pipeline/SKILL.md +34 -0
  166. package/skills/meeting-notes/SKILL.md +34 -0
  167. package/skills/meeting-scheduler/SKILL.md +34 -0
  168. package/skills/message-queues/SKILL.md +34 -0
  169. package/skills/message-summarization/SKILL.md +34 -0
  170. package/skills/microservices-architecture/SKILL.md +34 -0
  171. package/skills/microsoft-foundry/SKILL.md +262 -0
  172. package/skills/migrate-to-shoehorn/SKILL.md +118 -0
  173. package/skills/milestone-tracking/SKILL.md +34 -0
  174. package/skills/minimalist-skill/SKILL.md +85 -0
  175. package/skills/model-deployment/SKILL.md +34 -0
  176. package/skills/model-evaluation/SKILL.md +34 -0
  177. package/skills/monitoring-setup/SKILL.md +34 -0
  178. package/skills/monorepo-setup/SKILL.md +34 -0
  179. package/skills/motion-graphics/SKILL.md +170 -0
  180. package/skills/multi-agent-systems/SKILL.md +34 -0
  181. package/skills/music-to-video/SKILL.md +197 -0
  182. package/skills/network-troubleshooting/SKILL.md +34 -0
  183. package/skills/node/SKILL.md +94 -0
  184. package/skills/nodejs-core/SKILL.md +156 -0
  185. package/skills/note-organization/SKILL.md +34 -0
  186. package/skills/oauth/SKILL.md +186 -0
  187. package/skills/obsidian-vault/SKILL.md +59 -0
  188. package/skills/octocat/SKILL.md +93 -0
  189. package/skills/openclaw-secure-linux-cloud/SKILL.md +157 -0
  190. package/skills/opensource-guide-coach/SKILL.md +218 -0
  191. package/skills/output-skill/SKILL.md +49 -0
  192. package/skills/package-publishing/SKILL.md +34 -0
  193. package/skills/password-generator/SKILL.md +34 -0
  194. package/skills/pdf/SKILL.md +314 -0
  195. package/skills/pdf-processing/SKILL.md +34 -0
  196. package/skills/performance-optimization/SKILL.md +34 -0
  197. package/skills/pomodoro-timer/SKILL.md +34 -0
  198. package/skills/powershell-automation/SKILL.md +34 -0
  199. package/skills/pptx/SKILL.md +232 -0
  200. package/skills/pr-to-video/SKILL.md +235 -0
  201. package/skills/priority-filtering/SKILL.md +34 -0
  202. package/skills/product-launch-video/SKILL.md +205 -0
  203. package/skills/project-tracking/SKILL.md +34 -0
  204. package/skills/prompt-compression/SKILL.md +34 -0
  205. package/skills/prompt-engineering/SKILL.md +34 -0
  206. package/skills/push-notifications/SKILL.md +34 -0
  207. package/skills/python-appservice-deploy/SKILL.md +36 -0
  208. package/skills/qa/SKILL.md +130 -0
  209. package/skills/rag-implementation/SKILL.md +34 -0
  210. package/skills/rate-limiting/SKILL.md +34 -0
  211. package/skills/react-best-practices/SKILL.md +149 -0
  212. package/skills/react-native-skills/SKILL.md +121 -0
  213. package/skills/react-view-transitions/SKILL.md +320 -0
  214. package/skills/readme-i18n/SKILL.md +176 -0
  215. package/skills/real-time-communication/SKILL.md +34 -0
  216. package/skills/redesign-skill/SKILL.md +178 -0
  217. package/skills/refactoring-strategy/SKILL.md +34 -0
  218. package/skills/regex-mastery/SKILL.md +34 -0
  219. package/skills/remotion/SKILL.md +364 -0
  220. package/skills/report-generation/SKILL.md +34 -0
  221. package/skills/request-refactor-plan/SKILL.md +68 -0
  222. package/skills/research-compiler/SKILL.md +34 -0
  223. package/skills/resolving-merge-conflicts/SKILL.md +14 -0
  224. package/skills/responsive-design/SKILL.md +34 -0
  225. package/skills/rest-api-patterns/SKILL.md +34 -0
  226. package/skills/retrospectives/SKILL.md +34 -0
  227. package/skills/risk-assessment/SKILL.md +34 -0
  228. package/skills/roadmap-creation/SKILL.md +34 -0
  229. package/skills/running-claude-code-via-litellm-copilot/SKILL.md +263 -0
  230. package/skills/scaffold-exercises/SKILL.md +106 -0
  231. package/skills/search-implementation/SKILL.md +34 -0
  232. package/skills/secrets-management/SKILL.md +34 -0
  233. package/skills/secure-linux-web-hosting/SKILL.md +162 -0
  234. package/skills/security-audit/SKILL.md +34 -0
  235. package/skills/selective-memory/SKILL.md +34 -0
  236. package/skills/semantic-search/SKILL.md +34 -0
  237. package/skills/semantic-versioning/SKILL.md +34 -0
  238. package/skills/sentiment-analysis/SKILL.md +34 -0
  239. package/skills/seo-optimization/SKILL.md +34 -0
  240. package/skills/setup-pre-commit/SKILL.md +91 -0
  241. package/skills/shadcn/SKILL.md +267 -0
  242. package/skills/simple/SKILL.md +52 -0
  243. package/skills/skill-creator/SKILL.md +485 -0
  244. package/skills/skill-optimizer/SKILL.md +47 -0
  245. package/skills/skills-cli/SKILL.md +281 -0
  246. package/skills/slack-gif-creator/SKILL.md +254 -0
  247. package/skills/snipgrapher/SKILL.md +58 -0
  248. package/skills/snippet-manager/SKILL.md +34 -0
  249. package/skills/soft-skill/SKILL.md +98 -0
  250. package/skills/sprint-planning/SKILL.md +34 -0
  251. package/skills/sql-query-optimization/SKILL.md +34 -0
  252. package/skills/stakeholder-communication/SKILL.md +34 -0
  253. package/skills/state-management/SKILL.md +34 -0
  254. package/skills/statistical-analysis/SKILL.md +34 -0
  255. package/skills/stitch-skill/SKILL.md +184 -0
  256. package/skills/streaming-responses/SKILL.md +34 -0
  257. package/skills/structured-output/SKILL.md +34 -0
  258. package/skills/summarization-techniques/SKILL.md +34 -0
  259. package/skills/supabase/SKILL.md +135 -0
  260. package/skills/supabase-postgres-best-practices/SKILL.md +64 -0
  261. package/skills/system-diagnostics/SKILL.md +34 -0
  262. package/skills/systematic-debugging/SKILL.md +296 -0
  263. package/skills/talking-head-recut/SKILL.md +1191 -0
  264. package/skills/task-decomposition/SKILL.md +34 -0
  265. package/skills/task-prioritization/SKILL.md +34 -0
  266. package/skills/taste-skill/SKILL.md +1206 -0
  267. package/skills/taste-skill-v1/SKILL.md +226 -0
  268. package/skills/tdd/SKILL.md +108 -0
  269. package/skills/teach/SKILL.md +140 -0
  270. package/skills/template-library/SKILL.md +34 -0
  271. package/skills/test-driven-development/SKILL.md +371 -0
  272. package/skills/test-generation/SKILL.md +34 -0
  273. package/skills/testing-strategy/SKILL.md +34 -0
  274. package/skills/text-expansion/SKILL.md +34 -0
  275. package/skills/theme-factory/SKILL.md +59 -0
  276. package/skills/time-blocking/SKILL.md +34 -0
  277. package/skills/to-prd/SKILL.md +75 -0
  278. package/skills/token-budgeting/SKILL.md +34 -0
  279. package/skills/token-optimization/SKILL.md +34 -0
  280. package/skills/tool-calling-patterns/SKILL.md +34 -0
  281. package/skills/typescript-magician/SKILL.md +117 -0
  282. package/skills/tzst/SKILL.md +68 -0
  283. package/skills/ubiquitous-language/SKILL.md +93 -0
  284. package/skills/use-my-browser/SKILL.md +110 -0
  285. package/skills/using-superpowers/SKILL.md +121 -0
  286. package/skills/vector-database-setup/SKILL.md +34 -0
  287. package/skills/vercel-cli-with-tokens/SKILL.md +353 -0
  288. package/skills/vercel-optimize/SKILL.md +322 -0
  289. package/skills/video-editing/SKILL.md +34 -0
  290. package/skills/viral-instagram-reels/SKILL.md +180 -0
  291. package/skills/viral-short-form/SKILL.md +147 -0
  292. package/skills/viral-short-form-ideas/SKILL.md +184 -0
  293. package/skills/viral-tiktok-content/SKILL.md +180 -0
  294. package/skills/visualization-creation/SKILL.md +34 -0
  295. package/skills/web-artifacts-builder/SKILL.md +74 -0
  296. package/skills/web-design-guidelines/SKILL.md +39 -0
  297. package/skills/web-scraping/SKILL.md +34 -0
  298. package/skills/webapp-testing/SKILL.md +96 -0
  299. package/skills/webhook-handling/SKILL.md +34 -0
  300. package/skills/website-to-video/SKILL.md +145 -0
  301. package/skills/weekly-review/SKILL.md +34 -0
  302. package/skills/workflow-automation/SKILL.md +34 -0
  303. package/skills/writing-beats/SKILL.md +67 -0
  304. package/skills/writing-fragments/SKILL.md +79 -0
  305. package/skills/writing-great-skills/SKILL.md +82 -0
  306. package/skills/writing-guidelines/SKILL.md +39 -0
  307. package/skills/writing-plans/SKILL.md +174 -0
  308. package/skills/writing-shape/SKILL.md +79 -0
  309. package/skills/xdrop/SKILL.md +78 -0
  310. package/skills/xget/SKILL.md +87 -0
  311. package/skills/xlsx/SKILL.md +292 -0
  312. package/src/commands/code_v5.js +377 -73
  313. package/src/commands/repl.js +505 -86
  314. package/src/providers/model/anthropic.js +84 -0
  315. package/src/providers/model/gemini.js +49 -0
  316. package/src/providers/model/minimax.js +48 -0
  317. package/src/providers/model/ollama.js +42 -0
  318. package/src/providers/model/openai.js +49 -0
  319. package/src/providers/search/duckduckgo.js +45 -0
  320. package/src/providers/search/exa.js +52 -0
  321. package/src/providers/search/searxng.js +51 -0
  322. package/src/providers/search/tavily.js +47 -0
  323. package/src/tools/model_provider.js +71 -0
  324. package/src/tools/parallel_search.js +40 -49
  325. package/src/tools/search_provider.js +79 -0
  326. package/src/tools/skills_download.js +217 -0
  327. package/src/tools/web_search.js +42 -62
  328. package/src/tools/workflow.js +21 -9
  329. package/src/utils/cron.js +82 -126
  330. package/src/utils/effort-levels.js +42 -0
  331. package/src/utils/fallback-chain.js +72 -0
  332. package/src/utils/file-history.js +78 -0
  333. package/src/utils/model-provider.js +113 -0
  334. package/src/utils/permissions.js +147 -0
  335. package/src/utils/plan-mode.js +164 -0
  336. package/src/utils/provider-detect.js +7 -32
  337. package/src/utils/sandbox.js +60 -0
  338. package/src/utils/search-provider.js +62 -0
  339. package/src/utils/session-search.js +66 -0
  340. package/src/utils/structured-output.js +20 -0
  341. package/src/utils/system-prompt.js +28 -2
  342. package/src/utils/tasks.js +132 -0
  343. package/src/utils/tool-hooks.js +154 -0
  344. package/src/utils/tools.js +18 -2
  345. package/src/utils/ultra-review.js +59 -0
  346. package/src/utils/worktree.js +192 -0
@@ -0,0 +1,84 @@
1
+ const { ModelProvider, registerProvider, DEFAULT_ANTHROPIC_SYSTEM } = require('../../utils/model-provider');
2
+
3
+ class AnthropicProvider extends ModelProvider {
4
+ constructor(config = {}) {
5
+ super(config);
6
+ this.name = 'anthropic';
7
+ }
8
+
9
+ getEndpoint() {
10
+ const base = (this.config.providerUrl || '').replace(/\/+$/, '');
11
+ return `${base}/v1/messages`;
12
+ }
13
+
14
+ extractSystem(messages) {
15
+ const systemMsg = messages.find(m => m.role === 'system');
16
+ if (!systemMsg) return DEFAULT_ANTHROPIC_SYSTEM;
17
+ const content = systemMsg.content;
18
+ if (typeof content === 'string' && content.trim()) return content;
19
+ if (Array.isArray(content) && content.length > 0) return content;
20
+ return DEFAULT_ANTHROPIC_SYSTEM;
21
+ }
22
+
23
+ buildRequest(messages, options = {}) {
24
+ const userMsgs = messages.filter(m => m.role !== 'system');
25
+ return {
26
+ model: this.config.providerModel || 'claude-3-5-haiku-20241022',
27
+ messages: userMsgs.map(m => ({ role: m.role, content: m.content })),
28
+ system: this.extractSystem(messages),
29
+ max_tokens: options.max_tokens || 4096,
30
+ temperature: options.temperature ?? 0.7,
31
+ stream: options.stream || false,
32
+ ...(options.tools?.length > 0 ? { tools: options.tools } : {}),
33
+ };
34
+ }
35
+
36
+ parseResponse(data) {
37
+ const textContent = data.content?.find(c => c.type === 'text')?.text || '';
38
+ const toolCalls = data.content
39
+ ?.filter(c => c.type === 'tool_use')
40
+ ?.map(c => ({
41
+ id: c.id,
42
+ type: 'function',
43
+ function: { name: c.name, arguments: JSON.stringify(c.input || {}) },
44
+ })) || [];
45
+ return {
46
+ role: 'assistant',
47
+ content: textContent,
48
+ tool_calls: toolCalls.length > 0 ? toolCalls : undefined,
49
+ usage: data.usage || undefined,
50
+ };
51
+ }
52
+
53
+ normalizeTools(tools) {
54
+ return (tools || []).map(t => ({
55
+ name: t.name || t.function?.name,
56
+ description: t.description || t.function?.description || '',
57
+ input_schema: t.inputSchema || t.input_schema || t.function?.parameters || { type: 'object', properties: {} },
58
+ }));
59
+ }
60
+
61
+ parseToolCalls(message) {
62
+ if (Array.isArray(message.content)) {
63
+ return message.content
64
+ .filter(c => c.type === 'tool_use')
65
+ .map(c => ({
66
+ id: c.id,
67
+ type: 'function',
68
+ function: { name: c.name, arguments: JSON.stringify(c.input || {}) },
69
+ }));
70
+ }
71
+ return [];
72
+ }
73
+
74
+ getAuthHeaders() {
75
+ return {
76
+ 'x-api-key': this.config.providerApiKey || '',
77
+ 'anthropic-version': '2023-06-01',
78
+ 'Content-Type': 'application/json',
79
+ };
80
+ }
81
+ }
82
+
83
+ registerProvider('anthropic', AnthropicProvider);
84
+ module.exports = AnthropicProvider;
@@ -0,0 +1,49 @@
1
+ const { ModelProvider, registerProvider } = require('../../utils/model-provider');
2
+
3
+ class GeminiProvider extends ModelProvider {
4
+ constructor(config = {}) {
5
+ super(config);
6
+ this.name = 'gemini';
7
+ }
8
+
9
+ getEndpoint() {
10
+ const base = (this.config.providerUrl || '').replace(/\/+$/, '');
11
+ return `${base}/openai/chat/completions`;
12
+ }
13
+
14
+ buildRequest(messages, options = {}) {
15
+ return {
16
+ model: this.config.providerModel || 'gemini-2.0-flash',
17
+ messages,
18
+ max_tokens: options.max_tokens || 4096,
19
+ temperature: options.temperature ?? 0.7,
20
+ stream: options.stream || false,
21
+ ...(options.tools?.length > 0 ? { tools: options.tools, tool_choice: 'auto' } : {}),
22
+ };
23
+ }
24
+
25
+ parseResponse(data) {
26
+ const choice = data.choices?.[0];
27
+ if (!choice) return { role: 'assistant', content: '' };
28
+ return {
29
+ role: 'assistant',
30
+ content: choice.message?.content || choice.text || '',
31
+ tool_calls: choice.message?.tool_calls || undefined,
32
+ usage: data.usage || undefined,
33
+ };
34
+ }
35
+
36
+ normalizeTools(tools) {
37
+ return (tools || []).map(t => ({
38
+ type: 'function',
39
+ function: {
40
+ name: t.name || t.function?.name,
41
+ description: t.description || t.function?.description || '',
42
+ parameters: t.inputSchema || t.input_schema || t.function?.parameters || { type: 'object', properties: {} },
43
+ },
44
+ }));
45
+ }
46
+ }
47
+
48
+ registerProvider('gemini', GeminiProvider);
49
+ module.exports = GeminiProvider;
@@ -0,0 +1,48 @@
1
+ const { ModelProvider, registerProvider } = require('../../utils/model-provider');
2
+
3
+ class MiniMaxProvider extends ModelProvider {
4
+ constructor(config = {}) {
5
+ super(config);
6
+ this.name = 'minimax';
7
+ }
8
+
9
+ getEndpoint() {
10
+ const base = (this.config.providerUrl || '').replace(/\/+$/, '');
11
+ return `${base}/v1/text/chatcompletion_v2`;
12
+ }
13
+
14
+ buildRequest(messages, options = {}) {
15
+ return {
16
+ model: this.config.providerModel || 'minimax-m2.5',
17
+ messages,
18
+ max_tokens: options.max_tokens || 4096,
19
+ temperature: options.temperature ?? 0.7,
20
+ stream: options.stream || false,
21
+ ...(options.tools?.length > 0 ? { tools: options.tools, tool_choice: 'auto' } : {}),
22
+ };
23
+ }
24
+
25
+ parseResponse(data) {
26
+ const choice = data.choices?.[0] || data.base_resp || {};
27
+ return {
28
+ role: 'assistant',
29
+ content: choice.message?.content || choice.text || data.reply || '',
30
+ tool_calls: choice.message?.tool_calls || undefined,
31
+ usage: data.usage || undefined,
32
+ };
33
+ }
34
+
35
+ normalizeTools(tools) {
36
+ return (tools || []).map(t => ({
37
+ type: 'function',
38
+ function: {
39
+ name: t.name || t.function?.name,
40
+ description: t.description || t.function?.description || '',
41
+ parameters: t.inputSchema || t.input_schema || t.function?.parameters || { type: 'object', properties: {} },
42
+ },
43
+ }));
44
+ }
45
+ }
46
+
47
+ registerProvider('minimax', MiniMaxProvider);
48
+ module.exports = MiniMaxProvider;
@@ -0,0 +1,42 @@
1
+ const { ModelProvider, registerProvider } = require('../../utils/model-provider');
2
+
3
+ class OllamaProvider extends ModelProvider {
4
+ constructor(config = {}) {
5
+ super(config);
6
+ this.name = 'ollama';
7
+ }
8
+
9
+ getEndpoint() {
10
+ const base = (this.config.providerUrl || '').replace(/\/+$/, '');
11
+ return `${base}/chat/completions`;
12
+ }
13
+
14
+ buildRequest(messages, options = {}) {
15
+ return {
16
+ model: this.config.providerModel || 'llama3.2',
17
+ messages,
18
+ max_tokens: options.max_tokens || 4096,
19
+ temperature: options.temperature ?? 0.7,
20
+ stream: options.stream || false,
21
+ ...(options.tools?.length > 0 ? { tools: options.tools, tool_choice: 'auto' } : {}),
22
+ };
23
+ }
24
+
25
+ parseResponse(data) {
26
+ const choice = data.choices?.[0];
27
+ if (!choice) return { role: 'assistant', content: data.response || '' };
28
+ return {
29
+ role: 'assistant',
30
+ content: choice.message?.content || choice.text || data.response || '',
31
+ tool_calls: choice.message?.tool_calls || undefined,
32
+ usage: data.usage || undefined,
33
+ };
34
+ }
35
+
36
+ normalizeTools(tools) {
37
+ return [];
38
+ }
39
+ }
40
+
41
+ registerProvider('ollama', OllamaProvider);
42
+ module.exports = OllamaProvider;
@@ -0,0 +1,49 @@
1
+ const { ModelProvider, registerProvider, DEFAULT_ANTHROPIC_SYSTEM } = require('../../utils/model-provider');
2
+
3
+ class OpenAIProvider extends ModelProvider {
4
+ constructor(config = {}) {
5
+ super(config);
6
+ this.name = 'openai';
7
+ }
8
+
9
+ getEndpoint() {
10
+ const base = (this.config.providerUrl || '').replace(/\/+$/, '');
11
+ return `${base}/chat/completions`;
12
+ }
13
+
14
+ buildRequest(messages, options = {}) {
15
+ return {
16
+ model: this.config.providerModel || 'gpt-4o-mini',
17
+ messages,
18
+ max_tokens: options.max_tokens || 4096,
19
+ temperature: options.temperature ?? 0.7,
20
+ stream: options.stream || false,
21
+ ...(options.tools?.length > 0 ? { tools: options.tools, tool_choice: 'auto' } : {}),
22
+ };
23
+ }
24
+
25
+ parseResponse(data) {
26
+ const choice = data.choices?.[0];
27
+ if (!choice) return { role: 'assistant', content: data.response || data.content || '' };
28
+ return {
29
+ role: 'assistant',
30
+ content: choice.message?.content || choice.text || '',
31
+ tool_calls: choice.message?.tool_calls || undefined,
32
+ usage: data.usage || undefined,
33
+ };
34
+ }
35
+
36
+ normalizeTools(tools) {
37
+ return (tools || []).map(t => ({
38
+ type: 'function',
39
+ function: {
40
+ name: t.name || t.function?.name,
41
+ description: t.description || t.function?.description || '',
42
+ parameters: t.inputSchema || t.input_schema || t.function?.parameters || { type: 'object', properties: {} },
43
+ },
44
+ }));
45
+ }
46
+ }
47
+
48
+ registerProvider('openai', OpenAIProvider);
49
+ module.exports = OpenAIProvider;
@@ -0,0 +1,45 @@
1
+ const { SearchProvider, registerProvider } = require('../../utils/search-provider');
2
+
3
+ class DuckDuckGoProvider extends SearchProvider {
4
+ constructor(config = {}) {
5
+ super(config);
6
+ this.name = 'duckduckgo';
7
+ }
8
+
9
+ async search(query, options = {}) {
10
+ const maxResults = options.maxResults || 5;
11
+ const encoded = encodeURIComponent(query);
12
+
13
+ const response = await fetch(
14
+ `https://html.duckduckgo.com/html/?q=${encoded}`,
15
+ { headers: { 'User-Agent': 'NatureCo-CLI/2.0' } }
16
+ );
17
+
18
+ if (!response.ok) {
19
+ return { success: false, error: `DuckDuckGo error: ${response.status}`, provider: this.name };
20
+ }
21
+
22
+ const html = await response.text();
23
+ const results = [];
24
+ const resultRegex = /<a rel="nofollow" class="result__a" href="([^"]+)"[^>]*>([\s\S]*?)<\/a>[\s\S]*?<a class="result__snippet"[^>]*>([\s\S]*?)<\/a>/gi;
25
+ let match;
26
+ while ((match = resultRegex.exec(html)) !== null && results.length < maxResults) {
27
+ results.push({
28
+ title: match[2].replace(/<[^>]+>/g, '').trim(),
29
+ snippet: match[3].replace(/<[^>]+>/g, '').trim(),
30
+ url: match[1],
31
+ });
32
+ }
33
+
34
+ return {
35
+ success: true,
36
+ query,
37
+ results,
38
+ count: results.length,
39
+ provider: this.name,
40
+ };
41
+ }
42
+ }
43
+
44
+ registerProvider('duckduckgo', DuckDuckGoProvider);
45
+ module.exports = DuckDuckGoProvider;
@@ -0,0 +1,52 @@
1
+ const { SearchProvider, registerProvider } = require('../../utils/search-provider');
2
+
3
+ class ExaProvider extends SearchProvider {
4
+ constructor(config = {}) {
5
+ super(config);
6
+ this.name = 'exa';
7
+ }
8
+
9
+ async search(query, options = {}) {
10
+ const apiKey = this.config.exaApiKey || process.env.EXA_API_KEY;
11
+ if (!apiKey) {
12
+ return { success: false, error: 'Exa API key gerekli. Kur: natureco config set exaApiKey <key>', provider: this.name };
13
+ }
14
+
15
+ const response = await fetch('https://api.exa.ai/search', {
16
+ method: 'POST',
17
+ headers: { 'Content-Type': 'application/json', 'x-api-key': apiKey },
18
+ body: JSON.stringify({
19
+ query,
20
+ type: options.type || 'auto',
21
+ numResults: options.maxResults || 5,
22
+ includeTerms: options.includeTerms,
23
+ excludeTerms: options.excludeTerms,
24
+ }),
25
+ });
26
+
27
+ if (!response.ok) {
28
+ const err = await response.text().catch(() => '');
29
+ return { success: false, error: `Exa error ${response.status}: ${err}`, provider: this.name };
30
+ }
31
+
32
+ const data = await response.json();
33
+ const results = (data.results || []).map(r => ({
34
+ title: r.title,
35
+ snippet: r.text,
36
+ url: r.url,
37
+ score: r.score,
38
+ publishedDate: r.publishedDate,
39
+ }));
40
+
41
+ return {
42
+ success: true,
43
+ query,
44
+ results,
45
+ count: results.length,
46
+ provider: this.name,
47
+ };
48
+ }
49
+ }
50
+
51
+ registerProvider('exa', ExaProvider);
52
+ module.exports = ExaProvider;
@@ -0,0 +1,51 @@
1
+ const { SearchProvider, registerProvider } = require('../../utils/search-provider');
2
+
3
+ class SearXNGProvider extends SearchProvider {
4
+ constructor(config = {}) {
5
+ super(config);
6
+ this.name = 'searxng';
7
+ }
8
+
9
+ async search(query, options = {}) {
10
+ const instanceUrl = (options.instanceUrl || this.config.searxngInstanceUrl || 'https://search.sapti.me').replace(/\/+$/, '');
11
+ const maxResults = options.maxResults || 5;
12
+
13
+ const searchParams = new URLSearchParams({
14
+ q: query,
15
+ format: 'json',
16
+ language: 'en',
17
+ categories: options.categories || 'general',
18
+ pageno: 1,
19
+ });
20
+
21
+ const response = await fetch(`${instanceUrl}/search?${searchParams}`, {
22
+ headers: { 'User-Agent': 'NatureCo-CLI/2.0', 'Accept': 'application/json' },
23
+ });
24
+
25
+ if (!response.ok) {
26
+ return { success: false, error: `SearXNG error: ${response.status}`, provider: this.name };
27
+ }
28
+
29
+ const data = await response.json();
30
+ const raw = (data.results || []).slice(0, maxResults);
31
+ const results = raw.map(r => ({
32
+ title: r.title,
33
+ snippet: r.content,
34
+ url: r.url,
35
+ engine: r.engine,
36
+ category: r.category,
37
+ }));
38
+
39
+ return {
40
+ success: true,
41
+ query,
42
+ instance: instanceUrl,
43
+ results,
44
+ count: results.length,
45
+ provider: this.name,
46
+ };
47
+ }
48
+ }
49
+
50
+ registerProvider('searxng', SearXNGProvider);
51
+ module.exports = SearXNGProvider;
@@ -0,0 +1,47 @@
1
+ const { SearchProvider, registerProvider } = require('../../utils/search-provider');
2
+
3
+ class TavilyProvider extends SearchProvider {
4
+ constructor(config = {}) {
5
+ super(config);
6
+ this.name = 'tavily';
7
+ }
8
+
9
+ async search(query, options = {}) {
10
+ const apiKey = this.config.tavilyApiKey || process.env.TAVILY_API_KEY;
11
+ if (!apiKey) {
12
+ return { success: false, error: 'Tavily API key gerekli. Kur: natureco config set tavilyApiKey tvly_xxx', provider: this.name };
13
+ }
14
+
15
+ const response = await fetch('https://api.tavily.com/search', {
16
+ method: 'POST',
17
+ headers: { 'Content-Type': 'application/json' },
18
+ body: JSON.stringify({
19
+ api_key: apiKey,
20
+ query,
21
+ search_depth: options.searchDepth || 'basic',
22
+ max_results: options.maxResults || 5,
23
+ }),
24
+ });
25
+
26
+ if (!response.ok) {
27
+ return { success: false, error: `Tavily API error: ${response.status}`, provider: this.name };
28
+ }
29
+
30
+ const data = await response.json();
31
+ if (data.error) {
32
+ return { success: false, error: data.error, provider: this.name };
33
+ }
34
+
35
+ const results = this.normalizeResults(data.results || []);
36
+ return {
37
+ success: true,
38
+ query,
39
+ results,
40
+ count: results.length,
41
+ provider: this.name,
42
+ };
43
+ }
44
+ }
45
+
46
+ registerProvider('tavily', TavilyProvider);
47
+ module.exports = TavilyProvider;
@@ -0,0 +1,71 @@
1
+ require('../providers/model/openai');
2
+ require('../providers/model/anthropic');
3
+ require('../providers/model/gemini');
4
+ require('../providers/model/minimax');
5
+ require('../providers/model/ollama');
6
+
7
+ const name = 'model_provider';
8
+ const description = 'Model provider management. status/switch/list — view or switch between model providers (openai, anthropic, gemini, minimax, ollama). Also supports model-specific queries.';
9
+ const parameters = {
10
+ type: 'object',
11
+ properties: {
12
+ action: {
13
+ type: 'string',
14
+ enum: ['status', 'list', 'switch'],
15
+ description: 'Operation: status, list, or switch',
16
+ },
17
+ provider: { type: 'string', description: '(switch) Provider name to switch to' },
18
+ model: { type: 'string', description: '(switch) Model to use with provider' },
19
+ },
20
+ required: ['action'],
21
+ };
22
+
23
+ async function execute(params) {
24
+ const fs = require('fs');
25
+ const path = require('path');
26
+ const os = require('os');
27
+ const cfg = (() => { try { return JSON.parse(fs.readFileSync(path.join(os.homedir(), '.natureco', 'config.json'), 'utf8')); } catch { return {}; } })();
28
+ const { getProviderNames, getProvider, resolveProviderConfig, detectFamily } = require('../utils/model-provider');
29
+
30
+ switch (params.action) {
31
+ case 'status': {
32
+ const active = resolveProviderConfig(cfg);
33
+ const family = detectFamily(cfg.providerUrl, cfg.providerModel);
34
+ const avail = getProviderNames().sort();
35
+ return {
36
+ activeProvider: active,
37
+ detectedFamily: family,
38
+ available: avail,
39
+ url: (cfg.providerUrl || '').replace(/\/\/.*@/, '//***@'),
40
+ model: cfg.providerModel || '(not set)',
41
+ env: process.env.NATURECO_MODEL_PROVIDER || '(not set)',
42
+ configValue: cfg.modelProvider || '(not set, using auto-detect)',
43
+ };
44
+ }
45
+
46
+ case 'list': {
47
+ const avail = getProviderNames().sort();
48
+ return {
49
+ success: true,
50
+ providers: avail.map(name => {
51
+ const Provider = getProvider(name);
52
+ const inst = new Provider(cfg);
53
+ return { name, endpoint: inst.getEndpoint() };
54
+ }),
55
+ };
56
+ }
57
+
58
+ case 'switch': {
59
+ if (!params.provider) return { success: false, error: 'provider name gerekli' };
60
+ const { setConfigValue } = require('../utils/config');
61
+ setConfigValue('modelProvider', params.provider);
62
+ if (params.model) setConfigValue('providerModel', params.model);
63
+ return { success: true, message: `Model provider switched to: ${params.provider}${params.model ? ' (model: ' + params.model + ')' : ''}` };
64
+ }
65
+
66
+ default:
67
+ return { success: false, error: `Unknown action: ${params.action}` };
68
+ }
69
+ }
70
+
71
+ module.exports = { name, description, parameters, execute };
@@ -1,77 +1,68 @@
1
1
  const { getConfig } = require('../utils/config');
2
+ const { getProviderNames, getProvider } = require('../utils/search-provider');
3
+ require('../providers/search/tavily');
4
+ require('../providers/search/duckduckgo');
5
+ require('../providers/search/searxng');
6
+ require('../providers/search/exa');
2
7
 
3
8
  module.exports = {
4
9
  name: 'parallel_search',
5
- description: 'Free web search using Parallel (no API key required)',
10
+ description: 'Run search across multiple search providers in parallel and merge results. Uses configured providers (DuckDuckGo, SearXNG, Exa, Tavily).',
6
11
  inputSchema: {
7
12
  type: 'object',
8
13
  properties: {
9
14
  query: { type: 'string', description: 'Search query' },
10
- maxResults: { type: 'number', description: 'Maximum results (default: 5)', default: 5 }
15
+ maxResults: { type: 'number', description: 'Maximum results per provider (default: 3)' },
16
+ providers: { type: 'array', items: { type: 'string' }, description: 'Providers to use (default: all available, except Tavily which needs API key)' },
11
17
  },
12
- required: ['query']
18
+ required: ['query'],
13
19
  },
14
20
 
15
21
  async execute(params) {
16
22
  try {
17
- const query = encodeURIComponent(params.query);
18
- const maxResults = params.maxResults || 5;
23
+ const config = getConfig();
24
+ const query = params.query;
25
+ const maxResults = params.maxResults || 3;
26
+ const allProviders = getProviderNames();
19
27
 
20
- const response = await fetch(
21
- `https://api.duckduckgo.com/?q=${query}&format=json&no_html=1&skip_disambig=1`,
22
- { headers: { 'User-Agent': 'NatureCo-CLI/2.0' } }
23
- );
28
+ let providersToUse = params.providers || allProviders;
29
+ providersToUse = providersToUse.filter(name => allProviders.includes(name));
24
30
 
25
- if (!response.ok) {
26
- return { success: false, error: `Parallel search error: ${response.status}` };
31
+ if (providersToUse.length === 0) {
32
+ return { success: false, error: 'Kullanilabilir search provider bulunamadi' };
27
33
  }
28
34
 
29
- const data = await response.json();
30
- const results = [];
31
-
32
- if (data.AbstractText) {
33
- results.push({
34
- title: data.Heading || 'Summary',
35
- snippet: data.AbstractText,
36
- url: data.AbstractURL || ''
37
- });
38
- }
39
-
40
- if (data.Results && Array.isArray(data.Results)) {
41
- for (const r of data.Results) {
42
- if (results.length >= maxResults) break;
43
- if (r.Text && r.FirstURL) {
44
- results.push({ title: r.Text.split(' - ')[0] || r.Text, snippet: r.Text, url: r.FirstURL });
45
- }
46
- }
47
- }
35
+ const results = await Promise.allSettled(
36
+ providersToUse.map(async (name) => {
37
+ const Provider = getProvider(name);
38
+ if (!Provider) throw new Error(`Provider bulunamadi: ${name}`);
39
+ const provider = new Provider(config);
40
+ const result = await provider.search(query, { maxResults });
41
+ return { provider: name, result };
42
+ })
43
+ );
48
44
 
49
- if (data.RelatedTopics && Array.isArray(data.RelatedTopics)) {
50
- for (const r of data.RelatedTopics) {
51
- if (results.length >= maxResults) break;
52
- if (r.Text && r.FirstURL) {
53
- results.push({ title: r.Text.split(' - ')[0] || r.Text, snippet: r.Text, url: r.FirstURL });
54
- }
55
- if (r.Topics && Array.isArray(r.Topics)) {
56
- for (const t of r.Topics) {
57
- if (results.length >= maxResults) break;
58
- if (t.Text && t.FirstURL) {
59
- results.push({ title: t.Text.split(' - ')[0] || t.Text, snippet: t.Text, url: t.FirstURL });
60
- }
61
- }
45
+ const merged = [];
46
+ for (const r of results) {
47
+ if (r.status === 'fulfilled' && r.value.result.success) {
48
+ for (const item of r.value.result.results || []) {
49
+ merged.push({
50
+ ...item,
51
+ _provider: r.value.provider,
52
+ });
62
53
  }
63
54
  }
64
55
  }
65
56
 
66
57
  return {
67
58
  success: true,
68
- query: params.query,
69
- results,
70
- count: results.length,
71
- source: 'parallel'
59
+ query,
60
+ results: merged.slice(0, maxResults * providersToUse.length),
61
+ count: merged.length,
62
+ providersUsed: providersToUse,
72
63
  };
73
64
  } catch (error) {
74
65
  return { success: false, error: error.message };
75
66
  }
76
- }
77
- };
67
+ },
68
+ };