agent-afk 5.352.0 → 5.353.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,6 +1,6 @@
1
1
  export { MemoryStore } from './memory-store.js';
2
2
  export { estimateTokens } from './estimate-tokens.js';
3
- export { loadHotMemory, injectHotMemory, injectEpisodeRecall, scoredEpisodes } from './memory-loader.js';
3
+ export { loadHotMemory, injectHotMemory, injectEpisodeRecall, scoredEpisodes, EPISODE_RECALL_CAP } from './memory-loader.js';
4
4
  export type { InjectEpisodeRecallOptions, ScoredEpisode } from './memory-loader.js';
5
5
  export { injectGoalPrompt } from '../goals/inject.js';
6
6
  export { createMemorySessionEndHook, createChildMemoryHotBlockHook } from './memory-hooks.js';
@@ -22,6 +22,7 @@ export interface ResponsesStreamEvent {
22
22
  total_tokens?: number;
23
23
  input_tokens_details?: {
24
24
  cached_tokens?: number;
25
+ cache_write_tokens?: number;
25
26
  };
26
27
  };
27
28
  incomplete_details?: {
@@ -27,6 +27,7 @@ export interface OpenAIChunk {
27
27
  total_tokens?: number;
28
28
  prompt_tokens_details?: {
29
29
  cached_tokens?: number;
30
+ cache_write_tokens?: number;
30
31
  };
31
32
  };
32
33
  }
@@ -10,6 +10,7 @@ export interface LedgerEnsureContext {
10
10
  model?: string;
11
11
  cwd?: string;
12
12
  };
13
+ credentialSource?: string | undefined;
13
14
  }
14
15
  export declare class LedgerLifecycle {
15
16
  private writer;
@@ -1,2 +1,2 @@
1
1
  import type { TraceSink } from '../trace/index.js';
2
- export declare function emitSessionIdAssigned(writer: TraceSink | undefined, sessionId: string, priorSessionId: string | undefined): Promise<void>;
2
+ export declare function emitSessionIdAssigned(writer: TraceSink | undefined, sessionId: string, priorSessionId: string | undefined, credentialSource?: string | undefined): Promise<void>;
@@ -9,6 +9,7 @@ export interface SessionMeta {
9
9
  startedAt?: number;
10
10
  afkVersion?: string;
11
11
  forkedFrom?: string;
12
+ credentialSource?: string;
12
13
  gitHead?: GitHeadSnapshot | null;
13
14
  }
14
15
  export interface GitHeadSnapshot {
@@ -782,6 +782,7 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
782
782
  sessionId: z.ZodOptional<z.ZodString>;
783
783
  priorSessionId: z.ZodOptional<z.ZodString>;
784
784
  afkVersion: z.ZodOptional<z.ZodString>;
785
+ credentialSource: z.ZodOptional<z.ZodString>;
785
786
  }, z.core.$strip>;
786
787
  }, z.core.$strip>], "kind">;
787
788
  export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -1270,6 +1271,7 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1270
1271
  sessionId: z.ZodOptional<z.ZodString>;
1271
1272
  priorSessionId: z.ZodOptional<z.ZodString>;
1272
1273
  afkVersion: z.ZodOptional<z.ZodString>;
1274
+ credentialSource: z.ZodOptional<z.ZodString>;
1273
1275
  }, z.core.$strip>;
1274
1276
  }, z.core.$strip>, z.ZodObject<{
1275
1277
  ts: z.ZodString;
@@ -132,4 +132,5 @@ export declare const SessionPhasePayloadSchema: z.ZodObject<{
132
132
  sessionId: z.ZodOptional<z.ZodString>;
133
133
  priorSessionId: z.ZodOptional<z.ZodString>;
134
134
  afkVersion: z.ZodOptional<z.ZodString>;
135
+ credentialSource: z.ZodOptional<z.ZodString>;
135
136
  }, z.core.$strip>;
@@ -5,6 +5,7 @@ export { renderReceiptMarkdown };
5
5
  export { RECEIPT_SCHEMA_VERSION, type ReceiptMeta, type ReceiptToolFailure, type RunReceipt } from './receipt.types.js';
6
6
  import { type ReceiptMeta, type RunReceipt } from './receipt.types.js';
7
7
  export { extractJournalSummary, type JournalSummary } from './receipt.journal.js';
8
+ export { type SubagentModelEntry, type SubagentsByModel } from './receipt.subagents-by-model.js';
8
9
  export declare function parseTraceJsonl(raw: string): TraceEvent[];
9
10
  export declare function receiptPathsFor(tracePath: string): {
10
11
  label: string;
@@ -0,0 +1,11 @@
1
+ import type { TraceEvent } from './types.js';
2
+ export interface SubagentModelEntry {
3
+ started: number;
4
+ succeeded: number;
5
+ failed: number;
6
+ cancelled: number;
7
+ costUsd: number;
8
+ requested: string[];
9
+ }
10
+ export type SubagentsByModel = Record<string, SubagentModelEntry>;
11
+ export declare function buildSubagentsByModel(events: TraceEvent[]): SubagentsByModel | undefined;
@@ -2,6 +2,7 @@ import type { CostTokens, SessionCostSource } from './cost.js';
2
2
  import type { JournalSummary } from './receipt.journal.js';
3
3
  import type { OutcomesV1 } from '../outcomes/outcomes-v1.schema.js';
4
4
  import type { ClosureReason, ToolFailureClass, TraceEventKind } from './types.js';
5
+ import type { SubagentsByModel } from './receipt.subagents-by-model.js';
5
6
  export declare const RECEIPT_SCHEMA_VERSION: 3;
6
7
  export interface ReceiptToolFailure {
7
8
  toolUseId: string;
@@ -53,6 +54,7 @@ export interface RunReceipt {
53
54
  succeeded: number;
54
55
  failed: number;
55
56
  cancelled: number;
57
+ byModel?: SubagentsByModel;
56
58
  };
57
59
  cost: {
58
60
  finalCostUsd?: number;
@@ -10,4 +10,5 @@ export interface SessionPhasePayload {
10
10
  sessionId?: string;
11
11
  priorSessionId?: string;
12
12
  afkVersion?: string;
13
+ credentialSource?: string;
13
14
  }
@@ -90,6 +90,7 @@ export interface AgentConfig {
90
90
  drainSubagents?: (reason: string) => Promise<unknown>;
91
91
  getPendingChildTerminalWrites?: () => readonly Promise<void>[];
92
92
  getPendingChildBillingStreams?: () => readonly Promise<void>[];
93
+ credentialSource?: string;
93
94
  isSubagentFork?: true;
94
95
  hasWorkspacePreamble?: true;
95
96
  provider?: ModelProvider;