@coltonkirsten/a12s 0.11.2 → 0.12.1
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 +18 -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
|
@@ -346,7 +346,7 @@ type Ev<T extends string, D> = Omit<EventEnvelope, "type" | "data"> & {
|
|
|
346
346
|
type: T;
|
|
347
347
|
data: D;
|
|
348
348
|
};
|
|
349
|
-
/** 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. */
|
|
350
350
|
export interface TurnInboxMessage {
|
|
351
351
|
id: string;
|
|
352
352
|
seq: number;
|
|
@@ -358,12 +358,19 @@ export interface TurnInboxMessage {
|
|
|
358
358
|
bytes: number;
|
|
359
359
|
key?: string;
|
|
360
360
|
superseded?: number;
|
|
361
|
+
/** In a finished Turn: the Message joined the Turn while it ran (`inbox.duringTurn: steer`). */
|
|
362
|
+
steered?: boolean;
|
|
361
363
|
}
|
|
362
364
|
export interface TurnInbox {
|
|
363
365
|
batch: string;
|
|
364
366
|
pendingAfter: number;
|
|
365
367
|
messages: TurnInboxMessage[];
|
|
366
368
|
}
|
|
369
|
+
export interface TurnSteeredData {
|
|
370
|
+
requestId: string;
|
|
371
|
+
/** The Messages that joined the Turn. */
|
|
372
|
+
inbox: TurnInbox;
|
|
373
|
+
}
|
|
367
374
|
export interface TurnStartedData {
|
|
368
375
|
harness: Harness;
|
|
369
376
|
model?: string;
|
|
@@ -500,9 +507,18 @@ export interface GapData {
|
|
|
500
507
|
}
|
|
501
508
|
export type TurnStartedEvent = Ev<"turn.started", TurnStartedData>;
|
|
502
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>;
|
|
503
512
|
export type TextDeltaEvent = Ev<"text.delta", {
|
|
504
513
|
text: string;
|
|
505
514
|
}>;
|
|
515
|
+
/** Claude Code only: the model started writing a tool call of the agent's own; its tool.started, with the same `id`, follows once the input is complete. */
|
|
516
|
+
export type ToolComposingEvent = Ev<"tool.composing", {
|
|
517
|
+
id: string;
|
|
518
|
+
name: string;
|
|
519
|
+
}>;
|
|
520
|
+
/** Claude Code only: the model started a thinking block of the agent's own. */
|
|
521
|
+
export type ThinkingEvent = Ev<"thinking", Record<string, never>>;
|
|
506
522
|
export type ToolStartedEvent = Ev<"tool.started", ToolStartedData>;
|
|
507
523
|
export type ToolFinishedEvent = Ev<"tool.finished", ToolFinishedData>;
|
|
508
524
|
export type PermissionEvent = Ev<"permission", {
|
|
@@ -547,7 +563,7 @@ export type ServicePhaseEvent = Ev<"service.phase", ServicePhaseData>;
|
|
|
547
563
|
/** Made by the SDK, never journaled: the stream could not resume from its cursor and events were lost. */
|
|
548
564
|
export type GapEvent = Ev<"gap", GapData>;
|
|
549
565
|
/** 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`. */
|
|
550
|
-
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;
|
|
566
|
+
export type A12sEvent = TurnStartedEvent | TurnDispatchedEvent | TurnSteeredEvent | TextDeltaEvent | ToolComposingEvent | ThinkingEvent | ToolStartedEvent | ToolFinishedEvent | PermissionEvent | DiagnosticEvent | TurnFinishedEvent | SessionChangedEvent | ResumeFailedEvent | LifecycleEvent | HarnessRestartedEvent | ContinuationAbandonedEvent | TurnRefusedEvent | InboxDiscardedEvent | EgressDeniedEvent | TaskStartedEvent | TaskFinishedEvent | FleetChangedEvent | PhaseEvent | InboxChangedEvent | ServicePhaseEvent | GapEvent;
|
|
551
567
|
export type EventType = A12sEvent["type"];
|
|
552
568
|
/** One tool call in a Turn. A `send` to another Computer is `mcp__a12s__send` with `input.body`. */
|
|
553
569
|
export interface ToolCall {
|
package/package.json
CHANGED