@dp-bohrium/widget-contracts 0.0.1
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/LICENSE +21 -0
- package/README.md +190 -0
- package/conformance/bridge/capability-request.json +23 -0
- package/conformance/bridge/network-fetch-denied.json +16 -0
- package/conformance/bridge/network-fetch-request.json +19 -0
- package/conformance/bridge/network-fetch-success.json +22 -0
- package/conformance/bridge/presentation-change-surface-request.json +14 -0
- package/conformance/bridge/presentation-close-request.json +14 -0
- package/conformance/bridge/presentation-close-success.json +11 -0
- package/conformance/bridge/presentation-downgrade-success.json +14 -0
- package/conformance/bridge/presentation-focus-backward-request.json +14 -0
- package/conformance/bridge/presentation-focus-boundary-success.json +14 -0
- package/conformance/bridge/presentation-focus-forward-request.json +14 -0
- package/conformance/bridge/presentation-init.json +70 -0
- package/conformance/bridge/presentation-policy-denied.json +16 -0
- package/conformance/bridge/presentation-present-request.json +14 -0
- package/conformance/bridge/presentation-user-denied.json +16 -0
- package/conformance/bridge/ready.json +11 -0
- package/conformance/bundles/minimal-file-preview/entry.js +1 -0
- package/conformance/bundles/minimal-file-preview/manifest.json +12 -0
- package/conformance/bundles/minimal-file-preview/samples/file-preview.json +1 -0
- package/conformance/bundles/minimal-panel/entry.js +1 -0
- package/conformance/bundles/minimal-panel/manifest.json +11 -0
- package/conformance/bundles/minimal-panel/samples/panel.json +1 -0
- package/conformance/bundles/minimal-tool-result/entry.js +1 -0
- package/conformance/bundles/minimal-tool-result/manifest.json +11 -0
- package/conformance/bundles/minimal-tool-result/samples/tool-result.json +1 -0
- package/conformance/file-responses/list.json +1 -0
- package/conformance/file-responses/metadata.json +11 -0
- package/conformance/file-responses/permission-denied.json +6 -0
- package/conformance/file-responses/resource-limit.json +1 -0
- package/conformance/file-responses/text-content.json +1 -0
- package/conformance/host-runtime-config/invalid-missing-manifest-fields.json +55 -0
- package/conformance/host-runtime-config/invalid-static-origins.json +60 -0
- package/conformance/host-runtime-config/valid.json +85 -0
- package/conformance/invalid-bridge-messages/network-fetch-mixed-case-forbidden-header.json +21 -0
- package/conformance/invalid-manifests/missing-target.json +11 -0
- package/conformance/invalid-manifests/presentation-duplicate-surfaces.json +16 -0
- package/conformance/invalid-manifests/presentation-empty-surfaces.json +14 -0
- package/conformance/invalid-manifests/presentation-unknown-surface.json +16 -0
- package/conformance/invalid-manifests/unknown-field.json +12 -0
- package/conformance/invalid-network-requests/mixed-case-forbidden-header.json +11 -0
- package/conformance/invalid-presentation-grants/duplicate-surfaces.json +5 -0
- package/conformance/invalid-presentation-grants/empty-surfaces.json +5 -0
- package/conformance/invalid-presentation-grants/false-confirmation.json +5 -0
- package/conformance/invalid-presentation-grants/missing-confirmation.json +4 -0
- package/conformance/invalid-presentation-grants/unknown-surface.json +5 -0
- package/conformance/invalid-presentation-requests/change-surface-missing-surface.json +4 -0
- package/conformance/invalid-presentation-requests/close-with-surface.json +4 -0
- package/conformance/invalid-presentation-requests/focus-boundary-missing-direction.json +4 -0
- package/conformance/invalid-presentation-requests/focus-boundary-unknown-direction.json +4 -0
- package/conformance/invalid-presentation-requests/focus-boundary-with-coordinates.json +9 -0
- package/conformance/invalid-presentation-requests/focus-boundary-with-event-provenance.json +8 -0
- package/conformance/invalid-presentation-requests/focus-boundary-with-generation.json +8 -0
- package/conformance/invalid-presentation-requests/focus-boundary-with-identity.json +12 -0
- package/conformance/invalid-presentation-requests/focus-boundary-with-key.json +8 -0
- package/conformance/invalid-presentation-requests/focus-boundary-with-modifiers.json +11 -0
- package/conformance/invalid-presentation-requests/focus-boundary-with-selector.json +8 -0
- package/conformance/invalid-presentation-requests/focus-boundary-with-surface.json +8 -0
- package/conformance/invalid-presentation-requests/focus-boundary-with-target.json +8 -0
- package/conformance/invalid-presentation-requests/focus-boundary-with-timestamp.json +8 -0
- package/conformance/invalid-presentation-requests/focus-boundary-with-z-index.json +8 -0
- package/conformance/invalid-presentation-requests/present-missing-surface.json +4 -0
- package/conformance/invalid-presentation-requests/unknown-surface.json +4 -0
- package/conformance/invalid-presentation-requests/widget-controls-coordinates.json +9 -0
- package/conformance/invalid-presentation-requests/widget-controls-geometry.json +8 -0
- package/conformance/invalid-presentation-requests/widget-controls-instance-id.json +8 -0
- package/conformance/invalid-presentation-requests/widget-controls-principal.json +8 -0
- package/conformance/invalid-presentation-requests/widget-controls-run-id.json +4 -0
- package/conformance/invalid-presentation-requests/widget-controls-widget-id.json +8 -0
- package/conformance/invalid-presentation-requests/widget-controls-widget-version-id.json +8 -0
- package/conformance/invalid-presentation-requests/widget-controls-z-index.json +4 -0
- package/conformance/invalid-render-inputs/malformed.json +17 -0
- package/conformance/manifests/valid-file-preview.json +12 -0
- package/conformance/manifests/valid-network.json +15 -0
- package/conformance/manifests/valid-panel.json +11 -0
- package/conformance/manifests/valid-presentation-panel.json +21 -0
- package/conformance/manifests/valid-tool-result.json +14 -0
- package/conformance/render-inputs/compatibility/literature-search-paper-results.json +75 -0
- package/conformance/render-inputs/compatibility/scientific-bibliography-bibtex.json +10 -0
- package/conformance/render-inputs/compatibility/scientific-dataset-csv.json +10 -0
- package/conformance/render-inputs/compatibility/scientific-manuscript-latex.json +10 -0
- package/conformance/render-inputs/compatibility/scientific-manuscript-markdown.json +10 -0
- package/conformance/render-inputs/compatibility/scientific-molecule-mol.json +10 -0
- package/conformance/render-inputs/compatibility/scientific-molecule-mol2.json +10 -0
- package/conformance/render-inputs/compatibility/scientific-notebook-ipynb.json +10 -0
- package/conformance/render-inputs/compatibility/scientific-paper-pdf.json +10 -0
- package/conformance/render-inputs/compatibility/scientific-protein-pdb.json +10 -0
- package/conformance/render-inputs/compatibility/scientific-source-python.json +10 -0
- package/conformance/render-inputs/compatibility/scientific-structure-cif.json +47 -0
- package/conformance/render-inputs/compatibility/scientific-structure-poscar.json +10 -0
- package/conformance/render-inputs/compatibility/scientific-structure-stru.json +10 -0
- package/conformance/render-inputs/compatibility/scientific-trajectory-xyz.json +10 -0
- package/conformance/render-inputs/compatibility/thinking-process-paper-search.json +25 -0
- package/conformance/render-inputs/compatibility/thinking-process-scholar-search.json +25 -0
- package/conformance/render-inputs/compatibility/thinking-process-web-search.json +25 -0
- package/conformance/render-inputs/compatibility/workspace-file-search.json +24 -0
- package/conformance/render-inputs/compatibility/workspace-file-tree.json +24 -0
- package/conformance/render-inputs/empty.json +10 -0
- package/conformance/render-inputs/file-preview.json +10 -0
- package/conformance/render-inputs/incremental-update.json +10 -0
- package/conformance/render-inputs/large.json +10 -0
- package/conformance/render-inputs/malformed.json +1 -0
- package/conformance/render-inputs/panel.json +10 -0
- package/conformance/render-inputs/partial-state-full-snapshot.json +40 -0
- package/conformance/render-inputs/tool-result.json +10 -0
- package/dist/generated-host-runtime-config.d.ts +246 -0
- package/dist/generated-host-runtime-config.js +3 -0
- package/dist/generated-manifest.d.ts +86 -0
- package/dist/generated-manifest.js +3 -0
- package/dist/generated-runtime-contracts.d.ts +401 -0
- package/dist/generated-runtime-contracts.js +3 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +2 -0
- package/package.json +55 -0
- package/schemas/host-runtime-config.schema.json +185 -0
- package/schemas/widget-manifest.schema.json +227 -0
- package/schemas/widget-runtime-contracts.schema.json +1478 -0
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "widget-manifest.schema.json",
|
|
4
|
+
"title": "Widget Manifest",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["name", "widgetConfig"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"name": { "type": "string", "minLength": 1, "maxLength": 128 },
|
|
10
|
+
"description": { "type": "string", "maxLength": 2000 },
|
|
11
|
+
"widgetConfig": { "$ref": "#/$defs/WidgetConfig" }
|
|
12
|
+
},
|
|
13
|
+
"$defs": {
|
|
14
|
+
"WidgetConfig": {
|
|
15
|
+
"title": "WidgetConfig",
|
|
16
|
+
"type": "object",
|
|
17
|
+
"additionalProperties": false,
|
|
18
|
+
"required": [
|
|
19
|
+
"schemaVersion",
|
|
20
|
+
"hostApiVersion",
|
|
21
|
+
"widgetSdkVersion",
|
|
22
|
+
"entry",
|
|
23
|
+
"slot",
|
|
24
|
+
"samples"
|
|
25
|
+
],
|
|
26
|
+
"properties": {
|
|
27
|
+
"schemaVersion": { "const": 1 },
|
|
28
|
+
"hostApiVersion": { "const": 1 },
|
|
29
|
+
"widgetSdkVersion": { "$ref": "#/$defs/WidgetSdkVersion" },
|
|
30
|
+
"entry": { "$ref": "#/$defs/EntryPath" },
|
|
31
|
+
"slot": { "$ref": "#/$defs/WidgetSlotConfig" },
|
|
32
|
+
"requestedCapabilities": {
|
|
33
|
+
"$ref": "#/$defs/RequestedCapabilities"
|
|
34
|
+
},
|
|
35
|
+
"runtime": { "$ref": "#/$defs/RuntimeOptions" },
|
|
36
|
+
"samples": { "$ref": "#/$defs/Samples" }
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"RequestedCapabilities": {
|
|
40
|
+
"title": "RequestedCapabilities",
|
|
41
|
+
"type": "object",
|
|
42
|
+
"additionalProperties": false,
|
|
43
|
+
"properties": {
|
|
44
|
+
"files": { "$ref": "#/$defs/FilesCapabilityRequest" },
|
|
45
|
+
"events": { "$ref": "#/$defs/EventsCapabilityRequest" },
|
|
46
|
+
"actions": { "$ref": "#/$defs/ActionsCapabilityRequest" },
|
|
47
|
+
"network": { "$ref": "#/$defs/NetworkCapabilityRequest" },
|
|
48
|
+
"presentation": {
|
|
49
|
+
"$ref": "#/$defs/RequestedPresentationCapability"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"FilesCapabilityRequest": {
|
|
54
|
+
"title": "FilesCapabilityRequest",
|
|
55
|
+
"type": "object",
|
|
56
|
+
"additionalProperties": false,
|
|
57
|
+
"properties": {
|
|
58
|
+
"list": { "type": "boolean" },
|
|
59
|
+
"metadata": { "type": "boolean" },
|
|
60
|
+
"read": { "type": "boolean" }
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"EventsCapabilityRequest": {
|
|
64
|
+
"title": "EventsCapabilityRequest",
|
|
65
|
+
"type": "object",
|
|
66
|
+
"additionalProperties": false,
|
|
67
|
+
"required": ["topics"],
|
|
68
|
+
"properties": {
|
|
69
|
+
"topics": {
|
|
70
|
+
"type": "array",
|
|
71
|
+
"minItems": 1,
|
|
72
|
+
"maxItems": 32,
|
|
73
|
+
"uniqueItems": true,
|
|
74
|
+
"items": {
|
|
75
|
+
"type": "string",
|
|
76
|
+
"minLength": 1,
|
|
77
|
+
"maxLength": 128,
|
|
78
|
+
"pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]*$"
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"ActionsCapabilityRequest": {
|
|
84
|
+
"title": "ActionsCapabilityRequest",
|
|
85
|
+
"type": "object",
|
|
86
|
+
"additionalProperties": false,
|
|
87
|
+
"required": ["names"],
|
|
88
|
+
"properties": {
|
|
89
|
+
"names": {
|
|
90
|
+
"type": "array",
|
|
91
|
+
"minItems": 1,
|
|
92
|
+
"maxItems": 32,
|
|
93
|
+
"uniqueItems": true,
|
|
94
|
+
"items": {
|
|
95
|
+
"type": "string",
|
|
96
|
+
"minLength": 1,
|
|
97
|
+
"maxLength": 128,
|
|
98
|
+
"pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]*$"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"NetworkCapabilityRequest": {
|
|
104
|
+
"title": "NetworkCapabilityRequest",
|
|
105
|
+
"type": "object",
|
|
106
|
+
"additionalProperties": false,
|
|
107
|
+
"required": ["fetch"],
|
|
108
|
+
"properties": {
|
|
109
|
+
"fetch": { "const": true }
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"RequestedPresentationCapability": {
|
|
113
|
+
"title": "RequestedPresentationCapability",
|
|
114
|
+
"type": "object",
|
|
115
|
+
"additionalProperties": false,
|
|
116
|
+
"required": ["surfaces"],
|
|
117
|
+
"properties": {
|
|
118
|
+
"surfaces": {
|
|
119
|
+
"type": "array",
|
|
120
|
+
"minItems": 1,
|
|
121
|
+
"maxItems": 2,
|
|
122
|
+
"uniqueItems": true,
|
|
123
|
+
"items": { "enum": ["floating", "overlay"] }
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"WidgetSdkVersion": {
|
|
128
|
+
"title": "WidgetSdkVersion",
|
|
129
|
+
"type": "string",
|
|
130
|
+
"pattern": "^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?$"
|
|
131
|
+
},
|
|
132
|
+
"EntryPath": {
|
|
133
|
+
"title": "EntryPath",
|
|
134
|
+
"type": "string",
|
|
135
|
+
"minLength": 1,
|
|
136
|
+
"maxLength": 256,
|
|
137
|
+
"pattern": "^(?!/)(?!.*\\.\\.)(?!.*\\\\)(?!.*://).+\\.m?js$"
|
|
138
|
+
},
|
|
139
|
+
"RuntimeOptions": {
|
|
140
|
+
"title": "RuntimeOptions",
|
|
141
|
+
"type": "object",
|
|
142
|
+
"additionalProperties": false,
|
|
143
|
+
"properties": {
|
|
144
|
+
"worker": { "type": "boolean" },
|
|
145
|
+
"webAssembly": { "type": "boolean" }
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"Samples": {
|
|
149
|
+
"title": "Samples",
|
|
150
|
+
"type": "array",
|
|
151
|
+
"minItems": 1,
|
|
152
|
+
"uniqueItems": true,
|
|
153
|
+
"items": {
|
|
154
|
+
"type": "object",
|
|
155
|
+
"additionalProperties": false,
|
|
156
|
+
"required": ["id", "title", "request"],
|
|
157
|
+
"properties": {
|
|
158
|
+
"id": {
|
|
159
|
+
"type": "string",
|
|
160
|
+
"minLength": 1,
|
|
161
|
+
"maxLength": 64,
|
|
162
|
+
"pattern": "^[A-Za-z0-9_-]+$"
|
|
163
|
+
},
|
|
164
|
+
"title": { "type": "string", "minLength": 1, "maxLength": 128 },
|
|
165
|
+
"request": {
|
|
166
|
+
"type": "string",
|
|
167
|
+
"minLength": 1,
|
|
168
|
+
"maxLength": 256,
|
|
169
|
+
"pattern": "^(?!/)(?!.*\\.\\.)(?!.*\\\\)(?!.*://).+\\.json$"
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
"WidgetSlotConfig": {
|
|
175
|
+
"title": "WidgetSlotConfig",
|
|
176
|
+
"oneOf": [
|
|
177
|
+
{
|
|
178
|
+
"type": "object",
|
|
179
|
+
"additionalProperties": false,
|
|
180
|
+
"required": ["type", "toolName"],
|
|
181
|
+
"properties": {
|
|
182
|
+
"type": { "const": "tool-result" },
|
|
183
|
+
"toolName": {
|
|
184
|
+
"type": "string",
|
|
185
|
+
"minLength": 1,
|
|
186
|
+
"maxLength": 128,
|
|
187
|
+
"pattern": "^[A-Za-z0-9_.:-]+$"
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"type": "object",
|
|
193
|
+
"additionalProperties": false,
|
|
194
|
+
"required": ["type", "extensions"],
|
|
195
|
+
"properties": {
|
|
196
|
+
"type": { "const": "file-preview" },
|
|
197
|
+
"extensions": {
|
|
198
|
+
"type": "array",
|
|
199
|
+
"minItems": 1,
|
|
200
|
+
"uniqueItems": true,
|
|
201
|
+
"items": {
|
|
202
|
+
"type": "string",
|
|
203
|
+
"minLength": 1,
|
|
204
|
+
"maxLength": 32,
|
|
205
|
+
"pattern": "^[a-z0-9][a-z0-9.-]*$"
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"type": "object",
|
|
212
|
+
"additionalProperties": false,
|
|
213
|
+
"required": ["type", "panelType"],
|
|
214
|
+
"properties": {
|
|
215
|
+
"type": { "const": "panel" },
|
|
216
|
+
"panelType": {
|
|
217
|
+
"type": "string",
|
|
218
|
+
"minLength": 1,
|
|
219
|
+
"maxLength": 128,
|
|
220
|
+
"pattern": "^[A-Za-z0-9_.:-]+$"
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
]
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|