@agentxm/registry-protocol 0.31.1 → 0.33.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.
@@ -1,6 +1,6 @@
1
1
  import * as Schema from "effect/Schema";
2
2
  import type { PackDependencyPolicyFinding } from "@agentxm/extension-model/unstable/packs/dependency-policy";
3
- import { type ExtensionName, type ExtensionType } from "@agentxm/extension-model/unstable/extensions/common";
3
+ import { type ExtensionName, type ExtensionType, type PackMemberRegistrySource } from "@agentxm/extension-model/unstable/extensions/common";
4
4
  import { type Handle } from "@agentxm/extension-model/unstable/extensions/handle";
5
5
  import { type Version, type VersionRange } from "@agentxm/extension-model/unstable/version-constraints";
6
6
  export declare const PUBLICATION_SET_CONTRACT: "publication-set-v2";
@@ -18,6 +18,7 @@ export interface PackDependencyDescriptor {
18
18
  readonly type: Exclude<ExtensionType, "pack">;
19
19
  readonly name: ExtensionName;
20
20
  readonly range: VersionRange;
21
+ readonly source?: PackMemberRegistrySource | undefined;
21
22
  }
22
23
  export declare const PublicationVisibilityInputSchema: Schema.Struct<{
23
24
  readonly intent: Schema.NullOr<Schema.Struct<{
@@ -28,6 +29,36 @@ export declare const PublicationVisibilityInputSchema: Schema.Struct<{
28
29
  readonly request: Schema.NullOr<Schema.Literals<readonly ["public", "private"]>>;
29
30
  }>;
30
31
  export type PublicationVisibilityInput = typeof PublicationVisibilityInputSchema.Type;
32
+ export declare const PublicationDescriptorSchema: Schema.Struct<{
33
+ readonly target: Schema.Struct<{
34
+ readonly owner: Schema.brand<Schema.String, "Handle">;
35
+ readonly type: Schema.Literals<readonly ("skill" | "mcp-server" | "subagent" | "rule" | "hook" | "knowledge" | "pack")[]>;
36
+ readonly name: Schema.brand<Schema.NonEmptyString, "ExtensionName">;
37
+ readonly version: Schema.brand<Schema.String, "Version">;
38
+ }>;
39
+ readonly participation: Schema.Literals<readonly ["publish", "verified-existing"]>;
40
+ readonly archiveSha256Hex: Schema.optional<Schema.String>;
41
+ readonly visibility: Schema.Struct<{
42
+ readonly intent: Schema.NullOr<Schema.Struct<{
43
+ readonly value: Schema.Literals<readonly ["public", "private"]>;
44
+ readonly source: Schema.Literals<readonly ["manifest", "workspace"]>;
45
+ readonly fingerprint: Schema.String;
46
+ }>>;
47
+ readonly request: Schema.NullOr<Schema.Literals<readonly ["public", "private"]>>;
48
+ }>;
49
+ readonly pack: Schema.optional<Schema.Struct<{
50
+ readonly dependencies: Schema.$Array<Schema.Struct<{
51
+ readonly owner: Schema.brand<Schema.String, "Handle">;
52
+ readonly type: Schema.Literals<readonly ["hook", "knowledge", "mcp-server", "rule", "skill", "subagent"]>;
53
+ readonly name: Schema.brand<Schema.NonEmptyString, "ExtensionName">;
54
+ readonly range: Schema.brand<Schema.NonEmptyString, "VersionRange">;
55
+ readonly source: Schema.optional<Schema.Struct<{
56
+ readonly type: Schema.Literal<"registry">;
57
+ readonly url: Schema.URLFromString;
58
+ }>>;
59
+ }>>;
60
+ }>>;
61
+ }>;
31
62
  export interface PublicationDescriptor {
32
63
  readonly target: PublicationTarget;
33
64
  readonly participation: "publish" | "verified-existing";
@@ -62,6 +93,10 @@ export declare const PreviewPublicationSetRequestSchema: Schema.Struct<{
62
93
  readonly type: Schema.Literals<readonly ["hook", "knowledge", "mcp-server", "rule", "skill", "subagent"]>;
63
94
  readonly name: Schema.brand<Schema.NonEmptyString, "ExtensionName">;
64
95
  readonly range: Schema.brand<Schema.NonEmptyString, "VersionRange">;
96
+ readonly source: Schema.optional<Schema.Struct<{
97
+ readonly type: Schema.Literal<"registry">;
98
+ readonly url: Schema.URLFromString;
99
+ }>>;
65
100
  }>>;
66
101
  }>>;
67
102
  }>>;
@@ -80,6 +115,10 @@ export declare const PackDependencyFindingSchema: Schema.Struct<{
80
115
  readonly type: Schema.Literals<readonly ["hook", "knowledge", "mcp-server", "rule", "skill", "subagent"]>;
81
116
  readonly name: Schema.brand<Schema.NonEmptyString, "ExtensionName">;
82
117
  readonly range: Schema.brand<Schema.NonEmptyString, "VersionRange">;
118
+ readonly source: Schema.optional<Schema.Struct<{
119
+ readonly type: Schema.Literal<"registry">;
120
+ readonly url: Schema.URLFromString;
121
+ }>>;
83
122
  }>;
84
123
  readonly effectiveVisibility: Schema.optional<Schema.Literals<readonly ["public", "private"]>>;
85
124
  readonly lifecycle: Schema.optional<Schema.Literals<readonly ["active", "unavailable"]>>;
@@ -200,6 +239,10 @@ export declare const PreviewPublicationSetResponseSchema: Schema.Struct<{
200
239
  readonly type: Schema.Literals<readonly ["hook", "knowledge", "mcp-server", "rule", "skill", "subagent"]>;
201
240
  readonly name: Schema.brand<Schema.NonEmptyString, "ExtensionName">;
202
241
  readonly range: Schema.brand<Schema.NonEmptyString, "VersionRange">;
242
+ readonly source: Schema.optional<Schema.Struct<{
243
+ readonly type: Schema.Literal<"registry">;
244
+ readonly url: Schema.URLFromString;
245
+ }>>;
203
246
  }>;
204
247
  readonly effectiveVisibility: Schema.optional<Schema.Literals<readonly ["public", "private"]>>;
205
248
  readonly lifecycle: Schema.optional<Schema.Literals<readonly ["active", "unavailable"]>>;
@@ -241,6 +284,10 @@ export declare const PreviewPublicationSetResponseSchema: Schema.Struct<{
241
284
  readonly type: Schema.Literals<readonly ["hook", "knowledge", "mcp-server", "rule", "skill", "subagent"]>;
242
285
  readonly name: Schema.brand<Schema.NonEmptyString, "ExtensionName">;
243
286
  readonly range: Schema.brand<Schema.NonEmptyString, "VersionRange">;
287
+ readonly source: Schema.optional<Schema.Struct<{
288
+ readonly type: Schema.Literal<"registry">;
289
+ readonly url: Schema.URLFromString;
290
+ }>>;
244
291
  }>;
245
292
  readonly effectiveVersion: Schema.brand<Schema.String, "Version">;
246
293
  }>>;
