shellpuppet 0.1.0 → 0.2.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.
Files changed (95) hide show
  1. package/README.md +191 -32
  2. package/dist/cli/desktopShortcut.d.ts +22 -0
  3. package/dist/cli/desktopShortcut.js +157 -0
  4. package/dist/cli/desktopShortcut.js.map +1 -0
  5. package/dist/cli/index.js +205 -52
  6. package/dist/cli/index.js.map +1 -1
  7. package/dist/client/http.d.ts +62 -1
  8. package/dist/client/http.js +388 -32
  9. package/dist/client/http.js.map +1 -1
  10. package/dist/core/dialogs.d.ts +20 -12
  11. package/dist/core/dialogs.js +31 -19
  12. package/dist/core/dialogs.js.map +1 -1
  13. package/dist/core/manager.d.ts +35 -5
  14. package/dist/core/manager.js +121 -8
  15. package/dist/core/manager.js.map +1 -1
  16. package/dist/core/nativePty.d.ts +9 -5
  17. package/dist/core/nativePty.js +11 -6
  18. package/dist/core/nativePty.js.map +1 -1
  19. package/dist/core/promptDetector.d.ts +37 -3
  20. package/dist/core/promptDetector.js +303 -12
  21. package/dist/core/promptDetector.js.map +1 -1
  22. package/dist/core/reasoning.d.ts +19 -6
  23. package/dist/core/reasoning.js +223 -30
  24. package/dist/core/reasoning.js.map +1 -1
  25. package/dist/core/regexBudget.d.ts +20 -0
  26. package/dist/core/regexBudget.js +25 -1
  27. package/dist/core/regexBudget.js.map +1 -1
  28. package/dist/core/renderer.d.ts +16 -1
  29. package/dist/core/renderer.js +97 -6
  30. package/dist/core/renderer.js.map +1 -1
  31. package/dist/core/selection.d.ts +6 -0
  32. package/dist/core/selection.js +48 -0
  33. package/dist/core/selection.js.map +1 -0
  34. package/dist/core/session.d.ts +266 -12
  35. package/dist/core/session.js +583 -99
  36. package/dist/core/session.js.map +1 -1
  37. package/dist/core/types.d.ts +53 -18
  38. package/dist/core/types.js +30 -6
  39. package/dist/core/types.js.map +1 -1
  40. package/dist/core/waiter.d.ts +12 -4
  41. package/dist/core/waiter.js +63 -70
  42. package/dist/core/waiter.js.map +1 -1
  43. package/dist/core/windowsConsoleHost.d.ts +147 -0
  44. package/dist/core/windowsConsoleHost.js +588 -0
  45. package/dist/core/windowsConsoleHost.js.map +1 -0
  46. package/dist/core/windowsPtyStart.d.ts +100 -29
  47. package/dist/core/windowsPtyStart.js +143 -36
  48. package/dist/core/windowsPtyStart.js.map +1 -1
  49. package/dist/daemon/auth.d.ts +72 -2
  50. package/dist/daemon/auth.js +128 -3
  51. package/dist/daemon/auth.js.map +1 -1
  52. package/dist/daemon/config.d.ts +44 -1
  53. package/dist/daemon/config.js +276 -9
  54. package/dist/daemon/config.js.map +1 -1
  55. package/dist/daemon/folderPicker.d.ts +27 -0
  56. package/dist/daemon/folderPicker.js +115 -0
  57. package/dist/daemon/folderPicker.js.map +1 -0
  58. package/dist/daemon/index.js +20 -19
  59. package/dist/daemon/index.js.map +1 -1
  60. package/dist/daemon/launchProfiles.d.ts +155 -0
  61. package/dist/daemon/launchProfiles.js +554 -0
  62. package/dist/daemon/launchProfiles.js.map +1 -0
  63. package/dist/daemon/paths.d.ts +2 -0
  64. package/dist/daemon/paths.js.map +1 -1
  65. package/dist/daemon/screenshot.d.ts +58 -1
  66. package/dist/daemon/screenshot.js +172 -26
  67. package/dist/daemon/screenshot.js.map +1 -1
  68. package/dist/daemon/server.d.ts +219 -10
  69. package/dist/daemon/server.js +1970 -203
  70. package/dist/daemon/server.js.map +1 -1
  71. package/dist/daemon/sessionFeed.d.ts +48 -0
  72. package/dist/daemon/sessionFeed.js +101 -0
  73. package/dist/daemon/sessionFeed.js.map +1 -0
  74. package/dist/daemon/viewerLauncher.d.ts +100 -9
  75. package/dist/daemon/viewerLauncher.js +349 -67
  76. package/dist/daemon/viewerLauncher.js.map +1 -1
  77. package/dist/mcp/config.d.ts +7 -14
  78. package/dist/mcp/config.js +10 -21
  79. package/dist/mcp/config.js.map +1 -1
  80. package/dist/mcp/index.js +20 -11
  81. package/dist/mcp/index.js.map +1 -1
  82. package/dist/mcp/tools.d.ts +14 -7
  83. package/dist/mcp/tools.js +161 -60
  84. package/dist/mcp/tools.js.map +1 -1
  85. package/dist/viewer/dashboard-folders.js +20 -0
  86. package/dist/viewer/dashboard-layout.js +52 -0
  87. package/dist/viewer/dashboard.css +67 -0
  88. package/dist/viewer/dashboard.html +44 -0
  89. package/dist/viewer/dashboard.js +1518 -0
  90. package/dist/viewer/icon.ico +0 -0
  91. package/dist/viewer/index.html +12 -7
  92. package/dist/viewer/pane.js +736 -0
  93. package/dist/viewer/viewer.css +18 -7
  94. package/dist/viewer/viewer.js +47 -624
  95. package/package.json +13 -13
