@jamesmurdza/opencode-daytona 0.1.21 → 0.1.23

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 (116) hide show
  1. package/.opencode/plugin/daytona/core/logger.d.ts +2 -2
  2. package/.opencode/plugin/daytona/core/logger.js +28 -15
  3. package/.opencode/plugin/daytona/core/logger.js.map +1 -1
  4. package/.opencode/plugin/daytona/core/project-data-storage.d.ts +11 -7
  5. package/.opencode/plugin/daytona/core/project-data-storage.js +84 -43
  6. package/.opencode/plugin/daytona/core/project-data-storage.js.map +1 -1
  7. package/.opencode/plugin/daytona/core/session-manager.d.ts +5 -2
  8. package/.opencode/plugin/daytona/core/session-manager.js +113 -60
  9. package/.opencode/plugin/daytona/core/session-manager.js.map +1 -1
  10. package/.opencode/plugin/daytona/core/toast.d.ts +47 -0
  11. package/.opencode/plugin/daytona/core/toast.js +73 -0
  12. package/.opencode/plugin/daytona/core/toast.js.map +1 -0
  13. package/.opencode/plugin/daytona/core/types.d.ts +10 -8
  14. package/.opencode/plugin/daytona/core/types.js +10 -6
  15. package/.opencode/plugin/daytona/core/types.js.map +1 -1
  16. package/.opencode/plugin/daytona/git/host-git-manager.d.ts +34 -7
  17. package/.opencode/plugin/daytona/git/host-git-manager.js +254 -68
  18. package/.opencode/plugin/daytona/git/host-git-manager.js.map +1 -1
  19. package/.opencode/plugin/daytona/git/index.d.ts +4 -1
  20. package/.opencode/plugin/daytona/git/index.js +9 -1
  21. package/.opencode/plugin/daytona/git/index.js.map +1 -1
  22. package/.opencode/plugin/daytona/git/sandbox-git-manager.d.ts +5 -1
  23. package/.opencode/plugin/daytona/git/sandbox-git-manager.js +23 -12
  24. package/.opencode/plugin/daytona/git/sandbox-git-manager.js.map +1 -1
  25. package/.opencode/plugin/daytona/git/session-git-manager.d.ts +19 -3
  26. package/.opencode/plugin/daytona/git/session-git-manager.js +80 -43
  27. package/.opencode/plugin/daytona/git/session-git-manager.js.map +1 -1
  28. package/.opencode/plugin/daytona/index.d.ts +131 -23
  29. package/.opencode/plugin/daytona/index.js +27 -16
  30. package/.opencode/plugin/daytona/index.js.map +1 -1
  31. package/.opencode/plugin/daytona/plugins/custom-tools.d.ts +129 -5
  32. package/.opencode/plugin/daytona/plugins/custom-tools.js +15 -13
  33. package/.opencode/plugin/daytona/plugins/custom-tools.js.map +1 -1
  34. package/.opencode/plugin/daytona/plugins/session-events.d.ts +10 -0
  35. package/.opencode/plugin/daytona/plugins/session-events.js +51 -0
  36. package/.opencode/plugin/daytona/plugins/session-events.js.map +1 -0
  37. package/.opencode/plugin/daytona/plugins/system-transform.d.ts +8 -5
  38. package/.opencode/plugin/daytona/plugins/system-transform.js +19 -15
  39. package/.opencode/plugin/daytona/plugins/system-transform.js.map +1 -1
  40. package/.opencode/plugin/daytona/tools/bash.d.ts +7 -3
  41. package/.opencode/plugin/daytona/tools/bash.js +16 -5
  42. package/.opencode/plugin/daytona/tools/bash.js.map +1 -1
  43. package/.opencode/plugin/daytona/tools/edit.d.ts +6 -2
  44. package/.opencode/plugin/daytona/tools/edit.js +13 -5
  45. package/.opencode/plugin/daytona/tools/edit.js.map +1 -1
  46. package/.opencode/plugin/daytona/tools/get-preview-url.d.ts +6 -2
  47. package/.opencode/plugin/daytona/tools/get-preview-url.js +11 -3
  48. package/.opencode/plugin/daytona/tools/get-preview-url.js.map +1 -1
  49. package/.opencode/plugin/daytona/tools/glob.d.ts +6 -2
  50. package/.opencode/plugin/daytona/tools/glob.js +11 -3
  51. package/.opencode/plugin/daytona/tools/glob.js.map +1 -1
  52. package/.opencode/plugin/daytona/tools/grep.d.ts +6 -2
  53. package/.opencode/plugin/daytona/tools/grep.js +11 -3
  54. package/.opencode/plugin/daytona/tools/grep.js.map +1 -1
  55. package/.opencode/plugin/daytona/tools/ls.d.ts +6 -2
  56. package/.opencode/plugin/daytona/tools/ls.js +11 -3
  57. package/.opencode/plugin/daytona/tools/ls.js.map +1 -1
  58. package/.opencode/plugin/daytona/tools/lsp.d.ts +6 -2
  59. package/.opencode/plugin/daytona/tools/lsp.js +13 -5
  60. package/.opencode/plugin/daytona/tools/lsp.js.map +1 -1
  61. package/.opencode/plugin/daytona/tools/multiedit.d.ts +6 -2
  62. package/.opencode/plugin/daytona/tools/multiedit.js +14 -6
  63. package/.opencode/plugin/daytona/tools/multiedit.js.map +1 -1
  64. package/.opencode/plugin/daytona/tools/patch.d.ts +7 -5
  65. package/.opencode/plugin/daytona/tools/patch.js +13 -13
  66. package/.opencode/plugin/daytona/tools/patch.js.map +1 -1
  67. package/.opencode/plugin/daytona/tools/read.d.ts +6 -2
  68. package/.opencode/plugin/daytona/tools/read.js +11 -3
  69. package/.opencode/plugin/daytona/tools/read.js.map +1 -1
  70. package/.opencode/plugin/daytona/tools/write.d.ts +6 -2
  71. package/.opencode/plugin/daytona/tools/write.js +12 -4
  72. package/.opencode/plugin/daytona/tools/write.js.map +1 -1
  73. package/.opencode/plugin/daytona/tools.d.ts +14 -16
  74. package/.opencode/plugin/daytona/tools.js +31 -23
  75. package/.opencode/plugin/daytona/tools.js.map +1 -1
  76. package/.opencode/plugin/index.d.ts +7 -4
  77. package/.opencode/plugin/index.js +12 -3
  78. package/.opencode/plugin/index.js.map +1 -1
  79. package/README.md +68 -29
  80. package/package.json +34 -17
  81. package/.opencode/plugin/daytona/core/logger.d.ts.map +0 -1
  82. package/.opencode/plugin/daytona/core/project-data-storage.d.ts.map +0 -1
  83. package/.opencode/plugin/daytona/core/session-manager.d.ts.map +0 -1
  84. package/.opencode/plugin/daytona/core/types.d.ts.map +0 -1
  85. package/.opencode/plugin/daytona/git/host-git-manager.d.ts.map +0 -1
  86. package/.opencode/plugin/daytona/git/index.d.ts.map +0 -1
  87. package/.opencode/plugin/daytona/git/sandbox-git-manager.d.ts.map +0 -1
  88. package/.opencode/plugin/daytona/git/session-git-manager.d.ts.map +0 -1
  89. package/.opencode/plugin/daytona/index.d.ts.map +0 -1
  90. package/.opencode/plugin/daytona/plugins/custom-tools.d.ts.map +0 -1
  91. package/.opencode/plugin/daytona/plugins/index.d.ts +0 -8
  92. package/.opencode/plugin/daytona/plugins/index.d.ts.map +0 -1
  93. package/.opencode/plugin/daytona/plugins/index.js +0 -8
  94. package/.opencode/plugin/daytona/plugins/index.js.map +0 -1
  95. package/.opencode/plugin/daytona/plugins/session-cleanup.d.ts +0 -8
  96. package/.opencode/plugin/daytona/plugins/session-cleanup.d.ts.map +0 -1
  97. package/.opencode/plugin/daytona/plugins/session-cleanup.js +0 -38
  98. package/.opencode/plugin/daytona/plugins/session-cleanup.js.map +0 -1
  99. package/.opencode/plugin/daytona/plugins/session-idle-auto-commit.d.ts +0 -7
  100. package/.opencode/plugin/daytona/plugins/session-idle-auto-commit.d.ts.map +0 -1
  101. package/.opencode/plugin/daytona/plugins/session-idle-auto-commit.js +0 -46
  102. package/.opencode/plugin/daytona/plugins/session-idle-auto-commit.js.map +0 -1
  103. package/.opencode/plugin/daytona/plugins/system-transform.d.ts.map +0 -1
  104. package/.opencode/plugin/daytona/tools/bash.d.ts.map +0 -1
  105. package/.opencode/plugin/daytona/tools/edit.d.ts.map +0 -1
  106. package/.opencode/plugin/daytona/tools/get-preview-url.d.ts.map +0 -1
  107. package/.opencode/plugin/daytona/tools/glob.d.ts.map +0 -1
  108. package/.opencode/plugin/daytona/tools/grep.d.ts.map +0 -1
  109. package/.opencode/plugin/daytona/tools/ls.d.ts.map +0 -1
  110. package/.opencode/plugin/daytona/tools/lsp.d.ts.map +0 -1
  111. package/.opencode/plugin/daytona/tools/multiedit.d.ts.map +0 -1
  112. package/.opencode/plugin/daytona/tools/patch.d.ts.map +0 -1
  113. package/.opencode/plugin/daytona/tools/read.d.ts.map +0 -1
  114. package/.opencode/plugin/daytona/tools/write.d.ts.map +0 -1
  115. package/.opencode/plugin/daytona/tools.d.ts.map +0 -1
  116. package/.opencode/plugin/index.d.ts.map +0 -1
