@takisvc/code-canvas 0.1.0 → 0.1.1

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.
@@ -125,26 +125,6 @@ function showUsage(usage) {
125
125
  function extractAgentkitChallenge(body) {
126
126
  return body?.extensions?.agentkit ?? body?.accepts?.[0]?.extensions?.agentkit ?? body?.paymentRequirements?.[0]?.extensions?.agentkit ?? body?.challenge;
127
127
  }
128
- function runRegistration(address) {
129
- console.log();
130
- console.log(
131
- chalk.yellow("Launching World ID registration \u2014 scan the QR code with your World App:")
132
- );
133
- console.log();
134
- try {
135
- execSync(
136
- `npx @worldcoin/agentkit-cli register ${address} --network world`,
137
- { stdio: "inherit" }
138
- );
139
- console.log();
140
- console.log(chalk.green("Registration successful!"));
141
- return true;
142
- } catch {
143
- console.log();
144
- console.log(chalk.red("Registration failed or was cancelled."));
145
- return false;
146
- }
147
- }
148
128
  async function generateImage(endpoint2, prompt2, account2) {
149
129
  const spinner = ora(randomSpinnerMessage()).start();
150
130
  const interval = setInterval(() => {
@@ -235,25 +215,14 @@ async function generateImage(endpoint2, prompt2, account2) {
235
215
  spinner.stop();
236
216
  console.log();
237
217
  console.log(chalk.yellow("Your agent is not registered with World ID."));
238
- const registered = runRegistration(account2.address);
239
- if (registered) {
240
- console.log();
241
- console.log(chalk.cyan("Retrying image generation..."));
242
- return false;
243
- }
244
218
  console.log();
245
- console.log(
246
- ` ${chalk.bold("Option 1:")} Try registration again manually:`
247
- );
248
- console.log(
249
- ` npx @worldcoin/agentkit-cli register ${account2.address} --network world`
250
- );
219
+ console.log(` ${chalk.bold("Register:")} Run this in your terminal and scan the QR code with World App:`);
251
220
  console.log();
252
- console.log(
253
- ` ${chalk.bold("Option 2:")} Pay ${chalk.cyan("$1.20 USDC")} per image:`
254
- );
255
- console.log(` Fund your wallet with USDC on World Chain and re-run.`);
256
- console.log(` Wallet: ${account2.address}`);
221
+ console.log(` npx @worldcoin/agentkit-cli register ${account2.address} --network world`);
222
+ console.log();
223
+ console.log(` Then re-run the image generation command.`);
224
+ console.log();
225
+ console.log(` ${chalk.bold("Or pay:")} Fund wallet ${account2.address} with ${chalk.cyan("$1.20 USDC")} on World Chain.`);
257
226
  if (errorBody?.error) {
258
227
  console.log();
259
228
  console.log(chalk.dim(`Server: ${errorBody.error}`));
@@ -276,7 +245,4 @@ if (!prompt) {
276
245
  var account = ensureWallet();
277
246
  var endpoint = `${SERVER_URL}/code-canvas/generate-image`;
278
247
  var success = await generateImage(endpoint, prompt, account);
279
- if (!success && !process.exitCode) {
280
- success = await generateImage(endpoint, prompt, account);
281
- }
282
248
  process.exit(success ? 0 : 1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takisvc/code-canvas",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "code-canvas": "./dist/code-canvas.js"