start-command 0.20.1 → 0.20.3
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.
- package/CHANGELOG.md +39 -0
- package/package.json +1 -1
- package/src/bin/cli.js +4 -1
- package/src/lib/docker-utils.js +2 -3
- package/test/output-blocks.test.js +82 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,44 @@
|
|
|
1
1
|
# start-command
|
|
2
2
|
|
|
3
|
+
## 0.20.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 3598f38: Fix visual continuity in docker isolation mode (#73)
|
|
8
|
+
|
|
9
|
+
The empty line is now properly placed after the command line (e.g., `$ docker pull alpine:latest`)
|
|
10
|
+
instead of before it, maintaining consistent visual structure in the timeline output.
|
|
11
|
+
|
|
12
|
+
Before:
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
│
|
|
16
|
+
|
|
17
|
+
$ docker pull alpine:latest
|
|
18
|
+
latest: Pulling from library/alpine
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
After:
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
│
|
|
25
|
+
$ docker pull alpine:latest
|
|
26
|
+
|
|
27
|
+
latest: Pulling from library/alpine
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## 0.20.2
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- 4749051: fix: Remove empty line after virtual command to maintain visual continuity
|
|
35
|
+
- Fixed visual continuity break in docker pull output
|
|
36
|
+
- Removed empty line between timeline marker (`│`) and virtual command line (`$ docker pull`)
|
|
37
|
+
- Output now flows continuously from timeline marker to command to output
|
|
38
|
+
- Applies to all virtual command blocks (currently docker pull operations)
|
|
39
|
+
|
|
40
|
+
Fixes #73
|
|
41
|
+
|
|
3
42
|
## 0.20.1
|
|
4
43
|
|
|
5
44
|
### Patch Changes
|
package/package.json
CHANGED
package/src/bin/cli.js
CHANGED
|
@@ -523,7 +523,10 @@ async function runWithIsolation(
|
|
|
523
523
|
deferCommand,
|
|
524
524
|
})
|
|
525
525
|
);
|
|
526
|
-
|
|
526
|
+
// Only print empty line when not deferring command (docker isolation handles its own spacing)
|
|
527
|
+
if (!deferCommand) {
|
|
528
|
+
console.log('');
|
|
529
|
+
}
|
|
527
530
|
|
|
528
531
|
// Save initial execution record and set global reference for signal cleanup
|
|
529
532
|
if (executionRecord && store) {
|
package/src/lib/docker-utils.js
CHANGED
|
@@ -115,7 +115,7 @@ function dockerPullImage(image) {
|
|
|
115
115
|
createTimelineSeparator,
|
|
116
116
|
} = require('./output-blocks');
|
|
117
117
|
|
|
118
|
-
// Print the virtual command line
|
|
118
|
+
// Print the virtual command line followed by empty line for visual separation
|
|
119
119
|
console.log(createVirtualCommandBlock(`docker pull ${image}`));
|
|
120
120
|
console.log();
|
|
121
121
|
|
|
@@ -142,8 +142,7 @@ function dockerPullImage(image) {
|
|
|
142
142
|
success = false;
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
-
// Print result marker and separator
|
|
146
|
-
console.log();
|
|
145
|
+
// Print result marker and separator (no empty line needed - already printed after command)
|
|
147
146
|
console.log(createVirtualCommandResult(success));
|
|
148
147
|
console.log(createTimelineSeparator());
|
|
149
148
|
|
|
@@ -458,6 +458,88 @@ describe('output-blocks module', () => {
|
|
|
458
458
|
});
|
|
459
459
|
expect(block).not.toContain('$ echo hello');
|
|
460
460
|
});
|
|
461
|
+
|
|
462
|
+
it('should end with empty timeline line when deferCommand is true (issue #73)', () => {
|
|
463
|
+
// Issue #73: Visual continuity - when deferCommand is true,
|
|
464
|
+
// the start block should end with │ (empty timeline line)
|
|
465
|
+
// and no trailing empty line should be added by the CLI
|
|
466
|
+
const block = createStartBlock({
|
|
467
|
+
sessionId: 'test-uuid',
|
|
468
|
+
timestamp: '2025-01-01 00:00:00',
|
|
469
|
+
command: 'echo hello',
|
|
470
|
+
extraLines: [
|
|
471
|
+
'[Isolation] Environment: docker, Mode: attached',
|
|
472
|
+
'[Isolation] Image: alpine:latest',
|
|
473
|
+
'[Isolation] Session: docker-container-123',
|
|
474
|
+
],
|
|
475
|
+
deferCommand: true,
|
|
476
|
+
});
|
|
477
|
+
const lines = block.split('\n');
|
|
478
|
+
// Last line should be empty timeline line (│)
|
|
479
|
+
expect(lines[lines.length - 1]).toBe('│');
|
|
480
|
+
// Should not contain the command
|
|
481
|
+
expect(block).not.toContain('$ echo hello');
|
|
482
|
+
});
|
|
483
|
+
});
|
|
484
|
+
|
|
485
|
+
describe('Visual Continuity (issue #73)', () => {
|
|
486
|
+
it('virtual command block should be followed by empty line for visual separation', () => {
|
|
487
|
+
// Issue #73: The empty line should come AFTER the command
|
|
488
|
+
// ($ docker pull ...), not BEFORE it
|
|
489
|
+
// This test verifies the expected format: command line followed by
|
|
490
|
+
// empty line before output
|
|
491
|
+
const virtualCommand = createVirtualCommandBlock(
|
|
492
|
+
'docker pull alpine:latest'
|
|
493
|
+
);
|
|
494
|
+
expect(virtualCommand).toBe('$ docker pull alpine:latest');
|
|
495
|
+
// The empty line is added by the caller (dockerPullImage)
|
|
496
|
+
// after the command and before running docker pull
|
|
497
|
+
});
|
|
498
|
+
|
|
499
|
+
it('timeline separator should be empty timeline line for visual structure', () => {
|
|
500
|
+
// After virtual command output, we print result marker and separator
|
|
501
|
+
const separator = createTimelineSeparator();
|
|
502
|
+
expect(separator).toBe('│');
|
|
503
|
+
});
|
|
504
|
+
|
|
505
|
+
it('start block with docker isolation should end cleanly for virtual commands', () => {
|
|
506
|
+
// When using docker isolation with defer_command, the block ends with │
|
|
507
|
+
// The virtual command (docker pull) starts immediately after
|
|
508
|
+
const block = createStartBlock({
|
|
509
|
+
sessionId: 'uuid-abc',
|
|
510
|
+
timestamp: '2026-01-08 12:00:00',
|
|
511
|
+
command: 'echo hi',
|
|
512
|
+
extraLines: [
|
|
513
|
+
'[Isolation] Environment: docker, Mode: attached',
|
|
514
|
+
'[Isolation] Image: alpine:latest',
|
|
515
|
+
'[Isolation] Session: docker-1234',
|
|
516
|
+
],
|
|
517
|
+
deferCommand: true,
|
|
518
|
+
});
|
|
519
|
+
|
|
520
|
+
// Expected structure:
|
|
521
|
+
// │ session uuid-abc
|
|
522
|
+
// │ start 2026-01-08 12:00:00
|
|
523
|
+
// │
|
|
524
|
+
// │ isolation docker
|
|
525
|
+
// │ mode attached
|
|
526
|
+
// │ image alpine:latest
|
|
527
|
+
// │ container docker-1234
|
|
528
|
+
// │ <-- ends here with empty timeline line
|
|
529
|
+
const lines = block.split('\n');
|
|
530
|
+
expect(lines[lines.length - 1]).toBe('│');
|
|
531
|
+
|
|
532
|
+
// Next should be virtual command (added separately by docker-utils):
|
|
533
|
+
// $ docker pull alpine:latest
|
|
534
|
+
// <empty line>
|
|
535
|
+
// <docker output>
|
|
536
|
+
// ✓
|
|
537
|
+
// │
|
|
538
|
+
// $ echo hi
|
|
539
|
+
// <empty line>
|
|
540
|
+
// hi
|
|
541
|
+
// ✓
|
|
542
|
+
});
|
|
461
543
|
});
|
|
462
544
|
});
|
|
463
545
|
|