@teambit/ripple 0.0.0-fe2dbd4f0d4ec21100d4de95313aa4e5215a3a08 → 0.0.2

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.
@@ -3,7 +3,29 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.RippleCmd = void 0;
6
+ exports.RippleStopCmd = exports.RippleRetryCmd = exports.RippleLogCmd = exports.RippleListCmd = exports.RippleErrorsCmd = exports.RippleCmd = void 0;
7
+ function _chalk() {
8
+ const data = _interopRequireDefault(require("chalk"));
9
+ _chalk = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ function _cliTable() {
15
+ const data = _interopRequireDefault(require("cli-table"));
16
+ _cliTable = function () {
17
+ return data;
18
+ };
19
+ return data;
20
+ }
21
+ function _rippleUtils() {
22
+ const data = require("./ripple-utils");
23
+ _rippleUtils = function () {
24
+ return data;
25
+ };
26
+ return data;
27
+ }
28
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
7
29
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
8
30
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
9
31
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
@@ -26,5 +48,513 @@ class RippleCmd {
26
48
  }
27
49
  }
28
50
  exports.RippleCmd = RippleCmd;
51
+ class RippleListCmd {
52
+ constructor(ripple) {
53
+ this.ripple = ripple;
54
+ _defineProperty(this, "name", 'list');
55
+ _defineProperty(this, "description", 'list recent Ripple CI jobs (filtered by workspace owner by default)');
56
+ _defineProperty(this, "skipWorkspace", true);
57
+ _defineProperty(this, "remoteOp", true);
58
+ _defineProperty(this, "alias", '');
59
+ _defineProperty(this, "options", [['', 'all', 'show jobs from all owners, not just the workspace owner'], ['o', 'owner <owner>', 'filter by organization (default: detected from workspace defaultScope)'], ['s', 'scope <scope>', 'filter by scope (e.g. "teambit.cloud")'], ['', 'lane <lane>', 'filter by lane ID (e.g. "scope/lane-name")'], ['u', 'user <user>', 'filter by username'], ['', 'status <status>', 'filter by status (e.g. SUCCESS, FAILURE, RUNNING)'], ['l', 'limit <limit>', 'max number of jobs to show (default: 20)'], ['j', 'json', 'return the output as JSON']]);
60
+ }
61
+ async report(args, flags) {
62
+ const {
63
+ jobs,
64
+ ownerUsed
65
+ } = await this.getFilteredJobs(flags);
66
+ if (!jobs || jobs.length === 0) {
67
+ let hint = '';
68
+ if (flags.lane) hint = ` for lane "${flags.lane}"`;else if (flags.scope) hint = ` for scope "${flags.scope}"`;else if (ownerUsed) hint = ` for owner "${ownerUsed}"`;
69
+ const tip = ownerUsed ? ' Use --all to see jobs from all owners.' : '';
70
+ return _chalk().default.yellow(`No Ripple CI jobs found${hint}.${tip}`);
71
+ }
72
+ const table = new (_cliTable().default)({
73
+ head: [_chalk().default.cyan('Job ID'), _chalk().default.cyan('Name'), _chalk().default.cyan('Scope'), _chalk().default.cyan('Status'), _chalk().default.cyan('User'), _chalk().default.cyan('Started'), _chalk().default.cyan('Duration')],
74
+ chars: {
75
+ top: '',
76
+ 'top-mid': '',
77
+ 'top-left': '',
78
+ 'top-right': '',
79
+ bottom: '',
80
+ 'bottom-mid': '',
81
+ 'bottom-left': '',
82
+ 'bottom-right': '',
83
+ left: '',
84
+ 'left-mid': '',
85
+ mid: '',
86
+ 'mid-mid': '',
87
+ right: '',
88
+ 'right-mid': '',
89
+ middle: ' '
90
+ },
91
+ style: {
92
+ 'padding-left': 1,
93
+ 'padding-right': 1
94
+ }
95
+ });
96
+ for (const job of jobs) {
97
+ table.push([job.id, truncate(job.name || '-', 40), getScopeFromLaneId(job.laneId), (0, _rippleUtils().colorPhase)(job.status?.phase), job.user?.username || '-', formatDate(job.status?.startedAt), formatDuration(job.status?.startedAt, job.status?.finishedAt)]);
98
+ }
99
+ const header = ownerUsed ? _chalk().default.gray(`showing jobs for owner "${ownerUsed}" (use --all for all jobs)`) : '';
100
+ return [header, table.toString()].filter(Boolean).join('\n');
101
+ }
102
+ async json(args, flags) {
103
+ const {
104
+ jobs
105
+ } = await this.getFilteredJobs(flags);
106
+ return {
107
+ jobs: jobs || []
108
+ };
109
+ }
110
+ async getFilteredJobs(flags) {
111
+ const requestedLimit = flags.limit ? parseInt(flags.limit, 10) : 20;
112
+ if (!Number.isFinite(requestedLimit) || requestedLimit < 1) {
113
+ throw new Error(`Invalid --limit value "${flags.limit}". Expected a positive integer.`);
114
+ }
115
+
116
+ // build server-side filters
117
+ const filters = {};
118
+
119
+ // determine owner for default filtering (skip when --lane or --scope is given explicitly)
120
+ let ownerUsed;
121
+ if (!flags.all && !flags.lane && !flags.scope) {
122
+ ownerUsed = flags.owner || this.ripple.getDefaultOwner();
123
+ } else if (flags.owner) {
124
+ ownerUsed = flags.owner;
125
+ }
126
+ if (ownerUsed) filters.owners = [ownerUsed];
127
+ if (flags.lane) filters.lanes = [flags.lane];
128
+ if (flags.scope) filters.scopes = [flags.scope];
129
+ if (flags.status) filters.status = flags.status.toUpperCase();
130
+
131
+ // user filter is not supported server-side, so overfetch if needed
132
+ const needsClientFilter = !!flags.user;
133
+ const fetchLimit = needsClientFilter ? Math.max(requestedLimit * 5, 100) : requestedLimit;
134
+ let jobs = await this.ripple.listJobs({
135
+ filters,
136
+ limit: fetchLimit
137
+ });
138
+
139
+ // apply client-side filters for fields not supported by FilterOptions
140
+ if (flags.user) {
141
+ const userFilter = flags.user.toLowerCase();
142
+ jobs = jobs.filter(j => j.user?.username?.toLowerCase().includes(userFilter));
143
+ }
144
+ jobs = jobs.slice(0, requestedLimit);
145
+ return {
146
+ jobs,
147
+ ownerUsed
148
+ };
149
+ }
150
+ }
151
+ exports.RippleListCmd = RippleListCmd;
152
+ class RippleLogCmd {
153
+ constructor(ripple) {
154
+ this.ripple = ripple;
155
+ _defineProperty(this, "name", 'log [job-id]');
156
+ _defineProperty(this, "description", 'show job details and component build task summaries (auto-detects current lane when no job-id given)');
157
+ _defineProperty(this, "skipWorkspace", true);
158
+ _defineProperty(this, "remoteOp", true);
159
+ _defineProperty(this, "alias", '');
160
+ _defineProperty(this, "options", [['', 'lane <lane>', 'lane ID to find the latest job for (default: detected from .bitmap)'], ['c', 'component <component>', 'show build tasks for a specific component (full component ID)'], ['j', 'json', 'return the output as JSON']]);
161
+ _defineProperty(this, "arguments", [{
162
+ name: 'job-id',
163
+ description: 'the Ripple CI job ID (optional — auto-detects from current lane)'
164
+ }]);
165
+ }
166
+ async resolveJob(jobId, flags) {
167
+ if (jobId) {
168
+ return this.ripple.getJob(jobId);
169
+ }
170
+ const laneId = flags.lane || this.ripple.getCurrentLaneId();
171
+ if (!laneId) return null;
172
+ const found = await this.ripple.findLatestJobForLane(laneId);
173
+ return found ? this.ripple.getJob(found.id) : null;
174
+ }
175
+ async report([jobId], flags) {
176
+ const job = await this.resolveJob(jobId, flags);
177
+ if (!job) {
178
+ if (!jobId) {
179
+ const laneId = flags.lane || this.ripple.getCurrentLaneId();
180
+ if (laneId) {
181
+ return _chalk().default.red(`No Ripple CI job found for lane "${laneId}".`);
182
+ }
183
+ return _chalk().default.red('Could not find a Ripple CI job. Provide a job ID, use --lane, or run from a workspace on a lane.');
184
+ }
185
+ return _chalk().default.red(`Job "${jobId}" not found.`);
186
+ }
187
+ const lines = [];
188
+ lines.push(_chalk().default.bold('Job Details'));
189
+ lines.push(` ${_chalk().default.cyan('ID:')} ${job.id}`);
190
+ if (job.name) lines.push(` ${_chalk().default.cyan('Name:')} ${job.name}`);
191
+ lines.push(` ${_chalk().default.cyan('Status:')} ${(0, _rippleUtils().colorPhase)(job.status?.phase)}`);
192
+ if (job.laneId) lines.push(` ${_chalk().default.cyan('Lane:')} ${job.laneId}`);
193
+ if (job.user?.displayName) lines.push(` ${_chalk().default.cyan('User:')} ${job.user.displayName} (${job.user.username})`);
194
+ if (job.status?.startedAt) lines.push(` ${_chalk().default.cyan('Started:')} ${new Date(job.status.startedAt).toLocaleString()}`);
195
+ if (job.status?.finishedAt) lines.push(` ${_chalk().default.cyan('Finished:')} ${new Date(job.status.finishedAt).toLocaleString()}`);
196
+ const jobUrl = this.ripple.getJobUrl(job);
197
+ lines.push(` ${_chalk().default.cyan('URL:')} ${jobUrl}`);
198
+ if (flags.component) {
199
+ await this.appendComponentDetail(lines, job.id, flags.component);
200
+ } else {
201
+ this.appendComponentList(lines, job);
202
+ }
203
+ return lines.join('\n');
204
+ }
205
+ async appendComponentDetail(lines, jobId, componentId) {
206
+ const summary = await this.ripple.getComponentBuildSummary(jobId, componentId);
207
+ if (!summary) {
208
+ lines.push('');
209
+ lines.push(_chalk().default.yellow(`No build summary found for component "${componentId}" in this job.`));
210
+ return;
211
+ }
212
+ lines.push('');
213
+ lines.push(_chalk().default.bold(`Build Tasks for ${summary.name || componentId}`));
214
+ if (!summary.tasks || summary.tasks.length === 0) {
215
+ lines.push(_chalk().default.gray(' No build tasks found.'));
216
+ return;
217
+ }
218
+ const table = new (_cliTable().default)({
219
+ head: [_chalk().default.cyan('Task'), _chalk().default.cyan('Status'), _chalk().default.cyan('Started'), _chalk().default.cyan('Warnings')],
220
+ chars: {
221
+ top: '',
222
+ 'top-mid': '',
223
+ 'top-left': '',
224
+ 'top-right': '',
225
+ bottom: '',
226
+ 'bottom-mid': '',
227
+ 'bottom-left': '',
228
+ 'bottom-right': '',
229
+ left: '',
230
+ 'left-mid': '',
231
+ mid: '',
232
+ 'mid-mid': '',
233
+ right: '',
234
+ 'right-mid': '',
235
+ middle: ' '
236
+ },
237
+ style: {
238
+ 'padding-left': 1,
239
+ 'padding-right': 1
240
+ }
241
+ });
242
+ for (const task of summary.tasks) {
243
+ table.push([task.name || '-', (0, _rippleUtils().colorPhase)(task.status?.status), task.startTime ? new Date(task.startTime).toLocaleString() : '-', task.status?.warnings ? _chalk().default.yellow(String(task.status.warnings)) : '0']);
244
+ }
245
+ lines.push(table.toString());
246
+ }
247
+ appendComponentList(lines, job) {
248
+ const ciNodes = this.ripple.getCiGraphNodes(job);
249
+ if (ciNodes.length === 0) return;
250
+ const totalComponents = ciNodes.reduce((sum, n) => sum + n.componentIds.length, 0);
251
+ lines.push('');
252
+ lines.push(_chalk().default.bold(`Components (${totalComponents})`));
253
+ lines.push(_chalk().default.gray(' Use --component <id> to see build tasks for a specific component'));
254
+ let shown = 0;
255
+ for (const node of ciNodes) {
256
+ if (shown >= 30) {
257
+ lines.push(_chalk().default.gray(` ... and ${totalComponents - shown} more`));
258
+ break;
259
+ }
260
+ for (const compId of node.componentIds) {
261
+ if (shown >= 30) break;
262
+ const icon = (0, _rippleUtils().isFailedPhase)(node.phase) ? _chalk().default.red('✗') : node.phase === 'SUCCESS' ? _chalk().default.green('✓') : _chalk().default.yellow('○');
263
+ lines.push(` ${icon} ${compId}`);
264
+ shown++;
265
+ }
266
+ }
267
+ }
268
+ async json([jobId], flags) {
269
+ const job = await this.resolveJob(jobId, flags);
270
+ if (flags.component && job) {
271
+ const summary = await this.ripple.getComponentBuildSummary(job.id, flags.component);
272
+ return {
273
+ job,
274
+ componentBuild: summary
275
+ };
276
+ }
277
+ return {
278
+ job
279
+ };
280
+ }
281
+ }
282
+ exports.RippleLogCmd = RippleLogCmd;
283
+ class RippleErrorsCmd {
284
+ constructor(ripple) {
285
+ this.ripple = ripple;
286
+ _defineProperty(this, "name", 'errors [job-id]');
287
+ _defineProperty(this, "description", 'show build errors for a Ripple CI job (auto-detects current lane when no job-id given)');
288
+ _defineProperty(this, "skipWorkspace", true);
289
+ _defineProperty(this, "remoteOp", true);
290
+ _defineProperty(this, "alias", '');
291
+ _defineProperty(this, "options", [['', 'lane <lane>', 'lane ID to find the latest failed job for (default: detected from .bitmap)'], ['', 'log', 'show full build log for failed containers (not just the error summary)'], ['j', 'json', 'return the output as JSON']]);
292
+ _defineProperty(this, "arguments", [{
293
+ name: 'job-id',
294
+ description: 'the Ripple CI job ID (optional — auto-detects from current lane)'
295
+ }]);
296
+ }
297
+ async report([jobId], flags) {
298
+ const {
299
+ job,
300
+ ciNodes
301
+ } = await this.getErrors(jobId, flags);
302
+ if (!job) {
303
+ if (jobId) {
304
+ return _chalk().default.red(`Job "${jobId}" not found.`);
305
+ }
306
+ const laneId = flags.lane || this.ripple.getCurrentLaneId();
307
+ if (laneId) {
308
+ return _chalk().default.red(`No failed Ripple CI job found for lane "${laneId}".`);
309
+ }
310
+ return _chalk().default.red('Could not find a Ripple CI job. Provide a job ID, use --lane, or run from a workspace on a lane.');
311
+ }
312
+ const lines = [];
313
+ lines.push(_chalk().default.bold(`Ripple CI Errors — ${job.name || job.id}`));
314
+ lines.push(` ${_chalk().default.cyan('Job ID:')} ${job.id}`);
315
+ lines.push(` ${_chalk().default.cyan('Status:')} ${(0, _rippleUtils().colorPhase)(job.status?.phase)}`);
316
+ if (job.laneId) lines.push(` ${_chalk().default.cyan('Lane:')} ${job.laneId}`);
317
+ lines.push(` ${_chalk().default.cyan('URL:')} ${this.ripple.getJobUrl(job)}`);
318
+ if (ciNodes.length === 0) {
319
+ lines.push('');
320
+ lines.push(_chalk().default.yellow('Could not determine which components are in this job.'));
321
+ return lines.join('\n');
322
+ }
323
+ const failedNodes = ciNodes.filter(n => (0, _rippleUtils().isFailedPhase)(n.phase));
324
+ const succeededNodes = ciNodes.filter(n => n.phase === 'SUCCESS');
325
+ const otherNodes = ciNodes.filter(n => !(0, _rippleUtils().isFailedPhase)(n.phase) && n.phase !== 'SUCCESS');
326
+ const totalComponents = ciNodes.reduce((sum, n) => sum + n.componentIds.length, 0);
327
+ const failedComponents = failedNodes.flatMap(n => n.componentIds);
328
+ const blockedComponents = otherNodes.flatMap(n => n.componentIds);
329
+ if (failedComponents.length === 0) {
330
+ if (job.status?.phase?.toUpperCase() === 'FAILURE') {
331
+ lines.push('');
332
+ lines.push(_chalk().default.yellow(`${totalComponents} component(s) in this job — no individual component failures found.`));
333
+ lines.push(_chalk().default.yellow('The failure may be in a pipeline-level step. Check the Ripple CI URL above.'));
334
+ } else {
335
+ lines.push('');
336
+ lines.push(_chalk().default.green(`All ${totalComponents} component(s) built successfully.`));
337
+ }
338
+ return lines.join('\n');
339
+ }
340
+ lines.push('');
341
+ lines.push(_chalk().default.red.bold(`${failedComponents.length} component(s) with build failures:`));
342
+
343
+ // fetch all build logs in parallel
344
+ const containerNames = failedNodes.map(n => n.containerName);
345
+ const logMap = await this.ripple.getContainerLogs(job.id, containerNames);
346
+ for (const node of failedNodes) {
347
+ const compList = node.componentIds.join(', ');
348
+ lines.push('');
349
+ lines.push(_chalk().default.bold(` ${compList}`));
350
+ const logMessages = logMap.get(node.containerName);
351
+ if (logMessages && logMessages.length > 0) {
352
+ const errorLines = flags.log ? logMessages : this.ripple.extractErrorsFromLog(logMessages);
353
+ if (errorLines.length > 0) {
354
+ for (const msg of errorLines) {
355
+ const clean = (0, _rippleUtils().stripAnsi)(msg);
356
+ // skip stack trace lines (noisy) unless --log is used
357
+ if (!flags.log && /^\s+at\s/.test(clean)) continue;
358
+ if (clean.length > 0) {
359
+ lines.push(` ${clean}`);
360
+ }
361
+ }
362
+ } else {
363
+ lines.push(_chalk().default.gray(' No error details found in build log.'));
364
+ }
365
+ } else {
366
+ lines.push(_chalk().default.gray(' Build log not available.'));
367
+ }
368
+ }
369
+ if (blockedComponents.length > 0) {
370
+ lines.push('');
371
+ lines.push(_chalk().default.yellow(`${blockedComponents.length} component(s) not built (blocked by failure):`));
372
+ for (const compId of blockedComponents) {
373
+ lines.push(` ${_chalk().default.yellow('○')} ${compId}`);
374
+ }
375
+ }
376
+ if (succeededNodes.length > 0) {
377
+ const succeededCount = succeededNodes.reduce((sum, n) => sum + n.componentIds.length, 0);
378
+ lines.push('');
379
+ lines.push(_chalk().default.green(`${succeededCount} component(s) built successfully.`));
380
+ }
381
+ return lines.join('\n');
382
+ }
383
+ async json([jobId], flags) {
384
+ const {
385
+ job,
386
+ ciNodes
387
+ } = await this.getErrors(jobId, flags);
388
+ if (!job) return {
389
+ error: 'No job found',
390
+ job: null,
391
+ ciNodes: [],
392
+ containerLogs: {}
393
+ };
394
+
395
+ // fetch error logs for failed containers in parallel
396
+ const failedNodes = ciNodes.filter(n => (0, _rippleUtils().isFailedPhase)(n.phase));
397
+ const containerNames = failedNodes.map(n => n.containerName);
398
+ const logMap = await this.ripple.getContainerLogs(job.id, containerNames);
399
+ const containerLogs = {};
400
+ for (const [name, messages] of logMap) {
401
+ containerLogs[name] = flags.log ? messages : this.ripple.extractErrorsFromLog(messages);
402
+ }
403
+ return {
404
+ job,
405
+ ciNodes,
406
+ containerLogs
407
+ };
408
+ }
409
+ async getErrors(jobId, flags) {
410
+ let job;
411
+ if (jobId) {
412
+ job = await this.ripple.getJob(jobId);
413
+ } else {
414
+ const laneId = flags.lane || this.ripple.getCurrentLaneId();
415
+ if (!laneId) {
416
+ return {
417
+ job: null,
418
+ ciNodes: []
419
+ };
420
+ }
421
+ const found = await this.ripple.findLatestJobForLane(laneId, 'FAILURE');
422
+ job = found ? await this.ripple.getJob(found.id) : null;
423
+ }
424
+ if (!job) {
425
+ return {
426
+ job: null,
427
+ ciNodes: []
428
+ };
429
+ }
430
+
431
+ // use ciGraph (internal graph) for job-specific build status per container/component
432
+ const ciNodes = this.ripple.getCiGraphNodes(job);
433
+ return {
434
+ job,
435
+ ciNodes
436
+ };
437
+ }
438
+ }
439
+ exports.RippleErrorsCmd = RippleErrorsCmd;
440
+ class RippleRetryCmd {
441
+ constructor(ripple) {
442
+ this.ripple = ripple;
443
+ _defineProperty(this, "name", 'retry [job-id]');
444
+ _defineProperty(this, "description", 'retry a failed Ripple CI job (auto-detects current lane when no job-id given)');
445
+ _defineProperty(this, "skipWorkspace", true);
446
+ _defineProperty(this, "remoteOp", true);
447
+ _defineProperty(this, "alias", '');
448
+ _defineProperty(this, "options", [['', 'lane <lane>', 'lane ID to find the latest job for (default: detected from .bitmap)'], ['j', 'json', 'return the output as JSON']]);
449
+ _defineProperty(this, "arguments", [{
450
+ name: 'job-id',
451
+ description: 'the Ripple CI job ID to retry (optional — auto-detects from current lane)'
452
+ }]);
453
+ }
454
+ async report([jobId], flags) {
455
+ const resolved = await (0, _rippleUtils().resolveJobId)(this.ripple, jobId, flags, {
456
+ allowedPhases: ['FAILURE', 'FAILED'],
457
+ actionVerb: 'retry'
458
+ });
459
+ if ('error' in resolved) return _chalk().default.red(resolved.error);
460
+ const result = await this.ripple.retryJob(resolved.id);
461
+ if (!result) {
462
+ return _chalk().default.red(`Failed to retry job "${resolved.id}". Make sure the job exists and has failed.`);
463
+ }
464
+ const lines = [];
465
+ lines.push(_chalk().default.green(`Successfully retried job "${resolved.id}".`));
466
+ if (result.id) lines.push(` ${_chalk().default.cyan('New Job ID:')} ${result.id}`);
467
+ if (result.status?.phase) lines.push(` ${_chalk().default.cyan('Status:')} ${result.status.phase}`);
468
+ const jobUrl = this.ripple.getJobUrl(result);
469
+ lines.push(` ${_chalk().default.cyan('URL:')} ${jobUrl}`);
470
+ return lines.join('\n');
471
+ }
472
+ async json([jobId], flags) {
473
+ const resolved = await (0, _rippleUtils().resolveJobId)(this.ripple, jobId, flags, {
474
+ allowedPhases: ['FAILURE', 'FAILED'],
475
+ actionVerb: 'retry'
476
+ });
477
+ if ('error' in resolved) return {
478
+ error: resolved.error
479
+ };
480
+ const result = await this.ripple.retryJob(resolved.id);
481
+ return {
482
+ job: result
483
+ };
484
+ }
485
+ }
486
+ exports.RippleRetryCmd = RippleRetryCmd;
487
+ class RippleStopCmd {
488
+ constructor(ripple) {
489
+ this.ripple = ripple;
490
+ _defineProperty(this, "name", 'stop [job-id]');
491
+ _defineProperty(this, "description", 'stop a running Ripple CI job (auto-detects current lane when no job-id given)');
492
+ _defineProperty(this, "skipWorkspace", true);
493
+ _defineProperty(this, "remoteOp", true);
494
+ _defineProperty(this, "alias", '');
495
+ _defineProperty(this, "options", [['', 'lane <lane>', 'lane ID to find the latest job for (default: detected from .bitmap)'], ['j', 'json', 'return the output as JSON']]);
496
+ _defineProperty(this, "arguments", [{
497
+ name: 'job-id',
498
+ description: 'the Ripple CI job ID to stop (optional — auto-detects from current lane)'
499
+ }]);
500
+ }
501
+ async report([jobId], flags) {
502
+ const resolved = await (0, _rippleUtils().resolveJobId)(this.ripple, jobId, flags, {
503
+ allowedPhases: ['RUNNING', 'IN_PROGRESS', 'PROCESSING'],
504
+ actionVerb: 'stop'
505
+ });
506
+ if ('error' in resolved) return _chalk().default.red(resolved.error);
507
+ const result = await this.ripple.stopJob(resolved.id);
508
+ if (!result) {
509
+ return _chalk().default.red(`Failed to stop job "${resolved.id}". Make sure the job exists and is currently running.`);
510
+ }
511
+ return _chalk().default.green(`Successfully stopped job "${resolved.id}".`);
512
+ }
513
+ async json([jobId], flags) {
514
+ const resolved = await (0, _rippleUtils().resolveJobId)(this.ripple, jobId, flags, {
515
+ allowedPhases: ['RUNNING', 'IN_PROGRESS', 'PROCESSING'],
516
+ actionVerb: 'stop'
517
+ });
518
+ if ('error' in resolved) return {
519
+ error: resolved.error
520
+ };
521
+ const result = await this.ripple.stopJob(resolved.id);
522
+ return {
523
+ job: result
524
+ };
525
+ }
526
+ }
527
+ exports.RippleStopCmd = RippleStopCmd;
528
+ function formatDate(dateStr) {
529
+ if (!dateStr) return '-';
530
+ try {
531
+ return new Date(dateStr).toLocaleString();
532
+ } catch {
533
+ return dateStr;
534
+ }
535
+ }
536
+ function formatDuration(startedAt, finishedAt) {
537
+ if (!startedAt) return '-';
538
+ const start = new Date(startedAt).getTime();
539
+ const end = finishedAt ? new Date(finishedAt).getTime() : Date.now();
540
+ const ms = end - start;
541
+ if (ms < 0) return '-';
542
+ const seconds = Math.floor(ms / 1000);
543
+ if (seconds < 60) return `${seconds}s`;
544
+ const minutes = Math.floor(seconds / 60);
545
+ const remainingSeconds = seconds % 60;
546
+ if (minutes < 60) return `${minutes}m ${remainingSeconds}s`;
547
+ const hours = Math.floor(minutes / 60);
548
+ const remainingMinutes = minutes % 60;
549
+ return `${hours}h ${remainingMinutes}m`;
550
+ }
551
+ function getScopeFromLaneId(laneId) {
552
+ if (!laneId) return '-';
553
+ return laneId.split('/')[0] || '-';
554
+ }
555
+ function truncate(str, max) {
556
+ if (str.length <= max) return str;
557
+ return `${str.substring(0, max - 1)}…`;
558
+ }
29
559
 
