shellfie-cli 2.0.2 → 2.0.9

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 (43) hide show
  1. package/README.md +28 -9
  2. package/dist/cli.js +0 -0
  3. package/package.json +6 -2
  4. package/dist/animator.d.ts +0 -8
  5. package/dist/animator.d.ts.map +0 -1
  6. package/dist/animator.js +0 -210
  7. package/dist/animator.js.map +0 -1
  8. package/dist/dvd-executor-v2.d.ts +0 -76
  9. package/dist/dvd-executor-v2.d.ts.map +0 -1
  10. package/dist/dvd-executor-v2.js +0 -258
  11. package/dist/dvd-executor-v2.js.map +0 -1
  12. package/dist/dvd-executor.d.ts +0 -144
  13. package/dist/dvd-executor.d.ts.map +0 -1
  14. package/dist/dvd-executor.js +0 -669
  15. package/dist/dvd-executor.js.map +0 -1
  16. package/dist/dvd-parser.d.ts +0 -96
  17. package/dist/dvd-parser.d.ts.map +0 -1
  18. package/dist/dvd-parser.js +0 -279
  19. package/dist/dvd-parser.js.map +0 -1
  20. package/dist/dvd.d.ts +0 -31
  21. package/dist/dvd.d.ts.map +0 -1
  22. package/dist/dvd.js +0 -154
  23. package/dist/dvd.js.map +0 -1
  24. package/dist/frame-animator.d.ts +0 -21
  25. package/dist/frame-animator.d.ts.map +0 -1
  26. package/dist/frame-animator.js +0 -254
  27. package/dist/frame-animator.js.map +0 -1
  28. package/dist/frame-capture.d.ts +0 -16
  29. package/dist/frame-capture.d.ts.map +0 -1
  30. package/dist/frame-capture.js +0 -162
  31. package/dist/frame-capture.js.map +0 -1
  32. package/dist/svg-animator-v2.d.ts +0 -23
  33. package/dist/svg-animator-v2.d.ts.map +0 -1
  34. package/dist/svg-animator-v2.js +0 -134
  35. package/dist/svg-animator-v2.js.map +0 -1
  36. package/dist/svg-animator.d.ts +0 -23
  37. package/dist/svg-animator.d.ts.map +0 -1
  38. package/dist/svg-animator.js +0 -134
  39. package/dist/svg-animator.js.map +0 -1
  40. package/dist/terminal-renderer.d.ts +0 -34
  41. package/dist/terminal-renderer.d.ts.map +0 -1
  42. package/dist/terminal-renderer.js +0 -229
  43. package/dist/terminal-renderer.js.map +0 -1
