@hydranium/client-theia 1.0.0-next.22 → 1.0.0-next.220

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 (94) hide show
  1. package/README.md +49 -12
  2. package/lib/browser/browser-capture.js.map +1 -1
  3. package/lib/browser/channel-logger.d.ts +4 -3
  4. package/lib/browser/channel-logger.d.ts.map +1 -1
  5. package/lib/browser/channel-logger.js +10 -7
  6. package/lib/browser/channel-logger.js.map +1 -1
  7. package/lib/browser/connection-diagnostics-contribution.d.ts +69 -0
  8. package/lib/browser/connection-diagnostics-contribution.d.ts.map +1 -0
  9. package/lib/browser/connection-diagnostics-contribution.js +153 -0
  10. package/lib/browser/connection-diagnostics-contribution.js.map +1 -0
  11. package/lib/browser/connection-reporter.d.ts +57 -0
  12. package/lib/browser/connection-reporter.d.ts.map +1 -0
  13. package/lib/browser/connection-reporter.js +104 -0
  14. package/lib/browser/connection-reporter.js.map +1 -0
  15. package/lib/browser/editor-disk-sync.d.ts +142 -0
  16. package/lib/browser/editor-disk-sync.d.ts.map +1 -0
  17. package/lib/browser/editor-disk-sync.js +250 -0
  18. package/lib/browser/editor-disk-sync.js.map +1 -0
  19. package/lib/browser/hydranium-file-service.d.ts +44 -0
  20. package/lib/browser/hydranium-file-service.d.ts.map +1 -0
  21. package/lib/browser/hydranium-file-service.js +61 -0
  22. package/lib/browser/hydranium-file-service.js.map +1 -0
  23. package/lib/browser/index.d.ts +5 -0
  24. package/lib/browser/index.d.ts.map +1 -1
  25. package/lib/browser/index.js +5 -0
  26. package/lib/browser/index.js.map +1 -1
  27. package/lib/browser/log-level-preference.d.ts.map +1 -1
  28. package/lib/browser/log-level-preference.js +11 -0
  29. package/lib/browser/log-level-preference.js.map +1 -1
  30. package/lib/browser/memory-diagnostics-contribution.d.ts +40 -4
  31. package/lib/browser/memory-diagnostics-contribution.d.ts.map +1 -1
  32. package/lib/browser/memory-diagnostics-contribution.js +161 -31
  33. package/lib/browser/memory-diagnostics-contribution.js.map +1 -1
  34. package/lib/browser/session-aware-connection-source.d.ts +101 -0
  35. package/lib/browser/session-aware-connection-source.d.ts.map +1 -0
  36. package/lib/browser/session-aware-connection-source.js +184 -0
  37. package/lib/browser/session-aware-connection-source.js.map +1 -0
  38. package/lib/common/clock.d.ts +19 -0
  39. package/lib/common/clock.d.ts.map +1 -0
  40. package/lib/common/clock.js +13 -0
  41. package/lib/common/clock.js.map +1 -0
  42. package/lib/common/connection-resilience-options.d.ts +30 -0
  43. package/lib/common/connection-resilience-options.d.ts.map +1 -0
  44. package/lib/common/connection-resilience-options.js +11 -0
  45. package/lib/common/connection-resilience-options.js.map +1 -0
  46. package/lib/common/framed-socket-write-buffer.d.ts +173 -0
  47. package/lib/common/framed-socket-write-buffer.d.ts.map +1 -0
  48. package/lib/common/framed-socket-write-buffer.js +293 -0
  49. package/lib/common/framed-socket-write-buffer.js.map +1 -0
  50. package/lib/common/inbound-message-sequence.d.ts +56 -0
  51. package/lib/common/inbound-message-sequence.d.ts.map +1 -0
  52. package/lib/common/inbound-message-sequence.js +98 -0
  53. package/lib/common/inbound-message-sequence.js.map +1 -0
  54. package/lib/common/index.d.ts +13 -0
  55. package/lib/common/index.d.ts.map +1 -0
  56. package/lib/common/index.js +32 -0
  57. package/lib/common/index.js.map +1 -0
  58. package/lib/node/abstract-socket-forwarding-connection-handler.d.ts +12 -8
  59. package/lib/node/abstract-socket-forwarding-connection-handler.d.ts.map +1 -1
  60. package/lib/node/abstract-socket-forwarding-connection-handler.js +70 -13
  61. package/lib/node/abstract-socket-forwarding-connection-handler.js.map +1 -1
  62. package/lib/node/index.d.ts +2 -0
  63. package/lib/node/index.d.ts.map +1 -1
  64. package/lib/node/index.js +2 -0
  65. package/lib/node/index.js.map +1 -1
  66. package/lib/node/session-bound-frontend-connection-service.d.ts +118 -0
  67. package/lib/node/session-bound-frontend-connection-service.d.ts.map +1 -0
  68. package/lib/node/session-bound-frontend-connection-service.js +224 -0
  69. package/lib/node/session-bound-frontend-connection-service.js.map +1 -0
  70. package/lib/node/socket-channel-forwarder.d.ts +54 -0
  71. package/lib/node/socket-channel-forwarder.d.ts.map +1 -0
  72. package/lib/node/socket-channel-forwarder.js +95 -0
  73. package/lib/node/socket-channel-forwarder.js.map +1 -0
  74. package/lib/testing/stub-inversify-context.js.map +1 -1
  75. package/lib/testing/stub-output-channel.js.map +1 -1
  76. package/package.json +31 -32
  77. package/src/browser/channel-logger.ts +10 -7
  78. package/src/browser/connection-diagnostics-contribution.ts +142 -0
  79. package/src/browser/connection-reporter.ts +121 -0
  80. package/src/browser/editor-disk-sync.ts +253 -0
  81. package/src/browser/hydranium-file-service.ts +56 -0
  82. package/src/browser/index.ts +5 -0
  83. package/src/browser/log-level-preference.ts +11 -0
  84. package/src/browser/memory-diagnostics-contribution.ts +268 -45
  85. package/src/browser/session-aware-connection-source.ts +196 -0
  86. package/src/common/clock.ts +20 -0
  87. package/src/common/connection-resilience-options.ts +30 -0
  88. package/src/common/framed-socket-write-buffer.ts +345 -0
  89. package/src/common/inbound-message-sequence.ts +102 -0
  90. package/src/common/index.ts +16 -0
  91. package/src/node/abstract-socket-forwarding-connection-handler.ts +61 -15
  92. package/src/node/index.ts +2 -0
  93. package/src/node/session-bound-frontend-connection-service.ts +260 -0
  94. package/src/node/socket-channel-forwarder.ts +101 -0
