@backendkit-labs/agent-core 0.18.2 → 0.19.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.
Files changed (2) hide show
  1. package/README.md +72 -9
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -143,31 +143,39 @@ Built-in commands registered by `registerBuiltinCommands`:
143
143
 
144
144
  ### `/plugin` — MCP agent plugins
145
145
 
146
- Plugins are MCP servers that run as subprocesses via `npx`. They extend the agent with new tools (docker, k8s, etc.) without modifying the engine code.
146
+ Plugins are MCP servers that extend the agent with new tools (docker, k8s, etc.) without modifying the engine code. `/plugin add` installs the package via `npm install` into `~/.{appName}/plugins/<name>/` and launches it with `node` — no global installs, no npx overhead, works on Windows.
147
147
 
148
148
  Configuration is stored in `~/.{appName}/config.json` and loaded on next engine start.
149
149
 
150
150
  ```bash
151
151
  # In the agent CLI
152
152
  /plugin list # show active plugins
153
- /plugin add docker # add @backendkit-labs/docker-agent
154
- /plugin add k8s # add @backendkit-labs/k8s-agent
155
- /plugin remove docker # remove a plugin
153
+ /plugin add docker # install @backendkit-labs/docker-agent
154
+ /plugin add k8s # install @backendkit-labs/k8s-agent
155
+ /plugin remove docker # remove a plugin (uninstalls package)
156
156
  ```
157
157
 
158
- Or wire it up programmatically:
158
+ `/plugin add` auto-configures the plugin's LLM from the app's `defaultProvider` — no manual env editing needed:
159
159
 
160
- ```ts
160
+ ```jsonc
161
161
  // ~/.my-app/config.json (managed by /plugin add)
162
162
  {
163
163
  "mcpServers": [
164
- { "name": "docker", "command": "npx", "args": ["-y", "@backendkit-labs/docker-agent"] },
165
- { "name": "k8s", "command": "npx", "args": ["-y", "@backendkit-labs/k8s-agent"] }
164
+ {
165
+ "name": "docker",
166
+ "command": "node",
167
+ "args": ["~/.my-app/plugins/docker/node_modules/@backendkit-labs/docker-agent/dist/mcp.js"],
168
+ "env": {
169
+ "LLM_PROVIDER": "deepseek",
170
+ "LLM_BASE_URL": "https://api.deepseek.com/v1",
171
+ "LLM_MODEL": "deepseek-chat"
172
+ }
173
+ }
166
174
  ]
167
175
  }
168
176
  ```
169
177
 
170
- The engine reads `mcpServers` at startup and connects each plugin over stdio MCP transport. The `CommandContext` must have `appName` set for `/plugin` to know which config file to read:
178
+ The `CommandContext` must have `appName` set for `/plugin` to know which config file to read:
171
179
 
172
180
  ```ts
173
181
  await registry.dispatch('/plugin add docker', {
@@ -178,6 +186,61 @@ await registry.dispatch('/plugin add docker', {
178
186
 
179
187
  ---
180
188
 
189
+ ## Per-agent model overrides
190
+
191
+ Run routing/reasoning agents on a smarter model and tool-calling specialists on a cheaper one — without multiple engines or extra providers.
192
+
193
+ ### Same LLM, different models
194
+
195
+ Set `model` on the `AgentProfile`. The engine passes it as a per-call override; providers use `callbacks.model ?? this.model`, so agents without an override use the provider default unchanged.
196
+
197
+ ```ts
198
+ const engine = createBaseEngine({
199
+ providers: {
200
+ default: new OpenAICompatibleProvider({
201
+ apiKey: process.env.LLM_API_KEY!,
202
+ baseUrl: 'https://api.deepseek.com/v1',
203
+ model: 'deepseek-chat', // fallback for agents with no model override
204
+ }),
205
+ },
206
+ defaultProvider: 'default',
207
+ agents: [
208
+ { id: 'orchestrator', model: 'deepseek-reasoner', ... }, // smart — routing decisions
209
+ { id: 'coder', model: 'deepseek-chat', ... }, // fast — bulk tool calls
210
+ { id: 'data-analyst', model: 'deepseek-chat', ... }, // fast — tool calls
211
+ ],
212
+ });
213
+ ```
214
+
215
+ ### Different LLM providers per agent
216
+
217
+ Register multiple providers, then set `provider` on the agent profile. `model` is still a per-call override within the chosen provider.
218
+
219
+ ```ts
220
+ const engine = createBaseEngine({
221
+ providers: {
222
+ deepseek: new OpenAICompatibleProvider({
223
+ apiKey: process.env.DEEPSEEK_API_KEY!, baseUrl: 'https://api.deepseek.com/v1', model: 'deepseek-chat',
224
+ }),
225
+ anthropic: new AnthropicProvider({ apiKey: process.env.ANTHROPIC_API_KEY! }),
226
+ },
227
+ defaultProvider: 'deepseek',
228
+ agents: [
229
+ { id: 'coder', provider: 'deepseek', model: 'deepseek-chat' }, // fast
230
+ { id: 'architect', provider: 'anthropic', model: 'claude-opus-4-8' }, // smart
231
+ ],
232
+ });
233
+ ```
234
+
235
+ The two levels are independent:
236
+
237
+ | Field | Selects | Fallback |
238
+ |---|---|---|
239
+ | `provider` | Which LLM backend (`ProviderRegistry`) | `defaultProvider` |
240
+ | `model` | Which model within that backend | Provider's configured default |
241
+
242
+ ---
243
+
181
244
  ## Sub-path exports
182
245
 
183
246
  ```ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backendkit-labs/agent-core",
3
- "version": "0.18.2",
3
+ "version": "0.19.0",
4
4
  "description": "Generic multi-agent engine — model-agnostic, transport-agnostic",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",