@@ -1,258 +0,0 @@
1
- "use strict";
2
- /**
3
- * DVD Command Executor V2
4
- * Executes real commands with typing effect and cursor
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.DVDExecutorV2 = void 0;
8
- const node_child_process_1 = require("node:child_process");
9
- const node_util_1 = require("node:util");
10
- const terminal_renderer_1 = require("./terminal-renderer");
11
- const execAsync = (0, node_util_1.promisify)(node_child_process_1.exec);
12
- class DVDExecutorV2 {
13
- context;
14
- options;
15
- constructor(options = {}) {
16
- this.options = options;
17
- this.context = {
18
- lines: [''],
19
- currentLine: '',
20
- cursorX: 0,
21
- cursorY: 0,
22
- frames: [],
23
- clipboard: '',
24
- startTime: Date.now(),
25
- width: options.width || 800,
26
- height: options.height || 600,
27
- fontSize: options.fontSize || 14,
28
- title: options.title,
29
- template: options.template || 'macos',
30
- };
31
- }
32
- /**
33
- * Capture current terminal state as a frame
34
- */
35
- captureFrame(showCursor = true) {
36
- const buffer = [...this.context.lines];
37
- buffer[this.context.cursorY] = this.context.currentLine;
38
- const state = (0, terminal_renderer_1.createTerminalState)(buffer.join('\n'), this.context.cursorX, this.context.cursorY, this.context.width, this.context.height, this.context.fontSize, showCursor);
39
- const svg = (0, terminal_renderer_1.renderTerminalSVG)(state, {
40
- title: this.context.title,
41
- template: this.context.template,
42
- });
43
- const frame = {
44
- timestamp: Date.now() - this.context.startTime,
45
- svg,
46
- state,
47
- };
48
- this.context.frames.push(frame);
49
- this.options.onFrame?.(frame);
50
- }
51
- /**
52
- * Execute Type command - simulate typing character by character
53
- */
54
- async executeType(text, speed) {
55
- const delay = speed || 50;
56
- for (const char of text) {
57
- this.context.currentLine += char;
58
- this.context.cursorX++;
59
- // Capture frame showing the new character with cursor
60
- await new Promise((resolve) => setTimeout(resolve, delay));
61
- this.captureFrame(true);
62
- }
63
- }
64
- /**
65
- * Execute Enter - run the command and capture output
66
- */
67
- async executeEnter() {
68
- const command = this.context.currentLine.trim();
69
- // Finalize current line (the command that was typed)
70
- this.context.lines[this.context.cursorY] = this.context.currentLine;
71
- // Move to next line
72
- this.context.cursorY++;
73
- this.context.cursorX = 0;
74
- this.context.currentLine = '';
75
- if (!this.context.lines[this.context.cursorY]) {
76
- this.context.lines[this.context.cursorY] = '';
77
- }
78
- // Capture frame showing command was submitted (cursor on new line)
79
- await new Promise((resolve) => setTimeout(resolve, 100));
80
- this.captureFrame(true);
81
- // Execute the command if it's not empty
82
- if (command) {
83
- try {
84
- const { stdout, stderr } = await execAsync(command, {
85
- env: { ...process.env, FORCE_COLOR: '1', CLICOLOR_FORCE: '1' },
86
- maxBuffer: 10 * 1024 * 1024, // 10MB buffer
87
- });
88
- const output = (stdout + stderr).trim();
89
- if (output) {
90
- // Split output into lines and add to terminal
91
- const outputLines = output.split('\n');
92
- for (const line of outputLines) {
93
- this.context.lines[this.context.cursorY] = line;
94
- this.context.cursorY++;
95
- this.context.lines[this.context.cursorY] = '';
96
- }
97
- // Capture frame showing command output
98
- await new Promise((resolve) => setTimeout(resolve, 100));
99
- this.captureFrame(true);
100
- }
101
- }
102
- catch (err) {
103
- // Command failed - show error output
104
- const error = err;
105
- const errorOutput = (error.stderr || error.stdout || 'Command failed').trim();
106
- const errorLines = errorOutput.split('\n');
107
- for (const line of errorLines) {
108
- this.context.lines[this.context.cursorY] = line;
109
- this.context.cursorY++;
110
- this.context.lines[this.context.cursorY] = '';
111
- }
112
- await new Promise((resolve) => setTimeout(resolve, 100));
113
- this.captureFrame(true);
114
- }
115
- }
116
- }
117
- /**
118
- * Execute arrow keys
119
- */
120
- async executeArrow(direction) {
121
- switch (direction) {
122
- case 'Left':
123
- if (this.context.cursorX > 0)
124
- this.context.cursorX--;
125
- break;
126
- case 'Right':
127
- if (this.context.cursorX < this.context.currentLine.length)
128
- this.context.cursorX++;
129
- break;
130
- case 'Up':
131
- if (this.context.cursorY > 0) {
132
- this.context.cursorY--;
133
- this.context.currentLine = this.context.lines[this.context.cursorY];
134
- this.context.cursorX = Math.min(this.context.cursorX, this.context.currentLine.length);
135
- }
136
- break;
137
- case 'Down':
138
- if (this.context.cursorY < this.context.lines.length - 1) {
139
- this.context.cursorY++;
140
- this.context.currentLine = this.context.lines[this.context.cursorY];
141
- this.context.cursorX = Math.min(this.context.cursorX, this.context.currentLine.length);
142
- }
143
- break;
144
- }
145
- await new Promise((resolve) => setTimeout(resolve, 50));
146
- this.captureFrame(true);
147
- }
148
- /**
149
- * Execute Backspace
150
- */
151
- async executeBackspace() {
152
- if (this.context.cursorX > 0) {
153
- this.context.currentLine =
154
- this.context.currentLine.slice(0, this.context.cursorX - 1) +
155
- this.context.currentLine.slice(this.context.cursorX);
156
- this.context.cursorX--;
157
- await new Promise((resolve) => setTimeout(resolve, 50));
158
- this.captureFrame(true);
159
- }
160
- }
161
- /**
162
- * Execute a single command
163
- */
164
- async executeCommand(command) {
165
- switch (command.type) {
166
- case 'Type':
167
- await this.executeType(command.text, command.speed);
168
- break;
169
- case 'Key':
170
- if (['Left', 'Right', 'Up', 'Down'].includes(command.key)) {
171
- await this.executeArrow(command.key);
172
- }
173
- else if (command.key === 'Enter') {
174
- await this.executeEnter();
175
- }
176
- else if (command.key === 'Backspace') {
177
- await this.executeBackspace();
178
- }
179
- else if (command.key === 'Space') {
180
- await this.executeType(' ');
181
- }
182
- else if (command.key === 'Tab') {
183
- await this.executeType(' '); // 4 spaces
184
- }
185
- break;
186
- case 'Sleep':
187
- await new Promise((resolve) => setTimeout(resolve, command.duration));
188
- this.captureFrame(true);
189
- break;
190
- case 'Screenshot':
191
- this.captureFrame(true);
192
- break;
193
- case 'Copy':
194
- this.context.clipboard = command.text;
195
- break;
196
- case 'Paste':
197
- if (this.context.clipboard) {
198
- await this.executeType(this.context.clipboard);
199
- }
200
- break;
201
- case 'Hide':
202
- case 'Show':
203
- case 'Output':
204
- case 'Require':
205
- case 'Set':
206
- case 'Source':
207
- case 'Env':
208
- case 'Comment':
209
- case 'Shortcut':
210
- case 'Wait':
211
- // Not implemented in simulation mode
212
- break;
213
- }
214
- }
215
- /**
216
- * Execute complete DVD script
217
- */
218
- async execute(script) {
219
- // Apply settings
220
- for (const [key, value] of script.settings.entries()) {
221
- if (key === 'Width')
222
- this.context.width = parseInt(value, 10);
223
- if (key === 'Height')
224
- this.context.height = parseInt(value, 10);
225
- if (key === 'FontSize')
226
- this.context.fontSize = parseInt(value, 10);
227
- if (key === 'Title')
228
- this.context.title = value;
229
- if (key === 'Template')
230
- this.context.template = value;
231
- }
232
- // Capture initial frame
233
- this.captureFrame(true);
234
- // Execute commands
235
- const actionCommands = script.commands.filter((cmd) => !['Output', 'Require', 'Set', 'Env'].includes(cmd.type));
236
- for (let i = 0; i < actionCommands.length; i++) {
237
- await this.executeCommand(actionCommands[i]);
238
- this.options.onProgress?.(i + 1, actionCommands.length);
239
- }
240
- // Capture final frame without cursor
241
- this.captureFrame(false);
242
- return this.context.frames;
243
- }
244
- /**
245
- * Get all captured frames
246
- */
247
- getFrames() {
248
- return this.context.frames;
249
- }
250
- /**
251
- * Cleanup (no-op for simulation)
252
- */
253
- async cleanup() {
254
- // Nothing to clean up in simulation mode
255
- }
256
- }
257
- exports.DVDExecutorV2 = DVDExecutorV2;
258
- //# sourceMappingURL=dvd-executor-v2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dvd-executor-v2.js","sourceRoot":"","sources":["../src/dvd-executor-v2.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2DAA0C;AAC1C,yCAAsC;AAEtC,2DAAiG;AAEjG,MAAM,SAAS,GAAG,IAAA,qBAAS,EAAC,yBAAI,CAAC,CAAC;AAiClC,MAAa,aAAa;IAChB,OAAO,CAAmB;IAC1B,OAAO,CAAqB;IAEpC,YAAY,UAA8B,EAAE;QAC1C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,IAAI,CAAC,OAAO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CAAyC;IAC3C,CAAC;CACF;AAzRD,sCAyRC"}
@@ -1,144 +0,0 @@
1
- /**
2
- * DVD Command Executor
3
- * Executes real commands with typing effect and cursor
4
- */
5
- import type { DVDScript } from './dvd-parser';
6
- import { type TerminalState } from './terminal-renderer';
7
- import { type Theme } from 'shellfie';
8
- export interface TerminalFrame {
9
- timestamp: number;
10
- svg: string;
11
- state: TerminalState;
12
- }
13
- export interface SimulatorContext {
14
- lines: string[];
15
- currentLine: string;
16
- cursorX: number;
17
- cursorY: number;
18
- frames: TerminalFrame[];
19
- clipboard: string;
20
- startTime: number;
21
- width: number;
22
- height: number;
23
- fontSize: number;
24
- typingSpeed: number;
25
- title?: string;
26
- template?: 'macos' | 'windows' | 'minimal';
27
- promptPrefix: string;
28
- theme?: Theme;
29
- cursorBlink: boolean;
30
- selectionStart?: number;
31
- selectionEnd?: number;
32
- watermark?: string;
33
- screenshotCounter: number;
34
- outputPath?: string;
35
- }
36
- export interface DVDExecutorOptions {
37
- width?: number;
38
- height?: number;
39
- fontSize?: number;
40
- title?: string;
41
- template?: 'macos' | 'windows' | 'minimal';
42
- theme?: Theme;
43
- onFrame?: (frame: TerminalFrame) => void;
44
- onProgress?: (current: number, total: number, description?: string) => void;
45
- }
46
- export declare class DVDExecutor {
47
- private context;
48
- private options;
49
- constructor(options?: DVDExecutorOptions);
50
- /**
51
- * Capture current terminal state as a frame
52
- */
53
- private captureFrame;
54
- /**
55
- * Execute Type command - simulate typing character by character
56
- */
57
- private executeType;
58
- /**
59
- * Strip ANSI escape codes to get actual string length
60
- */
61
- private stripAnsi;
62
- /**
63
- * Execute Enter - run the command and capture streaming output
64
- */
65
- private executeEnter;
66
- /**
67
- * Execute command with streaming output support
68
- */
69
- private executeCommandStreaming;
70
- /**
71
- * Execute arrow keys
72
- */
73
- private executeArrow;
74
- /**
75
- * Execute Screenshot - save current terminal state as static SVG using shellfie
76
- */
77
- private executeScreenshot;
78
- /**
79
- * Execute Backspace - delete characters with animation
80
- */
81
- private executeBackspace;
82
- /**
83
- * Execute keyboard shortcut with modifiers
84
- */
85
- private executeShortcut;
86
- /**
87
- * Execute selection movement (Shift + Left/Right)
88
- */
89
- private executeSelectionMove;
90
- /**
91
- * Execute word movement (Alt + Left/Right)
92
- */
93
- private executeWordMove;
94
- /**
95
- * Execute word selection (Alt + Shift + Left/Right)
96
- */
97
- private executeWordSelection;
98
- /**
99
- * Execute line navigation (Cmd/Ctrl + Left/Right)
100
- */
101
- private executeLineNavigation;
102
- /**
103
- * Execute word deletion (Cmd/Ctrl + Backspace)
104
- */
105
- private executeWordDelete;
106
- /**
107
- * Check if there's an active selection
108
- */
109
- private hasSelection;
110
- /**
111
- * Get selected text
112
- */
113
- private getSelectedText;
114
- /**
115
- * Clear selection
116
- */
117
- private clearSelection;
118
- /**
119
- * Delete selected text and return true if selection was deleted
120
- */
121
- private deleteSelection;
122
- /**
123
- * Find word boundary in the given direction
124
- * Returns the position of the word boundary
125
- */
126
- private findWordBoundary;
127
- /**
128
- * Execute a single command
129
- */
130
- private executeCommand;
131
- /**
132
- * Execute complete DVD script
133
- */
134
- execute(script: DVDScript): Promise<TerminalFrame[]>;
135
- /**
136
- * Get all captured frames
137
- */
138
- getFrames(): TerminalFrame[];
139
- /**
140
- * Cleanup (no-op for simulation)
141
- */
142
- cleanup(): Promise<void>;
143
- }
144
- //# sourceMappingURL=dvd-executor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dvd-executor.d.ts","sourceRoot":"","sources":["../src/dvd-executor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAc,SAAS,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAA0C,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACjG,OAAO,EAAU,KAAK,KAAK,EAAY,MAAM,UAAU,CAAC;AAExD,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK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