fix(triggers): add copilot as a trigger type (#3191)

* fix(triggers): add copilot as a trigger type

* update color
This commit is contained in:
Waleed
2026-02-10 21:36:38 -08:00
committed by GitHub
parent 13a91113fd
commit 3d5bd003ef
8 changed files with 18 additions and 5 deletions

View File

@@ -72,6 +72,7 @@ const TRIGGER_VARIANT_MAP: Record<string, React.ComponentProps<typeof Badge>['va
webhook: 'orange',
mcp: 'cyan',
a2a: 'teal',
copilot: 'pink',
}
interface StatusBadgeProps {

View File

@@ -10,7 +10,7 @@ export interface WorkflowExecutionOptions {
onStream?: (se: StreamingExecution) => Promise<void>
executionId?: string
onBlockComplete?: (blockId: string, output: any) => Promise<void>
overrideTriggerType?: 'chat' | 'manual' | 'api'
overrideTriggerType?: 'chat' | 'manual' | 'api' | 'copilot'
stopAfterBlockId?: string
/** For run_from_block / run_block: start from a specific block using cached state */
runFromBlock?: {

View File

@@ -27,6 +27,7 @@ const badgeVariants = cva(
amber: `${STATUS_BASE} bg-[#fde68a] text-[#a16207] dark:bg-[rgba(245,158,11,0.2)] dark:text-[#fcd34d]`,
teal: `${STATUS_BASE} bg-[#99f6e4] text-[#0f766e] dark:bg-[rgba(20,184,166,0.2)] dark:text-[#5eead4]`,
cyan: `${STATUS_BASE} bg-[var(--surface-4)] text-[#0891b2] dark:bg-[rgba(14,165,233,0.2)] dark:text-[#7dd3fc]`,
pink: `${STATUS_BASE} bg-[#fbcfe8] text-[#be185d] dark:bg-[rgba(236,72,153,0.2)] dark:text-[#f9a8d4]`,
'gray-secondary': `${STATUS_BASE} bg-[var(--surface-4)] text-[var(--text-secondary)]`,
},
size: {
@@ -54,6 +55,7 @@ const STATUS_VARIANTS = [
'amber',
'teal',
'cyan',
'pink',
'gray-secondary',
] as const
@@ -87,7 +89,7 @@ export interface BadgeProps
* Supports two categories of variants:
* - **Bordered**: `default`, `outline`, `type` - traditional badges with borders
* - **Status colors**: `green`, `red`, `gray`, `blue`, `blue-secondary`, `purple`,
* `orange`, `amber`, `teal`, `cyan`, `gray-secondary` - borderless colored badges
* `orange`, `amber`, `teal`, `cyan`, `pink`, `gray-secondary` - borderless colored badges
*
* Status color variants can display a dot indicator via the `dot` prop.
* All variants support an optional `icon` prop for leading icons.

View File

@@ -115,6 +115,7 @@ async function doExecuteRunTool(
const result = await executeWorkflowWithFullLogging({
workflowInput,
executionId,
overrideTriggerType: 'copilot',
stopAfterBlockId,
runFromBlock,
})

View File

@@ -172,7 +172,7 @@ export async function executeRunWorkflow(
generateRequestId(),
params.workflow_input || params.input || undefined,
context.userId,
{ enabled: true, useDraftState }
{ enabled: true, useDraftState, workflowTriggerType: 'copilot' }
)
return {
@@ -408,7 +408,12 @@ export async function executeRunWorkflowUntilBlock(
generateRequestId(),
params.workflow_input || params.input || undefined,
context.userId,
{ enabled: true, useDraftState, stopAfterBlockId: params.stopAfterBlockId }
{
enabled: true,
useDraftState,
stopAfterBlockId: params.stopAfterBlockId,
workflowTriggerType: 'copilot',
}
)
return {
@@ -540,6 +545,7 @@ export async function executeRunFromBlock(
{
enabled: true,
useDraftState,
workflowTriggerType: 'copilot',
runFromBlock: { startBlockId: params.startBlockId, sourceSnapshot: snapshot },
}
)
@@ -602,6 +608,7 @@ export async function executeRunBlock(
{
enabled: true,
useDraftState,
workflowTriggerType: 'copilot',
runFromBlock: { startBlockId: params.blockId, sourceSnapshot: snapshot },
stopAfterBlockId: params.blockId,
}

View File

@@ -39,6 +39,7 @@ export function getTriggerOptions(): TriggerOption[] {
{ value: 'webhook', label: 'Webhook', color: '#ea580c' },
{ value: 'mcp', label: 'MCP', color: '#dc2626' },
{ value: 'a2a', label: 'A2A', color: '#14b8a6' },
{ value: 'copilot', label: 'Copilot', color: '#ec4899' },
]
for (const trigger of triggers) {

View File

@@ -13,7 +13,7 @@ export interface ExecuteWorkflowOptions {
enabled: boolean
selectedOutputs?: string[]
isSecureMode?: boolean
workflowTriggerType?: 'api' | 'chat'
workflowTriggerType?: 'api' | 'chat' | 'copilot'
onStream?: (streamingExec: StreamingExecution) => Promise<void>
onBlockComplete?: (blockId: string, output: unknown) => Promise<void>
skipLoggingComplete?: boolean

View File

@@ -190,6 +190,7 @@ export const CORE_TRIGGER_TYPES = [
'webhook',
'mcp',
'a2a',
'copilot',
] as const
export type CoreTriggerType = (typeof CORE_TRIGGER_TYPES)[number]