agent-afk 5.306.2 → 5.306.4

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.
@@ -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,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;
@@ -1,6 +1,6 @@
1
+ export { truncate } from '../../utils/truncate.js';
1
2
  export declare function fmtDuration(ms: number): string;
2
3
  export declare function fmtBytes(n: number): string;
3
4
  export declare function fmtUsd(n: number): string;
4
5
  export declare function fmtTime(ts: string): string;
5
- export declare function truncate(s: string, n: number): string;
6
6
  export declare function label(s: string): string;