@clowder-ai/plugin-contract 0.2.0 → 0.3.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/codegen/generate-contract.d.ts.map +1 -1
- package/dist/codegen/generate-contract.js +0 -30
- package/dist/codegen/generate-contract.js.map +1 -1
- package/dist/conformance/index.d.ts +1 -2
- package/dist/conformance/index.d.ts.map +1 -1
- package/dist/conformance/index.js +1 -2
- package/dist/conformance/index.js.map +1 -1
- package/dist/conformance/messaging-behavior-fixture.d.ts +1 -1
- package/dist/conformance/messaging-behavior-fixture.d.ts.map +1 -1
- package/dist/conformance/messaging-behavior-fixture.js +1 -7
- package/dist/conformance/messaging-behavior-fixture.js.map +1 -1
- package/dist/conformance/messaging-loopback-adapter.d.ts +0 -3
- package/dist/conformance/messaging-loopback-adapter.d.ts.map +1 -1
- package/dist/conformance/messaging-loopback-adapter.js +1 -77
- package/dist/conformance/messaging-loopback-adapter.js.map +1 -1
- package/dist/conformance/messaging-loopback-state.d.ts +0 -6
- package/dist/conformance/messaging-loopback-state.d.ts.map +1 -1
- package/dist/conformance/messaging-loopback-state.js +0 -20
- package/dist/conformance/messaging-loopback-state.js.map +1 -1
- package/dist/generated/contract.generated.d.ts +6 -51
- package/dist/generated/contract.generated.d.ts.map +1 -1
- package/dist/generated/contract.generated.js +0 -8
- package/dist/generated/contract.generated.js.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +0 -1
- package/dist/types/index.js.map +1 -1
- package/dist/validation/manifest.d.ts.map +1 -1
- package/dist/validation/manifest.js +29 -15
- package/dist/validation/manifest.js.map +1 -1
- package/dist/wire/dispatch.d.ts.map +1 -1
- package/dist/wire/dispatch.js +0 -10
- package/dist/wire/dispatch.js.map +1 -1
- package/dist/wire/disposition-fixtures.d.ts +1 -1
- package/dist/wire/disposition-fixtures.d.ts.map +1 -1
- package/dist/wire/disposition-fixtures.js +0 -96
- package/dist/wire/disposition-fixtures.js.map +1 -1
- package/dist/wire/disposition.d.ts +3 -4
- package/dist/wire/disposition.d.ts.map +1 -1
- package/dist/wire/disposition.js +5 -16
- package/dist/wire/disposition.js.map +1 -1
- package/dist/wire/envelope.d.ts +0 -1
- package/dist/wire/envelope.d.ts.map +1 -1
- package/dist/wire/envelope.js.map +1 -1
- package/dist/wire/handshake-byte-bounds.d.ts.map +1 -1
- package/dist/wire/handshake-byte-bounds.js +0 -6
- package/dist/wire/handshake-byte-bounds.js.map +1 -1
- package/dist/wire/handshake.d.ts +6 -11
- package/dist/wire/handshake.d.ts.map +1 -1
- package/dist/wire/handshake.js +5 -12
- package/dist/wire/handshake.js.map +1 -1
- package/dist/wire/index.d.ts +2 -4
- package/dist/wire/index.d.ts.map +1 -1
- package/dist/wire/index.js +1 -3
- package/dist/wire/index.js.map +1 -1
- package/dist/wire/lifecycle-byte-bounds.d.ts.map +1 -1
- package/dist/wire/lifecycle-byte-bounds.js +0 -1
- package/dist/wire/lifecycle-byte-bounds.js.map +1 -1
- package/dist/wire/registry.d.ts +2 -23
- package/dist/wire/registry.d.ts.map +1 -1
- package/dist/wire/registry.js +2 -21
- package/dist/wire/registry.js.map +1 -1
- package/dist/wire/row-shapes.d.ts +0 -16
- package/dist/wire/row-shapes.d.ts.map +1 -1
- package/dist/wire/row-shapes.js.map +1 -1
- package/fixtures/behavior/messaging/adversarial-invariants.json +5 -216
- package/fixtures/manifest/invalid/contract-version-leading-zero-prerelease.json +1 -3
- package/fixtures/manifest/invalid/contract-version-range.json +1 -3
- package/fixtures/manifest/invalid/duplicate-signal-type.json +1 -3
- package/fixtures/manifest/invalid/icon-package-escape.json +1 -3
- package/fixtures/manifest/invalid/ipc-empty-entrypoint.json +1 -3
- package/fixtures/manifest/invalid/plugin-version-leading-zero-prerelease.json +1 -3
- package/fixtures/manifest/invalid/plugin-version-not-semver.json +1 -3
- package/fixtures/manifest/invalid/semver-empty-build-metadata.json +1 -3
- package/fixtures/manifest/invalid/stdio-missing-entrypoint.json +1 -3
- package/fixtures/manifest/invalid/user-authored-lifecycle.json +1 -3
- package/fixtures/manifest/valid/localized-product-metadata.json +1 -3
- package/fixtures/manifest/valid/minimal-builtin.json +1 -3
- package/fixtures/manifest/valid/protocol-intrinsic-lifecycle.json +1 -3
- package/fixtures/manifest/valid/semver-build-metadata.json +1 -3
- package/fixtures/manifest/valid/stdio-entrypoint.json +1 -3
- package/package.json +2 -2
- package/src/schemas/behavior-fixture.schema.json +0 -139
- package/src/schemas/manifest.schema.json +7 -103
- package/dist/types/capability.d.ts +0 -4
- package/dist/types/capability.d.ts.map +0 -1
- package/dist/types/capability.js +0 -11
- package/dist/types/capability.js.map +0 -1
- package/dist/wire/grants.d.ts +0 -57
- package/dist/wire/grants.d.ts.map +0 -1
- package/dist/wire/grants.js +0 -59
- package/dist/wire/grants.js.map +0 -1
- package/fixtures/manifest/invalid/unknown-capability.json +0 -19
|
@@ -115,13 +115,6 @@
|
|
|
115
115
|
"caller": {
|
|
116
116
|
"$ref": "#/$defs/FixtureCaller"
|
|
117
117
|
},
|
|
118
|
-
"grants": {
|
|
119
|
-
"type": "array",
|
|
120
|
-
"items": {
|
|
121
|
-
"$ref": "#/$defs/CapabilityName"
|
|
122
|
-
},
|
|
123
|
-
"uniqueItems": true
|
|
124
|
-
},
|
|
125
118
|
"handles": {
|
|
126
119
|
"type": "object",
|
|
127
120
|
"additionalProperties": {
|
|
@@ -135,7 +128,6 @@
|
|
|
135
128
|
},
|
|
136
129
|
"required": [
|
|
137
130
|
"caller",
|
|
138
|
-
"grants",
|
|
139
131
|
"handles",
|
|
140
132
|
"state"
|
|
141
133
|
],
|
|
@@ -239,38 +231,6 @@
|
|
|
239
231
|
],
|
|
240
232
|
"additionalProperties": false
|
|
241
233
|
},
|
|
242
|
-
{
|
|
243
|
-
"type": "object",
|
|
244
|
-
"properties": {
|
|
245
|
-
"operation": {
|
|
246
|
-
"const": "applyGrantPreset"
|
|
247
|
-
},
|
|
248
|
-
"input": {
|
|
249
|
-
"$ref": "#/$defs/GrantPresetInput"
|
|
250
|
-
}
|
|
251
|
-
},
|
|
252
|
-
"required": [
|
|
253
|
-
"operation",
|
|
254
|
-
"input"
|
|
255
|
-
],
|
|
256
|
-
"additionalProperties": false
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
"type": "object",
|
|
260
|
-
"properties": {
|
|
261
|
-
"operation": {
|
|
262
|
-
"const": "revokeGrant"
|
|
263
|
-
},
|
|
264
|
-
"input": {
|
|
265
|
-
"$ref": "#/$defs/RevokeGrantInput"
|
|
266
|
-
}
|
|
267
|
-
},
|
|
268
|
-
"required": [
|
|
269
|
-
"operation",
|
|
270
|
-
"input"
|
|
271
|
-
],
|
|
272
|
-
"additionalProperties": false
|
|
273
|
-
},
|
|
274
234
|
{
|
|
275
235
|
"type": "object",
|
|
276
236
|
"properties": {
|
|
@@ -287,22 +247,6 @@
|
|
|
287
247
|
],
|
|
288
248
|
"additionalProperties": false
|
|
289
249
|
},
|
|
290
|
-
{
|
|
291
|
-
"type": "object",
|
|
292
|
-
"properties": {
|
|
293
|
-
"operation": {
|
|
294
|
-
"const": "checkPermissionMatrix"
|
|
295
|
-
},
|
|
296
|
-
"input": {
|
|
297
|
-
"$ref": "#/$defs/PermissionMatrixInput"
|
|
298
|
-
}
|
|
299
|
-
},
|
|
300
|
-
"required": [
|
|
301
|
-
"operation",
|
|
302
|
-
"input"
|
|
303
|
-
],
|
|
304
|
-
"additionalProperties": false
|
|
305
|
-
},
|
|
306
250
|
{
|
|
307
251
|
"type": "object",
|
|
308
252
|
"properties": {
|
|
@@ -549,42 +493,6 @@
|
|
|
549
493
|
],
|
|
550
494
|
"additionalProperties": false
|
|
551
495
|
},
|
|
552
|
-
"CapabilityName": {
|
|
553
|
-
"$ref": "https://clowder-ai.dev/schemas/manifest/v0.1#/$defs/Capability"
|
|
554
|
-
},
|
|
555
|
-
"GrantPresetInput": {
|
|
556
|
-
"type": "object",
|
|
557
|
-
"properties": {
|
|
558
|
-
"presetKind": {
|
|
559
|
-
"const": "first_party"
|
|
560
|
-
},
|
|
561
|
-
"capabilities": {
|
|
562
|
-
"type": "array",
|
|
563
|
-
"items": {
|
|
564
|
-
"$ref": "#/$defs/CapabilityName"
|
|
565
|
-
},
|
|
566
|
-
"minItems": 1,
|
|
567
|
-
"uniqueItems": true
|
|
568
|
-
}
|
|
569
|
-
},
|
|
570
|
-
"required": [
|
|
571
|
-
"presetKind",
|
|
572
|
-
"capabilities"
|
|
573
|
-
],
|
|
574
|
-
"additionalProperties": false
|
|
575
|
-
},
|
|
576
|
-
"RevokeGrantInput": {
|
|
577
|
-
"type": "object",
|
|
578
|
-
"properties": {
|
|
579
|
-
"capability": {
|
|
580
|
-
"$ref": "#/$defs/CapabilityName"
|
|
581
|
-
}
|
|
582
|
-
},
|
|
583
|
-
"required": [
|
|
584
|
-
"capability"
|
|
585
|
-
],
|
|
586
|
-
"additionalProperties": false
|
|
587
|
-
},
|
|
588
496
|
"OnMessageDeliveryInput": {
|
|
589
497
|
"type": "object",
|
|
590
498
|
"properties": {
|
|
@@ -602,48 +510,6 @@
|
|
|
602
510
|
],
|
|
603
511
|
"additionalProperties": false
|
|
604
512
|
},
|
|
605
|
-
"PermissionMatrixEntry": {
|
|
606
|
-
"type": "object",
|
|
607
|
-
"properties": {
|
|
608
|
-
"capability": {
|
|
609
|
-
"$ref": "#/$defs/CapabilityName"
|
|
610
|
-
},
|
|
611
|
-
"layer": {
|
|
612
|
-
"type": "string",
|
|
613
|
-
"enum": [
|
|
614
|
-
"L0",
|
|
615
|
-
"L1",
|
|
616
|
-
"L2"
|
|
617
|
-
]
|
|
618
|
-
},
|
|
619
|
-
"firstPartyPreset": {
|
|
620
|
-
"type": "boolean"
|
|
621
|
-
}
|
|
622
|
-
},
|
|
623
|
-
"required": [
|
|
624
|
-
"capability",
|
|
625
|
-
"layer",
|
|
626
|
-
"firstPartyPreset"
|
|
627
|
-
],
|
|
628
|
-
"additionalProperties": false
|
|
629
|
-
},
|
|
630
|
-
"PermissionMatrixInput": {
|
|
631
|
-
"type": "object",
|
|
632
|
-
"properties": {
|
|
633
|
-
"entries": {
|
|
634
|
-
"type": "array",
|
|
635
|
-
"items": {
|
|
636
|
-
"$ref": "#/$defs/PermissionMatrixEntry"
|
|
637
|
-
},
|
|
638
|
-
"minItems": 22,
|
|
639
|
-
"maxItems": 22
|
|
640
|
-
}
|
|
641
|
-
},
|
|
642
|
-
"required": [
|
|
643
|
-
"entries"
|
|
644
|
-
],
|
|
645
|
-
"additionalProperties": false
|
|
646
|
-
},
|
|
647
513
|
"DeleteReplayEventsInput": {
|
|
648
514
|
"type": "object",
|
|
649
515
|
"properties": {
|
|
@@ -688,8 +554,6 @@
|
|
|
688
554
|
"snapshot",
|
|
689
555
|
"reply_preview",
|
|
690
556
|
"provenance",
|
|
691
|
-
"grant_state",
|
|
692
|
-
"permission_matrix",
|
|
693
557
|
"replay_events"
|
|
694
558
|
]
|
|
695
559
|
},
|
|
@@ -1119,9 +983,6 @@
|
|
|
1119
983
|
"properties": {
|
|
1120
984
|
"operation": {
|
|
1121
985
|
"enum": [
|
|
1122
|
-
"applyGrantPreset",
|
|
1123
|
-
"revokeGrant",
|
|
1124
|
-
"checkPermissionMatrix",
|
|
1125
986
|
"deleteReplayEvents"
|
|
1126
987
|
]
|
|
1127
988
|
}
|
|
@@ -2,37 +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
|
|
6
|
-
"x-clowder-capability-layers": {
|
|
7
|
-
"L0": [
|
|
8
|
-
"plugin.config.read",
|
|
9
|
-
"plugin.state.get",
|
|
10
|
-
"plugin.state.set"
|
|
11
|
-
],
|
|
12
|
-
"L1": [
|
|
13
|
-
"messaging.send",
|
|
14
|
-
"schedule.register",
|
|
15
|
-
"messaging.appendElements",
|
|
16
|
-
"streams.read"
|
|
17
|
-
],
|
|
18
|
-
"L2": [
|
|
19
|
-
"onMessage",
|
|
20
|
-
"message.event.subscribe",
|
|
21
|
-
"secret.read",
|
|
22
|
-
"thread.listMetadata",
|
|
23
|
-
"thread.readContent",
|
|
24
|
-
"thread.write",
|
|
25
|
-
"task.read",
|
|
26
|
-
"task.write",
|
|
27
|
-
"task.admitEntrusted",
|
|
28
|
-
"memory.query",
|
|
29
|
-
"memory.append",
|
|
30
|
-
"memory.retrieve",
|
|
31
|
-
"windows.create",
|
|
32
|
-
"whisper.extend",
|
|
33
|
-
"cloud.conversation.host"
|
|
34
|
-
]
|
|
35
|
-
},
|
|
5
|
+
"description": "Machine-readable plugin declarations, configuration, runtime and contributions.",
|
|
36
6
|
"x-clowder-data-class-strategies": {
|
|
37
7
|
"cache": [
|
|
38
8
|
"lifecycle",
|
|
@@ -123,33 +93,6 @@
|
|
|
123
93
|
"ask-on-uninstall"
|
|
124
94
|
]
|
|
125
95
|
},
|
|
126
|
-
"Capability": {
|
|
127
|
-
"type": "string",
|
|
128
|
-
"enum": [
|
|
129
|
-
"plugin.config.read",
|
|
130
|
-
"plugin.state.get",
|
|
131
|
-
"plugin.state.set",
|
|
132
|
-
"messaging.send",
|
|
133
|
-
"schedule.register",
|
|
134
|
-
"messaging.appendElements",
|
|
135
|
-
"streams.read",
|
|
136
|
-
"onMessage",
|
|
137
|
-
"message.event.subscribe",
|
|
138
|
-
"secret.read",
|
|
139
|
-
"thread.listMetadata",
|
|
140
|
-
"thread.readContent",
|
|
141
|
-
"thread.write",
|
|
142
|
-
"task.read",
|
|
143
|
-
"task.write",
|
|
144
|
-
"task.admitEntrusted",
|
|
145
|
-
"memory.query",
|
|
146
|
-
"memory.append",
|
|
147
|
-
"memory.retrieve",
|
|
148
|
-
"windows.create",
|
|
149
|
-
"whisper.extend",
|
|
150
|
-
"cloud.conversation.host"
|
|
151
|
-
]
|
|
152
|
-
},
|
|
153
96
|
"DataDeclaration": {
|
|
154
97
|
"type": "object",
|
|
155
98
|
"properties": {
|
|
@@ -197,7 +140,7 @@
|
|
|
197
140
|
"retained",
|
|
198
141
|
"ask-on-uninstall"
|
|
199
142
|
],
|
|
200
|
-
"description": "User-visible/relationship data MUST be retained or ask-on-uninstall. lifecycle is structurally forbidden (
|
|
143
|
+
"description": "User-visible/relationship data MUST be retained or ask-on-uninstall. lifecycle is structurally forbidden (铁律 #5: user state defaults to persistent)."
|
|
201
144
|
}
|
|
202
145
|
}
|
|
203
146
|
}
|
|
@@ -1089,20 +1032,6 @@
|
|
|
1089
1032
|
],
|
|
1090
1033
|
"additionalProperties": false
|
|
1091
1034
|
},
|
|
1092
|
-
"McpActionMethod": {
|
|
1093
|
-
"description": "A native MCP method allowlist entry, without fixed business parameters.",
|
|
1094
|
-
"type": "object",
|
|
1095
|
-
"properties": {
|
|
1096
|
-
"method": {
|
|
1097
|
-
"type": "string",
|
|
1098
|
-
"minLength": 1
|
|
1099
|
-
}
|
|
1100
|
-
},
|
|
1101
|
-
"required": [
|
|
1102
|
-
"method"
|
|
1103
|
-
],
|
|
1104
|
-
"additionalProperties": false
|
|
1105
|
-
},
|
|
1106
1035
|
"McpContribution": {
|
|
1107
1036
|
"type": "object",
|
|
1108
1037
|
"properties": {
|
|
@@ -1116,15 +1045,6 @@
|
|
|
1116
1045
|
"runtime": {
|
|
1117
1046
|
"$ref": "#/$defs/ContributionRuntime"
|
|
1118
1047
|
},
|
|
1119
|
-
"actions": {
|
|
1120
|
-
"description": "Module methods callable by this native MCP server; these do not publish direct tools.",
|
|
1121
|
-
"type": "array",
|
|
1122
|
-
"minItems": 1,
|
|
1123
|
-
"uniqueItems": true,
|
|
1124
|
-
"items": {
|
|
1125
|
-
"$ref": "#/$defs/McpActionMethod"
|
|
1126
|
-
}
|
|
1127
|
-
},
|
|
1128
1048
|
"environment": {
|
|
1129
1049
|
"type": "object",
|
|
1130
1050
|
"additionalProperties": {
|
|
@@ -1365,7 +1285,7 @@
|
|
|
1365
1285
|
},
|
|
1366
1286
|
"CloudConversationHostContribution": {
|
|
1367
1287
|
"type": "object",
|
|
1368
|
-
"description": "Declares that this package hosts one cloud conversation provider: the Host sends owner cloud-cat messages through appendMessage and pulls assistant returns through assistantReturns.list / ack. Method semantics come from the manifest only; runtime data can never introduce new methods. Error codes are data (external-process transports flatten thrown errors): NEEDS_BINDING / BOUND_CONVERSATION_MISMATCH -> needs-binding (incl. h4); HOST_UNAVAILABLE -> treated as no adapter (null); every other code (the STALE_* revisions, AMBIGUOUS_EFFECT, IDEMPOTENCY_CONFLICT, NEEDS_AUTHORIZATION, HOST_STOPPED, PAIRING_REJECTED, ...) and any unknown code -> host-append-failed. HOST_UNAVAILABLE must only describe failures before a request could have had any effect (no pairing record, missing socket, connection refused); any error after the request was written is AMBIGUOUS_EFFECT.
|
|
1288
|
+
"description": "Declares that this package hosts one cloud conversation provider: the Host sends owner cloud-cat messages through appendMessage and pulls assistant returns through assistantReturns.list / ack. Method semantics come from the manifest only; runtime data can never introduce new methods. Error codes are data (external-process transports flatten thrown errors): NEEDS_BINDING / BOUND_CONVERSATION_MISMATCH -> needs-binding (incl. h4); HOST_UNAVAILABLE -> treated as no adapter (null); every other code (the STALE_* revisions, AMBIGUOUS_EFFECT, IDEMPOTENCY_CONFLICT, NEEDS_AUTHORIZATION, HOST_STOPPED, PAIRING_REJECTED, ...) and any unknown code -> host-append-failed. HOST_UNAVAILABLE must only describe failures before a request could have had any effect (no pairing record, missing socket, connection refused); any error after the request was written is AMBIGUOUS_EFFECT. One provider accepts at most one enabled package.",
|
|
1369
1289
|
"properties": {
|
|
1370
1290
|
"type": {
|
|
1371
1291
|
"const": "cloud-conversation-host"
|
|
@@ -1778,14 +1698,6 @@
|
|
|
1778
1698
|
"properties": {
|
|
1779
1699
|
"featureEnabled": {
|
|
1780
1700
|
"type": "boolean"
|
|
1781
|
-
},
|
|
1782
|
-
"requiresCapabilities": {
|
|
1783
|
-
"type": "array",
|
|
1784
|
-
"items": {
|
|
1785
|
-
"$ref": "#/$defs/Capability"
|
|
1786
|
-
},
|
|
1787
|
-
"minItems": 1,
|
|
1788
|
-
"uniqueItems": true
|
|
1789
1701
|
}
|
|
1790
1702
|
},
|
|
1791
1703
|
"minProperties": 1,
|
|
@@ -1973,7 +1885,7 @@
|
|
|
1973
1885
|
},
|
|
1974
1886
|
"DesktopWindowContribution": {
|
|
1975
1887
|
"type": "object",
|
|
1976
|
-
"description": "Host-created desktop surface
|
|
1888
|
+
"description": "Host-created desktop surface owned by its declared feature. 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.",
|
|
1977
1889
|
"properties": {
|
|
1978
1890
|
"type": {
|
|
1979
1891
|
"const": "desktop-window"
|
|
@@ -2211,20 +2123,12 @@
|
|
|
2211
2123
|
"items": {
|
|
2212
2124
|
"$ref": "#/$defs/ContributionReference"
|
|
2213
2125
|
}
|
|
2214
|
-
},
|
|
2215
|
-
"capabilities": {
|
|
2216
|
-
"type": "array",
|
|
2217
|
-
"items": {
|
|
2218
|
-
"$ref": "#/$defs/Capability"
|
|
2219
|
-
},
|
|
2220
|
-
"description": "@signed(G-0 2026-07-15) \u2014 capability vocabulary is contract-versioned (P15). Adding a new capability = new contract version. Unknown strings are structurally rejected at schema level; authorization is a separate host runtime layer. Lifecycle callbacks are protocol-intrinsic baseline behavior, so they are not grantable or revocable capability IDs."
|
|
2221
2126
|
}
|
|
2222
2127
|
},
|
|
2223
2128
|
"required": [
|
|
2224
2129
|
"id",
|
|
2225
2130
|
"name",
|
|
2226
|
-
"resources"
|
|
2227
|
-
"capabilities"
|
|
2131
|
+
"resources"
|
|
2228
2132
|
],
|
|
2229
2133
|
"additionalProperties": false
|
|
2230
2134
|
},
|
|
@@ -2299,11 +2203,11 @@
|
|
|
2299
2203
|
},
|
|
2300
2204
|
"version": {
|
|
2301
2205
|
"$ref": "#/$defs/SemVer",
|
|
2302
|
-
"description": "Plugin version
|
|
2206
|
+
"description": "Plugin version — must be valid semver (§9: numeric prerelease identifiers MUST NOT have leading zeroes)."
|
|
2303
2207
|
},
|
|
2304
2208
|
"contractVersion": {
|
|
2305
2209
|
"$ref": "#/$defs/SemVer",
|
|
2306
|
-
"description": "Must be an exact published semver version
|
|
2210
|
+
"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."
|
|
2307
2211
|
},
|
|
2308
2212
|
"name": {
|
|
2309
2213
|
"type": "string",
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type AuthorizationLayer } from '../generated/contract.generated.js';
|
|
2
|
-
/** Return the schema-owned authorization layer for a capability identifier. */
|
|
3
|
-
export declare function getCapabilityLayer(capability: string): AuthorizationLayer | undefined;
|
|
4
|
-
//# sourceMappingURL=capability.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"capability.d.ts","sourceRoot":"","sources":["../../src/types/capability.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,oCAAoC,CAAC;AAE5C,+EAA+E;AAC/E,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS,CAOrF"}
|
package/dist/types/capability.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { CAPABILITY_TABLE, } from '../generated/contract.generated.js';
|
|
2
|
-
/** Return the schema-owned authorization layer for a capability identifier. */
|
|
3
|
-
export function getCapabilityLayer(capability) {
|
|
4
|
-
for (const layer of Object.keys(CAPABILITY_TABLE)) {
|
|
5
|
-
if (CAPABILITY_TABLE[layer].includes(capability)) {
|
|
6
|
-
return layer;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
return undefined;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=capability.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"capability.js","sourceRoot":"","sources":["../../src/types/capability.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,GAEjB,MAAM,oCAAoC,CAAC;AAE5C,+EAA+E;AAC/E,MAAM,UAAU,kBAAkB,CAAC,UAAkB;IACnD,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAyB,EAAE,CAAC;QAC1E,IAAK,gBAAgB,CAAC,KAAK,CAAuB,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;YACxE,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/dist/wire/grants.d.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Grant snapshot types — GrantSnapshot for SessionBinding and host.grants.changed.
|
|
3
|
-
* Mechanized verbatim from #1165 frozen shape.
|
|
4
|
-
*
|
|
5
|
-
* GrantSnapshot represents the effective capability set at a point in time.
|
|
6
|
-
* It appears in two locations:
|
|
7
|
-
* - SessionBinding (initial grant state at handshake)
|
|
8
|
-
* - host.grants.changed notification (runtime grant mutations)
|
|
9
|
-
*
|
|
10
|
-
* grantRevision is strictly monotonic per plugin instance — the Host
|
|
11
|
-
* increments it on every grant mutation. A plugin that observes
|
|
12
|
-
* revision N may discard any notification with revision < N.
|
|
13
|
-
*/
|
|
14
|
-
import type { Capability } from '../generated/contract.generated.js';
|
|
15
|
-
/**
|
|
16
|
-
* Maximum number of items in effectiveGrants.
|
|
17
|
-
* Derived from the signed Capability enum — a plugin cannot hold
|
|
18
|
-
* more capabilities than exist.
|
|
19
|
-
*/
|
|
20
|
-
export declare const MAX_GRANT_ITEMS: 28;
|
|
21
|
-
/**
|
|
22
|
-
* GrantSnapshot captures a versioned capability set.
|
|
23
|
-
*
|
|
24
|
-
* Used in SessionBinding (handshake) and host.grants.changed (notification).
|
|
25
|
-
* The two fields are always paired and always travel together.
|
|
26
|
-
*/
|
|
27
|
-
export interface GrantSnapshot {
|
|
28
|
-
/**
|
|
29
|
-
* WireUInt53(0, 9_007_199_254_740_991).
|
|
30
|
-
* Monotonically increasing per plugin instance.
|
|
31
|
-
* The Host is the sole writer; plugins observe only.
|
|
32
|
-
*/
|
|
33
|
-
readonly grantRevision: number;
|
|
34
|
-
/**
|
|
35
|
-
* Unique Capability[], 0..20 items.
|
|
36
|
-
* Duplicates are a protocol violation (Host guarantees uniqueness).
|
|
37
|
-
* Empty array is valid (plugin has no capabilities).
|
|
38
|
-
*/
|
|
39
|
-
readonly effectiveGrants: readonly Capability[];
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Frozen set of all valid Capability values, derived from the generated
|
|
43
|
-
* L0/L1/L2 capability arrays. Used for closed-enum membership checks.
|
|
44
|
-
*/
|
|
45
|
-
export declare const VALID_CAPABILITIES: ReadonlySet<string>;
|
|
46
|
-
/**
|
|
47
|
-
* Validate that effectiveGrants:
|
|
48
|
-
* 1. Does not exceed MAX_GRANT_ITEMS (28).
|
|
49
|
-
* 2. Contains no duplicates.
|
|
50
|
-
* 3. Contains only valid Capability enum members (closed-enum check).
|
|
51
|
-
*
|
|
52
|
-
* Fail-closed: any unrecognized capability value returns false.
|
|
53
|
-
* This is an authorization boundary — fail-open would allow
|
|
54
|
-
* uncontrolled privilege escalation.
|
|
55
|
-
*/
|
|
56
|
-
export declare function validateEffectiveGrants(grants: readonly string[]): boolean;
|
|
57
|
-
//# sourceMappingURL=grants.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"grants.d.ts","sourceRoot":"","sources":["../../src/wire/grants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAWrE;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAG,EAAW,CAAC;AAM3C;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,eAAe,EAAE,SAAS,UAAU,EAAE,CAAC;CACjD;AAMD;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAIjD,CAAC;AAEH;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAS1E"}
|
package/dist/wire/grants.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Grant snapshot types — GrantSnapshot for SessionBinding and host.grants.changed.
|
|
3
|
-
* Mechanized verbatim from #1165 frozen shape.
|
|
4
|
-
*
|
|
5
|
-
* GrantSnapshot represents the effective capability set at a point in time.
|
|
6
|
-
* It appears in two locations:
|
|
7
|
-
* - SessionBinding (initial grant state at handshake)
|
|
8
|
-
* - host.grants.changed notification (runtime grant mutations)
|
|
9
|
-
*
|
|
10
|
-
* grantRevision is strictly monotonic per plugin instance — the Host
|
|
11
|
-
* increments it on every grant mutation. A plugin that observes
|
|
12
|
-
* revision N may discard any notification with revision < N.
|
|
13
|
-
*/
|
|
14
|
-
import { L0_CAPABILITIES, L1_CAPABILITIES, L2_CAPABILITIES, } from '../generated/contract.generated.js';
|
|
15
|
-
// ---------------------------------------------------------------------------
|
|
16
|
-
// Constants
|
|
17
|
-
// ---------------------------------------------------------------------------
|
|
18
|
-
/**
|
|
19
|
-
* Maximum number of items in effectiveGrants.
|
|
20
|
-
* Derived from the signed Capability enum — a plugin cannot hold
|
|
21
|
-
* more capabilities than exist.
|
|
22
|
-
*/
|
|
23
|
-
export const MAX_GRANT_ITEMS = 28;
|
|
24
|
-
// ---------------------------------------------------------------------------
|
|
25
|
-
// Validators
|
|
26
|
-
// ---------------------------------------------------------------------------
|
|
27
|
-
/**
|
|
28
|
-
* Frozen set of all valid Capability values, derived from the generated
|
|
29
|
-
* L0/L1/L2 capability arrays. Used for closed-enum membership checks.
|
|
30
|
-
*/
|
|
31
|
-
export const VALID_CAPABILITIES = new Set([
|
|
32
|
-
...L0_CAPABILITIES,
|
|
33
|
-
...L1_CAPABILITIES,
|
|
34
|
-
...L2_CAPABILITIES,
|
|
35
|
-
]);
|
|
36
|
-
/**
|
|
37
|
-
* Validate that effectiveGrants:
|
|
38
|
-
* 1. Does not exceed MAX_GRANT_ITEMS (28).
|
|
39
|
-
* 2. Contains no duplicates.
|
|
40
|
-
* 3. Contains only valid Capability enum members (closed-enum check).
|
|
41
|
-
*
|
|
42
|
-
* Fail-closed: any unrecognized capability value returns false.
|
|
43
|
-
* This is an authorization boundary — fail-open would allow
|
|
44
|
-
* uncontrolled privilege escalation.
|
|
45
|
-
*/
|
|
46
|
-
export function validateEffectiveGrants(grants) {
|
|
47
|
-
if (grants.length > MAX_GRANT_ITEMS)
|
|
48
|
-
return false;
|
|
49
|
-
const seen = new Set();
|
|
50
|
-
for (const g of grants) {
|
|
51
|
-
if (!VALID_CAPABILITIES.has(g))
|
|
52
|
-
return false; // unknown capability
|
|
53
|
-
if (seen.has(g))
|
|
54
|
-
return false; // duplicate
|
|
55
|
-
seen.add(g);
|
|
56
|
-
}
|
|
57
|
-
return true;
|
|
58
|
-
}
|
|
59
|
-
//# sourceMappingURL=grants.js.map
|
package/dist/wire/grants.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"grants.js","sourceRoot":"","sources":["../../src/wire/grants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EACL,eAAe,EACf,eAAe,EACf,eAAe,GAChB,MAAM,oCAAoC,CAAC;AAE5C,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAE9E;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,EAAW,CAAC;AA2B3C,8EAA8E;AAC9E,aAAa;AACb,8EAA8E;AAE9E;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAwB,IAAI,GAAG,CAAS;IACrE,GAAG,eAAe;IAClB,GAAG,eAAe;IAClB,GAAG,eAAe;CACnB,CAAC,CAAC;AAEH;;;;;;;;;GASG;AACH,MAAM,UAAU,uBAAuB,CAAC,MAAyB;IAC/D,IAAI,MAAM,CAAC,MAAM,GAAG,eAAe;QAAE,OAAO,KAAK,CAAC;IAClD,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;QACvB,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC;YAAE,OAAO,KAAK,CAAC,CAAC,qBAAqB;QACnE,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;YAAE,OAAO,KAAK,CAAC,CAAgB,YAAY;QAC1D,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACd,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"pluginId": "dev.clowder.fixture.unknown-capability",
|
|
3
|
-
"version": "0.1.0",
|
|
4
|
-
"contractVersion": "0.1.0",
|
|
5
|
-
"name": "Unknown capability fixture",
|
|
6
|
-
"features": [
|
|
7
|
-
{
|
|
8
|
-
"id": "escape",
|
|
9
|
-
"name": "Escape",
|
|
10
|
-
"resources": [],
|
|
11
|
-
"capabilities": [
|
|
12
|
-
"host.unrestricted"
|
|
13
|
-
]
|
|
14
|
-
}
|
|
15
|
-
],
|
|
16
|
-
"runtime": {
|
|
17
|
-
"transport": "builtin"
|
|
18
|
-
}
|
|
19
|
-
}
|