@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
@@ -64,25 +64,10 @@ export interface ProjectRepository {
64
64
  sandboxProvider: string;
65
65
  sandboxWorkdir: string;
66
66
  setupCommand: string | null;
67
- /** Base checkpoint metadata — set by the base-checkpoint build job. */
68
- baseCheckpoint: ProjectRepositoryBaseCheckpoint | null;
69
67
  teardownCommand: string | null;
70
68
  createdAt: Date;
71
69
  updatedAt: Date;
72
70
  }
73
- /**
74
- * Metadata for a repo's warm base checkpoint (cloned default branch + setup
75
- * command already run). New sessions boot from it instead of a cold clone.
76
- */
77
- export interface ProjectRepositoryBaseCheckpoint {
78
- /** Provider checkpoint name, e.g. `repo-<projectRepositoryId>`. */
79
- name: string;
80
- /** Default-branch HEAD sha the checkpoint was built at. */
81
- sha: string;
82
- builtAt: Date;
83
- /** Hash of the setup command at build time (null when no setup command) — mismatch invalidates the checkpoint. */
84
- setupCommandHash: string | null;
85
- }
86
71
  export interface ExternalRepositoryProjectTarget {
87
72
  orgId: string;
88
73
  factoryProjectId: string;
@@ -111,56 +96,6 @@ export interface UpdateProjectRepositoryInput {
111
96
  setupCommand?: string | null;
112
97
  teardownCommand?: string | null;
113
98
  }
114
- export interface ProjectRepositorySandbox {
115
- id: string;
116
- projectRepositoryId: string;
117
- userId: string;
118
- sandboxId: string | null;
119
- sandboxWorkdir: string;
120
- materializedAt: Date | null;
121
- createdAt: Date;
122
- }
123
- /**
124
- * A provider sandbox that is no longer bound to any session and can be handed
125
- * to the next session for the same project-repository link instead of
126
- * provisioning a fresh VM. Pooling is per-repository, not per-user: no
127
- * credentials are baked into the VM (tokens are injected per command), so any
128
- * user's session can safely claim it. `userId` records who released it,
129
- * purely as provenance.
130
- */
131
- export interface PooledSandbox {
132
- id: string;
133
- orgId: string;
134
- projectRepositoryId: string;
135
- /** User whose session released this sandbox (provenance, not a claim key). */
136
- userId: string;
137
- sandboxId: string;
138
- sandboxWorkdir: string;
139
- releasedAt: Date;
140
- }
141
- export interface ReleasePooledSandboxInput {
142
- orgId: string;
143
- projectRepositoryId: string;
144
- userId: string;
145
- sandboxId: string;
146
- sandboxWorkdir: string;
147
- }
148
- export interface SourceControlWorktree {
149
- id: string;
150
- projectRepositoryId: string;
151
- userId: string;
152
- branch: string;
153
- baseBranch: string;
154
- worktreePath: string;
155
- createdAt: Date;
156
- }
157
- export interface UpsertSourceControlWorktreeInput {
158
- projectRepositoryId: string;
159
- userId: string;
160
- branch: string;
161
- baseBranch: string;
162
- worktreePath: string;
163
- }
164
99
  /**
165
100
  * Who can open a session: 'org' sessions are visible to every member of the
166
101
  * owning organization, 'private' sessions only to their owner. Stored at
@@ -291,90 +226,11 @@ export interface SourceControlStorageHandle {
291
226
  id: string;
292
227
  input: UpdateProjectRepositoryInput;
293
228
  }): Promise<ProjectRepository | null>;
294
- /**
295
- * Record (or clear, with `checkpoint: null`) the repo's base-checkpoint
296
- * metadata after a build job snapshots the prepared workdir. Writes from a
297
- * build are ignored when the setup command changed while it was running.
298
- */
299
- setBaseCheckpoint(args: {
300
- id: string;
301
- checkpoint: null;
302
- } | {
303
- id: string;
304
- checkpoint: ProjectRepositoryBaseCheckpoint;
305
- expectedSetupCommand: string | null;
306
- }): Promise<void>;
307
229
  unlink(args: {
308
230
  orgId: string;
309
231
  id: string;
310
232
  }): Promise<boolean>;
311
233
  };
