@openfairygui/mcp 0.2.0 → 0.3.0-alpha.2
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 +7 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +52 -5
- package/dist/index.d.mts +52 -5
- package/dist/index.mjs +1 -1
- package/dist/{stdio-eqd_tVeJ.cjs → stdio-DsVFGCZw.cjs} +53 -1
- package/dist/{stdio-AonL7fG4.mjs → stdio-nxePbIRB.mjs} +53 -1
- package/dist/stdio.cjs +1 -1
- package/dist/stdio.mjs +1 -1
- package/package.json +4 -4
- package/src/prompt-definitions.ts +12 -0
- package/src/resource-definitions.ts +14 -0
- package/src/tool-definitions.ts +22 -0
- package/src/tool-handler.ts +12 -0
package/README.md
CHANGED
|
@@ -10,9 +10,13 @@ It maps the backend P2 runtime surface into MCP tools:
|
|
|
10
10
|
|
|
11
11
|
- `getCapabilities`
|
|
12
12
|
- `openSession`
|
|
13
|
+
- `openProjectSession`
|
|
13
14
|
- `getSession`
|
|
15
|
+
- `getProjectOutline`
|
|
16
|
+
- `validateSession`
|
|
14
17
|
- `applyTransaction`
|
|
15
18
|
- `saveSession`
|
|
19
|
+
- `materializeSession`
|
|
16
20
|
- `closeSession`
|
|
17
21
|
- `getEvents`
|
|
18
22
|
- `getJob`
|
|
@@ -33,11 +37,13 @@ P1 also registers MCP-native ergonomics around the same backend surface:
|
|
|
33
37
|
- read-only resources for identity snapshots:
|
|
34
38
|
- `openfairygui://backend/capabilities`
|
|
35
39
|
- `openfairygui://backend/session/{sessionId}`
|
|
40
|
+
- `openfairygui://backend/session/{sessionId}/outline`
|
|
36
41
|
- `openfairygui://backend/cache/{sessionId}`
|
|
37
42
|
- `openfairygui://backend/job/{sessionId}/{jobId}`
|
|
38
|
-
- prompts for capability inspection, session open/inspect, revision-checked transactions, save, and runtime polling
|
|
43
|
+
- prompts for capability inspection, session open/inspect, project-outline inspection, revision-checked transactions, save, and runtime polling
|
|
39
44
|
|
|
40
45
|
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.
|
|
46
|
+
The project outline is revision-bound and exposes package, resource, folder, display-node, controller-page, and transition identities for transaction planning. It intentionally omits source bytes and full property payloads. `validateSession` returns the backend-owned read-only project validation report; the MCP adapter does not reinterpret its diagnostics.
|
|
41
47
|
|
|
42
48
|
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
49
|
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_stdio = require("./stdio-
|
|
2
|
+
const require_stdio = require("./stdio-DsVFGCZw.cjs");
|
|
3
3
|
exports.OPENFAIRYGUI_BACKEND_CAPABILITIES_RESOURCE_URI = require_stdio.OPENFAIRYGUI_BACKEND_CAPABILITIES_RESOURCE_URI;
|
|
4
4
|
exports.OPENFAIRYGUI_BACKEND_PROMPT_DEFINITIONS = require_stdio.OPENFAIRYGUI_BACKEND_PROMPT_DEFINITIONS;
|
|
5
5
|
exports.OPENFAIRYGUI_BACKEND_PROMPT_NAMES = require_stdio.OPENFAIRYGUI_BACKEND_PROMPT_NAMES;
|
package/dist/index.d.cts
CHANGED
|
@@ -6,9 +6,9 @@ import { z } from "zod";
|
|
|
6
6
|
|
|
7
7
|
//#region src/tool-definitions.d.ts
|
|
8
8
|
declare const OPENFAIRYGUI_BACKEND_TOOL_PREFIX = "openfairygui_backend_";
|
|
9
|
-
declare const OPENFAIRYGUI_BACKEND_TOOL_NAMES: readonly ["openfairygui_backend_get_capabilities", "openfairygui_backend_open_session", "openfairygui_backend_open_project_session", "openfairygui_backend_get_session", "openfairygui_backend_apply_transaction", "openfairygui_backend_save_session", "openfairygui_backend_materialize_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"];
|
|
9
|
+
declare const OPENFAIRYGUI_BACKEND_TOOL_NAMES: readonly ["openfairygui_backend_get_capabilities", "openfairygui_backend_open_session", "openfairygui_backend_open_project_session", "openfairygui_backend_get_session", "openfairygui_backend_get_project_outline", "openfairygui_backend_validate_session", "openfairygui_backend_apply_transaction", "openfairygui_backend_save_session", "openfairygui_backend_materialize_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"];
|
|
10
10
|
type OpenFairyGuiBackendToolName = typeof OPENFAIRYGUI_BACKEND_TOOL_NAMES[number];
|
|
11
|
-
type BackendMethodName = 'getCapabilities' | 'openSession' | 'openProjectSession' | 'getSession' | 'applyTransaction' | 'saveSession' | 'materializeSession' | 'closeSession' | 'getEvents' | 'getJob' | 'listJobs' | 'cancelJob' | 'getCacheSnapshot' | 'refreshCache';
|
|
11
|
+
type BackendMethodName = 'getCapabilities' | 'openSession' | 'openProjectSession' | 'getSession' | 'getProjectOutline' | 'validateSession' | 'applyTransaction' | 'saveSession' | 'materializeSession' | 'closeSession' | 'getEvents' | 'getJob' | 'listJobs' | 'cancelJob' | 'getCacheSnapshot' | 'refreshCache';
|
|
12
12
|
interface OpenFairyGuiBackendToolDefinition {
|
|
13
13
|
name: OpenFairyGuiBackendToolName;
|
|
14
14
|
backendMethod: BackendMethodName;
|
|
@@ -116,6 +116,48 @@ declare const OPENFAIRYGUI_BACKEND_TOOL_DEFINITIONS: readonly [{
|
|
|
116
116
|
readonly idempotentHint: true;
|
|
117
117
|
readonly openWorldHint: false;
|
|
118
118
|
};
|
|
119
|
+
}, {
|
|
120
|
+
readonly name: "openfairygui_backend_get_project_outline";
|
|
121
|
+
readonly backendMethod: "getProjectOutline";
|
|
122
|
+
readonly title: "Get Project Outline";
|
|
123
|
+
readonly description: "Return a revision-bound project/package/resource/component identity outline without source bytes or full property payloads.";
|
|
124
|
+
readonly inputSchema: z.ZodObject<{
|
|
125
|
+
sessionId: z.ZodString;
|
|
126
|
+
}, z.core.$strip>;
|
|
127
|
+
readonly outputSchema: z.ZodObject<{
|
|
128
|
+
backendResult: z.ZodObject<{
|
|
129
|
+
ok: z.ZodBoolean;
|
|
130
|
+
data: z.ZodOptional<z.ZodUnknown>;
|
|
131
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
132
|
+
meta: z.ZodOptional<z.ZodUnknown>;
|
|
133
|
+
}, z.core.$loose>;
|
|
134
|
+
}, z.core.$strip>;
|
|
135
|
+
readonly annotations: {
|
|
136
|
+
readonly readOnlyHint: true;
|
|
137
|
+
readonly idempotentHint: true;
|
|
138
|
+
readonly openWorldHint: false;
|
|
139
|
+
};
|
|
140
|
+
}, {
|
|
141
|
+
readonly name: "openfairygui_backend_validate_session";
|
|
142
|
+
readonly backendMethod: "validateSession";
|
|
143
|
+
readonly title: "Validate Project Session";
|
|
144
|
+
readonly description: "Validate the current session project structure, references, paths, and available source bytes without writing files.";
|
|
145
|
+
readonly inputSchema: z.ZodObject<{
|
|
146
|
+
sessionId: z.ZodString;
|
|
147
|
+
}, z.core.$strip>;
|
|
148
|
+
readonly outputSchema: z.ZodObject<{
|
|
149
|
+
backendResult: z.ZodObject<{
|
|
150
|
+
ok: z.ZodBoolean;
|
|
151
|
+
data: z.ZodOptional<z.ZodUnknown>;
|
|
152
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
153
|
+
meta: z.ZodOptional<z.ZodUnknown>;
|
|
154
|
+
}, z.core.$loose>;
|
|
155
|
+
}, z.core.$strip>;
|
|
156
|
+
readonly annotations: {
|
|
157
|
+
readonly readOnlyHint: true;
|
|
158
|
+
readonly idempotentHint: true;
|
|
159
|
+
readonly openWorldHint: false;
|
|
160
|
+
};
|
|
119
161
|
}, {
|
|
120
162
|
readonly name: "openfairygui_backend_apply_transaction";
|
|
121
163
|
readonly backendMethod: "applyTransaction";
|
|
@@ -361,7 +403,7 @@ declare const OPENFAIRYGUI_BACKEND_TOOL_DEFINITIONS: readonly [{
|
|
|
361
403
|
}];
|
|
362
404
|
//#endregion
|
|
363
405
|
//#region src/tool-handler.d.ts
|
|
364
|
-
type OpenFairyGuiBackendRuntime = Pick<BackendRuntime, 'getCapabilities' | 'openSession' | 'openProjectSession' | 'getSession' | 'applyTransaction' | 'saveSession' | 'materializeSession' | 'closeSession' | 'getEvents' | 'getJob' | 'listJobs' | 'cancelJob' | 'getCacheSnapshot' | 'refreshCache'>;
|
|
406
|
+
type OpenFairyGuiBackendRuntime = Pick<BackendRuntime, 'getCapabilities' | 'openSession' | 'openProjectSession' | 'getSession' | 'getProjectOutline' | 'validateSession' | 'applyTransaction' | 'saveSession' | 'materializeSession' | 'closeSession' | 'getEvents' | 'getJob' | 'listJobs' | 'cancelJob' | 'getCacheSnapshot' | 'refreshCache'>;
|
|
365
407
|
declare function callOpenFairyGuiBackendTool(runtime: OpenFairyGuiBackendRuntime, name: OpenFairyGuiBackendToolName, input: Record<string, unknown>): Promise<CallToolResult>;
|
|
366
408
|
//#endregion
|
|
367
409
|
//#region src/server.d.ts
|
|
@@ -373,7 +415,7 @@ interface CreateOpenFairyGuiMcpServerOptions {
|
|
|
373
415
|
declare function createOpenFairyGuiMcpServer(options?: CreateOpenFairyGuiMcpServerOptions): McpServer;
|
|
374
416
|
//#endregion
|
|
375
417
|
//#region src/prompt-definitions.d.ts
|
|
376
|
-
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"];
|
|
418
|
+
declare const OPENFAIRYGUI_BACKEND_PROMPT_NAMES: readonly ["openfairygui_inspect_capabilities", "openfairygui_open_and_inspect_session", "openfairygui_inspect_project_outline", "openfairygui_plan_revision_checked_transaction", "openfairygui_save_session", "openfairygui_poll_runtime_state"];
|
|
377
419
|
type OpenFairyGuiBackendPromptName = typeof OPENFAIRYGUI_BACKEND_PROMPT_NAMES[number];
|
|
378
420
|
declare const OPENFAIRYGUI_BACKEND_PROMPT_DEFINITIONS: readonly [{
|
|
379
421
|
readonly name: "openfairygui_inspect_capabilities";
|
|
@@ -385,6 +427,11 @@ declare const OPENFAIRYGUI_BACKEND_PROMPT_DEFINITIONS: readonly [{
|
|
|
385
427
|
readonly title: "Open and Inspect an OpenFairyGUI Session";
|
|
386
428
|
readonly description: "Guide a client through opening and reading a backend session.";
|
|
387
429
|
readonly text: string;
|
|
430
|
+
}, {
|
|
431
|
+
readonly name: "openfairygui_inspect_project_outline";
|
|
432
|
+
readonly title: "Inspect an OpenFairyGUI Project Outline";
|
|
433
|
+
readonly description: "Guide a client through selector discovery before a revision-checked transaction.";
|
|
434
|
+
readonly text: string;
|
|
388
435
|
}, {
|
|
389
436
|
readonly name: "openfairygui_plan_revision_checked_transaction";
|
|
390
437
|
readonly title: "Plan a Revision-Checked OpenFairyGUI Transaction";
|
|
@@ -404,6 +451,6 @@ declare const OPENFAIRYGUI_BACKEND_PROMPT_DEFINITIONS: readonly [{
|
|
|
404
451
|
//#endregion
|
|
405
452
|
//#region src/resource-definitions.d.ts
|
|
406
453
|
declare const OPENFAIRYGUI_BACKEND_CAPABILITIES_RESOURCE_URI = "openfairygui://backend/capabilities";
|
|
407
|
-
declare const OPENFAIRYGUI_BACKEND_RESOURCE_TEMPLATES: readonly ["openfairygui://backend/session/{sessionId}", "openfairygui://backend/cache/{sessionId}", "openfairygui://backend/job/{sessionId}/{jobId}"];
|
|
454
|
+
declare const OPENFAIRYGUI_BACKEND_RESOURCE_TEMPLATES: readonly ["openfairygui://backend/session/{sessionId}", "openfairygui://backend/session/{sessionId}/outline", "openfairygui://backend/cache/{sessionId}", "openfairygui://backend/job/{sessionId}/{jobId}"];
|
|
408
455
|
//#endregion
|
|
409
456
|
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 OpenFairyGuiBackendRuntime, type OpenFairyGuiBackendToolDefinition, type OpenFairyGuiBackendToolName, callOpenFairyGuiBackendTool, connectOpenFairyGuiMcpStdio, createOpenFairyGuiMcpServer };
|
package/dist/index.d.mts
CHANGED
|
@@ -6,9 +6,9 @@ import { BackendRuntime } from "@openfairygui/backend";
|
|
|
6
6
|
|
|
7
7
|
//#region src/tool-definitions.d.ts
|
|
8
8
|
declare const OPENFAIRYGUI_BACKEND_TOOL_PREFIX = "openfairygui_backend_";
|
|
9
|
-
declare const OPENFAIRYGUI_BACKEND_TOOL_NAMES: readonly ["openfairygui_backend_get_capabilities", "openfairygui_backend_open_session", "openfairygui_backend_open_project_session", "openfairygui_backend_get_session", "openfairygui_backend_apply_transaction", "openfairygui_backend_save_session", "openfairygui_backend_materialize_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"];
|
|
9
|
+
declare const OPENFAIRYGUI_BACKEND_TOOL_NAMES: readonly ["openfairygui_backend_get_capabilities", "openfairygui_backend_open_session", "openfairygui_backend_open_project_session", "openfairygui_backend_get_session", "openfairygui_backend_get_project_outline", "openfairygui_backend_validate_session", "openfairygui_backend_apply_transaction", "openfairygui_backend_save_session", "openfairygui_backend_materialize_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"];
|
|
10
10
|
type OpenFairyGuiBackendToolName = typeof OPENFAIRYGUI_BACKEND_TOOL_NAMES[number];
|
|
11
|
-
type BackendMethodName = 'getCapabilities' | 'openSession' | 'openProjectSession' | 'getSession' | 'applyTransaction' | 'saveSession' | 'materializeSession' | 'closeSession' | 'getEvents' | 'getJob' | 'listJobs' | 'cancelJob' | 'getCacheSnapshot' | 'refreshCache';
|
|
11
|
+
type BackendMethodName = 'getCapabilities' | 'openSession' | 'openProjectSession' | 'getSession' | 'getProjectOutline' | 'validateSession' | 'applyTransaction' | 'saveSession' | 'materializeSession' | 'closeSession' | 'getEvents' | 'getJob' | 'listJobs' | 'cancelJob' | 'getCacheSnapshot' | 'refreshCache';
|
|
12
12
|
interface OpenFairyGuiBackendToolDefinition {
|
|
13
13
|
name: OpenFairyGuiBackendToolName;
|
|
14
14
|
backendMethod: BackendMethodName;
|
|
@@ -116,6 +116,48 @@ declare const OPENFAIRYGUI_BACKEND_TOOL_DEFINITIONS: readonly [{
|
|
|
116
116
|
readonly idempotentHint: true;
|
|
117
117
|
readonly openWorldHint: false;
|
|
118
118
|
};
|
|
119
|
+
}, {
|
|
120
|
+
readonly name: "openfairygui_backend_get_project_outline";
|
|
121
|
+
readonly backendMethod: "getProjectOutline";
|
|
122
|
+
readonly title: "Get Project Outline";
|
|
123
|
+
readonly description: "Return a revision-bound project/package/resource/component identity outline without source bytes or full property payloads.";
|
|
124
|
+
readonly inputSchema: z.ZodObject<{
|
|
125
|
+
sessionId: z.ZodString;
|
|
126
|
+
}, z.core.$strip>;
|
|
127
|
+
readonly outputSchema: z.ZodObject<{
|
|
128
|
+
backendResult: z.ZodObject<{
|
|
129
|
+
ok: z.ZodBoolean;
|
|
130
|
+
data: z.ZodOptional<z.ZodUnknown>;
|
|
131
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
132
|
+
meta: z.ZodOptional<z.ZodUnknown>;
|
|
133
|
+
}, z.core.$loose>;
|
|
134
|
+
}, z.core.$strip>;
|
|
135
|
+
readonly annotations: {
|
|
136
|
+
readonly readOnlyHint: true;
|
|
137
|
+
readonly idempotentHint: true;
|
|
138
|
+
readonly openWorldHint: false;
|
|
139
|
+
};
|
|
140
|
+
}, {
|
|
141
|
+
readonly name: "openfairygui_backend_validate_session";
|
|
142
|
+
readonly backendMethod: "validateSession";
|
|
143
|
+
readonly title: "Validate Project Session";
|
|
144
|
+
readonly description: "Validate the current session project structure, references, paths, and available source bytes without writing files.";
|
|
145
|
+
readonly inputSchema: z.ZodObject<{
|
|
146
|
+
sessionId: z.ZodString;
|
|
147
|
+
}, z.core.$strip>;
|
|
148
|
+
readonly outputSchema: z.ZodObject<{
|
|
149
|
+
backendResult: z.ZodObject<{
|
|
150
|
+
ok: z.ZodBoolean;
|
|
151
|
+
data: z.ZodOptional<z.ZodUnknown>;
|
|
152
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
153
|
+
meta: z.ZodOptional<z.ZodUnknown>;
|
|
154
|
+
}, z.core.$loose>;
|
|
155
|
+
}, z.core.$strip>;
|
|
156
|
+
readonly annotations: {
|
|
157
|
+
readonly readOnlyHint: true;
|
|
158
|
+
readonly idempotentHint: true;
|
|
159
|
+
readonly openWorldHint: false;
|
|
160
|
+
};
|
|
119
161
|
}, {
|
|
120
162
|
readonly name: "openfairygui_backend_apply_transaction";
|
|
121
163
|
readonly backendMethod: "applyTransaction";
|
|
@@ -361,7 +403,7 @@ declare const OPENFAIRYGUI_BACKEND_TOOL_DEFINITIONS: readonly [{
|
|
|
361
403
|
}];
|
|
362
404
|
//#endregion
|
|
363
405
|
//#region src/tool-handler.d.ts
|
|
364
|
-
type OpenFairyGuiBackendRuntime = Pick<BackendRuntime, 'getCapabilities' | 'openSession' | 'openProjectSession' | 'getSession' | 'applyTransaction' | 'saveSession' | 'materializeSession' | 'closeSession' | 'getEvents' | 'getJob' | 'listJobs' | 'cancelJob' | 'getCacheSnapshot' | 'refreshCache'>;
|
|
406
|
+
type OpenFairyGuiBackendRuntime = Pick<BackendRuntime, 'getCapabilities' | 'openSession' | 'openProjectSession' | 'getSession' | 'getProjectOutline' | 'validateSession' | 'applyTransaction' | 'saveSession' | 'materializeSession' | 'closeSession' | 'getEvents' | 'getJob' | 'listJobs' | 'cancelJob' | 'getCacheSnapshot' | 'refreshCache'>;
|
|
365
407
|
declare function callOpenFairyGuiBackendTool(runtime: OpenFairyGuiBackendRuntime, name: OpenFairyGuiBackendToolName, input: Record<string, unknown>): Promise<CallToolResult>;
|
|
366
408
|
//#endregion
|
|
367
409
|
//#region src/server.d.ts
|
|
@@ -373,7 +415,7 @@ interface CreateOpenFairyGuiMcpServerOptions {
|
|
|
373
415
|
declare function createOpenFairyGuiMcpServer(options?: CreateOpenFairyGuiMcpServerOptions): McpServer;
|
|
374
416
|
//#endregion
|
|
375
417
|
//#region src/prompt-definitions.d.ts
|
|
376
|
-
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"];
|
|
418
|
+
declare const OPENFAIRYGUI_BACKEND_PROMPT_NAMES: readonly ["openfairygui_inspect_capabilities", "openfairygui_open_and_inspect_session", "openfairygui_inspect_project_outline", "openfairygui_plan_revision_checked_transaction", "openfairygui_save_session", "openfairygui_poll_runtime_state"];
|
|
377
419
|
type OpenFairyGuiBackendPromptName = typeof OPENFAIRYGUI_BACKEND_PROMPT_NAMES[number];
|
|
378
420
|
declare const OPENFAIRYGUI_BACKEND_PROMPT_DEFINITIONS: readonly [{
|
|
379
421
|
readonly name: "openfairygui_inspect_capabilities";
|
|
@@ -385,6 +427,11 @@ declare const OPENFAIRYGUI_BACKEND_PROMPT_DEFINITIONS: readonly [{
|
|
|
385
427
|
readonly title: "Open and Inspect an OpenFairyGUI Session";
|
|
386
428
|
readonly description: "Guide a client through opening and reading a backend session.";
|
|
387
429
|
readonly text: string;
|
|
430
|
+
}, {
|
|
431
|
+
readonly name: "openfairygui_inspect_project_outline";
|
|
432
|
+
readonly title: "Inspect an OpenFairyGUI Project Outline";
|
|
433
|
+
readonly description: "Guide a client through selector discovery before a revision-checked transaction.";
|
|
434
|
+
readonly text: string;
|
|
388
435
|
}, {
|
|
389
436
|
readonly name: "openfairygui_plan_revision_checked_transaction";
|
|
390
437
|
readonly title: "Plan a Revision-Checked OpenFairyGUI Transaction";
|
|
@@ -404,6 +451,6 @@ declare const OPENFAIRYGUI_BACKEND_PROMPT_DEFINITIONS: readonly [{
|
|
|
404
451
|
//#endregion
|
|
405
452
|
//#region src/resource-definitions.d.ts
|
|
406
453
|
declare const OPENFAIRYGUI_BACKEND_CAPABILITIES_RESOURCE_URI = "openfairygui://backend/capabilities";
|
|
407
|
-
declare const OPENFAIRYGUI_BACKEND_RESOURCE_TEMPLATES: readonly ["openfairygui://backend/session/{sessionId}", "openfairygui://backend/cache/{sessionId}", "openfairygui://backend/job/{sessionId}/{jobId}"];
|
|
454
|
+
declare const OPENFAIRYGUI_BACKEND_RESOURCE_TEMPLATES: readonly ["openfairygui://backend/session/{sessionId}", "openfairygui://backend/session/{sessionId}/outline", "openfairygui://backend/cache/{sessionId}", "openfairygui://backend/job/{sessionId}/{jobId}"];
|
|
408
455
|
//#endregion
|
|
409
456
|
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 OpenFairyGuiBackendRuntime, type OpenFairyGuiBackendToolDefinition, type OpenFairyGuiBackendToolName, callOpenFairyGuiBackendTool, connectOpenFairyGuiMcpStdio, createOpenFairyGuiMcpServer };
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as OPENFAIRYGUI_BACKEND_TOOL_OUTPUT_SCHEMA, c as OPENFAIRYGUI_BACKEND_CAPABILITIES_RESOURCE_URI, d as OPENFAIRYGUI_BACKEND_PROMPT_NAMES, i as OPENFAIRYGUI_BACKEND_TOOL_NAMES, l as OPENFAIRYGUI_BACKEND_RESOURCE_TEMPLATES, n as createOpenFairyGuiMcpServer, o as OPENFAIRYGUI_BACKEND_TOOL_PREFIX, r as OPENFAIRYGUI_BACKEND_TOOL_DEFINITIONS, s as callOpenFairyGuiBackendTool, t as connectOpenFairyGuiMcpStdio, u as OPENFAIRYGUI_BACKEND_PROMPT_DEFINITIONS } from "./stdio-
|
|
1
|
+
import { a as OPENFAIRYGUI_BACKEND_TOOL_OUTPUT_SCHEMA, c as OPENFAIRYGUI_BACKEND_CAPABILITIES_RESOURCE_URI, d as OPENFAIRYGUI_BACKEND_PROMPT_NAMES, i as OPENFAIRYGUI_BACKEND_TOOL_NAMES, l as OPENFAIRYGUI_BACKEND_RESOURCE_TEMPLATES, n as createOpenFairyGuiMcpServer, o as OPENFAIRYGUI_BACKEND_TOOL_PREFIX, r as OPENFAIRYGUI_BACKEND_TOOL_DEFINITIONS, s as callOpenFairyGuiBackendTool, t as connectOpenFairyGuiMcpStdio, u as OPENFAIRYGUI_BACKEND_PROMPT_DEFINITIONS } from "./stdio-nxePbIRB.mjs";
|
|
2
2
|
export { 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, callOpenFairyGuiBackendTool, connectOpenFairyGuiMcpStdio, createOpenFairyGuiMcpServer };
|
|
@@ -8,6 +8,7 @@ let node_url = require("node:url");
|
|
|
8
8
|
const OPENFAIRYGUI_BACKEND_PROMPT_NAMES = [
|
|
9
9
|
"openfairygui_inspect_capabilities",
|
|
10
10
|
"openfairygui_open_and_inspect_session",
|
|
11
|
+
"openfairygui_inspect_project_outline",
|
|
11
12
|
"openfairygui_plan_revision_checked_transaction",
|
|
12
13
|
"openfairygui_save_session",
|
|
13
14
|
"openfairygui_poll_runtime_state"
|
|
@@ -33,6 +34,17 @@ const OPENFAIRYGUI_BACKEND_PROMPT_DEFINITIONS = [
|
|
|
33
34
|
"Close the session with openfairygui_backend_close_session when finished."
|
|
34
35
|
].join("\n")
|
|
35
36
|
},
|
|
37
|
+
{
|
|
38
|
+
name: "openfairygui_inspect_project_outline",
|
|
39
|
+
title: "Inspect an OpenFairyGUI Project Outline",
|
|
40
|
+
description: "Guide a client through selector discovery before a revision-checked transaction.",
|
|
41
|
+
text: [
|
|
42
|
+
"Use openfairygui_backend_get_project_outline with the active sessionId before planning mutations.",
|
|
43
|
+
"Use package, resource, folder, display node, controller page, and transition identities from the returned outline.",
|
|
44
|
+
"Pass the returned revision as expectedRevision when calling openfairygui_backend_apply_transaction.",
|
|
45
|
+
"Read a new outline if the backend reports a stale revision; the outline intentionally excludes source bytes and full property payloads."
|
|
46
|
+
].join("\n")
|
|
47
|
+
},
|
|
36
48
|
{
|
|
37
49
|
name: "openfairygui_plan_revision_checked_transaction",
|
|
38
50
|
title: "Plan a Revision-Checked OpenFairyGUI Transaction",
|
|
@@ -97,6 +109,7 @@ function jsonResource(uri, backendResult) {
|
|
|
97
109
|
const OPENFAIRYGUI_BACKEND_CAPABILITIES_RESOURCE_URI = "openfairygui://backend/capabilities";
|
|
98
110
|
const OPENFAIRYGUI_BACKEND_RESOURCE_TEMPLATES = [
|
|
99
111
|
"openfairygui://backend/session/{sessionId}",
|
|
112
|
+
"openfairygui://backend/session/{sessionId}/outline",
|
|
100
113
|
"openfairygui://backend/cache/{sessionId}",
|
|
101
114
|
"openfairygui://backend/job/{sessionId}/{jobId}"
|
|
102
115
|
];
|
|
@@ -111,6 +124,11 @@ function registerOpenFairyGuiBackendResources(server, runtime) {
|
|
|
111
124
|
description: "Read a backend session envelope by backend-local session id.",
|
|
112
125
|
mimeType: JSON_MIME_TYPE
|
|
113
126
|
}, (uri, variables) => jsonResource(uri, runtime.getSession({ sessionId: firstVariable(variables.sessionId) })));
|
|
127
|
+
server.registerResource("openfairygui_backend_project_outline", new _modelcontextprotocol_sdk_server_mcp_js.ResourceTemplate("openfairygui://backend/session/{sessionId}/outline", { list: void 0 }), {
|
|
128
|
+
title: "OpenFairyGUI Project Outline",
|
|
129
|
+
description: "Read a revision-bound project identity outline without source bytes or full property payloads.",
|
|
130
|
+
mimeType: JSON_MIME_TYPE
|
|
131
|
+
}, (uri, variables) => jsonResource(uri, runtime.getProjectOutline({ sessionId: firstVariable(variables.sessionId) })));
|
|
114
132
|
server.registerResource("openfairygui_backend_cache", new _modelcontextprotocol_sdk_server_mcp_js.ResourceTemplate("openfairygui://backend/cache/{sessionId}", { list: void 0 }), {
|
|
115
133
|
title: "OpenFairyGUI Backend Cache Snapshot",
|
|
116
134
|
description: "Read a derived backend cache envelope by backend-local session id.",
|
|
@@ -160,6 +178,12 @@ async function callOpenFairyGuiBackendTool(runtime, name, input) {
|
|
|
160
178
|
case "openfairygui_backend_get_session":
|
|
161
179
|
result = runtime.getSession({ sessionId: String(input.sessionId) });
|
|
162
180
|
break;
|
|
181
|
+
case "openfairygui_backend_get_project_outline":
|
|
182
|
+
result = runtime.getProjectOutline({ sessionId: String(input.sessionId) });
|
|
183
|
+
break;
|
|
184
|
+
case "openfairygui_backend_validate_session":
|
|
185
|
+
result = runtime.validateSession({ sessionId: String(input.sessionId) });
|
|
186
|
+
break;
|
|
163
187
|
case "openfairygui_backend_apply_transaction":
|
|
164
188
|
result = await runtime.applyTransaction({
|
|
165
189
|
sessionId: String(input.sessionId),
|
|
@@ -235,6 +259,8 @@ const OPENFAIRYGUI_BACKEND_TOOL_NAMES = [
|
|
|
235
259
|
"openfairygui_backend_open_session",
|
|
236
260
|
"openfairygui_backend_open_project_session",
|
|
237
261
|
"openfairygui_backend_get_session",
|
|
262
|
+
"openfairygui_backend_get_project_outline",
|
|
263
|
+
"openfairygui_backend_validate_session",
|
|
238
264
|
"openfairygui_backend_apply_transaction",
|
|
239
265
|
"openfairygui_backend_save_session",
|
|
240
266
|
"openfairygui_backend_materialize_session",
|
|
@@ -314,6 +340,32 @@ const OPENFAIRYGUI_BACKEND_TOOL_DEFINITIONS = [
|
|
|
314
340
|
openWorldHint: false
|
|
315
341
|
}
|
|
316
342
|
},
|
|
343
|
+
{
|
|
344
|
+
name: "openfairygui_backend_get_project_outline",
|
|
345
|
+
backendMethod: "getProjectOutline",
|
|
346
|
+
title: "Get Project Outline",
|
|
347
|
+
description: "Return a revision-bound project/package/resource/component identity outline without source bytes or full property payloads.",
|
|
348
|
+
inputSchema: zod.z.object({ sessionId }),
|
|
349
|
+
outputSchema: OPENFAIRYGUI_BACKEND_TOOL_OUTPUT_SCHEMA,
|
|
350
|
+
annotations: {
|
|
351
|
+
readOnlyHint: true,
|
|
352
|
+
idempotentHint: true,
|
|
353
|
+
openWorldHint: false
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
name: "openfairygui_backend_validate_session",
|
|
358
|
+
backendMethod: "validateSession",
|
|
359
|
+
title: "Validate Project Session",
|
|
360
|
+
description: "Validate the current session project structure, references, paths, and available source bytes without writing files.",
|
|
361
|
+
inputSchema: zod.z.object({ sessionId }),
|
|
362
|
+
outputSchema: OPENFAIRYGUI_BACKEND_TOOL_OUTPUT_SCHEMA,
|
|
363
|
+
annotations: {
|
|
364
|
+
readOnlyHint: true,
|
|
365
|
+
idempotentHint: true,
|
|
366
|
+
openWorldHint: false
|
|
367
|
+
}
|
|
368
|
+
},
|
|
317
369
|
{
|
|
318
370
|
name: "openfairygui_backend_apply_transaction",
|
|
319
371
|
backendMethod: "applyTransaction",
|
|
@@ -497,7 +549,7 @@ const OPENFAIRYGUI_BACKEND_TOOL_DEFINITIONS = [
|
|
|
497
549
|
//#region src/server.ts
|
|
498
550
|
const require$1 = (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href);
|
|
499
551
|
function getInjectedPackageVersion() {
|
|
500
|
-
const version = "0.
|
|
552
|
+
const version = "0.3.0-alpha.2";
|
|
501
553
|
return typeof version === "string" && true ? version : null;
|
|
502
554
|
}
|
|
503
555
|
function readPackageVersion() {
|
|
@@ -8,6 +8,7 @@ import { pathToFileURL } from "node:url";
|
|
|
8
8
|
const OPENFAIRYGUI_BACKEND_PROMPT_NAMES = [
|
|
9
9
|
"openfairygui_inspect_capabilities",
|
|
10
10
|
"openfairygui_open_and_inspect_session",
|
|
11
|
+
"openfairygui_inspect_project_outline",
|
|
11
12
|
"openfairygui_plan_revision_checked_transaction",
|
|
12
13
|
"openfairygui_save_session",
|
|
13
14
|
"openfairygui_poll_runtime_state"
|
|
@@ -33,6 +34,17 @@ const OPENFAIRYGUI_BACKEND_PROMPT_DEFINITIONS = [
|
|
|
33
34
|
"Close the session with openfairygui_backend_close_session when finished."
|
|
34
35
|
].join("\n")
|
|
35
36
|
},
|
|
37
|
+
{
|
|
38
|
+
name: "openfairygui_inspect_project_outline",
|
|
39
|
+
title: "Inspect an OpenFairyGUI Project Outline",
|
|
40
|
+
description: "Guide a client through selector discovery before a revision-checked transaction.",
|
|
41
|
+
text: [
|
|
42
|
+
"Use openfairygui_backend_get_project_outline with the active sessionId before planning mutations.",
|
|
43
|
+
"Use package, resource, folder, display node, controller page, and transition identities from the returned outline.",
|
|
44
|
+
"Pass the returned revision as expectedRevision when calling openfairygui_backend_apply_transaction.",
|
|
45
|
+
"Read a new outline if the backend reports a stale revision; the outline intentionally excludes source bytes and full property payloads."
|
|
46
|
+
].join("\n")
|
|
47
|
+
},
|
|
36
48
|
{
|
|
37
49
|
name: "openfairygui_plan_revision_checked_transaction",
|
|
38
50
|
title: "Plan a Revision-Checked OpenFairyGUI Transaction",
|
|
@@ -97,6 +109,7 @@ function jsonResource(uri, backendResult) {
|
|
|
97
109
|
const OPENFAIRYGUI_BACKEND_CAPABILITIES_RESOURCE_URI = "openfairygui://backend/capabilities";
|
|
98
110
|
const OPENFAIRYGUI_BACKEND_RESOURCE_TEMPLATES = [
|
|
99
111
|
"openfairygui://backend/session/{sessionId}",
|
|
112
|
+
"openfairygui://backend/session/{sessionId}/outline",
|
|
100
113
|
"openfairygui://backend/cache/{sessionId}",
|
|
101
114
|
"openfairygui://backend/job/{sessionId}/{jobId}"
|
|
102
115
|
];
|
|
@@ -111,6 +124,11 @@ function registerOpenFairyGuiBackendResources(server, runtime) {
|
|
|
111
124
|
description: "Read a backend session envelope by backend-local session id.",
|
|
112
125
|
mimeType: JSON_MIME_TYPE
|
|
113
126
|
}, (uri, variables) => jsonResource(uri, runtime.getSession({ sessionId: firstVariable(variables.sessionId) })));
|
|
127
|
+
server.registerResource("openfairygui_backend_project_outline", new ResourceTemplate("openfairygui://backend/session/{sessionId}/outline", { list: void 0 }), {
|
|
128
|
+
title: "OpenFairyGUI Project Outline",
|
|
129
|
+
description: "Read a revision-bound project identity outline without source bytes or full property payloads.",
|
|
130
|
+
mimeType: JSON_MIME_TYPE
|
|
131
|
+
}, (uri, variables) => jsonResource(uri, runtime.getProjectOutline({ sessionId: firstVariable(variables.sessionId) })));
|
|
114
132
|
server.registerResource("openfairygui_backend_cache", new ResourceTemplate("openfairygui://backend/cache/{sessionId}", { list: void 0 }), {
|
|
115
133
|
title: "OpenFairyGUI Backend Cache Snapshot",
|
|
116
134
|
description: "Read a derived backend cache envelope by backend-local session id.",
|
|
@@ -160,6 +178,12 @@ async function callOpenFairyGuiBackendTool(runtime, name, input) {
|
|
|
160
178
|
case "openfairygui_backend_get_session":
|
|
161
179
|
result = runtime.getSession({ sessionId: String(input.sessionId) });
|
|
162
180
|
break;
|
|
181
|
+
case "openfairygui_backend_get_project_outline":
|
|
182
|
+
result = runtime.getProjectOutline({ sessionId: String(input.sessionId) });
|
|
183
|
+
break;
|
|
184
|
+
case "openfairygui_backend_validate_session":
|
|
185
|
+
result = runtime.validateSession({ sessionId: String(input.sessionId) });
|
|
186
|
+
break;
|
|
163
187
|
case "openfairygui_backend_apply_transaction":
|
|
164
188
|
result = await runtime.applyTransaction({
|
|
165
189
|
sessionId: String(input.sessionId),
|
|
@@ -235,6 +259,8 @@ const OPENFAIRYGUI_BACKEND_TOOL_NAMES = [
|
|
|
235
259
|
"openfairygui_backend_open_session",
|
|
236
260
|
"openfairygui_backend_open_project_session",
|
|
237
261
|
"openfairygui_backend_get_session",
|
|
262
|
+
"openfairygui_backend_get_project_outline",
|
|
263
|
+
"openfairygui_backend_validate_session",
|
|
238
264
|
"openfairygui_backend_apply_transaction",
|
|
239
265
|
"openfairygui_backend_save_session",
|
|
240
266
|
"openfairygui_backend_materialize_session",
|
|
@@ -314,6 +340,32 @@ const OPENFAIRYGUI_BACKEND_TOOL_DEFINITIONS = [
|
|
|
314
340
|
openWorldHint: false
|
|
315
341
|
}
|
|
316
342
|
},
|
|
343
|
+
{
|
|
344
|
+
name: "openfairygui_backend_get_project_outline",
|
|
345
|
+
backendMethod: "getProjectOutline",
|
|
346
|
+
title: "Get Project Outline",
|
|
347
|
+
description: "Return a revision-bound project/package/resource/component identity outline without source bytes or full property payloads.",
|
|
348
|
+
inputSchema: z.object({ sessionId }),
|
|
349
|
+
outputSchema: OPENFAIRYGUI_BACKEND_TOOL_OUTPUT_SCHEMA,
|
|
350
|
+
annotations: {
|
|
351
|
+
readOnlyHint: true,
|
|
352
|
+
idempotentHint: true,
|
|
353
|
+
openWorldHint: false
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
name: "openfairygui_backend_validate_session",
|
|
358
|
+
backendMethod: "validateSession",
|
|
359
|
+
title: "Validate Project Session",
|
|
360
|
+
description: "Validate the current session project structure, references, paths, and available source bytes without writing files.",
|
|
361
|
+
inputSchema: z.object({ sessionId }),
|
|
362
|
+
outputSchema: OPENFAIRYGUI_BACKEND_TOOL_OUTPUT_SCHEMA,
|
|
363
|
+
annotations: {
|
|
364
|
+
readOnlyHint: true,
|
|
365
|
+
idempotentHint: true,
|
|
366
|
+
openWorldHint: false
|
|
367
|
+
}
|
|
368
|
+
},
|
|
317
369
|
{
|
|
318
370
|
name: "openfairygui_backend_apply_transaction",
|
|
319
371
|
backendMethod: "applyTransaction",
|
|
@@ -497,7 +549,7 @@ const OPENFAIRYGUI_BACKEND_TOOL_DEFINITIONS = [
|
|
|
497
549
|
//#region src/server.ts
|
|
498
550
|
const require = createRequire(import.meta.url);
|
|
499
551
|
function getInjectedPackageVersion() {
|
|
500
|
-
const version = "0.
|
|
552
|
+
const version = "0.3.0-alpha.2";
|
|
501
553
|
return typeof version === "string" && true ? version : null;
|
|
502
554
|
}
|
|
503
555
|
function readPackageVersion() {
|
package/dist/stdio.cjs
CHANGED
package/dist/stdio.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as connectOpenFairyGuiMcpStdio } from "./stdio-
|
|
1
|
+
import { t as connectOpenFairyGuiMcpStdio } from "./stdio-nxePbIRB.mjs";
|
|
2
2
|
export { connectOpenFairyGuiMcpStdio };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfairygui/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0-alpha.2",
|
|
4
4
|
"description": "FairyGUI Headless Authoring SDK - MCP server adapter for the backend runtime.",
|
|
5
5
|
"author": "OpenFairyGUI Contributors",
|
|
6
6
|
"license": "MIT",
|
|
@@ -58,13 +58,13 @@
|
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
60
60
|
"zod": "^4.3.6",
|
|
61
|
-
"@openfairygui/backend": "0.
|
|
61
|
+
"@openfairygui/backend": "0.3.0-alpha.2"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"ava": "^7.0.0",
|
|
65
65
|
"tsx": "^4.0.0",
|
|
66
|
-
"@openfairygui/
|
|
67
|
-
"@openfairygui/
|
|
66
|
+
"@openfairygui/core": "0.3.0-alpha.2",
|
|
67
|
+
"@openfairygui/test-utils": "0.2.0-alpha.10"
|
|
68
68
|
},
|
|
69
69
|
"ava": {
|
|
70
70
|
"extensions": {
|
|
@@ -3,6 +3,7 @@ import type { GetPromptResult } from '@modelcontextprotocol/sdk/types.js';
|
|
|
3
3
|
export const OPENFAIRYGUI_BACKEND_PROMPT_NAMES = [
|
|
4
4
|
'openfairygui_inspect_capabilities',
|
|
5
5
|
'openfairygui_open_and_inspect_session',
|
|
6
|
+
'openfairygui_inspect_project_outline',
|
|
6
7
|
'openfairygui_plan_revision_checked_transaction',
|
|
7
8
|
'openfairygui_save_session',
|
|
8
9
|
'openfairygui_poll_runtime_state',
|
|
@@ -38,6 +39,17 @@ export const OPENFAIRYGUI_BACKEND_PROMPT_DEFINITIONS = [
|
|
|
38
39
|
'Close the session with openfairygui_backend_close_session when finished.',
|
|
39
40
|
].join('\n'),
|
|
40
41
|
},
|
|
42
|
+
{
|
|
43
|
+
name: 'openfairygui_inspect_project_outline',
|
|
44
|
+
title: 'Inspect an OpenFairyGUI Project Outline',
|
|
45
|
+
description: 'Guide a client through selector discovery before a revision-checked transaction.',
|
|
46
|
+
text: [
|
|
47
|
+
'Use openfairygui_backend_get_project_outline with the active sessionId before planning mutations.',
|
|
48
|
+
'Use package, resource, folder, display node, controller page, and transition identities from the returned outline.',
|
|
49
|
+
'Pass the returned revision as expectedRevision when calling openfairygui_backend_apply_transaction.',
|
|
50
|
+
'Read a new outline if the backend reports a stale revision; the outline intentionally excludes source bytes and full property payloads.',
|
|
51
|
+
].join('\n'),
|
|
52
|
+
},
|
|
41
53
|
{
|
|
42
54
|
name: 'openfairygui_plan_revision_checked_transaction',
|
|
43
55
|
title: 'Plan a Revision-Checked OpenFairyGUI Transaction',
|
|
@@ -24,6 +24,7 @@ export const OPENFAIRYGUI_BACKEND_CAPABILITIES_RESOURCE_URI = 'openfairygui://ba
|
|
|
24
24
|
|
|
25
25
|
export const OPENFAIRYGUI_BACKEND_RESOURCE_TEMPLATES = [
|
|
26
26
|
'openfairygui://backend/session/{sessionId}',
|
|
27
|
+
'openfairygui://backend/session/{sessionId}/outline',
|
|
27
28
|
'openfairygui://backend/cache/{sessionId}',
|
|
28
29
|
'openfairygui://backend/job/{sessionId}/{jobId}',
|
|
29
30
|
] as const;
|
|
@@ -53,6 +54,19 @@ export function registerOpenFairyGuiBackendResources(server: McpServer, runtime:
|
|
|
53
54
|
})),
|
|
54
55
|
);
|
|
55
56
|
|
|
57
|
+
server.registerResource(
|
|
58
|
+
'openfairygui_backend_project_outline',
|
|
59
|
+
new ResourceTemplate('openfairygui://backend/session/{sessionId}/outline', { list: undefined }),
|
|
60
|
+
{
|
|
61
|
+
title: 'OpenFairyGUI Project Outline',
|
|
62
|
+
description: 'Read a revision-bound project identity outline without source bytes or full property payloads.',
|
|
63
|
+
mimeType: JSON_MIME_TYPE,
|
|
64
|
+
},
|
|
65
|
+
(uri: URL, variables) => jsonResource(uri, runtime.getProjectOutline({
|
|
66
|
+
sessionId: firstVariable(variables.sessionId),
|
|
67
|
+
})),
|
|
68
|
+
);
|
|
69
|
+
|
|
56
70
|
server.registerResource(
|
|
57
71
|
'openfairygui_backend_cache',
|
|
58
72
|
new ResourceTemplate('openfairygui://backend/cache/{sessionId}', { list: undefined }),
|
package/src/tool-definitions.ts
CHANGED
|
@@ -7,6 +7,8 @@ export const OPENFAIRYGUI_BACKEND_TOOL_NAMES = [
|
|
|
7
7
|
'openfairygui_backend_open_session',
|
|
8
8
|
'openfairygui_backend_open_project_session',
|
|
9
9
|
'openfairygui_backend_get_session',
|
|
10
|
+
'openfairygui_backend_get_project_outline',
|
|
11
|
+
'openfairygui_backend_validate_session',
|
|
10
12
|
'openfairygui_backend_apply_transaction',
|
|
11
13
|
'openfairygui_backend_save_session',
|
|
12
14
|
'openfairygui_backend_materialize_session',
|
|
@@ -26,6 +28,8 @@ export type BackendMethodName =
|
|
|
26
28
|
| 'openSession'
|
|
27
29
|
| 'openProjectSession'
|
|
28
30
|
| 'getSession'
|
|
31
|
+
| 'getProjectOutline'
|
|
32
|
+
| 'validateSession'
|
|
29
33
|
| 'applyTransaction'
|
|
30
34
|
| 'saveSession'
|
|
31
35
|
| 'materializeSession'
|
|
@@ -110,6 +114,24 @@ export const OPENFAIRYGUI_BACKEND_TOOL_DEFINITIONS = [
|
|
|
110
114
|
outputSchema: OPENFAIRYGUI_BACKEND_TOOL_OUTPUT_SCHEMA,
|
|
111
115
|
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: false },
|
|
112
116
|
},
|
|
117
|
+
{
|
|
118
|
+
name: 'openfairygui_backend_get_project_outline',
|
|
119
|
+
backendMethod: 'getProjectOutline',
|
|
120
|
+
title: 'Get Project Outline',
|
|
121
|
+
description: 'Return a revision-bound project/package/resource/component identity outline without source bytes or full property payloads.',
|
|
122
|
+
inputSchema: z.object({ sessionId }),
|
|
123
|
+
outputSchema: OPENFAIRYGUI_BACKEND_TOOL_OUTPUT_SCHEMA,
|
|
124
|
+
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: false },
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: 'openfairygui_backend_validate_session',
|
|
128
|
+
backendMethod: 'validateSession',
|
|
129
|
+
title: 'Validate Project Session',
|
|
130
|
+
description: 'Validate the current session project structure, references, paths, and available source bytes without writing files.',
|
|
131
|
+
inputSchema: z.object({ sessionId }),
|
|
132
|
+
outputSchema: OPENFAIRYGUI_BACKEND_TOOL_OUTPUT_SCHEMA,
|
|
133
|
+
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: false },
|
|
134
|
+
},
|
|
113
135
|
{
|
|
114
136
|
name: 'openfairygui_backend_apply_transaction',
|
|
115
137
|
backendMethod: 'applyTransaction',
|
package/src/tool-handler.ts
CHANGED
|
@@ -8,6 +8,8 @@ export type OpenFairyGuiBackendRuntime = Pick<
|
|
|
8
8
|
| 'openSession'
|
|
9
9
|
| 'openProjectSession'
|
|
10
10
|
| 'getSession'
|
|
11
|
+
| 'getProjectOutline'
|
|
12
|
+
| 'validateSession'
|
|
11
13
|
| 'applyTransaction'
|
|
12
14
|
| 'saveSession'
|
|
13
15
|
| 'materializeSession'
|
|
@@ -70,6 +72,16 @@ export async function callOpenFairyGuiBackendTool(
|
|
|
70
72
|
sessionId: String(input.sessionId),
|
|
71
73
|
});
|
|
72
74
|
break;
|
|
75
|
+
case 'openfairygui_backend_get_project_outline':
|
|
76
|
+
result = runtime.getProjectOutline({
|
|
77
|
+
sessionId: String(input.sessionId),
|
|
78
|
+
});
|
|
79
|
+
break;
|
|
80
|
+
case 'openfairygui_backend_validate_session':
|
|
81
|
+
result = runtime.validateSession({
|
|
82
|
+
sessionId: String(input.sessionId),
|
|
83
|
+
});
|
|
84
|
+
break;
|
|
73
85
|
case 'openfairygui_backend_apply_transaction':
|
|
74
86
|
result = await runtime.applyTransaction({
|
|
75
87
|
sessionId: String(input.sessionId),
|