@cubis/foundry 0.3.40 → 0.3.42

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 (29) hide show
  1. package/README.md +67 -3
  2. package/bin/cubis.js +360 -26
  3. package/mcp/README.md +72 -8
  4. package/mcp/config.json +3 -0
  5. package/mcp/dist/index.js +315 -68
  6. package/mcp/src/config/index.test.ts +1 -0
  7. package/mcp/src/config/schema.ts +5 -0
  8. package/mcp/src/index.ts +40 -9
  9. package/mcp/src/server.ts +66 -10
  10. package/mcp/src/telemetry/tokenBudget.ts +114 -0
  11. package/mcp/src/tools/index.ts +7 -0
  12. package/mcp/src/tools/skillBrowseCategory.ts +22 -5
  13. package/mcp/src/tools/skillBudgetReport.ts +128 -0
  14. package/mcp/src/tools/skillGet.ts +18 -0
  15. package/mcp/src/tools/skillListCategories.ts +19 -6
  16. package/mcp/src/tools/skillSearch.ts +22 -5
  17. package/mcp/src/tools/skillTools.test.ts +61 -9
  18. package/mcp/src/vault/manifest.test.ts +19 -1
  19. package/mcp/src/vault/manifest.ts +12 -1
  20. package/mcp/src/vault/scanner.test.ts +1 -0
  21. package/mcp/src/vault/scanner.ts +1 -0
  22. package/mcp/src/vault/types.ts +6 -0
  23. package/package.json +1 -1
  24. package/workflows/workflows/agent-environment-setup/platforms/antigravity/rules/GEMINI.md +28 -0
  25. package/workflows/workflows/agent-environment-setup/platforms/codex/rules/AGENTS.md +31 -2
  26. package/workflows/workflows/agent-environment-setup/platforms/copilot/rules/AGENTS.md +28 -0
  27. package/workflows/workflows/agent-environment-setup/platforms/copilot/rules/copilot-instructions.md +28 -0
  28. package/workflows/workflows/agent-environment-setup/platforms/cursor/rules/.cursorrules +28 -0
  29. package/workflows/workflows/agent-environment-setup/platforms/windsurf/rules/.windsurfrules +28 -0
package/README.md CHANGED
@@ -32,7 +32,7 @@ Skill install default is profile-based:
32
32
 
33
33
  - Workflow files (`/plan`, `/create`, etc.)
34
34
  - Skill folders
35
- - Codex callable wrapper skills (`$workflow-*`, `$agent-*`)
35
+ - Codex callable wrapper skills ($workflow-*, $agent-*)
36
36
  - Platform rule files (`AGENTS.md`, `GEMINI.md`, etc.)
37
37
  - Engineering artifacts in workspace (`ENGINEERING_RULES.md`, `TECH.md`)
38
38
  - Managed MCP config for Postman and Stitch
@@ -145,7 +145,7 @@ Postman and Stitch now support multiple named profiles with active selection.
145
145
  "runtime": "docker",
146
146
  "fallback": "local",
147
147
  "docker": {
148
- "image": "ghcr.io/cubis/foundry-mcp:0.1.0",
148
+ "image": "ghcr.io/cubetiq/foundry-mcp:<package-version>",
149
149
  "updatePolicy": "pinned"
150
150
  },
