@ammduncan/easel 0.2.13 → 0.2.14

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/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  All notable changes to easel. This project adheres to [Semantic Versioning](https://semver.org/).
4
4
 
5
+ ## 0.2.14 — 2026-05-23
6
+
7
+ ### Changed
8
+ - **First-push auto-open is now actually the only trigger.** 0.2.10 moved the MCP-side auto-open from "first tool call" to "first push when no tab is alive". But Claude Code launches were still opening a tab because `easel setup` also installed a `SessionStart` hook that ran `easel open --quiet`. Two changes:
9
+ - `easel setup` no longer installs the `easel open --quiet` SessionStart block, and actively strips any pre-existing one from `~/.claude/settings.json`. The `idCaptureBlock` (which writes the per-PPID session-id file) stays — it's needed for PPID → session correlation and has no UI side effect.
10
+ - `mcp.ts` `autoOpenIfNeeded` drops the `hookHasFiredForThisPpid()` short-circuit. That check was a proxy for "the hook already opened a tab"; now that the hook doesn't open tabs, `sessionTabs > 0` is the truthful signal.
11
+ - After upgrading, run `easel update` once so setup re-runs and cleans your existing `~/.claude/settings.json`.
12
+
5
13
  ## 0.2.13 — 2026-05-23
6
14
 
7
15
  ### Added
package/dist/cli.js CHANGED
@@ -124,7 +124,8 @@ function cmdSetup() {
124
124
  const hooks = settings.hooks ?? {};
125
125
  let sessionStart = hooks.SessionStart ?? [];
126
126
  // Drop legacy entries from prior versions (the old bash hook, paths under the
127
- // claude-display name) before re-adding the current Node-based hook.
127
+ // claude-display name) AND the prior autoOpenBlock (which opened a tab at
128
+ // SessionStart — replaced by MCP-side auto-open on first push as of 0.2.14).
128
129
  const isLegacy = (block) => {
129
130
  const inner = block?.hooks ?? [block];
130
131
  if (!Array.isArray(inner))
@@ -135,16 +136,16 @@ function cmdSetup() {
135
136
  return false;
136
137
  return (cmd.includes("claude-display-session-id.sh") ||
137
138
  cmd.includes("easel-session-id.sh") ||
138
- cmd.includes("bin/claude-display "));
139
+ cmd.includes("bin/claude-display ") ||
140
+ // Prior `easel open --quiet` SessionStart hook — superseded by
141
+ // MCP-side first-push auto-open.
142
+ (cmd.includes("easel") && cmd.includes("open --quiet")));
139
143
  });
140
144
  };
141
145
  sessionStart = sessionStart.filter((b) => !isLegacy(b));
142
146
  const idCaptureBlock = {
143
147
  hooks: [{ type: "command", command: `node ${hookScript}` }],
144
148
  };
145
- const autoOpenBlock = {
146
- hooks: [{ type: "command", command: `${cliEntry} open --quiet` }],
147
- };
148
149
  const containsBlockMatching = (substr) => sessionStart.some((block) => {
149
150
  const inner = block?.hooks ?? [block];
150
151
  return (Array.isArray(inner) ? inner : []).some((h) => typeof h === "object" &&
@@ -155,9 +156,6 @@ function cmdSetup() {
155
156
  if (!containsBlockMatching("easel-session-id.mjs")) {
156
157
  sessionStart.push(idCaptureBlock);
157
158
  }
158
- if (!containsBlockMatching("easel") || !containsBlockMatching("open --quiet")) {
159
- sessionStart.push(autoOpenBlock);
160
- }
161
159
  hooks.SessionStart = sessionStart;
162
160
  settings.hooks = hooks;
163
161
  mkdirSync(dirname(settingsPath), { recursive: true });
package/dist/mcp.js CHANGED
@@ -3,11 +3,8 @@ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
3
3
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
4
  import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
5
5
  import { spawn } from "node:child_process";
6
- import { existsSync } from "node:fs";
7
- import { join } from "node:path";
8
6
  import { ensureHttpServer } from "./server-manager.js";
9
7
  import { resolveClaudeSessionId } from "./session-id.js";
10
- import { HOOK_DIR } from "./paths.js";
11
8
  function openUrlInBrowser(url) {
12
9
  const platform = process.platform;
13
10
  const cmd = platform === "darwin" ? "open" : platform === "win32" ? "start" : "xdg-open";
@@ -24,14 +21,6 @@ const TOOL_PUSH = "push";
24
21
  const TOOL_OPEN = "open";
25
22
  const TOOL_CONFIG = "config";
26
23
  const TOOL_LABEL = "label";
27
- /**
28
- * True if a SessionStart hook (e.g. Claude Code's) has already written a
29
- * session-id file for this MCP child's PPID. Tells us a hook-aware client is
30
- * managing tab lifecycle, so the MCP server should NOT also auto-open.
31
- */
32
- function hookHasFiredForThisPpid() {
33
- return existsSync(join(HOOK_DIR, `cc-session-${process.ppid}.txt`));
34
- }
35
24
  // One-shot guard: only auto-open once per MCP-child lifetime. If the user
36
25
  // closes the tab afterwards, subsequent pushes won't re-open it — the user
37
26
  // closing the tab is treated as an explicit dismissal we should respect.
@@ -43,10 +32,16 @@ let autoOpenAttempted = false;
43
32
  * - `otherTabs > 0`: easel is open, but on a different session. Don't surprise
44
33
  * the user with another window — return "other-session" so the caller can
45
34
  * tell the agent to ask whether to use the topbar switcher or open a new tab.
46
- * - both 0 + no hook-managed tab: auto-open one tab.
35
+ * - both 0: auto-open one tab.
47
36
  *
48
37
  * One-shot per MCP child lifetime. Closing the tab counts as dismissal;
49
38
  * subsequent pushes won't re-open.
39
+ *
40
+ * Note: until 0.2.13, this also short-circuited when the Claude Code
41
+ * SessionStart hook had fired (`hookHasFiredForThisPpid`), because the hook
42
+ * itself opened a tab. As of 0.2.14 `easel setup` no longer installs that
43
+ * hook, so the MCP-side decision is reactive to actual tab presence only —
44
+ * `sessionTabs` is the truthful signal.
50
45
  */
51
46
  function autoOpenIfNeeded(url, sessionTabs, otherTabs) {
52
47
  if (autoOpenAttempted)
@@ -60,11 +55,6 @@ function autoOpenIfNeeded(url, sessionTabs, otherTabs) {
60
55
  autoOpenAttempted = true;
61
56
  return { kind: "other-session" };
62
57
  }
63
- if (hookHasFiredForThisPpid()) {
64
- // Claude Code's SessionStart hook handled it (or tried to).
65
- autoOpenAttempted = true;
66
- return { kind: "noop" };
67
- }
68
58
  autoOpenAttempted = true;
69
59
  openUrlInBrowser(url);
70
60
  return { kind: "opened" };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ammduncan/easel",
3
- "version": "0.2.13",
3
+ "version": "0.2.14",
4
4
  "description": "A live browser tab for every Claude Code (and MCP) session. The push MCP tool appends HTML cards to a scrolling feed you keep open in split-screen.",
5
5
  "type": "module",
6
6
  "license": "MIT",