@catamorphic/fastify-plugin 0.1.0-alpha.39 → 0.1.0-alpha.42

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 (81) hide show
  1. package/NOTICE.txt +7 -0
  2. package/dist/app.d.ts +2 -0
  3. package/dist/app.d.ts.map +1 -1
  4. package/dist/chunk-jytcc42y.js +592 -0
  5. package/dist/chunk-jytcc42y.js.map +11 -0
  6. package/dist/index.d.ts +1 -1
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +1673 -411
  9. package/dist/index.js.map +29 -25
  10. package/dist/mcp-scopes.d.ts +12 -0
  11. package/dist/mcp-scopes.d.ts.map +1 -0
  12. package/dist/mcp-server.d.ts +158 -0
  13. package/dist/mcp-server.d.ts.map +1 -0
  14. package/dist/mcp-shared.d.ts +3 -50
  15. package/dist/mcp-shared.d.ts.map +1 -1
  16. package/dist/mcp.d.ts +4 -2
  17. package/dist/mcp.d.ts.map +1 -1
  18. package/dist/mcp.js +6 -4
  19. package/dist/mcp.js.map +1 -1
  20. package/dist/plugin.d.ts +26 -2
  21. package/dist/plugin.d.ts.map +1 -1
  22. package/dist/project-capabilities.d.ts.map +1 -1
  23. package/dist/project-mcp-surface.d.ts +3 -4
  24. package/dist/project-mcp-surface.d.ts.map +1 -1
  25. package/dist/routes/agent.d.ts.map +1 -1
  26. package/dist/routes/apps-mcp.d.ts.map +1 -1
  27. package/dist/routes/client-runners.d.ts.map +1 -1
  28. package/dist/routes/connection-mcp.d.ts.map +1 -1
  29. package/dist/routes/documents.d.ts.map +1 -1
  30. package/dist/routes/environments.d.ts.map +1 -1
  31. package/dist/routes/project-mcp.d.ts.map +1 -1
  32. package/dist/routes/projects.d.ts.map +1 -1
  33. package/dist/routes/publications.d.ts.map +1 -1
  34. package/dist/routes/run-errors.d.ts.map +1 -1
  35. package/dist/routes/runs.d.ts.map +1 -1
  36. package/dist/routes/server-mcp.d.ts +17 -0
  37. package/dist/routes/server-mcp.d.ts.map +1 -0
  38. package/dist/routes/session-mailboxes.d.ts.map +1 -1
  39. package/dist/routes/triggers.d.ts.map +1 -1
  40. package/dist/routes/watchers.d.ts.map +1 -1
  41. package/dist/routes/workflow-enablements.d.ts.map +1 -1
  42. package/dist/routes/workflows.d.ts.map +1 -1
  43. package/dist/schemas.d.ts +3684 -28
  44. package/dist/schemas.d.ts.map +1 -1
  45. package/dist/session-mcp.d.ts +54 -0
  46. package/dist/session-mcp.d.ts.map +1 -0
  47. package/dist/session-tools.d.ts +49 -0
  48. package/dist/session-tools.d.ts.map +1 -0
  49. package/package.json +12 -12
  50. package/src/app.ts +3 -0
  51. package/src/index.ts +1 -0
  52. package/src/mcp-scopes.ts +69 -0
  53. package/src/mcp-server.ts +827 -0
  54. package/src/mcp-shared.ts +3 -151
  55. package/src/mcp.ts +6 -5
  56. package/src/plugin.ts +73 -2
  57. package/src/project-capabilities.ts +5 -3
  58. package/src/project-mcp-program.ts +2 -2
  59. package/src/project-mcp-surface.ts +18 -239
  60. package/src/routes/agent.ts +384 -41
  61. package/src/routes/apps-mcp.ts +84 -82
  62. package/src/routes/client-runners.ts +3 -1
  63. package/src/routes/connection-mcp.ts +6 -13
  64. package/src/routes/documents.ts +4 -0
  65. package/src/routes/environments.ts +49 -1
  66. package/src/routes/project-mcp.ts +176 -154
  67. package/src/routes/projects.ts +6 -0
  68. package/src/routes/publications.ts +2 -0
  69. package/src/routes/run-errors.ts +5 -1
  70. package/src/routes/runs.ts +4 -0
  71. package/src/routes/server-mcp.ts +151 -0
  72. package/src/routes/session-mailboxes.ts +1 -0
  73. package/src/routes/triggers.ts +6 -1
  74. package/src/routes/watchers.ts +1 -0
  75. package/src/routes/workflow-enablements.ts +132 -1
  76. package/src/routes/workflows.ts +4 -0
  77. package/src/schemas.ts +347 -5
  78. package/src/session-mcp.ts +696 -0
  79. package/src/session-tools.ts +169 -0
  80. package/dist/chunk-baagvvm3.js +0 -164
  81. package/dist/chunk-baagvvm3.js.map +0 -10
