mintree 0.5.9 → 0.5.11
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/lib/claude.js +12 -12
- package/dist/lib/terminal.d.ts +9 -8
- package/dist/lib/terminal.js +20 -22
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -292,7 +292,7 @@ Linear authentication lives in `~/.mintree/credentials.json` (user-scoped, not p
|
|
|
292
292
|
- **Sessions persist by issue**: each issue gets a UUID stored in `metadata.json`. Subsequent `worktree work` calls pass `--resume <uuid>` so Claude reopens the same conversation.
|
|
293
293
|
- **Live state** (optional): the four hooks installed by `mintree helpers session-signal install` write the current Claude state to `.mintree/session-states/<issue>.json` on every prompt / stop / notification / session-end. The dashboard reads those files to colour each row in real time.
|
|
294
294
|
- **Remote Control** (optional): `mintree doctor` checks `~/.claude.json` for `remoteControlAtStartup: true`. Enabling it lets you continue a local session from a different device.
|
|
295
|
-
- **iTerm2
|
|
295
|
+
- **iTerm2 session badge** (automatic): when you launch on [iTerm2](https://iterm2.com), mintree sets the terminal **badge** — the large translucent label drawn over the session — to the session name (the worktree issue id like `VAL-68`, or the orchestrator's name) so each tab stays identifiable at a glance. It uses the badge rather than the tab title because Claude Code overwrites the title while it runs; the badge is independent of it and persists for the whole session, then clears on exit. No-op on other terminals (detected via `TERM_PROGRAM` / `LC_TERMINAL`).
|
|
296
296
|
|
|
297
297
|
---
|
|
298
298
|
|
package/dist/lib/claude.js
CHANGED
|
@@ -2,7 +2,7 @@ import { execSync, spawn } from "child_process";
|
|
|
2
2
|
import { existsSync, writeFileSync } from "fs";
|
|
3
3
|
import { homedir, tmpdir } from "os";
|
|
4
4
|
import { join } from "path";
|
|
5
|
-
import {
|
|
5
|
+
import { setITermBadge, clearITermBadge } from "./terminal.js";
|
|
6
6
|
export const PERMISSION_MODES = ["default", "auto"];
|
|
7
7
|
/**
|
|
8
8
|
* Resolves the absolute path of the Claude Code CLI binary, or null if not on
|
|
@@ -75,17 +75,17 @@ export function launchClaude(options) {
|
|
|
75
75
|
if (options.prompt && options.prompt.length > 0) {
|
|
76
76
|
args.push("--", promptArg(options.prompt));
|
|
77
77
|
}
|
|
78
|
-
// Label the session
|
|
79
|
-
//
|
|
80
|
-
//
|
|
81
|
-
//
|
|
82
|
-
const
|
|
83
|
-
if (
|
|
84
|
-
|
|
78
|
+
// Label the session with an iTerm2 badge before handing over the TTY. The
|
|
79
|
+
// badge survives Claude overwriting the terminal title, so the tab stays
|
|
80
|
+
// identifiable (worktree issue id, or orchestrator name) while it runs.
|
|
81
|
+
// No-op outside iTerm2.
|
|
82
|
+
const badge = options.remoteControlName;
|
|
83
|
+
if (badge)
|
|
84
|
+
setITermBadge(badge);
|
|
85
85
|
const child = spawn(bin, args, { stdio: "inherit", cwd: options.cwd });
|
|
86
|
-
// Clear the
|
|
87
|
-
// that regains the TTY.
|
|
88
|
-
if (
|
|
89
|
-
child.on("exit", () =>
|
|
86
|
+
// Clear the badge once Claude exits so the badge doesn't linger on the
|
|
87
|
+
// shell that regains the TTY.
|
|
88
|
+
if (badge)
|
|
89
|
+
child.on("exit", () => clearITermBadge());
|
|
90
90
|
return child;
|
|
91
91
|
}
|
package/dist/lib/terminal.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/** True when the active terminal is iTerm2 (also detected through tmux). */
|
|
2
2
|
export declare function isITerm(): boolean;
|
|
3
3
|
/**
|
|
4
|
-
* Builds the raw
|
|
5
|
-
* so it can be unit-tested; an empty string clears the
|
|
6
|
-
* iTerm2
|
|
4
|
+
* Builds the raw iTerm2 SetBadgeFormat escape sequence for `text`. Pure (no I/O)
|
|
5
|
+
* so it can be unit-tested; an empty string clears the badge. The badge format
|
|
6
|
+
* supports `\(...)` interpolation in iTerm2, but plain ids/labels carry no
|
|
7
|
+
* parens so the base64-encoded literal renders verbatim.
|
|
7
8
|
*/
|
|
8
|
-
export declare function
|
|
9
|
-
/** Sets the iTerm2
|
|
10
|
-
export declare function
|
|
11
|
-
/** Clears the iTerm2
|
|
12
|
-
export declare function
|
|
9
|
+
export declare function buildBadgeSequence(text: string): string;
|
|
10
|
+
/** Sets the iTerm2 badge to `text`. No-op outside iTerm2 or with empty text. */
|
|
11
|
+
export declare function setITermBadge(text: string): void;
|
|
12
|
+
/** Clears the iTerm2 badge. No-op outside iTerm2. */
|
|
13
|
+
export declare function clearITermBadge(): void;
|
package/dist/lib/terminal.js
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
// iTerm2
|
|
1
|
+
// iTerm2 badge integration.
|
|
2
2
|
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
// icon name / tab title is a separate slot it leaves alone. An earlier version
|
|
10
|
-
// used the iTerm2 badge instead, but the badge font scales to fill a
|
|
11
|
-
// profile-controlled box and rendered enormous for short labels, with no
|
|
12
|
-
// per-session escape to shrink it. The tab title is small and unobtrusive.
|
|
3
|
+
// Claude Code overwrites the terminal title (OSC 0/2) while it runs and exposes
|
|
4
|
+
// no way to disable that or pin a custom title, so a tab title we set before
|
|
5
|
+
// launching wouldn't survive. The iTerm2 *badge* — a large translucent label
|
|
6
|
+
// drawn over the session — is independent of the title and Claude never touches
|
|
7
|
+
// it, so it's the one reliable way to identify a mintree session at a glance
|
|
8
|
+
// (e.g. the worktree issue id `VAL-68`, or `orchestrator-VAL-12_BE-16`).
|
|
13
9
|
//
|
|
14
10
|
// Everything here is a no-op outside iTerm2, so callers can invoke it
|
|
15
11
|
// unconditionally.
|
|
@@ -29,12 +25,14 @@ function wrapForTmux(seq) {
|
|
|
29
25
|
return `${ESC}Ptmux;${doubled}${ESC}\\`;
|
|
30
26
|
}
|
|
31
27
|
/**
|
|
32
|
-
* Builds the raw
|
|
33
|
-
* so it can be unit-tested; an empty string clears the
|
|
34
|
-
* iTerm2
|
|
28
|
+
* Builds the raw iTerm2 SetBadgeFormat escape sequence for `text`. Pure (no I/O)
|
|
29
|
+
* so it can be unit-tested; an empty string clears the badge. The badge format
|
|
30
|
+
* supports `\(...)` interpolation in iTerm2, but plain ids/labels carry no
|
|
31
|
+
* parens so the base64-encoded literal renders verbatim.
|
|
35
32
|
*/
|
|
36
|
-
export function
|
|
37
|
-
|
|
33
|
+
export function buildBadgeSequence(text) {
|
|
34
|
+
const b64 = Buffer.from(text, "utf8").toString("base64");
|
|
35
|
+
return wrapForTmux(`${ESC}]1337;SetBadgeFormat=${b64}${BEL}`);
|
|
38
36
|
}
|
|
39
37
|
function writeToTty(seq) {
|
|
40
38
|
// We only call this right before spawning Claude / right after it exits,
|
|
@@ -43,15 +41,15 @@ function writeToTty(seq) {
|
|
|
43
41
|
if (process.stdout.isTTY)
|
|
44
42
|
process.stdout.write(seq);
|
|
45
43
|
}
|
|
46
|
-
/** Sets the iTerm2
|
|
47
|
-
export function
|
|
44
|
+
/** Sets the iTerm2 badge to `text`. No-op outside iTerm2 or with empty text. */
|
|
45
|
+
export function setITermBadge(text) {
|
|
48
46
|
if (!isITerm() || !text)
|
|
49
47
|
return;
|
|
50
|
-
writeToTty(
|
|
48
|
+
writeToTty(buildBadgeSequence(text));
|
|
51
49
|
}
|
|
52
|
-
/** Clears the iTerm2
|
|
53
|
-
export function
|
|
50
|
+
/** Clears the iTerm2 badge. No-op outside iTerm2. */
|
|
51
|
+
export function clearITermBadge() {
|
|
54
52
|
if (!isITerm())
|
|
55
53
|
return;
|
|
56
|
-
writeToTty(
|
|
54
|
+
writeToTty(buildBadgeSequence(""));
|
|
57
55
|
}
|
package/package.json
CHANGED