run402 4.155.1 → 4.156.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 (37) hide show
  1. package/cli.mjs +0 -6
  2. package/lib/admin.mjs +3 -3
  3. package/lib/billing.mjs +12 -12
  4. package/lib/buzz.mjs +7 -7
  5. package/lib/command-manifest.mjs +2 -2
  6. package/lib/contacts.mjs +73 -15
  7. package/lib/jobs.mjs +6 -6
  8. package/lib/repos.mjs +2 -2
  9. package/package.json +1 -1
  10. package/sdk/dist/namespaces/admin.d.ts +62 -27
  11. package/sdk/dist/namespaces/admin.d.ts.map +1 -1
  12. package/sdk/dist/namespaces/admin.js +48 -20
  13. package/sdk/dist/namespaces/admin.js.map +1 -1
  14. package/sdk/dist/namespaces/billing.d.ts +9 -9
  15. package/sdk/dist/namespaces/billing.d.ts.map +1 -1
  16. package/sdk/dist/namespaces/billing.js +26 -26
  17. package/sdk/dist/namespaces/billing.js.map +1 -1
  18. package/sdk/dist/namespaces/buzz.d.ts +5 -5
  19. package/sdk/dist/namespaces/buzz.d.ts.map +1 -1
  20. package/sdk/dist/namespaces/buzz.js +13 -13
  21. package/sdk/dist/namespaces/buzz.js.map +1 -1
  22. package/sdk/dist/namespaces/buzz.types.d.ts +3 -3
  23. package/sdk/dist/namespaces/buzz.types.d.ts.map +1 -1
  24. package/sdk/dist/namespaces/jobs.d.ts +7 -7
  25. package/sdk/dist/namespaces/jobs.d.ts.map +1 -1
  26. package/sdk/dist/namespaces/jobs.js +15 -13
  27. package/sdk/dist/namespaces/jobs.js.map +1 -1
  28. package/sdk/dist/namespaces/repos.d.ts +9 -8
  29. package/sdk/dist/namespaces/repos.d.ts.map +1 -1
  30. package/sdk/dist/namespaces/repos.js +14 -13
  31. package/sdk/dist/namespaces/repos.js.map +1 -1
  32. package/sdk/dist/secret-gate.d.ts +7 -3
  33. package/sdk/dist/secret-gate.d.ts.map +1 -1
  34. package/sdk/dist/secret-gate.js +7 -3
  35. package/sdk/dist/secret-gate.js.map +1 -1
  36. package/vault-surface.json +1 -1
  37. package/lib/webhook-secret.mjs +0 -52
