@oneharness/sdk 0.7.2 → 0.9.0
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/dist/generated/capabilities.d.ts +34 -0
- package/dist/generated/capabilities.js +24 -0
- package/dist/generated/schemas.json +48 -24
- package/dist/index.d.ts +1 -1
- package/dist/index.js +33 -1
- package/package.json +2 -2
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
export type FlagKind = "positional" | "value" | "repeated" | "switch" | "key-value" | "trailing";
|
|
2
|
+
/**
|
|
3
|
+
* What both members of a suppressed pair rendering an argument means.
|
|
4
|
+
*
|
|
5
|
+
* Absent — a manifest older than the annotation — is `refuse`, the safe half:
|
|
6
|
+
* a contradiction reported is recoverable, a contradiction edited out is a call
|
|
7
|
+
* that ran as something the caller never asked for.
|
|
8
|
+
*/
|
|
9
|
+
export type UnlessResolution = "refuse" | "prefer";
|
|
2
10
|
/** One SDK option and the CLI flag it renders to. */
|
|
3
11
|
export type OptionBinding = {
|
|
4
12
|
readonly option: string;
|
|
@@ -7,6 +15,8 @@ export type OptionBinding = {
|
|
|
7
15
|
readonly kind: FlagKind;
|
|
8
16
|
/** Another option that suppresses this one when it renders an argument. */
|
|
9
17
|
readonly unless: string | null;
|
|
18
|
+
/** Only present beside an `unless`, which it says how to resolve. */
|
|
19
|
+
readonly unless_resolution?: UnlessResolution;
|
|
10
20
|
};
|
|
11
21
|
/** How a verb's stdout reaches a caller. */
|
|
12
22
|
export type StdoutShape = "json" | "jsonl" | "text";
|
|
@@ -66,6 +76,7 @@ export declare const CAPABILITIES: {
|
|
|
66
76
|
readonly flag: "--all";
|
|
67
77
|
readonly kind: "switch";
|
|
68
78
|
readonly unless: "harnesses";
|
|
79
|
+
readonly unless_resolution: "refuse";
|
|
69
80
|
}, {
|
|
70
81
|
readonly option: "exclude";
|
|
71
82
|
readonly flag: "--exclude";
|
|
@@ -86,6 +97,7 @@ export declare const CAPABILITIES: {
|
|
|
86
97
|
readonly flag: "--system-file";
|
|
87
98
|
readonly kind: "value";
|
|
88
99
|
readonly unless: "system";
|
|
100
|
+
readonly unless_resolution: "refuse";
|
|
89
101
|
}, {
|
|
90
102
|
readonly option: "reasoning";
|
|
91
103
|
readonly flag: "--reasoning";
|
|
@@ -181,6 +193,7 @@ export declare const CAPABILITIES: {
|
|
|
181
193
|
readonly flag: "--config";
|
|
182
194
|
readonly kind: "value";
|
|
183
195
|
readonly unless: "noConfig";
|
|
196
|
+
readonly unless_resolution: "refuse";
|
|
184
197
|
}, {
|
|
185
198
|
readonly option: "noConfig";
|
|
186
199
|
readonly flag: "--no-config";
|
|
@@ -221,6 +234,7 @@ export declare const CAPABILITIES: {
|
|
|
221
234
|
readonly flag: "--history";
|
|
222
235
|
readonly kind: "switch";
|
|
223
236
|
readonly unless: "noHistory";
|
|
237
|
+
readonly unless_resolution: "refuse";
|
|
224
238
|
}, {
|
|
225
239
|
readonly option: "noHistory";
|
|
226
240
|
readonly flag: "--no-history";
|
|
@@ -297,6 +311,7 @@ export declare const CAPABILITIES: {
|
|
|
297
311
|
readonly flag: "--all";
|
|
298
312
|
readonly kind: "switch";
|
|
299
313
|
readonly unless: "harnesses";
|
|
314
|
+
readonly unless_resolution: "refuse";
|
|
300
315
|
}, {
|
|
301
316
|
readonly option: "exclude";
|
|
302
317
|
readonly flag: "--exclude";
|
|
@@ -317,6 +332,7 @@ export declare const CAPABILITIES: {
|
|
|
317
332
|
readonly flag: "--system-file";
|
|
318
333
|
readonly kind: "value";
|
|
319
334
|
readonly unless: "system";
|
|
335
|
+
readonly unless_resolution: "refuse";
|
|
320
336
|
}, {
|
|
321
337
|
readonly option: "reasoning";
|
|
322
338
|
readonly flag: "--reasoning";
|
|
@@ -412,6 +428,7 @@ export declare const CAPABILITIES: {
|
|
|
412
428
|
readonly flag: "--config";
|
|
413
429
|
readonly kind: "value";
|
|
414
430
|
readonly unless: "noConfig";
|
|
431
|
+
readonly unless_resolution: "refuse";
|
|
415
432
|
}, {
|
|
416
433
|
readonly option: "noConfig";
|
|
417
434
|
readonly flag: "--no-config";
|
|
@@ -452,6 +469,7 @@ export declare const CAPABILITIES: {
|
|
|
452
469
|
readonly flag: "--history";
|
|
453
470
|
readonly kind: "switch";
|
|
454
471
|
readonly unless: "noHistory";
|
|
472
|
+
readonly unless_resolution: "refuse";
|
|
455
473
|
}, {
|
|
456
474
|
readonly option: "noHistory";
|
|
457
475
|
readonly flag: "--no-history";
|
|
@@ -520,6 +538,7 @@ export declare const CAPABILITIES: {
|
|
|
520
538
|
readonly flag: "--all";
|
|
521
539
|
readonly kind: "switch";
|
|
522
540
|
readonly unless: "harnesses";
|
|
541
|
+
readonly unless_resolution: "refuse";
|
|
523
542
|
}, {
|
|
524
543
|
readonly option: "exclude";
|
|
525
544
|
readonly flag: "--exclude";
|
|
@@ -535,6 +554,7 @@ export declare const CAPABILITIES: {
|
|
|
535
554
|
readonly flag: "--config";
|
|
536
555
|
readonly kind: "value";
|
|
537
556
|
readonly unless: "noConfig";
|
|
557
|
+
readonly unless_resolution: "refuse";
|
|
538
558
|
}, {
|
|
539
559
|
readonly option: "noConfig";
|
|
540
560
|
readonly flag: "--no-config";
|
|
@@ -567,6 +587,7 @@ export declare const CAPABILITIES: {
|
|
|
567
587
|
readonly flag: "--config";
|
|
568
588
|
readonly kind: "value";
|
|
569
589
|
readonly unless: "noConfig";
|
|
590
|
+
readonly unless_resolution: "refuse";
|
|
570
591
|
}, {
|
|
571
592
|
readonly option: "noConfig";
|
|
572
593
|
readonly flag: "--no-config";
|
|
@@ -609,6 +630,7 @@ export declare const CAPABILITIES: {
|
|
|
609
630
|
readonly flag: "--config";
|
|
610
631
|
readonly kind: "value";
|
|
611
632
|
readonly unless: "noConfig";
|
|
633
|
+
readonly unless_resolution: "refuse";
|
|
612
634
|
}, {
|
|
613
635
|
readonly option: "noConfig";
|
|
614
636
|
readonly flag: "--no-config";
|
|
@@ -658,6 +680,7 @@ export declare const CAPABILITIES: {
|
|
|
658
680
|
readonly flag: "--all";
|
|
659
681
|
readonly kind: "switch";
|
|
660
682
|
readonly unless: "harnesses";
|
|
683
|
+
readonly unless_resolution: "refuse";
|
|
661
684
|
}, {
|
|
662
685
|
readonly option: "exclude";
|
|
663
686
|
readonly flag: "--exclude";
|
|
@@ -683,6 +706,7 @@ export declare const CAPABILITIES: {
|
|
|
683
706
|
readonly flag: "--config";
|
|
684
707
|
readonly kind: "value";
|
|
685
708
|
readonly unless: "noConfig";
|
|
709
|
+
readonly unless_resolution: "refuse";
|
|
686
710
|
}, {
|
|
687
711
|
readonly option: "noConfig";
|
|
688
712
|
readonly flag: "--no-config";
|
|
@@ -794,6 +818,7 @@ export declare const CAPABILITIES: {
|
|
|
794
818
|
readonly flag: "";
|
|
795
819
|
readonly kind: "positional";
|
|
796
820
|
readonly unless: "last";
|
|
821
|
+
readonly unless_resolution: "prefer";
|
|
797
822
|
}, {
|
|
798
823
|
readonly option: "last";
|
|
799
824
|
readonly flag: "--last";
|
|
@@ -809,6 +834,7 @@ export declare const CAPABILITIES: {
|
|
|
809
834
|
readonly flag: "--project";
|
|
810
835
|
readonly kind: "value";
|
|
811
836
|
readonly unless: "allProjects";
|
|
837
|
+
readonly unless_resolution: "refuse";
|
|
812
838
|
}, {
|
|
813
839
|
readonly option: "allProjects";
|
|
814
840
|
readonly flag: "--all-projects";
|
|
@@ -824,6 +850,7 @@ export declare const CAPABILITIES: {
|
|
|
824
850
|
readonly flag: "--config";
|
|
825
851
|
readonly kind: "value";
|
|
826
852
|
readonly unless: "noConfig";
|
|
853
|
+
readonly unless_resolution: "refuse";
|
|
827
854
|
}, {
|
|
828
855
|
readonly option: "noConfig";
|
|
829
856
|
readonly flag: "--no-config";
|
|
@@ -854,6 +881,7 @@ export declare const CAPABILITIES: {
|
|
|
854
881
|
readonly flag: "--project";
|
|
855
882
|
readonly kind: "value";
|
|
856
883
|
readonly unless: "allProjects";
|
|
884
|
+
readonly unless_resolution: "refuse";
|
|
857
885
|
}, {
|
|
858
886
|
readonly option: "allProjects";
|
|
859
887
|
readonly flag: "--all-projects";
|
|
@@ -869,6 +897,7 @@ export declare const CAPABILITIES: {
|
|
|
869
897
|
readonly flag: "--config";
|
|
870
898
|
readonly kind: "value";
|
|
871
899
|
readonly unless: "noConfig";
|
|
900
|
+
readonly unless_resolution: "refuse";
|
|
872
901
|
}, {
|
|
873
902
|
readonly option: "noConfig";
|
|
874
903
|
readonly flag: "--no-config";
|
|
@@ -909,6 +938,7 @@ export declare const CAPABILITIES: {
|
|
|
909
938
|
readonly flag: "--project";
|
|
910
939
|
readonly kind: "value";
|
|
911
940
|
readonly unless: "allProjects";
|
|
941
|
+
readonly unless_resolution: "refuse";
|
|
912
942
|
}, {
|
|
913
943
|
readonly option: "allProjects";
|
|
914
944
|
readonly flag: "--all-projects";
|
|
@@ -929,6 +959,7 @@ export declare const CAPABILITIES: {
|
|
|
929
959
|
readonly flag: "--config";
|
|
930
960
|
readonly kind: "value";
|
|
931
961
|
readonly unless: "noConfig";
|
|
962
|
+
readonly unless_resolution: "refuse";
|
|
932
963
|
}, {
|
|
933
964
|
readonly option: "noConfig";
|
|
934
965
|
readonly flag: "--no-config";
|
|
@@ -951,6 +982,7 @@ export declare const CAPABILITIES: {
|
|
|
951
982
|
readonly flag: "--project";
|
|
952
983
|
readonly kind: "value";
|
|
953
984
|
readonly unless: "allProjects";
|
|
985
|
+
readonly unless_resolution: "refuse";
|
|
954
986
|
}, {
|
|
955
987
|
readonly option: "allProjects";
|
|
956
988
|
readonly flag: "--all-projects";
|
|
@@ -971,6 +1003,7 @@ export declare const CAPABILITIES: {
|
|
|
971
1003
|
readonly flag: "--config";
|
|
972
1004
|
readonly kind: "value";
|
|
973
1005
|
readonly unless: "noConfig";
|
|
1006
|
+
readonly unless_resolution: "refuse";
|
|
974
1007
|
}, {
|
|
975
1008
|
readonly option: "noConfig";
|
|
976
1009
|
readonly flag: "--no-config";
|
|
@@ -998,6 +1031,7 @@ export declare const CAPABILITIES: {
|
|
|
998
1031
|
readonly flag: "--config";
|
|
999
1032
|
readonly kind: "value";
|
|
1000
1033
|
readonly unless: "noConfig";
|
|
1034
|
+
readonly unless_resolution: "refuse";
|
|
1001
1035
|
}, {
|
|
1002
1036
|
readonly option: "noConfig";
|
|
1003
1037
|
readonly flag: "--no-config";
|
|
@@ -44,6 +44,7 @@ export const CAPABILITIES = {
|
|
|
44
44
|
flag: "--all",
|
|
45
45
|
kind: "switch",
|
|
46
46
|
unless: "harnesses",
|
|
47
|
+
unless_resolution: "refuse",
|
|
47
48
|
},
|
|
48
49
|
{
|
|
49
50
|
option: "exclude",
|
|
@@ -68,6 +69,7 @@ export const CAPABILITIES = {
|
|
|
68
69
|
flag: "--system-file",
|
|
69
70
|
kind: "value",
|
|
70
71
|
unless: "system",
|
|
72
|
+
unless_resolution: "refuse",
|
|
71
73
|
},
|
|
72
74
|
{
|
|
73
75
|
option: "reasoning",
|
|
@@ -182,6 +184,7 @@ export const CAPABILITIES = {
|
|
|
182
184
|
flag: "--config",
|
|
183
185
|
kind: "value",
|
|
184
186
|
unless: "noConfig",
|
|
187
|
+
unless_resolution: "refuse",
|
|
185
188
|
},
|
|
186
189
|
{
|
|
187
190
|
option: "noConfig",
|
|
@@ -230,6 +233,7 @@ export const CAPABILITIES = {
|
|
|
230
233
|
flag: "--history",
|
|
231
234
|
kind: "switch",
|
|
232
235
|
unless: "noHistory",
|
|
236
|
+
unless_resolution: "refuse",
|
|
233
237
|
},
|
|
234
238
|
{
|
|
235
239
|
option: "noHistory",
|
|
@@ -322,6 +326,7 @@ export const CAPABILITIES = {
|
|
|
322
326
|
flag: "--all",
|
|
323
327
|
kind: "switch",
|
|
324
328
|
unless: "harnesses",
|
|
329
|
+
unless_resolution: "refuse",
|
|
325
330
|
},
|
|
326
331
|
{
|
|
327
332
|
option: "exclude",
|
|
@@ -346,6 +351,7 @@ export const CAPABILITIES = {
|
|
|
346
351
|
flag: "--system-file",
|
|
347
352
|
kind: "value",
|
|
348
353
|
unless: "system",
|
|
354
|
+
unless_resolution: "refuse",
|
|
349
355
|
},
|
|
350
356
|
{
|
|
351
357
|
option: "reasoning",
|
|
@@ -460,6 +466,7 @@ export const CAPABILITIES = {
|
|
|
460
466
|
flag: "--config",
|
|
461
467
|
kind: "value",
|
|
462
468
|
unless: "noConfig",
|
|
469
|
+
unless_resolution: "refuse",
|
|
463
470
|
},
|
|
464
471
|
{
|
|
465
472
|
option: "noConfig",
|
|
@@ -508,6 +515,7 @@ export const CAPABILITIES = {
|
|
|
508
515
|
flag: "--history",
|
|
509
516
|
kind: "switch",
|
|
510
517
|
unless: "noHistory",
|
|
518
|
+
unless_resolution: "refuse",
|
|
511
519
|
},
|
|
512
520
|
{
|
|
513
521
|
option: "noHistory",
|
|
@@ -588,6 +596,7 @@ export const CAPABILITIES = {
|
|
|
588
596
|
flag: "--all",
|
|
589
597
|
kind: "switch",
|
|
590
598
|
unless: "harnesses",
|
|
599
|
+
unless_resolution: "refuse",
|
|
591
600
|
},
|
|
592
601
|
{
|
|
593
602
|
option: "exclude",
|
|
@@ -606,6 +615,7 @@ export const CAPABILITIES = {
|
|
|
606
615
|
flag: "--config",
|
|
607
616
|
kind: "value",
|
|
608
617
|
unless: "noConfig",
|
|
618
|
+
unless_resolution: "refuse",
|
|
609
619
|
},
|
|
610
620
|
{
|
|
611
621
|
option: "noConfig",
|
|
@@ -643,6 +653,7 @@ export const CAPABILITIES = {
|
|
|
643
653
|
flag: "--config",
|
|
644
654
|
kind: "value",
|
|
645
655
|
unless: "noConfig",
|
|
656
|
+
unless_resolution: "refuse",
|
|
646
657
|
},
|
|
647
658
|
{
|
|
648
659
|
option: "noConfig",
|
|
@@ -692,6 +703,7 @@ export const CAPABILITIES = {
|
|
|
692
703
|
flag: "--config",
|
|
693
704
|
kind: "value",
|
|
694
705
|
unless: "noConfig",
|
|
706
|
+
unless_resolution: "refuse",
|
|
695
707
|
},
|
|
696
708
|
{
|
|
697
709
|
option: "noConfig",
|
|
@@ -748,6 +760,7 @@ export const CAPABILITIES = {
|
|
|
748
760
|
flag: "--all",
|
|
749
761
|
kind: "switch",
|
|
750
762
|
unless: "harnesses",
|
|
763
|
+
unless_resolution: "refuse",
|
|
751
764
|
},
|
|
752
765
|
{
|
|
753
766
|
option: "exclude",
|
|
@@ -778,6 +791,7 @@ export const CAPABILITIES = {
|
|
|
778
791
|
flag: "--config",
|
|
779
792
|
kind: "value",
|
|
780
793
|
unless: "noConfig",
|
|
794
|
+
unless_resolution: "refuse",
|
|
781
795
|
},
|
|
782
796
|
{
|
|
783
797
|
option: "noConfig",
|
|
@@ -907,6 +921,7 @@ export const CAPABILITIES = {
|
|
|
907
921
|
flag: "",
|
|
908
922
|
kind: "positional",
|
|
909
923
|
unless: "last",
|
|
924
|
+
unless_resolution: "prefer",
|
|
910
925
|
},
|
|
911
926
|
{
|
|
912
927
|
option: "last",
|
|
@@ -925,6 +940,7 @@ export const CAPABILITIES = {
|
|
|
925
940
|
flag: "--project",
|
|
926
941
|
kind: "value",
|
|
927
942
|
unless: "allProjects",
|
|
943
|
+
unless_resolution: "refuse",
|
|
928
944
|
},
|
|
929
945
|
{
|
|
930
946
|
option: "allProjects",
|
|
@@ -943,6 +959,7 @@ export const CAPABILITIES = {
|
|
|
943
959
|
flag: "--config",
|
|
944
960
|
kind: "value",
|
|
945
961
|
unless: "noConfig",
|
|
962
|
+
unless_resolution: "refuse",
|
|
946
963
|
},
|
|
947
964
|
{
|
|
948
965
|
option: "noConfig",
|
|
@@ -979,6 +996,7 @@ export const CAPABILITIES = {
|
|
|
979
996
|
flag: "--project",
|
|
980
997
|
kind: "value",
|
|
981
998
|
unless: "allProjects",
|
|
999
|
+
unless_resolution: "refuse",
|
|
982
1000
|
},
|
|
983
1001
|
{
|
|
984
1002
|
option: "allProjects",
|
|
@@ -997,6 +1015,7 @@ export const CAPABILITIES = {
|
|
|
997
1015
|
flag: "--config",
|
|
998
1016
|
kind: "value",
|
|
999
1017
|
unless: "noConfig",
|
|
1018
|
+
unless_resolution: "refuse",
|
|
1000
1019
|
},
|
|
1001
1020
|
{
|
|
1002
1021
|
option: "noConfig",
|
|
@@ -1045,6 +1064,7 @@ export const CAPABILITIES = {
|
|
|
1045
1064
|
flag: "--project",
|
|
1046
1065
|
kind: "value",
|
|
1047
1066
|
unless: "allProjects",
|
|
1067
|
+
unless_resolution: "refuse",
|
|
1048
1068
|
},
|
|
1049
1069
|
{
|
|
1050
1070
|
option: "allProjects",
|
|
@@ -1069,6 +1089,7 @@ export const CAPABILITIES = {
|
|
|
1069
1089
|
flag: "--config",
|
|
1070
1090
|
kind: "value",
|
|
1071
1091
|
unless: "noConfig",
|
|
1092
|
+
unless_resolution: "refuse",
|
|
1072
1093
|
},
|
|
1073
1094
|
{
|
|
1074
1095
|
option: "noConfig",
|
|
@@ -1094,6 +1115,7 @@ export const CAPABILITIES = {
|
|
|
1094
1115
|
flag: "--project",
|
|
1095
1116
|
kind: "value",
|
|
1096
1117
|
unless: "allProjects",
|
|
1118
|
+
unless_resolution: "refuse",
|
|
1097
1119
|
},
|
|
1098
1120
|
{
|
|
1099
1121
|
option: "allProjects",
|
|
@@ -1118,6 +1140,7 @@ export const CAPABILITIES = {
|
|
|
1118
1140
|
flag: "--config",
|
|
1119
1141
|
kind: "value",
|
|
1120
1142
|
unless: "noConfig",
|
|
1143
|
+
unless_resolution: "refuse",
|
|
1121
1144
|
},
|
|
1122
1145
|
{
|
|
1123
1146
|
option: "noConfig",
|
|
@@ -1149,6 +1172,7 @@ export const CAPABILITIES = {
|
|
|
1149
1172
|
flag: "--config",
|
|
1150
1173
|
kind: "value",
|
|
1151
1174
|
unless: "noConfig",
|
|
1175
|
+
unless_resolution: "refuse",
|
|
1152
1176
|
},
|
|
1153
1177
|
{
|
|
1154
1178
|
option: "noConfig",
|
|
@@ -49,7 +49,8 @@
|
|
|
49
49
|
"option": "all",
|
|
50
50
|
"flag": "--all",
|
|
51
51
|
"kind": "switch",
|
|
52
|
-
"unless": "harnesses"
|
|
52
|
+
"unless": "harnesses",
|
|
53
|
+
"unless_resolution": "refuse"
|
|
53
54
|
},
|
|
54
55
|
{
|
|
55
56
|
"option": "exclude",
|
|
@@ -73,7 +74,8 @@
|
|
|
73
74
|
"option": "systemFile",
|
|
74
75
|
"flag": "--system-file",
|
|
75
76
|
"kind": "value",
|
|
76
|
-
"unless": "system"
|
|
77
|
+
"unless": "system",
|
|
78
|
+
"unless_resolution": "refuse"
|
|
77
79
|
},
|
|
78
80
|
{
|
|
79
81
|
"option": "reasoning",
|
|
@@ -187,7 +189,8 @@
|
|
|
187
189
|
"option": "config",
|
|
188
190
|
"flag": "--config",
|
|
189
191
|
"kind": "value",
|
|
190
|
-
"unless": "noConfig"
|
|
192
|
+
"unless": "noConfig",
|
|
193
|
+
"unless_resolution": "refuse"
|
|
191
194
|
},
|
|
192
195
|
{
|
|
193
196
|
"option": "noConfig",
|
|
@@ -235,7 +238,8 @@
|
|
|
235
238
|
"option": "history",
|
|
236
239
|
"flag": "--history",
|
|
237
240
|
"kind": "switch",
|
|
238
|
-
"unless": "noHistory"
|
|
241
|
+
"unless": "noHistory",
|
|
242
|
+
"unless_resolution": "refuse"
|
|
239
243
|
},
|
|
240
244
|
{
|
|
241
245
|
"option": "noHistory",
|
|
@@ -332,7 +336,8 @@
|
|
|
332
336
|
"option": "all",
|
|
333
337
|
"flag": "--all",
|
|
334
338
|
"kind": "switch",
|
|
335
|
-
"unless": "harnesses"
|
|
339
|
+
"unless": "harnesses",
|
|
340
|
+
"unless_resolution": "refuse"
|
|
336
341
|
},
|
|
337
342
|
{
|
|
338
343
|
"option": "exclude",
|
|
@@ -356,7 +361,8 @@
|
|
|
356
361
|
"option": "systemFile",
|
|
357
362
|
"flag": "--system-file",
|
|
358
363
|
"kind": "value",
|
|
359
|
-
"unless": "system"
|
|
364
|
+
"unless": "system",
|
|
365
|
+
"unless_resolution": "refuse"
|
|
360
366
|
},
|
|
361
367
|
{
|
|
362
368
|
"option": "reasoning",
|
|
@@ -470,7 +476,8 @@
|
|
|
470
476
|
"option": "config",
|
|
471
477
|
"flag": "--config",
|
|
472
478
|
"kind": "value",
|
|
473
|
-
"unless": "noConfig"
|
|
479
|
+
"unless": "noConfig",
|
|
480
|
+
"unless_resolution": "refuse"
|
|
474
481
|
},
|
|
475
482
|
{
|
|
476
483
|
"option": "noConfig",
|
|
@@ -518,7 +525,8 @@
|
|
|
518
525
|
"option": "history",
|
|
519
526
|
"flag": "--history",
|
|
520
527
|
"kind": "switch",
|
|
521
|
-
"unless": "noHistory"
|
|
528
|
+
"unless": "noHistory",
|
|
529
|
+
"unless_resolution": "refuse"
|
|
522
530
|
},
|
|
523
531
|
{
|
|
524
532
|
"option": "noHistory",
|
|
@@ -606,7 +614,8 @@
|
|
|
606
614
|
"option": "all",
|
|
607
615
|
"flag": "--all",
|
|
608
616
|
"kind": "switch",
|
|
609
|
-
"unless": "harnesses"
|
|
617
|
+
"unless": "harnesses",
|
|
618
|
+
"unless_resolution": "refuse"
|
|
610
619
|
},
|
|
611
620
|
{
|
|
612
621
|
"option": "exclude",
|
|
@@ -624,7 +633,8 @@
|
|
|
624
633
|
"option": "config",
|
|
625
634
|
"flag": "--config",
|
|
626
635
|
"kind": "value",
|
|
627
|
-
"unless": "noConfig"
|
|
636
|
+
"unless": "noConfig",
|
|
637
|
+
"unless_resolution": "refuse"
|
|
628
638
|
},
|
|
629
639
|
{
|
|
630
640
|
"option": "noConfig",
|
|
@@ -665,7 +675,8 @@
|
|
|
665
675
|
"option": "config",
|
|
666
676
|
"flag": "--config",
|
|
667
677
|
"kind": "value",
|
|
668
|
-
"unless": "noConfig"
|
|
678
|
+
"unless": "noConfig",
|
|
679
|
+
"unless_resolution": "refuse"
|
|
669
680
|
},
|
|
670
681
|
{
|
|
671
682
|
"option": "noConfig",
|
|
@@ -718,7 +729,8 @@
|
|
|
718
729
|
"option": "config",
|
|
719
730
|
"flag": "--config",
|
|
720
731
|
"kind": "value",
|
|
721
|
-
"unless": "noConfig"
|
|
732
|
+
"unless": "noConfig",
|
|
733
|
+
"unless_resolution": "refuse"
|
|
722
734
|
},
|
|
723
735
|
{
|
|
724
736
|
"option": "noConfig",
|
|
@@ -780,7 +792,8 @@
|
|
|
780
792
|
"option": "all",
|
|
781
793
|
"flag": "--all",
|
|
782
794
|
"kind": "switch",
|
|
783
|
-
"unless": "harnesses"
|
|
795
|
+
"unless": "harnesses",
|
|
796
|
+
"unless_resolution": "refuse"
|
|
784
797
|
},
|
|
785
798
|
{
|
|
786
799
|
"option": "exclude",
|
|
@@ -810,7 +823,8 @@
|
|
|
810
823
|
"option": "config",
|
|
811
824
|
"flag": "--config",
|
|
812
825
|
"kind": "value",
|
|
813
|
-
"unless": "noConfig"
|
|
826
|
+
"unless": "noConfig",
|
|
827
|
+
"unless_resolution": "refuse"
|
|
814
828
|
},
|
|
815
829
|
{
|
|
816
830
|
"option": "noConfig",
|
|
@@ -952,7 +966,8 @@
|
|
|
952
966
|
"option": "session",
|
|
953
967
|
"flag": "",
|
|
954
968
|
"kind": "positional",
|
|
955
|
-
"unless": "last"
|
|
969
|
+
"unless": "last",
|
|
970
|
+
"unless_resolution": "prefer"
|
|
956
971
|
},
|
|
957
972
|
{
|
|
958
973
|
"option": "last",
|
|
@@ -970,7 +985,8 @@
|
|
|
970
985
|
"option": "project",
|
|
971
986
|
"flag": "--project",
|
|
972
987
|
"kind": "value",
|
|
973
|
-
"unless": "allProjects"
|
|
988
|
+
"unless": "allProjects",
|
|
989
|
+
"unless_resolution": "refuse"
|
|
974
990
|
},
|
|
975
991
|
{
|
|
976
992
|
"option": "allProjects",
|
|
@@ -988,7 +1004,8 @@
|
|
|
988
1004
|
"option": "config",
|
|
989
1005
|
"flag": "--config",
|
|
990
1006
|
"kind": "value",
|
|
991
|
-
"unless": "noConfig"
|
|
1007
|
+
"unless": "noConfig",
|
|
1008
|
+
"unless_resolution": "refuse"
|
|
992
1009
|
},
|
|
993
1010
|
{
|
|
994
1011
|
"option": "noConfig",
|
|
@@ -1029,7 +1046,8 @@
|
|
|
1029
1046
|
"option": "project",
|
|
1030
1047
|
"flag": "--project",
|
|
1031
1048
|
"kind": "value",
|
|
1032
|
-
"unless": "allProjects"
|
|
1049
|
+
"unless": "allProjects",
|
|
1050
|
+
"unless_resolution": "refuse"
|
|
1033
1051
|
},
|
|
1034
1052
|
{
|
|
1035
1053
|
"option": "allProjects",
|
|
@@ -1047,7 +1065,8 @@
|
|
|
1047
1065
|
"option": "config",
|
|
1048
1066
|
"flag": "--config",
|
|
1049
1067
|
"kind": "value",
|
|
1050
|
-
"unless": "noConfig"
|
|
1068
|
+
"unless": "noConfig",
|
|
1069
|
+
"unless_resolution": "refuse"
|
|
1051
1070
|
},
|
|
1052
1071
|
{
|
|
1053
1072
|
"option": "noConfig",
|
|
@@ -1101,7 +1120,8 @@
|
|
|
1101
1120
|
"option": "project",
|
|
1102
1121
|
"flag": "--project",
|
|
1103
1122
|
"kind": "value",
|
|
1104
|
-
"unless": "allProjects"
|
|
1123
|
+
"unless": "allProjects",
|
|
1124
|
+
"unless_resolution": "refuse"
|
|
1105
1125
|
},
|
|
1106
1126
|
{
|
|
1107
1127
|
"option": "allProjects",
|
|
@@ -1125,7 +1145,8 @@
|
|
|
1125
1145
|
"option": "config",
|
|
1126
1146
|
"flag": "--config",
|
|
1127
1147
|
"kind": "value",
|
|
1128
|
-
"unless": "noConfig"
|
|
1148
|
+
"unless": "noConfig",
|
|
1149
|
+
"unless_resolution": "refuse"
|
|
1129
1150
|
},
|
|
1130
1151
|
{
|
|
1131
1152
|
"option": "noConfig",
|
|
@@ -1155,7 +1176,8 @@
|
|
|
1155
1176
|
"option": "project",
|
|
1156
1177
|
"flag": "--project",
|
|
1157
1178
|
"kind": "value",
|
|
1158
|
-
"unless": "allProjects"
|
|
1179
|
+
"unless": "allProjects",
|
|
1180
|
+
"unless_resolution": "refuse"
|
|
1159
1181
|
},
|
|
1160
1182
|
{
|
|
1161
1183
|
"option": "allProjects",
|
|
@@ -1179,7 +1201,8 @@
|
|
|
1179
1201
|
"option": "config",
|
|
1180
1202
|
"flag": "--config",
|
|
1181
1203
|
"kind": "value",
|
|
1182
|
-
"unless": "noConfig"
|
|
1204
|
+
"unless": "noConfig",
|
|
1205
|
+
"unless_resolution": "refuse"
|
|
1183
1206
|
},
|
|
1184
1207
|
{
|
|
1185
1208
|
"option": "noConfig",
|
|
@@ -1215,7 +1238,8 @@
|
|
|
1215
1238
|
"option": "config",
|
|
1216
1239
|
"flag": "--config",
|
|
1217
1240
|
"kind": "value",
|
|
1218
|
-
"unless": "noConfig"
|
|
1241
|
+
"unless": "noConfig",
|
|
1242
|
+
"unless_resolution": "refuse"
|
|
1219
1243
|
},
|
|
1220
1244
|
{
|
|
1221
1245
|
"option": "noConfig",
|
package/dist/index.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ import type { SyncOptions } from "./generated/sync-options.js";
|
|
|
25
25
|
import type { SyncReport } from "./generated/sync-report.js";
|
|
26
26
|
import type { UsageOptions } from "./generated/usage-options.js";
|
|
27
27
|
import type { UsageReport } from "./generated/usage-report.js";
|
|
28
|
-
export type { Capability, CapabilityMethod, FlagKind, OptionBinding, StdoutShape, } from "./generated/capabilities.js";
|
|
28
|
+
export type { Capability, CapabilityMethod, FlagKind, OptionBinding, StdoutShape, UnlessResolution, } from "./generated/capabilities.js";
|
|
29
29
|
export { CAPABILITIES } from "./generated/capabilities.js";
|
|
30
30
|
export type { ConfigOptions } from "./generated/config-options.js";
|
|
31
31
|
export type { ConfigReport } from "./generated/config-report.js";
|
package/dist/index.js
CHANGED
|
@@ -213,6 +213,23 @@ function rendersArgument(binding, value) {
|
|
|
213
213
|
return true;
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
|
+
/**
|
|
217
|
+
* Does this value assert something, or merely occupy the key?
|
|
218
|
+
*
|
|
219
|
+
* Suppression asks whether a binding renders; refusing asks something narrower,
|
|
220
|
+
* because a contradiction takes two positive answers. An empty value is not one.
|
|
221
|
+
* `{system: ""}` does render `--system ""` — which is why it still suppresses the
|
|
222
|
+
* `--system-file` clap refuses beside it — but an empty system prompt asks for
|
|
223
|
+
* nothing, so a file beside it is a defaulted key next to a real choice rather
|
|
224
|
+
* than a caller asking for two different things.
|
|
225
|
+
*/
|
|
226
|
+
function statesAChoice(binding, value) {
|
|
227
|
+
if (!rendersArgument(binding, value))
|
|
228
|
+
return false;
|
|
229
|
+
if (binding.kind === "value" || binding.kind === "positional")
|
|
230
|
+
return String(value) !== "";
|
|
231
|
+
return true;
|
|
232
|
+
}
|
|
216
233
|
/**
|
|
217
234
|
* Render one capability's argv from its declared bindings.
|
|
218
235
|
*
|
|
@@ -239,8 +256,23 @@ function capabilityArguments(method, options) {
|
|
|
239
256
|
// that an `unless` always resolves here, so a missing entry is unreachable
|
|
240
257
|
// rather than a case to render through.
|
|
241
258
|
const suppressor = binding.unless === null ? null : bound.get(binding.unless);
|
|
242
|
-
if (suppressor && rendersArgument(suppressor, input[suppressor.option]))
|
|
259
|
+
if (suppressor && rendersArgument(suppressor, input[suppressor.option])) {
|
|
260
|
+
// What both halves asserting means is the manifest's question, not this
|
|
261
|
+
// client's: `prefer` is a request with one meaning (`{session, last:
|
|
262
|
+
// true}` is "the most recent"), `refuse` is a caller who asked for two
|
|
263
|
+
// different things. Editing the second one out picks an answer silently,
|
|
264
|
+
// which is how a turn gets billed to a harness nobody selected. So
|
|
265
|
+
// `prefer` is the only waiver, and everything else refuses: an absent
|
|
266
|
+
// annotation (a manifest older than the key) and a resolution added after
|
|
267
|
+
// this client shipped both read as the recoverable half, because a
|
|
268
|
+
// refusal the manifest meant to resolve is a message the caller can act
|
|
269
|
+
// on and the reverse is not.
|
|
270
|
+
if ((binding.unless_resolution ?? "refuse") !== "prefer" &&
|
|
271
|
+
statesAChoice(binding, input[binding.option]) &&
|
|
272
|
+
statesAChoice(suppressor, input[suppressor.option]))
|
|
273
|
+
throw new Error(`invalid oneharness ${capability.argv.join(" ")} options: \`${binding.option}\` and \`${suppressor.option}\` are mutually exclusive, and this call sets both to values the CLI would send. Pass only the one you mean — resolving it here would run the call as something you did not ask for.`);
|
|
243
274
|
continue;
|
|
275
|
+
}
|
|
244
276
|
const value = input[binding.option];
|
|
245
277
|
if (value === undefined || value === null)
|
|
246
278
|
continue;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oneharness/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Typed Node.js SDK for oneharness",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"node": ">=20"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"oneharness-cli": "0.
|
|
22
|
+
"oneharness-cli": "0.9.0",
|
|
23
23
|
"zod": "^4.4.3"
|
|
24
24
|
}
|
|
25
25
|
}
|