agent-afk 5.85.8 → 5.85.10
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/tools/fs-case.d.ts +4 -0
- package/dist/cli/commands/interactive/bootstrap-config.d.ts +21 -0
- package/dist/cli/commands/interactive/bootstrap-hooks.d.ts +17 -0
- package/dist/cli/commands/interactive/bootstrap-infra.d.ts +31 -0
- package/dist/cli/commands/interactive/bootstrap-mcp.d.ts +8 -0
- package/dist/cli/commands/interactive/bootstrap-providers.d.ts +21 -0
- package/dist/cli/commands/interactive/bootstrap-session-builder.d.ts +44 -0
- package/dist/cli/commands/interactive/bootstrap-slash-context.d.ts +19 -0
- package/dist/cli/commands/interactive/bootstrap-surface.d.ts +30 -0
- package/dist/cli/commands/interactive/bootstrap-wiring.d.ts +15 -0
- package/dist/cli/commands/interactive/bootstrap.d.ts +1 -27
- package/dist/cli.mjs +551 -551
- package/dist/index.mjs +168 -168
- package/dist/telegram.mjs +217 -217
- package/package.json +1 -1
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function isCaseInsensitiveFs(protectedPath?: string): boolean;
|
|
2
|
+
export declare function pathIsWithin(real: string, blocked: string, protectedPath?: string): boolean;
|
|
3
|
+
export declare function textMentionsPath(haystack: string, needle: string): boolean;
|
|
4
|
+
export declare function _resetFsCaseCacheForTests(value?: boolean): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ThinkingConfig, EffortLevel, AgentConfig } from '../../../agent/types.js';
|
|
2
|
+
import { type CliConfig } from '../../config.js';
|
|
3
|
+
import type { CliOptions } from './shared.js';
|
|
4
|
+
import type { ResolvedResumeTarget } from '../../resume-session.js';
|
|
5
|
+
export interface BootstrapConfig {
|
|
6
|
+
resumeTarget: ResolvedResumeTarget | undefined;
|
|
7
|
+
resumeConfig: Partial<AgentConfig>;
|
|
8
|
+
effectiveCwd: string | undefined;
|
|
9
|
+
sessionModel: string;
|
|
10
|
+
thinking: ThinkingConfig | undefined;
|
|
11
|
+
effort: EffortLevel | undefined;
|
|
12
|
+
maxOutputTokens: number | undefined;
|
|
13
|
+
maxToolUseIterations: number | undefined;
|
|
14
|
+
basePrompt: string | undefined;
|
|
15
|
+
systemPrompt: string | undefined;
|
|
16
|
+
systemPromptSource: string | undefined;
|
|
17
|
+
cliConfig: CliConfig;
|
|
18
|
+
}
|
|
19
|
+
export declare function resolveBootstrapConfig(options: CliOptions, extras?: {
|
|
20
|
+
cwd?: string;
|
|
21
|
+
}): BootstrapConfig;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { HookRegistry } from '../../../agent/hooks.js';
|
|
2
|
+
import type { MemoryStore } from '../../../agent/memory/index.js';
|
|
3
|
+
import type { TraceWriter } from '../../../agent/trace/index.js';
|
|
4
|
+
import type { SessionStats } from '../../slash/types.js';
|
|
5
|
+
import type { CompletionWriter } from './shared.js';
|
|
6
|
+
export declare function createReplHookRegistry(a: {
|
|
7
|
+
completionWriter: CompletionWriter;
|
|
8
|
+
memoryStore: MemoryStore;
|
|
9
|
+
stats: SessionStats;
|
|
10
|
+
effectiveCwd: string | undefined;
|
|
11
|
+
traceWriter: TraceWriter | undefined;
|
|
12
|
+
}): {
|
|
13
|
+
hookRegistry: HookRegistry;
|
|
14
|
+
pathApprovalGrantRef: {
|
|
15
|
+
current: unknown;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { SessionRef } from '../../../agent/session-ref.js';
|
|
2
|
+
import type { CliConfig } from '../../config.js';
|
|
3
|
+
import type { SubagentExecutor } from '../../../agent/tools/subagent-executor.js';
|
|
4
|
+
import type { SkillExecutor } from '../../../agent/tools/skill-executor.js';
|
|
5
|
+
import type { ComposeExecutor } from '../../../agent/tools/compose-executor.js';
|
|
6
|
+
import type { SubagentManager } from '../../../agent/subagent.js';
|
|
7
|
+
import { BackgroundAgentRegistry } from '../../../agent/background-registry.js';
|
|
8
|
+
import { BackgroundSummarizer } from '../../../agent/background-summarizer.js';
|
|
9
|
+
import { createDefaultTraceWriter } from '../../../agent/trace/factory.js';
|
|
10
|
+
import type { ResolvedResumeTarget } from '../../resume-session.js';
|
|
11
|
+
import type { CliOptions } from './shared.js';
|
|
12
|
+
export interface BootstrapInfra {
|
|
13
|
+
trace: ReturnType<typeof createDefaultTraceWriter>;
|
|
14
|
+
apiKey: string | undefined;
|
|
15
|
+
backgroundRegistry: BackgroundAgentRegistry;
|
|
16
|
+
bgSummarizer: BackgroundSummarizer | undefined;
|
|
17
|
+
rootManager: SubagentManager;
|
|
18
|
+
subagentExecutor: SubagentExecutor;
|
|
19
|
+
skillExecutor: SkillExecutor;
|
|
20
|
+
composeExecutor: ComposeExecutor;
|
|
21
|
+
}
|
|
22
|
+
export declare function createBootstrapInfra(a: {
|
|
23
|
+
sessionRef: SessionRef;
|
|
24
|
+
options: CliOptions;
|
|
25
|
+
cliConfig: CliConfig;
|
|
26
|
+
sessionModel: string;
|
|
27
|
+
basePrompt: string | undefined;
|
|
28
|
+
effectiveCwd: string | undefined;
|
|
29
|
+
resumeTarget: ResolvedResumeTarget | undefined;
|
|
30
|
+
bootWarnings: string[];
|
|
31
|
+
}): BootstrapInfra;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { McpManager } from '../../../agent/mcp/index.js';
|
|
2
|
+
import type { TraceWriter } from '../../../agent/trace/index.js';
|
|
3
|
+
export declare function connectReplMcp(a: {
|
|
4
|
+
effectiveCwd: string | undefined;
|
|
5
|
+
mcpConfigOverride: string | undefined;
|
|
6
|
+
traceWriter: TraceWriter | undefined;
|
|
7
|
+
bootWarnings: string[];
|
|
8
|
+
}): Promise<McpManager | undefined>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ModelProvider } from '../../../agent/provider.js';
|
|
2
|
+
import type { MemoryStore } from '../../../agent/memory/index.js';
|
|
3
|
+
import type { SubagentExecutor } from '../../../agent/tools/subagent-executor.js';
|
|
4
|
+
import type { SkillExecutor } from '../../../agent/tools/skill-executor.js';
|
|
5
|
+
import type { ComposeExecutor } from '../../../agent/tools/compose-executor.js';
|
|
6
|
+
import type { McpManager } from '../../../agent/mcp/index.js';
|
|
7
|
+
import type { CliConfig } from '../../config.js';
|
|
8
|
+
import type { CliOptions } from './shared.js';
|
|
9
|
+
export declare function createReplProviders(a: {
|
|
10
|
+
options: CliOptions;
|
|
11
|
+
cliConfig: CliConfig;
|
|
12
|
+
sessionModel: string;
|
|
13
|
+
subagentExecutor: SubagentExecutor;
|
|
14
|
+
skillExecutor: SkillExecutor;
|
|
15
|
+
composeExecutor: ComposeExecutor;
|
|
16
|
+
memoryStore: MemoryStore;
|
|
17
|
+
mcpManager: McpManager | undefined;
|
|
18
|
+
}): {
|
|
19
|
+
providerFactory: (m: string | undefined) => ModelProvider;
|
|
20
|
+
startupProvider: ModelProvider;
|
|
21
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { AgentSession } from '../../../agent/session.js';
|
|
2
|
+
import type { PermissionMode } from '../../../agent/types/sdk-types.js';
|
|
3
|
+
import type { ThinkingConfig, EffortLevel } from '../../../agent/types.js';
|
|
4
|
+
import type { AgentConfig } from '../../../agent/types.js';
|
|
5
|
+
import type { ModelProvider } from '../../../agent/provider.js';
|
|
6
|
+
import type { HookRegistry } from '../../../agent/hooks.js';
|
|
7
|
+
import type { TraceWriter } from '../../../agent/trace/index.js';
|
|
8
|
+
import type { CliConfig } from '../../config.js';
|
|
9
|
+
export interface BuildAgentSessionDeps {
|
|
10
|
+
model: string;
|
|
11
|
+
resumeConfig: Partial<AgentConfig>;
|
|
12
|
+
systemPrompt: string | undefined;
|
|
13
|
+
systemPromptSource: string | undefined;
|
|
14
|
+
thinking: ThinkingConfig | undefined;
|
|
15
|
+
effort: EffortLevel | undefined;
|
|
16
|
+
maxOutputTokens: number | undefined;
|
|
17
|
+
maxToolUseIterations: number | undefined;
|
|
18
|
+
providerFactory: (model: string | undefined) => ModelProvider;
|
|
19
|
+
hookRegistry: HookRegistry;
|
|
20
|
+
traceWriter: TraceWriter | undefined;
|
|
21
|
+
cwd: string | undefined;
|
|
22
|
+
maxTurns: number;
|
|
23
|
+
autoResumeOnUsageLimit: boolean | undefined;
|
|
24
|
+
permissionMode?: PermissionMode;
|
|
25
|
+
baseUrl?: string;
|
|
26
|
+
}
|
|
27
|
+
export declare function buildAgentSession(deps: BuildAgentSessionDeps): AgentSession;
|
|
28
|
+
export declare function buildSharedDeps(a: {
|
|
29
|
+
sessionModel: string;
|
|
30
|
+
resumeConfig: Partial<AgentConfig>;
|
|
31
|
+
systemPrompt: string | undefined;
|
|
32
|
+
systemPromptSource: string | undefined;
|
|
33
|
+
thinking: ThinkingConfig | undefined;
|
|
34
|
+
effort: EffortLevel | undefined;
|
|
35
|
+
maxOutputTokens: number | undefined;
|
|
36
|
+
maxToolUseIterations: number | undefined;
|
|
37
|
+
cliConfig: CliConfig;
|
|
38
|
+
providerFactory: (m: string | undefined) => ModelProvider;
|
|
39
|
+
hookRegistry: HookRegistry;
|
|
40
|
+
traceWriter: TraceWriter | undefined;
|
|
41
|
+
effectiveCwd: string | undefined;
|
|
42
|
+
maxTurns: string;
|
|
43
|
+
initialPermissionMode: PermissionMode | undefined;
|
|
44
|
+
}): BuildAgentSessionDeps;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { SlashContext } from '../../slash/types.js';
|
|
2
|
+
import type { SessionRef } from '../../../agent/session-ref.js';
|
|
3
|
+
import type { SessionStats } from '../../slash/types.js';
|
|
4
|
+
import type { StatusLine } from '../../status-line.js';
|
|
5
|
+
import type { ContextSampler } from '../../context-sampler.js';
|
|
6
|
+
import type { GitStatusSampler } from '../../git-status-sampler.js';
|
|
7
|
+
import type { TrustedSkillLedger } from '../../trusted-skill-ledger.js';
|
|
8
|
+
import type { McpManager } from '../../../agent/mcp/index.js';
|
|
9
|
+
import type { createConsoleWriter } from '../../slash/writer.js';
|
|
10
|
+
export declare function createReplSlashContext(a: {
|
|
11
|
+
sessionRef: SessionRef;
|
|
12
|
+
stats: SessionStats;
|
|
13
|
+
writer: ReturnType<typeof createConsoleWriter>;
|
|
14
|
+
statusLine: StatusLine;
|
|
15
|
+
contextSampler: ContextSampler;
|
|
16
|
+
gitStatusSampler: GitStatusSampler;
|
|
17
|
+
ledger: TrustedSkillLedger;
|
|
18
|
+
mcpManager: McpManager | undefined;
|
|
19
|
+
}): SlashContext;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { StatusLine } from '../../status-line.js';
|
|
2
|
+
import { GitStatusSampler } from '../../git-status-sampler.js';
|
|
3
|
+
import { createConsoleWriter } from '../../slash/writer.js';
|
|
4
|
+
import type { SessionStats } from '../../slash/types.js';
|
|
5
|
+
import type { PermissionMode } from '../../../agent/types/sdk-types.js';
|
|
6
|
+
import type { CompletionWriter } from './shared.js';
|
|
7
|
+
import { createReplRenderer } from './repl-renderer.js';
|
|
8
|
+
import { TrustedSkillLedger } from '../../trusted-skill-ledger.js';
|
|
9
|
+
import type { CliConfig } from '../../config.js';
|
|
10
|
+
import type { CliOptions } from './shared.js';
|
|
11
|
+
import type { ResolvedResumeTarget } from '../../resume-session.js';
|
|
12
|
+
import { createDefaultTraceWriter } from '../../../agent/trace/factory.js';
|
|
13
|
+
export declare function createReplSurface(a: {
|
|
14
|
+
options: CliOptions;
|
|
15
|
+
cliConfig: CliConfig;
|
|
16
|
+
sessionModel: string;
|
|
17
|
+
resumeTarget: ResolvedResumeTarget | undefined;
|
|
18
|
+
effectiveCwd: string | undefined;
|
|
19
|
+
extrasCwd: string | undefined;
|
|
20
|
+
trace: ReturnType<typeof createDefaultTraceWriter>;
|
|
21
|
+
}): {
|
|
22
|
+
stats: SessionStats;
|
|
23
|
+
initialPermissionMode: PermissionMode | undefined;
|
|
24
|
+
completionWriter: CompletionWriter;
|
|
25
|
+
statusLine: StatusLine;
|
|
26
|
+
replRenderer: ReturnType<typeof createReplRenderer>;
|
|
27
|
+
writer: ReturnType<typeof createConsoleWriter>;
|
|
28
|
+
trustedSkillLedger: TrustedSkillLedger;
|
|
29
|
+
gitStatusSampler: GitStatusSampler;
|
|
30
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as readline from 'node:readline';
|
|
2
|
+
import type { ModelProvider } from '../../../agent/provider.js';
|
|
3
|
+
import type { CompletionWriter } from './shared.js';
|
|
4
|
+
import { TrustedSkillLedger } from '../../trusted-skill-ledger.js';
|
|
5
|
+
import type { InputSurface } from '../../input/input-surface.js';
|
|
6
|
+
export declare function wireTrustedSkillEvents(completionWriter: CompletionWriter, ledger: TrustedSkillLedger): () => void;
|
|
7
|
+
export declare function wireProviderGrants(startupProvider: ModelProvider, pathApprovalGrantRef: {
|
|
8
|
+
current: unknown;
|
|
9
|
+
}): void;
|
|
10
|
+
export declare function createReplInput(): {
|
|
11
|
+
rl: readline.Interface;
|
|
12
|
+
inputSurfaceRef: {
|
|
13
|
+
current: InputSurface | null;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -1,32 +1,6 @@
|
|
|
1
|
-
import { AgentSession } from '../../../agent/session.js';
|
|
2
|
-
import type { PermissionMode } from '../../../agent/types/sdk-types.js';
|
|
3
|
-
import type { ThinkingConfig, EffortLevel } from '../../../agent/types.js';
|
|
4
|
-
import type { AgentConfig } from '../../../agent/types.js';
|
|
5
|
-
import type { ModelProvider } from '../../../agent/provider.js';
|
|
6
|
-
import type { HookRegistry } from '../../../agent/hooks.js';
|
|
7
|
-
import type { TraceWriter } from '../../../agent/trace/index.js';
|
|
8
1
|
import type { CliOptions, InteractiveCtx } from './shared.js';
|
|
9
|
-
|
|
10
|
-
model: string;
|
|
11
|
-
resumeConfig: Partial<AgentConfig>;
|
|
12
|
-
systemPrompt: string | undefined;
|
|
13
|
-
systemPromptSource: string | undefined;
|
|
14
|
-
thinking: ThinkingConfig | undefined;
|
|
15
|
-
effort: EffortLevel | undefined;
|
|
16
|
-
maxOutputTokens: number | undefined;
|
|
17
|
-
maxToolUseIterations: number | undefined;
|
|
18
|
-
providerFactory: (model: string | undefined) => ModelProvider;
|
|
19
|
-
hookRegistry: HookRegistry;
|
|
20
|
-
traceWriter: TraceWriter | undefined;
|
|
21
|
-
cwd: string | undefined;
|
|
22
|
-
maxTurns: number;
|
|
23
|
-
autoResumeOnUsageLimit: boolean | undefined;
|
|
24
|
-
permissionMode?: PermissionMode;
|
|
25
|
-
baseUrl?: string;
|
|
26
|
-
}
|
|
27
|
-
export declare function buildAgentSession(deps: BuildAgentSessionDeps): AgentSession;
|
|
2
|
+
export { buildAgentSession } from './bootstrap-session-builder.js';
|
|
28
3
|
export declare function bootstrapSession(options: CliOptions, extras?: {
|
|
29
4
|
cwd?: string;
|
|
30
5
|
bootWarnings?: string[];
|
|
31
6
|
}): Promise<InteractiveCtx>;
|
|
32
|
-
export {};
|