@@ -250,10 +297,10 @@ export type PreviewPublicationSetResponse = typeof PreviewPublicationSetResponse
250
297
  export type PublicationCandidateResult = PreviewPublicationSetResponse["candidates"][number];
251
298
  export type PublicationPackResult = PreviewPublicationSetResponse["packs"][number];
252
299
  export declare const comparePublicationTargets: (left: PublicationTarget, right: PublicationTarget) => number;
253
- export declare const normalizePublicationDescriptor: (descriptor: PublicationDescriptor) => PublicationDescriptor;
254
- export declare const normalizePublicationSet: (descriptors: ReadonlyArray<PublicationDescriptor>) => ReadonlyArray<PublicationDescriptor>;
255
- export declare const publicationDescriptorDigest: (descriptor: PublicationDescriptor) => Sha256Hex;
256
- export declare const publicationSetDigest: (descriptors: ReadonlyArray<PublicationDescriptor>) => Sha256Hex;
300
+ export declare const normalizePublicationDescriptor: (input: unknown) => PublicationDescriptor;
301
+ export declare const normalizePublicationSet: (descriptors: ReadonlyArray<unknown>) => ReadonlyArray<PublicationDescriptor>;
302
+ export declare const publicationDescriptorDigest: (descriptor: unknown) => Sha256Hex;
303
+ export declare const publicationSetDigest: (descriptors: ReadonlyArray<unknown>) => Sha256Hex;
257
304
  export declare const archiveSha256Hex: (archive: Uint8Array) => Sha256Hex;
258
305
  export declare const publicationTargetKey: (target: PublicationTarget) => string;
259
306
  export declare const validatePublicationDescriptors: (descriptors: ReadonlyArray<PublicationDescriptor>) => ReadonlyArray<PublicationDescriptor>;
@@ -2,7 +2,7 @@ import { createHash } from "node:crypto";
2
2
  import * as Schema from "effect/Schema";
3
3
  import * as semver from "semver";
4
4
  import { SuggestedActionSchema } from "../suggested-action.js";
5
- import { ExtensionNameSchema, ExtensionTypeSchema, ExtensionVisibilitySchema, } from "@agentxm/extension-model/unstable/extensions/common";
5
+ import { ExtensionNameSchema, ExtensionTypeSchema, ExtensionVisibilitySchema, PackMemberRegistrySourceSchema, } from "@agentxm/extension-model/unstable/extensions/common";
6
6
  import { formatFqn } from "@agentxm/extension-model/unstable/extensions/fqn";
7
7
  import { HandleSchema } from "@agentxm/extension-model/unstable/extensions/handle";
8
8
  import { VisibilityEvaluationSchema, VisibilityEvaluationUnavailableSchema, VisibilityIntentSchema, } from "../publish/visibility.js";
@@ -24,12 +24,13 @@ const PackDependencyDescriptorSchema = Schema.Struct({
24
24
  type: Schema.Literals(["hook", "knowledge", "mcp-server", "rule", "skill", "subagent"]),
25
25
  name: ExtensionNameSchema,
26
26
  range: VersionRangeSchema,
27
+ source: Schema.optional(PackMemberRegistrySourceSchema),
27
28
  }).annotate({ identifier: "PackDependencyDescriptor" });
