@tracecode/harness 0.16.1 → 0.16.3

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 (45) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/{browser-runtime-provider-NQNCL6HE.js → browser-runtime-provider-C53ZJH3D.js} +4 -4
  3. package/dist/{chunk-MMQLUTPP.js → chunk-53ROKKGU.js} +2 -2
  4. package/dist/{chunk-KYTMGAFA.js → chunk-6SWX35P2.js} +2 -2
  5. package/dist/{chunk-4W6MUXZE.js → chunk-BXUGUGWL.js} +9 -9
  6. package/dist/{chunk-AWHLLSEH.js → chunk-DI7WIHES.js} +3 -3
  7. package/dist/chunk-EJE2EJDI.js +193 -0
  8. package/dist/{chunk-DQMPICNS.js → chunk-TXDHVV6B.js} +193 -345
  9. package/dist/{chunk-57WKRSIB.js → chunk-YID2AAYD.js} +2 -2
  10. package/dist/cli.cjs +5 -0
  11. package/dist/cli.js +5 -0
  12. package/dist/core.cjs +8 -8
  13. package/dist/core.d.cts +2 -2
  14. package/dist/core.d.ts +2 -2
  15. package/dist/core.js +1 -1
  16. package/dist/{cpp-worker-client-A2ULEW5T.js → cpp-worker-client-FLJ2YLSW.js} +3 -3
  17. package/dist/{csharp-worker-client-RA47P77F.js → csharp-worker-client-S4U6MCVF.js} +3 -3
  18. package/dist/internal/tracekernel-workspace.cjs +171 -31
  19. package/dist/internal/tracekernel-workspace.d.cts +8 -2
  20. package/dist/internal/tracekernel-workspace.d.ts +8 -2
  21. package/dist/internal/tracekernel-workspace.js +164 -24
  22. package/dist/{java-project-BTAANBJH.js → java-project-GK6MHT3I.js} +2 -2
  23. package/dist/{java-project-client-R7CKC72F.js → java-project-client-PEQKFTH6.js} +11 -2
  24. package/dist/judge.cjs +420 -214
  25. package/dist/judge.d.cts +1 -1
  26. package/dist/judge.d.ts +1 -1
  27. package/dist/judge.js +9 -7
  28. package/dist/{project-browser-GBSPIYEW.js → project-browser-3I5FVB5N.js} +2 -2
  29. package/dist/{project-browser-U3YK43H4.js → project-browser-ADXGG5RZ.js} +2 -2
  30. package/dist/{project-browser-J6LVPVDC.js → project-browser-B5T7WJWP.js} +2 -2
  31. package/dist/{project-browser-QMZCUVJA.js → project-browser-JXJ74RDZ.js} +2 -2
  32. package/dist/{project-browser-PC7TRROQ.js → project-browser-TDL4LMJJ.js} +2 -2
  33. package/dist/{python-worker-client-NEBS6V63.js → python-worker-client-2RF6IYIN.js} +3 -3
  34. package/dist/{runtime-environment-D7mZm8SA.d.cts → runtime-environment-BO5I1fAC.d.cts} +5 -0
  35. package/dist/{runtime-environment-Q60S0pUa.d.ts → runtime-environment-Dfg6ZoCj.d.ts} +5 -0
  36. package/dist/{runtime-open-source-info-BQtIRJ9F.d.cts → runtime-open-source-info-CaBpNicy.d.cts} +4 -2
  37. package/dist/{runtime-open-source-info-FkIxlAcm.d.ts → runtime-open-source-info-D0OJc4zH.d.ts} +4 -2
  38. package/dist/tracecc-runtime-assets-G3BFH7LY.js +19 -0
  39. package/dist/tracekernel.cjs +585 -235
  40. package/dist/tracekernel.d.cts +14 -5
  41. package/dist/tracekernel.d.ts +14 -5
  42. package/dist/tracekernel.js +175 -31
  43. package/package.json +44 -32
  44. package/runtime-assets.lock.json +7 -7
  45. package/workers/javascript/javascript-project-worker.js +7 -7
