windows-development-sandbox 1.18.2 → 1.18.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 (72) hide show
  1. package/config.example.json +1 -1
  2. package/dist/app/features/defs.d.ts +8 -0
  3. package/dist/app/features/sandbox/sandbox.def.d.ts +12 -0
  4. package/dist/app/features/sandbox/sandbox.def.js +17 -2
  5. package/dist/app/features/sandbox/sandbox.run.d.ts +4 -0
  6. package/dist/app/features/sandbox/sandbox.run.js +4 -0
  7. package/dist/bin/agent-sandbox.js +2 -2
  8. package/dist/bin/{chunk-IIHL7W6B.js → chunk-3G53NNZP.js} +1 -1
  9. package/dist/bin/{chunk-MQIA7GNB.js → chunk-FQWYCF6L.js} +981 -866
  10. package/dist/bin/{chunk-M4OM632I.js → chunk-M6XUQK53.js} +1 -1
  11. package/dist/bin/claude-host.js +2 -2
  12. package/dist/bin/claude-sbx.js +2 -2
  13. package/dist/bin/codex-sbx.js +2 -2
  14. package/dist/bin/gemini-sbx.js +2 -2
  15. package/dist/bin/sandbox.js +2 -2
  16. package/dist/bin/sbx-hide.js +2 -2
  17. package/dist/bin/sbx-show.js +2 -2
  18. package/dist/cli/commands/repair/checks/sandbox.d.ts +3 -1
  19. package/dist/cli/commands/repair/checks/sandbox.js +24 -0
  20. package/dist/core/config/defaults.js +1 -1
  21. package/dist/core/schema/sandbox.js +1 -1
  22. package/dist/core/schema/toolchains.js +2 -2
  23. package/dist/guest/daemon/daemon.js +1 -1
  24. package/dist/guest/daemon/heartbeat.d.ts +6 -0
  25. package/dist/guest/daemon/heartbeat.js +40 -0
  26. package/dist/guest/entries/daemon.js +2 -0
  27. package/dist/guest/governor/core.d.ts +19 -1
  28. package/dist/guest/governor/core.js +23 -1
  29. package/dist/guest/governor/decide.d.ts +14 -0
  30. package/dist/guest/governor/decide.js +52 -7
  31. package/dist/guest/governor/governor.d.ts +4 -1
  32. package/dist/guest/governor/governor.js +9 -2
  33. package/dist/guest/toolchains/native/rust-extras.d.ts +7 -0
  34. package/dist/guest/toolchains/native/rust-extras.js +26 -3
  35. package/dist/guest/toolchains/plan.js +6 -4
  36. package/dist/host/channel/channel.d.ts +1 -1
  37. package/dist/host/channel/channel.js +10 -2
  38. package/dist/host/launch/wsb-file.d.ts +6 -1
  39. package/dist/host/launch/wsb-file.js +9 -5
  40. package/dist/host/life/crash-report.d.ts +2 -0
  41. package/dist/host/life/crash-report.js +4 -0
  42. package/dist/host/life/index.d.ts +1 -0
  43. package/dist/host/life/index.js +1 -0
  44. package/dist/host/life/last-end.d.ts +21 -0
  45. package/dist/host/life/last-end.js +70 -0
  46. package/dist/host/life/watchdog.d.ts +2 -0
  47. package/dist/host/life/watchdog.js +8 -2
  48. package/dist/runtime/agent.js +26 -3
  49. package/dist/runtime/daemon.js +367 -234
  50. package/dist/runtime/db.js +26 -3
  51. package/dist/runtime/main.js +57 -11
  52. package/dist/runtime/netproxy.js +26 -3
  53. package/dist/runtime/tool.js +26 -3
  54. package/dist/runtime/view.js +26 -3
  55. package/dist/selftest/heavy-load.test.js +95 -14
  56. package/dist/selftest/live-terminal.test.js +4 -0
  57. package/dist/shared/channel/run-dir.d.ts +4 -1
  58. package/dist/shared/channel/run-dir.js +7 -1
  59. package/dist/shared/channel/schema.d.ts +23 -0
  60. package/dist/shared/channel/schema.js +21 -0
  61. package/dist/shared/memory/policy.d.ts +10 -0
  62. package/dist/shared/memory/policy.js +17 -1
  63. package/dist/sync/watcher.js +1 -1
  64. package/dist/web/index.html +1 -1
  65. package/dist/web/{main-CWIF4VQI.js → main-6XYO5FZC.js} +43 -43
  66. package/native/csharp/HcsHost/AssemblyInfo.cs +3 -3
  67. package/native/csharp/HostTools/AssemblyInfo.cs +3 -3
  68. package/native/csharp/StorageHelper/AssemblyInfo.cs +3 -3
  69. package/package.json +1 -1
  70. package/sandbox/csharp/MemGov.cs +58 -0
  71. package/schemas/config.schema.json +3 -3
  72. package/schemas/sandbox-config.schema.json +3 -3
