@claudexor/harness-acp 3.20.1

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Anton Razzhigaev
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/NOTICE ADDED
@@ -0,0 +1,23 @@
1
+ Permission, environment, launch and ACP event/lifecycle semantics adapted in
2
+ TypeScript from razzant/ouroboros#769 by Róger Valderrama (@germago119),
3
+ which credits Q00/ouroboros. No Python runtime code is included.
4
+
5
+ Copyright (c) 2025 Q00
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in all
15
+ copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ SOFTWARE.
@@ -0,0 +1,14 @@
1
+ /** Bounded hand-off: a slow transcript consumer backpressures the child pipe. */
2
+ export declare class Channel<T> {
3
+ private readonly capacity;
4
+ private values;
5
+ private waiters;
6
+ closed: boolean;
7
+ constructor(capacity?: number);
8
+ private wake;
9
+ private wait;
10
+ push(value: T, signal?: AbortSignal): Promise<void>;
11
+ read(): AsyncGenerator<T>;
12
+ close(): void;
13
+ }
14
+ //# sourceMappingURL=channel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../src/channel.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,qBAAa,OAAO,CAAC,CAAC;IAKR,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAJrC,OAAO,CAAC,MAAM,CAAW;IACzB,OAAO,CAAC,OAAO,CAAyB;IACxC,MAAM,UAAS;IAEf,YAA6B,QAAQ,SAAK,EAAI;IAE9C,OAAO,CAAC,IAAI;YAKE,IAAI;IAgBZ,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,WAAW,iBAMxC;IAEM,IAAI,IAAI,cAAc,CAAC,CAAC,CAAC,CAU/B;IAED,KAAK,SAGJ;CACF"}
@@ -0,0 +1,56 @@
1
+ /** Bounded hand-off: a slow transcript consumer backpressures the child pipe. */
2
+ export class Channel {
3
+ capacity;
4
+ values = [];
5
+ waiters = new Set();
6
+ closed = false;
7
+ constructor(capacity = 16) {
8
+ this.capacity = capacity;
9
+ }
10
+ wake() {
11
+ for (const waiter of this.waiters)
12
+ waiter();
13
+ this.waiters.clear();
14
+ }
15
+ async wait(signal) {
16
+ if (signal?.aborted)
17
+ throw new Error("ACP cancelled");
18
+ let resume;
19
+ const ready = new Promise((resolve) => {
20
+ resume = resolve;
21
+ });
22
+ this.waiters.add(resume);
23
+ signal?.addEventListener("abort", resume, { once: true });
24
+ try {
25
+ await ready;
26
+ }
27
+ finally {
28
+ signal?.removeEventListener("abort", resume);
29
+ this.waiters.delete(resume);
30
+ }
31
+ }
32
+ async push(value, signal) {
33
+ while (!this.closed && !signal?.aborted && this.values.length >= this.capacity)
34
+ await this.wait(signal);
35
+ if (this.closed || signal?.aborted)
36
+ throw new Error("ACP channel closed");
37
+ this.values.push(value);
38
+ this.wake();
39
+ }
40
+ async *read() {
41
+ while (!this.closed || this.values.length) {
42
+ if (!this.values.length) {
43
+ await this.wait();
44
+ continue;
45
+ }
46
+ const value = this.values.shift();
47
+ this.wake();
48
+ yield value;
49
+ }
50
+ }
51
+ close() {
52
+ this.closed = true;
53
+ this.wake();
54
+ }
55
+ }
56
+ //# sourceMappingURL=channel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channel.js","sourceRoot":"","sources":["../src/channel.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,MAAM,OAAO,OAAO;IAKW,QAAQ;IAJ7B,MAAM,GAAQ,EAAE,CAAC;IACjB,OAAO,GAAG,IAAI,GAAG,EAAc,CAAC;IACxC,MAAM,GAAG,KAAK,CAAC;IAEf,YAA6B,QAAQ,GAAG,EAAE;wBAAb,QAAQ;IAAQ,CAAC;IAEtC,IAAI;QACV,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,OAAO;YAAE,MA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CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YAC1C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;gBACxB,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;gBAClB,SAAS;YACX,CAAC;YACD,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,EAAG,CAAC;YACnC,IAAI,CAAC,IAAI,EAAE,CAAC;YACZ,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;IAED,KAAK;QACH,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC;CACF"}
@@ -0,0 +1,22 @@
1
+ import type { PinnedVendorCliVersion } from "@claudexor/util";
2
+ /** Agent identity stays vendor-specific; the transport is shared. */
3
+ export interface AcpEntry {
4
+ id: string;
5
+ displayName: string;
6
+ binary: string;
7
+ binaryEnv: string;
8
+ npmPackage: string;
9
+ version: PinnedVendorCliVersion;
10
+ flags: readonly string[];
11
+ tokenEnv: string;
12
+ homeEnv: string;
13
+ homeDir: string;
14
+ readTools: readonly string[];
15
+ workspaceTools: readonly string[];
16
+ effortLevels: readonly string[];
17
+ modelHints: readonly string[];
18
+ /** Prefix of a single-line first chunk that reports disabled tools: status, not answer. */
19
+ disabledToolsNotice?: string;
20
+ }
21
+ export declare const copilot: AcpEntry;
22
+ //# sourceMappingURL=entry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry.d.ts","sourceRoot":"","sources":["../src/entry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAE9D,qEAAqE;AACrE,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,sBAAsB,CAAC;IAChC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B,2FAA2F;IAC3F,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAID,eAAO,MAAM,OAAO,EAAE,QAqCrB,CAAC"}
package/dist/entry.js ADDED
@@ -0,0 +1,41 @@
1
+ // Docs-verified 2026-10-03, not a live CLI conformance claim. The npm pin is
2
+ // deterministic_only. --no-remote disables remote control, not network access.
3
+ export const copilot = {
4
+ id: "copilot",
5
+ displayName: "GitHub Copilot",
6
+ binary: "copilot",
7
+ binaryEnv: "CLAUDEXOR_COPILOT_BIN",
8
+ npmPackage: "@github/copilot",
9
+ version: "1.0.91",
10
+ flags: [
11
+ "--acp",
12
+ "--stdio",
13
+ "--no-auto-update",
14
+ "--no-ask-user",
15
+ "--no-color",
16
+ "--no-bash-env",
17
+ "--disable-builtin-mcps",
18
+ "--disallow-temp-dir",
19
+ "--no-remote",
20
+ ],
21
+ tokenEnv: "COPILOT_GITHUB_TOKEN",
22
+ homeEnv: "COPILOT_HOME",
23
+ homeDir: ".copilot",
24
+ readTools: ["view", "glob", "grep"],
25
+ workspaceTools: [
26
+ "view",
27
+ "glob",
28
+ "grep",
29
+ "edit",
30
+ "create",
31
+ "apply_patch",
32
+ "bash",
33
+ "read_bash",
34
+ "stop_bash",
35
+ "list_bash",
36
+ ],
37
+ effortLevels: ["low", "medium", "high", "xhigh", "max"],
38
+ modelHints: ["claude-sonnet-4.6", "gpt-5.4"],
39
+ disabledToolsNotice: "Info: Disabled tools: ",
40
+ };
41
+ //# sourceMappingURL=entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry.js","sourceRoot":"","sources":["../src/entry.ts"],"names":[],"mappings":"AAsBA,6EAA6E;AAC7E,+EAA+E;AAC/E,MAAM,CAAC,MAAM,OAAO,GAAa;IAC/B,EAAE,EAAE,SAAS;IACb,WAAW,EAAE,gBAAgB;IAC7B,MAAM,EAAE,SAAS;IACjB,SAAS,EAAE,uBAAuB;IAClC,UAAU,EAAE,iBAAiB;IAC7B,OAAO,EAAE,QAAQ;IACjB,KAAK,EAAE;QACL,OAAO;QACP,SAAS;QACT,kBAAkB;QAClB,eAAe;QACf,YAAY;QACZ,eAAe;QACf,wBAAwB;QACxB,qBAAqB;QACrB,aAAa;KACd;IACD,QAAQ,EAAE,sBAAsB;IAChC,OAAO,EAAE,cAAc;IACvB,OAAO,EAAE,UAAU;IACnB,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;IACnC,cAAc,EAAE;QACd,MAAM;QACN,MAAM;QACN,MAAM;QACN,MAAM;QACN,QAAQ;QACR,aAAa;QACb,MAAM;QACN,WAAW;QACX,WAAW;QACX,WAAW;KACZ;IACD,YAAY,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC;IACvD,UAAU,EAAE,CAAC,mBAAmB,EAAE,SAAS,CAAC;IAC5C,mBAAmB,EAAE,wBAAwB;CAC9C,CAAC"}
package/dist/env.d.ts ADDED
@@ -0,0 +1,23 @@
1
+ import { resolveSecret } from "@claudexor/secrets";
2
+ import { type CredentialProfile } from "@claudexor/schema";
3
+ import type { AcpEntry } from "./entry.js";
4
+ export declare function acpToken(entry: AcpEntry, profile?: CredentialProfile | null, get?: typeof resolveSecret): string;
5
+ export declare function probeAcpProfile(entry: AcpEntry, profile: CredentialProfile, get?: typeof resolveSecret): {
6
+ profile_id: string;
7
+ harness_id: string;
8
+ availability: "available" | "unavailable" | "unknown";
9
+ verification: "failed" | "not_run" | "passed";
10
+ verification_source: "local_store" | "vendor";
11
+ stale?: boolean | undefined;
12
+ stale_age_ms?: number | undefined;
13
+ stale_basis?: "last_positive_after_timeout" | undefined;
14
+ detail?: string | undefined;
15
+ last_verified_at: string | null;
16
+ };
17
+ /** A complete patch over the shared spawn base, not a partial denylist. */
18
+ export declare function acpChildEnv(entry: AcpEntry, home: string, token: string, source?: NodeJS.ProcessEnv): Record<string, string | null>;
19
+ export declare function prepareAcpEnv(entry: AcpEntry, token: string, overrides?: Record<string, string | null | undefined>): {
20
+ env: Record<string, string | null>;
21
+ dispose: () => void;
22
+ };
23
+ //# sourceMappingURL=env.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAKA,OAAO,EAA2B,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAA2B,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACpF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAyB3C,wBAAgB,QAAQ,CACtB,KAAK,EAAE,QAAQ,EACf,OAAO,GAAE,iBAAiB,GAAG,IAAW,EACxC,GAAG,uBAAgB,GAClB,MAAM,CAkBR;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,iBAAiB,EAAE,GAAG,uBAAgB;;;;;;;;;;;EAmB/F;AAED,2EAA2E;AAC3E,wBAAgB,WAAW,CACzB,KAAK,EAAE,QAAQ,EACf,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,MAAM,GAAE,MAAM,CAAC,UAAwB,GACtC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAiB/B;AAED,wBAAgB,aAAa,CAC3B,KAAK,EAAE,QAAQ,EACf,KAAK,EAAE,MAAM,EACb,SAAS,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAM;IAYvD,GAAG;IACH,OAAO;EAIV"}
package/dist/env.js ADDED
@@ -0,0 +1,102 @@
1
+ // Environment/credential semantics from ouroboros#769; Q00 MIT notice: ../NOTICE.
2
+ import { mkdirSync, mkdtempSync, rmSync } from "node:fs";
3
+ import { tmpdir } from "node:os";
4
+ import { join } from "node:path";
5
+ import { composeBaseEnv, HarnessUnavailableError } from "@claudexor/core";
6
+ import { namespacedSecretRefBase, resolveSecret } from "@claudexor/secrets";
7
+ import { CredentialProfileStatus } from "@claudexor/schema";
8
+ const BASE_KEYS = new Set([
9
+ "PATH",
10
+ "SYSTEMROOT",
11
+ "WINDIR",
12
+ "COMSPEC",
13
+ "PATHEXT",
14
+ "TEMP",
15
+ "TMP",
16
+ "TMPDIR",
17
+ "LANG",
18
+ "LC_ALL",
19
+ "LC_CTYPE",
20
+ "HTTP_PROXY",
21
+ "HTTPS_PROXY",
22
+ "ALL_PROXY",
23
+ "NO_PROXY",
24
+ "NODE_EXTRA_CA_CERTS",
25
+ "SSL_CERT_FILE",
26
+ "SSL_CERT_DIR",
27
+ "GH_HOST",
28
+ "COPILOT_GH_HOST",
29
+ ]);
30
+ export function acpToken(entry, profile = null, get = resolveSecret) {
31
+ if (profile &&
32
+ (profile.harness_id !== entry.id ||
33
+ profile.credential_kind !== "api_key" ||
34
+ namespacedSecretRefBase(profile.secret_ref) !== entry.id)) {
35
+ throw new HarnessUnavailableError(`${entry.id} requires an api_key profile with a namespaced ${entry.id}:<profile> secret`);
36
+ }
37
+ const ref = profile?.secret_ref ?? entry.id;
38
+ const token = get(ref);
39
+ if (!token)
40
+ throw new HarnessUnavailableError(`${entry.displayName} is not logged in: store the ${ref} secret in Claudexor`);
41
+ return token;
42
+ }
43
+ export function probeAcpProfile(entry, profile, get = resolveSecret) {
44
+ try {
45
+ acpToken(entry, profile, get);
46
+ return CredentialProfileStatus.parse({
47
+ profile_id: profile.profile_id,
48
+ harness_id: entry.id,
49
+ availability: "available",
50
+ verification: "not_run",
51
+ detail: `secret ${profile.secret_ref} is stored; vendor acceptance is unverified`,
52
+ });
53
+ }
54
+ catch (error) {
55
+ return CredentialProfileStatus.parse({
56
+ profile_id: profile.profile_id,
57
+ harness_id: entry.id,
58
+ availability: "unavailable",
59
+ verification: "not_run",
60
+ detail: error instanceof Error ? error.message : String(error),
61
+ });
62
+ }
63
+ }
64
+ /** A complete patch over the shared spawn base, not a partial denylist. */
65
+ export function acpChildEnv(entry, home, token, source = process.env) {
66
+ const env = Object.fromEntries(Object.keys(composeBaseEnv("mirror_native")).map((key) => [key, null]));
67
+ for (const [key, value] of Object.entries(composeBaseEnv("mirror_native", source))) {
68
+ if (BASE_KEYS.has(key.toUpperCase()) && value !== undefined)
69
+ env[key] = value;
70
+ }
71
+ return {
72
+ ...env,
73
+ HOME: home,
74
+ USERPROFILE: home,
75
+ XDG_CONFIG_HOME: join(home, ".config"),
76
+ XDG_CACHE_HOME: join(home, ".cache"),
77
+ XDG_DATA_HOME: join(home, ".local", "share"),
78
+ [entry.homeEnv]: join(home, entry.homeDir),
79
+ [entry.tokenEnv]: token,
80
+ };
81
+ }
82
+ export function prepareAcpEnv(entry, token, overrides = {}) {
83
+ // Unscoped in-place/default probes get a disposable vendor HOME too.
84
+ const base = overrides["HOME"] ? null : mkdtempSync(join(tmpdir(), "claudexor-acp-"));
85
+ const home = overrides["HOME"] || join(base, "home");
86
+ mkdirSync(join(home, entry.homeDir), { recursive: true, mode: 0o700 });
87
+ const source = { ...process.env };
88
+ for (const [key, value] of Object.entries(overrides)) {
89
+ if (value == null)
90
+ delete source[key];
91
+ else
92
+ source[key] = value;
93
+ }
94
+ return {
95
+ env: acpChildEnv(entry, home, token, source),
96
+ dispose: () => {
97
+ if (base)
98
+ rmSync(base, { recursive: true, force: true });
99
+ },
100
+ };
101
+ }
102
+ //# sourceMappingURL=env.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.js","sourceRoot":"","sources":["../src/env.ts"],"names":[],"m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AAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;QACrD,IAAI,KAAK,IAAI,IAAI;YAAE,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;;YACjC,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IAC3B,CAAC;IACD,OAAO;QACL,GAAG,EAAE,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC;QAC5C,OAAO,EAAE,GAAG,EAAE;YACZ,IAAI,IAAI;gBAAE,MAAM,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAC3D,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,24 @@
1
+ import type { HarnessEvent } from "@claudexor/schema";
2
+ export declare class AcpFailure extends Error {
3
+ readonly code: string;
4
+ constructor(code: string, message: string);
5
+ }
6
+ export declare const record: (value: unknown) => Record<string, unknown>;
7
+ export declare class AcpEvents {
8
+ private readonly sessionId;
9
+ /** The vendor row's disabled-tools notice prefix (AcpEntry). */
10
+ private readonly noticePrefix?;
11
+ private answer;
12
+ private answerBytes;
13
+ private firstChunk;
14
+ private cost;
15
+ private calls;
16
+ constructor(sessionId: string,
17
+ /** The vendor row's disabled-tools notice prefix (AcpEntry). */
18
+ noticePrefix?: string | undefined);
19
+ event(type: HarnessEvent["type"], fields?: Partial<HarnessEvent>): HarnessEvent;
20
+ update(value: unknown): HarnessEvent[];
21
+ private tool;
22
+ finish(stop: string): HarnessEvent[];
23
+ }
24
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAW,MAAM,mBAAmB,CAAC;AAG/D,qBAAa,UAAW,SAAQ,KAAK;IAEjC,QAAQ,CAAC,IAAI,EAAE,MAAM;IADvB,YACW,IAAI,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,EAGhB;CACF;AAED,eAAO,MAAM,MAAM,UAAW,OAAO,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAGtD,CAAC;AAwBT,qBAAa,SAAS;IAQlB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,gEAAgE;IAChE,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;IAThC,OAAO,CAAC,MAAM,CAAM;IACpB,OAAO,CAAC,WAAW,CAAK;IACxB,OAAO,CAAC,UAAU,CAAQ;IAC1B,OAAO,CAAC,IAAI,CAAK;IACjB,OAAO,CAAC,KAAK,CAAmC;IAEhD,YACmB,SAAS,EAAE,MAAM;IAClC,gEAAgE;IAC/C,YAAY,CAAC,EAAE,MAAM,YAAA,EACpC;IAEJ,KAAK,CAAC,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC,EAAE,MAAM,GAAE,OAAO,CAAC,YAAY,CAAM,GAAG,YAAY,CAElF;IAED,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,EAAE,CAgErC;IAED,OAAO,CAAC,IAAI;IA+DZ,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,EAAE,CAcnC;CACF"}
package/dist/events.js ADDED
@@ -0,0 +1,183 @@
1
+ import { nowIso } from "@claudexor/util";
2
+ export class AcpFailure extends Error {
3
+ code;
4
+ constructor(code, message) {
5
+ super(message);
6
+ this.code = code;
7
+ }
8
+ }
9
+ export const record = (value) => value && typeof value === "object" && !Array.isArray(value)
10
+ ? value
11
+ : {};
12
+ const TOOL_KINDS = {
13
+ read: "file",
14
+ edit: "file",
15
+ delete: "file",
16
+ move: "file",
17
+ search: "search",
18
+ execute: "command",
19
+ fetch: "web",
20
+ };
21
+ export class AcpEvents {
22
+ sessionId;
23
+ noticePrefix;
24
+ answer = "";
25
+ answerBytes = 0;
26
+ firstChunk = true;
27
+ cost = 0;
28
+ calls = new Map();
29
+ constructor(sessionId,
30
+ /** The vendor row's disabled-tools notice prefix (AcpEntry). */
31
+ noticePrefix) {
32
+ this.sessionId = sessionId;
33
+ this.noticePrefix = noticePrefix;
34
+ }
35
+ event(type, fields = {}) {
36
+ return { type, session_id: this.sessionId, ts: nowIso(), ...fields };
37
+ }
38
+ update(value) {
39
+ const raw = record(value);
40
+ const update = raw;
41
+ const child = typeof record(raw["_meta"])["parentToolCallId"] === "string";
42
+ switch (update.sessionUpdate) {
43
+ case "agent_message_chunk":
44
+ case "agent_thought_chunk": {
45
+ if (update.content?.type !== "text" || typeof update.content.text !== "string")
46
+ return [];
47
+ const text = update.content.text;
48
+ if (update.sessionUpdate === "agent_thought_chunk")
49
+ return [this.event("thinking", { text })];
50
+ if (child)
51
+ return [this.event("status", { payload: { child_message: text } })];
52
+ const notice = this.firstChunk &&
53
+ this.noticePrefix !== undefined &&
54
+ text.startsWith(this.noticePrefix) &&
55
+ !text.trimEnd().includes("\n");
56
+ this.firstChunk = false;
57
+ if (notice)
58
+ return [this.event("status", { text })];
59
+ this.answerBytes += Buffer.byteLength(text);
60
+ if (this.answerBytes > 8 * 1024 * 1024)
61
+ throw new AcpFailure("answer_too_large", "ACP answer exceeds 8 MiB");
62
+ this.answer += text;
63
+ return [this.event("message", { text, payload: { delta: true } })];
64
+ }
65
+ case "plan":
66
+ return [
67
+ this.event("status", {
68
+ plan_progress: {
69
+ items: update.entries.map((entry, i) => ({
70
+ id: String(i),
71
+ title: entry.content,
72
+ status: entry.status,
73
+ })),
74
+ },
75
+ }),
76
+ ];
77
+ case "tool_call":
78
+ case "tool_call_update":
79
+ return this.tool(update, child);
80
+ case "usage_update": {
81
+ const amount = update.cost?.amount;
82
+ const usd = update.cost?.currency === "USD" &&
83
+ typeof amount === "number" &&
84
+ Number.isFinite(amount) &&
85
+ amount >= this.cost;
86
+ const usage = usd ? { cost_usd: amount - this.cost } : {};
87
+ if (usd)
88
+ this.cost = amount;
89
+ // used/size are context occupancy, not billable input/output tokens.
90
+ return [
91
+ this.event("usage", {
92
+ usage,
93
+ payload: {
94
+ context_used: update.used,
95
+ context_size: update.size,
96
+ cost: update.cost ?? null,
97
+ },
98
+ }),
99
+ ];
100
+ }
101
+ default:
102
+ return []; // Every wire frame is retained by the transport.
103
+ }
104
+ }
105
+ tool(update, child) {
106
+ const id = update.toolCallId;
107
+ if (typeof id !== "string" || !id)
108
+ throw new AcpFailure("invalid_tool", "ACP tool call has no id");
109
+ let call = this.calls.get(id);
110
+ const first = !call;
111
+ if (!call) {
112
+ if (this.calls.size >= 4096)
113
+ throw new AcpFailure("too_many_tools", "ACP turn exceeds 4096 tool calls");
114
+ call = { terminal: false };
115
+ this.calls.set(id, call);
116
+ if (!child) {
117
+ this.answer = "";
118
+ this.answerBytes = 0;
119
+ }
120
+ }
121
+ if (call.terminal)
122
+ return [];
123
+ if (update.title != null)
124
+ call.title = update.title;
125
+ if (update.kind != null)
126
+ call.kind = update.kind;
127
+ if (update.status != null)
128
+ call.status = update.status;
129
+ if (update.rawOutput != null) {
130
+ const output = record(update.rawOutput);
131
+ const exit = [output["exitCode"], output["exit_code"], output["returncode"]].find((value) => typeof value === "number" && Number.isInteger(value));
132
+ call.exitCode = exit;
133
+ call.reportedError = output["isError"] === true || output["success"] === false;
134
+ }
135
+ const tool = {
136
+ name: (call.title ?? call.kind ?? "tool").slice(0, 512),
137
+ kind: TOOL_KINDS[call.kind ?? ""] ?? "other",
138
+ use_id: id,
139
+ };
140
+ const events = first ? [this.event("tool_call", { tool: { ...tool } })] : [];
141
+ // ACP may attach a diff before its terminal status update. Keep that
142
+ // evidence when it arrives; a file_change is not proof of a disk write.
143
+ for (const item of update.content ?? []) {
144
+ if (item.type === "diff")
145
+ events.push(this.event("file_change", {
146
+ payload: { path: item.path, old_text: item.oldText, new_text: item.newText },
147
+ }));
148
+ }
149
+ if (call.status !== "completed" && call.status !== "failed")
150
+ return events;
151
+ call.terminal = true;
152
+ const { exitCode } = call;
153
+ const failed = call.status === "failed" ||
154
+ call.reportedError === true ||
155
+ (exitCode !== undefined && exitCode !== 0);
156
+ events.push(this.event("tool_result", {
157
+ tool: {
158
+ ...tool,
159
+ status: failed ? "error" : "ok",
160
+ ...(exitCode !== undefined ? { exit_code: exitCode } : {}),
161
+ },
162
+ }));
163
+ return events;
164
+ }
165
+ finish(stop) {
166
+ if (stop === "cancelled")
167
+ return [];
168
+ if (stop !== "end_turn")
169
+ throw new AcpFailure(stop, `ACP turn stopped: ${stop}`);
170
+ if ([...this.calls.values()].some((call) => !call.terminal))
171
+ throw new AcpFailure("unfinished_turn", "ACP end_turn left unfinished tool calls");
172
+ if (!this.answer.trim())
173
+ throw new AcpFailure("empty_answer", "ACP end_turn produced no final answer");
174
+ return [
175
+ this.event("message", {
176
+ text: this.answer,
177
+ final: true,
178
+ payload: { final_source: "session/prompt" },
179
+ }),
180
+ ];
181
+ }
182
+ }
183
+ //# sourceMappingURL=events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.js","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,MAAM,OAAO,UAAW,SAAQ,KAAK;IAExB,IAAI;IADf,YACW,IAAY,EACrB,OAAe;QAEf,KAAK,CAAC,OAAO,CAAC,CAAC;oBAHN,IAAI;IAIf,CAAC;CACF;AAED,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,KAAc,EAA2B,EAAE,CAChE,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;IACzD,CAAC,CAAE,KAAiC;IACpC,CAAC,CAAC,EAAE,CAAC;AAET,MAAM,UAAU,GAAoC;IAClD,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,KAAK;CACb,CAAC;AAcF,MAAM,O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AC,CAAC,CAAC;QAC7C,MAAM,CAAC,IAAI,CACT,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE;YACxB,IAAI,EAAE;gBACJ,GAAG,IAAI;gBACP,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI;gBAC/B,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAC3D;SACF,CAAC,CACH,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,CAAC,IAAY;QACjB,IAAI,IAAI,KAAK,WAAW;YAAE,OAAO,EAAE,CAAC;QACpC,IAAI,IAAI,KAAK,UAAU;YAAE,MAAM,IAAI,UAAU,CAAC,IAAI,EAAE,qBAAqB,IAAI,EAAE,CAAC,CAAC;QACjF,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC;YACzD,MAAM,IAAI,UAAU,CAAC,iBAAiB,EAAE,yCAAyC,CAAC,CAAC;QACrF,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;YACrB,MAAM,IAAI,UAAU,CAAC,cAAc,EAAE,uCAAuC,CAAC,CAAC;QAChF,OAAO;YACL,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE;gBACpB,IAAI,EAAE,IAAI,CAAC,MAAM;gBACjB,KAAK,EAAE,IAAI;gBACX,OAAO,EAAE,EAAE,YAAY,EAAE,gBAAgB,EAAE;aAC5C,CAAC;SACH,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,6 @@
1
+ import type { HarnessAdapter } from "@claudexor/core";
2
+ import type { AcpEntry } from "./entry.js";
3
+ export { copilot } from "./entry.js";
4
+ /** A vendor identity over the shared ACP v1 transport. */
5
+ export declare function createAcpAdapter(entry: AcpEntry): HarnessAdapter;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAK3C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,0DAA0D;AAC1D,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,QAAQ,GAAG,cAAc,CAchE"}
package/dist/index.js ADDED
@@ -0,0 +1,22 @@
1
+ import { acpCapabilityProfile } from "./manifest.js";
2
+ import { acpRunner } from "./run.js";
3
+ import { acpProbes } from "./probes.js";
4
+ import { probeAcpProfile } from "./env.js";
5
+ export { copilot } from "./entry.js";
6
+ /** A vendor identity over the shared ACP v1 transport. */
7
+ export function createAcpAdapter(entry) {
8
+ const runner = acpRunner(entry);
9
+ const profile = acpCapabilityProfile();
10
+ return {
11
+ id: entry.id,
12
+ effortParameter: "--effort",
13
+ capabilityProfile: profile,
14
+ ...acpProbes(entry, profile, runner),
15
+ run: runner.run,
16
+ cancel: runner.cancel,
17
+ async probeCredentialProfile(credential) {
18
+ return probeAcpProfile(entry, credential);
19
+ },
20
+ };
21
+ }
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,0DAA0D;AAC1D,MAAM,UAAU,gBAAgB,CAAC,KAAe;IAC9C,MAAM,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;IAChC,MAAM,OAAO,GAAG,oBAAoB,EAAE,CAAC;IACvC,OAAO;QACL,EAAE,EAAE,KAAK,CAAC,EAAE;QACZ,eAAe,EAAE,UAAU;QAC3B,iBAAiB,EAAE,OAAO;QAC1B,GAAG,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC;QACpC,GAAG,EAAE,MAAM,CAAC,GAAG;QACf,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,KAAK,CAAC,sBAAsB,CAAC,UAAU;YACrC,OAAO,eAAe,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;QAC5C,CAAC;KACF,CAAC;AACJ,CAAC"}