nandi/oripublic Fork 0
7895c1d1c9bb1048807dc04f7246dc456c47e025
Commits
Clone
git clone https://git.rickub.com/nandi/ori.git
git clone ssh://git@rickub.com/nandi/ori.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

forked from bots-garden/ori

protocol.ts · 123 lines · 3.1 KBTypeScript Blame HistoryRaw
✨ Introduce new feature(s): ACP web client — Go backend (agent, bridge, httpserver, mockagent) + React SPA (Zed-like agent panel), tests, quality gate PASS 2434cc7 k33g 2d ago1/**
2 * Wire contract with the ori backend, mirroring internal/bridge/protocol.go.
3 *
4 * ACP payloads (session updates, permission requests) arrive verbatim from
5 * the agent, so their shapes follow https://agentclientprotocol.com.
6 */
7
8/** An ACP content block; only text blocks are rendered in this version. */
9export interface AcpContentBlock {
10 type: string;
11 text?: string;
12 [key: string]: unknown;
13}
14
15/** One piece of tool-call output: nested content, a file diff, or a terminal. */
16export interface AcpToolCallContent {
17 type: string;
18 content?: AcpContentBlock;
19 path?: string;
20 oldText?: string | null;
21 newText?: string;
22 terminalId?: string;
23}
24
25/** A file location a tool call touches (Zed uses this to "follow the agent"). */
26export interface AcpToolCallLocation {
27 path: string;
28 line?: number;
29}
30
31/** One entry of the agent's execution plan. */
32export interface AcpPlanEntry {
33 content: string;
34 priority: string;
35 status: string;
36}
37
38/** One choice offered by a permission request. */
39export interface AcpPermissionOption {
40 optionId: string;
41 name: string;
42 kind: string;
43}
44
✨ Workspace panel, selectors, previews, desktop app, sandbox template, resizable file tree, light/dark theme 76d62ac k33g yesterday45/** One slash command announced by the agent (available_commands_update). */
46export interface AcpAvailableCommand {
47 name: string;
48 description: string;
49 input?: { hint?: string } | null;
50}
51
✨ Introduce new feature(s): ACP web client — Go backend (agent, bridge, httpserver, mockagent) + React SPA (Zed-like agent panel), tests, quality gate PASS 2434cc7 k33g 2d ago52/** The ACP payload of a session/request_permission call. */
53export interface AcpPermissionRequest {
54 sessionId?: string;
55 toolCall?: {
56 toolCallId?: string;
57 title?: string | null;
58 kind?: string;
59 [key: string]: unknown;
60 };
61 options?: AcpPermissionOption[];
62}
63
64/**
65 * One ACP session/update notification payload, discriminated by
66 * sessionUpdate. Message/thought chunks use `content` as a single block;
67 * tool calls use it as an array of AcpToolCallContent.
68 */
69export interface AcpSessionUpdate {
70 sessionUpdate: string;
71 content?: AcpContentBlock | AcpToolCallContent[];
72 toolCallId?: string;
73 title?: string | null;
74 kind?: string;
75 status?: string;
76 locations?: AcpToolCallLocation[];
77 entries?: AcpPlanEntry[];
✨ Workspace panel, selectors, previews, desktop app, sandbox template, resizable file tree, light/dark theme 76d62ac k33g yesterday78 availableCommands?: AcpAvailableCommand[];
✨ Introduce new feature(s): ACP web client — Go backend (agent, bridge, httpserver, mockagent) + React SPA (Zed-like agent panel), tests, quality gate PASS 2434cc7 k33g 2d ago79 [key: string]: unknown;
80}
81
✨ Workspace panel, selectors, previews, desktop app, sandbox template, resizable file tree, light/dark theme 76d62ac k33g yesterday82/**
83 * A workspace file mentioned in a prompt with "@": the server turns it into
84 * an ACP resource_link block next to the text. `path` is absolute (as
85 * returned by the file search), `name` the relative path shown in the text.
86 */
87export interface PromptAttachment {
88 path: string;
89 name: string;
90}
91
✨ Introduce new feature(s): ACP web client — Go backend (agent, bridge, httpserver, mockagent) + React SPA (Zed-like agent panel), tests, quality gate PASS 2434cc7 k33g 2d ago92/** A message sent by the server over the WebSocket. */
93export interface ServerMessage {
94 type:
95 | "hello"
96 | "user_message"
97 | "session_update"
98 | "permission_request"
99 | "permission_resolved"
100 | "turn_started"
101 | "turn_ended"
102 | "error";
103 sessionId?: string;
104 turnActive?: boolean;
105 update?: AcpSessionUpdate;
106 requestId?: string;
107 request?: AcpPermissionRequest;
108 text?: string;
✨ Workspace panel, selectors, previews, desktop app, sandbox template, resizable file tree, light/dark theme 76d62ac k33g yesterday109 attachments?: PromptAttachment[];
✨ Introduce new feature(s): ACP web client — Go backend (agent, bridge, httpserver, mockagent) + React SPA (Zed-like agent panel), tests, quality gate PASS 2434cc7 k33g 2d ago110 stopReason?: string;
111 message?: string;
112}
113
114/** A message the browser sends to the server. */
115export type ClientMessage =
✨ Workspace panel, selectors, previews, desktop app, sandbox template, resizable file tree, light/dark theme 76d62ac k33g yesterday116 | { type: "prompt"; text: string; attachments?: PromptAttachment[] }
✨ Introduce new feature(s): ACP web client — Go backend (agent, bridge, httpserver, mockagent) + React SPA (Zed-like agent panel), tests, quality gate PASS 2434cc7 k33g 2d ago117 | { type: "cancel" }
118 | {
119 type: "permission_response";
120 requestId: string;
121 optionId?: string;
122 cancelled?: boolean;
123 };