@@ -28,8 +28,11 @@
28
28
  * not start with `^` matches anywhere in a line; OpenCode draws a sidebar on
29
29
  * the same rows as the dialog, after it. Each signature's search runs under
30
30
  * the regular-expression time budget (`regexBudget.ts`): a pattern from
31
- * config is text a person wrote, and one that runs past the budget is set
32
- * aside and reported rather than tried on every scan.
31
+ * config is text a person wrote, and one that runs past the budget is
32
+ * reported and set aside for a minute (`SET_ASIDE_MS`) rather than tried on
33
+ * every scan. It is tried again after that, built-in ones included, as an
34
+ * agent signature is (`reasoning.ts`): an ordinary pattern can run past a
35
+ * wall-clock budget once on a loaded machine.
33
36
  */
34
37
  import type { DetectedPrompt } from './promptDetector.js';
35
38
  /** One program's dialog, as data. The shape of a `prompts.dialogs` entry. */
@@ -63,14 +66,19 @@ interface CompiledDialog {
63
66
  choices: RegExp;
64
67
  within: number;
65
68
  below: number;
66
- /** Set once the signature has run past its budget; it is not tried again. */
67
- overBudget: boolean;
69
+ /**
70
+ * When the signature last ran past its budget. It is set aside for
71
+ * `SET_ASIDE_MS` after that, then tried again.
72
+ */
73
+ overBudgetAt: number | null;
74
+ /** Whether it is one of `BUILT_IN_DIALOGS`, which no config can change. */
75
+ builtIn: boolean;
68
76
  }
69
77
  /**
70
78
  * Compile signatures, setting aside any that cannot be used and saying why,
71
- * in words a person can act on.
79
+ * in words a person can act on. `builtIn` marks the list as `BUILT_IN_DIALOGS`.
72
80
  */
