@wildo-ai/platform-config-lib 1.1.5 → 1.1.6

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 (138) hide show
  1. package/dist/esm/bootstrap/bootstrap.contracts.d.ts +3 -2
  2. package/dist/esm/bootstrap/bootstrap.contracts.d.ts.map +1 -1
  3. package/dist/esm/bootstrap/bootstrap.contracts.js +3 -2
  4. package/dist/esm/bootstrap/bootstrap.contracts.js.map +1 -1
  5. package/dist/esm/bootstrap/bootstrap.schemas.d.ts +47 -0
  6. package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
  7. package/dist/esm/bootstrap/bootstrap.schemas.js +8 -0
  8. package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
  9. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts +12 -1
  10. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
  11. package/dist/esm/bootstrap/platform-runtime-env.contracts.js +12 -0
  12. package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
  13. package/dist/esm/bootstrap/platform-store-preconnect.d.ts +37 -0
  14. package/dist/esm/bootstrap/platform-store-preconnect.d.ts.map +1 -0
  15. package/dist/esm/bootstrap/platform-store-preconnect.js +43 -0
  16. package/dist/esm/bootstrap/platform-store-preconnect.js.map +1 -0
  17. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts.map +1 -1
  18. package/dist/esm/bootstrap/runtime-backing-service-access.js +8 -4
  19. package/dist/esm/bootstrap/runtime-backing-service-access.js.map +1 -1
  20. package/dist/esm/bootstrap/runtime-topology.contracts.d.ts +36 -3
  21. package/dist/esm/bootstrap/runtime-topology.contracts.d.ts.map +1 -1
  22. package/dist/esm/bootstrap/runtime-topology.contracts.js +36 -13
  23. package/dist/esm/bootstrap/runtime-topology.contracts.js.map +1 -1
  24. package/dist/esm/index.d.ts +1 -0
  25. package/dist/esm/index.d.ts.map +1 -1
  26. package/dist/esm/index.js +1 -0
  27. package/dist/esm/index.js.map +1 -1
  28. package/dist/esm/lockfile/lockfile-io.d.ts +7 -1
  29. package/dist/esm/lockfile/lockfile-io.d.ts.map +1 -1
  30. package/dist/esm/lockfile/lockfile-io.js +17 -3
  31. package/dist/esm/lockfile/lockfile-io.js.map +1 -1
  32. package/dist/esm/lockfile/materialize-infra-section.d.ts +27 -6
  33. package/dist/esm/lockfile/materialize-infra-section.d.ts.map +1 -1
  34. package/dist/esm/lockfile/materialize-infra-section.js +23 -10
  35. package/dist/esm/lockfile/materialize-infra-section.js.map +1 -1
  36. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts +455 -6
  37. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -1
  38. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js +27 -0
  39. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -1
  40. package/dist/esm/project-config/application-public-pricing-catalog.loader.d.ts +13 -0
  41. package/dist/esm/project-config/application-public-pricing-catalog.loader.d.ts.map +1 -0
  42. package/dist/esm/project-config/application-public-pricing-catalog.loader.js +56 -0
  43. package/dist/esm/project-config/application-public-pricing-catalog.loader.js.map +1 -0
  44. package/dist/esm/project-config/define-infra-env-config.d.ts +0 -27
  45. package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -1
  46. package/dist/esm/project-config/define-infra-env-config.js +0 -2
  47. package/dist/esm/project-config/define-infra-env-config.js.map +1 -1
  48. package/dist/esm/project-config/define-saas-config.d.ts +52 -0
  49. package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
  50. package/dist/esm/project-config/define-saas-config.js +65 -15
  51. package/dist/esm/project-config/define-saas-config.js.map +1 -1
  52. package/dist/esm/project-config/index.d.ts +3 -0
  53. package/dist/esm/project-config/index.d.ts.map +1 -1
  54. package/dist/esm/project-config/index.js +3 -0
  55. package/dist/esm/project-config/index.js.map +1 -1
  56. package/dist/esm/project-config/loader.d.ts +11 -0
  57. package/dist/esm/project-config/loader.d.ts.map +1 -1
  58. package/dist/esm/project-config/loader.js +34 -7
  59. package/dist/esm/project-config/loader.js.map +1 -1
  60. package/dist/esm/project-config/npm-version-range.d.ts +23 -0
  61. package/dist/esm/project-config/npm-version-range.d.ts.map +1 -0
  62. package/dist/esm/project-config/npm-version-range.js +175 -0
  63. package/dist/esm/project-config/npm-version-range.js.map +1 -0
  64. package/dist/esm/project-config/provider-companion-discovery.d.ts +256 -30
  65. package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -1
  66. package/dist/esm/project-config/provider-companion-discovery.js +719 -40
  67. package/dist/esm/project-config/provider-companion-discovery.js.map +1 -1
  68. package/dist/esm/project-config/provider-runtime-artifacts.d.ts +125 -2
  69. package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
  70. package/dist/esm/project-config/provider-runtime-artifacts.js +283 -66
  71. package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -1
  72. package/dist/esm/project-config/shared/backing-service-servability.d.ts +157 -0
  73. package/dist/esm/project-config/shared/backing-service-servability.d.ts.map +1 -0
  74. package/dist/esm/project-config/shared/backing-service-servability.js +256 -0
  75. package/dist/esm/project-config/shared/backing-service-servability.js.map +1 -0
  76. package/dist/esm/project-config/shared/backing-services.schemas.d.ts +62 -67
  77. package/dist/esm/project-config/shared/backing-services.schemas.d.ts.map +1 -1
  78. package/dist/esm/project-config/shared/backing-services.schemas.js +71 -68
  79. package/dist/esm/project-config/shared/backing-services.schemas.js.map +1 -1
  80. package/dist/esm/project-config/shared/csp-emit.d.ts.map +1 -1
  81. package/dist/esm/project-config/shared/csp-emit.js +41 -2
  82. package/dist/esm/project-config/shared/csp-emit.js.map +1 -1
  83. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts +180 -4
  84. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -1
  85. package/dist/esm/project-config/shared/infra-providers.schemas.js +40 -0
  86. package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -1
  87. package/dist/esm/project-config/static-asset-import-noop.d.ts +26 -0
  88. package/dist/esm/project-config/static-asset-import-noop.d.ts.map +1 -0
  89. package/dist/esm/project-config/static-asset-import-noop.js +49 -0
  90. package/dist/esm/project-config/static-asset-import-noop.js.map +1 -0
  91. package/dist/esm/registry/companion-api.schemas.d.ts +0 -176
  92. package/dist/esm/registry/companion-api.schemas.d.ts.map +0 -1
  93. package/dist/esm/registry/companion-api.schemas.js.map +0 -1
  94. package/dist/esm/registry/index.d.ts +3 -1
  95. package/dist/esm/registry/index.d.ts.map +1 -1
  96. package/dist/esm/registry/index.js +3 -1
  97. package/dist/esm/registry/index.js.map +1 -1
  98. package/dist/esm/registry/local-checkout-source.d.ts +31 -0
  99. package/dist/esm/registry/local-checkout-source.d.ts.map +1 -0
  100. package/dist/esm/registry/local-checkout-source.js +45 -0
  101. package/dist/esm/registry/local-checkout-source.js.map +1 -0
  102. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts +174 -14
  103. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts.map +1 -1
  104. package/dist/esm/registry/lockfile-modules-section.schemas.js +120 -11
  105. package/dist/esm/registry/lockfile-modules-section.schemas.js.map +1 -1
  106. package/dist/esm/registry/module-artifact.schemas.d.ts +79 -0
  107. package/dist/esm/registry/module-artifact.schemas.d.ts.map +1 -1
  108. package/dist/esm/registry/module-artifact.schemas.js +36 -0
  109. package/dist/esm/registry/module-artifact.schemas.js.map +1 -1
  110. package/dist/esm/registry/module-manifest.schemas.d.ts +393 -7
  111. package/dist/esm/registry/module-manifest.schemas.d.ts.map +1 -1
  112. package/dist/esm/registry/module-manifest.schemas.js +488 -40
  113. package/dist/esm/registry/module-manifest.schemas.js.map +1 -1
  114. package/dist/esm/registry/module-search.schemas.d.ts +80 -0
  115. package/dist/esm/registry/module-search.schemas.d.ts.map +1 -0
  116. package/dist/esm/registry/module-search.schemas.js +112 -0
  117. package/dist/esm/registry/module-search.schemas.js.map +1 -0
  118. package/dist/esm/registry/registry-config.schemas.d.ts +16 -0
  119. package/dist/esm/registry/registry-config.schemas.d.ts.map +1 -1
  120. package/dist/esm/registry/registry-config.schemas.js +8 -0
  121. package/dist/esm/registry/registry-config.schemas.js.map +1 -1
  122. package/dist/esm/registry/registry-errors.d.ts +126 -2
  123. package/dist/esm/registry/registry-errors.d.ts.map +1 -1
  124. package/dist/esm/registry/registry-errors.js +183 -14
  125. package/dist/esm/registry/registry-errors.js.map +1 -1
  126. package/dist/esm/registry/registry-keys.schemas.d.ts +80 -0
  127. package/dist/esm/registry/registry-keys.schemas.d.ts.map +1 -0
  128. package/dist/esm/registry/registry-keys.schemas.js +68 -0
  129. package/dist/esm/registry/registry-keys.schemas.js.map +1 -0
  130. package/dist/esm/registry/registry-section-schemas.constants.d.ts +25 -3
  131. package/dist/esm/registry/registry-section-schemas.constants.d.ts.map +1 -1
  132. package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts +13 -11
  133. package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts.map +1 -1
  134. package/dist/esm/workspace-scope/workspace-homes.schemas.js +2 -2
  135. package/dist/esm/workspace-scope/workspace-homes.schemas.js.map +1 -1
  136. package/package.json +7 -7
  137. package/dist/esm/registry/companion-api.schemas.js +0 -165
  138. package/dist/tsconfig.build.tsbuildinfo +0 -1
