@openfairygui/mcp 0.2.0-alpha.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 +83 -0
- package/bin/ofgui-mcp.cjs +14 -0
- package/dist/index.cjs +13 -0
- package/dist/index.d.cts +357 -0
- package/dist/index.d.mts +357 -0
- package/dist/index.mjs +2 -0
- package/dist/stdio-BDHxauin.cjs +535 -0
- package/dist/stdio-ByGWerIG.mjs +470 -0
- package/dist/stdio.cjs +3 -0
- package/dist/stdio.d.cts +4 -0
- package/dist/stdio.d.mts +4 -0
- package/dist/stdio.mjs +2 -0
- package/package.json +85 -0
- package/src/index.ts +28 -0
- package/src/prompt-definitions.ts +106 -0
- package/src/resource-definitions.ts +82 -0
- package/src/server.ts +48 -0
- package/src/stdio.ts +15 -0
- package/src/tool-definitions.ts +196 -0
- package/src/tool-handler.ts +110 -0
package/README.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# @openfairygui/mcp
|
|
2
|
+
|
|
3
|
+
MCP server adapter for OpenFairyGUI backend runtime services.
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
`@openfairygui/mcp` is a thin Model Context Protocol adapter over `@openfairygui/backend`.
|
|
8
|
+
|
|
9
|
+
It maps the backend P2 runtime surface into MCP tools:
|
|
10
|
+
|
|
11
|
+
- `getCapabilities`
|
|
12
|
+
- `openSession`
|
|
13
|
+
- `getSession`
|
|
14
|
+
- `applyTransaction`
|
|
15
|
+
- `saveSession`
|
|
16
|
+
- `closeSession`
|
|
17
|
+
- `getEvents`
|
|
18
|
+
- `getJob`
|
|
19
|
+
- `listJobs`
|
|
20
|
+
- `cancelJob`
|
|
21
|
+
- `getCacheSnapshot`
|
|
22
|
+
- `refreshCache`
|
|
23
|
+
|
|
24
|
+
Each tool exposes a shared output schema for `structuredContent.backendResult`, preserving the backend envelope shape:
|
|
25
|
+
|
|
26
|
+
- `ok`
|
|
27
|
+
- `data?`
|
|
28
|
+
- `error?`
|
|
29
|
+
- `meta?`
|
|
30
|
+
|
|
31
|
+
P1 also registers MCP-native ergonomics around the same backend surface:
|
|
32
|
+
|
|
33
|
+
- read-only resources for identity snapshots:
|
|
34
|
+
- `openfairygui://backend/capabilities`
|
|
35
|
+
- `openfairygui://backend/session/{sessionId}`
|
|
36
|
+
- `openfairygui://backend/cache/{sessionId}`
|
|
37
|
+
- `openfairygui://backend/job/{sessionId}/{jobId}`
|
|
38
|
+
- prompts for capability inspection, session open/inspect, revision-checked transactions, save, and runtime polling
|
|
39
|
+
|
|
40
|
+
Resources return `application/json` text containing the unchanged backend result envelope. Parameterized polling remains tool-based: `getEvents` and `listJobs` are not exposed as resource URI query grammars.
|
|
41
|
+
|
|
42
|
+
It does **not** redefine transaction selectors, transaction operations, path policy, session semantics, job semantics, cache semantics, or backend error envelopes. Those remain owned by `@openfairygui/backend`, `@openfairygui/functions`, and `@openfairygui/core`.
|
|
43
|
+
|
|
44
|
+
It also does **not** activate artifact publish/restore jobs, subscriptions, persistent jobs, or cache-as-source-of-truth behavior. MCP roots may be useful client context, but this package does not enforce roots or duplicate backend path canonicalization; backend path policy remains authoritative.
|
|
45
|
+
|
|
46
|
+
## Usage
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
import { createOpenFairyGuiMcpServer } from '@openfairygui/mcp';
|
|
50
|
+
|
|
51
|
+
const server = createOpenFairyGuiMcpServer();
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
For stdio clients, use the package binary:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
ofgui-mcp
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Example local MCP client configuration:
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"mcpServers": {
|
|
65
|
+
"openfairygui": {
|
|
66
|
+
"command": "ofgui-mcp"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
When running from a workspace checkout before publishing, point the command at the package binary after building:
|
|
73
|
+
|
|
74
|
+
```json
|
|
75
|
+
{
|
|
76
|
+
"mcpServers": {
|
|
77
|
+
"openfairygui": {
|
|
78
|
+
"command": "node",
|
|
79
|
+
"args": ["./packages/mcp/bin/ofgui-mcp.cjs"]
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
```
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const { pathToFileURL } = require('url');
|
|
6
|
+
|
|
7
|
+
const entry = path.resolve(__dirname, '../dist/stdio.mjs');
|
|
8
|
+
|
|
9
|
+
import(pathToFileURL(entry).href)
|
|
10
|
+
.then((module) => module.connectOpenFairyGuiMcpStdio())
|
|
11
|
+
.catch((error) => {
|
|
12
|
+
console.error(error instanceof Error ? error.stack ?? error.message : String(error));
|
|
13
|
+
process.exitCode = 1;
|
|
14
|
+
});
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_stdio = require("./stdio-BDHxauin.cjs");
|
|
3
|
+
exports.OPENFAIRYGUI_BACKEND_CAPABILITIES_RESOURCE_URI = require_stdio.OPENFAIRYGUI_BACKEND_CAPABILITIES_RESOURCE_URI;
|
|
4
|
+
exports.OPENFAIRYGUI_BACKEND_PROMPT_DEFINITIONS = require_stdio.OPENFAIRYGUI_BACKEND_PROMPT_DEFINITIONS;
|
|
5
|
+
exports.OPENFAIRYGUI_BACKEND_PROMPT_NAMES = require_stdio.OPENFAIRYGUI_BACKEND_PROMPT_NAMES;
|
|
6
|
+
exports.OPENFAIRYGUI_BACKEND_RESOURCE_TEMPLATES = require_stdio.OPENFAIRYGUI_BACKEND_RESOURCE_TEMPLATES;
|
|
7
|
+
exports.OPENFAIRYGUI_BACKEND_TOOL_DEFINITIONS = require_stdio.OPENFAIRYGUI_BACKEND_TOOL_DEFINITIONS;
|
|
8
|
+
exports.OPENFAIRYGUI_BACKEND_TOOL_NAMES = require_stdio.OPENFAIRYGUI_BACKEND_TOOL_NAMES;
|
|
9
|
+
exports.OPENFAIRYGUI_BACKEND_TOOL_OUTPUT_SCHEMA = require_stdio.OPENFAIRYGUI_BACKEND_TOOL_OUTPUT_SCHEMA;
|
|
10
|
+
exports.OPENFAIRYGUI_BACKEND_TOOL_PREFIX = require_stdio.OPENFAIRYGUI_BACKEND_TOOL_PREFIX;
|
|
11
|
+
exports.callOpenFairyGuiBackendTool = require_stdio.callOpenFairyGuiBackendTool;
|
|
12
|
+
exports.connectOpenFairyGuiMcpStdio = require_stdio.connectOpenFairyGuiMcpStdio;
|
|
13
|
+
exports.createOpenFairyGuiMcpServer = require_stdio.createOpenFairyGuiMcpServer;
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
import { connectOpenFairyGuiMcpStdio } from "./stdio.cjs";
|
|
2
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
|
+
import { BackendRuntime } from "@openfairygui/backend";
|
|
4
|
+
import { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
|
|
7
|
+
//#region src/server.d.ts
|
|
8
|
+
interface CreateOpenFairyGuiMcpServerOptions {
|
|
9
|
+
runtime?: BackendRuntime;
|
|
10
|
+
name?: string;
|
|
11
|
+
version?: string;
|
|
12
|
+
}
|
|
13
|
+
declare function createOpenFairyGuiMcpServer(options?: CreateOpenFairyGuiMcpServerOptions): McpServer;
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/tool-definitions.d.ts
|
|
16
|
+
declare const OPENFAIRYGUI_BACKEND_TOOL_PREFIX = "openfairygui_backend_";
|
|
17
|
+
declare const OPENFAIRYGUI_BACKEND_TOOL_NAMES: readonly ["openfairygui_backend_get_capabilities", "openfairygui_backend_open_session", "openfairygui_backend_get_session", "openfairygui_backend_apply_transaction", "openfairygui_backend_save_session", "openfairygui_backend_close_session", "openfairygui_backend_get_events", "openfairygui_backend_get_job", "openfairygui_backend_list_jobs", "openfairygui_backend_cancel_job", "openfairygui_backend_get_cache_snapshot", "openfairygui_backend_refresh_cache"];
|
|
18
|
+
type OpenFairyGuiBackendToolName = typeof OPENFAIRYGUI_BACKEND_TOOL_NAMES[number];
|
|
19
|
+
type BackendMethodName = 'getCapabilities' | 'openSession' | 'getSession' | 'applyTransaction' | 'saveSession' | 'closeSession' | 'getEvents' | 'getJob' | 'listJobs' | 'cancelJob' | 'getCacheSnapshot' | 'refreshCache';
|
|
20
|
+
interface OpenFairyGuiBackendToolDefinition {
|
|
21
|
+
name: OpenFairyGuiBackendToolName;
|
|
22
|
+
backendMethod: BackendMethodName;
|
|
23
|
+
title: string;
|
|
24
|
+
description: string;
|
|
25
|
+
inputSchema: z.ZodObject;
|
|
26
|
+
outputSchema: z.ZodObject;
|
|
27
|
+
annotations: {
|
|
28
|
+
readOnlyHint?: boolean;
|
|
29
|
+
destructiveHint?: boolean;
|
|
30
|
+
idempotentHint?: boolean;
|
|
31
|
+
openWorldHint?: boolean;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
declare const OPENFAIRYGUI_BACKEND_TOOL_OUTPUT_SCHEMA: z.ZodObject<{
|
|
35
|
+
backendResult: z.ZodObject<{
|
|
36
|
+
ok: z.ZodBoolean;
|
|
37
|
+
data: z.ZodOptional<z.ZodUnknown>;
|
|
38
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
39
|
+
meta: z.ZodOptional<z.ZodUnknown>;
|
|
40
|
+
}, z.core.$loose>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
declare const OPENFAIRYGUI_BACKEND_TOOL_DEFINITIONS: readonly [{
|
|
43
|
+
readonly name: "openfairygui_backend_get_capabilities";
|
|
44
|
+
readonly backendMethod: "getCapabilities";
|
|
45
|
+
readonly title: "Get Backend Capabilities";
|
|
46
|
+
readonly description: "Return the OpenFairyGUI backend capability, version, and service-plane snapshot.";
|
|
47
|
+
readonly inputSchema: z.ZodObject<{}, z.core.$strip>;
|
|
48
|
+
readonly outputSchema: z.ZodObject<{
|
|
49
|
+
backendResult: z.ZodObject<{
|
|
50
|
+
ok: z.ZodBoolean;
|
|
51
|
+
data: z.ZodOptional<z.ZodUnknown>;
|
|
52
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
53
|
+
meta: z.ZodOptional<z.ZodUnknown>;
|
|
54
|
+
}, z.core.$loose>;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
readonly annotations: {
|
|
57
|
+
readonly readOnlyHint: true;
|
|
58
|
+
readonly idempotentHint: true;
|
|
59
|
+
readonly openWorldHint: false;
|
|
60
|
+
};
|
|
61
|
+
}, {
|
|
62
|
+
readonly name: "openfairygui_backend_open_session";
|
|
63
|
+
readonly backendMethod: "openSession";
|
|
64
|
+
readonly title: "Open Backend Session";
|
|
65
|
+
readonly description: "Open a FairyGUI project through BackendRuntime and acquire its backend-local session lock.";
|
|
66
|
+
readonly inputSchema: z.ZodObject<{
|
|
67
|
+
projectPath: z.ZodString;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
readonly outputSchema: z.ZodObject<{
|
|
70
|
+
backendResult: z.ZodObject<{
|
|
71
|
+
ok: z.ZodBoolean;
|
|
72
|
+
data: z.ZodOptional<z.ZodUnknown>;
|
|
73
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
74
|
+
meta: z.ZodOptional<z.ZodUnknown>;
|
|
75
|
+
}, z.core.$loose>;
|
|
76
|
+
}, z.core.$strip>;
|
|
77
|
+
readonly annotations: {
|
|
78
|
+
readonly readOnlyHint: false;
|
|
79
|
+
readonly idempotentHint: false;
|
|
80
|
+
readonly openWorldHint: false;
|
|
81
|
+
};
|
|
82
|
+
}, {
|
|
83
|
+
readonly name: "openfairygui_backend_get_session";
|
|
84
|
+
readonly backendMethod: "getSession";
|
|
85
|
+
readonly title: "Get Backend Session";
|
|
86
|
+
readonly description: "Return a backend session snapshot by session id.";
|
|
87
|
+
readonly inputSchema: z.ZodObject<{
|
|
88
|
+
sessionId: z.ZodString;
|
|
89
|
+
}, z.core.$strip>;
|
|
90
|
+
readonly outputSchema: z.ZodObject<{
|
|
91
|
+
backendResult: z.ZodObject<{
|
|
92
|
+
ok: z.ZodBoolean;
|
|
93
|
+
data: z.ZodOptional<z.ZodUnknown>;
|
|
94
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
95
|
+
meta: z.ZodOptional<z.ZodUnknown>;
|
|
96
|
+
}, z.core.$loose>;
|
|
97
|
+
}, z.core.$strip>;
|
|
98
|
+
readonly annotations: {
|
|
99
|
+
readonly readOnlyHint: true;
|
|
100
|
+
readonly idempotentHint: true;
|
|
101
|
+
readonly openWorldHint: false;
|
|
102
|
+
};
|
|
103
|
+
}, {
|
|
104
|
+
readonly name: "openfairygui_backend_apply_transaction";
|
|
105
|
+
readonly backendMethod: "applyTransaction";
|
|
106
|
+
readonly title: "Apply UAM Transaction";
|
|
107
|
+
readonly description: "Apply a backend revision-checked UAM operation batch without redefining selector or operation grammar.";
|
|
108
|
+
readonly inputSchema: z.ZodObject<{
|
|
109
|
+
sessionId: z.ZodString;
|
|
110
|
+
expectedRevision: z.ZodNumber;
|
|
111
|
+
operations: z.ZodArray<z.ZodUnknown>;
|
|
112
|
+
}, z.core.$strip>;
|
|
113
|
+
readonly outputSchema: z.ZodObject<{
|
|
114
|
+
backendResult: z.ZodObject<{
|
|
115
|
+
ok: z.ZodBoolean;
|
|
116
|
+
data: z.ZodOptional<z.ZodUnknown>;
|
|
117
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
118
|
+
meta: z.ZodOptional<z.ZodUnknown>;
|
|
119
|
+
}, z.core.$loose>;
|
|
120
|
+
}, z.core.$strip>;
|
|
121
|
+
readonly annotations: {
|
|
122
|
+
readonly readOnlyHint: false;
|
|
123
|
+
readonly destructiveHint: true;
|
|
124
|
+
readonly idempotentHint: false;
|
|
125
|
+
readonly openWorldHint: false;
|
|
126
|
+
};
|
|
127
|
+
}, {
|
|
128
|
+
readonly name: "openfairygui_backend_save_session";
|
|
129
|
+
readonly backendMethod: "saveSession";
|
|
130
|
+
readonly title: "Save Backend Session";
|
|
131
|
+
readonly description: "Write the current backend session back through the backend coordinated non-atomic save path.";
|
|
132
|
+
readonly inputSchema: z.ZodObject<{
|
|
133
|
+
sessionId: z.ZodString;
|
|
134
|
+
expectedRevision: z.ZodOptional<z.ZodNumber>;
|
|
135
|
+
targetPath: z.ZodOptional<z.ZodString>;
|
|
136
|
+
}, z.core.$strip>;
|
|
137
|
+
readonly outputSchema: z.ZodObject<{
|
|
138
|
+
backendResult: z.ZodObject<{
|
|
139
|
+
ok: z.ZodBoolean;
|
|
140
|
+
data: z.ZodOptional<z.ZodUnknown>;
|
|
141
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
142
|
+
meta: z.ZodOptional<z.ZodUnknown>;
|
|
143
|
+
}, z.core.$loose>;
|
|
144
|
+
}, z.core.$strip>;
|
|
145
|
+
readonly annotations: {
|
|
146
|
+
readonly readOnlyHint: false;
|
|
147
|
+
readonly destructiveHint: true;
|
|
148
|
+
readonly idempotentHint: false;
|
|
149
|
+
readonly openWorldHint: false;
|
|
150
|
+
};
|
|
151
|
+
}, {
|
|
152
|
+
readonly name: "openfairygui_backend_close_session";
|
|
153
|
+
readonly backendMethod: "closeSession";
|
|
154
|
+
readonly title: "Close Backend Session";
|
|
155
|
+
readonly description: "Close a backend session and release its backend-local advisory lock.";
|
|
156
|
+
readonly inputSchema: z.ZodObject<{
|
|
157
|
+
sessionId: z.ZodString;
|
|
158
|
+
}, z.core.$strip>;
|
|
159
|
+
readonly outputSchema: z.ZodObject<{
|
|
160
|
+
backendResult: z.ZodObject<{
|
|
161
|
+
ok: z.ZodBoolean;
|
|
162
|
+
data: z.ZodOptional<z.ZodUnknown>;
|
|
163
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
164
|
+
meta: z.ZodOptional<z.ZodUnknown>;
|
|
165
|
+
}, z.core.$loose>;
|
|
166
|
+
}, z.core.$strip>;
|
|
167
|
+
readonly annotations: {
|
|
168
|
+
readonly readOnlyHint: false;
|
|
169
|
+
readonly idempotentHint: false;
|
|
170
|
+
readonly openWorldHint: false;
|
|
171
|
+
};
|
|
172
|
+
}, {
|
|
173
|
+
readonly name: "openfairygui_backend_get_events";
|
|
174
|
+
readonly backendMethod: "getEvents";
|
|
175
|
+
readonly title: "Get Runtime Events";
|
|
176
|
+
readonly description: "Poll backend runtime events for a session using the backend P2 event cursor contract.";
|
|
177
|
+
readonly inputSchema: z.ZodObject<{
|
|
178
|
+
sessionId: z.ZodString;
|
|
179
|
+
after: z.ZodOptional<z.ZodString>;
|
|
180
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
181
|
+
}, z.core.$strip>;
|
|
182
|
+
readonly outputSchema: z.ZodObject<{
|
|
183
|
+
backendResult: z.ZodObject<{
|
|
184
|
+
ok: z.ZodBoolean;
|
|
185
|
+
data: z.ZodOptional<z.ZodUnknown>;
|
|
186
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
187
|
+
meta: z.ZodOptional<z.ZodUnknown>;
|
|
188
|
+
}, z.core.$loose>;
|
|
189
|
+
}, z.core.$strip>;
|
|
190
|
+
readonly annotations: {
|
|
191
|
+
readonly readOnlyHint: true;
|
|
192
|
+
readonly idempotentHint: true;
|
|
193
|
+
readonly openWorldHint: false;
|
|
194
|
+
};
|
|
195
|
+
}, {
|
|
196
|
+
readonly name: "openfairygui_backend_get_job";
|
|
197
|
+
readonly backendMethod: "getJob";
|
|
198
|
+
readonly title: "Get Runtime Job";
|
|
199
|
+
readonly description: "Return a backend runtime job snapshot by session and backend-local job id.";
|
|
200
|
+
readonly inputSchema: z.ZodObject<{
|
|
201
|
+
sessionId: z.ZodString;
|
|
202
|
+
jobId: z.ZodString;
|
|
203
|
+
}, z.core.$strip>;
|
|
204
|
+
readonly outputSchema: z.ZodObject<{
|
|
205
|
+
backendResult: z.ZodObject<{
|
|
206
|
+
ok: z.ZodBoolean;
|
|
207
|
+
data: z.ZodOptional<z.ZodUnknown>;
|
|
208
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
209
|
+
meta: z.ZodOptional<z.ZodUnknown>;
|
|
210
|
+
}, z.core.$loose>;
|
|
211
|
+
}, z.core.$strip>;
|
|
212
|
+
readonly annotations: {
|
|
213
|
+
readonly readOnlyHint: true;
|
|
214
|
+
readonly idempotentHint: true;
|
|
215
|
+
readonly openWorldHint: false;
|
|
216
|
+
};
|
|
217
|
+
}, {
|
|
218
|
+
readonly name: "openfairygui_backend_list_jobs";
|
|
219
|
+
readonly backendMethod: "listJobs";
|
|
220
|
+
readonly title: "List Runtime Jobs";
|
|
221
|
+
readonly description: "List backend runtime jobs for a session with backend P2 status/kind filters.";
|
|
222
|
+
readonly inputSchema: z.ZodObject<{
|
|
223
|
+
sessionId: z.ZodString;
|
|
224
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
225
|
+
queued: "queued";
|
|
226
|
+
running: "running";
|
|
227
|
+
completed: "completed";
|
|
228
|
+
failed: "failed";
|
|
229
|
+
cancelled: "cancelled";
|
|
230
|
+
active: "active";
|
|
231
|
+
terminal: "terminal";
|
|
232
|
+
}>>;
|
|
233
|
+
kind: z.ZodOptional<z.ZodLiteral<"cache.refresh">>;
|
|
234
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
235
|
+
}, z.core.$strip>;
|
|
236
|
+
readonly outputSchema: z.ZodObject<{
|
|
237
|
+
backendResult: z.ZodObject<{
|
|
238
|
+
ok: z.ZodBoolean;
|
|
239
|
+
data: z.ZodOptional<z.ZodUnknown>;
|
|
240
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
241
|
+
meta: z.ZodOptional<z.ZodUnknown>;
|
|
242
|
+
}, z.core.$loose>;
|
|
243
|
+
}, z.core.$strip>;
|
|
244
|
+
readonly annotations: {
|
|
245
|
+
readonly readOnlyHint: true;
|
|
246
|
+
readonly idempotentHint: true;
|
|
247
|
+
readonly openWorldHint: false;
|
|
248
|
+
};
|
|
249
|
+
}, {
|
|
250
|
+
readonly name: "openfairygui_backend_cancel_job";
|
|
251
|
+
readonly backendMethod: "cancelJob";
|
|
252
|
+
readonly title: "Cancel Runtime Job";
|
|
253
|
+
readonly description: "Request cooperative cancellation for a backend runtime job.";
|
|
254
|
+
readonly inputSchema: z.ZodObject<{
|
|
255
|
+
sessionId: z.ZodString;
|
|
256
|
+
jobId: z.ZodString;
|
|
257
|
+
}, z.core.$strip>;
|
|
258
|
+
readonly outputSchema: z.ZodObject<{
|
|
259
|
+
backendResult: z.ZodObject<{
|
|
260
|
+
ok: z.ZodBoolean;
|
|
261
|
+
data: z.ZodOptional<z.ZodUnknown>;
|
|
262
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
263
|
+
meta: z.ZodOptional<z.ZodUnknown>;
|
|
264
|
+
}, z.core.$loose>;
|
|
265
|
+
}, z.core.$strip>;
|
|
266
|
+
readonly annotations: {
|
|
267
|
+
readonly readOnlyHint: false;
|
|
268
|
+
readonly idempotentHint: false;
|
|
269
|
+
readonly openWorldHint: false;
|
|
270
|
+
};
|
|
271
|
+
}, {
|
|
272
|
+
readonly name: "openfairygui_backend_get_cache_snapshot";
|
|
273
|
+
readonly backendMethod: "getCacheSnapshot";
|
|
274
|
+
readonly title: "Get Cache Snapshot";
|
|
275
|
+
readonly description: "Return the backend P2 derived read-only cache snapshot for a session.";
|
|
276
|
+
readonly inputSchema: z.ZodObject<{
|
|
277
|
+
sessionId: z.ZodString;
|
|
278
|
+
}, z.core.$strip>;
|
|
279
|
+
readonly outputSchema: z.ZodObject<{
|
|
280
|
+
backendResult: z.ZodObject<{
|
|
281
|
+
ok: z.ZodBoolean;
|
|
282
|
+
data: z.ZodOptional<z.ZodUnknown>;
|
|
283
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
284
|
+
meta: z.ZodOptional<z.ZodUnknown>;
|
|
285
|
+
}, z.core.$loose>;
|
|
286
|
+
}, z.core.$strip>;
|
|
287
|
+
readonly annotations: {
|
|
288
|
+
readonly readOnlyHint: true;
|
|
289
|
+
readonly idempotentHint: true;
|
|
290
|
+
readonly openWorldHint: false;
|
|
291
|
+
};
|
|
292
|
+
}, {
|
|
293
|
+
readonly name: "openfairygui_backend_refresh_cache";
|
|
294
|
+
readonly backendMethod: "refreshCache";
|
|
295
|
+
readonly title: "Refresh Cache";
|
|
296
|
+
readonly description: "Create a backend P2 cache.refresh job for the session cache snapshot.";
|
|
297
|
+
readonly inputSchema: z.ZodObject<{
|
|
298
|
+
sessionId: z.ZodString;
|
|
299
|
+
reason: z.ZodOptional<z.ZodEnum<{
|
|
300
|
+
manual: "manual";
|
|
301
|
+
session_open: "session_open";
|
|
302
|
+
after_save: "after_save";
|
|
303
|
+
}>>;
|
|
304
|
+
}, z.core.$strip>;
|
|
305
|
+
readonly outputSchema: z.ZodObject<{
|
|
306
|
+
backendResult: z.ZodObject<{
|
|
307
|
+
ok: z.ZodBoolean;
|
|
308
|
+
data: z.ZodOptional<z.ZodUnknown>;
|
|
309
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
310
|
+
meta: z.ZodOptional<z.ZodUnknown>;
|
|
311
|
+
}, z.core.$loose>;
|
|
312
|
+
}, z.core.$strip>;
|
|
313
|
+
readonly annotations: {
|
|
314
|
+
readonly readOnlyHint: false;
|
|
315
|
+
readonly idempotentHint: false;
|
|
316
|
+
readonly openWorldHint: false;
|
|
317
|
+
};
|
|
318
|
+
}];
|
|
319
|
+
//#endregion
|
|
320
|
+
//#region src/tool-handler.d.ts
|
|
321
|
+
declare function callOpenFairyGuiBackendTool(runtime: BackendRuntime, name: OpenFairyGuiBackendToolName, input: Record<string, unknown>): Promise<CallToolResult>;
|
|
322
|
+
//#endregion
|
|
323
|
+
//#region src/prompt-definitions.d.ts
|
|
324
|
+
declare const OPENFAIRYGUI_BACKEND_PROMPT_NAMES: readonly ["openfairygui_inspect_capabilities", "openfairygui_open_and_inspect_session", "openfairygui_plan_revision_checked_transaction", "openfairygui_save_session", "openfairygui_poll_runtime_state"];
|
|
325
|
+
type OpenFairyGuiBackendPromptName = typeof OPENFAIRYGUI_BACKEND_PROMPT_NAMES[number];
|
|
326
|
+
declare const OPENFAIRYGUI_BACKEND_PROMPT_DEFINITIONS: readonly [{
|
|
327
|
+
readonly name: "openfairygui_inspect_capabilities";
|
|
328
|
+
readonly title: "Inspect OpenFairyGUI Backend Capabilities";
|
|
329
|
+
readonly description: "Guide a client through the capability and version discovery tool.";
|
|
330
|
+
readonly text: string;
|
|
331
|
+
}, {
|
|
332
|
+
readonly name: "openfairygui_open_and_inspect_session";
|
|
333
|
+
readonly title: "Open and Inspect an OpenFairyGUI Session";
|
|
334
|
+
readonly description: "Guide a client through opening and reading a backend session.";
|
|
335
|
+
readonly text: string;
|
|
336
|
+
}, {
|
|
337
|
+
readonly name: "openfairygui_plan_revision_checked_transaction";
|
|
338
|
+
readonly title: "Plan a Revision-Checked OpenFairyGUI Transaction";
|
|
339
|
+
readonly description: "Guide a client through backend-owned revision checks without inventing operation grammar.";
|
|
340
|
+
readonly text: string;
|
|
341
|
+
}, {
|
|
342
|
+
readonly name: "openfairygui_save_session";
|
|
343
|
+
readonly title: "Save an OpenFairyGUI Backend Session";
|
|
344
|
+
readonly description: "Guide a client through coordinated backend save semantics.";
|
|
345
|
+
readonly text: string;
|
|
346
|
+
}, {
|
|
347
|
+
readonly name: "openfairygui_poll_runtime_state";
|
|
348
|
+
readonly title: "Poll OpenFairyGUI Runtime State";
|
|
349
|
+
readonly description: "Guide a client through event, job, and cache polling tools.";
|
|
350
|
+
readonly text: string;
|
|
351
|
+
}];
|
|
352
|
+
//#endregion
|
|
353
|
+
//#region src/resource-definitions.d.ts
|
|
354
|
+
declare const OPENFAIRYGUI_BACKEND_CAPABILITIES_RESOURCE_URI = "openfairygui://backend/capabilities";
|
|
355
|
+
declare const OPENFAIRYGUI_BACKEND_RESOURCE_TEMPLATES: readonly ["openfairygui://backend/session/{sessionId}", "openfairygui://backend/cache/{sessionId}", "openfairygui://backend/job/{sessionId}/{jobId}"];
|
|
356
|
+
//#endregion
|
|
357
|
+
export { type BackendMethodName, type CreateOpenFairyGuiMcpServerOptions, OPENFAIRYGUI_BACKEND_CAPABILITIES_RESOURCE_URI, OPENFAIRYGUI_BACKEND_PROMPT_DEFINITIONS, OPENFAIRYGUI_BACKEND_PROMPT_NAMES, OPENFAIRYGUI_BACKEND_RESOURCE_TEMPLATES, OPENFAIRYGUI_BACKEND_TOOL_DEFINITIONS, OPENFAIRYGUI_BACKEND_TOOL_NAMES, OPENFAIRYGUI_BACKEND_TOOL_OUTPUT_SCHEMA, OPENFAIRYGUI_BACKEND_TOOL_PREFIX, type OpenFairyGuiBackendPromptName, type OpenFairyGuiBackendToolDefinition, type OpenFairyGuiBackendToolName, callOpenFairyGuiBackendTool, connectOpenFairyGuiMcpStdio, createOpenFairyGuiMcpServer };
|