@@ -0,0 +1,12 @@
1
+ import { type Identity, type TokenScope } from "@catamorphic/core";
2
+ import type { McpTool } from "./mcp-server.js";
3
+ import type { RouteContext } from "./plugin.js";
4
+ /** The scope a tool needs: its own, or the one its name and effect imply. */
5
+ export declare function toolScope(tool: McpTool): TokenScope;
6
+ /** Whether the caller's token lets it see and call the tool. */
7
+ export declare function mayCallTool(identity: Identity, tool: McpTool): boolean;
8
+ /** The tools the caller's token hides, with the scope each would need. */
9
+ export declare function withheldTools(identity: Identity, tools: readonly McpTool[]): ReadonlyMap<string, string>;
10
+ /** The secret that signs the state a wait hands out (MRTR). */
11
+ export declare function mcpStateSecret(ctx: RouteContext): string;
12
+ //# sourceMappingURL=mcp-scopes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-scopes.d.ts","sourceRoot":"","sources":["../src/mcp-scopes.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,UAAU,EAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAyBhD,6EAA6E;AAC7E,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,GAAG,UAAU,CASnD;AAED,gEAAgE;AAChE,wBAAgB,WAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAEtE;AAED,0EAA0E;AAC1E,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,SAAS,OAAO,EAAE,GACxB,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAM7B;AAMD,+DAA+D;AAC/D,wBAAgB,cAAc,CAAC,GAAG,EAAE,YAAY,GAAG,MAAM,CAExD"}
@@ -0,0 +1,158 @@
1
+ import { type TokenScope } from "@catamorphic/core";
2
+ import type { FastifyReply, FastifyRequest } from "fastify";
3
+ import { type ForwardedToolDefinition } from "./mcp-shared.js";
4
+ /**
5
+ * One MCP endpoint for both protocol eras (ADR 0347). A request carrying
6
+ * the per-request `_meta` envelope, or a modern `MCP-Protocol-Version`
7
+ * header, is served by the current revision: stateless, validated against
8
+ * its mirrored headers, with `server/discover`, result types, caching
9
+ * hints, `subscriptions/listen` and the tasks extension. Anything else is
10
+ * a 2025-era client and gets the stateless `initialize` shell with plain
11
+ * tools. Neither path keeps a session: every request stands alone, and
12
+ * whatever must outlive one is in Postgres.
13
+ */
14
+ /** The revisions served with per-request metadata, newest first. */
15
+ export declare const MODERN_PROTOCOL_VERSIONS: readonly ["2026-07-28"];
16
+ /** The handshake revisions a 2025-era client may negotiate. */
17
+ export declare const SUPPORTED_PROTOCOL_VERSIONS: Set<string>;
18
+ export declare const DEFAULT_PROTOCOL_VERSION = "2025-06-18";
19
+ export declare const MCP_META: {
20
+ readonly protocolVersion: "io.modelcontextprotocol/protocolVersion";
21
+ readonly clientInfo: "io.modelcontextprotocol/clientInfo";
22
+ readonly clientCapabilities: "io.modelcontextprotocol/clientCapabilities";
23
+ readonly serverInfo: "io.modelcontextprotocol/serverInfo";
24
+ readonly subscriptionId: "io.modelcontextprotocol/subscriptionId";
25
+ };
26
+ /** The tasks extension (SEP-2663): a durable handle for a long call. */
27
+ export declare const TASKS_EXTENSION = "io.modelcontextprotocol/tasks";
28
+ export declare const MCP_ERROR: {
29
+ readonly parse: -32700;
30
+ readonly invalidRequest: -32600;
31
+ readonly methodNotFound: -32601;
32
+ readonly invalidParams: -32602;
33
+ readonly internal: -32603;
34
+ readonly headerMismatch: -32020;
35
+ readonly missingClientCapability: -32021;
36
+ readonly unsupportedProtocolVersion: -32022;
37
+ };
38
+ /** How long a keep-alive comment keeps a quiet listen stream open. */
39
+ export declare const MCP_KEEP_ALIVE_MS = 15000;
40
+ /** A failure that answers with a specific JSON-RPC error and HTTP status. */
41
+ export declare class McpError extends Error {
42
+ readonly code: number;
43
+ readonly options: {
44
+ status?: number;
45
+ data?: unknown;
46
+ };
47
+ constructor(code: number, message: string, options?: {
48
+ status?: number;
49
+ data?: unknown;
50
+ });
51
+ }
52
+ /** The token lacks a scope the call needs: answered as a step-up (403). */
53
+ export declare class McpScopeError extends Error {
54
+ readonly scope: string;
55
+ constructor(scope: string);
56
+ }
57
+ /** What a handler is told about the request it serves. */
58
+ export interface McpCallContext {
59
+ era: "modern" | "legacy";
60
+ protocolVersion: string;
61
+ /** What the client declared for this request; empty for a legacy one. */
62
+ clientCapabilities: Record<string, unknown>;
63
+ /** Aborted when the caller went away. */
64
+ signal: AbortSignal;
65
+ /** A retried call's answers to what the server asked (MRTR). */
66
+ inputResponses?: Record<string, unknown>;
67
+ /** The state the server handed out with what it asked. */
68
+ requestState?: string;
69
+ }
70
+ /** A tool's answer in MCP's shape. */
71
+ export type McpToolResult = Record<string, unknown>;
72
+ /**
73
+ * One tool an MCP endpoint serves: what clients list, the OAuth scope a
74
+ * token needs for it, and how it runs. A result may carry its own
75
+ * `resultType` (`input_required`, `task`) for a modern caller.
76
+ */
77
+ export interface McpTool {
78
+ definition: Record<string, unknown>;
79
+ /** The OAuth scope a token must carry to list or call it; none: any. */
80
+ scope?: TokenScope;
81
+ call: (args: Record<string, unknown>, context?: McpCallContext) => Promise<McpToolResult>;
82
+ }
83
+ /** What a listen stream is told changed; `stop` ends the watching. */
84
+ export interface McpWatch {
85
+ /** The subset of what was asked for that is watched. */
86
+ accepted: string[];
87
+ stop(): void;
88
+ }
89
+ export interface McpResources {
90
+ list(): Promise<Array<Record<string, unknown>>>;
91
+ templates(): Promise<Array<Record<string, unknown>>>;
92
+ /** The resource's contents; an unknown URI throws {@link McpError}. */
93
+ read(uri: string): Promise<Array<Record<string, unknown>>>;
94
+ /** Tell `changed` when one of these resources changes; none: no listening. */
95
+ watch?(uris: readonly string[], changed: (uri: string) => void, ended: () => void): Promise<McpWatch>;
96
+ }
97
+ export interface McpTasks {
98
+ /** The task's state; an unknown id throws {@link McpError}. */
99
+ get(taskId: string): Promise<Record<string, unknown>>;
100
+ update(taskId: string, inputResponses: Record<string, unknown>): Promise<void>;
101
+ cancel(taskId: string): Promise<void>;
102
+ /** Tell `changed` with the task's state whenever its status changes. */
103
+ watch(taskIds: readonly string[], changed: (task: Record<string, unknown>) => void): Promise<McpWatch>;
104
+ }
105
+ /** Everything one endpoint serves to one caller. */
106
+ export interface McpEndpoint {
107
+ serverInfo: {
108
+ name: string;
109
+ title?: string;
110
+ version: string;
111
+ };
112
+ /** What every client is told first; none: nothing to say. */
113
+ instructions?(): Promise<string>;
114
+ /** The tools this caller may list and call. */
115
+ tools(): Promise<McpTool[]>;
116
+ /**
117
+ * Runs a call itself instead of the listed tool: for an endpoint that
118
+ * forwards another server's tools and need not list them to call one.
119
+ */
120
+ callTool?(call: {
121
+ name: string;
122
+ arguments: Record<string, unknown>;
123
+ }, context: McpCallContext): Promise<McpToolResult>;
124
+ /** Tools this caller would see with a scope its token lacks. */
125
+ withheld?(): Promise<ReadonlyMap<string, string>>;
126
+ resources?: McpResources;
127
+ tasks?: McpTasks;
128
+ }
129
+ /** Whether the client declared the tasks extension on this request. */
130
+ export declare function declaresTasks(context: McpCallContext | undefined): boolean;
131
+ /** Whether the client can ask its person a form elicitation. */
132
+ export declare function declaresElicitation(context: McpCallContext | undefined): boolean;
133
+ /** Serve one POST to an MCP endpoint, in whichever era the client speaks. */
134
+ export declare function serveMcp(args: {
135
+ request: FastifyRequest;
136
+ reply: FastifyReply;
137
+ endpoint: McpEndpoint;
138
+ /** Named in a step-up challenge, when the host publishes one. */
139
+ resourceMetadataUrl?: string;
140
+ }): Promise<FastifyReply>;
141
+ /**
142
+ * An MCP endpoint serving another server's tools: tools listed and results
143
+ * returned as that server declared and sent them (ADR 0225), in whichever
144
+ * era the client speaks. `callTool` answers with the server's own result
145
+ * (any tool result passes through), or throws {@link McpError} for a
146
+ * refusal at the protocol boundary.
147
+ */
148
+ export declare function serveForwardedTools(args: {
149
+ request: FastifyRequest;
150
+ reply: FastifyReply;
151
+ serverName: string;
152
+ listTools(): Promise<readonly ForwardedToolDefinition[]>;
153
+ callTool(call: {
154
+ name: string;
155
+ arguments: Record<string, unknown>;
156
+ }): Promise<unknown>;
157
+ }): Promise<FastifyReply>;
158
+ //# sourceMappingURL=mcp-server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../src/mcp-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAA2B,MAAM,mBAAmB,CAAC;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE5D,OAAO,EACL,KAAK,uBAAuB,EAG7B,MAAM,iBAAiB,CAAC;AAEzB;;;;;;;;;GASG;AAEH,oEAAoE;AACpE,eAAO,MAAM,wBAAwB,YAAI,YAAY,CAAU,CAAC;AAEhE,+DAA+D;AAC/D,eAAO,MAAM,2BAA2B,aAKtC,CAAC;AACH,eAAO,MAAM,wBAAwB,eAAe,CAAC;AAErD,eAAO,MAAM,QAAQ;aACnB,eAAe,EAAE,yCAAyC;aAC1D,UAAU,EAAE,oCAAoC;aAChD,kBAAkB,EAAE,4CAA4C;aAChE,UAAU,EAAE,oCAAoC;aAChD,cAAc,EAAE,wCAAwC;CAChD,CAAC;AAEX,wEAAwE;AACxE,eAAO,MAAM,eAAe,kCAAkC,CAAC;AAE/D,eAAO,MAAM,SAAS;aACpB,KAAK,EAAE,CAAC,KAAK;aACb,cAAc,EAAE,CAAC,KAAK;aACtB,cAAc,EAAE,CAAC,KAAK;aACtB,aAAa,EAAE,CAAC,KAAK;aACrB,QAAQ,EAAE,CAAC,KAAK;aAChB,cAAc,EAAE,CAAC,KAAK;aACtB,uBAAuB,EAAE,CAAC,KAAK;aAC/B,0BAA0B,EAAE,CAAC,KAAK;CAC1B,CAAC;AAEX,sEAAsE;AACtE,eAAO,MAAM,iBAAiB,QAAS,CAAC;AAExC,6EAA6E;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,MAAM,CAAC;IACnB,SAAS,IAAI,OAAO,CAAC,SAAS,uBAAuB,EAAE,CAAC,CAAC;IACzD,QAAQ,CAAC,IAAI,EAAE;QACb,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACpC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACtB,GAAG,OAAO,CAAC,YAAY,CAAC,CAkBxB"}
@@ -1,39 +1,9 @@
1
1
  import type { CatamorphicCore, Identity } from "@catamorphic/core";
