shellfie-cli 2.0.1 → 2.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.
- package/README.md +1 -1
- package/dist/animator.d.ts +8 -0
- package/dist/animator.d.ts.map +1 -0
- package/dist/animator.js +210 -0
- package/dist/animator.js.map +1 -0
- package/dist/dvd-executor-v2.d.ts +76 -0
- package/dist/dvd-executor-v2.d.ts.map +1 -0
- package/dist/dvd-executor-v2.js +258 -0
- package/dist/dvd-executor-v2.js.map +1 -0
- package/dist/dvd-executor.d.ts +144 -0
- package/dist/dvd-executor.d.ts.map +1 -0
- package/dist/dvd-executor.js +669 -0
- package/dist/dvd-executor.js.map +1 -0
- package/dist/dvd-parser.d.ts +96 -0
- package/dist/dvd-parser.d.ts.map +1 -0
- package/dist/dvd-parser.js +279 -0
- package/dist/dvd-parser.js.map +1 -0
- package/dist/dvd.d.ts +31 -0
- package/dist/dvd.d.ts.map +1 -0
- package/dist/dvd.js +154 -0
- package/dist/dvd.js.map +1 -0
- package/dist/frame-animator.d.ts +21 -0
- package/dist/frame-animator.d.ts.map +1 -0
- package/dist/frame-animator.js +254 -0
- package/dist/frame-animator.js.map +1 -0
- package/dist/frame-capture.d.ts +16 -0
- package/dist/frame-capture.d.ts.map +1 -0
- package/dist/frame-capture.js +162 -0
- package/dist/frame-capture.js.map +1 -0
- package/dist/svg-animator-v2.d.ts +23 -0
- package/dist/svg-animator-v2.d.ts.map +1 -0
- package/dist/svg-animator-v2.js +134 -0
- package/dist/svg-animator-v2.js.map +1 -0
- package/dist/svg-animator.d.ts +23 -0
- package/dist/svg-animator.d.ts.map +1 -0
- package/dist/svg-animator.js +134 -0
- package/dist/svg-animator.js.map +1 -0
- package/dist/terminal-renderer.d.ts +34 -0
- package/dist/terminal-renderer.d.ts.map +1 -0
- package/dist/terminal-renderer.js +229 -0
- package/dist/terminal-renderer.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,144 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,EAAE,aAAa,CAAC;CACtB;AAED,MAAM,WAAW,g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