@stan-chen/simple-cli 0.2.5 → 0.2.7

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.
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ export declare const cleanupProcesses: () => void;
2
3
  export declare const readFiles: {
3
4
  name: string;
4
5
  description: string;
@@ -32,25 +33,25 @@ export declare const writeFiles: {
32
33
  search: z.ZodString;
33
34
  replace: z.ZodString;
34
35
  }, "strip", z.ZodTypeAny, {
35
- search: string;
36
36
  replace: string;
37
- }, {
38
37
  search: string;
38
+ }, {
39
39
  replace: string;
40
+ search: string;
40
41
  }>, "many">>;
41
42
  }, "strip", z.ZodTypeAny, {
42
43
  path: string;
43
44
  content?: string | undefined;
44
45
  searchReplace?: {
45
- search: string;
46
46
  replace: string;
47
+ search: string;
47
48
  }[] | undefined;
48
49
  }, {
49
50
  path: string;
50
51
  content?: string | undefined;
51
52
  searchReplace?: {
52
- search: string;
53
53
  replace: string;
54
+ search: string;
54
55
  }[] | undefined;
55
56
  }>, "many">;
56
57
  }, "strip", z.ZodTypeAny, {
@@ -58,8 +59,8 @@ export declare const writeFiles: {
58
59
  path: string;
59
60
  content?: string | undefined;
60
61
  searchReplace?: {
61
- search: string;
62
62
  replace: string;
63
+ search: string;
63
64
  }[] | undefined;
64
65
  }[];
65
66
  }, {
@@ -67,8 +68,8 @@ export declare const writeFiles: {
67
68
  path: string;
68
69
  content?: string | undefined;
69
70
  searchReplace?: {
70
- search: string;
71
71
  replace: string;
72
+ search: string;
72
73
  }[] | undefined;
73
74
  }[];
74
75
  }>;
@@ -158,15 +159,15 @@ export declare const listFiles: {
158
159
  includeDirectories: z.ZodDefault<z.ZodBoolean>;
159
160
  maxResults: z.ZodOptional<z.ZodNumber>;
160
161
  }, "strip", z.ZodTypeAny, {
162
+ ignore: string[];
161
163
  path: string;
162
164
  pattern: string;
163
- ignore: string[];
164
165
  includeDirectories: boolean;
165
166
  maxResults?: number | undefined;
166
167
  }, {
167
168
  pattern: string;
168
- path?: string | undefined;
169
169
  ignore?: string[] | undefined;
170
+ path?: string | undefined;
170
171
  includeDirectories?: boolean | undefined;
171
172
  maxResults?: number | undefined;
172
173
  }>;
@@ -177,9 +178,15 @@ export declare const listFiles: {
177
178
  includeDirectories: boolean;
178
179
  maxResults?: number;
179
180
  }) => Promise<{
181
+ matches: never[];
182
+ count: number;
183
+ truncated: boolean;
184
+ error: string;
185
+ } | {
180
186
  matches: string[];
181
187
  count: number;
182
188
  truncated: boolean;
189
+ error?: undefined;
183
190
  }>;
184
191
  };
185
192
  export declare const searchFiles: {
@@ -221,9 +228,15 @@ export declare const searchFiles: {
221
228
  }) => Promise<{
222
229
  matches: never[];
223
230
  count: number;
231
+ truncated: boolean;
224
232
  error: string;
225
233
  files?: undefined;
234
+ } | {
235
+ matches: never[];
236
+ count: number;
237
+ error: string;
226
238
  truncated?: undefined;
239
+ files?: undefined;
227
240
  } | {
228
241
  matches: any[];
229
242
  count: number;
@@ -244,7 +257,7 @@ export declare const listDir: {
244
257
  }>;
245
258
  execute: ({ path }: {
246
259
  path: string;
247
- }) => Promise<{
260
+ }) => Promise<"Access denied: Path is outside the allowed workspace." | {
248
261
  name: string;
249
262
  isDir: boolean;
250
263
  }[]>;
