create-bk-agent 0.20.1 → 0.21.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/README.md +194 -132
- package/dist/src/index.js +12 -0
- package/dist/src/prompts.js +11 -2
- package/dist/src/scaffold.js +13 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,208 +1,270 @@
|
|
|
1
1
|
# create-bk-agent
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
CLI scaffolding tool for the BackendKit Labs agent framework. Generates a fully configured TypeScript agent project in seconds — choose your architecture, deployment mode, and LLM provider, and get a working project with all dependencies wired.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Usage
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
The CLI asks three questions and generates a production-ready project:
|
|
8
|
+
npm create bk-agent@latest my-agent
|
|
9
|
+
cd my-agent && npm install && npm run dev
|
|
12
10
|
|
|
11
|
+
# Or with npx:
|
|
12
|
+
npx create-bk-agent my-agent
|
|
13
13
|
```
|
|
14
|
-
✨ create-bk-agent v0.20.0
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
? Architecture: Multi-agent (orchestrator + specialists)
|
|
18
|
-
? Skill packs: Node.js / TypeScript
|
|
19
|
-
? How will it be used? MCP Server (HTTP)
|
|
15
|
+
---
|
|
20
16
|
|
|
21
|
-
|
|
22
|
-
Installing dependencies...
|
|
17
|
+
## Interactive setup
|
|
23
18
|
|
|
24
|
-
|
|
19
|
+
The CLI asks three questions:
|
|
25
20
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
1. **Architecture** — what kind of agent?
|
|
22
|
+
2. **Deploy mode** — how will it be used?
|
|
23
|
+
3. **Provider** — which LLM API?
|
|
24
|
+
|
|
25
|
+
---
|
|
30
26
|
|
|
31
27
|
## Architectures
|
|
32
28
|
|
|
33
|
-
|
|
34
|
-
|---|---|---|
|
|
35
|
-
| `multi-agent` | Orchestrator + specialists with delegation | Domain agents (DevOps, finance, data, etc.) |
|
|
36
|
-
| `single` | One agent with a tool registry | Simple task automation |
|
|
37
|
-
| `coding` | 10 pre-built agents + all coding tools | Coding assistants, ready out of the box |
|
|
38
|
-
| `autonomous` | Trigger system (cron / webhook / event) | Scheduled or event-driven daemons |
|
|
39
|
-
| `minimal` | Bare engine, no entry point | Library embedding |
|
|
29
|
+
### `multi-agent` — Multi-agent orchestrator
|
|
40
30
|
|
|
41
|
-
|
|
31
|
+
A routing orchestrator that delegates tasks to specialized sub-agents. Best for complex domains with distinct request types.
|
|
42
32
|
|
|
43
|
-
|
|
33
|
+
```
|
|
34
|
+
src/
|
|
35
|
+
├── agents/ ← agent profiles (JSON)
|
|
36
|
+
├── tools/ ← typed tool definitions
|
|
37
|
+
├── orchestrator.ts ← routes requests to sub-agents
|
|
38
|
+
└── index.ts
|
|
39
|
+
```
|
|
44
40
|
|
|
45
|
-
|
|
46
|
-
|---|---|---|
|
|
47
|
-
| `repl` | `src/index.ts` — readline loop | Local terminal tool |
|
|
48
|
-
| `mcp-http` | `src/server.ts` — HTTP MCP server | Connect to Claude Desktop, Cursor, etc. |
|
|
49
|
-
| `mcp-stdio` | `src/server.ts` — stdio MCP server | Subprocess / pipe-based MCP |
|
|
50
|
-
| `hybrid` | Both `index.ts` + `server.ts` | REPL for dev, server for production |
|
|
51
|
-
| `library` | Only `src/engine.ts` exported | Import the engine in your own app |
|
|
41
|
+
**Use case:** A customer platform with separate agents for billing, support, and account management.
|
|
52
42
|
|
|
53
|
-
|
|
43
|
+
### `single` — Single-agent assistant
|
|
54
44
|
|
|
55
|
-
|
|
45
|
+
One agent with a custom system prompt and your tools.
|
|
56
46
|
|
|
57
|
-
|
|
47
|
+
```
|
|
48
|
+
src/
|
|
49
|
+
├── tools/
|
|
50
|
+
├── agent.ts
|
|
51
|
+
└── index.ts
|
|
52
|
+
```
|
|
58
53
|
|
|
59
|
-
|
|
54
|
+
### `coding` — Coding assistant
|
|
60
55
|
|
|
61
|
-
|
|
62
|
-
|---|---|---|
|
|
63
|
-
| `LLM_MODEL` | `gpt-4o` | Base model — used by all agents unless overridden |
|
|
64
|
-
| `LLM_MODEL_FAST` | `LLM_MODEL` | Execution agents (specialists, tool-calling loops) |
|
|
65
|
-
| `LLM_MODEL_SMART` | `LLM_MODEL` | Routing agents (orchestrator, reasoning-heavy tasks) |
|
|
56
|
+
Pre-configured with 10 coding agents, filesystem tools, persistent memory, and stack detection. Ready to use immediately.
|
|
66
57
|
|
|
67
|
-
|
|
58
|
+
```
|
|
59
|
+
src/
|
|
60
|
+
└── index.ts ← createCodingEngine() + readline REPL
|
|
61
|
+
AGENT.md ← project context injected into every LLM call
|
|
62
|
+
```
|
|
68
63
|
|
|
69
|
-
|
|
64
|
+
**Use case:** A project-specific coding assistant with your team's conventions in `AGENT.md`.
|
|
70
65
|
|
|
71
|
-
|
|
72
|
-
LLM_API_KEY=sk-...
|
|
73
|
-
LLM_BASE_URL=https://api.deepseek.com/v1
|
|
74
|
-
LLM_MODEL=deepseek-chat
|
|
75
|
-
LLM_MODEL_FAST=deepseek-chat
|
|
76
|
-
LLM_MODEL_SMART=deepseek-reasoner
|
|
77
|
-
```
|
|
66
|
+
### `autonomous` — Autonomous daemon
|
|
78
67
|
|
|
79
|
-
|
|
68
|
+
Runs on a schedule without user interaction. Pre-wired with `createAutonomousAgent` + cron trigger.
|
|
80
69
|
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
...
|
|
87
|
-
};
|
|
70
|
+
```
|
|
71
|
+
src/
|
|
72
|
+
├── triggers/
|
|
73
|
+
├── tools/
|
|
74
|
+
└── index.ts ← cron + event loop
|
|
88
75
|
```
|
|
89
76
|
|
|
90
|
-
|
|
77
|
+
**Use case:** Nightly reports, daily standups, automated monitoring.
|
|
91
78
|
|
|
92
|
-
|
|
79
|
+
### `minimal` — Minimal / embedded
|
|
93
80
|
|
|
94
|
-
|
|
81
|
+
Bare-bones template — just `AgentEngine`, one tool, one agent. Use when embedding an agent into an existing application or building a library.
|
|
95
82
|
|
|
96
|
-
```
|
|
97
|
-
|
|
83
|
+
```
|
|
84
|
+
src/
|
|
85
|
+
└── index.ts ← AgentEngine, bare minimum
|
|
98
86
|
```
|
|
99
87
|
|
|
100
|
-
### `
|
|
88
|
+
### `enterprise` — Enterprise (local LLM + RAG)
|
|
101
89
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
90
|
+
Full enterprise setup: Ollama LLM, Obsidian vault as knowledge base, six department agents (General, Support, HR, Sales, Finance, Ops), VaultWriter, and optionally an `AgentServer` web server.
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
src/
|
|
94
|
+
├── server.ts ← createEnterpriseSetup() + AgentServer
|
|
95
|
+
└── agents/ ← 6 department profiles
|
|
96
|
+
.env.example ← VAULT_PATH, JWT_SECRET, PORT, OLLAMA_HOST
|
|
105
97
|
```
|
|
106
98
|
|
|
107
|
-
|
|
108
|
-
- Adds `@backendkit-labs/mcp-server` to `dependencies`
|
|
109
|
-
- Adds `"server"` script to `package.json`
|
|
99
|
+
---
|
|
110
100
|
|
|
111
|
-
|
|
101
|
+
## Deploy modes
|
|
112
102
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
103
|
+
| Mode | Description |
|
|
104
|
+
|------|-------------|
|
|
105
|
+
| `repl` | Terminal REPL — stdin/stdout |
|
|
106
|
+
| `mcp-stdio` | MCP server over stdio (for Claude Desktop, agent-core) |
|
|
107
|
+
| `mcp-http` | MCP server over HTTP (`npm run server`) |
|
|
108
|
+
| `hybrid` | REPL + MCP server side-by-side |
|
|
109
|
+
| `library` | Exports an engine factory, no I/O |
|
|
110
|
+
| `web` | Fastify web server — chat + kanban (enterprise only) |
|
|
117
111
|
|
|
118
|
-
|
|
119
|
-
- Patches `src/engine.ts`: adds the import and `agents.register()`
|
|
112
|
+
---
|
|
120
113
|
|
|
121
|
-
|
|
114
|
+
## Provider options
|
|
122
115
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
116
|
+
| Provider | Required env var |
|
|
117
|
+
|----------|-----------------|
|
|
118
|
+
| DeepSeek | `DEEPSEEK_API_KEY` |
|
|
119
|
+
| OpenAI | `OPENAI_API_KEY` |
|
|
120
|
+
| Anthropic | `ANTHROPIC_API_KEY` |
|
|
121
|
+
| Ollama (local) | *(none — requires `ollama serve`)* |
|
|
127
122
|
|
|
128
|
-
|
|
129
|
-
- Patches `src/engine.ts`: adds the import and `tools.register()`
|
|
123
|
+
The scaffolded `.env.example` lists all required variables.
|
|
130
124
|
|
|
131
|
-
|
|
125
|
+
---
|
|
132
126
|
|
|
133
|
-
|
|
134
|
-
npx create-bk-agent add mcp-client http://localhost:3001/mcp
|
|
135
|
-
npx create-bk-agent add mcp-client http://billing-agent/mcp --name billing
|
|
136
|
-
```
|
|
127
|
+
## Scaffolded project structure
|
|
137
128
|
|
|
138
|
-
|
|
139
|
-
- Creates the `mcpServers` array if it doesn't exist yet
|
|
129
|
+
### Coding assistant (simplest)
|
|
140
130
|
|
|
141
|
-
|
|
131
|
+
```
|
|
132
|
+
my-agent/
|
|
133
|
+
├── src/
|
|
134
|
+
│ └── index.ts ← createCodingEngine() + readline REPL
|
|
135
|
+
├── AGENT.md ← project context (edit this!)
|
|
136
|
+
├── package.json
|
|
137
|
+
├── tsconfig.json
|
|
138
|
+
└── .env.example
|
|
139
|
+
```
|
|
142
140
|
|
|
143
|
-
|
|
141
|
+
**`AGENT.md`** is injected into every LLM call. Describe your project, stack, and conventions:
|
|
144
142
|
|
|
145
|
-
|
|
143
|
+
```markdown
|
|
144
|
+
# My Project
|
|
146
145
|
|
|
147
|
-
|
|
146
|
+
## Tech stack
|
|
147
|
+
Node.js 20, TypeScript 5, Express 4, PostgreSQL 15
|
|
148
148
|
|
|
149
|
-
|
|
149
|
+
## Conventions
|
|
150
|
+
- All functions must have JSDoc
|
|
151
|
+
- Tests use Jest + Supertest
|
|
152
|
+
- Never use `any` — use `unknown`
|
|
150
153
|
|
|
151
|
-
|
|
154
|
+
## Architecture
|
|
155
|
+
REST API with repository pattern. DB access only via src/repositories/.
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Enterprise web server (most complete)
|
|
152
159
|
|
|
153
160
|
```
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
/
|
|
161
|
+
my-agent/
|
|
162
|
+
├── src/
|
|
163
|
+
│ ├── server.ts ← createEnterpriseSetup() + AgentServer
|
|
164
|
+
│ └── agents/ ← 6 department profiles
|
|
165
|
+
├── .env.example ← VAULT_PATH, OLLAMA_HOST, JWT_SECRET, PORT
|
|
166
|
+
├── package.json ← agent-enterprise + agent-web
|
|
167
|
+
└── tsconfig.json
|
|
158
168
|
```
|
|
159
169
|
|
|
160
|
-
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## Examples
|
|
161
173
|
|
|
162
|
-
###
|
|
174
|
+
### Coding assistant
|
|
163
175
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
| `/workspace add <ws> <cwd> [name]` | Add a project |
|
|
168
|
-
| `/workspace import <cwd> [ws] [name]` | Add project (auto-creates workspace) |
|
|
169
|
-
| `/workspace switch <ws> [project]` | Switch to workspace (uses shared root if configured) |
|
|
170
|
-
| `/workspace set-root <ws> [path]` | Set shared root manually (auto-detected if no path) |
|
|
171
|
-
| `/workspace remove <ws> <project>` | Remove a project |
|
|
172
|
-
| `/workspace delete <name>` | Delete workspace |
|
|
173
|
-
| `/workspace list` | List all workspaces |
|
|
176
|
+
```bash
|
|
177
|
+
npx create-bk-agent my-dev-assistant
|
|
178
|
+
# → coding → repl → deepseek
|
|
174
179
|
|
|
175
|
-
|
|
180
|
+
cd my-dev-assistant
|
|
181
|
+
cp .env.example .env
|
|
182
|
+
# Edit .env: add DEEPSEEK_API_KEY
|
|
176
183
|
|
|
177
|
-
|
|
184
|
+
# Describe your project
|
|
185
|
+
nano AGENT.md
|
|
178
186
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
├── auth-service/
|
|
182
|
-
├── api-gateway/
|
|
183
|
-
└── user-service/
|
|
187
|
+
npm install && npm run dev
|
|
188
|
+
# > What can I help with?
|
|
184
189
|
```
|
|
185
190
|
|
|
186
|
-
|
|
191
|
+
### Enterprise on-premises assistant
|
|
187
192
|
|
|
193
|
+
```bash
|
|
194
|
+
npx create-bk-agent company-assistant
|
|
195
|
+
# → enterprise → web → ollama
|
|
196
|
+
|
|
197
|
+
cd company-assistant
|
|
198
|
+
cp .env.example .env
|
|
199
|
+
# Edit .env: VAULT_PATH=/path/to/obsidian-vault
|
|
200
|
+
|
|
201
|
+
ollama serve
|
|
202
|
+
ollama pull llama3.2
|
|
203
|
+
ollama pull nomic-embed-text
|
|
204
|
+
|
|
205
|
+
npm install && npm run dev
|
|
206
|
+
# → Indexing vault...
|
|
207
|
+
# → Server running on :4001
|
|
208
|
+
# Chat: http://localhost:4001/
|
|
209
|
+
# Kanban: http://localhost:4001/#kanban
|
|
188
210
|
```
|
|
189
|
-
|
|
190
|
-
|
|
211
|
+
|
|
212
|
+
### Autonomous cron agent
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
npx create-bk-agent standup-bot
|
|
216
|
+
# → autonomous → repl → deepseek
|
|
217
|
+
|
|
218
|
+
cd standup-bot
|
|
219
|
+
# Edit src/triggers/index.ts: schedule, prompt, output
|
|
220
|
+
npm install && npm run dev
|
|
191
221
|
```
|
|
192
222
|
|
|
193
|
-
|
|
223
|
+
### MCP server exposing your tools
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
npx create-bk-agent my-tools-server
|
|
227
|
+
# → single → mcp-http → openai
|
|
194
228
|
|
|
229
|
+
cd my-tools-server
|
|
230
|
+
# Add tools to src/tools/
|
|
231
|
+
# Add agent to src/agents/
|
|
232
|
+
npm install && npm run server # MCP server on :3000
|
|
195
233
|
```
|
|
196
|
-
|
|
234
|
+
|
|
235
|
+
Claude Desktop config:
|
|
236
|
+
|
|
237
|
+
```json
|
|
238
|
+
{
|
|
239
|
+
"mcpServers": {
|
|
240
|
+
"my-tools": {
|
|
241
|
+
"command": "npx",
|
|
242
|
+
"args": ["-y", "my-tools-server"]
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
197
246
|
```
|
|
198
247
|
|
|
199
248
|
---
|
|
200
249
|
|
|
201
|
-
##
|
|
250
|
+
## `bk add` command
|
|
251
|
+
|
|
252
|
+
After scaffolding, add new components to your project:
|
|
253
|
+
|
|
254
|
+
```bash
|
|
255
|
+
bk add tool lookup-order # creates src/tools/lookup-order.ts
|
|
256
|
+
bk add agent billing # creates src/agents/billing.json
|
|
257
|
+
bk add trigger daily-report # adds a cron trigger
|
|
258
|
+
```
|
|
202
259
|
|
|
203
|
-
|
|
204
|
-
- An API key for your chosen provider (Anthropic, OpenAI, DeepSeek, or Ollama)
|
|
260
|
+
---
|
|
205
261
|
|
|
206
|
-
##
|
|
262
|
+
## Scripts in scaffolded projects
|
|
207
263
|
|
|
208
|
-
|
|
264
|
+
| Script | Description |
|
|
265
|
+
|--------|-------------|
|
|
266
|
+
| `npm run dev` | Development with tsx / ts-node |
|
|
267
|
+
| `npm run build` | Compile TypeScript |
|
|
268
|
+
| `npm run start` | Run compiled output |
|
|
269
|
+
| `npm run server` | Start MCP or web server |
|
|
270
|
+
| `npm run typecheck` | TypeScript type-check only |
|
package/dist/src/index.js
CHANGED
|
@@ -65,6 +65,7 @@ function describeChoices(choices) {
|
|
|
65
65
|
'mcp-stdio': 'MCP Server (stdio)',
|
|
66
66
|
hybrid: 'REPL + MCP Server',
|
|
67
67
|
library: 'Library',
|
|
68
|
+
web: 'Web Server (chat + kanban)',
|
|
68
69
|
};
|
|
69
70
|
const archLabel = arch[choices.architecture] ?? choices.architecture;
|
|
70
71
|
if (!choices.deployMode)
|
|
@@ -83,6 +84,17 @@ function buildNextSteps(choices) {
|
|
|
83
84
|
return ['Implement your LLM provider in src/index.ts', 'npm run dev'];
|
|
84
85
|
// Enterprise — local LLM + RAG
|
|
85
86
|
if (arch === 'enterprise') {
|
|
87
|
+
if (mode === 'web') {
|
|
88
|
+
return [
|
|
89
|
+
'Make sure Ollama is running: ollama serve',
|
|
90
|
+
'Pull model: ollama pull llama3.2',
|
|
91
|
+
'Review vault path in .env (VAULT_PATH)',
|
|
92
|
+
'npm run dev # indexes vault + starts server on :4001',
|
|
93
|
+
'# Chat: http://localhost:4001/',
|
|
94
|
+
'# Kanban: http://localhost:4001/#kanban',
|
|
95
|
+
'# Monitor: ws://localhost:4001/monitor',
|
|
96
|
+
];
|
|
97
|
+
}
|
|
86
98
|
return [
|
|
87
99
|
'Make sure Ollama is running: ollama serve',
|
|
88
100
|
'Pull required models: ollama pull llama3.2 && ollama pull nomic-embed-text',
|
package/dist/src/prompts.js
CHANGED
|
@@ -45,7 +45,7 @@ const SKILL_PACK_CHOICES = [
|
|
|
45
45
|
{ title: p('Go', 24) + 'go test, golangci-lint', value: 'go' },
|
|
46
46
|
{ title: p('Docker / K8s', 24) + 'docker, kubectl, helm', value: 'docker' },
|
|
47
47
|
];
|
|
48
|
-
const
|
|
48
|
+
const DEPLOY_MODE_CHOICES_BASE = [
|
|
49
49
|
{
|
|
50
50
|
title: p('Terminal REPL', 28) + 'Humans type requests, agent responds in the terminal',
|
|
51
51
|
value: 'repl',
|
|
@@ -68,6 +68,15 @@ const DEPLOY_MODE_CHOICES = [
|
|
|
68
68
|
value: 'library',
|
|
69
69
|
},
|
|
70
70
|
];
|
|
71
|
+
const WEB_DEPLOY_CHOICE = {
|
|
72
|
+
title: p('Web server', 28) + 'WebSocket chat + kanban monitor UI on port 4001',
|
|
73
|
+
value: 'web',
|
|
74
|
+
description: 'Serves @backendkit-labs/agent-web with all 6 enterprise departments',
|
|
75
|
+
};
|
|
76
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
77
|
+
const deployChoices = (_prev, v) => v.architecture === 'enterprise'
|
|
78
|
+
? [...DEPLOY_MODE_CHOICES_BASE, WEB_DEPLOY_CHOICE]
|
|
79
|
+
: DEPLOY_MODE_CHOICES_BASE;
|
|
71
80
|
const PROVIDER_CHOICES = [
|
|
72
81
|
{ title: p('Anthropic (Claude)', 32) + 'claude-sonnet-4-6 recommended', value: 'anthropic' },
|
|
73
82
|
{ title: p('OpenAI', 32) + 'gpt-4o recommended', value: 'openai' },
|
|
@@ -115,7 +124,7 @@ async function askQuestions(defaultName) {
|
|
|
115
124
|
type: whenDeploy,
|
|
116
125
|
name: 'deployMode',
|
|
117
126
|
message: 'How will this agent be used?',
|
|
118
|
-
choices:
|
|
127
|
+
choices: deployChoices,
|
|
119
128
|
initial: 0,
|
|
120
129
|
},
|
|
121
130
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
package/dist/src/scaffold.js
CHANGED
|
@@ -77,6 +77,11 @@ const DEPLOY_SCRIPTS = {
|
|
|
77
77
|
delete s['server'];
|
|
78
78
|
},
|
|
79
79
|
// hybrid: keep both dev (REPL) and server (MCP) — no changes
|
|
80
|
+
web: (s) => {
|
|
81
|
+
s['dev'] = 'ts-node src/server.ts';
|
|
82
|
+
s['start'] = 'node dist/server.js';
|
|
83
|
+
delete s['server'];
|
|
84
|
+
},
|
|
80
85
|
library: (s) => {
|
|
81
86
|
delete s['dev'];
|
|
82
87
|
delete s['server'];
|
|
@@ -84,6 +89,7 @@ const DEPLOY_SCRIPTS = {
|
|
|
84
89
|
},
|
|
85
90
|
};
|
|
86
91
|
const MCP_DEPLOY_MODES = ['mcp-http', 'mcp-stdio', 'hybrid'];
|
|
92
|
+
const WEB_DEPLOY_MODES = ['web'];
|
|
87
93
|
function patchPackageJson(dir, projectName, deployMode) {
|
|
88
94
|
const pkgPath = path.join(dir, 'package.json');
|
|
89
95
|
if (!fs.existsSync(pkgPath))
|
|
@@ -98,6 +104,10 @@ function patchPackageJson(dir, projectName, deployMode) {
|
|
|
98
104
|
pkg.dependencies ??= {};
|
|
99
105
|
pkg.dependencies['@backendkit-labs/mcp-server'] ??= '^0.15.0';
|
|
100
106
|
}
|
|
107
|
+
if (deployMode && WEB_DEPLOY_MODES.includes(deployMode)) {
|
|
108
|
+
pkg.dependencies ??= {};
|
|
109
|
+
pkg.dependencies['@backendkit-labs/agent-web'] ??= '^0.1.0';
|
|
110
|
+
}
|
|
101
111
|
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n');
|
|
102
112
|
}
|
|
103
113
|
// ── Write .env stub ───────────────────────────────────────────────────────────
|
|
@@ -165,10 +175,10 @@ function scaffold(choices, targetDir) {
|
|
|
165
175
|
// 2. Deploy layer — overlaid on top of base (layered architectures only)
|
|
166
176
|
if (isLayered && choices.deployMode && choices.deployMode !== 'library') {
|
|
167
177
|
const deployDir = path.join(DEPLOY_DIR, choices.deployMode);
|
|
168
|
-
if (
|
|
169
|
-
|
|
178
|
+
if (fs.existsSync(deployDir)) {
|
|
179
|
+
copyDir(deployDir, targetDir);
|
|
170
180
|
}
|
|
171
|
-
|
|
181
|
+
// No directory = base template already covers this mode
|
|
172
182
|
}
|
|
173
183
|
// 3. Skill packs — appended to engine.ts
|
|
174
184
|
for (const pack of choices.skillPacks) {
|