makefx 2.0.2 → 2.0.3
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 +4 -0
- package/dist/makefx.js +15 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
The 1.x packages were built from the first version of makefx.app and do not
|
|
4
4
|
work with the current service.
|
|
5
5
|
|
|
6
|
+
## 2.0.3 — 2026-09-26
|
|
7
|
+
|
|
8
|
+
- `create` refuses a prompt longer than the model's published `prompt_max_chars` before spending credits, and counts prompt length in characters rather than UTF-16 units, as the service does.
|
|
9
|
+
|
|
6
10
|
## 2.0.2 — 2026-09-26
|
|
7
11
|
|
|
8
12
|
- `create --wait --json` now prints each asset's final ready or failed state instead of the queued state captured before waiting, and exits 1 with the failed asset's error when waiting ends in failure.
|
package/dist/makefx.js
CHANGED
|
@@ -13,7 +13,7 @@ var ENVIRONMENT_ORIGINS = {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
// src/lib/version.ts
|
|
16
|
-
var CLI_VERSION = true ? "2.0.
|
|
16
|
+
var CLI_VERSION = true ? "2.0.3" : "0.0.0-dev";
|
|
17
17
|
|
|
18
18
|
// src/commands/convenience.ts
|
|
19
19
|
import { randomUUID } from "node:crypto";
|
|
@@ -1247,7 +1247,7 @@ function prepareCreate(parsed) {
|
|
|
1247
1247
|
throw new CliUsageError("--request-id must be at most 64 characters.");
|
|
1248
1248
|
}
|
|
1249
1249
|
const prompt = optional2(parsed, "prompt") ?? "";
|
|
1250
|
-
if (prompt.length > 8e3) throw new CliUsageError("--prompt must be at most 8000 characters.");
|
|
1250
|
+
if (Array.from(prompt).length > 8e3) throw new CliUsageError("--prompt must be at most 8000 characters.");
|
|
1251
1251
|
return {
|
|
1252
1252
|
spaceId: required2(parsed, "space"),
|
|
1253
1253
|
kind,
|
|
@@ -1308,12 +1308,19 @@ function catalogModels(document) {
|
|
|
1308
1308
|
`list_models returned a malformed catalog: ${error instanceof Error ? error.message : "invalid params_schema."}`
|
|
1309
1309
|
);
|
|
1310
1310
|
}
|
|
1311
|
+
const promptMaxChars = model.prompt_max_chars;
|
|
1312
|
+
if (promptMaxChars !== void 0 && (typeof promptMaxChars !== "number" || !Number.isSafeInteger(promptMaxChars) || promptMaxChars < 1)) {
|
|
1313
|
+
throw new Error(
|
|
1314
|
+
`list_models returned a malformed catalog: model "${model.id}" prompt_max_chars must be a positive integer.`
|
|
1315
|
+
);
|
|
1316
|
+
}
|
|
1311
1317
|
return {
|
|
1312
1318
|
id: model.id,
|
|
1313
1319
|
kind: model.kind,
|
|
1314
1320
|
availability: model.availability,
|
|
1315
1321
|
hidden: model.hidden,
|
|
1316
|
-
paramsSchema: model.params_schema
|
|
1322
|
+
paramsSchema: model.params_schema,
|
|
1323
|
+
...promptMaxChars === void 0 ? {} : { promptMaxChars }
|
|
1317
1324
|
};
|
|
1318
1325
|
});
|
|
1319
1326
|
}
|
|
@@ -1326,6 +1333,11 @@ function createToolArguments(prepared, entry, requestId) {
|
|
|
1326
1333
|
`Model "${prepared.model}" is unavailable. Run models --space ${prepared.spaceId} to list the catalog.`
|
|
1327
1334
|
);
|
|
1328
1335
|
}
|
|
1336
|
+
if (entry.promptMaxChars !== void 0 && prepared.recipeMode !== "exact" && Array.from(prepared.prompt).length > entry.promptMaxChars) {
|
|
1337
|
+
throw new CliUsageError(
|
|
1338
|
+
`--prompt must be at most ${entry.promptMaxChars} characters for model "${prepared.model}".`
|
|
1339
|
+
);
|
|
1340
|
+
}
|
|
1329
1341
|
const validation = validateJsonSchema(entry.paramsSchema, prepared.params);
|
|
1330
1342
|
if (!validation.ok) {
|
|
1331
1343
|
const field = validation.issue.field.replace(/^params\.?/, "") || "params";
|