@ggui-ai/mcp-server-handlers 0.1.0-rc.3 → 0.2.0-alpha.3
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 +3 -3
- package/dist/app-discovery/errors.d.ts +1 -1
- package/dist/app-discovery/errors.js +4 -4
- package/dist/app-discovery/list-themes.d.ts +1 -1
- package/dist/app-discovery/list-themes.js +2 -2
- package/dist/blueprints/render-blueprint.d.ts +1 -1
- package/dist/blueprints/render-blueprint.js +1 -1
- package/dist/blueprints/search-blueprints.d.ts +1 -1
- package/dist/blueprints/search-blueprints.js +1 -1
- package/dist/contract-tests/index.d.ts +13 -13
- package/dist/contract-tests/index.d.ts.map +1 -1
- package/dist/contract-tests/index.js +1 -19
- package/dist/index.d.ts +12 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -11
- package/dist/ops-apps/delete-app.d.ts +1 -1
- package/dist/ops-apps/delete-app.js +2 -2
- package/dist/ops-apps/set-default-app.js +1 -1
- package/dist/ops-apps/update-app-system-prompt.d.ts +1 -1
- package/dist/ops-apps/update-app-system-prompt.js +3 -3
- package/dist/ops-blueprint/errors.d.ts +1 -1
- package/dist/ops-blueprint/errors.js +9 -9
- package/dist/ops-blueprint/generate.d.ts +7 -7
- package/dist/ops-blueprint/generate.d.ts.map +1 -1
- package/dist/ops-blueprint/generate.js +38 -53
- package/dist/ops-blueprint/register.d.ts +6 -6
- package/dist/ops-blueprint/register.d.ts.map +1 -1
- package/dist/ops-blueprint/register.js +28 -38
- package/dist/ops-connector-keys/issue-connector-key.js +1 -1
- package/dist/ops-orgs/invite-to-org.d.ts +2 -2
- package/dist/ops-orgs/revoke-invite.d.ts +2 -2
- package/dist/renders/apply-render-patch.d.ts +79 -0
- package/dist/renders/apply-render-patch.d.ts.map +1 -0
- package/dist/{session-mutations/apply-stack-item-patch.js → renders/apply-render-patch.js} +4 -16
- package/dist/renders/assert-action-contract.d.ts.map +1 -0
- package/dist/renders/assert-contract-no-retired-fields.d.ts.map +1 -0
- package/dist/{session-mutations → renders}/assert-gadgets.d.ts +1 -1
- package/dist/renders/assert-gadgets.d.ts.map +1 -0
- package/dist/{session-mutations → renders}/assert-gadgets.js +15 -17
- package/dist/{session-mutations → renders}/assert-generator.d.ts +1 -1
- package/dist/renders/assert-generator.d.ts.map +1 -0
- package/dist/{session-mutations → renders}/assert-generator.js +1 -1
- package/dist/renders/assert-no-duplicate-gadget-hooks.d.ts.map +1 -0
- package/dist/renders/assert-props-contract.d.ts.map +1 -0
- package/dist/renders/assert-public-env.d.ts.map +1 -0
- package/dist/renders/assert-stream-contract.d.ts.map +1 -0
- package/dist/{session-mutations → renders}/blueprint-matcher.d.ts +2 -2
- package/dist/renders/blueprint-matcher.d.ts.map +1 -0
- package/dist/{session-mutations → renders}/blueprint-registry.d.ts +2 -2
- package/dist/renders/blueprint-registry.d.ts.map +1 -0
- package/dist/{session-mutations → renders}/blueprint-registry.js +1 -1
- package/dist/{session-mutations → renders}/cache-trace-sink.d.ts +2 -2
- package/dist/renders/cache-trace-sink.d.ts.map +1 -0
- package/dist/{session-mutations → renders}/cache-trace-sink.js +1 -1
- package/dist/{session-mutations → renders}/canvas-lifecycle.d.ts +5 -2
- package/dist/renders/canvas-lifecycle.d.ts.map +1 -0
- package/dist/renders/client-observations.d.ts.map +1 -0
- package/dist/{session-mutations → renders}/consume.d.ts +25 -21
- package/dist/renders/consume.d.ts.map +1 -0
- package/dist/{session-mutations → renders}/consume.js +119 -78
- package/dist/renders/errors.d.ts +96 -0
- package/dist/renders/errors.d.ts.map +1 -0
- package/dist/renders/errors.js +83 -0
- package/dist/renders/fetch-gadget-types.d.ts.map +1 -0
- package/dist/{session-mutations → renders}/generation-cache.d.ts +6 -6
- package/dist/renders/generation-cache.d.ts.map +1 -0
- package/dist/{session-mutations → renders}/generation-cache.js +1 -1
- package/dist/renders/get-render.d.ts +69 -0
- package/dist/renders/get-render.d.ts.map +1 -0
- package/dist/renders/get-render.js +134 -0
- package/dist/{session-mutations → renders}/handle-stream.d.ts +27 -34
- package/dist/renders/handle-stream.d.ts.map +1 -0
- package/dist/{session-mutations → renders}/handle-stream.js +13 -34
- package/dist/{session-mutations → renders}/handshake.d.ts +42 -130
- package/dist/renders/handshake.d.ts.map +1 -0
- package/dist/{session-mutations → renders}/handshake.js +35 -168
- package/dist/renders/index.d.ts +64 -0
- package/dist/renders/index.d.ts.map +1 -0
- package/dist/renders/index.js +72 -0
- package/dist/{session-mutations → renders}/install-to-cache.d.ts +1 -1
- package/dist/renders/install-to-cache.d.ts.map +1 -0
- package/dist/{session-mutations → renders}/install-to-cache.js +1 -1
- package/dist/renders/installed-blueprints-provider.d.ts.map +1 -0
- package/dist/renders/list-renders.d.ts +82 -0
- package/dist/renders/list-renders.d.ts.map +1 -0
- package/dist/renders/list-renders.js +124 -0
- package/dist/{session-mutations → renders}/no-credentials-card.d.ts +13 -11
- package/dist/renders/no-credentials-card.d.ts.map +1 -0
- package/dist/{session-mutations → renders}/no-credentials-card.js +11 -7
- package/dist/{session-mutations → renders}/payload-trace-sink.d.ts +8 -8
- package/dist/renders/payload-trace-sink.d.ts.map +1 -0
- package/dist/{session-mutations → renders}/payload-trace-sink.js +5 -5
- package/dist/{session-mutations → renders}/provisional-preview.d.ts +26 -33
- package/dist/renders/provisional-preview.d.ts.map +1 -0
- package/dist/{session-mutations → renders}/provisional-preview.js +15 -22
- package/dist/{session-mutations/refresh-bootstrap.d.ts → renders/refresh-ws-token.d.ts} +22 -17
- package/dist/renders/refresh-ws-token.d.ts.map +1 -0
- package/dist/{session-mutations/refresh-bootstrap.js → renders/refresh-ws-token.js} +23 -18
- package/dist/{session-mutations/push.d.ts → renders/render.d.ts} +253 -298
- package/dist/renders/render.d.ts.map +1 -0
- package/dist/renders/render.js +1650 -0
- package/dist/{session-mutations/bootstrap-meta-derivation.d.ts → renders/slice-meta-derivation.d.ts} +62 -64
- package/dist/renders/slice-meta-derivation.d.ts.map +1 -0
- package/dist/{session-mutations/bootstrap-meta-derivation.js → renders/slice-meta-derivation.js} +55 -46
- package/dist/{session-mutations → renders}/stream-replay-ops.d.ts +26 -26
- package/dist/renders/stream-replay-ops.d.ts.map +1 -0
- package/dist/{session-mutations → renders}/stream-replay-ops.js +35 -35
- package/dist/{session-mutations → renders}/stream.d.ts +12 -8
- package/dist/renders/stream.d.ts.map +1 -0
- package/dist/{session-mutations → renders}/stream.js +25 -18
- package/dist/{session-mutations → renders}/submit-action.d.ts +50 -23
- package/dist/renders/submit-action.d.ts.map +1 -0
- package/dist/{session-mutations → renders}/submit-action.js +66 -57
- package/dist/{session-mutations → renders}/sync-context.d.ts +17 -16
- package/dist/renders/sync-context.d.ts.map +1 -0
- package/dist/{session-mutations → renders}/sync-context.js +67 -76
- package/dist/{session-mutations → renders}/update.d.ts +89 -98
- package/dist/renders/update.d.ts.map +1 -0
- package/dist/renders/update.js +375 -0
- package/dist/types.d.ts +64 -31
- package/dist/types.d.ts.map +1 -1
- package/package.json +9 -9
- package/dist/contract-tests/push-handler.contract.d.ts +0 -31
- package/dist/contract-tests/push-handler.contract.d.ts.map +0 -1
- package/dist/contract-tests/push-handler.contract.js +0 -378
- package/dist/session-mutations/apply-stack-item-patch.d.ts +0 -79
- package/dist/session-mutations/apply-stack-item-patch.d.ts.map +0 -1
- package/dist/session-mutations/assert-action-contract.d.ts.map +0 -1
- package/dist/session-mutations/assert-contract-no-retired-fields.d.ts.map +0 -1
- package/dist/session-mutations/assert-event-allowed.d.ts +0 -29
- package/dist/session-mutations/assert-event-allowed.d.ts.map +0 -1
- package/dist/session-mutations/assert-event-allowed.js +0 -34
- package/dist/session-mutations/assert-gadgets.d.ts.map +0 -1
- package/dist/session-mutations/assert-generator.d.ts.map +0 -1
- package/dist/session-mutations/assert-no-duplicate-gadget-hooks.d.ts.map +0 -1
- package/dist/session-mutations/assert-props-contract.d.ts.map +0 -1
- package/dist/session-mutations/assert-public-env.d.ts.map +0 -1
- package/dist/session-mutations/assert-stream-contract.d.ts.map +0 -1
- package/dist/session-mutations/blueprint-matcher.d.ts.map +0 -1
- package/dist/session-mutations/blueprint-registry.d.ts.map +0 -1
- package/dist/session-mutations/bootstrap-meta-derivation.d.ts.map +0 -1
- package/dist/session-mutations/cache-trace-sink.d.ts.map +0 -1
- package/dist/session-mutations/canvas-lifecycle.d.ts.map +0 -1
- package/dist/session-mutations/client-observations.d.ts.map +0 -1
- package/dist/session-mutations/close.d.ts +0 -70
- package/dist/session-mutations/close.d.ts.map +0 -1
- package/dist/session-mutations/close.js +0 -127
- package/dist/session-mutations/consume.d.ts.map +0 -1
- package/dist/session-mutations/errors.d.ts +0 -180
- package/dist/session-mutations/errors.d.ts.map +0 -1
- package/dist/session-mutations/errors.js +0 -187
- package/dist/session-mutations/fetch-gadget-types.d.ts.map +0 -1
- package/dist/session-mutations/generation-cache.d.ts.map +0 -1
- package/dist/session-mutations/get-session.d.ts +0 -71
- package/dist/session-mutations/get-session.d.ts.map +0 -1
- package/dist/session-mutations/get-session.js +0 -153
- package/dist/session-mutations/get-stack.d.ts +0 -32
- package/dist/session-mutations/get-stack.d.ts.map +0 -1
- package/dist/session-mutations/get-stack.js +0 -85
- package/dist/session-mutations/handle-stream.d.ts.map +0 -1
- package/dist/session-mutations/handshake.d.ts.map +0 -1
- package/dist/session-mutations/index.d.ts +0 -85
- package/dist/session-mutations/index.d.ts.map +0 -1
- package/dist/session-mutations/index.js +0 -93
- package/dist/session-mutations/install-to-cache.d.ts.map +0 -1
- package/dist/session-mutations/installed-blueprints-provider.d.ts.map +0 -1
- package/dist/session-mutations/new-session.d.ts +0 -108
- package/dist/session-mutations/new-session.d.ts.map +0 -1
- package/dist/session-mutations/new-session.js +0 -248
- package/dist/session-mutations/no-credentials-card.d.ts.map +0 -1
- package/dist/session-mutations/payload-trace-sink.d.ts.map +0 -1
- package/dist/session-mutations/pop.d.ts +0 -41
- package/dist/session-mutations/pop.d.ts.map +0 -1
- package/dist/session-mutations/pop.js +0 -62
- package/dist/session-mutations/provisional-preview.d.ts.map +0 -1
- package/dist/session-mutations/push.d.ts.map +0 -1
- package/dist/session-mutations/push.js +0 -1942
- package/dist/session-mutations/refresh-bootstrap.d.ts.map +0 -1
- package/dist/session-mutations/stream-replay-ops.d.ts.map +0 -1
- package/dist/session-mutations/stream.d.ts.map +0 -1
- package/dist/session-mutations/submit-action.d.ts.map +0 -1
- package/dist/session-mutations/sync-context.d.ts.map +0 -1
- package/dist/session-mutations/update.d.ts.map +0 -1
- package/dist/session-mutations/update.js +0 -397
- /package/dist/{session-mutations → renders}/assert-action-contract.d.ts +0 -0
- /package/dist/{session-mutations → renders}/assert-action-contract.js +0 -0
- /package/dist/{session-mutations → renders}/assert-contract-no-retired-fields.d.ts +0 -0
- /package/dist/{session-mutations → renders}/assert-contract-no-retired-fields.js +0 -0
- /package/dist/{session-mutations → renders}/assert-no-duplicate-gadget-hooks.d.ts +0 -0
- /package/dist/{session-mutations → renders}/assert-no-duplicate-gadget-hooks.js +0 -0
- /package/dist/{session-mutations → renders}/assert-props-contract.d.ts +0 -0
- /package/dist/{session-mutations → renders}/assert-props-contract.js +0 -0
- /package/dist/{session-mutations → renders}/assert-public-env.d.ts +0 -0
- /package/dist/{session-mutations → renders}/assert-public-env.js +0 -0
- /package/dist/{session-mutations → renders}/assert-stream-contract.d.ts +0 -0
- /package/dist/{session-mutations → renders}/assert-stream-contract.js +0 -0
- /package/dist/{session-mutations → renders}/blueprint-matcher.js +0 -0
- /package/dist/{session-mutations → renders}/canvas-lifecycle.js +0 -0
- /package/dist/{session-mutations → renders}/client-observations.d.ts +0 -0
- /package/dist/{session-mutations → renders}/client-observations.js +0 -0
- /package/dist/{session-mutations → renders}/fetch-gadget-types.d.ts +0 -0
- /package/dist/{session-mutations → renders}/fetch-gadget-types.js +0 -0
- /package/dist/{session-mutations → renders}/installed-blueprints-provider.d.ts +0 -0
- /package/dist/{session-mutations → renders}/installed-blueprints-provider.js +0 -0
package/README.md
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
MCP tool handler logic for the **ggui protocol**.
|
|
4
4
|
|
|
5
|
-
This package implements the actual behavior behind every ggui MCP tool —
|
|
6
|
-
lifecycle, the contract handshake, UI
|
|
5
|
+
This package implements the actual behavior behind every ggui MCP tool — render
|
|
6
|
+
lifecycle, the contract handshake, UI emission, blueprint management, threads, app
|
|
7
7
|
discovery, and the operator (`ggui_ops_*`) tools. The handlers are written purely
|
|
8
8
|
over the seam interfaces in
|
|
9
9
|
[`@ggui-ai/mcp-server-core`](https://www.npmjs.com/package/@ggui-ai/mcp-server-core),
|
|
@@ -23,7 +23,7 @@ that determines which route it surfaces on and its wire-name prefix —
|
|
|
23
23
|
## Subpath exports
|
|
24
24
|
|
|
25
25
|
Handler families are also available behind subpath exports — for example
|
|
26
|
-
`@ggui-ai/mcp-server-handlers/blueprints`, `/
|
|
26
|
+
`@ggui-ai/mcp-server-handlers/blueprints`, `/renders`, `/threads`,
|
|
27
27
|
`/credits`, `/app-discovery`, and the `/ops-*` families — so consumers can import
|
|
28
28
|
exactly the family they need.
|
|
29
29
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Typed errors thrown by app-discovery handlers.
|
|
3
3
|
*
|
|
4
4
|
* Lives alongside the handlers (not in `@ggui-ai/protocol`) for the
|
|
5
|
-
* same reason `
|
|
5
|
+
* same reason `renders/errors.ts` does — these are
|
|
6
6
|
* handler-flow diagnostics, not contract-shape violations.
|
|
7
7
|
*/
|
|
8
8
|
/**
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Typed errors thrown by app-discovery handlers.
|
|
3
3
|
*
|
|
4
4
|
* Lives alongside the handlers (not in `@ggui-ai/protocol`) for the
|
|
5
|
-
* same reason `
|
|
5
|
+
* same reason `renders/errors.ts` does — these are
|
|
6
6
|
* handler-flow diagnostics, not contract-shape violations.
|
|
7
7
|
*/
|
|
8
8
|
/**
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
* app.
|
|
18
18
|
*/
|
|
19
19
|
export class AppAccessDeniedError extends Error {
|
|
20
|
-
code =
|
|
20
|
+
code = "app_access_denied";
|
|
21
21
|
constructor(message) {
|
|
22
22
|
super(message ??
|
|
23
|
-
|
|
24
|
-
this.name =
|
|
23
|
+
"app_access_denied: the supplied appId does not match the caller identity. Omit the appId field to default to the caller-resolved app, or invoke from a deployment whose auth resolves to the requested app.");
|
|
24
|
+
this.name = "AppAccessDeniedError";
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* ## Audience
|
|
21
21
|
*
|
|
22
22
|
* `['agent']` — registered on `/mcp`. Agent-callable anytime; pair
|
|
23
|
-
* with `
|
|
23
|
+
* with `ggui_render({themeId})` or `ggui_render({themeId})` to
|
|
24
24
|
* apply a chosen theme.
|
|
25
25
|
*/
|
|
26
26
|
import { z } from 'zod';
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* ## Audience
|
|
21
21
|
*
|
|
22
22
|
* `['agent']` — registered on `/mcp`. Agent-callable anytime; pair
|
|
23
|
-
* with `
|
|
23
|
+
* with `ggui_render({themeId})` or `ggui_render({themeId})` to
|
|
24
24
|
* apply a chosen theme.
|
|
25
25
|
*/
|
|
26
26
|
import { z } from 'zod';
|
|
@@ -55,7 +55,7 @@ export function createGguiListThemesHandler(deps) {
|
|
|
55
55
|
name: 'ggui_list_themes',
|
|
56
56
|
title: 'List themes',
|
|
57
57
|
audience: ['agent'],
|
|
58
|
-
description: "List visual themes the agent may apply to a
|
|
58
|
+
description: "List visual themes the agent may apply to a render via `ggui_render({themeId})`. Each entry carries an `id` (pass to themeId), `name` (human-readable), `description` (agent-readable: e.g. 'warm marketing palette', 'high-contrast scientific dashboard'), and `modes` (light/dark variants the theme ships). Call this when the user's intent suggests a visual style choice — pick the theme whose description best matches the requested aesthetic. Operator-scoped: returns the per-app allowlist when one is configured, otherwise the full registered catalog.",
|
|
59
59
|
inputSchema,
|
|
60
60
|
outputSchema,
|
|
61
61
|
async handler(rawInput, ctx) {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* ## Why the factory shape (vs. the old deprecation shim)
|
|
22
22
|
*
|
|
23
23
|
* The pre-2026-04-22 handler was a always-throws deprecation shim with
|
|
24
|
-
* the explanation "use
|
|
24
|
+
* the explanation "use ggui_render — the generator will render it". That
|
|
25
25
|
* collapsed the registered-blueprint path onto generation, which in
|
|
26
26
|
* turn required BYOK + an LLM round-trip even for authored UIs that
|
|
27
27
|
* were already fully compiled. This factory restores the direct path:
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* ## Why the factory shape (vs. the old deprecation shim)
|
|
22
22
|
*
|
|
23
23
|
* The pre-2026-04-22 handler was a always-throws deprecation shim with
|
|
24
|
-
* the explanation "use
|
|
24
|
+
* the explanation "use ggui_render — the generator will render it". That
|
|
25
25
|
* collapsed the registered-blueprint path onto generation, which in
|
|
26
26
|
* turn required BYOK + an LLM round-trip even for authored UIs that
|
|
27
27
|
* were already fully compiled. This factory restores the direct path:
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* add for this source.
|
|
16
16
|
*
|
|
17
17
|
* 2. **Semantic source** — the `VectorStore` / `EmbeddingProvider`
|
|
18
|
-
* pair. Covers prior `
|
|
18
|
+
* pair. Covers prior `ggui_render` cache entries + any other
|
|
19
19
|
* producer that has written into the scope. Continues to honor
|
|
20
20
|
* `MIN_SIMILARITY_SCORE`.
|
|
21
21
|
*
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* add for this source.
|
|
16
16
|
*
|
|
17
17
|
* 2. **Semantic source** — the `VectorStore` / `EmbeddingProvider`
|
|
18
|
-
* pair. Covers prior `
|
|
18
|
+
* pair. Covers prior `ggui_render` cache entries + any other
|
|
19
19
|
* producer that has written into the scope. Continues to honor
|
|
20
20
|
* `MIN_SIMILARITY_SCORE`.
|
|
21
21
|
*
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
* Cross-implementation contract test suites for
|
|
3
3
|
* `@ggui-ai/mcp-server-handlers` factories.
|
|
4
4
|
*
|
|
5
|
-
* Portable test batteries that any conforming
|
|
6
|
-
*
|
|
7
|
-
* recoverability invariants. Subpath import:
|
|
5
|
+
* Portable test batteries that any conforming handler deployment
|
|
6
|
+
* plugs into to prove wire-shape + recoverability invariants.
|
|
8
7
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
8
|
+
* **Post-Phase-B (flatten-render-identity) status.** The legacy
|
|
9
|
+
* push-handler contract battery (exercising the pre-rename push
|
|
10
|
+
* handler, with vessel+stack identity) has been deleted; the
|
|
11
|
+
* replacement render handler — `createGguiRenderHandler` (flat
|
|
12
|
+
* render identity) — does not yet have a portable contract suite.
|
|
13
|
+
* Per-deps unit tests in `../renders/*.test.ts` cover the
|
|
14
|
+
* behavioural invariants while the render-handler contract battery
|
|
15
|
+
* is being authored. Cloud pod adapters that previously consumed the
|
|
16
|
+
* push-handler suite need to be re-wired against the upcoming
|
|
17
|
+
* `runRenderHandlerContract` once it lands.
|
|
18
18
|
*/
|
|
19
|
-
export {
|
|
19
|
+
export {};
|
|
20
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contract-tests/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contract-tests/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,CAAC"}
|
|
@@ -1,19 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Cross-implementation contract test suites for
|
|
3
|
-
* `@ggui-ai/mcp-server-handlers` factories.
|
|
4
|
-
*
|
|
5
|
-
* Portable test batteries that any conforming push-handler / handshake-
|
|
6
|
-
* handler / etc. deployment plugs into to prove wire-shape +
|
|
7
|
-
* recoverability invariants. Subpath import:
|
|
8
|
-
*
|
|
9
|
-
* ```ts
|
|
10
|
-
* import { runPushHandlerContract } from
|
|
11
|
-
* '@ggui-ai/mcp-server-handlers/contract-tests';
|
|
12
|
-
* ```
|
|
13
|
-
*
|
|
14
|
-
* The in-memory invocation lives in `./push-handler.contract.test.ts`
|
|
15
|
-
* and runs in the standard test surface. Cloud and other
|
|
16
|
-
* adapter-backed deployments invoke the same suite from their own
|
|
17
|
-
* test files against their adapter-backed deps.
|
|
18
|
-
*/
|
|
19
|
-
export { runPushHandlerContract, } from './push-handler.contract.js';
|
|
1
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -13,16 +13,16 @@
|
|
|
13
13
|
* `@ggui-ai/mcp-server-handlers/blueprints`) to make it obvious when
|
|
14
14
|
* consumers are reaching for a specific family vs. the core contract.
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
19
|
-
export
|
|
20
|
-
export * from
|
|
21
|
-
export * from
|
|
22
|
-
export * from
|
|
23
|
-
export * from
|
|
24
|
-
export * from
|
|
25
|
-
export * from
|
|
26
|
-
export * from
|
|
27
|
-
export * from
|
|
16
|
+
export * from "./blueprints/index.js";
|
|
17
|
+
export * from "./renders/index.js";
|
|
18
|
+
export { AuthRequiredError } from "./types.js";
|
|
19
|
+
export type { AudienceTag, HandlerContext, SharedHandler } from "./types.js";
|
|
20
|
+
export * from "./threads/index.js";
|
|
21
|
+
export * from "./credits/index.js";
|
|
22
|
+
export * from "./app-discovery/index.js";
|
|
23
|
+
export * from "./ops-blueprint/index.js";
|
|
24
|
+
export * from "./ops-apps/index.js";
|
|
25
|
+
export * from "./ops-connector-keys/index.js";
|
|
26
|
+
export * from "./ops-coupon/index.js";
|
|
27
|
+
export * from "./ops-orgs/index.js";
|
|
28
28
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAI7E,cAAc,oBAAoB,CAAC;AAInC,cAAc,oBAAoB,CAAC;AAInC,cAAc,0BAA0B,CAAC;AAIzC,cAAc,0BAA0B,CAAC;AAMzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -13,31 +13,31 @@
|
|
|
13
13
|
* `@ggui-ai/mcp-server-handlers/blueprints`) to make it obvious when
|
|
14
14
|
* consumers are reaching for a specific family vs. the core contract.
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
17
|
-
export * from
|
|
18
|
-
export
|
|
16
|
+
export * from "./blueprints/index.js";
|
|
17
|
+
export * from "./renders/index.js";
|
|
18
|
+
export { AuthRequiredError } from "./types.js";
|
|
19
19
|
// Persistent-chat handler family — thread storage and message
|
|
20
20
|
// history MCP tools. Thin over @ggui-ai/mcp-server-core ThreadStore.
|
|
21
21
|
// Available under `@ggui-ai/mcp-server-handlers/threads` subpath too.
|
|
22
|
-
export * from
|
|
22
|
+
export * from "./threads/index.js";
|
|
23
23
|
// Credit handler family — read-only MCP tools for the prepaid
|
|
24
24
|
// credit system. Available under
|
|
25
25
|
// `@ggui-ai/mcp-server-handlers/credits` subpath too.
|
|
26
|
-
export * from
|
|
26
|
+
export * from "./credits/index.js";
|
|
27
27
|
// App-discovery handler family — per-app metadata lookups, including
|
|
28
28
|
// `ggui_list_gadgets`. Available under
|
|
29
29
|
// `@ggui-ai/mcp-server-handlers/app-discovery` subpath too.
|
|
30
|
-
export * from
|
|
30
|
+
export * from "./app-discovery/index.js";
|
|
31
31
|
// Operator-class blueprint handler family — `ggui_ops_*` tools
|
|
32
32
|
// served on the `/ops` route. Available under
|
|
33
33
|
// `@ggui-ai/mcp-server-handlers/ops-blueprint` subpath too.
|
|
34
|
-
export * from
|
|
34
|
+
export * from "./ops-blueprint/index.js";
|
|
35
35
|
// Operator-class apps, orgs, connector-keys, and coupon handler
|
|
36
36
|
// families — `ggui_ops_*` tools backing the console's management
|
|
37
37
|
// surfaces, each pure over a deps seam. Subpaths:
|
|
38
38
|
// `@ggui-ai/mcp-server-handlers/ops-apps`, `…/ops-orgs`,
|
|
39
39
|
// `…/ops-connector-keys`, `…/ops-coupon`.
|
|
40
|
-
export * from
|
|
41
|
-
export * from
|
|
42
|
-
export * from
|
|
43
|
-
export * from
|
|
40
|
+
export * from "./ops-apps/index.js";
|
|
41
|
+
export * from "./ops-connector-keys/index.js";
|
|
42
|
+
export * from "./ops-coupon/index.js";
|
|
43
|
+
export * from "./ops-orgs/index.js";
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* What the cloud adapter additionally does on top of this seam (NOT
|
|
10
10
|
* the responsibility of the handler):
|
|
11
11
|
* - Cascade-revoke per-app `GguiUserApiKey` rows
|
|
12
|
-
* - Cascade-clean per-app provider keys, blueprints,
|
|
12
|
+
* - Cascade-clean per-app provider keys, blueprints, renders
|
|
13
13
|
* The handler stays narrow; the adapter's `delete()` implementation
|
|
14
14
|
* orchestrates the cascade.
|
|
15
15
|
*
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* What the cloud adapter additionally does on top of this seam (NOT
|
|
10
10
|
* the responsibility of the handler):
|
|
11
11
|
* - Cascade-revoke per-app `GguiUserApiKey` rows
|
|
12
|
-
* - Cascade-clean per-app provider keys, blueprints,
|
|
12
|
+
* - Cascade-clean per-app provider keys, blueprints, renders
|
|
13
13
|
* The handler stays narrow; the adapter's `delete()` implementation
|
|
14
14
|
* orchestrates the cascade.
|
|
15
15
|
*
|
|
@@ -31,7 +31,7 @@ export function createDeleteAppHandler(deps) {
|
|
|
31
31
|
name: 'ggui_ops_delete_app',
|
|
32
32
|
title: 'Delete app',
|
|
33
33
|
audience: ['ops'],
|
|
34
|
-
description: "Hard-delete an app owned by the calling user. Idempotent — a second delete returns `{deleted: true}`. Cross-tenant probes return the same shape without touching foreign rows (no existence leak). Cascades per-app keys / blueprints /
|
|
34
|
+
description: "Hard-delete an app owned by the calling user. Idempotent — a second delete returns `{deleted: true}`. Cross-tenant probes return the same shape without touching foreign rows (no existence leak). Cascades per-app keys / blueprints / renders at the cloud adapter layer.",
|
|
35
35
|
inputSchema,
|
|
36
36
|
outputSchema,
|
|
37
37
|
async handler(rawInput, ctx) {
|
|
@@ -28,7 +28,7 @@ export function createSetDefaultAppHandler(deps) {
|
|
|
28
28
|
name: 'ggui_ops_set_default_app',
|
|
29
29
|
title: 'Set default app',
|
|
30
30
|
audience: ['ops'],
|
|
31
|
-
description: "Set the calling user's `defaultAppId` — the universal MCP route resolves this on every request to scope the
|
|
31
|
+
description: "Set the calling user's `defaultAppId` — the universal MCP route resolves this on every request to scope the call. Target appId MUST be owned by the caller; cross-tenant targets throw `app_not_found`. Returns the persisted `defaultAppId`.",
|
|
32
32
|
inputSchema,
|
|
33
33
|
outputSchema,
|
|
34
34
|
async handler(rawInput, ctx) {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Sibling of the console's Apps → System Prompt editor. Same column,
|
|
6
6
|
* MCP surface. Empty-string input clears the override (the pod's
|
|
7
|
-
* `
|
|
7
|
+
* `ggui_render` resolution chain falls back to the universal
|
|
8
8
|
* default when this field is absent or empty).
|
|
9
9
|
*
|
|
10
10
|
* Tenancy: cross-tenant probes throw `app_not_found` (uniform with
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Sibling of the console's Apps → System Prompt editor. Same column,
|
|
6
6
|
* MCP surface. Empty-string input clears the override (the pod's
|
|
7
|
-
* `
|
|
7
|
+
* `ggui_render` resolution chain falls back to the universal
|
|
8
8
|
* default when this field is absent or empty).
|
|
9
9
|
*
|
|
10
10
|
* Tenancy: cross-tenant probes throw `app_not_found` (uniform with
|
|
@@ -23,7 +23,7 @@ const inputSchema = {
|
|
|
23
23
|
systemPrompt: z
|
|
24
24
|
.string()
|
|
25
25
|
.max(10_000)
|
|
26
|
-
.describe("Replacement system-prompt text. Pass an empty string to clear the per-app override (
|
|
26
|
+
.describe("Replacement system-prompt text. Pass an empty string to clear the per-app override (renders then use the universal default). Cap 10k chars to bound the response payload + match a reasonable agent-authored prompt length."),
|
|
27
27
|
};
|
|
28
28
|
const outputSchema = {
|
|
29
29
|
appId: z.string(),
|
|
@@ -37,7 +37,7 @@ export function createUpdateAppSystemPromptHandler(deps) {
|
|
|
37
37
|
name: 'ggui_ops_update_app_system_prompt',
|
|
38
38
|
title: 'Update app system prompt',
|
|
39
39
|
audience: ['ops'],
|
|
40
|
-
description: "Set or clear the per-app system-prompt override on a `GguiApp` the caller owns. Empty-string clears the field — the pod's
|
|
40
|
+
description: "Set or clear the per-app system-prompt override on a `GguiApp` the caller owns. Empty-string clears the field — the pod's render resolution then falls back to the universal default. Cross-tenant targets throw `app_not_found`. Returns the updated row (10k char cap on input).",
|
|
41
41
|
inputSchema,
|
|
42
42
|
outputSchema,
|
|
43
43
|
async handler(rawInput, ctx) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Typed errors thrown by the operator-class blueprint handlers.
|
|
3
3
|
*
|
|
4
4
|
* Lives alongside the handlers (not in `@ggui-ai/protocol`) for the
|
|
5
|
-
* same reason `
|
|
5
|
+
* same reason `renders/errors.ts` does — these are
|
|
6
6
|
* handler-flow diagnostics, not contract-shape violations.
|
|
7
7
|
*
|
|
8
8
|
* `BlueprintNotFoundError` and `BlueprintAlreadyExistsError` are
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Typed errors thrown by the operator-class blueprint handlers.
|
|
3
3
|
*
|
|
4
4
|
* Lives alongside the handlers (not in `@ggui-ai/protocol`) for the
|
|
5
|
-
* same reason `
|
|
5
|
+
* same reason `renders/errors.ts` does — these are
|
|
6
6
|
* handler-flow diagnostics, not contract-shape violations.
|
|
7
7
|
*
|
|
8
8
|
* `BlueprintNotFoundError` and `BlueprintAlreadyExistsError` are
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
* before re-invoking.
|
|
24
24
|
*/
|
|
25
25
|
export class GeneratorNotFoundError extends Error {
|
|
26
|
-
code =
|
|
26
|
+
code = "generator_not_found";
|
|
27
27
|
constructor(slug, registeredSlugs) {
|
|
28
|
-
super(`generator_not_found: no generator registered under slug ${JSON.stringify(slug)}. Registered slugs: [${registeredSlugs.map((s) => JSON.stringify(s)).join(
|
|
29
|
-
this.name =
|
|
28
|
+
super(`generator_not_found: no generator registered under slug ${JSON.stringify(slug)}. Registered slugs: [${registeredSlugs.map((s) => JSON.stringify(s)).join(", ")}]. Omit the \`generator\` field to use the registry default, or register the missing generator before re-invoking.`);
|
|
29
|
+
this.name = "GeneratorNotFoundError";
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
@@ -41,11 +41,11 @@ export class GeneratorNotFoundError extends Error {
|
|
|
41
41
|
* whose `resolveLlm` dep returns a pool credential.
|
|
42
42
|
*/
|
|
43
43
|
export class MissingCredentialsError extends Error {
|
|
44
|
-
code =
|
|
44
|
+
code = "missing_credentials";
|
|
45
45
|
constructor(message) {
|
|
46
46
|
super(message ??
|
|
47
|
-
|
|
48
|
-
this.name =
|
|
47
|
+
"missing_credentials: no LLM provider credentials resolved for the caller. Set a BYOK provider key (`ggui_ops_set_provider_key`) before invoking generate, or run on a deployment whose `resolveLlm` dep returns a pool credential.");
|
|
48
|
+
this.name = "MissingCredentialsError";
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
@@ -55,11 +55,11 @@ export class MissingCredentialsError extends Error {
|
|
|
55
55
|
* which generator failed and why.
|
|
56
56
|
*/
|
|
57
57
|
export class GenerationFailedError extends Error {
|
|
58
|
-
code =
|
|
58
|
+
code = "generation_failed";
|
|
59
59
|
cause;
|
|
60
60
|
constructor(message, cause) {
|
|
61
61
|
super(`generation_failed: ${message}`);
|
|
62
|
-
this.name =
|
|
62
|
+
this.name = "GenerationFailedError";
|
|
63
63
|
this.cause = cause;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
@@ -37,19 +37,19 @@
|
|
|
37
37
|
*
|
|
38
38
|
* ## What this handler does NOT do
|
|
39
39
|
*
|
|
40
|
-
* -
|
|
41
|
-
*
|
|
40
|
+
* - Commit a render. No `renderId`, no commit into the render
|
|
41
|
+
* store. Pure registry mutation.
|
|
42
42
|
* - Pick a generator dynamically. Operator chooses; the LLM-driven
|
|
43
43
|
* selector layers above the registry, not below.
|
|
44
44
|
* - Validate the contract beyond Zod parsing. Schema-compat and
|
|
45
45
|
* hygiene linting run elsewhere; the operator path trusts the
|
|
46
46
|
* contract the operator paste-tested into the console.
|
|
47
47
|
*/
|
|
48
|
-
import {
|
|
49
|
-
import { type Blueprint, type DataContract, type OpsGenerateBlueprintOutput } from
|
|
50
|
-
import
|
|
51
|
-
import type
|
|
52
|
-
import {
|
|
48
|
+
import type { AppMetadataStore, BlueprintProvider, BlueprintStore, GeneratorRegistry, TelemetrySink } from "@ggui-ai/mcp-server-core";
|
|
49
|
+
import { type Blueprint, type DataContract, type OpsGenerateBlueprintOutput } from "@ggui-ai/protocol";
|
|
50
|
+
import { z } from "zod";
|
|
51
|
+
import { type BlueprintRegistryDeps, type GenerationCredentials } from "../renders/index.js";
|
|
52
|
+
import type { HandlerContext, SharedHandler } from "../types.js";
|
|
53
53
|
declare const opsInputSchema: {
|
|
54
54
|
contract: z.ZodType<import("@ggui-ai/protocol").DataContract, unknown, z.core.$ZodTypeInternals<import("@ggui-ai/protocol").DataContract, unknown>>;
|
|
55
55
|
generator: z.ZodOptional<z.ZodString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/ops-blueprint/generate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/ops-blueprint/generate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,aAAa,EAGd,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,YAAY,EAGjB,KAAK,0BAA0B,EAChC,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAQjE,QAAA,MAAM,cAAc;;;;;;;;CAAwC,CAAC;AAC7D,QAAA,MAAM,eAAe;;;;;CAKb,CAAC;AAET;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxD;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACrC;;;OAGG;IACH,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC;;;;;;;OAOG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,SAAS,EAAE,CAAC,CAAC;IAC1E;;;;;;;OAOG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IAC7C;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,EAAE,CACnB,GAAG,EAAE,cAAc,KAChB,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,GAAG,qBAAqB,GAAG,IAAI,CAAC;IAC1E;;;;OAIG;IACH,QAAQ,CAAC,UAAU,EAAE,iBAAiB,CAAC;IACvC;;;;;;OAMG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC;IAC/B;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,qBAAqB,CAAC;IAC/C;;;;OAIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,aAAa,CAAC;IACnC;;;OAGG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,MAAM,CAAC;CACzC;AAmCD,wBAAgB,qCAAqC,CACnD,IAAI,EAAE,4BAA4B,GACjC,aAAa,CAAC,OAAO,cAAc,EAAE,OAAO,eAAe,EAAE,0BAA0B,CAAC,CAqO1F"}
|