@hathbanger/jr-studio 0.0.2 → 0.0.4

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 (2) hide show
  1. package/dist/index.js +14 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -73843,7 +73843,7 @@ function writeJrConfig(updates) {
73843
73843
  fs2.writeFileSync(CONFIG_FILE2, JSON.stringify({ ...current, ...updates }, null, 2), "utf8");
73844
73844
  }
73845
73845
  function getApiUrl() {
73846
- return readJrConfig().api_url ?? process.env.JR_STUDIO_API_URL ?? "http://localhost:3000";
73846
+ return readJrConfig().api_url ?? process.env.JR_STUDIO_API_URL ?? "https://jr-studio-web.fly.dev";
73847
73847
  }
73848
73848
  function getNetwork() {
73849
73849
  const n = readJrConfig().network ?? process.env.JR_STUDIO_NETWORK;
@@ -73958,9 +73958,9 @@ async function promptForUrl(reason) {
73958
73958
  return new Promise((resolve) => {
73959
73959
  process.stdout.write(`\x1B[33m${reason}\x1B[0m
73960
73960
  `);
73961
- rl.question("Base URL [http://localhost:3100]: ", (answer) => {
73961
+ rl.question("Base URL [https://jr-studio-web.fly.dev]: ", (answer) => {
73962
73962
  rl.close();
73963
- const url = answer.trim() || "http://localhost:3100";
73963
+ const url = answer.trim() || "https://jr-studio-web.fly.dev";
73964
73964
  writeJrConfig({ api_url: url });
73965
73965
  resolve(url);
73966
73966
  });
@@ -79581,6 +79581,10 @@ var ExactEvmScheme = class {
79581
79581
  };
79582
79582
 
79583
79583
  // src/commands/jr-generate.ts
79584
+ var NETWORK_TO_CHAIN = {
79585
+ base: "eip155:8453",
79586
+ "base-sepolia": "eip155:84532"
79587
+ };
79584
79588
  async function jrGenerateAction(prompt2, options) {
79585
79589
  const token = requireToken();
79586
79590
  const apiUrl = getApiUrl();
@@ -79595,7 +79599,8 @@ async function jrGenerateAction(prompt2, options) {
79595
79599
  const signer = privateKeyToAccount(privateKey);
79596
79600
  const evmScheme = new ExactEvmScheme(signer);
79597
79601
  const client = new x402Client();
79598
- client.register(process.env.PAYMENT_NETWORK ?? "eip155:84532", evmScheme);
79602
+ const paymentNetwork = process.env.PAYMENT_NETWORK ?? NETWORK_TO_CHAIN[getNetwork()];
79603
+ client.register(paymentNetwork, evmScheme);
79599
79604
  fetchWithPayment = wrapFetchWithPayment(fetch, client);
79600
79605
  }
79601
79606
  const spinner = (0, import_ora2.default)(`Generating "${prompt2}"...`).start();
@@ -79626,13 +79631,13 @@ async function jrGenerateAction(prompt2, options) {
79626
79631
  const { default: readline4 } = await import("readline");
79627
79632
  const rl = readline4.createInterface({ input: process.stdin, output: process.stdout });
79628
79633
  const newBase = await new Promise(
79629
- (resolve) => rl.question("Base URL [http://localhost:3100]: ", (a) => {
79634
+ (resolve) => rl.question("Base URL [https://jr-studio-web.fly.dev]: ", (a) => {
79630
79635
  rl.close();
79631
- resolve(a.trim() || "http://localhost:3100");
79636
+ resolve(a.trim() || "https://jr-studio-web.fly.dev");
79632
79637
  })
79633
79638
  );
79634
79639
  writeJrConfig({ api_url: newBase });
79635
- process.stderr.write("URL saved. Re-run the command.\n");
79640
+ process.stderr.write("URL saved. Re-run the command. If the server uses Base Sepolia, run: jr-studio network base-sepolia\n");
79636
79641
  process.exit(1);
79637
79642
  }
79638
79643
  if (!res.ok) {
@@ -86901,7 +86906,7 @@ async function networkSetAction(network) {
86901
86906
 
86902
86907
  // src/index.ts
86903
86908
  var program2 = new Command();
86904
- program2.name("jr-studio").description("AI music generation CLI powered by EvoLink (Suno models)").version("0.1.0").option("--url <url>", "JR Studio base URL \u2014 saved to ~/.jr-studio/config.json for future calls");
86909
+ program2.name("jr-studio").description("AI music generation CLI powered by EvoLink (Suno models)").version("0.0.4").option("--url <url>", "JR Studio base URL \u2014 saved to ~/.jr-studio/config.json for future calls");
86905
86910
  program2.hook("preAction", () => {
86906
86911
  const { url } = program2.opts();
86907
86912
  if (url) writeJrConfig({ api_url: url.replace(/\/$/, "") });
@@ -86972,7 +86977,7 @@ program2.command("balances").description("Show ETH and USDC balances for your co
86972
86977
  json: options.json
86973
86978
  });
86974
86979
  });
86975
- var networkCmd = program2.command("network").description("Get or set the chain (base | base-sepolia) used for balances and on-chain operations");
86980
+ var networkCmd = program2.command("network").description("Get or set the chain (base | base-sepolia) for balances and x402 payment; must match server (e.g. jr-studio-web uses base-sepolia)");
86976
86981
  networkCmd.argument("[network]", "base | base-sepolia (omit to show current)").action(async (network) => {
86977
86982
  if (network) {
86978
86983
  await networkSetAction(network);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hathbanger/jr-studio",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "AI music generation CLI powered by EvoLink (Suno models)",
5
5
  "license": "ISC",
6
6
  "type": "commonjs",