agent-afk 5.99.0 → 5.100.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.
@@ -74,6 +74,7 @@ export type ProviderEvent = {
74
74
  toolName: string;
75
75
  toolInput: string;
76
76
  toolInputRaw?: string;
77
+ pending?: true;
77
78
  sessionId?: string;
78
79
  } | {
79
80
  type: 'tool.use';
@@ -14,6 +14,7 @@ export declare class AgentSession implements IAgentSession {
14
14
  private conversationHistory;
15
15
  private turnCount;
16
16
  private inboundMessageCount;
17
+ private subagentOutputRecorder;
17
18
  private pendingFrameworkContext;
18
19
  private lastResponseMetadata;
19
20
  private initPromise;
@@ -0,0 +1,24 @@
1
+ import type { OutputEvent } from '../types/session-types.js';
2
+ export declare const MAX_RECORD_BYTES: number;
3
+ export declare const MAX_TRANSCRIPT_BYTES: number;
4
+ export declare const OUTPUT_CAPTURE_BANNER = "<!-- Best-effort secret redaction only. Connection strings, PEM blocks, and PII are NOT caught. -->";
5
+ export interface SubagentOutputCaptureInput {
6
+ sessionId: string | undefined;
7
+ subagentId: string | undefined;
8
+ isSubagentFork: boolean;
9
+ model: string | undefined;
10
+ }
11
+ export declare function shouldCaptureSubagentOutput(input: SubagentOutputCaptureInput): boolean;
12
+ export declare function sanitizeRecordText(text: string): string;
13
+ export declare function buildOutputHeader(input: SubagentOutputCaptureInput): string;
14
+ export declare function buildRecord(kind: 'say' | 'tool' | 'end', detail: {
15
+ text?: string;
16
+ toolName?: string;
17
+ toolInput?: string;
18
+ reason?: string;
19
+ }): string;
20
+ export interface SubagentOutputRecorder {
21
+ observe(event: OutputEvent): void;
22
+ end(reason: string): void;
23
+ }
24
+ export declare function createSubagentOutputRecorder(input: SubagentOutputCaptureInput): SubagentOutputRecorder | null;
@@ -101,13 +101,13 @@ export declare const HookDecisionPayloadSchema: z.ZodObject<{
101
101
  injectedContextBytes: z.ZodOptional<z.ZodNumber>;
102
102
  durationMs: z.ZodOptional<z.ZodNumber>;
103
103
  approvalOutcome: z.ZodOptional<z.ZodEnum<{
104
+ decline: "decline";
105
+ cancel: "cancel";
104
106
  timeout: "timeout";
105
107
  "carve-out": "carve-out";
106
108
  approved: "approved";
107
109
  denied: "denied";
108
110
  unrecognised: "unrecognised";
109
- decline: "decline";
110
- cancel: "cancel";
111
111
  "hard-block": "hard-block";
112
112
  }>>;
113
113
  }, z.core.$strip>;
@@ -238,8 +238,8 @@ export declare const BackgroundAgentJoinedPayloadSchema: z.ZodObject<{
238
238
  jobId: z.ZodString;
239
239
  subagentId: z.ZodString;
240
240
  jobStatus: z.ZodEnum<{
241
- completed: "completed";
242
241
  failed: "failed";
242
+ completed: "completed";
243
243
  cancelled: "cancelled";
244
244
  }>;
245
245
  }, z.core.$strip>;
@@ -248,8 +248,8 @@ export declare const BackgroundAgentDeliveredPayloadSchema: z.ZodObject<{
248
248
  jobId: z.ZodString;
249
249
  subagentId: z.ZodString;
250
250
  jobStatus: z.ZodEnum<{
251
- completed: "completed";
252
251
  failed: "failed";
252
+ completed: "completed";
253
253
  cancelled: "cancelled";
254
254
  }>;
255
255
  }, z.core.$strip>;
@@ -285,8 +285,8 @@ export declare const BackgroundAgentPayloadSchema: z.ZodDiscriminatedUnion<[z.Zo
285
285
  jobId: z.ZodString;
286
286
  subagentId: z.ZodString;
287
287
  jobStatus: z.ZodEnum<{
288
- completed: "completed";
289
288
  failed: "failed";
289
+ completed: "completed";
290
290
  cancelled: "cancelled";
291
291
  }>;
292
292
  }, z.core.$strip>, z.ZodObject<{
@@ -294,8 +294,8 @@ export declare const BackgroundAgentPayloadSchema: z.ZodDiscriminatedUnion<[z.Zo
294
294
  jobId: z.ZodString;
295
295
  subagentId: z.ZodString;
296
296
  jobStatus: z.ZodEnum<{
297
- completed: "completed";
298
297
  failed: "failed";
298
+ completed: "completed";
299
299
  cancelled: "cancelled";
300
300
  }>;
301
301
  }, z.core.$strip>], "transition">;
@@ -557,8 +557,8 @@ export declare const SessionPhasePayloadSchema: z.ZodObject<{
557
557
  }, z.core.$strip>;
558
558
  export declare const SessionSealedPayloadSchema: z.ZodObject<{
559
559
  status: z.ZodEnum<{
560
- succeeded: "succeeded";
561
560
  failed: "failed";
561
+ succeeded: "succeeded";
562
562
  cancelled: "cancelled";
563
563
  }>;
564
564
  finalCostUsd: z.ZodNumber;
@@ -627,13 +627,13 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
627
627
  injectedContextBytes: z.ZodOptional<z.ZodNumber>;
628
628
  durationMs: z.ZodOptional<z.ZodNumber>;
629
629
  approvalOutcome: z.ZodOptional<z.ZodEnum<{
630
+ decline: "decline";
631
+ cancel: "cancel";
630
632
  timeout: "timeout";
631
633
  "carve-out": "carve-out";
632
634
  approved: "approved";
633
635
  denied: "denied";
634
636
  unrecognised: "unrecognised";
635
- decline: "decline";
636
- cancel: "cancel";
637
637
  "hard-block": "hard-block";
638
638
  }>>;
639
639
  }, z.core.$strip>;
@@ -717,8 +717,8 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
717
717
  jobId: z.ZodString;
718
718
  subagentId: z.ZodString;
719
719
  jobStatus: z.ZodEnum<{
720
- completed: "completed";
721
720
  failed: "failed";
721
+ completed: "completed";
722
722
  cancelled: "cancelled";
723
723
  }>;
724
724
  }, z.core.$strip>, z.ZodObject<{
@@ -726,8 +726,8 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
726
726
  jobId: z.ZodString;
727
727
  subagentId: z.ZodString;
728
728
  jobStatus: z.ZodEnum<{
729
- completed: "completed";
730
729
  failed: "failed";
730
+ completed: "completed";
731
731
  cancelled: "cancelled";
732
732
  }>;
733
733
  }, z.core.$strip>], "transition">;
