@run402/sdk 4.95.0 → 4.96.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.
Files changed (210) hide show
  1. package/README.md +24 -24
  2. package/core-dist/keystore.d.ts +1 -1
  3. package/core-dist/keystore.js +1 -1
  4. package/dist/errors.d.ts +4 -4
  5. package/dist/errors.d.ts.map +1 -1
  6. package/dist/index.d.ts +9 -9
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +8 -8
  9. package/dist/index.js.map +1 -1
  10. package/dist/namespaces/deploy.d.ts +5 -5
  11. package/dist/namespaces/deploy.d.ts.map +1 -1
  12. package/dist/namespaces/deploy.js +20 -20
  13. package/dist/namespaces/deploy.js.map +1 -1
  14. package/dist/namespaces/deploy.types.d.ts +17 -17
  15. package/dist/namespaces/deploy.types.d.ts.map +1 -1
  16. package/dist/namespaces/org.d.ts +2 -2
  17. package/dist/namespaces/org.js +2 -2
  18. package/dist/namespaces/org.types.d.ts +3 -3
  19. package/dist/namespaces/pay.js +1 -1
  20. package/dist/namespaces/{gitvault.d.ts → repos.d.ts} +436 -449
  21. package/dist/namespaces/repos.d.ts.map +1 -0
  22. package/dist/namespaces/{gitvault.js → repos.js} +451 -459
  23. package/dist/namespaces/repos.js.map +1 -0
  24. package/dist/namespaces/rooms.js +2 -2
  25. package/dist/namespaces/rooms.js.map +1 -1
  26. package/dist/namespaces/session.d.ts +2 -2
  27. package/dist/namespaces/session.d.ts.map +1 -1
  28. package/dist/namespaces/session.js +2 -2
  29. package/dist/namespaces/session.js.map +1 -1
  30. package/dist/namespaces/tier.d.ts +3 -3
  31. package/dist/namespaces/tier.d.ts.map +1 -1
  32. package/dist/namespaces/{gitvault.crypto.d.ts → vault.crypto.d.ts} +141 -141
  33. package/dist/namespaces/vault.crypto.d.ts.map +1 -0
  34. package/dist/namespaces/{gitvault.crypto.js → vault.crypto.js} +173 -173
  35. package/dist/namespaces/vault.crypto.js.map +1 -0
  36. package/dist/namespaces/{gitvault.types.d.ts → vault.types.d.ts} +136 -136
  37. package/dist/namespaces/vault.types.d.ts.map +1 -0
  38. package/dist/namespaces/{gitvault.types.js → vault.types.js} +4 -4
  39. package/dist/namespaces/vault.types.js.map +1 -0
  40. package/dist/node/bearer-redeem-key.d.ts +1 -1
  41. package/dist/node/bearer-redeem-key.js +5 -5
  42. package/dist/node/bearer-redeem-key.js.map +1 -1
  43. package/dist/node/http-dispatcher.js +5 -5
  44. package/dist/node/http-dispatcher.js.map +1 -1
  45. package/dist/node/index.d.ts +29 -29
  46. package/dist/node/index.d.ts.map +1 -1
  47. package/dist/node/index.js +39 -39
  48. package/dist/node/index.js.map +1 -1
  49. package/dist/node/{gitvault-address.d.ts → vault-address.d.ts} +42 -42
  50. package/dist/node/vault-address.d.ts.map +1 -0
  51. package/dist/node/{gitvault-address.js → vault-address.js} +43 -43
  52. package/dist/node/vault-address.js.map +1 -0
  53. package/dist/node/{gitvault-apply.d.ts → vault-apply.d.ts} +27 -27
  54. package/dist/node/vault-apply.d.ts.map +1 -0
  55. package/dist/node/{gitvault-apply.js → vault-apply.js} +38 -38
  56. package/dist/node/vault-apply.js.map +1 -0
  57. package/dist/node/vault-byo-config.d.ts +29 -0
  58. package/dist/node/vault-byo-config.d.ts.map +1 -0
  59. package/dist/node/{gitvault-byo-config.js → vault-byo-config.js} +18 -18
  60. package/dist/node/vault-byo-config.js.map +1 -0
  61. package/dist/node/vault-byo-probe.d.ts +20 -0
  62. package/dist/node/vault-byo-probe.d.ts.map +1 -0
  63. package/dist/node/vault-byo-probe.js +57 -0
  64. package/dist/node/vault-byo-probe.js.map +1 -0
  65. package/dist/node/{gitvault-creation-journal.d.ts → vault-creation-journal.d.ts} +69 -69
  66. package/dist/node/vault-creation-journal.d.ts.map +1 -0
  67. package/dist/node/{gitvault-creation-journal.js → vault-creation-journal.js} +54 -54
  68. package/dist/node/vault-creation-journal.js.map +1 -0
  69. package/dist/node/{gitvault-degraded-read.d.ts → vault-degraded-read.d.ts} +34 -34
  70. package/dist/node/vault-degraded-read.d.ts.map +1 -0
  71. package/dist/node/{gitvault-degraded-read.js → vault-degraded-read.js} +24 -24
  72. package/dist/node/vault-degraded-read.js.map +1 -0
  73. package/dist/node/{gitvault-deploy.d.ts → vault-deploy.d.ts} +67 -67
  74. package/dist/node/vault-deploy.d.ts.map +1 -0
  75. package/dist/node/{gitvault-deploy.js → vault-deploy.js} +27 -27
  76. package/dist/node/vault-deploy.js.map +1 -0
  77. package/dist/node/{gitvault-edge-fetch.d.ts → vault-edge-fetch.d.ts} +9 -9
  78. package/dist/node/vault-edge-fetch.d.ts.map +1 -0
  79. package/dist/node/{gitvault-edge-fetch.js → vault-edge-fetch.js} +11 -11
  80. package/dist/node/vault-edge-fetch.js.map +1 -0
  81. package/dist/node/{gitvault-handoff.d.ts → vault-handoff.d.ts} +9 -9
  82. package/dist/node/vault-handoff.d.ts.map +1 -0
  83. package/dist/node/{gitvault-handoff.js → vault-handoff.js} +24 -24
  84. package/dist/node/vault-handoff.js.map +1 -0
  85. package/dist/node/{gitvault-keystore.d.ts → vault-keystore.d.ts} +87 -77
  86. package/dist/node/vault-keystore.d.ts.map +1 -0
  87. package/dist/node/{gitvault-keystore.js → vault-keystore.js} +105 -68
  88. package/dist/node/vault-keystore.js.map +1 -0
  89. package/dist/node/{gitvault-member-bundle.d.ts → vault-member-bundle.d.ts} +17 -17
  90. package/dist/node/vault-member-bundle.d.ts.map +1 -0
  91. package/dist/node/{gitvault-member-bundle.js → vault-member-bundle.js} +11 -11
  92. package/dist/node/vault-member-bundle.js.map +1 -0
  93. package/dist/node/{gitvault-mirror-backend.d.ts → vault-mirror-backend.d.ts} +26 -26
  94. package/dist/node/vault-mirror-backend.d.ts.map +1 -0
  95. package/dist/node/{gitvault-mirror-backend.js → vault-mirror-backend.js} +25 -25
  96. package/dist/node/vault-mirror-backend.js.map +1 -0
  97. package/dist/node/{gitvault-mirror-config.d.ts → vault-mirror-config.d.ts} +23 -23
  98. package/dist/node/vault-mirror-config.d.ts.map +1 -0
  99. package/dist/node/{gitvault-mirror-config.js → vault-mirror-config.js} +16 -16
  100. package/dist/node/vault-mirror-config.js.map +1 -0
  101. package/dist/node/{gitvault-mirror.d.ts → vault-mirror.d.ts} +36 -36
  102. package/dist/node/vault-mirror.d.ts.map +1 -0
  103. package/dist/node/{gitvault-mirror.js → vault-mirror.js} +75 -75
  104. package/dist/node/vault-mirror.js.map +1 -0
  105. package/dist/node/{gitvault-native-crypto.d.ts → vault-native-crypto.d.ts} +10 -10
  106. package/dist/node/vault-native-crypto.d.ts.map +1 -0
  107. package/dist/node/{gitvault-native-crypto.js → vault-native-crypto.js} +16 -16
  108. package/dist/node/vault-native-crypto.js.map +1 -0
  109. package/dist/node/{gitvault-open-or-create.d.ts → vault-open-or-create.d.ts} +16 -16
  110. package/dist/node/vault-open-or-create.d.ts.map +1 -0
  111. package/dist/node/{gitvault-open-or-create.js → vault-open-or-create.js} +10 -10
  112. package/dist/node/vault-open-or-create.js.map +1 -0
  113. package/dist/node/{gitvault-prewarm.d.ts → vault-prewarm.d.ts} +13 -13
  114. package/dist/node/vault-prewarm.d.ts.map +1 -0
  115. package/dist/node/{gitvault-prewarm.js → vault-prewarm.js} +25 -25
  116. package/dist/node/vault-prewarm.js.map +1 -0
  117. package/dist/node/{gitvault-profile-scan.d.ts → vault-profile-scan.d.ts} +3 -3
  118. package/dist/node/vault-profile-scan.d.ts.map +1 -0
  119. package/dist/node/{gitvault-profile-scan.js → vault-profile-scan.js} +12 -12
  120. package/dist/node/vault-profile-scan.js.map +1 -0
  121. package/dist/node/{gitvault-prune.d.ts → vault-prune.d.ts} +61 -61
  122. package/dist/node/vault-prune.d.ts.map +1 -0
  123. package/dist/node/{gitvault-prune.js → vault-prune.js} +34 -34
  124. package/dist/node/vault-prune.js.map +1 -0
  125. package/dist/node/{gitvault-publication.d.ts → vault-publication.d.ts} +399 -399
  126. package/dist/node/vault-publication.d.ts.map +1 -0
  127. package/dist/node/{gitvault-publication.js → vault-publication.js} +584 -584
  128. package/dist/node/vault-publication.js.map +1 -0
  129. package/dist/node/{gitvault-push-to-create.d.ts → vault-push-to-create.d.ts} +16 -16
  130. package/dist/node/vault-push-to-create.d.ts.map +1 -0
  131. package/dist/node/{gitvault-push-to-create.js → vault-push-to-create.js} +9 -9
  132. package/dist/node/vault-push-to-create.js.map +1 -0
  133. package/dist/node/{gitvault-recover.d.ts → vault-recover.d.ts} +50 -50
  134. package/dist/node/vault-recover.d.ts.map +1 -0
  135. package/dist/node/{gitvault-recover.js → vault-recover.js} +84 -84
  136. package/dist/node/vault-recover.js.map +1 -0
  137. package/dist/node/{gitvault-restore.d.ts → vault-restore.d.ts} +8 -8
  138. package/dist/node/vault-restore.d.ts.map +1 -0
  139. package/dist/node/{gitvault-restore.js → vault-restore.js} +11 -11
  140. package/dist/node/vault-restore.js.map +1 -0
  141. package/dist/node/{gitvault-snapshot.d.ts → vault-snapshot.d.ts} +48 -48
  142. package/dist/node/vault-snapshot.d.ts.map +1 -0
  143. package/dist/node/{gitvault-snapshot.js → vault-snapshot.js} +61 -61
  144. package/dist/node/vault-snapshot.js.map +1 -0
  145. package/dist/node/{gitvault-writer-state.d.ts → vault-writer-state.d.ts} +8 -8
  146. package/dist/node/vault-writer-state.d.ts.map +1 -0
  147. package/dist/node/{gitvault-writer-state.js → vault-writer-state.js} +15 -15
  148. package/dist/node/vault-writer-state.js.map +1 -0
  149. package/dist/node/workflow-output.js +4 -4
  150. package/dist/node/workflow-output.js.map +1 -1
  151. package/package.json +1 -1
  152. package/dist/namespaces/gitvault.crypto.d.ts.map +0 -1
  153. package/dist/namespaces/gitvault.crypto.js.map +0 -1
  154. package/dist/namespaces/gitvault.d.ts.map +0 -1
  155. package/dist/namespaces/gitvault.js.map +0 -1
  156. package/dist/namespaces/gitvault.types.d.ts.map +0 -1
  157. package/dist/namespaces/gitvault.types.js.map +0 -1
  158. package/dist/node/gitvault-address.d.ts.map +0 -1
  159. package/dist/node/gitvault-address.js.map +0 -1
  160. package/dist/node/gitvault-apply.d.ts.map +0 -1
  161. package/dist/node/gitvault-apply.js.map +0 -1
  162. package/dist/node/gitvault-byo-config.d.ts +0 -29
  163. package/dist/node/gitvault-byo-config.d.ts.map +0 -1
  164. package/dist/node/gitvault-byo-config.js.map +0 -1
  165. package/dist/node/gitvault-byo-probe.d.ts +0 -20
  166. package/dist/node/gitvault-byo-probe.d.ts.map +0 -1
  167. package/dist/node/gitvault-byo-probe.js +0 -57
  168. package/dist/node/gitvault-byo-probe.js.map +0 -1
  169. package/dist/node/gitvault-creation-journal.d.ts.map +0 -1
  170. package/dist/node/gitvault-creation-journal.js.map +0 -1
  171. package/dist/node/gitvault-degraded-read.d.ts.map +0 -1
  172. package/dist/node/gitvault-degraded-read.js.map +0 -1
  173. package/dist/node/gitvault-deploy.d.ts.map +0 -1
  174. package/dist/node/gitvault-deploy.js.map +0 -1
  175. package/dist/node/gitvault-edge-fetch.d.ts.map +0 -1
  176. package/dist/node/gitvault-edge-fetch.js.map +0 -1
  177. package/dist/node/gitvault-handoff.d.ts.map +0 -1
  178. package/dist/node/gitvault-handoff.js.map +0 -1
  179. package/dist/node/gitvault-keystore.d.ts.map +0 -1
  180. package/dist/node/gitvault-keystore.js.map +0 -1
  181. package/dist/node/gitvault-member-bundle.d.ts.map +0 -1
  182. package/dist/node/gitvault-member-bundle.js.map +0 -1
  183. package/dist/node/gitvault-mirror-backend.d.ts.map +0 -1
  184. package/dist/node/gitvault-mirror-backend.js.map +0 -1
  185. package/dist/node/gitvault-mirror-config.d.ts.map +0 -1
  186. package/dist/node/gitvault-mirror-config.js.map +0 -1
  187. package/dist/node/gitvault-mirror.d.ts.map +0 -1
  188. package/dist/node/gitvault-mirror.js.map +0 -1
  189. package/dist/node/gitvault-native-crypto.d.ts.map +0 -1
  190. package/dist/node/gitvault-native-crypto.js.map +0 -1
  191. package/dist/node/gitvault-open-or-create.d.ts.map +0 -1
  192. package/dist/node/gitvault-open-or-create.js.map +0 -1
  193. package/dist/node/gitvault-prewarm.d.ts.map +0 -1
  194. package/dist/node/gitvault-prewarm.js.map +0 -1
  195. package/dist/node/gitvault-profile-scan.d.ts.map +0 -1
  196. package/dist/node/gitvault-profile-scan.js.map +0 -1
  197. package/dist/node/gitvault-prune.d.ts.map +0 -1
  198. package/dist/node/gitvault-prune.js.map +0 -1
  199. package/dist/node/gitvault-publication.d.ts.map +0 -1
  200. package/dist/node/gitvault-publication.js.map +0 -1
  201. package/dist/node/gitvault-push-to-create.d.ts.map +0 -1
  202. package/dist/node/gitvault-push-to-create.js.map +0 -1
  203. package/dist/node/gitvault-recover.d.ts.map +0 -1
  204. package/dist/node/gitvault-recover.js.map +0 -1
  205. package/dist/node/gitvault-restore.d.ts.map +0 -1
  206. package/dist/node/gitvault-restore.js.map +0 -1
  207. package/dist/node/gitvault-snapshot.d.ts.map +0 -1
  208. package/dist/node/gitvault-snapshot.js.map +0 -1
  209. package/dist/node/gitvault-writer-state.d.ts.map +0 -1
  210. package/dist/node/gitvault-writer-state.js.map +0 -1
