@mastra/factory 0.11.1 → 0.12.0-alpha.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 (112) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/factory.d.ts +2 -22
  3. package/dist/factory.d.ts.map +1 -1
  4. package/dist/factory.js +15 -58
  5. package/dist/factory.js.map +1 -1
  6. package/dist/index.d.ts +2 -1
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/integrations/base.d.ts +5 -13
  9. package/dist/integrations/base.d.ts.map +1 -1
  10. package/dist/integrations/github/config.d.ts +4 -4
  11. package/dist/integrations/github/config.d.ts.map +1 -1
  12. package/dist/integrations/github/config.js +3 -3
  13. package/dist/integrations/github/config.js.map +1 -1
  14. package/dist/integrations/github/integration.d.ts.map +1 -1
  15. package/dist/integrations/github/integration.js +2 -4
  16. package/dist/integrations/github/integration.js.map +1 -1
  17. package/dist/integrations/github/reconcile-worker.d.ts +0 -5
  18. package/dist/integrations/github/reconcile-worker.d.ts.map +1 -1
  19. package/dist/integrations/github/reconcile-worker.js +0 -7
  20. package/dist/integrations/github/reconcile-worker.js.map +1 -1
  21. package/dist/integrations/github/routes.d.ts +6 -5
  22. package/dist/integrations/github/routes.d.ts.map +1 -1
  23. package/dist/integrations/github/routes.js +36 -263
  24. package/dist/integrations/github/routes.js.map +1 -1
  25. package/dist/integrations/github/sandbox-release.d.ts +17 -47
  26. package/dist/integrations/github/sandbox-release.d.ts.map +1 -1
  27. package/dist/integrations/github/sandbox-release.js +24 -103
  28. package/dist/integrations/github/sandbox-release.js.map +1 -1
  29. package/dist/integrations/github/sandbox.d.ts +25 -139
  30. package/dist/integrations/github/sandbox.d.ts.map +1 -1
  31. package/dist/integrations/github/sandbox.js +24 -212
  32. package/dist/integrations/github/sandbox.js.map +1 -1
  33. package/dist/integrations/github/webhook.d.ts.map +1 -1
  34. package/dist/integrations/github/webhook.js +1 -2
  35. package/dist/integrations/github/webhook.js.map +1 -1
  36. package/dist/integrations/platform/github/event-worker.d.ts +0 -2
  37. package/dist/integrations/platform/github/event-worker.d.ts.map +1 -1
  38. package/dist/integrations/platform/github/event-worker.js +0 -7
  39. package/dist/integrations/platform/github/event-worker.js.map +1 -1
  40. package/dist/integrations/platform/github/integration.d.ts.map +1 -1
  41. package/dist/integrations/platform/github/integration.js +5 -7
  42. package/dist/integrations/platform/github/integration.js.map +1 -1
  43. package/dist/routes/config.d.ts.map +1 -1
  44. package/dist/routes/config.js +3 -1
  45. package/dist/routes/config.js.map +1 -1
  46. package/dist/routes/fs.d.ts +4 -6
  47. package/dist/routes/fs.d.ts.map +1 -1
  48. package/dist/routes/fs.js +28 -34
  49. package/dist/routes/fs.js.map +1 -1
  50. package/dist/routes/skills.d.ts.map +1 -1
  51. package/dist/routes/skills.js +6 -3
  52. package/dist/routes/skills.js.map +1 -1
  53. package/dist/routes/surface.d.ts +4 -9
  54. package/dist/routes/surface.d.ts.map +1 -1
  55. package/dist/routes/surface.js +3 -5
  56. package/dist/routes/surface.js.map +1 -1
  57. package/dist/sandbox/materialization.d.ts +36 -0
  58. package/dist/sandbox/materialization.d.ts.map +1 -0
  59. package/dist/sandbox/materialization.js +18 -0
  60. package/dist/sandbox/materialization.js.map +1 -0
  61. package/dist/sandbox/session-retirement.d.ts +8 -6
  62. package/dist/sandbox/session-retirement.d.ts.map +1 -1
  63. package/dist/sandbox/session-retirement.js +28 -123
  64. package/dist/sandbox/session-retirement.js.map +1 -1
  65. package/dist/sandbox/session-sandbox.d.ts +117 -0
  66. package/dist/sandbox/session-sandbox.d.ts.map +1 -0
  67. package/dist/sandbox/session-sandbox.js +132 -0
  68. package/dist/sandbox/session-sandbox.js.map +1 -0
  69. package/dist/sandbox/workdir.d.ts +30 -0
  70. package/dist/sandbox/workdir.d.ts.map +1 -0
  71. package/dist/sandbox/workdir.js +48 -0
  72. package/dist/sandbox/workdir.js.map +1 -0
  73. package/dist/session/filesystem-capture.d.ts +2 -1
  74. package/dist/session/filesystem-capture.d.ts.map +1 -1
  75. package/dist/session/filesystem-capture.js +45 -4
  76. package/dist/session/filesystem-capture.js.map +1 -1
  77. package/dist/session/first-exec-capture.d.ts +1 -0
  78. package/dist/session/first-exec-capture.d.ts.map +1 -1
  79. package/dist/session/first-exec-capture.js +1 -1
  80. package/dist/session/first-exec-capture.js.map +1 -1
  81. package/dist/storage/domains/integrations/base.d.ts +1 -1
  82. package/dist/storage/domains/integrations/base.js +1 -1
  83. package/dist/storage/domains/integrations/base.js.map +1 -1
  84. package/dist/storage/domains/source-control/base.d.ts +0 -144
  85. package/dist/storage/domains/source-control/base.d.ts.map +1 -1
  86. package/dist/storage/domains/source-control/base.js +3 -290
  87. package/dist/storage/domains/source-control/base.js.map +1 -1
  88. package/dist/storage/domains/source-control/inmemory.d.ts +1 -63
  89. package/dist/storage/domains/source-control/inmemory.d.ts.map +1 -1
  90. package/dist/storage/domains/source-control/inmemory.js +0 -89
  91. package/dist/storage/domains/source-control/inmemory.js.map +1 -1
  92. package/dist/workspace.d.ts +5 -37
  93. package/dist/workspace.d.ts.map +1 -1
  94. package/dist/workspace.js +107 -245
  95. package/dist/workspace.js.map +1 -1
  96. package/package.json +4 -4
  97. package/dist/sandbox/base-checkpoint-triggers.d.ts +0 -77
  98. package/dist/sandbox/base-checkpoint-triggers.d.ts.map +0 -1
  99. package/dist/sandbox/base-checkpoint-triggers.js +0 -137
  100. package/dist/sandbox/base-checkpoint-triggers.js.map +0 -1
  101. package/dist/sandbox/base-checkpoint.d.ts +0 -59
  102. package/dist/sandbox/base-checkpoint.d.ts.map +0 -1
  103. package/dist/sandbox/base-checkpoint.js +0 -145
  104. package/dist/sandbox/base-checkpoint.js.map +0 -1
  105. package/dist/sandbox/fleet.d.ts +0 -258
  106. package/dist/sandbox/fleet.d.ts.map +0 -1
  107. package/dist/sandbox/fleet.js +0 -356
  108. package/dist/sandbox/fleet.js.map +0 -1
  109. package/dist/sandbox/reattach.d.ts +0 -3
  110. package/dist/sandbox/reattach.d.ts.map +0 -1
  111. package/dist/sandbox/reattach.js +0 -16
  112. package/dist/sandbox/reattach.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"sandbox-release.d.ts","sourceRoot":"","sources":["../../../src/integrations/github/sandbox-release.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACnF,OAAO,KAAK,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AACrH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAGjF;;;;;;;;GAQG;AACH,wBAAsB,oBAAoB,CAAC,OAAO,EAAE;IAClD,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,iBAAiB,CAAC,CAAC;IAC7C,aAAa,EAAE,IAAI,CAAC,0BAA0B,EAAE,qBAAqB,GAAG,cAAc,CAAC,CAAC;IACxF,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB,EAAE,MAAM,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,sBAAsB,CAAC;CAClC,GAAG,OAAO,CAAC,IAAI,CAAC,CAsBhB;AAED;;;;;;;;;GASG;AACH,wBAAsB,4BAA4B,CAAC,OAAO,EAAE;IAC1D,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,UAAU,GAAG,iBAAiB,GAAG,iBAAiB,CAAC,CAAC;IAC9E,aAAa,EAAE,IAAI,CAAC,0BAA0B,EAAE,aAAa,GAAG,qBAAqB,GAAG,cAAc,CAAC,CAAC;IACxG,OAAO,EAAE,IAAI,CAAC,oBAAoB,EAAE,OAAO,GAAG,QAAQ,GAAG,qBAAqB,GAAG,WAAW,GAAG,gBAAgB,CAAC,CAAC;CAClH,GAAG,OAAO,CAAC,IAAI,CAAC,CAsChB;AAED;;;;;;;;;GASG;AACH,wBAAsB,wBAAwB,CAAC,OAAO,EAAE;IACtD,SAAS,EAAE,IAAI,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;IACzC,aAAa,EAAE,IAAI,CAAC,0BAA0B,EAAE,UAAU,GAAG,aAAa,GAAG,qBAAqB,GAAG,cAAc,CAAC,CAAC;IACrH,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,iBAAiB,CAAC,CAAC;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,IAAI,CAAC,CA+BhB"}
