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
@@ -11,7 +11,7 @@
11
11
  * organization named directly outranks one derived from a project named in that
12
12
  * same class:
13
13
  *
14
- * 1. flag --org <org_id> else --project <id> -> its org
14
+ * 1. flag --org <org_id> else --project <project_id> -> its org
15
15
  * 2. environment RUN402_ORG, else the org else RUN402_PROJECT_ID -> its org
16
16
  * half of RUN402_ROOM
17
17
  * 3. binding the `org` key of the nearest .run402(.local).json
@@ -57,7 +57,7 @@ export const ROOM_ENV = "RUN402_ROOM";
57
57
  export const PROJECT_ENV = "RUN402_PROJECT_ID";
58
58
 
59
59
  /** Command groups that must stay usable while selection is ambiguous. */
60
- const CONFLICT_EXEMPT = new Set(["org", "wallets", "doctor"]);
60
+ const CONFLICT_EXEMPT = new Set(["orgs", "wallets", "doctor"]);
61
61
 
62
62
  /** `org_id` is a UUID at every API boundary (`uuidParam` on every route). */
63
63
  const ORG_ID_RE = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;
@@ -78,7 +78,7 @@ function assertOrgIdShape(orgId, origin) {
78
78
  fail({
79
79
  code: "BAD_ORG_ID",
80
80
  message: `Invalid organization id ${JSON.stringify(describeRejectedValue(orgId))} (from ${origin}).`,
81
- hint: "An org_id is a UUID. Run 'run402 org list' to see the organizations you belong to.",
81
+ hint: "An org_id is a UUID. Run 'run402 orgs list' to see the organizations you belong to.",
82
82
  details: { org_id: describeRejectedValue(orgId), origin },
83
83
  next_actions: [listOrgsAction()],
84
84
  });
@@ -118,7 +118,7 @@ async function readGitvaultPinnedOrgId(cwd) {
118
118
 
119
119
  function listOrgsAction() {
120
120
  return nextAction("edit_request", {
121
- command: "run402 org list",
121
+ command: "run402 orgs list",
122
122
  why: "List the organizations this wallet belongs to.",
123
123
  });
124
124
  }
@@ -126,7 +126,7 @@ function listOrgsAction() {
126
126
  function orgRequiredActions() {
127
127
  return [
128
128
  nextAction("edit_request", {
129
- command: "run402 org use <org_id>",
129
+ command: "run402 orgs use <org_id>",
130
130
  why: "Select a current organization for this wallet profile.",
131
131
  }),
132
132
  listOrgsAction(),
@@ -266,7 +266,7 @@ export async function resolveOrg(input = {}, opts = {}) {
266
266
  // --- Class 4: profile state ----------------------------------------------
267
267
  const selected = trimmed(coreGetActiveOrgId());
268
268
  if (selected) {
269
- return { orgId: assertOrgIdShape(selected, "org use"), source: "profile", sourceDetail: "org use" };
269
+ return { orgId: assertOrgIdShape(selected, "orgs use"), source: "profile", sourceDetail: "orgs use" };
270
270
  }
271
271
  const activeProject = trimmed(getActiveProjectId());
272
272
  if (activeProject) {
@@ -278,7 +278,7 @@ export async function resolveOrg(input = {}, opts = {}) {
278
278
  fail({
279
279
  code: "ORG_REQUIRED",
280
280
  message: "No organization specified and no current organization set.",
281
- hint: `Pass --org <org_id>, set ${ORG_ENV}, bind this directory in .run402.json, or run: run402 org use <org_id>`,
281
+ hint: `Pass --org <org_id>, set ${ORG_ENV}, bind this directory in .run402.json, or run: run402 orgs use <org_id>`,
282
282
  next_actions: orgRequiredActions(),
283
283
  });
284
284
  return null; // unreachable — fail() exits
@@ -301,17 +301,17 @@ export async function resolveOrgId(a, opts = {}) {
301
301
  * Every Org-Scoped Command").
302
302
  *
303
303
  * `<org_id>` is optional sugar on every verb that acts on an organization —
304
- * `org get`, `org member add`, `billing link-wallet`, … A leading positional
304
+ * `orgs get`, `orgs members add`, `billing link-wallet`, … A leading positional
305
305
  * that IS an org id (a UUID) addresses that org; anything else is the verb's
306
306
  * own next positional (a wallet, an email, a principal) and the org comes from
307
307
  * the shared chain: `--org`, then `RUN402_ORG`, then the `.run402.json`
308
- * binding, then `org use`. So inside a bound checkout the two-agent case reads
309
- * `run402 org member add 0xB… --role developer` with nothing else to know.
308
+ * binding, then `orgs use`. So inside a bound checkout the two-agent case reads
309
+ * `run402 orgs members add 0xB… --role developer` with nothing else to know.
310
310
  *
311
311
  * Naming the org twice with different values (positional AND `--org`) is
312
312
  * `AMBIGUOUS_ORG`, never a silent pick — the same refusal the env-vs-binding
313
313
  * pair gets. A non-org first positional with no chain answer fails
314
- * `ORG_REQUIRED` and NAMES the rejected value, so `org get foo` says why `foo`
314
+ * `ORG_REQUIRED` and NAMES the rejected value, so `orgs get foo` says why `foo`
315
315
  * did not count rather than reporting a bare "no organization".
316
316
  *
317
317
  * Returns the org id with provenance plus the REMAINING positionals; bound
@@ -350,7 +350,7 @@ export async function takeOrgPositional(a, valueFlags = [], opts = {}) {
350
350
  message: typeof first === "string"
351
351
  ? `No organization specified and no current organization set (${JSON.stringify(first)} is not an org_id — an org_id is a UUID).`
352
352
  : "No organization specified and no current organization set.",
353
- hint: `Pass --org <org_id> (or a leading <org_id> positional), set ${ORG_ENV}, bind this directory in .run402.json, or run: run402 org use <org_id>`,
353
+ hint: `Pass --org <org_id> (or a leading <org_id> positional), set ${ORG_ENV}, bind this directory in .run402.json, or run: run402 orgs use <org_id>`,
354
354
  ...(typeof first === "string" ? { details: { rejected_positional: first } } : {}),
355
355
  next_actions: orgRequiredActions(),
356
356
  });
@@ -388,7 +388,7 @@ export function getSelectedOrgId() {
388
388
  }
389
389
 
390
390
  /** Record the profile's selected organization. */
391
- export function setSelectedOrgId(orgId, origin = "org use") {
391
+ export function setSelectedOrgId(orgId, origin = "orgs use") {
392
392
  coreSetActiveOrgId(assertOrgIdShape(orgId, origin));
393
393
  }
394
394