@xpert-ai/plugin-sdk 3.18.5 → 3.18.7

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 (37) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +44 -0
  3. package/data-workbench.cjs.default.js +1 -0
  4. package/data-workbench.cjs.js +669 -0
  5. package/data-workbench.cjs.mjs +2 -0
  6. package/data-workbench.d.ts +1 -0
  7. package/data-workbench.esm.js +663 -0
  8. package/index.cjs.js +3118 -33
  9. package/index.esm.js +3109 -39
  10. package/model-provider.cjs.js +9 -0
  11. package/model-provider.esm.js +8 -2
  12. package/package.json +33 -27
  13. package/src/data-workbench.d.ts +3 -0
  14. package/src/lib/core/runtime-capability.d.ts +4 -0
  15. package/src/lib/core/strategy-bus.d.ts +3 -0
  16. package/src/lib/data/datasource/index.d.ts +3 -0
  17. package/src/lib/data/datasource/types.d.ts +2 -0
  18. package/src/lib/data/datasource/workbench-adapter.d.ts +39 -0
  19. package/src/lib/data/datasource/workbench-pagination.d.ts +6 -0
  20. package/src/lib/data/datasource/workbench-sql-lexer.d.ts +11 -0
  21. package/src/lib/data/datasource/workbench-sql-syntax.d.ts +3 -0
  22. package/src/lib/data/datasource/workbench-sql.d.ts +12 -0
  23. package/src/lib/data/datasource/workbench.d.ts +133 -0
  24. package/src/lib/rag/analyzer/index.d.ts +3 -0
  25. package/src/lib/rag/analyzer/strategy.decorator.d.ts +2 -0
  26. package/src/lib/rag/analyzer/strategy.interface.d.ts +11 -0
  27. package/src/lib/rag/analyzer/strategy.registry.d.ts +8 -0
  28. package/src/lib/rag/index.d.ts +1 -0
  29. package/src/lib/runtime/capabilities/index.d.ts +1 -0
  30. package/src/lib/runtime/capabilities/knowledge-graph.d.ts +59 -0
  31. package/src/lib/tool-provider/component.d.ts +2 -0
  32. package/src/lib/tool-provider/decorators.d.ts +1 -1
  33. package/src/lib/tool-provider/index.d.ts +3 -0
  34. package/src/lib/tool-provider/mcp-methods.d.ts +39 -0
  35. package/src/lib/tool-provider/provider-methods.d.ts +5 -0
  36. package/src/lib/tool-provider/tool-result.d.ts +1 -1
  37. package/src/lib/tool-provider/types.d.ts +12 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,40 @@
1
1
  # @xpert-ai/plugin-sdk
2
2
 
3
+ ## 3.18.7
4
+
5
+ ### Patch Changes
6
+
7
+ - 5213185: Expose keyword analyzer strategy interfaces, discovery metadata, and a scoped registry with exact source lookup. Add optional plugin removal preflight guards so hosts can protect active analyzer dependencies.
8
+
9
+ Correct read-only SQL classification for derived tables, CTE column declarations and type modifiers, and preserve duplicate MySQL output names with direct bounded pagination.
10
+
11
+ ## 3.18.6
12
+
13
+ ### Patch Changes
14
+
15
+ - a8a251d: Support non-tool MCP capabilities, task policies and transport-specific input validation on decorated tool providers. Pass execution-scoped workspace files and Agent feature configuration to middleware business methods and allow existing MCP result envelopes without requiring a new structured output schema.
16
+
17
+ Share runtime component fingerprinting across host entry points and include transport input schemas, task policies, resources, resource templates and prompts in update detection.
18
+
19
+ Add resource, resource-template and prompt method decorators with inherited method discovery, shared runtime/fingerprint definitions and legacy extension compatibility.
20
+
21
+ - 983b730: Prepare the Xpert 3.18.6 patch release, including plugin-sdk.
22
+
23
+ Extend decorated MCP capabilities and structured knowledge graph runtime contracts.
24
+ Improve document parsing and scanned-page understanding, semantic FAQ exclusion,
25
+ manual tags during document import, and per-knowledgebase vector storage selection.
26
+ Include schema-driven sliders and the scoped database workbench adapter.
27
+
28
+ The target platform version is 3.18.6. Verify contracts, plugin-sdk, and xpert-ui
29
+ all resolve to this version in the release version PR, including changelogs,
30
+ internal dependency references, and lockfile entries. Publish the separately
31
+ versioned Runtime Suite source images before creating platform-version aliases.
32
+
33
+ - Updated dependencies [9a2a2a0]
34
+ - Updated dependencies [089e3ff]
35
+ - Updated dependencies [983b730]
36
+ - @xpert-ai/contracts@3.18.6
37
+
3
38
  ## 3.18.5
