image-skill 0.1.64 → 0.1.65
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 +9 -0
- package/bin/image-skill.mjs +249 -131
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,15 @@ 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.65 - 2026-06-17
|
|
8
|
+
|
|
9
|
+
- Release (activation/self-fund): make hosted create/edit success
|
|
10
|
+
`data.quota.top_up` and `data.next_actions.self_fund` commands copy-runnable
|
|
11
|
+
from the public CLI, so near-wall agents can move from a successful media
|
|
12
|
+
response into the same zero-setup `npx image-skill@latest` top-up path as
|
|
13
|
+
quota reads and quota errors. No payment caps, wallet action, provider spend,
|
|
14
|
+
hosted deploy, or production write changed in this release bump.
|
|
15
|
+
|
|
7
16
|
## 0.1.64 - 2026-06-17
|
|
8
17
|
|
|
9
18
|
- Release (activation/self-fund): publish the hosted success-surface
|
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.65";
|
|
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";
|
|
@@ -2829,14 +2829,38 @@ function withCopyRunnablePaymentNextActionCommands(result, commandPrefix) {
|
|
|
2829
2829
|
}
|
|
2830
2830
|
|
|
2831
2831
|
function paymentNextActionsWithCopyRunnableCommands(data, commandPrefix) {
|
|
2832
|
+
let changed = false;
|
|
2833
|
+
let updated = data;
|
|
2834
|
+
|
|
2835
|
+
if (
|
|
2836
|
+
data.quota !== null &&
|
|
2837
|
+
typeof data.quota === "object" &&
|
|
2838
|
+
!Array.isArray(data.quota) &&
|
|
2839
|
+
data.quota.top_up !== null &&
|
|
2840
|
+
typeof data.quota.top_up === "object" &&
|
|
2841
|
+
!Array.isArray(data.quota.top_up)
|
|
2842
|
+
) {
|
|
2843
|
+
updated = {
|
|
2844
|
+
...updated,
|
|
2845
|
+
quota: {
|
|
2846
|
+
...data.quota,
|
|
2847
|
+
top_up: quotaTopUpWithCopyRunnableCommands(
|
|
2848
|
+
data.quota.top_up,
|
|
2849
|
+
commandPrefix,
|
|
2850
|
+
),
|
|
2851
|
+
},
|
|
2852
|
+
};
|
|
2853
|
+
changed = true;
|
|
2854
|
+
}
|
|
2855
|
+
|
|
2832
2856
|
if (
|
|
2833
2857
|
data.next_actions === null ||
|
|
2834
2858
|
typeof data.next_actions !== "object" ||
|
|
2835
2859
|
Array.isArray(data.next_actions)
|
|
2836
2860
|
) {
|
|
2837
|
-
return data;
|
|
2861
|
+
return changed ? updated : data;
|
|
2838
2862
|
}
|
|
2839
|
-
|
|
2863
|
+
|
|
2840
2864
|
const nextActions = { ...data.next_actions };
|
|
2841
2865
|
|
|
2842
2866
|
if (
|
|
@@ -2893,7 +2917,18 @@ function paymentNextActionsWithCopyRunnableCommands(data, commandPrefix) {
|
|
|
2893
2917
|
nextActions.recommended_settlement = recommendedSettlement;
|
|
2894
2918
|
}
|
|
2895
2919
|
|
|
2896
|
-
|
|
2920
|
+
if (
|
|
2921
|
+
nextActions.self_fund !== null &&
|
|
2922
|
+
typeof nextActions.self_fund === "object" &&
|
|
2923
|
+
!Array.isArray(nextActions.self_fund)
|
|
2924
|
+
) {
|
|
2925
|
+
const selfFund = { ...nextActions.self_fund };
|
|
2926
|
+
changed =
|
|
2927
|
+
renderSelfFundActionCommandFields(selfFund, commandPrefix) || changed;
|
|
2928
|
+
nextActions.self_fund = selfFund;
|
|
2929
|
+
}
|
|
2930
|
+
|
|
2931
|
+
return changed ? { ...updated, next_actions: nextActions } : data;
|
|
2897
2932
|
}
|
|
2898
2933
|
|
|
2899
2934
|
function renderPaymentActionCommandField(record, field, commandPrefix) {
|
|
@@ -2911,6 +2946,57 @@ function renderPaymentActionCommandField(record, field, commandPrefix) {
|
|
|
2911
2946
|
return true;
|
|
2912
2947
|
}
|
|
2913
2948
|
|
|
2949
|
+
function renderSelfFundActionCommandFields(record, commandPrefix) {
|
|
2950
|
+
let changed = false;
|
|
2951
|
+
for (const field of [
|
|
2952
|
+
"first_safe_command",
|
|
2953
|
+
"inspect_methods_command",
|
|
2954
|
+
"inspect_packs_command",
|
|
2955
|
+
"quote_command",
|
|
2956
|
+
"buy_command",
|
|
2957
|
+
"status_command",
|
|
2958
|
+
"fallback_quote_command",
|
|
2959
|
+
"fallback_buy_command",
|
|
2960
|
+
]) {
|
|
2961
|
+
changed =
|
|
2962
|
+
renderPaymentActionCommandField(record, field, commandPrefix) || changed;
|
|
2963
|
+
}
|
|
2964
|
+
|
|
2965
|
+
if (
|
|
2966
|
+
record.workflow !== null &&
|
|
2967
|
+
typeof record.workflow === "object" &&
|
|
2968
|
+
!Array.isArray(record.workflow) &&
|
|
2969
|
+
Array.isArray(record.workflow.steps)
|
|
2970
|
+
) {
|
|
2971
|
+
let workflowChanged = false;
|
|
2972
|
+
const steps = record.workflow.steps.map((step) => {
|
|
2973
|
+
if (
|
|
2974
|
+
step === null ||
|
|
2975
|
+
typeof step !== "object" ||
|
|
2976
|
+
Array.isArray(step) ||
|
|
2977
|
+
typeof step.command !== "string"
|
|
2978
|
+
) {
|
|
2979
|
+
return step;
|
|
2980
|
+
}
|
|
2981
|
+
const command = renderCopyRunnablePaymentCommand(
|
|
2982
|
+
commandPrefix,
|
|
2983
|
+
step.command,
|
|
2984
|
+
);
|
|
2985
|
+
if (command === step.command) {
|
|
2986
|
+
return step;
|
|
2987
|
+
}
|
|
2988
|
+
workflowChanged = true;
|
|
2989
|
+
return { ...step, command };
|
|
2990
|
+
});
|
|
2991
|
+
if (workflowChanged) {
|
|
2992
|
+
record.workflow = { ...record.workflow, steps };
|
|
2993
|
+
changed = true;
|
|
2994
|
+
}
|
|
2995
|
+
}
|
|
2996
|
+
|
|
2997
|
+
return changed;
|
|
2998
|
+
}
|
|
2999
|
+
|
|
2914
3000
|
function creditQuoteWithCopyRunnableCommands(quote, commandPrefix) {
|
|
2915
3001
|
const recommendedBuy =
|
|
2916
3002
|
quote.next_actions?.recommended_buy !== null &&
|
|
@@ -4057,50 +4143,56 @@ async function create(argv) {
|
|
|
4057
4143
|
argv,
|
|
4058
4144
|
})
|
|
4059
4145
|
: 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
|
-
|
|
4146
|
+
const commandPrefix = createGuideCommandPrefix();
|
|
4147
|
+
const result = withCopyRunnablePaymentNextActionCommands(
|
|
4148
|
+
withCopyRunnableQuotaRecoveryCommands(
|
|
4149
|
+
await apiRequest({
|
|
4150
|
+
command: "image-skill create",
|
|
4151
|
+
method: "POST",
|
|
4152
|
+
apiBaseUrl: apiBase(args),
|
|
4153
|
+
path: "/v1/create",
|
|
4154
|
+
...(token.token === null ? {} : { token: token.token }),
|
|
4155
|
+
body: {
|
|
4156
|
+
prompt: prompt.value,
|
|
4157
|
+
...(flagString(args, "provider") === null
|
|
4158
|
+
? {}
|
|
4159
|
+
: { provider: flagString(args, "provider") }),
|
|
4160
|
+
...(flagString(args, "model") === null
|
|
4161
|
+
? {}
|
|
4162
|
+
: { model: flagString(args, "model") }),
|
|
4163
|
+
...(flagString(args, "intent") === null
|
|
4164
|
+
? {}
|
|
4165
|
+
: { intent: flagString(args, "intent") }),
|
|
4166
|
+
aspect_ratio: flagString(args, "aspect-ratio") ?? "1:1",
|
|
4167
|
+
...(references.references.length === 0
|
|
4168
|
+
? {}
|
|
4169
|
+
: { references: references.references }),
|
|
4170
|
+
...(outputCount.value === null
|
|
4171
|
+
? {}
|
|
4172
|
+
: { output_count: outputCount.value }),
|
|
4173
|
+
...(flagNumber(args, "max-estimated-usd-per-image") === null
|
|
4174
|
+
? {}
|
|
4175
|
+
: {
|
|
4176
|
+
max_estimated_usd_per_image: flagNumber(
|
|
4177
|
+
args,
|
|
4178
|
+
"max-estimated-usd-per-image",
|
|
4179
|
+
),
|
|
4180
|
+
}),
|
|
4181
|
+
...(modelParameters.value === null
|
|
4182
|
+
? {}
|
|
4183
|
+
: { model_parameters: modelParameters.value }),
|
|
4184
|
+
// Retry-safe dedupe (#1228/#1789): a live create always carries a key so a
|
|
4185
|
+
// retry (or an interrupted-then-recovered run) dedupes to one charge.
|
|
4186
|
+
...(idempotencyKey === null
|
|
4187
|
+
? {}
|
|
4188
|
+
: { idempotency_key: idempotencyKey }),
|
|
4189
|
+
dry_run: flagBool(args, "dry-run"),
|
|
4190
|
+
accept_unknown_cost: flagBool(args, "accept-unknown-cost"),
|
|
4191
|
+
},
|
|
4192
|
+
}),
|
|
4193
|
+
commandPrefix,
|
|
4194
|
+
),
|
|
4195
|
+
commandPrefix,
|
|
4104
4196
|
);
|
|
4105
4197
|
await clearInFlightSpendForResult(inFlight, result);
|
|
4106
4198
|
return result;
|
|
@@ -4194,47 +4286,55 @@ async function edit(argv) {
|
|
|
4194
4286
|
argv,
|
|
4195
4287
|
})
|
|
4196
4288
|
: 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
|
-
|
|
4289
|
+
const commandPrefix = createGuideCommandPrefix();
|
|
4290
|
+
const result = withCopyRunnablePaymentNextActionCommands(
|
|
4291
|
+
withCopyRunnableQuotaRecoveryCommands(
|
|
4292
|
+
await apiRequest({
|
|
4293
|
+
command: "image-skill edit",
|
|
4294
|
+
method: "POST",
|
|
4295
|
+
apiBaseUrl: apiBase(args),
|
|
4296
|
+
path: "/v1/edit",
|
|
4297
|
+
token: token.token,
|
|
4298
|
+
body: {
|
|
4299
|
+
input_asset_id: assetId.assetId,
|
|
4300
|
+
...(maskAssetId === null
|
|
4301
|
+
? {}
|
|
4302
|
+
: { mask_asset_id: maskAssetId.assetId }),
|
|
4303
|
+
...(references.references.length === 0
|
|
4304
|
+
? {}
|
|
4305
|
+
: { references: references.references }),
|
|
4306
|
+
...(prompt.value.length === 0 ? {} : { prompt: prompt.value }),
|
|
4307
|
+
...(flagString(args, "provider") === null
|
|
4308
|
+
? {}
|
|
4309
|
+
: { provider: flagString(args, "provider") }),
|
|
4310
|
+
...(modelId === null ? {} : { model: modelId }),
|
|
4311
|
+
...(flagString(args, "intent") === null
|
|
4312
|
+
? {}
|
|
4313
|
+
: { intent: flagString(args, "intent") }),
|
|
4314
|
+
aspect_ratio: flagString(args, "aspect-ratio") ?? "auto",
|
|
4315
|
+
...(flagNumber(args, "max-estimated-usd-per-image") === null
|
|
4316
|
+
? {}
|
|
4317
|
+
: {
|
|
4318
|
+
max_estimated_usd_per_image: flagNumber(
|
|
4319
|
+
args,
|
|
4320
|
+
"max-estimated-usd-per-image",
|
|
4321
|
+
),
|
|
4322
|
+
}),
|
|
4323
|
+
...(modelParameters.value === null
|
|
4324
|
+
? {}
|
|
4325
|
+
: { model_parameters: modelParameters.value }),
|
|
4326
|
+
...(flagBool(args, "dry-run") ? { dry_run: true } : {}),
|
|
4327
|
+
// Retry-safe dedupe (#1228/#1789): a live edit always carries a key so a
|
|
4328
|
+
// retry (or an interrupted-then-recovered run) dedupes to one charge.
|
|
4329
|
+
...(idempotencyKey === null
|
|
4330
|
+
? {}
|
|
4331
|
+
: { idempotency_key: idempotencyKey }),
|
|
4332
|
+
accept_unknown_cost: flagBool(args, "accept-unknown-cost"),
|
|
4333
|
+
},
|
|
4334
|
+
}),
|
|
4335
|
+
commandPrefix,
|
|
4336
|
+
),
|
|
4337
|
+
commandPrefix,
|
|
4238
4338
|
);
|
|
4239
4339
|
await clearInFlightSpendForResult(inFlight, result);
|
|
4240
4340
|
return result;
|
|
@@ -4259,22 +4359,28 @@ async function assets(argv) {
|
|
|
4259
4359
|
return token.result;
|
|
4260
4360
|
}
|
|
4261
4361
|
if (subcommand === "show") {
|
|
4262
|
-
return
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4362
|
+
return withCopyRunnablePaymentNextActionCommands(
|
|
4363
|
+
await apiRequest({
|
|
4364
|
+
command: "image-skill assets show",
|
|
4365
|
+
method: "GET",
|
|
4366
|
+
apiBaseUrl: apiBase(args),
|
|
4367
|
+
path: `/v1/assets/${encodeURIComponent(assetId)}`,
|
|
4368
|
+
token: token.token,
|
|
4369
|
+
}),
|
|
4370
|
+
createGuideCommandPrefix(),
|
|
4371
|
+
);
|
|
4269
4372
|
}
|
|
4270
4373
|
if (subcommand === "get") {
|
|
4271
|
-
const shown =
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4374
|
+
const shown = withCopyRunnablePaymentNextActionCommands(
|
|
4375
|
+
await apiRequest({
|
|
4376
|
+
command: "image-skill assets get",
|
|
4377
|
+
method: "GET",
|
|
4378
|
+
apiBaseUrl: apiBase(args),
|
|
4379
|
+
path: `/v1/assets/${encodeURIComponent(assetId)}`,
|
|
4380
|
+
token: token.token,
|
|
4381
|
+
}),
|
|
4382
|
+
createGuideCommandPrefix(),
|
|
4383
|
+
);
|
|
4278
4384
|
if (!shown.envelope.ok) {
|
|
4279
4385
|
return shown;
|
|
4280
4386
|
}
|
|
@@ -4315,26 +4421,32 @@ async function jobs(argv) {
|
|
|
4315
4421
|
return token.result;
|
|
4316
4422
|
}
|
|
4317
4423
|
if (subcommand === "show") {
|
|
4318
|
-
return
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4424
|
+
return withCopyRunnablePaymentNextActionCommands(
|
|
4425
|
+
await apiRequest({
|
|
4426
|
+
command: "image-skill jobs show",
|
|
4427
|
+
method: "GET",
|
|
4428
|
+
apiBaseUrl: apiBase(args),
|
|
4429
|
+
path: `/v1/jobs/${encodeURIComponent(jobId)}`,
|
|
4430
|
+
token: token.token,
|
|
4431
|
+
}),
|
|
4432
|
+
createGuideCommandPrefix(),
|
|
4433
|
+
);
|
|
4325
4434
|
}
|
|
4326
4435
|
if (subcommand === "wait") {
|
|
4327
4436
|
const timeoutMs = flagNumber(args, "timeout-ms") ?? 30_000;
|
|
4328
4437
|
const pollIntervalMs = flagNumber(args, "poll-interval-ms") ?? 1_000;
|
|
4329
4438
|
const started = Date.now();
|
|
4330
4439
|
while (Date.now() - started <= timeoutMs) {
|
|
4331
|
-
const current =
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4440
|
+
const current = withCopyRunnablePaymentNextActionCommands(
|
|
4441
|
+
await apiRequest({
|
|
4442
|
+
command: "image-skill jobs wait",
|
|
4443
|
+
method: "GET",
|
|
4444
|
+
apiBaseUrl: apiBase(args),
|
|
4445
|
+
path: `/v1/jobs/${encodeURIComponent(jobId)}`,
|
|
4446
|
+
token: token.token,
|
|
4447
|
+
}),
|
|
4448
|
+
createGuideCommandPrefix(),
|
|
4449
|
+
);
|
|
4338
4450
|
if (!current.envelope.ok) {
|
|
4339
4451
|
return current;
|
|
4340
4452
|
}
|
|
@@ -4380,13 +4492,16 @@ async function activity(argv) {
|
|
|
4380
4492
|
"activity show requires REFERENCE",
|
|
4381
4493
|
);
|
|
4382
4494
|
}
|
|
4383
|
-
return
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4495
|
+
return withCopyRunnablePaymentNextActionCommands(
|
|
4496
|
+
await apiRequest({
|
|
4497
|
+
command: "image-skill activity show",
|
|
4498
|
+
method: "GET",
|
|
4499
|
+
apiBaseUrl: apiBase(args),
|
|
4500
|
+
path: `/v1/activity/${encodeURIComponent(reference)}`,
|
|
4501
|
+
token: token.token,
|
|
4502
|
+
}),
|
|
4503
|
+
createGuideCommandPrefix(),
|
|
4504
|
+
);
|
|
4390
4505
|
}
|
|
4391
4506
|
if (subcommand === "list") {
|
|
4392
4507
|
const query = new URLSearchParams();
|
|
@@ -4398,13 +4513,16 @@ async function activity(argv) {
|
|
|
4398
4513
|
if (subject !== null) {
|
|
4399
4514
|
query.set("subject", subject);
|
|
4400
4515
|
}
|
|
4401
|
-
return
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4516
|
+
return withCopyRunnablePaymentNextActionCommands(
|
|
4517
|
+
await apiRequest({
|
|
4518
|
+
command: "image-skill activity list",
|
|
4519
|
+
method: "GET",
|
|
4520
|
+
apiBaseUrl: apiBase(args),
|
|
4521
|
+
path: `/v1/activity${query.size > 0 ? `?${query.toString()}` : ""}`,
|
|
4522
|
+
token: token.token,
|
|
4523
|
+
}),
|
|
4524
|
+
createGuideCommandPrefix(),
|
|
4525
|
+
);
|
|
4408
4526
|
}
|
|
4409
4527
|
return invalid("image-skill activity", "activity requires list or show");
|
|
4410
4528
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "image-skill",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.65",
|
|
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,
|