2
- import type { FastifyReply } from "fastify";
3
2
  /**
4
- * The JSON-RPC / MCP plumbing shared by the plugin's MCP endpoints — the
5
- * apps server (`/projects/:id/apps-mcp`), the workflow-tools server
6
- * (`/projects/:id/mcp`) and the connection broker (`/connection-mcp`) —
7
- * and by hosts that forward MCP servers of their own. All are stateless
8
- * Streamable-HTTP handlers speaking the `initialize`-handshake protocol era
9
- * (≤2025-11-25): requests are independent, no sessions, notifications
10
- * answered with a bare 202.
3
+ * What the plugin's MCP endpoints share beside the dispatcher
4
+ * (`mcp-server.ts`): how a value becomes a tool result, how another
5
+ * server's tools and results are forwarded, and the run poll tool.
11
6
  */
12
- export interface JsonRpcMessage {
13
- jsonrpc?: string;
14
- id?: number | string | null;
15
- method?: string;
16
- params?: Record<string, unknown>;
17
- }
18
- export declare const SUPPORTED_PROTOCOL_VERSIONS: Set<string>;
19
- export declare const DEFAULT_PROTOCOL_VERSION = "2025-06-18";
20
- /** The requested revision when supported, our default otherwise. */
21
- export declare function negotiateProtocolVersion(requested: unknown): string;
22
- /** A dispatch failure that should ride a specific JSON-RPC error code. */
23
- export declare class McpRequestError extends Error {
24
- readonly code: number;
25
- constructor(code: number, message: string);
26
- }
27
- /**
28
- * The stateless request shell the endpoints share: body-shape validation,
29
- * the notification 202, missing-method rejection, and error mapping.
30
- * `dispatch` returns the JSON-RPC result for a method; it throws
31
- * {@link McpRequestError} for coded failures (-32601 method-not-found,
32
- * -32602 bad params) and anything else becomes -32603.
33
- */
34
- export declare function handleMcpPost(reply: FastifyReply, body: unknown, dispatch: (method: string, params: Record<string, unknown>) => Promise<unknown>): Promise<FastifyReply>;
35
- export declare function rpcResult(reply: FastifyReply, id: number | string, result: unknown): FastifyReply;
36
- export declare function rpcError(reply: FastifyReply, id: number | string | null, code: number, message: string): FastifyReply;
37
7
  /**
38
8
  * Tool result: JSON text for model readability plus `structuredContent`
39
9
  * for structured consumers. MCP defines structured content as a JSON
@@ -97,21 +67,4 @@ export interface ForwardedToolDefinition {
97
67
  outputSchema?: unknown;
98
68
  annotations?: unknown;
99
69
  }
100
- /**
101
- * A stateless MCP endpoint serving another server's tools: tools listed
102
- * and results returned as that server declared and sent them (ADR 0225).
103
- * `callTool` answers with the server's own result (any tool result, such
104
- * as {@link toolError}, passes through), or throws {@link McpRequestError}
105
- * for a refusal at the protocol boundary.
106
- */
107
- export declare function serveForwardedTools(args: {
108
- reply: FastifyReply;
109
- body: unknown;
110
- serverName: string;
111
- listTools(): Promise<readonly ForwardedToolDefinition[]>;
112
- callTool(call: {
113
- name: string;
114
- arguments: Record<string, unknown>;
115
- }): Promise<unknown>;
116
- }): Promise<FastifyReply>;
117
70
  //# sourceMappingURL=mcp-shared.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-shared.d.ts","sourceRoot":"","sources":["../src/mcp-shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAG5C;;;;;;;;GAQG;AAEH,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC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AAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAY5E;AAUD;;;GAGG;AACH,eAAO,MAAM,aAAa,yBAAoB,CAAC;AAE/C,wEAAwE;AACxE,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAY5D,CAAC;AAEF,qEAAqE;AACrE,wBAAsB,eAAe,CACnC,IAAI,EAAE,eAAe,EACrB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAQlC;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE;QACT,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH;AAED,uEAAuE;AACvE,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,eAAe,EACrB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,gBAAgB,CAAC,CA4B3B;AAED,6EAA6E;AAC7E,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB"}
