create-cogitator-app 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.js +161 -60
- package/dist/index.js.map +1 -1
- package/dist/lib.d.ts +7 -2
- package/dist/lib.js +173 -70
- package/dist/lib.js.map +1 -1
- package/package.json +3 -3
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.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" }];
|
|
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.4", "@cogitator-ai/core": "^0.38.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", "OPENROUTER_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.4", "@cogitator-ai/core": "^0.38.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY", "OPENROUTER_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.38.0", "@cogitator-ai/self-modifying": "^19.4.4", 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", "OPENROUTER_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.38.0", "@cogitator-ai/neuro-symbolic": "^17.0.24", "@cogitator-ai/types": "^0.40.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY", "OPENROUTER_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.38.0", "@cogitator-ai/wasm-tools": "^0.7.18", 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", "OPENROUTER_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.14", "@cogitator-ai/core": "^0.38.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY", "OPENROUTER_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.14", "@cogitator-ai/core": "^0.38.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY", "OPENROUTER_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.14", "@cogitator-ai/core": "^0.38.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY", "OPENROUTER_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.14", "@cogitator-ai/core": "^0.38.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY", "OPENROUTER_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.10.0", "@cogitator-ai/core": "^0.38.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.10.0", "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.10.0", "@cogitator-ai/core": "^0.38.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: "channels/social-publisher", title: "Social publisher", entry: "channels/04-social-publisher.ts", files: ["channels/04-social-publisher.ts", "channels/cogitator.yml", "channels/webchat-client.html"], dependencies: { "@cogitator-ai/channels": "^0.10.0", "@cogitator-ai/types": "^0.40.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["BLUESKY_APP_PASSWORD", "BLUESKY_HANDLE", "PUBLISH", "THREADS_ACCESS_TOKEN"], runtime: "node" }, { name: "channels/social-bot", title: "Social bot", entry: "channels/05-social-bot.ts", files: ["channels/05-social-bot.ts", "channels/cogitator.yml", "channels/webchat-client.html"], dependencies: { "@cogitator-ai/channels": "^0.10.0", "@cogitator-ai/core": "^0.38.0", "@cogitator-ai/types": "^0.40.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["BLUESKY_APP_PASSWORD", "BLUESKY_HANDLE", "GOOGLE_API_KEY", "THREADS_ACCESS_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.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", "OPENROUTER_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.38.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY", "OPENROUTER_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.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", "OPENROUTER_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.38.0", "@cogitator-ai/types": "^0.40.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY", "OPENROUTER_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.38.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY", "OPENROUTER_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.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", "OPENROUTER_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.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", "OPENROUTER_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.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", "OPENROUTER_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.38.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY", "OPENROUTER_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.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", "OPENROUTER_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.38.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY", "OPENROUTER_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.38.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY", "OPENROUTER_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.38.0", "@cogitator-ai/models": "^18.4.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY", "OPENROUTER_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.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", "OPENROUTER_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.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", "OPENROUTER_API_KEY"], runtime: "node" }, { name: "core/decisions", title: "Decision models: typed answers with probabilities", entry: "core/16-decisions.ts", files: ["_shared/setup.ts", "core/16-decisions.ts"], dependencies: { "@cogitator-ai/core": "^0.38.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY", "OPENROUTER_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.38.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.38.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.38.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.38.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.38.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.38.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", "OPENROUTER_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.38.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", "OPENROUTER_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.38.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", "OPENROUTER_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.38.0", "@cogitator-ai/memory": "^0.12.4", 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", "OPENROUTER_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.38.0", "@cogitator-ai/memory": "^0.12.4", 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", "OPENROUTER_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.38.0", "@cogitator-ai/worker": "^0.9.4", 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", "OPENROUTER_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.38.0", "@cogitator-ai/deploy": "^0.6.3", 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", "OPENROUTER_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.38.0", "@cogitator-ai/sandbox": "^0.5.13", "@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", "OPENROUTER_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.38.0", "@cogitator-ai/express": "^0.8.4", 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", "OPENROUTER_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.38.0", "@cogitator-ai/fastify": "^0.7.4", 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", "OPENROUTER_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.38.0", "@cogitator-ai/hono": "^0.7.4", "@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", "OPENROUTER_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.38.0", "@cogitator-ai/koa": "^0.7.4", "@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", "OPENROUTER_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.38.0", "@cogitator-ai/next": "^0.8.4", 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.38.0", "@cogitator-ai/openai-compat": "^21.2.4", "@cogitator-ai/types": "^0.40.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", "OPENROUTER_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.38.0", "@cogitator-ai/types": "^0.40.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", "OPENROUTER_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.38.0", "@cogitator-ai/mcp": "^19.3.4", "@cogitator-ai/tetsu": "^0.5.4", "@cogitator-ai/types": "^0.40.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", "OPENROUTER_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.38.0", "@cogitator-ai/mcp": "^19.3.4", "@cogitator-ai/types": "^0.40.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY", "OPENROUTER_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.38.0", "@cogitator-ai/mcp": "^19.3.4", "@cogitator-ai/types": "^0.40.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", "OPENROUTER_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.38.0", "@cogitator-ai/mcp": "^19.3.4", "@cogitator-ai/types": "^0.40.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", "OPENROUTER_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.38.0", "@cogitator-ai/mcp": "^19.3.4", "@cogitator-ai/types": "^0.40.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", "OPENROUTER_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.38.0", "@cogitator-ai/memory": "^0.12.4", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY", "OPENROUTER_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.38.0", "@cogitator-ai/memory": "^0.12.4", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY", "OPENROUTER_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.38.0", "@cogitator-ai/memory": "^0.12.4", "@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", "OPENROUTER_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.38.0", "@cogitator-ai/memory": "^0.12.4", "@cogitator-ai/types": "^0.40.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY", "OPENROUTER_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.38.0", "@cogitator-ai/memory": "^0.12.4", "@cogitator-ai/rag": "^0.6.4", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY", "OPENROUTER_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.38.0", "@cogitator-ai/memory": "^0.12.4", "@cogitator-ai/rag": "^0.6.4", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY", "OPENROUTER_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.38.0", "@cogitator-ai/memory": "^0.12.4", "@cogitator-ai/rag": "^0.6.4", "@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", "OPENROUTER_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.38.0", "@cogitator-ai/swarms": "^0.12.4", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY", "OPENROUTER_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.38.0", "@cogitator-ai/swarms": "^0.12.4", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY", "OPENROUTER_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.38.0", "@cogitator-ai/swarms": "^0.12.4", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY", "OPENROUTER_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.38.0", "@cogitator-ai/swarms": "^0.12.4", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY", "OPENROUTER_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.38.0", "@cogitator-ai/voice": "^0.5.4", 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", "OPENROUTER_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.38.0", "@cogitator-ai/voice": "^0.5.4", 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", "OPENROUTER_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.38.0", "@cogitator-ai/voice": "^0.5.4", 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", "OPENROUTER_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.38.0", "@cogitator-ai/voice": "^0.5.4", 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", "OPENROUTER_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.38.0", "@cogitator-ai/workflows": "^0.12.4", 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", "OPENROUTER_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.38.0", "@cogitator-ai/workflows": "^0.12.4", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY", "OPENROUTER_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.38.0", "@cogitator-ai/workflows": "^0.12.4", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY", "OPENROUTER_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.4", "@cogitator-ai/ai-sdk": "0.6.0", "@cogitator-ai/browser": "0.4.14", "@cogitator-ai/channels": "0.10.0", "@cogitator-ai/cli": "0.7.0", "@cogitator-ai/config": "0.14.0", "@cogitator-ai/core": "0.38.0", "@cogitator-ai/deploy": "0.6.3", "@cogitator-ai/evals": "0.6.0", "@cogitator-ai/express": "0.8.4", "@cogitator-ai/fastify": "0.7.4", "@cogitator-ai/hono": "0.7.4", "@cogitator-ai/koa": "0.7.4", "@cogitator-ai/mcp": "19.3.4", "@cogitator-ai/memory": "0.12.4", "@cogitator-ai/models": "18.4.0", "@cogitator-ai/neuro-symbolic": "17.0.24", "@cogitator-ai/next": "0.8.4", "@cogitator-ai/openai-compat": "21.2.4", "@cogitator-ai/rag": "0.6.4", "@cogitator-ai/redis": "0.5.2", "@cogitator-ai/sandbox": "0.5.13", "@cogitator-ai/self-modifying": "19.4.4", "@cogitator-ai/server-shared": "0.5.4", "@cogitator-ai/studio": "0.1.4", "@cogitator-ai/swarms": "0.12.4", "@cogitator-ai/test-utils": "0.2.18", "@cogitator-ai/tetsu": "0.5.4", "@cogitator-ai/types": "0.40.0", "@cogitator-ai/voice": "0.5.4", "@cogitator-ai/wasm-tools": "0.7.18", "@cogitator-ai/worker": "0.9.4", "@cogitator-ai/workflows": "0.12.4" };
|
|
8
8
|
|
|
9
9
|
// src/cli/main.ts
|
|
10
10
|
import { relative as relative2 } from "path";
|
|
@@ -93,7 +93,7 @@ var FEATURES = [
|
|
|
93
93
|
var DEPLOY_TARGETS = ["none", "docker", "fly"];
|
|
94
94
|
var CODING_AGENTS = ["claude", "cursor", "codex"];
|
|
95
95
|
var PACKAGE_MANAGERS = ["pnpm", "npm", "yarn", "bun"];
|
|
96
|
-
var CHANNELS = ["telegram", "discord", "slack", "webchat"];
|
|
96
|
+
var CHANNELS = ["telegram", "discord", "slack", "webchat", "bluesky", "threads"];
|
|
97
97
|
var PACKAGE_NAME = /^[a-z0-9][a-z0-9._-]*$/;
|
|
98
98
|
var MAX_NAME_LENGTH = 214;
|
|
99
99
|
function validateProjectName(name) {
|
|
@@ -179,7 +179,7 @@ function compatibilityIssues(spec) {
|
|
|
179
179
|
if (spec.app === "channels" && spec.channels.length === 0) {
|
|
180
180
|
issues.push({
|
|
181
181
|
message: "A messaging bot needs at least one channel",
|
|
182
|
-
fix: "pass --channels webchat, telegram, discord or
|
|
182
|
+
fix: "pass --channels webchat, telegram, discord, slack, bluesky or threads"
|
|
183
183
|
});
|
|
184
184
|
}
|
|
185
185
|
if (spec.app !== "channels" && spec.channels.length > 0) {
|
|
@@ -417,6 +417,8 @@ async function pullOllamaModel(baseUrl, model, onStatus) {
|
|
|
417
417
|
}
|
|
418
418
|
|
|
419
419
|
// src/kit/package-manager.ts
|
|
420
|
+
import { existsSync } from "fs";
|
|
421
|
+
import { basename, dirname, join } from "path";
|
|
420
422
|
function detectPackageManager(userAgent = process.env.npm_config_user_agent) {
|
|
421
423
|
const name = userAgent?.split("/")[0];
|
|
422
424
|
return PACKAGE_MANAGERS.find((pm) => pm === name) ?? "pnpm";
|
|
@@ -436,6 +438,17 @@ function execCommand(pm, bin) {
|
|
|
436
438
|
if (pm === "bun") return `bunx ${bin}`;
|
|
437
439
|
return `${pm} exec ${bin}`;
|
|
438
440
|
}
|
|
441
|
+
function launchingPackageManager(pm, env) {
|
|
442
|
+
const execPath = env.npm_execpath;
|
|
443
|
+
if (!execPath || env.npm_config_user_agent?.split("/")[0] !== pm) return void 0;
|
|
444
|
+
const path = pm === "npm" && basename(execPath) === "npx-cli.js" ? join(dirname(execPath), "npm-cli.js") : execPath;
|
|
445
|
+
return existsSync(path) ? path : void 0;
|
|
446
|
+
}
|
|
447
|
+
function packageManagerInvocation(pm, args, env = process.env) {
|
|
448
|
+
const launcher = launchingPackageManager(pm, env);
|
|
449
|
+
if (!launcher) return { command: pm, args, fromPath: true };
|
|
450
|
+
return /\.[cm]?js$/.test(launcher) ? { command: process.execPath, args: [launcher, ...args], fromPath: false } : { command: launcher, args, fromPath: false };
|
|
451
|
+
}
|
|
439
452
|
function installCommand(pm) {
|
|
440
453
|
return `${pm} install`;
|
|
441
454
|
}
|
|
@@ -627,7 +640,7 @@ function yamlString(value) {
|
|
|
627
640
|
|
|
628
641
|
// src/kit/versions.ts
|
|
629
642
|
function scaffolderVersion() {
|
|
630
|
-
return false ? "0.0.0" : "0.
|
|
643
|
+
return false ? "0.0.0" : "0.7.0";
|
|
631
644
|
}
|
|
632
645
|
function workspaceVersions() {
|
|
633
646
|
return typeof define_COGITATOR_VERSIONS_default === "undefined" ? {} : define_COGITATOR_VERSIONS_default;
|
|
@@ -680,6 +693,7 @@ var VERSIONS = {
|
|
|
680
693
|
discord: "^14.27.0",
|
|
681
694
|
slackBolt: "^5.1.0",
|
|
682
695
|
ws: "^8.22.0",
|
|
696
|
+
atprotoApi: "^0.24.0",
|
|
683
697
|
langfuse: "^3.39.2",
|
|
684
698
|
modelContextProtocol: "^1.32.1"
|
|
685
699
|
};
|
|
@@ -739,7 +753,7 @@ function emitPackageJson(project, extras) {
|
|
|
739
753
|
};
|
|
740
754
|
project.file("package.json", JSON.stringify(pkg, null, 2) + "\n");
|
|
741
755
|
}
|
|
742
|
-
var SKIPPED_BUILDS = ["cpu-features", "protobufjs", "ssh2"];
|
|
756
|
+
var SKIPPED_BUILDS = ["better-sqlite3", "cpu-features", "protobufjs", "ssh2"];
|
|
743
757
|
function pnpmWorkspaceYaml(nativeBuilds) {
|
|
744
758
|
const allowed = new Set(nativeBuilds);
|
|
745
759
|
const entries = [
|
|
@@ -1691,7 +1705,7 @@ function emitAssistant(project) {
|
|
|
1691
1705
|
// src/kit/features/deploy.ts
|
|
1692
1706
|
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "fs";
|
|
1693
1707
|
import { tmpdir } from "os";
|
|
1694
|
-
import { dirname, join } from "path";
|
|
1708
|
+
import { dirname as dirname2, join as join2 } from "path";
|
|
1695
1709
|
import { ArtifactGenerator, ProjectAnalyzer } from "@cogitator-ai/deploy";
|
|
1696
1710
|
var ROOT_ARTIFACTS = {
|
|
1697
1711
|
Dockerfile: "Dockerfile",
|
|
@@ -1701,14 +1715,14 @@ var ROOT_ARTIFACTS = {
|
|
|
1701
1715
|
function emitDeployArtifacts(project) {
|
|
1702
1716
|
const { spec } = project;
|
|
1703
1717
|
if (spec.deploy === "none") return;
|
|
1704
|
-
const dir = mkdtempSync(
|
|
1718
|
+
const dir = mkdtempSync(join2(tmpdir(), "cogitator-deploy-plan-"));
|
|
1705
1719
|
try {
|
|
1706
1720
|
for (const file of project.files.values()) {
|
|
1707
|
-
const target =
|
|
1708
|
-
mkdirSync(
|
|
1721
|
+
const target = join2(dir, file.path);
|
|
1722
|
+
mkdirSync(dirname2(target), { recursive: true });
|
|
1709
1723
|
writeFileSync(target, file.content);
|
|
1710
1724
|
}
|
|
1711
|
-
writeFileSync(
|
|
1725
|
+
writeFileSync(join2(dir, LOCKFILES[spec.packageManager]), "");
|
|
1712
1726
|
const analysis = new ProjectAnalyzer().analyze(dir, { target: spec.deploy }, { env: {} });
|
|
1713
1727
|
const { files } = new ArtifactGenerator().generate(analysis.deployConfig, analysis);
|
|
1714
1728
|
for (const artifact of files) {
|
|
@@ -1977,6 +1991,7 @@ function startupStatements(project) {
|
|
|
1977
1991
|
|
|
1978
1992
|
// src/kit/features/app-channels.ts
|
|
1979
1993
|
var WEBCHAT_PORT = 18789;
|
|
1994
|
+
var TOKENS_PATH = ".cogitator/tokens.json";
|
|
1980
1995
|
var CHANNEL_SETUP = {
|
|
1981
1996
|
telegram: {
|
|
1982
1997
|
factory: "telegramChannel",
|
|
@@ -2027,6 +2042,48 @@ var CHANNEL_SETUP = {
|
|
|
2027
2042
|
expression: `webchatChannel({ port: Number(env.WEBCHAT_PORT ?? ${WEBCHAT_PORT}) })`,
|
|
2028
2043
|
packages: [["ws", VERSIONS.ws]],
|
|
2029
2044
|
env: []
|
|
2045
|
+
},
|
|
2046
|
+
bluesky: {
|
|
2047
|
+
factory: "blueskyChannel",
|
|
2048
|
+
imports: ["FileTokenStore"],
|
|
2049
|
+
expression: code`
|
|
2050
|
+
blueskyChannel({
|
|
2051
|
+
identifier: env.BLUESKY_HANDLE,
|
|
2052
|
+
appPassword: env.BLUESKY_APP_PASSWORD,
|
|
2053
|
+
store: new FileTokenStore({ path: '${TOKENS_PATH}' }),
|
|
2054
|
+
})
|
|
2055
|
+
`,
|
|
2056
|
+
packages: [["@atproto/api", VERSIONS.atprotoApi]],
|
|
2057
|
+
env: [
|
|
2058
|
+
{
|
|
2059
|
+
name: "BLUESKY_HANDLE",
|
|
2060
|
+
description: "Bluesky handle of the bot account, such as yourbot.bsky.social",
|
|
2061
|
+
required: true
|
|
2062
|
+
},
|
|
2063
|
+
{
|
|
2064
|
+
name: "BLUESKY_APP_PASSWORD",
|
|
2065
|
+
description: "Bluesky app password (Settings, Privacy and security, App passwords), with direct messages allowed",
|
|
2066
|
+
required: true
|
|
2067
|
+
}
|
|
2068
|
+
]
|
|
2069
|
+
},
|
|
2070
|
+
threads: {
|
|
2071
|
+
factory: "threadsChannel",
|
|
2072
|
+
imports: ["FileTokenStore"],
|
|
2073
|
+
expression: code`
|
|
2074
|
+
threadsChannel({
|
|
2075
|
+
accessToken: env.THREADS_ACCESS_TOKEN,
|
|
2076
|
+
store: new FileTokenStore({ path: '${TOKENS_PATH}' }),
|
|
2077
|
+
})
|
|
2078
|
+
`,
|
|
2079
|
+
packages: [],
|
|
2080
|
+
env: [
|
|
2081
|
+
{
|
|
2082
|
+
name: "THREADS_ACCESS_TOKEN",
|
|
2083
|
+
description: "Threads long-lived access token; it is renewed automatically and kept in .cogitator/tokens.json",
|
|
2084
|
+
required: true
|
|
2085
|
+
}
|
|
2086
|
+
]
|
|
2030
2087
|
}
|
|
2031
2088
|
};
|
|
2032
2089
|
var appChannelsFeature = {
|
|
@@ -2040,6 +2097,9 @@ var appChannelsFeature = {
|
|
|
2040
2097
|
for (const [name, version] of setup.packages) project.dependency(name, version);
|
|
2041
2098
|
for (const variable of setup.env) project.envVar({ ...variable, secret: true });
|
|
2042
2099
|
}
|
|
2100
|
+
if (spec.channels.some((channel) => CHANNEL_SETUP[channel].imports?.includes("FileTokenStore"))) {
|
|
2101
|
+
project.ignore(TOKENS_PATH);
|
|
2102
|
+
}
|
|
2043
2103
|
if (spec.channels.includes("webchat")) {
|
|
2044
2104
|
project.envVar({
|
|
2045
2105
|
name: "WEBCHAT_PORT",
|
|
@@ -2063,7 +2123,7 @@ var appChannelsFeature = {
|
|
|
2063
2123
|
project.file(
|
|
2064
2124
|
"src/gateway.ts",
|
|
2065
2125
|
code`
|
|
2066
|
-
import { Gateway, ${channels.
|
|
2126
|
+
import { Gateway, ${[...new Set(channels.flatMap((c) => [c.factory, ...c.imports ?? []]))].join(", ")} } from '@cogitator-ai/channels';
|
|
2067
2127
|
import { agents, cogitator } from './cogitator.js';
|
|
2068
2128
|
import { loadEnv } from './env.js';
|
|
2069
2129
|
${startupImports(project)}
|
|
@@ -5653,7 +5713,7 @@ var PRESETS = [
|
|
|
5653
5713
|
{
|
|
5654
5714
|
id: "channels",
|
|
5655
5715
|
label: "Messaging bot",
|
|
5656
|
-
hint: "one assistant on Telegram, Discord, Slack or
|
|
5716
|
+
hint: "one assistant on Telegram, Discord, Slack, WebChat, Bluesky or Threads",
|
|
5657
5717
|
spec: { app: "channels", channels: ["webchat"], memory: "sqlite", features: [] }
|
|
5658
5718
|
},
|
|
5659
5719
|
{
|
|
@@ -6025,9 +6085,9 @@ function planProject(input, options = {}) {
|
|
|
6025
6085
|
|
|
6026
6086
|
// src/kit/scaffold.ts
|
|
6027
6087
|
import { createHash } from "crypto";
|
|
6028
|
-
import { existsSync, readFileSync, readdirSync } from "fs";
|
|
6088
|
+
import { existsSync as existsSync2, readFileSync, readdirSync } from "fs";
|
|
6029
6089
|
import { chmod, mkdir, readFile, writeFile } from "fs/promises";
|
|
6030
|
-
import { dirname as
|
|
6090
|
+
import { dirname as dirname3, join as join3, resolve } from "path";
|
|
6031
6091
|
|
|
6032
6092
|
// src/kit/errors.ts
|
|
6033
6093
|
var CodedError = class extends Error {
|
|
@@ -6053,7 +6113,7 @@ function runCommand(command, args, options) {
|
|
|
6053
6113
|
cwd: options.cwd,
|
|
6054
6114
|
env: options.env ?? process.env,
|
|
6055
6115
|
stdio: options.inherit ? "inherit" : ["ignore", "pipe", "pipe"],
|
|
6056
|
-
shell: process.platform === "win32",
|
|
6116
|
+
shell: options.shell ?? process.platform === "win32",
|
|
6057
6117
|
timeout: options.timeoutMs
|
|
6058
6118
|
});
|
|
6059
6119
|
let output = "";
|
|
@@ -6090,8 +6150,8 @@ function failure(error) {
|
|
|
6090
6150
|
}
|
|
6091
6151
|
async function writeFiles(directory, files) {
|
|
6092
6152
|
for (const file of files) {
|
|
6093
|
-
const target =
|
|
6094
|
-
await mkdir(
|
|
6153
|
+
const target = join3(directory, file.path);
|
|
6154
|
+
await mkdir(dirname3(target), { recursive: true });
|
|
6095
6155
|
await writeFile(
|
|
6096
6156
|
target,
|
|
6097
6157
|
file.content,
|
|
@@ -6106,15 +6166,15 @@ async function saveLock(directory, files) {
|
|
|
6106
6166
|
generator: `create-cogitator-app@${scaffolderVersion()}`,
|
|
6107
6167
|
files: Object.fromEntries(Object.entries(files).sort(([a], [b]) => a.localeCompare(b)))
|
|
6108
6168
|
};
|
|
6109
|
-
await mkdir(
|
|
6110
|
-
await writeFile(
|
|
6169
|
+
await mkdir(join3(directory, dirname3(LOCK_PATH)), { recursive: true });
|
|
6170
|
+
await writeFile(join3(directory, LOCK_PATH), JSON.stringify(lock, null, 2) + "\n");
|
|
6111
6171
|
}
|
|
6112
6172
|
async function hashFiles(directory, paths) {
|
|
6113
6173
|
const hashes = /* @__PURE__ */ new Map();
|
|
6114
6174
|
for (const path of paths) {
|
|
6115
6175
|
if (UNTRACKED.has(path) || path === LOCK_PATH) continue;
|
|
6116
|
-
const full =
|
|
6117
|
-
hashes.set(path,
|
|
6176
|
+
const full = join3(directory, path);
|
|
6177
|
+
hashes.set(path, existsSync2(full) ? hashContent(await readFile(full, "utf-8")) : void 0);
|
|
6118
6178
|
}
|
|
6119
6179
|
return hashes;
|
|
6120
6180
|
}
|
|
@@ -6125,8 +6185,8 @@ async function writeLock(directory, paths) {
|
|
|
6125
6185
|
}
|
|
6126
6186
|
function biomeBinary(directory) {
|
|
6127
6187
|
const name = process.platform === "win32" ? "biome.cmd" : "biome";
|
|
6128
|
-
const path =
|
|
6129
|
-
return
|
|
6188
|
+
const path = join3(directory, "node_modules", ".bin", name);
|
|
6189
|
+
return existsSync2(path) ? path : void 0;
|
|
6130
6190
|
}
|
|
6131
6191
|
async function formatProject(directory, paths = ["."]) {
|
|
6132
6192
|
const biome = biomeBinary(directory);
|
|
@@ -6144,7 +6204,7 @@ ${tail(result.output)}`));
|
|
|
6144
6204
|
}
|
|
6145
6205
|
async function enclosingGitRepo(directory) {
|
|
6146
6206
|
let dir = resolve(directory);
|
|
6147
|
-
while (!
|
|
6207
|
+
while (!existsSync2(dir)) dir = dirname3(dir);
|
|
6148
6208
|
try {
|
|
6149
6209
|
const result = await runCommand("git", ["rev-parse", "--show-toplevel"], { cwd: dir });
|
|
6150
6210
|
return result.code === 0 ? result.output.trim() : void 0;
|
|
@@ -6153,11 +6213,11 @@ async function enclosingGitRepo(directory) {
|
|
|
6153
6213
|
}
|
|
6154
6214
|
}
|
|
6155
6215
|
function enclosingWorkspace(directory) {
|
|
6156
|
-
let dir =
|
|
6216
|
+
let dir = dirname3(resolve(directory));
|
|
6157
6217
|
for (; ; ) {
|
|
6158
|
-
if (
|
|
6159
|
-
const manifest =
|
|
6160
|
-
if (
|
|
6218
|
+
if (existsSync2(join3(dir, "pnpm-workspace.yaml"))) return dir;
|
|
6219
|
+
const manifest = join3(dir, "package.json");
|
|
6220
|
+
if (existsSync2(manifest)) {
|
|
6161
6221
|
try {
|
|
6162
6222
|
const parsed = JSON.parse(readFileSync(manifest, "utf-8"));
|
|
6163
6223
|
if (typeof parsed === "object" && parsed !== null && "workspaces" in parsed) return dir;
|
|
@@ -6165,7 +6225,7 @@ function enclosingWorkspace(directory) {
|
|
|
6165
6225
|
return void 0;
|
|
6166
6226
|
}
|
|
6167
6227
|
}
|
|
6168
|
-
const parent =
|
|
6228
|
+
const parent = dirname3(dir);
|
|
6169
6229
|
if (parent === dir) return void 0;
|
|
6170
6230
|
dir = parent;
|
|
6171
6231
|
}
|
|
@@ -6208,7 +6268,8 @@ ${tail(commit.output)}`));
|
|
|
6208
6268
|
return { status: "done" };
|
|
6209
6269
|
}
|
|
6210
6270
|
async function installDependencies(directory, pm, inherit) {
|
|
6211
|
-
|
|
6271
|
+
const invocation = packageManagerInvocation(pm, ["install"]);
|
|
6272
|
+
if (invocation.fromPath && !await hasCommand(pm, directory)) {
|
|
6212
6273
|
return failure(
|
|
6213
6274
|
new CodedError(
|
|
6214
6275
|
"PM_NOT_FOUND",
|
|
@@ -6217,7 +6278,11 @@ async function installDependencies(directory, pm, inherit) {
|
|
|
6217
6278
|
);
|
|
6218
6279
|
}
|
|
6219
6280
|
try {
|
|
6220
|
-
const result = await runCommand(
|
|
6281
|
+
const result = await runCommand(invocation.command, invocation.args, {
|
|
6282
|
+
cwd: directory,
|
|
6283
|
+
inherit,
|
|
6284
|
+
...!invocation.fromPath && { shell: false }
|
|
6285
|
+
});
|
|
6221
6286
|
if (result.code !== 0) {
|
|
6222
6287
|
return failure(
|
|
6223
6288
|
new CodedError(
|
|
@@ -6233,7 +6298,7 @@ ${tail(result.output)}`
|
|
|
6233
6298
|
}
|
|
6234
6299
|
}
|
|
6235
6300
|
function assertEmptyDirectory(directory) {
|
|
6236
|
-
if (
|
|
6301
|
+
if (existsSync2(directory) && readdirSync(directory).length > 0) {
|
|
6237
6302
|
throw new CodedError("DIRECTORY_NOT_EMPTY", `${directory} already exists and is not empty`);
|
|
6238
6303
|
}
|
|
6239
6304
|
}
|
|
@@ -6292,15 +6357,30 @@ async function scaffold(spec, options) {
|
|
|
6292
6357
|
}
|
|
6293
6358
|
|
|
6294
6359
|
// src/kit/telemetry.ts
|
|
6295
|
-
import { existsSync as
|
|
6360
|
+
import { existsSync as existsSync3, mkdirSync as mkdirSync2, writeFileSync as writeFileSync2 } from "fs";
|
|
6296
6361
|
import { homedir } from "os";
|
|
6297
|
-
import { join as
|
|
6362
|
+
import { join as join4 } from "path";
|
|
6363
|
+
import { z as z2 } from "zod";
|
|
6298
6364
|
var TELEMETRY_HOST = "https://analytics.el1fe.com";
|
|
6299
6365
|
var TELEMETRY_DOCS = "https://cogitator.app/docs/getting-started/telemetry";
|
|
6300
6366
|
var SEND_TIMEOUT_MS = 1500;
|
|
6301
6367
|
function telemetryWebsiteId() {
|
|
6302
6368
|
return false ? "" : "ef978a40-6d7f-4332-81ba-e6d86e9d4b38";
|
|
6303
6369
|
}
|
|
6370
|
+
var VALUE = z2.string().regex(/^[\w.,-]{0,100}$/);
|
|
6371
|
+
var PAYLOAD_SCHEMA = z2.strictObject({
|
|
6372
|
+
version: VALUE,
|
|
6373
|
+
preset: VALUE,
|
|
6374
|
+
provider: VALUE,
|
|
6375
|
+
memory: VALUE,
|
|
6376
|
+
features: VALUE,
|
|
6377
|
+
packageManager: VALUE,
|
|
6378
|
+
node: VALUE,
|
|
6379
|
+
os: VALUE,
|
|
6380
|
+
outcome: z2.enum(["success", "failure"]),
|
|
6381
|
+
failedStep: z2.enum(["none", "create", "install"]),
|
|
6382
|
+
errorCode: VALUE
|
|
6383
|
+
});
|
|
6304
6384
|
var SAFE_CODE = /^[A-Z][A-Z0-9_]{1,63}$/;
|
|
6305
6385
|
function telemetryErrorCode(error) {
|
|
6306
6386
|
let kind;
|
|
@@ -6347,12 +6427,12 @@ function telemetryDisabledReason(options) {
|
|
|
6347
6427
|
return void 0;
|
|
6348
6428
|
}
|
|
6349
6429
|
function configDir(env) {
|
|
6350
|
-
if (process.platform === "win32" && env.APPDATA) return
|
|
6351
|
-
return
|
|
6430
|
+
if (process.platform === "win32" && env.APPDATA) return join4(env.APPDATA, "cogitator");
|
|
6431
|
+
return join4(env.XDG_CONFIG_HOME || join4(homedir(), ".config"), "cogitator");
|
|
6352
6432
|
}
|
|
6353
6433
|
function firstRunNotice(env = process.env) {
|
|
6354
|
-
const marker =
|
|
6355
|
-
if (
|
|
6434
|
+
const marker = join4(configDir(env), "telemetry-notice");
|
|
6435
|
+
if (existsSync3(marker)) return void 0;
|
|
6356
6436
|
try {
|
|
6357
6437
|
mkdirSync2(configDir(env), { recursive: true });
|
|
6358
6438
|
writeFileSync2(marker, `${(/* @__PURE__ */ new Date()).toISOString()}
|
|
@@ -6373,14 +6453,17 @@ function telemetryUserAgent(payload) {
|
|
|
6373
6453
|
async function sendTelemetry(payload, options = {}) {
|
|
6374
6454
|
const website = options.websiteId ?? telemetryWebsiteId();
|
|
6375
6455
|
if (!website) return false;
|
|
6456
|
+
const parsed = PAYLOAD_SCHEMA.safeParse(payload);
|
|
6457
|
+
if (!parsed.success) return false;
|
|
6458
|
+
const data = parsed.data;
|
|
6376
6459
|
const body = {
|
|
6377
6460
|
type: "event",
|
|
6378
6461
|
payload: {
|
|
6379
6462
|
website,
|
|
6380
6463
|
hostname: "create-cogitator-app",
|
|
6381
|
-
url: `/scaffold/${
|
|
6464
|
+
url: `/scaffold/${data.preset}`,
|
|
6382
6465
|
name: "scaffold",
|
|
6383
|
-
data
|
|
6466
|
+
data
|
|
6384
6467
|
}
|
|
6385
6468
|
};
|
|
6386
6469
|
try {
|
|
@@ -6388,7 +6471,7 @@ async function sendTelemetry(payload, options = {}) {
|
|
|
6388
6471
|
method: "POST",
|
|
6389
6472
|
headers: {
|
|
6390
6473
|
"content-type": "application/json",
|
|
6391
|
-
"user-agent": telemetryUserAgent(
|
|
6474
|
+
"user-agent": telemetryUserAgent(data)
|
|
6392
6475
|
},
|
|
6393
6476
|
body: JSON.stringify(body),
|
|
6394
6477
|
signal: AbortSignal.timeout(options.timeoutMs ?? SEND_TIMEOUT_MS)
|
|
@@ -6484,6 +6567,18 @@ var KNOWN_ENV = {
|
|
|
6484
6567
|
OWNER_TG_ID: { description: "Your Telegram user id, the owner of the bot" },
|
|
6485
6568
|
WEBCHAT_TOKEN: { description: "Token WebChat clients authenticate with" },
|
|
6486
6569
|
WEBCHAT_PORT: { description: "Port of the WebChat server", example: "8080" },
|
|
6570
|
+
OPENROUTER_API_KEY: {
|
|
6571
|
+
description: "OpenRouter API key, for decision models and models of every provider (https://openrouter.ai/keys)"
|
|
6572
|
+
},
|
|
6573
|
+
BLUESKY_HANDLE: {
|
|
6574
|
+
description: "Bluesky handle of the bot account",
|
|
6575
|
+
example: "yourbot.bsky.social"
|
|
6576
|
+
},
|
|
6577
|
+
BLUESKY_APP_PASSWORD: {
|
|
6578
|
+
description: "Bluesky app password (Settings, Privacy and security, App passwords)"
|
|
6579
|
+
},
|
|
6580
|
+
THREADS_ACCESS_TOKEN: { description: "Threads long-lived access token, renewed automatically" },
|
|
6581
|
+
PUBLISH: { description: "Set to 1 to publish for real instead of a dry run", example: "0" },
|
|
6487
6582
|
DEEPGRAM_API_KEY: { description: "Deepgram API key for speech to text" },
|
|
6488
6583
|
ELEVENLABS_API_KEY: { description: "ElevenLabs API key for text to speech" }
|
|
6489
6584
|
};
|
|
@@ -6637,9 +6732,9 @@ async function fetchExampleFiles(plan, fetchImpl = fetch) {
|
|
|
6637
6732
|
}
|
|
6638
6733
|
|
|
6639
6734
|
// src/kit/remote.ts
|
|
6640
|
-
import { existsSync as
|
|
6735
|
+
import { existsSync as existsSync4, readFileSync as readFileSync2, readdirSync as readdirSync2, writeFileSync as writeFileSync3 } from "fs";
|
|
6641
6736
|
import { mkdir as mkdir2 } from "fs/promises";
|
|
6642
|
-
import { join as
|
|
6737
|
+
import { join as join5 } from "path";
|
|
6643
6738
|
import { Readable } from "stream";
|
|
6644
6739
|
import { pipeline } from "stream/promises";
|
|
6645
6740
|
import { x as extract } from "tar";
|
|
@@ -6726,9 +6821,9 @@ async function downloadTemplate(template, directory, options = {}) {
|
|
|
6726
6821
|
return { files: files.sort(), skipped: skipped.sort() };
|
|
6727
6822
|
}
|
|
6728
6823
|
function prepareTemplate(directory, options) {
|
|
6729
|
-
const lockfile = PACKAGE_MANAGERS.find((pm) =>
|
|
6730
|
-
const manifestPath =
|
|
6731
|
-
if (!
|
|
6824
|
+
const lockfile = PACKAGE_MANAGERS.find((pm) => existsSync4(join5(directory, LOCKFILES[pm])));
|
|
6825
|
+
const manifestPath = join5(directory, "package.json");
|
|
6826
|
+
if (!existsSync4(manifestPath)) {
|
|
6732
6827
|
throw new CodedError(
|
|
6733
6828
|
"TEMPLATE_NO_MANIFEST",
|
|
6734
6829
|
`The template has no package.json at its root (it has ${readdirSync2(directory).slice(0, 8).join(", ")}): point --template at the project directory`
|
|
@@ -6768,9 +6863,9 @@ function prepareTemplate(directory, options) {
|
|
|
6768
6863
|
}
|
|
6769
6864
|
|
|
6770
6865
|
// src/kit/starter.ts
|
|
6771
|
-
import { existsSync as
|
|
6866
|
+
import { existsSync as existsSync5, readFileSync as readFileSync3 } from "fs";
|
|
6772
6867
|
import { mkdir as mkdir3, readdir, rm } from "fs/promises";
|
|
6773
|
-
import { join as
|
|
6868
|
+
import { join as join6, relative, resolve as resolve2 } from "path";
|
|
6774
6869
|
async function finish2(directory, packageManager, options) {
|
|
6775
6870
|
const log2 = options.log ?? silentLogger;
|
|
6776
6871
|
let install = { status: "skipped", reason: "install was turned off" };
|
|
@@ -6841,7 +6936,7 @@ async function createFromTemplate(template, options) {
|
|
|
6841
6936
|
const log2 = options.log ?? silentLogger;
|
|
6842
6937
|
const directory = resolve2(options.directory);
|
|
6843
6938
|
assertEmptyDirectory(directory);
|
|
6844
|
-
const existed =
|
|
6939
|
+
const existed = existsSync5(directory);
|
|
6845
6940
|
log2.start(`Downloading ${describeTemplate(template)}`);
|
|
6846
6941
|
let downloaded;
|
|
6847
6942
|
let prepared;
|
|
@@ -6855,7 +6950,7 @@ async function createFromTemplate(template, options) {
|
|
|
6855
6950
|
log2.fail(`Could not use ${describeTemplate(template)}`);
|
|
6856
6951
|
if (existed) {
|
|
6857
6952
|
for (const entry of await readdir(directory)) {
|
|
6858
|
-
await rm(
|
|
6953
|
+
await rm(join6(directory, entry), { recursive: true, force: true });
|
|
6859
6954
|
}
|
|
6860
6955
|
} else {
|
|
6861
6956
|
await rm(directory, { recursive: true, force: true });
|
|
@@ -6874,7 +6969,7 @@ async function createFromTemplate(template, options) {
|
|
|
6874
6969
|
...downloaded.skipped.length > 0 ? [`Left out links and special files: ${downloaded.skipped.join(", ")}`] : []
|
|
6875
6970
|
];
|
|
6876
6971
|
const { install, git } = await finish2(directory, packageManager, options);
|
|
6877
|
-
const manifest = JSON.parse(readFileSync3(
|
|
6972
|
+
const manifest = JSON.parse(readFileSync3(join6(directory, "package.json"), "utf-8"));
|
|
6878
6973
|
return {
|
|
6879
6974
|
directory,
|
|
6880
6975
|
source: describeTemplate(template),
|
|
@@ -6887,7 +6982,7 @@ async function createFromTemplate(template, options) {
|
|
|
6887
6982
|
packageManager,
|
|
6888
6983
|
manifest.scripts ?? {},
|
|
6889
6984
|
install.status === "done",
|
|
6890
|
-
|
|
6985
|
+
existsSync5(join6(directory, ".env.example"))
|
|
6891
6986
|
),
|
|
6892
6987
|
notes
|
|
6893
6988
|
};
|
|
@@ -7080,7 +7175,11 @@ var APP_CHOICES = [
|
|
|
7080
7175
|
{ value: "script", label: "Script", hint: "an agent you run from the terminal" },
|
|
7081
7176
|
{ value: "server", label: "HTTP server", hint: "agents behind a REST, SSE and WebSocket API" },
|
|
7082
7177
|
{ value: "next", label: "Next.js app", hint: "a streaming chat UI with server-side agents" },
|
|
7083
|
-
{
|
|
7178
|
+
{
|
|
7179
|
+
value: "channels",
|
|
7180
|
+
label: "Messaging bot",
|
|
7181
|
+
hint: "Telegram, Discord, Slack, WebChat, Bluesky or Threads"
|
|
7182
|
+
},
|
|
7084
7183
|
{ value: "worker", label: "Queue worker", hint: "agents run as BullMQ jobs on Redis" }
|
|
7085
7184
|
];
|
|
7086
7185
|
var SERVER_CHOICES = [
|
|
@@ -7134,7 +7233,9 @@ var CHANNEL_CHOICES = [
|
|
|
7134
7233
|
{ value: "webchat", label: "WebChat", hint: "a local WebSocket chat, no setup" },
|
|
7135
7234
|
{ value: "telegram", label: "Telegram", hint: "needs a bot token from @BotFather" },
|
|
7136
7235
|
{ value: "discord", label: "Discord", hint: "needs a bot token" },
|
|
7137
|
-
{ value: "slack", label: "Slack", hint: "needs a bot token and signing secret" }
|
|
7236
|
+
{ value: "slack", label: "Slack", hint: "needs a bot token and signing secret" },
|
|
7237
|
+
{ value: "bluesky", label: "Bluesky", hint: "mentions, replies and DMs; needs an app password" },
|
|
7238
|
+
{ value: "threads", label: "Threads", hint: "replies and mentions; needs a long-lived token" }
|
|
7138
7239
|
];
|
|
7139
7240
|
var CODING_AGENT_CHOICES = [
|
|
7140
7241
|
{ value: "claude", label: "Claude Code", hint: ".mcp.json and a skill in .claude/skills" },
|
|
@@ -7229,9 +7330,9 @@ function exampleList() {
|
|
|
7229
7330
|
}
|
|
7230
7331
|
|
|
7231
7332
|
// src/cli/interactive.ts
|
|
7232
|
-
import { existsSync as
|
|
7333
|
+
import { existsSync as existsSync6 } from "fs";
|
|
7233
7334
|
import { homedir as homedir2 } from "os";
|
|
7234
|
-
import { join as
|
|
7335
|
+
import { join as join7 } from "path";
|
|
7235
7336
|
import * as p from "@clack/prompts";
|
|
7236
7337
|
|
|
7237
7338
|
// src/kit/models.ts
|
|
@@ -7323,10 +7424,10 @@ function modelChoices(provider) {
|
|
|
7323
7424
|
}
|
|
7324
7425
|
|
|
7325
7426
|
// src/cli/resolve.ts
|
|
7326
|
-
import { basename, resolve as resolve3 } from "path";
|
|
7427
|
+
import { basename as basename2, resolve as resolve3 } from "path";
|
|
7327
7428
|
var DEFAULT_DIRECTORY = "my-agents";
|
|
7328
7429
|
function projectNameFromDirectory(directory, cwd = process.cwd()) {
|
|
7329
|
-
return
|
|
7430
|
+
return basename2(resolve3(cwd, directory.trim()));
|
|
7330
7431
|
}
|
|
7331
7432
|
function resolveDirectory(directory, cwd = process.cwd()) {
|
|
7332
7433
|
const name = projectNameFromDirectory(directory, cwd);
|
|
@@ -7382,7 +7483,7 @@ function detectCodingAgents(home = homedir2()) {
|
|
|
7382
7483
|
codex: ".codex"
|
|
7383
7484
|
};
|
|
7384
7485
|
return CODING_AGENT_CHOICES.map((choice) => choice.value).filter(
|
|
7385
|
-
(agent) =>
|
|
7486
|
+
(agent) => existsSync6(join7(home, markers[agent]))
|
|
7386
7487
|
);
|
|
7387
7488
|
}
|
|
7388
7489
|
async function askDirectory() {
|