@mediaproc/image 1.4.6 → 1.4.8

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 (45) hide show
  1. package/dist/commands/watermark.d.ts.map +1 -1
  2. package/dist/commands/watermark.js +23 -20
  3. package/dist/commands/watermark.js.map +1 -1
  4. package/dist/register.js +1 -1
  5. package/package.json +6 -6
  6. package/dist/commands/auto-enhance.d.ts +0 -3
  7. package/dist/commands/auto-enhance.d.ts.map +0 -1
  8. package/dist/commands/auto-enhance.js +0 -172
  9. package/dist/commands/auto-enhance.js.map +0 -1
  10. package/dist/commands/auto-orient.d.ts +0 -3
  11. package/dist/commands/auto-orient.d.ts.map +0 -1
  12. package/dist/commands/auto-orient.js +0 -131
  13. package/dist/commands/auto-orient.js.map +0 -1
  14. package/dist/commands/grid.d.ts +0 -3
  15. package/dist/commands/grid.d.ts.map +0 -1
  16. package/dist/commands/grid.js +0 -230
  17. package/dist/commands/grid.js.map +0 -1
  18. package/dist/commands/smart-crop.d.ts +0 -3
  19. package/dist/commands/smart-crop.d.ts.map +0 -1
  20. package/dist/commands/smart-crop.js +0 -158
  21. package/dist/commands/smart-crop.js.map +0 -1
  22. package/dist/commands/stack.d.ts +0 -3
  23. package/dist/commands/stack.d.ts.map +0 -1
  24. package/dist/commands/stack.js +0 -242
  25. package/dist/commands/stack.js.map +0 -1
  26. package/dist/utils/branding.d.ts +0 -6
  27. package/dist/utils/branding.d.ts.map +0 -1
  28. package/dist/utils/branding.js +0 -45
  29. package/dist/utils/branding.js.map +0 -1
  30. package/dist/utils/colorUtils.d.ts +0 -7
  31. package/dist/utils/colorUtils.d.ts.map +0 -1
  32. package/dist/utils/colorUtils.js +0 -82
  33. package/dist/utils/colorUtils.js.map +0 -1
  34. package/dist/utils/explainFormatter.d.ts +0 -2
  35. package/dist/utils/explainFormatter.d.ts.map +0 -1
  36. package/dist/utils/explainFormatter.js +0 -4
  37. package/dist/utils/explainFormatter.js.map +0 -1
  38. package/dist/utils/helpFormatter.d.ts +0 -63
  39. package/dist/utils/helpFormatter.d.ts.map +0 -1
  40. package/dist/utils/helpFormatter.js +0 -171
  41. package/dist/utils/helpFormatter.js.map +0 -1
  42. package/dist/utils/pathValidator.d.ts +0 -48
  43. package/dist/utils/pathValidator.d.ts.map +0 -1
  44. package/dist/utils/pathValidator.js +0 -183
  45. package/dist/utils/pathValidator.js.map +0 -1
