Clone any viral video with AI agents. Not just a script, the whole workflow: swap the face, the words, the B-roll, ship 100 variants in one command, and get your 100M views.
TypeScript agentic-aiaiai-agentsai-videocompilerdslffmpeggenerative-aillmmarkup-languagemonorepoplugin-systemprogramming-languagetext-to-videotypescriptvideovideo-automationvideo-clonevideo-editingvideo-generation
fix(pricing): show complete provider-owned rate material
kashorin599b2d05d26e
diff --git a/packages/cli/README.md b/packages/cli/README.mdindex 58775df6..1e09f327 100644--- a/packages/cli/README.md+++ b/packages/cli/README.md@@ -11,9 +11,9 @@ Source imports decide which language and component packages give the source meanProfile separately selects Credential Stores and Endpoints allowed to execute work. The CLI does notinvent targets, candidates or Provider choices.-Human output is compact by default. `--json` emits a stable, bounded command view rather than raw-compiler, Runtime or Repository objects. `--verbose` adds bounded operational detail; it never turns-the command into an internal state dump.+Human output is compact by default. `--json` emits a command-specific view rather than raw compiler,+Runtime or Repository objects. `--verbose` adds operational detail; it never turns the command into+an internal state dump.`plan` lists every Endpoint request in the frozen Build graph. Exact-model packages expose their ownport tables and request-assembly edges, so the CLI can show authored prompt, duration and generation@@ -22,6 +22,24 @@ made by an earlier Build step, that direct graph edge stays symbolic until the fof the request is still shown. A complete request is resolved through the same Endpoint Registry asthe Build, including the Endpoint's `supports` check.+`pricing <run>` uses that selected Runtime to read Provider-owned rate material. The default report+summarizes requests whose resolved Endpoint explicitly declares `pricing.kind: "local"` as having no+Provider charge. Requests with missing pricing declarations, failed price reads, or unresolved or+unsupported Endpoints remain visible. Names, model families and request parameters do not determine+whether work is free.++Matching capability, Endpoint and pricing material share one group. Each group shows shared request+parameters once and preserves the counts and combinations of varying parameters. A Provider's optional+document summary supplies the default rate display; otherwise the document itself is shown, or the+declared pricing page when no document is available. Documents retain the Provider's fields, units and conditions. The CLI+does not interpret formulas, infer upstream media properties, or calculate totals.++All groups are shown by default. `--limit <count>` limits human groups after grouping; `--verbose`+adds no-charge request details, full request names and original documents. JSON uses `hypit.cli-pricing@1`: `requestCount`+and `noChargeRequestCount` describe the whole Run, while `groups[]` holds Provider selection facts,+`requests[]` with known parameters and pending inputs, and `pricingDocuments[]` with source and data.+JSON includes every group regardless of `--limit`; no-charge requests are included with `--verbose`.+The implementation follows those same boundaries: `command.ts` defines the exact semantic commandunion, while argument parsing and option ownership live in `arguments.ts`; project Resultbrowsing/export lives under `commands/results.ts`; Runtime,diff --git a/packages/cli/src/arguments.ts b/packages/cli/src/arguments.tsindex 6a8e2b92..04eba6b2 100644--- a/packages/cli/src/arguments.ts+++ b/packages/cli/src/arguments.ts@@ -67,6 +67,16 @@ export function parseCommand(argv: readonly string[]): CliCommand {const [source, rest] = requiredPositional(tail, `${command} requires one Source`);const options = commandOptions(command, rest,"--runtime", "--package-root", "--workspace", "--asset-root", "--limit");+ if (command === "pricing") return {+ command,+ source,+ presentation: options.presentation,+ assetRoots: options.assetRoots,+ ...(options.seenOptions.includes("--limit") ? { limit: options.limit } : {}),+ ...optionalProject(options),+ ...optionalRuntime(options),+ ...optionalPackageRoot(options),+ };return {command,source,diff --git a/packages/cli/src/build-planning.ts b/packages/cli/src/build-planning.tsindex 20f72e4f..4dfe92ba 100644--- a/packages/cli/src/build-planning.ts+++ b/packages/cli/src/build-planning.ts@@ -86,6 +86,7 @@ export type PlanPricingView = PlanProviderView & {readonly pricingDocuments?: readonly {readonly source: string;readonly data: CanonicalValue;+ readonly summary?: string;}[];readonly pricingError?: string;};diff --git a/packages/cli/src/command.ts b/packages/cli/src/command.tsindex 7f3f1c6a..70ea7baa 100644--- a/packages/cli/src/command.ts+++ b/packages/cli/src/command.ts@@ -22,7 +22,10 @@ type SourceOptions = ProjectOption & {export type AuthorCommand =| (CommandBase & SourceOptions & { readonly command: "check" })| (CommandBase & SourceOptions & RuntimeOption & { readonly command: "plan" })- | (CommandBase & SourceOptions & RuntimeOption & { readonly command: "pricing" })+ | (CommandBase & Omit<SourceOptions, "limit"> & RuntimeOption & {+ readonly command: "pricing";+ readonly limit?: number;+ })| (CommandBase & SourceOptions & RuntimeOption & {readonly command: "build";readonly follow: boolean;diff --git a/packages/cli/src/main.ts b/packages/cli/src/main.tsindex 3e6f6d38..0f64f7cc 100644--- a/packages/cli/src/main.ts+++ b/packages/cli/src/main.ts@@ -13,7 +13,7 @@ import type {CliRuntime,CliRuntimeController,} from "./runtime-port.js";-import { writeCliHelp, writeCliOutput } from "./output.js";+import { createPricingOutput, writeCliHelp, writeCliOutput } from "./output.js";import type { CliIo, CliMachineView } from "./output.js";import { parseCommand } from "./arguments.js";import type { CliCommand, RuntimeOption } from "./command.js";@@ -577,18 +577,12 @@ export async function runCli(}const pricing = await describePlanPricing(planHost, evaluated.state, evaluated);const needs = describePlanNeeds(evaluated.state, evaluated, pricing);- const shown = args.limit;writeCliOutput(io, args.presentation, {kind: "pricing",- machine: {- format: "hypit.cli-pricing@1",- run: projectPath(loaded.path, effectiveWorkspaceRoot),- requestCount: pricing.length,- pricing: pricing.slice(0, shown),- ...(pricing.length <= shown ? {} : { omittedPricing: pricing.length - shown }),- needs: needs.slice(0, shown),- ...(needs.length <= shown ? {} : { omittedNeeds: needs.length - shown }),- },+ ...(args.limit === undefined ? {} : { limit: args.limit }),+ machine: createPricingOutput(+ projectPath(loaded.path, effectiveWorkspaceRoot), pricing, needs, args.presentation.verbose,+ ),});return;}diff --git a/packages/cli/src/output.ts b/packages/cli/src/output.tsindex bd7b6570..320a6dc2 100644--- a/packages/cli/src/output.ts+++ b/packages/cli/src/output.ts@@ -147,16 +147,17 @@ export type PricingEntry = PlanProvider & {export type PricingDocument = {readonly source: string;readonly data: CanonicalValue;+ readonly summary?: string;};export type PricingOutput = {readonly format: "hypit.cli-pricing@1";readonly run: string;readonly requestCount: number;- readonly pricing: readonly PricingEntry[];- readonly omittedPricing?: number;- readonly needs: readonly PlanNeed[];- readonly omittedNeeds?: number;+ readonly noChargeRequestCount: number;+ readonly groups: readonly (Omit<PricingEntry, "request"> & {+ readonly requests: readonly PlanNeed[];+ })[];};export type PlanNeed = {@@ -200,6 +201,8 @@ export type CliPresentation =| {readonly kind: "pricing";readonly machine: PricingOutput;+ /** Optional human display limit, applied after grouping; JSON always contains every group. */+ readonly limit?: number;}| {readonly kind: "operational";@@ -451,7 +454,7 @@ function providerGroupKey(provider: PlanProvider): string {});}-function providerRejectionText(provider: PlanProvider, verbose: boolean): string {+function providerRejectionText(provider: Pick<PlanProvider, "rejections">, verbose: boolean): string {const rejections = provider.rejections ?? [];if (rejections.length === 0) return "no configured Endpoint accepts this request";const shown = verbose ? rejections : rejections.slice(0, 1);@@ -580,16 +583,85 @@ function renderPlan(}function pricingDocumentLines(document: PricingDocument, colors: Palette, verbose: boolean): string[] {- if (!verbose) {- return [` ${colors.dim("Pricing data")} ${document.source} ${colors.dim("· use --json or --verbose for the Provider document")}`];- }- const rendered = JSON.stringify(document.data, undefined, 2);+ const rendered = !verbose && document.summary !== undefined+ ? document.summary : JSON.stringify(document.data, undefined, 2);return [` ${colors.dim("Source")} ${document.source}`,...rendered.split("\n").map((line) => ` ${line}`),];}+/** Factor shared request parameters without losing the combinations of the remaining parameters. */+function pricingNeedLines(needs: readonly PlanNeed[], colors: Palette, verbose: boolean): string[] {+ if (verbose || needs.length < 2) return groupedNeedLines(needs, colors, verbose);+ const first = needs[0]!;+ const sharedFields = Object.fromEntries(Object.entries(first.summary?.fields ?? {}).filter(([key, value]) => {+ const measured = typeof value === "string" ? MEASURE.exec(value) : null;+ return needs.every((need) => {+ const other = need.summary?.fields[key];+ return other === value || (measured !== null && typeof other === "string"+ && MEASURE.exec(other)?.[2] === measured[2]);+ });+ }));+ const sharedReferences = needs.every((need) =>+ JSON.stringify(need.summary?.references ?? {}) === JSON.stringify(first.summary?.references ?? {}));+ const sharedPending = needs.every((need) =>+ JSON.stringify(need.pending.map((input) => input.kind).sort())+ === JSON.stringify(first.pending.map((input) => input.kind).sort()));+ const common = needs.map(({ issue: _issue, ...need }) => ({+ ...need,+ summary: {+ fields: Object.fromEntries(Object.keys(sharedFields).map((key) => [key, need.summary!.fields[key]!])),+ references: sharedReferences ? need.summary?.references ?? {} : {},+ },+ pending: sharedPending ? need.pending : [],+ }));+ const varying = needs.map((need) => ({+ ...need,+ summary: {+ fields: Object.fromEntries(Object.entries(need.summary?.fields ?? {}).filter(([key]) => !Object.hasOwn(sharedFields, key))),+ references: sharedReferences ? {} : need.summary?.references ?? {},+ },+ pending: sharedPending ? [] : need.pending,+ }));+ const hasParameters = (need: PlanNeed) => Object.keys(need.summary?.fields ?? {}).length > 0+ || Object.keys(need.summary?.references ?? {}).length > 0 || need.pending.length > 0 || need.issue !== undefined;+ return [+ ...(common.some(hasParameters) ? [` ${needSummaryText(common)}`] : []),+ ...(varying.some(hasParameters) ? groupedNeedLines(varying, colors, false) : []),+ ];+}++/** Group Provider facts without interpreting their documents or inferring charges from model names. */+export function createPricingOutput(+ run: string,+ entries: readonly PricingEntry[],+ needs: readonly PlanNeed[],+ includeNoCharge = false,+): PricingOutput {+ const needsByRequest = new Map(needs.map((need) => [need.request, need]));+ const groups = new Map<string, Omit<PricingEntry, "request"> & { requests: PlanNeed[] }>();+ let noChargeRequestCount = 0;+ for (const { request, ...entry } of entries) {+ if (entry.status === "resolved" && entry.pricing?.kind === "local") {+ noChargeRequestCount++;+ if (!includeNoCharge) continue;+ }+ const key = JSON.stringify(entry);+ let group = groups.get(key);+ if (group === undefined) {+ group = { ...entry, requests: [] };+ groups.set(key, group);+ }+ const need = needsByRequest.get(request);+ if (need !== undefined) group.requests.push(need);+ }+ return {+ format: "hypit.cli-pricing@1", run, requestCount: entries.length,+ noChargeRequestCount, groups: [...groups.values()],+ };+}+function renderPricing(view: Extract<CliPresentation, { kind: "pricing" }>,io: CliIo,@@ -601,26 +673,14 @@ function renderPricing(lines.push(...facts([["Run", shortPath(machine.run)],["Requests", String(machine.requestCount)],+ ["No Provider charge", `${machine.noChargeRequestCount} requests`],], colors));- if (machine.pricing.length > 0) lines.push("", colors.strong("Requests and pricing sources"));- const groups = new Map<string, PricingEntry[]>();- for (const item of machine.pricing) {- const key = JSON.stringify({- capability: item.capability,- status: item.status,- endpoint: item.endpoint,- use: item.use,- pricing: item.pricing,- endpoints: item.endpoints,- rejections: item.rejections,- binding: item.binding,- pricingDocuments: item.pricingDocuments,- pricingError: item.pricingError,- });- groups.set(key, [...(groups.get(key) ?? []), item]);+ if (machine.noChargeRequestCount > 0 && !verbose) {+ lines.push(` ${colors.dim("No-charge request details: --verbose")}`);}- for (const group of groups.values()) {- const item = group[0]!;+ if (machine.groups.length > 0) lines.push("", colors.strong("Requests and Provider rates"));+ const shown = view.limit === undefined ? machine.groups : machine.groups.slice(0, view.limit);+ for (const item of shown) {const selected = item.status === "resolved"? `${item.endpoint ?? ""} ${colors.dim(`(${item.use ?? "?"})`)}`: item.status === "ambiguous"@@ -629,7 +689,8 @@ function renderPricing(? colors.error(providerRejectionText(item, verbose)): colors.error("no selected Endpoint accepts this request");lines.push(` ${colors.accent(verbose ? item.capability : capabilityLabel(item.capability))}`);- lines.push(` ${selected}${group.length === 1 ? "" : ` each ×${group.length}`}`);+ lines.push(` ${selected} · ${item.requests.length} request${item.requests.length === 1 ? "" : "s"}`);+ lines.push(...pricingNeedLines(item.requests, colors, verbose));if (item.pricing?.kind === "local") {lines.push(` ${colors.dim("local, no Provider charge")}`);}@@ -643,14 +704,12 @@ function renderPricing(lines.push(` ${colors.dim("Pricing page")} ${item.pricing.url}`);} else if ((item.pricingDocuments?.length ?? 0) === 0 && item.pricing === undefined&& item.status === "resolved" && item.pricingError === undefined) {- lines.push(` ${colors.dim("No pricing source declared by this Provider")}`);+ lines.push(` ${colors.warning("Pricing unknown: no pricing source declared by this Provider")}`);}- const requests = new Set(group.map((entry) => entry.request));- const needs = machine.needs.filter((need) => requests.has(need.request));- lines.push(...groupedNeedLines(needs, colors, verbose));+ lines.push("");}- if ((machine.omittedPricing ?? 0) > 0) {- lines.push(` ${colors.dim(`${machine.omittedPricing} more requests · use --limit <count>`)}`);+ if (shown.length < machine.groups.length) {+ lines.push(` ${colors.dim(`${machine.groups.length - shown.length} more groups · omit --limit or use --json for all groups`)}`);}return `${lines.join("\n")}\n`;}@@ -731,7 +790,10 @@ function commandHelp(topic: string, colors: Palette): readonly string[] | undefi" hypit pricing <run-source> [--runtime <profile>] [--workspace <workspace>] [--asset-root <directory>]","","Pricing is an explicit read-only network operation. It starts no Build and submits no generation.",- "The command shows each Need beside its Provider source; use --json or --verbose for the raw document.",+ "Matching requests share their parameters and Provider rates, with source URLs.",+ "Provider summaries appear when available; --verbose and --json retain the full documents.",+ "Explicit no-charge requests are summarized; --verbose includes their details.",+ "All groups are shown by default. --limit <count> limits human groups; --json always includes all groups.","Hypit calculates no total.",],build: [diff --git a/packages/cli/test/output.test.ts b/packages/cli/test/output.test.tsindex 7d3263d5..638f0faf 100644--- a/packages/cli/test/output.test.ts+++ b/packages/cli/test/output.test.ts@@ -1,7 +1,9 @@import assert from "node:assert/strict";import test from "node:test";-import { renderCliError, writeCliHelp, writeCliOutput } from "../src/output.js";+import { createPricingOutput, renderCliError, writeCliHelp, writeCliOutput } from "../src/output.js";+import type { PlanNeed, PricingEntry } from "../src/output.js";+import { parseCommand } from "../src/arguments.js";function capture(options: Parameters<typeof writeCliOutput>[1],@@ -153,11 +155,7 @@ test("plan names the Provider and price page behind each request, and points at});test("pricing presents Provider-owned material beside the corresponding Needs", () => {- const presentation = { kind: "pricing", machine: {- format: "hypit.cli-pricing@1",- run: "/project/build.svrun",- requestCount: 2,- pricing: [{+ const presentation = { kind: "pricing", machine: createPricingOutput("/project/build.svrun", [{request: "seedance:one", capability: "@hypit/seedance@1#seedance-2", status: "resolved",endpoint: "hypihub.default", use: "@hypit/provider-hypihub",pricing: { kind: "page", url: "https://hypit.ai/commercial/pricing/" },@@ -169,21 +167,19 @@ test("pricing presents Provider-owned material beside the corresponding Needs",request: "image:one", capability: "@hypit/gpt-image@1#gpt-image-2", status: "resolved",endpoint: "kie.default", use: "@hypit/provider-kie",pricing: { kind: "page", url: "https://kie.ai/pricing" },- }],- needs: [{+ }], [{request: "seedance:one", step: "video::component::presenter.generate", port: "generation",capability: "@hypit/seedance@1#seedance-2", endpoint: "hypihub.default",summary: { fields: { duration: 5, resolution: "720p" }, references: {} }, pending: [],}, {request: "image:one", step: "video::component::portrait.generate", port: "generation",capability: "@hypit/gpt-image@1#gpt-image-2", endpoint: "kie.default", pending: [],- }],- } } as const;+ }]),+ } as const;const output = capture(human, presentation);assert.match(output, /Provider pricing information/u);assert.match(output, /https:\/\/hypit\.ai\/v1\/pricing\?model=bytedance%2Fseedance-2/u);- assert.match(output, /use --json or --verbose for the Provider document/u);- assert.doesNotMatch(output, /"per_second_usd": 0\.1045/u);+ assert.match(output, /"per_second_usd": 0\.1045/u);assert.match(output, /duration 5 · resolution 720p/u);assert.match(output, /Pricing page\s+https:\/\/kie\.ai\/pricing/u);@@ -191,6 +187,94 @@ test("pricing presents Provider-owned material beside the corresponding Needs",assert.match(verbose, /"per_second_usd": 0\.1045/u);});+test("pricing summarizes 24 no-charge requests and retains all 15 priced requests with shared rate documents", () => {+ const entries: PricingEntry[] = [];+ const needs: PlanNeed[] = [];+ const add = (count: number, capability: string, metadata: Omit<PricingEntry, "request" | "capability">) => {+ for (let index = 0; index < count; index++) {+ const request = `${capability}:${index}`;+ entries.push({ request, capability, ...metadata });+ needs.push({ request, capability, step: request, port: "result", pending: [],+ summary: { fields: { quantity: index + 1 }, references: {} } });+ }+ };+ add(24, "example.processing@1#prepare", {+ status: "resolved", endpoint: "processing", pricing: { kind: "local" },+ });+ for (const [count, capability] of [[7, "example.work@1#create"], [7, "example.work@1#align"], [1, "example.work@1#draw"]] as const) {+ add(count, capability, {+ status: "resolved", endpoint: "vendor", pricing: { kind: "page", url: "https://vendor.example/prices" },+ pricingDocuments: [{ source: `https://vendor.example/prices/${capability}`, data: { creditsPerUnit: 3 } }],+ });+ }+ const machine = createPricingOutput("build.svrun", entries, needs);+ assert.equal(machine.requestCount, 39);+ assert.equal(machine.noChargeRequestCount, 24);+ assert.deepEqual(machine.groups.map((group) => group.requests.length), [7, 7, 1]);+ assert.deepEqual(machine.groups.flatMap((group) => group.requests), needs.slice(24));+ const output = capture(human, { kind: "pricing", machine });+ assert.doesNotMatch(output, /example.processing/u);+ assert.equal(output.match(/"creditsPerUnit": 3/gu)?.length, 3);+ assert.match(output, /quantity 7/u);+ assert.match(output, /example.work#draw/u);+ const detailed = createPricingOutput("build.svrun", entries, needs, true);+ assert.equal(detailed.groups.flatMap((group) => group.requests).length, 39);+});++test("pricing retains unknown and rejected requests and distinguishes Endpoint-specific rate material", () => {+ const entries: PricingEntry[] = [+ { request: "unknown", capability: "example.local@1#free", status: "resolved", endpoint: "free.local" },+ { request: "rejected", capability: "example.local@1#free", status: "unsupported", pricing: { kind: "local" },+ rejections: [{ endpoint: "free.local", message: "unsupported parameter" }] },+ { request: "failed", capability: "example@1#create", status: "resolved", endpoint: "vendor",+ pricing: { kind: "page", url: "https://vendor.example/prices" }, pricingError: "pricing service unavailable" },+ ...["account-a", "account-b"].flatMap((endpoint) => [1, 2].map((tier) => ({+ request: `${endpoint}:${tier}`, capability: "example@1#create", status: "resolved" as const, endpoint,+ pricingDocuments: [{ source: "https://vendor.example/prices", data: { tier, amount: tier * 2 } }],+ }))),+ ];+ const needs = entries.map(({ request, capability }) => ({ request, capability, step: request, port: "result", pending: [] }));+ const machine = createPricingOutput("build.svrun", entries, needs);+ assert.equal(machine.noChargeRequestCount, 0);+ assert.equal(machine.groups.length, 7);+ const presentation = { kind: "pricing", machine } as const;+ const output = capture(human, presentation);+ assert.match(output, /Pricing unknown/u);+ assert.match(output, /unsupported parameter/u);+ assert.match(output, /pricing service unavailable/u);+ assert.match(output, /Pricing page\s+https:\/\/vendor.example\/prices/u);+ const limited = { ...presentation, limit: 1 };+ assert.match(capture(human, limited), /6 more groups/u);+ assert.deepEqual(JSON.parse(capture({ ...human, json: true }, limited)), machine);+ const command = parseCommand(["pricing", "build.svrun"]);+ assert.equal(command.command, "pricing");+ assert.equal("limit" in command, false);+ assert.equal((parseCommand(["pricing", "build.svrun", "--limit", "1"]) as { limit: number }).limit, 1);+});++test("Provider summaries keep raw pricing available and shared parameters preserve differing combinations", () => {+ const entries = ["first", "second", "third"].map((request) => ({+ request, capability: "example@1#generate", status: "resolved" as const, endpoint: "vendor",+ pricingDocuments: [{ source: "https://vendor.example/prices", summary: "Gold: 2 credits per unit",+ data: { actualRate: 2, marketingComparison: 99 } }],+ }));+ const needs = entries.map(({ request, capability }, index) => ({+ request, capability, step: request, port: "result", pending: [],+ summary: { fields: { mode: "gold", duration: index === 0 ? 5 : 10, size: index === 2 ? "large" : "small" }, references: {} },+ }));+ const machine = createPricingOutput("build.svrun", entries, needs);+ const presentation = { kind: "pricing", machine } as const;+ const output = capture(human, presentation);+ assert.equal(output.match(/mode gold/gu)?.length, 1);+ assert.match(output, /duration 5 · size small/u);+ assert.match(output, /duration 10 · size small/u);+ assert.match(output, /duration 10 · size large/u);+ assert.match(output, /Gold: 2 credits per unit/u);+ assert.doesNotMatch(output, /marketingComparison/u);+ assert.match(capture({ ...human, verbose: true }, presentation), /"marketingComparison": 99/u);+ assert.equal(JSON.parse(capture({ ...human, json: true }, presentation)).groups[0].pricingDocuments[0].data.marketingComparison, 99);+});+test("run check treats historical reuse as a normal summary", () => {const output = capture(human, {kind: "check-run",diff --git a/packages/endpoint-kit/README.md b/packages/endpoint-kit/README.mdindex d7c1e79d..77236c75 100644--- a/packages/endpoint-kit/README.md+++ b/packages/endpoint-kit/README.md@@ -68,6 +68,11 @@ session; capabilities that require durable quota shared with Builds stay Build-oEndpoint packages are selected by a Runtime Profile, never activated by author imports. This packagedepends on no Node filesystem, scheduler implementation or video domain.+`pricing: { kind: "local" }` explicitly declares work on this machine without a Provider call charge.+`pricing: { kind: "page", url }` identifies published pricing information; it does not determine an+account's eventual bill. An absent declaration leaves pricing unknown. Callers can summarize explicit+no-charge work while keeping unknown pricing and Endpoint selection failures visible.+An Endpoint may also expose `readPricing`. It receives the same complete `EndpointRequest` used forsupport selection and resolves only that Endpoint's declared credentials when its source requiresthem. The Provider returns current pricing documents together with their source URLs. Their data shape@@ -76,6 +81,18 @@ and another may expose only its declared pricing page. Hypit preserves the materinventing a shared rate-table taxonomy, interpreting formulas, calculating totals, or turning pricinginformation into spending authority.+An `EndpointPricingDocument` may add a concise `summary` for the default human view. It should retain+the published rates, units and applicable conditions. The Provider owns this description because it+knows its API's price fields and which fields merely describe marketing comparisons. The original+`data` remains available in JSON and verbose output. Without a summary, the CLI displays the data.++Use the Provider's execution mapping to select the upstream model and the request's known parameters+to narrow the published material when the service supports it. Preserve applicable units and+conditions. A future media input supplies its declared slot and role, not its eventual duration or+other measured properties. Pricing readers receive no graph to traverse; incomplete usage still+allows returning the model's rate information. Requests sharing a catalogue lookup can share that read+inside the Provider, whose API determines what can be cached together.+Three facts remain separate at this boundary:- the `EndpointRequest` describes the work selected by the Run;diff --git a/packages/endpoint-kit/src/index.ts b/packages/endpoint-kit/src/index.tsindex d4486714..21a49076 100644--- a/packages/endpoint-kit/src/index.ts+++ b/packages/endpoint-kit/src/index.ts@@ -66,6 +66,8 @@ export type EndpointCredential = CredentialValue & {export type EndpointPricingDocument = {readonly source: string;readonly data: CanonicalValue;+ /** Optional concise rate description, including units and conditions, owned by this Provider. */+ readonly summary?: string;};export type EndpointPricingReaderContext = {@@ -85,6 +87,8 @@ export function verifyEndpointPricingDocument(value: EndpointPricingDocument): vassert(source?.protocol === "https:" || source?.hostname === "localhost","Endpoint pricing source must use HTTPS or localhost");canonicalize(value.data);+ assert(value.summary === undefined || typeof value.summary === "string",+ "Endpoint pricing summary must be text");}export type EndpointInvocationContext = {diff --git a/packages/provider-kie/README.md b/packages/provider-kie/README.mdindex a82641ca..9290069f 100644--- a/packages/provider-kie/README.md+++ b/packages/provider-kie/README.md@@ -52,6 +52,9 @@ pages with that wire model in KIE's `modelDescription` query, and preserves theProvider contains no Hypit model-price table and does not interpret KIE's descriptions or formulas.All returned parameter rows remain intact for the Agent to read beside the Need. Reading this publiccatalogue does not resolve the generation API credential and submits no work.+The optional document summary presents each row's model description, USD price, credit price and+billing unit. Comparison prices and promotion fields remain in the original data for JSON or verbose+inspection; the summary does not guess a matching tier from KIE's description text.There is deliberately no Grok image capability and no MiMo capability in this release. Seedream's`nsfwCheck` is explicit author request content; KIE cannot silently enable or disable it. Adiff --git a/packages/provider-kie/src/provider.ts b/packages/provider-kie/src/provider.tsindex 441f7652..50b44512 100644--- a/packages/provider-kie/src/provider.ts+++ b/packages/provider-kie/src/provider.ts@@ -433,9 +433,19 @@ function kiePricingReader(client: KieClient): EndpointPricingReader {const selectedModel = route.selectModel(request);const records = await client.pricingRecords(selectedModel);if (records.length === 0) return [];+ const lines = records.map((record) => {+ if (typeof record.modelDescription !== "string" || typeof record.creditUnit !== "string") return undefined;+ const value = (item: unknown) => typeof item === "string" || typeof item === "number" ? String(item) : undefined;+ const usd = value(record.usdPrice);+ const credits = value(record.creditPrice);+ if (usd === undefined && credits === undefined) return undefined;+ const amounts = [usd === undefined ? undefined : `USD ${usd}`, credits === undefined ? undefined : `${credits} credits`];+ return `${record.modelDescription}: ${amounts.filter((item) => item !== undefined).join("; ")} (${record.creditUnit})`;+ });return [{source: client.pricingSource,data: canonicalize({ model: selectedModel, records }),+ ...(lines.every((line) => line !== undefined) ? { summary: lines.join("\n") } : {}),}];};}diff --git a/packages/provider-kie/test/provider.test.ts b/packages/provider-kie/test/provider.test.tsindex 315f1bab..6ec7933e 100644--- a/packages/provider-kie/test/provider.test.ts+++ b/packages/provider-kie/test/provider.test.ts@@ -120,6 +120,7 @@ test("KIE exposes the rate-card records returned for the request's wire model",credentials: async () => { throw new Error("public pricing must not require credentials"); },}), [{source: "https://api.kie.ai/client/v1/model-pricing/page",+ summary: "bytedance/seedance-2-mini, 720P no video: USD 0.041; 8.2 credits (per second)",data: {model: "bytedance/seedance-2-mini",records: [{diff --git a/packages/runtime-host-node/src/index.ts b/packages/runtime-host-node/src/index.tsindex 341f84e3..4ea67045 100644--- a/packages/runtime-host-node/src/index.ts+++ b/packages/runtime-host-node/src/index.ts@@ -174,6 +174,7 @@ export type RuntimeHostCapabilityPricing = RuntimeHostCapabilityProvider & {readonly pricingDocuments?: readonly {readonly source: string;readonly data: CanonicalValue;+ readonly summary?: string;}[];/** A failed pricing-source read. The Provider's static price page remains available. */readonly pricingError?: string;diff --git a/packages/runtime-local/test/config.test.ts b/packages/runtime-local/test/config.test.tsindex 9e1b9708..cef4594b 100644--- a/packages/runtime-local/test/config.test.ts+++ b/packages/runtime-local/test/config.test.ts@@ -415,7 +415,7 @@ test("Runtime pricing reads Provider-owned material with only the selected Endpoconst resolved = await credentials();assert.equal(resolved.apiKey?.secret, "selected-key");assert.deepEqual(request.constraints, { seconds: 5 });- return [{ source: "https://prices.example/models/generate", data: { usdPerSecond: 0.25 } }];+ return [{ source: "https://prices.example/models/generate", data: { usdPerSecond: 0.25 }, summary: "USD 0.25 per second" }];},capabilities: [{ capability: generate, returns, lifecycle: "immediate", handler }],}) }),@@ -438,6 +438,7 @@ test("Runtime pricing reads Provider-owned material with only the selected EndpopricingDocuments: [{source: "https://prices.example/models/generate",data: { usdPerSecond: 0.25 },+ summary: "USD 0.25 per second",}],}, {request: "render", capability: render, status: "resolved", endpoint: "local", use: "example.local",diff --git a/packages/video-cli/test/cli.test.ts b/packages/video-cli/test/cli.test.tsindex c7a38afb..a2a03a60 100644--- a/packages/video-cli/test/cli.test.ts+++ b/packages/video-cli/test/cli.test.ts@@ -5,6 +5,7 @@ import { join } from "node:path";import test from "node:test";import { runVideoCli, videoCliDistribution } from "@hypit/video-cli";+import { runCli as runCommand } from "@hypit/cli";import { videoTestPackages } from "./packages.js";@@ -98,3 +99,55 @@ test("check compiles a data-only package Source export without a project copy",await rm(root, { recursive: true, force: true });}});++test("pricing keeps every planned generation after the old 20-request cutoff and exposes authored parameters", async () => {+ const root = await mkdtemp(join(tmpdir(), "hypit-pricing-"));+ try {+ const ids = Array.from({ length: 25 }, (_, index) => `portrait-${index}`);+ await writeFile(join(root, "main.svml"), `<?svml using="@hypit/markup@1"?>+<svml>+ <import as="copy" from="@hypit/text@1"/>+ <import as="gpt" from="@hypit/gpt-image@1"/>+ ${ids.map((id) => `<copy:Value id="${id}-prompt">An original ${id}.</copy:Value>+ <gpt:Image id="${id}" prompt={${id}-prompt} aspect-ratio="9:16" resolution="2K"/>`).join("\n")}+</svml>`);+ const source = join(root, "build.svrun");+ await writeFile(source, `<?svml using="@hypit/run-markup@1"?>+<svrun version="1"><author source="./main.svml"/>+ ${ids.map((id) => `<target output="${id}.image"/>`).join("\n")}+</svrun>`);+ let queried = 0;+ let output = "";+ await runCommand(["pricing", source, "--workspace", root, "--runtime", join(root, "runtime.json"),+ "--json", "--limit", "1"], { write: (text) => { output += text; } }, {+ ...videoCliDistribution,+ bootstrapPackages: videoTestPackages,+ openRuntimeHost: async (path, options) => ({+ ...await videoCliDistribution.openRuntimeHost(path, options),+ pricing: async (requests) => {+ queried = requests.length;+ return requests.map((request) => ({+ request: request.request, capability: request.capability, status: "resolved" as const,+ endpoint: "test.vendor", use: "test.provider",+ pricingDocuments: [{ source: "https://vendor.example/rates", data: { creditsPerImage: 2 } }],+ }));+ },+ createRuntime: async () => { throw new Error("pricing cannot execute a Build"); },+ }),+ });+ const report = JSON.parse(output);+ assert.equal(queried, 25);+ assert.equal(report.format, "hypit.cli-pricing@1");+ assert.equal(report.requestCount, 25);+ assert.equal(report.groups.length, 1);+ const group = report.groups[0];+ assert.equal(group.requests.length, 25);+ assert.deepEqual(group.pricingDocuments[0].data, { creditsPerImage: 2 });+ for (const request of group.requests) {+ assert.equal(request.summary.fields.resolution, "2K");+ assert.equal(request.summary.fields.aspectRatio, "9:16");+ }+ } finally {+ await rm(root, { recursive: true, force: true });+ }+});