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,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tools Facade - Simple API for accessing all built-in tools
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* import { tools } from 'praisonai';
|
|
6
|
+
* const agent = new Agent({ tools: [tools.tavily(), tools.codeExecution()] });
|
|
7
|
+
*/
|
|
8
|
+
import type { PraisonTool } from './registry/types';
|
|
9
|
+
import type { CodeExecutionConfig } from './builtins/code-execution';
|
|
10
|
+
import type { TavilySearchConfig, TavilyExtractConfig, TavilyCrawlConfig } from './builtins/tavily';
|
|
11
|
+
import type { ExaSearchConfig } from './builtins/exa';
|
|
12
|
+
import type { PerplexitySearchConfig } from './builtins/perplexity';
|
|
13
|
+
import type { ParallelSearchConfig } from './builtins/parallel';
|
|
14
|
+
import type { FirecrawlScrapeConfig, FirecrawlCrawlConfig } from './builtins/firecrawl';
|
|
15
|
+
import type { GuardConfig, RedactConfig, VerifyConfig } from './builtins/superagent';
|
|
16
|
+
import type { ValyuSearchConfig } from './builtins/valyu';
|
|
17
|
+
import type { CodeInterpreterConfig, BrowserConfig } from './builtins/bedrock-agentcore';
|
|
18
|
+
import type { AirweaveSearchConfig } from './builtins/airweave';
|
|
19
|
+
import type { CodeModeConfig } from './builtins/code-mode';
|
|
20
|
+
import type { CustomToolConfig } from './builtins/custom';
|
|
21
|
+
/**
|
|
22
|
+
* Register all built-in tools with the global registry
|
|
23
|
+
*/
|
|
24
|
+
export declare function registerBuiltinTools(): void;
|
|
25
|
+
/**
|
|
26
|
+
* Tools facade - provides simple access to all built-in tools
|
|
27
|
+
*/
|
|
28
|
+
export declare const tools: {
|
|
29
|
+
codeExecution: (config?: CodeExecutionConfig) => PraisonTool<import("./builtins/code-execution").CodeExecutionInput, import("./builtins/code-execution").CodeExecutionOutput>;
|
|
30
|
+
executeCode: (config?: CodeExecutionConfig) => PraisonTool<import("./builtins/code-execution").CodeExecutionInput, import("./builtins/code-execution").CodeExecutionOutput>;
|
|
31
|
+
tavily: (config?: TavilySearchConfig) => PraisonTool<import("./builtins/tavily").TavilySearchInput, import("./builtins/tavily").TavilySearchResult>;
|
|
32
|
+
tavilySearch: (config?: TavilySearchConfig) => PraisonTool<import("./builtins/tavily").TavilySearchInput, import("./builtins/tavily").TavilySearchResult>;
|
|
33
|
+
tavilyExtract: (config?: TavilyExtractConfig) => PraisonTool<import("./builtins/tavily").TavilyExtractInput, import("./builtins/tavily").TavilyExtractResult>;
|
|
34
|
+
tavilyCrawl: (config?: TavilyCrawlConfig) => PraisonTool<import("./builtins/tavily").TavilyCrawlInput, import("./builtins/tavily").TavilyCrawlResult>;
|
|
35
|
+
exa: (config?: ExaSearchConfig) => PraisonTool<import("./builtins/exa").ExaSearchInput, import("./builtins/exa").ExaSearchResult>;
|
|
36
|
+
exaSearch: (config?: ExaSearchConfig) => PraisonTool<import("./builtins/exa").ExaSearchInput, import("./builtins/exa").ExaSearchResult>;
|
|
37
|
+
perplexity: (config?: PerplexitySearchConfig) => PraisonTool<import("./builtins/perplexity").PerplexitySearchInput, import("./builtins/perplexity").PerplexitySearchResult>;
|
|
38
|
+
perplexitySearch: (config?: PerplexitySearchConfig) => PraisonTool<import("./builtins/perplexity").PerplexitySearchInput, import("./builtins/perplexity").PerplexitySearchResult>;
|
|
39
|
+
parallel: (config?: ParallelSearchConfig) => PraisonTool<import("./builtins/parallel").ParallelSearchInput, import("./builtins/parallel").ParallelSearchResult>;
|
|
40
|
+
parallelSearch: (config?: ParallelSearchConfig) => PraisonTool<import("./builtins/parallel").ParallelSearchInput, import("./builtins/parallel").ParallelSearchResult>;
|
|
41
|
+
firecrawl: (config?: FirecrawlScrapeConfig) => PraisonTool<import("./builtins/firecrawl").FirecrawlScrapeInput, import("./builtins/firecrawl").FirecrawlScrapeResult>;
|
|
42
|
+
firecrawlScrape: (config?: FirecrawlScrapeConfig) => PraisonTool<import("./builtins/firecrawl").FirecrawlScrapeInput, import("./builtins/firecrawl").FirecrawlScrapeResult>;
|
|
43
|
+
firecrawlCrawl: (config?: FirecrawlCrawlConfig) => PraisonTool<import("./builtins/firecrawl").FirecrawlCrawlInput, import("./builtins/firecrawl").FirecrawlCrawlResult>;
|
|
44
|
+
guard: (config?: GuardConfig) => PraisonTool<import("./builtins/superagent").GuardInput, import("./builtins/superagent").GuardResult>;
|
|
45
|
+
redact: (config?: RedactConfig) => PraisonTool<import("./builtins/superagent").RedactInput, import("./builtins/superagent").RedactResult>;
|
|
46
|
+
verify: (config?: VerifyConfig) => PraisonTool<import("./builtins/superagent").VerifyInput, import("./builtins/superagent").VerifyResult>;
|
|
47
|
+
superagentGuard: (config?: GuardConfig) => PraisonTool<import("./builtins/superagent").GuardInput, import("./builtins/superagent").GuardResult>;
|
|
48
|
+
superagentRedact: (config?: RedactConfig) => PraisonTool<import("./builtins/superagent").RedactInput, import("./builtins/superagent").RedactResult>;
|
|
49
|
+
superagentVerify: (config?: VerifyConfig) => PraisonTool<import("./builtins/superagent").VerifyInput, import("./builtins/superagent").VerifyResult>;
|
|
50
|
+
valyuWebSearch: (config?: ValyuSearchConfig) => PraisonTool<import("./builtins/valyu").ValyuSearchInput, import("./builtins/valyu").ValyuSearchResult>;
|
|
51
|
+
valyuFinanceSearch: (config?: ValyuSearchConfig) => PraisonTool<import("./builtins/valyu").ValyuSearchInput, import("./builtins/valyu").ValyuSearchResult>;
|
|
52
|
+
valyuPaperSearch: (config?: ValyuSearchConfig) => PraisonTool<import("./builtins/valyu").ValyuSearchInput, import("./builtins/valyu").ValyuSearchResult>;
|
|
53
|
+
valyuBioSearch: (config?: ValyuSearchConfig) => PraisonTool<import("./builtins/valyu").ValyuSearchInput, import("./builtins/valyu").ValyuSearchResult>;
|
|
54
|
+
valyuPatentSearch: (config?: ValyuSearchConfig) => PraisonTool<import("./builtins/valyu").ValyuSearchInput, import("./builtins/valyu").ValyuSearchResult>;
|
|
55
|
+
valyuSecSearch: (config?: ValyuSearchConfig) => PraisonTool<import("./builtins/valyu").ValyuSearchInput, import("./builtins/valyu").ValyuSearchResult>;
|
|
56
|
+
valyuEconomicsSearch: (config?: ValyuSearchConfig) => PraisonTool<import("./builtins/valyu").ValyuSearchInput, import("./builtins/valyu").ValyuSearchResult>;
|
|
57
|
+
valyuCompanyResearch: (config?: ValyuSearchConfig) => PraisonTool<import("./builtins/valyu").ValyuSearchInput, import("./builtins/valyu").ValyuSearchResult>;
|
|
58
|
+
bedrockCodeInterpreter: (config?: CodeInterpreterConfig) => PraisonTool<import("./builtins/bedrock-agentcore").CodeInterpreterInput, import("./builtins/bedrock-agentcore").CodeInterpreterResult>;
|
|
59
|
+
bedrockBrowserNavigate: (config?: BrowserConfig) => PraisonTool<import("./builtins/bedrock-agentcore").BrowserNavigateInput, import("./builtins/bedrock-agentcore").BrowserResult>;
|
|
60
|
+
bedrockBrowserClick: (config?: BrowserConfig) => PraisonTool<import("./builtins/bedrock-agentcore").BrowserClickInput, import("./builtins/bedrock-agentcore").BrowserResult>;
|
|
61
|
+
bedrockBrowserFill: (config?: BrowserConfig) => PraisonTool<import("./builtins/bedrock-agentcore").BrowserFillInput, import("./builtins/bedrock-agentcore").BrowserResult>;
|
|
62
|
+
airweave: (config?: AirweaveSearchConfig) => PraisonTool<import("./builtins/airweave").AirweaveSearchInput, import("./builtins/airweave").AirweaveSearchResult>;
|
|
63
|
+
airweaveSearch: (config?: AirweaveSearchConfig) => PraisonTool<import("./builtins/airweave").AirweaveSearchInput, import("./builtins/airweave").AirweaveSearchResult>;
|
|
64
|
+
codeMode: (config?: CodeModeConfig) => PraisonTool<import("./builtins/code-mode").CodeModeInput, import("./builtins/code-mode").CodeModeResult>;
|
|
65
|
+
custom: <TInput = unknown, TOutput = unknown>(config: CustomToolConfig<TInput, TOutput>) => PraisonTool<TInput, TOutput>;
|
|
66
|
+
register: <TInput = unknown, TOutput = unknown>(config: CustomToolConfig<TInput, TOutput>) => PraisonTool<TInput, TOutput>;
|
|
67
|
+
fromNpm: (packageName: string, toolName?: string) => Promise<PraisonTool<unknown, unknown>>;
|
|
68
|
+
fromLocal: (filePath: string, toolName?: string) => Promise<PraisonTool<unknown, unknown>>;
|
|
69
|
+
getRegistry: () => import("./registry/registry").ToolsRegistry;
|
|
70
|
+
list: () => import("./registry/types").ToolMetadata[];
|
|
71
|
+
get: (id: string) => import("./registry/types").ToolMetadata | undefined;
|
|
72
|
+
create: <TConfig = unknown>(id: string, config?: TConfig) => PraisonTool<unknown, unknown>;
|
|
73
|
+
};
|
|
74
|
+
export default tools;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Tools Facade - Simple API for accessing all built-in tools
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* import { tools } from 'praisonai';
|
|
7
|
+
* const agent = new Agent({ tools: [tools.tavily(), tools.codeExecution()] });
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.tools = void 0;
|
|
11
|
+
exports.registerBuiltinTools = registerBuiltinTools;
|
|
12
|
+
const registry_1 = require("./registry/registry");
|
|
13
|
+
// Import all tool factories
|
|
14
|
+
const code_execution_1 = require("./builtins/code-execution");
|
|
15
|
+
const tavily_1 = require("./builtins/tavily");
|
|
16
|
+
const exa_1 = require("./builtins/exa");
|
|
17
|
+
const perplexity_1 = require("./builtins/perplexity");
|
|
18
|
+
const parallel_1 = require("./builtins/parallel");
|
|
19
|
+
const firecrawl_1 = require("./builtins/firecrawl");
|
|
20
|
+
const superagent_1 = require("./builtins/superagent");
|
|
21
|
+
const valyu_1 = require("./builtins/valyu");
|
|
22
|
+
const bedrock_agentcore_1 = require("./builtins/bedrock-agentcore");
|
|
23
|
+
const airweave_1 = require("./builtins/airweave");
|
|
24
|
+
const code_mode_1 = require("./builtins/code-mode");
|
|
25
|
+
const custom_1 = require("./builtins/custom");
|
|
26
|
+
/**
|
|
27
|
+
* Register all built-in tools with the global registry
|
|
28
|
+
*/
|
|
29
|
+
function registerBuiltinTools() {
|
|
30
|
+
const registry = (0, registry_1.getToolsRegistry)();
|
|
31
|
+
// Code Execution
|
|
32
|
+
registry.register(code_execution_1.CODE_EXECUTION_METADATA, code_execution_1.createCodeExecutionTool);
|
|
33
|
+
// Tavily - register with both base ID and specific IDs
|
|
34
|
+
registry.register(tavily_1.TAVILY_METADATA, tavily_1.createTavilySearchTool);
|
|
35
|
+
registry.register({ ...tavily_1.TAVILY_METADATA, id: 'tavily-search' }, tavily_1.createTavilySearchTool);
|
|
36
|
+
registry.register({ ...tavily_1.TAVILY_METADATA, id: 'tavily-extract' }, tavily_1.createTavilyExtractTool);
|
|
37
|
+
registry.register({ ...tavily_1.TAVILY_METADATA, id: 'tavily-crawl' }, tavily_1.createTavilyCrawlTool);
|
|
38
|
+
// Exa
|
|
39
|
+
registry.register(exa_1.EXA_METADATA, exa_1.createExaSearchTool);
|
|
40
|
+
// Perplexity
|
|
41
|
+
registry.register(perplexity_1.PERPLEXITY_METADATA, perplexity_1.createPerplexitySearchTool);
|
|
42
|
+
// Parallel
|
|
43
|
+
registry.register(parallel_1.PARALLEL_METADATA, parallel_1.createParallelSearchTool);
|
|
44
|
+
// Firecrawl
|
|
45
|
+
registry.register({ ...firecrawl_1.FIRECRAWL_METADATA, id: 'firecrawl-scrape' }, firecrawl_1.createFirecrawlScrapeTool);
|
|
46
|
+
registry.register({ ...firecrawl_1.FIRECRAWL_METADATA, id: 'firecrawl-crawl' }, firecrawl_1.createFirecrawlCrawlTool);
|
|
47
|
+
// Superagent
|
|
48
|
+
registry.register({ ...superagent_1.SUPERAGENT_METADATA, id: 'superagent-guard' }, superagent_1.createSuperagentGuardTool);
|
|
49
|
+
registry.register({ ...superagent_1.SUPERAGENT_METADATA, id: 'superagent-redact' }, superagent_1.createSuperagentRedactTool);
|
|
50
|
+
registry.register({ ...superagent_1.SUPERAGENT_METADATA, id: 'superagent-verify' }, superagent_1.createSuperagentVerifyTool);
|
|
51
|
+
// Valyu
|
|
52
|
+
registry.register({ ...valyu_1.VALYU_METADATA, id: 'valyu-web' }, valyu_1.createValyuWebSearchTool);
|
|
53
|
+
registry.register({ ...valyu_1.VALYU_METADATA, id: 'valyu-finance' }, valyu_1.createValyuFinanceSearchTool);
|
|
54
|
+
registry.register({ ...valyu_1.VALYU_METADATA, id: 'valyu-paper' }, valyu_1.createValyuPaperSearchTool);
|
|
55
|
+
registry.register({ ...valyu_1.VALYU_METADATA, id: 'valyu-bio' }, valyu_1.createValyuBioSearchTool);
|
|
56
|
+
registry.register({ ...valyu_1.VALYU_METADATA, id: 'valyu-patent' }, valyu_1.createValyuPatentSearchTool);
|
|
57
|
+
registry.register({ ...valyu_1.VALYU_METADATA, id: 'valyu-sec' }, valyu_1.createValyuSecSearchTool);
|
|
58
|
+
registry.register({ ...valyu_1.VALYU_METADATA, id: 'valyu-economics' }, valyu_1.createValyuEconomicsSearchTool);
|
|
59
|
+
registry.register({ ...valyu_1.VALYU_METADATA, id: 'valyu-company' }, valyu_1.createValyuCompanyResearchTool);
|
|
60
|
+
// Bedrock AgentCore
|
|
61
|
+
registry.register({ ...bedrock_agentcore_1.BEDROCK_AGENTCORE_METADATA, id: 'bedrock-code-interpreter' }, bedrock_agentcore_1.createBedrockCodeInterpreterTool);
|
|
62
|
+
registry.register({ ...bedrock_agentcore_1.BEDROCK_AGENTCORE_METADATA, id: 'bedrock-browser-navigate' }, bedrock_agentcore_1.createBedrockBrowserNavigateTool);
|
|
63
|
+
registry.register({ ...bedrock_agentcore_1.BEDROCK_AGENTCORE_METADATA, id: 'bedrock-browser-click' }, bedrock_agentcore_1.createBedrockBrowserClickTool);
|
|
64
|
+
registry.register({ ...bedrock_agentcore_1.BEDROCK_AGENTCORE_METADATA, id: 'bedrock-browser-fill' }, bedrock_agentcore_1.createBedrockBrowserFillTool);
|
|
65
|
+
// Airweave
|
|
66
|
+
registry.register(airweave_1.AIRWEAVE_METADATA, airweave_1.createAirweaveSearchTool);
|
|
67
|
+
// Code Mode
|
|
68
|
+
registry.register(code_mode_1.CODE_MODE_METADATA, code_mode_1.createCodeModeTool);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Tools facade - provides simple access to all built-in tools
|
|
72
|
+
*/
|
|
73
|
+
exports.tools = {
|
|
74
|
+
// Code Execution (Vercel Sandbox)
|
|
75
|
+
codeExecution: (config) => (0, code_execution_1.codeExecution)(config),
|
|
76
|
+
executeCode: (config) => (0, code_execution_1.codeExecution)(config), // Alias
|
|
77
|
+
// Tavily
|
|
78
|
+
tavily: (config) => (0, tavily_1.tavilySearch)(config),
|
|
79
|
+
tavilySearch: (config) => (0, tavily_1.tavilySearch)(config),
|
|
80
|
+
tavilyExtract: (config) => (0, tavily_1.tavilyExtract)(config),
|
|
81
|
+
tavilyCrawl: (config) => (0, tavily_1.tavilyCrawl)(config),
|
|
82
|
+
// Exa
|
|
83
|
+
exa: (config) => (0, exa_1.exaSearch)(config),
|
|
84
|
+
exaSearch: (config) => (0, exa_1.exaSearch)(config),
|
|
85
|
+
// Perplexity
|
|
86
|
+
perplexity: (config) => (0, perplexity_1.perplexitySearch)(config),
|
|
87
|
+
perplexitySearch: (config) => (0, perplexity_1.perplexitySearch)(config),
|
|
88
|
+
// Parallel
|
|
89
|
+
parallel: (config) => (0, parallel_1.parallelSearch)(config),
|
|
90
|
+
parallelSearch: (config) => (0, parallel_1.parallelSearch)(config),
|
|
91
|
+
// Firecrawl
|
|
92
|
+
firecrawl: (config) => (0, firecrawl_1.firecrawlScrape)(config),
|
|
93
|
+
firecrawlScrape: (config) => (0, firecrawl_1.firecrawlScrape)(config),
|
|
94
|
+
firecrawlCrawl: (config) => (0, firecrawl_1.firecrawlCrawl)(config),
|
|
95
|
+
// Superagent (Security)
|
|
96
|
+
guard: (config) => (0, superagent_1.superagentGuard)(config),
|
|
97
|
+
redact: (config) => (0, superagent_1.superagentRedact)(config),
|
|
98
|
+
verify: (config) => (0, superagent_1.superagentVerify)(config),
|
|
99
|
+
superagentGuard: (config) => (0, superagent_1.superagentGuard)(config),
|
|
100
|
+
superagentRedact: (config) => (0, superagent_1.superagentRedact)(config),
|
|
101
|
+
superagentVerify: (config) => (0, superagent_1.superagentVerify)(config),
|
|
102
|
+
// Valyu (Domain Search)
|
|
103
|
+
valyuWebSearch: (config) => (0, valyu_1.valyuWebSearch)(config),
|
|
104
|
+
valyuFinanceSearch: (config) => (0, valyu_1.valyuFinanceSearch)(config),
|
|
105
|
+
valyuPaperSearch: (config) => (0, valyu_1.valyuPaperSearch)(config),
|
|
106
|
+
valyuBioSearch: (config) => (0, valyu_1.valyuBioSearch)(config),
|
|
107
|
+
valyuPatentSearch: (config) => (0, valyu_1.valyuPatentSearch)(config),
|
|
108
|
+
valyuSecSearch: (config) => (0, valyu_1.valyuSecSearch)(config),
|
|
109
|
+
valyuEconomicsSearch: (config) => (0, valyu_1.valyuEconomicsSearch)(config),
|
|
110
|
+
valyuCompanyResearch: (config) => (0, valyu_1.valyuCompanyResearch)(config),
|
|
111
|
+
// Bedrock AgentCore
|
|
112
|
+
bedrockCodeInterpreter: (config) => (0, bedrock_agentcore_1.bedrockCodeInterpreter)(config),
|
|
113
|
+
bedrockBrowserNavigate: (config) => (0, bedrock_agentcore_1.bedrockBrowserNavigate)(config),
|
|
114
|
+
bedrockBrowserClick: (config) => (0, bedrock_agentcore_1.bedrockBrowserClick)(config),
|
|
115
|
+
bedrockBrowserFill: (config) => (0, bedrock_agentcore_1.bedrockBrowserFill)(config),
|
|
116
|
+
// Airweave
|
|
117
|
+
airweave: (config) => (0, airweave_1.airweaveSearch)(config),
|
|
118
|
+
airweaveSearch: (config) => (0, airweave_1.airweaveSearch)(config),
|
|
119
|
+
// Code Mode
|
|
120
|
+
codeMode: (config) => (0, code_mode_1.codeMode)(config),
|
|
121
|
+
// Custom Tools
|
|
122
|
+
custom: (config) => (0, custom_1.createCustomTool)(config),
|
|
123
|
+
register: (config) => (0, custom_1.registerCustomTool)(config),
|
|
124
|
+
fromNpm: (packageName, toolName) => (0, custom_1.registerNpmTool)(packageName, toolName),
|
|
125
|
+
fromLocal: (filePath, toolName) => (0, custom_1.registerLocalTool)(filePath, toolName),
|
|
126
|
+
// Registry access
|
|
127
|
+
getRegistry: () => (0, registry_1.getToolsRegistry)(),
|
|
128
|
+
list: () => (0, registry_1.getToolsRegistry)().list(),
|
|
129
|
+
get: (id) => (0, registry_1.getToolsRegistry)().getMetadata(id),
|
|
130
|
+
create: (id, config) => (0, registry_1.getToolsRegistry)().create(id, config),
|
|
131
|
+
};
|
|
132
|
+
// Export the tools object as default
|
|
133
|
+
exports.default = exports.tools;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare enum LogLevel {
|
|
2
|
+
DEBUG = 0,
|
|
3
|
+
INFO = 1,
|
|
4
|
+
WARN = 2,
|
|
5
|
+
ERROR = 3
|
|
6
|
+
}
|
|
7
|
+
export declare class Logger {
|
|
8
|
+
private static level;
|
|
9
|
+
private static verbose;
|
|
10
|
+
private static pretty;
|
|
11
|
+
private static getCircularReplacer;
|
|
12
|
+
private static formatContext;
|
|
13
|
+
static setVerbose(verbose: boolean): void;
|
|
14
|
+
static setPretty(pretty: boolean): void;
|
|
15
|
+
static debug(message: string, context?: any): Promise<void>;
|
|
16
|
+
static info(message: string, context?: any): Promise<void>;
|
|
17
|
+
static warn(message: string, context?: any): Promise<void>;
|
|
18
|
+
static error(message: string, context?: any): Promise<void>;
|
|
19
|
+
static success(message: string, data?: unknown): Promise<void>;
|
|
20
|
+
static startSpinner(text: string): Promise<void>;
|
|
21
|
+
static updateSpinner(text: string): Promise<void>;
|
|
22
|
+
static stopSpinner(success?: boolean): Promise<void>;
|
|
23
|
+
static table(headers: string[], data: (string | number)[][]): Promise<void>;
|
|
24
|
+
static section(title: string, content: string): Promise<void>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Logger = exports.LogLevel = void 0;
|
|
4
|
+
const pretty_logger_1 = require("./pretty-logger");
|
|
5
|
+
var LogLevel;
|
|
6
|
+
(function (LogLevel) {
|
|
7
|
+
LogLevel[LogLevel["DEBUG"] = 0] = "DEBUG";
|
|
8
|
+
LogLevel[LogLevel["INFO"] = 1] = "INFO";
|
|
9
|
+
LogLevel[LogLevel["WARN"] = 2] = "WARN";
|
|
10
|
+
LogLevel[LogLevel["ERROR"] = 3] = "ERROR";
|
|
11
|
+
})(LogLevel || (exports.LogLevel = LogLevel = {}));
|
|
12
|
+
class Logger {
|
|
13
|
+
static getCircularReplacer() {
|
|
14
|
+
const seen = new WeakSet();
|
|
15
|
+
return (key, value) => {
|
|
16
|
+
if (typeof value === "object" && value !== null) {
|
|
17
|
+
if (seen.has(value)) {
|
|
18
|
+
return "[Circular]";
|
|
19
|
+
}
|
|
20
|
+
seen.add(value);
|
|
21
|
+
}
|
|
22
|
+
return value;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
static formatContext(context) {
|
|
26
|
+
try {
|
|
27
|
+
return JSON.stringify(context, this.getCircularReplacer(), 2);
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
return String(context);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
static setVerbose(verbose) {
|
|
34
|
+
this.verbose = verbose;
|
|
35
|
+
}
|
|
36
|
+
static setPretty(pretty) {
|
|
37
|
+
this.pretty = pretty;
|
|
38
|
+
}
|
|
39
|
+
static async debug(message, context) {
|
|
40
|
+
if (this.level <= LogLevel.DEBUG && this.verbose) {
|
|
41
|
+
if (this.pretty) {
|
|
42
|
+
await pretty_logger_1.PrettyLogger.info(message, context);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
console.log(`[DEBUG] ${message}${context ? '\nContext: ' + this.formatContext(context) : ''}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
static async info(message, context) {
|
|
50
|
+
if (this.level <= LogLevel.INFO && this.verbose) {
|
|
51
|
+
if (this.pretty) {
|
|
52
|
+
await pretty_logger_1.PrettyLogger.info(message, context);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
console.log(`[INFO] ${message}${context ? '\nContext: ' + this.formatContext(context) : ''}`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
static async warn(message, context) {
|
|
60
|
+
if (this.level <= LogLevel.WARN && this.verbose) {
|
|
61
|
+
if (this.pretty) {
|
|
62
|
+
await pretty_logger_1.PrettyLogger.warning(message, context);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
console.warn(`[WARN] ${message}${context ? '\nContext: ' + this.formatContext(context) : ''}`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
static async error(message, context) {
|
|
70
|
+
if (this.level <= LogLevel.ERROR) {
|
|
71
|
+
if (this.pretty) {
|
|
72
|
+
await pretty_logger_1.PrettyLogger.error(message, context);
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
console.error(`[ERROR] ${message}${context ? '\nContext: ' + this.formatContext(context) : ''}`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
static async success(message, data) {
|
|
80
|
+
if (!this.verbose)
|
|
81
|
+
return;
|
|
82
|
+
if (this.pretty) {
|
|
83
|
+
await pretty_logger_1.PrettyLogger.success(message, data);
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
console.log(`✓ ${message}`);
|
|
87
|
+
if (data) {
|
|
88
|
+
console.log(data);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
static async startSpinner(text) {
|
|
93
|
+
if (!this.verbose)
|
|
94
|
+
return;
|
|
95
|
+
if (this.pretty) {
|
|
96
|
+
await pretty_logger_1.PrettyLogger.startSpinner(text);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
console.log(`⟳ ${text}`);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
static async updateSpinner(text) {
|
|
103
|
+
if (!this.verbose)
|
|
104
|
+
return;
|
|
105
|
+
if (this.pretty) {
|
|
106
|
+
await pretty_logger_1.PrettyLogger.updateSpinner(text);
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
console.log(`⟳ ${text}`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
static async stopSpinner(success = true) {
|
|
113
|
+
if (!this.verbose)
|
|
114
|
+
return;
|
|
115
|
+
if (this.pretty) {
|
|
116
|
+
await pretty_logger_1.PrettyLogger.stopSpinner(success);
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
// Already logged in startSpinner
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
static async table(headers, data) {
|
|
123
|
+
if (!this.verbose)
|
|
124
|
+
return;
|
|
125
|
+
if (this.pretty) {
|
|
126
|
+
await pretty_logger_1.PrettyLogger.table(headers, data);
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
console.log(headers.join('\t'));
|
|
130
|
+
data.forEach(row => console.log(row.join('\t')));
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
static async section(title, content) {
|
|
134
|
+
if (!this.verbose)
|
|
135
|
+
return;
|
|
136
|
+
if (this.pretty) {
|
|
137
|
+
await pretty_logger_1.PrettyLogger.section(title, content);
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
console.log(`\n=== ${title} ===`);
|
|
141
|
+
console.log(content);
|
|
142
|
+
console.log('='.repeat(title.length + 8));
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
exports.Logger = Logger;
|
|
147
|
+
Logger.level = process.env.LOGLEVEL === 'debug' ? LogLevel.DEBUG : LogLevel.INFO;
|
|
148
|
+
Logger.verbose = true;
|
|
149
|
+
Logger.pretty = false;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare class PrettyLogger {
|
|
2
|
+
private static spinner;
|
|
3
|
+
private static lastSpinnerText;
|
|
4
|
+
private static initialized;
|
|
5
|
+
private static isLoaded;
|
|
6
|
+
private static init;
|
|
7
|
+
static showTitle(text: string): Promise<void>;
|
|
8
|
+
static info(message: string, data?: unknown): Promise<void>;
|
|
9
|
+
static success(message: string, data?: unknown): Promise<void>;
|
|
10
|
+
static plain(text: string): Promise<void>;
|
|
11
|
+
static dim(text: string): Promise<void>;
|
|
12
|
+
static newline(): Promise<void>;
|
|
13
|
+
static heading(text: string): Promise<void>;
|
|
14
|
+
static error(message: string, error?: unknown): Promise<void>;
|
|
15
|
+
static warning(message: string, data?: unknown): Promise<void>;
|
|
16
|
+
static startSpinner(text: string): Promise<void>;
|
|
17
|
+
static updateSpinner(text: string): Promise<void>;
|
|
18
|
+
static stopSpinner(success?: boolean): Promise<void>;
|
|
19
|
+
static table(headers: string[], data: (string | number)[][]): Promise<void>;
|
|
20
|
+
static section(title: string, content: string): Promise<void>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.PrettyLogger = void 0;
|
|
37
|
+
// We'll load these dynamically since they're ES modules
|
|
38
|
+
let chalk;
|
|
39
|
+
let boxen;
|
|
40
|
+
let ora;
|
|
41
|
+
let Table;
|
|
42
|
+
let figlet;
|
|
43
|
+
// Load dependencies dynamically
|
|
44
|
+
async function loadDependencies() {
|
|
45
|
+
try {
|
|
46
|
+
const imports = await Promise.all([
|
|
47
|
+
Promise.resolve().then(() => __importStar(require('chalk'))),
|
|
48
|
+
Promise.resolve().then(() => __importStar(require('boxen'))),
|
|
49
|
+
Promise.resolve().then(() => __importStar(require('ora'))),
|
|
50
|
+
Promise.resolve().then(() => __importStar(require('cli-table3'))),
|
|
51
|
+
Promise.resolve().then(() => __importStar(require('figlet')))
|
|
52
|
+
]);
|
|
53
|
+
[chalk, boxen, ora, Table, figlet] = imports.map(imp => imp.default);
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
console.warn('Pretty logging dependencies not available, falling back to basic logging');
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
class PrettyLogger {
|
|
62
|
+
static async init() {
|
|
63
|
+
if (!this.initialized) {
|
|
64
|
+
this.isLoaded = await loadDependencies();
|
|
65
|
+
this.initialized = true;
|
|
66
|
+
}
|
|
67
|
+
return this.isLoaded;
|
|
68
|
+
}
|
|
69
|
+
static async showTitle(text) {
|
|
70
|
+
if (!await this.init()) {
|
|
71
|
+
console.log(text);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
return new Promise((resolve, reject) => {
|
|
75
|
+
figlet(text, (err, data) => {
|
|
76
|
+
if (err) {
|
|
77
|
+
reject(err);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
if (data) {
|
|
81
|
+
console.log(chalk.cyan(data));
|
|
82
|
+
}
|
|
83
|
+
resolve();
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
static async info(message, data) {
|
|
88
|
+
if (!await this.init()) {
|
|
89
|
+
console.log(`ℹ ${message}`);
|
|
90
|
+
if (data)
|
|
91
|
+
console.log(data);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
console.log(chalk.blue('ℹ'), chalk.blue(message));
|
|
95
|
+
if (data) {
|
|
96
|
+
console.log(boxen(JSON.stringify(data, null, 2), {
|
|
97
|
+
padding: 1,
|
|
98
|
+
margin: 1,
|
|
99
|
+
borderStyle: 'round',
|
|
100
|
+
borderColor: 'blue'
|
|
101
|
+
}));
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
static async success(message, data) {
|
|
105
|
+
if (!await this.init()) {
|
|
106
|
+
console.log(`✓ ${message}`);
|
|
107
|
+
if (data)
|
|
108
|
+
console.log(data);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
console.log(chalk.green('✓'), chalk.green(message));
|
|
112
|
+
if (data) {
|
|
113
|
+
console.log(boxen(JSON.stringify(data, null, 2), {
|
|
114
|
+
padding: 1,
|
|
115
|
+
margin: 1,
|
|
116
|
+
borderStyle: 'round',
|
|
117
|
+
borderColor: 'green'
|
|
118
|
+
}));
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
static async plain(text) {
|
|
122
|
+
if (!await this.init()) {
|
|
123
|
+
console.log(text);
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
console.log(text);
|
|
127
|
+
}
|
|
128
|
+
static async dim(text) {
|
|
129
|
+
if (!await this.init()) {
|
|
130
|
+
console.log(text);
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
console.log(chalk.dim(text));
|
|
134
|
+
}
|
|
135
|
+
static async newline() {
|
|
136
|
+
console.log('');
|
|
137
|
+
}
|
|
138
|
+
static async heading(text) {
|
|
139
|
+
if (!await this.init()) {
|
|
140
|
+
console.log(`\n${text}\n`);
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
console.log(chalk.bold.underline(`\n${text}`));
|
|
144
|
+
}
|
|
145
|
+
static async error(message, error) {
|
|
146
|
+
if (!await this.init()) {
|
|
147
|
+
console.error(`✗ ${message}`);
|
|
148
|
+
if (error)
|
|
149
|
+
console.error(error);
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
console.log(chalk.red('✗'), chalk.red(message));
|
|
153
|
+
if (error) {
|
|
154
|
+
console.log(boxen(JSON.stringify(error, null, 2), {
|
|
155
|
+
padding: 1,
|
|
156
|
+
margin: 1,
|
|
157
|
+
borderStyle: 'round',
|
|
158
|
+
borderColor: 'red'
|
|
159
|
+
}));
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
static async warning(message, data) {
|
|
163
|
+
if (!await this.init()) {
|
|
164
|
+
console.warn(`⚠ ${message}`);
|
|
165
|
+
if (data)
|
|
166
|
+
console.warn(data);
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
console.log(chalk.yellow('⚠'), chalk.yellow(message));
|
|
170
|
+
if (data) {
|
|
171
|
+
console.log(boxen(JSON.stringify(data, null, 2), {
|
|
172
|
+
padding: 1,
|
|
173
|
+
margin: 1,
|
|
174
|
+
borderStyle: 'round',
|
|
175
|
+
borderColor: 'yellow'
|
|
176
|
+
}));
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
static async startSpinner(text) {
|
|
180
|
+
if (!await this.init()) {
|
|
181
|
+
console.log(`⟳ ${text}`);
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
this.lastSpinnerText = text;
|
|
185
|
+
this.spinner = ora({
|
|
186
|
+
text: chalk.cyan(text),
|
|
187
|
+
color: 'cyan'
|
|
188
|
+
}).start();
|
|
189
|
+
}
|
|
190
|
+
static async updateSpinner(text) {
|
|
191
|
+
if (!await this.init()) {
|
|
192
|
+
console.log(`⟳ ${text}`);
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
if (this.spinner) {
|
|
196
|
+
this.lastSpinnerText = text;
|
|
197
|
+
this.spinner.text = chalk.cyan(text);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
static async stopSpinner(success = true) {
|
|
201
|
+
if (!await this.init())
|
|
202
|
+
return;
|
|
203
|
+
if (this.spinner) {
|
|
204
|
+
if (success) {
|
|
205
|
+
this.spinner.succeed(chalk.green(this.lastSpinnerText));
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
this.spinner.fail(chalk.red(this.lastSpinnerText));
|
|
209
|
+
}
|
|
210
|
+
this.spinner = null;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
static async table(headers, data) {
|
|
214
|
+
if (!await this.init()) {
|
|
215
|
+
console.log(headers.join('\t'));
|
|
216
|
+
data.forEach(row => console.log(row.join('\t')));
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
const table = new Table({
|
|
220
|
+
head: headers.map(h => chalk.cyan(h)),
|
|
221
|
+
style: {
|
|
222
|
+
head: [],
|
|
223
|
+
border: []
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
data.forEach(row => table.push(row));
|
|
227
|
+
console.log(table.toString());
|
|
228
|
+
}
|
|
229
|
+
static async section(title, content) {
|
|
230
|
+
if (!await this.init()) {
|
|
231
|
+
console.log(`\n=== ${title} ===`);
|
|
232
|
+
console.log(content);
|
|
233
|
+
console.log('='.repeat(title.length + 8));
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
console.log('\n' + boxen(chalk.bold(title) + '\n\n' + content, {
|
|
237
|
+
padding: 1,
|
|
238
|
+
margin: 1,
|
|
239
|
+
borderStyle: 'double',
|
|
240
|
+
borderColor: 'cyan'
|
|
241
|
+
}));
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
exports.PrettyLogger = PrettyLogger;
|
|
245
|
+
PrettyLogger.spinner = null;
|
|
246
|
+
PrettyLogger.lastSpinnerText = '';
|
|
247
|
+
PrettyLogger.initialized = false;
|
|
248
|
+
PrettyLogger.isLoaded = false;
|