@backendkit-labs/agent-coding 0.29.0 → 0.30.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 +4 -0
- package/dist/__tests__/cli-baseline.test.d.ts +2 -0
- package/dist/__tests__/cli-baseline.test.d.ts.map +1 -0
- package/dist/__tests__/cli-baseline.test.js +114 -0
- package/dist/__tests__/cli-baseline.test.js.map +1 -0
- package/dist/__tests__/createCodingEngine.forwarding.test.js +2 -1
- package/dist/__tests__/createCodingEngine.forwarding.test.js.map +1 -1
- package/dist/__tests__/workspace-trust.test.js +7 -5
- package/dist/__tests__/workspace-trust.test.js.map +1 -1
- package/dist/agents/AgentLoader.d.ts.map +1 -1
- package/dist/agents/AgentLoader.js +2 -1
- package/dist/agents/AgentLoader.js.map +1 -1
- package/dist/cli/agent-discovery/AgentPackageLoader.d.ts +22 -0
- package/dist/cli/agent-discovery/AgentPackageLoader.d.ts.map +1 -0
- package/dist/cli/agent-discovery/AgentPackageLoader.js +100 -0
- package/dist/cli/agent-discovery/AgentPackageLoader.js.map +1 -0
- package/dist/cli/agent-discovery/RemoteAgentRegistry.d.ts +31 -0
- package/dist/cli/agent-discovery/RemoteAgentRegistry.d.ts.map +1 -0
- package/dist/cli/agent-discovery/RemoteAgentRegistry.js +106 -0
- package/dist/cli/agent-discovery/RemoteAgentRegistry.js.map +1 -0
- package/dist/cli/agent-discovery/__tests__/RemoteAgentRegistry.ssrf.test.d.ts +2 -0
- package/dist/cli/agent-discovery/__tests__/RemoteAgentRegistry.ssrf.test.d.ts.map +1 -0
- package/dist/cli/agent-discovery/__tests__/RemoteAgentRegistry.ssrf.test.js +34 -0
- package/dist/cli/agent-discovery/__tests__/RemoteAgentRegistry.ssrf.test.js.map +1 -0
- package/dist/cli/agent-discovery/__tests__/discoverAgents.test.d.ts +2 -0
- package/dist/cli/agent-discovery/__tests__/discoverAgents.test.d.ts.map +1 -0
- package/dist/cli/agent-discovery/__tests__/discoverAgents.test.js +147 -0
- package/dist/cli/agent-discovery/__tests__/discoverAgents.test.js.map +1 -0
- package/dist/cli/agent-discovery/__tests__/download-guard.test.d.ts +2 -0
- package/dist/cli/agent-discovery/__tests__/download-guard.test.d.ts.map +1 -0
- package/dist/cli/agent-discovery/__tests__/download-guard.test.js +47 -0
- package/dist/cli/agent-discovery/__tests__/download-guard.test.js.map +1 -0
- package/dist/cli/agent-discovery/discoverAgents.d.ts +21 -0
- package/dist/cli/agent-discovery/discoverAgents.d.ts.map +1 -0
- package/dist/cli/agent-discovery/discoverAgents.js +74 -0
- package/dist/cli/agent-discovery/discoverAgents.js.map +1 -0
- package/dist/cli/agent-discovery/download-guard.d.ts +20 -0
- package/dist/cli/agent-discovery/download-guard.d.ts.map +1 -0
- package/dist/cli/agent-discovery/download-guard.js +84 -0
- package/dist/cli/agent-discovery/download-guard.js.map +1 -0
- package/dist/cli/agent-discovery/index.d.ts +5 -0
- package/dist/cli/agent-discovery/index.d.ts.map +1 -0
- package/dist/cli/agent-discovery/index.js +12 -0
- package/dist/cli/agent-discovery/index.js.map +1 -0
- package/dist/cli/agent-discovery/types.d.ts +48 -0
- package/dist/cli/agent-discovery/types.d.ts.map +1 -0
- package/dist/cli/agent-discovery/types.js +3 -0
- package/dist/cli/agent-discovery/types.js.map +1 -0
- package/dist/cli/bootstrap/GlobalSeed.d.ts +46 -0
- package/dist/cli/bootstrap/GlobalSeed.d.ts.map +1 -0
- package/dist/cli/bootstrap/GlobalSeed.js +285 -0
- package/dist/cli/bootstrap/GlobalSeed.js.map +1 -0
- package/dist/cli/bootstrap/config.d.ts +24 -0
- package/dist/cli/bootstrap/config.d.ts.map +1 -0
- package/dist/cli/bootstrap/config.js +71 -0
- package/dist/cli/bootstrap/config.js.map +1 -0
- package/dist/cli/checkpoint/index.d.ts +17 -0
- package/dist/cli/checkpoint/index.d.ts.map +1 -0
- package/dist/cli/checkpoint/index.js +207 -0
- package/dist/cli/checkpoint/index.js.map +1 -0
- package/dist/cli/commands/builtin.d.ts +7 -0
- package/dist/cli/commands/builtin.d.ts.map +1 -0
- package/dist/cli/commands/builtin.js +962 -0
- package/dist/cli/commands/builtin.js.map +1 -0
- package/dist/cli/context/__tests__/formatPipeline.test.d.ts +2 -0
- package/dist/cli/context/__tests__/formatPipeline.test.d.ts.map +1 -0
- package/dist/cli/context/__tests__/formatPipeline.test.js +25 -0
- package/dist/cli/context/__tests__/formatPipeline.test.js.map +1 -0
- package/dist/cli/context/index.d.ts +8 -0
- package/dist/cli/context/index.d.ts.map +1 -0
- package/dist/cli/context/index.js +8 -0
- package/dist/cli/context/index.js.map +1 -0
- package/dist/cli/context/pipeline.d.ts +46 -0
- package/dist/cli/context/pipeline.d.ts.map +1 -0
- package/dist/cli/context/pipeline.js +112 -0
- package/dist/cli/context/pipeline.js.map +1 -0
- package/dist/cli/context/stages/stage-instructions.d.ts +12 -0
- package/dist/cli/context/stages/stage-instructions.d.ts.map +1 -0
- package/dist/cli/context/stages/stage-instructions.js +76 -0
- package/dist/cli/context/stages/stage-instructions.js.map +1 -0
- package/dist/cli/context/stages/stage-lessons.d.ts +13 -0
- package/dist/cli/context/stages/stage-lessons.d.ts.map +1 -0
- package/dist/cli/context/stages/stage-lessons.js +83 -0
- package/dist/cli/context/stages/stage-lessons.js.map +1 -0
- package/dist/cli/context/stages/stage-manifest.d.ts +11 -0
- package/dist/cli/context/stages/stage-manifest.d.ts.map +1 -0
- package/dist/cli/context/stages/stage-manifest.js +62 -0
- package/dist/cli/context/stages/stage-manifest.js.map +1 -0
- package/dist/cli/context/stages/stage-project.d.ts +10 -0
- package/dist/cli/context/stages/stage-project.d.ts.map +1 -0
- package/dist/cli/context/stages/stage-project.js +55 -0
- package/dist/cli/context/stages/stage-project.js.map +1 -0
- package/dist/cli/context/stages/stage-session.d.ts +12 -0
- package/dist/cli/context/stages/stage-session.d.ts.map +1 -0
- package/dist/cli/context/stages/stage-session.js +69 -0
- package/dist/cli/context/stages/stage-session.js.map +1 -0
- package/dist/cli/file-sources.d.ts +17 -0
- package/dist/cli/file-sources.d.ts.map +1 -0
- package/dist/cli/file-sources.js +42 -0
- package/dist/cli/file-sources.js.map +1 -0
- package/dist/cli/index.d.ts +26 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +55 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/skills/__tests__/SkillLoader.test.d.ts +2 -0
- package/dist/cli/skills/__tests__/SkillLoader.test.d.ts.map +1 -0
- package/dist/cli/skills/__tests__/SkillLoader.test.js +285 -0
- package/dist/cli/skills/__tests__/SkillLoader.test.js.map +1 -0
- package/dist/cli/skills/__tests__/SkillManager.safety.test.d.ts +2 -0
- package/dist/cli/skills/__tests__/SkillManager.safety.test.d.ts.map +1 -0
- package/dist/cli/skills/__tests__/SkillManager.safety.test.js +87 -0
- package/dist/cli/skills/__tests__/SkillManager.safety.test.js.map +1 -0
- package/dist/cli/skills/__tests__/stack.test.d.ts +2 -0
- package/dist/cli/skills/__tests__/stack.test.d.ts.map +1 -0
- package/dist/cli/skills/__tests__/stack.test.js +81 -0
- package/dist/cli/skills/__tests__/stack.test.js.map +1 -0
- package/dist/cli/skills/loader.d.ts +42 -0
- package/dist/cli/skills/loader.d.ts.map +1 -0
- package/dist/cli/skills/loader.js +158 -0
- package/dist/cli/skills/loader.js.map +1 -0
- package/dist/cli/skills/manager.d.ts +97 -0
- package/dist/cli/skills/manager.d.ts.map +1 -0
- package/dist/cli/skills/manager.js +304 -0
- package/dist/cli/skills/manager.js.map +1 -0
- package/dist/cli/skills/parse-md-skill.d.ts +14 -0
- package/dist/cli/skills/parse-md-skill.d.ts.map +1 -0
- package/dist/cli/skills/parse-md-skill.js +86 -0
- package/dist/cli/skills/parse-md-skill.js.map +1 -0
- package/dist/cli/skills/providers/github.d.ts +21 -0
- package/dist/cli/skills/providers/github.d.ts.map +1 -0
- package/dist/cli/skills/providers/github.js +146 -0
- package/dist/cli/skills/providers/github.js.map +1 -0
- package/dist/cli/skills/providers/index.d.ts +6 -0
- package/dist/cli/skills/providers/index.d.ts.map +1 -0
- package/dist/cli/skills/providers/index.js +12 -0
- package/dist/cli/skills/providers/index.js.map +1 -0
- package/dist/cli/skills/providers/local.d.ts +16 -0
- package/dist/cli/skills/providers/local.d.ts.map +1 -0
- package/dist/cli/skills/providers/local.js +91 -0
- package/dist/cli/skills/providers/local.js.map +1 -0
- package/dist/cli/skills/providers/obsidian.d.ts +31 -0
- package/dist/cli/skills/providers/obsidian.d.ts.map +1 -0
- package/dist/cli/skills/providers/obsidian.js +141 -0
- package/dist/cli/skills/providers/obsidian.js.map +1 -0
- package/dist/cli/skills/providers/skills-sh.d.ts +32 -0
- package/dist/cli/skills/providers/skills-sh.d.ts.map +1 -0
- package/dist/cli/skills/providers/skills-sh.js +53 -0
- package/dist/cli/skills/providers/skills-sh.js.map +1 -0
- package/dist/cli/skills/providers/types.d.ts +25 -0
- package/dist/cli/skills/providers/types.d.ts.map +1 -0
- package/dist/cli/skills/providers/types.js +3 -0
- package/dist/cli/skills/providers/types.js.map +1 -0
- package/dist/cli/skills/safe-name.d.ts +2 -0
- package/dist/cli/skills/safe-name.d.ts.map +1 -0
- package/dist/cli/skills/safe-name.js +22 -0
- package/dist/cli/skills/safe-name.js.map +1 -0
- package/dist/cli/skills/stack.d.ts +3 -0
- package/dist/cli/skills/stack.d.ts.map +1 -0
- package/dist/cli/skills/stack.js +64 -0
- package/dist/cli/skills/stack.js.map +1 -0
- package/dist/cli/skills/types.d.ts +28 -0
- package/dist/cli/skills/types.d.ts.map +1 -0
- package/dist/cli/skills/types.js +3 -0
- package/dist/cli/skills/types.js.map +1 -0
- package/dist/cli/trust/__tests__/workspace-trust.test.d.ts +2 -0
- package/dist/cli/trust/__tests__/workspace-trust.test.d.ts.map +1 -0
- package/dist/cli/trust/__tests__/workspace-trust.test.js +252 -0
- package/dist/cli/trust/__tests__/workspace-trust.test.js.map +1 -0
- package/dist/cli/trust/workspace-trust.d.ts +49 -0
- package/dist/cli/trust/workspace-trust.d.ts.map +1 -0
- package/dist/cli/trust/workspace-trust.js +163 -0
- package/dist/cli/trust/workspace-trust.js.map +1 -0
- package/dist/cli/workspace/index.d.ts +68 -0
- package/dist/cli/workspace/index.d.ts.map +1 -0
- package/dist/cli/workspace/index.js +231 -0
- package/dist/cli/workspace/index.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/dist/store/ProjectStore.d.ts.map +1 -1
- package/dist/store/ProjectStore.js +2 -1
- package/dist/store/ProjectStore.js.map +1 -1
- package/package.json +10 -2
|
@@ -0,0 +1,962 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.registerBuiltinCommands = registerBuiltinCommands;
|
|
37
|
+
const fs = __importStar(require("fs/promises"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
const child_process_1 = require("child_process");
|
|
40
|
+
const result_1 = require("@backendkit-labs/result");
|
|
41
|
+
const manager_1 = require("../skills/manager");
|
|
42
|
+
const parse_md_skill_1 = require("../skills/parse-md-skill");
|
|
43
|
+
const safe_name_1 = require("../skills/safe-name");
|
|
44
|
+
const agent_core_1 = require("@backendkit-labs/agent-core");
|
|
45
|
+
const agent_core_2 = require("@backendkit-labs/agent-core");
|
|
46
|
+
const workspace_trust_1 = require("../trust/workspace-trust");
|
|
47
|
+
const checkpoint_1 = require("../checkpoint");
|
|
48
|
+
const workspace_1 = require("../workspace");
|
|
49
|
+
// ── Internal helper ───────────────────────────────────────────────────────────
|
|
50
|
+
async function doSwitch(wsName, projectName, config, appName, emit, injectContext, onCwdChange) {
|
|
51
|
+
const ws = config[wsName];
|
|
52
|
+
if (!ws) {
|
|
53
|
+
emit(`Workspace "${wsName}" not found.`);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const target = ws.projects.find(p => p.name === projectName);
|
|
57
|
+
if (!target) {
|
|
58
|
+
emit(`Project "${projectName}" not found in workspace "${wsName}".`);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
// Persist the new active state
|
|
62
|
+
const updated = (0, workspace_1.setActiveProject)(config, wsName, target.name);
|
|
63
|
+
await (0, workspace_1.saveWorkspaces)(appName, updated);
|
|
64
|
+
// Build workspace context once — passed to both injectContext (host) and
|
|
65
|
+
// onCwdChange (engine bindings) so the inject is guaranteed even when the
|
|
66
|
+
// host overrides injectContext with its own pendingContext mechanism.
|
|
67
|
+
const context = await (0, workspace_1.buildWorkspaceContext)(wsName, updated[wsName], appName);
|
|
68
|
+
injectContext?.(context);
|
|
69
|
+
if (onCwdChange) {
|
|
70
|
+
const effectiveCwd = ws.commonRoot ?? target.cwd;
|
|
71
|
+
onCwdChange(effectiveCwd, context);
|
|
72
|
+
const rootNote = ws.commonRoot ? ` (shared root: ${ws.commonRoot})` : '';
|
|
73
|
+
emit(`Switched to workspace "${wsName}" — project: ${target.name}${rootNote}`);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
emit(`Workspace "${wsName}" loaded — project: ${target.name} (${target.cwd})`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
// ── Registry ──────────────────────────────────────────────────────────────────
|
|
80
|
+
/**
|
|
81
|
+
* Registers the framework's built-in slash commands into the given registry.
|
|
82
|
+
* Call this once when bootstrapping the app — before registering app-specific commands.
|
|
83
|
+
*/
|
|
84
|
+
function registerBuiltinCommands(registry) {
|
|
85
|
+
registry.register('/help', 'List available commands', async (ctx) => {
|
|
86
|
+
const cmds = registry.getAll();
|
|
87
|
+
const list = cmds.map(c => `- ${c.name.padEnd(22)} ${c.description}`).join('\n');
|
|
88
|
+
ctx.emit(`Available commands:\n${list}`);
|
|
89
|
+
});
|
|
90
|
+
registry.register('/agents', 'List agents or switch active agent', async (ctx) => {
|
|
91
|
+
if (!ctx.agents?.length) {
|
|
92
|
+
ctx.emit('No agents loaded.');
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
const active = ctx.effectiveAgentId;
|
|
96
|
+
if (ctx.prompt) {
|
|
97
|
+
const options = ctx.agents.map(a => {
|
|
98
|
+
const icon = a.icon ? `${a.icon} ` : '';
|
|
99
|
+
const badge = a.id === active ? ' [activo]' : '';
|
|
100
|
+
const label = `${icon}${a.name}${badge}`;
|
|
101
|
+
const desc = a.description ? ` — ${a.description}` : '';
|
|
102
|
+
return { label: `${label.padEnd(28)}${desc}`, value: a.id };
|
|
103
|
+
});
|
|
104
|
+
const selected = await ctx.prompt('Seleccionar agente:', options);
|
|
105
|
+
if (!selected)
|
|
106
|
+
return;
|
|
107
|
+
if (selected === active) {
|
|
108
|
+
ctx.emit(`Ya estás usando ${selected}.`);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
// Switch via engine so the bridge/engine updates the active agent
|
|
112
|
+
await ctx.runEngine?.(`/agent ${selected}`);
|
|
113
|
+
ctx.emit(`Agente cambiado → ${selected}`);
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
const lines = ctx.agents.map(a => {
|
|
117
|
+
const icon = a.icon ? `${a.icon} ` : '';
|
|
118
|
+
const marker = a.id === active ? ' ◀ activo' : '';
|
|
119
|
+
return ` ${icon}${a.id.padEnd(20)} ${a.name}${marker}`;
|
|
120
|
+
});
|
|
121
|
+
ctx.emit('Agentes disponibles:\n' + lines.join('\n') +
|
|
122
|
+
'\n\nUsa /agents para el picker interactivo o /agent <id> para cambiar directamente.');
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
registry.register('/skills', 'Gestionar skills: list, install, create, generate, update, uninstall, reload', async (ctx) => {
|
|
126
|
+
const parts = ctx.args.trim().split(/\s+/);
|
|
127
|
+
const sub = parts[0];
|
|
128
|
+
// ── /skills install <url> [--global] ─────────────────────────────────
|
|
129
|
+
if (sub === 'install') {
|
|
130
|
+
const source = parts[1];
|
|
131
|
+
if (!source) {
|
|
132
|
+
ctx.emit('Uso: /skills install <url> [--global]\n' +
|
|
133
|
+
' /skills install https://skills.sh/owner/repo\n' +
|
|
134
|
+
' /skills install https://github.com/owner/repo\n' +
|
|
135
|
+
' /skills install https://skills.sh/owner/repo --global\n\n' +
|
|
136
|
+
'Sin --global, el pack se instala solo para este proyecto.');
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
const isGlobal = parts.includes('--global');
|
|
140
|
+
const appName = ctx.appName ?? 'bk-agent';
|
|
141
|
+
const manager = (0, manager_1.createSkillManager)(appName);
|
|
142
|
+
try {
|
|
143
|
+
ctx.emit(`Instalando skill desde: ${source}…`);
|
|
144
|
+
await manager.install(source, {
|
|
145
|
+
projectDir: isGlobal ? undefined : ctx.projectDir,
|
|
146
|
+
});
|
|
147
|
+
const scope = isGlobal ? 'global' : 'proyecto';
|
|
148
|
+
await ctx.reloadSkills?.();
|
|
149
|
+
ctx.emit(`✓ Skill instalada (scope: ${scope}).`);
|
|
150
|
+
}
|
|
151
|
+
catch (err) {
|
|
152
|
+
ctx.emit(`✗ Error al instalar: ${err.message}`);
|
|
153
|
+
}
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
// ── /skills create <nombre> [--global] ───────────────────────────────
|
|
157
|
+
if (sub === 'create') {
|
|
158
|
+
const name = parts[1];
|
|
159
|
+
if (!name) {
|
|
160
|
+
ctx.emit('Uso: /skills create <nombre> [--global]\n' +
|
|
161
|
+
' /skills create mi-skill → crea en el proyecto actual\n' +
|
|
162
|
+
' /skills create mi-skill --global → crea en el directorio global\n\n' +
|
|
163
|
+
'El nombre debe ser kebab-case (ej: code-review-nestjs, deploy-docker).');
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
if (!/^[a-z0-9][a-z0-9-]*$/.test(name)) {
|
|
167
|
+
ctx.emit('✗ El nombre debe ser kebab-case (solo letras minúsculas, números y guiones).');
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
const isGlobal = parts.includes('--global');
|
|
171
|
+
const appName = ctx.appName ?? 'bk-agent';
|
|
172
|
+
const dir = isGlobal || !ctx.projectDir
|
|
173
|
+
? path.join((0, agent_core_1.getFrameworkDir)(appName), 'skills', 'global')
|
|
174
|
+
: path.join(ctx.projectDir, 'skills');
|
|
175
|
+
const filePath = path.join(dir, `${name}.md`);
|
|
176
|
+
const exists = await (0, result_1.run)(() => fs.access(filePath));
|
|
177
|
+
if ((0, result_1.isOk)(exists)) {
|
|
178
|
+
ctx.emit(`✗ Ya existe una skill con ese nombre: ${filePath}`);
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
const template = [
|
|
182
|
+
'---',
|
|
183
|
+
`name: ${name}`,
|
|
184
|
+
'version: 1.0.0',
|
|
185
|
+
'description: ',
|
|
186
|
+
'triggers:',
|
|
187
|
+
' - ',
|
|
188
|
+
'---',
|
|
189
|
+
'',
|
|
190
|
+
'',
|
|
191
|
+
].join('\n');
|
|
192
|
+
await fs.mkdir(dir, { recursive: true });
|
|
193
|
+
await (0, agent_core_2.atomicWrite)(filePath, template);
|
|
194
|
+
await ctx.reloadSkills?.();
|
|
195
|
+
ctx.emit(`✓ Skill creada: ${filePath}`);
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
// ── /skills generate <descripción> [--global] ────────────────────────
|
|
199
|
+
if (sub === 'generate') {
|
|
200
|
+
const isGlobal = parts.includes('--global');
|
|
201
|
+
const description = parts.slice(1).filter(p => p !== '--global').join(' ');
|
|
202
|
+
if (!description) {
|
|
203
|
+
ctx.emit('Uso: /skills generate <descripción> [--global]\n' +
|
|
204
|
+
' /skills generate "proceso de code review para NestJS"\n' +
|
|
205
|
+
' /skills generate "flujo de deploy con Docker Compose" --global');
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
if (!ctx.llm) {
|
|
209
|
+
ctx.emit('✗ LLM no disponible en este contexto.\n' +
|
|
210
|
+
'Usá /skills create <nombre> para crear la skill manualmente.');
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
const appName = ctx.appName ?? 'bk-agent';
|
|
214
|
+
const dir = isGlobal || !ctx.projectDir
|
|
215
|
+
? path.join((0, agent_core_1.getFrameworkDir)(appName), 'skills', 'global')
|
|
216
|
+
: path.join(ctx.projectDir, 'skills');
|
|
217
|
+
ctx.emit('Generando skill…');
|
|
218
|
+
const prompt = `Generate a skill file in .md format with YAML frontmatter.\n` +
|
|
219
|
+
`Output raw file content only — no markdown code fences, no extra explanation.\n\n` +
|
|
220
|
+
`Required format:\n` +
|
|
221
|
+
`---\n` +
|
|
222
|
+
`name: <kebab-case name, max 4 words>\n` +
|
|
223
|
+
`version: 1.0.0\n` +
|
|
224
|
+
`description: <one concise line>\n` +
|
|
225
|
+
`triggers:\n` +
|
|
226
|
+
` - <keyword1>\n` +
|
|
227
|
+
` - <keyword2>\n` +
|
|
228
|
+
` - <keyword3>\n` +
|
|
229
|
+
`---\n\n` +
|
|
230
|
+
`<Clear step-by-step instructions in markdown>\n\n` +
|
|
231
|
+
`Description: "${description.slice(0, 500)}"`;
|
|
232
|
+
let md;
|
|
233
|
+
try {
|
|
234
|
+
const raw = await ctx.llm(prompt);
|
|
235
|
+
md = raw.replace(/^```(?:md|markdown)?\n?/im, '').replace(/```\s*$/m, '').trim();
|
|
236
|
+
}
|
|
237
|
+
catch (err) {
|
|
238
|
+
ctx.emit(`✗ Error generando skill: ${err.message}`);
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
const skill = (0, parse_md_skill_1.parseMdSkill)(md);
|
|
242
|
+
if (!skill?.name) {
|
|
243
|
+
ctx.emit('✗ La respuesta del LLM no tiene el formato esperado.\n' +
|
|
244
|
+
'Usá /skills create <nombre> para crear la skill manualmente.');
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
try {
|
|
248
|
+
(0, safe_name_1.assertSafeFileName)('skill name', skill.name);
|
|
249
|
+
}
|
|
250
|
+
catch (err) {
|
|
251
|
+
ctx.emit(`✗ ${err.message}`);
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
const filePath = path.join(dir, `${skill.name}.md`);
|
|
255
|
+
const exists = await (0, result_1.run)(() => fs.access(filePath));
|
|
256
|
+
if ((0, result_1.isOk)(exists)) {
|
|
257
|
+
ctx.emit(`✗ Ya existe una skill con ese nombre: ${filePath}`);
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
await fs.mkdir(dir, { recursive: true });
|
|
261
|
+
await (0, agent_core_2.atomicWrite)(filePath, md);
|
|
262
|
+
await ctx.reloadSkills?.();
|
|
263
|
+
ctx.emit(`✓ Skill "${skill.name}" generada: ${filePath}`);
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
// ── /skills uninstall <pack> ──────────────────────────────────────────
|
|
267
|
+
if (sub === 'uninstall') {
|
|
268
|
+
const pack = parts[1];
|
|
269
|
+
const appName = ctx.appName ?? 'bk-agent';
|
|
270
|
+
const manager = (0, manager_1.createSkillManager)(appName);
|
|
271
|
+
if (!pack) {
|
|
272
|
+
const packs = await manager.list();
|
|
273
|
+
if (!packs.length) {
|
|
274
|
+
ctx.emit('No hay packs instalados.\nUsá /skills install <url> para instalar uno.');
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
if (ctx.prompt) {
|
|
278
|
+
const options = packs.map(p => ({
|
|
279
|
+
label: `${p.pack.padEnd(26)} skills: ${p.skills.join(', ')}`,
|
|
280
|
+
value: p.pack,
|
|
281
|
+
}));
|
|
282
|
+
const selected = await ctx.prompt('Seleccioná el pack a desinstalar:', options);
|
|
283
|
+
if (!selected)
|
|
284
|
+
return;
|
|
285
|
+
try {
|
|
286
|
+
await manager.uninstall(selected);
|
|
287
|
+
ctx.emit(`✓ Pack "${selected}" desinstalado.`);
|
|
288
|
+
}
|
|
289
|
+
catch (err) {
|
|
290
|
+
ctx.emit(`✗ Error: ${err.message}`);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
else {
|
|
294
|
+
const lines = packs.map(p => ` ${p.pack.padEnd(26)} ${p.skills.join(', ')}`);
|
|
295
|
+
ctx.emit('Packs instalados:\n' + lines.join('\n') + '\n\nUsá: /skills uninstall <pack>');
|
|
296
|
+
}
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
try {
|
|
300
|
+
await manager.uninstall(pack);
|
|
301
|
+
ctx.emit(`✓ Pack "${pack}" desinstalado.`);
|
|
302
|
+
}
|
|
303
|
+
catch (err) {
|
|
304
|
+
ctx.emit(`✗ Error: ${err.message}`);
|
|
305
|
+
}
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
// ── /skills update <pack> ─────────────────────────────────────────────
|
|
309
|
+
if (sub === 'update') {
|
|
310
|
+
const pack = parts[1];
|
|
311
|
+
const appName = ctx.appName ?? 'bk-agent';
|
|
312
|
+
const manager = (0, manager_1.createSkillManager)(appName);
|
|
313
|
+
if (!pack) {
|
|
314
|
+
const packs = await manager.list();
|
|
315
|
+
if (!packs.length) {
|
|
316
|
+
ctx.emit('No hay packs instalados.\nUsá /skills install <url> para instalar uno.');
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
if (ctx.prompt) {
|
|
320
|
+
const options = packs.map(p => ({
|
|
321
|
+
label: `${p.pack.padEnd(26)} instalado: ${p.installedAt.slice(0, 10)}`,
|
|
322
|
+
value: p.pack,
|
|
323
|
+
}));
|
|
324
|
+
const selected = await ctx.prompt('Seleccioná el pack a actualizar:', options);
|
|
325
|
+
if (!selected)
|
|
326
|
+
return;
|
|
327
|
+
try {
|
|
328
|
+
ctx.emit(`Actualizando "${selected}"…`);
|
|
329
|
+
await manager.update(selected);
|
|
330
|
+
ctx.emit(`✓ Pack "${selected}" actualizado. Reinicia para aplicar los cambios.`);
|
|
331
|
+
}
|
|
332
|
+
catch (err) {
|
|
333
|
+
ctx.emit(`✗ Error: ${err.message}`);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
else {
|
|
337
|
+
const lines = packs.map(p => ` ${p.pack.padEnd(26)} instalado: ${p.installedAt.slice(0, 10)}`);
|
|
338
|
+
ctx.emit('Packs instalados:\n' + lines.join('\n') + '\n\nUsá: /skills update <pack>');
|
|
339
|
+
}
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
try {
|
|
343
|
+
ctx.emit(`Actualizando "${pack}"…`);
|
|
344
|
+
await manager.update(pack);
|
|
345
|
+
ctx.emit(`✓ Pack "${pack}" actualizado. Reinicia para aplicar los cambios.`);
|
|
346
|
+
}
|
|
347
|
+
catch (err) {
|
|
348
|
+
ctx.emit(`✗ Error: ${err.message}`);
|
|
349
|
+
}
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
352
|
+
// ── /skills reload ────────────────────────────────────────────────────
|
|
353
|
+
if (sub === 'reload') {
|
|
354
|
+
if (!ctx.reloadSkills) {
|
|
355
|
+
ctx.emit('✗ Reload no disponible en este contexto.');
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
ctx.emit('Recargando skills…');
|
|
359
|
+
await ctx.reloadSkills();
|
|
360
|
+
ctx.emit('✓ Skills recargadas.');
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
// ── /skills list (default) ────────────────────────────────────────────
|
|
364
|
+
const SUBCOMMANDS_HINT = '\n\nSubcomandos: install | create | generate | update | uninstall | reload';
|
|
365
|
+
if (!ctx.skills?.length) {
|
|
366
|
+
ctx.emit('No skills cargadas.' + SUBCOMMANDS_HINT);
|
|
367
|
+
return;
|
|
368
|
+
}
|
|
369
|
+
if (ctx.prompt) {
|
|
370
|
+
const options = ctx.skills.map(s => ({
|
|
371
|
+
label: `${s.name.padEnd(26)} ${s.description}`,
|
|
372
|
+
value: s.name,
|
|
373
|
+
}));
|
|
374
|
+
const INSTALL = '__install__';
|
|
375
|
+
const selected = await ctx.prompt('Skills disponibles:', [
|
|
376
|
+
...options,
|
|
377
|
+
{ label: '+ Instalar pack desde URL...', value: INSTALL },
|
|
378
|
+
]);
|
|
379
|
+
if (!selected || selected === INSTALL) {
|
|
380
|
+
if (selected === INSTALL) {
|
|
381
|
+
ctx.emit('Para instalar un pack escribí:\n /skills install https://skills.sh/owner/repo');
|
|
382
|
+
}
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
const skill = ctx.skills.find(s => s.name === selected);
|
|
386
|
+
if (skill) {
|
|
387
|
+
ctx.emit([
|
|
388
|
+
`Skill: ${skill.name}`,
|
|
389
|
+
`Descripción: ${skill.description}`,
|
|
390
|
+
skill.triggers.length ? `Triggers: ${skill.triggers.join(', ')}` : '',
|
|
391
|
+
skill.language?.length ? `Lenguajes: ${skill.language.join(', ')}` : '',
|
|
392
|
+
`Scope: ${skill.scope ?? '—'}`,
|
|
393
|
+
].filter(Boolean).join('\n'));
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
else {
|
|
397
|
+
const lines = ctx.skills.map(s => ` ${s.name.padEnd(26)} ${s.description}${s.scope === 'project' ? ' [proyecto]' : ''}`);
|
|
398
|
+
ctx.emit('Skills:\n' + lines.join('\n') + SUBCOMMANDS_HINT);
|
|
399
|
+
}
|
|
400
|
+
});
|
|
401
|
+
registry.register('/status', 'Show current agent and model', async (ctx) => {
|
|
402
|
+
ctx.emit([
|
|
403
|
+
`Agent : ${ctx.effectiveAgentId ?? '—'}`,
|
|
404
|
+
`Model : ${ctx.model ?? '—'}`,
|
|
405
|
+
`Iteration : ${ctx.getIterationMode?.() ?? '—'}`,
|
|
406
|
+
].join('\n'));
|
|
407
|
+
});
|
|
408
|
+
registry.register('/trust', 'Trust this project so its own agents and skills load: status, add, remove, list', async (ctx) => {
|
|
409
|
+
const appName = ctx.appName;
|
|
410
|
+
const project = ctx.workingDir;
|
|
411
|
+
if (!appName || !project) {
|
|
412
|
+
ctx.emit('/trust needs the host to pass appName and workingDir.');
|
|
413
|
+
return;
|
|
414
|
+
}
|
|
415
|
+
const [sub = 'status'] = ctx.args.trim().split(/\s+/).filter(Boolean);
|
|
416
|
+
if (sub === 'list') {
|
|
417
|
+
const all = (0, workspace_trust_1.listTrustedProjects)(appName);
|
|
418
|
+
ctx.emit(all.length ? `Trusted projects:\n${all.map(p => ` ${p}`).join('\n')}` : 'No project is trusted.');
|
|
419
|
+
return;
|
|
420
|
+
}
|
|
421
|
+
if (sub === 'add') {
|
|
422
|
+
const trusted = (0, workspace_trust_1.trustProject)(appName, project);
|
|
423
|
+
await ctx.reloadSkills?.();
|
|
424
|
+
ctx.emit(`Trusted: ${trusted}\n` +
|
|
425
|
+
`Its skills load now. Its agents load the next time the agent starts: restart it to apply them.`);
|
|
426
|
+
return;
|
|
427
|
+
}
|
|
428
|
+
if (sub === 'remove') {
|
|
429
|
+
const removed = (0, workspace_trust_1.untrustProject)(appName, project);
|
|
430
|
+
ctx.emit(removed
|
|
431
|
+
? `No longer trusted: ${project}\nThe project's agents and skills stop loading the next time the agent starts.`
|
|
432
|
+
: `${project} was not trusted.`);
|
|
433
|
+
return;
|
|
434
|
+
}
|
|
435
|
+
if (sub !== 'status') {
|
|
436
|
+
ctx.emit('Usage: /trust [status | add | remove | list]');
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
const status = (0, workspace_trust_1.isProjectTrusted)(appName, project);
|
|
440
|
+
const layer = (0, workspace_trust_1.projectLayerContents)(appName, project);
|
|
441
|
+
const holds = [
|
|
442
|
+
layer.agents.length ? `agents: ${layer.agents.join(', ')}` : '',
|
|
443
|
+
layer.skills.length ? `skills: ${layer.skills.join(', ')}` : '',
|
|
444
|
+
].filter(Boolean).join(' | ') || 'nothing';
|
|
445
|
+
ctx.emit([
|
|
446
|
+
`Project : ${status.path}`,
|
|
447
|
+
`Trusted : ${status.trusted ? `yes (${status.reason === 'env' ? 'BK_TRUST_PROJECT=1' : 'listed'})` : 'no'}`,
|
|
448
|
+
`Project layer (${layer.dir}): ${holds}`,
|
|
449
|
+
status.trusted ? '' : 'Run /trust add to load it. Only do it if you trust whoever wrote this repository.',
|
|
450
|
+
].filter(Boolean).join('\n'));
|
|
451
|
+
});
|
|
452
|
+
registry.register('/iteration', 'Change or show the iteration mode', async (ctx) => {
|
|
453
|
+
const MODES = [
|
|
454
|
+
{ value: 'interactive', label: 'interactive', description: 'Pauses every N iterations — you decide whether to continue' },
|
|
455
|
+
{ value: 'auto', label: 'auto', description: 'Never pauses — runs until done or global cap (1000)' },
|
|
456
|
+
{ value: 'step-by-step', label: 'step-by-step', description: 'Pauses after every single iteration for maximum control' },
|
|
457
|
+
];
|
|
458
|
+
const current = ctx.getIterationMode?.();
|
|
459
|
+
// Arg directo: /iteration auto | /iteration step-by-step | /iteration interactive
|
|
460
|
+
if (ctx.args) {
|
|
461
|
+
const arg = ctx.args.trim();
|
|
462
|
+
if (MODES.some(m => m.value === arg)) {
|
|
463
|
+
ctx.setIterationMode?.(arg);
|
|
464
|
+
ctx.emit(`Iteration mode → ${arg}`);
|
|
465
|
+
}
|
|
466
|
+
else {
|
|
467
|
+
ctx.emit(`Unknown mode "${arg}". Options: interactive | auto | step-by-step`);
|
|
468
|
+
}
|
|
469
|
+
return;
|
|
470
|
+
}
|
|
471
|
+
// Sin arg: mostrar modo actual y permitir elegir
|
|
472
|
+
if (ctx.prompt) {
|
|
473
|
+
const selected = await ctx.prompt(`Iteration mode (current: ${current ?? '—'}):`, MODES.map(m => ({
|
|
474
|
+
label: `${m.value.padEnd(16)} ${m.description}`,
|
|
475
|
+
value: m.value,
|
|
476
|
+
})));
|
|
477
|
+
if (selected) {
|
|
478
|
+
ctx.setIterationMode?.(selected);
|
|
479
|
+
ctx.emit(`Iteration mode → ${selected}`);
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
else {
|
|
483
|
+
const lines = MODES.map(m => ` ${(current === m.value ? '▶ ' : ' ')}${m.value.padEnd(16)} ${m.description}`);
|
|
484
|
+
ctx.emit(`Iteration mode (current: ${current ?? '—'}):\n${lines.join('\n')}\n\nUse /iteration <mode> to change.`);
|
|
485
|
+
}
|
|
486
|
+
});
|
|
487
|
+
registry.register('/workspace', 'Manage multi-project workspaces', async (ctx) => {
|
|
488
|
+
const { args, emit, appName, injectContext, onCwdChange } = ctx;
|
|
489
|
+
if (!appName) {
|
|
490
|
+
emit('appName not set in CommandContext.');
|
|
491
|
+
return;
|
|
492
|
+
}
|
|
493
|
+
const parts = (args ?? '').split(' ').filter(Boolean);
|
|
494
|
+
const sub = parts[0];
|
|
495
|
+
// ── /workspace or /workspace list ──────────────────────────────────
|
|
496
|
+
if (!sub || sub === 'list') {
|
|
497
|
+
const config = await (0, workspace_1.loadWorkspaces)(appName);
|
|
498
|
+
const names = Object.keys(config);
|
|
499
|
+
if (!names.length) {
|
|
500
|
+
emit('No hay workspaces configurados.\n\n' +
|
|
501
|
+
'Comandos disponibles:\n' +
|
|
502
|
+
' /workspace create <name> Crear workspace nuevo\n' +
|
|
503
|
+
' /workspace add <ws> <cwd> [name] Agregar proyecto existente\n' +
|
|
504
|
+
' /workspace import <cwd> [ws] [name] Importar proyecto (crea ws si no existe)\n' +
|
|
505
|
+
' /workspace switch <ws> [project] Cambiar workspace/proyecto activo\n' +
|
|
506
|
+
' /workspace set-root <ws> [path] Raiz compartida (auto-detecta si no hay path)\n' +
|
|
507
|
+
' /workspace remove <ws> <project> Quitar proyecto del workspace\n' +
|
|
508
|
+
' /workspace delete <name> Eliminar workspace\n' +
|
|
509
|
+
' /workspace list Listar workspaces');
|
|
510
|
+
return;
|
|
511
|
+
}
|
|
512
|
+
if (ctx.prompt && !sub) {
|
|
513
|
+
// Interactive: let the user pick a workspace+project to switch to directly
|
|
514
|
+
const options = names.flatMap(wsName => {
|
|
515
|
+
const ws = config[wsName];
|
|
516
|
+
return ws.projects.map(p => ({
|
|
517
|
+
label: `${wsName.padEnd(18)} ${p.name}${p.name === ws.active ? ' *' : ''}`,
|
|
518
|
+
value: `${wsName}::${p.name}`,
|
|
519
|
+
}));
|
|
520
|
+
});
|
|
521
|
+
const selected = await ctx.prompt('Workspaces — select to switch:', options);
|
|
522
|
+
if (!selected)
|
|
523
|
+
return;
|
|
524
|
+
const [wsName, projectName] = selected.split('::');
|
|
525
|
+
sub === undefined && await doSwitch(wsName, projectName, config, appName, emit, injectContext, onCwdChange);
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
528
|
+
const lines = names.map(n => {
|
|
529
|
+
const ws = config[n];
|
|
530
|
+
const projects = ws.projects
|
|
531
|
+
.map(p => `${p.name}${p.name === ws.active ? '*' : ''}`)
|
|
532
|
+
.join(', ') || '(vacío)';
|
|
533
|
+
return ` ${n.padEnd(20)} ${projects}`;
|
|
534
|
+
});
|
|
535
|
+
emit('Workspaces (* = proyecto activo):\n' + lines.join('\n') + '\n\n' +
|
|
536
|
+
'Comandos:\n' +
|
|
537
|
+
' /workspace create <name> Crear workspace\n' +
|
|
538
|
+
' /workspace add <ws> <cwd> [name] Agregar proyecto\n' +
|
|
539
|
+
' /workspace import <cwd> [ws] [name] Importar proyecto\n' +
|
|
540
|
+
' /workspace switch <ws> [project] Cambiar activo\n' +
|
|
541
|
+
' /workspace set-root <ws> [path] Raiz compartida (auto si no hay path)\n' +
|
|
542
|
+
' /workspace remove <ws> <project> Quitar proyecto\n' +
|
|
543
|
+
' /workspace delete <name> Eliminar workspace');
|
|
544
|
+
return;
|
|
545
|
+
}
|
|
546
|
+
// ── /workspace create <name> ──────────────────────────────────────────
|
|
547
|
+
if (sub === 'create') {
|
|
548
|
+
const name = parts[1];
|
|
549
|
+
if (!name) {
|
|
550
|
+
emit('Usage: /workspace create <name>');
|
|
551
|
+
return;
|
|
552
|
+
}
|
|
553
|
+
const config = await (0, workspace_1.loadWorkspaces)(appName);
|
|
554
|
+
if (config[name]) {
|
|
555
|
+
emit(`Workspace "${name}" already exists.`);
|
|
556
|
+
return;
|
|
557
|
+
}
|
|
558
|
+
await (0, workspace_1.saveWorkspaces)(appName, (0, workspace_1.createWorkspace)(config, name));
|
|
559
|
+
emit(`Workspace "${name}" created.`);
|
|
560
|
+
return;
|
|
561
|
+
}
|
|
562
|
+
// ── /workspace add <workspace> <cwd> [name] ──────────────────────────
|
|
563
|
+
if (sub === 'add') {
|
|
564
|
+
const [, wsName, cwd, projectName] = parts;
|
|
565
|
+
if (!wsName || !cwd) {
|
|
566
|
+
emit('Usage: /workspace add <workspace> <cwd> [name]');
|
|
567
|
+
return;
|
|
568
|
+
}
|
|
569
|
+
const resolvedCwd = path.resolve(cwd);
|
|
570
|
+
const name = projectName ?? (0, workspace_1.deriveProjectName)(resolvedCwd);
|
|
571
|
+
try {
|
|
572
|
+
const config = await (0, workspace_1.loadWorkspaces)(appName);
|
|
573
|
+
await (0, workspace_1.saveWorkspaces)(appName, (0, workspace_1.addProject)(config[wsName] ? config : (0, workspace_1.createWorkspace)(config, wsName), wsName, { name, cwd: resolvedCwd }));
|
|
574
|
+
emit(`Added "${name}" to workspace "${wsName}".\n cwd: ${resolvedCwd}`);
|
|
575
|
+
}
|
|
576
|
+
catch (e) {
|
|
577
|
+
emit(`Error: ${e.message}`);
|
|
578
|
+
}
|
|
579
|
+
return;
|
|
580
|
+
}
|
|
581
|
+
// ── /workspace import <cwd> [workspace] [name] ───────────────────────
|
|
582
|
+
// Like add but auto-creates the workspace if missing. Useful for quick onboarding.
|
|
583
|
+
if (sub === 'import') {
|
|
584
|
+
const [, cwd, wsName, projectName] = parts;
|
|
585
|
+
if (!cwd) {
|
|
586
|
+
emit('Usage: /workspace import <cwd> [workspace] [name]');
|
|
587
|
+
return;
|
|
588
|
+
}
|
|
589
|
+
const resolvedCwd = path.resolve(cwd);
|
|
590
|
+
const name = projectName ?? (0, workspace_1.deriveProjectName)(resolvedCwd);
|
|
591
|
+
const ws = wsName ?? name;
|
|
592
|
+
try {
|
|
593
|
+
const config = await (0, workspace_1.loadWorkspaces)(appName);
|
|
594
|
+
await (0, workspace_1.saveWorkspaces)(appName, (0, workspace_1.importProject)(config, ws, { name, cwd: resolvedCwd }));
|
|
595
|
+
emit(`Imported "${name}" into workspace "${ws}".\n cwd: ${resolvedCwd}`);
|
|
596
|
+
}
|
|
597
|
+
catch (e) {
|
|
598
|
+
emit(`Error: ${e.message}`);
|
|
599
|
+
}
|
|
600
|
+
return;
|
|
601
|
+
}
|
|
602
|
+
// ── /workspace remove <workspace> <project> ───────────────────────────
|
|
603
|
+
if (sub === 'remove') {
|
|
604
|
+
const [, wsName, projectName] = parts;
|
|
605
|
+
if (!wsName || !projectName) {
|
|
606
|
+
emit('Usage: /workspace remove <workspace> <project>');
|
|
607
|
+
return;
|
|
608
|
+
}
|
|
609
|
+
const config = await (0, workspace_1.loadWorkspaces)(appName);
|
|
610
|
+
if (!config[wsName]) {
|
|
611
|
+
emit(`Workspace "${wsName}" not found.`);
|
|
612
|
+
return;
|
|
613
|
+
}
|
|
614
|
+
try {
|
|
615
|
+
await (0, workspace_1.saveWorkspaces)(appName, (0, workspace_1.removeProject)(config, wsName, projectName));
|
|
616
|
+
emit(`Removed "${projectName}" from workspace "${wsName}".`);
|
|
617
|
+
}
|
|
618
|
+
catch (e) {
|
|
619
|
+
emit(`Error: ${e.message}`);
|
|
620
|
+
}
|
|
621
|
+
return;
|
|
622
|
+
}
|
|
623
|
+
// ── /workspace delete <name> ──────────────────────────────────────────
|
|
624
|
+
if (sub === 'delete') {
|
|
625
|
+
const name = parts[1];
|
|
626
|
+
if (!name) {
|
|
627
|
+
emit('Usage: /workspace delete <name>');
|
|
628
|
+
return;
|
|
629
|
+
}
|
|
630
|
+
const config = await (0, workspace_1.loadWorkspaces)(appName);
|
|
631
|
+
if (!config[name]) {
|
|
632
|
+
emit(`Workspace "${name}" not found.`);
|
|
633
|
+
return;
|
|
634
|
+
}
|
|
635
|
+
await (0, workspace_1.saveWorkspaces)(appName, (0, workspace_1.deleteWorkspace)(config, name));
|
|
636
|
+
emit(`Workspace "${name}" deleted.`);
|
|
637
|
+
return;
|
|
638
|
+
}
|
|
639
|
+
// ── /workspace switch <workspace> [project] ───────────────────────────
|
|
640
|
+
if (sub === 'switch') {
|
|
641
|
+
const [, wsName, projectName] = parts;
|
|
642
|
+
const config = await (0, workspace_1.loadWorkspaces)(appName);
|
|
643
|
+
// No args after switch → interactive picker
|
|
644
|
+
if (!wsName && ctx.prompt) {
|
|
645
|
+
const names = Object.keys(config);
|
|
646
|
+
if (!names.length) {
|
|
647
|
+
emit('No workspaces configured.');
|
|
648
|
+
return;
|
|
649
|
+
}
|
|
650
|
+
const options = names.flatMap(wn => {
|
|
651
|
+
const ws = config[wn];
|
|
652
|
+
return ws.projects.map(p => ({
|
|
653
|
+
label: `${wn.padEnd(18)} ${p.name}${p.name === ws.active ? ' *' : ''}`,
|
|
654
|
+
value: `${wn}::${p.name}`,
|
|
655
|
+
}));
|
|
656
|
+
});
|
|
657
|
+
const selected = await ctx.prompt('Switch to:', options);
|
|
658
|
+
if (!selected)
|
|
659
|
+
return;
|
|
660
|
+
const [selWs, selProject] = selected.split('::');
|
|
661
|
+
await doSwitch(selWs, selProject, config, appName, emit, injectContext, onCwdChange);
|
|
662
|
+
return;
|
|
663
|
+
}
|
|
664
|
+
if (!wsName) {
|
|
665
|
+
emit('Usage: /workspace switch <workspace> [project]');
|
|
666
|
+
return;
|
|
667
|
+
}
|
|
668
|
+
const ws = config[wsName];
|
|
669
|
+
if (!ws) {
|
|
670
|
+
emit(`Workspace "${wsName}" not found.`);
|
|
671
|
+
return;
|
|
672
|
+
}
|
|
673
|
+
if (!ws.projects.length) {
|
|
674
|
+
emit(`Workspace "${wsName}" has no projects.`);
|
|
675
|
+
return;
|
|
676
|
+
}
|
|
677
|
+
const target = projectName
|
|
678
|
+
? ws.projects.find(p => p.name === projectName)
|
|
679
|
+
: (ws.projects.find(p => p.name === ws.active) ?? ws.projects[0]);
|
|
680
|
+
if (!target) {
|
|
681
|
+
emit(`Project "${projectName}" not found in workspace "${wsName}".`);
|
|
682
|
+
return;
|
|
683
|
+
}
|
|
684
|
+
await doSwitch(wsName, target.name, config, appName, emit, injectContext, onCwdChange);
|
|
685
|
+
return;
|
|
686
|
+
}
|
|
687
|
+
// ── /workspace set-root <workspace> [path] ────────────────────────────
|
|
688
|
+
// Sets (or auto-detects) the commonRoot for a workspace.
|
|
689
|
+
// With no path arg, auto-detects the common ancestor of all project cwds.
|
|
690
|
+
if (sub === 'set-root') {
|
|
691
|
+
const [, wsName, rootPath] = parts;
|
|
692
|
+
if (!wsName) {
|
|
693
|
+
emit('Usage: /workspace set-root <workspace> [path]');
|
|
694
|
+
return;
|
|
695
|
+
}
|
|
696
|
+
const config = await (0, workspace_1.loadWorkspaces)(appName);
|
|
697
|
+
const ws = config[wsName];
|
|
698
|
+
if (!ws) {
|
|
699
|
+
emit(`Workspace "${wsName}" not found.`);
|
|
700
|
+
return;
|
|
701
|
+
}
|
|
702
|
+
if (!ws.projects.length) {
|
|
703
|
+
emit(`Workspace "${wsName}" has no projects.`);
|
|
704
|
+
return;
|
|
705
|
+
}
|
|
706
|
+
const root = rootPath
|
|
707
|
+
? path.resolve(rootPath)
|
|
708
|
+
: (0, workspace_1.detectCommonRoot)(ws.projects.map(p => p.cwd));
|
|
709
|
+
await (0, workspace_1.saveWorkspaces)(appName, (0, workspace_1.setCommonRoot)(config, wsName, root));
|
|
710
|
+
emit(`Workspace "${wsName}" common root set to: ${root}\nNext /workspace switch will use this as workingDir.`);
|
|
711
|
+
return;
|
|
712
|
+
}
|
|
713
|
+
emit([
|
|
714
|
+
'Usage:',
|
|
715
|
+
' /workspace list',
|
|
716
|
+
' /workspace create <name>',
|
|
717
|
+
' /workspace add <workspace> <cwd> [name]',
|
|
718
|
+
' /workspace import <cwd> [workspace] [name]',
|
|
719
|
+
' /workspace remove <workspace> <project>',
|
|
720
|
+
' /workspace delete <name>',
|
|
721
|
+
' /workspace switch [workspace] [project]',
|
|
722
|
+
' /workspace set-root <workspace> [path] Set shared root (auto-detected if no path)',
|
|
723
|
+
].join('\n'));
|
|
724
|
+
});
|
|
725
|
+
registry.register('/checkpoint', 'Create / list / load session checkpoints', async (ctx) => {
|
|
726
|
+
const { args, emit, projectDir, sessionContent, injectContext } = ctx;
|
|
727
|
+
if (!projectDir) {
|
|
728
|
+
emit('No active project directory.');
|
|
729
|
+
return;
|
|
730
|
+
}
|
|
731
|
+
// /checkpoint list
|
|
732
|
+
if (args === 'list') {
|
|
733
|
+
const all = await (0, checkpoint_1.listCheckpoints)(projectDir);
|
|
734
|
+
if (!all.length) {
|
|
735
|
+
emit('No checkpoints saved.');
|
|
736
|
+
return;
|
|
737
|
+
}
|
|
738
|
+
const latest = (0, checkpoint_1.getLatestCheckpoints)(all);
|
|
739
|
+
const lines = latest.map((cp, i) => {
|
|
740
|
+
const count = all.filter(c => c.feature === cp.feature).length;
|
|
741
|
+
const label = (cp.feature || '(unnamed)').padEnd(24);
|
|
742
|
+
const timeDisplay = cp.time ? `${cp.time.slice(0, 2)}:${cp.time.slice(2)}` : '';
|
|
743
|
+
const versions = count > 1 ? ` (${count} versions)` : '';
|
|
744
|
+
return ` ${i + 1}. ${label} ${cp.date} ${timeDisplay}${versions}`;
|
|
745
|
+
});
|
|
746
|
+
emit(lines.join('\n'));
|
|
747
|
+
return;
|
|
748
|
+
}
|
|
749
|
+
// /checkpoint load [feature]
|
|
750
|
+
if (args === 'load' || args.startsWith('load ')) {
|
|
751
|
+
const target = args.slice(4).trim();
|
|
752
|
+
const all = await (0, checkpoint_1.listCheckpoints)(projectDir);
|
|
753
|
+
if (!all.length) {
|
|
754
|
+
emit('No checkpoints saved.');
|
|
755
|
+
return;
|
|
756
|
+
}
|
|
757
|
+
let match = target
|
|
758
|
+
? all.find(cp => cp.feature === target || cp.feature.includes(target))
|
|
759
|
+
: all[0]; // most recent overall
|
|
760
|
+
if (!match) {
|
|
761
|
+
emit(`Checkpoint not found: ${target}`);
|
|
762
|
+
return;
|
|
763
|
+
}
|
|
764
|
+
const raw = await (0, checkpoint_1.readCheckpoint)(projectDir, match.filename);
|
|
765
|
+
if (raw) {
|
|
766
|
+
const session = (0, checkpoint_1.extractSessionFromCheckpoint)(raw);
|
|
767
|
+
const timeDisplay = match.time ? `${match.time.slice(0, 2)}:${match.time.slice(2)}` : '';
|
|
768
|
+
const label = match.feature || 'unnamed';
|
|
769
|
+
injectContext?.(`## Checkpoint: ${label} (${match.date} ${timeDisplay})\n\n${session}`);
|
|
770
|
+
emit(`Checkpoint loaded: ${label}`);
|
|
771
|
+
}
|
|
772
|
+
return;
|
|
773
|
+
}
|
|
774
|
+
// /checkpoint [name] — create (name optional)
|
|
775
|
+
const featureName = args ?? '';
|
|
776
|
+
const cpPath = await (0, checkpoint_1.createCheckpoint)(projectDir, featureName, '', sessionContent ?? '');
|
|
777
|
+
const label = featureName || '(unnamed)';
|
|
778
|
+
emit(`Checkpoint saved: ${label}\n${cpPath}`);
|
|
779
|
+
});
|
|
780
|
+
// ── /plugin ───────────────────────────────────────────────────────────────
|
|
781
|
+
registry.register('/plugin', 'Manage MCP agent plugins: list, add, remove', async (ctx) => {
|
|
782
|
+
const { args, emit, appName } = ctx;
|
|
783
|
+
const app = appName ?? 'bk-agent';
|
|
784
|
+
const configPath = path.join((0, agent_core_1.getFrameworkDir)(app), 'config.json');
|
|
785
|
+
// Provider → base URL mapping (same providers the framework supports)
|
|
786
|
+
const PROVIDER_BASE_URLS = {
|
|
787
|
+
deepseek: 'https://api.deepseek.com/v1',
|
|
788
|
+
openai: 'https://api.openai.com/v1',
|
|
789
|
+
anthropic: 'https://api.anthropic.com/v1',
|
|
790
|
+
};
|
|
791
|
+
const KNOWN_PLUGINS = {
|
|
792
|
+
docker: {
|
|
793
|
+
npm: '@backendkit-labs/docker-agent',
|
|
794
|
+
description: 'Docker containers, Compose, Swarm',
|
|
795
|
+
models: { deepseek: 'deepseek-chat', openai: 'gpt-4o-mini', anthropic: 'claude-haiku-4-5-20251001' },
|
|
796
|
+
llmModel: 'gpt-4o-mini',
|
|
797
|
+
},
|
|
798
|
+
k8s: {
|
|
799
|
+
npm: '@backendkit-labs/k8s-agent',
|
|
800
|
+
description: 'Kubernetes pods, deployments, services',
|
|
801
|
+
models: { deepseek: 'deepseek-chat', openai: 'gpt-4o-mini', anthropic: 'claude-haiku-4-5-20251001' },
|
|
802
|
+
llmModel: 'gpt-4o-mini',
|
|
803
|
+
},
|
|
804
|
+
};
|
|
805
|
+
const readConfig = async () => {
|
|
806
|
+
const result = await (0, result_1.run)(() => fs.readFile(configPath, 'utf-8'));
|
|
807
|
+
if (!(0, result_1.isOk)(result))
|
|
808
|
+
return {};
|
|
809
|
+
try {
|
|
810
|
+
return JSON.parse(result.value);
|
|
811
|
+
}
|
|
812
|
+
catch {
|
|
813
|
+
return {};
|
|
814
|
+
}
|
|
815
|
+
};
|
|
816
|
+
const writeConfig = async (cfg) => {
|
|
817
|
+
await fs.mkdir(path.dirname(configPath), { recursive: true });
|
|
818
|
+
await (0, agent_core_2.atomicWrite)(configPath, JSON.stringify(cfg, null, 2));
|
|
819
|
+
};
|
|
820
|
+
const parts = (args ?? '').trim().split(/\s+/).filter(Boolean);
|
|
821
|
+
const sub = parts[0];
|
|
822
|
+
// ── /plugin list ─────────────────────────────────────────────────────
|
|
823
|
+
if (!sub || sub === 'list') {
|
|
824
|
+
const cfg = await readConfig();
|
|
825
|
+
const active = cfg.mcpServers ?? [];
|
|
826
|
+
if (!active.length) {
|
|
827
|
+
const hints = Object.entries(KNOWN_PLUGINS)
|
|
828
|
+
.map(([id, p]) => ` /plugin add ${id.padEnd(8)} — ${p.description}`)
|
|
829
|
+
.join('\n');
|
|
830
|
+
emit(`No hay plugins activos.\n\nDisponibles:\n${hints}`);
|
|
831
|
+
return;
|
|
832
|
+
}
|
|
833
|
+
// Enrich with live connection status from the engine when available
|
|
834
|
+
if (ctx.mcpList) {
|
|
835
|
+
const live = await ctx.mcpList();
|
|
836
|
+
const liveMap = new Map(live.map(s => [s.name, s]));
|
|
837
|
+
const lines = active.map(s => {
|
|
838
|
+
const status = liveMap.get(s.name);
|
|
839
|
+
const dot = status?.connected ? '●' : '○';
|
|
840
|
+
const tools = status?.connected ? ` (${status.toolCount} tools)` : ' (offline)';
|
|
841
|
+
return ` ${dot} ${s.name.padEnd(20)}${tools}`;
|
|
842
|
+
});
|
|
843
|
+
emit(`Plugins (${active.length}):\n${lines.join('\n')}\n\nUsa /plugin remove <name> para desactivar.`);
|
|
844
|
+
}
|
|
845
|
+
else {
|
|
846
|
+
const lines = active.map(s => ` ${s.name.padEnd(20)} ${(s.args ?? []).join(' ')}`);
|
|
847
|
+
emit(`Plugins activos (${active.length}):\n${lines.join('\n')}\n\nUsa /plugin remove <name> para desactivar.`);
|
|
848
|
+
}
|
|
849
|
+
return;
|
|
850
|
+
}
|
|
851
|
+
// ── /plugin add <id|npm-package> ─────────────────────────────────────
|
|
852
|
+
if (sub === 'add') {
|
|
853
|
+
const id = parts[1];
|
|
854
|
+
if (!id) {
|
|
855
|
+
const list = Object.entries(KNOWN_PLUGINS)
|
|
856
|
+
.map(([k, v]) => ` ${k.padEnd(8)} ${v.npm} — ${v.description}`)
|
|
857
|
+
.join('\n');
|
|
858
|
+
emit(`Uso: /plugin add <id>\n\nPlugins conocidos:\n${list}`);
|
|
859
|
+
return;
|
|
860
|
+
}
|
|
861
|
+
const known = KNOWN_PLUGINS[id.toLowerCase()];
|
|
862
|
+
const npmPkg = known?.npm ?? id;
|
|
863
|
+
const name = known ? id.toLowerCase() : (npmPkg.split('/').pop() ?? npmPkg);
|
|
864
|
+
// npmPkg is spawned through a shell below — accept only valid npm package names.
|
|
865
|
+
if (!/^(?:@[a-z0-9][\w.-]*\/)?[a-z0-9][\w.-]*(?:@[\w.^~-]+)?$/i.test(npmPkg)) {
|
|
866
|
+
emit(`Nombre de paquete npm inválido: "${npmPkg}".`);
|
|
867
|
+
return;
|
|
868
|
+
}
|
|
869
|
+
const cfg = await readConfig();
|
|
870
|
+
const servers = cfg.mcpServers ?? [];
|
|
871
|
+
if (servers.some(s => s.name === name)) {
|
|
872
|
+
emit(`Plugin "${name}" ya está activo.`);
|
|
873
|
+
return;
|
|
874
|
+
}
|
|
875
|
+
// Install into a dedicated dir so we can run via `node <path>` directly.
|
|
876
|
+
// Using `node` instead of `npx` avoids Windows stdin-pipe forwarding issues
|
|
877
|
+
// that occur when npx wraps the process through cmd.exe.
|
|
878
|
+
const pluginDir = path.join((0, agent_core_1.getFrameworkDir)(app), 'plugins', name);
|
|
879
|
+
await fs.mkdir(pluginDir, { recursive: true });
|
|
880
|
+
emit(`Instalando ${npmPkg}... (puede tardar un momento)`);
|
|
881
|
+
const installErr = await new Promise((resolve) => {
|
|
882
|
+
const proc = (0, child_process_1.spawn)('npm', ['install', npmPkg, '--no-fund', '--no-audit'], {
|
|
883
|
+
cwd: pluginDir,
|
|
884
|
+
shell: true,
|
|
885
|
+
stdio: 'inherit',
|
|
886
|
+
});
|
|
887
|
+
proc.on('close', (code) => resolve(code === 0 ? null : `npm salió con código ${code}`));
|
|
888
|
+
proc.on('error', (e) => resolve(e.message));
|
|
889
|
+
});
|
|
890
|
+
if (installErr) {
|
|
891
|
+
emit(`✗ Error instalando plugin: ${installErr}`);
|
|
892
|
+
return;
|
|
893
|
+
}
|
|
894
|
+
// Read main entry from the package's package.json
|
|
895
|
+
const pkgJsonResult = await (0, result_1.run)(() => fs.readFile(path.join(pluginDir, 'node_modules', npmPkg, 'package.json'), 'utf-8'));
|
|
896
|
+
if (!(0, result_1.isOk)(pkgJsonResult)) {
|
|
897
|
+
emit(`✗ No se encontró package.json para ${npmPkg}`);
|
|
898
|
+
return;
|
|
899
|
+
}
|
|
900
|
+
const pkgJson = JSON.parse(pkgJsonResult.value);
|
|
901
|
+
const entryRelative = pkgJson.main ?? 'dist/index.js';
|
|
902
|
+
const entryAbsolute = path.join(pluginDir, 'node_modules', npmPkg, entryRelative);
|
|
903
|
+
// Build LLM env from the app's configured provider so the plugin
|
|
904
|
+
// uses the same LLM stack without the user having to set it manually.
|
|
905
|
+
const provider = cfg.defaultProvider ?? 'openai';
|
|
906
|
+
const baseUrl = PROVIDER_BASE_URLS[provider] ?? PROVIDER_BASE_URLS['openai'];
|
|
907
|
+
const model = known?.models?.[provider] ?? known?.llmModel ?? 'gpt-4o-mini';
|
|
908
|
+
const pluginEnv = {
|
|
909
|
+
LLM_PROVIDER: provider,
|
|
910
|
+
LLM_BASE_URL: baseUrl,
|
|
911
|
+
LLM_MODEL: model,
|
|
912
|
+
};
|
|
913
|
+
servers.push({ name, command: 'node', args: [entryAbsolute], env: pluginEnv });
|
|
914
|
+
await writeConfig({ ...cfg, mcpServers: servers });
|
|
915
|
+
emit(`✓ Plugin "${name}" instalado (${provider} / ${model}).\nReinicia el agente para activarlo.`);
|
|
916
|
+
return;
|
|
917
|
+
}
|
|
918
|
+
// ── /plugin remove <name> ─────────────────────────────────────────────
|
|
919
|
+
if (sub === 'remove') {
|
|
920
|
+
const name = parts[1];
|
|
921
|
+
const cfg = await readConfig();
|
|
922
|
+
const before = cfg.mcpServers ?? [];
|
|
923
|
+
const doRemove = async (target) => {
|
|
924
|
+
const after = before.filter(s => s.name !== target);
|
|
925
|
+
await writeConfig({ ...cfg, mcpServers: after });
|
|
926
|
+
// Remove the local install directory if present (node-based plugins)
|
|
927
|
+
const pluginDir = path.join((0, agent_core_1.getFrameworkDir)(app), 'plugins', target);
|
|
928
|
+
await fs.rm(pluginDir, { recursive: true, force: true }).catch(() => { });
|
|
929
|
+
emit(`✓ Plugin "${target}" removido.\nReinicia el agente para aplicar el cambio.`);
|
|
930
|
+
};
|
|
931
|
+
if (!name) {
|
|
932
|
+
if (!before.length) {
|
|
933
|
+
emit('No hay plugins activos.');
|
|
934
|
+
return;
|
|
935
|
+
}
|
|
936
|
+
if (ctx.prompt) {
|
|
937
|
+
const options = before.map(s => ({ label: s.name, value: s.name }));
|
|
938
|
+
const selected = await ctx.prompt('Seleccioná el plugin a remover:', options);
|
|
939
|
+
if (!selected)
|
|
940
|
+
return;
|
|
941
|
+
if (!before.some(s => s.name === selected)) {
|
|
942
|
+
emit(`Plugin "${selected}" no encontrado.`);
|
|
943
|
+
return;
|
|
944
|
+
}
|
|
945
|
+
await doRemove(selected);
|
|
946
|
+
}
|
|
947
|
+
else {
|
|
948
|
+
emit(`Uso: /plugin remove <name>\n\nActivos: ${before.map(s => s.name).join(', ')}`);
|
|
949
|
+
}
|
|
950
|
+
return;
|
|
951
|
+
}
|
|
952
|
+
if (!before.some(s => s.name === name)) {
|
|
953
|
+
emit(`Plugin "${name}" no encontrado.`);
|
|
954
|
+
return;
|
|
955
|
+
}
|
|
956
|
+
await doRemove(name);
|
|
957
|
+
return;
|
|
958
|
+
}
|
|
959
|
+
emit('Subcomandos: list | add <id> | remove <name>');
|
|
960
|
+
});
|
|
961
|
+
}
|
|
962
|
+
//# sourceMappingURL=builtin.js.map
|