@automatalabs/acp-agents 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/dist/acp-client.d.ts +164 -0
- package/dist/acp-client.d.ts.map +1 -0
- package/dist/acp-client.js +611 -0
- package/dist/backend.d.ts +28 -0
- package/dist/backend.d.ts.map +1 -0
- package/dist/backend.js +4 -0
- package/dist/backends/claude.d.ts +10 -0
- package/dist/backends/claude.d.ts.map +1 -0
- package/dist/backends/claude.js +48 -0
- package/dist/backends/codex.d.ts +10 -0
- package/dist/backends/codex.d.ts.map +1 -0
- package/dist/backends/codex.js +62 -0
- package/dist/errors-map.d.ts +5 -0
- package/dist/errors-map.d.ts.map +1 -0
- package/dist/errors-map.js +47 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/permissions.d.ts +10 -0
- package/dist/permissions.d.ts.map +1 -0
- package/dist/permissions.js +86 -0
- package/dist/pool.d.ts +35 -0
- package/dist/pool.d.ts.map +1 -0
- package/dist/pool.js +103 -0
- package/dist/runner.d.ts +22 -0
- package/dist/runner.d.ts.map +1 -0
- package/dist/runner.js +211 -0
- package/dist/schema-strict.d.ts +11 -0
- package/dist/schema-strict.d.ts.map +1 -0
- package/dist/schema-strict.js +189 -0
- package/dist/structured-output.d.ts +37 -0
- package/dist/structured-output.d.ts.map +1 -0
- package/dist/structured-output.js +88 -0
- package/dist/usage.d.ts +21 -0
- package/dist/usage.d.ts.map +1 -0
- package/dist/usage.js +52 -0
- package/package.json +33 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Automata Labs
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
202
|
+
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { ClientSideConnection, type PromptResponse, type SessionConfigOption, type SessionNotification } from "@agentclientprotocol/sdk";
|
|
2
|
+
import type { TSchema } from "typebox";
|
|
3
|
+
import { type AgentHistoryEntry, type McpServerConfig } from "@automatalabs/shared-types";
|
|
4
|
+
import type { Backend, BackendId, StructuredSource } from "./backend.js";
|
|
5
|
+
import { type ToolPolicy } from "./permissions.js";
|
|
6
|
+
import { UsageAccumulator } from "./usage.js";
|
|
7
|
+
interface RawResultSuccess {
|
|
8
|
+
type: string;
|
|
9
|
+
subtype: string;
|
|
10
|
+
structured_output?: unknown;
|
|
11
|
+
}
|
|
12
|
+
/** Per-session accumulator: assistant text, tool history, usage, the Claude raw structured_output,
|
|
13
|
+
* and the tool policy used to auto-answer permission requests for THIS session. */
|
|
14
|
+
declare class SessionState {
|
|
15
|
+
readonly policy: ToolPolicy;
|
|
16
|
+
readonly textChunks: string[];
|
|
17
|
+
readonly history: AgentHistoryEntry[];
|
|
18
|
+
readonly usage: UsageAccumulator;
|
|
19
|
+
rawResultSuccess: RawResultSuccess | undefined;
|
|
20
|
+
private turnStartIndex;
|
|
21
|
+
constructor(policy: ToolPolicy);
|
|
22
|
+
/** Mark the start of a new turn so currentTurnText()/structured_output read only this turn. */
|
|
23
|
+
beginTurn(): void;
|
|
24
|
+
currentTurnText(): string;
|
|
25
|
+
applyUpdate(update: SessionNotification["update"]): void;
|
|
26
|
+
applyRawMessage(message: RawResultSuccess | undefined): void;
|
|
27
|
+
}
|
|
28
|
+
export interface AcpSessionOptions {
|
|
29
|
+
/** Absolute working directory for the ACP session (worktree isolation). */
|
|
30
|
+
cwd: string;
|
|
31
|
+
/** The schema for this run, if any (drives the backend's session/prompt `_meta`). */
|
|
32
|
+
schema: TSchema | undefined;
|
|
33
|
+
policy: ToolPolicy;
|
|
34
|
+
signal?: AbortSignal;
|
|
35
|
+
/** Client-provided MCP servers to attach at session/new. Omitted => `[]` (the default). */
|
|
36
|
+
mcpServers?: McpServerConfig[];
|
|
37
|
+
/** Engine run id, stamped onto session/new `_meta` (META_KEYS.runId) as a correlation id.
|
|
38
|
+
* Omitted => no runId `_meta` is stamped (the request `_meta` is whatever the backend set). */
|
|
39
|
+
runId?: string;
|
|
40
|
+
}
|
|
41
|
+
/** Notified by a PooledConnection when its process dies, so the pool can drop it. */
|
|
42
|
+
export interface PooledConnectionDeps {
|
|
43
|
+
onDead(connection: PooledConnection): void;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* One long-lived ACP server subprocess + its held ACP client connection. Initialized ONCE and
|
|
47
|
+
* reused across agent() calls; it multiplexes many concurrent sessions. The process is NOT killed
|
|
48
|
+
* between sessions — only dispose() (pool teardown) or a crash ends it.
|
|
49
|
+
*/
|
|
50
|
+
export declare class PooledConnection {
|
|
51
|
+
readonly backendId: BackendId;
|
|
52
|
+
/** The held ACP connection; SessionHandles drive their session/* calls through it. */
|
|
53
|
+
readonly rpc: ClientSideConnection;
|
|
54
|
+
private readonly backend;
|
|
55
|
+
private readonly child;
|
|
56
|
+
private readonly client;
|
|
57
|
+
private readonly onDead;
|
|
58
|
+
/** Resolves once `initialize` completed (or rejects if the process died first). */
|
|
59
|
+
private readonly ready;
|
|
60
|
+
/** Resolves when the process dies; `race()` turns it into a thrown, descriptive error. */
|
|
61
|
+
private readonly whenDead;
|
|
62
|
+
private resolveDead;
|
|
63
|
+
private deathError;
|
|
64
|
+
private supportsClose;
|
|
65
|
+
private _alive;
|
|
66
|
+
private _activeSessions;
|
|
67
|
+
private stderrTail;
|
|
68
|
+
private constructor();
|
|
69
|
+
/** Spawn the backend and kick off the single `initialize`. Returns immediately; callers await
|
|
70
|
+
* readiness implicitly via openSession(). */
|
|
71
|
+
static create(backend: Backend, deps: PooledConnectionDeps): PooledConnection;
|
|
72
|
+
get alive(): boolean;
|
|
73
|
+
get activeSessions(): number;
|
|
74
|
+
/** Mark this connection dead exactly once, then ask the pool to evict it. Idempotent. */
|
|
75
|
+
private die;
|
|
76
|
+
private stderrSuffix;
|
|
77
|
+
/** Race a wire call against process death so a crash surfaces a clear error instead of hanging
|
|
78
|
+
* on a JSON-RPC response that will never come. */
|
|
79
|
+
race<T>(op: Promise<T>): Promise<T>;
|
|
80
|
+
private initialize;
|
|
81
|
+
/**
|
|
82
|
+
* Open a new per-agent session on this pooled connection: session/new { cwd }, register its
|
|
83
|
+
* accumulator for routing, and return a SessionHandle. `activeSessions` is reserved
|
|
84
|
+
* synchronously (before the first await) so the pool's load accounting is race-free.
|
|
85
|
+
*/
|
|
86
|
+
openSession(opts: AcpSessionOptions): Promise<SessionHandle>;
|
|
87
|
+
/** Best-effort ACP cancel for one session (wired to opts.signal). The PROCESS stays pooled. */
|
|
88
|
+
cancelSession(sessionId: string): Promise<void>;
|
|
89
|
+
/**
|
|
90
|
+
* Release a session: stop routing it, free the load slot, and best-effort session/close on the
|
|
91
|
+
* wire (capability-gated, bounded, never fatal). The PROCESS is NOT killed — it returns to the
|
|
92
|
+
* pool for the next agent() call.
|
|
93
|
+
*/
|
|
94
|
+
releaseSession(sessionId: string): Promise<void>;
|
|
95
|
+
/** Synchronous best-effort kill for a process-exit hook (no time to await a graceful close). */
|
|
96
|
+
killNow(): void;
|
|
97
|
+
/** Close the process (pool teardown): end stdin, SIGTERM, escalate to SIGKILL, await exit. */
|
|
98
|
+
dispose(): Promise<void>;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* One agent() run's ACP session on a pooled connection. Owns the per-session cwd/schema/policy,
|
|
102
|
+
* the model-selection state, and the abort wiring. On release() it lets go of the session
|
|
103
|
+
* WITHOUT killing the pooled process. Implements StructuredSource for the backend's native read.
|
|
104
|
+
*/
|
|
105
|
+
export declare class SessionHandle implements StructuredSource {
|
|
106
|
+
private readonly pooled;
|
|
107
|
+
private readonly sessionId;
|
|
108
|
+
private readonly state;
|
|
109
|
+
private readonly opts;
|
|
110
|
+
private configOptions;
|
|
111
|
+
private removeAbort;
|
|
112
|
+
private released;
|
|
113
|
+
constructor(pooled: PooledConnection, sessionId: string, state: SessionState, configOptions: SessionConfigOption[], opts: AcpSessionOptions);
|
|
114
|
+
/** Per-session usage accumulator (read by the runner on BOTH success and error paths). */
|
|
115
|
+
get usage(): UsageAccumulator;
|
|
116
|
+
/** Diagnostic message/tool history accumulated across this session's run. */
|
|
117
|
+
get history(): AgentHistoryEntry[];
|
|
118
|
+
/**
|
|
119
|
+
* Select the model for this session from the agent-advertised config options (§5.4).
|
|
120
|
+
* Returns `matched:false` (the caller fires onModelFallback) when the catalog has no value
|
|
121
|
+
* matching the spec, leaving the session default in place.
|
|
122
|
+
*
|
|
123
|
+
* Beyond the `model` select, this also drives the sibling config options the catalog may
|
|
124
|
+
* advertise (codex-acp), decoded from the `model[effort]` spec encoding:
|
|
125
|
+
* - `reasoning_effort` (id "reasoning_effort" / category "thought_level"): set to the
|
|
126
|
+
* bracketed effort token, e.g. `gpt-5.1-codex[high]` -> "high".
|
|
127
|
+
* - Fast mode (id "fast-mode" / category "fast-mode"): turned on when the bracket carries
|
|
128
|
+
* a `fast` token.
|
|
129
|
+
* Each is best-effort and advertise-gated: when the catalog does not expose the option, or
|
|
130
|
+
* the requested value is not among its choices, the modifier is NOT applied — but, unlike
|
|
131
|
+
* before, that silent no-op is now SURFACED. `modifierFallbacks` lists a descriptor for every
|
|
132
|
+
* requested effort/Fast value that could not be applied, so the caller can fire the same
|
|
133
|
+
* onModelFallback channel model selection uses (incorrect tiering becomes observable). It
|
|
134
|
+
* stays best-effort: an unmet modifier is reported, never thrown.
|
|
135
|
+
*/
|
|
136
|
+
selectModel(spec: string): Promise<{
|
|
137
|
+
matched: boolean;
|
|
138
|
+
resolved?: string;
|
|
139
|
+
modifierFallbacks?: string[];
|
|
140
|
+
}>;
|
|
141
|
+
/**
|
|
142
|
+
* Drive reasoning_effort + Fast-mode from the `model[effort]` spec bracket, when advertised.
|
|
143
|
+
* Returns a descriptor for each requested modifier that could NOT be applied because the
|
|
144
|
+
* catalog does not advertise the option or the requested value — the symmetric signal to
|
|
145
|
+
* model fallback, so the no-op is observable rather than silent. When the resolved model id
|
|
146
|
+
* already ENCODES the bracket (e.g. a `gpt-5-codex[high]` catalog value), the effort is
|
|
147
|
+
* carried by the model select itself, so it is treated as satisfied (no fallback).
|
|
148
|
+
*/
|
|
149
|
+
private applyModelModifiers;
|
|
150
|
+
/** Set one session config option via the wire method and adopt the echoed catalog. */
|
|
151
|
+
private applyConfigOption;
|
|
152
|
+
/** Send a prompt turn and drain it; returns the final PromptResponse. */
|
|
153
|
+
prompt(text: string, promptMeta?: Record<string, unknown>): Promise<PromptResponse>;
|
|
154
|
+
/** StructuredSource — the latest turn's assistant text. */
|
|
155
|
+
currentTurnText(): string;
|
|
156
|
+
/** StructuredSource — Claude's raw structured_output for the latest turn, if any. */
|
|
157
|
+
rawStructuredOutput(): unknown;
|
|
158
|
+
/** Best-effort ACP cancel (wired to opts.signal). The agent settles the turn as "cancelled". */
|
|
159
|
+
cancel(): Promise<void>;
|
|
160
|
+
/** Let go of this session WITHOUT killing the pooled process; idempotent. */
|
|
161
|
+
release(): Promise<void>;
|
|
162
|
+
}
|
|
163
|
+
export {};
|
|
164
|
+
//# sourceMappingURL=acp-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acp-client.d.ts","sourceRoot":"","sources":["../src/acp-client.ts"],"names":[],"mappings":"AAwBA,OAAO,EACL,oBAAoB,EAOpB,KAAK,cAAc,EAGnB,KAAK,mBAAmB,EAGxB,KAAK,mBAAmB,EACzB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAa,KAAK,iBAAiB,EAAE,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAC;AACrG,OAAO,KAAK,EAAE,OAAO,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