Sauvegarde de l'arbre de travail en cours (persistance P8, conversations C-series, write-portal frontend, médiation d'entrée) avant d'attaquer le support de la délégation inter-agents pour les profils Codex. Le round-trip inter-agent question/réponse est couvert sans tokens par les tests loopback existants (state::mcp_e2e_loopback_tests). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
36 lines
1.2 KiB
TypeScript
36 lines
1.2 KiB
TypeScript
/**
|
|
* Tauri adapter for {@link InputGateway} (ARCHITECTURE §20.3).
|
|
*
|
|
* `interrupt` → `interrupt_agent` (preempt). `delegationDelivered` →
|
|
* `delegation_delivered` (the native write-portal's ack that a delegation's
|
|
* text was effectively written into the PTY). The former `submit` →
|
|
* `submit_agent_input` path is gone: the agent cell is a native terminal, so
|
|
* human keystrokes reach the PTY directly (no mediated-input strip).
|
|
*
|
|
* Commands use snake_case (Tauri convention); payload keys are camelCase
|
|
* (matching the backend DTO `#[serde(rename_all = "camelCase")]`), consistent
|
|
* with the other adapters in this directory.
|
|
*/
|
|
|
|
import { invoke } from "@tauri-apps/api/core";
|
|
|
|
import type { InputGateway } from "@/ports";
|
|
|
|
export class TauriInputGateway implements InputGateway {
|
|
async interrupt(projectId: string, agentId: string): Promise<void> {
|
|
await invoke("interrupt_agent", {
|
|
request: { projectId, agentId },
|
|
});
|
|
}
|
|
|
|
async delegationDelivered(
|
|
projectId: string,
|
|
agentId: string,
|
|
ticket: string,
|
|
): Promise<void> {
|
|
await invoke("delegation_delivered", {
|
|
request: { projectId, agentId, ticket },
|
|
});
|
|
}
|
|
}
|