@ganglion/xacpx 0.19.3 → 0.20.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/adapters/adapter-catalog.d.ts +49 -2
- package/dist/adapters/adapter-npm.d.ts +6 -0
- package/dist/adapters/adapter-preinstall.d.ts +64 -0
- package/dist/adapters/adapter-registry.d.ts +1 -1
- package/dist/adapters/adapter-verifier.d.ts +10 -0
- package/dist/adapters/hermes-acp-shim.js +2 -10
- package/dist/adapters/hermes-shim.d.ts +6 -2
- package/dist/adapters/resolve-node-exe.d.ts +6 -0
- package/dist/bridge/bridge-main.js +2877 -616
- package/dist/channels/types.d.ts +3 -0
- package/dist/cli.js +4285 -1372
- package/dist/config/agent-catalog.d.ts +4 -2
- package/dist/config/agent-launch.d.ts +28 -0
- package/dist/config/config-path.d.ts +1 -0
- package/dist/config/local-agent-bin.d.ts +7 -0
- package/dist/config/resolve-agent-command.d.ts +23 -1
- package/dist/config/types.d.ts +4 -0
- package/dist/control/control-event-bus.d.ts +2 -0
- package/dist/control/control-service.d.ts +9 -0
- package/dist/control/session-turn-runner.d.ts +1 -0
- package/dist/control/turn-queue.d.ts +4 -0
- package/dist/control/turn-support.d.ts +4 -0
- package/dist/i18n/types.d.ts +5 -0
- package/dist/logging/app-logger.d.ts +1 -0
- package/dist/plugin-api.js +12 -2
- package/dist/process/ipc-guard.d.ts +24 -0
- package/dist/process/terminate-process-tree.d.ts +11 -0
- package/dist/process/windows-process-identity.d.ts +7 -0
- package/dist/process/windows-process-tree.d.ts +57 -0
- package/dist/sessions/session-service.d.ts +33 -3
- package/dist/state/replace-runtime-state.d.ts +3 -0
- package/dist/state/types.d.ts +5 -0
- package/dist/transport/types.d.ts +15 -0
- package/dist/weixin/monitor/consumer-lock.d.ts +6 -0
- package/package.json +11 -4
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ Chat isn't the only entry point: xacpx also ships a self-hostable **[relay hub](
|
|
|
31
31
|
|
|
32
32
|
### Prerequisites
|
|
33
33
|
|
|
34
|
-
- Node.js 22.
|
|
34
|
+
- Node.js 22.13+ or Bun
|
|
35
35
|
- A working agent CLI you intend to use, such as Codex / Claude Code / Gemini / OpenCode
|
|
36
36
|
- A phone with WeChat, Feishu, or Yuanbao installed
|
|
37
37
|
|
|
@@ -2,24 +2,71 @@ export declare const MANAGED_ADAPTERS: {
|
|
|
2
2
|
readonly codex: {
|
|
3
3
|
readonly packageName: "@agentclientprotocol/codex-acp";
|
|
4
4
|
readonly binName: "codex-acp";
|
|
5
|
-
readonly defaultVersion: "1.1.
|
|
5
|
+
readonly defaultVersion: "1.1.9";
|
|
6
6
|
};
|
|
7
7
|
readonly claude: {
|
|
8
8
|
readonly packageName: "@agentclientprotocol/claude-agent-acp";
|
|
9
9
|
readonly binName: "claude-agent-acp";
|
|
10
|
-
readonly defaultVersion: "0.
|
|
10
|
+
readonly defaultVersion: "0.64.2";
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
13
|
export type ManagedAdapterId = keyof typeof MANAGED_ADAPTERS;
|
|
14
14
|
export type AdapterVersionOverrides = Partial<Record<ManagedAdapterId, string>>;
|
|
15
|
+
export interface ManagedNpxCommand {
|
|
16
|
+
kind: "npx";
|
|
17
|
+
id: ManagedAdapterId;
|
|
18
|
+
version: string;
|
|
19
|
+
registry?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ManagedPreinstalledCommand {
|
|
22
|
+
kind: "preinstalled";
|
|
23
|
+
id: ManagedAdapterId;
|
|
24
|
+
releaseId: string;
|
|
25
|
+
nodeExecutable: string;
|
|
26
|
+
entryPath: string;
|
|
27
|
+
}
|
|
28
|
+
export type DecodedManagedAdapterCommand = ManagedNpxCommand | ManagedPreinstalledCommand;
|
|
15
29
|
export declare function isManagedAdapterId(value: string): value is ManagedAdapterId;
|
|
16
30
|
export declare function listManagedAdapterIds(): ManagedAdapterId[];
|
|
17
31
|
export declare function isExactAdapterVersion(value: string): boolean;
|
|
18
32
|
export declare function effectiveAdapterVersion(id: ManagedAdapterId, overrides: AdapterVersionOverrides | undefined): string;
|
|
33
|
+
export declare function buildManagedAdapterArgv(id: ManagedAdapterId, version: string, registry?: string): string[];
|
|
19
34
|
export declare function buildManagedAdapterCommand(id: ManagedAdapterId, version: string, registry?: string): string;
|
|
35
|
+
export declare function resolveManagedAdapterArgv(driver: string, overrides?: AdapterVersionOverrides, registry?: string): string[] | undefined;
|
|
20
36
|
export declare function resolveManagedAdapterCommand(driver: string, overrides?: AdapterVersionOverrides, registry?: string): string | undefined;
|
|
21
37
|
export declare function isManagedAdapterCommand(driver: string, command: string | undefined): boolean;
|
|
22
38
|
export declare function managedAdapterRegistryFromCommand(command: string | undefined): string | undefined;
|
|
39
|
+
export declare function canonicalAdapterRegistry(registry: string): string;
|
|
40
|
+
export declare function adapterRegistryHash8(registry: string): string;
|
|
41
|
+
export declare function createAdapterReleaseId(version: string, registry: string, uuid?: string): string;
|
|
42
|
+
export declare function parseAdapterReleaseId(releaseId: string): {
|
|
43
|
+
version: string;
|
|
44
|
+
registryHash8: string;
|
|
45
|
+
uuid8: string;
|
|
46
|
+
} | null;
|
|
47
|
+
export declare function splitAdapterCommand(command: string): string[] | null;
|
|
48
|
+
/** Structural preinstall classifier used only to decide whether launch fencing is mandatory. */
|
|
49
|
+
export declare function classifyPreinstalledAdapterCommandShape(command: string | undefined): ManagedAdapterId | null;
|
|
50
|
+
export interface ClassifyRecordedPreinstalledAdapterCommandOptions {
|
|
51
|
+
/** Trusted xacpx runtime root containing the managed adapters directory. */
|
|
52
|
+
runtimeRoot: string;
|
|
53
|
+
platform?: NodeJS.Platform;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Strict structural classifier for persisted session identity. Unlike the broad
|
|
57
|
+
* fencing classifier above, this only treats a command as derived managed state
|
|
58
|
+
* when its entry is under the trusted runtime adapter root and has the complete
|
|
59
|
+
* immutable release/package layout.
|
|
60
|
+
*/
|
|
61
|
+
export declare function classifyRecordedPreinstalledAdapterCommand(command: string | undefined, options: ClassifyRecordedPreinstalledAdapterCommandOptions): ManagedAdapterId | null;
|
|
62
|
+
export interface DecodeManagedAdapterCommandOptions {
|
|
63
|
+
adaptersRoot?: string;
|
|
64
|
+
controlledNodeExecutable?: string;
|
|
65
|
+
platform?: NodeJS.Platform;
|
|
66
|
+
realpath?: (path: string) => Promise<string>;
|
|
67
|
+
}
|
|
68
|
+
/** The single trust-boundary decoder used by classification and GC. */
|
|
69
|
+
export declare function decodeManagedAdapterCommand(command: string | undefined, options?: DecodeManagedAdapterCommandOptions): Promise<DecodedManagedAdapterCommand | null>;
|
|
23
70
|
/** A recorded generated command is derived state, so a newer configured/default
|
|
24
71
|
* version replaces it. Truly custom commands remain sticky for session identity. */
|
|
25
72
|
export declare function preferCurrentManagedAdapterCommand(driver: string, recorded: string | undefined, current: string | undefined): string | undefined;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ManagedAdapterId } from "./adapter-catalog";
|
|
2
|
+
export declare function getAdapterNpmVersion(id: ManagedAdapterId, version: string | undefined, registry: string): Promise<string | null>;
|
|
3
|
+
export declare function resolveNpmCommand(): {
|
|
4
|
+
command: string;
|
|
5
|
+
prefixArgs: string[];
|
|
6
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { type ManagedAdapterId } from "./adapter-catalog";
|
|
2
|
+
export interface InstalledAdapterManifest {
|
|
3
|
+
schemaVersion: 1;
|
|
4
|
+
id: ManagedAdapterId;
|
|
5
|
+
packageName: string;
|
|
6
|
+
version: string;
|
|
7
|
+
releaseId: string;
|
|
8
|
+
registry: string;
|
|
9
|
+
nodeExecutable: string;
|
|
10
|
+
entryRelPath: string;
|
|
11
|
+
installedAt: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ActiveAdapterPointer {
|
|
14
|
+
version: string;
|
|
15
|
+
releaseId: string;
|
|
16
|
+
activatedAt: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ValidateReleaseExpected {
|
|
19
|
+
id: ManagedAdapterId;
|
|
20
|
+
version: string;
|
|
21
|
+
packageName: string;
|
|
22
|
+
registry: string;
|
|
23
|
+
releaseId: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ValidateReleaseOptions {
|
|
26
|
+
probe?: boolean;
|
|
27
|
+
verify?: (command: string, args: string[]) => Promise<void>;
|
|
28
|
+
platform?: NodeJS.Platform;
|
|
29
|
+
staging?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface PreinstallAdapterOptions {
|
|
32
|
+
runtimeRoot: string;
|
|
33
|
+
id: ManagedAdapterId;
|
|
34
|
+
version: string;
|
|
35
|
+
registry: string;
|
|
36
|
+
nodeExecutable?: string;
|
|
37
|
+
now?: () => Date;
|
|
38
|
+
uuid?: () => string;
|
|
39
|
+
installPackage?: (stagingDir: string, packageSpec: string, registry: string) => Promise<void>;
|
|
40
|
+
verify?: (command: string, args: string[]) => Promise<void>;
|
|
41
|
+
fault?: (boundary: string) => void | Promise<void>;
|
|
42
|
+
}
|
|
43
|
+
export declare function validateAdapterRelease(releaseDir: string, expected: ValidateReleaseExpected, options?: ValidateReleaseOptions): Promise<InstalledAdapterManifest>;
|
|
44
|
+
export declare function preinstallAdapter(options: PreinstallAdapterOptions): Promise<{
|
|
45
|
+
releaseDir: string;
|
|
46
|
+
manifest: InstalledAdapterManifest;
|
|
47
|
+
pointer: ActiveAdapterPointer;
|
|
48
|
+
}>;
|
|
49
|
+
export declare function recoverAdapterInstall(runtimeRoot: string, id: ManagedAdapterId): Promise<void>;
|
|
50
|
+
export declare function readActiveAdapterPointer(runtimeRoot: string, id: ManagedAdapterId): Promise<ActiveAdapterPointer | null>;
|
|
51
|
+
export declare function listInstalledAdapterReleases(runtimeRoot: string): Promise<Array<{
|
|
52
|
+
id: ManagedAdapterId;
|
|
53
|
+
releaseId: string;
|
|
54
|
+
active: boolean;
|
|
55
|
+
}>>;
|
|
56
|
+
/** Spawn-time static validation. The initialize probe is intentionally skipped. */
|
|
57
|
+
export declare function resolveActiveAdapterCommandSync(runtimeRoot: string, expected: Omit<ValidateReleaseExpected, "releaseId">): string | null;
|
|
58
|
+
/** Structured-argv variant of the spawn-time resolution for lossless launches. */
|
|
59
|
+
export declare function resolveActiveAdapterArgvSync(runtimeRoot: string, expected: Omit<ValidateReleaseExpected, "releaseId">): string[] | null;
|
|
60
|
+
/** Validate the referenced immutable release, then re-resolve the active pointer. */
|
|
61
|
+
export declare function validateAndReResolveAdapterCommand(runtimeRoot: string, command: string): Promise<{
|
|
62
|
+
id: ManagedAdapterId;
|
|
63
|
+
agentCommand: string;
|
|
64
|
+
}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const DEFAULT_ADAPTER_REGISTRY = "https://registry.npmjs.org
|
|
1
|
+
export declare const DEFAULT_ADAPTER_REGISTRY = "https://registry.npmjs.org";
|
|
2
2
|
export declare class AdapterRegistryPackageNotFoundError extends Error {
|
|
3
3
|
readonly registry: string;
|
|
4
4
|
readonly code = "E404";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ManagedAdapterId } from "./adapter-catalog";
|
|
2
|
+
interface VerifyOptions {
|
|
3
|
+
timeoutMs?: number;
|
|
4
|
+
adapterRegistry?: string;
|
|
5
|
+
}
|
|
6
|
+
/** Runs a structured ACP initialize probe and tears down the process tree afterward. */
|
|
7
|
+
export declare function verifyAcpInitialize(command: string, args: string[], options?: VerifyOptions): Promise<void>;
|
|
8
|
+
/** Downloads the exact package version through npm's exec cache, then probes ACP. */
|
|
9
|
+
export declare function verifyAdapterVersion(id: ManagedAdapterId, version: string, registry?: string): Promise<void>;
|
|
10
|
+
export {};
|
|
@@ -65,16 +65,8 @@ function resolveHermesAcpShimEntry(moduleUrl = import.meta.url) {
|
|
|
65
65
|
}
|
|
66
66
|
return fileURLToPath(new URL("./hermes-acp-shim.js", moduleUrl));
|
|
67
67
|
}
|
|
68
|
-
function
|
|
69
|
-
return
|
|
70
|
-
}
|
|
71
|
-
function hermesAcpShimCommand(execPath = process.execPath, shimEntry = resolveHermesAcpShimEntry()) {
|
|
72
|
-
return [
|
|
73
|
-
quoteAgentCommandToken(execPath),
|
|
74
|
-
quoteAgentCommandToken(shimEntry),
|
|
75
|
-
"hermes",
|
|
76
|
-
"acp"
|
|
77
|
-
].join(" ");
|
|
68
|
+
function hermesAcpShimArgv(execPath = process.execPath, shimEntry = resolveHermesAcpShimEntry()) {
|
|
69
|
+
return [execPath, shimEntry, "hermes", "acp"];
|
|
78
70
|
}
|
|
79
71
|
function stripResumeCapability(line) {
|
|
80
72
|
let message;
|
|
@@ -16,14 +16,18 @@ export declare function resolveHermesAcpShimEntry(moduleUrl?: string): string;
|
|
|
16
16
|
/** Quote one token for acpx's `--agent` parser (double quotes; `\` and `"` escaped —
|
|
17
17
|
* its splitCommandLine treats backslash as an escape inside double quotes). */
|
|
18
18
|
export declare function quoteAgentCommandToken(token: string): string;
|
|
19
|
-
/** Runtime-only agent
|
|
19
|
+
/** Runtime-only agent argv for the hermes driver: never persisted to config.
|
|
20
20
|
*
|
|
21
|
-
* Tradeoff: the
|
|
21
|
+
* Tradeoff: the argv embeds `process.execPath` and this install's dist path,
|
|
22
22
|
* and acpx keys its backend session records by EXACT agentCommand equality — so a
|
|
23
23
|
* node upgrade (nvm paths embed the version) or an install relocation re-keys
|
|
24
24
|
* hermes session identity: acpx starts a fresh backend record and the old queue
|
|
25
25
|
* owner ages out via TTL. Accepted because the alternative (a stable bin shim)
|
|
26
26
|
* isn't worth the packaging surface for a workaround slated for removal. */
|
|
27
|
+
export declare function hermesAcpShimArgv(execPath?: string, shimEntry?: string): string[];
|
|
28
|
+
/** Runtime-only agent command for the hermes driver: the quoted-string form of
|
|
29
|
+
* `hermesAcpShimArgv` for acpx `--agent` (Unix paths only). Only path-bearing
|
|
30
|
+
* tokens are quoted; `hermes acp` stay bare. */
|
|
27
31
|
export declare function hermesAcpShimCommand(execPath?: string, shimEntry?: string): string;
|
|
28
32
|
/**
|
|
29
33
|
* If `line` is the initialize response advertising `sessionCapabilities.resume`,
|