@@ -1,8 +1,8 @@
1
1
  /**
2
- * The gitvault deploy lane, supplied at last (change `gitvault-deploy-lane`).
2
+ * The vault deploy lane, supplied at last (change `vault-deploy-lane`).
3
3
  *
4
- * `add-gitvault` 5.6 built `runGitvaultDeploy` with the lane INJECTED and never
5
- * supplied one, so a project whose `gitvault_policy` is `required` could not be
4
+ * `add-vault` 5.6 built `runVaultDeploy` with the lane INJECTED and never
5
+ * supplied one, so a project whose `vault_policy` is `required` could not be
6
6
  * deployed by any published client. This module is that supplier, plus the
7
7
  * entry point the CLI calls in place of a bare `apply()`:
8
8
  *
@@ -12,11 +12,11 @@
12
12
  * than reassembling it. Warning gating, CAS dedup, event emission, asset
13
13
  * re-plan, and terminal polling are the same code every other deploy runs;
14
14
  * the only difference is two extra wire fields.
15
- * - {@link applyWithGitvault} decides whether any of that happens at all. A
15
+ * - {@link applyWithVault} decides whether any of that happens at all. A
16
16
  * project that is not `required` takes the untouched path: no capture, no
17
17
  * token, no extra refusal, one policy read.
18
18
  *
19
- * THE COROUTINE, because it is the non-obvious part. `runGitvaultDeploy` wants
19
+ * THE COROUTINE, because it is the non-obvious part. `runVaultDeploy` wants
20
20
  * two separable steps (plan, then commit) with the vault push running between
21
21
  * them; `Deploy.apply()` is one call. The lane bridges them with a pair of
22
22
  * deferreds: `apply()`'s `authorize` hook fires once the plan exists and its
@@ -46,7 +46,7 @@ export function createApplyDeployLane(options) {
46
46
  async plan(input) {
47
47
  applyPromise = options.engine.apply(options.spec, {
48
48
  ...(options.apply ?? {}),
49
- gitvault: {
49
+ vault: {
50
50
  declaration: { capture_id: input.capture_id, snapshot_oid_hmac: input.snapshot_oid_hmac },
51
51
  authorize: async (p) => {
52
52
  if (!p.apply_plan_sha256) {
@@ -55,7 +55,7 @@ export function createApplyDeployLane(options) {
55
55
  // inventing a placeholder: the capture still publishes (with a
56
56
  // null digest, so nothing is mintable from it) and the outcome
57
57
  // is an honest `DEPLOY_FAILED_VAULTED`.
58
- const missing = new LocalError("the gateway accepted a capture-bearing plan but returned no apply_plan_sha256; no activation token can be minted for it", "planning a gitvault deploy", { code: "GITVAULT_PLAN_DIGEST_MISSING", details: { plan_id: p.plan_id, operation_id: p.operation_id } });
58
+ const missing = new LocalError("the gateway accepted a capture-bearing plan but returned no apply_plan_sha256; no activation token can be minted for it", "planning a vault deploy", { code: "VAULT_PLAN_DIGEST_MISSING", details: { plan_id: p.plan_id, operation_id: p.operation_id } });
59
59
  planned.reject(missing);
60
60
  throw missing;
61
61
  }
@@ -73,7 +73,7 @@ export function createApplyDeployLane(options) {
73
73
  async commit(input) {
74
74
  authorized.resolve(commitDeclaration(input));
75
75
  if (!applyPromise)
76
- throw new LocalError("commit was called before plan", "committing gitvault deploy", { code: "GITVAULT_LANE_OUT_OF_ORDER" });
76
+ throw new LocalError("commit was called before plan", "committing vault deploy", { code: "VAULT_LANE_OUT_OF_ORDER" });
77
77
  result = await applyPromise;
78
78
  return result;
79
79
  },
@@ -82,7 +82,7 @@ export function createApplyDeployLane(options) {
82
82
  return;
83
83
  authorized.reject(reason instanceof Error
84
84
  ? reason
85
- : new LocalError("the gitvault deploy was abandoned before commit", "committing gitvault deploy", { code: "GITVAULT_DEPLOY_ABANDONED", details: { reason } }));
85
+ : new LocalError("the vault deploy was abandoned before commit", "committing vault deploy", { code: "VAULT_DEPLOY_ABANDONED", details: { reason } }));
86
86
  },
87
87
  result: () => result,
88
88
  };
@@ -93,25 +93,25 @@ function commitDeclaration(input) {
93
93
  return { allow_unvaulted: true, override_reason: input.allow_unvaulted.reason };
94
94
  const tokenId = input.activation_token?.object_id;
95
95
  if (!tokenId) {
96
- throw new LocalError("a vaulted commit needs an activation token and none was minted", "committing gitvault deploy", { code: "GITVAULT_ACTIVATION_TOKEN_MISSING" });
96
+ throw new LocalError("a vaulted commit needs an activation token and none was minted", "committing vault deploy", { code: "VAULT_ACTIVATION_TOKEN_MISSING" });
97
97
  }
98
98
  return { activation_token_id: tokenId };
99
99
  }
100
100
  /** `run402 repos policy required` — the offer D3 attaches to every ungated deploy. */
