Skip to main content

Request

Enum Request 

Source
pub enum Request {
Show 42 variants Hello { client: String, since: Option<Seq>, token: Option<String>, epoch: Option<String>, }, Snapshot, Spawn(SpawnRequest), Prompt { session: SessionId, text: String, attachments: Vec<Attachment>, queue: bool, }, Exec { session: SessionId, command: String, }, QueueClear { session: SessionId, }, QueuePop { session: SessionId, }, Cancel { session: SessionId, }, SessionRemove { session: SessionId, force: bool, }, Handoff { session: SessionId, kind: AgentKind, model: Option<String>, effort: Option<String>, note: Option<String>, role: Option<Role>, parent: Option<ParentChange>, force: bool, }, Kill { session: SessionId, }, KillBgProc { session: SessionId, pid: Option<u32>, force: bool, }, Resume { session: SessionId, prompt: Option<String>, }, Clear { session: SessionId, force: bool, }, Sleep { session: SessionId, }, Wake { session: SessionId, }, SessionConfig { session: SessionId, model: Option<String>, effort: Option<String>, }, SessionBudget { session: SessionId, budget_usd: f64, }, McpPermission { session: SessionId, title: String, detail: String, }, ApprovalAsk { session: SessionId, tool: String, input: String, }, Permission { session: SessionId, req: String, decision: Decision, }, McpQuestion { session: SessionId, question: String, header: Option<String>, options: Vec<String>, multi_select: bool, }, AnswerQuestion { session: SessionId, id: String, answers: Vec<String>, }, BusSend { from: Option<SessionId>, to: Target, kind: MsgKind, body: String, reply_to: Option<MsgId>, }, BusInbox { session: SessionId, unread_only: bool, }, BusWait { session: SessionId, from: Option<SessionId>, reply_to: Option<MsgId>, timeout_ms: u64, }, TaskCreate { title: String, detail: String, assignee: Option<SessionId>, created_by: Option<SessionId>, depends_on: Vec<TaskId>, }, TaskUpdate { id: TaskId, status: Option<TaskStatus>, assignee: Option<SessionId>, detail: Option<String>, }, SessionNote { session: SessionId, note: String, }, ArtifactShare { session: SessionId, kind: ArtifactKind, path: String, note: String, }, WorktreeList, WorktreeDiff { session: SessionId, stat_only: bool, paths: Vec<String>, max_lines: Option<usize>, fold_generated: bool, }, WorktreeDiscard { session: SessionId, file: String, patch: Option<String>, }, WorktreeMerge { session: SessionId, dry_run: bool, resolve: bool, strategy: Option<MergeStrategy>, }, WorktreePr { session: SessionId, title: String, body: String, }, WorktreeGc { session: Option<SessionId>, force: bool, }, Prune { project: Option<String>, }, ReviewComment { session: SessionId, location: String, comment: String, }, WebControl { enabled: Option<bool>, addr: Option<String>, }, ListModels { kind: String, }, Shutdown, Restart,
}
Expand description

client → daemon。

Variants§

§

Hello

打招呼並 (可選)要求補齊 since 之後的事件;遠端連線可帶 token。

Fields

§client: String
§since: Option<Seq>
§epoch: Option<String>

client 上次連線時 daemon 回報的 epoch;不符時 daemon 忽略 since、改送完整快照。

§

Snapshot

要一份完整狀態快照。

§

Spawn(SpawnRequest)

§

Prompt

送 prompt / 使用者輸入給某個 session。

Fields

§session: SessionId
§text: String
§attachments: Vec<Attachment>

附件 (檔案、圖片)。

§queue: bool

若為 true:session 忙或佇列非空時改進待送佇列,閒下來再依序送出。

§

Exec

在 session 的工作目錄執行 shell 命令 (不經過 agent),輸出寫入逐字稿。

Fields

§session: SessionId
§command: String
§

QueueClear

清空某個 session 的待送 prompt 佇列。

Fields

§session: SessionId
§

QueuePop

取出 (移除)某個 session 待送佇列的最後一則,透過 Frame::Ok { note } 回傳原始文字。

Fields

§session: SessionId
§

Cancel

中斷當前回合 (不殺處理程序)。

Fields

§session: SessionId
§

SessionRemove

從清單移除已結束的 session;有 worktree 分支時比照 gc (未合併或有未 commit 變更需 force)。

Fields

§session: SessionId
§force: bool
§

Handoff

把 session 的工作交接給另一個 agent:產生交接簡報,新 agent 沿用同一個工作目錄。

Fields

§session: SessionId
§effort: Option<String>
§note: Option<String>

額外補充給接手者的說明。

§role: Option<Role>
§force: bool
§

Kill

結束 session 並殺掉處理程序。

Fields

§session: SessionId
§

KillBgProc

終止某個 session 的背景子處理程序 (pid: None 代表清理全部)。

Fields

§session: SessionId
§force: bool
§

Resume

接續已結束的 session:用 agent 原生的對話 id 接回原對話 (session id 不變)。

Fields

§session: SessionId
§prompt: Option<String>

