agent-afk 5.232.2 → 5.233.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.
@@ -1,4 +1,4 @@
1
- export { FACET_VERSION, SessionFacetSchema, StoredSessionInputSchema, FacetOutcomeSchema, SubagentPersistenceSchema, SubagentInvocationSchema, WorldChangesSchema, TokenBreakdownSchema, type SessionFacet, type StoredSessionInput, type ToolEventInput, type FacetOutcome, type SubagentInvocation, type WorldChanges, type TokenBreakdown, } from './schema.js';
1
+ export { FACET_VERSION, SessionFacetSchema, StoredSessionInputSchema, FacetOutcomeSchema, SubagentPersistenceSchema, SubagentInvocationSchema, WorldChangesSchema, TokenBreakdownSchema, ParallelDispatchStatsSchema, type SessionFacet, type StoredSessionInput, type ToolEventInput, type FacetOutcome, type SubagentInvocation, type WorldChanges, type TokenBreakdown, type ParallelDispatchStats, } from './schema.js';
2
2
  export { deriveSessionFacet, type DeriveOptions } from './derive.js';
3
3
  export { getOrDeriveFacet, loadStoredSession, listSessionIds, type FacetStoreOptions, } from './store.js';
4
4
  export { createFacetSessionEndHook } from './session-end-hook.js';
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- export declare const FACET_VERSION = 3;
2
+ export declare const FACET_VERSION = 4;
3
3
  export declare const ToolEventInputSchema: z.ZodObject<{
4
4
  toolName: z.ZodString;
5
5
  toolUseId: z.ZodOptional<z.ZodString>;
@@ -86,6 +86,14 @@ export declare const TokenBreakdownSchema: z.ZodObject<{
86
86
  cost_usd: z.ZodNumber;
87
87
  }, z.core.$strip>;
88
88
  export type TokenBreakdown = z.infer<typeof TokenBreakdownSchema>;
89
+ export declare const ParallelDispatchStatsSchema: z.ZodObject<{
90
+ total_tool_calls: z.ZodNumber;
91
+ parallel_tool_calls: z.ZodNumber;
92
+ parallel_turns: z.ZodNumber;
93
+ tool_turns: z.ZodNumber;
94
+ ratio: z.ZodNullable<z.ZodNumber>;
95
+ }, z.core.$strip>;
96
+ export type ParallelDispatchStats = z.infer<typeof ParallelDispatchStatsSchema>;
89
97
  export declare const SessionFacetSchema: z.ZodObject<{
90
98
  facet_version: z.ZodNumber;
91
99
  session_id: z.ZodString;
@@ -148,6 +156,13 @@ export declare const SessionFacetSchema: z.ZodObject<{
148
156
  cache_creation: z.ZodOptional<z.ZodNumber>;
149
157
  cost_usd: z.ZodNumber;
150
158
  }, z.core.$strip>>;
159
+ parallel_dispatch: z.ZodObject<{
160
+ total_tool_calls: z.ZodNumber;
161
+ parallel_tool_calls: z.ZodNumber;
162
+ parallel_turns: z.ZodNumber;
163
+ tool_turns: z.ZodNumber;
164
+ ratio: z.ZodNullable<z.ZodNumber>;
165
+ }, z.core.$strip>;
151
166
  decisions: z.ZodArray<z.ZodString>;
152
167
  evidence_pointers: z.ZodArray<z.ZodString>;
153
168
  }, z.core.$loose>;
@@ -1,9 +1,12 @@
1
1
  import type { AgentSession } from '../../../agent/session.js';
2
- import type { SessionStats } from '../../slash/types.js';
2
+ import type { SessionStats, ToolEvent } from '../../slash/types.js';
3
+ import type { ContentBlockParam } from '@anthropic-ai/sdk/resources';
3
4
  import { type ImageAttachment } from '../../input/attachments.js';
4
5
  import type { InputSurfaceRefs } from '../../input/input-surface.js';
5
6
  import { type CompletionWriter, type ThinkingUiMode, type TurnHandles } from './shared.js';
6
7
  export { formatToolLine, formatToolResultLine, ToolLane } from './tool-lane.js';
8
+ export declare function buildAssistantContentBlocks(responseText: string, toolEvents: ToolEvent[]): ContentBlockParam[] | undefined;
9
+ export declare function buildUserContentBlocks(userText: string, toolEvents: ToolEvent[]): ContentBlockParam[] | undefined;
7
10
  export type { InputSurfaceRefs } from '../../input/input-surface.js';
8
11
  export declare function runTurn(input: {
9
12
  text: string;
@@ -1,6 +1,7 @@
1
1
  import type { ResponseMetadata } from '../../agent/types/message-types.js';
2
2
  import type { AgentModelInput } from '../../agent/types.js';
3
+ import type { ContentBlockParam } from '@anthropic-ai/sdk/resources';
3
4
  import type { SessionStats, ToolEvent, TurnRecord } from './types.js';
4
5
  export declare function createSessionStats(model: AgentModelInput): SessionStats;
5
6
  export declare function resetStats(stats: SessionStats): void;
6
- export declare function recordTurn(stats: SessionStats, userInput: string, assistantText: string, metadata: ResponseMetadata | undefined, toolEvents?: ToolEvent[]): TurnRecord;
7
+ export declare function recordTurn(stats: SessionStats, userInput: string, assistantText: string, metadata: ResponseMetadata | undefined, toolEvents?: ToolEvent[], userContentBlocks?: ContentBlockParam[], assistantContentBlocks?: ContentBlockParam[]): TurnRecord;