image-skill 0.1.64 → 0.1.66
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 +19 -0
- package/SKILL.md +4 -3
- package/bin/image-skill.mjs +274 -137
- package/cli.md +2 -1
- package/llms.txt +1 -1
- package/package.json +1 -1
- package/skill.md +4 -3
- package/skills/image-skill/SKILL.md +4 -3
- package/skills/image-skill/references/cli.md +2 -1
- package/skills/image-skill/references/llms.txt +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,25 @@ 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.66 - 2026-06-18
|
|
8
|
+
|
|
9
|
+
- Release (activation/self-fund): publish ready-to-create guide
|
|
10
|
+
`data.self_fund_preparation` urgency fields, so agents that still have free
|
|
11
|
+
allowance can see `setup_recommended`, `urgency_score`, and
|
|
12
|
+
`urgency_reasons` before they spend down into the quota wall. The public CLI
|
|
13
|
+
also derives the same urgency from older hosted quota responses that only
|
|
14
|
+
carry `recommendation_reason`. No payment caps, wallet action, provider
|
|
15
|
+
spend, hosted deploy, or production write changed in this release bump.
|
|
16
|
+
|
|
17
|
+
## 0.1.65 - 2026-06-17
|
|
18
|
+
|
|
19
|
+
- Release (activation/self-fund): make hosted create/edit success
|
|
20
|
+
`data.quota.top_up` and `data.next_actions.self_fund` commands copy-runnable
|
|
21
|
+
from the public CLI, so near-wall agents can move from a successful media
|
|
22
|
+
response into the same zero-setup `npx image-skill@latest` top-up path as
|
|
23
|
+
quota reads and quota errors. No payment caps, wallet action, provider spend,
|
|
24
|
+
hosted deploy, or production write changed in this release bump.
|
|
25
|
+
|
|
7
26
|
## 0.1.64 - 2026-06-17
|
|
8
27
|
|
|
9
28
|
- Release (activation/self-fund): publish the hosted success-surface
|
package/SKILL.md
CHANGED
|
@@ -39,7 +39,7 @@ JSON is the default. Do not add `--json` to examples.
|
|
|
39
39
|
npm_config_update_notifier=false npx -y image-skill@latest create --guide --prompt "a compact field camera on a stainless workbench"
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
The guide is a free, zero-spend planning call. Given current auth, quota, and payment state, it returns `data.next_command`, `data.next_command_copy_runnable`, `data.next_command_missing_inputs`, `data.stage`, `data.guide_warning`, `data.next_command_effect`, `data.auth_ready`, `data.no_spend_evaluation`, `data.guide_recovery`, `data.recommended_no_spend_command` (alias of `data.no_spend_next_command`), `data.no_spend_next_command_effect`, `data.self_fund_next_command`, `data.self_fund_handoff`, `data.self_fund_preparation`, `data.auth_handoff`, and `data.mutation`. It also preserves `data.checks.quota.top_up`, the same quota top-up recommendation returned by `usage quota`, so wallet-capable agents can see whether a browserless x402 top-up is recommended before the hard wall. Read `data.guide_warning` before running `data.next_command`: `next_command_safety` names whether the command is no-spend setup, read-only inspection, live-money payment action, or live media create. Run that next command only when `data.next_command_copy_runnable` is `true` and the warning says it is safe for your spend policy; when it is `false`, fill `data.next_command_missing_inputs` first. Prefer `data.guide_recovery` for no-doc recovery loops: it names the safest no-spend command and field, the live create or payment field that would spend, and the double-spend guard to check before any live retry. Repeat until `data.stage` is `ready_to_create`. At `ready_to_create`, `data.auth_ready.ready` and `data.auth_ready.next_command_auth_ready` are `true`: the returned create can reuse saved config, env token, or stdin token context without exposing a raw token. Read `data.self_fund_preparation` in this stage before spending the remaining free allowance: when `available` and `recommended`
|
|
42
|
+
The guide is a free, zero-spend planning call. Given current auth, quota, and payment state, it returns `data.next_command`, `data.next_command_copy_runnable`, `data.next_command_missing_inputs`, `data.stage`, `data.guide_warning`, `data.next_command_effect`, `data.auth_ready`, `data.no_spend_evaluation`, `data.guide_recovery`, `data.recommended_no_spend_command` (alias of `data.no_spend_next_command`), `data.no_spend_next_command_effect`, `data.self_fund_next_command`, `data.self_fund_handoff`, `data.self_fund_preparation`, `data.auth_handoff`, and `data.mutation`. It also preserves `data.checks.quota.top_up`, the same quota top-up recommendation returned by `usage quota`, so wallet-capable agents can see whether a browserless x402 top-up is recommended before the hard wall. Read `data.guide_warning` before running `data.next_command`: `next_command_safety` names whether the command is no-spend setup, read-only inspection, live-money payment action, or live media create. Run that next command only when `data.next_command_copy_runnable` is `true` and the warning says it is safe for your spend policy; when it is `false`, fill `data.next_command_missing_inputs` first. Prefer `data.guide_recovery` for no-doc recovery loops: it names the safest no-spend command and field, the live create or payment field that would spend, and the double-spend guard to check before any live retry. Repeat until `data.stage` is `ready_to_create`. At `ready_to_create`, `data.auth_ready.ready` and `data.auth_ready.next_command_auth_ready` are `true`: the returned create can reuse saved config, env token, or stdin token context without exposing a raw token. Read `data.self_fund_preparation` in this stage before spending the remaining free allowance: when `available` is true, it mirrors top-up `urgency`, `urgency_score`, and `urgency_reasons`; when `recommended` is true, `quote_command` creates an authenticated live-money quote/payment object but does not pay, settle a wallet transfer, debit credits, call a provider, or write media. Only a later buy/payment step can spend money. When `data.guide_warning.next_command_safety` is `live_media_create_credit_debit` and `data.no_spend_evaluation.stop_here` is `true`, `data.next_command` is the live create: run it only if media spend is allowed, otherwise stop before it and run `data.recommended_no_spend_command` for no-spend proof. The no-spend command is an authenticated hosted dry-run: it may create a recoverable `job.planned` receipt, but it has no provider call, credit debit, downloadable asset, or media write.
|
|
43
43
|
|
|
44
44
|
When `data.stage` is `quota_required`, `data.self_fund_handoff` mirrors top-up `urgency`, `urgency_score`, and `urgency_reasons`, and exposes `first_safe_command` with a no-spend inspection effect. Run that no-spend command first when you need to inspect rails or stay below delegated spend authority before opening the live-money quote path.
|
|
45
45
|
|
|
@@ -204,8 +204,9 @@ exposes `first_safe_command`, usually `image-skill credits methods --json`, for
|
|
|
204
204
|
no-spend payment-method inspection before quote/buy steps.
|
|
205
205
|
When `create --guide` reaches `ready_to_create`, inspect
|
|
206
206
|
`data.self_fund_preparation` before consuming the remaining free allowance. If
|
|
207
|
-
it is available
|
|
208
|
-
|
|
207
|
+
it is available, `urgency`, `urgency_score`, and `urgency_reasons` mirror
|
|
208
|
+
`data.checks.quota.top_up`; if it is recommended, `quote_command` is the
|
|
209
|
+
pre-wall browserless x402 quote path: it creates an authenticated live-money quote/payment object
|
|
209
210
|
without paying, settling a wallet transfer, debiting credits, calling a
|
|
210
211
|
provider, or writing media. Only follow the later buy/status/wallet-settlement
|
|
211
212
|
commands when delegated spend is allowed.
|
package/bin/image-skill.mjs
CHANGED
|
@@ -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.
|
|
18
|
+
const VERSION = "0.1.66";
|
|
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";
|
|
@@ -1871,6 +1871,9 @@ async function createGuide(args, options = {}) {
|
|
|
1871
1871
|
stage,
|
|
1872
1872
|
paymentSummary,
|
|
1873
1873
|
);
|
|
1874
|
+
const quotaTopUp = createGuideQuotaTopUp(
|
|
1875
|
+
quota?.envelope.data?.top_up ?? null,
|
|
1876
|
+
);
|
|
1874
1877
|
const afterNext =
|
|
1875
1878
|
stage === "auth_required" || stage === "quota_required"
|
|
1876
1879
|
? renderGuideCommand(
|
|
@@ -1906,11 +1909,11 @@ async function createGuide(args, options = {}) {
|
|
|
1906
1909
|
afterNext,
|
|
1907
1910
|
tokenSource: publicTokenSource,
|
|
1908
1911
|
commandPrefix: guideCommandPrefix,
|
|
1909
|
-
quotaTopUp
|
|
1912
|
+
quotaTopUp,
|
|
1910
1913
|
});
|
|
1911
1914
|
const selfFundPreparation = createGuideSelfFundPreparation(stage, {
|
|
1912
1915
|
paymentSummary,
|
|
1913
|
-
quotaTopUp
|
|
1916
|
+
quotaTopUp,
|
|
1914
1917
|
afterNext,
|
|
1915
1918
|
tokenSource: publicTokenSource,
|
|
1916
1919
|
});
|
|
@@ -1964,7 +1967,7 @@ async function createGuide(args, options = {}) {
|
|
|
1964
1967
|
required_credits: estimatedCredits,
|
|
1965
1968
|
daily_jobs_remaining:
|
|
1966
1969
|
quota?.envelope.data?.daily_jobs?.remaining ?? null,
|
|
1967
|
-
top_up:
|
|
1970
|
+
top_up: quotaTopUp,
|
|
1968
1971
|
reason:
|
|
1969
1972
|
quota === null
|
|
1970
1973
|
? "auth_required"
|
|
@@ -2829,14 +2832,38 @@ function withCopyRunnablePaymentNextActionCommands(result, commandPrefix) {
|
|
|
2829
2832
|
}
|
|
2830
2833
|
|
|
2831
2834
|
function paymentNextActionsWithCopyRunnableCommands(data, commandPrefix) {
|
|
2835
|
+
let changed = false;
|
|
2836
|
+
let updated = data;
|
|
2837
|
+
|
|
2838
|
+
if (
|
|
2839
|
+
data.quota !== null &&
|
|
2840
|
+
typeof data.quota === "object" &&
|
|
2841
|
+
!Array.isArray(data.quota) &&
|
|
2842
|
+
data.quota.top_up !== null &&
|
|
2843
|
+
typeof data.quota.top_up === "object" &&
|
|
2844
|
+
!Array.isArray(data.quota.top_up)
|
|
2845
|
+
) {
|
|
2846
|
+
updated = {
|
|
2847
|
+
...updated,
|
|
2848
|
+
quota: {
|
|
2849
|
+
...data.quota,
|
|
2850
|
+
top_up: quotaTopUpWithCopyRunnableCommands(
|
|
2851
|
+
data.quota.top_up,
|
|
2852
|
+
commandPrefix,
|
|
2853
|
+
),
|
|
2854
|
+
},
|
|
2855
|
+
};
|
|
2856
|
+
changed = true;
|
|
2857
|
+
}
|
|
2858
|
+
|
|
2832
2859
|
if (
|
|
2833
2860
|
data.next_actions === null ||
|
|
2834
2861
|
typeof data.next_actions !== "object" ||
|
|
2835
2862
|
Array.isArray(data.next_actions)
|
|
2836
2863
|
) {
|
|
2837
|
-
return data;
|
|
2864
|
+
return changed ? updated : data;
|
|
2838
2865
|
}
|
|
2839
|
-
|
|
2866
|
+
|
|
2840
2867
|
const nextActions = { ...data.next_actions };
|
|
2841
2868
|
|
|
2842
2869
|
if (
|
|
@@ -2893,7 +2920,18 @@ function paymentNextActionsWithCopyRunnableCommands(data, commandPrefix) {
|
|
|
2893
2920
|
nextActions.recommended_settlement = recommendedSettlement;
|
|
2894
2921
|
}
|
|
2895
2922
|
|
|
2896
|
-
|
|
2923
|
+
if (
|
|
2924
|
+
nextActions.self_fund !== null &&
|
|
2925
|
+
typeof nextActions.self_fund === "object" &&
|
|
2926
|
+
!Array.isArray(nextActions.self_fund)
|
|
2927
|
+
) {
|
|
2928
|
+
const selfFund = { ...nextActions.self_fund };
|
|
2929
|
+
changed =
|
|
2930
|
+
renderSelfFundActionCommandFields(selfFund, commandPrefix) || changed;
|
|
2931
|
+
nextActions.self_fund = selfFund;
|
|
2932
|
+
}
|
|
2933
|
+
|
|
2934
|
+
return changed ? { ...updated, next_actions: nextActions } : data;
|
|
2897
2935
|
}
|
|
2898
2936
|
|
|
2899
2937
|
function renderPaymentActionCommandField(record, field, commandPrefix) {
|
|
@@ -2911,6 +2949,57 @@ function renderPaymentActionCommandField(record, field, commandPrefix) {
|
|
|
2911
2949
|
return true;
|
|
2912
2950
|
}
|
|
2913
2951
|
|
|
2952
|
+
function renderSelfFundActionCommandFields(record, commandPrefix) {
|
|
2953
|
+
let changed = false;
|
|
2954
|
+
for (const field of [
|
|
2955
|
+
"first_safe_command",
|
|
2956
|
+
"inspect_methods_command",
|
|
2957
|
+
"inspect_packs_command",
|
|
2958
|
+
"quote_command",
|
|
2959
|
+
"buy_command",
|
|
2960
|
+
"status_command",
|
|
2961
|
+
"fallback_quote_command",
|
|
2962
|
+
"fallback_buy_command",
|
|
2963
|
+
]) {
|
|
2964
|
+
changed =
|
|
2965
|
+
renderPaymentActionCommandField(record, field, commandPrefix) || changed;
|
|
2966
|
+
}
|
|
2967
|
+
|
|
2968
|
+
if (
|
|
2969
|
+
record.workflow !== null &&
|
|
2970
|
+
typeof record.workflow === "object" &&
|
|
2971
|
+
!Array.isArray(record.workflow) &&
|
|
2972
|
+
Array.isArray(record.workflow.steps)
|
|
2973
|
+
) {
|
|
2974
|
+
let workflowChanged = false;
|
|
2975
|
+
const steps = record.workflow.steps.map((step) => {
|
|
2976
|
+
if (
|
|
2977
|
+
step === null ||
|
|
2978
|
+
typeof step !== "object" ||
|
|
2979
|
+
Array.isArray(step) ||
|
|
2980
|
+
typeof step.command !== "string"
|
|
2981
|
+
) {
|
|
2982
|
+
return step;
|
|
2983
|
+
}
|
|
2984
|
+
const command = renderCopyRunnablePaymentCommand(
|
|
2985
|
+
commandPrefix,
|
|
2986
|
+
step.command,
|
|
2987
|
+
);
|
|
2988
|
+
if (command === step.command) {
|
|
2989
|
+
return step;
|
|
2990
|
+
}
|
|
2991
|
+
workflowChanged = true;
|
|
2992
|
+
return { ...step, command };
|
|
2993
|
+
});
|
|
2994
|
+
if (workflowChanged) {
|
|
2995
|
+
record.workflow = { ...record.workflow, steps };
|
|
2996
|
+
changed = true;
|
|
2997
|
+
}
|
|
2998
|
+
}
|
|
2999
|
+
|
|
3000
|
+
return changed;
|
|
3001
|
+
}
|
|
3002
|
+
|
|
2914
3003
|
function creditQuoteWithCopyRunnableCommands(quote, commandPrefix) {
|
|
2915
3004
|
const recommendedBuy =
|
|
2916
3005
|
quote.next_actions?.recommended_buy !== null &&
|
|
@@ -3178,9 +3267,7 @@ function createGuideSelfFundHandoff(stage, input) {
|
|
|
3178
3267
|
return {
|
|
3179
3268
|
required: true,
|
|
3180
3269
|
preferred_method: preferredMethod,
|
|
3181
|
-
|
|
3182
|
-
urgency_score: input.quotaTopUp?.urgency_score ?? null,
|
|
3183
|
-
urgency_reasons: input.quotaTopUp?.urgency_reasons ?? [],
|
|
3270
|
+
...createGuideQuotaTopUpUrgencyFields(input.quotaTopUp),
|
|
3184
3271
|
live_money:
|
|
3185
3272
|
preferredMethod !== null &&
|
|
3186
3273
|
input.paymentSummary.live_money_methods.includes(preferredMethod),
|
|
@@ -3257,6 +3344,7 @@ function createGuideSelfFundPreparation(stage, input) {
|
|
|
3257
3344
|
available,
|
|
3258
3345
|
recommended: input.quotaTopUp?.recommended === true,
|
|
3259
3346
|
recommendation_reason: input.quotaTopUp?.recommendation_reason ?? null,
|
|
3347
|
+
...createGuideQuotaTopUpUrgencyFields(input.quotaTopUp),
|
|
3260
3348
|
preferred_method: preferredMethod,
|
|
3261
3349
|
top_up_path: topUpPath,
|
|
3262
3350
|
inspect_methods_command: guidePaymentInspectionCommand(
|
|
@@ -3300,6 +3388,23 @@ function createGuideSelfFundPreparation(stage, input) {
|
|
|
3300
3388
|
};
|
|
3301
3389
|
}
|
|
3302
3390
|
|
|
3391
|
+
function createGuideQuotaTopUp(topUp) {
|
|
3392
|
+
if (topUp === null) {
|
|
3393
|
+
return null;
|
|
3394
|
+
}
|
|
3395
|
+
return {
|
|
3396
|
+
...topUp,
|
|
3397
|
+
...quotaTopUpUrgencyFields(topUp),
|
|
3398
|
+
};
|
|
3399
|
+
}
|
|
3400
|
+
|
|
3401
|
+
function createGuideQuotaTopUpUrgencyFields(quotaTopUp) {
|
|
3402
|
+
if (quotaTopUp === null) {
|
|
3403
|
+
return { urgency: null, urgency_score: null, urgency_reasons: [] };
|
|
3404
|
+
}
|
|
3405
|
+
return quotaTopUpUrgencyFields(quotaTopUp);
|
|
3406
|
+
}
|
|
3407
|
+
|
|
3303
3408
|
function createGuideWalletSettlementHandoff({
|
|
3304
3409
|
preferredMethod,
|
|
3305
3410
|
browserless,
|
|
@@ -4057,50 +4162,56 @@ async function create(argv) {
|
|
|
4057
4162
|
argv,
|
|
4058
4163
|
})
|
|
4059
4164
|
: null;
|
|
4060
|
-
const
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4165
|
+
const commandPrefix = createGuideCommandPrefix();
|
|
4166
|
+
const result = withCopyRunnablePaymentNextActionCommands(
|
|
4167
|
+
withCopyRunnableQuotaRecoveryCommands(
|
|
4168
|
+
await apiRequest({
|
|
4169
|
+
command: "image-skill create",
|
|
4170
|
+
method: "POST",
|
|
4171
|
+
apiBaseUrl: apiBase(args),
|
|
4172
|
+
path: "/v1/create",
|
|
4173
|
+
...(token.token === null ? {} : { token: token.token }),
|
|
4174
|
+
body: {
|
|
4175
|
+
prompt: prompt.value,
|
|
4176
|
+
...(flagString(args, "provider") === null
|
|
4177
|
+
? {}
|
|
4178
|
+
: { provider: flagString(args, "provider") }),
|
|
4179
|
+
...(flagString(args, "model") === null
|
|
4180
|
+
? {}
|
|
4181
|
+
: { model: flagString(args, "model") }),
|
|
4182
|
+
...(flagString(args, "intent") === null
|
|
4183
|
+
? {}
|
|
4184
|
+
: { intent: flagString(args, "intent") }),
|
|
4185
|
+
aspect_ratio: flagString(args, "aspect-ratio") ?? "1:1",
|
|
4186
|
+
...(references.references.length === 0
|
|
4187
|
+
? {}
|
|
4188
|
+
: { references: references.references }),
|
|
4189
|
+
...(outputCount.value === null
|
|
4190
|
+
? {}
|
|
4191
|
+
: { output_count: outputCount.value }),
|
|
4192
|
+
...(flagNumber(args, "max-estimated-usd-per-image") === null
|
|
4193
|
+
? {}
|
|
4194
|
+
: {
|
|
4195
|
+
max_estimated_usd_per_image: flagNumber(
|
|
4196
|
+
args,
|
|
4197
|
+
"max-estimated-usd-per-image",
|
|
4198
|
+
),
|
|
4199
|
+
}),
|
|
4200
|
+
...(modelParameters.value === null
|
|
4201
|
+
? {}
|
|
4202
|
+
: { model_parameters: modelParameters.value }),
|
|
4203
|
+
// Retry-safe dedupe (#1228/#1789): a live create always carries a key so a
|
|
4204
|
+
// retry (or an interrupted-then-recovered run) dedupes to one charge.
|
|
4205
|
+
...(idempotencyKey === null
|
|
4206
|
+
? {}
|
|
4207
|
+
: { idempotency_key: idempotencyKey }),
|
|
4208
|
+
dry_run: flagBool(args, "dry-run"),
|
|
4209
|
+
accept_unknown_cost: flagBool(args, "accept-unknown-cost"),
|
|
4210
|
+
},
|
|
4211
|
+
}),
|
|
4212
|
+
commandPrefix,
|
|
4213
|
+
),
|
|
4214
|
+
commandPrefix,
|
|
4104
4215
|
);
|
|
4105
4216
|
await clearInFlightSpendForResult(inFlight, result);
|
|
4106
4217
|
return result;
|
|
@@ -4194,47 +4305,55 @@ async function edit(argv) {
|
|
|
4194
4305
|
argv,
|
|
4195
4306
|
})
|
|
4196
4307
|
: null;
|
|
4197
|
-
const
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4308
|
+
const commandPrefix = createGuideCommandPrefix();
|
|
4309
|
+
const result = withCopyRunnablePaymentNextActionCommands(
|
|
4310
|
+
withCopyRunnableQuotaRecoveryCommands(
|
|
4311
|
+
await apiRequest({
|
|
4312
|
+
command: "image-skill edit",
|
|
4313
|
+
method: "POST",
|
|
4314
|
+
apiBaseUrl: apiBase(args),
|
|
4315
|
+
path: "/v1/edit",
|
|
4316
|
+
token: token.token,
|
|
4317
|
+
body: {
|
|
4318
|
+
input_asset_id: assetId.assetId,
|
|
4319
|
+
...(maskAssetId === null
|
|
4320
|
+
? {}
|
|
4321
|
+
: { mask_asset_id: maskAssetId.assetId }),
|
|
4322
|
+
...(references.references.length === 0
|
|
4323
|
+
? {}
|
|
4324
|
+
: { references: references.references }),
|
|
4325
|
+
...(prompt.value.length === 0 ? {} : { prompt: prompt.value }),
|
|
4326
|
+
...(flagString(args, "provider") === null
|
|
4327
|
+
? {}
|
|
4328
|
+
: { provider: flagString(args, "provider") }),
|
|
4329
|
+
...(modelId === null ? {} : { model: modelId }),
|
|
4330
|
+
...(flagString(args, "intent") === null
|
|
4331
|
+
? {}
|
|
4332
|
+
: { intent: flagString(args, "intent") }),
|
|
4333
|
+
aspect_ratio: flagString(args, "aspect-ratio") ?? "auto",
|
|
4334
|
+
...(flagNumber(args, "max-estimated-usd-per-image") === null
|
|
4335
|
+
? {}
|
|
4336
|
+
: {
|
|
4337
|
+
max_estimated_usd_per_image: flagNumber(
|
|
4338
|
+
args,
|
|
4339
|
+
"max-estimated-usd-per-image",
|
|
4340
|
+
),
|
|
4341
|
+
}),
|
|
4342
|
+
...(modelParameters.value === null
|
|
4343
|
+
? {}
|
|
4344
|
+
: { model_parameters: modelParameters.value }),
|
|
4345
|
+
...(flagBool(args, "dry-run") ? { dry_run: true } : {}),
|
|
4346
|
+
// Retry-safe dedupe (#1228/#1789): a live edit always carries a key so a
|
|
4347
|
+
// retry (or an interrupted-then-recovered run) dedupes to one charge.
|
|
4348
|
+
...(idempotencyKey === null
|
|
4349
|
+
? {}
|
|
4350
|
+
: { idempotency_key: idempotencyKey }),
|
|
4351
|
+
accept_unknown_cost: flagBool(args, "accept-unknown-cost"),
|
|
4352
|
+
},
|
|
4353
|
+
}),
|
|
4354
|
+
commandPrefix,
|
|
4355
|
+
),
|
|
4356
|
+
commandPrefix,
|
|
4238
4357
|
);
|
|
4239
4358
|
await clearInFlightSpendForResult(inFlight, result);
|
|
4240
4359
|
return result;
|
|
@@ -4259,22 +4378,28 @@ async function assets(argv) {
|
|
|
4259
4378
|
return token.result;
|
|
4260
4379
|
}
|
|
4261
4380
|
if (subcommand === "show") {
|
|
4262
|
-
return
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4381
|
+
return withCopyRunnablePaymentNextActionCommands(
|
|
4382
|
+
await apiRequest({
|
|
4383
|
+
command: "image-skill assets show",
|
|
4384
|
+
method: "GET",
|
|
4385
|
+
apiBaseUrl: apiBase(args),
|
|
4386
|
+
path: `/v1/assets/${encodeURIComponent(assetId)}`,
|
|
4387
|
+
token: token.token,
|
|
4388
|
+
}),
|
|
4389
|
+
createGuideCommandPrefix(),
|
|
4390
|
+
);
|
|
4269
4391
|
}
|
|
4270
4392
|
if (subcommand === "get") {
|
|
4271
|
-
const shown =
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4393
|
+
const shown = withCopyRunnablePaymentNextActionCommands(
|
|
4394
|
+
await apiRequest({
|
|
4395
|
+
command: "image-skill assets get",
|
|
4396
|
+
method: "GET",
|
|
4397
|
+
apiBaseUrl: apiBase(args),
|
|
4398
|
+
path: `/v1/assets/${encodeURIComponent(assetId)}`,
|
|
4399
|
+
token: token.token,
|
|
4400
|
+
}),
|
|
4401
|
+
createGuideCommandPrefix(),
|
|
4402
|
+
);
|
|
4278
4403
|
if (!shown.envelope.ok) {
|
|
4279
4404
|
return shown;
|
|
4280
4405
|
}
|
|
@@ -4315,26 +4440,32 @@ async function jobs(argv) {
|
|
|
4315
4440
|
return token.result;
|
|
4316
4441
|
}
|
|
4317
4442
|
if (subcommand === "show") {
|
|
4318
|
-
return
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4443
|
+
return withCopyRunnablePaymentNextActionCommands(
|
|
4444
|
+
await apiRequest({
|
|
4445
|
+
command: "image-skill jobs show",
|
|
4446
|
+
method: "GET",
|
|
4447
|
+
apiBaseUrl: apiBase(args),
|
|
4448
|
+
path: `/v1/jobs/${encodeURIComponent(jobId)}`,
|
|
4449
|
+
token: token.token,
|
|
4450
|
+
}),
|
|
4451
|
+
createGuideCommandPrefix(),
|
|
4452
|
+
);
|
|
4325
4453
|
}
|
|
4326
4454
|
if (subcommand === "wait") {
|
|
4327
4455
|
const timeoutMs = flagNumber(args, "timeout-ms") ?? 30_000;
|
|
4328
4456
|
const pollIntervalMs = flagNumber(args, "poll-interval-ms") ?? 1_000;
|
|
4329
4457
|
const started = Date.now();
|
|
4330
4458
|
while (Date.now() - started <= timeoutMs) {
|
|
4331
|
-
const current =
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4459
|
+
const current = withCopyRunnablePaymentNextActionCommands(
|
|
4460
|
+
await apiRequest({
|
|
4461
|
+
command: "image-skill jobs wait",
|
|
4462
|
+
method: "GET",
|
|
4463
|
+
apiBaseUrl: apiBase(args),
|
|
4464
|
+
path: `/v1/jobs/${encodeURIComponent(jobId)}`,
|
|
4465
|
+
token: token.token,
|
|
4466
|
+
}),
|
|
4467
|
+
createGuideCommandPrefix(),
|
|
4468
|
+
);
|
|
4338
4469
|
if (!current.envelope.ok) {
|
|
4339
4470
|
return current;
|
|
4340
4471
|
}
|
|
@@ -4380,13 +4511,16 @@ async function activity(argv) {
|
|
|
4380
4511
|
"activity show requires REFERENCE",
|
|
4381
4512
|
);
|
|
4382
4513
|
}
|
|
4383
|
-
return
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4514
|
+
return withCopyRunnablePaymentNextActionCommands(
|
|
4515
|
+
await apiRequest({
|
|
4516
|
+
command: "image-skill activity show",
|
|
4517
|
+
method: "GET",
|
|
4518
|
+
apiBaseUrl: apiBase(args),
|
|
4519
|
+
path: `/v1/activity/${encodeURIComponent(reference)}`,
|
|
4520
|
+
token: token.token,
|
|
4521
|
+
}),
|
|
4522
|
+
createGuideCommandPrefix(),
|
|
4523
|
+
);
|
|
4390
4524
|
}
|
|
4391
4525
|
if (subcommand === "list") {
|
|
4392
4526
|
const query = new URLSearchParams();
|
|
@@ -4398,13 +4532,16 @@ async function activity(argv) {
|
|
|
4398
4532
|
if (subject !== null) {
|
|
4399
4533
|
query.set("subject", subject);
|
|
4400
4534
|
}
|
|
4401
|
-
return
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4535
|
+
return withCopyRunnablePaymentNextActionCommands(
|
|
4536
|
+
await apiRequest({
|
|
4537
|
+
command: "image-skill activity list",
|
|
4538
|
+
method: "GET",
|
|
4539
|
+
apiBaseUrl: apiBase(args),
|
|
4540
|
+
path: `/v1/activity${query.size > 0 ? `?${query.toString()}` : ""}`,
|
|
4541
|
+
token: token.token,
|
|
4542
|
+
}),
|
|
4543
|
+
createGuideCommandPrefix(),
|
|
4544
|
+
);
|
|
4408
4545
|
}
|
|
4409
4546
|
return invalid("image-skill activity", "activity requires list or show");
|
|
4410
4547
|
}
|
package/cli.md
CHANGED
|
@@ -246,7 +246,8 @@ step.
|
|
|
246
246
|
`error.recovery.suggested_command` for no-spend payment-method inspection.
|
|
247
247
|
- `ready_to_create`: `data.next_command` is a live media create. Its
|
|
248
248
|
`data.self_fund_preparation` is the pre-wall top-up affordance; when
|
|
249
|
-
`available`
|
|
249
|
+
`available` is true, it mirrors top-up `urgency`, `urgency_score`, and
|
|
250
|
+
`urgency_reasons`; when `recommended` is true, `quote_command` creates an
|
|
250
251
|
authenticated live-money quote/payment object without paying, settling a
|
|
251
252
|
wallet transfer, debiting credits, calling a provider, or writing media.
|
|
252
253
|
Only follow later buy/status/wallet-settlement commands when delegated spend
|
package/llms.txt
CHANGED
|
@@ -62,7 +62,7 @@ First-run guide loop:
|
|
|
62
62
|
2. Read data.guide_warning, then follow data.next_command when its next_command_safety is safe for the current spend policy. Prefer data.guide_recovery for no-doc recovery: data.guide_recovery.no_spend_command_field and data.guide_recovery.no_spend_command name the safest no-spend command, data.guide_recovery.live_create_command_field and data.guide_recovery.live_payment_command_field name fields that would spend, and data.guide_recovery.double_spend_guard tells you when to check error.recovery, jobs, activity, or payment status before any live retry. Do not run doctor, models list, signup, whoami, quota, dry-run, or payment commands as a setup checklist before the guide asks for them.
|
|
63
63
|
3. If data.stage is prompt_required, rerun data.next_command with the real prompt.
|
|
64
64
|
4. If data.stage is auth_required, data.auth_ready.ready is false and data.guide_warning.next_command_safety is hosted_signup_no_spend_setup. Run data.next_command, then rerun the guide once. Hosted signup saves the restricted token to the public CLI config by default with 0600 permissions. If the configured config path is blocked, data.next_command sets IMAGE_SKILL_CONFIG_PATH="$PWD/.image-skill/config.json" and still runs a saved-config signup; do not switch to raw-token handoff unless recovery explicitly requires it. If the runtime intentionally uses --no-save --show-token, store the returned token in the agent runtime secret store, then rerun with IMAGE_SKILL_TOKEN or --token-stdin; data.auth_handoff.rerun_guide.with_env and data.auth_handoff.rerun_guide.with_stdin are copy-safe templates for that mode. Signup is anonymous by default: no contact inbox is required to get a restricted token. The optional --agent-contact flag takes an email-shaped durable contact inbox for the restricted agent identity, not a requirement to find an individual human; attach one later with image-skill claim request --contact INBOX --json when funding or durability makes it worth having. Hosted signup returns the raw restricted token only when --show-token is set, and only once. When providing a contact, use an agent-owned inbox when available; otherwise use an operator, team, or sponsor inbox that can receive future claim, billing, or abuse notices. Never invent an inbox or borrow an unrelated human email just to fill the flag — omit it instead. example.invalid addresses are only appropriate inside documented harness or proof runs. --human-email remains accepted as a compatibility alias, but the guide must not teach it. Anonymous signups mint a fresh agent identity on every call; reuse the saved config instead of re-running signup. --save is accepted as a compatibility no-op for the default save behavior; use --no-save only when the runtime has a separate secret store and does not want local config.
|
|
65
|
-
5. At any guide stage, read data.checks.quota.top_up. When available is true, it includes recommended, recommendation_reason, preferred_payment_method, quote_command, quote_command_copy_runnable, quote_command_effect, and quote/buy/status command templates for the browserless x402 top-up path; recommended and urgency say whether to act now. On quota/payment recovery errors, read error.recovery.top_up: when delegated live-money quoting is allowed, prefer error.recovery.top_up.quote_command to open the top-up path, and use error.recovery.suggested_command for no-spend payment-method inspection. If data.stage is quota_required, data.guide_warning.next_command_safety is live_money_payment_action and data.guide_warning.payment_top_up_path summarizes the live-money path. Run data.self_fund_next_command to start the top-up. It aliases data.next_command and is the first payment command, usually an x402 or Stripe quote. First read data.checks.payments.preferred_method_summary.top_up_path: browserless_agent_self_fund means a wallet-equipped agent can complete the preferred live-money rail without a browser; human_payment_handoff means the agent can create the payment attempt but a human/browser step must complete before credits are granted. If the guide authenticated from env or stdin, prefer data.self_fund_handoff.auth.next_command.with_env or data.self_fund_handoff.auth.next_command.with_stdin so auth follows the payment command. Then follow data.self_fund_handoff.payment_commands.buy and status, and rerun data.self_fund_handoff.after_next once credits are granted. If data.stage is ready_to_create, inspect data.self_fund_preparation before consuming the remaining free allowance. When available and recommended are true, data.self_fund_preparation.quote_command is the pre-wall browserless x402 quote: it creates an authenticated live-money quote/payment object, but data.self_fund_preparation.quote_command_effect must show no provider call, no hosted create, no credit debit, no media write, and no wallet settlement until a later buy/payment step. 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 four-job daily cap.
|
|
65
|
+
5. At any guide stage, read data.checks.quota.top_up. When available is true, it includes recommended, recommendation_reason, preferred_payment_method, quote_command, quote_command_copy_runnable, quote_command_effect, and quote/buy/status command templates for the browserless x402 top-up path; recommended and urgency say whether to act now. On quota/payment recovery errors, read error.recovery.top_up: when delegated live-money quoting is allowed, prefer error.recovery.top_up.quote_command to open the top-up path, and use error.recovery.suggested_command for no-spend payment-method inspection. If data.stage is quota_required, data.guide_warning.next_command_safety is live_money_payment_action and data.guide_warning.payment_top_up_path summarizes the live-money path. Run data.self_fund_next_command to start the top-up. It aliases data.next_command and is the first payment command, usually an x402 or Stripe quote. First read data.checks.payments.preferred_method_summary.top_up_path: browserless_agent_self_fund means a wallet-equipped agent can complete the preferred live-money rail without a browser; human_payment_handoff means the agent can create the payment attempt but a human/browser step must complete before credits are granted. If the guide authenticated from env or stdin, prefer data.self_fund_handoff.auth.next_command.with_env or data.self_fund_handoff.auth.next_command.with_stdin so auth follows the payment command. Then follow data.self_fund_handoff.payment_commands.buy and status, and rerun data.self_fund_handoff.after_next once credits are granted. If data.stage is ready_to_create, inspect data.self_fund_preparation before consuming the remaining free allowance; it mirrors top-up urgency, urgency_score, and urgency_reasons. When available and recommended are true, data.self_fund_preparation.quote_command is the pre-wall browserless x402 quote: it creates an authenticated live-money quote/payment object, but data.self_fund_preparation.quote_command_effect must show no provider call, no hosted create, no credit debit, no media write, and no wallet settlement until a later buy/payment step. 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 four-job daily cap.
|
|
66
66
|
5a. When data.stage is quota_required, data.self_fund_handoff mirrors top-up urgency, urgency_score, and urgency_reasons, and exposes first_safe_command plus first_safe_command_effect. Run first_safe_command, usually image-skill credits methods --json, for no-spend rail inspection before quote/buy when delegated spend authority is absent or unclear.
|
|
67
67
|
6. If data.stage is ready_to_create, data.next_command is the first bounded live create. data.guide_warning.next_command_safety must be live_media_create_credit_debit, data.guide_warning.no_spend_safe must be false, data.guide_warning.spend_required must be true, and data.guide_warning.recommended_command_field must be recommended_no_spend_command. data.auth_ready.ready and data.auth_ready.next_command_auth_ready must be true; data.auth_ready.next_command_requires_auth must be true, and the command can reuse saved config, IMAGE_SKILL_TOKEN, or --token-stdin context without exposing a raw token. data.next_command_effect.label must be live_media_create_credit_debit and its provider_call, hosted_create, credit_debit, and media_write flags are true. data.no_spend_evaluation.stop_here must be true, data.no_spend_evaluation.next_command_is_live_create must be true, and data.no_spend_evaluation.recommended_command_field must be recommended_no_spend_command. Run data.next_command only when media spend is allowed. In no-spend evaluations, or when you only need to prove readiness without media/provider work, stop before data.next_command and run data.recommended_no_spend_command instead. data.recommended_no_spend_command must equal data.no_spend_next_command. data.no_spend_next_command_effect.label must be dry_run_planned_job_no_provider_call_no_credit_debit_no_media_write: no_spend, hosted_create_dry_run, planned_job, and plan_receipt are true; activity_event is job.planned; provider_call, credit_debit, and media_write are false. This dry-run may create a recoverable planned job/activity receipt but no provider execution, debit, downloadable asset, or media write. If the guide authenticated from env or stdin, prefer data.auth_handoff.next_command.with_env or data.auth_handoff.next_command.with_stdin so auth follows the live create. In guide cost output, cost.estimated_usd_per_image and cost.estimated_debit_usd_per_image are the Image Skill debit dollars for one output; cost.estimated_provider_usd_per_image is only the upstream provider estimate. Use the guide's returned max_estimated_usd_per_image because it is sized to the credit debit the agent funds. Add --output-count N only after models show confirms the selected create model supports more than one output; credit_pricing.credits_required is the total debit across outputs, while max_estimated_usd_per_image remains a per-image Image Skill debit guard.
|
|
68
68
|
7. After create, prefer data.next_actions when present: inspect_job and inspect_asset are copy-runnable no-spend recovery commands, iterate_edit is the reusable-asset edit template, and self_fund is the promoted top-up quote handoff when quota.top_up.available is true. self_fund.recommended plus urgency, urgency_score, and urgency_reasons say whether to act now, and self_fund exposes first_safe_command plus first_safe_command_effect for no-spend rail inspection before quote/buy. self_fund.quote_command is copy-runnable and omits --idempotency-key so the public CLI generates and returns one for retry safety; follow the quote response into buy/status. Otherwise use image-skill jobs show JOB_ID to recover status, cost, safety, timestamps, and final assets; image-skill assets get ASSET_URL_OR_ID --output ./result.png to fetch the generated asset without repeating provider work; and image-skill activity list --subject JOB_ID to find ledger events, trace, usage, asset links, and any data.next_actions.self_fund handoff to cite or follow. Hosted asset-id assets show/get may also return data.next_actions.self_fund after generated work, so inspect that field before ending the session.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "image-skill",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.66",
|
|
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,
|
package/skill.md
CHANGED
|
@@ -39,7 +39,7 @@ JSON is the default. Do not add `--json` to examples.
|
|
|
39
39
|
npm_config_update_notifier=false npx -y image-skill@latest create --guide --prompt "a compact field camera on a stainless workbench"
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
The guide is a free, zero-spend planning call. Given current auth, quota, and payment state, it returns `data.next_command`, `data.next_command_copy_runnable`, `data.next_command_missing_inputs`, `data.stage`, `data.guide_warning`, `data.next_command_effect`, `data.auth_ready`, `data.no_spend_evaluation`, `data.guide_recovery`, `data.recommended_no_spend_command` (alias of `data.no_spend_next_command`), `data.no_spend_next_command_effect`, `data.self_fund_next_command`, `data.self_fund_handoff`, `data.self_fund_preparation`, `data.auth_handoff`, and `data.mutation`. It also preserves `data.checks.quota.top_up`, the same quota top-up recommendation returned by `usage quota`, so wallet-capable agents can see whether a browserless x402 top-up is recommended before the hard wall. Read `data.guide_warning` before running `data.next_command`: `next_command_safety` names whether the command is no-spend setup, read-only inspection, live-money payment action, or live media create. Run that next command only when `data.next_command_copy_runnable` is `true` and the warning says it is safe for your spend policy; when it is `false`, fill `data.next_command_missing_inputs` first. Prefer `data.guide_recovery` for no-doc recovery loops: it names the safest no-spend command and field, the live create or payment field that would spend, and the double-spend guard to check before any live retry. Repeat until `data.stage` is `ready_to_create`. At `ready_to_create`, `data.auth_ready.ready` and `data.auth_ready.next_command_auth_ready` are `true`: the returned create can reuse saved config, env token, or stdin token context without exposing a raw token. Read `data.self_fund_preparation` in this stage before spending the remaining free allowance: when `available` and `recommended`
|
|
42
|
+
The guide is a free, zero-spend planning call. Given current auth, quota, and payment state, it returns `data.next_command`, `data.next_command_copy_runnable`, `data.next_command_missing_inputs`, `data.stage`, `data.guide_warning`, `data.next_command_effect`, `data.auth_ready`, `data.no_spend_evaluation`, `data.guide_recovery`, `data.recommended_no_spend_command` (alias of `data.no_spend_next_command`), `data.no_spend_next_command_effect`, `data.self_fund_next_command`, `data.self_fund_handoff`, `data.self_fund_preparation`, `data.auth_handoff`, and `data.mutation`. It also preserves `data.checks.quota.top_up`, the same quota top-up recommendation returned by `usage quota`, so wallet-capable agents can see whether a browserless x402 top-up is recommended before the hard wall. Read `data.guide_warning` before running `data.next_command`: `next_command_safety` names whether the command is no-spend setup, read-only inspection, live-money payment action, or live media create. Run that next command only when `data.next_command_copy_runnable` is `true` and the warning says it is safe for your spend policy; when it is `false`, fill `data.next_command_missing_inputs` first. Prefer `data.guide_recovery` for no-doc recovery loops: it names the safest no-spend command and field, the live create or payment field that would spend, and the double-spend guard to check before any live retry. Repeat until `data.stage` is `ready_to_create`. At `ready_to_create`, `data.auth_ready.ready` and `data.auth_ready.next_command_auth_ready` are `true`: the returned create can reuse saved config, env token, or stdin token context without exposing a raw token. Read `data.self_fund_preparation` in this stage before spending the remaining free allowance: when `available` is true, it mirrors top-up `urgency`, `urgency_score`, and `urgency_reasons`; when `recommended` is true, `quote_command` creates an authenticated live-money quote/payment object but does not pay, settle a wallet transfer, debit credits, call a provider, or write media. Only a later buy/payment step can spend money. When `data.guide_warning.next_command_safety` is `live_media_create_credit_debit` and `data.no_spend_evaluation.stop_here` is `true`, `data.next_command` is the live create: run it only if media spend is allowed, otherwise stop before it and run `data.recommended_no_spend_command` for no-spend proof. The no-spend command is an authenticated hosted dry-run: it may create a recoverable `job.planned` receipt, but it has no provider call, credit debit, downloadable asset, or media write.
|
|
43
43
|
|
|
44
44
|
When `data.stage` is `quota_required`, `data.self_fund_handoff` mirrors top-up `urgency`, `urgency_score`, and `urgency_reasons`, and exposes `first_safe_command` with a no-spend inspection effect. Run that no-spend command first when you need to inspect rails or stay below delegated spend authority before opening the live-money quote path.
|
|
45
45
|
|
|
@@ -204,8 +204,9 @@ exposes `first_safe_command`, usually `image-skill credits methods --json`, for
|
|
|
204
204
|
no-spend payment-method inspection before quote/buy steps.
|
|
205
205
|
When `create --guide` reaches `ready_to_create`, inspect
|
|
206
206
|
`data.self_fund_preparation` before consuming the remaining free allowance. If
|
|
207
|
-
it is available
|
|
208
|
-
|
|
207
|
+
it is available, `urgency`, `urgency_score`, and `urgency_reasons` mirror
|
|
208
|
+
`data.checks.quota.top_up`; if it is recommended, `quote_command` is the
|
|
209
|
+
pre-wall browserless x402 quote path: it creates an authenticated live-money quote/payment object
|
|
209
210
|
without paying, settling a wallet transfer, debiting credits, calling a
|
|
210
211
|
provider, or writing media. Only follow the later buy/status/wallet-settlement
|
|
211
212
|
commands when delegated spend is allowed.
|
|
@@ -39,7 +39,7 @@ JSON is the default. Do not add `--json` to examples.
|
|
|
39
39
|
npm_config_update_notifier=false npx -y image-skill@latest create --guide --prompt "a compact field camera on a stainless workbench"
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
The guide is a free, zero-spend planning call. Given current auth, quota, and payment state, it returns `data.next_command`, `data.next_command_copy_runnable`, `data.next_command_missing_inputs`, `data.stage`, `data.guide_warning`, `data.next_command_effect`, `data.auth_ready`, `data.no_spend_evaluation`, `data.guide_recovery`, `data.recommended_no_spend_command` (alias of `data.no_spend_next_command`), `data.no_spend_next_command_effect`, `data.self_fund_next_command`, `data.self_fund_handoff`, `data.self_fund_preparation`, `data.auth_handoff`, and `data.mutation`. It also preserves `data.checks.quota.top_up`, the same quota top-up recommendation returned by `usage quota`, so wallet-capable agents can see whether a browserless x402 top-up is recommended before the hard wall. Read `data.guide_warning` before running `data.next_command`: `next_command_safety` names whether the command is no-spend setup, read-only inspection, live-money payment action, or live media create. Run that next command only when `data.next_command_copy_runnable` is `true` and the warning says it is safe for your spend policy; when it is `false`, fill `data.next_command_missing_inputs` first. Prefer `data.guide_recovery` for no-doc recovery loops: it names the safest no-spend command and field, the live create or payment field that would spend, and the double-spend guard to check before any live retry. Repeat until `data.stage` is `ready_to_create`. At `ready_to_create`, `data.auth_ready.ready` and `data.auth_ready.next_command_auth_ready` are `true`: the returned create can reuse saved config, env token, or stdin token context without exposing a raw token. Read `data.self_fund_preparation` in this stage before spending the remaining free allowance: when `available` and `recommended`
|
|
42
|
+
The guide is a free, zero-spend planning call. Given current auth, quota, and payment state, it returns `data.next_command`, `data.next_command_copy_runnable`, `data.next_command_missing_inputs`, `data.stage`, `data.guide_warning`, `data.next_command_effect`, `data.auth_ready`, `data.no_spend_evaluation`, `data.guide_recovery`, `data.recommended_no_spend_command` (alias of `data.no_spend_next_command`), `data.no_spend_next_command_effect`, `data.self_fund_next_command`, `data.self_fund_handoff`, `data.self_fund_preparation`, `data.auth_handoff`, and `data.mutation`. It also preserves `data.checks.quota.top_up`, the same quota top-up recommendation returned by `usage quota`, so wallet-capable agents can see whether a browserless x402 top-up is recommended before the hard wall. Read `data.guide_warning` before running `data.next_command`: `next_command_safety` names whether the command is no-spend setup, read-only inspection, live-money payment action, or live media create. Run that next command only when `data.next_command_copy_runnable` is `true` and the warning says it is safe for your spend policy; when it is `false`, fill `data.next_command_missing_inputs` first. Prefer `data.guide_recovery` for no-doc recovery loops: it names the safest no-spend command and field, the live create or payment field that would spend, and the double-spend guard to check before any live retry. Repeat until `data.stage` is `ready_to_create`. At `ready_to_create`, `data.auth_ready.ready` and `data.auth_ready.next_command_auth_ready` are `true`: the returned create can reuse saved config, env token, or stdin token context without exposing a raw token. Read `data.self_fund_preparation` in this stage before spending the remaining free allowance: when `available` is true, it mirrors top-up `urgency`, `urgency_score`, and `urgency_reasons`; when `recommended` is true, `quote_command` creates an authenticated live-money quote/payment object but does not pay, settle a wallet transfer, debit credits, call a provider, or write media. Only a later buy/payment step can spend money. When `data.guide_warning.next_command_safety` is `live_media_create_credit_debit` and `data.no_spend_evaluation.stop_here` is `true`, `data.next_command` is the live create: run it only if media spend is allowed, otherwise stop before it and run `data.recommended_no_spend_command` for no-spend proof. The no-spend command is an authenticated hosted dry-run: it may create a recoverable `job.planned` receipt, but it has no provider call, credit debit, downloadable asset, or media write.
|
|
43
43
|
|
|
44
44
|
When `data.stage` is `quota_required`, `data.self_fund_handoff` mirrors top-up `urgency`, `urgency_score`, and `urgency_reasons`, and exposes `first_safe_command` with a no-spend inspection effect. Run that no-spend command first when you need to inspect rails or stay below delegated spend authority before opening the live-money quote path.
|
|
45
45
|
|
|
@@ -204,8 +204,9 @@ exposes `first_safe_command`, usually `image-skill credits methods --json`, for
|
|
|
204
204
|
no-spend payment-method inspection before quote/buy steps.
|
|
205
205
|
When `create --guide` reaches `ready_to_create`, inspect
|
|
206
206
|
`data.self_fund_preparation` before consuming the remaining free allowance. If
|
|
207
|
-
it is available
|
|
208
|
-
|
|
207
|
+
it is available, `urgency`, `urgency_score`, and `urgency_reasons` mirror
|
|
208
|
+
`data.checks.quota.top_up`; if it is recommended, `quote_command` is the
|
|
209
|
+
pre-wall browserless x402 quote path: it creates an authenticated live-money quote/payment object
|
|
209
210
|
without paying, settling a wallet transfer, debiting credits, calling a
|
|
210
211
|
provider, or writing media. Only follow the later buy/status/wallet-settlement
|
|
211
212
|
commands when delegated spend is allowed.
|
|
@@ -246,7 +246,8 @@ step.
|
|
|
246
246
|
`error.recovery.suggested_command` for no-spend payment-method inspection.
|
|
247
247
|
- `ready_to_create`: `data.next_command` is a live media create. Its
|
|
248
248
|
`data.self_fund_preparation` is the pre-wall top-up affordance; when
|
|
249
|
-
`available`
|
|
249
|
+
`available` is true, it mirrors top-up `urgency`, `urgency_score`, and
|
|
250
|
+
`urgency_reasons`; when `recommended` is true, `quote_command` creates an
|
|
250
251
|
authenticated live-money quote/payment object without paying, settling a
|
|
251
252
|
wallet transfer, debiting credits, calling a provider, or writing media.
|
|
252
253
|
Only follow later buy/status/wallet-settlement commands when delegated spend
|
|
@@ -62,7 +62,7 @@ First-run guide loop:
|
|
|
62
62
|
2. Read data.guide_warning, then follow data.next_command when its next_command_safety is safe for the current spend policy. Prefer data.guide_recovery for no-doc recovery: data.guide_recovery.no_spend_command_field and data.guide_recovery.no_spend_command name the safest no-spend command, data.guide_recovery.live_create_command_field and data.guide_recovery.live_payment_command_field name fields that would spend, and data.guide_recovery.double_spend_guard tells you when to check error.recovery, jobs, activity, or payment status before any live retry. Do not run doctor, models list, signup, whoami, quota, dry-run, or payment commands as a setup checklist before the guide asks for them.
|
|
63
63
|
3. If data.stage is prompt_required, rerun data.next_command with the real prompt.
|
|
64
64
|
4. If data.stage is auth_required, data.auth_ready.ready is false and data.guide_warning.next_command_safety is hosted_signup_no_spend_setup. Run data.next_command, then rerun the guide once. Hosted signup saves the restricted token to the public CLI config by default with 0600 permissions. If the configured config path is blocked, data.next_command sets IMAGE_SKILL_CONFIG_PATH="$PWD/.image-skill/config.json" and still runs a saved-config signup; do not switch to raw-token handoff unless recovery explicitly requires it. If the runtime intentionally uses --no-save --show-token, store the returned token in the agent runtime secret store, then rerun with IMAGE_SKILL_TOKEN or --token-stdin; data.auth_handoff.rerun_guide.with_env and data.auth_handoff.rerun_guide.with_stdin are copy-safe templates for that mode. Signup is anonymous by default: no contact inbox is required to get a restricted token. The optional --agent-contact flag takes an email-shaped durable contact inbox for the restricted agent identity, not a requirement to find an individual human; attach one later with image-skill claim request --contact INBOX --json when funding or durability makes it worth having. Hosted signup returns the raw restricted token only when --show-token is set, and only once. When providing a contact, use an agent-owned inbox when available; otherwise use an operator, team, or sponsor inbox that can receive future claim, billing, or abuse notices. Never invent an inbox or borrow an unrelated human email just to fill the flag — omit it instead. example.invalid addresses are only appropriate inside documented harness or proof runs. --human-email remains accepted as a compatibility alias, but the guide must not teach it. Anonymous signups mint a fresh agent identity on every call; reuse the saved config instead of re-running signup. --save is accepted as a compatibility no-op for the default save behavior; use --no-save only when the runtime has a separate secret store and does not want local config.
|
|
65
|
-
5. At any guide stage, read data.checks.quota.top_up. When available is true, it includes recommended, recommendation_reason, preferred_payment_method, quote_command, quote_command_copy_runnable, quote_command_effect, and quote/buy/status command templates for the browserless x402 top-up path; recommended and urgency say whether to act now. On quota/payment recovery errors, read error.recovery.top_up: when delegated live-money quoting is allowed, prefer error.recovery.top_up.quote_command to open the top-up path, and use error.recovery.suggested_command for no-spend payment-method inspection. If data.stage is quota_required, data.guide_warning.next_command_safety is live_money_payment_action and data.guide_warning.payment_top_up_path summarizes the live-money path. Run data.self_fund_next_command to start the top-up. It aliases data.next_command and is the first payment command, usually an x402 or Stripe quote. First read data.checks.payments.preferred_method_summary.top_up_path: browserless_agent_self_fund means a wallet-equipped agent can complete the preferred live-money rail without a browser; human_payment_handoff means the agent can create the payment attempt but a human/browser step must complete before credits are granted. If the guide authenticated from env or stdin, prefer data.self_fund_handoff.auth.next_command.with_env or data.self_fund_handoff.auth.next_command.with_stdin so auth follows the payment command. Then follow data.self_fund_handoff.payment_commands.buy and status, and rerun data.self_fund_handoff.after_next once credits are granted. If data.stage is ready_to_create, inspect data.self_fund_preparation before consuming the remaining free allowance. When available and recommended are true, data.self_fund_preparation.quote_command is the pre-wall browserless x402 quote: it creates an authenticated live-money quote/payment object, but data.self_fund_preparation.quote_command_effect must show no provider call, no hosted create, no credit debit, no media write, and no wallet settlement until a later buy/payment step. 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 four-job daily cap.
|
|
65
|
+
5. At any guide stage, read data.checks.quota.top_up. When available is true, it includes recommended, recommendation_reason, preferred_payment_method, quote_command, quote_command_copy_runnable, quote_command_effect, and quote/buy/status command templates for the browserless x402 top-up path; recommended and urgency say whether to act now. On quota/payment recovery errors, read error.recovery.top_up: when delegated live-money quoting is allowed, prefer error.recovery.top_up.quote_command to open the top-up path, and use error.recovery.suggested_command for no-spend payment-method inspection. If data.stage is quota_required, data.guide_warning.next_command_safety is live_money_payment_action and data.guide_warning.payment_top_up_path summarizes the live-money path. Run data.self_fund_next_command to start the top-up. It aliases data.next_command and is the first payment command, usually an x402 or Stripe quote. First read data.checks.payments.preferred_method_summary.top_up_path: browserless_agent_self_fund means a wallet-equipped agent can complete the preferred live-money rail without a browser; human_payment_handoff means the agent can create the payment attempt but a human/browser step must complete before credits are granted. If the guide authenticated from env or stdin, prefer data.self_fund_handoff.auth.next_command.with_env or data.self_fund_handoff.auth.next_command.with_stdin so auth follows the payment command. Then follow data.self_fund_handoff.payment_commands.buy and status, and rerun data.self_fund_handoff.after_next once credits are granted. If data.stage is ready_to_create, inspect data.self_fund_preparation before consuming the remaining free allowance; it mirrors top-up urgency, urgency_score, and urgency_reasons. When available and recommended are true, data.self_fund_preparation.quote_command is the pre-wall browserless x402 quote: it creates an authenticated live-money quote/payment object, but data.self_fund_preparation.quote_command_effect must show no provider call, no hosted create, no credit debit, no media write, and no wallet settlement until a later buy/payment step. 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 four-job daily cap.
|
|
66
66
|
5a. When data.stage is quota_required, data.self_fund_handoff mirrors top-up urgency, urgency_score, and urgency_reasons, and exposes first_safe_command plus first_safe_command_effect. Run first_safe_command, usually image-skill credits methods --json, for no-spend rail inspection before quote/buy when delegated spend authority is absent or unclear.
|
|
67
67
|
6. If data.stage is ready_to_create, data.next_command is the first bounded live create. data.guide_warning.next_command_safety must be live_media_create_credit_debit, data.guide_warning.no_spend_safe must be false, data.guide_warning.spend_required must be true, and data.guide_warning.recommended_command_field must be recommended_no_spend_command. data.auth_ready.ready and data.auth_ready.next_command_auth_ready must be true; data.auth_ready.next_command_requires_auth must be true, and the command can reuse saved config, IMAGE_SKILL_TOKEN, or --token-stdin context without exposing a raw token. data.next_command_effect.label must be live_media_create_credit_debit and its provider_call, hosted_create, credit_debit, and media_write flags are true. data.no_spend_evaluation.stop_here must be true, data.no_spend_evaluation.next_command_is_live_create must be true, and data.no_spend_evaluation.recommended_command_field must be recommended_no_spend_command. Run data.next_command only when media spend is allowed. In no-spend evaluations, or when you only need to prove readiness without media/provider work, stop before data.next_command and run data.recommended_no_spend_command instead. data.recommended_no_spend_command must equal data.no_spend_next_command. data.no_spend_next_command_effect.label must be dry_run_planned_job_no_provider_call_no_credit_debit_no_media_write: no_spend, hosted_create_dry_run, planned_job, and plan_receipt are true; activity_event is job.planned; provider_call, credit_debit, and media_write are false. This dry-run may create a recoverable planned job/activity receipt but no provider execution, debit, downloadable asset, or media write. If the guide authenticated from env or stdin, prefer data.auth_handoff.next_command.with_env or data.auth_handoff.next_command.with_stdin so auth follows the live create. In guide cost output, cost.estimated_usd_per_image and cost.estimated_debit_usd_per_image are the Image Skill debit dollars for one output; cost.estimated_provider_usd_per_image is only the upstream provider estimate. Use the guide's returned max_estimated_usd_per_image because it is sized to the credit debit the agent funds. Add --output-count N only after models show confirms the selected create model supports more than one output; credit_pricing.credits_required is the total debit across outputs, while max_estimated_usd_per_image remains a per-image Image Skill debit guard.
|
|
68
68
|
7. After create, prefer data.next_actions when present: inspect_job and inspect_asset are copy-runnable no-spend recovery commands, iterate_edit is the reusable-asset edit template, and self_fund is the promoted top-up quote handoff when quota.top_up.available is true. self_fund.recommended plus urgency, urgency_score, and urgency_reasons say whether to act now, and self_fund exposes first_safe_command plus first_safe_command_effect for no-spend rail inspection before quote/buy. self_fund.quote_command is copy-runnable and omits --idempotency-key so the public CLI generates and returns one for retry safety; follow the quote response into buy/status. Otherwise use image-skill jobs show JOB_ID to recover status, cost, safety, timestamps, and final assets; image-skill assets get ASSET_URL_OR_ID --output ./result.png to fetch the generated asset without repeating provider work; and image-skill activity list --subject JOB_ID to find ledger events, trace, usage, asset links, and any data.next_actions.self_fund handoff to cite or follow. Hosted asset-id assets show/get may also return data.next_actions.self_fund after generated work, so inspect that field before ending the session.
|