@@ -162,7 +162,7 @@ import {
162
162
  withRuntimeProjectCommandRunnerCapabilities,
163
163
  withRuntimeTraceOptions,
164
164
  writeRuntimeCommandStdinPipeBytes
165
- } from "../chunk-4W6MUXZE.js";
165
+ } from "../chunk-BXUGUGWL.js";
166
166
  import {
167
167
  TraceKernelChildProcessError,
168
168
  TraceKernelControlledRuntime,
@@ -61060,20 +61060,27 @@ var RuntimeProjectWorkspaceTerminalSession = class {
61060
61060
  signalCharacter === "" ? "SIGINT" : "SIGQUIT"
61061
61061
  );
61062
61062
  }
61063
- const route = this.options.terminalInputRouter?.write(data) ?? (this.activeStdinPipe !== null ? "legacy" : "rejected");
61063
+ const routed = this.options.terminalInputRouter?.write(data);
61064
+ const route = routed === "rejected" && this.activeStdinPipe !== null ? "legacy" : routed ?? (this.activeStdinPipe !== null ? "legacy" : "rejected");
61064
61065
  if (route === "legacy") {
61065
- this.activeStdinPipe?.write(data);
61066
+ if (!this.activeStdinPipe) return false;
61067
+ try {
61068
+ this.activeStdinPipe.write(data);
61069
+ } catch {
61070
+ return false;
61071
+ }
61066
61072
  }
61067
61073
  const accepted = route !== "rejected";
61068
61074
  if (accepted && this.currentInputState.mode === "stdin") {
61069
61075
  this.activeStdinPrompt = "";
61070
- this.setInputState("busy", "stdin-submit");
61076
+ this.setInputState("stdin", "stdin-submit", "");
61071
61077
  }
61072
61078
  return accepted;
61073
61079
  }
