agent-afk 5.306.3 → 5.307.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,5 @@
1
1
  import type { CompactUsageEntry } from '../usage/usage-formatter.js';
2
+ import type { SubagentOutcomeSummaryEntry } from '../../insights/aggregators/subagent-outcomes.js';
2
3
  export type Surface = 'cli' | 'repl' | 'daemon' | 'telegram' | 'subagent' | 'web' | 'unknown';
3
4
  export type PhaseRole = 'read-only' | 'read-write';
4
5
  export type SubagentStatusLiteValue = 'idle' | 'running' | 'succeeded' | 'failed' | 'cancelled';
@@ -58,7 +59,9 @@ export interface RuntimeSnapshot {
58
59
  subagents: RuntimeSubagents;
59
60
  workspace: RuntimeWorkspace;
60
61
  usage?: RuntimeUsageEntry[];
62
+ subagentOutcomeSummary?: SubagentOutcomeSummaryEntry[];
61
63
  }
64
+ export type { SubagentOutcomeSummaryEntry } from '../../insights/aggregators/subagent-outcomes.js';
62
65
  export type RuntimeView = 'self' | 'tools' | 'subagents' | 'workspace' | 'all';
63
66
  export interface RuntimeStateSource {
64
67
  getSelf(): RuntimeSelf;
@@ -66,4 +69,5 @@ export interface RuntimeStateSource {
66
69
  getSubagents(): RuntimeSubagents;
67
70
  getWorkspace(): RuntimeWorkspace;
68
71
  getUsage(): RuntimeUsageEntry[];
72
+ getSubagentOutcomeSummary(): SubagentOutcomeSummaryEntry[];
69
73
  }
@@ -58,6 +58,7 @@ export declare class CronScheduler {
58
58
  private readonly queueDir;
59
59
  private readonly inFlightTaskIds;
60
60
  private readonly budgetAlerts;
61
+ private readonly overlapAlerts;
61
62
  private readonly telemetryAlerts;
62
63
  constructor(options?: SchedulerOptions);
63
64
  register(task: ScheduledTask): void;
@@ -6,3 +6,10 @@ export declare function makeOverlapSkipRecord(task: ScheduledTask, trigger: Tele
6
6
  export declare function makeBudgetSkipRecord(task: ScheduledTask, trigger: TelemetryTrigger, nowMs: number, skip: BudgetGateSkip): TelemetryRecord;
7
7
  export declare function makeTelemetryUnwritableSkipRecord(task: ScheduledTask, nowMs: number, errorDescription: string): TelemetryRecord;
8
8
  export declare function makeSessionStartSkipRecord(task: ScheduledTask, decision: GateDecision, nowMs: number): TelemetryRecord;
9
+ export declare class OverlapAlertLatch {
10
+ private readonly alerted;
11
+ shouldAlert(taskId: string): boolean;
12
+ clear(taskId: string): void;
13
+ _reset(): void;
14
+ }
15
+ export declare function formatOverlapAlertMessage(taskId: string, command: string, cron: string | undefined): string;
@@ -0,0 +1,8 @@
1
+ export declare const DEFAULT_TAIL_BYTES = 1048576;
2
+ export declare const DEFAULT_HISTORY_LIMIT = 10;
3
+ export interface ReadTelemetryHistoryOptions {
4
+ taskId: string;
5
+ limit?: number;
6
+ tailBytes?: number;
7
+ }
8
+ export declare function readTelemetryHistory(telemetryPath: string, options: ReadTelemetryHistoryOptions): Promise<unknown[]>;
@@ -48,6 +48,7 @@ export interface PreToolUseContext {
48
48
  toolName: string;
49
49
  input?: unknown;
50
50
  grantManager?: GrantManager;
51
+ nonInteractive?: boolean;
51
52
  toolUseId?: string;
52
53
  }
53
54
  export interface PostToolUseContext {
@@ -33,6 +33,7 @@ export interface BuildDispatcherOptions {
33
33
  bashOutputTailReporter?: (toolUseId: string) => (tail: string | undefined) => void;
34
34
  detachRegistry?: import('../../tools/detach-registry.js').DetachableToolRegistry;
35
35
  processJobs?: import('../../shell-jobs/process-jobs.js').ProcessJobRegistry;
36
+ isNonInteractive?: boolean;
36
37
  }
37
38
  export interface BuildDispatcherDeps {
38
39
  memoryStore: MemoryStore;
@@ -34,6 +34,7 @@ export interface CwdDependentsFactoryArgs {
34
34
  runtimeStateSource?: RuntimeStateSource;
35
35
  hookRegistry?: AgentConfig['hookRegistry'];
36
36
  planExitControls?: AgentConfig['planExitControls'];
37
+ isNonInteractive?: boolean;
37
38
  }) => ToolDispatcher;
38
39
  }
39
40
  export declare function createCwdDependentsFactory(args: CwdDependentsFactoryArgs): CwdDependentsFactory;
@@ -1,5 +1,10 @@
1
1
  import type { ContentBlockParam } from '@anthropic-ai/sdk/resources';
2
2
  import type { SessionState } from './query/session-state.js';
3
+ export declare const ENV_SPLIT_MARKER = "\n\n# Environment\n";
4
+ export declare function splitAtEnvironmentBoundary(assembled: string): {
5
+ stablePrefix: string;
6
+ volatileTail: string;
7
+ } | null;
3
8
  export declare function composeQuerySystem(options: {
4
9
  state: SessionState;
5
10
  systemPrefix: ContentBlockParam[] | null;
@@ -1,4 +1,4 @@
1
- import type { PlanExitControls } from '../../types/config-types.js';
1
+ import type { AgentConfig, PlanExitControls } from '../../types/config-types.js';
2
2
  import type { RuntimeStateSource } from '../../awareness/index.js';
3
3
  export interface BuildDispatcherOpts {
4
4
  cwd?: string;
@@ -17,6 +17,7 @@ export interface BuildDispatcherOpts {
17
17
  runtimeStateSource?: RuntimeStateSource;
18
18
  isSkillDispatch?: boolean;
19
19
  isNonInteractive?: boolean;
20
+ headless?: boolean;
20
21
  hookRegistry?: import('../../hooks.js').HookRegistry;
21
22
  planExitControls?: PlanExitControls;
22
23
  }
@@ -24,3 +25,7 @@ export declare function sessionRegistryOpts(src: {
24
25
  detachRegistry?: BuildDispatcherOpts['detachRegistry'];
25
26
  processJobs?: BuildDispatcherOpts['processJobs'];
26
27
  }): Pick<BuildDispatcherOpts, 'detachRegistry' | 'processJobs'>;
28
+ export declare function headlessSignalOpts(src: Pick<BuildDispatcherOpts, 'headless'>): {
29
+ isNonInteractive?: true;
30
+ };
31
+ export declare function interactivityOpts(config: Pick<AgentConfig, 'isNonInteractive' | 'surface'>): Pick<BuildDispatcherOpts, 'isNonInteractive' | 'headless'>;
@@ -0,0 +1,2 @@
1
+ import type { AgentConfig } from '../../types/config-types.js';
2
+ export declare function isHeadlessSession(config: Pick<AgentConfig, 'isNonInteractive' | 'surface'>): boolean;
@@ -40,6 +40,7 @@ export interface SessionToolDispatcherOptions {
40
40
  rootSessionId?: string;
41
41
  subagentId?: string;
42
42
  sessionGrantManager?: GrantManager;
43
+ isNonInteractive?: boolean;
43
44
  traceWriter?: TraceSink;
44
45
  readOnlyBash?: boolean;
45
46
  maxOutputBytes?: number;
@@ -70,6 +71,7 @@ export declare class SessionToolDispatcher implements ToolDispatcher {
70
71
  private readonly rootSessionId;
71
72
  private readonly subagentId;
72
73
  private readonly sessionGrantManager;
74
+ private readonly isNonInteractive;
73
75
  private readonly traceWriter;
74
76
  private readonly readOnlyBash;
75
77
  private readonly maxOutputBytes;
@@ -28,6 +28,7 @@ export interface PreDispatchGateDeps {
28
28
  parentSessionId: string | undefined;
29
29
  subagentId: string | undefined;
30
30
  sessionGrantManager: GrantManager | undefined;
31
+ nonInteractive: boolean;
31
32
  resolveBase: string | undefined;
32
33
  traceWriter: TraceSink | undefined;
33
34
  isRegisteredTool: (toolName: string) => boolean;
@@ -3,7 +3,6 @@ export { isMcpDenyEntry, isToolDenied } from './operator-denied.match.js';
3
3
  export declare const LOCKED_TOOLS: ReadonlySet<string>;
4
4
  export declare const TOOL_GROUP_NAMES: readonly ["browser", "image", "clipboard", "peer", "schedules"];
5
5
  export declare function toolGroups(): Readonly<Record<string, readonly string[]>>;
6
- export declare function resetWarnings(): void;
7
6
  export declare function parseDisabledTools(value: unknown, source: string, customNames?: readonly string[]): string[];
8
7
  export declare function resolveOperatorDeniedTools(customNames?: readonly string[]): string[];
9
8
  export declare function withOperatorDenied(base: ToolPermissionConfig | undefined, denied: readonly string[]): ToolPermissionConfig | undefined;
@@ -1,6 +1,7 @@
1
1
  export declare function emitKeypressEventsImmediateEscape(stream: NodeJS.ReadableStream): void;
2
2
  export declare const CPR_KEYPRESS_GRACE_MS = 500;
3
3
  export declare function armCprKeypressGuard(stdin: NodeJS.ReadableStream, durationMs: number): void;
4
+ export declare function disarmCprKeypressGuard(): void;
4
5
  export declare function isCprKeypressGuardActive(stdin: NodeJS.ReadableStream): boolean;
5
6
  export declare function isCprSequence(stdin: NodeJS.ReadableStream, sequence: string): boolean;
6
7
  export declare function __resetCprKeypressGuardForTests(): void;
@@ -10,6 +10,7 @@ export interface KeypressCallbacks {
10
10
  export interface KeypressCtx {
11
11
  opts: ReadWithAutocompleteOpts;
12
12
  stdout: NodeJS.WriteStream;
13
+ stdin: NodeJS.ReadableStream;
13
14
  repaintCtx: RepaintCtx;
14
15
  callbacks: KeypressCallbacks;
15
16
  pasteWindowMs: number;
@@ -5,4 +5,5 @@ export interface PluginSkillHarvest {
5
5
  export declare function harvestPluginSkillFlags(cacheRoot?: string): Map<string, string[]>;
6
6
  export declare function harvestPluginSkillMetadata(cacheRoot?: string): PluginSkillHarvest;
7
7
  export declare function harvestAllPluginSkillFlags(): Map<string, string[]>;
8
+ export declare function harvestDiscoveredPluginSkillMetadata(): PluginSkillHarvest;
8
9
  export declare function extractHintFromDescription(description: string): string | undefined;
@@ -9,6 +9,7 @@ export declare const CPR_RTT_SCALE = 4;
9
9
  export declare const CPR_TIMEOUT_CEILING_MS = 1500;
10
10
  export declare const CPR_MAX_REQUERY = 8;
11
11
  export declare function __resetCprRttForTests(): void;
12
+ export declare function __getCprRttForTests(): number | null;
12
13
  export interface CprHost {
13
14
  readonly stdout: NodeJS.WriteStream;
14
15
  readonly stdin: NodeJS.ReadStream;