create-cogitator-app 0.6.0 → 0.6.1

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 CHANGED
@@ -4,7 +4,7 @@
4
4
  var define_COGITATOR_EXAMPLES_default = [{ name: "a2a/a2a-server", title: "A2A Server", entry: "a2a/01-a2a-server.ts", files: ["_shared/setup.ts", "a2a/01-a2a-server.ts"], dependencies: { "@cogitator-ai/a2a": "^0.8.3", "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5", express: "^5.2.1" }, devDependencies: { "@types/express": "^5.0.6", tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "a2a/a2a-client", title: "A2A Client", entry: "a2a/02-a2a-client.ts", files: ["_shared/setup.ts", "a2a/02-a2a-client.ts"], dependencies: { "@cogitator-ai/a2a": "^0.8.3", "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "advanced/self-modifying", title: "Self-Modifying Agent", entry: "advanced/01-self-modifying.ts", files: ["_shared/setup.ts", "advanced/01-self-modifying.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/self-modifying": "^19.4.3", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "advanced/neuro-symbolic", title: "Neuro-Symbolic Reasoning", entry: "advanced/02-neuro-symbolic.ts", files: ["_shared/setup.ts", "advanced/02-neuro-symbolic.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/neuro-symbolic": "^17.0.23", "@cogitator-ai/types": "^0.39.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "advanced/wasm-tools", title: "WASM-Sandboxed Tools", entry: "advanced/03-wasm-tools.ts", files: ["_shared/setup.ts", "advanced/03-wasm-tools.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/wasm-tools": "^0.7.17", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "browser/web-scraping", title: "Web Scraping with Browser Agent", entry: "browser/01-web-scraping.ts", files: ["_shared/setup.ts", "browser/01-web-scraping.ts"], dependencies: { "@cogitator-ai/browser": "^0.4.13", "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "browser/form-automation", title: "Form Automation with Browser Agent", entry: "browser/02-form-automation.ts", files: ["_shared/setup.ts", "browser/02-form-automation.ts"], dependencies: { "@cogitator-ai/browser": "^0.4.13", "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "browser/stealth-agent", title: "Stealth Browser Agent", entry: "browser/03-stealth-agent.ts", files: ["_shared/setup.ts", "browser/03-stealth-agent.ts"], dependencies: { "@cogitator-ai/browser": "^0.4.13", "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "browser/bitcoin-price-scraper", title: "Bitcoin Price Scraper (Binance)", entry: "browser/04-bitcoin-price-scraper.ts", files: ["_shared/setup.ts", "browser/04-bitcoin-price-scraper.ts"], dependencies: { "@cogitator-ai/browser": "^0.4.13", "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "channels/telegram-assistant", title: "Telegram assistant", entry: "channels/01-telegram-assistant.ts", files: ["channels/01-telegram-assistant.ts", "channels/cogitator.yml", "channels/webchat-client.html"], dependencies: { "@cogitator-ai/channels": "^0.9.3", "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5", grammy: "^1.46.0", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["GOOGLE_API_KEY", "OWNER_TG_ID", "TG_TOKEN"], runtime: "node" }, { name: "channels/super-assistant", title: "Super assistant", entry: "channels/02-super-assistant.ts", files: ["channels/02-super-assistant.ts", "channels/cogitator.yml", "channels/webchat-client.html"], dependencies: { "@cogitator-ai/channels": "^0.9.3", "better-sqlite3": "^13.0.3", dotenv: "^18.0.5", grammy: "^1.46.0" }, devDependencies: { tsx: "^4.23.15" }, env: ["OWNER_TG_ID", "TG_TOKEN"], runtime: "node" }, { name: "channels/webchat-bot", title: "Webchat bot", entry: "channels/03-webchat-bot.ts", files: ["channels/03-webchat-bot.ts", "channels/cogitator.yml", "channels/webchat-client.html"], dependencies: { "@cogitator-ai/channels": "^0.9.3", "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5", ws: "^8.22.0", zod: "^4.6.5" }, devDependencies: { "@types/ws": "^8.18.2", tsx: "^4.23.15" }, env: ["GOOGLE_API_KEY", "WEBCHAT_PORT", "WEBCHAT_TOKEN"], runtime: "node" }, { name: "core/basic-agent", title: "Basic Agent with Custom Tools", entry: "core/01-basic-agent.ts", files: ["_shared/setup.ts", "core/01-basic-agent.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/built-in-tools", title: "Built-in Tools", entry: "core/02-built-in-tools.ts", files: ["_shared/setup.ts", "core/02-built-in-tools.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/tool-caching", title: "Tool Caching with withCache", entry: "core/03-tool-caching.ts", files: ["_shared/setup.ts", "core/03-tool-caching.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/context-manager", title: "Context Manager", entry: "core/04-context-manager.ts", files: ["_shared/setup.ts", "core/04-context-manager.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/types": "^0.39.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/tree-of-thought", title: "Tree of Thought", entry: "core/05-tree-of-thought.ts", files: ["_shared/setup.ts", "core/05-tree-of-thought.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/reflection", title: "Reflection", entry: "core/06-reflection.ts", files: ["_shared/setup.ts", "core/06-reflection.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/agent-optimizer", title: "Agent Optimizer", entry: "core/07-agent-optimizer.ts", files: ["_shared/setup.ts", "core/07-agent-optimizer.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/time-travel", title: "Time Travel", entry: "core/08-time-travel.ts", files: ["_shared/setup.ts", "core/08-time-travel.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/cost-routing", title: "Cost-Aware Routing", entry: "core/09-cost-routing.ts", files: ["_shared/setup.ts", "core/09-cost-routing.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/constitutional-ai", title: "Constitutional AI", entry: "core/10-constitutional-ai.ts", files: ["_shared/setup.ts", "core/10-constitutional-ai.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/prompt-injection", title: "Prompt Injection Detection", entry: "core/11-prompt-injection.ts", files: ["_shared/setup.ts", "core/11-prompt-injection.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/causal-reasoning", title: "Causal Reasoning", entry: "core/12-causal-reasoning.ts", files: ["_shared/setup.ts", "core/12-causal-reasoning.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/model-registry", title: "Model Registry", entry: "core/13-model-registry.ts", files: ["_shared/setup.ts", "core/13-model-registry.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/models": "^18.3.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/approvals", title: "Approvals: pause before a sensitive tool, resume later", entry: "core/14-approvals.ts", files: ["_shared/setup.ts", "core/14-approvals.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/handoffs", title: "Handoffs: a triage agent passes the conversation on", entry: "core/15-handoffs.ts", files: ["_shared/setup.ts", "core/15-handoffs.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "device-tools/screenshot", title: "Screenshot", entry: "device-tools/01-screenshot.ts", files: ["device-tools/01-screenshot.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: [], runtime: "node" }, { name: "device-tools/clipboard", title: "Clipboard", entry: "device-tools/02-clipboard.ts", files: ["device-tools/02-clipboard.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: [], runtime: "node" }, { name: "device-tools/notify", title: "Notify", entry: "device-tools/03-notify.ts", files: ["device-tools/03-notify.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: [], runtime: "node" }, { name: "device-tools/open-url", title: "Open url", entry: "device-tools/04-open-url.ts", files: ["device-tools/04-open-url.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: [], runtime: "node" }, { name: "device-tools/shell-exec", title: "Shell exec", entry: "device-tools/05-shell-exec.ts", files: ["device-tools/05-shell-exec.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: [], runtime: "node" }, { name: "evals/basic-eval", title: "Basic Evaluation", entry: "evals/01-basic-eval.ts", files: ["_shared/setup.ts", "evals/01-basic-eval.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/evals": "^0.6.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "evals/llm-judge", title: "LLM-as-Judge Evaluation", entry: "evals/02-llm-judge.ts", files: ["_shared/setup.ts", "evals/02-llm-judge.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/evals": "^0.6.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "evals/ab-comparison", title: "A/B Comparison", entry: "evals/03-ab-comparison.ts", files: ["_shared/setup.ts", "evals/03-ab-comparison.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/evals": "^0.6.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "infrastructure/redis-memory", title: "Redis Memory: Persistent Conversations", entry: "infrastructure/01-redis-memory.ts", files: ["_shared/setup.ts", "infrastructure/01-redis-memory.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/memory": "^0.12.3", dotenv: "^18.0.5", ioredis: "^5.0.0 || ^6.0.0" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY", "REDIS_URL"], runtime: "node" }, { name: "infrastructure/postgres-memory", title: "PostgreSQL Memory: Long-Term Persistence", entry: "infrastructure/02-postgres-memory.ts", files: ["_shared/setup.ts", "infrastructure/02-postgres-memory.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/memory": "^0.12.3", dotenv: "^18.0.5", pg: "^8.23.1" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "DATABASE_URL", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "infrastructure/worker-queue", title: "Worker Queue: Distributed Agent Execution", entry: "infrastructure/03-worker-queue.ts", files: ["_shared/setup.ts", "infrastructure/03-worker-queue.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/worker": "^0.9.3", dotenv: "^18.0.5", ioredis: "^5.0.0 || ^6.0.0" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY", "REDIS_URL"], runtime: "node" }, { name: "infrastructure/deploy-docker", title: "Deploy: Docker Deployment Planning", entry: "infrastructure/04-deploy-docker.ts", files: ["_shared/setup.ts", "infrastructure/04-deploy-docker.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/deploy": "^0.6.2", dotenv: "^18.0.5", pg: "^8.23.1" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "infrastructure/sandbox-execution", title: "Sandbox Execution: Docker, WASM & Native", entry: "infrastructure/05-sandbox-execution.ts", files: ["_shared/setup.ts", "infrastructure/05-sandbox-execution.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/sandbox": "^0.5.12", "@extism/extism": "^2.0.0-rc13", dockerode: "^4.0.0 || ^5.0.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "integrations/express-server", title: "Express Server Integration", entry: "integrations/01-express-server.ts", files: ["_shared/arithmetic.ts", "_shared/setup.ts", "integrations/01-express-server.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/express": "^0.8.3", dotenv: "^18.0.5", express: "^5.2.1", zod: "^4.6.5" }, devDependencies: { "@types/express": "^5.0.6", tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "integrations/fastify-server", title: "Fastify Server Integration", entry: "integrations/02-fastify-server.ts", files: ["_shared/arithmetic.ts", "_shared/setup.ts", "integrations/02-fastify-server.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/fastify": "^0.7.3", dotenv: "^18.0.5", fastify: "^5.12.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "integrations/hono-server", title: "Hono Server Integration", entry: "integrations/03-hono-server.ts", files: ["_shared/setup.ts", "integrations/03-hono-server.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/hono": "^0.7.3", "@hono/node-server": "^2.1.3", dotenv: "^18.0.5", hono: "^4.13.12" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "integrations/koa-server", title: "Koa Server Integration", entry: "integrations/04-koa-server.ts", files: ["_shared/setup.ts", "integrations/04-koa-server.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/koa": "^0.7.3", "@koa/router": "^15.7.0", dotenv: "^18.0.5", koa: "^3.2.1" }, devDependencies: { "@types/koa": "^3.0.3", tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "integrations/nextjs-handler", title: "Nextjs handler", entry: "integrations/05-nextjs-handler.ts", files: ["integrations/05-nextjs-handler.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/next": "^0.8.3", next: "^14.0.0 || ^15.0.0 || ^16.0.0", react: "^18.2.0 || ^19.0.0", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["GOOGLE_API_KEY"], runtime: "node" }, { name: "integrations/openai-compat", title: "OpenAI-Compatible Server", entry: "integrations/06-openai-compat.ts", files: ["_shared/setup.ts", "integrations/06-openai-compat.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/openai-compat": "^21.2.3", "@cogitator-ai/types": "^0.39.0", dotenv: "^18.0.5", openai: "^7.25.0", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "integrations/ai-sdk-adapter", title: "Vercel AI SDK Adapter", entry: "integrations/07-ai-sdk-adapter.ts", files: ["_shared/setup.ts", "integrations/07-ai-sdk-adapter.ts"], dependencies: { "@cogitator-ai/ai-sdk": "^0.6.0", "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/types": "^0.39.0", ai: "^7.0.127", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "integrations/tetsu-server", title: "Tetsu Server on Bun: an app with its own MCP server and agent", entry: "integrations/08-tetsu-server.ts", files: ["_shared/setup.ts", "integrations/08-tetsu-server.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/mcp": "^19.3.3", "@cogitator-ai/tetsu": "^0.5.3", "@cogitator-ai/types": "^0.39.0", "@tetsujs/core": "^0.6.1", "@tetsujs/openapi": "^0.6.1", "@tetsujs/sse": "^0.6.1", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "bun" }, { name: "mcp/mcp-client", title: "MCP Client: Filesystem Server", entry: "mcp/01-mcp-client.ts", files: ["_shared/setup.ts", "mcp/01-mcp-client.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/mcp": "^19.3.3", "@cogitator-ai/types": "^0.39.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "mcp/mcp-server", title: "MCP Server: Expose Cogitator Tools over HTTP", entry: "mcp/02-mcp-server.ts", files: ["_shared/setup.ts", "mcp/02-mcp-server.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/mcp": "^19.3.3", "@cogitator-ai/types": "^0.39.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "mcp/per-user-mcp", title: "An Agent on Your Own MCP Server, per User", entry: "mcp/03-per-user-mcp.ts", files: ["_shared/setup.ts", "mcp/03-per-user-mcp.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/mcp": "^19.3.3", "@cogitator-ai/types": "^0.39.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "mcp/agent-as-mcp-server", title: "A Cogitator Agent as an MCP Server", entry: "mcp/04-agent-as-mcp-server.ts", files: ["_shared/setup.ts", "mcp/04-agent-as-mcp-server.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/mcp": "^19.3.3", "@cogitator-ai/types": "^0.39.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "memory/basic-memory", title: "Basic Memory: Threads & Multi-Turn Conversations", entry: "memory/01-basic-memory.ts", files: ["_shared/setup.ts", "memory/01-basic-memory.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/memory": "^0.12.3", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "memory/context-builder", title: "Context Builder: Token-Aware Context Windows", entry: "memory/02-context-builder.ts", files: ["_shared/setup.ts", "memory/02-context-builder.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/memory": "^0.12.3", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "memory/semantic-search", title: "Semantic Search: Hybrid BM25 + Vector Search", entry: "memory/03-semantic-search.ts", files: ["_shared/setup.ts", "memory/03-semantic-search.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/memory": "^0.12.3", "@qdrant/js-client-rest": "^1.10.0", dotenv: "^18.0.5", pg: "^8.23.1" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "memory/knowledge-graph", title: "Knowledge Graph: Entity Extraction & Graph Traversal", entry: "memory/04-knowledge-graph.ts", files: ["_shared/setup.ts", "memory/04-knowledge-graph.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/memory": "^0.12.3", "@cogitator-ai/types": "^0.39.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "rag/basic-retrieval", title: "Basic RAG Retrieval", entry: "rag/01-basic-retrieval.ts", files: ["_shared/setup.ts", "rag/01-basic-retrieval.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/memory": "^0.12.3", "@cogitator-ai/rag": "^0.6.3", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "rag/chunking-strategies", title: "Chunking Strategies Comparison", entry: "rag/02-chunking-strategies.ts", files: ["_shared/setup.ts", "rag/02-chunking-strategies.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/memory": "^0.12.3", "@cogitator-ai/rag": "^0.6.3", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "rag/agent-with-rag", title: "Agent with RAG Tools", entry: "rag/03-agent-with-rag.ts", files: ["_shared/setup.ts", "rag/03-agent-with-rag.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/memory": "^0.12.3", "@cogitator-ai/rag": "^0.6.3", "@qdrant/js-client-rest": "^1.10.0", "better-sqlite3": "^13.0.3", dotenv: "^18.0.5", ioredis: "^5.0.0 || ^6.0.0", mongodb: "^6.0.0 || ^7.0.0", pg: "^8.23.1" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "swarms/debate-swarm", title: "Debate Swarm", entry: "swarms/01-debate-swarm.ts", files: ["_shared/setup.ts", "swarms/01-debate-swarm.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/swarms": "^0.12.3", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "swarms/pipeline-swarm", title: "Pipeline Swarm", entry: "swarms/02-pipeline-swarm.ts", files: ["_shared/setup.ts", "swarms/02-pipeline-swarm.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/swarms": "^0.12.3", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "swarms/hierarchical-swarm", title: "Hierarchical Swarm", entry: "swarms/03-hierarchical-swarm.ts", files: ["_shared/setup.ts", "swarms/03-hierarchical-swarm.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/swarms": "^0.12.3", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "swarms/negotiation-swarm", title: "Negotiation Swarm", entry: "swarms/04-negotiation-swarm.ts", files: ["_shared/setup.ts", "swarms/04-negotiation-swarm.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/swarms": "^0.12.3", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "voice/pipeline", title: "Voice Pipeline", entry: "voice/01-pipeline.ts", files: ["_shared/setup.ts", "voice/01-pipeline.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/voice": "^0.5.3", dotenv: "^18.0.5", openai: "^7.25.0" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "voice/realtime", title: "Realtime Voice Session", entry: "voice/02-realtime.ts", files: ["_shared/setup.ts", "voice/02-realtime.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/voice": "^0.5.3", dotenv: "^18.0.5", openai: "^7.25.0" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "voice/voice-agent", title: "Voice Agent (WebSocket Server)", entry: "voice/03-voice-agent.ts", files: ["_shared/setup.ts", "voice/03-voice-agent.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/voice": "^0.5.3", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "DEEPGRAM_API_KEY", "ELEVENLABS_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "voice/realtime-voice-agent", title: "Realtime Voice Agent (Gemini Live over WebSocket)", entry: "voice/04-realtime-voice-agent.ts", files: ["_shared/setup.ts", "voice/04-realtime-voice-agent.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/voice": "^0.5.3", dotenv: "^18.0.5", ws: "^8.22.0" }, devDependencies: { "@types/ws": "^8.18.2", tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "workflows/basic-workflow", title: "Basic Workflow: Code Review Pipeline", entry: "workflows/01-basic-workflow.ts", files: ["_shared/setup.ts", "workflows/01-basic-workflow.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/workflows": "^0.12.3", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "workflows/human-in-loop", title: "Human-in-the-Loop: Content Publishing Workflow", entry: "workflows/02-human-in-loop.ts", files: ["_shared/setup.ts", "workflows/02-human-in-loop.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/workflows": "^0.12.3", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "workflows/map-reduce", title: "Map-Reduce: Parallel Document Analysis", entry: "workflows/03-map-reduce.ts", files: ["_shared/setup.ts", "workflows/03-map-reduce.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/workflows": "^0.12.3", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }];
5
5
 
6
6
  // <define:__COGITATOR_VERSIONS__>
7
- var define_COGITATOR_VERSIONS_default = { "@cogitator-ai/a2a": "0.8.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" };
7
+ var define_COGITATOR_VERSIONS_default = { "@cogitator-ai/a2a": "0.8.3", "@cogitator-ai/ai-sdk": "0.6.0", "@cogitator-ai/browser": "0.4.13", "@cogitator-ai/channels": "0.9.3", "@cogitator-ai/cli": "0.6.4", "@cogitator-ai/config": "0.13.0", "@cogitator-ai/core": "0.37.0", "@cogitator-ai/deploy": "0.6.2", "@cogitator-ai/evals": "0.6.0", "@cogitator-ai/express": "0.8.3", "@cogitator-ai/fastify": "0.7.3", "@cogitator-ai/hono": "0.7.3", "@cogitator-ai/koa": "0.7.3", "@cogitator-ai/mcp": "19.3.3", "@cogitator-ai/memory": "0.12.3", "@cogitator-ai/models": "18.3.0", "@cogitator-ai/neuro-symbolic": "17.0.23", "@cogitator-ai/next": "0.8.3", "@cogitator-ai/openai-compat": "21.2.3", "@cogitator-ai/rag": "0.6.3", "@cogitator-ai/redis": "0.5.2", "@cogitator-ai/sandbox": "0.5.12", "@cogitator-ai/self-modifying": "19.4.3", "@cogitator-ai/server-shared": "0.5.3", "@cogitator-ai/studio": "0.1.2", "@cogitator-ai/swarms": "0.12.3", "@cogitator-ai/test-utils": "0.2.17", "@cogitator-ai/tetsu": "0.5.3", "@cogitator-ai/types": "0.39.0", "@cogitator-ai/voice": "0.5.3", "@cogitator-ai/wasm-tools": "0.7.17", "@cogitator-ai/worker": "0.9.3", "@cogitator-ai/workflows": "0.12.3" };
8
8
 
9
9
  // src/cli/main.ts
10
10
  import { relative as relative2 } from "path";
@@ -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.6.0";
643
+ return false ? "0.0.0" : "0.6.1";
631
644
  }
632
645
  function workspaceVersions() {
633
646
  return typeof define_COGITATOR_VERSIONS_default === "undefined" ? {} : define_COGITATOR_VERSIONS_default;
@@ -739,7 +752,7 @@ function emitPackageJson(project, extras) {
739
752
  };
740
753
  project.file("package.json", JSON.stringify(pkg, null, 2) + "\n");
741
754
  }
742
- var SKIPPED_BUILDS = ["cpu-features", "protobufjs", "ssh2"];
755
+ var SKIPPED_BUILDS = ["better-sqlite3", "cpu-features", "protobufjs", "ssh2"];
743
756
  function pnpmWorkspaceYaml(nativeBuilds) {
744
757
  const allowed = new Set(nativeBuilds);
745
758
  const entries = [
@@ -1691,7 +1704,7 @@ function emitAssistant(project) {
1691
1704
  // src/kit/features/deploy.ts
1692
1705
  import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "fs";
1693
1706
  import { tmpdir } from "os";
1694
- import { dirname, join } from "path";
1707
+ import { dirname as dirname2, join as join2 } from "path";
1695
1708
  import { ArtifactGenerator, ProjectAnalyzer } from "@cogitator-ai/deploy";
1696
1709
  var ROOT_ARTIFACTS = {
1697
1710
  Dockerfile: "Dockerfile",
@@ -1701,14 +1714,14 @@ var ROOT_ARTIFACTS = {
1701
1714
  function emitDeployArtifacts(project) {
1702
1715
  const { spec } = project;
1703
1716
  if (spec.deploy === "none") return;
1704
- const dir = mkdtempSync(join(tmpdir(), "cogitator-deploy-plan-"));
1717
+ const dir = mkdtempSync(join2(tmpdir(), "cogitator-deploy-plan-"));
1705
1718
  try {
1706
1719
  for (const file of project.files.values()) {
1707
- const target = join(dir, file.path);
1708
- mkdirSync(dirname(target), { recursive: true });
1720
+ const target = join2(dir, file.path);
1721
+ mkdirSync(dirname2(target), { recursive: true });
1709
1722
  writeFileSync(target, file.content);
1710
1723
  }
1711
- writeFileSync(join(dir, LOCKFILES[spec.packageManager]), "");
1724
+ writeFileSync(join2(dir, LOCKFILES[spec.packageManager]), "");
1712
1725
  const analysis = new ProjectAnalyzer().analyze(dir, { target: spec.deploy }, { env: {} });
1713
1726
  const { files } = new ArtifactGenerator().generate(analysis.deployConfig, analysis);
1714
1727
  for (const artifact of files) {
@@ -6025,9 +6038,9 @@ function planProject(input, options = {}) {
6025
6038
 
6026
6039
  // src/kit/scaffold.ts
6027
6040
  import { createHash } from "crypto";
6028
- import { existsSync, readFileSync, readdirSync } from "fs";
6041
+ import { existsSync as existsSync2, readFileSync, readdirSync } from "fs";
6029
6042
  import { chmod, mkdir, readFile, writeFile } from "fs/promises";
6030
- import { dirname as dirname2, join as join2, resolve } from "path";
6043
+ import { dirname as dirname3, join as join3, resolve } from "path";
6031
6044
 
6032
6045
  // src/kit/errors.ts
6033
6046
  var CodedError = class extends Error {
@@ -6053,7 +6066,7 @@ function runCommand(command, args, options) {
6053
6066
  cwd: options.cwd,
6054
6067
  env: options.env ?? process.env,
6055
6068
  stdio: options.inherit ? "inherit" : ["ignore", "pipe", "pipe"],
6056
- shell: process.platform === "win32",
6069
+ shell: options.shell ?? process.platform === "win32",
6057
6070
  timeout: options.timeoutMs
6058
6071
  });
6059
6072
  let output = "";
@@ -6090,8 +6103,8 @@ function failure(error) {
6090
6103
  }
6091
6104
  async function writeFiles(directory, files) {
6092
6105
  for (const file of files) {
6093
- const target = join2(directory, file.path);
6094
- await mkdir(dirname2(target), { recursive: true });
6106
+ const target = join3(directory, file.path);
6107
+ await mkdir(dirname3(target), { recursive: true });
6095
6108
  await writeFile(
6096
6109
  target,
6097
6110
  file.content,
@@ -6106,15 +6119,15 @@ async function saveLock(directory, files) {
6106
6119
  generator: `create-cogitator-app@${scaffolderVersion()}`,
6107
6120
  files: Object.fromEntries(Object.entries(files).sort(([a], [b]) => a.localeCompare(b)))
6108
6121
  };
6109
- await mkdir(join2(directory, dirname2(LOCK_PATH)), { recursive: true });
6110
- await writeFile(join2(directory, LOCK_PATH), JSON.stringify(lock, null, 2) + "\n");
6122
+ await mkdir(join3(directory, dirname3(LOCK_PATH)), { recursive: true });
6123
+ await writeFile(join3(directory, LOCK_PATH), JSON.stringify(lock, null, 2) + "\n");
6111
6124
  }
6112
6125
  async function hashFiles(directory, paths) {
6113
6126
  const hashes = /* @__PURE__ */ new Map();
6114
6127
  for (const path of paths) {
6115
6128
  if (UNTRACKED.has(path) || path === LOCK_PATH) continue;
6116
- const full = join2(directory, path);
6117
- hashes.set(path, existsSync(full) ? hashContent(await readFile(full, "utf-8")) : void 0);
6129
+ const full = join3(directory, path);
6130
+ hashes.set(path, existsSync2(full) ? hashContent(await readFile(full, "utf-8")) : void 0);
6118
6131
  }
6119
6132
  return hashes;
6120
6133
  }
@@ -6125,8 +6138,8 @@ async function writeLock(directory, paths) {
6125
6138
  }
6126
6139
  function biomeBinary(directory) {
6127
6140
  const name = process.platform === "win32" ? "biome.cmd" : "biome";
6128
- const path = join2(directory, "node_modules", ".bin", name);
6129
- return existsSync(path) ? path : void 0;
6141
+ const path = join3(directory, "node_modules", ".bin", name);
6142
+ return existsSync2(path) ? path : void 0;
6130
6143
  }
6131
6144
  async function formatProject(directory, paths = ["."]) {
6132
6145
  const biome = biomeBinary(directory);
@@ -6144,7 +6157,7 @@ ${tail(result.output)}`));
6144
6157
  }
6145
6158
  async function enclosingGitRepo(directory) {
6146
6159
  let dir = resolve(directory);
6147
- while (!existsSync(dir)) dir = dirname2(dir);
6160
+ while (!existsSync2(dir)) dir = dirname3(dir);
6148
6161
  try {
6149
6162
  const result = await runCommand("git", ["rev-parse", "--show-toplevel"], { cwd: dir });
6150
6163
  return result.code === 0 ? result.output.trim() : void 0;
@@ -6153,11 +6166,11 @@ async function enclosingGitRepo(directory) {
6153
6166
  }
6154
6167
  }
6155
6168
  function enclosingWorkspace(directory) {
6156
- let dir = dirname2(resolve(directory));
6169
+ let dir = dirname3(resolve(directory));
6157
6170
  for (; ; ) {
6158
- if (existsSync(join2(dir, "pnpm-workspace.yaml"))) return dir;
6159
- const manifest = join2(dir, "package.json");
6160
- if (existsSync(manifest)) {
6171
+ if (existsSync2(join3(dir, "pnpm-workspace.yaml"))) return dir;
6172
+ const manifest = join3(dir, "package.json");
6173
+ if (existsSync2(manifest)) {
6161
6174
  try {
6162
6175
  const parsed = JSON.parse(readFileSync(manifest, "utf-8"));
6163
6176
  if (typeof parsed === "object" && parsed !== null && "workspaces" in parsed) return dir;
@@ -6165,7 +6178,7 @@ function enclosingWorkspace(directory) {
6165
6178
  return void 0;
6166
6179
  }
6167
6180
  }
6168
- const parent = dirname2(dir);
6181
+ const parent = dirname3(dir);
6169
6182
  if (parent === dir) return void 0;
6170
6183
  dir = parent;
6171
6184
  }
@@ -6208,7 +6221,8 @@ ${tail(commit.output)}`));
6208
6221
  return { status: "done" };
6209
6222
  }
6210
6223
  async function installDependencies(directory, pm, inherit) {
6211
- if (!await hasCommand(pm, directory)) {
6224
+ const invocation = packageManagerInvocation(pm, ["install"]);
6225
+ if (invocation.fromPath && !await hasCommand(pm, directory)) {
6212
6226
  return failure(
6213
6227
  new CodedError(
6214
6228
  "PM_NOT_FOUND",
@@ -6217,7 +6231,11 @@ async function installDependencies(directory, pm, inherit) {
6217
6231
  );
6218
6232
  }
6219
6233
  try {
6220
- const result = await runCommand(pm, ["install"], { cwd: directory, inherit });
6234
+ const result = await runCommand(invocation.command, invocation.args, {
6235
+ cwd: directory,
6236
+ inherit,
6237
+ ...!invocation.fromPath && { shell: false }
6238
+ });
6221
6239
  if (result.code !== 0) {
6222
6240
  return failure(
6223
6241
  new CodedError(
@@ -6233,7 +6251,7 @@ ${tail(result.output)}`
6233
6251
  }
6234
6252
  }
6235
6253
  function assertEmptyDirectory(directory) {
6236
- if (existsSync(directory) && readdirSync(directory).length > 0) {
6254
+ if (existsSync2(directory) && readdirSync(directory).length > 0) {
6237
6255
  throw new CodedError("DIRECTORY_NOT_EMPTY", `${directory} already exists and is not empty`);
6238
6256
  }
6239
6257
  }
@@ -6292,15 +6310,30 @@ async function scaffold(spec, options) {
6292
6310
  }
6293
6311
 
6294
6312
  // src/kit/telemetry.ts
6295
- import { existsSync as existsSync2, mkdirSync as mkdirSync2, writeFileSync as writeFileSync2 } from "fs";
6313
+ import { existsSync as existsSync3, mkdirSync as mkdirSync2, writeFileSync as writeFileSync2 } from "fs";
6296
6314
  import { homedir } from "os";
6297
- import { join as join3 } from "path";
6315
+ import { join as join4 } from "path";
6316
+ import { z as z2 } from "zod";
6298
6317
  var TELEMETRY_HOST = "https://analytics.el1fe.com";
6299
6318
  var TELEMETRY_DOCS = "https://cogitator.app/docs/getting-started/telemetry";
6300
6319
  var SEND_TIMEOUT_MS = 1500;
6301
6320
  function telemetryWebsiteId() {
6302
6321
  return false ? "" : "ef978a40-6d7f-4332-81ba-e6d86e9d4b38";
6303
6322
  }
6323
+ var VALUE = z2.string().regex(/^[\w.,-]{0,100}$/);
6324
+ var PAYLOAD_SCHEMA = z2.strictObject({
6325
+ version: VALUE,
6326
+ preset: VALUE,
6327
+ provider: VALUE,
6328
+ memory: VALUE,
6329
+ features: VALUE,
6330
+ packageManager: VALUE,
6331
+ node: VALUE,
6332
+ os: VALUE,
6333
+ outcome: z2.enum(["success", "failure"]),
6334
+ failedStep: z2.enum(["none", "create", "install"]),
6335
+ errorCode: VALUE
6336
+ });
6304
6337
  var SAFE_CODE = /^[A-Z][A-Z0-9_]{1,63}$/;
6305
6338
  function telemetryErrorCode(error) {
6306
6339
  let kind;
@@ -6347,12 +6380,12 @@ function telemetryDisabledReason(options) {
6347
6380
  return void 0;
6348
6381
  }
6349
6382
  function configDir(env) {
6350
- if (process.platform === "win32" && env.APPDATA) return join3(env.APPDATA, "cogitator");
6351
- return join3(env.XDG_CONFIG_HOME || join3(homedir(), ".config"), "cogitator");
6383
+ if (process.platform === "win32" && env.APPDATA) return join4(env.APPDATA, "cogitator");
6384
+ return join4(env.XDG_CONFIG_HOME || join4(homedir(), ".config"), "cogitator");
6352
6385
  }
6353
6386
  function firstRunNotice(env = process.env) {
6354
- const marker = join3(configDir(env), "telemetry-notice");
6355
- if (existsSync2(marker)) return void 0;
6387
+ const marker = join4(configDir(env), "telemetry-notice");
6388
+ if (existsSync3(marker)) return void 0;
6356
6389
  try {
6357
6390
  mkdirSync2(configDir(env), { recursive: true });
6358
6391
  writeFileSync2(marker, `${(/* @__PURE__ */ new Date()).toISOString()}
@@ -6373,14 +6406,17 @@ function telemetryUserAgent(payload) {
6373
6406
  async function sendTelemetry(payload, options = {}) {
6374
6407
  const website = options.websiteId ?? telemetryWebsiteId();
6375
6408
  if (!website) return false;
6409
+ const parsed = PAYLOAD_SCHEMA.safeParse(payload);
6410
+ if (!parsed.success) return false;
6411
+ const data = parsed.data;
6376
6412
  const body = {
6377
6413
  type: "event",
6378
6414
  payload: {
6379
6415
  website,
6380
6416
  hostname: "create-cogitator-app",
6381
- url: `/scaffold/${payload.preset}`,
6417
+ url: `/scaffold/${data.preset}`,
6382
6418
  name: "scaffold",
6383
- data: payload
6419
+ data
6384
6420
  }
6385
6421
  };
6386
6422
  try {
@@ -6388,7 +6424,7 @@ async function sendTelemetry(payload, options = {}) {
6388
6424
  method: "POST",
6389
6425
  headers: {
6390
6426
  "content-type": "application/json",
6391
- "user-agent": telemetryUserAgent(payload)
6427
+ "user-agent": telemetryUserAgent(data)
6392
6428
  },
6393
6429
  body: JSON.stringify(body),
6394
6430
  signal: AbortSignal.timeout(options.timeoutMs ?? SEND_TIMEOUT_MS)
@@ -6637,9 +6673,9 @@ async function fetchExampleFiles(plan, fetchImpl = fetch) {
6637
6673
  }
6638
6674
 
6639
6675
  // src/kit/remote.ts
6640
- import { existsSync as existsSync3, readFileSync as readFileSync2, readdirSync as readdirSync2, writeFileSync as writeFileSync3 } from "fs";
6676
+ import { existsSync as existsSync4, readFileSync as readFileSync2, readdirSync as readdirSync2, writeFileSync as writeFileSync3 } from "fs";
6641
6677
  import { mkdir as mkdir2 } from "fs/promises";
6642
- import { join as join4 } from "path";
6678
+ import { join as join5 } from "path";
6643
6679
  import { Readable } from "stream";
6644
6680
  import { pipeline } from "stream/promises";
6645
6681
  import { x as extract } from "tar";
@@ -6726,9 +6762,9 @@ async function downloadTemplate(template, directory, options = {}) {
6726
6762
  return { files: files.sort(), skipped: skipped.sort() };
6727
6763
  }
6728
6764
  function prepareTemplate(directory, options) {
6729
- const lockfile = PACKAGE_MANAGERS.find((pm) => existsSync3(join4(directory, LOCKFILES[pm])));
6730
- const manifestPath = join4(directory, "package.json");
6731
- if (!existsSync3(manifestPath)) {
6765
+ const lockfile = PACKAGE_MANAGERS.find((pm) => existsSync4(join5(directory, LOCKFILES[pm])));
6766
+ const manifestPath = join5(directory, "package.json");
6767
+ if (!existsSync4(manifestPath)) {
6732
6768
  throw new CodedError(
6733
6769
  "TEMPLATE_NO_MANIFEST",
6734
6770
  `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 +6804,9 @@ function prepareTemplate(directory, options) {
6768
6804
  }
6769
6805
 
6770
6806
  // src/kit/starter.ts
6771
- import { existsSync as existsSync4, readFileSync as readFileSync3 } from "fs";
6807
+ import { existsSync as existsSync5, readFileSync as readFileSync3 } from "fs";
6772
6808
  import { mkdir as mkdir3, readdir, rm } from "fs/promises";
6773
- import { join as join5, relative, resolve as resolve2 } from "path";
6809
+ import { join as join6, relative, resolve as resolve2 } from "path";
6774
6810
  async function finish2(directory, packageManager, options) {
6775
6811
  const log2 = options.log ?? silentLogger;
6776
6812
  let install = { status: "skipped", reason: "install was turned off" };
@@ -6841,7 +6877,7 @@ async function createFromTemplate(template, options) {
6841
6877
  const log2 = options.log ?? silentLogger;
6842
6878
  const directory = resolve2(options.directory);
6843
6879
  assertEmptyDirectory(directory);
6844
- const existed = existsSync4(directory);
6880
+ const existed = existsSync5(directory);
6845
6881
  log2.start(`Downloading ${describeTemplate(template)}`);
6846
6882
  let downloaded;
6847
6883
  let prepared;
@@ -6855,7 +6891,7 @@ async function createFromTemplate(template, options) {
6855
6891
  log2.fail(`Could not use ${describeTemplate(template)}`);
6856
6892
  if (existed) {
6857
6893
  for (const entry of await readdir(directory)) {
6858
- await rm(join5(directory, entry), { recursive: true, force: true });
6894
+ await rm(join6(directory, entry), { recursive: true, force: true });
6859
6895
  }
6860
6896
  } else {
6861
6897
  await rm(directory, { recursive: true, force: true });
@@ -6874,7 +6910,7 @@ async function createFromTemplate(template, options) {
6874
6910
  ...downloaded.skipped.length > 0 ? [`Left out links and special files: ${downloaded.skipped.join(", ")}`] : []
6875
6911
  ];
6876
6912
  const { install, git } = await finish2(directory, packageManager, options);
6877
- const manifest = JSON.parse(readFileSync3(join5(directory, "package.json"), "utf-8"));
6913
+ const manifest = JSON.parse(readFileSync3(join6(directory, "package.json"), "utf-8"));
6878
6914
  return {
6879
6915
  directory,
6880
6916
  source: describeTemplate(template),
@@ -6887,7 +6923,7 @@ async function createFromTemplate(template, options) {
6887
6923
  packageManager,
6888
6924
  manifest.scripts ?? {},
6889
6925
  install.status === "done",
6890
- existsSync4(join5(directory, ".env.example"))
6926
+ existsSync5(join6(directory, ".env.example"))
6891
6927
  ),
6892
6928
  notes
6893
6929
  };
@@ -7229,9 +7265,9 @@ function exampleList() {
7229
7265
  }
7230
7266
 
7231
7267
  // src/cli/interactive.ts
7232
- import { existsSync as existsSync5 } from "fs";
7268
+ import { existsSync as existsSync6 } from "fs";
7233
7269
  import { homedir as homedir2 } from "os";
7234
- import { join as join6 } from "path";
7270
+ import { join as join7 } from "path";
7235
7271
  import * as p from "@clack/prompts";
7236
7272
 
7237
7273
  // src/kit/models.ts
@@ -7323,10 +7359,10 @@ function modelChoices(provider) {
7323
7359
  }
7324
7360
 
7325
7361
  // src/cli/resolve.ts
7326
- import { basename, resolve as resolve3 } from "path";
7362
+ import { basename as basename2, resolve as resolve3 } from "path";
7327
7363
  var DEFAULT_DIRECTORY = "my-agents";
7328
7364
  function projectNameFromDirectory(directory, cwd = process.cwd()) {
7329
- return basename(resolve3(cwd, directory.trim()));
7365
+ return basename2(resolve3(cwd, directory.trim()));
7330
7366
  }
7331
7367
  function resolveDirectory(directory, cwd = process.cwd()) {
7332
7368
  const name = projectNameFromDirectory(directory, cwd);
@@ -7382,7 +7418,7 @@ function detectCodingAgents(home = homedir2()) {
7382
7418
  codex: ".codex"
7383
7419
  };
7384
7420
  return CODING_AGENT_CHOICES.map((choice) => choice.value).filter(
7385
- (agent) => existsSync5(join6(home, markers[agent]))
7421
+ (agent) => existsSync6(join7(home, markers[agent]))
7386
7422
  );
7387
7423
  }
7388
7424
  async function askDirectory() {