@hop-top/kit 0.5.0-alpha.1 → 0.5.0-alpha.11
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/CHANGELOG.md +275 -0
- package/LICENSE +1 -1
- package/LICENSE-cobra.txt +174 -0
- package/NOTICE +15 -0
- package/README.md +55 -259
- package/dist/aim-DZHwwiIc.d.ts +139 -0
- package/dist/aim.d.ts +1 -116
- package/dist/aim.js +13 -414
- package/dist/alias-D9_qFlyP.d.ts +174 -0
- package/dist/alias.d.ts +2 -73
- package/dist/alias.js +27 -207
- package/dist/api-DAexsu2H.d.ts +77 -0
- package/dist/api.d.ts +1 -62
- package/dist/api.js +10 -164
- package/dist/auth-2-jfgiHn.d.ts +34 -0
- package/dist/auth.d.ts +1 -26
- package/dist/auth.js +6 -40
- package/dist/chunk-3FIKGFKI.js +54 -0
- package/dist/chunk-4FMALWYB.js +669 -0
- package/dist/chunk-4GPCWBBA.js +143 -0
- package/dist/chunk-4UE5TCMQ.js +104 -0
- package/dist/chunk-65VPWMPV.js +1134 -0
- package/dist/chunk-6HFAEZ52.js +29 -0
- package/dist/chunk-6SVOHNIC.js +17 -0
- package/dist/chunk-BDNNPRX6.js +41 -0
- package/dist/chunk-BRNEKPWX.js +37 -0
- package/dist/chunk-BXJ2J27B.js +219 -0
- package/dist/chunk-CSJWB6D3.js +151 -0
- package/dist/chunk-CXBZTONY.js +65 -0
- package/dist/chunk-EE4M2UOF.js +818 -0
- package/dist/chunk-GFRAYYRD.js +817 -0
- package/dist/chunk-IVQHLI56.js +1890 -0
- package/dist/chunk-IZ6Q4SE3.js +178 -0
- package/dist/chunk-JKMQSAJP.js +174 -0
- package/dist/chunk-K7E34Q3A.js +1445 -0
- package/dist/chunk-KVG7YCTS.js +115 -0
- package/dist/chunk-L23O2FFE.js +51 -0
- package/dist/chunk-MFVUENZR.js +1549 -0
- package/dist/chunk-ML7D5DWY.js +263 -0
- package/dist/chunk-MQXYDYRD.js +968 -0
- package/dist/chunk-POR5L2DG.js +247 -0
- package/dist/chunk-QJVSKKRQ.js +369 -0
- package/dist/chunk-QQQYCWSC.js +240 -0
- package/dist/chunk-R5U7XKVJ.js +16 -0
- package/dist/chunk-RYKLVOVK.js +309 -0
- package/dist/chunk-SNVGDYX7.js +187 -0
- package/dist/chunk-T6OZMPPV.js +68 -0
- package/dist/chunk-UKZIAQA7.js +26 -0
- package/dist/chunk-VGOA5Y7S.js +251 -0
- package/dist/chunk-VWGP4NVJ.js +513 -0
- package/dist/chunk-WBVO43HU.js +355 -0
- package/dist/chunk-WUOAQVOA.js +86 -0
- package/dist/chunk-XJTRY453.js +868 -0
- package/dist/chunk-YOBAUCVN.js +583 -0
- package/dist/cli-RSRk1M36.d.ts +707 -0
- package/dist/cli.d.ts +7 -309
- package/dist/cli.js +125 -945
- package/dist/completion-csVun6SP.d.ts +112 -0
- package/dist/completion-values-By-mnjNt.d.ts +142 -0
- package/dist/completion-values.d.ts +1 -0
- package/dist/completion-values.js +29 -0
- package/dist/completion.d.ts +3 -0
- package/dist/completion.js +34 -0
- package/dist/compliance-AxFf-uMy.d.ts +60 -0
- package/dist/compliance.d.ts +1 -0
- package/dist/compliance.js +17 -0
- package/dist/config-CaK60ByQ.d.ts +241 -0
- package/dist/config.d.ts +1 -97
- package/dist/config.js +8 -78
- package/dist/errcorrect-BcX1Ft0K.d.ts +44 -0
- package/dist/errcorrect.d.ts +1 -37
- package/dist/errcorrect.js +8 -68
- package/dist/error-Do8Qji43.d.ts +231 -0
- package/dist/id/index.d.ts +2 -83
- package/dist/id/index.js +14 -65
- package/dist/index-BKJZClJx.d.ts +1486 -0
- package/dist/index-C3Zw4wDJ.d.ts +359 -0
- package/dist/index-CGE5yLBj.d.ts +328 -0
- package/dist/index-VLDcI5NF.d.ts +95 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.js +132 -0
- package/dist/llm-DYuR7_uX.d.ts +1069 -0
- package/dist/llm-anthropic-Cd_I2xXB.d.ts +67 -0
- package/dist/llm-anthropic.d.ts +2 -0
- package/dist/llm-anthropic.js +13 -0
- package/dist/llm-openai-DyFrucmV.d.ts +87 -0
- package/dist/llm-openai.d.ts +2 -0
- package/dist/llm-openai.js +19 -0
- package/dist/llm.d.ts +1 -188
- package/dist/llm.js +101 -356
- package/dist/log-CkaxMX3U.d.ts +115 -0
- package/dist/log.d.ts +2 -0
- package/dist/log.js +14 -0
- package/dist/mcp/index.d.ts +4 -0
- package/dist/mcp/index.js +185 -0
- package/dist/netpolicy-Brx5XZUB.d.ts +151 -0
- package/dist/netpolicy.d.ts +1 -0
- package/dist/netpolicy.js +25 -0
- package/dist/output-CjZWmL8s.d.ts +420 -0
- package/dist/output.d.ts +3 -213
- package/dist/output.js +135 -447
- package/dist/parity-CvMuYcVI.d.ts +61 -0
- package/dist/progress-CAzyxeWl.d.ts +38 -0
- package/dist/progress.d.ts +1 -30
- package/dist/progress.js +6 -55
- package/dist/provenance-SMFHm5gx.d.ts +30 -0
- package/dist/provenance.d.ts +1 -24
- package/dist/provenance.js +6 -31
- package/dist/routellm-B0nv59mH.d.ts +111 -0
- package/dist/routellm.d.ts +2 -64
- package/dist/routellm.js +13 -255
- package/dist/rpc-D31Lg0Kc.d.ts +32 -0
- package/dist/rpc.d.ts +2 -25
- package/dist/rpc.js +4 -98
- package/dist/safety-CUaYEjZc.d.ts +30 -0
- package/dist/safety.d.ts +1 -24
- package/dist/safety.js +6 -43
- package/dist/scope-BrhYB4ij.d.ts +141 -0
- package/dist/scope.d.ts +1 -121
- package/dist/scope.js +20 -377
- package/dist/serve-D8yWMrTc.d.ts +646 -0
- package/dist/serve.d.ts +3 -0
- package/dist/serve.js +75 -0
- package/dist/sqlstore.js +6 -39
- package/dist/stream-CrjeCp0M.d.ts +44 -0
- package/dist/stream.d.ts +1 -35
- package/dist/stream.js +8 -51
- package/dist/telemetry/index.d.ts +1 -315
- package/dist/telemetry/index.js +26 -599
- package/dist/toolspec-DcPwwoAZ.d.ts +368 -0
- package/dist/toolspec.d.ts +2 -0
- package/dist/toolspec.js +37 -0
- package/dist/tui/index.d.ts +6 -298
- package/dist/tui/index.js +17 -381
- package/dist/upgrade-C3RWGwRi.d.ts +125 -0
- package/dist/upgrade.d.ts +1 -95
- package/dist/upgrade.js +6 -114
- package/dist/xdg-DB7Shoib.d.ts +179 -0
- package/dist/xdg.d.ts +1 -169
- package/dist/xdg.js +14 -128
- package/package.json +192 -24
- package/src/README.md +15 -0
- package/src/alias.conformance.test.ts +250 -0
- package/src/alias.test.ts +206 -2
- package/src/alias.ts +196 -21
- package/src/cli.help-command.test.ts +105 -0
- package/src/cli.offline.test.ts +93 -0
- package/src/cli.parity.test.ts +192 -0
- package/src/cli.root.conformance.test.ts +166 -0
- package/src/cli.test.ts +95 -1
- package/src/cli.ts +234 -25
- package/src/completion-scripts.ts +16 -0
- package/src/completion-values.test.ts +76 -16
- package/src/completion-values.ts +170 -66
- package/src/completion.conformance.test.ts +298 -0
- package/src/completion.test.ts +268 -145
- package/src/completion.ts +772 -121
- package/src/compliance.test.ts +196 -2
- package/src/compliance.ts +440 -20
- package/src/config-merge.test.ts +425 -0
- package/src/config.test.ts +228 -1
- package/src/config.ts +429 -16
- package/src/delegation.test.ts +299 -0
- package/src/delegation.ts +807 -0
- package/src/gen/crud_pb.ts +7 -7
- package/src/id/README.md +38 -0
- package/src/id/contract.test.ts +1 -1
- package/src/id/index.test.ts +1 -1
- package/src/id/index.ts +3 -2
- package/src/index.test.ts +71 -0
- package/src/index.ts +46 -0
- package/src/llm-anthropic.conformance.test.ts +1135 -0
- package/src/llm-anthropic.test.ts +152 -0
- package/src/llm-anthropic.ts +940 -0
- package/src/llm-choice-hermetic.test.ts +335 -0
- package/src/llm-config.test.ts +232 -0
- package/src/llm-config.ts +106 -0
- package/src/llm-endpoint.ts +254 -0
- package/src/llm-error.ts +17 -0
- package/src/llm-errors.ts +152 -0
- package/src/llm-file.ts +126 -0
- package/src/llm-http.ts +317 -0
- package/src/llm-keys.ts +167 -0
- package/src/llm-media.conformance.test.ts +87 -0
- package/src/llm-media.test.ts +279 -0
- package/src/llm-media.ts +322 -0
- package/src/llm-openai.conformance.test.ts +407 -0
- package/src/llm-openai.test.ts +510 -0
- package/src/llm-openai.ts +708 -0
- package/src/llm-payload.ts +155 -0
- package/src/llm-quote.ts +46 -0
- package/src/llm-routellm.conformance.test.ts +44 -0
- package/src/llm-toolnames.conformance.test.ts +112 -0
- package/src/llm-toolnames.test.ts +132 -0
- package/src/llm-toolnames.ts +298 -0
- package/src/llm-uri.ts +99 -0
- package/src/llm.test.ts +43 -15
- package/src/llm.toolcall.test.ts +175 -0
- package/src/llm.ts +602 -190
- package/src/log.parity.test.ts +105 -0
- package/src/log.test.ts +270 -1
- package/src/log.ts +228 -49
- package/src/mcp/README.md +63 -0
- package/src/mcp/args-separator.test.ts +164 -0
- package/src/mcp/args.test.ts +223 -0
- package/src/mcp/args.ts +160 -0
- package/src/mcp/audit.test.ts +520 -0
- package/src/mcp/audit.ts +70 -0
- package/src/mcp/bridge.test.ts +250 -0
- package/src/mcp/bridge.ts +286 -0
- package/src/mcp/conformance.test.ts +357 -0
- package/src/mcp/dispatch.ts +359 -0
- package/src/mcp/identity.test.ts +166 -0
- package/src/mcp/identity.ts +72 -0
- package/src/mcp/index.ts +176 -0
- package/src/mcp/legacy-notify.test.ts +59 -0
- package/src/mcp/legacy.ts +367 -0
- package/src/mcp/mcp.test.ts +707 -0
- package/src/mcp/modern-confirm.test.ts +520 -0
- package/src/mcp/modern-confirm.ts +484 -0
- package/src/mcp/modern.ts +788 -0
- package/src/mcp/stdio.test.ts +313 -0
- package/src/mcp/stdio.ts +254 -0
- package/src/mcp/tasks.ts +82 -0
- package/src/mcp/testtree.ts +250 -0
- package/src/mcp/toolname.test.ts +147 -0
- package/src/mcp/types.ts +689 -0
- package/src/netpolicy.test.ts +280 -0
- package/src/netpolicy.ts +256 -0
- package/src/output/README.md +46 -0
- package/src/output/builtins.ts +5 -5
- package/src/output/dispatch.ts +10 -2
- package/src/output/error.ts +459 -0
- package/src/output/formatter.ts +29 -5
- package/src/output/formatters/README.md +50 -0
- package/src/output/formatters/csv.ts +48 -12
- package/src/output/formatters/json.ts +4 -25
- package/src/output/formatters/project.ts +34 -0
- package/src/output/formatters/table.ts +8 -6
- package/src/output/formatters/text.ts +7 -3
- package/src/output/formatters/yaml.ts +5 -22
- package/src/output/projection.test.ts +298 -0
- package/src/output/projection.ts +33 -59
- package/src/output/template.ts +11 -21
- package/src/output.surface.test.ts +41 -0
- package/src/output.ts +64 -3
- package/src/plan.ts +89 -0
- package/src/policy.ts +472 -0
- package/src/published-types.test.ts +133 -0
- package/src/routellm.test.ts +209 -28
- package/src/routellm.toolcall.test.ts +521 -0
- package/src/routellm.ts +213 -177
- package/src/router/README.md +44 -0
- package/src/router/server.test.ts +41 -0
- package/src/router/server.ts +11 -0
- package/src/safety.test.ts +19 -9
- package/src/scope-defaults.json +29 -29
- package/src/serve.test.ts +1257 -0
- package/src/serve.ts +1665 -0
- package/src/sideeffect.ts +105 -0
- package/src/telemetry/README.md +48 -0
- package/src/telemetry/client.test.ts +31 -0
- package/src/telemetry/client.ts +12 -6
- package/src/telemetry/offline.test.ts +64 -0
- package/src/toolspec-internal.ts +279 -0
- package/src/toolspec-manifest.test.ts +167 -0
- package/src/toolspec-manifest.ts +415 -0
- package/src/toolspec-spec-schemas.ts +12 -0
- package/src/toolspec-spec.test.ts +273 -0
- package/src/toolspec-spec.ts +458 -0
- package/src/toolspec.from-command.test.ts +350 -0
- package/src/toolspec.test.ts +2 -2
- package/src/toolspec.ts +222 -0
- package/src/triton/README.md +34 -0
- package/src/tui/README.md +42 -0
- package/src/tui/parity.test.ts +120 -31
- package/src/tui/parity.ts +58 -7
- package/src/upgrade.test.ts +291 -0
- package/src/upgrade.ts +116 -7
- package/src/wizard.test.ts +7 -7
- package/test/llm/conformance-helpers.ts +100 -0
- package/test/output/csv.test.ts +164 -0
- package/test/output/dispatch.test.ts +1 -2
- package/test/output/error.test.ts +277 -0
- package/test/output/smoke-capture.ts +2 -2
- package/test/output/smoke.test.ts +2 -2
- package/test/output/taxonomy-contract.test.ts +148 -0
- package/test/setup-env.ts +16 -0
- package/test/toolspec/fixture.ts +79 -0
- package/tsconfig.json +3 -1
- package/tsconfig.test.json +10 -0
- package/vitest.config.ts +9 -0
- package/src/tui/parity.json +0 -74
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import * as yaml from 'js-yaml';
|
|
3
|
+
import {
|
|
4
|
+
CODE_CONFLICT,
|
|
5
|
+
CODE_CONSENT_REFUSED,
|
|
6
|
+
CODE_GENERIC,
|
|
7
|
+
CODE_NOT_FOUND,
|
|
8
|
+
CODE_PREREQUISITE,
|
|
9
|
+
CODE_PROVENANCE_MISSING,
|
|
10
|
+
CODE_RATE_LIMITED,
|
|
11
|
+
CODE_TRANSIENT,
|
|
12
|
+
CODE_UNAUTHORIZED,
|
|
13
|
+
CODE_USAGE,
|
|
14
|
+
EXIT_CONSENT_REFUSED,
|
|
15
|
+
EXIT_GENERIC,
|
|
16
|
+
EXIT_PREREQUISITE,
|
|
17
|
+
EXIT_PROVENANCE_MISSING,
|
|
18
|
+
EXIT_RATE_LIMITED,
|
|
19
|
+
EXIT_TRANSIENT,
|
|
20
|
+
TRANSIENCE_PERMANENT,
|
|
21
|
+
TRANSIENCE_TRANSIENT,
|
|
22
|
+
TRANSIENCE_UNKNOWN,
|
|
23
|
+
conflictError,
|
|
24
|
+
consentRefusedError,
|
|
25
|
+
genericError,
|
|
26
|
+
notFoundError,
|
|
27
|
+
prerequisiteError,
|
|
28
|
+
provenanceMissingError,
|
|
29
|
+
rateLimitedError,
|
|
30
|
+
renderError,
|
|
31
|
+
transienceForCode,
|
|
32
|
+
transientError,
|
|
33
|
+
unauthorizedError,
|
|
34
|
+
unwrapError,
|
|
35
|
+
usageError,
|
|
36
|
+
withTransience,
|
|
37
|
+
wrapError,
|
|
38
|
+
} from '../../src/output/error';
|
|
39
|
+
import type { CliError } from '../../src/output/error';
|
|
40
|
+
|
|
41
|
+
/** Collects renderError output into a string. */
|
|
42
|
+
function capture(): { write(chunk: string): void; text(): string } {
|
|
43
|
+
let buf = '';
|
|
44
|
+
return {
|
|
45
|
+
write(chunk: string) {
|
|
46
|
+
buf += chunk;
|
|
47
|
+
},
|
|
48
|
+
text: () => buf,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
describe('constructors — code/exit/transience', () => {
|
|
53
|
+
const cases: Array<[string, CliError, string, number, string]> = [
|
|
54
|
+
['Generic', genericError('boom'), CODE_GENERIC, 1, TRANSIENCE_PERMANENT],
|
|
55
|
+
['NotFound', notFoundError('nope'), CODE_NOT_FOUND, 3, TRANSIENCE_PERMANENT],
|
|
56
|
+
['Conflict', conflictError('dup'), CODE_CONFLICT, 4, TRANSIENCE_PERMANENT],
|
|
57
|
+
[
|
|
58
|
+
'Unauthorized',
|
|
59
|
+
unauthorizedError('nope'),
|
|
60
|
+
CODE_UNAUTHORIZED,
|
|
61
|
+
5,
|
|
62
|
+
TRANSIENCE_PERMANENT,
|
|
63
|
+
],
|
|
64
|
+
['Usage', usageError('bad flag'), CODE_USAGE, 2, TRANSIENCE_PERMANENT],
|
|
65
|
+
[
|
|
66
|
+
'RateLimited',
|
|
67
|
+
rateLimitedError('budget'),
|
|
68
|
+
CODE_RATE_LIMITED,
|
|
69
|
+
64,
|
|
70
|
+
TRANSIENCE_TRANSIENT,
|
|
71
|
+
],
|
|
72
|
+
[
|
|
73
|
+
'Transient',
|
|
74
|
+
transientError('upstream timeout'),
|
|
75
|
+
CODE_TRANSIENT,
|
|
76
|
+
6,
|
|
77
|
+
TRANSIENCE_TRANSIENT,
|
|
78
|
+
],
|
|
79
|
+
[
|
|
80
|
+
'ProvenanceMissing',
|
|
81
|
+
provenanceMissingError('/email'),
|
|
82
|
+
CODE_PROVENANCE_MISSING,
|
|
83
|
+
65,
|
|
84
|
+
TRANSIENCE_PERMANENT,
|
|
85
|
+
],
|
|
86
|
+
[
|
|
87
|
+
'ConsentRefused',
|
|
88
|
+
consentRefusedError('declined'),
|
|
89
|
+
CODE_CONSENT_REFUSED,
|
|
90
|
+
7,
|
|
91
|
+
TRANSIENCE_TRANSIENT,
|
|
92
|
+
],
|
|
93
|
+
[
|
|
94
|
+
'Prerequisite',
|
|
95
|
+
prerequisiteError('no listener'),
|
|
96
|
+
CODE_PREREQUISITE,
|
|
97
|
+
70,
|
|
98
|
+
TRANSIENCE_TRANSIENT,
|
|
99
|
+
],
|
|
100
|
+
];
|
|
101
|
+
it.each(cases)('%s', (_name, got, wantCode, wantExit, wantTransience) => {
|
|
102
|
+
expect(got.code).toBe(wantCode);
|
|
103
|
+
expect(got.exit_code).toBe(wantExit);
|
|
104
|
+
expect(got.transience).toBe(wantTransience);
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
// Mirrors Go's envelope exit-code table: the 0-6 core taxonomy plus
|
|
108
|
+
// CONSENT_REFUSED 7 and the kit extension band 64/65/70. Uniqueness
|
|
109
|
+
// pins the taxonomy; the per-number assertions pin which class owns
|
|
110
|
+
// which slot, so a port that adds a class at a number Go already
|
|
111
|
+
// spent fails here rather than on a user's machine.
|
|
112
|
+
it('exit-code table is unique and every slot is owned by its Go class', () => {
|
|
113
|
+
const exits = new Map(cases.map(([, e]) => [e.exit_code, e.code]));
|
|
114
|
+
expect(exits.size).toBe(10);
|
|
115
|
+
expect(EXIT_GENERIC).toBe(1);
|
|
116
|
+
expect(EXIT_TRANSIENT).toBe(6);
|
|
117
|
+
expect(EXIT_CONSENT_REFUSED).toBe(7);
|
|
118
|
+
expect(EXIT_RATE_LIMITED).toBe(64);
|
|
119
|
+
expect(EXIT_PROVENANCE_MISSING).toBe(65);
|
|
120
|
+
expect(EXIT_PREREQUISITE).toBe(70);
|
|
121
|
+
expect(exits.get(1)).toBe(CODE_GENERIC);
|
|
122
|
+
expect(exits.get(6)).toBe(CODE_TRANSIENT);
|
|
123
|
+
expect(exits.get(7)).toBe(CODE_CONSENT_REFUSED);
|
|
124
|
+
expect(exits.get(65)).toBe(CODE_PROVENANCE_MISSING);
|
|
125
|
+
expect(exits.get(70)).toBe(CODE_PREREQUISITE);
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
describe('transienceForCode', () => {
|
|
130
|
+
it.each([
|
|
131
|
+
[CODE_USAGE, TRANSIENCE_PERMANENT],
|
|
132
|
+
[CODE_NOT_FOUND, TRANSIENCE_PERMANENT],
|
|
133
|
+
[CODE_CONFLICT, TRANSIENCE_PERMANENT],
|
|
134
|
+
[CODE_UNAUTHORIZED, TRANSIENCE_PERMANENT],
|
|
135
|
+
[CODE_PROVENANCE_MISSING, TRANSIENCE_PERMANENT],
|
|
136
|
+
[CODE_RATE_LIMITED, TRANSIENCE_TRANSIENT],
|
|
137
|
+
[CODE_TRANSIENT, TRANSIENCE_TRANSIENT],
|
|
138
|
+
[CODE_CONSENT_REFUSED, TRANSIENCE_TRANSIENT],
|
|
139
|
+
[CODE_PREREQUISITE, TRANSIENCE_TRANSIENT],
|
|
140
|
+
[CODE_GENERIC, TRANSIENCE_UNKNOWN],
|
|
141
|
+
['ADOPTER_SPECIFIC', TRANSIENCE_UNKNOWN],
|
|
142
|
+
['', TRANSIENCE_UNKNOWN],
|
|
143
|
+
])('%s -> %s', (code, want) => {
|
|
144
|
+
expect(transienceForCode(code)).toBe(want);
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
describe('wrapError', () => {
|
|
149
|
+
it('defaults transience from code', () => {
|
|
150
|
+
const base = new Error('boom');
|
|
151
|
+
expect(wrapError(base, CODE_CONFLICT, 4)?.transience).toBe(
|
|
152
|
+
TRANSIENCE_PERMANENT,
|
|
153
|
+
);
|
|
154
|
+
expect(wrapError(base, CODE_RATE_LIMITED, 64)?.transience).toBe(
|
|
155
|
+
TRANSIENCE_TRANSIENT,
|
|
156
|
+
);
|
|
157
|
+
expect(wrapError(base, CODE_GENERIC, 1)?.transience).toBe(
|
|
158
|
+
TRANSIENCE_UNKNOWN,
|
|
159
|
+
);
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
it('retains the source error and passes null through', () => {
|
|
163
|
+
const base = new Error('boom');
|
|
164
|
+
const e = wrapError(base, CODE_CONFLICT, 4);
|
|
165
|
+
expect(e?.message).toBe('boom');
|
|
166
|
+
expect(unwrapError(e as CliError)).toBe(base);
|
|
167
|
+
expect(wrapError(null, CODE_GENERIC, 1)).toBeNull();
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
describe('withTransience', () => {
|
|
172
|
+
it('copies and sets, never mutates the shared envelope', () => {
|
|
173
|
+
const orig: CliError = { code: 'SHARED', message: 'm', exit_code: 9 };
|
|
174
|
+
const got = withTransience(orig, TRANSIENCE_TRANSIENT);
|
|
175
|
+
expect(got).not.toBe(orig);
|
|
176
|
+
expect(got.transience).toBe(TRANSIENCE_TRANSIENT);
|
|
177
|
+
expect(orig.transience).toBeUndefined();
|
|
178
|
+
expect(got.code).toBe(orig.code);
|
|
179
|
+
expect(got.message).toBe(orig.message);
|
|
180
|
+
expect(got.exit_code).toBe(orig.exit_code);
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
it('carries the retained source error to the copy', () => {
|
|
184
|
+
const base = new Error('boom');
|
|
185
|
+
const e = wrapError(base, CODE_GENERIC, 1) as CliError;
|
|
186
|
+
expect(unwrapError(withTransience(e, TRANSIENCE_PERMANENT))).toBe(base);
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
describe('renderError — structured always carries transience', () => {
|
|
191
|
+
it('normalizes unset transience to unknown in JSON', () => {
|
|
192
|
+
const w = capture();
|
|
193
|
+
renderError(w, 'json', { code: 'ADOPTER_SPECIFIC', message: 'm', exit_code: 9 });
|
|
194
|
+
expect(JSON.parse(w.text()).transience).toBe(TRANSIENCE_UNKNOWN);
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
it('normalizes unset transience to unknown in YAML', () => {
|
|
198
|
+
const w = capture();
|
|
199
|
+
renderError(w, 'yaml', { code: 'ADOPTER_SPECIFIC', message: 'm', exit_code: 9 });
|
|
200
|
+
expect(w.text()).toContain('transience: unknown');
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
it('renders an explicit class untouched', () => {
|
|
204
|
+
const w = capture();
|
|
205
|
+
renderError(w, 'json', rateLimitedError('budget'));
|
|
206
|
+
expect(JSON.parse(w.text()).transience).toBe(TRANSIENCE_TRANSIENT);
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
it('does not mutate the input envelope', () => {
|
|
210
|
+
const e: CliError = { code: 'ADOPTER_SPECIFIC', message: 'm', exit_code: 9 };
|
|
211
|
+
renderError(capture(), 'json', e);
|
|
212
|
+
expect(e.transience).toBeUndefined();
|
|
213
|
+
});
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
describe('renderError — wire round-trip', () => {
|
|
217
|
+
it('JSON: full envelope, empty optionals off the wire', () => {
|
|
218
|
+
let w = capture();
|
|
219
|
+
renderError(w, 'json', provenanceMissingError('/email'));
|
|
220
|
+
const full = JSON.parse(w.text());
|
|
221
|
+
expect(full.code).toBe(CODE_PROVENANCE_MISSING);
|
|
222
|
+
expect(full.cause).toBe('/email');
|
|
223
|
+
expect(full.exit_code).toBe(65);
|
|
224
|
+
expect(full.transience).toBe(TRANSIENCE_PERMANENT);
|
|
225
|
+
|
|
226
|
+
w = capture();
|
|
227
|
+
renderError(w, 'json', transientError('upstream timeout'));
|
|
228
|
+
const bare = JSON.parse(w.text());
|
|
229
|
+
expect(Object.keys(bare).sort()).toEqual([
|
|
230
|
+
'code',
|
|
231
|
+
'exit_code',
|
|
232
|
+
'message',
|
|
233
|
+
'transience',
|
|
234
|
+
]);
|
|
235
|
+
expect(bare.exit_code).toBe(6);
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
it('YAML: parses back to the wire shape', () => {
|
|
239
|
+
const w = capture();
|
|
240
|
+
renderError(w, 'yaml', transientError('upstream timeout'));
|
|
241
|
+
expect(yaml.load(w.text())).toEqual({
|
|
242
|
+
code: CODE_TRANSIENT,
|
|
243
|
+
message: 'upstream timeout',
|
|
244
|
+
exit_code: 6,
|
|
245
|
+
transience: TRANSIENCE_TRANSIENT,
|
|
246
|
+
});
|
|
247
|
+
});
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
describe('renderError — plain text + null', () => {
|
|
251
|
+
it('renders each populated field on its own line', () => {
|
|
252
|
+
const w = capture();
|
|
253
|
+
renderError(w, 'table', {
|
|
254
|
+
code: 'NOT_FOUND',
|
|
255
|
+
message: 'missing thing',
|
|
256
|
+
cause: 'root',
|
|
257
|
+
suggested_fix: 'try --all',
|
|
258
|
+
alternatives: ['other'],
|
|
259
|
+
exit_code: 3,
|
|
260
|
+
});
|
|
261
|
+
expect(w.text()).toBe(
|
|
262
|
+
'NOT_FOUND: missing thing\nCause: root\nFix: try --all\nAlternative: other\n',
|
|
263
|
+
);
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
it('renders bare message without code prefix', () => {
|
|
267
|
+
const w = capture();
|
|
268
|
+
renderError(w, '', { code: '', message: 'just text', exit_code: 1 });
|
|
269
|
+
expect(w.text()).toBe('just text\n');
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
it('null renders nothing', () => {
|
|
273
|
+
const w = capture();
|
|
274
|
+
renderError(w, 'json', null);
|
|
275
|
+
expect(w.text()).toBe('');
|
|
276
|
+
});
|
|
277
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Captures verbatim output for each smoke command
|
|
3
|
-
*
|
|
2
|
+
* Captures verbatim output for each smoke command so a report can
|
|
3
|
+
* include real-world output samples. Run with:
|
|
4
4
|
*
|
|
5
5
|
* pnpm exec tsx test/output/smoke-capture.ts
|
|
6
6
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Smoke tests mirroring
|
|
2
|
+
* Smoke tests mirroring the manual checklist. Each test exercises a
|
|
3
3
|
* dispatch path end-to-end against an in-memory writer or temp file so the
|
|
4
4
|
* suite is hermetic but covers the same surface a real `cli list` invocation
|
|
5
5
|
* would.
|
|
@@ -44,7 +44,7 @@ const rows = [
|
|
|
44
44
|
{ id: '2', name: 'Bob', status: 'idle' },
|
|
45
45
|
];
|
|
46
46
|
|
|
47
|
-
describe('smoke —
|
|
47
|
+
describe('smoke — checklist', () => {
|
|
48
48
|
it('cli list (default table)', async () => {
|
|
49
49
|
const program = makeProgram([]);
|
|
50
50
|
const cap = captureStdout();
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
// Cross-language exit-taxonomy contract loader.
|
|
2
|
+
//
|
|
3
|
+
// Loads contracts/exit-taxonomy-v1/taxonomy.json — generated from
|
|
4
|
+
// go/console/output/envelope, the single source of truth — and asserts
|
|
5
|
+
// this TS SDK's table agrees with it on every class, every exit number
|
|
6
|
+
// and every transience.
|
|
7
|
+
//
|
|
8
|
+
// A failure here means Go's taxonomy moved and this port did not follow.
|
|
9
|
+
// That is the exact drift this contract exists to catch: when Go gained
|
|
10
|
+
// CONSENT_REFUSED 7 and PREREQUISITE 70, all four SDK ports silently
|
|
11
|
+
// kept the old nine-class table for two releases, and
|
|
12
|
+
// transienceForCode returned 'unknown' where Go returned 'transient' —
|
|
13
|
+
// so four runtimes handed agents wrong retry guidance.
|
|
14
|
+
//
|
|
15
|
+
// Fix by adding the missing class here, not by editing the contract:
|
|
16
|
+
// the contract is regenerated from Go, never hand-edited.
|
|
17
|
+
|
|
18
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
19
|
+
import { dirname, resolve } from 'node:path';
|
|
20
|
+
import { fileURLToPath } from 'node:url';
|
|
21
|
+
|
|
22
|
+
import { describe, it, expect } from 'vitest';
|
|
23
|
+
|
|
24
|
+
import {
|
|
25
|
+
exitClasses,
|
|
26
|
+
exitCodeForClass,
|
|
27
|
+
transienceForCode,
|
|
28
|
+
} from '../../src/output/error';
|
|
29
|
+
|
|
30
|
+
interface TaxonomyClass {
|
|
31
|
+
readonly class: string;
|
|
32
|
+
readonly exit: number;
|
|
33
|
+
readonly transience: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
interface BandSlot {
|
|
37
|
+
readonly exit: number;
|
|
38
|
+
readonly class: string;
|
|
39
|
+
readonly owner: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
interface TaxonomyContract {
|
|
43
|
+
readonly version: string;
|
|
44
|
+
readonly source: string;
|
|
45
|
+
readonly transiences: ReadonlyArray<string>;
|
|
46
|
+
readonly classes: ReadonlyArray<TaxonomyClass>;
|
|
47
|
+
readonly extension_band: ReadonlyArray<BandSlot>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Walk up from this test file's directory until we hit a directory
|
|
51
|
+
// holding contracts/exit-taxonomy-v1/taxonomy.json. Robust against both
|
|
52
|
+
// `vitest run` (CWD = sdk/ts) and IDE-driven invocations whose CWD may
|
|
53
|
+
// vary.
|
|
54
|
+
function locateContract(): string {
|
|
55
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
56
|
+
let dir = here;
|
|
57
|
+
for (let i = 0; i < 10; i++) {
|
|
58
|
+
const candidate = resolve(
|
|
59
|
+
dir,
|
|
60
|
+
'contracts',
|
|
61
|
+
'exit-taxonomy-v1',
|
|
62
|
+
'taxonomy.json',
|
|
63
|
+
);
|
|
64
|
+
if (existsSync(candidate)) return candidate;
|
|
65
|
+
const parent = dirname(dir);
|
|
66
|
+
if (parent === dir) break;
|
|
67
|
+
dir = parent;
|
|
68
|
+
}
|
|
69
|
+
throw new Error(
|
|
70
|
+
`contracts/exit-taxonomy-v1/taxonomy.json: not found walking up from ${here}`,
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const CONTRACT: TaxonomyContract = JSON.parse(
|
|
75
|
+
readFileSync(locateContract(), 'utf8'),
|
|
76
|
+
) as TaxonomyContract;
|
|
77
|
+
|
|
78
|
+
// The slots envelope itself owns. The conformance-tree slots (66-69)
|
|
79
|
+
// are recorded in the contract so a new allocation cannot double-book a
|
|
80
|
+
// number, but no SDK port is expected to export them.
|
|
81
|
+
const ENVELOPE_OWNER = 'hop.top/kit/go/console/output/envelope';
|
|
82
|
+
|
|
83
|
+
describe('exit-taxonomy-v1 contract metadata', () => {
|
|
84
|
+
it('pins version and source', () => {
|
|
85
|
+
expect(CONTRACT.version).toBe('v1');
|
|
86
|
+
expect(CONTRACT.source).toBe(ENVELOPE_OWNER);
|
|
87
|
+
expect(CONTRACT.classes.length).toBeGreaterThan(0);
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
describe('exit-taxonomy-v1: this port matches the contract', () => {
|
|
92
|
+
// Membership in both directions. A port carrying an extra class Go
|
|
93
|
+
// does not define is as much a divergence as a port missing one: an
|
|
94
|
+
// adopter branching on it gets a number no other runtime produces.
|
|
95
|
+
it('declares exactly the contract classes, in contract order', () => {
|
|
96
|
+
expect(exitClasses()).toEqual(CONTRACT.classes.map((c) => c.class));
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
it.each(CONTRACT.classes.map((c) => [c.class, c] as const))(
|
|
100
|
+
'%s resolves to the contract exit and transience',
|
|
101
|
+
(_name, row) => {
|
|
102
|
+
expect(exitCodeForClass(row.class)).toBe(row.exit);
|
|
103
|
+
expect(transienceForCode(row.class)).toBe(row.transience);
|
|
104
|
+
},
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
// The transience vocabulary is itself a contract: an agent branching
|
|
108
|
+
// on a fourth string has no defined behavior.
|
|
109
|
+
it('answers only with the contract transience vocabulary', () => {
|
|
110
|
+
for (const row of CONTRACT.classes) {
|
|
111
|
+
expect(CONTRACT.transiences).toContain(transienceForCode(row.class));
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
// An unknown class must resolve to nothing rather than to a fallback
|
|
116
|
+
// number. A built-in fallback is what turns "kit added a class and
|
|
117
|
+
// this port never copied it" into an assertion against exit 1 that
|
|
118
|
+
// reads as a real failure rather than a stale table.
|
|
119
|
+
it('does not invent a code for an adopter-defined class', () => {
|
|
120
|
+
expect(exitCodeForClass('ADOPTER_SPECIFIC')).toBeUndefined();
|
|
121
|
+
expect(transienceForCode('ADOPTER_SPECIFIC')).toBe('unknown');
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
describe('exit-taxonomy-v1 extension band', () => {
|
|
126
|
+
it('exports every band slot envelope owns', () => {
|
|
127
|
+
const owned = CONTRACT.extension_band.filter(
|
|
128
|
+
(s) => s.owner === ENVELOPE_OWNER,
|
|
129
|
+
);
|
|
130
|
+
expect(owned.length).toBeGreaterThan(0);
|
|
131
|
+
for (const slot of owned) {
|
|
132
|
+
expect(exitCodeForClass(slot.class)).toBe(slot.exit);
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
// Slots owned elsewhere must NOT be claimed here. A port that
|
|
137
|
+
// exported LEAK_DETECTED would be minting a number the conformance
|
|
138
|
+
// tree owns, which is the collision the band record exists to stop.
|
|
139
|
+
it('leaves slots owned by other packages unclaimed', () => {
|
|
140
|
+
const foreign = CONTRACT.extension_band.filter(
|
|
141
|
+
(s) => s.owner !== ENVELOPE_OWNER,
|
|
142
|
+
);
|
|
143
|
+
expect(foreign.length).toBeGreaterThan(0);
|
|
144
|
+
for (const slot of foreign) {
|
|
145
|
+
expect(exitCodeForClass(slot.class)).toBeUndefined();
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vitest setup: points XDG_CONFIG_HOME at an empty temp dir per test
|
|
3
|
+
* file, so a developer's own config (llm.yaml included) never reaches
|
|
4
|
+
* a test. A test that needs a config writes it there or sets its own.
|
|
5
|
+
*
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { mkdtempSync, rmSync } from "node:fs";
|
|
10
|
+
import { tmpdir } from "node:os";
|
|
11
|
+
import { join } from "node:path";
|
|
12
|
+
import { afterAll } from "vitest";
|
|
13
|
+
|
|
14
|
+
const dir = mkdtempSync(join(tmpdir(), "kit-ts-xdg-"));
|
|
15
|
+
process.env["XDG_CONFIG_HOME"] = dir;
|
|
16
|
+
afterAll(() => rmSync(dir, { recursive: true, force: true }));
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds the shared cross-language toolspec fixture tree
|
|
3
|
+
* (sdk/tests/cross-lang/fixtures/toolspec-manifest.tree.json) as a
|
|
4
|
+
* commander program, mirroring the Go cobra builder in
|
|
5
|
+
* go/ai/toolspec/cli/manifest_crosslang_test.go.
|
|
6
|
+
*/
|
|
7
|
+
import * as fs from "fs";
|
|
8
|
+
import * as path from "path";
|
|
9
|
+
import { Command, Option } from "commander";
|
|
10
|
+
|
|
11
|
+
export const FIXTURES = path.resolve(__dirname, "../../../tests/cross-lang/fixtures");
|
|
12
|
+
export const CONTRACTS = path.resolve(__dirname, "../../../../contracts");
|
|
13
|
+
|
|
14
|
+
interface TreeFlag {
|
|
15
|
+
name: string;
|
|
16
|
+
short?: string;
|
|
17
|
+
type: "bool" | "string" | "stringSlice";
|
|
18
|
+
default?: string | string[];
|
|
19
|
+
description?: string;
|
|
20
|
+
hidden?: boolean;
|
|
21
|
+
/** cobra MarkFlagRequired / commander makeOptionMandatory. */
|
|
22
|
+
required?: boolean;
|
|
23
|
+
/** kit flag enum (cli.FlagEnumAnnotation) / commander .choices(). */
|
|
24
|
+
enum?: string[];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
interface TreeCommand {
|
|
28
|
+
name: string;
|
|
29
|
+
short?: string;
|
|
30
|
+
long?: string;
|
|
31
|
+
hidden?: boolean;
|
|
32
|
+
run?: boolean;
|
|
33
|
+
annotations?: Record<string, string>;
|
|
34
|
+
flags?: TreeFlag[];
|
|
35
|
+
commands?: TreeCommand[];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface Tree {
|
|
39
|
+
tool: string;
|
|
40
|
+
version: string;
|
|
41
|
+
reserved: string[];
|
|
42
|
+
commands: TreeCommand[];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function addFixtureCommand(parent: Command, tc: TreeCommand): void {
|
|
46
|
+
const cmd = parent.command(tc.name, { hidden: tc.hidden ?? false });
|
|
47
|
+
if (tc.short && tc.long) cmd.summary(tc.short).description(tc.long);
|
|
48
|
+
else if (tc.short) cmd.description(tc.short);
|
|
49
|
+
if (tc.run) cmd.action(() => {});
|
|
50
|
+
if (tc.annotations) {
|
|
51
|
+
(cmd as Command & { annotations?: Record<string, string> }).annotations = {
|
|
52
|
+
...tc.annotations,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
for (const f of tc.flags ?? []) {
|
|
56
|
+
const short = f.short ? `-${f.short}, ` : "";
|
|
57
|
+
const arg =
|
|
58
|
+
f.type === "bool" ? "" : f.type === "string" ? " <value>" : " <values...>";
|
|
59
|
+
const opt = new Option(`${short}--${f.name}${arg}`, f.description);
|
|
60
|
+
if (f.default !== undefined) opt.default(f.default);
|
|
61
|
+
if (f.hidden) opt.hideHelp();
|
|
62
|
+
if (f.required) opt.makeOptionMandatory();
|
|
63
|
+
if (f.enum) opt.choices(f.enum);
|
|
64
|
+
cmd.addOption(opt);
|
|
65
|
+
}
|
|
66
|
+
for (const child of tc.commands ?? []) addFixtureCommand(cmd, child);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* The fixture program, with createCLI's `-v, --version` on the root.
|
|
71
|
+
*/
|
|
72
|
+
export function fixtureProgram(): { program: Command; tree: Tree } {
|
|
73
|
+
const tree = JSON.parse(
|
|
74
|
+
fs.readFileSync(path.join(FIXTURES, "toolspec-manifest.tree.json"), "utf-8"),
|
|
75
|
+
) as Tree;
|
|
76
|
+
const program = new Command(tree.tool).version(tree.version, "-v, --version");
|
|
77
|
+
for (const c of tree.commands) addFixtureCommand(program, c);
|
|
78
|
+
return { program, tree };
|
|
79
|
+
}
|
package/tsconfig.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"target": "ES2020",
|
|
4
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
4
5
|
"module": "CommonJS",
|
|
5
6
|
"declaration": true,
|
|
6
7
|
"outDir": "./dist",
|
|
@@ -8,5 +9,6 @@
|
|
|
8
9
|
"esModuleInterop": true,
|
|
9
10
|
"resolveJsonModule": true
|
|
10
11
|
},
|
|
11
|
-
"include": ["src"]
|
|
12
|
+
"include": ["src"],
|
|
13
|
+
"exclude": ["src/**/*.test.ts"]
|
|
12
14
|
}
|
package/vitest.config.ts
ADDED
package/src/tui/parity.json
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://hop.top/kit/go/console/tui/parity.json",
|
|
4
|
-
"description": "Cross-language TUI parity constants. All language implementations MUST load values from here.",
|
|
5
|
-
|
|
6
|
-
"status": {
|
|
7
|
-
"description": "Prefix symbols for status lines. Mirrors Go's InfoType constants in tui/status.go.",
|
|
8
|
-
"symbols": {
|
|
9
|
-
"info": "ℹ",
|
|
10
|
-
"success": "✓",
|
|
11
|
-
"error": "●",
|
|
12
|
-
"warn": "▲"
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
"spinner": {
|
|
17
|
-
"description": "Braille dot spinner frames and timing.",
|
|
18
|
-
"frames": ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"],
|
|
19
|
-
"interval_ms": 80
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
"anim": {
|
|
23
|
-
"description": "Gradient character-scramble animation constants.",
|
|
24
|
-
"runes": "0123456789abcdefABCDEF~!@#$%^&*()+=_",
|
|
25
|
-
"interval_ms": 100,
|
|
26
|
-
"default_width": 10
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
"help": {
|
|
30
|
-
"description": "Root --help layout contract. Fang is canonical; TS and Python mirror it.",
|
|
31
|
-
"section_order": ["commands", "flags"],
|
|
32
|
-
"sections": {
|
|
33
|
-
"usage": { "title": "USAGE" },
|
|
34
|
-
"commands": { "title": "COMMANDS" },
|
|
35
|
-
"flags": { "title": "FLAGS" },
|
|
36
|
-
"global flags": { "title": "GLOBAL FLAGS" },
|
|
37
|
-
"arguments": { "title": "ARGUMENTS" },
|
|
38
|
-
"aliases": { "title": "ALIASES" },
|
|
39
|
-
"examples": { "title": "EXAMPLES" },
|
|
40
|
-
"streams": { "title": "STREAMS" }
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
"verbosity": {
|
|
45
|
-
"description": "Stackable -V flag maps count to log level. --quiet overrides to warn.",
|
|
46
|
-
"flag": "-V",
|
|
47
|
-
"levels": {
|
|
48
|
-
"0": "info",
|
|
49
|
-
"1": "debug",
|
|
50
|
-
"2": "trace"
|
|
51
|
-
},
|
|
52
|
-
"quiet_override": "warn"
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
"streams": {
|
|
56
|
-
"description": "Per-command named output streams toggled via --stream flag.",
|
|
57
|
-
"flag": "--stream",
|
|
58
|
-
"label_format": "[{name}]",
|
|
59
|
-
"output": "stderr"
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
"table": {
|
|
63
|
-
"description": "Styled-table contract for the output package. Plain tabwriter is the default; callers opt in to the lipgloss-backed renderer via WithTableStyle. The styled path is gated on writer-is-TTY so non-TTY writers (pipes, files, tests) always emit ANSI-free, diff-friendly output.",
|
|
64
|
-
"render_option": "WithTableStyle",
|
|
65
|
-
"tty_only": true,
|
|
66
|
-
"row_emphasis_kinds": ["none", "primary", "secondary", "muted"],
|
|
67
|
-
"row_emphasis_option": "RowEmphasis",
|
|
68
|
-
"border_default": "normal"
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
"extends": [
|
|
72
|
-
"scope-defaults.json"
|
|
73
|
-
]
|
|
74
|
-
}
|