@fabricorg/sdk-mcp 0.1.14 → 0.1.16
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/dist/index.cjs +7 -1
- package/dist/index.d.cts +106 -2
- package/dist/index.d.ts +105 -1
- package/dist/index.js +2 -2
- package/dist/src-DGnJhMpQ.js +3259 -0
- package/dist/src-DGnJhMpQ.js.map +1 -0
- package/dist/src-DhrJfSKo.cjs +3306 -0
- package/dist/src-DhrJfSKo.cjs.map +1 -0
- package/dist/stdio.cjs +1 -1
- package/dist/stdio.js +1 -1
- package/package.json +2 -2
- package/dist/src-Dvp0pFUZ.cjs +0 -164
- package/dist/src-Dvp0pFUZ.cjs.map +0 -1
- package/dist/src-OoM54hoY.js +0 -153
- package/dist/src-OoM54hoY.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_src = require("./src-
|
|
2
|
+
const require_src = require("./src-DhrJfSKo.cjs");
|
|
3
|
+
exports.FABRIC_BRAND = require_src.FABRIC_BRAND;
|
|
4
|
+
exports.FABRIC_MARK_DATA_URI = require_src.FABRIC_MARK_DATA_URI;
|
|
5
|
+
exports.FABRIC_MCP_APP_RESOURCES = require_src.FABRIC_MCP_APP_RESOURCES;
|
|
6
|
+
exports.buildFabricVisualizePayload = require_src.buildFabricVisualizePayload;
|
|
3
7
|
exports.createFabricMcpServer = require_src.createFabricMcpServer;
|
|
8
|
+
exports.readFabricMcpAppResource = require_src.readFabricMcpAppResource;
|
|
9
|
+
exports.withFabricApp = require_src.withFabricApp;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,106 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
//#region src/ui-kit/index.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Official Fabric 3-arc brand mark encoded as an inline SVG data URI
|
|
5
|
+
* in Fabric's warm bright-orange primary accent (`#bc3e0b`).
|
|
6
|
+
* Requires zero external network requests (`img-src data:` CSP-safe).
|
|
7
|
+
*/
|
|
8
|
+
export declare const FABRIC_MARK_DATA_URI: string;
|
|
9
|
+
interface KitAccent {
|
|
10
|
+
light?: string;
|
|
11
|
+
dark?: string;
|
|
12
|
+
tintLight?: string;
|
|
13
|
+
tintDark?: string;
|
|
14
|
+
inkLight?: string;
|
|
15
|
+
inkDark?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const FABRIC_BRAND: {
|
|
18
|
+
accent: Required<KitAccent>;
|
|
19
|
+
display: string;
|
|
20
|
+
mark: string;
|
|
21
|
+
};
|
|
22
|
+
interface FabricVisualizeResult {
|
|
23
|
+
title: string;
|
|
24
|
+
provenance: string;
|
|
25
|
+
document: unknown[];
|
|
26
|
+
surfaces: Array<{
|
|
27
|
+
surfaceId: string;
|
|
28
|
+
catalogId: string;
|
|
29
|
+
components: number;
|
|
30
|
+
}>;
|
|
31
|
+
errors: Array<{
|
|
32
|
+
code: string;
|
|
33
|
+
surfaceId: string;
|
|
34
|
+
path: string;
|
|
35
|
+
message: string;
|
|
36
|
+
}>;
|
|
37
|
+
sources: Array<{
|
|
38
|
+
title: string;
|
|
39
|
+
page: string;
|
|
40
|
+
url: string;
|
|
41
|
+
}>;
|
|
42
|
+
textSummary: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Validates an A2UI v0.9.1 document (JSONL string or JSON array of messages)
|
|
46
|
+
* against the Fabric A2UI catalog (`https://agents.fabric.pro/a2ui/v0.9/fabric_catalog.json`)
|
|
47
|
+
* and produces both the structured payload for `ui://fabric/visualize` and a complete
|
|
48
|
+
* text fallback for non-App MCP clients.
|
|
49
|
+
*/
|
|
50
|
+
export declare function buildFabricVisualizePayload(args: {
|
|
51
|
+
document?: unknown;
|
|
52
|
+
title?: unknown;
|
|
53
|
+
sources?: unknown;
|
|
54
|
+
}): FabricVisualizeResult;
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region src/mcp-apps.d.ts
|
|
57
|
+
interface FabricMcpAppResourceDescriptor {
|
|
58
|
+
uri: string;
|
|
59
|
+
name: string;
|
|
60
|
+
description: string;
|
|
61
|
+
mimeType: string;
|
|
62
|
+
_meta: {
|
|
63
|
+
ui: {
|
|
64
|
+
csp: {
|
|
65
|
+
connectDomains: string[];
|
|
66
|
+
resourceDomains: string[];
|
|
67
|
+
frameDomains: string[];
|
|
68
|
+
baseUriDomains: string[];
|
|
69
|
+
};
|
|
70
|
+
permissions: string[];
|
|
71
|
+
prefersBorder: boolean;
|
|
72
|
+
};
|
|
73
|
+
"openai/widgetCSP": {
|
|
74
|
+
connect_domains: string[];
|
|
75
|
+
resource_domains: string[];
|
|
76
|
+
redirect_domains: string[];
|
|
77
|
+
};
|
|
78
|
+
"openai/widgetDomain": string;
|
|
79
|
+
"openai/widgetPrefersBorder": boolean;
|
|
80
|
+
"openai/widgetDescription": string;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
interface FabricMcpAppResourceContent {
|
|
84
|
+
uri: string;
|
|
85
|
+
mimeType: string;
|
|
86
|
+
text: string;
|
|
87
|
+
_meta?: Record<string, unknown>;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Helper to attach an MCP App resource URI (`_meta.ui.resourceUri` and flat `"ui/resourceUri"`)
|
|
91
|
+
* to a tool's `_meta` definition or result.
|
|
92
|
+
*/
|
|
93
|
+
export declare function withFabricApp<T extends Record<string, unknown> = Record<string, unknown>>(resourceUri: string, meta?: T): T & {
|
|
94
|
+
ui: {
|
|
95
|
+
resourceUri: string;
|
|
96
|
+
};
|
|
97
|
+
"ui/resourceUri": string;
|
|
98
|
+
};
|
|
99
|
+
export declare const FABRIC_MCP_APP_RESOURCES: readonly FabricMcpAppResourceDescriptor[];
|
|
100
|
+
export declare function readFabricMcpAppResource(uri: string): {
|
|
101
|
+
contents: FabricMcpAppResourceContent[];
|
|
102
|
+
} | null;
|
|
103
|
+
//#endregion
|
|
2
104
|
//#region src/index.d.ts
|
|
3
105
|
export type FabricLike = {
|
|
4
106
|
integrations: {
|
|
@@ -21,9 +123,11 @@ export interface CreateFabricMcpServerOptions {
|
|
|
21
123
|
version?: string;
|
|
22
124
|
}
|
|
23
125
|
/**
|
|
24
|
-
* Build a configured `McpServer` exposing the workspace catalog
|
|
126
|
+
* Build a configured `McpServer` exposing the workspace catalog and
|
|
127
|
+
* built-in Fabric MCP App resources (`ui://fabric/*`). Caller is
|
|
25
128
|
* responsible for `.connect(transport)` so the same server works over stdio,
|
|
26
129
|
* HTTP, or any other MCP transport.
|
|
27
130
|
*/
|
|
28
131
|
export declare function createFabricMcpServer(options: CreateFabricMcpServerOptions): McpServer;
|
|
29
|
-
//#endregion
|
|
132
|
+
//#endregion
|
|
133
|
+
export type { FabricMcpAppResourceContent, FabricMcpAppResourceDescriptor, FabricVisualizeResult };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,106 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
//#region src/ui-kit/index.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Official Fabric 3-arc brand mark encoded as an inline SVG data URI
|
|
5
|
+
* in Fabric's warm bright-orange primary accent (`#bc3e0b`).
|
|
6
|
+
* Requires zero external network requests (`img-src data:` CSP-safe).
|
|
7
|
+
*/
|
|
8
|
+
export declare const FABRIC_MARK_DATA_URI: string;
|
|
9
|
+
interface KitAccent {
|
|
10
|
+
light?: string;
|
|
11
|
+
dark?: string;
|
|
12
|
+
tintLight?: string;
|
|
13
|
+
tintDark?: string;
|
|
14
|
+
inkLight?: string;
|
|
15
|
+
inkDark?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const FABRIC_BRAND: {
|
|
18
|
+
accent: Required<KitAccent>;
|
|
19
|
+
display: string;
|
|
20
|
+
mark: string;
|
|
21
|
+
};
|
|
22
|
+
interface FabricVisualizeResult {
|
|
23
|
+
title: string;
|
|
24
|
+
provenance: string;
|
|
25
|
+
document: unknown[];
|
|
26
|
+
surfaces: Array<{
|
|
27
|
+
surfaceId: string;
|
|
28
|
+
catalogId: string;
|
|
29
|
+
components: number;
|
|
30
|
+
}>;
|
|
31
|
+
errors: Array<{
|
|
32
|
+
code: string;
|
|
33
|
+
surfaceId: string;
|
|
34
|
+
path: string;
|
|
35
|
+
message: string;
|
|
36
|
+
}>;
|
|
37
|
+
sources: Array<{
|
|
38
|
+
title: string;
|
|
39
|
+
page: string;
|
|
40
|
+
url: string;
|
|
41
|
+
}>;
|
|
42
|
+
textSummary: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Validates an A2UI v0.9.1 document (JSONL string or JSON array of messages)
|
|
46
|
+
* against the Fabric A2UI catalog (`https://agents.fabric.pro/a2ui/v0.9/fabric_catalog.json`)
|
|
47
|
+
* and produces both the structured payload for `ui://fabric/visualize` and a complete
|
|
48
|
+
* text fallback for non-App MCP clients.
|
|
49
|
+
*/
|
|
50
|
+
export declare function buildFabricVisualizePayload(args: {
|
|
51
|
+
document?: unknown;
|
|
52
|
+
title?: unknown;
|
|
53
|
+
sources?: unknown;
|
|
54
|
+
}): FabricVisualizeResult;
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region src/mcp-apps.d.ts
|
|
57
|
+
interface FabricMcpAppResourceDescriptor {
|
|
58
|
+
uri: string;
|
|
59
|
+
name: string;
|
|
60
|
+
description: string;
|
|
61
|
+
mimeType: string;
|
|
62
|
+
_meta: {
|
|
63
|
+
ui: {
|
|
64
|
+
csp: {
|
|
65
|
+
connectDomains: string[];
|
|
66
|
+
resourceDomains: string[];
|
|
67
|
+
frameDomains: string[];
|
|
68
|
+
baseUriDomains: string[];
|
|
69
|
+
};
|
|
70
|
+
permissions: string[];
|
|
71
|
+
prefersBorder: boolean;
|
|
72
|
+
};
|
|
73
|
+
"openai/widgetCSP": {
|
|
74
|
+
connect_domains: string[];
|
|
75
|
+
resource_domains: string[];
|
|
76
|
+
redirect_domains: string[];
|
|
77
|
+
};
|
|
78
|
+
"openai/widgetDomain": string;
|
|
79
|
+
"openai/widgetPrefersBorder": boolean;
|
|
80
|
+
"openai/widgetDescription": string;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
interface FabricMcpAppResourceContent {
|
|
84
|
+
uri: string;
|
|
85
|
+
mimeType: string;
|
|
86
|
+
text: string;
|
|
87
|
+
_meta?: Record<string, unknown>;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Helper to attach an MCP App resource URI (`_meta.ui.resourceUri` and flat `"ui/resourceUri"`)
|
|
91
|
+
* to a tool's `_meta` definition or result.
|
|
92
|
+
*/
|
|
93
|
+
export declare function withFabricApp<T extends Record<string, unknown> = Record<string, unknown>>(resourceUri: string, meta?: T): T & {
|
|
94
|
+
ui: {
|
|
95
|
+
resourceUri: string;
|
|
96
|
+
};
|
|
97
|
+
"ui/resourceUri": string;
|
|
98
|
+
};
|
|
99
|
+
export declare const FABRIC_MCP_APP_RESOURCES: readonly FabricMcpAppResourceDescriptor[];
|
|
100
|
+
export declare function readFabricMcpAppResource(uri: string): {
|
|
101
|
+
contents: FabricMcpAppResourceContent[];
|
|
102
|
+
} | null;
|
|
103
|
+
//#endregion
|
|
2
104
|
//#region src/index.d.ts
|
|
3
105
|
export type FabricLike = {
|
|
4
106
|
integrations: {
|
|
@@ -21,9 +123,11 @@ export interface CreateFabricMcpServerOptions {
|
|
|
21
123
|
version?: string;
|
|
22
124
|
}
|
|
23
125
|
/**
|
|
24
|
-
* Build a configured `McpServer` exposing the workspace catalog
|
|
126
|
+
* Build a configured `McpServer` exposing the workspace catalog and
|
|
127
|
+
* built-in Fabric MCP App resources (`ui://fabric/*`). Caller is
|
|
25
128
|
* responsible for `.connect(transport)` so the same server works over stdio,
|
|
26
129
|
* HTTP, or any other MCP transport.
|
|
27
130
|
*/
|
|
28
131
|
export declare function createFabricMcpServer(options: CreateFabricMcpServerOptions): McpServer;
|
|
29
132
|
//#endregion
|
|
133
|
+
export type { FabricMcpAppResourceContent, FabricMcpAppResourceDescriptor, FabricVisualizeResult };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createFabricMcpServer } from "./src-
|
|
2
|
-
export { createFabricMcpServer };
|
|
1
|
+
import { a as FABRIC_BRAND, i as withFabricApp, n as FABRIC_MCP_APP_RESOURCES, o as FABRIC_MARK_DATA_URI, r as readFabricMcpAppResource, s as buildFabricVisualizePayload, t as createFabricMcpServer } from "./src-DGnJhMpQ.js";
|
|
2
|
+
export { FABRIC_BRAND, FABRIC_MARK_DATA_URI, FABRIC_MCP_APP_RESOURCES, buildFabricVisualizePayload, createFabricMcpServer, readFabricMcpAppResource, withFabricApp };
|