@run402/sdk 4.93.2 → 4.95.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 (225) hide show
  1. package/README.md +40 -38
  2. package/core-dist/config.d.ts +16 -2
  3. package/core-dist/config.js +52 -18
  4. package/core-dist/control-plane-session.d.ts +29 -14
  5. package/core-dist/control-plane-session.js +31 -6
  6. package/core-dist/keystore.js +7 -7
  7. package/core-dist/profiles.d.ts +3 -3
  8. package/core-dist/profiles.js +9 -7
  9. package/core-dist/{allowance-auth.d.ts → wallet-auth.d.ts} +6 -6
  10. package/core-dist/{allowance-auth.js → wallet-auth.js} +15 -15
  11. package/core-dist/wallet.d.ts +22 -0
  12. package/core-dist/{allowance.js → wallet.js} +20 -20
  13. package/core-dist/{write-auth-session.d.ts → write-approvals.d.ts} +28 -26
  14. package/core-dist/{write-auth-session.js → write-approvals.js} +19 -19
  15. package/dist/actions.d.ts +4 -4
  16. package/dist/actions.d.ts.map +1 -1
  17. package/dist/app-up.d.ts +2 -2
  18. package/dist/app-up.d.ts.map +1 -1
  19. package/dist/config.d.ts +1 -2
  20. package/dist/config.d.ts.map +1 -1
  21. package/dist/config.js.map +1 -1
  22. package/dist/control-plane-credentials.d.ts +8 -8
  23. package/dist/control-plane-credentials.js +7 -7
  24. package/dist/credentials.d.ts +20 -20
  25. package/dist/credentials.d.ts.map +1 -1
  26. package/dist/credentials.js +1 -1
  27. package/dist/errors.d.ts +26 -28
  28. package/dist/errors.d.ts.map +1 -1
  29. package/dist/errors.js +35 -38
  30. package/dist/errors.js.map +1 -1
  31. package/dist/index.d.ts +29 -16
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +30 -17
  34. package/dist/index.js.map +1 -1
  35. package/dist/kernel.d.ts +1 -1
  36. package/dist/kernel.d.ts.map +1 -1
  37. package/dist/kernel.js +10 -9
  38. package/dist/kernel.js.map +1 -1
  39. package/dist/namespaces/admin.d.ts +52 -121
  40. package/dist/namespaces/admin.d.ts.map +1 -1
  41. package/dist/namespaces/admin.js +41 -45
  42. package/dist/namespaces/admin.js.map +1 -1
  43. package/dist/namespaces/agent.d.ts +2 -2
  44. package/dist/namespaces/agent.d.ts.map +1 -1
  45. package/dist/namespaces/agent.js +2 -2
  46. package/dist/namespaces/agent.js.map +1 -1
  47. package/dist/namespaces/ai.d.ts +2 -2
  48. package/dist/namespaces/ai.js +3 -3
  49. package/dist/namespaces/ai.js.map +1 -1
  50. package/dist/namespaces/assets.js +1 -1
  51. package/dist/namespaces/assets.js.map +1 -1
  52. package/dist/namespaces/billing.d.ts +6 -3
  53. package/dist/namespaces/billing.d.ts.map +1 -1
  54. package/dist/namespaces/billing.js.map +1 -1
  55. package/dist/namespaces/buzz-notifications.types.d.ts +1 -1
  56. package/dist/namespaces/buzz.d.ts +2 -2
  57. package/dist/namespaces/buzz.d.ts.map +1 -1
  58. package/dist/namespaces/buzz.js +2 -2
  59. package/dist/namespaces/buzz.js.map +1 -1
  60. package/dist/namespaces/buzz.types.d.ts +2 -2
  61. package/dist/namespaces/buzz.types.d.ts.map +1 -1
  62. package/dist/namespaces/ci.js +3 -3
  63. package/dist/namespaces/ci.js.map +1 -1
  64. package/dist/namespaces/credentials.types.d.ts +1 -1
  65. package/dist/namespaces/deploy.d.ts +1 -1
  66. package/dist/namespaces/deploy.d.ts.map +1 -1
  67. package/dist/namespaces/deploy.js +31 -32
  68. package/dist/namespaces/deploy.js.map +1 -1
  69. package/dist/namespaces/deploy.types.d.ts +6 -6
  70. package/dist/namespaces/deploy.types.d.ts.map +1 -1
  71. package/dist/namespaces/domains.d.ts +10 -2
  72. package/dist/namespaces/domains.d.ts.map +1 -1
  73. package/dist/namespaces/domains.js +10 -5
  74. package/dist/namespaces/domains.js.map +1 -1
  75. package/dist/namespaces/errors.js +1 -1
  76. package/dist/namespaces/escalations.d.ts +1 -1
  77. package/dist/namespaces/escalations.js +1 -1
  78. package/dist/namespaces/escalations.types.d.ts +2 -2
  79. package/dist/namespaces/escalations.types.d.ts.map +1 -1
  80. package/dist/namespaces/events.types.d.ts +1 -1
  81. package/dist/namespaces/functions.d.ts +1 -1
  82. package/dist/namespaces/functions.js +2 -2
  83. package/dist/namespaces/functions.js.map +1 -1
  84. package/dist/namespaces/gitvault.crypto.d.ts +1 -1
  85. package/dist/namespaces/gitvault.d.ts +26 -26
  86. package/dist/namespaces/gitvault.d.ts.map +1 -1
  87. package/dist/namespaces/gitvault.js +113 -113
  88. package/dist/namespaces/gitvault.js.map +1 -1
  89. package/dist/namespaces/me.d.ts +120 -0
  90. package/dist/namespaces/me.d.ts.map +1 -0
  91. package/dist/namespaces/me.js +34 -0
  92. package/dist/namespaces/me.js.map +1 -0
  93. package/dist/namespaces/org.d.ts +108 -6
  94. package/dist/namespaces/org.d.ts.map +1 -1
  95. package/dist/namespaces/org.js +63 -7
  96. package/dist/namespaces/org.js.map +1 -1
  97. package/dist/namespaces/org.types.d.ts +29 -9
  98. package/dist/namespaces/org.types.d.ts.map +1 -1
  99. package/dist/namespaces/pay.js +3 -3
  100. package/dist/namespaces/pay.js.map +1 -1
  101. package/dist/namespaces/projects.d.ts +9 -9
  102. package/dist/namespaces/projects.js +15 -15
  103. package/dist/namespaces/projects.js.map +1 -1
  104. package/dist/namespaces/projects.types.d.ts +28 -12
  105. package/dist/namespaces/projects.types.d.ts.map +1 -1
  106. package/dist/namespaces/rooms.d.ts +7 -7
  107. package/dist/namespaces/rooms.js +17 -17
  108. package/dist/namespaces/rooms.js.map +1 -1
  109. package/dist/namespaces/rooms.types.d.ts +9 -9
  110. package/dist/namespaces/rooms.types.d.ts.map +1 -1
  111. package/dist/namespaces/service.d.ts +1 -1
  112. package/dist/namespaces/service.js +1 -1
  113. package/dist/namespaces/{operator-session.d.ts → session.d.ts} +135 -51
  114. package/dist/namespaces/session.d.ts.map +1 -0
  115. package/dist/namespaces/{operator-session.js → session.js} +118 -30
  116. package/dist/namespaces/session.js.map +1 -0
  117. package/dist/namespaces/subdomains.d.ts +5 -5
  118. package/dist/namespaces/subdomains.d.ts.map +1 -1
  119. package/dist/namespaces/subdomains.js +6 -6
  120. package/dist/namespaces/subdomains.js.map +1 -1
  121. package/dist/namespaces/tier.d.ts +44 -21
  122. package/dist/namespaces/tier.d.ts.map +1 -1
  123. package/dist/namespaces/tier.js +7 -7
  124. package/dist/namespaces/tier.js.map +1 -1
  125. package/dist/namespaces/transfers.d.ts +119 -85
  126. package/dist/namespaces/transfers.d.ts.map +1 -1
  127. package/dist/namespaces/transfers.js +31 -38
  128. package/dist/namespaces/transfers.js.map +1 -1
  129. package/dist/namespaces/vouchers.d.ts +9 -10
  130. package/dist/namespaces/vouchers.d.ts.map +1 -1
  131. package/dist/namespaces/vouchers.js +4 -5
  132. package/dist/namespaces/vouchers.js.map +1 -1
  133. package/dist/namespaces/wallets.d.ts +72 -3
  134. package/dist/namespaces/wallets.d.ts.map +1 -1
  135. package/dist/namespaces/wallets.js +141 -3
  136. package/dist/namespaces/wallets.js.map +1 -1
  137. package/dist/namespaces/write-approval.d.ts +101 -0
  138. package/dist/namespaces/write-approval.d.ts.map +1 -0
  139. package/dist/namespaces/write-approval.js +62 -0
  140. package/dist/namespaces/write-approval.js.map +1 -0
  141. package/dist/node/actions-node.d.ts +3 -3
  142. package/dist/node/actions-node.d.ts.map +1 -1
  143. package/dist/node/actions-node.js +44 -44
  144. package/dist/node/actions-node.js.map +1 -1
  145. package/dist/node/assets-node.js +6 -6
  146. package/dist/node/assets-node.js.map +1 -1
  147. package/dist/node/{bearer-claim-key.d.ts → bearer-redeem-key.d.ts} +12 -12
  148. package/dist/node/bearer-redeem-key.d.ts.map +1 -0
  149. package/dist/node/{bearer-claim-key.js → bearer-redeem-key.js} +21 -21
  150. package/dist/node/bearer-redeem-key.js.map +1 -0
  151. package/dist/node/ci.d.ts +1 -1
  152. package/dist/node/ci.d.ts.map +1 -1
  153. package/dist/node/ci.js +6 -6
  154. package/dist/node/ci.js.map +1 -1
  155. package/dist/node/credentials.d.ts +18 -17
  156. package/dist/node/credentials.d.ts.map +1 -1
  157. package/dist/node/credentials.js +29 -28
  158. package/dist/node/credentials.js.map +1 -1
  159. package/dist/node/deploy-manifest.d.ts +3 -5
  160. package/dist/node/deploy-manifest.d.ts.map +1 -1
  161. package/dist/node/deploy-manifest.js +3 -12
  162. package/dist/node/deploy-manifest.js.map +1 -1
  163. package/dist/node/funding-recovery.d.ts +1 -1
  164. package/dist/node/funding-recovery.d.ts.map +1 -1
  165. package/dist/node/funding-recovery.js +1 -1
  166. package/dist/node/funding-recovery.js.map +1 -1
  167. package/dist/node/gitvault-apply.d.ts +1 -1
  168. package/dist/node/gitvault-apply.d.ts.map +1 -1
  169. package/dist/node/gitvault-apply.js +1 -1
  170. package/dist/node/gitvault-apply.js.map +1 -1
  171. package/dist/node/gitvault-handoff.d.ts +22 -22
  172. package/dist/node/gitvault-handoff.d.ts.map +1 -1
  173. package/dist/node/gitvault-handoff.js +45 -45
  174. package/dist/node/gitvault-handoff.js.map +1 -1
  175. package/dist/node/gitvault-prewarm.js +7 -7
  176. package/dist/node/gitvault-prewarm.js.map +1 -1
  177. package/dist/node/gitvault-restore.d.ts +1 -1
  178. package/dist/node/gitvault-restore.js +1 -1
  179. package/dist/node/index.d.ts +16 -16
  180. package/dist/node/index.d.ts.map +1 -1
  181. package/dist/node/index.js +15 -15
  182. package/dist/node/index.js.map +1 -1
  183. package/dist/node/manifest-export.js +2 -2
  184. package/dist/node/manifest-export.js.map +1 -1
  185. package/dist/node/org-adopt.d.ts +49 -0
  186. package/dist/node/org-adopt.d.ts.map +1 -0
  187. package/dist/node/org-adopt.js +77 -0
  188. package/dist/node/org-adopt.js.map +1 -0
  189. package/dist/node/paid-fetch.d.ts +7 -7
  190. package/dist/node/paid-fetch.d.ts.map +1 -1
  191. package/dist/node/paid-fetch.js +54 -54
  192. package/dist/node/paid-fetch.js.map +1 -1
  193. package/dist/node/preflight.d.ts +1 -1
  194. package/dist/node/preflight.d.ts.map +1 -1
  195. package/dist/node/preflight.js +1 -1
  196. package/dist/node/preflight.js.map +1 -1
  197. package/dist/node/sites-node.js +1 -1
  198. package/dist/node/sites-node.js.map +1 -1
  199. package/dist/node/source-scan.d.ts +1 -1
  200. package/dist/node/source-scan.js +2 -2
  201. package/dist/node/source-scan.js.map +1 -1
  202. package/dist/scoped.d.ts +11 -11
  203. package/dist/scoped.d.ts.map +1 -1
  204. package/dist/scoped.js +5 -5
  205. package/dist/scoped.js.map +1 -1
  206. package/package.json +1 -1
  207. package/core-dist/allowance.d.ts +0 -22
  208. package/core-dist/operator-session.d.ts +0 -80
  209. package/core-dist/operator-session.js +0 -154
  210. package/dist/namespaces/allowance.d.ts +0 -79
  211. package/dist/namespaces/allowance.d.ts.map +0 -1
  212. package/dist/namespaces/allowance.js +0 -149
  213. package/dist/namespaces/allowance.js.map +0 -1
  214. package/dist/namespaces/operator-session.d.ts.map +0 -1
  215. package/dist/namespaces/operator-session.js.map +0 -1
  216. package/dist/namespaces/operator.d.ts +0 -359
  217. package/dist/namespaces/operator.d.ts.map +0 -1
  218. package/dist/namespaces/operator.js +0 -272
  219. package/dist/namespaces/operator.js.map +0 -1
  220. package/dist/node/bearer-claim-key.d.ts.map +0 -1
  221. package/dist/node/bearer-claim-key.js.map +0 -1
  222. package/dist/node/operator-claim.d.ts +0 -49
  223. package/dist/node/operator-claim.d.ts.map +0 -1
  224. package/dist/node/operator-claim.js +0 -77
  225. package/dist/node/operator-claim.js.map +0 -1
