@kumwe/studio-protocol 0.1.0-alpha.4 → 0.1.0-alpha.5
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/guards.d.ts.map +1 -1
- package/dist/guards.js +44 -0
- package/dist/guards.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/schemas.d.ts +7 -0
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +21 -0
- package/dist/schemas.js.map +1 -1
- package/dist/types.d.ts +69 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/schemas/canonical-vector.schema.json +65 -0
- package/schemas/corpus-manifest.schema.json +48 -0
- package/schemas/field-adapter.schema.json +51 -0
- package/schemas/host-capabilities.schema.json +3 -2
- package/schemas/host-operations.schema.json +162 -0
- package/schemas/host-request.schema.json +71 -0
- package/schemas/host-result.schema.json +19 -0
- package/schemas/host-vector.schema.json +197 -0
- package/schemas/inspector.schema.json +44 -0
- package/schemas/manifest.json +47 -2
- package/schemas/media-upload-grant.schema.json +48 -0
- package/schemas/preview-message.schema.json +385 -60
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.kumwe.org/studio/v1/corpus-manifest.schema.json",
|
|
4
|
+
"title": "Studio corpus integrity manifest",
|
|
5
|
+
"description": "The digest of every file in the published conformance corpus, grouped by the directory it ships in. A host that vendors the corpus verifies its copy against this manifest, so a stale or altered fixture is detected before it silently changes what a conformance claim means. The schema manifest covers the schemas; this covers everything replayed against them.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["contractVersion", "kind", "groups"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"contractVersion": { "$ref": "common.schema.json#/$defs/contractVersion" },
|
|
11
|
+
"kind": { "const": "corpus-manifest" },
|
|
12
|
+
"groups": {
|
|
13
|
+
"type": "array",
|
|
14
|
+
"minItems": 1,
|
|
15
|
+
"maxItems": 50,
|
|
16
|
+
"items": {
|
|
17
|
+
"type": "object",
|
|
18
|
+
"additionalProperties": false,
|
|
19
|
+
"required": ["files", "group", "path"],
|
|
20
|
+
"properties": {
|
|
21
|
+
"files": {
|
|
22
|
+
"type": "array",
|
|
23
|
+
"maxItems": 5000,
|
|
24
|
+
"items": {
|
|
25
|
+
"type": "object",
|
|
26
|
+
"additionalProperties": false,
|
|
27
|
+
"required": ["digest", "file"],
|
|
28
|
+
"properties": {
|
|
29
|
+
"digest": { "$ref": "common.schema.json#/$defs/integrity" },
|
|
30
|
+
"file": { "type": "string", "minLength": 1, "maxLength": 200 }
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"group": {
|
|
35
|
+
"description": "The stable name of the corpus group.",
|
|
36
|
+
"$ref": "common.schema.json#/$defs/localName"
|
|
37
|
+
},
|
|
38
|
+
"path": {
|
|
39
|
+
"description": "The package-relative directory the group ships in.",
|
|
40
|
+
"type": "string",
|
|
41
|
+
"minLength": 1,
|
|
42
|
+
"maxLength": 200
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.kumwe.org/studio/v1/field-adapter.schema.json",
|
|
4
|
+
"title": "Studio field adapter contribution",
|
|
5
|
+
"description": "The declarative payload behind a `field-adapter` plugin contribution: a control an extension offers for editing a declared field kind. The declaration is inert data - it names the control, the field kinds it accepts, the capability its executable half requires, and the bounded option schema an author configures it through. It never carries markup, styles or code.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": [
|
|
9
|
+
"contractVersion",
|
|
10
|
+
"kind",
|
|
11
|
+
"id",
|
|
12
|
+
"version",
|
|
13
|
+
"owner",
|
|
14
|
+
"label",
|
|
15
|
+
"control",
|
|
16
|
+
"fieldKinds"
|
|
17
|
+
],
|
|
18
|
+
"properties": {
|
|
19
|
+
"contractVersion": { "$ref": "common.schema.json#/$defs/contractVersion" },
|
|
20
|
+
"kind": { "const": "field-adapter" },
|
|
21
|
+
"id": { "$ref": "common.schema.json#/$defs/qualifiedName" },
|
|
22
|
+
"version": { "$ref": "common.schema.json#/$defs/semanticVersion" },
|
|
23
|
+
"owner": { "$ref": "common.schema.json#/$defs/ownerReference" },
|
|
24
|
+
"label": { "$ref": "common.schema.json#/$defs/messageReference" },
|
|
25
|
+
"description": { "$ref": "common.schema.json#/$defs/messageReference" },
|
|
26
|
+
"control": {
|
|
27
|
+
"description": "The control identifier a field's authoring metadata names to select this adapter.",
|
|
28
|
+
"$ref": "common.schema.json#/$defs/qualifiedName"
|
|
29
|
+
},
|
|
30
|
+
"fieldKinds": {
|
|
31
|
+
"description": "The field kinds this control accepts. A field of any other kind never resolves to it.",
|
|
32
|
+
"type": "array",
|
|
33
|
+
"minItems": 1,
|
|
34
|
+
"maxItems": 50,
|
|
35
|
+
"uniqueItems": true,
|
|
36
|
+
"items": { "$ref": "common.schema.json#/$defs/qualifiedName" }
|
|
37
|
+
},
|
|
38
|
+
"optionSchema": {
|
|
39
|
+
"description": "The bounded schema an author's control options validate against, inside the Studio Schema Profile exactly like a contributed block's property schema.",
|
|
40
|
+
"type": "object",
|
|
41
|
+
"maxProperties": 100,
|
|
42
|
+
"propertyNames": { "$ref": "common.schema.json#/$defs/safeJsonMemberName" },
|
|
43
|
+
"additionalProperties": { "$ref": "common.schema.json#/$defs/jsonValue" }
|
|
44
|
+
},
|
|
45
|
+
"requiredCapability": {
|
|
46
|
+
"description": "The capability the executable half requires. A declaration without one is inspectable but never executed.",
|
|
47
|
+
"$ref": "common.schema.json#/$defs/qualifiedName"
|
|
48
|
+
},
|
|
49
|
+
"extensions": { "$ref": "common.schema.json#/$defs/extensions" }
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -33,14 +33,15 @@
|
|
|
33
33
|
"additionalProperties": false,
|
|
34
34
|
"required": ["id", "version", "operations"],
|
|
35
35
|
"properties": {
|
|
36
|
-
"id": { "$ref": "
|
|
36
|
+
"id": { "$ref": "host-operations.schema.json#/$defs/portCapability" },
|
|
37
37
|
"version": { "$ref": "common.schema.json#/$defs/semanticVersion" },
|
|
38
38
|
"operations": {
|
|
39
|
+
"description": "The operations this host actually implements, closed by the operation registry so a capability document cannot advertise an operation that is not on the wire.",
|
|
39
40
|
"type": "array",
|
|
40
41
|
"minItems": 1,
|
|
41
42
|
"maxItems": 100,
|
|
42
43
|
"uniqueItems": true,
|
|
43
|
-
"items": { "$ref": "
|
|
44
|
+
"items": { "$ref": "host-operations.schema.json#/$defs/operationCapability" }
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.kumwe.org/studio/v1/host-operations.schema.json",
|
|
4
|
+
"title": "Studio host port operation registry",
|
|
5
|
+
"description": "The closed registry binding every host port operation to its names: the wire operation a transport addresses, the typed method a client calls, and the capability identifier a host advertises. A host cannot publish a truthful capability document without it, because the vocabularies must map one to one. Adding an operation is an additive protocol change; renaming or removing one is breaking.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["contractVersion", "kind", "operations"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"contractVersion": {
|
|
11
|
+
"$ref": "common.schema.json#/$defs/contractVersion"
|
|
12
|
+
},
|
|
13
|
+
"kind": {
|
|
14
|
+
"const": "host-operations"
|
|
15
|
+
},
|
|
16
|
+
"operations": {
|
|
17
|
+
"type": "array",
|
|
18
|
+
"minItems": 1,
|
|
19
|
+
"maxItems": 200,
|
|
20
|
+
"items": {
|
|
21
|
+
"type": "object",
|
|
22
|
+
"additionalProperties": false,
|
|
23
|
+
"required": [
|
|
24
|
+
"capability",
|
|
25
|
+
"expectsRevision",
|
|
26
|
+
"method",
|
|
27
|
+
"mutating",
|
|
28
|
+
"operation",
|
|
29
|
+
"port",
|
|
30
|
+
"portCapability",
|
|
31
|
+
"required",
|
|
32
|
+
"route"
|
|
33
|
+
],
|
|
34
|
+
"properties": {
|
|
35
|
+
"capability": {
|
|
36
|
+
"$ref": "#/$defs/operationCapability"
|
|
37
|
+
},
|
|
38
|
+
"expectsRevision": {
|
|
39
|
+
"description": "The operation is concurrency-protected: the request envelope carries expectedRevision and a mismatch conflicts.",
|
|
40
|
+
"type": "boolean"
|
|
41
|
+
},
|
|
42
|
+
"method": {
|
|
43
|
+
"description": "The typed method name a client port interface exposes, which differs from the wire name where the wire spelling is not a valid identifier.",
|
|
44
|
+
"type": "string",
|
|
45
|
+
"pattern": "^[a-z][A-Za-z0-9]*(?![\\s\\S])",
|
|
46
|
+
"maxLength": 100
|
|
47
|
+
},
|
|
48
|
+
"mutating": {
|
|
49
|
+
"description": "The operation changes host state, so it is authorized, audited and idempotent when retried.",
|
|
50
|
+
"type": "boolean"
|
|
51
|
+
},
|
|
52
|
+
"operation": {
|
|
53
|
+
"$ref": "common.schema.json#/$defs/localName"
|
|
54
|
+
},
|
|
55
|
+
"port": {
|
|
56
|
+
"$ref": "#/$defs/portName"
|
|
57
|
+
},
|
|
58
|
+
"portCapability": {
|
|
59
|
+
"$ref": "#/$defs/portCapability"
|
|
60
|
+
},
|
|
61
|
+
"required": {
|
|
62
|
+
"description": "The port must be present for an editable session; an absent optional port degrades with diagnostics.",
|
|
63
|
+
"type": "boolean"
|
|
64
|
+
},
|
|
65
|
+
"route": {
|
|
66
|
+
"$ref": "#/$defs/operationRoute"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"extensions": {
|
|
72
|
+
"$ref": "common.schema.json#/$defs/extensions"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"$defs": {
|
|
76
|
+
"operationCapability": {
|
|
77
|
+
"description": "The capability identifier a host advertises for one port operation.",
|
|
78
|
+
"enum": [
|
|
79
|
+
"studio.operation/artifact.dependencies",
|
|
80
|
+
"studio.operation/artifact.load",
|
|
81
|
+
"studio.operation/artifact.publish",
|
|
82
|
+
"studio.operation/artifact.save",
|
|
83
|
+
"studio.operation/artifact.unpublish",
|
|
84
|
+
"studio.operation/localization.messages",
|
|
85
|
+
"studio.operation/media.abort-upload",
|
|
86
|
+
"studio.operation/media.authorize-upload",
|
|
87
|
+
"studio.operation/media.complete-upload",
|
|
88
|
+
"studio.operation/media.get",
|
|
89
|
+
"studio.operation/media.import-external",
|
|
90
|
+
"studio.operation/media.list",
|
|
91
|
+
"studio.operation/media.upload-status",
|
|
92
|
+
"studio.operation/model.get",
|
|
93
|
+
"studio.operation/model.list",
|
|
94
|
+
"studio.operation/permission.explain",
|
|
95
|
+
"studio.operation/permission.refresh",
|
|
96
|
+
"studio.operation/preview.cancel",
|
|
97
|
+
"studio.operation/preview.render",
|
|
98
|
+
"studio.operation/recovery.discard",
|
|
99
|
+
"studio.operation/recovery.load",
|
|
100
|
+
"studio.operation/recovery.store",
|
|
101
|
+
"studio.operation/resource.search",
|
|
102
|
+
"studio.operation/telemetry.emit"
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
"operationRoute": {
|
|
106
|
+
"description": "The transport route segment addressing one port operation.",
|
|
107
|
+
"enum": [
|
|
108
|
+
"artifact/dependencies",
|
|
109
|
+
"artifact/load",
|
|
110
|
+
"artifact/publish",
|
|
111
|
+
"artifact/save",
|
|
112
|
+
"artifact/unpublish",
|
|
113
|
+
"localization/messages",
|
|
114
|
+
"media/abort-upload",
|
|
115
|
+
"media/authorize-upload",
|
|
116
|
+
"media/complete-upload",
|
|
117
|
+
"media/get",
|
|
118
|
+
"media/import-external",
|
|
119
|
+
"media/list",
|
|
120
|
+
"media/upload-status",
|
|
121
|
+
"model/get",
|
|
122
|
+
"model/list",
|
|
123
|
+
"permission/explain",
|
|
124
|
+
"permission/refresh",
|
|
125
|
+
"preview/cancel",
|
|
126
|
+
"preview/render",
|
|
127
|
+
"recovery/discard",
|
|
128
|
+
"recovery/load",
|
|
129
|
+
"recovery/store",
|
|
130
|
+
"resource/search",
|
|
131
|
+
"telemetry/emit"
|
|
132
|
+
]
|
|
133
|
+
},
|
|
134
|
+
"portCapability": {
|
|
135
|
+
"description": "The capability identifier a host advertises for a whole port.",
|
|
136
|
+
"enum": [
|
|
137
|
+
"studio.port/artifact",
|
|
138
|
+
"studio.port/localization",
|
|
139
|
+
"studio.port/media",
|
|
140
|
+
"studio.port/model",
|
|
141
|
+
"studio.port/permission",
|
|
142
|
+
"studio.port/preview",
|
|
143
|
+
"studio.port/recovery",
|
|
144
|
+
"studio.port/resource",
|
|
145
|
+
"studio.port/telemetry"
|
|
146
|
+
]
|
|
147
|
+
},
|
|
148
|
+
"portName": {
|
|
149
|
+
"enum": [
|
|
150
|
+
"artifact",
|
|
151
|
+
"localization",
|
|
152
|
+
"media",
|
|
153
|
+
"model",
|
|
154
|
+
"permission",
|
|
155
|
+
"preview",
|
|
156
|
+
"recovery",
|
|
157
|
+
"resource",
|
|
158
|
+
"telemetry"
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.kumwe.org/studio/v1/host-request.schema.json",
|
|
4
|
+
"title": "Studio host port request",
|
|
5
|
+
"description": "The body of one host port operation call: the argument the operation takes and the envelope every operation carries. A host validates this shape before dispatching, so a malformed envelope is refused as invalid-request rather than partially honoured.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["context"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"arguments": {
|
|
11
|
+
"description": "The operation argument. Absent for operations that take only the envelope.",
|
|
12
|
+
"$ref": "common.schema.json#/$defs/jsonValue"
|
|
13
|
+
},
|
|
14
|
+
"context": { "$ref": "#/$defs/requestContext" }
|
|
15
|
+
},
|
|
16
|
+
"$defs": {
|
|
17
|
+
"requestContext": {
|
|
18
|
+
"description": "The request envelope. Actor identity and authorization evidence are attached by the trusted transport and never appear here: a Studio-supplied actor value is display context, never authentication.",
|
|
19
|
+
"type": "object",
|
|
20
|
+
"additionalProperties": false,
|
|
21
|
+
"required": [
|
|
22
|
+
"operationId",
|
|
23
|
+
"protocolVersion",
|
|
24
|
+
"requestId",
|
|
25
|
+
"resourceContextKey",
|
|
26
|
+
"sessionGeneration"
|
|
27
|
+
],
|
|
28
|
+
"properties": {
|
|
29
|
+
"expectedRevision": {
|
|
30
|
+
"description": "The revision the caller believes is current. Required by every operation the registry marks expectsRevision; a mismatch conflicts and the host returns the safe current revision.",
|
|
31
|
+
"$ref": "common.schema.json#/$defs/revision"
|
|
32
|
+
},
|
|
33
|
+
"idempotencyKey": {
|
|
34
|
+
"description": "Present when a mutation may be retried. A host that has already accepted this key for this operation returns the original outcome rather than applying the mutation twice.",
|
|
35
|
+
"$ref": "common.schema.json#/$defs/stableId"
|
|
36
|
+
},
|
|
37
|
+
"locale": {
|
|
38
|
+
"description": "The locale for localized diagnostics. Absent means the session locale.",
|
|
39
|
+
"$ref": "common.schema.json#/$defs/locale"
|
|
40
|
+
},
|
|
41
|
+
"operationId": {
|
|
42
|
+
"description": "The capability identifier of the operation being invoked, closed by the operation registry.",
|
|
43
|
+
"$ref": "host-operations.schema.json#/$defs/operationCapability"
|
|
44
|
+
},
|
|
45
|
+
"protocolVersion": {
|
|
46
|
+
"description": "The negotiated wire version. A version the host does not support is refused as incompatible before any work.",
|
|
47
|
+
"$ref": "common.schema.json#/$defs/semanticVersion"
|
|
48
|
+
},
|
|
49
|
+
"requestId": {
|
|
50
|
+
"description": "Unique per call, used for correlation. It never identifies the actor.",
|
|
51
|
+
"$ref": "common.schema.json#/$defs/stableId"
|
|
52
|
+
},
|
|
53
|
+
"resourceContextKey": {
|
|
54
|
+
"description": "The opaque, non-secret, non-bearer context key. The host resolves and verifies the canonical context from this key rather than trusting client-supplied scope values; a stale, altered or cross-session key is rejected without disclosing private resource existence.",
|
|
55
|
+
"$ref": "common.schema.json#/$defs/stableId"
|
|
56
|
+
},
|
|
57
|
+
"sessionGeneration": {
|
|
58
|
+
"description": "The generation the session was opened at. A superseded generation is refused, because a permission or context change mints a new one.",
|
|
59
|
+
"$ref": "common.schema.json#/$defs/revision"
|
|
60
|
+
},
|
|
61
|
+
"traceContext": {
|
|
62
|
+
"description": "Trace correlation permitted by privacy policy. It carries no actor identity, credential or private resource value.",
|
|
63
|
+
"type": "object",
|
|
64
|
+
"maxProperties": 10,
|
|
65
|
+
"propertyNames": { "$ref": "common.schema.json#/$defs/localName" },
|
|
66
|
+
"additionalProperties": { "type": "string", "maxLength": 200 }
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.kumwe.org/studio/v1/host-result.schema.json",
|
|
4
|
+
"title": "Studio host port result",
|
|
5
|
+
"description": "The body a host returns when a port operation succeeds. A failure is never expressed here: it carries the canonical host error document instead, so a client distinguishes outcomes by shape rather than by guessing from a status code.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["value"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"revision": {
|
|
11
|
+
"description": "The accepted resource revision. Every operation the registry marks expectsRevision returns the revision it advanced to, so a client never re-reads to learn what it just wrote.",
|
|
12
|
+
"$ref": "common.schema.json#/$defs/revision"
|
|
13
|
+
},
|
|
14
|
+
"value": {
|
|
15
|
+
"description": "The normalized operation result. Operations that answer with nothing return null rather than omitting the member, so absence is explicit.",
|
|
16
|
+
"$ref": "common.schema.json#/$defs/jsonValue"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.kumwe.org/studio/v1/host-vector.schema.json",
|
|
4
|
+
"title": "Studio canonical host conformance vector",
|
|
5
|
+
"description": "One canonical host-port exchange: the host state a conforming implementation is seeded with, the request envelope and argument Studio sends, and either the accepted result or the exact error category the closed taxonomy requires. Every precondition is a condition a real host can reproduce - a seeded revision, a withheld permission, an unknown identifier, an unsupported wire version - so the corpus is replayable by any implementation in any language without executing Studio code.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": [
|
|
9
|
+
"contractVersion",
|
|
10
|
+
"kind",
|
|
11
|
+
"id",
|
|
12
|
+
"description",
|
|
13
|
+
"profile",
|
|
14
|
+
"port",
|
|
15
|
+
"operation",
|
|
16
|
+
"given",
|
|
17
|
+
"context",
|
|
18
|
+
"expect"
|
|
19
|
+
],
|
|
20
|
+
"properties": {
|
|
21
|
+
"contractVersion": { "$ref": "common.schema.json#/$defs/contractVersion" },
|
|
22
|
+
"kind": { "const": "host-vector" },
|
|
23
|
+
"id": { "$ref": "common.schema.json#/$defs/stableId" },
|
|
24
|
+
"description": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"minLength": 1,
|
|
27
|
+
"maxLength": 500
|
|
28
|
+
},
|
|
29
|
+
"profile": {
|
|
30
|
+
"description": "The conformance profile whose assertion set this vector belongs to.",
|
|
31
|
+
"$ref": "common.schema.json#/$defs/qualifiedName"
|
|
32
|
+
},
|
|
33
|
+
"port": {
|
|
34
|
+
"enum": [
|
|
35
|
+
"artifact",
|
|
36
|
+
"localization",
|
|
37
|
+
"media",
|
|
38
|
+
"model",
|
|
39
|
+
"permission",
|
|
40
|
+
"preview",
|
|
41
|
+
"recovery",
|
|
42
|
+
"resource",
|
|
43
|
+
"telemetry"
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"operation": { "$ref": "common.schema.json#/$defs/localName" },
|
|
47
|
+
"given": {
|
|
48
|
+
"description": "The reproducible host state before the request. A conforming host seeds exactly this state; nothing here is a test double.",
|
|
49
|
+
"type": "object",
|
|
50
|
+
"additionalProperties": false,
|
|
51
|
+
"required": ["artifacts", "permissions"],
|
|
52
|
+
"properties": {
|
|
53
|
+
"artifacts": {
|
|
54
|
+
"description": "Artifact identities the host already stores, with the revision each is stored at.",
|
|
55
|
+
"type": "array",
|
|
56
|
+
"maxItems": 20,
|
|
57
|
+
"items": {
|
|
58
|
+
"type": "object",
|
|
59
|
+
"additionalProperties": false,
|
|
60
|
+
"required": ["id", "kind", "revision"],
|
|
61
|
+
"properties": {
|
|
62
|
+
"id": { "$ref": "common.schema.json#/$defs/stableId" },
|
|
63
|
+
"kind": { "enum": ["blueprint", "content-model", "entry"] },
|
|
64
|
+
"revision": { "$ref": "common.schema.json#/$defs/revision" }
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"permissions": {
|
|
69
|
+
"description": "Operations the acting identity is authorized for. An operation absent here is withheld.",
|
|
70
|
+
"type": "array",
|
|
71
|
+
"maxItems": 50,
|
|
72
|
+
"uniqueItems": true,
|
|
73
|
+
"items": { "$ref": "common.schema.json#/$defs/qualifiedName" }
|
|
74
|
+
},
|
|
75
|
+
"sessionGeneration": {
|
|
76
|
+
"description": "The host's live session generation. A request naming any other generation is stale.",
|
|
77
|
+
"$ref": "common.schema.json#/$defs/revision"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"context": {
|
|
82
|
+
"description": "The request envelope every port operation carries.",
|
|
83
|
+
"type": "object",
|
|
84
|
+
"additionalProperties": false,
|
|
85
|
+
"required": [
|
|
86
|
+
"operationId",
|
|
87
|
+
"protocolVersion",
|
|
88
|
+
"requestId",
|
|
89
|
+
"resourceContextKey",
|
|
90
|
+
"sessionGeneration"
|
|
91
|
+
],
|
|
92
|
+
"properties": {
|
|
93
|
+
"expectedRevision": { "$ref": "common.schema.json#/$defs/revision" },
|
|
94
|
+
"idempotencyKey": { "$ref": "common.schema.json#/$defs/stableId" },
|
|
95
|
+
"locale": { "$ref": "common.schema.json#/$defs/locale" },
|
|
96
|
+
"operationId": { "$ref": "common.schema.json#/$defs/qualifiedName" },
|
|
97
|
+
"protocolVersion": {
|
|
98
|
+
"description": "Deliberately looser than the negotiated wire version so a vector can carry a version the host must refuse.",
|
|
99
|
+
"type": "string",
|
|
100
|
+
"maxLength": 100
|
|
101
|
+
},
|
|
102
|
+
"requestId": {
|
|
103
|
+
"description": "Deliberately looser than the canonical stable identifier so a vector can carry a structurally invalid envelope the host must refuse.",
|
|
104
|
+
"type": "string",
|
|
105
|
+
"maxLength": 240
|
|
106
|
+
},
|
|
107
|
+
"resourceContextKey": { "$ref": "common.schema.json#/$defs/stableId" },
|
|
108
|
+
"sessionGeneration": { "$ref": "common.schema.json#/$defs/revision" }
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"argument": {
|
|
112
|
+
"description": "The port argument, shaped by the operation. Absent for operations that take only the envelope.",
|
|
113
|
+
"$ref": "common.schema.json#/$defs/jsonValue"
|
|
114
|
+
},
|
|
115
|
+
"expect": {
|
|
116
|
+
"oneOf": [
|
|
117
|
+
{
|
|
118
|
+
"type": "object",
|
|
119
|
+
"additionalProperties": false,
|
|
120
|
+
"required": ["outcome"],
|
|
121
|
+
"properties": {
|
|
122
|
+
"outcome": { "const": "result" },
|
|
123
|
+
"revision": {
|
|
124
|
+
"description": "The accepted revision the result carries. A mutation MUST advance it beyond the stored revision.",
|
|
125
|
+
"$ref": "common.schema.json#/$defs/revision"
|
|
126
|
+
},
|
|
127
|
+
"revisionAdvances": {
|
|
128
|
+
"description": "True when the operation mutates and the returned revision must differ from the stored one.",
|
|
129
|
+
"type": "boolean"
|
|
130
|
+
},
|
|
131
|
+
"value": {
|
|
132
|
+
"description": "The value shape the result carries.",
|
|
133
|
+
"enum": [
|
|
134
|
+
"artifact",
|
|
135
|
+
"artifact-references",
|
|
136
|
+
"media-asset",
|
|
137
|
+
"media-page",
|
|
138
|
+
"message-bundle",
|
|
139
|
+
"null",
|
|
140
|
+
"permission-explanation",
|
|
141
|
+
"permission-snapshot",
|
|
142
|
+
"recovery-envelope",
|
|
143
|
+
"rendered",
|
|
144
|
+
"search-page",
|
|
145
|
+
"upload-accepted",
|
|
146
|
+
"upload-grant"
|
|
147
|
+
]
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"type": "object",
|
|
153
|
+
"additionalProperties": false,
|
|
154
|
+
"required": ["outcome", "category"],
|
|
155
|
+
"properties": {
|
|
156
|
+
"outcome": { "const": "error" },
|
|
157
|
+
"category": {
|
|
158
|
+
"enum": [
|
|
159
|
+
"cancelled",
|
|
160
|
+
"conflict",
|
|
161
|
+
"forbidden",
|
|
162
|
+
"incompatible",
|
|
163
|
+
"internal",
|
|
164
|
+
"invalid-request",
|
|
165
|
+
"limit-exceeded",
|
|
166
|
+
"not-found",
|
|
167
|
+
"rate-limited",
|
|
168
|
+
"unauthenticated",
|
|
169
|
+
"unavailable",
|
|
170
|
+
"validation-failed"
|
|
171
|
+
]
|
|
172
|
+
},
|
|
173
|
+
"retryable": {
|
|
174
|
+
"description": "The retry classification the error MUST carry.",
|
|
175
|
+
"type": "boolean"
|
|
176
|
+
},
|
|
177
|
+
"revision": {
|
|
178
|
+
"description": "The safe current revision a conflict MUST return so the client can resolve without a second read.",
|
|
179
|
+
"$ref": "common.schema.json#/$defs/revision"
|
|
180
|
+
},
|
|
181
|
+
"messageMustNotContain": {
|
|
182
|
+
"description": "Values the user-facing message MUST NOT echo, so a rejection never discloses private resource existence or request internals.",
|
|
183
|
+
"type": "array",
|
|
184
|
+
"minItems": 1,
|
|
185
|
+
"maxItems": 10,
|
|
186
|
+
"items": {
|
|
187
|
+
"type": "string",
|
|
188
|
+
"minLength": 1,
|
|
189
|
+
"maxLength": 200
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
]
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.kumwe.org/studio/v1/inspector.schema.json",
|
|
4
|
+
"title": "Studio inspector contribution",
|
|
5
|
+
"description": "The declarative payload behind an `inspector` plugin contribution: a panel an extension offers for inspecting or configuring the block types it declares. The declaration is inert data; whether its executable half runs, and in which realm, stays a host decision recorded in the plugin manifest.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": [
|
|
9
|
+
"contractVersion",
|
|
10
|
+
"kind",
|
|
11
|
+
"id",
|
|
12
|
+
"version",
|
|
13
|
+
"owner",
|
|
14
|
+
"label",
|
|
15
|
+
"blockTypes",
|
|
16
|
+
"placement"
|
|
17
|
+
],
|
|
18
|
+
"properties": {
|
|
19
|
+
"contractVersion": { "$ref": "common.schema.json#/$defs/contractVersion" },
|
|
20
|
+
"kind": { "const": "inspector" },
|
|
21
|
+
"id": { "$ref": "common.schema.json#/$defs/qualifiedName" },
|
|
22
|
+
"version": { "$ref": "common.schema.json#/$defs/semanticVersion" },
|
|
23
|
+
"owner": { "$ref": "common.schema.json#/$defs/ownerReference" },
|
|
24
|
+
"label": { "$ref": "common.schema.json#/$defs/messageReference" },
|
|
25
|
+
"description": { "$ref": "common.schema.json#/$defs/messageReference" },
|
|
26
|
+
"blockTypes": {
|
|
27
|
+
"description": "The block types this inspector applies to. It never sees a node of any other type.",
|
|
28
|
+
"type": "array",
|
|
29
|
+
"minItems": 1,
|
|
30
|
+
"maxItems": 500,
|
|
31
|
+
"uniqueItems": true,
|
|
32
|
+
"items": { "$ref": "common.schema.json#/$defs/qualifiedName" }
|
|
33
|
+
},
|
|
34
|
+
"placement": {
|
|
35
|
+
"description": "Whether the panel augments the built-in inspector or replaces it for the declared block types. Replacement never removes the host's own policy and accessibility surfaces.",
|
|
36
|
+
"enum": ["augment", "replace"]
|
|
37
|
+
},
|
|
38
|
+
"requiredCapability": {
|
|
39
|
+
"description": "The capability the executable half requires. A declaration without one is inspectable but never executed.",
|
|
40
|
+
"$ref": "common.schema.json#/$defs/qualifiedName"
|
|
41
|
+
},
|
|
42
|
+
"extensions": { "$ref": "common.schema.json#/$defs/extensions" }
|
|
43
|
+
}
|
|
44
|
+
}
|