@@ -43,6 +43,15 @@ export declare const MemoryDiagnosticsService: unique symbol;
43
43
  */
44
44
  export type HostMemoryDiagnosticsService = HostDiagnosticsProtocol;
45
45
  export declare const HostMemoryDiagnosticsService: unique symbol;
46
+ /**
47
+ * What a `report` call captured, as a code rather than a prose fragment. The
48
+ * sentences it appears in are authored once per code, because a fragment
49
+ * substituted into a sentence is itself translatable text and a translator
50
+ * given the sentence alone cannot inflect around a hole.
51
+ */
52
+ export type DiagnosticsSubject = 'server-state' | 'pod-memory' | 'latency' | 'backend-state' | 'profile';
53
+ /** Which process a heap snapshot is taken of; a code, for the reason {@link DiagnosticsSubject} is one. */
54
+ export type HeapSnapshotTarget = 'server' | 'backend';
46
55
  /**
47
56
  * Memory-diagnostics commands, one per layer reachable from the frontend. Full
48
57
  * multi-line snapshots are appended to the configured output channel; a one-line
@@ -77,14 +86,28 @@ export declare class MemoryDiagnosticsContribution implements CommandContributio
77
86
  */
78
87
  protected readonly stopProfilingLabel: string;
79
88
  registerCommands(registry: CommandRegistry): void;
80
- protected command(id: string, label: string, category: string): Command;
89
+ /**
90
+ * Takes an object rather than positional arguments so that `label` — the one
91
+ * user-facing member — is addressable by name. A lint rule guarding the
92
+ * localization of labels has only syntax to work with, and a selector for an
93
+ * argument position would equally catch `id`, which must stay a bare literal.
94
+ */
95
+ protected command(spec: {
96
+ id: string;
97
+ label: string;
98
+ category: string;
99
+ }): Command;
100
+ /** The record window as whole seconds, for the label and the toast that must agree on it. */
101
+ protected recordDurationSeconds(): number;
81
102
  /** Run a snapshot call, append the full result to the channel, toast the first matching summary line. */
82
- protected report(what: string, produce: () => Promise<string>, summaryKeys: string[]): Promise<void>;
83
- protected writeSnapshot(target: string, produce: (label: string) => Promise<string>): Promise<void>;
103
+ protected report(subject: DiagnosticsSubject, produce: () => Promise<string>, summaryKeys: string[]): Promise<void>;
104
+ protected writeSnapshot(target: HeapSnapshotTarget, produce: (label: string) => Promise<string>): Promise<void>;
84
105
  /** Begin an open-ended capture; the toast's stop action ends it and reports. */
85
106
  protected startProfiling(): Promise<void>;
86
107
  /** End the capture and report it. Shared, so the toast action and the command cannot diverge in behaviour. */
87
108
  protected stopProfiling(): Promise<void>;
109
+ /** One authored sentence for both start paths; identical literals in two places drift apart under translation. */
110
+ protected startProfilingFailedMessage(detail: string): string;
88
111
  /** Capture a fixed-length window: start, wait, stop, and report the result. */
89
112
  protected recordProfile(): Promise<void>;
90
113
  /** Isolated so tests can drive the record window without a real timer. */
@@ -92,7 +115,20 @@ export declare class MemoryDiagnosticsContribution implements CommandContributio
92
115
  protected dumpFrontendState(): Promise<void>;
93
116
  protected channel(): OutputChannel;
94
117
  /** Pull the first line starting with one of `keys` for a one-line toast; full text is in the channel. */
