@adhdev/daemon-core 0.9.82-rc.161 → 0.9.82-rc.162

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhdev/daemon-core",
3
- "version": "0.9.82-rc.161",
3
+ "version": "0.9.82-rc.162",
4
4
  "description": "ADHDev daemon core — CDP, IDE detection, providers, command execution",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -23,7 +23,22 @@
23
23
  */
24
24
  'use strict';
25
25
 
26
- import { Terminal } from '@xterm/headless';
26
+ // @xterm/headless ships as CJS only but stamps __esModule = true on its
27
+ // export object, so tsup's __toESM helper neither synthesizes a `default`
28
+ // property (it sees the __esModule marker and trusts it) nor preserves
29
+ // the named `Terminal` export through a plain ESM-style
30
+ // `import { Terminal } from '@xterm/headless'`. The first symptom we saw
31
+ // from this was the published `adhdev` CLI exploding with
32
+ // "Named export 'Terminal' not found" inside the mcp ipc bootstrap.
33
+ //
34
+ // Pull Terminal off the namespace import (which tsup compiles into a
35
+ // shim that *does* see the package's own Terminal property) instead.
36
+ // Type-only import keeps the .d.ts surface honest.
37
+ import type { Terminal as TerminalType } from '@xterm/headless';
38
+ import * as xtermHeadlessNs from '@xterm/headless';
39
+ const TerminalCtor: { new (...args: unknown[]): TerminalType } =
40
+ (xtermHeadlessNs as any).Terminal
41
+ ?? (xtermHeadlessNs as any).default?.Terminal;
27
42
  import { NodePtyTransportFactory, type PtyRuntimeTransport, type PtyTransportFactory } from '../../cli-adapters/pty-transport.js';
28
43
 
29
44
  export interface TerminalAdapterOpts {
@@ -57,7 +72,7 @@ export interface TerminalAdapterHandlers {
57
72
  }
58
73
 
59
74
  export class TerminalAdapter {
60
- private term: Terminal;
75
+ private term: TerminalType;
61
76
  private pty: PtyRuntimeTransport | null = null;
62
77
  private factory: PtyTransportFactory;
63
78
  private cols: number;
@@ -77,7 +92,7 @@ export class TerminalAdapter {
77
92
  this.screenDebounceMs = opts.screenChangeDebounceMs ?? 80;
78
93
  this.tickIntervalMs = opts.tickIntervalMs ?? 0;
79
94
  this.factory = opts.transportFactory ?? new NodePtyTransportFactory();
80
- this.term = new Terminal({ cols: this.cols, rows: this.rows, allowProposedApi: true, scrollback: 1000 });
95
+ this.term = new TerminalCtor({ cols: this.cols, rows: this.rows, allowProposedApi: true, scrollback: 1000 });
81
96
  }
82
97
 
83
98
  start(): void {