151
151
  "catalog": {
@@ -193,6 +193,17 @@ cbx workflows install --platform codex --bundle agent-environment-setup --postma
193
193
 
194
194
  If active Postman env var (for example `POSTMAN_API_KEY_DEFAULT`) is available and `--yes` is not used, installer can show workspace chooser and save selected `workspaceId` in active Postman profile.
195
195
 
196
+ `--postman` now installs side-by-side MCP topology by default:
197
+ - direct Postman MCP server (`postman`)
198
+ - direct Stitch MCP server where applicable (`StitchMCP` for Antigravity)
199
+ - local Foundry MCP command server (`cubis-foundry` via `cbx mcp serve --transport stdio --scope auto`)
200
+
201
+ To opt out of Foundry MCP registration during install:
202
+
203
+ ```bash
204
+ cbx workflows install --platform codex --bundle agent-environment-setup --postman --no-foundry-mcp
205
+ ```
206
+
196
207
  ### Manual workspace ID
197
208
 
198
209
  ```bash
@@ -245,14 +256,17 @@ Runtime target patching:
245
256
  Codex:
246
257
  - Global MCP runtime target: `~/.codex/config.toml` (via `codex mcp add/remove`)
247
258
  - Project MCP runtime target: `<workspace>/.vscode/mcp.json`
259
+ - Foundry side-by-side server id: `cubis-foundry` (command: `cbx mcp serve --transport stdio --scope auto`)
248
260
 
249
261
  Antigravity:
250
262
  - Global runtime target: `~/.gemini/settings.json` (`mcpServers`)
251
263
  - Project runtime target: `<workspace>/.gemini/settings.json` (`mcpServers`)
264
+ - Foundry side-by-side server id: `cubis-foundry` (command template)
252
265
 
253
266
  Copilot:
254
267
  - Global runtime target: `~/.copilot/mcp-config.json` (`servers`)
255
268
  - Project runtime target: `<workspace>/.vscode/mcp.json` (`servers`)
269
+ - Foundry side-by-side server id: `cubis-foundry` (stdio command server)
256
270
 
257
271
  ## Command Reference
258
272
 
@@ -272,7 +286,7 @@ MCP runtime flags (install):
272
286
  cbx workflows install --platform codex --bundle agent-environment-setup --postman \
273
287
  --mcp-runtime docker \
274
288
  --mcp-fallback local \
275
- --mcp-image ghcr.io/cubis/foundry-mcp:0.1.0 \
289
+ --mcp-image ghcr.io/cubetiq/foundry-mcp:<package-version> \
276
290
  --mcp-update-policy pinned \
277
291
  --mcp-build-local # optional: build image locally instead of docker pull
278
292
  ```
@@ -289,6 +303,19 @@ cbx mcp tools list --service postman --scope global
289
303
  cbx mcp tools list --service stitch --scope global
290
304
  ```
291
305
 
306
+ Foundry local serve command (canonical entrypoint for MCP client registration):
307
+
308
+ ```bash
309
+ # stdio (default)
310
+ cbx mcp serve --transport stdio --scope auto
311
+
312
+ # http for local smoke/debug
313
+ cbx mcp serve --transport http --scope auto --host 127.0.0.1 --port 3100
314
+
315
+ # verify vault only
316
+ cbx mcp serve --scan-only
317
+ ```
318
+
292
319
  MCP Docker runtime commands:
293
320
 
294
321
  ```bash
@@ -317,6 +344,18 @@ Optional strict key mode:
317
344
  CBX_MCP_REQUIRE_KEYS=1 npm run test:mcp:docker
318
345
  ```
319
346
 
347
+ Context budget reporting (from MCP skill tools):
348
+
349
+ - Skill tools now include `structuredContent.metrics` with deterministic estimates.
350
+ - Metrics include:
351
+ - `fullCatalogEstimatedTokens`
352
+ - `responseEstimatedTokens`
353
+ - `selectedSkillsEstimatedTokens` or `loadedSkillEstimatedTokens`
354
+ - `estimatedSavingsVsFullCatalog`
355
+ - `estimatedSavingsVsFullCatalogPercent`
356
+ - New rollup tool: `skill_budget_report` for consolidated Skill Log + Context Budget.
357
+ - All token values are estimates using `ceil(char_count / charsPerToken)` (default `charsPerToken=4`), not provider billing tokens.
358
+
320
359
  Install profile flags:
321
360
 
322
361
  ```bash
@@ -398,6 +437,31 @@ If installer says config was skipped:
398
437
  - Re-run with `--overwrite`, or
399
438
  - Use `cbx workflows config` / `cbx workflows config keys ...` to mutate existing config.
400
439
 
440
+ ### Docker runtime starts but skill discovery is zero
441
+
442
+ Cause:
443
+ - Runtime container has no skill mount at `/workflows/skills`.
444
+
445
+ Fix:
446
+ ```bash
447
+ # Ensure host skill vault exists
448
+ ls ~/.agents/skills
449
+
450
+ # Recreate runtime
451
+ cbx mcp runtime up --scope global --name cbx-mcp --replace
452
+
453
+ # Check mount hint
454
+ cbx mcp runtime status --scope global --name cbx-mcp
455
+ ```
456
+
457
+ If `~/.agents/skills` is missing, runtime still starts but will warn and skill discovery may return zero.
458
+
459
+ ### Docker vs stdio behavior
460
+
461
+ - `cbx mcp runtime up` runs HTTP transport in Docker for shared local endpoint (`http://127.0.0.1:<port>/mcp`).
462
+ - `cbx mcp serve --transport stdio` runs local stdio transport for command-based MCP clients.
463
+ - Prefer stdio command server entries (`cubis-foundry`) for direct client integrations; use Docker runtime for explicit HTTP endpoint use cases.
464
+
401
465
  ### Duplicate skills shown in UI after older installs
402
466
 
403
467
  Installer now auto-cleans nested duplicate skills (for example duplicates under `postman/*`).