windows-development-sandbox 1.27.1 → 1.28.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 (121) hide show
  1. package/dist/app/context.d.ts +5 -0
  2. package/dist/app/context.js +13 -0
  3. package/dist/app/features/accounts/accounts.def.d.ts +16 -0
  4. package/dist/app/features/accounts/accounts.run.d.ts +4 -0
  5. package/dist/app/features/accounts/services.def.d.ts +15 -1
  6. package/dist/app/features/accounts/services.def.js +67 -31
  7. package/dist/app/features/accounts/services.run.d.ts +7 -2
  8. package/dist/app/features/accounts/services.run.js +25 -6
  9. package/dist/app/features/defs.d.ts +17 -0
  10. package/dist/app/registry.d.ts +1 -1
  11. package/dist/app/registry.js +15 -2
  12. package/dist/bin/agent-sandbox.js +2 -2
  13. package/dist/bin/{chunk-RSIX7C6D.js → chunk-CB44HTTN.js} +444 -175
  14. package/dist/bin/{chunk-4TLSWPG7.js → chunk-UZ5S3EMB.js} +1 -1
  15. package/dist/bin/{chunk-QUHNXHVG.js → chunk-ZMZI3625.js} +46 -41
  16. package/dist/bin/claude-host.js +2 -2
  17. package/dist/bin/claude-sbx.js +2 -2
  18. package/dist/bin/codex-sbx.js +2 -2
  19. package/dist/bin/gemini-sbx.js +2 -2
  20. package/dist/bin/sandbox.js +2 -2
  21. package/dist/bin/sbx-hide.js +2 -2
  22. package/dist/bin/sbx-show.js +2 -2
  23. package/dist/cli/menu/menu.js +6 -1
  24. package/dist/cli/menu/pages/accounts-page.js +9 -5
  25. package/dist/core/schema/sandbox.js +1 -1
  26. package/dist/guest/apps/app-installer.js +7 -5
  27. package/dist/guest/apps/comet-unpack.js +2 -2
  28. package/dist/guest/daemon/heartbeat.js +1 -0
  29. package/dist/guest/governor/core.d.ts +53 -1
  30. package/dist/guest/governor/core.js +95 -1
  31. package/dist/guest/governor/decide.d.ts +4 -0
  32. package/dist/guest/governor/decide.js +2 -0
  33. package/dist/guest/governor/governor.js +23 -9
  34. package/dist/guest/runtime/pools.d.ts +4 -4
  35. package/dist/guest/runtime/pools.js +4 -15
  36. package/dist/guest/runtime/process.d.ts +5 -2
  37. package/dist/guest/runtime/process.js +23 -3
  38. package/dist/guest/toolchains/engines/epic-launcher.d.ts +6 -0
  39. package/dist/guest/toolchains/engines/epic-launcher.js +19 -1
  40. package/dist/guest/toolchains/engines/unreal-engines.js +2 -1
  41. package/dist/guest/toolchains/installers.d.ts +3 -3
  42. package/dist/guest/toolchains/installers.js +5 -5
  43. package/dist/guest/toolchains/native/unreal.js +22 -3
  44. package/dist/guest/toolchains/native/vcruntime.js +2 -2
  45. package/dist/guest/toolchains/native/vs-persist.d.ts +2 -2
  46. package/dist/guest/toolchains/runtimes.js +7 -6
  47. package/dist/guest/toolchains/signature.d.ts +2 -0
  48. package/dist/guest/toolchains/signature.js +9 -2
  49. package/dist/guest/toolchains/step-scheduler.js +1 -1
  50. package/dist/host/accounts/deliver.js +15 -7
  51. package/dist/host/life/crash-report.d.ts +4 -0
  52. package/dist/host/life/crash-report.js +30 -1
  53. package/dist/host/life/last-end.js +1 -0
  54. package/dist/host/pc-installs/discover.js +5 -2
  55. package/dist/host/pc-installs/unreal.d.ts +3 -1
  56. package/dist/host/pc-installs/unreal.js +27 -1
  57. package/dist/host/tools/windows-terminal.d.ts +4 -1
  58. package/dist/host/tools/windows-terminal.js +25 -9
  59. package/dist/runtime/agent.js +39 -23
  60. package/dist/runtime/daemon.js +279 -121
  61. package/dist/runtime/db.js +37 -17
  62. package/dist/runtime/main.js +340 -109
  63. package/dist/runtime/netproxy.js +31 -13
  64. package/dist/runtime/tool.js +37 -16
  65. package/dist/runtime/view.js +150 -38
  66. package/dist/selftest/agent-paths.test.js +3 -1
  67. package/dist/selftest/app.test.js +20 -2
  68. package/dist/selftest/boot-runner.test.js +15 -1
  69. package/dist/selftest/channel.test.js +33 -0
  70. package/dist/selftest/engines.test.js +22 -1
  71. package/dist/selftest/heavy-load.test.js +116 -4
  72. package/dist/selftest/live-terminal.test.js +103 -0
  73. package/dist/selftest/menu-screens.js +52 -1
  74. package/dist/selftest/menu.test.js +29 -3
  75. package/dist/selftest/personalization.test.js +2 -1
  76. package/dist/selftest/service-accounts.test.js +77 -2
  77. package/dist/selftest/support/engine-golden.js +2 -0
  78. package/dist/selftest/ui-text.test.js +4 -0
  79. package/dist/shared/accounts/kinds.js +9 -9
  80. package/dist/shared/apps/catalogue-gamedev.js +1 -0
  81. package/dist/shared/apps/catalogue.d.ts +2 -0
  82. package/dist/shared/channel/schema.d.ts +2 -0
  83. package/dist/shared/channel/schema.js +4 -0
  84. package/dist/shared/concurrency/pools.js +1 -1
  85. package/dist/shared/download/archive.js +4 -2
  86. package/dist/shared/download/index.d.ts +1 -1
  87. package/dist/shared/download/index.js +1 -1
  88. package/dist/shared/download/spawn.d.ts +7 -1
  89. package/dist/shared/download/spawn.js +16 -1
  90. package/dist/shared/memory/index.d.ts +1 -0
  91. package/dist/shared/memory/index.js +1 -0
  92. package/dist/shared/memory/policy.d.ts +12 -0
  93. package/dist/shared/memory/policy.js +4 -0
  94. package/dist/shared/memory/unreal-build.d.ts +2 -0
  95. package/dist/shared/memory/unreal-build.js +21 -0
  96. package/dist/shared/paths/pc-installs.d.ts +8 -0
  97. package/dist/shared/pty/clipboard-watch.d.ts +4 -0
  98. package/dist/shared/pty/clipboard-watch.js +40 -0
  99. package/dist/shared/pty/ctrl-c.d.ts +13 -7
  100. package/dist/shared/pty/ctrl-c.js +35 -19
  101. package/dist/shared/pty/index.d.ts +1 -0
  102. package/dist/shared/pty/index.js +1 -0
  103. package/dist/shared/pty/terminal.d.ts +1 -1
  104. package/dist/shared/pty/terminal.js +16 -13
  105. package/dist/shared/unreal/launcher-files.d.ts +7 -0
  106. package/dist/shared/unreal/launcher-files.js +32 -1
  107. package/dist/shared/web/ctrl-c.d.ts +26 -0
  108. package/dist/shared/web/ctrl-c.js +64 -0
  109. package/dist/shared/web/index.d.ts +1 -0
  110. package/dist/shared/web/index.js +1 -0
  111. package/dist/web/index.html +1 -1
  112. package/dist/web/{main-VPMYTSUL.js → main-7NY4X6YU.js} +67 -67
  113. package/native/csharp/HcsHost/AssemblyInfo.cs +3 -3
  114. package/native/csharp/HostTools/AssemblyInfo.cs +3 -3
  115. package/native/csharp/StorageHelper/AssemblyInfo.cs +3 -3
  116. package/package.json +1 -1
  117. package/sandbox/csharp/ClipboardWatch.cs +59 -0
  118. package/sandbox/csharp/MemGov.cs +752 -7
  119. package/sandbox/scripts/watch-clipboard.ps1 +8 -0
  120. package/schemas/config.schema.json +10 -10
  121. package/schemas/sandbox-config.schema.json +9 -9
