@ontrails/mcp 1.0.0-beta.5 → 1.0.0-beta.50
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/CHANGELOG.md +416 -12
- package/README.md +69 -17
- package/package.json +16 -3
- package/src/annotations.ts +24 -1
- package/src/build.ts +1335 -136
- package/src/index.ts +32 -4
- package/src/progress.ts +22 -0
- package/src/resources.ts +336 -0
- package/src/stdio.ts +9 -1
- package/src/surface.ts +295 -0
- package/src/tool-name.ts +6 -7
- package/.turbo/turbo-build.log +0 -1
- package/.turbo/turbo-lint.log +0 -3
- package/.turbo/turbo-typecheck.log +0 -1
- package/dist/annotations.d.ts +0 -19
- package/dist/annotations.d.ts.map +0 -1
- package/dist/annotations.js +0 -31
- package/dist/annotations.js.map +0 -1
- package/dist/blaze.d.ts +0 -36
- package/dist/blaze.d.ts.map +0 -1
- package/dist/blaze.js +0 -96
- package/dist/blaze.js.map +0 -1
- package/dist/build.d.ts +0 -40
- package/dist/build.d.ts.map +0 -1
- package/dist/build.js +0 -227
- package/dist/build.js.map +0 -1
- package/dist/index.d.ts +0 -7
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -13
- package/dist/index.js.map +0 -1
- package/dist/progress.d.ts +0 -13
- package/dist/progress.d.ts.map +0 -1
- package/dist/progress.js +0 -51
- package/dist/progress.js.map +0 -1
- package/dist/stdio.d.ts +0 -12
- package/dist/stdio.d.ts.map +0 -1
- package/dist/stdio.js +0 -15
- package/dist/stdio.js.map +0 -1
- package/dist/tool-name.d.ts +0 -15
- package/dist/tool-name.d.ts.map +0 -1
- package/dist/tool-name.js +0 -19
- package/dist/tool-name.js.map +0 -1
- package/src/__tests__/annotations.test.ts +0 -63
- package/src/__tests__/blaze.test.ts +0 -105
- package/src/__tests__/build.test.ts +0 -453
- package/src/__tests__/progress.test.ts +0 -136
- package/src/__tests__/tool-name.test.ts +0 -46
- package/src/blaze.ts +0 -146
- package/tsconfig.json +0 -9
- package/tsconfig.tsbuildinfo +0 -1
package/src/annotations.ts
CHANGED
|
@@ -25,9 +25,32 @@ export interface McpAnnotations {
|
|
|
25
25
|
*
|
|
26
26
|
* Only sets hints that are explicitly declared on the trail.
|
|
27
27
|
* Omitted hints let the MCP SDK use its defaults.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* import { deriveAnnotations } from '@ontrails/mcp';
|
|
32
|
+
*
|
|
33
|
+
* const annotations = deriveAnnotations({
|
|
34
|
+
* intent: 'read',
|
|
35
|
+
* idempotent: true,
|
|
36
|
+
* description: 'Show account',
|
|
37
|
+
* });
|
|
38
|
+
*
|
|
39
|
+
* // read intent -> readOnlyHint, idempotent -> idempotentHint, description -> title.
|
|
40
|
+
* annotations.readOnlyHint === true;
|
|
41
|
+
* annotations.idempotentHint === true;
|
|
42
|
+
* annotations.title === 'Show account';
|
|
43
|
+
*
|
|
44
|
+
* // destroy intent -> destructiveHint.
|
|
45
|
+
* const destroyAnnotations = deriveAnnotations({ intent: 'destroy' });
|
|
46
|
+
* destroyAnnotations.destructiveHint === true;
|
|
47
|
+
* ```
|
|
28
48
|
*/
|
|
29
49
|
export const deriveAnnotations = (
|
|
30
|
-
trail: Pick<
|
|
50
|
+
trail: Pick<
|
|
51
|
+
Trail<unknown, unknown, unknown>,
|
|
52
|
+
'intent' | 'idempotent' | 'description'
|
|
53
|
+
>
|
|
31
54
|
): McpAnnotations => {
|
|
32
55
|
const annotations: Record<string, unknown> = {};
|
|
33
56
|
|