73
- export declare function compileDialogs(list: readonly unknown[]): {
81
+ export declare function compileDialogs(list: readonly unknown[], builtIn?: boolean): {
74
82
  dialogs: CompiledDialog[];
75
83
  problems: string[];
76
84
  /** The positions in `list` of the entries that compiled. */
@@ -78,11 +86,11 @@ export declare function compileDialogs(list: readonly unknown[]): {
78
86
  };
79
87
  /**
80
88
  * Recognise the built-in dialogs plus `extra`, the entries from config, and
81
- * name the one to tell when a signature runs past its budget (the daemon
82
- * logs it). Returns what was wrong with `extra`; the entries that are fine
83
- * are used.
89
+ * name the one to tell, with whether the signature is built in, when a
90
+ * signature runs past its budget (the daemon logs it). Returns what was wrong
91
+ * with `extra`; the entries that are fine are used.
84
92
  */
85
- export declare function useDialogSignatures(extra: readonly unknown[], onOverBudget?: (name: string) => void): string[];
86
- /** A recognised dialog on screen, or null. */
87
- export declare function dialogPrompt(raw: readonly string[], dialogs?: readonly CompiledDialog[]): DetectedPrompt | null;
93
+ export declare function useDialogSignatures(extra: readonly unknown[], onOverBudget?: (name: string, builtIn: boolean) => void): string[];
94
+ /** A recognised dialog on screen, or null. `now` is the time of the scan. */
95
+ export declare function dialogPrompt(raw: readonly string[], dialogs?: readonly CompiledDialog[], now?: number): DetectedPrompt | null;
88
96
  export {};
@@ -28,10 +28,13 @@
28
28
  * not start with `^` matches anywhere in a line; OpenCode draws a sidebar on
29
29
  * the same rows as the dialog, after it. Each signature's search runs under
30
30
  * the regular-expression time budget (`regexBudget.ts`): a pattern from
31
- * config is text a person wrote, and one that runs past the budget is set
32
- * aside and reported rather than tried on every scan.
31
+ * config is text a person wrote, and one that runs past the budget is
32
+ * reported and set aside for a minute (`SET_ASIDE_MS`) rather than tried on
33
+ * every scan. It is tried again after that, built-in ones included, as an
34
+ * agent signature is (`reasoning.ts`): an ordinary pattern can run past a
35
+ * wall-clock budget once on a loaded machine.
33
36
  */
34
- import { RegexBudgetError, withRegexBudget } from './regexBudget.js';
37
+ import { RegexBudgetError, SET_ASIDE_MS, withRegexBudget } from './regexBudget.js';
35
38
  export const DEFAULT_DIALOG_WITHIN = 40;
36
39
  export const DEFAULT_DIALOG_BELOW = 4;
37
40
  const MAX_DIALOG_WITHIN = 100;
@@ -52,9 +55,9 @@ function wholeNumber(value, max) {
52
55
  }
53
56
  /**
54
57
  * Compile signatures, setting aside any that cannot be used and saying why,
55
- * in words a person can act on.
58
+ * in words a person can act on. `builtIn` marks the list as `BUILT_IN_DIALOGS`.
56
59
  */
57
- export function compileDialogs(list) {
60
+ export function compileDialogs(list, builtIn = false) {
58
61
  const dialogs = [];
59
62
  const problems = [];
60
63
  const usable = [];
@@ -89,7 +92,8 @@ export function compileDialogs(list) {
89
92
  choices: new RegExp(choices, 'u'),
90
93
  within: within ?? DEFAULT_DIALOG_WITHIN,
91
94
  below: below ?? DEFAULT_DIALOG_BELOW,
92
- overBudget: false,
95
+ overBudgetAt: null,
96
+ builtIn,
93
97
  });
94
98
  usable.push(index);
95
99
  }
@@ -99,16 +103,16 @@ export function compileDialogs(list) {
99
103
  });
100
104
  return { dialogs, problems, usable };
101
105
  }
102
- let active = compileDialogs(BUILT_IN_DIALOGS).dialogs;
106
+ let active = compileDialogs(BUILT_IN_DIALOGS, true).dialogs;
103
107
  let reportOverBudget = () => undefined;
104
108
  /**
105
109
  * Recognise the built-in dialogs plus `extra`, the entries from config, and
106
- * name the one to tell when a signature runs past its budget (the daemon
107
- * logs it). Returns what was wrong with `extra`; the entries that are fine
108
- * are used.
110
+ * name the one to tell, with whether the signature is built in, when a
111
+ * signature runs past its budget (the daemon logs it). Returns what was wrong
112
+ * with `extra`; the entries that are fine are used.
109
113
  */
