create-cogitator-app 0.5.1 → 0.6.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/dist/index.js +199 -41
- package/dist/index.js.map +1 -1
- package/dist/lib.d.ts +58 -2
- package/dist/lib.js +206 -42
- package/dist/lib.js.map +1 -1
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// <define:__COGITATOR_EXAMPLES__>
|
|
4
|
-
var define_COGITATOR_EXAMPLES_default = [{ name: "a2a/a2a-server", title: "A2A Server", entry: "a2a/01-a2a-server.ts", files: ["_shared/setup.ts", "a2a/01-a2a-server.ts"], dependencies: { "@cogitator-ai/a2a": "^0.8.2", "@cogitator-ai/core": "^0.36.0", dotenv: "^18.0.5", express: "^5.2.1" }, devDependencies: { "@types/express": "^5.0.6", tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "a2a/a2a-client", title: "A2A Client", entry: "a2a/02-a2a-client.ts", files: ["_shared/setup.ts", "a2a/02-a2a-client.ts"], dependencies: { "@cogitator-ai/a2a": "^0.8.2", "@cogitator-ai/core": "^0.36.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "advanced/self-modifying", title: "Self-Modifying Agent", entry: "advanced/01-self-modifying.ts", files: ["_shared/setup.ts", "advanced/01-self-modifying.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/self-modifying": "^19.4.2", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "advanced/neuro-symbolic", title: "Neuro-Symbolic Reasoning", entry: "advanced/02-neuro-symbolic.ts", files: ["_shared/setup.ts", "advanced/02-neuro-symbolic.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/neuro-symbolic": "^17.0.22", "@cogitator-ai/types": "^0.38.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "advanced/wasm-tools", title: "WASM-Sandboxed Tools", entry: "advanced/03-wasm-tools.ts", files: ["_shared/setup.ts", "advanced/03-wasm-tools.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/wasm-tools": "^0.7.16", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "browser/web-scraping", title: "Web Scraping with Browser Agent", entry: "browser/01-web-scraping.ts", files: ["_shared/setup.ts", "browser/01-web-scraping.ts"], dependencies: { "@cogitator-ai/browser": "^0.4.12", "@cogitator-ai/core": "^0.36.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "browser/form-automation", title: "Form Automation with Browser Agent", entry: "browser/02-form-automation.ts", files: ["_shared/setup.ts", "browser/02-form-automation.ts"], dependencies: { "@cogitator-ai/browser": "^0.4.12", "@cogitator-ai/core": "^0.36.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "browser/stealth-agent", title: "Stealth Browser Agent", entry: "browser/03-stealth-agent.ts", files: ["_shared/setup.ts", "browser/03-stealth-agent.ts"], dependencies: { "@cogitator-ai/browser": "^0.4.12", "@cogitator-ai/core": "^0.36.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "browser/bitcoin-price-scraper", title: "Bitcoin Price Scraper (Binance)", entry: "browser/04-bitcoin-price-scraper.ts", files: ["_shared/setup.ts", "browser/04-bitcoin-price-scraper.ts"], dependencies: { "@cogitator-ai/browser": "^0.4.12", "@cogitator-ai/core": "^0.36.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "channels/telegram-assistant", title: "Telegram assistant", entry: "channels/01-telegram-assistant.ts", files: ["channels/01-telegram-assistant.ts", "channels/cogitator.yml", "channels/webchat-client.html"], dependencies: { "@cogitator-ai/channels": "^0.9.2", "@cogitator-ai/core": "^0.36.0", dotenv: "^18.0.5", grammy: "^1.46.0", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["GOOGLE_API_KEY", "OWNER_TG_ID", "TG_TOKEN"], runtime: "node" }, { name: "channels/super-assistant", title: "Super assistant", entry: "channels/02-super-assistant.ts", files: ["channels/02-super-assistant.ts", "channels/cogitator.yml", "channels/webchat-client.html"], dependencies: { "@cogitator-ai/channels": "^0.9.2", "better-sqlite3": "^13.0.3", dotenv: "^18.0.5", grammy: "^1.46.0" }, devDependencies: { tsx: "^4.23.15" }, env: ["OWNER_TG_ID", "TG_TOKEN"], runtime: "node" }, { name: "channels/webchat-bot", title: "Webchat bot", entry: "channels/03-webchat-bot.ts", files: ["channels/03-webchat-bot.ts", "channels/cogitator.yml", "channels/webchat-client.html"], dependencies: { "@cogitator-ai/channels": "^0.9.2", "@cogitator-ai/core": "^0.36.0", dotenv: "^18.0.5", ws: "^8.22.0", zod: "^4.6.5" }, devDependencies: { "@types/ws": "^8.18.2", tsx: "^4.23.15" }, env: ["GOOGLE_API_KEY", "WEBCHAT_PORT", "WEBCHAT_TOKEN"], runtime: "node" }, { name: "core/basic-agent", title: "Basic Agent with Custom Tools", entry: "core/01-basic-agent.ts", files: ["_shared/setup.ts", "core/01-basic-agent.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/built-in-tools", title: "Built-in Tools", entry: "core/02-built-in-tools.ts", files: ["_shared/setup.ts", "core/02-built-in-tools.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/tool-caching", title: "Tool Caching with withCache", entry: "core/03-tool-caching.ts", files: ["_shared/setup.ts", "core/03-tool-caching.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/context-manager", title: "Context Manager", entry: "core/04-context-manager.ts", files: ["_shared/setup.ts", "core/04-context-manager.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/types": "^0.38.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/tree-of-thought", title: "Tree of Thought", entry: "core/05-tree-of-thought.ts", files: ["_shared/setup.ts", "core/05-tree-of-thought.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/reflection", title: "Reflection", entry: "core/06-reflection.ts", files: ["_shared/setup.ts", "core/06-reflection.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/agent-optimizer", title: "Agent Optimizer", entry: "core/07-agent-optimizer.ts", files: ["_shared/setup.ts", "core/07-agent-optimizer.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/time-travel", title: "Time Travel", entry: "core/08-time-travel.ts", files: ["_shared/setup.ts", "core/08-time-travel.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/cost-routing", title: "Cost-Aware Routing", entry: "core/09-cost-routing.ts", files: ["_shared/setup.ts", "core/09-cost-routing.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/constitutional-ai", title: "Constitutional AI", entry: "core/10-constitutional-ai.ts", files: ["_shared/setup.ts", "core/10-constitutional-ai.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/prompt-injection", title: "Prompt Injection Detection", entry: "core/11-prompt-injection.ts", files: ["_shared/setup.ts", "core/11-prompt-injection.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/causal-reasoning", title: "Causal Reasoning", entry: "core/12-causal-reasoning.ts", files: ["_shared/setup.ts", "core/12-causal-reasoning.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/model-registry", title: "Model Registry", entry: "core/13-model-registry.ts", files: ["_shared/setup.ts", "core/13-model-registry.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/models": "^18.3.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/approvals", title: "Approvals: pause before a sensitive tool, resume later", entry: "core/14-approvals.ts", files: ["_shared/setup.ts", "core/14-approvals.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/handoffs", title: "Handoffs: a triage agent passes the conversation on", entry: "core/15-handoffs.ts", files: ["_shared/setup.ts", "core/15-handoffs.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "device-tools/screenshot", title: "Screenshot", entry: "device-tools/01-screenshot.ts", files: ["device-tools/01-screenshot.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: [], runtime: "node" }, { name: "device-tools/clipboard", title: "Clipboard", entry: "device-tools/02-clipboard.ts", files: ["device-tools/02-clipboard.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: [], runtime: "node" }, { name: "device-tools/notify", title: "Notify", entry: "device-tools/03-notify.ts", files: ["device-tools/03-notify.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: [], runtime: "node" }, { name: "device-tools/open-url", title: "Open url", entry: "device-tools/04-open-url.ts", files: ["device-tools/04-open-url.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: [], runtime: "node" }, { name: "device-tools/shell-exec", title: "Shell exec", entry: "device-tools/05-shell-exec.ts", files: ["device-tools/05-shell-exec.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: [], runtime: "node" }, { name: "evals/basic-eval", title: "Basic Evaluation", entry: "evals/01-basic-eval.ts", files: ["_shared/setup.ts", "evals/01-basic-eval.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/evals": "^0.6.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "evals/llm-judge", title: "LLM-as-Judge Evaluation", entry: "evals/02-llm-judge.ts", files: ["_shared/setup.ts", "evals/02-llm-judge.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/evals": "^0.6.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "evals/ab-comparison", title: "A/B Comparison", entry: "evals/03-ab-comparison.ts", files: ["_shared/setup.ts", "evals/03-ab-comparison.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/evals": "^0.6.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "infrastructure/redis-memory", title: "Redis Memory: Persistent Conversations", entry: "infrastructure/01-redis-memory.ts", files: ["_shared/setup.ts", "infrastructure/01-redis-memory.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/memory": "^0.12.2", dotenv: "^18.0.5", ioredis: "^5.0.0 || ^6.0.0" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY", "REDIS_URL"], runtime: "node" }, { name: "infrastructure/postgres-memory", title: "PostgreSQL Memory: Long-Term Persistence", entry: "infrastructure/02-postgres-memory.ts", files: ["_shared/setup.ts", "infrastructure/02-postgres-memory.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/memory": "^0.12.2", dotenv: "^18.0.5", pg: "^8.23.1" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "DATABASE_URL", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "infrastructure/worker-queue", title: "Worker Queue: Distributed Agent Execution", entry: "infrastructure/03-worker-queue.ts", files: ["_shared/setup.ts", "infrastructure/03-worker-queue.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/worker": "^0.9.2", dotenv: "^18.0.5", ioredis: "^5.0.0 || ^6.0.0" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY", "REDIS_URL"], runtime: "node" }, { name: "infrastructure/deploy-docker", title: "Deploy: Docker Deployment Planning", entry: "infrastructure/04-deploy-docker.ts", files: ["_shared/setup.ts", "infrastructure/04-deploy-docker.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/deploy": "^0.6.1", dotenv: "^18.0.5", pg: "^8.23.1" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "infrastructure/sandbox-execution", title: "Sandbox Execution: Docker, WASM & Native", entry: "infrastructure/05-sandbox-execution.ts", files: ["_shared/setup.ts", "infrastructure/05-sandbox-execution.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/sandbox": "^0.5.11", "@extism/extism": "^2.0.0-rc13", dockerode: "^4.0.0 || ^5.0.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "integrations/express-server", title: "Express Server Integration", entry: "integrations/01-express-server.ts", files: ["_shared/arithmetic.ts", "_shared/setup.ts", "integrations/01-express-server.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/express": "^0.8.2", dotenv: "^18.0.5", express: "^5.2.1", zod: "^4.6.5" }, devDependencies: { "@types/express": "^5.0.6", tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "integrations/fastify-server", title: "Fastify Server Integration", entry: "integrations/02-fastify-server.ts", files: ["_shared/arithmetic.ts", "_shared/setup.ts", "integrations/02-fastify-server.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/fastify": "^0.7.2", dotenv: "^18.0.5", fastify: "^5.12.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "integrations/hono-server", title: "Hono Server Integration", entry: "integrations/03-hono-server.ts", files: ["_shared/setup.ts", "integrations/03-hono-server.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/hono": "^0.7.2", "@hono/node-server": "^2.1.3", dotenv: "^18.0.5", hono: "^4.13.12" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "integrations/koa-server", title: "Koa Server Integration", entry: "integrations/04-koa-server.ts", files: ["_shared/setup.ts", "integrations/04-koa-server.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/koa": "^0.7.2", "@koa/router": "^15.7.0", dotenv: "^18.0.5", koa: "^3.2.1" }, devDependencies: { "@types/koa": "^3.0.3", tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "integrations/nextjs-handler", title: "Nextjs handler", entry: "integrations/05-nextjs-handler.ts", files: ["integrations/05-nextjs-handler.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/next": "^0.8.2", next: "^14.0.0 || ^15.0.0 || ^16.0.0", react: "^18.2.0 || ^19.0.0", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["GOOGLE_API_KEY"], runtime: "node" }, { name: "integrations/openai-compat", title: "OpenAI-Compatible Server", entry: "integrations/06-openai-compat.ts", files: ["_shared/setup.ts", "integrations/06-openai-compat.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/openai-compat": "^21.2.2", "@cogitator-ai/types": "^0.38.0", dotenv: "^18.0.5", openai: "^7.25.0", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "integrations/ai-sdk-adapter", title: "Vercel AI SDK Adapter", entry: "integrations/07-ai-sdk-adapter.ts", files: ["_shared/setup.ts", "integrations/07-ai-sdk-adapter.ts"], dependencies: { "@cogitator-ai/ai-sdk": "^0.6.0", "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/types": "^0.38.0", ai: "^7.0.127", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "integrations/tetsu-server", title: "Tetsu Server on Bun: an app with its own MCP server and agent", entry: "integrations/08-tetsu-server.ts", files: ["_shared/setup.ts", "integrations/08-tetsu-server.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/mcp": "^19.3.2", "@cogitator-ai/tetsu": "^0.5.2", "@cogitator-ai/types": "^0.38.0", "@tetsujs/core": "^0.6.1", "@tetsujs/openapi": "^0.6.1", "@tetsujs/sse": "^0.6.1", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "bun" }, { name: "mcp/mcp-client", title: "MCP Client: Filesystem Server", entry: "mcp/01-mcp-client.ts", files: ["_shared/setup.ts", "mcp/01-mcp-client.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/mcp": "^19.3.2", "@cogitator-ai/types": "^0.38.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "mcp/mcp-server", title: "MCP Server: Expose Cogitator Tools over HTTP", entry: "mcp/02-mcp-server.ts", files: ["_shared/setup.ts", "mcp/02-mcp-server.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/mcp": "^19.3.2", "@cogitator-ai/types": "^0.38.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "mcp/per-user-mcp", title: "An Agent on Your Own MCP Server, per User", entry: "mcp/03-per-user-mcp.ts", files: ["_shared/setup.ts", "mcp/03-per-user-mcp.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/mcp": "^19.3.2", "@cogitator-ai/types": "^0.38.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "mcp/agent-as-mcp-server", title: "A Cogitator Agent as an MCP Server", entry: "mcp/04-agent-as-mcp-server.ts", files: ["_shared/setup.ts", "mcp/04-agent-as-mcp-server.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/mcp": "^19.3.2", "@cogitator-ai/types": "^0.38.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "memory/basic-memory", title: "Basic Memory: Threads & Multi-Turn Conversations", entry: "memory/01-basic-memory.ts", files: ["_shared/setup.ts", "memory/01-basic-memory.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/memory": "^0.12.2", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "memory/context-builder", title: "Context Builder: Token-Aware Context Windows", entry: "memory/02-context-builder.ts", files: ["_shared/setup.ts", "memory/02-context-builder.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/memory": "^0.12.2", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "memory/semantic-search", title: "Semantic Search: Hybrid BM25 + Vector Search", entry: "memory/03-semantic-search.ts", files: ["_shared/setup.ts", "memory/03-semantic-search.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/memory": "^0.12.2", "@qdrant/js-client-rest": "^1.10.0", dotenv: "^18.0.5", pg: "^8.23.1" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "memory/knowledge-graph", title: "Knowledge Graph: Entity Extraction & Graph Traversal", entry: "memory/04-knowledge-graph.ts", files: ["_shared/setup.ts", "memory/04-knowledge-graph.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/memory": "^0.12.2", "@cogitator-ai/types": "^0.38.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "rag/basic-retrieval", title: "Basic RAG Retrieval", entry: "rag/01-basic-retrieval.ts", files: ["_shared/setup.ts", "rag/01-basic-retrieval.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/memory": "^0.12.2", "@cogitator-ai/rag": "^0.6.2", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "rag/chunking-strategies", title: "Chunking Strategies Comparison", entry: "rag/02-chunking-strategies.ts", files: ["_shared/setup.ts", "rag/02-chunking-strategies.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/memory": "^0.12.2", "@cogitator-ai/rag": "^0.6.2", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "rag/agent-with-rag", title: "Agent with RAG Tools", entry: "rag/03-agent-with-rag.ts", files: ["_shared/setup.ts", "rag/03-agent-with-rag.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/memory": "^0.12.2", "@cogitator-ai/rag": "^0.6.2", "@qdrant/js-client-rest": "^1.10.0", "better-sqlite3": "^13.0.3", dotenv: "^18.0.5", ioredis: "^5.0.0 || ^6.0.0", mongodb: "^6.0.0 || ^7.0.0", pg: "^8.23.1" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "swarms/debate-swarm", title: "Debate Swarm", entry: "swarms/01-debate-swarm.ts", files: ["_shared/setup.ts", "swarms/01-debate-swarm.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/swarms": "^0.12.2", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "swarms/pipeline-swarm", title: "Pipeline Swarm", entry: "swarms/02-pipeline-swarm.ts", files: ["_shared/setup.ts", "swarms/02-pipeline-swarm.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/swarms": "^0.12.2", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "swarms/hierarchical-swarm", title: "Hierarchical Swarm", entry: "swarms/03-hierarchical-swarm.ts", files: ["_shared/setup.ts", "swarms/03-hierarchical-swarm.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/swarms": "^0.12.2", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "swarms/negotiation-swarm", title: "Negotiation Swarm", entry: "swarms/04-negotiation-swarm.ts", files: ["_shared/setup.ts", "swarms/04-negotiation-swarm.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/swarms": "^0.12.2", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "voice/pipeline", title: "Voice Pipeline", entry: "voice/01-pipeline.ts", files: ["_shared/setup.ts", "voice/01-pipeline.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/voice": "^0.5.2", dotenv: "^18.0.5", openai: "^7.25.0" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "voice/realtime", title: "Realtime Voice Session", entry: "voice/02-realtime.ts", files: ["_shared/setup.ts", "voice/02-realtime.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/voice": "^0.5.2", dotenv: "^18.0.5", openai: "^7.25.0" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "voice/voice-agent", title: "Voice Agent (WebSocket Server)", entry: "voice/03-voice-agent.ts", files: ["_shared/setup.ts", "voice/03-voice-agent.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/voice": "^0.5.2", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "DEEPGRAM_API_KEY", "ELEVENLABS_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "voice/realtime-voice-agent", title: "Realtime Voice Agent (Gemini Live over WebSocket)", entry: "voice/04-realtime-voice-agent.ts", files: ["_shared/setup.ts", "voice/04-realtime-voice-agent.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/voice": "^0.5.2", dotenv: "^18.0.5", ws: "^8.22.0" }, devDependencies: { "@types/ws": "^8.18.2", tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "workflows/basic-workflow", title: "Basic Workflow: Code Review Pipeline", entry: "workflows/01-basic-workflow.ts", files: ["_shared/setup.ts", "workflows/01-basic-workflow.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/workflows": "^0.12.2", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "workflows/human-in-loop", title: "Human-in-the-Loop: Content Publishing Workflow", entry: "workflows/02-human-in-loop.ts", files: ["_shared/setup.ts", "workflows/02-human-in-loop.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/workflows": "^0.12.2", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "workflows/map-reduce", title: "Map-Reduce: Parallel Document Analysis", entry: "workflows/03-map-reduce.ts", files: ["_shared/setup.ts", "workflows/03-map-reduce.ts"], dependencies: { "@cogitator-ai/core": "^0.36.0", "@cogitator-ai/workflows": "^0.12.2", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }];
|
|
4
|
+
var define_COGITATOR_EXAMPLES_default = [{ name: "a2a/a2a-server", title: "A2A Server", entry: "a2a/01-a2a-server.ts", files: ["_shared/setup.ts", "a2a/01-a2a-server.ts"], dependencies: { "@cogitator-ai/a2a": "^0.8.3", "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5", express: "^5.2.1" }, devDependencies: { "@types/express": "^5.0.6", tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "a2a/a2a-client", title: "A2A Client", entry: "a2a/02-a2a-client.ts", files: ["_shared/setup.ts", "a2a/02-a2a-client.ts"], dependencies: { "@cogitator-ai/a2a": "^0.8.3", "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "advanced/self-modifying", title: "Self-Modifying Agent", entry: "advanced/01-self-modifying.ts", files: ["_shared/setup.ts", "advanced/01-self-modifying.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/self-modifying": "^19.4.3", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "advanced/neuro-symbolic", title: "Neuro-Symbolic Reasoning", entry: "advanced/02-neuro-symbolic.ts", files: ["_shared/setup.ts", "advanced/02-neuro-symbolic.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/neuro-symbolic": "^17.0.23", "@cogitator-ai/types": "^0.39.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "advanced/wasm-tools", title: "WASM-Sandboxed Tools", entry: "advanced/03-wasm-tools.ts", files: ["_shared/setup.ts", "advanced/03-wasm-tools.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/wasm-tools": "^0.7.17", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "browser/web-scraping", title: "Web Scraping with Browser Agent", entry: "browser/01-web-scraping.ts", files: ["_shared/setup.ts", "browser/01-web-scraping.ts"], dependencies: { "@cogitator-ai/browser": "^0.4.13", "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "browser/form-automation", title: "Form Automation with Browser Agent", entry: "browser/02-form-automation.ts", files: ["_shared/setup.ts", "browser/02-form-automation.ts"], dependencies: { "@cogitator-ai/browser": "^0.4.13", "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "browser/stealth-agent", title: "Stealth Browser Agent", entry: "browser/03-stealth-agent.ts", files: ["_shared/setup.ts", "browser/03-stealth-agent.ts"], dependencies: { "@cogitator-ai/browser": "^0.4.13", "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "browser/bitcoin-price-scraper", title: "Bitcoin Price Scraper (Binance)", entry: "browser/04-bitcoin-price-scraper.ts", files: ["_shared/setup.ts", "browser/04-bitcoin-price-scraper.ts"], dependencies: { "@cogitator-ai/browser": "^0.4.13", "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "channels/telegram-assistant", title: "Telegram assistant", entry: "channels/01-telegram-assistant.ts", files: ["channels/01-telegram-assistant.ts", "channels/cogitator.yml", "channels/webchat-client.html"], dependencies: { "@cogitator-ai/channels": "^0.9.3", "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5", grammy: "^1.46.0", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["GOOGLE_API_KEY", "OWNER_TG_ID", "TG_TOKEN"], runtime: "node" }, { name: "channels/super-assistant", title: "Super assistant", entry: "channels/02-super-assistant.ts", files: ["channels/02-super-assistant.ts", "channels/cogitator.yml", "channels/webchat-client.html"], dependencies: { "@cogitator-ai/channels": "^0.9.3", "better-sqlite3": "^13.0.3", dotenv: "^18.0.5", grammy: "^1.46.0" }, devDependencies: { tsx: "^4.23.15" }, env: ["OWNER_TG_ID", "TG_TOKEN"], runtime: "node" }, { name: "channels/webchat-bot", title: "Webchat bot", entry: "channels/03-webchat-bot.ts", files: ["channels/03-webchat-bot.ts", "channels/cogitator.yml", "channels/webchat-client.html"], dependencies: { "@cogitator-ai/channels": "^0.9.3", "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5", ws: "^8.22.0", zod: "^4.6.5" }, devDependencies: { "@types/ws": "^8.18.2", tsx: "^4.23.15" }, env: ["GOOGLE_API_KEY", "WEBCHAT_PORT", "WEBCHAT_TOKEN"], runtime: "node" }, { name: "core/basic-agent", title: "Basic Agent with Custom Tools", entry: "core/01-basic-agent.ts", files: ["_shared/setup.ts", "core/01-basic-agent.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/built-in-tools", title: "Built-in Tools", entry: "core/02-built-in-tools.ts", files: ["_shared/setup.ts", "core/02-built-in-tools.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/tool-caching", title: "Tool Caching with withCache", entry: "core/03-tool-caching.ts", files: ["_shared/setup.ts", "core/03-tool-caching.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/context-manager", title: "Context Manager", entry: "core/04-context-manager.ts", files: ["_shared/setup.ts", "core/04-context-manager.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/types": "^0.39.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/tree-of-thought", title: "Tree of Thought", entry: "core/05-tree-of-thought.ts", files: ["_shared/setup.ts", "core/05-tree-of-thought.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/reflection", title: "Reflection", entry: "core/06-reflection.ts", files: ["_shared/setup.ts", "core/06-reflection.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/agent-optimizer", title: "Agent Optimizer", entry: "core/07-agent-optimizer.ts", files: ["_shared/setup.ts", "core/07-agent-optimizer.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/time-travel", title: "Time Travel", entry: "core/08-time-travel.ts", files: ["_shared/setup.ts", "core/08-time-travel.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/cost-routing", title: "Cost-Aware Routing", entry: "core/09-cost-routing.ts", files: ["_shared/setup.ts", "core/09-cost-routing.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/constitutional-ai", title: "Constitutional AI", entry: "core/10-constitutional-ai.ts", files: ["_shared/setup.ts", "core/10-constitutional-ai.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/prompt-injection", title: "Prompt Injection Detection", entry: "core/11-prompt-injection.ts", files: ["_shared/setup.ts", "core/11-prompt-injection.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/causal-reasoning", title: "Causal Reasoning", entry: "core/12-causal-reasoning.ts", files: ["_shared/setup.ts", "core/12-causal-reasoning.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/model-registry", title: "Model Registry", entry: "core/13-model-registry.ts", files: ["_shared/setup.ts", "core/13-model-registry.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/models": "^18.3.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/approvals", title: "Approvals: pause before a sensitive tool, resume later", entry: "core/14-approvals.ts", files: ["_shared/setup.ts", "core/14-approvals.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/handoffs", title: "Handoffs: a triage agent passes the conversation on", entry: "core/15-handoffs.ts", files: ["_shared/setup.ts", "core/15-handoffs.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "device-tools/screenshot", title: "Screenshot", entry: "device-tools/01-screenshot.ts", files: ["device-tools/01-screenshot.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: [], runtime: "node" }, { name: "device-tools/clipboard", title: "Clipboard", entry: "device-tools/02-clipboard.ts", files: ["device-tools/02-clipboard.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: [], runtime: "node" }, { name: "device-tools/notify", title: "Notify", entry: "device-tools/03-notify.ts", files: ["device-tools/03-notify.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: [], runtime: "node" }, { name: "device-tools/open-url", title: "Open url", entry: "device-tools/04-open-url.ts", files: ["device-tools/04-open-url.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: [], runtime: "node" }, { name: "device-tools/shell-exec", title: "Shell exec", entry: "device-tools/05-shell-exec.ts", files: ["device-tools/05-shell-exec.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: [], runtime: "node" }, { name: "evals/basic-eval", title: "Basic Evaluation", entry: "evals/01-basic-eval.ts", files: ["_shared/setup.ts", "evals/01-basic-eval.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/evals": "^0.6.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "evals/llm-judge", title: "LLM-as-Judge Evaluation", entry: "evals/02-llm-judge.ts", files: ["_shared/setup.ts", "evals/02-llm-judge.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/evals": "^0.6.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "evals/ab-comparison", title: "A/B Comparison", entry: "evals/03-ab-comparison.ts", files: ["_shared/setup.ts", "evals/03-ab-comparison.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/evals": "^0.6.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "infrastructure/redis-memory", title: "Redis Memory: Persistent Conversations", entry: "infrastructure/01-redis-memory.ts", files: ["_shared/setup.ts", "infrastructure/01-redis-memory.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/memory": "^0.12.3", dotenv: "^18.0.5", ioredis: "^5.0.0 || ^6.0.0" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY", "REDIS_URL"], runtime: "node" }, { name: "infrastructure/postgres-memory", title: "PostgreSQL Memory: Long-Term Persistence", entry: "infrastructure/02-postgres-memory.ts", files: ["_shared/setup.ts", "infrastructure/02-postgres-memory.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/memory": "^0.12.3", dotenv: "^18.0.5", pg: "^8.23.1" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "DATABASE_URL", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "infrastructure/worker-queue", title: "Worker Queue: Distributed Agent Execution", entry: "infrastructure/03-worker-queue.ts", files: ["_shared/setup.ts", "infrastructure/03-worker-queue.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/worker": "^0.9.3", dotenv: "^18.0.5", ioredis: "^5.0.0 || ^6.0.0" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY", "REDIS_URL"], runtime: "node" }, { name: "infrastructure/deploy-docker", title: "Deploy: Docker Deployment Planning", entry: "infrastructure/04-deploy-docker.ts", files: ["_shared/setup.ts", "infrastructure/04-deploy-docker.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/deploy": "^0.6.2", dotenv: "^18.0.5", pg: "^8.23.1" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "infrastructure/sandbox-execution", title: "Sandbox Execution: Docker, WASM & Native", entry: "infrastructure/05-sandbox-execution.ts", files: ["_shared/setup.ts", "infrastructure/05-sandbox-execution.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/sandbox": "^0.5.12", "@extism/extism": "^2.0.0-rc13", dockerode: "^4.0.0 || ^5.0.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "integrations/express-server", title: "Express Server Integration", entry: "integrations/01-express-server.ts", files: ["_shared/arithmetic.ts", "_shared/setup.ts", "integrations/01-express-server.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/express": "^0.8.3", dotenv: "^18.0.5", express: "^5.2.1", zod: "^4.6.5" }, devDependencies: { "@types/express": "^5.0.6", tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "integrations/fastify-server", title: "Fastify Server Integration", entry: "integrations/02-fastify-server.ts", files: ["_shared/arithmetic.ts", "_shared/setup.ts", "integrations/02-fastify-server.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/fastify": "^0.7.3", dotenv: "^18.0.5", fastify: "^5.12.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "integrations/hono-server", title: "Hono Server Integration", entry: "integrations/03-hono-server.ts", files: ["_shared/setup.ts", "integrations/03-hono-server.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/hono": "^0.7.3", "@hono/node-server": "^2.1.3", dotenv: "^18.0.5", hono: "^4.13.12" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "integrations/koa-server", title: "Koa Server Integration", entry: "integrations/04-koa-server.ts", files: ["_shared/setup.ts", "integrations/04-koa-server.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/koa": "^0.7.3", "@koa/router": "^15.7.0", dotenv: "^18.0.5", koa: "^3.2.1" }, devDependencies: { "@types/koa": "^3.0.3", tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "integrations/nextjs-handler", title: "Nextjs handler", entry: "integrations/05-nextjs-handler.ts", files: ["integrations/05-nextjs-handler.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/next": "^0.8.3", next: "^14.0.0 || ^15.0.0 || ^16.0.0", react: "^18.2.0 || ^19.0.0", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["GOOGLE_API_KEY"], runtime: "node" }, { name: "integrations/openai-compat", title: "OpenAI-Compatible Server", entry: "integrations/06-openai-compat.ts", files: ["_shared/setup.ts", "integrations/06-openai-compat.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/openai-compat": "^21.2.3", "@cogitator-ai/types": "^0.39.0", dotenv: "^18.0.5", openai: "^7.25.0", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "integrations/ai-sdk-adapter", title: "Vercel AI SDK Adapter", entry: "integrations/07-ai-sdk-adapter.ts", files: ["_shared/setup.ts", "integrations/07-ai-sdk-adapter.ts"], dependencies: { "@cogitator-ai/ai-sdk": "^0.6.0", "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/types": "^0.39.0", ai: "^7.0.127", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "integrations/tetsu-server", title: "Tetsu Server on Bun: an app with its own MCP server and agent", entry: "integrations/08-tetsu-server.ts", files: ["_shared/setup.ts", "integrations/08-tetsu-server.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/mcp": "^19.3.3", "@cogitator-ai/tetsu": "^0.5.3", "@cogitator-ai/types": "^0.39.0", "@tetsujs/core": "^0.6.1", "@tetsujs/openapi": "^0.6.1", "@tetsujs/sse": "^0.6.1", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "bun" }, { name: "mcp/mcp-client", title: "MCP Client: Filesystem Server", entry: "mcp/01-mcp-client.ts", files: ["_shared/setup.ts", "mcp/01-mcp-client.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/mcp": "^19.3.3", "@cogitator-ai/types": "^0.39.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "mcp/mcp-server", title: "MCP Server: Expose Cogitator Tools over HTTP", entry: "mcp/02-mcp-server.ts", files: ["_shared/setup.ts", "mcp/02-mcp-server.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/mcp": "^19.3.3", "@cogitator-ai/types": "^0.39.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "mcp/per-user-mcp", title: "An Agent on Your Own MCP Server, per User", entry: "mcp/03-per-user-mcp.ts", files: ["_shared/setup.ts", "mcp/03-per-user-mcp.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/mcp": "^19.3.3", "@cogitator-ai/types": "^0.39.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "mcp/agent-as-mcp-server", title: "A Cogitator Agent as an MCP Server", entry: "mcp/04-agent-as-mcp-server.ts", files: ["_shared/setup.ts", "mcp/04-agent-as-mcp-server.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/mcp": "^19.3.3", "@cogitator-ai/types": "^0.39.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "memory/basic-memory", title: "Basic Memory: Threads & Multi-Turn Conversations", entry: "memory/01-basic-memory.ts", files: ["_shared/setup.ts", "memory/01-basic-memory.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/memory": "^0.12.3", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "memory/context-builder", title: "Context Builder: Token-Aware Context Windows", entry: "memory/02-context-builder.ts", files: ["_shared/setup.ts", "memory/02-context-builder.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/memory": "^0.12.3", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "memory/semantic-search", title: "Semantic Search: Hybrid BM25 + Vector Search", entry: "memory/03-semantic-search.ts", files: ["_shared/setup.ts", "memory/03-semantic-search.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/memory": "^0.12.3", "@qdrant/js-client-rest": "^1.10.0", dotenv: "^18.0.5", pg: "^8.23.1" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "memory/knowledge-graph", title: "Knowledge Graph: Entity Extraction & Graph Traversal", entry: "memory/04-knowledge-graph.ts", files: ["_shared/setup.ts", "memory/04-knowledge-graph.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/memory": "^0.12.3", "@cogitator-ai/types": "^0.39.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "rag/basic-retrieval", title: "Basic RAG Retrieval", entry: "rag/01-basic-retrieval.ts", files: ["_shared/setup.ts", "rag/01-basic-retrieval.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/memory": "^0.12.3", "@cogitator-ai/rag": "^0.6.3", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "rag/chunking-strategies", title: "Chunking Strategies Comparison", entry: "rag/02-chunking-strategies.ts", files: ["_shared/setup.ts", "rag/02-chunking-strategies.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/memory": "^0.12.3", "@cogitator-ai/rag": "^0.6.3", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "rag/agent-with-rag", title: "Agent with RAG Tools", entry: "rag/03-agent-with-rag.ts", files: ["_shared/setup.ts", "rag/03-agent-with-rag.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/memory": "^0.12.3", "@cogitator-ai/rag": "^0.6.3", "@qdrant/js-client-rest": "^1.10.0", "better-sqlite3": "^13.0.3", dotenv: "^18.0.5", ioredis: "^5.0.0 || ^6.0.0", mongodb: "^6.0.0 || ^7.0.0", pg: "^8.23.1" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "swarms/debate-swarm", title: "Debate Swarm", entry: "swarms/01-debate-swarm.ts", files: ["_shared/setup.ts", "swarms/01-debate-swarm.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/swarms": "^0.12.3", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "swarms/pipeline-swarm", title: "Pipeline Swarm", entry: "swarms/02-pipeline-swarm.ts", files: ["_shared/setup.ts", "swarms/02-pipeline-swarm.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/swarms": "^0.12.3", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "swarms/hierarchical-swarm", title: "Hierarchical Swarm", entry: "swarms/03-hierarchical-swarm.ts", files: ["_shared/setup.ts", "swarms/03-hierarchical-swarm.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/swarms": "^0.12.3", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "swarms/negotiation-swarm", title: "Negotiation Swarm", entry: "swarms/04-negotiation-swarm.ts", files: ["_shared/setup.ts", "swarms/04-negotiation-swarm.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/swarms": "^0.12.3", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "voice/pipeline", title: "Voice Pipeline", entry: "voice/01-pipeline.ts", files: ["_shared/setup.ts", "voice/01-pipeline.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/voice": "^0.5.3", dotenv: "^18.0.5", openai: "^7.25.0" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "voice/realtime", title: "Realtime Voice Session", entry: "voice/02-realtime.ts", files: ["_shared/setup.ts", "voice/02-realtime.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/voice": "^0.5.3", dotenv: "^18.0.5", openai: "^7.25.0" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "voice/voice-agent", title: "Voice Agent (WebSocket Server)", entry: "voice/03-voice-agent.ts", files: ["_shared/setup.ts", "voice/03-voice-agent.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/voice": "^0.5.3", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "DEEPGRAM_API_KEY", "ELEVENLABS_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "voice/realtime-voice-agent", title: "Realtime Voice Agent (Gemini Live over WebSocket)", entry: "voice/04-realtime-voice-agent.ts", files: ["_shared/setup.ts", "voice/04-realtime-voice-agent.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/voice": "^0.5.3", dotenv: "^18.0.5", ws: "^8.22.0" }, devDependencies: { "@types/ws": "^8.18.2", tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "workflows/basic-workflow", title: "Basic Workflow: Code Review Pipeline", entry: "workflows/01-basic-workflow.ts", files: ["_shared/setup.ts", "workflows/01-basic-workflow.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/workflows": "^0.12.3", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "workflows/human-in-loop", title: "Human-in-the-Loop: Content Publishing Workflow", entry: "workflows/02-human-in-loop.ts", files: ["_shared/setup.ts", "workflows/02-human-in-loop.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/workflows": "^0.12.3", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "workflows/map-reduce", title: "Map-Reduce: Parallel Document Analysis", entry: "workflows/03-map-reduce.ts", files: ["_shared/setup.ts", "workflows/03-map-reduce.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/workflows": "^0.12.3", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }];
|
|
5
5
|
|
|
6
6
|
// <define:__COGITATOR_VERSIONS__>
|
|
7
|
-
var define_COGITATOR_VERSIONS_default = { "@cogitator-ai/a2a": "0.8.
|
|
7
|
+
var define_COGITATOR_VERSIONS_default = { "@cogitator-ai/a2a": "0.8.3", "@cogitator-ai/ai-sdk": "0.6.0", "@cogitator-ai/browser": "0.4.13", "@cogitator-ai/channels": "0.9.3", "@cogitator-ai/cli": "0.6.3", "@cogitator-ai/config": "0.13.0", "@cogitator-ai/core": "0.37.0", "@cogitator-ai/deploy": "0.6.2", "@cogitator-ai/evals": "0.6.0", "@cogitator-ai/express": "0.8.3", "@cogitator-ai/fastify": "0.7.3", "@cogitator-ai/hono": "0.7.3", "@cogitator-ai/koa": "0.7.3", "@cogitator-ai/mcp": "19.3.3", "@cogitator-ai/memory": "0.12.3", "@cogitator-ai/models": "18.3.0", "@cogitator-ai/neuro-symbolic": "17.0.23", "@cogitator-ai/next": "0.8.3", "@cogitator-ai/openai-compat": "21.2.3", "@cogitator-ai/rag": "0.6.3", "@cogitator-ai/redis": "0.5.2", "@cogitator-ai/sandbox": "0.5.12", "@cogitator-ai/self-modifying": "19.4.3", "@cogitator-ai/server-shared": "0.5.3", "@cogitator-ai/studio": "0.1.2", "@cogitator-ai/swarms": "0.12.3", "@cogitator-ai/test-utils": "0.2.17", "@cogitator-ai/tetsu": "0.5.3", "@cogitator-ai/types": "0.39.0", "@cogitator-ai/voice": "0.5.3", "@cogitator-ai/wasm-tools": "0.7.17", "@cogitator-ai/worker": "0.9.3", "@cogitator-ai/workflows": "0.12.3" };
|
|
8
8
|
|
|
9
9
|
// src/cli/main.ts
|
|
10
10
|
import { relative as relative2 } from "path";
|
|
@@ -259,6 +259,7 @@ function compatibilityIssues(spec) {
|
|
|
259
259
|
return issues;
|
|
260
260
|
}
|
|
261
261
|
var IncompatibleSpecError = class extends Error {
|
|
262
|
+
code = "INCOMPATIBLE_SPEC";
|
|
262
263
|
issues;
|
|
263
264
|
constructor(issues) {
|
|
264
265
|
super(
|
|
@@ -438,6 +439,103 @@ function execCommand(pm, bin) {
|
|
|
438
439
|
function installCommand(pm) {
|
|
439
440
|
return `${pm} install`;
|
|
440
441
|
}
|
|
442
|
+
var SYSTEM_CODES = [
|
|
443
|
+
"ECONNREFUSED",
|
|
444
|
+
"ECONNRESET",
|
|
445
|
+
"ENOTFOUND",
|
|
446
|
+
"EAI_AGAIN",
|
|
447
|
+
"ETIMEDOUT",
|
|
448
|
+
"ENETUNREACH",
|
|
449
|
+
"EHOSTUNREACH",
|
|
450
|
+
"EPROTO",
|
|
451
|
+
"EACCES",
|
|
452
|
+
"EPERM",
|
|
453
|
+
"ENOSPC",
|
|
454
|
+
"ENOENT",
|
|
455
|
+
"EINTEGRITY",
|
|
456
|
+
"ELIFECYCLE"
|
|
457
|
+
];
|
|
458
|
+
var PNPM_CODES = /* @__PURE__ */ new Set([
|
|
459
|
+
"NO_MATCHING_VERSION",
|
|
460
|
+
"NO_MATURE_MATCHING_VERSION",
|
|
461
|
+
"NO_VERSIONS",
|
|
462
|
+
"META_FETCH_FAIL",
|
|
463
|
+
"TARBALL_INTEGRITY",
|
|
464
|
+
"BAD_TARBALL_SIZE",
|
|
465
|
+
"PEER_DEP_ISSUES",
|
|
466
|
+
"UNSUPPORTED_ENGINE",
|
|
467
|
+
"UNSUPPORTED_PLATFORM",
|
|
468
|
+
"OUTDATED_LOCKFILE",
|
|
469
|
+
"BROKEN_LOCKFILE",
|
|
470
|
+
"LOCKFILE_BREAKING_CHANGE",
|
|
471
|
+
"LOCKFILE_MISSING_DEPENDENCY",
|
|
472
|
+
"NO_OFFLINE_META",
|
|
473
|
+
"NO_OFFLINE_TARBALL",
|
|
474
|
+
"LINKING_FAILED",
|
|
475
|
+
"UNEXPECTED_STORE",
|
|
476
|
+
"STORE_BREAKING_CHANGE",
|
|
477
|
+
"SPEC_NOT_SUPPORTED_BY_ANY_RESOLVER",
|
|
478
|
+
"IGNORED_BUILDS",
|
|
479
|
+
"INVALID_PACKAGE_NAME",
|
|
480
|
+
"PREPARE_PACKAGE",
|
|
481
|
+
...SYSTEM_CODES
|
|
482
|
+
]);
|
|
483
|
+
var NPM_CODES = /* @__PURE__ */ new Set([
|
|
484
|
+
"ETARGET",
|
|
485
|
+
"ENOVERSIONS",
|
|
486
|
+
"ERESOLVE",
|
|
487
|
+
"EBADENGINE",
|
|
488
|
+
"EBADPLATFORM",
|
|
489
|
+
"ENOTSUP",
|
|
490
|
+
"EJSONPARSE",
|
|
491
|
+
"EUNSUPPORTEDPROTOCOL",
|
|
492
|
+
...SYSTEM_CODES
|
|
493
|
+
]);
|
|
494
|
+
var BUN_ERRORS = {
|
|
495
|
+
ConnectionRefused: "ECONNREFUSED",
|
|
496
|
+
ConnectionResetByPeer: "ECONNRESET",
|
|
497
|
+
ConnectionClosed: "ECONNRESET",
|
|
498
|
+
ConnectionTimedOut: "ETIMEDOUT",
|
|
499
|
+
Timeout: "ETIMEDOUT",
|
|
500
|
+
NetworkUnreachable: "ENETUNREACH",
|
|
501
|
+
HostUnreachable: "EHOSTUNREACH"
|
|
502
|
+
};
|
|
503
|
+
var HTTP_ERROR = /^[45]\d\d$/;
|
|
504
|
+
var READERS = [
|
|
505
|
+
(output) => {
|
|
506
|
+
const code2 = /\bERR_PNPM_([A-Z0-9_]+)/.exec(output)?.[1];
|
|
507
|
+
if (code2 === void 0) return void 0;
|
|
508
|
+
const known = PNPM_CODES.has(code2) || /^FETCH_[45]\d\d$/.test(code2);
|
|
509
|
+
return known ? `ERR_PNPM_${code2}` : "ERR_PNPM_OTHER";
|
|
510
|
+
},
|
|
511
|
+
(output) => {
|
|
512
|
+
const code2 = /^npm (?:ERR!|error) code (\S+)/m.exec(output)?.[1];
|
|
513
|
+
if (code2 === void 0) return void 0;
|
|
514
|
+
if (NPM_CODES.has(code2)) return code2;
|
|
515
|
+
if (/^E[45]\d\d$/.test(code2)) return code2;
|
|
516
|
+
return /^npm (?:ERR!|error) command failed/m.test(output) ? "ELIFECYCLE" : "NPM_OTHER";
|
|
517
|
+
},
|
|
518
|
+
(output) => [...output.matchAll(/\bYN(\d{4}):/g)].map((match) => Number(match[1])).filter((code2) => code2 > 1 && code2 < 100).map((code2) => `YN${String(code2).padStart(4, "0")}`).at(-1),
|
|
519
|
+
(output) => /^error:? (?:No version matching |Couldn't find any versions for )/m.test(output) ? "NO_MATCHING_VERSION" : void 0,
|
|
520
|
+
(output) => {
|
|
521
|
+
const status = /^error: GET \S+ - (\d{3})$/m.exec(output)?.[1];
|
|
522
|
+
return status && HTTP_ERROR.test(status) ? `HTTP_${status}` : void 0;
|
|
523
|
+
},
|
|
524
|
+
(output) => /^error Error: https?:\/\/\S+: Not found/m.test(output) ? "HTTP_404" : void 0,
|
|
525
|
+
(output) => /^error:? (?:\S+ script from .* exited with|Command failed with exit code) \d+/m.test(output) ? "ELIFECYCLE" : void 0,
|
|
526
|
+
(output) => {
|
|
527
|
+
const name = /^error: ([A-Za-z]+) /m.exec(output)?.[1];
|
|
528
|
+
return name !== void 0 && Object.hasOwn(BUN_ERRORS, name) ? BUN_ERRORS[name] : void 0;
|
|
529
|
+
},
|
|
530
|
+
(output) => SYSTEM_CODES.find((code2) => new RegExp(`\\b${code2}\\b`).test(output))
|
|
531
|
+
];
|
|
532
|
+
function installErrorCode(output, exitCode) {
|
|
533
|
+
for (const read of READERS) {
|
|
534
|
+
const code2 = read(output);
|
|
535
|
+
if (code2 !== void 0) return code2;
|
|
536
|
+
}
|
|
537
|
+
return /\bYN0001:/.test(output) ? "YN0001" : `EXIT_${exitCode}`;
|
|
538
|
+
}
|
|
441
539
|
function ciInstallCommand(pm, packageManagerSpec) {
|
|
442
540
|
switch (pm) {
|
|
443
541
|
case "pnpm":
|
|
@@ -529,7 +627,7 @@ function yamlString(value) {
|
|
|
529
627
|
|
|
530
628
|
// src/kit/versions.ts
|
|
531
629
|
function scaffolderVersion() {
|
|
532
|
-
return false ? "0.0.0" : "0.
|
|
630
|
+
return false ? "0.0.0" : "0.6.0";
|
|
533
631
|
}
|
|
534
632
|
function workspaceVersions() {
|
|
535
633
|
return typeof define_COGITATOR_VERSIONS_default === "undefined" ? {} : define_COGITATOR_VERSIONS_default;
|
|
@@ -5931,6 +6029,19 @@ import { existsSync, readFileSync, readdirSync } from "fs";
|
|
|
5931
6029
|
import { chmod, mkdir, readFile, writeFile } from "fs/promises";
|
|
5932
6030
|
import { dirname as dirname2, join as join2, resolve } from "path";
|
|
5933
6031
|
|
|
6032
|
+
// src/kit/errors.ts
|
|
6033
|
+
var CodedError = class extends Error {
|
|
6034
|
+
code;
|
|
6035
|
+
constructor(code2, message, options) {
|
|
6036
|
+
super(message, options);
|
|
6037
|
+
this.name = "CodedError";
|
|
6038
|
+
this.code = code2;
|
|
6039
|
+
}
|
|
6040
|
+
};
|
|
6041
|
+
function constantCase(name) {
|
|
6042
|
+
return name.replace(/([a-z0-9])([A-Z])/g, "$1_$2").toUpperCase();
|
|
6043
|
+
}
|
|
6044
|
+
|
|
5934
6045
|
// src/kit/process.ts
|
|
5935
6046
|
import { spawn } from "child_process";
|
|
5936
6047
|
function tail(text2, lines = 20) {
|
|
@@ -6098,14 +6209,22 @@ ${tail(commit.output)}`));
|
|
|
6098
6209
|
}
|
|
6099
6210
|
async function installDependencies(directory, pm, inherit) {
|
|
6100
6211
|
if (!await hasCommand(pm, directory)) {
|
|
6101
|
-
return failure(
|
|
6212
|
+
return failure(
|
|
6213
|
+
new CodedError(
|
|
6214
|
+
"PM_NOT_FOUND",
|
|
6215
|
+
`${pm} is not installed, install it or pick another one with --pm`
|
|
6216
|
+
)
|
|
6217
|
+
);
|
|
6102
6218
|
}
|
|
6103
6219
|
try {
|
|
6104
6220
|
const result = await runCommand(pm, ["install"], { cwd: directory, inherit });
|
|
6105
6221
|
if (result.code !== 0) {
|
|
6106
6222
|
return failure(
|
|
6107
|
-
new
|
|
6108
|
-
|
|
6223
|
+
new CodedError(
|
|
6224
|
+
installErrorCode(result.output, result.code),
|
|
6225
|
+
`${installCommand(pm)} exited with ${result.code}:
|
|
6226
|
+
${tail(result.output)}`
|
|
6227
|
+
)
|
|
6109
6228
|
);
|
|
6110
6229
|
}
|
|
6111
6230
|
return { status: "done" };
|
|
@@ -6115,7 +6234,7 @@ ${tail(result.output)}`)
|
|
|
6115
6234
|
}
|
|
6116
6235
|
function assertEmptyDirectory(directory) {
|
|
6117
6236
|
if (existsSync(directory) && readdirSync(directory).length > 0) {
|
|
6118
|
-
throw new
|
|
6237
|
+
throw new CodedError("DIRECTORY_NOT_EMPTY", `${directory} already exists and is not empty`);
|
|
6119
6238
|
}
|
|
6120
6239
|
}
|
|
6121
6240
|
async function scaffold(spec, options) {
|
|
@@ -6182,7 +6301,23 @@ var SEND_TIMEOUT_MS = 1500;
|
|
|
6182
6301
|
function telemetryWebsiteId() {
|
|
6183
6302
|
return false ? "" : "ef978a40-6d7f-4332-81ba-e6d86e9d4b38";
|
|
6184
6303
|
}
|
|
6185
|
-
|
|
6304
|
+
var SAFE_CODE = /^[A-Z][A-Z0-9_]{1,63}$/;
|
|
6305
|
+
function telemetryErrorCode(error) {
|
|
6306
|
+
let kind;
|
|
6307
|
+
let current = error;
|
|
6308
|
+
for (let depth = 0; depth < 5 && typeof current === "object" && current !== null; depth++) {
|
|
6309
|
+
if ("code" in current && typeof current.code === "string" && SAFE_CODE.test(current.code))
|
|
6310
|
+
return current.code;
|
|
6311
|
+
if (!kind && current instanceof Error && current.name !== "Error" && /^[A-Za-z]+$/.test(current.name))
|
|
6312
|
+
kind = constantCase(current.name);
|
|
6313
|
+
current = "cause" in current ? current.cause : void 0;
|
|
6314
|
+
}
|
|
6315
|
+
return kind ?? "UNKNOWN";
|
|
6316
|
+
}
|
|
6317
|
+
function installFailure(result) {
|
|
6318
|
+
return result.install.status === "failed" ? { step: "install", error: result.install.error } : void 0;
|
|
6319
|
+
}
|
|
6320
|
+
function payloadFor(spec, failure2, kind = "generated") {
|
|
6186
6321
|
return {
|
|
6187
6322
|
version: scaffolderVersion(),
|
|
6188
6323
|
preset: kind !== "generated" ? kind : spec?.preset ?? "custom",
|
|
@@ -6192,7 +6327,9 @@ function payloadFor(spec, outcome, kind = "generated") {
|
|
|
6192
6327
|
packageManager: spec?.packageManager ?? "unknown",
|
|
6193
6328
|
node: process.versions.node.split(".")[0],
|
|
6194
6329
|
os: process.platform,
|
|
6195
|
-
outcome
|
|
6330
|
+
outcome: failure2 ? "failure" : "success",
|
|
6331
|
+
failedStep: failure2?.step ?? "none",
|
|
6332
|
+
errorCode: failure2 ? telemetryErrorCode(failure2.error) : "none"
|
|
6196
6333
|
};
|
|
6197
6334
|
}
|
|
6198
6335
|
function telemetryDisabledReason(options) {
|
|
@@ -6223,7 +6360,15 @@ function firstRunNotice(env = process.env) {
|
|
|
6223
6360
|
} catch {
|
|
6224
6361
|
return void 0;
|
|
6225
6362
|
}
|
|
6226
|
-
return `Cogitator sends one anonymous event per scaffolded project (version, preset, provider, memory, add-ons, package manager, Node major, OS). Turn it off with --no-telemetry or COGITATOR_TELEMETRY_DISABLED=1: ${TELEMETRY_DOCS}`;
|
|
6363
|
+
return `Cogitator sends one anonymous event per scaffolded project (version, preset, provider, memory, add-ons, package manager, Node major, OS, and where and why it failed if it did). Turn it off with --no-telemetry or COGITATOR_TELEMETRY_DISABLED=1: ${TELEMETRY_DOCS}`;
|
|
6364
|
+
}
|
|
6365
|
+
var UA_PLATFORMS = {
|
|
6366
|
+
darwin: "Macintosh; Intel Mac OS X 10_15_7",
|
|
6367
|
+
linux: "X11; Linux x86_64",
|
|
6368
|
+
win32: "Windows NT 10.0; Win64; x64"
|
|
6369
|
+
};
|
|
6370
|
+
function telemetryUserAgent(payload) {
|
|
6371
|
+
return `Mozilla/5.0 (${UA_PLATFORMS[payload.os] ?? payload.os}) create-cogitator-app/${payload.version}`;
|
|
6227
6372
|
}
|
|
6228
6373
|
async function sendTelemetry(payload, options = {}) {
|
|
6229
6374
|
const website = options.websiteId ?? telemetryWebsiteId();
|
|
@@ -6243,7 +6388,7 @@ async function sendTelemetry(payload, options = {}) {
|
|
|
6243
6388
|
method: "POST",
|
|
6244
6389
|
headers: {
|
|
6245
6390
|
"content-type": "application/json",
|
|
6246
|
-
"user-agent":
|
|
6391
|
+
"user-agent": telemetryUserAgent(payload)
|
|
6247
6392
|
},
|
|
6248
6393
|
body: JSON.stringify(body),
|
|
6249
6394
|
signal: AbortSignal.timeout(options.timeoutMs ?? SEND_TIMEOUT_MS)
|
|
@@ -6304,14 +6449,16 @@ function findExample(query, index = examples()) {
|
|
|
6304
6449
|
const short = index.filter((example) => example.name.split("/")[1] === normalized);
|
|
6305
6450
|
if (short.length === 1) return short[0];
|
|
6306
6451
|
if (short.length > 1) {
|
|
6307
|
-
throw new
|
|
6452
|
+
throw new CodedError(
|
|
6453
|
+
"AMBIGUOUS_EXAMPLE",
|
|
6308
6454
|
`"${query}" is in more than one category: ${short.map((example) => example.name).join(", ")}`
|
|
6309
6455
|
);
|
|
6310
6456
|
}
|
|
6311
6457
|
const names = index.map((example) => example.name);
|
|
6312
6458
|
const match = closest(normalized, [...names, ...names.map((name) => name.split("/")[1])]);
|
|
6313
6459
|
const suggestion2 = match ? ` Did you mean "${names.find((name) => name.endsWith(match)) ?? match}"?` : "";
|
|
6314
|
-
throw new
|
|
6460
|
+
throw new CodedError(
|
|
6461
|
+
"UNKNOWN_EXAMPLE",
|
|
6315
6462
|
`There is no example "${query}".${suggestion2} Run with --list-examples to see them all.`
|
|
6316
6463
|
);
|
|
6317
6464
|
}
|
|
@@ -6473,11 +6620,17 @@ async function fetchExampleFiles(plan, fetchImpl = fetch) {
|
|
|
6473
6620
|
const url = exampleFileUrl(plan.ref, path);
|
|
6474
6621
|
const response = await fetchImpl(url, { signal: AbortSignal.timeout(3e4) });
|
|
6475
6622
|
if (response.status === 404) {
|
|
6476
|
-
throw new
|
|
6623
|
+
throw new CodedError(
|
|
6624
|
+
"HTTP_404",
|
|
6477
6625
|
`examples/${path} is not at ${plan.ref} of ${EXAMPLES_REPO.owner}/${EXAMPLES_REPO.repo}. Pass --example ${plan.example.name}#main for the main branch.`
|
|
6478
6626
|
);
|
|
6479
6627
|
}
|
|
6480
|
-
if (!response.ok)
|
|
6628
|
+
if (!response.ok) {
|
|
6629
|
+
throw new CodedError(
|
|
6630
|
+
`HTTP_${response.status}`,
|
|
6631
|
+
`Could not download ${url}: HTTP ${response.status}`
|
|
6632
|
+
);
|
|
6633
|
+
}
|
|
6481
6634
|
return { path: exampleTarget(path), content: await response.text() };
|
|
6482
6635
|
})
|
|
6483
6636
|
);
|
|
@@ -6514,22 +6667,28 @@ async function downloadTemplate(template, directory, options = {}) {
|
|
|
6514
6667
|
signal: AbortSignal.timeout(12e4)
|
|
6515
6668
|
});
|
|
6516
6669
|
if (response.status === 404) {
|
|
6517
|
-
throw new
|
|
6670
|
+
throw new CodedError(
|
|
6671
|
+
"HTTP_404",
|
|
6518
6672
|
`${describeTemplate(template)} was not found: check the repository and the ref${options.token ? "" : ", and set GITHUB_TOKEN for a private repository"}`
|
|
6519
6673
|
);
|
|
6520
6674
|
}
|
|
6521
6675
|
if (!response.ok) {
|
|
6522
|
-
throw new
|
|
6676
|
+
throw new CodedError(
|
|
6677
|
+
`HTTP_${response.status}`,
|
|
6678
|
+
`Could not download ${describeTemplate(template)}: HTTP ${response.status}`
|
|
6679
|
+
);
|
|
6523
6680
|
}
|
|
6524
6681
|
const length = Number(response.headers.get("content-length") ?? 0);
|
|
6525
6682
|
if (length > MAX_ARCHIVE_BYTES) {
|
|
6526
|
-
throw new
|
|
6683
|
+
throw new CodedError(
|
|
6684
|
+
"TEMPLATE_TOO_LARGE",
|
|
6527
6685
|
`${describeTemplate(template)} is larger than ${MAX_ARCHIVE_BYTES / 1024 / 1024} MB`
|
|
6528
6686
|
);
|
|
6529
6687
|
}
|
|
6530
6688
|
const archive = Buffer.from(await response.arrayBuffer());
|
|
6531
6689
|
if (archive.length > MAX_ARCHIVE_BYTES) {
|
|
6532
|
-
throw new
|
|
6690
|
+
throw new CodedError(
|
|
6691
|
+
"TEMPLATE_TOO_LARGE",
|
|
6533
6692
|
`${describeTemplate(template)} is larger than ${MAX_ARCHIVE_BYTES / 1024 / 1024} MB`
|
|
6534
6693
|
);
|
|
6535
6694
|
}
|
|
@@ -6559,7 +6718,8 @@ async function downloadTemplate(template, directory, options = {}) {
|
|
|
6559
6718
|
})
|
|
6560
6719
|
);
|
|
6561
6720
|
if (files.length === 0) {
|
|
6562
|
-
throw new
|
|
6721
|
+
throw new CodedError(
|
|
6722
|
+
"TEMPLATE_EMPTY",
|
|
6563
6723
|
template.path ? `${describeTemplate(template)} has no files under ${template.path}` : `${describeTemplate(template)} is empty`
|
|
6564
6724
|
);
|
|
6565
6725
|
}
|
|
@@ -6569,7 +6729,8 @@ function prepareTemplate(directory, options) {
|
|
|
6569
6729
|
const lockfile = PACKAGE_MANAGERS.find((pm) => existsSync3(join4(directory, LOCKFILES[pm])));
|
|
6570
6730
|
const manifestPath = join4(directory, "package.json");
|
|
6571
6731
|
if (!existsSync3(manifestPath)) {
|
|
6572
|
-
throw new
|
|
6732
|
+
throw new CodedError(
|
|
6733
|
+
"TEMPLATE_NO_MANIFEST",
|
|
6573
6734
|
`The template has no package.json at its root (it has ${readdirSync2(directory).slice(0, 8).join(", ")}): point --template at the project directory`
|
|
6574
6735
|
);
|
|
6575
6736
|
}
|
|
@@ -6597,7 +6758,8 @@ function prepareTemplate(directory, options) {
|
|
|
6597
6758
|
}
|
|
6598
6759
|
}
|
|
6599
6760
|
if (unresolvable.length > 0) {
|
|
6600
|
-
throw new
|
|
6761
|
+
throw new CodedError(
|
|
6762
|
+
"TEMPLATE_WORKSPACE_DEPENDENCIES",
|
|
6601
6763
|
`The template depends on packages of its own monorepo, which cannot be installed outside it: ${unresolvable.join(", ")}`
|
|
6602
6764
|
);
|
|
6603
6765
|
}
|
|
@@ -6734,6 +6896,7 @@ async function createFromTemplate(template, options) {
|
|
|
6734
6896
|
// src/cli/args.ts
|
|
6735
6897
|
import { parseArgs } from "util";
|
|
6736
6898
|
var CliError = class extends Error {
|
|
6899
|
+
code = "INVALID_ARGS";
|
|
6737
6900
|
constructor(message) {
|
|
6738
6901
|
super(message);
|
|
6739
6902
|
this.name = "CliError";
|
|
@@ -7588,24 +7751,21 @@ async function run(argv, io = defaultIo, deps = {}) {
|
|
|
7588
7751
|
if (args.example !== void 0 || args.remote) {
|
|
7589
7752
|
const kind = args.example !== void 0 ? "example" : "template";
|
|
7590
7753
|
try {
|
|
7591
|
-
const
|
|
7592
|
-
if (
|
|
7593
|
-
await report(
|
|
7594
|
-
|
|
7595
|
-
deps,
|
|
7596
|
-
payloadFor(void 0, code2 === 0 ? "success" : "failure", kind)
|
|
7597
|
-
);
|
|
7598
|
-
return code2;
|
|
7754
|
+
const created = await runStarter(args, interactive, io, deps);
|
|
7755
|
+
if (created)
|
|
7756
|
+
await report(telemetry, deps, payloadFor(void 0, installFailure(created), kind));
|
|
7757
|
+
return 0;
|
|
7599
7758
|
} catch (error) {
|
|
7600
7759
|
if (error instanceof CancelledError) {
|
|
7601
7760
|
p2.cancel("Cancelled, nothing was created.");
|
|
7602
7761
|
return 1;
|
|
7603
7762
|
}
|
|
7604
|
-
await report(telemetry, deps, payloadFor(void 0, "
|
|
7763
|
+
await report(telemetry, deps, payloadFor(void 0, { step: "create", error }, kind));
|
|
7605
7764
|
return reportError(error, args.json, io);
|
|
7606
7765
|
}
|
|
7607
7766
|
}
|
|
7608
7767
|
let resolvedSpec;
|
|
7768
|
+
let reported = false;
|
|
7609
7769
|
try {
|
|
7610
7770
|
if (interactive) {
|
|
7611
7771
|
io.stderr(banner(version));
|
|
@@ -7639,11 +7799,8 @@ async function run(argv, io = defaultIo, deps = {}) {
|
|
|
7639
7799
|
git: args.git ?? true,
|
|
7640
7800
|
log: args.json ? void 0 : clackLogger()
|
|
7641
7801
|
});
|
|
7642
|
-
|
|
7643
|
-
|
|
7644
|
-
deps,
|
|
7645
|
-
payloadFor(result.plan.spec, result.install.status === "failed" ? "failure" : "success")
|
|
7646
|
-
);
|
|
7802
|
+
reported = true;
|
|
7803
|
+
await report(telemetry, deps, payloadFor(result.plan.spec, installFailure(result)));
|
|
7647
7804
|
const modelReady = result.plan.spec.provider === "ollama" ? await prepareOllama(result.plan, interactive) : true;
|
|
7648
7805
|
const key = envKey ? args.apiKey ?? process.env[envKey] : void 0;
|
|
7649
7806
|
const provider = result.plan.spec.provider;
|
|
@@ -7690,7 +7847,8 @@ async function run(argv, io = defaultIo, deps = {}) {
|
|
|
7690
7847
|
p2.cancel("Cancelled, nothing was created.");
|
|
7691
7848
|
return 1;
|
|
7692
7849
|
}
|
|
7693
|
-
if (resolvedSpec
|
|
7850
|
+
if (resolvedSpec && !reported)
|
|
7851
|
+
await report(telemetry, deps, payloadFor(resolvedSpec, { step: "create", error }));
|
|
7694
7852
|
return reportError(error, args.json, io);
|
|
7695
7853
|
}
|
|
7696
7854
|
}
|
|
@@ -7769,7 +7927,7 @@ async function runStarter(args, interactive, io, deps) {
|
|
|
7769
7927
|
].join("\n")
|
|
7770
7928
|
);
|
|
7771
7929
|
}
|
|
7772
|
-
return 0;
|
|
7930
|
+
return void 0;
|
|
7773
7931
|
}
|
|
7774
7932
|
result = await createFromExample(plan, options);
|
|
7775
7933
|
} else if (args.remote) {
|
|
@@ -7780,7 +7938,7 @@ async function runStarter(args, interactive, io, deps) {
|
|
|
7780
7938
|
` : `${pc2.bold("Dry run:")} nothing was written. ${message}.
|
|
7781
7939
|
`
|
|
7782
7940
|
);
|
|
7783
|
-
return 0;
|
|
7941
|
+
return void 0;
|
|
7784
7942
|
}
|
|
7785
7943
|
result = await createFromTemplate(args.remote, {
|
|
7786
7944
|
...options,
|
|
@@ -7808,13 +7966,13 @@ async function runStarter(args, interactive, io, deps) {
|
|
|
7808
7966
|
)}
|
|
7809
7967
|
`
|
|
7810
7968
|
);
|
|
7811
|
-
return
|
|
7969
|
+
return result;
|
|
7812
7970
|
}
|
|
7813
7971
|
for (const note of result.notes) p2.log.info(note);
|
|
7814
7972
|
if (interactive) p2.outro(starterOutro(result));
|
|
7815
7973
|
else io.stderr(`${starterOutro(result)}
|
|
7816
7974
|
`);
|
|
7817
|
-
return
|
|
7975
|
+
return result;
|
|
7818
7976
|
}
|
|
7819
7977
|
function reportError(error, json, io) {
|
|
7820
7978
|
const message = error instanceof Error ? error.message : String(error);
|