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/lib.d.ts CHANGED
@@ -852,7 +852,9 @@ declare function telemetryDisabledReason(options: {
852
852
  declare function firstRunNotice(env?: NodeJS.ProcessEnv): string | undefined;
853
853
  /**
854
854
  * Sends the event to Umami. It never throws and never takes longer than its
855
- * timeout: a slow or failing network changes nothing for the scaffolder.
855
+ * timeout: a slow or failing network changes nothing for the scaffolder. A
856
+ * payload that is not exactly an event (another field, a value with a path or
857
+ * a space in it) sends nothing.
856
858
  */
857
859
  declare function sendTelemetry(payload: TelemetryPayload, options?: {
858
860
  fetch?: typeof fetch;
package/dist/lib.js CHANGED
@@ -2,13 +2,13 @@
2
2
  var define_COGITATOR_EXAMPLES_default = [{ name: "a2a/a2a-server", title: "A2A Server", entry: "a2a/01-a2a-server.ts", files: ["_shared/setup.ts", "a2a/01-a2a-server.ts"], dependencies: { "@cogitator-ai/a2a": "^0.8.3", "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5", express: "^5.2.1" }, devDependencies: { "@types/express": "^5.0.6", tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "a2a/a2a-client", title: "A2A Client", entry: "a2a/02-a2a-client.ts", files: ["_shared/setup.ts", "a2a/02-a2a-client.ts"], dependencies: { "@cogitator-ai/a2a": "^0.8.3", "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "advanced/self-modifying", title: "Self-Modifying Agent", entry: "advanced/01-self-modifying.ts", files: ["_shared/setup.ts", "advanced/01-self-modifying.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/self-modifying": "^19.4.3", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "advanced/neuro-symbolic", title: "Neuro-Symbolic Reasoning", entry: "advanced/02-neuro-symbolic.ts", files: ["_shared/setup.ts", "advanced/02-neuro-symbolic.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/neuro-symbolic": "^17.0.23", "@cogitator-ai/types": "^0.39.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "advanced/wasm-tools", title: "WASM-Sandboxed Tools", entry: "advanced/03-wasm-tools.ts", files: ["_shared/setup.ts", "advanced/03-wasm-tools.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/wasm-tools": "^0.7.17", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "browser/web-scraping", title: "Web Scraping with Browser Agent", entry: "browser/01-web-scraping.ts", files: ["_shared/setup.ts", "browser/01-web-scraping.ts"], dependencies: { "@cogitator-ai/browser": "^0.4.13", "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "browser/form-automation", title: "Form Automation with Browser Agent", entry: "browser/02-form-automation.ts", files: ["_shared/setup.ts", "browser/02-form-automation.ts"], dependencies: { "@cogitator-ai/browser": "^0.4.13", "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "browser/stealth-agent", title: "Stealth Browser Agent", entry: "browser/03-stealth-agent.ts", files: ["_shared/setup.ts", "browser/03-stealth-agent.ts"], dependencies: { "@cogitator-ai/browser": "^0.4.13", "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "browser/bitcoin-price-scraper", title: "Bitcoin Price Scraper (Binance)", entry: "browser/04-bitcoin-price-scraper.ts", files: ["_shared/setup.ts", "browser/04-bitcoin-price-scraper.ts"], dependencies: { "@cogitator-ai/browser": "^0.4.13", "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "channels/telegram-assistant", title: "Telegram assistant", entry: "channels/01-telegram-assistant.ts", files: ["channels/01-telegram-assistant.ts", "channels/cogitator.yml", "channels/webchat-client.html"], dependencies: { "@cogitator-ai/channels": "^0.9.3", "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5", grammy: "^1.46.0", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["GOOGLE_API_KEY", "OWNER_TG_ID", "TG_TOKEN"], runtime: "node" }, { name: "channels/super-assistant", title: "Super assistant", entry: "channels/02-super-assistant.ts", files: ["channels/02-super-assistant.ts", "channels/cogitator.yml", "channels/webchat-client.html"], dependencies: { "@cogitator-ai/channels": "^0.9.3", "better-sqlite3": "^13.0.3", dotenv: "^18.0.5", grammy: "^1.46.0" }, devDependencies: { tsx: "^4.23.15" }, env: ["OWNER_TG_ID", "TG_TOKEN"], runtime: "node" }, { name: "channels/webchat-bot", title: "Webchat bot", entry: "channels/03-webchat-bot.ts", files: ["channels/03-webchat-bot.ts", "channels/cogitator.yml", "channels/webchat-client.html"], dependencies: { "@cogitator-ai/channels": "^0.9.3", "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5", ws: "^8.22.0", zod: "^4.6.5" }, devDependencies: { "@types/ws": "^8.18.2", tsx: "^4.23.15" }, env: ["GOOGLE_API_KEY", "WEBCHAT_PORT", "WEBCHAT_TOKEN"], runtime: "node" }, { name: "core/basic-agent", title: "Basic Agent with Custom Tools", entry: "core/01-basic-agent.ts", files: ["_shared/setup.ts", "core/01-basic-agent.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/built-in-tools", title: "Built-in Tools", entry: "core/02-built-in-tools.ts", files: ["_shared/setup.ts", "core/02-built-in-tools.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/tool-caching", title: "Tool Caching with withCache", entry: "core/03-tool-caching.ts", files: ["_shared/setup.ts", "core/03-tool-caching.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/context-manager", title: "Context Manager", entry: "core/04-context-manager.ts", files: ["_shared/setup.ts", "core/04-context-manager.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/types": "^0.39.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/tree-of-thought", title: "Tree of Thought", entry: "core/05-tree-of-thought.ts", files: ["_shared/setup.ts", "core/05-tree-of-thought.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/reflection", title: "Reflection", entry: "core/06-reflection.ts", files: ["_shared/setup.ts", "core/06-reflection.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/agent-optimizer", title: "Agent Optimizer", entry: "core/07-agent-optimizer.ts", files: ["_shared/setup.ts", "core/07-agent-optimizer.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/time-travel", title: "Time Travel", entry: "core/08-time-travel.ts", files: ["_shared/setup.ts", "core/08-time-travel.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/cost-routing", title: "Cost-Aware Routing", entry: "core/09-cost-routing.ts", files: ["_shared/setup.ts", "core/09-cost-routing.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/constitutional-ai", title: "Constitutional AI", entry: "core/10-constitutional-ai.ts", files: ["_shared/setup.ts", "core/10-constitutional-ai.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/prompt-injection", title: "Prompt Injection Detection", entry: "core/11-prompt-injection.ts", files: ["_shared/setup.ts", "core/11-prompt-injection.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/causal-reasoning", title: "Causal Reasoning", entry: "core/12-causal-reasoning.ts", files: ["_shared/setup.ts", "core/12-causal-reasoning.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/model-registry", title: "Model Registry", entry: "core/13-model-registry.ts", files: ["_shared/setup.ts", "core/13-model-registry.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/models": "^18.3.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/approvals", title: "Approvals: pause before a sensitive tool, resume later", entry: "core/14-approvals.ts", files: ["_shared/setup.ts", "core/14-approvals.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "core/handoffs", title: "Handoffs: a triage agent passes the conversation on", entry: "core/15-handoffs.ts", files: ["_shared/setup.ts", "core/15-handoffs.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "device-tools/screenshot", title: "Screenshot", entry: "device-tools/01-screenshot.ts", files: ["device-tools/01-screenshot.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: [], runtime: "node" }, { name: "device-tools/clipboard", title: "Clipboard", entry: "device-tools/02-clipboard.ts", files: ["device-tools/02-clipboard.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: [], runtime: "node" }, { name: "device-tools/notify", title: "Notify", entry: "device-tools/03-notify.ts", files: ["device-tools/03-notify.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: [], runtime: "node" }, { name: "device-tools/open-url", title: "Open url", entry: "device-tools/04-open-url.ts", files: ["device-tools/04-open-url.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: [], runtime: "node" }, { name: "device-tools/shell-exec", title: "Shell exec", entry: "device-tools/05-shell-exec.ts", files: ["device-tools/05-shell-exec.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: [], runtime: "node" }, { name: "evals/basic-eval", title: "Basic Evaluation", entry: "evals/01-basic-eval.ts", files: ["_shared/setup.ts", "evals/01-basic-eval.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/evals": "^0.6.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "evals/llm-judge", title: "LLM-as-Judge Evaluation", entry: "evals/02-llm-judge.ts", files: ["_shared/setup.ts", "evals/02-llm-judge.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/evals": "^0.6.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "evals/ab-comparison", title: "A/B Comparison", entry: "evals/03-ab-comparison.ts", files: ["_shared/setup.ts", "evals/03-ab-comparison.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/evals": "^0.6.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "infrastructure/redis-memory", title: "Redis Memory: Persistent Conversations", entry: "infrastructure/01-redis-memory.ts", files: ["_shared/setup.ts", "infrastructure/01-redis-memory.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/memory": "^0.12.3", dotenv: "^18.0.5", ioredis: "^5.0.0 || ^6.0.0" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY", "REDIS_URL"], runtime: "node" }, { name: "infrastructure/postgres-memory", title: "PostgreSQL Memory: Long-Term Persistence", entry: "infrastructure/02-postgres-memory.ts", files: ["_shared/setup.ts", "infrastructure/02-postgres-memory.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/memory": "^0.12.3", dotenv: "^18.0.5", pg: "^8.23.1" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "DATABASE_URL", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "infrastructure/worker-queue", title: "Worker Queue: Distributed Agent Execution", entry: "infrastructure/03-worker-queue.ts", files: ["_shared/setup.ts", "infrastructure/03-worker-queue.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/worker": "^0.9.3", dotenv: "^18.0.5", ioredis: "^5.0.0 || ^6.0.0" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY", "REDIS_URL"], runtime: "node" }, { name: "infrastructure/deploy-docker", title: "Deploy: Docker Deployment Planning", entry: "infrastructure/04-deploy-docker.ts", files: ["_shared/setup.ts", "infrastructure/04-deploy-docker.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/deploy": "^0.6.2", dotenv: "^18.0.5", pg: "^8.23.1" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "infrastructure/sandbox-execution", title: "Sandbox Execution: Docker, WASM & Native", entry: "infrastructure/05-sandbox-execution.ts", files: ["_shared/setup.ts", "infrastructure/05-sandbox-execution.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/sandbox": "^0.5.12", "@extism/extism": "^2.0.0-rc13", dockerode: "^4.0.0 || ^5.0.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "integrations/express-server", title: "Express Server Integration", entry: "integrations/01-express-server.ts", files: ["_shared/arithmetic.ts", "_shared/setup.ts", "integrations/01-express-server.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/express": "^0.8.3", dotenv: "^18.0.5", express: "^5.2.1", zod: "^4.6.5" }, devDependencies: { "@types/express": "^5.0.6", tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "integrations/fastify-server", title: "Fastify Server Integration", entry: "integrations/02-fastify-server.ts", files: ["_shared/arithmetic.ts", "_shared/setup.ts", "integrations/02-fastify-server.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/fastify": "^0.7.3", dotenv: "^18.0.5", fastify: "^5.12.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "integrations/hono-server", title: "Hono Server Integration", entry: "integrations/03-hono-server.ts", files: ["_shared/setup.ts", "integrations/03-hono-server.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/hono": "^0.7.3", "@hono/node-server": "^2.1.3", dotenv: "^18.0.5", hono: "^4.13.12" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "integrations/koa-server", title: "Koa Server Integration", entry: "integrations/04-koa-server.ts", files: ["_shared/setup.ts", "integrations/04-koa-server.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/koa": "^0.7.3", "@koa/router": "^15.7.0", dotenv: "^18.0.5", koa: "^3.2.1" }, devDependencies: { "@types/koa": "^3.0.3", tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "integrations/nextjs-handler", title: "Nextjs handler", entry: "integrations/05-nextjs-handler.ts", files: ["integrations/05-nextjs-handler.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/next": "^0.8.3", next: "^14.0.0 || ^15.0.0 || ^16.0.0", react: "^18.2.0 || ^19.0.0", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["GOOGLE_API_KEY"], runtime: "node" }, { name: "integrations/openai-compat", title: "OpenAI-Compatible Server", entry: "integrations/06-openai-compat.ts", files: ["_shared/setup.ts", "integrations/06-openai-compat.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/openai-compat": "^21.2.3", "@cogitator-ai/types": "^0.39.0", dotenv: "^18.0.5", openai: "^7.25.0", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "integrations/ai-sdk-adapter", title: "Vercel AI SDK Adapter", entry: "integrations/07-ai-sdk-adapter.ts", files: ["_shared/setup.ts", "integrations/07-ai-sdk-adapter.ts"], dependencies: { "@cogitator-ai/ai-sdk": "^0.6.0", "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/types": "^0.39.0", ai: "^7.0.127", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "integrations/tetsu-server", title: "Tetsu Server on Bun: an app with its own MCP server and agent", entry: "integrations/08-tetsu-server.ts", files: ["_shared/setup.ts", "integrations/08-tetsu-server.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/mcp": "^19.3.3", "@cogitator-ai/tetsu": "^0.5.3", "@cogitator-ai/types": "^0.39.0", "@tetsujs/core": "^0.6.1", "@tetsujs/openapi": "^0.6.1", "@tetsujs/sse": "^0.6.1", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "bun" }, { name: "mcp/mcp-client", title: "MCP Client: Filesystem Server", entry: "mcp/01-mcp-client.ts", files: ["_shared/setup.ts", "mcp/01-mcp-client.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/mcp": "^19.3.3", "@cogitator-ai/types": "^0.39.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "mcp/mcp-server", title: "MCP Server: Expose Cogitator Tools over HTTP", entry: "mcp/02-mcp-server.ts", files: ["_shared/setup.ts", "mcp/02-mcp-server.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/mcp": "^19.3.3", "@cogitator-ai/types": "^0.39.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "mcp/per-user-mcp", title: "An Agent on Your Own MCP Server, per User", entry: "mcp/03-per-user-mcp.ts", files: ["_shared/setup.ts", "mcp/03-per-user-mcp.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/mcp": "^19.3.3", "@cogitator-ai/types": "^0.39.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "mcp/agent-as-mcp-server", title: "A Cogitator Agent as an MCP Server", entry: "mcp/04-agent-as-mcp-server.ts", files: ["_shared/setup.ts", "mcp/04-agent-as-mcp-server.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/mcp": "^19.3.3", "@cogitator-ai/types": "^0.39.0", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "memory/basic-memory", title: "Basic Memory: Threads & Multi-Turn Conversations", entry: "memory/01-basic-memory.ts", files: ["_shared/setup.ts", "memory/01-basic-memory.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/memory": "^0.12.3", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "memory/context-builder", title: "Context Builder: Token-Aware Context Windows", entry: "memory/02-context-builder.ts", files: ["_shared/setup.ts", "memory/02-context-builder.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/memory": "^0.12.3", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "memory/semantic-search", title: "Semantic Search: Hybrid BM25 + Vector Search", entry: "memory/03-semantic-search.ts", files: ["_shared/setup.ts", "memory/03-semantic-search.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/memory": "^0.12.3", "@qdrant/js-client-rest": "^1.10.0", dotenv: "^18.0.5", pg: "^8.23.1" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "memory/knowledge-graph", title: "Knowledge Graph: Entity Extraction & Graph Traversal", entry: "memory/04-knowledge-graph.ts", files: ["_shared/setup.ts", "memory/04-knowledge-graph.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/memory": "^0.12.3", "@cogitator-ai/types": "^0.39.0", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "rag/basic-retrieval", title: "Basic RAG Retrieval", entry: "rag/01-basic-retrieval.ts", files: ["_shared/setup.ts", "rag/01-basic-retrieval.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/memory": "^0.12.3", "@cogitator-ai/rag": "^0.6.3", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "rag/chunking-strategies", title: "Chunking Strategies Comparison", entry: "rag/02-chunking-strategies.ts", files: ["_shared/setup.ts", "rag/02-chunking-strategies.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/memory": "^0.12.3", "@cogitator-ai/rag": "^0.6.3", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "rag/agent-with-rag", title: "Agent with RAG Tools", entry: "rag/03-agent-with-rag.ts", files: ["_shared/setup.ts", "rag/03-agent-with-rag.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/memory": "^0.12.3", "@cogitator-ai/rag": "^0.6.3", "@qdrant/js-client-rest": "^1.10.0", "better-sqlite3": "^13.0.3", dotenv: "^18.0.5", ioredis: "^5.0.0 || ^6.0.0", mongodb: "^6.0.0 || ^7.0.0", pg: "^8.23.1" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "swarms/debate-swarm", title: "Debate Swarm", entry: "swarms/01-debate-swarm.ts", files: ["_shared/setup.ts", "swarms/01-debate-swarm.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/swarms": "^0.12.3", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "swarms/pipeline-swarm", title: "Pipeline Swarm", entry: "swarms/02-pipeline-swarm.ts", files: ["_shared/setup.ts", "swarms/02-pipeline-swarm.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/swarms": "^0.12.3", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "swarms/hierarchical-swarm", title: "Hierarchical Swarm", entry: "swarms/03-hierarchical-swarm.ts", files: ["_shared/setup.ts", "swarms/03-hierarchical-swarm.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/swarms": "^0.12.3", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "swarms/negotiation-swarm", title: "Negotiation Swarm", entry: "swarms/04-negotiation-swarm.ts", files: ["_shared/setup.ts", "swarms/04-negotiation-swarm.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/swarms": "^0.12.3", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "voice/pipeline", title: "Voice Pipeline", entry: "voice/01-pipeline.ts", files: ["_shared/setup.ts", "voice/01-pipeline.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/voice": "^0.5.3", dotenv: "^18.0.5", openai: "^7.25.0" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "voice/realtime", title: "Realtime Voice Session", entry: "voice/02-realtime.ts", files: ["_shared/setup.ts", "voice/02-realtime.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/voice": "^0.5.3", dotenv: "^18.0.5", openai: "^7.25.0" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "voice/voice-agent", title: "Voice Agent (WebSocket Server)", entry: "voice/03-voice-agent.ts", files: ["_shared/setup.ts", "voice/03-voice-agent.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/voice": "^0.5.3", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "DEEPGRAM_API_KEY", "ELEVENLABS_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "voice/realtime-voice-agent", title: "Realtime Voice Agent (Gemini Live over WebSocket)", entry: "voice/04-realtime-voice-agent.ts", files: ["_shared/setup.ts", "voice/04-realtime-voice-agent.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/voice": "^0.5.3", dotenv: "^18.0.5", ws: "^8.22.0" }, devDependencies: { "@types/ws": "^8.18.2", tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "workflows/basic-workflow", title: "Basic Workflow: Code Review Pipeline", entry: "workflows/01-basic-workflow.ts", files: ["_shared/setup.ts", "workflows/01-basic-workflow.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/workflows": "^0.12.3", dotenv: "^18.0.5", zod: "^4.6.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "workflows/human-in-loop", title: "Human-in-the-Loop: Content Publishing Workflow", entry: "workflows/02-human-in-loop.ts", files: ["_shared/setup.ts", "workflows/02-human-in-loop.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/workflows": "^0.12.3", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }, { name: "workflows/map-reduce", title: "Map-Reduce: Parallel Document Analysis", entry: "workflows/03-map-reduce.ts", files: ["_shared/setup.ts", "workflows/03-map-reduce.ts"], dependencies: { "@cogitator-ai/core": "^0.37.0", "@cogitator-ai/workflows": "^0.12.3", dotenv: "^18.0.5" }, devDependencies: { tsx: "^4.23.15" }, env: ["ANTHROPIC_API_KEY", "GOOGLE_API_KEY", "OLLAMA_URL", "OPENAI_API_KEY"], runtime: "node" }];
3
3
 
4
4
  // <define:__COGITATOR_VERSIONS__>
5
- var define_COGITATOR_VERSIONS_default = { "@cogitator-ai/a2a": "0.8.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" };
5
+ var define_COGITATOR_VERSIONS_default = { "@cogitator-ai/a2a": "0.8.3", "@cogitator-ai/ai-sdk": "0.6.0", "@cogitator-ai/browser": "0.4.13", "@cogitator-ai/channels": "0.9.3", "@cogitator-ai/cli": "0.6.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" };
6
6
 
7
7
  // src/kit/scaffold.ts
8
8
  import { createHash } from "crypto";
9
- import { existsSync, readFileSync, readdirSync } from "fs";
9
+ import { existsSync as existsSync2, readFileSync, readdirSync } from "fs";
10
10
  import { chmod, mkdir, readFile, writeFile } from "fs/promises";
11
- import { dirname as dirname2, join as join2, resolve } from "path";
11
+ import { dirname as dirname3, join as join3, resolve } from "path";
12
12
 
13
13
  // src/kit/errors.ts
14
14
  var CodedError = class extends Error {
@@ -23,6 +23,10 @@ function constantCase(name) {
23
23
  return name.replace(/([a-z0-9])([A-Z])/g, "$1_$2").toUpperCase();
24
24
  }
25
25
 
26
+ // src/kit/package-manager.ts
27
+ import { existsSync } from "fs";
28
+ import { basename, dirname, join } from "path";
29
+
26
30
  // src/kit/spec.ts
27
31
  import { z } from "zod";
28
32
  var PROVIDERS = ["ollama", "openai", "anthropic", "google"];
@@ -133,6 +137,17 @@ function execCommand(pm, bin) {
133
137
  if (pm === "bun") return `bunx ${bin}`;
134
138
  return `${pm} exec ${bin}`;
135
139
  }
140
+ function launchingPackageManager(pm, env) {
141
+ const execPath = env.npm_execpath;
142
+ if (!execPath || env.npm_config_user_agent?.split("/")[0] !== pm) return void 0;
143
+ const path = pm === "npm" && basename(execPath) === "npx-cli.js" ? join(dirname(execPath), "npm-cli.js") : execPath;
144
+ return existsSync(path) ? path : void 0;
145
+ }
146
+ function packageManagerInvocation(pm, args, env = process.env) {
147
+ const launcher = launchingPackageManager(pm, env);
148
+ if (!launcher) return { command: pm, args, fromPath: true };
149
+ return /\.[cm]?js$/.test(launcher) ? { command: process.execPath, args: [launcher, ...args], fromPath: false } : { command: launcher, args, fromPath: false };
150
+ }
136
151
  function installCommand(pm) {
137
152
  return `${pm} install`;
138
153
  }
@@ -503,7 +518,7 @@ function yamlString(value) {
503
518
 
504
519
  // src/kit/versions.ts
505
520
  function scaffolderVersion() {
506
- return false ? "0.0.0" : "0.6.0";
521
+ return false ? "0.0.0" : "0.6.1";
507
522
  }
508
523
  function workspaceVersions() {
509
524
  return typeof define_COGITATOR_VERSIONS_default === "undefined" ? {} : define_COGITATOR_VERSIONS_default;
@@ -618,7 +633,7 @@ function emitPackageJson(project, extras) {
618
633
  };
619
634
  project.file("package.json", JSON.stringify(pkg, null, 2) + "\n");
620
635
  }
621
- var SKIPPED_BUILDS = ["cpu-features", "protobufjs", "ssh2"];
636
+ var SKIPPED_BUILDS = ["better-sqlite3", "cpu-features", "protobufjs", "ssh2"];
622
637
  function pnpmWorkspaceYaml(nativeBuilds) {
623
638
  const allowed = new Set(nativeBuilds);
624
639
  const entries = [
@@ -1570,7 +1585,7 @@ function emitAssistant(project) {
1570
1585
  // src/kit/features/deploy.ts
1571
1586
  import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "fs";
1572
1587
  import { tmpdir } from "os";
1573
- import { dirname, join } from "path";
1588
+ import { dirname as dirname2, join as join2 } from "path";
1574
1589
  import { ArtifactGenerator, ProjectAnalyzer } from "@cogitator-ai/deploy";
1575
1590
  var ROOT_ARTIFACTS = {
1576
1591
  Dockerfile: "Dockerfile",
@@ -1580,14 +1595,14 @@ var ROOT_ARTIFACTS = {
1580
1595
  function emitDeployArtifacts(project) {
1581
1596
  const { spec } = project;
1582
1597
  if (spec.deploy === "none") return;
1583
- const dir = mkdtempSync(join(tmpdir(), "cogitator-deploy-plan-"));
1598
+ const dir = mkdtempSync(join2(tmpdir(), "cogitator-deploy-plan-"));
1584
1599
  try {
1585
1600
  for (const file of project.files.values()) {
1586
- const target = join(dir, file.path);
1587
- mkdirSync(dirname(target), { recursive: true });
1601
+ const target = join2(dir, file.path);
1602
+ mkdirSync(dirname2(target), { recursive: true });
1588
1603
  writeFileSync(target, file.content);
1589
1604
  }
1590
- writeFileSync(join(dir, LOCKFILES[spec.packageManager]), "");
1605
+ writeFileSync(join2(dir, LOCKFILES[spec.packageManager]), "");
1591
1606
  const analysis = new ProjectAnalyzer().analyze(dir, { target: spec.deploy }, { env: {} });
1592
1607
  const { files } = new ArtifactGenerator().generate(analysis.deployConfig, analysis);
1593
1608
  for (const artifact of files) {
@@ -5914,7 +5929,7 @@ function runCommand(command, args, options) {
5914
5929
  cwd: options.cwd,
5915
5930
  env: options.env ?? process.env,
5916
5931
  stdio: options.inherit ? "inherit" : ["ignore", "pipe", "pipe"],
5917
- shell: process.platform === "win32",
5932
+ shell: options.shell ?? process.platform === "win32",
5918
5933
  timeout: options.timeoutMs
5919
5934
  });
5920
5935
  let output = "";
@@ -5951,8 +5966,8 @@ function failure(error) {
5951
5966
  }
5952
5967
  async function writeFiles(directory, files) {
5953
5968
  for (const file of files) {
5954
- const target = join2(directory, file.path);
5955
- await mkdir(dirname2(target), { recursive: true });
5969
+ const target = join3(directory, file.path);
5970
+ await mkdir(dirname3(target), { recursive: true });
5956
5971
  await writeFile(
5957
5972
  target,
5958
5973
  file.content,
@@ -5967,15 +5982,15 @@ async function saveLock(directory, files) {
5967
5982
  generator: `create-cogitator-app@${scaffolderVersion()}`,
5968
5983
  files: Object.fromEntries(Object.entries(files).sort(([a], [b]) => a.localeCompare(b)))
5969
5984
  };
5970
- await mkdir(join2(directory, dirname2(LOCK_PATH)), { recursive: true });
5971
- await writeFile(join2(directory, LOCK_PATH), JSON.stringify(lock, null, 2) + "\n");
5985
+ await mkdir(join3(directory, dirname3(LOCK_PATH)), { recursive: true });
5986
+ await writeFile(join3(directory, LOCK_PATH), JSON.stringify(lock, null, 2) + "\n");
5972
5987
  }
5973
5988
  async function hashFiles(directory, paths) {
5974
5989
  const hashes = /* @__PURE__ */ new Map();
5975
5990
  for (const path of paths) {
5976
5991
  if (UNTRACKED.has(path) || path === LOCK_PATH) continue;
5977
- const full = join2(directory, path);
5978
- hashes.set(path, existsSync(full) ? hashContent(await readFile(full, "utf-8")) : void 0);
5992
+ const full = join3(directory, path);
5993
+ hashes.set(path, existsSync2(full) ? hashContent(await readFile(full, "utf-8")) : void 0);
5979
5994
  }
5980
5995
  return hashes;
5981
5996
  }
@@ -5993,8 +6008,8 @@ async function updateLock(directory, paths) {
5993
6008
  await saveLock(directory, files);
5994
6009
  }
5995
6010
  function readLock(directory) {
5996
- const path = join2(directory, LOCK_PATH);
5997
- if (!existsSync(path)) return void 0;
6011
+ const path = join3(directory, LOCK_PATH);
6012
+ if (!existsSync2(path)) return void 0;
5998
6013
  const parsed = JSON.parse(readFileSync(path, "utf-8"));
5999
6014
  if (typeof parsed !== "object" || parsed === null || !("files" in parsed) || typeof parsed.files !== "object" || parsed.files === null) {
6000
6015
  throw new Error(`${LOCK_PATH} is not a scaffold lock`);
@@ -6008,8 +6023,8 @@ function readLock(directory) {
6008
6023
  }
6009
6024
  function biomeBinary(directory) {
6010
6025
  const name = process.platform === "win32" ? "biome.cmd" : "biome";
6011
- const path = join2(directory, "node_modules", ".bin", name);
6012
- return existsSync(path) ? path : void 0;
6026
+ const path = join3(directory, "node_modules", ".bin", name);
6027
+ return existsSync2(path) ? path : void 0;
6013
6028
  }
6014
6029
  async function formatProject(directory, paths = ["."]) {
6015
6030
  const biome = biomeBinary(directory);
@@ -6027,7 +6042,7 @@ ${tail(result.output)}`));
6027
6042
  }
6028
6043
  async function enclosingGitRepo(directory) {
6029
6044
  let dir = resolve(directory);
6030
- while (!existsSync(dir)) dir = dirname2(dir);
6045
+ while (!existsSync2(dir)) dir = dirname3(dir);
6031
6046
  try {
6032
6047
  const result = await runCommand("git", ["rev-parse", "--show-toplevel"], { cwd: dir });
6033
6048
  return result.code === 0 ? result.output.trim() : void 0;
@@ -6036,11 +6051,11 @@ async function enclosingGitRepo(directory) {
6036
6051
  }
6037
6052
  }
6038
6053
  function enclosingWorkspace(directory) {
6039
- let dir = dirname2(resolve(directory));
6054
+ let dir = dirname3(resolve(directory));
6040
6055
  for (; ; ) {
6041
- if (existsSync(join2(dir, "pnpm-workspace.yaml"))) return dir;
6042
- const manifest = join2(dir, "package.json");
6043
- if (existsSync(manifest)) {
6056
+ if (existsSync2(join3(dir, "pnpm-workspace.yaml"))) return dir;
6057
+ const manifest = join3(dir, "package.json");
6058
+ if (existsSync2(manifest)) {
6044
6059
  try {
6045
6060
  const parsed = JSON.parse(readFileSync(manifest, "utf-8"));
6046
6061
  if (typeof parsed === "object" && parsed !== null && "workspaces" in parsed) return dir;
@@ -6048,7 +6063,7 @@ function enclosingWorkspace(directory) {
6048
6063
  return void 0;
6049
6064
  }
6050
6065
  }
6051
- const parent = dirname2(dir);
6066
+ const parent = dirname3(dir);
6052
6067
  if (parent === dir) return void 0;
6053
6068
  dir = parent;
6054
6069
  }
@@ -6091,7 +6106,8 @@ ${tail(commit.output)}`));
6091
6106
  return { status: "done" };
6092
6107
  }
6093
6108
  async function installDependencies(directory, pm, inherit) {
6094
- if (!await hasCommand(pm, directory)) {
6109
+ const invocation = packageManagerInvocation(pm, ["install"]);
6110
+ if (invocation.fromPath && !await hasCommand(pm, directory)) {
6095
6111
  return failure(
6096
6112
  new CodedError(
6097
6113
  "PM_NOT_FOUND",
@@ -6100,7 +6116,11 @@ async function installDependencies(directory, pm, inherit) {
6100
6116
  );
6101
6117
  }
6102
6118
  try {
6103
- const result = await runCommand(pm, ["install"], { cwd: directory, inherit });
6119
+ const result = await runCommand(invocation.command, invocation.args, {
6120
+ cwd: directory,
6121
+ inherit,
6122
+ ...!invocation.fromPath && { shell: false }
6123
+ });
6104
6124
  if (result.code !== 0) {
6105
6125
  return failure(
6106
6126
  new CodedError(
@@ -6116,7 +6136,7 @@ ${tail(result.output)}`
6116
6136
  }
6117
6137
  }
6118
6138
  function assertEmptyDirectory(directory) {
6119
- if (existsSync(directory) && readdirSync(directory).length > 0) {
6139
+ if (existsSync2(directory) && readdirSync(directory).length > 0) {
6120
6140
  throw new CodedError("DIRECTORY_NOT_EMPTY", `${directory} already exists and is not empty`);
6121
6141
  }
6122
6142
  }
@@ -6175,9 +6195,9 @@ async function scaffold(spec, options) {
6175
6195
  }
6176
6196
 
6177
6197
  // src/kit/add.ts
6178
- import { existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
6198
+ import { existsSync as existsSync3, readFileSync as readFileSync2 } from "fs";
6179
6199
  import { mkdir as mkdir2, rm, writeFile as writeFile2 } from "fs/promises";
6180
- import { dirname as dirname3, join as join3, resolve as resolve2 } from "path";
6200
+ import { dirname as dirname4, join as join4, resolve as resolve2 } from "path";
6181
6201
  import { parseDocument as parseDocument2 } from "yaml";
6182
6202
 
6183
6203
  // src/kit/diff.ts
@@ -6403,8 +6423,8 @@ var AddConflictError = class extends Error {
6403
6423
  }
6404
6424
  };
6405
6425
  function readProject(directory) {
6406
- const manifestPath = join3(directory, "package.json");
6407
- if (!existsSync2(manifestPath)) {
6426
+ const manifestPath = join4(directory, "package.json");
6427
+ if (!existsSync3(manifestPath)) {
6408
6428
  throw new NotAScaffoldedProjectError(
6409
6429
  `There is no package.json in ${directory}: run cogitator add in the root of the project`
6410
6430
  );
@@ -6605,8 +6625,8 @@ function decide(inputs) {
6605
6625
  return structuredDecision(inputs) ?? textDecision(inputs);
6606
6626
  }
6607
6627
  function readText(directory, path) {
6608
- const full = join3(directory, path);
6609
- return existsSync2(full) ? readFileSync2(full, "utf-8") : void 0;
6628
+ const full = join4(directory, path);
6629
+ return existsSync3(full) ? readFileSync2(full, "utf-8") : void 0;
6610
6630
  }
6611
6631
  function fileMap(plan) {
6612
6632
  return new Map(
@@ -6706,12 +6726,12 @@ async function addToProject(directory, changes, options = {}) {
6706
6726
  const written = [];
6707
6727
  const deleted = [];
6708
6728
  for (const change of plan.changes) {
6709
- const target = join3(plan.directory, change.path);
6729
+ const target = join4(plan.directory, change.path);
6710
6730
  if (change.kind === "delete") {
6711
6731
  await rm(target, { force: true });
6712
6732
  deleted.push(change.path);
6713
6733
  } else {
6714
- await mkdir2(dirname3(target), { recursive: true });
6734
+ await mkdir2(dirname4(target), { recursive: true });
6715
6735
  await writeFile2(target, change.content ?? "");
6716
6736
  written.push(change.path);
6717
6737
  }
@@ -6976,9 +6996,9 @@ async function fetchExampleFiles(plan, fetchImpl = fetch) {
6976
6996
  }
6977
6997
 
6978
6998
  // src/kit/remote.ts
6979
- import { existsSync as existsSync3, readFileSync as readFileSync3, readdirSync as readdirSync2, writeFileSync as writeFileSync2 } from "fs";
6999
+ import { existsSync as existsSync4, readFileSync as readFileSync3, readdirSync as readdirSync2, writeFileSync as writeFileSync2 } from "fs";
6980
7000
  import { mkdir as mkdir3 } from "fs/promises";
6981
- import { join as join4 } from "path";
7001
+ import { join as join5 } from "path";
6982
7002
  import { Readable } from "stream";
6983
7003
  import { pipeline } from "stream/promises";
6984
7004
  import { x as extract } from "tar";
@@ -7065,9 +7085,9 @@ async function downloadTemplate(template, directory, options = {}) {
7065
7085
  return { files: files.sort(), skipped: skipped.sort() };
7066
7086
  }
7067
7087
  function prepareTemplate(directory, options) {
7068
- const lockfile = PACKAGE_MANAGERS.find((pm) => existsSync3(join4(directory, LOCKFILES[pm])));
7069
- const manifestPath = join4(directory, "package.json");
7070
- if (!existsSync3(manifestPath)) {
7088
+ const lockfile = PACKAGE_MANAGERS.find((pm) => existsSync4(join5(directory, LOCKFILES[pm])));
7089
+ const manifestPath = join5(directory, "package.json");
7090
+ if (!existsSync4(manifestPath)) {
7071
7091
  throw new CodedError(
7072
7092
  "TEMPLATE_NO_MANIFEST",
7073
7093
  `The template has no package.json at its root (it has ${readdirSync2(directory).slice(0, 8).join(", ")}): point --template at the project directory`
@@ -7107,9 +7127,9 @@ function prepareTemplate(directory, options) {
7107
7127
  }
7108
7128
 
7109
7129
  // src/kit/starter.ts
7110
- import { existsSync as existsSync4, readFileSync as readFileSync4 } from "fs";
7130
+ import { existsSync as existsSync5, readFileSync as readFileSync4 } from "fs";
7111
7131
  import { mkdir as mkdir4, readdir, rm as rm2 } from "fs/promises";
7112
- import { join as join5, relative, resolve as resolve3 } from "path";
7132
+ import { join as join6, relative, resolve as resolve3 } from "path";
7113
7133
  async function finish2(directory, packageManager, options) {
7114
7134
  const log2 = options.log ?? silentLogger;
7115
7135
  let install = { status: "skipped", reason: "install was turned off" };
@@ -7180,7 +7200,7 @@ async function createFromTemplate(template, options) {
7180
7200
  const log2 = options.log ?? silentLogger;
7181
7201
  const directory = resolve3(options.directory);
7182
7202
  assertEmptyDirectory(directory);
7183
- const existed = existsSync4(directory);
7203
+ const existed = existsSync5(directory);
7184
7204
  log2.start(`Downloading ${describeTemplate(template)}`);
7185
7205
  let downloaded;
7186
7206
  let prepared;
@@ -7194,7 +7214,7 @@ async function createFromTemplate(template, options) {
7194
7214
  log2.fail(`Could not use ${describeTemplate(template)}`);
7195
7215
  if (existed) {
7196
7216
  for (const entry of await readdir(directory)) {
7197
- await rm2(join5(directory, entry), { recursive: true, force: true });
7217
+ await rm2(join6(directory, entry), { recursive: true, force: true });
7198
7218
  }
7199
7219
  } else {
7200
7220
  await rm2(directory, { recursive: true, force: true });
@@ -7213,7 +7233,7 @@ async function createFromTemplate(template, options) {
7213
7233
  ...downloaded.skipped.length > 0 ? [`Left out links and special files: ${downloaded.skipped.join(", ")}`] : []
7214
7234
  ];
7215
7235
  const { install, git } = await finish2(directory, packageManager, options);
7216
- const manifest = JSON.parse(readFileSync4(join5(directory, "package.json"), "utf-8"));
7236
+ const manifest = JSON.parse(readFileSync4(join6(directory, "package.json"), "utf-8"));
7217
7237
  return {
7218
7238
  directory,
7219
7239
  source: describeTemplate(template),
@@ -7226,7 +7246,7 @@ async function createFromTemplate(template, options) {
7226
7246
  packageManager,
7227
7247
  manifest.scripts ?? {},
7228
7248
  install.status === "done",
7229
- existsSync4(join5(directory, ".env.example"))
7249
+ existsSync5(join6(directory, ".env.example"))
7230
7250
  ),
7231
7251
  notes
7232
7252
  };
@@ -7529,9 +7549,10 @@ function describeKeyCheck(envKey, check) {
7529
7549
  }
7530
7550
 
7531
7551
  // src/kit/telemetry.ts
7532
- import { existsSync as existsSync5, mkdirSync as mkdirSync2, writeFileSync as writeFileSync3 } from "fs";
7552
+ import { existsSync as existsSync6, mkdirSync as mkdirSync2, writeFileSync as writeFileSync3 } from "fs";
7533
7553
  import { homedir } from "os";
7534
- import { join as join6 } from "path";
7554
+ import { join as join7 } from "path";
7555
+ import { z as z2 } from "zod";
7535
7556
  var TELEMETRY_HOST = "https://analytics.el1fe.com";
7536
7557
  var TELEMETRY_DOCS = "https://cogitator.app/docs/getting-started/telemetry";
7537
7558
  var SEND_TIMEOUT_MS = 1500;
@@ -7551,6 +7572,20 @@ var PAYLOAD_FIELDS = [
7551
7572
  "failedStep",
7552
7573
  "errorCode"
7553
7574
  ];
7575
+ var VALUE = z2.string().regex(/^[\w.,-]{0,100}$/);
7576
+ var PAYLOAD_SCHEMA = z2.strictObject({
7577
+ version: VALUE,
7578
+ preset: VALUE,
7579
+ provider: VALUE,
7580
+ memory: VALUE,
7581
+ features: VALUE,
7582
+ packageManager: VALUE,
7583
+ node: VALUE,
7584
+ os: VALUE,
7585
+ outcome: z2.enum(["success", "failure"]),
7586
+ failedStep: z2.enum(["none", "create", "install"]),
7587
+ errorCode: VALUE
7588
+ });
7554
7589
  var SAFE_CODE = /^[A-Z][A-Z0-9_]{1,63}$/;
7555
7590
  function telemetryErrorCode(error) {
7556
7591
  let kind;
@@ -7597,12 +7632,12 @@ function telemetryDisabledReason(options) {
7597
7632
  return void 0;
7598
7633
  }
7599
7634
  function configDir(env) {
7600
- if (process.platform === "win32" && env.APPDATA) return join6(env.APPDATA, "cogitator");
7601
- return join6(env.XDG_CONFIG_HOME || join6(homedir(), ".config"), "cogitator");
7635
+ if (process.platform === "win32" && env.APPDATA) return join7(env.APPDATA, "cogitator");
7636
+ return join7(env.XDG_CONFIG_HOME || join7(homedir(), ".config"), "cogitator");
7602
7637
  }
7603
7638
  function firstRunNotice(env = process.env) {
7604
- const marker = join6(configDir(env), "telemetry-notice");
7605
- if (existsSync5(marker)) return void 0;
7639
+ const marker = join7(configDir(env), "telemetry-notice");
7640
+ if (existsSync6(marker)) return void 0;
7606
7641
  try {
7607
7642
  mkdirSync2(configDir(env), { recursive: true });
7608
7643
  writeFileSync3(marker, `${(/* @__PURE__ */ new Date()).toISOString()}
@@ -7623,14 +7658,17 @@ function telemetryUserAgent(payload) {
7623
7658
  async function sendTelemetry(payload, options = {}) {
7624
7659
  const website = options.websiteId ?? telemetryWebsiteId();
7625
7660
  if (!website) return false;
7661
+ const parsed = PAYLOAD_SCHEMA.safeParse(payload);
7662
+ if (!parsed.success) return false;
7663
+ const data = parsed.data;
7626
7664
  const body = {
7627
7665
  type: "event",
7628
7666
  payload: {
7629
7667
  website,
7630
7668
  hostname: "create-cogitator-app",
7631
- url: `/scaffold/${payload.preset}`,
7669
+ url: `/scaffold/${data.preset}`,
7632
7670
  name: "scaffold",
7633
- data: payload
7671
+ data
7634
7672
  }
7635
7673
  };
7636
7674
  try {
@@ -7638,7 +7676,7 @@ async function sendTelemetry(payload, options = {}) {
7638
7676
  method: "POST",
7639
7677
  headers: {
7640
7678
  "content-type": "application/json",
7641
- "user-agent": telemetryUserAgent(payload)
7679
+ "user-agent": telemetryUserAgent(data)
7642
7680
  },
7643
7681
  body: JSON.stringify(body),
7644
7682
  signal: AbortSignal.timeout(options.timeoutMs ?? SEND_TIMEOUT_MS)
@@ -7921,16 +7959,16 @@ function exampleList() {
7921
7959
  }
7922
7960
 
7923
7961
  // src/cli/interactive.ts
7924
- import { existsSync as existsSync6 } from "fs";
7962
+ import { existsSync as existsSync7 } from "fs";
7925
7963
  import { homedir as homedir2 } from "os";
7926
- import { join as join7 } from "path";
7964
+ import { join as join8 } from "path";
7927
7965
  import * as p from "@clack/prompts";
7928
7966
 
7929
7967
  // src/cli/resolve.ts
7930
- import { basename, resolve as resolve4 } from "path";
7968
+ import { basename as basename2, resolve as resolve4 } from "path";
7931
7969
  var DEFAULT_DIRECTORY = "my-agents";
7932
7970
  function projectNameFromDirectory(directory, cwd = process.cwd()) {
7933
- return basename(resolve4(cwd, directory.trim()));
7971
+ return basename2(resolve4(cwd, directory.trim()));
7934
7972
  }
7935
7973
  function resolveDirectory(directory, cwd = process.cwd()) {
7936
7974
  const name = projectNameFromDirectory(directory, cwd);
@@ -7986,7 +8024,7 @@ function detectCodingAgents(home = homedir2()) {
7986
8024
  codex: ".codex"
7987
8025
  };
7988
8026
  return CODING_AGENT_CHOICES.map((choice) => choice.value).filter(
7989
- (agent) => existsSync6(join7(home, markers[agent]))
8027
+ (agent) => existsSync7(join8(home, markers[agent]))
7990
8028
  );
7991
8029
  }
7992
8030
  async function askDirectory() {