@frontmcp/skills 1.8.0 → 1.8.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.
Files changed (38) hide show
  1. package/catalog/create-tool/examples/08-tool-with-provider-injection.md +2 -2
  2. package/catalog/create-tool/examples/22-tool-with-ui-html-template.md +7 -7
  3. package/catalog/create-tool/examples/24-tool-with-ui-csp-and-bridge.md +3 -3
  4. package/catalog/create-tool/references/decorator-options.md +1 -0
  5. package/catalog/create-tool/references/elicitation.md +9 -0
  6. package/catalog/create-tool/references/error-handling.md +10 -6
  7. package/catalog/create-tool/references/execution-context.md +7 -3
  8. package/catalog/create-tool/references/input-schema.md +2 -0
  9. package/catalog/create-tool/references/output-schema.md +6 -1
  10. package/catalog/create-tool/references/throttling.md +7 -8
  11. package/catalog/create-tool/references/ui-widgets.md +14 -1
  12. package/catalog/frontmcp-authorities/SKILL.md +1 -0
  13. package/catalog/frontmcp-authorities/references/custom-evaluators.md +13 -2
  14. package/catalog/frontmcp-authorities/references/rbac-abac-rebac.md +2 -0
  15. package/catalog/frontmcp-config/examples/configure-skills-http/inject-instructions.md +4 -4
  16. package/catalog/frontmcp-config/references/configure-auth.md +1 -0
  17. package/catalog/frontmcp-config/references/configure-skills-http.md +2 -2
  18. package/catalog/frontmcp-config/references/configure-throttle-guard-config.md +5 -5
  19. package/catalog/frontmcp-config/references/configure-throttle.md +49 -22
  20. package/catalog/frontmcp-deployment/references/deploy-to-cloudflare-skills-only.md +4 -0
  21. package/catalog/frontmcp-deployment/references/deploy-to-cloudflare.md +1 -1
  22. package/catalog/frontmcp-development/examples/create-plugin-hooks/caching-with-around.md +7 -6
  23. package/catalog/frontmcp-development/examples/official-plugins/production-multi-plugin-setup.md +2 -2
  24. package/catalog/frontmcp-development/references/create-plugin-hooks.md +21 -17
  25. package/catalog/frontmcp-development/references/create-prompt.md +18 -16
  26. package/catalog/frontmcp-development/references/create-provider.md +3 -3
  27. package/catalog/frontmcp-development/references/create-resource.md +10 -8
  28. package/catalog/frontmcp-development/references/create-skill.md +7 -0
  29. package/catalog/frontmcp-development/references/decorators-guide.md +9 -8
  30. package/catalog/frontmcp-development/references/official-plugins.md +77 -6
  31. package/catalog/frontmcp-development/references/openapi-adapter.md +2 -1
  32. package/catalog/frontmcp-observability/references/metrics-endpoint.md +1 -1
  33. package/catalog/frontmcp-observability/references/structured-logging.md +35 -0
  34. package/catalog/frontmcp-testing/examples/test-e2e-handler/tool-call-and-error-e2e.md +3 -1
  35. package/catalog/frontmcp-testing/references/setup-testing.md +9 -9
  36. package/catalog/frontmcp-testing/references/test-e2e-handler.md +35 -0
  37. package/catalog/skills-manifest.json +3 -2
  38. package/package.json +1 -1
@@ -67,6 +67,41 @@ describe('Server E2E', () => {
67
67
  });
