@toa.io/extensions.exposition 1.0.0-alpha.286 → 1.0.0-alpha.288
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 +16 -0
- package/components/identity.basic/tsconfig.tsbuildinfo +1 -1
- package/components/identity.clients/tsconfig.tsbuildinfo +1 -1
- package/components/identity.credentials/tsconfig.tsbuildinfo +1 -1
- package/components/identity.federation/tsconfig.tsbuildinfo +1 -1
- package/components/identity.grants/tsconfig.tsbuildinfo +1 -1
- package/components/identity.keys/tsconfig.tsbuildinfo +1 -1
- package/components/identity.otp/tsconfig.tsbuildinfo +1 -1
- package/components/identity.passkeys/manifest.toa.yaml +2 -1
- package/components/identity.passkeys/source/errors.test.ts +34 -0
- package/components/identity.passkeys/source/webauthn.test.ts +26 -0
- package/components/identity.passkeys/tsconfig.tsbuildinfo +1 -1
- package/components/identity.passkeys/types/toa.d.ts +1 -1
- package/components/identity.tokens/tsconfig.tsbuildinfo +1 -1
- package/documentation/access.md +22 -4
- package/documentation/discovery.md +81 -0
- package/documentation/help.md +109 -0
- package/documentation/introspection.md +34 -9
- package/documentation/mcp.md +13 -16
- package/features/cors.feature +31 -1
- package/features/dev.feature +2 -0
- package/features/discovery.feature +211 -0
- package/features/discovery.ui.feature +197 -0
- package/features/help.feature +466 -0
- package/features/introspection.feature +94 -8
- package/features/map.feature +1 -0
- package/features/mcp.feature +74 -12
- package/features/methods.feature +2 -1
- package/features/oauth.grants.feature +3 -1
- package/features/octets.download.feature +1 -0
- package/features/octets.meta.feature +1 -0
- package/features/site/_app/immutable/asset.js +1 -0
- package/features/site/favicon.ico +0 -0
- package/features/site/index.html +10 -0
- package/features/steps/Parameters.ts +12 -0
- package/package.json +6 -4
- package/readme.md +3 -0
- package/source/Directive.ts +4 -0
- package/source/Discovery/Explorer.ts +34 -0
- package/source/Discovery/Site.test.ts +147 -0
- package/source/Discovery/Site.ts +202 -0
- package/source/Discovery/index.ts +3 -0
- package/source/Discovery/tree.test.ts +175 -0
- package/source/Discovery/tree.ts +77 -0
- package/source/Discovery/trunk.ts +23 -0
- package/source/Endpoint.ts +4 -0
- package/source/Gateway.ts +34 -4
- package/source/HTTP/Context.ts +7 -0
- package/source/Introspection.ts +33 -10
- package/source/MCP/schema.ts +16 -5
- package/source/MCP/tools.ts +14 -32
- package/source/Mapping.ts +5 -0
- package/source/Query.ts +17 -2
- package/source/RTD/Directives.ts +10 -0
- package/source/RTD/Endpoint.ts +8 -1
- package/source/RTD/Node.ts +20 -6
- package/source/RTD/Tree.ts +19 -9
- package/source/RTD/factory.ts +37 -1
- package/source/RTD/segment.ts +21 -0
- package/source/const.ts +8 -0
- package/source/directives/auth/Anonymous.test.ts +31 -5
- package/source/directives/auth/Anonymous.ts +5 -3
- package/source/directives/auth/Anyone.ts +6 -0
- package/source/directives/auth/Assert.ts +5 -0
- package/source/directives/auth/Delegate.ts +5 -2
- package/source/directives/auth/Federation.ts +11 -0
- package/source/directives/auth/Id.ts +15 -0
- package/source/directives/auth/Input.ts +5 -0
- package/source/directives/auth/Role.ts +17 -0
- package/source/directives/cors/CORS.test.ts +75 -0
- package/source/directives/cors/CORS.ts +10 -3
- package/source/directives/help/Family.ts +118 -0
- package/source/directives/help/Help.test.ts +227 -0
- package/source/directives/help/Help.ts +26 -0
- package/source/directives/help/Parameters.ts +47 -0
- package/source/directives/help/described.ts +57 -0
- package/source/directives/help/index.ts +45 -0
- package/source/directives/index.ts +8 -1
- package/source/directives/map/Headers.ts +6 -6
- package/source/directives/mcp/MCP.ts +12 -21
- package/source/directives/mcp/Tool.test.ts +22 -68
- package/source/directives/mcp/Tool.ts +14 -41
- package/transpiled/Directive.d.ts +1 -0
- package/transpiled/Directive.js +3 -0
- package/transpiled/Directive.js.map +1 -1
- package/transpiled/Discovery/Explorer.d.ts +11 -0
- package/transpiled/Discovery/Explorer.js +29 -0
- package/transpiled/Discovery/Explorer.js.map +1 -0
- package/transpiled/Discovery/Site.d.ts +43 -0
- package/transpiled/Discovery/Site.js +171 -0
- package/transpiled/Discovery/Site.js.map +1 -0
- package/transpiled/Discovery/index.d.ts +3 -0
- package/transpiled/Discovery/index.js +4 -0
- package/transpiled/Discovery/index.js.map +1 -0
- package/transpiled/Discovery/tree.d.ts +26 -0
- package/transpiled/Discovery/tree.js +50 -0
- package/transpiled/Discovery/tree.js.map +1 -0
- package/transpiled/Discovery/trunk.d.ts +10 -0
- package/transpiled/Discovery/trunk.js +21 -0
- package/transpiled/Discovery/trunk.js.map +1 -0
- package/transpiled/Endpoint.d.ts +2 -1
- package/transpiled/Endpoint.js +3 -0
- package/transpiled/Endpoint.js.map +1 -1
- package/transpiled/Gateway.d.ts +4 -0
- package/transpiled/Gateway.js +29 -4
- package/transpiled/Gateway.js.map +1 -1
- package/transpiled/HTTP/Context.d.ts +6 -0
- package/transpiled/HTTP/Context.js +6 -0
- package/transpiled/HTTP/Context.js.map +1 -1
- package/transpiled/Introspection.d.ts +18 -7
- package/transpiled/Introspection.js +16 -1
- package/transpiled/Introspection.js.map +1 -1
- package/transpiled/MCP/schema.d.ts +2 -2
- package/transpiled/MCP/schema.js +11 -5
- package/transpiled/MCP/schema.js.map +1 -1
- package/transpiled/MCP/tools.d.ts +1 -1
- package/transpiled/MCP/tools.js +12 -28
- package/transpiled/MCP/tools.js.map +1 -1
- package/transpiled/Mapping.d.ts +2 -0
- package/transpiled/Mapping.js +4 -0
- package/transpiled/Mapping.js.map +1 -1
- package/transpiled/Query.d.ts +12 -0
- package/transpiled/Query.js +16 -2
- package/transpiled/Query.js.map +1 -1
- package/transpiled/RTD/Directives.d.ts +8 -0
- package/transpiled/RTD/Endpoint.d.ts +7 -1
- package/transpiled/RTD/Node.d.ts +11 -2
- package/transpiled/RTD/Node.js +12 -2
- package/transpiled/RTD/Node.js.map +1 -1
- package/transpiled/RTD/Tree.js +15 -8
- package/transpiled/RTD/Tree.js.map +1 -1
- package/transpiled/RTD/factory.js +27 -1
- package/transpiled/RTD/factory.js.map +1 -1
- package/transpiled/RTD/segment.d.ts +7 -0
- package/transpiled/RTD/segment.js +17 -0
- package/transpiled/RTD/segment.js.map +1 -1
- package/transpiled/const.d.ts +7 -0
- package/transpiled/const.js +7 -0
- package/transpiled/const.js.map +1 -1
- package/transpiled/directives/auth/Anonymous.d.ts +4 -2
- package/transpiled/directives/auth/Anonymous.js +5 -3
- package/transpiled/directives/auth/Anonymous.js.map +1 -1
- package/transpiled/directives/auth/Anyone.d.ts +3 -0
- package/transpiled/directives/auth/Anyone.js +4 -0
- package/transpiled/directives/auth/Anyone.js.map +1 -1
- package/transpiled/directives/auth/Assert.d.ts +2 -0
- package/transpiled/directives/auth/Assert.js +4 -0
- package/transpiled/directives/auth/Assert.js.map +1 -1
- package/transpiled/directives/auth/Delegate.d.ts +4 -1
- package/transpiled/directives/auth/Delegate.js +5 -2
- package/transpiled/directives/auth/Delegate.js.map +1 -1
- package/transpiled/directives/auth/Federation.d.ts +5 -0
- package/transpiled/directives/auth/Federation.js +8 -0
- package/transpiled/directives/auth/Federation.js.map +1 -1
- package/transpiled/directives/auth/Id.d.ts +9 -0
- package/transpiled/directives/auth/Id.js +12 -0
- package/transpiled/directives/auth/Id.js.map +1 -1
- package/transpiled/directives/auth/Input.d.ts +2 -0
- package/transpiled/directives/auth/Input.js +4 -0
- package/transpiled/directives/auth/Input.js.map +1 -1
- package/transpiled/directives/auth/Role.d.ts +7 -0
- package/transpiled/directives/auth/Role.js +11 -0
- package/transpiled/directives/auth/Role.js.map +1 -1
- package/transpiled/directives/cors/CORS.js +9 -2
- package/transpiled/directives/cors/CORS.js.map +1 -1
- package/transpiled/directives/help/Family.d.ts +28 -0
- package/transpiled/directives/help/Family.js +79 -0
- package/transpiled/directives/help/Family.js.map +1 -0
- package/transpiled/directives/help/Help.d.ts +16 -0
- package/transpiled/directives/help/Help.js +22 -0
- package/transpiled/directives/help/Help.js.map +1 -0
- package/transpiled/directives/help/Parameters.d.ts +18 -0
- package/transpiled/directives/help/Parameters.js +34 -0
- package/transpiled/directives/help/Parameters.js.map +1 -0
- package/transpiled/directives/help/described.d.ts +16 -0
- package/transpiled/directives/help/described.js +23 -0
- package/transpiled/directives/help/described.js.map +1 -0
- package/transpiled/directives/help/index.d.ts +22 -0
- package/transpiled/directives/help/index.js +34 -0
- package/transpiled/directives/help/index.js.map +1 -0
- package/transpiled/directives/index.d.ts +4 -0
- package/transpiled/directives/index.js +8 -1
- package/transpiled/directives/index.js.map +1 -1
- package/transpiled/directives/map/Headers.d.ts +5 -0
- package/transpiled/directives/map/Headers.js +7 -5
- package/transpiled/directives/map/Headers.js.map +1 -1
- package/transpiled/directives/mcp/MCP.d.ts +8 -5
- package/transpiled/directives/mcp/MCP.js +9 -13
- package/transpiled/directives/mcp/MCP.js.map +1 -1
- package/transpiled/directives/mcp/Tool.d.ts +6 -12
- package/transpiled/directives/mcp/Tool.js +10 -23
- package/transpiled/directives/mcp/Tool.js.map +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/ui/dist/_app/env.js +1 -0
- package/ui/dist/_app/immutable/assets/0.BcIGtTfw.css +2 -0
- package/ui/dist/_app/immutable/assets/2.BC0-Jhqu.css +1 -0
- package/ui/dist/_app/immutable/assets/inter-cyrillic-ext-wght-normal.BOeWTOD4.woff2 +0 -0
- package/ui/dist/_app/immutable/assets/inter-cyrillic-wght-normal.DqGufNeO.woff2 +0 -0
- package/ui/dist/_app/immutable/assets/inter-greek-ext-wght-normal.DlzME5K_.woff2 +0 -0
- package/ui/dist/_app/immutable/assets/inter-greek-wght-normal.CkhJZR-_.woff2 +0 -0
- package/ui/dist/_app/immutable/assets/inter-latin-ext-wght-normal.DO1Apj_S.woff2 +0 -0
- package/ui/dist/_app/immutable/assets/inter-latin-wght-normal.Dx4kXJAl.woff2 +0 -0
- package/ui/dist/_app/immutable/assets/inter-vietnamese-wght-normal.CBcvBZtf.woff2 +0 -0
- package/ui/dist/_app/immutable/chunks/BgTrzN6u.js +1 -0
- package/ui/dist/_app/immutable/chunks/Bjy-W4x2.js +81 -0
- package/ui/dist/_app/immutable/chunks/CWJaG9mK.js +6 -0
- package/ui/dist/_app/immutable/chunks/DjIYL2zC.js +3 -0
- package/ui/dist/_app/immutable/chunks/xihTtKlq.js +1 -0
- package/ui/dist/_app/immutable/chunks/yDQhitF9.js +1 -0
- package/ui/dist/_app/immutable/entry/app.WZSMBcGf.js +2 -0
- package/ui/dist/_app/immutable/entry/start._LkoC6Lz.js +1 -0
- package/ui/dist/_app/immutable/nodes/0.Dl2DqINo.js +1 -0
- package/ui/dist/_app/immutable/nodes/1.CSSnGhVD.js +1 -0
- package/ui/dist/_app/immutable/nodes/2.DmolQyNG.js +14 -0
- package/ui/dist/_app/version.json +1 -0
- package/ui/dist/apple-touch-icon.png +0 -0
- package/ui/dist/favicon-96x96.png +0 -0
- package/ui/dist/favicon.ico +0 -0
- package/ui/dist/index.html +66 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Headers.js","sourceRoot":"","sources":["../../../source/directives/map/Headers.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAI7C;;;;GAIG;AACH,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAA;AAE7C,MAAM,OAAO,OAAQ,SAAQ,OAA+B;IACzC,OAAO,CAAU;IAElC,YAAmB,GAA2B;QAC5C,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,WAAW,KAAK,MAAM,EAAE,iCAAiC,CAAC,CAAA;QAExE,MAAM,CAAC,EAAE,CACP,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,KAAK,KAA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tool.js';
|
|
2
|
+
import type { DirectiveFamily } from '../../RTD/index.js';
|
|
2
3
|
import type { Context } from '../../HTTP/index.js';
|
|
3
4
|
import type { Introspection } from '../../Introspection.js';
|
|
4
|
-
import type { DirectiveFamily } from '../../RTD/index.js';
|
|
5
5
|
/** The name the family is declared under, and what `MCP` asks a method for. */
|
|
6
6
|
export declare const FAMILY = "mcp";
|
|
7
7
|
export declare class MCP implements DirectiveFamily<Tool> {
|
|
8
8
|
readonly name = "mcp";
|
|
9
9
|
readonly mandatory = false;
|
|
10
|
-
/**
|
|
11
|
-
static published(directives: Tool[] | undefined):
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
/** Whether this method is published, which is what the nearest declaration says. */
|
|
11
|
+
static published(directives: Tool[] | undefined): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Whether this method is published to a model, which is what the route declares. Whether
|
|
14
|
+
* one is served at all is the annotation's, and a route says nothing of that.
|
|
15
|
+
*/
|
|
14
16
|
explain(directives: Tool[], _: Context, introspection: Introspection): Introspection;
|
|
17
|
+
create(name: string, value: unknown, _: unknown, route: string): Tool;
|
|
15
18
|
}
|
|
@@ -5,25 +5,21 @@ export const FAMILY = 'mcp';
|
|
|
5
5
|
export class MCP {
|
|
6
6
|
name = FAMILY;
|
|
7
7
|
mandatory = false;
|
|
8
|
-
/**
|
|
8
|
+
/** Whether this method is published, which is what the nearest declaration says. */
|
|
9
9
|
static published(directives) {
|
|
10
|
-
return directives?.[0] ??
|
|
10
|
+
return directives?.[0]?.published ?? false;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Whether this method is published to a model, which is what the route declares. Whether
|
|
14
|
+
* one is served at all is the annotation's, and a route says nothing of that.
|
|
15
|
+
*/
|
|
16
|
+
explain(directives, _, introspection) {
|
|
17
|
+
return MCP.published(directives) ? { ...introspection, mcp: true } : introspection;
|
|
11
18
|
}
|
|
12
19
|
// eslint-disable-next-line max-params
|
|
13
20
|
create(name, value, _, route) {
|
|
14
21
|
assert.ok(name === 'tool', `Unknown directive: mcp:${name}`);
|
|
15
22
|
return new Tool(value, route);
|
|
16
23
|
}
|
|
17
|
-
/** What the route states this method is, which is the only thing that states it. */
|
|
18
|
-
explain(directives, _, introspection) {
|
|
19
|
-
const tool = MCP.published(directives);
|
|
20
|
-
if (tool === null)
|
|
21
|
-
return introspection;
|
|
22
|
-
return {
|
|
23
|
-
...introspection,
|
|
24
|
-
description: tool.description,
|
|
25
|
-
...(tool.title === undefined ? {} : { title: tool.title })
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
24
|
}
|
|
29
25
|
//# sourceMappingURL=MCP.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MCP.js","sourceRoot":"","sources":["../../../source/directives/mcp/MCP.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAKhC,+EAA+E;AAC/E,MAAM,CAAC,MAAM,MAAM,GAAG,KAAK,CAAA;AAE3B,MAAM,OAAO,GAAG;IACE,IAAI,GAAG,MAAM,CAAA;IACb,SAAS,GAAG,KAAK,CAAA;IAEjC,oFAAoF;IAC7E,MAAM,CAAC,SAAS,CAAC,UAA8B;QACpD,OAAO,UAAU,EAAE,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"MCP.js","sourceRoot":"","sources":["../../../source/directives/mcp/MCP.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAKhC,+EAA+E;AAC/E,MAAM,CAAC,MAAM,MAAM,GAAG,KAAK,CAAA;AAE3B,MAAM,OAAO,GAAG;IACE,IAAI,GAAG,MAAM,CAAA;IACb,SAAS,GAAG,KAAK,CAAA;IAEjC,oFAAoF;IAC7E,MAAM,CAAC,SAAS,CAAC,UAA8B;QACpD,OAAO,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,IAAI,KAAK,CAAA;IAC5C,CAAC;IAED;;;OAGG;IACI,OAAO,CAAC,UAAkB,EAAE,CAAU,EAAE,aAA4B;QACzE,OAAO,GAAG,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,aAAa,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,aAAa,CAAA;IACpF,CAAC;IAED,sCAAsC;IAC/B,MAAM,CAAC,IAAY,EAAE,KAAc,EAAE,CAAU,EAAE,KAAa;QACnE,MAAM,CAAC,EAAE,CAAC,IAAI,KAAK,MAAM,EAAE,0BAA0B,IAAI,EAAE,CAAC,CAAA;QAE5D,OAAO,IAAI,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;IAC/B,CAAC;CACF"}
|
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* says
|
|
4
|
-
*
|
|
2
|
+
* Whether one method is published to a model. Declaring it is what publishes it, and it
|
|
3
|
+
* says nothing else — what a tool is, is [`help:method`](../help/Help.ts), which is what
|
|
4
|
+
* describes the method to everything else as well.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* a mapping.
|
|
9
|
-
*
|
|
10
|
-
* The operation states what it is too, and that is not this. An operation is written without
|
|
11
|
-
* knowledge of any route, and a tool is an operation and a route together — the same
|
|
12
|
-
* operation mounted twice is two tools, and one sentence is not true of both.
|
|
6
|
+
* `false` withdraws one: the declaration is inherited, as every directive is, and a node
|
|
7
|
+
* publishing what is under it is how a subtree is published at all.
|
|
13
8
|
*/
|
|
14
9
|
export declare class Tool {
|
|
15
|
-
readonly
|
|
16
|
-
readonly title: string | undefined;
|
|
10
|
+
readonly published: boolean;
|
|
17
11
|
constructor(value: unknown, route: string);
|
|
18
12
|
}
|
|
@@ -2,35 +2,22 @@ import assert from 'node:assert';
|
|
|
2
2
|
import { refusal } from '../../RPC/names.js';
|
|
3
3
|
import { segment } from '../../RTD/segment.js';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
* says
|
|
7
|
-
*
|
|
5
|
+
* Whether one method is published to a model. Declaring it is what publishes it, and it
|
|
6
|
+
* says nothing else — what a tool is, is [`help:method`](../help/Help.ts), which is what
|
|
7
|
+
* describes the method to everything else as well.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* a mapping.
|
|
12
|
-
*
|
|
13
|
-
* The operation states what it is too, and that is not this. An operation is written without
|
|
14
|
-
* knowledge of any route, and a tool is an operation and a route together — the same
|
|
15
|
-
* operation mounted twice is two tools, and one sentence is not true of both.
|
|
9
|
+
* `false` withdraws one: the declaration is inherited, as every directive is, and a node
|
|
10
|
+
* publishing what is under it is how a subtree is published at all.
|
|
16
11
|
*/
|
|
17
12
|
export class Tool {
|
|
18
|
-
|
|
19
|
-
title;
|
|
13
|
+
published;
|
|
20
14
|
constructor(value, route) {
|
|
21
|
-
|
|
22
|
-
assert.ok(typeof stated === 'object' && stated !== null && !Array.isArray(stated), 'Directive mcp:tool: the value is what the tool is, or a `title` and a `description`');
|
|
23
|
-
const { description, title, ...rest } = stated;
|
|
24
|
-
assert.ok(Object.keys(rest).length === 0, `Directive mcp:tool: unknown ${Object.keys(rest)
|
|
25
|
-
.map((key) => `'${key}'`)
|
|
26
|
-
.join(', ')}`);
|
|
27
|
-
assert.ok(typeof description === 'string' && description.trim().length > 0, 'Directive mcp:tool: a description cannot be empty');
|
|
28
|
-
assert.ok(title === undefined || (typeof title === 'string' && title.trim().length > 0), 'Directive mcp:tool: a title cannot be empty');
|
|
15
|
+
assert.ok(typeof value === 'boolean', 'Directive mcp:tool: the value is whether the method is published; what it is, is `help:method`');
|
|
29
16
|
// a tool is called by name, so a route that cannot be named cannot be one — said where
|
|
30
17
|
// the mistake is, rather than as a tool that is quietly never listed
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
this.
|
|
18
|
+
if (value)
|
|
19
|
+
assert.ok(refusal(segment(route)) === null, `Directive mcp:tool: '${route}' holds a segment no tool name can spell`);
|
|
20
|
+
this.published = value;
|
|
34
21
|
}
|
|
35
22
|
}
|
|
36
23
|
//# sourceMappingURL=Tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tool.js","sourceRoot":"","sources":["../../../source/directives/mcp/Tool.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAE9C
|
|
1
|
+
{"version":3,"file":"Tool.js","sourceRoot":"","sources":["../../../source/directives/mcp/Tool.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAE9C;;;;;;;GAOG;AACH,MAAM,OAAO,IAAI;IACC,SAAS,CAAS;IAElC,YAAmB,KAAc,EAAE,KAAa;QAC9C,MAAM,CAAC,EAAE,CACP,OAAO,KAAK,KAAK,SAAS,EAC1B,gGAAgG,CACjG,CAAA;QAED,uFAAuF;QACvF,qEAAqE;QACrE,IAAI,KAAK;YACP,MAAM,CAAC,EAAE,CACP,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,EAChC,wBAAwB,KAAK,0CAA0C,CACxE,CAAA;QAEH,IAAI,CAAC,SAAS,GAAG,KAAK,CAAA;IACxB,CAAC;CACF"}
|