agent-afk 5.308.4 → 5.308.6
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.
- package/dist/agent/awareness/types.d.ts +1 -1
- package/dist/agent/background-registry.d.ts +0 -1
- package/dist/agent/background-registry.mark-terminal.d.ts +29 -0
- package/dist/agent/daemon/gates.d.ts +1 -1
- package/dist/agent/daemon/schedule-store.d.ts +5 -1
- package/dist/agent/daemon/scheduler.d.ts +2 -1
- package/dist/agent/daemon/scheduler.execute-agent-task.d.ts +3 -1
- package/dist/agent/daemon/scheduler.overlap-guard.d.ts +2 -0
- package/dist/agent/daemon/scheduler.runat-gate.d.ts +13 -0
- package/dist/agent/daemon/session-spawn.d.ts +3 -0
- package/dist/agent/daemon/triggers.d.ts +2 -0
- package/dist/agent/mcp/index.d.ts +1 -6
- package/dist/agent/memory/memory-store.schema.d.ts +0 -1
- package/dist/agent/outcomes/verification-patterns.d.ts +1 -0
- package/dist/agent/providers/anthropic-direct/query/prompt-assembly.d.ts +2 -1
- package/dist/agent/providers/index.d.ts +1 -0
- package/dist/agent/providers/openai-compatible/index.d.ts +2 -31
- package/dist/agent/providers/openai-compatible/index.options.d.ts +31 -0
- package/dist/agent/providers/openai-compatible/system-prompt-wiring.d.ts +2 -1
- package/dist/agent/providers/shared/supported-commands.d.ts +6 -1
- package/dist/agent/providers/shared/transient-retry.d.ts +1 -0
- package/dist/agent/providers/xai/oauth-http.d.ts +1 -0
- package/dist/agent/session/agent-session.executors.d.ts +12 -0
- package/dist/agent/session/create-wired-executors.d.ts +20 -0
- package/dist/agent/session/default-subagent-model.d.ts +2 -0
- package/dist/agent/session/deferred-parent-proxy.d.ts +7 -0
- package/dist/agent/session/sdk-surface-warning.d.ts +7 -0
- package/dist/agent/session/session-executors.d.ts +32 -0
- package/dist/agent/session/wire-executors.d.ts +5 -0
- package/dist/agent/session/wire-executors.scope.d.ts +10 -0
- package/dist/agent/subagent.abort-wiring.d.ts +1 -0
- package/dist/agent/subagent.drain.d.ts +11 -0
- package/dist/agent/tools/compose-executor.context.d.ts +29 -0
- package/dist/agent/tools/compose-executor.d.ts +2 -28
- package/dist/agent/tools/compose-executor.wave-manifest.d.ts +14 -0
- package/dist/agent/tools/nesting.d.ts +3 -1
- package/dist/agent/tools/skill-bridge.d.ts +2 -0
- package/dist/agent/tools/skill-executor/allowlist.d.ts +2 -0
- package/dist/agent/tools/skill-executor/types.d.ts +3 -0
- package/dist/agent/tools/skill-executor.d.ts +5 -0
- package/dist/agent/tools/subagent/child-config.d.ts +1 -0
- package/dist/agent/tools/subagent-executor/types.d.ts +2 -0
- package/dist/agent/tools/subagent-executor.d.ts +2 -2
- package/dist/agent/tools/subagent-executor.execute-once.d.ts +22 -0
- package/dist/agent/tools/subagent-executor.execute-once.helpers.d.ts +103 -0
- package/dist/agent/types/config-types.d.ts +1 -0
- package/dist/cli/commands/config-command.env.d.ts +2 -0
- package/dist/cli/commands/interactive/bootstrap-session-builder.d.ts +9 -0
- package/dist/cli/commands/marketplace.subcommands.d.ts +14 -0
- package/dist/cli/config/json-tier-parse.interactive.d.ts +4 -0
- package/dist/cli/config/json-tier-parse.telegram.d.ts +4 -0
- package/dist/cli/shared-helpers.d.ts +2 -2
- package/dist/cli/slash/_lib/run-skill-preflight.d.ts +3 -0
- package/dist/cli/slash/commands/info.mcp.d.ts +2 -0
- package/dist/cli.mjs +385 -390
- package/dist/improve/schemas.d.ts +2 -2
- package/dist/index.d.ts +3 -0
- package/dist/index.mjs +271 -185
- package/dist/telegram.mjs +200 -199
- package/dist/utils/abort.d.ts +11 -0
- package/dist/web-server/session-owner.d.ts +1 -0
- package/package.json +1 -1
|
@@ -38,6 +38,7 @@ export interface BuildChildConfigArgs {
|
|
|
38
38
|
traceWriter?: TraceSink;
|
|
39
39
|
workspaceStore?: import('../../workspace/index.js').WorkspaceStore;
|
|
40
40
|
delegationBudget?: import('../../tools/delegation-budget.js').DelegationBudget;
|
|
41
|
+
hookRegistry?: import('../../hooks.js').HookRegistry;
|
|
41
42
|
parentRootSessionId?: string;
|
|
42
43
|
createChildExecutor: (ctx: SubagentExecutorContext) => SubagentExecutor;
|
|
43
44
|
}
|
|
@@ -12,6 +12,7 @@ import type { Surface } from '../../awareness/types.js';
|
|
|
12
12
|
import type { TraceSink } from '../../trace/index.js';
|
|
13
13
|
import type { InboundAttachmentReader } from '../../content/attachment-registry.js';
|
|
14
14
|
import type { DelegationBudget } from '../delegation-budget.js';
|
|
15
|
+
import type { HookRegistry } from '../../hooks.js';
|
|
15
16
|
import type { QueuedNoteClaim } from '../subagent/queued-note.js';
|
|
16
17
|
import type { PromotedSubagentInfo } from '../subagent/foreground-promotion.js';
|
|
17
18
|
export type { PromotedSubagentInfo, QueuedNoteClaim };
|
|
@@ -35,6 +36,7 @@ export interface SubagentExecutorContext {
|
|
|
35
36
|
traceWriter?: TraceSink;
|
|
36
37
|
workspaceStore?: import('../../workspace/index.js').WorkspaceStore;
|
|
37
38
|
delegationBudget?: DelegationBudget;
|
|
39
|
+
hookRegistry?: HookRegistry;
|
|
38
40
|
allowedTools?: string[];
|
|
39
41
|
readOnlyBash?: boolean;
|
|
40
42
|
nestedAgentAllowlist?: readonly string[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TraceSink } from '../trace/index.js';
|
|
2
2
|
import type { AnthropicToolDef, ToolCall, ToolResult } from './types.js';
|
|
3
|
-
import {
|
|
3
|
+
import type { AgentExecutionMode } from './subagent/input-parse.js';
|
|
4
4
|
import { buildSubagentsLite } from './subagent-executor.lite-snapshot.js';
|
|
5
5
|
import type { SubagentExecutorContext, SubagentControl } from './subagent-executor/types.js';
|
|
6
6
|
import type { QueuedNoteClaim, PromotedSubagentInfo } from './subagent-executor/types.js';
|
|
@@ -11,7 +11,7 @@ export type { PromotedSubagentInfo } from './subagent/foreground-promotion.js';
|
|
|
11
11
|
export declare class SubagentExecutor implements SubagentControl {
|
|
12
12
|
private readonly ctx;
|
|
13
13
|
private currentCwd;
|
|
14
|
-
private
|
|
14
|
+
private readonly isolationCounterRef;
|
|
15
15
|
constructor(ctx: SubagentExecutorContext);
|
|
16
16
|
setCwd(cwd: string): void;
|
|
17
17
|
setTraceWriter(writer: TraceSink | undefined): void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ToolCall, ToolResult } from './types.js';
|
|
2
|
+
import { type BuildChildConfigArgs } from './subagent/child-config.js';
|
|
3
|
+
import { type PromotionTrigger } from './subagent/foreground-promotion.js';
|
|
4
|
+
import type { StreamCutProbe } from '../subagent/stream-cut-retry.js';
|
|
5
|
+
import { WaveManifestTracker } from './subagent-executor.wave-manifest.js';
|
|
6
|
+
import type { SubagentExecutorContext } from './subagent-executor/types.js';
|
|
7
|
+
export interface ExecuteOnceArgs {
|
|
8
|
+
ctx: SubagentExecutorContext;
|
|
9
|
+
currentCwd: string | undefined;
|
|
10
|
+
isolationCounterRef: {
|
|
11
|
+
value: number;
|
|
12
|
+
};
|
|
13
|
+
waveTracker: WaveManifestTracker;
|
|
14
|
+
promotionTriggers: Map<string, PromotionTrigger>;
|
|
15
|
+
activeForegroundHandles: Map<string, {
|
|
16
|
+
cancel: () => Promise<void>;
|
|
17
|
+
}>;
|
|
18
|
+
getCancelGeneration: () => number;
|
|
19
|
+
inheritedChildConfigArgs: () => Partial<BuildChildConfigArgs>;
|
|
20
|
+
updateCurrentWaveUnit: (callId: string, status: 'running' | 'done' | 'failed', error?: string, cwd?: string) => void;
|
|
21
|
+
}
|
|
22
|
+
export declare function executeOnce(call: ToolCall, args: ExecuteOnceArgs, probe?: StreamCutProbe, retryCancelGeneration?: number): Promise<ToolResult>;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { SubagentManager } from '../subagent.js';
|
|
2
|
+
import type { AgentInput } from './subagent/input-parse.js';
|
|
3
|
+
import type { StreamCutProbe } from '../subagent/stream-cut-retry.js';
|
|
4
|
+
import { type InboundAttachmentReader } from '../content/attachment-registry.js';
|
|
5
|
+
import type { SpawnReceipt } from './delegation-budget.js';
|
|
6
|
+
import type { ContentBlockParam } from '@anthropic-ai/sdk/resources';
|
|
7
|
+
import type { RegisteredAgent } from '../agents/index.js';
|
|
8
|
+
import type { SubagentExecutorContext } from './subagent-executor/types.js';
|
|
9
|
+
import type { TraceOrigin, TraceActor } from '../session/session-identity.js';
|
|
10
|
+
import type { AgentConfig } from '../types/config-types.js';
|
|
11
|
+
import type { ToolResult } from './types.js';
|
|
12
|
+
import type { TraceSink } from '../trace/index.js';
|
|
13
|
+
export interface IsolationWorktreeResult {
|
|
14
|
+
teardown: {
|
|
15
|
+
repoRoot: string;
|
|
16
|
+
worktreePath: string;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export interface SetupIsolationWorktreeArgs {
|
|
20
|
+
parsed: AgentInput;
|
|
21
|
+
currentCwd: string | undefined;
|
|
22
|
+
isolationCounterRef: {
|
|
23
|
+
value: number;
|
|
24
|
+
};
|
|
25
|
+
childConfig: AgentConfig;
|
|
26
|
+
childWriteCapable: boolean;
|
|
27
|
+
probe: StreamCutProbe | undefined;
|
|
28
|
+
budgetReceipt: SpawnReceipt | undefined;
|
|
29
|
+
}
|
|
30
|
+
export declare function setupIsolationWorktree(args: SetupIsolationWorktreeArgs): Promise<IsolationWorktreeResult | {
|
|
31
|
+
skipped: true;
|
|
32
|
+
} | {
|
|
33
|
+
error: ToolResult;
|
|
34
|
+
}>;
|
|
35
|
+
export interface ForkAndCheckCancelArgs {
|
|
36
|
+
ctx: SubagentExecutorContext;
|
|
37
|
+
parsed: AgentInput;
|
|
38
|
+
childConfig: AgentConfig;
|
|
39
|
+
namedAgent: RegisteredAgent | undefined;
|
|
40
|
+
nestedAgentAllowlist: string[] | undefined;
|
|
41
|
+
isolationTeardown: {
|
|
42
|
+
repoRoot: string;
|
|
43
|
+
worktreePath: string;
|
|
44
|
+
} | undefined;
|
|
45
|
+
getCancelGeneration: () => number;
|
|
46
|
+
retryCancelGeneration: number | undefined;
|
|
47
|
+
budgetReceipt: SpawnReceipt | undefined;
|
|
48
|
+
childManager: {
|
|
49
|
+
teardownAll: () => Promise<void>;
|
|
50
|
+
} | undefined;
|
|
51
|
+
identity: {
|
|
52
|
+
origin?: TraceOrigin;
|
|
53
|
+
actor?: TraceActor;
|
|
54
|
+
};
|
|
55
|
+
depth: number;
|
|
56
|
+
updateCurrentWaveUnit: (callId: string, status: 'running' | 'done' | 'failed', error?: string, cwd?: string) => void;
|
|
57
|
+
callId: string;
|
|
58
|
+
}
|
|
59
|
+
export type ForkResult = {
|
|
60
|
+
handle: Awaited<ReturnType<SubagentManager['forkSubagent']>>;
|
|
61
|
+
cancelled: false;
|
|
62
|
+
} | {
|
|
63
|
+
cancelled: true;
|
|
64
|
+
result: ToolResult;
|
|
65
|
+
} | {
|
|
66
|
+
forkError: true;
|
|
67
|
+
result: ToolResult;
|
|
68
|
+
};
|
|
69
|
+
export declare function forkAndCheckCancel(args: ForkAndCheckCancelArgs): Promise<ForkResult>;
|
|
70
|
+
export interface ResolveChildPromptArgs {
|
|
71
|
+
parsed: AgentInput;
|
|
72
|
+
childScopeInputs: {
|
|
73
|
+
parentReadRoots: string[] | undefined;
|
|
74
|
+
parentCwd: string | undefined;
|
|
75
|
+
};
|
|
76
|
+
currentCwd: string | undefined;
|
|
77
|
+
sessionId: string | undefined;
|
|
78
|
+
attachmentRegistry?: InboundAttachmentReader;
|
|
79
|
+
}
|
|
80
|
+
export type ResolveChildPromptResult = {
|
|
81
|
+
prompt: string | ContentBlockParam[];
|
|
82
|
+
error?: never;
|
|
83
|
+
} | {
|
|
84
|
+
error: ToolResult;
|
|
85
|
+
prompt?: never;
|
|
86
|
+
};
|
|
87
|
+
export declare function resolveChildPrompt(args: ResolveChildPromptArgs): Promise<ResolveChildPromptResult>;
|
|
88
|
+
export interface RunBackgroundDispatchArgs {
|
|
89
|
+
handle: Awaited<ReturnType<SubagentManager['forkSubagent']>>;
|
|
90
|
+
ctx: SubagentExecutorContext;
|
|
91
|
+
parsed: AgentInput;
|
|
92
|
+
childConfig: AgentConfig;
|
|
93
|
+
waveId: string | undefined;
|
|
94
|
+
callId: string;
|
|
95
|
+
budgetRelease: (() => void) | undefined;
|
|
96
|
+
isolationTeardown: {
|
|
97
|
+
repoRoot: string;
|
|
98
|
+
worktreePath: string;
|
|
99
|
+
} | undefined;
|
|
100
|
+
traceWriter: TraceSink | undefined;
|
|
101
|
+
}
|
|
102
|
+
export declare function runBackgroundDispatch(args: RunBackgroundDispatchArgs): Promise<ToolResult>;
|
|
103
|
+
export declare function checkNestedScope(nestedScope: readonly string[], requestedType: string | undefined): ToolResult | undefined;
|
|
@@ -88,6 +88,7 @@ export interface AgentConfig {
|
|
|
88
88
|
drainSubagents?: (reason: string) => Promise<unknown>;
|
|
89
89
|
isSubagentFork?: true;
|
|
90
90
|
provider?: ModelProvider;
|
|
91
|
+
executors?: import('../session/session-executors.js').SessionExecutors;
|
|
91
92
|
providerFactory?: (model: string | undefined) => ModelProvider;
|
|
92
93
|
maxBudgetUsd?: number;
|
|
93
94
|
taskBudget?: number;
|
|
@@ -53,3 +53,12 @@ export declare function buildSharedDeps(a: {
|
|
|
53
53
|
initialPermissionMode: PermissionMode | undefined;
|
|
54
54
|
explicitProvider?: string;
|
|
55
55
|
}): BuildAgentSessionDeps;
|
|
56
|
+
import { MemoryStore } from '../../../agent/memory/index.js';
|
|
57
|
+
import { StateStore } from '../../../agent/state/state-store.js';
|
|
58
|
+
import { WorkspaceStore } from '../../../agent/workspace/workspace-store.js';
|
|
59
|
+
export interface BootstrapSharedStores {
|
|
60
|
+
sharedWorkspaceStore: WorkspaceStore | undefined;
|
|
61
|
+
sharedMemoryStore: MemoryStore;
|
|
62
|
+
sharedStateStore: StateStore;
|
|
63
|
+
}
|
|
64
|
+
export declare function createBootstrapSharedStores(): BootstrapSharedStores;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Command } from 'commander';
|
|
2
|
+
import ora from 'ora';
|
|
3
|
+
import { type InstallFromMarketplaceDeps } from '../../agent/marketplaces/resolve.js';
|
|
4
|
+
import { type UpdateMarketplaceDeps, type UpdateMarketplaceOutcome } from '../../agent/marketplaces/update.js';
|
|
5
|
+
export interface MarketplaceSubDeps extends InstallFromMarketplaceDeps, UpdateMarketplaceDeps {
|
|
6
|
+
logger?: Pick<Console, 'log' | 'error'>;
|
|
7
|
+
cacheDir: string;
|
|
8
|
+
indexPath: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function registerMarketplaceInstallPlugin(market: Command, moduleDeps: MarketplaceSubDeps): void;
|
|
11
|
+
export declare function registerMarketplaceRemove(market: Command, moduleDeps: MarketplaceSubDeps, logger: Pick<Console, 'log' | 'error'>): void;
|
|
12
|
+
export declare function formatOutcome(o: UpdateMarketplaceOutcome): string;
|
|
13
|
+
export declare function printOutcome(o: UpdateMarketplaceOutcome, spinner: ReturnType<typeof ora>): void;
|
|
14
|
+
export declare function registerMarketplaceUpdate(market: Command, moduleDeps: MarketplaceSubDeps, logger: Pick<Console, 'log' | 'error'>): void;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CliConfig, ConfigFileSchema } from './types.js';
|
|
2
|
+
type InteractiveConfig = NonNullable<CliConfig['interactive']>;
|
|
3
|
+
export declare function parseInteractiveBlock(raw: ConfigFileSchema['interactive'], configPath: string): InteractiveConfig | undefined;
|
|
4
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ProviderRouteHints } from '../agent/providers/index.js';
|
|
2
2
|
import type { AgentModelInput, ThinkingConfig, EffortLevel } from '../agent/types.js';
|
|
3
3
|
import type { GrantManager } from './slash/commands/allow-dir.js';
|
|
4
4
|
export { composeSystemPrompt, loadConfigSystemPrompt, loadSystemPrompt, OPERATOR_CONFIG_HEADER, resolveBaseSystemPrompt, } from './system-prompt.js';
|
|
@@ -9,7 +9,7 @@ export declare function getCodexApiKey(): string | undefined;
|
|
|
9
9
|
export declare function getApiKeyForModel(model: string | undefined, hints?: ProviderRouteHints): string | undefined;
|
|
10
10
|
export declare function explicitProviderHints(provider: string | undefined): ProviderRouteHints | undefined;
|
|
11
11
|
export declare function getModel(): AgentModelInput;
|
|
12
|
-
export
|
|
12
|
+
export { getDefaultSubagentModel } from '../agent/session/default-subagent-model.js';
|
|
13
13
|
export declare function parseThinking(raw: string | undefined): ThinkingConfig | undefined;
|
|
14
14
|
export declare function parseEffort(raw: string | undefined): EffortLevel | undefined;
|
|
15
15
|
export declare function getThinking(): ThinkingConfig | undefined;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { SkillInvocation } from '../preflight/index.js';
|
|
2
|
+
import type { SlashContext } from '../types.js';
|
|
3
|
+
export declare function invokeSkillPreflight(skillName: string, rawArgs: string, source: SkillInvocation['source'], ctx: SlashContext): Promise<string | undefined>;
|