@powerhousedao/ph-cli 6.4.0-next.3 → 6.4.0-next.6

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 (129) hide show
  1. package/dist/auth-5bqHASGL.mjs +4 -0
  2. package/dist/auth-DYknkWfW.mjs +23 -0
  3. package/dist/auth-DYknkWfW.mjs.map +1 -0
  4. package/dist/{build-B-rPwjM8.mjs → build-CGnPJwut.mjs} +8 -8
  5. package/dist/{build-B-rPwjM8.mjs.map → build-CGnPJwut.mjs.map} +1 -1
  6. package/dist/build-mTLB2w-Q.mjs +4 -0
  7. package/dist/{check-B7C3Vi_b.mjs → check-CW81vbe9.mjs} +4 -4
  8. package/dist/{check-B7C3Vi_b.mjs.map → check-CW81vbe9.mjs.map} +1 -1
  9. package/dist/{check-DeUTd514.mjs → check-Ch1obo1o.mjs} +3 -3
  10. package/dist/{check-DM7UdFTK.mjs → check-DQnWxQCS.mjs} +7 -7
  11. package/dist/check-DQnWxQCS.mjs.map +1 -0
  12. package/dist/{cli-connect-override-Bx_g3-ZE.mjs → cli-connect-override-DKxY3lCi.mjs} +4 -4
  13. package/dist/{cli-connect-override-Bx_g3-ZE.mjs.map → cli-connect-override-DKxY3lCi.mjs.map} +1 -1
  14. package/dist/cli.mjs +9 -8
  15. package/dist/cli.mjs.map +1 -1
  16. package/dist/{compound-Q9sZSEZF-DQvtoigb.mjs → compound-g6x_KkWp-Bs7olmlI.mjs} +465 -361
  17. package/dist/compound-g6x_KkWp-Bs7olmlI.mjs.map +1 -0
  18. package/dist/{connect-build-CaTxdYcc.mjs → connect-build-CQgSyKm1.mjs} +8 -10
  19. package/dist/connect-build-CQgSyKm1.mjs.map +1 -0
  20. package/dist/{connect-config-A-U83U8U.mjs → connect-config-BpzwJln3.mjs} +4 -4
  21. package/dist/{connect-config-A-U83U8U.mjs.map → connect-config-BpzwJln3.mjs.map} +1 -1
  22. package/dist/{connect-preview-BvxXGo_W.mjs → connect-preview-B_E4SIV6.mjs} +21 -4
  23. package/dist/connect-preview-B_E4SIV6.mjs.map +1 -0
  24. package/dist/connect-studio-SH4U0Cpm.mjs +214 -0
  25. package/dist/connect-studio-SH4U0Cpm.mjs.map +1 -0
  26. package/dist/credentials-CmtYywgk.mjs +132 -0
  27. package/dist/credentials-CmtYywgk.mjs.map +1 -0
  28. package/dist/definitions-worker.mjs +4 -4
  29. package/dist/definitions-worker.mjs.map +1 -1
  30. package/dist/{dev-host-RhWeATKB.mjs → dev-host-CM-Jg2kY.mjs} +4 -4
  31. package/dist/{dev-host-RhWeATKB.mjs.map → dev-host-CM-Jg2kY.mjs.map} +1 -1
  32. package/dist/{dist-D_UjZsgt.mjs → dist-DPj_FB8H.mjs} +5 -5
  33. package/dist/dist-DPj_FB8H.mjs.map +1 -0
  34. package/dist/{explain-DbbHpa61.mjs → explain-DQ5ymlco.mjs} +5 -5
  35. package/dist/{explain-DbbHpa61.mjs.map → explain-DQ5ymlco.mjs.map} +1 -1
  36. package/dist/{export-FduYVQEM.mjs → export-CzeF8pob.mjs} +4 -4
  37. package/dist/{export-FduYVQEM.mjs.map → export-CzeF8pob.mjs.map} +1 -1
  38. package/dist/{files-DEHg350R.mjs → files-D6_euBBn.mjs} +4 -4
  39. package/dist/{files-DEHg350R.mjs.map → files-D6_euBBn.mjs.map} +1 -1
  40. package/dist/{generate-all-BE8UmbJv.mjs → generate-all-B9MwWXlq.mjs} +4 -4
  41. package/dist/{generate-all-BE8UmbJv.mjs.map → generate-all-B9MwWXlq.mjs.map} +1 -1
  42. package/dist/{generate-document-model-DSYPTMZg.mjs → generate-document-model-D3LKY1D7.mjs} +6 -8
  43. package/dist/generate-document-model-D3LKY1D7.mjs.map +1 -0
  44. package/dist/{generate-subgraph-EQ2ZjMp9.mjs → generate-subgraph-Q1VLh3SC.mjs} +10 -17
  45. package/dist/generate-subgraph-Q1VLh3SC.mjs.map +1 -0
  46. package/dist/{get-version-7oKMD8Gt.mjs → get-version-Cz5WJkpH.mjs} +4 -4
  47. package/dist/{get-version-7oKMD8Gt.mjs.map → get-version-Cz5WJkpH.mjs.map} +1 -1
  48. package/dist/identity-DXZFeQfC.mjs +137 -0
  49. package/dist/identity-DXZFeQfC.mjs.map +1 -0
  50. package/dist/{index-Bs1PfL3W.d.mts → index-aosqo7aM.d.mts} +5 -4
  51. package/dist/index-aosqo7aM.d.mts.map +1 -0
  52. package/dist/{inspect-CulIpVsF.mjs → inspect-BgKI8Fhd.mjs} +6 -6
  53. package/dist/{inspect-CulIpVsF.mjs.map → inspect-BgKI8Fhd.mjs.map} +1 -1
  54. package/dist/{keyframes-bFo9iDhT.mjs → keyframes-BkeORfEu.mjs} +4 -4
  55. package/dist/{keyframes-bFo9iDhT.mjs.map → keyframes-BkeORfEu.mjs.map} +1 -1
  56. package/dist/{mcp-CcZT9zT9.mjs → mcp-Cx2HhCsK.mjs} +149 -7
  57. package/dist/mcp-Cx2HhCsK.mjs.map +1 -0
  58. package/dist/{migrate-Ddr7YAtM.mjs → migrate-BzPAS4zM.mjs} +4 -4
  59. package/dist/{migrate-Ddr7YAtM.mjs.map → migrate-BzPAS4zM.mjs.map} +1 -1
  60. package/dist/{migrate-document-models-X_mVTljj.mjs → migrate-document-models-BcrQKkDB.mjs} +5 -6
  61. package/dist/migrate-document-models-BcrQKkDB.mjs.map +1 -0
  62. package/dist/migrate-subgraphs-ChQdt6w7.mjs +4 -0
  63. package/dist/{migrate-subgraphs-Ffwwm7Oy.mjs → migrate-subgraphs-Dw5UFCQ3.mjs} +6 -7
  64. package/dist/migrate-subgraphs-Dw5UFCQ3.mjs.map +1 -0
  65. package/dist/ph-cli-commands-BcDloXsM.mjs +4 -0
  66. package/dist/{ph-cli-commands-D4Z6YSwd.mjs → ph-cli-commands-CGR5p3vg.mjs} +161 -107
  67. package/dist/ph-cli-commands-CGR5p3vg.mjs.map +1 -0
  68. package/dist/{registry-auth-Bm5AR-fB.mjs → registry-auth-C8D5cno2.mjs} +4 -4
  69. package/dist/{registry-auth-Bm5AR-fB.mjs.map → registry-auth-C8D5cno2.mjs.map} +1 -1
  70. package/dist/render-BQE20Cnd.mjs +4 -0
  71. package/dist/{render-SVfj3m8A.mjs → render-CQdi685k.mjs} +6 -6
  72. package/dist/render-CQdi685k.mjs.map +1 -0
  73. package/dist/{run-LRGy7zGo.mjs → run-C6Vha5VN.mjs} +3 -3
  74. package/dist/{run--de_-WAz.mjs → run-sVzTTEUx.mjs} +5 -36
  75. package/dist/run-sVzTTEUx.mjs.map +1 -0
  76. package/dist/{run-sugar-CkuGJuPg.mjs → run-sugar-BuxOaRzE.mjs} +5 -5
  77. package/dist/{run-sugar-CkuGJuPg.mjs.map → run-sugar-BuxOaRzE.mjs.map} +1 -1
  78. package/dist/{run-sugar-Dd_Mu058.mjs → run-sugar-Dz-rpeMO.mjs} +3 -3
  79. package/dist/runners/connect.d.mts +20 -3
  80. package/dist/runners/connect.d.mts.map +1 -1
  81. package/dist/runners/connect.mjs +37 -15
  82. package/dist/runners/connect.mjs.map +1 -1
  83. package/dist/runners/switchboard.d.mts +1 -1
  84. package/dist/runners/switchboard.mjs +3 -3
  85. package/dist/scripts/generate-commands-docs.ts +12 -0
  86. package/dist/{subgraphs-7OYWwP-C.mjs → subgraphs-Bm9NHTCn.mjs} +5 -38
  87. package/dist/subgraphs-Bm9NHTCn.mjs.map +1 -0
  88. package/dist/{sugar-checks-CAtgUIem.mjs → sugar-checks-DL-J3l2y.mjs} +6 -6
  89. package/dist/{sugar-checks-CAtgUIem.mjs.map → sugar-checks-DL-J3l2y.mjs.map} +1 -1
  90. package/dist/{verify-DXrs0JUp.mjs → verify-B3CKpYI8.mjs} +5 -5
  91. package/dist/{verify-DXrs0JUp.mjs.map → verify-B3CKpYI8.mjs.map} +1 -1
  92. package/dist/{vetra-gateway-BHuz7pvS.mjs → vetra-gateway-BZJEJiGT.mjs} +5 -5
  93. package/dist/{vetra-gateway-BHuz7pvS.mjs.map → vetra-gateway-BZJEJiGT.mjs.map} +1 -1
  94. package/dist/vetra-gateway-CeWIXaAl.mjs +4 -0
  95. package/dist/vetra-host-0rSW35_r.mjs +230 -0
  96. package/dist/vetra-host-0rSW35_r.mjs.map +1 -0
  97. package/dist/{vetra-launcher-B5L3yXPo.mjs → vetra-launcher-6NKfi6Au.mjs} +45 -5
  98. package/dist/vetra-launcher-6NKfi6Au.mjs.map +1 -0
  99. package/dist/vetra-launcher-XMk_Hv0c.mjs +4 -0
  100. package/package.json +17 -15
  101. package/dist/auth-BFUq7CvE.mjs +0 -18
  102. package/dist/auth-BFUq7CvE.mjs.map +0 -1
  103. package/dist/auth-CNhbN5UM.mjs +0 -4
  104. package/dist/build-DuwAPWMY.mjs +0 -4
  105. package/dist/check-DM7UdFTK.mjs.map +0 -1
  106. package/dist/compound-Q9sZSEZF-DQvtoigb.mjs.map +0 -1
  107. package/dist/connect-build-CaTxdYcc.mjs.map +0 -1
  108. package/dist/connect-preview-BvxXGo_W.mjs.map +0 -1
  109. package/dist/connect-studio-B2gugCJU.mjs +0 -106
  110. package/dist/connect-studio-B2gugCJU.mjs.map +0 -1
  111. package/dist/dist-D_UjZsgt.mjs.map +0 -1
  112. package/dist/generate-document-model-DSYPTMZg.mjs.map +0 -1
  113. package/dist/generate-subgraph-EQ2ZjMp9.mjs.map +0 -1
  114. package/dist/index-Bs1PfL3W.d.mts.map +0 -1
  115. package/dist/mcp-CcZT9zT9.mjs.map +0 -1
  116. package/dist/migrate-document-models-X_mVTljj.mjs.map +0 -1
  117. package/dist/migrate-subgraphs-DEqWkLoh.mjs +0 -4
  118. package/dist/migrate-subgraphs-Ffwwm7Oy.mjs.map +0 -1
  119. package/dist/ph-cli-commands-D4Z6YSwd.mjs.map +0 -1
  120. package/dist/ph-cli-commands-p9cO6MsE.mjs +0 -4
  121. package/dist/render-3M3DwFzO.mjs +0 -4
  122. package/dist/render-SVfj3m8A.mjs.map +0 -1
  123. package/dist/run--de_-WAz.mjs.map +0 -1
  124. package/dist/subgraphs-7OYWwP-C.mjs.map +0 -1
  125. package/dist/vetra-gateway-ag33E_Ta.mjs +0 -4
  126. package/dist/vetra-host-CYdbd3J3.mjs +0 -111
  127. package/dist/vetra-host-CYdbd3J3.mjs.map +0 -1
  128. package/dist/vetra-launcher-B5L3yXPo.mjs.map +0 -1
  129. package/dist/vetra-launcher-BUO9e74r.mjs +0 -4