package/dist/mcp.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  /**
2
2
  * MCP serving for hosts: an endpoint that forwards another MCP server's
3
- * tools the way the plugin's own connection endpoint does (ADR 0225).
3
+ * tools the way the plugin's own connection endpoint does (ADR 0225), on
4
+ * the dispatcher every MCP endpoint shares (ADR 0347).
4
5
  */
5
- export { type ForwardedToolDefinition, McpRequestError, serveForwardedTools, toolError, } from "./mcp-shared.js";
6
+ export { MCP_ERROR, McpError, serveForwardedTools, } from "./mcp-server.js";
7
+ export { type ForwardedToolDefinition, toolError } from "./mcp-shared.js";
6
8
  //# sourceMappingURL=mcp.d.ts.map
package/dist/mcp.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../src/mcp.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,KAAK,uBAAuB,EAC5B,eAAe,EACf,mBAAmB,EACnB,SAAS,GACV,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../src/mcp.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,SAAS,EACT,QAAQ,EACR,mBAAmB,GACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,KAAK,uBAAuB,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC"}
package/dist/mcp.js CHANGED
@@ -1,13 +1,15 @@
1
1
  import {
2
- McpRequestError2,
3
2
  toolError2,
3
+ MCP_ERROR2,
4
+ McpError2,
4
5
  serveForwardedTools2
5
- } from "./chunk-baagvvm3.js";
6
+ } from "./chunk-jytcc42y.js";
6
7
  export {
7
- McpRequestError2 as McpRequestError,
8
+ MCP_ERROR2 as MCP_ERROR,
9
+ McpError2 as McpError,
8
10
  serveForwardedTools2 as serveForwardedTools,
9
11
  toolError2 as toolError
10
12
  };
