agent-afk 5.359.0 → 6.0.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/github-event-poller.d.ts +13 -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 +1 -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/dispatch-preparation.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 +2 -1
- package/dist/agent/tools/handlers/artifact-publish.d.ts +7 -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/readonly-bash.destructive-git.d.ts +2 -2
- package/dist/agent/tools/readonly-bash.destructive-git.here-string.d.ts +14 -0
- package/dist/agent/tools/readonly-bash.destructive-git.literal.d.ts +1 -0
- package/dist/agent/tools/schemas.artifact.d.ts +2 -1
- package/dist/agent/trace/events.d.ts +4 -0
- package/dist/agent/trace/events.session-phase.d.ts +4 -0
- package/dist/agent/trace/types.session-phase.d.ts +1 -1
- package/dist/agent/types/sdk-types.d.ts +1 -1
- package/dist/bundled-plugins/awa-bundled/skills/refactor/SKILL.md +1 -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 +16 -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 +10 -0
- package/dist/cli/commands/acp.session-record.d.ts +5 -0
- package/dist/cli/commands/acp.session.d.ts +10 -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 +685 -678
- package/dist/config/env.auth.d.ts +6 -0
- package/dist/config/env.d.ts +8 -2
- package/dist/config/env.misc.d.ts +2 -2
- package/dist/improve/propose/template-engine.cluster-text.d.ts +10 -0
- package/dist/index.mjs +464 -463
- 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 +491 -496
- 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-BD19GE01.js} +1 -1
- package/dist/web-ui-assets/assets/{angular-ts-CYYKmYCY.js → angular-ts-D-8nWbDi.js} +1 -1
- package/dist/web-ui-assets/assets/{apl-Qebclc6H.js → apl-CGAwGaMO.js} +1 -1
- package/dist/web-ui-assets/assets/{astro-EC7rA9tr.js → astro-CkuQ2DiX.js} +1 -1
- package/dist/web-ui-assets/assets/{blade-3LEHciyw.js → blade-Dq7KjYqn.js} +1 -1
- package/dist/web-ui-assets/assets/{c-BMHvDp3M.js → c-WCbbQlvl.js} +1 -1
- package/dist/web-ui-assets/assets/{chapel-DIdY1czS.js → chapel-Ba2DJ_K-.js} +1 -1
- package/dist/web-ui-assets/assets/{cobol-B4veGjea.js → cobol-USx_xtge.js} +1 -1
- package/dist/web-ui-assets/assets/{coffee-CTW65drd.js → coffee-CNrrqUk0.js} +1 -1
- package/dist/web-ui-assets/assets/{cpp-UFv8IcpT.js → cpp-CIgzylbd.js} +1 -1
- package/dist/web-ui-assets/assets/{crystal-CAl2astP.js → crystal-DnxAjwyI.js} +1 -1
- package/dist/web-ui-assets/assets/{css-W4FP-8b5.js → css-Or29-r2v.js} +1 -1
- package/dist/web-ui-assets/assets/{dist-CL6azZY0.js → dist-BB4rhKId.js} +2 -2
- package/dist/web-ui-assets/assets/{edge-BHV7W1lD.js → edge-B07IYMaR.js} +1 -1
- package/dist/web-ui-assets/assets/{elixir-BSeMK1dJ.js → elixir-6L-Dirx2.js} +1 -1
- package/dist/web-ui-assets/assets/{elm-DBbEnhG_.js → elm-C8ChgcyM.js} +1 -1
- package/dist/web-ui-assets/assets/{erb-prErkLIh.js → erb-Om_2jij1.js} +1 -1
- package/dist/web-ui-assets/assets/{git-rebase-C2YnmdYZ.js → git-rebase-CCKmJCA6.js} +1 -1
- package/dist/web-ui-assets/assets/{glimmer-js-UE5yPqqs.js → glimmer-js-Bx6hTLu2.js} +1 -1
- package/dist/web-ui-assets/assets/{glimmer-ts-CHUC7ee4.js → glimmer-ts-Cp2ZQAGt.js} +1 -1
- package/dist/web-ui-assets/assets/{glsl-BP7hWcQl.js → glsl-CIFxcCf6.js} +1 -1
- package/dist/web-ui-assets/assets/{graphql-B2mDXSlF.js → graphql-OJDAyU7X.js} +1 -1
- package/dist/web-ui-assets/assets/{hack-CYmItAIT.js → hack-BNzHnOHD.js} +1 -1
- package/dist/web-ui-assets/assets/{haml-BE55kcBt.js → haml-DV_DV3nb.js} +1 -1
- package/dist/web-ui-assets/assets/{handlebars-HqWAfmn0.js → handlebars-2i4BLtuY.js} +1 -1
- package/dist/web-ui-assets/assets/{html-DQqmUNra.js → html-2LI4xeh6.js} +1 -1
- package/dist/web-ui-assets/assets/{html-derivative-DHtOwb02.js → html-derivative-Uh0lbTVx.js} +1 -1
- package/dist/web-ui-assets/assets/{http-qsOPQWSh.js → http-nl67p9fn.js} +1 -1
- package/dist/web-ui-assets/assets/{hurl-CLG0zR7e.js → hurl-_dXaFsHc.js} +1 -1
- package/dist/web-ui-assets/assets/index-BlprD6uZ.js +94 -0
- package/dist/web-ui-assets/assets/{java-CIoYCZPE.js → java-Dnrn3fXn.js} +1 -1
- package/dist/web-ui-assets/assets/{javascript-BiSgC3HH.js → javascript-xuPl9J-y.js} +1 -1
- package/dist/web-ui-assets/assets/{jinja-uoMhNXH1.js → jinja-BuATxnBy.js} +1 -1
- package/dist/web-ui-assets/assets/{jison-62dtSwty.js → jison-DBoY3_ql.js} +1 -1
- package/dist/web-ui-assets/assets/{json-Cxps7Vp_.js → json-R2XvyPkK.js} +1 -1
- package/dist/web-ui-assets/assets/{jsx-i4FhzmZ3.js → jsx-jylJrkrO.js} +1 -1
- package/dist/web-ui-assets/assets/{julia-4eQbL51O.js → julia-Bfy50lSf.js} +1 -1
- package/dist/web-ui-assets/assets/{just-DuzaqAD6.js → just-GdHYpD5d.js} +1 -1
- package/dist/web-ui-assets/assets/{latex-DR1YiBEA.js → latex-LvBZM7jj.js} +1 -1
- package/dist/web-ui-assets/assets/{liquid-BCJgC6HS.js → liquid-DXtCDLqj.js} +1 -1
- package/dist/web-ui-assets/assets/{lua-BC4drQZp.js → lua-CanFQLQS.js} +1 -1
- package/dist/web-ui-assets/assets/{marko-DtJIqB68.js → marko-mEMoboMp.js} +1 -1
- package/dist/web-ui-assets/assets/{mdc-CYBfAC3q.js → mdc-DnAWWso2.js} +1 -1
- package/dist/web-ui-assets/assets/{nginx-CMR593MB.js → nginx-C0AS8LWG.js} +1 -1
- package/dist/web-ui-assets/assets/{nim-BbUeXd8c.js → nim-BKqgQhZU.js} +1 -1
- package/dist/web-ui-assets/assets/{org-oHqhaY5K.js → org-BvjAAc1G.js} +1 -1
- package/dist/web-ui-assets/assets/{perl-DE4Fx5iS.js → perl-DRoj4I0f.js} +1 -1
- package/dist/web-ui-assets/assets/{php-rh-d5On6.js → php-DmwtuIRD.js} +1 -1
- package/dist/web-ui-assets/assets/{pug-8Ni7Ix1b.js → pug-BfP3xlRM.js} +1 -1
- package/dist/web-ui-assets/assets/{qml-CrGNXQfX.js → qml-oXbOqJFi.js} +1 -1
- package/dist/web-ui-assets/assets/{r-BiZL36Lf.js → r-D3xXpa1x.js} +1 -1
- package/dist/web-ui-assets/assets/{razor-DnQFAjmg.js → razor-Bc3Q8LHv.js} +1 -1
- package/dist/web-ui-assets/assets/{regexp-ZehcoqOu.js → regexp-Pxrw-iZl.js} +1 -1
- package/dist/web-ui-assets/assets/{rst-BHnIys2E.js → rst-C8omPrnn.js} +1 -1
- package/dist/web-ui-assets/assets/{ruby-CQjEBqXf.js → ruby-Csro-4R8.js} +1 -1
- package/dist/web-ui-assets/assets/{sas-DDw_qWwd.js → sas-Cf1Puaz0.js} +1 -1
- package/dist/web-ui-assets/assets/{scss-Buc-D2q0.js → scss-GMWlbQ5A.js} +1 -1
- package/dist/web-ui-assets/assets/{shellscript-DSdjoUZi.js → shellscript-D1jiMC3C.js} +1 -1
- package/dist/web-ui-assets/assets/{shellsession-Dlf5ZOd7.js → shellsession-IDWdez9j.js} +1 -1
- package/dist/web-ui-assets/assets/{soy-BtqthtDI.js → soy-BeZBXQOk.js} +1 -1
- package/dist/web-ui-assets/assets/{sql-Wbs3a-2M.js → sql-Ct97Hist.js} +1 -1
- package/dist/web-ui-assets/assets/{stata-CZQadxtE.js → stata-Bi9Dbspb.js} +1 -1
- package/dist/web-ui-assets/assets/{surrealql-BHX1_keB.js → surrealql-CXgkGA72.js} +1 -1
- package/dist/web-ui-assets/assets/{svelte-5Gzb7jP2.js → svelte-CDZVQK7l.js} +1 -1
- package/dist/web-ui-assets/assets/{templ-6-2sxD2t.js → templ-BFbWMT7B.js} +1 -1
- package/dist/web-ui-assets/assets/{tex-s7OSL_QU.js → tex-AzZNnYqj.js} +1 -1
- package/dist/web-ui-assets/assets/{ts-tags-ILSDF7eF.js → ts-tags-CkCmvzlF.js} +1 -1
- package/dist/web-ui-assets/assets/{tsx-Ba3RCOh1.js → tsx-sydsmG_7.js} +1 -1
- package/dist/web-ui-assets/assets/{twig-B5Q27p1D.js → twig-ip13cNU9.js} +1 -1
- package/dist/web-ui-assets/assets/{typescript-BGZwH6By.js → typescript-Br3p3VYj.js} +1 -1
- package/dist/web-ui-assets/assets/{typst-BNUBq5yx.js → typst-CPZuTSqk.js} +1 -1
- package/dist/web-ui-assets/assets/{vue-BWxalE-A.js → vue-1qwXNPRK.js} +1 -1
- package/dist/web-ui-assets/assets/{vue-html-Czl3_Xc-.js → vue-html-BydJWkgv.js} +1 -1
- package/dist/web-ui-assets/assets/{vue-vine-DbFJFkgw.js → vue-vine-BSd-zJ-p.js} +1 -1
- package/dist/web-ui-assets/assets/{xml-_-I97g00.js → xml-Bqt-gslq.js} +1 -1
- package/dist/web-ui-assets/assets/{xsl-BS-NWXy1.js → xsl-DowXju11.js} +1 -1
- package/dist/web-ui-assets/assets/{yaml-Dru6aRB_.js → yaml-gvaqWrcK.js} +1 -1
- package/dist/web-ui-assets/index.html +1 -1
- package/package.json +2 -2
- package/dist/agent/afk-mode-gate.d.ts +0 -17
- 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
|
@@ -11,3 +11,4 @@ export interface PrepareDispatchModelResult extends ResolvedChildModel {
|
|
|
11
11
|
apiKey: string | undefined;
|
|
12
12
|
}
|
|
13
13
|
export declare function prepareDispatchModel(input: DispatchModelPreparationInput): PrepareDispatchModelResult;
|
|
14
|
+
export declare function resolveChildMaxDepth(ctxMaxDepth: number | undefined): number;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ToolCall, ToolResult } from '../providers/anthropic-direct/types.js';
|
|
2
|
+
import { type PreDispatchGateDeps } from './dispatcher.pre-dispatch-gates.js';
|
|
3
|
+
export declare function runCanUseTool(call: ToolCall, deps: PreDispatchGateDeps): Promise<ToolResult | null>;
|
|
@@ -7,6 +7,7 @@ import type { CanUseTool } from '../types/sdk-types.js';
|
|
|
7
7
|
import type { TraceSink } from '../trace/index.js';
|
|
8
8
|
import type { GrantManager } from './grant-manager.js';
|
|
9
9
|
import type { HookBlockRepeatState } from './hook-block-repeat-breaker.js';
|
|
10
|
+
export { runCanUseTool } from './dispatcher.pre-dispatch-gates.can-use-tool.js';
|
|
10
11
|
export interface PreDispatchGateMutableState {
|
|
11
12
|
repeatBreaker: {
|
|
12
13
|
fingerprint: string;
|
|
@@ -42,7 +43,7 @@ export declare function emitPreToolUseBlock(blockedTool: string, reason: string,
|
|
|
42
43
|
export declare function resetDenialBreaker(state: PreDispatchGateMutableState): void;
|
|
43
44
|
export { applyHookBlockRepeatGate as applyHookBlockRepeat } from './dispatcher.hook-block-repeat-gate.js';
|
|
44
45
|
export declare function resetProgressBreakers(state: PreDispatchGateMutableState): void;
|
|
45
|
-
export declare function accountDenialBreakerPostGate(call: ToolCall, blockReason: string | undefined, blockResult: ToolResult, deps: PreDispatchGateDeps): ToolResult
|
|
46
|
+
export declare function accountDenialBreakerPostGate(call: ToolCall, blockReason: string | undefined, blockResult: ToolResult, deps: PreDispatchGateDeps): Promise<ToolResult>;
|
|
46
47
|
export declare function replayObserveSuspectedLoopPostGate(call: ToolCall, deps: PreDispatchGateDeps): void;
|
|
47
48
|
export interface RunPreDispatchGatesOpts {
|
|
48
49
|
parallelSafe?: boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ToolHandler } from '../types.js';
|
|
2
|
+
export interface ArtifactPublishHandlerOptions {
|
|
3
|
+
cwd?: string;
|
|
4
|
+
storeDir?: string;
|
|
5
|
+
indexPath?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function createArtifactPublishHandler(opts?: ArtifactPublishHandlerOptions): ToolHandler;
|
|
@@ -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;
|
|
@@ -3,6 +3,6 @@ type Verdict = {
|
|
|
3
3
|
destructive: boolean;
|
|
4
4
|
reason?: string;
|
|
5
5
|
};
|
|
6
|
-
export declare function destructiveGitSegmentReason(argv: readonly string[], depth?: number): string | null;
|
|
7
|
-
export declare function classifyDestructiveGit(command: string, depth?: number): Verdict;
|
|
6
|
+
export declare function destructiveGitSegmentReason(argv: readonly string[], depth?: number, literal?: boolean): string | null;
|
|
7
|
+
export declare function classifyDestructiveGit(command: string, depth?: number, literalParent?: boolean): Verdict;
|
|
8
8
|
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type HereString = {
|
|
2
|
+
text: string | null;
|
|
3
|
+
io: string;
|
|
4
|
+
raw: string;
|
|
5
|
+
end: number;
|
|
6
|
+
position: number;
|
|
7
|
+
};
|
|
8
|
+
export declare function hereStringAt(command: string, start: number, position: number, io: string): HereString | null;
|
|
9
|
+
export declare function restoreHereStrings(header: string, words: readonly HereString[]): string;
|
|
10
|
+
export declare function continuedHereStringPipeline(words: readonly HereString[], preceding: string, header: string): boolean;
|
|
11
|
+
export declare function collectHereStrings(words: readonly HereString[], preceding: string, pipeline: (position: number) => {
|
|
12
|
+
context: string;
|
|
13
|
+
kind: string;
|
|
14
|
+
}, scripts: string[]): string | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isLiteralCommand(command: string): boolean;
|
|
@@ -2,4 +2,5 @@ import type { AnthropicToolDef } from './types.js';
|
|
|
2
2
|
export declare const artifactGetTool: AnthropicToolDef;
|
|
3
3
|
export declare const artifactListTool: AnthropicToolDef;
|
|
4
4
|
export declare const artifactReadTool: AnthropicToolDef;
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const artifactPublishTool: AnthropicToolDef;
|
|
6
|
+
export declare const artifactToolSchemas: readonly [AnthropicToolDef, AnthropicToolDef, AnthropicToolDef, AnthropicToolDef];
|
|
@@ -764,6 +764,8 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
764
764
|
compose_recovery_decision: "compose_recovery_decision";
|
|
765
765
|
compose_leaf_tools_stripped: "compose_leaf_tools_stripped";
|
|
766
766
|
hook_block_repeat_tripped: "hook_block_repeat_tripped";
|
|
767
|
+
denial_circuit_breaker_tripped: "denial_circuit_breaker_tripped";
|
|
768
|
+
endpoint_semaphore_wait: "endpoint_semaphore_wait";
|
|
767
769
|
billing_settled: "billing_settled";
|
|
768
770
|
subagent_model_fallback: "subagent_model_fallback";
|
|
769
771
|
model_fallback: "model_fallback";
|
|
@@ -1260,6 +1262,8 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1260
1262
|
compose_recovery_decision: "compose_recovery_decision";
|
|
1261
1263
|
compose_leaf_tools_stripped: "compose_leaf_tools_stripped";
|
|
1262
1264
|
hook_block_repeat_tripped: "hook_block_repeat_tripped";
|
|
1265
|
+
denial_circuit_breaker_tripped: "denial_circuit_breaker_tripped";
|
|
1266
|
+
endpoint_semaphore_wait: "endpoint_semaphore_wait";
|
|
1263
1267
|
billing_settled: "billing_settled";
|
|
1264
1268
|
subagent_model_fallback: "subagent_model_fallback";
|
|
1265
1269
|
model_fallback: "model_fallback";
|
|
@@ -50,6 +50,8 @@ export declare const SessionPhaseNameSchema: z.ZodEnum<{
|
|
|
50
50
|
compose_recovery_decision: "compose_recovery_decision";
|
|
51
51
|
compose_leaf_tools_stripped: "compose_leaf_tools_stripped";
|
|
52
52
|
hook_block_repeat_tripped: "hook_block_repeat_tripped";
|
|
53
|
+
denial_circuit_breaker_tripped: "denial_circuit_breaker_tripped";
|
|
54
|
+
endpoint_semaphore_wait: "endpoint_semaphore_wait";
|
|
53
55
|
billing_settled: "billing_settled";
|
|
54
56
|
subagent_model_fallback: "subagent_model_fallback";
|
|
55
57
|
model_fallback: "model_fallback";
|
|
@@ -111,6 +113,8 @@ export declare const SessionPhasePayloadSchema: z.ZodObject<{
|
|
|
111
113
|
compose_recovery_decision: "compose_recovery_decision";
|
|
112
114
|
compose_leaf_tools_stripped: "compose_leaf_tools_stripped";
|
|
113
115
|
hook_block_repeat_tripped: "hook_block_repeat_tripped";
|
|
116
|
+
denial_circuit_breaker_tripped: "denial_circuit_breaker_tripped";
|
|
117
|
+
endpoint_semaphore_wait: "endpoint_semaphore_wait";
|
|
114
118
|
billing_settled: "billing_settled";
|
|
115
119
|
subagent_model_fallback: "subagent_model_fallback";
|
|
116
120
|
model_fallback: "model_fallback";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type SessionPhaseName = 'bootstrap_start' | 'bootstrap_done' | 'session_init_start' | 'session_init_done' | 'mcp_connect_start' | 'mcp_connect_done' | 'mcp_server_start' | 'mcp_server_done' | 'loop_start' | 'loop_end' | 'model_ttfb' | 'context_pressure_wind_down' | 'catalog_model_upgrade' | 'interrupt_halt' | 'rate_limit' | 'ttfb_timeout' | 'usage_limit_pause' | 'usage_limit_resume' | 'credential_swap' | 'overload_pause' | 'overload_resume' | 'idle_watchdog_fired' | 'pause_extension_granted' | 'suspected_loop' | 'compaction_disabled' | 'boot_warning' | 'workspace_subscribed' | 'workspace_delivery' | 'gate_shape' | 'session_id_assigned' | 'many_image_degraded' | 'stream_accepted_after_drop' | 'connection_retry' | 'connection_retry_exhausted' | 'connection_failure' | 'connection_recovered' | 'connection_budget_exhausted' | 'usage_notice' | 'tool_degraded' | 'strategy_nudge_fired' | 'stop_inject_dropped' | 'stop_hook_continuation' | 'stop_hook_cap_reached' | 'orphan_repair' | 'thinking_block_dropped' | 'background_process_started' | 'background_process_settled' | 'compose_recovery_decision' | 'compose_leaf_tools_stripped' | 'hook_block_repeat_tripped' | 'endpoint_semaphore_wait' | 'billing_settled' | 'subagent_model_fallback' | 'model_fallback' | 'round_cap_notice_dropped' | 'continuation_settle_degraded' | 'prompt_fragment_sizes' | 'ratelimit_unified_state' | 'auth_retry_outcome';
|
|
1
|
+
export type SessionPhaseName = 'bootstrap_start' | 'bootstrap_done' | 'session_init_start' | 'session_init_done' | 'mcp_connect_start' | 'mcp_connect_done' | 'mcp_server_start' | 'mcp_server_done' | 'loop_start' | 'loop_end' | 'model_ttfb' | 'context_pressure_wind_down' | 'catalog_model_upgrade' | 'interrupt_halt' | 'rate_limit' | 'ttfb_timeout' | 'usage_limit_pause' | 'usage_limit_resume' | 'credential_swap' | 'overload_pause' | 'overload_resume' | 'idle_watchdog_fired' | 'pause_extension_granted' | 'suspected_loop' | 'compaction_disabled' | 'boot_warning' | 'workspace_subscribed' | 'workspace_delivery' | 'gate_shape' | 'session_id_assigned' | 'many_image_degraded' | 'stream_accepted_after_drop' | 'connection_retry' | 'connection_retry_exhausted' | 'connection_failure' | 'connection_recovered' | 'connection_budget_exhausted' | 'usage_notice' | 'tool_degraded' | 'strategy_nudge_fired' | 'stop_inject_dropped' | 'stop_hook_continuation' | 'stop_hook_cap_reached' | 'orphan_repair' | 'thinking_block_dropped' | 'background_process_started' | 'background_process_settled' | 'compose_recovery_decision' | 'compose_leaf_tools_stripped' | 'hook_block_repeat_tripped' | 'denial_circuit_breaker_tripped' | 'endpoint_semaphore_wait' | 'billing_settled' | 'subagent_model_fallback' | 'model_fallback' | 'round_cap_notice_dropped' | 'continuation_settle_degraded' | 'prompt_fragment_sizes' | 'ratelimit_unified_state' | 'auth_retry_outcome';
|
|
2
2
|
export interface SessionPhasePayload {
|
|
3
3
|
phase: SessionPhaseName;
|
|
4
4
|
durationMs?: number;
|
|
@@ -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';
|
|
@@ -99,7 +99,7 @@ Dispatch one sub-agent per site in this layer, all in parallel, each in a worktr
|
|
|
99
99
|
- The `diff_applied` for that site
|
|
100
100
|
- The `failure_reason`
|
|
101
101
|
- The current layer number and which layers (if any) already completed successfully
|
|
102
|
-
- Recommendation: "
|
|
102
|
+
- Recommendation: "Preserve layer N changes with `git diff > saved.patch` or `git switch -c rescue-<name>`, then diagnose with `/diagnose`. Child sessions must not use checkout/restore to discard changes. If restoring one file is intentional, use `git show <ref>:<path> > <path>` (quote paths and preserve local edits first; this overwrites the file), or report the requirement to the caller."
|
|
103
103
|
|
|
104
104
|
---
|
|
105
105
|
|
|
@@ -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,16 @@
|
|
|
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
|
+
}
|
|
16
|
+
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,10 @@
|
|
|
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 readLegacyAcpCwd(acpId: string): string | undefined;
|
|
10
|
+
export declare function resolveAcpId(acpId: string): string;
|
|
@@ -2,16 +2,26 @@ 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'];
|
|
10
19
|
}
|
|
11
20
|
export interface AcpSessionHandle {
|
|
12
21
|
session: AgentSession;
|
|
13
22
|
memoryStore: MemoryStore;
|
|
14
23
|
stateStore: StateStore;
|
|
24
|
+
resources?: AcpSessionResources;
|
|
15
25
|
}
|
|
16
26
|
export declare function buildAcpSession(opts: AcpSessionOptions): Promise<AcpSessionHandle>;
|
|
17
27
|
export declare function closeAcpSession(handle: AcpSessionHandle): Promise<void>;
|