@ggui-ai/mcp-server 0.9.0 → 0.10.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/dist/api-renders-routes.d.ts +21 -0
- package/dist/api-renders-routes.d.ts.map +1 -1
- package/dist/api-renders-routes.js +22 -5
- package/dist/build-mcp.d.ts +38 -7
- package/dist/build-mcp.d.ts.map +1 -1
- package/dist/build-mcp.js +23 -2
- package/dist/code-module-variant.d.ts +150 -0
- package/dist/code-module-variant.d.ts.map +1 -0
- package/dist/code-module-variant.js +243 -0
- package/dist/code-routes.d.ts +12 -2
- package/dist/code-routes.d.ts.map +1 -1
- package/dist/code-routes.js +12 -2
- package/dist/control-service.d.ts +29 -3
- package/dist/control-service.d.ts.map +1 -1
- package/dist/control-service.js +26 -2
- package/dist/health-routes.d.ts +19 -3
- package/dist/health-routes.d.ts.map +1 -1
- package/dist/health-routes.js +26 -18
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/mcp-apps-outbound.d.ts +40 -8
- package/dist/mcp-apps-outbound.d.ts.map +1 -1
- package/dist/mcp-apps-outbound.js +127 -30
- package/dist/mcp-endpoint-routes.d.ts +6 -0
- package/dist/mcp-endpoint-routes.d.ts.map +1 -1
- package/dist/mcp-endpoint-routes.js +67 -1
- package/dist/oauth-as-routes.d.ts +11 -0
- package/dist/oauth-as-routes.d.ts.map +1 -1
- package/dist/oauth-as-routes.js +9 -1
- package/dist/runtime-bundle-hash.d.ts +12 -0
- package/dist/runtime-bundle-hash.d.ts.map +1 -1
- package/dist/runtime-bundle-hash.js +19 -0
- package/dist/server.d.ts +223 -56
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +263 -125
- package/package.json +13 -12
package/dist/code-routes.js
CHANGED
|
@@ -28,12 +28,22 @@
|
|
|
28
28
|
* store sees the parameter.
|
|
29
29
|
*/
|
|
30
30
|
import { CODE_HASH_REGEX } from "@ggui-ai/mcp-server-core";
|
|
31
|
+
import { mountCodeModuleVariantRoute, } from "./code-module-variant.js";
|
|
31
32
|
/**
|
|
32
|
-
* Mount `GET /code/:hash.js` + `GET /contract/:hash.js`
|
|
33
|
-
*
|
|
33
|
+
* Mount `GET /code/:hash.js` + `GET /contract/:hash.js` (+ the
|
|
34
|
+
* module-variant route when configured) onto the express app. Returns
|
|
35
|
+
* nothing — the routes self-register.
|
|
34
36
|
*/
|
|
35
37
|
export function mountCodeRoutes(opts) {
|
|
36
38
|
const { app, codeStore, logger } = opts;
|
|
39
|
+
if (opts.moduleVariant !== undefined) {
|
|
40
|
+
mountCodeModuleVariantRoute({
|
|
41
|
+
app,
|
|
42
|
+
codeStore,
|
|
43
|
+
variant: opts.moduleVariant,
|
|
44
|
+
logger,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
37
47
|
const mountContentAddressableRoute = (mountPath, label) => {
|
|
38
48
|
app.get(mountPath, async (req, res) => {
|
|
39
49
|
res.setHeader("Access-Control-Allow-Origin", "*");
|
|
@@ -88,6 +88,18 @@ export declare function filterHandlersByAudience(set: ReadonlyArray<AnyHandler>,
|
|
|
88
88
|
* mutations. Confirm-gating it would break the card's inline render on
|
|
89
89
|
* the first call, because the confirmation preview does not carry the
|
|
90
90
|
* card's discriminant.
|
|
91
|
+
*
|
|
92
|
+
* `ggui_ops_save_library_blueprint` is the one MUTATING entry, by owner
|
|
93
|
+
* ruling (ggui#525, 2026-08-16). The argument that it is safe on the
|
|
94
|
+
* first call: the save is idempotent under the name-collapse rule (same
|
|
95
|
+
* slug ⇒ one row, a repeat is a no-op), it writes only to the CALLER's
|
|
96
|
+
* own library (no cross-tenant or account-wide effect), and its caller
|
|
97
|
+
* is the console helper agent auto-saving after a render — the
|
|
98
|
+
* "confirm" it performed was an agent self-confirm with no human in
|
|
99
|
+
* the loop, which bought no safety and cost one extra tool round trip
|
|
100
|
+
* on every helper render. A future entry that lacks any of those three
|
|
101
|
+
* properties (idempotent, own-scope, no human to protect) does NOT
|
|
102
|
+
* inherit this ruling — it argues its own.
|
|
91
103
|
*/
|
|
92
104
|
export declare const SINGLE_CALL_OPS: ReadonlySet<string>;
|
|
93
105
|
/**
|
|
@@ -110,8 +122,12 @@ export declare function stripAudience<I extends ZodRawShape, O extends ZodRawSha
|
|
|
110
122
|
* populated: every deployment tier proves identity differently
|
|
111
123
|
* (single-user builder, per-app key, per-user key, OIDC), and only the
|
|
112
124
|
* source distinguishes "the adapter authenticated this request" from
|
|
113
|
-
* "the transport let it through".
|
|
114
|
-
*
|
|
125
|
+
* "the transport let it through". This gate is defense-in-depth
|
|
126
|
+
* behind the transport's anonymous-ops 401 challenge (ggui#505, see
|
|
127
|
+
* `mcp-endpoint-routes.ts`): anonymous callers normally never reach
|
|
128
|
+
* dispatch on an ops tool; a throw HERE surfaces as an in-band
|
|
129
|
+
* `isError` tool result, which is the contract for callers that
|
|
130
|
+
* authenticated but lack what the handler needs.
|
|
115
131
|
*/
|
|
116
132
|
export declare function withAuthGate<I extends ZodRawShape, O extends ZodRawShape, D>(h: SharedHandler<I, O, D>): SharedHandler<I, O, D>;
|
|
117
133
|
/**
|
|
@@ -155,6 +171,16 @@ export interface BuildControlServiceArgs {
|
|
|
155
171
|
* design-time tools, and the per-handler auth gate is what keeps the
|
|
156
172
|
* ops half closed.
|
|
157
173
|
*/
|
|
158
|
-
export declare function buildControlService(args: BuildControlServiceArgs):
|
|
174
|
+
export declare function buildControlService(args: BuildControlServiceArgs): ControlService;
|
|
175
|
+
/**
|
|
176
|
+
* {@link McpService} plus the control plane's ops-tool name set — the
|
|
177
|
+
* membership the transport-level OAuth challenge reads. A separate
|
|
178
|
+
* field (rather than audience tags on the handlers) because service
|
|
179
|
+
* handlers deliberately carry no audience tag (see
|
|
180
|
+
* {@link stripAudience}).
|
|
181
|
+
*/
|
|
182
|
+
export interface ControlService extends McpService {
|
|
183
|
+
readonly opsToolNames: ReadonlySet<string>;
|
|
184
|
+
}
|
|
159
185
|
export {};
|
|
160
186
|
//# sourceMappingURL=control-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-service.d.ts","sourceRoot":"","sources":["../src/control-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAK,KAAK,WAAW,EAAmB,MAAM,KAAK,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,KAAK,UAAU,GAAG,aAAa,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAE1D,gDAAgD;AAChD,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,SAAS,GAAG,UAAU,GAAG,KAAK,CAAC;AAEnE,6CAA6C;AAC7C,eAAO,MAAM,YAAY,aAAa,CAAC;AAEvC,+EAA+E;AAC/E,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAE9C,sDAAsD;AACtD,eAAO,MAAM,oBAAoB,EAAE,aAAa,CAAC,WAAW,CAAwB,CAAC;AAErF,0CAA0C;AAC1C,eAAO,MAAM,uBAAuB,EAAE,aAAa,CAAC,WAAW,CAAuB,CAAC;AAEvF;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,aAAa,CAAC,UAAU,CAAC,EAC9B,OAAO,EAAE,aAAa,CAAC,WAAW,CAAC,GAClC,aAAa,CAAC,UAAU,CAAC,CAK3B;AAED
|
|
1
|
+
{"version":3,"file":"control-service.d.ts","sourceRoot":"","sources":["../src/control-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAK,KAAK,WAAW,EAAmB,MAAM,KAAK,CAAC;AAC3D,OAAO,KAAK,EAAE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G;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,WAAW,EAAE,CAAC,SAAS,WAAW,EAAE,CAAC,EAC7E,CAAC,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GACxB,aAAa,CAAC,WAAW,EAAE,WAAW,CAAC,CA+BzC;AAED,MAAM,WAAW,uBAAuB;IACtC;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IAC7C;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAChD;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,uBAAuB,GAAG,cAAc,CAwBjF;AAED;;;;;;GAMG;AACH,MAAM,WAAW,cAAe,SAAQ,UAAU;IAChD,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC5C"}
|
package/dist/control-service.js
CHANGED
|
@@ -89,11 +89,24 @@ export function filterHandlersByAudience(set, allowed) {
|
|
|
89
89
|
* mutations. Confirm-gating it would break the card's inline render on
|
|
90
90
|
* the first call, because the confirmation preview does not carry the
|
|
91
91
|
* card's discriminant.
|
|
92
|
+
*
|
|
93
|
+
* `ggui_ops_save_library_blueprint` is the one MUTATING entry, by owner
|
|
94
|
+
* ruling (ggui#525, 2026-08-16). The argument that it is safe on the
|
|
95
|
+
* first call: the save is idempotent under the name-collapse rule (same
|
|
96
|
+
* slug ⇒ one row, a repeat is a no-op), it writes only to the CALLER's
|
|
97
|
+
* own library (no cross-tenant or account-wide effect), and its caller
|
|
98
|
+
* is the console helper agent auto-saving after a render — the
|
|
99
|
+
* "confirm" it performed was an agent self-confirm with no human in
|
|
100
|
+
* the loop, which bought no safety and cost one extra tool round trip
|
|
101
|
+
* on every helper render. A future entry that lacks any of those three
|
|
102
|
+
* properties (idempotent, own-scope, no human to protect) does NOT
|
|
103
|
+
* inherit this ruling — it argues its own.
|
|
92
104
|
*/
|
|
93
105
|
export const SINGLE_CALL_OPS = new Set([
|
|
94
106
|
"ggui_ops_get_credit_balance",
|
|
95
107
|
"ggui_ops_get_my_blueprint_source",
|
|
96
108
|
"ggui_ops_get_org_balance",
|
|
109
|
+
"ggui_ops_get_render_source",
|
|
97
110
|
"ggui_ops_list_apps",
|
|
98
111
|
"ggui_ops_list_blueprints",
|
|
99
112
|
"ggui_ops_list_connector_keys",
|
|
@@ -102,6 +115,8 @@ export const SINGLE_CALL_OPS = new Set([
|
|
|
102
115
|
"ggui_ops_list_my_blueprints",
|
|
103
116
|
"ggui_ops_list_orgs",
|
|
104
117
|
"ggui_ops_list_provider_keys",
|
|
118
|
+
"ggui_ops_list_recent_renders",
|
|
119
|
+
"ggui_ops_save_library_blueprint",
|
|
105
120
|
"ggui_ops_setup_byok",
|
|
106
121
|
]);
|
|
107
122
|
/**
|
|
@@ -127,8 +142,12 @@ export function stripAudience(h) {
|
|
|
127
142
|
* populated: every deployment tier proves identity differently
|
|
128
143
|
* (single-user builder, per-app key, per-user key, OIDC), and only the
|
|
129
144
|
* source distinguishes "the adapter authenticated this request" from
|
|
130
|
-
* "the transport let it through".
|
|
131
|
-
*
|
|
145
|
+
* "the transport let it through". This gate is defense-in-depth
|
|
146
|
+
* behind the transport's anonymous-ops 401 challenge (ggui#505, see
|
|
147
|
+
* `mcp-endpoint-routes.ts`): anonymous callers normally never reach
|
|
148
|
+
* dispatch on an ops tool; a throw HERE surfaces as an in-band
|
|
149
|
+
* `isError` tool result, which is the contract for callers that
|
|
150
|
+
* authenticated but lack what the handler needs.
|
|
132
151
|
*/
|
|
133
152
|
export function withAuthGate(h) {
|
|
134
153
|
return {
|
|
@@ -216,5 +235,10 @@ export function buildControlService(args) {
|
|
|
216
235
|
path: CONTROL_PATH,
|
|
217
236
|
handlers,
|
|
218
237
|
anonymous: true,
|
|
238
|
+
// Captured BEFORE stripAudience erases the tags — the transport's
|
|
239
|
+
// anonymous-ops 401 challenge (ggui#505) needs the ops-name set,
|
|
240
|
+
// and the stripped handlers can no longer answer "which of you are
|
|
241
|
+
// ops". This service is the single authority on that membership.
|
|
242
|
+
opsToolNames: new Set(opsTools.map((h) => h.name)),
|
|
219
243
|
};
|
|
220
244
|
}
|
package/dist/health-routes.d.ts
CHANGED
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
* loop can run a handler, regardless of
|
|
6
6
|
* readiness).
|
|
7
7
|
* GET /ggui/health — readiness probe; runs the operator-supplied
|
|
8
|
-
* readiness checks
|
|
9
|
-
* results, live-channel
|
|
10
|
-
* thread-transport durability
|
|
8
|
+
* readiness checks, advisory checks, and
|
|
9
|
+
* reports per-check results, live-channel
|
|
10
|
+
* counts, and the thread-transport durability
|
|
11
|
+
* claim.
|
|
11
12
|
* GET /ggui/auth-check — authenticated liveness. 204 when the bearer
|
|
12
13
|
* resolves via the configured AuthAdapter,
|
|
13
14
|
* 401 otherwise (with `WWW-Authenticate` when
|
|
@@ -44,6 +45,21 @@ interface MountOptions {
|
|
|
44
45
|
readonly name: string;
|
|
45
46
|
readonly check: () => boolean | Promise<boolean>;
|
|
46
47
|
}>;
|
|
48
|
+
/**
|
|
49
|
+
* Reported but non-gating checks — surfaced under `body.advisoryChecks`
|
|
50
|
+
* in the `/ggui/health` response with the SAME per-check boolean
|
|
51
|
+
* shape as `readinessChecks`, but a failing advisory check never
|
|
52
|
+
* flips `status` or the HTTP status code. Use this for a dependency
|
|
53
|
+
* whose health is worth reporting for diagnostics but that MUST NOT
|
|
54
|
+
* affect readiness on its own — e.g. a best-effort side channel
|
|
55
|
+
* every consumer already degrades gracefully around when the
|
|
56
|
+
* dependency is unavailable. Same 1s per-check timeout as
|
|
57
|
+
* `readinessChecks`; a timeout or thrown check reports `false`.
|
|
58
|
+
*/
|
|
59
|
+
readonly advisoryChecks?: ReadonlyArray<{
|
|
60
|
+
readonly name: string;
|
|
61
|
+
readonly check: () => boolean | Promise<boolean>;
|
|
62
|
+
}>;
|
|
47
63
|
/**
|
|
48
64
|
* Late-bound live-channel reference. The channel is constructed
|
|
49
65
|
* AFTER these routes mount (declaration-order in the composer), so
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"health-routes.d.ts","sourceRoot":"","sources":["../src/health-routes.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"health-routes.d.ts","sourceRoot":"","sources":["../src/health-routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAqB,MAAM,SAAS,CAAC;AAE1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAW1C,UAAU,YAAY;IACpB,iCAAiC;IACjC,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;IACtB,+DAA+D;IAC/D,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,wDAAwD;IACxD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,iEAAiE;IACjE,QAAQ,CAAC,eAAe,EAAE,aAAa,CAAC;QACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;KAClD,CAAC,CAAC;IACH;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,aAAa,CAAC;QACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;KAClD,CAAC,CAAC;IACH;;;;OAIG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,wBAAwB,GAAG,IAAI,CAAC;IAC3D;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,GAAG,WAAW,CAAA;KAAE,CAAC;IACrE,gEAAgE;IAChE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,iEAAiE;IACjE,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,uDAAuD;IACvD,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,4DAA4D;IAC5D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;gEAC4D;IAC5D,QAAQ,CAAC,WAAW,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAC9C;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAmJ1D"}
|
package/dist/health-routes.js
CHANGED
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
* loop can run a handler, regardless of
|
|
6
6
|
* readiness).
|
|
7
7
|
* GET /ggui/health — readiness probe; runs the operator-supplied
|
|
8
|
-
* readiness checks
|
|
9
|
-
* results, live-channel
|
|
10
|
-
* thread-transport durability
|
|
8
|
+
* readiness checks, advisory checks, and
|
|
9
|
+
* reports per-check results, live-channel
|
|
10
|
+
* counts, and the thread-transport durability
|
|
11
|
+
* claim.
|
|
11
12
|
* GET /ggui/auth-check — authenticated liveness. 204 when the bearer
|
|
12
13
|
* resolves via the configured AuthAdapter,
|
|
13
14
|
* 401 otherwise (with `WWW-Authenticate` when
|
|
@@ -31,8 +32,9 @@ import { resolveIdentity, UnauthenticatedError } from "./auth.js";
|
|
|
31
32
|
import { buildWwwAuthenticate, resolveIssuerUrl } from "./oauth.js";
|
|
32
33
|
/**
|
|
33
34
|
* 1s per-check timeout — a hung dependency must not block the K8s
|
|
34
|
-
*
|
|
35
|
-
* treated as a failed check; the dependency is degraded
|
|
35
|
+
* readiness probe (/ggui/health), which itself runs on a short period.
|
|
36
|
+
* A timeout is treated as a failed check; the dependency is degraded
|
|
37
|
+
* either way.
|
|
36
38
|
*/
|
|
37
39
|
const READINESS_CHECK_TIMEOUT_MS = 1_000;
|
|
38
40
|
/**
|
|
@@ -40,29 +42,29 @@ const READINESS_CHECK_TIMEOUT_MS = 1_000;
|
|
|
40
42
|
* express app. Returns nothing — the routes self-register.
|
|
41
43
|
*/
|
|
42
44
|
export function mountHealthRoutes(opts) {
|
|
43
|
-
const { app, info, toolCount, readinessChecks, getChannel, threads, auth, oauthEnabled, logger, corsOrigins, } = opts;
|
|
44
|
-
async function
|
|
45
|
-
if (
|
|
46
|
-
return {
|
|
45
|
+
const { app, info, toolCount, readinessChecks, advisoryChecks, getChannel, threads, auth, oauthEnabled, logger, corsOrigins, } = opts;
|
|
46
|
+
async function runChecks(checks) {
|
|
47
|
+
if (checks.length === 0) {
|
|
48
|
+
return { allOk: true, results: {} };
|
|
47
49
|
}
|
|
48
50
|
const results = {};
|
|
49
|
-
let
|
|
50
|
-
await Promise.all(
|
|
51
|
+
let allOk = true;
|
|
52
|
+
await Promise.all(checks.map(async ({ name, check }) => {
|
|
51
53
|
try {
|
|
52
|
-
const
|
|
54
|
+
const ok = await Promise.race([
|
|
53
55
|
Promise.resolve().then(() => check()),
|
|
54
56
|
new Promise((resolve) => setTimeout(() => resolve(false), READINESS_CHECK_TIMEOUT_MS)),
|
|
55
57
|
]);
|
|
56
|
-
results[name] =
|
|
57
|
-
if (!
|
|
58
|
-
|
|
58
|
+
results[name] = ok;
|
|
59
|
+
if (!ok)
|
|
60
|
+
allOk = false;
|
|
59
61
|
}
|
|
60
62
|
catch {
|
|
61
63
|
results[name] = false;
|
|
62
|
-
|
|
64
|
+
allOk = false;
|
|
63
65
|
}
|
|
64
66
|
}));
|
|
65
|
-
return {
|
|
67
|
+
return { allOk, results };
|
|
66
68
|
}
|
|
67
69
|
// No body needed for the kubelet's HTTP check (status code is the
|
|
68
70
|
// signal), but a tiny JSON keeps the endpoint debuggable from a
|
|
@@ -73,7 +75,10 @@ export function mountHealthRoutes(opts) {
|
|
|
73
75
|
});
|
|
74
76
|
app.get("/ggui/health", (_req, res) => {
|
|
75
77
|
void (async () => {
|
|
76
|
-
const { allReady, results } = await
|
|
78
|
+
const [{ allOk: allReady, results }, { results: advisoryResults },] = await Promise.all([
|
|
79
|
+
runChecks(readinessChecks),
|
|
80
|
+
runChecks(advisoryChecks ?? []),
|
|
81
|
+
]);
|
|
77
82
|
const body = {
|
|
78
83
|
status: allReady ? "ok" : "degraded",
|
|
79
84
|
server: info.name,
|
|
@@ -111,6 +116,9 @@ export function mountHealthRoutes(opts) {
|
|
|
111
116
|
if (Object.keys(results).length > 0) {
|
|
112
117
|
body.checks = results;
|
|
113
118
|
}
|
|
119
|
+
if (Object.keys(advisoryResults).length > 0) {
|
|
120
|
+
body.advisoryChecks = advisoryResults;
|
|
121
|
+
}
|
|
114
122
|
res.status(allReady ? 200 : 503).json(body);
|
|
115
123
|
})();
|
|
116
124
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -33,7 +33,9 @@ export { buildOpsBundleHandlers, createGguiServer, defaultHandlers } from './ser
|
|
|
33
33
|
export type { CreateGguiServerOptions, ErrorMapperResult, GguiServer, OpsBundleDeps, } from './server.js';
|
|
34
34
|
export { buildControlService, CONTROL_PATH, filterHandlersByAudience, SINGLE_CALL_OPS, } from './control-service.js';
|
|
35
35
|
export type { AudienceTag, BuildControlServiceArgs } from './control-service.js';
|
|
36
|
-
export { computeRuntimeBundleHash, insertRuntimeBundleHash, resolveHashedRuntimeBundleUrl, } from './runtime-bundle-hash.js';
|
|
36
|
+
export { computeRuntimeBundleHash, insertRuntimeBundleHash, resolveHashedRuntimeBundleUrl, resolveRuntimeBundleHash, } from './runtime-bundle-hash.js';
|
|
37
|
+
export { createCodeModuleUrlMinter, composeCodeModuleUrl, } from './code-module-variant.js';
|
|
38
|
+
export type { MintCodeModuleUrl } from './code-module-variant.js';
|
|
37
39
|
export { FileSystemCodeStore } from './code-store-fs.js';
|
|
38
40
|
export type { FileSystemCodeStoreOptions } from './code-store-fs.js';
|
|
39
41
|
export type { McpServerMount } from './mcp-mounts.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAKlF,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAKnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACxF,YAAY,EACV,uBAAuB,EACvB,iBAAiB,EACjB,UAAU,EACV,aAAa,GACd,MAAM,aAAa,CAAC;AAMrB,OAAO,EACL,mBAAmB,EACnB,YAAY,EACZ,wBAAwB,EACxB,eAAe,GAChB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAMjF,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,6BAA6B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAKlF,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,iBAAiB,GAClB,MAAM,mBAAmB,CAA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AAU/E,YAAY,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAOhE,YAAY,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAU9D,YAAY,EACV,WAAW,EACX,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AAQnC,YAAY,EACV,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,0BAA0B,CAAC;AAKlC,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,0BAA0B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -42,7 +42,13 @@ export { buildControlService, CONTROL_PATH, filterHandlersByAudience, SINGLE_CAL
|
|
|
42
42
|
// that compose their own render handler (replacing the factory's
|
|
43
43
|
// default set) and therefore mint an absolute `runtimeUrl` directly —
|
|
44
44
|
// one derivation, no drift against the route the factory mounts.
|
|
45
|
-
export { computeRuntimeBundleHash, insertRuntimeBundleHash, resolveHashedRuntimeBundleUrl, } from './runtime-bundle-hash.js';
|
|
45
|
+
export { computeRuntimeBundleHash, insertRuntimeBundleHash, resolveHashedRuntimeBundleUrl, resolveRuntimeBundleHash, } from './runtime-bundle-hash.js';
|
|
46
|
+
// Strict-CSP module-variant delivery (ggui#522 slice 2). The minter is
|
|
47
|
+
// exported for the same composed-handler deployments: a pod that binds
|
|
48
|
+
// `codeStore`/`codeBaseUrl` on its own render tool builds the minter
|
|
49
|
+
// from `resolveRuntimeBundleHash()` so its `codeModuleUrl`s name the
|
|
50
|
+
// exact variant family the co-resident factory routes serve.
|
|
51
|
+
export { createCodeModuleUrlMinter, composeCodeModuleUrl, } from './code-module-variant.js';
|
|
46
52
|
// Content-addressable code delivery (2026-05-03). FileSystemCodeStore
|
|
47
53
|
// is the OSS dev default; in-memory variant ships in
|
|
48
54
|
// `@ggui-ai/mcp-server-core/in-memory` for tests + ephemeral runs.
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
* same `@ggui-ai/mcp-server` instance that mints the bootstrap.
|
|
33
33
|
*/
|
|
34
34
|
import type { BlueprintIndex, GguiSessionStore, VectorStore } from "@ggui-ai/mcp-server-core";
|
|
35
|
-
import { type BlueprintDurabilityDeps } from "@ggui-ai/mcp-server-handlers/renders";
|
|
35
|
+
import { type BlueprintDurabilityDeps, type SliceThemeDeps } from "@ggui-ai/mcp-server-handlers/renders";
|
|
36
36
|
import { type McpAppAiGguiRenderMeta } from "@ggui-ai/protocol/integrations/mcp-apps";
|
|
37
37
|
import { type McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
38
38
|
import type { HandlerContext } from "@ggui-ai/mcp-server-handlers";
|
|
39
39
|
import type { Logger } from "./logger.js";
|
|
40
|
-
export declare const GGUI_RENDER_SHELL_HTML = "<!doctype html>\n<html lang=\"en\" style=\"height:100%;background-color:var(--ggui-color-surface, #1e293b)\"><head><meta charset=\"utf-8\"><title>ggui render</title></head>\n<body style=\"margin:0;height:100%;min-height:480px;background-color:var(--ggui-color-surface, #1e293b)\"><div id=\"ggui-root\" data-ggui-shell=\"thin\" style=\"height:100%;min-height:480px\"></div>\n<script>\n(function(){'use strict';\n// MCP Apps shell. Speaks the canonical postMessage protocol from\n// @modelcontextprotocol/ext-apps:\n// 1. iframe -> host: ui/initialize\n// 2. iframe -> host: ui/notifications/initialized\n// 3. host -> iframe: ui/notifications/tool-result (per CallToolResult)\n// On tool-result, read the slice envelope from _meta (spec-canonical\n// CallToolResult _meta at the top level), set window.__GGUI_META__ to\n// the envelope, fetch runtime as blob, inject as script.\n// Runtime auto-mounts inline. No nested iframe (claudemcpcontent.com\n// CSP frame-src forbids cross-origin frames). State machine matches\n// buildSelfContainedShell so the same runtime mounts both paths.\n//\n// R5 (2026-05-26): the historic /r/<shortCode> HTTP fallback was\n// removed along with the bearer-by-obscurity model -- hosts that strip\n// _meta no longer have a recovery path here. Spec-canonical hosts\n// deliver _meta inline and are unaffected.\n//\n// Phase B (2026-05-27): the historic two-slice envelope\n// (`ai.ggui/session` + `ai.ggui/stack-item`) collapsed to ONE flat\n// `ai.ggui/render` slice. runtimeUrl now lives directly on the\n// render slice; sessionId is the canonical identity.\nvar rpcId=1,pending={};\nvar rootEl=document.getElementById('ggui-root');\nrootEl.style.cssText='display:flex;flex-direction:column;height:100%;min-height:300px;margin:0';\nvar mounted=false;\nvar lastEnvelope=null;\n// Text color pairs with the shell surface: themed var when the runtime\n// injected theme CSS, else the light-on-dark fallback matching the\n// shell's static #1e293b pre-theme surface. The old hardcoded #666 was\n// illegible on that dark fallback (#481).\nvar SHELL_FG='var(--ggui-color-onSurface,#e2e8f0)';\nfunction setOverlay(text){\n if(mounted)return;\n rootEl.innerHTML='<div style=\"font:13px system-ui,sans-serif;padding:24px;color:'+SHELL_FG+';opacity:.55\">'+text+'</div>';\n}\nfunction escText(s){\n return String(s).replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/\"/g,'"');\n}\n// Terminal failure card (#481): plain-language summary, diagnostic\n// reachable but collapsed, Retry only when a retry can actually work.\n// Same visual vocabulary as the runtime's React error boundary so the\n// two error surfaces read as one system.\nfunction showFailure(summary,detail,retry){\n if(mounted)return;\n rootEl.innerHTML=''+\n '<div style=\"display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:32px 24px;min-height:160px;font-family:system-ui,sans-serif;color:'+SHELL_FG+';text-align:center\">'+\n '<div style=\"font-size:14px;font-weight:600\">'+escText(summary)+'</div>'+\n '<div style=\"font-size:12px;opacity:.65;max-width:320px;line-height:1.45\">The interface could not start. The conversation is unaffected \u2014 you can also just ask for the view again.</div>'+\n (retry?'<button id=\"ggui-shell-retry\" style=\"margin-top:2px;padding:7px 18px;border-radius:8px;border:1px solid currentColor;background:transparent;color:inherit;opacity:.75;font:500 13px system-ui,sans-serif;cursor:pointer\">Retry</button>':'')+\n '<details style=\"margin-top:6px;max-width:340px;width:100%;text-align:left;opacity:.75\">'+\n '<summary style=\"cursor:pointer;font-size:12px\">Details</summary>'+\n '<pre style=\"margin:6px 0 0;font:11px/1.5 ui-monospace,Menlo,monospace;white-space:pre-wrap;word-break:break-word\">'+escText(detail)+'</pre>'+\n '</details>'+\n '</div>';\n if(retry){\n var b=document.getElementById('ggui-shell-retry');\n if(b)b.onclick=retry;\n }\n}\nfunction postNotification(method,params){\n try{window.parent.postMessage({jsonrpc:'2.0',method:method,params:params||{}},'*');}catch(e){}\n}\nfunction postRpc(method,params){\n return new Promise(function(res,rej){\n var id=rpcId++;pending[id]={res:res,rej:rej};\n try{window.parent.postMessage({jsonrpc:'2.0',id:id,method:method,params:params||{}},'*');}\n catch(e){delete pending[id];rej(e);}\n });\n}\nfunction postBootstrapFailed(reason,message){\n // Surface every shell-layer bootstrap-failure path as a typed\n // RendererBootFailedMessage envelope so hosts pinning the C9\n // error pane (McpAppIframe onError, IframeErrorPane) see the\n // failure instead of staring at the inert overlay until the test\n // times out. Reason codes match BootstrapFailureReason.\n try{window.parent.postMessage({type:'ggui:bootstrap-failed',reason:reason,message:message},'*');}catch(e){}\n}\nasync function mountFromMeta(envelope){\n if(mounted)return;\n // Slice envelope shape (Phase B): { \"ai.ggui/render\": { sessionId,\n // appId, runtimeUrl, ... } }. runtimeUrl on the render slice is\n // the only load-bearing field at the shell layer \u2014 it tells us\n // which iframe-runtime bundle to fetch. Everything else is\n // optional; the runtime decides at boot time based on the meta\n // it reads from window.__GGUI_META__.\n var renderSlice=envelope&&envelope['ai.ggui/render'];\n var runtimeUrl=renderSlice&&renderSlice.runtimeUrl;\n if(!envelope||typeof runtimeUrl!=='string'){\n // No retry: without a valid envelope there is nothing to re-run.\n showFailure('This view could not start','MALFORMED_BOOTSTRAP: bootstrap payload malformed (no ai.ggui/render slice with a runtimeUrl).',null);\n postBootstrapFailed('MALFORMED_BOOTSTRAP','Bootstrap payload malformed.');\n return;\n }\n lastEnvelope=envelope;\n setOverlay('Loading UI\u2026');\n window.__GGUI_META__=envelope;\n // Load the runtime bundle via a direct cross-origin script tag\n // (governed by CSP script-src) instead of fetch + Blob (governed by\n // CSP connect-src). claude.ai's claudemcpcontent.com iframe CSP\n // forbids cross-origin connect-src so fetch throws TypeError\n // 'Failed to fetch', but allows cross-origin script-src when the\n // bundle responds with the right CORS headers (the iframe-runtime\n // mount sets them). The self-contained shell already uses this\n // pattern; legacy postMessage shell now matches it.\n try{\n var s=document.createElement('script');\n s.type='module';\n // crossorigin=anonymous opts into CORS-mode error reporting.\n // Without it, cross-origin script tags get a sanitized\n // \"script error\" with no details, masking the real cause\n // (CSP block, CORS reject, module-evaluation throw). With it,\n // the error event surfaces the actual message in the iframe\n // console -- the bundle ships ACAO=* so credentialed mode is\n // unnecessary.\n s.crossOrigin='anonymous';\n s.src=runtimeUrl;\n s.onload=function(){mounted=true;};\n s.onerror=function(e){\n var msg='Runtime bundle failed to load: '+(e&&e.message||'script error');\n showFailure('This view could not load','BUNDLE_FETCH_FAILED: '+msg,function(){mountFromMeta(lastEnvelope);});\n postBootstrapFailed('BUNDLE_FETCH_FAILED',msg);\n };\n rootEl.innerHTML='';\n document.body.appendChild(s);\n }catch(e){\n var msg='Runtime bundle failed to load: '+(e&&e.message||e);\n showFailure('This view could not load','BUNDLE_FETCH_FAILED: '+msg,function(){mountFromMeta(lastEnvelope);});\n postBootstrapFailed('BUNDLE_FETCH_FAILED',msg);\n }\n}\nfunction readMetaFromCallToolResult(params){\n // MCP Apps spec (specification/2026-01-26/apps.mdx:1145-1155):\n // ui/notifications/tool-result\n // params: CallToolResult // Standard MCP type\n // So params IS the CallToolResult and _meta lives at the top\n // level. Spec-compliant hosts (Claude Desktop, claude.ai\n // Connector, Claude Code) deliver slice-envelope material here.\n // Single slice-envelope key (Phase B: ai.ggui/render). Only the\n // render slice's runtimeUrl is load-bearing at the shell layer;\n // the runtime reads everything else off window.__GGUI_META__\n // after we set it.\n if(!params||typeof params!=='object')return null;\n var meta=params._meta;\n if(!meta||typeof meta!=='object')return null;\n var renderSlice=meta['ai.ggui/render'];\n if(!renderSlice||typeof renderSlice!=='object')return null;\n if(typeof renderSlice.runtimeUrl!=='string')return null;\n return meta;\n}\nwindow.addEventListener('message',function(ev){\n var m=ev&&ev.data;\n if(!m||m.jsonrpc!=='2.0')return;\n if(m.id!=null&&pending[m.id]){\n var p=pending[m.id];delete pending[m.id];\n if(m.error)p.rej(m.error);else p.res(m.result);\n return;\n }\n if(m.method==='ui/notifications/tool-result'){\n // Spec-compliant hosts: m.params IS the CallToolResult; _meta is\n // at the top level.\n var specMeta=readMetaFromCallToolResult(m.params);\n if(specMeta){mountFromMeta(specMeta);return;}\n // R5 (2026-05-26) -- the /r/<shortCode> HTTP fallback was removed\n // along with the bearer-by-obscurity model. Hosts that strip\n // _meta on the tool-result wire have no fallback path here;\n // spec-canonical hosts deliver meta inline and land in the branch\n // above.\n }\n});\n// Named so the failure card's Retry can re-run the whole handshake \u2014\n// a host that missed or rejected the first ui/initialize may answer a\n// second (observed with hosts that attach their listener late).\nfunction startInit(){\n setOverlay('Initializing\u2026');\n var initTimer=setTimeout(function(){\n showFailure('This view did not hear back from its host','INIT_TIMEOUT: no response to ui/initialize within 3s.',startInit);\n },3000);\n postRpc('ui/initialize',{\n appCapabilities:{},\n appInfo:{name:'ggui-render',version:'1.0.0'},\n protocolVersion:'2026-01-26'\n }).then(function(){\n clearTimeout(initTimer);\n postNotification('ui/notifications/initialized',{});\n // Wait for the host to send ui/notifications/tool-result carrying\n // the slice envelope in _meta \u2014 the spec-canonical delivery channel.\n // The ui/initialize result itself carries no slice meta (the\n // McpUiInitializeResult schema defines no such field).\n setOverlay('Waiting for tool result\u2026');\n }).catch(function(e){\n clearTimeout(initTimer);\n showFailure('This view could not connect to its host','ui/initialize failed: '+(e&&e.message||JSON.stringify(e)),startInit);\n });\n}\nstartInit();\n})();\n</script></body></html>";
|
|
40
|
+
export declare const GGUI_RENDER_SHELL_HTML = "<!doctype html>\n<html lang=\"en\" style=\"height:100%;background-color:var(--ggui-shell-background, var(--ggui-color-surface, #1e293b))\"><head><meta charset=\"utf-8\"><title>ggui render</title></head>\n<body style=\"margin:0;height:100%;min-height:480px;background-color:var(--ggui-shell-background, var(--ggui-color-surface, #1e293b))\"><div id=\"ggui-root\" data-ggui-shell=\"thin\" style=\"height:100%;min-height:480px\"></div>\n<script>\n(function(){'use strict';\n// MCP Apps shell. Speaks the canonical postMessage protocol from\n// @modelcontextprotocol/ext-apps:\n// 1. iframe -> host: ui/initialize\n// 2. iframe -> host: ui/notifications/initialized\n// 3. host -> iframe: ui/notifications/tool-result (per CallToolResult)\n// On tool-result, read the slice envelope from _meta (spec-canonical\n// CallToolResult _meta at the top level), set window.__GGUI_META__ to\n// the envelope, fetch runtime as blob, inject as script.\n// Runtime auto-mounts inline. No nested iframe (claudemcpcontent.com\n// CSP frame-src forbids cross-origin frames). State machine matches\n// buildSelfContainedShell so the same runtime mounts both paths.\n//\n// R5 (2026-05-26): the historic /r/<shortCode> HTTP fallback was\n// removed along with the bearer-by-obscurity model -- hosts that strip\n// _meta no longer have a recovery path here. Spec-canonical hosts\n// deliver _meta inline and are unaffected.\n//\n// Phase B (2026-05-27): the historic two-slice envelope\n// (`ai.ggui/session` + `ai.ggui/stack-item`) collapsed to ONE flat\n// `ai.ggui/render` slice. runtimeUrl now lives directly on the\n// render slice; sessionId is the canonical identity.\nvar rpcId=1,pending={};\nvar rootEl=document.getElementById('ggui-root');\nrootEl.style.cssText='display:flex;flex-direction:column;height:100%;min-height:300px;margin:0';\nvar mounted=false;\nvar lastEnvelope=null;\n// Text color pairs with the shell surface: themed var when the runtime\n// injected theme CSS, else the light-on-dark fallback matching the\n// shell's static #1e293b pre-theme surface. The old hardcoded #666 was\n// illegible on that dark fallback (#481).\nvar SHELL_FG='var(--ggui-color-onSurface,#e2e8f0)';\nfunction setOverlay(text){\n if(mounted)return;\n rootEl.innerHTML='<div style=\"font:13px system-ui,sans-serif;padding:24px;color:'+SHELL_FG+';opacity:.55\">'+text+'</div>';\n}\nfunction escText(s){\n return String(s).replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/\"/g,'"');\n}\n// Terminal failure card (#481): plain-language summary, diagnostic\n// reachable but collapsed, Retry only when a retry can actually work.\n// Same visual vocabulary as the runtime's React error boundary so the\n// two error surfaces read as one system.\nfunction showFailure(summary,detail,retry){\n if(mounted)return;\n rootEl.innerHTML=''+\n '<div style=\"display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:32px 24px;min-height:160px;font-family:system-ui,sans-serif;color:'+SHELL_FG+';text-align:center\">'+\n '<div style=\"font-size:14px;font-weight:600\">'+escText(summary)+'</div>'+\n '<div style=\"font-size:12px;opacity:.65;max-width:320px;line-height:1.45\">The interface could not start. The conversation is unaffected \u2014 you can also just ask for the view again.</div>'+\n (retry?'<button id=\"ggui-shell-retry\" style=\"margin-top:2px;padding:7px 18px;border-radius:8px;border:1px solid currentColor;background:transparent;color:inherit;opacity:.75;font:500 13px system-ui,sans-serif;cursor:pointer\">Retry</button>':'')+\n '<details style=\"margin-top:6px;max-width:340px;width:100%;text-align:left;opacity:.75\">'+\n '<summary style=\"cursor:pointer;font-size:12px\">Details</summary>'+\n '<pre style=\"margin:6px 0 0;font:11px/1.5 ui-monospace,Menlo,monospace;white-space:pre-wrap;word-break:break-word\">'+escText(detail)+'</pre>'+\n '</details>'+\n '</div>';\n if(retry){\n var b=document.getElementById('ggui-shell-retry');\n if(b)b.onclick=retry;\n }\n}\nfunction postNotification(method,params){\n try{window.parent.postMessage({jsonrpc:'2.0',method:method,params:params||{}},'*');}catch(e){}\n}\nfunction postRpc(method,params){\n return new Promise(function(res,rej){\n var id=rpcId++;pending[id]={res:res,rej:rej};\n try{window.parent.postMessage({jsonrpc:'2.0',id:id,method:method,params:params||{}},'*');}\n catch(e){delete pending[id];rej(e);}\n });\n}\nfunction postBootstrapFailed(reason,message){\n // Surface every shell-layer bootstrap-failure path as a typed\n // RendererBootFailedMessage envelope so hosts pinning the C9\n // error pane (McpAppIframe onError, IframeErrorPane) see the\n // failure instead of staring at the inert overlay until the test\n // times out. Reason codes match BootstrapFailureReason.\n try{window.parent.postMessage({type:'ggui:bootstrap-failed',reason:reason,message:message},'*');}catch(e){}\n}\nasync function mountFromMeta(envelope){\n if(mounted)return;\n // Slice envelope shape (Phase B): { \"ai.ggui/render\": { sessionId,\n // appId, runtimeUrl, ... } }. runtimeUrl on the render slice is\n // the only load-bearing field at the shell layer \u2014 it tells us\n // which iframe-runtime bundle to fetch. Everything else is\n // optional; the runtime decides at boot time based on the meta\n // it reads from window.__GGUI_META__.\n var renderSlice=envelope&&envelope['ai.ggui/render'];\n var runtimeUrl=renderSlice&&renderSlice.runtimeUrl;\n if(!envelope||typeof runtimeUrl!=='string'){\n // No retry: without a valid envelope there is nothing to re-run.\n showFailure('This view could not start','MALFORMED_BOOTSTRAP: bootstrap payload malformed (no ai.ggui/render slice with a runtimeUrl).',null);\n postBootstrapFailed('MALFORMED_BOOTSTRAP','Bootstrap payload malformed.');\n return;\n }\n lastEnvelope=envelope;\n setOverlay('Loading UI\u2026');\n window.__GGUI_META__=envelope;\n // Load the runtime bundle via a direct cross-origin script tag\n // (governed by CSP script-src) instead of fetch + Blob (governed by\n // CSP connect-src). claude.ai's claudemcpcontent.com iframe CSP\n // forbids cross-origin connect-src so fetch throws TypeError\n // 'Failed to fetch', but allows cross-origin script-src when the\n // bundle responds with the right CORS headers (the iframe-runtime\n // mount sets them). The self-contained shell already uses this\n // pattern; legacy postMessage shell now matches it.\n try{\n var s=document.createElement('script');\n s.type='module';\n // crossorigin=anonymous opts into CORS-mode error reporting.\n // Without it, cross-origin script tags get a sanitized\n // \"script error\" with no details, masking the real cause\n // (CSP block, CORS reject, module-evaluation throw). With it,\n // the error event surfaces the actual message in the iframe\n // console -- the bundle ships ACAO=* so credentialed mode is\n // unnecessary.\n s.crossOrigin='anonymous';\n s.src=runtimeUrl;\n s.onload=function(){mounted=true;};\n s.onerror=function(e){\n var msg='Runtime bundle failed to load: '+(e&&e.message||'script error');\n showFailure('This view could not load','BUNDLE_FETCH_FAILED: '+msg,function(){mountFromMeta(lastEnvelope);});\n postBootstrapFailed('BUNDLE_FETCH_FAILED',msg);\n };\n rootEl.innerHTML='';\n document.body.appendChild(s);\n }catch(e){\n var msg='Runtime bundle failed to load: '+(e&&e.message||e);\n showFailure('This view could not load','BUNDLE_FETCH_FAILED: '+msg,function(){mountFromMeta(lastEnvelope);});\n postBootstrapFailed('BUNDLE_FETCH_FAILED',msg);\n }\n}\nfunction readMetaFromCallToolResult(params){\n // MCP Apps spec (specification/2026-01-26/apps.mdx:1145-1155):\n // ui/notifications/tool-result\n // params: CallToolResult // Standard MCP type\n // So params IS the CallToolResult and _meta lives at the top\n // level. Spec-compliant hosts (Claude Desktop, claude.ai\n // Connector, Claude Code) deliver slice-envelope material here.\n // Single slice-envelope key (Phase B: ai.ggui/render). Only the\n // render slice's runtimeUrl is load-bearing at the shell layer;\n // the runtime reads everything else off window.__GGUI_META__\n // after we set it.\n if(!params||typeof params!=='object')return null;\n var meta=params._meta;\n if(!meta||typeof meta!=='object')return null;\n var renderSlice=meta['ai.ggui/render'];\n if(!renderSlice||typeof renderSlice!=='object')return null;\n if(typeof renderSlice.runtimeUrl!=='string')return null;\n return meta;\n}\nwindow.addEventListener('message',function(ev){\n var m=ev&&ev.data;\n if(!m||m.jsonrpc!=='2.0')return;\n if(m.id!=null&&pending[m.id]){\n var p=pending[m.id];delete pending[m.id];\n if(m.error)p.rej(m.error);else p.res(m.result);\n return;\n }\n if(m.method==='ui/notifications/tool-result'){\n // Spec-compliant hosts: m.params IS the CallToolResult; _meta is\n // at the top level.\n var specMeta=readMetaFromCallToolResult(m.params);\n if(specMeta){mountFromMeta(specMeta);return;}\n // Read-plane door (ggui#537). A server running the read-plane-only\n // posture publishes only the view's IDENTITY on the result -- the\n // ui:// locator on structuredContent.resourceUri and the spec\n // pointer _meta.ui.resourceUri -- and no bootstrap material. The\n // per-render resource that locator names is the self-contained\n // shell, whose document inlines the very envelope this shell needs;\n // ask the HOST to read it (resources/read, proxied by the host's\n // own MCP client -- no fetch from this sandbox, so a host CSP with\n // no connect-src to the server is not in the way). R5 (2026-05-26)\n // removed the /r/<shortCode> HTTP fallback with the bearer-by-\n // obscurity model; this door is the spec-canonical replacement.\n var locator=readLocatorFromCallToolResult(m.params);\n if(locator){mountFromLocator(locator);return;}\n }\n});\nfunction readLocatorFromCallToolResult(params){\n if(!params||typeof params!=='object')return null;\n var sc=params.structuredContent, meta=params._meta, uri=null;\n if(sc&&typeof sc==='object'&&typeof sc.resourceUri==='string')uri=sc.resourceUri;\n else if(meta&&typeof meta==='object'&&meta.ui&&typeof meta.ui==='object'&&typeof meta.ui.resourceUri==='string')uri=meta.ui.resourceUri;\n if(!uri||uri.indexOf('ui://ggui/render/')!==0)return null;\n return uri;\n}\nfunction envelopeFromResourceDoc(text){\n // The per-render self-contained shell inlines its envelope on ONE\n // line inside its meta script tag: globalThis.__GGUI_META__ = {...};\n // (protocol gguiShellHtml). The JSON is angle-bracket-escaped by the\n // assembler, so the first ';' followed by the closing script tag\n // after the marker is the terminator.\n if(typeof text!=='string')return null;\n var marker='globalThis.__GGUI_META__ = ';\n var start=text.indexOf(marker);\n if(start<0)return null;\n start+=marker.length;\n var end=text.indexOf(';<'+'/script>',start);\n if(end<0)return null;\n try{var env=JSON.parse(text.slice(start,end));}catch(e){return null;}\n return (env&&typeof env==='object'&&env['ai.ggui/render']&&typeof env['ai.ggui/render'].runtimeUrl==='string')?env:null;\n}\nasync function mountFromLocator(uri){\n if(mounted)return;\n setOverlay('Resolving view\u2026');\n var res;\n try{res=await postRpc('resources/read',{uri:uri});}\n catch(e){\n var rmsg='READ_DOOR_FAILED: the host could not read '+uri+' -- '+(e&&e.message||JSON.stringify(e));\n showFailure('This view could not be resolved',rmsg,function(){mountFromLocator(uri);});\n postBootstrapFailed('MALFORMED_BOOTSTRAP',rmsg);\n return;\n }\n var c=res&&res.contents&&res.contents[0];\n var env=envelopeFromResourceDoc(c&&c.text);\n if(!env){\n var emsg='MALFORMED_BOOTSTRAP: resource '+uri+' carried no ai.ggui/render envelope with a runtimeUrl.';\n showFailure('This view could not start',emsg,function(){mountFromLocator(uri);});\n postBootstrapFailed('MALFORMED_BOOTSTRAP',emsg);\n return;\n }\n mountFromMeta(env);\n}\n// Named so the failure card's Retry can re-run the whole handshake \u2014\n// a host that missed or rejected the first ui/initialize may answer a\n// second (observed with hosts that attach their listener late).\nfunction startInit(){\n setOverlay('Initializing\u2026');\n var initTimer=setTimeout(function(){\n showFailure('This view did not hear back from its host','INIT_TIMEOUT: no response to ui/initialize within 3s.',startInit);\n },3000);\n postRpc('ui/initialize',{\n appCapabilities:{},\n appInfo:{name:'ggui-render',version:'1.0.0'},\n protocolVersion:'2026-01-26'\n }).then(function(){\n clearTimeout(initTimer);\n postNotification('ui/notifications/initialized',{});\n // Wait for the host to send ui/notifications/tool-result carrying\n // the slice envelope in _meta \u2014 the spec-canonical delivery channel.\n // The ui/initialize result itself carries no slice meta (the\n // McpUiInitializeResult schema defines no such field).\n setOverlay('Waiting for tool result\u2026');\n }).catch(function(e){\n clearTimeout(initTimer);\n showFailure('This view could not connect to its host','ui/initialize failed: '+(e&&e.message||JSON.stringify(e)),startInit);\n });\n}\nstartInit();\n})();\n</script></body></html>";
|
|
41
41
|
/**
|
|
42
42
|
* CSP `script-src` source expression that authorises the inline
|
|
43
43
|
* `<script>` block of {@link GGUI_RENDER_SHELL_HTML} when it executes
|
|
@@ -165,6 +165,14 @@ export interface SelfContainedShellInputs {
|
|
|
165
165
|
* renders without re-parsing.
|
|
166
166
|
*/
|
|
167
167
|
readonly codeHash?: string;
|
|
168
|
+
/**
|
|
169
|
+
* Strict-CSP module-variant twin of {@link codeUrl} (ggui#522 slice
|
|
170
|
+
* 2): the same bytes, server-side import-rewritten to static shim
|
|
171
|
+
* assets, directly `import()`able with no `blob:`/`data:` grants.
|
|
172
|
+
* Rides only alongside `codeUrl`/`codeB64` — a load path, never a
|
|
173
|
+
* mode discriminator.
|
|
174
|
+
*/
|
|
175
|
+
readonly codeModuleUrl?: string;
|
|
168
176
|
/**
|
|
169
177
|
* Base64-encoded compiled component source inlined on the bootstrap
|
|
170
178
|
* — the fetch-free twin of {@link codeUrl}, decoded by the
|
|
@@ -392,15 +400,39 @@ export interface GguiRenderResourceTemplateOptions {
|
|
|
392
400
|
*/
|
|
393
401
|
readonly codeBaseUrl?: string;
|
|
394
402
|
/**
|
|
395
|
-
*
|
|
396
|
-
*
|
|
397
|
-
*
|
|
398
|
-
|
|
399
|
-
|
|
403
|
+
* Strict-CSP module-variant minter (ggui#522 slice 2) — same
|
|
404
|
+
* function dep the render handler takes; the read path re-mints the
|
|
405
|
+
* `codeModuleUrl` twin alongside its re-minted `codeUrl`.
|
|
406
|
+
*/
|
|
407
|
+
readonly mintCodeModuleUrl?: (args: {
|
|
408
|
+
readonly code: string;
|
|
409
|
+
readonly hash: string;
|
|
410
|
+
readonly base: string;
|
|
411
|
+
}) => string | undefined;
|
|
412
|
+
/**
|
|
413
|
+
* Static theme preset id resolved from `ggui.json#theme` — the LAST
|
|
414
|
+
* layer of the resolution the served shell stamps. The shell resolves
|
|
415
|
+
* `themeId` / `themeMode` through {@link resolveSliceTheme}, the same
|
|
416
|
+
* function the tool-result slice uses: live `themeProvider()` beats
|
|
417
|
+
* the per-render override the agent set on the GguiSession
|
|
418
|
+
* (`ggui_render({ themeId })`) beats this static value (ggui#539 —
|
|
419
|
+
* before that, `resources/read` stamped only this static layer, so a
|
|
420
|
+
* per-render override never reached a host that mounts by read).
|
|
421
|
+
* Without any layer, MCP-Apps hosts (claude.ai, Claude Desktop) that
|
|
422
|
+
* fetch the resource via `resources/read` render the runtime's baked
|
|
423
|
+
* default theme.
|
|
400
424
|
*/
|
|
401
425
|
readonly themeId?: string;
|
|
402
|
-
/**
|
|
426
|
+
/** Static theme color mode resolved from `ggui.json#theme.mode` (last layer; see `themeId`). */
|
|
403
427
|
readonly themeMode?: "light" | "dark";
|
|
428
|
+
/**
|
|
429
|
+
* Live theme getter — the operator's current pick (the console's
|
|
430
|
+
* "Save to ggui.json" cell), evaluated per read. FIRST layer of the
|
|
431
|
+
* resolution; identical in shape and precedence to the render
|
|
432
|
+
* handler's `themeProvider` dep, so a pick that changes the next
|
|
433
|
+
* tool-result slice changes the next `resources/read` shell too.
|
|
434
|
+
*/
|
|
435
|
+
readonly themeProvider?: SliceThemeDeps["themeProvider"];
|
|
404
436
|
/**
|
|
405
437
|
* Per-app metadata store the resource handler reads to resolve
|
|
406
438
|
* `App.publicEnv` for the bootstrap projection.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-apps-outbound.d.ts","sourceRoot":"","sources":["../src/mcp-apps-outbound.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAEhB,WAAW,EACZ,MAAM,0BAA0B,CAAC;AAClC,OAAO,
|
|
1
|
+
{"version":3,"file":"mcp-apps-outbound.d.ts","sourceRoot":"","sources":["../src/mcp-apps-outbound.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAEhB,WAAW,EACZ,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAWL,KAAK,uBAAuB,EAC5B,KAAK,cAAc,EACpB,MAAM,sCAAsC,CAAC;AAkB9C,OAAO,EAaL,KAAK,sBAAsB,EAE5B,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAG3F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAGnE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAoY1C,eAAO,MAAM,sBAAsB,yraAG6B,CAAC;AAEjE;;;;;;;;;;;;;;;;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