package openidea:plugin@1.21.0; /// Forking recorded native agent sessions into new tasks (API 1.18). Requires /// the `agents` capability. The session must belong to the invoking window's /// project and have been recorded in `cwd`; the host builds the fork invocation /// and names the fork's id for claude (codex assigns its own). interface agents { use types.{error}; /// Fork the recorded session `session-id` of `agent` (a native provider, /// `claude` or `codex`) into a new task in the open project, returning the /// new task id. `cwd` must be where the session was recorded. The first /// turn continues the recording as the agent's own fork. fork-session: func(agent: string, session-id: string, cwd: string) -> result; /// A recorded native session to continue as a fork (API 1.21). The host validates /// it and builds the fork invocation itself, like `fork-session`; a plugin never /// puts tokens on an agent's command line. record recorded-session { /// The recorded session's id; the task's provider must be the agent that recorded it. session-id: string, /// Where it was recorded (same rule as fork-session). cwd: string, } /// A new task a plugin starts (API 1.21). The host does NOT send the prompt: the /// task opens in the Agents window with the provider selected and the prompt in /// its message field, focused, for the user to review and send. record new-task { provider: string, /// Without `fork`, must be non-empty; the host rejects an empty prompt. prompt: string, /// Continue a recorded native session as a fork, like fork-session. fork: option, } /// Start a new task in the invoking window's project and return its id (API 1.21). /// Requires the `agents` capability. The task is created unsent; the user reviews /// the prompt in the Agents window and sends it. With `fork`, the recorded session /// is validated and continued exactly as `fork-session` does. start-task: func(task: new-task) -> result; }