@@ -255,21 +268,37 @@ export declare const runCommand: {
255
268
  inputSchema: z.ZodObject<{
256
269
  command: z.ZodString;
257
270
  timeout: z.ZodOptional<z.ZodNumber>;
271
+ background: z.ZodDefault<z.ZodBoolean>;
258
272
  }, "strip", z.ZodTypeAny, {
259
273
  command: string;
274
+ background: boolean;
260
275
  timeout?: number | undefined;
261
276
  }, {
262
277
  command: string;
263
278
  timeout?: number | undefined;
279
+ background?: boolean | undefined;
264
280
  }>;
265
- execute: ({ command, timeout }: {
281
+ execute: ({ command, timeout, background }: {
266
282
  command: string;
267
283
  timeout?: number;
284
+ background: boolean;
268
285
  }) => Promise<{
286
+ message: string;
287
+ pid: number | undefined;
288
+ success: boolean;
289
+ stdout?: undefined;
290
+ stderr?: undefined;
291
+ exitCode?: undefined;
292
+ timedOut?: undefined;
293
+ error?: undefined;
294
+ } | {
269
295
  stdout: string;
270
296
  stderr: string;
271
297
  exitCode: number;
272
298
  timedOut: boolean;
299
+ message?: undefined;
300
+ pid?: undefined;
301
+ success?: undefined;
273
302
  error?: undefined;
274
303
  } | {
275
304
  error: any;
@@ -277,8 +306,25 @@ export declare const runCommand: {
277
306
  stderr: any;
278
307
  exitCode: any;
279
308
  timedOut: any;
309
+ message?: undefined;
310
+ pid?: undefined;
311
+ success?: undefined;
280
312
  }>;
281
313
  };
314
+ export declare const stopCommand: {
315
+ name: string;
316
+ description: string;
317
+ inputSchema: z.ZodObject<{
318
+ pid: z.ZodNumber;
319
+ }, "strip", z.ZodTypeAny, {
320
+ pid: number;
321
+ }, {
322
+ pid: number;
323
+ }>;
324
+ execute: ({ pid }: {
325
+ pid: number;
326
+ }) => Promise<string>;
327
+ };
282
328
  export declare const deleteFile: {
283
329
  name: string;
284
330
  description: string;
@@ -368,6 +414,152 @@ export declare const linter: {
368
414
  export declare const getCurrentBranch: (cwd: string) => Promise<string | null>;
369
415
  export declare const getChangedFiles: (cwd: string) => Promise<string[]>;
370
416
  export declare const getTrackedFiles: (cwd: string) => Promise<string[]>;
417
+ export declare const delegate_cli: {
418
+ name: string;
419
+ description: string;
420
+ inputSchema: z.ZodObject<{
421
+ cli: z.ZodString;
422
+ task: z.ZodString;
423
+ context_files: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
424
+ async: z.ZodDefault<z.ZodBoolean>;
425
+ }, "strip", z.ZodTypeAny, {
426
+ cli: string;
427
+ task: string;
428
+ async: boolean;
429
+ context_files?: string[] | undefined;
430
+ }, {
431
+ cli: string;
432
+ task: string;
433
+ context_files?: string[] | undefined;
434
+ async?: boolean | undefined;
435
+ }>;
436
+ execute: ({ cli, task, context_files, async }: {
437
+ cli: string;
438
+ task: string;
439
+ context_files?: string[];
440
+ async: boolean;
441
+ }) => Promise<unknown>;
442
+ };
443
+ export declare const schedule_task: {
444
+ name: string;
445
+ description: string;
446
+ inputSchema: z.ZodObject<{
447
+ cron: z.ZodString;
448
+ prompt: z.ZodString;
449
+ description: z.ZodString;
450
+ }, "strip", z.ZodTypeAny, {
451
+ description: string;
452
+ cron: string;
453
+ prompt: string;
454
+ }, {
455
+ description: string;
456
+ cron: string;
457
+ prompt: string;
458
+ }>;
459
+ execute: ({ cron, prompt, description }: {
460
+ cron: string;
461
+ prompt: string;
462
+ description: string;
463
+ }) => Promise<string>;
464
+ };
465
+ export declare const pr_list: {
466
+ name: string;
467
+ description: string;
468
+ inputSchema: z.ZodObject<{
469
+ limit: z.ZodDefault<z.ZodNumber>;
470
+ }, "strip", z.ZodTypeAny, {
471
+ limit: number;
472
+ }, {
473
+ limit?: number | undefined;
474
+ }>;
475
+ execute: ({ limit }: {
476
+ limit: number;
477
+ }) => Promise<string>;
478
+ };
479
+ export declare const pr_review: {
480
+ name: string;
481
+ description: string;
482
+ inputSchema: z.ZodObject<{
483
+ pr_number: z.ZodNumber;
484
+ }, "strip", z.ZodTypeAny, {
485
+ pr_number: number;
486
+ }, {
487
+ pr_number: number;
488
+ }>;
489
+ execute: ({ pr_number }: {
490
+ pr_number: number;
491
+ }) => Promise<string>;
492
+ };
493
+ export declare const pr_comment: {
494
+ name: string;
495
+ description: string;
496
+ inputSchema: z.ZodObject<{
497
+ pr_number: z.ZodNumber;
498
+ body: z.ZodString;
499
+ }, "strip", z.ZodTypeAny, {
500
+ pr_number: number;
501
+ body: string;
502
+ }, {
503
+ pr_number: number;
504
+ body: string;
505
+ }>;
506
+ execute: ({ pr_number, body }: {
507
+ pr_number: number;
508
+ body: string;
509
+ }) => Promise<string>;
510
+ };
511
+ export declare const pr_ready: {
512
+ name: string;
513
+ description: string;
514
+ inputSchema: z.ZodObject<{
515
+ pr_number: z.ZodNumber;
516
+ }, "strip", z.ZodTypeAny, {
517
+ pr_number: number;
518
+ }, {
519
+ pr_number: number;
520
+ }>;
521
+ execute: ({ pr_number }: {
522
+ pr_number: number;
523
+ }) => Promise<string>;
524
+ };
525
+ export declare const pr_merge: {
526
+ name: string;
527
+ description: string;
528
+ inputSchema: z.ZodObject<{
529
+ pr_number: z.ZodNumber;
530
+ method: z.ZodDefault<z.ZodEnum<["merge", "squash", "rebase"]>>;
531
+ }, "strip", z.ZodTypeAny, {
532
+ pr_number: number;
533
+ method: "merge" | "squash" | "rebase";
534
+ }, {
535
+ pr_number: number;
536
+ method?: "merge" | "squash" | "rebase" | undefined;
537
+ }>;
538
+ execute: ({ pr_number, method }: {
539
+ pr_number: number;
540
+ method: string;
541
+ }) => Promise<string>;
542
+ };
543
+ export declare const check_task_status: {
544
+ name: string;
545
+ description: string;
546
+ inputSchema: z.ZodObject<{
547
+ id: z.ZodString;
548
+ }, "strip", z.ZodTypeAny, {
549
+ id: string;
550
+ }, {
551
+ id: string;
552
+ }>;
553
+ execute: ({ id }: {
554
+ id: string;
555
+ }) => Promise<string>;
556
+ };
557
+ export declare const list_bg_tasks: {
558
+ name: string;
559
+ description: string;
560
+ inputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
561
+ execute: () => Promise<string>;
562
+ };
371
563
  export declare const allBuiltins: ({
372
564
  name: string;
373
565
  description: string;
@@ -400,25 +592,25 @@ export declare const allBuiltins: ({
400
592
  search: z.ZodString;
401
593
  replace: z.ZodString;
402
594
  }, "strip", z.ZodTypeAny, {
403
- search: string;
404
595
  replace: string;
405
- }, {
406
596
  search: string;
597
+ }, {
407
598
  replace: string;
599
+ search: string;
408
600
  }>, "many">>;
409
601
  }, "strip", z.ZodTypeAny, {
410
602
  path: string;
411
603
  content?: string | undefined;
412
604
  searchReplace?: {
413
- search: string;
414
605
  replace: string;
606
+ search: string;
415
607
  }[] | undefined;
416
608
  }, {
417
609
  path: string;
418
610
  content?: string | undefined;
419
611
  searchReplace?: {
420
- search: string;
421
612
  replace: string;
613
+ search: string;
422
614
  }[] | undefined;
423
615
  }>, "many">;
424
616
  }, "strip", z.ZodTypeAny, {
@@ -426,8 +618,8 @@ export declare const allBuiltins: ({
426
618
  path: string;
427
619
  content?: string | undefined;
428
620
  searchReplace?: {
429
- search: string;
430
621
  replace: string;
622
+ search: string;
431
623
  }[] | undefined;
432
624
  }[];
433
625
  }, {
@@ -435,8 +627,8 @@ export declare const allBuiltins: ({
435
627
  path: string;
436
628
  content?: string | undefined;
437
629
  searchReplace?: {
438
- search: string;
439
630
  replace: string;
631
+ search: string;
440
632
  }[] | undefined;
441
633
  }[];
442
634
  }>;
@@ -523,15 +715,15 @@ export declare const allBuiltins: ({
523
715
  includeDirectories: z.ZodDefault<z.ZodBoolean>;
524
716
  maxResults: z.ZodOptional<z.ZodNumber>;
525
717
  }, "strip", z.ZodTypeAny, {
718
+ ignore: string[];
526
719
  path: string;
527
720
  pattern: string;
528
- ignore: string[];
529
721
  includeDirectories: boolean;
530
722
  maxResults?: number | undefined;
531
723
  }, {
532
724
  pattern: string;
533
- path?: string | undefined;
534
725
  ignore?: string[] | undefined;
726
+ path?: string | undefined;
535
727
  includeDirectories?: boolean | undefined;
536
728
  maxResults?: number | undefined;
537
729
  }>;
@@ -542,9 +734,15 @@ export declare const allBuiltins: ({
542
734
  includeDirectories: boolean;
543
735
  maxResults?: number;
544
736
  }) => Promise<{
737
+ matches: never[];
738
+ count: number;
739
+ truncated: boolean;
740
+ error: string;
741
+ } | {
545
742
  matches: string[];
546
743
  count: number;
547
744
  truncated: boolean;
745
+ error?: undefined;
548
746
  }>;
549
747
  } | {
550
748
  name: string;
@@ -585,9 +783,15 @@ export declare const allBuiltins: ({
585
783
  }) => Promise<{
586
784
  matches: never[];
587
785
  count: number;
786
+ truncated: boolean;
588
787
  error: string;
589
788
  files?: undefined;
789
+ } | {
790
+ matches: never[];
791
+ count: number;
792
+ error: string;
590
793
  truncated?: undefined;
794
+ files?: undefined;
591
795
  } | {
592
796
  matches: any[];
593
797
  count: number;
@@ -607,7 +811,7 @@ export declare const allBuiltins: ({
607
811
  }>;
608
812
  execute: ({ path }: {
609
813
  path: string;
610
- }) => Promise<{
814
+ }) => Promise<"Access denied: Path is outside the allowed workspace." | {
611
815
  name: string;
612
816
  isDir: boolean;
613
817
  }[]>;
@@ -617,21 +821,37 @@ export declare const allBuiltins: ({
617
821
  inputSchema: z.ZodObject<{
618
822
  command: z.ZodString;
619
823
  timeout: z.ZodOptional<z.ZodNumber>;
824
+ background: z.ZodDefault<z.ZodBoolean>;
620
825
  }, "strip", z.ZodTypeAny, {
621
826
  command: string;
827
+ background: boolean;
622
828
  timeout?: number | undefined;
623
829
  }, {
624
830
  command: string;
625
831
  timeout?: number | undefined;
832
+ background?: boolean | undefined;
626
833
  }>;
627
- execute: ({ command, timeout }: {
834
+ execute: ({ command, timeout, background }: {
628
835
  command: string;
629
836
  timeout?: number;
837
+ background: boolean;
630
838
  }) => Promise<{
839
+ message: string;
840
+ pid: number | undefined;
841
+ success: boolean;
842
+ stdout?: undefined;
843
+ stderr?: undefined;
844
+ exitCode?: undefined;
845
+ timedOut?: undefined;
846
+ error?: undefined;
847
+ } | {
631
848
  stdout: string;
632
849
  stderr: string;
633
850
  exitCode: number;
634
851
  timedOut: boolean;
852
+ message?: undefined;
853
+ pid?: undefined;
854
+ success?: undefined;
635
855
  error?: undefined;
636
856
  } | {
637
857
  error: any;
@@ -639,7 +859,23 @@ export declare const allBuiltins: ({
639
859
  stderr: any;
640
860
  exitCode: any;
641
861
  timedOut: any;
862
+ message?: undefined;
863
+ pid?: undefined;
864
+ success?: undefined;
642
865
  }>;
866
+ } | {
867
+ name: string;
868
+ description: string;
869
+ inputSchema: z.ZodObject<{
870
+ pid: z.ZodNumber;
871
+ }, "strip", z.ZodTypeAny, {
872
+ pid: number;
873
+ }, {
874
+ pid: number;
875
+ }>;
876
+ execute: ({ pid }: {
877
+ pid: number;
878
+ }) => Promise<string>;
643
879
  } | {
644
880
  name: string;
645
881
  description: string;
@@ -723,4 +959,128 @@ export declare const allBuiltins: ({
723
959
  output: any;
724
960
  file: string;
725
961
  }>;
962
+ } | {
963
+ name: string;
964
+ description: string;
965
+ inputSchema: z.ZodObject<{
966
+ cli: z.ZodString;
967
+ task: z.ZodString;
968
+ context_files: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
969
+ async: z.ZodDefault<z.ZodBoolean>;
970
+ }, "strip", z.ZodTypeAny, {
971
+ cli: string;
972
+ task: string;
973
+ async: boolean;
974
+ context_files?: string[] | undefined;
975
+ }, {
976
+ cli: string;
977
+ task: string;
978
+ context_files?: string[] | undefined;
979
+ async?: boolean | undefined;
980
+ }>;
981
+ execute: ({ cli, task, context_files, async }: {
982
+ cli: string;
983
+ task: string;
984
+ context_files?: string[];
985
+ async: boolean;
986
+ }) => Promise<unknown>;
987
+ } | {
988
+ name: string;
989
+ description: string;
990
+ inputSchema: z.ZodObject<{
991
+ cron: z.ZodString;
992
+ prompt: z.ZodString;
993
+ description: z.ZodString;
994
+ }, "strip", z.ZodTypeAny, {
995
+ description: string;
996
+ cron: string;
997
+ prompt: string;
998
+ }, {
999
+ description: string;
1000
+ cron: string;
1001
+ prompt: string;
1002
+ }>;
1003
+ execute: ({ cron, prompt, description }: {
1004
+ cron: string;
1005
+ prompt: string;
1006
+ description: string;
1007
+ }) => Promise<string>;
1008
+ } | {
1009
+ name: string;
1010
+ description: string;
1011
+ inputSchema: z.ZodObject<{
1012
+ limit: z.ZodDefault<z.ZodNumber>;
1013
+ }, "strip", z.ZodTypeAny, {
1014
+ limit: number;
1015
+ }, {
1016
+ limit?: number | undefined;
1017
+ }>;
1018
+ execute: ({ limit }: {
1019
+ limit: number;
1020
+ }) => Promise<string>;
1021
+ } | {
1022
+ name: string;
1023
+ description: string;
1024
+ inputSchema: z.ZodObject<{
1025
+ pr_number: z.ZodNumber;
1026
+ }, "strip", z.ZodTypeAny, {
1027
+ pr_number: number;
1028
+ }, {
1029
+ pr_number: number;
1030
+ }>;
1031
+ execute: ({ pr_number }: {
1032
+ pr_number: number;
1033
+ }) => Promise<string>;
1034
+ } | {
1035
+ name: string;
1036
+ description: string;
1037
+ inputSchema: z.ZodObject<{
1038
+ pr_number: z.ZodNumber;
1039
+ body: z.ZodString;
1040
+ }, "strip", z.ZodTypeAny, {
1041
+ pr_number: number;
1042
+ body: string;
1043
+ }, {
1044
+ pr_number: number;
1045
+ body: string;
1046
+ }>;
1047
+ execute: ({ pr_number, body }: {
1048
+ pr_number: number;
1049
+ body: string;
1050
+ }) => Promise<string>;
1051
+ } | {
1052
+ name: string;
1053
+ description: string;
1054
+ inputSchema: z.ZodObject<{
1055
+ pr_number: z.ZodNumber;
1056
+ method: z.ZodDefault<z.ZodEnum<["merge", "squash", "rebase"]>>;
1057
+ }, "strip", z.ZodTypeAny, {
1058
+ pr_number: number;
1059
+ method: "merge" | "squash" | "rebase";
1060
+ }, {
1061
+ pr_number: number;
1062
+ method?: "merge" | "squash" | "rebase" | undefined;
1063
+ }>;
1064
+ execute: ({ pr_number, method }: {
1065
+ pr_number: number;
1066
+ method: string;
1067
+ }) => Promise<string>;
1068
+ } | {
1069
+ name: string;
1070
+ description: string;
1071
+ inputSchema: z.ZodObject<{
1072
+ id: z.ZodString;
1073
+ }, "strip", z.ZodTypeAny, {
1074
+ id: string;
1075
+ }, {
1076
+ id: string;
1077
+ }>;
1078
+ execute: ({ id }: {
1079
+ id: string;
1080
+ }) => Promise<string>;
1081
+ } | {
1082
+ name: string;
1083
+ description: string;
1084
+ inputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
1085
+ execute: () => Promise<string>;
726
1086
  })[];