@lucascouts/claude-agent-tui 0.17.7 → 0.17.9
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 +3 -10
- package/dist/agent-catalog.js +3 -1
- package/dist/claude-config-dir.d.ts +1 -0
- package/dist/claude-config-dir.js +21 -0
- package/dist/command-catalog.js +10 -7
- package/dist/drift-checks.js +66 -0
- package/dist/jsonl.d.ts +3 -2
- package/dist/jsonl.js +6 -5
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ This project bridges the two: it drives the **official Claude Code TUI** over a
|
|
|
26
26
|
|
|
27
27
|
- The **`claude` CLI** (Claude Code subscription) available on your `PATH`.
|
|
28
28
|
- **Node.js ≥ 24** — the runtime and test suite use native TypeScript type-stripping (`node --experimental-strip-types`). Raising this floor from the previous `>=20` is a **breaking change** for consumers still on Node 20–23.
|
|
29
|
-
- **SDK lines** — the ACP TypeScript SDK 2.x (`@agentclientprotocol/sdk` 2.
|
|
29
|
+
- **SDK lines** — the ACP TypeScript SDK 2.x (`@agentclientprotocol/sdk` 2.12.0, its `/unstable` entry; ACP protocol v1 on the wire) and `@anthropic-ai/claude-agent-sdk` 0.3.332. This fork drives the `claude` CLI installed on the host, not the one the SDK bundles.
|
|
30
30
|
|
|
31
31
|
> **Why 24, and not upstream's `>=22`?** The floor is a support policy, not a measured minimum: this project targets the **active LTS** line, which is Node 24. It is verified rather than copied — a fresh clone with no host `node_modules` or `dist/`, then `npm ci` → `npm run build` → `npm test`, inside `node:24` pinned by digest `sha256:934240a162082fd8b8a2f90cd5114446443f1eba1c5378f6687167ca405e6584` (Node v24.19.0). Green in both the fork and mirror trees: 1222 tests in the fork, 1183 here, 0 failures.
|
|
32
32
|
>
|
|
@@ -74,15 +74,8 @@ npm test
|
|
|
74
74
|
|
|
75
75
|
## Release notes
|
|
76
76
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
- zod 4.6.7 (GHSA-mrhx).
|
|
80
|
-
- Fast mode is detected on any model, not only Opus.
|
|
81
|
-
- A tool call with a non-string path no longer breaks its title; Grep and Bash titles show the CLI's input aliases (`file_path`, `-l`, `-c`, `command_description`).
|
|
82
|
-
- Deleting a never-prompted, unknown or non-UUID session succeeds.
|
|
83
|
-
- `effort = "ultracode"` is accepted as deprecated and maps to effort `xhigh` plus the Ultracode switch.
|
|
84
|
-
|
|
85
|
-
The full per-commit log is [`CHANGELOG.md`](CHANGELOG.md).
|
|
77
|
+
Each release has its section in [`CHANGELOG.md`](CHANGELOG.md), newest first, and its
|
|
78
|
+
[GitHub release](https://github.com/zeo-workspace/claude-agent-tui/releases), so the notes are not repeated here.
|
|
86
79
|
|
|
87
80
|
## Supply-chain notes
|
|
88
81
|
|
package/dist/agent-catalog.js
CHANGED
|
@@ -237,7 +237,9 @@ function globDiscoverAgents(cwd, deps) {
|
|
|
237
237
|
const readdirMd = deps.readdirMd ?? defaultReaddirMd;
|
|
238
238
|
const readFile = deps.readFile ?? defaultReadFile;
|
|
239
239
|
const projectDir = join(cwd, ".claude", "agents");
|
|
240
|
-
|
|
240
|
+
// The user tier follows the CLI's config dir (CLAUDE_CONFIG_DIR, Zeo 0.41.0), else ~/.claude --
|
|
241
|
+
// claude-config-dir.ts's rule, inlined: this module's tests load it from its .ts, with no siblings.
|
|
242
|
+
const userDir = join(process.env.CLAUDE_CONFIG_DIR || join(homedir(), ".claude"), "agents");
|
|
241
243
|
const byValue = new Map();
|
|
242
244
|
for (const dir of [projectDir, userDir]) {
|
|
243
245
|
for (const filename of readdirMd(dir)) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function claudeConfigDir(env?: NodeJS.ProcessEnv, home?: string): string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Claude config dir the `claude` CLI this adapter drives reads its user-level state from:
|
|
3
|
+
* `CLAUDE_CONFIG_DIR` when it is set and not empty, else `<home>/.claude` -- the same rule as
|
|
4
|
+
* Claude Code's own and `acp-agent.ts`'s `CLAUDE_CONFIG_DIR`.
|
|
5
|
+
*
|
|
6
|
+
* Zeo 0.41.0 starts a project's Claude agent with `CLAUDE_CONFIG_DIR` at the project's own Claude
|
|
7
|
+
* folder (Zeo patches 0237-0240), and the spawned `claude` inherits it. Every user-level path this
|
|
8
|
+
* adapter reads -- transcripts, custom agents, user commands and skills, plugins -- must follow the
|
|
9
|
+
* same dir, or the adapter looks in `~/.claude` while the CLI writes elsewhere: a resume finds no
|
|
10
|
+
* transcript, the Agent menu lists the wrong agents. This adapter still never SETS the variable
|
|
11
|
+
* (engine-pty.ts: it relocates auth); it only reads what it was started with.
|
|
12
|
+
*
|
|
13
|
+
* @param env the environment to read (default: `process.env`).
|
|
14
|
+
* @param home the user's home dir (default: `os.homedir()`), for the fallback.
|
|
15
|
+
*/
|
|
16
|
+
import { homedir as osHomedir } from "node:os";
|
|
17
|
+
import { join } from "node:path";
|
|
18
|
+
export function claudeConfigDir(env = process.env, home = osHomedir()) {
|
|
19
|
+
const configured = env.CLAUDE_CONFIG_DIR;
|
|
20
|
+
return configured ? configured : join(home, ".claude");
|
|
21
|
+
}
|
package/dist/command-catalog.js
CHANGED
|
@@ -223,12 +223,12 @@ function sortByName(entries) {
|
|
|
223
223
|
* contributes nothing — this NEVER throws (an unreadable/parse failure degrades to the empty set → all
|
|
224
224
|
* plugins skipped).
|
|
225
225
|
*
|
|
226
|
-
* @param
|
|
226
|
+
* @param configDir the resolved Claude config dir (the manifest lives under `configDir/plugins`).
|
|
227
227
|
* @param readFile the injectable UTF-8 file reader (throws on a missing manifest — caught here).
|
|
228
228
|
* @returns the set of enabled marketplace names (EMPTY when the manifest is absent/malformed).
|
|
229
229
|
*/
|
|
230
|
-
function readEnabledMarketplaces(
|
|
231
|
-
const path = join(
|
|
230
|
+
function readEnabledMarketplaces(configDir, readFile) {
|
|
231
|
+
const path = join(configDir, "plugins", "installed_plugins.json");
|
|
232
232
|
let parsed;
|
|
233
233
|
try {
|
|
234
234
|
parsed = JSON.parse(readFile(path));
|
|
@@ -290,14 +290,17 @@ export function discoverCommands(cwd, deps = {}) {
|
|
|
290
290
|
const readFile = deps.readFile ?? defaultReadFile;
|
|
291
291
|
const builtins = deps.builtins ?? BUILTIN_COMMANDS;
|
|
292
292
|
const home = homedir();
|
|
293
|
+
// The user and plugin tiers follow the CLI's config dir (CLAUDE_CONFIG_DIR, Zeo 0.41.0), else
|
|
294
|
+
// ~/.claude -- claude-config-dir.ts's rule, inlined: this module's tests load it from its .ts.
|
|
295
|
+
const configDir = process.env.CLAUDE_CONFIG_DIR || join(home, ".claude");
|
|
293
296
|
// Ordered disk surfaces (highest precedence first) — commands scanned via `readdirMd`+`resolveEntry`,
|
|
294
297
|
// skills via `readdirDirs`+`resolveSkillEntry`. A cwd command outranks a cwd skill; any cwd surface
|
|
295
298
|
// outranks any user surface (R1.1 / R7). The plugin tier (R8) slots in AFTER these, before builtins.
|
|
296
299
|
const userSources = [
|
|
297
300
|
{ kind: "commands", dir: join(cwd, ".claude", "commands") }, // cwd commands — highest
|
|
298
301
|
{ kind: "skills", dir: join(cwd, ".claude", "skills") }, // cwd skills
|
|
299
|
-
{ kind: "commands", dir: join(
|
|
300
|
-
{ kind: "skills", dir: join(
|
|
302
|
+
{ kind: "commands", dir: join(configDir, "commands") }, // user commands
|
|
303
|
+
{ kind: "skills", dir: join(configDir, "skills") }, // user skills
|
|
301
304
|
];
|
|
302
305
|
const byName = new Map();
|
|
303
306
|
const add = (entry) => {
|
|
@@ -322,8 +325,8 @@ export function discoverCommands(cwd, deps = {}) {
|
|
|
322
325
|
// `installed_plugins.json`. For each enabled marketplace (dirs already sorted), fold its `commands`
|
|
323
326
|
// then its `skills`; first-wins means any plugin name already claimed by a cwd/user surface is DROPPED
|
|
324
327
|
// (R8.1). A missing marketplaces dir / manifest degrades to skipping plugins (never throws).
|
|
325
|
-
const marketplacesDir = join(
|
|
326
|
-
const enabled = readEnabledMarketplaces(
|
|
328
|
+
const marketplacesDir = join(configDir, "plugins", "marketplaces");
|
|
329
|
+
const enabled = readEnabledMarketplaces(configDir, readFile);
|
|
327
330
|
for (const m of readdirDirs(marketplacesDir)) {
|
|
328
331
|
if (!enabled.has(m))
|
|
329
332
|
continue; // treat a not-installed marketplace as disabled
|
package/dist/drift-checks.js
CHANGED
|
@@ -76,6 +76,72 @@ export const KNOWN_JSONL_KEYS = new Set([
|
|
|
76
76
|
"usage",
|
|
77
77
|
"toolUseResult",
|
|
78
78
|
"permissionMode",
|
|
79
|
+
// Top-level keys claude 2.1.330/2.1.331 writes that this list did not know (parity round 26):
|
|
80
|
+
// measured 2026-11-25 over 24 local transcripts, 4383 event lines, key NAMES only. Refresh the
|
|
81
|
+
// same way on a CLI bump, so the check flags what is new rather than everything since 2.1.161.
|
|
82
|
+
"advisorModel",
|
|
83
|
+
"apiBlockIndex",
|
|
84
|
+
"attachment",
|
|
85
|
+
"attributionMcpServer",
|
|
86
|
+
"attributionMcpTool",
|
|
87
|
+
"attributionPlugin",
|
|
88
|
+
"attributionSkill",
|
|
89
|
+
"compactMetadata",
|
|
90
|
+
"content",
|
|
91
|
+
"dataFlowOn",
|
|
92
|
+
"durationMs",
|
|
93
|
+
"effort",
|
|
94
|
+
"failedHookErrorIndexes",
|
|
95
|
+
"hasOutput",
|
|
96
|
+
"hookAdditionalContext",
|
|
97
|
+
"hookCount",
|
|
98
|
+
"hookErrors",
|
|
99
|
+
"hookInfos",
|
|
100
|
+
"isVisibleInTranscriptOnly",
|
|
101
|
+
"madeBy",
|
|
102
|
+
"mcpCallNotReadOnly",
|
|
103
|
+
"mcpMeta",
|
|
104
|
+
"messageCount",
|
|
105
|
+
"origin",
|
|
106
|
+
"perTurnEffort",
|
|
107
|
+
"permissionDecision",
|
|
108
|
+
"preventedContinuation",
|
|
109
|
+
"promptCacheRequested",
|
|
110
|
+
"promptSource",
|
|
111
|
+
"queueSkipAttachments",
|
|
112
|
+
"queueSkipSlashCommands",
|
|
113
|
+
"rendered",
|
|
114
|
+
"renderedBesideToolResult",
|
|
115
|
+
"renderedInHumanTurn",
|
|
116
|
+
"renderedRole",
|
|
117
|
+
"requestRef",
|
|
118
|
+
"requestSessionId",
|
|
119
|
+
"requestedModel",
|
|
120
|
+
"rowSource",
|
|
121
|
+
"sandboxed",
|
|
122
|
+
"serverClassifierContext",
|
|
123
|
+
"serverClassifierRequest",
|
|
124
|
+
"session_id",
|
|
125
|
+
"slug",
|
|
126
|
+
"sourceToolAssistantUUID",
|
|
127
|
+
"sourceToolUseID",
|
|
128
|
+
"stopReason",
|
|
129
|
+
"subtype",
|
|
130
|
+
"thinkingDisplay",
|
|
131
|
+
"thinkingDurationMs",
|
|
132
|
+
"toolDenialKind",
|
|
133
|
+
"toolEndsTurn",
|
|
134
|
+
"toolInputStreamMs",
|
|
135
|
+
"toolResultRemedy",
|
|
136
|
+
"toolUseID",
|
|
137
|
+
"turnAttributionKey",
|
|
138
|
+
"turnCompanion",
|
|
139
|
+
"turnOrigin",
|
|
140
|
+
"turnPosition",
|
|
141
|
+
"turnPromptId",
|
|
142
|
+
"wakeupSource",
|
|
143
|
+
"wireIngestContext",
|
|
144
|
+
"wireToolInputs",
|
|
79
145
|
]);
|
|
80
146
|
/** The keystroke the native TUI permission prompt accepts for Yes — mirror of allow-inject.ts:29. */
|
|
81
147
|
export const EXPECTED_ALLOW_KEYSTROKE = "1\r";
|
package/dist/jsonl.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Build the absolute glob pattern used to locate a session's transcript:
|
|
3
|
-
* the `<sessionId>.jsonl` basename anywhere under
|
|
3
|
+
* the `<sessionId>.jsonl` basename anywhere under `<config dir>/projects` -- `CLAUDE_CONFIG_DIR`, else
|
|
4
|
+
* `~/.claude` ({@link claudeConfigDir}), `~` expanded via os.homedir
|
|
4
5
|
* (globSync does NOT perform tilde expansion). Exposed so callers can report the
|
|
5
6
|
* EXACT pattern they globbed in a not-found/ambiguity diagnostic without
|
|
6
7
|
* re-deriving (and risking drift from) the string used by findTranscript (R1.3).
|
|
@@ -12,7 +13,7 @@ export declare function transcriptGlob(sessionId: string): string;
|
|
|
12
13
|
/**
|
|
13
14
|
* Find Claude transcript file(s) for a given session id.
|
|
14
15
|
*
|
|
15
|
-
* Globs the `<sessionId>.jsonl` basename anywhere under
|
|
16
|
+
* Globs the `<sessionId>.jsonl` basename anywhere under `<config dir>/projects` ({@link claudeConfigDir})
|
|
16
17
|
* so the file is found independent of the cwd→dir encoding (R1.1). Returns ALL
|
|
17
18
|
* matches (normally one) as absolute paths; an empty array means "not found".
|
|
18
19
|
*
|
package/dist/jsonl.js
CHANGED
|
@@ -18,12 +18,13 @@
|
|
|
18
18
|
// 5583 ms turn watchdog and MUST NOT be conflated with it. This module only ever uses the
|
|
19
19
|
// file-discovery watchdog.
|
|
20
20
|
import { closeSync, globSync, openSync, readFileSync, readSync, statSync, watch } from "node:fs";
|
|
21
|
-
import { homedir } from "node:os";
|
|
22
21
|
import { join } from "node:path";
|
|
23
22
|
import { StringDecoder } from "node:string_decoder";
|
|
23
|
+
import { claudeConfigDir } from "./claude-config-dir.js";
|
|
24
24
|
/**
|
|
25
25
|
* Build the absolute glob pattern used to locate a session's transcript:
|
|
26
|
-
* the `<sessionId>.jsonl` basename anywhere under
|
|
26
|
+
* the `<sessionId>.jsonl` basename anywhere under `<config dir>/projects` -- `CLAUDE_CONFIG_DIR`, else
|
|
27
|
+
* `~/.claude` ({@link claudeConfigDir}), `~` expanded via os.homedir
|
|
27
28
|
* (globSync does NOT perform tilde expansion). Exposed so callers can report the
|
|
28
29
|
* EXACT pattern they globbed in a not-found/ambiguity diagnostic without
|
|
29
30
|
* re-deriving (and risking drift from) the string used by findTranscript (R1.3).
|
|
@@ -32,12 +33,12 @@ import { StringDecoder } from "node:string_decoder";
|
|
|
32
33
|
* @returns the absolute glob pattern findTranscript passes to globSync.
|
|
33
34
|
*/
|
|
34
35
|
export function transcriptGlob(sessionId) {
|
|
35
|
-
return join(
|
|
36
|
+
return join(claudeConfigDir(), "projects", "**", `${sessionId}.jsonl`);
|
|
36
37
|
}
|
|
37
38
|
/**
|
|
38
39
|
* Find Claude transcript file(s) for a given session id.
|
|
39
40
|
*
|
|
40
|
-
* Globs the `<sessionId>.jsonl` basename anywhere under
|
|
41
|
+
* Globs the `<sessionId>.jsonl` basename anywhere under `<config dir>/projects` ({@link claudeConfigDir})
|
|
41
42
|
* so the file is found independent of the cwd→dir encoding (R1.1). Returns ALL
|
|
42
43
|
* matches (normally one) as absolute paths; an empty array means "not found".
|
|
43
44
|
*
|
|
@@ -46,7 +47,7 @@ export function transcriptGlob(sessionId) {
|
|
|
46
47
|
*/
|
|
47
48
|
export function findTranscript(sessionId) {
|
|
48
49
|
// globSync returns paths relative to cwd unless the pattern is absolute, which it is here
|
|
49
|
-
// (
|
|
50
|
+
// (the config dir is absolute, via transcriptGlob), so matches are absolute too. transcriptGlob
|
|
50
51
|
// is the single source of the pattern string.
|
|
51
52
|
return globSync(transcriptGlob(sessionId));
|
|
52
53
|
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.17.
|
|
6
|
+
"version": "0.17.9",
|
|
7
7
|
"description": "Runs the official Claude Code TUI over a PTY and exposes it via ACP, so Claude Code threads render natively in Zed's agent panel. Built for Anthropic's June 2026 billing split (since paused).",
|
|
8
8
|
"main": "dist/lib.js",
|
|
9
9
|
"types": "dist/lib.d.ts",
|
|
@@ -64,19 +64,19 @@
|
|
|
64
64
|
"node": ">=24"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@agentclientprotocol/sdk": "2.
|
|
68
|
-
"@anthropic-ai/claude-agent-sdk": "0.3.
|
|
67
|
+
"@agentclientprotocol/sdk": "2.12.0",
|
|
68
|
+
"@anthropic-ai/claude-agent-sdk": "0.3.332",
|
|
69
69
|
"node-pty": "1.1.0",
|
|
70
70
|
"zod": "^4.0.0"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
-
"@anthropic-ai/sdk": "1.
|
|
73
|
+
"@anthropic-ai/sdk": "1.14.0",
|
|
74
74
|
"@eslint/js": "10.0.1",
|
|
75
|
-
"@types/node": "26.6.
|
|
76
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
77
|
-
"@typescript-eslint/parser": "8.
|
|
78
|
-
"eslint": "10.
|
|
79
|
-
"eslint-config-prettier": "10.1.
|
|
75
|
+
"@types/node": "26.6.11",
|
|
76
|
+
"@typescript-eslint/eslint-plugin": "8.74.0",
|
|
77
|
+
"@typescript-eslint/parser": "8.74.0",
|
|
78
|
+
"eslint": "10.16.0",
|
|
79
|
+
"eslint-config-prettier": "10.1.9",
|
|
80
80
|
"globals": "17.14.0",
|
|
81
81
|
"prettier": "3.10.1",
|
|
82
82
|
"ts-node": "10.9.2",
|