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/projects.mjs CHANGED
@@ -14,27 +14,26 @@ Usage:
14
14
 
15
15
  Subcommands:
16
16
  quote Show pricing tiers
17
- provision [--tier <tier>] [--name <n>] [--org <id>] Provision a new Postgres project
18
- use <id> Set the active project (used as default for other commands)
19
- list [--org <id>] [--all] List your projects from the server (name, site_url, custom domains, org_id, active marker)
20
- rename <id> --name <label> Rename a project (fix an auto-generated name)
17
+ provision [--tier <tier>] [--name <n>] [--org <org_id>] Provision a new Postgres project
18
+ use <project_id> Set the active project (used as default for other commands)
19
+ list [--org <org_id>] [--all] List your projects from the server (name, site_url, custom domains, org_id, active marker)
20
+ rename <project_id> --name <label> Rename a project (fix an auto-generated name)
21
21
  tenant-payments [project_id] [--status <s>] List redacted tenant x402 payments for priced routes
22
- get [id] Authoritative server read: status, org, tier, active deploy, mailbox, usage vs limits (live; no keys)
22
+ get [project_id] Authoritative server read: status, org, tier, active deploy, mailbox, usage vs limits (live; no keys)
23
23
  current Show the active project pointer and validation status
24
- sql "<query>" [--project <id>] [--file <path>] [--params '<json>'] Run a SQL query (supports parameterized queries)
25
- rest <table> [--query "<params>"] [--project <id>] Query a table via the REST API (PostgREST)
26
- usage [id] Show compute/storage usage for a project
27
- costs [id] [--window <w>] Show admin-only per-project revenue/cost/margin
28
- schema [id] Inspect the database schema
29
- apply-expose [id] <manifest_json> Apply a declarative authorization manifest
30
- apply-expose [id] --file <path> Apply a manifest from a JSON file
31
- validate-expose [id] <manifest_json> Validate an authorization manifest without applying it
32
- validate-expose [id] --file <path> Validate a manifest file without mutating the project
33
- get-expose [id] Get the current authorization manifest
34
- delete [id] --confirm Immediately and irreversibly delete a project (cascade purge) and remove from local state. Requires --confirm.
35
- promote-user [id] <email> Promote a user to project_admin role
36
- demote-user [id] <email> Demote a user from project_admin role
37
- export [id] [archive options] Export a portable Run402 Core archive
24
+ sql "<query>" [--project <project_id>] [--file <path>] [--params '<json>'] Run a SQL query (supports parameterized queries)
25
+ rest <table> [--query "<params>"] [--project <project_id>] Query a table via the REST API (PostgREST)
26
+ usage [project_id] Show compute/storage usage for a project
27
+ costs [project_id] [--window <w>] Show admin-only per-project revenue/cost/margin
28
+ schema [project_id] Inspect the database schema
29
+ apply-expose [project_id] <manifest_json> Apply a declarative authorization manifest
30
+ apply-expose [project_id] --file <path> Apply a manifest from a JSON file
31
+ validate-expose [project_id] <manifest_json> Validate an authorization manifest without applying it
32
+ validate-expose [project_id] --file <path> Validate a manifest file without mutating the project
33
+ get-expose [project_id] Get the current authorization manifest
34
+ delete [project_id] --confirm Immediately and irreversibly delete a project (cascade purge) and remove from local state. Requires --confirm.
35
+ promote-user [project_id] <email> Promote a user to project_admin role
36
+ demote-user [project_id] <email> Demote a user from project_admin role
38
37
 
39
38
  Examples:
40
39
  run402 projects quote
@@ -59,7 +58,6 @@ Examples:
59
58
  run402 projects apply-expose prj_abc123 --file manifest.json
60
59
  run402 projects get-expose prj_abc123
61
60
  run402 projects delete prj_abc123 --confirm
62
- run402 projects export prj_abc123 --wait --output ./project.r402ar --json
63
61
 
64
62
  Global options (any command):
65
63
  --wallet <name> Use a named wallet (profile) for this command. Precedence:
@@ -67,15 +65,15 @@ Global options (any command):
67
65
  'run402 wallets use' default > 'default'. See 'run402 wallets'.
68
66
 
69
67
  Notes:
70
- - <id> is the project_id shown in 'run402 projects list' (prefix: 'prj_')
71
- - Most commands that take <id> default to the active project when omitted
72
- (set it with 'run402 projects use <id>'). Project IDs start with 'prj_';
68
+ - <project_id> is the project_id shown in 'run402 projects list' (prefix: 'prj_')
69
+ - Most commands that take <project_id> default to the active project when omitted
70
+ (set it with 'run402 projects use <project_id>'). Project IDs start with 'prj_';
73
71
  any first positional that doesn't is treated as the next argument instead.