312
- readonly sandboxes: {
313
- getOrCreate(args: {
314
- projectRepository: ProjectRepository;
315
- userId: string;
316
- }): Promise<ProjectRepositorySandbox>;
317
- getById(args: {
318
- id: string;
319
- }): Promise<ProjectRepositorySandbox | null>;
320
- /**
321
- * Point the binding at a new workdir and clear `materializedAt` — a moved
322
- * workdir means the checkout must be re-cloned. Used to heal bindings whose
323
- * inherited workdir went stale (e.g. the sandbox provider changed).
324
- */
325
- setWorkdir(args: {
326
- id: string;
327
- sandboxWorkdir: string;
328
- }): Promise<void>;
329
- setSandboxId(args: {
330
- id: string;
331
- sandboxId: string;
332
- }): Promise<void>;
333
- clearBinding(args: {
334
- id: string;
335
- }): Promise<void>;
336
- markMaterialized(args: {
337
- id: string;
338
- }): Promise<void>;
339
- };
340
- readonly sandboxPool: {
341
- /**
342
- * Return a sandbox to the reuse pool. Idempotent per provider sandbox ID —
343
- * releasing the same sandbox twice keeps one pool row.
344
- */
345
- release(args: ReleasePooledSandboxInput): Promise<void>;
346
- /**
347
- * Atomically take one pooled sandbox for the given project-repository
348
- * link, preferring the most recently released (warmest) VM. Returns
349
- * `null` when the pool is empty. Each pooled sandbox is handed to exactly
350
- * one claimer even under concurrent claims.
351
- */
352
- claim(args: {
353
- projectRepositoryId: string;
354
- }): Promise<PooledSandbox | null>;
355
- };
356
- readonly worktrees: {
357
- upsert(args: UpsertSourceControlWorktreeInput): Promise<void>;
358
- list(args: {
359
- projectRepositoryId: string;
360
- userId: string;
361
- }): Promise<SourceControlWorktree[]>;
362
- get(args: {
363
- projectRepositoryId: string;
364
- userId: string;
365
- branch: string;
366
- }): Promise<SourceControlWorktree | null>;
367
- findByPath(args: {
368
- projectRepositoryId: string;
369
- userId: string;
370
- worktreePath: string;
371
- }): Promise<SourceControlWorktree | null>;
372
- delete(args: {
373
- projectRepositoryId: string;
374
- userId: string;
375
- branch: string;
376
- }): Promise<void>;
377
- };
378
234
  readonly sessions: {
379
235
  /**
380
236
  * Viewer-aware listing: every org-visible session for the repository
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/source-control/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAwB,MAAM,sBAAsB,CAAC;AAClF,OAAO,KAAK,EAAE,gBAAgB,EAAqB,MAAM,sBAAsB,CAAC;AAYhF,qBAAa,oCAAqC,SAAQ,KAAK;;CAK9D;AAED,eAAO,MAAM,sBAAsB,EAAE,gBAAgB,EA6LpD,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CA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BAA0B;CA4dlE"}
@@ -5,9 +5,6 @@ const INSTALLATIONS = "source_control_installations";
5
5
  const REPOSITORIES = "source_control_repositories";
6
6
  const CONNECTIONS = "factory_project_source_control_connections";
7
7
  const PROJECT_REPOSITORIES = "factory_project_repositories";
8
- const SANDBOXES = "source_control_project_repository_sandboxes";
9
- const SANDBOX_POOL = "source_control_sandbox_pool";
10
- const WORKTREES = "source_control_worktrees";
11
8
  const SESSIONS = "source_control_sessions";
12
9
  var SourceControlConnectionNotFoundError = class extends Error {
13
10
  constructor() {
@@ -108,22 +105,6 @@ const SOURCE_CONTROL_SCHEMAS = [
108
105
  type: "text",
109
106
  nullable: true
110
107
  },
111
- base_checkpoint_name: {
112
- type: "text",
113
- nullable: true
114
- },
115
- base_checkpoint_sha: {
116
- type: "text",
117
- nullable: true
118
- },
119
- base_checkpoint_built_at: {
120
- type: "timestamp",
121
- nullable: true
122
- },
123
- base_checkpoint_setup_hash: {
124
- type: "text",
125
- nullable: true
126
- },
127
108
  teardown_command: {
128
109
  type: "text",
129
110
  nullable: true
@@ -140,68 +121,6 @@ const SOURCE_CONTROL_SCHEMAS = [
140
121
  columns: ["connection_id"]
141
122
  }]
142
123
  },
143
- {
144
- name: SANDBOXES,
145
- columns: {
146
- id: { type: "uuid-pk" },
147
- project_repository_id: { type: "text" },
148
- user_id: { type: "text" },
149
- sandbox_id: {
150
- type: "text",
151
- nullable: true
152
- },
153
- sandbox_workdir: { type: "text" },
154
- materialized_at: {
155
- type: "timestamp",
156
- nullable: true
157
- },
158
- created_at: { type: "timestamp" }
159
- },
160
- uniqueIndexes: [{
161
- name: "source_control_project_repository_sandboxes_link_user_unique",
162
- columns: ["project_repository_id", "user_id"]
163
- }]
164
- },
165
- {
166
- name: SANDBOX_POOL,
167
- columns: {
168
- id: { type: "uuid-pk" },
169
- org_id: { type: "text" },
170
- project_repository_id: { type: "text" },
171
- user_id: { type: "text" },
172
- sandbox_id: { type: "text" },
173
- sandbox_workdir: { type: "text" },
174
- released_at: { type: "timestamp" }
175
- },
176
- uniqueIndexes: [{
177
- name: "source_control_sandbox_pool_sandbox_unique",
178
- columns: ["sandbox_id"]
179
- }],
180
- indexes: [{
181
- name: "source_control_sandbox_pool_repository_user_idx",
182
- columns: ["project_repository_id", "user_id"]
183
- }]
184
- },
185
- {
186
- name: WORKTREES,
187
- columns: {
188
- id: { type: "uuid-pk" },
189
- project_repository_id: { type: "text" },
190
- user_id: { type: "text" },
191
- branch: { type: "text" },
192
- base_branch: { type: "text" },
193
- worktree_path: { type: "text" },
194
- created_at: { type: "timestamp" }
195
- },
196
- uniqueIndexes: [{
197
- name: "source_control_worktrees_project_repository_user_branch_unique",
198
- columns: [
199
- "project_repository_id",
200
- "user_id",
201
- "branch"
202
- ]
203
- }]
204
- },
205
124
  {
206
125
  name: SESSIONS,
207
126
  columns: {
@@ -301,50 +220,11 @@ function toProjectRepository(row) {
301
220
  sandboxProvider: row.sandbox_provider,
302
221
  sandboxWorkdir: row.sandbox_workdir,
303
222
  setupCommand: row.setup_command,
304
- baseCheckpoint: row.base_checkpoint_name && row.base_checkpoint_sha && row.base_checkpoint_built_at ? {
305
- name: row.base_checkpoint_name,
306
- sha: row.base_checkpoint_sha,
307
- builtAt: row.base_checkpoint_built_at,
308
- setupCommandHash: row.base_checkpoint_setup_hash ?? null
309
- } : null,
310
223
  teardownCommand: row.teardown_command,
311
224
  createdAt: row.created_at,
312
225
  updatedAt: row.updated_at
313
226
  };
314
227
  }
315
- function toSandbox(row) {
316
- return {
317
- id: row.id,
318
- projectRepositoryId: row.project_repository_id,
319
- userId: row.user_id,
320
- sandboxId: row.sandbox_id,
321
- sandboxWorkdir: row.sandbox_workdir,
322
- materializedAt: row.materialized_at,
323
- createdAt: row.created_at
324
- };
325
- }
326
- function toPooledSandbox(row) {
327
- return {
328
- id: row.id,
329
- orgId: row.org_id,
330
- projectRepositoryId: row.project_repository_id,
331
- userId: row.user_id,
332
- sandboxId: row.sandbox_id,
333
- sandboxWorkdir: row.sandbox_workdir,
334
- releasedAt: row.released_at
335
- };
336
- }
337
- function toWorktree(row) {
338
- return {
339
- id: row.id,
340
- projectRepositoryId: row.project_repository_id,
341
- userId: row.user_id,
342
- branch: row.branch,
343
- baseBranch: row.base_branch,
344
- worktreePath: row.worktree_path,
345
- createdAt: row.created_at
346
- };
347
- }
348
228
  function toSession(row) {
349
229
  return {
350
230
  id: row.id,
@@ -374,9 +254,6 @@ var SourceControlStorage = class extends FactoryStorageDomain {
374
254
  }
375
255
  async dangerouslyClearAll() {
376
256
  await this.ops.deleteMany(SESSIONS, {});
377
- await this.ops.deleteMany(WORKTREES, {});
378
- await this.ops.deleteMany(SANDBOX_POOL, {});
379
- await this.ops.deleteMany(SANDBOXES, {});
380
257
  await this.ops.deleteMany(PROJECT_REPOSITORIES, {});
381
258
  await this.ops.deleteMany(CONNECTIONS, {});
382
259
  await this.ops.deleteMany(REPOSITORIES, {});
@@ -452,16 +329,6 @@ var SourceControlStorage = class extends FactoryStorageDomain {
452
329
  if (!projectRepository) throw new Error("Project repository not found for this integration.");
453
330
  return projectRepository;
454
331
  };
455
- const getSandbox = async (id) => {
456
- const row = await db().findOne(SANDBOXES, { id });
457
- if (!row || !await getProjectRepositoryById(row.project_repository_id)) return null;
458
- return toSandbox(row);
459
- };
460
- const requireSandbox = async (id) => {
461
- const sandbox = await getSandbox(id);
462
- if (!sandbox) throw new Error("Project-repository sandbox not found for this integration.");
463
- return sandbox;
464
- };
465
332
  return {
466
333
  integrationId,
467
334
  installations: {
@@ -630,12 +497,7 @@ var SourceControlStorage = class extends FactoryStorageDomain {
630
497
  id
631
498
  })) return false;
632
499
  const projectRepositories = await db().findMany(PROJECT_REPOSITORIES, { connection_id: id });
633
- for (const projectRepository of projectRepositories) {
634
- await db().deleteMany(SESSIONS, { project_repository_id: projectRepository.id });
635
- await db().deleteMany(WORKTREES, { project_repository_id: projectRepository.id });
636
- await db().deleteMany(SANDBOX_POOL, { project_repository_id: projectRepository.id });
637
- await db().deleteMany(SANDBOXES, { project_repository_id: projectRepository.id });
638
- }
500
+ for (const projectRepository of projectRepositories) await db().deleteMany(SESSIONS, { project_repository_id: projectRepository.id });
639
501
  await db().deleteMany(PROJECT_REPOSITORIES, { connection_id: id });
640
502
  await db().deleteMany(CONNECTIONS, {
641
503
  id,
@@ -741,22 +603,15 @@ var SourceControlStorage = class extends FactoryStorageDomain {
741
603
  }
742
604
  },
743
605
  update: async ({ orgId, id, input }) => {
744
- const existing = await getProjectRepository({
606
+ if (!await getProjectRepository({
745
607
  orgId,
746
608
  id
747
- });
748
- if (!existing) return null;
609
+ })) return null;
749
610
  const patch = { updated_at: /* @__PURE__ */ new Date() };
