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,170 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* CLI command: external-agents
|
|
4
|
+
* Integration with external AI CLI tools
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.execute = execute;
|
|
8
|
+
const external_agents_1 = require("../features/external-agents");
|
|
9
|
+
async function execute(args, options) {
|
|
10
|
+
const subcommand = args[0] || 'help';
|
|
11
|
+
const isJson = Boolean(options.output === 'json' || options.json);
|
|
12
|
+
switch (subcommand) {
|
|
13
|
+
case 'list':
|
|
14
|
+
await handleList(isJson);
|
|
15
|
+
break;
|
|
16
|
+
case 'check':
|
|
17
|
+
await handleCheck(args.slice(1), isJson);
|
|
18
|
+
break;
|
|
19
|
+
case 'run':
|
|
20
|
+
await handleRun(args.slice(1), options, isJson);
|
|
21
|
+
break;
|
|
22
|
+
case 'help':
|
|
23
|
+
default:
|
|
24
|
+
showHelp(isJson);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
async function handleList(isJson) {
|
|
28
|
+
const registry = (0, external_agents_1.getExternalAgentRegistry)();
|
|
29
|
+
const all = registry.list();
|
|
30
|
+
const available = await registry.getAvailable();
|
|
31
|
+
if (isJson) {
|
|
32
|
+
console.log(JSON.stringify({
|
|
33
|
+
success: true,
|
|
34
|
+
agents: all,
|
|
35
|
+
available
|
|
36
|
+
}, null, 2));
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
console.log('External Agents:\n');
|
|
40
|
+
for (const name of all) {
|
|
41
|
+
const status = available.includes(name) ? '✓' : '✗';
|
|
42
|
+
console.log(` ${status} ${name}`);
|
|
43
|
+
}
|
|
44
|
+
console.log(`\n${available.length}/${all.length} available`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
async function handleCheck(args, isJson) {
|
|
48
|
+
const name = args[0];
|
|
49
|
+
if (!name) {
|
|
50
|
+
console.error('Error: Agent name is required');
|
|
51
|
+
process.exit(1);
|
|
52
|
+
}
|
|
53
|
+
const agent = (0, external_agents_1.createExternalAgent)(name);
|
|
54
|
+
if (!agent) {
|
|
55
|
+
if (isJson) {
|
|
56
|
+
console.log(JSON.stringify({ success: false, error: `Unknown agent: ${name}` }));
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
console.error(`Unknown agent: ${name}`);
|
|
60
|
+
}
|
|
61
|
+
process.exit(1);
|
|
62
|
+
}
|
|
63
|
+
const available = await agent.isAvailable();
|
|
64
|
+
if (isJson) {
|
|
65
|
+
console.log(JSON.stringify({ success: true, agent: name, available }));
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
if (available) {
|
|
69
|
+
console.log(`✓ ${name} is available`);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
console.log(`✗ ${name} is not available (CLI not found)`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
async function handleRun(args, options, isJson) {
|
|
77
|
+
const name = args[0];
|
|
78
|
+
const prompt = args.slice(1).join(' ');
|
|
79
|
+
if (!name) {
|
|
80
|
+
console.error('Error: Agent name is required');
|
|
81
|
+
process.exit(1);
|
|
82
|
+
}
|
|
83
|
+
if (!prompt) {
|
|
84
|
+
console.error('Error: Prompt is required');
|
|
85
|
+
process.exit(1);
|
|
86
|
+
}
|
|
87
|
+
const cwd = options.cwd;
|
|
88
|
+
const agent = (0, external_agents_1.createExternalAgent)(name, cwd);
|
|
89
|
+
if (!agent) {
|
|
90
|
+
if (isJson) {
|
|
91
|
+
console.log(JSON.stringify({ success: false, error: `Unknown agent: ${name}` }));
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
console.error(`Unknown agent: ${name}`);
|
|
95
|
+
}
|
|
96
|
+
process.exit(1);
|
|
97
|
+
}
|
|
98
|
+
if (!await agent.isAvailable()) {
|
|
99
|
+
if (isJson) {
|
|
100
|
+
console.log(JSON.stringify({ success: false, error: `${name} CLI not available` }));
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
console.error(`${name} CLI not available`);
|
|
104
|
+
}
|
|
105
|
+
process.exit(1);
|
|
106
|
+
}
|
|
107
|
+
const result = await agent.execute(prompt);
|
|
108
|
+
if (isJson) {
|
|
109
|
+
console.log(JSON.stringify(result, null, 2));
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
if (result.success) {
|
|
113
|
+
console.log(result.output);
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
console.error(`Error: ${result.error}`);
|
|
117
|
+
process.exit(result.exitCode);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
function showHelp(isJson) {
|
|
122
|
+
const help = {
|
|
123
|
+
command: 'external-agents',
|
|
124
|
+
description: 'Integration with external AI CLI tools',
|
|
125
|
+
subcommands: {
|
|
126
|
+
list: 'List all external agents and availability',
|
|
127
|
+
check: 'Check if an agent is available',
|
|
128
|
+
run: 'Run a prompt with an external agent'
|
|
129
|
+
},
|
|
130
|
+
agents: {
|
|
131
|
+
claude: 'Claude Code CLI',
|
|
132
|
+
gemini: 'Gemini CLI',
|
|
133
|
+
codex: 'OpenAI Codex CLI',
|
|
134
|
+
aider: 'Aider CLI'
|
|
135
|
+
},
|
|
136
|
+
flags: {
|
|
137
|
+
'--cwd': 'Working directory for the agent',
|
|
138
|
+
'--json': 'Output in JSON format'
|
|
139
|
+
},
|
|
140
|
+
examples: [
|
|
141
|
+
'overai external-agents list',
|
|
142
|
+
'overai external-agents check claude',
|
|
143
|
+
'overai external-agents run claude "Explain this code"',
|
|
144
|
+
'overai external-agents run gemini "Refactor this function" --cwd ./src',
|
|
145
|
+
'overai external-agents run aider "Fix this bug"'
|
|
146
|
+
]
|
|
147
|
+
};
|
|
148
|
+
if (isJson) {
|
|
149
|
+
console.log(JSON.stringify(help, null, 2));
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
console.log('External Agents - AI CLI tool integration\n');
|
|
153
|
+
console.log('Subcommands:');
|
|
154
|
+
for (const [cmd, desc] of Object.entries(help.subcommands)) {
|
|
155
|
+
console.log(` ${cmd.padEnd(12)} ${desc}`);
|
|
156
|
+
}
|
|
157
|
+
console.log('\nSupported Agents:');
|
|
158
|
+
for (const [agent, desc] of Object.entries(help.agents)) {
|
|
159
|
+
console.log(` ${agent.padEnd(12)} ${desc}`);
|
|
160
|
+
}
|
|
161
|
+
console.log('\nFlags:');
|
|
162
|
+
for (const [flag, desc] of Object.entries(help.flags)) {
|
|
163
|
+
console.log(` ${flag.padEnd(12)} ${desc}`);
|
|
164
|
+
}
|
|
165
|
+
console.log('\nExamples:');
|
|
166
|
+
for (const ex of help.examples) {
|
|
167
|
+
console.log(` ${ex}`);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* CLI command: fast-context
|
|
4
|
+
* Fast context retrieval and summarization
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.execute = execute;
|
|
8
|
+
const fast_context_1 = require("../features/fast-context");
|
|
9
|
+
async function execute(args, options) {
|
|
10
|
+
const subcommand = args[0] || 'help';
|
|
11
|
+
const isJson = Boolean(options.output === 'json' || options.json);
|
|
12
|
+
switch (subcommand) {
|
|
13
|
+
case 'query':
|
|
14
|
+
await handleQuery(args.slice(1), options, isJson);
|
|
15
|
+
break;
|
|
16
|
+
case 'stats':
|
|
17
|
+
await handleStats(isJson);
|
|
18
|
+
break;
|
|
19
|
+
case 'clear':
|
|
20
|
+
await handleClear(isJson);
|
|
21
|
+
break;
|
|
22
|
+
case 'help':
|
|
23
|
+
default:
|
|
24
|
+
showHelp(isJson);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
let globalContext = null;
|
|
28
|
+
function getContext(maxTokens) {
|
|
29
|
+
if (!globalContext) {
|
|
30
|
+
globalContext = (0, fast_context_1.createFastContext)({ maxTokens, cacheEnabled: true });
|
|
31
|
+
}
|
|
32
|
+
return globalContext;
|
|
33
|
+
}
|
|
34
|
+
async function handleQuery(args, options, isJson) {
|
|
35
|
+
const query = args.join(' ');
|
|
36
|
+
if (!query) {
|
|
37
|
+
console.error('Error: Query is required');
|
|
38
|
+
process.exit(1);
|
|
39
|
+
}
|
|
40
|
+
const maxTokens = options['max-tokens'];
|
|
41
|
+
const sources = options.sources;
|
|
42
|
+
const fc = getContext(maxTokens);
|
|
43
|
+
// Add sources if provided
|
|
44
|
+
if (sources) {
|
|
45
|
+
const sourceList = sources.split(',').map(s => s.trim());
|
|
46
|
+
fc.registerSource('cli-sources', 'custom', sourceList);
|
|
47
|
+
}
|
|
48
|
+
const result = await fc.getContext(query);
|
|
49
|
+
if (isJson) {
|
|
50
|
+
console.log(JSON.stringify({ success: true, ...result }, null, 2));
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
console.log('Fast Context Result:');
|
|
54
|
+
console.log(` Query: ${query}`);
|
|
55
|
+
console.log(` Token count: ${result.tokenCount}`);
|
|
56
|
+
console.log(` Sources used: ${result.sources.length}`);
|
|
57
|
+
console.log(` Cached: ${result.cached}`);
|
|
58
|
+
console.log(` Latency: ${result.latencyMs}ms`);
|
|
59
|
+
console.log('\nContext:');
|
|
60
|
+
console.log(result.context || '(empty)');
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
async function handleStats(isJson) {
|
|
64
|
+
const fc = getContext();
|
|
65
|
+
const stats = fc.getCacheStats();
|
|
66
|
+
if (isJson) {
|
|
67
|
+
console.log(JSON.stringify({ success: true, stats }, null, 2));
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
console.log('Fast Context Cache Stats:');
|
|
71
|
+
console.log(` Cache size: ${stats.size}`);
|
|
72
|
+
console.log(` Total hits: ${stats.totalHits}`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
async function handleClear(isJson) {
|
|
76
|
+
const fc = getContext();
|
|
77
|
+
fc.clearCache();
|
|
78
|
+
fc.clearSources();
|
|
79
|
+
if (isJson) {
|
|
80
|
+
console.log(JSON.stringify({ success: true, message: 'Cache and sources cleared' }));
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
console.log('✓ Cache and sources cleared');
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function showHelp(isJson) {
|
|
87
|
+
const help = {
|
|
88
|
+
command: 'fast-context',
|
|
89
|
+
description: 'Fast context retrieval and summarization',
|
|
90
|
+
subcommands: {
|
|
91
|
+
query: 'Query for relevant context',
|
|
92
|
+
stats: 'Show cache statistics',
|
|
93
|
+
clear: 'Clear cache and sources'
|
|
94
|
+
},
|
|
95
|
+
flags: {
|
|
96
|
+
'--max-tokens': 'Maximum tokens in context (default: 4000)',
|
|
97
|
+
'--sources': 'Comma-separated source texts',
|
|
98
|
+
'--json': 'Output in JSON format'
|
|
99
|
+
},
|
|
100
|
+
examples: [
|
|
101
|
+
'praisonai-ts fast-context query "What is the main topic?"',
|
|
102
|
+
'praisonai-ts fast-context query "summarize" --sources "text1,text2,text3"',
|
|
103
|
+
'praisonai-ts fast-context query "find relevant" --max-tokens 2000',
|
|
104
|
+
'praisonai-ts fast-context stats',
|
|
105
|
+
'praisonai-ts fast-context clear'
|
|
106
|
+
]
|
|
107
|
+
};
|
|
108
|
+
if (isJson) {
|
|
109
|
+
console.log(JSON.stringify(help, null, 2));
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
console.log('Fast Context - Fast context retrieval\n');
|
|
113
|
+
console.log('Subcommands:');
|
|
114
|
+
for (const [cmd, desc] of Object.entries(help.subcommands)) {
|
|
115
|
+
console.log(` ${cmd.padEnd(12)} ${desc}`);
|
|
116
|
+
}
|
|
117
|
+
console.log('\nFlags:');
|
|
118
|
+
for (const [flag, desc] of Object.entries(help.flags)) {
|
|
119
|
+
console.log(` ${flag.padEnd(14)} ${desc}`);
|
|
120
|
+
}
|
|
121
|
+
console.log('\nExamples:');
|
|
122
|
+
for (const ex of help.examples) {
|
|
123
|
+
console.log(` ${ex}`);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* CLI command: flow
|
|
4
|
+
* Workflow flow visualization
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.execute = execute;
|
|
8
|
+
const flow_display_1 = require("../features/flow-display");
|
|
9
|
+
async function execute(args, options) {
|
|
10
|
+
const subcommand = args[0] || 'help';
|
|
11
|
+
const isJson = Boolean(options.output === 'json' || options.json);
|
|
12
|
+
switch (subcommand) {
|
|
13
|
+
case 'show':
|
|
14
|
+
await handleShow(args.slice(1), options, isJson);
|
|
15
|
+
break;
|
|
16
|
+
case 'dot':
|
|
17
|
+
await handleDot(args.slice(1), options, isJson);
|
|
18
|
+
break;
|
|
19
|
+
case 'help':
|
|
20
|
+
default:
|
|
21
|
+
showHelp(isJson);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
async function handleShow(args, options, isJson) {
|
|
25
|
+
const stepsStr = args[0] || options.steps;
|
|
26
|
+
let steps = [];
|
|
27
|
+
if (stepsStr) {
|
|
28
|
+
try {
|
|
29
|
+
steps = JSON.parse(stepsStr);
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
// Parse simple format: "step1,step2,step3"
|
|
33
|
+
steps = stepsStr.split(',').map(s => {
|
|
34
|
+
const [name, type] = s.split(':');
|
|
35
|
+
return { name: name.trim(), type: type?.trim() };
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
// Default example
|
|
41
|
+
steps = [
|
|
42
|
+
{ name: 'Input', type: 'start' },
|
|
43
|
+
{ name: 'Process', type: 'agent' },
|
|
44
|
+
{ name: 'Validate', type: 'condition' },
|
|
45
|
+
{ name: 'Output', type: 'end' }
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
const display = (0, flow_display_1.createFlowDisplay)({
|
|
49
|
+
showStatus: Boolean(options.status),
|
|
50
|
+
compact: Boolean(options.compact)
|
|
51
|
+
});
|
|
52
|
+
display.fromWorkflowSteps(steps);
|
|
53
|
+
if (isJson) {
|
|
54
|
+
const graph = display.getGraph();
|
|
55
|
+
console.log(JSON.stringify({
|
|
56
|
+
success: true,
|
|
57
|
+
nodes: Array.from(graph.nodes.values()),
|
|
58
|
+
edges: graph.edges
|
|
59
|
+
}, null, 2));
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
if (options.boxes) {
|
|
63
|
+
console.log(display.renderBoxes());
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
console.log(display.render());
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
async function handleDot(args, options, isJson) {
|
|
71
|
+
const stepsStr = args[0] || options.steps;
|
|
72
|
+
let steps = [];
|
|
73
|
+
if (stepsStr) {
|
|
74
|
+
try {
|
|
75
|
+
steps = JSON.parse(stepsStr);
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
steps = stepsStr.split(',').map(s => {
|
|
79
|
+
const [name, type] = s.split(':');
|
|
80
|
+
return { name: name.trim(), type: type?.trim() };
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
steps = [
|
|
86
|
+
{ name: 'Start', type: 'start' },
|
|
87
|
+
{ name: 'Agent', type: 'agent' },
|
|
88
|
+
{ name: 'End', type: 'end' }
|
|
89
|
+
];
|
|
90
|
+
}
|
|
91
|
+
const display = (0, flow_display_1.createFlowDisplay)();
|
|
92
|
+
display.fromWorkflowSteps(steps);
|
|
93
|
+
const dot = display.toDot();
|
|
94
|
+
if (isJson) {
|
|
95
|
+
console.log(JSON.stringify({ success: true, dot }));
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
console.log(dot);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function showHelp(isJson) {
|
|
102
|
+
const help = {
|
|
103
|
+
command: 'flow',
|
|
104
|
+
description: 'Workflow flow visualization',
|
|
105
|
+
subcommands: {
|
|
106
|
+
show: 'Display workflow as text tree or boxes',
|
|
107
|
+
dot: 'Export workflow as DOT format (for Graphviz)'
|
|
108
|
+
},
|
|
109
|
+
flags: {
|
|
110
|
+
'--steps': 'Steps as JSON or "name:type,name:type"',
|
|
111
|
+
'--status': 'Show status indicators',
|
|
112
|
+
'--compact': 'Compact display mode',
|
|
113
|
+
'--boxes': 'Display as ASCII boxes',
|
|
114
|
+
'--json': 'Output in JSON format'
|
|
115
|
+
},
|
|
116
|
+
examples: [
|
|
117
|
+
'praisonai-ts flow show "Input,Process,Output"',
|
|
118
|
+
'praisonai-ts flow show "Start:start,Agent:agent,End:end"',
|
|
119
|
+
'praisonai-ts flow show --boxes',
|
|
120
|
+
'praisonai-ts flow dot "Step1,Step2,Step3" > workflow.dot'
|
|
121
|
+
]
|
|
122
|
+
};
|
|
123
|
+
if (isJson) {
|
|
124
|
+
console.log(JSON.stringify(help, null, 2));
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
console.log('Flow - Workflow visualization\n');
|
|
128
|
+
console.log('Subcommands:');
|
|
129
|
+
for (const [cmd, desc] of Object.entries(help.subcommands)) {
|
|
130
|
+
console.log(` ${cmd.padEnd(12)} ${desc}`);
|
|
131
|
+
}
|
|
132
|
+
console.log('\nFlags:');
|
|
133
|
+
for (const [flag, desc] of Object.entries(help.flags)) {
|
|
134
|
+
console.log(` ${flag.padEnd(12)} ${desc}`);
|
|
135
|
+
}
|
|
136
|
+
console.log('\nExamples:');
|
|
137
|
+
for (const ex of help.examples) {
|
|
138
|
+
console.log(` ${ex}`);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* CLI command: git
|
|
4
|
+
* Git integration for repository operations
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.execute = execute;
|
|
8
|
+
const git_integration_1 = require("../features/git-integration");
|
|
9
|
+
async function execute(args, options) {
|
|
10
|
+
const subcommand = args[0] || 'help';
|
|
11
|
+
const isJson = Boolean(options.output === 'json' || options.json);
|
|
12
|
+
const cwd = options.cwd || process.cwd();
|
|
13
|
+
switch (subcommand) {
|
|
14
|
+
case 'status':
|
|
15
|
+
await handleStatus(cwd, isJson);
|
|
16
|
+
break;
|
|
17
|
+
case 'diff':
|
|
18
|
+
await handleDiff(options, cwd, isJson);
|
|
19
|
+
break;
|
|
20
|
+
case 'log':
|
|
21
|
+
await handleLog(options, cwd, isJson);
|
|
22
|
+
break;
|
|
23
|
+
case 'branches':
|
|
24
|
+
await handleBranches(cwd, isJson);
|
|
25
|
+
break;
|
|
26
|
+
case 'stash':
|
|
27
|
+
await handleStash(args.slice(1), cwd, isJson);
|
|
28
|
+
break;
|
|
29
|
+
case 'help':
|
|
30
|
+
default:
|
|
31
|
+
showHelp(isJson);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
async function handleStatus(cwd, isJson) {
|
|
35
|
+
const git = (0, git_integration_1.createGitManager)({ cwd, safe: true });
|
|
36
|
+
if (!await git.isRepo()) {
|
|
37
|
+
console.error('Error: Not a git repository');
|
|
38
|
+
process.exit(1);
|
|
39
|
+
}
|
|
40
|
+
const status = await git.getStatus();
|
|
41
|
+
if (isJson) {
|
|
42
|
+
console.log(JSON.stringify({ success: true, ...status }, null, 2));
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
console.log(await git.getStatusString());
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
async function handleDiff(options, cwd, isJson) {
|
|
49
|
+
const git = (0, git_integration_1.createGitManager)({ cwd, safe: true });
|
|
50
|
+
const staged = Boolean(options.staged);
|
|
51
|
+
if (!await git.isRepo()) {
|
|
52
|
+
console.error('Error: Not a git repository');
|
|
53
|
+
process.exit(1);
|
|
54
|
+
}
|
|
55
|
+
const diff = await git.getDiff(staged);
|
|
56
|
+
if (isJson) {
|
|
57
|
+
console.log(JSON.stringify({ success: true, ...diff }, null, 2));
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
if (diff.files.length === 0) {
|
|
61
|
+
console.log(staged ? 'No staged changes' : 'No changes');
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
console.log(`Changes (${diff.files.length} files):\n`);
|
|
65
|
+
for (const file of diff.files) {
|
|
66
|
+
console.log(` ${file.path} (+${file.additions}/-${file.deletions})`);
|
|
67
|
+
}
|
|
68
|
+
if (options.full) {
|
|
69
|
+
console.log('\n' + diff.summary);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
async function handleLog(options, cwd, isJson) {
|
|
75
|
+
const git = (0, git_integration_1.createGitManager)({ cwd, safe: true });
|
|
76
|
+
const limit = options.limit || 10;
|
|
77
|
+
if (!await git.isRepo()) {
|
|
78
|
+
console.error('Error: Not a git repository');
|
|
79
|
+
process.exit(1);
|
|
80
|
+
}
|
|
81
|
+
const commits = await git.getLog(limit);
|
|
82
|
+
if (isJson) {
|
|
83
|
+
console.log(JSON.stringify({ success: true, commits }, null, 2));
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
console.log('Recent commits:\n');
|
|
87
|
+
for (const commit of commits) {
|
|
88
|
+
console.log(` ${commit.shortHash} ${commit.message}`);
|
|
89
|
+
console.log(` by ${commit.author} on ${commit.date.toLocaleDateString()}`);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
async function handleBranches(cwd, isJson) {
|
|
94
|
+
const git = (0, git_integration_1.createGitManager)({ cwd, safe: true });
|
|
95
|
+
if (!await git.isRepo()) {
|
|
96
|
+
console.error('Error: Not a git repository');
|
|
97
|
+
process.exit(1);
|
|
98
|
+
}
|
|
99
|
+
const branches = await git.getBranches();
|
|
100
|
+
if (isJson) {
|
|
101
|
+
console.log(JSON.stringify({ success: true, branches }, null, 2));
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
console.log('Branches:\n');
|
|
105
|
+
for (const branch of branches) {
|
|
106
|
+
const marker = branch.current ? '* ' : ' ';
|
|
107
|
+
console.log(`${marker}${branch.name}`);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
async function handleStash(args, cwd, isJson) {
|
|
112
|
+
const git = (0, git_integration_1.createGitManager)({ cwd, safe: true });
|
|
113
|
+
if (!await git.isRepo()) {
|
|
114
|
+
console.error('Error: Not a git repository');
|
|
115
|
+
process.exit(1);
|
|
116
|
+
}
|
|
117
|
+
const stashes = await git.getStashList();
|
|
118
|
+
if (isJson) {
|
|
119
|
+
console.log(JSON.stringify({ success: true, stashes }, null, 2));
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
if (stashes.length === 0) {
|
|
123
|
+
console.log('No stashes');
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
console.log('Stashes:\n');
|
|
127
|
+
for (const stash of stashes) {
|
|
128
|
+
console.log(` ${stash}`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
function showHelp(isJson) {
|
|
134
|
+
const help = {
|
|
135
|
+
command: 'git',
|
|
136
|
+
description: 'Git integration for repository operations (read-only by default)',
|
|
137
|
+
subcommands: {
|
|
138
|
+
status: 'Show repository status',
|
|
139
|
+
diff: 'Show changes',
|
|
140
|
+
log: 'Show recent commits',
|
|
141
|
+
branches: 'List branches',
|
|
142
|
+
stash: 'List stashes'
|
|
143
|
+
},
|
|
144
|
+
flags: {
|
|
145
|
+
'--cwd': 'Working directory (default: current)',
|
|
146
|
+
'--staged': 'Show staged changes only (for diff)',
|
|
147
|
+
'--full': 'Show full diff output',
|
|
148
|
+
'--limit': 'Number of commits to show (default: 10)',
|
|
149
|
+
'--json': 'Output in JSON format'
|
|
150
|
+
},
|
|
151
|
+
examples: [
|
|
152
|
+
'praisonai-ts git status',
|
|
153
|
+
'praisonai-ts git diff',
|
|
154
|
+
'praisonai-ts git diff --staged',
|
|
155
|
+
'praisonai-ts git log --limit 5',
|
|
156
|
+
'praisonai-ts git branches',
|
|
157
|
+
'praisonai-ts git stash'
|
|
158
|
+
]
|
|
159
|
+
};
|
|
160
|
+
if (isJson) {
|
|
161
|
+
console.log(JSON.stringify(help, null, 2));
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
console.log('Git - Repository operations (read-only)\n');
|
|
165
|
+
console.log('Subcommands:');
|
|
166
|
+
for (const [cmd, desc] of Object.entries(help.subcommands)) {
|
|
167
|
+
console.log(` ${cmd.padEnd(12)} ${desc}`);
|
|
168
|
+
}
|
|
169
|
+
console.log('\nFlags:');
|
|
170
|
+
for (const [flag, desc] of Object.entries(help.flags)) {
|
|
171
|
+
console.log(` ${flag.padEnd(12)} ${desc}`);
|
|
172
|
+
}
|
|
173
|
+
console.log('\nExamples:');
|
|
174
|
+
for (const ex of help.examples) {
|
|
175
|
+
console.log(` ${ex}`);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Graph RAG command - Graph-based retrieval augmented generation
|
|
3
|
+
*/
|
|
4
|
+
export interface GraphRagOptions {
|
|
5
|
+
verbose?: boolean;
|
|
6
|
+
output?: 'json' | 'text' | 'pretty';
|
|
7
|
+
json?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function execute(args: string[], options: GraphRagOptions): Promise<void>;
|