feat(agent): add output routes to Agent v2 (#42599)

Co-authored-by: zhsama <torvalds@linux.do>
This commit is contained in:
盐粒 Yanliandzhsama authored and GitHub committed 2026-09-22 21:28:07 +00:00
1 parent a068c47ea9
commit 0f6a6227f5
114 files changed
+2888 -536

No files matched your search

@@ -639,6 +639,7 @@ export type WorkflowNodeJobConfig = {
human_contacts?: Array<AgentHumanContactConfig>
metadata?: WorkflowNodeJobMetadata
mode?: WorkflowNodeJobMode
output_routes?: WorkflowOutputRoutes
previous_node_output_refs?: Array<WorkflowPreviousNodeOutputRef>
schema_version?: number
workflow_prompt?: string
@@ -1161,6 +1162,11 @@ export type WorkflowNodeJobMetadata = {
export type WorkflowNodeJobMode = 'let_agent_figure_it_out' | 'tell_agent_what_to_do'
export type WorkflowOutputRoutes = {
enabled?: boolean
routes?: Array<WorkflowOutputRoute>
}
export type WorkflowPreviousNodeOutputRef = {
key?: string | null
name?: string | null
@@ -1524,6 +1530,12 @@ export type AgentFileRefConfig = {
[key: string]: unknown
}
export type WorkflowOutputRoute = {
id: string
label?: string | null
name?: string
}
export type AgentCliToolAuthorizationStatus =
| 'allowed'
| 'authorized'
@@ -1580,6 +1580,27 @@ export const zWorkflowNodeJobMetadata = z.object({
file_refs: z.array(zAgentFileRefConfig).nullish(),
})
/**
* WorkflowOutputRoute
*
* Stable workflow exit identity and its model-visible selection condition.
*/
export const zWorkflowOutputRoute = z.object({
id: z.string().min(1),
label: z.string().nullish(),
name: z.string().optional().default(''),
})
/**
* WorkflowOutputRoutes
*
* Enabled routes require at least two exits; drafts may omit conditions.
*/
export const zWorkflowOutputRoutes = z.object({
enabled: z.boolean().optional().default(false),
routes: z.array(zWorkflowOutputRoute).optional(),
})
/**
* AgentCliToolAuthorizationStatus
*
@@ -2059,6 +2080,7 @@ export const zWorkflowNodeJobConfig = z.object({
human_contacts: z.array(zAgentHumanContactConfig).optional(),
metadata: zWorkflowNodeJobMetadata.optional(),
mode: zWorkflowNodeJobMode.optional().default('tell_agent_what_to_do'),
output_routes: zWorkflowOutputRoutes.optional(),
previous_node_output_refs: z.array(zWorkflowPreviousNodeOutputRef).optional(),
schema_version: z.int().optional().default(1),
workflow_prompt: z.string().optional().default(''),
@@ -1959,6 +1959,7 @@ export type WorkflowNodeJobConfig = {
human_contacts?: Array<AgentHumanContactConfig>
metadata?: WorkflowNodeJobMetadata
mode?: WorkflowNodeJobMode
output_routes?: WorkflowOutputRoutes
previous_node_output_refs?: Array<WorkflowPreviousNodeOutputRef>
schema_version?: number
workflow_prompt?: string
@@ -2411,6 +2412,11 @@ export type WorkflowNodeJobMetadata = {
export type WorkflowNodeJobMode = 'let_agent_figure_it_out' | 'tell_agent_what_to_do'
export type WorkflowOutputRoutes = {
enabled?: boolean
routes?: Array<WorkflowOutputRoute>
}
export type WorkflowPreviousNodeOutputRef = {
key?: string | null
name?: string | null
@@ -2701,6 +2707,12 @@ export type DeclaredOutputRetryConfig = {
retry_interval_ms?: number
}
export type WorkflowOutputRoute = {
id: string
label?: string | null
name?: string
}
export type AgentCliToolAuthorizationStatus =
| 'allowed'
| 'authorized'
@@ -3146,6 +3146,27 @@ export const zDeclaredOutputFailureStrategy = z.object({
retry: zDeclaredOutputRetryConfig.optional(),
})
/**
* WorkflowOutputRoute
*
* Stable workflow exit identity and its model-visible selection condition.
*/
export const zWorkflowOutputRoute = z.object({
id: z.string().min(1),
label: z.string().nullish(),
name: z.string().optional().default(''),
})
/**
* WorkflowOutputRoutes
*
* Enabled routes require at least two exits; drafts may omit conditions.
*/
export const zWorkflowOutputRoutes = z.object({
enabled: z.boolean().optional().default(false),
routes: z.array(zWorkflowOutputRoute).optional(),
})
/**
* AgentCliToolAuthorizationStatus
*
@@ -3500,6 +3521,7 @@ export const zWorkflowNodeJobConfig = z.object({
human_contacts: z.array(zAgentHumanContactConfig).optional(),
metadata: zWorkflowNodeJobMetadata.optional(),
mode: zWorkflowNodeJobMode.optional().default('tell_agent_what_to_do'),
output_routes: zWorkflowOutputRoutes.optional(),
previous_node_output_refs: z.array(zWorkflowPreviousNodeOutputRef).optional(),
schema_version: z.int().optional().default(1),
workflow_prompt: z.string().optional().default(''),
@@ -451,6 +451,7 @@ export type WorkflowNodeJobConfig = {
human_contacts?: Array<AgentHumanContactConfig>
metadata?: WorkflowNodeJobMetadata
mode?: WorkflowNodeJobMode
output_routes?: WorkflowOutputRoutes
previous_node_output_refs?: Array<WorkflowPreviousNodeOutputRef>
schema_version?: number
workflow_prompt?: string
@@ -701,6 +702,11 @@ export type WorkflowNodeJobMetadata = {
export type WorkflowNodeJobMode = 'let_agent_figure_it_out' | 'tell_agent_what_to_do'
export type WorkflowOutputRoutes = {
enabled?: boolean
routes?: Array<WorkflowOutputRoute>
}
export type WorkflowPreviousNodeOutputRef = {
key?: string | null
name?: string | null
@@ -944,6 +950,12 @@ export type DeclaredOutputRetryConfig = {
retry_interval_ms?: number
}
export type WorkflowOutputRoute = {
id: string
label?: string | null
name?: string
}
export type AgentCliToolAuthorizationStatus =
| 'allowed'
| 'authorized'
@@ -927,6 +927,27 @@ export const zDeclaredOutputFailureStrategy = z.object({
retry: zDeclaredOutputRetryConfig.optional(),
})
/**
* WorkflowOutputRoute
*
* Stable workflow exit identity and its model-visible selection condition.
*/
export const zWorkflowOutputRoute = z.object({
id: z.string().min(1),
label: z.string().nullish(),
name: z.string().optional().default(''),
})
/**
* WorkflowOutputRoutes
*
* Enabled routes require at least two exits; drafts may omit conditions.
*/
export const zWorkflowOutputRoutes = z.object({
enabled: z.boolean().optional().default(false),
routes: z.array(zWorkflowOutputRoute).optional(),
})
/**
* AgentCliToolAuthorizationStatus
*
@@ -1237,6 +1258,7 @@ export const zWorkflowNodeJobConfig = z.object({
human_contacts: z.array(zAgentHumanContactConfig).optional(),
metadata: zWorkflowNodeJobMetadata.optional(),
mode: zWorkflowNodeJobMode.optional().default('tell_agent_what_to_do'),
output_routes: zWorkflowOutputRoutes.optional(),
previous_node_output_refs: z.array(zWorkflowPreviousNodeOutputRef).optional(),
schema_version: z.int().optional().default(1),
workflow_prompt: z.string().optional().default(''),