-
Notifications
You must be signed in to change notification settings - Fork 3
WIP: Trajectory format #457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
50f09a1
be7e3b2
c2fc83a
9ef0483
234d756
3b70bce
ec2c221
5bdc168
337147c
e12246e
e4a55a5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. | ||
| import type { UserContent } from "./UserContent"; | ||
|
|
||
| export type Agent = { name?: string, version?: string, metadata: Record<string, unknown>, instructions?: UserContent, }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. | ||
| import type { AssistantContent } from "./AssistantContent"; | ||
| import type { UniversalUsage } from "./UniversalUsage"; | ||
|
|
||
| export type AgentResponse = { response?: AssistantContent, usage?: UniversalUsage, start_time?: string, end_time?: string, }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. | ||
|
|
||
| export type Compaction = { id: string, replaced_message_count?: number, }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. | ||
|
|
||
| export type EvidenceField = "input" | "output" | "error"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. | ||
|
|
||
| export type EvidencePart = "reasoning" | "arguments"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. | ||
| import type { FindingEvidence } from "./FindingEvidence"; | ||
| import type { FindingSeverity } from "./FindingSeverity"; | ||
|
|
||
| export type Finding = { title?: string, severity?: FindingSeverity, kind?: string, hypothesis?: string, root_cause?: string, next_steps?: Array<string>, evidence?: Array<FindingEvidence>, pattern_id?: string, }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. | ||
| import type { EvidenceField } from "./EvidenceField"; | ||
| import type { EvidencePart } from "./EvidencePart"; | ||
|
|
||
| export type FindingEvidence = { step_id: string, field?: EvidenceField, part?: EvidencePart, explanation?: string, quote?: string, highlight_terms?: Array<string>, leading_text?: string, trailing_text?: string, }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. | ||
|
|
||
| export type FindingSeverity = "critical" | "high" | "medium" | "low"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. | ||
| import type { ModalityTokenCount } from "./ModalityTokenCount"; | ||
| import type { TokenBreakdown } from "./TokenBreakdown"; | ||
|
|
||
| /** | ||
| * Detailed subsets of inclusive prompt/input usage. | ||
| */ | ||
| export type InputTokenDetails = { | ||
| /** | ||
| * User/request content tokens by modality. Provider-generated tool prompts are separate. | ||
| */ | ||
| content_by_modality?: Array<ModalityTokenCount>, | ||
| /** | ||
| * Cache-read tokens, which are included in `UniversalUsage::prompt_tokens`. | ||
| */ | ||
| cached?: TokenBreakdown, | ||
| /** | ||
| * Cache-write tokens, which are included in `UniversalUsage::prompt_tokens` when reported. | ||
| */ | ||
| cache_creation?: TokenBreakdown, | ||
| /** | ||
| * Provider-generated tool prompt tokens included in `UniversalUsage::prompt_tokens`. | ||
| */ | ||
| tool_prompt?: TokenBreakdown, }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. | ||
| import type { Message } from "./Message"; | ||
| import type { UniversalParams } from "./UniversalParams"; | ||
| import type { UniversalUsage } from "./UniversalUsage"; | ||
|
|
||
| export type LLMAnalysis = { work?: Array<Message>, model?: string, params?: UniversalParams, usage?: UniversalUsage, }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. | ||
| import type { TokenModality } from "./TokenModality"; | ||
|
|
||
| /** | ||
| * Token count for one modality. | ||
| */ | ||
| export type ModalityTokenCount = { modality?: TokenModality, token_count?: number, }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. | ||
| import type { ModalityTokenCount } from "./ModalityTokenCount"; | ||
| import type { TokenBreakdown } from "./TokenBreakdown"; | ||
|
|
||
| /** | ||
| * Detailed subsets of inclusive completion/output usage. | ||
| */ | ||
| export type OutputTokenDetails = { | ||
| /** | ||
| * Returned candidate content tokens by modality. Reasoning tokens are separate. | ||
| */ | ||
| content_by_modality?: Array<ModalityTokenCount>, | ||
| /** | ||
| * Reasoning/thinking tokens included in `UniversalUsage::completion_tokens`. | ||
| */ | ||
| reasoning?: TokenBreakdown, }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. | ||
|
|
||
| export type Scope = { "type": "span", id: string, } | { "type": "trace", trace_id: string, } | { "type": "thread", key: string, value: string, }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. | ||
|
|
||
| export type Section = { name: string, description: string, step_ids: Array<string>, }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. | ||
| import type { ModalityTokenCount } from "./ModalityTokenCount"; | ||
|
|
||
| /** | ||
| * A token subset with an optional modality breakdown. | ||
| */ | ||
| export type TokenBreakdown = { total_tokens?: number, by_modality?: Array<ModalityTokenCount>, }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. | ||
|
|
||
| /** | ||
| * A provider-independent token modality. | ||
| */ | ||
| export type TokenModality = "unspecified" | "text" | "image" | "audio" | "video" | "document"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. | ||
| import type { ToolContentPart } from "./ToolContentPart"; | ||
|
|
||
| export type ToolResult = { input?: unknown, content?: Array<ToolContentPart>, }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. | ||
| import type { Agent } from "./Agent"; | ||
| import type { Finding } from "./Finding"; | ||
| import type { Scope } from "./Scope"; | ||
| import type { Section } from "./Section"; | ||
| import type { Turn } from "./Turn"; | ||
|
|
||
| export type Trajectory = { scope: Array<Scope>, agent: Agent, sections?: Array<Section>, findings?: Array<Finding>, turns: Array<Turn>, metadata: Record<string, unknown>, version?: string, }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. | ||
| import type { AgentResponse } from "./AgentResponse"; | ||
| import type { Compaction } from "./Compaction"; | ||
| import type { Message } from "./Message"; | ||
| import type { UniversalParams } from "./UniversalParams"; | ||
| import type { WorkStep } from "./WorkStep"; | ||
|
|
||
| export type Turn = { request_id: string, response_id?: string, request?: Array<Message>, response?: AgentResponse, work: Array<WorkStep>, model?: string, params?: UniversalParams, start_time: string, end_time?: string, interrupted?: boolean, compaction?: Compaction, }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. | ||
| import type { InputTokenDetails } from "./InputTokenDetails"; | ||
| import type { OutputTokenDetails } from "./OutputTokenDetails"; | ||
|
|
||
| /** | ||
| * Token usage statistics. | ||
| */ | ||
| export type UniversalUsage = { | ||
| /** | ||
| * Tokens in the prompt/input, including provider-generated tool prompts when reported. | ||
| */ | ||
| prompt_tokens?: number, | ||
| /** | ||
| * Tokens in the completion/output | ||
| */ | ||
| completion_tokens?: number, | ||
| /** | ||
| * Total tokens. Preserves a provider-reported value or falls back to prompt plus completion. | ||
| */ | ||
| total_tokens?: number, | ||
| /** | ||
| * Cached tokens in the prompt (from prompt caching) | ||
| */ | ||
| prompt_cached_tokens?: number, | ||
| /** | ||
| * Tokens written to cache during this request | ||
| */ | ||
| prompt_cache_creation_tokens?: number, | ||
| /** | ||
| * Tokens written to the 5-minute-TTL cache (Anthropic split cache writes) | ||
| */ | ||
| prompt_cache_creation_5m_tokens?: number, | ||
| /** | ||
| * Tokens written to the 1-hour-TTL cache (Anthropic split cache writes) | ||
| */ | ||
| prompt_cache_creation_1h_tokens?: number, | ||
| /** | ||
| * True when `prompt_tokens` excludes the cache read/creation buckets. | ||
| * Anthropic-style usage reports `input_tokens` exclusive of cache | ||
| * tokens, while OpenAI-style usage reports `prompt_tokens` inclusive of | ||
| * them. Consumers that want an OpenAI-style inclusive prompt total must | ||
| * add the cache buckets back when this is set; see | ||
| * [`UniversalUsage::inclusive_prompt_tokens`]. Consumers that want an | ||
| * Anthropic-style exclusive input count must subtract the cache buckets | ||
| * when this is not set; see [`UniversalUsage::exclusive_prompt_tokens`]. | ||
| */ | ||
| prompt_tokens_exclude_cache?: boolean, | ||
| /** | ||
| * Reasoning/thinking tokens used in the completion. | ||
| * `Some(n)` only when `n > 0`; otherwise `None`. | ||
| */ | ||
| completion_reasoning_tokens?: number, | ||
| /** | ||
| * Detailed prompt/input token subsets and modality breakdowns. | ||
| */ | ||
| input_details?: InputTokenDetails, | ||
| /** | ||
| * Detailed completion/output token subsets and modality breakdowns. | ||
| */ | ||
| output_details?: OutputTokenDetails, }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. | ||
| import type { AgentResponse } from "./AgentResponse"; | ||
| import type { LLMAnalysis } from "./LLMAnalysis"; | ||
| import type { ToolResult } from "./ToolResult"; | ||
|
|
||
| export type Work = { "type": "agent_response" } & AgentResponse | { "type": "tool_result" } & ToolResult | { "type": "llm_analysis" } & LLMAnalysis; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. | ||
| import type { Trajectory } from "./Trajectory"; | ||
| import type { Work } from "./Work"; | ||
|
|
||
| export type WorkStep = { id: string, span_type: string, name?: string, error?: unknown, start_time: string, end_time?: string, work: Work, sub_agent?: Trajectory, }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,7 @@ pub mod response_format; | |
| pub mod stream; | ||
| pub mod tool_choice; | ||
| pub mod tools; | ||
| pub mod trajectory; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When Rust consumers import universal types through the established public API, AGENTS.md reference: AGENTS.md:L42-L50 Useful? React with 👍 / 👎. |
||
| pub mod transform; | ||
|
|
||
| // Re-export main types for convenience | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the package export map exposes only the root barrel, exporting just these five types leaves most of the newly generated public schema—such as
Scope,Agent,Finding,FindingEvidence,Work,ToolResult,LLMAnalysis, and the token-detail types—unimportable by TypeScript consumers. This affects consumers as soon as they need a helper accepting one of these nested types or want to switch directly on theWorkunion; re-export the complete public trajectory type graph from this barrel.AGENTS.md reference: AGENTS.md:L11-L14
Useful? React with 👍 / 👎.