@@ -99,17 +99,18 @@ function randomHandoffUuid() {
99
99
  * `org_id`, `project_id` (docs/style.md's API-boundary vocabulary) — on
100
100
  * BOTH the handoff mint (`POST /vaults/v1/:vault_id/handoffs`) and
101
101
  * claim (`POST /vaults/v1/handoffs/:handoff_id/redeem`) responses. The SDK
102
- * groups them under `vault` with the `organization_id` spelling every other
103
- * SDK result uses. Neither response carries a slug-form address, so
102
+ * groups them under `vault`, renaming only `repo_id` to `vault_id`; the org
103
+ * stays `org_id`, as at every Run402 API boundary. Neither response carries
104
+ * a slug-form address, so
104
105
  * `address` is `null` unless the caller already knows one (a slug-form
105
106
  * remote at mint time). Pure; exported for tests.
106
107
  */
107
108
  export function handoffVaultFromWire(wire, address = null) {
108
- return { vault_id: wire.repo_id, address, organization_id: wire.org_id, project_id: wire.project_id };
109
+ return { vault_id: wire.repo_id, address, org_id: wire.org_id, project_id: wire.project_id };
109
110
  }
110
- /** The redeem response's `membership` block (`org_id` on the wire) in the SDK's `organization_id` spelling. Pure; exported for tests. */
111
+ /** The redeem response's `membership` block, `org_id` kept as the wire spells it. Pure; exported for tests. */
111
112
  export function handoffMembershipFromWire(wire) {
112
- return { organization_id: wire.org_id, role: wire.role, status: wire.status };
113
+ return { org_id: wire.org_id, role: wire.role, status: wire.status };
113
114
  }
114
115
  // ─── Invite / join result shapes (kygit-invite design D4/D5/D9) ─────────────
115
116
  /**
@@ -2042,7 +2043,7 @@ export class Repos {
2042
2043
  minted_role: response.role,
2043
2044
  expires_at: response.expires_at,
2044
2045
  vault: handoffVaultFromWire(response, options.address && vaultRemoteAddressForm(options.address) === "slug" ? `${options.address.org_id}/${options.address.project_id}` : null),
2045
- room: { organization_id: response.room?.org_id ?? repoFile.org_id, room_key: response.room?.room_key ?? roomKey },
2046
+ room: { org_id: response.room?.org_id ?? repoFile.org_id, room_key: response.room?.room_key ?? roomKey },
2046
2047
  checkpoint: response.checkpoint,
2047
2048
  capture: {
2048
2049
  modified_captured: snapshot.modified_captured.length,
@@ -2236,7 +2237,7 @@ export class Repos {
2236
2237
  const myWriterKeyId = identity.signing_fingerprint;
2237
2238
  keystore.saveRepo({
2238
2239
  repo_id: vault.vault_id,
2239
- org_id: vault.organization_id,
2240
+ org_id: vault.org_id,
2240
2241
  project_id: vault.project_id ?? "",
2241
2242
  k_repo_hex: payload.k_e_hex,
2242
2243
  epoch: payload.epoch,
@@ -2251,7 +2252,7 @@ export class Repos {
2251
2252
  });
2252
2253
  const targetDir = resolveResumeTargetDir(options.to, vault.address, vault.vault_id);
2253
2254
  options.onLine?.(`resuming into ${targetDir}`);
2254
- const remoteUrl = vaultRemoteUrl(vault.organization_id, vault.project_id);
2255
+ const remoteUrl = vaultRemoteUrl(vault.org_id, vault.project_id);
2255
2256
  await cloneVaultRemote(remoteUrl, targetDir);
2256
2257
  // A vault with no branch heads clones empty; bring the checkpoint in now,
2257
2258
  // before anything is activated, so a missing commit fails cleanly.
@@ -2261,7 +2262,7 @@ export class Repos {
2261
2262
  // vault resolution path uses, which also writes `r402.room`.
2262
2263
  const { pinVaultRepo } = await this.#address();
2263
2264
  const addressParts = vault.address ? vault.address.split("/") : null;
2264
- await pinVaultRepo(targetDir, vault.vault_id, addressParts && addressParts.length === 2 ? { org_slug: addressParts[0], repo_name: addressParts[1] } : undefined, { project_id: vault.project_id, org_id: vault.organization_id });
2265
+ await pinVaultRepo(targetDir, vault.vault_id, addressParts && addressParts.length === 2 ? { org_slug: addressParts[0], repo_name: addressParts[1] } : undefined, { project_id: vault.project_id, org_id: vault.org_id });
2265
2266
  // kygit-invite design D5: restore is kind-agnostic, so the same
2266
2267
  // `.git/info/exclude` write `join` performs happens on `resume` too —
2267
2268
  // best-effort, never a `resume()` throw.
@@ -2481,7 +2482,7 @@ export class Repos {
2481
2482
  const myWriterKeyId = identity.signing_fingerprint;
2482
2483
  keystore.saveRepo({
2483
2484
  repo_id: vault.vault_id,
2484
- org_id: vault.organization_id,
2485
+ org_id: vault.org_id,
2485
2486
  project_id: vault.project_id ?? "",
2486
2487
  k_repo_hex: payload.k_e_hex,
2487
2488
  epoch: payload.epoch,
@@ -2494,7 +2495,7 @@ export class Repos {
2494
2495
  });
2495
2496
  const targetDir = resolveResumeTargetDir(options.to, vault.address, vault.vault_id);
2496
2497
  options.onLine?.(`joining into ${targetDir}`);
2497
- const remoteUrl = vaultRemoteUrl(vault.organization_id, vault.project_id);
2498
+ const remoteUrl = vaultRemoteUrl(vault.org_id, vault.project_id);
2498
2499
  await cloneVaultRemote(remoteUrl, targetDir);
2499
2500
  // A vault with no branch heads clones empty; bring the checkpoint in now,
2500
2501
  // before anything is activated, so a missing commit fails cleanly.
@@ -2508,7 +2509,7 @@ export class Repos {
2508
2509
  // resolution path uses, this time with the invite's OWN room key.
2509
2510
  const { pinVaultRepo } = await this.#address();
2510
2511
  const addressParts = vault.address ? vault.address.split("/") : null;
2511
- await pinVaultRepo(targetDir, vault.vault_id, addressParts && addressParts.length === 2 ? { org_slug: addressParts[0], repo_name: addressParts[1] } : undefined, { project_id: vault.project_id, org_id: vault.organization_id, room_key: roomKey });
2512
+ await pinVaultRepo(targetDir, vault.vault_id, addressParts && addressParts.length === 2 ? { org_slug: addressParts[0], repo_name: addressParts[1] } : undefined, { project_id: vault.project_id, org_id: vault.org_id, room_key: roomKey });
2512
2513
  // design D5/D9 risk list: `.git/info/exclude` rather than `.gitignore`
2513
2514
  // — the ignore file is part of the captured tree and touching it would
2514
2515
  // break exact-state on the first `git status`. Best-effort.
@@ -2675,7 +2676,7 @@ export class Repos {
2675
2676
  restored: { dir: targetDir, branch: restored.branch, base_head_oid: restored.base_head_oid, stash_oid: restored.stash_oid },
2676
2677
  membership: handoffMembershipFromWire(redeem.membership),
2677
2678
  members: redeem.members ?? [],
2678
- room: { organization_id: redeem.room?.org_id ?? redeem.org_id, room_key: roomKey },
2679
+ room: { org_id: redeem.room?.org_id ?? redeem.org_id, room_key: roomKey },
2679
2680
  inviter: redeem.inviter ?? null,
2680
2681
  presence: myPresence,
2681
2682
  presence_failure: presenceFailure,