@@ -140,7 +140,7 @@
140
140
  "components": [],
141
141
  "targets": [],
142
142
  "crates": [],
143
- "targetDir": "separate",
143
+ "targetDir": "auto",
144
144
  "linker": "lld",
145
145
  "linkSlots": "auto"
146
146
  },
@@ -374,6 +374,10 @@ export declare const QUERIES: readonly [QueryDef<import("zod").ZodObject<{}, imp
374
374
  guarded: import("zod").ZodNumber;
375
375
  findings: import("zod").ZodArray<import("zod").ZodString>;
376
376
  }, import("zod/v4/core").$strip>;
377
+ lastEnd: import("zod").ZodOptional<import("zod").ZodObject<{
378
+ text: import("zod").ZodString;
379
+ at: import("zod").ZodString;
380
+ }, import("zod/v4/core").$strip>>;
377
381
  }, import("zod/v4/core").$strip>, "sandbox.status">, QueryDef<import("zod").ZodObject<{
378
382
  wide: import("zod").ZodDefault<import("zod").ZodBoolean>;
379
383
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
@@ -1064,6 +1068,10 @@ export declare const VIEWS: readonly [import("../kernel/define.js").ViewDef<{
1064
1068
  guarded: import("zod").ZodNumber;
1065
1069
  findings: import("zod").ZodArray<import("zod").ZodString>;
1066
1070
  }, import("zod/v4/core").$strip>;
1071
+ lastEnd: import("zod").ZodOptional<import("zod").ZodObject<{
1072
+ text: import("zod").ZodString;
1073
+ at: import("zod").ZodString;
1074
+ }, import("zod/v4/core").$strip>>;
1067
1075
  }, import("zod/v4/core").$strip>, "sandbox.status">;
1068
1076
  }, Record<string, never>, "sandbox">, import("../kernel/define.js").ViewDef<{
1069
1077
  sessions: QueryDef<import("zod").ZodObject<{
@@ -57,6 +57,10 @@ export declare const SandboxStatusSchema: z.ZodObject<{
57
57
  guarded: z.ZodNumber;
58
58
  findings: z.ZodArray<z.ZodString>;
59
59
  }, z.core.$strip>;
60
+ lastEnd: z.ZodOptional<z.ZodObject<{
61
+ text: z.ZodString;
62
+ at: z.ZodString;
63
+ }, z.core.$strip>>;
60
64
  }, z.core.$strip>;
61
65
  export type SandboxStatus = z.output<typeof SandboxStatusSchema>;
62
66
  /** "pong (2 session(s) running)" from the helper in the sandbox, in plain words. */
@@ -118,6 +122,10 @@ export declare const sandboxStatus: import("../../kernel/define.js").QueryDef<z.
118
122
  guarded: z.ZodNumber;
119
123
  findings: z.ZodArray<z.ZodString>;
120
124
  }, z.core.$strip>;
125
+ lastEnd: z.ZodOptional<z.ZodObject<{
126
+ text: z.ZodString;
127
+ at: z.ZodString;
128
+ }, z.core.$strip>>;
121
129
  }, z.core.$strip>, "sandbox.status">;
122
130
  export declare const showWindow: import("../../kernel/define.js").OperationDef<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
123
131
  message: z.ZodString;
@@ -189,5 +197,9 @@ export declare const sandboxView: import("../../kernel/define.js").ViewDef<{
189
197
  guarded: z.ZodNumber;
190
198
  findings: z.ZodArray<z.ZodString>;
191
199
  }, z.core.$strip>;
200
+ lastEnd: z.ZodOptional<z.ZodObject<{
201
+ text: z.ZodString;
202
+ at: z.ZodString;
203
+ }, z.core.$strip>>;
192
204
  }, z.core.$strip>, "sandbox.status">;
193
205
  }, Record<string, never>, "sandbox">;
@@ -1,7 +1,8 @@
1
1
  // The running sandbox as a whole: what it is doing (a live query), its window, and stopping it. Pure: schemas, labels
2
2
  // and the view; sandbox.run.ts does the work.
3
3
  import { z } from 'zod';
4
- import { action, ago, defineOperation, defineQuery, defineView, plural, } from '../../kernel/index.js';
4
+ import { action, ago, defineOperation, defineQuery, defineView, link, plural, } from '../../kernel/index.js';
5
+ import { CRASH } from '../logs/logs.def.js';
5
6
  const ProjectSchema = z.object({
6
7
  name: z.string().describe('The project'),
7
8
  host: z.string().describe('Its folder on this PC'),
@@ -38,6 +39,11 @@ export const SandboxStatusSchema = z.object({
38
39
  projects: z.array(ProjectSchema),
39
40
  otherSessions: z.array(z.object({ id: z.string(), harness: z.string(), cwd: z.string() })),
40
41
  repoGuard: z.object({ guarded: z.number(), findings: z.array(z.string()) }),
42
+ /** How the last sandbox ended when nobody closed it (it is not running now). */
43
+ lastEnd: z
44
+ .object({ text: z.string().describe('What happened'), at: z.string().describe('When (ISO time)') })
45
+ .optional()
46
+ .describe('The last sandbox ended unexpectedly'),
41
47
  });
42
48
  const MessageSchema = z.object({ message: z.string().describe('What happened') });
43
49
  /** "pong (2 session(s) running)" from the helper in the sandbox, in plain words. */
@@ -85,6 +91,7 @@ export const sandboxStatus = defineQuery({
85
91
  projects: o.projects,
86
92
  otherSessions: o.otherSessions,
87
93
  repoGuard: o.repoGuard,
94
+ ...(o.lastEnd ? { lastEnd: o.lastEnd } : {}),
88
95
  };
89
96
  },
90
97
  },
@@ -168,6 +175,7 @@ function facts(o) {
168
175
  fact('sessions', 'Sessions', String(sessions)),
169
176
  ]
170
177
  : []),