4
39
 
5
40
  ### Patch Changes
package/README.md CHANGED
@@ -67,6 +67,50 @@ export class OrderOperationsTools {
67
67
 
68
68
  MCP exposure is explicit. Provide strict Zod input/output schemas and return an allowlisted DTO; the host validates the output and maps it to `structuredContent` and a JSON `TextContent` block so clients that only expose text can still read the result. With `resultFormat: 'tool_result'`, image and other content blocks are preserved and the validated structured metadata also receives a JSON text fallback. Invocation context is constructed for every call and must never be cached on the Provider singleton. `getMiddlewareExtensions()` may add Agent-only hooks such as `wrapToolCall`, but business-critical behavior belongs in the method or shared service.
69
69
 
70
+ Use the same `@XpertToolProvider` class for every capability:
71
+
72
+ | Decorator | Method signature | Result |
73
+ | ------------------------ | --------------------------------------------------------------- | ---------------------------- |
74
+ | `@XpertTool` | `(input, context)` | Tool DTO or content envelope |
75
+ | `@XpertResource` | `(context: ResourceReadContext)` | `McpResourceReadResult` |
76
+ | `@XpertResourceTemplate` | `(args: Record<string, string>, context: ResourceReadContext)` | `McpResourceReadResult` |
77
+ | `@XpertPrompt` | `(args: Record<string, string>, context: ToolExecutionContext)` | `McpPromptResult` |
78
+
79
+ No business base class is required. All four decorators support inherited methods;
80
+ a child override replaces the parent declaration, and an undecorated override
81
+ removes that exposure. The SDK reuses its existing `BuiltinToolset` adapter.
82
+ Resource-only and prompt-only providers are supported. Template and prompt options
83
+ can specify `completionMethod` to bind an instance `McpCompletionHandler`.
84
+
85
+ ```ts
86
+ @XpertResourceTemplate({
87
+ key: 'project', uriTemplate: 'example://projects/{projectId}',
88
+ arguments: { projectId: { required: true } }, requiredContext: ['tenant', 'principal']
89
+ })
90
+ readProject(args: Record<string, string>, context: ResourceReadContext) {
91
+ return this.projects.readResource(args.projectId, context)
92
+ }
93
+ ```
94
+
95
+ Handlers receive the current caller's context and retain their provider `this`.
96
+ Do not cache caller context on a singleton. `getMcpExtensions()` remains a legacy
97
+ compatibility hook; duplicate keys or public URIs/names are rejected when merged
98
+ with decorated declarations. Runtime publication and component fingerprints use
99
+ the same resolved definitions. App bundles remain in provider options.
100
+
101
+ Use `mcp.task` for the existing MCP task policy and `mcp.inputSchema` for stricter
102
+ transport inputs (for example, requiring project identity that native Workbench
103
+ calls may infer). The MCP adapter validates the shared schema first, then the
104
+ transport schema. The transport schema is advertised to MCP clients. Native
105
+ methods also receive execution-scoped workspace files via `context.host.files`
106
+ and the current Agent feature configuration via `context.xpertFeatures`.
107
+
108
+ Existing tools without a structured output contract may explicitly select
109
+ `resultFormat: 'tool_result'` and omit `outputSchema`. The SDK still validates the
110
+ content envelope and media blocks, but does not claim to validate business fields
111
+ in `structuredContent`. DTO-format MCP methods continue to require a strict
112
+ output schema, and supplied output schemas retain their validation.
113
+
70
114
  For completed operations, `prepareToolResult(() => project(result), () => minimalReceipt)` defers output mapping to the adapter. The normal path maps and validates once; projection, validation or JSON serialization failures recover a bounded receipt without executing the business method again. Declare `outputSchema: z.union([normalSchema, receiptSchema])`, with strict objects in every branch. The fallback is validated too. Business exceptions thrown before the method returns remain errors. With `tool_result`, both callbacks return the content envelope and the union describes its structured metadata. The MCP protocol still validates the published JSON Schema; custom Zod refinements remain enforced by the SDK. Do not put side effects inside either callback.
71
115
 
72
116
  For a host-native MCP App, declare each static HTML bundle once in the Provider's `apps` array, then bind a Tool with `mcp.app.resourceKey` and include `app` visibility. The App key must exist in the same Provider and its entry must be a relative `.html` path inside the packaged plugin. The host publishes the bundle as a `ui://` resource; plugins must not create a stdio server or put CSP/credentials in Tool results.
@@ -0,0 +1 @@
1
+ exports._default = require('./data-workbench.cjs.js').default;