@clowder-ai/plugin-contract 0.1.0-beta.11 → 0.1.0-beta.13

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.
Files changed (33) hide show
  1. package/dist/codegen/generate-contract.d.ts +4 -0
  2. package/dist/codegen/generate-contract.d.ts.map +1 -1
  3. package/dist/codegen/generate-contract.js +171 -17
  4. package/dist/codegen/generate-contract.js.map +1 -1
  5. package/dist/conformance/runner.d.ts.map +1 -1
  6. package/dist/conformance/runner.js +2 -0
  7. package/dist/conformance/runner.js.map +1 -1
  8. package/dist/generated/contract.generated.d.ts +418 -8
  9. package/dist/generated/contract.generated.d.ts.map +1 -1
  10. package/dist/generated/contract.generated.js +1 -1
  11. package/dist/generated/contract.generated.js.map +1 -1
  12. package/dist/validation/catalog.d.ts +21 -0
  13. package/dist/validation/catalog.d.ts.map +1 -0
  14. package/dist/validation/catalog.js +140 -0
  15. package/dist/validation/catalog.js.map +1 -0
  16. package/dist/validation/index.d.ts +1 -0
  17. package/dist/validation/index.d.ts.map +1 -1
  18. package/dist/validation/index.js +1 -0
  19. package/dist/validation/index.js.map +1 -1
  20. package/dist/validation/manifest.d.ts.map +1 -1
  21. package/dist/validation/manifest.js +104 -0
  22. package/dist/validation/manifest.js.map +1 -1
  23. package/dist/wire/grants.d.ts +1 -1
  24. package/dist/wire/grants.js +1 -1
  25. package/dist/wire/signal-byte-bounds.d.ts +3 -3
  26. package/fixtures/behavior/messaging/adversarial-invariants.json +85 -0
  27. package/fixtures/manifest/invalid/icon-package-escape.json +22 -0
  28. package/fixtures/manifest/valid/localized-product-metadata.json +27 -0
  29. package/package.json +3 -1
  30. package/src/schemas/behavior-fixture.schema.json +262 -2
  31. package/src/schemas/catalog.schema.json +91 -0
  32. package/src/schemas/manifest.schema.json +388 -3
  33. package/src/schemas/plugin-metadata.schema.json +62 -0
@@ -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 plugin manifest (§3.4/§3.5). beta.9 adds the C-2 declared-signal contribution while schedule/state (C-3) remain future contract deltas.",
5
+ "description": "Machine-readable truth source for the static plugin.yaml access protocol (§3.4/§3.5). beta.13 adds typed Train B configuration and contribution declarations while Host grants remain a separate runtime authority.",
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"],
@@ -100,6 +100,378 @@
100
100
  "additionalProperties": false
101
101
  },
102
102
 
