@agentforge-io/connectors-higgsfield 1.0.1 → 1.1.0
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 +5 -1
- package/dist/api.d.ts +38 -1
- package/dist/api.js +137 -8
- package/dist/index.d.ts +1 -1
- package/dist/mcp.d.ts +6 -0
- package/dist/mcp.js +2 -1
- package/dist/rules.d.ts +22 -0
- package/dist/rules.js +15 -1
- package/dist/skills.d.ts +110 -7
- package/dist/skills.js +79 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -53,7 +53,11 @@ envelopes of `balance` (`{credits, subscription_plan_type}`) and `estimate_image
|
|
|
53
53
|
NOT verified against a real grant. Parsed tolerantly; anything else throws `unexpected_response`:
|
|
54
54
|
- `media_import_url`: media id in `media_id` | `id` | `media.id` | `results[0].(media_id|id)`.
|
|
55
55
|
- `remove_background`: a `job_id` (also in `job`/`jobs[]`/`results[]`) and/or a `media_id`; whether it costs credits and
|
|
56
|
-
where `use_unlim` goes (we put it inside `params`).
|
|
56
|
+
where `use_unlim` goes (we put it inside `params`). The real success envelope was NEVER captured (PDK-HIGGSFIELD-UNKNOWN: a paid,
|
|
57
|
+
completed call surfaced as an unreadable reply). If the reply cannot be read, `removeBackground` does not guess: it looks the job up
|
|
58
|
+
for free in the generation history (`findBackgroundRemoval`, verified `show_generations` shape: model `image_background_remover`,
|
|
59
|
+
`params.medias[].data.id` = the source job/media id, `results.rawUrl`) and only throws `unexpected_response` (with the reply's SHAPE,
|
|
60
|
+
never its values) when nothing matches.
|
|
57
61
|
- `generate_image`: job ids in `job_id` | `id` | `job_ids[]` | `jobs[]` | `results[]`; the `variant` parameter name for
|
|
58
62
|
flux_2 `pro`; whether `quote_ref` can be passed back.
|
|
59
63
|
- `jobs_wait`: `all_terminal` boolean plus a `jobs[]` (or `results[]`) list with `job_id`|`id`, `status`, and result URLs
|
package/dist/api.d.ts
CHANGED
|
@@ -35,9 +35,29 @@ export interface GenerateImageParams {
|
|
|
35
35
|
medias?: MediaRef[];
|
|
36
36
|
[extra: string]: unknown;
|
|
37
37
|
}
|
|
38
|
+
/** Structure only (keys and primitive types, never values): safe to log and to store for diagnosis. */
|
|
39
|
+
export declare function shapeOf(v: unknown, depth?: number): string;
|
|
40
|
+
export interface BackgroundRemoval {
|
|
41
|
+
jobId: string;
|
|
42
|
+
status: JobStatus;
|
|
43
|
+
url?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface HiggsfieldApiOptions {
|
|
46
|
+
/** Injectable for tests. */
|
|
47
|
+
sleep?: (ms: number) => Promise<void>;
|
|
48
|
+
now?: () => number;
|
|
49
|
+
/** Lookups attempted after an unreadable remove_background reply (default 3). */
|
|
50
|
+
recoverTries?: number;
|
|
51
|
+
/** Delay between those lookups (default 2000 ms). */
|
|
52
|
+
recoverDelayMs?: number;
|
|
53
|
+
}
|
|
38
54
|
export declare class HiggsfieldApi {
|
|
39
55
|
private readonly mcp;
|
|
40
|
-
|
|
56
|
+
private readonly sleep;
|
|
57
|
+
private readonly now;
|
|
58
|
+
private readonly recoverTries;
|
|
59
|
+
private readonly recoverDelayMs;
|
|
60
|
+
constructor(mcp: HiggsfieldMcpClient, opts?: HiggsfieldApiOptions);
|
|
41
61
|
/** Verified envelope: { credits, subscription_plan_type }. */
|
|
42
62
|
balance(): Promise<Balance>;
|
|
43
63
|
/** Returns a confirmed media_id (envelope parsed tolerantly). */
|
|
@@ -47,11 +67,28 @@ export declare class HiggsfieldApi {
|
|
|
47
67
|
/**
|
|
48
68
|
* Treated as spending (its cost is not published). Result may be a job or a media id.
|
|
49
69
|
* The tool's params schema is closed: only media_id and media_type are accepted.
|
|
70
|
+
*
|
|
71
|
+
* The real success envelope was never captured (PDK-HIGGSFIELD-UNKNOWN). When the call was ACCEPTED but its reply is
|
|
72
|
+
* unreadable (`unexpected_response`: no JSON content, or no job/media id), the job is looked up for free in the
|
|
73
|
+
* generation history (`findBackgroundRemoval`) before giving up. Timeouts / `outcome_unknown` are NOT recovered here
|
|
74
|
+
* (the call may never have been made); the platform reconciles those with the same free lookup.
|
|
50
75
|
*/
|
|
51
76
|
removeBackground(mediaId: string): Promise<{
|
|
52
77
|
jobId?: string;
|
|
53
78
|
mediaId?: string;
|
|
54
79
|
}>;
|
|
80
|
+
/**
|
|
81
|
+
* FREE, read-only. Finds the background removal of `sourceId` (a generation job id or media id) in the account's
|
|
82
|
+
* generation history: `show_generations` items with model `image_background_remover` whose `params.medias[].data.id`
|
|
83
|
+
* is `sourceId`. Newest match wins. Verified shape (2026-12-01): `{ items: [{ id, status, model, params:{medias:
|
|
84
|
+
* [{role, data:{id,type,url}}]}, results:{rawUrl,minUrl}, createdAt }], next_cursor }`.
|
|
85
|
+
* Never throws on items it does not understand; returns undefined when nothing matches.
|
|
86
|
+
*/
|
|
87
|
+
findBackgroundRemoval(sourceId: string, opts?: {
|
|
88
|
+
createdAfter?: number;
|
|
89
|
+
pageSize?: number;
|
|
90
|
+
maxPages?: number;
|
|
91
|
+
}): Promise<BackgroundRemoval | undefined>;
|
|
55
92
|
/** Verified envelope: { cost: { credits, credits_exact }, quote_ref }. Free call. */
|
|
56
93
|
estimateImageCost(params: GenerateImageParams): Promise<CostEstimate>;
|
|
57
94
|
/** SPENDING. Never retried; ambiguous failures surface as providerCode 'outcome_unknown'. */
|
package/dist/api.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.HiggsfieldApi = exports.TERMINAL_JOB_STATUSES = void 0;
|
|
4
|
+
exports.shapeOf = shapeOf;
|
|
4
5
|
const mcp_1 = require("./mcp");
|
|
5
6
|
exports.TERMINAL_JOB_STATUSES = ['completed', 'failed', 'nsfw', 'ip_detected'];
|
|
6
7
|
function unexpected(tool, what) {
|
|
@@ -41,7 +42,7 @@ function findId(o, keys, listKeys, nestKeys = []) {
|
|
|
41
42
|
for (const k of listKeys) {
|
|
42
43
|
const l = o[k];
|
|
43
44
|
if (Array.isArray(l) && l.length) {
|
|
44
|
-
const e = firstId(l[0], keys);
|
|
45
|
+
const e = typeof l[0] === 'string' && l[0] ? l[0] : firstId(l[0], keys);
|
|
45
46
|
if (e)
|
|
46
47
|
return e;
|
|
47
48
|
}
|
|
@@ -67,6 +68,44 @@ function findIds(o, keys, listKeys) {
|
|
|
67
68
|
}
|
|
68
69
|
return [...new Set(out)];
|
|
69
70
|
}
|
|
71
|
+
/** Last resort: first string under any of `keys`, at any depth (bounded). */
|
|
72
|
+
function deepFindId(o, keys, depth = 0) {
|
|
73
|
+
if (depth > 4)
|
|
74
|
+
return undefined;
|
|
75
|
+
if (Array.isArray(o)) {
|
|
76
|
+
for (const e of o.slice(0, 10)) {
|
|
77
|
+
const f = deepFindId(e, keys, depth + 1);
|
|
78
|
+
if (f)
|
|
79
|
+
return f;
|
|
80
|
+
}
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
83
|
+
if (!isObj(o))
|
|
84
|
+
return undefined;
|
|
85
|
+
const direct = firstId(o, keys);
|
|
86
|
+
if (direct)
|
|
87
|
+
return direct;
|
|
88
|
+
for (const v of Object.values(o)) {
|
|
89
|
+
const f = deepFindId(v, keys, depth + 1);
|
|
90
|
+
if (f)
|
|
91
|
+
return f;
|
|
92
|
+
}
|
|
93
|
+
return undefined;
|
|
94
|
+
}
|
|
95
|
+
/** Structure only (keys and primitive types, never values): safe to log and to store for diagnosis. */
|
|
96
|
+
function shapeOf(v, depth = 0) {
|
|
97
|
+
if (Array.isArray(v))
|
|
98
|
+
return depth >= 3 ? 'array' : `[${v.length ? shapeOf(v[0], depth + 1) : ''}]`;
|
|
99
|
+
if (isObj(v)) {
|
|
100
|
+
if (depth >= 3)
|
|
101
|
+
return 'object';
|
|
102
|
+
const parts = Object.keys(v)
|
|
103
|
+
.slice(0, 12)
|
|
104
|
+
.map((k) => `${k.slice(0, 40)}:${shapeOf(v[k], depth + 1)}`);
|
|
105
|
+
return `{${parts.join(',')}}`;
|
|
106
|
+
}
|
|
107
|
+
return v === null ? 'null' : typeof v;
|
|
108
|
+
}
|
|
70
109
|
function urlsOf(v) {
|
|
71
110
|
const out = [];
|
|
72
111
|
const push = (e) => {
|
|
@@ -85,8 +124,12 @@ function urlsOf(v) {
|
|
|
85
124
|
return out;
|
|
86
125
|
}
|
|
87
126
|
class HiggsfieldApi {
|
|
88
|
-
constructor(mcp) {
|
|
127
|
+
constructor(mcp, opts = {}) {
|
|
89
128
|
this.mcp = mcp;
|
|
129
|
+
this.sleep = opts.sleep ?? ((ms) => new Promise((r) => setTimeout(r, ms)));
|
|
130
|
+
this.now = opts.now ?? Date.now;
|
|
131
|
+
this.recoverTries = opts.recoverTries ?? 3;
|
|
132
|
+
this.recoverDelayMs = opts.recoverDelayMs ?? 2000;
|
|
90
133
|
}
|
|
91
134
|
/** Verified envelope: { credits, subscription_plan_type }. */
|
|
92
135
|
async balance() {
|
|
@@ -109,15 +152,101 @@ class HiggsfieldApi {
|
|
|
109
152
|
/**
|
|
110
153
|
* Treated as spending (its cost is not published). Result may be a job or a media id.
|
|
111
154
|
* The tool's params schema is closed: only media_id and media_type are accepted.
|
|
155
|
+
*
|
|
156
|
+
* The real success envelope was never captured (PDK-HIGGSFIELD-UNKNOWN). When the call was ACCEPTED but its reply is
|
|
157
|
+
* unreadable (`unexpected_response`: no JSON content, or no job/media id), the job is looked up for free in the
|
|
158
|
+
* generation history (`findBackgroundRemoval`) before giving up. Timeouts / `outcome_unknown` are NOT recovered here
|
|
159
|
+
* (the call may never have been made); the platform reconciles those with the same free lookup.
|
|
112
160
|
*/
|
|
113
161
|
async removeBackground(mediaId) {
|
|
114
162
|
const params = { media_id: mediaId, media_type: 'image' };
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
163
|
+
const startedAt = this.now() / 1000;
|
|
164
|
+
let failure;
|
|
165
|
+
try {
|
|
166
|
+
const r = await this.mcp.callTool('remove_background', { params }, { spending: true });
|
|
167
|
+
// Same tolerance as generate_image (`id`, `job_ids[]`, ...).
|
|
168
|
+
const jobId = findId(r, ['job_id', 'jobId', 'id'], ['job_ids', 'jobs', 'results', 'result'], ['job', 'result', 'data']) ??
|
|
169
|
+
deepFindId(r, ['job_id', 'jobId']);
|
|
170
|
+
const outMedia = findId(r, ['media_id', 'mediaId'], ['medias', 'results'], ['media']);
|
|
171
|
+
if (jobId || outMedia)
|
|
172
|
+
return { ...(jobId ? { jobId } : {}), ...(outMedia ? { mediaId: outMedia } : {}) };
|
|
173
|
+
failure = new mcp_1.HiggsfieldApiError(200, 'unexpected_response', `remove_background: neither a job id nor a media id in response (${shapeOf(r)})`);
|
|
174
|
+
}
|
|
175
|
+
catch (e) {
|
|
176
|
+
if (!(e instanceof mcp_1.HiggsfieldApiError) || e.providerCode !== 'unexpected_response')
|
|
177
|
+
throw e;
|
|
178
|
+
failure = e;
|
|
179
|
+
}
|
|
180
|
+
for (let i = 0; i < this.recoverTries; i++) {
|
|
181
|
+
if (i > 0)
|
|
182
|
+
await this.sleep(this.recoverDelayMs);
|
|
183
|
+
let found;
|
|
184
|
+
try {
|
|
185
|
+
found = await this.findBackgroundRemoval(mediaId, { createdAfter: startedAt - 60 });
|
|
186
|
+
}
|
|
187
|
+
catch {
|
|
188
|
+
found = undefined; // the lookup is best effort; the original failure is what gets reported
|
|
189
|
+
}
|
|
190
|
+
if (found)
|
|
191
|
+
return { jobId: found.jobId };
|
|
192
|
+
}
|
|
193
|
+
throw failure;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* FREE, read-only. Finds the background removal of `sourceId` (a generation job id or media id) in the account's
|
|
197
|
+
* generation history: `show_generations` items with model `image_background_remover` whose `params.medias[].data.id`
|
|
198
|
+
* is `sourceId`. Newest match wins. Verified shape (2026-12-01): `{ items: [{ id, status, model, params:{medias:
|
|
199
|
+
* [{role, data:{id,type,url}}]}, results:{rawUrl,minUrl}, createdAt }], next_cursor }`.
|
|
200
|
+
* Never throws on items it does not understand; returns undefined when nothing matches.
|
|
201
|
+
*/
|
|
202
|
+
async findBackgroundRemoval(sourceId, opts = {}) {
|
|
203
|
+
const size = opts.pageSize ?? 30;
|
|
204
|
+
const maxPages = opts.maxPages ?? 2;
|
|
205
|
+
let cursor;
|
|
206
|
+
for (let page = 0; page < maxPages; page++) {
|
|
207
|
+
const r = await this.mcp.callTool('show_generations', {
|
|
208
|
+
only_completed: false,
|
|
209
|
+
size,
|
|
210
|
+
type: 'image',
|
|
211
|
+
...(cursor !== undefined ? { cursor } : {}),
|
|
212
|
+
});
|
|
213
|
+
if (!isObj(r) || !Array.isArray(r.items))
|
|
214
|
+
return undefined;
|
|
215
|
+
let best;
|
|
216
|
+
for (const it of r.items) {
|
|
217
|
+
if (!isObj(it) || it.model !== 'image_background_remover')
|
|
218
|
+
continue;
|
|
219
|
+
const id = str(it.id);
|
|
220
|
+
if (!id)
|
|
221
|
+
continue;
|
|
222
|
+
const medias = isObj(it.params) && Array.isArray(it.params.medias) ? it.params.medias : [];
|
|
223
|
+
const matches = medias.some((m) => isObj(m) && isObj(m.data) && str(m.data.id) === sourceId);
|
|
224
|
+
if (!matches)
|
|
225
|
+
continue;
|
|
226
|
+
const at = typeof it.createdAt === 'number' ? it.createdAt : 0;
|
|
227
|
+
if (opts.createdAfter !== undefined && at < opts.createdAfter)
|
|
228
|
+
continue;
|
|
229
|
+
if (best && best.at >= at)
|
|
230
|
+
continue;
|
|
231
|
+
const url = isObj(it.results) ? str(it.results.rawUrl) : undefined;
|
|
232
|
+
best = { jobId: id, status: str(it.status) ?? 'unknown', ...(url ? { url } : {}), at };
|
|
233
|
+
}
|
|
234
|
+
if (best) {
|
|
235
|
+
const { at: _at, ...out } = best;
|
|
236
|
+
return out;
|
|
237
|
+
}
|
|
238
|
+
const next = r.next_cursor;
|
|
239
|
+
if (typeof next !== 'number' || !r.items.length)
|
|
240
|
+
return undefined;
|
|
241
|
+
// Stop paging once the page is entirely older than the window.
|
|
242
|
+
if (opts.createdAfter !== undefined) {
|
|
243
|
+
const times = r.items.map((i) => (isObj(i) && typeof i.createdAt === 'number' ? i.createdAt : Infinity));
|
|
244
|
+
if (Math.max(...times) < opts.createdAfter)
|
|
245
|
+
return undefined;
|
|
246
|
+
}
|
|
247
|
+
cursor = next;
|
|
248
|
+
}
|
|
249
|
+
return undefined;
|
|
121
250
|
}
|
|
122
251
|
/** Verified envelope: { cost: { credits, credits_exact }, quote_ref }. Free call. */
|
|
123
252
|
async estimateImageCost(params) {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { higgsfieldConnector, HIGGSFIELD_MCP_URL, type HiggsfieldConnectorOptions } from './connector';
|
|
2
2
|
export { higgsfieldClientMetadata, type HiggsfieldClientMetadata, type HiggsfieldClientMetadataInput, } from './client-metadata';
|
|
3
3
|
export { HiggsfieldMcpClient, HiggsfieldApiError, type McpClientOptions, type CallToolOptions } from './mcp';
|
|
4
|
-
export { HiggsfieldApi, TERMINAL_JOB_STATUSES, type Balance, type CostEstimate, type GenerateImageParams, type JobRef, type JobState, type JobStatus, type JobsWaitResult, type MediaRef, } from './api';
|
|
4
|
+
export { HiggsfieldApi, TERMINAL_JOB_STATUSES, type Balance, type BackgroundRemoval, type HiggsfieldApiOptions, type CostEstimate, type GenerateImageParams, type JobRef, type JobState, type JobStatus, type JobsWaitResult, type MediaRef, } from './api';
|
|
5
5
|
export * from './rules';
|
|
6
6
|
export { higgsfieldGetBalanceTool } from './tools/get-balance';
|
|
7
7
|
export { higgsfieldGetJobTool } from './tools/get-job';
|
package/dist/mcp.d.ts
CHANGED
|
@@ -16,6 +16,11 @@ export interface McpClientOptions {
|
|
|
16
16
|
endpoint?: string;
|
|
17
17
|
fetchImpl?: typeof fetch;
|
|
18
18
|
timeoutMs?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Timeout of a SPENDING call. Longer than `timeoutMs`: a paid tool may do work before answering, and timing out
|
|
21
|
+
* turns an accepted (charged) call into an unknown outcome. Default 90 s.
|
|
22
|
+
*/
|
|
23
|
+
spendingTimeoutMs?: number;
|
|
19
24
|
/** Extra attempts for read-only calls on 429/5xx/network/timeout. */
|
|
20
25
|
maxRetries?: number;
|
|
21
26
|
sleep?: (ms: number) => Promise<void>;
|
|
@@ -35,6 +40,7 @@ export declare class HiggsfieldMcpClient {
|
|
|
35
40
|
private readonly fetchImpl;
|
|
36
41
|
private readonly endpoint;
|
|
37
42
|
private readonly timeoutMs;
|
|
43
|
+
private readonly spendingTimeoutMs;
|
|
38
44
|
private readonly maxRetries;
|
|
39
45
|
private readonly sleep;
|
|
40
46
|
constructor(opts: McpClientOptions);
|
package/dist/mcp.js
CHANGED
|
@@ -30,6 +30,7 @@ class HiggsfieldMcpClient {
|
|
|
30
30
|
this.fetchImpl = opts.fetchImpl ?? fetch;
|
|
31
31
|
this.endpoint = opts.endpoint ?? exports.HIGGSFIELD_MCP_ENDPOINT;
|
|
32
32
|
this.timeoutMs = opts.timeoutMs ?? 30_000;
|
|
33
|
+
this.spendingTimeoutMs = opts.spendingTimeoutMs ?? 90_000;
|
|
33
34
|
this.maxRetries = opts.maxRetries ?? 2;
|
|
34
35
|
this.sleep = opts.sleep ?? ((ms) => new Promise((r) => setTimeout(r, ms)));
|
|
35
36
|
this.sessionId = opts.sessionId;
|
|
@@ -95,7 +96,7 @@ class HiggsfieldMcpClient {
|
|
|
95
96
|
if (this.sessionId)
|
|
96
97
|
headers['mcp-session-id'] = this.sessionId;
|
|
97
98
|
const ctrl = new AbortController();
|
|
98
|
-
const timer = setTimeout(() => ctrl.abort(), this.timeoutMs);
|
|
99
|
+
const timer = setTimeout(() => ctrl.abort(), spending ? this.spendingTimeoutMs : this.timeoutMs);
|
|
99
100
|
let res;
|
|
100
101
|
try {
|
|
101
102
|
res = await this.fetchImpl(this.endpoint, {
|
package/dist/rules.d.ts
CHANGED
|
@@ -24,6 +24,28 @@ export declare const STUDIO_MODEL: {
|
|
|
24
24
|
readonly resolution: "2k";
|
|
25
25
|
readonly referenceRole: "image_references";
|
|
26
26
|
};
|
|
27
|
+
/**
|
|
28
|
+
* Fallback generation models for a job the primary model's moderation ended as `nsfw` / `ip_detected` (PDK-HIGGSFIELD-FALLBACK).
|
|
29
|
+
* Model facts from the live Higgsfield catalog (models_explore, 2026-12-02): both take `image_references`.
|
|
30
|
+
* - gpt_image_2_6 (OpenAI, Higgsfield's default for product shots / edits): quality low..max, resolution 1k|2k|4k,
|
|
31
|
+
* background auto|opaque|transparent, aspect ratios incl. 1:1 3:4 4:5 9:16 16:9, up to 16 references.
|
|
32
|
+
* - seedream_5_5 (Bytedance, edits that keep untargeted parts unchanged): resolution up to 4k, up to 10 references.
|
|
33
|
+
* Exact param VALUES (quality enum, resolution strings) are only confirmed by a free `estimate_image_cost`; the platform always
|
|
34
|
+
* quotes before it spends, so a wrong shape fails at the (free) quote, never at the paid call.
|
|
35
|
+
*/
|
|
36
|
+
export declare const FALLBACK_MODEL_IDS: readonly ["gpt_image_2_6", "seedream_5_5"];
|
|
37
|
+
export type FallbackModelId = (typeof FALLBACK_MODEL_IDS)[number];
|
|
38
|
+
export interface FallbackModel {
|
|
39
|
+
model: FallbackModelId;
|
|
40
|
+
resolution: string;
|
|
41
|
+
referenceRole: string;
|
|
42
|
+
/** gpt_image_2_6 only. */
|
|
43
|
+
quality?: string;
|
|
44
|
+
}
|
|
45
|
+
export declare const GPT_IMAGE_FALLBACK: FallbackModel;
|
|
46
|
+
export declare const SEEDREAM_FALLBACK: FallbackModel;
|
|
47
|
+
/** Which job verdicts a fallback / cutout retry is offered for. */
|
|
48
|
+
export declare const MODERATION_VERDICTS: readonly ["nsfw", "ip_detected"];
|
|
27
49
|
export declare const REJECTED_STUDIO_MODELS: readonly ["marketing_studio_2_image"];
|
|
28
50
|
export type CatalogErrorCode = 'PHOTO_REQUIRED' | 'INVALID_MODE' | 'INVALID_ANGLE';
|
|
29
51
|
export declare class CatalogRequestError extends Error {
|
package/dist/rules.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CatalogRequestError = exports.REJECTED_STUDIO_MODELS = exports.STUDIO_MODEL = exports.STUDIO_ANGLES = exports.CATALOG_MODES = exports.CATALOG_MASTER = exports.CATALOG_RULES_VERSION = void 0;
|
|
3
|
+
exports.CatalogRequestError = exports.REJECTED_STUDIO_MODELS = exports.MODERATION_VERDICTS = exports.SEEDREAM_FALLBACK = exports.GPT_IMAGE_FALLBACK = exports.FALLBACK_MODEL_IDS = exports.STUDIO_MODEL = exports.STUDIO_ANGLES = exports.CATALOG_MODES = exports.CATALOG_MASTER = exports.CATALOG_RULES_VERSION = void 0;
|
|
4
4
|
exports.buildStudioPrompt = buildStudioPrompt;
|
|
5
5
|
exports.assertCatalogRequest = assertCatalogRequest;
|
|
6
6
|
exports.buildStudioGenerateParams = buildStudioGenerateParams;
|
|
@@ -23,6 +23,20 @@ exports.CATALOG_MODES = ['cutout', 'studio'];
|
|
|
23
23
|
exports.STUDIO_ANGLES = ['front', 'three_quarter', 'top'];
|
|
24
24
|
/** marketing_studio_2_image is ad-styled (copy, badges), so it is deliberately not used. */
|
|
25
25
|
exports.STUDIO_MODEL = { model: 'flux_2', variant: 'pro', resolution: '2k', referenceRole: 'image_references' };
|
|
26
|
+
/**
|
|
27
|
+
* Fallback generation models for a job the primary model's moderation ended as `nsfw` / `ip_detected` (PDK-HIGGSFIELD-FALLBACK).
|
|
28
|
+
* Model facts from the live Higgsfield catalog (models_explore, 2026-12-02): both take `image_references`.
|
|
29
|
+
* - gpt_image_2_6 (OpenAI, Higgsfield's default for product shots / edits): quality low..max, resolution 1k|2k|4k,
|
|
30
|
+
* background auto|opaque|transparent, aspect ratios incl. 1:1 3:4 4:5 9:16 16:9, up to 16 references.
|
|
31
|
+
* - seedream_5_5 (Bytedance, edits that keep untargeted parts unchanged): resolution up to 4k, up to 10 references.
|
|
32
|
+
* Exact param VALUES (quality enum, resolution strings) are only confirmed by a free `estimate_image_cost`; the platform always
|
|
33
|
+
* quotes before it spends, so a wrong shape fails at the (free) quote, never at the paid call.
|
|
34
|
+
*/
|
|
35
|
+
exports.FALLBACK_MODEL_IDS = ['gpt_image_2_6', 'seedream_5_5'];
|
|
36
|
+
exports.GPT_IMAGE_FALLBACK = { model: 'gpt_image_2_6', resolution: '2k', referenceRole: 'image_references', quality: 'high' };
|
|
37
|
+
exports.SEEDREAM_FALLBACK = { model: 'seedream_5_5', resolution: '2k', referenceRole: 'image_references' };
|
|
38
|
+
/** Which job verdicts a fallback / cutout retry is offered for. */
|
|
39
|
+
exports.MODERATION_VERDICTS = ['nsfw', 'ip_detected'];
|
|
26
40
|
exports.REJECTED_STUDIO_MODELS = ['marketing_studio_2_image'];
|
|
27
41
|
class CatalogRequestError extends Error {
|
|
28
42
|
constructor(code, message) {
|
package/dist/skills.d.ts
CHANGED
|
@@ -1,12 +1,38 @@
|
|
|
1
|
+
import { type FallbackModel } from './rules';
|
|
1
2
|
/**
|
|
2
3
|
* Image skills (PDK-HIGGSFIELD §10, D10-D14): server-side, versioned art-direction recipes.
|
|
3
4
|
* The owner picks a slug (+ the business palette, + an optional short note); the system owns every
|
|
4
5
|
* word of the prompt. Pure module: no I/O, no network, no spend.
|
|
5
6
|
*/
|
|
6
7
|
/** Bump on ANY change to a skill's text, model, aspect or the palette / hard-rule wording: jobs record it. */
|
|
7
|
-
export declare const SKILLS_RULES_VERSION = "2026-12-
|
|
8
|
+
export declare const SKILLS_RULES_VERSION = "2026-12-02.1";
|
|
8
9
|
export declare const SKILL_SLUGS: readonly ["product-cart", "ugc-model", "minimal-poster", "gravity-defying", "hero-offert", "cleanfly"];
|
|
9
10
|
export type SkillSlug = (typeof SKILL_SLUGS)[number];
|
|
11
|
+
/**
|
|
12
|
+
* The one NON-generative skill (PDK-HIGGSFIELD-FALLBACK): only the background removal of the owner's own photo, as a
|
|
13
|
+
* transparent catalog master. No generative model runs, so a generative model's moderation cannot block it. It is NOT in
|
|
14
|
+
* IMAGE_SKILLS (no prompt, no palette, no model, never part of a batch): the platform runs it as its `cutout` recipe.
|
|
15
|
+
*/
|
|
16
|
+
export declare const CUTOUT_SKILL_SLUG: "cutout";
|
|
17
|
+
export declare const CUTOUT_SKILL: {
|
|
18
|
+
readonly slug: "cutout";
|
|
19
|
+
readonly label: {
|
|
20
|
+
readonly es: "Recortar producto";
|
|
21
|
+
readonly en: "Cut out product";
|
|
22
|
+
};
|
|
23
|
+
readonly purpose: {
|
|
24
|
+
readonly es: "Quita el fondo de tu foto real y la deja en PNG transparente, sin generar nada nuevo.";
|
|
25
|
+
readonly en: "Removes the background of your real photo into a transparent PNG, without generating anything new.";
|
|
26
|
+
};
|
|
27
|
+
readonly aspectRatio: "1:1";
|
|
28
|
+
readonly size: {
|
|
29
|
+
readonly width: 2048;
|
|
30
|
+
readonly height: 2048;
|
|
31
|
+
};
|
|
32
|
+
readonly output: "alpha_master";
|
|
33
|
+
readonly generative: false;
|
|
34
|
+
};
|
|
35
|
+
export declare const isCutoutSlug: (slug: unknown) => slug is typeof CUTOUT_SKILL_SLUG;
|
|
10
36
|
/** alpha_master = the catalog master (generate, remove background, 2048 PNG with alpha). scene = a finished picture. */
|
|
11
37
|
export type SkillOutput = 'alpha_master' | 'scene';
|
|
12
38
|
export type PeoplePolicy = 'none' | 'one_person';
|
|
@@ -34,6 +60,11 @@ export interface ImageSkill {
|
|
|
34
60
|
/** One line, neutral Spanish (tú) / English. */
|
|
35
61
|
purpose: LocalizedText;
|
|
36
62
|
model: SkillModel;
|
|
63
|
+
/**
|
|
64
|
+
* Model tried ONLY when the owner explicitly asks to redo a job the primary model's moderation ended as nsfw / ip_detected.
|
|
65
|
+
* Same prompt, same reference, same aspect; never used automatically.
|
|
66
|
+
*/
|
|
67
|
+
fallbackModel: FallbackModel;
|
|
37
68
|
/** Aspect of the STORED result (the platform crops/resizes to `size`). */
|
|
38
69
|
aspectRatio: AspectRatio;
|
|
39
70
|
/** Aspect sent to generate_image: always one flux_2 supports (FLUX2_ASPECTS). */
|
|
@@ -113,13 +144,66 @@ export declare function buildSkillPrompt(opts: {
|
|
|
113
144
|
palette: unknown;
|
|
114
145
|
note?: unknown;
|
|
115
146
|
}): string;
|
|
116
|
-
|
|
147
|
+
export type SkillEngine = 'primary' | 'fallback';
|
|
148
|
+
/**
|
|
149
|
+
* generate_image params for a fallback model, per model id (the param names differ). Aspect = the skill's `generateAspect`
|
|
150
|
+
* (1:1, 3:4 and 16:9 are accepted by both fallback models), so the stored crop/resize is identical to the primary's.
|
|
151
|
+
* Throws for a model id this table does not know: no model is ever assumed.
|
|
152
|
+
*/
|
|
153
|
+
export declare function buildFallbackGenerateParams(opts: {
|
|
154
|
+
fallback: FallbackModel;
|
|
155
|
+
prompt: string;
|
|
156
|
+
aspect: string;
|
|
157
|
+
referenceMediaId: string;
|
|
158
|
+
}): {
|
|
159
|
+
model: "gpt_image_2_6";
|
|
160
|
+
prompt: string;
|
|
161
|
+
aspect_ratio: string;
|
|
162
|
+
resolution: string;
|
|
163
|
+
quality: string;
|
|
164
|
+
medias: {
|
|
165
|
+
value: string;
|
|
166
|
+
role: string;
|
|
167
|
+
}[];
|
|
168
|
+
} | {
|
|
169
|
+
model: "seedream_5_5";
|
|
170
|
+
prompt: string;
|
|
171
|
+
aspect_ratio: string;
|
|
172
|
+
resolution: string;
|
|
173
|
+
medias: {
|
|
174
|
+
value: string;
|
|
175
|
+
role: string;
|
|
176
|
+
}[];
|
|
177
|
+
quality?: undefined;
|
|
178
|
+
};
|
|
179
|
+
/** generate_image params: reference-guided, the skill's aspect, no free text. `engine: 'fallback'` swaps ONLY the model + its params. */
|
|
117
180
|
export declare function buildSkillGenerateParams(opts: {
|
|
118
181
|
skill: ImageSkill | SkillSlug;
|
|
119
182
|
palette: unknown;
|
|
120
183
|
note?: unknown;
|
|
121
184
|
referenceMediaId: string;
|
|
185
|
+
engine?: SkillEngine;
|
|
122
186
|
}): {
|
|
187
|
+
model: "gpt_image_2_6";
|
|
188
|
+
prompt: string;
|
|
189
|
+
aspect_ratio: string;
|
|
190
|
+
resolution: string;
|
|
191
|
+
quality: string;
|
|
192
|
+
medias: {
|
|
193
|
+
value: string;
|
|
194
|
+
role: string;
|
|
195
|
+
}[];
|
|
196
|
+
} | {
|
|
197
|
+
model: "seedream_5_5";
|
|
198
|
+
prompt: string;
|
|
199
|
+
aspect_ratio: string;
|
|
200
|
+
resolution: string;
|
|
201
|
+
medias: {
|
|
202
|
+
value: string;
|
|
203
|
+
role: string;
|
|
204
|
+
}[];
|
|
205
|
+
quality?: undefined;
|
|
206
|
+
} | {
|
|
123
207
|
model: string;
|
|
124
208
|
variant: string;
|
|
125
209
|
resolution: string;
|
|
@@ -131,13 +215,32 @@ export declare function buildSkillGenerateParams(opts: {
|
|
|
131
215
|
}[];
|
|
132
216
|
};
|
|
133
217
|
/** What a host lists to an owner: no prompt text, no model internals. */
|
|
134
|
-
export declare function listImageSkills(): {
|
|
135
|
-
slug:
|
|
218
|
+
export declare function listImageSkills(): ({
|
|
219
|
+
slug: string;
|
|
136
220
|
label: LocalizedText;
|
|
137
221
|
purpose: LocalizedText;
|
|
138
|
-
aspectRatio:
|
|
139
|
-
generateAspect:
|
|
222
|
+
aspectRatio: string;
|
|
223
|
+
generateAspect: string;
|
|
140
224
|
width: number;
|
|
141
225
|
height: number;
|
|
142
226
|
output: SkillOutput;
|
|
143
|
-
|
|
227
|
+
generative: boolean;
|
|
228
|
+
hasFallback: boolean;
|
|
229
|
+
} | {
|
|
230
|
+
slug: string;
|
|
231
|
+
label: {
|
|
232
|
+
readonly es: "Recortar producto";
|
|
233
|
+
readonly en: "Cut out product";
|
|
234
|
+
};
|
|
235
|
+
purpose: {
|
|
236
|
+
readonly es: "Quita el fondo de tu foto real y la deja en PNG transparente, sin generar nada nuevo.";
|
|
237
|
+
readonly en: "Removes the background of your real photo into a transparent PNG, without generating anything new.";
|
|
238
|
+
};
|
|
239
|
+
aspectRatio: string;
|
|
240
|
+
generateAspect: string;
|
|
241
|
+
width: 2048;
|
|
242
|
+
height: 2048;
|
|
243
|
+
output: SkillOutput;
|
|
244
|
+
generative: boolean;
|
|
245
|
+
hasFallback: boolean;
|
|
246
|
+
})[];
|
package/dist/skills.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NOTE_MAX_LENGTH = exports.SkillRequestError = exports.GLOBAL_AVOID = exports.HARD_RULES = exports.IMAGE_SKILLS = exports.FLUX2_ASPECTS = exports.SKILL_SLUGS = exports.SKILLS_RULES_VERSION = void 0;
|
|
3
|
+
exports.NOTE_MAX_LENGTH = exports.SkillRequestError = exports.GLOBAL_AVOID = exports.HARD_RULES = exports.IMAGE_SKILLS = exports.FLUX2_ASPECTS = exports.isCutoutSlug = exports.CUTOUT_SKILL = exports.CUTOUT_SKILL_SLUG = exports.SKILL_SLUGS = exports.SKILLS_RULES_VERSION = void 0;
|
|
4
4
|
exports.getImageSkill = getImageSkill;
|
|
5
5
|
exports.normalizeHex = normalizeHex;
|
|
6
6
|
exports.colorName = colorName;
|
|
@@ -12,6 +12,7 @@ exports.sanitizeNote = sanitizeNote;
|
|
|
12
12
|
exports.assertNote = assertNote;
|
|
13
13
|
exports.assertSkillRequest = assertSkillRequest;
|
|
14
14
|
exports.buildSkillPrompt = buildSkillPrompt;
|
|
15
|
+
exports.buildFallbackGenerateParams = buildFallbackGenerateParams;
|
|
15
16
|
exports.buildSkillGenerateParams = buildSkillGenerateParams;
|
|
16
17
|
exports.listImageSkills = listImageSkills;
|
|
17
18
|
const rules_1 = require("./rules");
|
|
@@ -21,7 +22,7 @@ const rules_1 = require("./rules");
|
|
|
21
22
|
* word of the prompt. Pure module: no I/O, no network, no spend.
|
|
22
23
|
*/
|
|
23
24
|
/** Bump on ANY change to a skill's text, model, aspect or the palette / hard-rule wording: jobs record it. */
|
|
24
|
-
exports.SKILLS_RULES_VERSION = '2026-12-
|
|
25
|
+
exports.SKILLS_RULES_VERSION = '2026-12-02.1';
|
|
25
26
|
exports.SKILL_SLUGS = [
|
|
26
27
|
'product-cart',
|
|
27
28
|
'ugc-model',
|
|
@@ -30,6 +31,26 @@ exports.SKILL_SLUGS = [
|
|
|
30
31
|
'hero-offert',
|
|
31
32
|
'cleanfly',
|
|
32
33
|
];
|
|
34
|
+
/**
|
|
35
|
+
* The one NON-generative skill (PDK-HIGGSFIELD-FALLBACK): only the background removal of the owner's own photo, as a
|
|
36
|
+
* transparent catalog master. No generative model runs, so a generative model's moderation cannot block it. It is NOT in
|
|
37
|
+
* IMAGE_SKILLS (no prompt, no palette, no model, never part of a batch): the platform runs it as its `cutout` recipe.
|
|
38
|
+
*/
|
|
39
|
+
exports.CUTOUT_SKILL_SLUG = 'cutout';
|
|
40
|
+
exports.CUTOUT_SKILL = {
|
|
41
|
+
slug: exports.CUTOUT_SKILL_SLUG,
|
|
42
|
+
label: { es: 'Recortar producto', en: 'Cut out product' },
|
|
43
|
+
purpose: {
|
|
44
|
+
es: 'Quita el fondo de tu foto real y la deja en PNG transparente, sin generar nada nuevo.',
|
|
45
|
+
en: 'Removes the background of your real photo into a transparent PNG, without generating anything new.',
|
|
46
|
+
},
|
|
47
|
+
aspectRatio: rules_1.CATALOG_MASTER.aspectRatio,
|
|
48
|
+
size: { width: rules_1.CATALOG_MASTER.width, height: rules_1.CATALOG_MASTER.height },
|
|
49
|
+
output: 'alpha_master',
|
|
50
|
+
generative: false,
|
|
51
|
+
};
|
|
52
|
+
const isCutoutSlug = (slug) => slug === exports.CUTOUT_SKILL_SLUG;
|
|
53
|
+
exports.isCutoutSlug = isCutoutSlug;
|
|
33
54
|
/**
|
|
34
55
|
* Aspect ratios flux_2 accepts, checked against the live Higgsfield model catalog (models_explore get flux_2)
|
|
35
56
|
* on 2026-12-01: aspect_ratios 1:1, 4:3, 3:4, 16:9, 9:16; resolution 1k|2k; variants pro|flex|max; media role
|
|
@@ -42,6 +63,7 @@ exports.FLUX2_ASPECTS = ['1:1', '4:3', '3:4', '16:9', '9:16'];
|
|
|
42
63
|
* reference, which is the whole point (no invented products). No other model id is assumed.
|
|
43
64
|
*/
|
|
44
65
|
const MODEL = { ...rules_1.STUDIO_MODEL };
|
|
66
|
+
const FALLBACK = { ...rules_1.GPT_IMAGE_FALLBACK };
|
|
45
67
|
exports.IMAGE_SKILLS = [
|
|
46
68
|
{
|
|
47
69
|
slug: 'product-cart',
|
|
@@ -51,6 +73,7 @@ exports.IMAGE_SKILLS = [
|
|
|
51
73
|
en: 'Clean product photo on a transparent background, ready for your catalog and cart.',
|
|
52
74
|
},
|
|
53
75
|
model: MODEL,
|
|
76
|
+
fallbackModel: FALLBACK,
|
|
54
77
|
aspectRatio: rules_1.CATALOG_MASTER.aspectRatio,
|
|
55
78
|
generateAspect: '1:1',
|
|
56
79
|
size: { width: rules_1.CATALOG_MASTER.width, height: rules_1.CATALOG_MASTER.height },
|
|
@@ -78,6 +101,7 @@ exports.IMAGE_SKILLS = [
|
|
|
78
101
|
en: 'A person naturally using or holding your real product, with a phone-shot look.',
|
|
79
102
|
},
|
|
80
103
|
model: MODEL,
|
|
104
|
+
fallbackModel: FALLBACK,
|
|
81
105
|
aspectRatio: '4:5',
|
|
82
106
|
generateAspect: '3:4',
|
|
83
107
|
size: { width: 1600, height: 2000 },
|
|
@@ -114,6 +138,7 @@ exports.IMAGE_SKILLS = [
|
|
|
114
138
|
en: 'Minimal editorial composition with plenty of calm space for your copy later.',
|
|
115
139
|
},
|
|
116
140
|
model: MODEL,
|
|
141
|
+
fallbackModel: FALLBACK,
|
|
117
142
|
aspectRatio: '3:4',
|
|
118
143
|
generateAspect: '3:4',
|
|
119
144
|
size: { width: 1536, height: 2048 },
|
|
@@ -137,6 +162,7 @@ exports.IMAGE_SKILLS = [
|
|
|
137
162
|
en: 'Your product levitating with a few of its own parts or ingredients.',
|
|
138
163
|
},
|
|
139
164
|
model: MODEL,
|
|
165
|
+
fallbackModel: FALLBACK,
|
|
140
166
|
aspectRatio: '1:1',
|
|
141
167
|
generateAspect: '1:1',
|
|
142
168
|
size: { width: 2048, height: 2048 },
|
|
@@ -161,6 +187,7 @@ exports.IMAGE_SKILLS = [
|
|
|
161
187
|
en: 'Wide web hero with the product on the right and calm space for your message.',
|
|
162
188
|
},
|
|
163
189
|
model: MODEL,
|
|
190
|
+
fallbackModel: FALLBACK,
|
|
164
191
|
aspectRatio: '16:9',
|
|
165
192
|
generateAspect: '16:9',
|
|
166
193
|
size: { width: 2048, height: 1152 },
|
|
@@ -187,6 +214,7 @@ exports.IMAGE_SKILLS = [
|
|
|
187
214
|
en: 'Tidy top-down flat lay with your product and two or three related items.',
|
|
188
215
|
},
|
|
189
216
|
model: MODEL,
|
|
217
|
+
fallbackModel: FALLBACK,
|
|
190
218
|
aspectRatio: '4:5',
|
|
191
219
|
generateAspect: '3:4',
|
|
192
220
|
size: { width: 1600, height: 2000 },
|
|
@@ -498,30 +526,67 @@ function buildSkillPrompt(opts) {
|
|
|
498
526
|
`Avoid: ${avoid.join(', ')}.`,
|
|
499
527
|
].join('\n');
|
|
500
528
|
}
|
|
501
|
-
/**
|
|
529
|
+
/**
|
|
530
|
+
* generate_image params for a fallback model, per model id (the param names differ). Aspect = the skill's `generateAspect`
|
|
531
|
+
* (1:1, 3:4 and 16:9 are accepted by both fallback models), so the stored crop/resize is identical to the primary's.
|
|
532
|
+
* Throws for a model id this table does not know: no model is ever assumed.
|
|
533
|
+
*/
|
|
534
|
+
function buildFallbackGenerateParams(opts) {
|
|
535
|
+
const { fallback: f } = opts;
|
|
536
|
+
const medias = [{ value: opts.referenceMediaId, role: f.referenceRole }];
|
|
537
|
+
switch (f.model) {
|
|
538
|
+
case 'gpt_image_2_6':
|
|
539
|
+
return { model: f.model, prompt: opts.prompt, aspect_ratio: opts.aspect, resolution: f.resolution, quality: f.quality ?? 'high', medias };
|
|
540
|
+
case 'seedream_5_5':
|
|
541
|
+
return { model: f.model, prompt: opts.prompt, aspect_ratio: opts.aspect, resolution: f.resolution, medias };
|
|
542
|
+
default:
|
|
543
|
+
throw new SkillRequestError('INVALID_SKILL', `no param builder for fallback model ${String(f.model)}`);
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
/** generate_image params: reference-guided, the skill's aspect, no free text. `engine: 'fallback'` swaps ONLY the model + its params. */
|
|
502
547
|
function buildSkillGenerateParams(opts) {
|
|
503
548
|
const skill = typeof opts.skill === 'string' ? getImageSkill(opts.skill) : getImageSkill(opts.skill?.slug);
|
|
504
549
|
if (!skill)
|
|
505
550
|
throw new SkillRequestError('INVALID_SKILL', 'unknown skill');
|
|
551
|
+
const prompt = buildSkillPrompt({ skill, palette: opts.palette, note: opts.note });
|
|
552
|
+
if (opts.engine === 'fallback') {
|
|
553
|
+
return buildFallbackGenerateParams({ fallback: skill.fallbackModel, prompt, aspect: skill.generateAspect, referenceMediaId: opts.referenceMediaId });
|
|
554
|
+
}
|
|
506
555
|
return {
|
|
507
556
|
model: skill.model.model,
|
|
508
557
|
variant: skill.model.variant,
|
|
509
558
|
resolution: skill.model.resolution,
|
|
510
|
-
prompt
|
|
559
|
+
prompt,
|
|
511
560
|
aspect_ratio: skill.generateAspect,
|
|
512
561
|
medias: [{ value: opts.referenceMediaId, role: skill.model.referenceRole }],
|
|
513
562
|
};
|
|
514
563
|
}
|
|
515
564
|
/** What a host lists to an owner: no prompt text, no model internals. */
|
|
516
565
|
function listImageSkills() {
|
|
517
|
-
return
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
566
|
+
return [
|
|
567
|
+
...exports.IMAGE_SKILLS.map((s) => ({
|
|
568
|
+
slug: s.slug,
|
|
569
|
+
label: s.label,
|
|
570
|
+
purpose: s.purpose,
|
|
571
|
+
aspectRatio: s.aspectRatio,
|
|
572
|
+
generateAspect: s.generateAspect,
|
|
573
|
+
width: s.size.width,
|
|
574
|
+
height: s.size.height,
|
|
575
|
+
output: s.output,
|
|
576
|
+
generative: true,
|
|
577
|
+
hasFallback: true,
|
|
578
|
+
})),
|
|
579
|
+
{
|
|
580
|
+
slug: exports.CUTOUT_SKILL.slug,
|
|
581
|
+
label: exports.CUTOUT_SKILL.label,
|
|
582
|
+
purpose: exports.CUTOUT_SKILL.purpose,
|
|
583
|
+
aspectRatio: exports.CUTOUT_SKILL.aspectRatio,
|
|
584
|
+
generateAspect: exports.CUTOUT_SKILL.aspectRatio,
|
|
585
|
+
width: exports.CUTOUT_SKILL.size.width,
|
|
586
|
+
height: exports.CUTOUT_SKILL.size.height,
|
|
587
|
+
output: exports.CUTOUT_SKILL.output,
|
|
588
|
+
generative: false,
|
|
589
|
+
hasFallback: false,
|
|
590
|
+
},
|
|
591
|
+
];
|
|
527
592
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentforge-io/connectors-higgsfield",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Higgsfield connector for AgentForge — OAuth public client (CIMD + PKCE) over the Higgsfield MCP server, with a typed MCP client, versioned catalog-photo rules, and read-only agent tools (balance, job status). Nothing here spends credits on its own.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|