@@ -1,230 +0,0 @@
1
- import chalk from 'chalk';
2
- import ora from 'ora';
3
- import * as fs from 'fs';
4
- import { validatePaths, IMAGE_EXTENSIONS, createStandardHelp, resolveOutputPaths, MediaProcError, ErrorType, EXIT_CODES } from '@mediaproc/core';
5
- import { createSharpInstance } from '../utils/sharp.js';
6
- import path from 'node:path';
7
- export function gridCommand(imageCmd) {
8
- imageCmd
9
- .command('grid <images...>')
10
- .description('Create image grid/collage from multiple images')
11
- .option('-c, --columns <number>', 'Number of columns (default: auto-calculate)', parseInt)
12
- .option('-r, --rows <number>', 'Number of rows (default: auto-calculate)', parseInt)
13
- .option('-w, --width <pixels>', 'Cell width in pixels (default: 300)', parseInt, 300)
14
- .option('-h, --height <pixels>', 'Cell height in pixels (default: 300)', parseInt, 300)
15
- .option('-g, --gap <pixels>', 'Gap between images in pixels (default: 10)', parseInt, 10)
16
- .option('-b, --background <color>', 'Background color (default: #FFFFFF)', '#FFFFFF')
17
- .option('-o, --output <path>', 'Output file path (default: grid.jpg)')
18
- .option('-q, --quality <quality>', 'Output quality 1-100 (default: 90)', parseInt, 90)
19
- .option('--dry-run', 'Show what would be done without executing')
20
- .option('--explain [mode]', 'Show a detailed explanation of what this command will do, including technical and human-readable output. Modes: human, details, json. Adds context like timestamp, user, and platform.')
21
- .option('-v, --verbose', 'Verbose output')
22
- .option('--help', 'Display help for grid command')
23
- .action(async (images, options) => {
24
- if (options.help || !images) {
25
- createStandardHelp({
26
- commandName: 'grid',
27
- emoji: '🎞️',
28
- description: 'Create beautiful image grids and collages from multiple images. Perfect for social media posts, photo albums, and presentations.',
29
- usage: ['grid image1.jpg image2.jpg image3.jpg', 'grid *.jpg -c 3 -w 400 -h 400', 'grid photo1.png photo2.png -g 20 -b "#000000"'],
30
- options: [
31
- { flag: '-c, --columns <number>', description: 'Number of columns (auto-calculated if not specified)' },
32
- { flag: '-r, --rows <number>', description: 'Number of rows (auto-calculated if not specified)' },
33
- { flag: '-w, --width <pixels>', description: 'Cell width in pixels (default: 300)' },
34
- { flag: '-h, --height <pixels>', description: 'Cell height in pixels (default: 300)' },
35
- { flag: '-g, --gap <pixels>', description: 'Gap between images (default: 10)' },
36
- { flag: '-b, --background <color>', description: 'Background color - hex or name (default: #FFFFFF)' },
37
- { flag: '-o, --output <path>', description: 'Output file path (default: grid.jpg)' },
38
- { flag: '--dry-run', description: 'Preview changes without executing' },
39
- { flag: '--explain [mode]', description: 'Show a detailed explanation of what this command will do, including technical and human-readable output. Modes: human, details, json. Adds context like timestamp, user, and platform.' },
40
- { flag: '-v, --verbose', description: 'Show detailed output' }
41
- ],
42
- examples: [
43
- { command: 'grid photo1.jpg photo2.jpg photo3.jpg photo4.jpg', description: 'Create 2x2 grid with default settings' },
44
- { command: 'grid *.jpg -c 3 -w 400 -h 400', description: 'Create 3-column grid with 400x400 cells' },
45
- { command: 'grid img1.png img2.png img3.png -g 20 -b black', description: 'Black background with 20px gaps' },
46
- { command: 'grid photo*.jpg -c 5 -o collage.png', description: '5-column grid saved as collage.png' },
47
- { command: 'grid *.jpg -r 2 -w 500 -g 0', description: 'Fixed 2 rows, no gaps' }
48
- ],
49
- additionalSections: [
50
- {
51
- title: 'Layout Options',
52
- items: [
53
- 'Auto layout - Only specify columns or rows, other is calculated',
54
- 'Fixed grid - Specify both columns and rows',
55
- 'Square cells - Use same width and height',
56
- 'Custom aspect - Different width and height for cells'
57
- ]
58
- },
59
- {
60
- title: 'Use Cases',
61
- items: [
62
- 'Instagram multi-image posts',
63
- 'Photo album layouts',
64
- 'Before/after comparisons',
65
- 'Product showcase grids',
66
- 'Portfolio presentations',
67
- 'Social media collages'
68
- ]
69
- },
70
- {
71
- title: 'Common Grid Sizes',
72
- items: [
73
- '2x2 - Four images, Instagram style',
74
- '3x3 - Nine images, classic grid',
75
- '4x4 - Sixteen images, large collage',
76
- '1x3 - Three images horizontal',
77
- '3x1 - Three images vertical'
78
- ]
79
- }
80
- ],
81
- tips: [
82
- 'Images are automatically resized to fit cells',
83
- 'Use --gap 0 for seamless grid',
84
- 'Black/white backgrounds work great for galleries',
85
- 'Square cells (same width/height) look most uniform'
86
- ]
87
- });
88
- process.exit(0);
89
- }
90
- const spinner = ora('Creating grid...').start();
91
- try {
92
- // Validate all input files and output path using core helpers
93
- const { inputFiles, errors } = validatePaths(images.join(','), options.output, {
94
- allowedExtensions: IMAGE_EXTENSIONS,
95
- });
96
- if (errors.length > 0) {
97
- spinner.fail(chalk.red('Validation failed:'));
98
- errors.forEach(err => console.log(chalk.red(` ✗ ${err}`)));
99
- process.exit(1);
100
- }
101
- if (inputFiles.length === 0) {
102
- spinner.fail(chalk.red('No valid images provided'));
103
- process.exit(1);
104
- }
105
- const validImages = inputFiles;
106
- const imageCount = validImages.length;
107
- // Use resolveOutputPaths to get output path
108
- const outputMap = resolveOutputPaths(validImages, options.output || 'grid.jpg', {
109
- newExtension: '.jpg',
110
- });
111
- // For grid, only one output file is created
112
- const outputPath = outputMap.values().next().value;
113
- // Validate quality
114
- let quality = Number(options.quality);
115
- if (isNaN(quality) || quality < 1 || quality > 100) {
116
- throw new MediaProcError({
117
- message: 'Quality must be an integer between 1 and 100',
118
- type: ErrorType.UserInput,
119
- exitCode: EXIT_CODES.USER_INPUT,
120
- });
121
- }
122
- // Calculate grid dimensions
123
- let columns = options.columns;
124
- let rows = options.rows;
125
- if (!columns && !rows) {
126
- // Auto-calculate square-ish grid
127
- columns = Math.ceil(Math.sqrt(validImages.length));
128
- rows = Math.ceil(imageCount / columns);
129
- }
130
- else if (columns && !rows) {
131
- rows = Math.ceil(imageCount / columns);
132
- }
133
- else if (rows && !columns) {
134
- columns = Math.ceil(imageCount / rows);
135
- }
136
- // Use user-supplied cell size (already handled by Commander defaults)
137
- const cellWidth = options.width ?? 300;
138
- const cellHeight = options.height ?? 300;
139
- const gap = options.gap || 10;
140
- const background = options.background || '#FFFFFF';
141
- const gridWidth = columns * cellWidth + (columns - 1) * gap;
142
- const gridHeight = rows * cellHeight + (rows - 1) * gap;
143
- if (options.verbose) {
144
- spinner.info(chalk.blue('Configuration:'));
145
- console.log(chalk.dim(` Images: ${imageCount}`));
146
- console.log(chalk.dim(` Grid: ${columns}x${rows}`));
147
- console.log(chalk.dim(` Cell size: ${cellWidth}x${cellHeight}`));
148
- console.log(chalk.dim(` Gap: ${gap}px`));
149
- console.log(chalk.dim(` Canvas: ${gridWidth}x${gridHeight}`));
150
- console.log(chalk.dim(` Output: ${outputPath}`));
151
- console.log(chalk.dim(` Quality: ${quality}`));
152
- spinner.start('Processing...');
153
- }
154
- if (options.dryRun) {
155
- spinner.info(chalk.yellow('Dry run mode - no changes will be made'));
156
- console.log(chalk.green('✓ Would create grid:'));
157
- console.log(chalk.dim(` Images: ${imageCount}`));
158
- console.log(chalk.dim(` Layout: ${columns}x${rows}`));
159
- console.log(chalk.dim(` Output size: ${gridWidth}x${gridHeight}`));
160
- return;
161
- }
162
- // Create base canvas
163
- const canvas = await createSharpInstance({
164
- create: {
165
- width: gridWidth,
166
- height: gridHeight,
167
- channels: 4,
168
- background: background
169
- }
170
- }).png().toBuffer();
171
- // Process and position images
172
- const composites = [];
173
- for (let i = 0; i < Math.min(imageCount, columns * rows); i++) {
174
- const row = Math.floor(i / columns);
175
- const col = i % columns;
176
- const x = col * (cellWidth + gap);
177
- const y = row * (cellHeight + gap);
178
- // Resize image to fit cell
179
- const processedImage = await createSharpInstance(validImages[i])
180
- .resize(cellWidth, cellHeight, {
181
- fit: 'cover',
182
- position: 'center'
183
- })
184
- .toBuffer();
185
- composites.push({
186
- input: processedImage,
187
- left: x,
188
- top: y
189
- });
190
- }
191
- // Composite all images onto canvas
192
- let sharpInstance = createSharpInstance(canvas).composite(composites);
193
- const ext = path.extname(outputPath).toLowerCase();
194
- if (ext === '.jpg' || ext === '.jpeg') {
195
- sharpInstance = sharpInstance.jpeg({ quality });
196
- }
197
- else if (ext === '.png') {
198
- sharpInstance = sharpInstance.png({ quality });
199
- }
200
- else if (ext === '.webp') {
201
- sharpInstance = sharpInstance.webp({ quality });
202
- }
203
- else if (ext === '.avif') {
204
- sharpInstance = sharpInstance.avif({ quality });
205
- }
206
- else if (ext === '.tiff' || ext === '.tif') {
207
- sharpInstance = sharpInstance.tiff({ quality });
208
- }
209
- await sharpInstance.toFile(outputPath);
210
- const outputStats = fs.statSync(outputPath);
211
- spinner.succeed(chalk.green('✓ Grid created successfully!'));
212
- console.log(chalk.dim(` Images: ${imageCount} (${Math.min(imageCount, columns * rows)} used)`));
213
- console.log(chalk.dim(` Layout: ${columns}x${rows}`));
214
- console.log(chalk.dim(` Cell size: ${cellWidth}x${cellHeight}`));
215
- console.log(chalk.dim(` Output: ${outputPath} (${gridWidth}x${gridHeight})`));
216
- console.log(chalk.dim(` File size: ${(outputStats.size / 1024).toFixed(2)}KB`));
217
- }
218
- catch (error) {
219
- spinner.fail(chalk.red('Failed to create grid'));
220
- if (options.verbose) {
221
- console.error(chalk.red('Error details:'), error);
222
- }
223
- else {
224
- console.error(chalk.red(error.message));
225
- }
226
- process.exit(1);
227
- }
228
- });
229
- }
230
- //# sourceMappingURL=grid.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"grid.js","sourceRoot":"","sources":["../../src/commands/grid.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,cAAc,EAAE,SAAS,EAAE,UAAU,EAAE,MA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AO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE,KAAK,CAAC,CAAC;YACpD,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAE,KAAe,CAAC,OAAO,CAAC,CAAC,CAAC;YACrD,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { Command } from 'commander';
2
- export declare function smartCropCommand(imageCmd: Command): void;
3
- //# sourceMappingURL=smart-crop.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"smart-crop.d.ts","sourceRoot":"","sources":["../../src/commands/smart-crop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAmBzC,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAmKxD"}
@@ -1,158 +0,0 @@
1
- import chalk from 'chalk';
2
- import ora from 'ora';
3
- import { validatePaths, resolveOutputPaths, IMAGE_EXTENSIONS, getFileName, createStandardHelp, showPluginBranding } from '@mediaproc/core';
4
- import { createSharpInstance } from '../utils/sharp.js';
5
- export function smartCropCommand(imageCmd) {
6
- imageCmd
7
- .command('smart-crop <input>')
8
- .description('Intelligent cropping based on image content')
9
- .requiredOption('-w, --width <pixels>', 'Target width', parseInt)
10
- .requiredOption('-h, --height <pixels>', 'Target height', parseInt)
11
- .option('-s, --strategy <type>', 'Cropping strategy: entropy (default), attention', 'entropy')
12
- .option('-o, --output <path>', 'Output file path')
13
- .option('--dry-run', 'Show what would be done without executing')
14
- .option('-v, --verbose', 'Verbose output')
15
- .option('--explain [mode]', 'Show a detailed explanation of what this command will do, including technical and human-readable output. Modes: human, details, json. Adds context like timestamp, user, and platform.')
16
- .option('--help', 'Display help for smart-crop command')
17
- .action(async (input, options) => {
18
- if (options.help || !input) {
19
- createStandardHelp({
20
- commandName: 'smart-crop',
21
- emoji: '🎯',
22
- description: 'Intelligently crop images to target dimensions while preserving the most important content. Uses entropy or attention-based algorithms.',
23
- usage: ['smart-crop <input> -w 1200 -h 630', 'smart-crop <input> -w 800 -h 800 --strategy attention', 'smart-crop <input> -w 1920 -h 1080 -o banner.jpg'],
24
- options: [
25
- { flag: '-w, --width <pixels>', description: 'Target width in pixels (required)' },
26
- { flag: '-h, --height <pixels>', description: 'Target height in pixels (required)' },
27
- { flag: '-s, --strategy <type>', description: 'Cropping strategy: entropy (edges/details) or attention (center-weighted) (default: entropy)' },
28
- { flag: '-o, --output <path>', description: 'Output file path' },
29
- { flag: '--dry-run', description: 'Preview changes without executing' },
30
- { flag: '--explain [mode]', description: 'Show a detailed explanation of what this command will do, including technical and human-readable output. Modes: human, details, json. Adds context like timestamp, user, and platform.' },
31
- { flag: '-v, --verbose', description: 'Show detailed output' }
32
- ],
33
- examples: [
34
- { command: 'smart-crop photo.jpg -w 1200 -h 630', description: 'Create social media banner' },
35
- { command: 'smart-crop portrait.jpg -w 800 -h 800 --strategy attention', description: 'Square crop with center focus' },
36
- { command: 'smart-crop landscape.jpg -w 1920 -h 1080', description: 'Full HD crop with detail preservation' },
37
- { command: 'smart-crop product.png -w 600 -h 600 -o thumbnail.png', description: 'Smart product thumbnail' }
38
- ],
39
- additionalSections: [
40
- {
41
- title: 'Cropping Strategies',
42
- items: [
43
- 'entropy - Analyzes image details and edges, preserves high-information areas',
44
- 'attention - Center-weighted, ideal for portraits and centered subjects',
45
- 'Both strategies avoid cutting off important content'
46
- ]
47
- },
48
- {
49
- title: 'Use Cases',
50
- items: [
51
- 'Social media images (Facebook, Twitter, LinkedIn)',
52
- 'Product thumbnails for e-commerce',
53
- 'Blog post featured images',
54
- 'Profile pictures and avatars',
55
- 'Banner images for websites',
56
- 'Mobile app screenshots'
57
- ]
58
- },
59
- {
60
- title: 'Common Dimensions',
61
- items: [
62
- '1200x630 - Facebook/LinkedIn shared posts',
63
- '1024x512 - Twitter cards',
64
- '1080x1080 - Instagram square posts',
65
- '1080x1920 - Instagram stories',
66
- '800x800 - General square thumbnails',
67
- '1920x1080 - Full HD banners'
68
- ]
69
- }
70
- ],
71
- tips: [
72
- 'Use entropy for landscapes and detailed images',
73
- 'Use attention for portraits and centered subjects',
74
- 'Preview with --dry-run to check crop area',
75
- 'Works best when target size is smaller than source'
76
- ]
77
- });
78
- process.exit(0);
79
- }
80
- const spinner = ora('Analyzing image content...').start();
81
- try {
82
- // Validate input paths
83
- const { inputFiles, outputPath, errors } = validatePaths(input, options.output, {
84
- allowedExtensions: IMAGE_EXTENSIONS,
85
- });
86
- if (errors.length > 0) {
87
- spinner.fail(chalk.red('Validation failed:'));
88
- errors.forEach(err => console.log(chalk.red(` ✗ ${err}`)));
89
- process.exit(1);
90
- }
91
- if (inputFiles.length === 0) {
92
- spinner.fail(chalk.red('No valid image files found'));
93
- process.exit(1);
94
- }
95
- const outputPaths = resolveOutputPaths(inputFiles, outputPath, {
96
- suffix: '-cropped',
97
- });
98
- let successCount = 0;
99
- let failCount = 0;
100
- if (options.verbose) {
101
- spinner.info(chalk.blue('Configuration:'));
102
- console.log(chalk.dim(` Found ${inputFiles.length} file(s)`));
103
- console.log(chalk.dim(` Target: ${options.width}x${options.height}`));
104
- console.log(chalk.dim(` Strategy: ${options.strategy}`));
105
- spinner.start('Processing...');
106
- }
107
- if (options.dryRun) {
108
- spinner.info(chalk.yellow('Dry run mode - no changes will be made'));
109
- console.log(chalk.green(`✓ Would smart crop ${inputFiles.length} file(s):`));
110
- inputFiles.forEach(f => console.log(chalk.dim(` - ${f}`)));
111
- console.log(chalk.dim(` To: ${options.width}x${options.height}`));
112
- console.log(chalk.dim(` Strategy: ${options.strategy}`));
113
- showPluginBranding('Image', '../../package.json');
114
- return;
115
- }
116
- const strategy = options.strategy === 'attention' ? 'attention' : 'entropy';
117
- // Process all files
118
- for (const inputFile of inputFiles) {
119
- try {
120
- const fileName = getFileName(inputFile);
121
- const outputPath = outputPaths.get(inputFile);
122
- await createSharpInstance(inputFile)
123
- .resize(options.width, options.height, {
124
- fit: 'cover',
125
- position: strategy
126
- })
127
- .toFile(outputPath);
128
- spinner.succeed(chalk.green(`✓ ${fileName} smart cropped`));
129
- successCount++;
130
- }
131
- catch (error) {
132
- spinner.fail(chalk.red(`✗ Failed: ${getFileName(inputFile)}`));
133
- if (options.verbose && error instanceof Error) {
134
- console.log(chalk.red(` Error: ${error.message}`));
135
- }
136
- failCount++;
137
- }
138
- }
139
- console.log(chalk.bold('\nSummary:'));
140
- console.log(chalk.green(` ✓ Success: ${successCount}`));
141
- if (failCount > 0) {
142
- console.log(chalk.red(` ✗ Failed: ${failCount}`));
143
- }
144
- showPluginBranding('Image', '../../package.json');
145
- }
146
- catch (error) {
147
- spinner.fail(chalk.red('Processing failed'));
148
- if (options.verbose) {
149
- console.error(chalk.red('Error details:'), error);
150
- }
151
- else {
152
- console.error(chalk.red(error.message));
153
- }
154
- process.exit(1);
155
- }
156
- });
157
- }
158
- //# sourceMappingURL=smart-crop.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"smart-crop.js","sourceRoot":"","sources":["../../src/commands/smart-crop.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC3I,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAcxD,MAAM,UAAU,gBAAgB,CAAC,QAAiB;IAChD,QAAQ;SACL,OAAO,CAAC,oBAAoB,CAAC;SAC7B,WAAW,CAAC,6CAA6C,CAAC;SAC1D,cAAc,CAAC,sBAAsB,EAAE,cAAc,EAAE,QAAQ,CAAC;SAChE,cAAc,CAAC,uBAAuB,EAAE,eAAe,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//# sourceMappingURL=stack.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stack.d.ts","sourceRoot":"","sources":["../../src/commands/stack.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoBzC,wBAAgB,YAAY,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CA2PpD"}