61074
61080
  endStdin() {
61075
61081
  if (!this.activeRun || this.activeStdinEnded) return false;
61076
- const route = this.options.terminalInputRouter?.end() ?? (this.activeStdinPipe !== null ? "legacy" : "rejected");
61082
+ const routed = this.options.terminalInputRouter?.end();
61083
+ const route = routed === "rejected" && this.activeStdinPipe !== null ? "legacy" : routed ?? (this.activeStdinPipe !== null ? "legacy" : "rejected");
61077
61084
  if (route === "rejected") return false;
61078
61085
  this.activeStdinEnded = true;
61079
61086
  if (route === "legacy") {
@@ -61112,6 +61119,14 @@ var RuntimeProjectWorkspaceTerminalSession = class {
61112
61119
  this.emitTerminalEvent(reason);
61113
61120
  return this.currentInputState;
61114
61121
  }
61122
+ showForegroundInputLine() {
61123
+ const acceptsInput = this.activeStdinPipe !== null || this.options.terminalInputRouter !== void 0;
61124
+ return this.setInputState(
61125
+ acceptsInput ? "stdin" : "busy",
61126
+ "command-start",
61127
+ acceptsInput ? "" : this.prompt.text
61128
+ );
61129
+ }
61115
61130
  async run(command, options = {}) {
61116
61131
  const trimmed = command.trim();
61117
61132
  if (!trimmed) return { stdout: "", stderr: "", exitCode: 0 };
@@ -61166,7 +61181,7 @@ var RuntimeProjectWorkspaceTerminalSession = class {
61166
61181
  this.activeTerminalEventHandler = options.onTerminalEvent;
61167
61182
  this.activeStdinPrompt = "";
61168
61183
  this.activeCommand = submittedCommand;
61169
- this.setInputState("busy", "command-start");
61184
+ this.showForegroundInputLine();
61170
61185
  try {
61171
61186
  let stdout = "";
61172
61187
  let stderr = "";
@@ -61195,6 +61210,7 @@ var RuntimeProjectWorkspaceTerminalSession = class {
61195
61210
  ...error ? { error } : {}
61196
61211
  };
61197
61212
  } finally {
61213
+ this.options.terminalInputRouter?.reset();
61198
61214
  ownedStdinPipe?.close();
61199
61215
  this.activeStdinPipe = previousStdinPipe;
61200
61216
  this.activeStdinEnded = previousStdinEnded;
@@ -61233,7 +61249,7 @@ var RuntimeProjectWorkspaceTerminalSession = class {
61233
61249
  this.activeStdinPrompt = "";
61234
61250
  this.activeCommand = trimmed;
61235
61251
  this.activeCommandAbortController = commandAbortController;
61236
- this.setInputState("busy", "command-start");
61252
+ this.showForegroundInputLine();
61237
61253
  try {
61238
61254
  const result = await this.runForegroundTerminalCommand(
61239
61255
  trimmed,
@@ -61244,6 +61260,7 @@ var RuntimeProjectWorkspaceTerminalSession = class {
61244
61260
  return result;
61245
61261
  } finally {
61246
61262
  options.signal?.removeEventListener("abort", forwardExternalAbort);
61263
+ this.options.terminalInputRouter?.reset();
61247
61264
  ownedStdinPipe?.close();
61248
61265
  this.activeStdinPipe = previousStdinPipe;
61249
61266
  this.activeStdinEnded = previousStdinEnded;
@@ -66917,21 +66934,26 @@ function createWorkspaceRuntimeRunnerBridge(bridge) {
66917
66934
  ...requestWithoutLegacyStdin
66918
66935
  } = request;
66919
66936
  const activeStdinPipe = request.source !== "compile" && request.source !== "stdin" ? commandContext?.stdinPipe : void 0;
66937
+ const consumesLiveStdin = request.source !== "compile" && request.source !== "stdin";
66920
66938
  const stdinPipe = request.stdinPipe ?? activeStdinPipe;
66921
- const processBinding = commandContext ? bridge.bindProcess(commandContext, descriptorStdio) : {};
66939
+ const processBinding = commandContext ? bridge.bindProcess(
66940
+ commandContext,
66941
+ descriptorStdio,
66942
+ consumesLiveStdin
66943
+ ) : {};
66922
66944
  const signal = processBinding.signal ?? request.signal;
66923
66945
  const runtimeIo = commandContext?.runtimeIo;
66924
66946
  let acceptingRunnerEvents = true;
66925
66947
  let result;
66926
66948
  const kernelSyscalls = options.kernelSyscalls ? bridge.createKernelSyscallBridge(commandContext) : void 0;
66927
- if (descriptorStdio && commandContext) {
66949
+ if (descriptorStdio && commandContext && consumesLiveStdin) {
66928
66950
  bridge.startHostStandardInputPump(commandContext);
66929
66951
  }
66930
66952
  try {
66931
- result = await runner({
66932
- ...descriptorStdio ? requestWithoutLegacyStdin : request,
66953
+ const execution = runner({
66954
+ ...descriptorStdio || !consumesLiveStdin ? requestWithoutLegacyStdin : request,
66933
66955
  ...processBinding.process ? { process: processBinding.process } : {},
66934
- ...stdinPipe && !descriptorStdio ? { stdinPipe: { buffer: stdinPipe.buffer } } : {},
66956
+ ...stdinPipe && !descriptorStdio && consumesLiveStdin ? { stdinPipe: { buffer: stdinPipe.buffer } } : {},
66935
66957
  ...commandContext?.terminal ? { terminal: commandContext.terminal } : {},
66936
66958
  ...commandContext?.engineLease ? { engineLease: commandContext.engineLease } : {},
66937
66959
  ...signal ? { signal } : {},
@@ -66943,6 +66965,8 @@ function createWorkspaceRuntimeRunnerBridge(bridge) {
66943
66965
  bridge.handleRuntimeCommandEvent(event, commandContext);
66944
66966
  }
66945
66967
  });
66968
+ await processBinding.replayStartupInput?.();
66969
+ result = await execution;
66946
66970
  } finally {
66947
66971
  acceptingRunnerEvents = false;
66948
66972
  kernelSyscalls?.close();
@@ -67830,6 +67854,7 @@ function createRuntimeWorkspaceShellCommands(options) {
67830
67854
  var PRINCIPAL_ACTOR2 = runtimeWorkspaceActorPreset("principal");
67831
67855
  var RUNTIME_ACTOR = runtimeWorkspaceActorPreset("runtime");
67832
67856
  var SYSTEM_ACTOR2 = runtimeWorkspaceActorPreset("system");
67857
+ var TERMINAL_STARTUP_INPUT_MAX_BYTES = 64 * 1024 - 1;
67833
67858
  var TRACEKERNEL_SYSCALL_ERROR_CODES = /* @__PURE__ */ new Set([
67834
67859
  "E2BIG",
67835
67860
  "EAGAIN",
@@ -67963,6 +67988,7 @@ var RuntimeProjectWorkspace = class {
67963
67988
  processState = new WorkspaceProcessState();
67964
67989
  terminalShells = /* @__PURE__ */ new Map();
67965
67990
  terminalResourceIds = /* @__PURE__ */ new Map();
67991
+ pendingTerminalStartupInput = /* @__PURE__ */ new Map();
67966
67992
  processProjection;
67967
67993
  // Temporary 0.13 introspection aliases. The process state module remains
67968
67994
  // authoritative; these preserve existing hardening probes while 0.14 moves
@@ -68144,17 +68170,24 @@ var RuntimeProjectWorkspace = class {
68144
68170
  });
68145
68171
  const withEvents = createWorkspaceRuntimeRunnerBridge({
68146
68172
  resolveCommandContext: (context) => this.resolveCommandContext(context),
68147
- bindProcess: (context, descriptorStdio) => {
68173
+ bindProcess: (context, descriptorStdio, consumesLiveStdin) => {
68148
68174
  const executionHandle = this.processProjection.executionHandle(
68149
68175
  context.process
68150
68176
  );
68151
68177
  if (executionHandle) {
68152
68178
  executionHandle.descriptorStdio = descriptorStdio;
68179
+ executionHandle.consumesLiveStdin = consumesLiveStdin;
68153
68180
  }
68154
68181
  const processSnapshot = this.processProjection.authoritativeSnapshot(
68155
68182
  context.process
68156
68183
  );
68157
68184
  return {
68185
+ replayStartupInput: () => this.resolvePendingTerminalStartupInput(
68186
+ context.process.pid,
68187
+ descriptorStdio,
68188
+ context.stdinPipe,
68189
+ consumesLiveStdin
68190
+ ),
68158
68191
  ...executionHandle?.abortController?.signal ? { signal: executionHandle.abortController.signal } : {},
68159
68192
  ...executionHandle?.signalChannel ? { kernelSignals: executionHandle.signalChannel } : {},
68160
68193
  ...processSnapshot ? {
@@ -70702,24 +70735,106 @@ var RuntimeProjectWorkspace = class {
70702
70735
  )
70703
70736
  );
70704
70737
  }
70705
- kernelTerminalInputRoute(terminal) {
70738
+ kernelTerminalInputRoute(terminalSessionId, terminal) {
70706
70739
  const hasDescriptorConsumer = this.traceKernelAuthority?.session.processSnapshots().some(
70707
- (process3) => process3.sid === terminal.sessionId && process3.pgid === terminal.foregroundProcessGroupId && this.processState.executionHandles.get(process3.pid)?.descriptorStdio === true
70740
+ (process3) => process3.sid === terminal.sessionId && process3.pgid === terminal.foregroundProcessGroupId && this.processState.executionHandles.get(process3.pid)?.descriptorStdio === true && this.processState.executionHandles.get(process3.pid)?.consumesLiveStdin === true
70708
70741
  ) === true;
70709
- return hasDescriptorConsumer ? "kernel" : "legacy";
70742
+ if (hasDescriptorConsumer) return "kernel";
70743
+ const foregroundPid = this.processState.terminalForeground.get(
70744
+ terminalSessionId
70745
+ );
70746
+ if (foregroundPid === void 0) return "pending";
70747
+ const executionHandle = this.processState.executionHandles.get(foregroundPid);
70748
+ if (executionHandle?.consumesLiveStdin !== true) return "pending";
70749
+ const descriptorStdio = executionHandle.descriptorStdio;
70750
+ return descriptorStdio === void 0 ? "pending" : descriptorStdio ? "kernel" : "legacy";
70751
+ }
70752
+ queueTerminalStartupInput(terminalSessionId, input = {}) {
70753
+ const pending = this.pendingTerminalStartupInput.get(terminalSessionId) ?? {
70754
+ chunks: [],
70755
+ byteLength: 0,
70756
+ eof: false
70757
+ };
70758
+ if (input.data) {
70759
+ const byteLength = new TextEncoder().encode(input.data).byteLength;
70760
+ if (pending.byteLength + byteLength > TERMINAL_STARTUP_INPUT_MAX_BYTES) {
70761
+ return false;
70762
+ }
70763
+ pending.chunks.push(input.data);
70764
+ pending.byteLength += byteLength;
70765
+ }
70766
+ if (input.eof) pending.eof = true;
70767
+ this.pendingTerminalStartupInput.set(terminalSessionId, pending);
70768
+ return true;
70710
70769
  }
70711
- writeKernelTerminalInput(terminalSessionId, data) {
70770
+ async resolvePendingTerminalStartupInput(foregroundPid, descriptorStdio, stdinPipe, consumesLiveStdin = true) {
70771
+ const boundProcess = this.processProjection.find(foregroundPid);
70772
+ const boundSnapshot = boundProcess ? this.processProjection.authoritativeSnapshot(boundProcess) : void 0;
70773
+ const terminalSessionId = [...this.processState.terminalForeground].find(([, pid]) => {
70774
+ if (pid === foregroundPid) return true;
70775
+ const terminalProcess = this.processProjection.find(pid);
70776
+ const terminalSnapshot = terminalProcess ? this.processProjection.authoritativeSnapshot(terminalProcess) : void 0;
70777
+ return Boolean(
70778
+ boundSnapshot && terminalSnapshot && boundSnapshot.pgid === terminalSnapshot.pgid
70779
+ );
70780
+ })?.[0];
70781
+ if (!terminalSessionId) return;
70782
+ const pending = this.pendingTerminalStartupInput.get(terminalSessionId);
70783
+ if (!pending) return;
70784
+ if (!consumesLiveStdin) return;
70785
+ this.pendingTerminalStartupInput.delete(terminalSessionId);
70786
+ if (!descriptorStdio) {
70787
+ if (!stdinPipe) return;
70788
+ try {
70789
+ for (const chunk of pending.chunks) stdinPipe.write(chunk);
70790
+ if (pending.eof) stdinPipe.close();
70791
+ } catch {
70792
+ stdinPipe.close();
70793
+ }
70794
+ return;
70795
+ }
70712
70796
  const authority = this.traceKernelAuthority;
70713
70797
  const terminalId = this.terminalResourceIds.get(terminalSessionId);
70714
70798
  const terminal = terminalId === void 0 ? void 0 : authority?.session.terminalSnapshots().find(
70715
70799
  (candidate) => candidate.id === terminalId
70716
70800
  );
70717
- if (!authority || !terminal || terminal.closed) return "rejected";
70801
+ if (!authority || !terminal || terminal.closed) return;
70802
+ const bytes = new TextEncoder().encode(pending.chunks.join(""));
70803
+ await runPromise(
70804
+ gen(function* () {
70805
+ if (bytes.byteLength > 0) {
70806
+ yield* authority.session.writeTerminalInput(terminal.id, bytes);
70807
+ }
70808
+ if (pending.eof) {
70809
+ yield* authority.session.sendTerminalInputEof(terminal.id);
70810
+ }
70811
+ }).pipe(catchAll(() => _void))
70812
+ );
70813
+ }
70814
+ discardPendingTerminalStartupInput(terminalSessionId, foregroundPid) {
70815
+ if (terminalSessionId && (foregroundPid === void 0 || this.processState.terminalForeground.get(terminalSessionId) === foregroundPid)) {
70816
+ this.pendingTerminalStartupInput.delete(terminalSessionId);
70817
+ }
70818
+ }
70819
+ writeKernelTerminalInput(terminalSessionId, data) {
70718
70820
  const signalByte = new TextEncoder().encode(data).find(
70719
70821
  (byte) => byte === 3 || byte === 28
70720
70822
  );
70721
- if (signalByte === void 0 && this.kernelTerminalInputRoute(terminal) === "legacy") {
70722
- return "legacy";
70823
+ const authority = this.traceKernelAuthority;
70824
+ const terminalId = this.terminalResourceIds.get(terminalSessionId);
70825
+ const terminal = terminalId === void 0 ? void 0 : authority?.session.terminalSnapshots().find(
70826
+ (candidate) => candidate.id === terminalId
70827
+ );
70828
+ if (!authority || !terminal || terminal.closed) {
70829
+ if (signalByte !== void 0) return "rejected";
70830
+ return this.queueTerminalStartupInput(terminalSessionId, { data }) ? "pending" : "rejected";
70831
+ }
70832
+ if (signalByte === void 0) {
70833
+ const route = this.kernelTerminalInputRoute(terminalSessionId, terminal);
70834
+ if (route === "pending") {
70835
+ return this.queueTerminalStartupInput(terminalSessionId, { data }) ? "pending" : "rejected";
70836
+ }
70837
+ if (route === "legacy") return "legacy";
70723
70838
  }
70724
70839
  if (signalByte !== void 0) {
70725
70840
  const signal = signalByte === 3 ? "SIGINT" : "SIGQUIT";
@@ -70749,8 +70864,16 @@ var RuntimeProjectWorkspace = class {
70749
70864
  const terminal = terminalId === void 0 ? void 0 : authority?.session.terminalSnapshots().find(
70750
70865
  (candidate) => candidate.id === terminalId
70751
70866
  );
70752
- if (!authority || !terminal || terminal.closed) return "rejected";
70753
- if (this.kernelTerminalInputRoute(terminal) === "legacy") return "legacy";
70867
+ if (!authority || !terminal || terminal.closed) {
70868
+ this.queueTerminalStartupInput(terminalSessionId, { eof: true });
70869
+ return "pending";
70870
+ }
70871
+ const route = this.kernelTerminalInputRoute(terminalSessionId, terminal);
70872
+ if (route === "pending") {
70873
+ this.queueTerminalStartupInput(terminalSessionId, { eof: true });
70874
+ return "pending";
70875
+ }
70876
+ if (route === "legacy") return "legacy";
70754
70877
  runFork(
70755
70878
  authority.session.sendTerminalInputEof(terminal.id).pipe(
70756
70879
  catchAll(() => _void)
@@ -71904,6 +72027,10 @@ usage: tracekernelctl {status|reset|verbose [on|off|status]|kill <pid> [signal]|
71904
72027
  executionHandle.signalChannel?.close();
71905
72028
  this.processState.executionHandles.delete(process3.pid);
71906
72029
  if (options.terminalSessionId && this.processState.terminalForeground.get(options.terminalSessionId) === process3.pid) {
72030
+ this.discardPendingTerminalStartupInput(
72031
+ options.terminalSessionId,
72032
+ process3.pid
72033
+ );
71907
72034
  this.processState.terminalForeground.delete(options.terminalSessionId);
71908
72035
  }
71909
72036
  clearKernelSignalHandler();
@@ -72158,6 +72285,10 @@ usage: tracekernelctl {status|reset|verbose [on|off|status]|kill <pid> [signal]|
72158
72285
  executionHandle.signalChannel?.close();
72159
72286
  this.processState.executionHandles.delete(process3.pid);
72160
72287
  if (options.terminalSessionId && this.processState.terminalForeground.get(options.terminalSessionId) === process3.pid) {
72288
+ this.discardPendingTerminalStartupInput(
72289
+ options.terminalSessionId,
72290
+ process3.pid
72291
+ );
72161
72292
  this.processState.terminalForeground.delete(options.terminalSessionId);
72162
72293
  }
72163
72294
  this.observeKernelReparentedChildren(process3.pid);
@@ -72464,6 +72595,7 @@ usage: tracekernelctl {status|reset|verbose [on|off|status]|kill <pid> [signal]|
72464
72595
  const shellPromise = this.terminalShells.get(terminalSessionId);
72465
72596
  this.terminalShells.delete(terminalSessionId);
72466
72597
  this.terminalResourceIds.delete(terminalSessionId);
72598
+ this.pendingTerminalStartupInput.delete(terminalSessionId);
72467
72599
  if (!shellPromise) return;
72468
72600
  const disposal = shellPromise.then(async (shell) => {
72469
72601
  const authority = this.traceKernelAuthority;
@@ -72518,7 +72650,8 @@ usage: tracekernelctl {status|reset|verbose [on|off|status]|kill <pid> [signal]|
72518
72650
  signalForeground: (signal) => this.signalTerminalForeground(terminalSessionId, signal),
72519
72651
  terminalInputRouter: {
72520
72652
  write: (data) => this.writeKernelTerminalInput(terminalSessionId, data),
72521
- end: () => this.endKernelTerminalInput(terminalSessionId)
72653
+ end: () => this.endKernelTerminalInput(terminalSessionId),
72654
+ reset: () => this.discardPendingTerminalStartupInput(terminalSessionId)
72522
72655
  },
72523
72656
  resizeTerminal: (columns, rows) => this.resizeKernelTerminal(terminalSessionId, columns, rows),
72524
72657
  closeTerminal: () => this.closeTerminalShell(terminalSessionId),
@@ -72632,13 +72765,14 @@ usage: tracekernelctl {status|reset|verbose [on|off|status]|kill <pid> [signal]|
72632
72765
  const descriptorStdio = this.cppRunner.capabilities?.descriptorStdio === true;
72633
72766
  if (executionHandle) {
72634
72767
  executionHandle.descriptorStdio = descriptorStdio;
72768
+ executionHandle.consumesLiveStdin = true;
72635
72769
  }
72636
72770
  if (descriptorStdio) {
72637
72771
  this.startHostStandardInputPump(request.commandContext);
72638
72772
  }
72639
72773
  let result;
72640
72774
  try {
72641
- result = await this.cppRunner({
72775
+ const execution = this.cppRunner({
72642
72776
  code: "",
72643
72777
  source: "run",
72644
72778
  scriptPath,
@@ -72663,6 +72797,12 @@ usage: tracekernelctl {status|reset|verbose [on|off|status]|kill <pid> [signal]|
72663
72797
  this.handleRuntimeCommandEvent(event, request.commandContext);
72664
72798
  }
72665
72799
  });
72800
+ await this.resolvePendingTerminalStartupInput(
72801
+ request.commandContext.process.pid,
72802
+ descriptorStdio,
72803
+ request.stdinPipe
72804
+ );
72805
+ result = await execution;
72666
72806
  } finally {
72667
72807
  kernelSyscalls?.close();
72668
72808
  }
@@ -4,7 +4,7 @@ import {
4
4
  runtimeAbortSignalName,
5
5
  runtimeSignalExitCode,
6
6
  withRuntimeProjectCommandRunnerCapabilities
7
- } from "./chunk-4W6MUXZE.js";
7
+ } from "./chunk-BXUGUGWL.js";
8
8
  import "./chunk-756Z7C6D.js";
9
9
 
10
10
  // packages/runtime-java/src/java-project.ts
@@ -484,4 +484,4 @@ export {
484
484
  JAVA_PROJECT_CAPABILITIES,
485
485
  createJavaProjectRunner
486
486
  };
487
- //# sourceMappingURL=java-project-BTAANBJH.js.map
487
+ //# sourceMappingURL=java-project-GK6MHT3I.js.map
@@ -3792,6 +3792,13 @@ function normalizeBaseUrl(value) {
3792
3792
  const baseUrl = value ?? resolveBuiltInTraceJVMRuntimeAssetBaseUrl();
3793
3793
  return normalizeTraceJVMRuntimeAssetBaseUrl(baseUrl);
3794
3794
  }
3795
+ function normalizeWorkerUrl(value) {
3796
+ const workerUrl = value.trim();
3797
+ if (!workerUrl) {
3798
+ throw new TypeError("TraceJVM project Worker URL cannot be empty");
3799
+ }
3800
+ return workerUrl;
3801
+ }
3795
3802
  function createWorker(workerUrl, role) {
3796
3803
  return new Worker(workerUrl, {
3797
3804
  type: "module",
@@ -3851,7 +3858,9 @@ var TraceJVMProjectClient = class {
3851
3858
  };
3852
3859
  function createJavaProjectClientFactory(options = {}) {
3853
3860
  const runtimeAssetBaseUrl = normalizeBaseUrl(options.runtimeAssetBaseUrl);
3854
- const workerUrl = `${runtimeAssetBaseUrl}/browser-worker.js`;
3861
+ const workerUrl = normalizeWorkerUrl(
3862
+ options.workerUrl ?? `${runtimeAssetBaseUrl}/browser-worker.js`
3863
+ );
3855
3864
  const workerFor = (role) => options.createWorker?.(workerUrl, role) ?? createWorker(workerUrl, role);
3856
3865
  const runtimeProfile = options.runtimeProfile ?? "spring-server";
3857
3866
  const runtimeProfileBaseUrls = {
@@ -3906,4 +3915,4 @@ export {
3906
3915
  createJavaProjectClientFactory,
3907
3916
  resolveBuiltInTraceJVMRuntimeAssetBaseUrl
3908
3917
  };
3909
- //# sourceMappingURL=java-project-client-R7CKC72F.js.map
3918
+ //# sourceMappingURL=java-project-client-PEQKFTH6.js.map