@anhlp/alp-protocol 0.0.1-beta.3 → 0.0.1-beta.4
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/conformance/cases.json +1 -1
- package/dist/connection.d.ts +4 -0
- package/dist/contract-v1.d.ts +4867 -1197
- package/dist/contract-v1.js +1 -1
- package/dist/events.d.ts +41 -0
- package/dist/index.d.ts +1 -0
- package/dist/rpc.d.ts +651 -11
- package/dist/schedule.d.ts +43 -0
- package/dist/schedule.js +0 -0
- package/dist/session.d.ts +142 -2
- package/dist/wire.d.ts +112 -0
- package/dist/wire.js +78 -3
- package/fixtures/v1/cases.json +3247 -0
- package/package.json +1 -1
- package/schema/ipc-v1.json +953 -17
- package/schema/methods-v1.json +4854 -933
- package/src/connection.ts +4 -0
- package/src/contract-v1.js +1 -1
- package/src/events.ts +28 -2
- package/src/index.ts +1 -0
- package/src/rpc.ts +171 -12
- package/src/schedule.ts +43 -0
- package/src/session.ts +120 -4
- package/src/wire.js +128 -2
package/dist/events.d.ts
CHANGED
|
@@ -11,6 +11,15 @@ export type TimelineItem = {
|
|
|
11
11
|
text: string;
|
|
12
12
|
clientMessageId?: string; /** How many images the message carried; their data is not replayed. */
|
|
13
13
|
images?: number;
|
|
14
|
+
/** Files attached to the message (capability `attachments`, §12.6): ids, display names, types and sizes, never a host path. */
|
|
15
|
+
attachments?: Array<{
|
|
16
|
+
attachmentId: string;
|
|
17
|
+
name: string;
|
|
18
|
+
mimeType: string;
|
|
19
|
+
size: number;
|
|
20
|
+
}>;
|
|
21
|
+
/** Who wrote it: the user, or ALP itself (mail, a brief, a resume); absent when the runtime cannot tell. Only the user's words name a root (ALPD §15). */
|
|
22
|
+
origin?: TurnOrigin;
|
|
14
23
|
} | {
|
|
15
24
|
kind: 'assistant_message';
|
|
16
25
|
id: string;
|
|
@@ -164,6 +173,11 @@ export type SessionSnapshot = {
|
|
|
164
173
|
instructionsSha?: string;
|
|
165
174
|
/** The session's runtime takes images in session.prompt (capability `prompt.images`); absent means it does not. */
|
|
166
175
|
promptImages?: boolean;
|
|
176
|
+
/**
|
|
177
|
+
* How the session's runtime can use files attached in session.prompt (§12.6): `file.path` (its tools
|
|
178
|
+
* read a staged read-only copy), `document.native`, `text.extract`. Absent: it takes no attachment parts.
|
|
179
|
+
*/
|
|
180
|
+
promptAttachments?: Array<'file.path' | 'document.native' | 'text.extract'>;
|
|
167
181
|
/** The latest usage the session's runtime reported (ALPD §57); absent before its first report. */
|
|
168
182
|
usage?: SessionUsage;
|
|
169
183
|
};
|
|
@@ -181,6 +195,17 @@ export type AssignmentSnapshot = {
|
|
|
181
195
|
};
|
|
182
196
|
/** runtime: a turn the native runtime started by itself, such as Claude after a background task ended. */
|
|
183
197
|
export type TurnOrigin = 'user' | 'wake' | 'assignment' | 'runtime';
|
|
198
|
+
/**
|
|
199
|
+
* A root's turn that ended while nobody looked (Paseo's attention): `finished` for a completed turn,
|
|
200
|
+
* `error` for a failed one. alpd keeps it for every client until one acknowledges it or the root
|
|
201
|
+
* starts another turn (docs/protocol/alp-json-rpc-v1.md §12.2).
|
|
202
|
+
*/
|
|
203
|
+
export type TurnAttention = {
|
|
204
|
+
reason: 'finished' | 'error';
|
|
205
|
+
at: string;
|
|
206
|
+
turnId?: string;
|
|
207
|
+
message?: string;
|
|
208
|
+
};
|
|
184
209
|
/** A question an agent asked the user with alp_ask to: "user". */
|
|
185
210
|
export type UserQuestion = {
|
|
186
211
|
id: string;
|
|
@@ -295,6 +320,22 @@ export type AlpEvent = {
|
|
|
295
320
|
type: 'unpin';
|
|
296
321
|
pinId: string;
|
|
297
322
|
reason: 'unpinned' | 'session_ended';
|
|
323
|
+
}
|
|
324
|
+
/** A root's attention set, or cleared when absent: sent only to `question.watch { attention: true }` connections, never kept. */
|
|
325
|
+
| {
|
|
326
|
+
type: 'attention';
|
|
327
|
+
attention?: TurnAttention;
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* The root's conversation was rewound (capability `session.rewind`, §12.7): history pages and cursors of
|
|
331
|
+
* the earlier generation are stale. Sent to attached connections only, never kept: drop the cached
|
|
332
|
+
* history, fetch a new tail and attach again with this generation.
|
|
333
|
+
*/
|
|
334
|
+
| {
|
|
335
|
+
type: 'history.reset';
|
|
336
|
+
generation: string;
|
|
337
|
+
reason: 'rewind';
|
|
338
|
+
branchId: string;
|
|
298
339
|
};
|
|
299
340
|
export type Envelope = {
|
|
300
341
|
sessionId: string;
|