750
611
  if (input.branch !== void 0) patch.branch = input.branch;
751
612
  if (input.sandboxProvider !== void 0) patch.sandbox_provider = input.sandboxProvider;
752
613
  if (input.sandboxWorkdir !== void 0) patch.sandbox_workdir = input.sandboxWorkdir;
753
614
  if (input.setupCommand !== void 0) patch.setup_command = input.setupCommand;
754
- if (input.setupCommand !== void 0 && input.setupCommand !== existing.setupCommand) {
755
- patch.base_checkpoint_name = null;
756
- patch.base_checkpoint_sha = null;
757
- patch.base_checkpoint_built_at = null;
758
- patch.base_checkpoint_setup_hash = null;
759
- }
760
615
  if (input.teardownCommand !== void 0) patch.teardown_command = input.teardownCommand;
761
616
  await db().updateMany(PROJECT_REPOSITORIES, { id }, patch);
762
617
  return getProjectRepository({
@@ -764,158 +619,16 @@ var SourceControlStorage = class extends FactoryStorageDomain {
764
619
  id
765
620
  });
766
621
  },
767
- setBaseCheckpoint: async (args) => {
768
- await requireProjectRepositoryById(args.id);
769
- await db().updateMany(PROJECT_REPOSITORIES, args.checkpoint ? {
770
- id: args.id,
771
- setup_command: args.expectedSetupCommand
772
- } : { id: args.id }, args.checkpoint ? {
773
- base_checkpoint_name: args.checkpoint.name,
774
- base_checkpoint_sha: args.checkpoint.sha,
775
- base_checkpoint_built_at: args.checkpoint.builtAt,
776
- base_checkpoint_setup_hash: args.checkpoint.setupCommandHash
777
- } : {
778
- base_checkpoint_name: null,
779
- base_checkpoint_sha: null,
780
- base_checkpoint_built_at: null,
781
- base_checkpoint_setup_hash: null
782
- });
783
- },
784
622
  unlink: async ({ orgId, id }) => {
785
623
  if (!await getProjectRepository({
786
624
  orgId,
787
625
  id
788
626
  })) return false;
789
627
  await db().deleteMany(SESSIONS, { project_repository_id: id });
790
- await db().deleteMany(WORKTREES, { project_repository_id: id });
791
- await db().deleteMany(SANDBOX_POOL, { project_repository_id: id });
792
- await db().deleteMany(SANDBOXES, { project_repository_id: id });
793
628
  await db().deleteMany(PROJECT_REPOSITORIES, { id });
794
629
  return true;
795
630
  }