74
72
  - 'list', 'get', and 'use' are SERVER-authoritative project identity flows.
75
73
  Local project keys live under 'run402 credentials project-keys ...'.
76
74
  - 'list' is a SERVER read, not the local key cache: it shows every project the
77
75
  active wallet can reach (membership-scoped), with name, site_url, custom
78
- domains, and org_id. '--org <id>' filters to one org; '--all' reads every
76
+ domains, and org_id. '--org <org_id>' filters to one org; '--all' reads every
79
77
  project you can reach across all your orgs (as your sign-in session after
80
78
  'run402 login', else as the current wallet). The 'active' marker still
81
79
  comes from local state.
@@ -108,10 +106,10 @@ const SUB_HELP = {
108
106
  list: `run402 projects list — List your projects from the server
109
107
 
110
108
  Usage:
111
- run402 projects list [--org <id>] [--all]
109
+ run402 projects list [--org <org_id>] [--all]
112
110
 
113
111
  Options:
114
- --org <id> Filter to projects owned by one org (organization).
112
+ --org <org_id> Filter to projects owned by one org (organization).
115
113
  Authorize-before-reveal: a non-member or guessed id is a
116
114
  403; a non-UUID id is a 400.
117
115
  --all Read every project you can reach across all your orgs
@@ -135,10 +133,10 @@ Examples:
135
133
  rename: `run402 projects rename — Rename a project
136
134
 
137
135
  Usage:
138
- run402 projects rename <id> --name <label>
136
+ run402 projects rename <project_id> --name <label>
139
137
 
140
138
  Arguments:
141
- <id> Project ID (prefix: 'prj_'). Required.
139
+ <project_id> Project ID (prefix: 'prj_'). Required.
142
140
 
143
141
  Options:
144
142
  --name <label> New display name (1-200 chars, no control characters).
@@ -183,12 +181,12 @@ Notes:
183
181
  provision: `run402 projects provision — Provision a new Postgres project
184
182
 
185
183
  Usage:
186
- run402 projects provision [--tier <tier>] [--name <name>] [--org <id>] [--idempotency-key <key>]
184
+ run402 projects provision [--tier <tier>] [--name <name>] [--org <org_id>] [--idempotency-key <key>]
187
185
 
188
186
  Options:
189
187
  --tier <tier> Tier for the new project (default: prototype)
190
188
  --name <name> Human-readable name for the project
191
- --org <id> Provision into an EXISTING org (needs developer+ on it).
189
+ --org <org_id> Provision into an EXISTING org (needs developer+ on it).
192
190
  Omit for the cold-start path. Tier is org-governed.
193
191
  --idempotency-key <key> Retry-safe key: re-running with the same key returns
194
192
  the existing project instead of duplicating it. Auto-derived
@@ -209,8 +207,8 @@ Examples:
209
207
  sql: `run402 projects sql — Run a SQL query against a project's database
210
208
 
211
209
  Usage:
212
- run402 projects sql "<query>" [--project <id>] [options]
213
- run402 projects sql --file <path> [--project <id>] [options]
210
+ run402 projects sql "<query>" [--project <project_id>] [options]
211
+ run402 projects sql --file <path> [--project <project_id>] [options]
214
212
 
215
213
  Legacy (still supported):
216
214
  run402 projects sql <prj_id> "<query>" [options]
@@ -219,7 +217,7 @@ Arguments:
219
217
  <query> Inline SQL query (quote it to preserve spaces)
220
218
 
221
219
  Options:
222
- --project <id> Project ID (defaults to the active project; a leading
220
+ --project <project_id> Project ID (defaults to the active project; a leading
223
221
  prj_... positional is also still accepted)
224
222
  --file <path> Read SQL from a file instead of an inline query
225
223
  --params '<json>' JSON array of parameters for a parameterized query
@@ -232,10 +230,10 @@ Examples:
232
230
  costs: `run402 projects costs — Show admin-only per-project finance
233
231
 
234
232
  Usage:
235
- run402 projects costs [id] [--window <24h|7d|30d|90d>]
233
+ run402 projects costs [project_id] [--window <24h|7d|30d|90d>]
236
234
 
237
235
  Arguments:
238
- [id] Project ID (defaults to the active project if omitted)
236
+ [project_id] Project ID (defaults to the active project if omitted)
239
237
 
240
238
  Options:
241
239
  --window <w> Finance window (default: 30d). One of: 24h, 7d, 30d, 90d
@@ -258,12 +256,12 @@ Examples:
258
256
  "validate-expose": `run402 projects validate-expose — Validate an authorization manifest without applying it
259
257
 
260
258
  Usage:
261
- run402 projects validate-expose [id] <manifest_json> [options]
262
- run402 projects validate-expose [id] --file <path> [options]
263
- cat manifest.json | run402 projects validate-expose [id] [options]
259
+ run402 projects validate-expose [project_id] <manifest_json> [options]
260
+ run402 projects validate-expose [project_id] --file <path> [options]
261
+ cat manifest.json | run402 projects validate-expose [project_id] [options]
264
262
 
265
263
  Arguments:
266
- [id] Optional project ID. When omitted, the active project is
264
+ [project_id] Optional project ID. When omitted, the active project is
267
265
  used if one is set; otherwise validation is projectless.
268
266
  <manifest_json> Inline auth/expose manifest JSON.
269
267
 
@@ -328,7 +326,7 @@ async function provision(args) {
328
326
  code: "BAD_USAGE",
329
327
  message: "--org must not be empty.",
330
328
  details: { field: "--org" },
331
- hint: "Pass an org id (run402 org list), or omit --org for the cold-start path.",
329
+ hint: "Pass an org id (run402 orgs list), or omit --org for the cold-start path.",
332
330
  });
333
331
  }