11
13
 
12
- //# debugId=8061829D6A9EECAB64756E2164756E21
14
+ //# debugId=4735D73A846AAF2664756E2164756E21
13
15
  //# sourceMappingURL=mcp.js.map
package/dist/mcp.js.map CHANGED
@@ -4,6 +4,6 @@
4
4
  "sourcesContent": [
5
5
  ],
6
6
  "mappings": "",
7
- "debugId": "8061829D6A9EECAB64756E2164756E21",
7
+ "debugId": "4735D73A846AAF2664756E2164756E21",
8
8
  "names": []
9
9
  }
package/dist/plugin.d.ts CHANGED
@@ -1,6 +1,12 @@
1
- import type { CatamorphicCore, Identity } from "@catamorphic/core";
2
- import type { FastifyPluginAsync } from "fastify";
1
+ import type { CatamorphicCore, Identity, TokenScope } from "@catamorphic/core";
2
+ import type { FastifyPluginAsync, FastifyReply } from "fastify";
3
3
  import { type IdentityResolver } from "./http-identity.js";
4
+ declare module "fastify" {
5
+ interface FastifyContextConfig {
6
+ /** OAuth scope required for a member to call this route. */
7
+ tokenScope?: TokenScope;
8
+ }
9
+ }
4
10
  export interface CatamorphicPluginOptions {
5
11
  /**
6
12
  * Wired catamorphic services (build them with `@catamorphic/server-sdk` or
@@ -44,6 +50,18 @@ export interface CatamorphicPluginOptions {
44
50
  publicApiBase?: string;
45
51
  /** Host additions to the project MCP endpoint (ADR 0166). */
46
52
  projectMcp?: ProjectMcpHost;
53
+ /** What the MCP endpoints need from a host with replicas or OAuth. */
54
+ mcp?: McpHost;
55
+ }
56
+ /**
57
+ * Host settings for the MCP endpoints (ADR 0347). `stateSecret` signs the
58
+ * state a wait hands a client with what it asks; replicas must share it,
59
+ * and a host that sets none gets one per process. `resourceMetadataUrl`
60
+ * is the OAuth protected-resource document a step-up challenge names.
61
+ */
62
+ export interface McpHost {
63
+ stateSecret?: string;
64
+ resourceMetadataUrl?: string;
47
65
  }
