agent-afk 5.305.8 → 5.306.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.
@@ -0,0 +1,12 @@
1
+ import type { LedgerRecord } from './session-end-hook.js';
2
+ export interface DefectCluster {
3
+ repo: string;
4
+ locus: string;
5
+ signal: string;
6
+ category: string;
7
+ recurrenceCount: number;
8
+ firstSeen: string;
9
+ lastSeen: string;
10
+ }
11
+ export declare function readLedgerRecords(ledgerPath?: string): LedgerRecord[];
12
+ export declare function clusterLedgerRecords(records: LedgerRecord[]): DefectCluster[];
@@ -14,7 +14,7 @@ import type { GrantManager } from '../../tools/grant-manager.js';
14
14
  import type { RuntimeStateSource } from '../../awareness/index.js';
15
15
  import type { SpawnedPidRegistry } from '../../tools/handlers/pid-registry.js';
16
16
  import { SessionToolDispatcher } from '../../tools/dispatcher.js';
17
- import { type ToolPermissionConfig } from '../../tools/permissions.js';
17
+ import type { ToolPermissionConfig } from '../../tools/permissions.js';
18
18
  export interface BuildDispatcherOptions {
19
19
  cwd?: string;
20
20
  readRoots?: string[];
@@ -3,7 +3,7 @@ import type { HookRegistry } from '../../hooks.js';
3
3
  import type { SubagentExecutor } from '../../tools/subagent-executor.js';
4
4
  import type { SkillExecutor } from '../../tools/skill-executor.js';
5
5
  import type { ComposeExecutor } from '../../tools/compose-executor.js';
6
- import { type ToolPermissionConfig } from '../../tools/permissions.js';
6
+ import type { ToolPermissionConfig } from '../../tools/permissions.js';
7
7
  import type { CanUseTool } from '../../types/sdk-types.js';
8
8
  import type { ToolDispatcher } from '../anthropic-direct/tool-dispatcher.js';
9
9
  import { MemoryStore } from '../../memory/index.js';
@@ -9,7 +9,7 @@ import type { ComposeExecutor } from './compose-executor.js';
9
9
  import type { ToolHandler, ConcurrencyClassifier } from './types.js';
10
10
  import type { ToolActivityReporter } from '../providers/shared/tool-activity.js';
11
11
  import type { SpawnedPidRegistry } from './handlers/pid-registry.js';
12
- import type { ToolPermissionConfig } from './permissions.js';
12
+ import { type ToolPermissionConfig } from './permissions.js';
13
13
  import type { CanUseTool } from '../types/sdk-types.js';
14
14
  import { type GrantSnapshot, type GrantManager } from './grant-manager.js';
15
15
  import type { TraceSink } from '../trace/index.js';
@@ -0,0 +1,13 @@
1
+ import type { ToolPermissionConfig } from './permissions.js';
2
+ import type { AnthropicToolDef, ToolDispatcher } from '../providers/anthropic-direct/types.js';
3
+ export declare function withOperatorDeniedDispatcher(inner: ToolDispatcher | undefined, permissions: ToolPermissionConfig | undefined): ToolDispatcher | undefined;
4
+ export declare function snapshotOperatorOptions<T extends {
5
+ permissions?: ToolPermissionConfig;
6
+ tools?: ToolDispatcher;
7
+ customTools?: readonly {
8
+ schema: {
9
+ name: string;
10
+ };
11
+ }[];
12
+ }>(opts: T): T;
13
+ export declare function operatorDispatcherToolDefs(dispatcher: ToolDispatcher, fallback: readonly AnthropicToolDef[]): readonly AnthropicToolDef[];
@@ -0,0 +1,10 @@
1
+ import type { ToolPermissionConfig } from './permissions.js';
2
+ export { isMcpDenyEntry, isToolDenied } from './operator-denied.match.js';
3
+ export declare const LOCKED_TOOLS: ReadonlySet<string>;
4
+ export declare const TOOL_GROUP_NAMES: readonly ["browser", "image", "clipboard", "peer", "schedules"];
5
+ export declare function toolGroups(): Readonly<Record<string, readonly string[]>>;
6
+ export declare function resetWarnings(): void;
7
+ export declare function parseDisabledTools(value: unknown, source: string, customNames?: readonly string[]): string[];
8
+ export declare function resolveOperatorDeniedTools(customNames?: readonly string[]): string[];
9
+ export declare function withOperatorDenied(base: ToolPermissionConfig | undefined, denied: readonly string[]): ToolPermissionConfig | undefined;
10
+ export declare function snapshotOperatorPermissions(base: ToolPermissionConfig | undefined, customNames?: readonly string[]): ToolPermissionConfig | undefined;
@@ -0,0 +1,4 @@
1
+ export declare const OPERATOR_DENIED_MARKER = "disabled by operator settings";
2
+ export declare function operatorDeniedReason(toolName: string): string;
3
+ export declare function isMcpDenyEntry(entry: string): boolean;
4
+ export declare function isToolDenied(name: string, denied?: readonly string[]): boolean;
@@ -0,0 +1,2 @@
1
+ import { type ToolPermissionConfig } from './permissions.js';
2
+ export declare function composeDispatcherPermissions(base: ToolPermissionConfig | undefined, mcpWireNames: readonly string[] | undefined, customToolNames: readonly string[]): ToolPermissionConfig | undefined;
@@ -1,4 +1,5 @@
1
1
  export interface ToolPermissionConfig {
2
+ deniedTools?: string[];
2
3
  allowedTools?: string[];
3
4
  }
4
5
  export interface PermissionCheckResult {
@@ -0,0 +1,2 @@
1
+ import type { CliConfig, ConfigFileSchema } from './types.js';
2
+ export declare function parseToolsConfig(json: ConfigFileSchema): Partial<CliConfig>;
@@ -0,0 +1,10 @@
1
+ import { type JsonConfigTier } from './json-tier-paths.js';
2
+ export interface TierDisabledTools {
3
+ tier: JsonConfigTier;
4
+ label: string;
5
+ path: string;
6
+ entries: readonly string[];
7
+ unreadable?: boolean;
8
+ }
9
+ export declare function readDisabledToolsByTier(): TierDisabledTools[];
10
+ export declare function writeUserDisabledTools(entries: readonly string[], file?: string): void;
@@ -9,6 +9,9 @@ export interface AutoRoutingConfig {
9
9
  telegram?: boolean;
10
10
  }
11
11
  export interface CliConfig {
12
+ tools?: {
13
+ disabled?: string[];
14
+ };
12
15
  apiKey?: string;
13
16
  baseUrl?: string;
14
17
  model: AgentModelInput;
@@ -77,6 +80,9 @@ export interface ModelSlotConfigEntry {
77
80
  apiKey?: string;
78
81
  }
79
82
  export interface ConfigFileSchema {
83
+ tools?: {
84
+ disabled?: string[];
85
+ };
80
86
  model?: string;
81
87
  models?: {
82
88
  small?: string | ModelSlotConfigEntry;
@@ -0,0 +1,15 @@
1
+ import type { MenuOverlays } from './config-menu.js';
2
+ import { type TierDisabledTools } from '../config/tools-disabled.js';
3
+ export interface ToolsMenuIo {
4
+ byTier(): readonly TierDisabledTools[];
5
+ writeUser(entries: readonly string[]): void;
6
+ mcpServers(): readonly string[];
7
+ }
8
+ export interface ToolRow {
9
+ entry: string;
10
+ detail: string;
11
+ }
12
+ export declare function buildToolRows(mcpServers: readonly string[], configured: readonly string[]): ToolRow[];
13
+ export declare function disabledCount(io: ToolsMenuIo): number;
14
+ export declare function runToolsMenu(ov: MenuOverlays, io: ToolsMenuIo): Promise<void>;
15
+ export declare function defaultToolsIo(): ToolsMenuIo;
@@ -3,10 +3,12 @@ import { type ConfigKeySpec } from '../../config/settable-keys.js';
3
3
  import { type ConfigProvenance } from '../config/provenance.js';
4
4
  import { type ProvenanceCache } from '../config/provenance-cache.js';
5
5
  import { type LiveApplyHandle, type LiveApplyOutcome } from '../config/live-apply.js';
6
+ import { type ToolsMenuIo } from './config-menu-tools.js';
6
7
  export interface MenuOverlays {
7
8
  pick(header: readonly string[], options: readonly string[]): Promise<number | null>;
8
9
  editText(header: readonly string[], initial: string, help: string, validate: (v: string) => string | null): Promise<string | null>;
9
10
  emit(line: string): void;
11
+ pickMany?(header: readonly string[], options: readonly string[], initialSelected: ReadonlySet<number>): Promise<number[] | null>;
10
12
  }
11
13
  export interface MenuIo {
12
14
  specs(): readonly ConfigKeySpec[];
@@ -14,6 +16,7 @@ export interface MenuIo {
14
16
  write(path: string, rawValue: string, allowHuman: boolean): string;
15
17
  provenance?(path: string, cache?: ProvenanceCache): ConfigProvenance;
16
18
  applyLive?(path: string, rawValue: string): Promise<LiveApplyOutcome>;
19
+ tools?: ToolsMenuIo;
17
20
  }
18
21
  export declare function runConfigMenu(ov: MenuOverlays, io: MenuIo): Promise<void>;
19
22
  export declare function overlaysFromCompositor(c: TerminalCompositor): MenuOverlays;