run402 4.94.0 → 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 (131) hide show
  1. package/README.md +20 -20
  2. package/cli.mjs +7 -19
  3. package/gitvault-surface.json +2 -2
  4. package/lib/admin.mjs +5 -5
  5. package/lib/ai.mjs +5 -5
  6. package/lib/apps.mjs +9 -9
  7. package/lib/archives.mjs +371 -8
  8. package/lib/argparse.mjs +5 -5
  9. package/lib/assets.mjs +12 -12
  10. package/lib/auth.mjs +34 -34
  11. package/lib/branches.mjs +7 -7
  12. package/lib/buzz-doctor.mjs +1 -1
  13. package/lib/buzz-notifications.mjs +4 -4
  14. package/lib/buzz.mjs +2 -2
  15. package/lib/cache.mjs +1 -1
  16. package/lib/cdn.mjs +2 -2
  17. package/lib/ci.mjs +8 -8
  18. package/lib/claims.mjs +2 -2
  19. package/lib/command-manifest.mjs +35 -36
  20. package/lib/config.mjs +4 -4
  21. package/lib/contacts.mjs +3 -3
  22. package/lib/contracts.mjs +11 -11
  23. package/lib/credentials.mjs +31 -31
  24. package/lib/delegates.mjs +13 -13
  25. package/lib/deliveries.mjs +2 -2
  26. package/lib/deploy-v2.mjs +9 -9
  27. package/lib/dev.mjs +3 -3
  28. package/lib/doctor.mjs +6 -6
  29. package/lib/domains.mjs +27 -27
  30. package/lib/email.mjs +38 -38
  31. package/lib/errors.mjs +40 -24
  32. package/lib/escalations.mjs +4 -4
  33. package/lib/events.mjs +32 -25
  34. package/lib/feedback.mjs +2 -2
  35. package/lib/functions.mjs +34 -34
  36. package/lib/gitvault-scaffold.mjs +2 -2
  37. package/lib/gitvault.mjs +2 -2
  38. package/lib/grants.mjs +7 -7
  39. package/lib/image.mjs +7 -7
  40. package/lib/init.mjs +3 -3
  41. package/lib/jobs.mjs +15 -15
  42. package/lib/live.mjs +1 -1
  43. package/lib/logs.mjs +8 -8
  44. package/lib/messages.mjs +5 -5
  45. package/lib/next-actions.mjs +1 -1
  46. package/lib/org-context.mjs +13 -13
  47. package/lib/{org.mjs → orgs.mjs} +124 -163
  48. package/lib/projects.mjs +45 -56
  49. package/lib/repos.mjs +23 -23
  50. package/lib/rooms.mjs +2 -2
  51. package/lib/sdk-errors.mjs +1 -1
  52. package/lib/secrets.mjs +13 -13
  53. package/lib/sites.mjs +14 -14
  54. package/lib/snapshots.mjs +10 -10
  55. package/lib/subdomains.mjs +12 -12
  56. package/lib/subscriptions.mjs +2 -2
  57. package/lib/transfer.mjs +1 -1
  58. package/lib/up.mjs +7 -7
  59. package/lib/wallet-context.mjs +1 -1
  60. package/lib/wallets.mjs +1 -1
  61. package/lib/webhooks.mjs +8 -8
  62. package/lib/whoami.mjs +32 -5
  63. package/package.json +1 -1
  64. package/sdk/dist/actions.d.ts +3 -3
  65. package/sdk/dist/actions.d.ts.map +1 -1
  66. package/sdk/dist/app-up.d.ts +2 -2
  67. package/sdk/dist/app-up.d.ts.map +1 -1
  68. package/sdk/dist/config.d.ts +1 -2
  69. package/sdk/dist/config.d.ts.map +1 -1
  70. package/sdk/dist/config.js.map +1 -1
  71. package/sdk/dist/credentials.d.ts +1 -1
  72. package/sdk/dist/errors.d.ts +2 -2
  73. package/sdk/dist/errors.d.ts.map +1 -1
  74. package/sdk/dist/errors.js +1 -1
  75. package/sdk/dist/errors.js.map +1 -1
  76. package/sdk/dist/index.js +1 -1
  77. package/sdk/dist/index.js.map +1 -1
  78. package/sdk/dist/namespaces/admin.d.ts +1 -1
  79. package/sdk/dist/namespaces/admin.d.ts.map +1 -1
  80. package/sdk/dist/namespaces/ai.d.ts +1 -1
  81. package/sdk/dist/namespaces/ai.js +2 -2
  82. package/sdk/dist/namespaces/ai.js.map +1 -1
  83. package/sdk/dist/namespaces/assets.js +1 -1
  84. package/sdk/dist/namespaces/assets.js.map +1 -1
  85. package/sdk/dist/namespaces/ci.js +3 -3
  86. package/sdk/dist/namespaces/ci.js.map +1 -1
  87. package/sdk/dist/namespaces/deploy.d.ts.map +1 -1
  88. package/sdk/dist/namespaces/deploy.js +26 -27
  89. package/sdk/dist/namespaces/deploy.js.map +1 -1
  90. package/sdk/dist/namespaces/deploy.types.d.ts +2 -2
  91. package/sdk/dist/namespaces/deploy.types.d.ts.map +1 -1
  92. package/sdk/dist/namespaces/domains.d.ts +10 -2
  93. package/sdk/dist/namespaces/domains.d.ts.map +1 -1
  94. package/sdk/dist/namespaces/domains.js +10 -5
  95. package/sdk/dist/namespaces/domains.js.map +1 -1
  96. package/sdk/dist/namespaces/errors.js +1 -1
  97. package/sdk/dist/namespaces/functions.js +1 -1
  98. package/sdk/dist/namespaces/functions.js.map +1 -1
  99. package/sdk/dist/namespaces/gitvault.d.ts +2 -2
  100. package/sdk/dist/namespaces/gitvault.js +4 -4
  101. package/sdk/dist/namespaces/gitvault.js.map +1 -1
  102. package/sdk/dist/namespaces/tier.d.ts +1 -1
  103. package/sdk/dist/namespaces/transfers.d.ts +46 -15
  104. package/sdk/dist/namespaces/transfers.d.ts.map +1 -1
  105. package/sdk/dist/namespaces/transfers.js.map +1 -1
  106. package/sdk/dist/node/actions-node.js +8 -8
  107. package/sdk/dist/node/actions-node.js.map +1 -1
  108. package/sdk/dist/node/assets-node.js +6 -6
  109. package/sdk/dist/node/assets-node.js.map +1 -1
  110. package/sdk/dist/node/ci.js +1 -1
  111. package/sdk/dist/node/ci.js.map +1 -1
  112. package/sdk/dist/node/credentials.d.ts +1 -1
  113. package/sdk/dist/node/credentials.js +1 -1
  114. package/sdk/dist/node/deploy-manifest.d.ts +3 -5
  115. package/sdk/dist/node/deploy-manifest.d.ts.map +1 -1
  116. package/sdk/dist/node/deploy-manifest.js +3 -12
  117. package/sdk/dist/node/deploy-manifest.js.map +1 -1
  118. package/sdk/dist/node/gitvault-apply.js +1 -1
  119. package/sdk/dist/node/gitvault-apply.js.map +1 -1
  120. package/sdk/dist/node/manifest-export.js +2 -2
  121. package/sdk/dist/node/manifest-export.js.map +1 -1
  122. package/sdk/dist/node/org-adopt.js +1 -1
  123. package/sdk/dist/node/org-adopt.js.map +1 -1
  124. package/sdk/dist/node/sites-node.js +1 -1
  125. package/sdk/dist/node/sites-node.js.map +1 -1
  126. package/sdk/dist/scoped.d.ts +8 -8
  127. package/sdk/dist/scoped.d.ts.map +1 -1
  128. package/sdk/dist/scoped.js +3 -3
  129. package/sdk/dist/scoped.js.map +1 -1
  130. package/lib/cloud.mjs +0 -256
  131. package/lib/core.mjs +0 -123
