@ggui-ai/registry-core 0.6.2 → 0.7.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/impls/memory-registry-storage.d.ts.map +1 -1
- package/dist/impls/memory-registry-storage.js +44 -4
- package/dist/index.d.ts +6 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -2
- package/dist/install-command.d.ts +25 -0
- package/dist/install-command.d.ts.map +1 -0
- package/dist/install-command.js +15 -0
- package/dist/interfaces/registry-storage.d.ts +95 -1
- package/dist/interfaces/registry-storage.d.ts.map +1 -1
- package/dist/ops/delete-author-key.d.ts +45 -0
- package/dist/ops/delete-author-key.d.ts.map +1 -0
- package/dist/ops/delete-author-key.js +31 -0
- package/dist/ops/list-author-keys.d.ts +34 -0
- package/dist/ops/list-author-keys.d.ts.map +1 -0
- package/dist/ops/list-author-keys.js +45 -0
- package/dist/ops/publish.d.ts +38 -1
- package/dist/ops/publish.d.ts.map +1 -1
- package/dist/ops/publish.js +145 -3
- package/dist/ops/register-author-key.d.ts +13 -0
- package/dist/ops/register-author-key.d.ts.map +1 -1
- package/dist/ops/register-author-key.js +42 -0
- package/dist/testing/registry-storage-contract.d.ts +1 -1
- package/dist/testing/registry-storage-contract.d.ts.map +1 -1
- package/dist/testing/registry-storage-contract.js +229 -0
- package/dist/types.d.ts +143 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +49 -0
- package/package.json +13 -4
package/dist/types.d.ts
CHANGED
|
@@ -183,11 +183,62 @@ export interface CompiledBlobRow {
|
|
|
183
183
|
* Author signing-key row. One per `(subject, keyId)` pair. The key is
|
|
184
184
|
* stored base64 — verification re-decodes + invokes
|
|
185
185
|
* {@link verifyBundleEd25519}.
|
|
186
|
+
*
|
|
187
|
+
* `createdAt` + `label` ([E], 2026-08-10) are display enrichment for
|
|
188
|
+
* key-management surfaces (the list endpoint and whatever UI a
|
|
189
|
+
* deployment builds on it). Both are
|
|
190
|
+
* optional: rows written before the enrichment carry neither, and
|
|
191
|
+
* consumers MUST render the absence honestly (an em dash, not a
|
|
192
|
+
* fabricated date). `createdAt` is stamped by {@link registerAuthorKey}
|
|
193
|
+
* on first write; `label` is caller-supplied free text.
|
|
186
194
|
*/
|
|
187
195
|
export interface AuthorKeyRow {
|
|
188
196
|
readonly subject: string;
|
|
189
197
|
readonly keyId: string;
|
|
190
198
|
readonly publicKeyBase64: string;
|
|
199
|
+
/** ISO timestamp stamped by the register op on first write. */
|
|
200
|
+
readonly createdAt?: string;
|
|
201
|
+
/** Optional human-readable name (`ggui keys register --label …`). */
|
|
202
|
+
readonly label?: string;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Verification state of a claimed scope.
|
|
206
|
+
*
|
|
207
|
+
* - `unverified` — the default: the scope was claimed by first
|
|
208
|
+
* publish and nobody has proven a matching domain/brand.
|
|
209
|
+
* - `verified` — a registry operator confirmed the owner controls
|
|
210
|
+
* the matching domain or brand (out-of-band check today; a
|
|
211
|
+
* self-serve DNS flow is a future enhancement).
|
|
212
|
+
*/
|
|
213
|
+
export declare const SCOPE_VERIFICATIONS: readonly ["unverified", "verified"];
|
|
214
|
+
export type ScopeVerification = (typeof SCOPE_VERIFICATIONS)[number];
|
|
215
|
+
/**
|
|
216
|
+
* Scope-ownership row. One per claimed scope (`@acme`). Created by the
|
|
217
|
+
* FIRST authenticated publish into an unclaimed scope
|
|
218
|
+
* ({@link RegistryStorage.claimScope} — atomic first-writer-wins) and
|
|
219
|
+
* enforced on every subsequent publish: only `ownerSubject` may publish
|
|
220
|
+
* under `scope`.
|
|
221
|
+
*
|
|
222
|
+
* `ownerSubject` is the same subject namespace as
|
|
223
|
+
* {@link ArtifactVersionRow.publishedBy} — whatever the deployment's
|
|
224
|
+
* auth layer stamps into `AuthnContext.subject`.
|
|
225
|
+
*
|
|
226
|
+
* An `unverified` row is reclaimable by the registry operator in favor
|
|
227
|
+
* of a caller who proves ownership of the matching domain/brand; a
|
|
228
|
+
* `verified` row records that proof (`verifiedDomain`, `verifiedAt`).
|
|
229
|
+
*/
|
|
230
|
+
export interface ScopeOwnerRow {
|
|
231
|
+
/** PK. The npm-style scope, including the leading `@` (e.g. `@acme`). */
|
|
232
|
+
readonly scope: string;
|
|
233
|
+
/** Subject that owns publishes under this scope. */
|
|
234
|
+
readonly ownerSubject: string;
|
|
235
|
+
/** ISO timestamp of the claim (first publish or operator seed/transfer). */
|
|
236
|
+
readonly claimedAt: string;
|
|
237
|
+
readonly verification: ScopeVerification;
|
|
238
|
+
/** Domain whose control was proven, present when `verification: 'verified'`. */
|
|
239
|
+
readonly verifiedDomain?: string;
|
|
240
|
+
/** ISO timestamp of the verification, present when `verification: 'verified'`. */
|
|
241
|
+
readonly verifiedAt?: string;
|
|
191
242
|
}
|
|
192
243
|
/**
|
|
193
244
|
* `GET /pkg/{scope}/{name}/{version}` body.
|
|
@@ -331,7 +382,7 @@ export interface PublishResponseBody {
|
|
|
331
382
|
* propagates to both the wire and the runtime membership check used
|
|
332
383
|
* by downstream guards.
|
|
333
384
|
*/
|
|
334
|
-
export declare const PUBLISH_ERROR_CODES: readonly ["unauthorized", "manifest_invalid", "bundle_required", "bundle_too_large", "conformance_failed", "bundle_hash_mismatch", "unknown_key", "signature_invalid", "version_exists", "internal"];
|
|
385
|
+
export declare const PUBLISH_ERROR_CODES: readonly ["unauthorized", "manifest_invalid", "bundle_required", "bundle_too_large", "conformance_failed", "bundle_hash_mismatch", "visibility_algorithm_mismatch", "scope_forbidden", "unknown_key", "signature_invalid", "version_exists", "internal"];
|
|
335
386
|
export type PublishErrorCode = (typeof PUBLISH_ERROR_CODES)[number];
|
|
336
387
|
/**
|
|
337
388
|
* Closed enum for `GET /pkg/:scope/:name[/version]` read responses.
|
|
@@ -377,16 +428,23 @@ export type RegisterAuthorKeyErrorCode = (typeof REGISTER_AUTHOR_KEY_ERROR_CODES
|
|
|
377
428
|
*/
|
|
378
429
|
export interface RegisterAuthorKeyRequestBody {
|
|
379
430
|
readonly publicKeyBase64: string;
|
|
431
|
+
/** Optional human-readable name for the key (`--label`). */
|
|
432
|
+
readonly label?: string;
|
|
380
433
|
}
|
|
381
434
|
/**
|
|
382
435
|
* `POST /author-keys` 200/201 response. Echoes the stored row so the
|
|
383
436
|
* CLI can confirm the (subject, keyId) tuple the registry now knows.
|
|
384
|
-
* 201 on first-write; 200 on idempotent re-register of the same row
|
|
437
|
+
* 201 on first-write; 200 on idempotent re-register of the same row —
|
|
438
|
+
* in which case `createdAt`/`label` are the EXISTING row's values (a
|
|
439
|
+
* retry never rewrites them), and both are absent for rows written
|
|
440
|
+
* before the display enrichment.
|
|
385
441
|
*/
|
|
386
442
|
export interface RegisterAuthorKeyResponseBody {
|
|
387
443
|
readonly subject: string;
|
|
388
444
|
readonly keyId: string;
|
|
389
445
|
readonly publicKeyBase64: string;
|
|
446
|
+
readonly createdAt?: string;
|
|
447
|
+
readonly label?: string;
|
|
390
448
|
}
|
|
391
449
|
/**
|
|
392
450
|
* `POST /author-keys` error body — same shape as the read/search
|
|
@@ -397,6 +455,89 @@ export interface RegisterAuthorKeyErrorBody {
|
|
|
397
455
|
readonly message: string;
|
|
398
456
|
readonly detail?: unknown;
|
|
399
457
|
}
|
|
458
|
+
/**
|
|
459
|
+
* Closed enum for `GET /author-keys` list responses.
|
|
460
|
+
*
|
|
461
|
+
* - `unauthorized` — missing or invalid caller credentials (the
|
|
462
|
+
* route requires a verified bearer identity;
|
|
463
|
+
* there is no anonymous view of "my keys").
|
|
464
|
+
* - `server_error` — unexpected adapter failure.
|
|
465
|
+
*/
|
|
466
|
+
export declare const LIST_AUTHOR_KEYS_ERROR_CODES: readonly ["unauthorized", "server_error"];
|
|
467
|
+
export type ListAuthorKeysErrorCode = (typeof LIST_AUTHOR_KEYS_ERROR_CODES)[number];
|
|
468
|
+
/**
|
|
469
|
+
* One key in the `GET /author-keys` 200 response. The caller's subject
|
|
470
|
+
* is hoisted to the body root ({@link ListAuthorKeysResponseBody}) so
|
|
471
|
+
* entries carry only per-key fields. `createdAt` / `label` are absent
|
|
472
|
+
* on rows registered before the display enrichment — consumers render
|
|
473
|
+
* the absence honestly.
|
|
474
|
+
*/
|
|
475
|
+
export interface AuthorKeyListEntry {
|
|
476
|
+
readonly keyId: string;
|
|
477
|
+
readonly publicKeyBase64: string;
|
|
478
|
+
readonly createdAt?: string;
|
|
479
|
+
readonly label?: string;
|
|
480
|
+
}
|
|
481
|
+
/**
|
|
482
|
+
* `GET /author-keys` 200 response — every signing key registered under
|
|
483
|
+
* the verified caller identity, newest first (`createdAt` DESC, rows
|
|
484
|
+
* without `createdAt` last, `keyId` tie-break).
|
|
485
|
+
*/
|
|
486
|
+
export interface ListAuthorKeysResponseBody {
|
|
487
|
+
readonly subject: string;
|
|
488
|
+
readonly keys: readonly AuthorKeyListEntry[];
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* `GET /author-keys` error body. `error` narrowed to
|
|
492
|
+
* {@link ListAuthorKeysErrorCode}.
|
|
493
|
+
*/
|
|
494
|
+
export interface ListAuthorKeysErrorBody {
|
|
495
|
+
readonly error: ListAuthorKeysErrorCode;
|
|
496
|
+
readonly message: string;
|
|
497
|
+
readonly detail?: unknown;
|
|
498
|
+
}
|
|
499
|
+
/**
|
|
500
|
+
* Closed enum for `DELETE /author-keys/{keyId}` responses.
|
|
501
|
+
*
|
|
502
|
+
* - `unauthorized` — missing or invalid caller credentials.
|
|
503
|
+
* - `invalid_request` — missing/empty `keyId` path segment.
|
|
504
|
+
* - `server_error` — unexpected adapter failure.
|
|
505
|
+
*/
|
|
506
|
+
export declare const DELETE_AUTHOR_KEY_ERROR_CODES: readonly ["unauthorized", "invalid_request", "server_error"];
|
|
507
|
+
export type DeleteAuthorKeyErrorCode = (typeof DELETE_AUTHOR_KEY_ERROR_CODES)[number];
|
|
508
|
+
/**
|
|
509
|
+
* `DELETE /author-keys/{keyId}` 200 response. The delete is idempotent:
|
|
510
|
+
* `deleted: true` when a row existed and was removed, `deleted: false`
|
|
511
|
+
* when nothing existed under the caller's identity — including when the
|
|
512
|
+
* keyId belongs to a DIFFERENT subject, so key existence never leaks
|
|
513
|
+
* across accounts. Removal blocks FUTURE publishes signed with the key;
|
|
514
|
+
* versions already published stay valid (their signing key is pinned
|
|
515
|
+
* per version at publish time).
|
|
516
|
+
*/
|
|
517
|
+
export interface DeleteAuthorKeyResponseBody {
|
|
518
|
+
readonly keyId: string;
|
|
519
|
+
readonly deleted: boolean;
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* `DELETE /author-keys/{keyId}` error body. `error` narrowed to
|
|
523
|
+
* {@link DeleteAuthorKeyErrorCode}.
|
|
524
|
+
*/
|
|
525
|
+
export interface DeleteAuthorKeyErrorBody {
|
|
526
|
+
readonly error: DeleteAuthorKeyErrorCode;
|
|
527
|
+
readonly message: string;
|
|
528
|
+
readonly detail?: unknown;
|
|
529
|
+
}
|
|
530
|
+
/**
|
|
531
|
+
* THE 401 body for bearer-required registry routes — one constructor,
|
|
532
|
+
* exported beside the error-code enums, so every transport of this
|
|
533
|
+
* wire contract emits an identical unauthorized shape. Deliberately
|
|
534
|
+
* reason-agnostic: missing vs invalid credentials are distinguished in
|
|
535
|
+
* code paths and logs, never on the wire (less oracle surface).
|
|
536
|
+
*/
|
|
537
|
+
export declare function unauthorizedErrorBody(): {
|
|
538
|
+
readonly error: 'unauthorized';
|
|
539
|
+
readonly message: string;
|
|
540
|
+
};
|
|
400
541
|
/**
|
|
401
542
|
* Publish-endpoint error body. `error` is narrowed to
|
|
402
543
|
* {@link PublishErrorCode} so consumers get autocomplete +
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE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C,KAAK,CAAC,EAAE,UAAU,CAAC;CAC7B;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,yBAAyB,2DAI5B,CAAC;AACX,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/E;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,KAAK,EAAE,qBAAqB,CAAC;IACtC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;CAC3B"}
|
package/dist/types.js
CHANGED
|
@@ -7,6 +7,16 @@
|
|
|
7
7
|
* honor it.
|
|
8
8
|
*/
|
|
9
9
|
export const ARTIFACTS_METADATA_SK = 'metadata#';
|
|
10
|
+
/**
|
|
11
|
+
* Verification state of a claimed scope.
|
|
12
|
+
*
|
|
13
|
+
* - `unverified` — the default: the scope was claimed by first
|
|
14
|
+
* publish and nobody has proven a matching domain/brand.
|
|
15
|
+
* - `verified` — a registry operator confirmed the owner controls
|
|
16
|
+
* the matching domain or brand (out-of-band check today; a
|
|
17
|
+
* self-serve DNS flow is a future enhancement).
|
|
18
|
+
*/
|
|
19
|
+
export const SCOPE_VERIFICATIONS = ['unverified', 'verified'];
|
|
10
20
|
/**
|
|
11
21
|
* `GET /search` sort options. Supports a registry-web "Recent" view
|
|
12
22
|
* that needs `publishedAt`-DESC ordering.
|
|
@@ -40,6 +50,8 @@ export const PUBLISH_ERROR_CODES = [
|
|
|
40
50
|
'bundle_too_large',
|
|
41
51
|
'conformance_failed',
|
|
42
52
|
'bundle_hash_mismatch',
|
|
53
|
+
'visibility_algorithm_mismatch',
|
|
54
|
+
'scope_forbidden',
|
|
43
55
|
'unknown_key',
|
|
44
56
|
'signature_invalid',
|
|
45
57
|
'version_exists',
|
|
@@ -90,6 +102,43 @@ export const REGISTER_AUTHOR_KEY_ERROR_CODES = [
|
|
|
90
102
|
'key_conflict',
|
|
91
103
|
'server_error',
|
|
92
104
|
];
|
|
105
|
+
/**
|
|
106
|
+
* Closed enum for `GET /author-keys` list responses.
|
|
107
|
+
*
|
|
108
|
+
* - `unauthorized` — missing or invalid caller credentials (the
|
|
109
|
+
* route requires a verified bearer identity;
|
|
110
|
+
* there is no anonymous view of "my keys").
|
|
111
|
+
* - `server_error` — unexpected adapter failure.
|
|
112
|
+
*/
|
|
113
|
+
export const LIST_AUTHOR_KEYS_ERROR_CODES = [
|
|
114
|
+
'unauthorized',
|
|
115
|
+
'server_error',
|
|
116
|
+
];
|
|
117
|
+
/**
|
|
118
|
+
* Closed enum for `DELETE /author-keys/{keyId}` responses.
|
|
119
|
+
*
|
|
120
|
+
* - `unauthorized` — missing or invalid caller credentials.
|
|
121
|
+
* - `invalid_request` — missing/empty `keyId` path segment.
|
|
122
|
+
* - `server_error` — unexpected adapter failure.
|
|
123
|
+
*/
|
|
124
|
+
export const DELETE_AUTHOR_KEY_ERROR_CODES = [
|
|
125
|
+
'unauthorized',
|
|
126
|
+
'invalid_request',
|
|
127
|
+
'server_error',
|
|
128
|
+
];
|
|
129
|
+
/**
|
|
130
|
+
* THE 401 body for bearer-required registry routes — one constructor,
|
|
131
|
+
* exported beside the error-code enums, so every transport of this
|
|
132
|
+
* wire contract emits an identical unauthorized shape. Deliberately
|
|
133
|
+
* reason-agnostic: missing vs invalid credentials are distinguished in
|
|
134
|
+
* code paths and logs, never on the wire (less oracle surface).
|
|
135
|
+
*/
|
|
136
|
+
export function unauthorizedErrorBody() {
|
|
137
|
+
return {
|
|
138
|
+
error: 'unauthorized',
|
|
139
|
+
message: 'a valid bearer credential is required in the Authorization header — missing or invalid token',
|
|
140
|
+
};
|
|
141
|
+
}
|
|
93
142
|
/**
|
|
94
143
|
* Closed enum for `GET /pkg/{scope}/{name}` list-versions responses.
|
|
95
144
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ggui-ai/registry-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Pure-TypeScript registry operations and storage interfaces for the ggui marketplace. No I/O, no HTTP — operations take typed inputs plus a storage deps bag and return discriminated-union results.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ggui",
|
|
@@ -34,6 +34,11 @@
|
|
|
34
34
|
"import": "./dist/types.js",
|
|
35
35
|
"default": "./dist/types.js"
|
|
36
36
|
},
|
|
37
|
+
"./install-command": {
|
|
38
|
+
"types": "./dist/install-command.d.ts",
|
|
39
|
+
"import": "./dist/install-command.js",
|
|
40
|
+
"default": "./dist/install-command.js"
|
|
41
|
+
},
|
|
37
42
|
"./interfaces/registry-storage": {
|
|
38
43
|
"types": "./dist/interfaces/registry-storage.d.ts",
|
|
39
44
|
"import": "./dist/interfaces/registry-storage.js",
|
|
@@ -44,9 +49,9 @@
|
|
|
44
49
|
"esbuild": "0.25.12",
|
|
45
50
|
"oxc-parser": "^0.131.0",
|
|
46
51
|
"zod": "^4.3.6",
|
|
47
|
-
"@ggui-ai/artifact-manifest": "0.
|
|
48
|
-
"@ggui-ai/gadget-signing": "0.
|
|
49
|
-
"@ggui-ai/protocol": "0.
|
|
52
|
+
"@ggui-ai/artifact-manifest": "0.7.0",
|
|
53
|
+
"@ggui-ai/gadget-signing": "0.7.0",
|
|
54
|
+
"@ggui-ai/protocol": "0.7.0"
|
|
50
55
|
},
|
|
51
56
|
"peerDependenciesMeta": {
|
|
52
57
|
"vitest": {
|
|
@@ -54,7 +59,11 @@
|
|
|
54
59
|
}
|
|
55
60
|
},
|
|
56
61
|
"devDependencies": {
|
|
62
|
+
"@sigstore/mock": "~0.12.1",
|
|
63
|
+
"@sigstore/protobuf-specs": "^0.5.1",
|
|
64
|
+
"@tufjs/repo-mock": "4.0.1",
|
|
57
65
|
"@types/node": "^24.0.0",
|
|
66
|
+
"nock": "^13.5.6",
|
|
58
67
|
"typescript": "^5.0.0",
|
|
59
68
|
"vitest": "^3.2.6"
|
|
60
69
|
},
|