接續成功後立刻送出的 prompt。

§

Clear

重設上下文但不換身分:殺掉 agent 處理程序後以全新對話重啟 (ertangle session id、 label、父子關係、worktree、inbox 與任務都保留)。忙碌中預設拒絕,force 會先中斷。

Fields

§session: SessionId
§force: bool
§

Sleep

暫停閒置 session 子處理程序 (SIGSTOP)。

Fields

§session: SessionId
§

Wake

唤醒休眠中的 session 子處理程序 (SIGCONT)。

Fields

§session: SessionId
§

SessionConfig

執行期切換指定 session 的 model 與/或 effort (下一個回合起生效)。

Fields

§session: SessionId
§effort: Option<String>
§

SessionBudget

設定或調高指定 session 的成本上限 (美元),並解除 over_budget。

Fields

§session: SessionId
§budget_usd: f64
§

McpPermission

agent (經 MCP ertangle_approve)請求核准並等待結果。

Fields

§session: SessionId
§title: String
§detail: String
§

ApprovalAsk

agent (經 MCP ertangle_approve)請求核准並等待結果;回覆 Ok 的 note 為 allow 或 deny。

Fields

§session: SessionId
§tool: String
§input: String

工具輸入 (JSON 字串)。

§

Permission

回覆核准請求。

Fields

§session: SessionId
§decision: Decision
§

McpQuestion

Agent asks a question through MCP ertangle_question and waits for the user’s answer.

Fields

§session: SessionId
§question: String
§header: Option<String>
§options: Vec<String>
§multi_select: bool
§

AnswerQuestion

Reply to an interactive question.

Fields

§session: SessionId
§answers: Vec<String>
§

BusSend

送訊息到匯流排 (agent 之間溝通)。

Fields

§kind: MsgKind
§body: String
§reply_to: Option<MsgId>
§

BusInbox

讀取某個 session 的收件匣 (預設只讀未讀並推進游標)。

Fields

§session: SessionId
§unread_only: bool
§

BusWait

阻塞等待下一則進收件匣的訊息 (可選篩選發送者或 reply_to)。

Fields

§session: SessionId
§reply_to: Option<MsgId>
§timeout_ms: u64
§

TaskCreate

Fields

§title: String
§detail: String
§assignee: Option<SessionId>
§created_by: Option<SessionId>
§depends_on: Vec<TaskId>
§

TaskUpdate

Fields

§assignee: Option<SessionId>
§detail: Option<String>
§

SessionNote

更新某個 session 的簡短狀態字串 (對應 ertangle_status)。

Fields

§session: SessionId
§note: String
§

ArtifactShare

分享產出 (檔案、分支或 diff)。

Fields

§session: SessionId
§path: String
§note: String
§

WorktreeList

列出所有受管 worktree。

§

WorktreeDiff

取得某個 session 工作區的 git diff (含未追蹤檔案摘要)。

Fields

§session: SessionId
§stat_only: bool

只回傳變更檔案與行數統計 (+N -M),不含 unified diff 內容。

§paths: Vec<String>

只檢視符合指定相對路徑或前綴的檔案。

§max_lines: Option<usize>

最多回傳幾行 diff (超過時截斷並附上省略提示)。

§fold_generated: bool

自動將大型 lockfile / 自動產生檔 (package-lock.json、*.Designer.cs 等) 摺疊為單行摘要。

§

WorktreeDiscard

退回 (捨棄) 某個 session 工作區的單一 Hunk 或整個檔案變更。

Fields

§session: SessionId
§file: String
§

WorktreeMerge

將某個 session 的 worktree 分支合併回主工作區。

Fields

§session: SessionId
§dry_run: bool
§resolve: bool
§strategy: Option<MergeStrategy>

合併策略;省略時由 daemon 的全域 [git] merge_strategy 決定,預設 merge。

§

WorktreePr

為某個 session 的分支建立 Pull Request (透過 gh)。

Fields

§session: SessionId
§title: String
§body: String
§

WorktreeGc

清除已結束 session 的 worktree (若指定 session 則清除該筆)。

Fields

§force: bool

連未合併或有未 commit 變更的也一併移除。

§

Prune

Archive every ended session that is merged or has no worktree, removing merged worktrees safely. Live sessions and unmerged work are never touched.

Fields

§project: Option<String>

Restrict to sessions of this project root (absolute path); None = all.

§

ReviewComment

對某個 session 的 diff 行留下審查註解並送回該 agent 修正。

Fields

§session: SessionId
§location: String
§comment: String
§

WebControl

控制或查詢 Web 版支援。

Fields

§enabled: Option<bool>
§

ListModels

列出某個 agent 可選的 model (Claude 內建清單;其他 agent 向 CLI 查詢,最多數秒)。

Fields

§kind: String

agent 種類 (claude、codex、opencode、antigravity)。

§

Shutdown

要 daemon 關閉。

§

Restart

要 daemon 以同一個執行檔重新啟動 (re-exec);執行中的 session 會自動接續。

Trait Implementations§

Source§

impl Clone for Request

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Request

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Request

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Request

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.