@hanamesh/dsh-app-host 0.6.20 → 0.6.21

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.
@@ -2,11 +2,13 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://hanamesh.com/schemas/app-host/install-target.schema.json",
4
4
  "title": "HanaMesh AppHost install target",
5
- "description": "Public identifiers a caller may hand to the AppHost market. The market resolves its own catalog, shows its own confirmation and performs the install; callers never supply versions, download locations or confirmation. Lengths are JavaScript string lengths.",
5
+ "description": "Catalog identity and reviewed structured npm/GitHub target. AppHost resolves its own catalog, binds the source/SHA/build permissions shown in its confirmation, and installs only on explicit client confirmation.",
6
6
  "x-hanamesh-contract": {
7
7
  "name": "hanamesh.install-target",
8
8
  "version": "1",
9
- "supported": ["1"],
9
+ "supported": [
10
+ "1"
11
+ ],
10
12
  "package": "@hanamesh/dsh-app-host",
11
13
  "since": "0.2.0-rc.8",
12
14
  "fragmentPrefix": "#hanamesh-install?",
@@ -38,6 +40,12 @@
38
40
  "compensation": "New install: dsh plugin remove (or dsh plugin install when only residue remains); runtime items newly claimed by this operation are removed by lib-provision ownership, unowned files and dataRoot are never deleted. Upgrade: dsh plugin add of the original spec (--save-exact when exact); a replaced runtime item is provisioned again from the restored definition. Concurrent writes by other profile writers are never undone. No automatic retry; no manual profile/store/metadata edit.",
39
41
  "readback": "restored and not-needed are reported only when every check row equals the baseline. Anything else is failed with residue rows, the recovery error (if the compensation itself failed) and originals: the pre-operation package.json/pnpm-lock.yaml/runtime ledger kept under <dataRoot>/library-recovery/<operationId>/.",
40
42
  "presentation": "A failed install is never presented as installed. failed is never presented as restored or rolled back. An event without recovery (provider before rc.10) is not presented as restored."
43
+ },
44
+ "github": {
45
+ "target": "C-INDEXER-CATALOG CatalogPackageInstallTarget",
46
+ "ref": "full immutable 40-character commit SHA, pinned at collection",
47
+ "confirmation": "show repository, full commit, path and build script permission; submit the same installTarget",
48
+ "execution": "official dsh plugin add --save-exact; native pnpm Git source and --allow-build arguments"
41
49
  }
42
50
  },
43
51
  "$ref": "#/$defs/target",
@@ -57,65 +65,152 @@
57
65
  "contractVersion": {
58
66
  "description": "Optional declaration of the contract version the caller speaks.",
59
67
  "type": "string",
60
- "enum": ["1"]
68
+ "enum": [
69
+ "1"
70
+ ]
61
71
  },
62
72
  "target": {
63
- "description": "openInstallTarget input, GET /hanamesh/library/target query and #hanamesh-install? fragment fields. At least one identifier; both must name the same catalog item. Every other field is refused.",
73
+ "description": "Catalog identifiers and optional reviewed I1 package installation target. Structured targets require itemId and must match the current catalog; callers cannot supply commands or arbitrary sources.",
64
74
  "type": "object",
65
75
  "properties": {
66
- "itemId": { "$ref": "#/$defs/itemId" },
67
- "packageName": { "$ref": "#/$defs/packageName" },
68
- "contractVersion": { "$ref": "#/$defs/contractVersion" }
76
+ "itemId": {
77
+ "$ref": "#/$defs/itemId"
78
+ },
79
+ "packageName": {
80
+ "$ref": "#/$defs/packageName"
81
+ },
82
+ "contractVersion": {
83
+ "$ref": "#/$defs/contractVersion"
84
+ },
85
+ "installTarget": {
86
+ "$ref": "#/$defs/packageInstallTarget"
87
+ }
69
88
  },
70
89
  "additionalProperties": false,
71
90
  "anyOf": [
72
- { "required": ["itemId"] },
73
- { "required": ["packageName"] }
74
- ]
91
+ {
92
+ "required": [
93
+ "itemId"
94
+ ]
95
+ },
96
+ {
97
+ "required": [
98
+ "packageName"
99
+ ]
100
+ }
101
+ ],
102
+ "dependentRequired": {
103
+ "installTarget": [
104
+ "itemId"
105
+ ]
106
+ }
75
107
  },