48
66
  /**
49
67
  * What a host adds to `POST /projects/:projectId/mcp`: the name a client
@@ -90,6 +108,7 @@ export interface RouteContext {
90
108
  features: HostFeatures;
91
109
  publicApiBase?: string;
92
110
  projectMcp?: ProjectMcpHost;
111
+ mcp?: McpHost;
93
112
  }
94
113
  /**
95
114
  * Mountable Fastify plugin exposing the catamorphic HTTP API. Hosts register
@@ -109,5 +128,10 @@ export interface RouteContext {
109
128
  * mechanism; there is no header fallback unless the host opts into
110
129
  * `identityFromHeaders()` explicitly.
111
130
  */
131
+ /**
132
+ * 403 with the scope to ask for (RFC 6750), for a grant that lacks one:
133
+ * the same answer over REST and both MCP endpoints.
134
+ */
135
+ export declare function insufficientScope(reply: FastifyReply, scope: TokenScope, mcp: McpHost | undefined): FastifyReply;
112
136
  export declare const catamorphicPlugin: FastifyPluginAsync<CatamorphicPluginOptions>;
113
137
  //# sourceMappingURL=plugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAwBnE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAKlD,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,oBAAoB,CAAC;AAoC5B,MAAM,WAAW,wBAAwB;IACvC;;;;OAIG;IACH,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB;;;;;;;;;;;;;;;;;;OAkBG;IACH,QAAQ,EAAE,gBAAgB,CAAC;IAC3B;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IACjC;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,cAAc,CAAC;CAC7B;AAED;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,UAAU,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE;QACb,QAAQ,EAAE,QAAQ,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;KACnB,KAAK,kBAAkB,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,kBAAkB;IAC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B,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,KAAK,OAAO,CAAC;IACtE,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE;QAClB,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;QACzB,KAAK,EAAE,OAAO,CAAC;QACf,UAAU,EAAE,yBAAyB,CAAC;KACvC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACrB,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CA+F7B"}
@@ -1,9 +1,8 @@
1
1
  import type { CatamorphicCore, Identity } from "@catamorphic/core";
2
2
  import { mayUseProject } from "@catamorphic/core";
3
- export interface SurfaceTool {
4
- definition: Record<string, unknown>;
5
- call: (args: Record<string, unknown>) => Promise<Record<string, unknown>>;
6
- }
3
+ import { type McpTool } from "./session-tools.js";
4
+ /** One tool of the surface: see {@link McpTool}. */
5
+ export type SurfaceTool = McpTool;
7
6
  export { mayUseProject };
8
7
  /** Workflow names a scoped caller may see on the tools list; null = all. */
9
8
  export declare function allowedWorkflowNames(core: CatamorphicCore, identity: Identity, projectId: string): Promise<ReadonlySet<string> | null>;
