overai 1.4.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.
- package/README.md +248 -0
- package/dist/agent/context.d.ts +74 -0
- package/dist/agent/context.js +140 -0
- package/dist/agent/enhanced.d.ts +98 -0
- package/dist/agent/enhanced.js +293 -0
- package/dist/agent/handoff.d.ts +82 -0
- package/dist/agent/handoff.js +124 -0
- package/dist/agent/image.d.ts +57 -0
- package/dist/agent/image.js +116 -0
- package/dist/agent/index.d.ts +19 -0
- package/dist/agent/index.js +38 -0
- package/dist/agent/prompt-expander.d.ts +43 -0
- package/dist/agent/prompt-expander.js +99 -0
- package/dist/agent/proxy.d.ts +26 -0
- package/dist/agent/proxy.js +173 -0
- package/dist/agent/query-rewriter.d.ts +41 -0
- package/dist/agent/query-rewriter.js +94 -0
- package/dist/agent/research.d.ts +55 -0
- package/dist/agent/research.js +134 -0
- package/dist/agent/router.d.ts +141 -0
- package/dist/agent/router.js +209 -0
- package/dist/agent/simple.d.ts +289 -0
- package/dist/agent/simple.js +696 -0
- package/dist/agent/types.d.ts +56 -0
- package/dist/agent/types.js +165 -0
- package/dist/ai/agent-loop.d.ts +177 -0
- package/dist/ai/agent-loop.js +313 -0
- package/dist/ai/devtools.d.ts +74 -0
- package/dist/ai/devtools.js +216 -0
- package/dist/ai/embed.d.ts +71 -0
- package/dist/ai/embed.js +154 -0
- package/dist/ai/generate-image.d.ts +66 -0
- package/dist/ai/generate-image.js +138 -0
- package/dist/ai/generate-object.d.ts +132 -0
- package/dist/ai/generate-object.js +206 -0
- package/dist/ai/generate-text.d.ts +201 -0
- package/dist/ai/generate-text.js +253 -0
- package/dist/ai/index.d.ts +27 -0
- package/dist/ai/index.js +140 -0
- package/dist/ai/mcp.d.ts +181 -0
- package/dist/ai/mcp.js +234 -0
- package/dist/ai/middleware.d.ts +110 -0
- package/dist/ai/middleware.js +186 -0
- package/dist/ai/models.d.ts +67 -0
- package/dist/ai/models.js +249 -0
- package/dist/ai/multimodal.d.ts +125 -0
- package/dist/ai/multimodal.js +270 -0
- package/dist/ai/nextjs.d.ts +122 -0
- package/dist/ai/nextjs.js +218 -0
- package/dist/ai/server.d.ts +126 -0
- package/dist/ai/server.js +336 -0
- package/dist/ai/speech.d.ts +135 -0
- package/dist/ai/speech.js +296 -0
- package/dist/ai/telemetry.d.ts +162 -0
- package/dist/ai/telemetry.js +311 -0
- package/dist/ai/tool-approval.d.ts +225 -0
- package/dist/ai/tool-approval.js +407 -0
- package/dist/ai/tools.d.ts +93 -0
- package/dist/ai/tools.js +89 -0
- package/dist/ai/types.d.ts +47 -0
- package/dist/ai/types.js +5 -0
- package/dist/ai/ui-message.d.ts +218 -0
- package/dist/ai/ui-message.js +291 -0
- package/dist/auto/index.d.ts +62 -0
- package/dist/auto/index.js +163 -0
- package/dist/cache/index.d.ts +78 -0
- package/dist/cache/index.js +235 -0
- package/dist/cli/commands/agent.d.ts +30 -0
- package/dist/cli/commands/agent.js +151 -0
- package/dist/cli/commands/agents.d.ts +24 -0
- package/dist/cli/commands/agents.js +166 -0
- package/dist/cli/commands/approval.d.ts +10 -0
- package/dist/cli/commands/approval.js +253 -0
- package/dist/cli/commands/auto.d.ts +12 -0
- package/dist/cli/commands/auto.js +109 -0
- package/dist/cli/commands/autonomy.d.ts +5 -0
- package/dist/cli/commands/autonomy.js +152 -0
- package/dist/cli/commands/benchmark.d.ts +19 -0
- package/dist/cli/commands/benchmark.js +484 -0
- package/dist/cli/commands/cache.d.ts +9 -0
- package/dist/cli/commands/cache.js +143 -0
- package/dist/cli/commands/chat.d.ts +14 -0
- package/dist/cli/commands/chat.js +127 -0
- package/dist/cli/commands/checkpoints.d.ts +5 -0
- package/dist/cli/commands/checkpoints.js +236 -0
- package/dist/cli/commands/context.d.ts +11 -0
- package/dist/cli/commands/context.js +182 -0
- package/dist/cli/commands/cost.d.ts +5 -0
- package/dist/cli/commands/cost.js +146 -0
- package/dist/cli/commands/db.d.ts +9 -0
- package/dist/cli/commands/db.js +149 -0
- package/dist/cli/commands/embed.d.ts +20 -0
- package/dist/cli/commands/embed.js +375 -0
- package/dist/cli/commands/eval.d.ts +17 -0
- package/dist/cli/commands/eval.js +247 -0
- package/dist/cli/commands/external-agents.d.ts +5 -0
- package/dist/cli/commands/external-agents.js +170 -0
- package/dist/cli/commands/fast-context.d.ts +5 -0
- package/dist/cli/commands/fast-context.js +126 -0
- package/dist/cli/commands/flow.d.ts +5 -0
- package/dist/cli/commands/flow.js +141 -0
- package/dist/cli/commands/git.d.ts +5 -0
- package/dist/cli/commands/git.js +178 -0
- package/dist/cli/commands/graph-rag.d.ts +9 -0
- package/dist/cli/commands/graph-rag.js +131 -0
- package/dist/cli/commands/guardrail.d.ts +11 -0
- package/dist/cli/commands/guardrail.js +156 -0
- package/dist/cli/commands/handoff.d.ts +9 -0
- package/dist/cli/commands/handoff.js +133 -0
- package/dist/cli/commands/help.d.ts +8 -0
- package/dist/cli/commands/help.js +139 -0
- package/dist/cli/commands/image.d.ts +13 -0
- package/dist/cli/commands/image.js +192 -0
- package/dist/cli/commands/interactive.d.ts +6 -0
- package/dist/cli/commands/interactive.js +79 -0
- package/dist/cli/commands/jobs.d.ts +5 -0
- package/dist/cli/commands/jobs.js +282 -0
- package/dist/cli/commands/knowledge.d.ts +9 -0
- package/dist/cli/commands/knowledge.js +226 -0
- package/dist/cli/commands/llm.d.ts +21 -0
- package/dist/cli/commands/llm.js +748 -0
- package/dist/cli/commands/mcp.d.ts +9 -0
- package/dist/cli/commands/mcp.js +243 -0
- package/dist/cli/commands/memory.d.ts +10 -0
- package/dist/cli/commands/memory.js +198 -0
- package/dist/cli/commands/n8n.d.ts +5 -0
- package/dist/cli/commands/n8n.js +137 -0
- package/dist/cli/commands/observability.d.ts +16 -0
- package/dist/cli/commands/observability.js +335 -0
- package/dist/cli/commands/planning.d.ts +9 -0
- package/dist/cli/commands/planning.js +167 -0
- package/dist/cli/commands/prompt-expand.d.ts +11 -0
- package/dist/cli/commands/prompt-expand.js +100 -0
- package/dist/cli/commands/providers.d.ts +17 -0
- package/dist/cli/commands/providers.js +386 -0
- package/dist/cli/commands/query-rewrite.d.ts +12 -0
- package/dist/cli/commands/query-rewrite.js +102 -0
- package/dist/cli/commands/repo-map.d.ts +5 -0
- package/dist/cli/commands/repo-map.js +151 -0
- package/dist/cli/commands/reranker.d.ts +10 -0
- package/dist/cli/commands/reranker.js +144 -0
- package/dist/cli/commands/research.d.ts +12 -0
- package/dist/cli/commands/research.js +108 -0
- package/dist/cli/commands/router.d.ts +11 -0
- package/dist/cli/commands/router.js +142 -0
- package/dist/cli/commands/run.d.ts +14 -0
- package/dist/cli/commands/run.js +111 -0
- package/dist/cli/commands/sandbox.d.ts +5 -0
- package/dist/cli/commands/sandbox.js +135 -0
- package/dist/cli/commands/scheduler.d.ts +5 -0
- package/dist/cli/commands/scheduler.js +260 -0
- package/dist/cli/commands/session.d.ts +9 -0
- package/dist/cli/commands/session.js +238 -0
- package/dist/cli/commands/skills.d.ts +9 -0
- package/dist/cli/commands/skills.js +256 -0
- package/dist/cli/commands/telemetry.d.ts +9 -0
- package/dist/cli/commands/telemetry.js +146 -0
- package/dist/cli/commands/tools.d.ts +19 -0
- package/dist/cli/commands/tools.js +576 -0
- package/dist/cli/commands/vector.d.ts +10 -0
- package/dist/cli/commands/vector.js +171 -0
- package/dist/cli/commands/version.d.ts +8 -0
- package/dist/cli/commands/version.js +40 -0
- package/dist/cli/commands/voice.d.ts +10 -0
- package/dist/cli/commands/voice.js +162 -0
- package/dist/cli/commands/workflow.d.ts +13 -0
- package/dist/cli/commands/workflow.js +184 -0
- package/dist/cli/config/index.d.ts +6 -0
- package/dist/cli/config/index.js +22 -0
- package/dist/cli/config/load.d.ts +20 -0
- package/dist/cli/config/load.js +229 -0
- package/dist/cli/config/resolve.d.ts +28 -0
- package/dist/cli/config/resolve.js +70 -0
- package/dist/cli/config/schema.d.ts +15 -0
- package/dist/cli/config/schema.js +65 -0
- package/dist/cli/features/autonomy-mode.d.ts +98 -0
- package/dist/cli/features/autonomy-mode.js +266 -0
- package/dist/cli/features/background-jobs.d.ts +155 -0
- package/dist/cli/features/background-jobs.js +416 -0
- package/dist/cli/features/checkpoints.d.ts +126 -0
- package/dist/cli/features/checkpoints.js +288 -0
- package/dist/cli/features/cost-tracker.d.ts +101 -0
- package/dist/cli/features/cost-tracker.js +212 -0
- package/dist/cli/features/external-agents.d.ts +117 -0
- package/dist/cli/features/external-agents.js +296 -0
- package/dist/cli/features/fast-context.d.ts +126 -0
- package/dist/cli/features/fast-context.js +310 -0
- package/dist/cli/features/flow-display.d.ts +100 -0
- package/dist/cli/features/flow-display.js +254 -0
- package/dist/cli/features/git-integration.d.ts +138 -0
- package/dist/cli/features/git-integration.js +374 -0
- package/dist/cli/features/index.d.ts +17 -0
- package/dist/cli/features/index.js +102 -0
- package/dist/cli/features/interactive-tui.d.ts +114 -0
- package/dist/cli/features/interactive-tui.js +326 -0
- package/dist/cli/features/n8n-integration.d.ts +111 -0
- package/dist/cli/features/n8n-integration.js +299 -0
- package/dist/cli/features/repo-map.d.ts +101 -0
- package/dist/cli/features/repo-map.js +350 -0
- package/dist/cli/features/sandbox-executor.d.ts +89 -0
- package/dist/cli/features/sandbox-executor.js +314 -0
- package/dist/cli/features/scheduler.d.ts +111 -0
- package/dist/cli/features/scheduler.js +298 -0
- package/dist/cli/features/slash-commands.d.ts +77 -0
- package/dist/cli/features/slash-commands.js +316 -0
- package/dist/cli/index.d.ts +24 -0
- package/dist/cli/index.js +214 -0
- package/dist/cli/output/errors.d.ts +23 -0
- package/dist/cli/output/errors.js +36 -0
- package/dist/cli/output/json.d.ts +27 -0
- package/dist/cli/output/json.js +31 -0
- package/dist/cli/output/pretty.d.ts +13 -0
- package/dist/cli/output/pretty.js +31 -0
- package/dist/cli/runtime/env.d.ts +12 -0
- package/dist/cli/runtime/env.js +55 -0
- package/dist/cli/runtime/exit.d.ts +11 -0
- package/dist/cli/runtime/exit.js +49 -0
- package/dist/cli/runtime/index.d.ts +6 -0
- package/dist/cli/runtime/index.js +22 -0
- package/dist/cli/runtime/lazy.d.ts +18 -0
- package/dist/cli/runtime/lazy.js +85 -0
- package/dist/cli/spec/cli-spec.d.ts +87 -0
- package/dist/cli/spec/cli-spec.js +551 -0
- package/dist/cli/spec/index.d.ts +4 -0
- package/dist/cli/spec/index.js +20 -0
- package/dist/db/index.d.ts +6 -0
- package/dist/db/index.js +75 -0
- package/dist/db/types.d.ts +42 -0
- package/dist/db/types.js +2 -0
- package/dist/eval/index.d.ts +61 -0
- package/dist/eval/index.js +157 -0
- package/dist/events/index.d.ts +84 -0
- package/dist/events/index.js +153 -0
- package/dist/guardrails/index.d.ts +82 -0
- package/dist/guardrails/index.js +202 -0
- package/dist/guardrails/llm-guardrail.d.ts +46 -0
- package/dist/guardrails/llm-guardrail.js +112 -0
- package/dist/index.d.ts +92 -0
- package/dist/index.js +608 -0
- package/dist/integrations/computer-use.d.ts +182 -0
- package/dist/integrations/computer-use.js +356 -0
- package/dist/integrations/index.d.ts +7 -0
- package/dist/integrations/index.js +26 -0
- package/dist/integrations/observability/base.d.ts +123 -0
- package/dist/integrations/observability/base.js +183 -0
- package/dist/integrations/observability/index.d.ts +8 -0
- package/dist/integrations/observability/index.js +29 -0
- package/dist/integrations/observability/langfuse.d.ts +32 -0
- package/dist/integrations/observability/langfuse.js +174 -0
- package/dist/integrations/postgres.d.ts +162 -0
- package/dist/integrations/postgres.js +396 -0
- package/dist/integrations/slack.d.ts +145 -0
- package/dist/integrations/slack.js +270 -0
- package/dist/integrations/vector/base.d.ts +110 -0
- package/dist/integrations/vector/base.js +158 -0
- package/dist/integrations/vector/chroma.d.ts +25 -0
- package/dist/integrations/vector/chroma.js +143 -0
- package/dist/integrations/vector/index.d.ts +14 -0
- package/dist/integrations/vector/index.js +37 -0
- package/dist/integrations/vector/pinecone.d.ts +28 -0
- package/dist/integrations/vector/pinecone.js +172 -0
- package/dist/integrations/vector/qdrant.d.ts +25 -0
- package/dist/integrations/vector/qdrant.js +146 -0
- package/dist/integrations/vector/weaviate.d.ts +30 -0
- package/dist/integrations/vector/weaviate.js +206 -0
- package/dist/integrations/voice/base.d.ts +76 -0
- package/dist/integrations/voice/base.js +168 -0
- package/dist/integrations/voice/index.d.ts +6 -0
- package/dist/integrations/voice/index.js +26 -0
- package/dist/knowledge/chunking.d.ts +55 -0
- package/dist/knowledge/chunking.js +158 -0
- package/dist/knowledge/graph-rag.d.ts +125 -0
- package/dist/knowledge/graph-rag.js +289 -0
- package/dist/knowledge/index.d.ts +24 -0
- package/dist/knowledge/index.js +47 -0
- package/dist/knowledge/knowledge.d.ts +0 -0
- package/dist/knowledge/knowledge.js +1 -0
- package/dist/knowledge/rag.d.ts +80 -0
- package/dist/knowledge/rag.js +147 -0
- package/dist/knowledge/reranker.d.ts +86 -0
- package/dist/knowledge/reranker.js +196 -0
- package/dist/llm/backend-resolver.d.ts +77 -0
- package/dist/llm/backend-resolver.js +242 -0
- package/dist/llm/embeddings.d.ts +66 -0
- package/dist/llm/embeddings.js +294 -0
- package/dist/llm/index.d.ts +29 -0
- package/dist/llm/index.js +33 -0
- package/dist/llm/llm.d.ts +0 -0
- package/dist/llm/llm.js +1 -0
- package/dist/llm/openai.d.ts +39 -0
- package/dist/llm/openai.js +302 -0
- package/dist/llm/providers/ai-sdk/adapter.d.ts +121 -0
- package/dist/llm/providers/ai-sdk/adapter.js +399 -0
- package/dist/llm/providers/ai-sdk/backend.d.ts +49 -0
- package/dist/llm/providers/ai-sdk/backend.js +421 -0
- package/dist/llm/providers/ai-sdk/index.d.ts +69 -0
- package/dist/llm/providers/ai-sdk/index.js +200 -0
- package/dist/llm/providers/ai-sdk/middleware.d.ts +60 -0
- package/dist/llm/providers/ai-sdk/middleware.js +262 -0
- package/dist/llm/providers/ai-sdk/provider-map.d.ts +75 -0
- package/dist/llm/providers/ai-sdk/provider-map.js +258 -0
- package/dist/llm/providers/ai-sdk/types.d.ts +217 -0
- package/dist/llm/providers/ai-sdk/types.js +222 -0
- package/dist/llm/providers/anthropic.d.ts +33 -0
- package/dist/llm/providers/anthropic.js +291 -0
- package/dist/llm/providers/base.d.ts +25 -0
- package/dist/llm/providers/base.js +43 -0
- package/dist/llm/providers/google.d.ts +27 -0
- package/dist/llm/providers/google.js +275 -0
- package/dist/llm/providers/index.d.ts +107 -0
- package/dist/llm/providers/index.js +216 -0
- package/dist/llm/providers/openai.d.ts +18 -0
- package/dist/llm/providers/openai.js +203 -0
- package/dist/llm/providers/registry.d.ts +159 -0
- package/dist/llm/providers/registry.js +279 -0
- package/dist/llm/providers/types.d.ts +94 -0
- package/dist/llm/providers/types.js +5 -0
- package/dist/main.d.ts +0 -0
- package/dist/main.js +1 -0
- package/dist/memory/auto-memory.d.ts +136 -0
- package/dist/memory/auto-memory.js +301 -0
- package/dist/memory/file-memory.d.ts +88 -0
- package/dist/memory/file-memory.js +287 -0
- package/dist/memory/index.d.ts +26 -0
- package/dist/memory/index.js +41 -0
- package/dist/memory/memory.d.ts +92 -0
- package/dist/memory/memory.js +170 -0
- package/dist/observability/adapters/console.d.ts +33 -0
- package/dist/observability/adapters/console.js +71 -0
- package/dist/observability/adapters/external/arize.d.ts +20 -0
- package/dist/observability/adapters/external/arize.js +22 -0
- package/dist/observability/adapters/external/axiom.d.ts +20 -0
- package/dist/observability/adapters/external/axiom.js +22 -0
- package/dist/observability/adapters/external/braintrust.d.ts +20 -0
- package/dist/observability/adapters/external/braintrust.js +22 -0
- package/dist/observability/adapters/external/helicone.d.ts +20 -0
- package/dist/observability/adapters/external/helicone.js +22 -0
- package/dist/observability/adapters/external/laminar.d.ts +20 -0
- package/dist/observability/adapters/external/laminar.js +22 -0
- package/dist/observability/adapters/external/langfuse.d.ts +28 -0
- package/dist/observability/adapters/external/langfuse.js +186 -0
- package/dist/observability/adapters/external/langsmith.d.ts +21 -0
- package/dist/observability/adapters/external/langsmith.js +83 -0
- package/dist/observability/adapters/external/langwatch.d.ts +20 -0
- package/dist/observability/adapters/external/langwatch.js +22 -0
- package/dist/observability/adapters/external/maxim.d.ts +20 -0
- package/dist/observability/adapters/external/maxim.js +22 -0
- package/dist/observability/adapters/external/patronus.d.ts +20 -0
- package/dist/observability/adapters/external/patronus.js +22 -0
- package/dist/observability/adapters/external/scorecard.d.ts +20 -0
- package/dist/observability/adapters/external/scorecard.js +22 -0
- package/dist/observability/adapters/external/signoz.d.ts +20 -0
- package/dist/observability/adapters/external/signoz.js +22 -0
- package/dist/observability/adapters/external/traceloop.d.ts +20 -0
- package/dist/observability/adapters/external/traceloop.js +22 -0
- package/dist/observability/adapters/external/weave.d.ts +20 -0
- package/dist/observability/adapters/external/weave.js +22 -0
- package/dist/observability/adapters/index.d.ts +19 -0
- package/dist/observability/adapters/index.js +289 -0
- package/dist/observability/adapters/memory.d.ts +41 -0
- package/dist/observability/adapters/memory.js +190 -0
- package/dist/observability/adapters/noop.d.ts +25 -0
- package/dist/observability/adapters/noop.js +64 -0
- package/dist/observability/index.d.ts +47 -0
- package/dist/observability/index.js +115 -0
- package/dist/observability/types.d.ts +165 -0
- package/dist/observability/types.js +165 -0
- package/dist/planning/index.d.ts +253 -0
- package/dist/planning/index.js +475 -0
- package/dist/process/index.d.ts +25 -0
- package/dist/process/index.js +37 -0
- package/dist/process/process.d.ts +0 -0
- package/dist/process/process.js +1 -0
- package/dist/session/index.d.ts +111 -0
- package/dist/session/index.js +250 -0
- package/dist/skills/index.d.ts +70 -0
- package/dist/skills/index.js +233 -0
- package/dist/task/index.d.ts +25 -0
- package/dist/task/index.js +32 -0
- package/dist/task/task.d.ts +0 -0
- package/dist/task/task.js +1 -0
- package/dist/telemetry/index.d.ts +175 -0
- package/dist/telemetry/index.js +287 -0
- package/dist/tools/arxivTools.d.ts +32 -0
- package/dist/tools/arxivTools.js +81 -0
- package/dist/tools/base.d.ts +97 -0
- package/dist/tools/base.js +147 -0
- package/dist/tools/builtins/airweave.d.ts +32 -0
- package/dist/tools/builtins/airweave.js +119 -0
- package/dist/tools/builtins/bedrock-agentcore.d.ts +62 -0
- package/dist/tools/builtins/bedrock-agentcore.js +233 -0
- package/dist/tools/builtins/code-execution.d.ts +36 -0
- package/dist/tools/builtins/code-execution.js +136 -0
- package/dist/tools/builtins/code-mode.d.ts +54 -0
- package/dist/tools/builtins/code-mode.js +167 -0
- package/dist/tools/builtins/custom.d.ts +42 -0
- package/dist/tools/builtins/custom.js +195 -0
- package/dist/tools/builtins/exa.d.ts +53 -0
- package/dist/tools/builtins/exa.js +112 -0
- package/dist/tools/builtins/firecrawl.d.ts +56 -0
- package/dist/tools/builtins/firecrawl.js +158 -0
- package/dist/tools/builtins/index.d.ts +45 -0
- package/dist/tools/builtins/index.js +180 -0
- package/dist/tools/builtins/parallel.d.ts +30 -0
- package/dist/tools/builtins/parallel.js +113 -0
- package/dist/tools/builtins/perplexity.d.ts +32 -0
- package/dist/tools/builtins/perplexity.js +113 -0
- package/dist/tools/builtins/superagent.d.ts +66 -0
- package/dist/tools/builtins/superagent.js +187 -0
- package/dist/tools/builtins/tavily.d.ts +99 -0
- package/dist/tools/builtins/tavily.js +285 -0
- package/dist/tools/builtins/valyu.d.ts +65 -0
- package/dist/tools/builtins/valyu.js +193 -0
- package/dist/tools/decorator.d.ts +91 -0
- package/dist/tools/decorator.js +165 -0
- package/dist/tools/index.d.ts +8 -0
- package/dist/tools/index.js +36 -0
- package/dist/tools/mcpSse.d.ts +43 -0
- package/dist/tools/mcpSse.js +110 -0
- package/dist/tools/registry/index.d.ts +9 -0
- package/dist/tools/registry/index.js +28 -0
- package/dist/tools/registry/middleware.d.ts +43 -0
- package/dist/tools/registry/middleware.js +220 -0
- package/dist/tools/registry/registry.d.ts +92 -0
- package/dist/tools/registry/registry.js +280 -0
- package/dist/tools/registry/types.d.ts +217 -0
- package/dist/tools/registry/types.js +49 -0
- package/dist/tools/test.d.ts +0 -0
- package/dist/tools/test.js +1 -0
- package/dist/tools/tools.d.ts +74 -0
- package/dist/tools/tools.js +133 -0
- package/dist/utils/logger.d.ts +25 -0
- package/dist/utils/logger.js +149 -0
- package/dist/utils/pretty-logger.d.ts +21 -0
- package/dist/utils/pretty-logger.js +248 -0
- package/dist/workflows/index.d.ts +118 -0
- package/dist/workflows/index.js +247 -0
- package/dist/workflows/loop.d.ts +0 -0
- package/dist/workflows/loop.js +1 -0
- package/dist/workflows/yaml-parser.d.ts +48 -0
- package/dist/workflows/yaml-parser.js +304 -0
- package/package.json +119 -0
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Providers command - List and manage LLM providers
|
|
4
|
+
*
|
|
5
|
+
* Supports:
|
|
6
|
+
* - list: List all registered providers (60+ AI SDK v6 providers)
|
|
7
|
+
* - doctor: Check environment variables for selected provider
|
|
8
|
+
* - test: Run a small test request to verify provider works
|
|
9
|
+
* - info: Show provider details
|
|
10
|
+
*/
|
|
11
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
14
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
15
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
16
|
+
}
|
|
17
|
+
Object.defineProperty(o, k2, desc);
|
|
18
|
+
}) : (function(o, m, k, k2) {
|
|
19
|
+
if (k2 === undefined) k2 = k;
|
|
20
|
+
o[k2] = m[k];
|
|
21
|
+
}));
|
|
22
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
23
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
24
|
+
}) : function(o, v) {
|
|
25
|
+
o["default"] = v;
|
|
26
|
+
});
|
|
27
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
28
|
+
var ownKeys = function(o) {
|
|
29
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
30
|
+
var ar = [];
|
|
31
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
32
|
+
return ar;
|
|
33
|
+
};
|
|
34
|
+
return ownKeys(o);
|
|
35
|
+
};
|
|
36
|
+
return function (mod) {
|
|
37
|
+
if (mod && mod.__esModule) return mod;
|
|
38
|
+
var result = {};
|
|
39
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
40
|
+
__setModuleDefault(result, mod);
|
|
41
|
+
return result;
|
|
42
|
+
};
|
|
43
|
+
})();
|
|
44
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
+
exports.execute = execute;
|
|
46
|
+
const providers_1 = require("../../llm/providers");
|
|
47
|
+
const types_1 = require("../../llm/providers/ai-sdk/types");
|
|
48
|
+
const env_1 = require("../runtime/env");
|
|
49
|
+
const pretty_logger_1 = require("../../utils/pretty-logger");
|
|
50
|
+
function outputJson(data) {
|
|
51
|
+
console.log(JSON.stringify(data, null, 2));
|
|
52
|
+
}
|
|
53
|
+
function formatSuccess(data) {
|
|
54
|
+
return { success: true, data };
|
|
55
|
+
}
|
|
56
|
+
function formatError(code, message, meta) {
|
|
57
|
+
return meta !== undefined
|
|
58
|
+
? { success: false, error: { code, message }, meta }
|
|
59
|
+
: { success: false, error: { code, message } };
|
|
60
|
+
}
|
|
61
|
+
const ERROR_CODES = {
|
|
62
|
+
INVALID_ARGS: 'INVALID_ARGS',
|
|
63
|
+
MISSING_ARG: 'MISSING_ARG',
|
|
64
|
+
PROVIDER_NOT_FOUND: 'PROVIDER_NOT_FOUND',
|
|
65
|
+
UNKNOWN: 'UNKNOWN_ERROR',
|
|
66
|
+
};
|
|
67
|
+
const BUILTIN_PROVIDERS = ['openai', 'anthropic', 'google', 'gemini', 'oai', 'claude'];
|
|
68
|
+
const PROVIDER_MODELS = {
|
|
69
|
+
openai: ['gpt-4o', 'gpt-4o-mini', 'gpt-4-turbo', 'gpt-4', 'gpt-3.5-turbo', 'gpt-5', 'gpt-5-mini'],
|
|
70
|
+
anthropic: ['claude-sonnet-4-20250514', 'claude-3-5-sonnet-20241022', 'claude-3-opus-20240229', 'claude-3-haiku-20240307', 'claude-opus-4-5'],
|
|
71
|
+
google: ['gemini-2.0-flash', 'gemini-1.5-pro', 'gemini-1.5-flash'],
|
|
72
|
+
xai: ['grok-4', 'grok-3', 'grok-3-fast', 'grok-3-mini'],
|
|
73
|
+
groq: ['llama-3.3-70b-versatile', 'mixtral-8x7b-32768', 'gemma2-9b-it'],
|
|
74
|
+
mistral: ['mistral-large-latest', 'mistral-medium-latest', 'mistral-small-latest'],
|
|
75
|
+
deepseek: ['deepseek-chat', 'deepseek-reasoner'],
|
|
76
|
+
cerebras: ['llama3.1-8b', 'llama3.3-70b'],
|
|
77
|
+
};
|
|
78
|
+
async function execute(args, options) {
|
|
79
|
+
const subcommand = args[0] || 'list';
|
|
80
|
+
const outputFormat = options.json ? 'json' : (options.output || 'pretty');
|
|
81
|
+
switch (subcommand) {
|
|
82
|
+
case 'list':
|
|
83
|
+
await listProvidersCommand(options, outputFormat);
|
|
84
|
+
break;
|
|
85
|
+
case 'doctor':
|
|
86
|
+
await doctorCommand(args[1] || options.provider, options, outputFormat);
|
|
87
|
+
break;
|
|
88
|
+
case 'test':
|
|
89
|
+
await testCommand(args[1] || options.provider, args[2] || options.model, options, outputFormat);
|
|
90
|
+
break;
|
|
91
|
+
case 'info':
|
|
92
|
+
await providerInfoCommand(args[1], options, outputFormat);
|
|
93
|
+
break;
|
|
94
|
+
default:
|
|
95
|
+
await listProvidersCommand(options, outputFormat);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
async function listProvidersCommand(options, outputFormat) {
|
|
99
|
+
const registry = (0, providers_1.getDefaultRegistry)();
|
|
100
|
+
const registeredProviders = registry.list();
|
|
101
|
+
const providers = registeredProviders.map(name => {
|
|
102
|
+
const isBuiltin = BUILTIN_PROVIDERS.includes(name);
|
|
103
|
+
return {
|
|
104
|
+
name,
|
|
105
|
+
registered: true,
|
|
106
|
+
available: (0, providers_1.isProviderAvailable)(name),
|
|
107
|
+
hasApiKey: (0, env_1.hasApiKey)(name),
|
|
108
|
+
isBuiltin,
|
|
109
|
+
models: PROVIDER_MODELS[name]
|
|
110
|
+
};
|
|
111
|
+
});
|
|
112
|
+
if (outputFormat === 'json') {
|
|
113
|
+
outputJson(formatSuccess({
|
|
114
|
+
providers: providers.map(p => ({
|
|
115
|
+
name: p.name,
|
|
116
|
+
registered: p.registered,
|
|
117
|
+
available: p.available,
|
|
118
|
+
has_api_key: p.hasApiKey,
|
|
119
|
+
is_builtin: p.isBuiltin,
|
|
120
|
+
models: options.verbose ? p.models : undefined
|
|
121
|
+
})),
|
|
122
|
+
total: providers.length,
|
|
123
|
+
builtin_count: providers.filter(p => p.isBuiltin).length,
|
|
124
|
+
custom_count: providers.filter(p => !p.isBuiltin).length
|
|
125
|
+
}));
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
await pretty_logger_1.PrettyLogger.heading('Registered LLM Providers');
|
|
129
|
+
// Built-in providers
|
|
130
|
+
const builtinProviders = providers.filter(p => p.isBuiltin);
|
|
131
|
+
if (builtinProviders.length > 0) {
|
|
132
|
+
await pretty_logger_1.PrettyLogger.plain('\n Built-in:');
|
|
133
|
+
for (const provider of builtinProviders) {
|
|
134
|
+
const status = provider.available ? '✅' : '❌';
|
|
135
|
+
const keyStatus = provider.hasApiKey ? '🔑' : '⚠️ No API key';
|
|
136
|
+
await pretty_logger_1.PrettyLogger.plain(` ${status} ${provider.name} ${keyStatus}`);
|
|
137
|
+
if (options.verbose && provider.models) {
|
|
138
|
+
for (const model of provider.models) {
|
|
139
|
+
await pretty_logger_1.PrettyLogger.dim(` - ${model}`);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
// Custom providers
|
|
145
|
+
const customProviders = providers.filter(p => !p.isBuiltin);
|
|
146
|
+
if (customProviders.length > 0) {
|
|
147
|
+
await pretty_logger_1.PrettyLogger.plain('\n Custom:');
|
|
148
|
+
for (const provider of customProviders) {
|
|
149
|
+
const status = provider.available ? '✅' : '❌';
|
|
150
|
+
await pretty_logger_1.PrettyLogger.plain(` ${status} ${provider.name}`);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
await pretty_logger_1.PrettyLogger.newline();
|
|
154
|
+
await pretty_logger_1.PrettyLogger.info('Register custom providers with registerProvider():');
|
|
155
|
+
await pretty_logger_1.PrettyLogger.dim(' import { registerProvider } from "overai";');
|
|
156
|
+
await pretty_logger_1.PrettyLogger.dim(' registerProvider("cloudflare", CloudflareProvider);');
|
|
157
|
+
await pretty_logger_1.PrettyLogger.newline();
|
|
158
|
+
await pretty_logger_1.PrettyLogger.info('Set API keys via environment variables:');
|
|
159
|
+
await pretty_logger_1.PrettyLogger.dim(' OPENAI_API_KEY, ANTHROPIC_API_KEY, GOOGLE_API_KEY');
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Doctor command - Check environment variables for a provider
|
|
164
|
+
*/
|
|
165
|
+
async function doctorCommand(providerName, options, outputFormat) {
|
|
166
|
+
// Get all AI SDK providers
|
|
167
|
+
const allProviders = Object.entries(types_1.AISDK_PROVIDERS);
|
|
168
|
+
if (providerName) {
|
|
169
|
+
// Check specific provider
|
|
170
|
+
const resolved = types_1.PROVIDER_ALIASES[providerName.toLowerCase()] || providerName.toLowerCase();
|
|
171
|
+
const providerInfo = types_1.AISDK_PROVIDERS[resolved];
|
|
172
|
+
if (!providerInfo) {
|
|
173
|
+
if (outputFormat === 'json') {
|
|
174
|
+
outputJson(formatError(ERROR_CODES.INVALID_ARGS, `Unknown provider: ${providerName}`));
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
await pretty_logger_1.PrettyLogger.error(`Unknown provider: ${providerName}`);
|
|
178
|
+
await pretty_logger_1.PrettyLogger.info(`Available providers: ${Object.keys(types_1.AISDK_PROVIDERS).slice(0, 10).join(', ')}...`);
|
|
179
|
+
}
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
const hasKey = !!process.env[providerInfo.envKey];
|
|
183
|
+
const keyValue = process.env[providerInfo.envKey];
|
|
184
|
+
const maskedKey = keyValue ? `${keyValue.slice(0, 4)}...${keyValue.slice(-4)}` : 'not set';
|
|
185
|
+
if (outputFormat === 'json') {
|
|
186
|
+
outputJson(formatSuccess({
|
|
187
|
+
provider: resolved,
|
|
188
|
+
env_key: providerInfo.envKey,
|
|
189
|
+
has_key: hasKey,
|
|
190
|
+
key_preview: hasKey ? maskedKey : null,
|
|
191
|
+
package: providerInfo.package,
|
|
192
|
+
description: providerInfo.description,
|
|
193
|
+
modalities: providerInfo.modalities,
|
|
194
|
+
status: hasKey ? 'ready' : 'missing_key'
|
|
195
|
+
}));
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
await pretty_logger_1.PrettyLogger.heading(`Provider Doctor: ${resolved}`);
|
|
199
|
+
await pretty_logger_1.PrettyLogger.plain(` Package: ${providerInfo.package}`);
|
|
200
|
+
await pretty_logger_1.PrettyLogger.plain(` Description: ${providerInfo.description || 'N/A'}`);
|
|
201
|
+
await pretty_logger_1.PrettyLogger.plain(` Environment Variable: ${providerInfo.envKey}`);
|
|
202
|
+
await pretty_logger_1.PrettyLogger.plain(` Status: ${hasKey ? '✅ Ready' : '❌ Missing API Key'}`);
|
|
203
|
+
if (hasKey) {
|
|
204
|
+
await pretty_logger_1.PrettyLogger.dim(` Key Preview: ${maskedKey}`);
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
await pretty_logger_1.PrettyLogger.newline();
|
|
208
|
+
await pretty_logger_1.PrettyLogger.info(`Set the API key with:`);
|
|
209
|
+
await pretty_logger_1.PrettyLogger.dim(` export ${providerInfo.envKey}=your-api-key`);
|
|
210
|
+
}
|
|
211
|
+
await pretty_logger_1.PrettyLogger.newline();
|
|
212
|
+
await pretty_logger_1.PrettyLogger.plain(' Modalities:');
|
|
213
|
+
const m = providerInfo.modalities;
|
|
214
|
+
await pretty_logger_1.PrettyLogger.plain(` Text/Chat: ${m.chat ? '✅' : '❌'} Embeddings: ${m.embeddings ? '✅' : '❌'} Image: ${m.image ? '✅' : '❌'}`);
|
|
215
|
+
await pretty_logger_1.PrettyLogger.plain(` Audio: ${m.audio ? '✅' : '❌'} Speech: ${m.speech ? '✅' : '❌'} Tools: ${m.tools ? '✅' : '❌'}`);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
// Check all providers
|
|
220
|
+
const results = allProviders.map(([name, info]) => ({
|
|
221
|
+
name,
|
|
222
|
+
envKey: info.envKey,
|
|
223
|
+
hasKey: !!process.env[info.envKey],
|
|
224
|
+
description: info.description
|
|
225
|
+
}));
|
|
226
|
+
const ready = results.filter(r => r.hasKey);
|
|
227
|
+
const missing = results.filter(r => !r.hasKey);
|
|
228
|
+
if (outputFormat === 'json') {
|
|
229
|
+
outputJson(formatSuccess({
|
|
230
|
+
total: results.length,
|
|
231
|
+
ready: ready.length,
|
|
232
|
+
missing: missing.length,
|
|
233
|
+
providers: results
|
|
234
|
+
}));
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
await pretty_logger_1.PrettyLogger.heading('Provider Environment Check');
|
|
238
|
+
await pretty_logger_1.PrettyLogger.plain(`\n Total Providers: ${results.length}`);
|
|
239
|
+
await pretty_logger_1.PrettyLogger.plain(` Ready: ${ready.length} ✅`);
|
|
240
|
+
await pretty_logger_1.PrettyLogger.plain(` Missing Keys: ${missing.length} ⚠️`);
|
|
241
|
+
if (ready.length > 0) {
|
|
242
|
+
await pretty_logger_1.PrettyLogger.plain('\n Ready Providers:');
|
|
243
|
+
for (const p of ready.slice(0, 10)) {
|
|
244
|
+
await pretty_logger_1.PrettyLogger.plain(` ✅ ${p.name}`);
|
|
245
|
+
}
|
|
246
|
+
if (ready.length > 10) {
|
|
247
|
+
await pretty_logger_1.PrettyLogger.dim(` ... and ${ready.length - 10} more`);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
await pretty_logger_1.PrettyLogger.newline();
|
|
251
|
+
await pretty_logger_1.PrettyLogger.info('Run "providers doctor <name>" for detailed info on a specific provider');
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Test command - Run a small test request to verify provider works
|
|
257
|
+
*/
|
|
258
|
+
async function testCommand(providerName, modelName, options, outputFormat) {
|
|
259
|
+
if (!providerName) {
|
|
260
|
+
if (outputFormat === 'json') {
|
|
261
|
+
outputJson(formatError(ERROR_CODES.MISSING_ARG, 'Provider name required. Usage: providers test <provider> [model]'));
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
await pretty_logger_1.PrettyLogger.error('Provider name required. Usage: providers test <provider> [model]');
|
|
265
|
+
}
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
const resolved = types_1.PROVIDER_ALIASES[providerName.toLowerCase()] || providerName.toLowerCase();
|
|
269
|
+
const providerInfo = types_1.AISDK_PROVIDERS[resolved];
|
|
270
|
+
if (!providerInfo) {
|
|
271
|
+
if (outputFormat === 'json') {
|
|
272
|
+
outputJson(formatError(ERROR_CODES.INVALID_ARGS, `Unknown provider: ${providerName}`));
|
|
273
|
+
}
|
|
274
|
+
else {
|
|
275
|
+
await pretty_logger_1.PrettyLogger.error(`Unknown provider: ${providerName}`);
|
|
276
|
+
}
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
// Check API key
|
|
280
|
+
if (!process.env[providerInfo.envKey]) {
|
|
281
|
+
if (outputFormat === 'json') {
|
|
282
|
+
outputJson(formatError(ERROR_CODES.MISSING_ARG, `Missing API key: ${providerInfo.envKey}`));
|
|
283
|
+
}
|
|
284
|
+
else {
|
|
285
|
+
await pretty_logger_1.PrettyLogger.error(`Missing API key: ${providerInfo.envKey}`);
|
|
286
|
+
await pretty_logger_1.PrettyLogger.info(`Set it with: export ${providerInfo.envKey}=your-api-key`);
|
|
287
|
+
}
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
// Get default model
|
|
291
|
+
const model = modelName || PROVIDER_MODELS[resolved]?.[0] || 'default';
|
|
292
|
+
const modelString = `${resolved}/${model}`;
|
|
293
|
+
if (outputFormat !== 'json') {
|
|
294
|
+
await pretty_logger_1.PrettyLogger.info(`Testing ${modelString}...`);
|
|
295
|
+
}
|
|
296
|
+
const startTime = Date.now();
|
|
297
|
+
try {
|
|
298
|
+
// Try to use the backend resolver
|
|
299
|
+
const { resolveBackend } = await Promise.resolve().then(() => __importStar(require('../../llm/backend-resolver')));
|
|
300
|
+
const { provider } = await resolveBackend(modelString);
|
|
301
|
+
// Make a minimal test request
|
|
302
|
+
const result = await provider.generateText({
|
|
303
|
+
messages: [{ role: 'user', content: 'Say "test ok" and nothing else.' }],
|
|
304
|
+
temperature: 0,
|
|
305
|
+
maxTokens: 10
|
|
306
|
+
});
|
|
307
|
+
const latency = Date.now() - startTime;
|
|
308
|
+
const responseText = result.text?.slice(0, 50) || '[no response]';
|
|
309
|
+
if (outputFormat === 'json') {
|
|
310
|
+
outputJson(formatSuccess({
|
|
311
|
+
provider: resolved,
|
|
312
|
+
model,
|
|
313
|
+
status: 'success',
|
|
314
|
+
latency_ms: latency,
|
|
315
|
+
response_preview: responseText,
|
|
316
|
+
usage: result.usage
|
|
317
|
+
}));
|
|
318
|
+
}
|
|
319
|
+
else {
|
|
320
|
+
await pretty_logger_1.PrettyLogger.plain(`\n ✅ Test Passed`);
|
|
321
|
+
await pretty_logger_1.PrettyLogger.plain(` Provider: ${resolved}`);
|
|
322
|
+
await pretty_logger_1.PrettyLogger.plain(` Model: ${model}`);
|
|
323
|
+
await pretty_logger_1.PrettyLogger.plain(` Latency: ${latency}ms`);
|
|
324
|
+
await pretty_logger_1.PrettyLogger.dim(` Response: "${responseText}"`);
|
|
325
|
+
if (result.usage) {
|
|
326
|
+
await pretty_logger_1.PrettyLogger.dim(` Tokens: ${result.usage.totalTokens || 'N/A'}`);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
catch (error) {
|
|
331
|
+
const latency = Date.now() - startTime;
|
|
332
|
+
const errorMessage = error.message || String(error);
|
|
333
|
+
if (outputFormat === 'json') {
|
|
334
|
+
outputJson(formatError(ERROR_CODES.UNKNOWN, errorMessage, {
|
|
335
|
+
provider: resolved,
|
|
336
|
+
model,
|
|
337
|
+
latency_ms: latency
|
|
338
|
+
}));
|
|
339
|
+
}
|
|
340
|
+
else {
|
|
341
|
+
await pretty_logger_1.PrettyLogger.error(`Test Failed: ${errorMessage}`);
|
|
342
|
+
await pretty_logger_1.PrettyLogger.plain(` Provider: ${resolved}`);
|
|
343
|
+
await pretty_logger_1.PrettyLogger.plain(` Model: ${model}`);
|
|
344
|
+
await pretty_logger_1.PrettyLogger.plain(` Latency: ${latency}ms`);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
async function providerInfoCommand(name, options, outputFormat) {
|
|
349
|
+
if (!name) {
|
|
350
|
+
if (outputFormat === 'json') {
|
|
351
|
+
outputJson(formatError(ERROR_CODES.MISSING_ARG, 'Provider name required'));
|
|
352
|
+
}
|
|
353
|
+
else {
|
|
354
|
+
await pretty_logger_1.PrettyLogger.error('Provider name required. Usage: providers info <name>');
|
|
355
|
+
}
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
const registry = (0, providers_1.getDefaultRegistry)();
|
|
359
|
+
const isRegistered = registry.has(name);
|
|
360
|
+
const isBuiltin = BUILTIN_PROVIDERS.includes(name.toLowerCase());
|
|
361
|
+
const available = (0, providers_1.isProviderAvailable)(name);
|
|
362
|
+
const models = PROVIDER_MODELS[name.toLowerCase()];
|
|
363
|
+
if (outputFormat === 'json') {
|
|
364
|
+
outputJson(formatSuccess({
|
|
365
|
+
name,
|
|
366
|
+
registered: isRegistered,
|
|
367
|
+
available,
|
|
368
|
+
is_builtin: isBuiltin,
|
|
369
|
+
has_api_key: (0, env_1.hasApiKey)(name),
|
|
370
|
+
models: models || []
|
|
371
|
+
}));
|
|
372
|
+
}
|
|
373
|
+
else {
|
|
374
|
+
await pretty_logger_1.PrettyLogger.heading(`Provider: ${name}`);
|
|
375
|
+
await pretty_logger_1.PrettyLogger.plain(` Registered: ${isRegistered ? '✅ Yes' : '❌ No'}`);
|
|
376
|
+
await pretty_logger_1.PrettyLogger.plain(` Available: ${available ? '✅ Yes' : '❌ No'}`);
|
|
377
|
+
await pretty_logger_1.PrettyLogger.plain(` Type: ${isBuiltin ? 'Built-in' : 'Custom'}`);
|
|
378
|
+
await pretty_logger_1.PrettyLogger.plain(` API Key: ${(0, env_1.hasApiKey)(name) ? '🔑 Set' : '⚠️ Not set'}`);
|
|
379
|
+
if (models && models.length > 0) {
|
|
380
|
+
await pretty_logger_1.PrettyLogger.plain('\n Models:');
|
|
381
|
+
for (const model of models) {
|
|
382
|
+
await pretty_logger_1.PrettyLogger.dim(` - ${model}`);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Query Rewrite command - Rewrite queries for better search results
|
|
3
|
+
*/
|
|
4
|
+
export interface QueryRewriteOptions {
|
|
5
|
+
model?: string;
|
|
6
|
+
verbose?: boolean;
|
|
7
|
+
output?: 'json' | 'text' | 'pretty';
|
|
8
|
+
json?: boolean;
|
|
9
|
+
strategy?: string;
|
|
10
|
+
count?: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function execute(args: string[], options: QueryRewriteOptions): Promise<void>;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Query Rewrite command - Rewrite queries for better search results
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.execute = execute;
|
|
40
|
+
const query_rewriter_1 = require("../../agent/query-rewriter");
|
|
41
|
+
const resolve_1 = require("../config/resolve");
|
|
42
|
+
const json_1 = require("../output/json");
|
|
43
|
+
const pretty = __importStar(require("../output/pretty"));
|
|
44
|
+
const cli_spec_1 = require("../spec/cli-spec");
|
|
45
|
+
const errors_1 = require("../output/errors");
|
|
46
|
+
async function execute(args, options) {
|
|
47
|
+
const query = args.join(' ');
|
|
48
|
+
const outputFormat = options.json ? 'json' : (options.output || 'pretty');
|
|
49
|
+
const config = (0, resolve_1.resolveConfig)(options);
|
|
50
|
+
if (!query) {
|
|
51
|
+
if (outputFormat === 'json') {
|
|
52
|
+
(0, json_1.outputJson)((0, json_1.formatError)(errors_1.ERROR_CODES.MISSING_ARG, 'Please provide a query to rewrite'));
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
await pretty.error('Please provide a query to rewrite');
|
|
56
|
+
await pretty.dim('Usage: overai query-rewrite "your search query"');
|
|
57
|
+
}
|
|
58
|
+
process.exit(cli_spec_1.EXIT_CODES.INVALID_ARGUMENTS);
|
|
59
|
+
}
|
|
60
|
+
const startTime = Date.now();
|
|
61
|
+
try {
|
|
62
|
+
if (outputFormat !== 'json') {
|
|
63
|
+
await pretty.info(`Rewriting query: "${query}"`);
|
|
64
|
+
}
|
|
65
|
+
const agent = (0, query_rewriter_1.createQueryRewriterAgent)({
|
|
66
|
+
llm: config.model,
|
|
67
|
+
verbose: options.verbose,
|
|
68
|
+
defaultStrategy: options.strategy
|
|
69
|
+
});
|
|
70
|
+
const result = await agent.rewrite(query);
|
|
71
|
+
const duration = Date.now() - startTime;
|
|
72
|
+
if (outputFormat === 'json') {
|
|
73
|
+
(0, json_1.outputJson)((0, json_1.formatSuccess)({
|
|
74
|
+
originalQuery: query,
|
|
75
|
+
rewrittenQueries: result.rewritten,
|
|
76
|
+
strategy: result.strategy,
|
|
77
|
+
confidence: result.confidence
|
|
78
|
+
}, {
|
|
79
|
+
duration_ms: duration,
|
|
80
|
+
model: config.model
|
|
81
|
+
}));
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
await pretty.heading('Rewritten Queries');
|
|
85
|
+
for (let i = 0; i < result.rewritten.length; i++) {
|
|
86
|
+
await pretty.plain(` ${i + 1}. ${result.rewritten[i]}`);
|
|
87
|
+
}
|
|
88
|
+
await pretty.newline();
|
|
89
|
+
await pretty.dim(`Strategy: ${result.strategy}`);
|
|
90
|
+
await pretty.success(`Completed in ${duration}ms`);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
if (outputFormat === 'json') {
|
|
95
|
+
(0, json_1.outputJson)((0, json_1.formatError)(errors_1.ERROR_CODES.UNKNOWN, error instanceof Error ? error.message : String(error)));
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
await pretty.error(error instanceof Error ? error.message : String(error));
|
|
99
|
+
}
|
|
100
|
+
process.exit(cli_spec_1.EXIT_CODES.RUNTIME_ERROR);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* CLI command: repo-map
|
|
4
|
+
* Repository structure visualization and symbol extraction
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.execute = execute;
|
|
8
|
+
const repo_map_1 = require("../features/repo-map");
|
|
9
|
+
async function execute(args, options) {
|
|
10
|
+
const subcommand = args[0] || 'tree';
|
|
11
|
+
const isJson = Boolean(options.output === 'json' || options.json);
|
|
12
|
+
switch (subcommand) {
|
|
13
|
+
case 'tree':
|
|
14
|
+
await handleTree(args.slice(1), options, isJson);
|
|
15
|
+
break;
|
|
16
|
+
case 'symbols':
|
|
17
|
+
await handleSymbols(args.slice(1), options, isJson);
|
|
18
|
+
break;
|
|
19
|
+
case 'help':
|
|
20
|
+
default:
|
|
21
|
+
if (subcommand !== 'help' && !subcommand.startsWith('-')) {
|
|
22
|
+
// Treat as path for tree command
|
|
23
|
+
await handleTree([subcommand, ...args.slice(1)], options, isJson);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
showHelp(isJson);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
async function handleTree(args, options, isJson) {
|
|
31
|
+
const rootPath = args[0] || process.cwd();
|
|
32
|
+
const maxDepth = options.depth || 5;
|
|
33
|
+
const includeSymbols = Boolean(options.symbols);
|
|
34
|
+
const map = (0, repo_map_1.createRepoMap)({
|
|
35
|
+
rootPath,
|
|
36
|
+
maxDepth,
|
|
37
|
+
includeSymbols
|
|
38
|
+
});
|
|
39
|
+
try {
|
|
40
|
+
const result = await map.generate();
|
|
41
|
+
if (isJson) {
|
|
42
|
+
console.log(JSON.stringify({
|
|
43
|
+
success: true,
|
|
44
|
+
root: result.root,
|
|
45
|
+
totalFiles: result.totalFiles,
|
|
46
|
+
totalDirectories: result.totalDirectories,
|
|
47
|
+
symbolCount: result.symbols.length
|
|
48
|
+
}, null, 2));
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
console.log(result.summary);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
if (isJson) {
|
|
56
|
+
console.log(JSON.stringify({ success: false, error: error.message }));
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
console.error(`Error: ${error.message}`);
|
|
60
|
+
}
|
|
61
|
+
process.exit(1);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
async function handleSymbols(args, options, isJson) {
|
|
65
|
+
const rootPath = args[0] || process.cwd();
|
|
66
|
+
const maxDepth = options.depth || 5;
|
|
67
|
+
const map = (0, repo_map_1.createRepoMap)({
|
|
68
|
+
rootPath,
|
|
69
|
+
maxDepth,
|
|
70
|
+
includeSymbols: true
|
|
71
|
+
});
|
|
72
|
+
try {
|
|
73
|
+
const result = await map.generate();
|
|
74
|
+
if (isJson) {
|
|
75
|
+
console.log(JSON.stringify({
|
|
76
|
+
success: true,
|
|
77
|
+
symbols: result.symbols,
|
|
78
|
+
count: result.symbols.length
|
|
79
|
+
}, null, 2));
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
console.log(`Symbols in ${rootPath}:\n`);
|
|
83
|
+
const byType = {};
|
|
84
|
+
for (const sym of result.symbols) {
|
|
85
|
+
if (!byType[sym.type])
|
|
86
|
+
byType[sym.type] = [];
|
|
87
|
+
byType[sym.type].push(sym);
|
|
88
|
+
}
|
|
89
|
+
for (const [type, symbols] of Object.entries(byType)) {
|
|
90
|
+
console.log(`${type}s (${symbols.length}):`);
|
|
91
|
+
for (const sym of symbols.slice(0, 20)) {
|
|
92
|
+
const exported = sym.exported ? ' [exported]' : '';
|
|
93
|
+
console.log(` ${sym.name}${exported} (line ${sym.line})`);
|
|
94
|
+
}
|
|
95
|
+
if (symbols.length > 20) {
|
|
96
|
+
console.log(` ... and ${symbols.length - 20} more`);
|
|
97
|
+
}
|
|
98
|
+
console.log();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
if (isJson) {
|
|
104
|
+
console.log(JSON.stringify({ success: false, error: error.message }));
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
console.error(`Error: ${error.message}`);
|
|
108
|
+
}
|
|
109
|
+
process.exit(1);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
function showHelp(isJson) {
|
|
113
|
+
const help = {
|
|
114
|
+
command: 'repo-map',
|
|
115
|
+
description: 'Repository structure visualization and symbol extraction',
|
|
116
|
+
subcommands: {
|
|
117
|
+
tree: 'Show repository tree structure',
|
|
118
|
+
symbols: 'Extract and list code symbols'
|
|
119
|
+
},
|
|
120
|
+
flags: {
|
|
121
|
+
'--depth': 'Maximum directory depth (default: 5)',
|
|
122
|
+
'--symbols': 'Include symbols in tree output',
|
|
123
|
+
'--json': 'Output in JSON format'
|
|
124
|
+
},
|
|
125
|
+
examples: [
|
|
126
|
+
'overai repo-map',
|
|
127
|
+
'overai repo-map tree ./src',
|
|
128
|
+
'overai repo-map tree --depth 3',
|
|
129
|
+
'overai repo-map symbols ./src',
|
|
130
|
+
'overai repo-map tree --symbols'
|
|
131
|
+
]
|
|
132
|
+
};
|
|
133
|
+
if (isJson) {
|
|
134
|
+
console.log(JSON.stringify(help, null, 2));
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
console.log('Repo Map - Repository visualization\n');
|
|
138
|
+
console.log('Subcommands:');
|
|
139
|
+
for (const [cmd, desc] of Object.entries(help.subcommands)) {
|
|
140
|
+
console.log(` ${cmd.padEnd(12)} ${desc}`);
|
|
141
|
+
}
|
|
142
|
+
console.log('\nFlags:');
|
|
143
|
+
for (const [flag, desc] of Object.entries(help.flags)) {
|
|
144
|
+
console.log(` ${flag.padEnd(12)} ${desc}`);
|
|
145
|
+
}
|
|
146
|
+
console.log('\nExamples:');
|
|
147
|
+
for (const ex of help.examples) {
|
|
148
|
+
console.log(` ${ex}`);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reranker command - Document reranking
|
|
3
|
+
*/
|
|
4
|
+
export interface RerankerOptions {
|
|
5
|
+
verbose?: boolean;
|
|
6
|
+
output?: 'json' | 'text' | 'pretty';
|
|
7
|
+
json?: boolean;
|
|
8
|
+
provider?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function execute(args: string[], options: RerankerOptions): Promise<void>;
|