image-skill 0.1.40 → 0.1.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,18 @@ 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.41 - 2026-06-12
8
+
9
+ - Fix (activation): `create --guide` now selects executable models from the
10
+ compact default `/v1/models` response. The guide no longer reports
11
+ `no_executable_model` while the same response says executable models exist;
12
+ it preserves compact-row execution status, pricing, aspect-ratio fallback,
13
+ and input-image hints so the first no-spend dry-run handoff is usable again.
14
+ - Fix (payments): Stripe Checkout handoff URLs now keep redirecting to the
15
+ stored Stripe Checkout URL for non-expired fulfilled attempts instead of
16
+ surfacing the misleading plain-text `handoff database read failed` page after
17
+ webhook fulfillment.
18
+
7
19
  ## 0.1.40 - 2026-06-11
8
20
 
9
21
  - Fix (growth): the `IMAGE_SKILL_DISCOVERY_SOURCE` attribution slug now
@@ -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.40";
10
+ const VERSION = "0.1.41";
11
11
  const PACKAGE_NAME = "image-skill";
12
12
  const DEFAULT_API_BASE_URL = "https://api.image-skill.com";
13
13
  const DEFAULT_DOCS_BASE_URL = "https://image-skill.com";
@@ -1652,12 +1652,15 @@ async function createGuide(args) {
1652
1652
  })
1653
1653
  : null;
1654
1654
  const selectedAspectRatio = createGuideSuggestedAspectRatio(selected);
1655
- const pricing = selected?.economics?.credit_pricing ?? null;
1655
+ const pricing = createGuideModelCreditPricing(selected);
1656
1656
  const estimatedCredits = pricing?.credits_required ?? null;
1657
1657
  const estimatedProviderUsdPerImage =
1658
1658
  selected?.economics?.estimated_usd_per_image ??
1659
1659
  pricing?.estimated_provider_cost_usd ??
1660
1660
  pricing?.fallback_provider_cost_usd ??
1661
+ (typeof selected?.estimated_usd_per_image === "number"
1662
+ ? selected.estimated_usd_per_image
1663
+ : null) ??
1661
1664
  null;
1662
1665
  const estimatedDebitUsdPerImage =
1663
1666
  pricing?.estimated_revenue_usd ?? estimatedProviderUsdPerImage;
