@ggui-ai/protocol-conformance 0.14.0 → 0.16.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/README.md +33 -16
- package/dist/cli.d.ts +27 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +269 -23
- package/dist/domain-error-conformance/cases/amend-unknown-session.json +9 -0
- package/dist/domain-error-conformance/cases/consume-unknown-session.json +9 -0
- package/dist/domain-error-conformance/cases/emit-unknown-session.json +9 -0
- package/dist/domain-error-conformance/cases/get-session-unknown-session.json +6 -0
- package/dist/domain-error-conformance/cases/render-unknown-handshake.json +6 -0
- package/dist/domain-error-conformance/cases/update-unknown-session.json +9 -0
- package/dist/domain-error-conformance/index.d.ts +97 -0
- package/dist/domain-error-conformance/index.d.ts.map +1 -0
- package/dist/domain-error-conformance/index.js +97 -0
- package/dist/fixtures/index.d.ts +8 -6
- package/dist/fixtures/index.d.ts.map +1 -1
- package/dist/fixtures/index.js +9 -7
- package/dist/fixtures/{subscribe-tenancy → subscribe-app-scope}/absent-appid-defaults.json +1 -1
- package/dist/fixtures/{subscribe-tenancy → subscribe-app-scope}/app-mismatch.json +1 -1
- package/dist/fixtures/subscribe-app-scope/index.d.ts +6 -0
- package/dist/fixtures/subscribe-app-scope/index.d.ts.map +1 -0
- package/dist/fixtures/{subscribe-tenancy → subscribe-app-scope}/index.js +5 -5
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -1
- package/dist/json-equal.d.ts +6 -0
- package/dist/json-equal.d.ts.map +1 -0
- package/dist/json-equal.js +23 -0
- package/dist/refusal-envelope-conformance/cases/refuse-after-fix-caller.json +3 -3
- package/dist/refusal-envelope-conformance/cases/refuse-non-render-surface.json +4 -4
- package/dist/refusal-envelope-conformance/index.d.ts.map +1 -1
- package/dist/refusal-envelope-conformance/index.js +1 -20
- package/dist/run-conformance.d.ts +22 -3
- package/dist/run-conformance.d.ts.map +1 -1
- package/dist/run-conformance.js +86 -9
- package/dist/theme-binding-conformance/cases/app-theme-v1-base.json +18 -0
- package/dist/theme-binding-conformance/cases/app-theme-v1-one-palette.json +11 -0
- package/dist/theme-binding-conformance/cases/app-theme-v2-accepted.json +18 -0
- package/dist/theme-binding-conformance/cases/app-theme-v2-keyframes-accepted.json +16 -0
- package/dist/theme-binding-conformance/cases/app-theme-v2-keyframes-not-keyframes.json +15 -0
- package/dist/theme-binding-conformance/cases/app-theme-v2-label-too-long.json +17 -0
- package/dist/theme-binding-conformance/cases/app-theme-v2-missing-dark.json +13 -0
- package/dist/theme-binding-conformance/cases/app-theme-v2-no-hash.json +15 -0
- package/dist/theme-binding-conformance/cases/app-theme-v2-platform-pin.json +17 -0
- package/dist/theme-binding-conformance/cases/overlay-hash-canonical.json +17 -0
- package/dist/theme-binding-conformance/cases/theme-mode-absence.json +10 -0
- package/dist/theme-binding-conformance/cases/theme-mode-default-when-silent-host.json +10 -0
- package/dist/theme-binding-conformance/cases/theme-mode-order.json +10 -0
- package/dist/theme-binding-conformance/index.d.ts +59 -0
- package/dist/theme-binding-conformance/index.d.ts.map +1 -0
- package/dist/theme-binding-conformance/index.js +110 -0
- package/dist/transport-refusal-conformance/cases/refuse-deprovisioned-endpoint.json +27 -0
- package/dist/transport-refusal-conformance/cases/refuse-render-only-code.json +12 -0
- package/dist/transport-refusal-conformance/index.d.ts +56 -0
- package/dist/transport-refusal-conformance/index.d.ts.map +1 -0
- package/dist/transport-refusal-conformance/index.js +52 -0
- package/dist/types.d.ts +1 -1
- package/package.json +18 -3
- package/dist/fixtures/subscribe-tenancy/index.d.ts +0 -6
- package/dist/fixtures/subscribe-tenancy/index.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/transport-refusal-conformance/index.ts"],"names":[],"mappings":"AAyBA;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB;IACpC,+BAA+B;IAC/B,QAA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wBAAwB,EAAE,CAAC;CACtD;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,CAAC,OAAO,EAAE,qBAAqB,KAAK,yBAAyB,GAAG,IAAI,GAC5E,iCAAiC,CAiBnC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transport-refusal conformance catalog (ggui#825) — grades a deployment's
|
|
3
|
+
* PER-APP ENDPOINT refusal projector: the function that turns a registry
|
|
4
|
+
* refusal into the JSON-RPC error a per-app MCP endpoint answers with when
|
|
5
|
+
* it refuses a request for a typed reason, on ANY method (`initialize`
|
|
6
|
+
* included).
|
|
7
|
+
*
|
|
8
|
+
* The contract it makes observable: a deprovisioned app answers HTTP 403
|
|
9
|
+
* with `{ code: -32003, message: "App not found", data: { refusal } }` where
|
|
10
|
+
* `refusal` is the registry projection without the render-only fields
|
|
11
|
+
* (`code`, `message`, `fix`, `retry`, `appId`); an authorization failure that is
|
|
12
|
+
* NOT a registry state answers 403 with `-32007` and no `data` — the untyped
|
|
13
|
+
* arms deliberately indistinguishable among themselves, so a client never
|
|
14
|
+
* learns which one it hit (codes ruled in ggui#836).
|
|
15
|
+
*
|
|
16
|
+
* Each case ships as raw JSON under `./cases/`. The kit never imports a
|
|
17
|
+
* concrete server: the adopter supplies the projector, the catalog grades
|
|
18
|
+
* it, and a code whose `surfaces` exclude `mcp-endpoint` must project to
|
|
19
|
+
* `null` (no transport envelope exists for it).
|
|
20
|
+
*/
|
|
21
|
+
import refuseDeprovisionedEndpoint from './cases/refuse-deprovisioned-endpoint.json' with { type: 'json' };
|
|
22
|
+
import refuseRenderOnlyCode from './cases/refuse-render-only-code.json' with { type: 'json' };
|
|
23
|
+
import { jsonEqual } from '../json-equal.js';
|
|
24
|
+
export const transportRefusalCases = [
|
|
25
|
+
refuseDeprovisionedEndpoint,
|
|
26
|
+
refuseRenderOnlyCode,
|
|
27
|
+
];
|
|
28
|
+
/**
|
|
29
|
+
* Grade a per-app endpoint refusal projector against the catalog. Pure
|
|
30
|
+
* and synchronous: no server, no transport — the deterministic
|
|
31
|
+
* projection is the whole obligation.
|
|
32
|
+
*/
|
|
33
|
+
export function runTransportRefusalConformance(project) {
|
|
34
|
+
const passed = [];
|
|
35
|
+
const failed = [];
|
|
36
|
+
for (const testCase of transportRefusalCases) {
|
|
37
|
+
let actual;
|
|
38
|
+
try {
|
|
39
|
+
actual = project(testCase.refusal);
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
actual = error instanceof Error ? error.message : String(error);
|
|
43
|
+
}
|
|
44
|
+
if (typeof actual !== 'string' && jsonEqual(actual, testCase.expect)) {
|
|
45
|
+
passed.push(testCase.name);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
failed.push({ name: testCase.name, expected: testCase.expect, actual });
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return { passed, failed };
|
|
52
|
+
}
|
package/dist/types.d.ts
CHANGED
|
@@ -167,7 +167,7 @@ export interface CreateGguiSessionStep {
|
|
|
167
167
|
/** Opaque render id the host allocates. Downstream steps + the
|
|
168
168
|
* fixture's `inputEnvelope` reference it by value. */
|
|
169
169
|
readonly sessionId: string;
|
|
170
|
-
/** Optional app
|
|
170
|
+
/** Optional app id the render scopes to. Defaults to the
|
|
171
171
|
* host's implementation-defined "default app". */
|
|
172
172
|
readonly appId?: string;
|
|
173
173
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ggui-ai/protocol-conformance",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Conformance test kit for the ggui protocol. Drives a behavioral fixture catalog against a live implementation over WebSocket, a resources/read catalog against a live MCP server, and
|
|
3
|
+
"version": "0.16.0",
|
|
4
|
+
"description": "Conformance test kit for the ggui protocol. Drives a behavioral fixture catalog against a live implementation over WebSocket, a resources/read catalog against a live MCP server, and nine pure-function catalogs (schema, registration, resolution, binding, props-schema, host-helper, refusal-envelope, registry-completeness, transport-refusal) for the gadget, tool-binding, schema-precise-render, host-helper and pre-generation-refusal obligations, reporting a scorecard-style pass / fail / skip. MCP builders adopt this kit to prove their implementation is protocol-conformant.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"ggui",
|
|
@@ -51,6 +51,11 @@
|
|
|
51
51
|
"import": "./dist/resource-read-conformance/index.js",
|
|
52
52
|
"default": "./dist/resource-read-conformance/index.js"
|
|
53
53
|
},
|
|
54
|
+
"./theme-binding-conformance": {
|
|
55
|
+
"types": "./dist/theme-binding-conformance/index.d.ts",
|
|
56
|
+
"import": "./dist/theme-binding-conformance/index.js",
|
|
57
|
+
"default": "./dist/theme-binding-conformance/index.js"
|
|
58
|
+
},
|
|
54
59
|
"./binding-conformance": {
|
|
55
60
|
"types": "./dist/binding-conformance/index.d.ts",
|
|
56
61
|
"import": "./dist/binding-conformance/index.js",
|
|
@@ -71,15 +76,25 @@
|
|
|
71
76
|
"import": "./dist/refusal-envelope-conformance/index.js",
|
|
72
77
|
"default": "./dist/refusal-envelope-conformance/index.js"
|
|
73
78
|
},
|
|
79
|
+
"./domain-error-conformance": {
|
|
80
|
+
"types": "./dist/domain-error-conformance/index.d.ts",
|
|
81
|
+
"import": "./dist/domain-error-conformance/index.js",
|
|
82
|
+
"default": "./dist/domain-error-conformance/index.js"
|
|
83
|
+
},
|
|
74
84
|
"./registry-completeness": {
|
|
75
85
|
"types": "./dist/registry-completeness/index.d.ts",
|
|
76
86
|
"import": "./dist/registry-completeness/index.js",
|
|
77
87
|
"default": "./dist/registry-completeness/index.js"
|
|
88
|
+
},
|
|
89
|
+
"./transport-refusal-conformance": {
|
|
90
|
+
"types": "./dist/transport-refusal-conformance/index.d.ts",
|
|
91
|
+
"import": "./dist/transport-refusal-conformance/index.js",
|
|
92
|
+
"default": "./dist/transport-refusal-conformance/index.js"
|
|
78
93
|
}
|
|
79
94
|
},
|
|
80
95
|
"dependencies": {
|
|
81
96
|
"ws": "^8.20.1",
|
|
82
|
-
"@ggui-ai/protocol": "0.
|
|
97
|
+
"@ggui-ai/protocol": "0.16.0"
|
|
83
98
|
},
|
|
84
99
|
"devDependencies": {
|
|
85
100
|
"@types/node": "^22.0.0",
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { TestCase } from '../../types.js';
|
|
2
|
-
/** All fixtures asserting subscribe-time tenancy (SPEC §12.2 field
|
|
3
|
-
* table — identity-default resolution on absent `appId` — and
|
|
4
|
-
* §12.2.3 `APP_MISMATCH`). */
|
|
5
|
-
export declare const subscribeTenancyFixtures: readonly TestCase[];
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fixtures/subscribe-tenancy/index.ts"],"names":[],"mappings":"AAwDA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C;;+BAE+B;AAC/B,eAAO,MAAM,wBAAwB,EAAE,SAAS,QAAQ,EAGvD,CAAC"}
|