796
631
  },
797
- sandboxes: {
798
- getOrCreate: async ({ projectRepository, userId }) => {
799
- await requireProjectRepositoryById(projectRepository.id);
800
- const where = {
801
- project_repository_id: projectRepository.id,
802
- user_id: userId
803
- };
804
- const existing = await db().findOne(SANDBOXES, where);
805
- if (existing) return toSandbox(existing);
806
- try {
807
- return toSandbox(await db().insertOne(SANDBOXES, {
808
- ...where,
809
- sandbox_id: null,
810
- sandbox_workdir: projectRepository.sandboxWorkdir,
811
- materialized_at: null,
812
- created_at: /* @__PURE__ */ new Date()
813
- }));
814
- } catch (error) {
815
- if (!(error instanceof UniqueViolationError)) throw error;
816
- const row = await db().findOne(SANDBOXES, where);
817
- if (!row) throw error;
818
- return toSandbox(row);
819
- }
820
- },
821
- getById: ({ id }) => getSandbox(id),
822
- setWorkdir: async ({ id, sandboxWorkdir }) => {
823
- await requireSandbox(id);
824
- await db().updateMany(SANDBOXES, { id }, {
825
- sandbox_workdir: sandboxWorkdir,
826
- materialized_at: null
827
- });
828
- },
829
- setSandboxId: async ({ id, sandboxId }) => {
830
- await requireSandbox(id);
831
- await db().updateMany(SANDBOXES, { id }, { sandbox_id: sandboxId });
832
- },
833
- clearBinding: async ({ id }) => {
834
- await requireSandbox(id);
835
- await db().updateMany(SANDBOXES, { id }, {
836
- sandbox_id: null,
837
- materialized_at: null
838
- });
839
- },
840
- markMaterialized: async ({ id }) => {
841
- await requireSandbox(id);
842
- await db().updateMany(SANDBOXES, { id }, { materialized_at: /* @__PURE__ */ new Date() });
843
- }
844
- },
845
- sandboxPool: {
846
- release: async (input) => {
847
- if (!await getProjectRepositoryById(input.projectRepositoryId)) return;
848
- try {
849
- await db().insertOne(SANDBOX_POOL, {
850
- org_id: input.orgId,
851
- project_repository_id: input.projectRepositoryId,
852
- user_id: input.userId,
853
- sandbox_id: input.sandboxId,
854
- sandbox_workdir: input.sandboxWorkdir,
855
- released_at: /* @__PURE__ */ new Date()
856
- });
857
- } catch (error) {
858
- if (!(error instanceof UniqueViolationError)) throw error;
859
- }
860
- },
861
- claim: async ({ projectRepositoryId }) => {
862
- if (!await getProjectRepositoryById(projectRepositoryId)) return null;
863
- const rows = await db().findMany(SANDBOX_POOL, { project_repository_id: projectRepositoryId });
864
- rows.sort((left, right) => right.released_at.getTime() - left.released_at.getTime());
865
- for (const row of rows) if (await db().deleteMany(SANDBOX_POOL, { id: row.id }) === 1) return toPooledSandbox(row);
866
- return null;
867
- }
868
- },
869
- worktrees: {
870
- upsert: async (input) => {
871
- await requireProjectRepositoryById(input.projectRepositoryId);
872
- await db().upsertOne(WORKTREES, [
873
- "project_repository_id",
874
- "user_id",
875
- "branch"
876
- ], {
877
- project_repository_id: input.projectRepositoryId,
878
- user_id: input.userId,
879
- branch: input.branch,
880
- base_branch: input.baseBranch,
881
- worktree_path: input.worktreePath,
882
- created_at: /* @__PURE__ */ new Date()
883
- });
884
- },
885
- list: async ({ projectRepositoryId, userId }) => {
886
- if (!await getProjectRepositoryById(projectRepositoryId)) return [];
887
- return (await db().findMany(WORKTREES, {
888
- project_repository_id: projectRepositoryId,
889
- user_id: userId
890
- })).map(toWorktree);
891
- },
892
- get: async ({ projectRepositoryId, userId, branch }) => {
893
- if (!await getProjectRepositoryById(projectRepositoryId)) return null;
894
- const row = await db().findOne(WORKTREES, {
895
- project_repository_id: projectRepositoryId,
896
- user_id: userId,
897
- branch
898
- });
899
- return row ? toWorktree(row) : null;
900
- },
901
- findByPath: async ({ projectRepositoryId, userId, worktreePath }) => {
902
- if (!await getProjectRepositoryById(projectRepositoryId)) return null;
903
- const row = await db().findOne(WORKTREES, {
904
- project_repository_id: projectRepositoryId,
905
- user_id: userId,
906
- worktree_path: worktreePath
907
- });
908
- return row ? toWorktree(row) : null;
909
- },
910
- delete: async ({ projectRepositoryId, userId, branch }) => {
911
- await requireProjectRepositoryById(projectRepositoryId);
912
- await db().deleteMany(WORKTREES, {
913
- project_repository_id: projectRepositoryId,
914
- user_id: userId,
915
- branch
916
- });
917
- }
918
- },
919
632
  sessions: {
920
633
  list: async ({ projectRepositoryId, viewerUserId }) => {
921
634
  if (!await getProjectRepositoryById(projectRepositoryId)) return [];