76
108
  "receipt": {
77
109
  "description": "openInstallTarget resolution receipt; not an install result.",
78
110
  "type": "object",
79
111
  "properties": {
80
- "status": { "type": "string", "enum": ["confirmation-required", "installing", "already-installed", "superseded"] },
81
- "itemId": { "type": "string" },
82
- "packageName": { "type": "string" }
112
+ "status": {
113
+ "type": "string",
114
+ "enum": [
115
+ "confirmation-required",
116
+ "installing",
117
+ "already-installed",
118
+ "superseded"
119
+ ]
120
+ },
121
+ "itemId": {
122
+ "type": "string"
123
+ },
124
+ "packageName": {
125
+ "type": "string"
126
+ }
83
127
  },
84
- "required": ["status"],
128
+ "required": [
129
+ "status"
130
+ ],
85
131
  "additionalProperties": false
86
132
  },
87
133
  "resolution": {
88
134
  "description": "GET /hanamesh/library/target 200 body. contractVersion is the provider's declaration (added in 0.2.0-rc.8).",
89
135
  "type": "object",
90
136
  "properties": {
91
- "contractVersion": { "type": "string", "enum": ["1"] },
137
+ "contractVersion": {
138
+ "type": "string",
139
+ "enum": [
140
+ "1"
141
+ ]
142
+ },
92
143
  "item": {
93
144
  "type": "object",
94
145
  "properties": {
95
- "id": { "$ref": "#/$defs/itemId" },
96
- "displayName": { "type": "string" },
97
- "latestVersion": { "type": "string" },
98
- "kind": { "type": "string", "enum": ["application", "plugin", "listing"] },
99
- "upgradeAvailable": { "type": "boolean" },
146
+ "id": {
147
+ "$ref": "#/$defs/itemId"
148
+ },
149
+ "displayName": {
150
+ "type": "string"
151
+ },
152
+ "kind": {
153
+ "type": "string",
154
+ "enum": [
155
+ "application",
156
+ "plugin",
157
+ "listing"
158
+ ]
159
+ },
160
+ "upgradeAvailable": {
161
+ "type": "boolean"
162
+ },
100
163
  "package": {
101
164
  "type": "object",
102
165
  "properties": {
103
- "registry": { "type": "string", "const": "npm" },
104
- "name": { "$ref": "#/$defs/packageName" }
166
+ "registry": {
167
+ "type": "string",
168
+ "enum": [
169
+ "npm",
170
+ "github"
171
+ ]
172
+ },
173
+ "name": {
174
+ "$ref": "#/$defs/packageName"
175
+ }
105
176
  },
106
- "required": ["registry", "name"]
177
+ "required": [
178
+ "registry",
179
+ "name"
180
+ ]
181
+ },
182
+ "installTarget": {
183
+ "$ref": "#/$defs/packageInstallTarget"
107
184
  }
108
185
  },
109
- "required": ["id", "kind", "package", "upgradeAvailable"]
186
+ "required": [
187
+ "id",
188
+ "kind",
189
+ "package",
190
+ "upgradeAvailable"
191
+ ]
110
192
  },
111
193
  "source": {
112
194
  "type": "object",
113
- "properties": { "kind": { "type": "string" } },
114
- "required": ["kind"]
195
+ "properties": {
196
+ "kind": {
197
+ "type": "string"
198
+ }
199
+ },
200
+ "required": [
201
+ "kind"
202
+ ]
115
203
  },
116
- "traceId": { "type": "string" }
204
+ "traceId": {
205
+ "type": "string"
206
+ }
117
207
  },
118
- "required": ["contractVersion", "item", "source", "traceId"]
208
+ "required": [
209
+ "contractVersion",
210
+ "item",
211
+ "source",
212
+ "traceId"
213
+ ]
119
214
  },
120
215
  "error": {
121
216
  "description": "Refusal body of the HTTP routes; the client rejects with the same code.",
@@ -126,26 +221,64 @@
126
221
  "properties": {
127
222
  "code": {
128
223
  "type": "string",
129
- "enum": ["INVALID_INPUT", "CONTRACT_VERSION_UNSUPPORTED", "CATALOG_ITEM_MISSING", "NOT_INSTALLABLE", "PACKAGE_DENIED", "HOST_DENIED", "ORIGIN_DENIED", "FRAME_CONTROL_DENIED", "CSRF_DENIED", "UNAUTHENTICATED", "FORBIDDEN", "METHOD_NOT_ALLOWED", "LIBRARY_INSTALL_UNAVAILABLE"]
224
+ "enum": [
225
+ "INVALID_INPUT",
226
+ "CONTRACT_VERSION_UNSUPPORTED",
227
+ "CATALOG_ITEM_MISSING",
228
+ "NOT_INSTALLABLE",
229
+ "PACKAGE_DENIED",
230
+ "HOST_DENIED",
231
+ "ORIGIN_DENIED",
232
+ "FRAME_CONTROL_DENIED",
233
+ "CSRF_DENIED",
234
+ "UNAUTHENTICATED",
235
+ "FORBIDDEN",
236
+ "METHOD_NOT_ALLOWED",
237
+ "LIBRARY_INSTALL_UNAVAILABLE"
238
+ ]
130
239
  },
131
- "message": { "type": "string" }
240
+ "message": {
241
+ "type": "string"
242
+ }
132
243
  },
133
- "required": ["code"]
244
+ "required": [
245
+ "code"
246
+ ]
134
247
  },
