stitchkit 0.41.0 → 0.43.0
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/README.md +22 -5
- package/dist/cli.js +2 -2
- package/dist/contract/errors-factory.d.ts +88 -15
- package/dist/contract/errors-factory.d.ts.map +1 -1
- package/dist/contract/errors.d.ts +4 -4
- package/dist/contract/errors.d.ts.map +1 -1
- package/dist/contract/factory.d.ts +29 -2
- package/dist/contract/factory.d.ts.map +1 -1
- package/dist/contract/index.d.ts +2 -2
- package/dist/contract/index.d.ts.map +1 -1
- package/dist/contract/index.js +2 -2
- package/dist/{index-dnkefke9.js → index-310bfer5.js} +1 -1
- package/dist/{index-4e1c0hsw.js → index-esqmem78.js} +101 -67
- package/dist/{index-sc67e454.js → index-gex6gxhe.js} +7 -4
- package/dist/{index-ncqqn1bc.js → index-h2wdcsby.js} +95 -17
- package/dist/{index-xax049k6.js → index-r6czv7yt.js} +58 -22
- package/dist/{index-809wc1tt.js → index-s4qsmgwe.js} +4 -1
- package/dist/index.js +2 -2
- package/dist/internal/typed.d.ts +8 -0
- package/dist/internal/typed.d.ts.map +1 -1
- package/dist/node.js +2 -2
- package/dist/observability/audit.d.ts +27 -15
- package/dist/observability/audit.d.ts.map +1 -1
- package/dist/observability/event.d.ts +2 -2
- package/dist/observability/index.d.ts +4 -4
- package/dist/observability/index.d.ts.map +1 -1
- package/dist/observability/index.js +70 -59
- package/dist/react.js +1 -1
- package/dist/server/create.d.ts.map +1 -1
- package/dist/server/error-hook.d.ts +8 -4
- package/dist/server/error-hook.d.ts.map +1 -1
- package/dist/server/index.js +7 -6
- package/dist/server/logger.d.ts +0 -1
- package/dist/server/logger.d.ts.map +1 -1
- package/dist/server/types.d.ts +8 -13
- package/dist/server/types.d.ts.map +1 -1
- package/dist/tools/agent.d.ts +1 -1
- package/dist/tools/agent.d.ts.map +1 -1
- package/dist/tools/flatten-join.d.ts.map +1 -1
- package/dist/tools/list-names.d.ts +8 -6
- package/dist/tools/list-names.d.ts.map +1 -1
- package/dist/tools/manifest.d.ts +13 -5
- package/dist/tools/manifest.d.ts.map +1 -1
- package/dist/tools/mcp-handler.d.ts +5 -4
- package/dist/tools/mcp-handler.d.ts.map +1 -1
- package/dist/tools/mcp-stdio.d.ts +3 -2
- package/dist/tools/mcp-stdio.d.ts.map +1 -1
- package/dist/tools/mcp.d.ts +49 -9
- package/dist/tools/mcp.d.ts.map +1 -1
- package/dist/tools/native-mcp.d.ts +4 -18
- package/dist/tools/native-mcp.d.ts.map +1 -1
- package/dist/tools/runtime-tool.d.ts +32 -1
- package/dist/tools/runtime-tool.d.ts.map +1 -1
- package/dist/tools/surface.d.ts +37 -0
- package/dist/tools/surface.d.ts.map +1 -0
- package/dist/tools/toolkit.d.ts +4 -4
- package/dist/tools/toolkit.d.ts.map +1 -1
- package/dist/tools/transports.d.ts +11 -9
- package/dist/tools/transports.d.ts.map +1 -1
- package/dist/tools/view-file.d.ts +3 -3
- package/dist/tools.d.ts +6 -6
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +330 -155
- package/llms-full.txt +524 -131
- package/llms.txt +1 -0
- package/package.json +2 -2
package/dist/react.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/server/create.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/server/create.ts"],"names":[],"mappings":"AA+CA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAA2B,MAAM,SAAS,CAAC;AAIpF,wBAAgB,aAAa,CAAC,OAAO,GAAG,OAAO,EAC7C,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,GAC7B,YAAY,CAAC,OAAO,CAAC,CAofvB"}
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
*/
|
|
34
34
|
import type { RuntimeContext } from '../contract';
|
|
35
35
|
import { type StitchErrorCode } from '../contract';
|
|
36
|
-
import type { LifecycleHooks } from './types';
|
|
36
|
+
import type { LifecycleHooks, MethodDef } from './types';
|
|
37
37
|
/** The normalised error handed to `render` — code already remapped. */
|
|
38
38
|
export interface ResolvedError {
|
|
39
39
|
/** Wire code — the app code from `codeMap` for a stitch error, else the thrown code. */
|
|
@@ -62,9 +62,13 @@ export interface ErrorHookConfig<TWireCode extends string = string> {
|
|
|
62
62
|
* in the envelope, which is the ordinary reason to have one. Declaring the
|
|
63
63
|
* parameter is optional: a one-argument `render` stays assignable.
|
|
64
64
|
*/
|
|
65
|
-
render: (info: ResolvedError, ctx: RuntimeContext) => unknown
|
|
66
|
-
/**
|
|
67
|
-
|
|
65
|
+
render: (info: ResolvedError, ctx: RuntimeContext, endpoint?: MethodDef) => unknown | Promise<unknown>;
|
|
66
|
+
/**
|
|
67
|
+
* Observe the raw thrown value before rendering — logging, metrics or
|
|
68
|
+
* asynchronous request attribution. The matched endpoint is absent for
|
|
69
|
+
* failures that happen before the router resolves an operation.
|
|
70
|
+
*/
|
|
71
|
+
onError?: (error: unknown, info: ResolvedError, ctx: RuntimeContext, endpoint?: MethodDef) => unknown | Promise<unknown>;
|
|
68
72
|
}
|
|
69
73
|
/** Build an `onError` hook from a code map + envelope renderer. */
|
|
70
74
|
export declare function createErrorHook<TWireCode extends string = string>(config: ErrorHookConfig<TWireCode>): NonNullable<LifecycleHooks['onError']>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-hook.d.ts","sourceRoot":"","sources":["../../src/server/error-hook.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAEtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"error-hook.d.ts","sourceRoot":"","sources":["../../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,SAAS,CAAC,CAAC,CA0BxC"}
|
package/dist/server/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
socketIoLane,
|
|
10
10
|
staticRoute,
|
|
11
11
|
webSocketLane
|
|
12
|
-
} from "../index-
|
|
12
|
+
} from "../index-esqmem78.js";
|
|
13
13
|
import {
|
|
14
14
|
createAuthHook,
|
|
15
15
|
createBearerResolver,
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
signJwt,
|
|
23
23
|
verifyJwt,
|
|
24
24
|
verifyPkce
|
|
25
|
-
} from "../index-
|
|
25
|
+
} from "../index-310bfer5.js";
|
|
26
26
|
import {
|
|
27
27
|
DEFAULT_CORS_ALLOW_HEADERS,
|
|
28
28
|
DEFAULT_CORS_EXPOSE_HEADERS,
|
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
resolveTraceId,
|
|
60
60
|
unauthorized,
|
|
61
61
|
zodIssues
|
|
62
|
-
} from "../index-
|
|
62
|
+
} from "../index-gex6gxhe.js";
|
|
63
63
|
// src/server/bun.ts
|
|
64
64
|
function createServer(config) {
|
|
65
65
|
const { routes, websocket, development, bun: bunExtra, port = 3000, hostname } = config;
|
|
@@ -140,7 +140,7 @@ function cacheHeaders(maxAge, scope = "public") {
|
|
|
140
140
|
}
|
|
141
141
|
// src/server/error-hook.ts
|
|
142
142
|
function createErrorHook(config) {
|
|
143
|
-
return (ctx, error) => {
|
|
143
|
+
return async (ctx, error, endpoint) => {
|
|
144
144
|
const appErr = normalizeError(error);
|
|
145
145
|
const code = config.codeMap && isStitchErrorCode(appErr.code) ? config.codeMap[appErr.code] : appErr.code;
|
|
146
146
|
const info = {
|
|
@@ -150,8 +150,9 @@ function createErrorHook(config) {
|
|
|
150
150
|
details: appErr.details,
|
|
151
151
|
hint: appErr.hint
|
|
152
152
|
};
|
|
153
|
-
config.onError?.(error, info, ctx);
|
|
154
|
-
|
|
153
|
+
await config.onError?.(error, info, ctx, endpoint);
|
|
154
|
+
const body = await config.render(info, ctx, endpoint);
|
|
155
|
+
return new Response(JSON.stringify(body), {
|
|
155
156
|
status: info.status,
|
|
156
157
|
headers: { "content-type": "application/json" }
|
|
157
158
|
});
|
package/dist/server/logger.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/server/logger.ts"],"names":[],"mappings":"AAqCA,0CAA0C;AAC1C,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE1C;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,CAAC,EAAE,SAAS,GAAG,SAAS,CAGlE;AAaD,6DAA6D;AAC7D,wBAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEnD;AAoBD,yCAAyC;AACzC,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAIxE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,MAAM,GACjB;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAIA;AA0BD,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/server/logger.ts"],"names":[],"mappings":"AAqCA,0CAA0C;AAC1C,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE1C;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,C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f,GAAG,EAAE,UAAU,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,UAAU,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,MAAM,EAAE,SAAS,CAAC;IAClB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAyBzD"}
|
package/dist/server/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ZodType } from 'zod';
|
|
2
2
|
import type { EndpointDef, EndpointResponseMeta, EndpointToolAnnotations, EndpointUiMeta, HandlerContext, HttpMethod, ResponseMetadata, RuntimeContext, Transport } from '../contract';
|
|
3
|
+
import type { HttpRequestObserver } from '../observability/audit';
|
|
3
4
|
import type { LogFormat } from './logger';
|
|
4
5
|
import type { CorsConfig } from './middleware/cors';
|
|
5
6
|
type Prop<T, K extends string> = K extends keyof T ? T[K] : undefined;
|
|
@@ -247,8 +248,8 @@ export interface LoggingConfig {
|
|
|
247
248
|
* not (a cycle, a `BigInt`) costs the extra fields for that line; the
|
|
248
249
|
* framework's own are re-emitted alone rather than losing the record.
|
|
249
250
|
* - It is synchronous and the request body is **already consumed** by the
|
|
250
|
-
* time it runs.
|
|
251
|
-
*
|
|
251
|
+
* time it runs. Body-derived records belong in request observability with
|
|
252
|
+
* `includePayload: true`, which clones before handler parsing.
|
|
252
253
|
* - Its values reach the sink as given. A header echoed straight into a
|
|
253
254
|
* text-based logger can inject line breaks — sanitise anything
|
|
254
255
|
* caller-controlled, as the framework does for the request path.
|
|
@@ -297,6 +298,8 @@ export interface HandlerConfig<TServer = unknown> {
|
|
|
297
298
|
cors?: CorsConfig;
|
|
298
299
|
hooks?: LifecycleHooks;
|
|
299
300
|
logging?: boolean | LoggingConfig;
|
|
301
|
+
/** Framework-owned HTTP RequestEvent projection from `createObservability`. */
|
|
302
|
+
observability?: HttpRequestObserver;
|
|
300
303
|
/**
|
|
301
304
|
* Report handler-output keys the contract schema removed, as dot-paths, through
|
|
302
305
|
* the configured logger. **Off by default** — the strip itself is correct (the
|
|
@@ -329,17 +332,9 @@ export interface HandlerConfig<TServer = unknown> {
|
|
|
329
332
|
/**
|
|
330
333
|
* The composition seam shared by the servers that own their own `fetch`.
|
|
331
334
|
*
|
|
332
|
-
*
|
|
333
|
-
*
|
|
334
|
-
*
|
|
335
|
-
* observability layer at all. `wrapFetch` is where those wrappers go.
|
|
336
|
-
*
|
|
337
|
-
* Order is the consumer's, and it matters: `wrapInRequestContext` outermost,
|
|
338
|
-
* the audit wrapper inside it, because the audit hook reads that context.
|
|
339
|
-
*
|
|
340
|
-
* ```ts
|
|
341
|
-
* createServer({ services, wrapFetch: (h) => wrapInRequestContext(audit.http(h)) })
|
|
342
|
-
* ```
|
|
335
|
+
* Built-in request observability belongs in `HandlerConfig.observability` and
|
|
336
|
+
* needs no wrapper. `wrapFetch` remains the escape hatch for unrelated
|
|
337
|
+
* transport-level composition around the complete handler.
|
|
343
338
|
*/
|
|
344
339
|
export interface FetchComposition<TServer = unknown> {
|
|
345
340
|
wrapFetch?: (fetch: FetchHandler<TServer>) => FetchHandler<TServer>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/server/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACnC,OAAO,KAAK,EACV,WAAW,EACX,oBAAoB,EACpB,uBAAuB,EACvB,cAAc,EACd,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,SAAS,EACV,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MA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,CAAC;IACxB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,GAAG,aAAa,CAAC;IAClC,+EAA+E;IAC/E,aAAa,CAAC,EAAE,mBAAmB,CAAC;IACpC;;;;;;;;;;;OAWG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,MAAM,GAAG,SAAS,CAAC;IAC/C;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB,CAAC,OAAO,GAAG,OAAO;IACjD,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,KAAK,YAAY,CAAC,OAAO,CAAC,CAAC;CACrE"}
|
package/dist/tools/agent.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { ToolSet } from 'ai';
|
|
|
2
2
|
import type { ServiceDef } from '../server/types';
|
|
3
3
|
import { type ErrorHintFn, type ToolCallHooks, type ToolLifecycle } from './execute';
|
|
4
4
|
import { type ToolExtend } from './mount';
|
|
5
|
-
import {
|
|
5
|
+
import type { RuntimeToolDefinition } from './runtime-tool';
|
|
6
6
|
export interface AgentContext {
|
|
7
7
|
[key: string]: unknown;
|
|
8
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/tools/agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAGlC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,aAAa,EAEnB,M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sources":["../../src/tools/flatten-join.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAExD,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,sBAAsB,CAAC;IAC/B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;CACnB;
|
|
1
|
+
{"version":3,"file":"flatten-join.d.ts","sourceRoot":"","sources":["../../src/tools/flatten-join.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAExD,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,sBAAsB,CAAC;IAC/B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAmND,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,eAAe,EAAE,GAAG,sBAAsB,CAuB1F"}
|
|
@@ -7,13 +7,15 @@
|
|
|
7
7
|
* consumer's build instead. Also the mechanical "what changed" diff when
|
|
8
8
|
* migrating a service between contract shapes.
|
|
9
9
|
*
|
|
10
|
-
* Built on
|
|
11
|
-
*
|
|
10
|
+
* Built on the mixed-surface collector used by the mounts — the listing cannot
|
|
11
|
+
* drift when pathless runtime tools sit beside contract operations.
|
|
12
12
|
*/
|
|
13
13
|
import type { Transport } from '../contract';
|
|
14
|
-
import type
|
|
14
|
+
import { type ToolSurfaceDefinition } from './surface';
|
|
15
15
|
/** One mounted tool name and where it comes from. */
|
|
16
16
|
export interface ToolNameEntry {
|
|
17
|
+
/** Whether the operation comes from a contract or a pathless runtime definition. */
|
|
18
|
+
kind: 'contract' | 'runtime';
|
|
17
19
|
/** Final tool name — the `toolName` override, else derived from service + method. */
|
|
18
20
|
name: string;
|
|
19
21
|
/** Owning service (`ServiceDef.name` — the contract's prefix). */
|
|
@@ -24,11 +26,11 @@ export interface ToolNameEntry {
|
|
|
24
26
|
transports: Transport[];
|
|
25
27
|
}
|
|
26
28
|
/**
|
|
27
|
-
* Resolve every tool name the
|
|
28
|
-
*
|
|
29
|
+
* Resolve every tool name the surface exposes, sorted by name (then service) —
|
|
30
|
+
* a stable shape to snapshot. Multipart and raw-response endpoints
|
|
29
31
|
* are absent
|
|
30
32
|
* (never mounted as tools) and CLI appears only where `expose` opts in,
|
|
31
33
|
* mirroring the real mounts.
|
|
32
34
|
*/
|
|
33
|
-
export declare function listToolNames(
|
|
35
|
+
export declare function listToolNames(surface: ToolSurfaceDefinition): ToolNameEntry[];
|
|
34
36
|
//# sourceMappingURL=list-names.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-names.d.ts","sourceRoot":"","sources":["../../src/tools/list-names.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"list-names.d.ts","sourceRoot":"","sources":["../../src/tools/list-names.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAEL,KAAK,qBAAqB,EAE3B,MAAM,WAAW,CAAC;AAEnB,qDAAqD;AACrD,MAAM,WAAW,aAAa;IAC5B,oFAAoF;IACpF,IAAI,EAAE,UAAU,GAAG,SAAS,CAAC;IAC7B,qFAAqF;IACrF,IAAI,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,OAAO,EAAE,MAAM,CAAC;IAChB,2DAA2D;IAC3D,MAAM,EAAE,MAAM,CAAC;IACf,6EAA6E;IAC7E,UAAU,EAAE,SAAS,EAAE,CAAC;CACzB;AAID;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,qBAAqB,GAAG,aAAa,EAAE,CA6B7E"}
|
package/dist/tools/manifest.d.ts
CHANGED
|
@@ -1,17 +1,25 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CollectToolsConfig } from './mount';
|
|
2
|
+
import type { RuntimeToolTransport } from './runtime-tool';
|
|
3
|
+
import { type ToolSurfaceDefinition } from './surface';
|
|
2
4
|
export interface ToolManifestEntry {
|
|
3
5
|
name: string;
|
|
4
6
|
description: string;
|
|
5
7
|
inputSchema: Record<string, unknown>;
|
|
6
8
|
}
|
|
9
|
+
export interface ToolManifestConfig extends ToolSurfaceDefinition {
|
|
10
|
+
/** Model-facing surface whose exposure rules the manifest must mirror. */
|
|
11
|
+
transport: RuntimeToolTransport;
|
|
12
|
+
extend?: CollectToolsConfig['extend'];
|
|
13
|
+
flattenUnionInput?: boolean;
|
|
14
|
+
}
|
|
7
15
|
/**
|
|
8
|
-
* Build a searchable manifest from
|
|
9
|
-
* JSON Schema for each. Use it to power a `tool_search`
|
|
10
|
-
* decides the search algorithm and the unlock mechanism.
|
|
16
|
+
* Build a searchable manifest from the complete contract/runtime surface —
|
|
17
|
+
* name, description and JSON Schema for each. Use it to power a `tool_search`
|
|
18
|
+
* tool: the app decides the search algorithm and the unlock mechanism.
|
|
11
19
|
*
|
|
12
20
|
* A tool whose schema cannot be represented as JSON Schema still appears —
|
|
13
21
|
* with an empty `inputSchema` — so it stays discoverable by name / description
|
|
14
22
|
* rather than crashing the whole manifest.
|
|
15
23
|
*/
|
|
16
|
-
export declare function buildToolManifest(
|
|
24
|
+
export declare function buildToolManifest(config: ToolManifestConfig): ToolManifestEntry[];
|
|
17
25
|
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/tools/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/tools/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAsB,KAAK,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAE3E,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,kBAAmB,SAAQ,qBAAqB;IAC/D,0EAA0E;IAC1E,SAAS,EAAE,oBAAoB,CAAC;IAChC,MAAM,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACtC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,kBAAkB,GAAG,iBAAiB,EAAE,CAWjF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type McpServerBuildConfig } from './mcp';
|
|
1
|
+
import { type McpServerBuildConfig, type McpSurfaceRegistry } from './mcp';
|
|
2
2
|
import { type ProtectedResourceConfig } from './oauth-metadata';
|
|
3
|
-
export interface
|
|
3
|
+
export interface McpHttpConfig<TAuth> {
|
|
4
4
|
/** Resolve an incoming request to an identity. Return `null` → 401. */
|
|
5
5
|
auth: (req: Request) => TAuth | null | Promise<TAuth | null>;
|
|
6
6
|
/**
|
|
@@ -14,6 +14,7 @@ export interface McpHandlerConfig<TAuth> extends McpServerBuildConfig<TAuth> {
|
|
|
14
14
|
* for cross-request progress, server push or resumable SSE sessions. */
|
|
15
15
|
sessionMode?: McpSessionMode;
|
|
16
16
|
}
|
|
17
|
+
export type McpHandlerConfig<TAuth, TSurfaces extends McpSurfaceRegistry = McpSurfaceRegistry> = McpServerBuildConfig<TAuth, TSurfaces> & McpHttpConfig<TAuth>;
|
|
17
18
|
export type McpSessionMode = 'stateful' | 'stateless';
|
|
18
19
|
/**
|
|
19
20
|
* Build a Streamable-HTTP MCP request handler (`Request → Response`).
|
|
@@ -22,12 +23,12 @@ export type McpSessionMode = 'stateful' | 'stateless';
|
|
|
22
23
|
* mode, the SSE event/session stores — so the consuming app never imports the
|
|
23
24
|
* SDK itself. The app only declares WHAT to expose:
|
|
24
25
|
* how to authenticate and which contract services. MCP tools come from
|
|
25
|
-
* contracts;
|
|
26
|
+
* contracts; multimodal operations are declared as framework `runtimeTools`.
|
|
26
27
|
*
|
|
27
28
|
* The server itself is built by the transport-neutral `buildMcpServer` — the
|
|
28
29
|
* same core used by `createStdioMcpServer`.
|
|
29
30
|
*
|
|
30
31
|
* Mount the returned handler in your server's fetch router (e.g. under `/mcp`).
|
|
31
32
|
*/
|
|
32
|
-
export declare function createMcpHandler<TAuth>(config: McpHandlerConfig<TAuth>): (req: Request) => Promise<Response>;
|
|
33
|
+
export declare function createMcpHandler<TAuth, const TSurfaces extends McpSurfaceRegistry = McpSurfaceRegistry>(config: McpHandlerConfig<TAuth, TSurfaces>): (req: Request) => Promise<Response>;
|
|
33
34
|
//# sourceMappingURL=mcp-handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-handler.d.ts","sourceRoot":"","sources":["../../src/tools/mcp-handler.ts"],"names":[],"mappings":"AASA,OAAO,EAGL,KAAK,oBAAoB,
|
|
1
|
+
{"version":3,"file":"mcp-handler.d.ts","sourceRoot":"","sources":["../../src/tools/mcp-handler.ts"],"names":[],"mappings":"AASA,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EAExB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,KAAK,uBAAuB,EAAyB,MAAM,kBAAkB,CAAC;AAqEvF,MAAM,WAAW,aAAa,CAAC,KAAK;IAClC,uEAAuE;IACvE,IAAI,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,KAAK,GAAG,IAAI,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;IAC7D;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,uBAAuB,CAAC;IAC5C;6EACyE;IACzE,WAAW,CAAC,EAAE,cAAc,CAAC;CAC9B;AAED,MAAM,MAAM,gBAAgB,CAC1B,KAAK,EACL,SAAS,SAAS,kBAAkB,GAAG,kBAAkB,IACvD,oBAAoB,CAAC,KAAK,EAAE,SAAS,CAAC,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;AAElE,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,WAAW,CAAC;AAoBtD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EACL,KAAK,CAAC,SAAS,SAAS,kBAAkB,GAAG,kBAAkB,EAC/D,MAAM,EAAE,gBAAgB,CAAC,KAAK,EAAE,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAyJjF"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import { type McpServerBuildConfig } from './mcp';
|
|
2
|
+
import { type McpServerBuildConfig, type McpSurfaceRegistry } from './mcp';
|
|
3
3
|
/**
|
|
4
4
|
* Config for a stdio MCP server. Unlike the HTTP handler, a stdio server is a
|
|
5
5
|
* single process serving one client — identity is resolved ONCE at startup
|
|
6
6
|
* (from an env var / CLI arg), not per request.
|
|
7
7
|
*/
|
|
8
|
-
export interface
|
|
8
|
+
export interface StdioAuthConfig<TAuth> {
|
|
9
9
|
/** Identity for the single stdio session — a value or a promise of one. */
|
|
10
10
|
auth: TAuth | Promise<TAuth>;
|
|
11
11
|
}
|
|
12
|
+
export type StdioMcpServerConfig<TAuth, TSurfaces extends McpSurfaceRegistry = McpSurfaceRegistry> = McpServerBuildConfig<TAuth, TSurfaces> & StdioAuthConfig<TAuth>;
|
|
12
13
|
/**
|
|
13
14
|
* Build an MCP server and connect it over stdio — the server runs as a
|
|
14
15
|
* subprocess of the MCP client, on the client's machine, so it can reach the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-stdio.d.ts","sourceRoot":"","sources":["../../src/tools/mcp-stdio.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,OAAO,EAAkB,KAAK,oBAAoB,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"mcp-stdio.d.ts","sourceRoot":"","sources":["../../src/tools/mcp-stdio.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,OAAO,EAAkB,KAAK,oBAAoB,EAAE,KAAK,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAE3F;;;;GAIG;AACH,MAAM,WAAW,eAAe,CAAC,KAAK;IACpC,2EAA2E;IAC3E,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;CAC9B;AAED,MAAM,MAAM,oBAAoB,CAC9B,KAAK,EACL,SAAS,SAAS,kBAAkB,GAAG,kBAAkB,IACvD,oBAAoB,CAAC,KAAK,EAAE,SAAS,CAAC,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;AAEpE;;;;;;;;;;;GAWG;AACH,wBAAsB,oBAAoB,CAAC,KAAK,EAC9C,MAAM,EAAE,oBAAoB,CAAC,KAAK,CAAC,GAClC,OAAO,CAAC,SAAS,CAAC,CAKpB"}
|
package/dist/tools/mcp.d.ts
CHANGED
|
@@ -5,7 +5,8 @@ import { type ErrorHintFn, type ToolCallHooks, type ToolLifecycle } from './exec
|
|
|
5
5
|
import type { ToolPresentationSchema } from './flatten';
|
|
6
6
|
import { type McpResourceDef } from './mcp-app';
|
|
7
7
|
import { type MountableTool, type ToolExtend } from './mount';
|
|
8
|
-
import {
|
|
8
|
+
import type { RuntimeToolDefinition } from './runtime-tool';
|
|
9
|
+
import { type ToolSurfaceDefinition } from './surface';
|
|
9
10
|
/**
|
|
10
11
|
* What to do when a tool's schema cannot be advertised on the MCP surface — a
|
|
11
12
|
* union / discriminated-union input (MCP needs an object), or a construct
|
|
@@ -59,6 +60,27 @@ export interface McpSurfacePreparationConfig {
|
|
|
59
60
|
export declare function prepareMcpSurface(services: ServiceDef | ServiceDef[], config?: McpSurfacePreparationConfig): PreparedMcpSurface;
|
|
60
61
|
/** Prepare already-resolved tool operations through the canonical MCP schema profile. */
|
|
61
62
|
export declare function prepareMcpTools(tools: readonly MountableTool[], config?: McpSurfacePreparationConfig): PreparedMcpSurface;
|
|
63
|
+
/** One immutable, framework-managed MCP surface selected as a unit. */
|
|
64
|
+
export interface McpSurfaceDefinition extends ToolSurfaceDefinition {
|
|
65
|
+
services: ServiceDef[];
|
|
66
|
+
}
|
|
67
|
+
/** A finite set of surfaces known when the server/handler is constructed. */
|
|
68
|
+
export type McpSurfaceRegistry = Record<string, McpSurfaceDefinition>;
|
|
69
|
+
/** A runtime definition paired with its already validated MCP descriptor. */
|
|
70
|
+
export interface PreparedRuntimeMcpTool {
|
|
71
|
+
definition: RuntimeToolDefinition;
|
|
72
|
+
descriptor: PreparedMcpTool;
|
|
73
|
+
}
|
|
74
|
+
/** Complete immutable tool descriptors for one fresh MCP server runtime. */
|
|
75
|
+
export interface PreparedMcpServerSurface {
|
|
76
|
+
contractTools: PreparedMcpSurface;
|
|
77
|
+
runtimeTools: readonly PreparedRuntimeMcpTool[];
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Prepare contracts and framework runtime tools as one collision-checked unit.
|
|
81
|
+
* No auth, request context, lifecycle, hooks, SDK server or transport is stored.
|
|
82
|
+
*/
|
|
83
|
+
export declare function prepareMcpServerSurface(surface: McpSurfaceDefinition, config?: McpSurfacePreparationConfig): PreparedMcpServerSurface;
|
|
62
84
|
export interface McpMountConfig {
|
|
63
85
|
context?: Record<string, unknown>;
|
|
64
86
|
/** Tool-call observability hooks. */
|
|
@@ -101,14 +123,12 @@ export declare function mountPreparedMcp(mcpServer: McpServer, prepared: Prepare
|
|
|
101
123
|
* resolved. `createMcpHandler` (HTTP) and `createStdioMcpServer` (stdio) each
|
|
102
124
|
* add their own `auth` on top.
|
|
103
125
|
*/
|
|
104
|
-
export interface
|
|
126
|
+
export interface McpServerSharedConfig<TAuth> {
|
|
105
127
|
/** MCP server identity (name + version). */
|
|
106
128
|
serverInfo: {
|
|
107
129
|
name: string;
|
|
108
130
|
version: string;
|
|
109
131
|
};
|
|
110
|
-
/** Contract services exposed as MCP tools — may depend on the identity. */
|
|
111
|
-
services: ServiceDef[] | ((auth: TAuth) => ServiceDef[]);
|
|
112
132
|
/** Context merged into every contract handler (`mountMcp` context). */
|
|
113
133
|
context?: (auth: TAuth) => Record<string, unknown>;
|
|
114
134
|
/** Tool-call observability hooks — `afterToolCall` fires for every result
|
|
@@ -128,10 +148,9 @@ export interface McpServerBuildConfig<TAuth> {
|
|
|
128
148
|
schemaValidation?: McpSchemaValidationConfig;
|
|
129
149
|
/** Logger for schema-incompatibility warnings — defaults to `console`. */
|
|
130
150
|
logger?: StitchLogger;
|
|
131
|
-
/**
|
|
132
|
-
*
|
|
133
|
-
|
|
134
|
-
nativeTools?: (registrar: NativeMcpRegistrar, auth: TAuth) => void;
|
|
151
|
+
/** Explicit unprotected SDK escape hatch. Prefer `runtimeTools`; registrations
|
|
152
|
+
* here do not receive stitchkit validation, lifecycle, context or hooks. */
|
|
153
|
+
rawTools?: (server: McpServer, auth: TAuth) => void;
|
|
135
154
|
/** MCP Apps UI resources (`ui://…`) served for tools that declare `ui`. */
|
|
136
155
|
resources?: McpResourceDef[];
|
|
137
156
|
/** Server instructions — a short (≤2KB) hint to the host on when and how to
|
|
@@ -146,13 +165,34 @@ export interface McpServerBuildConfig<TAuth> {
|
|
|
146
165
|
/** Report output keys the contract schema removed — → ADR 0037. */
|
|
147
166
|
onOutputStrip?: (toolName: string, paths: string[]) => void;
|
|
148
167
|
}
|
|
168
|
+
export interface DirectMcpSurfaceConfig<TAuth> {
|
|
169
|
+
/** Contract services exposed as MCP tools — may depend on the identity. */
|
|
170
|
+
services: ServiceDef[] | ((auth: TAuth) => ServiceDef[]);
|
|
171
|
+
/** Framework-managed runtime tools — may depend on the identity. */
|
|
172
|
+
runtimeTools?: readonly RuntimeToolDefinition[] | ((auth: TAuth) => readonly RuntimeToolDefinition[]);
|
|
173
|
+
surfaces?: never;
|
|
174
|
+
selectSurface?: never;
|
|
175
|
+
}
|
|
176
|
+
export interface FiniteMcpSurfaceConfig<TAuth, TSurfaces extends McpSurfaceRegistry> {
|
|
177
|
+
/** Finite immutable surfaces, all prepared eagerly exactly once. */
|
|
178
|
+
surfaces: TSurfaces;
|
|
179
|
+
/** Select one declared surface for the resolved identity. */
|
|
180
|
+
selectSurface: (auth: TAuth) => Extract<keyof TSurfaces, string>;
|
|
181
|
+
services?: never;
|
|
182
|
+
runtimeTools?: never;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Transport-neutral MCP build config. Use direct services for a static or truly
|
|
186
|
+
* identity-dynamic surface; use `surfaces` for a bounded role/plan registry.
|
|
187
|
+
*/
|
|
188
|
+
export type McpServerBuildConfig<TAuth, TSurfaces extends McpSurfaceRegistry = McpSurfaceRegistry> = McpServerSharedConfig<TAuth> & (DirectMcpSurfaceConfig<TAuth> | FiniteMcpSurfaceConfig<TAuth, TSurfaces>);
|
|
149
189
|
/**
|
|
150
190
|
* Build an `McpServer` from contract services for a resolved identity.
|
|
151
191
|
* Transport-agnostic — the shared core behind every MCP transport.
|
|
152
192
|
*/
|
|
153
193
|
export declare function buildMcpServer<TAuth>(config: McpServerBuildConfig<TAuth>, auth: TAuth): McpServer;
|
|
154
194
|
/** Build one fresh server from a deterministic surface prepared by its owner. */
|
|
155
|
-
export declare function buildMcpServerFromPrepared<TAuth>(config: McpServerBuildConfig<TAuth>, auth: TAuth, prepared:
|
|
195
|
+
export declare function buildMcpServerFromPrepared<TAuth>(config: McpServerBuildConfig<TAuth>, auth: TAuth, prepared: PreparedMcpServerSurface): McpServer;
|
|
156
196
|
/**
|
|
157
197
|
* Register one MCP Apps UI resource on an `McpServer`. The `read` callback's
|
|
158
198
|
* HTML is served under the resource `uri` with the apps MIME type; any `ui`
|
package/dist/tools/mcp.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/tools/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,aAAa,EAGnB,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAExD,OAAO,EAAE,KAAK,cAAc,EAAsB,MAAM,WAAW,CAAC;AACpE,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,UAAU,EAChB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/tools/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,aAAa,EAGnB,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAExD,OAAO,EAAE,KAAK,cAAc,EAAsB,MAAM,WAAW,CAAC;AACpE,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,UAAU,EAChB,MAAM,SAAS,CAAC;AASjB,OAAO,KAAK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;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAClC,MAAM,EAAE,oBAAoB,CAAC,KAAK,CAAC,EACnC,IAAI,EAAE,KAAK,GACV,SAAS,CA0BX;AAED,iFAAiF;AACjF,wBAAgB,0BAA0B,CAAC,KAAK,EAC9C,MAAM,EAAE,oBAAoB,CAAC,KAAK,CAAC,EACnC,IAAI,EAAE,KAAK,EACX,QAAQ,EAAE,wBAAwB,GACjC,SAAS,CAgCX;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,GAAG,IAAI,CAgBlF"}
|
|
@@ -1,30 +1,16 @@
|
|
|
1
1
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
2
|
import { type CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
-
import { z } from 'zod';
|
|
4
3
|
import { executeToolMethod, type ToolCallHooks, type ToolLifecycle } from './execute';
|
|
5
|
-
import type {
|
|
6
|
-
import { type RuntimeToolDefinitionWithOutput, type RuntimeToolDefinitionWithoutOutput, runtimeToolMountable } from './runtime-tool';
|
|
7
|
-
export interface NativeMcpRegistrar {
|
|
8
|
-
/** Register through stitchkit validation, lifecycle, context and tool hooks. */
|
|
9
|
-
registerTool<TInput extends z.ZodObject, TOutput extends z.ZodType>(definition: RuntimeToolDefinitionWithOutput<TInput, TOutput>): void;
|
|
10
|
-
registerTool<TInput extends z.ZodObject>(definition: RuntimeToolDefinitionWithoutOutput<TInput>): void;
|
|
11
|
-
/**
|
|
12
|
-
* Explicit SDK escape hatch. Registrations made here do not run stitchkit
|
|
13
|
-
* validation, lifecycle, per-call context or tool hooks.
|
|
14
|
-
*/
|
|
15
|
-
readonly rawServer: McpServer;
|
|
16
|
-
}
|
|
4
|
+
import type { PreparedRuntimeMcpTool } from './mcp';
|
|
17
5
|
interface NativeMcpRuntimeConfig {
|
|
18
6
|
context?: Record<string, unknown>;
|
|
19
7
|
hooks?: ToolCallHooks;
|
|
20
8
|
lifecycle?: ToolLifecycle;
|
|
21
9
|
coerceJsonArgs?: boolean;
|
|
22
10
|
onOutputStrip?: (toolName: string, paths: string[]) => void;
|
|
23
|
-
|
|
24
|
-
prepare: (tool: ReturnType<typeof runtimeToolMountable>) => PreparedMcpSurface;
|
|
25
|
-
formatResult: (result: Awaited<ReturnType<typeof executeToolMethod>>, mode: PreparedMcpSurface[number]['outputMode'], toolName: string) => CallToolResult;
|
|
11
|
+
formatResult: (result: Awaited<ReturnType<typeof executeToolMethod>>, mode: PreparedRuntimeMcpTool['descriptor']['outputMode'], toolName: string) => CallToolResult;
|
|
26
12
|
}
|
|
27
|
-
/**
|
|
28
|
-
export declare function
|
|
13
|
+
/** Mount immutable runtime-tool descriptors onto one fresh MCP server/runtime. */
|
|
14
|
+
export declare function mountPreparedRuntimeMcp(server: McpServer, tools: readonly PreparedRuntimeMcpTool[], config: NativeMcpRuntimeConfig): void;
|
|
29
15
|
export {};
|
|
30
16
|
//# sourceMappingURL=native-mcp.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native-mcp.d.ts","sourceRoot":"","sources":["../../src/tools/native-mcp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"native-mcp.d.ts","sourceRoot":"","sources":["../../src/tools/native-mcp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,oCAAoC,CAAC;AAI/F,OAAO,EAAE,iBAAiB,EAAE,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,MAAM,WAAW,CAAC;AACtF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAC;AAGpD,UAAU,sBAAsB;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC5D,YAAY,EAAE,CACZ,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC,EACrD,IAAI,EAAE,sBAAsB,CAAC,YAAY,CAAC,CAAC,YAAY,CAAC,EACxD,QAAQ,EAAE,MAAM,KACb,cAAc,CAAC;CACrB;AAMD,kFAAkF;AAClF,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,SAAS,EACjB,KAAK,EAAE,SAAS,sBAAsB,EAAE,EACxC,MAAM,EAAE,sBAAsB,GAC7B,IAAI,CA4EN"}
|
|
@@ -18,6 +18,11 @@ export type RuntimeToolHandlerContext<TInput extends ZodObject> = RuntimeContext
|
|
|
18
18
|
input: z.output<TInput>;
|
|
19
19
|
};
|
|
20
20
|
export type RuntimeToolOutput<TOutput extends ZodType | undefined> = TOutput extends ZodType ? z.output<TOutput> : undefined;
|
|
21
|
+
/** Parsed application context plus the canonical runtime-tool input fields. */
|
|
22
|
+
export type RuntimeToolFactoryHandlerContext<TContext extends ZodObject, TInput extends ZodObject> = Omit<z.output<TContext>, 'input' | 'params'> & {
|
|
23
|
+
params: undefined;
|
|
24
|
+
input: z.output<TInput>;
|
|
25
|
+
};
|
|
21
26
|
/** MCP-owned fields; validation and error state are always supplied by Stitchkit. */
|
|
22
27
|
export type RuntimeMcpPresentation = Omit<CallToolResult, 'structuredContent' | 'isError'> & {
|
|
23
28
|
structuredContent?: never;
|
|
@@ -49,10 +54,36 @@ export interface RuntimeToolDefinitionWithoutOutput<TInput extends ZodObject> ex
|
|
|
49
54
|
present?: never;
|
|
50
55
|
}
|
|
51
56
|
export type RuntimeToolDefinition = RuntimeToolDefinitionWithOutput<ZodObject, ZodType> | RuntimeToolDefinitionWithoutOutput<ZodObject>;
|
|
57
|
+
export interface RuntimeToolFactoryConfig<TContext extends ZodObject> {
|
|
58
|
+
serviceName: string;
|
|
59
|
+
scope?: string;
|
|
60
|
+
context: TContext;
|
|
61
|
+
meta?: Record<string, unknown>;
|
|
62
|
+
}
|
|
63
|
+
export interface RuntimeToolFactoryIdentityFields {
|
|
64
|
+
action: string;
|
|
65
|
+
method: HttpMethod;
|
|
66
|
+
meta?: Record<string, unknown>;
|
|
67
|
+
}
|
|
68
|
+
export type RuntimeToolFactoryDefinitionWithOutput<TContext extends ZodObject, TInput extends ZodObject, TOutput extends ZodType> = Omit<RuntimeToolDefinitionWithOutput<TInput, TOutput>, 'handler' | 'identity'> & RuntimeToolFactoryIdentityFields & {
|
|
69
|
+
handler: (context: RuntimeToolFactoryHandlerContext<TContext, TInput>) => z.output<TOutput> | Promise<z.output<TOutput>>;
|
|
70
|
+
};
|
|
71
|
+
export type RuntimeToolFactoryDefinitionWithoutOutput<TContext extends ZodObject, TInput extends ZodObject> = Omit<RuntimeToolDefinitionWithoutOutput<TInput>, 'handler' | 'identity'> & RuntimeToolFactoryIdentityFields & {
|
|
72
|
+
handler: (context: RuntimeToolFactoryHandlerContext<TContext, TInput>) => void | Promise<void>;
|
|
73
|
+
};
|
|
74
|
+
export interface RuntimeToolFactory<TContext extends ZodObject> {
|
|
75
|
+
define<TInput extends ZodObject, TOutput extends ZodType>(definition: RuntimeToolFactoryDefinitionWithOutput<TContext, TInput, TOutput>): RuntimeToolDefinitionWithOutput<TInput, TOutput>;
|
|
76
|
+
define<TInput extends ZodObject>(definition: RuntimeToolFactoryDefinitionWithoutOutput<TContext, TInput>): RuntimeToolDefinitionWithoutOutput<TInput>;
|
|
77
|
+
}
|
|
52
78
|
/** Typed identity helper; execution remains owned by the transport mounts. */
|
|
53
79
|
export declare function defineRuntimeTool<TInput extends ZodObject, TOutput extends ZodType>(definition: RuntimeToolDefinitionWithOutput<TInput, TOutput>): RuntimeToolDefinitionWithOutput<TInput, TOutput>;
|
|
54
80
|
export declare function defineRuntimeTool<TInput extends ZodObject>(definition: RuntimeToolDefinitionWithoutOutput<TInput>): RuntimeToolDefinitionWithoutOutput<TInput>;
|
|
81
|
+
/**
|
|
82
|
+
* Bind shared runtime-tool identity and validate application context once per
|
|
83
|
+
* call while keeping execution in the canonical tool runner.
|
|
84
|
+
*/
|
|
85
|
+
export declare function createRuntimeToolFactory<TContext extends ZodObject>(config: RuntimeToolFactoryConfig<TContext>): RuntimeToolFactory<TContext>;
|
|
55
86
|
export declare function runtimeToolSupports(definition: RuntimeToolDefinition, transport: RuntimeToolTransport): boolean;
|
|
56
87
|
export declare function runtimeToolIdentity(definition: RuntimeToolDefinition): OperationIdentity;
|
|
57
|
-
export declare function runtimeToolMountable(definition: RuntimeToolDefinition): MountableTool;
|
|
88
|
+
export declare function runtimeToolMountable(definition: RuntimeToolDefinition, assertName?: boolean): MountableTool;
|
|
58
89
|
//# sourceMappingURL=runtime-tool.d.ts.map
|