@hanamesh/dsh-app-host 0.2.0-rc.2

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 (82) hide show
  1. package/LICENSE +31 -0
  2. package/README.md +104 -0
  3. package/consistency.json +101 -0
  4. package/dist/client-ui.d.ts +19 -0
  5. package/dist/client-ui.js +271 -0
  6. package/dist/client.d.ts +16 -0
  7. package/dist/client.js +42 -0
  8. package/dist/consistency.js +12 -0
  9. package/dist/descriptor.js +141 -0
  10. package/dist/dsh.d.ts +25 -0
  11. package/dist/dsh.js +194 -0
  12. package/dist/errors.js +25 -0
  13. package/dist/gateway.js +224 -0
  14. package/dist/guardian.js +113 -0
  15. package/dist/index.d.ts +130 -0
  16. package/dist/index.js +15 -0
  17. package/dist/launcher.js +17 -0
  18. package/dist/library/catalog.js +108 -0
  19. package/dist/library/domain.js +8 -0
  20. package/dist/library/install.js +87 -0
  21. package/dist/library/installed.js +67 -0
  22. package/dist/library/locate.js +79 -0
  23. package/dist/library/routes.js +17 -0
  24. package/dist/library/service.js +76 -0
  25. package/dist/manager.js +605 -0
  26. package/dist/provision/LICENSE +6 -0
  27. package/dist/provision/THIRD_PARTY_NOTICES.md +13 -0
  28. package/dist/provision/archive.d.ts +28 -0
  29. package/dist/provision/archive.js +66 -0
  30. package/dist/provision/check.d.ts +10 -0
  31. package/dist/provision/check.js +51 -0
  32. package/dist/provision/checkpoints.d.ts +12 -0
  33. package/dist/provision/checkpoints.js +23 -0
  34. package/dist/provision/cli.d.ts +1 -0
  35. package/dist/provision/cli.js +169 -0
  36. package/dist/provision/download.d.ts +21 -0
  37. package/dist/provision/download.js +242 -0
  38. package/dist/provision/errors.d.ts +11 -0
  39. package/dist/provision/errors.js +13 -0
  40. package/dist/provision/extract.d.ts +17 -0
  41. package/dist/provision/extract.js +124 -0
  42. package/dist/provision/fsutil.d.ts +8 -0
  43. package/dist/provision/fsutil.js +71 -0
  44. package/dist/provision/index.d.ts +7 -0
  45. package/dist/provision/index.js +6 -0
  46. package/dist/provision/ledger.d.ts +14 -0
  47. package/dist/provision/ledger.js +50 -0
  48. package/dist/provision/manifest.d.ts +11 -0
  49. package/dist/provision/manifest.js +171 -0
  50. package/dist/provision/paths.d.ts +27 -0
  51. package/dist/provision/paths.js +95 -0
  52. package/dist/provision/platform.d.ts +6 -0
  53. package/dist/provision/platform.js +7 -0
  54. package/dist/provision/provision.d.ts +17 -0
  55. package/dist/provision/provision.js +454 -0
  56. package/dist/provision/tar.d.ts +7 -0
  57. package/dist/provision/tar.js +169 -0
  58. package/dist/provision/types.d.ts +174 -0
  59. package/dist/provision/types.js +7 -0
  60. package/dist/provision/zip.d.ts +4 -0
  61. package/dist/provision/zip.js +194 -0
  62. package/dist/router/broker.js +161 -0
  63. package/dist/router/domain.js +18 -0
  64. package/dist/router/receipts-domain.js +8 -0
  65. package/dist/router/receipts.js +156 -0
  66. package/dist/router/routes.js +48 -0
  67. package/dist/router/sources.js +87 -0
  68. package/dist/routes.js +74 -0
  69. package/dist/runtime.js +222 -0
  70. package/dist/store.js +250 -0
  71. package/dist/usage-evidence.js +117 -0
  72. package/docs/APP_PACKAGE.md +38 -0
  73. package/docs/CONTRACT.md +190 -0
  74. package/docs/DSH_INTEGRATION.md +43 -0
  75. package/docs/LIBRARY.md +45 -0
  76. package/docs/LICENSES.json +185 -0
  77. package/docs/PROVENANCE.json +63 -0
  78. package/docs/SECURITY.md +52 -0
  79. package/package.json +112 -0
  80. package/profile/cordis.patch.yml +4 -0
  81. package/schemas/catalog-provider-page.schema.json +376 -0
  82. package/schemas/catalog-source.schema.json +151 -0