95
- protected summarize(snapshot: string, what: string, keys: string[]): string;
118
+ protected summarize(snapshot: string, subject: DiagnosticsSubject, keys: string[]): string;
119
+ /**
120
+ * The captured-with-detail toast. The detail is a machine-formatted figure,
121
+ * so it is safe as a substitution parameter; the subject is not, hence one
122
+ * authored sentence per subject.
123
+ */
124
+ protected capturedDetailMessage(subject: DiagnosticsSubject, detail: string): string;
125
+ /** The captured-without-detail toast; the channel name is adopter branding, not translatable text. */
126
+ protected capturedChannelMessage(subject: DiagnosticsSubject): string;
127
+ /** The failed-to-dump toast; the detail is a technical error string, safe as a parameter. */
128
+ protected dumpFailedMessage(subject: DiagnosticsSubject, detail: string): string;
129
+ protected writingSnapshotMessage(target: HeapSnapshotTarget): string;
130
+ protected wroteSnapshotMessage(target: HeapSnapshotTarget, filePath: string): string;
131
+ protected writeSnapshotFailedMessage(target: HeapSnapshotTarget, detail: string): string;
96
132
  protected errorMessage(error: unknown): string;
97
133
  }
98
134
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"memory-diagnostics-contribution.d.ts","sourceRoot":"","sources":["../../src/browser/memory-diagnostics-contribution.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAEJ,KAAK,6BAA6B,EAClC,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACzB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,KAAK,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AACtG,OAAO,EAAgC,KAAK,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC7F,OAAO,EAAE,oBAAoB,EAAE,KAAK,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAEpG;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACtC,kFAAkF;IAClF,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,gCAAgC;IAChC,QAAQ,CAAC,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E,MAAM,EAAE,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CASzF;IAED;;;;OAIG;IACH,SAAS,CAAC,qBAAqB,CAAC,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAanF;IAED,sGAAsG;IACtG,SAAS,CAAC,sBAAsB,CAAC,OAAO,EAAE,kBAAkB,GAAG,MAAM,CAkCpE;IAED,6FAA6F;IAC7F,SAAS,CAAC,iBAAiB,CAAC,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAa/E;IAED,SAAS,CAAC,sBAAsB,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM,CAanE;IAED,SAAS,CAAC,oBAAoB,CAAC,MAAM,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAOnF;IAED,SAAS,CAAC,0BAA0B,CAAC,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAevF;IAED,SAAS,CAAC,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAE7C;CACH;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,wBAAwB,GAAG,IAAI,CAIpG"}
@@ -59,71 +59,123 @@ let MemoryDiagnosticsContribution = class MemoryDiagnosticsContribution {
59
59
  * localized apart, leaving a button or an instruction that names a command
60
60
  * the user cannot find.
61
61
  */
62
- stopProfilingLabel = 'Stop Profiling (Server)';
62
+ stopProfilingLabel = core_1.nls.localize('hydranium/client-theia/command-stop-profiling-server', 'Stop Profiling (Server)');
63
63
  registerCommands(registry) {
64
64
  const { category } = this.options;
65
- registry.registerCommand(this.command('dumpServerState', 'Dump Server State', category), {
66
- execute: () => this.report('server state', () => this.diagnostics.dumpServerState({ label: new Date().toISOString() }), ['heap'])
65
+ registry.registerCommand(this.command({
66
+ id: 'dumpServerState',
67
+ label: core_1.nls.localize('hydranium/client-theia/command-dump-server-state', 'Dump Server State'),
68
+ category
69
+ }), {
70
+ execute: () => this.report('server-state', () => this.diagnostics.dumpServerState({ label: new Date().toISOString() }), ['heap'])
67
71
  });
68
- registry.registerCommand(this.command('dumpPodMemory', 'Dump Pod Memory', category), {
69
- execute: () => this.report('pod memory', () => this.diagnostics.dumpPodMemory(), ['current', 'rss sum'])
72
+ registry.registerCommand(this.command({
73
+ id: 'dumpPodMemory',
74
+ label: core_1.nls.localize('hydranium/client-theia/command-dump-pod-memory', 'Dump Pod Memory'),
75
+ category
76
+ }), {
77
+ execute: () => this.report('pod-memory', () => this.diagnostics.dumpPodMemory(), ['current', 'rss sum'])
70
78
  });
71
- registry.registerCommand(this.command('dumpFrontendState', 'Dump Frontend State', category), {
79
+ registry.registerCommand(this.command({
80
+ id: 'dumpFrontendState',
81
+ label: core_1.nls.localize('hydranium/client-theia/command-dump-frontend-state', 'Dump Frontend State'),
82
+ category
83
+ }), {
72
84
  execute: () => this.dumpFrontendState()
73
85
  });
74
- registry.registerCommand(this.command('writeHeapSnapshot', 'Write Heap Snapshot (Server)', category), {
86
+ registry.registerCommand(this.command({
87
+ id: 'writeHeapSnapshot',
88
+ label: core_1.nls.localize('hydranium/client-theia/command-write-heap-snapshot-server', 'Write Heap Snapshot (Server)'),
89
+ category
90
+ }), {
75
91
  execute: () => this.writeSnapshot('server', label => this.diagnostics.writeHeapSnapshot({ label }))
76
92
  });
77
93
  // Sampled profiling of the server process — sampling does NOT pause it (unlike
78
94
  // the heap snapshot). Start/Stop are the manual pair; Record wraps a fixed window.
79
- registry.registerCommand(this.command('startProfiling', 'Start Profiling (Server)', category), {
95
+ registry.registerCommand(this.command({
96
+ id: 'startProfiling',
97
+ label: core_1.nls.localize('hydranium/client-theia/command-start-profiling-server', 'Start Profiling (Server)'),
98
+ category
99
+ }), {
80
100
  execute: () => this.startProfiling()
81
101
  });
82
- registry.registerCommand(this.command('stopProfiling', this.stopProfilingLabel, category), {
102
+ registry.registerCommand(this.command({ id: 'stopProfiling', label: this.stopProfilingLabel, category }), {
83
103
  execute: () => this.stopProfiling()
84
104
  });
85
- registry.registerCommand(this.command('recordProfile', `Record Performance Profile (Server, ${Math.round(this.recordDurationMs / 1000)}s)`, category), {
105
+ registry.registerCommand(this.command({
106
+ id: 'recordProfile',
107
+ // The window length rides the substitution path rather than a
108
+ // template literal: an extractor reads the source text, so an
109
+ // interpolated default is never in the catalogue at all.
110
+ label: core_1.nls.localize('hydranium/client-theia/command-record-profile', 'Record Performance Profile (Server, {0}s)', this.recordDurationSeconds()),
111
+ category
112
+ }), {
86
113
  execute: () => this.recordProfile()
87
114
  });
88
- registry.registerCommand(this.command('dumpLatency', 'Dump RPC/LSP Latency (Server)', category), {
89
- execute: () => this.report('RPC/LSP latency', async () => (0, protocol_1.formatLatencyReport)(await this.diagnostics.getLatency()), ['window'])
115
+ registry.registerCommand(this.command({
116
+ id: 'dumpLatency',
117
+ label: core_1.nls.localize('hydranium/client-theia/command-dump-latency', 'Dump RPC/LSP Latency (Server)'),
118
+ category
119
+ }), {
120
+ execute: () => this.report('latency', async () => (0, protocol_1.formatLatencyReport)(await this.diagnostics.getLatency()), ['window'])
90
121
  });
91
122
  // Host (Theia backend) process commands — registered only when the
92
123
  // optional host-diagnostics service is bound (see HostMemoryDiagnosticsService).
93
124
  const hostDiagnostics = this.hostDiagnostics;
94
125
  if (hostDiagnostics) {
95
- registry.registerCommand(this.command('dumpBackendState', 'Dump Backend State', category), {
96
- execute: () => this.report('backend state', () => hostDiagnostics.dumpHostState({ label: new Date().toISOString() }), ['heap'])
126
+ registry.registerCommand(this.command({
127
+ id: 'dumpBackendState',
128
+ label: core_1.nls.localize('hydranium/client-theia/command-dump-backend-state', 'Dump Backend State'),
129
+ category
130
+ }), {
131
+ execute: () => this.report('backend-state', () => hostDiagnostics.dumpHostState({ label: new Date().toISOString() }), ['heap'])
97
132
  });
98
- registry.registerCommand(this.command('writeBackendHeapSnapshot', 'Write Heap Snapshot (Backend)', category), {
133
+ registry.registerCommand(this.command({
134
+ id: 'writeBackendHeapSnapshot',
135
+ label: core_1.nls.localize('hydranium/client-theia/command-write-heap-snapshot-backend', 'Write Heap Snapshot (Backend)'),
136
+ category
137
+ }), {
99
138
  execute: () => this.writeSnapshot('backend', label => hostDiagnostics.writeHostHeapSnapshot({ label }))
100
139
  });
101
140
  }
102
141
  }
103
- command(id, label, category) {
104
- return { id: `${this.options.commandIdPrefix}.${id}`, label, category };
142
+ /**
143
+ * Takes an object rather than positional arguments so that `label` — the one
144
+ * user-facing member — is addressable by name. A lint rule guarding the
145
+ * localization of labels has only syntax to work with, and a selector for an
146
+ * argument position would equally catch `id`, which must stay a bare literal.
147
+ */
148
+ command(spec) {
149
+ return { id: `${this.options.commandIdPrefix}.${spec.id}`, label: spec.label, category: spec.category };
150
+ }
151
+ /** The record window as whole seconds, for the label and the toast that must agree on it. */
152
+ recordDurationSeconds() {
153
+ return Math.round(this.recordDurationMs / 1000);
105
154
  }
106
155
  /** Run a snapshot call, append the full result to the channel, toast the first matching summary line. */
107
- async report(what, produce, summaryKeys) {
156
+ async report(subject, produce, summaryKeys) {
108
157
  try {
109
158
  const snapshot = await produce();
110
159
  this.channel().appendLine(snapshot);
111
160
  this.channel().appendLine('');
112
- this.messageService.info(this.summarize(snapshot, what, summaryKeys), { timeout: 5000 });
161
+ this.messageService.info(this.summarize(snapshot, subject, summaryKeys), { timeout: 5000 });
113
162
  }
114
163
  catch (error) {
115
- this.messageService.error(`Failed to dump ${what}: ${this.errorMessage(error)}`);
164
+ this.messageService.error(this.dumpFailedMessage(subject, this.errorMessage(error)));
116
165
  }
117
166
  }
118
167
  async writeSnapshot(target, produce) {
119
168
  try {
120
- this.messageService.info(`Writing ${target} heap snapshot — this briefly pauses that process...`, { timeout: 3000 });
169
+ this.messageService.info(this.writingSnapshotMessage(target), { timeout: 3000 });
121
170
  const filePath = await produce(new Date().toISOString());
122
- this.channel().appendLine(`Heap snapshot (${target}) written to ${filePath}`);
123
- this.messageService.info(`Heap snapshot (${target}) written to ${filePath}`, { timeout: 8000 });
171
+ // One sentence, shown in both places: two literals of equal value can be
172
+ // localized apart, leaving the channel and the toast naming different files.
173
+ const written = this.wroteSnapshotMessage(target, filePath);
174
+ this.channel().appendLine(written);
175
+ this.messageService.info(written, { timeout: 8000 });
124
176
  }
125
177
  catch (error) {
126
- this.messageService.error(`Failed to write ${target} heap snapshot: ${this.errorMessage(error)}`);
178
+ this.messageService.error(this.writeSnapshotFailedMessage(target, this.errorMessage(error)));
127
179
  }
128
180
  }
129
181
  /** Begin an open-ended capture; the toast's stop action ends it and reports. */
@@ -132,14 +184,14 @@ let MemoryDiagnosticsContribution = class MemoryDiagnosticsContribution {
132
184
  await this.diagnostics.startProfiling(this.profileDimensions);
133
185
  }
134
186
  catch (error) {
135
- this.messageService.error(`Failed to start profiling: ${this.errorMessage(error)}`);
187
+ this.messageService.error(this.startProfilingFailedMessage(this.errorMessage(error)));
136
188
  return;
137
189
  }
138
190
  // No timeout: the capture runs as long as the user wants it to, and an
139
191
  // auto-dismissing toast takes the stop affordance with it. Awaiting the
140
192
  // toast is what keeps the action live, so this resolves only once the
141
193
  // user acts on it or dismisses it.
142
- const chosen = await this.messageService.info('Server profiling started — sampling does not stop the process.', { timeout: 0 }, this.stopProfilingLabel);
194
+ const chosen = await this.messageService.info(core_1.nls.localize('hydranium/client-theia/profiling-started', 'Server profiling started — sampling does not stop the process.'), { timeout: 0 }, this.stopProfilingLabel);
143
195
  if (chosen === this.stopProfilingLabel) {
144
196
  await this.stopProfiling();
145
197
  }
@@ -148,16 +200,20 @@ let MemoryDiagnosticsContribution = class MemoryDiagnosticsContribution {
148
200
  stopProfiling() {
149
201
  return this.report('profile', () => this.diagnostics.stopProfiling({ label: new Date().toISOString() }), ['duration']);
150
202
  }
203
+ /** One authored sentence for both start paths; identical literals in two places drift apart under translation. */
204
+ startProfilingFailedMessage(detail) {
205
+ return core_1.nls.localize('hydranium/client-theia/error-start-profiling', 'Failed to start profiling: {0}', detail);
206
+ }
151
207
  /** Capture a fixed-length window: start, wait, stop, and report the result. */
152
208
  async recordProfile() {
153
209
  try {
154
210
  await this.diagnostics.startProfiling(this.profileDimensions);
155
211
  }
156
212
  catch (error) {
157
- this.messageService.error(`Failed to start profiling: ${this.errorMessage(error)}`);
213
+ this.messageService.error(this.startProfilingFailedMessage(this.errorMessage(error)));
158
214
  return;
159
215
  }
160
- this.messageService.info(`Recording a ${Math.round(this.recordDurationMs / 1000)}s server performance profile...`, { timeout: 4000 });
216
+ this.messageService.info(core_1.nls.localize('hydranium/client-theia/recording-profile', 'Recording a {0}s server performance profile...', this.recordDurationSeconds()), { timeout: 4000 });
161
217
  await this.delay(this.recordDurationMs);
162
218
  await this.stopProfiling();
163
219
  }
@@ -176,15 +232,89 @@ let MemoryDiagnosticsContribution = class MemoryDiagnosticsContribution {
176
232
  return channel;
177
233
  }
178
234
  /** Pull the first line starting with one of `keys` for a one-line toast; full text is in the channel. */
179
- summarize(snapshot, what, keys) {
235
+ summarize(snapshot, subject, keys) {
180
236
  const lines = snapshot.split('\n');
181
237
  for (const key of keys) {
182
238
  const line = lines.find(entry => entry.trim().startsWith(key));
183
239
  if (line) {
184
- return `Captured ${what} —${line.replace(new RegExp(`^\\s*${key}\\s*`), ` ${key} `)}`;
240
+ return this.capturedDetailMessage(subject, line.replace(new RegExp(`^\\s*${key}\\s*`), ` ${key} `));
185
241
  }
186
242
  }
187
- return `Captured ${what} (see the ${this.options.channelName} output channel)`;
243
+ return this.capturedChannelMessage(subject);
244
+ }
245
+ /**
246
+ * The captured-with-detail toast. The detail is a machine-formatted figure,
247
+ * so it is safe as a substitution parameter; the subject is not, hence one
248
+ * authored sentence per subject.
249
+ */
250
+ capturedDetailMessage(subject, detail) {
251
+ switch (subject) {
252
+ case 'server-state':
253
+ return core_1.nls.localize('hydranium/client-theia/captured-server-state-detail', 'Captured server state —{0}', detail);
254
+ case 'pod-memory':
255
+ return core_1.nls.localize('hydranium/client-theia/captured-pod-memory-detail', 'Captured pod memory —{0}', detail);
256
+ case 'latency':
257
+ return core_1.nls.localize('hydranium/client-theia/captured-latency-detail', 'Captured RPC/LSP latency —{0}', detail);
258
+ case 'backend-state':
259
+ return core_1.nls.localize('hydranium/client-theia/captured-backend-state-detail', 'Captured backend state —{0}', detail);
260
+ case 'profile':
261
+ return core_1.nls.localize('hydranium/client-theia/captured-profile-detail', 'Captured profile —{0}', detail);
262
+ }
263
+ }
264
+ /** The captured-without-detail toast; the channel name is adopter branding, not translatable text. */
265
+ capturedChannelMessage(subject) {
266
+ const channelName = this.options.channelName;
267
+ switch (subject) {
268
+ case 'server-state':
269
+ return core_1.nls.localize('hydranium/client-theia/captured-server-state-channel', 'Captured server state (see the {0} output channel)', channelName);
270
+ case 'pod-memory':
271
+ return core_1.nls.localize('hydranium/client-theia/captured-pod-memory-channel', 'Captured pod memory (see the {0} output channel)', channelName);
272
+ case 'latency':
273
+ return core_1.nls.localize('hydranium/client-theia/captured-latency-channel', 'Captured RPC/LSP latency (see the {0} output channel)', channelName);
274
+ case 'backend-state':
275
+ return core_1.nls.localize('hydranium/client-theia/captured-backend-state-channel', 'Captured backend state (see the {0} output channel)', channelName);
276
+ case 'profile':
277
+ return core_1.nls.localize('hydranium/client-theia/captured-profile-channel', 'Captured profile (see the {0} output channel)', channelName);
278
+ }
279
+ }
280
+ /** The failed-to-dump toast; the detail is a technical error string, safe as a parameter. */
281
+ dumpFailedMessage(subject, detail) {
282
+ switch (subject) {
283
+ case 'server-state':
284
+ return core_1.nls.localize('hydranium/client-theia/error-dump-server-state', 'Failed to dump server state: {0}', detail);
285
+ case 'pod-memory':
286
+ return core_1.nls.localize('hydranium/client-theia/error-dump-pod-memory', 'Failed to dump pod memory: {0}', detail);
287
+ case 'latency':
288
+ return core_1.nls.localize('hydranium/client-theia/error-dump-latency', 'Failed to dump RPC/LSP latency: {0}', detail);
289
+ case 'backend-state':
290
+ return core_1.nls.localize('hydranium/client-theia/error-dump-backend-state', 'Failed to dump backend state: {0}', detail);
291
+ case 'profile':
292
+ return core_1.nls.localize('hydranium/client-theia/error-dump-profile', 'Failed to dump profile: {0}', detail);
293
+ }
294
+ }
295
+ writingSnapshotMessage(target) {
296
+ switch (target) {
297
+ case 'server':
298
+ return core_1.nls.localize('hydranium/client-theia/writing-heap-snapshot-server', 'Writing server heap snapshot — this briefly pauses that process...');
299
+ case 'backend':
300
+ return core_1.nls.localize('hydranium/client-theia/writing-heap-snapshot-backend', 'Writing backend heap snapshot — this briefly pauses that process...');
301
+ }
302
+ }
303
+ wroteSnapshotMessage(target, filePath) {
304
+ switch (target) {
305
+ case 'server':
306
+ return core_1.nls.localize('hydranium/client-theia/wrote-heap-snapshot-server', 'Heap snapshot (server) written to {0}', filePath);
307
+ case 'backend':
308
+ return core_1.nls.localize('hydranium/client-theia/wrote-heap-snapshot-backend', 'Heap snapshot (backend) written to {0}', filePath);
309
+ }
310
+ }
311
+ writeSnapshotFailedMessage(target, detail) {
312
+ switch (target) {
313
+ case 'server':
314
+ return core_1.nls.localize('hydranium/client-theia/error-write-heap-snapshot-server', 'Failed to write server heap snapshot: {0}', detail);
315
+ case 'backend':
316
+ return core_1.nls.localize('hydranium/client-theia/error-write-heap-snapshot-backend', 'Failed to write backend heap snapshot: {0}', detail);
317
+ }
188
318
  }
189
319
  errorMessage(error) {
190
320
  return error instanceof Error ? error.message : String(error);
@@ -1 +1 @@
1
- {"version":3,"file":"memory-diagnostics-contribution.js","sourceRoot":"","sources":["../../src/browser/memory-diagnostics-contribution.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;AA4OlF,sDAIC;AA9OD,kDAK6B;AAC7B,uDAAgF;AAChF,sCAAsG;AACtG,4DAA6F;AAC7F,6EAAoG;AAevF,QAAA,wBAAwB,GAAG,MAAM,CAAC,0BAA0B,CAAC,CAAC;AAU9D,QAAA,wBAAwB,GAAG,MAAM,CAAC,0BAA0B,CAAC,C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,CAAC,QAAQ,GAAG,MAAM,CAAC,EAAE,IAAI,GAAG,GAAG,CAAC,EAAE,CAAC;YACzF,CAAC;QACJ,CAAC;QACD,OAAO,YAAY,IAAI,aAAa,IAAI,CAAC,OAAO,CAAC,WAAW,kBAAkB,CAAC;IAClF,CAAC;IAES,YAAY,CAAC,KAAc;QAClC,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACjE,CAAC;CACH,CAAA;AAlKY,sEAA6B;AACc;IAApD,IAAA,kBAAM,EAAC,gCAAwB,CAAC;;kEAA0D;AACtC;IAApD,IAAA,kBAAM,EAAC,gCAAwB,CAAC;;8DAAsD;AAC5C;IAA1C,IAAA,kBAAM,EAAC,qBAAc,CAAC;8BAAoC,qBAAc;qEAAC;AACzB;IAAhD,IAAA,kBAAM,EAAC,qCAAoB,CAAC;8BAA8B,qCAAoB;+DAAC;AACX;IAApE,IAAA,kBAAM,EAAC,oCAA4B,CAAC;IAAE,IAAA,oBAAQ,GAAE;;sEAAmE;wCAL1G,6BAA6B;IADzC,IAAA,sBAAU,GAAE;GACA,6BAA6B,CAkKzC;AAED;;;;;GAKG;AACH,SAAgB,qBAAqB,CAAC,IAAqB,EAAE,OAAiC;IAC3F,IAAI,CAAC,gCAAwB,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACxD,IAAI,CAAC,6BAA6B,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAChE,IAAI,CAAC,0BAAmB,CAAC,CAAC,SAAS,CAAC,6BAA6B,CAAC,CAAC;AACtE,CAAC"}
1
+ {"version":3,"file":"memory-diagnostics-contribution.js","sourceRoot":"","sources":["../../src/browser/memory-diagnostics-contribution.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;AAElF,kDAK6B;AAC7B,uDAAgF;AAChF,sCAA2G;AAC3G,4D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;GACA,6BAA6B,CAsXzC;AAED;;;;;GAKG;AACH,+BAAsC,IAAqB,EAAE,OAAiC;IAC3F,IAAI,CAAC,QAAA,wBAAwB,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACxD,IAAI,CAAC,6BAA6B,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAChE,IAAI,CAAC,0BAAmB,CAAC,CAAC,SAAS,CAAC,6BAA6B,CAAC,CAAC;AACtE,CAAC"}
@@ -0,0 +1,101 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2026 CrossBreeze, EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the MIT License which is available in the project root.
6
+ *
7
+ * SPDX-License-Identifier: MIT
8
+ ********************************************************************************/
9
+ import { WebSocketConnectionSource } from '@theia/core/lib/browser/messaging/ws-connection-source';
10
+ import { type Event } from '@theia/core/lib/common/event';
11
+ import { type AbstractChannel } from '@theia/core/lib/common/message-rpc/channel';
12
+ import { type interfaces } from '@theia/core/shared/inversify';
13
+ import { type ConnectionResilienceOptions } from '../common/connection-resilience-options';
14
+ import { type ConnectionBufferOverflow, FramedSocketWriteBuffer } from '../common/framed-socket-write-buffer';
15
+ /**
16
+ * Sends a message only once the server has confirmed the session, and only
17
+ * behind anything already queued.
18
+ *
19
+ * Theia sends straight away when `socket.connected` is true and buffers
20
+ * otherwise. The gap is that reconnecting sets that flag immediately, while the
21
+ * session is only confirmed a round trip later. A message produced in that
22
+ * window either jumps ahead of older messages still waiting in the buffer, or,
23
+ * if nothing was waiting, goes out on a socket whose channel the server has not
24
+ * attached yet and is discarded by a peer with no listener for it.
25
+ *
26
+ * Losing one or reordering them is equally unrecoverable for anything that
27
+ * applies messages by position. Theia's plugin host keeps a line-indexed copy of
28
+ * every open document, so a single late or missing edit leaves that copy wrong
29
+ * for good, and the next edit past its end fails.
30
+ *
31
+ * The server side needs no equivalent: it adopts its socket and flushes in one
32
+ * synchronous step, so it has no window of this kind.
33
+ */
34
+ export declare class SessionAwareConnectionSource extends WebSocketConnectionSource {
35
+ /**
36
+ * Whether the server has confirmed, on the socket in use right now, that it
37
+ * still holds this frontend's session. A connected socket is not enough:
38
+ * until the handshake is answered the server has not attached its channel to
39
+ * this socket, and a message sent meanwhile reaches a peer with no listener
40
+ * for it and is discarded without a trace.
41
+ */
42
+ protected sessionResumed: boolean;
43
+ protected sessionListenersAttached: boolean;
44
+ /**
45
+ * Every connect starts a socket the server has not confirmed yet, including
46
+ * the reconnects socket.io performs on its own. Resetting here rather than on
47
+ * disconnect also covers a connect that follows no clean disconnect event.
48
+ */
49
+ protected handleSocketConnected(): void;
50
+ /**
51
+ * Watches the connection handshake for its outcome.
52
+ *
53
+ * Attached once, to the socket socket.io reuses across reconnects, and before
54
+ * the base class adds its own per-negotiation listeners — so this has already
55
+ * recorded the outcome by the time the base class reacts to it by flushing.
56
+ */
57
+ protected trackSessionState(): void;
58
+ /** Whether a message may go out now, as opposed to waiting in the buffer. */
59
+ protected get canSend(): boolean;
60
+ /**
61
+ * Copied from Theia apart from the duplicate check on receipt and the `onCommit` body, because
62
+ * the base builds both callbacks inline and exposes no narrower seam. Re-diff when the supported
63
+ * range moves.
64
+ *
65
+ * Called once per session, so the receive-side state starts afresh with the server's numbering.
66
+ */
67
+ protected createChannel(): AbstractChannel;
68
+ /** Fires when the buffer runs out of room, so an adopter can say so rather than just stopping. */
69
+ get onBufferOverflow(): Event<ConnectionBufferOverflow>;
70
+ /**
71
+ * The write buffer Theia injected into the base class.
72
+ *
73
+ * Reached through a structural view rather than as `this.writeBuffer`,
74
+ * because that member is `private` in Theia 1.70 and only became `protected`
75
+ * in 1.71 — and this package compiles against the whole range. The view
76
+ * asserts nothing the versions disagree about: the field is there in both,
77
+ * holding whatever `SocketWriteBuffer` is bound, and the check below is what
78
+ * establishes it is ours.
79
+ */
80
+ protected get framedBuffer(): FramedSocketWriteBuffer;
81
+ }
82
+ /**
83
+ * Replaces the frontend pieces that decide how outgoing messages survive a
84
+ * reconnect. Every one of them rebinds something Theia's
85
+ * `messagingFrontendModule` already bound, so this belongs in a module loaded
86
+ * into the same container.
87
+ *
88
+ * It must be a `frontendPreload` module rather than a normal frontend module:
89
+ * Theia's preloader resolves `WebSocketConnectionSource` (and with it the write
90
+ * buffer) while loading i18n and OS settings, which happens before any frontend
91
+ * module is loaded. A rebind there would come too late — the instances would
92
+ * already exist. All `frontendPreload` modules, by contrast, are loaded before
93
+ * the preloader constructs anything.
94
+ *
95
+ * Does nothing but warn on a Theia too old to expose the buffer binding, so the
96
+ * package keeps one supported range rather than splitting its floor for this
97
+ * feature. Returns whether the hardening was installed, for an adopter that
98
+ * wants to branch on it.
99
+ */
100
+ export declare function bindConnectionResilience(isBound: interfaces.IsBound, rebind: interfaces.Rebind, options?: ConnectionResilienceOptions): boolean;
101
+ //# sourceMappingURL=session-aware-connection-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-aware-connection-source.d.ts","sourceRoot":"","sources":["../../src/browser/session-aware-connection-source.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,yBAAyB,EAAE,MAAM,wDAAwD,CAAC;AAEnG,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,KAAK,eAAe,EAAqB,MAAM,4CAA4C,CAAC;AAGrG,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE3E,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AAC3F,OAAO,EACJ,KAAK,wBAAwB,EAE7B,uBAAuB,EAGzB,MAAM,sCAAsC,CAAC;AAG9C;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBACa,4BAA6B,SAAQ,yBAAyB;IACxE;;;;;;OAMG;IACH,SAAS,CAAC,cAAc,UAAS;IACjC,SAAS,CAAC,wBAAwB,UAAS;IAE3C;;;;OAIG;IACH,UAAmB,qBAAqB,IAAI,IAAI,CAI/C;IAED;;;;;;OAMG;IACH,SAAS,CAAC,iBAAiB,IAAI,IAAI,CAgBlC;IAED,6EAA6E;IAC7E,SAAS,KAAK,OAAO,IAAI,OAAO,CAE/B;IAED;;;;;;OAMG;IACH,UAAmB,aAAa,IAAI,eAAe,CAgClD;IAED,kGAAkG;IAClG,IAAI,gBAAgB,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAEtD;IAED;;;;;;;;;OASG;IACH,SAAS,KAAK,YAAY,IAAI,uBAAuB,CAMpD;CACH;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,wBAAwB,CACrC,OAAO,EAAE,UAAU,CAAC,OAAO,EAC3B,MAAM,EAAE,UAAU,CAAC,MAAM,EACzB,OAAO,GAAE,2BAAgC,GACzC,OAAO,CAST"}