/** * Agent-instance roster helpers (Issue #1000). * * Shared by the `instances` command (add/remove/alias/kill/list) and the * `send --instance ... --register` option. All roster mutations go through * PATCH /api/worktrees/[id] (`agentInstances`), the same endpoint the * AgentInstancesPane UI uses, so CLI-created instances show up in the UI and * vice versa. * * Uses a RELATIVE path (not `@/`) to import server-side constants: CLI builds * via tsconfig.cli.json set `"paths": {}`. Mirrors the existing pattern in * ../config/cli-tool-ids.ts. */ import { type ApiClient } from './api-client'; import type { AgentInstance } from '../types/api-responses'; import { MAX_AGENT_INSTANCES, MAX_AGENT_ALIAS_LENGTH } from '../../lib/cli-tools/types'; import { MIN_AGENT_INSTANCES } from '../../lib/agent-instances-validator'; export { MAX_AGENT_INSTANCES, MAX_AGENT_ALIAS_LENGTH, MIN_AGENT_INSTANCES }; /** * Fetch the current agent-instance roster for a worktree. */ export declare function fetchAgentInstances(client: ApiClient, worktreeId: string): Promise; /** * Persist a full roster replacement. `order` is re-normalized to array * position, matching AgentInstancesPane's persist() behavior. */ export declare function saveAgentInstances(client: ApiClient, worktreeId: string, instances: AgentInstance[]): Promise; /** * Generate a unique instance id for `cliTool`. Mirrors * AgentInstancesPane.tsx's nextInstanceId(): claims the primary id * (`id === cliTool`) when free, otherwise the smallest free `{cliTool}-{n}` * suffix (n >= 2). */ export declare function nextInstanceId(cliTool: string, existing: ReadonlyArray<{ id: string; }>): string; /** * Default alias for a freshly-added instance (tool display name, suffixed * for non-primary instances). Mirrors AgentInstancesPane.tsx's defaultAlias(). * * @param cliTool - Caller must have already validated this via isCliToolId(). */ export declare function defaultAlias(cliTool: string, id: string): string; //# sourceMappingURL=agent-instances.d.ts.map