@@ -10,6 +10,50 @@
10
10
  * context (operator instructions, links, retry hints) when they
11
11
  * surface these errors.
12
12
  */
13
+ export var RegistryErrorCode;
14
+ (function (RegistryErrorCode) {
15
+ /** Downloaded bytes do not hash to the digest the registry resolved. */
16
+ RegistryErrorCode["ARTIFACT_INTEGRITY_MISMATCH"] = "WILDO_REGISTRY_ARTIFACT_INTEGRITY_MISMATCH";
17
+ /** No module with that id in the domain. */
18
+ RegistryErrorCode["MODULE_NOT_FOUND"] = "WILDO_REGISTRY_MODULE_NOT_FOUND";
19
+ /** No release satisfies the requested range or tag. */
20
+ RegistryErrorCode["VERSION_NOT_FOUND"] = "WILDO_REGISTRY_VERSION_NOT_FOUND";
21
+ /** The requested release is yanked. */
22
+ RegistryErrorCode["VERSION_YANKED"] = "WILDO_REGISTRY_VERSION_YANKED";
23
+ /** A module requires dependencies the application does not provide. */
24
+ RegistryErrorCode["DEPENDENCY_UNSATISFIED"] = "WILDO_REGISTRY_DEPENDENCY_UNSATISFIED";
25
+ /** A module would write outside its declared boundaries. */
26
+ RegistryErrorCode["BOUNDARY_VIOLATION"] = "WILDO_REGISTRY_BOUNDARY_VIOLATION";
27
+ /** An installed file carries local edits an update would overwrite. */
28
+ RegistryErrorCode["CONFLICT_LOCAL_EDIT"] = "WILDO_REGISTRY_CONFLICT_LOCAL_EDIT";
29
+ /** The request needs a registry key and carried none. */
30
+ RegistryErrorCode["AUTH_REQUIRED"] = "WILDO_REGISTRY_AUTH_REQUIRED";
31
+ /**
32
+ * The request carried a key and the registry refused it: revoked, expired, mistyped, or belonging to a
33
+ * suspended organization. Distinct from `AUTH_REQUIRED` because the remedy differs: that one is "log
34
+ * in", this one is "the key you logged in with no longer works".
35
+ */
36
+ RegistryErrorCode["CREDENTIAL_REJECTED"] = "WILDO_REGISTRY_CREDENTIAL_REJECTED";
37
+ /**
38
+ * The registry refused the request for volume: most often the per-source failed-credential guard every
39
+ * Wildo backend applies (#1759), after repeated rejected keys. Retrying immediately extends it.
40
+ */
41
+ RegistryErrorCode["RATE_LIMITED"] = "WILDO_REGISTRY_RATE_LIMITED";
42
+ /** A yank of a yanked release, or an unyank of a live one (#1758): the release is already in that state. */
43
+ RegistryErrorCode["YANK_STATE_CONFLICT"] = "WILDO_REGISTRY_YANK_STATE_CONFLICT";
44
+ /** The key is valid but not allowed to perform this operation. */
45
+ RegistryErrorCode["AUTH_FORBIDDEN"] = "WILDO_REGISTRY_AUTH_FORBIDDEN";
46
+ /** The modules lockfile is inconsistent in a way `wildo registry repair-lockfile` can fix. */
47
+ RegistryErrorCode["LOCKFILE_REPAIRABLE"] = "WILDO_REGISTRY_LOCKFILE_REPAIRABLE";
48
+ /** The source change succeeded but provider materialization afterwards failed (install, update or remove). */
49
+ RegistryErrorCode["PROVIDER_SYNC_FAILED"] = "WILDO_REGISTRY_PROVIDER_SYNC_FAILED";
50
+ /** The registry answered with an HTTP status the client has no meaning for. */
51
+ RegistryErrorCode["UNEXPECTED_STATUS"] = "WILDO_REGISTRY_UNEXPECTED_STATUS";
52
+ /** A 2xx response carried a payload the contract cannot parse. */
53
+ RegistryErrorCode["MALFORMED_PAYLOAD"] = "WILDO_REGISTRY_MALFORMED_PAYLOAD";
54
+ /** The exchange ran out of time; `RegistryTimeoutPhase` says where (#1763). */
55
+ RegistryErrorCode["REQUEST_TIMEOUT"] = "WILDO_REGISTRY_REQUEST_TIMEOUT";
56
+ })(RegistryErrorCode || (RegistryErrorCode = {}));
13
57
  export class RegistryError extends Error {
14
58
  code;
15
59
  constructor(code, message) {
@@ -30,7 +74,7 @@ export class RegistryArtifactIntegrityMismatchError extends RegistryError {
30
74
  expected;
31
75
  actual;
32
76
  constructor(moduleId, version, expected, actual) {
33
- super('WILDO_REGISTRY_ARTIFACT_INTEGRITY_MISMATCH', `Artifact integrity mismatch for ${moduleId}@${version}: expected ${expected}, got ${actual}.`);
77
+ super(RegistryErrorCode.ARTIFACT_INTEGRITY_MISMATCH, `Artifact integrity mismatch for ${moduleId}@${version}: expected ${expected}, got ${actual}.`);
34
78
  this.moduleId = moduleId;
35
79
  this.version = version;
36
80
  this.expected = expected;
@@ -41,7 +85,7 @@ export class RegistryArtifactIntegrityMismatchError extends RegistryError {
41
85
  export class RegistryModuleNotFoundError extends RegistryError {
42
86
  moduleId;
43
87
  constructor(moduleId) {
44
- super('WILDO_REGISTRY_MODULE_NOT_FOUND', `Module not found: ${moduleId}.`);
88
+ super(RegistryErrorCode.MODULE_NOT_FOUND, `Module not found: ${moduleId}.`);
45
89
  this.moduleId = moduleId;
46
90
  this.name = 'RegistryModuleNotFoundError';
47
91
  }
@@ -50,7 +94,7 @@ export class RegistryVersionNotFoundError extends RegistryError {
50
94
  moduleId;
51
95
  versionRange;
52
96
  constructor(moduleId, versionRange) {
53
- super('WILDO_REGISTRY_VERSION_NOT_FOUND', `No version of ${moduleId} satisfies "${versionRange}".`);
97
+ super(RegistryErrorCode.VERSION_NOT_FOUND, `No version of ${moduleId} satisfies "${versionRange}".`);
54
98
  this.moduleId = moduleId;
55
99
  this.versionRange = versionRange;
56
100
  this.name = 'RegistryVersionNotFoundError';
@@ -60,7 +104,7 @@ export class RegistryVersionYankedError extends RegistryError {
60
104
  moduleId;
61
105
  version;
62
106
  constructor(moduleId, version, reason) {
63
- super('WILDO_REGISTRY_VERSION_YANKED', `Version ${moduleId}@${version} is yanked${reason ? `: ${reason}` : ''}.`);
107
+ super(RegistryErrorCode.VERSION_YANKED, `Version ${moduleId}@${version} is yanked${reason ? `: ${reason}` : ''}.`);
64
108
  this.moduleId = moduleId;
65
109
  this.version = version;
66
110
  this.name = 'RegistryVersionYankedError';
@@ -70,7 +114,7 @@ export class RegistryDependencyUnsatisfiedError extends RegistryError {
70
114
  moduleId;
71
115
  missing;
72
116
  constructor(moduleId, missing) {
73
- super('WILDO_REGISTRY_DEPENDENCY_UNSATISFIED', `Module ${moduleId} requires unmet dependencies: ${missing.join(', ')}.`);
117
+ super(RegistryErrorCode.DEPENDENCY_UNSATISFIED, `Module ${moduleId} requires unmet dependencies: ${missing.join(', ')}.`);
74
118
  this.moduleId = moduleId;
75
119
  this.missing = missing;
76
120
  this.name = 'RegistryDependencyUnsatisfiedError';
@@ -80,7 +124,7 @@ export class RegistryBoundaryViolationError extends RegistryError {
80
124
  moduleId;
81
125
  offendingPath;
82
126
  constructor(moduleId, offendingPath) {
83
- super('WILDO_REGISTRY_BOUNDARY_VIOLATION', `Module ${moduleId} attempts to write outside its declared boundaries: ${offendingPath}.`);
127
+ super(RegistryErrorCode.BOUNDARY_VIOLATION, `Module ${moduleId} attempts to write outside its declared boundaries: ${offendingPath}.`);
84
128
  this.moduleId = moduleId;
85
129
  this.offendingPath = offendingPath;
86
130
  this.name = 'RegistryBoundaryViolationError';
@@ -89,7 +133,7 @@ export class RegistryBoundaryViolationError extends RegistryError {
89
133
  export class RegistryConflictLocalEditError extends RegistryError {
90
134
  filePath;
91
135
  constructor(filePath) {
92
- super('WILDO_REGISTRY_CONFLICT_LOCAL_EDIT', `Local edit detected at ${filePath}; refusing to overwrite without --force.`);
136
+ super(RegistryErrorCode.CONFLICT_LOCAL_EDIT, `Local edit detected at ${filePath}; refusing to overwrite without --force.`);
93
137
  this.filePath = filePath;
94
138
  this.name = 'RegistryConflictLocalEditError';
95
139
  }
@@ -97,15 +141,90 @@ export class RegistryConflictLocalEditError extends RegistryError {
97
141
  export class RegistryAuthRequiredError extends RegistryError {
98
142
  registryUrl;
99
143
  constructor(registryUrl) {
100
- super('WILDO_REGISTRY_AUTH_REQUIRED', `Authentication required for ${registryUrl}. Run \`wildo registry login --url <url>\`.`);
144
+ super(RegistryErrorCode.AUTH_REQUIRED, `Authentication required for ${registryUrl}. Run \`wildo registry login --registry ${registryUrl}\`.`);
101
145
  this.registryUrl = registryUrl;
102
146
  this.name = 'RegistryAuthRequiredError';
103
147
  }
104
148
  }
149
+ export class RegistryCredentialRejectedError extends RegistryError {
150
+ registryUrl;
151
+ constructor(registryUrl) {
152
+ super(RegistryErrorCode.CREDENTIAL_REJECTED, `The registry at ${registryUrl} rejected the stored key (revoked, expired or not recognised). ` +
153
+ `Run \`wildo registry login --registry ${registryUrl}\` with a current key.`);
154
+ this.registryUrl = registryUrl;
155
+ this.name = 'RegistryCredentialRejectedError';
156
+ }
157
+ }
158
+ export class RegistryRateLimitedError extends RegistryError {
159
+ registryUrl;
160
+ action;
161
+ retryAfterSeconds;
162
+ constructor(registryUrl, action,
163
+ /** From `Retry-After`, when the registry sent one in seconds. */
164
+ retryAfterSeconds) {
165
+ super(RegistryErrorCode.RATE_LIMITED, `Registry "${action}" was rate-limited at ${registryUrl}` +
166
+ (retryAfterSeconds !== undefined ? `; retry in ${retryAfterSeconds}s.` : '; wait before retrying.') +
167
+ ' Repeated rejected keys from one source trigger this; check the key before retrying.');
168
+ this.registryUrl = registryUrl;
169
+ this.action = action;
170
+ this.retryAfterSeconds = retryAfterSeconds;
171
+ this.name = 'RegistryRateLimitedError';
172
+ }
173
+ }
174
+ /** The two release-state verbs (#1758); the value is also the route segment. */
175
+ export var RegistryYankVerb;
176
+ (function (RegistryYankVerb) {
177
+ RegistryYankVerb["YANK"] = "yank";
178
+ RegistryYankVerb["UNYANK"] = "unyank";
179
+ })(RegistryYankVerb || (RegistryYankVerb = {}));
180
+ /**
181
+ * The registry refused a yank or unyank because the release is already in the requested state (409).
182
+ * Typed so a caller can report it as the no-op it is rather than a failure of the registry.
183
+ */
184
+ export class RegistryYankStateConflictError extends RegistryError {
185
+ moduleId;
186
+ version;
187
+ verb;
188
+ constructor(moduleId, version, verb) {
189
+ super(RegistryErrorCode.YANK_STATE_CONFLICT, verb === RegistryYankVerb.YANK ? `${moduleId}@${version} is already yanked.` : `${moduleId}@${version} is not yanked.`);
190
+ this.moduleId = moduleId;
191
+ this.version = version;
192
+ this.verb = verb;
193
+ this.name = 'RegistryYankStateConflictError';
194
+ }
195
+ }
196
+ /**
197
+ * Stable, client-branchable codes the registry server puts on a refusal, carried on the wire as
198
+ * `error.details.code` (the engine's documented channel for a switch-on-code refusal: `code` is the one
199
+ * context key its client sanitizer admits for that purpose). Server and client both import this enum, so
200
+ * the value has one source.
201
+ */
202
+ export var RegistryRefusalCode;
203
+ (function (RegistryRefusalCode) {
204
+ /**
205
+ * A yank of a yanked release, or an unyank of a live one: the release is ALREADY in the requested
206
+ * state, so the request is a no-op a caller may report as done.
207
+ */
208
+ RegistryRefusalCode["RELEASE_STATE"] = "registry_release_state";
209
+ })(RegistryRefusalCode || (RegistryRefusalCode = {}));
210
+ /**
211
+ * Whether a 409 body from a yank/unyank route is the release-state refusal rather than any other conflict
212
+ * (#1758 re-review R3).
213
+ *
214
+ * Both routes answer 409 for two different things: the release is already in the requested state, or the
215
+ * registry gave up re-deciding after repeated lost optimistic checks (`version_conflict`). Only the first
216
+ * is a no-op; reading every 409 as one told an operator yanking a compromised release that it was already
217
+ * yanked. It keys on the registry's OWN code rather than the engine's generic `conflict` reference, which
218
+ * about twenty other refusals share, so a future conflict on these routes cannot be mistaken for it.
219
+ */
220
+ export function isRegistryReleaseStateConflictBody(body) {
221
+ const error = body?.error;
222
+ return error?.details?.code === RegistryRefusalCode.RELEASE_STATE;
223
+ }
105
224
  export class RegistryAuthForbiddenError extends RegistryError {
106
225
  action;
107
226
  constructor(action) {
108
- super('WILDO_REGISTRY_AUTH_FORBIDDEN', `Action "${action}" is not permitted by the current credentials.`);
227
+ super(RegistryErrorCode.AUTH_FORBIDDEN, `Action "${action}" is not permitted by the current credentials.`);
109
228
  this.action = action;
110
229
  this.name = 'RegistryAuthForbiddenError';
111
230
  }
@@ -113,7 +232,7 @@ export class RegistryAuthForbiddenError extends RegistryError {
113
232
  export class RegistryLockfileRepairableError extends RegistryError {
114
233
  hints;
115
234
  constructor(message, hints = []) {
116
- super('WILDO_REGISTRY_LOCKFILE_REPAIRABLE', message);
235
+ super(RegistryErrorCode.LOCKFILE_REPAIRABLE, message);
117
236
  this.hints = hints;
118
237
  this.name = 'RegistryLockfileRepairableError';
119
238
  }
@@ -130,7 +249,7 @@ export class RegistryProviderSyncFailedError extends RegistryError {
130
249
  failureKind;
131
250
  stderrTail;
132
251
  constructor(message, failureKind, stderrTail) {
133
- super('WILDO_REGISTRY_PROVIDER_SYNC_FAILED', message);
252
+ super(RegistryErrorCode.PROVIDER_SYNC_FAILED, message);
134
253
  this.failureKind = failureKind;
135
254
  this.stderrTail = stderrTail;
136
255
  this.name = 'RegistryProviderSyncFailedError';
@@ -151,7 +270,7 @@ export class RegistryUnexpectedStatusError extends RegistryError {
151
270
  statusText;
152
271
  action;
153
272
  constructor(registryUrl, status, statusText, action) {
154
- super('WILDO_REGISTRY_UNEXPECTED_STATUS', `Registry "${action}" failed with HTTP ${status} ${statusText} at ${registryUrl}.`);
273
+ super(RegistryErrorCode.UNEXPECTED_STATUS, `Registry "${action}" failed with HTTP ${status} ${statusText} at ${registryUrl}.`);
155
274
  this.registryUrl = registryUrl;
156
275
  this.status = status;
157
276
  this.statusText = statusText;
@@ -160,7 +279,7 @@ export class RegistryUnexpectedStatusError extends RegistryError {
160
279
  }
161
280
  }
162
281
  /**
163
- * Raised by `RegistryServerClient` (and `RegistryCompanionClient`) when
282
+ * Raised by `RegistryServerClient` when
164
283
  * a 2xx response carries a payload the canonical Zod schema can't parse.
165
284
  * Without this, malformed payloads previously surfaced as bare `Error`
166
285
  * (`'Registry resolve returned a malformed payload at ...'`), which
@@ -172,13 +291,63 @@ export class RegistryMalformedPayloadError extends RegistryError {
172
291
  action;
173
292
  detail;
174
293
  constructor(registryUrl, action, detail) {
175
- super('WILDO_REGISTRY_MALFORMED_PAYLOAD', `Registry "${action}" returned a malformed payload at ${registryUrl}: ${detail}`);
294
+ super(RegistryErrorCode.MALFORMED_PAYLOAD, `Registry "${action}" returned a malformed payload at ${registryUrl}: ${detail}`);
176
295
  this.registryUrl = registryUrl;
177
296
  this.action = action;
178
297
  this.detail = detail;
179
298
  this.name = 'RegistryMalformedPayloadError';
180
299
  }
181
300
  }
301
+ /**
302
+ * Where a registry exchange ran out of time (#1763). The two call for different remedies: no response
303
+ * at all points at the registry or the network path; a transfer that STALLED part-way is a slow link,
304
+ * and is measured as silence between chunks rather than as the size of the artifact.
305
+ */
306
+ export var RegistryTimeoutPhase;
307
+ (function (RegistryTimeoutPhase) {
308
+ /** No response (status + headers) arrived within the request budget. */
309
+ RegistryTimeoutPhase["AWAITING_RESPONSE"] = "awaiting_response";
310
+ /** The response started, then no bytes arrived for the idle budget. */
311
+ RegistryTimeoutPhase["TRANSFER_STALLED"] = "transfer_stalled";
312
+ /**
313
+ * The response (status + headers) arrived, but a small metadata body did not finish within the same
314
+ * request budget. Not `TRANSFER_STALLED`: a metadata body has no idle budget, only the request's.
315
+ */
316
+ RegistryTimeoutPhase["READING_BODY"] = "reading_body";
317
+ })(RegistryTimeoutPhase || (RegistryTimeoutPhase = {}));
318
+ function describeTimeout(phase, action, registryUrl, timeoutMs) {
319
+ switch (phase) {
320
+ case RegistryTimeoutPhase.AWAITING_RESPONSE:
321
+ return `Registry "${action}" got no response within ${timeoutMs}ms at ${registryUrl}.`;
322
+ case RegistryTimeoutPhase.TRANSFER_STALLED:
323
+ return `Registry "${action}" stalled: no data for ${timeoutMs}ms at ${registryUrl}.`;
324
+ case RegistryTimeoutPhase.READING_BODY:
325
+ return `Registry "${action}" answered but its response did not finish within ${timeoutMs}ms at ${registryUrl}.`;
326
+ }
327
+ }
328
+ /**
329
+ * A registry request that timed out, in the typed vocabulary, so `isRegistryError(err)` handlers see it.
330
+ * Before #1763 a timeout escaped as a bare `Error` (before the response) or a raw `AbortError` (during
331
+ * the body), and a JSON body cut short was reported as a MALFORMED payload.
332
+ */
333
+ export class RegistryRequestTimeoutError extends RegistryError {
334
+ registryUrl;
335
+ action;
336
+ phase;
337
+ timeoutMs;
338
+ constructor(registryUrl, action, phase, timeoutMs) {
339
+ super(RegistryErrorCode.REQUEST_TIMEOUT, describeTimeout(phase, action, registryUrl, timeoutMs));
340
+ this.registryUrl = registryUrl;
341
+ this.action = action;
342
+ this.phase = phase;
343
+ this.timeoutMs = timeoutMs;
344
+ this.name = 'RegistryRequestTimeoutError';
345
+ }
346
+ }
347
+ /** True for the error a fetch (or a body read) raises when its abort signal fires. */
348
+ export function isAbortLikeError(err) {
349
+ return err instanceof Error && (err.name === 'AbortError' || err.name === 'TimeoutError');
350
+ }
182
351
  export function isRegistryError(value) {
183
352
  return value instanceof RegistryError;
184
353
  }
@@ -1 +1 @@
1
- {"version":3,"file":"registry-errors.js","sourceRoot":"","sources":["../../../../src/registry/registry-errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAiBH,MAAM,OAAO,aAAc,SAAQ,KAAK;IAC7B,IAAI,CAAoB;IAEjC,YAAY,IAAuB,EAAE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AAU,GAAV,UAAU,CAAQ;QAClB,WAAM,GAAN,MAAM,CAAQ;QAM9B,IAAI,CAAC,IAAI,GAAG,+BAA+B,CAAC;IAC9C,CAAC;CACF;AAED;;;;;;;GAOG;AACH,MAAM,OAAO,6BAA8B,SAAQ,aAAa;IAE5C;IACA;IACA;IAHlB,YACkB,WAAmB,EACnB,MAAc,EACd,MAAc;QAE9B,KAAK,CACH,kCAAkC,EAClC,aAAa,MAAM,qCAAqC,WAAW,KAAK,MAAM,EAAE,CACjF,CAAC;QAPc,gBAAW,GAAX,WAAW,CAAQ;QACnB,WAAM,GAAN,MAAM,CAAQ;QACd,WAAM,GAAN,MAAM,CAAQ;QAM9B,IAAI,CAAC,IAAI,GAAG,+BAA+B,CAAC;IAC9C,CAAC;CACF;AAED,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,OAAO,KAAK,YAAY,aAAa,CAAC;AACxC,CAAC","sourcesContent":["/**\n * Registry-typed error classes.\n *\n * Phase 1 ships the typed-error vocabulary that Phase 2+ services\n * raise. Each error carries a stable `code` so CLI callers can\n * map errors to UX-specific copy without parsing messages.\n *\n * Errors are intentionally minimal — they encode discriminators,\n * not full diagnostic envelopes. UX layers attach their own\n * context (operator instructions, links, retry hints) when they\n * surface these errors.\n */\n\nexport type RegistryErrorCode =\n | 'WILDO_REGISTRY_ARTIFACT_INTEGRITY_MISMATCH'\n | 'WILDO_REGISTRY_MODULE_NOT_FOUND'\n | 'WILDO_REGISTRY_VERSION_NOT_FOUND'\n | 'WILDO_REGISTRY_VERSION_YANKED'\n | 'WILDO_REGISTRY_DEPENDENCY_UNSATISFIED'\n | 'WILDO_REGISTRY_BOUNDARY_VIOLATION'\n | 'WILDO_REGISTRY_CONFLICT_LOCAL_EDIT'\n | 'WILDO_REGISTRY_AUTH_REQUIRED'\n | 'WILDO_REGISTRY_AUTH_FORBIDDEN'\n | 'WILDO_REGISTRY_LOCKFILE_REPAIRABLE'\n | 'WILDO_REGISTRY_PROVIDER_SYNC_FAILED'\n | 'WILDO_REGISTRY_UNEXPECTED_STATUS'\n | 'WILDO_REGISTRY_MALFORMED_PAYLOAD';\n\nexport class RegistryError extends Error {\n readonly code: RegistryErrorCode;\n\n constructor(code: RegistryErrorCode, message: string) {\n super(message);\n // L13 (third-pass review): set `name = 'RegistryError'` defensively.\n // Subclasses still overwrite it in their constructors, but a future\n // subclass that forgets to set `name` would leave the default\n // `'Error'` in stack traces — misleading. With this base default,\n // even an undeclared subclass surfaces as a `RegistryError` in\n // logs.\n this.name = 'RegistryError';\n this.code = code;\n }\n}\n\nexport class RegistryArtifactIntegrityMismatchError extends RegistryError {\n constructor(\n public readonly moduleId: string,\n public readonly version: string,\n public readonly expected: string,\n public readonly actual: string,\n ) {\n super(\n 'WILDO_REGISTRY_ARTIFACT_INTEGRITY_MISMATCH',\n `Artifact integrity mismatch for ${moduleId}@${version}: expected ${expected}, got ${actual}.`,\n );\n this.name = 'RegistryArtifactIntegrityMismatchError';\n }\n}\n\nexport class RegistryModuleNotFoundError extends RegistryError {\n constructor(public readonly moduleId: string) {\n super(\n 'WILDO_REGISTRY_MODULE_NOT_FOUND',\n `Module not found: ${moduleId}.`,\n );\n this.name = 'RegistryModuleNotFoundError';\n }\n}\n\nexport class RegistryVersionNotFoundError extends RegistryError {\n constructor(public readonly moduleId: string, public readonly versionRange: string) {\n super(\n 'WILDO_REGISTRY_VERSION_NOT_FOUND',\n `No version of ${moduleId} satisfies \"${versionRange}\".`,\n );\n this.name = 'RegistryVersionNotFoundError';\n }\n}\n\nexport class RegistryVersionYankedError extends RegistryError {\n constructor(public readonly moduleId: string, public readonly version: string, reason?: string) {\n super(\n 'WILDO_REGISTRY_VERSION_YANKED',\n `Version ${moduleId}@${version} is yanked${reason ? `: ${reason}` : ''}.`,\n );\n this.name = 'RegistryVersionYankedError';\n }\n}\n\nexport class RegistryDependencyUnsatisfiedError extends RegistryError {\n constructor(public readonly moduleId: string, public readonly missing: readonly string[]) {\n super(\n 'WILDO_REGISTRY_DEPENDENCY_UNSATISFIED',\n `Module ${moduleId} requires unmet dependencies: ${missing.join(', ')}.`,\n );\n this.name = 'RegistryDependencyUnsatisfiedError';\n }\n}\n\nexport class RegistryBoundaryViolationError extends RegistryError {\n constructor(public readonly moduleId: string, public readonly offendingPath: string) {\n super(\n 'WILDO_REGISTRY_BOUNDARY_VIOLATION',\n `Module ${moduleId} attempts to write outside its declared boundaries: ${offendingPath}.`,\n );\n this.name = 'RegistryBoundaryViolationError';\n }\n}\n\nexport class RegistryConflictLocalEditError extends RegistryError {\n constructor(public readonly filePath: string) {\n super(\n 'WILDO_REGISTRY_CONFLICT_LOCAL_EDIT',\n `Local edit detected at ${filePath}; refusing to overwrite without --force.`,\n );\n this.name = 'RegistryConflictLocalEditError';\n }\n}\n\nexport class RegistryAuthRequiredError extends RegistryError {\n constructor(public readonly registryUrl: string) {\n super(\n 'WILDO_REGISTRY_AUTH_REQUIRED',\n `Authentication required for ${registryUrl}. Run \\`wildo registry login --url <url>\\`.`,\n );\n this.name = 'RegistryAuthRequiredError';\n }\n}\n\nexport class RegistryAuthForbiddenError extends RegistryError {\n constructor(public readonly action: string) {\n super(\n 'WILDO_REGISTRY_AUTH_FORBIDDEN',\n `Action \"${action}\" is not permitted by the current credentials.`,\n );\n this.name = 'RegistryAuthForbiddenError';\n }\n}\n\nexport class RegistryLockfileRepairableError extends RegistryError {\n constructor(message: string, public readonly hints: readonly string[] = []) {\n super('WILDO_REGISTRY_LOCKFILE_REPAIRABLE', message);\n this.name = 'RegistryLockfileRepairableError';\n }\n}\n\n/**\n * Raised when post-install / post-update / post-remove provider\n * materialization fails after the source mutation succeeded. The\n * companion-export discovery and `runtimeImport` reachability\n * failure modes are both surfaced via this error so module-registry\n * callers report them as first-class repairable integration errors\n * (`module-registry-analysis.md` / Provider Migration WIP Seams §1).\n */\nexport class RegistryProviderSyncFailedError extends RegistryError {\n constructor(\n message: string,\n public readonly failureKind: 'companion-discovery' | 'runtime-import-reachability' | 'invalid-scope' | 'timeout' | 'unknown',\n public readonly stderrTail?: string,\n ) {\n super('WILDO_REGISTRY_PROVIDER_SYNC_FAILED', message);\n this.name = 'RegistryProviderSyncFailedError';\n }\n}\n\n/**\n * Raised by `RegistryServerClient` when the server returns a non-2xx\n * status that doesn't map to a more specific typed error (404 →\n * `RegistryModuleNotFoundError`/`RegistryVersionNotFoundError`, 401 →\n * `RegistryAuthRequiredError`, 403 → `RegistryAuthForbiddenError`).\n * Carries the status code + URL so callers can discriminate \"registry\n * down / 5xx\" from authoritative client errors without re-parsing\n * `Error.message` strings.\n */\nexport class RegistryUnexpectedStatusError extends RegistryError {\n constructor(\n public readonly registryUrl: string,\n public readonly status: number,\n public readonly statusText: string,\n public readonly action: string,\n ) {\n super(\n 'WILDO_REGISTRY_UNEXPECTED_STATUS',\n `Registry \"${action}\" failed with HTTP ${status} ${statusText} at ${registryUrl}.`,\n );\n this.name = 'RegistryUnexpectedStatusError';\n }\n}\n\n/**\n * Raised by `RegistryServerClient` (and `RegistryCompanionClient`) when\n * a 2xx response carries a payload the canonical Zod schema can't parse.\n * Without this, malformed payloads previously surfaced as bare `Error`\n * (`'Registry resolve returned a malformed payload at ...'`), which\n * broke the `isRegistryError(err)` typed-handler contract every other\n * client surface honored.\n */\nexport class RegistryMalformedPayloadError extends RegistryError {\n constructor(\n public readonly registryUrl: string,\n public readonly action: string,\n public readonly detail: string,\n ) {\n super(\n 'WILDO_REGISTRY_MALFORMED_PAYLOAD',\n `Registry \"${action}\" returned a malformed payload at ${registryUrl}: ${detail}`,\n );\n this.name = 'RegistryMalformedPayloadError';\n }\n}\n\nexport function isRegistryError(value: unknown): value is RegistryError {\n return value instanceof RegistryError;\n}\n"]}
1
+ {"version":3,"file":"registry-errors.js","sourceRoot":"","sources":["../../../../src/registry/registry-errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,CAAN,IAAY,iBA0CX;AA1CD,WAAY,iBAAiB;IAC3B,wEAAwE;IACxE,+FAA0E,C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AAS,SAAS,WAAW,GAAG,CAAC;IACpH,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAO,2BAA4B,SAAQ,aAAa;IAE1C;IACA;IACA;IACA;IAJlB,YACkB,WAAmB,EACnB,MAAc,EACd,KAA2B,EAC3B,SAAiB;QAEjC,KAAK,CACH,iBAAiB,CAAC,eAAe,EACjC,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,CAAC,CACvD,CAAC;QARc,gBAAW,GAAX,WAAW,CAAQ;QACnB,WAAM,GAAN,MAAM,CAAQ;QACd,UAAK,GAAL,KAAK,CAAsB;QAC3B,cAAS,GAAT,SAAS,CAAQ;QAMjC,IAAI,CAAC,IAAI,GAAG,6BAA6B,CAAC;IAC5C,CAAC;CACF;AAED,sFAAsF;AACtF,MAAM,UAAU,gBAAgB,CAAC,GAAY;IAC3C,OAAO,GAAG,YAAY,KAAK,IAAI,CAAC,GAAG,CAAC,IAAI,KAAK,YAAY,IAAI,GAAG,CAAC,IAAI,KAAK,cAAc,CAAC,CAAC;AAC5F,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,OAAO,KAAK,YAAY,aAAa,CAAC;AACxC,CAAC","sourcesContent":["/**\n * Registry-typed error classes.\n *\n * Phase 1 ships the typed-error vocabulary that Phase 2+ services\n * raise. Each error carries a stable `code` so CLI callers can\n * map errors to UX-specific copy without parsing messages.\n *\n * Errors are intentionally minimal — they encode discriminators,\n * not full diagnostic envelopes. UX layers attach their own\n * context (operator instructions, links, retry hints) when they\n * surface these errors.\n */\n\nexport enum RegistryErrorCode {\n /** Downloaded bytes do not hash to the digest the registry resolved. */\n ARTIFACT_INTEGRITY_MISMATCH = 'WILDO_REGISTRY_ARTIFACT_INTEGRITY_MISMATCH',\n /** No module with that id in the domain. */\n MODULE_NOT_FOUND = 'WILDO_REGISTRY_MODULE_NOT_FOUND',\n /** No release satisfies the requested range or tag. */\n VERSION_NOT_FOUND = 'WILDO_REGISTRY_VERSION_NOT_FOUND',\n /** The requested release is yanked. */\n VERSION_YANKED = 'WILDO_REGISTRY_VERSION_YANKED',\n /** A module requires dependencies the application does not provide. */\n DEPENDENCY_UNSATISFIED = 'WILDO_REGISTRY_DEPENDENCY_UNSATISFIED',\n /** A module would write outside its declared boundaries. */\n BOUNDARY_VIOLATION = 'WILDO_REGISTRY_BOUNDARY_VIOLATION',\n /** An installed file carries local edits an update would overwrite. */\n CONFLICT_LOCAL_EDIT = 'WILDO_REGISTRY_CONFLICT_LOCAL_EDIT',\n /** The request needs a registry key and carried none. */\n AUTH_REQUIRED = 'WILDO_REGISTRY_AUTH_REQUIRED',\n /**\n * The request carried a key and the registry refused it: revoked, expired, mistyped, or belonging to a\n * suspended organization. Distinct from `AUTH_REQUIRED` because the remedy differs: that one is \"log\n * in\", this one is \"the key you logged in with no longer works\".\n */\n CREDENTIAL_REJECTED = 'WILDO_REGISTRY_CREDENTIAL_REJECTED',\n /**\n * The registry refused the request for volume: most often the per-source failed-credential guard every\n * Wildo backend applies (#1759), after repeated rejected keys. Retrying immediately extends it.\n */\n RATE_LIMITED = 'WILDO_REGISTRY_RATE_LIMITED',\n /** A yank of a yanked release, or an unyank of a live one (#1758): the release is already in that state. */\n YANK_STATE_CONFLICT = 'WILDO_REGISTRY_YANK_STATE_CONFLICT',\n /** The key is valid but not allowed to perform this operation. */\n AUTH_FORBIDDEN = 'WILDO_REGISTRY_AUTH_FORBIDDEN',\n /** The modules lockfile is inconsistent in a way `wildo registry repair-lockfile` can fix. */\n LOCKFILE_REPAIRABLE = 'WILDO_REGISTRY_LOCKFILE_REPAIRABLE',\n /** The source change succeeded but provider materialization afterwards failed (install, update or remove). */\n PROVIDER_SYNC_FAILED = 'WILDO_REGISTRY_PROVIDER_SYNC_FAILED',\n /** The registry answered with an HTTP status the client has no meaning for. */\n UNEXPECTED_STATUS = 'WILDO_REGISTRY_UNEXPECTED_STATUS',\n /** A 2xx response carried a payload the contract cannot parse. */\n MALFORMED_PAYLOAD = 'WILDO_REGISTRY_MALFORMED_PAYLOAD',\n /** The exchange ran out of time; `RegistryTimeoutPhase` says where (#1763). */\n REQUEST_TIMEOUT = 'WILDO_REGISTRY_REQUEST_TIMEOUT',\n}\n\nexport class RegistryError extends Error {\n readonly code: RegistryErrorCode;\n\n constructor(code: RegistryErrorCode, message: string) {\n super(message);\n // L13 (third-pass review): set `name = 'RegistryError'` defensively.\n // Subclasses still overwrite it in their constructors, but a future\n // subclass that forgets to set `name` would leave the default\n // `'Error'` in stack traces — misleading. With this base default,\n // even an undeclared subclass surfaces as a `RegistryError` in\n // logs.\n this.name = 'RegistryError';\n this.code = code;\n }\n}\n\nexport class RegistryArtifactIntegrityMismatchError extends RegistryError {\n constructor(\n public readonly moduleId: string,\n public readonly version: string,\n public readonly expected: string,\n public readonly actual: string,\n ) {\n super(\n RegistryErrorCode.ARTIFACT_INTEGRITY_MISMATCH,\n `Artifact integrity mismatch for ${moduleId}@${version}: expected ${expected}, got ${actual}.`,\n );\n this.name = 'RegistryArtifactIntegrityMismatchError';\n }\n}\n\nexport class RegistryModuleNotFoundError extends RegistryError {\n constructor(public readonly moduleId: string) {\n super(\n RegistryErrorCode.MODULE_NOT_FOUND,\n `Module not found: ${moduleId}.`,\n );\n this.name = 'RegistryModuleNotFoundError';\n }\n}\n\nexport class RegistryVersionNotFoundError extends RegistryError {\n constructor(public readonly moduleId: string, public readonly versionRange: string) {\n super(\n RegistryErrorCode.VERSION_NOT_FOUND,\n `No version of ${moduleId} satisfies \"${versionRange}\".`,\n );\n this.name = 'RegistryVersionNotFoundError';\n }\n}\n\nexport class RegistryVersionYankedError extends RegistryError {\n constructor(public readonly moduleId: string, public readonly version: string, reason?: string) {\n super(\n RegistryErrorCode.VERSION_YANKED,\n `Version ${moduleId}@${version} is yanked${reason ? `: ${reason}` : ''}.`,\n );\n this.name = 'RegistryVersionYankedError';\n }\n}\n\nexport class RegistryDependencyUnsatisfiedError extends RegistryError {\n constructor(public readonly moduleId: string, public readonly missing: readonly string[]) {\n super(\n RegistryErrorCode.DEPENDENCY_UNSATISFIED,\n `Module ${moduleId} requires unmet dependencies: ${missing.join(', ')}.`,\n );\n this.name = 'RegistryDependencyUnsatisfiedError';\n }\n}\n\nexport class RegistryBoundaryViolationError extends RegistryError {\n constructor(public readonly moduleId: string, public readonly offendingPath: string) {\n super(\n RegistryErrorCode.BOUNDARY_VIOLATION,\n `Module ${moduleId} attempts to write outside its declared boundaries: ${offendingPath}.`,\n );\n this.name = 'RegistryBoundaryViolationError';\n }\n}\n\nexport class RegistryConflictLocalEditError extends RegistryError {\n constructor(public readonly filePath: string) {\n super(\n RegistryErrorCode.CONFLICT_LOCAL_EDIT,\n `Local edit detected at ${filePath}; refusing to overwrite without --force.`,\n );\n this.name = 'RegistryConflictLocalEditError';\n }\n}\n\nexport class RegistryAuthRequiredError extends RegistryError {\n constructor(public readonly registryUrl: string) {\n super(\n RegistryErrorCode.AUTH_REQUIRED,\n `Authentication required for ${registryUrl}. Run \\`wildo registry login --registry ${registryUrl}\\`.`,\n );\n this.name = 'RegistryAuthRequiredError';\n }\n}\n\nexport class RegistryCredentialRejectedError extends RegistryError {\n constructor(public readonly registryUrl: string) {\n super(\n RegistryErrorCode.CREDENTIAL_REJECTED,\n `The registry at ${registryUrl} rejected the stored key (revoked, expired or not recognised). ` +\n `Run \\`wildo registry login --registry ${registryUrl}\\` with a current key.`,\n );\n this.name = 'RegistryCredentialRejectedError';\n }\n}\n\nexport class RegistryRateLimitedError extends RegistryError {\n constructor(\n public readonly registryUrl: string,\n public readonly action: string,\n /** From `Retry-After`, when the registry sent one in seconds. */\n public readonly retryAfterSeconds: number | undefined,\n ) {\n super(\n RegistryErrorCode.RATE_LIMITED,\n `Registry \"${action}\" was rate-limited at ${registryUrl}` +\n (retryAfterSeconds !== undefined ? `; retry in ${retryAfterSeconds}s.` : '; wait before retrying.') +\n ' Repeated rejected keys from one source trigger this; check the key before retrying.',\n );\n this.name = 'RegistryRateLimitedError';\n }\n}\n\n/** The two release-state verbs (#1758); the value is also the route segment. */\nexport enum RegistryYankVerb {\n YANK = 'yank',\n UNYANK = 'unyank',\n}\n\n/**\n * The registry refused a yank or unyank because the release is already in the requested state (409).\n * Typed so a caller can report it as the no-op it is rather than a failure of the registry.\n */\nexport class RegistryYankStateConflictError extends RegistryError {\n constructor(\n public readonly moduleId: string,\n public readonly version: string,\n public readonly verb: RegistryYankVerb,\n ) {\n super(\n RegistryErrorCode.YANK_STATE_CONFLICT,\n verb === RegistryYankVerb.YANK ? `${moduleId}@${version} is already yanked.` : `${moduleId}@${version} is not yanked.`,\n );\n this.name = 'RegistryYankStateConflictError';\n }\n}\n\n/**\n * Stable, client-branchable codes the registry server puts on a refusal, carried on the wire as\n * `error.details.code` (the engine's documented channel for a switch-on-code refusal: `code` is the one\n * context key its client sanitizer admits for that purpose). Server and client both import this enum, so\n * the value has one source.\n */\nexport enum RegistryRefusalCode {\n /**\n * A yank of a yanked release, or an unyank of a live one: the release is ALREADY in the requested\n * state, so the request is a no-op a caller may report as done.\n */\n RELEASE_STATE = 'registry_release_state',\n}\n\n/**\n * Whether a 409 body from a yank/unyank route is the release-state refusal rather than any other conflict\n * (#1758 re-review R3).\n *\n * Both routes answer 409 for two different things: the release is already in the requested state, or the\n * registry gave up re-deciding after repeated lost optimistic checks (`version_conflict`). Only the first\n * is a no-op; reading every 409 as one told an operator yanking a compromised release that it was already\n * yanked. It keys on the registry's OWN code rather than the engine's generic `conflict` reference, which\n * about twenty other refusals share, so a future conflict on these routes cannot be mistaken for it.\n */\nexport function isRegistryReleaseStateConflictBody(body: unknown): boolean {\n const error = (body as { error?: { details?: { code?: unknown } } } | null | undefined)?.error;\n return error?.details?.code === RegistryRefusalCode.RELEASE_STATE;\n}\n\nexport class RegistryAuthForbiddenError extends RegistryError {\n constructor(public readonly action: string) {\n super(\n RegistryErrorCode.AUTH_FORBIDDEN,\n `Action \"${action}\" is not permitted by the current credentials.`,\n );\n this.name = 'RegistryAuthForbiddenError';\n }\n}\n\nexport class RegistryLockfileRepairableError extends RegistryError {\n constructor(message: string, public readonly hints: readonly string[] = []) {\n super(RegistryErrorCode.LOCKFILE_REPAIRABLE, message);\n this.name = 'RegistryLockfileRepairableError';\n }\n}\n\n/**\n * Raised when post-install / post-update / post-remove provider\n * materialization fails after the source mutation succeeded. The\n * companion-export discovery and `runtimeImport` reachability\n * failure modes are both surfaced via this error so module-registry\n * callers report them as first-class repairable integration errors\n * (`module-registry-analysis.md` / Provider Migration WIP Seams §1).\n */\nexport class RegistryProviderSyncFailedError extends RegistryError {\n constructor(\n message: string,\n public readonly failureKind: 'companion-discovery' | 'runtime-import-reachability' | 'invalid-scope' | 'timeout' | 'unknown',\n public readonly stderrTail?: string,\n ) {\n super(RegistryErrorCode.PROVIDER_SYNC_FAILED, message);\n this.name = 'RegistryProviderSyncFailedError';\n }\n}\n\n/**\n * Raised by `RegistryServerClient` when the server returns a non-2xx\n * status that doesn't map to a more specific typed error (404 →\n * `RegistryModuleNotFoundError`/`RegistryVersionNotFoundError`, 401 →\n * `RegistryAuthRequiredError`, 403 → `RegistryAuthForbiddenError`).\n * Carries the status code + URL so callers can discriminate \"registry\n * down / 5xx\" from authoritative client errors without re-parsing\n * `Error.message` strings.\n */\nexport class RegistryUnexpectedStatusError extends RegistryError {\n constructor(\n public readonly registryUrl: string,\n public readonly status: number,\n public readonly statusText: string,\n public readonly action: string,\n ) {\n super(\n RegistryErrorCode.UNEXPECTED_STATUS,\n `Registry \"${action}\" failed with HTTP ${status} ${statusText} at ${registryUrl}.`,\n );\n this.name = 'RegistryUnexpectedStatusError';\n }\n}\n\n/**\n * Raised by `RegistryServerClient` when\n * a 2xx response carries a payload the canonical Zod schema can't parse.\n * Without this, malformed payloads previously surfaced as bare `Error`\n * (`'Registry resolve returned a malformed payload at ...'`), which\n * broke the `isRegistryError(err)` typed-handler contract every other\n * client surface honored.\n */\nexport class RegistryMalformedPayloadError extends RegistryError {\n constructor(\n public readonly registryUrl: string,\n public readonly action: string,\n public readonly detail: string,\n ) {\n super(\n RegistryErrorCode.MALFORMED_PAYLOAD,\n `Registry \"${action}\" returned a malformed payload at ${registryUrl}: ${detail}`,\n );\n this.name = 'RegistryMalformedPayloadError';\n }\n}\n\n/**\n * Where a registry exchange ran out of time (#1763). The two call for different remedies: no response\n * at all points at the registry or the network path; a transfer that STALLED part-way is a slow link,\n * and is measured as silence between chunks rather than as the size of the artifact.\n */\nexport enum RegistryTimeoutPhase {\n /** No response (status + headers) arrived within the request budget. */\n AWAITING_RESPONSE = 'awaiting_response',\n /** The response started, then no bytes arrived for the idle budget. */\n TRANSFER_STALLED = 'transfer_stalled',\n /**\n * The response (status + headers) arrived, but a small metadata body did not finish within the same\n * request budget. Not `TRANSFER_STALLED`: a metadata body has no idle budget, only the request's.\n */\n READING_BODY = 'reading_body',\n}\n\nfunction describeTimeout(phase: RegistryTimeoutPhase, action: string, registryUrl: string, timeoutMs: number): string {\n switch (phase) {\n case RegistryTimeoutPhase.AWAITING_RESPONSE:\n return `Registry \"${action}\" got no response within ${timeoutMs}ms at ${registryUrl}.`;\n case RegistryTimeoutPhase.TRANSFER_STALLED:\n return `Registry \"${action}\" stalled: no data for ${timeoutMs}ms at ${registryUrl}.`;\n case RegistryTimeoutPhase.READING_BODY:\n return `Registry \"${action}\" answered but its response did not finish within ${timeoutMs}ms at ${registryUrl}.`;\n }\n}\n\n/**\n * A registry request that timed out, in the typed vocabulary, so `isRegistryError(err)` handlers see it.\n * Before #1763 a timeout escaped as a bare `Error` (before the response) or a raw `AbortError` (during\n * the body), and a JSON body cut short was reported as a MALFORMED payload.\n */\nexport class RegistryRequestTimeoutError extends RegistryError {\n constructor(\n public readonly registryUrl: string,\n public readonly action: string,\n public readonly phase: RegistryTimeoutPhase,\n public readonly timeoutMs: number,\n ) {\n super(\n RegistryErrorCode.REQUEST_TIMEOUT,\n describeTimeout(phase, action, registryUrl, timeoutMs),\n );\n this.name = 'RegistryRequestTimeoutError';\n }\n}\n\n/** True for the error a fetch (or a body read) raises when its abort signal fires. */\nexport function isAbortLikeError(err: unknown): boolean {\n return err instanceof Error && (err.name === 'AbortError' || err.name === 'TimeoutError');\n}\n\nexport function isRegistryError(value: unknown): value is RegistryError {\n return value instanceof RegistryError;\n}\n"]}
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Wire contract of the platform's module-registry key door (#1756): apps-manager
3
+ * `/admin/registry/keys`, called by `wildo registry key`. Shared here because the two ends are
4
+ * different packages and neither may import the other.
5
+ *
6
+ * ## A key belongs to an ORGANIZATION, and says so
7
+ *
8
+ * The registry authorizes against `ownerOrganizationId` on its domain and module rows, so a registry
9
+ * key's authority is its organization: a publish key may publish into EVERY domain that organization
10
+ * owns. The door therefore addresses an organization, not an application. An earlier draft took an
11
+ * `appSlug` and resolved its owner, which read as a per-application key while narrowing nothing: every
12
+ * application a platform registers is owned by the one platform owner organization
13
+ * (`WILDO_OWNER_ORGANIZATION`), so a key "for application A" could publish into application B's domains.
14
+ * A parameter that looks like a scope and scopes nothing is a false control, so it was removed.
15
+ * Omit `organizationSlug` for the platform owner organization, the common case.
16
+ */
17
+ import { z } from 'zod';
18
+ import { ApiKeyStatus, CORE_ORG_ROLES } from '@wildo-ai/saas-models';
19
+ /** The roles a registry key may carry — mapped by apps-manager onto the two roles the registry's resources declare. */
20
+ export declare enum RegistryKeyRole {
21
+ /** Read RESTRICTED modules (resolve, info, download) — an install / CI key. Carries `ORG_MEMBER`. */
22
+ READ = "read",
23
+ /** Publish, yank and tag in the owning organization's domains. Carries `ORG_ADMIN`. */
24
+ PUBLISH = "publish"
25
+ }
26
+ /** A registry key always expires; the operator re-mints rather than extending. */
27
+ export declare const REGISTRY_KEY_DEFAULT_EXPIRY_DAYS = 90;
28
+ export declare const REGISTRY_KEY_MAX_EXPIRY_DAYS = 365;
29
+ /** A key's operator-facing name: lowercase letters, digits, `.`, `_`, `-` (max 64). */
30
+ export declare const RegistryKeyNameSchema: z.ZodString;
31
+ /** The organization a key belongs to, by slug. Absent = the platform owner organization. */
32
+ export declare const RegistryKeyOrganizationSlugSchema: z.ZodOptional<z.ZodString>;
33
+ export declare const RegistryKeyMintRequestSchema: z.ZodObject<{
34
+ organizationSlug: z.ZodOptional<z.ZodString>;
35
+ name: z.ZodString;
36
+ role: z.ZodEnum<typeof RegistryKeyRole>;
37
+ expiresInDays: z.ZodOptional<z.ZodNumber>;
38
+ }, z.core.$strict>;
39
+ export type RegistryKeyMintRequest = z.infer<typeof RegistryKeyMintRequestSchema>;
40
+ export declare const RegistryKeyMintResponseSchema: z.ZodObject<{
41
+ apiKeyId: z.ZodString;
42
+ plainKey: z.ZodString;
43
+ keyPrefix: z.ZodString;
44
+ organizationId: z.ZodString;
45
+ organizationSlug: z.ZodString;
46
+ role: z.ZodEnum<typeof RegistryKeyRole>;
47
+ expiresAt: z.ZodISODateTime;
48
+ }, z.core.$strip>;
49
+ export type RegistryKeyMintResponse = z.infer<typeof RegistryKeyMintResponseSchema>;
50
+ export declare const RegistryKeySummarySchema: z.ZodObject<{
51
+ apiKeyId: z.ZodString;
52
+ name: z.ZodString;
53
+ keyPrefix: z.ZodString;
54
+ roles: z.ZodArray<z.ZodEnum<typeof CORE_ORG_ROLES>>;
55
+ status: z.ZodEnum<typeof ApiKeyStatus>;
56
+ expiresAt: z.ZodOptional<z.ZodISODateTime>;
57
+ }, z.core.$strip>;
58
+ export type RegistryKeySummary = z.infer<typeof RegistryKeySummarySchema>;
59
+ export declare const RegistryKeyListResponseSchema: z.ZodObject<{
60
+ organizationSlug: z.ZodString;
61
+ keys: z.ZodArray<z.ZodObject<{
62
+ apiKeyId: z.ZodString;
63
+ name: z.ZodString;
64
+ keyPrefix: z.ZodString;
65
+ roles: z.ZodArray<z.ZodEnum<typeof CORE_ORG_ROLES>>;
66
+ status: z.ZodEnum<typeof ApiKeyStatus>;
67
+ expiresAt: z.ZodOptional<z.ZodISODateTime>;
68
+ }, z.core.$strip>>;
69
+ }, z.core.$strip>;
70
+ export type RegistryKeyListResponse = z.infer<typeof RegistryKeyListResponseSchema>;
71
+ export declare const RegistryKeyListQuerySchema: z.ZodObject<{
72
+ organizationSlug: z.ZodOptional<z.ZodString>;
73
+ }, z.core.$strict>;
74
+ export declare const RegistryKeyRevokeRequestSchema: z.ZodObject<{
75
+ organizationSlug: z.ZodOptional<z.ZodString>;
76
+ }, z.core.$strict>;
77
+ /** Admin-door paths, one place for both ends. */
78
+ export declare const REGISTRY_KEYS_ADMIN_PATH = "/admin/registry/keys";
79
+ export declare function buildRegistryKeyRevokePath(apiKeyId: string): string;
80
+ //# sourceMappingURL=registry-keys.schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry-keys.schemas.d.ts","sourceRoot":"","sources":["../../../../src/registry/registry-keys.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAErE,uHAAuH;AACvH,oBAAY,eAAe;IACzB,qGAAqG;IACrG,IAAI,SAAS;IACb,uFAAuF;IACvF,OAAO,YAAY;CACpB;AAED,kFAAkF;AAClF,eAAO,MAAM,gCAAgC,KAAK,CAAC;AACnD,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAEhD,uFAAuF;AACvF,eAAO,MAAM,qBAAqB,aAEhC,CAAC;AAEH,4FAA4F;AAC5F,eAAO,MAAM,iCAAiC,4BAA+B,CAAC;AAE9E,eAAO,MAAM,4BAA4B;;;;;kBAKvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,eAAO,MAAM,6BAA6B;;;;;;;;iBASxC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF,eAAO,MAAM,wBAAwB;;;;;;;iBAOnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,eAAO,MAAM,6BAA6B;;;;;;;;;;iBAA6F,CAAC;AACxI,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF,eAAO,MAAM,0BAA0B;;kBAA0E,CAAC;AAElH,eAAO,MAAM,8BAA8B;;kBAA0E,CAAC;AAEtH,iDAAiD;AACjD,eAAO,MAAM,wBAAwB,yBAAyB,CAAC;AAC/D,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEnE"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Wire contract of the platform's module-registry key door (#1756): apps-manager
3
+ * `/admin/registry/keys`, called by `wildo registry key`. Shared here because the two ends are
4
+ * different packages and neither may import the other.
5
+ *
6
+ * ## A key belongs to an ORGANIZATION, and says so
7
+ *
8
+ * The registry authorizes against `ownerOrganizationId` on its domain and module rows, so a registry
9
+ * key's authority is its organization: a publish key may publish into EVERY domain that organization
10
+ * owns. The door therefore addresses an organization, not an application. An earlier draft took an
11
+ * `appSlug` and resolved its owner, which read as a per-application key while narrowing nothing: every
12
+ * application a platform registers is owned by the one platform owner organization
13
+ * (`WILDO_OWNER_ORGANIZATION`), so a key "for application A" could publish into application B's domains.
14
+ * A parameter that looks like a scope and scopes nothing is a false control, so it was removed.
15
+ * Omit `organizationSlug` for the platform owner organization, the common case.
16
+ */
17
+ import { z } from 'zod';
18
+ import { ApiKeyStatus, CORE_ORG_ROLES } from '@wildo-ai/saas-models';
19
+ /** The roles a registry key may carry — mapped by apps-manager onto the two roles the registry's resources declare. */
20
+ export var RegistryKeyRole;
21
+ (function (RegistryKeyRole) {
22
+ /** Read RESTRICTED modules (resolve, info, download) — an install / CI key. Carries `ORG_MEMBER`. */
23
+ RegistryKeyRole["READ"] = "read";
24
+ /** Publish, yank and tag in the owning organization's domains. Carries `ORG_ADMIN`. */
25
+ RegistryKeyRole["PUBLISH"] = "publish";
26
+ })(RegistryKeyRole || (RegistryKeyRole = {}));
27
+ /** A registry key always expires; the operator re-mints rather than extending. */
28
+ export const REGISTRY_KEY_DEFAULT_EXPIRY_DAYS = 90;
29
+ export const REGISTRY_KEY_MAX_EXPIRY_DAYS = 365;
30
+ /** A key's operator-facing name: lowercase letters, digits, `.`, `_`, `-` (max 64). */
31
+ export const RegistryKeyNameSchema = z.string().regex(/^[a-z0-9][a-z0-9._-]{0,63}$/, {
32
+ error: 'a registry key name must be lowercase letters, digits, ".", "_" or "-" (max 64)',
33
+ });
34
+ /** The organization a key belongs to, by slug. Absent = the platform owner organization. */
35
+ export const RegistryKeyOrganizationSlugSchema = z.string().min(1).optional();
36
+ export const RegistryKeyMintRequestSchema = z.strictObject({
37
+ organizationSlug: RegistryKeyOrganizationSlugSchema,
38
+ name: RegistryKeyNameSchema,
39
+ role: z.enum(RegistryKeyRole),
40
+ expiresInDays: z.number().int().min(1).max(REGISTRY_KEY_MAX_EXPIRY_DAYS).optional(),
41
+ });
42
+ export const RegistryKeyMintResponseSchema = z.object({
43
+ apiKeyId: z.string().min(1),
44
+ /** The secret — returned exactly once, never stored by the platform. */
45
+ plainKey: z.string().min(1),
46
+ keyPrefix: z.string().min(1),
47
+ organizationId: z.string().min(1),
48
+ organizationSlug: z.string().min(1),
49
+ role: z.enum(RegistryKeyRole),
50
+ expiresAt: z.iso.datetime(),
51
+ });
52
+ export const RegistryKeySummarySchema = z.object({
53
+ apiKeyId: z.string().min(1),
54
+ name: z.string(),
55
+ keyPrefix: z.string(),
56
+ roles: z.array(z.enum(CORE_ORG_ROLES)),
57
+ status: z.enum(ApiKeyStatus),
58
+ expiresAt: z.iso.datetime().optional(),
59
+ });
60
+ export const RegistryKeyListResponseSchema = z.object({ organizationSlug: z.string().min(1), keys: z.array(RegistryKeySummarySchema) });
61
+ export const RegistryKeyListQuerySchema = z.strictObject({ organizationSlug: RegistryKeyOrganizationSlugSchema });
62
+ export const RegistryKeyRevokeRequestSchema = z.strictObject({ organizationSlug: RegistryKeyOrganizationSlugSchema });
63
+ /** Admin-door paths, one place for both ends. */
64
+ export const REGISTRY_KEYS_ADMIN_PATH = '/admin/registry/keys';
65
+ export function buildRegistryKeyRevokePath(apiKeyId) {
66
+ return `${REGISTRY_KEYS_ADMIN_PATH}/${encodeURIComponent(apiKeyId)}/revoke`;
67
+ }
68
+ //# sourceMappingURL=registry-keys.schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry-keys.schemas.js","sourceRoot":"","sources":["../../../../src/registry/registry-keys.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAErE,uHAAuH;AACvH,MAAM,CAAN,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,qGAAqG;IACrG,gCAAa,CAAA;IACb,uFAAuF;IACvF,sCAAmB,CAAA;AACrB,CAAC,EALW,eAAe,KAAf,eAAe,QAK1B;AAED,kFAAkF;AAClF,MAAM,CAAC,MAAM,gCAAgC,GAAG,EAAE,CAAC;AACnD,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,CAAC;AAEhD,uFAAuF;AACvF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,6BAA6B,EAAE;IACnF,KAAK,EAAE,iFAAiF;CACzF,CAAC,CAAC;AAEH,4FAA4F;AAC5F,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;AAE9E,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,YAAY,CAAC;IACzD,gBAAgB,EAAE,iCAAiC;IACn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,CAAC,QAAQ,EAAE;CACvC,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC;AAGxI,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,YAAY,CAAC,EAAE,gBAAgB,EAAE,iCAAiC,EAAE,CAAC,CAAC;AAElH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,YAAY,CAAC,EAAE,gBAAgB,EAAE,iCAAiC,EAAE,CAAC,CAAC;AAEtH,iDAAiD;AACjD,MAAM,CAAC,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AAC/D,MAAM,UAAU,0BAA0B,CAAC,QAAgB;IACzD,OAAO,GAAG,wBAAwB,IAAI,kBAAkB,CAAC,QAAQ,CAAC,SAAS,CAAC;AAC9E,CAAC","sourcesContent":["/**\n * Wire contract of the platform's module-registry key door (#1756): apps-manager\n * `/admin/registry/keys`, called by `wildo registry key`. Shared here because the two ends are\n * different packages and neither may import the other.\n *\n * ## A key belongs to an ORGANIZATION, and says so\n *\n * The registry authorizes against `ownerOrganizationId` on its domain and module rows, so a registry\n * key's authority is its organization: a publish key may publish into EVERY domain that organization\n * owns. The door therefore addresses an organization, not an application. An earlier draft took an\n * `appSlug` and resolved its owner, which read as a per-application key while narrowing nothing: every\n * application a platform registers is owned by the one platform owner organization\n * (`WILDO_OWNER_ORGANIZATION`), so a key \"for application A\" could publish into application B's domains.\n * A parameter that looks like a scope and scopes nothing is a false control, so it was removed.\n * Omit `organizationSlug` for the platform owner organization, the common case.\n */\n\nimport { z } from 'zod';\nimport { ApiKeyStatus, CORE_ORG_ROLES } from '@wildo-ai/saas-models';\n\n/** The roles a registry key may carry — mapped by apps-manager onto the two roles the registry's resources declare. */\nexport enum RegistryKeyRole {\n /** Read RESTRICTED modules (resolve, info, download) — an install / CI key. Carries `ORG_MEMBER`. */\n READ = 'read',\n /** Publish, yank and tag in the owning organization's domains. Carries `ORG_ADMIN`. */\n PUBLISH = 'publish',\n}\n\n/** A registry key always expires; the operator re-mints rather than extending. */\nexport const REGISTRY_KEY_DEFAULT_EXPIRY_DAYS = 90;\nexport const REGISTRY_KEY_MAX_EXPIRY_DAYS = 365;\n\n/** A key's operator-facing name: lowercase letters, digits, `.`, `_`, `-` (max 64). */\nexport const RegistryKeyNameSchema = z.string().regex(/^[a-z0-9][a-z0-9._-]{0,63}$/, {\n error: 'a registry key name must be lowercase letters, digits, \".\", \"_\" or \"-\" (max 64)',\n});\n\n/** The organization a key belongs to, by slug. Absent = the platform owner organization. */\nexport const RegistryKeyOrganizationSlugSchema = z.string().min(1).optional();\n\nexport const RegistryKeyMintRequestSchema = z.strictObject({\n organizationSlug: RegistryKeyOrganizationSlugSchema,\n name: RegistryKeyNameSchema,\n role: z.enum(RegistryKeyRole),\n expiresInDays: z.number().int().min(1).max(REGISTRY_KEY_MAX_EXPIRY_DAYS).optional(),\n});\nexport type RegistryKeyMintRequest = z.infer<typeof RegistryKeyMintRequestSchema>;\n\nexport const RegistryKeyMintResponseSchema = z.object({\n apiKeyId: z.string().min(1),\n /** The secret — returned exactly once, never stored by the platform. */\n plainKey: z.string().min(1),\n keyPrefix: z.string().min(1),\n organizationId: z.string().min(1),\n organizationSlug: z.string().min(1),\n role: z.enum(RegistryKeyRole),\n expiresAt: z.iso.datetime(),\n});\nexport type RegistryKeyMintResponse = z.infer<typeof RegistryKeyMintResponseSchema>;\n\nexport const RegistryKeySummarySchema = z.object({\n apiKeyId: z.string().min(1),\n name: z.string(),\n keyPrefix: z.string(),\n roles: z.array(z.enum(CORE_ORG_ROLES)),\n status: z.enum(ApiKeyStatus),\n expiresAt: z.iso.datetime().optional(),\n});\nexport type RegistryKeySummary = z.infer<typeof RegistryKeySummarySchema>;\n\nexport const RegistryKeyListResponseSchema = z.object({ organizationSlug: z.string().min(1), keys: z.array(RegistryKeySummarySchema) });\nexport type RegistryKeyListResponse = z.infer<typeof RegistryKeyListResponseSchema>;\n\nexport const RegistryKeyListQuerySchema = z.strictObject({ organizationSlug: RegistryKeyOrganizationSlugSchema });\n\nexport const RegistryKeyRevokeRequestSchema = z.strictObject({ organizationSlug: RegistryKeyOrganizationSlugSchema });\n\n/** Admin-door paths, one place for both ends. */\nexport const REGISTRY_KEYS_ADMIN_PATH = '/admin/registry/keys';\nexport function buildRegistryKeyRevokePath(apiKeyId: string): string {\n return `${REGISTRY_KEYS_ADMIN_PATH}/${encodeURIComponent(apiKeyId)}/revoke`;\n}\n"]}
@@ -19,19 +19,41 @@ export declare const DEFAULT_REGISTRY_SECTION_SCHEMAS: {
19
19
  readonly modules: import("zod").ZodObject<{
20
20
  installed: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
21
21
  moduleId: import("zod").ZodString;
22
- registryId: import("zod").ZodString;
23
- registryUrl: import("zod").ZodString;
22
+ distribution: import("zod").ZodDefault<import("zod").ZodEnum<typeof import("./lockfile-modules-section.schemas").ModuleDistribution>>;
23
+ registryId: import("zod").ZodOptional<import("zod").ZodString>;
24
+ registryUrl: import("zod").ZodOptional<import("zod").ZodString>;
25
+ checkoutCommit: import("zod").ZodOptional<import("zod").ZodString>;
26
+ checkoutDirty: import("zod").ZodOptional<import("zod").ZodBoolean>;
24
27
  domain: import("zod").ZodString;
25
28
  version: import("zod").ZodString;
26
29
  requestedRange: import("zod").ZodOptional<import("zod").ZodString>;
27
- artifactDigest: import("zod").ZodString;
30
+ artifactDigest: import("zod").ZodOptional<import("zod").ZodString>;
28
31
  installedAt: import("zod").ZodISODateTime;
29
32
  files: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodString>>;
33
+ installedFileHashes: import("zod").ZodCatch<import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>>;
30
34
  source: import("zod").ZodOptional<import("zod").ZodEnum<{
31
35
  install: "install";
32
36
  update: "update";
33
37
  adopt: "adopt";
34
38
  }>>;
39
+ registration: import("zod").ZodOptional<import("zod").ZodObject<{
40
+ scenario: import("zod").ZodEnum<typeof import("./module-manifest.schemas").ModuleRegistrationScenario>;
41
+ moduleId: import("zod").ZodString;
42
+ moduleCamel: import("zod").ZodString;
43
+ layers: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodEnum<typeof import("./module-manifest.schemas").DomainModuleLayer>>>;
44
+ providerWiring: import("zod").ZodOptional<import("zod").ZodObject<{
45
+ backendPackage: import("zod").ZodOptional<import("zod").ZodString>;
46
+ backendOwners: import("zod").ZodArray<import("zod").ZodObject<{
47
+ serviceKey: import("zod").ZodString;
48
+ path: import("zod").ZodString;
49
+ }, import("zod/v4/core").$strict>>;
50
+ frontendPackage: import("zod").ZodOptional<import("zod").ZodString>;
51
+ frontendOwners: import("zod").ZodArray<import("zod").ZodObject<{
52
+ serviceKey: import("zod").ZodString;
53
+ path: import("zod").ZodString;
54
+ }, import("zod/v4/core").$strict>>;
55
+ }, import("zod/v4/core").$strict>>;
56
+ }, import("zod/v4/core").$strict>>;
35
57
  }, import("zod/v4/core").$strict>>>;
36
58
  }, import("zod/v4/core").$strict>;
37
59
  };
@@ -1 +1 @@
1
- {"version":3,"file":"registry-section-schemas.constants.d.ts","sourceRoot":"","sources":["../../../../src/registry/registry-section-schemas.constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;CAEnC,CAAC;AAEX,MAAM,MAAM,6BAA6B,GAAG,OAAO,gCAAgC,CAAC"}
1
+ {"version":3,"file":"registry-section-schemas.constants.d.ts","sourceRoot":"","sources":["../../../../src/registry/registry-section-schemas.constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEnC,CAAC;AAEX,MAAM,MAAM,6BAA6B,GAAG,OAAO,gCAAgC,CAAC"}