@@ -1,97 +1,283 @@
1
- import { logger } from '../core/logger';
2
- import { execSync } from 'child_process';
3
- function execSyncSilent(cmd, options = {}) {
4
- return execSync(cmd, { stdio: 'ignore', ...options });
1
+ "use strict";
2
+ /**
3
+ * Copyright 2025 Daytona Platforms Inc.
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.HostGitManager = void 0;
8
+ const logger_1 = require("../core/logger");
9
+ const child_process_1 = require("child_process");
10
+ function execCommand(cmd, options = {}) {
11
+ try {
12
+ const stdout = (0, child_process_1.execSync)(cmd, {
13
+ stdio: ['ignore', 'pipe', 'pipe'],
14
+ encoding: 'utf8',
15
+ ...options,
16
+ });
17
+ return { ok: true, stdout: stdout ?? '', stderr: '', status: 0 };
18
+ }
19
+ catch (err) {
20
+ const stdout = err?.stdout?.toString?.() ?? '';
21
+ const stderr = err?.stderr?.toString?.() ?? err?.message ?? String(err);
22
+ const status = typeof err?.status === 'number' ? err.status : null;
23
+ return { ok: false, stdout, stderr, status };
24
+ }
5
25
  }
6
- export class HostGitManager {
26
+ class HostGitManager {
7
27
  // No constructor needed; use global logger
28
+ operationQueue = Promise.resolve();
29
+ /** Cached OID of an empty commit used to reserve branch refs (branches must point at commits, not blobs). */
30
+ emptyCommitOidCache = new Map();
8
31
  /**
9
- * Pushes local changes to the sandbox remote, following the same steps as the standalone function.
10
- * @param sshUrl The SSH URL of the sandbox remote.
11
- * @param branch The branch to push to.
32
+ * Checks if a git repository exists in the current directory
33
+ * @returns true if a git repo exists, false otherwise
12
34
  */
13
- pushLocalToSandboxRemote(sshUrl, branch) {
14
- try {
15
- logger.info(`Init in current directory, pushing to ${sshUrl} on branch ${branch}`);
16
- try {
17
- execSyncSilent('git rev-parse --is-inside-work-tree');
18
- }
19
- catch {
20
- execSyncSilent('git init');
35
+ hasRepo(cwd) {
36
+ return execCommand('git rev-parse --is-inside-work-tree', cwd ? { cwd } : {}).ok;
37
+ }
38
+ /**
39
+ * Allocates the next available opencode/N branch number by scanning local refs and
40
+ * reserving the chosen number by creating the ref immediately.
41
+ *
42
+ * This avoids relying on OpenCode's project ID and works even in repos with no commits.
43
+ */
44
+ allocateAndReserveBranchNumber(cwd, prefix = 'opencode') {
45
+ const start = Date.now();
46
+ if (!this.hasRepo(cwd)) {
47
+ throw new Error('No local git repository found.');
48
+ }
49
+ const base = `refs/heads/${prefix}/`;
50
+ const listRes = execCommand(`git for-each-ref --format='%(refname:strip=3)' ${base}`, { cwd });
51
+ if (!listRes.ok)
52
+ throw new Error(listRes.stderr);
53
+ const list = listRes.stdout.trim();
54
+ const nums = list.length === 0
55
+ ? []
56
+ : list
57
+ .split('\n')
58
+ .map((s) => s.trim())
59
+ .filter(Boolean)
60
+ .map((s) => Number.parseInt(s, 10))
61
+ .filter((n) => Number.isFinite(n) && n > 0);
62
+ let n = (nums.length ? Math.max(...nums) : 0) + 1;
63
+ const maxAttempts = 50; // Circuit-breaker
64
+ let attempts = 0;
65
+ while (n < 1_000_000 && attempts < maxAttempts) {
66
+ attempts++;
67
+ const ref = `${base}${n}`;
68
+ if (this.refExists(cwd, ref)) {
69
+ n++;
70
+ continue;
21
71
  }
22
- try {
23
- execSyncSilent('git remote get-url sandbox');
24
- execSyncSilent(`git remote set-url sandbox ${sshUrl}`);
72
+ const oid = this.getOrCreateEmptyCommitOid(cwd);
73
+ const result = execCommand(`git update-ref "${ref}" "${oid}"`, { cwd });
74
+ if (result.ok) {
75
+ logger_1.logger.info(`[branch-alloc] reserved ${prefix}/${n} in ${Date.now() - start}ms`);
76
+ return n;
25
77
  }
26
- catch (e) {
27
- execSyncSilent(`git remote add sandbox ${sshUrl}`);
78
+ else {
79
+ // If we raced or hit an edge case, try the next number.
80
+ n++;
28
81
  }
29
- execSyncSilent('git add .');
30
- execSyncSilent('git commit -m "Sync local changes before agent start" || echo "No changes to commit"', {
31
- shell: '/bin/bash',
32
- });
33
- execSyncSilent(`git push sandbox HEAD:${branch}`);
34
- logger.info('✓ Pushed local changes to sandbox');
35
82
  }
36
- catch (e) {
37
- logger.error(`Error pushing to sandbox: ${e}`);
83
+ const oid = this.getOrCreateEmptyCommitOid(cwd);
84
+ const last = execCommand(`git update-ref "${base}${n}" "${oid}"`, { cwd });
85
+ throw new Error(`Failed to allocate branch number after ${attempts} attempts. Last error: ${last.stderr}`);
86
+ }
87
+ refExists(cwd, ref) {
88
+ return execCommand(`git show-ref --verify --quiet "${ref}"`, { cwd }).ok;
89
+ }
90
+ /**
91
+ * Returns a commit OID that branch refs can point at. Uses HEAD if the repo has commits,
92
+ * otherwise creates and caches an empty commit (empty tree + commit). Branch refs must
93
+ * point at commits, not blobs.
94
+ */
95
+ getOrCreateEmptyCommitOid(cwd) {
96
+ const cached = this.emptyCommitOidCache.get(cwd);
97
+ if (cached)
98
+ return cached;
99
+ const headRes = execCommand('git rev-parse HEAD', { cwd });
100
+ const head = headRes.ok ? headRes.stdout.trim() : '';
101
+ if (head) {
102
+ this.emptyCommitOidCache.set(cwd, head);
103
+ return head;
104
+ }
105
+ // Create an empty tree (idempotent) then a commit pointing at it.
106
+ // Branch refs must point at commits, so we can't reserve with a blob.
107
+ const treeResult = (0, child_process_1.spawnSync)('git', ['hash-object', '-t', 'tree', '-w', '--stdin'], {
108
+ // Empty stdin => empty tree
109
+ input: '',
110
+ cwd,
111
+ encoding: 'utf8',
112
+ });
113
+ const treeOid = treeResult.stdout?.trim();
114
+ if (treeResult.status !== 0 || !treeOid) {
115
+ const errorMsg = treeResult.stderr?.toString() || treeResult.error?.message || String(treeResult.error || 'unknown');
116
+ throw new Error(`Failed to create empty tree: ${errorMsg}`);
38
117
  }
118
+ // Provide a default identity for reservation commits when repo has no user.name/user.email (e.g. CI).
119
+ const reservationCommitName = 'OpenCode Plugin';
120
+ const reservationCommitEmail = 'opencode@daytona.io';
121
+ const reservationCommitMessage = 'OpenCode reservation';
122
+ const commitEnv = {
123
+ ...process.env,
124
+ GIT_AUTHOR_NAME: reservationCommitName,
125
+ GIT_AUTHOR_EMAIL: reservationCommitEmail,
126
+ GIT_COMMITTER_NAME: reservationCommitName,
127
+ GIT_COMMITTER_EMAIL: reservationCommitEmail,
128
+ };
129
+ // Create the commit
130
+ const commitRes = execCommand(`git commit-tree ${treeOid} -m "${reservationCommitMessage}"`, {
131
+ cwd,
132
+ env: commitEnv,
133
+ });
134
+ if (!commitRes.ok)
135
+ throw new Error(`Failed to create empty commit: ${commitRes.stderr}`);
136
+ const commitOid = commitRes.stdout.trim();
137
+ this.emptyCommitOidCache.set(cwd, commitOid);
138
+ return commitOid;
39
139
  }
40
- ensureRepo() {
140
+ /**
141
+ * Pushes local changes to the sandbox remote.
142
+ * @param remoteName Numbered remote (e.g. sandbox-2) matching opencode/N.
143
+ * @param sshUrl The SSH URL of the sandbox remote.
144
+ * @param branch The branch to push to.
145
+ * @param cwd Worktree path to run git in.
146
+ * @returns true if push was successful, false if no repo exists
147
+ */
148
+ async pushLocalToSandboxRemote(remoteName, sshUrl, branch, cwd) {
149
+ if (!this.hasRepo(cwd)) {
150
+ logger_1.logger.warn('No local git repository found. Skipping push to sandbox.');
151
+ return false;
152
+ }
41
153
  try {
42
- execSyncSilent('git rev-parse --is-inside-work-tree');
43
- logger.info('Git repo already exists in local worktree.');
154
+ logger_1.logger.info(`Pushing to ${remoteName} (${sshUrl}) on branch ${branch}`);
155
+ const operation = this.operationQueue.then(async () => {
156
+ const statusRes = execCommand('git status --porcelain', { cwd });
157
+ if (!statusRes.ok) {
158
+ throw new Error(statusRes.stderr);
159
+ }
160
+ if (statusRes.stdout.trim().length > 0) {
161
+ logger_1.logger.warn('Local repository has uncommitted changes; pushing HEAD only (no auto-commit).');
162
+ }
163
+ this.setRemote(remoteName, sshUrl, cwd);
164
+ let attempts = 0;
165
+ while (attempts < 3) {
166
+ try {
167
+ const pushRes = execCommand(`git push ${remoteName} HEAD:${branch}`, { cwd });
168
+ if (!pushRes.ok)
169
+ throw new Error(pushRes.stderr);
170
+ logger_1.logger.info(`✓ Pushed local changes to ${remoteName}`);
171
+ return;
172
+ }
173
+ catch (e) {
174
+ attempts++;
175
+ if (attempts >= 3) {
176
+ logger_1.logger.error(`Error pushing to ${remoteName} after 3 attempts: ${e}`);
177
+ }
178
+ else {
179
+ logger_1.logger.warn(`Push attempt ${attempts} failed, retrying...`);
180
+ }
181
+ }
182
+ }
183
+ });
184
+ this.operationQueue = operation;
185
+ await operation;
186
+ return true;
44
187
  }
45
- catch {
46
- execSyncSilent('git init');
47
- logger.info('Initialized new git repo in local worktree.');
188
+ catch (e) {
189
+ logger_1.logger.error(`Error pushing to sandbox: ${e}`);
190
+ return false;
48
191
  }
49
192
  }
50
- setRemote(remoteName, sshUrl) {
193
+ setRemote(remoteName, sshUrl, cwd) {
51
194
  try {
52
195
  // remove existing remote if it exists
53
- execSyncSilent(`git remote remove ${remoteName} || true`);
54
- execSyncSilent(`git remote add ${remoteName} ${sshUrl}`);
196
+ execCommand(`git remote remove ${remoteName}`, { cwd });
197
+ execCommand(`git remote add ${remoteName} ${sshUrl}`, { cwd });
55
198
  }
56
199
  catch (e) {
57
- logger.warn(`Could not set sandbox remote: ${e}`);
200
+ logger_1.logger.warn(`Could not set sandbox remote: ${e}`);
58
201
  }
59
202
  }
60
- pull(remoteName, branch, localBranch) {
61
- let attempts = 0;
62
- // The first pull attempt sometimes fails. I'm not sure what the cause is.
63
- while (attempts < 3) {
64
- try {
65
- if (localBranch) {
66
- // Fetch the remote branch into the specified local branch
67
- execSyncSilent(`git fetch ${remoteName} ${branch}:${localBranch}`);
68
- logger.info(`✓ Fetched latest changes from sandbox into ${localBranch}`);
203
+ async pull(remoteName, sshUrl, branch, cwd, localBranch) {
204
+ const operation = this.operationQueue.then(async () => {
205
+ this.setRemote(remoteName, sshUrl, cwd);
206
+ let attempts = 0;
207
+ let lastError = undefined;
208
+ // The first pull attempt sometimes fails. I'm not sure what the cause is.
209
+ while (attempts < 3) {
210
+ try {
211
+ if (localBranch) {
212
+ // Fetch into FETCH_HEAD only (never into refs/heads) so we don't hit
213
+ // "refusing to fetch into branch checked out" when this branch is checked out.
214
+ const fetchRes = execCommand(`git fetch ${remoteName} ${branch}`, { cwd });
215
+ if (!fetchRes.ok)
216
+ throw new Error(fetchRes.stderr);
217
+ const updateRefRes = execCommand(`git update-ref refs/heads/${localBranch} FETCH_HEAD`, { cwd });
218
+ if (!updateRefRes.ok)
219
+ throw new Error(updateRefRes.stderr);
220
+ // Only reset working directory if we're currently on this branch
221
+ const currentBranchRes = execCommand(`git rev-parse --abbrev-ref HEAD`, { cwd });
222
+ const currentBranch = currentBranchRes.ok ? currentBranchRes.stdout.trim() : '';
223
+ if (currentBranch === localBranch) {
224
+ const resetRes = execCommand(`git reset --hard refs/heads/${localBranch}`, { cwd });
225
+ if (!resetRes.ok)
226
+ throw new Error(resetRes.stderr);
227
+ }
228
+ logger_1.logger.info(`✓ Force pulled latest changes from sandbox into ${localBranch}`);
229
+ }
230
+ else {
231
+ const pullRes = execCommand(`git pull ${remoteName} ${branch}`, { cwd });
232
+ if (!pullRes.ok)
233
+ throw new Error(pullRes.stderr);
234
+ logger_1.logger.info('✓ Pulled latest changes from sandbox');
235
+ }
236
+ return;
69
237
  }
70
- else {
71
- execSyncSilent(`git pull ${remoteName} ${branch}`);
72
- logger.info('✓ Pulled latest changes from sandbox');
238
+ catch (e) {
239
+ lastError = e;
240
+ attempts++;
241
+ if (attempts >= 3) {
242
+ logger_1.logger.error(`Error pulling from sandbox after 3 attempts: ${e}`);
243
+ }
244
+ else {
245
+ logger_1.logger.warn(`Pull attempt ${attempts} failed, retrying...`);
246
+ }
73
247
  }
74
- return;
75
248
  }
76
- catch (e) {
77
- attempts++;
78
- if (attempts >= 3) {
79
- logger.error(`Error pulling from sandbox after 3 attempts: ${e}`);
249
+ // If we got here, all attempts failed.
250
+ throw lastError ?? new Error('Pull failed after 3 attempts');
251
+ });
252
+ this.operationQueue = operation;
253
+ await operation;
254
+ }
255
+ async push(remoteName, sshUrl, branch, cwd) {
256
+ const operation = this.operationQueue.then(async () => {
257
+ this.setRemote(remoteName, sshUrl, cwd);
258
+ let attempts = 0;
259
+ while (attempts < 3) {
260
+ try {
261
+ const pushRes = execCommand(`git push ${remoteName} HEAD:${branch}`, { cwd });
262
+ if (!pushRes.ok)
263
+ throw new Error(pushRes.stderr);
264
+ logger_1.logger.info('✓ Pushed changes to sandbox');
265
+ return;
80
266
  }
81
- else {
82
- logger.warn(`Pull attempt ${attempts} failed, retrying...`);
267
+ catch (e) {
268
+ attempts++;
269
+ if (attempts >= 3) {
270
+ logger_1.logger.error(`Error pushing to sandbox after 3 attempts: ${e}`);
271
+ }
272
+ else {
273
+ logger_1.logger.warn(`Push attempt ${attempts} failed, retrying...`);
274
+ }
83
275
  }
84
276
  }
85
- }
86
- }
87
- push(remoteName, branch) {
88
- try {
89
- execSyncSilent(`git push ${remoteName} HEAD:${branch}`);
90
- logger.info('✓ Pushed changes to sandbox');
91
- }
92
- catch (e) {
93
- logger.error(`Error pushing to sandbox: ${e}`);
94
- }
277
+ });
278
+ this.operationQueue = operation;
279
+ await operation;
95
280
  }
96
281
  }
282
+ exports.HostGitManager = HostGitManager;
97
283
  //# sourceMappingURL=host-git-manager.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"host-git-manager.js","sourceRoot":"","sources":["../../../../../.opencode/plugin/daytona/git/host-git-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAQ,QAAQ,EAAE,MAAM,eAAe,CAAA;AAE9C,SAAS,cAAc,CAAC,GAAW,EAAE,UAAe,EAAE;IACpD,OAAO,QAAQ,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,OAAO,EAAE,CAAC,CAAA;AACvD,CAAC;AAED,MAAM,OAAO,cAAc;IACzB,2CAA2C;IAE3C;;;;OAIG;IACH,wBAAwB,CAAC,MAAc,EAAE,MAAc;QACrD,IAAI,CAAC;YACH,MAAM,CAAC,IAAI,CAAC,yCAAyC,MAAM,cAAc,MAAM,EAAE,CAAC,CAAA;YAClF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CAAC;IACH,CAAC;IAED,IAAI,CAAC,UAAkB,EAAE,MAAc,EAAE,WAAoB;QAC3D,IAAI,QAAQ,GAAG,CAAC,CAAA;QAChB,0EAA0E;QAC1E,OAAO,QAAQ,GAAG,CAAC,EAAE,CAAC;YACpB,IAAI,CAAC;gBACH,IAAI,WAAW,EAAE,CAAC;oBAChB,0DAA0D;oBAC1D,cAAc,CAAC,aAAa,UAAU,IAAI,MAAM,IAAI,WAAW,EAAE,CAAC,CAAA;oBAClE,MAAM,CAAC,IAAI,CAAC,8CAA8C,WAAW,EAAE,CAAC,CAAA;gBAC1E,CAAC;qBAAM,CAAC;oBACN,cAAc,CAAC,YAAY,UAAU,IAAI,MAAM,EAAE,CAAC,CAAA;oBAClD,MAAM,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAA;gBACrD,CAAC;gBACD,OAAM;YACR,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,QAAQ,EAAE,CAAA;gBACV,IAAI,QAAQ,IAAI,CAAC,EAAE,CAAC;oBAClB,MAAM,CAAC,KAAK,CAAC,gDAAgD,CAAC,EAAE,CAAC,CAAA;gBACnE,CAAC;qBAAM,CAAC;oBACN,MAAM,CAAC,IAAI,CAAC,gBAAgB,QAAQ,sBAAsB,CAAC,CAAA;gBAC7D,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,IAAI,CAAC,UAAkB,EAAE,MAAc;QACrC,IAAI,CAAC;YACH,cAAc,CAAC,YAAY,UAAU,SAAS,MAAM,EAAE,CAAC,CAAA;YACvD,MAAM,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAA;QAC5C,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,MAAM,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAA;QAChD,CAAC;IACH,CAAC;CACF"}
1
+ {"version":3,"file":"host-git-manager.js","sourceRoot":"","sources":["../../../../../../../libs/opencode-plugin/.opencode/plugin/daytona/git/host-git-manager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} from './session-git-manager';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,10 @@
1
- export { SessionGitManager } from './session-git-manager';
1
+ "use strict";
2
+ /**
3
+ * Copyright 2025 Daytona Platforms Inc.
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.SessionGitManager = void 0;
8
+ var session_git_manager_1 = require("./session-git-manager");
9
+ Object.defineProperty(exports, "SessionGitManager", { enumerable: true, get: function () { return session_git_manager_1.SessionGitManager; } });
2
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../.opencode/plugin/daytona/git/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../libs/opencode-plugin/.opencode/plugin/daytona/git/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6DAAyD;AAAhD,wHAAA,iBAAiB,OAAA"}
@@ -1,10 +1,14 @@
1
+ /**
2
+ * Copyright 2025 Daytona Platforms Inc.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
1
5
  import type { Sandbox } from '@daytonaio/sdk';
2
6
  export declare class DaytonaSandboxGitManager {
3
7
  private readonly sandbox;
4
8
  private readonly repoPath;
5
9
  constructor(sandbox: Sandbox, repoPath: string);
10
+ ensureDirectory(): Promise<void>;
6
11
  ensureRepo(): Promise<void>;
7
12
  autoCommit(): Promise<boolean>;
8
13
  resetToRemote(branch: string): Promise<void>;
9
14
  }
10
- //# sourceMappingURL=sandbox-git-manager.d.ts.map
@@ -1,19 +1,29 @@
1
- import { logger } from '../core/logger';
2
- export class DaytonaSandboxGitManager {
1
+ "use strict";
2
+ /**
3
+ * Copyright 2025 Daytona Platforms Inc.
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.DaytonaSandboxGitManager = void 0;
8
+ const logger_1 = require("../core/logger");
9
+ class DaytonaSandboxGitManager {
3
10
  sandbox;
4
11
  repoPath;
5
12
  constructor(sandbox, repoPath) {
6
13
  this.sandbox = sandbox;
7
14
  this.repoPath = repoPath;
8
15
  }
16
+ async ensureDirectory() {
17
+ await this.sandbox.fs.createFolder(this.repoPath, '755');
18
+ }
9
19
  async ensureRepo() {
10
- await this.sandbox.process.executeCommand(`mkdir -p ${this.repoPath}`);
20
+ await this.ensureDirectory();
11
21
  const isGit = await this.sandbox.process.executeCommand('git rev-parse --is-inside-work-tree', this.repoPath);
12
22
  if (!isGit || isGit.result.trim() !== 'true') {
13
23
  await this.sandbox.process.executeCommand('git init', this.repoPath);
14
24
  await this.sandbox.process.executeCommand('git config user.email "sandbox@example.com"', this.repoPath);
15
25
  await this.sandbox.process.executeCommand('git config user.name "Daytona Sandbox"', this.repoPath);
16
- logger.info(`Initialized git repo in sandbox at ${this.repoPath}`);
26
+ logger_1.logger.info(`Initialized git repo in sandbox at ${this.repoPath}`);
17
27
  }
18
28
  }
19
29
  async autoCommit() {
@@ -21,37 +31,38 @@ export class DaytonaSandboxGitManager {
21
31
  // Check if there are any changes to commit
22
32
  const statusResult = await this.sandbox.process.executeCommand('git status --porcelain', this.repoPath);
23
33
  if (!statusResult.result.trim()) {
24
- logger.info(`No changes to commit in sandbox at ${this.repoPath}`);
34
+ logger_1.logger.info(`No changes to commit in sandbox at ${this.repoPath}`);
25
35
  return false;
26
36
  }
27
37
  await this.sandbox.process.executeCommand('git add .', this.repoPath);
28
38
  await this.sandbox.process.executeCommand('git commit -am "Auto-commit from Daytona plugin"', this.repoPath);
29
- logger.info(`Auto-committed changes in sandbox at ${this.repoPath}`);
39
+ logger_1.logger.info(`Auto-committed changes in sandbox at ${this.repoPath}`);
30
40
  return true;
31
41
  }
32
42
  catch (err) {
33
- logger.error(`Failed to auto-commit in sandbox at ${this.repoPath}: ${err}`);
43
+ logger_1.logger.error(`Failed to auto-commit in sandbox at ${this.repoPath}: ${err}`);
34
44
  return false;
35
45
  }
36
46
  }
37
47
  async resetToRemote(branch) {
38
48
  try {
39
49
  const result = await this.sandbox.process.executeCommand(`git checkout -B ${branch}`, this.repoPath);
40
- logger.info(`Checked out branch '${branch}': ${result.result}`);
50
+ logger_1.logger.info(`Checked out branch '${branch}': ${result.result}`);
41
51
  await this.sandbox.process.executeCommand('git reset --hard', this.repoPath);
42
52
  await this.sandbox.process.executeCommand('git clean -fd', this.repoPath);
43
- logger.info('Reset sandbox worktree to pushed state.');
53
+ logger_1.logger.info('Reset sandbox worktree to pushed state.');
44
54
  const statusResult = await this.sandbox.process.executeCommand('git status --porcelain', this.repoPath);
45
55
  if (statusResult.result.trim()) {
46
- logger.warn(`Sandbox has uncommitted changes after reset:\n${statusResult.result}`);
56
+ logger_1.logger.warn(`Sandbox has uncommitted changes after reset:\n${statusResult.result}`);
47
57
  }
48
58
  else {
49
- logger.info('No uncommitted changes in sandbox after reset.');
59
+ logger_1.logger.info('No uncommitted changes in sandbox after reset.');
50
60
  }
51
61
  }
52
62
  catch (err) {
53
- logger.error(`Failed to reset sandbox worktree: ${err}`);
63
+ logger_1.logger.error(`Failed to reset sandbox worktree: ${err}`);
54
64
  }
55
65
  }
56
66
  }
67
+ exports.DaytonaSandboxGitManager = DaytonaSandboxGitManager;
57
68
  //# sourceMappingURL=sandbox-git-manager.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sandbox-git-manager.js","sourceRoot":"","sources":["../../../../../.opencode/plugin/daytona/git/sandbox-git-manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAEvC,MAAM,OAAO,wBAAwB;IAEhB;IACA;IAFnB,YACmB,OAAgB,EAChB,QAAgB;QADhB,YAAO,GAAP,OAAO,CAAS;QAChB,aAAQ,GAAR,QAAQ,CAAQ;IAChC,CAAC;IAEJ,KAAK,CAAC,UAAU;QACd,MAAM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OAAO,GAAG,EAAE,CAAC;YACb,MAAM,CAAC,KAAK,CAAC,qCAAqC,GAAG,EAAE,CAAC,CAAA;QAC1D,CAAC;IACH,CAAC;CACF"}
1
+ {"version":3,"file":"sandbox-git-manager.js","sourceRoot":"","sources":["../../../../../../../libs/opencode-plugin/.opencode/plugin/daytona/git/sandbox-git-manager.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,2CAAuC;AAEvC,MAAa,wBAAwB;IAEhB;IACA;IAFnB,YACmB,OAAgB,EAChB,QAAgB;QADhB,YAAO,GAAP,OAAO,CAAS;QAChB,aAAQ,GAAR,QAAQ,CAAQ;IAChC,CAAC;IAEJ,KAAK,CAAC,eAAe;QACnB,MAAM,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;IAC1D,CAAC;IAED,KAAK,CAAC,UAAU;QACd,MAAM,IAAI,CAAC,eAAe,EAAE,CAAA;QAC5B,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,qCAAqC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;QAC7G,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,MAAM,EAAE,CAAC;YAC7C,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;YACpE,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,6CAA6C,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;YACvG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,wCAAwC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;YAClG,eAAM,CAAC,IAAI,CAAC,sCAAsC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAA;QACpE,CAA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AA;YAC5E,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,eAAe,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;YACzE,eAAM,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAA;YACtD,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,wBAAwB,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;YACvG,IAAI,YAAY,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;gBAC/B,eAAM,CAAC,IAAI,CAAC,iDAAiD,YAAY,CAAC,MAAM,EAAE,CAAC,CAAA;YACrF,CAAC;iBAAM,CAAC;gBACN,eAAM,CAAC,IAAI,CAAC,gDAAgD,CAAC,CAAA;YAC/D,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,eAAM,CAAC,KAAK,CAAC,qCAAqC,GAAG,EAAE,CAAC,CAAA;QAC1D,CAAC;IACH,CAAC;CACF;AAxDD,4DAwDC"}
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Copyright 2025 Daytona Platforms Inc.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
1
5
  import type { Sandbox } from '@daytonaio/sdk';
2
6
  import type { PluginInput } from '@opencode-ai/plugin';
3
7
  /**
@@ -8,10 +12,23 @@ export declare class SessionGitManager {
8
12
  private readonly hostGit;
9
13
  private readonly sandbox;
10
14
  private readonly repoPath;
15
+ private readonly worktree;
11
16
  private readonly branch;
12
17
  private readonly localBranch;
13
- constructor(sandbox: Sandbox, repoPath: string, branchNumber: number);
18
+ /** Numbered remote (sandbox-2) matches localBranch (opencode/2) */
19
+ private readonly remoteName;
20
+ constructor(sandbox: Sandbox, repoPath: string, worktree: string, branchNumber: number);
21
+ /**
22
+ * Allocate and reserve the next opencode/N number in the local repo at `worktree`.
23
+ * This keeps all host-git concerns inside the git manager layer.
24
+ */
25
+ static allocateAndReserveBranchNumber(worktree: string, prefix?: string): number;
14
26
  private getSshUrl;
27
+ /**
28
+ * Check if local git repository exists
29
+ * @returns true if repo exists, false otherwise
30
+ */
31
+ hasLocalRepo(): boolean;
15
32
  /**
16
33
  * Initialize git in the sandbox and sync with host
17
34
  * Used when a new sandbox is created for a session
@@ -20,8 +37,7 @@ export declare class SessionGitManager {
20
37
  /**
21
38
  * Auto-commit in the sandbox and pull latest from host
22
39
  * Used on session idle
23
- * Returns true if changes were synced, false if no changes
40
+ * Returns true if changes were synced, false if no changes or no local repo
24
41
  */
25
42
  autoCommitAndPull(pluginCtx?: PluginInput): Promise<boolean>;
26
43
  }
27
- //# sourceMappingURL=session-git-manager.d.ts.map