@@ -1 +1 @@
1
- {"version":3,"file":"project-mcp-surface.d.ts","sourceRoot":"","sources":["../src/project-mcp-surface.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAIL,aAAa,EAMd,MAAM,mBAAmB,CAAC;AAwB3B,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,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CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,wBAAgB,YAAY,CAC1B,IAAI,EAAE,eAAe,EACrB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,MAAM,EACjB,QAAQ,GAAE,eAA6D,EACvE,gBAAgB,CAAC,EAAE,MAAM,GACxB,WAAW,EAAE,CA6kBf"}
@@ -1 +1 @@
1
- {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/routes/agent.ts"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAqD9C,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,YAAY,QAi5C1E"}
1
+ {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/routes/agent.ts"],"names":[],"mappings":"AAqCA,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,SAAS,CAAC;AAG7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAuG9C,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,YAAY,QAirD1E"}
@@ -1 +1 @@
1
- {"version":3,"file":"apps-mcp.d.ts","sourceRoot":"","sources":["../../src/routes/apps-mcp.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAmD9C,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,YAAY,QAiF5E"}
1
+ {"version":3,"file":"apps-mcp.d.ts","sourceRoot":"","sources":["../../src/routes/apps-mcp.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAkD9C,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,YAAY,QAoF5E"}
@@ -1 +1 @@
1
- {"version":3,"file":"client-runners.d.ts","sourceRoot":"","sources":["../../src/routes/client-runners.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAO9C;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,YAAY,QA+NlB"}
1
+ {"version":3,"file":"client-runners.d.ts","sourceRoot":"","sources":["../../src/routes/client-runners.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAO9C;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,YAAY,QAiOlB"}
@@ -1 +1 @@
1
- {"version":3,"file":"connection-mcp.d.ts","sourceRoot":"","sources":["../../src/routes/connection-mcp.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAQ9C;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,YAAY,GAChB,IAAI,CAuGN"}
1
+ {"version":3,"file":"connection-mcp.d.ts","sourceRoot":"","sources":["../../src/routes/connection-mcp.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAI9C;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,YAAY,GAChB,IAAI,CAoGN"}
@@ -1 +1 @@
1
- {"version":3,"file":"documents.d.ts","sourceRoot":"","sources":["../../src/routes/documents.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,SAAS,CAAC;AAG7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAoB9C;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,YAAY,QAiflB"}
1
+ {"version":3,"file":"documents.d.ts","sourceRoot":"","sources":["../../src/routes/documents.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,SAAS,CAAC;AAG7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAoB9C;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,YAAY,QAqflB"}
@@ -1 +1 @@
1
- {"version":3,"file":"environments.d.ts","sourceRoot":"","sources":["../../src/routes/environments.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAS9C,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,YAAY,GAChB,IAAI,CAwDN"}
1
+ {"version":3,"file":"environments.d.ts","sourceRoot":"","sources":["../../src/routes/environments.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAU9C,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,YAAY,GAChB,IAAI,CAmGN"}
@@ -1 +1 @@
1
- {"version":3,"file":"project-mcp.d.ts","sourceRoot":"","sources":["../../src/routes/project-mcp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,QAAQ,EACR,eAAe,EACf,kBAAkB,EAEnB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAqD9C,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,eAAe,CAAC;IAC1B,OAAO,EAAE,kBAAkB,CAAC;IAC5B;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,YAAY,QAkKlB;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,eAAe,EACrB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,WAAW,EAAE,CAAC,CA6BxB;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAmCzE;AAED,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,eAAe,EACrB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CA2DlC"}
1
+ {"version":3,"file":"project-mcp.d.ts","sourceRoot":"","sources":["../../src/routes/project-mcp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,QAAQ,EACR,eAAe,EACf,kBAAkB,EAEnB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAqD9C,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,eAAe,CAAC;IAC1B,OAAO,EAAE,kBAAkB,CAAC;IAC5B;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,YAAY,QAwLlB;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,eAAe,EACrB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,WAAW,EAAE,CAAC,CA6BxB;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAmCzE;AAED,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,eAAe,EACrB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CA2DlC"}
@@ -1 +1 @@
1
- {"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/routes/projects.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AA6C9C,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,YAAY,QAmnB5E"}
1
+ {"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/routes/projects.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AA6C9C,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,YAAY,QAynB5E"}
@@ -1 +1 @@
1
- {"version":3,"file":"publications.d.ts","sourceRoot":"","sources":["../../src/routes/publications.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,SAAS,CAAC;AAG7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAU9C;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,YAAY,QA0LlB"}
1
+ {"version":3,"file":"publications.d.ts","sourceRoot":"","sources":["../../src/routes/publications.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,SAAS,CAAC;AAG7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAU9C;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,YAAY,QA4LlB"}
@@ -1 +1 @@
1
- {"version":3,"file":"run-errors.d.ts","sourceRoot":"","sources":["../../src/routes/run-errors.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,YAAY,GAClB,YAAY,GAAG,IAAI,CAyDrB"}
1
+ {"version":3,"file":"run-errors.d.ts","sourceRoot":"","sources":["../../src/routes/run-errors.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,YAAY,GAClB,YAAY,GAAG,IAAI,CA4DrB"}
@@ -1 +1 @@
1
- {"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../../src/routes/runs.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,SAAS,CAAC;AAG7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAkB9C,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,YAAY,QAiNxE"}
1
+ {"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../../src/routes/runs.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,SAAS,CAAC;AAG7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAkB9C,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,YAAY,QAqNxE"}
@@ -0,0 +1,17 @@
1
+ import type { FastifyInstance } from "fastify";
2
+ import type { RouteContext } from "../app.js";
3
+ /**
4
+ * The server's own MCP endpoint (ADR 0347): the one address a person
5
+ * gives their agent. It serves `project_list` and the session operations
6
+ * with the project as an argument, so one connection starts, watches and
7
+ * answers chats in every project its person may use. A project's own
8
+ * endpoint (`/projects/:projectId/mcp`) adds that project's documents,
9
+ * program and workflows, with the same chat tools bound to it.
10
+ */
11
+ /**
12
+ * What every client is told first. The first 512 characters stand alone:
13
+ * some clients read no further.
14
+ */
15
+ export declare const SERVER_MCP_INSTRUCTIONS = "Work runs coding agents on this server as you. Start one with session_start (it returns a sessionId at once), keep working, then call session_wait with the returned cursor until state is idle, failed or needs_input. needs_input lists requests: answer questions with session_answer; approvals go to your person. Read replies, typed results and pull requests with session_read. Steer with session_send, stop with session_interrupt. Retry any call with the same idempotencyKey.\n\nproject_list names the projects you may use and their agents: pass a project's id as project to session_start and session_list. Every chat tool answers with the chat's state (working, needs_input, idle, failed or closed) and a cursor. A wait returns within 50 seconds; changed false means nothing happened yet, so call it again with the same cursor. A project's own endpoint, at /projects/<id>/mcp beside this one, adds its documents, program and workflows.";
16
+ export declare function registerServerMcpRoutes(app: FastifyInstance, ctx: RouteContext): void;
17
+ //# sourceMappingURL=server-mcp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server-mcp.d.ts","sourceRoot":"","sources":["../../src/routes/server-mcp.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,SAAS,CAAC;AAE7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAO9C;;;;;;;GAOG;AAEH;;;GAGG;AACH,eAAO,MAAM,uBAAuB,46BACu4B,CAAC;AAyE56B,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,YAAY,QAmDlB"}
@@ -1 +1 @@
1
- {"version":3,"file":"session-mailboxes.d.ts","sourceRoot":"","sources":["../../src/routes/session-mailboxes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAY9C,wBAAgB,4BAA4B,CAC1C,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,YAAY,QA8DlB"}
1
+ {"version":3,"file":"session-mailboxes.d.ts","sourceRoot":"","sources":["../../src/routes/session-mailboxes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAY9C,wBAAgB,4BAA4B,CAC1C,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,YAAY,QA+DlB"}
@@ -1 +1 @@
1
- {"version":3,"file":"triggers.d.ts","sourceRoot":"","sources":["../../src/routes/triggers.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAA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E,GAAG,EAAE,YAAY,QAoI5E"}
@@ -1 +1 @@
1
- {"version":3,"file":"watchers.d.ts","sourceRoot":"","sources":["../../src/routes/watchers.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAW9C,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,YAAY,QA4E5E"}
1
+ {"version":3,"file":"watchers.d.ts","sourceRoot":"","sources":["../../src/routes/watchers.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAW9C,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,YAAY,QA6E5E"}
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-enablements.d.ts","sourceRoot":"","sources":["../../src/routes/workflow-enablements.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAG7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAgC9C,wBAAgB,gCAAgC,CAC9C,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,YAAY,GAChB,IAAI,CAuON;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,4SA0CxE"}
1
+ {"version":3,"file":"workflow-enablements.d.ts","sourceRoot":"","sources":["../../src/routes/workflow-enablements.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAG7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAiC9C,wBAAgB,gCAAgC,CAC9C,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,YAAY,GAChB,IAAI,CA+TN;AAyCD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,4SA2CxE"}
@@ -1 +1 @@
1
- {"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../../src/routes/workflows.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAsB9C,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,YAAY,QAqSlB"}
1
+ {"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../../src/routes/workflows.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAsB9C,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,YAAY,QAySlB"}