28
29
  export const PublicationVisibilityInputSchema = Schema.Struct({
29
30
  intent: Schema.NullOr(VisibilityIntentSchema),
30
31
  request: Schema.NullOr(ExtensionVisibilitySchema),
31
32
  }).annotate({ identifier: "PublicationVisibilityInput" });
32
- const PublicationDescriptorSchema = Schema.Struct({
33
+ export const PublicationDescriptorSchema = Schema.Struct({
33
34
  target: PublicationTargetSchema,
34
35
  participation: Schema.Literals(["publish", "verified-existing"]),
35
36
  archiveSha256Hex: Schema.optional(Sha256HexSchema),
@@ -38,6 +39,10 @@ const PublicationDescriptorSchema = Schema.Struct({
38
39
  dependencies: Schema.Array(PackDependencyDescriptorSchema),
39
40
  })),
40
41
  }).annotate({ identifier: "PublicationDescriptor" });
42
+ const PublicationDescriptorInputSchema = Schema.Union([
43
+ PublicationDescriptorSchema,
44
+ Schema.toType(PublicationDescriptorSchema),
45
+ ]);
41
46
  export const PreviewPublicationSetRequestSchema = Schema.Struct({
42
47
  contract: Schema.Literal(PUBLICATION_SET_CONTRACT),
43
48
  candidates: Schema.Array(PublicationDescriptorSchema),
@@ -205,34 +210,90 @@ export const comparePublicationTargets = (left, right) => compareText(left.owner
205
210
  const compareDependencies = (left, right) => compareText(left.owner, right.owner) ||
206
211
  compareText(left.type, right.type) ||
207
212
  compareText(left.name, right.name) ||
208
- compareText(left.range, right.range);
209
- export const normalizePublicationDescriptor = (descriptor) => ({
210
- target: descriptor.target,
211
- participation: descriptor.participation,
212
- visibility: descriptor.visibility,
213
- ...(descriptor.archiveSha256Hex === undefined
214
- ? {}
215
- : { archiveSha256Hex: descriptor.archiveSha256Hex }),
216
- ...(descriptor.pack === undefined
217
- ? {}
218
- : {
219
- pack: {
220
- dependencies: [...descriptor.pack.dependencies].sort(compareDependencies),
221
- },
222
- }),
223
- });
213
+ compareText(left.range, right.range) ||
214
+ compareText(left.source?.url.href ?? "", right.source?.url.href ?? "");
215
+ export const normalizePublicationDescriptor = (input) => {
216
+ const descriptor = Schema.decodeUnknownSync(PublicationDescriptorInputSchema)(input);
217
+ return {
218
+ target: {
219
+ owner: descriptor.target.owner,
220
+ type: descriptor.target.type,
221
+ name: descriptor.target.name,
222
+ version: descriptor.target.version,
223
+ },
224
+ participation: descriptor.participation,
225
+ visibility: {
226
+ intent: descriptor.visibility.intent === null
227
+ ? null
228
+ : {
229
+ value: descriptor.visibility.intent.value,
230
+ source: descriptor.visibility.intent.source,
231
+ fingerprint: descriptor.visibility.intent.fingerprint,
232
+ },
233
+ request: descriptor.visibility.request,
234
+ },
235
+ ...(descriptor.archiveSha256Hex === undefined
236
+ ? {}
237
+ : { archiveSha256Hex: descriptor.archiveSha256Hex }),
238
+ ...(descriptor.pack === undefined
239
+ ? {}
240
+ : {
241
+ pack: {
242
+ dependencies: descriptor.pack.dependencies
243
+ .map((dependency) => ({
244
+ owner: dependency.owner,
245
+ type: dependency.type,
246
+ name: dependency.name,
247
+ range: dependency.range,
248
+ ...(dependency.source === undefined
249
+ ? {}
250
+ : {
251
+ source: {
252
+ type: dependency.source.type,
253
+ url: dependency.source.url,
254
+ },
255
+ }),
256
+ }))
257
+ .sort(compareDependencies),
258
+ },
259
+ }),
260
+ };
261
+ };
224
262
  export const normalizePublicationSet = (descriptors) => descriptors
225
263
  .map(normalizePublicationDescriptor)
226
264
  .sort((left, right) => comparePublicationTargets(left.target, right.target));
227
265
  const canonicalBytes = (value) => new TextEncoder().encode(JSON.stringify(value));
266
+ const canonicalPublicationDescriptor = (input) => {
267
+ const descriptor = normalizePublicationDescriptor(input);
268
+ return {
269
+ ...descriptor,
270
+ ...(descriptor.pack === undefined
271
+ ? {}
272
+ : {
273
+ pack: {
274
+ dependencies: descriptor.pack.dependencies.map((dependency) => ({
275
+ ...dependency,
276
+ ...(dependency.source === undefined
277
+ ? {}
278
+ : {
279
+ source: {
280
+ type: dependency.source.type,
281
+ url: dependency.source.url.href,
282
+ },
283
+ }),
284
+ })),
285
+ },
286
+ }),
287
+ };
288
+ };
228
289
  const sha256Hex = (bytes) => Schema.decodeUnknownSync(Sha256HexSchema)(createHash("sha256").update(bytes).digest("hex"));
229
290
  export const publicationDescriptorDigest = (descriptor) => sha256Hex(canonicalBytes({
230
291
  contract: PUBLICATION_SET_CONTRACT,
231
- descriptor: normalizePublicationDescriptor(descriptor),
292
+ descriptor: canonicalPublicationDescriptor(descriptor),
232
293
  }));
233
294
  export const publicationSetDigest = (descriptors) => sha256Hex(canonicalBytes({
234
295
  contract: PUBLICATION_SET_CONTRACT,
235
- candidates: normalizePublicationSet(descriptors),
296
+ candidates: normalizePublicationSet(descriptors).map(canonicalPublicationDescriptor),
236
297
  }));
237
298
  export const archiveSha256Hex = (archive) => sha256Hex(archive);
238
299
  export const publicationTargetKey = (target) => JSON.stringify([target.owner, target.type, target.name, target.version]);
@@ -241,12 +302,9 @@ export const validatePublicationDescriptors = (descriptors) => {
241
302
  if (descriptors.length > MAX_PUBLICATION_SET_CANDIDATES) {
242
303
  throw new RangeError(`Publication sets accept at most ${MAX_PUBLICATION_SET_CANDIDATES} candidates.`);
243
304
  }
244
- Schema.decodeUnknownSync(PreviewPublicationSetRequestSchema)({
245
- contract: PUBLICATION_SET_CONTRACT,
246
- candidates: descriptors,
247
- });
305
+ const normalized = normalizePublicationSet(descriptors);
248
306
  const identities = new Set();
249
- for (const descriptor of descriptors) {
307
+ for (const descriptor of normalized) {
250
308
  const key = publicationIdentityKey(descriptor.target);
251
309
  if (identities.has(key)) {
252
310
  throw new TypeError(`Duplicate publication target ${key}.`);
@@ -259,7 +317,7 @@ export const validatePublicationDescriptors = (descriptors) => {
259
317
  throw new TypeError("Pack declarations are required exactly for pack candidates.");
260
318
  }
261
319
  }
262
- return normalizePublicationSet(descriptors);
320
+ return normalized;
263
321
  };
264
322
  const dependencyIdentityKey = (dependency) => `${dependency.owner}\u0000${dependency.type}\u0000${dependency.name}`;
265
323
  export const validatePublicationSetResponse = (descriptors, response) => {
@@ -0,0 +1,351 @@
1
+ /**
2
+ * Repeat-safe Registry metadata query contract. Selection stays with the client;
3
+ * each response page is evidence for one authorized identity and revision.
4
+ *
5
+ * @experimental This API is unstable and may change without notice.
6
+ */
7
+ import * as Schema from "effect/Schema";
8
+ import * as Result from "effect/Result";
9
+ export declare const RESOLUTION_METADATA_SCHEMA_VERSION = 1;
10
+ export declare const RESOLUTION_SELECTION_POLICY_VERSION = "1";
11
+ export declare const MAX_RESOLUTION_METADATA_ITEMS = 100;
12
+ export declare const MAX_RESOLUTION_METADATA_VERSIONS_PER_PAGE = 100;
13
+ export declare const MAX_RESOLUTION_METADATA_REQUEST_BYTES: number;
14
+ export declare const MAX_RESOLUTION_METADATA_RESPONSE_BYTES: number;
15
+ export declare const ResolutionMetadataIdentitySchema: Schema.Struct<{
16
+ readonly owner: Schema.brand<Schema.String, "Handle">;
17
+ readonly type: Schema.Literals<readonly ("skill" | "mcp-server" | "subagent" | "rule" | "hook" | "knowledge" | "pack")[]>;
18
+ readonly name: Schema.brand<Schema.NonEmptyString, "ExtensionName">;
19
+ }>;
20
+ export declare const ResolutionMetadataItemSchema: Schema.Union<readonly [Schema.Struct<{
21
+ readonly purpose: Schema.Literal<"select">;
22
+ readonly key: Schema.NonEmptyString;
23
+ readonly identity: Schema.Struct<{
24
+ readonly owner: Schema.brand<Schema.String, "Handle">;
25
+ readonly type: Schema.Literals<readonly ("skill" | "mcp-server" | "subagent" | "rule" | "hook" | "knowledge" | "pack")[]>;
26
+ readonly name: Schema.brand<Schema.NonEmptyString, "ExtensionName">;
27
+ }>;
28
+ readonly expectedPublisherBinding: Schema.optional<Schema.NonEmptyString>;
29
+ readonly knownRevision: Schema.optional<Schema.NonEmptyString>;
30
+ readonly continuation: Schema.optional<Schema.Struct<{
31
+ readonly token: Schema.NonEmptyString;
32
+ readonly revision: Schema.NonEmptyString;
33
+ }>>;
34
+ }>, Schema.Struct<{
35
+ readonly purpose: Schema.Literal<"restore-exact">;
36
+ readonly accepted: Schema.Struct<{
37
+ readonly version: Schema.brand<Schema.String, "Version">;
38
+ readonly integrity: Schema.NonEmptyString;
39
+ }>;
40
+ readonly key: Schema.NonEmptyString;
41
+ readonly identity: Schema.Struct<{
42
+ readonly owner: Schema.brand<Schema.String, "Handle">;
43
+ readonly type: Schema.Literals<readonly ("skill" | "mcp-server" | "subagent" | "rule" | "hook" | "knowledge" | "pack")[]>;
44
+ readonly name: Schema.brand<Schema.NonEmptyString, "ExtensionName">;
45
+ }>;
46
+ readonly expectedPublisherBinding: Schema.optional<Schema.NonEmptyString>;
47
+ readonly knownRevision: Schema.optional<Schema.NonEmptyString>;
48
+ readonly continuation: Schema.optional<Schema.Struct<{
49
+ readonly token: Schema.NonEmptyString;
50
+ readonly revision: Schema.NonEmptyString;
51
+ }>>;
52
+ }>]>;
53
+ export declare const ResolutionMetadataRequestSchema: Schema.Struct<{
54
+ readonly schemaVersion: Schema.Literal<1>;
55
+ readonly selectionPolicyVersion: Schema.Literal<"1">;
56
+ readonly items: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
57
+ readonly purpose: Schema.Literal<"select">;
58
+ readonly key: Schema.NonEmptyString;
59
+ readonly identity: Schema.Struct<{
60
+ readonly owner: Schema.brand<Schema.String, "Handle">;
61
+ readonly type: Schema.Literals<readonly ("skill" | "mcp-server" | "subagent" | "rule" | "hook" | "knowledge" | "pack")[]>;
62
+ readonly name: Schema.brand<Schema.NonEmptyString, "ExtensionName">;
63
+ }>;
64
+ readonly expectedPublisherBinding: Schema.optional<Schema.NonEmptyString>;
65
+ readonly knownRevision: Schema.optional<Schema.NonEmptyString>;
66
+ readonly continuation: Schema.optional<Schema.Struct<{
67
+ readonly token: Schema.NonEmptyString;
68
+ readonly revision: Schema.NonEmptyString;
69
+ }>>;
70
+ }>, Schema.Struct<{
71
+ readonly purpose: Schema.Literal<"restore-exact">;
72
+ readonly accepted: Schema.Struct<{
73
+ readonly version: Schema.brand<Schema.String, "Version">;
74
+ readonly integrity: Schema.NonEmptyString;
75
+ }>;
76
+ readonly key: Schema.NonEmptyString;
77
+ readonly identity: Schema.Struct<{
78
+ readonly owner: Schema.brand<Schema.String, "Handle">;
79
+ readonly type: Schema.Literals<readonly ("skill" | "mcp-server" | "subagent" | "rule" | "hook" | "knowledge" | "pack")[]>;
80
+ readonly name: Schema.brand<Schema.NonEmptyString, "ExtensionName">;
81
+ }>;
82
+ readonly expectedPublisherBinding: Schema.optional<Schema.NonEmptyString>;
83
+ readonly knownRevision: Schema.optional<Schema.NonEmptyString>;
84
+ readonly continuation: Schema.optional<Schema.Struct<{
85
+ readonly token: Schema.NonEmptyString;
86
+ readonly revision: Schema.NonEmptyString;
87
+ }>>;
88
+ }>]>>;
89
+ }>;
90
+ export type ResolutionMetadataRequest = typeof ResolutionMetadataRequestSchema.Type;
91
+ export declare const ResolutionMetadataOutcomeSchema: Schema.Union<readonly [Schema.Struct<{
92
+ readonly key: Schema.NonEmptyString;
93
+ readonly outcome: Schema.Literal<"metadata">;
94
+ readonly page: Schema.Struct<{
95
+ readonly versions: Schema.$Array<Schema.Struct<{
96
+ readonly version: Schema.brand<Schema.String, "Version">;
97
+ readonly published: Schema.decodeTo<Schema.DateTimeUtc, Schema.String, never, never>;
98
+ readonly dependencies: Schema.optional<Schema.$Record<Schema.String, Schema.brand<Schema.NonEmptyString, "VersionRange">>>;
99
+ readonly packages: Schema.optional<Schema.$Array<Schema.Struct<{
100
+ readonly purl: Schema.brand<Schema.NonEmptyString, "PackageIdentityPurl">;
101
+ readonly versionRange: Schema.optional<Schema.brand<Schema.decodeTo<Schema.toType<Schema.Struct<{
102
+ readonly raw: Schema.NonEmptyString;
103
+ readonly scheme: Schema.NonEmptyString;
104
+ readonly constraints: Schema.$Array<Schema.Struct<{
105
+ readonly comparator: Schema.Literals<readonly ["=", "!=", "<", "<=", ">", ">="]>;
106
+ readonly version: Schema.NonEmptyString;
107
+ }>>;
108
+ }>>, Schema.NonEmptyString, never, never>, "VersRange">>;
109
+ }>>>;
110
+ readonly integrity: Schema.String;
111
+ readonly yankedAt: Schema.optional<Schema.decodeTo<Schema.DateTimeUtc, Schema.String, never, never>>;
112
+ readonly yankCategory: Schema.optional<Schema.String>;
113
+ readonly yankNotice: Schema.optional<Schema.String>;
114
+ }>>;
115
+ readonly continuation: Schema.NullOr<Schema.NonEmptyString>;
116
+ readonly description: Schema.optional<Schema.String>;
117
+ readonly repository: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Struct<{
118
+ readonly type: Schema.optional<Schema.NonEmptyString>;
119
+ readonly url: Schema.NonEmptyString;
120
+ readonly directory: Schema.optional<Schema.NonEmptyString>;
121
+ }>]>>;
122
+ readonly bugs: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Struct<{
123
+ readonly url: Schema.optional<Schema.NonEmptyString>;
124
+ readonly email: Schema.optional<Schema.NonEmptyString>;
125
+ }>]>>;
126
+ readonly license: Schema.optional<Schema.String>;
127
+ readonly authors: Schema.optional<Schema.$Array<Schema.Struct<{
128
+ readonly name: Schema.String;
129
+ readonly email: Schema.optional<Schema.String>;
130
+ readonly url: Schema.optional<Schema.String>;
131
+ }>>>;
132
+ readonly publisherBindingId: Schema.NonEmptyString;
133
+ readonly visibility: Schema.Literals<readonly ["public", "private"]>;
134
+ readonly archival: Schema.NullOr<Schema.Struct<{
135
+ readonly archivedAt: Schema.decodeTo<Schema.DateTimeUtc, Schema.String, never, never>;
136
+ readonly reason: Schema.optional<Schema.String>;
137
+ }>>;
138
+ readonly deprecation: Schema.NullOr<Schema.Union<readonly [Schema.Struct<{
139
+ readonly deprecatedAt: Schema.decodeTo<Schema.DateTimeUtc, Schema.String, never, never>;
140
+ readonly message: Schema.String;
141
+ readonly replacement: Schema.optional<Schema.Union<readonly [Schema.Struct<{
142
+ readonly status: Schema.Literal<"available">;
143
+ readonly fqn: Schema.String;
144
+ }>, Schema.Struct<{
145
+ readonly status: Schema.Literal<"unavailable">;
146
+ readonly fqn: Schema.optional<Schema.String>;
147
+ }>]>>;
148
+ }>, Schema.Struct<{
149
+ readonly deprecatedAt: Schema.decodeTo<Schema.DateTimeUtc, Schema.String, never, never>;
150
+ readonly message: Schema.optional<Schema.String>;
151
+ readonly replacement: Schema.Union<readonly [Schema.Struct<{
152
+ readonly status: Schema.Literal<"available">;
153
+ readonly fqn: Schema.String;
154
+ }>, Schema.Struct<{
155
+ readonly status: Schema.Literal<"unavailable">;
156
+ readonly fqn: Schema.optional<Schema.String>;
157
+ }>]>;
158
+ }>]>>;
159
+ readonly revision: Schema.NonEmptyString;
160
+ readonly observedAt: Schema.decodeTo<Schema.DateTimeUtc, Schema.String, never, never>;
161
+ readonly validUntil: Schema.decodeTo<Schema.DateTimeUtc, Schema.String, never, never>;
162
+ }>;
163
+ }>, Schema.Struct<{
164
+ readonly exactVersion: Schema.optional<Schema.brand<Schema.String, "Version">>;
165
+ readonly publisherBindingId: Schema.NonEmptyString;
166
+ readonly visibility: Schema.Literals<readonly ["public", "private"]>;
167
+ readonly archival: Schema.NullOr<Schema.Struct<{
168
+ readonly archivedAt: Schema.decodeTo<Schema.DateTimeUtc, Schema.String, never, never>;
169
+ readonly reason: Schema.optional<Schema.String>;
170
+ }>>;
171
+ readonly deprecation: Schema.NullOr<Schema.Union<readonly [Schema.Struct<{
172
+ readonly deprecatedAt: Schema.decodeTo<Schema.DateTimeUtc, Schema.String, never, never>;
173
+ readonly message: Schema.String;
174
+ readonly replacement: Schema.optional<Schema.Union<readonly [Schema.Struct<{
175
+ readonly status: Schema.Literal<"available">;
176
+ readonly fqn: Schema.String;
177
+ }>, Schema.Struct<{
178
+ readonly status: Schema.Literal<"unavailable">;
179
+ readonly fqn: Schema.optional<Schema.String>;
180
+ }>]>>;
181
+ }>, Schema.Struct<{
182
+ readonly deprecatedAt: Schema.decodeTo<Schema.DateTimeUtc, Schema.String, never, never>;
183
+ readonly message: Schema.optional<Schema.String>;
184
+ readonly replacement: Schema.Union<readonly [Schema.Struct<{
185
+ readonly status: Schema.Literal<"available">;
186
+ readonly fqn: Schema.String;
187
+ }>, Schema.Struct<{
188
+ readonly status: Schema.Literal<"unavailable">;
189
+ readonly fqn: Schema.optional<Schema.String>;
190
+ }>]>;
191
+ }>]>>;
192
+ readonly revision: Schema.NonEmptyString;
193
+ readonly observedAt: Schema.decodeTo<Schema.DateTimeUtc, Schema.String, never, never>;
194
+ readonly validUntil: Schema.decodeTo<Schema.DateTimeUtc, Schema.String, never, never>;
195
+ readonly key: Schema.NonEmptyString;
196
+ readonly outcome: Schema.Literal<"unchanged">;
197
+ }>, Schema.Struct<{
198
+ readonly key: Schema.NonEmptyString;
199
+ readonly outcome: Schema.Literal<"unavailable">;
200
+ }>, Schema.Struct<{
201
+ readonly key: Schema.NonEmptyString;
202
+ readonly outcome: Schema.Literal<"binding-conflict">;
203
+ readonly publisherBindingId: Schema.NonEmptyString;
204
+ }>, Schema.Struct<{
205
+ readonly key: Schema.NonEmptyString;
206
+ readonly outcome: Schema.Literal<"exact-conflict">;
207
+ readonly reason: Schema.Literals<readonly ["version-unavailable", "integrity-mismatch"]>;
208
+ }>, Schema.Struct<{
209
+ readonly key: Schema.NonEmptyString;
210
+ readonly outcome: Schema.Literal<"restart-required">;
211
+ readonly revision: Schema.NonEmptyString;
212
+ }>]>;
213
+ export type ResolutionMetadataOutcome = typeof ResolutionMetadataOutcomeSchema.Type;
214
+ export declare const ResolutionMetadataResponseSchema: Schema.Struct<{
215
+ readonly schemaVersion: Schema.Literal<1>;
216
+ readonly selectionPolicyVersion: Schema.Literal<"1">;
217
+ readonly observedAt: Schema.decodeTo<Schema.DateTimeUtc, Schema.String, never, never>;
218
+ readonly results: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
219
+ readonly key: Schema.NonEmptyString;
220
+ readonly outcome: Schema.Literal<"metadata">;
221
+ readonly page: Schema.Struct<{
222
+ readonly versions: Schema.$Array<Schema.Struct<{
223
+ readonly version: Schema.brand<Schema.String, "Version">;
224
+ readonly published: Schema.decodeTo<Schema.DateTimeUtc, Schema.String, never, never>;
225
+ readonly dependencies: Schema.optional<Schema.$Record<Schema.String, Schema.brand<Schema.NonEmptyString, "VersionRange">>>;
226
+ readonly packages: Schema.optional<Schema.$Array<Schema.Struct<{
227
+ readonly purl: Schema.brand<Schema.NonEmptyString, "PackageIdentityPurl">;
228
+ readonly versionRange: Schema.optional<Schema.brand<Schema.decodeTo<Schema.toType<Schema.Struct<{
229
+ readonly raw: Schema.NonEmptyString;
230
+ readonly scheme: Schema.NonEmptyString;
231
+ readonly constraints: Schema.$Array<Schema.Struct<{
232
+ readonly comparator: Schema.Literals<readonly ["=", "!=", "<", "<=", ">", ">="]>;
233
+ readonly version: Schema.NonEmptyString;
234
+ }>>;
235
+ }>>, Schema.NonEmptyString, never, never>, "VersRange">>;
236
+ }>>>;
237
+ readonly integrity: Schema.String;
238
+ readonly yankedAt: Schema.optional<Schema.decodeTo<Schema.DateTimeUtc, Schema.String, never, never>>;
239
+ readonly yankCategory: Schema.optional<Schema.String>;
240
+ readonly yankNotice: Schema.optional<Schema.String>;
241
+ }>>;
242
+ readonly continuation: Schema.NullOr<Schema.NonEmptyString>;
243
+ readonly description: Schema.optional<Schema.String>;
244
+ readonly repository: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Struct<{
245
+ readonly type: Schema.optional<Schema.NonEmptyString>;
246
+ readonly url: Schema.NonEmptyString;
247
+ readonly directory: Schema.optional<Schema.NonEmptyString>;
248
+ }>]>>;
249
+ readonly bugs: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Struct<{
250
+ readonly url: Schema.optional<Schema.NonEmptyString>;
251
+ readonly email: Schema.optional<Schema.NonEmptyString>;
252
+ }>]>>;
253
+ readonly license: Schema.optional<Schema.String>;
254
+ readonly authors: Schema.optional<Schema.$Array<Schema.Struct<{
255
+ readonly name: Schema.String;
256
+ readonly email: Schema.optional<Schema.String>;
257
+ readonly url: Schema.optional<Schema.String>;
258
+ }>>>;
259
+ readonly publisherBindingId: Schema.NonEmptyString;
260
+ readonly visibility: Schema.Literals<readonly ["public", "private"]>;
261
+ readonly archival: Schema.NullOr<Schema.Struct<{
262
+ readonly archivedAt: Schema.decodeTo<Schema.DateTimeUtc, Schema.String, never, never>;
263
+ readonly reason: Schema.optional<Schema.String>;
264
+ }>>;
265
+ readonly deprecation: Schema.NullOr<Schema.Union<readonly [Schema.Struct<{
266
+ readonly deprecatedAt: Schema.decodeTo<Schema.DateTimeUtc, Schema.String, never, never>;
267
+ readonly message: Schema.String;
268
+ readonly replacement: Schema.optional<Schema.Union<readonly [Schema.Struct<{
269
+ readonly status: Schema.Literal<"available">;
270
+ readonly fqn: Schema.String;
271
+ }>, Schema.Struct<{
272
+ readonly status: Schema.Literal<"unavailable">;
273
+ readonly fqn: Schema.optional<Schema.String>;
274
+ }>]>>;
275
+ }>, Schema.Struct<{
276
+ readonly deprecatedAt: Schema.decodeTo<Schema.DateTimeUtc, Schema.String, never, never>;
277
+ readonly message: Schema.optional<Schema.String>;
278
+ readonly replacement: Schema.Union<readonly [Schema.Struct<{
279
+ readonly status: Schema.Literal<"available">;
280
+ readonly fqn: Schema.String;
281
+ }>, Schema.Struct<{
282
+ readonly status: Schema.Literal<"unavailable">;
283
+ readonly fqn: Schema.optional<Schema.String>;
284
+ }>]>;
285
+ }>]>>;
286
+ readonly revision: Schema.NonEmptyString;
287
+ readonly observedAt: Schema.decodeTo<Schema.DateTimeUtc, Schema.String, never, never>;
288
+ readonly validUntil: Schema.decodeTo<Schema.DateTimeUtc, Schema.String, never, never>;
289
+ }>;
290
+ }>, Schema.Struct<{
291
+ readonly exactVersion: Schema.optional<Schema.brand<Schema.String, "Version">>;
292
+ readonly publisherBindingId: Schema.NonEmptyString;
293
+ readonly visibility: Schema.Literals<readonly ["public", "private"]>;
294
+ readonly archival: Schema.NullOr<Schema.Struct<{
295
+ readonly archivedAt: Schema.decodeTo<Schema.DateTimeUtc, Schema.String, never, never>;
296
+ readonly reason: Schema.optional<Schema.String>;
297
+ }>>;
298
+ readonly deprecation: Schema.NullOr<Schema.Union<readonly [Schema.Struct<{
299
+ readonly deprecatedAt: Schema.decodeTo<Schema.DateTimeUtc, Schema.String, never, never>;
300
+ readonly message: Schema.String;
301
+ readonly replacement: Schema.optional<Schema.Union<readonly [Schema.Struct<{
302
+ readonly status: Schema.Literal<"available">;
303
+ readonly fqn: Schema.String;
304
+ }>, Schema.Struct<{
305
+ readonly status: Schema.Literal<"unavailable">;
306
+ readonly fqn: Schema.optional<Schema.String>;
307
+ }>]>>;
308
+ }>, Schema.Struct<{
309
+ readonly deprecatedAt: Schema.decodeTo<Schema.DateTimeUtc, Schema.String, never, never>;
310
+ readonly message: Schema.optional<Schema.String>;
311
+ readonly replacement: Schema.Union<readonly [Schema.Struct<{
312
+ readonly status: Schema.Literal<"available">;
313
+ readonly fqn: Schema.String;
314
+ }>, Schema.Struct<{
315
+ readonly status: Schema.Literal<"unavailable">;
316
+ readonly fqn: Schema.optional<Schema.String>;
317
+ }>]>;
318
+ }>]>>;
319
+ readonly revision: Schema.NonEmptyString;
320
+ readonly observedAt: Schema.decodeTo<Schema.DateTimeUtc, Schema.String, never, never>;
321
+ readonly validUntil: Schema.decodeTo<Schema.DateTimeUtc, Schema.String, never, never>;
322
+ readonly key: Schema.NonEmptyString;
323
+ readonly outcome: Schema.Literal<"unchanged">;
324
+ }>, Schema.Struct<{
325
+ readonly key: Schema.NonEmptyString;
326
+ readonly outcome: Schema.Literal<"unavailable">;
327
+ }>, Schema.Struct<{
328
+ readonly key: Schema.NonEmptyString;
329
+ readonly outcome: Schema.Literal<"binding-conflict">;
330
+ readonly publisherBindingId: Schema.NonEmptyString;
331
+ }>, Schema.Struct<{
332
+ readonly key: Schema.NonEmptyString;
333
+ readonly outcome: Schema.Literal<"exact-conflict">;
334
+ readonly reason: Schema.Literals<readonly ["version-unavailable", "integrity-mismatch"]>;
335
+ }>, Schema.Struct<{
336
+ readonly key: Schema.NonEmptyString;
337
+ readonly outcome: Schema.Literal<"restart-required">;
338
+ readonly revision: Schema.NonEmptyString;
339
+ }>]>>;
340
+ }>;
341
+ export type ResolutionMetadataResponse = typeof ResolutionMetadataResponseSchema.Type;
342
+ /** Validate the response against the submitted keys before consuming any page. */
343
+ export declare const resolutionMetadataResponseMatchesRequest: (request: ResolutionMetadataRequest, response: ResolutionMetadataResponse) => boolean;
344
+ export declare const ResolutionMetadataErrorSchema: Schema.Struct<{
345
+ readonly code: Schema.Literals<readonly ["invalid-request", "unsupported-schema-version", "unsupported-selection-policy-version", "request-too-large", "response-too-large", "backend-unavailable"]>;
346
+ readonly detail: Schema.String;
347
+ }>;
348
+ export type ResolutionMetadataError = typeof ResolutionMetadataErrorSchema.Type;
349
+ /** Apply the encoded body limit before parsing an untrusted request. */
350
+ export declare const decodeResolutionMetadataRequestBody: (body: Uint8Array) => Result.Result<ResolutionMetadataRequest, ResolutionMetadataError>;
351
+ //# sourceMappingURL=resolution-metadata.d.ts.map