Skip to content

fix: export VideoClient from package entry point#3

Merged
1bcMax merged 2 commits into
BlockRunAI:mainfrom
KillerQueen-Z:fix/export-video-client
May 14, 2026
Merged

fix: export VideoClient from package entry point#3
1bcMax merged 2 commits into
BlockRunAI:mainfrom
KillerQueen-Z:fix/export-video-client

Conversation

@KillerQueen-Z
Copy link
Copy Markdown
Contributor

@KillerQueen-Z KillerQueen-Z commented May 14, 2026

Summary

  • VideoClient is fully implemented in src/video.ts and the README documents import { VideoClient } from '@blockrun/llm' as the supported usage, but the export was missing from src/index.ts.
  • Downstream consumers (Franklin's videogen.ts, the new franklin-canvas server) had to hand-roll the entire x402 + polling loop against /v1/videos/generations even though a working client was already shipped — they just couldn't reach it.
  • This PR adds the missing export and realigns test/unit/cost-log.test.ts with the refactored module schema (ts / endpoint / cost_usd fields, new log path ~/.blockrun/cost_log.jsonl).

Changes

 export { ImageClient } from "./image";
 export { MusicClient } from "./music";
+export { VideoClient } from "./video";

Plus a CHANGELOG.md entry under ## Unreleased and updated cost-log tests to match the current schema.

Test plan

  • npm run typecheck — clean
  • npm run lint — clean
  • npx vitest run113 passed, 0 failed
  • Verified import { VideoClient } from '@blockrun/llm' resolves after rebuild

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.
@1bcMax 1bcMax merged commit cd35ffd into BlockRunAI:main May 14, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant