dispatch('canceled')} on:confirmed={() => dispatch('confirmed', { selectedTriggers, selectedAgents })} >
{#if draftTriggers.length > 0}
{`Your ${runnable} has draft triggers. Select which draft triggers to deploy with the ${runnable}. Undeployed draft triggers will be permanently deleted.`}
5 ? 'h-[300px]' : ''}> Triggers to deploy {#each draftTriggers as trigger} {@const SvelteComponent = triggerIconMap[trigger.type]} {@const permission = checkSavePermissions(trigger)} {@const isSelectedTrigger = isSelected(selectedTriggers, trigger)}
{#if trigger.isPrimary} {/if}
{#if permission === 'deploy'}
toggleTrigger(trigger, e.detail)} > {#snippet children({ item })} {/snippet}
{:else if permission === 'admin-only'} Admin only {:else if permission === 'invalid-config'} Invalid config {/if} {/each}
{/if} {#if draftAgents.length > 0}
Saved agents this flow uses have unsaved changes. Select which ones to deploy with the flow. An agent kept as a draft stays editable, and the flow runs the agent as currently deployed.
5 ? 'h-[300px]' : ''}> Agents to deploy {#each draftAgents as agent (agent.path)} {@const permission = checkAgentPermissions(agent)} {@const isSelectedAgent = selectedAgents.some((a) => a.path === agent.path)}
{agent.path} {#if agent.noDeployed} Never deployed {/if}
{#if agent.noDeployed && !isSelectedAgent} Never deployed, so the flow will not run until this agent is deployed. {/if}
{#if permission.state === 'deploy'}
toggleAgent(agent, e.detail)} > {#snippet children({ item })} {/snippet}
{:else if permission.state === 'read-only'} Read-only {:else} Invalid config {/if} {/each}
{/if}