Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
361 lines
8.7 KiB
Go
361 lines
8.7 KiB
Go
package workspaceissues
|
|
|
|
type Status string
|
|
|
|
const (
|
|
StatusNotStarted Status = "not_started"
|
|
StatusRunning Status = "running"
|
|
StatusPendingAcceptance Status = "pending_acceptance"
|
|
StatusCompleted Status = "completed"
|
|
StatusFailed Status = "failed"
|
|
StatusCanceled Status = "canceled"
|
|
)
|
|
|
|
type Priority string
|
|
|
|
const (
|
|
PriorityHigh Priority = "high"
|
|
PriorityMedium Priority = "medium"
|
|
PriorityLow Priority = "low"
|
|
)
|
|
|
|
type PlanningSource string
|
|
|
|
const (
|
|
PlanningSourceManual PlanningSource = "manual"
|
|
PlanningSourceTuttiModePlan PlanningSource = "tutti_mode_plan"
|
|
PlanningSourceTraditionalPlan PlanningSource = "traditional_plan"
|
|
)
|
|
|
|
type BudgetMode string
|
|
|
|
const (
|
|
BudgetModeAuto BudgetMode = "auto"
|
|
BudgetModeFixed BudgetMode = "fixed"
|
|
)
|
|
|
|
type BudgetStatus string
|
|
|
|
const (
|
|
BudgetStatusActive BudgetStatus = "active"
|
|
BudgetStatusSoftLimited BudgetStatus = "soft_limited"
|
|
)
|
|
|
|
type AcceptanceState string
|
|
|
|
const (
|
|
AcceptanceAgentClaimed AcceptanceState = "agent_claimed"
|
|
AcceptanceAutoChecked AcceptanceState = "auto_checked"
|
|
AcceptanceUserAccepted AcceptanceState = "user_accepted"
|
|
)
|
|
|
|
type ExecutionProfile struct {
|
|
ReasoningIntensity int
|
|
OrchestrationIntensity int
|
|
}
|
|
|
|
type Budget struct {
|
|
Mode BudgetMode
|
|
TokenLimit int64
|
|
ConsumedTokens int64
|
|
QuotaWaterlinePercent float64
|
|
RemainingQuotaPercent float64
|
|
HasRemainingQuota bool
|
|
Status BudgetStatus
|
|
}
|
|
|
|
type TokenUsage struct {
|
|
InputTokens int64
|
|
OutputTokens int64
|
|
CacheReadTokens int64
|
|
CacheWriteTokens int64
|
|
}
|
|
|
|
func (u TokenUsage) Total() int64 {
|
|
return u.InputTokens + u.OutputTokens + u.CacheReadTokens + u.CacheWriteTokens
|
|
}
|
|
|
|
type Cost struct {
|
|
Currency string
|
|
EstimatedMicros int64
|
|
ActualMicros int64
|
|
}
|
|
|
|
type ContextRefParentKind string
|
|
|
|
const (
|
|
ContextRefParentIssue ContextRefParentKind = "issue"
|
|
ContextRefParentTask ContextRefParentKind = "task"
|
|
)
|
|
|
|
const DefaultTopicID = "default"
|
|
|
|
type Topic struct {
|
|
ID uint64
|
|
TopicID string
|
|
WorkspaceID string
|
|
Title string
|
|
Summary string
|
|
IsDefault bool
|
|
PinnedAtUnixMS int64
|
|
LastActivityAtUnixMS int64
|
|
CreatedAtUnixMS int64
|
|
UpdatedAtUnixMS int64
|
|
}
|
|
|
|
type Issue struct {
|
|
ID uint64
|
|
IssueID string
|
|
TopicID string
|
|
WorkspaceID string
|
|
Title string
|
|
Content string
|
|
SearchText string
|
|
Status Status
|
|
TaskCount int
|
|
NotStartedCount int
|
|
RunningCount int
|
|
PendingAcceptanceCount int
|
|
CompletedCount int
|
|
FailedCount int
|
|
CanceledCount int
|
|
CreatorUserID string
|
|
CreatorDisplayName string
|
|
CreatorAvatarURL string
|
|
PlanningSource PlanningSource
|
|
SourceSessionID string
|
|
SequentialExecution bool
|
|
ParallelExecution bool
|
|
DispatchPaused bool
|
|
ExecutionProfile ExecutionProfile
|
|
Budget Budget
|
|
CreatedAtUnixMS int64
|
|
UpdatedAtUnixMS int64
|
|
}
|
|
|
|
type Task struct {
|
|
ID uint64
|
|
TaskID string
|
|
IssueID string
|
|
WorkspaceID string
|
|
Title string
|
|
Content string
|
|
SearchText string
|
|
Status Status
|
|
Priority Priority
|
|
SortIndex int
|
|
DueAtUnixMS int64
|
|
CreatorUserID string
|
|
CreatorDisplayName string
|
|
CreatorAvatarURL string
|
|
LatestRunID string
|
|
AgentTargetID string
|
|
ModelPlanID string
|
|
Model string
|
|
// PermissionModeID and ReasoningEffort are task-level launch overrides
|
|
// recorded from the Tutti Mode plan review. Empty inherits the target's
|
|
// composer default (permission mode) or the Issue-level reasoning
|
|
// intensity compilation (reasoning effort).
|
|
PermissionModeID string
|
|
ReasoningEffort string
|
|
ExecutionDirectory string
|
|
DependencyTaskIDs []string
|
|
// Parallelizable marks a task that may run alongside other ready tasks
|
|
// even when the Issue executes sequentially. False keeps the sequential
|
|
// default: the task waits for its predecessors in sort order.
|
|
Parallelizable bool
|
|
// AutoAccept bypasses the human acceptance gate: a successful run
|
|
// completion is accepted automatically and dispatch advances. False keeps
|
|
// the default pending-acceptance stop.
|
|
AutoAccept bool
|
|
AcceptanceState AcceptanceState
|
|
AcceptanceSummary string
|
|
// SupersededAtUnixMS logically removes an obsolete task from the active
|
|
// graph without deleting its Runs, outputs, or audit history.
|
|
SupersededAtUnixMS int64
|
|
SupersededByTaskID string
|
|
CreatedAtUnixMS int64
|
|
UpdatedAtUnixMS int64
|
|
}
|
|
|
|
func (task Task) IsSuperseded() bool {
|
|
return task.SupersededAtUnixMS > 0
|
|
}
|
|
|
|
type Run struct {
|
|
ID uint64
|
|
RunID string
|
|
TaskID string
|
|
IssueID string
|
|
WorkspaceID string
|
|
RequesterUserID string
|
|
AgentUserID string
|
|
AgentTargetID string
|
|
AgentSessionID string
|
|
AgentProvider string
|
|
ModelPlanID string
|
|
Model string
|
|
ReasoningIntensity int
|
|
Status Status
|
|
Usage TokenUsage
|
|
Summary string
|
|
ErrorMessage string
|
|
OutputDir string
|
|
ExecutionDirectory string
|
|
CreatedAtUnixMS int64
|
|
StartedAtUnixMS int64
|
|
CompletedAtUnixMS int64
|
|
UpdatedAtUnixMS int64
|
|
}
|
|
|
|
// PreparedRunLaunch is the transport-neutral durable identity needed to
|
|
// recover an external Run delivery without creating a second Agent turn.
|
|
type PreparedRunLaunch struct {
|
|
Run Run
|
|
ClientSubmitID string
|
|
// OpaquePayload is owned and decoded by the host adapter that admitted the
|
|
// external delivery. The reusable Issue core never interprets host paths or
|
|
// provider-preparation details stored in it.
|
|
OpaquePayload string
|
|
}
|
|
|
|
type RunLaunchSettlement struct {
|
|
WorkspaceID string
|
|
IssueID string
|
|
RunID string
|
|
LeaseOwner string
|
|
Status Status
|
|
ErrorMessage string
|
|
NowUnixMS int64
|
|
}
|
|
|
|
type RunOutput struct {
|
|
ID uint64
|
|
OutputID string
|
|
RunID string
|
|
TaskID string
|
|
IssueID string
|
|
WorkspaceID string
|
|
Path string
|
|
DisplayName string
|
|
MediaType string
|
|
SizeBytes int64
|
|
CreatedAtUnixMS int64
|
|
}
|
|
|
|
// RunOutputSearchParams scopes a workspace-wide search over produced output files.
|
|
// Query matches output file display names. IssueID and TopicID are optional
|
|
// scopes; IssueID takes precedence when both are set.
|
|
type RunOutputSearchParams struct {
|
|
WorkspaceID string
|
|
Query string
|
|
// Filters 为已选「文件类型筛选分类」id(全局统一口径)。筛选与搜索是同一能力:
|
|
// Query 可空、Filters 非空时即按类型查。空 = 不按类型过滤。
|
|
Filters []string
|
|
IssueID string
|
|
TopicID string
|
|
Limit int
|
|
}
|
|
|
|
// RunOutputSearchHit is one matched output file annotated with its owning issue
|
|
// title, used as the search-result subtitle.
|
|
type RunOutputSearchHit struct {
|
|
Output RunOutput
|
|
IssueTitle string
|
|
}
|
|
|
|
type ContextRef struct {
|
|
ID uint64
|
|
ContextRefID string
|
|
WorkspaceID string
|
|
IssueID string
|
|
TaskID string
|
|
ParentKind ContextRefParentKind
|
|
RefType string
|
|
Path string
|
|
DisplayName string
|
|
CreatedAtUnixMS int64
|
|
}
|
|
|
|
type StatusCounts struct {
|
|
All int
|
|
NotStarted int
|
|
Running int
|
|
PendingAcceptance int
|
|
Completed int
|
|
Failed int
|
|
Canceled int
|
|
}
|
|
|
|
type IssueListCursor struct {
|
|
UpdatedAtUnixMS int64
|
|
ID uint64
|
|
}
|
|
|
|
type IssueListFilter struct {
|
|
WorkspaceID string
|
|
TopicID string
|
|
PageSize int
|
|
Cursor *IssueListCursor
|
|
StatusFilter Status
|
|
SearchQuery string
|
|
ReturnAll bool
|
|
}
|
|
|
|
type IssueList struct {
|
|
Items []Issue
|
|
NextCursor *IssueListCursor
|
|
NextPageToken string
|
|
TotalCount int
|
|
StatusCounts StatusCounts
|
|
}
|
|
|
|
type TopicList struct {
|
|
Items []Topic
|
|
}
|
|
|
|
type TaskListCursor struct {
|
|
SortIndex int
|
|
ID uint64
|
|
}
|
|
|
|
type TaskListFilter struct {
|
|
WorkspaceID string
|
|
IssueID string
|
|
PageSize int
|
|
Cursor *TaskListCursor
|
|
StatusFilter Status
|
|
SearchQuery string
|
|
ReturnAll bool
|
|
}
|
|
|
|
type TaskList struct {
|
|
Items []Task
|
|
NextCursor *TaskListCursor
|
|
NextPageToken string
|
|
TotalCount int
|
|
StatusCounts StatusCounts
|
|
}
|
|
|
|
type IssueDetail struct {
|
|
Issue Issue
|
|
Tasks []Task
|
|
ContextRefs []ContextRef
|
|
LatestRun *Run
|
|
RecentRuns []Run
|
|
LatestOutputs []RunOutput
|
|
}
|
|
|
|
type TaskDetail struct {
|
|
Task Task
|
|
ContextRefs []ContextRef
|
|
LatestRun *Run
|
|
RecentRuns []Run
|
|
LatestOutputs []RunOutput
|
|
}
|
|
|
|
type RunDetail struct {
|
|
Run Run
|
|
Outputs []RunOutput
|
|
}
|