30
560
  //# sourceMappingURL=ripple.cmd.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["RippleCmd","constructor","_defineProperty","report","code","data","exports"],"sources":["ripple.cmd.ts"],"sourcesContent":["import type { Command, CommandOptions } from '@teambit/cli';\n\nexport class RippleCmd implements Command {\n name = 'ripple <sub-command>';\n description = 'manage Ripple CI jobs on bit.cloud';\n extendedDescription = 'view, retry, and manage Ripple CI jobs that build your components in the cloud after export.';\n group = 'collaborate';\n skipWorkspace = true;\n remoteOp = true;\n\n options: CommandOptions = [];\n commands: Command[] = [];\n\n async report() {\n return { code: 1, data: '[ripple] please specify a subcommand. See --help for available commands.' };\n }\n}\n"],"mappings":";;;;;;;;;AAEO,MAAMA,SAAS,CAAoB;EAAAC,YAAA;IAAAC,eAAA,eACjC,sBAAsB;IAAAA,eAAA,sBACf,oCAAoC;IAAAA,eAAA,8BAC5B,8FAA8F;IAAAA,eAAA,gBAC5G,aAAa;IAAAA,eAAA,wBACL,IAAI;IAAAA,eAAA,mBACT,IAAI;IAAAA,eAAA,kBAEW,EAAE;IAAAA,eAAA,mBACN,EAAE;EAAA;EAExB,MAAMC,MAAMA,CAAA,EAAG;IACb,OAAO;MAAEC,IAAI,EAAE,CAAC;MAAEC,IAAI,EAAE;IAA2E,CAAC;EACtG;AACF;AAACC,OAAA,CAAAN,SAAA,GAAAA,SAAA","ignoreList":[]}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_cliTable","_rippleUtils","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","RippleCmd","constructor","report","code","exports","RippleListCmd","ripple","args","flags","jobs","ownerUsed","getFilteredJobs","length","hint","lane","scope","tip","chalk","yellow","table","Table","head","cyan","chars","top","bottom","left","mid","right","middle","style","job","push","id","truncate","name","getScopeFromLaneId","laneId","colorPhase","status","phase","user","username","formatDate","startedAt","formatDuration","finishedAt","header","gray","toString","filter","Boolean","join","json","requestedLimit","limit","parseInt","isFinite","Error","filters","all","owner","getDefaultOwner","owners","lanes","scopes","toUpperCase","needsClientFilter","fetchLimit","Math","max","listJobs","userFilter","toLowerCase","j","includes","slice","RippleLogCmd","description","resolveJob","jobId","getJob","getCurrentLaneId","found","findLatestJobForLane","red","lines","bold","displayName","Date","toLocaleString","jobUrl","getJobUrl","component","appendComponentDetail","appendComponentList","componentId","summary","getComponentBuildSummary","tasks","task","startTime","warnings","ciNodes","getCiGraphNodes","totalComponents","reduce","sum","n","componentIds","shown","node","compId","icon","isFailedPhase","green","componentBuild","RippleErrorsCmd","getErrors","failedNodes","succeededNodes","otherNodes","failedComponents","flatMap","blockedComponents","containerNames","map","containerName","logMap","getContainerLogs","compList","logMessages","get","errorLines","log","extractErrorsFromLog","msg","clean","stripAnsi","test","succeededCount","error","containerLogs","messages","RippleRetryCmd","resolved","resolveJobId","allowedPhases","actionVerb","result","retryJob","RippleStopCmd","stopJob","dateStr","start","getTime","end","now","ms","seconds","floor","minutes","remainingSeconds","hours","remainingMinutes","split","str","substring"],"sources":["ripple.cmd.ts"],"sourcesContent":["import type { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport Table from 'cli-table';\nimport type { RippleMain, RippleJob, CiGraphNode } from './ripple.main.runtime';\nimport { colorPhase, isFailedPhase, stripAnsi, resolveJobId } from './ripple-utils';\n\nexport class RippleCmd implements Command {\n name = 'ripple <sub-command>';\n description = 'manage Ripple CI jobs on bit.cloud';\n extendedDescription = 'view, retry, and manage Ripple CI jobs that build your components in the cloud after export.';\n group = 'collaborate';\n skipWorkspace = true;\n remoteOp = true;\n\n options: CommandOptions = [];\n commands: Command[] = [];\n\n async report() {\n return { code: 1, data: '[ripple] please specify a subcommand. See --help for available commands.' };\n }\n}\n\nexport class RippleListCmd implements Command {\n name = 'list';\n description = 'list recent Ripple CI jobs (filtered by workspace owner by default)';\n skipWorkspace = true;\n remoteOp = true;\n alias = '';\n\n options: CommandOptions = [\n ['', 'all', 'show jobs from all owners, not just the workspace owner'],\n ['o', 'owner <owner>', 'filter by organization (default: detected from workspace defaultScope)'],\n ['s', 'scope <scope>', 'filter by scope (e.g. \"teambit.cloud\")'],\n ['', 'lane <lane>', 'filter by lane ID (e.g. \"scope/lane-name\")'],\n ['u', 'user <user>', 'filter by username'],\n ['', 'status <status>', 'filter by status (e.g. SUCCESS, FAILURE, RUNNING)'],\n ['l', 'limit <limit>', 'max number of jobs to show (default: 20)'],\n ['j', 'json', 'return the output as JSON'],\n ];\n\n constructor(private ripple: RippleMain) {}\n\n async report(\n args: [],\n flags: {\n all?: boolean;\n owner?: string;\n scope?: string;\n lane?: string;\n user?: string;\n status?: string;\n limit?: string;\n }\n ) {\n const { jobs, ownerUsed } = await this.getFilteredJobs(flags);\n\n if (!jobs || jobs.length === 0) {\n let hint = '';\n if (flags.lane) hint = ` for lane \"${flags.lane}\"`;\n else if (flags.scope) hint = ` for scope \"${flags.scope}\"`;\n else if (ownerUsed) hint = ` for owner \"${ownerUsed}\"`;\n const tip = ownerUsed ? ' Use --all to see jobs from all owners.' : '';\n return chalk.yellow(`No Ripple CI jobs found${hint}.${tip}`);\n }\n\n const table = new Table({\n head: [\n chalk.cyan('Job ID'),\n chalk.cyan('Name'),\n chalk.cyan('Scope'),\n chalk.cyan('Status'),\n chalk.cyan('User'),\n chalk.cyan('Started'),\n chalk.cyan('Duration'),\n ],\n chars: {\n top: '',\n 'top-mid': '',\n 'top-left': '',\n 'top-right': '',\n bottom: '',\n 'bottom-mid': '',\n 'bottom-left': '',\n 'bottom-right': '',\n left: '',\n 'left-mid': '',\n mid: '',\n 'mid-mid': '',\n right: '',\n 'right-mid': '',\n middle: ' ',\n },\n style: { 'padding-left': 1, 'padding-right': 1 },\n });\n\n for (const job of jobs) {\n table.push([\n job.id,\n truncate(job.name || '-', 40),\n getScopeFromLaneId(job.laneId),\n colorPhase(job.status?.phase),\n job.user?.username || '-',\n formatDate(job.status?.startedAt),\n formatDuration(job.status?.startedAt, job.status?.finishedAt),\n ]);\n }\n\n const header = ownerUsed ? chalk.gray(`showing jobs for owner \"${ownerUsed}\" (use --all for all jobs)`) : '';\n return [header, table.toString()].filter(Boolean).join('\\n');\n }\n\n async json(\n args: [],\n flags: {\n all?: boolean;\n owner?: string;\n scope?: string;\n lane?: string;\n user?: string;\n status?: string;\n limit?: string;\n }\n ) {\n const { jobs } = await this.getFilteredJobs(flags);\n return { jobs: jobs || [] };\n }\n\n private async getFilteredJobs(flags: {\n all?: boolean;\n owner?: string;\n scope?: string;\n lane?: string;\n user?: string;\n status?: string;\n limit?: string;\n }): Promise<{ jobs: RippleJob[]; ownerUsed?: string }> {\n const requestedLimit = flags.limit ? parseInt(flags.limit, 10) : 20;\n if (!Number.isFinite(requestedLimit) || requestedLimit < 1) {\n throw new Error(`Invalid --limit value \"${flags.limit}\". Expected a positive integer.`);\n }\n\n // build server-side filters\n const filters: { lanes?: string[]; owners?: string[]; scopes?: string[]; status?: string } = {};\n\n // determine owner for default filtering (skip when --lane or --scope is given explicitly)\n let ownerUsed: string | undefined;\n if (!flags.all && !flags.lane && !flags.scope) {\n ownerUsed = flags.owner || this.ripple.getDefaultOwner();\n } else if (flags.owner) {\n ownerUsed = flags.owner;\n }\n\n if (ownerUsed) filters.owners = [ownerUsed];\n if (flags.lane) filters.lanes = [flags.lane];\n if (flags.scope) filters.scopes = [flags.scope];\n if (flags.status) filters.status = flags.status.toUpperCase();\n\n // user filter is not supported server-side, so overfetch if needed\n const needsClientFilter = !!flags.user;\n const fetchLimit = needsClientFilter ? Math.max(requestedLimit * 5, 100) : requestedLimit;\n let jobs = await this.ripple.listJobs({ filters, limit: fetchLimit });\n\n // apply client-side filters for fields not supported by FilterOptions\n if (flags.user) {\n const userFilter = flags.user.toLowerCase();\n jobs = jobs.filter((j) => j.user?.username?.toLowerCase().includes(userFilter));\n }\n\n jobs = jobs.slice(0, requestedLimit);\n\n return { jobs, ownerUsed };\n }\n}\n\nexport class RippleLogCmd implements Command {\n name = 'log [job-id]';\n description = 'show job details and component build task summaries (auto-detects current lane when no job-id given)';\n skipWorkspace = true;\n remoteOp = true;\n alias = '';\n\n options: CommandOptions = [\n ['', 'lane <lane>', 'lane ID to find the latest job for (default: detected from .bitmap)'],\n ['c', 'component <component>', 'show build tasks for a specific component (full component ID)'],\n ['j', 'json', 'return the output as JSON'],\n ];\n\n arguments = [{ name: 'job-id', description: 'the Ripple CI job ID (optional — auto-detects from current lane)' }];\n\n constructor(private ripple: RippleMain) {}\n\n private async resolveJob(jobId: string | undefined, flags: { lane?: string }) {\n if (jobId) {\n return this.ripple.getJob(jobId);\n }\n const laneId = flags.lane || this.ripple.getCurrentLaneId();\n if (!laneId) return null;\n const found = await this.ripple.findLatestJobForLane(laneId);\n return found ? this.ripple.getJob(found.id) : null;\n }\n\n async report([jobId]: [string], flags: { lane?: string; component?: string }) {\n const job = await this.resolveJob(jobId, flags);\n if (!job) {\n if (!jobId) {\n const laneId = flags.lane || this.ripple.getCurrentLaneId();\n if (laneId) {\n return chalk.red(`No Ripple CI job found for lane \"${laneId}\".`);\n }\n return chalk.red(\n 'Could not find a Ripple CI job. Provide a job ID, use --lane, or run from a workspace on a lane.'\n );\n }\n return chalk.red(`Job \"${jobId}\" not found.`);\n }\n\n const lines: string[] = [];\n lines.push(chalk.bold('Job Details'));\n lines.push(` ${chalk.cyan('ID:')} ${job.id}`);\n if (job.name) lines.push(` ${chalk.cyan('Name:')} ${job.name}`);\n lines.push(` ${chalk.cyan('Status:')} ${colorPhase(job.status?.phase)}`);\n if (job.laneId) lines.push(` ${chalk.cyan('Lane:')} ${job.laneId}`);\n if (job.user?.displayName)\n lines.push(` ${chalk.cyan('User:')} ${job.user.displayName} (${job.user.username})`);\n if (job.status?.startedAt)\n lines.push(` ${chalk.cyan('Started:')} ${new Date(job.status.startedAt).toLocaleString()}`);\n if (job.status?.finishedAt)\n lines.push(` ${chalk.cyan('Finished:')} ${new Date(job.status.finishedAt).toLocaleString()}`);\n const jobUrl = this.ripple.getJobUrl(job);\n lines.push(` ${chalk.cyan('URL:')} ${jobUrl}`);\n\n if (flags.component) {\n await this.appendComponentDetail(lines, job.id, flags.component);\n } else {\n this.appendComponentList(lines, job);\n }\n\n return lines.join('\\n');\n }\n\n private async appendComponentDetail(lines: string[], jobId: string, componentId: string) {\n const summary = await this.ripple.getComponentBuildSummary(jobId, componentId);\n if (!summary) {\n lines.push('');\n lines.push(chalk.yellow(`No build summary found for component \"${componentId}\" in this job.`));\n return;\n }\n lines.push('');\n lines.push(chalk.bold(`Build Tasks for ${summary.name || componentId}`));\n if (!summary.tasks || summary.tasks.length === 0) {\n lines.push(chalk.gray(' No build tasks found.'));\n return;\n }\n const table = new Table({\n head: [chalk.cyan('Task'), chalk.cyan('Status'), chalk.cyan('Started'), chalk.cyan('Warnings')],\n chars: {\n top: '',\n 'top-mid': '',\n 'top-left': '',\n 'top-right': '',\n bottom: '',\n 'bottom-mid': '',\n 'bottom-left': '',\n 'bottom-right': '',\n left: '',\n 'left-mid': '',\n mid: '',\n 'mid-mid': '',\n right: '',\n 'right-mid': '',\n middle: ' ',\n },\n style: { 'padding-left': 1, 'padding-right': 1 },\n });\n for (const task of summary.tasks) {\n table.push([\n task.name || '-',\n colorPhase(task.status?.status),\n task.startTime ? new Date(task.startTime).toLocaleString() : '-',\n task.status?.warnings ? chalk.yellow(String(task.status.warnings)) : '0',\n ]);\n }\n lines.push(table.toString());\n }\n\n private appendComponentList(lines: string[], job: { ciGraph?: string }) {\n const ciNodes = this.ripple.getCiGraphNodes(job);\n if (ciNodes.length === 0) return;\n const totalComponents = ciNodes.reduce((sum, n) => sum + n.componentIds.length, 0);\n lines.push('');\n lines.push(chalk.bold(`Components (${totalComponents})`));\n lines.push(chalk.gray(' Use --component <id> to see build tasks for a specific component'));\n let shown = 0;\n for (const node of ciNodes) {\n if (shown >= 30) {\n lines.push(chalk.gray(` ... and ${totalComponents - shown} more`));\n break;\n }\n for (const compId of node.componentIds) {\n if (shown >= 30) break;\n const icon = isFailedPhase(node.phase)\n ? chalk.red('✗')\n : node.phase === 'SUCCESS'\n ? chalk.green('✓')\n : chalk.yellow('○');\n lines.push(` ${icon} ${compId}`);\n shown++;\n }\n }\n }\n\n async json([jobId]: [string], flags: { lane?: string; component?: string }) {\n const job = await this.resolveJob(jobId, flags);\n if (flags.component && job) {\n const summary = await this.ripple.getComponentBuildSummary(job.id, flags.component);\n return { job, componentBuild: summary };\n }\n return { job };\n }\n}\n\nexport class RippleErrorsCmd implements Command {\n name = 'errors [job-id]';\n description = 'show build errors for a Ripple CI job (auto-detects current lane when no job-id given)';\n skipWorkspace = true;\n remoteOp = true;\n alias = '';\n\n options: CommandOptions = [\n ['', 'lane <lane>', 'lane ID to find the latest failed job for (default: detected from .bitmap)'],\n ['', 'log', 'show full build log for failed containers (not just the error summary)'],\n ['j', 'json', 'return the output as JSON'],\n ];\n\n arguments = [{ name: 'job-id', description: 'the Ripple CI job ID (optional — auto-detects from current lane)' }];\n\n constructor(private ripple: RippleMain) {}\n\n async report([jobId]: [string], flags: { lane?: string; log?: boolean }) {\n const { job, ciNodes } = await this.getErrors(jobId, flags);\n\n if (!job) {\n if (jobId) {\n return chalk.red(`Job \"${jobId}\" not found.`);\n }\n const laneId = flags.lane || this.ripple.getCurrentLaneId();\n if (laneId) {\n return chalk.red(`No failed Ripple CI job found for lane \"${laneId}\".`);\n }\n return chalk.red(\n 'Could not find a Ripple CI job. Provide a job ID, use --lane, or run from a workspace on a lane.'\n );\n }\n\n const lines: string[] = [];\n lines.push(chalk.bold(`Ripple CI Errors — ${job.name || job.id}`));\n lines.push(` ${chalk.cyan('Job ID:')} ${job.id}`);\n lines.push(` ${chalk.cyan('Status:')} ${colorPhase(job.status?.phase)}`);\n if (job.laneId) lines.push(` ${chalk.cyan('Lane:')} ${job.laneId}`);\n lines.push(` ${chalk.cyan('URL:')} ${this.ripple.getJobUrl(job)}`);\n\n if (ciNodes.length === 0) {\n lines.push('');\n lines.push(chalk.yellow('Could not determine which components are in this job.'));\n return lines.join('\\n');\n }\n\n const failedNodes = ciNodes.filter((n) => isFailedPhase(n.phase));\n const succeededNodes = ciNodes.filter((n) => n.phase === 'SUCCESS');\n const otherNodes = ciNodes.filter((n) => !isFailedPhase(n.phase) && n.phase !== 'SUCCESS');\n\n const totalComponents = ciNodes.reduce((sum, n) => sum + n.componentIds.length, 0);\n const failedComponents = failedNodes.flatMap((n) => n.componentIds);\n const blockedComponents = otherNodes.flatMap((n) => n.componentIds);\n\n if (failedComponents.length === 0) {\n if (job.status?.phase?.toUpperCase() === 'FAILURE') {\n lines.push('');\n lines.push(\n chalk.yellow(`${totalComponents} component(s) in this job — no individual component failures found.`)\n );\n lines.push(chalk.yellow('The failure may be in a pipeline-level step. Check the Ripple CI URL above.'));\n } else {\n lines.push('');\n lines.push(chalk.green(`All ${totalComponents} component(s) built successfully.`));\n }\n return lines.join('\\n');\n }\n\n lines.push('');\n lines.push(chalk.red.bold(`${failedComponents.length} component(s) with build failures:`));\n\n // fetch all build logs in parallel\n const containerNames = failedNodes.map((n) => n.containerName);\n const logMap = await this.ripple.getContainerLogs(job.id, containerNames);\n\n for (const node of failedNodes) {\n const compList = node.componentIds.join(', ');\n lines.push('');\n lines.push(chalk.bold(` ${compList}`));\n\n const logMessages = logMap.get(node.containerName);\n if (logMessages && logMessages.length > 0) {\n const errorLines = flags.log ? logMessages : this.ripple.extractErrorsFromLog(logMessages);\n if (errorLines.length > 0) {\n for (const msg of errorLines) {\n const clean = stripAnsi(msg);\n // skip stack trace lines (noisy) unless --log is used\n if (!flags.log && /^\\s+at\\s/.test(clean)) continue;\n if (clean.length > 0) {\n lines.push(` ${clean}`);\n }\n }\n } else {\n lines.push(chalk.gray(' No error details found in build log.'));\n }\n } else {\n lines.push(chalk.gray(' Build log not available.'));\n }\n }\n\n if (blockedComponents.length > 0) {\n lines.push('');\n lines.push(chalk.yellow(`${blockedComponents.length} component(s) not built (blocked by failure):`));\n for (const compId of blockedComponents) {\n lines.push(` ${chalk.yellow('○')} ${compId}`);\n }\n }\n\n if (succeededNodes.length > 0) {\n const succeededCount = succeededNodes.reduce((sum, n) => sum + n.componentIds.length, 0);\n lines.push('');\n lines.push(chalk.green(`${succeededCount} component(s) built successfully.`));\n }\n\n return lines.join('\\n');\n }\n\n async json([jobId]: [string], flags: { lane?: string; log?: boolean }) {\n const { job, ciNodes } = await this.getErrors(jobId, flags);\n if (!job) return { error: 'No job found', job: null, ciNodes: [], containerLogs: {} };\n\n // fetch error logs for failed containers in parallel\n const failedNodes = ciNodes.filter((n) => isFailedPhase(n.phase));\n const containerNames = failedNodes.map((n) => n.containerName);\n const logMap = await this.ripple.getContainerLogs(job.id, containerNames);\n const containerLogs: Record<string, string[]> = {};\n for (const [name, messages] of logMap) {\n containerLogs[name] = flags.log ? messages : this.ripple.extractErrorsFromLog(messages);\n }\n\n return { job, ciNodes, containerLogs };\n }\n\n private async getErrors(\n jobId: string | undefined,\n flags: { lane?: string }\n ): Promise<{\n job: any;\n ciNodes: CiGraphNode[];\n }> {\n let job;\n\n if (jobId) {\n job = await this.ripple.getJob(jobId);\n } else {\n const laneId = flags.lane || this.ripple.getCurrentLaneId();\n if (!laneId) {\n return { job: null, ciNodes: [] };\n }\n const found = await this.ripple.findLatestJobForLane(laneId, 'FAILURE');\n job = found ? await this.ripple.getJob(found.id) : null;\n }\n\n if (!job) {\n return { job: null, ciNodes: [] };\n }\n\n // use ciGraph (internal graph) for job-specific build status per container/component\n const ciNodes = this.ripple.getCiGraphNodes(job);\n\n return { job, ciNodes };\n }\n}\n\nexport class RippleRetryCmd implements Command {\n name = 'retry [job-id]';\n description = 'retry a failed Ripple CI job (auto-detects current lane when no job-id given)';\n skipWorkspace = true;\n remoteOp = true;\n alias = '';\n\n options: CommandOptions = [\n ['', 'lane <lane>', 'lane ID to find the latest job for (default: detected from .bitmap)'],\n ['j', 'json', 'return the output as JSON'],\n ];\n\n arguments = [\n { name: 'job-id', description: 'the Ripple CI job ID to retry (optional — auto-detects from current lane)' },\n ];\n\n constructor(private ripple: RippleMain) {}\n\n async report([jobId]: [string], flags: { lane?: string }) {\n const resolved = await resolveJobId(this.ripple, jobId, flags, {\n allowedPhases: ['FAILURE', 'FAILED'],\n actionVerb: 'retry',\n });\n if ('error' in resolved) return chalk.red(resolved.error);\n\n const result = await this.ripple.retryJob(resolved.id);\n if (!result) {\n return chalk.red(`Failed to retry job \"${resolved.id}\". Make sure the job exists and has failed.`);\n }\n const lines: string[] = [];\n lines.push(chalk.green(`Successfully retried job \"${resolved.id}\".`));\n if (result.id) lines.push(` ${chalk.cyan('New Job ID:')} ${result.id}`);\n if (result.status?.phase) lines.push(` ${chalk.cyan('Status:')} ${result.status.phase}`);\n const jobUrl = this.ripple.getJobUrl(result);\n lines.push(` ${chalk.cyan('URL:')} ${jobUrl}`);\n return lines.join('\\n');\n }\n\n async json([jobId]: [string], flags: { lane?: string }) {\n const resolved = await resolveJobId(this.ripple, jobId, flags, {\n allowedPhases: ['FAILURE', 'FAILED'],\n actionVerb: 'retry',\n });\n if ('error' in resolved) return { error: resolved.error };\n const result = await this.ripple.retryJob(resolved.id);\n return { job: result };\n }\n}\n\nexport class RippleStopCmd implements Command {\n name = 'stop [job-id]';\n description = 'stop a running Ripple CI job (auto-detects current lane when no job-id given)';\n skipWorkspace = true;\n remoteOp = true;\n alias = '';\n\n options: CommandOptions = [\n ['', 'lane <lane>', 'lane ID to find the latest job for (default: detected from .bitmap)'],\n ['j', 'json', 'return the output as JSON'],\n ];\n\n arguments = [\n { name: 'job-id', description: 'the Ripple CI job ID to stop (optional — auto-detects from current lane)' },\n ];\n\n constructor(private ripple: RippleMain) {}\n\n async report([jobId]: [string], flags: { lane?: string }) {\n const resolved = await resolveJobId(this.ripple, jobId, flags, {\n allowedPhases: ['RUNNING', 'IN_PROGRESS', 'PROCESSING'],\n actionVerb: 'stop',\n });\n if ('error' in resolved) return chalk.red(resolved.error);\n\n const result = await this.ripple.stopJob(resolved.id);\n if (!result) {\n return chalk.red(`Failed to stop job \"${resolved.id}\". Make sure the job exists and is currently running.`);\n }\n return chalk.green(`Successfully stopped job \"${resolved.id}\".`);\n }\n\n async json([jobId]: [string], flags: { lane?: string }) {\n const resolved = await resolveJobId(this.ripple, jobId, flags, {\n allowedPhases: ['RUNNING', 'IN_PROGRESS', 'PROCESSING'],\n actionVerb: 'stop',\n });\n if ('error' in resolved) return { error: resolved.error };\n const result = await this.ripple.stopJob(resolved.id);\n return { job: result };\n }\n}\n\nfunction formatDate(dateStr?: string): string {\n if (!dateStr) return '-';\n try {\n return new Date(dateStr).toLocaleString();\n } catch {\n return dateStr;\n }\n}\n\nfunction formatDuration(startedAt?: string, finishedAt?: string): string {\n if (!startedAt) return '-';\n const start = new Date(startedAt).getTime();\n const end = finishedAt ? new Date(finishedAt).getTime() : Date.now();\n const ms = end - start;\n if (ms < 0) return '-';\n const seconds = Math.floor(ms / 1000);\n if (seconds < 60) return `${seconds}s`;\n const minutes = Math.floor(seconds / 60);\n const remainingSeconds = seconds % 60;\n if (minutes < 60) return `${minutes}m ${remainingSeconds}s`;\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return `${hours}h ${remainingMinutes}m`;\n}\n\nfunction getScopeFromLaneId(laneId?: string): string {\n if (!laneId) return '-';\n return laneId.split('/')[0] || '-';\n}\n\nfunction truncate(str: string, max: number): string {\n if (str.length <= max) return str;\n return `${str.substring(0, max - 1)}…`;\n}\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,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