@agent-vm/agent-vm 0.0.31 → 0.0.32

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 (144) hide show
  1. package/dist/backup/backup-create-operation.d.ts +3 -1
  2. package/dist/backup/backup-create-operation.d.ts.map +1 -1
  3. package/dist/backup/backup-create-operation.js +49 -14
  4. package/dist/backup/backup-create-operation.js.map +1 -1
  5. package/dist/backup/backup-manager.d.ts +8 -6
  6. package/dist/backup/backup-manager.d.ts.map +1 -1
  7. package/dist/backup/backup-manager.js +7 -5
  8. package/dist/backup/backup-manager.js.map +1 -1
  9. package/dist/backup/backup-restore-operation.d.ts +1 -1
  10. package/dist/backup/backup-restore-operation.d.ts.map +1 -1
  11. package/dist/backup/backup-restore-operation.js +13 -9
  12. package/dist/backup/backup-restore-operation.js.map +1 -1
  13. package/dist/build/docker-image-builder.d.ts.map +1 -1
  14. package/dist/build/docker-image-builder.js +12 -6
  15. package/dist/build/docker-image-builder.js.map +1 -1
  16. package/dist/cli/backup-commands.d.ts.map +1 -1
  17. package/dist/cli/backup-commands.js +4 -2
  18. package/dist/cli/backup-commands.js.map +1 -1
  19. package/dist/cli/commands/controller-definition.d.ts +86 -68
  20. package/dist/cli/commands/controller-definition.d.ts.map +1 -1
  21. package/dist/cli/commands/controller-definition.js +20 -0
  22. package/dist/cli/commands/controller-definition.js.map +1 -1
  23. package/dist/cli/commands/create-app.d.ts +86 -68
  24. package/dist/cli/commands/create-app.d.ts.map +1 -1
  25. package/dist/cli/commands/init-definition.d.ts.map +1 -1
  26. package/dist/cli/commands/init-definition.js +3 -1
  27. package/dist/cli/commands/init-definition.js.map +1 -1
  28. package/dist/cli/commands/paths-definition.d.ts.map +1 -1
  29. package/dist/cli/commands/paths-definition.js +9 -4
  30. package/dist/cli/commands/paths-definition.js.map +1 -1
  31. package/dist/cli/controller-operation-commands.d.ts.map +1 -1
  32. package/dist/cli/controller-operation-commands.js +70 -11
  33. package/dist/cli/controller-operation-commands.js.map +1 -1
  34. package/dist/cli/init-command.d.ts.map +1 -1
  35. package/dist/cli/init-command.js +45 -28
  36. package/dist/cli/init-command.js.map +1 -1
  37. package/dist/cli/lease-commands.d.ts.map +1 -1
  38. package/dist/cli/lease-commands.js +8 -0
  39. package/dist/cli/lease-commands.js.map +1 -1
  40. package/dist/cli/run-task.js +1 -1
  41. package/dist/cli/vm-host-system-templates.d.ts +1 -0
  42. package/dist/cli/vm-host-system-templates.d.ts.map +1 -1
  43. package/dist/cli/vm-host-system-templates.js +2 -2
  44. package/dist/cli/vm-host-system-templates.js.map +1 -1
  45. package/dist/config/system-config.d.ts +22 -9
  46. package/dist/config/system-config.d.ts.map +1 -1
  47. package/dist/config/system-config.js +72 -14
  48. package/dist/config/system-config.js.map +1 -1
  49. package/dist/controller/active-task-registry.d.ts +14 -2
  50. package/dist/controller/active-task-registry.d.ts.map +1 -1
  51. package/dist/controller/active-task-registry.js +14 -0
  52. package/dist/controller/active-task-registry.js.map +1 -1
  53. package/dist/controller/controller-runtime.d.ts.map +1 -1
  54. package/dist/controller/controller-runtime.js +27 -8
  55. package/dist/controller/controller-runtime.js.map +1 -1
  56. package/dist/controller/git-pull-default-operations.d.ts +101 -9
  57. package/dist/controller/git-pull-default-operations.d.ts.map +1 -1
  58. package/dist/controller/git-pull-default-operations.js +405 -68
  59. package/dist/controller/git-pull-default-operations.js.map +1 -1
  60. package/dist/controller/git-push-operations.d.ts +2 -0
  61. package/dist/controller/git-push-operations.d.ts.map +1 -1
  62. package/dist/controller/git-push-operations.js +267 -76
  63. package/dist/controller/git-push-operations.js.map +1 -1
  64. package/dist/controller/git-retry-support.d.ts +21 -0
  65. package/dist/controller/git-retry-support.d.ts.map +1 -0
  66. package/dist/controller/git-retry-support.js +60 -0
  67. package/dist/controller/git-retry-support.js.map +1 -0
  68. package/dist/controller/http/controller-client.d.ts +2 -0
  69. package/dist/controller/http/controller-client.d.ts.map +1 -1
  70. package/dist/controller/http/controller-client.js +13 -0
  71. package/dist/controller/http/controller-client.js.map +1 -1
  72. package/dist/controller/http/controller-http-route-support.d.ts +7 -2
  73. package/dist/controller/http/controller-http-route-support.d.ts.map +1 -1
  74. package/dist/controller/http/controller-http-route-support.js +17 -1
  75. package/dist/controller/http/controller-http-route-support.js.map +1 -1
  76. package/dist/controller/http/controller-http-routes.d.ts +4 -1
  77. package/dist/controller/http/controller-http-routes.d.ts.map +1 -1
  78. package/dist/controller/http/controller-http-routes.js +33 -6
  79. package/dist/controller/http/controller-http-routes.js.map +1 -1
  80. package/dist/controller/http/controller-lease-response-types.d.ts +17 -0
  81. package/dist/controller/http/controller-lease-response-types.d.ts.map +1 -0
  82. package/dist/controller/http/controller-lease-response-types.js +16 -0
  83. package/dist/controller/http/controller-lease-response-types.js.map +1 -0
  84. package/dist/controller/http/controller-request-schemas.d.ts +84 -13
  85. package/dist/controller/http/controller-request-schemas.d.ts.map +1 -1
  86. package/dist/controller/http/controller-request-schemas.js +110 -9
  87. package/dist/controller/http/controller-request-schemas.js.map +1 -1
  88. package/dist/controller/http/controller-zone-operation-routes.d.ts.map +1 -1
  89. package/dist/controller/http/controller-zone-operation-routes.js +10 -3
  90. package/dist/controller/http/controller-zone-operation-routes.js.map +1 -1
  91. package/dist/controller/leases/idle-reaper.d.ts +3 -1
  92. package/dist/controller/leases/idle-reaper.d.ts.map +1 -1
  93. package/dist/controller/leases/idle-reaper.js +3 -2
  94. package/dist/controller/leases/idle-reaper.js.map +1 -1
  95. package/dist/controller/leases/lease-manager.d.ts +18 -9
  96. package/dist/controller/leases/lease-manager.d.ts.map +1 -1
  97. package/dist/controller/leases/lease-manager.js +155 -57
  98. package/dist/controller/leases/lease-manager.js.map +1 -1
  99. package/dist/controller/leases/lease-workspace-paths.d.ts +14 -0
  100. package/dist/controller/leases/lease-workspace-paths.d.ts.map +1 -0
  101. package/dist/controller/leases/lease-workspace-paths.js +104 -0
  102. package/dist/controller/leases/lease-workspace-paths.js.map +1 -0
  103. package/dist/controller/runtime-instructions-builder.d.ts +1 -2
  104. package/dist/controller/runtime-instructions-builder.d.ts.map +1 -1
  105. package/dist/controller/runtime-instructions-builder.js +8 -9
  106. package/dist/controller/runtime-instructions-builder.js.map +1 -1
  107. package/dist/controller/task-config-builder.d.ts +2 -1
  108. package/dist/controller/task-config-builder.d.ts.map +1 -1
  109. package/dist/controller/task-config-builder.js +2 -1
  110. package/dist/controller/task-config-builder.js.map +1 -1
  111. package/dist/controller/worker-task-runner.d.ts +10 -4
  112. package/dist/controller/worker-task-runner.d.ts.map +1 -1
  113. package/dist/controller/worker-task-runner.js +147 -44
  114. package/dist/controller/worker-task-runner.js.map +1 -1
  115. package/dist/gateway/gateway-zone-orchestrator.d.ts.map +1 -1
  116. package/dist/gateway/gateway-zone-orchestrator.js +4 -2
  117. package/dist/gateway/gateway-zone-orchestrator.js.map +1 -1
  118. package/dist/gateway/gateway-zone-support.d.ts.map +1 -1
  119. package/dist/gateway/gateway-zone-support.js +18 -10
  120. package/dist/gateway/gateway-zone-support.js.map +1 -1
  121. package/dist/operations/config-validation.d.ts +1 -0
  122. package/dist/operations/config-validation.d.ts.map +1 -1
  123. package/dist/operations/config-validation.js +7 -3
  124. package/dist/operations/config-validation.js.map +1 -1
  125. package/dist/operations/destroy-zone.d.ts.map +1 -1
  126. package/dist/operations/destroy-zone.js +8 -1
  127. package/dist/operations/destroy-zone.js.map +1 -1
  128. package/dist/operations/doctor.d.ts +4 -0
  129. package/dist/operations/doctor.d.ts.map +1 -1
  130. package/dist/operations/doctor.js +127 -4
  131. package/dist/operations/doctor.js.map +1 -1
  132. package/dist/operations/runtime-config-paths.d.ts +4 -0
  133. package/dist/operations/runtime-config-paths.d.ts.map +1 -0
  134. package/dist/operations/runtime-config-paths.js +6 -0
  135. package/dist/operations/runtime-config-paths.js.map +1 -0
  136. package/dist/perf/gondolin-vfs-benchmark-support.d.ts +28 -0
  137. package/dist/perf/gondolin-vfs-benchmark-support.d.ts.map +1 -0
  138. package/dist/perf/gondolin-vfs-benchmark-support.js +50 -0
  139. package/dist/perf/gondolin-vfs-benchmark-support.js.map +1 -0
  140. package/dist/tool-vm/tool-vm-lifecycle.d.ts +5 -7
  141. package/dist/tool-vm/tool-vm-lifecycle.d.ts.map +1 -1
  142. package/dist/tool-vm/tool-vm-lifecycle.js +32 -27
  143. package/dist/tool-vm/tool-vm-lifecycle.js.map +1 -1
  144. package/package.json +7 -7