@@ -246,7 +246,7 @@ export class Deploy {
246
246
  /**
247
247
  * Promote an existing release to be the project's current live release —
248
248
  * a pointer swap on `internal.projects.live_release_id` without re-running
249
- * the apply pipeline. Designed for operator recovery from a destructive
249
+ * the apply pipeline. Designed for recovery from a destructive
250
250
  * apply ("oops on a real project ID"). The prior release's bytes,
251
251
  * functions, and migrations remain persisted; this just routes traffic
252
252
  * back to them.
@@ -301,7 +301,7 @@ export class Deploy {
301
301
  context: "promoting release",
302
302
  headers: { "content-type": "application/json" },
303
303
  body: {
304
- project,
304
+ project_id: project,
305
305
  allow_warning_codes: allowCodes,
306
306
  },
307
307
  });
@@ -688,7 +688,7 @@ async function applyOnce(client, spec, opts, emit) {
688
688
  // event and resolve before we hit upload.
689
689
  }
690
690
  if (target === "core") {
691
- await uploadCoreContent(client, spec.project, byteReaders, emit);
691
+ await uploadCoreContent(client, spec.project_id, byteReaders, emit);
692
692
  emit({
693
693
  type: "commit.phase",
694
694
  phase: "validate",
@@ -696,13 +696,13 @@ async function applyOnce(client, spec, opts, emit) {
696
696
  ...(sliceKinds.length > 0 ? { slice_kinds: sliceKinds } : {}),
697
697
  });
698
698
  const planId = requirePlanId(plan, "applying deploy to Core");
699
- const commit = await commitInternal(client, planId, opts.idempotencyKey, spec.project, opts.requiredPlan);
699
+ const commit = await commitInternal(client, planId, opts.idempotencyKey, spec.project_id, opts.requiredPlan);
700
700
  if (!isCoreCommitResponse(commit)) {
701
- return await pollUntilReady(client, commit, plan.diff, plan.warnings, emit, spec.project, sliceKinds);
701
+ return await pollUntilReady(client, commit, plan.diff, plan.warnings, emit, spec.project_id, sliceKinds);
702
702
  }
703
- return await coreDeployResult(client, commit, plan.diff, plan.warnings, emit, spec.project, sliceKinds);
703
+ return await coreDeployResult(client, commit, plan.diff, plan.warnings, emit, spec.project_id, sliceKinds);
704
704
  }
705
- await uploadMissing(client, spec.project, plan.missing_content, byteReaders, emit);
705
+ await uploadMissing(client, spec.project_id, plan.missing_content, byteReaders, emit);
706
706
  emit({
707
707
  type: "commit.phase",
708
708
  phase: "validate",
@@ -717,7 +717,7 @@ async function applyOnce(client, spec, opts, emit) {
717
717
  // protect and commits directly. A passed rehearsal binds the commit to the
718
718
  // report's `required_plan` — unbound commits of rehearsed plans are
719
719
  // refused by the gateway.
720
- const rehearsal = await rehearseBeforeCommit(client, plan, planId, spec.project, opts, emit);
720
+ const rehearsal = await rehearseBeforeCommit(client, plan, planId, spec.project_id, opts, emit);
721
721
  const requiredPlan = rehearsal.requiredPlan ?? opts.requiredPlan;
722
722
  // gitvault §6.5 — the handshake. Content is uploaded, so the artifacts this
723
723
  // release ships are fixed; `authorize` verifies snapshot correspondence,
@@ -731,8 +731,8 @@ async function applyOnce(client, spec, opts, emit) {
731
731
  apply_plan_sha256: plan.gitvault?.apply_plan_sha256 ?? null,
732
732
  })
733
733
  : undefined;
734
- const commit = requireCloudCommitResponse(await commitInternal(client, planId, opts.idempotencyKey, spec.project, requiredPlan, gitvaultCommit), "applying deploy");
735
- const result = await pollUntilReady(client, commit, plan.diff, plan.warnings, emit, spec.project, sliceKinds);
734
+ const commit = requireCloudCommitResponse(await commitInternal(client, planId, opts.idempotencyKey, spec.project_id, requiredPlan, gitvaultCommit), "applying deploy");
735
+ const result = await pollUntilReady(client, commit, plan.diff, plan.warnings, emit, spec.project_id, sliceKinds);
736
736
  result.rehearsal = rehearsal.block;
737
737
  // v1.48 unified-apply: thread the plan response's `asset_entries[]` back
738
738
  // into DeployResult.assets so callers reading `result.assets.byKey[key]`
@@ -1110,7 +1110,7 @@ function i18nToWire(i18n) {
1110
1110
  }
1111
1111
  function releaseSpecToCoreSpec(spec) {
1112
1112
  return {
1113
- project: spec.project,
1113
+ project: spec.project_id,
1114
1114
  ...(spec.base !== undefined ? { base: spec.base } : {}),
1115
1115
  ...(spec.database !== undefined ? { database: databaseToCoreSpec(spec.database) } : {}),
1116
1116
  ...(spec.secrets !== undefined ? { secrets: spec.secrets } : {}),
@@ -1125,7 +1125,7 @@ function releaseSpecToCoreSpec(spec) {
1125
1125
  }
1126
1126
  function releaseSpecToWire(spec) {
1127
1127
  return {
1128
- project_id: spec.project,
1128
+ project_id: spec.project_id,
1129
1129
  ...(spec.base !== undefined ? { base: spec.base } : {}),
1130
1130
  ...(spec.database !== undefined ? { database: databaseToWire(spec.database) } : {}),
1131
1131
  ...(spec.secrets !== undefined ? { secrets: spec.secrets } : {}),
@@ -1208,8 +1208,8 @@ async function planInternal(client, spec, idempotencyKey, opts = {}) {
1208
1208
  // can pick it up via `manifest_ref`. The body still carries a minimal
1209
1209
  // `spec` so the gateway has the project for auth + plan persistence.
1210
1210
  const manifestBytes = new TextEncoder().encode(JSON.stringify(wireSpec));
1211
- const ref = await uploadInlineCas(client, spec.project, manifestBytes, MANIFEST_CONTENT_TYPE);
1212
- body = { spec: { project_id: spec.project }, manifest_ref: contentRefToWire(ref) };
1211
+ const ref = await uploadInlineCas(client, spec.project_id, manifestBytes, MANIFEST_CONTENT_TYPE);
1212
+ body = { spec: { project_id: spec.project_id }, manifest_ref: contentRefToWire(ref) };
1213
1213
  if (idempotencyKey)
1214
1214
  body.idempotency_key = idempotencyKey;
1215
1215
  if (opts.gitvault)
@@ -1220,8 +1220,8 @@ async function planInternal(client, spec, idempotencyKey, opts = {}) {
1220
1220
  plan = withClientPlanWarnings(normalized, normalizePlanResponse(await client.request(dryRun ? "/apply/v1/plans?dry_run=true" : "/apply/v1/plans", {
1221
1221
  method: "POST",
1222
1222
  body,
1223
- // Operator-approval scope: deploying a release is `project.deploy` on this project.
1224
- authMeta: { method: "deploy.plan", capability: "project.deploy", target: { project_id: spec.project } },
1223
+ // Write-approval scope: deploying a release is `project.deploy` on this project.
1224
+ authMeta: { method: "deploy.plan", capability: "project.deploy", target: { project_id: spec.project_id } },
1225
1225
  context: "planning deploy",
1226
1226
  })));
1227
1227
  }
@@ -1402,7 +1402,7 @@ async function computeDesiredScheduledFunctionCount(client, spec) {
1402
1402
  }
1403
1403
  if (!functions.patch)
1404
1404
  return null;
1405
- const activeScheduled = await readActiveScheduledFunctionNames(client, spec.project);
1405
+ const activeScheduled = await readActiveScheduledFunctionNames(client, spec.project_id);
1406
1406
  if (!activeScheduled)
1407
1407
  return null;
1408
1408
  applyScheduledFunctionPatch(activeScheduled, functions.patch);
@@ -1603,7 +1603,7 @@ async function commitInternal(client, planId, idempotencyKey, project, requiredP
1603
1603
  return await client.request(`/apply/v1/plans/${encodeURIComponent(planId)}/commit`, {
1604
1604
  method: "POST",
1605
1605
  body,
1606
- // Operator-approval scope: committing a deploy is `project.deploy` on this project.
1606
+ // Write-approval scope: committing a deploy is `project.deploy` on this project.
1607
1607
  ...(project
1608
1608
  ? {
1609
1609
  authMeta: {
@@ -1862,7 +1862,7 @@ async function pollUntilReady(client, commit, diff, warnings, emit, projectId, s
1862
1862
  ...(commit.subdomain_bindings ? { subdomain_bindings: commit.subdomain_bindings } : {}),
1863
1863
  ...(commit.static_continuity ? { static_continuity: commit.static_continuity } : {}),
1864
1864
  ...(commit.edge ? { edge: commit.edge } : {}),
1865
- // The gateway's riders (poll / watch_errors / hand_to_operator) ride the
1865
+ // The gateway's riders (poll / watch_errors / hand_to_member) ride the
1866
1866
  // synchronous ready response and nowhere else — dropping them here is
1867
1867
  // how an agent never learns the offer existed (builder-promotion).
1868
1868
  ...(Array.isArray(commit.next_actions) && commit.next_actions.length > 0
@@ -1971,7 +1971,7 @@ async function pollSnapshotUntilReady(client, initial, diff, warnings, emit, pro
1971
1971
  ...(snapshot.edge ? { edge: snapshot.edge } : {}),
1972
1972
  // The gateway now attaches the same riders to a ready operation
1973
1973
  // snapshot as to a synchronous ready commit (poll / watch_errors /
1974
- // hand_to_operator) — pass them through exactly as the fast path does.
1974
+ // hand_to_member) — pass them through exactly as the fast path does.
1975
1975
  ...(Array.isArray(snapshot.next_actions) && snapshot.next_actions.length > 0
1976
1976
  ? { next_actions: snapshot.next_actions }
1977
1977
  : {}),
@@ -2093,7 +2093,7 @@ async function startInternal(client, spec, opts) {
2093
2093
  }
2094
2094
  const sliceKinds = deriveSliceKinds(spec);
2095
2095
  const resultPromise = (async () => {
2096
- await uploadMissing(client, spec.project, plan.missing_content, byteReaders, emit);
2096
+ await uploadMissing(client, spec.project_id, plan.missing_content, byteReaders, emit);
2097
2097
  emit({
2098
2098
  type: "commit.phase",
2099
2099
  phase: "validate",
@@ -2101,15 +2101,15 @@ async function startInternal(client, spec, opts) {
2101
2101
  ...(sliceKinds.length > 0 ? { slice_kinds: sliceKinds } : {}),
2102
2102
  });
2103
2103
  const { planId } = requirePersistedPlan(plan, "starting deploy");
2104
- const commit = requireCloudCommitResponse(await commitInternal(client, planId, opts.idempotencyKey, spec.project, opts.requiredPlan), "starting deploy");
2105
- return await pollUntilReady(client, commit, plan.diff, plan.warnings, emit, spec.project, sliceKinds);
2104
+ const commit = requireCloudCommitResponse(await commitInternal(client, planId, opts.idempotencyKey, spec.project_id, opts.requiredPlan), "starting deploy");
2105
+ return await pollUntilReady(client, commit, plan.diff, plan.warnings, emit, spec.project_id, sliceKinds);
2106
2106
  })();
2107
2107
  // Avoid an unhandled-rejection at construction time. Consumers must call
2108
2108
  // .result() to actually observe the error.
2109
2109
  resultPromise.catch(() => { });
2110
2110
  let snapshot = null;
2111
2111
  const { operationId } = requirePersistedPlan(plan, "starting deploy");
2112
- const startHeaders = await apikeyHeaders(client, spec.project);
2112
+ const startHeaders = await apikeyHeaders(client, spec.project_id);
2113
2113
  const fetchSnapshot = async () => {
2114
2114
  if (snapshot && TERMINAL_STATUSES.includes(snapshot.status))
2115
2115
  return snapshot;
@@ -2200,7 +2200,7 @@ async function startInternal(client, spec, opts) {
2200
2200
  }
2201
2201
  const RELEASE_SPEC_FIELDS = new Set([
2202
2202
  "$schema",
2203
- "project",
2203
+ "project_id",
2204
2204
  "base",
2205
2205
  "database",
2206
2206
  "secrets",
@@ -2282,16 +2282,15 @@ function validateSpec(spec) {
2282
2282
  }
2283
2283
  const raw = spec;
2284
2284
  validateKnownFields(raw, "spec", RELEASE_SPEC_FIELDS, {
2285
- project_id: "Use `project` in ReleaseSpec, or call `loadDeployManifest()` / `normalizeDeployManifest()` for MCP/CLI-style manifests.",
2286
2285
  subdomain: "Use `subdomains: { set: [name] }`.",
2287
2286
  });
2288
- if (!spec.project || typeof spec.project !== "string") {
2289
- throw new Run402DeployError("ReleaseSpec.project is required", {
2287
+ if (!spec.project_id || typeof spec.project_id !== "string") {
2288
+ throw new Run402DeployError("ReleaseSpec.project_id is required", {
2290
2289
  code: "INVALID_SPEC",
2291
2290
  phase: "validate",
2292
- resource: "spec.project",
2291
+ resource: "spec.project_id",
2293
2292
  retryable: false,
2294
- fix: { action: "set_field", path: "project" },
2293
+ fix: { action: "set_field", path: "project_id" },
2295
2294
  context: "validating spec",
2296
2295
  });
2297
2296
  }
@@ -3357,7 +3356,7 @@ async function normalizeReleaseSpec(client, spec, opts = {}) {
3357
3356
  };
3358
3357
  const rememberRelease = makeRemember("release");
3359
3358
  const rememberAsset = makeRemember("asset");
3360
- const normalized = { project: spec.project };
3359
+ const normalized = { project_id: spec.project_id };
3361
3360
  if (spec.base)
3362
3361
  normalized.base = spec.base;
3363
3362
  if (spec.subdomains)
@@ -3380,7 +3379,7 @@ async function normalizeReleaseSpec(client, spec, opts = {}) {
3380
3379
  db.zero_downtime = spec.database.zero_downtime;
3381
3380
  }
3382
3381
  if (spec.database.migrations && spec.database.migrations.length > 0) {
3383
- db.migrations = await Promise.all(spec.database.migrations.map(async (m) => normalizeMigration(client, spec.project, m, rememberRelease, opts)));
3382
+ db.migrations = await Promise.all(spec.database.migrations.map(async (m) => normalizeMigration(client, spec.project_id, m, rememberRelease, opts)));
3384
3383
  assertUniqueMigrationIds(db.migrations);
3385
3384
  }
3386
3385
  normalized.database = db;