/** Hosted conversation behavior for an agent trigger target. */ export type AgentConversationMode = "create_new" | "existing" | "none"; /** Trigger target addressing a task definition. */ export interface TaskTriggerTarget extends TriggerTarget { /** Definition kind resolved by project runtime discovery. */ kind: "task"; /** Canonical slash-separated definition identifier. */ id: string; /** Task targets do not carry hosted conversation behavior. */ conversationMode?: never; /** Task targets do not carry hosted conversation identifiers. */ conversationId?: never; } /** Trigger target addressing a workflow definition. */ export interface WorkflowTriggerTarget extends TriggerTarget { /** Definition kind resolved by project runtime discovery. */ kind: "workflow"; /** Canonical slash-separated definition identifier. */ id: string; /** Workflow targets do not carry hosted conversation behavior. */ conversationMode?: never; /** Workflow targets do not carry hosted conversation identifiers. */ conversationId?: never; } /** Trigger target addressing an agent definition and its hosted conversation. */ export interface AgentTriggerTarget extends TriggerTarget { /** Definition kind resolved by project runtime discovery. */ kind: "agent"; /** Canonical slash-separated definition identifier. */ id: string; /** Hosted conversation behavior; defaults to `none`. */ conversationMode?: AgentConversationMode | undefined; /** Existing conversation UUID; required only with `conversationMode: "existing"`. */ conversationId?: string | null | undefined; } /** Canonical reference to a runnable project definition. */ export interface TriggerTarget { /** Definition kind resolved by project runtime discovery. */ kind: "task" | "workflow" | "agent"; /** Canonical slash-separated definition identifier. */ id: string; } /** Author-facing target shape accepting stored base values and kind-specific literals. */ export type TriggerTargetConfig = (TriggerTarget & { conversationMode?: never; conversationId?: never; }) | TaskTriggerTarget | WorkflowTriggerTarget | AgentTriggerTarget; /** Validated target value that narrows conversation fields by `kind`. */ export type ResolvedTriggerTarget = TaskTriggerTarget | WorkflowTriggerTarget | AgentTriggerTarget; /** Supported local trigger target kinds. */ export type TriggerTargetKind = TriggerTarget["kind"]; /** * Own keys a trigger target may declare, widened for agent targets. * * TypeScript without `exactOptionalPropertyTypes` accepts an explicitly * undefined value for an optional `never` property. Keep that authoring shape * aligned with runtime normalization while still rejecting accessors and every * defined conversation value on non-agent targets. */ export declare function triggerTargetKeys(value: unknown): readonly string[]; /** * Describe why agent conversation addressing is invalid, or return `null`. * * `label` prefixes the diagnostic so schedules, webhooks, and targets report * the same invariant with their own field path. */ export declare function agentConversationDiagnostic(label: string, conversationMode: unknown, conversationId: unknown): string | null; /** * Describe one value declared in two places with disagreeing content. * * Repeating a value is redundant, not wrong: an author spanning a platform * upgrade must be able to write a single definition that both the old and the * new platform read correctly. Only a disagreement is unresolvable, because * honoring one copy would detach the deployed trigger from what the other copy * names. */ export declare function declarationConflictDiagnostic(label: string, path: string, legacyPath: string, value: unknown, legacyValue: unknown): string | null; /** * Describe a conversation pair that disagrees across two locations. * * `legacyLabel` names the other location so the message spells out both real * field paths without ranking them: which one a given platform reads depends * on its version, so neither can be called authoritative here. */ export declare function conversationConflictDiagnostic(label: string, legacyLabel: string, target: ResolvedTriggerTarget, legacyConversationMode: unknown, legacyConversationId: unknown): string | null; /** A canonical target, or the reason the value is not one. */ export type TriggerTargetResolution = { readonly target: ResolvedTriggerTarget; readonly detail?: undefined; } | { readonly target?: undefined; readonly detail: string; }; /** * Validate and copy the canonical fields of a trigger target. * * Public `TriggerTarget` interfaces are intentionally extendable, so this * generic helper ignores caller-owned extension fields. Schedule and webhook * authoring validators apply strict key checks before calling this helper. */ export declare function resolveTriggerTarget(label: string, value: unknown): TriggerTargetResolution; /** * Validate and copy a trigger target without retaining caller-owned state. */ export declare function snapshotTriggerTarget(value: unknown): ResolvedTriggerTarget | null; /** Return true only for canonical targets stored in own data properties. */ export declare function isTriggerTarget(value: unknown): value is ResolvedTriggerTarget; //# sourceMappingURL=target.d.ts.map