110
114
  export function useDialogSignatures(extra, onOverBudget = () => undefined) {
111
- const builtIn = compileDialogs(BUILT_IN_DIALOGS).dialogs;
115
+ const builtIn = compileDialogs(BUILT_IN_DIALOGS, true).dialogs;
112
116
  const { dialogs, problems } = compileDialogs(extra);
113
117
  active = [...builtIn, ...dialogs];
114
118
  reportOverBudget = onOverBudget;
@@ -119,10 +123,10 @@ function normalise(text) {
119
123
  }
120
124
  /** Leading whitespace and box-drawing borders (U+2500 to U+257F). */
121
125
  const LEADING_BORDER = /^[\s─-╿]+/u;
122
- /** A recognised dialog on screen, or null. */
123
- export function dialogPrompt(raw, dialogs = active) {
126
+ /** A recognised dialog on screen, or null. `now` is the time of the scan. */
127
+ export function dialogPrompt(raw, dialogs = active, now = Date.now()) {
124
128
  for (const dialog of dialogs) {
125
- if (dialog.overBudget)
129
+ if (dialog.overBudgetAt !== null && now - dialog.overBudgetAt < SET_ASIDE_MS)
126
130
  continue;
127
131
  let found = null;
128
132
  try {
@@ -131,10 +135,11 @@ export function dialogPrompt(raw, dialogs = active) {
131
135
  catch (error) {
132
136
  if (!(error instanceof RegexBudgetError))
133
137
  throw error;
134
- // Set aside rather than tried on every scan, and the person who wrote
135
- // it is told once.
136
- dialog.overBudget = true;
137
- reportOverBudget(dialog.name);
138
+ // Set aside rather than tried on every scan, and reported each time it
139
+ // trips: a person reading daemon.log sees whether a signature keeps
140
+ // running long or tripped once under load.
141
+ dialog.overBudgetAt = now;
142
+ reportOverBudget(dialog.name, dialog.builtIn);
138
143
  }
139
144
  if (found !== null)
140
145
  return found;
@@ -183,7 +188,14 @@ function matchDialog(raw, dialog) {
183
188
  // of the title's text.
184
189
  const frame = [...new Set(titleLine.slice(0, title.index + title[0].length - titleText.length))].filter((ch) => /[─-╿]/u.test(ch));
185
190
  const request = requestText(raw.slice(t + 1, c), frame);
186
- return { question, options, signature: [dialog.name, question, request, ...options].join(' | ') };
191
+ return {
192
+ question,
193
+ options,
194
+ signature: [dialog.name, question, request, ...options].join(' | '),
195
+ // The title down to the row of choices, the request between them included.
196
+ rows: [t, c],
197
+ basis: 'frame',
198
+ };
187
199
  }
188
200
  }
189
201
  return null;
@@ -1 +1 @@
1
- {"version":3,"file":"dialogs.js","sourceRoot":"","sources":["../../src/core/dialogs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AE,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;gBACnE,2EAA2E;gBAC3E,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;gBACZ,KAAK,EAAE,OAAO;aACf,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAS,WAAW,CAAC,IAAuB,EAAE,KAAwB;IACpE,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,QAAQ,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAC3D,OAAO,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC3E,CAAC"}
@@ -12,13 +12,23 @@ import type { Logger, SessionOptions, SessionSummary } from './types.js';
12
12
  export declare class PolicyViolationError extends Error {
13
13
  constructor(message: string);
14
14
  }
15
+ export declare class SessionStartError extends Error {
16
+ constructor(message: string);
17
+ }
18
+ /** node-pty 1.2.0-beta.18's lib/windowsConoutConnection.js waits this long in dispose before terminating its worker. */
19
+ export declare const CONPTY_WORKER_DISPOSAL_MS = 1000;
20
+ /** Margin for the scheduled termination and a short pause before another start. */
21
+ export declare const CONPTY_START_RETRY_DELAY_MS = 100;
15
22
  export declare class SessionManager {
23
+ private readonly onRemoved;
16
24
  private readonly sessions;
17
25
  private readonly logger;
18
26
  private readonly sessionDeps;
19
27
  private policy;
20
28
  private seq;
21
- constructor(policy: CompiledPolicy, logger?: Logger, deps?: SessionDeps);
29
+ private readonly starting;
30
+ private readonly cancelledStarts;
31
+ constructor(policy: CompiledPolicy, logger?: Logger, deps?: SessionDeps, onRemoved?: (id: string) => void);
22
32
  /** Replace the policy. */
23
33
  setPolicy(policy: CompiledPolicy): void;
24
34
  /**
@@ -26,9 +36,14 @@ export declare class SessionManager {
26
36
  * policy's reason when refused. Callers map it to a 403.
27
37
  */
28
38
  create(options: SessionOptions): Session;
39
+ /** Finish the deferred Windows start contract, retrying one proven worker
40
+ * connection timeout under the same id after the failed attempt is ended.
41
+ * The starting reservation remains in the capacity count throughout.
42
+ */
43
+ finishStart(session: Session, options: SessionOptions): Promise<Session>;
29
44
  get(id: string): Session | undefined;
30
45
  list(): SessionSummary[];
31
- /** Sessions whose process has not exited. */
46
+ /** Live sessions, including an exited first attempt holding a retry slot. */
32
47
  liveCount(): number;
33
48
  size(): number;
34
49
  /**
@@ -51,8 +66,19 @@ export declare class SessionManager {
51
66
  * run (`taskkillTrees` says why), so each session's own kill then finds its
52
67
  * root gone and only has its terminal left to release. That run is bounded
53
68
  * by its own cap (`TREE_KILL_TIMEOUT_MS`), not by `timeoutMs`: a shorter
54
- * bound would cut short the very run it exists for. So shutdown takes
55
- * at most that cap plus `timeoutMs`.
69
+ * bound would cut short the very run it exists for.
70
+ *
71
+ * Before any of that, every session's program is waited for
72
+ * (`Session.startedProgramPid`): node-pty creates a Windows terminal's
73
+ * program only after its output worker connects, so a session started in
74
+ * the moment of shutdown has no pid yet. That wait has its own bound (above
75
+ * node-pty's five-second connection limit) and sits outside `timeoutMs`, so
76
+ * the per-session teardown budget is spent on teardown, not on waiting, and
77
+ * each kill is still awaited and verified.
78
+ *
79
+ * So shutdown takes at most the program wait (`PROGRAM_PID_WAIT_MS`), plus
80
+ * the tree kill's cap, plus `timeoutMs`. A session whose program wait ran
81
+ * out is not waited for again by its own kill.
56
82
  *
57
83
  * Each kill is bounded so shutdown ALWAYS completes. An unbounded teardown
58
84
  * that wedges leaves the daemon alive but undiscoverable. That is worse than
@@ -61,6 +87,10 @@ export declare class SessionManager {
61
87
  * overruns is logged and abandoned.
62
88
  */
63
89
  killAll(timeoutMs?: number): Promise<void>;
64
- /** Windows only: kill every live session's tree in one `taskkill` run. */
90
+ /**
91
+ * Windows only: kill, in one `taskkill` run, the tree of every session
92
+ * whose program has not been seen to end, including one whose session
93
+ * ended without it (`Session.programEnded`).
94
+ */
65
95
  private killTreesInOneRun;
66
96
  }
@@ -6,6 +6,7 @@
6
6
  * hands off to `Session`, which applies the platform shell wrapper at spawn.
7
7
  */
8
8
  import { Session, TREE_KILL_TIMEOUT_MS, taskkillTrees } from './session.js';
9
+ import { whenConsoleHostBatchSettled } from './windowsConsoleHost.js';
9
10
  import { checkSessionCapacity, evaluateCommand } from './policy.js';
10
11
  import { NULL_LOGGER } from './types.js';
11
12
  export class PolicyViolationError extends Error {
@@ -14,13 +15,27 @@ export class PolicyViolationError extends Error {
14
15
  this.name = 'PolicyViolationError';
15
16
  }
16
17
  }
18
+ export class SessionStartError extends Error {
19
+ constructor(message) {
20
+ super(message);
21
+ this.name = 'SessionStartError';
22
+ }
23
+ }
24
+ /** node-pty 1.2.0-beta.18's lib/windowsConoutConnection.js waits this long in dispose before terminating its worker. */
25
+ export const CONPTY_WORKER_DISPOSAL_MS = 1_000;
26
+ /** Margin for the scheduled termination and a short pause before another start. */
27
+ export const CONPTY_START_RETRY_DELAY_MS = 100;
17
28
  export class SessionManager {
29
+ onRemoved;
18
30
  sessions = new Map();
19
31
  logger;
20
32
  sessionDeps;
21
33
  policy;
22
34
  seq = 0;
23
- constructor(policy, logger = NULL_LOGGER, deps = {}) {
35
+ starting = new Set();
36
+ cancelledStarts = new Set();
37
+ constructor(policy, logger = NULL_LOGGER, deps = {}, onRemoved = () => undefined) {
38
+ this.onRemoved = onRemoved;
24
39
  this.policy = policy;
25
40
  this.logger = logger;
26
41
  this.sessionDeps = { logger, ...deps };
@@ -51,15 +66,78 @@ export class SessionManager {
51
66
  this.sessions.set(id, session);
52
67
  return session;
53
68
  }
69
+ /** Finish the deferred Windows start contract, retrying one proven worker
70
+ * connection timeout under the same id after the failed attempt is ended.
71
+ * The starting reservation remains in the capacity count throughout.
72
+ */
73
+ async finishStart(session, options) {
74
+ this.starting.add(session.id);
75
+ let current = session;
76
+ const registered = (allowOwnKill = false) => this.sessions.get(session.id) === current &&
77
+ !this.cancelledStarts.has(session.id) &&
78
+ (allowOwnKill || !current.isKilled);
79
+ const discard = () => {
80
+ if (this.sessions.get(session.id) !== current)
81
+ return;
82
+ this.sessions.delete(session.id);
83
+ this.onRemoved(session.id);
84
+ };
85
+ try {
86
+ for (let attempt = 0; attempt < 2; attempt++) {
87
+ const pid = await current.startedProgramPid();
88
+ if (!registered()) {
89
+ await current.kill();
90
+ discard();
91
+ throw new SessionStartError('Session start was cancelled.');
92
+ }
93
+ if (pid !== null)
94
+ return current;
95
+ const retry = attempt === 0 && current.conptyConnectionTimedOut;
96
+ const failure = current.startFailure();
97
+ await current.kill();
98
+ if (!retry) {
99
+ discard();
100
+ throw new SessionStartError(failure);
101
+ }
102
+ // The first attempt's host must be ended before the id is reused.
103
+ // The queue can settle after exhausting its attempts without ending it.
104
+ const hostEnded = await current.whenConsoleHostSettled();
105
+ await whenConsoleHostBatchSettled();
106
+ if (!hostEnded) {
107
+ discard();
108
+ throw new SessionStartError(failure);
109
+ }
110
+ if (!registered(true))
111
+ throw new SessionStartError('Session start was cancelled.');
112
+ await new Promise((resolve) => setTimeout(resolve, CONPTY_WORKER_DISPOSAL_MS + CONPTY_START_RETRY_DELAY_MS));
113
+ if (!registered(true))
114
+ throw new SessionStartError('Session start was cancelled.');
115
+ this.logger.warn('session ConPTY start retry', { id: session.id, delayMs: CONPTY_START_RETRY_DELAY_MS });
116
+ try {
117
+ current = new Session(session.id, options, { ...this.sessionDeps, retryAttempt: true });
118
+ }
119
+ catch (error) {
120
+ discard();
121
+ throw error;
122
+ }
123
+ this.sessions.set(session.id, current);
124
+ }
125
+ throw new Error('unreachable start attempt');
126
+ }
127
+ finally {
128
+ this.starting.delete(session.id);
129
+ this.cancelledStarts.delete(session.id);
130
+ }
131
+ }
54
132
  get(id) {
55
133
  return this.sessions.get(id);
56
134
  }
57
135
  list() {
58
136
  return [...this.sessions.values()].map((s) => s.summary());
59
137
  }
60
- /** Sessions whose process has not exited. */
138
+ /** Live sessions, including an exited first attempt holding a retry slot. */
61
139
  liveCount() {
62
- return [...this.sessions.values()].filter((s) => !s.exited).length;
140
+ return [...this.sessions.values()].filter((s) => !s.exited || this.starting.has(s.id)).length;
63
141
  }
64
142
  size() {
65
143
  return this.sessions.size;
@@ -82,6 +160,7 @@ export class SessionManager {
82
160
  if (now - session.exitedAt < graceMs)
83
161
  continue;
84
162
  this.sessions.delete(id);
163
+ this.onRemoved(id);
85
164
  // The process is already dead; kill() just releases the PTY handles
86
165
  // and disposes the renderer. It deliberately does NOT tree-kill: the
87
166
  // root has been gone for the whole grace period, so there is nothing
@@ -89,6 +168,9 @@ export class SessionManager {
89
168
  // recycled. A grandchild that outlived its parent is left
90
169
  // running, which is a residual risk stated in
91
170
  // `docs/reference/security-model.md` rather than a case to guess at.
171
+ // The one exception is a session that ended without its program being
172
+ // seen to end (`Session.programEnded`): the session ends that program
173
+ // at once, and kill() waits for it, or walks the tree if it has not.
92
174
  await session.kill();
93
175
  reaped.push(id);
94
176
  }
@@ -99,8 +181,11 @@ export class SessionManager {
99
181
  const session = this.sessions.get(id);
100
182
  if (session === undefined)
101
183
  return false;
184
+ if (this.starting.has(id))
185
+ this.cancelledStarts.add(id);
102
186
  await session.kill();
103
187
  this.sessions.delete(id);
188
+ this.onRemoved(id);
104
189
  return true;
105
190
  }
106
191
  /**
@@ -111,8 +196,19 @@ export class SessionManager {
111
196
  * run (`taskkillTrees` says why), so each session's own kill then finds its
112
197
  * root gone and only has its terminal left to release. That run is bounded
113
198
  * by its own cap (`TREE_KILL_TIMEOUT_MS`), not by `timeoutMs`: a shorter
114
- * bound would cut short the very run it exists for. So shutdown takes
115
- * at most that cap plus `timeoutMs`.
199
+ * bound would cut short the very run it exists for.
200
+ *
201
+ * Before any of that, every session's program is waited for
202
+ * (`Session.startedProgramPid`): node-pty creates a Windows terminal's
203
+ * program only after its output worker connects, so a session started in
204
+ * the moment of shutdown has no pid yet. That wait has its own bound (above
205
+ * node-pty's five-second connection limit) and sits outside `timeoutMs`, so
206
+ * the per-session teardown budget is spent on teardown, not on waiting, and
207
+ * each kill is still awaited and verified.
208
+ *
209
+ * So shutdown takes at most the program wait (`PROGRAM_PID_WAIT_MS`), plus
210
+ * the tree kill's cap, plus `timeoutMs`. A session whose program wait ran
211
+ * out is not waited for again by its own kill.
116
212
  *
117
213
  * Each kill is bounded so shutdown ALWAYS completes. An unbounded teardown
118
214
  * that wedges leaves the daemon alive but undiscoverable. That is worse than
@@ -122,7 +218,15 @@ export class SessionManager {
122
218
  */
123
219
  async killAll(timeoutMs = 10_000) {
124
220
  const all = [...this.sessions.values()];
125
- this.sessions.clear();
221
+ for (const session of all) {
222
+ if (this.starting.has(session.id))
223
+ this.cancelledStarts.add(session.id);
224
+ this.sessions.delete(session.id);
225
+ this.onRemoved(session.id);
226
+ }
227
+ await Promise.all(all.map(async (session) => {
228
+ await session.startedProgramPid();
229
+ }));
126
230
  await this.killTreesInOneRun(all);
127
231
  await Promise.all(all.map(async (session) => {
128
232
  let timer;
@@ -140,11 +244,20 @@ export class SessionManager {
140
244
  }
141
245
  }));
142
246
  }
143
- /** Windows only: kill every live session's tree in one `taskkill` run. */
247
+ /**
248
+ * Windows only: kill, in one `taskkill` run, the tree of every session
249
+ * whose program has not been seen to end, including one whose session
250
+ * ended without it (`Session.programEnded`).
251
+ */
144
252
  async killTreesInOneRun(sessions) {
145
253
  if ((this.sessionDeps.platform ?? process.platform) !== 'win32')
146
254
  return;
147
- const pids = sessions.filter((session) => !session.exited).map((session) => session.pid);
255
+ // A pid of 0 is a program node-pty has not created yet (its deferred
256
+ // connection); such a session's own kill waits for the pid and then walks
257
+ // its tree, and a start whose connection failed has nothing to walk.
258
+ const pids = sessions
259
+ .filter((session) => !session.programEnded && session.pid > 0)
260
+ .map((session) => session.pid);
148
261
  if (pids.length === 0)
149
262
  return;
150
263
  const failure = await (this.sessionDeps.treeKiller ?? taskkillTrees)(pids);
@@ -1 +1 @@
1
- {"version":3,"file":"manager.js","sourceRoot":"","sources":["../../src/core/manager.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE5E,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEpE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAGzC,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF;AAED,MAAM,OAAO,cAAc;IACR,QAAQ,GAAG,IAAI,GAAG,EAAmB,CAAC;IACtC,MAAM,CAAS;IACf,WAAW,CAAc;IAClC,MAAM,CAAiB;IACvB,GAAG,GAAG,CAAC,CAAC;IAEhB,YAAY,MAAsB,EAAE,SAAiB,WAAW,EAAE,OAAoB,EAAE;QACtF,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,CAAC;IACzC,CAAC;IAED,0BAA0B;IAC1B,SAAS,CAAC,MAAsB;QAC9B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,OAAuB;QAC5B,MAAM,QAAQ,GAAG,eAAe,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;QACnF,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;YACtB,IAAI,CAAC,MAAM,CAAC,IAAI,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runs a dependency's install scripts only when the person installing
6
- * allows them. node-pty has prebuilt binaries for Windows and macOS but not for
7
- * Linux, where its install script builds one; without that script there is no
8
- * native module to load. On macOS the prebuilt `spawn-helper` ships without its
9
- * execute bit (microsoft/node-pty#850). npm 12 would block an install script
10
- * that restored it, and every spawn would then fail with "posix_spawnp failed".
6
+ * allows them. node-pty ships prebuilt binaries for Windows and macOS and,
7
+ * since 1.2.0-beta, for mainstream Linux; its install script builds one only
8
+ * where no prebuilt matches (another architecture, or musl in place of
9
+ * glibc). Its loader searches `build/Release`, `build/Debug` and then
10
+ * `prebuilds/<platform>-<arch>`, so an install whose script never ran still
11
+ * loads a prebuilt binary that is there. On macOS the prebuilt `spawn-helper`
12
+ * ships without its execute bit (microsoft/node-pty#850). npm 12 would block
13
+ * an install script that restored it, and every spawn would then fail with
14
+ * "posix_spawnp failed".
11
15
  *
12
16
  * So node-pty is loaded on the first start rather than when the daemon starts,
13
17
  * and the helper's execute bit is checked there. Either failure reaches the
@@ -3,11 +3,15 @@
3
3
  * terminal.
4
4
  *
5
5
  * npm 12 runs a dependency's install scripts only when the person installing
6
- * allows them. node-pty has prebuilt binaries for Windows and macOS but not for
7
- * Linux, where its install script builds one; without that script there is no
8
- * native module to load. On macOS the prebuilt `spawn-helper` ships without its
9
- * execute bit (microsoft/node-pty#850). npm 12 would block an install script
10
- * that restored it, and every spawn would then fail with "posix_spawnp failed".
6
+ * allows them. node-pty ships prebuilt binaries for Windows and macOS and,
7
+ * since 1.2.0-beta, for mainstream Linux; its install script builds one only
8
+ * where no prebuilt matches (another architecture, or musl in place of
9
+ * glibc). Its loader searches `build/Release`, `build/Debug` and then
10
+ * `prebuilds/<platform>-<arch>`, so an install whose script never ran still
11
+ * loads a prebuilt binary that is there. On macOS the prebuilt `spawn-helper`
12
+ * ships without its execute bit (microsoft/node-pty#850). npm 12 would block
13
+ * an install script that restored it, and every spawn would then fail with
14
+ * "posix_spawnp failed".
11
15
  *
12
16
  * So node-pty is loaded on the first start rather than when the daemon starts,
13
17
  * and the helper's execute bit is checked there. Either failure reaches the
@@ -76,7 +80,8 @@ export function explainLoadFailure(error) {
76
80
  return ("node-pty's native module is missing, or was built for another version of Node.js, " +
77
81
  'so ShellPuppet cannot open a terminal. ' +
78
82
  "npm 12 runs a dependency's install script only when you allow it; reinstall with " +
79
- `${REINSTALL} (on Linux that builds node-pty, which needs Python 3, make and a C++ compiler). (${detail})`);
83
+ `${REINSTALL} (on a machine node-pty ships no prebuilt binary for, that builds it, ` +
84
+ `which needs Python 3, make and a C++ compiler). (${detail})`);
80
85
  }
81
86
  return `node-pty could not be loaded, so ShellPuppet cannot open a terminal: ${detail}`;
82
87
  }
@@ -1 +1 @@
1
- {"version":3,"file":"nativePty.js","sourceRoot":"","sources":["../../src/core/nativePty.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAIlC,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/C;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,qDAAqD,CAAC;AAE/E,oFAAoF;AACpF,MAAM,OAAO,yBAA0B,SAAQ,KAAK;IAClD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAC;IAC1C,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,OAAsB,GAAG,EAAE,CAAC,OAAO,CAAC,UAAU,CAAY;IACtF,IAAI,MAA2B,CAAC;IAChC,OAAO,GAAG,EAAE;QACV,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,IAAI,CAAC;gBACH,MAAM,GAAG,IAAI,EAAE,CAAC;YAClB,C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