@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/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;
package/dist/index.d.ts CHANGED
@@ -3,4 +3,5 @@ export type * from './dto.js';
3
3
  export type * from './events.js';
4
4
  export type * from './connection.js';
5
5
  export type * from './session.js';
6
+ export type * from './schedule.js';
6
7
  export type * from './rpc.js';