agent-afk 5.360.0 → 6.1.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.
- package/README.md +12 -7
- package/dist/agent/background-summarizer.d.ts +0 -2
- package/dist/agent/daemon/failure-streak-threshold.d.ts +14 -0
- package/dist/agent/daemon/schedule-store.d.ts +3 -1
- package/dist/agent/daemon/scheduler.d.ts +11 -3
- package/dist/agent/daemon/scheduler.execute-agent-task.d.ts +1 -2
- package/dist/agent/daemon/scheduler.failure-streak.d.ts +37 -0
- package/dist/agent/daemon/scheduler.notification.d.ts +23 -0
- package/dist/agent/daemon/scheduler.pull-tick.d.ts +3 -1
- package/dist/agent/daemon/scheduler.streak-history.d.ts +19 -0
- package/dist/agent/daemon/scheduler.telemetry.d.ts +5 -0
- package/dist/agent/daemon/session-spawn.d.ts +0 -2
- package/dist/agent/daemon/triggers.d.ts +1 -0
- package/dist/agent/daemon.shell-trust.d.ts +17 -0
- package/dist/agent/default-hook-registry.d.ts +0 -2
- package/dist/agent/lsp/client.d.ts +2 -0
- package/dist/agent/lsp/crash-loop-guard.d.ts +21 -0
- package/dist/agent/lsp/pool.d.ts +3 -0
- package/dist/agent/session/ledger-lifecycle.d.ts +2 -0
- package/dist/agent/session/prompt-dump.d.ts +1 -0
- package/dist/agent/session/session-send.d.ts +1 -1
- package/dist/agent/session/turn-stream-runner.abandoned-turn.d.ts +59 -0
- package/dist/agent/session/turn-stream-runner.d.ts +8 -1
- package/dist/agent/session/turn-stream-runner.fatal-done.d.ts +1 -0
- package/dist/agent/session/wire-executors.d.ts +2 -1
- package/dist/agent/subagent/continuation-guards.d.ts +4 -2
- package/dist/agent/subagent/fork-child-config.d.ts +1 -0
- package/dist/agent/subagent/identity-preamble.d.ts +2 -1
- package/dist/agent/subagent/identity-preamble.worktree.d.ts +1 -1
- package/dist/agent/terminal-state-gate.d.ts +0 -2
- package/dist/agent/timeout.d.ts +2 -0
- package/dist/agent/tools/compose-executor.context.d.ts +2 -1
- package/dist/agent/tools/compose-node-provider.d.ts +1 -0
- package/dist/agent/tools/dispatcher.pre-dispatch-gates.can-use-tool.d.ts +3 -0
- package/dist/agent/tools/dispatcher.pre-dispatch-gates.d.ts +1 -0
- package/dist/agent/tools/handlers/git-read.exec-guard.d.ts +14 -0
- package/dist/agent/tools/nesting.can-use-tool.d.ts +38 -0
- package/dist/agent/tools/nesting.d.ts +6 -5
- package/dist/agent/tools/subagent-executor.execute-once.fork-gate.d.ts +2 -0
- package/dist/agent/types/sdk-types.d.ts +1 -1
- package/dist/agent/types/session-types.d.ts +1 -1
- package/dist/browser/sanitize.d.ts +0 -1
- package/dist/bundled-plugins/awa-bundled/skills/ship/SKILL.md +7 -2
- package/dist/cli/auth-wizard.check.d.ts +4 -0
- package/dist/cli/auth-wizard.daemon.d.ts +1 -0
- package/dist/cli/auth-wizard.guided.d.ts +2 -0
- package/dist/cli/auth-wizard.prompt.d.ts +1 -0
- package/dist/cli/commands/acp.d.ts +1 -0
- package/dist/cli/commands/acp.diff.d.ts +3 -0
- package/dist/cli/commands/acp.handlers.d.ts +39 -0
- package/dist/cli/commands/acp.lines.d.ts +10 -0
- package/dist/cli/commands/acp.params.d.ts +17 -0
- package/dist/cli/commands/acp.permission.d.ts +7 -0
- package/dist/cli/commands/acp.permission.git.d.ts +2 -0
- package/dist/cli/commands/acp.permission.grants.d.ts +5 -0
- package/dist/cli/commands/acp.permission.labels.d.ts +5 -0
- package/dist/cli/commands/acp.permission.paths.d.ts +7 -0
- package/dist/cli/commands/acp.permission.policy.d.ts +7 -0
- package/dist/cli/commands/acp.permission.realpath.d.ts +7 -0
- package/dist/cli/commands/acp.permission.sensitive.d.ts +6 -0
- package/dist/cli/commands/acp.prompt-turn.d.ts +30 -0
- package/dist/cli/commands/acp.replay.d.ts +4 -0
- package/dist/cli/commands/acp.rpc-peer.d.ts +7 -0
- package/dist/cli/commands/acp.server.console.d.ts +2 -0
- package/dist/cli/commands/acp.server.d.ts +5 -2
- package/dist/cli/commands/acp.server.protocol.d.ts +23 -39
- package/dist/cli/commands/acp.session-load.d.ts +7 -0
- package/dist/cli/commands/acp.session-map.d.ts +9 -0
- package/dist/cli/commands/acp.session-record.d.ts +5 -0
- package/dist/cli/commands/acp.session.d.ts +11 -0
- package/dist/cli/commands/acp.session.mcp.d.ts +4 -0
- package/dist/cli/commands/acp.session.prompt.d.ts +6 -0
- package/dist/cli/commands/acp.session.provider.d.ts +2 -0
- package/dist/cli/commands/acp.session.resources.d.ts +12 -0
- package/dist/cli/commands/acp.tool-kind.d.ts +4 -0
- package/dist/cli/commands/acp.tool-title.d.ts +6 -0
- package/dist/cli/commands/acp.translate.bounds.d.ts +9 -0
- package/dist/cli/commands/acp.translate.d.ts +5 -0
- package/dist/cli/commands/acp.translate.paths.d.ts +3 -0
- package/dist/cli/commands/acp.translate.terminal.d.ts +5 -0
- package/dist/cli/commands/acp.wire.d.ts +266 -0
- package/dist/cli/commands/daemon.action.d.ts +2 -0
- package/dist/cli/commands/doctor-checks.subsystem.d.ts +3 -0
- package/dist/cli/commands/schedule.health.d.ts +4 -0
- package/dist/cli/config/permission-mode-warning.d.ts +5 -0
- package/dist/cli/permission-mode-cycle.d.ts +1 -1
- package/dist/cli/provider-parser.d.ts +1 -0
- package/dist/cli/render/status-line-format.d.ts +0 -2
- package/dist/cli/wrap.d.ts +1 -0
- package/dist/cli.mjs +640 -634
- package/dist/index.mjs +432 -433
- package/dist/paths.d.ts +1 -1
- package/dist/paths.journal.d.ts +2 -0
- package/dist/remote/remote-subagent-handle.d.ts +1 -0
- package/dist/skills/mint/_phases/child-gate.d.ts +10 -0
- package/dist/skills/skill-types.d.ts +2 -0
- package/dist/telegram/bot.d.ts +0 -5
- package/dist/telegram.mjs +452 -459
- package/dist/web-server/session-owner.d.ts +1 -0
- package/dist/web-server/session-owner.provider.d.ts +18 -0
- package/dist/web-server/session-owner.wiring.d.ts +2 -1
- package/dist/web-server/shared/ledger-adapter.d.ts +1 -0
- package/dist/web-ui-assets/assets/{angular-html-D3r_OvVu.js → angular-html-C85Dugk9.js} +1 -1
- package/dist/web-ui-assets/assets/{angular-ts-CYYKmYCY.js → angular-ts-kYjKxpAq.js} +1 -1
- package/dist/web-ui-assets/assets/{apl-Qebclc6H.js → apl-H6xD6R6W.js} +1 -1
- package/dist/web-ui-assets/assets/{astro-EC7rA9tr.js → astro-DQe_HbEs.js} +1 -1
- package/dist/web-ui-assets/assets/{blade-3LEHciyw.js → blade-4-tvsLmi.js} +1 -1
- package/dist/web-ui-assets/assets/{c-BMHvDp3M.js → c-gik9xvSm.js} +1 -1
- package/dist/web-ui-assets/assets/{chapel-DIdY1czS.js → chapel-CNhK8GmZ.js} +1 -1
- package/dist/web-ui-assets/assets/{cobol-B4veGjea.js → cobol-CFRrQwTf.js} +1 -1
- package/dist/web-ui-assets/assets/{coffee-CTW65drd.js → coffee-CIS9zt6C.js} +1 -1
- package/dist/web-ui-assets/assets/{cpp-UFv8IcpT.js → cpp-BJGKcaQ2.js} +1 -1
- package/dist/web-ui-assets/assets/{crystal-CAl2astP.js → crystal-DrshRrYd.js} +1 -1
- package/dist/web-ui-assets/assets/{css-W4FP-8b5.js → css-RSoGQ9CU.js} +1 -1
- package/dist/web-ui-assets/assets/{dist-CL6azZY0.js → dist-CJdV1FJY.js} +2 -2
- package/dist/web-ui-assets/assets/{edge-BHV7W1lD.js → edge-D5Mh5hW4.js} +1 -1
- package/dist/web-ui-assets/assets/{elixir-BSeMK1dJ.js → elixir-CVxXxJNz.js} +1 -1
- package/dist/web-ui-assets/assets/{elm-DBbEnhG_.js → elm-Dlo4E_41.js} +1 -1
- package/dist/web-ui-assets/assets/{erb-prErkLIh.js → erb-ByL9xu2F.js} +1 -1
- package/dist/web-ui-assets/assets/{git-rebase-C2YnmdYZ.js → git-rebase-OuLy99Ny.js} +1 -1
- package/dist/web-ui-assets/assets/{glimmer-js-UE5yPqqs.js → glimmer-js-BNMbvc5A.js} +1 -1
- package/dist/web-ui-assets/assets/{glimmer-ts-CHUC7ee4.js → glimmer-ts-LWNvX4Gj.js} +1 -1
- package/dist/web-ui-assets/assets/{glsl-BP7hWcQl.js → glsl-DZr3GrVI.js} +1 -1
- package/dist/web-ui-assets/assets/{graphql-B2mDXSlF.js → graphql-CI8lFP8J.js} +1 -1
- package/dist/web-ui-assets/assets/{hack-CYmItAIT.js → hack-tDxt7H8D.js} +1 -1
- package/dist/web-ui-assets/assets/{haml-BE55kcBt.js → haml-DkI1Wtrk.js} +1 -1
- package/dist/web-ui-assets/assets/{handlebars-HqWAfmn0.js → handlebars-CRsZz40e.js} +1 -1
- package/dist/web-ui-assets/assets/{html-DQqmUNra.js → html-BIypIehr.js} +1 -1
- package/dist/web-ui-assets/assets/{html-derivative-DHtOwb02.js → html-derivative-rr2iMJpd.js} +1 -1
- package/dist/web-ui-assets/assets/{http-qsOPQWSh.js → http-D6S54Bbx.js} +1 -1
- package/dist/web-ui-assets/assets/{hurl-CLG0zR7e.js → hurl-BSshBRHD.js} +1 -1
- package/dist/web-ui-assets/assets/index-DxbrAlfz.js +94 -0
- package/dist/web-ui-assets/assets/{java-CIoYCZPE.js → java-EtJoHQZR.js} +1 -1
- package/dist/web-ui-assets/assets/{javascript-BiSgC3HH.js → javascript-CLpqmXE0.js} +1 -1
- package/dist/web-ui-assets/assets/{jinja-uoMhNXH1.js → jinja-PA6irl9u.js} +1 -1
- package/dist/web-ui-assets/assets/{jison-62dtSwty.js → jison-DxqwpCqh.js} +1 -1
- package/dist/web-ui-assets/assets/{json-Cxps7Vp_.js → json-B6fuMtpU.js} +1 -1
- package/dist/web-ui-assets/assets/{jsx-i4FhzmZ3.js → jsx-BJyOE1yn.js} +1 -1
- package/dist/web-ui-assets/assets/{julia-4eQbL51O.js → julia-DHqh2B7-.js} +1 -1
- package/dist/web-ui-assets/assets/{just-DuzaqAD6.js → just-CSPu2IZ4.js} +1 -1
- package/dist/web-ui-assets/assets/{latex-DR1YiBEA.js → latex-1lJzG2hL.js} +1 -1
- package/dist/web-ui-assets/assets/{liquid-BCJgC6HS.js → liquid-D9Ciy6uZ.js} +1 -1
- package/dist/web-ui-assets/assets/{lua-BC4drQZp.js → lua-CFjUSwQg.js} +1 -1
- package/dist/web-ui-assets/assets/{marko-DtJIqB68.js → marko-CfzAx6nq.js} +1 -1
- package/dist/web-ui-assets/assets/{mdc-CYBfAC3q.js → mdc-CJ7N65mG.js} +1 -1
- package/dist/web-ui-assets/assets/{nginx-CMR593MB.js → nginx-BMoA9yN9.js} +1 -1
- package/dist/web-ui-assets/assets/{nim-BbUeXd8c.js → nim-BDzXDiN9.js} +1 -1
- package/dist/web-ui-assets/assets/{org-oHqhaY5K.js → org-DqkXzdx7.js} +1 -1
- package/dist/web-ui-assets/assets/{perl-DE4Fx5iS.js → perl-BfDhtEbl.js} +1 -1
- package/dist/web-ui-assets/assets/{php-rh-d5On6.js → php-CG-iT0bZ.js} +1 -1
- package/dist/web-ui-assets/assets/{pug-8Ni7Ix1b.js → pug-CwR1_59V.js} +1 -1
- package/dist/web-ui-assets/assets/{qml-CrGNXQfX.js → qml-CSHgad12.js} +1 -1
- package/dist/web-ui-assets/assets/{r-BiZL36Lf.js → r-DIjvsd-X.js} +1 -1
- package/dist/web-ui-assets/assets/{razor-DnQFAjmg.js → razor-Dr-UE982.js} +1 -1
- package/dist/web-ui-assets/assets/{regexp-ZehcoqOu.js → regexp-CNiPgECb.js} +1 -1
- package/dist/web-ui-assets/assets/{rst-BHnIys2E.js → rst-BFhRD-Dc.js} +1 -1
- package/dist/web-ui-assets/assets/{ruby-CQjEBqXf.js → ruby-6gDBsBPK.js} +1 -1
- package/dist/web-ui-assets/assets/{sas-DDw_qWwd.js → sas-BH8HGnTp.js} +1 -1
- package/dist/web-ui-assets/assets/{scss-Buc-D2q0.js → scss-DHyUaYhk.js} +1 -1
- package/dist/web-ui-assets/assets/{shellscript-DSdjoUZi.js → shellscript-C6y3E5Sv.js} +1 -1
- package/dist/web-ui-assets/assets/{shellsession-Dlf5ZOd7.js → shellsession-DHS7GsE9.js} +1 -1
- package/dist/web-ui-assets/assets/{soy-BtqthtDI.js → soy-C2tuyyR2.js} +1 -1
- package/dist/web-ui-assets/assets/{sql-Wbs3a-2M.js → sql-DccA9zc6.js} +1 -1
- package/dist/web-ui-assets/assets/{stata-CZQadxtE.js → stata-CSDjFjIS.js} +1 -1
- package/dist/web-ui-assets/assets/{surrealql-BHX1_keB.js → surrealql-Deemb84V.js} +1 -1
- package/dist/web-ui-assets/assets/{svelte-5Gzb7jP2.js → svelte-Di-dGYfQ.js} +1 -1
- package/dist/web-ui-assets/assets/{templ-6-2sxD2t.js → templ-nltc8MkE.js} +1 -1
- package/dist/web-ui-assets/assets/{tex-s7OSL_QU.js → tex-CCk-q3gk.js} +1 -1
- package/dist/web-ui-assets/assets/{ts-tags-ILSDF7eF.js → ts-tags-BTslhx07.js} +1 -1
- package/dist/web-ui-assets/assets/{tsx-Ba3RCOh1.js → tsx-DTO7ESyr.js} +1 -1
- package/dist/web-ui-assets/assets/{twig-B5Q27p1D.js → twig-12YiESYn.js} +1 -1
- package/dist/web-ui-assets/assets/{typescript-BGZwH6By.js → typescript-DomHOzpY.js} +1 -1
- package/dist/web-ui-assets/assets/{typst-BNUBq5yx.js → typst-DnLdDQm5.js} +1 -1
- package/dist/web-ui-assets/assets/{vue-BWxalE-A.js → vue-BNvjzHNk.js} +1 -1
- package/dist/web-ui-assets/assets/{vue-html-Czl3_Xc-.js → vue-html-C0QzS-K2.js} +1 -1
- package/dist/web-ui-assets/assets/{vue-vine-DbFJFkgw.js → vue-vine-BeCf67d3.js} +1 -1
- package/dist/web-ui-assets/assets/{xml-_-I97g00.js → xml-_WZueolK.js} +1 -1
- package/dist/web-ui-assets/assets/{xsl-BS-NWXy1.js → xsl-CmPrFugX.js} +1 -1
- package/dist/web-ui-assets/assets/{yaml-Dru6aRB_.js → yaml-C74a4W5w.js} +1 -1
- package/dist/web-ui-assets/index.html +1 -1
- package/package.json +1 -1
- package/dist/agent/afk-mode-gate.d.ts +0 -17
- package/dist/agent/afk-mode-rm-allowlist.d.ts +0 -1
- package/dist/agent/daemon/scheduler-gate-recovery.d.ts +0 -20
- package/dist/agent/providers/anthropic-direct/afk-mode-addendum.d.ts +0 -1
- package/dist/agent/providers/shared/afk-mode-addendum.d.ts +0 -3
- package/dist/agent/redact-secrets.d.ts +0 -2
- package/dist/agent/trace/block-evasion-analyzer.d.ts +0 -48
- package/dist/cli/afk-mode-toggle.d.ts +0 -2
- package/dist/cli/slash/commands/afk.d.ts +0 -2
- package/dist/telegram/handlers/afk.d.ts +0 -5
- package/dist/web-ui-assets/assets/index-CrFMdDLW.js +0 -94
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const MAX_FILTER_DRIVERS = 256;
|
|
2
|
+
export declare const GIT_READ_NO_HOOKS_PATH: string;
|
|
3
|
+
export declare const GIT_READ_EXEC_GUARD_ARGS: readonly string[];
|
|
4
|
+
export declare function guardSubmoduleArgv(argv: readonly string[]): string[];
|
|
5
|
+
export type FilterDriverParse = {
|
|
6
|
+
ok: true;
|
|
7
|
+
names: string[];
|
|
8
|
+
} | {
|
|
9
|
+
ok: false;
|
|
10
|
+
error: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function parseFilterDrivers(stdout: string): FilterDriverParse;
|
|
13
|
+
export declare function filterNeutralisingEnv(names: readonly string[]): Record<string, string>;
|
|
14
|
+
export declare function enumerateFilterDrivers(globalArgs: readonly string[], cwd: string, env: Record<string, string | undefined>, signal: AbortSignal): Promise<FilterDriverParse>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { CanUseTool } from '../types.js';
|
|
2
|
+
export type ChildToolRoute = 'agent' | 'skill' | 'compose';
|
|
3
|
+
export interface ChildToolOrigin {
|
|
4
|
+
route: ChildToolRoute;
|
|
5
|
+
depth: number;
|
|
6
|
+
agentType?: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
cwd?: string;
|
|
9
|
+
}
|
|
10
|
+
export type ChildCanUseToolFactory = (origin: ChildToolOrigin) => CanUseTool | undefined;
|
|
11
|
+
export interface ChildGateOptions {
|
|
12
|
+
childCanUseTool?: ChildCanUseToolFactory;
|
|
13
|
+
}
|
|
14
|
+
export interface ChildGateArgs {
|
|
15
|
+
origin?: ChildToolOrigin;
|
|
16
|
+
}
|
|
17
|
+
export declare function skillChildOrigin(depth: number, skillName: string | undefined, cwd?: string): ChildToolOrigin;
|
|
18
|
+
export declare function agentChildOrigin(depth: number, agentType: string | undefined, label: string | undefined, cwd?: string): ChildToolOrigin;
|
|
19
|
+
export declare function childGateOpt(factory: ChildCanUseToolFactory | undefined, origin: ChildToolOrigin | undefined): {
|
|
20
|
+
canUseTool: CanUseTool;
|
|
21
|
+
} | Record<string, never>;
|
|
22
|
+
export declare function chainCanUseTool(first: CanUseTool | undefined, second: CanUseTool | undefined): CanUseTool | undefined;
|
|
23
|
+
export declare function composeNodeGated<R extends object>(restrictions: R, factory: ChildCanUseToolFactory | undefined, node: {
|
|
24
|
+
id: string;
|
|
25
|
+
agent_type?: string | undefined;
|
|
26
|
+
}, composeDepth: number, cwd?: string): R | (R & {
|
|
27
|
+
surfaceGate: CanUseTool;
|
|
28
|
+
});
|
|
29
|
+
export declare function attachChildGate<F extends object>(providerFactory: F, gate: ChildCanUseToolFactory | undefined): F;
|
|
30
|
+
export declare function childGateOf(providerFactory: object | undefined): ChildCanUseToolFactory | undefined;
|
|
31
|
+
export declare function inlineSkillChildGate(factory: ChildCanUseToolFactory | undefined, childDepth: number, cwd?: string): ((agentType: string) => CanUseTool | undefined) | undefined;
|
|
32
|
+
export declare function forkConfigGate(gate: ((agentType: string) => CanUseTool | undefined) | undefined, agentType: string, own?: CanUseTool): {
|
|
33
|
+
canUseTool: CanUseTool;
|
|
34
|
+
} | Record<string, never>;
|
|
35
|
+
export declare function childGateFor(providerFactory: object | undefined, origin: ChildToolOrigin): CanUseTool | undefined;
|
|
36
|
+
export declare function inlineChildGateOpt(providerFactory: object | undefined, childDepth: number, cwd?: string): {
|
|
37
|
+
childGate: (agentType: string) => CanUseTool | undefined;
|
|
38
|
+
} | Record<string, never>;
|
|
@@ -12,10 +12,11 @@ import type { BackgroundAgentRegistry } from '../background-registry.js';
|
|
|
12
12
|
import type { AgentRegistry } from '../agents/types.js';
|
|
13
13
|
import type { SdkPluginConfig } from '../types/sdk-types.js';
|
|
14
14
|
import type { HookRegistry } from '../hooks.js';
|
|
15
|
+
import { type ChildGateArgs, type ChildGateOptions } from './nesting.can-use-tool.js';
|
|
15
16
|
export declare const DEFAULT_MAX_NESTING_DEPTH = 3;
|
|
16
17
|
export declare const MAX_NESTING_DEPTH_CEILING = 6;
|
|
17
18
|
export declare function resolveMaxNestingDepth(): number;
|
|
18
|
-
export interface ChildProviderFactoryArgs {
|
|
19
|
+
export interface ChildProviderFactoryArgs extends ChildGateArgs {
|
|
19
20
|
childExecutor: SubagentExecutor;
|
|
20
21
|
childSkillExecutor?: SkillExecutor;
|
|
21
22
|
model?: AgentModelInput;
|
|
@@ -29,13 +30,13 @@ export declare function createStubParentSession(signal: AbortSignal): Pick<IAgen
|
|
|
29
30
|
export declare const CHILD_ALLOWED_TOOLS: string[];
|
|
30
31
|
export declare const RECON_ALLOWED_TOOLS: readonly string[];
|
|
31
32
|
export declare const DEFAULT_READ_ONLY_SKILLS: ReadonlySet<string>;
|
|
32
|
-
export interface CreateChildProviderFactoryOptions {
|
|
33
|
+
export interface CreateChildProviderFactoryOptions extends ChildGateOptions {
|
|
33
34
|
openaiBaseUrl?: string;
|
|
34
35
|
workspaceStore?: WorkspaceStore;
|
|
35
36
|
blockDestructiveGit?: boolean;
|
|
36
37
|
}
|
|
37
38
|
export declare function createChildProviderFactory(opts?: CreateChildProviderFactoryOptions): (args: ChildProviderFactoryArgs) => ModelProvider;
|
|
38
|
-
export declare function buildReadOnlyReconProvider(model: AgentModelInput | undefined, openaiBaseUrl?: string, allowedTools?: readonly string[], workspaceStore?: WorkspaceStore): ModelProvider;
|
|
39
|
+
export declare function buildReadOnlyReconProvider(model: AgentModelInput | undefined, openaiBaseUrl?: string, allowedTools?: readonly string[], workspaceStore?: WorkspaceStore, canUseTool?: CanUseTool): ModelProvider;
|
|
39
40
|
export declare const COMPOSE_LEAF_STRIPPED_TOOLS: ReadonlySet<string>;
|
|
40
41
|
export interface BuildComposeNodeProviderOpts {
|
|
41
42
|
openaiBaseUrl?: string;
|
|
@@ -46,5 +47,5 @@ export interface BuildComposeNodeProviderOpts {
|
|
|
46
47
|
export declare function buildComposeNodeProvider(model: AgentModelInput | undefined, workspaceStore: WorkspaceStore | undefined, opts?: BuildComposeNodeProviderOpts): ModelProvider;
|
|
47
48
|
export declare function createChildSkillExecutorFactory(defaultModel: AgentModelInput, apiKey: string | undefined, childProviderFactory: (args: ChildProviderFactoryArgs) => ModelProvider, baseUrl?: string, traceWriter?: TraceSink, backgroundRegistry?: BackgroundAgentRegistry, cwd?: string, resolveApiKeyForModel?: (model: string) => string | undefined, surface?: Surface, defaultSubagentModel?: AgentModelInput, agentRegistry?: AgentRegistry, openaiBaseUrl?: string, xaiBaseUrl?: string, workspaceStore?: WorkspaceStore, delegationBudget?: import('./delegation-budget.js').DelegationBudget, pluginConfigs?: SdkPluginConfig[], skillAllowlist?: readonly string[], hookRegistry?: HookRegistry, onSubagentSucceeded?: import('../subagent/fork-types.js').SubagentManagerOptions['onSubagentSucceeded'], parentBillingStreams?: Set<Promise<void>>): (depth: number, maxDepth: number, signal: AbortSignal, inheritedCwd?: string, inheritedReadScope?: ReadScopeInputs, skillDispatchName?: string, journalParent?: JournalParent, rootSessionId?: string) => SkillExecutor;
|
|
48
49
|
export type PhaseRole = 'read-only' | 'read-write';
|
|
49
|
-
export declare function buildSkillRestrictedProvider(allowedTools: string[], model: AgentModelInput | undefined, readOnlyBash?: boolean, openaiBaseUrl?: string, workspaceStore?: WorkspaceStore): ModelProvider;
|
|
50
|
-
export declare function buildPhaseRestrictedProvider(_role: 'read-only', model: AgentModelInput | undefined, workspaceStore?: WorkspaceStore): ModelProvider;
|
|
50
|
+
export declare function buildSkillRestrictedProvider(allowedTools: string[], model: AgentModelInput | undefined, readOnlyBash?: boolean, openaiBaseUrl?: string, workspaceStore?: WorkspaceStore, canUseTool?: CanUseTool): ModelProvider;
|
|
51
|
+
export declare function buildPhaseRestrictedProvider(_role: 'read-only', model: AgentModelInput | undefined, workspaceStore?: WorkspaceStore, canUseTool?: CanUseTool): ModelProvider;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type EffortLevel = 'low' | 'medium' | 'high' | 'xhigh' | 'max';
|
|
2
|
-
export type PermissionMode = '
|
|
2
|
+
export type PermissionMode = 'acceptEdits' | 'bypassPermissions' | 'plan' | 'dontAsk' | 'auto';
|
|
3
3
|
export declare const VALID_PERMISSION_MODES: ReadonlySet<string>;
|
|
4
4
|
export declare function isValidPermissionMode(value: string): value is PermissionMode;
|
|
5
5
|
export type SettingSource = 'user' | 'project' | 'local';
|
|
@@ -63,10 +63,15 @@ Stage only the confirmed files, then write the commit message to a temp file wit
|
|
|
63
63
|
|
|
64
64
|
```
|
|
65
65
|
# 1. Pick the scratch dir <SCRATCH>. It must not be the working tree itself:
|
|
66
|
-
# - Your
|
|
67
|
-
#
|
|
66
|
+
# - Your system prompt says to put throwaway files in `.afk-scratch/`
|
|
67
|
+
# (the scratch-dir sentence is present): use <worktree-root>/.afk-scratch
|
|
68
68
|
# git ignores it, you can always write there, and it is deleted with
|
|
69
69
|
# the worktree.
|
|
70
|
+
# - Your cwd is under `.afk-worktrees/` but the scratch-dir sentence is
|
|
71
|
+
# absent (pre-#5016 worktree or external creation): use the path printed by
|
|
72
|
+
# git rev-parse --absolute-git-dir
|
|
73
|
+
# This writes inside the git dir, which is never tracked or shown by
|
|
74
|
+
# `git status`. Do NOT assume `.git/`: in a linked worktree `.git` is a FILE.
|
|
70
75
|
# - Any other checkout: the path printed by
|
|
71
76
|
# git rev-parse --absolute-git-dir
|
|
72
77
|
# Do NOT assume `.git/`: in a linked worktree `.git` is a FILE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isDaemonRunning(lockPath?: string): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function promptAuthSecret(question: string): Promise<string>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { AgentModelInput } from '../../agent/types.js';
|
|
2
|
+
import { type LiveSession } from './acp.prompt-turn.js';
|
|
3
|
+
import type { AcpRpcPeer, InitializeResponse, PromptResponse } from './acp.wire.js';
|
|
4
|
+
export declare class AcpError extends Error {
|
|
5
|
+
readonly code: number;
|
|
6
|
+
readonly detail?: string | undefined;
|
|
7
|
+
readonly data?: {
|
|
8
|
+
sessionId: string;
|
|
9
|
+
} | undefined;
|
|
10
|
+
constructor(code: number, detail?: string | undefined, data?: {
|
|
11
|
+
sessionId: string;
|
|
12
|
+
} | undefined);
|
|
13
|
+
}
|
|
14
|
+
export interface HandlerOptions {
|
|
15
|
+
model: AgentModelInput;
|
|
16
|
+
maxTurns: number;
|
|
17
|
+
dangerouslySkipPermissions?: boolean;
|
|
18
|
+
cancelGraceMs?: number;
|
|
19
|
+
}
|
|
20
|
+
export interface ServerContext {
|
|
21
|
+
opts: HandlerOptions;
|
|
22
|
+
peer: AcpRpcPeer;
|
|
23
|
+
initialized: boolean;
|
|
24
|
+
sessions: Map<string, LiveSession>;
|
|
25
|
+
restoring: Set<string>;
|
|
26
|
+
promptWrites: Map<string, Promise<void>>;
|
|
27
|
+
log(line: string): void;
|
|
28
|
+
}
|
|
29
|
+
export declare function requireInit(ctx: ServerContext): void;
|
|
30
|
+
export declare function handleInitialize(ctx: ServerContext, params: unknown): InitializeResponse;
|
|
31
|
+
export declare function knownContextWindow(model: AgentModelInput): number | undefined;
|
|
32
|
+
export declare function handleSessionNew(ctx: ServerContext, params: unknown): Promise<{
|
|
33
|
+
sessionId: string;
|
|
34
|
+
}>;
|
|
35
|
+
export declare function handleRestore(ctx: ServerContext, params: unknown, mode: 'load' | 'resume'): Promise<Record<string, never>>;
|
|
36
|
+
export declare function releaseSession(ctx: ServerContext, live: LiveSession): Promise<void>;
|
|
37
|
+
export declare function startPrompt(ctx: ServerContext, params: unknown): Promise<PromptResponse>;
|
|
38
|
+
export declare function handleCancel(ctx: ServerContext, params: unknown): void;
|
|
39
|
+
export declare function handleClose(ctx: ServerContext, params: unknown): Promise<Record<string, never>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Readable } from 'node:stream';
|
|
2
|
+
export type InboundLine = {
|
|
3
|
+
kind: 'line';
|
|
4
|
+
text: string;
|
|
5
|
+
} | {
|
|
6
|
+
kind: 'oversize';
|
|
7
|
+
} | {
|
|
8
|
+
kind: 'bad-utf8';
|
|
9
|
+
};
|
|
10
|
+
export declare function readLines(input: Readable, maxBytes: number): AsyncGenerator<InboundLine>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { McpServerConfig } from '../../agent/mcp/types.js';
|
|
2
|
+
import type { McpServerStdio } from './acp.wire.js';
|
|
3
|
+
export declare class AcpInvalidParams extends Error {
|
|
4
|
+
readonly detail: string;
|
|
5
|
+
constructor(detail: string);
|
|
6
|
+
}
|
|
7
|
+
export declare function validateCwd(raw: unknown): string;
|
|
8
|
+
export declare function parseMcpServers(raw: unknown): McpServerStdio[];
|
|
9
|
+
export declare function convertMcpServers(servers: readonly McpServerStdio[]): Record<string, McpServerConfig>;
|
|
10
|
+
export interface SessionSetup {
|
|
11
|
+
cwd: string;
|
|
12
|
+
wireMcp: McpServerStdio[];
|
|
13
|
+
mcpServers: Record<string, McpServerConfig>;
|
|
14
|
+
sessionId?: string;
|
|
15
|
+
systemPrompt?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function parseSessionSetup(params: unknown, mode: 'new' | 'load' | 'resume'): SessionSetup;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PermissionResult } from '../../agent/types/sdk-types.js';
|
|
2
|
+
import type { AcpClientPeer, AcpPermissionGate, AcpPermissionOptions, PermissionOption } from './acp.wire.js';
|
|
3
|
+
export declare const PERMISSION_TIMEOUT_MS = 120000;
|
|
4
|
+
export type DenyReason = 'rejected' | 'unknown_option' | 'malformed_reply' | 'request_error' | 'peer_closed' | 'aborted' | 'cancelled' | 'timeout' | 'no_active_turn';
|
|
5
|
+
export declare function denyResult(reason: DenyReason): PermissionResult;
|
|
6
|
+
export declare function classifyReply(reply: unknown, offered: readonly PermissionOption[]): 'allow_once' | 'allow_always' | DenyReason;
|
|
7
|
+
export declare function createAcpPermissionGate(peer: AcpClientPeer, sessionId: string, opts: AcpPermissionOptions): AcpPermissionGate;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type PathFlavor } from './acp.permission.paths.js';
|
|
2
|
+
import { type FsProbe } from './acp.permission.realpath.js';
|
|
3
|
+
export declare const GRANTABLE_TOOLS: readonly string[];
|
|
4
|
+
export declare function isGrantable(toolName: string): boolean;
|
|
5
|
+
export declare function grantFits(toolName: string, input: Record<string, unknown>, cwd: string | undefined, callerCwd?: string, p?: PathFlavor, probe?: FsProbe | null): boolean;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ChildToolOrigin } from '../../agent/tools/nesting.can-use-tool.js';
|
|
2
|
+
export declare const DELEGATION_SUFFIX = " (each subagent tool call is asked separately)";
|
|
3
|
+
export declare const REMOTE_SUFFIX = " (runs on another machine; its actions are NOT asked in this session)";
|
|
4
|
+
export declare function delegationSuffix(toolName: string): string;
|
|
5
|
+
export declare function childPrefix(origin: ChildToolOrigin | undefined): string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
export type PathFlavor = typeof path.posix;
|
|
3
|
+
export declare function isContained(root: string, abs: string, p?: PathFlavor): boolean;
|
|
4
|
+
export declare function driveless(raw: string, p?: PathFlavor): boolean;
|
|
5
|
+
export declare function relocatesChildren(toolName: string, input: Record<string, unknown>, cwd: string | undefined, p?: PathFlavor): boolean;
|
|
6
|
+
export declare function dependsOnCallerCwd(input: Record<string, unknown>, p?: PathFlavor): boolean;
|
|
7
|
+
export declare function outsidePaths(toolName: string, input: Record<string, unknown>, cwd: string | undefined, callerCwd?: string, p?: PathFlavor): string[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PermissionOption, ToolCallStart } from './acp.wire.js';
|
|
2
|
+
export declare const DELEGATION: Set<string>;
|
|
3
|
+
export { DELEGATION_SUFFIX, REMOTE_SUFFIX } from './acp.permission.labels.js';
|
|
4
|
+
export declare function outsideTargets(toolName: string, input: Record<string, unknown>, cwd: string | undefined, callerCwd?: string): string[];
|
|
5
|
+
export declare function requiresAsk(toolName: string, input: Record<string, unknown>, cwd?: string, callerCwd?: string): boolean;
|
|
6
|
+
export declare function permissionOptions(toolName: string, outside?: boolean): PermissionOption[];
|
|
7
|
+
export declare function buildPendingStart(toolCallId: string, toolName: string, input: Record<string, unknown>, cwd?: string, prefix?: string, callerCwd?: string): ToolCallStart;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PathFlavor } from './acp.permission.paths.js';
|
|
2
|
+
export interface FsProbe {
|
|
3
|
+
realpath(p: string): string;
|
|
4
|
+
lexists(p: string): boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const nativeProbe: FsProbe;
|
|
7
|
+
export declare function realTarget(abs: string, p: PathFlavor, probe: FsProbe): string | undefined;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PathFlavor } from './acp.permission.paths.js';
|
|
2
|
+
export declare const GIT_MARKER = "(git internals)";
|
|
3
|
+
export declare const CONFIG_MARKER = "(project config that runs commands)";
|
|
4
|
+
export declare const AGENT_MARKER = "(agent instructions or definitions)";
|
|
5
|
+
export declare function sensitiveMarker(raw: string, base: string | undefined, p?: PathFlavor): string;
|
|
6
|
+
export declare function sensitiveMarkers(toolName: string, input: Record<string, unknown>, base: string | undefined, p?: PathFlavor): string[];
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { AcpSessionHandle } from './acp.session.js';
|
|
2
|
+
import type { AcpClientPeer, AcpPermissionGate, SessionUpdate, StopReason, ToolCallStart, TranslatorState } from './acp.wire.js';
|
|
3
|
+
export interface ActiveTurn {
|
|
4
|
+
abort: AbortController;
|
|
5
|
+
cancelled: boolean;
|
|
6
|
+
ending?: boolean;
|
|
7
|
+
done: Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export interface LiveSession {
|
|
10
|
+
id: string;
|
|
11
|
+
cwd: string;
|
|
12
|
+
handle?: AcpSessionHandle;
|
|
13
|
+
translator: TranslatorState;
|
|
14
|
+
gate?: AcpPermissionGate;
|
|
15
|
+
active?: ActiveTurn;
|
|
16
|
+
closing: boolean;
|
|
17
|
+
wireMcp?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare class AcpTurnFailed extends Error {
|
|
20
|
+
}
|
|
21
|
+
export interface PromptTurnDeps {
|
|
22
|
+
peer: AcpClientPeer;
|
|
23
|
+
log(line: string): void;
|
|
24
|
+
cancelGraceMs?: number;
|
|
25
|
+
maxTurns?: number;
|
|
26
|
+
}
|
|
27
|
+
export declare function sendUpdate(peer: AcpClientPeer, sessionId: string, update: SessionUpdate): Promise<void>;
|
|
28
|
+
export declare function cancelTurn(live: LiveSession, log: (l: string) => void): void;
|
|
29
|
+
export declare function makeEmitToolCall(live: LiveSession, peer: AcpClientPeer): (update: ToolCallStart) => Promise<void>;
|
|
30
|
+
export declare function runPromptTurn(live: LiveSession, text: string, deps: PromptTurnDeps): Promise<StopReason>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { JournalMessage } from '../../agent/journal/types.js';
|
|
2
|
+
import type { AcpClientPeer, SessionUpdate } from './acp.wire.js';
|
|
3
|
+
export declare function buildReplayUpdates(messages: readonly JournalMessage[], cwd?: string): SessionUpdate[];
|
|
4
|
+
export declare function emitReplayUpdates(acpSessionId: string, afkSessionId: string, peer: AcpClientPeer, cwd?: string): Promise<void>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AcpRpcPeer, AcpRpcPeerOptions } from './acp.wire.js';
|
|
2
|
+
export declare class AcpPeerClosedError extends Error {
|
|
3
|
+
readonly reason: string;
|
|
4
|
+
name: string;
|
|
5
|
+
constructor(reason: string);
|
|
6
|
+
}
|
|
7
|
+
export declare function createAcpRpcPeer(opts: AcpRpcPeerOptions): AcpRpcPeer;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import type { Readable, Writable } from 'node:stream';
|
|
2
2
|
import type { AgentModelInput } from '../../agent/types.js';
|
|
3
|
-
export type { JsonRpcRequest, JsonRpcResponse } from './acp.server.protocol.js';
|
|
4
|
-
export { writeJson, successResponse, errorResponse } from './acp.server.protocol.js';
|
|
5
3
|
export interface AcpServerOptions {
|
|
6
4
|
model: AgentModelInput;
|
|
7
5
|
maxTurns: number;
|
|
8
6
|
input: Readable;
|
|
9
7
|
output: Writable;
|
|
10
8
|
dangerouslySkipPermissions?: boolean;
|
|
9
|
+
log?: (line: string) => void;
|
|
10
|
+
cancelGraceMs?: number;
|
|
11
|
+
shutdownDeadlineMs?: number;
|
|
11
12
|
}
|
|
13
|
+
export declare const SHUTDOWN_DEADLINE_MS = 10000;
|
|
12
14
|
export declare function runAcpServer(options: AcpServerOptions): Promise<void>;
|
|
15
|
+
export declare function exitAfterServer(output: Writable, exit: (code: number) => void, flushMs?: number): Promise<void>;
|
|
@@ -1,48 +1,32 @@
|
|
|
1
1
|
import type { Writable } from 'node:stream';
|
|
2
|
-
|
|
3
|
-
jsonrpc: '2.0';
|
|
4
|
-
id: string | number | null;
|
|
5
|
-
method: string;
|
|
6
|
-
params?: unknown;
|
|
7
|
-
}
|
|
8
|
-
export interface JsonRpcSuccess {
|
|
9
|
-
jsonrpc: '2.0';
|
|
10
|
-
id: string | number | null;
|
|
11
|
-
result: unknown;
|
|
12
|
-
}
|
|
13
|
-
export interface JsonRpcError {
|
|
14
|
-
jsonrpc: '2.0';
|
|
15
|
-
id: string | number | null;
|
|
16
|
-
error: {
|
|
17
|
-
code: number;
|
|
18
|
-
message: string;
|
|
19
|
-
data?: unknown;
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
export type JsonRpcResponse = JsonRpcSuccess | JsonRpcError;
|
|
23
|
-
export interface JsonRpcNotification {
|
|
24
|
-
jsonrpc: '2.0';
|
|
25
|
-
method: string;
|
|
26
|
-
params?: unknown;
|
|
27
|
-
}
|
|
2
|
+
import type { RequestId, RpcFrame, RpcRequest, RpcResponse } from './acp.wire.js';
|
|
28
3
|
export declare const PARSE_ERROR = -32700;
|
|
29
4
|
export declare const INVALID_REQUEST = -32600;
|
|
30
5
|
export declare const METHOD_NOT_FOUND = -32601;
|
|
31
6
|
export declare const INVALID_PARAMS = -32602;
|
|
32
7
|
export declare const INTERNAL_ERROR = -32603;
|
|
33
|
-
export
|
|
34
|
-
export
|
|
35
|
-
type: AcpUpdateType;
|
|
36
|
-
delta?: string;
|
|
37
|
-
toolName?: string;
|
|
38
|
-
retryAfterMs?: number;
|
|
39
|
-
sessionId?: string;
|
|
40
|
-
costUsd?: number;
|
|
41
|
-
error?: string;
|
|
42
|
-
}
|
|
8
|
+
export declare const RESOURCE_NOT_FOUND = -32002;
|
|
9
|
+
export declare const ERROR_MESSAGES: Readonly<Record<number, string>>;
|
|
43
10
|
export declare const MAX_LINE_BYTES = 1048576;
|
|
44
11
|
export declare function writeJson(output: Writable, obj: unknown): Promise<void>;
|
|
45
|
-
export declare function
|
|
46
|
-
export declare function
|
|
47
|
-
export declare function
|
|
12
|
+
export declare function createSerialWriter(output: Writable, isOpen?: () => boolean): (frame: RpcFrame) => Promise<void>;
|
|
13
|
+
export declare function successResponse(id: RequestId, result: unknown): RpcResponse;
|
|
14
|
+
export declare function errorResponse(id: RequestId, code: number, data?: {
|
|
15
|
+
sessionId: string;
|
|
16
|
+
}): RpcResponse;
|
|
17
|
+
export type InboundFrame = {
|
|
18
|
+
kind: 'request';
|
|
19
|
+
frame: RpcRequest;
|
|
20
|
+
} | {
|
|
21
|
+
kind: 'notification';
|
|
22
|
+
method: string;
|
|
23
|
+
params: unknown;
|
|
24
|
+
} | {
|
|
25
|
+
kind: 'response';
|
|
26
|
+
frame: RpcResponse;
|
|
27
|
+
} | {
|
|
28
|
+
kind: 'error';
|
|
29
|
+
response: RpcResponse;
|
|
30
|
+
};
|
|
31
|
+
export declare function classifyLine(line: string): InboundFrame;
|
|
48
32
|
export declare function normalizePrompt(raw: unknown): string | null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AcpClientPeer, LoadSessionRequest } from './acp.wire.js';
|
|
2
|
+
import type { AcpSessionHandle, AcpSessionOptions } from './acp.session.js';
|
|
3
|
+
export declare function loadAcpSession(params: LoadSessionRequest, opts: AcpSessionOptions): Promise<AcpSessionHandle>;
|
|
4
|
+
export declare function replayHistory(sessionId: string, peer: AcpClientPeer, cwd?: string): Promise<void>;
|
|
5
|
+
export declare class AcpNotFoundError extends Error {
|
|
6
|
+
name: string;
|
|
7
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface AcpSessionEntry {
|
|
2
|
+
afkId?: string;
|
|
3
|
+
cwd?: string;
|
|
4
|
+
}
|
|
5
|
+
export type AcpSessionMap = Record<string, string | AcpSessionEntry>;
|
|
6
|
+
export declare function readAcpSessionMap(): AcpSessionMap;
|
|
7
|
+
export declare function writeAcpSessionMap(map: AcpSessionMap): Promise<void>;
|
|
8
|
+
export declare function recordAcpMapping(acpId: string, afkId: string): Promise<void>;
|
|
9
|
+
export declare function resolveAcpId(acpId: string): string;
|
|
@@ -2,16 +2,27 @@ import { AgentSession } from '../../agent/session.js';
|
|
|
2
2
|
import { MemoryStore } from '../../agent/memory/index.js';
|
|
3
3
|
import { StateStore } from '../../agent/state/state-store.js';
|
|
4
4
|
import type { AgentModelInput } from '../../agent/types.js';
|
|
5
|
+
import type { AgentConfig } from '../../agent/types/config-types.js';
|
|
6
|
+
import type { CanUseTool } from './acp.wire.js';
|
|
7
|
+
import type { ChildCanUseToolFactory } from '../../agent/tools/nesting.can-use-tool.js';
|
|
8
|
+
import { AcpSessionResources } from './acp.session.resources.js';
|
|
5
9
|
export interface AcpSessionOptions {
|
|
6
10
|
model: AgentModelInput;
|
|
7
11
|
maxTurns: number;
|
|
8
12
|
dangerouslySkipPermissions?: boolean;
|
|
9
13
|
cwd?: string;
|
|
14
|
+
canUseTool?: CanUseTool;
|
|
15
|
+
childCanUseTool?: ChildCanUseToolFactory;
|
|
16
|
+
resume?: string;
|
|
17
|
+
sessionId?: string;
|
|
18
|
+
mcpServers?: AgentConfig['mcpServers'];
|
|
19
|
+
systemPrompt?: string;
|
|
10
20
|
}
|
|
11
21
|
export interface AcpSessionHandle {
|
|
12
22
|
session: AgentSession;
|
|
13
23
|
memoryStore: MemoryStore;
|
|
14
24
|
stateStore: StateStore;
|
|
25
|
+
resources?: AcpSessionResources;
|
|
15
26
|
}
|
|
16
27
|
export declare function buildAcpSession(opts: AcpSessionOptions): Promise<AcpSessionHandle>;
|
|
17
28
|
export declare function closeAcpSession(handle: AcpSessionHandle): Promise<void>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { McpManager } from '../../agent/mcp/index.js';
|
|
2
|
+
import type { TraceWriter } from '../../agent/trace/writer.js';
|
|
3
|
+
import type { AcpSessionOptions } from './acp.session.js';
|
|
4
|
+
export declare function connectAcpMcp(cwd: string, servers: AcpSessionOptions['mcpServers'], traceWriter: TraceWriter | undefined): Promise<McpManager | undefined>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const RESOURCE_DISPOSE_DEADLINE_MS = 2000;
|
|
2
|
+
export declare function withDeadline(work: () => unknown, ms: number): Promise<'done' | 'timeout'>;
|
|
3
|
+
export declare class AcpSessionResources {
|
|
4
|
+
private readonly deadlineMs;
|
|
5
|
+
private readonly disposers;
|
|
6
|
+
private released;
|
|
7
|
+
constructor(deadlineMs?: number);
|
|
8
|
+
add(dispose: () => unknown): void;
|
|
9
|
+
release(): Promise<void>;
|
|
10
|
+
private releaseAll;
|
|
11
|
+
}
|
|
12
|
+
export declare function onceAcpShutdown<T>(shutdown: (reason: string) => Promise<T>): (reason: string) => Promise<T>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ToolCallLocation, ToolKind } from './acp.wire.js';
|
|
2
|
+
export declare function toolKind(toolName: string): ToolKind;
|
|
3
|
+
export declare function toolTitle(toolName: string, input?: unknown, cwd?: string): string;
|
|
4
|
+
export declare function toolLocations(toolName: string, input: unknown, cwd: string): ToolCallLocation[];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const DETAIL_CHARS = 160;
|
|
2
|
+
export declare const ELLIPSIS = "\u2026";
|
|
3
|
+
export declare function escapeInvisible(s: string): string;
|
|
4
|
+
export declare function oneLine(text: string, max?: number): string;
|
|
5
|
+
export declare function shellCommandLine(cmd: string, max?: number): string;
|
|
6
|
+
export declare function toolDetail(toolName: string, input: unknown, cwd: string | undefined): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { JsonValue, ToolCallContent, ToolCallStart } from './acp.wire.js';
|
|
2
|
+
export declare function serializedBytes(value: unknown): number;
|
|
3
|
+
export declare function parseToolInput(raw: string | undefined): JsonValue | undefined;
|
|
4
|
+
export declare function boundedRawInput(input: JsonValue | undefined): JsonValue | undefined;
|
|
5
|
+
export declare function boundedResult(text: string): string;
|
|
6
|
+
export declare function isDiffOmission(item: ToolCallContent): boolean;
|
|
7
|
+
export declare function boundedContent(content: ToolCallContent[]): ToolCallContent[];
|
|
8
|
+
export declare function boundStartDisplay(start: ToolCallStart): ToolCallStart;
|
|
9
|
+
export declare function sanitizeDisplay<T>(value: T): T;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { OutputEvent } from '../../agent/types/session-types.js';
|
|
2
|
+
import type { FinishedTurn, SessionUpdate, TranslatorContext, TranslatorState, TurnMetadata } from './acp.wire.js';
|
|
3
|
+
export declare function createTranslatorState(): TranslatorState;
|
|
4
|
+
export declare function translateOutputEvent(ev: OutputEvent, st: TranslatorState, ctx: TranslatorContext): SessionUpdate[];
|
|
5
|
+
export declare function finishTurn(st: TranslatorState, meta?: TurnMetadata): FinishedTurn;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { SessionUpdate, TranslatorState } from './acp.wire.js';
|
|
2
|
+
export declare const TURN_ENDED_TEXT = "Turn ended before the tool call finished";
|
|
3
|
+
export declare function observeSentUpdate(st: TranslatorState, update: SessionUpdate): void;
|
|
4
|
+
export declare function isClosedByTurnEnd(st: TranslatorState, toolCallId: string): boolean;
|
|
5
|
+
export declare function closeOpenToolCalls(st: TranslatorState): SessionUpdate[];
|