@clowder-ai/plugin-contract 0.1.0-beta.14 → 0.1.0-beta.16
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/codegen/generate-contract.d.ts +2 -0
- package/dist/codegen/generate-contract.d.ts.map +1 -1
- package/dist/codegen/generate-contract.js +12 -1
- package/dist/codegen/generate-contract.js.map +1 -1
- package/dist/docx-materialization.d.ts +8 -0
- package/dist/docx-materialization.d.ts.map +1 -0
- package/dist/docx-materialization.js +19 -0
- package/dist/docx-materialization.js.map +1 -0
- package/dist/generated/contract.generated.d.ts +183 -3
- package/dist/generated/contract.generated.d.ts.map +1 -1
- package/dist/generated/contract.generated.js +3 -1
- package/dist/generated/contract.generated.js.map +1 -1
- package/dist/validation/companion-bridge.d.ts +6 -0
- package/dist/validation/companion-bridge.d.ts.map +1 -0
- package/dist/validation/companion-bridge.js +36 -0
- package/dist/validation/companion-bridge.js.map +1 -0
- package/dist/validation/docx-materialization.d.ts +6 -0
- package/dist/validation/docx-materialization.d.ts.map +1 -0
- package/dist/validation/docx-materialization.js +36 -0
- package/dist/validation/docx-materialization.js.map +1 -0
- package/dist/validation/index.d.ts +2 -0
- package/dist/validation/index.d.ts.map +1 -1
- package/dist/validation/index.js +2 -0
- package/dist/validation/index.js.map +1 -1
- package/dist/validation/manifest.d.ts.map +1 -1
- package/dist/validation/manifest.js +3 -0
- package/dist/validation/manifest.js.map +1 -1
- package/package.json +7 -1
- package/src/schemas/companion-bridge.schema.json +574 -0
- package/src/schemas/docx-materialization.schema.json +302 -0
- package/src/schemas/manifest.schema.json +53 -3
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://clowder-ai.dev/schemas/docx-materialization/v1",
|
|
4
|
+
"title": "Independent DOCX materialization protocol",
|
|
5
|
+
"description": "Host-internal, content-editor-provider worker protocol. No capability token, content binding, Host path or owner effect API crosses this boundary. Inspect is read-only; generated bytes remain uncommitted until the Host rechecks authority and owner CAS.",
|
|
6
|
+
"$defs": {
|
|
7
|
+
"DocxMaterializationText": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"pattern": "^[\\u0009\\u000A\\u0020-\\uD7FF\\uE000-\\uFFFD\\u{10000}-\\u{10FFFF}]*(?![\\s\\S])",
|
|
10
|
+
"description": "Lossless XML 1.0 text: valid Unicode scalars only; CR is rejected because the frozen engine emits it literally and XML end-of-line normalization changes it. TAB and LF are supported. No sanitization is permitted."
|
|
11
|
+
},
|
|
12
|
+
"DocxMaterializationAuthor": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"pattern": "^[\\u0020-\\uD7FF\\uE000-\\uFFFD\\u{10000}-\\u{10FFFF}]*(?![\\s\\S])",
|
|
15
|
+
"description": "Lossless XML 1.0 attribute text. TAB, LF and CR are excluded because XML attribute normalization would change the author identity."
|
|
16
|
+
},
|
|
17
|
+
"DocxMaterializationBytes": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"minLength": 4,
|
|
20
|
+
"maxLength": 11184812,
|
|
21
|
+
"pattern": "^[A-Za-z0-9+/]*={0,2}$",
|
|
22
|
+
"description": "Canonical base64, at most 8 MiB decoded. Hosts enforce decoded size and canonical encoding before launch and after return."
|
|
23
|
+
},
|
|
24
|
+
"DocxMaterializationAnchor": {
|
|
25
|
+
"type": "object",
|
|
26
|
+
"properties": {
|
|
27
|
+
"paragraphId": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"minLength": 68,
|
|
30
|
+
"maxLength": 88,
|
|
31
|
+
"pattern": "^p:[0-9]{1,10}:[a-f0-9]{64}$"
|
|
32
|
+
},
|
|
33
|
+
"textQuote": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"minLength": 1,
|
|
36
|
+
"maxLength": 8192
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"required": [
|
|
40
|
+
"paragraphId",
|
|
41
|
+
"textQuote"
|
|
42
|
+
],
|
|
43
|
+
"additionalProperties": false
|
|
44
|
+
},
|
|
45
|
+
"DocxMaterializationAttribution": {
|
|
46
|
+
"type": "object",
|
|
47
|
+
"properties": {
|
|
48
|
+
"author": {
|
|
49
|
+
"$ref": "#/$defs/DocxMaterializationAuthor",
|
|
50
|
+
"minLength": 1,
|
|
51
|
+
"maxLength": 64
|
|
52
|
+
},
|
|
53
|
+
"operationId": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"minLength": 1,
|
|
56
|
+
"maxLength": 128
|
|
57
|
+
},
|
|
58
|
+
"timestamp": {
|
|
59
|
+
"type": "string",
|
|
60
|
+
"minLength": 20,
|
|
61
|
+
"maxLength": 24,
|
|
62
|
+
"format": "date-time"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"required": [
|
|
66
|
+
"author",
|
|
67
|
+
"operationId",
|
|
68
|
+
"timestamp"
|
|
69
|
+
],
|
|
70
|
+
"additionalProperties": false
|
|
71
|
+
},
|
|
72
|
+
"DocxMaterializationOperation": {
|
|
73
|
+
"oneOf": [
|
|
74
|
+
{
|
|
75
|
+
"type": "object",
|
|
76
|
+
"properties": {
|
|
77
|
+
"kind": {
|
|
78
|
+
"const": "inspect"
|
|
79
|
+
},
|
|
80
|
+
"cursor": {
|
|
81
|
+
"type": "integer",
|
|
82
|
+
"minimum": 0,
|
|
83
|
+
"maximum": 65535
|
|
84
|
+
},
|
|
85
|
+
"limit": {
|
|
86
|
+
"type": "integer",
|
|
87
|
+
"minimum": 1,
|
|
88
|
+
"maximum": 32
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"required": [
|
|
92
|
+
"kind",
|
|
93
|
+
"cursor",
|
|
94
|
+
"limit"
|
|
95
|
+
],
|
|
96
|
+
"additionalProperties": false
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"type": "object",
|
|
100
|
+
"properties": {
|
|
101
|
+
"kind": {
|
|
102
|
+
"const": "tracked-change"
|
|
103
|
+
},
|
|
104
|
+
"target": {
|
|
105
|
+
"$ref": "#/$defs/DocxMaterializationAnchor"
|
|
106
|
+
},
|
|
107
|
+
"replacement": {
|
|
108
|
+
"$ref": "#/$defs/DocxMaterializationText",
|
|
109
|
+
"minLength": 0,
|
|
110
|
+
"maxLength": 8192
|
|
111
|
+
},
|
|
112
|
+
"attribution": {
|
|
113
|
+
"$ref": "#/$defs/DocxMaterializationAttribution"
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"required": [
|
|
117
|
+
"kind",
|
|
118
|
+
"target",
|
|
119
|
+
"replacement",
|
|
120
|
+
"attribution"
|
|
121
|
+
],
|
|
122
|
+
"additionalProperties": false
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"type": "object",
|
|
126
|
+
"properties": {
|
|
127
|
+
"kind": {
|
|
128
|
+
"const": "comment"
|
|
129
|
+
},
|
|
130
|
+
"target": {
|
|
131
|
+
"$ref": "#/$defs/DocxMaterializationAnchor"
|
|
132
|
+
},
|
|
133
|
+
"body": {
|
|
134
|
+
"$ref": "#/$defs/DocxMaterializationText",
|
|
135
|
+
"minLength": 1,
|
|
136
|
+
"maxLength": 8192
|
|
137
|
+
},
|
|
138
|
+
"attribution": {
|
|
139
|
+
"$ref": "#/$defs/DocxMaterializationAttribution"
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
"required": [
|
|
143
|
+
"kind",
|
|
144
|
+
"target",
|
|
145
|
+
"body",
|
|
146
|
+
"attribution"
|
|
147
|
+
],
|
|
148
|
+
"additionalProperties": false
|
|
149
|
+
}
|
|
150
|
+
]
|
|
151
|
+
},
|
|
152
|
+
"DocxMaterializationRequest": {
|
|
153
|
+
"type": "object",
|
|
154
|
+
"properties": {
|
|
155
|
+
"protocolVersion": {
|
|
156
|
+
"const": "1.0.0"
|
|
157
|
+
},
|
|
158
|
+
"requestId": {
|
|
159
|
+
"type": "string",
|
|
160
|
+
"minLength": 1,
|
|
161
|
+
"maxLength": 128
|
|
162
|
+
},
|
|
163
|
+
"mediaType": {
|
|
164
|
+
"const": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
|
|
165
|
+
},
|
|
166
|
+
"bytesBase64": {
|
|
167
|
+
"$ref": "#/$defs/DocxMaterializationBytes"
|
|
168
|
+
},
|
|
169
|
+
"operation": {
|
|
170
|
+
"$ref": "#/$defs/DocxMaterializationOperation"
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
"required": [
|
|
174
|
+
"protocolVersion",
|
|
175
|
+
"requestId",
|
|
176
|
+
"mediaType",
|
|
177
|
+
"bytesBase64",
|
|
178
|
+
"operation"
|
|
179
|
+
],
|
|
180
|
+
"additionalProperties": false
|
|
181
|
+
},
|
|
182
|
+
"DocxMaterializationResult": {
|
|
183
|
+
"oneOf": [
|
|
184
|
+
{
|
|
185
|
+
"type": "object",
|
|
186
|
+
"properties": {
|
|
187
|
+
"kind": {
|
|
188
|
+
"const": "inspection"
|
|
189
|
+
},
|
|
190
|
+
"paragraphs": {
|
|
191
|
+
"type": "array",
|
|
192
|
+
"maxItems": 32,
|
|
193
|
+
"items": {
|
|
194
|
+
"type": "object",
|
|
195
|
+
"properties": {
|
|
196
|
+
"target": {
|
|
197
|
+
"$ref": "#/$defs/DocxMaterializationAnchor"
|
|
198
|
+
},
|
|
199
|
+
"editable": {
|
|
200
|
+
"type": "boolean"
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
"required": [
|
|
204
|
+
"target",
|
|
205
|
+
"editable"
|
|
206
|
+
],
|
|
207
|
+
"additionalProperties": false
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
"nextCursor": {
|
|
211
|
+
"anyOf": [
|
|
212
|
+
{
|
|
213
|
+
"type": "integer",
|
|
214
|
+
"minimum": 0,
|
|
215
|
+
"maximum": 65535
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"type": "null"
|
|
219
|
+
}
|
|
220
|
+
]
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
"required": [
|
|
224
|
+
"kind",
|
|
225
|
+
"paragraphs",
|
|
226
|
+
"nextCursor"
|
|
227
|
+
],
|
|
228
|
+
"additionalProperties": false
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"type": "object",
|
|
232
|
+
"properties": {
|
|
233
|
+
"kind": {
|
|
234
|
+
"const": "document"
|
|
235
|
+
},
|
|
236
|
+
"bytesBase64": {
|
|
237
|
+
"$ref": "#/$defs/DocxMaterializationBytes"
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
"required": [
|
|
241
|
+
"kind",
|
|
242
|
+
"bytesBase64"
|
|
243
|
+
],
|
|
244
|
+
"additionalProperties": false
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"type": "object",
|
|
248
|
+
"properties": {
|
|
249
|
+
"kind": {
|
|
250
|
+
"const": "rejected"
|
|
251
|
+
},
|
|
252
|
+
"code": {
|
|
253
|
+
"type": "string",
|
|
254
|
+
"enum": [
|
|
255
|
+
"INVALID_DOCX",
|
|
256
|
+
"TARGET_MISMATCH",
|
|
257
|
+
"UNSUPPORTED_TARGET",
|
|
258
|
+
"LIMIT_EXCEEDED",
|
|
259
|
+
"INVALID_REQUEST"
|
|
260
|
+
]
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
"required": [
|
|
264
|
+
"kind",
|
|
265
|
+
"code"
|
|
266
|
+
],
|
|
267
|
+
"additionalProperties": false
|
|
268
|
+
}
|
|
269
|
+
]
|
|
270
|
+
},
|
|
271
|
+
"DocxMaterializationResponse": {
|
|
272
|
+
"type": "object",
|
|
273
|
+
"properties": {
|
|
274
|
+
"protocolVersion": {
|
|
275
|
+
"const": "1.0.0"
|
|
276
|
+
},
|
|
277
|
+
"requestId": {
|
|
278
|
+
"type": "string",
|
|
279
|
+
"minLength": 1,
|
|
280
|
+
"maxLength": 128
|
|
281
|
+
},
|
|
282
|
+
"result": {
|
|
283
|
+
"$ref": "#/$defs/DocxMaterializationResult"
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
"required": [
|
|
287
|
+
"protocolVersion",
|
|
288
|
+
"requestId",
|
|
289
|
+
"result"
|
|
290
|
+
],
|
|
291
|
+
"additionalProperties": false
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
"oneOf": [
|
|
295
|
+
{
|
|
296
|
+
"$ref": "#/$defs/DocxMaterializationRequest"
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
"$ref": "#/$defs/DocxMaterializationResponse"
|
|
300
|
+
}
|
|
301
|
+
]
|
|
302
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://clowder-ai.dev/schemas/manifest/v0.1",
|
|
4
4
|
"title": "Clowder AI Plugin Manifest (v0.1)",
|
|
5
|
-
"description": "Machine-readable truth source for the static plugin.yaml access protocol (§3.4/§3.5). beta.
|
|
5
|
+
"description": "Machine-readable truth source for the static plugin.yaml access protocol (§3.4/§3.5). beta.16 adds the Host-governed desktop-window contribution. Window, media and conversation authorities remain separate Host runtime decisions; the signed broker wire is unchanged.",
|
|
6
6
|
"x-clowder-capability-layers": {
|
|
7
7
|
"L0": ["plugin.config.read", "plugin.state.get", "plugin.state.set"],
|
|
8
8
|
"L1": ["messaging.send", "schedule.register", "events.publish", "messaging.appendElements"],
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
"properties": {
|
|
106
106
|
"type": {
|
|
107
107
|
"type": "string",
|
|
108
|
-
"enum": ["identity", "schedule", "tool", "mcp", "skill", "limb", "webhook", "message-subscription", "service", "connector", "ui", "content-editor-provider"]
|
|
108
|
+
"enum": ["identity", "schedule", "tool", "mcp", "skill", "limb", "webhook", "message-subscription", "service", "connector", "ui", "content-editor-provider", "desktop-window"]
|
|
109
109
|
},
|
|
110
110
|
"id": { "type": "string", "minLength": 1 }
|
|
111
111
|
},
|
|
@@ -456,6 +456,54 @@
|
|
|
456
456
|
]
|
|
457
457
|
},
|
|
458
458
|
|
|
459
|
+
"SemanticMaterializerDeclaration": {
|
|
460
|
+
"type": "object",
|
|
461
|
+
"description": "Optional independent DOCX computation. The Host admits one closed worker bundle under the installed package and live feature authority, in a fresh sandboxed private browser process with no ambient effects. This is not permission to execute package code in the Host or renderer.",
|
|
462
|
+
"properties": {
|
|
463
|
+
"executionClass": { "const": "dedicated-browser-worker" },
|
|
464
|
+
"entrypoint": { "$ref": "#/$defs/PackageRelativePath", "pattern": "\\.js$" },
|
|
465
|
+
"integrity": { "type": "string", "pattern": "^sha256-[A-Za-z0-9+/]{43}=$" },
|
|
466
|
+
"protocolVersion": { "const": "1.0.0" }
|
|
467
|
+
},
|
|
468
|
+
"required": ["executionClass", "entrypoint", "integrity", "protocolVersion"],
|
|
469
|
+
"additionalProperties": false
|
|
470
|
+
},
|
|
471
|
+
|
|
472
|
+
"DesktopWindowContribution": {
|
|
473
|
+
"type": "object",
|
|
474
|
+
"description": "Host-created desktop surface under its owning feature's windows.create grant. surface.integrity verifies only the entry HTML bytes. The Host must separately verify the complete installed package and serve a verified snapshot of all referenced assets. This declares no executable, Host origin, identity, or capture permission. The Host owns window execution, media/session admission and the isolated receive-only provider channel.",
|
|
475
|
+
"properties": {
|
|
476
|
+
"type": { "const": "desktop-window" },
|
|
477
|
+
"id": { "type": "string", "minLength": 1, "maxLength": 128 },
|
|
478
|
+
"role": { "const": "companion" },
|
|
479
|
+
"surface": {
|
|
480
|
+
"type": "object",
|
|
481
|
+
"properties": {
|
|
482
|
+
"entrypoint": { "$ref": "#/$defs/PackageRelativePath", "pattern": "\\.html$" },
|
|
483
|
+
"integrity": { "type": "string", "pattern": "^sha256-[A-Za-z0-9+/]{43}=$" }
|
|
484
|
+
},
|
|
485
|
+
"required": ["entrypoint", "integrity"],
|
|
486
|
+
"additionalProperties": false
|
|
487
|
+
},
|
|
488
|
+
"bridgeVersion": { "const": "1.0.0" },
|
|
489
|
+
"presentation": {
|
|
490
|
+
"type": "object",
|
|
491
|
+
"properties": {
|
|
492
|
+
"width": { "type": "integer", "minimum": 160, "maximum": 600 },
|
|
493
|
+
"height": { "type": "integer", "minimum": 160, "maximum": 1000 },
|
|
494
|
+
"transparent": { "const": true },
|
|
495
|
+
"frame": { "const": false },
|
|
496
|
+
"alwaysOnTop": { "type": "boolean" },
|
|
497
|
+
"skipTaskbar": { "type": "boolean" }
|
|
498
|
+
},
|
|
499
|
+
"required": ["width", "height", "transparent", "frame", "alwaysOnTop", "skipTaskbar"],
|
|
500
|
+
"additionalProperties": false
|
|
501
|
+
}
|
|
502
|
+
},
|
|
503
|
+
"required": ["type", "id", "role", "surface", "bridgeVersion", "presentation"],
|
|
504
|
+
"additionalProperties": false
|
|
505
|
+
},
|
|
506
|
+
|
|
459
507
|
"ContentEditorProviderContribution": {
|
|
460
508
|
"type": "object",
|
|
461
509
|
"properties": {
|
|
@@ -491,6 +539,7 @@
|
|
|
491
539
|
"additionalProperties": false
|
|
492
540
|
},
|
|
493
541
|
"bridgeVersion": { "const": "1.0.0" },
|
|
542
|
+
"semanticMaterializer": { "$ref": "#/$defs/SemanticMaterializerDeclaration" },
|
|
494
543
|
"operations": {
|
|
495
544
|
"type": "array",
|
|
496
545
|
"items": { "type": "string", "enum": ["load", "settle", "comment", "tracked-change"] },
|
|
@@ -516,7 +565,8 @@
|
|
|
516
565
|
{ "$ref": "#/$defs/ServiceContribution" },
|
|
517
566
|
{ "$ref": "#/$defs/ConnectorContribution" },
|
|
518
567
|
{ "$ref": "#/$defs/UiContribution" },
|
|
519
|
-
{ "$ref": "#/$defs/ContentEditorProviderContribution" }
|
|
568
|
+
{ "$ref": "#/$defs/ContentEditorProviderContribution" },
|
|
569
|
+
{ "$ref": "#/$defs/DesktopWindowContribution" }
|
|
520
570
|
]
|
|
521
571
|
},
|
|
522
572
|
|