@blockrun/franklin 3.21.9 → 3.23.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 +12 -0
- package/dist/agent/context.js +6 -4
- package/dist/agent/llm.js +20 -7
- package/dist/agent/loop.js +29 -0
- package/dist/agent/optimize.js +3 -2
- package/dist/agent/repair/flatten.d.ts +32 -0
- package/dist/agent/repair/flatten.js +77 -0
- package/dist/agent/repair/index.d.ts +66 -0
- package/dist/agent/repair/index.js +77 -0
- package/dist/agent/repair/scavenge.d.ts +12 -0
- package/dist/agent/repair/scavenge.js +193 -0
- package/dist/agent/repair/truncation.d.ts +17 -0
- package/dist/agent/repair/truncation.js +94 -0
- package/dist/agent/tokens.js +2 -1
- package/dist/commands/init.js +1 -1
- package/dist/content/image-pricing.d.ts +7 -1
- package/dist/content/image-pricing.js +40 -17
- package/dist/content/record-image.d.ts +1 -1
- package/dist/content/record-image.js +2 -2
- package/dist/pricing.js +2 -1
- package/dist/proxy/server.js +2 -1
- package/dist/router/index.js +6 -5
- package/dist/router/vision.js +1 -0
- package/dist/tools/blockrun.js +13 -4
- package/dist/tools/imagegen.d.ts +22 -3
- package/dist/tools/imagegen.js +252 -88
- package/dist/tools/index.js +5 -1
- package/dist/tools/realface.d.ts +29 -0
- package/dist/tools/realface.js +263 -0
- package/dist/tools/surf.d.ts +22 -0
- package/dist/tools/surf.js +281 -0
- package/dist/tools/tool-categories.js +7 -0
- package/dist/tools/videogen.js +44 -1
- package/dist/ui/model-picker.js +3 -2
- package/package.json +2 -2
package/dist/tools/videogen.js
CHANGED
|
@@ -28,6 +28,13 @@ import { ModelClient } from '../agent/llm.js';
|
|
|
28
28
|
import { analyzeMediaRequest, renderProposalForAskUser } from '../agent/media-router.js';
|
|
29
29
|
import { recordUsage } from '../stats/tracker.js';
|
|
30
30
|
import { findModel, estimateCostUsd } from '../gateway-models.js';
|
|
31
|
+
// BytePlus RealFace asset IDs from the RealFace tool (after H5 liveness +
|
|
32
|
+
// enrollment). Format: `ta_` + alphanumeric.
|
|
33
|
+
const REAL_FACE_ASSET_ID_REGEX = /^ta_[A-Za-z0-9]+$/;
|
|
34
|
+
const REAL_FACE_MODELS = new Set([
|
|
35
|
+
'bytedance/seedance-2.0',
|
|
36
|
+
'bytedance/seedance-2.0-fast',
|
|
37
|
+
]);
|
|
31
38
|
const DEFAULT_MODEL = 'xai/grok-imagine-video';
|
|
32
39
|
const DEFAULT_DURATION = 8;
|
|
33
40
|
const PRICE_PER_SECOND_USD = 0.05;
|
|
@@ -44,9 +51,33 @@ function estimateVideoCostUsd(durationSeconds = DEFAULT_DURATION) {
|
|
|
44
51
|
function buildExecute(deps) {
|
|
45
52
|
return async function execute(input, ctx) {
|
|
46
53
|
const rawInput = input;
|
|
47
|
-
const { output_path, model, image_url, duration_seconds, contentId, aspect_ratio } = rawInput;
|
|
54
|
+
const { output_path, model, image_url, duration_seconds, contentId, aspect_ratio, real_face_asset_id } = rawInput;
|
|
48
55
|
if (!rawInput.prompt)
|
|
49
56
|
return { output: 'Error: prompt is required', isError: true };
|
|
57
|
+
// RealFace asset client-side validations (the gateway 400s on the same
|
|
58
|
+
// conditions but a local check is friendlier — and the rejected request
|
|
59
|
+
// doesn't burn an x402 round-trip).
|
|
60
|
+
if (real_face_asset_id !== undefined) {
|
|
61
|
+
if (typeof real_face_asset_id !== 'string' || !REAL_FACE_ASSET_ID_REGEX.test(real_face_asset_id)) {
|
|
62
|
+
return {
|
|
63
|
+
output: `Error: real_face_asset_id must match "ta_<alphanumeric>" (e.g. ta_abc123). Enroll one with the RealFace tool. Got: ${JSON.stringify(real_face_asset_id)}`,
|
|
64
|
+
isError: true,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
const chosenModel = model || DEFAULT_MODEL;
|
|
68
|
+
if (!REAL_FACE_MODELS.has(chosenModel)) {
|
|
69
|
+
return {
|
|
70
|
+
output: `Error: real_face_asset_id is only supported on Seedance 2.0 variants (${[...REAL_FACE_MODELS].join(', ')}). Current model: ${chosenModel}.`,
|
|
71
|
+
isError: true,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
if (image_url) {
|
|
75
|
+
return {
|
|
76
|
+
output: 'Error: real_face_asset_id and image_url both seed the first frame — pick one. Drop image_url to use RealFace, or drop real_face_asset_id to use the image.',
|
|
77
|
+
isError: true,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}
|
|
50
81
|
// Resolve image_url before sending. The gateway requires a URL (http(s)
|
|
51
82
|
// or data: URI), but agents naturally pass a local file path —
|
|
52
83
|
// verified 2026-05-04 in a live session: agent passed
|
|
@@ -162,6 +193,10 @@ function buildExecute(deps) {
|
|
|
162
193
|
// value, the 400 body surfaces via 3.15.45 diagnostic so the agent
|
|
163
194
|
// can drop the param and retry.
|
|
164
195
|
...(aspect_ratio ? { aspect_ratio } : {}),
|
|
196
|
+
// RealFace (BytePlus, Seedance 2.0 only) — seeds the first frame from
|
|
197
|
+
// a real-person asset for cross-frame character consistency. Client
|
|
198
|
+
// already validated the ID + model gate above; just pass through.
|
|
199
|
+
...(real_face_asset_id ? { real_face_asset_id } : {}),
|
|
165
200
|
});
|
|
166
201
|
const headers = {
|
|
167
202
|
'Content-Type': 'application/json',
|
|
@@ -502,6 +537,14 @@ export function createVideoGenCapability(deps = {}) {
|
|
|
502
537
|
'error body surfaces — drop the param and retry.',
|
|
503
538
|
},
|
|
504
539
|
contentId: { type: 'string', description: 'Optional Content id to attach and budget against.' },
|
|
540
|
+
real_face_asset_id: {
|
|
541
|
+
type: 'string',
|
|
542
|
+
description: 'Optional BytePlus RealFace asset id (format `ta_<alphanumeric>`) for cross-frame ' +
|
|
543
|
+
'character consistency from a real person. Enroll one with the RealFace tool ' +
|
|
544
|
+
'(init → phone liveness → enroll). Seedance 2.0 variants only (bytedance/seedance-2.0, ' +
|
|
545
|
+
'bytedance/seedance-2.0-fast). Mutually exclusive with image_url — both seed the ' +
|
|
546
|
+
'first frame; pick one.',
|
|
547
|
+
},
|
|
505
548
|
},
|
|
506
549
|
required: ['prompt'],
|
|
507
550
|
},
|
package/dist/ui/model-picker.js
CHANGED
|
@@ -19,7 +19,8 @@ export const MODEL_SHORTCUTS = {
|
|
|
19
19
|
sonnet: 'anthropic/claude-sonnet-4.6',
|
|
20
20
|
claude: 'anthropic/claude-sonnet-4.6',
|
|
21
21
|
'sonnet-4.6': 'anthropic/claude-sonnet-4.6',
|
|
22
|
-
opus: 'anthropic/claude-opus-4.
|
|
22
|
+
opus: 'anthropic/claude-opus-4.8',
|
|
23
|
+
'opus-4.8': 'anthropic/claude-opus-4.8',
|
|
23
24
|
'opus-4.7': 'anthropic/claude-opus-4.7',
|
|
24
25
|
'opus-4.6': 'anthropic/claude-opus-4.6',
|
|
25
26
|
haiku: 'anthropic/claude-haiku-4.5-20251001',
|
|
@@ -149,7 +150,7 @@ export const PICKER_CATEGORIES = [
|
|
|
149
150
|
// free-tier entries and v3.9.2 used to retire Kimi K2.5.
|
|
150
151
|
category: '✨ Premium frontier',
|
|
151
152
|
models: [
|
|
152
|
-
{ id: 'anthropic/claude-opus-4.
|
|
153
|
+
{ id: 'anthropic/claude-opus-4.8', shortcut: 'opus', label: 'Claude Opus 4.8', price: '$5/$25', highlight: true },
|
|
153
154
|
{ id: 'anthropic/claude-sonnet-4.6', shortcut: 'sonnet', label: 'Claude Sonnet 4.6', price: '$3/$15' },
|
|
154
155
|
{ id: 'openai/gpt-5.5', shortcut: 'gpt', label: 'GPT-5.5', price: '$5/$30', highlight: true },
|
|
155
156
|
{ id: 'google/gemini-3.1-pro', shortcut: 'gemini-3', label: 'Gemini 3.1 Pro', price: '$2/$12' },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blockrun/franklin",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.23.0",
|
|
4
4
|
"description": "Franklin Agent — The AI agent with a wallet. Spends USDC autonomously to get real work done. Pay per action, no subscriptions.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"build": "tsc && node scripts/copy-plugin-assets.mjs",
|
|
32
32
|
"dev": "tsc --watch",
|
|
33
33
|
"start": "node dist/index.js",
|
|
34
|
-
"test": "npm run build && node --test --test-reporter=spec test/local.mjs test/skills.local.mjs",
|
|
34
|
+
"test": "npm run build && node --test --test-reporter=spec test/local.mjs test/skills.local.mjs test/repair.mjs",
|
|
35
35
|
"test:e2e": "npm run build && node --test --test-reporter=spec test/e2e.mjs",
|
|
36
36
|
"test:free-models": "npm run build && node --test --test-reporter=spec test/free-model-matrix.mjs",
|
|
37
37
|
"test:all": "npm run test && npm run test:e2e",
|