@coltonkirsten/a12s 0.11.1 → 0.12.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/dist/src/client.js +3 -0
- package/dist/src/types.d.ts +13 -2
- package/package.json +1 -1
package/dist/src/client.js
CHANGED
|
@@ -698,6 +698,9 @@ class TurnBuilder {
|
|
|
698
698
|
t.startedAt = ev.ts;
|
|
699
699
|
t.reason = ev.data.reason;
|
|
700
700
|
return undefined;
|
|
701
|
+
case "turn.steered":
|
|
702
|
+
t.messages = [...t.messages, ...(ev.data.inbox?.messages ?? []).map((m) => ({ ...m, steered: true }))];
|
|
703
|
+
return undefined;
|
|
701
704
|
case "tool.started":
|
|
702
705
|
t.afterTool = true;
|
|
703
706
|
t.tools.set(ev.data.id, { id: ev.data.id, name: ev.data.name, input: ev.data.input, isError: false });
|
package/dist/src/types.d.ts
CHANGED
|
@@ -225,6 +225,8 @@ export interface BackgroundTask {
|
|
|
225
225
|
description: string;
|
|
226
226
|
startedAt: string;
|
|
227
227
|
deadline: string;
|
|
228
|
+
/** The tool call that started the task, as on its `task.started`; a detached process has none. */
|
|
229
|
+
toolUseId?: string;
|
|
228
230
|
}
|
|
229
231
|
export interface DriveRow {
|
|
230
232
|
name: string;
|
|
@@ -344,7 +346,7 @@ type Ev<T extends string, D> = Omit<EventEnvelope, "type" | "data"> & {
|
|
|
344
346
|
type: T;
|
|
345
347
|
data: D;
|
|
346
348
|
};
|
|
347
|
-
/** One Message a Turn carries, as listed in its `turn.started` event. */
|
|
349
|
+
/** One Message a Turn carries, as listed in its `turn.started` or `turn.steered` event. */
|
|
348
350
|
export interface TurnInboxMessage {
|
|
349
351
|
id: string;
|
|
350
352
|
seq: number;
|
|
@@ -356,12 +358,19 @@ export interface TurnInboxMessage {
|
|
|
356
358
|
bytes: number;
|
|
357
359
|
key?: string;
|
|
358
360
|
superseded?: number;
|
|
361
|
+
/** In a finished Turn: the Message joined the Turn while it ran (`inbox.duringTurn: steer`). */
|
|
362
|
+
steered?: boolean;
|
|
359
363
|
}
|
|
360
364
|
export interface TurnInbox {
|
|
361
365
|
batch: string;
|
|
362
366
|
pendingAfter: number;
|
|
363
367
|
messages: TurnInboxMessage[];
|
|
364
368
|
}
|
|
369
|
+
export interface TurnSteeredData {
|
|
370
|
+
requestId: string;
|
|
371
|
+
/** The Messages that joined the Turn. */
|
|
372
|
+
inbox: TurnInbox;
|
|
373
|
+
}
|
|
365
374
|
export interface TurnStartedData {
|
|
366
375
|
harness: Harness;
|
|
367
376
|
model?: string;
|
|
@@ -498,6 +507,8 @@ export interface GapData {
|
|
|
498
507
|
}
|
|
499
508
|
export type TurnStartedEvent = Ev<"turn.started", TurnStartedData>;
|
|
500
509
|
export type TurnDispatchedEvent = Ev<"turn.dispatched", Record<string, never>>;
|
|
510
|
+
/** The harness took a Batch into the running Turn (`inbox.duringTurn: steer`). */
|
|
511
|
+
export type TurnSteeredEvent = Ev<"turn.steered", TurnSteeredData>;
|
|
501
512
|
export type TextDeltaEvent = Ev<"text.delta", {
|
|
502
513
|
text: string;
|
|
503
514
|
}>;
|
|
@@ -545,7 +556,7 @@ export type ServicePhaseEvent = Ev<"service.phase", ServicePhaseData>;
|
|
|
545
556
|
/** Made by the SDK, never journaled: the stream could not resume from its cursor and events were lost. */
|
|
546
557
|
export type GapEvent = Ev<"gap", GapData>;
|
|
547
558
|
/** One event of an agent computer's journal, or the Controller's own on the fleet-wide stream. Narrow on `type` to get typed `data`. */
|
|
548
|
-
export type A12sEvent = TurnStartedEvent | TurnDispatchedEvent | TextDeltaEvent | ToolStartedEvent | ToolFinishedEvent | PermissionEvent | DiagnosticEvent | TurnFinishedEvent | SessionChangedEvent | ResumeFailedEvent | LifecycleEvent | HarnessRestartedEvent | ContinuationAbandonedEvent | TurnRefusedEvent | InboxDiscardedEvent | EgressDeniedEvent | TaskStartedEvent | TaskFinishedEvent | FleetChangedEvent | PhaseEvent | InboxChangedEvent | ServicePhaseEvent | GapEvent;
|
|
559
|
+
export type A12sEvent = TurnStartedEvent | TurnDispatchedEvent | TurnSteeredEvent | TextDeltaEvent | ToolStartedEvent | ToolFinishedEvent | PermissionEvent | DiagnosticEvent | TurnFinishedEvent | SessionChangedEvent | ResumeFailedEvent | LifecycleEvent | HarnessRestartedEvent | ContinuationAbandonedEvent | TurnRefusedEvent | InboxDiscardedEvent | EgressDeniedEvent | TaskStartedEvent | TaskFinishedEvent | FleetChangedEvent | PhaseEvent | InboxChangedEvent | ServicePhaseEvent | GapEvent;
|
|
549
560
|
export type EventType = A12sEvent["type"];
|
|
550
561
|
/** One tool call in a Turn. A `send` to another Computer is `mcp__a12s__send` with `input.body`. */
|
|
551
562
|
export interface ToolCall {
|
package/package.json
CHANGED