image-skill 0.1.1 → 0.1.2

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/README.md CHANGED
@@ -17,6 +17,7 @@ Install the executable CLI from npm:
17
17
  npm install -g image-skill
18
18
  image-skill doctor --json
19
19
  image-skill signup --agent --human-email human@example.com --agent-name creative-agent --runtime openclaw --save --json
20
+ image-skill credits methods --json
20
21
  image-skill credits packs list --json
21
22
  image-skill credits quote --pack starter-500 --payment-method stripe_checkout --idempotency-key first-topup-001 --json
22
23
  image-skill credits buy --provider stripe --quote-id quote_... --idempotency-key first-buy-001 --json
@@ -7,7 +7,7 @@ import { Readable } from "node:stream";
7
7
  import { pipeline } from "node:stream/promises";
8
8
  import os from "node:os";
9
9
 
10
- const VERSION = "0.1.1";
10
+ const VERSION = "0.1.2";
11
11
  const DEFAULT_API_BASE_URL = "https://api.image-skill.com";
12
12
  const DEFAULT_CONFIG_PATH = join(
13
13
  process.env.XDG_CONFIG_HOME ?? join(os.homedir(), ".config"),
@@ -41,6 +41,7 @@ async function main(rawArgv) {
41
41
  "auth logout",
42
42
  "whoami",
43
43
  "usage quota",
44
+ "credits methods",
44
45
  "credits packs list",
45
46
  "credits quote",
46
47
  "credits buy",
@@ -335,6 +336,32 @@ async function quota(argv) {
335
336
 
336
337
  async function credits(argv) {
337
338
  const [subcommand, ...rest] = argv;
339
+ if (subcommand === "methods") {
340
+ const args = parseArgs(rest);
341
+ const unknownFlags = [...args.flags.keys()].filter(
342
+ (flag) => !["json", "api-base-url"].includes(flag),
343
+ );
344
+ if (!flagBool(args, "json")) {
345
+ return invalid(
346
+ "image-skill credits methods",
347
+ "credits methods requires --json",
348
+ );
349
+ }
350
+ if (args.positionals.length > 0 || unknownFlags.length > 0) {
351
+ return invalid(
352
+ "image-skill credits methods",
353
+ unknownFlags.length > 0
354
+ ? `unsupported flags for credits methods: ${unknownFlags.map((flag) => `--${flag}`).join(", ")}`
355
+ : "credits methods does not accept positional arguments",
356
+ );
357
+ }
358
+ return apiRequest({
359
+ command: "image-skill credits methods",
360
+ method: "GET",
361
+ apiBaseUrl: apiBase(args),
362
+ path: "/v1/payment-methods",
363
+ });
364
+ }
338
365
  if (subcommand === "packs") {
339
366
  const [packsSubcommand, ...packsRest] = rest;
340
367
  if (packsSubcommand !== "list") {
@@ -483,7 +510,7 @@ async function credits(argv) {
483
510
  }
484
511
  return invalid(
485
512
  "image-skill credits",
486
- "credits requires packs, quote, buy, status, or fake-purchase",
513
+ "credits requires methods, packs, quote, buy, status, or fake-purchase",
487
514
  );
488
515
  }
489
516
 
package/cli.md CHANGED
@@ -109,6 +109,58 @@ curl -sS https://api.image-skill.com/v1/quota \
109
109
  -H "authorization: Bearer $IMAGE_SKILL_TOKEN"
110
110
  ```
111
111
 
112
+ ### `image-skill credits methods`
113
+
114
+ Machine-readable payment rail discovery. Use this before quoting or buying so
115
+ agents can tell which rails are available, whether live money can move, whether
116
+ browser/human action is required, and which command to try next.
117
+
118
+ ```bash
119
+ image-skill credits methods --json
120
+ ```
121
+
122
+ Minimum success data shape:
123
+
124
+ ```json
125
+ {
126
+ "contract_version": "image-skill.payment-methods.v1",
127
+ "credit_unit_cents": 1,
128
+ "currency": "USD",
129
+ "quote_endpoint": "/v1/credit-quotes",
130
+ "packs_endpoint": "/v1/credit-packs",
131
+ "status_endpoint": "/v1/credit-purchases/status",
132
+ "methods": [
133
+ {
134
+ "method_id": "fake",
135
+ "available": true,
136
+ "live_money": false,
137
+ "buyer_modes": ["agent_only", "hybrid", "human_only"],
138
+ "requires_browser": false,
139
+ "purchase_endpoint": "/v1/credit-purchases"
140
+ },
141
+ {
142
+ "method_id": "stripe_checkout",
143
+ "available": true,
144
+ "live_money": true,
145
+ "buyer_modes": ["hybrid", "human_only"],
146
+ "requires_browser": true,
147
+ "default_pack_id": "starter-500",
148
+ "purchase_endpoint": "/v1/credit-purchases/stripe-checkout-sessions"
149
+ }
150
+ ]
151
+ }
152
+ ```
153
+
154
+ `available` is environment-dependent. `available:false` means the rail is known
155
+ but not currently usable in the queried environment; read `unavailable_reason`
156
+ and `recovery`.
157
+
158
+ Hosted API equivalent:
159
+
160
+ ```bash
161
+ curl -sS https://api.image-skill.com/v1/payment-methods
162
+ ```
163
+
112
164
  ### `image-skill credits packs list`
113
165
 
114
166
  Lists the recommended Image Skill credit packs for Stripe Checkout. Packs are
@@ -819,7 +871,7 @@ example, `BUDGET_REQUIRES_CONFIRMATION` returns
819
871
  `credits status`, `credits fake-purchase`, `create`, `activity list`,
820
872
  `activity show`, and `feedback create` accept `--token-stdin` for stdin-based
821
873
  secret handoff.
822
- `credits packs list` does not require auth.
874
+ `credits methods` and `credits packs list` do not require auth.
823
875
 
824
876
  Feedback should avoid raw prompts, provider keys, generated image bytes, source
825
877
  image bytes, and private user data.
package/llms.txt CHANGED
@@ -49,11 +49,12 @@ First-run flow:
49
49
  4. image-skill whoami --json
50
50
  5. image-skill usage quota --json
51
51
  5-credit-note. One Image Skill credit is $0.01. Credit quotes grant prepaid value units; create/edit operations debit model-priced credits reported as cost.credit_pricing. Starter preview currently gives bounded free-preview credits plus a two-job daily cap.
52
- 5a. image-skill credits packs list --json to inspect recommended live-money packs.
53
- 5b. image-skill credits quote --pack starter-500 --payment-method stripe_checkout --idempotency-key KEY --json for the default Stripe Checkout top-up path. Use --credits CREDITS instead of --pack only when the required exact budget is already known.
54
- 5c. image-skill credits buy --provider stripe --quote-id QUOTE_ID --idempotency-key KEY --json when the agent has a stripe_checkout quote and needs a Stripe-hosted checkout_url. Credits are granted only after verified Stripe webhook fulfillment succeeds.
55
- 5d. image-skill credits status --payment-attempt-id PAYMENT_ATTEMPT_ID --json after buy or checkout completion to read durable payment state, receipt, credit_event, limits, and retry guidance without inferring from quota text.
56
- 5e. image-skill credits quote --credits 10 --json and image-skill credits fake-purchase --quote-id QUOTE_ID --idempotency-key KEY --json only for fake/test credit-ledger proof. This moves no live money, accepts no payment credential, and returns live_money:false.
52
+ 5a. image-skill credits methods --json to inspect payment rails, availability, buyer modes, browser requirements, and recovery commands before quoting or buying.
53
+ 5b. image-skill credits packs list --json to inspect recommended live-money packs.
54
+ 5c. image-skill credits quote --pack starter-500 --payment-method stripe_checkout --idempotency-key KEY --json for the default Stripe Checkout top-up path. Use --credits CREDITS instead of --pack only when the required exact budget is already known.
55
+ 5d. image-skill credits buy --provider stripe --quote-id QUOTE_ID --idempotency-key KEY --json when the agent has a stripe_checkout quote and needs a Stripe-hosted checkout_url. Credits are granted only after verified Stripe webhook fulfillment succeeds.
56
+ 5e. image-skill credits status --payment-attempt-id PAYMENT_ATTEMPT_ID --json after buy or checkout completion to read durable payment state, receipt, credit_event, limits, and retry guidance without inferring from quota text.
57
+ 5f. image-skill credits quote --credits 10 --json and image-skill credits fake-purchase --quote-id QUOTE_ID --idempotency-key KEY --json only for fake/test credit-ledger proof. This moves no live money, accepts no payment credential, and returns live_money:false.
57
58
  6. image-skill create --dry-run --prompt PROMPT --json for zero-cost planning.
58
59
  7. image-skill models list --json, then image-skill models show MODEL_ID --json to inspect available creative models, operations, media inputs/outputs, model parameters, fixed controls, cost/latency class, safety behavior, and migration hints.
59
60
  8. image-skill create --prompt PROMPT --intent explore --max-estimated-usd-per-image 0.05 --json for the first bounded free-preview operation when quota allows.
@@ -70,6 +71,7 @@ Core commands:
70
71
  - image-skill whoami --json
71
72
  - image-skill usage quota --json
72
73
  - image-skill quota --json (compatibility alias)
74
+ - image-skill credits methods --json
73
75
  - image-skill credits packs list --json
74
76
  - image-skill credits quote --pack PACK_ID --payment-method fake|stripe_checkout --idempotency-key KEY --json
75
77
  - image-skill credits quote --credits CREDITS --payment-method fake|stripe_checkout --idempotency-key KEY --json
@@ -99,6 +101,7 @@ Hosted API endpoints:
99
101
  - POST https://api.image-skill.com/v1/agent-signups creates or rotates a restricted unclaimed agent token. The response returns the token once as data.token. Store it in the agent runtime secret store; never put it in prompts, logs, issue text, or feedback.
100
102
  - GET https://api.image-skill.com/v1/whoami returns durable hosted identity for Authorization: Bearer TOKEN.
101
103
  - GET https://api.image-skill.com/v1/quota returns durable hosted quota for Authorization: Bearer TOKEN.
104
+ - GET https://api.image-skill.com/v1/payment-methods returns the no-auth payment rail catalog. It tells agents which rails are available, whether live money can move, buyer modes (agent_only, hybrid, human_only), browser requirements, limits, endpoint paths, and recovery commands.
102
105
  - GET https://api.image-skill.com/v1/credit-packs returns the public pack catalog. Recommended live-money packs include starter-500, builder-2000, and studio-5000. Packs are the default Stripe Checkout UX; exact quotes remain supported for agents that already know the required credit budget.
103
106
  - POST https://api.image-skill.com/v1/credit-quotes returns a fake/test or stripe_checkout credit quote for Authorization: Bearer TOKEN. Request JSON: either credits or pack_id, optional payment_method, idempotency_key. Response includes quote_id, credits, price_amount_cents, currency, accepted_payment_method, pack_id, pack, and live_money. One credit equals $0.01, so price_amount_cents equals credits. This does not grant credits.
104
107
  - POST https://api.image-skill.com/v1/credit-purchases/stripe-checkout-sessions creates a Stripe Checkout Session for a stripe_checkout quote. Request JSON: quote_id, idempotency_key. Response includes state: action_required, payment_attempt_id, checkout_session_id, checkout_url, accepted_payment_method: stripe_checkout, and next.human_action: open_checkout_url. This does not grant credits; verified Stripe webhook fulfillment grants paid credits exactly once.
@@ -178,7 +181,7 @@ Unclaimed agents may not:
178
181
  - send card data, wallet secrets, provider receipts, Stripe secrets, MPP tokens, SPTs, or any payment credential to Image Skill; Stripe payment details must be entered only on Stripe-hosted checkout pages
179
182
 
180
183
  Credits:
181
- One Image Skill credit is $0.01. Use image-skill credits packs list --json to inspect recommended Stripe Checkout packs. Use image-skill credits quote --pack PACK_ID --payment-method stripe_checkout --json for the default live-money top-up path. Use image-skill credits quote --credits CREDITS --json for exact bounded custom top-ups when the required budget is already known. The default payment_method is fake. Use image-skill credits buy --provider stripe --json to create a hosted Stripe Checkout Session for a stripe_checkout quote; this returns checkout_url and does not grant credits. Use image-skill credits status --payment-attempt-id PAYMENT_ATTEMPT_ID --json after buy and after checkout completion to read state, receipt, credit_event, limits, and retry guidance. Use image-skill credits fake-purchase --json only to exercise the quote, receipt, credit-ledger, and activity-audit contract before live settlement rails are enabled. Create/edit debit model-priced credits after provider success; inspect models show and operation cost.credit_pricing for credits_required and pricing_confidence. Credits buy and fake-purchase require explicit --idempotency-key. Never send payment credentials to Image Skill; Stripe collects payment details on Stripe-hosted pages. Public request fields are credits, pack_id, payment_method, quote_id, status reference IDs, and idempotency_key.
184
+ One Image Skill credit is $0.01. Use image-skill credits methods --json to inspect payment rail availability and whether a browser/human action is required. Use image-skill credits packs list --json to inspect recommended Stripe Checkout packs. Use image-skill credits quote --pack PACK_ID --payment-method stripe_checkout --json for the default live-money top-up path. Use image-skill credits quote --credits CREDITS --json for exact bounded custom top-ups when the required budget is already known. The default payment_method is fake. Use image-skill credits buy --provider stripe --json to create a hosted Stripe Checkout Session for a stripe_checkout quote; this returns checkout_url and does not grant credits. Use image-skill credits status --payment-attempt-id PAYMENT_ATTEMPT_ID --json after buy and after checkout completion to read state, receipt, credit_event, limits, and retry guidance. Use image-skill credits fake-purchase --json only to exercise the quote, receipt, credit-ledger, and activity-audit contract before live settlement rails are enabled. Create/edit debit model-priced credits after provider success; inspect models show and operation cost.credit_pricing for credits_required and pricing_confidence. Credits buy and fake-purchase require explicit --idempotency-key. Never send payment credentials to Image Skill; Stripe collects payment details on Stripe-hosted pages. Public request fields are credits, pack_id, payment_method, quote_id, status reference IDs, and idempotency_key.
182
185
 
183
186
  Telemetry:
184
187
  - command or endpoint name
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "image-skill",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Thin hosted CLI for Image Skill, a creative runtime for agents.",
5
5
  "type": "module",
6
6
  "private": false,
package/skill.md CHANGED
@@ -81,6 +81,7 @@ path to meaningful usage.
81
81
  Credit quote and buy flow:
82
82
 
83
83
  ```bash
84
+ image-skill credits methods --json
84
85
  image-skill credits packs list --json
85
86
  image-skill credits quote \
86
87
  --pack starter-500 \
@@ -102,7 +103,10 @@ image-skill credits fake-purchase \
102
103
  This is the agent-facing precursor to future MPP, Stripe, wallet, or
103
104
  delegated-card adapters. Packs are the default Stripe Checkout UX; exact
104
105
  `--credits` quotes remain available when an agent already knows the required
105
- budget. `credits buy --provider stripe` returns a
106
+ budget. `credits methods --json` tells agents which rails are currently
107
+ available, which buyer modes they support, and whether browser/human action is
108
+ required before an agent tries to quote or buy. `credits buy --provider stripe`
109
+ returns a
106
110
  Stripe-hosted `checkout_url` for a `stripe_checkout` quote and does not grant
107
111
  credits until verified webhook fulfillment succeeds. `credits fake-purchase`
108
112
  returns `live_money:false`, moves no live money, accepts no payment credential,
@@ -293,6 +297,8 @@ closed if durable hosted feedback storage is unavailable.
293
297
 
294
298
  - Check `usage quota --json` before costly workflows. `quota --json` remains a
295
299
  compatibility alias.
300
+ - Use `credits methods --json` to inspect payment rail availability, buyer
301
+ modes, limits, and recovery commands before quoting or buying.
296
302
  - Use `credits packs list --json` to inspect recommended live-money packs.
297
303
  - Use `credits quote --pack PACK_ID --payment-method stripe_checkout --json`
298
304
  for the default Stripe Checkout path.