@anhlp/alp-protocol 0.0.1-beta.3 → 0.0.1-beta.5

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/dto.d.ts CHANGED
@@ -50,7 +50,12 @@ export type TaskRow = {
50
50
  waits?: string[];
51
51
  approvals?: Array<{
52
52
  gate: string;
53
- note: string;
53
+ note: string; /** Answers to pick from; any approves. */
54
+ options?: string[]; /** The user's latest rejection; the gate stays open. */
55
+ rejected?: {
56
+ at: string;
57
+ reason?: string;
58
+ };
54
59
  }>;
55
60
  handoff?: {
56
61
  outcome: string;
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;
@@ -190,6 +215,12 @@ export type UserQuestion = {
190
215
  body: string;
191
216
  options?: string[];
192
217
  askedAt: string;
218
+ /** A card that mirrors an open human gate of the project's tasks: choosing an option approves it, dismissing rejects it. It has no timeout. */
219
+ gate?: {
220
+ projectRoot: string;
221
+ taskId: string;
222
+ gateId: string;
223
+ };
193
224
  };
194
225
  export type SessionState = 'running' | 'waiting' | 'waiting_parent' | 'waiting_user' | 'idle';
195
226
  /** A live tree at one moment, for dashboards (plans/reference/ALPD.md §17). */
@@ -295,6 +326,22 @@ export type AlpEvent = {
295
326
  type: 'unpin';
296
327
  pinId: string;
297
328
  reason: 'unpinned' | 'session_ended';
329
+ }
330
+ /** A root's attention set, or cleared when absent: sent only to `question.watch { attention: true }` connections, never kept. */
331
+ | {
332
+ type: 'attention';
333
+ attention?: TurnAttention;
334
+ }
335
+ /**
336
+ * The root's conversation was rewound (capability `session.rewind`, §12.7): history pages and cursors of
337
+ * the earlier generation are stale. Sent to attached connections only, never kept: drop the cached
338
+ * history, fetch a new tail and attach again with this generation.
339
+ */
340
+ | {
341
+ type: 'history.reset';
342
+ generation: string;
343
+ reason: 'rewind';
344
+ branchId: string;
298
345
  };
299
346
  export type Envelope = {
300
347
  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';