incur 0.3.25 → 0.4.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.
- package/README.md +11 -11
- package/SKILL.md +6 -6
- package/dist/Cli.js +14 -14
- package/dist/Cli.js.map +1 -1
- package/dist/Help.js +1 -1
- package/dist/Help.js.map +1 -1
- package/package.json +1 -1
- package/src/Cli.test.ts +64 -41
- package/src/Cli.ts +14 -14
- package/src/Help.test.ts +17 -17
- package/src/Help.ts +1 -1
- package/src/Openapi.test.ts +4 -4
- package/src/e2e.test.ts +59 -41
package/src/Openapi.test.ts
CHANGED
|
@@ -142,11 +142,11 @@ describe('cli integration', () => {
|
|
|
142
142
|
expect(json(output)).toEqual({ ok: true })
|
|
143
143
|
})
|
|
144
144
|
|
|
145
|
-
test('--
|
|
145
|
+
test('--full-output wraps in envelope', async () => {
|
|
146
146
|
const { output } = await serve(createCli(), [
|
|
147
147
|
'api',
|
|
148
148
|
'healthCheck',
|
|
149
|
-
'--
|
|
149
|
+
'--full-output',
|
|
150
150
|
'--format',
|
|
151
151
|
'json',
|
|
152
152
|
])
|
|
@@ -254,11 +254,11 @@ describe('@hono/zod-openapi integration', () => {
|
|
|
254
254
|
expect(json(output)).toEqual({ ok: true })
|
|
255
255
|
})
|
|
256
256
|
|
|
257
|
-
test('--
|
|
257
|
+
test('--full-output wraps in envelope', async () => {
|
|
258
258
|
const { output } = await serve(createCli(), [
|
|
259
259
|
'api',
|
|
260
260
|
'healthCheck',
|
|
261
|
-
'--
|
|
261
|
+
'--full-output',
|
|
262
262
|
'--format',
|
|
263
263
|
'json',
|
|
264
264
|
])
|
package/src/e2e.test.ts
CHANGED
|
@@ -173,7 +173,7 @@ describe('args and options', () => {
|
|
|
173
173
|
'read',
|
|
174
174
|
'--scopes',
|
|
175
175
|
'write',
|
|
176
|
-
'--
|
|
176
|
+
'--full-output',
|
|
177
177
|
'--format',
|
|
178
178
|
'json',
|
|
179
179
|
])
|
|
@@ -192,7 +192,7 @@ describe('args and options', () => {
|
|
|
192
192
|
'list',
|
|
193
193
|
'--limit',
|
|
194
194
|
'5',
|
|
195
|
-
'--
|
|
195
|
+
'--full-output',
|
|
196
196
|
'--format',
|
|
197
197
|
'json',
|
|
198
198
|
])
|
|
@@ -327,8 +327,8 @@ describe('output formats', () => {
|
|
|
327
327
|
`)
|
|
328
328
|
})
|
|
329
329
|
|
|
330
|
-
test('--
|
|
331
|
-
const { output } = await serve(createApp(), ['ping', '--
|
|
330
|
+
test('--full-output full envelope', async () => {
|
|
331
|
+
const { output } = await serve(createApp(), ['ping', '--full-output'])
|
|
332
332
|
expect(output).toMatchInlineSnapshot(`
|
|
333
333
|
"ok: true
|
|
334
334
|
data:
|
|
@@ -340,8 +340,8 @@ describe('output formats', () => {
|
|
|
340
340
|
`)
|
|
341
341
|
})
|
|
342
342
|
|
|
343
|
-
test('--
|
|
344
|
-
const { output } = await serve(createApp(), ['ping', '--
|
|
343
|
+
test('--full-output --format json full envelope', async () => {
|
|
344
|
+
const { output } = await serve(createApp(), ['ping', '--full-output', '--format', 'json'])
|
|
345
345
|
expect(json(output)).toMatchInlineSnapshot(`
|
|
346
346
|
{
|
|
347
347
|
"data": {
|
|
@@ -356,13 +356,13 @@ describe('output formats', () => {
|
|
|
356
356
|
`)
|
|
357
357
|
})
|
|
358
358
|
|
|
359
|
-
test('nested command path in
|
|
359
|
+
test('nested command path in full-output meta', async () => {
|
|
360
360
|
const { output } = await serve(createApp(), [
|
|
361
361
|
'project',
|
|
362
362
|
'deploy',
|
|
363
363
|
'status',
|
|
364
364
|
'd-1',
|
|
365
|
-
'--
|
|
365
|
+
'--full-output',
|
|
366
366
|
'--format',
|
|
367
367
|
'json',
|
|
368
368
|
])
|
|
@@ -400,8 +400,8 @@ describe('undefined output', () => {
|
|
|
400
400
|
expect(output).toBe('')
|
|
401
401
|
})
|
|
402
402
|
|
|
403
|
-
test('void command shows envelope with --
|
|
404
|
-
const { output } = await serve(createApp(), ['noop', '--
|
|
403
|
+
test('void command shows envelope with --full-output', async () => {
|
|
404
|
+
const { output } = await serve(createApp(), ['noop', '--full-output', '--format', 'json'])
|
|
405
405
|
expect(json(output)).toMatchInlineSnapshot(`
|
|
406
406
|
{
|
|
407
407
|
"meta": {
|
|
@@ -455,10 +455,10 @@ describe('--token-limit and --token-offset', () => {
|
|
|
455
455
|
`)
|
|
456
456
|
})
|
|
457
457
|
|
|
458
|
-
test('works with --
|
|
458
|
+
test('works with --full-output', async () => {
|
|
459
459
|
const { output } = await serve(createApp(), [
|
|
460
460
|
'ping',
|
|
461
|
-
'--
|
|
461
|
+
'--full-output',
|
|
462
462
|
'--format',
|
|
463
463
|
'json',
|
|
464
464
|
'--token-limit',
|
|
@@ -479,10 +479,10 @@ describe('--token-limit and --token-offset', () => {
|
|
|
479
479
|
`)
|
|
480
480
|
})
|
|
481
481
|
|
|
482
|
-
test('--
|
|
482
|
+
test('--full-output includes meta.nextOffset when truncated', async () => {
|
|
483
483
|
const { output } = await serve(createApp(), [
|
|
484
484
|
'ping',
|
|
485
|
-
'--
|
|
485
|
+
'--full-output',
|
|
486
486
|
'--format',
|
|
487
487
|
'json',
|
|
488
488
|
'--token-limit',
|
|
@@ -492,10 +492,10 @@ describe('--token-limit and --token-offset', () => {
|
|
|
492
492
|
expect(output).toContain('[truncated:')
|
|
493
493
|
})
|
|
494
494
|
|
|
495
|
-
test('--
|
|
495
|
+
test('--full-output omits meta.nextOffset when not truncated', async () => {
|
|
496
496
|
const { output } = await serve(createApp(), [
|
|
497
497
|
'ping',
|
|
498
|
-
'--
|
|
498
|
+
'--full-output',
|
|
499
499
|
'--format',
|
|
500
500
|
'json',
|
|
501
501
|
'--token-limit',
|
|
@@ -575,7 +575,7 @@ describe('error handling', () => {
|
|
|
575
575
|
const { output, exitCode } = await serve(createApp(), [
|
|
576
576
|
'auth',
|
|
577
577
|
'status',
|
|
578
|
-
'--
|
|
578
|
+
'--full-output',
|
|
579
579
|
'--format',
|
|
580
580
|
'json',
|
|
581
581
|
])
|
|
@@ -633,7 +633,7 @@ describe('error handling', () => {
|
|
|
633
633
|
test('command not found returns error envelope', async () => {
|
|
634
634
|
const { output, exitCode } = await serve(createApp(), [
|
|
635
635
|
'nonexistent',
|
|
636
|
-
'--
|
|
636
|
+
'--full-output',
|
|
637
637
|
'--format',
|
|
638
638
|
'json',
|
|
639
639
|
])
|
|
@@ -676,7 +676,13 @@ describe('error handling', () => {
|
|
|
676
676
|
|
|
677
677
|
describe('cta', () => {
|
|
678
678
|
test('ok() with string CTAs', async () => {
|
|
679
|
-
const { output } = await serve(createApp(), [
|
|
679
|
+
const { output } = await serve(createApp(), [
|
|
680
|
+
'auth',
|
|
681
|
+
'login',
|
|
682
|
+
'--full-output',
|
|
683
|
+
'--format',
|
|
684
|
+
'json',
|
|
685
|
+
])
|
|
680
686
|
expect(json(output).meta.cta).toMatchInlineSnapshot(`
|
|
681
687
|
{
|
|
682
688
|
"commands": [
|
|
@@ -694,7 +700,7 @@ describe('cta', () => {
|
|
|
694
700
|
'project',
|
|
695
701
|
'create',
|
|
696
702
|
'MyProject',
|
|
697
|
-
'--
|
|
703
|
+
'--full-output',
|
|
698
704
|
'--format',
|
|
699
705
|
'json',
|
|
700
706
|
])
|
|
@@ -715,7 +721,13 @@ describe('cta', () => {
|
|
|
715
721
|
})
|
|
716
722
|
|
|
717
723
|
test('error() with CTA', async () => {
|
|
718
|
-
const { output } = await serve(createApp(), [
|
|
724
|
+
const { output } = await serve(createApp(), [
|
|
725
|
+
'auth',
|
|
726
|
+
'status',
|
|
727
|
+
'--full-output',
|
|
728
|
+
'--format',
|
|
729
|
+
'json',
|
|
730
|
+
])
|
|
719
731
|
expect(json(output).meta.cta).toMatchInlineSnapshot(`
|
|
720
732
|
{
|
|
721
733
|
"commands": [
|
|
@@ -729,7 +741,7 @@ describe('cta', () => {
|
|
|
729
741
|
})
|
|
730
742
|
|
|
731
743
|
test('plain return omits CTA', async () => {
|
|
732
|
-
const { output } = await serve(createApp(), ['ping', '--
|
|
744
|
+
const { output } = await serve(createApp(), ['ping', '--full-output', '--format', 'json'])
|
|
733
745
|
expect(json(output).meta.cta).toBeUndefined()
|
|
734
746
|
})
|
|
735
747
|
|
|
@@ -738,7 +750,7 @@ describe('cta', () => {
|
|
|
738
750
|
'project',
|
|
739
751
|
'list',
|
|
740
752
|
'--archived',
|
|
741
|
-
'--
|
|
753
|
+
'--full-output',
|
|
742
754
|
'--format',
|
|
743
755
|
'json',
|
|
744
756
|
])
|
|
@@ -780,8 +792,8 @@ describe('streaming', () => {
|
|
|
780
792
|
`)
|
|
781
793
|
})
|
|
782
794
|
|
|
783
|
-
test('default streams toon per chunk (--
|
|
784
|
-
const { output } = await serve(createApp(), ['stream', '--
|
|
795
|
+
test('default streams toon per chunk (--full-output)', async () => {
|
|
796
|
+
const { output } = await serve(createApp(), ['stream', '--full-output'])
|
|
785
797
|
expect(output).toMatchInlineSnapshot(`
|
|
786
798
|
"content: hello
|
|
787
799
|
content: world
|
|
@@ -803,8 +815,8 @@ describe('streaming', () => {
|
|
|
803
815
|
`)
|
|
804
816
|
})
|
|
805
817
|
|
|
806
|
-
test('--format json --
|
|
807
|
-
const { output } = await serve(createApp(), ['stream', '--
|
|
818
|
+
test('--format json --full-output buffers with envelope', async () => {
|
|
819
|
+
const { output } = await serve(createApp(), ['stream', '--full-output', '--format', 'json'])
|
|
808
820
|
expect(json(output)).toMatchInlineSnapshot(`
|
|
809
821
|
{
|
|
810
822
|
"data": [
|
|
@@ -972,6 +984,7 @@ describe('help', () => {
|
|
|
972
984
|
Global Options:
|
|
973
985
|
--filter-output <keys> Filter output by key paths (e.g. foo,bar.baz,a[0,3])
|
|
974
986
|
--format <toon|json|yaml|md|jsonl> Output format
|
|
987
|
+
--full-output Show full output envelope
|
|
975
988
|
--help Show help
|
|
976
989
|
--llms, --llms-full Print LLM-readable manifest
|
|
977
990
|
--mcp Start as MCP stdio server
|
|
@@ -979,7 +992,6 @@ describe('help', () => {
|
|
|
979
992
|
--token-count Print token count of output (instead of output)
|
|
980
993
|
--token-limit <n> Limit output to n tokens
|
|
981
994
|
--token-offset <n> Skip first n tokens of output
|
|
982
|
-
--verbose Show full output envelope
|
|
983
995
|
--version Show version
|
|
984
996
|
"
|
|
985
997
|
`)
|
|
@@ -1006,13 +1018,13 @@ describe('help', () => {
|
|
|
1006
1018
|
Global Options:
|
|
1007
1019
|
--filter-output <keys> Filter output by key paths (e.g. foo,bar.baz,a[0,3])
|
|
1008
1020
|
--format <toon|json|yaml|md|jsonl> Output format
|
|
1021
|
+
--full-output Show full output envelope
|
|
1009
1022
|
--help Show help
|
|
1010
1023
|
--llms, --llms-full Print LLM-readable manifest
|
|
1011
1024
|
--schema Show JSON Schema for command
|
|
1012
1025
|
--token-count Print token count of output (instead of output)
|
|
1013
1026
|
--token-limit <n> Limit output to n tokens
|
|
1014
1027
|
--token-offset <n> Skip first n tokens of output
|
|
1015
|
-
--verbose Show full output envelope
|
|
1016
1028
|
"
|
|
1017
1029
|
`)
|
|
1018
1030
|
})
|
|
@@ -1033,13 +1045,13 @@ describe('help', () => {
|
|
|
1033
1045
|
Global Options:
|
|
1034
1046
|
--filter-output <keys> Filter output by key paths (e.g. foo,bar.baz,a[0,3])
|
|
1035
1047
|
--format <toon|json|yaml|md|jsonl> Output format
|
|
1048
|
+
--full-output Show full output envelope
|
|
1036
1049
|
--help Show help
|
|
1037
1050
|
--llms, --llms-full Print LLM-readable manifest
|
|
1038
1051
|
--schema Show JSON Schema for command
|
|
1039
1052
|
--token-count Print token count of output (instead of output)
|
|
1040
1053
|
--token-limit <n> Limit output to n tokens
|
|
1041
1054
|
--token-offset <n> Skip first n tokens of output
|
|
1042
|
-
--verbose Show full output envelope
|
|
1043
1055
|
"
|
|
1044
1056
|
`)
|
|
1045
1057
|
})
|
|
@@ -1059,13 +1071,13 @@ describe('help', () => {
|
|
|
1059
1071
|
Global Options:
|
|
1060
1072
|
--filter-output <keys> Filter output by key paths (e.g. foo,bar.baz,a[0,3])
|
|
1061
1073
|
--format <toon|json|yaml|md|jsonl> Output format
|
|
1074
|
+
--full-output Show full output envelope
|
|
1062
1075
|
--help Show help
|
|
1063
1076
|
--llms, --llms-full Print LLM-readable manifest
|
|
1064
1077
|
--schema Show JSON Schema for command
|
|
1065
1078
|
--token-count Print token count of output (instead of output)
|
|
1066
1079
|
--token-limit <n> Limit output to n tokens
|
|
1067
1080
|
--token-offset <n> Skip first n tokens of output
|
|
1068
|
-
--verbose Show full output envelope
|
|
1069
1081
|
"
|
|
1070
1082
|
`)
|
|
1071
1083
|
})
|
|
@@ -1091,13 +1103,13 @@ describe('help', () => {
|
|
|
1091
1103
|
Global Options:
|
|
1092
1104
|
--filter-output <keys> Filter output by key paths (e.g. foo,bar.baz,a[0,3])
|
|
1093
1105
|
--format <toon|json|yaml|md|jsonl> Output format
|
|
1106
|
+
--full-output Show full output envelope
|
|
1094
1107
|
--help Show help
|
|
1095
1108
|
--llms, --llms-full Print LLM-readable manifest
|
|
1096
1109
|
--schema Show JSON Schema for command
|
|
1097
1110
|
--token-count Print token count of output (instead of output)
|
|
1098
1111
|
--token-limit <n> Limit output to n tokens
|
|
1099
1112
|
--token-offset <n> Skip first n tokens of output
|
|
1100
|
-
--verbose Show full output envelope
|
|
1101
1113
|
"
|
|
1102
1114
|
`)
|
|
1103
1115
|
})
|
|
@@ -1747,6 +1759,7 @@ describe('root command with subcommands', () => {
|
|
|
1747
1759
|
Global Options:
|
|
1748
1760
|
--filter-output <keys> Filter output by key paths (e.g. foo,bar.baz,a[0,3])
|
|
1749
1761
|
--format <toon|json|yaml|md|jsonl> Output format
|
|
1762
|
+
--full-output Show full output envelope
|
|
1750
1763
|
--help Show help
|
|
1751
1764
|
--llms, --llms-full Print LLM-readable manifest
|
|
1752
1765
|
--mcp Start as MCP stdio server
|
|
@@ -1754,7 +1767,6 @@ describe('root command with subcommands', () => {
|
|
|
1754
1767
|
--token-count Print token count of output (instead of output)
|
|
1755
1768
|
--token-limit <n> Limit output to n tokens
|
|
1756
1769
|
--token-offset <n> Skip first n tokens of output
|
|
1757
|
-
--verbose Show full output envelope
|
|
1758
1770
|
--version Show version
|
|
1759
1771
|
"
|
|
1760
1772
|
`)
|
|
@@ -1865,7 +1877,7 @@ describe('edge cases', () => {
|
|
|
1865
1877
|
'prod',
|
|
1866
1878
|
'--branch',
|
|
1867
1879
|
'release',
|
|
1868
|
-
'--
|
|
1880
|
+
'--full-output',
|
|
1869
1881
|
])
|
|
1870
1882
|
expect(json(output)).toMatchInlineSnapshot(`
|
|
1871
1883
|
{
|
|
@@ -1894,7 +1906,7 @@ describe('env', () => {
|
|
|
1894
1906
|
test('env vars passed to handler', async () => {
|
|
1895
1907
|
const { output } = await serve(
|
|
1896
1908
|
createApp(),
|
|
1897
|
-
['auth', 'login', '--
|
|
1909
|
+
['auth', 'login', '--full-output', '--format', 'json'],
|
|
1898
1910
|
{ env: { AUTH_HOST: 'custom.example.com' } },
|
|
1899
1911
|
)
|
|
1900
1912
|
expect(json(output).data.hostname).toBe('custom.example.com')
|
|
@@ -1903,7 +1915,7 @@ describe('env', () => {
|
|
|
1903
1915
|
test('env defaults applied when var is unset', async () => {
|
|
1904
1916
|
const { output } = await serve(
|
|
1905
1917
|
createApp(),
|
|
1906
|
-
['auth', 'login', '--
|
|
1918
|
+
['auth', 'login', '--full-output', '--format', 'json'],
|
|
1907
1919
|
{ env: {} },
|
|
1908
1920
|
)
|
|
1909
1921
|
expect(json(output).data.hostname).toBe('api.example.com')
|
|
@@ -1924,13 +1936,13 @@ describe('env', () => {
|
|
|
1924
1936
|
Global Options:
|
|
1925
1937
|
--filter-output <keys> Filter output by key paths (e.g. foo,bar.baz,a[0,3])
|
|
1926
1938
|
--format <toon|json|yaml|md|jsonl> Output format
|
|
1939
|
+
--full-output Show full output envelope
|
|
1927
1940
|
--help Show help
|
|
1928
1941
|
--llms, --llms-full Print LLM-readable manifest
|
|
1929
1942
|
--schema Show JSON Schema for command
|
|
1930
1943
|
--token-count Print token count of output (instead of output)
|
|
1931
1944
|
--token-limit <n> Limit output to n tokens
|
|
1932
1945
|
--token-offset <n> Skip first n tokens of output
|
|
1933
|
-
--verbose Show full output envelope
|
|
1934
1946
|
|
|
1935
1947
|
Environment Variables:
|
|
1936
1948
|
AUTH_TOKEN Pre-existing auth token
|
|
@@ -2037,9 +2049,9 @@ describe('middleware', () => {
|
|
|
2037
2049
|
`)
|
|
2038
2050
|
})
|
|
2039
2051
|
|
|
2040
|
-
test('vars:
|
|
2052
|
+
test('vars: full-output envelope includes var data', async () => {
|
|
2041
2053
|
const { cli } = createMiddlewareApp()
|
|
2042
|
-
const { output } = await serve(cli, ['whoami', '--
|
|
2054
|
+
const { output } = await serve(cli, ['whoami', '--full-output', '--format', 'json'])
|
|
2043
2055
|
const parsed = json(output)
|
|
2044
2056
|
expect(parsed.data.user).toBe('alice')
|
|
2045
2057
|
expect(parsed.data.requestId).toBe('req-default')
|
|
@@ -2276,8 +2288,14 @@ describe('fetch gateway', () => {
|
|
|
2276
2288
|
expect(json(output)).toEqual({ ok: true })
|
|
2277
2289
|
})
|
|
2278
2290
|
|
|
2279
|
-
test('--
|
|
2280
|
-
const { output } = await serve(createApp(), [
|
|
2291
|
+
test('--full-output wraps in envelope', async () => {
|
|
2292
|
+
const { output } = await serve(createApp(), [
|
|
2293
|
+
'api',
|
|
2294
|
+
'health',
|
|
2295
|
+
'--full-output',
|
|
2296
|
+
'--format',
|
|
2297
|
+
'json',
|
|
2298
|
+
])
|
|
2281
2299
|
const parsed = json(output)
|
|
2282
2300
|
expect(parsed.ok).toBe(true)
|
|
2283
2301
|
expect(parsed.data).toEqual({ ok: true })
|