@hop-top/kit 0.5.0-alpha.4 → 0.5.0-alpha.6
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 +19 -0
- package/README.md +8 -8
- package/dist/chunk-6RFRV4VP.js +128 -0
- package/dist/{chunk-WTYDHXPW.js → chunk-7FDIN5KE.js} +55 -20
- package/dist/chunk-GAZPYCQD.js +120 -0
- package/dist/chunk-W7ERKNSQ.js +171 -0
- package/dist/{cli-8rfITnv4.d.ts → cli-C5B5tnpA.d.ts} +1 -60
- package/dist/cli.d.ts +2 -1
- package/dist/cli.js +4 -3
- package/dist/completion-CVnPcWMZ.d.ts +32 -0
- package/dist/completion.d.ts +2 -0
- package/dist/completion.js +13 -0
- package/dist/{index-DEyjGoo2.d.ts → index-DCe1boBz.d.ts} +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.js +28 -16
- package/dist/log-uKjHsK-c.d.ts +62 -0
- package/dist/log.d.ts +2 -0
- package/dist/log.js +14 -0
- package/dist/output.js +4 -4
- package/dist/parity-CvMuYcVI.d.ts +61 -0
- package/dist/toolspec-DPBr18Ub.d.ts +106 -0
- package/dist/toolspec.d.ts +1 -0
- package/dist/toolspec.js +11 -0
- package/dist/tui/index.d.ts +3 -2
- package/package.json +26 -2
- package/src/cli.help-command.test.ts +105 -0
- package/src/cli.test.ts +39 -0
- package/src/cli.ts +54 -9
- package/src/index.ts +3 -0
- package/dist/{chunk-UIOOOK6M.js → chunk-IXVQ62NZ.js} +2 -2
|
@@ -1,68 +1,9 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
+
import { P as ParityData } from './parity-CvMuYcVI.js';
|
|
2
3
|
import { E as ErrOffline, O as OfflineError, g as guardFetch, i as isOffline, a as isOfflineError, w as withOffline } from './netpolicy-Brx5XZUB.js';
|
|
3
4
|
import { Writable } from 'node:stream';
|
|
4
5
|
import { F as Format } from './output-CjZWmL8s.js';
|
|
5
6
|
|
|
6
|
-
/**
|
|
7
|
-
* @module tui/parity
|
|
8
|
-
* @package @hop-top/kit
|
|
9
|
-
*
|
|
10
|
-
* Cross-language parity constants SoT. Values are read from the canonical
|
|
11
|
-
* `contracts/parity/parity.json` at build time — tsup/esbuild inlines the
|
|
12
|
-
* JSON into the emitted bundle, so the published package stays
|
|
13
|
-
* self-contained without vendoring a second copy of the file.
|
|
14
|
-
*
|
|
15
|
-
* All TUI modules should import constants from here, not hardcode them.
|
|
16
|
-
*/
|
|
17
|
-
/** Display metadata for a single help section. */
|
|
18
|
-
interface SectionConfig {
|
|
19
|
-
title: string;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* ParityData models every content block `parity.json` declares.
|
|
23
|
-
*
|
|
24
|
-
* A block present in the JSON but absent here is decoration: nothing loads
|
|
25
|
-
* it, so no test and no consumer can see it drift. `PARITY_BLOCKS` below is
|
|
26
|
-
* the machine-checkable half of that rule.
|
|
27
|
-
*/
|
|
28
|
-
interface ParityData {
|
|
29
|
-
description: string;
|
|
30
|
-
status: {
|
|
31
|
-
symbols: Record<'info' | 'success' | 'error' | 'warn', string>;
|
|
32
|
-
};
|
|
33
|
-
spinner: {
|
|
34
|
-
frames: string[];
|
|
35
|
-
interval_ms: number;
|
|
36
|
-
};
|
|
37
|
-
anim: {
|
|
38
|
-
runes: string;
|
|
39
|
-
interval_ms: number;
|
|
40
|
-
default_width: number;
|
|
41
|
-
};
|
|
42
|
-
help: {
|
|
43
|
-
/** Fang-vocabulary section names in render order. */
|
|
44
|
-
section_order: string[];
|
|
45
|
-
/** Display metadata keyed by fang section name. */
|
|
46
|
-
sections: Record<string, SectionConfig>;
|
|
47
|
-
};
|
|
48
|
-
verbosity: {
|
|
49
|
-
flag: string;
|
|
50
|
-
/**
|
|
51
|
-
* Maps the stacked `-V` count (as a decimal string) to a log level name.
|
|
52
|
-
* Keys are strings because JSON object keys are.
|
|
53
|
-
*/
|
|
54
|
-
levels: Record<string, string>;
|
|
55
|
-
quiet_override: string;
|
|
56
|
-
};
|
|
57
|
-
streams: {
|
|
58
|
-
flag: string;
|
|
59
|
-
label_format: string;
|
|
60
|
-
output: string;
|
|
61
|
-
};
|
|
62
|
-
/** Sibling contract files the parity suite also covers. */
|
|
63
|
-
extends: string[];
|
|
64
|
-
}
|
|
65
|
-
|
|
66
7
|
/**
|
|
67
8
|
* @module hint
|
|
68
9
|
* @package @hop-top/kit
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import 'commander';
|
|
2
|
-
|
|
2
|
+
import './parity-CvMuYcVI.js';
|
|
3
3
|
export { E as ErrOffline, O as OfflineError, g as guardFetch, i as isOffline, a as isOfflineError, w as withOffline } from './netpolicy-Brx5XZUB.js';
|
|
4
|
+
export { C as CLIConfig, a as CLIResult, D as Dark, H as Hint, b as HintOptions, d as HintSet, N as Neon, P as Palette, T as Theme, e as active, f as applyHelpTheme, g as buildTheme, h as channel, i as createCLI, j as getCommandGroup, k as getStreamDefs, l as hintsEnabled, m as isQuiet, r as registerStream, n as registerUpgradeHints, o as registerVersionHints, p as renderHints, s as setCommandGroup, q as streamFlagName, t as streamLabel, u as streamOutput, v as verboseCount, w as verbosityFlagSpec, x as verbosityShorthand } from './cli-C5B5tnpA.js';
|
|
4
5
|
import 'node:stream';
|
|
5
6
|
import './output-CjZWmL8s.js';
|
|
6
7
|
import './error-Do8Qji43.js';
|
package/dist/cli.js
CHANGED
|
@@ -22,9 +22,8 @@
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var _chunk7FDIN5KEjs = require('./chunk-7FDIN5KE.js');
|
|
26
26
|
require('./chunk-QPUCXQXT.js');
|
|
27
|
-
require('./chunk-72XZWQX7.js');
|
|
28
27
|
|
|
29
28
|
|
|
30
29
|
|
|
@@ -33,6 +32,8 @@ require('./chunk-72XZWQX7.js');
|
|
|
33
32
|
|
|
34
33
|
|
|
35
34
|
var _chunkKVG7YCTSjs = require('./chunk-KVG7YCTS.js');
|
|
35
|
+
require('./chunk-72XZWQX7.js');
|
|
36
|
+
require('./chunk-POR5L2DG.js');
|
|
36
37
|
require('./chunk-R5U7XKVJ.js');
|
|
37
38
|
|
|
38
39
|
|
|
@@ -64,4 +65,4 @@ require('./chunk-R5U7XKVJ.js');
|
|
|
64
65
|
|
|
65
66
|
|
|
66
67
|
|
|
67
|
-
exports.Dark =
|
|
68
|
+
exports.Dark = _chunk7FDIN5KEjs.Dark; exports.ErrOffline = _chunkKVG7YCTSjs.ErrOffline; exports.HintSet = _chunk7FDIN5KEjs.HintSet; exports.Neon = _chunk7FDIN5KEjs.Neon; exports.OfflineError = _chunkKVG7YCTSjs.OfflineError; exports.active = _chunk7FDIN5KEjs.active; exports.applyHelpTheme = _chunk7FDIN5KEjs.applyHelpTheme; exports.buildTheme = _chunk7FDIN5KEjs.buildTheme; exports.channel = _chunk7FDIN5KEjs.channel; exports.createCLI = _chunk7FDIN5KEjs.createCLI; exports.getCommandGroup = _chunk7FDIN5KEjs.getCommandGroup; exports.getStreamDefs = _chunk7FDIN5KEjs.getStreamDefs; exports.guardFetch = _chunkKVG7YCTSjs.guardFetch; exports.hintsEnabled = _chunk7FDIN5KEjs.hintsEnabled; exports.isOffline = _chunkKVG7YCTSjs.isOffline; exports.isOfflineError = _chunkKVG7YCTSjs.isOfflineError; exports.isQuiet = _chunk7FDIN5KEjs.isQuiet; exports.registerStream = _chunk7FDIN5KEjs.registerStream; exports.registerUpgradeHints = _chunk7FDIN5KEjs.registerUpgradeHints; exports.registerVersionHints = _chunk7FDIN5KEjs.registerVersionHints; exports.renderHints = _chunk7FDIN5KEjs.renderHints; exports.setCommandGroup = _chunk7FDIN5KEjs.setCommandGroup; exports.streamFlagName = _chunk7FDIN5KEjs.streamFlagName; exports.streamLabel = _chunk7FDIN5KEjs.streamLabel; exports.streamOutput = _chunk7FDIN5KEjs.streamOutput; exports.verboseCount = _chunk7FDIN5KEjs.verboseCount; exports.verbosityFlagSpec = _chunk7FDIN5KEjs.verbosityFlagSpec; exports.verbosityShorthand = _chunk7FDIN5KEjs.verbosityShorthand; exports.withOffline = _chunkKVG7YCTSjs.withOffline;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @module completion
|
|
5
|
+
* @package @hop-top/kit
|
|
6
|
+
*
|
|
7
|
+
* Shell completion script generators for Commander-based CLIs.
|
|
8
|
+
* Extracts subcommand names and flag names from the program tree
|
|
9
|
+
* and generates bash/zsh/fish completion scripts.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/** Generate a bash completion script for the given program. */
|
|
13
|
+
declare function generateBashCompletion(program: Command): string;
|
|
14
|
+
/** Generate a zsh completion script for the given program. */
|
|
15
|
+
declare function generateZshCompletion(program: Command): string;
|
|
16
|
+
/** Generate a fish completion script for the given program. */
|
|
17
|
+
declare function generateFishCompletion(program: Command): string;
|
|
18
|
+
/**
|
|
19
|
+
* Create a hidden `completion` command with bash/zsh/fish subcommands.
|
|
20
|
+
* Each prints the completion script to stdout.
|
|
21
|
+
*/
|
|
22
|
+
declare function completionCommand(program: Command): Command;
|
|
23
|
+
|
|
24
|
+
declare const completion_completionCommand: typeof completionCommand;
|
|
25
|
+
declare const completion_generateBashCompletion: typeof generateBashCompletion;
|
|
26
|
+
declare const completion_generateFishCompletion: typeof generateFishCompletion;
|
|
27
|
+
declare const completion_generateZshCompletion: typeof generateZshCompletion;
|
|
28
|
+
declare namespace completion {
|
|
29
|
+
export { completion_completionCommand as completionCommand, completion_generateBashCompletion as generateBashCompletion, completion_generateFishCompletion as generateFishCompletion, completion_generateZshCompletion as generateZshCompletion };
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { completionCommand as a, generateFishCompletion as b, completion as c, generateZshCompletion as d, generateBashCompletion as g };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunk6RFRV4VPjs = require('./chunk-6RFRV4VP.js');
|
|
7
|
+
require('./chunk-R5U7XKVJ.js');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
exports.completionCommand = _chunk6RFRV4VPjs.completionCommand; exports.generateBashCompletion = _chunk6RFRV4VPjs.generateBashCompletion; exports.generateFishCompletion = _chunk6RFRV4VPjs.generateFishCompletion; exports.generateZshCompletion = _chunk6RFRV4VPjs.generateZshCompletion;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,11 +3,13 @@ export { a as alias } from './alias-BOj0-VAr.js';
|
|
|
3
3
|
export { l as anthropic } from './llm-anthropic-Cd_I2xXB.js';
|
|
4
4
|
export { a as api } from './api-DAexsu2H.js';
|
|
5
5
|
export { a as auth } from './auth-2-jfgiHn.js';
|
|
6
|
-
export { c as cli } from './cli-
|
|
6
|
+
export { c as cli } from './cli-C5B5tnpA.js';
|
|
7
|
+
export { c as completion } from './completion-CVnPcWMZ.js';
|
|
7
8
|
export { c as config } from './config-Bm9fBXch.js';
|
|
8
9
|
export { e as errcorrect } from './errcorrect-BcX1Ft0K.js';
|
|
9
10
|
export { i as id } from './index-VLDcI5NF.js';
|
|
10
11
|
export { l as llm } from './llm-DYuR7_uX.js';
|
|
12
|
+
export { l as log } from './log-uKjHsK-c.js';
|
|
11
13
|
export { i as mcp } from './index-B-pqGHhU.js';
|
|
12
14
|
export { n as netpolicy } from './netpolicy-Brx5XZUB.js';
|
|
13
15
|
export { l as openai } from './llm-openai-DyFrucmV.js';
|
|
@@ -21,10 +23,12 @@ export { s as scope } from './scope-BrhYB4ij.js';
|
|
|
21
23
|
export { s as serve } from './serve-D8yWMrTc.js';
|
|
22
24
|
export { s as stream } from './stream-CrjeCp0M.js';
|
|
23
25
|
export { i as telemetry } from './index-C3Zw4wDJ.js';
|
|
24
|
-
export {
|
|
26
|
+
export { t as toolspec } from './toolspec-DPBr18Ub.js';
|
|
27
|
+
export { i as tui } from './index-DCe1boBz.js';
|
|
25
28
|
export { u as upgrade } from './upgrade-p_zh3pvV.js';
|
|
26
29
|
export { x as xdg } from './xdg-DB7Shoib.js';
|
|
27
30
|
import 'commander';
|
|
31
|
+
import './parity-CvMuYcVI.js';
|
|
28
32
|
import 'node:stream';
|
|
29
33
|
import 'zod';
|
|
30
34
|
import '@modelcontextprotocol/server';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
+
var _chunkW7ERKNSQjs = require('./chunk-W7ERKNSQ.js');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkWWUKGJB5js = require('./chunk-WWUKGJB5.js');
|
|
7
|
+
|
|
8
|
+
|
|
3
9
|
var _chunkL23O2FFEjs = require('./chunk-L23O2FFE.js');
|
|
4
10
|
|
|
5
11
|
|
|
@@ -12,6 +18,12 @@ var _chunkYOBAUCVNjs = require('./chunk-YOBAUCVN.js');
|
|
|
12
18
|
var _chunkGGWJRWWAjs = require('./chunk-GGWJRWWA.js');
|
|
13
19
|
|
|
14
20
|
|
|
21
|
+
var _chunk6SVOHNICjs = require('./chunk-6SVOHNIC.js');
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
var _chunkMUIQVU6Ejs = require('./chunk-MUIQVU6E.js');
|
|
25
|
+
|
|
26
|
+
|
|
15
27
|
var _chunkWUOAQVOAjs = require('./chunk-WUOAQVOA.js');
|
|
16
28
|
|
|
17
29
|
|
|
@@ -27,30 +39,23 @@ var _chunkMQXYDYRDjs = require('./chunk-MQXYDYRD.js');
|
|
|
27
39
|
var _chunkBRNEKPWXjs = require('./chunk-BRNEKPWX.js');
|
|
28
40
|
|
|
29
41
|
|
|
30
|
-
var _chunkWWUKGJB5js = require('./chunk-WWUKGJB5.js');
|
|
31
|
-
|
|
32
|
-
|
|
33
42
|
var _chunkT46YPHKNjs = require('./chunk-T46YPHKN.js');
|
|
34
43
|
|
|
35
44
|
|
|
36
|
-
var
|
|
37
|
-
require('./chunk-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
var _chunkBDNNPRX6js = require('./chunk-BDNNPRX6.js');
|
|
45
|
+
var _chunkABQSE7AIjs = require('./chunk-ABQSE7AI.js');
|
|
46
|
+
require('./chunk-YGYQUFGY.js');
|
|
41
47
|
|
|
42
48
|
|
|
43
|
-
var
|
|
49
|
+
var _chunkPSFYJGDGjs = require('./chunk-PSFYJGDG.js');
|
|
44
50
|
|
|
45
51
|
|
|
46
|
-
var
|
|
52
|
+
var _chunkGAZPYCQDjs = require('./chunk-GAZPYCQD.js');
|
|
47
53
|
|
|
48
54
|
|
|
49
|
-
var
|
|
50
|
-
require('./chunk-YGYQUFGY.js');
|
|
55
|
+
var _chunkIXVQ62NZjs = require('./chunk-IXVQ62NZ.js');
|
|
51
56
|
|
|
52
57
|
|
|
53
|
-
var
|
|
58
|
+
var _chunkBDNNPRX6js = require('./chunk-BDNNPRX6.js');
|
|
54
59
|
|
|
55
60
|
|
|
56
61
|
var _chunkQJVSKKRQjs = require('./chunk-QJVSKKRQ.js');
|
|
@@ -68,12 +73,16 @@ var _chunkCSJWB6D3js = require('./chunk-CSJWB6D3.js');
|
|
|
68
73
|
var _chunkUKZIAQA7js = require('./chunk-UKZIAQA7.js');
|
|
69
74
|
|
|
70
75
|
|
|
71
|
-
var
|
|
76
|
+
var _chunk7FDIN5KEjs = require('./chunk-7FDIN5KE.js');
|
|
72
77
|
require('./chunk-QPUCXQXT.js');
|
|
73
|
-
require('./chunk-72XZWQX7.js');
|
|
74
78
|
|
|
75
79
|
|
|
76
80
|
var _chunkKVG7YCTSjs = require('./chunk-KVG7YCTS.js');
|
|
81
|
+
require('./chunk-72XZWQX7.js');
|
|
82
|
+
require('./chunk-POR5L2DG.js');
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
var _chunk6RFRV4VPjs = require('./chunk-6RFRV4VP.js');
|
|
77
86
|
|
|
78
87
|
|
|
79
88
|
var _chunkIQXEISMCjs = require('./chunk-IQXEISMC.js');
|
|
@@ -108,4 +117,7 @@ require('./chunk-R5U7XKVJ.js');
|
|
|
108
117
|
|
|
109
118
|
|
|
110
119
|
|
|
111
|
-
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
exports.aim = _chunkQJVSKKRQjs.aim_exports; exports.alias = _chunkS45UHXQFjs.alias_exports; exports.anthropic = _chunkT46YPHKNjs.llm_anthropic_exports; exports.api = _chunkCSJWB6D3js.api_exports; exports.auth = _chunkUKZIAQA7js.auth_exports; exports.cli = _chunk7FDIN5KEjs.cli_exports; exports.completion = _chunk6RFRV4VPjs.completion_exports; exports.config = _chunkIQXEISMCjs.config_exports; exports.errcorrect = _chunk3FIKGFKIjs.errcorrect_exports; exports.id = _chunkL23O2FFEjs.id_exports; exports.llm = _chunkPSFYJGDGjs.llm_exports; exports.log = _chunkGAZPYCQDjs.log_exports; exports.mcp = _chunkJTMPNXVQjs.mcp_exports; exports.netpolicy = _chunkKVG7YCTSjs.netpolicy_exports; exports.openai = _chunkABQSE7AIjs.llm_openai_exports; exports.output = _chunkIXVQ62NZjs.output_exports; exports.progress = _chunkBDNNPRX6js.progress_exports; exports.provenance = _chunk6SVOHNICjs.provenance_exports; exports.routellm = _chunkMUIQVU6Ejs.routellm_exports; exports.rpc = _chunkWUOAQVOAjs.rpc_exports; exports.safety = _chunk6HFAEZ52js.safety_exports; exports.scope = _chunkWBVO43HUjs.scope_exports; exports.serve = _chunkMQXYDYRDjs.serve_exports; exports.stream = _chunkBRNEKPWXjs.stream_exports; exports.telemetry = _chunkYOBAUCVNjs.telemetry_exports; exports.toolspec = _chunkW7ERKNSQjs.toolspec_exports; exports.tui = _chunkGGWJRWWAjs.tui_exports; exports.upgrade = _chunkWWUKGJB5js.upgrade_exports; exports.xdg = _chunk4UE5TCMQjs.xdg_exports;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { P as ParityData } from './parity-CvMuYcVI.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Structured logger wrapping pino — applies kit's charmtone theme
|
|
5
|
+
* colors to stderr output.
|
|
6
|
+
*
|
|
7
|
+
* API: `logger.info('msg', 'key', val, 'key2', val2)` (variadic key-value)
|
|
8
|
+
* This matches Go's charm/log API, not pino's native object API.
|
|
9
|
+
* Pino handles transports, serialization, and performance under the hood.
|
|
10
|
+
*
|
|
11
|
+
* The `-V` count → level mapping and the `--quiet` override both come from
|
|
12
|
+
* the parity contract (`parity.json` verbosity block), so the level
|
|
13
|
+
* vocabulary stays identical across the Go, TypeScript and Python ports.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
interface Logger {
|
|
17
|
+
info(msg: string, ...keyvals: any[]): void;
|
|
18
|
+
warn(msg: string, ...keyvals: any[]): void;
|
|
19
|
+
error(msg: string, ...keyvals: any[]): void;
|
|
20
|
+
debug(msg: string, ...keyvals: any[]): void;
|
|
21
|
+
trace(msg: string, ...keyvals: any[]): void;
|
|
22
|
+
}
|
|
23
|
+
interface LoggerOptions {
|
|
24
|
+
quiet?: boolean;
|
|
25
|
+
noColor?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Resolve a `-V` count against a parity contract's `verbosity.levels`
|
|
29
|
+
* table. Counts above the highest declared key clamp to that key's level;
|
|
30
|
+
* an empty or unresolvable table falls back to `info`.
|
|
31
|
+
*
|
|
32
|
+
* Taking the contract as a parameter (rather than reading the module-level
|
|
33
|
+
* `parity`) keeps the mapping testable against a constructed `ParityData`
|
|
34
|
+
* without mutating the shared `parity.json`.
|
|
35
|
+
*/
|
|
36
|
+
declare function verbosityLevel(d: ParityData, verbose: number): string;
|
|
37
|
+
/**
|
|
38
|
+
* Resolve a parity contract's `verbosity.quiet_override` to a pino level
|
|
39
|
+
* name. An unrecognized or absent override falls back to `warn`.
|
|
40
|
+
*/
|
|
41
|
+
declare function quietLevel(d: ParityData): string;
|
|
42
|
+
declare function createLogger(opts?: LoggerOptions): Logger;
|
|
43
|
+
/**
|
|
44
|
+
* Map verbose count to a pino level through the parity contract's
|
|
45
|
+
* `verbosity.levels` table. Quiet overrides to the contract's
|
|
46
|
+
* `quiet_override` level regardless of verbose count.
|
|
47
|
+
*/
|
|
48
|
+
declare function withVerbose(opts: LoggerOptions & {
|
|
49
|
+
verbose?: number;
|
|
50
|
+
}): Logger;
|
|
51
|
+
|
|
52
|
+
type log_Logger = Logger;
|
|
53
|
+
type log_LoggerOptions = LoggerOptions;
|
|
54
|
+
declare const log_createLogger: typeof createLogger;
|
|
55
|
+
declare const log_quietLevel: typeof quietLevel;
|
|
56
|
+
declare const log_verbosityLevel: typeof verbosityLevel;
|
|
57
|
+
declare const log_withVerbose: typeof withVerbose;
|
|
58
|
+
declare namespace log {
|
|
59
|
+
export { type log_Logger as Logger, type log_LoggerOptions as LoggerOptions, log_createLogger as createLogger, log_quietLevel as quietLevel, log_verbosityLevel as verbosityLevel, log_withVerbose as withVerbose };
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export { type Logger as L, type LoggerOptions as a, createLogger as c, log as l, quietLevel as q, verbosityLevel as v, withVerbose as w };
|
package/dist/log.d.ts
ADDED
package/dist/log.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkGAZPYCQDjs = require('./chunk-GAZPYCQD.js');
|
|
7
|
+
require('./chunk-QPUCXQXT.js');
|
|
8
|
+
require('./chunk-R5U7XKVJ.js');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
exports.createLogger = _chunkGAZPYCQDjs.createLogger; exports.quietLevel = _chunkGAZPYCQDjs.quietLevel; exports.verbosityLevel = _chunkGAZPYCQDjs.verbosityLevel; exports.withVerbose = _chunkGAZPYCQDjs.withVerbose;
|
package/dist/output.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkIXVQ62NZjs = require('./chunk-IXVQ62NZ.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
@@ -23,6 +23,7 @@ var _chunkUIOOOK6Mjs = require('./chunk-UIOOOK6M.js');
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
+
var _chunk72XZWQX7js = require('./chunk-72XZWQX7.js');
|
|
26
27
|
|
|
27
28
|
|
|
28
29
|
|
|
@@ -50,7 +51,6 @@ var _chunkUIOOOK6Mjs = require('./chunk-UIOOOK6M.js');
|
|
|
50
51
|
|
|
51
52
|
|
|
52
53
|
|
|
53
|
-
var _chunkPOR5L2DGjs = require('./chunk-POR5L2DG.js');
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
|
|
@@ -67,7 +67,7 @@ var _chunkPOR5L2DGjs = require('./chunk-POR5L2DG.js');
|
|
|
67
67
|
|
|
68
68
|
|
|
69
69
|
|
|
70
|
-
var
|
|
70
|
+
var _chunkPOR5L2DGjs = require('./chunk-POR5L2DG.js');
|
|
71
71
|
require('./chunk-R5U7XKVJ.js');
|
|
72
72
|
|
|
73
73
|
|
|
@@ -134,4 +134,4 @@ require('./chunk-R5U7XKVJ.js');
|
|
|
134
134
|
|
|
135
135
|
|
|
136
136
|
|
|
137
|
-
exports.CODE_CONFLICT = _chunkPOR5L2DGjs.CODE_CONFLICT; exports.CODE_CONSENT_REFUSED = _chunkPOR5L2DGjs.CODE_CONSENT_REFUSED; exports.CODE_GENERIC = _chunkPOR5L2DGjs.CODE_GENERIC; exports.CODE_NOT_FOUND = _chunkPOR5L2DGjs.CODE_NOT_FOUND; exports.CODE_OK = _chunkPOR5L2DGjs.CODE_OK; exports.CODE_PREREQUISITE = _chunkPOR5L2DGjs.CODE_PREREQUISITE; exports.CODE_PROVENANCE_MISSING = _chunkPOR5L2DGjs.CODE_PROVENANCE_MISSING; exports.CODE_RATE_LIMITED = _chunkPOR5L2DGjs.CODE_RATE_LIMITED; exports.CODE_TRANSIENT = _chunkPOR5L2DGjs.CODE_TRANSIENT; exports.CODE_UNAUTHORIZED = _chunkPOR5L2DGjs.CODE_UNAUTHORIZED; exports.CODE_USAGE = _chunkPOR5L2DGjs.CODE_USAGE; exports.CSV_FORMAT =
|
|
137
|
+
exports.CODE_CONFLICT = _chunkPOR5L2DGjs.CODE_CONFLICT; exports.CODE_CONSENT_REFUSED = _chunkPOR5L2DGjs.CODE_CONSENT_REFUSED; exports.CODE_GENERIC = _chunkPOR5L2DGjs.CODE_GENERIC; exports.CODE_NOT_FOUND = _chunkPOR5L2DGjs.CODE_NOT_FOUND; exports.CODE_OK = _chunkPOR5L2DGjs.CODE_OK; exports.CODE_PREREQUISITE = _chunkPOR5L2DGjs.CODE_PREREQUISITE; exports.CODE_PROVENANCE_MISSING = _chunkPOR5L2DGjs.CODE_PROVENANCE_MISSING; exports.CODE_RATE_LIMITED = _chunkPOR5L2DGjs.CODE_RATE_LIMITED; exports.CODE_TRANSIENT = _chunkPOR5L2DGjs.CODE_TRANSIENT; exports.CODE_UNAUTHORIZED = _chunkPOR5L2DGjs.CODE_UNAUTHORIZED; exports.CODE_USAGE = _chunkPOR5L2DGjs.CODE_USAGE; exports.CSV_FORMAT = _chunkIXVQ62NZjs.CSV_FORMAT; exports.EXIT_CONFLICT = _chunkPOR5L2DGjs.EXIT_CONFLICT; exports.EXIT_CONSENT_REFUSED = _chunkPOR5L2DGjs.EXIT_CONSENT_REFUSED; exports.EXIT_GENERIC = _chunkPOR5L2DGjs.EXIT_GENERIC; exports.EXIT_NOT_FOUND = _chunkPOR5L2DGjs.EXIT_NOT_FOUND; exports.EXIT_OK = _chunkPOR5L2DGjs.EXIT_OK; exports.EXIT_PREREQUISITE = _chunkPOR5L2DGjs.EXIT_PREREQUISITE; exports.EXIT_PROVENANCE_MISSING = _chunkPOR5L2DGjs.EXIT_PROVENANCE_MISSING; exports.EXIT_RATE_LIMITED = _chunkPOR5L2DGjs.EXIT_RATE_LIMITED; exports.EXIT_TRANSIENT = _chunkPOR5L2DGjs.EXIT_TRANSIENT; exports.EXIT_UNAUTHORIZED = _chunkPOR5L2DGjs.EXIT_UNAUTHORIZED; exports.EXIT_USAGE = _chunkPOR5L2DGjs.EXIT_USAGE; exports.JSON_FORMAT = _chunkIXVQ62NZjs.JSON_FORMAT; exports.Registry = _chunk72XZWQX7js.Registry; exports.TABLE_FORMAT = _chunkIXVQ62NZjs.TABLE_FORMAT; exports.TEXT_FORMAT = _chunkIXVQ62NZjs.TEXT_FORMAT; exports.TRANSIENCE_PERMANENT = _chunkPOR5L2DGjs.TRANSIENCE_PERMANENT; exports.TRANSIENCE_TRANSIENT = _chunkPOR5L2DGjs.TRANSIENCE_TRANSIENT; exports.TRANSIENCE_UNKNOWN = _chunkPOR5L2DGjs.TRANSIENCE_UNKNOWN; exports.YAML_FORMAT = _chunkIXVQ62NZjs.YAML_FORMAT; exports.columnName = _chunk72XZWQX7js.columnName; exports.conflictError = _chunkPOR5L2DGjs.conflictError; exports.consentRefusedError = _chunkPOR5L2DGjs.consentRefusedError; exports.defaultRegistry = _chunk72XZWQX7js.defaultRegistry; exports.deriveHeaders = _chunk72XZWQX7js.deriveHeaders; exports.dispatch = _chunkIXVQ62NZjs.dispatch; exports.exitClasses = _chunkPOR5L2DGjs.exitClasses; exports.exitCodeForClass = _chunkPOR5L2DGjs.exitCodeForClass; exports.genericError = _chunkPOR5L2DGjs.genericError; exports.jsonFormatter = _chunk72XZWQX7js.jsonFormatter; exports.newRegistry = _chunk72XZWQX7js.newRegistry; exports.notFoundError = _chunkPOR5L2DGjs.notFoundError; exports.optionTypeName = _chunk72XZWQX7js.optionTypeName; exports.parseOptions = _chunk72XZWQX7js.parseOptions; exports.prerequisiteError = _chunkPOR5L2DGjs.prerequisiteError; exports.projectRows = _chunk72XZWQX7js.projectRows; exports.provenanceMissingError = _chunkPOR5L2DGjs.provenanceMissingError; exports.rateLimitedError = _chunkPOR5L2DGjs.rateLimitedError; exports.registerOutputFlags = _chunk72XZWQX7js.registerOutputFlags; exports.registryFor = _chunk72XZWQX7js.registryFor; exports.render = _chunkIXVQ62NZjs.render; exports.renderError = _chunkPOR5L2DGjs.renderError; exports.resolveCols = _chunk72XZWQX7js.resolveCols; exports.resolveEffectiveCols = _chunk72XZWQX7js.resolveEffectiveCols; exports.tableFormatter = _chunk72XZWQX7js.tableFormatter; exports.transienceForCode = _chunkPOR5L2DGjs.transienceForCode; exports.transientError = _chunkPOR5L2DGjs.transientError; exports.unauthorizedError = _chunkPOR5L2DGjs.unauthorizedError; exports.unwrapError = _chunkPOR5L2DGjs.unwrapError; exports.usageError = _chunkPOR5L2DGjs.usageError; exports.withTransience = _chunkPOR5L2DGjs.withTransience; exports.wrapError = _chunkPOR5L2DGjs.wrapError; exports.yamlFormatter = _chunk72XZWQX7js.yamlFormatter;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module tui/parity
|
|
3
|
+
* @package @hop-top/kit
|
|
4
|
+
*
|
|
5
|
+
* Cross-language parity constants SoT. Values are read from the canonical
|
|
6
|
+
* `contracts/parity/parity.json` at build time — tsup/esbuild inlines the
|
|
7
|
+
* JSON into the emitted bundle, so the published package stays
|
|
8
|
+
* self-contained without vendoring a second copy of the file.
|
|
9
|
+
*
|
|
10
|
+
* All TUI modules should import constants from here, not hardcode them.
|
|
11
|
+
*/
|
|
12
|
+
/** Display metadata for a single help section. */
|
|
13
|
+
interface SectionConfig {
|
|
14
|
+
title: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* ParityData models every content block `parity.json` declares.
|
|
18
|
+
*
|
|
19
|
+
* A block present in the JSON but absent here is decoration: nothing loads
|
|
20
|
+
* it, so no test and no consumer can see it drift. `PARITY_BLOCKS` below is
|
|
21
|
+
* the machine-checkable half of that rule.
|
|
22
|
+
*/
|
|
23
|
+
interface ParityData {
|
|
24
|
+
description: string;
|
|
25
|
+
status: {
|
|
26
|
+
symbols: Record<'info' | 'success' | 'error' | 'warn', string>;
|
|
27
|
+
};
|
|
28
|
+
spinner: {
|
|
29
|
+
frames: string[];
|
|
30
|
+
interval_ms: number;
|
|
31
|
+
};
|
|
32
|
+
anim: {
|
|
33
|
+
runes: string;
|
|
34
|
+
interval_ms: number;
|
|
35
|
+
default_width: number;
|
|
36
|
+
};
|
|
37
|
+
help: {
|
|
38
|
+
/** Fang-vocabulary section names in render order. */
|
|
39
|
+
section_order: string[];
|
|
40
|
+
/** Display metadata keyed by fang section name. */
|
|
41
|
+
sections: Record<string, SectionConfig>;
|
|
42
|
+
};
|
|
43
|
+
verbosity: {
|
|
44
|
+
flag: string;
|
|
45
|
+
/**
|
|
46
|
+
* Maps the stacked `-V` count (as a decimal string) to a log level name.
|
|
47
|
+
* Keys are strings because JSON object keys are.
|
|
48
|
+
*/
|
|
49
|
+
levels: Record<string, string>;
|
|
50
|
+
quiet_override: string;
|
|
51
|
+
};
|
|
52
|
+
streams: {
|
|
53
|
+
flag: string;
|
|
54
|
+
label_format: string;
|
|
55
|
+
output: string;
|
|
56
|
+
};
|
|
57
|
+
/** Sibling contract files the parity suite also covers. */
|
|
58
|
+
extends: string[];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export type { ParityData as P };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
type SafetyLevel = "safe" | "caution" | "dangerous";
|
|
2
|
+
interface Contract {
|
|
3
|
+
idempotent: boolean;
|
|
4
|
+
sideEffects?: string[];
|
|
5
|
+
retryable: boolean;
|
|
6
|
+
preConditions?: string[];
|
|
7
|
+
}
|
|
8
|
+
interface Safety {
|
|
9
|
+
level: SafetyLevel;
|
|
10
|
+
requiresConfirmation?: boolean;
|
|
11
|
+
permissions?: string[];
|
|
12
|
+
}
|
|
13
|
+
interface OutputSchema {
|
|
14
|
+
format?: string;
|
|
15
|
+
fields?: string[];
|
|
16
|
+
example?: string;
|
|
17
|
+
}
|
|
18
|
+
interface StateIntrospection {
|
|
19
|
+
configCommands?: string[];
|
|
20
|
+
envVars?: string[];
|
|
21
|
+
authCommands?: string[];
|
|
22
|
+
}
|
|
23
|
+
interface Provenance {
|
|
24
|
+
source?: string;
|
|
25
|
+
retrievedAt?: string;
|
|
26
|
+
confidence?: number;
|
|
27
|
+
}
|
|
28
|
+
interface Intent {
|
|
29
|
+
domain?: string;
|
|
30
|
+
category?: string;
|
|
31
|
+
tags?: string[];
|
|
32
|
+
}
|
|
33
|
+
interface Flag {
|
|
34
|
+
name: string;
|
|
35
|
+
short?: string;
|
|
36
|
+
type?: string;
|
|
37
|
+
description?: string;
|
|
38
|
+
deprecated?: boolean;
|
|
39
|
+
replacedBy?: string;
|
|
40
|
+
}
|
|
41
|
+
interface Command {
|
|
42
|
+
name: string;
|
|
43
|
+
aliases?: string[];
|
|
44
|
+
flags?: Flag[];
|
|
45
|
+
children?: Command[];
|
|
46
|
+
contract?: Contract;
|
|
47
|
+
safety?: Safety;
|
|
48
|
+
previewModes?: string[];
|
|
49
|
+
outputSchema?: OutputSchema;
|
|
50
|
+
deprecated?: boolean;
|
|
51
|
+
deprecatedSince?: string;
|
|
52
|
+
replacedBy?: string;
|
|
53
|
+
intent?: Intent;
|
|
54
|
+
suggestedNext?: string[];
|
|
55
|
+
}
|
|
56
|
+
interface ErrorPattern {
|
|
57
|
+
pattern: string;
|
|
58
|
+
fix: string;
|
|
59
|
+
source?: string;
|
|
60
|
+
cause?: string;
|
|
61
|
+
fixes?: string[];
|
|
62
|
+
confidence?: number;
|
|
63
|
+
provenance?: Provenance;
|
|
64
|
+
}
|
|
65
|
+
interface Workflow {
|
|
66
|
+
name: string;
|
|
67
|
+
steps: string[];
|
|
68
|
+
after?: Record<string, string[]>;
|
|
69
|
+
provenance?: Provenance;
|
|
70
|
+
}
|
|
71
|
+
interface ToolSpec {
|
|
72
|
+
name: string;
|
|
73
|
+
schemaVersion: string;
|
|
74
|
+
commands: Command[];
|
|
75
|
+
flags?: Flag[];
|
|
76
|
+
errorPatterns?: ErrorPattern[];
|
|
77
|
+
workflows?: Workflow[];
|
|
78
|
+
stateIntrospection?: StateIntrospection;
|
|
79
|
+
}
|
|
80
|
+
/** Parse a YAML toolspec file into a ToolSpec object. */
|
|
81
|
+
declare function loadToolSpec(yamlPath: string): ToolSpec;
|
|
82
|
+
/** Validate a ToolSpec, returning a list of error strings. */
|
|
83
|
+
declare function validateToolSpec(spec: ToolSpec): string[];
|
|
84
|
+
/** BFS search for a command by name (mirrors Go FindCommand). */
|
|
85
|
+
declare function findCommand(spec: ToolSpec, name: string): Command | undefined;
|
|
86
|
+
|
|
87
|
+
type toolspec_Command = Command;
|
|
88
|
+
type toolspec_Contract = Contract;
|
|
89
|
+
type toolspec_ErrorPattern = ErrorPattern;
|
|
90
|
+
type toolspec_Flag = Flag;
|
|
91
|
+
type toolspec_Intent = Intent;
|
|
92
|
+
type toolspec_OutputSchema = OutputSchema;
|
|
93
|
+
type toolspec_Provenance = Provenance;
|
|
94
|
+
type toolspec_Safety = Safety;
|
|
95
|
+
type toolspec_SafetyLevel = SafetyLevel;
|
|
96
|
+
type toolspec_StateIntrospection = StateIntrospection;
|
|
97
|
+
type toolspec_ToolSpec = ToolSpec;
|
|
98
|
+
type toolspec_Workflow = Workflow;
|
|
99
|
+
declare const toolspec_findCommand: typeof findCommand;
|
|
100
|
+
declare const toolspec_loadToolSpec: typeof loadToolSpec;
|
|
101
|
+
declare const toolspec_validateToolSpec: typeof validateToolSpec;
|
|
102
|
+
declare namespace toolspec {
|
|
103
|
+
export { type toolspec_Command as Command, type toolspec_Contract as Contract, type toolspec_ErrorPattern as ErrorPattern, type toolspec_Flag as Flag, type toolspec_Intent as Intent, type toolspec_OutputSchema as OutputSchema, type toolspec_Provenance as Provenance, type toolspec_Safety as Safety, type toolspec_SafetyLevel as SafetyLevel, type toolspec_StateIntrospection as StateIntrospection, type toolspec_ToolSpec as ToolSpec, type toolspec_Workflow as Workflow, toolspec_findCommand as findCommand, toolspec_loadToolSpec as loadToolSpec, toolspec_validateToolSpec as validateToolSpec };
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export { type Command as C, type ErrorPattern as E, type Flag as F, type Intent as I, type OutputSchema as O, type Provenance as P, type Safety as S, type ToolSpec as T, type Workflow as W, type Contract as a, type SafetyLevel as b, type StateIntrospection as c, findCommand as f, loadToolSpec as l, toolspec as t, validateToolSpec as v };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { C as Command, a as Contract, E as ErrorPattern, F as Flag, I as Intent, O as OutputSchema, P as Provenance, S as Safety, b as SafetyLevel, c as StateIntrospection, T as ToolSpec, W as Workflow, f as findCommand, l as loadToolSpec, v as validateToolSpec } from './toolspec-DPBr18Ub.js';
|
package/dist/toolspec.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunkW7ERKNSQjs = require('./chunk-W7ERKNSQ.js');
|
|
6
|
+
require('./chunk-R5U7XKVJ.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
exports.findCommand = _chunkW7ERKNSQjs.findCommand; exports.loadToolSpec = _chunkW7ERKNSQjs.loadToolSpec; exports.validateToolSpec = _chunkW7ERKNSQjs.validateToolSpec;
|
package/dist/tui/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { A as Anim, a as AnimOpts, B as BadgeOpts, C as ConfirmOpts, L as ListItem, b as ListOpts, P as Progress, S as Spinner, c as StatusKind, d as anim, e as badge, f as clamp01, g as confirm, l as list, m as makeGradient, p as pills, h as progress, r as renderBarPlain, s as spinner, j as status } from '../index-
|
|
2
|
-
import '../cli-
|
|
1
|
+
export { A as Anim, a as AnimOpts, B as BadgeOpts, C as ConfirmOpts, L as ListItem, b as ListOpts, P as Progress, S as Spinner, c as StatusKind, d as anim, e as badge, f as clamp01, g as confirm, l as list, m as makeGradient, p as pills, h as progress, r as renderBarPlain, s as spinner, j as status } from '../index-DCe1boBz.js';
|
|
2
|
+
import '../cli-C5B5tnpA.js';
|
|
3
3
|
import 'commander';
|
|
4
|
+
import '../parity-CvMuYcVI.js';
|
|
4
5
|
import '../netpolicy-Brx5XZUB.js';
|
|
5
6
|
import 'node:stream';
|
|
6
7
|
import '../output-CjZWmL8s.js';
|