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,147 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* BaseTool - Abstract base class for creating custom tools (plugins)
|
|
4
|
+
*
|
|
5
|
+
* This provides the same extensibility pattern as Python's BaseTool.
|
|
6
|
+
* External developers can create plugins by extending BaseTool.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* import { BaseTool } from 'praisonai';
|
|
10
|
+
*
|
|
11
|
+
* class MyTool extends BaseTool {
|
|
12
|
+
* name = 'my_tool';
|
|
13
|
+
* description = 'Does something useful';
|
|
14
|
+
*
|
|
15
|
+
* async run(params: { query: string }): Promise<string> {
|
|
16
|
+
* return `Result for ${params.query}`;
|
|
17
|
+
* }
|
|
18
|
+
* }
|
|
19
|
+
*/
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.BaseTool = exports.ToolValidationError = void 0;
|
|
22
|
+
exports.validateTool = validateTool;
|
|
23
|
+
exports.createTool = createTool;
|
|
24
|
+
class ToolValidationError extends Error {
|
|
25
|
+
constructor(message) {
|
|
26
|
+
super(message);
|
|
27
|
+
this.name = 'ToolValidationError';
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.ToolValidationError = ToolValidationError;
|
|
31
|
+
/**
|
|
32
|
+
* Abstract base class for all PraisonAI tools.
|
|
33
|
+
*
|
|
34
|
+
* Subclass this to create custom tools that can be:
|
|
35
|
+
* - Used directly by agents
|
|
36
|
+
* - Distributed as npm packages (plugins)
|
|
37
|
+
* - Auto-discovered via package.json
|
|
38
|
+
*/
|
|
39
|
+
class BaseTool {
|
|
40
|
+
constructor() {
|
|
41
|
+
/** Tool version string */
|
|
42
|
+
this.version = '1.0.0';
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Allow tool to be called directly like a function.
|
|
46
|
+
*/
|
|
47
|
+
async execute(params) {
|
|
48
|
+
return this.run(params);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Execute tool with error handling, returning ToolResult.
|
|
52
|
+
*/
|
|
53
|
+
async safeRun(params) {
|
|
54
|
+
try {
|
|
55
|
+
const output = await this.run(params);
|
|
56
|
+
return { output, success: true };
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
return {
|
|
60
|
+
output: null,
|
|
61
|
+
success: false,
|
|
62
|
+
error: error.message
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Get OpenAI-compatible function schema for this tool.
|
|
68
|
+
*/
|
|
69
|
+
getSchema() {
|
|
70
|
+
return {
|
|
71
|
+
type: 'function',
|
|
72
|
+
function: {
|
|
73
|
+
name: this.name,
|
|
74
|
+
description: this.description,
|
|
75
|
+
parameters: this.parameters || { type: 'object', properties: {}, required: [] }
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Validate the tool configuration.
|
|
81
|
+
*/
|
|
82
|
+
validate() {
|
|
83
|
+
const errors = [];
|
|
84
|
+
if (!this.name || typeof this.name !== 'string') {
|
|
85
|
+
errors.push("Tool must have a non-empty string 'name'");
|
|
86
|
+
}
|
|
87
|
+
if (!this.description || typeof this.description !== 'string') {
|
|
88
|
+
errors.push("Tool must have a non-empty string 'description'");
|
|
89
|
+
}
|
|
90
|
+
if (errors.length > 0) {
|
|
91
|
+
throw new ToolValidationError(`Tool '${this.name}' validation failed: ${errors.join('; ')}`);
|
|
92
|
+
}
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
toString() {
|
|
96
|
+
return `${this.constructor.name}(name='${this.name}')`;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
exports.BaseTool = BaseTool;
|
|
100
|
+
/**
|
|
101
|
+
* Validate any tool-like object.
|
|
102
|
+
*/
|
|
103
|
+
function validateTool(tool) {
|
|
104
|
+
if (tool instanceof BaseTool) {
|
|
105
|
+
return tool.validate();
|
|
106
|
+
}
|
|
107
|
+
if (typeof tool === 'function' || (tool && typeof tool.run === 'function')) {
|
|
108
|
+
const name = tool.name || tool.__name__;
|
|
109
|
+
if (!name) {
|
|
110
|
+
throw new ToolValidationError('Tool must have a name');
|
|
111
|
+
}
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
throw new ToolValidationError(`Invalid tool type: ${typeof tool}`);
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Create a simple tool from a function (alternative to class-based approach)
|
|
118
|
+
*/
|
|
119
|
+
function createTool(config) {
|
|
120
|
+
return {
|
|
121
|
+
name: config.name,
|
|
122
|
+
description: config.description,
|
|
123
|
+
version: '1.0.0',
|
|
124
|
+
parameters: config.parameters,
|
|
125
|
+
run: config.run,
|
|
126
|
+
execute: async (params) => config.run(params),
|
|
127
|
+
safeRun: async (params) => {
|
|
128
|
+
try {
|
|
129
|
+
const output = await config.run(params);
|
|
130
|
+
return { output, success: true };
|
|
131
|
+
}
|
|
132
|
+
catch (error) {
|
|
133
|
+
return { output: null, success: false, error: error.message };
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
getSchema: () => ({
|
|
137
|
+
type: 'function',
|
|
138
|
+
function: {
|
|
139
|
+
name: config.name,
|
|
140
|
+
description: config.description,
|
|
141
|
+
parameters: config.parameters || { type: 'object', properties: {}, required: [] }
|
|
142
|
+
}
|
|
143
|
+
}),
|
|
144
|
+
validate: () => true,
|
|
145
|
+
toString: () => `Tool(name='${config.name}')`
|
|
146
|
+
};
|
|
147
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Airweave Tool
|
|
3
|
+
*
|
|
4
|
+
* Context retrieval and semantic search across connected data sources.
|
|
5
|
+
* Package: @airweave/sdk
|
|
6
|
+
*/
|
|
7
|
+
import type { ToolMetadata, PraisonTool } from '../registry/types';
|
|
8
|
+
export declare const AIRWEAVE_METADATA: ToolMetadata;
|
|
9
|
+
export interface AirweaveSearchConfig {
|
|
10
|
+
limit?: number;
|
|
11
|
+
threshold?: number;
|
|
12
|
+
sources?: string[];
|
|
13
|
+
}
|
|
14
|
+
export interface AirweaveSearchInput {
|
|
15
|
+
query: string;
|
|
16
|
+
}
|
|
17
|
+
export interface AirweaveSearchResult {
|
|
18
|
+
results: Array<{
|
|
19
|
+
content: string;
|
|
20
|
+
source: string;
|
|
21
|
+
score: number;
|
|
22
|
+
metadata?: Record<string, unknown>;
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Create an Airweave Search tool
|
|
27
|
+
*/
|
|
28
|
+
export declare function airweaveSearch(config?: AirweaveSearchConfig): PraisonTool<AirweaveSearchInput, AirweaveSearchResult>;
|
|
29
|
+
/**
|
|
30
|
+
* Factory function for registry
|
|
31
|
+
*/
|
|
32
|
+
export declare function createAirweaveSearchTool(config?: AirweaveSearchConfig): PraisonTool<unknown, unknown>;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Airweave Tool
|
|
4
|
+
*
|
|
5
|
+
* Context retrieval and semantic search across connected data sources.
|
|
6
|
+
* Package: @airweave/sdk
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
+
}) : function(o, v) {
|
|
22
|
+
o["default"] = v;
|
|
23
|
+
});
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.AIRWEAVE_METADATA = void 0;
|
|
43
|
+
exports.airweaveSearch = airweaveSearch;
|
|
44
|
+
exports.createAirweaveSearchTool = createAirweaveSearchTool;
|
|
45
|
+
const types_1 = require("../registry/types");
|
|
46
|
+
exports.AIRWEAVE_METADATA = {
|
|
47
|
+
id: 'airweave',
|
|
48
|
+
displayName: 'Airweave',
|
|
49
|
+
description: 'Context retrieval and semantic search across connected data sources for RAG applications',
|
|
50
|
+
tags: ['rag', 'semantic-search', 'retrieval', 'context'],
|
|
51
|
+
requiredEnv: ['AIRWEAVE_API_KEY'],
|
|
52
|
+
optionalEnv: ['AIRWEAVE_BASE_URL'],
|
|
53
|
+
install: {
|
|
54
|
+
npm: 'npm install @airweave/sdk',
|
|
55
|
+
pnpm: 'pnpm add @airweave/sdk',
|
|
56
|
+
yarn: 'yarn add @airweave/sdk',
|
|
57
|
+
bun: 'bun add @airweave/sdk',
|
|
58
|
+
},
|
|
59
|
+
docsSlug: 'tools/airweave',
|
|
60
|
+
capabilities: {
|
|
61
|
+
rag: true,
|
|
62
|
+
search: true,
|
|
63
|
+
},
|
|
64
|
+
packageName: '@airweave/sdk',
|
|
65
|
+
};
|
|
66
|
+
async function loadAirweavePackage() {
|
|
67
|
+
if (!process.env.AIRWEAVE_API_KEY) {
|
|
68
|
+
throw new types_1.MissingEnvVarError(exports.AIRWEAVE_METADATA.id, 'AIRWEAVE_API_KEY', exports.AIRWEAVE_METADATA.docsSlug);
|
|
69
|
+
}
|
|
70
|
+
try {
|
|
71
|
+
return await Promise.resolve().then(() => __importStar(require('@airweave/sdk')));
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
throw new types_1.MissingDependencyError(exports.AIRWEAVE_METADATA.id, exports.AIRWEAVE_METADATA.packageName, exports.AIRWEAVE_METADATA.install, exports.AIRWEAVE_METADATA.requiredEnv, exports.AIRWEAVE_METADATA.docsSlug);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Create an Airweave Search tool
|
|
79
|
+
*/
|
|
80
|
+
function airweaveSearch(config) {
|
|
81
|
+
return {
|
|
82
|
+
name: 'airweaveSearch',
|
|
83
|
+
description: 'Search across connected data sources using semantic search. Returns relevant context for RAG applications.',
|
|
84
|
+
parameters: {
|
|
85
|
+
type: 'object',
|
|
86
|
+
properties: {
|
|
87
|
+
query: {
|
|
88
|
+
type: 'string',
|
|
89
|
+
description: 'The search query',
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
required: ['query'],
|
|
93
|
+
},
|
|
94
|
+
execute: async (input, context) => {
|
|
95
|
+
const pkg = await loadAirweavePackage();
|
|
96
|
+
// Airweave SDK uses a client-based API
|
|
97
|
+
const AirweaveClient = pkg.AirweaveClient ||
|
|
98
|
+
pkg.Airweave ||
|
|
99
|
+
pkg.default;
|
|
100
|
+
if (AirweaveClient && typeof AirweaveClient === 'function') {
|
|
101
|
+
const client = new AirweaveClient({
|
|
102
|
+
apiKey: process.env.AIRWEAVE_API_KEY,
|
|
103
|
+
baseUrl: process.env.AIRWEAVE_BASE_URL,
|
|
104
|
+
});
|
|
105
|
+
const result = await client.search(input.query, config);
|
|
106
|
+
return {
|
|
107
|
+
results: result.results || [],
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
return { results: [] };
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Factory function for registry
|
|
116
|
+
*/
|
|
117
|
+
function createAirweaveSearchTool(config) {
|
|
118
|
+
return airweaveSearch(config);
|
|
119
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Amazon Bedrock AgentCore Tools
|
|
3
|
+
*
|
|
4
|
+
* Code Interpreter and Browser automation powered by AWS.
|
|
5
|
+
* Package: bedrock-agentcore
|
|
6
|
+
*/
|
|
7
|
+
import type { ToolMetadata, PraisonTool } from '../registry/types';
|
|
8
|
+
export declare const BEDROCK_AGENTCORE_METADATA: ToolMetadata;
|
|
9
|
+
export interface CodeInterpreterConfig {
|
|
10
|
+
language?: 'python' | 'javascript' | 'typescript';
|
|
11
|
+
timeout?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface CodeInterpreterInput {
|
|
14
|
+
code: string;
|
|
15
|
+
}
|
|
16
|
+
export interface CodeInterpreterResult {
|
|
17
|
+
output: string;
|
|
18
|
+
success: boolean;
|
|
19
|
+
error?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface BrowserConfig {
|
|
22
|
+
headless?: boolean;
|
|
23
|
+
timeout?: number;
|
|
24
|
+
}
|
|
25
|
+
export interface BrowserNavigateInput {
|
|
26
|
+
url: string;
|
|
27
|
+
}
|
|
28
|
+
export interface BrowserClickInput {
|
|
29
|
+
selector: string;
|
|
30
|
+
}
|
|
31
|
+
export interface BrowserFillInput {
|
|
32
|
+
selector: string;
|
|
33
|
+
value: string;
|
|
34
|
+
}
|
|
35
|
+
export interface BrowserResult {
|
|
36
|
+
success: boolean;
|
|
37
|
+
data?: unknown;
|
|
38
|
+
error?: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Create a Bedrock Code Interpreter tool
|
|
42
|
+
*/
|
|
43
|
+
export declare function bedrockCodeInterpreter(config?: CodeInterpreterConfig): PraisonTool<CodeInterpreterInput, CodeInterpreterResult>;
|
|
44
|
+
/**
|
|
45
|
+
* Create a Bedrock Browser Navigate tool
|
|
46
|
+
*/
|
|
47
|
+
export declare function bedrockBrowserNavigate(config?: BrowserConfig): PraisonTool<BrowserNavigateInput, BrowserResult>;
|
|
48
|
+
/**
|
|
49
|
+
* Create a Bedrock Browser Click tool
|
|
50
|
+
*/
|
|
51
|
+
export declare function bedrockBrowserClick(config?: BrowserConfig): PraisonTool<BrowserClickInput, BrowserResult>;
|
|
52
|
+
/**
|
|
53
|
+
* Create a Bedrock Browser Fill tool
|
|
54
|
+
*/
|
|
55
|
+
export declare function bedrockBrowserFill(config?: BrowserConfig): PraisonTool<BrowserFillInput, BrowserResult>;
|
|
56
|
+
/**
|
|
57
|
+
* Factory functions for registry
|
|
58
|
+
*/
|
|
59
|
+
export declare function createBedrockCodeInterpreterTool(config?: CodeInterpreterConfig): PraisonTool<unknown, unknown>;
|
|
60
|
+
export declare function createBedrockBrowserNavigateTool(config?: BrowserConfig): PraisonTool<unknown, unknown>;
|
|
61
|
+
export declare function createBedrockBrowserClickTool(config?: BrowserConfig): PraisonTool<unknown, unknown>;
|
|
62
|
+
export declare function createBedrockBrowserFillTool(config?: BrowserConfig): PraisonTool<unknown, unknown>;
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Amazon Bedrock AgentCore Tools
|
|
4
|
+
*
|
|
5
|
+
* Code Interpreter and Browser automation powered by AWS.
|
|
6
|
+
* Package: bedrock-agentcore
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
+
}) : function(o, v) {
|
|
22
|
+
o["default"] = v;
|
|
23
|
+
});
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.BEDROCK_AGENTCORE_METADATA = void 0;
|
|
43
|
+
exports.bedrockCodeInterpreter = bedrockCodeInterpreter;
|
|
44
|
+
exports.bedrockBrowserNavigate = bedrockBrowserNavigate;
|
|
45
|
+
exports.bedrockBrowserClick = bedrockBrowserClick;
|
|
46
|
+
exports.bedrockBrowserFill = bedrockBrowserFill;
|
|
47
|
+
exports.createBedrockCodeInterpreterTool = createBedrockCodeInterpreterTool;
|
|
48
|
+
exports.createBedrockBrowserNavigateTool = createBedrockBrowserNavigateTool;
|
|
49
|
+
exports.createBedrockBrowserClickTool = createBedrockBrowserClickTool;
|
|
50
|
+
exports.createBedrockBrowserFillTool = createBedrockBrowserFillTool;
|
|
51
|
+
const types_1 = require("../registry/types");
|
|
52
|
+
exports.BEDROCK_AGENTCORE_METADATA = {
|
|
53
|
+
id: 'bedrock-agentcore',
|
|
54
|
+
displayName: 'Amazon Bedrock AgentCore',
|
|
55
|
+
description: 'Code interpreter and browser automation powered by AWS Bedrock AgentCore',
|
|
56
|
+
tags: ['sandbox', 'code', 'browser', 'aws'],
|
|
57
|
+
requiredEnv: [], // Uses AWS credentials from environment/config
|
|
58
|
+
optionalEnv: ['AWS_ACCESS_KEY_ID', 'AWS_SECRET_ACCESS_KEY', 'AWS_REGION'],
|
|
59
|
+
install: {
|
|
60
|
+
npm: 'npm install bedrock-agentcore',
|
|
61
|
+
pnpm: 'pnpm add bedrock-agentcore',
|
|
62
|
+
yarn: 'yarn add bedrock-agentcore',
|
|
63
|
+
bun: 'bun add bedrock-agentcore',
|
|
64
|
+
},
|
|
65
|
+
docsSlug: 'tools/bedrock-agentcore',
|
|
66
|
+
capabilities: {
|
|
67
|
+
sandbox: true,
|
|
68
|
+
code: true,
|
|
69
|
+
browser: true,
|
|
70
|
+
},
|
|
71
|
+
packageName: 'bedrock-agentcore',
|
|
72
|
+
};
|
|
73
|
+
async function loadBedrockPackage() {
|
|
74
|
+
try {
|
|
75
|
+
// @ts-ignore - Optional dependency
|
|
76
|
+
return await Promise.resolve().then(() => __importStar(require('bedrock-agentcore')));
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
throw new types_1.MissingDependencyError(exports.BEDROCK_AGENTCORE_METADATA.id, exports.BEDROCK_AGENTCORE_METADATA.packageName, exports.BEDROCK_AGENTCORE_METADATA.install, exports.BEDROCK_AGENTCORE_METADATA.requiredEnv, exports.BEDROCK_AGENTCORE_METADATA.docsSlug);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Create a Bedrock Code Interpreter tool
|
|
84
|
+
*/
|
|
85
|
+
function bedrockCodeInterpreter(config) {
|
|
86
|
+
return {
|
|
87
|
+
name: 'bedrockCodeInterpreter',
|
|
88
|
+
description: 'Execute code in a secure AWS-managed sandbox. Supports Python, JavaScript, and TypeScript.',
|
|
89
|
+
parameters: {
|
|
90
|
+
type: 'object',
|
|
91
|
+
properties: {
|
|
92
|
+
code: {
|
|
93
|
+
type: 'string',
|
|
94
|
+
description: 'The code to execute',
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
required: ['code'],
|
|
98
|
+
},
|
|
99
|
+
execute: async (input, context) => {
|
|
100
|
+
const pkg = await loadBedrockPackage();
|
|
101
|
+
// Try to get CodeInterpreterTools from the package
|
|
102
|
+
const CodeInterpreterTools = pkg.CodeInterpreterTools;
|
|
103
|
+
if (CodeInterpreterTools && typeof CodeInterpreterTools === 'function') {
|
|
104
|
+
const interpreter = new CodeInterpreterTools();
|
|
105
|
+
// Find the execute code tool
|
|
106
|
+
const executeTool = interpreter.tools?.executeCode;
|
|
107
|
+
if (executeTool && typeof executeTool.execute === 'function') {
|
|
108
|
+
const result = await executeTool.execute(input);
|
|
109
|
+
return {
|
|
110
|
+
output: String(result),
|
|
111
|
+
success: true,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return { output: '', success: false, error: 'Code interpreter not available' };
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Create a Bedrock Browser Navigate tool
|
|
121
|
+
*/
|
|
122
|
+
function bedrockBrowserNavigate(config) {
|
|
123
|
+
return {
|
|
124
|
+
name: 'bedrockBrowserNavigate',
|
|
125
|
+
description: 'Navigate to a URL using cloud-based browser automation.',
|
|
126
|
+
parameters: {
|
|
127
|
+
type: 'object',
|
|
128
|
+
properties: {
|
|
129
|
+
url: {
|
|
130
|
+
type: 'string',
|
|
131
|
+
description: 'The URL to navigate to',
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
required: ['url'],
|
|
135
|
+
},
|
|
136
|
+
execute: async (input, context) => {
|
|
137
|
+
const pkg = await loadBedrockPackage();
|
|
138
|
+
const BrowserTools = pkg.BrowserTools;
|
|
139
|
+
if (BrowserTools && typeof BrowserTools === 'function') {
|
|
140
|
+
const browser = new BrowserTools();
|
|
141
|
+
const navigateTool = browser.tools?.navigate;
|
|
142
|
+
if (navigateTool && typeof navigateTool.execute === 'function') {
|
|
143
|
+
await navigateTool.execute(input);
|
|
144
|
+
return { success: true };
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return { success: false, error: 'Browser tools not available' };
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Create a Bedrock Browser Click tool
|
|
153
|
+
*/
|
|
154
|
+
function bedrockBrowserClick(config) {
|
|
155
|
+
return {
|
|
156
|
+
name: 'bedrockBrowserClick',
|
|
157
|
+
description: 'Click an element on the page using a CSS selector.',
|
|
158
|
+
parameters: {
|
|
159
|
+
type: 'object',
|
|
160
|
+
properties: {
|
|
161
|
+
selector: {
|
|
162
|
+
type: 'string',
|
|
163
|
+
description: 'CSS selector for the element to click',
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
required: ['selector'],
|
|
167
|
+
},
|
|
168
|
+
execute: async (input, context) => {
|
|
169
|
+
const pkg = await loadBedrockPackage();
|
|
170
|
+
const BrowserTools = pkg.BrowserTools;
|
|
171
|
+
if (BrowserTools && typeof BrowserTools === 'function') {
|
|
172
|
+
const browser = new BrowserTools();
|
|
173
|
+
const clickTool = browser.tools?.click;
|
|
174
|
+
if (clickTool && typeof clickTool.execute === 'function') {
|
|
175
|
+
await clickTool.execute(input);
|
|
176
|
+
return { success: true };
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return { success: false, error: 'Browser tools not available' };
|
|
180
|
+
},
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Create a Bedrock Browser Fill tool
|
|
185
|
+
*/
|
|
186
|
+
function bedrockBrowserFill(config) {
|
|
187
|
+
return {
|
|
188
|
+
name: 'bedrockBrowserFill',
|
|
189
|
+
description: 'Fill a form field with text using a CSS selector.',
|
|
190
|
+
parameters: {
|
|
191
|
+
type: 'object',
|
|
192
|
+
properties: {
|
|
193
|
+
selector: {
|
|
194
|
+
type: 'string',
|
|
195
|
+
description: 'CSS selector for the input element',
|
|
196
|
+
},
|
|
197
|
+
value: {
|
|
198
|
+
type: 'string',
|
|
199
|
+
description: 'The value to fill in',
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
required: ['selector', 'value'],
|
|
203
|
+
},
|
|
204
|
+
execute: async (input, context) => {
|
|
205
|
+
const pkg = await loadBedrockPackage();
|
|
206
|
+
const BrowserTools = pkg.BrowserTools;
|
|
207
|
+
if (BrowserTools && typeof BrowserTools === 'function') {
|
|
208
|
+
const browser = new BrowserTools();
|
|
209
|
+
const fillTool = browser.tools?.fill;
|
|
210
|
+
if (fillTool && typeof fillTool.execute === 'function') {
|
|
211
|
+
await fillTool.execute(input);
|
|
212
|
+
return { success: true };
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return { success: false, error: 'Browser tools not available' };
|
|
216
|
+
},
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Factory functions for registry
|
|
221
|
+
*/
|
|
222
|
+
function createBedrockCodeInterpreterTool(config) {
|
|
223
|
+
return bedrockCodeInterpreter(config);
|
|
224
|
+
}
|
|
225
|
+
function createBedrockBrowserNavigateTool(config) {
|
|
226
|
+
return bedrockBrowserNavigate(config);
|
|
227
|
+
}
|
|
228
|
+
function createBedrockBrowserClickTool(config) {
|
|
229
|
+
return bedrockBrowserClick(config);
|
|
230
|
+
}
|
|
231
|
+
function createBedrockBrowserFillTool(config) {
|
|
232
|
+
return bedrockBrowserFill(config);
|
|
233
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Execution Tool (Vercel Sandbox)
|
|
3
|
+
*
|
|
4
|
+
* Execute Python code in a sandboxed Vercel environment.
|
|
5
|
+
* Package: ai-sdk-tool-code-execution
|
|
6
|
+
*/
|
|
7
|
+
import type { ToolMetadata, PraisonTool } from '../registry/types';
|
|
8
|
+
export declare const CODE_EXECUTION_METADATA: ToolMetadata;
|
|
9
|
+
export interface CodeExecutionConfig {
|
|
10
|
+
/** Enable debug logging */
|
|
11
|
+
debug?: boolean;
|
|
12
|
+
/** Execution timeout in ms */
|
|
13
|
+
timeoutMs?: number;
|
|
14
|
+
}
|
|
15
|
+
export interface CodeExecutionInput {
|
|
16
|
+
/** Python code to execute */
|
|
17
|
+
code: string;
|
|
18
|
+
}
|
|
19
|
+
export interface CodeExecutionOutput {
|
|
20
|
+
/** Execution result/output */
|
|
21
|
+
result: string;
|
|
22
|
+
/** Standard output */
|
|
23
|
+
stdout?: string;
|
|
24
|
+
/** Standard error */
|
|
25
|
+
stderr?: string;
|
|
26
|
+
/** Execution success */
|
|
27
|
+
success: boolean;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Create a Code Execution tool instance
|
|
31
|
+
*/
|
|
32
|
+
export declare function codeExecution(config?: CodeExecutionConfig): PraisonTool<CodeExecutionInput, CodeExecutionOutput>;
|
|
33
|
+
/**
|
|
34
|
+
* Factory function for registry
|
|
35
|
+
*/
|
|
36
|
+
export declare function createCodeExecutionTool(config?: CodeExecutionConfig): PraisonTool<unknown, unknown>;
|