@zvada/agent-server 0.3.26 → 0.3.28
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/CHANGELOG.md +71 -0
- package/README.md +7 -5
- package/dist/client/client.js +27 -11
- package/dist/client/connection.js +35 -3
- package/dist/core/agents/acp/account.js +111 -0
- package/dist/core/agents/acp/acp-agent.js +247 -158
- package/dist/core/agents/acp/adapter.js +103 -34
- package/dist/core/agents/acp/client.js +169 -42
- package/dist/core/agents/acp/known-agents.js +12 -5
- package/dist/core/agents/acp/mappings.js +84 -20
- package/dist/core/agents/acp/models.js +59 -0
- package/dist/core/agents/acp/profile.js +36 -0
- package/dist/core/agents/acp/prompts.js +248 -0
- package/dist/core/agents/acp/requests.js +4 -4
- package/dist/core/agents/claude-code/approvals.js +1 -1
- package/dist/core/agents/claude-code/login.js +4 -1
- package/dist/core/agents/claude-code/session.js +38 -10
- package/dist/core/agents/claude-code/spawn.js +0 -26
- package/dist/core/agents/codex-app-server/client.js +12 -13
- package/dist/core/agents/codex-app-server/login.js +4 -1
- package/dist/core/agents/codex-app-server/plan-approval.js +1 -1
- package/dist/core/agents/gemini/failures.js +133 -0
- package/dist/core/agents/gemini/login.js +173 -0
- package/dist/core/agents/gemini/profile.js +137 -0
- package/dist/core/agents/gemini/tools.js +91 -0
- package/dist/core/agents/login.js +8 -6
- package/dist/core/agents/scripted/scripted-agent.js +30 -3
- package/dist/core/agents/stderr-tail.js +5 -2
- package/dist/core/presets.js +17 -1
- package/dist/core/processes/native-processes.js +23 -1
- package/dist/core/provision/install-build.js +70 -26
- package/dist/core/provision/pins.js +5 -0
- package/dist/core/provision/provisioner.js +39 -16
- package/dist/core/provision/releases.js +39 -1
- package/dist/core/provision/tools.js +87 -28
- package/dist/core/runtime/agent-runtime.js +15 -5
- package/dist/core/runtime/event-processor.js +13 -8
- package/dist/core/runtime/origin-line.js +42 -0
- package/dist/core/runtime/request-broker.js +2 -1
- package/dist/core/runtime/steering.js +4 -3
- package/dist/core/runtime/turn.js +6 -4
- package/dist/operator/errors.js +97 -0
- package/dist/operator/index.js +10 -5
- package/dist/operator/mcp.js +7 -12
- package/dist/operator/operator.js +1431 -378
- package/dist/operator/refs.js +59 -0
- package/dist/operator/render.js +199 -94
- package/dist/operator/session-tools.js +88 -0
- package/dist/operator/types.js +30 -0
- package/dist/operator/view.js +82 -27
- package/dist/protocol/account.js +5 -1
- package/dist/protocol/auth.js +5 -1
- package/dist/protocol/config.js +12 -5
- package/dist/protocol/conversation.js +3 -0
- package/dist/protocol/credentials.js +9 -1
- package/dist/protocol/harness.js +9 -1
- package/dist/protocol/history.js +2 -1
- package/dist/protocol/index.js +1 -0
- package/dist/protocol/lifecycle.js +19 -0
- package/dist/protocol/origin.js +39 -0
- package/dist/protocol/reduce.js +2 -0
- package/dist/protocol/wire.js +17 -0
- package/dist/server/bin.js +22 -7
- package/dist/server/install.js +6 -4
- package/dist/server/routes.js +15 -5
- package/dist/types/client/client.d.ts.map +1 -1
- package/dist/types/client/connection.d.ts +14 -2
- package/dist/types/client/connection.d.ts.map +1 -1
- package/dist/types/client/turns.d.ts +2 -2
- package/dist/types/client/turns.d.ts.map +1 -1
- package/dist/types/core/agents/acp/account.d.ts +55 -0
- package/dist/types/core/agents/acp/account.d.ts.map +1 -0
- package/dist/types/core/agents/acp/acp-agent.d.ts +65 -36
- package/dist/types/core/agents/acp/acp-agent.d.ts.map +1 -1
- package/dist/types/core/agents/acp/adapter.d.ts +28 -3
- package/dist/types/core/agents/acp/adapter.d.ts.map +1 -1
- package/dist/types/core/agents/acp/client.d.ts +66 -4
- package/dist/types/core/agents/acp/client.d.ts.map +1 -1
- package/dist/types/core/agents/acp/known-agents.d.ts +4 -2
- package/dist/types/core/agents/acp/known-agents.d.ts.map +1 -1
- package/dist/types/core/agents/acp/mappings.d.ts +53 -7
- package/dist/types/core/agents/acp/mappings.d.ts.map +1 -1
- package/dist/types/core/agents/acp/models.d.ts +22 -0
- package/dist/types/core/agents/acp/models.d.ts.map +1 -0
- package/dist/types/core/agents/acp/profile.d.ts +92 -0
- package/dist/types/core/agents/acp/profile.d.ts.map +1 -0
- package/dist/types/core/agents/acp/prompts.d.ts +108 -0
- package/dist/types/core/agents/acp/prompts.d.ts.map +1 -0
- package/dist/types/core/agents/acp/requests.d.ts +7 -1
- package/dist/types/core/agents/acp/requests.d.ts.map +1 -1
- package/dist/types/core/agents/base.d.ts +2 -0
- package/dist/types/core/agents/base.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/login.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/session.d.ts +3 -0
- package/dist/types/core/agents/claude-code/session.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/spawn.d.ts +0 -8
- package/dist/types/core/agents/claude-code/spawn.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/client.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/login.d.ts.map +1 -1
- package/dist/types/core/agents/gemini/failures.d.ts +25 -0
- package/dist/types/core/agents/gemini/failures.d.ts.map +1 -0
- package/dist/types/core/agents/gemini/login.d.ts +28 -0
- package/dist/types/core/agents/gemini/login.d.ts.map +1 -0
- package/dist/types/core/agents/gemini/profile.d.ts +30 -0
- package/dist/types/core/agents/gemini/profile.d.ts.map +1 -0
- package/dist/types/core/agents/gemini/tools.d.ts +18 -0
- package/dist/types/core/agents/gemini/tools.d.ts.map +1 -0
- package/dist/types/core/agents/login.d.ts +15 -5
- package/dist/types/core/agents/login.d.ts.map +1 -1
- package/dist/types/core/agents/scripted/scripted-agent.d.ts +14 -1
- package/dist/types/core/agents/scripted/scripted-agent.d.ts.map +1 -1
- package/dist/types/core/agents/stderr-tail.d.ts +1 -1
- package/dist/types/core/agents/stderr-tail.d.ts.map +1 -1
- package/dist/types/core/presets.d.ts +2 -2
- package/dist/types/core/presets.d.ts.map +1 -1
- package/dist/types/core/processes/native-processes.d.ts +6 -0
- package/dist/types/core/processes/native-processes.d.ts.map +1 -1
- package/dist/types/core/provision/checksums.d.ts +7 -1
- package/dist/types/core/provision/checksums.d.ts.map +1 -1
- package/dist/types/core/provision/install-build.d.ts +32 -6
- package/dist/types/core/provision/install-build.d.ts.map +1 -1
- package/dist/types/core/provision/pins.d.ts +4 -0
- package/dist/types/core/provision/pins.d.ts.map +1 -1
- package/dist/types/core/provision/provisioner.d.ts +18 -7
- package/dist/types/core/provision/provisioner.d.ts.map +1 -1
- package/dist/types/core/provision/releases.d.ts +2 -1
- package/dist/types/core/provision/releases.d.ts.map +1 -1
- package/dist/types/core/provision/tools.d.ts +36 -7
- package/dist/types/core/provision/tools.d.ts.map +1 -1
- package/dist/types/core/runtime/agent-runtime.d.ts +4 -2
- package/dist/types/core/runtime/agent-runtime.d.ts.map +1 -1
- package/dist/types/core/runtime/event-processor.d.ts +2 -2
- package/dist/types/core/runtime/event-processor.d.ts.map +1 -1
- package/dist/types/core/runtime/origin-line.d.ts +15 -0
- package/dist/types/core/runtime/origin-line.d.ts.map +1 -0
- package/dist/types/core/runtime/request-broker.d.ts +1 -1
- package/dist/types/core/runtime/request-broker.d.ts.map +1 -1
- package/dist/types/core/runtime/steering.d.ts +7 -4
- package/dist/types/core/runtime/steering.d.ts.map +1 -1
- package/dist/types/core/runtime/turn.d.ts.map +1 -1
- package/dist/types/operator/errors.d.ts +87 -0
- package/dist/types/operator/errors.d.ts.map +1 -0
- package/dist/types/operator/index.d.ts +10 -5
- package/dist/types/operator/index.d.ts.map +1 -1
- package/dist/types/operator/mcp.d.ts +1 -1
- package/dist/types/operator/mcp.d.ts.map +1 -1
- package/dist/types/operator/operator.d.ts +15 -197
- package/dist/types/operator/operator.d.ts.map +1 -1
- package/dist/types/operator/refs.d.ts +25 -0
- package/dist/types/operator/refs.d.ts.map +1 -0
- package/dist/types/operator/render.d.ts +67 -22
- package/dist/types/operator/render.d.ts.map +1 -1
- package/dist/types/operator/session-tools.d.ts +61 -0
- package/dist/types/operator/session-tools.d.ts.map +1 -0
- package/dist/types/operator/types.d.ts +442 -0
- package/dist/types/operator/types.d.ts.map +1 -0
- package/dist/types/operator/view.d.ts +19 -29
- package/dist/types/operator/view.d.ts.map +1 -1
- package/dist/types/protocol/account.d.ts +4 -2
- package/dist/types/protocol/account.d.ts.map +1 -1
- package/dist/types/protocol/auth.d.ts +10 -7
- package/dist/types/protocol/auth.d.ts.map +1 -1
- package/dist/types/protocol/clis.d.ts +4 -3
- package/dist/types/protocol/clis.d.ts.map +1 -1
- package/dist/types/protocol/config.d.ts +22 -5
- package/dist/types/protocol/config.d.ts.map +1 -1
- package/dist/types/protocol/conversation.d.ts +47 -6
- package/dist/types/protocol/conversation.d.ts.map +1 -1
- package/dist/types/protocol/credentials.d.ts +8 -0
- package/dist/types/protocol/credentials.d.ts.map +1 -1
- package/dist/types/protocol/execution.d.ts +1 -1
- package/dist/types/protocol/harness.d.ts +5 -2
- package/dist/types/protocol/harness.d.ts.map +1 -1
- package/dist/types/protocol/history.d.ts +1 -1
- package/dist/types/protocol/history.d.ts.map +1 -1
- package/dist/types/protocol/index.d.ts +1 -0
- package/dist/types/protocol/index.d.ts.map +1 -1
- package/dist/types/protocol/lifecycle.d.ts +48 -10
- package/dist/types/protocol/lifecycle.d.ts.map +1 -1
- package/dist/types/protocol/models.d.ts +3 -0
- package/dist/types/protocol/models.d.ts.map +1 -1
- package/dist/types/protocol/origin.d.ts +49 -0
- package/dist/types/protocol/origin.d.ts.map +1 -0
- package/dist/types/protocol/reduce.d.ts.map +1 -1
- package/dist/types/protocol/wire-api.d.ts +78 -30
- package/dist/types/protocol/wire-api.d.ts.map +1 -1
- package/dist/types/protocol/wire.d.ts +78 -12
- package/dist/types/protocol/wire.d.ts.map +1 -1
- package/dist/types/server/install.d.ts +2 -1
- package/dist/types/server/install.d.ts.map +1 -1
- package/dist/types/server/routes.d.ts.map +1 -1
- package/docs/consuming.md +62 -121
- package/docs/deploy.md +17 -8
- package/docs/harnesses.md +166 -44
- package/docs/sync-history.md +2 -1
- package/package.json +1 -1
- package/src/client/client.ts +36 -9
- package/src/client/connection.ts +31 -1
- package/src/client/turns.ts +2 -1
- package/src/core/agents/acp/account.ts +158 -0
- package/src/core/agents/acp/acp-agent.ts +288 -178
- package/src/core/agents/acp/adapter.ts +126 -35
- package/src/core/agents/acp/client.ts +196 -49
- package/src/core/agents/acp/known-agents.ts +14 -5
- package/src/core/agents/acp/mappings.ts +112 -21
- package/src/core/agents/acp/models.ts +72 -0
- package/src/core/agents/acp/profile.ts +127 -0
- package/src/core/agents/acp/prompts.ts +287 -0
- package/src/core/agents/acp/requests.ts +16 -9
- package/src/core/agents/base.ts +2 -0
- package/src/core/agents/claude-code/approvals.ts +2 -2
- package/src/core/agents/claude-code/login.ts +4 -1
- package/src/core/agents/claude-code/session.ts +38 -8
- package/src/core/agents/claude-code/spawn.ts +0 -26
- package/src/core/agents/codex-app-server/client.ts +11 -18
- package/src/core/agents/codex-app-server/login.ts +4 -5
- package/src/core/agents/codex-app-server/plan-approval.ts +1 -1
- package/src/core/agents/gemini/failures.ts +148 -0
- package/src/core/agents/gemini/login.ts +188 -0
- package/src/core/agents/gemini/profile.ts +162 -0
- package/src/core/agents/gemini/tools.ts +99 -0
- package/src/core/agents/login.ts +14 -8
- package/src/core/agents/scripted/scripted-agent.ts +42 -3
- package/src/core/agents/stderr-tail.ts +5 -2
- package/src/core/presets.ts +19 -3
- package/src/core/processes/native-processes.ts +32 -1
- package/src/core/provision/checksums.ts +12 -2
- package/src/core/provision/install-build.ts +122 -55
- package/src/core/provision/pins.ts +5 -0
- package/src/core/provision/provisioner.ts +62 -27
- package/src/core/provision/releases.ts +47 -1
- package/src/core/provision/tools.ts +124 -31
- package/src/core/runtime/agent-runtime.ts +31 -7
- package/src/core/runtime/event-processor.ts +13 -6
- package/src/core/runtime/origin-line.ts +43 -0
- package/src/core/runtime/request-broker.ts +2 -0
- package/src/core/runtime/steering.ts +8 -4
- package/src/core/runtime/turn.ts +11 -4
- package/src/operator/errors.ts +221 -0
- package/src/operator/index.ts +18 -23
- package/src/operator/mcp.ts +7 -16
- package/src/operator/operator.ts +1684 -610
- package/src/operator/refs.ts +75 -0
- package/src/operator/render.ts +260 -118
- package/src/operator/session-tools.ts +127 -0
- package/src/operator/types.ts +506 -0
- package/src/operator/view.ts +93 -42
- package/src/protocol/account.ts +5 -2
- package/src/protocol/auth.ts +5 -1
- package/src/protocol/config.ts +14 -6
- package/src/protocol/conversation.ts +3 -0
- package/src/protocol/credentials.ts +11 -2
- package/src/protocol/harness.ts +9 -1
- package/src/protocol/history.ts +2 -1
- package/src/protocol/index.ts +1 -0
- package/src/protocol/lifecycle.ts +21 -0
- package/src/protocol/origin.ts +47 -0
- package/src/protocol/reduce.ts +4 -0
- package/src/protocol/wire.ts +18 -0
- package/src/server/bin.ts +20 -6
- package/src/server/install.ts +6 -3
- package/src/server/routes.ts +16 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../../src/client/connection.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,gBAAgB,EAKrB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAElB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,KAAK,QAAQ,EAAE,GAAG,EAAoB,MAAM,UAAU,CAAC;AAEhE,qEAAqE;AACrE,qBAAa,qBAAsB,SAAQ,KAAK;IAC/C,SAAkB,IAAI,EAAE,MAAM,CAA2B;CACzD;AAED;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,eAAe,GAAG,gBAAgB,GAAG,mBAAmB,CAAC;AAEzF;;;;GAIG;AACH,qBAAa,sBAAuB,SAAQ,qBAAqB;IAG/D,QAAQ,CAAC,MAAM,EAAE,iBAAiB;IAClC,wGAAwG;IACxG,QAAQ,CAAC,GAAG,EAAE,MAAM;IAJrB,S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AkBpB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAmB3B;;;OAGG;IACH,UAAU,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAsCvC,2GAA2G;IAC3G,OAAO,CAAC,UAAU;IAWlB,mEAAmE;IACnE,OAAO,CAAC,CAAC,SAAS,iBAAiB,EAClC,MAAM,EAAE,CAAC,EACT,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,EACrB,QAAQ,CAAC,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;IACzC,iGAAiG;IACjG,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,GACxC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAkBhC;;;;;;;;OAQG;IACG,MAAM,CAAC,CAAC,SAAS,iBAAiB,EACvC,MAAM,EAAE,CAAC,EACT,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,EACrB,QAAQ,CAAC,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;IACzC;;;;OAIG;IACH,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,GACxC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAehC,KAAK,IAAI,IAAI;IAYb,OAAO,CAAC,OAAO;YAmBD,MAAM;IA+EpB,6FAA6F;IAC7F,OAAO,CAAC,OAAO;IAMf;;;;OAIG;IACH,OAAO,CAAC,OAAO;CAqBf"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AgentInput, AsyncQueue, type DecodedLifecycleEvent, type DecodedWireEventEnvelope, type TurnEndedEvent, type TurnSteerResult, type UnknownEvent } from "../protocol/index.ts";
|
|
1
|
+
import { type AgentInput, AsyncQueue, type DecodedLifecycleEvent, type DecodedWireEventEnvelope, type Origin, type TurnEndedEvent, type TurnSteerResult, type UnknownEvent } from "../protocol/index.ts";
|
|
2
2
|
/** What a turn's handle yields: an unknown event type is delivered in order, not dropped. */
|
|
3
3
|
export type TurnEvent = DecodedLifecycleEvent | UnknownEvent;
|
|
4
4
|
/**
|
|
@@ -23,7 +23,7 @@ export interface TurnHandle {
|
|
|
23
23
|
*/
|
|
24
24
|
readonly catchUp: number;
|
|
25
25
|
/** Add input to this turn while it runs (see `AgentServerClient.steerTurn`). */
|
|
26
|
-
steer(input: AgentInput, steerId?: string): Promise<TurnSteerResult>;
|
|
26
|
+
steer(input: AgentInput, steerId?: string, origin?: Origin): Promise<TurnSteerResult>;
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* Where a handle joined its session: what came after the point is its, the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"turns.d.ts","sourceRoot":"","sources":["../../../src/client/turns.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,UAAU,EACf,UAAU,EACV,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,YAAY,EAGjB,MAAM,sBAAsB,CAAC;AAE9B,6FAA6F;AAC7F,MAAM,MAAM,SAAS,GAAG,qBAAqB,GAAG,YAAY,CAAC;AAE7D;;;;;;;GAOG;AACH,MAAM,WAAW,UAAU;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,qBAAqB,CAAC,SAAS,CAAC,CAAC;IACzC,MAAM,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IAChC;;;;;;OAMG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,gFAAgF;IAChF,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"turns.d.ts","sourceRoot":"","sources":["../../../src/client/turns.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,UAAU,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AS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM;IACvB,0EAA0E;IACjE,GAAG,EAAE,OAAO,EACJ,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI;IAUnD,2FAA2F;IAC3F,IAAI,CAAC,QAAQ,EAAE,wBAAwB,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAW/D,0EAA0E;IAC1E,UAAU,IAAI,IAAI;IAIlB,kEAAkE;IAClE,QAAQ,CAAC,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI;IAOrC,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI;IAO5B,GAAG,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI;IAQhC,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;CAO1B;AAED,yFAAyF;AACzF,qBAAa,KAAK;IACjB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAkC;IAE5D,mFAAmF;IACnF,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,GAAG,MAAM;IAQ7D,sEAAsE;IACtE,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAKnC,QAAQ,IAAI,MAAM,EAAE;IAIpB,mEAAmE;IACnE,OAAO,CAAC,QAAQ,EAAE,wBAAwB,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAKlE,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI;IAI3C,OAAO,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAI3B,OAAO,CAAC,KAAK;CAKb;AAED,YAAY,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { InitializeResponse, NewSessionResponse } from "@agentclientprotocol/sdk";
|
|
2
|
+
import type { NativeProcesses } from "../../processes/native-processes.ts";
|
|
3
|
+
import type { LoginOptions } from "../login.ts";
|
|
4
|
+
import { AcpClient, type AcpClientOptions, type AcpLaunch } from "./client.ts";
|
|
5
|
+
import type { AcpProfile } from "./profile.ts";
|
|
6
|
+
/** Deadline for session lifecycle requests (`session/new`, `session/resume`). */
|
|
7
|
+
export declare const SESSION_REQUEST_TIMEOUT_MS = 30000;
|
|
8
|
+
/** How an agent of a profile starts, for a turn or with none, and how the client introduces itself. */
|
|
9
|
+
export interface AcpStart {
|
|
10
|
+
profile: AcpProfile;
|
|
11
|
+
processes: NativeProcesses;
|
|
12
|
+
clientName?: string;
|
|
13
|
+
clientVersion?: string;
|
|
14
|
+
createClient?: (options: AcpClientOptions) => Promise<AcpClient>;
|
|
15
|
+
}
|
|
16
|
+
/** The profile's launch, refused when it has none; a cancel ends the wait. */
|
|
17
|
+
export declare function launchOf(profile: AcpProfile, signal?: AbortSignal): Promise<AcpLaunch>;
|
|
18
|
+
/** Start an agent of the profile's harness on the engine's processes. */
|
|
19
|
+
export declare function startClient(start: AcpStart, options: Pick<AcpClientOptions, "launch" | "cwd" | "env" | "sessionId" | "watchRequests">): Promise<AcpClient>;
|
|
20
|
+
/** `initialize` the agent, and refuse one its profile cannot drive. */
|
|
21
|
+
export declare function initialize(client: AcpClient, start: AcpStart): Promise<InitializeResponse>;
|
|
22
|
+
/**
|
|
23
|
+
* A folder of no project for an agent to start in, since an agent loads the
|
|
24
|
+
* rules, skills and hooks of the folder it runs in (Antigravity takes it as
|
|
25
|
+
* its workspace): a new one each time (`mkdtemp`, 0700), which nobody else
|
|
26
|
+
* can plant a project in, removed once `gone` settles (its process exited).
|
|
27
|
+
*/
|
|
28
|
+
export declare function privateFolder(): {
|
|
29
|
+
path: string;
|
|
30
|
+
removeAfter(gone?: Promise<unknown>): Promise<void>;
|
|
31
|
+
};
|
|
32
|
+
/** What a new session says of its account: the agent's `initialize`, and the session. */
|
|
33
|
+
export interface AcpAccountRead {
|
|
34
|
+
init: InitializeResponse;
|
|
35
|
+
session: NewSessionResponse;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The account an agent runs on, read through a session with no turn: the
|
|
39
|
+
* agent starts in a folder of no project, opens a session, is used, and ends.
|
|
40
|
+
* Its model list and its login read it this way.
|
|
41
|
+
*/
|
|
42
|
+
export declare class AcpAccount {
|
|
43
|
+
private readonly start;
|
|
44
|
+
constructor(start: AcpStart);
|
|
45
|
+
get processes(): NativeProcesses;
|
|
46
|
+
launch(signal?: AbortSignal): Promise<AcpLaunch>;
|
|
47
|
+
/**
|
|
48
|
+
* Start the agent in a folder of its own (`privateFolder`), `initialize`
|
|
49
|
+
* it, run `use`, and end it; `signal` ends it sooner.
|
|
50
|
+
*/
|
|
51
|
+
connect<T>(options: LoginOptions, use: (client: AcpClient, init: InitializeResponse, cwd: string) => Promise<T>): Promise<T>;
|
|
52
|
+
/** As `connect`, with a session opened in its folder for `use`, and never prompted. */
|
|
53
|
+
open<T>(options: LoginOptions, use: (client: AcpClient, read: AcpAccountRead) => Promise<T>): Promise<T>;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=account.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/acp/account.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACvF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAE3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAC/E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAQ/C,iFAAiF;AACjF,eAAO,MAAM,0BAA0B,QAAS,CAAC;AAEjD,uGAAuG;AACvG,MAAM,WAAW,QAAQ;IACxB,OAAO,EAAE,UAAU,CAAC;IACpB,SAAS,E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,EAAE,IAAI,EAAE,kBAAkB,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,GAC3E,OAAO,CAAC,CAAC,CAAC;IAqBb,uFAAuF;IACvF,IAAI,CAAC,CAAC,EACL,OAAO,EAAE,YAAY,EACrB,GAAG,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,cAAc,KAAK,OAAO,CAAC,CAAC,CAAC,GAC1D,OAAO,CAAC,CAAC,CAAC;CAUb"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import type { AgentInput } from "../../../protocol/index.ts";
|
|
1
|
+
import type { AgentCapabilities, AgentHarness, AgentInput, ModelDescriptor } from "../../../protocol/index.ts";
|
|
2
2
|
import { type NativeProcesses } from "../../processes/native-processes.ts";
|
|
3
|
-
import type { AgentExecuteOptions, RawAgentEvent } from "../base.ts";
|
|
3
|
+
import type { AgentExecuteOptions, ListModelsOptions, RawAgentEvent } from "../base.ts";
|
|
4
4
|
import { type HostTools } from "../host-tools.ts";
|
|
5
|
+
import type { CliLogin } from "../login.ts";
|
|
5
6
|
import { SessionAgent } from "../session-agent.ts";
|
|
6
|
-
import { AcpClient,
|
|
7
|
+
import type { AcpClient, AcpClientOptions, AcpLaunch } from "./client.ts";
|
|
8
|
+
import { type AcpProfile } from "./profile.ts";
|
|
7
9
|
export interface AcpAgentOptions {
|
|
8
10
|
/**
|
|
9
11
|
* Resolve the ACP agent subprocess to launch. Operator-level only — never
|
|
@@ -45,36 +47,36 @@ export interface AcpAgentOptions {
|
|
|
45
47
|
hostTools?: HostTools;
|
|
46
48
|
}
|
|
47
49
|
/**
|
|
48
|
-
* ACP
|
|
49
|
-
* subprocess (one per logical session, reused across turns).
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
50
|
+
* An ACP agent running a profile: drives an Agent Client Protocol v1 agent
|
|
51
|
+
* as a long-lived subprocess (one per logical session, reused across turns).
|
|
52
|
+
* What is one agent's own, its name, its launch command and where it departs
|
|
53
|
+
* from its `initialize`, is its profile; `initialize` negotiates the protocol
|
|
54
|
+
* version and gates optional features (resume, images) on the agent's
|
|
55
|
+
* advertised capabilities. The turn's stopReason arrives as the
|
|
53
56
|
* `session/prompt` *response*, so `execute` re-injects it into the raw stream
|
|
54
|
-
* as a synthetic `session/prompt_result` event for the adapter.
|
|
57
|
+
* as a synthetic `session/prompt_result` event for the adapter. Internal to
|
|
58
|
+
* the engine: a harness that is a profile constructs it in its registration
|
|
59
|
+
* (`geminiHarness`); `AcpAgent` is the `acp` harness.
|
|
55
60
|
*/
|
|
56
|
-
export declare class
|
|
61
|
+
export declare class ProfiledAcpAgent extends SessionAgent {
|
|
57
62
|
private readonly agentOptions;
|
|
58
|
-
readonly harness:
|
|
59
|
-
readonly capabilities:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
thinkingLevels: boolean;
|
|
64
|
-
images: boolean;
|
|
65
|
-
files: ((string & {}) | "text" | "pdf" | "binary")[];
|
|
66
|
-
mcpServers: boolean;
|
|
67
|
-
permissionRequests: boolean;
|
|
68
|
-
rejectionMessages: boolean;
|
|
69
|
-
turnScopedSubagents?: boolean | undefined;
|
|
70
|
-
steering?: boolean | undefined;
|
|
71
|
-
ignoredSettings?: string[] | undefined;
|
|
72
|
-
};
|
|
63
|
+
readonly harness: AgentHarness;
|
|
64
|
+
readonly capabilities: AgentCapabilities;
|
|
65
|
+
readonly login?: CliLogin;
|
|
66
|
+
/** Present when its profile lists models: what the agent offers this login. */
|
|
67
|
+
readonly listModels?: (options: ListModelsOptions) => Promise<ModelDescriptor[]>;
|
|
73
68
|
/** Its CLIs start here: the runtime's, or this OS process's own when it was made without one. */
|
|
74
69
|
readonly processes: NativeProcesses;
|
|
70
|
+
private readonly profile;
|
|
75
71
|
private readonly sessions;
|
|
76
72
|
private readonly host?;
|
|
77
|
-
|
|
73
|
+
/** How its agents start: its profile's, on its processes. */
|
|
74
|
+
private readonly starts;
|
|
75
|
+
/** The agent with no turn: its account, for the login and the model list. */
|
|
76
|
+
private readonly account;
|
|
77
|
+
/** What each session's conversation was started with, when this agent started it (`newSession`). */
|
|
78
|
+
private readonly startedWith;
|
|
79
|
+
constructor(profile: AcpProfile, agentOptions: Omit<AcpAgentOptions, "resolveLaunch">);
|
|
78
80
|
private resolveSession;
|
|
79
81
|
protected hostSecret(sessionId: string): string | undefined;
|
|
80
82
|
/**
|
|
@@ -91,26 +93,53 @@ export declare class AcpAgent extends SessionAgent {
|
|
|
91
93
|
*/
|
|
92
94
|
private spawn;
|
|
93
95
|
/**
|
|
94
|
-
* Select the requested model
|
|
95
|
-
* options
|
|
96
|
-
* agent does not offer
|
|
97
|
-
*
|
|
98
|
-
*
|
|
96
|
+
* Select the requested model, then the thinking level, through the agent's
|
|
97
|
+
* config options; an agent without the option keeps its own default. A
|
|
98
|
+
* model the agent does not offer, or its profile does not take, fails the
|
|
99
|
+
* turn; a turn that names none on a profile that lists models runs the
|
|
100
|
+
* one its list marks default (`defaultModel`). The levels are the ones
|
|
101
|
+
* offered once the model is set, which are that model's, and the turn
|
|
102
|
+
* runs the nearest of them, as on Claude and Codex (`clampThinkingLevel`);
|
|
103
|
+
* a level that cannot be fitted is left alone. Returns the settings it
|
|
104
|
+
* left alone.
|
|
99
105
|
*/
|
|
100
106
|
private applyConfig;
|
|
107
|
+
/**
|
|
108
|
+
* What a conversation keeps from its start (`newSession`), said not
|
|
109
|
+
* applied by a later turn that asks otherwise; what a conversation this
|
|
110
|
+
* agent did not start was given is unknown, and nothing is said.
|
|
111
|
+
*/
|
|
112
|
+
private keptFromStart;
|
|
101
113
|
/**
|
|
102
114
|
* Put the agent in the turn's permission mode (`default` when it names
|
|
103
|
-
* none) through `session/set_mode`, by the agent's own id for it.
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
* has
|
|
115
|
+
* none) through `session/set_mode`, by the agent's own id for it. An agent
|
|
116
|
+
* with no id for the mode is put in its `default`, never left in the mode
|
|
117
|
+
* an earlier turn left it in, and the engine answers what it asks by the
|
|
118
|
+
* turn's mode (`autoDecide`), as for an agent that offers no modes; neither
|
|
119
|
+
* has a plan of its own to make, so `plan` does not hold there. An agent
|
|
120
|
+
* with no `default` either stays where it is: in a mode the engine names
|
|
121
|
+
* and was not asked, the turn is refused; in one it cannot name, it runs,
|
|
122
|
+
* and the mode is said not applied. Returns whether the mode holds.
|
|
108
123
|
*/
|
|
109
124
|
private applyMode;
|
|
110
125
|
protected executeTurn(input: AgentInput, options: AgentExecuteOptions, controller: AbortController): AsyncIterableIterator<RawAgentEvent>;
|
|
126
|
+
/** A steer's file of a kind the harness does not take is refused, as a turn's is. */
|
|
127
|
+
protected checkSteerInput(input: AgentInput): void;
|
|
111
128
|
release(sessionId: string): Promise<void>;
|
|
129
|
+
/**
|
|
130
|
+
* The agent's login changed (in `store`, or in every store): each session's
|
|
131
|
+
* next turn starts a new agent, which resumes its conversation.
|
|
132
|
+
*/
|
|
133
|
+
loginChanged(store?: string): void;
|
|
112
134
|
/** After a host resume, each session's next turn starts its agent again, on its conversation. */
|
|
113
135
|
invalidateMcpConnections(): void;
|
|
114
136
|
terminateAll(): Promise<void>;
|
|
115
137
|
}
|
|
138
|
+
/**
|
|
139
|
+
* The `acp` harness: any ACP v1 agent the operator launches
|
|
140
|
+
* (`resolveLaunch`), taken at its `initialize`'s word.
|
|
141
|
+
*/
|
|
142
|
+
export declare class AcpAgent extends ProfiledAcpAgent {
|
|
143
|
+
constructor(options: AcpAgentOptions);
|
|
144
|
+
}
|
|
116
145
|
//# sourceMappingURL=acp-agent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acp-agent.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/acp/acp-agent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"acp-agent.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/acp/acp-agent.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,E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C,EAAE,MAAM,GAAG,IAAI;IAIlC,iGAAiG;IACjG,wBAAwB,IAAI,IAAI;IAIjB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;CAK5C;AAED;;;GAGG;AACH,qBAAa,QAAS,SAAQ,gBAAgB;gBACjC,OAAO,EAAE,eAAe;CAIpC"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import type { PromptResponse, SessionNotification } from "@agentclientprotocol/sdk";
|
|
2
|
+
import { type ErrorCategory } from "../../../protocol/index.ts";
|
|
2
3
|
import type { EventTransformer } from "../types.ts";
|
|
4
|
+
import type { AcpProfile } from "./profile.ts";
|
|
3
5
|
/**
|
|
4
6
|
* Parses ACP v1 raw events into AdapterEvents. The mapping is nearly identity:
|
|
5
7
|
* our part vocabulary (ToolKind, tool status, locations) was aligned to ACP up
|
|
6
8
|
* front, so chunks append to text/reasoning parts and
|
|
7
|
-
* `tool_call`/`tool_call_update` upsert tool parts by `toolCallId`.
|
|
9
|
+
* `tool_call`/`tool_call_update` upsert tool parts by `toolCallId`. Parts keep
|
|
10
|
+
* the order they came in: a message has one streaming part open at a time,
|
|
11
|
+
* which a new tool call or a chunk of the other kind finishes. Everything
|
|
8
12
|
* arrives through the SDK connection, which zod-validates inbound payloads —
|
|
9
13
|
* so the SDK's own types ARE the raw shapes (no defensive re-modelling).
|
|
10
14
|
*
|
|
@@ -13,7 +17,13 @@ import type { EventTransformer } from "../types.ts";
|
|
|
13
17
|
* - `{method: "session/prompt_result", params: PromptResponse}` (synthetic —
|
|
14
18
|
* ACP returns the turn's stopReason as the prompt *response*, not as a
|
|
15
19
|
* notification, so the agent re-injects it into the event stream)
|
|
16
|
-
* - `{method: "error", params: {message}}` (synthetic,
|
|
20
|
+
* - `{method: "error", params: {message, category?, usage?}}` (synthetic, a
|
|
21
|
+
* prompt that failed: its category when the reader knows it, and the usage
|
|
22
|
+
* of an answer a harness reads as a failure)
|
|
23
|
+
* - `{method: "agentServer/mcpServers", params: {names}}` (synthetic, the
|
|
24
|
+
* session's MCP servers, for a harness's tool rules)
|
|
25
|
+
* - `{method: "agentServer/steerRead", params: {steerId}}` (synthetic, the
|
|
26
|
+
* agent took a steer sent as a prompt)
|
|
17
27
|
*
|
|
18
28
|
* v1 `messageId` on chunks is optional: when present, a change opens a new
|
|
19
29
|
* wire message; when absent the whole turn is one message (the processor
|
|
@@ -29,11 +39,26 @@ export type AcpRawEvent = {
|
|
|
29
39
|
method: "error";
|
|
30
40
|
params: {
|
|
31
41
|
message?: string;
|
|
42
|
+
category?: ErrorCategory;
|
|
43
|
+
usage?: PromptResponse["usage"];
|
|
44
|
+
};
|
|
45
|
+
} | {
|
|
46
|
+
method: "agentServer/mcpServers";
|
|
47
|
+
params: {
|
|
48
|
+
names: string[];
|
|
49
|
+
};
|
|
50
|
+
} | {
|
|
51
|
+
method: "agentServer/steerRead";
|
|
52
|
+
params: {
|
|
53
|
+
steerId: string;
|
|
32
54
|
};
|
|
33
55
|
};
|
|
34
56
|
/** How a turn the agent did not get to answer ends: cancelled. */
|
|
35
57
|
export declare const CANCELLED_PROMPT_RESULT: AcpRawEvent;
|
|
58
|
+
/** What of its harness's profile an ACP turn's adapter reads: its tool rules and its mode ids. */
|
|
59
|
+
export type AcpReading = Pick<AcpProfile, "tools" | "modeIds">;
|
|
60
|
+
/** An ACP turn's adapter; `reading` is what of its harness's profile it reads beyond ACP. */
|
|
36
61
|
export declare function createAcpTransformer(ctx: {
|
|
37
62
|
sessionId: string;
|
|
38
|
-
}): EventTransformer
|
|
63
|
+
}, reading?: AcpReading): EventTransformer<AcpRawEvent>;
|
|
39
64
|
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/acp/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEX,cAAc,EACd,mBAAmB,EAInB,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"ad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,CAAC,EAAE,UAAU,GAClB,gBAAgB,CAAC,WAAW,CAAC,CAE/B"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { AgentNotificationMethod, AgentNotificationParamsByMethod, AgentRequestMethod, AgentRequestParamsByMethod, AgentRequestResponsesByMethod, CreateElicitationRequest, CreateElicitationResponse, RequestPermissionRequest, RequestPermissionResponse, SessionNotification } from "@agentclientprotocol/sdk";
|
|
1
|
+
import type { AgentNotificationMethod, AgentNotificationParamsByMethod, AgentRequestMethod, AgentRequestParamsByMethod, AgentRequestResponsesByMethod, AnyMessage, CreateElicitationRequest, CreateElicitationResponse, RequestPermissionRequest, RequestPermissionResponse, SessionNotification, Stream } from "@agentclientprotocol/sdk";
|
|
2
|
+
import type { AgentHarness } from "../../../protocol/index.ts";
|
|
2
3
|
import type { NativeProcesses } from "../../processes/native-processes.ts";
|
|
3
4
|
/**
|
|
4
5
|
* How to start one ACP agent subprocess. Operator-level only — the wire never
|
|
@@ -10,8 +11,61 @@ export interface AcpLaunch {
|
|
|
10
11
|
args?: string[];
|
|
11
12
|
/** Extra env layered onto the subprocess (over process.env). */
|
|
12
13
|
env?: Record<string, string>;
|
|
14
|
+
/**
|
|
15
|
+
* Env set over every other, the turn's included, which comes from the
|
|
16
|
+
* wire: what the engine keeps for its own reasons (a pinned CLI's
|
|
17
|
+
* self-update off), for a turn, a read with no turn and a sign-in alike.
|
|
18
|
+
*/
|
|
19
|
+
fixedEnv?: Record<string, string>;
|
|
13
20
|
}
|
|
14
21
|
type SessionUpdateHandler = (notification: SessionNotification) => void;
|
|
22
|
+
/**
|
|
23
|
+
* What the agent is asking on one connection, read from the messages
|
|
24
|
+
* themselves, for an agent steered by prompt, which refuses a prompt while it
|
|
25
|
+
* asks. A request (a `method` and an `id`) is open from its arrival, through
|
|
26
|
+
* our answer to it (that `id`, no `method`) being handed to the writer, until
|
|
27
|
+
* the agent shows it acted on that answer: its next `session/update` for the
|
|
28
|
+
* same session about the tool call the request names
|
|
29
|
+
* (`params.toolCall.toolCallId`, a permission's; `params.toolCallId`,
|
|
30
|
+
* Antigravity's question). An agent may apply an answer after it was written
|
|
31
|
+
* (Antigravity does), and nothing else says it has. A request that names no
|
|
32
|
+
* tool call cannot be seen acted on: it stays open until nothing is asked any
|
|
33
|
+
* more (`askNothing`). A prompt goes down the same writable as the answers,
|
|
34
|
+
* so one sent once `idle()` settles reaches an agent that has acted on every
|
|
35
|
+
* answer it waited for.
|
|
36
|
+
*/
|
|
37
|
+
export declare class AgentRequests {
|
|
38
|
+
/** Each open request, by its id: what it is about, and whether our answer is given. */
|
|
39
|
+
private readonly open;
|
|
40
|
+
private arrivals;
|
|
41
|
+
private waiters;
|
|
42
|
+
/** The connection's messages, counted as they pass: what `AcpClient` hands the SDK. */
|
|
43
|
+
watch(stream: Stream): Stream;
|
|
44
|
+
/**
|
|
45
|
+
* A message from the agent: an update acts on the answers given before it
|
|
46
|
+
* that wait for it, and a request opens what it asks.
|
|
47
|
+
*/
|
|
48
|
+
received(message: AnyMessage | readonly AnyMessage[]): void;
|
|
49
|
+
/** A message on its way to the agent: an answer is given, and the agent is yet to act on it. */
|
|
50
|
+
written(message: AnyMessage | readonly AnyMessage[]): void;
|
|
51
|
+
/** Whether the agent is waiting for an answer. */
|
|
52
|
+
get pending(): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* How many requests have arrived so far: a mark a later request passes
|
|
55
|
+
* (`arrivedSince`).
|
|
56
|
+
*/
|
|
57
|
+
get arrived(): number;
|
|
58
|
+
/** Whether a request arrived after `mark` (`arrived`, read earlier). */
|
|
59
|
+
arrivedSince(mark: number): boolean;
|
|
60
|
+
/** Settles once the agent asks nothing, or nothing is asked any more (`askNothing`). */
|
|
61
|
+
idle(): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Nothing is asked any more: the connection is gone, or the turn that
|
|
64
|
+
* asked has ended, so a request the agent never acted on is forgotten.
|
|
65
|
+
*/
|
|
66
|
+
askNothing(): void;
|
|
67
|
+
private wake;
|
|
68
|
+
}
|
|
15
69
|
/** Answers agent→client `session/request_permission`. Absent handler → cancelled. */
|
|
16
70
|
type AcpPermissionHandler = (request: RequestPermissionRequest) => Promise<RequestPermissionResponse>;
|
|
17
71
|
/** Answers agent→client `elicitation/create`. Absent handler → declined. */
|
|
@@ -27,8 +81,15 @@ export interface AcpClientOptions {
|
|
|
27
81
|
* recorded for `sessionId` (`createAgentRegistry` passes the runtime's).
|
|
28
82
|
*/
|
|
29
83
|
processes: NativeProcesses;
|
|
84
|
+
/** The harness it runs under, which its record names. */
|
|
85
|
+
harness: AgentHarness;
|
|
30
86
|
/** The logical session it serves, which its record names. */
|
|
31
87
|
sessionId?: string;
|
|
88
|
+
/**
|
|
89
|
+
* Count what the agent asks on the connection (`asking`), for an agent
|
|
90
|
+
* steered by prompt; otherwise the SDK gets the stream as it is.
|
|
91
|
+
*/
|
|
92
|
+
watchRequests?: boolean;
|
|
32
93
|
}
|
|
33
94
|
/**
|
|
34
95
|
* One ACP agent subprocess + its SDK connection. The engine talks to any
|
|
@@ -47,12 +108,15 @@ export declare class AcpClient {
|
|
|
47
108
|
private readonly closeHandlers;
|
|
48
109
|
private permissionHandler?;
|
|
49
110
|
private elicitationHandler?;
|
|
111
|
+
/** What the agent is asking, until it acted on each answer: present when `watchRequests` says so. */
|
|
112
|
+
readonly asking?: AgentRequests;
|
|
50
113
|
private exited;
|
|
51
114
|
/** The stop of its process, once one began: what `gone` waits for. */
|
|
52
115
|
private leaving?;
|
|
53
116
|
/** Why the agent stopped, once it has: its exit code and stderr tail. */
|
|
54
117
|
private exitError?;
|
|
55
|
-
private
|
|
118
|
+
private readonly pending;
|
|
119
|
+
private connectionEnd?;
|
|
56
120
|
private constructor();
|
|
57
121
|
/** Spawn the agent and connect. Fails if `@agentclientprotocol/sdk` is absent. */
|
|
58
122
|
static create(opts: AcpClientOptions): Promise<AcpClient>;
|
|
@@ -73,8 +137,6 @@ export declare class AcpClient {
|
|
|
73
137
|
* pass no timeout.
|
|
74
138
|
*/
|
|
75
139
|
request<M extends AgentRequestMethod>(method: M, params: AgentRequestParamsByMethod[M], timeoutMs?: number): Promise<AgentRequestResponsesByMethod[M]>;
|
|
76
|
-
/** Why the agent exited, waiting briefly for its exit when the connection went first. */
|
|
77
|
-
private whyExited;
|
|
78
140
|
private send;
|
|
79
141
|
/** Send a notification to the agent (`session/cancel`). */
|
|
80
142
|
notify<M extends AgentNotificationMethod>(method: M, params: AgentNotificationParamsByMethod[M]): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/acp/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/acp/client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACX,uBAAuB,EACvB,+BAA+B,EAC/B,kBAAkB,EAClB,0BAA0B,EAC1B,6BAA6B,EAC7B,UAAU,EAEV,wBAAwB,EACxB,yBAAyB,EACzB,wBAAwB,EACxB,yBAAyB,EACzB,mBAAmB,EACnB,MAAM,EACN,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,EAAiB,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAI1F;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,gEAAgE;IAChE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAKD,KAAK,oBAAoB,GAAG,CAAC,YAAY,EAAE,mBAAmB,KAAK,IAAI,CAAC;AAGxE;;;;;;;;;;;;;;GAcG;AACH,qBAAa,aAA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,EAAE,MAAM,GAChB,OAAO,CAAC,6BAA6B,CAAC,CAAC,CAAC,CAAC;YAgB9B,IAAI;IAkBlB,2DAA2D;IACrD,MAAM,CAAC,CAAC,SAAS,uBAAuB,EAC7C,MAAM,EAAE,CAAC,EACT,MAAM,EAAE,+BAA+B,CAAC,CAAC,CAAC,GACxC,OAAO,CAAC,IAAI,CAAC;IAKhB;;;;OAIG;IACH,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrB,KAAK,IAAI,IAAI;IAWb;;;;OAIG;IACH,OAAO,CAAC,IAAI;YAKE,KAAK;IA8DnB,OAAO,CAAC,MAAM;IAWd,OAAO,CAAC,YAAY;CAKpB"}
|
|
@@ -3,7 +3,7 @@ import type { AcpLaunch } from "./client.ts";
|
|
|
3
3
|
/**
|
|
4
4
|
* Advisory catalog of well-known ACP agents — UX sugar, not wire vocabulary
|
|
5
5
|
* (like the model catalog). On the wire the harness is always `acp`; these names
|
|
6
|
-
* let entry points offer "pi" or "gemini" as first-class choices and expand
|
|
6
|
+
* let entry points offer "pi" or "gemini-cli" as first-class choices and expand
|
|
7
7
|
* them to launch commands at the operator edge. Anything not listed here runs
|
|
8
8
|
* via an explicit launch command — any ACP-compatible agent works.
|
|
9
9
|
*/
|
|
@@ -29,7 +29,9 @@ export declare function resolveHarnessName(name: string): {
|
|
|
29
29
|
/**
|
|
30
30
|
* Resolve an operator spec that is either a known agent name (`"pi"`) or a
|
|
31
31
|
* raw launch command (`"npx -y pi-acp"`). The canonical resolver behind
|
|
32
|
-
* `--acp-agent` and `$AGENT_SERVER_ACP_AGENT`.
|
|
32
|
+
* `--acp-agent` and `$AGENT_SERVER_ACP_AGENT`. A harness's own name is no
|
|
33
|
+
* ACP agent and no command to launch: it is refused, naming the harness and
|
|
34
|
+
* the known agents, so an old setting (`gemini`) says what to write instead.
|
|
33
35
|
*/
|
|
34
36
|
export declare function resolveAcpLaunch(spec: string | undefined): AcpLaunch | undefined;
|
|
35
37
|
//# sourceMappingURL=known-agents.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"known-agents.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/acp/known-agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAkB,MAAM,4BAA4B,CAAC;AAC/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,SAAS,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"known-agents.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/acp/known-agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAkB,MAAM,4BAA4B,CAAC;AAC/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,SAAS,CAAA;CAAE,CAYjF,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAI9E;AAOD;;;;GAIG;AACH,wBAAgB,kBAAkB,CACjC,IAAI,EAAE,MAAM,GACV;IAAE,OAAO,EAAE,YAAY,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAI1D;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAShF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ContentBlock, McpServer, PermissionOption, RequestPermissionRequest, RequestPermissionResponse, ToolCallContent, ToolCallLocation } from "@agentclientprotocol/sdk";
|
|
2
|
-
import type { AgentInput, McpServerConfig, PermissionMode, PermissionToolCall, ToolKind, ToolLocation, ToolResultContent } from "../../../protocol/index.ts";
|
|
1
|
+
import type { ContentBlock, McpServer, PermissionOption, RequestPermissionRequest, RequestPermissionResponse, SessionConfigOption, ToolCallContent, ToolCallLocation } from "@agentclientprotocol/sdk";
|
|
2
|
+
import type { AgentInput, FileKind, McpServerConfig, McpTool, PermissionMode, PermissionToolCall, ToolKind, ToolLocation, ToolResultContent } from "../../../protocol/index.ts";
|
|
3
3
|
/**
|
|
4
4
|
* The single bridge between ACP's vocabulary and the engine's. Everything here
|
|
5
5
|
* is a pure conversion shared by the agent (outbound requests, permission
|
|
@@ -28,6 +28,12 @@ export interface AcpPromptCapabilities {
|
|
|
28
28
|
image: boolean;
|
|
29
29
|
embeddedContext: boolean;
|
|
30
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* Refuse a file of a kind the harness does not offer (`capabilities.files`),
|
|
33
|
+
* before any agent starts: what an agent says it embeds is not what it reads,
|
|
34
|
+
* so the harness's own list decides (LLP 0020, decision 13).
|
|
35
|
+
*/
|
|
36
|
+
export declare function refuseFiles(input: AgentInput, harness: string, files: readonly FileKind[]): void;
|
|
31
37
|
/**
|
|
32
38
|
* Engine turn input → ACP prompt content blocks. Every agent takes text and
|
|
33
39
|
* resource links; image data needs the `image` capability and inline files
|
|
@@ -35,8 +41,15 @@ export interface AcpPromptCapabilities {
|
|
|
35
41
|
* the agent cannot take fails the turn instead of vanishing.
|
|
36
42
|
*/
|
|
37
43
|
export declare function toPromptBlocks(input: AgentInput, prompt: AcpPromptCapabilities): ContentBlock[];
|
|
38
|
-
/**
|
|
39
|
-
|
|
44
|
+
/**
|
|
45
|
+
* ACP permission request → the engine's PermissionToolCall (SDK-validated, no
|
|
46
|
+
* casts). `described` is what the harness's tool rules read of the call
|
|
47
|
+
* (`AcpProfile.stream`): an ACP agent names its tools by no rule of its own.
|
|
48
|
+
*/
|
|
49
|
+
export declare function permissionToolCall(request: RequestPermissionRequest, described?: {
|
|
50
|
+
mcp?: McpTool;
|
|
51
|
+
command?: string;
|
|
52
|
+
}): PermissionToolCall;
|
|
40
53
|
export declare const CANCELLED_OUTCOME: RequestPermissionResponse;
|
|
41
54
|
/**
|
|
42
55
|
* Pick the option matching the decision: allow → `allow_once` only, deny →
|
|
@@ -47,10 +60,43 @@ export declare const CANCELLED_OUTCOME: RequestPermissionResponse;
|
|
|
47
60
|
*/
|
|
48
61
|
export declare function chooseOutcome(options: PermissionOption[], allow: boolean): RequestPermissionResponse;
|
|
49
62
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
63
|
+
* Whether a request is the user's to answer in `mode`, when the turn has a
|
|
64
|
+
* broker: everything in `default`; in `accept_edits` what is neither an edit
|
|
65
|
+
* nor a read, as Claude and Codex ask for a command in that mode. Every other
|
|
66
|
+
* mode decides by itself (`autoDecide`).
|
|
67
|
+
*/
|
|
68
|
+
export declare function asksInMode(request: RequestPermissionRequest, mode: PermissionMode): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Decide an ACP permission request without the engine broker:
|
|
71
|
+
* `bypass_permissions` allows everything, `accept_edits` edits and reads, and
|
|
72
|
+
* every other mode denies.
|
|
52
73
|
*/
|
|
53
74
|
export declare function autoDecide(request: RequestPermissionRequest, mode: PermissionMode | undefined): RequestPermissionResponse;
|
|
54
|
-
/** An ACP mode id the engine has a name for: its own, or Claude's (claude-agent-acp). */
|
|
75
|
+
/** An ACP mode id the engine has a name for: its own, or Claude's (claude-agent-acp), however it is cased and separated. */
|
|
55
76
|
export declare function permissionModeOf(modeId: string): PermissionMode | undefined;
|
|
77
|
+
/** An agent's own id for an engine mode, where its ids name none (`AcpProfile.modeIds`). */
|
|
78
|
+
export type ModeIds = Partial<Record<PermissionMode, string>>;
|
|
79
|
+
/**
|
|
80
|
+
* An agent's mode ids and the engine's modes, each way: the agent's own ids
|
|
81
|
+
* first (`own`), then the ids that name a mode (`permissionModeOf`).
|
|
82
|
+
*/
|
|
83
|
+
export declare function modeNames(own?: ModeIds): {
|
|
84
|
+
/** The engine's mode an agent's mode id is, when the engine can name it. */
|
|
85
|
+
modeOf: (modeId: string) => PermissionMode | undefined;
|
|
86
|
+
/** The agent's id for `mode`, of the ids it offers. */
|
|
87
|
+
idOf: (mode: PermissionMode, offered: readonly string[]) => string | undefined;
|
|
88
|
+
};
|
|
89
|
+
/** A select config option (`model`, `thought_level`). */
|
|
90
|
+
export type SelectOption = SessionConfigOption & {
|
|
91
|
+
type: "select";
|
|
92
|
+
};
|
|
93
|
+
/** Every choice a select option offers, whether listed flat or in groups. */
|
|
94
|
+
export declare function selectableChoices(option: SelectOption): Array<{
|
|
95
|
+
value: string;
|
|
96
|
+
name: string;
|
|
97
|
+
}>;
|
|
98
|
+
/** Every value a select option offers. */
|
|
99
|
+
export declare function selectableValues(option: SelectOption): string[];
|
|
100
|
+
/** The agent's select option of a category, as it stands. */
|
|
101
|
+
export declare function selectOf(options: readonly SessionConfigOption[], category: "model" | "thought_level"): SelectOption | undefined;
|
|
56
102
|
//# sourceMappingURL=mappings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mappings.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/acp/mappings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,wBAAwB,EACxB,yBAAyB,EACzB,eAAe,EACf,gBAAgB,EAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EACX,UAAU,EACV,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,QAAQ,EACR,YAAY,EACZ,iBAAiB,EACjB,MAAM,4BAA4B,CAAC;AAUpC;;;;;;GAMG;AAGH,gFAAgF;AAChF,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAEhF;AAED,4FAA4F;AAC5F,wBA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AAG,cAAc,GAAG,SAAS,CAG3E;AAED,4FAA4F;AAC5F,MAAM,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC;AAE9D;;;GAGG;AACH,wBAAgB,SAAS,CAAC,GAAG,GAAE,OAAY;IAKzC,4EAA4E;qBAJrD,MAAM,KAAG,cAAc,GAAG,SAAS;IAM1D,uDAAuD;iBAC1C,cAAc,WAAW,SAAS,MAAM,EAAE,KAAG,MAAM,GAAG,SAAS;EAM7E;AAED,yDAAyD;AACzD,MAAM,MAAM,YAAY,GAAG,mBAAmB,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC;AAEpE,6EAA6E;AAC7E,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,GAAG,KAAK,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAM9F;AAED,0CAA0C;AAC1C,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,EAAE,CAE/D;AAED,6DAA6D;AAC7D,wBAAgB,QAAQ,CACvB,OAAO,EAAE,SAAS,mBAAmB,EAAE,EACvC,QAAQ,EAAE,OAAO,GAAG,eAAe,GACjC,YAAY,GAAG,SAAS,CAI1B"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { AgentHarness, ModelDescriptor } from "../../../protocol/index.ts";
|
|
2
|
+
import type { ListModelsOptions } from "../base.ts";
|
|
3
|
+
import { type AcpAccount } from "./account.ts";
|
|
4
|
+
import { type SelectOption } from "./mappings.ts";
|
|
5
|
+
/**
|
|
6
|
+
* The model a turn that names none runs, for a harness that lists its
|
|
7
|
+
* models: the agent's current one when the harness offers it, else the first
|
|
8
|
+
* the agent lists that it offers (a person's own default may be another
|
|
9
|
+
* vendor's model), else none.
|
|
10
|
+
*/
|
|
11
|
+
export declare function defaultModel(option: SelectOption, offers: (value: string) => boolean): string | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* The models an agent offers, from a session with no turn: each value of its
|
|
14
|
+
* `model` option that `offers` takes, labelled by the option's name, the
|
|
15
|
+
* default the one a turn naming none runs (`defaultModel`). A model's levels
|
|
16
|
+
* are those its `thought_level` offers once it is set, which change with the
|
|
17
|
+
* model, so each is set in turn; only the default model's level is its own,
|
|
18
|
+
* the others carrying over the one set before. The read stops between models
|
|
19
|
+
* once `signal` aborts.
|
|
20
|
+
*/
|
|
21
|
+
export declare function listAcpModels(account: AcpAccount, harness: AgentHarness, offers: (value: string) => boolean, options: ListModelsOptions): Promise<ModelDescriptor[]>;
|
|
22
|
+
//# sourceMappingURL=models.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/acp/models.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAChF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,OAAO,EAAE,KAAK,UAAU,EAA8B,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,KAAK,YAAY,EAAiD,MAAM,eAAe,CAAC;AAGjG;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,sBAMpF;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC5B,OAAO,EAAE,UAAU,EACnB,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,EAClC,OAAO,EAAE,iBAAiB,GACxB,OAAO,CAAC,eAAe,EAAE,CAAC,CAmC5B"}
|