@@ -1,11 +1,29 @@
1
1
  import { execa } from 'execa';
2
2
  import { scrubGithubTokenFromOutput } from './git-auth-support.js';
3
+ import { runGitCommandWithTransientRetries } from './git-retry-support.js';
3
4
  const GIT_OPERATION_TIMEOUT_MS = 120_000;
5
+ const GIT_PUSH_RETRY_AFTER_MESSAGE = 'GitHub or the network is still rejecting the push after retries. Try git-push again in 5 minutes if the task is still running; otherwise start a new task.';
6
+ const GIT_PUSH_RETRY_AFTER_SECONDS = 300;
4
7
  export class PushBranchesValidationError extends Error {
5
8
  }
9
+ class GitPushFailedAfterRetriesError extends Error {
10
+ attempts;
11
+ phase;
12
+ constructor(message, attempts, phase) {
13
+ super(message);
14
+ this.attempts = attempts;
15
+ this.phase = phase;
16
+ this.name = 'GitPushFailedAfterRetriesError';
17
+ }
18
+ }
6
19
  function writePushFlowLog(message) {
7
20
  process.stderr.write(`[git-push-operations] ${message}\n`);
8
21
  }
22
+ async function sleep(delayMs) {
23
+ await new Promise((resolve) => {
24
+ setTimeout(resolve, delayMs);
25
+ });
26
+ }
9
27
  function parseRepoFromUrl(repoUrl) {
10
28
  const cleaned = repoUrl.replace(/\.git$/, '');
11
29
  const urlPattern = /(?:https?:\/\/)?github\.com\/([^/]+\/[^/]+)$/u;
@@ -24,24 +42,51 @@ function buildPushUrl(repoUrl, githubToken) {
24
42
  function sanitizeBranchName(name) {
25
43
  return name.replace(/[^a-zA-Z0-9\-_./]/gu, '-');
26
44
  }
45
+ function errorMessage(error) {
46
+ return error instanceof Error ? error.message : String(error);
47
+ }
48
+ async function recordPushEvent(options) {
49
+ try {
50
+ await options.recordEvent?.(options.event);
51
+ }
52
+ catch (error) {
53
+ writePushFlowLog(`Failed to record ${options.event.event}: ${error instanceof Error ? error.message : String(error)}`);
54
+ }
55
+ }
27
56
  async function git(options) {
28
- const result = await execa('git', [...options.args], {
29
- cwd: options.cwd,
57
+ const result = await execa('git', ['-c', 'core.hooksPath=/dev/null', `--git-dir=${options.gitDir}`, ...options.args], {
30
58
  reject: false,
31
59
  timeout: GIT_OPERATION_TIMEOUT_MS,
32
60
  });
61
+ const terminatedWithoutExitCode = typeof result.exitCode !== 'number';
62
+ const exitCode = typeof result.exitCode === 'number' ? result.exitCode : 128;
33
63
  const normalized = {
34
64
  stdout: result.stdout,
35
- stderr: result.stderr,
36
- exitCode: result.exitCode ?? 0,
65
+ stderr: terminatedWithoutExitCode
66
+ ? `${result.stderr}\ngit ${options.args.join(' ')} terminated without an exit code`.trim()
67
+ : result.stderr,
68
+ exitCode,
37
69
  };
38
70
  if (options.reject === true && normalized.exitCode !== 0) {
39
71
  throw new Error(`git ${options.args.join(' ')} failed\n${normalized.stdout}\n${normalized.stderr}`.trim());
40
72
  }
41
73
  return normalized;
42
74
  }
43
- async function gitStdout(cwd, args) {
44
- return (await git({ args, cwd, reject: true })).stdout.trim();
75
+ function formatGitCommandFailure(args, result) {
76
+ return `git ${args.join(' ')} failed\n${result.stdout}\n${result.stderr}`.trim();
77
+ }
78
+ async function gitWithTransientRetries(options) {
79
+ const retryResult = await runGitCommandWithTransientRetries({
80
+ run: async () => await git({ args: options.args, gitDir: options.gitDir, reject: false }),
81
+ sleep,
82
+ });
83
+ if (retryResult.result.exitCode !== 0) {
84
+ throw new Error(formatGitCommandFailure(options.args, retryResult.result));
85
+ }
86
+ return retryResult.result;
87
+ }
88
+ async function gitStdout(gitDir, args) {
89
+ return (await gitWithTransientRetries({ args, gitDir })).stdout.trim();
45
90
  }
46
91
  function parseCommitSummaries(output) {
47
92
  if (output.trim().length === 0)
@@ -64,80 +109,176 @@ function parseCommitSummaries(output) {
64
109
  return summary;
65
110
  });
66
111
  }
67
- async function commitSummaries(cwd, range, options) {
112
+ async function commitSummaries(gitDir, range, options) {
68
113
  const format = options?.includeAuthorDate === true ? '%H%x09%s%x09%an%x09%aI' : '%H%x09%s';
69
- const result = await git({ cwd, args: ['log', range, `--format=${format}`], reject: false });
70
- if (result.exitCode !== 0)
71
- return [];
114
+ const result = await gitWithTransientRetries({
115
+ gitDir,
116
+ args: ['log', range, `--format=${format}`],
117
+ });
72
118
  return parseCommitSummaries(result.stdout);
73
119
  }
74
- async function refExists(cwd, ref) {
75
- return ((await git({ cwd, args: ['rev-parse', '--verify', '--quiet', ref], reject: false }))
76
- .exitCode === 0);
77
- }
78
- async function countRange(cwd, range) {
79
- const result = await git({ cwd, args: ['rev-list', '--count', range], reject: false });
80
- if (result.exitCode !== 0)
81
- return 0;
82
- return Number.parseInt(result.stdout.trim(), 10) || 0;
120
+ async function refExists(gitDir, ref) {
121
+ const args = ['rev-parse', '--verify', '--quiet', ref];
122
+ const result = await git({ gitDir, args, reject: false });
123
+ if (result.exitCode === 0)
124
+ return true;
125
+ if (result.stderr.trim().length > 0) {
126
+ throw new Error(formatGitCommandFailure(args, result));
127
+ }
128
+ return false;
83
129
  }
84
130
  async function fetchRemoteRefs(options) {
85
131
  const pushUrl = buildPushUrl(options.repoUrl, options.githubToken);
86
- const result = await git({
87
- cwd: options.cwd,
88
- args: [
89
- 'fetch',
90
- '--prune',
91
- pushUrl,
92
- `${options.defaultBranch}:refs/remotes/origin/${options.defaultBranch}`,
93
- ],
94
- reject: false,
132
+ const retryResult = await runGitCommandWithTransientRetries({
133
+ run: async () => await git({
134
+ gitDir: options.gitDir,
135
+ args: [
136
+ 'fetch',
137
+ '--prune',
138
+ pushUrl,
139
+ `${options.defaultBranch}:refs/remotes/origin/${options.defaultBranch}`,
140
+ ],
141
+ reject: false,
142
+ }),
143
+ onRetry: async ({ attempt, delayMs, result }) => {
144
+ const detail = scrubGithubTokenFromOutput(`${result.stdout}\n${result.stderr}`).trim();
145
+ writePushFlowLog(`git fetch failed for ${options.repoUrl} ${options.defaultBranch} on attempt ${attempt}; retrying in ${delayMs / 1000}s: ${detail}`);
146
+ await recordPushEvent({
147
+ recordEvent: options.recordEvent,
148
+ event: {
149
+ event: 'controller-git-push-fetch-retry',
150
+ repoUrl: options.repoUrl,
151
+ branch: options.defaultBranch,
152
+ attempts: attempt,
153
+ message: detail,
154
+ retryDelaySeconds: delayMs / 1000,
155
+ },
156
+ });
157
+ },
95
158
  });
96
- if (result.exitCode !== 0) {
97
- const detail = scrubGithubTokenFromOutput(`${result.stdout}\n${result.stderr}`).trim();
98
- throw new Error(`git fetch failed\n${detail}`);
159
+ if (retryResult.result.exitCode !== 0) {
160
+ const detail = scrubGithubTokenFromOutput(`${retryResult.result.stdout}\n${retryResult.result.stderr}`).trim();
161
+ const message = retryResult.attempts > 1
162
+ ? `git fetch failed\n${GIT_PUSH_RETRY_AFTER_MESSAGE}\n${detail}`
163
+ : `git fetch failed\n${detail}`;
164
+ throw new GitPushFailedAfterRetriesError(message, retryResult.attempts, 'pre-push-fetch');
99
165
  }
100
166
  }
101
- async function remoteBranchHead(cwd, branchName) {
102
- if (!(await refExists(cwd, `refs/remotes/origin/${branchName}`)))
167
+ async function remoteBranchHead(gitDir, branchName) {
168
+ if (!(await refExists(gitDir, `refs/remotes/origin/${branchName}`)))
103
169
  return null;
104
- return await gitStdout(cwd, ['rev-parse', `refs/remotes/origin/${branchName}`]);
170
+ return await gitStdout(gitDir, ['rev-parse', `refs/remotes/origin/${branchName}`]);
105
171
  }
106
172
  async function pushBranch(options) {
107
- const result = await git({
108
- cwd: options.cwd,
109
- args: [
110
- 'push',
111
- buildPushUrl(options.repoUrl, options.githubToken),
112
- `${sanitizeBranchName(options.branchName)}:refs/heads/${sanitizeBranchName(options.branchName)}`,
113
- ],
114
- reject: false,
173
+ const sanitizedBranchName = sanitizeBranchName(options.branchName);
174
+ const pushArgs = [
175
+ 'push',
176
+ buildPushUrl(options.repoUrl, options.githubToken),
177
+ `${sanitizedBranchName}:refs/heads/${sanitizedBranchName}`,
178
+ ];
179
+ const retryResult = await runGitCommandWithTransientRetries({
180
+ run: async () => await git({
181
+ gitDir: options.gitDir,
182
+ args: pushArgs,
183
+ reject: false,
184
+ }),
185
+ onRetry: async ({ attempt, delayMs, result }) => {
186
+ const detail = scrubGithubTokenFromOutput(`${result.stdout}\n${result.stderr}`).trim();
187
+ writePushFlowLog(`git push failed for ${options.repoUrl} ${sanitizedBranchName} on attempt ${attempt}; retrying in ${delayMs / 1000}s: ${detail}`);
188
+ await recordPushEvent({
189
+ recordEvent: options.recordEvent,
190
+ event: {
191
+ event: 'controller-git-push-retry',
192
+ repoUrl: options.repoUrl,
193
+ branch: sanitizedBranchName,
194
+ attempts: attempt,
195
+ message: detail,
196
+ retryDelaySeconds: delayMs / 1000,
197
+ },
198
+ });
199
+ },
200
+ sleep,
201
+ });
202
+ if (retryResult.result.exitCode === 0) {
203
+ return { attempts: retryResult.attempts };
204
+ }
205
+ const lastErrorDetail = scrubGithubTokenFromOutput(`${retryResult.result.stdout}\n${retryResult.result.stderr}`).trim();
206
+ writePushFlowLog(`git push failed for ${options.repoUrl} ${sanitizedBranchName} after ${retryResult.attempts} attempts: ${lastErrorDetail}`);
207
+ const failureMessage = retryResult.attempts > 1
208
+ ? `git push failed\n${GIT_PUSH_RETRY_AFTER_MESSAGE}\n${lastErrorDetail}`
209
+ : `git push failed\n${lastErrorDetail}`;
210
+ throw new GitPushFailedAfterRetriesError(failureMessage, retryResult.attempts, 'push');
211
+ }
212
+ async function fetchPushedBranchRef(options) {
213
+ const retryResult = await runGitCommandWithTransientRetries({
214
+ run: async () => await git({
215
+ gitDir: options.gitDir,
216
+ args: [
217
+ 'fetch',
218
+ '--prune',
219
+ buildPushUrl(options.repoUrl, options.githubToken),
220
+ `${options.branchName}:refs/remotes/origin/${options.branchName}`,
221
+ ],
222
+ reject: false,
223
+ }),
224
+ onRetry: async ({ attempt, delayMs, result }) => {
225
+ const detail = scrubGithubTokenFromOutput(`${result.stdout}\n${result.stderr}`).trim();
226
+ writePushFlowLog(`post-push git fetch failed for ${options.repoUrl} ${options.branchName} on attempt ${attempt}; retrying in ${delayMs / 1000}s: ${detail}`);
227
+ await recordPushEvent({
228
+ recordEvent: options.recordEvent,
229
+ event: {
230
+ event: 'controller-git-push-fetch-retry',
231
+ repoUrl: options.repoUrl,
232
+ branch: options.branchName,
233
+ attempts: attempt,
234
+ message: detail,
235
+ retryDelaySeconds: delayMs / 1000,
236
+ },
237
+ });
238
+ },
239
+ sleep,
115
240
  });
116
- if (result.exitCode !== 0) {
117
- const errorDetail = scrubGithubTokenFromOutput(`${result.stdout}\n${result.stderr}`).trim();
118
- writePushFlowLog(`git push failed for ${options.repoUrl} ${sanitizeBranchName(options.branchName)}: ${errorDetail}`);
119
- throw new Error(`git push failed\n${errorDetail}`);
241
+ if (retryResult.result.exitCode !== 0) {
242
+ const detail = scrubGithubTokenFromOutput(`${retryResult.result.stdout}\n${retryResult.result.stderr}`).trim();
243
+ const message = retryResult.attempts > 1
244
+ ? `git fetch failed\n${GIT_PUSH_RETRY_AFTER_MESSAGE}\n${detail}`
245
+ : `git fetch failed\n${detail}`;
246
+ throw new GitPushFailedAfterRetriesError(message, retryResult.attempts, 'post-push-fetch');
247
+ }
248
+ }
249
+ function parseCountRangeOutput(output, range) {
250
+ const parsed = Number.parseInt(output.trim(), 10);
251
+ if (Number.isNaN(parsed)) {
252
+ throw new Error(`git rev-list --count ${range} returned non-numeric output: ${output}`);
120
253
  }
254
+ return parsed;
255
+ }
256
+ async function countRange(gitDir, range) {
257
+ const result = await gitWithTransientRetries({
258
+ gitDir,
259
+ args: ['rev-list', '--count', range],
260
+ });
261
+ return parseCountRangeOutput(result.stdout, range);
121
262
  }
122
263
  async function buildBranchState(options) {
123
- const localHead = await gitStdout(options.cwd, ['rev-parse', 'HEAD']);
124
- const pushedRemoteBranchHead = await remoteBranchHead(options.cwd, options.branchName);
264
+ const localHead = await gitStdout(options.gitDir, ['rev-parse', 'HEAD']);
265
+ const pushedRemoteBranchHead = await remoteBranchHead(options.gitDir, options.branchName);
125
266
  const remoteDefaultRef = `refs/remotes/origin/${options.defaultBranch}`;
126
- const remoteDefaultHead = (await refExists(options.cwd, remoteDefaultRef))
127
- ? await gitStdout(options.cwd, ['rev-parse', remoteDefaultRef])
267
+ const remoteDefaultHead = (await refExists(options.gitDir, remoteDefaultRef))
268
+ ? await gitStdout(options.gitDir, ['rev-parse', remoteDefaultRef])
128
269
  : '';
129
270
  const defaultRange = remoteDefaultHead ? `${remoteDefaultRef}..HEAD` : '';
130
271
  const commitsOnBranch = defaultRange
131
- ? await commitSummaries(options.cwd, defaultRange, { includeAuthorDate: true })
272
+ ? await commitSummaries(options.gitDir, defaultRange, { includeAuthorDate: true })
132
273
  : [];
133
274
  const pushedRange = options.previousRemoteBranchHead
134
275
  ? `${options.previousRemoteBranchHead}..HEAD`
135
276
  : defaultRange;
136
- const pushedInThisCall = pushedRange ? await commitSummaries(options.cwd, pushedRange) : [];
277
+ const pushedInThisCall = pushedRange ? await commitSummaries(options.gitDir, pushedRange) : [];
137
278
  const divergence = remoteDefaultHead
138
279
  ? {
139
- aheadOfDefault: await countRange(options.cwd, `${remoteDefaultRef}..HEAD`),
140
- behindDefault: await countRange(options.cwd, `HEAD..${remoteDefaultRef}`),
280
+ aheadOfDefault: await countRange(options.gitDir, `${remoteDefaultRef}..HEAD`),
281
+ behindDefault: await countRange(options.gitDir, `HEAD..${remoteDefaultRef}`),
141
282
  }
142
283
  : { aheadOfDefault: 0, behindDefault: 0 };
143
284
  return {
@@ -153,6 +294,7 @@ async function buildBranchState(options) {
153
294
  }
154
295
  export async function pushBranchesForTask(options) {
155
296
  const requestedRepoUrls = new Set();
297
+ const reposByUrl = new Map(options.activeTask.repos.map((repo) => [repo.repoUrl, repo]));
156
298
  for (const branch of options.branches) {
157
299
  if (!branch.branchName.startsWith(options.activeTask.branchPrefix)) {
158
300
  throw new PushBranchesValidationError(`Branch '${branch.branchName}' must start with '${options.activeTask.branchPrefix}'.`);
@@ -161,27 +303,39 @@ export async function pushBranchesForTask(options) {
161
303
  throw new PushBranchesValidationError(`Repo '${branch.repoUrl}' has multiple push requests. Push one branch per repo per request.`);
162
304
  }
163
305
  requestedRepoUrls.add(branch.repoUrl);
164
- const repo = options.activeTask.repos.find((candidate) => candidate.repoUrl === branch.repoUrl);
306
+ const repo = reposByUrl.get(branch.repoUrl);
165
307
  if (!repo) {
166
308
  throw new PushBranchesValidationError(`Repo '${branch.repoUrl}' is not registered for active task '${options.activeTask.taskId}'.`);
167
309
  }
168
310
  }
169
- const results = await Promise.all(options.branches.map(async (branch) => {
170
- const repo = options.activeTask.repos.find((candidate) => candidate.repoUrl === branch.repoUrl);
171
- if (!repo) {
172
- throw new PushBranchesValidationError(`Repo '${branch.repoUrl}' is not registered for active task '${options.activeTask.taskId}'.`);
173
- }
311
+ const pushResults = await Promise.allSettled(options.branches.map(async (branch) => {
312
+ const repo = reposByUrl.get(branch.repoUrl);
313
+ if (!repo)
314
+ throw new Error(`Validated repo '${branch.repoUrl}' disappeared before push.`);
174
315
  return await pushOneBranchForTask({
175
316
  branch,
176
317
  githubToken: options.githubToken,
318
+ ...(options.recordEvent ? { recordEvent: options.recordEvent } : {}),
177
319
  repo,
178
320
  task: options.activeTask,
179
321
  });
180
322
  }));
323
+ const results = pushResults.map((result, index) => {
324
+ if (result.status === 'fulfilled')
325
+ return result.value;
326
+ const branch = options.branches[index];
327
+ return {
328
+ repoUrl: branch?.repoUrl ?? 'unknown',
329
+ branch: sanitizeBranchName(branch?.branchName ?? 'unknown'),
330
+ success: false,
331
+ error: errorMessage(result.reason),
332
+ };
333
+ });
181
334
  return { results };
182
335
  }
183
336
  async function pushOneBranchForTask(options) {
184
337
  const branchName = sanitizeBranchName(options.branch.branchName);
338
+ let pushAttempts = 0;
185
339
  try {
186
340
  if (branchName === options.repo.baseBranch) {
187
341
  return {
@@ -191,14 +345,23 @@ async function pushOneBranchForTask(options) {
191
345
  error: `Refusing to push: you are on the default branch "${options.repo.baseBranch}". Create an ${options.task.branchPrefix} branch first and move your commits to it.`,
192
346
  };
193
347
  }
348
+ await recordPushEvent({
349
+ recordEvent: options.recordEvent,
350
+ event: {
351
+ event: 'controller-git-push-started',
352
+ repoUrl: options.branch.repoUrl,
353
+ branch: branchName,
354
+ },
355
+ });
194
356
  await fetchRemoteRefs({
195
- cwd: options.repo.hostWorkspacePath,
357
+ gitDir: options.repo.hostGitDir,
196
358
  defaultBranch: options.repo.baseBranch,
197
359
  repoUrl: options.branch.repoUrl,
198
360
  githubToken: options.githubToken,
361
+ ...(options.recordEvent ? { recordEvent: options.recordEvent } : {}),
199
362
  });
200
- const previousRemoteBranchHead = await remoteBranchHead(options.repo.hostWorkspacePath, branchName);
201
- const localHead = await gitStdout(options.repo.hostWorkspacePath, ['rev-parse', 'HEAD']);
363
+ const previousRemoteBranchHead = await remoteBranchHead(options.repo.hostGitDir, branchName);
364
+ const localHead = await gitStdout(options.repo.hostGitDir, ['rev-parse', 'HEAD']);
202
365
  if (previousRemoteBranchHead === localHead) {
203
366
  return {
204
367
  repoUrl: options.branch.repoUrl,
@@ -207,28 +370,38 @@ async function pushOneBranchForTask(options) {
207
370
  error: `Nothing new to push on ${branchName}. Local HEAD matches origin/${branchName} (${localHead}). Commit your work and call git-push again.`,
208
371
  };
209
372
  }
210
- await pushBranch({
373
+ const pushResult = await pushBranch({
211
374
  repoUrl: options.branch.repoUrl,
212
375
  branchName,
213
- cwd: options.repo.hostWorkspacePath,
376
+ gitDir: options.repo.hostGitDir,
214
377
  githubToken: options.githubToken,
378
+ ...(options.recordEvent ? { recordEvent: options.recordEvent } : {}),
215
379
  });
216
- await git({
217
- cwd: options.repo.hostWorkspacePath,
218
- args: [
219
- 'fetch',
220
- '--prune',
221
- buildPushUrl(options.branch.repoUrl, options.githubToken),
222
- `${branchName}:refs/remotes/origin/${branchName}`,
223
- ],
224
- reject: false,
380
+ pushAttempts = pushResult.attempts;
381
+ await fetchPushedBranchRef({
382
+ gitDir: options.repo.hostGitDir,
383
+ repoUrl: options.branch.repoUrl,
384
+ branchName,
385
+ githubToken: options.githubToken,
386
+ ...(options.recordEvent ? { recordEvent: options.recordEvent } : {}),
225
387
  });
226
388
  const state = await buildBranchState({
227
- cwd: options.repo.hostWorkspacePath,
389
+ gitDir: options.repo.hostGitDir,
228
390
  branchName,
229
391
  defaultBranch: options.repo.baseBranch,
230
392
  previousRemoteBranchHead,
231
393
  });
394
+ await recordPushEvent({
395
+ recordEvent: options.recordEvent,
396
+ event: {
397
+ event: 'controller-git-push-succeeded',
398
+ repoUrl: options.branch.repoUrl,
399
+ branch: branchName,
400
+ attempts: pushAttempts,
401
+ ...(state.localHead ? { localHead: state.localHead } : {}),
402
+ ...(state.remoteBranchHead ? { remoteBranchHead: state.remoteBranchHead } : {}),
403
+ },
404
+ });
232
405
  return {
233
406
  repoUrl: options.branch.repoUrl,
234
407
  branch: branchName,
@@ -237,11 +410,29 @@ async function pushOneBranchForTask(options) {
237
410
  };
238
411
  }
239
412
  catch (error) {
413
+ const message = errorMessage(error);
414
+ const attempts = error instanceof GitPushFailedAfterRetriesError ? error.attempts : pushAttempts;
415
+ const retryAfterSeconds = error instanceof GitPushFailedAfterRetriesError && error.attempts > 1
416
+ ? GIT_PUSH_RETRY_AFTER_SECONDS
417
+ : undefined;
418
+ const phase = error instanceof GitPushFailedAfterRetriesError ? error.phase : undefined;
419
+ await recordPushEvent({
420
+ recordEvent: options.recordEvent,
421
+ event: {
422
+ event: 'controller-git-push-failed',
423
+ repoUrl: options.branch.repoUrl,
424
+ branch: branchName,
425
+ attempts,
426
+ message,
427
+ ...(phase !== undefined ? { phase } : {}),
428
+ ...(retryAfterSeconds !== undefined ? { retryAfterSeconds } : {}),
429
+ },
430
+ });
240
431
  return {
241
432
  repoUrl: options.branch.repoUrl,
242
433
  branch: branchName,
243
434
  success: false,
244
- error: error instanceof Error ? error.message : String(error),
435
+ error: message,
245
436
  };
246
437
  }
247
438
  }
@@ -1 +1 @@
1
- {"version":3,"file":"git-push-operations.js","sourceRoot":"","sources":["../../src/controller/git-push-operations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAG9B,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEnE,MAAM,wBAAwB,GAAG,OAAO,CAAC;AAoCzC,MAAM,OAAO,2BAA4B,SAAQ,KAAK;CAAG;AAEzD,SAAS,gBAAgB,CAAC,OAAe;IACxC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,yBAAyB,OAAO,IAAI,CAAC,CAAC;AAC5D,CAAC;AAED,SAAS,gBAAgB,CAAC,OAAe;IACxC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAC9C,MAAM,UAAU,GAAG,+CAA+C,CAAC;IACnE,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAEvC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAChB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC;IACD,IAAI,qBAAqB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACzC,OAAO,OAAO,CAAC;IAChB,CAAC;IAED,MAAM,IAAI,2BAA2B,CAAC,8BAA8B,OAAO,EAAE,CAAC,CAAC;AAChF,CAAC;AAED,SAAS,YAAY,CAAC,OAAe,EAAE,WAAmB;IACzD,OAAO,0BAA0B,WAAW,eAAe,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAC;AAC5F,CAAC;AAED,SAAS,kBAAkB,CAAC,IAAY;IACvC,OAAO,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,GAAG,CAAC,CAAC;AACjD,CAAC;AAED,KAAK,UAAU,GAAG,CAAC,OAIlB;IACA,MAAM,MAAM,GAAG,MAAM,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AU,+BAA+B,UAAU,KAAK,SAAS,8CAA8C;aAChJ,CAAC;QACH,CAAC;QAED,MAAM,UAAU,CAAC;YAChB,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO;YAC/B,UAAU;YACV,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,iBAAiB;YACnC,WAAW,EAAE,OAAO,CAAC,WAAW;SAChC,CAAC,CAAC;QACH,MAAM,GAAG,CAAC;YACT,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,iBAAiB;YACnC,IAAI,EAAE;gBACL,OAAO;gBACP,SAAS;gBACT,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC;gBACzD,GAAG,UAAU,wBAAwB,UAAU,EAAE;aACjD;YACD,MAAM,EAAE,KAAK;SACb,CAAC,CAAC;QACH,MAAM,KAAK,GAAG,MAAM,gBAAgB,CAAC;YACpC,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,iBAAiB;YACnC,UAAU;YACV,aAAa,EAAE,OAAO,CAAC,IAAI,CAAC,UAAU;YACtC,wBAAwB;SACxB,CAAC,CAAC;QACH,OAAO;YACN,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO;YAC/B,MAAM,EAAE,UAAU;YAClB,OAAO,EAAE,IAAI;YACb,GAAG,KAAK;SACR,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,OAAO;YACN,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO;YAC/B,MAAM,EAAE,UAAU;YAClB,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;SAC7D,CAAC;IACH,CAAC;AACF,CAAC"}
1
+ {"version":3,"file":"git-push-operations.js","sourceRoot":"","sources":["../../src/controller/git-push-operations.ts"],"names":[],"mappings":"AACA,O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,IAAI,KAAK,CAAC,QAAQ,GAAG,CAAC;YACpE,CAAC,CAAC,4BAA4B;YAC9B,CAAC,CAAC,SAAS,CAAC;QACd,MAAM,KAAK,GAAG,KAAK,YAAY,8BAA8B,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;QACxF,MAAM,eAAe,CAAC;YACrB,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,KAAK,EAAE;gBACN,KAAK,EAAE,4BAA4B;gBACnC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO;gBAC/B,MAAM,EAAE,UAAU;gBAClB,QAAQ;gBACR,OAAO;gBACP,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBACzC,GAAG,CAAC,iBAAiB,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aACjE;SACD,CAAC,CAAC;QACH,OAAO;YACN,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO;YAC/B,MAAM,EAAE,UAAU;YAClB,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,OAAO;SACd,CAAC;IACH,CAAC;AACF,CAAC"}
@@ -0,0 +1,21 @@
1
+ export declare const GIT_NETWORK_RETRY_DELAYS_MS: readonly [2000, 4000, 16000];
2
+ export interface GitCommandResult {
3
+ readonly stdout: string;
4
+ readonly stderr: string;
5
+ readonly exitCode: number;
6
+ }
7
+ export interface GitCommandRetryResult {
8
+ readonly attempts: number;
9
+ readonly result: GitCommandResult;
10
+ }
11
+ export declare function isRetryableGitFailure(output: string): boolean;
12
+ export declare function runGitCommandWithTransientRetries(options: {
13
+ readonly run: () => Promise<GitCommandResult>;
14
+ readonly onRetry?: (props: {
15
+ readonly attempt: number;
16
+ readonly delayMs: number;
17
+ readonly result: GitCommandResult;
18
+ }) => Promise<void>;
19
+ readonly sleep?: (delayMs: number) => Promise<void>;
20
+ }): Promise<GitCommandRetryResult>;
21
+ //# sourceMappingURL=git-retry-support.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-retry-support.d.ts","sourceRoot":"","sources":["../../src/controller/git-retry-support.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,8BAAkC,CAAC;AAE3E,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;CAClC;AAuBD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAK7D;AAED,wBAAsB,iCAAiC,CAAC,OAAO,EAAE;IAChE,QAAQ,CAAC,GAAG,EAAE,MAAM,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC9C,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE;QAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;KAClC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpB,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACpD,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAuCjC"}
@@ -0,0 +1,60 @@
1
+ export const GIT_NETWORK_RETRY_DELAYS_MS = [2_000, 4_000, 16_000];
2
+ const retryableGitFailurePatterns = [
3
+ /ECONNRESET/iu,
4
+ /EAI_AGAIN/iu,
5
+ /Connection reset/iu,
6
+ /Could not resolve host/iu,
7
+ /HTTP (?:5\d\d|429)\b/iu,
8
+ /\b(?:5\d\d|429)\b.*(?:GitHub|github|HTTP|http)/iu,
9
+ /early EOF/iu,
10
+ /RPC failed/iu,
11
+ /terminated without an exit code/iu,
12
+ ];
13
+ const permanentGitFailurePatterns = [
14
+ /\bHTTP(?:\/\d(?:\.\d)?)?\s+(?:401|403|404)\b/iu,
15
+ /non-fast-forward/iu,
16
+ /(?:!\s+\[rejected\]|remote rejected)/iu,
17
+ /Authentication failed/iu,
18
+ /Repository not found/iu,
19
+ /Permission denied/iu,
20
+ ];
21
+ export function isRetryableGitFailure(output) {
22
+ if (permanentGitFailurePatterns.some((pattern) => pattern.test(output))) {
23
+ return false;
24
+ }
25
+ return retryableGitFailurePatterns.some((pattern) => pattern.test(output));
26
+ }
27
+ export async function runGitCommandWithTransientRetries(options) {
28
+ const sleep = options.sleep ??
29
+ (async (delayMs) => {
30
+ await new Promise((resolve) => {
31
+ setTimeout(resolve, delayMs);
32
+ });
33
+ });
34
+ let lastResult;
35
+ for (let attemptNumber = 1; attemptNumber <= GIT_NETWORK_RETRY_DELAYS_MS.length + 1; attemptNumber += 1) {
36
+ // Retry attempts are serial because each Git operation observes remote state.
37
+ // oxlint-disable-next-line eslint/no-await-in-loop
38
+ const result = await options.run();
39
+ lastResult = result;
40
+ if (result.exitCode === 0) {
41
+ return { attempts: attemptNumber, result };
42
+ }
43
+ const output = `${result.stdout}\n${result.stderr}`;
44
+ const retryDelayMs = GIT_NETWORK_RETRY_DELAYS_MS[attemptNumber - 1];
45
+ if (retryDelayMs === undefined || !isRetryableGitFailure(output)) {
46
+ return { attempts: attemptNumber, result };
47
+ }
48
+ // Retry event ordering follows the serial Git attempts.
49
+ // oxlint-disable-next-line eslint/no-await-in-loop
50
+ await options.onRetry?.({ attempt: attemptNumber, delayMs: retryDelayMs, result });
51
+ // Backoff sleeps are intentionally serial between retry attempts.
52
+ // oxlint-disable-next-line eslint/no-await-in-loop
53
+ await sleep(retryDelayMs);
54
+ }
55
+ if (!lastResult) {
56
+ throw new Error('Git retry loop finished without running a command.');
57
+ }
58
+ return { attempts: GIT_NETWORK_RETRY_DELAYS_MS.length + 1, result: lastResult };
59
+ }
60
+ //# sourceMappingURL=git-retry-support.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-retry-support.js","sourceRoot":"","sources":["../../src/controller/git-retry-support.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAU,CAAC;AAa3E,MAAM,2BAA2B,GAAsB;IACtD,cAAc;IACd,aAAa;IACb,oBAAoB;IACpB,0BAA0B;IAC1B,wBAAwB;IACxB,kDAAkD;IAClD,aAAa;IACb,cAAc;IACd,mCAAmC;CACnC,CAAC;AAEF,MAAM,2BAA2B,GAAsB;IACtD,gDAAgD;IAChD,oBAAoB;IACpB,wCAAwC;IACxC,yBAAyB;IACzB,wBAAwB;IACxB,qBAAqB;CACrB,CAAC;AAEF,MAAM,UAAU,qBAAqB,CAAC,MAAc;IACnD,IAAI,2BAA2B,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;QACzE,OAAO,KAAK,CAAC;IACd,CAAC;IACD,OAAO,2BAA2B,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AAC5E,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iCAAiC,CAAC,OAQvD;IACA,MAAM,KAAK,GACV,OAAO,CAAC,KAAK;QACb,CAAC,KAAK,EAAE,OAAO,EAAiB,EAAE;YACjC,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;gBACnC,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAC9B,CAAC,CAAC,CAAC;QAC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1
2
  export interface ControllerClient {
2
3
  destroyZone(zoneId: string, purge: boolean): Promise<unknown>;
3
4
  enableZoneSsh(zoneId: string): Promise<unknown>;
@@ -5,6 +6,7 @@ export interface ControllerClient {
5
6
  getControllerStatus(): Promise<unknown>;
6
7
  getZoneLogs(zoneId: string): Promise<unknown>;
7
8
  listLeases(): Promise<unknown>;
9
+ peekLease(leaseId: string): Promise<ControllerLeasePeekResponse>;
8
10
  refreshZoneCredentials(zoneId: string): Promise<unknown>;
9
11
  releaseLease(leaseId: string): Promise<void>;
10
12
  stopController(): Promise<unknown>;
@@ -1 +1 @@
1
- {"version":3,"file":"controller-client.d.ts","sourceRoot":"","sources":["../../../src/controller/http/controller-client.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAChC,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9D,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAChD,UAAU,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/D,mBAAmB,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IACxC,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9C,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/B,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACzD,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IACnC,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC9C;AAkBD,wBAAgB,sBAAsB,CAAC,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