68
68
  ```
69
69
 
70
+ ## Error Codes
71
+
72
+ Errors raised while a tool runs, including invalid input, come back as a tool result with `isError: true` and a string `_meta.code`, not as a JSON-RPC error. Match them with the string form, and keep the numeric form for JSON-RPC errors:
73
+
74
+ ```typescript
75
+ expect(await client.tools.call('add_numbers', { a: 5 })).toBeError('INVALID_INPUT');
76
+ expect(await client.tools.call('nonexistent_tool', {})).toBeError('TOOL_NOT_FOUND');
77
+ expect(await client.prompts.get('nonexistent_prompt')).toBeError(-32602);
78
+ ```
79
+
80
+ A tool without an `outputSchema` that returns a plain number sends `{ value: 8 }`, so assert `expect(result.json()).toEqual({ value: 8 })`.
81
+
82
+ ## Notifications and Progress
83
+
84
+ After `initialize`, `McpTestClient` opens the session's notification stream (a `GET` on the MCP endpoint) and records what the server sends there and on each request's own response:
85
+
86
+ ```typescript
87
+ it('records progress and log messages', async () => {
88
+ const progress = client.notifications.collectProgress(); // tools.call now sends a _meta.progressToken
89
+ const notifications = client.notifications.collect();
90
+ await client.raw.request({ jsonrpc: '2.0', id: 1, method: 'logging/setLevel', params: { level: 'info' } });
91
+
92
+ await client.tools.call('import_files', {});
93
+
94
+ await progress.waitForComplete(5000);
95
+ expect(progress.all.length).toBeGreaterThan(0);
96
+ await notifications.waitFor('notifications/message', 5000);
97
+ });
98
+ ```
99
+
100
+ - Pass `{ progressToken }` as the third argument of `tools.call()` to choose the token yourself.
101
+ - The server sends `notifications/message` (from `this.notify()`) only after `logging/setLevel`.
102
+ - Session-stream notifications can arrive after the call's result, so wait with `waitFor()` / `waitForComplete()` before asserting.
103
+ - `McpTestClient` speaks `2025-06-18` by default. `2026-07-28` has no `initialize` handshake, so `withProtocolVersion('2026-07-28')` makes `build()` throw.
104
+
70
105
  ## Examples
71
106
 
72
107
  | Example | Level | Description |
@@ -365,7 +365,7 @@
365
365
  "features": [
366
366
  "Restricting the widget's outbound `fetch` via `ui.csp.connectDomains` (emitted on the resource per #455)",
367
367
  "Opting the widget into cross-tool calls with `widgetAccessible: true` and using `window.FrontMcpBridge.callTool(name, args)` instead of host-specific APIs",
368
- "Embedding initial data into the widget's inline `<script>` safely via `ctx.helpers.jsonEmbed(...)` (escapes `</script>`)",
368
+ "Embedding initial data into the widget's inline `<script>` safely via `ctx.helpers.jsonEmbed(...)` (escapes `<`, `>` and `&`)",
369
369
  "Surfacing in-flight status via `invocationStatus.invoking` / `invoked` so the host UI shows feedback"
370
370
  ]
371
371
  },
@@ -1069,7 +1069,7 @@
1069
1069
  "Top-level `instructions` on `@FrontMcp` exposes a global system prompt to MCP clients",
1070
1070
  "`skillsConfig.injectInstructions: 'append'` adds the skill catalog summary after the user prompt",
1071
1071
  "Dynamic skills are picked up because the composer runs on every initialize request",
1072
- "Catalog summary is bounded at 16 KB with a truncation footer pointing at skill://catalog"
1072
+ "Catalog summary is bounded at 16 KB with a truncation footer pointing at skill://index.json"
1073
1073
  ]
1074
1074
  },
1075
1075
  {
@@ -3449,6 +3449,7 @@
3449
3449
  "Calling tools via `client.tools.call(name, args)` and asserting success with `toBeSuccessful()`",
3450
3450
  "Asserting text content with the `toHaveTextContent()` matcher",
3451
3451
  "Asserting error results with `toBeError()` for invalid input and unknown tools",
3452
+ "Matching the tool error code: invalid input is an `isError` result with `_meta.code: \"INVALID_INPUT\"`, so `toBeError('INVALID_INPUT')` matches it (a numeric code matches JSON-RPC errors only)",
3452
3453
  "Testing edge cases like zero values"
3453
3454
  ]
3454
3455
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontmcp/skills",
3
- "version": "1.8.0",
3
+ "version": "1.8.1",
4
4
  "description": "Curated skills catalog for FrontMCP projects",
5
5
  "author": "AgentFront <info@agentfront.dev>",
6
6
  "homepage": "https://docs.agentfront.dev",