@@ -1,10 +1,10 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d9725588-ce21-5651-b8da-3c4e72510054")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="bab91682-f557-502a-a7ab-c248d7699755")}catch(e){}}();
3
3
  import { n as skipInstallArgs } from "./install-added-dependencies-DnZFR3aE.mjs";
4
- import { n as isDevHost } from "./dev-host-RhWeATKB.mjs";
5
- import { n as VETRA_STUDIO_HOST, r as VETRA_STUDIO_PACKAGE } from "./vetra-gateway-BHuz7pvS.mjs";
4
+ import { n as isDevHost } from "./dev-host-CM-Jg2kY.mjs";
5
+ import { n as VETRA_STUDIO_HOST, r as VETRA_STUDIO_PACKAGE } from "./vetra-gateway-BZJEJiGT.mjs";
6
6
  import { boolean, command, extendType, flag, multioption, number, oneOf, option, optional, positional, restPositionals, string, subcommands } from "cmd-ts";
7
- import { AGENTS, accessTokenArgs, buildArgs, connectConfigArgs, debugArgs, hostCheckArgs, hostExportArgs, initArgs, inspectArgs, installArgs, keyframesArgs, listArgs, loginArgs, mcpArgs, migrateArgs, modelCheckArgs, modelInspectArgs, publishArgs, registryLoginArgs, uninstallArgs, unpublishArgs } from "@powerhousedao/shared/clis/args";
7
+ import { AGENTS, accessTokenArgs, buildArgs, connectConfigArgs, credentialsListArgs, credentialsWithdrawArgs, debugArgs, hostCheckArgs, hostExportArgs, identityPasswordArgs, initArgs, inspectArgs, installArgs, keyframesArgs, listArgs, loginArgs, logoutArgs, mcpArgs, migrateArgs, modelCheckArgs, modelInspectArgs, publishArgs, registryLoginArgs, uninstallArgs, unpublishArgs, whoamiArgs } from "@powerhousedao/shared/clis/args";
8
8
  import { DEFAULT_EXPIRY_SECONDS } from "@powerhousedao/shared/clis/constants";
