fix: export VideoClient from package entry point#3
Merged
Conversation
The VideoClient class is fully implemented in src/video.ts (async
client-polled flow: 402 → sign → 202 + poll loop, settlement only on
the first completed poll) and the README documents
`import { VideoClient } from '@blockrun/llm'` as the supported way to
generate videos. But the export was missing from src/index.ts, so
downstream consumers — Franklin's videogen.ts, the new franklin-canvas
server — had to hand-roll the entire x402 + polling loop against
/v1/videos/generations instead.
Restores the promised public surface. No source changes to video.ts.
cost-log.ts was rewritten between 1.13 and 2.1 to share Franklin's AgentClient ledger schema: - new path: ~/.blockrun/cost_log.jsonl (was: ~/.blockrun/data/costs.jsonl) - new fields: ts / endpoint / cost_usd (was: timestamp / costUsd / inputTokens) test/unit/cost-log.test.ts was never updated. The mismatch silently slipped through because main hadn't been touched by CI since 2026-04-21 — the regressing commits (8255f4c, d3882bd, 04e7506) landed without test runs. PR BlockRunAI#3 is the first PR to actually exercise CI on top of those commits, so the failure surfaces here. Three test fixes: 1. COST_LOG points at the real path. 2. logCost() calls pass `ts` / `endpoint` / `cost_usd` instead of the old keys. 3. Assertions read `entry.cost_usd` instead of `entry.costUsd`, and gain a sanity check on `entry.endpoint`. No production-code changes — only the test catches up to what the module already does on main.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
VideoClientis fully implemented insrc/video.tsand the README documentsimport { VideoClient } from '@blockrun/llm'as the supported usage, but the export was missing fromsrc/index.ts.videogen.ts, the newfranklin-canvasserver) had to hand-roll the entire x402 + polling loop against/v1/videos/generationseven though a working client was already shipped — they just couldn't reach it.test/unit/cost-log.test.tswith the refactored module schema (ts/endpoint/cost_usdfields, new log path~/.blockrun/cost_log.jsonl).Changes
export { ImageClient } from "./image"; export { MusicClient } from "./music"; +export { VideoClient } from "./video";Plus a
CHANGELOG.mdentry under## Unreleasedand updated cost-log tests to match the current schema.Test plan
npm run typecheck— cleannpm run lint— cleannpx vitest run— 113 passed, 0 failedimport { VideoClient } from '@blockrun/llm'resolves after rebuild