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/lib.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// <define:__COGITATOR_EXAMPLES__>
|
|
2
|
-
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" }];
|
|
2
|
+
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" }];
|
|
3
3
|
|
|
4
4
|
// <define:__COGITATOR_VERSIONS__>
|
|
5
|
-
var define_COGITATOR_VERSIONS_default = { "@cogitator-ai/a2a": "0.8.
|
|
5
|
+
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" };
|
|
6
6
|
|
|
7
7
|
// src/kit/scaffold.ts
|
|
8
8
|
import { createHash } from "crypto";
|
|
@@ -10,6 +10,19 @@ import { existsSync, readFileSync, readdirSync } from "fs";
|
|
|
10
10
|
import { chmod, mkdir, readFile, writeFile } from "fs/promises";
|
|
11
11
|
import { dirname as dirname2, join as join2, resolve } from "path";
|
|
12
12
|
|
|
13
|
+
// src/kit/errors.ts
|
|
14
|
+
var CodedError = class extends Error {
|
|
15
|
+
code;
|
|
16
|
+
constructor(code2, message, options) {
|
|
17
|
+
super(message, options);
|
|
18
|
+
this.name = "CodedError";
|
|
19
|
+
this.code = code2;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
function constantCase(name) {
|
|
23
|
+
return name.replace(/([a-z0-9])([A-Z])/g, "$1_$2").toUpperCase();
|
|
24
|
+
}
|
|
25
|
+
|
|
13
26
|
// src/kit/spec.ts
|
|
14
27
|
import { z } from "zod";
|
|
15
28
|
var PROVIDERS = ["ollama", "openai", "anthropic", "google"];
|
|
@@ -123,6 +136,103 @@ function execCommand(pm, bin) {
|
|
|
123
136
|
function installCommand(pm) {
|
|
124
137
|
return `${pm} install`;
|
|
125
138
|
}
|
|
139
|
+
var SYSTEM_CODES = [
|
|
140
|
+
"ECONNREFUSED",
|
|
141
|
+
"ECONNRESET",
|
|
142
|
+
"ENOTFOUND",
|
|
143
|
+
"EAI_AGAIN",
|
|
144
|
+
"ETIMEDOUT",
|
|
145
|
+
"ENETUNREACH",
|
|
146
|
+
"EHOSTUNREACH",
|
|
147
|
+
"EPROTO",
|
|
148
|
+
"EACCES",
|
|
149
|
+
"EPERM",
|
|
150
|
+
"ENOSPC",
|
|
151
|
+
"ENOENT",
|
|
152
|
+
"EINTEGRITY",
|
|
153
|
+
"ELIFECYCLE"
|
|
154
|
+
];
|
|
155
|
+
var PNPM_CODES = /* @__PURE__ */ new Set([
|
|
156
|
+
"NO_MATCHING_VERSION",
|
|
157
|
+
"NO_MATURE_MATCHING_VERSION",
|
|
158
|
+
"NO_VERSIONS",
|
|
159
|
+
"META_FETCH_FAIL",
|
|
160
|
+
"TARBALL_INTEGRITY",
|
|
161
|
+
"BAD_TARBALL_SIZE",
|
|
162
|
+
"PEER_DEP_ISSUES",
|
|
163
|
+
"UNSUPPORTED_ENGINE",
|
|
164
|
+
"UNSUPPORTED_PLATFORM",
|
|
165
|
+
"OUTDATED_LOCKFILE",
|
|
166
|
+
"BROKEN_LOCKFILE",
|
|
167
|
+
"LOCKFILE_BREAKING_CHANGE",
|
|
168
|
+
"LOCKFILE_MISSING_DEPENDENCY",
|
|
169
|
+
"NO_OFFLINE_META",
|
|
170
|
+
"NO_OFFLINE_TARBALL",
|
|
171
|
+
"LINKING_FAILED",
|
|
172
|
+
"UNEXPECTED_STORE",
|
|
173
|
+
"STORE_BREAKING_CHANGE",
|
|
174
|
+
"SPEC_NOT_SUPPORTED_BY_ANY_RESOLVER",
|
|
175
|
+
"IGNORED_BUILDS",
|
|
176
|
+
"INVALID_PACKAGE_NAME",
|
|
177
|
+
"PREPARE_PACKAGE",
|
|
178
|
+
...SYSTEM_CODES
|
|
179
|
+
]);
|
|
180
|
+
var NPM_CODES = /* @__PURE__ */ new Set([
|
|
181
|
+
"ETARGET",
|
|
182
|
+
"ENOVERSIONS",
|
|
183
|
+
"ERESOLVE",
|
|
184
|
+
"EBADENGINE",
|
|
185
|
+
"EBADPLATFORM",
|
|
186
|
+
"ENOTSUP",
|
|
187
|
+
"EJSONPARSE",
|
|
188
|
+
"EUNSUPPORTEDPROTOCOL",
|
|
189
|
+
...SYSTEM_CODES
|
|
190
|
+
]);
|
|
191
|
+
var BUN_ERRORS = {
|
|
192
|
+
ConnectionRefused: "ECONNREFUSED",
|
|
193
|
+
ConnectionResetByPeer: "ECONNRESET",
|
|
194
|
+
ConnectionClosed: "ECONNRESET",
|
|
195
|
+
ConnectionTimedOut: "ETIMEDOUT",
|
|
196
|
+
Timeout: "ETIMEDOUT",
|
|
197
|
+
NetworkUnreachable: "ENETUNREACH",
|
|
198
|
+
HostUnreachable: "EHOSTUNREACH"
|
|
199
|
+
};
|
|
200
|
+
var HTTP_ERROR = /^[45]\d\d$/;
|
|
201
|
+
var READERS = [
|
|
202
|
+
(output) => {
|
|
203
|
+
const code2 = /\bERR_PNPM_([A-Z0-9_]+)/.exec(output)?.[1];
|
|
204
|
+
if (code2 === void 0) return void 0;
|
|
205
|
+
const known = PNPM_CODES.has(code2) || /^FETCH_[45]\d\d$/.test(code2);
|
|
206
|
+
return known ? `ERR_PNPM_${code2}` : "ERR_PNPM_OTHER";
|
|
207
|
+
},
|
|
208
|
+
(output) => {
|
|
209
|
+
const code2 = /^npm (?:ERR!|error) code (\S+)/m.exec(output)?.[1];
|
|
210
|
+
if (code2 === void 0) return void 0;
|
|
211
|
+
if (NPM_CODES.has(code2)) return code2;
|
|
212
|
+
if (/^E[45]\d\d$/.test(code2)) return code2;
|
|
213
|
+
return /^npm (?:ERR!|error) command failed/m.test(output) ? "ELIFECYCLE" : "NPM_OTHER";
|
|
214
|
+
},
|
|
215
|
+
(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),
|
|
216
|
+
(output) => /^error:? (?:No version matching |Couldn't find any versions for )/m.test(output) ? "NO_MATCHING_VERSION" : void 0,
|
|
217
|
+
(output) => {
|
|
218
|
+
const status = /^error: GET \S+ - (\d{3})$/m.exec(output)?.[1];
|
|
219
|
+
return status && HTTP_ERROR.test(status) ? `HTTP_${status}` : void 0;
|
|
220
|
+
},
|
|
221
|
+
(output) => /^error Error: https?:\/\/\S+: Not found/m.test(output) ? "HTTP_404" : void 0,
|
|
222
|
+
(output) => /^error:? (?:\S+ script from .* exited with|Command failed with exit code) \d+/m.test(output) ? "ELIFECYCLE" : void 0,
|
|
223
|
+
(output) => {
|
|
224
|
+
const name = /^error: ([A-Za-z]+) /m.exec(output)?.[1];
|
|
225
|
+
return name !== void 0 && Object.hasOwn(BUN_ERRORS, name) ? BUN_ERRORS[name] : void 0;
|
|
226
|
+
},
|
|
227
|
+
(output) => SYSTEM_CODES.find((code2) => new RegExp(`\\b${code2}\\b`).test(output))
|
|
228
|
+
];
|
|
229
|
+
function installErrorCode(output, exitCode) {
|
|
230
|
+
for (const read of READERS) {
|
|
231
|
+
const code2 = read(output);
|
|
232
|
+
if (code2 !== void 0) return code2;
|
|
233
|
+
}
|
|
234
|
+
return /\bYN0001:/.test(output) ? "YN0001" : `EXIT_${exitCode}`;
|
|
235
|
+
}
|
|
126
236
|
function ciInstallCommand(pm, packageManagerSpec) {
|
|
127
237
|
switch (pm) {
|
|
128
238
|
case "pnpm":
|
|
@@ -305,6 +415,7 @@ function compatibilityIssues(spec) {
|
|
|
305
415
|
return issues;
|
|
306
416
|
}
|
|
307
417
|
var IncompatibleSpecError = class extends Error {
|
|
418
|
+
code = "INCOMPATIBLE_SPEC";
|
|
308
419
|
issues;
|
|
309
420
|
constructor(issues) {
|
|
310
421
|
super(
|
|
@@ -392,7 +503,7 @@ function yamlString(value) {
|
|
|
392
503
|
|
|
393
504
|
// src/kit/versions.ts
|
|
394
505
|
function scaffolderVersion() {
|
|
395
|
-
return false ? "0.0.0" : "0.
|
|
506
|
+
return false ? "0.0.0" : "0.6.0";
|
|
396
507
|
}
|
|
397
508
|
function workspaceVersions() {
|
|
398
509
|
return typeof define_COGITATOR_VERSIONS_default === "undefined" ? {} : define_COGITATOR_VERSIONS_default;
|
|
@@ -5981,14 +6092,22 @@ ${tail(commit.output)}`));
|
|
|
5981
6092
|
}
|
|
5982
6093
|
async function installDependencies(directory, pm, inherit) {
|
|
5983
6094
|
if (!await hasCommand(pm, directory)) {
|
|
5984
|
-
return failure(
|
|
6095
|
+
return failure(
|
|
6096
|
+
new CodedError(
|
|
6097
|
+
"PM_NOT_FOUND",
|
|
6098
|
+
`${pm} is not installed, install it or pick another one with --pm`
|
|
6099
|
+
)
|
|
6100
|
+
);
|
|
5985
6101
|
}
|
|
5986
6102
|
try {
|
|
5987
6103
|
const result = await runCommand(pm, ["install"], { cwd: directory, inherit });
|
|
5988
6104
|
if (result.code !== 0) {
|
|
5989
6105
|
return failure(
|
|
5990
|
-
new
|
|
5991
|
-
|
|
6106
|
+
new CodedError(
|
|
6107
|
+
installErrorCode(result.output, result.code),
|
|
6108
|
+
`${installCommand(pm)} exited with ${result.code}:
|
|
6109
|
+
${tail(result.output)}`
|
|
6110
|
+
)
|
|
5992
6111
|
);
|
|
5993
6112
|
}
|
|
5994
6113
|
return { status: "done" };
|
|
@@ -5998,7 +6117,7 @@ ${tail(result.output)}`)
|
|
|
5998
6117
|
}
|
|
5999
6118
|
function assertEmptyDirectory(directory) {
|
|
6000
6119
|
if (existsSync(directory) && readdirSync(directory).length > 0) {
|
|
6001
|
-
throw new
|
|
6120
|
+
throw new CodedError("DIRECTORY_NOT_EMPTY", `${directory} already exists and is not empty`);
|
|
6002
6121
|
}
|
|
6003
6122
|
}
|
|
6004
6123
|
async function scaffold(spec, options) {
|
|
@@ -6669,14 +6788,16 @@ function findExample(query, index = examples()) {
|
|
|
6669
6788
|
const short = index.filter((example) => example.name.split("/")[1] === normalized);
|
|
6670
6789
|
if (short.length === 1) return short[0];
|
|
6671
6790
|
if (short.length > 1) {
|
|
6672
|
-
throw new
|
|
6791
|
+
throw new CodedError(
|
|
6792
|
+
"AMBIGUOUS_EXAMPLE",
|
|
6673
6793
|
`"${query}" is in more than one category: ${short.map((example) => example.name).join(", ")}`
|
|
6674
6794
|
);
|
|
6675
6795
|
}
|
|
6676
6796
|
const names = index.map((example) => example.name);
|
|
6677
6797
|
const match = closest(normalized, [...names, ...names.map((name) => name.split("/")[1])]);
|
|
6678
6798
|
const suggestion2 = match ? ` Did you mean "${names.find((name) => name.endsWith(match)) ?? match}"?` : "";
|
|
6679
|
-
throw new
|
|
6799
|
+
throw new CodedError(
|
|
6800
|
+
"UNKNOWN_EXAMPLE",
|
|
6680
6801
|
`There is no example "${query}".${suggestion2} Run with --list-examples to see them all.`
|
|
6681
6802
|
);
|
|
6682
6803
|
}
|
|
@@ -6838,11 +6959,17 @@ async function fetchExampleFiles(plan, fetchImpl = fetch) {
|
|
|
6838
6959
|
const url = exampleFileUrl(plan.ref, path);
|
|
6839
6960
|
const response = await fetchImpl(url, { signal: AbortSignal.timeout(3e4) });
|
|
6840
6961
|
if (response.status === 404) {
|
|
6841
|
-
throw new
|
|
6962
|
+
throw new CodedError(
|
|
6963
|
+
"HTTP_404",
|
|
6842
6964
|
`examples/${path} is not at ${plan.ref} of ${EXAMPLES_REPO.owner}/${EXAMPLES_REPO.repo}. Pass --example ${plan.example.name}#main for the main branch.`
|
|
6843
6965
|
);
|
|
6844
6966
|
}
|
|
6845
|
-
if (!response.ok)
|
|
6967
|
+
if (!response.ok) {
|
|
6968
|
+
throw new CodedError(
|
|
6969
|
+
`HTTP_${response.status}`,
|
|
6970
|
+
`Could not download ${url}: HTTP ${response.status}`
|
|
6971
|
+
);
|
|
6972
|
+
}
|
|
6846
6973
|
return { path: exampleTarget(path), content: await response.text() };
|
|
6847
6974
|
})
|
|
6848
6975
|
);
|
|
@@ -6879,22 +7006,28 @@ async function downloadTemplate(template, directory, options = {}) {
|
|
|
6879
7006
|
signal: AbortSignal.timeout(12e4)
|
|
6880
7007
|
});
|
|
6881
7008
|
if (response.status === 404) {
|
|
6882
|
-
throw new
|
|
7009
|
+
throw new CodedError(
|
|
7010
|
+
"HTTP_404",
|
|
6883
7011
|
`${describeTemplate(template)} was not found: check the repository and the ref${options.token ? "" : ", and set GITHUB_TOKEN for a private repository"}`
|
|
6884
7012
|
);
|
|
6885
7013
|
}
|
|
6886
7014
|
if (!response.ok) {
|
|
6887
|
-
throw new
|
|
7015
|
+
throw new CodedError(
|
|
7016
|
+
`HTTP_${response.status}`,
|
|
7017
|
+
`Could not download ${describeTemplate(template)}: HTTP ${response.status}`
|
|
7018
|
+
);
|
|
6888
7019
|
}
|
|
6889
7020
|
const length = Number(response.headers.get("content-length") ?? 0);
|
|
6890
7021
|
if (length > MAX_ARCHIVE_BYTES) {
|
|
6891
|
-
throw new
|
|
7022
|
+
throw new CodedError(
|
|
7023
|
+
"TEMPLATE_TOO_LARGE",
|
|
6892
7024
|
`${describeTemplate(template)} is larger than ${MAX_ARCHIVE_BYTES / 1024 / 1024} MB`
|
|
6893
7025
|
);
|
|
6894
7026
|
}
|
|
6895
7027
|
const archive = Buffer.from(await response.arrayBuffer());
|
|
6896
7028
|
if (archive.length > MAX_ARCHIVE_BYTES) {
|
|
6897
|
-
throw new
|
|
7029
|
+
throw new CodedError(
|
|
7030
|
+
"TEMPLATE_TOO_LARGE",
|
|
6898
7031
|
`${describeTemplate(template)} is larger than ${MAX_ARCHIVE_BYTES / 1024 / 1024} MB`
|
|
6899
7032
|
);
|
|
6900
7033
|
}
|
|
@@ -6924,7 +7057,8 @@ async function downloadTemplate(template, directory, options = {}) {
|
|
|
6924
7057
|
})
|
|
6925
7058
|
);
|
|
6926
7059
|
if (files.length === 0) {
|
|
6927
|
-
throw new
|
|
7060
|
+
throw new CodedError(
|
|
7061
|
+
"TEMPLATE_EMPTY",
|
|
6928
7062
|
template.path ? `${describeTemplate(template)} has no files under ${template.path}` : `${describeTemplate(template)} is empty`
|
|
6929
7063
|
);
|
|
6930
7064
|
}
|
|
@@ -6934,7 +7068,8 @@ function prepareTemplate(directory, options) {
|
|
|
6934
7068
|
const lockfile = PACKAGE_MANAGERS.find((pm) => existsSync3(join4(directory, LOCKFILES[pm])));
|
|
6935
7069
|
const manifestPath = join4(directory, "package.json");
|
|
6936
7070
|
if (!existsSync3(manifestPath)) {
|
|
6937
|
-
throw new
|
|
7071
|
+
throw new CodedError(
|
|
7072
|
+
"TEMPLATE_NO_MANIFEST",
|
|
6938
7073
|
`The template has no package.json at its root (it has ${readdirSync2(directory).slice(0, 8).join(", ")}): point --template at the project directory`
|
|
6939
7074
|
);
|
|
6940
7075
|
}
|
|
@@ -6962,7 +7097,8 @@ function prepareTemplate(directory, options) {
|
|
|
6962
7097
|
}
|
|
6963
7098
|
}
|
|
6964
7099
|
if (unresolvable.length > 0) {
|
|
6965
|
-
throw new
|
|
7100
|
+
throw new CodedError(
|
|
7101
|
+
"TEMPLATE_WORKSPACE_DEPENDENCIES",
|
|
6966
7102
|
`The template depends on packages of its own monorepo, which cannot be installed outside it: ${unresolvable.join(", ")}`
|
|
6967
7103
|
);
|
|
6968
7104
|
}
|
|
@@ -7411,9 +7547,27 @@ var PAYLOAD_FIELDS = [
|
|
|
7411
7547
|
"packageManager",
|
|
7412
7548
|
"node",
|
|
7413
7549
|
"os",
|
|
7414
|
-
"outcome"
|
|
7550
|
+
"outcome",
|
|
7551
|
+
"failedStep",
|
|
7552
|
+
"errorCode"
|
|
7415
7553
|
];
|
|
7416
|
-
|
|
7554
|
+
var SAFE_CODE = /^[A-Z][A-Z0-9_]{1,63}$/;
|
|
7555
|
+
function telemetryErrorCode(error) {
|
|
7556
|
+
let kind;
|
|
7557
|
+
let current = error;
|
|
7558
|
+
for (let depth = 0; depth < 5 && typeof current === "object" && current !== null; depth++) {
|
|
7559
|
+
if ("code" in current && typeof current.code === "string" && SAFE_CODE.test(current.code))
|
|
7560
|
+
return current.code;
|
|
7561
|
+
if (!kind && current instanceof Error && current.name !== "Error" && /^[A-Za-z]+$/.test(current.name))
|
|
7562
|
+
kind = constantCase(current.name);
|
|
7563
|
+
current = "cause" in current ? current.cause : void 0;
|
|
7564
|
+
}
|
|
7565
|
+
return kind ?? "UNKNOWN";
|
|
7566
|
+
}
|
|
7567
|
+
function installFailure(result) {
|
|
7568
|
+
return result.install.status === "failed" ? { step: "install", error: result.install.error } : void 0;
|
|
7569
|
+
}
|
|
7570
|
+
function payloadFor(spec, failure2, kind = "generated") {
|
|
7417
7571
|
return {
|
|
7418
7572
|
version: scaffolderVersion(),
|
|
7419
7573
|
preset: kind !== "generated" ? kind : spec?.preset ?? "custom",
|
|
@@ -7423,7 +7577,9 @@ function payloadFor(spec, outcome, kind = "generated") {
|
|
|
7423
7577
|
packageManager: spec?.packageManager ?? "unknown",
|
|
7424
7578
|
node: process.versions.node.split(".")[0],
|
|
7425
7579
|
os: process.platform,
|
|
7426
|
-
outcome
|
|
7580
|
+
outcome: failure2 ? "failure" : "success",
|
|
7581
|
+
failedStep: failure2?.step ?? "none",
|
|
7582
|
+
errorCode: failure2 ? telemetryErrorCode(failure2.error) : "none"
|
|
7427
7583
|
};
|
|
7428
7584
|
}
|
|
7429
7585
|
function telemetryDisabledReason(options) {
|
|
@@ -7454,7 +7610,15 @@ function firstRunNotice(env = process.env) {
|
|
|
7454
7610
|
} catch {
|
|
7455
7611
|
return void 0;
|
|
7456
7612
|
}
|
|
7457
|
-
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}`;
|
|
7613
|
+
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}`;
|
|
7614
|
+
}
|
|
7615
|
+
var UA_PLATFORMS = {
|
|
7616
|
+
darwin: "Macintosh; Intel Mac OS X 10_15_7",
|
|
7617
|
+
linux: "X11; Linux x86_64",
|
|
7618
|
+
win32: "Windows NT 10.0; Win64; x64"
|
|
7619
|
+
};
|
|
7620
|
+
function telemetryUserAgent(payload) {
|
|
7621
|
+
return `Mozilla/5.0 (${UA_PLATFORMS[payload.os] ?? payload.os}) create-cogitator-app/${payload.version}`;
|
|
7458
7622
|
}
|
|
7459
7623
|
async function sendTelemetry(payload, options = {}) {
|
|
7460
7624
|
const website = options.websiteId ?? telemetryWebsiteId();
|
|
@@ -7474,7 +7638,7 @@ async function sendTelemetry(payload, options = {}) {
|
|
|
7474
7638
|
method: "POST",
|
|
7475
7639
|
headers: {
|
|
7476
7640
|
"content-type": "application/json",
|
|
7477
|
-
"user-agent":
|
|
7641
|
+
"user-agent": telemetryUserAgent(payload)
|
|
7478
7642
|
},
|
|
7479
7643
|
body: JSON.stringify(body),
|
|
7480
7644
|
signal: AbortSignal.timeout(options.timeoutMs ?? SEND_TIMEOUT_MS)
|
|
@@ -7493,6 +7657,7 @@ import pc2 from "picocolors";
|
|
|
7493
7657
|
// src/cli/args.ts
|
|
7494
7658
|
import { parseArgs } from "util";
|
|
7495
7659
|
var CliError = class extends Error {
|
|
7660
|
+
code = "INVALID_ARGS";
|
|
7496
7661
|
constructor(message) {
|
|
7497
7662
|
super(message);
|
|
7498
7663
|
this.name = "CliError";
|
|
@@ -8190,24 +8355,21 @@ async function run(argv, io = defaultIo, deps = {}) {
|
|
|
8190
8355
|
if (args.example !== void 0 || args.remote) {
|
|
8191
8356
|
const kind = args.example !== void 0 ? "example" : "template";
|
|
8192
8357
|
try {
|
|
8193
|
-
const
|
|
8194
|
-
if (
|
|
8195
|
-
await report(
|
|
8196
|
-
|
|
8197
|
-
deps,
|
|
8198
|
-
payloadFor(void 0, code2 === 0 ? "success" : "failure", kind)
|
|
8199
|
-
);
|
|
8200
|
-
return code2;
|
|
8358
|
+
const created = await runStarter(args, interactive, io, deps);
|
|
8359
|
+
if (created)
|
|
8360
|
+
await report(telemetry, deps, payloadFor(void 0, installFailure(created), kind));
|
|
8361
|
+
return 0;
|
|
8201
8362
|
} catch (error) {
|
|
8202
8363
|
if (error instanceof CancelledError) {
|
|
8203
8364
|
p2.cancel("Cancelled, nothing was created.");
|
|
8204
8365
|
return 1;
|
|
8205
8366
|
}
|
|
8206
|
-
await report(telemetry, deps, payloadFor(void 0, "
|
|
8367
|
+
await report(telemetry, deps, payloadFor(void 0, { step: "create", error }, kind));
|
|
8207
8368
|
return reportError(error, args.json, io);
|
|
8208
8369
|
}
|
|
8209
8370
|
}
|
|
8210
8371
|
let resolvedSpec;
|
|
8372
|
+
let reported = false;
|
|
8211
8373
|
try {
|
|
8212
8374
|
if (interactive) {
|
|
8213
8375
|
io.stderr(banner(version));
|
|
@@ -8241,11 +8403,8 @@ async function run(argv, io = defaultIo, deps = {}) {
|
|
|
8241
8403
|
git: args.git ?? true,
|
|
8242
8404
|
log: args.json ? void 0 : clackLogger()
|
|
8243
8405
|
});
|
|
8244
|
-
|
|
8245
|
-
|
|
8246
|
-
deps,
|
|
8247
|
-
payloadFor(result.plan.spec, result.install.status === "failed" ? "failure" : "success")
|
|
8248
|
-
);
|
|
8406
|
+
reported = true;
|
|
8407
|
+
await report(telemetry, deps, payloadFor(result.plan.spec, installFailure(result)));
|
|
8249
8408
|
const modelReady = result.plan.spec.provider === "ollama" ? await prepareOllama(result.plan, interactive) : true;
|
|
8250
8409
|
const key = envKey ? args.apiKey ?? process.env[envKey] : void 0;
|
|
8251
8410
|
const provider = result.plan.spec.provider;
|
|
@@ -8292,7 +8451,8 @@ async function run(argv, io = defaultIo, deps = {}) {
|
|
|
8292
8451
|
p2.cancel("Cancelled, nothing was created.");
|
|
8293
8452
|
return 1;
|
|
8294
8453
|
}
|
|
8295
|
-
if (resolvedSpec
|
|
8454
|
+
if (resolvedSpec && !reported)
|
|
8455
|
+
await report(telemetry, deps, payloadFor(resolvedSpec, { step: "create", error }));
|
|
8296
8456
|
return reportError(error, args.json, io);
|
|
8297
8457
|
}
|
|
8298
8458
|
}
|
|
@@ -8371,7 +8531,7 @@ async function runStarter(args, interactive, io, deps) {
|
|
|
8371
8531
|
].join("\n")
|
|
8372
8532
|
);
|
|
8373
8533
|
}
|
|
8374
|
-
return 0;
|
|
8534
|
+
return void 0;
|
|
8375
8535
|
}
|
|
8376
8536
|
result = await createFromExample(plan, options);
|
|
8377
8537
|
} else if (args.remote) {
|
|
@@ -8382,7 +8542,7 @@ async function runStarter(args, interactive, io, deps) {
|
|
|
8382
8542
|
` : `${pc2.bold("Dry run:")} nothing was written. ${message}.
|
|
8383
8543
|
`
|
|
8384
8544
|
);
|
|
8385
|
-
return 0;
|
|
8545
|
+
return void 0;
|
|
8386
8546
|
}
|
|
8387
8547
|
result = await createFromTemplate(args.remote, {
|
|
8388
8548
|
...options,
|
|
@@ -8410,13 +8570,13 @@ async function runStarter(args, interactive, io, deps) {
|
|
|
8410
8570
|
)}
|
|
8411
8571
|
`
|
|
8412
8572
|
);
|
|
8413
|
-
return
|
|
8573
|
+
return result;
|
|
8414
8574
|
}
|
|
8415
8575
|
for (const note of result.notes) p2.log.info(note);
|
|
8416
8576
|
if (interactive) p2.outro(starterOutro(result));
|
|
8417
8577
|
else io.stderr(`${starterOutro(result)}
|
|
8418
8578
|
`);
|
|
8419
|
-
return
|
|
8579
|
+
return result;
|
|
8420
8580
|
}
|
|
8421
8581
|
function reportError(error, json, io) {
|
|
8422
8582
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -8445,6 +8605,7 @@ export {
|
|
|
8445
8605
|
CHANNEL_CHOICES,
|
|
8446
8606
|
CODING_AGENTS,
|
|
8447
8607
|
CODING_AGENT_CHOICES,
|
|
8608
|
+
CodedError,
|
|
8448
8609
|
DEFAULT_OLLAMA_URL,
|
|
8449
8610
|
DEFAULT_PRESET,
|
|
8450
8611
|
DEPLOY_CHOICES,
|
|
@@ -8502,6 +8663,8 @@ export {
|
|
|
8502
8663
|
hasOllamaModel,
|
|
8503
8664
|
hashContent,
|
|
8504
8665
|
installCommand,
|
|
8666
|
+
installErrorCode,
|
|
8667
|
+
installFailure,
|
|
8505
8668
|
knownCogitatorVersions,
|
|
8506
8669
|
listOllamaModels,
|
|
8507
8670
|
modelChoices,
|
|
@@ -8528,6 +8691,7 @@ export {
|
|
|
8528
8691
|
sendTelemetry,
|
|
8529
8692
|
silentLogger,
|
|
8530
8693
|
telemetryDisabledReason,
|
|
8694
|
+
telemetryErrorCode,
|
|
8531
8695
|
telemetryWebsiteId,
|
|
8532
8696
|
templateArchive,
|
|
8533
8697
|
unifiedDiff,
|