@ggui-ai/mcp-server-handlers 0.6.2 → 0.7.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/ops-apps/delete-app.d.ts +26 -9
- package/dist/ops-apps/delete-app.d.ts.map +1 -1
- package/dist/ops-apps/delete-app.js +34 -11
- package/dist/ops-apps/index.d.ts +1 -1
- package/dist/ops-apps/index.d.ts.map +1 -1
- package/dist/ops-apps/index.js +1 -1
- package/dist/ops-apps/types.d.ts +32 -1
- package/dist/ops-apps/types.d.ts.map +1 -1
- package/dist/ops-apps/types.js +16 -0
- package/dist/ops-blueprint/generate.d.ts.map +1 -1
- package/dist/ops-blueprint/generate.js +6 -2
- package/dist/ops-blueprint/register.d.ts.map +1 -1
- package/dist/ops-blueprint/register.js +7 -2
- package/dist/ops-connector-keys/types.d.ts +7 -0
- package/dist/ops-connector-keys/types.d.ts.map +1 -1
- package/dist/renders/blueprint-durability.d.ts +111 -0
- package/dist/renders/blueprint-durability.d.ts.map +1 -0
- package/dist/renders/blueprint-durability.js +85 -0
- package/dist/renders/blueprint-registry.d.ts +24 -0
- package/dist/renders/blueprint-registry.d.ts.map +1 -1
- package/dist/renders/blueprint-registry.js +9 -0
- package/dist/renders/code-delivery-events.d.ts +76 -0
- package/dist/renders/code-delivery-events.d.ts.map +1 -0
- package/dist/renders/code-delivery-events.js +60 -0
- package/dist/renders/fetch-gadget-types.d.ts +7 -3
- package/dist/renders/fetch-gadget-types.d.ts.map +1 -1
- package/dist/renders/fetch-gadget-types.js +7 -3
- package/dist/renders/generation-cache.d.ts +9 -0
- package/dist/renders/generation-cache.d.ts.map +1 -1
- package/dist/renders/handshake.d.ts +5 -3
- package/dist/renders/handshake.d.ts.map +1 -1
- package/dist/renders/handshake.js +9 -4
- package/dist/renders/index.d.ts +3 -0
- package/dist/renders/index.d.ts.map +1 -1
- package/dist/renders/index.js +13 -0
- package/dist/renders/render-identity.d.ts +178 -0
- package/dist/renders/render-identity.d.ts.map +1 -0
- package/dist/renders/render-identity.js +136 -0
- package/dist/renders/render.d.ts +39 -5
- package/dist/renders/render.d.ts.map +1 -1
- package/dist/renders/render.js +198 -83
- package/dist/renders/sync-context.d.ts +13 -1
- package/dist/renders/sync-context.d.ts.map +1 -1
- package/dist/renders/sync-context.js +6 -1
- package/dist/renders/update.d.ts +15 -1
- package/dist/renders/update.d.ts.map +1 -1
- package/dist/renders/update.js +6 -1
- package/package.json +7 -7
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
*/
|
|
54
54
|
import { z } from 'zod';
|
|
55
55
|
import { CONTEXT_SLOT_VALUE_MAX_BYTES, CONTEXT_SNAPSHOT_MAX_BYTES, CONTEXT_SNAPSHOT_MAX_SLOTS, jsonValueSchema, validateContextData, } from '@ggui-ai/protocol';
|
|
56
|
+
import { refreshRenderIdentity } from './render-identity.js';
|
|
56
57
|
const inputSchema = {
|
|
57
58
|
sessionId: z
|
|
58
59
|
.string()
|
|
@@ -184,7 +185,7 @@ export function createGguiSyncContextHandler(deps) {
|
|
|
184
185
|
...stored.render,
|
|
185
186
|
contextSnapshot: snapshot,
|
|
186
187
|
};
|
|
187
|
-
await deps.renderStore.commit({
|
|
188
|
+
const committed = await deps.renderStore.commit({
|
|
188
189
|
render: updated,
|
|
189
190
|
appId: stored.appId,
|
|
190
191
|
...(stored.userId !== undefined ? { userId: stored.userId } : {}),
|
|
@@ -196,6 +197,10 @@ export function createGguiSyncContextHandler(deps) {
|
|
|
196
197
|
? { hostSession: stored.hostSession }
|
|
197
198
|
: {}),
|
|
198
199
|
});
|
|
200
|
+
// Keep the durable identity record's view of this row current.
|
|
201
|
+
// Reads the row the commit RETURNED so the record can't disagree
|
|
202
|
+
// with what was persisted.
|
|
203
|
+
await refreshRenderIdentity(deps.renderIdentityStore, committed);
|
|
199
204
|
return { ok: true };
|
|
200
205
|
},
|
|
201
206
|
};
|
package/dist/renders/update.d.ts
CHANGED
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
*/
|
|
63
63
|
import { z } from 'zod';
|
|
64
64
|
import { ContractViolationError, type JsonObject } from '@ggui-ai/protocol';
|
|
65
|
-
import type { GguiSessionStore } from '@ggui-ai/mcp-server-core';
|
|
65
|
+
import type { GguiSessionStore, RenderIdentityStore } from '@ggui-ai/mcp-server-core';
|
|
66
66
|
import type { HandlerContext, SharedHandler } from '../types.js';
|
|
67
67
|
import { type RenderSliceMetaDeps } from './slice-meta-derivation.js';
|
|
68
68
|
import { GguiSessionNotFoundError } from './errors.js';
|
|
@@ -134,6 +134,20 @@ export interface BillingGate {
|
|
|
134
134
|
export interface GguiUpdateHandlerDeps extends RenderSliceMetaDeps {
|
|
135
135
|
/** GguiSession-backing store. Used to load + persist the patched render. */
|
|
136
136
|
readonly renderStore: GguiSessionStore;
|
|
137
|
+
/**
|
|
138
|
+
* Durable render-identity side store. When present, a successful
|
|
139
|
+
* patch refreshes the existing record's view of the row it just
|
|
140
|
+
* re-committed — props, the sequence at that commit, and the
|
|
141
|
+
* freshness stamp. The identity itself (`blueprintId`,
|
|
142
|
+
* `contractKey`, `variantKey`) is carried forward untouched; this
|
|
143
|
+
* tool never sees the agreed contract those keys were derived from,
|
|
144
|
+
* so it is in no position to recompute them.
|
|
145
|
+
*
|
|
146
|
+
* A render with no record yet (store wired after it was rendered) is
|
|
147
|
+
* skipped, not synthesized. Writes are best-effort and can never
|
|
148
|
+
* fail the patch. Absent = no refresh, everything else unchanged.
|
|
149
|
+
*/
|
|
150
|
+
readonly renderIdentityStore?: RenderIdentityStore;
|
|
137
151
|
/**
|
|
138
152
|
* Optional live-subscriber notifier. When present, every successful
|
|
139
153
|
* persistence fans a `{type:'props_update', payload:{sessionId, props}}`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/renders/update.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;IAChE,4EAA4E;IAC5E,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC;IACvC;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IACnD;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IACnD;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC;IACnC;;;;OAIG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAO/B;AAED;;;;;;;;;GASG;AACH,QAAA,MAAM,WAAW;IACf;;;;;OAKG;;IAEH;;;;OAIG;;;;;IAEH;;;;OAIG;;IAEH;;;;;OAKG;;CAEK,CAAC;AAEX,QAAA,MAAM,YAAY;;;IAGhB;;;;;;;;;OASG;;CAEK,CAAC;AAEX,UAAU,YAAY;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,qBAAqB,GAC1B,aAAa,CAAC,OAAO,WAAW,EAAE,OAAO,YAAY,EAAE,YAAY,CAAC,CAsRtE"}
|
package/dist/renders/update.js
CHANGED
|
@@ -63,6 +63,7 @@
|
|
|
63
63
|
import { z } from 'zod';
|
|
64
64
|
import { ContractViolationError, } from '@ggui-ai/protocol';
|
|
65
65
|
import { GGUI_RENDER_UI_META, toMcpAppEnvelope, } from '@ggui-ai/protocol/integrations/mcp-apps';
|
|
66
|
+
import { refreshRenderIdentity } from './render-identity.js';
|
|
66
67
|
import { applyGguiSessionPatch, } from './apply-ggui-session-patch.js';
|
|
67
68
|
import { assembleRenderSliceBase, deriveRenderMeta, } from './slice-meta-derivation.js';
|
|
68
69
|
import { GguiSessionNotFoundError } from './errors.js';
|
|
@@ -254,7 +255,7 @@ export function createGguiUpdateHandler(deps) {
|
|
|
254
255
|
// replaces visible-bits in place. Lifecycle fields owned by the
|
|
255
256
|
// store (createdAt, eventSequence, hostSession) preserved across
|
|
256
257
|
// the upsert.
|
|
257
|
-
await deps.renderStore.commit({
|
|
258
|
+
const committed = await deps.renderStore.commit({
|
|
258
259
|
render: updatedSession,
|
|
259
260
|
appId: stored.appId,
|
|
260
261
|
...(stored.userId !== undefined ? { userId: stored.userId } : {}),
|
|
@@ -266,6 +267,10 @@ export function createGguiUpdateHandler(deps) {
|
|
|
266
267
|
? { hostSession: stored.hostSession }
|
|
267
268
|
: {}),
|
|
268
269
|
});
|
|
270
|
+
// Keep the durable identity record's view of this row current.
|
|
271
|
+
// Reads the row the commit RETURNED so the record can't disagree
|
|
272
|
+
// with what was persisted.
|
|
273
|
+
await refreshRenderIdentity(deps.renderIdentityStore, committed);
|
|
269
274
|
// Best-effort live delivery. Persistence is the source of truth;
|
|
270
275
|
// the live-channel fan-out is a latency optimization. Errors are
|
|
271
276
|
// swallowed — a failed notify must not fail the tool call (the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ggui-ai/mcp-server-handlers",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "MCP tool handler logic for the ggui protocol. Pure over @ggui-ai/mcp-server-core seams and consumed by @ggui-ai/mcp-server. Never imports AWS, HTTP transports, or CLI concerns.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ggui",
|
|
@@ -69,17 +69,17 @@
|
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
71
|
"zod": "^4.3.6",
|
|
72
|
-
"@ggui-ai/mcp-server-core": "0.
|
|
73
|
-
"@ggui-ai/negotiator": "0.
|
|
74
|
-
"@ggui-ai/protocol": "0.
|
|
75
|
-
"@ggui-ai/ui-
|
|
76
|
-
"@ggui-ai/ui-
|
|
72
|
+
"@ggui-ai/mcp-server-core": "0.7.0",
|
|
73
|
+
"@ggui-ai/negotiator": "0.7.0",
|
|
74
|
+
"@ggui-ai/protocol": "0.7.0",
|
|
75
|
+
"@ggui-ai/ui-gen": "0.7.0",
|
|
76
|
+
"@ggui-ai/ui-registry": "0.7.0"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
79
|
"@types/node": "^22.0.0",
|
|
80
80
|
"typescript": "^5.0.0",
|
|
81
81
|
"vitest": "^3.2.6",
|
|
82
|
-
"@ggui-ai/protocol-conformance": "0.
|
|
82
|
+
"@ggui-ai/protocol-conformance": "0.7.0"
|
|
83
83
|
},
|
|
84
84
|
"repository": {
|
|
85
85
|
"type": "git",
|