103
+ "ContributionReference": {
104
+ "type": "object",
105
+ "properties": {
106
+ "type": {
107
+ "type": "string",
108
+ "enum": ["identity", "schedule", "tool", "mcp", "skill", "limb", "webhook", "message-subscription", "service", "connector", "ui"]
109
+ },
110
+ "id": { "type": "string", "minLength": 1 }
111
+ },
112
+ "required": ["type", "id"],
113
+ "additionalProperties": false
114
+ },
115
+
116
+ "PackageRelativePath": {
117
+ "type": "string",
118
+ "minLength": 1,
119
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*(/[A-Za-z0-9][A-Za-z0-9._-]*)*$"
120
+ },
121
+
122
+ "ConfigurationOption": {
123
+ "type": "object",
124
+ "properties": {
125
+ "value": { "type": "string", "minLength": 1 },
126
+ "label": { "type": "string", "minLength": 1 },
127
+ "hint": { "type": "string" },
128
+ "docsUrl": { "type": "string", "format": "uri" }
129
+ },
130
+ "required": ["value", "label"],
131
+ "additionalProperties": false
132
+ },
133
+
134
+ "ConfigurationField": {
135
+ "type": "object",
136
+ "properties": {
137
+ "key": { "type": "string", "minLength": 1, "pattern": "^[A-Za-z][A-Za-z0-9._-]*$" },
138
+ "label": { "type": "string", "minLength": 1 },
139
+ "description": { "type": "string" },
140
+ "kind": { "type": "string", "enum": ["string", "secret", "select", "boolean", "number", "url"] },
141
+ "required": { "type": "boolean" },
142
+ "default": { "type": ["string", "number", "boolean"] },
143
+ "options": {
144
+ "type": "array",
145
+ "items": { "$ref": "#/$defs/ConfigurationOption" },
146
+ "minItems": 1
147
+ }
148
+ },
149
+ "required": ["key", "label", "kind", "required"],
150
+ "additionalProperties": false,
151
+ "allOf": [
152
+ {
153
+ "if": { "properties": { "kind": { "const": "select" } }, "required": ["kind"] },
154
+ "then": { "required": ["options"] },
155
+ "else": { "properties": { "options": false } }
156
+ },
157
+ {
158
+ "if": { "properties": { "kind": { "const": "secret" } }, "required": ["kind"] },
159
+ "then": { "properties": { "default": false } }
160
+ },
161
+ {
162
+ "if": { "properties": { "kind": { "const": "boolean" } }, "required": ["kind"] },
163
+ "then": { "properties": { "default": { "type": "boolean" } } }
164
+ },
165
+ {
166
+ "if": { "properties": { "kind": { "const": "number" } }, "required": ["kind"] },
167
+ "then": { "properties": { "default": { "type": "number" } } }
168
+ },
169
+ {
170
+ "if": { "properties": { "kind": { "enum": ["string", "select"] } }, "required": ["kind"] },
171
+ "then": { "properties": { "default": { "type": "string" } } }
172
+ },
173
+ {
174
+ "if": { "properties": { "kind": { "const": "url" } }, "required": ["kind"] },
175
+ "then": { "properties": { "default": { "type": "string", "format": "uri" } } }
176
+ }
177
+ ]
178
+ },
179
+
180
+ "EnvironmentBinding": {
181
+ "oneOf": [
182
+ {
183
+ "type": "object",
184
+ "properties": {
185
+ "source": { "const": "config" },
186
+ "key": { "type": "string", "minLength": 1 }
187
+ },
188
+ "required": ["source", "key"],
189
+ "additionalProperties": false
190
+ },
191
+ {
192
+ "type": "object",
193
+ "properties": {
194
+ "source": { "const": "secret" },
195
+ "key": { "type": "string", "minLength": 1 }
196
+ },
197
+ "required": ["source", "key"],
198
+ "additionalProperties": false
199
+ }
200
+ ]
201
+ },
202
+
203
+ "ContributionRuntime": {
204
+ "type": "object",
205
+ "properties": {
206
+ "transport": { "type": "string", "enum": ["stdio", "ipc"] },
207
+ "entrypoint": { "$ref": "#/$defs/PackageRelativePath" },
208
+ "args": { "type": "array", "items": { "type": "string" } }
209
+ },
210
+ "required": ["transport", "entrypoint"],
211
+ "additionalProperties": false
212
+ },
213
+
214
+ "CallbackAction": {
215
+ "type": "object",
216
+ "properties": {
217
+ "method": { "type": "string", "minLength": 1 },
218
+ "params": { "type": "object", "additionalProperties": true }
219
+ },
220
+ "required": ["method"],
221
+ "additionalProperties": false
222
+ },
223
+
224
+ "IdentityContribution": {
225
+ "type": "object",
226
+ "properties": {
227
+ "type": { "const": "identity" },
228
+ "id": { "type": "string", "minLength": 1 },
229
+ "displayName": { "type": "string", "minLength": 1 },
230
+ "icon": { "type": "string" },
231
+ "color": { "type": "string" }
232
+ },
233
+ "required": ["type", "id", "displayName"],
234
+ "additionalProperties": false
235
+ },
236
+
237
+ "ScheduleContribution": {
238
+ "type": "object",
239
+ "properties": {
240
+ "type": { "const": "schedule" },
241
+ "id": { "type": "string", "minLength": 1 },
242
+ "schedule": {
243
+ "oneOf": [
244
+ {
245
+ "type": "object",
246
+ "properties": { "kind": { "const": "interval" }, "everyMs": { "type": "integer", "minimum": 1000 } },
247
+ "required": ["kind", "everyMs"],
248
+ "additionalProperties": false
249
+ },
250
+ {
251
+ "type": "object",
252
+ "properties": { "kind": { "const": "cron" }, "expression": { "type": "string", "minLength": 1 } },
253
+ "required": ["kind", "expression"],
254
+ "additionalProperties": false
255
+ }
256
+ ]
257
+ },
258
+ "action": { "$ref": "#/$defs/CallbackAction" },
259
+ "policy": {
260
+ "type": "object",
261
+ "properties": {
262
+ "overlap": { "const": "skip" },
263
+ "timeoutMs": { "type": "integer", "minimum": 1000, "maximum": 86400000 }
264
+ },
265
+ "required": ["overlap", "timeoutMs"],
266
+ "additionalProperties": false
267
+ }
268
+ },
269
+ "required": ["type", "id", "schedule", "action", "policy"],
270
+ "additionalProperties": false
271
+ },
272
+
273
+ "DirectToolContribution": {
274
+ "type": "object",
275
+ "properties": {
276
+ "type": { "const": "tool" },
277
+ "id": { "type": "string", "minLength": 1 },
278
+ "name": { "type": "string", "minLength": 1 },
279
+ "description": { "type": "string" },
280
+ "inputSchema": { "type": "object", "additionalProperties": true },
281
+ "action": { "$ref": "#/$defs/CallbackAction" }
282
+ },
283
+ "required": ["type", "id", "name", "inputSchema", "action"],
284
+ "additionalProperties": false
285
+ },
286
+
287
+ "McpContribution": {
288
+ "type": "object",
289
+ "properties": {
290
+ "type": { "const": "mcp" },
291
+ "id": { "type": "string", "minLength": 1 },
292
+ "runtime": { "$ref": "#/$defs/ContributionRuntime" },
293
+ "environment": {
294
+ "type": "object",
295
+ "additionalProperties": { "$ref": "#/$defs/EnvironmentBinding" }
296
+ }
297
+ },
298
+ "required": ["type", "id", "runtime"],
299
+ "additionalProperties": false
300
+ },
301
+
302
+ "SkillContribution": {
303
+ "type": "object",
304
+ "properties": {
305
+ "type": { "const": "skill" },
306
+ "id": { "type": "string", "minLength": 1 },
307
+ "path": { "$ref": "#/$defs/PackageRelativePath" }
308
+ },
309
+ "required": ["type", "id", "path"],
310
+ "additionalProperties": false
311
+ },
312
+
313
+ "LimbContribution": {
314
+ "type": "object",
315
+ "properties": {
316
+ "type": { "const": "limb" },
317
+ "id": { "type": "string", "minLength": 1 },
318
+ "manifestPath": { "$ref": "#/$defs/PackageRelativePath" }
319
+ },
320
+ "required": ["type", "id", "manifestPath"],
321
+ "additionalProperties": false
322
+ },
323
+
324
+ "WebhookContribution": {
325
+ "type": "object",
326
+ "properties": {
327
+ "type": { "const": "webhook" },
328
+ "id": { "type": "string", "minLength": 1 },
329
+ "path": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]*(/[A-Za-z0-9][A-Za-z0-9_-]*)*$" },
330
+ "methods": { "type": "array", "items": { "type": "string", "enum": ["GET", "POST", "PUT", "DELETE"] }, "minItems": 1, "uniqueItems": true },
331
+ "action": { "$ref": "#/$defs/CallbackAction" },
332
+ "verificationSecretRef": { "type": "string", "minLength": 1 }
333
+ },
334
+ "required": ["type", "id", "path", "methods", "action"],
335
+ "additionalProperties": false
336
+ },
337
+
338
+ "MessageSubscriptionContribution": {
339
+ "type": "object",
340
+ "properties": {
341
+ "type": { "const": "message-subscription" },
342
+ "id": { "type": "string", "minLength": 1 },
343
+ "binding": { "type": "string", "minLength": 1 },
344
+ "filter": { "type": "object", "additionalProperties": true },
345
+ "action": { "$ref": "#/$defs/CallbackAction" }
346
+ },
347
+ "required": ["type", "id", "binding", "action"],
348
+ "additionalProperties": false
349
+ },
350
+
351
+ "ServiceContribution": {
352
+ "type": "object",
353
+ "properties": {
354
+ "type": { "const": "service" },
355
+ "id": { "type": "string", "minLength": 1 },
356
+ "runtime": { "$ref": "#/$defs/ContributionRuntime" },
357
+ "healthMethod": { "type": "string", "minLength": 1 },
358
+ "environment": {
359
+ "type": "object",
360
+ "additionalProperties": { "$ref": "#/$defs/EnvironmentBinding" }
361
+ }
362
+ },
363
+ "required": ["type", "id", "runtime", "healthMethod"],
364
+ "additionalProperties": false
365
+ },
366
+
367
+ "ConnectorContribution": {
368
+ "type": "object",
369
+ "properties": {
370
+ "type": { "const": "connector" },
371
+ "id": { "type": "string", "minLength": 1 },
372
+ "identityRef": { "type": "string", "minLength": 1 },
373
+ "inboundMethod": { "type": "string", "minLength": 1 },
374
+ "outboundMethod": { "type": "string", "minLength": 1 }
375
+ },
376
+ "required": ["type", "id", "identityRef", "inboundMethod", "outboundMethod"],
377
+ "additionalProperties": false
378
+ },
379
+
380
+ "UiWhenClause": {
381
+ "type": "object",
382
+ "properties": {
383
+ "featureEnabled": { "type": "boolean" },
384
+ "requiresCapabilities": {
385
+ "type": "array",
386
+ "items": { "$ref": "#/$defs/Capability" },
387
+ "minItems": 1,
388
+ "uniqueItems": true
389
+ }
390
+ },
391
+ "minProperties": 1,
392
+ "additionalProperties": false
393
+ },
394
+
395
+ "UiAnchor": {
396
+ "type": "object",
397
+ "properties": {
398
+ "position": { "type": "string", "enum": ["before", "after"] },
399
+ "target": { "type": "string", "minLength": 1 }
400
+ },
401
+ "required": ["position", "target"],
402
+ "additionalProperties": false
403
+ },
404
+
405
+ "UiCommandContribution": {
406
+ "type": "object",
407
+ "properties": {
408
+ "type": { "const": "ui" },
409
+ "id": { "type": "string", "minLength": 1 },
410
+ "kind": { "const": "command" },
411
+ "label": { "type": "string", "minLength": 1 },
412
+ "action": { "$ref": "#/$defs/CallbackAction" },
413
+ "when": { "$ref": "#/$defs/UiWhenClause" }
414
+ },
415
+ "required": ["type", "id", "kind", "label", "action"],
416
+ "additionalProperties": false
417
+ },
418
+
419
+ "UiSlotItemContribution": {
420
+ "type": "object",
421
+ "properties": {
422
+ "type": { "const": "ui" },
423
+ "id": { "type": "string", "minLength": 1 },
424
+ "kind": { "const": "slot-item" },
425
+ "label": { "type": "string", "minLength": 1 },
426
+ "command": { "type": "string", "minLength": 1 },
427
+ "group": { "type": "string", "minLength": 1 },
428
+ "anchor": { "$ref": "#/$defs/UiAnchor" },
429
+ "order": { "type": "integer", "minimum": -10000, "maximum": 10000 },
430
+ "when": { "$ref": "#/$defs/UiWhenClause" }
431
+ },
432
+ "required": ["type", "id", "kind", "label", "command", "group"],
433
+ "additionalProperties": false
434
+ },
435
+
436
+ "UiMessageElementContribution": {
437
+ "type": "object",
438
+ "properties": {
439
+ "type": { "const": "ui" },
440
+ "id": { "type": "string", "minLength": 1 },
441
+ "kind": { "const": "message-element" },
442
+ "label": { "type": "string", "minLength": 1 },
443
+ "elementKind": { "type": "string", "minLength": 1 },
444
+ "renderer": { "type": "string", "minLength": 1 },
445
+ "when": { "$ref": "#/$defs/UiWhenClause" }
446
+ },
447
+ "required": ["type", "id", "kind", "label", "elementKind", "renderer"],
448
+ "additionalProperties": false
449
+ },
450
+
451
+ "UiContribution": {
452
+ "oneOf": [
453
+ { "$ref": "#/$defs/UiCommandContribution" },
454
+ { "$ref": "#/$defs/UiSlotItemContribution" },
455
+ { "$ref": "#/$defs/UiMessageElementContribution" }
456
+ ]
457
+ },
458
+
459
+ "StaticContribution": {
460
+ "oneOf": [
461
+ { "$ref": "#/$defs/IdentityContribution" },
462
+ { "$ref": "#/$defs/ScheduleContribution" },
463
+ { "$ref": "#/$defs/DirectToolContribution" },
464
+ { "$ref": "#/$defs/McpContribution" },
465
+ { "$ref": "#/$defs/SkillContribution" },
466
+ { "$ref": "#/$defs/LimbContribution" },
467
+ { "$ref": "#/$defs/WebhookContribution" },
468
+ { "$ref": "#/$defs/MessageSubscriptionContribution" },
469
+ { "$ref": "#/$defs/ServiceContribution" },
470
+ { "$ref": "#/$defs/ConnectorContribution" },
471
+ { "$ref": "#/$defs/UiContribution" }
472
+ ]
473
+ },
474
+
103
475
  "PluginFeature": {
104
476
  "type": "object",
105
477
  "properties": {
@@ -109,6 +481,10 @@
109
481
  "type": "array",
110
482
  "items": { "$ref": "#/$defs/ResourceReference" }
111
483
  },
484
+ "contributions": {
485
+ "type": "array",
486
+ "items": { "$ref": "#/$defs/ContributionReference" }
487
+ },
112
488
  "capabilities": {
113
489
  "type": "array",
114
490
  "items": { "$ref": "#/$defs/Capability" },
@@ -133,7 +509,7 @@
133
509
  "type": "object",
134
510
  "properties": {
135
511
  "transport": { "$ref": "#/$defs/ExternalRuntimeTransport" },
136
- "entrypoint": { "type": "string", "minLength": 1 }
512
+ "entrypoint": { "$ref": "#/$defs/PackageRelativePath" }
137
513
  },
138
514
  "required": ["transport", "entrypoint"],
139
515
  "additionalProperties": false
@@ -169,7 +545,16 @@
169
545
  "description": "Must be an exact published semver version — no ranges, wildcards, or operator prefixes (five-step freeze: pin exact version). §9: numeric prerelease identifiers MUST NOT have leading zeroes."
170
546
  },
171
547
  "name": { "type": "string", "minLength": 1 },
172
- "description": { "type": "string" },
548
+ "description": { "$ref": "https://clowder-ai.dev/schemas/plugin-metadata/v1#/$defs/LocalizedDescription" },
549
+ "icon": { "$ref": "https://clowder-ai.dev/schemas/plugin-metadata/v1#/$defs/PluginIcon" },
550
+ "configuration": {
551
+ "type": "array",
552
+ "items": { "$ref": "#/$defs/ConfigurationField" }
553
+ },
554
+ "contributions": {
555
+ "type": "array",
556
+ "items": { "$ref": "#/$defs/StaticContribution" }
557
+ },
173
558
  "features": {
174
559
  "type": "array",
175
560
  "items": { "$ref": "#/$defs/PluginFeature" },
@@ -0,0 +1,62 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://clowder-ai.dev/schemas/plugin-metadata/v1",
4
+ "title": "Clowder AI Plugin Product Metadata (v1)",
5
+ "description": "Manifest-owned static product metadata projected into the repository catalog for Agent, Console, and Marketplace discovery.",
6
+ "$defs": {
7
+ "LocalizedDescriptionObject": {
8
+ "type": "object",
9
+ "properties": {
10
+ "default": { "type": "string", "minLength": 1, "maxLength": 4096 },
11
+ "translations": {
12
+ "type": "object",
13
+ "propertyNames": {
14
+ "pattern": "^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$"
15
+ },
16
+ "additionalProperties": { "type": "string", "minLength": 1, "maxLength": 4096 },
17
+ "minProperties": 1,
18
+ "maxProperties": 32
19
+ }
20
+ },
21
+ "required": ["default", "translations"],
22
+ "additionalProperties": false
23
+ },
24
+ "LocalizedDescription": {
25
+ "oneOf": [
26
+ { "type": "string", "minLength": 1, "maxLength": 4096 },
27
+ { "$ref": "#/$defs/LocalizedDescriptionObject" }
28
+ ]
29
+ },
30
+ "PackageAssetPath": {
31
+ "type": "string",
32
+ "minLength": 1,
33
+ "maxLength": 256,
34
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*(/[A-Za-z0-9][A-Za-z0-9._-]*)*$"
35
+ },
36
+ "PackageIcon": {
37
+ "type": "object",
38
+ "properties": {
39
+ "type": { "type": "string", "enum": ["svg", "png"] },
40
+ "src": { "$ref": "#/$defs/PackageAssetPath" }
41
+ },
42
+ "required": ["type", "src"],
43
+ "additionalProperties": false,
44
+ "allOf": [
45
+ {
46
+ "if": { "properties": { "type": { "const": "svg" } }, "required": ["type"] },
47
+ "then": { "properties": { "src": { "pattern": "\\.svg$" } } }
48
+ },
49
+ {
50
+ "if": { "properties": { "type": { "const": "png" } }, "required": ["type"] },
51
+ "then": { "properties": { "src": { "pattern": "\\.png$" } } }
52
+ }
53
+ ]
54
+ },
55
+ "PluginIcon": {
56
+ "oneOf": [
57
+ { "const": "github" },
58
+ { "$ref": "#/$defs/PackageIcon" }
59
+ ]
60
+ }
61
+ }
62
+ }