101
- export function gitvaultPolicyRequiredNextAction(repoId) {
101
+ export function vaultPolicyRequiredNextAction(repoId) {
102
102
  return {
103
- type: "gitvault_policy_required",
103
+ type: "vault_policy_required",
104
104
  command: "run402 repos policy required",
105
- why: `vault ${repoId} exists but gitvault_policy was never set, so this deploy ran without requiring a vaulted capture. Set it to require one, or run \`run402 repos policy grandfathered --reason <why>\` to explicitly accept the current state.`,
105
+ why: `vault ${repoId} exists but vault_policy was never set, so this deploy ran without requiring a vaulted capture. Set it to require one, or run \`run402 repos policy grandfathered --reason <why>\` to explicitly accept the current state.`,
106
106
  };
107
107
  }
108
108
  /** The standing `warnings[]` entry D3 attaches to every ungated deploy, until the policy is set either way. */
109
- export function gitvaultUngatedWarning(repoId) {
109
+ export function vaultUngatedWarning(repoId) {
110
110
  return {
111
- code: "GITVAULT_POLICY_UNSET",
111
+ code: "VAULT_POLICY_UNSET",
112
112
  severity: "low",
113
113
  requires_confirmation: false,
114
- message: `vault ${repoId} is not gated: gitvault_policy was never set, so a deploy can activate without a vaulted capture. Run \`run402 repos policy required\` (or \`grandfathered --reason <why>\` to explicitly accept this) to clear the drift.`,
114
+ message: `vault ${repoId} is not gated: vault_policy was never set, so a deploy can activate without a vaulted capture. Run \`run402 repos policy required\` (or \`grandfathered --reason <why>\` to explicitly accept this) to clear the drift.`,
115
115
  affected: [repoId],
116
116
  };
117
117
  }
@@ -119,12 +119,12 @@ export function gitvaultUngatedWarning(repoId) {
119
119
  function decorateUngatedResult(result, repoId) {
120
120
  return {
121
121
  ...result,
122
- warnings: [...(result.warnings ?? []), gitvaultUngatedWarning(repoId)],
123
- next_actions: [...(result.next_actions ?? []), gitvaultPolicyRequiredNextAction(repoId)],
122
+ warnings: [...(result.warnings ?? []), vaultUngatedWarning(repoId)],
123
+ next_actions: [...(result.next_actions ?? []), vaultPolicyRequiredNextAction(repoId)],
124
124
  };
125
125
  }
126
126
  /**
127
- * Deploy, taking the project's `gitvault_policy` into account.
127
+ * Deploy, taking the project's `vault_policy` into account.
128
128
  *
129
129
  * NOT `required` — no vault, an unreadable policy, a Core target, or an
130
130
  * explicit `grandfathered` — runs `apply()` with the caller's own options and
@@ -132,7 +132,7 @@ function decorateUngatedResult(result, repoId) {
132
132
  * user's deploy, and the only cost this function may add to it is the single
133
133
  * policy read that determines the project is not `required`.
134
134
  */
135
- export async function applyWithGitvault(options) {
135
+ export async function applyWithVault(options) {
136
136
  const applyOpts = {
137
137
  ...(options.apply ?? {}),
138
138
  ...(options.target ? { target: options.target } : {}),
@@ -140,32 +140,32 @@ export async function applyWithGitvault(options) {
140
140
  const plain = async (mode) => ({
141
141
  mode,
142
142
  deploy: await options.sdk._applyEngine.apply(options.spec, applyOpts),
143
- gitvault: null,
143
+ vault: null,
144
144
  });
145
145
  // A self-hosted Core gateway has no vault gate; never spend a round trip.
146
146
  if (options.target === "core")
147
147
  return plain({ kind: "none", reason: "no_vault" });
148
- const record = await readVaultRecord(options.sdk.gitvault, options.spec.project_id);
148
+ const record = await readVaultRecord(options.sdk.repos, options.spec.project_id);
149
149
  if (!record)
150
150
  return plain({ kind: "none", reason: "policy_unreadable" });
151
- if (record.gitvault_policy === "grandfathered") {
151
+ if (record.vault_policy === "grandfathered") {
152
152
  return plain({ kind: "grandfathered", repo_id: record.repo_id });
153
153
  }
154
- if (record.gitvault_policy !== "required") {
155
- // D3: allocation no longer sets `gitvault_policy`, so a vault whose
154
+ if (record.vault_policy !== "required") {
155
+ // D3: allocation no longer sets `vault_policy`, so a vault whose
156
156
  // policy is `null` is the ORDINARY shape, not a weakened one — the
157
157
  // deploy is never blocked or interactively prompted on this. It still
158
- // runs the untouched plain path (same options object, no gitvault hooks);
158
+ // runs the untouched plain path (same options object, no vault hooks);
159
159
  // the only difference from `grandfathered` is that the result carries an
160
160
  // offer to gate, plus a standing warning naming the drift until the
161
161
  // policy is set either way (spec scenario "Ungated drift stays visible").
162
162
  const deploy = await options.sdk._applyEngine.apply(options.spec, applyOpts);
163
- return { mode: { kind: "ungated", repo_id: record.repo_id }, deploy: decorateUngatedResult(deploy, record.repo_id), gitvault: null };
163
+ return { mode: { kind: "ungated", repo_id: record.repo_id }, deploy: decorateUngatedResult(deploy, record.repo_id), vault: null };
164
164
  }
165
165
  const lane = createApplyDeployLane({ engine: options.sdk._applyEngine, spec: options.spec, apply: applyOpts });
166
- let gitvault;
166
+ let vault;
167
167
  try {
168
- gitvault = await options.sdk.gitvault.deploy({
168
+ vault = await options.sdk.repos.deploy({
169
169
  lane,
170
170
  repo_id: record.repo_id,
171
171
  repo_dir: options.repo_dir ?? process.cwd(),
@@ -185,9 +185,9 @@ export async function applyWithGitvault(options) {
185
185
  throw enrichCaptureRefusal(err, record.repo_id);
186
186
  }
187
187
  finally {
188
- lane.abandon(new LocalError("the deploy ended without committing this plan", "committing gitvault deploy", { code: "GITVAULT_DEPLOY_ABANDONED" }));
188
+ lane.abandon(new LocalError("the deploy ended without committing this plan", "committing vault deploy", { code: "VAULT_DEPLOY_ABANDONED" }));
189
189
  }
190
- return { mode: { kind: "vaulted", repo_id: record.repo_id }, deploy: lane.result(), gitvault };
190
+ return { mode: { kind: "vaulted", repo_id: record.repo_id }, deploy: lane.result(), vault };
191
191
  }
192
192
  /**
193
193
  * Read the vault record, or `null` when it cannot be read.
@@ -197,9 +197,9 @@ export async function applyWithGitvault(options) {
197
197
  * genuinely required. Turning a transient control-plane blip into a failed
198
198
  * deploy for a project that has no vault at all would be the worse trade.
199
199
  */
200
- async function readVaultRecord(gitvault, projectId) {
200
+ async function readVaultRecord(repos, projectId) {
201
201
  try {
202
- return await gitvault.forProject(projectId);
202
+ return await repos.forProject(projectId);
203
203
  }
204
204
  catch {
205
205
  return null;
@@ -208,23 +208,23 @@ async function readVaultRecord(gitvault, projectId) {
208
208
  /**
209
209
  * A `required` project whose keystore this machine does not hold cannot
210
210
  * capture. The protocol's own code is PRESERVED (`KEYSTORE_MISSING` /
211
- * `GITVAULT_REPO_STATE_MISSING` — surfacing the typed outcome rather than
211
+ * `VAULT_REPO_STATE_MISSING` — surfacing the typed outcome rather than
212
212
  * substituting one), with actions prepended that actually resolve it.
213
213
  */
214
214
  function enrichCaptureRefusal(err, repoId) {
215
215
  if (!isRun402Error(err))
216
216
  return err;
217
217
  const e = err;
218
- if (e.code !== "KEYSTORE_MISSING" && e.code !== "GITVAULT_REPO_STATE_MISSING")
218
+ if (e.code !== "KEYSTORE_MISSING" && e.code !== "VAULT_REPO_STATE_MISSING")
219
219
  return err;
220
- return new LocalError(`${e.message} — this project's gitvault_policy is \`required\`, so a deploy from this machine needs the vault keystore`, "capturing for a gitvault-required deploy", {
220
+ return new LocalError(`${e.message} — this project's vault_policy is \`required\`, so a deploy from this machine needs the vault keystore`, "capturing for a vault-required deploy", {
221
221
  code: e.code,
222
222
  details: { repo_id: repoId, ...(e.details && typeof e.details === "object" ? e.details : {}) },
223
223
  next_actions: [
224
- { action: "restore the gitvault keystore onto this machine (run402 repos view prints keystore.root; back it up from the machine that holds it)" },
224
+ { action: "restore the vault keystore onto this machine (run402 repos view prints keystore.root; back it up from the machine that holds it)" },
225
225
  { action: 'run402 repos policy grandfathered --reason "<why>" — un-gate the project so deploys activate without a capture (owner + step-up, audited, doctor-persistent advisory)' },
226
226
  ...(Array.isArray(e.next_actions) ? e.next_actions : []),
227
227
  ],
228
228
  });
229
229
  }
230
- //# sourceMappingURL=gitvault-apply.js.map
230
+ //# sourceMappingURL=vault-apply.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vault-apply.js","sourceRoot":"","sources":["../../src/node/vault-apply.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,UAAU,EAAE,aAAa,EAAmB,MAAM,cAAc,CAAC;AA2B1E,SAAS,QAAQ;IACf,IAAI,OAA4B,CAAC;IACjC,IAAI,MAAkC,CAAC;IACvC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAI,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,GAAG,OAAO,GAAG,GAAG,CAAC,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/E,6EAA6E;IAC7E,6EAA6E;IAC7E,2CAA2C;IAC3C,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IAC/B,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AACtC,CAAC;AAqBD,MAAM,UAAU,qBAAqB,CAAC,OAA+B;IACnE,MAAM,OAAO,GAAG,QAAQ,EAAuB,CAAC;IAChD,MAAM,UAAU,GAAG,QAAQ,EAA0B,CAAC;IACtD,IAAI,YAAY,GAAiC,IAAI,CAAC;IACtD,IAAI,MAAM,GAAwB,IAAI,CAAC;IACvC,IAAI,OAAO,GAAG,KAAK,CAAC;IAEpB,MAAM,IAAI,GAAoB;QAC5B,KAAK,CAAC,IAAI,CAAC,KAAK;YACd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keystore.js";
2
+ import type { VaultMirrorCredential, VaultMirrorDestination } from "./vault-mirror-config.js";
3
+ /** `byo/<repo_id>.json` — where THIS machine writes a BYO vault's payload objects, and which credential NAME resolves it at use time. */
4
+ export interface VaultByoConfig {
5
+ version: 1;
6
+ repo_id: string;
7
+ destination: VaultMirrorDestination;
8
+ /** Present only for an `s3` destination — a directory destination needs no credential. */
9
+ credential?: VaultMirrorCredential;
10
+ created_at: string;
11
+ updated_at: string;
12
+ }
13
+ export declare function byoConfigDir(keystore: VaultKeystore): string;
14
+ export declare function byoConfigPath(keystore: VaultKeystore, repoId: string): string;
15
+ /** Read the local BYO write-credential config for one vault, or `null` when none is configured on this machine. */
16
+ export declare function readByoConfig(keystore: VaultKeystore, repoId: string): VaultByoConfig | null;
17
+ /** Every repo id with a local BYO write config on this machine. */
18
+ export declare function listByoConfiguredRepoIds(keystore: VaultKeystore): string[];
19
+ /** Set (create or replace) the local BYO write-credential config for one vault. */
20
+ export declare function saveByoConfig(keystore: VaultKeystore, input: {
21
+ repo_id: string;
22
+ destination: VaultMirrorDestination;
23
+ credential?: VaultMirrorCredential;
24
+ }, now?: () => Date): VaultByoConfig;
25
+ /** Remove the local BYO write-credential config for one vault. Never touches the customer bucket's own bytes — this only stops THIS machine from writing/reading it as the vault's primary destination. */
26
+ export declare function removeByoConfig(keystore: VaultKeystore, repoId: string): {
27
+ removed: boolean;
28
+ };
29
+ //# sourceMappingURL=vault-byo-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vault-byo-config.d.ts","sourceRoot":"","sources":["../../src/node/vault-byo-config.ts"],"names":[],"mappings":"AA6BA,OAAO,EAAE,aAAa,EAAyC,MAAM,qBAAqB,CAAC;AAC3F,OAAO,KAAK,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAM9F,yIAAyI;AACzI,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,CAAC,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,sBAAsB,CAAC;IACpC,0FAA0F;IAC1F,UAAU,CAAC,EAAE,qBAAqB,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,CAE5D;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAG7E;AAED,mHAAmH;AACnH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAa5F;AAED,mEAAmE;AACnE,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,EAAE,CAQ1E;AAED,mFAAmF;AACnF,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,aAAa,EACvB,KAAK,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,sBAAsB,CAAC;IAAC,UAAU,CAAC,EAAE,qBAAqB,CAAA;CAAE,EACnG,GAAG,GAAE,MAAM,IAAuB,GACjC,cAAc,CAehB;AAED,2MAA2M;AAC3M,wBAAgB,eAAe,CAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAS7F"}
@@ -1,33 +1,33 @@
1
1
  /**
2
- * gitvault-byo-primary-bucket — local per-vault BYO credential config
3
- * (design D2, task 3.1/3.2). Parallels `gitvault-mirror-config.ts` exactly,
2
+ * vault-byo-primary-bucket — local per-vault BYO credential config
3
+ * (design D2, task 3.1/3.2). Parallels `vault-mirror-config.ts` exactly,
4
4
  * on purpose: same file shape, same "beside the keystore, never in
5
5
  * `run402.config.json`, never a raw secret value" reasoning.
6
6
  *
7
7
  * A BYO vault's `storage_profile`/`byo_destination` are recorded on the
8
8
  * GATEWAY's vault record (the destination ADDRESS only — see
9
- * `gitvault-creation-journal.ts`'s allocation request). This file carries
9
+ * `vault-creation-journal.ts`'s allocation request). This file carries
10
10
  * the ONE thing that must stay purely local, per D2: the credential NAME
11
11
  * (an AWS profile, or the ambient environment chain) that resolves to the
12
12
  * customer bucket's actual secret at USE time — resolved by
13
- * `gitvault-mirror-backend.ts`, never read or cached here, never
13
+ * `vault-mirror-backend.ts`, never read or cached here, never
14
14
  * transmitted to run402 in any request. The destination's `region`/
15
15
  * `endpoint` are ALSO local-only (the server-side address string carries
16
- * neither), so this config persists the full `GitvaultMirrorDestination`,
16
+ * neither), so this config persists the full `VaultMirrorDestination`,
17
17
  * not just the credential.
18
18
  *
19
19
  * Written once by `repos create --byo` (or, for a fresh machine re-linking
20
- * to an already-BYO vault, `Gitvault.byoConfigSet`), keyed by `repo_id` —
20
+ * to an already-BYO vault, `Repos.byoConfigSet`), keyed by `repo_id` —
21
21
  * `repo_id` only exists AFTER allocation, so this file's existence for a
22
22
  * given repo is itself the local "this machine can write this vault's
23
- * payload objects directly" fact `gitvault-mirror.ts`'s dual-push hook and
24
- * `gitvault-degraded-read.ts`'s fallback resolution both gate on.
23
+ * payload objects directly" fact `vault-mirror.ts`'s dual-push hook and
24
+ * `vault-degraded-read.ts`'s fallback resolution both gate on.
25
25
  */
26
26
  import { existsSync, readdirSync, unlinkSync } from "node:fs";
27
27
  import { join } from "node:path";
28
28
  import { LocalError } from "../errors.js";
29
- import { GITVAULT_SRC_RE } from "../namespaces/gitvault.crypto.js";
30
- import { readFileNoFollow, writeFileAtomic0600 } from "./gitvault-keystore.js";
29
+ import { VAULT_SRC_RE } from "../namespaces/vault.crypto.js";
30
+ import { readFileNoFollow, writeFileAtomic0600 } from "./vault-keystore.js";
31
31
  function fail(code, message, context, details, nextActions) {
32
32
  throw new LocalError(message, context, { code, details, ...(nextActions ? { next_actions: nextActions } : {}) });
33
33
  }
@@ -35,8 +35,8 @@ export function byoConfigDir(keystore) {
35
35
  return join(keystore.rootDir, "byo");
36
36
  }
37
37
  export function byoConfigPath(keystore, repoId) {
38
- if (!GITVAULT_SRC_RE.test(repoId))
39
- fail("GITVAULT_BAD_REPO_ID", `not a src_ id: ${repoId}`, "resolving gitvault byo config path");
38
+ if (!VAULT_SRC_RE.test(repoId))
39
+ fail("VAULT_BAD_REPO_ID", `not a src_ id: ${repoId}`, "resolving vault byo config path");
40
40
  return join(byoConfigDir(keystore), `${repoId}.json`);
41
41
  }
42
42
  /** Read the local BYO write-credential config for one vault, or `null` when none is configured on this machine. */
@@ -49,10 +49,10 @@ export function readByoConfig(keystore, repoId) {
49
49
  parsed = JSON.parse(text);
50
50
  }
51
51
  catch (e) {
52
- fail("GITVAULT_BYO_CONFIG_CORRUPT", `byo config for ${repoId} is not valid JSON: ${e.message}`, "reading gitvault byo config", { repo_id: repoId });
52
+ fail("VAULT_BYO_CONFIG_CORRUPT", `byo config for ${repoId} is not valid JSON: ${e.message}`, "reading vault byo config", { repo_id: repoId });
53
53
  }
54
54
  if (parsed.version !== 1 || parsed.repo_id !== repoId || !parsed.destination) {
55
- fail("GITVAULT_BYO_CONFIG_CORRUPT", `byo config for ${repoId} is not a version-1 gitvault byo config`, "reading gitvault byo config", { repo_id: repoId });
55
+ fail("VAULT_BYO_CONFIG_CORRUPT", `byo config for ${repoId} is not a version-1 vault byo config`, "reading vault byo config", { repo_id: repoId });
56
56
  }
57
57
  return parsed;
58
58
  }
@@ -64,13 +64,13 @@ export function listByoConfiguredRepoIds(keystore) {
64
64
  return readdirSync(dir)
65
65
  .filter((n) => n.endsWith(".json"))
66
66
  .map((n) => n.slice(0, -5))
67
- .filter((id) => GITVAULT_SRC_RE.test(id))
67
+ .filter((id) => VAULT_SRC_RE.test(id))
68
68
  .sort();
69
69
  }
70
70
  /** Set (create or replace) the local BYO write-credential config for one vault. */
71
71
  export function saveByoConfig(keystore, input, now = () => new Date()) {
72
72
  if (input.destination.kind === "s3" && !input.credential) {
73
- fail("GITVAULT_MIRROR_CREDENTIAL_REQUIRED", "an s3 byo destination needs a credential — pass --profile <name> or --ambient", "configuring gitvault byo credential");
73
+ fail("VAULT_MIRROR_CREDENTIAL_REQUIRED", "an s3 byo destination needs a credential — pass --profile <name> or --ambient", "configuring vault byo credential");
74
74
  }
75
75
  const existing = readByoConfig(keystore, input.repo_id);
76
76
  const full = {
@@ -93,8 +93,8 @@ export function removeByoConfig(keystore, repoId) {
93
93
  unlinkSync(path);
94
94
  }
95
95
  catch (e) {
96
- fail("GITVAULT_BYO_CONFIG_REMOVE_FAILED", `could not remove byo config for ${repoId}: ${e.message}`, "removing gitvault byo config", { repo_id: repoId });
96
+ fail("VAULT_BYO_CONFIG_REMOVE_FAILED", `could not remove byo config for ${repoId}: ${e.message}`, "removing vault byo config", { repo_id: repoId });
97
97
  }
98
98
  return { removed: true };
99
99
  }
100
- //# sourceMappingURL=gitvault-byo-config.js.map
100
+ //# sourceMappingURL=vault-byo-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vault-byo-config.js","sourceRoot":"","sources":["../../src/node/vault-byo-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAiB,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAG3F,SAAS,IAAI,CAAC,IAAY,EAAE,OAAe,EAAE,OAAe,EAAE,OAAiB,EAAE,WAAuB;IACtG,MAAM,IAAI,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC,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EAAE;QACvD,UAAU,EAAE,GAAG,EAAE,CAAC,WAAW,EAAE;KAChC,CAAC;IACF,mBAAmB,CAAC,aAAa,CAAC,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC3F,OAAO,IAAI,CAAC;AACd,CAAC;AAED,2MAA2M;AAC3M,MAAM,UAAU,eAAe,CAAC,QAAuB,EAAE,MAAc;IACrE,MAAM,IAAI,GAAG,aAAa,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC7C,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IACjD,IAAI,CAAC;QACH,UAAU,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,CAAC,gCAAgC,EAAE,mCAAmC,MAAM,KAAM,CAAW,CAAC,OAAO,EAAE,EAAE,2BAA2B,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IACjK,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC3B,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { VaultBucketProbeResult } from "./vault-mirror-backend.js";
2
+ import type { VaultMirrorCredential, VaultMirrorDestination } from "./vault-mirror-config.js";
3
+ /**
4
+ * The failing properties, named — never a bundled "the probe failed". Every
5
+ * entry maps 1:1 to one of {@link VaultBucketProbeResult}'s three
6
+ * booleans, so a caller (or a test) can assert on exactly what broke.
7
+ */
8
+ export declare function vaultByoProbeFailingProperties(result: VaultBucketProbeResult): string[];
9
+ /**
10
+ * `repos create --byo`'s pre-allocation gate: open a root-scoped backend at
11
+ * `destination` (no `repo_id` — the probe never collides with any vault's
12
+ * own `source/<repo_id>/` prefix, since it writes under `_byo-probe/`
13
+ * instead) and run {@link VaultMirrorBackend.probeWritePolicy}. A failed
14
+ * property (or a thrown transport error) refuses with
15
+ * `VAULT_BYO_BUCKET_PROBE_FAILED`, naming exactly which propert(y/ies)
16
+ * failed and the underlying fact — the caller MUST NOT proceed to
17
+ * allocation on a failed probe.
18
+ */
19
+ export declare function probeVaultByoDestination(destination: VaultMirrorDestination, credential?: VaultMirrorCredential): Promise<VaultBucketProbeResult>;
20
+ //# sourceMappingURL=vault-byo-probe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vault-byo-probe.d.ts","sourceRoot":"","sources":["../../src/node/vault-byo-probe.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAExE,OAAO,KAAK,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAO9F;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,sBAAsB,GAAG,MAAM,EAAE,CAMvF;AAED;;;;;;;;;GASG;AACH,wBAAsB,wBAAwB,CAAC,WAAW,EAAE,sBAAsB,EAAE,UAAU,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CA0BvJ"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * vault-byo-primary-bucket — the allocation-time bucket-policy probe
3
+ * (design D6, task 3.1). Runs BEFORE the allocation request ever reaches
4
+ * the gateway, against the DESTINATION's own root (no `repo_id` exists yet
5
+ * — allocation is what mints one) — so a failed probe means "no vault
6
+ * half-exists", never a partially-created one.
7
+ *
8
+ * Reuses the shipped mirror backend's SigV4 client — no second S3 client.
9
+ */
10
+ import { LocalError } from "../errors.js";
11
+ import { openVaultDestinationBackend } from "./vault-mirror-backend.js";
12
+ import { formatMirrorDestination } from "./vault-mirror-config.js";
13
+ function fail(code, message, context, details, nextActions) {
14
+ throw new LocalError(message, context, { code, details, ...(nextActions ? { next_actions: nextActions } : {}) });
15
+ }
16
+ /**
17
+ * The failing properties, named — never a bundled "the probe failed". Every
18
+ * entry maps 1:1 to one of {@link VaultBucketProbeResult}'s three
19
+ * booleans, so a caller (or a test) can assert on exactly what broke.
20
+ */
21
+ export function vaultByoProbeFailingProperties(result) {
22
+ const failing = [];
23
+ if (!result.write_permitted)
24
+ failing.push("write_permitted");
25
+ if (!result.create_only_honored)
26
+ failing.push("create_only_honored");
27
+ if (!result.versioning_off)
28
+ failing.push("versioning_off");
29
+ return failing;
30
+ }
31
+ /**
32
+ * `repos create --byo`'s pre-allocation gate: open a root-scoped backend at
33
+ * `destination` (no `repo_id` — the probe never collides with any vault's
34
+ * own `source/<repo_id>/` prefix, since it writes under `_byo-probe/`
35
+ * instead) and run {@link VaultMirrorBackend.probeWritePolicy}. A failed
36
+ * property (or a thrown transport error) refuses with
37
+ * `VAULT_BYO_BUCKET_PROBE_FAILED`, naming exactly which propert(y/ies)
38
+ * failed and the underlying fact — the caller MUST NOT proceed to
39
+ * allocation on a failed probe.
40
+ */
41
+ export async function probeVaultByoDestination(destination, credential) {
42
+ const backend = openVaultDestinationBackend(destination, credential);
43
+ let result;
44
+ try {
45
+ result = await backend.probeWritePolicy();
46
+ }
47
+ catch (e) {
48
+ const message = e instanceof Error ? e.message : String(e);
49
+ fail("VAULT_BYO_BUCKET_PROBE_FAILED", `the bucket-policy probe against ${formatMirrorDestination(destination)} failed before any property could be confirmed: ${message}`, "probing the BYO destination before allocation", { destination: formatMirrorDestination(destination), failing_properties: ["write_permitted", "create_only_honored", "versioning_off"] }, [{ action: "confirm the destination and credential are correct, and that the bucket policy grants PutObject + GetBucketVersioning to this credential, then retry" }]);
50
+ }
51
+ const failing = vaultByoProbeFailingProperties(result);
52
+ if (failing.length > 0) {
53
+ fail("VAULT_BYO_BUCKET_PROBE_FAILED", `${formatMirrorDestination(destination)} does not satisfy the BYO bucket-policy profile (versioning disabled, create-only if-none-match writes honored, write permitted) — failing: ${failing.join(", ")}${result.detail ? ` (${result.detail})` : ""}`, "probing the BYO destination before allocation", { destination: formatMirrorDestination(destination), failing_properties: failing, probe: result }, [{ action: "disable bucket versioning, confirm the bucket policy enforces s3:if-none-match create-only writes, and confirm PutObject is permitted for this credential, then retry" }]);
54
+ }
55
+ return result;
56
+ }
57
+ //# sourceMappingURL=vault-byo-probe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vault-byo-probe.js","sourceRoot":"","sources":["../../src/node/vault-byo-probe.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAExE,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,SAAS,IAAI,CAAC,IAAY,EAAE,OAAe,EAAE,OAAe,EAAE,OAAiB,EAAE,WAAuB;IACtG,MAAM,IAAI,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AACnH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,8BAA8B,CAAC,MAA8B;IAC3E,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,IAAI,CAAC,MAAM,CAAC,eAAe;QAAE,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IAC7D,IAAI,CAAC,MAAM,CAAC,mBAAmB;QAAE,OAAO,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;IACrE,IAAI,CAAC,MAAM,CAAC,cAAc;QAAE,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAC3D,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,WAAmC,EAAE,UAAkC;IACpH,MAAM,OAAO,GAAG,2BAA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