@@ -0,0 +1,64 @@
1
+ // When a Ctrl+C is "copy" and when it is an interrupt, shared by the terminal client and the web terminal. Agents turn
2
+ // mouse tracking on, so selecting text happens inside the program (a mouse drag, or an OSC 52 clipboard write) and the
3
+ // terminal never sees a selection. After that every Ctrl+C is "copy" and is not sent, until another key or a click.
4
+ // Outside that, a lone Ctrl+C is held and a second one soon after is sent. Pure: no node imports.
5
+ /** A second Ctrl+C within this long sends it. */
6
+ export const CTRL_C_CONFIRM_MS = 1500;
7
+ /** What the title shows while a Ctrl+C is held back. */
8
+ export const CTRL_C_HINT = 'Ctrl+C again to send it to the program (Esc stops an agent)';
9
+ /** What the title shows when a Ctrl+C was taken as "copy". */
10
+ export const CTRL_C_COPY_HINT = 'Copied: Ctrl+C after selecting text is not sent to the program (Esc stops an agent)';
11
+ export class CtrlCDecider {
12
+ confirm;
13
+ armedAt = Number.NEGATIVE_INFINITY;
14
+ selected = false;
15
+ constructor(confirm = true) {
16
+ this.confirm = confirm;
17
+ }
18
+ /** Text was selected in the program: Ctrl+C is "copy" from now on. */
19
+ selection() {
20
+ this.selected = true;
21
+ this.armedAt = Number.NEGATIVE_INFINITY;
22
+ }
23
+ /** Any other key or a click: Ctrl+C is an interrupt again. */
24
+ otherInput() {
25
+ this.selected = false;
26
+ }
27
+ /** What to do with a lone Ctrl+C pressed at `nowMs`. */
28
+ ctrlC(nowMs) {
29
+ if (this.selected)
30
+ return 'copy';
31
+ if (!this.confirm)
32
+ return 'send';
33
+ if (nowMs - this.armedAt <= CTRL_C_CONFIRM_MS) {
34
+ this.armedAt = Number.NEGATIVE_INFINITY;
35
+ return 'send';
36
+ }
37
+ this.armedAt = nowMs;
38
+ return 'hold';
39
+ }
40
+ }
41
+ // SGR reports (ESC [ < b ; x ; y M|m) and X10 reports (ESC [ M and three characters); bounded, no backtracking.
42
+ const MOUSE_REPORT = /\x1b\[<(\d{1,4});\d{1,5};\d{1,5}([Mm])|\x1b\[M([\s\S])[\s\S]{2}/g;
43
+ /** What typed input holds: the strongest mouse report (a drag, else a click), and whether anything else is in it. */
44
+ export function classifyInput(text) {
45
+ let drag = false;
46
+ let click = false;
47
+ for (const m of text.matchAll(MOUSE_REPORT)) {
48
+ const sgr = m[1] !== undefined;
49
+ const b = sgr ? Number(m[1]) : (m[3] ?? ' ').charCodeAt(0) - 32;
50
+ if (b & 64)
51
+ continue;
52
+ if (b & 32) {
53
+ if ((b & 3) !== 3)
54
+ drag = true;
55
+ }
56
+ else if (sgr ? m[2] === 'M' : (b & 3) !== 3)
57
+ click = true;
58
+ }
59
+ return { mouse: drag ? 'drag' : click ? 'click' : null, keys: text.replace(MOUSE_REPORT, '').length > 0 };
60
+ }
61
+ /** True when program output asks the terminal to write the clipboard (OSC 52). */
62
+ export function hasClipboardWrite(text) {
63
+ return /\x1b\]0{0,2}52;/.test(text) || /\u009d0{0,2}52;/.test(text);
64
+ }
@@ -1 +1,2 @@
1
1
  export * from './protocol.js';
2
+ export * from './ctrl-c.js';
@@ -1 +1,2 @@
1
1
  export * from './protocol.js';
2
+ export * from './ctrl-c.js';
@@ -6,7 +6,7 @@
6
6
  <title>Sandbox</title>
7
7
  <link rel="icon" href="data:," />
8
8
  <link rel="stylesheet" href="/main-XT7T6ODM.css" />
9
- <script type="module" src="/main-VPMYTSUL.js"></script>
9
+ <script type="module" src="/main-7NY4X6YU.js"></script>
10
10
  </head>
11
11
  <body>
12
12
  <div id="root"></div>