mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-10-01 02:04:24 +00:00
Regenerate the TypeScript API client for the usage schemas
The generated models follow the spec: TokenCounts, Cost, Usage, ModelUsage, UsageModelRef, UsageStageRef, Speed, RunUsage, RunUsageStage, RunUsageTotals, UsageByModel, AggregateUsage, and AggregateUsageTotals replace the billing models, and UsageApi replaces BillingApi. The stale billing model files are deleted. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
ef86ad278a
commit
aca9bbbf97
34 changed files with 678 additions and 122 deletions
|
|
@ -1,7 +1,6 @@
|
|||
api.ts
|
||||
api/auth-api.ts
|
||||
api/automations-api.ts
|
||||
api/billing-api.ts
|
||||
api/completions-api.ts
|
||||
api/discovery-api.ts
|
||||
api/environments-api.ts
|
||||
|
|
@ -20,6 +19,7 @@ api/secrets-api.ts
|
|||
api/sessions-api.ts
|
||||
api/settings-api.ts
|
||||
api/system-api.ts
|
||||
api/usage-api.ts
|
||||
api/variables-api.ts
|
||||
api/workflow-versions-api.ts
|
||||
api/workflows-api.ts
|
||||
|
|
@ -51,8 +51,8 @@ models/agent-session-subagent-status.ts
|
|||
models/agent-session-subagent.ts
|
||||
models/agent-session-tool-activity.ts
|
||||
models/agent-tools-available-props.ts
|
||||
models/aggregate-billing-totals.ts
|
||||
models/aggregate-billing.ts
|
||||
models/aggregate-usage-totals.ts
|
||||
models/aggregate-usage.ts
|
||||
models/api-question.ts
|
||||
models/append-event-response.ts
|
||||
models/approval-mode.ts
|
||||
|
|
@ -84,12 +84,6 @@ models/batch-run-lifecycle-request.ts
|
|||
models/batch-run-lifecycle-response.ts
|
||||
models/batch-run-lifecycle-result.ts
|
||||
models/batch-run-lifecycle-summary.ts
|
||||
models/billed-model-usage.ts
|
||||
models/billed-token-counts.ts
|
||||
models/billing-by-model.ts
|
||||
models/billing-model-ref.ts
|
||||
models/billing-speed.ts
|
||||
models/billing-stage-ref.ts
|
||||
models/blocked-reason.ts
|
||||
models/board-column.ts
|
||||
models/check-run-status.ts
|
||||
|
|
@ -101,7 +95,6 @@ models/command-log-response.ts
|
|||
models/command-termination.ts
|
||||
models/compaction-reason.ts
|
||||
models/completion-content-part.ts
|
||||
models/completion-cost.ts
|
||||
models/completion-message.ts
|
||||
models/completion-response-format.ts
|
||||
models/completion-response-warnings-inner.ts
|
||||
|
|
@ -109,7 +102,6 @@ models/completion-response.ts
|
|||
models/completion-tool-choice.ts
|
||||
models/completion-tool-definition-kind.ts
|
||||
models/completion-tool-definition.ts
|
||||
models/completion-usage.ts
|
||||
models/conclusion.ts
|
||||
models/context-window-breakdown-item.ts
|
||||
models/context-window-category.ts
|
||||
|
|
@ -118,6 +110,7 @@ models/context-window-snapshot.ts
|
|||
models/context-window-staleness.ts
|
||||
models/context-window-warning.ts
|
||||
models/cost-source.ts
|
||||
models/cost.ts
|
||||
models/create-automation-request.ts
|
||||
models/create-completion-request.ts
|
||||
models/create-environment-request.ts
|
||||
|
|
@ -262,6 +255,7 @@ models/model-limits.ts
|
|||
models/model-reference.ts
|
||||
models/model-test-mode.ts
|
||||
models/model-test-result.ts
|
||||
models/model-usage.ts
|
||||
models/model.ts
|
||||
models/none-run-target.ts
|
||||
models/notification-provider-settings.ts
|
||||
|
|
@ -371,10 +365,6 @@ models/run-approval-state.ts
|
|||
models/run-approval.ts
|
||||
models/run-artifact-entry.ts
|
||||
models/run-artifact-list-response.ts
|
||||
models/run-billing-stage.ts
|
||||
models/run-billing-summary.ts
|
||||
models/run-billing-totals.ts
|
||||
models/run-billing.ts
|
||||
models/run-branch-settings.ts
|
||||
models/run-checkpoint-settings.ts
|
||||
models/run-checkpoint.ts
|
||||
|
|
@ -449,6 +439,9 @@ models/run-superseded-by-props.ts
|
|||
models/run-target.ts
|
||||
models/run-timestamps.ts
|
||||
models/run-timing.ts
|
||||
models/run-usage-stage.ts
|
||||
models/run-usage-totals.ts
|
||||
models/run-usage.ts
|
||||
models/run.ts
|
||||
models/sandbox-details.ts
|
||||
models/sandbox-file-entry.ts
|
||||
|
|
@ -500,6 +493,7 @@ models/session-turn.ts
|
|||
models/skill-activation-source.ts
|
||||
models/skill-summary.ts
|
||||
models/slack-integration-settings.ts
|
||||
models/speed.ts
|
||||
models/ssh-access-request.ts
|
||||
models/ssh-access-response.ts
|
||||
models/stage-completion.ts
|
||||
|
|
@ -545,7 +539,7 @@ models/todo-list-kind.ts
|
|||
models/todo-list-projection.ts
|
||||
models/todo-projection.ts
|
||||
models/todo-status.ts
|
||||
models/token-usage.ts
|
||||
models/token-counts.ts
|
||||
models/tool-category.ts
|
||||
models/tool-source-application.ts
|
||||
models/tool-source-mcp.ts
|
||||
|
|
@ -556,6 +550,10 @@ models/tool-summary.ts
|
|||
models/update-run-parent-request.ts
|
||||
models/update-run-request.ts
|
||||
models/update-variable-request.ts
|
||||
models/usage-by-model.ts
|
||||
models/usage-model-ref.ts
|
||||
models/usage-stage-ref.ts
|
||||
models/usage.ts
|
||||
models/user-response.ts
|
||||
models/validate-response.ts
|
||||
models/variable-list-response.ts
|
||||
|
|
|
|||
2
lib/packages/fabro-api-client/src/api.ts
generated
2
lib/packages/fabro-api-client/src/api.ts
generated
|
|
@ -16,7 +16,6 @@
|
|||
|
||||
export * from './api/auth-api';
|
||||
export * from './api/automations-api';
|
||||
export * from './api/billing-api';
|
||||
export * from './api/completions-api';
|
||||
export * from './api/discovery-api';
|
||||
export * from './api/environments-api';
|
||||
|
|
@ -35,6 +34,7 @@ export * from './api/secrets-api';
|
|||
export * from './api/sessions-api';
|
||||
export * from './api/settings-api';
|
||||
export * from './api/system-api';
|
||||
export * from './api/usage-api';
|
||||
export * from './api/variables-api';
|
||||
export * from './api/workflow-versions-api';
|
||||
export * from './api/workflows-api';
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import type { PaginatedRunCommitList } from '../models';
|
|||
// @ts-ignore
|
||||
import type { PaginatedRunFileList } from '../models';
|
||||
// @ts-ignore
|
||||
import type { RunBilling } from '../models';
|
||||
import type { RunUsage } from '../models';
|
||||
/**
|
||||
* RunOutputsApi - axios parameter creator
|
||||
*/
|
||||
|
|
@ -145,16 +145,16 @@ export const RunOutputsApiAxiosParamCreator = function (configuration?: Configur
|
|||
};
|
||||
},
|
||||
/**
|
||||
* Returns token counts and billed totals broken down by stage and model for a specific run.
|
||||
* @summary Retrieve Run Billing
|
||||
* Returns token counts and costs broken down by stage and model for a specific run.
|
||||
* @summary Retrieve Run Usage
|
||||
* @param {string} id Unique run identifier (ULID).
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
retrieveRunBilling: async (id: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
retrieveRunUsage: async (id: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
// verify required parameter 'id' is not null or undefined
|
||||
assertParamExists('retrieveRunBilling', 'id', id)
|
||||
const localVarPath = `/api/v1/runs/{id}/billing`
|
||||
assertParamExists('retrieveRunUsage', 'id', id)
|
||||
const localVarPath = `/api/v1/runs/{id}/usage`
|
||||
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
|
|
@ -226,16 +226,16 @@ export const RunOutputsApiFp = function(configuration?: Configuration) {
|
|||
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||
},
|
||||
/**
|
||||
* Returns token counts and billed totals broken down by stage and model for a specific run.
|
||||
* @summary Retrieve Run Billing
|
||||
* Returns token counts and costs broken down by stage and model for a specific run.
|
||||
* @summary Retrieve Run Usage
|
||||
* @param {string} id Unique run identifier (ULID).
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async retrieveRunBilling(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RunBilling>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveRunBilling(id, options);
|
||||
async retrieveRunUsage(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RunUsage>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveRunUsage(id, options);
|
||||
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||
const localVarOperationServerBasePath = operationServerMap['RunOutputsApi.retrieveRunBilling']?.[localVarOperationServerIndex]?.url;
|
||||
const localVarOperationServerBasePath = operationServerMap['RunOutputsApi.retrieveRunUsage']?.[localVarOperationServerIndex]?.url;
|
||||
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||
},
|
||||
}
|
||||
|
|
@ -274,14 +274,14 @@ export const RunOutputsApiFactory = function (configuration?: Configuration, bas
|
|||
return localVarFp.listRunFiles(id, pageLimit, pageOffset, scope, fromSha, toSha, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
* Returns token counts and billed totals broken down by stage and model for a specific run.
|
||||
* @summary Retrieve Run Billing
|
||||
* Returns token counts and costs broken down by stage and model for a specific run.
|
||||
* @summary Retrieve Run Usage
|
||||
* @param {string} id Unique run identifier (ULID).
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
retrieveRunBilling(id: string, options?: RawAxiosRequestConfig): AxiosPromise<RunBilling> {
|
||||
return localVarFp.retrieveRunBilling(id, options).then((request) => request(axios, basePath));
|
||||
retrieveRunUsage(id: string, options?: RawAxiosRequestConfig): AxiosPromise<RunUsage> {
|
||||
return localVarFp.retrieveRunUsage(id, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
};
|
||||
};
|
||||
|
|
@ -319,14 +319,14 @@ export class RunOutputsApi extends BaseAPI {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns token counts and billed totals broken down by stage and model for a specific run.
|
||||
* @summary Retrieve Run Billing
|
||||
* Returns token counts and costs broken down by stage and model for a specific run.
|
||||
* @summary Retrieve Run Usage
|
||||
* @param {string} id Unique run identifier (ULID).
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
public retrieveRunBilling(id: string, options?: RawAxiosRequestConfig) {
|
||||
return RunOutputsApiFp(this.configuration).retrieveRunBilling(id, options).then((request) => request(this.axios, this.basePath));
|
||||
public retrieveRunUsage(id: string, options?: RawAxiosRequestConfig) {
|
||||
return RunOutputsApiFp(this.configuration).retrieveRunUsage(id, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
122
lib/packages/fabro-api-client/src/api/usage-api.ts
generated
Normal file
122
lib/packages/fabro-api-client/src/api/usage-api.ts
generated
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Fabro Run API
|
||||
* HTTP API for managing Fabro workflow run executions.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.2.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import type { Configuration } from '../configuration';
|
||||
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
|
||||
import globalAxios from 'axios';
|
||||
// Some imports not used depending on template conditions
|
||||
// @ts-ignore
|
||||
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction, replaceWithSerializableTypeIfNeeded } from '../common';
|
||||
// @ts-ignore
|
||||
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
|
||||
// @ts-ignore
|
||||
import type { AggregateUsage } from '../models';
|
||||
/**
|
||||
* UsageApi - axios parameter creator
|
||||
*/
|
||||
export const UsageApiAxiosParamCreator = function (configuration?: Configuration) {
|
||||
return {
|
||||
/**
|
||||
* Returns aggregate token counts and costs across all completed runs since server start.
|
||||
* @summary Aggregate Usage
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
getAggregateUsage: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
const localVarPath = `/api/v1/usage`;
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
|
||||
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication SessionCookie required
|
||||
|
||||
// authentication BearerAuth required
|
||||
// http bearer authentication required
|
||||
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
||||
|
||||
localVarHeaderParameter['Accept'] = 'application/json';
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* UsageApi - functional programming interface
|
||||
*/
|
||||
export const UsageApiFp = function(configuration?: Configuration) {
|
||||
const localVarAxiosParamCreator = UsageApiAxiosParamCreator(configuration)
|
||||
return {
|
||||
/**
|
||||
* Returns aggregate token counts and costs across all completed runs since server start.
|
||||
* @summary Aggregate Usage
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async getAggregateUsage(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AggregateUsage>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.getAggregateUsage(options);
|
||||
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||
const localVarOperationServerBasePath = operationServerMap['UsageApi.getAggregateUsage']?.[localVarOperationServerIndex]?.url;
|
||||
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* UsageApi - factory interface
|
||||
*/
|
||||
export const UsageApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
||||
const localVarFp = UsageApiFp(configuration)
|
||||
return {
|
||||
/**
|
||||
* Returns aggregate token counts and costs across all completed runs since server start.
|
||||
* @summary Aggregate Usage
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
getAggregateUsage(options?: RawAxiosRequestConfig): AxiosPromise<AggregateUsage> {
|
||||
return localVarFp.getAggregateUsage(options).then((request) => request(axios, basePath));
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* UsageApi - object-oriented interface
|
||||
*/
|
||||
export class UsageApi extends BaseAPI {
|
||||
/**
|
||||
* Returns aggregate token counts and costs across all completed runs since server start.
|
||||
* @summary Aggregate Usage
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
public getAggregateUsage(options?: RawAxiosRequestConfig) {
|
||||
return UsageApiFp(this.configuration).getAggregateUsage(options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
}
|
||||
|
|
@ -13,15 +13,15 @@
|
|||
*/
|
||||
|
||||
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { BillingSpeed } from './billing-speed';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { PermissionLevel } from './permission-level';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { ReasoningEffort } from './reasoning-effort';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { Speed } from './speed';
|
||||
|
||||
/**
|
||||
* Properties for the `agent.session.activated` event.
|
||||
|
|
@ -31,7 +31,7 @@ export interface AgentSessionActivatedProps {
|
|||
'provider'?: string | null;
|
||||
'model'?: string | null;
|
||||
'reasoning_effort'?: ReasoningEffort | null;
|
||||
'speed'?: BillingSpeed | null;
|
||||
'speed'?: Speed | null;
|
||||
'permission_level'?: PermissionLevel | null;
|
||||
'capabilities': Array<AgentSessionActivatedPropsCapabilitiesEnum>;
|
||||
'visit': number;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
import type { CompactionReason } from './compaction-reason';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { TokenUsage } from './token-usage';
|
||||
import type { Usage } from './usage';
|
||||
|
||||
/**
|
||||
* One compaction the root session completed.
|
||||
|
|
@ -30,11 +30,7 @@ export interface AgentSessionCompaction {
|
|||
'summary_token_estimate': number;
|
||||
'tracked_file_count': number;
|
||||
/**
|
||||
* The summary call\'s tokens: a breakdown of the session\'s and the prompt\'s usage, which already include them. Zero on compactions recorded before it was kept.
|
||||
* The summary call\'s usage: a breakdown of the session\'s and the prompt\'s usage, which already include it. Zero on compactions recorded before it was kept.
|
||||
*/
|
||||
'usage'?: TokenUsage;
|
||||
/**
|
||||
* The summary call\'s provider-reported cost, included in the totals the same way.
|
||||
*/
|
||||
'cost_usd_micros'?: number;
|
||||
'usage'?: Usage;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { TokenUsage } from './token-usage';
|
||||
import type { Usage } from './usage';
|
||||
|
||||
/**
|
||||
* What one descendant session spent, as its own events reported it.
|
||||
|
|
@ -33,8 +33,7 @@ export interface AgentSessionDescendantAccount {
|
|||
* The model it runs on, from its `SessionStarted`; when the start was not seen, the model of its first answer.
|
||||
*/
|
||||
'model'?: string;
|
||||
'usage': TokenUsage;
|
||||
'cost_usd_micros': number | null;
|
||||
'usage': Usage;
|
||||
/**
|
||||
* Committed assistant messages.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -57,10 +57,10 @@ import type { ContextWindowSnapshot } from './context-window-snapshot';
|
|||
import type { TodoListProjection } from './todo-list-projection';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { TokenUsage } from './token-usage';
|
||||
import type { Usage } from './usage';
|
||||
|
||||
/**
|
||||
* The coding agent\'s fold of one stage\'s event stream: token counts and provider-reported cost for the root session and each descendant, the route and where it moved, the context window, tools, MCP servers, skills, todo lists, subagents, compactions, files touched, and the prompt in progress. Counts only; pricing a count from the catalog is fabro\'s, and lives in `StageProjection.usage`.
|
||||
* The coding agent\'s fold of one stage\'s event stream: token counts and provider-reported cost for the root session and each descendant, the route and where it moved, the context window, tools, MCP servers, skills, todo lists, subagents, compactions, files touched, and the prompt in progress. Its costs are the provider\'s own; pricing from the catalog is fabro\'s, and lives in `StageProjection.usage`.
|
||||
*/
|
||||
export interface AgentSessionProjection {
|
||||
/**
|
||||
|
|
@ -70,13 +70,9 @@ export interface AgentSessionProjection {
|
|||
'route': AgentSessionRoute;
|
||||
'activity': AgentSessionActivity;
|
||||
/**
|
||||
* The root session\'s usage over the stage.
|
||||
* The root session\'s usage over the stage, with the provider\'s reported cost when every answer carried one.
|
||||
*/
|
||||
'usage': TokenUsage;
|
||||
/**
|
||||
* The root session\'s provider-reported cost, when a provider reported one.
|
||||
*/
|
||||
'cost_usd_micros': number | null;
|
||||
'usage': Usage;
|
||||
/**
|
||||
* Committed assistant messages from the root session.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import type { AgentSessionSubagentCounts } from './agent-session-subagent-counts
|
|||
import type { ContextWindowSnapshot } from './context-window-snapshot';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { TokenUsage } from './token-usage';
|
||||
import type { Usage } from './usage';
|
||||
|
||||
/**
|
||||
* What the prompt in progress, or the last one, did: reset when a prompt starts, complete once `completed` is set.
|
||||
|
|
@ -40,8 +40,7 @@ export interface AgentSessionPromptDelta {
|
|||
/**
|
||||
* The root session\'s usage over the prompt.
|
||||
*/
|
||||
'usage': TokenUsage;
|
||||
'cost_usd_micros': number | null;
|
||||
'usage': Usage;
|
||||
/**
|
||||
* Committed assistant messages.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import type { AgentErrorData } from './agent-error-data';
|
|||
import type { FailoverContinuation } from './failover-continuation';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { TokenUsage } from './token-usage';
|
||||
import type { Usage } from './usage';
|
||||
|
||||
/**
|
||||
* One move the root session made to a fallback route, as the stream reported it from the route it moved to.
|
||||
|
|
@ -46,8 +46,7 @@ export interface AgentSessionRouteFailover {
|
|||
/**
|
||||
* What the prompt spent on the failed route. Already in the session\'s and the prompt\'s totals through that route\'s committed answers: a breakdown, not an addition.
|
||||
*/
|
||||
'usage': TokenUsage;
|
||||
'cost_usd_micros'?: number;
|
||||
'usage': Usage;
|
||||
/**
|
||||
* Milliseconds the prompt spent waiting on the failed route\'s model.
|
||||
*/
|
||||
|
|
|
|||
39
lib/packages/fabro-api-client/src/models/aggregate-usage-totals.ts
generated
Normal file
39
lib/packages/fabro-api-client/src/models/aggregate-usage-totals.ts
generated
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Fabro Run API
|
||||
* HTTP API for managing Fabro workflow run executions.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.2.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { RunTiming } from './run-timing';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { Usage } from './usage';
|
||||
|
||||
/**
|
||||
* Aggregate usage totals across all runs.
|
||||
*/
|
||||
export interface AggregateUsageTotals {
|
||||
/**
|
||||
* Total number of completed runs.
|
||||
*/
|
||||
'runs': number;
|
||||
/**
|
||||
* Tokens and cost summed across every completed run.
|
||||
*/
|
||||
'usage': Usage;
|
||||
/**
|
||||
* Aggregate timing rollup across every completed run. Active timing sums work across stage visits, so `active_time_ms` can exceed `wall_time_ms`.
|
||||
*/
|
||||
'timing': RunTiming;
|
||||
}
|
||||
32
lib/packages/fabro-api-client/src/models/aggregate-usage.ts
generated
Normal file
32
lib/packages/fabro-api-client/src/models/aggregate-usage.ts
generated
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Fabro Run API
|
||||
* HTTP API for managing Fabro workflow run executions.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.2.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { AggregateUsageTotals } from './aggregate-usage-totals';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { UsageByModel } from './usage-by-model';
|
||||
|
||||
/**
|
||||
* Aggregate token counts and costs across all runs since server start.
|
||||
*/
|
||||
export interface AggregateUsage {
|
||||
'totals': AggregateUsageTotals;
|
||||
/**
|
||||
* Usage grouped by model.
|
||||
*/
|
||||
'by_model': Array<UsageByModel>;
|
||||
}
|
||||
|
|
@ -18,19 +18,19 @@
|
|||
import type { CompletionContentPart } from './completion-content-part';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { CompletionCost } from './completion-cost';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { CompletionResponseWarningsInner } from './completion-response-warnings-inner';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { CompletionUsage } from './completion-usage';
|
||||
import type { Cost } from './cost';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { ModelHandle } from './model-handle';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { TokenCounts } from './token-counts';
|
||||
|
||||
/**
|
||||
* A lithos `Response`, returned verbatim. The server is the billing authority: `cost` is the catalog estimate or the provider\'s own figure. When the request carried `schema`, `output` holds the parsed object.
|
||||
* A lithos `Response`, returned verbatim. The server prices the response: `cost` is the catalog estimate or the provider\'s own figure. When the request carried `schema`, `output` holds the parsed object.
|
||||
*/
|
||||
export interface CompletionResponse {
|
||||
'output'?: any;
|
||||
|
|
@ -45,8 +45,8 @@ export interface CompletionResponse {
|
|||
* Why generation stopped: stop, length, tool_call, content_filter, error, incomplete, or a provider-specific reason.
|
||||
*/
|
||||
'finish_reason': string;
|
||||
'usage': CompletionUsage;
|
||||
'cost'?: CompletionCost;
|
||||
'usage': TokenCounts;
|
||||
'cost'?: Cost;
|
||||
'rate_limits'?: { [key: string]: any; };
|
||||
'warnings'?: Array<CompletionResponseWarningsInner>;
|
||||
'raw'?: any;
|
||||
|
|
|
|||
|
|
@ -13,9 +13,6 @@
|
|||
*/
|
||||
|
||||
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { BilledTokenCounts } from './billed-token-counts';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { RunDiff } from './run-diff';
|
||||
|
|
@ -31,6 +28,9 @@ import type { StageOutcome } from './stage-outcome';
|
|||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { StageSummary } from './stage-summary';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { Usage } from './usage';
|
||||
|
||||
/**
|
||||
* Terminal run conclusion derived from final workflow execution.
|
||||
|
|
@ -42,7 +42,7 @@ export interface Conclusion {
|
|||
'failure'?: RunFailure | null;
|
||||
'final_git_commit_sha'?: string | null;
|
||||
'stages': Array<StageSummary>;
|
||||
'billing'?: BilledTokenCounts | null;
|
||||
'usage'?: Usage | null;
|
||||
'total_retries': number;
|
||||
'diff': RunDiff;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
|
||||
/**
|
||||
* Where a cost came from: `catalog` (estimated from catalog prices), `provider` (the provider\'s own billing data), or `application`.
|
||||
* Where a cost came from: `catalog` (estimated from catalog prices), `provider` (the provider\'s own reported cost), or `application` (a sum the caller assembled from differently sourced parts).
|
||||
*/
|
||||
|
||||
export const CostSource = {
|
||||
|
|
|
|||
26
lib/packages/fabro-api-client/src/models/cost.ts
generated
Normal file
26
lib/packages/fabro-api-client/src/models/cost.ts
generated
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Fabro Run API
|
||||
* HTTP API for managing Fabro workflow run executions.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.2.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { CostSource } from './cost-source';
|
||||
|
||||
/**
|
||||
* lithos `Cost`: a USD amount in micros and where it came from.
|
||||
*/
|
||||
export interface Cost {
|
||||
'usd_micros': number;
|
||||
'source': CostSource;
|
||||
}
|
||||
|
|
@ -13,9 +13,6 @@
|
|||
*/
|
||||
|
||||
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { BillingSpeed } from './billing-speed';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { CompletionMessage } from './completion-message';
|
||||
|
|
@ -31,6 +28,9 @@ import type { CompletionToolDefinition } from './completion-tool-definition';
|
|||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { ReasoningEffort } from './reasoning-effort';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { Speed } from './speed';
|
||||
|
||||
/**
|
||||
* A lithos `Request` plus `stream`. Field names match the lithos wire form so a serialized lithos request can be posted as-is.
|
||||
|
|
@ -77,7 +77,7 @@ export interface CreateCompletionRequest {
|
|||
/**
|
||||
* Requested speed tier.
|
||||
*/
|
||||
'speed'?: BillingSpeed;
|
||||
'speed'?: Speed;
|
||||
/**
|
||||
* Request tags forwarded to providers that accept them.
|
||||
*/
|
||||
|
|
|
|||
28
lib/packages/fabro-api-client/src/models/index.ts
generated
28
lib/packages/fabro-api-client/src/models/index.ts
generated
|
|
@ -22,8 +22,8 @@ export * from './agent-session-subagent-status-failed';
|
|||
export * from './agent-session-subagent-status-running';
|
||||
export * from './agent-session-tool-activity';
|
||||
export * from './agent-tools-available-props';
|
||||
export * from './aggregate-billing';
|
||||
export * from './aggregate-billing-totals';
|
||||
export * from './aggregate-usage';
|
||||
export * from './aggregate-usage-totals';
|
||||
export * from './api-question';
|
||||
export * from './append-event-response';
|
||||
export * from './approval-mode';
|
||||
|
|
@ -55,12 +55,6 @@ export * from './batch-run-lifecycle-request';
|
|||
export * from './batch-run-lifecycle-response';
|
||||
export * from './batch-run-lifecycle-result';
|
||||
export * from './batch-run-lifecycle-summary';
|
||||
export * from './billed-model-usage';
|
||||
export * from './billed-token-counts';
|
||||
export * from './billing-by-model';
|
||||
export * from './billing-model-ref';
|
||||
export * from './billing-speed';
|
||||
export * from './billing-stage-ref';
|
||||
export * from './blocked-reason';
|
||||
export * from './board-column';
|
||||
export * from './check-run';
|
||||
|
|
@ -72,7 +66,6 @@ export * from './command-log-response';
|
|||
export * from './command-termination';
|
||||
export * from './compaction-reason';
|
||||
export * from './completion-content-part';
|
||||
export * from './completion-cost';
|
||||
export * from './completion-message';
|
||||
export * from './completion-response';
|
||||
export * from './completion-response-format';
|
||||
|
|
@ -80,7 +73,6 @@ export * from './completion-response-warnings-inner';
|
|||
export * from './completion-tool-choice';
|
||||
export * from './completion-tool-definition';
|
||||
export * from './completion-tool-definition-kind';
|
||||
export * from './completion-usage';
|
||||
export * from './conclusion';
|
||||
export * from './context-window-breakdown-item';
|
||||
export * from './context-window-category';
|
||||
|
|
@ -88,6 +80,7 @@ export * from './context-window-count-method';
|
|||
export * from './context-window-snapshot';
|
||||
export * from './context-window-staleness';
|
||||
export * from './context-window-warning';
|
||||
export * from './cost';
|
||||
export * from './cost-source';
|
||||
export * from './create-automation-request';
|
||||
export * from './create-completion-request';
|
||||
|
|
@ -233,6 +226,7 @@ export * from './model-limits';
|
|||
export * from './model-reference';
|
||||
export * from './model-test-mode';
|
||||
export * from './model-test-result';
|
||||
export * from './model-usage';
|
||||
export * from './none-run-target';
|
||||
export * from './notification-provider-settings';
|
||||
export * from './notification-route-settings';
|
||||
|
|
@ -342,10 +336,6 @@ export * from './run-approval';
|
|||
export * from './run-approval-state';
|
||||
export * from './run-artifact-entry';
|
||||
export * from './run-artifact-list-response';
|
||||
export * from './run-billing';
|
||||
export * from './run-billing-stage';
|
||||
export * from './run-billing-summary';
|
||||
export * from './run-billing-totals';
|
||||
export * from './run-branch-settings';
|
||||
export * from './run-checkpoint';
|
||||
export * from './run-checkpoint-settings';
|
||||
|
|
@ -420,6 +410,9 @@ export * from './run-superseded-by-props';
|
|||
export * from './run-target';
|
||||
export * from './run-timestamps';
|
||||
export * from './run-timing';
|
||||
export * from './run-usage';
|
||||
export * from './run-usage-stage';
|
||||
export * from './run-usage-totals';
|
||||
export * from './sandbox-details';
|
||||
export * from './sandbox-file-entry';
|
||||
export * from './sandbox-file-list-response';
|
||||
|
|
@ -470,6 +463,7 @@ export * from './session-turn';
|
|||
export * from './skill-activation-source';
|
||||
export * from './skill-summary';
|
||||
export * from './slack-integration-settings';
|
||||
export * from './speed';
|
||||
export * from './ssh-access-request';
|
||||
export * from './ssh-access-response';
|
||||
export * from './stage-completion';
|
||||
|
|
@ -515,7 +509,7 @@ export * from './todo-list-kind';
|
|||
export * from './todo-list-projection';
|
||||
export * from './todo-projection';
|
||||
export * from './todo-status';
|
||||
export * from './token-usage';
|
||||
export * from './token-counts';
|
||||
export * from './tool-category';
|
||||
export * from './tool-source';
|
||||
export * from './tool-source-application';
|
||||
|
|
@ -526,6 +520,10 @@ export * from './tool-summary';
|
|||
export * from './update-run-parent-request';
|
||||
export * from './update-run-request';
|
||||
export * from './update-variable-request';
|
||||
export * from './usage';
|
||||
export * from './usage-by-model';
|
||||
export * from './usage-model-ref';
|
||||
export * from './usage-stage-ref';
|
||||
export * from './user-response';
|
||||
export * from './validate-response';
|
||||
export * from './variable';
|
||||
|
|
|
|||
29
lib/packages/fabro-api-client/src/models/model-usage.ts
generated
Normal file
29
lib/packages/fabro-api-client/src/models/model-usage.ts
generated
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Fabro Run API
|
||||
* HTTP API for managing Fabro workflow run executions.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.2.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { Usage } from './usage';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { UsageModelRef } from './usage-model-ref';
|
||||
|
||||
/**
|
||||
* Usage grouped under one model: one response, or one model\'s share of a stage.
|
||||
*/
|
||||
export interface ModelUsage {
|
||||
'model': UsageModelRef;
|
||||
'usage': Usage;
|
||||
}
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
|
||||
/**
|
||||
* Run size bucket derived from current best-effort billed usage.
|
||||
* Run size bucket derived from the run\'s current cost.
|
||||
*/
|
||||
|
||||
export const RunSize = {
|
||||
|
|
|
|||
|
|
@ -13,9 +13,6 @@
|
|||
*/
|
||||
|
||||
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { BilledTokenCounts } from './billed-token-counts';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { StageHandler } from './stage-handler';
|
||||
|
|
@ -25,6 +22,9 @@ import type { StageModelUsage } from './stage-model-usage';
|
|||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { StageState } from './stage-state';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { Usage } from './usage';
|
||||
|
||||
/**
|
||||
* A single stage in a run\'s workflow graph.
|
||||
|
|
@ -74,7 +74,7 @@ export interface RunStage {
|
|||
*/
|
||||
'started_at'?: string | null;
|
||||
/**
|
||||
* Token counts for this stage execution alone. `total_usd_micros` is the provider-reported cost when there is one, otherwise the server catalog\'s price for these tokens — the same pricing the `/runs/{id}/billing` rows use. All-zero counts mean the stage made no model calls. Unlike the billing rows, which sum every visit of a node, this covers only this visit.
|
||||
* Usage for this stage execution alone. `cost` is the provider\'s reported cost when there is one, otherwise the server catalog\'s price for these tokens — the same pricing the `/runs/{id}/usage` rows use. All-zero counts mean the stage made no model calls. Unlike the usage rows, which sum every visit of a node, this covers only this visit.
|
||||
*/
|
||||
'billing': BilledTokenCounts;
|
||||
'usage': Usage;
|
||||
}
|
||||
|
|
|
|||
48
lib/packages/fabro-api-client/src/models/run-usage-stage.ts
generated
Normal file
48
lib/packages/fabro-api-client/src/models/run-usage-stage.ts
generated
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Fabro Run API
|
||||
* HTTP API for managing Fabro workflow run executions.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.2.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { StageState } from './stage-state';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { StageTiming } from './stage-timing';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { Usage } from './usage';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { UsageModelRef } from './usage-model-ref';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { UsageStageRef } from './usage-stage-ref';
|
||||
|
||||
/**
|
||||
* Token counts and cost for one workflow node within a run. Rows are grouped by node; usage and timing sum every visit of that node.
|
||||
*/
|
||||
export interface RunUsageStage {
|
||||
'stage': UsageStageRef;
|
||||
'model': UsageModelRef | null;
|
||||
'usage': Usage;
|
||||
/**
|
||||
* Per-node timing summed across every visit. `wall_time_ms` is the sum of visit wall times; the active breakdown sums work timing.
|
||||
*/
|
||||
'timing': StageTiming;
|
||||
/**
|
||||
* Wall-clock time the latest attempt of this stage started, if known.
|
||||
*/
|
||||
'started_at'?: string | null;
|
||||
'state'?: StageState | null;
|
||||
}
|
||||
35
lib/packages/fabro-api-client/src/models/run-usage-totals.ts
generated
Normal file
35
lib/packages/fabro-api-client/src/models/run-usage-totals.ts
generated
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Fabro Run API
|
||||
* HTTP API for managing Fabro workflow run executions.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.2.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { RunTiming } from './run-timing';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { Usage } from './usage';
|
||||
|
||||
/**
|
||||
* Aggregate usage totals across all stages of a run.
|
||||
*/
|
||||
export interface RunUsageTotals {
|
||||
/**
|
||||
* Run-level timing rollup. `wall_time_ms` is summed across stage visits; active timing sums work across visits.
|
||||
*/
|
||||
'timing': RunTiming;
|
||||
/**
|
||||
* Tokens and cost summed across every stage visit. The cost is known only when every visit that used tokens was priced.
|
||||
*/
|
||||
'usage': Usage;
|
||||
}
|
||||
39
lib/packages/fabro-api-client/src/models/run-usage.ts
generated
Normal file
39
lib/packages/fabro-api-client/src/models/run-usage.ts
generated
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Fabro Run API
|
||||
* HTTP API for managing Fabro workflow run executions.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.2.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { RunUsageStage } from './run-usage-stage';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { RunUsageTotals } from './run-usage-totals';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { UsageByModel } from './usage-by-model';
|
||||
|
||||
/**
|
||||
* Complete usage breakdown for a single run.
|
||||
*/
|
||||
export interface RunUsage {
|
||||
/**
|
||||
* Per-node usage breakdown. Each row sums usage and runtime across all visits of that node.
|
||||
*/
|
||||
'stages': Array<RunUsageStage>;
|
||||
'totals': RunUsageTotals;
|
||||
/**
|
||||
* Usage grouped by model.
|
||||
*/
|
||||
'by_model': Array<UsageByModel>;
|
||||
}
|
||||
11
lib/packages/fabro-api-client/src/models/run.ts
generated
11
lib/packages/fabro-api-client/src/models/run.ts
generated
|
|
@ -33,9 +33,6 @@ import type { PullRequestLink } from './pull-request-link';
|
|||
import type { RepositoryRef } from './repository-ref';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { RunBillingSummary } from './run-billing-summary';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { RunLifecycle } from './run-lifecycle';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
|
|
@ -63,6 +60,9 @@ import type { RunTimestamps } from './run-timestamps';
|
|||
import type { RunTiming } from './run-timing';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { Usage } from './usage';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { WorkflowRef } from './workflow-ref';
|
||||
|
||||
/**
|
||||
|
|
@ -92,7 +92,10 @@ export interface Run {
|
|||
'source_directory': string | null;
|
||||
'timestamps': RunTimestamps;
|
||||
'timing': RunTiming | null;
|
||||
'billing': RunBillingSummary | null;
|
||||
/**
|
||||
* The run\'s usage summed across every stage visit so far: the conclusion\'s total once the run ended, else the sum of the stages\'.
|
||||
*/
|
||||
'usage': Usage;
|
||||
'size': RunSize;
|
||||
'ask_fabro': AskFabro;
|
||||
'diff': DiffSummary | null;
|
||||
|
|
|
|||
27
lib/packages/fabro-api-client/src/models/speed.ts
generated
Normal file
27
lib/packages/fabro-api-client/src/models/speed.ts
generated
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Fabro Run API
|
||||
* HTTP API for managing Fabro workflow run executions.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.2.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* lithos `Speed`: the requested latency or cost tier.
|
||||
*/
|
||||
|
||||
export const Speed = {
|
||||
FAST: 'fast',
|
||||
BALANCED: 'balanced',
|
||||
ECONOMICAL: 'economical'
|
||||
} as const;
|
||||
|
||||
export type Speed = typeof Speed[keyof typeof Speed];
|
||||
|
|
@ -15,10 +15,10 @@
|
|||
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { BillingSpeed } from './billing-speed';
|
||||
import type { ReasoningEffort } from './reasoning-effort';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { ReasoningEffort } from './reasoning-effort';
|
||||
import type { Speed } from './speed';
|
||||
|
||||
/**
|
||||
* Provider, model, and request-control metadata recorded for a stage attempt.
|
||||
|
|
@ -31,5 +31,5 @@ export interface StageModelUsage {
|
|||
'provider'?: string | null;
|
||||
'model'?: string | null;
|
||||
'reasoning_effort'?: ReasoningEffort | null;
|
||||
'speed'?: BillingSpeed | null;
|
||||
'speed'?: Speed | null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,18 +18,12 @@
|
|||
import type { AgentSessionProjection } from './agent-session-projection';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { BilledModelUsage } from './billed-model-usage';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { BilledTokenCounts } from './billed-token-counts';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { BillingModelRef } from './billing-model-ref';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { CommandTermination } from './command-termination';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { ModelUsage } from './model-usage';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { ParallelBranchResult } from './parallel-branch-result';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
|
|
@ -55,6 +49,12 @@ import type { StageToolBatchProjection } from './stage-tool-batch-projection';
|
|||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { ToolSummary } from './tool-summary';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { Usage } from './usage';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { UsageModelRef } from './usage-model-ref';
|
||||
|
||||
/**
|
||||
* Observable projection data for one workflow stage execution.
|
||||
|
|
@ -100,8 +100,11 @@ export interface StageProjection {
|
|||
*/
|
||||
'live_tool_ms'?: number;
|
||||
'tool_batch'?: StageToolBatchProjection | null;
|
||||
'usage': BilledTokenCounts;
|
||||
'model'?: BillingModelRef | null;
|
||||
/**
|
||||
* The stage\'s usage: while the stage runs, its agent\'s own accounting of the session tree with whatever cost the provider reported; once it ends, the same tokens with the catalog\'s price where the provider reported none.
|
||||
*/
|
||||
'usage': Usage;
|
||||
'model'?: UsageModelRef | null;
|
||||
'permission_level'?: PermissionLevel | null;
|
||||
/**
|
||||
* Effective model-callable tools exposed to this agent stage session. Tool parameter schemas are intentionally omitted from this projection.
|
||||
|
|
@ -113,9 +116,9 @@ export interface StageProjection {
|
|||
*/
|
||||
'acp_started_at'?: string | null;
|
||||
/**
|
||||
* The completed stage\'s `usage` split by model, as `stage.completed` reported it: the root session\'s route and each subagent\'s own model, a subagent whose model the catalog does not know billed at the root\'s. Sums to `usage`. Empty while the stage runs and for stages without a coding agent; the billing rollup then bills `usage` to `model`.
|
||||
* The completed stage\'s `usage` split by model, as `stage.completed` reported it: the root session\'s route and each subagent\'s own model, a subagent whose model the catalog does not know priced at the root\'s. Sums to `usage`. Empty while the stage runs and for stages without a coding agent; the usage rollup then puts `usage` under `model`.
|
||||
*/
|
||||
'billing_by_model'?: Array<BilledModelUsage>;
|
||||
'usage_by_model'?: Array<ModelUsage>;
|
||||
'agent'?: AgentSessionProjection | null;
|
||||
/**
|
||||
* Lifecycle state of the stage projection.
|
||||
|
|
|
|||
|
|
@ -16,6 +16,9 @@
|
|||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { StageTiming } from './stage-timing';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { Usage } from './usage';
|
||||
|
||||
/**
|
||||
* Terminal summary for one stage in a run conclusion.
|
||||
|
|
@ -24,6 +27,9 @@ export interface StageSummary {
|
|||
'stage_id': string;
|
||||
'stage_label': string;
|
||||
'timing': StageTiming;
|
||||
'billing_usd_micros'?: number | null;
|
||||
/**
|
||||
* Per-node usage summed across every visit of the node.
|
||||
*/
|
||||
'usage': Usage;
|
||||
'retries': number;
|
||||
}
|
||||
|
|
|
|||
41
lib/packages/fabro-api-client/src/models/token-counts.ts
generated
Normal file
41
lib/packages/fabro-api-client/src/models/token-counts.ts
generated
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Fabro Run API
|
||||
* HTTP API for managing Fabro workflow run executions.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.2.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* lithos `TokenCounts`: five disjoint token buckets. Every token is counted in exactly one, so their plain sum is the total. `input` excludes cache reads and writes, while `output` excludes reasoning tokens when the provider reports them separately. A bucket that is absent reads as zero.
|
||||
*/
|
||||
export interface TokenCounts {
|
||||
/**
|
||||
* Prompt tokens that were neither read from nor written to a cache.
|
||||
*/
|
||||
'input'?: number;
|
||||
/**
|
||||
* Completion tokens that are not reasoning tokens.
|
||||
*/
|
||||
'output'?: number;
|
||||
/**
|
||||
* Completion tokens spent on reasoning, priced at the output rate.
|
||||
*/
|
||||
'reasoning'?: number;
|
||||
/**
|
||||
* Prompt tokens served from a provider cache.
|
||||
*/
|
||||
'cache_read'?: number;
|
||||
/**
|
||||
* Prompt tokens written into a provider cache.
|
||||
*/
|
||||
'cache_write'?: number;
|
||||
}
|
||||
33
lib/packages/fabro-api-client/src/models/usage-by-model.ts
generated
Normal file
33
lib/packages/fabro-api-client/src/models/usage-by-model.ts
generated
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Fabro Run API
|
||||
* HTTP API for managing Fabro workflow run executions.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.2.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { Usage } from './usage';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { UsageModelRef } from './usage-model-ref';
|
||||
|
||||
/**
|
||||
* Usage grouped by model.
|
||||
*/
|
||||
export interface UsageByModel {
|
||||
'model': UsageModelRef;
|
||||
/**
|
||||
* Number of usage-bearing stage visits that used this model.
|
||||
*/
|
||||
'stages': number;
|
||||
'usage': Usage;
|
||||
}
|
||||
30
lib/packages/fabro-api-client/src/models/usage-model-ref.ts
generated
Normal file
30
lib/packages/fabro-api-client/src/models/usage-model-ref.ts
generated
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Fabro Run API
|
||||
* HTTP API for managing Fabro workflow run executions.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.2.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { Speed } from './speed';
|
||||
|
||||
/**
|
||||
* Provider-qualified model identity a usage is grouped under. Carries the requested speed tier because providers price tiers differently.
|
||||
*/
|
||||
export interface UsageModelRef {
|
||||
/**
|
||||
* LLM provider identifier.
|
||||
*/
|
||||
'provider': string;
|
||||
'model_id': string;
|
||||
'speed'?: Speed | null;
|
||||
}
|
||||
29
lib/packages/fabro-api-client/src/models/usage-stage-ref.ts
generated
Normal file
29
lib/packages/fabro-api-client/src/models/usage-stage-ref.ts
generated
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Fabro Run API
|
||||
* HTTP API for managing Fabro workflow run executions.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.2.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reference to a workflow node in a usage stage row.
|
||||
*/
|
||||
export interface UsageStageRef {
|
||||
/**
|
||||
* Stage identifier (slug).
|
||||
*/
|
||||
'id': string;
|
||||
/**
|
||||
* Human-readable stage name.
|
||||
*/
|
||||
'name': string;
|
||||
}
|
||||
29
lib/packages/fabro-api-client/src/models/usage.ts
generated
Normal file
29
lib/packages/fabro-api-client/src/models/usage.ts
generated
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Fabro Run API
|
||||
* HTTP API for managing Fabro workflow run executions.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.2.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { Cost } from './cost';
|
||||
// May contain unused imports in some cases
|
||||
// @ts-ignore
|
||||
import type { TokenCounts } from './token-counts';
|
||||
|
||||
/**
|
||||
* lithos `Usage`: token counts and, when known, what they cost. `cost` is absent when there is no cost data, never zero. A sum has a cost only when every part that used tokens was priced; its `source` is the parts\' shared source, or `application` when they differ.
|
||||
*/
|
||||
export interface Usage {
|
||||
'tokens': TokenCounts;
|
||||
'cost'?: Cost;
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue