feat(tui): support goal budgets

This commit is contained in:
Felipe Coury
2026-05-02 15:55:16 -03:00
parent 35aaa5d9fc
commit 06bebefbfc
37 changed files with 2138 additions and 53 deletions
@@ -3521,6 +3521,52 @@
],
"type": "object"
},
"ThreadGoalBudgetParams": {
"oneOf": [
{
"properties": {
"token_budget": {
"format": "int64",
"type": "integer"
},
"type": {
"enum": [
"tokens"
],
"title": "TokensThreadGoalBudgetParamsType",
"type": "string"
}
},
"required": [
"token_budget",
"type"
],
"title": "TokensThreadGoalBudgetParams",
"type": "object"
},
{
"properties": {
"percent": {
"format": "double",
"type": "number"
},
"type": {
"enum": [
"fiveHourLimitPercent"
],
"title": "FiveHourLimitPercentThreadGoalBudgetParamsType",
"type": "string"
}
},
"required": [
"percent",
"type"
],
"title": "FiveHourLimitPercentThreadGoalBudgetParams",
"type": "object"
}
]
},
"ThreadGoalStatus": {
"enum": [
"active",
@@ -3045,6 +3045,16 @@
},
"ThreadGoal": {
"properties": {
"budget": {
"anyOf": [
{
"$ref": "#/definitions/ThreadGoalBudget"
},
{
"type": "null"
}
]
},
"createdAt": {
"format": "int64",
"type": "integer"
@@ -3089,6 +3099,80 @@
],
"type": "object"
},
"ThreadGoalBudget": {
"oneOf": [
{
"properties": {
"token_budget": {
"format": "int64",
"type": "integer"
},
"type": {
"enum": [
"tokens"
],
"title": "TokensThreadGoalBudgetType",
"type": "string"
}
},
"required": [
"token_budget",
"type"
],
"title": "TokensThreadGoalBudget",
"type": "object"
},
{
"properties": {
"baseline_resets_at": {
"format": "int64",
"type": [
"integer",
"null"
]
},
"baseline_used_percent": {
"format": "double",
"type": "number"
},
"latest_resets_at": {
"format": "int64",
"type": [
"integer",
"null"
]
},
"latest_used_percent": {
"format": "double",
"type": "number"
},
"limit_id": {
"type": "string"
},
"percent": {
"format": "double",
"type": "number"
},
"type": {
"enum": [
"fiveHourLimitPercent"
],
"title": "FiveHourLimitPercentThreadGoalBudgetType",
"type": "string"
}
},
"required": [
"baseline_used_percent",
"latest_used_percent",
"limit_id",
"percent",
"type"
],
"title": "FiveHourLimitPercentThreadGoalBudget",
"type": "object"
}
]
},
"ThreadGoalClearedNotification": {
"properties": {
"threadId": {
@@ -15265,6 +15265,16 @@
},
"ThreadGoal": {
"properties": {
"budget": {
"anyOf": [
{
"$ref": "#/definitions/v2/ThreadGoalBudget"
},
{
"type": "null"
}
]
},
"createdAt": {
"format": "int64",
"type": "integer"
@@ -15309,6 +15319,126 @@
],
"type": "object"
},
"ThreadGoalBudget": {
"oneOf": [
{
"properties": {
"token_budget": {
"format": "int64",
"type": "integer"
},
"type": {
"enum": [
"tokens"
],
"title": "TokensThreadGoalBudgetType",
"type": "string"
}
},
"required": [
"token_budget",
"type"
],
"title": "TokensThreadGoalBudget",
"type": "object"
},
{
"properties": {
"baseline_resets_at": {
"format": "int64",
"type": [
"integer",
"null"
]
},
"baseline_used_percent": {
"format": "double",
"type": "number"
},
"latest_resets_at": {
"format": "int64",
"type": [
"integer",
"null"
]
},
"latest_used_percent": {
"format": "double",
"type": "number"
},
"limit_id": {
"type": "string"
},
"percent": {
"format": "double",
"type": "number"
},
"type": {
"enum": [
"fiveHourLimitPercent"
],
"title": "FiveHourLimitPercentThreadGoalBudgetType",
"type": "string"
}
},
"required": [
"baseline_used_percent",
"latest_used_percent",
"limit_id",
"percent",
"type"
],
"title": "FiveHourLimitPercentThreadGoalBudget",
"type": "object"
}
]
},
"ThreadGoalBudgetParams": {
"oneOf": [
{
"properties": {
"token_budget": {
"format": "int64",
"type": "integer"
},
"type": {
"enum": [
"tokens"
],
"title": "TokensThreadGoalBudgetParamsType",
"type": "string"
}
},
"required": [
"token_budget",
"type"
],
"title": "TokensThreadGoalBudgetParams",
"type": "object"
},
{
"properties": {
"percent": {
"format": "double",
"type": "number"
},
"type": {
"enum": [
"fiveHourLimitPercent"
],
"title": "FiveHourLimitPercentThreadGoalBudgetParamsType",
"type": "string"
}
},
"required": [
"percent",
"type"
],
"title": "FiveHourLimitPercentThreadGoalBudgetParams",
"type": "object"
}
]
},
"ThreadGoalClearedNotification": {
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
@@ -13151,6 +13151,16 @@
},
"ThreadGoal": {
"properties": {
"budget": {
"anyOf": [
{
"$ref": "#/definitions/ThreadGoalBudget"
},
{
"type": "null"
}
]
},
"createdAt": {
"format": "int64",
"type": "integer"
@@ -13195,6 +13205,126 @@
],
"type": "object"
},
"ThreadGoalBudget": {
"oneOf": [
{
"properties": {
"token_budget": {
"format": "int64",
"type": "integer"
},
"type": {
"enum": [
"tokens"
],
"title": "TokensThreadGoalBudgetType",
"type": "string"
}
},
"required": [
"token_budget",
"type"
],
"title": "TokensThreadGoalBudget",
"type": "object"
},
{
"properties": {
"baseline_resets_at": {
"format": "int64",
"type": [
"integer",
"null"
]
},
"baseline_used_percent": {
"format": "double",
"type": "number"
},
"latest_resets_at": {
"format": "int64",
"type": [
"integer",
"null"
]
},
"latest_used_percent": {
"format": "double",
"type": "number"
},
"limit_id": {
"type": "string"
},
"percent": {
"format": "double",
"type": "number"
},
"type": {
"enum": [
"fiveHourLimitPercent"
],
"title": "FiveHourLimitPercentThreadGoalBudgetType",
"type": "string"
}
},
"required": [
"baseline_used_percent",
"latest_used_percent",
"limit_id",
"percent",
"type"
],
"title": "FiveHourLimitPercentThreadGoalBudget",
"type": "object"
}
]
},
"ThreadGoalBudgetParams": {
"oneOf": [
{
"properties": {
"token_budget": {
"format": "int64",
"type": "integer"
},
"type": {
"enum": [
"tokens"
],
"title": "TokensThreadGoalBudgetParamsType",
"type": "string"
}
},
"required": [
"token_budget",
"type"
],
"title": "TokensThreadGoalBudgetParams",
"type": "object"
},
{
"properties": {
"percent": {
"format": "double",
"type": "number"
},
"type": {
"enum": [
"fiveHourLimitPercent"
],
"title": "FiveHourLimitPercentThreadGoalBudgetParamsType",
"type": "string"
}
},
"required": [
"percent",
"type"
],
"title": "FiveHourLimitPercentThreadGoalBudgetParams",
"type": "object"
}
]
},
"ThreadGoalClearedNotification": {
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
@@ -3,6 +3,16 @@
"definitions": {
"ThreadGoal": {
"properties": {
"budget": {
"anyOf": [
{
"$ref": "#/definitions/ThreadGoalBudget"
},
{
"type": "null"
}
]
},
"createdAt": {
"format": "int64",
"type": "integer"
@@ -47,6 +57,80 @@
],
"type": "object"
},
"ThreadGoalBudget": {
"oneOf": [
{
"properties": {
"token_budget": {
"format": "int64",
"type": "integer"
},
"type": {
"enum": [
"tokens"
],
"title": "TokensThreadGoalBudgetType",
"type": "string"
}
},
"required": [
"token_budget",
"type"
],
"title": "TokensThreadGoalBudget",
"type": "object"
},
{
"properties": {
"baseline_resets_at": {
"format": "int64",
"type": [
"integer",
"null"
]
},
"baseline_used_percent": {
"format": "double",
"type": "number"
},
"latest_resets_at": {
"format": "int64",
"type": [
"integer",
"null"
]
},
"latest_used_percent": {
"format": "double",
"type": "number"
},
"limit_id": {
"type": "string"
},
"percent": {
"format": "double",
"type": "number"
},
"type": {
"enum": [
"fiveHourLimitPercent"
],
"title": "FiveHourLimitPercentThreadGoalBudgetType",
"type": "string"
}
},
"required": [
"baseline_used_percent",
"latest_used_percent",
"limit_id",
"percent",
"type"
],
"title": "FiveHourLimitPercentThreadGoalBudget",
"type": "object"
}
]
},
"ThreadGoalStatus": {
"enum": [
"active",
@@ -3,4 +3,4 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { ThreadGoalStatus } from "./ThreadGoalStatus";
export type ThreadGoal = { threadId: string, objective: string, status: ThreadGoalStatus, tokenBudget: number | null, tokensUsed: number, timeUsedSeconds: number, createdAt: number, updatedAt: number, };
export type ThreadGoal = { threadId: string, objective: string, status: ThreadGoalStatus, budget: ThreadGoalBudget | null, tokenBudget: number | null, tokensUsed: number, timeUsedSeconds: number, createdAt: number, updatedAt: number, };