@qodalis/cli-files 2.0.0-beta.1

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.
@@ -0,0 +1,995 @@
1
+ import * as _qodalis_cli_core from '@qodalis/cli-core';
2
+ import { ICliOwnership, ICliCommandProcessor, CliProcessCommand, ICliExecutionContext, ICliFileTransferService, ICliFileEntry, ICliCompletionProvider, ICliCompletionContext, ICliModule } from '@qodalis/cli-core';
3
+
4
+ /**
5
+ * Represents a node in the virtual filesystem (file or directory).
6
+ */
7
+ interface IFileNode {
8
+ /** Name of the file or directory */
9
+ name: string;
10
+ /** Node type */
11
+ type: 'file' | 'directory';
12
+ /** File content (text only, undefined for directories) */
13
+ content?: string;
14
+ /** Child nodes (only for directories) */
15
+ children?: IFileNode[];
16
+ /** Creation timestamp (ms since epoch) */
17
+ createdAt: number;
18
+ /** Last modification timestamp (ms since epoch) */
19
+ modifiedAt: number;
20
+ /** Size in bytes (content length for files, 0 for directories) */
21
+ size: number;
22
+ /** Unix-style permission string (e.g. "rwxr-xr-x") */
23
+ permissions?: string;
24
+ /** Owner and group metadata */
25
+ ownership?: ICliOwnership;
26
+ /** Target path for symbolic links */
27
+ linkTarget?: string;
28
+ }
29
+
30
+ declare const IFileSystemService_TOKEN = "cli-file-system-service";
31
+ /**
32
+ * Abstraction for virtual filesystem operations.
33
+ */
34
+ interface IFileSystemService {
35
+ getCurrentDirectory(): string;
36
+ setCurrentDirectory(path: string): void;
37
+ resolvePath(path: string): string;
38
+ getHomePath(): string;
39
+ setHomePath(path: string): void;
40
+ setCurrentUser(uid: string, groups: string[]): void;
41
+ getNode(path: string): IFileNode | null;
42
+ listDirectory(path: string): IFileNode[];
43
+ readFile(path: string): string | null;
44
+ exists(path: string): boolean;
45
+ isDirectory(path: string): boolean;
46
+ createDirectory(path: string, recursive?: boolean): void;
47
+ createFile(path: string, content?: string): void;
48
+ writeFile(path: string, content: string, append?: boolean): void;
49
+ remove(path: string, recursive?: boolean): void;
50
+ copy(src: string, dest: string, recursive?: boolean): void;
51
+ move(src: string, dest: string): void;
52
+ chmod(path: string, permissions: string): void;
53
+ chown(path: string, ownership: ICliOwnership): void;
54
+ initialize(): Promise<void>;
55
+ persist(): Promise<void>;
56
+ }
57
+
58
+ declare class CliLsCommandProcessor implements ICliCommandProcessor {
59
+ command: string;
60
+ description: string;
61
+ author: _qodalis_cli_core.ICliCommandAuthor;
62
+ version: string;
63
+ acceptsRawInput: boolean;
64
+ metadata: {
65
+ icon: string;
66
+ module: string;
67
+ };
68
+ parameters: {
69
+ name: string;
70
+ aliases: string[];
71
+ description: string;
72
+ required: boolean;
73
+ type: "boolean";
74
+ }[];
75
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
76
+ writeDescription(context: ICliExecutionContext): void;
77
+ private writeLongFormat;
78
+ private writeShortFormat;
79
+ }
80
+
81
+ declare class CliCdCommandProcessor implements ICliCommandProcessor {
82
+ command: string;
83
+ description: string;
84
+ author: _qodalis_cli_core.ICliCommandAuthor;
85
+ version: string;
86
+ acceptsRawInput: boolean;
87
+ metadata: {
88
+ icon: string;
89
+ module: string;
90
+ };
91
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
92
+ }
93
+
94
+ declare class CliPwdCommandProcessor implements ICliCommandProcessor {
95
+ command: string;
96
+ description: string;
97
+ author: _qodalis_cli_core.ICliCommandAuthor;
98
+ version: string;
99
+ metadata: {
100
+ icon: string;
101
+ module: string;
102
+ };
103
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
104
+ }
105
+
106
+ declare class CliMkdirCommandProcessor implements ICliCommandProcessor {
107
+ command: string;
108
+ description: string;
109
+ author: _qodalis_cli_core.ICliCommandAuthor;
110
+ version: string;
111
+ acceptsRawInput: boolean;
112
+ valueRequired: boolean;
113
+ metadata: {
114
+ icon: string;
115
+ module: string;
116
+ };
117
+ parameters: {
118
+ name: string;
119
+ aliases: string[];
120
+ description: string;
121
+ required: boolean;
122
+ type: "boolean";
123
+ }[];
124
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
125
+ }
126
+
127
+ declare class CliRmdirCommandProcessor implements ICliCommandProcessor {
128
+ command: string;
129
+ description: string;
130
+ author: _qodalis_cli_core.ICliCommandAuthor;
131
+ version: string;
132
+ acceptsRawInput: boolean;
133
+ valueRequired: boolean;
134
+ metadata: {
135
+ icon: string;
136
+ module: string;
137
+ };
138
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
139
+ }
140
+
141
+ declare class CliTouchCommandProcessor implements ICliCommandProcessor {
142
+ command: string;
143
+ description: string;
144
+ author: _qodalis_cli_core.ICliCommandAuthor;
145
+ version: string;
146
+ acceptsRawInput: boolean;
147
+ valueRequired: boolean;
148
+ metadata: {
149
+ icon: string;
150
+ module: string;
151
+ };
152
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
153
+ }
154
+
155
+ declare class CliCatCommandProcessor implements ICliCommandProcessor {
156
+ command: string;
157
+ description: string;
158
+ author: _qodalis_cli_core.ICliCommandAuthor;
159
+ version: string;
160
+ acceptsRawInput: boolean;
161
+ valueRequired: boolean;
162
+ metadata: {
163
+ icon: string;
164
+ module: string;
165
+ };
166
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
167
+ }
168
+
169
+ declare class CliEchoCommandProcessor implements ICliCommandProcessor {
170
+ command: string;
171
+ description: string;
172
+ author: _qodalis_cli_core.ICliCommandAuthor;
173
+ version: string;
174
+ acceptsRawInput: boolean;
175
+ extendsProcessor: boolean;
176
+ originalProcessor?: ICliCommandProcessor;
177
+ metadata: {
178
+ icon: string;
179
+ module: string;
180
+ };
181
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
182
+ }
183
+
184
+ declare class CliRmCommandProcessor implements ICliCommandProcessor {
185
+ command: string;
186
+ description: string;
187
+ author: _qodalis_cli_core.ICliCommandAuthor;
188
+ version: string;
189
+ acceptsRawInput: boolean;
190
+ valueRequired: boolean;
191
+ metadata: {
192
+ icon: string;
193
+ module: string;
194
+ };
195
+ parameters: {
196
+ name: string;
197
+ aliases: string[];
198
+ description: string;
199
+ required: boolean;
200
+ type: "boolean";
201
+ }[];
202
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
203
+ }
204
+
205
+ declare class CliCpCommandProcessor implements ICliCommandProcessor {
206
+ command: string;
207
+ description: string;
208
+ author: _qodalis_cli_core.ICliCommandAuthor;
209
+ version: string;
210
+ acceptsRawInput: boolean;
211
+ metadata: {
212
+ icon: string;
213
+ module: string;
214
+ };
215
+ parameters: {
216
+ name: string;
217
+ aliases: string[];
218
+ description: string;
219
+ required: boolean;
220
+ type: "boolean";
221
+ }[];
222
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
223
+ private parseArgs;
224
+ }
225
+
226
+ declare class CliMvCommandProcessor implements ICliCommandProcessor {
227
+ command: string;
228
+ description: string;
229
+ author: _qodalis_cli_core.ICliCommandAuthor;
230
+ version: string;
231
+ acceptsRawInput: boolean;
232
+ metadata: {
233
+ icon: string;
234
+ module: string;
235
+ };
236
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
237
+ private parseArgs;
238
+ }
239
+
240
+ declare class CliTreeCommandProcessor implements ICliCommandProcessor {
241
+ command: string;
242
+ description: string;
243
+ author: _qodalis_cli_core.ICliCommandAuthor;
244
+ version: string;
245
+ acceptsRawInput: boolean;
246
+ metadata: {
247
+ icon: string;
248
+ module: string;
249
+ };
250
+ parameters: {
251
+ name: string;
252
+ aliases: string[];
253
+ description: string;
254
+ required: boolean;
255
+ type: "number";
256
+ }[];
257
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
258
+ private printTree;
259
+ }
260
+
261
+ declare class CliHeadCommandProcessor implements ICliCommandProcessor {
262
+ command: string;
263
+ description: string;
264
+ author: _qodalis_cli_core.ICliCommandAuthor;
265
+ version: string;
266
+ acceptsRawInput: boolean;
267
+ valueRequired: boolean;
268
+ metadata: {
269
+ icon: string;
270
+ module: string;
271
+ };
272
+ parameters: {
273
+ name: string;
274
+ aliases: string[];
275
+ description: string;
276
+ required: boolean;
277
+ type: "number";
278
+ }[];
279
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
280
+ private parsePaths;
281
+ }
282
+
283
+ declare class CliTailCommandProcessor implements ICliCommandProcessor {
284
+ command: string;
285
+ description: string;
286
+ author: _qodalis_cli_core.ICliCommandAuthor;
287
+ version: string;
288
+ acceptsRawInput: boolean;
289
+ valueRequired: boolean;
290
+ metadata: {
291
+ icon: string;
292
+ module: string;
293
+ };
294
+ parameters: {
295
+ name: string;
296
+ aliases: string[];
297
+ description: string;
298
+ required: boolean;
299
+ type: "number";
300
+ }[];
301
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
302
+ private parsePaths;
303
+ }
304
+
305
+ declare class CliWcCommandProcessor implements ICliCommandProcessor {
306
+ command: string;
307
+ description: string;
308
+ author: _qodalis_cli_core.ICliCommandAuthor;
309
+ version: string;
310
+ acceptsRawInput: boolean;
311
+ valueRequired: boolean;
312
+ metadata: {
313
+ icon: string;
314
+ module: string;
315
+ };
316
+ parameters: {
317
+ name: string;
318
+ aliases: string[];
319
+ description: string;
320
+ required: boolean;
321
+ type: "boolean";
322
+ }[];
323
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
324
+ private parsePaths;
325
+ }
326
+
327
+ declare class CliFindCommandProcessor implements ICliCommandProcessor {
328
+ command: string;
329
+ description: string;
330
+ author: _qodalis_cli_core.ICliCommandAuthor;
331
+ version: string;
332
+ acceptsRawInput: boolean;
333
+ metadata: {
334
+ icon: string;
335
+ module: string;
336
+ };
337
+ parameters: ({
338
+ name: string;
339
+ description: string;
340
+ required: boolean;
341
+ type: "string";
342
+ } | {
343
+ name: string;
344
+ description: string;
345
+ required: boolean;
346
+ type: "number";
347
+ })[];
348
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
349
+ private parseSearchPath;
350
+ private globToRegex;
351
+ private walk;
352
+ }
353
+
354
+ declare class CliGrepCommandProcessor implements ICliCommandProcessor {
355
+ command: string;
356
+ description: string;
357
+ author: _qodalis_cli_core.ICliCommandAuthor;
358
+ version: string;
359
+ acceptsRawInput: boolean;
360
+ metadata: {
361
+ icon: string;
362
+ module: string;
363
+ };
364
+ parameters: {
365
+ name: string;
366
+ aliases: string[];
367
+ description: string;
368
+ required: boolean;
369
+ type: "boolean";
370
+ }[];
371
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
372
+ private grepContent;
373
+ private parseArgs;
374
+ private collectFiles;
375
+ }
376
+
377
+ declare class CliTacCommandProcessor implements ICliCommandProcessor {
378
+ command: string;
379
+ description: string;
380
+ author: _qodalis_cli_core.ICliCommandAuthor;
381
+ version: string;
382
+ acceptsRawInput: boolean;
383
+ valueRequired: boolean;
384
+ metadata: {
385
+ icon: string;
386
+ module: string;
387
+ };
388
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
389
+ private parsePaths;
390
+ }
391
+
392
+ declare class CliBasenameCommandProcessor implements ICliCommandProcessor {
393
+ command: string;
394
+ description: string;
395
+ author: _qodalis_cli_core.ICliCommandAuthor;
396
+ version: string;
397
+ acceptsRawInput: boolean;
398
+ valueRequired: boolean;
399
+ metadata: {
400
+ icon: string;
401
+ module: string;
402
+ };
403
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
404
+ private parseTokens;
405
+ }
406
+
407
+ declare class CliDirnameCommandProcessor implements ICliCommandProcessor {
408
+ command: string;
409
+ description: string;
410
+ author: _qodalis_cli_core.ICliCommandAuthor;
411
+ version: string;
412
+ acceptsRawInput: boolean;
413
+ valueRequired: boolean;
414
+ metadata: {
415
+ icon: string;
416
+ module: string;
417
+ };
418
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
419
+ private parseTokens;
420
+ }
421
+
422
+ declare class CliSortCommandProcessor implements ICliCommandProcessor {
423
+ command: string;
424
+ description: string;
425
+ author: _qodalis_cli_core.ICliCommandAuthor;
426
+ version: string;
427
+ acceptsRawInput: boolean;
428
+ valueRequired: boolean;
429
+ metadata: {
430
+ icon: string;
431
+ module: string;
432
+ };
433
+ parameters: ({
434
+ name: string;
435
+ aliases: string[];
436
+ description: string;
437
+ required: boolean;
438
+ type: "boolean";
439
+ } | {
440
+ name: string;
441
+ aliases: string[];
442
+ description: string;
443
+ required: boolean;
444
+ type: "string";
445
+ })[];
446
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
447
+ private parsePaths;
448
+ }
449
+
450
+ declare class CliUniqCommandProcessor implements ICliCommandProcessor {
451
+ command: string;
452
+ description: string;
453
+ author: _qodalis_cli_core.ICliCommandAuthor;
454
+ version: string;
455
+ acceptsRawInput: boolean;
456
+ valueRequired: boolean;
457
+ metadata: {
458
+ icon: string;
459
+ module: string;
460
+ };
461
+ parameters: {
462
+ name: string;
463
+ aliases: string[];
464
+ description: string;
465
+ required: boolean;
466
+ type: "boolean";
467
+ }[];
468
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
469
+ private parsePaths;
470
+ }
471
+
472
+ declare class CliCutCommandProcessor implements ICliCommandProcessor {
473
+ command: string;
474
+ description: string;
475
+ author: _qodalis_cli_core.ICliCommandAuthor;
476
+ version: string;
477
+ acceptsRawInput: boolean;
478
+ valueRequired: boolean;
479
+ metadata: {
480
+ icon: string;
481
+ module: string;
482
+ };
483
+ parameters: {
484
+ name: string;
485
+ aliases: string[];
486
+ description: string;
487
+ required: boolean;
488
+ type: "string";
489
+ }[];
490
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
491
+ private parseSpec;
492
+ private resolveIndices;
493
+ private parsePaths;
494
+ }
495
+
496
+ declare class CliPasteCommandProcessor implements ICliCommandProcessor {
497
+ command: string;
498
+ description: string;
499
+ author: _qodalis_cli_core.ICliCommandAuthor;
500
+ version: string;
501
+ acceptsRawInput: boolean;
502
+ valueRequired: boolean;
503
+ metadata: {
504
+ icon: string;
505
+ module: string;
506
+ };
507
+ parameters: ({
508
+ name: string;
509
+ aliases: string[];
510
+ description: string;
511
+ required: boolean;
512
+ type: "string";
513
+ } | {
514
+ name: string;
515
+ aliases: string[];
516
+ description: string;
517
+ required: boolean;
518
+ type: "boolean";
519
+ })[];
520
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
521
+ private parsePaths;
522
+ }
523
+
524
+ declare class CliTrCommandProcessor implements ICliCommandProcessor {
525
+ command: string;
526
+ description: string;
527
+ author: _qodalis_cli_core.ICliCommandAuthor;
528
+ version: string;
529
+ acceptsRawInput: boolean;
530
+ valueRequired: boolean;
531
+ metadata: {
532
+ icon: string;
533
+ module: string;
534
+ };
535
+ parameters: {
536
+ name: string;
537
+ description: string;
538
+ required: boolean;
539
+ type: "boolean";
540
+ }[];
541
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
542
+ private deleteChars;
543
+ private squeezeChars;
544
+ private translateChars;
545
+ }
546
+
547
+ declare class CliStatCommandProcessor implements ICliCommandProcessor {
548
+ command: string;
549
+ description: string;
550
+ author: _qodalis_cli_core.ICliCommandAuthor;
551
+ version: string;
552
+ acceptsRawInput: boolean;
553
+ valueRequired: boolean;
554
+ metadata: {
555
+ icon: string;
556
+ module: string;
557
+ };
558
+ parameters: never[];
559
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
560
+ private parsePaths;
561
+ }
562
+
563
+ declare class CliChmodCommandProcessor implements ICliCommandProcessor {
564
+ command: string;
565
+ description: string;
566
+ author: _qodalis_cli_core.ICliCommandAuthor;
567
+ version: string;
568
+ acceptsRawInput: boolean;
569
+ valueRequired: boolean;
570
+ metadata: {
571
+ icon: string;
572
+ module: string;
573
+ };
574
+ parameters: {
575
+ name: string;
576
+ description: string;
577
+ required: boolean;
578
+ type: "boolean";
579
+ }[];
580
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
581
+ private parseArgs;
582
+ private resolvePermissions;
583
+ private octalToPermString;
584
+ private applyPermissions;
585
+ }
586
+
587
+ declare class CliChownCommandProcessor implements ICliCommandProcessor {
588
+ command: string;
589
+ description: string;
590
+ author: _qodalis_cli_core.ICliCommandAuthor;
591
+ version: string;
592
+ acceptsRawInput: boolean;
593
+ valueRequired: boolean;
594
+ metadata: {
595
+ icon: string;
596
+ module: string;
597
+ };
598
+ parameters: {
599
+ name: string;
600
+ description: string;
601
+ required: boolean;
602
+ type: "boolean";
603
+ }[];
604
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
605
+ private parseArgs;
606
+ /** Parse "user:group", "user:", ":group", or "user" */
607
+ private parseOwnerSpec;
608
+ private applyOwnership;
609
+ }
610
+
611
+ declare class CliDuCommandProcessor implements ICliCommandProcessor {
612
+ command: string;
613
+ description: string;
614
+ author: _qodalis_cli_core.ICliCommandAuthor;
615
+ version: string;
616
+ acceptsRawInput: boolean;
617
+ valueRequired: boolean;
618
+ metadata: {
619
+ icon: string;
620
+ module: string;
621
+ };
622
+ parameters: ({
623
+ name: string;
624
+ description: string;
625
+ required: boolean;
626
+ type: "boolean";
627
+ aliases?: undefined;
628
+ } | {
629
+ name: string;
630
+ aliases: string[];
631
+ description: string;
632
+ required: boolean;
633
+ type: "number";
634
+ })[];
635
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
636
+ private parseArgs;
637
+ private collectSizes;
638
+ private formatSize;
639
+ }
640
+
641
+ declare class CliLnCommandProcessor implements ICliCommandProcessor {
642
+ command: string;
643
+ description: string;
644
+ author: _qodalis_cli_core.ICliCommandAuthor;
645
+ version: string;
646
+ acceptsRawInput: boolean;
647
+ valueRequired: boolean;
648
+ metadata: {
649
+ icon: string;
650
+ module: string;
651
+ };
652
+ parameters: {
653
+ name: string;
654
+ description: string;
655
+ required: boolean;
656
+ type: "boolean";
657
+ }[];
658
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
659
+ private parseArgs;
660
+ }
661
+
662
+ declare class CliSedCommandProcessor implements ICliCommandProcessor {
663
+ command: string;
664
+ description: string;
665
+ author: _qodalis_cli_core.ICliCommandAuthor;
666
+ version: string;
667
+ acceptsRawInput: boolean;
668
+ metadata: {
669
+ icon: string;
670
+ module: string;
671
+ };
672
+ parameters: ({
673
+ name: string;
674
+ aliases: string[];
675
+ description: string;
676
+ required: boolean;
677
+ type: "boolean";
678
+ } | {
679
+ name: string;
680
+ aliases: string[];
681
+ description: string;
682
+ required: boolean;
683
+ type: "string";
684
+ })[];
685
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
686
+ private parseRawCommand;
687
+ private tokenize;
688
+ private parseExpression;
689
+ private parseAddress;
690
+ private parseSubstitution;
691
+ private addressMatches;
692
+ }
693
+
694
+ declare class CliAwkCommandProcessor implements ICliCommandProcessor {
695
+ command: string;
696
+ description: string;
697
+ author: _qodalis_cli_core.ICliCommandAuthor;
698
+ version: string;
699
+ acceptsRawInput: boolean;
700
+ metadata: {
701
+ icon: string;
702
+ module: string;
703
+ };
704
+ parameters: {
705
+ name: string;
706
+ aliases: string[];
707
+ description: string;
708
+ required: boolean;
709
+ type: "string";
710
+ }[];
711
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
712
+ private parseArgs;
713
+ private parseProgram;
714
+ private findMatchingBrace;
715
+ private matchesPattern;
716
+ private getFieldValue;
717
+ private compareValues;
718
+ private executeAction;
719
+ private executePrint;
720
+ private splitByComma;
721
+ private evaluateConcatExpr;
722
+ private tokenizeExpr;
723
+ private resolveToken;
724
+ private executeAssignment;
725
+ private evaluateNumericExpr;
726
+ private escapeRegex;
727
+ }
728
+
729
+ declare class CliDiffCommandProcessor implements ICliCommandProcessor {
730
+ command: string;
731
+ description: string;
732
+ author: _qodalis_cli_core.ICliCommandAuthor;
733
+ version: string;
734
+ acceptsRawInput: boolean;
735
+ valueRequired: boolean;
736
+ metadata: {
737
+ icon: string;
738
+ module: string;
739
+ };
740
+ parameters: {
741
+ name: string;
742
+ aliases: string[];
743
+ description: string;
744
+ required: boolean;
745
+ type: "boolean";
746
+ }[];
747
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
748
+ private linesEqual;
749
+ private computeLCS;
750
+ private outputNormal;
751
+ private outputUnified;
752
+ private parsePaths;
753
+ }
754
+
755
+ declare class CliTeeCommandProcessor implements ICliCommandProcessor {
756
+ command: string;
757
+ description: string;
758
+ author: _qodalis_cli_core.ICliCommandAuthor;
759
+ version: string;
760
+ acceptsRawInput: boolean;
761
+ valueRequired: boolean;
762
+ metadata: {
763
+ icon: string;
764
+ module: string;
765
+ };
766
+ parameters: {
767
+ name: string;
768
+ aliases: string[];
769
+ description: string;
770
+ required: boolean;
771
+ type: "boolean";
772
+ }[];
773
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
774
+ private getAllPaths;
775
+ private parseArgs;
776
+ }
777
+
778
+ declare class CliXargsCommandProcessor implements ICliCommandProcessor {
779
+ command: string;
780
+ description: string;
781
+ author: _qodalis_cli_core.ICliCommandAuthor;
782
+ version: string;
783
+ acceptsRawInput: boolean;
784
+ valueRequired: boolean;
785
+ metadata: {
786
+ icon: string;
787
+ module: string;
788
+ };
789
+ parameters: ({
790
+ name: string;
791
+ aliases: string[];
792
+ description: string;
793
+ required: boolean;
794
+ type: "string";
795
+ } | {
796
+ name: string;
797
+ aliases: string[];
798
+ description: string;
799
+ required: boolean;
800
+ type: "number";
801
+ })[];
802
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
803
+ private getAllNonFlagTokens;
804
+ private escapeRegex;
805
+ private parseArgs;
806
+ }
807
+
808
+ /**
809
+ * Execute a script file containing CLI commands.
810
+ *
811
+ * Supported syntax inside scripts:
812
+ * - One command per line (pipes, operators, redirects all work)
813
+ * - `# comment` lines and blank lines are ignored
814
+ * - `set -e` (default) — stop on first error
815
+ * - `set +e` — continue on errors
816
+ * - `VAR=value` — variable assignment (script-scoped)
817
+ * - `$VAR` / `${VAR}` — variable substitution
818
+ */
819
+ declare class CliShCommandProcessor implements ICliCommandProcessor {
820
+ command: string;
821
+ aliases: string[];
822
+ description: string;
823
+ author: _qodalis_cli_core.ICliCommandAuthor;
824
+ version: string;
825
+ acceptsRawInput: boolean;
826
+ metadata: {
827
+ icon: string;
828
+ module: string;
829
+ };
830
+ parameters: {
831
+ name: string;
832
+ aliases: string[];
833
+ description: string;
834
+ required: boolean;
835
+ type: "boolean";
836
+ }[];
837
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
838
+ writeDescription(context: ICliExecutionContext): void;
839
+ }
840
+ /**
841
+ * Parse and execute script content line by line.
842
+ *
843
+ * Exported so the executor can reuse it for `./script.sh` execution.
844
+ */
845
+ declare function executeScript(content: string, context: ICliExecutionContext): Promise<void>;
846
+
847
+ declare class IndexedDbFileSystemService implements IFileSystemService {
848
+ private root;
849
+ private cwd;
850
+ private homePath;
851
+ private currentUid;
852
+ private currentGroups;
853
+ setCurrentUser(uid: string, groups: string[]): void;
854
+ private getDefaultOwnership;
855
+ getCurrentDirectory(): string;
856
+ setCurrentDirectory(path: string): void;
857
+ getHomePath(): string;
858
+ setHomePath(path: string): void;
859
+ resolvePath(path: string): string;
860
+ getNode(path: string): IFileNode | null;
861
+ listDirectory(path: string): IFileNode[];
862
+ readFile(path: string): string | null;
863
+ exists(path: string): boolean;
864
+ isDirectory(path: string): boolean;
865
+ createDirectory(path: string, recursive?: boolean): void;
866
+ createFile(path: string, content?: string): void;
867
+ writeFile(path: string, content: string, append?: boolean): void;
868
+ remove(path: string, recursive?: boolean): void;
869
+ copy(src: string, dest: string, recursive?: boolean): void;
870
+ move(src: string, dest: string): void;
871
+ chmod(path: string, permissions: string): void;
872
+ chown(path: string, ownership: ICliOwnership): void;
873
+ initialize(): Promise<void>;
874
+ persist(): Promise<void>;
875
+ private cloneNode;
876
+ private openDb;
877
+ private idbGet;
878
+ }
879
+
880
+ /**
881
+ * Configuration options for the ServerFileSystemService.
882
+ */
883
+ interface ServerFileSystemOptions {
884
+ /** Base URL of the CLI server, e.g. 'http://localhost:8047' */
885
+ baseUrl: string;
886
+ }
887
+ /**
888
+ * IFileSystemService implementation that delegates operations to a CLI server's
889
+ * `/api/cli/fs/*` REST endpoints.
890
+ *
891
+ * Because the IFileSystemService interface is synchronous, this service maintains
892
+ * an in-memory file tree that is returned immediately by read operations. Write
893
+ * operations update the local tree first (for instant feedback) and then fire
894
+ * asynchronous requests to the server for persistence. The `initialize()` method
895
+ * fetches the initial directory listing from the server.
896
+ */
897
+ declare class ServerFileSystemService implements IFileSystemService {
898
+ private root;
899
+ private cwd;
900
+ private homePath;
901
+ private currentUid;
902
+ private currentGroups;
903
+ private readonly baseUrl;
904
+ constructor(options: ServerFileSystemOptions);
905
+ setCurrentUser(uid: string, groups: string[]): void;
906
+ private getDefaultOwnership;
907
+ getCurrentDirectory(): string;
908
+ setCurrentDirectory(path: string): void;
909
+ getHomePath(): string;
910
+ setHomePath(path: string): void;
911
+ resolvePath(path: string): string;
912
+ getNode(path: string): IFileNode | null;
913
+ listDirectory(path: string): IFileNode[];
914
+ readFile(path: string): string | null;
915
+ exists(path: string): boolean;
916
+ isDirectory(path: string): boolean;
917
+ createDirectory(path: string, recursive?: boolean): void;
918
+ createFile(path: string, content?: string): void;
919
+ writeFile(path: string, content: string, append?: boolean): void;
920
+ remove(path: string, recursive?: boolean): void;
921
+ copy(src: string, dest: string, recursive?: boolean): void;
922
+ move(src: string, dest: string): void;
923
+ chmod(path: string, permissions: string): void;
924
+ chown(path: string, ownership: ICliOwnership): void;
925
+ /**
926
+ * Fetches the root directory listing from the server and populates the
927
+ * local in-memory file tree. Recursively loads subdirectories.
928
+ */
929
+ initialize(): Promise<void>;
930
+ /**
931
+ * No-op for server-backed storage — the server persists automatically.
932
+ */
933
+ persist(): Promise<void>;
934
+ private serverFetch;
935
+ private serverLs;
936
+ private serverCat;
937
+ private serverStat;
938
+ private serverMkdir;
939
+ private serverUpload;
940
+ private serverRm;
941
+ /**
942
+ * Recursively loads directory contents from the server into a local node.
943
+ */
944
+ private loadDirectoryFromServer;
945
+ /**
946
+ * Uploads all file nodes under the given path to the server.
947
+ * Used after copy/move to sync the local tree to the server.
948
+ */
949
+ private syncTreeToServer;
950
+ private cloneNode;
951
+ }
952
+
953
+ declare class VirtualFsFileTransferService implements ICliFileTransferService {
954
+ private readonly _fs;
955
+ private readonly _browserService;
956
+ constructor(_fs: IFileSystemService);
957
+ readFile(path: string): Promise<string | null>;
958
+ writeFile(path: string, content: string): Promise<void>;
959
+ listFiles(path: string): Promise<ICliFileEntry[]>;
960
+ exists(path: string): Promise<boolean>;
961
+ downloadToBrowser(filename: string, content: string | Blob): void;
962
+ uploadFromBrowser(accept?: string): Promise<{
963
+ name: string;
964
+ content: string;
965
+ } | null>;
966
+ }
967
+
968
+ /**
969
+ * Provides tab-completion for file and directory names from the virtual filesystem.
970
+ * Priority 50 (checked before command/parameter providers for file-related commands).
971
+ */
972
+ declare class FilePathCompletionProvider implements ICliCompletionProvider {
973
+ private readonly fs;
974
+ priority: number;
975
+ constructor(fs: IFileSystemService);
976
+ getCompletions(context: ICliCompletionContext): string[];
977
+ private completePath;
978
+ }
979
+
980
+ /**
981
+ * Configuration options for the files module.
982
+ */
983
+ interface CliFilesModuleConfig {
984
+ /**
985
+ * Whether to show the current working directory in the CLI prompt.
986
+ * @default true
987
+ */
988
+ showPathInPrompt?: boolean;
989
+ }
990
+ interface ICliFilesModule extends ICliModule {
991
+ configure(config: CliFilesModuleConfig): ICliModule;
992
+ }
993
+ declare const filesModule: ICliFilesModule;
994
+
995
+ export { CliAwkCommandProcessor, CliBasenameCommandProcessor, CliCatCommandProcessor, CliCdCommandProcessor, CliChmodCommandProcessor, CliChownCommandProcessor, CliCpCommandProcessor, CliCutCommandProcessor, CliDiffCommandProcessor, CliDirnameCommandProcessor, CliDuCommandProcessor, CliEchoCommandProcessor, type CliFilesModuleConfig, CliFindCommandProcessor, CliGrepCommandProcessor, CliHeadCommandProcessor, CliLnCommandProcessor, CliLsCommandProcessor, CliMkdirCommandProcessor, CliMvCommandProcessor, CliPasteCommandProcessor, CliPwdCommandProcessor, CliRmCommandProcessor, CliRmdirCommandProcessor, CliSedCommandProcessor, CliShCommandProcessor, CliSortCommandProcessor, CliStatCommandProcessor, CliTacCommandProcessor, CliTailCommandProcessor, CliTeeCommandProcessor, CliTouchCommandProcessor, CliTrCommandProcessor, CliTreeCommandProcessor, CliUniqCommandProcessor, CliWcCommandProcessor, CliXargsCommandProcessor, FilePathCompletionProvider, type IFileNode, type IFileSystemService, IFileSystemService_TOKEN, IndexedDbFileSystemService, type ServerFileSystemOptions, ServerFileSystemService, VirtualFsFileTransferService, executeScript, filesModule };