create-bk-agent 0.20.1 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- 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,5 +1,7 @@
|
|
|
1
1
|
# create-bk-agent
|
|
2
2
|
|
|
3
|
+
**Status: stable** — works and is maintained; will not be expanded during the pilot phase.
|
|
4
|
+
|
|
3
5
|
Scaffold a new [BackendKit agent](https://github.com/BackendKit-labs/backendkit-agent-framework) project in seconds — or add capabilities to an existing one.
|
|
4
6
|
|
|
5
7
|
## Create a project
|
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) {
|