ai-task-board-bridge 0.9.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +66 -15
- package/dist/app-server-client.js +1 -1
- package/dist/bridge.js +1 -1
- package/dist/cli.js +60 -18
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/installer.d.ts +13 -0
- package/dist/installer.d.ts.map +1 -0
- package/dist/installer.js +85 -0
- package/dist/installer.js.map +1 -0
- package/dist/kimi-runtime/acp-client.d.ts +59 -0
- package/dist/kimi-runtime/acp-client.d.ts.map +1 -0
- package/dist/kimi-runtime/acp-client.js +341 -0
- package/dist/kimi-runtime/acp-client.js.map +1 -0
- package/dist/kimi-runtime/board-client.d.ts +91 -0
- package/dist/kimi-runtime/board-client.d.ts.map +1 -0
- package/dist/kimi-runtime/board-client.js +286 -0
- package/dist/kimi-runtime/board-client.js.map +1 -0
- package/dist/kimi-runtime/bridge.d.ts +60 -0
- package/dist/kimi-runtime/bridge.d.ts.map +1 -0
- package/dist/kimi-runtime/bridge.js +773 -0
- package/dist/kimi-runtime/bridge.js.map +1 -0
- package/dist/kimi-runtime/cli.d.ts +3 -0
- package/dist/kimi-runtime/cli.d.ts.map +1 -0
- package/dist/kimi-runtime/cli.js +82 -0
- package/dist/kimi-runtime/cli.js.map +1 -0
- package/dist/kimi-runtime/config.d.ts +30 -0
- package/dist/kimi-runtime/config.d.ts.map +1 -0
- package/dist/kimi-runtime/config.js +121 -0
- package/dist/kimi-runtime/config.js.map +1 -0
- package/dist/kimi-runtime/index.d.ts +7 -0
- package/dist/kimi-runtime/index.d.ts.map +1 -0
- package/dist/kimi-runtime/index.js +7 -0
- package/dist/kimi-runtime/index.js.map +1 -0
- package/dist/kimi-runtime/setup.d.ts +23 -0
- package/dist/kimi-runtime/setup.d.ts.map +1 -0
- package/dist/kimi-runtime/setup.js +496 -0
- package/dist/kimi-runtime/setup.js.map +1 -0
- package/dist/kimi-runtime/utils.d.ts +13 -0
- package/dist/kimi-runtime/utils.d.ts.map +1 -0
- package/dist/kimi-runtime/utils.js +105 -0
- package/dist/kimi-runtime/utils.js.map +1 -0
- package/package.json +9 -4
package/README.md
CHANGED
|
@@ -1,24 +1,46 @@
|
|
|
1
1
|
# AI Task Board Bridge
|
|
2
2
|
|
|
3
|
-
`ai-task-board-bridge` is the
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
`ai-task-board-bridge` is the single public npm package for AI Task Board's
|
|
4
|
+
device companions. Its interactive installer asks whether to install Codex
|
|
5
|
+
Bridge, Kimi Bridge, or both. The two runtimes remain separate processes with
|
|
6
|
+
separate Board Connections, tokens, working-directory allowlists, and systemd
|
|
7
|
+
services.
|
|
8
|
+
|
|
9
|
+
Codex Bridge starts the local `codex app-server` over stdio, discovers
|
|
10
|
+
non-archived top-level Codex threads, maps each thread to a Board Session,
|
|
11
|
+
receives reserved work, and streams supported progress back to the Board. Kimi
|
|
12
|
+
Bridge starts the logged-in Kimi Code ACP server and manages real Kimi Sessions;
|
|
13
|
+
it does not expose Kimi as a fake Codex model.
|
|
8
14
|
|
|
9
15
|
The Bridge uses the Board REST API and authenticated SSE directly. The Board
|
|
10
16
|
MCP server is optional and is not required for Bridge operation.
|
|
11
17
|
|
|
12
|
-
##
|
|
18
|
+
## Unified interactive Linux setup
|
|
13
19
|
|
|
14
|
-
Node.js 18 or newer
|
|
15
|
-
|
|
20
|
+
Node.js 18 or newer is required. Run setup as the same OS user that owns the
|
|
21
|
+
selected agent login and workspaces:
|
|
16
22
|
|
|
17
23
|
```bash
|
|
18
|
-
npx --yes ai-task-board-bridge@0.
|
|
24
|
+
npx --yes ai-task-board-bridge@1.0.0 setup
|
|
19
25
|
```
|
|
20
26
|
|
|
21
|
-
The
|
|
27
|
+
The first prompt offers `Codex Bridge`, `Kimi Bridge`, and `both`. Automation or
|
|
28
|
+
repeat installs can bypass that first prompt:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npx --yes ai-task-board-bridge@1.0.0 setup codex
|
|
32
|
+
npx --yes ai-task-board-bridge@1.0.0 setup kimi
|
|
33
|
+
npx --yes ai-task-board-bridge@1.0.0 setup both
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Installing both runs the two setup flows in sequence. Create a separate Board
|
|
37
|
+
Connection with the matching platform for each runtime; a Codex token must not
|
|
38
|
+
be reused for Kimi or vice versa. The public tarball embeds the private Kimi ACP
|
|
39
|
+
runtime, so no second npm package needs to be published or installed.
|
|
40
|
+
|
|
41
|
+
### Codex setup
|
|
42
|
+
|
|
43
|
+
The Codex setup wizard asks for the Board URL, hidden Connection Token, working
|
|
22
44
|
directory, Codex home and executable, custom-provider credential environment
|
|
23
45
|
variables, thread limits, permission/approval modes, and the Web configuration
|
|
24
46
|
gate. It then installs and starts
|
|
@@ -53,7 +75,7 @@ install a service:
|
|
|
53
75
|
AI_TASK_BOARD_URL='https://board.example.com' \
|
|
54
76
|
AI_TASK_BOARD_CONNECTION_TOKEN='atb_REPLACE_ME' \
|
|
55
77
|
CODEX_WORKING_DIRECTORY='/path/to/a/safe/start-directory' \
|
|
56
|
-
npx --yes ai-task-board-bridge@0.
|
|
78
|
+
npx --yes ai-task-board-bridge@1.0.0 run codex
|
|
57
79
|
```
|
|
58
80
|
|
|
59
81
|
> **High-risk foreground defaults:** when these values are omitted, the Bridge uses
|
|
@@ -71,7 +93,7 @@ scope with one exact existing-thread compatibility filter:
|
|
|
71
93
|
|
|
72
94
|
```bash
|
|
73
95
|
CODEX_THREAD_ID='REPLACE_WITH_LOCAL_THREAD_ID' \
|
|
74
|
-
npx --yes ai-task-board-bridge@0.
|
|
96
|
+
npx --yes ai-task-board-bridge@1.0.0
|
|
75
97
|
```
|
|
76
98
|
|
|
77
99
|
Bridge 0.7 and later can manage several exact working directories in one process:
|
|
@@ -79,7 +101,7 @@ Bridge 0.7 and later can manage several exact working directories in one process
|
|
|
79
101
|
```bash
|
|
80
102
|
CODEX_WORKING_DIRECTORIES='[{"key":"main","name":"Main App","path":"/srv/main"},{"key":"docs","name":"Docs","path":"/srv/docs"}]' \
|
|
81
103
|
CODEX_THREAD_SCOPE='cwd' \
|
|
82
|
-
npx --yes ai-task-board-bridge@0.
|
|
104
|
+
npx --yes ai-task-board-bridge@1.0.0
|
|
83
105
|
```
|
|
84
106
|
|
|
85
107
|
The JSON array accepts 1 to 100 unique `{key,name?,path}` entries. Its first
|
|
@@ -244,10 +266,39 @@ strong token-isolation boundary. Use a separate UID and/or a token proxy when
|
|
|
244
266
|
strong isolation is required. Board schema and `/api/ai/sessions/sync` must be
|
|
245
267
|
upgraded before starting 0.8; there is no 404 fallback to the old registration
|
|
246
268
|
API. On Linux, use `setup` for a pinned local runtime and systemd user service.
|
|
247
|
-
On other platforms, pin version `0.
|
|
269
|
+
On other platforms, pin version `1.0.0` in launchd or another process manager.
|
|
248
270
|
Run only one Bridge for the same device/Connection, and
|
|
249
271
|
do not let another TUI, IDE, or automation writer submit turns to a managed
|
|
250
272
|
thread at the same time.
|
|
251
273
|
|
|
252
|
-
Use `npx --yes ai-task-board-bridge@0.
|
|
274
|
+
Use `npx --yes ai-task-board-bridge@1.0.0 --help` for the complete
|
|
253
275
|
environment-variable list.
|
|
276
|
+
|
|
277
|
+
## Kimi Bridge
|
|
278
|
+
|
|
279
|
+
Kimi Bridge requires a logged-in Kimi Code CLI and a dedicated Board Connection
|
|
280
|
+
whose platform is `Kimi Code`. Interactive setup installs the separate
|
|
281
|
+
`ai-task-board-kimi-bridge.service`, stores its token in a `0600` environment
|
|
282
|
+
file, and stages the embedded Kimi runtime plus ACP dependencies under the
|
|
283
|
+
current user's XDG data directory.
|
|
284
|
+
|
|
285
|
+
Foreground or non-systemd operation uses the same public npm package:
|
|
286
|
+
|
|
287
|
+
```bash
|
|
288
|
+
AI_TASK_BOARD_URL='https://board.example.com' \
|
|
289
|
+
AI_TASK_BOARD_CONNECTION_TOKEN='atb_REPLACE_ME' \
|
|
290
|
+
KIMI_WORKING_DIRECTORY='/absolute/path/to/project' \
|
|
291
|
+
KIMI_BRIDGE_MODE='auto' \
|
|
292
|
+
KIMI_BRIDGE_APPROVAL_MODE='accept' \
|
|
293
|
+
npx --yes ai-task-board-bridge@1.0.0 run kimi
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
`KIMI_WORKING_DIRECTORIES` accepts 1 to 100 unique exact
|
|
297
|
+
`{key,name?,path}` entries. The Bridge dynamically reports Kimi ACP's model and
|
|
298
|
+
thought-level catalog. Web creation and deletion operate on real Kimi Sessions;
|
|
299
|
+
rename remains hidden because Kimi Code 0.34 does not expose a reliable ACP
|
|
300
|
+
rename operation. The Board token is removed from the `kimi acp` child
|
|
301
|
+
environment, and only final replies plus bounded completion metadata are
|
|
302
|
+
uploaded. Interactive setup defaults to declining extra ACP permissions;
|
|
303
|
+
`KIMI_BRIDGE_MODE=yolo` and `KIMI_BRIDGE_APPROVAL_MODE=accept` are explicit
|
|
304
|
+
high-risk opt-ins.
|
package/dist/bridge.js
CHANGED
|
@@ -7,7 +7,7 @@ import { isSessionActiveClaimConflict, nextClaimAction, } from "./claim-retry.js
|
|
|
7
7
|
import { adaptiveIdlePollDelay, runSessionWakeListener, WakeLatch, } from "./wake-client.js";
|
|
8
8
|
import { managedDirectoryForWorkingDirectory, parseRemoteWorkingDirectories, parseWorkingDirectories, remoteWorkingDirectories, workingDirectoryForThreadCreate, } from "./working-directories.js";
|
|
9
9
|
export { isExactWorkingDirectory, managedDirectoryForWorkingDirectory, parseRemoteWorkingDirectories, parseWorkingDirectories, remoteWorkingDirectories, workingDirectoryForThreadCreate, } from "./working-directories.js";
|
|
10
|
-
const BRIDGE_VERSION = "0.
|
|
10
|
+
const BRIDGE_VERSION = "1.0.0";
|
|
11
11
|
const APP_SERVER_PROTOCOL = "codex-app-server/v1";
|
|
12
12
|
const THREAD_SOURCE_KINDS = ["cli", "vscode", "exec", "appServer"];
|
|
13
13
|
const DELTA_CHUNK_BYTES = 8_192;
|
package/dist/cli.js
CHANGED
|
@@ -3,16 +3,23 @@ import { readFile } from "node:fs/promises";
|
|
|
3
3
|
const HELP = `AI Task Board Bridge
|
|
4
4
|
|
|
5
5
|
Usage:
|
|
6
|
-
ai-task-board-bridge setup
|
|
7
|
-
ai-task-board-bridge run
|
|
6
|
+
ai-task-board-bridge setup [codex|kimi|both]
|
|
7
|
+
ai-task-board-bridge run [codex|kimi]
|
|
8
8
|
ai-task-board-bridge
|
|
9
9
|
|
|
10
10
|
Commands:
|
|
11
|
-
setup Interactively
|
|
12
|
-
run Run
|
|
11
|
+
setup Interactively choose and install Codex Bridge, Kimi Bridge, or both
|
|
12
|
+
run Run one Bridge using environment variables (default: codex)
|
|
13
|
+
|
|
14
|
+
With no command, an interactive terminal opens the unified installer when required
|
|
15
|
+
configuration is missing. Existing Codex environment launches remain compatible.
|
|
16
|
+
On Linux, setup installs the current user's systemd service or services.
|
|
13
17
|
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
Examples:
|
|
19
|
+
ai-task-board-bridge setup
|
|
20
|
+
ai-task-board-bridge setup kimi
|
|
21
|
+
ai-task-board-bridge setup both
|
|
22
|
+
ai-task-board-bridge run kimi
|
|
16
23
|
|
|
17
24
|
Required environment variables:
|
|
18
25
|
AI_TASK_BOARD_URL Board HTTPS base URL
|
|
@@ -43,6 +50,15 @@ Optional environment variables:
|
|
|
43
50
|
AI_TASK_BOARD_THREAD_SYNC_INTERVAL_MS Full inventory interval (10000..600000)
|
|
44
51
|
AI_TASK_BOARD_CONFIG_POLL_INTERVAL_MS Web config interval (1000..600000)
|
|
45
52
|
|
|
53
|
+
Kimi variables:
|
|
54
|
+
KIMI_WORKING_DIRECTORY Working directory (default: cwd)
|
|
55
|
+
KIMI_WORKING_DIRECTORIES JSON allowlist of {key,name,path} directories
|
|
56
|
+
KIMI_MAX_THREADS Maximum Sessions to manage (1..500)
|
|
57
|
+
KIMI_MAX_CONCURRENT_TURNS Device-wide concurrent turns (1..32)
|
|
58
|
+
KIMI_BRIDGE_APPROVAL_MODE accept or decline
|
|
59
|
+
KIMI_BRIDGE_MODE auto, default, plan, or yolo
|
|
60
|
+
KIMI_BINARY Kimi Code executable (default: kimi)
|
|
61
|
+
|
|
46
62
|
Options:
|
|
47
63
|
-h, --help Show this help
|
|
48
64
|
-v, --version Show the package version
|
|
@@ -61,32 +77,58 @@ async function run() {
|
|
|
61
77
|
process.stdout.write(`${await packageVersion()}\n`);
|
|
62
78
|
return;
|
|
63
79
|
}
|
|
64
|
-
if (args
|
|
65
|
-
const {
|
|
66
|
-
|
|
80
|
+
if (args[0] === "setup") {
|
|
81
|
+
const { parseBridgeSetupTarget, promptForBridgeSetupTarget, runBridgeSetup, } = await import("./installer.js");
|
|
82
|
+
if (args.length > 2) {
|
|
83
|
+
process.stderr.write(`Unknown option: ${args[2]}\n\n${HELP}`);
|
|
84
|
+
process.exitCode = 1;
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const requestedTarget = parseBridgeSetupTarget(args[1]);
|
|
88
|
+
if (args[1] && !requestedTarget) {
|
|
89
|
+
process.stderr.write(`Unknown setup target: ${args[1]}\n\n${HELP}`);
|
|
90
|
+
process.exitCode = 1;
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const target = requestedTarget ?? (await promptForBridgeSetupTarget());
|
|
94
|
+
await runBridgeSetup(target, await packageVersion());
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
if (args[0] === "run") {
|
|
98
|
+
const { parseBridgeRunTarget, runAgentBridge } = await import("./installer.js");
|
|
99
|
+
if (args.length > 2) {
|
|
100
|
+
process.stderr.write(`Unknown option: ${args[2]}\n\n${HELP}`);
|
|
101
|
+
process.exitCode = 1;
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
const target = args[1] ? parseBridgeRunTarget(args[1]) : "codex";
|
|
105
|
+
if (!target) {
|
|
106
|
+
process.stderr.write(`Unknown run target: ${args[1]}\n\n${HELP}`);
|
|
107
|
+
process.exitCode = 1;
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
await runAgentBridge(target);
|
|
67
111
|
return;
|
|
68
112
|
}
|
|
69
|
-
if (args.length >
|
|
113
|
+
if (args.length > 0) {
|
|
70
114
|
process.stderr.write(`Unknown option: ${args[0]}\n\n${HELP}`);
|
|
71
115
|
process.exitCode = 1;
|
|
72
116
|
return;
|
|
73
117
|
}
|
|
74
|
-
const explicitRun = args[0] === "run";
|
|
75
118
|
const missingRequiredConfiguration = !process.env.AI_TASK_BOARD_URL?.trim() ||
|
|
76
119
|
!process.env.AI_TASK_BOARD_CONNECTION_TOKEN?.trim();
|
|
77
|
-
if (
|
|
78
|
-
missingRequiredConfiguration &&
|
|
120
|
+
if (missingRequiredConfiguration &&
|
|
79
121
|
process.stdin.isTTY &&
|
|
80
122
|
process.stdout.isTTY) {
|
|
81
|
-
const {
|
|
82
|
-
await
|
|
123
|
+
const { promptForBridgeSetupTarget, runBridgeSetup } = await import("./installer.js");
|
|
124
|
+
await runBridgeSetup(await promptForBridgeSetupTarget(), await packageVersion());
|
|
83
125
|
return;
|
|
84
126
|
}
|
|
85
|
-
const {
|
|
86
|
-
await
|
|
127
|
+
const { runAgentBridge } = await import("./installer.js");
|
|
128
|
+
await runAgentBridge("codex");
|
|
87
129
|
}
|
|
88
130
|
void run().catch((error) => {
|
|
89
|
-
process.stderr.write(`
|
|
131
|
+
process.stderr.write(`Bridge 操作失败:${String(error)}\n`);
|
|
90
132
|
process.exitCode = 1;
|
|
91
133
|
});
|
|
92
134
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,MA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-1,6 +1,7 @@
|
|
|
1
1
|
export { boundActivityData, redactHarnessText, sanitizeHarnessValue, } from "./activity-sanitizer.js";
|
|
2
2
|
export { isSessionActiveClaimConflict, nextClaimAction, } from "./claim-retry.js";
|
|
3
3
|
export { adaptiveIdlePollDelay, consumeWakeEventStream, reconnectDelay, runSessionWakeListener, WakeLatch, } from "./wake-client.js";
|
|
4
|
+
export { BRIDGE_SETUP_CHOICES, parseBridgeRunTarget, parseBridgeSetupTarget, promptForBridgeSetupTarget, runAgentBridge, runBridgeSetup, type BridgeRunTarget, type BridgeSetupTarget, } from "./installer.js";
|
|
4
5
|
export * from "./app-server-client.js";
|
|
5
6
|
export * from "./history-sync.js";
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,4BAA4B,EAC5B,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,cAAc,EACd,sBAAsB,EACtB,SAAS,GACV,MAAM,kBAAkB,CAAC;AAC1B,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,4BAA4B,EAC5B,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,cAAc,EACd,sBAAsB,EACtB,SAAS,GACV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,0BAA0B,EAC1B,cAAc,EACd,cAAc,EACd,KAAK,eAAe,EACpB,KAAK,iBAAiB,GACvB,MAAM,gBAAgB,CAAC;AACxB,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { boundActivityData, redactHarnessText, sanitizeHarnessValue, } from "./activity-sanitizer.js";
|
|
2
2
|
export { isSessionActiveClaimConflict, nextClaimAction, } from "./claim-retry.js";
|
|
3
3
|
export { adaptiveIdlePollDelay, consumeWakeEventStream, reconnectDelay, runSessionWakeListener, WakeLatch, } from "./wake-client.js";
|
|
4
|
+
export { BRIDGE_SETUP_CHOICES, parseBridgeRunTarget, parseBridgeSetupTarget, promptForBridgeSetupTarget, runAgentBridge, runBridgeSetup, } from "./installer.js";
|
|
4
5
|
export * from "./app-server-client.js";
|
|
5
6
|
export * from "./history-sync.js";
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,4BAA4B,EAC5B,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,cAAc,EACd,sBAAsB,EACtB,SAAS,GACV,MAAM,kBAAkB,CAAC;AAC1B,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,4BAA4B,EAC5B,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,cAAc,EACd,sBAAsB,EACtB,SAAS,GACV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,0BAA0B,EAC1B,cAAc,EACd,cAAc,GAGf,MAAM,gBAAgB,CAAC;AACxB,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReadStream, WriteStream } from "node:tty";
|
|
2
|
+
export type BridgeSetupTarget = "codex" | "kimi" | "both";
|
|
3
|
+
export type BridgeRunTarget = Exclude<BridgeSetupTarget, "both">;
|
|
4
|
+
export declare const BRIDGE_SETUP_CHOICES: ReadonlyArray<{
|
|
5
|
+
value: BridgeSetupTarget;
|
|
6
|
+
label: string;
|
|
7
|
+
}>;
|
|
8
|
+
export declare function parseBridgeSetupTarget(value: string | undefined): BridgeSetupTarget | null;
|
|
9
|
+
export declare function parseBridgeRunTarget(value: string | undefined): BridgeRunTarget | null;
|
|
10
|
+
export declare function promptForBridgeSetupTarget(input?: ReadStream, output?: WriteStream): Promise<BridgeSetupTarget>;
|
|
11
|
+
export declare function runBridgeSetup(target: BridgeSetupTarget, packageVersion: string): Promise<void>;
|
|
12
|
+
export declare function runAgentBridge(target: BridgeRunTarget): Promise<void>;
|
|
13
|
+
//# sourceMappingURL=installer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installer.d.ts","sourceRoot":"","sources":["../src/installer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAExD,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAC1D,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;AAEjE,eAAO,MAAM,oBAAoB,EAAE,aAAa,CAAC;IAC/C,KAAK,EAAE,iBAAiB,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;CACf,CAIA,CAAC;AAEF,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB,iBAAiB,GAAG,IAAI,CAO1B;AAED,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB,eAAe,GAAG,IAAI,CAGxB;AAED,wBAAsB,0BAA0B,CAC9C,KAAK,GAAE,UAA0B,EACjC,MAAM,GAAE,WAA4B,GACnC,OAAO,CAAC,iBAAiB,CAAC,CA8B5B;AAiBD,wBAAsB,cAAc,CAClC,MAAM,EAAE,iBAAiB,EACzB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,IAAI,CAAC,CAef;AAED,wBAAsB,cAAc,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAY3E"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { createInterface } from "node:readline/promises";
|
|
2
|
+
export const BRIDGE_SETUP_CHOICES = [
|
|
3
|
+
{ value: "codex", label: "Codex Bridge" },
|
|
4
|
+
{ value: "kimi", label: "Kimi Bridge(Kimi Code ACP)" },
|
|
5
|
+
{ value: "both", label: "Codex Bridge 和 Kimi Bridge" },
|
|
6
|
+
];
|
|
7
|
+
export function parseBridgeSetupTarget(value) {
|
|
8
|
+
const normalized = value?.trim().toLowerCase();
|
|
9
|
+
if (!normalized)
|
|
10
|
+
return null;
|
|
11
|
+
if (normalized === "codex")
|
|
12
|
+
return "codex";
|
|
13
|
+
if (normalized === "kimi" || normalized === "kimi-code")
|
|
14
|
+
return "kimi";
|
|
15
|
+
if (normalized === "both" || normalized === "all")
|
|
16
|
+
return "both";
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
export function parseBridgeRunTarget(value) {
|
|
20
|
+
const target = parseBridgeSetupTarget(value);
|
|
21
|
+
return target === "codex" || target === "kimi" ? target : null;
|
|
22
|
+
}
|
|
23
|
+
export async function promptForBridgeSetupTarget(input = process.stdin, output = process.stdout) {
|
|
24
|
+
if (!input.isTTY || !output.isTTY) {
|
|
25
|
+
throw new Error("setup 需要交互式终端;自动化请选择 setup codex、setup kimi 或 setup both");
|
|
26
|
+
}
|
|
27
|
+
const readline = createInterface({ input, output, terminal: true });
|
|
28
|
+
try {
|
|
29
|
+
output.write("\nAI Task Board Bridge 安装器\n\n要安装什么?\n");
|
|
30
|
+
BRIDGE_SETUP_CHOICES.forEach((choice, index) => {
|
|
31
|
+
output.write(` ${index + 1}) ${choice.label}\n`);
|
|
32
|
+
});
|
|
33
|
+
while (true) {
|
|
34
|
+
const answer = (await readline.question("请选择 [1]: "))
|
|
35
|
+
.trim()
|
|
36
|
+
.toLowerCase();
|
|
37
|
+
if (!answer)
|
|
38
|
+
return "codex";
|
|
39
|
+
const numericChoice = Number(answer) - 1;
|
|
40
|
+
if (Number.isInteger(numericChoice) && BRIDGE_SETUP_CHOICES[numericChoice]) {
|
|
41
|
+
return BRIDGE_SETUP_CHOICES[numericChoice].value;
|
|
42
|
+
}
|
|
43
|
+
const namedChoice = parseBridgeSetupTarget(answer);
|
|
44
|
+
if (namedChoice)
|
|
45
|
+
return namedChoice;
|
|
46
|
+
output.write(" 请输入 1 到 3,或 codex、kimi、both。\n");
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
finally {
|
|
50
|
+
readline.close();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
async function setupCodex(packageVersion) {
|
|
54
|
+
const { runInteractiveSetup } = await import("./setup.js");
|
|
55
|
+
await runInteractiveSetup({ packageVersion });
|
|
56
|
+
}
|
|
57
|
+
async function setupKimi(packageVersion) {
|
|
58
|
+
const runtimeModule = "./kimi-runtime/index.js";
|
|
59
|
+
const { runKimiInteractiveSetup } = (await import(runtimeModule));
|
|
60
|
+
await runKimiInteractiveSetup({ packageVersion });
|
|
61
|
+
}
|
|
62
|
+
export async function runBridgeSetup(target, packageVersion) {
|
|
63
|
+
if (target === "codex") {
|
|
64
|
+
await setupCodex(packageVersion);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (target === "kimi") {
|
|
68
|
+
await setupKimi(packageVersion);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
process.stdout.write("\n将依次安装两个独立服务。Codex 与 Kimi 需要各自在看板中创建的 Connection Token。\n");
|
|
72
|
+
await setupCodex(packageVersion);
|
|
73
|
+
await setupKimi(packageVersion);
|
|
74
|
+
}
|
|
75
|
+
export async function runAgentBridge(target) {
|
|
76
|
+
if (target === "codex") {
|
|
77
|
+
const { runBridgeCli } = await import("./bridge.js");
|
|
78
|
+
await runBridgeCli();
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const runtimeModule = "./kimi-runtime/index.js";
|
|
82
|
+
const { runKimiBridgeCli } = (await import(runtimeModule));
|
|
83
|
+
await runKimiBridgeCli();
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=installer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installer.js","sourceRoot":"","sources":["../src/installer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAMzD,MAAM,CAAC,MAAM,oBAAoB,GAG5B;IACH,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE;IACzC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,4BAA4B,EAAE;IACtD,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,4BAA4B,EAAE;CACvD,CAAC;AAEF,MAAM,UAAU,sBAAsB,CACpC,KAAyB;IAEzB,MAAM,UAAU,GAAG,KAAK,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC/C,IAAI,CAAC,UAAU;QAAE,OAA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C,MAAM,CAAC,KAAK,CAClB,4DAA4D,CAC7D,CAAC;IACF,MAAM,UAAU,CAAC,cAAc,CAAC,CAAC;IACjC,MAAM,SAAS,CAAC,cAAc,CAAC,CAAC;AAClC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,MAAuB;IAC1D,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;QACvB,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,CAAC;QACrD,MAAM,YAAY,EAAE,CAAC;QACrB,OAAO;IACT,CAAC;IAED,MAAM,aAAa,GAAG,yBAAyB,CAAC;IAChD,MAAM,EAAE,gBAAgB,EAAE,GAAG,CAAC,MAAM,MAAM,CAAC,aAAa,CAAC,CAExD,CAAC;IACF,MAAM,gBAAgB,EAAE,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as acp from "@agentclientprotocol/sdk";
|
|
2
|
+
import type { PromptResponse, RequestPermissionRequest, RequestPermissionResponse, SessionConfigOption, SessionInfo, SessionNotification } from "@agentclientprotocol/sdk";
|
|
3
|
+
import type { KimiBridgeConfiguration } from "./config.js";
|
|
4
|
+
export type InventoryModel = {
|
|
5
|
+
id: string;
|
|
6
|
+
model: string;
|
|
7
|
+
display_name: string;
|
|
8
|
+
description: string | null;
|
|
9
|
+
default_reasoning_effort: string | null;
|
|
10
|
+
supported_reasoning_efforts: Array<{
|
|
11
|
+
reasoning_effort: string;
|
|
12
|
+
description: string | null;
|
|
13
|
+
}>;
|
|
14
|
+
input_modalities: string[];
|
|
15
|
+
is_default: boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare const KIMI_FALLBACK_MODEL_CATALOG: readonly InventoryModel[];
|
|
18
|
+
type SessionUpdateHandler = (notification: SessionNotification) => void;
|
|
19
|
+
export declare function selectConfigOption(options: readonly SessionConfigOption[] | null | undefined, category: "model" | "thought_level" | "mode"): Extract<SessionConfigOption, {
|
|
20
|
+
type: "select";
|
|
21
|
+
}> | null;
|
|
22
|
+
export declare function modelCatalogFromConfigOptions(options: readonly SessionConfigOption[] | null | undefined, supportsImages: boolean): InventoryModel[] | null;
|
|
23
|
+
export declare class KimiAcpClient {
|
|
24
|
+
private readonly child;
|
|
25
|
+
private readonly approvalMode;
|
|
26
|
+
private readonly updateHandlers;
|
|
27
|
+
private readonly activeTaskSessions;
|
|
28
|
+
private readonly configOptions;
|
|
29
|
+
private readonly connection;
|
|
30
|
+
private closing;
|
|
31
|
+
private exitHandler;
|
|
32
|
+
private initializeResponse;
|
|
33
|
+
private constructor();
|
|
34
|
+
static start(configuration: KimiBridgeConfiguration): Promise<KimiAcpClient>;
|
|
35
|
+
get supportsImages(): boolean;
|
|
36
|
+
get agentDescription(): string;
|
|
37
|
+
onUnexpectedExit(handler: (error: Error) => void): void;
|
|
38
|
+
setTaskActive(sessionId: string, active: boolean): void;
|
|
39
|
+
subscribe(sessionId: string, handler: SessionUpdateHandler): () => void;
|
|
40
|
+
receiveSessionUpdate(notification: SessionNotification): void;
|
|
41
|
+
requestPermission(params: RequestPermissionRequest): Promise<RequestPermissionResponse>;
|
|
42
|
+
listAllSessions(cwd: string): Promise<SessionInfo[]>;
|
|
43
|
+
newSession(cwd: string): Promise<{
|
|
44
|
+
sessionId: string;
|
|
45
|
+
configOptions: SessionConfigOption[];
|
|
46
|
+
}>;
|
|
47
|
+
resumeSession(session: SessionInfo): Promise<SessionConfigOption[]>;
|
|
48
|
+
setConfigValue(sessionId: string, options: readonly SessionConfigOption[], category: "model" | "thought_level" | "mode", value: string): Promise<SessionConfigOption[]>;
|
|
49
|
+
selectedValue(sessionId: string, category: "model" | "thought_level" | "mode"): string | null;
|
|
50
|
+
prompt(sessionId: string, messageId: string, prompt: acp.ContentBlock[]): Promise<PromptResponse>;
|
|
51
|
+
cancel(sessionId: string): Promise<void>;
|
|
52
|
+
closeSession(sessionId: string): Promise<void>;
|
|
53
|
+
deleteSession(sessionId: string): Promise<void>;
|
|
54
|
+
close(): Promise<void>;
|
|
55
|
+
private assertCapabilities;
|
|
56
|
+
private handleExit;
|
|
57
|
+
}
|
|
58
|
+
export {};
|
|
59
|
+
//# 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":"AAGA,OAAO,KAAK,GAAG,MAAM,0BAA0B,CAAC;AAChD,OAAO,KAAK,EAIV,cAAc,EACd,wBAAwB,EACxB,yBAAyB,EACzB,mBAAmB,EACnB,WAAW,EACX,mBAAmB,EACpB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAEV,uBAAuB,EACxB,MAAM,aAAa,CAAC;AAGrB,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,wBAAwB,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,2BAA2B,EAAE,KAAK,CAAC;QACjC,gBAAgB,EAAE,MAAM,CAAC;QACzB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;KAC5B,CAAC,CAAC;IACH,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,SAAS,cAAc,EAiDhE,CAAC;AAEF,KAAK,oBAAoB,GAAG,CAAC,YAAY,EAAE,mBAAmB,KAAK,IAAI,CAAC;AA8BxE,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,SAAS,mBAAmB,EAAE,GAAG,IAAI,GAAG,SAAS,EAC1D,QAAQ,EAAE,OAAO,GAAG,eAAe,GAAG,MAAM,GAC3C,OAAO,CAAC,mBAAmB,EAAE;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,GAAG,I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