178
+ ...(o.lastEnd ? [fact('lastEnd', 'Last sandbox', o.lastEnd.text, { tone: 'warn' })] : []),
171
179
  fact('account', 'Account', s.account ?? 'none selected (sandbox account use)'),
172
180
  fact('sync', 'Background sync', s.syncWatcher ? 'on' : 'off'),
173
181
  ];
@@ -228,7 +236,14 @@ export function sandboxPage(o) {
228
236
  : action(hideWindow, {}, { key: 'h', verb: 'hide', importance: 3 }),
229
237
  action(stopSandbox, {}, { key: 'x', verb: 'stop', importance: 1 }),
230
238
  ]
231
- : [],
239
+ : o.lastEnd
240
+ ? [
241
+ link({ kind: 'view', view: 'logs', params: { name: CRASH } }, 'Show crash report', {
242
+ verb: 'show',
243
+ importance: 2,
244
+ }),
245
+ ]
246
+ : [],
232
247
  };
233
248
  const others = {
234
249
  id: 'other-sessions',
@@ -55,6 +55,10 @@ export declare const sandboxStatusRun: import("../../kernel/define.js").Implemen
55
55
  guarded: import("zod").ZodNumber;
56
56
  findings: import("zod").ZodArray<import("zod").ZodString>;
57
57
  }, import("zod/v4/core").$strip>;
58
+ lastEnd: import("zod").ZodOptional<import("zod").ZodObject<{
59
+ text: import("zod").ZodString;
60
+ at: import("zod").ZodString;
61
+ }, import("zod/v4/core").$strip>>;
58
62
  }, import("zod/v4/core").$strip>, "sandbox.status">, import("../../../cli/commands/context.js").Context>;
59
63
  export declare const showWindowRun: import("../../kernel/define.js").Implementation<import("../../kernel/define.js").OperationDef<import("zod").ZodObject<{}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
60
64
  message: import("zod").ZodString;
@@ -3,6 +3,7 @@
3
3
  import path from 'node:path';
4
4
  import { safeText } from '../../../core/util/index.js';
5
5
  import { SandboxChannel } from '../../../host/channel/index.js';
6
+ import { LifeRecord, readLastEnd } from '../../../host/life/index.js';
6
7
  import { runningOwner } from '../../../host/sharing/index.js';
7
8
  import { requireOnPc, requireRunning } from '../../../cli/commands/context.js';
8
9
  import { hereDir } from '../../../cli/commands/projects/here.js';
@@ -36,7 +37,10 @@ export const sandboxStatusRun = implement(sandboxStatus, async (asked) => {
36
37
  if (view.limited)
37
38
  return limitedStatus(view, hereDir(asked));
38
39
  const report = await new SandboxService(view.ctx).status();
40
+ const { storageRoot, dataPath } = view.ctx;
41
+ const lastEnd = readLastEnd(() => new LifeRecord(storageRoot, dataPath).read(), dataPath, report.sandbox.running);
39
42
  return {
43
+ ...(lastEnd ? { lastEnd } : {}),
40
44
  ...(view.line ? { shared: { line: view.line, limited: false, startedBy: view.ctx.borrowed?.user ?? null } } : {}),
41
45
  ...report,
42
46
  sandbox: { ...report.sandbox, daemon: safeText(report.sandbox.daemon) },
@@ -2,8 +2,8 @@
2
2
  import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
3
3
  import {
4
4
  run
5
- } from "./chunk-IIHL7W6B.js";
6
- import "./chunk-MQIA7GNB.js";
5
+ } from "./chunk-3G53NNZP.js";
6
+ import "./chunk-FQWYCF6L.js";
7
7
 
8
8
  // src/bin/agent-sandbox.ts
9
9
  run(process.argv.slice(2));
@@ -228,7 +228,7 @@ import {
228
228
  withOperationCommands,
229
229
  working,
230
230
  writeJson
231
- } from "./chunk-MQIA7GNB.js";
231
+ } from "./chunk-FQWYCF6L.js";
232
232
 
233
233
  // node_modules/commander/lib/error.js
234
234
  var require_error = __commonJS({