package/lib/contracts.mjs CHANGED
@@ -53,7 +53,7 @@ const SUB_HELP = {
53
53
  "provision-signer": `run402 contracts provision-signer — Provision a KMS-backed signer
54
54
 
55
55
  Usage:
56
- run402 contracts provision-signer --chain <chain> [--project <id>] [options]
56
+ run402 contracts provision-signer --chain <chain> [--project <project_id>] [options]
57
57
 
58
58
  Legacy (still supported):
59
59
  run402 contracts provision-signer <project_id> --chain <chain> [options]
@@ -69,7 +69,7 @@ Options:
69
69
  "set-recovery": `run402 contracts set-recovery — Set or clear the signer recovery address
70
70
 
71
71
  Usage:
72
- run402 contracts set-recovery <signer_id> [--project <id>] [options]
72
+ run402 contracts set-recovery <signer_id> [--project <project_id>] [options]
73
73
 
74
74
  Legacy (still supported):
75
75
  run402 contracts set-recovery <project_id> <signer_id> [options]
@@ -77,7 +77,7 @@ Legacy (still supported):
77
77
  "set-alert": `run402 contracts set-alert — Set the low-balance alert threshold
78
78
 
79
79
  Usage:
80
- run402 contracts set-alert <signer_id> --threshold-wei <n> [--project <id>]
80
+ run402 contracts set-alert <signer_id> --threshold-wei <n> [--project <project_id>]
81
81
 
82
82
  Legacy (still supported):
83
83
  run402 contracts set-alert <project_id> <signer_id> --threshold-wei <n>
@@ -85,7 +85,7 @@ Legacy (still supported):
85
85
  call: `run402 contracts call — Submit a contract write call
86
86
 
87
87
  Usage:
88
- run402 contracts call <signer_id> --to 0x... --abi <json> [--project <id>]
88
+ run402 contracts call <signer_id> --to 0x... --abi <json> [--project <project_id>]
89
89
 
90
90
  Legacy (still supported):
91
91
  run402 contracts call <project_id> <signer_id> --to 0x... --abi <json>
@@ -98,7 +98,7 @@ Returns the deterministic CREATE address synchronously — known from (signer, n
98
98
  before the tx confirms. Cost: chain gas at-cost + $0.000005 KMS sign fee.
99
99
 
100
100
  Usage:
101
- run402 contracts deploy <signer_id> --bytecode 0x... [--project <id>] [options]
101
+ run402 contracts deploy <signer_id> --bytecode 0x... [--project <project_id>] [options]
102
102
 
103
103
  Legacy (still supported):
104
104
  run402 contracts deploy <project_id> <signer_id> --bytecode 0x... [options]
@@ -125,7 +125,7 @@ Usage:
125
125
  drain: `run402 contracts drain — Drain native balance to a destination address
126
126
 
127
127
  Usage:
128
- run402 contracts drain <signer_id> --to 0x... --confirm [--project <id>]
128
+ run402 contracts drain <signer_id> --to 0x... --confirm [--project <project_id>]
129
129
 
130
130
  Legacy (still supported):
131
131
  run402 contracts drain <project_id> <signer_id> --to 0x... --confirm
@@ -133,7 +133,7 @@ Legacy (still supported):
133
133
  delete: `run402 contracts delete — Schedule the KMS key for deletion
134
134
 
135
135
  Usage:
136
- run402 contracts delete <signer_id> --confirm [--project <id>]
136
+ run402 contracts delete <signer_id> --confirm [--project <project_id>]
137
137
 
138
138
  Legacy (still supported):
139
139
  run402 contracts delete <project_id> <signer_id> --confirm
@@ -141,7 +141,7 @@ Legacy (still supported):
141
141
  "get-signer": `run402 contracts get-signer — Get signer metadata + live balance
142
142
 
143
143
  Usage:
144
- run402 contracts get-signer <signer_id> [--project <id>]
144
+ run402 contracts get-signer <signer_id> [--project <project_id>]
145
145
 
146
146
  Legacy (still supported):
147
147
  run402 contracts get-signer <project_id> <signer_id>
@@ -156,7 +156,7 @@ Examples:
156
156
  "list-signers": `run402 contracts list-signers — List all KMS signers for a project
157
157
 
158
158
  Usage:
159
- run402 contracts list-signers [--project <id>]
159
+ run402 contracts list-signers [--project <project_id>]
160
160
 
161
161
  Legacy (still supported):
162
162
  run402 contracts list-signers <project_id>
@@ -173,7 +173,7 @@ Examples:
173
173
  status: `run402 contracts status — Get a contract call's status and receipt
174
174
 
175
175
  Usage:
176
- run402 contracts status <call_id> [--project <id>]
176
+ run402 contracts status <call_id> [--project <project_id>]
177
177
 
178
178
  Legacy (still supported):
179
179
  run402 contracts status <project_id> <call_id>
@@ -502,7 +502,7 @@ async function deleteSigner(projectId, signerId, args) {
502
502
  export async function run(sub, args) {
503
503
  if (!sub || sub === "--help" || sub === "-h") { console.log(HELP); process.exit(0); }
504
504
  if (Array.isArray(args) && (args.includes("--help") || args.includes("-h"))) { console.log(SUB_HELP[sub] || HELP); process.exit(0); }
505
- // Project selection (CLI-wide convention): `--project <id>` wins, else a
505
+ // Project selection (CLI-wide convention): `--project <project_id>` wins, else a
506
506
  // legacy leading `prj_...` positional, else the active project. The signer /
507
507
  // call id stays positional (`cwlt_...` / `ccall_...`). Computed lazily so
508
508
  // unknown subcommands (and the anonymous `read`) never trip project
@@ -26,18 +26,18 @@ Usage:
26
26
  run402 credentials <subcommand> [args...]
27
27
 
28
28
  Project credentials (on the gateway — named, revocable, rotatable):
29
- issue --kind <anon|service> --name <name> [--project <id>] [--expires <iso8601>] [--import]
29
+ issue --kind <anon|service> --name <name> [--project <project_id>] [--expires <iso8601>] [--import]
30
30
  Mint one. The secret is printed ONCE.
31
31
  --import also writes it into this machine's
32
32
  local key cache (the cold-restart re-key path).
33
- list [--project <id>] [--include-revoked]
33
+ list [--project <project_id>] [--include-revoked]
34
34
  List credentials (metadata only, never secrets)
35
- status [--project <id>] Are you still on the retiring legacy key?
36
- rotate <credential_id> [--project <id>]
35
+ status [--project <project_id>] Are you still on the retiring legacy key?
36
+ rotate <credential_id> [--project <project_id>]
37
37
  Replace in one step; new secret printed ONCE
38
- revoke <credential_id> [--project <id>] [--reason <text>]
38
+ revoke <credential_id> [--project <project_id>] [--reason <text>]
39
39
  Revoke immediately, freeing the name
40
- token [--project <id>] [--kind <anon|service>]
40
+ token [--project <project_id>] [--kind <anon|service>]
41
41
  Mint a SHORT-LIVED token. Works with only a
42
42
  delegate — the unattended recovery path.
43
43
 
@@ -68,12 +68,12 @@ Usage:
68
68
 
69
69
  Subcommands:
70
70
  list List cached project-key entries, redacted
71
- status --project <id> Show one cached entry, redacted
72
- import --project <id> --service-key-stdin
73
- import --project <id> --service-key-env <env>
74
- import --project <id> --anon-key-env <env> Rotate only the anon key
75
- export --project <id> --reveal Print cached keys, including secrets
76
- remove --project <id> Remove one cached key entry
71
+ status --project <project_id> Show one cached entry, redacted
72
+ import --project <project_id> --service-key-stdin
73
+ import --project <project_id> --service-key-env <env>
74
+ import --project <project_id> --anon-key-env <env> Rotate only the anon key
75
+ export --project <project_id> --reveal Print cached keys, including secrets
76
+ remove --project <project_id> Remove one cached key entry
77
77
 
78
78
  Notes:
79
79
  - This is a LOCAL CACHE surface. It is not project inventory.
@@ -89,7 +89,7 @@ const SUB_HELP = {
89
89
  issue: `run402 credentials issue — mint a named project credential
90
90
 
91
91
  Usage:
92
- run402 credentials issue --kind <anon|service> --name <name> [--project <id>] [--import]
92
+ run402 credentials issue --kind <anon|service> --name <name> [--project <project_id>] [--import]
93
93
  [--expires <iso8601>]
94
94
 
95
95
  --kind "anon" is the tenant-facing key; "service" is the privileged one.
@@ -112,14 +112,14 @@ can NEVER do this; use 'run402 credentials token' instead.
112
112
  list: `run402 credentials list — list a project's credentials
113
113
 
114
114
  Usage:
115
- run402 credentials list [--project <id>] [--include-revoked]
115
+ run402 credentials list [--project <project_id>] [--include-revoked]
116
116
 
117
117
  Metadata only — never a secret or a secret hash. Only project.read is needed.
118
118
  `,
119
119
  status: `run402 credentials status — are you still on the retiring legacy key?
120
120
 
121
121
  Usage:
122
- run402 credentials status [--project <id>]
122
+ run402 credentials status [--project <project_id>]
123
123
 
124
124
  Returns state "legacy" while the project still depends on the derived
125
125
  anon/service keys, or "rotatable" once it holds credentials it can revoke
@@ -133,7 +133,7 @@ date the platform has not committed to.
133
133
  rotate: `run402 credentials rotate — replace a credential in one step
134
134
 
135
135
  Usage:
136
- run402 credentials rotate <credential_id> [--project <id>]
136
+ run402 credentials rotate <credential_id> [--project <project_id>]
137
137
 
138
138
  Mints a replacement and revokes the old one in a single transaction, keeping
139
139
  the name. The NEW secret is printed once.
@@ -146,7 +146,7 @@ compromised.
146
146
  revoke: `run402 credentials revoke — revoke a credential immediately
147
147
 
148
148
  Usage:
149
- run402 credentials revoke <credential_id> [--project <id>] [--reason <text>]
149
+ run402 credentials revoke <credential_id> [--project <project_id>] [--reason <text>]
150
150
 
151
151
  Takes effect for every subsequent request and frees the name for reuse.
152
152
  Requires owner membership plus step-up.
@@ -154,7 +154,7 @@ Requires owner membership plus step-up.
154
154
  token: `run402 credentials token — mint a short-lived project token
155
155
 
156
156
  Usage:
157
- run402 credentials token [--project <id>] [--kind <anon|service>]
157
+ run402 credentials token [--project <project_id>] [--kind <anon|service>]
158
158
 
159
159
  The cold-restart recovery path, and the ONE credential call an agent can make
160
160
  with no human present: a delegate is accepted here. There is no step-up because
@@ -214,7 +214,7 @@ function requireProjectFlag(projectId, usage) {
214
214
  if (!projectId) {
215
215
  fail({
216
216
  code: "BAD_USAGE",
217
- message: "Missing --project <id>.",
217
+ message: "Missing --project <project_id>.",
218
218
  hint: usage,
219
219
  });
220
220
  }
@@ -227,7 +227,7 @@ function requireCachedProject(projectId) {
227
227
  fail({
228
228
  code: "PROJECT_CREDENTIAL_NOT_FOUND",
229
229
  message: `No local project credentials cached for ${projectId}.`,
230
- hint: "Import keys with `run402 credentials project-keys import --project <id> --service-key-stdin` if this operation truly requires local project credentials.",
230
+ hint: "Import keys with `run402 credentials project-keys import --project <project_id> --service-key-stdin` if this operation truly requires local project credentials.",
231
231
  details: { project_id: projectId, ...provenance() },
232
232
  next_actions: [{
233
233
  type: "run_command",
@@ -256,7 +256,7 @@ async function status(args) {
256
256
  if (rest.length > 0) {
257
257
  fail({ code: "BAD_USAGE", message: `Unexpected argument for project-keys status: ${rest[0]}` });
258
258
  }
259
- const id = requireProjectFlag(projectId, "run402 credentials project-keys status --project <id>");
259
+ const id = requireProjectFlag(projectId, "run402 credentials project-keys status --project <project_id>");
260
260
  console.log(JSON.stringify(redactedEntry(id, getProject(id)), null, 2));
261
261
  }
262
262
 
@@ -311,7 +311,7 @@ async function importKey(args) {
311
311
  if (rest.length > 0) {
312
312
  fail({ code: "BAD_USAGE", message: `Unexpected argument for project-keys import: ${rest[0]}` });
313
313
  }
314
- const id = requireProjectFlag(projectId, "run402 credentials project-keys import --project <id> --service-key-stdin");
314
+ const id = requireProjectFlag(projectId, "run402 credentials project-keys import --project <project_id> --service-key-stdin");
315
315
  // Resolve --anon-key-env before requiring a service key, so a missing service
316
316
  // key can report against the flags actually passed and an anon-only rotation
317
317
  // can reuse the cached service key.
@@ -346,12 +346,12 @@ async function exportKey(args) {
346
346
  if (rest.length > 0) {
347
347
  fail({ code: "BAD_USAGE", message: `Unexpected argument for project-keys export: ${rest[0]}` });
348
348
  }
349
- const id = requireProjectFlag(projectId, "run402 credentials project-keys export --project <id> --reveal");
349
+ const id = requireProjectFlag(projectId, "run402 credentials project-keys export --project <project_id> --reveal");
350
350
  if (!parsed.includes("--reveal")) {
351
351
  fail({
352
352
  code: "REVEAL_REQUIRED",
353
353
  message: "Exporting full project keys requires --reveal.",
354
- hint: "Use `run402 credentials project-keys status --project <id>` for redacted output.",
354
+ hint: "Use `run402 credentials project-keys status --project <project_id>` for redacted output.",
355
355
  details: { project_id: id, ...provenance() },
356
356
  });
357
357
  }
@@ -364,7 +364,7 @@ async function remove(args) {
364
364
  if (rest.length > 0) {
365
365
  fail({ code: "BAD_USAGE", message: `Unexpected argument for project-keys remove: ${rest[0]}` });
366
366
  }
367
- const id = requireProjectFlag(projectId, "run402 credentials project-keys remove --project <id>");
367
+ const id = requireProjectFlag(projectId, "run402 credentials project-keys remove --project <project_id>");
368
368
  const existed = Boolean(getProject(id));
369
369
  removeProject(id, projectCredentialsFile());
370
370
  console.log(JSON.stringify({ project_id: id, removed: existed, ...provenance() }, null, 2));
@@ -423,7 +423,7 @@ async function issue(args) {
423
423
  requirePositionalCount(rest, ISSUE_VALUE_FLAGS, {
424
424
  min: 0,
425
425
  max: 0,
426
- command: "run402 credentials issue --kind <anon|service> --name <name> [--project <id>] [--import]",
426
+ command: "run402 credentials issue --kind <anon|service> --name <name> [--project <project_id>] [--import]",
427
427
  missing: "",
428
428
  });
429
429
  if (kind !== "anon" && kind !== "service") {
@@ -485,7 +485,7 @@ async function listCredentials(args) {
485
485
  requirePositionalCount(rest, ["--project"], {
486
486
  min: 0,
487
487
  max: 0,
488
- command: "run402 credentials list [--project <id>]",
488
+ command: "run402 credentials list [--project <project_id>]",
489
489
  missing: "",
490
490
  });
491
491
  try {
@@ -503,7 +503,7 @@ async function credentialStatus(args) {
503
503
  requirePositionalCount(rest, ["--project"], {
504
504
  min: 0,
505
505
  max: 0,
506
- command: "run402 credentials status [--project <id>]",
506
+ command: "run402 credentials status [--project <project_id>]",
507
507
  missing: "",
508
508
  });
509
509
  try {
@@ -527,7 +527,7 @@ async function rotate(args) {
527
527
  const [credentialId] = requirePositionalCount(rest, ["--project"], {
528
528
  min: 1,
529
529
  max: 1,
530
- command: "run402 credentials rotate <credential_id> [--project <id>]",
530
+ command: "run402 credentials rotate <credential_id> [--project <project_id>]",
531
531
  missing: "Missing <credential_id>. Find it with: run402 credentials list",
532
532
  });
533
533
  try {
@@ -545,7 +545,7 @@ async function revoke(args) {
545
545
  const [credentialId] = requirePositionalCount(rest, ["--project", "--reason"], {
546
546
  min: 1,
547
547
  max: 1,
548
- command: "run402 credentials revoke <credential_id> [--project <id>]",
548
+ command: "run402 credentials revoke <credential_id> [--project <project_id>]",
549
549
  missing: "Missing <credential_id>. Find it with: run402 credentials list",
550
550
  });
551
551
  try {
@@ -564,7 +564,7 @@ async function token(args) {
564
564
  requirePositionalCount(rest, ["--project", "--kind"], {
565
565
  min: 0,
566
566
  max: 0,
567
- command: "run402 credentials token [--project <id>]",
567
+ command: "run402 credentials token [--project <project_id>]",
568
568
  missing: "",
569
569
  });
570
570
  if (kind && kind !== "anon" && kind !== "service") {
package/lib/delegates.mjs CHANGED
@@ -15,18 +15,18 @@ Usage:
15
15
  run402 delegates <subcommand> [args...]
16
16
 
17
17
  Subcommands:
18
- create --grant <grant_id> [--project <id>] [--capability <cap>] [--kind <kind>]
18
+ create --grant <grant_id> [--project <project_id>] [--capability <cap>] [--kind <kind>]
19
19
  [--scope <json>] [--expires <iso8601>]
20
20
  Mint a delegate. The bearer is printed ONCE.
21
- list [--project <id>] List delegates (never shows tokens)
22
- revoke <delegate_id> [--project <id>]
21
+ list [--project <project_id>] List delegates (never shows tokens)
22
+ revoke <delegate_id> [--project <project_id>]
23
23
  Revoke immediately
24
- rotate <delegate_id> [--project <id>]
24
+ rotate <delegate_id> [--project <project_id>]
25
25
  Revoke + reissue; new bearer printed ONCE
26
26
 
27
27
  Notes:
28
28
  - A delegate NARROWS an existing grant, so mint the grant first:
29
- run402 grants create <agent-wallet> --capability deploy --project <id>
29
+ run402 grants create <agent-wallet> --capability deploy --project <project_id>
30
30
  then pass the returned grant_id to 'delegates create'.
31
31
  - Mutations require you to be an owner of the project's org (wallet SIWX).
32
32
  - A delegate can never be an owner, and is revocable and expiring.
@@ -51,7 +51,7 @@ const SUB_HELP = {
51
51
  create: `run402 delegates create — mint a scoped deploy credential
52
52
 
53
53
  Usage:
54
- run402 delegates create --grant <grant_id> [--project <id>] [--capability <cap>]
54
+ run402 delegates create --grant <grant_id> [--project <project_id>] [--capability <cap>]
55
55
  [--kind <kind>] [--scope <json>] [--expires <iso8601>]
56
56
 
57
57
  --capability defaults to "deploy". --kind defaults to "run402_agent_key" (the
@@ -64,21 +64,21 @@ Requires owner of the project's org.
64
64
  list: `run402 delegates list — list a project's delegates
65
65
 
66
66
  Usage:
67
- run402 delegates list [--project <id>]
67
+ run402 delegates list [--project <project_id>]
68
68
 
69
69
  Never returns tokens or secret material — id, kind, scope, expiry, revocation.
70
70
  `,
71
71
  revoke: `run402 delegates revoke — revoke a delegate immediately
72
72
 
73
73
  Usage:
74
- run402 delegates revoke <delegate_id> [--project <id>]
74
+ run402 delegates revoke <delegate_id> [--project <project_id>]
75
75
 
76
76
  Takes effect for every subsequent request. Requires owner of the project's org.
77
77
  `,
78
78
  rotate: `run402 delegates rotate — revoke and reissue in one step
79
79
 
80
80
  Usage:
81
- run402 delegates rotate <delegate_id> [--project <id>]
81
+ run402 delegates rotate <delegate_id> [--project <project_id>]
82
82
 
83
83
  Keeps the same principal, grant, kind, scope, cap and expiry. The NEW bearer is
84
84
  printed once. Use this when a token is lost or possibly exposed.
@@ -99,12 +99,12 @@ async function create(args) {
99
99
  requirePositionalCount(rest, CREATE_VALUE_FLAGS, {
100
100
  min: 0,
101
101
  max: 0,
102
- command: "run402 delegates create --grant <grant_id> [--project <id>]",
102
+ command: "run402 delegates create --grant <grant_id> [--project <project_id>]",
103
103
  missing: "",
104
104
  });
105
105
  if (!grantId) {
106
106
  console.error("Missing --grant <grant_id>. Mint one first:");
107
- console.error(" run402 grants create <agent-wallet> --capability deploy --project <id>");
107
+ console.error(" run402 grants create <agent-wallet> --capability deploy --project <project_id>");
108
108
  process.exit(1);
109
109
  }
110
110
  const scope = scopeRaw != null
@@ -135,7 +135,7 @@ async function list(args) {
135
135
  requirePositionalCount(rest, ["--project"], {
136
136
  min: 0,
137
137
  max: 0,
138
- command: "run402 delegates list [--project <id>]",
138
+ command: "run402 delegates list [--project <project_id>]",
139
139
  missing: "",
140
140
  });
141
141
  try {
@@ -153,7 +153,7 @@ function oneIdCommand(name) {
153
153
  const [delegateId] = requirePositionalCount(rest, ["--project"], {
154
154
  min: 1,
155
155
  max: 1,
156
- command: `run402 delegates ${name} <delegate_id> [--project <id>]`,
156
+ command: `run402 delegates ${name} <delegate_id> [--project <project_id>]`,
157
157
  missing: "Missing <delegate_id>.",
158
158
  });
159
159
  try {
@@ -30,7 +30,7 @@ const HELP = `run402 deliveries — did a notification actually land
30
30
 
31
31
  Usage:
32
32
  run402 deliveries list [--type <event_type>] [--since <iso>] [--limit N] [--after <cursor>]
33
- run402 deliveries get <id>
33
+ run402 deliveries get <notification_id>
34
34
 
35
35
  Notes:
36
36
  - One row per delivery ATTEMPT, per channel, with its outcome — the audit
@@ -70,7 +70,7 @@ async function get(args) {
70
70
  assertKnownFlags(parsedArgs, ["--help", "-h"]);
71
71
  const positionals = positionalArgs(parsedArgs);
72
72
  if (positionals.length !== 1) {
73
- fail({ code: "BAD_USAGE", message: "Usage: run402 notifications get <id>" });
73
+ fail({ code: "BAD_USAGE", message: "Usage: run402 deliveries get <notification_id>" });
74
74
  }
75
75
  walletAuthHeaders("/agent/v1/notifications");
76
76
  try {
package/lib/deploy-v2.mjs CHANGED
@@ -506,14 +506,14 @@ async function rehearseCmd(rawArgs) {
506
506
  });
507
507
  const planId = planned.plan.plan_id;
508
508
  if (!planId) {
509
- fail({ code: "DRY_RUN_PLAN_NOT_COMMITTABLE", message: "Rehearsal requires a persisted plan_id, but the plan response did not include one.", details: { project_id: normalized.spec.project } });
509
+ fail({ code: "DRY_RUN_PLAN_NOT_COMMITTABLE", message: "Rehearsal requires a persisted plan_id, but the plan response did not include one.", details: { project_id: normalized.spec.project_id } });
510
510
  }
511
511
  await sdk._applyEngine.upload(planned.plan, {
512
- project: normalized.spec.project,
512
+ project: normalized.spec.project_id,
513
513
  byteReaders: planned.byteReaders,
514
514
  onEvent: emit,
515
515
  });
516
- return { planId, plan: planned.plan, projectId: normalized.spec.project };
516
+ return { planId, plan: planned.plan, projectId: normalized.spec.project_id };
517
517
  }
518
518
 
519
519
  try {
@@ -1250,11 +1250,11 @@ async function deployCmd(args) {
1250
1250
  target = await resolveDeploymentTarget({
1251
1251
  appRoot: applicationScope.app_root,
1252
1252
  manifestPath: manifestPath ?? undefined, projectId: opts.project || undefined, environmentProjectId: process.env.RUN402_PROJECT_ID || undefined,
1253
- manifestProjectId: manifestProject || (releaseSpec.project === "prj_up_preflight_placeholder" ? undefined : releaseSpec.project),
1253
+ manifestProjectId: manifestProject || (releaseSpec.project_id === "prj_up_preflight_placeholder" ? undefined : releaseSpec.project_id),
1254
1254
  targetKind: isCoreApiTarget() ? "core" : "cloud", apiBase: API,
1255
1255
  allowUnresolved: opts.mode === "check" || opts.mode === "printSpec" || opts.mode === "printManifest",
1256
1256
  });
1257
- if (target.project_id) releaseSpec.project = target.project_id;
1257
+ if (target.project_id) releaseSpec.project_id = target.project_id;
1258
1258
  } catch (err) { reportSdkError(err); }
1259
1259
  const idempotencyKey = normalizedManifest.idempotencyKey;
1260
1260
 
@@ -1289,7 +1289,7 @@ async function deployCmd(args) {
1289
1289
  return;
1290
1290
  }
1291
1291
  if (opts.mode === "printSpec") {
1292
- console.log(JSON.stringify({ ...releaseSpec, project: target.project_id ?? undefined }, null, 2));
1292
+ console.log(JSON.stringify({ ...releaseSpec, project_id: target.project_id ?? undefined }, null, 2));
1293
1293
  return;
1294
1294
  }
1295
1295
 
@@ -1298,7 +1298,7 @@ async function deployCmd(args) {
1298
1298
  const delegateToken = delegateTokenFromEnv();
1299
1299
  if (useGithubActionsOidc) {
1300
1300
  sdkOpts = {
1301
- credentials: githubActionsCredentials({ projectId: releaseSpec.project, apiBase: API }),
1301
+ credentials: githubActionsCredentials({ projectId: releaseSpec.project_id, apiBase: API }),
1302
1302
  disablePaidFetch: true,
1303
1303
  };
1304
1304
  } else if (delegateToken) {
@@ -1356,7 +1356,7 @@ async function deployCmd(args) {
1356
1356
  // Cache the activated deployment id so `run402 subdomains add` can
1357
1357
  // pass it as an optimization (the gateway defaults to the live release
1358
1358
  // without it). Best-effort: a keystore hiccup never fails the deploy.
1359
- rememberLastDeployment(releaseSpec.project, outcome.deploy?.urls?.deployment_id);
1359
+ rememberLastDeployment(releaseSpec.project_id, outcome.deploy?.urls?.deployment_id);
1360
1360
  if (!outcome.gitvault) {
1361
1361
  console.log(JSON.stringify({ ...outcome.deploy, stats: sdkStats(sdk) }, null, 2));
1362
1362
  printVerboseStats(opts.verbose, sdk);
@@ -1467,7 +1467,7 @@ const CI_DEPLOY_ERROR_GUIDANCE = {
1467
1467
  hint: "The GitHub repository id in the OIDC token does not match the linked binding.",
1468
1468
  next_actions: [
1469
1469
  editRequestAction("run402 ci link github", "Re-link from the current repository."),
1470
- editRequestAction("run402 ci link github --repository-id <id>", "Pass the numeric GitHub repository id if automatic lookup fails."),
1470
+ editRequestAction("run402 ci link github --repository-id <repository_id>", "Pass the numeric GitHub repository id if automatic lookup fails."),
1471
1471
  ],
1472
1472
  },
1473
1473
  forbidden_spec_field: {
package/lib/dev.mjs CHANGED
@@ -29,12 +29,12 @@ import { fail } from "./sdk-errors.mjs";
29
29
  const HELP = `run402 dev — Run Astro dev with Run402 context
30
30
 
31
31
  Usage:
32
- run402 dev [--port <n>] [--host <h>] [--project <id>]
32
+ run402 dev [--port <n>] [--host <h>] [--project <project_id>]
33
33
 
34
34
  Options:
35
35
  --port <n> Astro dev port (default 4321)
36
36
  --host <h> Astro dev host (default localhost)
37
- --project <id> Project id (default: RUN402_PROJECT_ID env var)
37
+ --project <project_id> Project id (default: RUN402_PROJECT_ID env var)
38
38
 
39
39
  The command:
40
40
  1. Loads .env.local from the current directory (if present)
@@ -85,7 +85,7 @@ export async function run(sub, args = []) {
85
85
  fail({
86
86
  code: "BAD_USAGE",
87
87
  message: "Missing RUN402_PROJECT_ID.",
88
- hint: "Set it in .env.local (or pass --project <id>). Run 'run402 projects provision' first if you don't have one.",
88
+ hint: "Set it in .env.local (or pass --project <project_id>). Run 'run402 projects provision' first if you don't have one.",
89
89
  });
90
90
  }
91
91
  if (!process.env.RUN402_SERVICE_KEY) {
package/lib/doctor.mjs CHANGED
@@ -75,7 +75,7 @@ function collectRepeatableFlag(args, flag) {
75
75
  const HELP = `run402 doctor — Health and config diagnostics
76
76
 
77
77
  Usage:
78
- run402 doctor [--verbose] [--refresh] [--no-scan] [--scan-dir <D>] [--project <id>]
78
+ run402 doctor [--verbose] [--refresh] [--no-scan] [--scan-dir <D>] [--project <project_id>]
79
79
  [--only <check> ...]
80
80
  run402 --wallet <profile> doctor --buzz --buzz-agent <npub-or-hex>
81
81
 
@@ -117,7 +117,7 @@ Options:
117
117
  --dir D Select the application directory for deployment diagnostics.
118
118
  --manifest P Explicitly select a manifest (executable configs are trusted code).
119
119
  --scan-dir D Advanced arbitrary scan; does not claim deployment readiness
120
- --project <id> Target THIS project's gitvault check instead of the repo-standing
120
+ --project <project_id> Target THIS project's gitvault check instead of the repo-standing
121
121
  default (the 4.38.0 pin / run402 remote / RUN402_PROJECT_ID / active
122
122
  project, in that order — see \`gitvault-target.mjs\`). Scoped to the
123
123
  gitvault check only; every other check is wallet/machine-wide, not
@@ -675,7 +675,7 @@ export async function run(sub, args = []) {
675
675
  for (const org of posture) {
676
676
  const label = `org ${org.org_id} (${org.vault_count} vault${org.vault_count === 1 ? "" : "s"})`;
677
677
  if (org.control_plane_configured === false) {
678
- gaps.push(`${label}: no human owner with a working control-plane login — if this org's agent machine dies, nobody can sign in to recover it. Invite a backup human (run402 org invite create ${org.org_id} --email <their-email> --role owner) and have them complete login at console.run402.com.`);
678
+ gaps.push(`${label}: no human owner with a working control-plane login — if this org's agent machine dies, nobody can sign in to recover it. Invite a backup human (run402 orgs invite create ${org.org_id} --email <their-email> --role owner) and have them complete login at console.run402.com.`);
679
679
  }
680
680
  if (org.source_backup_configured === false) {
681
681
  gaps.push(`${label}: no human member holds a working source-access key — vault history has no member-side decryption backup. Have a member complete source enrollment at console.run402.com/account → Source access.`);
@@ -735,7 +735,7 @@ export async function run(sub, args = []) {
735
735
  // with its own pinned repo id or run402/origin remote, doctor checks THAT
736
736
  // vault, not the profile's active project — the same pin > remote >
737
737
  // RUN402_PROJECT_ID env > active-project order every other gitvault verb
738
- // follows (`gitvault-target.mjs`). An explicit `--project <id>` outranks
738
+ // follows (`gitvault-target.mjs`). An explicit `--project <project_id>` outranks
739
739
  // all of that (the resolver's own top tier), same as every other gitvault
740
740
  // verb's `--project`.
741
741
  if (wanted("gitvault")) {
@@ -848,7 +848,7 @@ export async function run(sub, args = []) {
848
848
  if (gv.gitvault_policy === "required" && !gv.keystore.holds_repo_key) {
849
849
  gaps.push(
850
850
  "gitvault_policy is 'required' but this machine holds no key for the vault — a deploy from here is refused with GITVAULT_CLIENT_UPGRADE_REQUIRED. " +
851
- "Run 'run402 repos create --project <id>' (idempotent; resolves to the existing repo), or 'run402 repos policy grandfathered --reason <why>' to un-gate the project.",
851
+ "Run 'run402 repos create --project <project_id>' (idempotent; resolves to the existing repo), or 'run402 repos policy grandfathered --reason <why>' to un-gate the project.",
852
852
  );
853
853
  } else if (gv.gitvault_policy === "required" && !gv.keystore.can_sign) {
854
854
  gaps.push("gitvault_policy is 'required' and this keystore is read-only (no signing key) — it can verify but cannot publish the capture a deploy needs");
@@ -921,7 +921,7 @@ export async function run(sub, args = []) {
921
921
  status: gaps.length > 0 ? "warning" : "ok",
922
922
  value: gaps.length > 0 ? { ...value, gaps } : value,
923
923
  hint: (gv.vault === null
924
- ? `No vault for this project (that is a normal shape). Allocate one with 'run402 repos create --project <id>'. Keystore: ${gv.keystore.root}`
924
+ ? `No vault for this project (that is a normal shape). Allocate one with 'run402 repos create --project <project_id>'. Keystore: ${gv.keystore.root}`
925
925
  : gv.durability_statement
926
926
  ? `Back up ${gv.keystore.root} anyway — ${gv.durability_statement} (covering_recipients: ${gv.covering_recipients})`
927
927
  : `Back up ${gv.keystore.root} — whole-machine or whole-keystore loss is terminal for vault history.`) + byoDisclosure,