9
9
  import fs from "node:fs";
10
10
  import path from "node:path";
@@ -26,8 +26,8 @@ This command:
26
26
 
27
27
  Prerequisites:
28
28
  You must have a cryptographic identity. Run 'ph login' first to:
29
- - Generate a keypair (stored in .ph/.keypair.json)
30
- - Optionally link your Ethereum address (stored in .ph/.renown.json)
29
+ - Generate a keypair (stored in ~/.ph/identities/renown/.keypair.json)
30
+ - Optionally link your Ethereum address (stored in ~/.ph/identities/renown/.renown.json)
31
31
 
32
32
  Token Details:
33
33
  The generated token is a JWT (JSON Web Token) containing:
@@ -66,7 +66,7 @@ Notes:
66
66
  handler: async (args) => {
67
67
  if (args.debug) console.log(args);
68
68
  const { generateAccessToken, parseExpiry, formatExpiry } = await import("@renown/sdk/node");
69
- const { getRenown } = await import("./auth-CNhbN5UM.mjs");
69
+ const { getRenown } = await import("./auth-5bqHASGL.mjs");
70
70
  const renown = await getRenown();
71
71
  let expiresIn = DEFAULT_EXPIRY_SECONDS;
72
72
  if (args.expiry) expiresIn = parseExpiry(args.expiry);
@@ -105,7 +105,7 @@ can load and still fail at runtime, so don't publish it.`,
105
105
  handler: async (args) => {
106
106
  if (args.debug) console.log(args);
107
107
  try {
108
- const { runBuild } = await import("./build-DuwAPWMY.mjs");
108
+ const { runBuild } = await import("./build-mTLB2w-Q.mjs");
109
109
  await runBuild(args, {
110
110
  checkDefinitions: true,
111
111
  ownsProcess: true
@@ -138,7 +138,7 @@ Writes go to:
138
138
  `,
139
139
  args: connectConfigArgs,
140
140
  handler: async (args) => {
141
- const { runConnectConfig } = await import("./connect-config-A-U83U8U.mjs");
141
+ const { runConnectConfig } = await import("./connect-config-BpzwJln3.mjs");
142
142
  await runConnectConfig(args);
143
143
  }
144
144
  });
@@ -148,13 +148,49 @@ const connect = subcommands({
148
148
  cmds: { config }
149
149
  });
150
150
  //#endregion
151
+ //#region src/commands/credentials.ts
152
+ const credentialsList = command({
153
+ name: "list",
154
+ description: `
155
+ List the credentials this store's host accepts by its own record (\`.ph/credentials\` in the
156
+ data folder): who, the session's label, who wrote it, its expiry and whether it verifies.
157
+ `,
158
+ args: credentialsListArgs,
159
+ handler: async (args) => {
160
+ if (args.debug) console.log(args);
161
+ const { runCredentialsList } = await import("./credentials-CmtYywgk.mjs");
162
+ process.exitCode = await runCredentialsList(args);
163
+ }
164
+ });
165
+ const credentialsWithdraw = command({
166
+ name: "withdraw",
167
+ description: `
168
+ Withdraw credential records by id prefix, address or label. A running host refuses a withdrawn
169
+ credential from its next request, and the withdrawal holds after a restart.
170
+ `,
171
+ args: credentialsWithdrawArgs,
172
+ handler: async (args) => {
173
+ if (args.debug) console.log(args);
174
+ const { runCredentialsWithdraw } = await import("./credentials-CmtYywgk.mjs");
175
+ process.exitCode = runCredentialsWithdraw(args);
176
+ }
177
+ });
178
+ const credentials = subcommands({
179
+ name: "credentials",
180
+ description: "The credentials this store's host accepts: `list`, `withdraw`.",
181
+ cmds: {
182
+ list: credentialsList,
183
+ withdraw: credentialsWithdraw
184
+ }
185
+ });
186
+ //#endregion
151
187
  //#region src/commands/generate-all.ts
152
188
  const generateAllCmd = command({
153
189
  name: "all",
154
190
  description: "Re-generate all modules in the current project",
155
191
  args: {},
156
192
  handler: async () => {
157
- const { startGenerateAll } = await import("./generate-all-BE8UmbJv.mjs");
193
+ const { startGenerateAll } = await import("./generate-all-B9MwWXlq.mjs");
158
194
  await startGenerateAll(process.cwd());
159
195
  process.exit(0);
160
196
  }
@@ -296,22 +332,16 @@ const generateDocumentModelCmd = command({
296
332
  short: "a",
297
333
  description: "Re-generate all existing document models in the current project"
298
334
  }),
299
- /** @experimental Code-first scaffolding is being tested in production. */
300
335
  name: option({
301
336
  type: optional(string),
302
337
  long: "name",
303
338
  short: "n",
304
- description: "Experimental. Create a code-first document model with this name, with its editor"
305
- }),
306
- /** @experimental Chooses code-first authoring for the model --name creates. */
307
- codeFirst: flag({
308
- long: "code-first",
309
- description: "Experimental. With --name, create the model code-first. Existing models of both styles are discovered without it; ph migrate --document-model converts a schema-first one"
339
+ description: "Create a document model with this name, with its editor"
310
340
  }),
311
341
  ...debugArgs
312
342
  },
313
343
  handler: async (args) => {
314
- const { startGenerateDocumentModel } = await import("./generate-document-model-DSYPTMZg.mjs");
344
+ const { startGenerateDocumentModel } = await import("./generate-document-model-D3LKY1D7.mjs");
315
345
  await startGenerateDocumentModel(args, process.cwd());
316
346
  process.exit(0);
317
347
  }
@@ -612,7 +642,7 @@ const generateCmds = {
612
642
  type: optional(string),
613
643
  long: "name",
614
644
  short: "n",
615
- description: "The name of the subgraph to generate"
645
+ description: "Create a subgraph with this name. A subgraph directory that already exists keeps its form"
616
646
  }),
617
647
  dir: option({
618
648
  type: optional(ModuleDir),
@@ -624,16 +654,11 @@ const generateCmds = {
624
654
  short: "a",
625
655
  description: "Re-generate all existing subgraphs in the current project"
626
656
  }),
627
- /** @experimental */
628
- codeFirst: flag({
629
- long: "code-first",
630
- description: "Experimental. With --name, create a new subgraph code-first. Existing subgraphs keep their own style; ph migrate --subgraph converts one"
631
- }),
632
657
  ...skipInstallArgs,
633
658
  ...debugArgs
634
659
  },
635
660
  handler: async (args) => {
636
- const { startGenerateSubgraph } = await import("./generate-subgraph-EQ2ZjMp9.mjs");
661
+ const { startGenerateSubgraph } = await import("./generate-subgraph-Q1VLh3SC.mjs");
637
662
  await startGenerateSubgraph(args, process.cwd());
638
663
  process.exit(0);
639
664
  }
@@ -658,7 +683,7 @@ const check = command({
658
683
  description: "Check a host the way `ph run` would, without starting it: every load, validation, resolution and boot issue, grouped by host file. Exits 1 on any issue. `--env <file>` checks against that file alone.",
659
684
  args: hostCheckArgs,
660
685
  handler: async (args) => {
661
- const { runHostCheck } = await import("./check-B7C3Vi_b.mjs");
686
+ const { runHostCheck } = await import("./check-CW81vbe9.mjs");
662
687
  const { output, exitCode } = await runHostCheck(args);
663
688
  console.log(output);
664
689
  process.exitCode = exitCode;
@@ -669,7 +694,7 @@ const exportCmd = command({
669
694
  description: "Print a host as declared, with every member a compound names, as JSON (tokens unresolved). `--out` writes it to a file instead.",
670
695
  args: hostExportArgs,
671
696
  handler: async (args) => {
672
- const { runHostExport } = await import("./export-FduYVQEM.mjs");
697
+ const { runHostExport } = await import("./export-CzeF8pob.mjs");
673
698
  const { stdout, stderr, exitCode } = await runHostExport(args);
674
699
  if (stdout !== void 0) process.stdout.write(stdout);
675
700
  if (stderr !== void 0) process.stderr.write(stderr);
@@ -685,6 +710,22 @@ const host = subcommands({
685
710
  }
686
711
  });
687
712
  //#endregion
713
+ //#region src/commands/identity.ts
714
+ const identityPassword = command({
715
+ name: "password",
716
+ description: "Set, change or remove the password of your pseudonym, in the home folder and in every store it was copied into. Makes the pseudonym when there is none.",
717
+ args: identityPasswordArgs,
718
+ handler: async (args) => {
719
+ const { runIdentityPassword } = await import("./identity-DXZFeQfC.mjs");
720
+ process.exitCode = await runIdentityPassword(args);
721
+ }
722
+ });
723
+ const identity = subcommands({
724
+ name: "identity",
725
+ description: "Manage your pseudonym: `password`.",
726
+ cmds: { password: identityPassword }
727
+ });
728
+ //#endregion
688
729
  //#region src/commands/init.ts
689
730
  const init = command({
690
731
  name: "init",
@@ -857,7 +898,7 @@ run by hand.
857
898
  args: keyframesArgs,
858
899
  handler: async (args) => {
859
900
  if (args.debug) console.log(args);
860
- const { runKeyframesCommand } = await import("./keyframes-bFo9iDhT.mjs");
901
+ const { runKeyframesCommand } = await import("./keyframes-BkeORfEu.mjs");
861
902
  const exitCode = await runKeyframesCommand(args);
862
903
  process.exit(exitCode);
863
904
  }
@@ -911,38 +952,31 @@ This command:
911
952
  1. Generates or loads a cryptographic identity (DID) for the CLI
912
953
  2. Opens your browser to the Renown authentication page
913
954
  3. You authorize the CLI's DID to act on behalf of your Ethereum address
914
- 4. Stores the credentials locally in .ph/.renown.json
955
+ 4. Stores the login in your home folder (~/.ph/identities/renown), for every project
915
956
  `,
916
957
  args: loginArgs,
917
958
  handler: async (args) => {
918
959
  if (args.debug) console.log(args);
919
- const { getRenown } = await import("./auth-CNhbN5UM.mjs");
920
- const renown = await getRenown(args.renownUrl);
921
- if (args.showDid) {
922
- console.log(renown.did);
923
- process.exit(0);
924
- }
925
960
  if (args.status) {
926
- const { getAuthStatus } = await import("@renown/sdk/node");
927
- const status = getAuthStatus(renown);
928
- if (!status.authenticated || !status.address) {
929
- console.log("Not authenticated with an Ethereum address.");
930
- console.log("Run \"ph login\" to authenticate.");
931
- } else {
932
- console.log("Authenticated");
933
- console.log(` ETH Address: ${status.address}`);
934
- console.log(` User DID: ${status.userDid}`);
935
- console.log(` Chain ID: ${status.chainId}`);
936
- console.log(` CLI DID: ${status.cliDid}`);
937
- console.log(` Authenticated at: ${status.authenticatedAt?.toLocaleString()}`);
938
- console.log(` Renown URL: ${status.baseUrl}`);
939
- }
940
- process.exit(0);
961
+ const { runWhoami } = await import("./identity-DXZFeQfC.mjs");
962
+ process.exitCode = await runWhoami(args);
963
+ return;
941
964
  }
942
965
  if (args.logout) {
943
- await handleLogout();
966
+ const { runLogout } = await import("./identity-DXZFeQfC.mjs");
967
+ process.exitCode = await runLogout(args);
968
+ return;
969
+ }
970
+ const { getRenown } = await import("./auth-5bqHASGL.mjs");
971
+ const renown = await getRenown(args.renownUrl);
972
+ if (args.showDid) {
973
+ console.log(renown.did);
944
974
  process.exit(0);
945
975
  }
976
+ const { identityDataDir } = await import("@powerhousedao/shared/clis/identity");
977
+ const { projectLoginNotice } = await import("./identity-DXZFeQfC.mjs");
978
+ const notice = projectLoginNotice(identityDataDir());
979
+ if (notice) console.warn(notice);
946
980
  const { browserLogin } = await import("@renown/sdk/node");
947
981
  console.debug("Initializing cryptographic identity...");
948
982
  console.log(`CLI DID: ${renown.did}`);
@@ -984,31 +1018,18 @@ This command:
984
1018
  process.exit(0);
985
1019
  }
986
1020
  });
987
- async function handleLogout() {
988
- const { getRenown } = await import("./auth-CNhbN5UM.mjs");
989
- const renown = await getRenown();
990
- if (!renown.user) {
991
- console.log("Not currently authenticated.");
992
- return;
993
- }
994
- try {
995
- await renown.logout();
996
- console.log("Successfully logged out.");
997
- } catch (error) {
998
- console.error("Failed to clear credentials.");
999
- console.debug(error);
1000
- }
1001
- }
1002
1021
  //#endregion
1003
1022
  //#region src/commands/logout.ts
1004
1023
  const logout = command({
1005
1024
  name: "logout",
1006
1025
  description: `
1007
- The logout command removes an existing session created with 'ph login'`,
1008
- args: {},
1009
- handler: async () => {
1010
- await handleLogout();
1011
- process.exit(0);
1026
+ The logout command withdraws your Renown login at Renown and deletes it from this computer,
1027
+ its key included. Your pseudonym acts again.`,
1028
+ args: logoutArgs,
1029
+ handler: async (args) => {
1030
+ if (args.debug) console.log(args);
1031
+ const { runLogout } = await import("./identity-DXZFeQfC.mjs");
1032
+ process.exitCode = await runLogout(args);
1012
1033
  }
1013
1034
  });
1014
1035
  //#endregion
@@ -1037,7 +1058,7 @@ one.
1037
1058
  `,
1038
1059
  handler: async (args) => {
1039
1060
  if (args.debug) console.error(args);
1040
- const { startMcpLauncher } = await import("./mcp-CcZT9zT9.mjs");
1061
+ const { startMcpLauncher } = await import("./mcp-Cx2HhCsK.mjs");
1041
1062
  await startMcpLauncher({
1042
1063
  projectDir: args.projectDir,
1043
1064
  startTimeoutSeconds: args.startTimeout
@@ -1069,7 +1090,7 @@ const migrate = command({
1069
1090
  }
1070
1091
  let code = 0;
1071
1092
  if (models) {
1072
- const { migrateDocumentModels } = await import("./migrate-document-models-X_mVTljj.mjs");
1093
+ const { migrateDocumentModels } = await import("./migrate-document-models-BcrQKkDB.mjs");
1073
1094
  code |= await migrateDocumentModels({
1074
1095
  projectDir: process.cwd(),
1075
1096
  dirs: args.documentModel,
@@ -1078,7 +1099,7 @@ const migrate = command({
1078
1099
  });
1079
1100
  }
1080
1101
  if (subgraphs) {
1081
- const { migrateSubgraphs } = await import("./migrate-subgraphs-DEqWkLoh.mjs");
1102
+ const { migrateSubgraphs } = await import("./migrate-subgraphs-ChQdt6w7.mjs");
1082
1103
  code |= await migrateSubgraphs({
1083
1104
  projectDir: process.cwd(),
1084
1105
  dirs: args.subgraph,
@@ -1088,7 +1109,7 @@ const migrate = command({
1088
1109
  }
1089
1110
  process.exit(code);
1090
1111
  }
1091
- const { startMigrate } = await import("./migrate-Ddr7YAtM.mjs");
1112
+ const { startMigrate } = await import("./migrate-BzPAS4zM.mjs");
1092
1113
  await startMigrate(args);
1093
1114
  process.exit(0);
1094
1115
  }
@@ -1111,11 +1132,11 @@ stderr and exits 2.`;
1111
1132
  const modelCheck = command({
1112
1133
  name: "check",
1113
1134
  description: `Check this package's document models through one set of checks:
1114
- every model directory in documentModelsDir, whether it stores a schema-first
1115
- <name>.json or exports a code-first model from its index.ts. Writes nothing.
1135
+ every model directory in documentModelsDir, whether it stores the <name>.json of
1136
+ a legacy document model or exports a model from its index.ts. Writes nothing.
1116
1137
 
1117
- \`tsc\` cannot run these checks: a code-first model compiles when its module is
1118
- evaluated.
1138
+ \`tsc\` cannot run these checks: a document model with a definition compiles when
1139
+ its module is evaluated.
1119
1140
 
1120
1141
  --release (experimental) runs the checks \`ph build --release\` runs: these,
1121
1142
  the release checks, and host validation, which validates every model and the
@@ -1138,7 +1159,7 @@ ${EXPERIMENTAL}`,
1138
1159
  args: modelCheckArgs,
1139
1160
  handler: async (args) => {
1140
1161
  if (args.debug) console.error(args);
1141
- const [{ runModelCheck }, { exitWithModelCommand }] = await Promise.all([import("./check-DeUTd514.mjs"), import("./run-LRGy7zGo.mjs")]);
1162
+ const [{ runModelCheck }, { exitWithModelCommand }] = await Promise.all([import("./check-Ch1obo1o.mjs"), import("./run-C6Vha5VN.mjs")]);
1142
1163
  await exitWithModelCommand(args.json, (streams) => runModelCheck(args, { streams }));
1143
1164
  }
1144
1165
  });
@@ -1157,7 +1178,7 @@ ${EXPERIMENTAL}`,
1157
1178
  args: modelInspectArgs,
1158
1179
  handler: async (args) => {
1159
1180
  if (args.debug) console.error(args);
1160
- const [{ runModelInspect }, { exitWithModelCommand }] = await Promise.all([import("./inspect-CulIpVsF.mjs"), import("./run-LRGy7zGo.mjs")]);
1181
+ const [{ runModelInspect }, { exitWithModelCommand }] = await Promise.all([import("./inspect-BgKI8Fhd.mjs"), import("./run-C6Vha5VN.mjs")]);
1161
1182
  await exitWithModelCommand(args.json, (streams) => runModelInspect(args, { streams }));
1162
1183
  }
1163
1184
  });
@@ -1218,7 +1239,7 @@ This command:
1218
1239
  const { getPowerhouseProjectInfo } = await import("@powerhousedao/shared/clis");
1219
1240
  const { projectPath } = await getPowerhouseProjectInfo();
1220
1241
  if (!projectPath) throw new Error("Could not find project path.");
1221
- const { checkApprovalBeforePublish } = await import("./verify-DXrs0JUp.mjs");
1242
+ const { checkApprovalBeforePublish } = await import("./verify-B3CKpYI8.mjs");
1222
1243
  if (args.requireApproval) {
1223
1244
  const { ALLOWED_NPM_ARGUMENTS, refusedNpmArguments, targetSelectingNpmEnvironment } = await import("./npm-args-g1Tgel4s.mjs");
1224
1245
  const refused = refusedNpmArguments(args.forwardedArgs);
@@ -1238,7 +1259,7 @@ This command:
1238
1259
  if (packed) process.once("exit", packed.dispose);
1239
1260
  try {
1240
1261
  const { checkNpmAuth, npmPublish, resolveRegistryUrl } = await import("@powerhousedao/shared/registry");
1241
- const { mintRegistryAuthToken } = await import("./registry-auth-Bm5AR-fB.mjs");
1262
+ const { mintRegistryAuthToken } = await import("./registry-auth-C8D5cno2.mjs");
1242
1263
  const registryUrl = resolveRegistryUrl({
1243
1264
  registry: args.registry,
1244
1265
  projectPath
@@ -1339,7 +1360,7 @@ Usage:
1339
1360
  const projectPath = (await getPowerhouseProjectInfo().catch(() => null))?.projectPath ?? process.cwd();
1340
1361
  const [{ resolveRegistryUrl, writeRegistryAuthToken }, { mintRegistryAuthToken }, { parseExpiry, formatExpiry }] = await Promise.all([
1341
1362
  import("@powerhousedao/shared/registry"),
1342
- import("./registry-auth-Bm5AR-fB.mjs"),
1363
+ import("./registry-auth-C8D5cno2.mjs"),
1343
1364
  import("@renown/sdk/node")
1344
1365
  ]);
1345
1366
  const registryUrl = resolveRegistryUrl({
@@ -1392,8 +1413,17 @@ const runHost = command({
1392
1413
  })
1393
1414
  },
1394
1415
  handler: async (args) => {
1416
+ if (args.host === "supervisor") {
1417
+ const { runSupervisorCommand } = await import("@powerhousedao/ph-run/supervisor");
1418
+ process.exitCode = await runSupervisorCommand({
1419
+ verb: args.verb,
1420
+ argv: args.argv,
1421
+ stop: args.stop === true
1422
+ });
1423
+ return;
1424
+ }
1395
1425
  if (args.explain !== void 0) {
1396
- const { explainHost } = await import("./explain-DbbHpa61.mjs");
1426
+ const { explainHost } = await import("./explain-DQ5ymlco.mjs");
1397
1427
  await explainHost({
1398
1428
  host: args.host,
1399
1429
  topic: args.explain
@@ -1412,7 +1442,7 @@ const runHost = command({
1412
1442
  argv: args.argv
1413
1443
  };
1414
1444
  if (isDevHost(args.host)) {
1415
- const { runVetraHost } = await import("./vetra-host-CYdbd3J3.mjs");
1445
+ const { runVetraHost } = await import("./vetra-host-0rSW35_r.mjs");
1416
1446
  await runVetraHost(run);
1417
1447
  return;
1418
1448
  }
@@ -1575,6 +1605,32 @@ async function confirm(prompt) {
1575
1605
  }
1576
1606
  }
1577
1607
  //#endregion
1608
+ //#region src/commands/vetra.ts
1609
+ /**
1610
+ * `ph vetra`, the gateway to Vetra Studio. cli.ts hands every `ph vetra` but
1611
+ * its help to the gateway (services/vetra-gateway.ts), which makes it the
1612
+ * `ph run` of the studio host: this command gives the help and the docs.
1613
+ */
1614
+ const vetra = command({
1615
+ name: "vetra",
1616
+ description: `Open Vetra Studio: \`ph vetra [verb]\` is \`ph run ${VETRA_STUDIO_HOST} [verb]\`, the studio host of the ${VETRA_STUDIO_PACKAGE} package. A project without the package gets it first: \`ph vetra\` installs it as a devDependency, at this ph-cli's version, with the project's package manager. The runner arguments, --stop and --explain work as for \`ph run\`. The dev mode that \`ph vetra\` started before 6.4 (the project's hosts/vetra) is \`ph dev\`.`,
1617
+ args: {
1618
+ verb: positional({
1619
+ type: optional(string),
1620
+ displayName: "verb",
1621
+ description: "Verb of the studio host (default: the host's own)."
1622
+ }),
1623
+ argv: restPositionals({
1624
+ type: string,
1625
+ displayName: "runner arguments",
1626
+ description: "Arguments for the studio host's runner, as `ph run` takes them."
1627
+ })
1628
+ },
1629
+ handler: () => {
1630
+ throw new Error(`\`ph vetra\` is \`ph run ${VETRA_STUDIO_HOST}\`, through the gateway in cli.ts.`);
1631
+ }
1632
+ });
1633
+ //#endregion
1578
1634
  //#region src/commands/ph-cli-commands.ts
1579
1635
  const phCliCommands = {
1580
1636
  init,
@@ -1593,32 +1649,30 @@ const phCliCommands = {
1593
1649
  model,
1594
1650
  login,
1595
1651
  logout,
1652
+ whoami: command({
1653
+ name: "whoami",
1654
+ description: `
1655
+ Show who acts here: your Renown login when you are logged in (\`ph login\`), else your
1656
+ pseudonym, an Ethereum key made without a login and shown as "Anonymous" and a short
1657
+ address. Reads files only; \`--check\` also asks Renown whether the login is still valid.
1658
+ `,
1659
+ args: whoamiArgs,
1660
+ handler: async (args) => {
1661
+ if (args.debug) console.log(args);
1662
+ const { runWhoami } = await import("./identity-DXZFeQfC.mjs");
1663
+ process.exitCode = await runWhoami(args);
1664
+ }
1665
+ }),
1666
+ identity,
1667
+ credentials,
1596
1668
  install,
1597
1669
  uninstall,
1598
1670
  run: runHost,
1599
1671
  host,
1600
- vetra: command({
1601
- name: "vetra",
1602
- description: `Open Vetra Studio: \`ph vetra [verb]\` is \`ph run ${VETRA_STUDIO_HOST} [verb]\`, the studio host of the ${VETRA_STUDIO_PACKAGE} package. A project without the package gets it first: \`ph vetra\` installs it as a devDependency, at this ph-cli's version, with the project's package manager. The runner arguments, --stop and --explain work as for \`ph run\`. The dev mode that \`ph vetra\` started before 6.4 (the project's hosts/vetra) is \`ph dev\`.`,
1603
- args: {
1604
- verb: positional({
1605
- type: optional(string),
1606
- displayName: "verb",
1607
- description: "Verb of the studio host (default: the host's own)."
1608
- }),
1609
- argv: restPositionals({
1610
- type: string,
1611
- displayName: "runner arguments",
1612
- description: "Arguments for the studio host's runner, as `ph run` takes them."
1613
- })
1614
- },
1615
- handler: () => {
1616
- throw new Error(`\`ph vetra\` is \`ph run ${VETRA_STUDIO_HOST}\`, through the gateway in cli.ts.`);
1617
- }
1618
- })
1672
+ vetra
1619
1673
  };
1620
1674
  //#endregion
1621
1675
  export { phCliCommands as t };
1622
1676
 
1623
- //# sourceMappingURL=ph-cli-commands-D4Z6YSwd.mjs.map
1624
- //# debugId=d9725588-ce21-5651-b8da-3c4e72510054
1677
+ //# sourceMappingURL=ph-cli-commands-CGR5p3vg.mjs.map
1678
+ //# debugId=bab91682-f557-502a-a7ab-c248d7699755