-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathAgentRun.ts
More file actions
114 lines (103 loc) · 2.41 KB
/
AgentRun.ts
File metadata and controls
114 lines (103 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
import { BaseModel } from "./common";
/**
* Agent run status enum
*/
export type AgentRunStatus =
| "created"
| "in_progress"
| "awaiting"
| "completed"
| "stopping"
| "stopped"
| "failed"
| "stale";
/**
* Agent run type enum
*/
export type AgentRunType = "comment_thread";
/**
* Agent run activity signal enum
*/
export type AgentRunActivitySignal = "auth_request" | "continue" | "select" | "stop";
/**
* Agent run activity type enum
*/
export type AgentRunActivityType = "action" | "elicitation" | "error" | "prompt" | "response" | "thought";
/**
* Agent Run interface
*/
export interface AgentRun extends BaseModel {
agent_user: string;
comment?: string;
source_comment?: string;
creator: string;
stopped_at?: string;
stopped_by?: string;
started_at: string;
ended_at?: string;
external_link?: string;
issue?: string;
workspace: string;
project?: string;
status: AgentRunStatus;
error_metadata?: Record<string, any>;
type: AgentRunType;
}
/**
* Create agent run request interface
*/
export interface CreateAgentRunRequest {
agent_slug: string;
issue?: string;
project?: string;
comment?: string;
source_comment?: string;
external_link?: string;
type?: AgentRunType;
}
/**
* Agent run activity content for action type
*/
export interface AgentRunActivityActionContent {
type: "action";
action: string;
parameters: Record<string, string>;
}
/**
* Agent run activity content for other types
*/
export interface AgentRunActivityTextContent {
type: Exclude<AgentRunActivityType, "action">;
body: string;
}
/**
* Agent run activity content
*/
export type AgentRunActivityContent = AgentRunActivityActionContent | AgentRunActivityTextContent;
/**
* Agent Run Activity interface
*/
export interface AgentRunActivity extends BaseModel {
agent_run: string;
content: AgentRunActivityContent;
content_metadata?: Record<string, any>;
ephemeral: boolean;
signal: AgentRunActivitySignal;
signal_metadata?: Record<string, any>;
comment?: string;
actor?: string;
type: AgentRunActivityType;
project?: string;
workspace: string;
}
/**
* Create agent run activity request interface
*/
export interface CreateAgentRunActivityRequest {
content: AgentRunActivityContent;
content_metadata?: Record<string, any>;
signal?: AgentRunActivitySignal;
signal_metadata?: Record<string, any>;
type: Exclude<AgentRunActivityType, "prompt">;
project?: string;
}