334
332
  // Validate --name when provided. Omitted --name lets the server pick a
@@ -452,7 +450,7 @@ async function validateExpose(args = []) {
452
450
  fail({
453
451
  code: "BAD_USAGE",
454
452
  message: `Unexpected extra argument: ${arg}`,
455
- hint: "run402 projects validate-expose [id] <manifest_json>",
453
+ hint: "run402 projects validate-expose [project_id] <manifest_json>",
456
454
  });
457
455
  }
458
456
  }
@@ -460,7 +458,7 @@ async function validateExpose(args = []) {
460
458
  fail({
461
459
  code: "BAD_USAGE",
462
460
  message: "Provide either inline manifest JSON or --file <path>, not both.",
463
- hint: "run402 projects validate-expose [id] --file manifest.json",
461
+ hint: "run402 projects validate-expose [project_id] --file manifest.json",
464
462
  });
465
463
  }
466
464
  if (migrationFile && migrationSql !== null) {
@@ -571,7 +569,7 @@ async function rename(projectId, args = []) {
571
569
  fail({
572
570
  code: "BAD_USAGE",
573
571
  message: "Missing --name.",
574
- hint: "run402 projects rename <id> --name \"My Site\"",
572
+ hint: "run402 projects rename <project_id> --name \"My Site\"",
575
573
  });
576
574
  }
577
575
  try {
@@ -649,7 +647,7 @@ function commandMoved(name) {
649
647
  fail({
650
648
  code: "COMMAND_MOVED",
651
649
  message: `run402 projects ${name} moved to the explicit local credential-cache surface.`,
652
- hint: "Use `run402 credentials project-keys status/export --project <id>`.",
650
+ hint: "Use `run402 credentials project-keys status/export --project <project_id>`.",
653
651
  details: {
654
652
  old_command: `projects ${name}`,
655
653
  new_command: name === "keys" ? "credentials project-keys export --reveal" : "credentials project-keys status",
@@ -658,12 +656,12 @@ function commandMoved(name) {
658
656
  next_actions: [
659
657
  {
660
658
  type: "run_command",
661
- command: "run402 credentials project-keys status --project <id>",
659
+ command: "run402 credentials project-keys status --project <project_id>",
662
660
  why: "Inspect cached key presence without revealing secrets.",
663
661
  },
664
662
  {
665
663
  type: "run_command",
666
- command: "run402 credentials project-keys export --project <id> --reveal",
664
+ command: "run402 credentials project-keys export --project <project_id> --reveal",
667
665
  why: "Reveal cached project keys only when you explicitly need secret material.",
668
666
  },
669
667
  ],
@@ -733,7 +731,7 @@ async function rest(projectId, restArgs = []) {
733
731
  if (!table) {
734
732
  fail({
735
733
  code: "BAD_USAGE",
736
- message: "Missing <table> argument. Usage: run402 projects rest <table> [--query \"<query>\"] [--project <id>]",
734
+ message: "Missing <table> argument. Usage: run402 projects rest <table> [--query \"<query>\"] [--project <project_id>]",
737
735
  hint: "Run 'run402 projects schema' to list tables.",
738
736
  });
739
737
  }
@@ -886,10 +884,6 @@ const FLAGS_BY_SUB = {
886
884
  values: ["--project", "--file", "--migration-file", "--migration-sql"],
887
885
  },
888
886
  delete: { known: ["--project", "--confirm"], values: ["--project"] },
889
- export: {
890
- known: ["--project", "--scope", "--auth", "--consistency", "--idempotency-key", "--output", "--poll-interval", "--timeout", "--wait", "--json", "--json-stream"],
891
- values: ["--project", "--scope", "--auth", "--consistency", "--idempotency-key", "--output", "--poll-interval", "--timeout"],
892
- },
893
887
  };
894
888
 
895
889
  function validateFlags(sub, args) {
@@ -937,11 +931,6 @@ export async function run(sub, args) {
937
931
  case "validate-expose": await validateExpose(args); break;
938
932
  case "get-expose": { const { projectId } = resolveProjectSelector(args, { rejectBareFirst: true }); await getExpose(projectId); break; }
939
933
  case "delete": { const { projectId, rest } = resolveProjectSelector(args, { rejectBareFirst: true }); await deleteProject(projectId, rest); break; }
940
- case "export": {
941
- const { run } = await import("./cloud.mjs");
942
- await run("archives", ["create", ...args]);
943
- break;
944
- }
945
934
  case "promote-user": { const { projectId, rest } = resolveProjectSelector(args); await promoteUser(projectId, rest[0]); break; }
946
935
  case "demote-user": { const { projectId, rest } = resolveProjectSelector(args); await demoteUser(projectId, rest[0]); break; }
947
936
  default:
package/lib/repos.mjs CHANGED
@@ -63,9 +63,9 @@ Usage:
63
63
  run402 repos <verb> [options] — fifteen verbs, tiered by how often you reach for them:
64
64
 
65
65
  Common:
66
- run402 repos create [name] [--org <org_id>] [--dir <path>] [--nested] [--tier <tier>] [--project <id>]
66
+ run402 repos create [name] [--org <org_id>] [--dir <path>] [--nested] [--tier <tier>] [--project <project_id>]
67
67
  [--byo <s3://bucket/prefix>] [--profile <name> | --ambient] [--region <r>] [--endpoint <url>] [--no-init]
68
- run402 repos view [--project <id>] [--repo <repo_id>] [--human]
68
+ run402 repos view [--project <project_id>] [--repo <repo_id>] [--human]
69
69
  run402 repos list [--org <org_id>] [--human]
70
70
 
71
71
  Then plain git, forever:
@@ -73,38 +73,38 @@ Then plain git, forever:
73
73
  git clone run402::<org>/<repo>
74
74
 
75
75
  Handoff (pass a working tree to another agent):
76
- run402 repos handoff [--project <id>] [--repo <repo_id>] [--ttl <seconds>] [--role <role>]
76
+ run402 repos handoff [--project <project_id>] [--repo <repo_id>] [--ttl <seconds>] [--role <role>]
77
77
  [--include-sensitive <glob>]... [--note-file <path>] [--json] [--list] [--revoke <handoff_id>]
78
78
  (the Handoff Note is JSON piped on stdin when not using --note-file)
79
79
  run402 repos resume <kgh1_…|--key-stdin> [--to <dir>] [--no-init] [--json]
80
80
 
81
81
  Invite (bring a second agent into the SAME work, dirty tree included):
82
- run402 repos invite [--project <id>] [--repo <repo_id>] [--room <key>] [--ttl <seconds>] [--role <role>]
82
+ run402 repos invite [--project <project_id>] [--repo <repo_id>] [--room <key>] [--ttl <seconds>] [--role <role>]
83
83
  [--include-sensitive <glob>]... [--note-file <path>] [--json] [--list] [--revoke <invite_id>]
84
84
  (the Invite Note is JSON piped on stdin when not using --note-file)
85
85
  run402 repos join <kgi1_…|--key-stdin> [--to <dir>] [--no-init] [--json]
86
86
 
87
87
  Occasional:
88
- run402 repos snapshot [--project <id>] [--repo <repo_id>] [--message <text>] [--checkpoint] [--dry-run] [--allow-dirty] [--manifest-out <path>]
89
- run402 repos mirror [<destination>] [--off] [--backfill] [--profile <name> | --ambient] [--region <r>] [--endpoint <url>] [--project <id>] [--repo <repo_id>]
88
+ run402 repos snapshot [--project <project_id>] [--repo <repo_id>] [--message <text>] [--checkpoint] [--dry-run] [--allow-dirty] [--manifest-out <path>]
89
+ run402 repos mirror [<destination>] [--off] [--backfill] [--profile <name> | --ambient] [--region <r>] [--endpoint <url>] [--project <project_id>] [--repo <repo_id>]
90
90
  run402 repos recover <source> --out <dir> [--repo <repo_id>] [--profile <name> | --ambient] [--region <r>] [--endpoint <url>]
91
91
  [--bundle <file>] [--code <SRC1-…>] [--receipt <file>] [--rp-id <host>] [--human]
92
92
  run402 repos recovery-bundle [--out <file> | --out -]
93
93
 
94
94
  Lifecycle:
95
95
  run402 repos rename <new_name> [--repo <repo_id> | --project <project_id>]
96
- run402 repos delete [--project <id>] [--repo <repo_id>] [--force]
96
+ run402 repos delete [--project <project_id>] [--repo <repo_id>] [--force]
97
97
 
98
98
  Maintenance:
99
- run402 repos fsck [--project <id>] [--repo <repo_id>] [--mirror] [--budget <n>] [--no-write] [--human]
100
- run402 repos gc [--project <id>] [--repo <repo_id>] [--force-headroom] [--submit --intent-core <path> --verifier-receipt <path> [--wait]]
99
+ run402 repos fsck [--project <project_id>] [--repo <repo_id>] [--mirror] [--budget <n>] [--no-write] [--human]
100
+ run402 repos gc [--project <project_id>] [--repo <repo_id>] [--force-headroom] [--submit --intent-core <path> --verifier-receipt <path> [--wait]]
101
101
  run402 repos daemon <status|stop> The resident helper engine (gitvault-persistent-helper) — inspect or retire it; nothing requires either
102
- run402 repos access [--project <id>] [--repo <repo_id>] [--human]
103
- run402 repos access repair [--project <id>] [--repo <repo_id>] --recipient-state-version <n> --recipient-revocation-version <n>
104
- run402 repos access revoke-key <principal_id> [--project <id>] [--repo <repo_id>]
105
- run402 repos access declare-exposure [--project <id>] [--repo <repo_id>]
106
- run402 repos access repin [--project <id>] [--repo <repo_id>] --principal <principal_id> --fingerprint <ek_fingerprint>
107
- run402 repos policy <required|grandfathered> [--project <id>] [--repo <repo_id>] [--reason <why>]
102
+ run402 repos access [--project <project_id>] [--repo <repo_id>] [--human]
103
+ run402 repos access repair [--project <project_id>] [--repo <repo_id>] --recipient-state-version <n> --recipient-revocation-version <n>
104
+ run402 repos access revoke-key <principal_id> [--project <project_id>] [--repo <repo_id>]
105
+ run402 repos access declare-exposure [--project <project_id>] [--repo <repo_id>]
106
+ run402 repos access repin [--project <project_id>] [--repo <repo_id>] --principal <principal_id> --fingerprint <ek_fingerprint>
107
+ run402 repos policy <required|grandfathered> [--project <project_id>] [--repo <repo_id>] [--reason <why>]
108
108
  run402 repos policy auto-gc [<generations>|off] (local, per-checkout — no --project/--repo)
109
109
 
110
110
  Every verb above also accepts -v/--verbose (a stderr summary line of request
@@ -115,7 +115,7 @@ Subcommands:
115
115
  create Provision (or, with --project, ADOPT an existing project), ALLOCATE
116
116
  its vault (mints key material and, on first allocation, a one-shot
117
117
  recovery receipt), and scaffold the git remote — origin when free,
118
- run402 when taken. \`--project <id>\` allocates for a project that already exists,
118
+ run402 when taken. \`--project <project_id>\` allocates for a project that already exists,
119
119
  nothing is provisioned. \`[name]\` is inferred from an existing git
120
120
  remote's basename or the directory name when unambiguous — NEVER a
121
121
  prompt; if the directory and an existing remote disagree, or
@@ -376,7 +376,7 @@ Subcommands:
376
376
  \`off\` (or \`0\`) disables it. No value prints the current setting.
377
377
 
378
378
  Options:
379
- --project <id> Project whose repo to act on (defaults to the active project)
379
+ --project <project_id> Project whose repo to act on (defaults to the active project)
380
380
  --repo <repo_id> Address the repo directly by id, skipping project lookup
381
381
  --org <org_id> create/list: the owning organization (create resolves it
382
382
  the same way \`projects provision\` does when omitted)
@@ -655,7 +655,7 @@ async function formatRepoHuman(s, mirror) {
655
655
  lines.push(`Address: ${formatRepoAddress(s)}${remotePart}`);
656
656
 
657
657
  if (!s.vault) {
658
- lines.push("Repo: not allocated yet for this project — run 'run402 repos create --project <id>' to allocate one.");
658
+ lines.push("Repo: not allocated yet for this project — run 'run402 repos create --project <project_id>' to allocate one.");
659
659
  if (s.warnings.length > 0) lines.push(`Warnings: ${s.warnings.map((w) => w.message).join(" ")}`);
660
660
  return lines.join("\n");
661
661
  }
@@ -897,7 +897,7 @@ async function printCreateResult({ sdk, projectId, vault, adopted, name, verbose
897
897
  (vault.deduplicated ? "already existed — nothing was re-allocated" : `allocated (genesis ${vault.genesis_sha256})`),
898
898
  );
899
899
  if (address) console.error(`address: ${address}`);
900
- else if (!orgSlug) console.error("no named address yet — set an org slug (run402 org slug <slug>) to get run402::<slug>/<name> addresses");
900
+ else if (!orgSlug) console.error("no named address yet — set an org slug (run402 orgs slug <slug>) to get run402::<slug>/<name> addresses");
901
901
  else console.error(`no address set — run 'run402 repos rename <name> --project ${projectId}' to set one`);
902
902
  if (remoteScaffolded) {
903
903
  console.error(`remote '${vault.remote.name}' -> ${vault.remote.url} (${vault.remote.reason})`);
@@ -1040,7 +1040,7 @@ async function create(args) {
1040
1040
  fail({
1041
1041
  code: "BAD_USAGE",
1042
1042
  message: "a name positional and --project are mutually exclusive — --project adopts an EXISTING project.",
1043
- hint: "run402 repos create --project <id> to adopt, or run402 repos create <name> to provision a new one. Name it afterward with `run402 repos rename`.",
1043
+ hint: "run402 repos create --project <project_id> to adopt, or run402 repos create <name> to provision a new one. Name it afterward with `run402 repos rename`.",
1044
1044
  });
1045
1045
  }
1046
1046
  if (flagValue(a, "--tier") != null || flagValue(a, "--idempotency-key") != null) {
@@ -1297,7 +1297,7 @@ async function rename(args) {
1297
1297
  : `name "${result.repo_name}" set for ${projectId}`,
1298
1298
  );
1299
1299
  if (address) console.error(`address: ${address}`);
1300
- else console.error("this org has no slug yet — set one with `run402 org slug <slug>` to get a full run402::<slug>/<name> address");
1300
+ else console.error("this org has no slug yet — set one with `run402 orgs slug <slug>` to get a full run402::<slug>/<name> address");
1301
1301
  printVerboseStats(a, sdk);
1302
1302
  } catch (err) {
1303
1303
  reportSdkError(err);
@@ -1376,7 +1376,7 @@ async function del(args) {
1376
1376
  } else {
1377
1377
  ({ projectId, rest } = resolveProjectSelector(a, { rejectBareFirst: true }));
1378
1378
  }
1379
- requirePositionalCount(rest.filter((x) => x !== "--force"), [], { min: 0, max: 0, command: "run402 repos delete [--project <id>] [--repo <repo_id>] [--force]", missing: "" });
1379
+ requirePositionalCount(rest.filter((x) => x !== "--force"), [], { min: 0, max: 0, command: "run402 repos delete [--project <project_id>] [--repo <repo_id>] [--force]", missing: "" });
1380
1380
  const force = a.includes("--force");
1381
1381
 
1382
1382
  let status;
@@ -2935,7 +2935,7 @@ async function accessRevokeKey(args) {
2935
2935
  * eligible starting at the NEXT rotation.
2936
2936
  */
2937
2937
  /**
2938
- * `repos access repin --principal <id> --fingerprint <ek_…>` — a KEY-HOLDER
2938
+ * `repos access repin --principal <principal_id> --fingerprint <ek_…>` — a KEY-HOLDER
2939
2939
  * explicitly accepts a recipient's CHANGED key (gitvault-agent-envelopes D3).
2940
2940
  * The session-start reconcile refuses `pinned_key_mismatch` and never
2941
2941
  * bypasses it, not even after an owner's revoke — acceptance names the new
package/lib/rooms.mjs CHANGED
@@ -53,8 +53,8 @@ Usage:
53
53
  run402 rooms leave [<presence_id>]
54
54
 
55
55
  Addressing:
56
- --project <id> That project's DEFAULT room (the room key IS the project id)
57
- --org <id> --room <key> A named org room
56
+ --project <project_id> That project's DEFAULT room (the room key IS the project id)
57
+ --org <org_id> --room <key> A named org room
58
58
  (omit both) Resolved from RUN402_ROOM, a .run402.json binding, or the
59
59
  wallet profile's selected org
60
60
 
@@ -82,7 +82,7 @@ export function reportSdkError(err) {
82
82
  fail({
83
83
  code: "PROJECT_CREDENTIAL_NOT_FOUND",
84
84
  message: err?.message || "Local project credentials are not cached.",
85
- hint: "This is a local credential-cache miss, not proof that the project does not exist. Use a principal-auth command, or import keys with `run402 credentials project-keys import --project <id> --service-key-stdin` for credential-required operations.",
85
+ hint: "This is a local credential-cache miss, not proof that the project does not exist. Use a principal-auth command, or import keys with `run402 credentials project-keys import --project <project_id> --service-key-stdin` for credential-required operations.",
86
86
  details: err?.details,
87
87
  next_actions: err?.nextActions,
88
88
  retryable: err?.retryable ?? false,
package/lib/secrets.mjs CHANGED
@@ -10,10 +10,10 @@ Usage:
10
10
  run402 secrets <subcommand> [args...]
11
11
 
12
12
  Subcommands:
13
- set <key> (--value <v> | --file <path> | --stdin) [--project <id>]
13
+ set <key> (--value <v> | --file <path> | --stdin) [--project <project_id>]
14
14
  Set a secret on a project
15
- list [--project <id>] List all secrets for a project
16
- delete <key> [--project <id>] Delete a secret from a project
15
+ list [--project <project_id>] List all secrets for a project
16
+ delete <key> [--project <project_id>] Delete a secret from a project
17
17
 
18
18
  Legacy (still supported):
19
19
  run402 secrets set <prj_id> <key> <value>
@@ -38,9 +38,9 @@ const SUB_HELP = {
38
38
  set: `run402 secrets set — Set a secret on a project
39
39
 
40
40
  Usage:
41
- run402 secrets set <key> --value <v> [--project <id>]
42
- run402 secrets set <key> --file <path> [--project <id>]
43
- run402 secrets set <key> --stdin [--project <id>]
41
+ run402 secrets set <key> --value <v> [--project <project_id>]
42
+ run402 secrets set <key> --file <path> [--project <project_id>]
43
+ run402 secrets set <key> --stdin [--project <project_id>]
44
44
 
45
45
  Legacy (still supported):
46
46
  run402 secrets set <prj_id> <key> <value>
@@ -50,7 +50,7 @@ Arguments:
50
50
  <key> Secret key name (exposed as process.env.<key>)
51
51
 
52
52
  Options:
53
- --project <id> Project ID (defaults to the active project)
53
+ --project <project_id> Project ID (defaults to the active project)
54
54
  --value <v> Inline secret value (alternative to the legacy positional)
55
55
  --file <path> Read the secret value from a file instead of inline
56
56
  Use --file - or --file /dev/stdin to read from stdin
@@ -71,13 +71,13 @@ Examples:
71
71
  list: `run402 secrets list — List all secrets for a project
72
72
 
73
73
  Usage:
74
- run402 secrets list [--project <id>]
74
+ run402 secrets list [--project <project_id>]
75
75
 
76
76
  Legacy (still supported):
77
77
  run402 secrets list <prj_id>
78
78
 
79
79
  Options:
80
- --project <id> Project ID (defaults to the active project)
80
+ --project <project_id> Project ID (defaults to the active project)
81
81
 
82
82
  Notes:
83
83
  - Returns secret keys and timestamps only; raw values and value-derived hashes are never returned
@@ -88,7 +88,7 @@ Examples:
88
88
  delete: `run402 secrets delete — Delete a secret from a project
89
89
 
90
90
  Usage:
91
- run402 secrets delete <key> [--project <id>]
91
+ run402 secrets delete <key> [--project <project_id>]
92
92
 
93
93
  Legacy (still supported):
94
94
  run402 secrets delete <prj_id> <key>
@@ -97,7 +97,7 @@ Arguments:
97
97
  <key> Secret key name to remove
98
98
 
99
99
  Options:
100
- --project <id> Project ID (defaults to the active project)
100
+ --project <project_id> Project ID (defaults to the active project)
101
101
 
102
102
  Examples:
103
103
  run402 secrets delete STRIPE_KEY --project prj_abc123
@@ -147,7 +147,7 @@ async function set(projectId, args = []) {
147
147
  fail({
148
148
  code: "BAD_USAGE",
149
149
  message: "Missing <key>.",
150
- hint: "run402 secrets set <key> --value <v> [--project <id>]",
150
+ hint: "run402 secrets set <key> --value <v> [--project <project_id>]",
151
151
  });
152
152
  }
153
153
  const values = positionals.slice(1);
@@ -235,7 +235,7 @@ async function deleteSecret(projectId, args = []) {
235
235
  fail({
236
236
  code: "BAD_USAGE",
237
237
  message: "Missing <key>.",
238
- hint: "run402 secrets delete <key> [--project <id>]",
238
+ hint: "run402 secrets delete <key> [--project <project_id>]",
239
239
  });
240
240
  }
241
241
  if (positionals.length > 1) {
package/lib/sites.mjs CHANGED
@@ -13,8 +13,8 @@ const SMALL_DIR_THRESHOLD = 5;
13
13
  const HELP = `run402 sites - Deploy and manage static sites
14
14
 
15
15
  Usage:
16
- run402 sites deploy --manifest <file> [--project <id>]
17
- run402 sites deploy-dir <path> --project <id>
16
+ run402 sites deploy --manifest <file> [--project <project_id>]
17
+ run402 sites deploy-dir <path> --project <project_id>
18
18
  cat manifest.json | run402 sites deploy
19
19
 
20
20
  Subcommands:
@@ -23,12 +23,12 @@ Subcommands:
23
23
 
24
24
  Options (deploy):
25
25
  --manifest <file> Path to manifest JSON file (or read from stdin)
26
- --project <id> Project ID (defaults to active project)
26
+ --project <project_id> Project ID (defaults to active project)
27
27
  --help, -h Show this help message
28
28
 
29
29
  Options (deploy-dir):
30
30
  <path> Positional: local directory to deploy
31
- --project <id> Project ID (defaults to active project)
31
+ --project <project_id> Project ID (defaults to active project)
32
32
  --quiet Suppress progress events on stderr
33
33
  --dry-run Plan-only: print the diff envelope and exit
34
34
  --confirm-prune Required when <path> has fewer files than the
@@ -58,7 +58,7 @@ Notes:
58
58
  (CAS-backed): only bytes the gateway doesn't already have are uploaded.
59
59
  Re-deploys of an unchanged tree make no S3 PUTs.
60
60
  - To check status of an in-flight deploy, use 'run402 deploy events <op>'
61
- or 'run402 deploy list --project <id>'.
61
+ or 'run402 deploy list --project <project_id>'.
62
62
  - deploy-dir walks the directory, skips .git / node_modules / .DS_Store,
63
63
  and auto-detects binary files. Symlinks are rejected.
64
64
  - Progress events are emitted as JSON-line objects on stderr by default
@@ -71,12 +71,12 @@ const SUB_HELP = {
71
71
  deploy: `run402 sites deploy - Deploy a static site from a manifest
72
72
 
73
73
  Usage:
74
- run402 sites deploy --manifest <file> [--project <id>]
75
- cat manifest.json | run402 sites deploy [--project <id>]
74
+ run402 sites deploy --manifest <file> [--project <project_id>]
75
+ cat manifest.json | run402 sites deploy [--project <project_id>]
76
76
 
77
77
  Options:
78
78
  --manifest <file> Path to manifest JSON file (or read from stdin)
79
- --project <id> Project ID (defaults to the active project)
79
+ --project <project_id> Project ID (defaults to the active project)
80
80
 
81
81
  Manifest format (JSON):
82
82
  {
@@ -99,14 +99,14 @@ Examples:
99
99
  "deploy-dir": `run402 sites deploy-dir - Deploy a static site from a local directory
100
100
 
101
101
  Usage:
102
- run402 sites deploy-dir <path> [--project <id>] [--quiet]
102
+ run402 sites deploy-dir <path> [--project <project_id>] [--quiet]
103
103
  [--dry-run] [--confirm-prune]
104
104
 
105
105
  Arguments:
106
106
  <path> Local directory to deploy (positional, required)
107
107
 
108
108
  Options:
109
- --project <id> Project ID (defaults to the active project)
109
+ --project <project_id> Project ID (defaults to the active project)
110
110
  --quiet Suppress progress events on stderr (events are on by
111
111
  default — see Progress events below)
112
112
  --dry-run Plan the deploy and print a JSON envelope describing
@@ -196,7 +196,7 @@ async function deploy(args) {
196
196
  fail({
197
197
  code: "BAD_USAGE",
198
198
  message: `Unexpected argument for sites deploy: ${extra[0]}`,
199
- hint: "Use `run402 sites deploy --manifest <file> [--project <id>]`.",
199
+ hint: "Use `run402 sites deploy --manifest <file> [--project <project_id>]`.",
200
200
  });
201
201
  }
202
202
  const opts = { manifest: null, project: undefined, target: undefined, quiet: false };
@@ -252,7 +252,7 @@ async function deployDir(args) {
252
252
  fail({
253
253
  code: "BAD_USAGE",
254
254
  message: `Unexpected argument for sites deploy-dir: ${positionals[1]}`,
255
- hint: "Use `run402 sites deploy-dir <path> --project <id>`.",
255
+ hint: "Use `run402 sites deploy-dir <path> --project <project_id>`.",
256
256
  });
257
257
  }
258
258
  const opts = {
@@ -282,7 +282,7 @@ async function deployDir(args) {
282
282
  fail({
283
283
  code: "BAD_USAGE",
284
284
  message: "Missing <path>.",
285
- hint: "run402 sites deploy-dir <path> --project <id>",
285
+ hint: "run402 sites deploy-dir <path> --project <project_id>",
286
286
  });
287
287
  }
288
288
  const projectId = resolveProjectId(opts.project);
@@ -325,7 +325,7 @@ async function deployDir(args) {
325
325
  if (opts.dryRun) {
326
326
  try {
327
327
  const { plan } = await getSdk()._applyEngine.plan({
328
- project: projectId,
328
+ project_id: projectId,
329
329
  site: { replace: fileSet },
330
330
  }, { dryRun: true });
331
331
  console.log(JSON.stringify({