eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
61 lines (60 loc) • 2.63 kB
TypeScript
import { type AddChannelsDeps } from "../boxes/add-channels.js";
import { inspectExistingChannelRegistrations } from "../channel-add-conflicts.js";
import { detectDeployment } from "../project-resolution.js";
import type { Prompter } from "../prompter.js";
import { getVercelAuthStatus } from "../vercel-project.js";
/** Injected for tests; defaults to the real detection and box effects. */
export interface ChannelsFlowDeps {
detectDeployment: typeof detectDeployment;
inspectExistingChannelRegistrations: typeof inspectExistingChannelRegistrations;
getVercelAuthStatus: typeof getVercelAuthStatus;
addChannels?: AddChannelsDeps;
}
export type ChannelsFlowResult = {
kind: "done";
addedChannels: readonly string[];
} | {
/**
* The user chose "Deploy and chat" on the post-Slack "See it live"
* prompt. The caller deploys, then points them at this workspace.
*/
kind: "deploy-and-chat";
addedChannels: readonly string[];
chat: {
chatUrl?: string;
workspaceName?: string;
};
} | {
kind: "cancelled";
} | {
kind: "failed";
addedChannels: readonly string[];
message: string;
};
/** The post-Slack "see it live" chooser's title. */
export declare const SEE_IT_LIVE_MESSAGE = "See it live";
/**
* THE CHANNELS FLOW for the dev TUI's `/channels`: a task list that loops.
* Pick an unregistered channel, run its add sub-flow (Slack provisioning
* included), and land back on the repainted list with that channel checked;
* "Done" or Esc leaves. Filesystem effects can land before the runner applies
* their in-memory payload, so every cancelled or failed sub-flow re-inspects
* authored registrations and preserves a channel that became durable. Esc on
* the list after something was added reports the additions exactly like Done;
* only an empty exit folds to cancelled.
*
* Each pick reuses the `eve channels add` composition — the same conflict
* validation, Vercel services config pinned on, and the default empty agent
* name (the Slack connector slug falls back to the package.json name) — with
* two TUI-specific differences: no trailing deploy box (the TUI exposes
* `/deploy` as its own command), and no inline link pickers — channels that
* provision against the Vercel project render disabled with a warning
* pointing at /model while the directory is unlinked, so a pick can never
* reach provisioning without a link.
*/
export declare function runChannelsFlow(input: {
appRoot: string;
prompter: Prompter;
signal?: AbortSignal;
deps?: Partial<ChannelsFlowDeps>;
}): Promise<ChannelsFlowResult>;