135
- "traceId": { "type": "string" }
248
+ "traceId": {
249
+ "type": "string"
250
+ }
136
251
  },
137
- "required": ["error"]
252
+ "required": [
253
+ "error"
254
+ ]
138
255
  },
139
256
  "providerDeclaration": {
140
257
  "description": "package.json hanamesh.installTarget of a provider package.",
141
258
  "type": "object",
142
259
  "properties": {
143
- "contract": { "type": "string", "const": "hanamesh.install-target" },
144
- "contractVersion": { "type": "string" },
145
- "supported": { "type": "array", "items": { "type": "string" } },
146
- "schema": { "type": "string" }
260
+ "contract": {
261
+ "type": "string",
262
+ "const": "hanamesh.install-target"
263
+ },
264
+ "contractVersion": {
265
+ "type": "string"
266
+ },
267
+ "supported": {
268
+ "type": "array",
269
+ "items": {
270
+ "type": "string"
271
+ }
272
+ },
273
+ "schema": {
274
+ "type": "string"
275
+ }
147
276
  },
148
- "required": ["contract", "contractVersion", "supported"]
277
+ "required": [
278
+ "contract",
279
+ "contractVersion",
280
+ "supported"
281
+ ]
149
282
  },
150
283
  "recovery": {
151
284
  "description": "library.install-failed recovery result (added in 0.2.0-rc.10).",
@@ -293,6 +426,87 @@
293
426
  "type",
294
427
  "code"
295
428
  ]
429
+ },
430
+ "packageInstallTarget": {
431
+ "anyOf": [
432
+ {
433
+ "type": "object",
434
+ "properties": {
435
+ "source": {
436
+ "const": "npm"
437
+ },
438
+ "allowBuild": {
439
+ "type": "array",
440
+ "items": {
441
+ "type": "string",
442
+ "minLength": 1,
443
+ "maxLength": 2048,
444
+ "pattern": "^[^\\s\\u0000-\\u001f\\u007f-\\u009f]+$"
445
+ }
446
+ },
447
+ "name": {
448
+ "$ref": "#/$defs/packageName"
449
+ },
450
+ "version": {
451
+ "type": "string",
452
+ "maxLength": 128,
453
+ "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(?:-(?:0|[1-9][0-9]*|[0-9]*[A-Za-z-][0-9A-Za-z-]*)(?:\\.(?:0|[1-9][0-9]*|[0-9]*[A-Za-z-][0-9A-Za-z-]*))*)?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$"
454
+ }
455
+ },
456
+ "required": [
457
+ "source",
458
+ "name",
459
+ "version",
460
+ "allowBuild"
461
+ ],
462
+ "additionalProperties": false
463
+ },
464
+ {
465
+ "type": "object",
466
+ "properties": {
467
+ "source": {
468
+ "const": "github"
469
+ },
470
+ "allowBuild": {
471
+ "type": "array",
472
+ "items": {
473
+ "type": "string",
474
+ "minLength": 1,
475
+ "maxLength": 2048,
476
+ "pattern": "^[^\\s\\u0000-\\u001f\\u007f-\\u009f]+$"
477
+ }
478
+ },
479
+ "repo": {
480
+ "type": "string",
481
+ "pattern": "^[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?/[A-Za-z0-9_][A-Za-z0-9._-]*$"
482
+ },
483
+ "ref": {
484
+ "type": "string",
485
+ "pattern": "^[0-9a-fA-F]{40}$"
486
+ },
487
+ "path": {
488
+ "type": [
489
+ "string",
490
+ "null"
491
+ ],
492
+ "minLength": 1,
493
+ "pattern": "^(?!\\.{1,2}(?:/|$))[A-Za-z0-9_@+.-]+(?:/(?!\\.{1,2}(?:/|$))[A-Za-z0-9_@+.-]+)*$"
494
+ },
495
+ "packageName": {
496
+ "$ref": "#/$defs/packageName"
497
+ }
498
+ },
499
+ "required": [
500
+ "source",
501
+ "repo",
502
+ "ref",
503
+ "path",
504
+ "packageName",
505
+ "allowBuild"
506
+ ],
507
+ "additionalProperties": false
508
+ }
509
+ ]
296
510
  }
297
511
  }
298
512
  }