1
+ {"version":3,"file":"sandbox-release.d.ts","sourceRoot":"","sources":["../../../src/integrations/github/sandbox-release.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,wBAAsB,qBAAqB,CAAC,OAAO,EAAE;IACnD,2DAA2D;IAC3D,SAAS,EAAE,MAAM,CAAC;IAClB,qEAAqE;IACrE,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,OAAO,CAAC,IAAI,CAAC,CAehB;AAED;;;;GAIG;AACH,wBAAsB,4BAA4B,CAAC,OAAO,EAAE;IAC1D,OAAO,EAAE,IAAI,CAAC,OAAO,8CAA8C,EAAE,oBAAoB,EAAE,IAAI,CAAC,CAAC;CAClG,GAAG,OAAO,CAAC,IAAI,CAAC,CAEhB"}
@@ -1,117 +1,38 @@
1
- import { recycleClaimedWorkdir } from "./sandbox.js";
1
+ import { evictSessionSandbox, peekSessionSandbox } from "../../sandbox/session-sandbox.js";
2
2
  //#region src/integrations/github/sandbox-release.ts
3
3
  /**
4
- * Scrub a sandbox that is about to enter the reuse pool: force-checkout the
5
- * default branch and drop the released session's local state, so idle pooled
6
- * VMs don't sit on stale branches, dirty worktrees, or abandoned work while
7
- * they wait for the next claim. Best-effort — the VM may already be reaped
8
- * (the pooled claim then falls back to fresh provisioning) and the claim
9
- * path recycles the workdir again before reuse, so a failed scrub never
10
- * blocks the release.
11
- */
12
- async function cleanReleasedSandbox(options) {
13
- try {
14
- const projectRepository = await options.sourceControl.projectRepositories.get({
15
- orgId: options.orgId,
16
- id: options.projectRepositoryId
17
- });
18
- if (!projectRepository) return;
19
- const repository = await options.sourceControl.repositories.get({
20
- orgId: options.orgId,
21
- id: projectRepository.repositoryId
22
- });
23
- if (!repository) return;
24
- await recycleClaimedWorkdir(options.sandbox ?? await options.fleet.reattachSandbox(options.sandboxId, { actingUserId: options.actingUserId }), options.sandboxWorkdir, repository.defaultBranch);
25
- } catch {}
26
- }
27
- /**
28
- * Reclaim the sandbox a just-deleted user session was holding: return a remote
29
- * VM to the reuse pool (scrubbed first), or tear a local/unpooled one down.
4
+ * Stop or destroy the sandbox a session holds in this process, dropping it
5
+ * from the per-process memo first so later opens construct fresh.
30
6
  *
31
- * Runs after the session row is already gone. Waking the VM and scrubbing a
32
- * large checkout takes minutes, and none of it is something the caller can act
33
- * on the workspace has disappeared from their list either way. Nothing can
34
- * claim the sandbox until `release` publishes it to the pool, so deferring the
35
- * whole sequence preserves the scrub-before-reuse guarantee.
7
+ * Sandbox identity is the session id, so there is no reuse pool to publish
8
+ * into a reopened session resolves the same id through its provider
9
+ * (reconnect/resume, or a fresh VM whose setup hook re-materializes).
10
+ * Sessions never opened in this replica have no memo entry; their VMs are
11
+ * left to the provider's idle lifecycle (pause / idle GC).
36
12
  */
37
- async function reclaimDeletedSessionSandbox(options) {
38
- const { fleet, sourceControl, session } = options;
39
- if (!session.sandboxId) return;
40
- if (fleet.provider !== "local" && session.sandboxWorkdir) {
41
- await cleanReleasedSandbox({
42
- fleet,
43
- sourceControl,
44
- orgId: session.orgId,
45
- projectRepositoryId: session.projectRepositoryId,
46
- sandboxId: session.sandboxId,
47
- sandboxWorkdir: session.sandboxWorkdir,
48
- actingUserId: session.userId
49
- });
50
- await sourceControl.sandboxPool.release({
51
- orgId: session.orgId,
52
- projectRepositoryId: session.projectRepositoryId,
53
- userId: session.userId,
54
- sandboxId: session.sandboxId,
55
- sandboxWorkdir: session.sandboxWorkdir
56
- });
13
+ async function releaseSessionSandbox(options) {
14
+ const entry = peekSessionSandbox(options.sessionId);
15
+ if (!entry) return;
16
+ evictSessionSandbox(options.sessionId);
17
+ const sandbox = entry.sandbox;
18
+ if (options.destroy) {
19
+ await (sandbox._destroy ? sandbox._destroy() : sandbox.destroy?.());
57
20
  return;
58
21
  }
59
- let sandbox;
60
- try {
61
- sandbox = await fleet.reattachSandbox(session.sandboxId, { actingUserId: session.userId });
62
- } catch {}
63
- await fleet.teardownSandbox({
64
- sandboxId: session.sandboxId,
65
- setSandboxId: async () => {},
66
- clear: async () => {}
67
- }, sandbox);
22
+ await (sandbox._stop ? sandbox._stop() : sandbox.stop?.());
68
23
  }
69
24
  /**
70
- * Release the sandboxes held by a work item's sessions back to the reuse pool.
71
- *
72
- * Called when the item commits into a terminal stage (`done` / `canceled`):
73
- * its branch sessions stop receiving runs, so their VMs — which would
74
- * otherwise idle until the provider reaps them — can serve the next session
75
- * for the same repository instead of a fresh provision. Each session
76
- * keeps its row (a reopened branch simply claims a pooled VM or provisions
77
- * fresh on next use); it only loses its sandbox binding.
25
+ * Tear down the sandbox a just-deleted user session was holding. The row is
26
+ * already gone, so the VM is destroyed rather than stopped — nothing will
27
+ * ever resolve this session id again.
78
28
  */
79
- async function releaseWorkItemSandboxes(options) {
80
- const { workItems, sourceControl } = options;
81
- const item = await workItems.get({
82
- orgId: options.orgId,
83
- id: options.workItemId
29
+ async function reclaimDeletedSessionSandbox(options) {
30
+ await releaseSessionSandbox({
31
+ sessionId: options.session.id,
32
+ destroy: true
84
33
  });
85
- if (!item) return;
86
- const sessionIds = [...new Set(Object.values(item.sessions).map((session) => session.sessionId))];
87
- for (const sessionId of sessionIds) {
88
- const session = await sourceControl.sessions.getBySessionId(sessionId);
89
- if (!session || session.orgId !== options.orgId) continue;
90
- if (!session.sandboxId || !session.sandboxWorkdir) continue;
91
- await cleanReleasedSandbox({
92
- fleet: options.fleet,
93
- sourceControl,
94
- orgId: session.orgId,
95
- projectRepositoryId: session.projectRepositoryId,
96
- sandboxId: session.sandboxId,
97
- sandboxWorkdir: session.sandboxWorkdir,
98
- actingUserId: session.userId
99
- });
100
- await sourceControl.sandboxPool.release({
101
- orgId: session.orgId,
102
- projectRepositoryId: session.projectRepositoryId,
103
- userId: session.userId,
104
- sandboxId: session.sandboxId,
105
- sandboxWorkdir: session.sandboxWorkdir
106
- });
107
- await sourceControl.sessions.setSandbox({
108
- id: session.id,
109
- sandboxId: null,
110
- sandboxWorkdir: session.sandboxWorkdir
111
- });
112
- }
113
34
  }
114
35
  //#endregion
115
- export { cleanReleasedSandbox, reclaimDeletedSessionSandbox, releaseWorkItemSandboxes };
36
+ export { reclaimDeletedSessionSandbox, releaseSessionSandbox };
116
37
 
117
38
  //# sourceMappingURL=sandbox-release.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sandbox-release.js","names":[],"sources":["../../../src/integrations/github/sandbox-release.ts"],"sourcesContent":["import type { MaterializationSandbox, SandboxFleet } from '../../sandbox/fleet.js';\nimport type { SourceControlSession, SourceControlStorageHandle } from '../../storage/domains/source-control/base.js';\nimport type { WorkItemsStorage } from '../../storage/domains/work-items/base.js';\nimport { recycleClaimedWorkdir } from './sandbox.js';\n\n/**\n * Scrub a sandbox that is about to enter the reuse pool: force-checkout the\n * default branch and drop the released session's local state, so idle pooled\n * VMs don't sit on stale branches, dirty worktrees, or abandoned work while\n * they wait for the next claim. Best-effort the VM may already be reaped\n * (the pooled claim then falls back to fresh provisioning) and the claim\n * path recycles the workdir again before reuse, so a failed scrub never\n * blocks the release.\n */\nexport async function cleanReleasedSandbox(options: {\n fleet: Pick<SandboxFleet, 'reattachSandbox'>;\n sourceControl: Pick<SourceControlStorageHandle, 'projectRepositories' | 'repositories'>;\n orgId: string;\n projectRepositoryId: string;\n sandboxId: string;\n sandboxWorkdir: string;\n actingUserId: string;\n sandbox?: MaterializationSandbox;\n}): Promise<void> {\n try {\n const projectRepository = await options.sourceControl.projectRepositories.get({\n orgId: options.orgId,\n id: options.projectRepositoryId,\n });\n if (!projectRepository) return;\n const repository = await options.sourceControl.repositories.get({\n orgId: options.orgId,\n id: projectRepository.repositoryId,\n });\n if (!repository) return;\n const sandbox =\n options.sandbox ??\n (await options.fleet.reattachSandbox(options.sandboxId, {\n actingUserId: options.actingUserId,\n }));\n await recycleClaimedWorkdir(sandbox, options.sandboxWorkdir, repository.defaultBranch);\n } catch {\n // Reaped, unreachable, or wedged — the claim-side recycle is the\n // correctness guarantee; this scrub is hygiene for idle VMs.\n }\n}\n\n/**\n * Reclaim the sandbox a just-deleted user session was holding: return a remote\n * VM to the reuse pool (scrubbed first), or tear a local/unpooled one down.\n *\n * Runs after the session row is already gone. Waking the VM and scrubbing a\n * large checkout takes minutes, and none of it is something the caller can act\n * on — the workspace has disappeared from their list either way. Nothing can\n * claim the sandbox until `release` publishes it to the pool, so deferring the\n * whole sequence preserves the scrub-before-reuse guarantee.\n */\nexport async function reclaimDeletedSessionSandbox(options: {\n fleet: Pick<SandboxFleet, 'provider' | 'reattachSandbox' | 'teardownSandbox'>;\n sourceControl: Pick<SourceControlStorageHandle, 'sandboxPool' | 'projectRepositories' | 'repositories'>;\n session: Pick<SourceControlSession, 'orgId' | 'userId' | 'projectRepositoryId' | 'sandboxId' | 'sandboxWorkdir'>;\n}): Promise<void> {\n const { fleet, sourceControl, session } = options;\n if (!session.sandboxId) return;\n if (fleet.provider !== 'local' && session.sandboxWorkdir) {\n // Keep the remote VM alive: return it to the reuse pool so the next\n // session for this repository link and user claims it (repo already\n // cloned) instead of provisioning a fresh sandbox. Scrub the session's\n // work off the VM first so it doesn't idle with stale branches or dirty\n // state, and so nothing claims it mid-scrub.\n await cleanReleasedSandbox({\n fleet,\n sourceControl,\n orgId: session.orgId,\n projectRepositoryId: session.projectRepositoryId,\n sandboxId: session.sandboxId,\n sandboxWorkdir: session.sandboxWorkdir,\n actingUserId: session.userId,\n });\n await sourceControl.sandboxPool.release({\n orgId: session.orgId,\n projectRepositoryId: session.projectRepositoryId,\n userId: session.userId,\n sandboxId: session.sandboxId,\n sandboxWorkdir: session.sandboxWorkdir,\n });\n return;\n }\n let sandbox: MaterializationSandbox | undefined;\n try {\n sandbox = await fleet.reattachSandbox(session.sandboxId, { actingUserId: session.userId });\n } catch {\n // The provider may already have reclaimed the sandbox.\n }\n // The session row is deleted, so there is no binding left to clear.\n await fleet.teardownSandbox(\n { sandboxId: session.sandboxId, setSandboxId: async () => {}, clear: async () => {} },\n sandbox,\n );\n}\n\n/**\n * Release the sandboxes held by a work item's sessions back to the reuse pool.\n *\n * Called when the item commits into a terminal stage (`done` / `canceled`):\n * its branch sessions stop receiving runs, so their VMs which would\n * otherwise idle until the provider reaps them can serve the next session\n * for the same repository instead of a fresh provision. Each session\n * keeps its row (a reopened branch simply claims a pooled VM or provisions\n * fresh on next use); it only loses its sandbox binding.\n */\nexport async function releaseWorkItemSandboxes(options: {\n workItems: Pick<WorkItemsStorage, 'get'>;\n sourceControl: Pick<SourceControlStorageHandle, 'sessions' | 'sandboxPool' | 'projectRepositories' | 'repositories'>;\n fleet: Pick<SandboxFleet, 'reattachSandbox'>;\n orgId: string;\n workItemId: string;\n}): Promise<void> {\n const { workItems, sourceControl } = options;\n const item = await workItems.get({ orgId: options.orgId, id: options.workItemId });\n if (!item) return;\n const sessionIds = [...new Set(Object.values(item.sessions).map(session => session.sessionId))];\n for (const sessionId of sessionIds) {\n const session = await sourceControl.sessions.getBySessionId(sessionId);\n if (!session || session.orgId !== options.orgId) continue;\n if (!session.sandboxId || !session.sandboxWorkdir) continue;\n await cleanReleasedSandbox({\n fleet: options.fleet,\n sourceControl,\n orgId: session.orgId,\n projectRepositoryId: session.projectRepositoryId,\n sandboxId: session.sandboxId,\n sandboxWorkdir: session.sandboxWorkdir,\n actingUserId: session.userId,\n });\n await sourceControl.sandboxPool.release({\n orgId: session.orgId,\n projectRepositoryId: session.projectRepositoryId,\n userId: session.userId,\n sandboxId: session.sandboxId,\n sandboxWor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OAAO,YAAY,CAAC;CAAE,GACpF,OACF;AACF;;;;;;;;;;;AAYA,eAAsB,yBAAyB,SAM7B;CAChB,MAAM,EAAE,WAAW,kBAAkB;CACrC,MAAM,OAAO,MAAM,UAAU,IAAI;EAAE,OAAO,QAAQ;EAAO,IAAI,QAAQ;CAAW,CAAC;CACjF,IAAI,CAAC,MAAM;CACX,MAAM,aAAa,CAAC,GAAG,IAAI,IAAI,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,KAAI,YAAW,QAAQ,SAAS,CAAC,CAAC;CAC9F,KAAK,MAAM,aAAa,YAAY;EAClC,MAAM,UAAU,MAAM,cAAc,SAAS,eAAe,SAAS;EACrE,IAAI,CAAC,WAAW,QAAQ,UAAU,QAAQ,OAAO;EACjD,IAAI,CAAC,QAAQ,aAAa,CAAC,QAAQ,gBAAgB;EACnD,MAAM,qBAAqB;GACzB,OAAO,QAAQ;GACf;GACA,OAAO,QAAQ;GACf,qBAAqB,QAAQ;GAC7B,WAAW,QAAQ;GACnB,gBAAgB,QAAQ;GACxB,cAAc,QAAQ;EACxB,CAAC;EACD,MAAM,cAAc,YAAY,QAAQ;GACtC,OAAO,QAAQ;GACf,qBAAqB,QAAQ;GAC7B,QAAQ,QAAQ;GAChB,WAAW,QAAQ;GACnB,gBAAgB,QAAQ;EAC1B,CAAC;EACD,MAAM,cAAc,SAAS,WAAW;GACtC,IAAI,QAAQ;GACZ,WAAW;GACX,gBAAgB,QAAQ;EAC1B,CAAC;CACH;AACF"}
1
+ {"version":3,"file":"sandbox-release.js","names":[],"sources":["../../../src/integrations/github/sandbox-release.ts"],"sourcesContent":["import { evictSessionSandbox, peekSessionSandbox } from '../../sandbox/session-sandbox.js';\n\n/**\n * Stop or destroy the sandbox a session holds in this process, dropping it\n * from the per-process memo first so later opens construct fresh.\n *\n * Sandbox identity is the session id, so there is no reuse pool to publish\n * into a reopened session resolves the same id through its provider\n * (reconnect/resume, or a fresh VM whose setup hook re-materializes).\n * Sessions never opened in this replica have no memo entry; their VMs are\n * left to the provider's idle lifecycle (pause / idle GC).\n */\nexport async function releaseSessionSandbox(options: {\n /** The session's storage row id (the sandbox identity). */\n sessionId: string;\n /** Destroy instead of stop for sessions that are gone for good. */\n destroy?: boolean;\n}): Promise<void> {\n const entry = peekSessionSandbox(options.sessionId);\n if (!entry) return;\n evictSessionSandbox(options.sessionId);\n const sandbox = entry.sandbox as unknown as {\n _stop?: () => Promise<void>;\n _destroy?: () => Promise<void>;\n stop?: () => Promise<void>;\n destroy?: () => Promise<void>;\n };\n if (options.destroy) {\n await (sandbox._destroy ? sandbox._destroy() : sandbox.destroy?.());\n return;\n }\n await (sandbox._stop ? sandbox._stop() : sandbox.stop?.());\n}\n\n/**\n * Tear down the sandbox a just-deleted user session was holding. The row is\n * already gone, so the VM is destroyed rather than stoppednothing will\n * ever resolve this session id again.\n */\nexport async function reclaimDeletedSessionSandbox(options: {\n session: Pick<import('../../storage/domains/source-control/base.js').SourceControlSession, 'id'>;\n}): Promise<void> {\n await releaseSessionSandbox({ sessionId: options.session.id, destroy: true });\n}\n"],"mappings":";;;;;;;;;;;;AAYA,eAAsB,sBAAsB,SAK1B;CAChB,MAAM,QAAQ,mBAAmB,QAAQ,SAAS;CAClD,IAAI,CAAC,OAAO;CACZ,oBAAoB,QAAQ,SAAS;CACrC,MAAM,UAAU,MAAM;CAMtB,IAAI,QAAQ,SAAS;EACnB,OAAO,QAAQ,WAAW,QAAQ,SAAS,IAAI,QAAQ,UAAU;EACjE;CACF;CACA,OAAO,QAAQ,QAAQ,QAAQ,MAAM,IAAI,QAAQ,OAAO;AAC1D;;;;;;AAOA,eAAsB,6BAA6B,SAEjC;CAChB,MAAM,sBAAsB;EAAE,WAAW,QAAQ,QAAQ;EAAI,SAAS;CAAK,CAAC;AAC9E"}
@@ -1,57 +1,25 @@
1
1
  /**
2
2
  * Repo materialization for GitHub-backed repositories.
3
3
  *
4
- * A GitHub repo is never cloned onto the server host. Instead each project gets
5
- * its own isolated sandbox (provisioned by the fleet in `../sandbox/fleet`) and
6
- * the repo is cloned *inside* that sandbox. The agent's file tools and command
7
- * tools then operate entirely against the remote checkout.
4
+ * A GitHub repo is never cloned onto the server host. The repo is cloned
5
+ * *inside* the session's sandbox, so the agent's file tools and command tools
6
+ * operate entirely against the remote checkout.
8
7
  *
9
- * - `ensureProjectSandbox(row)` / `teardownProjectSandbox(row)` bind the fleet's
10
- * provision/reattach/teardown lifecycle to the per-(project,user) sandbox row.
11
8
  * - `materializeRepo(row, token)` runs `git clone` (first open) or `git pull`
12
9
  * (re-open) inside the sandbox, using a short-lived installation token that is
13
10
  * scrubbed from the git remote afterwards so it never persists in the VM.
14
11
  *
15
- * This module owns everything git/GitHub: clone/pull, commit/push, worktrees,
16
- * and `gh pr create`. Sandbox provisioning, budgets, and workdir layout live in
17
- * the fleet module.
12
+ * This module owns everything git/GitHub: clone/pull, commit/push, setup/teardown commands,
13
+ * and `gh pr create`. Workdir layout lives in `../sandbox/workdir`.
18
14
  */
19
- import type { MaterializationSandbox, ProgressFn, SandboxCommandResult, SandboxFleet } from '../../sandbox/fleet.js';
20
- import type { ProjectRepositorySandbox, SourceControlStorageHandle } from '../../storage/domains/source-control/base.js';
21
- type SourceControlSandboxStorage = SourceControlStorageHandle['sandboxes'];
22
- type MaterializationStore = Pick<SourceControlSandboxStorage, 'markMaterialized'>;
15
+ import type { ExecutableSandbox, SandboxCommandResult } from '../../sandbox/materialization.js';
16
+ import type { SourceControlStorageHandle } from '../../storage/domains/source-control/base.js';
17
+ type MaterializationStore = Pick<SourceControlStorageHandle['sessions'], 'markMaterialized'>;
23
18
  interface RepoMaterializationBinding {
24
19
  id: string;
25
20
  sandboxWorkdir: string;
26
21
  materializedAt: Date | null;
27
22
  }
28
- /**
29
- * Provision a new sandbox (persisting its provider id on first open) or
30
- * reattach to the stored one. Returns a started, live sandbox.
31
- */
32
- export declare function ensureProjectSandbox(options: {
33
- fleet: SandboxFleet;
34
- row: ProjectRepositorySandbox;
35
- storage: SourceControlSandboxStorage;
36
- token: string;
37
- onProgress?: ProgressFn;
38
- /** Repo base checkpoint to seed a fresh provision from (boot-only). */
39
- seedCheckpointName?: string;
40
- }): Promise<MaterializationSandbox>;
41
- /**
42
- * Tear down a user's sandbox for a project: stop the live VM (best-effort) and
43
- * clear the persisted `sandboxId`/`materializedAt` on the per-(project,user)
44
- * binding row so the next open re-provisions cleanly.
45
- *
46
- * @param row the per-(project,user) sandbox binding to tear down
47
- * @param sandbox an already-reattached live sandbox to stop, when available
48
- */
49
- export declare function teardownProjectSandbox(options: {
50
- fleet: SandboxFleet;
51
- row: ProjectRepositorySandbox;
52
- storage: SourceControlSandboxStorage;
53
- sandbox?: MaterializationSandbox;
54
- }): Promise<void>;
55
23
  /**
56
24
  * Single-quote a string for safe POSIX shell interpolation. Wraps the value in
57
25
  * single quotes and escapes any embedded single quote using the canonical
@@ -82,7 +50,7 @@ interface ShOptions {
82
50
  * to re-run. Hang-guard timeouts are NOT retried — the budget applies to the
83
51
  * command as a whole.
84
52
  */
85
- export declare function sh(sandbox: MaterializationSandbox, script: string, options?: ShOptions): Promise<SandboxCommandResult>;
53
+ export declare function sh(sandbox: ExecutableSandbox, script: string, options?: ShOptions): Promise<SandboxCommandResult>;
86
54
  /** Error raised when the sandbox cannot materialize the repo (actionable). */
87
55
  export declare class MaterializeError extends Error {
88
56
  readonly code: 'git-missing' | 'egress-blocked' | 'clone-failed' | 'pull-failed' | 'push-failed' | 'commit-failed' | 'gh-missing' | 'pr-failed';
@@ -95,47 +63,24 @@ export interface RepoMaterializeInfo {
95
63
  }
96
64
  /** Options for {@link materializeRepo}. */
97
65
  export interface MaterializeRepoOptions {
98
- /** The per-(project,user) sandbox binding (provisioned via `ensureProjectSandbox`). */
66
+ /** The per-(project,user) sandbox binding whose workdir this materializes into. */
99
67
  row: RepoMaterializationBinding;
100
68
  /** Repo metadata from the org-owned project row. */
101
69
  repoInfo: RepoMaterializeInfo;
102
70
  /** The live sandbox to run git inside. */
103
- sandbox: MaterializationSandbox;
71
+ sandbox: ExecutableSandbox;
104
72
  /** A freshly minted, short-lived installation access token. */
105
73
  token: string;
106
74
  storage: MaterializationStore;
107
- onProgress?: ProgressFn;
108
- /**
109
- * Skip the default-branch `git pull --ff-only` when the workdir already
110
- * holds a checkout. Set when the checkout was just seeded from a fresh base
111
- * checkpoint (rebuilt on every default-branch push), where the pull is
112
- * redundant network cost: session work happens on a branch that
113
- * `checkoutSessionBranch` fetches fresh regardless.
114
- */
115
- skipPullOnExistingCheckout?: boolean;
116
75
  }
117
76
  /**
118
77
  * Materialize the repo inside the user's sandbox. Clones on first open, pulls on
119
78
  * re-open. Always scrubs the install token from the remote afterwards and sets
120
79
  * `materialized_at` on the per-user sandbox binding row.
121
- *
122
80
  */
123
81
  export declare function materializeRepo(options: MaterializeRepoOptions): Promise<void>;
124
- /**
125
- * Reset a pooled workdir that a new session just claimed: the previous
126
- * session's branch and dirty state must not leak into the new session, so
127
- * force-checkout the default branch, drop all local modifications, and delete
128
- * every other local branch (a surviving branch would otherwise hand the next
129
- * session for the same branch the previous session's stale tip instead of a
130
- * fresh fork from the base branch). When the claimed VM was reaped and
131
- * re-provisioned there is no checkout yet and this is a no-op (the clone path
132
- * handles it). A wedged checkout falls back to wiping the workdir so
133
- * `materializeRepo` re-clones inside the same VM instead of permanently
134
- * failing the session.
135
- */
136
- export declare function recycleClaimedWorkdir(sandbox: MaterializationSandbox, workdir: string, defaultBranch: string): Promise<void>;
137
82
  /** Check out a session's branch inside its isolated repository clone. */
138
- export declare function checkoutSessionBranch(sandbox: MaterializationSandbox, workdir: string, options: {
83
+ export declare function checkoutSessionBranch(sandbox: ExecutableSandbox, workdir: string, options: {
139
84
  branch: string;
140
85
  baseBranch: string;
141
86
  token: string;
@@ -146,7 +91,7 @@ export declare function checkoutSessionBranch(sandbox: MaterializationSandbox, w
146
91
  * this exact repo. Matches both the clean and token-auth URL forms; any other
147
92
  * remote (or no git dir at all) falls back to the clone path.
148
93
  */
149
- export declare function hasExistingCheckout(sandbox: MaterializationSandbox, workdir: string, repoFullName: string): Promise<boolean>;
94
+ export declare function hasExistingCheckout(sandbox: ExecutableSandbox, workdir: string, repoFullName: string): Promise<boolean>;
150
95
  /**
151
96
  * Validate a git ref (branch) name. Server-side defense-in-depth: only allow a
152
97
  * conservative character set so a branch can never be built into a shell
@@ -173,7 +118,7 @@ export declare function resolveGitIdentity(identity: GitIdentity): {
173
118
  * Configure `user.name` / `user.email` for the given repo working tree inside
174
119
  * the sandbox so commits are authored correctly. Values are shell-quoted.
175
120
  */
176
- export declare function configureGitIdentity(sandbox: MaterializationSandbox, workdir: string, identity: GitIdentity): Promise<void>;
121
+ export declare function configureGitIdentity(sandbox: ExecutableSandbox, workdir: string, identity: GitIdentity): Promise<void>;
177
122
  /**
178
123
  * Temporarily rewrite `origin` to a tokenized URL, run `fn` (e.g. a push), and
179
124
  * **always** scrub the remote back to the tokenless URL afterwards. The token
@@ -186,14 +131,14 @@ export declare function configureGitIdentity(sandbox: MaterializationSandbox, wo
186
131
  * Only a failed set-url (the token never reached the remote) downgrades the
187
132
  * scrub to best-effort.
188
133
  */
189
- export declare function withInstallToken<T>(sandbox: MaterializationSandbox, workdir: string, repoFullName: string, token: string, fn: () => Promise<T>): Promise<T>;
134
+ export declare function withInstallToken<T>(sandbox: ExecutableSandbox, workdir: string, repoFullName: string, token: string, fn: () => Promise<T>): Promise<T>;
190
135
  /**
191
136
  * Push a branch back to GitHub from inside the sandbox using a short-lived
192
137
  * installation token. The branch is ref-validated, the token is injected only
193
138
  * into the remote URL via `withInstallToken`, and egress failures are
194
139
  * classified into actionable errors.
195
140
  */
196
- export declare function pushBranch(sandbox: MaterializationSandbox, workdir: string, branch: string, token: string, repoFullName: string): Promise<void>;
141
+ export declare function pushBranch(sandbox: ExecutableSandbox, workdir: string, branch: string, token: string, repoFullName: string): Promise<void>;
197
142
  export interface CommitResult {
198
143
  /** True when a commit was created; false when there was nothing to commit. */
199
144
  committed: boolean;
@@ -205,85 +150,26 @@ export interface CommitResult {
205
150
  * error, so callers can safely commit-then-push without first diffing.
206
151
  *
207
152
  * @param sandbox the live sandbox containing the checkout
208
- * @param workdir the worktree (or repo) path to commit in
153
+ * @param workdir the session workdir to commit in
209
154
  * @param message the commit message (quoted; arbitrary text is safe)
210
155
  * @param identity authorship identity for the commit
211
156
  */
212
- export declare function commitAll(sandbox: MaterializationSandbox, workdir: string, message: string, identity: GitIdentity): Promise<CommitResult>;
213
- /** Error raised when a worktree cannot be created/reused inside the sandbox. */
214
- export declare class WorktreeError extends Error {
215
- readonly code: 'invalid-branch' | 'worktree-failed' | 'setup-failed' | 'teardown-failed';
216
- constructor(message: string, code: 'invalid-branch' | 'worktree-failed' | 'setup-failed' | 'teardown-failed');
217
- }
218
- /**
219
- * Reduce a (already ref-validated) branch name to a filesystem-safe directory
220
- * segment for the worktree path: slashes/dots/unsafe chars collapsed to `-`.
221
- * This only affects the *directory name*, never the git branch itself.
222
- *
223
- * Sanitization is lossy (e.g. `feat/a` and `feat-a` both reduce to `feat-a`),
224
- * so an 8-char hash of the original branch is appended whenever the sanitized
225
- * form differs from the input. That keeps clean names (`main`) readable while
226
- * guaranteeing distinct branches never share a worktree directory.
227
- */
228
- export declare function safeBranchDir(branch: string): string;
229
- /**
230
- * Compute the absolute worktree path for a branch, server-side only. Worktrees
231
- * live alongside the repo checkout under a sibling `worktrees/` directory so the
232
- * repo's `.git` is shared. Never derived from client-supplied paths.
233
- */
234
- export declare function computeWorktreePath(repoWorkdir: string, branch: string): string;
235
- export interface EnsureWorktreeResult {
236
- worktreePath: string;
237
- branch: string;
238
- baseBranch: string;
239
- /** True when an existing worktree was reused rather than freshly created. */
240
- reused: boolean;
157
+ export declare function commitAll(sandbox: ExecutableSandbox, workdir: string, message: string, identity: GitIdentity): Promise<CommitResult>;
158
+ /** Error raised when the org's setup or teardown command fails in the sandbox. */
159
+ export declare class SetupCommandError extends Error {
160
+ readonly code: 'setup-failed' | 'teardown-failed';
161
+ constructor(message: string, code: 'setup-failed' | 'teardown-failed');
241
162
  }
242
- /**
243
- * Create (or reuse) a git worktree + branch inside the sandbox for a unit of
244
- * work. Idempotent: if a worktree already exists at the computed path it is
245
- * reused. The branch is created from the freshly fetched `origin/<baseBranch>`
246
- * — never the sandbox's possibly stale local ref — so new worktrees always
247
- * start from the latest remote state.
248
- *
249
- * @param sandbox live sandbox containing the base checkout
250
- * @param repoWorkdir the base repo checkout path inside the sandbox
251
- * @param branch the feature branch (ref-validated server-side)
252
- * @param baseBranch the branch to fork from (ref-validated; defaults to the repo's default branch)
253
- * @param token short-lived installation token used only for the base-branch fetch
254
- * @param repoFullName `owner/repo` used to build the tokenized remote URL
255
- */
256
- export declare function ensureWorktree(sandbox: MaterializationSandbox, repoWorkdir: string, { branch, baseBranch, token, repoFullName, }: {
257
- branch: string;
258
- baseBranch: string;
259
- token: string;
260
- repoFullName: string;
261
- }): Promise<EnsureWorktreeResult>;
262
- export declare function runWorktreeSetup(sandbox: MaterializationSandbox, worktreePath: string, command: string): Promise<void>;
163
+ export declare function runSetupCommand(sandbox: ExecutableSandbox, workdir: string, command: string): Promise<void>;
263
164
  /**
264
165
  * Run the repository's best-effort teardown command from the materialized
265
166
  * session workdir. Callers own lifecycle policy: this helper reports failures
266
167
  * so the retirement coordinator can log them while still continuing with
267
168
  * scrub, pooling/destruction, cache invalidation, and row deletion.
268
169
  */
269
- export declare function runWorktreeTeardown(sandbox: MaterializationSandbox, worktreePath: string, command: string, options?: {
170
+ export declare function runTeardownCommand(sandbox: ExecutableSandbox, workdir: string, command: string, options?: {
270
171
  timeoutMs?: number;
271
172
  }): Promise<void>;
272
- /**
273
- * Remove a worktree (and its local feature branch) from the sandbox. The
274
- * checkout is removed with `--force` — the caller owns confirming that any
275
- * uncommitted work in it can be discarded. Idempotent: a worktree whose
276
- * directory is already gone only has its metadata pruned.
277
- *
278
- * @param sandbox live sandbox containing the base checkout
279
- * @param repoWorkdir the base repo checkout path inside the sandbox
280
- * @param branch the worktree's feature branch (ref-validated)
281
- * @param worktreePath the persisted, server-computed worktree path
282
- */
283
- export declare function removeWorktree(sandbox: MaterializationSandbox, repoWorkdir: string, { branch, worktreePath }: {
284
- branch: string;
285
- worktreePath: string;
286
- }): Promise<void>;
287
173
  export interface CreatePullRequestArgs {
288
174
  /** Short-lived installation token, injected only into the `gh` process env. */
289
175
  token: string;
@@ -309,6 +195,6 @@ export interface CreatePullRequestResult {
309
195
  * @param sandbox live sandbox containing the checkout
310
196
  * @param workdir the worktree (or repo) path the PR head branch is checked out in
311
197
  */
312
- export declare function createPullRequest(sandbox: MaterializationSandbox, workdir: string, { token, base, head, title, body }: CreatePullRequestArgs): Promise<CreatePullRequestResult>;
198
+ export declare function createPullRequest(sandbox: ExecutableSandbox, workdir: string, { token, base, head, title, body }: CreatePullRequestArgs): Promise<CreatePullRequestResult>;
313
199
  export {};
314
200
  //# sourceMappingURL=sandbox.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../../../src/integrations/github/sandbox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH,OAAO,KAAK,EACV,sBAAsB,EACtB,UAAU,EAEV,oBAAoB,EACpB,YAAY,EACb,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,8CAA8C,CAAC;AAGtD,KAAK,2BAA2B,GAAG,0BAA0B,CAAC,WAAW,CAAC,CAAC;AAC3E,KAAK,oBAAoB,GAAG,IAAI,CAAC,2BAA2B,EAAE,kBAAkB,CAAC,CAAC;AAElF,UAAU,0BAA0B;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,IAAI,GAAG,IAAI,CAAC;CAC7B;AAoBD;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,OAAO,EAAE;IAClD,KAAK,EAAE,YAAY,CAAC;IACpB,GAAG,EAAE,wBAAwB,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