@@ -1856,7 +1859,7 @@ async function createGuide(args) {
1856
1859
  : "create",
1857
1860
  model_id: selected.id,
1858
1861
  model_status: selected.status,
1859
- model_execution_status: selected.execution.model_execution_status,
1862
+ model_execution_status: guideModelExecutionStatus(selected),
1860
1863
  modality: selected.modality ?? null,
1861
1864
  suggested_aspect_ratio: selectedAspectRatio,
1862
1865
  reason:
@@ -1924,12 +1927,12 @@ function selectCreateGuideModel(
1924
1927
  ) {
1925
1928
  const isExecutableCreate = (model) =>
1926
1929
  model?.status === "available" &&
1927
- model?.execution?.model_execution_status === "executable" &&
1930
+ guideModelExecutionStatus(model) === "executable" &&
1928
1931
  Array.isArray(model?.supports) &&
1929
1932
  model.supports.includes("create");
1930
1933
  const isExecutableInputImageEdit = (model) =>
1931
1934
  model?.status === "available" &&
1932
- model?.execution?.model_execution_status === "executable" &&
1935
+ guideModelExecutionStatus(model) === "executable" &&
1933
1936
  Array.isArray(model?.supports) &&
1934
1937
  (model.supports.includes("edit") || model.supports.includes("variation")) &&
1935
1938
  createGuideSelectedModelRequiresInputImage(model);
@@ -2036,16 +2039,57 @@ function preferredCreateGuideModelIds(intentClass) {
2036
2039
  }
2037
2040
 
2038
2041
  function guideBudgetUsdForModel(model) {
2039
- const pricing = model?.economics?.credit_pricing ?? null;
2042
+ const pricing = createGuideModelCreditPricing(model);
2040
2043
  return (
2041
2044
  pricing?.estimated_revenue_usd ??
2042
2045
  model?.economics?.estimated_usd_per_image ??
2043
2046
  pricing?.estimated_provider_cost_usd ??
2044
2047
  pricing?.fallback_provider_cost_usd ??
2048
+ (typeof model?.estimated_usd_per_image === "number"
2049
+ ? model.estimated_usd_per_image
2050
+ : null) ??
2045
2051
  null
2046
2052
  );
2047
2053
  }
2048
2054
 
2055
+ function guideModelExecutionStatus(model) {
2056
+ if (
2057
+ isRecord(model?.execution) &&
2058
+ typeof model.execution.model_execution_status === "string"
2059
+ ) {
2060
+ return model.execution.model_execution_status;
2061
+ }
2062
+ return typeof model?.model_execution_status === "string"
2063
+ ? model.model_execution_status
2064
+ : null;
2065
+ }
2066
+
2067
+ function createGuideModelCreditPricing(model) {
2068
+ if (isRecord(model?.economics?.credit_pricing)) {
2069
+ return model.economics.credit_pricing;
2070
+ }
2071
+ if (typeof model?.credits_required !== "number") {
2072
+ return null;
2073
+ }
2074
+ return {
2075
+ credits_required: model.credits_required,
2076
+ estimated_revenue_usd:
2077
+ typeof model.credits_required === "number"
2078
+ ? model.credits_required * CREDIT_UNIT_USD
2079
+ : null,
2080
+ estimated_provider_cost_usd:
2081
+ typeof model?.estimated_usd_per_image === "number"
2082
+ ? model.estimated_usd_per_image
2083
+ : null,
2084
+ fallback_provider_cost_usd: null,
2085
+ credit_unit_usd: CREDIT_UNIT_USD,
2086
+ pricing_confidence:
2087
+ typeof model?.pricing_confidence === "string"
2088
+ ? model.pricing_confidence
2089
+ : null,
2090
+ };
2091
+ }
2092
+
2049
2093
  function createGuideImplies3d(input) {
2050
2094
  const searchable =
2051
2095
  `${input?.intent ?? ""} ${input?.prompt ?? ""}`.toLowerCase();
@@ -2077,7 +2121,9 @@ function createGuideSuggestedAspectRatio(model) {
2077
2121
  if (model?.modality !== "video") {
2078
2122
  return null;
2079
2123
  }
2080
- const values = model?.media?.input?.aspect_ratios?.values;
2124
+ const values = Array.isArray(model?.media?.input?.aspect_ratios?.values)
2125
+ ? model.media.input.aspect_ratios.values
2126
+ : model?.aspect_ratios;
2081
2127
  if (!Array.isArray(values)) {
2082
2128
  return null;
2083
2129
  }
@@ -2086,7 +2132,8 @@ function createGuideSuggestedAspectRatio(model) {
2086
2132
 
2087
2133
  function createGuideSelectedModelRequiresInputImage(model) {
2088
2134
  return (
2089
- model?.media?.input?.images?.required === true &&
2135
+ (model?.media?.input?.images?.required === true ||
2136
+ model?.accepts_input_images === true) &&
2090
2137
  Array.isArray(model?.supports) &&
2091
2138
  (model.supports.includes("edit") || model.supports.includes("variation"))
2092
2139
  );
@@ -4383,6 +4430,9 @@ function modelAvailabilityStatus(model) {
4383
4430
  ) {
4384
4431
  return model.execution.model_execution_status;
4385
4432
  }
4433
+ if (typeof model.model_execution_status === "string") {
4434
+ return model.model_execution_status;
4435
+ }
4386
4436
  if (typeof model.availability_reason === "string") {
4387
4437
  return model.availability_reason;
4388
4438
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "image-skill",
3
- "version": "0.1.40",
3
+ "version": "0.1.41",
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,