image-skill 0.1.61 → 0.1.62

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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,14 @@ This changelog tracks the public `image-skill` CLI package and public skill
4
4
  mirror. The npm package metadata remains the authority for tarball integrity and
5
5
  provenance; this file is the human- and agent-readable release map.
6
6
 
7
+ ## 0.1.62 - 2026-06-17
8
+
9
+ - Release (activation/self-fund): make `usage quota --json` top-up handoffs
10
+ copy-runnable from ephemeral `npx image-skill@latest` runs. Quota
11
+ `top_up`, generated `next_actions.self_fund`, and create-guide embedded
12
+ quota top-up commands now carry the public handoff prefix instead of bare
13
+ `image-skill ...` commands.
14
+
7
15
  ## 0.1.61 - 2026-06-17
8
16
 
9
17
  - Release (activation/self-fund): add payment-attempt continuation actions.
@@ -15,7 +15,7 @@ import { Readable } from "node:stream";
15
15
  import { pipeline } from "node:stream/promises";
16
16
  import os from "node:os";
17
17
 
18
- const VERSION = "0.1.61";
18
+ const VERSION = "0.1.62";
19
19
  const PACKAGE_NAME = "image-skill";
20
20
  const DEFAULT_API_BASE_URL = "https://api.image-skill.com";
21
21
  const DEFAULT_DOCS_BASE_URL = "https://image-skill.com";
@@ -1746,16 +1746,22 @@ async function createGuide(args, options = {}) {
1746
1746
  maxEstimatedUsdPerImage ??
1747
1747
  estimatedDebitUsdPerImage ??
1748
1748
  (estimatedCredits === null ? 0.07 : estimatedCredits / 100);
1749
+ const quotaCommandPrefix = createGuideCommandPrefix({
1750
+ configPath: configuredImageSkillConfigPath(),
1751
+ });
1749
1752
  const quota =
1750
1753
  token.token === null
1751
1754
  ? null
1752
- : await apiRequest({
1753
- command: "image-skill create --guide",
1754
- method: "GET",
1755
- apiBaseUrl,
1756
- path: "/v1/quota",
1757
- token: token.token,
1758
- });
1755
+ : withQuotaNextActions(
1756
+ await apiRequest({
1757
+ command: "image-skill create --guide",
1758
+ method: "GET",
1759
+ apiBaseUrl,
1760
+ path: "/v1/quota",
1761
+ token: token.token,
1762
+ }),
1763
+ quotaCommandPrefix,
1764
+ );
1759
1765
  const authenticated = quota?.envelope.data?.authenticated === true;
1760
1766
  const publicTokenSource =
1761
1767
  token.source === "anonymous" ? "none" : token.source;
@@ -6341,7 +6347,10 @@ function withCommand(result, command) {
6341
6347
  };
6342
6348
  }
6343
6349
 
6344
- function withQuotaNextActions(result) {
6350
+ function withQuotaNextActions(
6351
+ result,
6352
+ commandPrefix = createGuideCommandPrefix(),
6353
+ ) {
6345
6354
  const data = result.envelope?.data;
6346
6355
  if (
6347
6356
  result.envelope?.ok !== true ||
@@ -6350,22 +6359,84 @@ function withQuotaNextActions(result) {
6350
6359
  ) {
6351
6360
  return result;
6352
6361
  }
6353
- const nextActions = quotaTopUpNextActions(data.top_up);
6362
+ const quotaData = quotaDataWithCopyRunnableTopUpCommands(data, commandPrefix);
6363
+ const nextActions = quotaTopUpNextActions(quotaData.top_up);
6354
6364
  if (nextActions === null) {
6355
- return result;
6365
+ return quotaData === data
6366
+ ? result
6367
+ : {
6368
+ ...result,
6369
+ envelope: {
6370
+ ...result.envelope,
6371
+ data: quotaData,
6372
+ },
6373
+ };
6356
6374
  }
6357
6375
  return {
6358
6376
  ...result,
6359
6377
  envelope: {
6360
6378
  ...result.envelope,
6361
6379
  data: {
6362
- ...data,
6380
+ ...quotaData,
6363
6381
  next_actions: nextActions,
6364
6382
  },
6365
6383
  },
6366
6384
  };
6367
6385
  }
6368
6386
 
6387
+ function quotaDataWithCopyRunnableTopUpCommands(data, commandPrefix) {
6388
+ if (data.top_up === undefined || data.top_up === null) {
6389
+ return data;
6390
+ }
6391
+ const topUp = quotaTopUpWithCopyRunnableCommands(data.top_up, commandPrefix);
6392
+ return topUp === data.top_up ? data : { ...data, top_up: topUp };
6393
+ }
6394
+
6395
+ function quotaTopUpWithCopyRunnableCommands(topUp, commandPrefix) {
6396
+ const commands = topUp.commands;
6397
+ const workflow = topUp.workflow;
6398
+ if (topUp === null || typeof topUp !== "object") {
6399
+ return topUp;
6400
+ }
6401
+ const render = (command) =>
6402
+ renderCopyRunnablePaymentCommand(commandPrefix, command);
6403
+ const renderIfString = (value) =>
6404
+ typeof value === "string" ? render(value) : value;
6405
+ return {
6406
+ ...topUp,
6407
+ first_command: renderIfString(topUp.first_command),
6408
+ quote_command: renderIfString(topUp.quote_command),
6409
+ commands:
6410
+ commands !== null && typeof commands === "object"
6411
+ ? {
6412
+ ...commands,
6413
+ inspect_methods: renderIfString(commands.inspect_methods),
6414
+ inspect_packs: renderIfString(commands.inspect_packs),
6415
+ quote: renderIfString(commands.quote),
6416
+ buy: renderIfString(commands.buy),
6417
+ status: renderIfString(commands.status),
6418
+ fallback_quote: renderIfString(commands.fallback_quote),
6419
+ fallback_buy: renderIfString(commands.fallback_buy),
6420
+ }
6421
+ : commands,
6422
+ workflow:
6423
+ workflow !== null &&
6424
+ typeof workflow === "object" &&
6425
+ Array.isArray(workflow.steps)
6426
+ ? {
6427
+ ...workflow,
6428
+ steps: workflow.steps.map((step) =>
6429
+ step !== null &&
6430
+ typeof step === "object" &&
6431
+ typeof step.command === "string"
6432
+ ? { ...step, command: render(step.command) }
6433
+ : step,
6434
+ ),
6435
+ }
6436
+ : workflow,
6437
+ };
6438
+ }
6439
+
6369
6440
  function quotaTopUpNextActions(topUp) {
6370
6441
  const commands = topUp?.commands;
6371
6442
  if (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "image-skill",
3
- "version": "0.1.61",
3
+ "version": "0.1.62",
4
4
  "description": "Zero-setup durable creative-media CLI for agents (image + video + audio + 3D): guide-first creation, model and cost inspection, owned URLs, JSON recovery, payments, reusable assets, and feedback.",
5
5
  "type": "module",
6
6
  "private": false,