@@ -0,0 +1,376 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:dsh-community-market:schema:catalog-provider-page:1.0.0",
4
+ "title": "DSH Community Market standard provider page",
5
+ "description": "The untrusted page JSON returned by one standard HTTPS catalog endpoint. Only schemaVersion, items, and page are required. A page may contain at most 200 items and must also respect the effective requested or declared default limit. Host-observed provenance is intentionally absent and is injected only after validation.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "schemaVersion",
10
+ "items",
11
+ "page"
12
+ ],
13
+ "properties": {
14
+ "schemaVersion": {
15
+ "const": "1.0.0"
16
+ },
17
+ "generatedAt": {
18
+ "type": "string",
19
+ "format": "date-time"
20
+ },
21
+ "revision": {
22
+ "type": "string",
23
+ "minLength": 1,
24
+ "maxLength": 160
25
+ },
26
+ "items": {
27
+ "type": "array",
28
+ "maxItems": 200,
29
+ "items": {
30
+ "$ref": "#/$defs/item"
31
+ }
32
+ },
33
+ "page": {
34
+ "$ref": "#/$defs/page"
35
+ }
36
+ },
37
+ "$defs": {
38
+ "identifier": {
39
+ "type": "string",
40
+ "minLength": 1,
41
+ "maxLength": 160,
42
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/@+-]*$"
43
+ },
44
+ "httpsUri": {
45
+ "type": "string",
46
+ "format": "uri",
47
+ "maxLength": 2048,
48
+ "pattern": "^https://(?![^/?#]*@)(?![^/?#]*:)[^#]+$"
49
+ },
50
+ "plainText": {
51
+ "type": "string",
52
+ "pattern": "^[^\\u0000-\\u001F\\u007F-\\u009F\\u202A-\\u202E\\u2066-\\u2069]*$"
53
+ },
54
+ "mediaAlt": {
55
+ "allOf": [
56
+ {
57
+ "$ref": "#/$defs/plainText"
58
+ },
59
+ {
60
+ "type": "string",
61
+ "minLength": 1,
62
+ "maxLength": 240
63
+ }
64
+ ]
65
+ },
66
+ "remoteIconCandidate": {
67
+ "type": "object",
68
+ "description": "A provider-declared remote plugin-icon candidate. The URL must share the final provider-page response origin. The Host resolves and validates it before it can enter a normalized snapshot; the Renderer never receives this URL.",
69
+ "additionalProperties": false,
70
+ "required": [
71
+ "url"
72
+ ],
73
+ "properties": {
74
+ "url": {
75
+ "$ref": "#/$defs/httpsUri"
76
+ },
77
+ "alt": {
78
+ "$ref": "#/$defs/mediaAlt"
79
+ }
80
+ }
81
+ },
82
+ "media": {
83
+ "type": "object",
84
+ "description": "Optional provider-declared plugin media. In v1, only a direct plugin icon is standardized.",
85
+ "additionalProperties": false,
86
+ "required": [
87
+ "icon"
88
+ ],
89
+ "properties": {
90
+ "icon": {
91
+ "$ref": "#/$defs/remoteIconCandidate"
92
+ }
93
+ }
94
+ },
95
+ "page": {
96
+ "type": "object",
97
+ "description": "Use an empty object when there is no next page. nextCursor is opaque and belongs only to this source and effective query.",
98
+ "additionalProperties": false,
99
+ "properties": {
100
+ "nextCursor": {
101
+ "type": "string",
102
+ "minLength": 1,
103
+ "maxLength": 2048
104
+ },
105
+ "total": {
106
+ "type": "integer",
107
+ "minimum": 0
108
+ }
109
+ }
110
+ },
111
+ "repository": {
112
+ "type": "object",
113
+ "additionalProperties": false,
114
+ "required": [
115
+ "url"
116
+ ],
117
+ "properties": {
118
+ "url": {
119
+ "$ref": "#/$defs/httpsUri"
120
+ },
121
+ "subdirectory": {
122
+ "type": "string",
123
+ "minLength": 1,
124
+ "maxLength": 240,
125
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))[^\\\\]+$"
126
+ }
127
+ }
128
+ },
129
+ "installSource": {
130
+ "type": "object",
131
+ "additionalProperties": false,
132
+ "required": [
133
+ "kind",
134
+ "commit"
135
+ ],
136
+ "properties": {
137
+ "kind": {
138
+ "const": "github"
139
+ },
140
+ "commit": {
141
+ "type": "string",
142
+ "pattern": "^[0-9a-f]{40}$"
143
+ }
144
+ }
145
+ },
146
+ "package": {
147
+ "type": "object",
148
+ "additionalProperties": false,
149
+ "required": [
150
+ "registry",
151
+ "name"
152
+ ],
153
+ "properties": {
154
+ "registry": {
155
+ "const": "npm"
156
+ },
157
+ "name": {
158
+ "type": "string",
159
+ "minLength": 1,
160
+ "maxLength": 214,
161
+ "pattern": "^(?:@[a-z0-9][a-z0-9._-]*/)?[a-z0-9][a-z0-9._-]*$"
162
+ }
163
+ }
164
+ },
165
+ "publisher": {
166
+ "type": "object",
167
+ "additionalProperties": false,
168
+ "required": [
169
+ "name"
170
+ ],
171
+ "properties": {
172
+ "name": {
173
+ "allOf": [
174
+ {
175
+ "$ref": "#/$defs/plainText"
176
+ },
177
+ {
178
+ "type": "string",
179
+ "minLength": 1,
180
+ "maxLength": 120
181
+ }
182
+ ]
183
+ },
184
+ "url": {
185
+ "$ref": "#/$defs/httpsUri"
186
+ }
187
+ }
188
+ },
189
+ "capabilityList": {
190
+ "type": "array",
191
+ "maxItems": 64,
192
+ "uniqueItems": true,
193
+ "items": {
194
+ "type": "string",
195
+ "minLength": 1,
196
+ "maxLength": 96,
197
+ "pattern": "^[a-z][a-z0-9-]*(?:\\.[a-z][a-z0-9-]*)+$"
198
+ }
199
+ },
200
+ "categoryId": {
201
+ "type": "string",
202
+ "minLength": 1,
203
+ "maxLength": 64,
204
+ "pattern": "^[a-z0-9][a-z0-9._:-]*$"
205
+ },
206
+ "capabilities": {
207
+ "type": "object",
208
+ "additionalProperties": false,
209
+ "properties": {
210
+ "required": {
211
+ "$ref": "#/$defs/capabilityList"
212
+ },
213
+ "optional": {
214
+ "$ref": "#/$defs/capabilityList"
215
+ }
216
+ }
217
+ },
218
+ "compatibility": {
219
+ "type": "object",
220
+ "additionalProperties": false,
221
+ "properties": {
222
+ "apiVersion": {
223
+ "type": "string",
224
+ "minLength": 1,
225
+ "maxLength": 64
226
+ },
227
+ "hosts": {
228
+ "type": "array",
229
+ "maxItems": 32,
230
+ "uniqueItems": true,
231
+ "items": {
232
+ "type": "string",
233
+ "minLength": 1,
234
+ "maxLength": 96
235
+ }
236
+ }
237
+ }
238
+ },
239
+ "item": {
240
+ "type": "object",
241
+ "additionalProperties": false,
242
+ "required": [
243
+ "id",
244
+ "name",
245
+ "displayName",
246
+ "summary"
247
+ ],
248
+ "properties": {
249
+ "id": {
250
+ "$ref": "#/$defs/identifier"
251
+ },
252
+ "name": {
253
+ "allOf": [
254
+ {
255
+ "$ref": "#/$defs/plainText"
256
+ },
257
+ {
258
+ "type": "string",
259
+ "minLength": 1,
260
+ "maxLength": 160
261
+ }
262
+ ]
263
+ },
264
+ "displayName": {
265
+ "allOf": [
266
+ {
267
+ "$ref": "#/$defs/plainText"
268
+ },
269
+ {
270
+ "type": "string",
271
+ "minLength": 1,
272
+ "maxLength": 120
273
+ }
274
+ ]
275
+ },
276
+ "summary": {
277
+ "allOf": [
278
+ {
279
+ "$ref": "#/$defs/plainText"
280
+ },
281
+ {
282
+ "type": "string",
283
+ "minLength": 1,
284
+ "maxLength": 1000
285
+ }
286
+ ]
287
+ },
288
+ "description": {
289
+ "allOf": [
290
+ {
291
+ "$ref": "#/$defs/plainText"
292
+ },
293
+ {
294
+ "type": "string",
295
+ "maxLength": 5000
296
+ }
297
+ ]
298
+ },
299
+ "homepage": {
300
+ "$ref": "#/$defs/httpsUri"
301
+ },
302
+ "latestVersion": {
303
+ "type": "string",
304
+ "minLength": 1,
305
+ "maxLength": 64
306
+ },
307
+ "license": {
308
+ "type": "string",
309
+ "minLength": 1,
310
+ "maxLength": 80
311
+ },
312
+ "categories": {
313
+ "type": "array",
314
+ "maxItems": 32,
315
+ "uniqueItems": true,
316
+ "items": {
317
+ "$ref": "#/$defs/categoryId"
318
+ }
319
+ },
320
+ "keywords": {
321
+ "type": "array",
322
+ "maxItems": 64,
323
+ "uniqueItems": true,
324
+ "items": {
325
+ "type": "string",
326
+ "minLength": 1,
327
+ "maxLength": 64
328
+ }
329
+ },
330
+ "repository": {
331
+ "$ref": "#/$defs/repository"
332
+ },
333
+ "installSource": {
334
+ "$ref": "#/$defs/installSource"
335
+ },
336
+ "package": {
337
+ "$ref": "#/$defs/package"
338
+ },
339
+ "publisher": {
340
+ "$ref": "#/$defs/publisher"
341
+ },
342
+ "media": {
343
+ "$ref": "#/$defs/media"
344
+ },
345
+ "capabilities": {
346
+ "$ref": "#/$defs/capabilities"
347
+ },
348
+ "compatibility": {
349
+ "$ref": "#/$defs/compatibility"
350
+ },
351
+ "updatedAt": {
352
+ "type": "string",
353
+ "format": "date-time"
354
+ }
355
+ },
356
+ "anyOf": [
357
+ {
358
+ "properties": {
359
+ "repository": true
360
+ },
361
+ "required": [
362
+ "repository"
363
+ ]
364
+ },
365
+ {
366
+ "properties": {
367
+ "package": true
368
+ },
369
+ "required": [
370
+ "package"
371
+ ]
372
+ }
373
+ ]
374
+ }
375
+ }
376
+ }
@@ -0,0 +1,151 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:dsh-community-market:schema:catalog-source:1.0.0",
4
+ "title": "DSH Community Market catalog source manifest",
5
+ "description": "A provider-neutral declaration for one user-selectable HTTPS JSON catalog endpoint. A user registers its manifest URL; selection and all other user-owned state stay local. The smallest recommended profile supports q, category, cursor, and limit and uses 50 as an example page size, not a global cap.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "manifestVersion",
10
+ "providerId",
11
+ "name",
12
+ "attribution",
13
+ "transport",
14
+ "query"
15
+ ],
16
+ "properties": {
17
+ "manifestVersion": {
18
+ "const": "1.0.0"
19
+ },
20
+ "providerId": {
21
+ "type": "string",
22
+ "minLength": 3,
23
+ "maxLength": 128,
24
+ "pattern": "^[a-z0-9]+(?:[.-][a-z0-9]+)+$",
25
+ "description": "Provider-claimed stable identifier, preferably in reverse-domain form. The Host generates a separate sourceRecordId for local identity."
26
+ },
27
+ "name": {
28
+ "type": "string",
29
+ "minLength": 1,
30
+ "maxLength": 120,
31
+ "pattern": "^[^\\u0000-\\u001F\\u007F-\\u009F\\u202A-\\u202E\\u2066-\\u2069]*$"
32
+ },
33
+ "description": {
34
+ "type": "string",
35
+ "maxLength": 500,
36
+ "pattern": "^[^\\u0000-\\u001F\\u007F-\\u009F\\u202A-\\u202E\\u2066-\\u2069]*$"
37
+ },
38
+ "homepage": {
39
+ "type": "string",
40
+ "format": "uri",
41
+ "maxLength": 2048,
42
+ "pattern": "^https://(?![^/?#]*@)(?![^/?#]*:)[^#]+$"
43
+ },
44
+ "attribution": {
45
+ "type": "object",
46
+ "additionalProperties": false,
47
+ "required": [
48
+ "name",
49
+ "url"
50
+ ],
51
+ "properties": {
52
+ "name": {
53
+ "type": "string",
54
+ "minLength": 1,
55
+ "maxLength": 120,
56
+ "pattern": "^[^\\u0000-\\u001F\\u007F-\\u009F\\u202A-\\u202E\\u2066-\\u2069]*$"
57
+ },
58
+ "url": {
59
+ "type": "string",
60
+ "format": "uri",
61
+ "maxLength": 2048,
62
+ "pattern": "^https://(?![^/?#]*@)(?![^/?#]*:)[^#]+$"
63
+ },
64
+ "notice": {
65
+ "type": "string",
66
+ "maxLength": 500,
67
+ "pattern": "^[^\\u0000-\\u001F\\u007F-\\u009F\\u202A-\\u202E\\u2066-\\u2069]*$"
68
+ }
69
+ }
70
+ },
71
+ "transport": {
72
+ "type": "object",
73
+ "additionalProperties": false,
74
+ "required": [
75
+ "kind",
76
+ "endpoint",
77
+ "method"
78
+ ],
79
+ "properties": {
80
+ "kind": {
81
+ "const": "https-json"
82
+ },
83
+ "endpoint": {
84
+ "type": "string",
85
+ "format": "uri",
86
+ "maxLength": 2048,
87
+ "pattern": "^https://(?![^/?#]*@)(?![^/?#]*:)[^/?#\\s]+(?:/[^?#\\s]*)?/v1/plugins$",
88
+ "description": "Absolute HTTPS endpoint on standard port 443 with no query or fragment. It must share the user-approved manifest origin, and the standard endpoint path ends in /v1/plugins."
89
+ },
90
+ "method": {
91
+ "const": "GET"
92
+ }
93
+ }
94
+ },
95
+ "query": {
96
+ "type": "object",
97
+ "description": "The endpoint query features advertised by this source. The minimal fixture uses supported=[q, category, cursor, limit], defaultLimit=50, maxLimit=50, and sorts=[]. Standard sources may declare limits through the Schema maximum of 200.",
98
+ "additionalProperties": false,
99
+ "required": [
100
+ "supported",
101
+ "defaultLimit",
102
+ "maxLimit",
103
+ "sorts"
104
+ ],
105
+ "properties": {
106
+ "supported": {
107
+ "type": "array",
108
+ "minItems": 0,
109
+ "maxItems": 7,
110
+ "uniqueItems": true,
111
+ "items": {
112
+ "enum": [
113
+ "q",
114
+ "category",
115
+ "capability",
116
+ "cursor",
117
+ "limit",
118
+ "sort",
119
+ "locale"
120
+ ]
121
+ }
122
+ },
123
+ "defaultLimit": {
124
+ "type": "integer",
125
+ "minimum": 1,
126
+ "maximum": 200,
127
+ "default": 50
128
+ },
129
+ "maxLimit": {
130
+ "type": "integer",
131
+ "minimum": 1,
132
+ "maximum": 200,
133
+ "default": 50
134
+ },
135
+ "sorts": {
136
+ "type": "array",
137
+ "maxItems": 4,
138
+ "uniqueItems": true,
139
+ "items": {
140
+ "enum": [
141
+ "relevance",
142
+ "updated",
143
+ "name",
144
+ "downloads"
145
+ ]
146
+ }
147
+ }
148
+ }
149
+ }
150
+ }
151
+ }