Files
united-workforce/packages/protocol/src/index.ts
T
xiaoju 99f40c2488
CI / check (pull_request) Successful in 2m28s
feat: add $usage field to adapter protocol
- Add Usage type to protocol (turns, inputTokens, outputTokens, duration)
- Add usage to StepRecord, StepNodePayload, StepEntry, STEP_NODE_SCHEMA
- Thread usage through util-agent extract pipeline (writeStepNode → persistStep → createAgent)
- All adapters return usage: null as placeholder (mock, hermes, claude-code, builtin)
- 746 tests pass, no breaking changes (usage not in schema required array)

Fixes #74
Refs #68
2026-06-04 15:41:07 +00:00

52 lines
908 B
TypeScript

export {
START_NODE_SCHEMA,
STEP_NODE_SCHEMA,
WORKFLOW_SCHEMA,
} from "./schemas.js";
export {
createThreadIndexEntry,
markThreadCompleted,
markThreadSuspended,
normalizeThreadIndexEntry,
parseThreadsIndex,
serializeThreadIndexEntry,
serializeThreadsIndex,
updateThreadHead,
} from "./thread-index.js";
export type {
AgentAlias,
AgentConfig,
CasRef,
GraphPseudoRole,
ModelAlias,
ModelConfig,
ModeratorContext,
ProviderAlias,
ProviderConfig,
RoleDefinition,
RoleName,
RunningThreadItem,
RunningThreadsOutput,
Scenario,
StartEntry,
StartNodePayload,
StartOutput,
StepContext,
StepEntry,
StepNodePayload,
StepOutput,
StepRecord,
Target,
ThreadForkOutput,
ThreadId,
ThreadIndexEntry,
ThreadListItem,
ThreadStatus,
ThreadStepsOutput,
ThreadsIndex,
Usage,
WorkflowConfig,
WorkflowName,
WorkflowPayload,
} from "./types.js";