@@ -960,13 +960,13 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
960
960
  injectedContextBytes: z.ZodOptional<z.ZodNumber>;
961
961
  durationMs: z.ZodOptional<z.ZodNumber>;
962
962
  approvalOutcome: z.ZodOptional<z.ZodEnum<{
963
+ decline: "decline";
964
+ cancel: "cancel";
963
965
  timeout: "timeout";
964
966
  "carve-out": "carve-out";
965
967
  approved: "approved";
966
968
  denied: "denied";
967
969
  unrecognised: "unrecognised";
968
- decline: "decline";
969
- cancel: "cancel";
970
970
  "hard-block": "hard-block";
971
971
  }>>;
972
972
  }, z.core.$strip>;
@@ -1054,8 +1054,8 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1054
1054
  jobId: z.ZodString;
1055
1055
  subagentId: z.ZodString;
1056
1056
  jobStatus: z.ZodEnum<{
1057
- completed: "completed";
1058
1057
  failed: "failed";
1058
+ completed: "completed";
1059
1059
  cancelled: "cancelled";
1060
1060
  }>;
1061
1061
  }, z.core.$strip>, z.ZodObject<{
@@ -1063,8 +1063,8 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1063
1063
  jobId: z.ZodString;
1064
1064
  subagentId: z.ZodString;
1065
1065
  jobStatus: z.ZodEnum<{
1066
- completed: "completed";
1067
1066
  failed: "failed";
1067
+ completed: "completed";
1068
1068
  cancelled: "cancelled";
1069
1069
  }>;
1070
1070
  }, z.core.$strip>], "transition">;
@@ -1265,8 +1265,8 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1265
1265
  kind: z.ZodLiteral<"session_sealed">;
1266
1266
  payload: z.ZodObject<{
1267
1267
  status: z.ZodEnum<{
1268
- succeeded: "succeeded";
1269
1268
  failed: "failed";
1269
+ succeeded: "succeeded";
1270
1270
  cancelled: "cancelled";
1271
1271
  }>;
1272
1272
  finalCostUsd: z.ZodNumber;
@@ -38,6 +38,7 @@ export interface ToolUseDetailChunk {
38
38
  toolName: string;
39
39
  toolInput: string;
40
40
  toolInputRaw?: string;
41
+ pending?: true;
41
42
  metadata?: Record<string, unknown>;
42
43
  }
43
44
  export interface ThinkingChunk {