@macro-inc/sdk 0.2.2 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +177 -3
- package/dist/{chunk-OGE7WXJE.js → chunk-AZJUIUIV.js} +177 -23
- package/dist/{chunk-PRUFPW3B.js → chunk-G43PLP2U.js} +144 -0
- package/dist/{chunk-7LVVPVNT.js → chunk-K4G5VO4P.js} +76 -1
- package/dist/{chunk-PAAFJYGO.js → chunk-PPR7IWZ7.js} +77 -51
- package/dist/{chunk-QVBNNMQS.js → chunk-PTX2RV2N.js} +169 -20
- package/dist/{chunk-SUINKDXF.js → chunk-PZPTJI6F.js} +42 -0
- package/dist/{chunk-7YJ6Y7HJ.js → chunk-XFA7NCJ5.js} +207 -0
- package/dist/{chunk-ZQXOHNDB.js → chunk-ZLBDES7U.js} +789 -12
- package/dist/generated/agent-fold/index.d.ts +4332 -0
- package/dist/generated/agent-fold/index.js +0 -0
- package/dist/generated/agent-harness/index.d.ts +1 -1
- package/dist/generated/agent-harness/index.js +1 -1
- package/dist/generated/agent-harness/sdk.gen.d.ts +83 -9
- package/dist/generated/agent-harness/types.gen.d.ts +1504 -160
- package/dist/generated/agent-reviews/index.d.ts +893 -0
- package/dist/generated/agent-reviews/index.js +0 -0
- package/dist/generated/auth/index.d.ts +1 -1
- package/dist/generated/auth/index.js +1 -1
- package/dist/generated/auth/sdk.gen.d.ts +108 -2
- package/dist/generated/auth/types.gen.d.ts +799 -6
- package/dist/generated/calendar/index.d.ts +1 -1
- package/dist/generated/calendar/index.js +1 -1
- package/dist/generated/calendar/sdk.gen.d.ts +63 -1
- package/dist/generated/calendar/types.gen.d.ts +1234 -5
- package/dist/generated/cognition/index.d.ts +1 -1
- package/dist/generated/cognition/index.js +1 -1
- package/dist/generated/cognition/sdk.gen.d.ts +85 -20
- package/dist/generated/cognition/types.gen.d.ts +1040 -121
- package/dist/generated/connection/index.d.ts +1 -1
- package/dist/generated/connection/index.js +15 -0
- package/dist/generated/connection/sdk.gen.d.ts +6 -1
- package/dist/generated/connection/types.gen.d.ts +18 -1
- package/dist/generated/email/index.d.ts +1 -1
- package/dist/generated/email/index.js +1 -1
- package/dist/generated/email/sdk.gen.d.ts +44 -2
- package/dist/generated/email/types.gen.d.ts +475 -10
- package/dist/generated/notification/index.d.ts +1 -1
- package/dist/generated/notification/index.js +1 -1
- package/dist/generated/notification/sdk.gen.d.ts +29 -21
- package/dist/generated/notification/types.gen.d.ts +267 -73
- package/dist/generated/properties/index.d.ts +1 -1
- package/dist/generated/properties/types.gen.d.ts +21 -1
- package/dist/generated/scheduled-action/index.d.ts +1 -1
- package/dist/generated/scheduled-action/index.js +1 -1
- package/dist/generated/scheduled-action/sdk.gen.d.ts +8 -1
- package/dist/generated/scheduled-action/types.gen.d.ts +669 -19
- package/dist/generated/search/index.d.ts +1 -1
- package/dist/generated/search/types.gen.d.ts +87 -7
- package/dist/generated/static-files/types.gen.d.ts +6 -0
- package/dist/generated/storage/index.d.ts +1 -1
- package/dist/generated/storage/index.js +1 -1
- package/dist/generated/storage/sdk.gen.d.ts +376 -13
- package/dist/generated/storage/types.gen.d.ts +12038 -5562
- package/dist/src/entities/account-managers/grant.d.ts +39 -0
- package/dist/src/entities/account-managers/namespace.d.ts +17 -0
- package/dist/src/entities/agent-sessions/activity.d.ts +39 -0
- package/dist/src/entities/agent-sessions/agent-session.d.ts +148 -6
- package/dist/src/entities/agent-sessions/code-execution.d.ts +5 -0
- package/dist/src/entities/agent-sessions/namespace.d.ts +54 -4
- package/dist/src/entities/agent-sessions/origin.d.ts +94 -0
- package/dist/src/entities/agent-sessions/review.d.ts +18 -62
- package/dist/src/entities/agent-sessions/view.d.ts +11 -0
- package/dist/src/entities/agents/namespace.d.ts +11 -2
- package/dist/src/entities/ai/namespace.d.ts +5 -1
- package/dist/src/entities/api-keys/namespace.d.ts +5 -1
- package/dist/src/entities/bots/bot.d.ts +108 -0
- package/dist/src/entities/bots/namespace.d.ts +17 -4
- package/dist/src/entities/bots/token.d.ts +34 -0
- package/dist/src/entities/calendar/booking-link.d.ts +49 -0
- package/dist/src/entities/calendar/booking-namespace.d.ts +130 -0
- package/dist/src/entities/calendar/booking-namespace.test.d.ts +1 -0
- package/dist/src/entities/calendar/booking.d.ts +77 -0
- package/dist/src/entities/calendar/calendar.d.ts +11 -4
- package/dist/src/entities/calendar/create-confirmed.test.d.ts +1 -0
- package/dist/src/entities/calendar/event.d.ts +104 -3
- package/dist/src/entities/calendar/namespace.d.ts +151 -7
- package/dist/src/entities/calendar/namespace.test.d.ts +1 -0
- package/dist/src/entities/calls/call-record.d.ts +34 -4
- package/dist/src/entities/calls/connection.d.ts +53 -0
- package/dist/src/entities/calls/errors.d.ts +15 -0
- package/dist/src/entities/calls/namespace.d.ts +21 -1
- package/dist/src/entities/calls/participant.d.ts +22 -0
- package/dist/src/entities/channels/access-request.d.ts +34 -0
- package/dist/src/entities/channels/channel.d.ts +47 -1
- package/dist/src/entities/channels/namespace.d.ts +21 -5
- package/dist/src/entities/channels/namespace.test.d.ts +1 -0
- package/dist/src/entities/channels/post.d.ts +14 -3
- package/dist/src/entities/channels/thread.d.ts +10 -1
- package/dist/src/entities/chats/chat.d.ts +7 -1
- package/dist/src/entities/chats/namespace.d.ts +14 -1
- package/dist/src/entities/connected-apps/connected-app.d.ts +107 -0
- package/dist/src/entities/connected-apps/connector.d.ts +56 -0
- package/dist/src/entities/connected-apps/namespace.d.ts +74 -0
- package/dist/src/entities/crm/company.d.ts +7 -3
- package/dist/src/entities/crm/contact.d.ts +4 -4
- package/dist/src/entities/crm/namespace.d.ts +34 -1
- package/dist/src/entities/crm/pipeline.d.ts +43 -2
- package/dist/src/entities/databases/database.d.ts +17 -0
- package/dist/src/entities/databases/namespace.d.ts +56 -0
- package/dist/src/entities/documents/ai-edit.d.ts +52 -0
- package/dist/src/entities/documents/document.d.ts +244 -5
- package/dist/src/entities/documents/namespace.d.ts +89 -4
- package/dist/src/entities/documents/office-files.d.ts +47 -0
- package/dist/src/entities/email/draft.d.ts +36 -7
- package/dist/src/entities/email/message.d.ts +99 -3
- package/dist/src/entities/email/namespace.d.ts +47 -4
- package/dist/src/entities/email/namespace.test.d.ts +1 -0
- package/dist/src/entities/email/thread.d.ts +55 -3
- package/dist/src/entities/entity-mentions/namespace.d.ts +5 -1
- package/dist/src/entities/external-chat/chat.d.ts +105 -0
- package/dist/src/entities/external-chat/message.d.ts +54 -0
- package/dist/src/entities/external-chat/namespace.d.ts +18 -0
- package/dist/src/entities/external-chat/participant.d.ts +28 -0
- package/dist/src/entities/external-chat/send.d.ts +32 -0
- package/dist/src/entities/external-chat/upload.d.ts +25 -0
- package/dist/src/entities/favorites/namespace.d.ts +5 -1
- package/dist/src/entities/foreign/namespace.d.ts +3 -0
- package/dist/src/entities/forms/form.d.ts +17 -2
- package/dist/src/entities/forms/namespace.d.ts +5 -1
- package/dist/src/entities/github-pull-requests/namespace.d.ts +5 -1
- package/dist/src/entities/harnesses/harness.d.ts +9 -0
- package/dist/src/entities/harnesses/namespace.d.ts +5 -1
- package/dist/src/entities/images/image.d.ts +77 -0
- package/dist/src/entities/images/namespace.d.ts +48 -0
- package/dist/src/entities/images/namespace.test.d.ts +1 -0
- package/dist/src/entities/initiatives/initiative.d.ts +12 -1
- package/dist/src/entities/initiatives/namespace.d.ts +15 -2
- package/dist/src/entities/me/namespace.d.ts +43 -0
- package/dist/src/entities/meetings/meeting.d.ts +5 -0
- package/dist/src/entities/meetings/namespace.d.ts +5 -1
- package/dist/src/entities/messages/thread.d.ts +1 -1
- package/dist/src/entities/notifications/namespace.d.ts +3 -0
- package/dist/src/entities/pins/namespace.d.ts +5 -1
- package/dist/src/entities/projects/namespace.d.ts +4 -1
- package/dist/src/entities/projects/project.d.ts +9 -1
- package/dist/src/entities/properties/namespace.d.ts +2 -0
- package/dist/src/entities/referrals/namespace.d.ts +33 -0
- package/dist/src/entities/routines/namespace.d.ts +42 -2
- package/dist/src/entities/routines/routine.d.ts +84 -5
- package/dist/src/entities/search/namespace.d.ts +65 -0
- package/dist/src/entities/{search.d.ts → search/options.d.ts} +8 -2
- package/dist/src/entities/search/types.d.ts +90 -0
- package/dist/src/entities/sharing/access.d.ts +14 -0
- package/dist/src/entities/tasks/namespace.d.ts +42 -3
- package/dist/src/entities/tasks/task.d.ts +47 -6
- package/dist/src/entities/teams/invite.d.ts +30 -0
- package/dist/src/entities/teams/namespace.d.ts +3 -0
- package/dist/src/entities/teams/team.d.ts +37 -0
- package/dist/src/entities/unfurls/namespace.d.ts +5 -1
- package/dist/src/entities/users/namespace.d.ts +9 -0
- package/dist/src/entities/users/user.d.ts +8 -0
- package/dist/src/entities/web/namespace.d.ts +61 -0
- package/dist/src/entities/web/namespace.test.d.ts +1 -0
- package/dist/src/entities/webhooks/namespace.d.ts +2 -0
- package/dist/src/entities/whatsapp/account.d.ts +20 -0
- package/dist/src/entities/whatsapp/chat.d.ts +54 -0
- package/dist/src/entities/whatsapp/namespace.d.ts +23 -0
- package/dist/src/entities/workspace/items.d.ts +7 -0
- package/dist/src/entities/workspace/namespace.d.ts +14 -9
- package/dist/src/entities/workspace/query.d.ts +23 -0
- package/dist/src/entities/workspace/types.d.ts +6 -3
- package/dist/src/events/hydrate/agentSession.d.ts +1 -1
- package/dist/src/events/hydrate/call.d.ts +101 -0
- package/dist/src/events/hydrate/channel.d.ts +8 -1
- package/dist/src/events/hydrate/document.d.ts +1 -1
- package/dist/src/events/hydrate/message.d.ts +1 -1
- package/dist/src/events/types.d.ts +2 -1
- package/dist/src/macro.d.ts +73 -4
- package/dist/src/macro.js +8235 -3701
- package/dist/src/mentions.d.ts +6 -1
- package/dist/src/utils/activity.d.ts +23 -2
- package/dist/src/utils/index.d.ts +1 -1
- package/dist/src/utils/unwrap.d.ts +27 -2
- package/package.json +2 -2
|
@@ -0,0 +1,4332 @@
|
|
|
1
|
+
/** What a step put in front of the person. */
|
|
2
|
+
export type ActivityCard = ActivityCard_Serialize | ActivityCard_Deserialize;
|
|
3
|
+
/** What a step put in front of the person. */
|
|
4
|
+
export type ActivityCard_Deserialize =
|
|
5
|
+
/**
|
|
6
|
+
* A view the agent presented: the `view` of a presented `PresentView`
|
|
7
|
+
* call. Its widgets name the items they show, and readers load those
|
|
8
|
+
* with their own access.
|
|
9
|
+
*/
|
|
10
|
+
{
|
|
11
|
+
kind: "view";
|
|
12
|
+
/** The dynamic-UI view. */
|
|
13
|
+
view: View_Deserialize;
|
|
14
|
+
};
|
|
15
|
+
/** What a step put in front of the person. */
|
|
16
|
+
export type ActivityCard_Serialize =
|
|
17
|
+
/**
|
|
18
|
+
* A view the agent presented: the `view` of a presented `PresentView`
|
|
19
|
+
* call. Its widgets name the items they show, and readers load those
|
|
20
|
+
* with their own access.
|
|
21
|
+
*/
|
|
22
|
+
{
|
|
23
|
+
kind: "view";
|
|
24
|
+
/** The dynamic-UI view. */
|
|
25
|
+
view: View_Serialize;
|
|
26
|
+
};
|
|
27
|
+
/** One step of work, worded for a person reading a conversation. */
|
|
28
|
+
export type ActivityRow = ActivityRow_Serialize | ActivityRow_Deserialize;
|
|
29
|
+
/** One step of work, worded for a person reading a conversation. */
|
|
30
|
+
export type ActivityRow_Deserialize = {
|
|
31
|
+
/** The tool call's id, stable across updates; `plan` for a plan update. */
|
|
32
|
+
id: string;
|
|
33
|
+
/** What happened, as a verb phrase: `Ran`, `Reading`, `Search documents`. */
|
|
34
|
+
label: string;
|
|
35
|
+
/**
|
|
36
|
+
* What it happened to - a command, a file, a query - when that is safe
|
|
37
|
+
* to show to everyone who can read the conversation.
|
|
38
|
+
*/
|
|
39
|
+
detail: string | null;
|
|
40
|
+
/** Where it got to. */
|
|
41
|
+
status: ActivityStatus;
|
|
42
|
+
/** What the step put in front of the person, shown where it ran. */
|
|
43
|
+
card?: ActivityCard_Deserialize | null;
|
|
44
|
+
};
|
|
45
|
+
/** One step of work, worded for a person reading a conversation. */
|
|
46
|
+
export type ActivityRow_Serialize = {
|
|
47
|
+
/** The tool call's id, stable across updates; `plan` for a plan update. */
|
|
48
|
+
id: string;
|
|
49
|
+
/** What happened, as a verb phrase: `Ran`, `Reading`, `Search documents`. */
|
|
50
|
+
label: string;
|
|
51
|
+
/**
|
|
52
|
+
* What it happened to - a command, a file, a query - when that is safe
|
|
53
|
+
* to show to everyone who can read the conversation.
|
|
54
|
+
*/
|
|
55
|
+
detail: string | null;
|
|
56
|
+
/** Where it got to. */
|
|
57
|
+
status: ActivityStatus;
|
|
58
|
+
/** What the step put in front of the person, shown where it ran. */
|
|
59
|
+
card: ActivityCard_Serialize | null;
|
|
60
|
+
};
|
|
61
|
+
/** Where one step of work got to. */
|
|
62
|
+
export type ActivityStatus =
|
|
63
|
+
/** Started and not finished, including a call waiting on permission. */
|
|
64
|
+
"running" |
|
|
65
|
+
/** Finished successfully. */
|
|
66
|
+
"completed" |
|
|
67
|
+
/** Finished unsuccessfully. */
|
|
68
|
+
"failed" |
|
|
69
|
+
/** Still running when its turn ended: nobody knows whether it finished. */
|
|
70
|
+
"interrupted";
|
|
71
|
+
/** A calendar event an agenda lists. */
|
|
72
|
+
export type AgendaEvent = AgendaEvent_Serialize | AgendaEvent_Deserialize;
|
|
73
|
+
/** A calendar event an agenda lists. */
|
|
74
|
+
export type AgendaEvent_Deserialize = {
|
|
75
|
+
/** The eventId a calendar tool such as ListCalendarEvents returned. */
|
|
76
|
+
eventId: string;
|
|
77
|
+
/**
|
|
78
|
+
* One instance of a recurring event: that instance's recurrenceId from
|
|
79
|
+
* ListCalendarEvents.
|
|
80
|
+
*/
|
|
81
|
+
occurrenceKey?: string;
|
|
82
|
+
};
|
|
83
|
+
/** A calendar event an agenda lists. */
|
|
84
|
+
export type AgendaEvent_Serialize = {
|
|
85
|
+
/** The eventId a calendar tool such as ListCalendarEvents returned. */
|
|
86
|
+
eventId: string;
|
|
87
|
+
/**
|
|
88
|
+
* One instance of a recurring event: that instance's recurrenceId from
|
|
89
|
+
* ListCalendarEvents.
|
|
90
|
+
*/
|
|
91
|
+
occurrenceKey?: string;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* The JSON-RPC id of a request the agent made, as the agent wrote it.
|
|
95
|
+
*
|
|
96
|
+
* Kept in the agent's own shape - a number stays a number - because an
|
|
97
|
+
* answer has to echo it exactly; `"7"` does not answer `7`.
|
|
98
|
+
*/
|
|
99
|
+
export type AgentRequestId =
|
|
100
|
+
/**
|
|
101
|
+
* A numeric id. Exported as a plain TypeScript number: agents count
|
|
102
|
+
* requests from zero, nowhere near where an `i64` stops round-tripping.
|
|
103
|
+
*/
|
|
104
|
+
number |
|
|
105
|
+
/** A string id. */
|
|
106
|
+
string;
|
|
107
|
+
/** How a container aligns its children across its axis. */
|
|
108
|
+
export type Align = "start" | "center" | "end" | "stretch";
|
|
109
|
+
/**
|
|
110
|
+
* Terminal output with ANSI escape sequences left in place.
|
|
111
|
+
*
|
|
112
|
+
* Stripping here would be lossy and irreversible, and the escapes carry real
|
|
113
|
+
* information - the recordings are full of colorized `ls` and `grep` output.
|
|
114
|
+
* Rendering decides whether to interpret, strip, or ignore them.
|
|
115
|
+
*/
|
|
116
|
+
export type AnsiText = string;
|
|
117
|
+
/**
|
|
118
|
+
* A chosen option, with the title it was offered under when the schema gave
|
|
119
|
+
* one. `title` is `None` for a value no option declared.
|
|
120
|
+
*/
|
|
121
|
+
export type AnsweredChoice = {
|
|
122
|
+
/** The value submitted. */
|
|
123
|
+
value: string;
|
|
124
|
+
/** The label it was offered under. */
|
|
125
|
+
title: string | null;
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* One property's answer, resolved against the schema that asked for it.
|
|
129
|
+
*
|
|
130
|
+
* The correlation happens here so that no client repeats it: an option's
|
|
131
|
+
* title is looked up where the options live, and the harness "Other" idiom -
|
|
132
|
+
* a free-text answer arriving under a *different* key than the property it
|
|
133
|
+
* replaces, sometimes alongside the choice it replaces (see the
|
|
134
|
+
* `elicitation_claude_single_select` fixture, which carries both) - collapses
|
|
135
|
+
* to a single [`AnsweredValue::Custom`].
|
|
136
|
+
*/
|
|
137
|
+
export type AnsweredField = {
|
|
138
|
+
/**
|
|
139
|
+
* The property this answers, or the key it arrived under when no
|
|
140
|
+
* property claimed it.
|
|
141
|
+
*/
|
|
142
|
+
name: string;
|
|
143
|
+
/** What to show as the label: the property's title, else its name. */
|
|
144
|
+
label: string;
|
|
145
|
+
/** The answer. */
|
|
146
|
+
value: AnsweredValue;
|
|
147
|
+
};
|
|
148
|
+
/** An answer's value, in the vocabulary the property declared. */
|
|
149
|
+
export type AnsweredValue =
|
|
150
|
+
/** Free text. */
|
|
151
|
+
{
|
|
152
|
+
kind: "text";
|
|
153
|
+
/** The text as submitted. */
|
|
154
|
+
text: string;
|
|
155
|
+
} |
|
|
156
|
+
/**
|
|
157
|
+
* A number, whole or not, exactly as it was submitted.
|
|
158
|
+
*
|
|
159
|
+
* Text rather than `f64`: a JSON integer can outrun `f64`'s exact range,
|
|
160
|
+
* and `f64` has a `number | null` TypeScript face because a non-finite
|
|
161
|
+
* float serializes as null. Nothing computes with an answer - it is
|
|
162
|
+
* rendered - so the digits are what matter.
|
|
163
|
+
*/
|
|
164
|
+
{
|
|
165
|
+
kind: "number";
|
|
166
|
+
/** The number as written. */
|
|
167
|
+
text: string;
|
|
168
|
+
} |
|
|
169
|
+
/** A yes/no. */
|
|
170
|
+
{
|
|
171
|
+
kind: "boolean";
|
|
172
|
+
/** Whether it was checked. */
|
|
173
|
+
checked: boolean;
|
|
174
|
+
} |
|
|
175
|
+
/** One of the offered options. */
|
|
176
|
+
{
|
|
177
|
+
kind: "choice";
|
|
178
|
+
/** The option chosen, with the title it was offered under. */
|
|
179
|
+
choice: AnsweredChoice;
|
|
180
|
+
} |
|
|
181
|
+
/** Several of the offered options. */
|
|
182
|
+
{
|
|
183
|
+
kind: "choices";
|
|
184
|
+
/** The options chosen, in the order they were submitted. */
|
|
185
|
+
choices: AnsweredChoice[];
|
|
186
|
+
} |
|
|
187
|
+
/**
|
|
188
|
+
* The free-text escape: the user typed their own answer instead of
|
|
189
|
+
* picking, and it arrived under the property's `customField`.
|
|
190
|
+
*/
|
|
191
|
+
{
|
|
192
|
+
kind: "custom";
|
|
193
|
+
/** What they typed. */
|
|
194
|
+
text: string;
|
|
195
|
+
} |
|
|
196
|
+
/**
|
|
197
|
+
* A value this fold could not read as any of the above - a nested
|
|
198
|
+
* object, or an array of something other than strings.
|
|
199
|
+
*/
|
|
200
|
+
{
|
|
201
|
+
kind: "unrecognized";
|
|
202
|
+
/** The value, verbatim. */
|
|
203
|
+
raw: unknown;
|
|
204
|
+
};
|
|
205
|
+
/** Who produced a [`FoldedMessage`]. */
|
|
206
|
+
export type Author =
|
|
207
|
+
/**
|
|
208
|
+
* A person, via `session/prompt`.
|
|
209
|
+
*
|
|
210
|
+
* The id comes from the log row rather than the ACP payload, and is
|
|
211
|
+
* absent when the prompt was not attributed to a user.
|
|
212
|
+
*/
|
|
213
|
+
{
|
|
214
|
+
kind: "user";
|
|
215
|
+
/** The attributed user's id. */
|
|
216
|
+
userId: string | null;
|
|
217
|
+
} |
|
|
218
|
+
/** The agent. */
|
|
219
|
+
{
|
|
220
|
+
kind: "agent";
|
|
221
|
+
};
|
|
222
|
+
/**
|
|
223
|
+
* One slash command the harness advertises.
|
|
224
|
+
*
|
|
225
|
+
* Mirrors ACP's `AvailableCommand`, flattened: the only input shape ACP
|
|
226
|
+
* defines today is "unstructured text after the name," so the hint is
|
|
227
|
+
* carried directly rather than through a nested enum.
|
|
228
|
+
*/
|
|
229
|
+
export type AvailableCommand = {
|
|
230
|
+
/**
|
|
231
|
+
* Bare name as advertised (`"qc"`, `"honeycomb:query-patterns"`) - no
|
|
232
|
+
* leading slash, which is client syntax rather than part of the name.
|
|
233
|
+
*/
|
|
234
|
+
name: string;
|
|
235
|
+
/** Human-readable description, verbatim from the harness. */
|
|
236
|
+
description: string;
|
|
237
|
+
/** Placeholder text for the command's input, when it takes any. */
|
|
238
|
+
inputHint: string | null;
|
|
239
|
+
};
|
|
240
|
+
/** Whether a call was attended. */
|
|
241
|
+
export type CallStatus = "ATTENDED" | "MISSED" | "UNATTENDED";
|
|
242
|
+
/** A workspace item a card shows. */
|
|
243
|
+
export type CardItem = {
|
|
244
|
+
type: CardItemType;
|
|
245
|
+
/**
|
|
246
|
+
* The item's id exactly as a tool returned it: a document id (documents
|
|
247
|
+
* and spreadsheets), an email thread id, a calendar eventId, or a
|
|
248
|
+
* project, channel, routine, form or initiative id.
|
|
249
|
+
*/
|
|
250
|
+
id: string;
|
|
251
|
+
};
|
|
252
|
+
/** The kinds of workspace item a card shows. */
|
|
253
|
+
export type CardItemType = "document" | "email_thread" | "calendar_event" | "project" | "channel" | "routine" | "form" | "initiative";
|
|
254
|
+
/** A session control operation shown in the conversation timeline. */
|
|
255
|
+
export type Control =
|
|
256
|
+
/** The runtime was asked to switch models. */
|
|
257
|
+
{
|
|
258
|
+
kind: "set_model";
|
|
259
|
+
/** The model slug requested by the caller. */
|
|
260
|
+
model: string;
|
|
261
|
+
} |
|
|
262
|
+
/** The runtime was asked to change an advertised session setting. */
|
|
263
|
+
{
|
|
264
|
+
kind: "set_config_option";
|
|
265
|
+
/** Opaque config id supplied by the runtime. */
|
|
266
|
+
config_id: string;
|
|
267
|
+
/** Opaque select value requested by the caller. */
|
|
268
|
+
value: string;
|
|
269
|
+
} |
|
|
270
|
+
/** The runtime was asked to compact its context. */
|
|
271
|
+
{
|
|
272
|
+
kind: "compact";
|
|
273
|
+
} |
|
|
274
|
+
/** The runtime was asked to stop its current work. */
|
|
275
|
+
{
|
|
276
|
+
kind: "stop";
|
|
277
|
+
};
|
|
278
|
+
/**
|
|
279
|
+
* How the runtime disposed of a [`Control`], like [`PermissionOutcome`] for
|
|
280
|
+
* permission requests. Pending is a legitimate final state: a control the
|
|
281
|
+
* session died before answering stays pending.
|
|
282
|
+
*/
|
|
283
|
+
export type ControlOutcome =
|
|
284
|
+
/** No response yet. */
|
|
285
|
+
{
|
|
286
|
+
kind: "pending";
|
|
287
|
+
} |
|
|
288
|
+
/** Acknowledged - immediately so for a stop, which nothing can answer. */
|
|
289
|
+
{
|
|
290
|
+
kind: "accepted";
|
|
291
|
+
} |
|
|
292
|
+
/** Answered with a JSON-RPC error. */
|
|
293
|
+
{
|
|
294
|
+
kind: "rejected";
|
|
295
|
+
/** The error's message, verbatim. */
|
|
296
|
+
message: string;
|
|
297
|
+
};
|
|
298
|
+
/** Bounds on a timestamp, as ISO 8601 strings. */
|
|
299
|
+
export type DateRangeFilter = DateRangeFilter_Serialize | DateRangeFilter_Deserialize;
|
|
300
|
+
/** Bounds on a timestamp, as ISO 8601 strings. */
|
|
301
|
+
export type DateRangeFilter_Deserialize = {
|
|
302
|
+
gt?: string;
|
|
303
|
+
gte?: string;
|
|
304
|
+
lt?: string;
|
|
305
|
+
lte?: string;
|
|
306
|
+
};
|
|
307
|
+
/** Bounds on a timestamp, as ISO 8601 strings. */
|
|
308
|
+
export type DateRangeFilter_Serialize = {
|
|
309
|
+
gt?: string;
|
|
310
|
+
gte?: string;
|
|
311
|
+
lt?: string;
|
|
312
|
+
lte?: string;
|
|
313
|
+
};
|
|
314
|
+
/** Overall review decision. */
|
|
315
|
+
export type DecisionOutcome =
|
|
316
|
+
/** All selected actions were approved. */
|
|
317
|
+
"approved" |
|
|
318
|
+
/** All selected items were dismissed. */
|
|
319
|
+
"dismissed" |
|
|
320
|
+
/** The batch contains mixed or unconfirmed results. */
|
|
321
|
+
"partial";
|
|
322
|
+
/** Surface of a review decision. */
|
|
323
|
+
export type DecisionVia =
|
|
324
|
+
/** Review card. */
|
|
325
|
+
"card" |
|
|
326
|
+
/** Owner request in chat. */
|
|
327
|
+
"chat" |
|
|
328
|
+
/** Inbox action. */
|
|
329
|
+
"inbox";
|
|
330
|
+
/** The axis a container lays its children along. */
|
|
331
|
+
export type Direction = "row" | "col";
|
|
332
|
+
/** The filters that apply to documents. */
|
|
333
|
+
export type DocumentFieldFilters = DocumentFieldFilters_Serialize | DocumentFieldFilters_Deserialize;
|
|
334
|
+
/** The filters that apply to documents. */
|
|
335
|
+
export type DocumentFieldFilters_Deserialize = {
|
|
336
|
+
documentId?: string[];
|
|
337
|
+
fileType?: string[];
|
|
338
|
+
fileAssoc?: string[];
|
|
339
|
+
subType?: string[];
|
|
340
|
+
projectId?: string[];
|
|
341
|
+
documentOwnerId?: string[];
|
|
342
|
+
documentSeen?: boolean;
|
|
343
|
+
documentDone?: boolean;
|
|
344
|
+
/** For tasks, whether the current user is an assignee. */
|
|
345
|
+
documentImportance?: boolean;
|
|
346
|
+
isEmailAttachment?: boolean;
|
|
347
|
+
documentCreatedAt?: DateRangeFilter_Deserialize;
|
|
348
|
+
documentUpdatedAt?: DateRangeFilter_Deserialize;
|
|
349
|
+
};
|
|
350
|
+
/** The filters that apply to documents. */
|
|
351
|
+
export type DocumentFieldFilters_Serialize = {
|
|
352
|
+
documentId?: string[];
|
|
353
|
+
fileType?: string[];
|
|
354
|
+
fileAssoc?: string[];
|
|
355
|
+
subType?: string[];
|
|
356
|
+
projectId?: string[];
|
|
357
|
+
documentOwnerId?: string[];
|
|
358
|
+
documentSeen?: boolean;
|
|
359
|
+
documentDone?: boolean;
|
|
360
|
+
/** For tasks, whether the current user is an assignee. */
|
|
361
|
+
documentImportance?: boolean;
|
|
362
|
+
isEmailAttachment?: boolean;
|
|
363
|
+
documentCreatedAt?: DateRangeFilter_Serialize;
|
|
364
|
+
documentUpdatedAt?: DateRangeFilter_Serialize;
|
|
365
|
+
};
|
|
366
|
+
/** Documents to include and exclude. */
|
|
367
|
+
export type DocumentFilterClause = DocumentFilterClause_Serialize | DocumentFilterClause_Deserialize;
|
|
368
|
+
/** Documents to include and exclude. */
|
|
369
|
+
export type DocumentFilterClause_Deserialize = {
|
|
370
|
+
include?: DocumentFieldFilters_Deserialize;
|
|
371
|
+
exclude?: DocumentFieldFilters_Deserialize;
|
|
372
|
+
};
|
|
373
|
+
/** Documents to include and exclude. */
|
|
374
|
+
export type DocumentFilterClause_Serialize = {
|
|
375
|
+
include?: DocumentFieldFilters_Serialize;
|
|
376
|
+
exclude?: DocumentFieldFilters_Serialize;
|
|
377
|
+
};
|
|
378
|
+
/** Document filter expressions combined. */
|
|
379
|
+
export type DocumentFilterCombination = DocumentFilterCombination_Serialize | DocumentFilterCombination_Deserialize;
|
|
380
|
+
/** Document filter expressions combined. */
|
|
381
|
+
export type DocumentFilterCombination_Deserialize = ({
|
|
382
|
+
op: "and";
|
|
383
|
+
clauses: DocumentFilterExpression_Deserialize[];
|
|
384
|
+
}) & {
|
|
385
|
+
clause?: never;
|
|
386
|
+
} | ({
|
|
387
|
+
op: "or";
|
|
388
|
+
clauses: DocumentFilterExpression_Deserialize[];
|
|
389
|
+
}) & {
|
|
390
|
+
clause?: never;
|
|
391
|
+
} | ({
|
|
392
|
+
op: "not";
|
|
393
|
+
clause: DocumentFilterExpression_Deserialize;
|
|
394
|
+
}) & {
|
|
395
|
+
clauses?: never;
|
|
396
|
+
};
|
|
397
|
+
/** Document filter expressions combined. */
|
|
398
|
+
export type DocumentFilterCombination_Serialize = ({
|
|
399
|
+
op: "and";
|
|
400
|
+
clauses: DocumentFilterExpression_Serialize[];
|
|
401
|
+
}) & {
|
|
402
|
+
clause?: never;
|
|
403
|
+
} | ({
|
|
404
|
+
op: "or";
|
|
405
|
+
clauses: DocumentFilterExpression_Serialize[];
|
|
406
|
+
}) & {
|
|
407
|
+
clause?: never;
|
|
408
|
+
} | ({
|
|
409
|
+
op: "not";
|
|
410
|
+
clause: DocumentFilterExpression_Serialize;
|
|
411
|
+
}) & {
|
|
412
|
+
clauses?: never;
|
|
413
|
+
};
|
|
414
|
+
/** A document filter: a clause, or clauses combined with `op`. */
|
|
415
|
+
export type DocumentFilterExpression = DocumentFilterExpression_Serialize | DocumentFilterExpression_Deserialize;
|
|
416
|
+
/** A document filter: a clause, or clauses combined with `op`. */
|
|
417
|
+
export type DocumentFilterExpression_Deserialize = DocumentFilterCombination_Deserialize | DocumentFilterClause_Deserialize;
|
|
418
|
+
/** A document filter: a clause, or clauses combined with `op`. */
|
|
419
|
+
export type DocumentFilterExpression_Serialize = DocumentFilterCombination_Serialize | DocumentFilterClause_Serialize;
|
|
420
|
+
/**
|
|
421
|
+
* Several document filter expressions that all apply, or one. Several comes
|
|
422
|
+
* first: serde reads a struct from an array too, so a clause would take one.
|
|
423
|
+
*/
|
|
424
|
+
export type DocumentWhere = DocumentWhere_Serialize | DocumentWhere_Deserialize;
|
|
425
|
+
/**
|
|
426
|
+
* Several document filter expressions that all apply, or one. Several comes
|
|
427
|
+
* first: serde reads a struct from an array too, so a clause would take one.
|
|
428
|
+
*/
|
|
429
|
+
export type DocumentWhere_Deserialize = DocumentFilterExpression_Deserialize[] | DocumentFilterExpression_Deserialize;
|
|
430
|
+
/**
|
|
431
|
+
* Several document filter expressions that all apply, or one. Several comes
|
|
432
|
+
* first: serde reads a struct from an array too, so a clause would take one.
|
|
433
|
+
*/
|
|
434
|
+
export type DocumentWhere_Serialize = DocumentFilterExpression_Serialize[] | DocumentFilterExpression_Serialize;
|
|
435
|
+
/** One choice in a select. */
|
|
436
|
+
export type ElicitationOption = {
|
|
437
|
+
/** The value sent back when chosen. */
|
|
438
|
+
value: string;
|
|
439
|
+
/**
|
|
440
|
+
* Label to show; absent for an untitled `enum`, where the value is the
|
|
441
|
+
* label.
|
|
442
|
+
*/
|
|
443
|
+
title: string | null;
|
|
444
|
+
/** Help text, when the agent gave one. */
|
|
445
|
+
description: string | null;
|
|
446
|
+
};
|
|
447
|
+
/**
|
|
448
|
+
* How an elicitation has resolved so far.
|
|
449
|
+
*
|
|
450
|
+
* [`Self::Pending`] is a legitimate final state on a dead session, like an
|
|
451
|
+
* unanswered permission.
|
|
452
|
+
*/
|
|
453
|
+
export type ElicitationOutcome =
|
|
454
|
+
/** No response has gone out yet. */
|
|
455
|
+
{
|
|
456
|
+
kind: "pending";
|
|
457
|
+
} |
|
|
458
|
+
/** The user submitted the form, or consented to open the URL. */
|
|
459
|
+
{
|
|
460
|
+
kind: "accepted";
|
|
461
|
+
/**
|
|
462
|
+
* What they answered: one entry per property the schema declared and
|
|
463
|
+
* the content answered, in declaration order, then any key no
|
|
464
|
+
* property claimed. Empty for a URL consent, which carries no
|
|
465
|
+
* content.
|
|
466
|
+
*/
|
|
467
|
+
answers: AnsweredField[];
|
|
468
|
+
} |
|
|
469
|
+
/** The user explicitly said no. */
|
|
470
|
+
{
|
|
471
|
+
kind: "declined";
|
|
472
|
+
} |
|
|
473
|
+
/** The user dismissed it, or a stop cancelled it. */
|
|
474
|
+
{
|
|
475
|
+
kind: "cancelled";
|
|
476
|
+
} |
|
|
477
|
+
/** URL only: the agent reported the external interaction finished. */
|
|
478
|
+
{
|
|
479
|
+
kind: "completed";
|
|
480
|
+
} |
|
|
481
|
+
/**
|
|
482
|
+
* The response was a JSON-RPC error - including this client's own
|
|
483
|
+
* refusal of a request it could not hold.
|
|
484
|
+
*/
|
|
485
|
+
{
|
|
486
|
+
kind: "errored";
|
|
487
|
+
/** The error's message, verbatim. */
|
|
488
|
+
message: string;
|
|
489
|
+
} |
|
|
490
|
+
/** A result arrived that this fold could not read as an ACP action. */
|
|
491
|
+
{
|
|
492
|
+
kind: "unrecognized";
|
|
493
|
+
};
|
|
494
|
+
/** One form field. */
|
|
495
|
+
export type ElicitationProperty = {
|
|
496
|
+
/** The key the answer is sent back under. */
|
|
497
|
+
name: string;
|
|
498
|
+
/** Label to show, when the agent gave one. */
|
|
499
|
+
title: string | null;
|
|
500
|
+
/** Help text, when the agent gave one. */
|
|
501
|
+
description: string | null;
|
|
502
|
+
/** The field's type and constraints. */
|
|
503
|
+
schema: ElicitationPropertySchema;
|
|
504
|
+
};
|
|
505
|
+
/**
|
|
506
|
+
* A field's type and constraints, mirroring ACP's restricted property
|
|
507
|
+
* schemas.
|
|
508
|
+
*/
|
|
509
|
+
export type ElicitationPropertySchema =
|
|
510
|
+
/** Free text, or a single choice when `options` is non-empty. */
|
|
511
|
+
{
|
|
512
|
+
type: "string";
|
|
513
|
+
/** Minimum length, when constrained. */
|
|
514
|
+
minLength: number | null;
|
|
515
|
+
/** Maximum length, when constrained. */
|
|
516
|
+
maxLength: number | null;
|
|
517
|
+
/**
|
|
518
|
+
* A regular expression the value must match. Agent-supplied, so a
|
|
519
|
+
* renderer must bound its evaluation.
|
|
520
|
+
*/
|
|
521
|
+
pattern: string | null;
|
|
522
|
+
/**
|
|
523
|
+
* ACP's format hint as its wire string (`email`, `uri`, `date`,
|
|
524
|
+
* `date-time`, or something this fold does not know).
|
|
525
|
+
*/
|
|
526
|
+
format: string | null;
|
|
527
|
+
/** Pre-filled value. */
|
|
528
|
+
default: string | null;
|
|
529
|
+
/** The choices, when this is a single select. Empty for free text. */
|
|
530
|
+
options: ElicitationOption[];
|
|
531
|
+
/**
|
|
532
|
+
* The key a free-text answer is sent under when one is accepted
|
|
533
|
+
* alongside `options` - the user picks a choice *or* types their
|
|
534
|
+
* own. A harness idiom (Claude Code's and Codex's "Other" field),
|
|
535
|
+
* never ACP's own; `None` for a plain select.
|
|
536
|
+
*/
|
|
537
|
+
customField: string | null;
|
|
538
|
+
} |
|
|
539
|
+
/** A floating-point number. */
|
|
540
|
+
{
|
|
541
|
+
type: "number";
|
|
542
|
+
/** Lower bound, when constrained. */
|
|
543
|
+
minimum: number | null;
|
|
544
|
+
/** Upper bound, when constrained. */
|
|
545
|
+
maximum: number | null;
|
|
546
|
+
/** Pre-filled value. */
|
|
547
|
+
default: number | null;
|
|
548
|
+
} |
|
|
549
|
+
/** A whole number. */
|
|
550
|
+
{
|
|
551
|
+
type: "integer";
|
|
552
|
+
/** Lower bound, when constrained. */
|
|
553
|
+
minimum: number | null;
|
|
554
|
+
/** Upper bound, when constrained. */
|
|
555
|
+
maximum: number | null;
|
|
556
|
+
/** Pre-filled value. */
|
|
557
|
+
default: number | null;
|
|
558
|
+
} |
|
|
559
|
+
/** A yes/no. */
|
|
560
|
+
{
|
|
561
|
+
type: "boolean";
|
|
562
|
+
/** Pre-filled value. */
|
|
563
|
+
default: boolean | null;
|
|
564
|
+
} |
|
|
565
|
+
/** Several choices from a list. */
|
|
566
|
+
{
|
|
567
|
+
type: "multi_select";
|
|
568
|
+
/** Fewest selections allowed, when constrained. */
|
|
569
|
+
minItems: number | null;
|
|
570
|
+
/** Most selections allowed, when constrained. */
|
|
571
|
+
maxItems: number | null;
|
|
572
|
+
/** The choices. */
|
|
573
|
+
options: ElicitationOption[];
|
|
574
|
+
/** Pre-selected values. */
|
|
575
|
+
default: string[];
|
|
576
|
+
/**
|
|
577
|
+
* The key a free-text answer is sent under when one is accepted
|
|
578
|
+
* instead of the choices. Harness idiom, `None` for a plain
|
|
579
|
+
* multi-select. See the `String` variant.
|
|
580
|
+
*/
|
|
581
|
+
customField: string | null;
|
|
582
|
+
} |
|
|
583
|
+
/**
|
|
584
|
+
* A property type this fold does not know. A renderer shows that it
|
|
585
|
+
* cannot display the field; decline and cancel still work.
|
|
586
|
+
*/
|
|
587
|
+
{
|
|
588
|
+
type: "unrecognized";
|
|
589
|
+
/** The wire `type`. */
|
|
590
|
+
typeName: string;
|
|
591
|
+
/** The property schema, verbatim. */
|
|
592
|
+
raw: unknown;
|
|
593
|
+
};
|
|
594
|
+
/** What the agent asked for. */
|
|
595
|
+
export type ElicitationRequest =
|
|
596
|
+
/** Structured data through a form the client renders. */
|
|
597
|
+
{
|
|
598
|
+
kind: "form";
|
|
599
|
+
/** The restricted schema describing the form. */
|
|
600
|
+
schema: ElicitationSchema;
|
|
601
|
+
} |
|
|
602
|
+
/** An out-of-band interaction the user consents to open. */
|
|
603
|
+
{
|
|
604
|
+
kind: "url";
|
|
605
|
+
/**
|
|
606
|
+
* The agent's handle for this interaction; `elicitation/complete`
|
|
607
|
+
* names it.
|
|
608
|
+
*/
|
|
609
|
+
elicitationId: string;
|
|
610
|
+
/** Where the user is sent. */
|
|
611
|
+
url: string;
|
|
612
|
+
} |
|
|
613
|
+
/**
|
|
614
|
+
* A Macro user tool (`SendEmail`, `CreateCalendarEvent`) paused for the
|
|
615
|
+
* user's review: the agent drafted the call and asks before it runs.
|
|
616
|
+
*
|
|
617
|
+
* Recognized from the call the form is scoped to - a tool this fold
|
|
618
|
+
* already knows as a user tool - or from `_meta.macro.userTool`, which
|
|
619
|
+
* Macro's own agent stamps. The draft is the call's arguments whole,
|
|
620
|
+
* so a client with the tool's own composer renders that and answers
|
|
621
|
+
* with the whole edited draft; `schema` is the flat form the agent also
|
|
622
|
+
* sent, for a client without one.
|
|
623
|
+
*/
|
|
624
|
+
{
|
|
625
|
+
kind: "user_tool";
|
|
626
|
+
/** The tool, by Macro's name. */
|
|
627
|
+
tool: string;
|
|
628
|
+
/** The call's arguments - the tool's own JSON. */
|
|
629
|
+
draft: unknown;
|
|
630
|
+
/** The restricted form describing the draft's flat fields. */
|
|
631
|
+
schema: ElicitationSchema;
|
|
632
|
+
} |
|
|
633
|
+
/**
|
|
634
|
+
* A mode this fold does not know. Kept raw so nothing is lost; a
|
|
635
|
+
* renderer must not treat it as form or url.
|
|
636
|
+
*/
|
|
637
|
+
{
|
|
638
|
+
kind: "unrecognized";
|
|
639
|
+
/** The wire mode. */
|
|
640
|
+
mode: string;
|
|
641
|
+
/** The request params, verbatim. */
|
|
642
|
+
raw: unknown;
|
|
643
|
+
};
|
|
644
|
+
/**
|
|
645
|
+
* The JSON-RPC id of an agent's `elicitation/create` request, carried whole
|
|
646
|
+
* so the answer echoes exactly what the agent sent.
|
|
647
|
+
*
|
|
648
|
+
* Agents pick these, not us: Claude Code counts from `0`, others use
|
|
649
|
+
* strings. `null` is not a legal id for a request that expects a response,
|
|
650
|
+
* so it is not representable here.
|
|
651
|
+
*/
|
|
652
|
+
export type ElicitationRequestId =
|
|
653
|
+
/**
|
|
654
|
+
* A numeric JSON-RPC id. Specta refuses `i64` (it does not fit a JS
|
|
655
|
+
* number); agents count their requests from zero, so `i32` is the
|
|
656
|
+
* honest TypeScript face.
|
|
657
|
+
*/
|
|
658
|
+
number |
|
|
659
|
+
/** A string JSON-RPC id. */
|
|
660
|
+
string;
|
|
661
|
+
/** ACP's restricted form schema: a flat object of primitive properties. */
|
|
662
|
+
export type ElicitationSchema = {
|
|
663
|
+
/** Schema-level title, when the agent gave one. */
|
|
664
|
+
title: string | null;
|
|
665
|
+
/** Schema-level description, when the agent gave one. */
|
|
666
|
+
description: string | null;
|
|
667
|
+
/** The fields, in the order the agent declared them. */
|
|
668
|
+
properties: ElicitationProperty[];
|
|
669
|
+
/** Property names the agent requires an answer for. */
|
|
670
|
+
required: string[];
|
|
671
|
+
};
|
|
672
|
+
/** Which shared emails to match. */
|
|
673
|
+
export type EmailShared = "exclude" | "include" | "only";
|
|
674
|
+
/** Which mailbox a query reads. */
|
|
675
|
+
export type EmailView = "inbox" | "drafts" | "sent" | "all";
|
|
676
|
+
/** A reference to a workspace item. */
|
|
677
|
+
export type EntityRef = {
|
|
678
|
+
id: string;
|
|
679
|
+
type: EntityType;
|
|
680
|
+
};
|
|
681
|
+
/** The kinds of workspace item a view can show. */
|
|
682
|
+
export type EntityType = "user" | "chat" | "channel" | "channel_message" | "document" | "project" | "email_thread" | "calendar_event" | "team" | "call" | "foreign_entity" | "static_file" | "crm_company" | "crm_contact" | "crm_pipeline" | "reminder" | "skill" | "agent_session" | "scheduled_action" | "initiative" | "database" | "database_row" | "form" | "external_chat" | "email" | "routine" | "channel_thread";
|
|
683
|
+
/** An external page where the person can act on a [`FailureNotice`]. */
|
|
684
|
+
export type FailureLink = {
|
|
685
|
+
/** The link's text, e.g. `Manage Cursor usage`. */
|
|
686
|
+
label: string;
|
|
687
|
+
/** The page, absolute. */
|
|
688
|
+
url: string;
|
|
689
|
+
};
|
|
690
|
+
/**
|
|
691
|
+
* A turn failure the person who prompted can act on, in their terms.
|
|
692
|
+
*
|
|
693
|
+
* A runtime attaches this to the `session/prompt` error as its `data`; the
|
|
694
|
+
* fold reads it back onto the failed turn's stop reason. It exists so a
|
|
695
|
+
* billing wall or a disconnected integration renders as an instruction with
|
|
696
|
+
* somewhere to go, not as the runtime's error text - and so the runtime's
|
|
697
|
+
* error text, which for a report includes source locations, never has to
|
|
698
|
+
* double as the thing a person reads.
|
|
699
|
+
*/
|
|
700
|
+
export type FailureNotice = {
|
|
701
|
+
/** Which class of failure, for readers that treat one specially. */
|
|
702
|
+
kind: FailureNoticeKind;
|
|
703
|
+
/** One short line naming what happened. */
|
|
704
|
+
title: string;
|
|
705
|
+
/** What it means and what to do, in plain language. */
|
|
706
|
+
body: string;
|
|
707
|
+
/** Where acting on it happens, when that is somewhere else. */
|
|
708
|
+
link?: FailureLink | null;
|
|
709
|
+
};
|
|
710
|
+
/** The classes of actionable failure a runtime can report. */
|
|
711
|
+
export type FailureNoticeKind =
|
|
712
|
+
/**
|
|
713
|
+
* The person's own account with the provider has no budget left for
|
|
714
|
+
* this work; the fix is on the provider's billing page.
|
|
715
|
+
*/
|
|
716
|
+
"provider_usage_limit" |
|
|
717
|
+
/** The selected model cannot read image attachments in this conversation. */
|
|
718
|
+
"unsupported_image_input" |
|
|
719
|
+
/**
|
|
720
|
+
* The provider ended the run in failure; its own page for the run is
|
|
721
|
+
* where any detail it kept lives.
|
|
722
|
+
*/
|
|
723
|
+
"provider_run_failed" |
|
|
724
|
+
/**
|
|
725
|
+
* The runtime accepted the prompt but never handed it to the agent;
|
|
726
|
+
* the fix is to send it again.
|
|
727
|
+
*/
|
|
728
|
+
"prompt_not_delivered";
|
|
729
|
+
/**
|
|
730
|
+
* Every filter, each over one field of one kind of item. Id lists match any
|
|
731
|
+
* of their ids.
|
|
732
|
+
*/
|
|
733
|
+
export type FieldFilters = FieldFilters_Serialize | FieldFilters_Deserialize;
|
|
734
|
+
/**
|
|
735
|
+
* Every filter, each over one field of one kind of item. Id lists match any
|
|
736
|
+
* of their ids.
|
|
737
|
+
*/
|
|
738
|
+
export type FieldFilters_Deserialize = {
|
|
739
|
+
calendarEventId?: string[];
|
|
740
|
+
threadId?: string[];
|
|
741
|
+
emailLinkId?: string[];
|
|
742
|
+
emailProjectId?: string[];
|
|
743
|
+
emailSender?: string[];
|
|
744
|
+
channelId?: string[];
|
|
745
|
+
channelType?: string[];
|
|
746
|
+
/**
|
|
747
|
+
* Membership states to match: `[true]` for channels the user is in,
|
|
748
|
+
* `[true, false]` to also match team channels they have not joined.
|
|
749
|
+
*/
|
|
750
|
+
channelIsParticipant?: boolean[];
|
|
751
|
+
channelSenderId?: string[];
|
|
752
|
+
channelMessageThreadId?: string[];
|
|
753
|
+
channelThreadId?: string[];
|
|
754
|
+
channelThreadRootSenderId?: string[];
|
|
755
|
+
channelThreadParticipantId?: string[];
|
|
756
|
+
agentSessionId?: string[];
|
|
757
|
+
agentSessionOwnerId?: string[];
|
|
758
|
+
chatId?: string[];
|
|
759
|
+
chatOwnerId?: string[];
|
|
760
|
+
chatProjectId?: string[];
|
|
761
|
+
folderId?: string[];
|
|
762
|
+
folderOwnerId?: string[];
|
|
763
|
+
callId?: string[];
|
|
764
|
+
callChannelId?: string[];
|
|
765
|
+
callSpeakerId?: string[];
|
|
766
|
+
foreignEntityRecordId?: string[];
|
|
767
|
+
foreignEntitySource?: string[];
|
|
768
|
+
crmCompanyId?: string[];
|
|
769
|
+
/** Property values to match; distinct properties all apply. */
|
|
770
|
+
properties?: PropertyFilter[];
|
|
771
|
+
/** Selected tags, combined by `tagFilterMode`. */
|
|
772
|
+
tagFilters?: PropertyFilter[];
|
|
773
|
+
tagFilterMode?: TagFilterMode;
|
|
774
|
+
emailSeen?: boolean;
|
|
775
|
+
emailDone?: boolean;
|
|
776
|
+
emailImportance?: boolean;
|
|
777
|
+
emailShared?: EmailShared;
|
|
778
|
+
emailCalendarOnly?: boolean;
|
|
779
|
+
channelSeen?: boolean;
|
|
780
|
+
channelDone?: boolean;
|
|
781
|
+
channelImportance?: boolean;
|
|
782
|
+
channelThreadSeen?: boolean;
|
|
783
|
+
channelThreadDone?: boolean;
|
|
784
|
+
chatSeen?: boolean;
|
|
785
|
+
chatDone?: boolean;
|
|
786
|
+
folderSeen?: boolean;
|
|
787
|
+
folderDone?: boolean;
|
|
788
|
+
initiativeSeen?: boolean;
|
|
789
|
+
initiativeDone?: boolean;
|
|
790
|
+
foreignEntitySeen?: boolean;
|
|
791
|
+
foreignEntityDone?: boolean;
|
|
792
|
+
foreignEntityIncludesMe?: boolean;
|
|
793
|
+
callStatus?: CallStatus;
|
|
794
|
+
callAttended?: boolean;
|
|
795
|
+
crmCompanyHidden?: boolean;
|
|
796
|
+
crmContactHidden?: boolean;
|
|
797
|
+
/** Literal text matched against a CRM contact's name or email. */
|
|
798
|
+
crmContactSearch?: string;
|
|
799
|
+
calendarEventSeen?: boolean;
|
|
800
|
+
calendarEventDone?: boolean;
|
|
801
|
+
includeAgentSessions?: boolean;
|
|
802
|
+
chatCreatedAt?: DateRangeFilter_Deserialize;
|
|
803
|
+
chatUpdatedAt?: DateRangeFilter_Deserialize;
|
|
804
|
+
folderCreatedAt?: DateRangeFilter_Deserialize;
|
|
805
|
+
folderUpdatedAt?: DateRangeFilter_Deserialize;
|
|
806
|
+
emailUpdatedAt?: DateRangeFilter_Deserialize;
|
|
807
|
+
} & DocumentFieldFilters_Deserialize;
|
|
808
|
+
/**
|
|
809
|
+
* Every filter, each over one field of one kind of item. Id lists match any
|
|
810
|
+
* of their ids.
|
|
811
|
+
*/
|
|
812
|
+
export type FieldFilters_Serialize = {
|
|
813
|
+
calendarEventId?: string[];
|
|
814
|
+
threadId?: string[];
|
|
815
|
+
emailLinkId?: string[];
|
|
816
|
+
emailProjectId?: string[];
|
|
817
|
+
emailSender?: string[];
|
|
818
|
+
channelId?: string[];
|
|
819
|
+
channelType?: string[];
|
|
820
|
+
/**
|
|
821
|
+
* Membership states to match: `[true]` for channels the user is in,
|
|
822
|
+
* `[true, false]` to also match team channels they have not joined.
|
|
823
|
+
*/
|
|
824
|
+
channelIsParticipant?: boolean[];
|
|
825
|
+
channelSenderId?: string[];
|
|
826
|
+
channelMessageThreadId?: string[];
|
|
827
|
+
channelThreadId?: string[];
|
|
828
|
+
channelThreadRootSenderId?: string[];
|
|
829
|
+
channelThreadParticipantId?: string[];
|
|
830
|
+
agentSessionId?: string[];
|
|
831
|
+
agentSessionOwnerId?: string[];
|
|
832
|
+
chatId?: string[];
|
|
833
|
+
chatOwnerId?: string[];
|
|
834
|
+
chatProjectId?: string[];
|
|
835
|
+
folderId?: string[];
|
|
836
|
+
folderOwnerId?: string[];
|
|
837
|
+
callId?: string[];
|
|
838
|
+
callChannelId?: string[];
|
|
839
|
+
callSpeakerId?: string[];
|
|
840
|
+
foreignEntityRecordId?: string[];
|
|
841
|
+
foreignEntitySource?: string[];
|
|
842
|
+
crmCompanyId?: string[];
|
|
843
|
+
/** Property values to match; distinct properties all apply. */
|
|
844
|
+
properties?: PropertyFilter[];
|
|
845
|
+
/** Selected tags, combined by `tagFilterMode`. */
|
|
846
|
+
tagFilters?: PropertyFilter[];
|
|
847
|
+
tagFilterMode?: TagFilterMode;
|
|
848
|
+
emailSeen?: boolean;
|
|
849
|
+
emailDone?: boolean;
|
|
850
|
+
emailImportance?: boolean;
|
|
851
|
+
emailShared?: EmailShared;
|
|
852
|
+
emailCalendarOnly?: boolean;
|
|
853
|
+
channelSeen?: boolean;
|
|
854
|
+
channelDone?: boolean;
|
|
855
|
+
channelImportance?: boolean;
|
|
856
|
+
channelThreadSeen?: boolean;
|
|
857
|
+
channelThreadDone?: boolean;
|
|
858
|
+
chatSeen?: boolean;
|
|
859
|
+
chatDone?: boolean;
|
|
860
|
+
folderSeen?: boolean;
|
|
861
|
+
folderDone?: boolean;
|
|
862
|
+
initiativeSeen?: boolean;
|
|
863
|
+
initiativeDone?: boolean;
|
|
864
|
+
foreignEntitySeen?: boolean;
|
|
865
|
+
foreignEntityDone?: boolean;
|
|
866
|
+
foreignEntityIncludesMe?: boolean;
|
|
867
|
+
callStatus?: CallStatus;
|
|
868
|
+
callAttended?: boolean;
|
|
869
|
+
crmCompanyHidden?: boolean;
|
|
870
|
+
crmContactHidden?: boolean;
|
|
871
|
+
/** Literal text matched against a CRM contact's name or email. */
|
|
872
|
+
crmContactSearch?: string;
|
|
873
|
+
calendarEventSeen?: boolean;
|
|
874
|
+
calendarEventDone?: boolean;
|
|
875
|
+
includeAgentSessions?: boolean;
|
|
876
|
+
chatCreatedAt?: DateRangeFilter_Serialize;
|
|
877
|
+
chatUpdatedAt?: DateRangeFilter_Serialize;
|
|
878
|
+
folderCreatedAt?: DateRangeFilter_Serialize;
|
|
879
|
+
folderUpdatedAt?: DateRangeFilter_Serialize;
|
|
880
|
+
emailUpdatedAt?: DateRangeFilter_Serialize;
|
|
881
|
+
} & DocumentFieldFilters_Serialize;
|
|
882
|
+
/** A file modification a tool reported. */
|
|
883
|
+
export type FileDiff = {
|
|
884
|
+
/** The file that changed. */
|
|
885
|
+
path: string;
|
|
886
|
+
/** Prior contents, absent when the file is new. */
|
|
887
|
+
oldText: string | null;
|
|
888
|
+
/** New contents. */
|
|
889
|
+
newText: string;
|
|
890
|
+
};
|
|
891
|
+
/** One renderable message, scoped to its agent session for its reader. */
|
|
892
|
+
export type FoldedMessage = FoldedMessage_Serialize | FoldedMessage_Deserialize;
|
|
893
|
+
/** One renderable message, scoped to its agent session for its reader. */
|
|
894
|
+
export type FoldedMessage_Deserialize = {
|
|
895
|
+
/** Session that scopes this message id. */
|
|
896
|
+
agentSessionId: string;
|
|
897
|
+
/**
|
|
898
|
+
* The message's identity within its session, `<turn>:<author kind>`
|
|
899
|
+
* (`3:agent`): stable across streaming updates, rebases, and pending
|
|
900
|
+
* flipping off, so a reader can key and reconcile rows by it.
|
|
901
|
+
*/
|
|
902
|
+
key: string;
|
|
903
|
+
/** The turn within the session, assigned in log order from zero. */
|
|
904
|
+
turn: number;
|
|
905
|
+
/** Who produced the message. */
|
|
906
|
+
author: Author;
|
|
907
|
+
/**
|
|
908
|
+
* The id the control endpoint returned for the action that derived this
|
|
909
|
+
* message, for correlation. Absent on agent messages and on frames the
|
|
910
|
+
* control plane did not mint.
|
|
911
|
+
*/
|
|
912
|
+
requestId: string | null;
|
|
913
|
+
/** Ordered renderable content. Never empty. */
|
|
914
|
+
parts: MessagePart_Deserialize[];
|
|
915
|
+
/** How the turn ended, absent while it remains in flight. */
|
|
916
|
+
stop: StopReason | null;
|
|
917
|
+
/**
|
|
918
|
+
* Derived from an action this client issued that the log has not yet
|
|
919
|
+
* confirmed. A reader shows it as sending; it flips off in place when
|
|
920
|
+
* the confirmed frame arrives.
|
|
921
|
+
*/
|
|
922
|
+
pending: boolean;
|
|
923
|
+
/**
|
|
924
|
+
* How an agent's reply reads as a conversation, the same boundaries the
|
|
925
|
+
* server posts channel messages by. Empty on a user's message.
|
|
926
|
+
*/
|
|
927
|
+
segments: Segment_Deserialize[];
|
|
928
|
+
/**
|
|
929
|
+
* What an agent's unfinished reply is doing now; absent once its turn
|
|
930
|
+
* has ended and on a user's message.
|
|
931
|
+
*/
|
|
932
|
+
phase: TurnPhase | null;
|
|
933
|
+
/**
|
|
934
|
+
* When a user's prompt was posted, RFC 3339. Absent on agent and control
|
|
935
|
+
* messages, until the log confirms a prompt, and on history a runtime
|
|
936
|
+
* replayed on load.
|
|
937
|
+
*/
|
|
938
|
+
postedAt: string | null;
|
|
939
|
+
};
|
|
940
|
+
/** One renderable message, scoped to its agent session for its reader. */
|
|
941
|
+
export type FoldedMessage_Serialize = {
|
|
942
|
+
/** Session that scopes this message id. */
|
|
943
|
+
agentSessionId: string;
|
|
944
|
+
/**
|
|
945
|
+
* The message's identity within its session, `<turn>:<author kind>`
|
|
946
|
+
* (`3:agent`): stable across streaming updates, rebases, and pending
|
|
947
|
+
* flipping off, so a reader can key and reconcile rows by it.
|
|
948
|
+
*/
|
|
949
|
+
key: string;
|
|
950
|
+
/** The turn within the session, assigned in log order from zero. */
|
|
951
|
+
turn: number;
|
|
952
|
+
/** Who produced the message. */
|
|
953
|
+
author: Author;
|
|
954
|
+
/**
|
|
955
|
+
* The id the control endpoint returned for the action that derived this
|
|
956
|
+
* message, for correlation. Absent on agent messages and on frames the
|
|
957
|
+
* control plane did not mint.
|
|
958
|
+
*/
|
|
959
|
+
requestId: string | null;
|
|
960
|
+
/** Ordered renderable content. Never empty. */
|
|
961
|
+
parts: MessagePart_Serialize[];
|
|
962
|
+
/** How the turn ended, absent while it remains in flight. */
|
|
963
|
+
stop: StopReason | null;
|
|
964
|
+
/**
|
|
965
|
+
* Derived from an action this client issued that the log has not yet
|
|
966
|
+
* confirmed. A reader shows it as sending; it flips off in place when
|
|
967
|
+
* the confirmed frame arrives.
|
|
968
|
+
*/
|
|
969
|
+
pending: boolean;
|
|
970
|
+
/**
|
|
971
|
+
* How an agent's reply reads as a conversation, the same boundaries the
|
|
972
|
+
* server posts channel messages by. Empty on a user's message.
|
|
973
|
+
*/
|
|
974
|
+
segments: Segment_Serialize[];
|
|
975
|
+
/**
|
|
976
|
+
* What an agent's unfinished reply is doing now; absent once its turn
|
|
977
|
+
* has ended and on a user's message.
|
|
978
|
+
*/
|
|
979
|
+
phase: TurnPhase | null;
|
|
980
|
+
/**
|
|
981
|
+
* When a user's prompt was posted, RFC 3339. Absent on agent and control
|
|
982
|
+
* messages, until the log confirms a prompt, and on history a runtime
|
|
983
|
+
* replayed on load.
|
|
984
|
+
*/
|
|
985
|
+
postedAt: string | null;
|
|
986
|
+
};
|
|
987
|
+
/**
|
|
988
|
+
* One change a pushed frame implied.
|
|
989
|
+
*
|
|
990
|
+
* Payloads are carried whole rather than as deltas: a reader replaces the
|
|
991
|
+
* message under the same session, turn, and author, or replaces its metadata
|
|
992
|
+
* outright.
|
|
993
|
+
*/
|
|
994
|
+
export type FoldedStreamEvent = FoldedStreamEvent_Serialize | FoldedStreamEvent_Deserialize;
|
|
995
|
+
/**
|
|
996
|
+
* One change a pushed frame implied.
|
|
997
|
+
*
|
|
998
|
+
* Payloads are carried whole rather than as deltas: a reader replaces the
|
|
999
|
+
* message under the same session, turn, and author, or replaces its metadata
|
|
1000
|
+
* outright.
|
|
1001
|
+
*/
|
|
1002
|
+
export type FoldedStreamEvent_Deserialize =
|
|
1003
|
+
/** A message derived for the first time. */
|
|
1004
|
+
({
|
|
1005
|
+
kind: "new";
|
|
1006
|
+
/** The message as it now stands. */
|
|
1007
|
+
message: FoldedMessage_Deserialize;
|
|
1008
|
+
}) & {
|
|
1009
|
+
messages?: never;
|
|
1010
|
+
metadata?: never;
|
|
1011
|
+
} |
|
|
1012
|
+
/** A previously reported message, changed. */
|
|
1013
|
+
({
|
|
1014
|
+
kind: "update";
|
|
1015
|
+
/** The message as it now stands. */
|
|
1016
|
+
message: FoldedMessage_Deserialize;
|
|
1017
|
+
}) & {
|
|
1018
|
+
messages?: never;
|
|
1019
|
+
metadata?: never;
|
|
1020
|
+
} |
|
|
1021
|
+
/** Replace all messages for this session, including removal of old rows. */
|
|
1022
|
+
({
|
|
1023
|
+
kind: "replace";
|
|
1024
|
+
/** The complete committed conversation. */
|
|
1025
|
+
messages: FoldedMessage_Deserialize[];
|
|
1026
|
+
}) & {
|
|
1027
|
+
message?: never;
|
|
1028
|
+
metadata?: never;
|
|
1029
|
+
} |
|
|
1030
|
+
/** The session's metadata changed; here it is in full. */
|
|
1031
|
+
({
|
|
1032
|
+
kind: "metadata";
|
|
1033
|
+
/** The metadata as it now stands. */
|
|
1034
|
+
metadata: SessionMetadata_Deserialize;
|
|
1035
|
+
}) & {
|
|
1036
|
+
message?: never;
|
|
1037
|
+
messages?: never;
|
|
1038
|
+
};
|
|
1039
|
+
/**
|
|
1040
|
+
* One change a pushed frame implied.
|
|
1041
|
+
*
|
|
1042
|
+
* Payloads are carried whole rather than as deltas: a reader replaces the
|
|
1043
|
+
* message under the same session, turn, and author, or replaces its metadata
|
|
1044
|
+
* outright.
|
|
1045
|
+
*/
|
|
1046
|
+
export type FoldedStreamEvent_Serialize =
|
|
1047
|
+
/** A message derived for the first time. */
|
|
1048
|
+
({
|
|
1049
|
+
kind: "new";
|
|
1050
|
+
/** The message as it now stands. */
|
|
1051
|
+
message: FoldedMessage_Serialize;
|
|
1052
|
+
}) & {
|
|
1053
|
+
messages?: never;
|
|
1054
|
+
metadata?: never;
|
|
1055
|
+
} |
|
|
1056
|
+
/** A previously reported message, changed. */
|
|
1057
|
+
({
|
|
1058
|
+
kind: "update";
|
|
1059
|
+
/** The message as it now stands. */
|
|
1060
|
+
message: FoldedMessage_Serialize;
|
|
1061
|
+
}) & {
|
|
1062
|
+
messages?: never;
|
|
1063
|
+
metadata?: never;
|
|
1064
|
+
} |
|
|
1065
|
+
/** Replace all messages for this session, including removal of old rows. */
|
|
1066
|
+
({
|
|
1067
|
+
kind: "replace";
|
|
1068
|
+
/** The complete committed conversation. */
|
|
1069
|
+
messages: FoldedMessage_Serialize[];
|
|
1070
|
+
}) & {
|
|
1071
|
+
message?: never;
|
|
1072
|
+
metadata?: never;
|
|
1073
|
+
} |
|
|
1074
|
+
/** The session's metadata changed; here it is in full. */
|
|
1075
|
+
({
|
|
1076
|
+
kind: "metadata";
|
|
1077
|
+
/** The metadata as it now stands. */
|
|
1078
|
+
metadata: SessionMetadata_Serialize;
|
|
1079
|
+
}) & {
|
|
1080
|
+
message?: never;
|
|
1081
|
+
messages?: never;
|
|
1082
|
+
};
|
|
1083
|
+
/** The space between a container's children, as a Tailwind-ish step. */
|
|
1084
|
+
export type Gap = number;
|
|
1085
|
+
/** The facet a list groups its rows by. */
|
|
1086
|
+
export type GroupBy = "date" | "entity_type" | "project";
|
|
1087
|
+
/**
|
|
1088
|
+
* Which ACP agent produced a session's log.
|
|
1089
|
+
*
|
|
1090
|
+
* ACP names none of a harness's conventions - which `_meta` keys it writes,
|
|
1091
|
+
* what it calls its tools, how it reports a subagent - so the fold has to
|
|
1092
|
+
* know who it is reading in order to read those. The agent announces itself
|
|
1093
|
+
* in the `initialize` response's `agentInfo.name`; a log that starts
|
|
1094
|
+
* mid-session (a resume) is recognized from the `_meta` namespaces its
|
|
1095
|
+
* first tool frames carry instead. Carried on the metadata so a reader can
|
|
1096
|
+
* show it and never has to infer it.
|
|
1097
|
+
*
|
|
1098
|
+
* [`Self::Unknown`] is a real state, not a failure: every reader falls back
|
|
1099
|
+
* to the harness-neutral conventions, and a harness this fold has not met
|
|
1100
|
+
* still folds to the generic vocabulary.
|
|
1101
|
+
*/
|
|
1102
|
+
export type Harness =
|
|
1103
|
+
/** `@agentclientprotocol/claude-agent-acp`. */
|
|
1104
|
+
"claude_code" |
|
|
1105
|
+
/** `OpenCode`, whose ACP server is built in. */
|
|
1106
|
+
"open_code" |
|
|
1107
|
+
/** OpenAI Codex, through `codex-acp`. */
|
|
1108
|
+
"codex" |
|
|
1109
|
+
/** Cursor cloud agents, through this repository's `cursor_cloud_agents`. */
|
|
1110
|
+
"cursor" |
|
|
1111
|
+
/** Macro's own in-process agent, `agent_inmem`. */
|
|
1112
|
+
"macro" |
|
|
1113
|
+
/** Nous Research's Hermes agent. */
|
|
1114
|
+
"hermes" |
|
|
1115
|
+
/** OpenClaw. */
|
|
1116
|
+
"open_claw" |
|
|
1117
|
+
/** Not announced, or an agent this fold does not know. */
|
|
1118
|
+
"unknown";
|
|
1119
|
+
/** One object an import report calls out. */
|
|
1120
|
+
export type ImportItem = ImportItem_Serialize | ImportItem_Deserialize;
|
|
1121
|
+
/** One object an import report calls out. */
|
|
1122
|
+
export type ImportItem_Deserialize = {
|
|
1123
|
+
/** The object's title. */
|
|
1124
|
+
title: string;
|
|
1125
|
+
/** Its URL in the source workspace. */
|
|
1126
|
+
url: string | null;
|
|
1127
|
+
/** Why it is called out. */
|
|
1128
|
+
reason: string | null;
|
|
1129
|
+
};
|
|
1130
|
+
/** One object an import report calls out. */
|
|
1131
|
+
export type ImportItem_Serialize = {
|
|
1132
|
+
/** The object's title. */
|
|
1133
|
+
title: string;
|
|
1134
|
+
/** Its URL in the source workspace. */
|
|
1135
|
+
url?: string | null;
|
|
1136
|
+
/** Why it is called out. */
|
|
1137
|
+
reason?: string | null;
|
|
1138
|
+
};
|
|
1139
|
+
/** How an approved import's write ended. */
|
|
1140
|
+
export type ImportOutcome =
|
|
1141
|
+
/** Every planned object was written or accounted for. */
|
|
1142
|
+
"completed" |
|
|
1143
|
+
/** The write stopped on an error. */
|
|
1144
|
+
"failed" |
|
|
1145
|
+
/** The owner cancelled it. */
|
|
1146
|
+
"cancelled";
|
|
1147
|
+
/** What an import plan proposes, once it is ready to approve. */
|
|
1148
|
+
export type ImportPlan = {
|
|
1149
|
+
/** The workspace the import reads. */
|
|
1150
|
+
source?: ImportWorkspace;
|
|
1151
|
+
/** Objects to copy as they are; projects for Linear and Jira. */
|
|
1152
|
+
copy: number;
|
|
1153
|
+
/** Data sources whose rows become tasks; issues for Linear and Jira. */
|
|
1154
|
+
taskLists: number;
|
|
1155
|
+
/** Objects to leave in the source workspace. */
|
|
1156
|
+
skipped: number;
|
|
1157
|
+
/** Objects that need handling by hand. */
|
|
1158
|
+
byHand: number;
|
|
1159
|
+
};
|
|
1160
|
+
/** The final report of an approved workspace import, with no page content. */
|
|
1161
|
+
export type ImportSettlement = ImportSettlement_Serialize | ImportSettlement_Deserialize;
|
|
1162
|
+
/** The final report of an approved workspace import, with no page content. */
|
|
1163
|
+
export type ImportSettlement_Deserialize = {
|
|
1164
|
+
/** The workspace the import read. */
|
|
1165
|
+
source?: ImportWorkspace;
|
|
1166
|
+
/** How the write ended. */
|
|
1167
|
+
outcome: ImportOutcome;
|
|
1168
|
+
/** Why it failed, or what went wrong in a completed write. */
|
|
1169
|
+
error: string | null;
|
|
1170
|
+
/** Objects written into Macro. */
|
|
1171
|
+
imported: number;
|
|
1172
|
+
/**
|
|
1173
|
+
* Objects the plan copies: as they are or as task lists from Notion,
|
|
1174
|
+
* projects and issues from Linear or Jira.
|
|
1175
|
+
*/
|
|
1176
|
+
planned: number;
|
|
1177
|
+
/** Planned documents. */
|
|
1178
|
+
documents: number;
|
|
1179
|
+
/** Planned databases. */
|
|
1180
|
+
databases: number;
|
|
1181
|
+
/** Rows those databases hold. */
|
|
1182
|
+
databaseRows: number;
|
|
1183
|
+
/** Planned task lists; issues that become tasks for Linear and Jira. */
|
|
1184
|
+
taskLists: number;
|
|
1185
|
+
/** Tasks those task lists or issues become. */
|
|
1186
|
+
taskRows: number;
|
|
1187
|
+
/** Objects left in the source workspace. */
|
|
1188
|
+
skipped: number;
|
|
1189
|
+
/** Planned objects that were not written. */
|
|
1190
|
+
notWritten: number;
|
|
1191
|
+
/** Written objects shared with the owner's team. */
|
|
1192
|
+
sharedWithTeam: number;
|
|
1193
|
+
/** Objects teammates had already imported, linked instead of copied. */
|
|
1194
|
+
alreadyInMacro: number;
|
|
1195
|
+
/** Objects a teammate is writing at the same time, linked once written. */
|
|
1196
|
+
waitingOnTeammates: number;
|
|
1197
|
+
/** The Macro folder the import writes into. */
|
|
1198
|
+
rootFolderId: string | null;
|
|
1199
|
+
/** Objects that could not be imported, at most [`MAX_IMPORT_ITEMS`]. */
|
|
1200
|
+
failures: ImportItem_Deserialize[];
|
|
1201
|
+
/** Objects left for the owner to handle by hand, at most [`MAX_IMPORT_ITEMS`]. */
|
|
1202
|
+
handItems: ImportItem_Deserialize[];
|
|
1203
|
+
};
|
|
1204
|
+
/** The final report of an approved workspace import, with no page content. */
|
|
1205
|
+
export type ImportSettlement_Serialize = {
|
|
1206
|
+
/** The workspace the import read. */
|
|
1207
|
+
source: ImportWorkspace;
|
|
1208
|
+
/** How the write ended. */
|
|
1209
|
+
outcome: ImportOutcome;
|
|
1210
|
+
/** Why it failed, or what went wrong in a completed write. */
|
|
1211
|
+
error?: string | null;
|
|
1212
|
+
/** Objects written into Macro. */
|
|
1213
|
+
imported: number;
|
|
1214
|
+
/**
|
|
1215
|
+
* Objects the plan copies: as they are or as task lists from Notion,
|
|
1216
|
+
* projects and issues from Linear or Jira.
|
|
1217
|
+
*/
|
|
1218
|
+
planned: number;
|
|
1219
|
+
/** Planned documents. */
|
|
1220
|
+
documents: number;
|
|
1221
|
+
/** Planned databases. */
|
|
1222
|
+
databases: number;
|
|
1223
|
+
/** Rows those databases hold. */
|
|
1224
|
+
databaseRows: number;
|
|
1225
|
+
/** Planned task lists; issues that become tasks for Linear and Jira. */
|
|
1226
|
+
taskLists: number;
|
|
1227
|
+
/** Tasks those task lists or issues become. */
|
|
1228
|
+
taskRows: number;
|
|
1229
|
+
/** Objects left in the source workspace. */
|
|
1230
|
+
skipped: number;
|
|
1231
|
+
/** Planned objects that were not written. */
|
|
1232
|
+
notWritten: number;
|
|
1233
|
+
/** Written objects shared with the owner's team. */
|
|
1234
|
+
sharedWithTeam: number;
|
|
1235
|
+
/** Objects teammates had already imported, linked instead of copied. */
|
|
1236
|
+
alreadyInMacro: number;
|
|
1237
|
+
/** Objects a teammate is writing at the same time, linked once written. */
|
|
1238
|
+
waitingOnTeammates: number;
|
|
1239
|
+
/** The Macro folder the import writes into. */
|
|
1240
|
+
rootFolderId?: string | null;
|
|
1241
|
+
/** Objects that could not be imported, at most [`MAX_IMPORT_ITEMS`]. */
|
|
1242
|
+
failures: ImportItem_Serialize[];
|
|
1243
|
+
/** Objects left for the owner to handle by hand, at most [`MAX_IMPORT_ITEMS`]. */
|
|
1244
|
+
handItems: ImportItem_Serialize[];
|
|
1245
|
+
};
|
|
1246
|
+
/**
|
|
1247
|
+
* The workspace an import reads. Events stored before Linear and Jira
|
|
1248
|
+
* imports existed are Notion's.
|
|
1249
|
+
*/
|
|
1250
|
+
export type ImportWorkspace =
|
|
1251
|
+
/** Notion pages and databases. */
|
|
1252
|
+
"notion" |
|
|
1253
|
+
/** Linear projects and issues. */
|
|
1254
|
+
"linear" |
|
|
1255
|
+
/** Jira projects, epics and issues. */
|
|
1256
|
+
"jira";
|
|
1257
|
+
/** Review item state, shared with notification consumers. */
|
|
1258
|
+
export type ItemStatus =
|
|
1259
|
+
/** Still awaiting a decision. */
|
|
1260
|
+
"pending" |
|
|
1261
|
+
/** Claimed for execution. */
|
|
1262
|
+
"submitting" |
|
|
1263
|
+
/** Confirmed complete. */
|
|
1264
|
+
"completed" |
|
|
1265
|
+
/** Dismissed by the owner. */
|
|
1266
|
+
"dismissed" |
|
|
1267
|
+
/** Outcome requires reconciliation. */
|
|
1268
|
+
"unknown";
|
|
1269
|
+
/** How a container spaces its children along its axis. */
|
|
1270
|
+
export type Justify = "start" | "center" | "end" | "between";
|
|
1271
|
+
/** Where a list's items come from. */
|
|
1272
|
+
export type ListSource = ListSource_Serialize | ListSource_Deserialize;
|
|
1273
|
+
/** Where a list's items come from. */
|
|
1274
|
+
export type ListSource_Deserialize =
|
|
1275
|
+
/** The items a filter matches, fetched by the list itself. */
|
|
1276
|
+
({
|
|
1277
|
+
kind: "query";
|
|
1278
|
+
query: Query_Deserialize;
|
|
1279
|
+
}) & {
|
|
1280
|
+
entities?: never;
|
|
1281
|
+
} |
|
|
1282
|
+
/** A fixed set of items. */
|
|
1283
|
+
({
|
|
1284
|
+
kind: "items";
|
|
1285
|
+
entities: EntityRef[];
|
|
1286
|
+
}) & {
|
|
1287
|
+
query?: never;
|
|
1288
|
+
};
|
|
1289
|
+
/** Where a list's items come from. */
|
|
1290
|
+
export type ListSource_Serialize =
|
|
1291
|
+
/** The items a filter matches, fetched by the list itself. */
|
|
1292
|
+
({
|
|
1293
|
+
kind: "query";
|
|
1294
|
+
query: Query_Serialize;
|
|
1295
|
+
}) & {
|
|
1296
|
+
entities?: never;
|
|
1297
|
+
} |
|
|
1298
|
+
/** A fixed set of items. */
|
|
1299
|
+
({
|
|
1300
|
+
kind: "items";
|
|
1301
|
+
entities: EntityRef[];
|
|
1302
|
+
}) & {
|
|
1303
|
+
query?: never;
|
|
1304
|
+
};
|
|
1305
|
+
/** A unit of renderable content. */
|
|
1306
|
+
export type MessagePart = MessagePart_Serialize | MessagePart_Deserialize;
|
|
1307
|
+
/** A unit of renderable content. */
|
|
1308
|
+
export type MessagePart_Deserialize =
|
|
1309
|
+
/** Prose from the user or the agent. */
|
|
1310
|
+
({
|
|
1311
|
+
kind: "text";
|
|
1312
|
+
/** The prose. */
|
|
1313
|
+
text: string;
|
|
1314
|
+
}) & {
|
|
1315
|
+
approvalId?: never;
|
|
1316
|
+
arguments?: never;
|
|
1317
|
+
control?: never;
|
|
1318
|
+
detail?: never;
|
|
1319
|
+
entries?: never;
|
|
1320
|
+
event?: never;
|
|
1321
|
+
id?: never;
|
|
1322
|
+
message?: never;
|
|
1323
|
+
mimeType?: never;
|
|
1324
|
+
name?: never;
|
|
1325
|
+
options?: never;
|
|
1326
|
+
outcome?: never;
|
|
1327
|
+
remembered?: never;
|
|
1328
|
+
reported?: never;
|
|
1329
|
+
request?: never;
|
|
1330
|
+
requestId?: never;
|
|
1331
|
+
requestedBy?: never;
|
|
1332
|
+
resolvedBy?: never;
|
|
1333
|
+
serverName?: never;
|
|
1334
|
+
serverSlug?: never;
|
|
1335
|
+
size?: never;
|
|
1336
|
+
status?: never;
|
|
1337
|
+
summary?: never;
|
|
1338
|
+
toolCall?: never;
|
|
1339
|
+
toolName?: never;
|
|
1340
|
+
toolOutcome?: never;
|
|
1341
|
+
uri?: never;
|
|
1342
|
+
} |
|
|
1343
|
+
/**
|
|
1344
|
+
* A file the user attached to their prompt, by where it can be fetched.
|
|
1345
|
+
*
|
|
1346
|
+
* Read off the prompt's `resource_link` blocks - the only shape this
|
|
1347
|
+
* side sends files in, since bytes never ride the log. Rendering decides
|
|
1348
|
+
* from `mime_type` whether that is a thumbnail or a chip.
|
|
1349
|
+
*/
|
|
1350
|
+
({
|
|
1351
|
+
kind: "attachment";
|
|
1352
|
+
/** Where the file can be fetched - a static file service URL. */
|
|
1353
|
+
uri: string;
|
|
1354
|
+
/** Display name, typically the original file name. */
|
|
1355
|
+
name: string;
|
|
1356
|
+
/** The file's media type, when the sender knew it. */
|
|
1357
|
+
mimeType: string | null;
|
|
1358
|
+
/**
|
|
1359
|
+
* Size in bytes, when the sender knew it. A double on the wire:
|
|
1360
|
+
* specta refuses 64-bit integers, and no file this renders is
|
|
1361
|
+
* anywhere near the precision limit.
|
|
1362
|
+
*/
|
|
1363
|
+
size: number | null;
|
|
1364
|
+
}) & {
|
|
1365
|
+
approvalId?: never;
|
|
1366
|
+
arguments?: never;
|
|
1367
|
+
control?: never;
|
|
1368
|
+
detail?: never;
|
|
1369
|
+
entries?: never;
|
|
1370
|
+
event?: never;
|
|
1371
|
+
id?: never;
|
|
1372
|
+
message?: never;
|
|
1373
|
+
options?: never;
|
|
1374
|
+
outcome?: never;
|
|
1375
|
+
remembered?: never;
|
|
1376
|
+
reported?: never;
|
|
1377
|
+
request?: never;
|
|
1378
|
+
requestId?: never;
|
|
1379
|
+
requestedBy?: never;
|
|
1380
|
+
resolvedBy?: never;
|
|
1381
|
+
serverName?: never;
|
|
1382
|
+
serverSlug?: never;
|
|
1383
|
+
status?: never;
|
|
1384
|
+
summary?: never;
|
|
1385
|
+
text?: never;
|
|
1386
|
+
toolCall?: never;
|
|
1387
|
+
toolName?: never;
|
|
1388
|
+
toolOutcome?: never;
|
|
1389
|
+
} |
|
|
1390
|
+
/** The agent's reasoning, which a reader may want to hide by default. */
|
|
1391
|
+
({
|
|
1392
|
+
kind: "thought";
|
|
1393
|
+
/** The reasoning. */
|
|
1394
|
+
text: string;
|
|
1395
|
+
}) & {
|
|
1396
|
+
approvalId?: never;
|
|
1397
|
+
arguments?: never;
|
|
1398
|
+
control?: never;
|
|
1399
|
+
detail?: never;
|
|
1400
|
+
entries?: never;
|
|
1401
|
+
event?: never;
|
|
1402
|
+
id?: never;
|
|
1403
|
+
message?: never;
|
|
1404
|
+
mimeType?: never;
|
|
1405
|
+
name?: never;
|
|
1406
|
+
options?: never;
|
|
1407
|
+
outcome?: never;
|
|
1408
|
+
remembered?: never;
|
|
1409
|
+
reported?: never;
|
|
1410
|
+
request?: never;
|
|
1411
|
+
requestId?: never;
|
|
1412
|
+
requestedBy?: never;
|
|
1413
|
+
resolvedBy?: never;
|
|
1414
|
+
serverName?: never;
|
|
1415
|
+
serverSlug?: never;
|
|
1416
|
+
size?: never;
|
|
1417
|
+
status?: never;
|
|
1418
|
+
summary?: never;
|
|
1419
|
+
toolCall?: never;
|
|
1420
|
+
toolName?: never;
|
|
1421
|
+
toolOutcome?: never;
|
|
1422
|
+
uri?: never;
|
|
1423
|
+
} |
|
|
1424
|
+
/** A tool the agent invoked. */
|
|
1425
|
+
({
|
|
1426
|
+
kind: "tool_use";
|
|
1427
|
+
/** The ACP `toolCallId`. */
|
|
1428
|
+
id: ToolUseId;
|
|
1429
|
+
/** What the harness called the tool. */
|
|
1430
|
+
name: ToolName;
|
|
1431
|
+
/** Where the call got to. */
|
|
1432
|
+
status: ToolStatus;
|
|
1433
|
+
/** What the tool did, as far as the log reveals. */
|
|
1434
|
+
detail: ToolDetail_Deserialize;
|
|
1435
|
+
}) & {
|
|
1436
|
+
approvalId?: never;
|
|
1437
|
+
arguments?: never;
|
|
1438
|
+
control?: never;
|
|
1439
|
+
entries?: never;
|
|
1440
|
+
event?: never;
|
|
1441
|
+
message?: never;
|
|
1442
|
+
mimeType?: never;
|
|
1443
|
+
options?: never;
|
|
1444
|
+
outcome?: never;
|
|
1445
|
+
remembered?: never;
|
|
1446
|
+
reported?: never;
|
|
1447
|
+
request?: never;
|
|
1448
|
+
requestId?: never;
|
|
1449
|
+
requestedBy?: never;
|
|
1450
|
+
resolvedBy?: never;
|
|
1451
|
+
serverName?: never;
|
|
1452
|
+
serverSlug?: never;
|
|
1453
|
+
size?: never;
|
|
1454
|
+
summary?: never;
|
|
1455
|
+
text?: never;
|
|
1456
|
+
toolCall?: never;
|
|
1457
|
+
toolName?: never;
|
|
1458
|
+
toolOutcome?: never;
|
|
1459
|
+
uri?: never;
|
|
1460
|
+
} |
|
|
1461
|
+
/** The agent asking to proceed. */
|
|
1462
|
+
({
|
|
1463
|
+
kind: "permission";
|
|
1464
|
+
/** The agent request id an approval must echo. */
|
|
1465
|
+
requestId: AgentRequestId;
|
|
1466
|
+
/** The tool call permission was requested for. */
|
|
1467
|
+
toolCall: ToolUseId;
|
|
1468
|
+
/** The choices offered, in the order ACP listed them. */
|
|
1469
|
+
options: PermissionOption[];
|
|
1470
|
+
/** How the request has resolved so far. */
|
|
1471
|
+
outcome: PermissionOutcome;
|
|
1472
|
+
}) & {
|
|
1473
|
+
approvalId?: never;
|
|
1474
|
+
arguments?: never;
|
|
1475
|
+
control?: never;
|
|
1476
|
+
detail?: never;
|
|
1477
|
+
entries?: never;
|
|
1478
|
+
event?: never;
|
|
1479
|
+
id?: never;
|
|
1480
|
+
message?: never;
|
|
1481
|
+
mimeType?: never;
|
|
1482
|
+
name?: never;
|
|
1483
|
+
remembered?: never;
|
|
1484
|
+
reported?: never;
|
|
1485
|
+
request?: never;
|
|
1486
|
+
requestedBy?: never;
|
|
1487
|
+
resolvedBy?: never;
|
|
1488
|
+
serverName?: never;
|
|
1489
|
+
serverSlug?: never;
|
|
1490
|
+
size?: never;
|
|
1491
|
+
status?: never;
|
|
1492
|
+
summary?: never;
|
|
1493
|
+
text?: never;
|
|
1494
|
+
toolName?: never;
|
|
1495
|
+
toolOutcome?: never;
|
|
1496
|
+
uri?: never;
|
|
1497
|
+
} |
|
|
1498
|
+
/**
|
|
1499
|
+
* An MCP tool call the egress proxy is holding, or held, until the
|
|
1500
|
+
* session's owner approved it: made in a turn somebody else prompted.
|
|
1501
|
+
*/
|
|
1502
|
+
({
|
|
1503
|
+
kind: "tool_approval";
|
|
1504
|
+
/** The approval an answer names. */
|
|
1505
|
+
approvalId: string;
|
|
1506
|
+
/** `macro`, or the connected app's slug. */
|
|
1507
|
+
serverSlug: string;
|
|
1508
|
+
/** What a person calls the server the tool is on. */
|
|
1509
|
+
serverName: string;
|
|
1510
|
+
/** The tool called. */
|
|
1511
|
+
toolName: string;
|
|
1512
|
+
/** What it was called with. */
|
|
1513
|
+
arguments: unknown;
|
|
1514
|
+
/** Who prompted the turn; absent for a bot on nobody's behalf. */
|
|
1515
|
+
requestedBy: string | null;
|
|
1516
|
+
/** Where it stands. */
|
|
1517
|
+
status: ToolApprovalStatus;
|
|
1518
|
+
/** Who resolved it, when a person did. */
|
|
1519
|
+
resolvedBy: string | null;
|
|
1520
|
+
/**
|
|
1521
|
+
* Approved for good: the person who asked may make the calls it
|
|
1522
|
+
* covers without the owner being asked again.
|
|
1523
|
+
*/
|
|
1524
|
+
remembered: boolean;
|
|
1525
|
+
}) & {
|
|
1526
|
+
control?: never;
|
|
1527
|
+
detail?: never;
|
|
1528
|
+
entries?: never;
|
|
1529
|
+
event?: never;
|
|
1530
|
+
id?: never;
|
|
1531
|
+
message?: never;
|
|
1532
|
+
mimeType?: never;
|
|
1533
|
+
name?: never;
|
|
1534
|
+
options?: never;
|
|
1535
|
+
outcome?: never;
|
|
1536
|
+
reported?: never;
|
|
1537
|
+
request?: never;
|
|
1538
|
+
requestId?: never;
|
|
1539
|
+
size?: never;
|
|
1540
|
+
summary?: never;
|
|
1541
|
+
text?: never;
|
|
1542
|
+
toolCall?: never;
|
|
1543
|
+
toolOutcome?: never;
|
|
1544
|
+
uri?: never;
|
|
1545
|
+
} |
|
|
1546
|
+
/** A user-issued control operation on the session. */
|
|
1547
|
+
({
|
|
1548
|
+
kind: "control";
|
|
1549
|
+
/** The requested operation. */
|
|
1550
|
+
control: Control;
|
|
1551
|
+
/** How the runtime disposed of it so far. */
|
|
1552
|
+
outcome: ControlOutcome;
|
|
1553
|
+
}) & {
|
|
1554
|
+
approvalId?: never;
|
|
1555
|
+
arguments?: never;
|
|
1556
|
+
detail?: never;
|
|
1557
|
+
entries?: never;
|
|
1558
|
+
event?: never;
|
|
1559
|
+
id?: never;
|
|
1560
|
+
message?: never;
|
|
1561
|
+
mimeType?: never;
|
|
1562
|
+
name?: never;
|
|
1563
|
+
options?: never;
|
|
1564
|
+
remembered?: never;
|
|
1565
|
+
reported?: never;
|
|
1566
|
+
request?: never;
|
|
1567
|
+
requestId?: never;
|
|
1568
|
+
requestedBy?: never;
|
|
1569
|
+
resolvedBy?: never;
|
|
1570
|
+
serverName?: never;
|
|
1571
|
+
serverSlug?: never;
|
|
1572
|
+
size?: never;
|
|
1573
|
+
status?: never;
|
|
1574
|
+
summary?: never;
|
|
1575
|
+
text?: never;
|
|
1576
|
+
toolCall?: never;
|
|
1577
|
+
toolName?: never;
|
|
1578
|
+
toolOutcome?: never;
|
|
1579
|
+
uri?: never;
|
|
1580
|
+
} |
|
|
1581
|
+
/** The agent's working todo list for the turn. */
|
|
1582
|
+
({
|
|
1583
|
+
kind: "plan";
|
|
1584
|
+
/** The tasks, in the order the agent listed them. */
|
|
1585
|
+
entries: PlanEntry[];
|
|
1586
|
+
}) & {
|
|
1587
|
+
approvalId?: never;
|
|
1588
|
+
arguments?: never;
|
|
1589
|
+
control?: never;
|
|
1590
|
+
detail?: never;
|
|
1591
|
+
event?: never;
|
|
1592
|
+
id?: never;
|
|
1593
|
+
message?: never;
|
|
1594
|
+
mimeType?: never;
|
|
1595
|
+
name?: never;
|
|
1596
|
+
options?: never;
|
|
1597
|
+
outcome?: never;
|
|
1598
|
+
remembered?: never;
|
|
1599
|
+
reported?: never;
|
|
1600
|
+
request?: never;
|
|
1601
|
+
requestId?: never;
|
|
1602
|
+
requestedBy?: never;
|
|
1603
|
+
resolvedBy?: never;
|
|
1604
|
+
serverName?: never;
|
|
1605
|
+
serverSlug?: never;
|
|
1606
|
+
size?: never;
|
|
1607
|
+
status?: never;
|
|
1608
|
+
summary?: never;
|
|
1609
|
+
text?: never;
|
|
1610
|
+
toolCall?: never;
|
|
1611
|
+
toolName?: never;
|
|
1612
|
+
toolOutcome?: never;
|
|
1613
|
+
uri?: never;
|
|
1614
|
+
} |
|
|
1615
|
+
/**
|
|
1616
|
+
* A background task the harness reported on: a command, subagent or
|
|
1617
|
+
* monitor it started earlier finished or emitted an event. The harness
|
|
1618
|
+
* hands the agent this report as a user turn; it is shown as a system
|
|
1619
|
+
* fact, never as something a person said.
|
|
1620
|
+
*/
|
|
1621
|
+
({
|
|
1622
|
+
kind: "task_notification";
|
|
1623
|
+
/** Where the task ended up; absent for a monitor's mid-stream event. */
|
|
1624
|
+
status: TaskStatus | null;
|
|
1625
|
+
/**
|
|
1626
|
+
* The harness's one-line account, such as `Background command
|
|
1627
|
+
* "Run tests" completed (exit code 0)`.
|
|
1628
|
+
*/
|
|
1629
|
+
summary: string;
|
|
1630
|
+
/** The line a monitor streamed, for a monitor event. */
|
|
1631
|
+
event: string | null;
|
|
1632
|
+
}) & {
|
|
1633
|
+
approvalId?: never;
|
|
1634
|
+
arguments?: never;
|
|
1635
|
+
control?: never;
|
|
1636
|
+
detail?: never;
|
|
1637
|
+
entries?: never;
|
|
1638
|
+
id?: never;
|
|
1639
|
+
message?: never;
|
|
1640
|
+
mimeType?: never;
|
|
1641
|
+
name?: never;
|
|
1642
|
+
options?: never;
|
|
1643
|
+
outcome?: never;
|
|
1644
|
+
remembered?: never;
|
|
1645
|
+
reported?: never;
|
|
1646
|
+
request?: never;
|
|
1647
|
+
requestId?: never;
|
|
1648
|
+
requestedBy?: never;
|
|
1649
|
+
resolvedBy?: never;
|
|
1650
|
+
serverName?: never;
|
|
1651
|
+
serverSlug?: never;
|
|
1652
|
+
size?: never;
|
|
1653
|
+
text?: never;
|
|
1654
|
+
toolCall?: never;
|
|
1655
|
+
toolName?: never;
|
|
1656
|
+
toolOutcome?: never;
|
|
1657
|
+
uri?: never;
|
|
1658
|
+
} |
|
|
1659
|
+
/**
|
|
1660
|
+
* The agent asking the user a question.
|
|
1661
|
+
*
|
|
1662
|
+
* When the question was asked on behalf of a tool call this fold had
|
|
1663
|
+
* already opened (Claude Code's `AskUserQuestion`), this part *replaces*
|
|
1664
|
+
* that tool's part in place: the question is the call, and rendering
|
|
1665
|
+
* both would show one thing twice.
|
|
1666
|
+
*/
|
|
1667
|
+
({
|
|
1668
|
+
kind: "elicitation";
|
|
1669
|
+
/**
|
|
1670
|
+
* The agent's `elicitation/create` request id - what an answer must
|
|
1671
|
+
* echo.
|
|
1672
|
+
*/
|
|
1673
|
+
requestId: ElicitationRequestId;
|
|
1674
|
+
/** The tool call the question belongs to, when the agent said. */
|
|
1675
|
+
toolCall: ToolUseId | null;
|
|
1676
|
+
/** What the agent is asking, in prose. */
|
|
1677
|
+
message: string;
|
|
1678
|
+
/** The form or URL. */
|
|
1679
|
+
request: ElicitationRequest;
|
|
1680
|
+
/** How it has resolved so far. */
|
|
1681
|
+
outcome: ElicitationOutcome;
|
|
1682
|
+
/**
|
|
1683
|
+
* The harness's own reading of the answer, when it reported one
|
|
1684
|
+
* after the response went back (Claude Code echoes the chosen
|
|
1685
|
+
* option through its tool result). Absent otherwise.
|
|
1686
|
+
*
|
|
1687
|
+
* Shaped like [`ElicitationOutcome::Accepted`]'s answers so a reader
|
|
1688
|
+
* renders one vocabulary either way, though a harness keys these by
|
|
1689
|
+
* question prose rather than by property, so each `name` is that
|
|
1690
|
+
* prose rather than a schema property.
|
|
1691
|
+
*/
|
|
1692
|
+
reported: AnsweredField[] | null;
|
|
1693
|
+
/**
|
|
1694
|
+
* For a user tool's review ([`ElicitationRequest::UserTool`]): how
|
|
1695
|
+
* the tool itself ended once the user answered - run with the
|
|
1696
|
+
* reviewed draft, rejected, or failed - read from the absorbed
|
|
1697
|
+
* call's later updates. Absent until the tool reports, and for
|
|
1698
|
+
* every other kind of question.
|
|
1699
|
+
*/
|
|
1700
|
+
toolOutcome: UserToolOutcome | null;
|
|
1701
|
+
}) & {
|
|
1702
|
+
approvalId?: never;
|
|
1703
|
+
arguments?: never;
|
|
1704
|
+
control?: never;
|
|
1705
|
+
detail?: never;
|
|
1706
|
+
entries?: never;
|
|
1707
|
+
event?: never;
|
|
1708
|
+
id?: never;
|
|
1709
|
+
mimeType?: never;
|
|
1710
|
+
name?: never;
|
|
1711
|
+
options?: never;
|
|
1712
|
+
remembered?: never;
|
|
1713
|
+
requestedBy?: never;
|
|
1714
|
+
resolvedBy?: never;
|
|
1715
|
+
serverName?: never;
|
|
1716
|
+
serverSlug?: never;
|
|
1717
|
+
size?: never;
|
|
1718
|
+
status?: never;
|
|
1719
|
+
summary?: never;
|
|
1720
|
+
text?: never;
|
|
1721
|
+
toolName?: never;
|
|
1722
|
+
uri?: never;
|
|
1723
|
+
};
|
|
1724
|
+
/** A unit of renderable content. */
|
|
1725
|
+
export type MessagePart_Serialize =
|
|
1726
|
+
/** Prose from the user or the agent. */
|
|
1727
|
+
({
|
|
1728
|
+
kind: "text";
|
|
1729
|
+
/** The prose. */
|
|
1730
|
+
text: string;
|
|
1731
|
+
}) & {
|
|
1732
|
+
approvalId?: never;
|
|
1733
|
+
arguments?: never;
|
|
1734
|
+
control?: never;
|
|
1735
|
+
detail?: never;
|
|
1736
|
+
entries?: never;
|
|
1737
|
+
event?: never;
|
|
1738
|
+
id?: never;
|
|
1739
|
+
message?: never;
|
|
1740
|
+
mimeType?: never;
|
|
1741
|
+
name?: never;
|
|
1742
|
+
options?: never;
|
|
1743
|
+
outcome?: never;
|
|
1744
|
+
remembered?: never;
|
|
1745
|
+
reported?: never;
|
|
1746
|
+
request?: never;
|
|
1747
|
+
requestId?: never;
|
|
1748
|
+
requestedBy?: never;
|
|
1749
|
+
resolvedBy?: never;
|
|
1750
|
+
serverName?: never;
|
|
1751
|
+
serverSlug?: never;
|
|
1752
|
+
size?: never;
|
|
1753
|
+
status?: never;
|
|
1754
|
+
summary?: never;
|
|
1755
|
+
toolCall?: never;
|
|
1756
|
+
toolName?: never;
|
|
1757
|
+
toolOutcome?: never;
|
|
1758
|
+
uri?: never;
|
|
1759
|
+
} |
|
|
1760
|
+
/**
|
|
1761
|
+
* A file the user attached to their prompt, by where it can be fetched.
|
|
1762
|
+
*
|
|
1763
|
+
* Read off the prompt's `resource_link` blocks - the only shape this
|
|
1764
|
+
* side sends files in, since bytes never ride the log. Rendering decides
|
|
1765
|
+
* from `mime_type` whether that is a thumbnail or a chip.
|
|
1766
|
+
*/
|
|
1767
|
+
({
|
|
1768
|
+
kind: "attachment";
|
|
1769
|
+
/** Where the file can be fetched - a static file service URL. */
|
|
1770
|
+
uri: string;
|
|
1771
|
+
/** Display name, typically the original file name. */
|
|
1772
|
+
name: string;
|
|
1773
|
+
/** The file's media type, when the sender knew it. */
|
|
1774
|
+
mimeType: string | null;
|
|
1775
|
+
/**
|
|
1776
|
+
* Size in bytes, when the sender knew it. A double on the wire:
|
|
1777
|
+
* specta refuses 64-bit integers, and no file this renders is
|
|
1778
|
+
* anywhere near the precision limit.
|
|
1779
|
+
*/
|
|
1780
|
+
size: number | null;
|
|
1781
|
+
}) & {
|
|
1782
|
+
approvalId?: never;
|
|
1783
|
+
arguments?: never;
|
|
1784
|
+
control?: never;
|
|
1785
|
+
detail?: never;
|
|
1786
|
+
entries?: never;
|
|
1787
|
+
event?: never;
|
|
1788
|
+
id?: never;
|
|
1789
|
+
message?: never;
|
|
1790
|
+
options?: never;
|
|
1791
|
+
outcome?: never;
|
|
1792
|
+
remembered?: never;
|
|
1793
|
+
reported?: never;
|
|
1794
|
+
request?: never;
|
|
1795
|
+
requestId?: never;
|
|
1796
|
+
requestedBy?: never;
|
|
1797
|
+
resolvedBy?: never;
|
|
1798
|
+
serverName?: never;
|
|
1799
|
+
serverSlug?: never;
|
|
1800
|
+
status?: never;
|
|
1801
|
+
summary?: never;
|
|
1802
|
+
text?: never;
|
|
1803
|
+
toolCall?: never;
|
|
1804
|
+
toolName?: never;
|
|
1805
|
+
toolOutcome?: never;
|
|
1806
|
+
} |
|
|
1807
|
+
/** The agent's reasoning, which a reader may want to hide by default. */
|
|
1808
|
+
({
|
|
1809
|
+
kind: "thought";
|
|
1810
|
+
/** The reasoning. */
|
|
1811
|
+
text: string;
|
|
1812
|
+
}) & {
|
|
1813
|
+
approvalId?: never;
|
|
1814
|
+
arguments?: never;
|
|
1815
|
+
control?: never;
|
|
1816
|
+
detail?: never;
|
|
1817
|
+
entries?: never;
|
|
1818
|
+
event?: never;
|
|
1819
|
+
id?: never;
|
|
1820
|
+
message?: never;
|
|
1821
|
+
mimeType?: never;
|
|
1822
|
+
name?: never;
|
|
1823
|
+
options?: never;
|
|
1824
|
+
outcome?: never;
|
|
1825
|
+
remembered?: never;
|
|
1826
|
+
reported?: never;
|
|
1827
|
+
request?: never;
|
|
1828
|
+
requestId?: never;
|
|
1829
|
+
requestedBy?: never;
|
|
1830
|
+
resolvedBy?: never;
|
|
1831
|
+
serverName?: never;
|
|
1832
|
+
serverSlug?: never;
|
|
1833
|
+
size?: never;
|
|
1834
|
+
status?: never;
|
|
1835
|
+
summary?: never;
|
|
1836
|
+
toolCall?: never;
|
|
1837
|
+
toolName?: never;
|
|
1838
|
+
toolOutcome?: never;
|
|
1839
|
+
uri?: never;
|
|
1840
|
+
} |
|
|
1841
|
+
/** A tool the agent invoked. */
|
|
1842
|
+
({
|
|
1843
|
+
kind: "tool_use";
|
|
1844
|
+
/** The ACP `toolCallId`. */
|
|
1845
|
+
id: ToolUseId;
|
|
1846
|
+
/** What the harness called the tool. */
|
|
1847
|
+
name: ToolName;
|
|
1848
|
+
/** Where the call got to. */
|
|
1849
|
+
status: ToolStatus;
|
|
1850
|
+
/** What the tool did, as far as the log reveals. */
|
|
1851
|
+
detail: ToolDetail_Serialize;
|
|
1852
|
+
}) & {
|
|
1853
|
+
approvalId?: never;
|
|
1854
|
+
arguments?: never;
|
|
1855
|
+
control?: never;
|
|
1856
|
+
entries?: never;
|
|
1857
|
+
event?: never;
|
|
1858
|
+
message?: never;
|
|
1859
|
+
mimeType?: never;
|
|
1860
|
+
options?: never;
|
|
1861
|
+
outcome?: never;
|
|
1862
|
+
remembered?: never;
|
|
1863
|
+
reported?: never;
|
|
1864
|
+
request?: never;
|
|
1865
|
+
requestId?: never;
|
|
1866
|
+
requestedBy?: never;
|
|
1867
|
+
resolvedBy?: never;
|
|
1868
|
+
serverName?: never;
|
|
1869
|
+
serverSlug?: never;
|
|
1870
|
+
size?: never;
|
|
1871
|
+
summary?: never;
|
|
1872
|
+
text?: never;
|
|
1873
|
+
toolCall?: never;
|
|
1874
|
+
toolName?: never;
|
|
1875
|
+
toolOutcome?: never;
|
|
1876
|
+
uri?: never;
|
|
1877
|
+
} |
|
|
1878
|
+
/** The agent asking to proceed. */
|
|
1879
|
+
({
|
|
1880
|
+
kind: "permission";
|
|
1881
|
+
/** The agent request id an approval must echo. */
|
|
1882
|
+
requestId: AgentRequestId;
|
|
1883
|
+
/** The tool call permission was requested for. */
|
|
1884
|
+
toolCall: ToolUseId;
|
|
1885
|
+
/** The choices offered, in the order ACP listed them. */
|
|
1886
|
+
options: PermissionOption[];
|
|
1887
|
+
/** How the request has resolved so far. */
|
|
1888
|
+
outcome: PermissionOutcome;
|
|
1889
|
+
}) & {
|
|
1890
|
+
approvalId?: never;
|
|
1891
|
+
arguments?: never;
|
|
1892
|
+
control?: never;
|
|
1893
|
+
detail?: never;
|
|
1894
|
+
entries?: never;
|
|
1895
|
+
event?: never;
|
|
1896
|
+
id?: never;
|
|
1897
|
+
message?: never;
|
|
1898
|
+
mimeType?: never;
|
|
1899
|
+
name?: never;
|
|
1900
|
+
remembered?: never;
|
|
1901
|
+
reported?: never;
|
|
1902
|
+
request?: never;
|
|
1903
|
+
requestedBy?: never;
|
|
1904
|
+
resolvedBy?: never;
|
|
1905
|
+
serverName?: never;
|
|
1906
|
+
serverSlug?: never;
|
|
1907
|
+
size?: never;
|
|
1908
|
+
status?: never;
|
|
1909
|
+
summary?: never;
|
|
1910
|
+
text?: never;
|
|
1911
|
+
toolName?: never;
|
|
1912
|
+
toolOutcome?: never;
|
|
1913
|
+
uri?: never;
|
|
1914
|
+
} |
|
|
1915
|
+
/**
|
|
1916
|
+
* An MCP tool call the egress proxy is holding, or held, until the
|
|
1917
|
+
* session's owner approved it: made in a turn somebody else prompted.
|
|
1918
|
+
*/
|
|
1919
|
+
({
|
|
1920
|
+
kind: "tool_approval";
|
|
1921
|
+
/** The approval an answer names. */
|
|
1922
|
+
approvalId: string;
|
|
1923
|
+
/** `macro`, or the connected app's slug. */
|
|
1924
|
+
serverSlug: string;
|
|
1925
|
+
/** What a person calls the server the tool is on. */
|
|
1926
|
+
serverName: string;
|
|
1927
|
+
/** The tool called. */
|
|
1928
|
+
toolName: string;
|
|
1929
|
+
/** What it was called with. */
|
|
1930
|
+
arguments: unknown;
|
|
1931
|
+
/** Who prompted the turn; absent for a bot on nobody's behalf. */
|
|
1932
|
+
requestedBy: string | null;
|
|
1933
|
+
/** Where it stands. */
|
|
1934
|
+
status: ToolApprovalStatus;
|
|
1935
|
+
/** Who resolved it, when a person did. */
|
|
1936
|
+
resolvedBy: string | null;
|
|
1937
|
+
/**
|
|
1938
|
+
* Approved for good: the person who asked may make the calls it
|
|
1939
|
+
* covers without the owner being asked again.
|
|
1940
|
+
*/
|
|
1941
|
+
remembered: boolean;
|
|
1942
|
+
}) & {
|
|
1943
|
+
control?: never;
|
|
1944
|
+
detail?: never;
|
|
1945
|
+
entries?: never;
|
|
1946
|
+
event?: never;
|
|
1947
|
+
id?: never;
|
|
1948
|
+
message?: never;
|
|
1949
|
+
mimeType?: never;
|
|
1950
|
+
name?: never;
|
|
1951
|
+
options?: never;
|
|
1952
|
+
outcome?: never;
|
|
1953
|
+
reported?: never;
|
|
1954
|
+
request?: never;
|
|
1955
|
+
requestId?: never;
|
|
1956
|
+
size?: never;
|
|
1957
|
+
summary?: never;
|
|
1958
|
+
text?: never;
|
|
1959
|
+
toolCall?: never;
|
|
1960
|
+
toolOutcome?: never;
|
|
1961
|
+
uri?: never;
|
|
1962
|
+
} |
|
|
1963
|
+
/** A user-issued control operation on the session. */
|
|
1964
|
+
({
|
|
1965
|
+
kind: "control";
|
|
1966
|
+
/** The requested operation. */
|
|
1967
|
+
control: Control;
|
|
1968
|
+
/** How the runtime disposed of it so far. */
|
|
1969
|
+
outcome: ControlOutcome;
|
|
1970
|
+
}) & {
|
|
1971
|
+
approvalId?: never;
|
|
1972
|
+
arguments?: never;
|
|
1973
|
+
detail?: never;
|
|
1974
|
+
entries?: never;
|
|
1975
|
+
event?: never;
|
|
1976
|
+
id?: never;
|
|
1977
|
+
message?: never;
|
|
1978
|
+
mimeType?: never;
|
|
1979
|
+
name?: never;
|
|
1980
|
+
options?: never;
|
|
1981
|
+
remembered?: never;
|
|
1982
|
+
reported?: never;
|
|
1983
|
+
request?: never;
|
|
1984
|
+
requestId?: never;
|
|
1985
|
+
requestedBy?: never;
|
|
1986
|
+
resolvedBy?: never;
|
|
1987
|
+
serverName?: never;
|
|
1988
|
+
serverSlug?: never;
|
|
1989
|
+
size?: never;
|
|
1990
|
+
status?: never;
|
|
1991
|
+
summary?: never;
|
|
1992
|
+
text?: never;
|
|
1993
|
+
toolCall?: never;
|
|
1994
|
+
toolName?: never;
|
|
1995
|
+
toolOutcome?: never;
|
|
1996
|
+
uri?: never;
|
|
1997
|
+
} |
|
|
1998
|
+
/** The agent's working todo list for the turn. */
|
|
1999
|
+
({
|
|
2000
|
+
kind: "plan";
|
|
2001
|
+
/** The tasks, in the order the agent listed them. */
|
|
2002
|
+
entries: PlanEntry[];
|
|
2003
|
+
}) & {
|
|
2004
|
+
approvalId?: never;
|
|
2005
|
+
arguments?: never;
|
|
2006
|
+
control?: never;
|
|
2007
|
+
detail?: never;
|
|
2008
|
+
event?: never;
|
|
2009
|
+
id?: never;
|
|
2010
|
+
message?: never;
|
|
2011
|
+
mimeType?: never;
|
|
2012
|
+
name?: never;
|
|
2013
|
+
options?: never;
|
|
2014
|
+
outcome?: never;
|
|
2015
|
+
remembered?: never;
|
|
2016
|
+
reported?: never;
|
|
2017
|
+
request?: never;
|
|
2018
|
+
requestId?: never;
|
|
2019
|
+
requestedBy?: never;
|
|
2020
|
+
resolvedBy?: never;
|
|
2021
|
+
serverName?: never;
|
|
2022
|
+
serverSlug?: never;
|
|
2023
|
+
size?: never;
|
|
2024
|
+
status?: never;
|
|
2025
|
+
summary?: never;
|
|
2026
|
+
text?: never;
|
|
2027
|
+
toolCall?: never;
|
|
2028
|
+
toolName?: never;
|
|
2029
|
+
toolOutcome?: never;
|
|
2030
|
+
uri?: never;
|
|
2031
|
+
} |
|
|
2032
|
+
/**
|
|
2033
|
+
* A background task the harness reported on: a command, subagent or
|
|
2034
|
+
* monitor it started earlier finished or emitted an event. The harness
|
|
2035
|
+
* hands the agent this report as a user turn; it is shown as a system
|
|
2036
|
+
* fact, never as something a person said.
|
|
2037
|
+
*/
|
|
2038
|
+
({
|
|
2039
|
+
kind: "task_notification";
|
|
2040
|
+
/** Where the task ended up; absent for a monitor's mid-stream event. */
|
|
2041
|
+
status: TaskStatus | null;
|
|
2042
|
+
/**
|
|
2043
|
+
* The harness's one-line account, such as `Background command
|
|
2044
|
+
* "Run tests" completed (exit code 0)`.
|
|
2045
|
+
*/
|
|
2046
|
+
summary: string;
|
|
2047
|
+
/** The line a monitor streamed, for a monitor event. */
|
|
2048
|
+
event: string | null;
|
|
2049
|
+
}) & {
|
|
2050
|
+
approvalId?: never;
|
|
2051
|
+
arguments?: never;
|
|
2052
|
+
control?: never;
|
|
2053
|
+
detail?: never;
|
|
2054
|
+
entries?: never;
|
|
2055
|
+
id?: never;
|
|
2056
|
+
message?: never;
|
|
2057
|
+
mimeType?: never;
|
|
2058
|
+
name?: never;
|
|
2059
|
+
options?: never;
|
|
2060
|
+
outcome?: never;
|
|
2061
|
+
remembered?: never;
|
|
2062
|
+
reported?: never;
|
|
2063
|
+
request?: never;
|
|
2064
|
+
requestId?: never;
|
|
2065
|
+
requestedBy?: never;
|
|
2066
|
+
resolvedBy?: never;
|
|
2067
|
+
serverName?: never;
|
|
2068
|
+
serverSlug?: never;
|
|
2069
|
+
size?: never;
|
|
2070
|
+
text?: never;
|
|
2071
|
+
toolCall?: never;
|
|
2072
|
+
toolName?: never;
|
|
2073
|
+
toolOutcome?: never;
|
|
2074
|
+
uri?: never;
|
|
2075
|
+
} |
|
|
2076
|
+
/**
|
|
2077
|
+
* The agent asking the user a question.
|
|
2078
|
+
*
|
|
2079
|
+
* When the question was asked on behalf of a tool call this fold had
|
|
2080
|
+
* already opened (Claude Code's `AskUserQuestion`), this part *replaces*
|
|
2081
|
+
* that tool's part in place: the question is the call, and rendering
|
|
2082
|
+
* both would show one thing twice.
|
|
2083
|
+
*/
|
|
2084
|
+
({
|
|
2085
|
+
kind: "elicitation";
|
|
2086
|
+
/**
|
|
2087
|
+
* The agent's `elicitation/create` request id - what an answer must
|
|
2088
|
+
* echo.
|
|
2089
|
+
*/
|
|
2090
|
+
requestId: ElicitationRequestId;
|
|
2091
|
+
/** The tool call the question belongs to, when the agent said. */
|
|
2092
|
+
toolCall: ToolUseId | null;
|
|
2093
|
+
/** What the agent is asking, in prose. */
|
|
2094
|
+
message: string;
|
|
2095
|
+
/** The form or URL. */
|
|
2096
|
+
request: ElicitationRequest;
|
|
2097
|
+
/** How it has resolved so far. */
|
|
2098
|
+
outcome: ElicitationOutcome;
|
|
2099
|
+
/**
|
|
2100
|
+
* The harness's own reading of the answer, when it reported one
|
|
2101
|
+
* after the response went back (Claude Code echoes the chosen
|
|
2102
|
+
* option through its tool result). Absent otherwise.
|
|
2103
|
+
*
|
|
2104
|
+
* Shaped like [`ElicitationOutcome::Accepted`]'s answers so a reader
|
|
2105
|
+
* renders one vocabulary either way, though a harness keys these by
|
|
2106
|
+
* question prose rather than by property, so each `name` is that
|
|
2107
|
+
* prose rather than a schema property.
|
|
2108
|
+
*/
|
|
2109
|
+
reported: AnsweredField[] | null;
|
|
2110
|
+
/**
|
|
2111
|
+
* For a user tool's review ([`ElicitationRequest::UserTool`]): how
|
|
2112
|
+
* the tool itself ended once the user answered - run with the
|
|
2113
|
+
* reviewed draft, rejected, or failed - read from the absorbed
|
|
2114
|
+
* call's later updates. Absent until the tool reports, and for
|
|
2115
|
+
* every other kind of question.
|
|
2116
|
+
*/
|
|
2117
|
+
toolOutcome: UserToolOutcome | null;
|
|
2118
|
+
}) & {
|
|
2119
|
+
approvalId?: never;
|
|
2120
|
+
arguments?: never;
|
|
2121
|
+
control?: never;
|
|
2122
|
+
detail?: never;
|
|
2123
|
+
entries?: never;
|
|
2124
|
+
event?: never;
|
|
2125
|
+
id?: never;
|
|
2126
|
+
mimeType?: never;
|
|
2127
|
+
name?: never;
|
|
2128
|
+
options?: never;
|
|
2129
|
+
remembered?: never;
|
|
2130
|
+
requestedBy?: never;
|
|
2131
|
+
resolvedBy?: never;
|
|
2132
|
+
serverName?: never;
|
|
2133
|
+
serverSlug?: never;
|
|
2134
|
+
size?: never;
|
|
2135
|
+
status?: never;
|
|
2136
|
+
summary?: never;
|
|
2137
|
+
text?: never;
|
|
2138
|
+
toolName?: never;
|
|
2139
|
+
uri?: never;
|
|
2140
|
+
};
|
|
2141
|
+
/** One model the runtime offers. */
|
|
2142
|
+
export type ModelOption = {
|
|
2143
|
+
/** The value to send back to select this model. */
|
|
2144
|
+
id: string;
|
|
2145
|
+
/** Human-readable label. */
|
|
2146
|
+
name: string;
|
|
2147
|
+
/** Descriptive copy - pricing, context size, and the like. */
|
|
2148
|
+
description: string | null;
|
|
2149
|
+
/** Image input support, absent when the runtime does not advertise it. */
|
|
2150
|
+
supportsImages?: boolean | null;
|
|
2151
|
+
/**
|
|
2152
|
+
* The heading the runtime listed this model under, when it grouped its
|
|
2153
|
+
* options (ACP's `SessionConfigSelectGroup.name`). `None` for a runtime
|
|
2154
|
+
* that offered a flat list; the flattened order still follows the
|
|
2155
|
+
* runtime's, group by group.
|
|
2156
|
+
*/
|
|
2157
|
+
group: string | null;
|
|
2158
|
+
};
|
|
2159
|
+
/** Supported event contracts. Add new kinds here rather than inventing prompts. */
|
|
2160
|
+
export type NotificationEvent = NotificationEvent_Serialize | NotificationEvent_Deserialize;
|
|
2161
|
+
/** Supported event contracts. Add new kinds here rather than inventing prompts. */
|
|
2162
|
+
export type NotificationEvent_Deserialize =
|
|
2163
|
+
/** Owner decision and its confirmed results. */
|
|
2164
|
+
{
|
|
2165
|
+
kind: "review.decided";
|
|
2166
|
+
payload: ReviewOutcome_Deserialize;
|
|
2167
|
+
} |
|
|
2168
|
+
/** Completion of work initiated by a prior review decision. */
|
|
2169
|
+
{
|
|
2170
|
+
kind: "review.settled";
|
|
2171
|
+
payload: ReviewSettlement_Deserialize;
|
|
2172
|
+
} |
|
|
2173
|
+
/** The import plan a presented review shows finished planning. */
|
|
2174
|
+
{
|
|
2175
|
+
kind: "import.planned";
|
|
2176
|
+
payload: ImportPlan;
|
|
2177
|
+
} |
|
|
2178
|
+
/** An app connection became available to the session. */
|
|
2179
|
+
{
|
|
2180
|
+
kind: "app.connected";
|
|
2181
|
+
payload: {
|
|
2182
|
+
/** Connected application's display name. */
|
|
2183
|
+
app: string;
|
|
2184
|
+
};
|
|
2185
|
+
};
|
|
2186
|
+
/** Supported event contracts. Add new kinds here rather than inventing prompts. */
|
|
2187
|
+
export type NotificationEvent_Serialize =
|
|
2188
|
+
/** Owner decision and its confirmed results. */
|
|
2189
|
+
{
|
|
2190
|
+
kind: "review.decided";
|
|
2191
|
+
payload: ReviewOutcome_Serialize;
|
|
2192
|
+
} |
|
|
2193
|
+
/** Completion of work initiated by a prior review decision. */
|
|
2194
|
+
{
|
|
2195
|
+
kind: "review.settled";
|
|
2196
|
+
payload: ReviewSettlement_Serialize;
|
|
2197
|
+
} |
|
|
2198
|
+
/** The import plan a presented review shows finished planning. */
|
|
2199
|
+
{
|
|
2200
|
+
kind: "import.planned";
|
|
2201
|
+
payload: ImportPlan;
|
|
2202
|
+
} |
|
|
2203
|
+
/** An app connection became available to the session. */
|
|
2204
|
+
{
|
|
2205
|
+
kind: "app.connected";
|
|
2206
|
+
payload: {
|
|
2207
|
+
/** Connected application's display name. */
|
|
2208
|
+
app: string;
|
|
2209
|
+
};
|
|
2210
|
+
};
|
|
2211
|
+
/**
|
|
2212
|
+
* The one elicitation the user can answer right now, surfaced on
|
|
2213
|
+
* [`SessionMetadata`](super::SessionMetadata) so a reader need not scan the
|
|
2214
|
+
* transcript for it.
|
|
2215
|
+
*/
|
|
2216
|
+
export type PendingElicitation = {
|
|
2217
|
+
/** The agent's request id; what an answer must name. */
|
|
2218
|
+
requestId: ElicitationRequestId;
|
|
2219
|
+
/** The turn whose agent message holds the matching part. */
|
|
2220
|
+
turn: number;
|
|
2221
|
+
/** The tool call it was asked on behalf of, when any. */
|
|
2222
|
+
toolCall: ToolUseId | null;
|
|
2223
|
+
/** What the agent is asking, in prose. */
|
|
2224
|
+
message: string;
|
|
2225
|
+
/** The form or URL. */
|
|
2226
|
+
request: ElicitationRequest;
|
|
2227
|
+
};
|
|
2228
|
+
/** An answerable request. Each variant retains its own response semantics. */
|
|
2229
|
+
export type PendingInteraction =
|
|
2230
|
+
/** A choice among the permission options offered by the agent. */
|
|
2231
|
+
{
|
|
2232
|
+
kind: "permission";
|
|
2233
|
+
} & PendingPermission |
|
|
2234
|
+
/** A form, URL consent, or user tool review. */
|
|
2235
|
+
{
|
|
2236
|
+
kind: "elicitation";
|
|
2237
|
+
} & PendingElicitation |
|
|
2238
|
+
/**
|
|
2239
|
+
* An MCP tool call held until the session's owner approves it. Only
|
|
2240
|
+
* the owner may approve or decline; anyone with edit access may cancel.
|
|
2241
|
+
*/
|
|
2242
|
+
{
|
|
2243
|
+
kind: "tool_approval";
|
|
2244
|
+
} & PendingToolApproval;
|
|
2245
|
+
/** A permission request the current connection can still answer. */
|
|
2246
|
+
export type PendingPermission = {
|
|
2247
|
+
/** The agent's request id, preserving numeric and string identities. */
|
|
2248
|
+
requestId: AgentRequestId;
|
|
2249
|
+
/** The turn that asked. */
|
|
2250
|
+
turn: number;
|
|
2251
|
+
/** The tool whose execution needs permission. */
|
|
2252
|
+
toolCall: ToolUseId;
|
|
2253
|
+
/** The options the agent offered. */
|
|
2254
|
+
options: PermissionOption[];
|
|
2255
|
+
};
|
|
2256
|
+
/** A held MCP tool call the owner can still answer. */
|
|
2257
|
+
export type PendingToolApproval = {
|
|
2258
|
+
/** The approval an answer names. */
|
|
2259
|
+
approvalId: string;
|
|
2260
|
+
/** The turn the call was made in. */
|
|
2261
|
+
turn: number;
|
|
2262
|
+
/** `macro`, or the connected app's slug. */
|
|
2263
|
+
serverSlug: string;
|
|
2264
|
+
/** What a person calls the server the tool is on. */
|
|
2265
|
+
serverName: string;
|
|
2266
|
+
/** The tool called. */
|
|
2267
|
+
toolName: string;
|
|
2268
|
+
/** Who prompted the turn; absent for a bot on nobody's behalf. */
|
|
2269
|
+
requestedBy: string | null;
|
|
2270
|
+
};
|
|
2271
|
+
/** One choice offered for a permission request. */
|
|
2272
|
+
export type PermissionOption = {
|
|
2273
|
+
/** The id to report back when this option is chosen. */
|
|
2274
|
+
id: string;
|
|
2275
|
+
/** Label to show. */
|
|
2276
|
+
name: string;
|
|
2277
|
+
/** What kind of choice this is. */
|
|
2278
|
+
kind: PermissionOptionKind;
|
|
2279
|
+
};
|
|
2280
|
+
/**
|
|
2281
|
+
* What kind of choice a [`PermissionOption`] offers, mirroring ACP's
|
|
2282
|
+
* `PermissionOptionKind`.
|
|
2283
|
+
*
|
|
2284
|
+
* ACP's enum is `#[non_exhaustive]`, but unlike [`StopReason`] there is no
|
|
2285
|
+
* wire string worth preserving for a variant this fold does not model: the
|
|
2286
|
+
* fold only ever sees one of these once the whole permission request has
|
|
2287
|
+
* already deserialized successfully, and a wire value ACP added after this
|
|
2288
|
+
* was written would have failed that deserialize already - so an unmatched
|
|
2289
|
+
* kind here cannot happen in practice, not "happens and is rendered
|
|
2290
|
+
* unlabeled."
|
|
2291
|
+
*/
|
|
2292
|
+
export type PermissionOptionKind =
|
|
2293
|
+
/** Allow this operation only this time. */
|
|
2294
|
+
"allow_once" |
|
|
2295
|
+
/** Allow this operation and remember the choice. */
|
|
2296
|
+
"allow_always" |
|
|
2297
|
+
/** Reject this operation only this time. */
|
|
2298
|
+
"reject_once" |
|
|
2299
|
+
/** Reject this operation and remember the choice. */
|
|
2300
|
+
"reject_always";
|
|
2301
|
+
/**
|
|
2302
|
+
* How a permission request has resolved so far.
|
|
2303
|
+
*
|
|
2304
|
+
* Not just "chosen or not": nothing chosen has more than one cause, and a
|
|
2305
|
+
* reader deciding whether to still show the options needs to tell them
|
|
2306
|
+
* apart. [`Self::Pending`] may still resolve; [`Self::Errored`] and
|
|
2307
|
+
* [`Self::Unrecognized`] have already resolved, just not into anything this
|
|
2308
|
+
* fold can show as a choice.
|
|
2309
|
+
*/
|
|
2310
|
+
export type PermissionOutcome =
|
|
2311
|
+
/** No response has arrived yet - the request is still outstanding. */
|
|
2312
|
+
{
|
|
2313
|
+
kind: "pending";
|
|
2314
|
+
} |
|
|
2315
|
+
/** An option was chosen. */
|
|
2316
|
+
{
|
|
2317
|
+
kind: "selected";
|
|
2318
|
+
/** The chosen option's id. */
|
|
2319
|
+
optionId: string;
|
|
2320
|
+
} |
|
|
2321
|
+
/** The request was cancelled without a choice. */
|
|
2322
|
+
{
|
|
2323
|
+
kind: "cancelled";
|
|
2324
|
+
} |
|
|
2325
|
+
/**
|
|
2326
|
+
* The response was a JSON-RPC error rather than a result: the harness
|
|
2327
|
+
* failed to answer the request rather than resolving it.
|
|
2328
|
+
*/
|
|
2329
|
+
{
|
|
2330
|
+
kind: "errored";
|
|
2331
|
+
} |
|
|
2332
|
+
/**
|
|
2333
|
+
* A result arrived, but this fold could not make sense of it - a
|
|
2334
|
+
* payload that did not match ACP's response shape, or an outcome ACP
|
|
2335
|
+
* added after this was written.
|
|
2336
|
+
*/
|
|
2337
|
+
{
|
|
2338
|
+
kind: "unrecognized";
|
|
2339
|
+
};
|
|
2340
|
+
/** One task on an agent plan. */
|
|
2341
|
+
export type PlanEntry = {
|
|
2342
|
+
/** What this task aims to accomplish. */
|
|
2343
|
+
content: string;
|
|
2344
|
+
/** The task's relative importance. */
|
|
2345
|
+
priority: PlanEntryPriority;
|
|
2346
|
+
/** Where the task got to. */
|
|
2347
|
+
status: PlanEntryStatus;
|
|
2348
|
+
};
|
|
2349
|
+
/**
|
|
2350
|
+
* A [`PlanEntry`]'s relative importance, mirroring ACP's
|
|
2351
|
+
* `PlanEntryPriority`.
|
|
2352
|
+
*/
|
|
2353
|
+
export type PlanEntryPriority =
|
|
2354
|
+
/** Critical to the overall goal. */
|
|
2355
|
+
"high" |
|
|
2356
|
+
/** Important but not critical. */
|
|
2357
|
+
"medium" |
|
|
2358
|
+
/** Nice to have but not essential. */
|
|
2359
|
+
"low";
|
|
2360
|
+
/** Where a [`PlanEntry`] got to, mirroring ACP's `PlanEntryStatus`. */
|
|
2361
|
+
export type PlanEntryStatus =
|
|
2362
|
+
/** Not started yet. */
|
|
2363
|
+
"pending" |
|
|
2364
|
+
/** Currently being worked on. */
|
|
2365
|
+
"in_progress" |
|
|
2366
|
+
/** Successfully completed. */
|
|
2367
|
+
"completed";
|
|
2368
|
+
/** One value of one property. */
|
|
2369
|
+
export type PropertyFilter = {
|
|
2370
|
+
propertyId: string;
|
|
2371
|
+
type: PropertyFilterType;
|
|
2372
|
+
value: string;
|
|
2373
|
+
};
|
|
2374
|
+
/** What a property filter's value is. */
|
|
2375
|
+
export type PropertyFilterType = "select" | "entity";
|
|
2376
|
+
/** A Soup filter query: the items to include and exclude. */
|
|
2377
|
+
export type Query = Query_Serialize | Query_Deserialize;
|
|
2378
|
+
/** A Soup filter query: the items to include and exclude. */
|
|
2379
|
+
export type Query_Deserialize = {
|
|
2380
|
+
include?: FieldFilters_Deserialize;
|
|
2381
|
+
exclude?: FieldFilters_Deserialize;
|
|
2382
|
+
documentWhere?: DocumentWhere_Deserialize;
|
|
2383
|
+
emailView?: EmailView;
|
|
2384
|
+
};
|
|
2385
|
+
/** A Soup filter query: the items to include and exclude. */
|
|
2386
|
+
export type Query_Serialize = {
|
|
2387
|
+
include?: FieldFilters_Serialize;
|
|
2388
|
+
exclude?: FieldFilters_Serialize;
|
|
2389
|
+
documentWhere?: DocumentWhere_Serialize;
|
|
2390
|
+
emailView?: EmailView;
|
|
2391
|
+
};
|
|
2392
|
+
/** One reviewed action's outcome. */
|
|
2393
|
+
export type ReviewItemOutcome = ReviewItemOutcome_Serialize | ReviewItemOutcome_Deserialize;
|
|
2394
|
+
/** One reviewed action's outcome. */
|
|
2395
|
+
export type ReviewItemOutcome_Deserialize = {
|
|
2396
|
+
/** Stable item identity. */
|
|
2397
|
+
id: string;
|
|
2398
|
+
/** Confirmed state. */
|
|
2399
|
+
status: ItemStatus;
|
|
2400
|
+
/** Whether the owner changed its draft before deciding. */
|
|
2401
|
+
edited: boolean;
|
|
2402
|
+
/** Failure detail when work could not be confirmed. */
|
|
2403
|
+
error: string | null;
|
|
2404
|
+
};
|
|
2405
|
+
/** One reviewed action's outcome. */
|
|
2406
|
+
export type ReviewItemOutcome_Serialize = {
|
|
2407
|
+
/** Stable item identity. */
|
|
2408
|
+
id: string;
|
|
2409
|
+
/** Confirmed state. */
|
|
2410
|
+
status: ItemStatus;
|
|
2411
|
+
/** Whether the owner changed its draft before deciding. */
|
|
2412
|
+
edited: boolean;
|
|
2413
|
+
/** Failure detail when work could not be confirmed. */
|
|
2414
|
+
error?: string | null;
|
|
2415
|
+
};
|
|
2416
|
+
/** The result of a review batch, with no draft content. */
|
|
2417
|
+
export type ReviewOutcome = ReviewOutcome_Serialize | ReviewOutcome_Deserialize;
|
|
2418
|
+
/** The result of a review batch, with no draft content. */
|
|
2419
|
+
export type ReviewOutcome_Deserialize = {
|
|
2420
|
+
/** Overall result. */
|
|
2421
|
+
outcome: DecisionOutcome;
|
|
2422
|
+
/** Authenticated owner who made the decision. */
|
|
2423
|
+
by: string;
|
|
2424
|
+
/** Surface through which the owner acted. */
|
|
2425
|
+
via: DecisionVia;
|
|
2426
|
+
/** Exact affected items and their final states. */
|
|
2427
|
+
items: ReviewItemOutcome_Deserialize[];
|
|
2428
|
+
};
|
|
2429
|
+
/** The result of a review batch, with no draft content. */
|
|
2430
|
+
export type ReviewOutcome_Serialize = {
|
|
2431
|
+
/** Overall result. */
|
|
2432
|
+
outcome: DecisionOutcome;
|
|
2433
|
+
/** Authenticated owner who made the decision. */
|
|
2434
|
+
by: string;
|
|
2435
|
+
/** Surface through which the owner acted. */
|
|
2436
|
+
via: DecisionVia;
|
|
2437
|
+
/** Exact affected items and their final states. */
|
|
2438
|
+
items: ReviewItemOutcome_Serialize[];
|
|
2439
|
+
};
|
|
2440
|
+
/**
|
|
2441
|
+
* How the work a review decision started ended. Untagged so settlements
|
|
2442
|
+
* stored before imports existed, bare [`ReviewOutcome`]s, still read.
|
|
2443
|
+
*/
|
|
2444
|
+
export type ReviewSettlement = ReviewSettlement_Serialize | ReviewSettlement_Deserialize;
|
|
2445
|
+
/**
|
|
2446
|
+
* How the work a review decision started ended. Untagged so settlements
|
|
2447
|
+
* stored before imports existed, bare [`ReviewOutcome`]s, still read.
|
|
2448
|
+
*/
|
|
2449
|
+
export type ReviewSettlement_Deserialize =
|
|
2450
|
+
/** An approved import's background write ended. */
|
|
2451
|
+
{
|
|
2452
|
+
/** The import's final report. */
|
|
2453
|
+
import: ImportSettlement_Deserialize;
|
|
2454
|
+
} |
|
|
2455
|
+
/** The decided actions' confirmed results. */
|
|
2456
|
+
ReviewOutcome_Deserialize;
|
|
2457
|
+
/**
|
|
2458
|
+
* How the work a review decision started ended. Untagged so settlements
|
|
2459
|
+
* stored before imports existed, bare [`ReviewOutcome`]s, still read.
|
|
2460
|
+
*/
|
|
2461
|
+
export type ReviewSettlement_Serialize =
|
|
2462
|
+
/** An approved import's background write ended. */
|
|
2463
|
+
{
|
|
2464
|
+
/** The import's final report. */
|
|
2465
|
+
import: ImportSettlement_Serialize;
|
|
2466
|
+
} |
|
|
2467
|
+
/** The decided actions' confirmed results. */
|
|
2468
|
+
ReviewOutcome_Serialize;
|
|
2469
|
+
/**
|
|
2470
|
+
* A review's saved record moved to `revision`: presented, edited, decided,
|
|
2471
|
+
* or an item's action finished.
|
|
2472
|
+
*/
|
|
2473
|
+
export type ReviewUpdatedNotification = {
|
|
2474
|
+
/** The review that changed. */
|
|
2475
|
+
reviewId: string;
|
|
2476
|
+
/** Its saved revision after the change. */
|
|
2477
|
+
revision: number;
|
|
2478
|
+
};
|
|
2479
|
+
/** A run of a reply's parts that reads as one unit. */
|
|
2480
|
+
export type Segment = Segment_Serialize | Segment_Deserialize;
|
|
2481
|
+
/** What a segment of a reply is. */
|
|
2482
|
+
export type SegmentKind =
|
|
2483
|
+
/** A passage the agent wrote. */
|
|
2484
|
+
"prose" |
|
|
2485
|
+
/** A run of tool calls and plan updates. */
|
|
2486
|
+
"activity" |
|
|
2487
|
+
/** A permission or a question the agent put to the user. */
|
|
2488
|
+
"interaction";
|
|
2489
|
+
/** A run of a reply's parts that reads as one unit. */
|
|
2490
|
+
export type Segment_Deserialize = {
|
|
2491
|
+
/** Position among the reply's segments, from zero. */
|
|
2492
|
+
index: number;
|
|
2493
|
+
/** What the segment is. */
|
|
2494
|
+
kind: SegmentKind;
|
|
2495
|
+
/** Index of the segment's first part. */
|
|
2496
|
+
start: number;
|
|
2497
|
+
/** Index one past the segment's last part. */
|
|
2498
|
+
end: number;
|
|
2499
|
+
/**
|
|
2500
|
+
* Whether the segment can still change: false only for the last segment
|
|
2501
|
+
* of a reply that is still being written.
|
|
2502
|
+
*/
|
|
2503
|
+
sealed: boolean;
|
|
2504
|
+
/** The steps, for an activity segment; empty otherwise. */
|
|
2505
|
+
rows: ActivityRow_Deserialize[];
|
|
2506
|
+
};
|
|
2507
|
+
/** A run of a reply's parts that reads as one unit. */
|
|
2508
|
+
export type Segment_Serialize = {
|
|
2509
|
+
/** Position among the reply's segments, from zero. */
|
|
2510
|
+
index: number;
|
|
2511
|
+
/** What the segment is. */
|
|
2512
|
+
kind: SegmentKind;
|
|
2513
|
+
/** Index of the segment's first part. */
|
|
2514
|
+
start: number;
|
|
2515
|
+
/** Index one past the segment's last part. */
|
|
2516
|
+
end: number;
|
|
2517
|
+
/**
|
|
2518
|
+
* Whether the segment can still change: false only for the last segment
|
|
2519
|
+
* of a reply that is still being written.
|
|
2520
|
+
*/
|
|
2521
|
+
sealed: boolean;
|
|
2522
|
+
/** The steps, for an activity segment; empty otherwise. */
|
|
2523
|
+
rows: ActivityRow_Serialize[];
|
|
2524
|
+
};
|
|
2525
|
+
/** The supported ACP session-config shapes. */
|
|
2526
|
+
export type SessionConfigKind =
|
|
2527
|
+
/** A single-value selector. */
|
|
2528
|
+
{
|
|
2529
|
+
type: "select";
|
|
2530
|
+
/** The value currently selected by the agent. */
|
|
2531
|
+
currentValue: string;
|
|
2532
|
+
/** Choices in the order advertised by the agent. */
|
|
2533
|
+
options: SessionConfigSelectOption[];
|
|
2534
|
+
} |
|
|
2535
|
+
/** An on/off setting. */
|
|
2536
|
+
{
|
|
2537
|
+
type: "boolean";
|
|
2538
|
+
/** The value currently selected by the agent. */
|
|
2539
|
+
currentValue: boolean;
|
|
2540
|
+
};
|
|
2541
|
+
/** One session setting advertised by an ACP agent. */
|
|
2542
|
+
export type SessionConfigOption = {
|
|
2543
|
+
/** Opaque id to return in `session/set_config_option`. */
|
|
2544
|
+
id: string;
|
|
2545
|
+
/** Human-readable label supplied by the agent. */
|
|
2546
|
+
name: string;
|
|
2547
|
+
/** Optional explanatory copy supplied by the agent. */
|
|
2548
|
+
description: string | null;
|
|
2549
|
+
/** ACP semantic category, such as `model` or `thought_level`. */
|
|
2550
|
+
category: string | null;
|
|
2551
|
+
} & SessionConfigKind;
|
|
2552
|
+
/** One value in an ACP select option. */
|
|
2553
|
+
export type SessionConfigSelectOption = {
|
|
2554
|
+
/** Opaque value to return in `session/set_config_option`. */
|
|
2555
|
+
value: string;
|
|
2556
|
+
/** Human-readable label supplied by the agent. */
|
|
2557
|
+
name: string;
|
|
2558
|
+
/** Optional explanatory copy supplied by the agent. */
|
|
2559
|
+
description: string | null;
|
|
2560
|
+
/** Optional group heading supplied by the agent. */
|
|
2561
|
+
group: string | null;
|
|
2562
|
+
};
|
|
2563
|
+
/**
|
|
2564
|
+
* Session-level state derived from the log, latest-wins and carried whole.
|
|
2565
|
+
* Fields start absent and fill in as the log reveals them.
|
|
2566
|
+
*
|
|
2567
|
+
* `PartialEq` only: a pending form's numeric bounds are `f64`.
|
|
2568
|
+
*/
|
|
2569
|
+
export type SessionMetadata = SessionMetadata_Serialize | SessionMetadata_Deserialize;
|
|
2570
|
+
/**
|
|
2571
|
+
* Session-level state derived from the log, latest-wins and carried whole.
|
|
2572
|
+
* Fields start absent and fill in as the log reveals them.
|
|
2573
|
+
*
|
|
2574
|
+
* `PartialEq` only: a pending form's numeric bounds are `f64`.
|
|
2575
|
+
*/
|
|
2576
|
+
export type SessionMetadata_Deserialize = {
|
|
2577
|
+
/** System events, projected independently of the conversation messages. */
|
|
2578
|
+
notifications: SessionNotification_Deserialize[];
|
|
2579
|
+
/**
|
|
2580
|
+
* The newest saved revision of each review the log announced, in the
|
|
2581
|
+
* order they were first announced.
|
|
2582
|
+
*/
|
|
2583
|
+
reviewRevisions: ReviewUpdatedNotification[];
|
|
2584
|
+
/** The last notification turn whose entire answer was suppressed. */
|
|
2585
|
+
noopTurn: number | null;
|
|
2586
|
+
/** The agent that produced the log. See [`Harness`]. */
|
|
2587
|
+
harness: Harness;
|
|
2588
|
+
/**
|
|
2589
|
+
* Current model per the runtime's own `configOptions` responses, so a
|
|
2590
|
+
* rejected model change never moves it.
|
|
2591
|
+
*/
|
|
2592
|
+
model: string | null;
|
|
2593
|
+
/** The models the runtime offers, in the order it listed them. */
|
|
2594
|
+
supportedModels: ModelOption[];
|
|
2595
|
+
/**
|
|
2596
|
+
* Every setting the ACP agent currently advertises. The list is replaced
|
|
2597
|
+
* whole whenever ACP returns a new `configOptions` snapshot.
|
|
2598
|
+
*/
|
|
2599
|
+
configOptions: SessionConfigOption[];
|
|
2600
|
+
/** Session title, when the harness reports one. */
|
|
2601
|
+
title: string | null;
|
|
2602
|
+
/**
|
|
2603
|
+
* The slash commands the harness most recently advertised, in the order
|
|
2604
|
+
* it listed them. Empty until the first `available_commands_update`,
|
|
2605
|
+
* which arrives right after session setup, before any turn.
|
|
2606
|
+
*/
|
|
2607
|
+
availableCommands: AvailableCommand[];
|
|
2608
|
+
/**
|
|
2609
|
+
* The last system event's wire name (`"acp_ready"`, `"disconnected"`),
|
|
2610
|
+
* `None` until the runtime reports one.
|
|
2611
|
+
*/
|
|
2612
|
+
status: string | null;
|
|
2613
|
+
/**
|
|
2614
|
+
* Requests the user can answer on the current turn and connection.
|
|
2615
|
+
* Multiple permissions may coexist with the one allowed elicitation.
|
|
2616
|
+
* History remains in the transcript after these live requests clear.
|
|
2617
|
+
*/
|
|
2618
|
+
pendingInteractions: PendingInteraction[];
|
|
2619
|
+
/**
|
|
2620
|
+
* Where the newest turn stands, as one value. Readers used to derive it
|
|
2621
|
+
* from the transcript's tail, the status, and their own record of what
|
|
2622
|
+
* they had posted; this is that derivation done once, in the fold.
|
|
2623
|
+
*/
|
|
2624
|
+
turn: TurnState;
|
|
2625
|
+
};
|
|
2626
|
+
/**
|
|
2627
|
+
* Session-level state derived from the log, latest-wins and carried whole.
|
|
2628
|
+
* Fields start absent and fill in as the log reveals them.
|
|
2629
|
+
*
|
|
2630
|
+
* `PartialEq` only: a pending form's numeric bounds are `f64`.
|
|
2631
|
+
*/
|
|
2632
|
+
export type SessionMetadata_Serialize = {
|
|
2633
|
+
/** System events, projected independently of the conversation messages. */
|
|
2634
|
+
notifications: SessionNotification_Serialize[];
|
|
2635
|
+
/**
|
|
2636
|
+
* The newest saved revision of each review the log announced, in the
|
|
2637
|
+
* order they were first announced.
|
|
2638
|
+
*/
|
|
2639
|
+
reviewRevisions: ReviewUpdatedNotification[];
|
|
2640
|
+
/** The last notification turn whose entire answer was suppressed. */
|
|
2641
|
+
noopTurn: number | null;
|
|
2642
|
+
/** The agent that produced the log. See [`Harness`]. */
|
|
2643
|
+
harness: Harness;
|
|
2644
|
+
/**
|
|
2645
|
+
* Current model per the runtime's own `configOptions` responses, so a
|
|
2646
|
+
* rejected model change never moves it.
|
|
2647
|
+
*/
|
|
2648
|
+
model: string | null;
|
|
2649
|
+
/** The models the runtime offers, in the order it listed them. */
|
|
2650
|
+
supportedModels: ModelOption[];
|
|
2651
|
+
/**
|
|
2652
|
+
* Every setting the ACP agent currently advertises. The list is replaced
|
|
2653
|
+
* whole whenever ACP returns a new `configOptions` snapshot.
|
|
2654
|
+
*/
|
|
2655
|
+
configOptions: SessionConfigOption[];
|
|
2656
|
+
/** Session title, when the harness reports one. */
|
|
2657
|
+
title: string | null;
|
|
2658
|
+
/**
|
|
2659
|
+
* The slash commands the harness most recently advertised, in the order
|
|
2660
|
+
* it listed them. Empty until the first `available_commands_update`,
|
|
2661
|
+
* which arrives right after session setup, before any turn.
|
|
2662
|
+
*/
|
|
2663
|
+
availableCommands: AvailableCommand[];
|
|
2664
|
+
/**
|
|
2665
|
+
* The last system event's wire name (`"acp_ready"`, `"disconnected"`),
|
|
2666
|
+
* `None` until the runtime reports one.
|
|
2667
|
+
*/
|
|
2668
|
+
status: string | null;
|
|
2669
|
+
/**
|
|
2670
|
+
* Requests the user can answer on the current turn and connection.
|
|
2671
|
+
* Multiple permissions may coexist with the one allowed elicitation.
|
|
2672
|
+
* History remains in the transcript after these live requests clear.
|
|
2673
|
+
*/
|
|
2674
|
+
pendingInteractions: PendingInteraction[];
|
|
2675
|
+
/**
|
|
2676
|
+
* Where the newest turn stands, as one value. Readers used to derive it
|
|
2677
|
+
* from the transcript's tail, the status, and their own record of what
|
|
2678
|
+
* they had posted; this is that derivation done once, in the fold.
|
|
2679
|
+
*/
|
|
2680
|
+
turn: TurnState;
|
|
2681
|
+
};
|
|
2682
|
+
/** A timeline event or a card state change. Never a conversation message. */
|
|
2683
|
+
export type SessionNotification = SessionNotification_Serialize | SessionNotification_Deserialize;
|
|
2684
|
+
/** A timeline event or a card state change. Never a conversation message. */
|
|
2685
|
+
export type SessionNotification_Deserialize = {
|
|
2686
|
+
/** Outbox identity. */
|
|
2687
|
+
id: string;
|
|
2688
|
+
/** Subject identity used to find an existing card. */
|
|
2689
|
+
subjectId: string;
|
|
2690
|
+
/** Event creation time, RFC3339. */
|
|
2691
|
+
createdAt: string;
|
|
2692
|
+
/** Turn that received it. */
|
|
2693
|
+
turn: number;
|
|
2694
|
+
/** Stable delivery action identity. */
|
|
2695
|
+
actionId: string;
|
|
2696
|
+
/** Whether this turn had no user prompt. */
|
|
2697
|
+
systemTurn: boolean;
|
|
2698
|
+
} & NotificationEvent_Deserialize;
|
|
2699
|
+
/** A timeline event or a card state change. Never a conversation message. */
|
|
2700
|
+
export type SessionNotification_Serialize = {
|
|
2701
|
+
/** Outbox identity. */
|
|
2702
|
+
id: string;
|
|
2703
|
+
/** Subject identity used to find an existing card. */
|
|
2704
|
+
subjectId: string;
|
|
2705
|
+
/** Event creation time, RFC3339. */
|
|
2706
|
+
createdAt: string;
|
|
2707
|
+
/** Turn that received it. */
|
|
2708
|
+
turn: number;
|
|
2709
|
+
/** Stable delivery action identity. */
|
|
2710
|
+
actionId: string;
|
|
2711
|
+
/** Whether this turn had no user prompt. */
|
|
2712
|
+
systemTurn: boolean;
|
|
2713
|
+
} & NotificationEvent_Serialize;
|
|
2714
|
+
/**
|
|
2715
|
+
* Why a turn stopped.
|
|
2716
|
+
*
|
|
2717
|
+
* All but one variant is parsed straight off ACP's `stopReason` wire string
|
|
2718
|
+
* by [`FromStr`]: the `snake_case` variant names are the wire names, and
|
|
2719
|
+
* anything unmodelled falls through to [`Self::Other`], so parsing never
|
|
2720
|
+
* fails. [`Self::Failed`] is the exception - no wire string produces it,
|
|
2721
|
+
* because it is what a turn that got no `stopReason` at all stopped for.
|
|
2722
|
+
*/
|
|
2723
|
+
export type StopReason =
|
|
2724
|
+
/** The agent finished its turn. */
|
|
2725
|
+
{
|
|
2726
|
+
kind: "end_turn";
|
|
2727
|
+
} |
|
|
2728
|
+
/** The model hit its token limit. */
|
|
2729
|
+
{
|
|
2730
|
+
kind: "max_tokens";
|
|
2731
|
+
} |
|
|
2732
|
+
/** The agent hit its turn-request limit. */
|
|
2733
|
+
{
|
|
2734
|
+
kind: "max_turn_requests";
|
|
2735
|
+
} |
|
|
2736
|
+
/** The agent declined. */
|
|
2737
|
+
{
|
|
2738
|
+
kind: "refusal";
|
|
2739
|
+
} |
|
|
2740
|
+
/** The turn was cancelled. */
|
|
2741
|
+
{
|
|
2742
|
+
kind: "cancelled";
|
|
2743
|
+
} |
|
|
2744
|
+
/** A stop reason this fold does not model, as its wire string. */
|
|
2745
|
+
{
|
|
2746
|
+
kind: "other";
|
|
2747
|
+
/** The unrecognized wire value. */
|
|
2748
|
+
reason: string;
|
|
2749
|
+
} |
|
|
2750
|
+
/**
|
|
2751
|
+
* The runtime answered the prompt with a JSON-RPC error, so the turn
|
|
2752
|
+
* produced no reply and never will.
|
|
2753
|
+
*
|
|
2754
|
+
* Constructed by the fold, never parsed: an error response carries no
|
|
2755
|
+
* `stopReason` to read. Modelled as a stop reason rather than as
|
|
2756
|
+
* something alongside one because that is what it is - a turn that
|
|
2757
|
+
* ended - and because every reader already asks `stop` whether a turn
|
|
2758
|
+
* is still running. A turn left with no stop reason reads as forever in
|
|
2759
|
+
* flight, which is how a failed prompt used to wedge a session.
|
|
2760
|
+
*/
|
|
2761
|
+
{
|
|
2762
|
+
kind: "failed";
|
|
2763
|
+
/** The runtime's error message, verbatim. */
|
|
2764
|
+
message: string;
|
|
2765
|
+
/**
|
|
2766
|
+
* The failure in the person's terms, when the runtime classified it
|
|
2767
|
+
* as one they can act on. Absent for an opaque failure, which a
|
|
2768
|
+
* reader shows as `message` alone.
|
|
2769
|
+
*/
|
|
2770
|
+
notice?: FailureNotice | null;
|
|
2771
|
+
};
|
|
2772
|
+
/**
|
|
2773
|
+
* What a subagent reported back, as far as its harness told us.
|
|
2774
|
+
*
|
|
2775
|
+
* Every field is optional because every harness tells us a different
|
|
2776
|
+
* subset: Claude Code reports timings, token counts and a per-tool
|
|
2777
|
+
* breakdown; OpenCode names the child session and its model; Cursor and
|
|
2778
|
+
* Hermes give back little more than the text. A reader shows what is
|
|
2779
|
+
* there.
|
|
2780
|
+
*/
|
|
2781
|
+
export type SubagentResult = {
|
|
2782
|
+
/** The subagent's answer, as text. */
|
|
2783
|
+
text: string | null;
|
|
2784
|
+
/** Why the subagent failed, when it did. */
|
|
2785
|
+
error: string | null;
|
|
2786
|
+
/**
|
|
2787
|
+
* The harness's id for the subagent or its session, for anyone who
|
|
2788
|
+
* wants to find it again.
|
|
2789
|
+
*/
|
|
2790
|
+
agentId: string | null;
|
|
2791
|
+
/** The model the subagent ran on. */
|
|
2792
|
+
model: string | null;
|
|
2793
|
+
/**
|
|
2794
|
+
* Wall-clock time the subagent took. `u32` because the browser
|
|
2795
|
+
* contract forbids 64-bit integers; 49 days of milliseconds is plenty.
|
|
2796
|
+
*/
|
|
2797
|
+
durationMs: number | null;
|
|
2798
|
+
/** Tokens the subagent consumed. `u32` for the same reason. */
|
|
2799
|
+
tokens: number | null;
|
|
2800
|
+
/** How many tools the subagent called. */
|
|
2801
|
+
toolUses: number | null;
|
|
2802
|
+
/** What kinds of tools the subagent called. */
|
|
2803
|
+
stats: ToolStats | null;
|
|
2804
|
+
};
|
|
2805
|
+
/** How selected tags combine: items with any of them, or with all of them. */
|
|
2806
|
+
export type TagFilterMode = "any" | "all";
|
|
2807
|
+
/**
|
|
2808
|
+
* One tag of an ontology and the narrower tags under it. A tag may exist
|
|
2809
|
+
* already, or be one the answer proposes.
|
|
2810
|
+
*/
|
|
2811
|
+
export type TagNode = TagNode_Serialize | TagNode_Deserialize;
|
|
2812
|
+
/**
|
|
2813
|
+
* One tag of an ontology and the narrower tags under it. A tag may exist
|
|
2814
|
+
* already, or be one the answer proposes.
|
|
2815
|
+
*/
|
|
2816
|
+
export type TagNode_Deserialize = {
|
|
2817
|
+
/**
|
|
2818
|
+
* The tag's name. Name a narrower tag on its own: "bug" under "Type",
|
|
2819
|
+
* not "Type/bug".
|
|
2820
|
+
*/
|
|
2821
|
+
label: string;
|
|
2822
|
+
/**
|
|
2823
|
+
* One of the tag colours: red, tomato, orange, amber, yellow, green,
|
|
2824
|
+
* teal, blue, indigo, purple, pink, gray. Gray when omitted.
|
|
2825
|
+
*/
|
|
2826
|
+
color?: string;
|
|
2827
|
+
/** What the tag is for, in a few words. */
|
|
2828
|
+
description?: string;
|
|
2829
|
+
/**
|
|
2830
|
+
* For a tag that exists, the id ListTags or CreateTag returned: the tag
|
|
2831
|
+
* then shows its current name and colour, and opens what is tagged with
|
|
2832
|
+
* it.
|
|
2833
|
+
*/
|
|
2834
|
+
tagId?: string;
|
|
2835
|
+
/** The narrower tags under this one. */
|
|
2836
|
+
children?: TagNode_Deserialize[];
|
|
2837
|
+
};
|
|
2838
|
+
/**
|
|
2839
|
+
* One tag of an ontology and the narrower tags under it. A tag may exist
|
|
2840
|
+
* already, or be one the answer proposes.
|
|
2841
|
+
*/
|
|
2842
|
+
export type TagNode_Serialize = {
|
|
2843
|
+
/**
|
|
2844
|
+
* The tag's name. Name a narrower tag on its own: "bug" under "Type",
|
|
2845
|
+
* not "Type/bug".
|
|
2846
|
+
*/
|
|
2847
|
+
label: string;
|
|
2848
|
+
/**
|
|
2849
|
+
* One of the tag colours: red, tomato, orange, amber, yellow, green,
|
|
2850
|
+
* teal, blue, indigo, purple, pink, gray. Gray when omitted.
|
|
2851
|
+
*/
|
|
2852
|
+
color?: string;
|
|
2853
|
+
/** What the tag is for, in a few words. */
|
|
2854
|
+
description?: string;
|
|
2855
|
+
/**
|
|
2856
|
+
* For a tag that exists, the id ListTags or CreateTag returned: the tag
|
|
2857
|
+
* then shows its current name and colour, and opens what is tagged with
|
|
2858
|
+
* it.
|
|
2859
|
+
*/
|
|
2860
|
+
tagId?: string;
|
|
2861
|
+
/** The narrower tags under this one. */
|
|
2862
|
+
children?: TagNode_Serialize[];
|
|
2863
|
+
};
|
|
2864
|
+
/** How a background task ended, per [`MessagePart::TaskNotification`]. */
|
|
2865
|
+
export type TaskStatus =
|
|
2866
|
+
/** It ran to the end. */
|
|
2867
|
+
"completed" |
|
|
2868
|
+
/** It ended with an error or a nonzero exit. */
|
|
2869
|
+
"failed" |
|
|
2870
|
+
/** It was stopped, or did not survive the previous session. */
|
|
2871
|
+
"stopped";
|
|
2872
|
+
/** One event of a timeline. */
|
|
2873
|
+
export type TimelineEvent = TimelineEvent_Serialize | TimelineEvent_Deserialize;
|
|
2874
|
+
/** One event of a timeline. */
|
|
2875
|
+
export type TimelineEvent_Deserialize = {
|
|
2876
|
+
/** Human-readable timestamp, e.g. "9:32am" or "Yesterday". */
|
|
2877
|
+
time: string;
|
|
2878
|
+
title: string;
|
|
2879
|
+
description?: string;
|
|
2880
|
+
/** Links the event to a workspace entity. */
|
|
2881
|
+
entity?: EntityRef;
|
|
2882
|
+
/**
|
|
2883
|
+
* true = upcoming/future event, rendered gray; omitted/false = past,
|
|
2884
|
+
* rendered accent.
|
|
2885
|
+
*/
|
|
2886
|
+
future?: boolean;
|
|
2887
|
+
};
|
|
2888
|
+
/** One event of a timeline. */
|
|
2889
|
+
export type TimelineEvent_Serialize = {
|
|
2890
|
+
/** Human-readable timestamp, e.g. "9:32am" or "Yesterday". */
|
|
2891
|
+
time: string;
|
|
2892
|
+
title: string;
|
|
2893
|
+
description?: string;
|
|
2894
|
+
/** Links the event to a workspace entity. */
|
|
2895
|
+
entity?: EntityRef;
|
|
2896
|
+
/**
|
|
2897
|
+
* true = upcoming/future event, rendered gray; omitted/false = past,
|
|
2898
|
+
* rendered accent.
|
|
2899
|
+
*/
|
|
2900
|
+
future?: boolean;
|
|
2901
|
+
};
|
|
2902
|
+
/** Where a held call stands. */
|
|
2903
|
+
export type ToolApprovalStatus =
|
|
2904
|
+
/** Held until the owner answers. */
|
|
2905
|
+
"pending" |
|
|
2906
|
+
/** The owner approved it; the call went through. */
|
|
2907
|
+
"approved" |
|
|
2908
|
+
/** The owner refused it; the call did not run. */
|
|
2909
|
+
"denied" |
|
|
2910
|
+
/** Someone with edit access, the agent, or the session gave up on it. */
|
|
2911
|
+
"cancelled" |
|
|
2912
|
+
/** Nobody answered in time. */
|
|
2913
|
+
"expired";
|
|
2914
|
+
/**
|
|
2915
|
+
* What a tool call actually did.
|
|
2916
|
+
*
|
|
2917
|
+
* Discriminated by what a reader needs in order to render it, not by ACP's
|
|
2918
|
+
* [`ToolKind`](agent_client_protocol::ToolKind). A terminal wants command and
|
|
2919
|
+
* output; an edit wants a diff; a handful of others want the paths they
|
|
2920
|
+
* touched or whatever text they reported; everything else wants its raw
|
|
2921
|
+
* input shown as JSON. Every named [`ToolKind`](agent_client_protocol::ToolKind)
|
|
2922
|
+
* has a variant here, so the fold never falls back to [`Self::Other`] for a
|
|
2923
|
+
* kind ACP defines - only for `switch_mode` (nothing a reader would want
|
|
2924
|
+
* rendered) and a kind this fold does not yet know about.
|
|
2925
|
+
*
|
|
2926
|
+
* Four variants are chosen by *name* rather than kind: Macro's own tools
|
|
2927
|
+
* ([`Self::Macro`], [`Self::View`], [`Self::UserTool`]) arrive as ACP `other`, and what a
|
|
2928
|
+
* reader wants for them is the tool's own JSON, not a generic card; a
|
|
2929
|
+
* delegation ([`Self::Subagent`]) is a tool call by whatever name its
|
|
2930
|
+
* harness gives it. The harness layer decides which names are which.
|
|
2931
|
+
*/
|
|
2932
|
+
export type ToolDetail = ToolDetail_Serialize | ToolDetail_Deserialize;
|
|
2933
|
+
/**
|
|
2934
|
+
* What a tool call actually did.
|
|
2935
|
+
*
|
|
2936
|
+
* Discriminated by what a reader needs in order to render it, not by ACP's
|
|
2937
|
+
* [`ToolKind`](agent_client_protocol::ToolKind). A terminal wants command and
|
|
2938
|
+
* output; an edit wants a diff; a handful of others want the paths they
|
|
2939
|
+
* touched or whatever text they reported; everything else wants its raw
|
|
2940
|
+
* input shown as JSON. Every named [`ToolKind`](agent_client_protocol::ToolKind)
|
|
2941
|
+
* has a variant here, so the fold never falls back to [`Self::Other`] for a
|
|
2942
|
+
* kind ACP defines - only for `switch_mode` (nothing a reader would want
|
|
2943
|
+
* rendered) and a kind this fold does not yet know about.
|
|
2944
|
+
*
|
|
2945
|
+
* Four variants are chosen by *name* rather than kind: Macro's own tools
|
|
2946
|
+
* ([`Self::Macro`], [`Self::View`], [`Self::UserTool`]) arrive as ACP `other`, and what a
|
|
2947
|
+
* reader wants for them is the tool's own JSON, not a generic card; a
|
|
2948
|
+
* delegation ([`Self::Subagent`]) is a tool call by whatever name its
|
|
2949
|
+
* harness gives it. The harness layer decides which names are which.
|
|
2950
|
+
*/
|
|
2951
|
+
export type ToolDetail_Deserialize =
|
|
2952
|
+
/** A shell command. ACP's `execute`. */
|
|
2953
|
+
({
|
|
2954
|
+
kind: "terminal";
|
|
2955
|
+
/** The command line, when the harness reported one. */
|
|
2956
|
+
command: string | null;
|
|
2957
|
+
/** Captured output, ANSI escapes intact. See [`AnsiText`]. */
|
|
2958
|
+
output: AnsiText | null;
|
|
2959
|
+
/** Process exit code, when the harness reported one. */
|
|
2960
|
+
exitCode: number | null;
|
|
2961
|
+
}) & {
|
|
2962
|
+
acpKind?: never;
|
|
2963
|
+
agentType?: never;
|
|
2964
|
+
background?: never;
|
|
2965
|
+
children?: never;
|
|
2966
|
+
description?: never;
|
|
2967
|
+
diffs?: never;
|
|
2968
|
+
error?: never;
|
|
2969
|
+
input?: never;
|
|
2970
|
+
outcome?: never;
|
|
2971
|
+
paths?: never;
|
|
2972
|
+
prompt?: never;
|
|
2973
|
+
result?: never;
|
|
2974
|
+
title?: never;
|
|
2975
|
+
view?: never;
|
|
2976
|
+
} |
|
|
2977
|
+
/** One or more file modifications. ACP's `edit`. */
|
|
2978
|
+
({
|
|
2979
|
+
kind: "edit";
|
|
2980
|
+
/** The diffs ACP reported for this call. */
|
|
2981
|
+
diffs: FileDiff[];
|
|
2982
|
+
}) & {
|
|
2983
|
+
acpKind?: never;
|
|
2984
|
+
agentType?: never;
|
|
2985
|
+
background?: never;
|
|
2986
|
+
children?: never;
|
|
2987
|
+
command?: never;
|
|
2988
|
+
description?: never;
|
|
2989
|
+
error?: never;
|
|
2990
|
+
exitCode?: never;
|
|
2991
|
+
input?: never;
|
|
2992
|
+
outcome?: never;
|
|
2993
|
+
output?: never;
|
|
2994
|
+
paths?: never;
|
|
2995
|
+
prompt?: never;
|
|
2996
|
+
result?: never;
|
|
2997
|
+
title?: never;
|
|
2998
|
+
view?: never;
|
|
2999
|
+
} |
|
|
3000
|
+
/** A file read. ACP's `read`. */
|
|
3001
|
+
({
|
|
3002
|
+
kind: "read";
|
|
3003
|
+
/** Paths this call touched. */
|
|
3004
|
+
paths: string[];
|
|
3005
|
+
}) & {
|
|
3006
|
+
acpKind?: never;
|
|
3007
|
+
agentType?: never;
|
|
3008
|
+
background?: never;
|
|
3009
|
+
children?: never;
|
|
3010
|
+
command?: never;
|
|
3011
|
+
description?: never;
|
|
3012
|
+
diffs?: never;
|
|
3013
|
+
error?: never;
|
|
3014
|
+
exitCode?: never;
|
|
3015
|
+
input?: never;
|
|
3016
|
+
outcome?: never;
|
|
3017
|
+
output?: never;
|
|
3018
|
+
prompt?: never;
|
|
3019
|
+
result?: never;
|
|
3020
|
+
title?: never;
|
|
3021
|
+
view?: never;
|
|
3022
|
+
} |
|
|
3023
|
+
/** One or more files removed. ACP's `delete`. */
|
|
3024
|
+
({
|
|
3025
|
+
kind: "delete";
|
|
3026
|
+
/** Paths this call touched. */
|
|
3027
|
+
paths: string[];
|
|
3028
|
+
}) & {
|
|
3029
|
+
acpKind?: never;
|
|
3030
|
+
agentType?: never;
|
|
3031
|
+
background?: never;
|
|
3032
|
+
children?: never;
|
|
3033
|
+
command?: never;
|
|
3034
|
+
description?: never;
|
|
3035
|
+
diffs?: never;
|
|
3036
|
+
error?: never;
|
|
3037
|
+
exitCode?: never;
|
|
3038
|
+
input?: never;
|
|
3039
|
+
outcome?: never;
|
|
3040
|
+
output?: never;
|
|
3041
|
+
prompt?: never;
|
|
3042
|
+
result?: never;
|
|
3043
|
+
title?: never;
|
|
3044
|
+
view?: never;
|
|
3045
|
+
} |
|
|
3046
|
+
/**
|
|
3047
|
+
* One or more files moved or renamed. ACP's `move`.
|
|
3048
|
+
*
|
|
3049
|
+
* Only the paths a reader can be sure of. ACP has no standard field for
|
|
3050
|
+
* "from" versus "to" - a call's `locations` is just the set of paths it
|
|
3051
|
+
* touched - so this does not guess at a direction.
|
|
3052
|
+
*/
|
|
3053
|
+
({
|
|
3054
|
+
kind: "move";
|
|
3055
|
+
/** Paths this call touched. */
|
|
3056
|
+
paths: string[];
|
|
3057
|
+
}) & {
|
|
3058
|
+
acpKind?: never;
|
|
3059
|
+
agentType?: never;
|
|
3060
|
+
background?: never;
|
|
3061
|
+
children?: never;
|
|
3062
|
+
command?: never;
|
|
3063
|
+
description?: never;
|
|
3064
|
+
diffs?: never;
|
|
3065
|
+
error?: never;
|
|
3066
|
+
exitCode?: never;
|
|
3067
|
+
input?: never;
|
|
3068
|
+
outcome?: never;
|
|
3069
|
+
output?: never;
|
|
3070
|
+
prompt?: never;
|
|
3071
|
+
result?: never;
|
|
3072
|
+
title?: never;
|
|
3073
|
+
view?: never;
|
|
3074
|
+
} |
|
|
3075
|
+
/** A search. ACP's `search`. */
|
|
3076
|
+
({
|
|
3077
|
+
kind: "search";
|
|
3078
|
+
/** Paths this call touched. */
|
|
3079
|
+
paths: string[];
|
|
3080
|
+
/** Text the call reported - e.g. matched lines - when any. */
|
|
3081
|
+
output: string | null;
|
|
3082
|
+
}) & {
|
|
3083
|
+
acpKind?: never;
|
|
3084
|
+
agentType?: never;
|
|
3085
|
+
background?: never;
|
|
3086
|
+
children?: never;
|
|
3087
|
+
command?: never;
|
|
3088
|
+
description?: never;
|
|
3089
|
+
diffs?: never;
|
|
3090
|
+
error?: never;
|
|
3091
|
+
exitCode?: never;
|
|
3092
|
+
input?: never;
|
|
3093
|
+
outcome?: never;
|
|
3094
|
+
prompt?: never;
|
|
3095
|
+
result?: never;
|
|
3096
|
+
title?: never;
|
|
3097
|
+
view?: never;
|
|
3098
|
+
} |
|
|
3099
|
+
/** Retrieving external data. ACP's `fetch`. */
|
|
3100
|
+
({
|
|
3101
|
+
kind: "fetch";
|
|
3102
|
+
/** Text the call reported, when any. */
|
|
3103
|
+
output: string | null;
|
|
3104
|
+
}) & {
|
|
3105
|
+
acpKind?: never;
|
|
3106
|
+
agentType?: never;
|
|
3107
|
+
background?: never;
|
|
3108
|
+
children?: never;
|
|
3109
|
+
command?: never;
|
|
3110
|
+
description?: never;
|
|
3111
|
+
diffs?: never;
|
|
3112
|
+
error?: never;
|
|
3113
|
+
exitCode?: never;
|
|
3114
|
+
input?: never;
|
|
3115
|
+
outcome?: never;
|
|
3116
|
+
paths?: never;
|
|
3117
|
+
prompt?: never;
|
|
3118
|
+
result?: never;
|
|
3119
|
+
title?: never;
|
|
3120
|
+
view?: never;
|
|
3121
|
+
} |
|
|
3122
|
+
/**
|
|
3123
|
+
* Explicit reasoning surfaced as its own tool call, as distinct from
|
|
3124
|
+
* [`MessagePart::Thought`], which is reasoning streamed inline. ACP's
|
|
3125
|
+
* `think`.
|
|
3126
|
+
*/
|
|
3127
|
+
({
|
|
3128
|
+
kind: "think";
|
|
3129
|
+
/** Text the call reported, when any. */
|
|
3130
|
+
output: string | null;
|
|
3131
|
+
}) & {
|
|
3132
|
+
acpKind?: never;
|
|
3133
|
+
agentType?: never;
|
|
3134
|
+
background?: never;
|
|
3135
|
+
children?: never;
|
|
3136
|
+
command?: never;
|
|
3137
|
+
description?: never;
|
|
3138
|
+
diffs?: never;
|
|
3139
|
+
error?: never;
|
|
3140
|
+
exitCode?: never;
|
|
3141
|
+
input?: never;
|
|
3142
|
+
outcome?: never;
|
|
3143
|
+
paths?: never;
|
|
3144
|
+
prompt?: never;
|
|
3145
|
+
result?: never;
|
|
3146
|
+
title?: never;
|
|
3147
|
+
view?: never;
|
|
3148
|
+
} |
|
|
3149
|
+
/**
|
|
3150
|
+
* Anything else: ACP's `switch_mode`, a tool from an MCP server the fold
|
|
3151
|
+
* knows nothing about, and any kind - including `other` itself,
|
|
3152
|
+
* [`ToolKind`](agent_client_protocol::ToolKind)'s default for a call
|
|
3153
|
+
* that names no kind at all - this fold has no special rendering for.
|
|
3154
|
+
* What a reader wants is the exchange itself: the request the agent
|
|
3155
|
+
* made and the response it got, as JSON.
|
|
3156
|
+
*/
|
|
3157
|
+
({
|
|
3158
|
+
kind: "other";
|
|
3159
|
+
/** ACP's tool kind, as its wire string. */
|
|
3160
|
+
acpKind: string;
|
|
3161
|
+
/** Text the call reported in its content blocks, when any. */
|
|
3162
|
+
output: string | null;
|
|
3163
|
+
/**
|
|
3164
|
+
* The tool's own arguments, when reported - out of any wrapper the
|
|
3165
|
+
* harness put around them.
|
|
3166
|
+
*/
|
|
3167
|
+
input: unknown;
|
|
3168
|
+
/**
|
|
3169
|
+
* The tool's own result, when the harness reported one in
|
|
3170
|
+
* `rawOutput` - out of the harness's wrapper and MCP's envelope, so
|
|
3171
|
+
* an MCP tool's `structuredContent` (or its text, parsed when it is
|
|
3172
|
+
* JSON) arrives as the JSON the tool returned.
|
|
3173
|
+
*/
|
|
3174
|
+
result: unknown;
|
|
3175
|
+
/** The error text, when the harness's wrapper reported failure. */
|
|
3176
|
+
error: string | null;
|
|
3177
|
+
}) & {
|
|
3178
|
+
agentType?: never;
|
|
3179
|
+
background?: never;
|
|
3180
|
+
children?: never;
|
|
3181
|
+
command?: never;
|
|
3182
|
+
description?: never;
|
|
3183
|
+
diffs?: never;
|
|
3184
|
+
exitCode?: never;
|
|
3185
|
+
outcome?: never;
|
|
3186
|
+
paths?: never;
|
|
3187
|
+
prompt?: never;
|
|
3188
|
+
title?: never;
|
|
3189
|
+
view?: never;
|
|
3190
|
+
} |
|
|
3191
|
+
/**
|
|
3192
|
+
* A Macro tool the fold knows by name - reached over Macro's MCP
|
|
3193
|
+
* server, or called in-process by Macro's own agent. Input and output
|
|
3194
|
+
* are the tool's own JSON, any MCP envelope already removed, so a
|
|
3195
|
+
* reader that knows the tool renders it without parsing the wire.
|
|
3196
|
+
*/
|
|
3197
|
+
({
|
|
3198
|
+
kind: "macro";
|
|
3199
|
+
/** The tool's arguments, as it defines them. */
|
|
3200
|
+
input: unknown;
|
|
3201
|
+
/**
|
|
3202
|
+
* The tool's result, as it defines it; absent until the call
|
|
3203
|
+
* completes.
|
|
3204
|
+
*/
|
|
3205
|
+
output: unknown;
|
|
3206
|
+
/** The error text, when the call failed. */
|
|
3207
|
+
error: string | null;
|
|
3208
|
+
}) & {
|
|
3209
|
+
acpKind?: never;
|
|
3210
|
+
agentType?: never;
|
|
3211
|
+
background?: never;
|
|
3212
|
+
children?: never;
|
|
3213
|
+
command?: never;
|
|
3214
|
+
description?: never;
|
|
3215
|
+
diffs?: never;
|
|
3216
|
+
exitCode?: never;
|
|
3217
|
+
outcome?: never;
|
|
3218
|
+
paths?: never;
|
|
3219
|
+
prompt?: never;
|
|
3220
|
+
result?: never;
|
|
3221
|
+
title?: never;
|
|
3222
|
+
view?: never;
|
|
3223
|
+
} |
|
|
3224
|
+
/**
|
|
3225
|
+
* A view shown to the person: Macro's `DisplayResults`, or the call the
|
|
3226
|
+
* harness presents for `execution.views.present`. The server decodes
|
|
3227
|
+
* the view into its result, so this is the view a reader renders.
|
|
3228
|
+
*/
|
|
3229
|
+
({
|
|
3230
|
+
kind: "view";
|
|
3231
|
+
/** The view, once the call has returned one that decodes. */
|
|
3232
|
+
view: View_Deserialize | null;
|
|
3233
|
+
/** The error text, when the call failed. */
|
|
3234
|
+
error: string | null;
|
|
3235
|
+
}) & {
|
|
3236
|
+
acpKind?: never;
|
|
3237
|
+
agentType?: never;
|
|
3238
|
+
background?: never;
|
|
3239
|
+
children?: never;
|
|
3240
|
+
command?: never;
|
|
3241
|
+
description?: never;
|
|
3242
|
+
diffs?: never;
|
|
3243
|
+
exitCode?: never;
|
|
3244
|
+
input?: never;
|
|
3245
|
+
outcome?: never;
|
|
3246
|
+
output?: never;
|
|
3247
|
+
paths?: never;
|
|
3248
|
+
prompt?: never;
|
|
3249
|
+
result?: never;
|
|
3250
|
+
title?: never;
|
|
3251
|
+
} |
|
|
3252
|
+
/**
|
|
3253
|
+
* A Macro user tool: the agent drafted it, the user finishes it after
|
|
3254
|
+
* the turn. See [`UserToolOutcome`].
|
|
3255
|
+
*/
|
|
3256
|
+
({
|
|
3257
|
+
kind: "user_tool";
|
|
3258
|
+
/**
|
|
3259
|
+
* The draft, as the tool defines its arguments; patched as the
|
|
3260
|
+
* user edits.
|
|
3261
|
+
*/
|
|
3262
|
+
input: unknown;
|
|
3263
|
+
/** Where the user got to with it. */
|
|
3264
|
+
outcome: UserToolOutcome;
|
|
3265
|
+
}) & {
|
|
3266
|
+
acpKind?: never;
|
|
3267
|
+
agentType?: never;
|
|
3268
|
+
background?: never;
|
|
3269
|
+
children?: never;
|
|
3270
|
+
command?: never;
|
|
3271
|
+
description?: never;
|
|
3272
|
+
diffs?: never;
|
|
3273
|
+
error?: never;
|
|
3274
|
+
exitCode?: never;
|
|
3275
|
+
output?: never;
|
|
3276
|
+
paths?: never;
|
|
3277
|
+
prompt?: never;
|
|
3278
|
+
result?: never;
|
|
3279
|
+
title?: never;
|
|
3280
|
+
view?: never;
|
|
3281
|
+
} |
|
|
3282
|
+
/**
|
|
3283
|
+
* Work the agent delegated to another agent.
|
|
3284
|
+
*
|
|
3285
|
+
* ACP has no notion of this; every harness spells it as a tool call by
|
|
3286
|
+
* its own conventions (Claude Code's `Agent`, OpenCode's and Cursor's
|
|
3287
|
+
* `task`, Codex's `spawnAgent`, Hermes's `delegate_task`), and the
|
|
3288
|
+
* harness reader recognizes it. What the subagent itself did nests in
|
|
3289
|
+
* `children` when the harness attributes its calls to the parent -
|
|
3290
|
+
* only Claude Code does today - and is otherwise summarized in
|
|
3291
|
+
* `result`.
|
|
3292
|
+
*/
|
|
3293
|
+
({
|
|
3294
|
+
kind: "subagent";
|
|
3295
|
+
/**
|
|
3296
|
+
* What to call the delegation: the harness's description when it
|
|
3297
|
+
* gave one, else the first line of the brief, else the tool's own
|
|
3298
|
+
* name. Always present, so a reader never has to pick a fallback
|
|
3299
|
+
* itself; `description` and `prompt` stay exactly what the harness
|
|
3300
|
+
* said.
|
|
3301
|
+
*/
|
|
3302
|
+
title: string;
|
|
3303
|
+
/**
|
|
3304
|
+
* Which kind of agent was delegated to (`general-purpose`,
|
|
3305
|
+
* `explore`), when the harness names one.
|
|
3306
|
+
*/
|
|
3307
|
+
agentType: string | null;
|
|
3308
|
+
/** A short description of the task, when given. */
|
|
3309
|
+
description: string | null;
|
|
3310
|
+
/** The brief the subagent was given. */
|
|
3311
|
+
prompt: string | null;
|
|
3312
|
+
/**
|
|
3313
|
+
* Whether the subagent was started in the background: its call
|
|
3314
|
+
* completes at once and its answer, if any, arrives some other way.
|
|
3315
|
+
*/
|
|
3316
|
+
background: boolean;
|
|
3317
|
+
/**
|
|
3318
|
+
* The subagent's own parts, in arrival order, for a harness that
|
|
3319
|
+
* attributes them to the parent call.
|
|
3320
|
+
*/
|
|
3321
|
+
children: MessagePart_Deserialize[];
|
|
3322
|
+
/**
|
|
3323
|
+
* What the subagent reported back, once it has.
|
|
3324
|
+
*
|
|
3325
|
+
* Boxed: this is by far the widest thing a part can hold, and every
|
|
3326
|
+
* part pays for the widest variant.
|
|
3327
|
+
*/
|
|
3328
|
+
result: SubagentResult | null;
|
|
3329
|
+
}) & {
|
|
3330
|
+
acpKind?: never;
|
|
3331
|
+
command?: never;
|
|
3332
|
+
diffs?: never;
|
|
3333
|
+
error?: never;
|
|
3334
|
+
exitCode?: never;
|
|
3335
|
+
input?: never;
|
|
3336
|
+
outcome?: never;
|
|
3337
|
+
output?: never;
|
|
3338
|
+
paths?: never;
|
|
3339
|
+
view?: never;
|
|
3340
|
+
};
|
|
3341
|
+
/**
|
|
3342
|
+
* What a tool call actually did.
|
|
3343
|
+
*
|
|
3344
|
+
* Discriminated by what a reader needs in order to render it, not by ACP's
|
|
3345
|
+
* [`ToolKind`](agent_client_protocol::ToolKind). A terminal wants command and
|
|
3346
|
+
* output; an edit wants a diff; a handful of others want the paths they
|
|
3347
|
+
* touched or whatever text they reported; everything else wants its raw
|
|
3348
|
+
* input shown as JSON. Every named [`ToolKind`](agent_client_protocol::ToolKind)
|
|
3349
|
+
* has a variant here, so the fold never falls back to [`Self::Other`] for a
|
|
3350
|
+
* kind ACP defines - only for `switch_mode` (nothing a reader would want
|
|
3351
|
+
* rendered) and a kind this fold does not yet know about.
|
|
3352
|
+
*
|
|
3353
|
+
* Four variants are chosen by *name* rather than kind: Macro's own tools
|
|
3354
|
+
* ([`Self::Macro`], [`Self::View`], [`Self::UserTool`]) arrive as ACP `other`, and what a
|
|
3355
|
+
* reader wants for them is the tool's own JSON, not a generic card; a
|
|
3356
|
+
* delegation ([`Self::Subagent`]) is a tool call by whatever name its
|
|
3357
|
+
* harness gives it. The harness layer decides which names are which.
|
|
3358
|
+
*/
|
|
3359
|
+
export type ToolDetail_Serialize =
|
|
3360
|
+
/** A shell command. ACP's `execute`. */
|
|
3361
|
+
({
|
|
3362
|
+
kind: "terminal";
|
|
3363
|
+
/** The command line, when the harness reported one. */
|
|
3364
|
+
command: string | null;
|
|
3365
|
+
/** Captured output, ANSI escapes intact. See [`AnsiText`]. */
|
|
3366
|
+
output: AnsiText | null;
|
|
3367
|
+
/** Process exit code, when the harness reported one. */
|
|
3368
|
+
exitCode: number | null;
|
|
3369
|
+
}) & {
|
|
3370
|
+
acpKind?: never;
|
|
3371
|
+
agentType?: never;
|
|
3372
|
+
background?: never;
|
|
3373
|
+
children?: never;
|
|
3374
|
+
description?: never;
|
|
3375
|
+
diffs?: never;
|
|
3376
|
+
error?: never;
|
|
3377
|
+
input?: never;
|
|
3378
|
+
outcome?: never;
|
|
3379
|
+
paths?: never;
|
|
3380
|
+
prompt?: never;
|
|
3381
|
+
result?: never;
|
|
3382
|
+
title?: never;
|
|
3383
|
+
view?: never;
|
|
3384
|
+
} |
|
|
3385
|
+
/** One or more file modifications. ACP's `edit`. */
|
|
3386
|
+
({
|
|
3387
|
+
kind: "edit";
|
|
3388
|
+
/** The diffs ACP reported for this call. */
|
|
3389
|
+
diffs: FileDiff[];
|
|
3390
|
+
}) & {
|
|
3391
|
+
acpKind?: never;
|
|
3392
|
+
agentType?: never;
|
|
3393
|
+
background?: never;
|
|
3394
|
+
children?: never;
|
|
3395
|
+
command?: never;
|
|
3396
|
+
description?: never;
|
|
3397
|
+
error?: never;
|
|
3398
|
+
exitCode?: never;
|
|
3399
|
+
input?: never;
|
|
3400
|
+
outcome?: never;
|
|
3401
|
+
output?: never;
|
|
3402
|
+
paths?: never;
|
|
3403
|
+
prompt?: never;
|
|
3404
|
+
result?: never;
|
|
3405
|
+
title?: never;
|
|
3406
|
+
view?: never;
|
|
3407
|
+
} |
|
|
3408
|
+
/** A file read. ACP's `read`. */
|
|
3409
|
+
({
|
|
3410
|
+
kind: "read";
|
|
3411
|
+
/** Paths this call touched. */
|
|
3412
|
+
paths: string[];
|
|
3413
|
+
}) & {
|
|
3414
|
+
acpKind?: never;
|
|
3415
|
+
agentType?: never;
|
|
3416
|
+
background?: never;
|
|
3417
|
+
children?: never;
|
|
3418
|
+
command?: never;
|
|
3419
|
+
description?: never;
|
|
3420
|
+
diffs?: never;
|
|
3421
|
+
error?: never;
|
|
3422
|
+
exitCode?: never;
|
|
3423
|
+
input?: never;
|
|
3424
|
+
outcome?: never;
|
|
3425
|
+
output?: never;
|
|
3426
|
+
prompt?: never;
|
|
3427
|
+
result?: never;
|
|
3428
|
+
title?: never;
|
|
3429
|
+
view?: never;
|
|
3430
|
+
} |
|
|
3431
|
+
/** One or more files removed. ACP's `delete`. */
|
|
3432
|
+
({
|
|
3433
|
+
kind: "delete";
|
|
3434
|
+
/** Paths this call touched. */
|
|
3435
|
+
paths: string[];
|
|
3436
|
+
}) & {
|
|
3437
|
+
acpKind?: never;
|
|
3438
|
+
agentType?: never;
|
|
3439
|
+
background?: never;
|
|
3440
|
+
children?: never;
|
|
3441
|
+
command?: never;
|
|
3442
|
+
description?: never;
|
|
3443
|
+
diffs?: never;
|
|
3444
|
+
error?: never;
|
|
3445
|
+
exitCode?: never;
|
|
3446
|
+
input?: never;
|
|
3447
|
+
outcome?: never;
|
|
3448
|
+
output?: never;
|
|
3449
|
+
prompt?: never;
|
|
3450
|
+
result?: never;
|
|
3451
|
+
title?: never;
|
|
3452
|
+
view?: never;
|
|
3453
|
+
} |
|
|
3454
|
+
/**
|
|
3455
|
+
* One or more files moved or renamed. ACP's `move`.
|
|
3456
|
+
*
|
|
3457
|
+
* Only the paths a reader can be sure of. ACP has no standard field for
|
|
3458
|
+
* "from" versus "to" - a call's `locations` is just the set of paths it
|
|
3459
|
+
* touched - so this does not guess at a direction.
|
|
3460
|
+
*/
|
|
3461
|
+
({
|
|
3462
|
+
kind: "move";
|
|
3463
|
+
/** Paths this call touched. */
|
|
3464
|
+
paths: string[];
|
|
3465
|
+
}) & {
|
|
3466
|
+
acpKind?: never;
|
|
3467
|
+
agentType?: never;
|
|
3468
|
+
background?: never;
|
|
3469
|
+
children?: never;
|
|
3470
|
+
command?: never;
|
|
3471
|
+
description?: never;
|
|
3472
|
+
diffs?: never;
|
|
3473
|
+
error?: never;
|
|
3474
|
+
exitCode?: never;
|
|
3475
|
+
input?: never;
|
|
3476
|
+
outcome?: never;
|
|
3477
|
+
output?: never;
|
|
3478
|
+
prompt?: never;
|
|
3479
|
+
result?: never;
|
|
3480
|
+
title?: never;
|
|
3481
|
+
view?: never;
|
|
3482
|
+
} |
|
|
3483
|
+
/** A search. ACP's `search`. */
|
|
3484
|
+
({
|
|
3485
|
+
kind: "search";
|
|
3486
|
+
/** Paths this call touched. */
|
|
3487
|
+
paths: string[];
|
|
3488
|
+
/** Text the call reported - e.g. matched lines - when any. */
|
|
3489
|
+
output: string | null;
|
|
3490
|
+
}) & {
|
|
3491
|
+
acpKind?: never;
|
|
3492
|
+
agentType?: never;
|
|
3493
|
+
background?: never;
|
|
3494
|
+
children?: never;
|
|
3495
|
+
command?: never;
|
|
3496
|
+
description?: never;
|
|
3497
|
+
diffs?: never;
|
|
3498
|
+
error?: never;
|
|
3499
|
+
exitCode?: never;
|
|
3500
|
+
input?: never;
|
|
3501
|
+
outcome?: never;
|
|
3502
|
+
prompt?: never;
|
|
3503
|
+
result?: never;
|
|
3504
|
+
title?: never;
|
|
3505
|
+
view?: never;
|
|
3506
|
+
} |
|
|
3507
|
+
/** Retrieving external data. ACP's `fetch`. */
|
|
3508
|
+
({
|
|
3509
|
+
kind: "fetch";
|
|
3510
|
+
/** Text the call reported, when any. */
|
|
3511
|
+
output: string | null;
|
|
3512
|
+
}) & {
|
|
3513
|
+
acpKind?: never;
|
|
3514
|
+
agentType?: never;
|
|
3515
|
+
background?: never;
|
|
3516
|
+
children?: never;
|
|
3517
|
+
command?: never;
|
|
3518
|
+
description?: never;
|
|
3519
|
+
diffs?: never;
|
|
3520
|
+
error?: never;
|
|
3521
|
+
exitCode?: never;
|
|
3522
|
+
input?: never;
|
|
3523
|
+
outcome?: never;
|
|
3524
|
+
paths?: never;
|
|
3525
|
+
prompt?: never;
|
|
3526
|
+
result?: never;
|
|
3527
|
+
title?: never;
|
|
3528
|
+
view?: never;
|
|
3529
|
+
} |
|
|
3530
|
+
/**
|
|
3531
|
+
* Explicit reasoning surfaced as its own tool call, as distinct from
|
|
3532
|
+
* [`MessagePart::Thought`], which is reasoning streamed inline. ACP's
|
|
3533
|
+
* `think`.
|
|
3534
|
+
*/
|
|
3535
|
+
({
|
|
3536
|
+
kind: "think";
|
|
3537
|
+
/** Text the call reported, when any. */
|
|
3538
|
+
output: string | null;
|
|
3539
|
+
}) & {
|
|
3540
|
+
acpKind?: never;
|
|
3541
|
+
agentType?: never;
|
|
3542
|
+
background?: never;
|
|
3543
|
+
children?: never;
|
|
3544
|
+
command?: never;
|
|
3545
|
+
description?: never;
|
|
3546
|
+
diffs?: never;
|
|
3547
|
+
error?: never;
|
|
3548
|
+
exitCode?: never;
|
|
3549
|
+
input?: never;
|
|
3550
|
+
outcome?: never;
|
|
3551
|
+
paths?: never;
|
|
3552
|
+
prompt?: never;
|
|
3553
|
+
result?: never;
|
|
3554
|
+
title?: never;
|
|
3555
|
+
view?: never;
|
|
3556
|
+
} |
|
|
3557
|
+
/**
|
|
3558
|
+
* Anything else: ACP's `switch_mode`, a tool from an MCP server the fold
|
|
3559
|
+
* knows nothing about, and any kind - including `other` itself,
|
|
3560
|
+
* [`ToolKind`](agent_client_protocol::ToolKind)'s default for a call
|
|
3561
|
+
* that names no kind at all - this fold has no special rendering for.
|
|
3562
|
+
* What a reader wants is the exchange itself: the request the agent
|
|
3563
|
+
* made and the response it got, as JSON.
|
|
3564
|
+
*/
|
|
3565
|
+
({
|
|
3566
|
+
kind: "other";
|
|
3567
|
+
/** ACP's tool kind, as its wire string. */
|
|
3568
|
+
acpKind: string;
|
|
3569
|
+
/** Text the call reported in its content blocks, when any. */
|
|
3570
|
+
output: string | null;
|
|
3571
|
+
/**
|
|
3572
|
+
* The tool's own arguments, when reported - out of any wrapper the
|
|
3573
|
+
* harness put around them.
|
|
3574
|
+
*/
|
|
3575
|
+
input: unknown;
|
|
3576
|
+
/**
|
|
3577
|
+
* The tool's own result, when the harness reported one in
|
|
3578
|
+
* `rawOutput` - out of the harness's wrapper and MCP's envelope, so
|
|
3579
|
+
* an MCP tool's `structuredContent` (or its text, parsed when it is
|
|
3580
|
+
* JSON) arrives as the JSON the tool returned.
|
|
3581
|
+
*/
|
|
3582
|
+
result: unknown;
|
|
3583
|
+
/** The error text, when the harness's wrapper reported failure. */
|
|
3584
|
+
error: string | null;
|
|
3585
|
+
}) & {
|
|
3586
|
+
agentType?: never;
|
|
3587
|
+
background?: never;
|
|
3588
|
+
children?: never;
|
|
3589
|
+
command?: never;
|
|
3590
|
+
description?: never;
|
|
3591
|
+
diffs?: never;
|
|
3592
|
+
exitCode?: never;
|
|
3593
|
+
outcome?: never;
|
|
3594
|
+
paths?: never;
|
|
3595
|
+
prompt?: never;
|
|
3596
|
+
title?: never;
|
|
3597
|
+
view?: never;
|
|
3598
|
+
} |
|
|
3599
|
+
/**
|
|
3600
|
+
* A Macro tool the fold knows by name - reached over Macro's MCP
|
|
3601
|
+
* server, or called in-process by Macro's own agent. Input and output
|
|
3602
|
+
* are the tool's own JSON, any MCP envelope already removed, so a
|
|
3603
|
+
* reader that knows the tool renders it without parsing the wire.
|
|
3604
|
+
*/
|
|
3605
|
+
({
|
|
3606
|
+
kind: "macro";
|
|
3607
|
+
/** The tool's arguments, as it defines them. */
|
|
3608
|
+
input: unknown;
|
|
3609
|
+
/**
|
|
3610
|
+
* The tool's result, as it defines it; absent until the call
|
|
3611
|
+
* completes.
|
|
3612
|
+
*/
|
|
3613
|
+
output: unknown;
|
|
3614
|
+
/** The error text, when the call failed. */
|
|
3615
|
+
error: string | null;
|
|
3616
|
+
}) & {
|
|
3617
|
+
acpKind?: never;
|
|
3618
|
+
agentType?: never;
|
|
3619
|
+
background?: never;
|
|
3620
|
+
children?: never;
|
|
3621
|
+
command?: never;
|
|
3622
|
+
description?: never;
|
|
3623
|
+
diffs?: never;
|
|
3624
|
+
exitCode?: never;
|
|
3625
|
+
outcome?: never;
|
|
3626
|
+
paths?: never;
|
|
3627
|
+
prompt?: never;
|
|
3628
|
+
result?: never;
|
|
3629
|
+
title?: never;
|
|
3630
|
+
view?: never;
|
|
3631
|
+
} |
|
|
3632
|
+
/**
|
|
3633
|
+
* A view shown to the person: Macro's `DisplayResults`, or the call the
|
|
3634
|
+
* harness presents for `execution.views.present`. The server decodes
|
|
3635
|
+
* the view into its result, so this is the view a reader renders.
|
|
3636
|
+
*/
|
|
3637
|
+
({
|
|
3638
|
+
kind: "view";
|
|
3639
|
+
/** The view, once the call has returned one that decodes. */
|
|
3640
|
+
view: View_Serialize | null;
|
|
3641
|
+
/** The error text, when the call failed. */
|
|
3642
|
+
error: string | null;
|
|
3643
|
+
}) & {
|
|
3644
|
+
acpKind?: never;
|
|
3645
|
+
agentType?: never;
|
|
3646
|
+
background?: never;
|
|
3647
|
+
children?: never;
|
|
3648
|
+
command?: never;
|
|
3649
|
+
description?: never;
|
|
3650
|
+
diffs?: never;
|
|
3651
|
+
exitCode?: never;
|
|
3652
|
+
input?: never;
|
|
3653
|
+
outcome?: never;
|
|
3654
|
+
output?: never;
|
|
3655
|
+
paths?: never;
|
|
3656
|
+
prompt?: never;
|
|
3657
|
+
result?: never;
|
|
3658
|
+
title?: never;
|
|
3659
|
+
} |
|
|
3660
|
+
/**
|
|
3661
|
+
* A Macro user tool: the agent drafted it, the user finishes it after
|
|
3662
|
+
* the turn. See [`UserToolOutcome`].
|
|
3663
|
+
*/
|
|
3664
|
+
({
|
|
3665
|
+
kind: "user_tool";
|
|
3666
|
+
/**
|
|
3667
|
+
* The draft, as the tool defines its arguments; patched as the
|
|
3668
|
+
* user edits.
|
|
3669
|
+
*/
|
|
3670
|
+
input: unknown;
|
|
3671
|
+
/** Where the user got to with it. */
|
|
3672
|
+
outcome: UserToolOutcome;
|
|
3673
|
+
}) & {
|
|
3674
|
+
acpKind?: never;
|
|
3675
|
+
agentType?: never;
|
|
3676
|
+
background?: never;
|
|
3677
|
+
children?: never;
|
|
3678
|
+
command?: never;
|
|
3679
|
+
description?: never;
|
|
3680
|
+
diffs?: never;
|
|
3681
|
+
error?: never;
|
|
3682
|
+
exitCode?: never;
|
|
3683
|
+
output?: never;
|
|
3684
|
+
paths?: never;
|
|
3685
|
+
prompt?: never;
|
|
3686
|
+
result?: never;
|
|
3687
|
+
title?: never;
|
|
3688
|
+
view?: never;
|
|
3689
|
+
} |
|
|
3690
|
+
/**
|
|
3691
|
+
* Work the agent delegated to another agent.
|
|
3692
|
+
*
|
|
3693
|
+
* ACP has no notion of this; every harness spells it as a tool call by
|
|
3694
|
+
* its own conventions (Claude Code's `Agent`, OpenCode's and Cursor's
|
|
3695
|
+
* `task`, Codex's `spawnAgent`, Hermes's `delegate_task`), and the
|
|
3696
|
+
* harness reader recognizes it. What the subagent itself did nests in
|
|
3697
|
+
* `children` when the harness attributes its calls to the parent -
|
|
3698
|
+
* only Claude Code does today - and is otherwise summarized in
|
|
3699
|
+
* `result`.
|
|
3700
|
+
*/
|
|
3701
|
+
({
|
|
3702
|
+
kind: "subagent";
|
|
3703
|
+
/**
|
|
3704
|
+
* What to call the delegation: the harness's description when it
|
|
3705
|
+
* gave one, else the first line of the brief, else the tool's own
|
|
3706
|
+
* name. Always present, so a reader never has to pick a fallback
|
|
3707
|
+
* itself; `description` and `prompt` stay exactly what the harness
|
|
3708
|
+
* said.
|
|
3709
|
+
*/
|
|
3710
|
+
title: string;
|
|
3711
|
+
/**
|
|
3712
|
+
* Which kind of agent was delegated to (`general-purpose`,
|
|
3713
|
+
* `explore`), when the harness names one.
|
|
3714
|
+
*/
|
|
3715
|
+
agentType: string | null;
|
|
3716
|
+
/** A short description of the task, when given. */
|
|
3717
|
+
description: string | null;
|
|
3718
|
+
/** The brief the subagent was given. */
|
|
3719
|
+
prompt: string | null;
|
|
3720
|
+
/**
|
|
3721
|
+
* Whether the subagent was started in the background: its call
|
|
3722
|
+
* completes at once and its answer, if any, arrives some other way.
|
|
3723
|
+
*/
|
|
3724
|
+
background: boolean;
|
|
3725
|
+
/**
|
|
3726
|
+
* The subagent's own parts, in arrival order, for a harness that
|
|
3727
|
+
* attributes them to the parent call.
|
|
3728
|
+
*/
|
|
3729
|
+
children: MessagePart_Serialize[];
|
|
3730
|
+
/**
|
|
3731
|
+
* What the subagent reported back, once it has.
|
|
3732
|
+
*
|
|
3733
|
+
* Boxed: this is by far the widest thing a part can hold, and every
|
|
3734
|
+
* part pays for the widest variant.
|
|
3735
|
+
*/
|
|
3736
|
+
result: SubagentResult | null;
|
|
3737
|
+
}) & {
|
|
3738
|
+
acpKind?: never;
|
|
3739
|
+
command?: never;
|
|
3740
|
+
diffs?: never;
|
|
3741
|
+
error?: never;
|
|
3742
|
+
exitCode?: never;
|
|
3743
|
+
input?: never;
|
|
3744
|
+
outcome?: never;
|
|
3745
|
+
output?: never;
|
|
3746
|
+
paths?: never;
|
|
3747
|
+
view?: never;
|
|
3748
|
+
};
|
|
3749
|
+
/**
|
|
3750
|
+
* What a harness called a tool.
|
|
3751
|
+
*
|
|
3752
|
+
* ACP has no tool-name field - a call carries a human-readable `title` and a
|
|
3753
|
+
* coarse `kind`, nothing more. The name a reader wants (`Bash`, `ReadContent`)
|
|
3754
|
+
* is a harness convention: Claude Code writes it to `_meta`, others put it
|
|
3755
|
+
* in the title, and tools reached over MCP arrive namespaced as
|
|
3756
|
+
* `mcp__<server>__<tool>`. This type is the one place that namespacing is
|
|
3757
|
+
* understood, so no reader downstream ever splits a string.
|
|
3758
|
+
*
|
|
3759
|
+
* Parsing is infallible: a string that is not an MCP name is a native one,
|
|
3760
|
+
* however odd it looks. Nothing is dropped for being unrecognized.
|
|
3761
|
+
*/
|
|
3762
|
+
export type ToolName =
|
|
3763
|
+
/**
|
|
3764
|
+
* A tool the harness owns: `Bash`, `Read`, `Write`, or a Macro tool
|
|
3765
|
+
* called in-process by Macro's own agent.
|
|
3766
|
+
*/
|
|
3767
|
+
{
|
|
3768
|
+
kind: "native";
|
|
3769
|
+
/** The name as the harness reported it. */
|
|
3770
|
+
name: string;
|
|
3771
|
+
} |
|
|
3772
|
+
/**
|
|
3773
|
+
* A tool reached over MCP, from the server the harness registered it
|
|
3774
|
+
* under.
|
|
3775
|
+
*/
|
|
3776
|
+
{
|
|
3777
|
+
kind: "mcp";
|
|
3778
|
+
/** The MCP server's name, as the harness registered it. */
|
|
3779
|
+
server: string;
|
|
3780
|
+
/** The tool's name on that server. */
|
|
3781
|
+
tool: string;
|
|
3782
|
+
};
|
|
3783
|
+
/**
|
|
3784
|
+
* A subagent's tool use, by kind. Claude Code's `toolStats`, in the fold's
|
|
3785
|
+
* vocabulary.
|
|
3786
|
+
*/
|
|
3787
|
+
export type ToolStats = {
|
|
3788
|
+
/** Files read. */
|
|
3789
|
+
reads: number;
|
|
3790
|
+
/** Searches run. */
|
|
3791
|
+
searches: number;
|
|
3792
|
+
/** Shell commands run. */
|
|
3793
|
+
commands: number;
|
|
3794
|
+
/** Files edited. */
|
|
3795
|
+
edits: number;
|
|
3796
|
+
/** Lines added across those edits. */
|
|
3797
|
+
linesAdded: number;
|
|
3798
|
+
/** Lines removed across those edits. */
|
|
3799
|
+
linesRemoved: number;
|
|
3800
|
+
/** Anything else. */
|
|
3801
|
+
other: number;
|
|
3802
|
+
};
|
|
3803
|
+
/**
|
|
3804
|
+
* How far a tool call progressed.
|
|
3805
|
+
*
|
|
3806
|
+
* [`ToolStatus::Pending`] and [`ToolStatus::Running`] are legitimate final
|
|
3807
|
+
* states, not errors: a live session's newest calls have not finished, and a
|
|
3808
|
+
* session that dies mid-call leaves one behind permanently.
|
|
3809
|
+
*/
|
|
3810
|
+
export type ToolStatus =
|
|
3811
|
+
/** Not started - either still streaming input or awaiting permission. */
|
|
3812
|
+
"pending" |
|
|
3813
|
+
/** Currently running. */
|
|
3814
|
+
"running" |
|
|
3815
|
+
/** Finished successfully. */
|
|
3816
|
+
"completed" |
|
|
3817
|
+
/** Finished unsuccessfully. */
|
|
3818
|
+
"failed";
|
|
3819
|
+
/** A tool call within a turn, identified by its ACP `toolCallId`. */
|
|
3820
|
+
export type ToolUseId = string;
|
|
3821
|
+
/** What the agent is doing right now, as a typing indicator says it. */
|
|
3822
|
+
export type TurnPhase =
|
|
3823
|
+
/** Nothing to show yet, or between steps. */
|
|
3824
|
+
"thinking" |
|
|
3825
|
+
/** Writing prose. */
|
|
3826
|
+
"writing" |
|
|
3827
|
+
/** Running a tool. */
|
|
3828
|
+
"working" |
|
|
3829
|
+
/** Waiting on the user to answer a permission or a question. */
|
|
3830
|
+
"waiting";
|
|
3831
|
+
/** Where the newest turn stands. */
|
|
3832
|
+
export type TurnState =
|
|
3833
|
+
/** No turn is open. */
|
|
3834
|
+
"idle" |
|
|
3835
|
+
/** No turn is open, and the newest agent reply failed. */
|
|
3836
|
+
"failed" |
|
|
3837
|
+
/**
|
|
3838
|
+
* A prompt this client issued is on the wire, unconfirmed, and the agent
|
|
3839
|
+
* has produced nothing. Only a speculative fold reports this.
|
|
3840
|
+
*/
|
|
3841
|
+
"starting" |
|
|
3842
|
+
/** A turn is open and the agent is working. */
|
|
3843
|
+
"running" |
|
|
3844
|
+
/** A stop was issued against the open turn and no stop reason has arrived. */
|
|
3845
|
+
"stopping" |
|
|
3846
|
+
/**
|
|
3847
|
+
* The open turn is waiting on a permission, elicitation, or tool
|
|
3848
|
+
* approval response.
|
|
3849
|
+
*/
|
|
3850
|
+
"blocked" |
|
|
3851
|
+
/** The runtime reported `disconnected`; whatever was open is not moving. */
|
|
3852
|
+
"disconnected";
|
|
3853
|
+
/**
|
|
3854
|
+
* How far a user tool has got - the fold's reading of the backend's
|
|
3855
|
+
* `UserToolResponse`, restated each time the call is patched.
|
|
3856
|
+
*
|
|
3857
|
+
* A user tool's call completes, from ACP's point of view, the moment the
|
|
3858
|
+
* agent invokes it: the backend answers `"PendingUserExecution"` and does
|
|
3859
|
+
* nothing. What happens next - the user editing, sending, or rejecting the
|
|
3860
|
+
* draft - reaches the log as later patches to the same call, so
|
|
3861
|
+
* [`Self::Pending`] is where every user tool starts and where one the user
|
|
3862
|
+
* never touched stays.
|
|
3863
|
+
*/
|
|
3864
|
+
export type UserToolOutcome =
|
|
3865
|
+
/** Awaiting the user. The draft is whatever the input currently holds. */
|
|
3866
|
+
{
|
|
3867
|
+
kind: "pending";
|
|
3868
|
+
} |
|
|
3869
|
+
/**
|
|
3870
|
+
* The user edited the draft without finishing it; the input holds
|
|
3871
|
+
* their edits.
|
|
3872
|
+
*/
|
|
3873
|
+
{
|
|
3874
|
+
kind: "edited";
|
|
3875
|
+
} |
|
|
3876
|
+
/** `SendEmail`: the email went out. */
|
|
3877
|
+
{
|
|
3878
|
+
kind: "sent";
|
|
3879
|
+
/** The sent message's id. */
|
|
3880
|
+
messageId: string;
|
|
3881
|
+
/** The thread the message landed in. */
|
|
3882
|
+
threadId: string;
|
|
3883
|
+
} |
|
|
3884
|
+
/** `SendEmail`: the user saved the draft instead of sending it. */
|
|
3885
|
+
{
|
|
3886
|
+
kind: "draft";
|
|
3887
|
+
/** The saved draft's id. */
|
|
3888
|
+
draftId: string;
|
|
3889
|
+
/** The thread the draft belongs to, when it is a reply. */
|
|
3890
|
+
threadId: string | null;
|
|
3891
|
+
} |
|
|
3892
|
+
/**
|
|
3893
|
+
* The user executed the tool; this is what the tool returned. The shape
|
|
3894
|
+
* is the tool's own - a calendar event for `CreateCalendarEvent`.
|
|
3895
|
+
*/
|
|
3896
|
+
{
|
|
3897
|
+
kind: "completed";
|
|
3898
|
+
/** The tool's result, verbatim. */
|
|
3899
|
+
result: unknown;
|
|
3900
|
+
} |
|
|
3901
|
+
/** The user declined. */
|
|
3902
|
+
{
|
|
3903
|
+
kind: "rejected";
|
|
3904
|
+
} |
|
|
3905
|
+
/** The call itself failed before the user could act. */
|
|
3906
|
+
{
|
|
3907
|
+
kind: "failed";
|
|
3908
|
+
/** The error, as reported. */
|
|
3909
|
+
message: string;
|
|
3910
|
+
} |
|
|
3911
|
+
/**
|
|
3912
|
+
* A result arrived that this fold could not read as a user tool
|
|
3913
|
+
* response - a shape the backend added after this was written.
|
|
3914
|
+
*/
|
|
3915
|
+
{
|
|
3916
|
+
kind: "unrecognized";
|
|
3917
|
+
};
|
|
3918
|
+
/** A top-level composed view: a flex column of widgets. */
|
|
3919
|
+
export type View = View_Serialize | View_Deserialize;
|
|
3920
|
+
/** A top-level composed view: a flex column of widgets. */
|
|
3921
|
+
export type View_Deserialize = {
|
|
3922
|
+
title?: string;
|
|
3923
|
+
widgets: Widget_Deserialize[];
|
|
3924
|
+
};
|
|
3925
|
+
/** A top-level composed view: a flex column of widgets. */
|
|
3926
|
+
export type View_Serialize = {
|
|
3927
|
+
title?: string;
|
|
3928
|
+
widgets: Widget_Serialize[];
|
|
3929
|
+
};
|
|
3930
|
+
/**
|
|
3931
|
+
* One block of a view. Layout is order-driven; nesting is achieved with the
|
|
3932
|
+
* `container` widget.
|
|
3933
|
+
*/
|
|
3934
|
+
export type Widget = Widget_Serialize | Widget_Deserialize;
|
|
3935
|
+
/**
|
|
3936
|
+
* One block of a view. Layout is order-driven; nesting is achieved with the
|
|
3937
|
+
* `container` widget.
|
|
3938
|
+
*/
|
|
3939
|
+
export type Widget_Deserialize =
|
|
3940
|
+
/**
|
|
3941
|
+
* Markdown text: the narrative between the other widgets. Its type is
|
|
3942
|
+
* "md", never "markdown".
|
|
3943
|
+
*/
|
|
3944
|
+
({
|
|
3945
|
+
type: "md";
|
|
3946
|
+
markdown: string;
|
|
3947
|
+
}) & {
|
|
3948
|
+
align?: never;
|
|
3949
|
+
channelId?: never;
|
|
3950
|
+
children?: never;
|
|
3951
|
+
direction?: never;
|
|
3952
|
+
events?: never;
|
|
3953
|
+
gap?: never;
|
|
3954
|
+
groupBy?: never;
|
|
3955
|
+
items?: never;
|
|
3956
|
+
justify?: never;
|
|
3957
|
+
limit?: never;
|
|
3958
|
+
messageId?: never;
|
|
3959
|
+
source?: never;
|
|
3960
|
+
tags?: never;
|
|
3961
|
+
title?: never;
|
|
3962
|
+
wrap?: never;
|
|
3963
|
+
} |
|
|
3964
|
+
/** A chronological sequence of events. Great for "what happened" answers. */
|
|
3965
|
+
({
|
|
3966
|
+
type: "timeline";
|
|
3967
|
+
title?: string;
|
|
3968
|
+
events: TimelineEvent_Deserialize[];
|
|
3969
|
+
}) & {
|
|
3970
|
+
align?: never;
|
|
3971
|
+
channelId?: never;
|
|
3972
|
+
children?: never;
|
|
3973
|
+
direction?: never;
|
|
3974
|
+
gap?: never;
|
|
3975
|
+
groupBy?: never;
|
|
3976
|
+
items?: never;
|
|
3977
|
+
justify?: never;
|
|
3978
|
+
limit?: never;
|
|
3979
|
+
markdown?: never;
|
|
3980
|
+
messageId?: never;
|
|
3981
|
+
source?: never;
|
|
3982
|
+
tags?: never;
|
|
3983
|
+
wrap?: never;
|
|
3984
|
+
} |
|
|
3985
|
+
/**
|
|
3986
|
+
* A list of workspace items, fetched by a filter query or given as a
|
|
3987
|
+
* fixed set of entity references.
|
|
3988
|
+
*/
|
|
3989
|
+
({
|
|
3990
|
+
type: "list";
|
|
3991
|
+
title?: string;
|
|
3992
|
+
source: ListSource_Deserialize;
|
|
3993
|
+
/** Group rows by a facet. */
|
|
3994
|
+
groupBy?: GroupBy;
|
|
3995
|
+
/** Cap the number of rows shown. */
|
|
3996
|
+
limit?: number;
|
|
3997
|
+
}) & {
|
|
3998
|
+
align?: never;
|
|
3999
|
+
channelId?: never;
|
|
4000
|
+
children?: never;
|
|
4001
|
+
direction?: never;
|
|
4002
|
+
events?: never;
|
|
4003
|
+
gap?: never;
|
|
4004
|
+
items?: never;
|
|
4005
|
+
justify?: never;
|
|
4006
|
+
markdown?: never;
|
|
4007
|
+
messageId?: never;
|
|
4008
|
+
tags?: never;
|
|
4009
|
+
wrap?: never;
|
|
4010
|
+
} |
|
|
4011
|
+
/** A single channel message with surrounding context. */
|
|
4012
|
+
({
|
|
4013
|
+
type: "channelMessage";
|
|
4014
|
+
/** The channel the message belongs to. */
|
|
4015
|
+
channelId: string;
|
|
4016
|
+
/** The message to render. */
|
|
4017
|
+
messageId: string;
|
|
4018
|
+
}) & {
|
|
4019
|
+
align?: never;
|
|
4020
|
+
children?: never;
|
|
4021
|
+
direction?: never;
|
|
4022
|
+
events?: never;
|
|
4023
|
+
gap?: never;
|
|
4024
|
+
groupBy?: never;
|
|
4025
|
+
items?: never;
|
|
4026
|
+
justify?: never;
|
|
4027
|
+
limit?: never;
|
|
4028
|
+
markdown?: never;
|
|
4029
|
+
source?: never;
|
|
4030
|
+
tags?: never;
|
|
4031
|
+
title?: never;
|
|
4032
|
+
wrap?: never;
|
|
4033
|
+
} |
|
|
4034
|
+
/**
|
|
4035
|
+
* A calendar agenda: the events grouped by day with their times, places
|
|
4036
|
+
* and attendees, loaded live from the user's calendars. Use it whenever
|
|
4037
|
+
* an answer is about calendar events instead of listing them in text.
|
|
4038
|
+
*/
|
|
4039
|
+
({
|
|
4040
|
+
type: "events";
|
|
4041
|
+
title?: string;
|
|
4042
|
+
events: AgendaEvent_Deserialize[];
|
|
4043
|
+
}) & {
|
|
4044
|
+
align?: never;
|
|
4045
|
+
channelId?: never;
|
|
4046
|
+
children?: never;
|
|
4047
|
+
direction?: never;
|
|
4048
|
+
gap?: never;
|
|
4049
|
+
groupBy?: never;
|
|
4050
|
+
items?: never;
|
|
4051
|
+
justify?: never;
|
|
4052
|
+
limit?: never;
|
|
4053
|
+
markdown?: never;
|
|
4054
|
+
messageId?: never;
|
|
4055
|
+
source?: never;
|
|
4056
|
+
tags?: never;
|
|
4057
|
+
wrap?: never;
|
|
4058
|
+
} |
|
|
4059
|
+
/**
|
|
4060
|
+
* Rich cards for the one to four specific items the answer is about: a
|
|
4061
|
+
* document or spreadsheet, an email thread, a calendar event, a project,
|
|
4062
|
+
* a channel, a routine, a form or an initiative. Each card opens its
|
|
4063
|
+
* item, and a routine's card can pause it or run it now. Use a list
|
|
4064
|
+
* widget for longer sets.
|
|
4065
|
+
*/
|
|
4066
|
+
({
|
|
4067
|
+
type: "cards";
|
|
4068
|
+
title?: string;
|
|
4069
|
+
items: CardItem[];
|
|
4070
|
+
}) & {
|
|
4071
|
+
align?: never;
|
|
4072
|
+
channelId?: never;
|
|
4073
|
+
children?: never;
|
|
4074
|
+
direction?: never;
|
|
4075
|
+
events?: never;
|
|
4076
|
+
gap?: never;
|
|
4077
|
+
groupBy?: never;
|
|
4078
|
+
justify?: never;
|
|
4079
|
+
limit?: never;
|
|
4080
|
+
markdown?: never;
|
|
4081
|
+
messageId?: never;
|
|
4082
|
+
source?: never;
|
|
4083
|
+
tags?: never;
|
|
4084
|
+
wrap?: never;
|
|
4085
|
+
} |
|
|
4086
|
+
/**
|
|
4087
|
+
* Tags as coloured pills, nested to any depth: the user's tags, a
|
|
4088
|
+
* taxonomy the answer proposes, or any other ontology of tags, each with
|
|
4089
|
+
* what it is for. Use it whenever an answer is about tags, instead of a
|
|
4090
|
+
* table or a list in markdown.
|
|
4091
|
+
*/
|
|
4092
|
+
({
|
|
4093
|
+
type: "tags";
|
|
4094
|
+
title?: string;
|
|
4095
|
+
tags: TagNode_Deserialize[];
|
|
4096
|
+
}) & {
|
|
4097
|
+
align?: never;
|
|
4098
|
+
channelId?: never;
|
|
4099
|
+
children?: never;
|
|
4100
|
+
direction?: never;
|
|
4101
|
+
events?: never;
|
|
4102
|
+
gap?: never;
|
|
4103
|
+
groupBy?: never;
|
|
4104
|
+
items?: never;
|
|
4105
|
+
justify?: never;
|
|
4106
|
+
limit?: never;
|
|
4107
|
+
markdown?: never;
|
|
4108
|
+
messageId?: never;
|
|
4109
|
+
source?: never;
|
|
4110
|
+
wrap?: never;
|
|
4111
|
+
} |
|
|
4112
|
+
/** A nestable flex container of widgets. */
|
|
4113
|
+
({
|
|
4114
|
+
type: "container";
|
|
4115
|
+
direction?: Direction;
|
|
4116
|
+
/** Tailwind-ish gap step, 0-8. Defaults to 3. */
|
|
4117
|
+
gap?: Gap;
|
|
4118
|
+
wrap?: boolean;
|
|
4119
|
+
align?: Align;
|
|
4120
|
+
justify?: Justify;
|
|
4121
|
+
title?: string;
|
|
4122
|
+
children: Widget_Deserialize[];
|
|
4123
|
+
}) & {
|
|
4124
|
+
channelId?: never;
|
|
4125
|
+
events?: never;
|
|
4126
|
+
groupBy?: never;
|
|
4127
|
+
items?: never;
|
|
4128
|
+
limit?: never;
|
|
4129
|
+
markdown?: never;
|
|
4130
|
+
messageId?: never;
|
|
4131
|
+
source?: never;
|
|
4132
|
+
tags?: never;
|
|
4133
|
+
};
|
|
4134
|
+
/**
|
|
4135
|
+
* One block of a view. Layout is order-driven; nesting is achieved with the
|
|
4136
|
+
* `container` widget.
|
|
4137
|
+
*/
|
|
4138
|
+
export type Widget_Serialize =
|
|
4139
|
+
/**
|
|
4140
|
+
* Markdown text: the narrative between the other widgets. Its type is
|
|
4141
|
+
* "md", never "markdown".
|
|
4142
|
+
*/
|
|
4143
|
+
({
|
|
4144
|
+
type: "md";
|
|
4145
|
+
markdown: string;
|
|
4146
|
+
}) & {
|
|
4147
|
+
align?: never;
|
|
4148
|
+
channelId?: never;
|
|
4149
|
+
children?: never;
|
|
4150
|
+
direction?: never;
|
|
4151
|
+
events?: never;
|
|
4152
|
+
gap?: never;
|
|
4153
|
+
groupBy?: never;
|
|
4154
|
+
items?: never;
|
|
4155
|
+
justify?: never;
|
|
4156
|
+
limit?: never;
|
|
4157
|
+
messageId?: never;
|
|
4158
|
+
source?: never;
|
|
4159
|
+
tags?: never;
|
|
4160
|
+
title?: never;
|
|
4161
|
+
wrap?: never;
|
|
4162
|
+
} |
|
|
4163
|
+
/** A chronological sequence of events. Great for "what happened" answers. */
|
|
4164
|
+
({
|
|
4165
|
+
type: "timeline";
|
|
4166
|
+
title?: string;
|
|
4167
|
+
events: TimelineEvent_Serialize[];
|
|
4168
|
+
}) & {
|
|
4169
|
+
align?: never;
|
|
4170
|
+
channelId?: never;
|
|
4171
|
+
children?: never;
|
|
4172
|
+
direction?: never;
|
|
4173
|
+
gap?: never;
|
|
4174
|
+
groupBy?: never;
|
|
4175
|
+
items?: never;
|
|
4176
|
+
justify?: never;
|
|
4177
|
+
limit?: never;
|
|
4178
|
+
markdown?: never;
|
|
4179
|
+
messageId?: never;
|
|
4180
|
+
source?: never;
|
|
4181
|
+
tags?: never;
|
|
4182
|
+
wrap?: never;
|
|
4183
|
+
} |
|
|
4184
|
+
/**
|
|
4185
|
+
* A list of workspace items, fetched by a filter query or given as a
|
|
4186
|
+
* fixed set of entity references.
|
|
4187
|
+
*/
|
|
4188
|
+
({
|
|
4189
|
+
type: "list";
|
|
4190
|
+
title?: string;
|
|
4191
|
+
source: ListSource_Serialize;
|
|
4192
|
+
/** Group rows by a facet. */
|
|
4193
|
+
groupBy?: GroupBy;
|
|
4194
|
+
/** Cap the number of rows shown. */
|
|
4195
|
+
limit?: number;
|
|
4196
|
+
}) & {
|
|
4197
|
+
align?: never;
|
|
4198
|
+
channelId?: never;
|
|
4199
|
+
children?: never;
|
|
4200
|
+
direction?: never;
|
|
4201
|
+
events?: never;
|
|
4202
|
+
gap?: never;
|
|
4203
|
+
items?: never;
|
|
4204
|
+
justify?: never;
|
|
4205
|
+
markdown?: never;
|
|
4206
|
+
messageId?: never;
|
|
4207
|
+
tags?: never;
|
|
4208
|
+
wrap?: never;
|
|
4209
|
+
} |
|
|
4210
|
+
/** A single channel message with surrounding context. */
|
|
4211
|
+
({
|
|
4212
|
+
type: "channelMessage";
|
|
4213
|
+
/** The channel the message belongs to. */
|
|
4214
|
+
channelId: string;
|
|
4215
|
+
/** The message to render. */
|
|
4216
|
+
messageId: string;
|
|
4217
|
+
}) & {
|
|
4218
|
+
align?: never;
|
|
4219
|
+
children?: never;
|
|
4220
|
+
direction?: never;
|
|
4221
|
+
events?: never;
|
|
4222
|
+
gap?: never;
|
|
4223
|
+
groupBy?: never;
|
|
4224
|
+
items?: never;
|
|
4225
|
+
justify?: never;
|
|
4226
|
+
limit?: never;
|
|
4227
|
+
markdown?: never;
|
|
4228
|
+
source?: never;
|
|
4229
|
+
tags?: never;
|
|
4230
|
+
title?: never;
|
|
4231
|
+
wrap?: never;
|
|
4232
|
+
} |
|
|
4233
|
+
/**
|
|
4234
|
+
* A calendar agenda: the events grouped by day with their times, places
|
|
4235
|
+
* and attendees, loaded live from the user's calendars. Use it whenever
|
|
4236
|
+
* an answer is about calendar events instead of listing them in text.
|
|
4237
|
+
*/
|
|
4238
|
+
({
|
|
4239
|
+
type: "events";
|
|
4240
|
+
title?: string;
|
|
4241
|
+
events: AgendaEvent_Serialize[];
|
|
4242
|
+
}) & {
|
|
4243
|
+
align?: never;
|
|
4244
|
+
channelId?: never;
|
|
4245
|
+
children?: never;
|
|
4246
|
+
direction?: never;
|
|
4247
|
+
gap?: never;
|
|
4248
|
+
groupBy?: never;
|
|
4249
|
+
items?: never;
|
|
4250
|
+
justify?: never;
|
|
4251
|
+
limit?: never;
|
|
4252
|
+
markdown?: never;
|
|
4253
|
+
messageId?: never;
|
|
4254
|
+
source?: never;
|
|
4255
|
+
tags?: never;
|
|
4256
|
+
wrap?: never;
|
|
4257
|
+
} |
|
|
4258
|
+
/**
|
|
4259
|
+
* Rich cards for the one to four specific items the answer is about: a
|
|
4260
|
+
* document or spreadsheet, an email thread, a calendar event, a project,
|
|
4261
|
+
* a channel, a routine, a form or an initiative. Each card opens its
|
|
4262
|
+
* item, and a routine's card can pause it or run it now. Use a list
|
|
4263
|
+
* widget for longer sets.
|
|
4264
|
+
*/
|
|
4265
|
+
({
|
|
4266
|
+
type: "cards";
|
|
4267
|
+
title?: string;
|
|
4268
|
+
items: CardItem[];
|
|
4269
|
+
}) & {
|
|
4270
|
+
align?: never;
|
|
4271
|
+
channelId?: never;
|
|
4272
|
+
children?: never;
|
|
4273
|
+
direction?: never;
|
|
4274
|
+
events?: never;
|
|
4275
|
+
gap?: never;
|
|
4276
|
+
groupBy?: never;
|
|
4277
|
+
justify?: never;
|
|
4278
|
+
limit?: never;
|
|
4279
|
+
markdown?: never;
|
|
4280
|
+
messageId?: never;
|
|
4281
|
+
source?: never;
|
|
4282
|
+
tags?: never;
|
|
4283
|
+
wrap?: never;
|
|
4284
|
+
} |
|
|
4285
|
+
/**
|
|
4286
|
+
* Tags as coloured pills, nested to any depth: the user's tags, a
|
|
4287
|
+
* taxonomy the answer proposes, or any other ontology of tags, each with
|
|
4288
|
+
* what it is for. Use it whenever an answer is about tags, instead of a
|
|
4289
|
+
* table or a list in markdown.
|
|
4290
|
+
*/
|
|
4291
|
+
({
|
|
4292
|
+
type: "tags";
|
|
4293
|
+
title?: string;
|
|
4294
|
+
tags: TagNode_Serialize[];
|
|
4295
|
+
}) & {
|
|
4296
|
+
align?: never;
|
|
4297
|
+
channelId?: never;
|
|
4298
|
+
children?: never;
|
|
4299
|
+
direction?: never;
|
|
4300
|
+
events?: never;
|
|
4301
|
+
gap?: never;
|
|
4302
|
+
groupBy?: never;
|
|
4303
|
+
items?: never;
|
|
4304
|
+
justify?: never;
|
|
4305
|
+
limit?: never;
|
|
4306
|
+
markdown?: never;
|
|
4307
|
+
messageId?: never;
|
|
4308
|
+
source?: never;
|
|
4309
|
+
wrap?: never;
|
|
4310
|
+
} |
|
|
4311
|
+
/** A nestable flex container of widgets. */
|
|
4312
|
+
({
|
|
4313
|
+
type: "container";
|
|
4314
|
+
direction?: Direction;
|
|
4315
|
+
/** Tailwind-ish gap step, 0-8. Defaults to 3. */
|
|
4316
|
+
gap?: Gap;
|
|
4317
|
+
wrap?: boolean;
|
|
4318
|
+
align?: Align;
|
|
4319
|
+
justify?: Justify;
|
|
4320
|
+
title?: string;
|
|
4321
|
+
children: Widget_Serialize[];
|
|
4322
|
+
}) & {
|
|
4323
|
+
channelId?: never;
|
|
4324
|
+
events?: never;
|
|
4325
|
+
groupBy?: never;
|
|
4326
|
+
items?: never;
|
|
4327
|
+
limit?: never;
|
|
4328
|
+
markdown?: never;
|
|
4329
|
+
messageId?: never;
|
|
4330
|
+
source?: never;
|
|
4331
|
+
tags?: never;
|
|
4332
|
+
};
|