@hop-top/kit 0.5.0-alpha.0 → 0.5.0-alpha.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/CHANGELOG.md CHANGED
@@ -4,6 +4,17 @@ All notable changes to `@hop-top/kit` are documented in this file.
4
4
  Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/);
5
5
  versions follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.5.0-alpha.1](https://github.com/hop-top/poly-kit/compare/kit-ts/v0.5.0-alpha.0...kit-ts/v0.5.0-alpha.1) (2026-07-14)
8
+
9
+ The hop-top team is happy to announce Kit's TS SDK 0.5.0-alpha.1. This release includes maintenance release with bug fixes.
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * **ts:** ESM export conditions + self-contained parity data
15
+
16
+ Full diff: [kit-ts/v0.5.0-alpha.0...kit-ts/v0.5.0-alpha.1](https://github.com/hop-top/poly-kit/compare/kit-ts/v0.5.0-alpha.0...kit-ts/v0.5.0-alpha.1)
17
+
7
18
  ## [0.5.0-alpha.0](https://github.com/hop-top/poly-kit/compare/kit-ts/v0.4.0-alpha.2...kit-ts/v0.5.0-alpha.0) (2026-06-07)
8
19
 
9
20
  The hop-top team is happy to announce Kit's TS SDK 0.5.0-alpha.0. This release includes miscellaneous improvements.
package/dist/cli.js CHANGED
@@ -51,16 +51,76 @@ __export(cli_exports, {
51
51
  module.exports = __toCommonJS(cli_exports);
52
52
  var import_commander = require("commander");
53
53
 
54
+ // src/tui/parity.json
55
+ var parity_default = {
56
+ $schema: "https://json-schema.org/draft/2020-12/schema",
57
+ $id: "https://hop.top/kit/go/console/tui/parity.json",
58
+ description: "Cross-language TUI parity constants. All language implementations MUST load values from here.",
59
+ status: {
60
+ description: "Prefix symbols for status lines. Mirrors Go's InfoType constants in tui/status.go.",
61
+ symbols: {
62
+ info: "\u2139",
63
+ success: "\u2713",
64
+ error: "\u25CF",
65
+ warn: "\u25B2"
66
+ }
67
+ },
68
+ spinner: {
69
+ description: "Braille dot spinner frames and timing.",
70
+ frames: ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"],
71
+ interval_ms: 80
72
+ },
73
+ anim: {
74
+ description: "Gradient character-scramble animation constants.",
75
+ runes: "0123456789abcdefABCDEF~!@#$%^&*()+=_",
76
+ interval_ms: 100,
77
+ default_width: 10
78
+ },
79
+ help: {
80
+ description: "Root --help layout contract. Fang is canonical; TS and Python mirror it.",
81
+ section_order: ["commands", "flags"],
82
+ sections: {
83
+ usage: { title: "USAGE" },
84
+ commands: { title: "COMMANDS" },
85
+ flags: { title: "FLAGS" },
86
+ "global flags": { title: "GLOBAL FLAGS" },
87
+ arguments: { title: "ARGUMENTS" },
88
+ aliases: { title: "ALIASES" },
89
+ examples: { title: "EXAMPLES" },
90
+ streams: { title: "STREAMS" }
91
+ }
92
+ },
93
+ verbosity: {
94
+ description: "Stackable -V flag maps count to log level. --quiet overrides to warn.",
95
+ flag: "-V",
96
+ levels: {
97
+ "0": "info",
98
+ "1": "debug",
99
+ "2": "trace"
100
+ },
101
+ quiet_override: "warn"
102
+ },
103
+ streams: {
104
+ description: "Per-command named output streams toggled via --stream flag.",
105
+ flag: "--stream",
106
+ label_format: "[{name}]",
107
+ output: "stderr"
108
+ },
109
+ table: {
110
+ 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.",
111
+ render_option: "WithTableStyle",
112
+ tty_only: true,
113
+ row_emphasis_kinds: ["none", "primary", "secondary", "muted"],
114
+ row_emphasis_option: "RowEmphasis",
115
+ border_default: "normal"
116
+ },
117
+ extends: [
118
+ "scope-defaults.json"
119
+ ]
120
+ };
121
+
54
122
  // src/tui/parity.ts
55
- var import_node_fs = require("fs");
56
- var import_node_path = require("path");
57
- var _candidates = [
58
- (0, import_node_path.resolve)(__dirname, "..", "..", "..", "..", "contracts", "parity", "parity.json"),
59
- (0, import_node_path.resolve)(__dirname, "..", "..", "..", "..", "..", "contracts", "parity", "parity.json"),
60
- (0, import_node_path.resolve)(process.cwd(), "contracts", "parity", "parity.json")
61
- ];
62
- var _path = _candidates.find((path) => (0, import_node_fs.existsSync)(path)) ?? _candidates[0];
63
- var parity = JSON.parse((0, import_node_fs.readFileSync)(_path, "utf8"));
123
+ var parity = parity_default;
64
124
 
65
125
  // src/output/registry.ts
66
126
  var Registry = class {
package/dist/tui/index.js CHANGED
@@ -52,16 +52,76 @@ function hexToRgb(hex) {
52
52
  ];
53
53
  }
54
54
 
55
+ // src/tui/parity.json
56
+ var parity_default = {
57
+ $schema: "https://json-schema.org/draft/2020-12/schema",
58
+ $id: "https://hop.top/kit/go/console/tui/parity.json",
59
+ description: "Cross-language TUI parity constants. All language implementations MUST load values from here.",
60
+ status: {
61
+ description: "Prefix symbols for status lines. Mirrors Go's InfoType constants in tui/status.go.",
62
+ symbols: {
63
+ info: "\u2139",
64
+ success: "\u2713",
65
+ error: "\u25CF",
66
+ warn: "\u25B2"
67
+ }
68
+ },
69
+ spinner: {
70
+ description: "Braille dot spinner frames and timing.",
71
+ frames: ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"],
72
+ interval_ms: 80
73
+ },
74
+ anim: {
75
+ description: "Gradient character-scramble animation constants.",
76
+ runes: "0123456789abcdefABCDEF~!@#$%^&*()+=_",
77
+ interval_ms: 100,
78
+ default_width: 10
79
+ },
80
+ help: {
81
+ description: "Root --help layout contract. Fang is canonical; TS and Python mirror it.",
82
+ section_order: ["commands", "flags"],
83
+ sections: {
84
+ usage: { title: "USAGE" },
85
+ commands: { title: "COMMANDS" },
86
+ flags: { title: "FLAGS" },
87
+ "global flags": { title: "GLOBAL FLAGS" },
88
+ arguments: { title: "ARGUMENTS" },
89
+ aliases: { title: "ALIASES" },
90
+ examples: { title: "EXAMPLES" },
91
+ streams: { title: "STREAMS" }
92
+ }
93
+ },
94
+ verbosity: {
95
+ description: "Stackable -V flag maps count to log level. --quiet overrides to warn.",
96
+ flag: "-V",
97
+ levels: {
98
+ "0": "info",
99
+ "1": "debug",
100
+ "2": "trace"
101
+ },
102
+ quiet_override: "warn"
103
+ },
104
+ streams: {
105
+ description: "Per-command named output streams toggled via --stream flag.",
106
+ flag: "--stream",
107
+ label_format: "[{name}]",
108
+ output: "stderr"
109
+ },
110
+ table: {
111
+ 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.",
112
+ render_option: "WithTableStyle",
113
+ tty_only: true,
114
+ row_emphasis_kinds: ["none", "primary", "secondary", "muted"],
115
+ row_emphasis_option: "RowEmphasis",
116
+ border_default: "normal"
117
+ },
118
+ extends: [
119
+ "scope-defaults.json"
120
+ ]
121
+ };
122
+
55
123
  // src/tui/parity.ts
56
- var import_node_fs = require("fs");
57
- var import_node_path = require("path");
58
- var _candidates = [
59
- (0, import_node_path.resolve)(__dirname, "..", "..", "..", "..", "contracts", "parity", "parity.json"),
60
- (0, import_node_path.resolve)(__dirname, "..", "..", "..", "..", "..", "contracts", "parity", "parity.json"),
61
- (0, import_node_path.resolve)(process.cwd(), "contracts", "parity", "parity.json")
62
- ];
63
- var _path = _candidates.find((path) => (0, import_node_fs.existsSync)(path)) ?? _candidates[0];
64
- var parity = JSON.parse((0, import_node_fs.readFileSync)(_path, "utf8"));
124
+ var parity = parity_default;
65
125
 
66
126
  // src/tui/status.ts
67
127
  var _symbols = parity.status.symbols;
package/package.json CHANGED
@@ -1,102 +1,124 @@
1
1
  {
2
2
  "name": "@hop-top/kit",
3
- "version": "0.5.0-alpha.0",
3
+ "version": "0.5.0-alpha.1",
4
4
  "description": "Shared CLI utilities for hop-top tools — TypeScript/CJS edition",
5
5
  "type": "commonjs",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
8
8
  "exports": {
9
9
  ".": {
10
- "require": "./dist/index.js",
11
- "types": "./dist/index.d.ts"
10
+ "types": "./dist/index.d.ts",
11
+ "require": "./dist/index.js"
12
12
  },
13
13
  "./cli": {
14
+ "types": "./dist/cli.d.ts",
14
15
  "require": "./dist/cli.js",
15
- "types": "./dist/cli.d.ts"
16
+ "default": "./dist/cli.js"
16
17
  },
17
18
  "./output": {
19
+ "types": "./dist/output.d.ts",
18
20
  "require": "./dist/output.js",
19
- "types": "./dist/output.d.ts"
21
+ "default": "./dist/output.js"
20
22
  },
21
23
  "./xdg": {
24
+ "types": "./dist/xdg.d.ts",
22
25
  "require": "./dist/xdg.js",
23
- "types": "./dist/xdg.d.ts"
26
+ "default": "./dist/xdg.js"
24
27
  },
25
28
  "./config": {
29
+ "types": "./dist/config.d.ts",
26
30
  "require": "./dist/config.js",
27
- "types": "./dist/config.d.ts"
31
+ "default": "./dist/config.js"
28
32
  },
29
33
  "./sqlstore": {
34
+ "types": "./dist/sqlstore.d.ts",
30
35
  "require": "./dist/sqlstore.js",
31
- "types": "./dist/sqlstore.d.ts"
36
+ "default": "./dist/sqlstore.js"
32
37
  },
33
38
  "./upgrade": {
39
+ "types": "./dist/upgrade.d.ts",
34
40
  "require": "./dist/upgrade.js",
35
- "types": "./dist/upgrade.d.ts"
41
+ "default": "./dist/upgrade.js"
36
42
  },
37
43
  "./llm": {
44
+ "types": "./dist/llm.d.ts",
38
45
  "require": "./dist/llm.js",
39
- "types": "./dist/llm.d.ts"
46
+ "default": "./dist/llm.js"
40
47
  },
41
48
  "./routellm": {
49
+ "types": "./dist/routellm.d.ts",
42
50
  "require": "./dist/routellm.js",
43
- "types": "./dist/routellm.d.ts"
51
+ "default": "./dist/routellm.js"
44
52
  },
45
53
  "./alias": {
54
+ "types": "./dist/alias.d.ts",
46
55
  "require": "./dist/alias.js",
47
- "types": "./dist/alias.d.ts"
56
+ "default": "./dist/alias.js"
48
57
  },
49
58
  "./tui": {
59
+ "types": "./dist/tui/index.d.ts",
50
60
  "require": "./dist/tui/index.js",
51
- "types": "./dist/tui/index.d.ts"
61
+ "default": "./dist/tui/index.js"
52
62
  },
53
63
  "./errcorrect": {
64
+ "types": "./dist/errcorrect.d.ts",
54
65
  "require": "./dist/errcorrect.js",
55
- "types": "./dist/errcorrect.d.ts"
66
+ "default": "./dist/errcorrect.js"
56
67
  },
57
68
  "./safety": {
69
+ "types": "./dist/safety.d.ts",
58
70
  "require": "./dist/safety.js",
59
- "types": "./dist/safety.d.ts"
71
+ "default": "./dist/safety.js"
60
72
  },
61
73
  "./provenance": {
74
+ "types": "./dist/provenance.d.ts",
62
75
  "require": "./dist/provenance.js",
63
- "types": "./dist/provenance.d.ts"
76
+ "default": "./dist/provenance.js"
64
77
  },
65
78
  "./stream": {
79
+ "types": "./dist/stream.d.ts",
66
80
  "require": "./dist/stream.js",
67
- "types": "./dist/stream.d.ts"
81
+ "default": "./dist/stream.js"
68
82
  },
69
83
  "./progress": {
84
+ "types": "./dist/progress.d.ts",
70
85
  "require": "./dist/progress.js",
71
- "types": "./dist/progress.d.ts"
86
+ "default": "./dist/progress.js"
72
87
  },
73
88
  "./auth": {
89
+ "types": "./dist/auth.d.ts",
74
90
  "require": "./dist/auth.js",
75
- "types": "./dist/auth.d.ts"
91
+ "default": "./dist/auth.js"
76
92
  },
77
93
  "./api": {
94
+ "types": "./dist/api.d.ts",
78
95
  "require": "./dist/api.js",
79
- "types": "./dist/api.d.ts"
96
+ "default": "./dist/api.js"
80
97
  },
81
98
  "./rpc": {
99
+ "types": "./dist/rpc.d.ts",
82
100
  "require": "./dist/rpc.js",
83
- "types": "./dist/rpc.d.ts"
101
+ "default": "./dist/rpc.js"
84
102
  },
85
103
  "./aim": {
104
+ "types": "./dist/aim.d.ts",
86
105
  "require": "./dist/aim.js",
87
- "types": "./dist/aim.d.ts"
106
+ "default": "./dist/aim.js"
88
107
  },
89
108
  "./scope": {
109
+ "types": "./dist/scope.d.ts",
90
110
  "require": "./dist/scope.js",
91
- "types": "./dist/scope.d.ts"
111
+ "default": "./dist/scope.js"
92
112
  },
93
113
  "./telemetry": {
114
+ "types": "./dist/telemetry/index.d.ts",
94
115
  "require": "./dist/telemetry/index.js",
95
- "types": "./dist/telemetry/index.d.ts"
116
+ "default": "./dist/telemetry/index.js"
96
117
  },
97
118
  "./id": {
119
+ "types": "./dist/id/index.d.ts",
98
120
  "require": "./dist/id/index.js",
99
- "types": "./dist/id/index.d.ts"
121
+ "default": "./dist/id/index.js"
100
122
  }
101
123
  },
102
124
  "dependencies": {
@@ -0,0 +1,74 @@
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
+ }
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Contract-sync tests for tui/parity.
3
+ *
4
+ * - Compare the vendored sdk/ts/src/tui/parity.json against the canonical
5
+ * contracts/parity/parity.json. If they drift, the test fails — keeping
6
+ * the published package self-contained without losing the single source
7
+ * of truth.
8
+ * - Sanity-check the shape the loader exposes.
9
+ */
10
+
11
+ import * as fs from 'fs';
12
+ import * as path from 'path';
13
+ import { describe, expect, it } from 'vitest';
14
+
15
+ import { parity } from './parity.js';
16
+
17
+ // ─── Contract sync ───────────────────────────────────────────────────────────
18
+
19
+ describe('tui parity contract sync', () => {
20
+ it('local parity.json matches contracts/parity/parity.json', () => {
21
+ const local = JSON.parse(
22
+ fs.readFileSync(path.join(__dirname, 'parity.json'), 'utf8'),
23
+ );
24
+ const canonical = JSON.parse(
25
+ fs.readFileSync(
26
+ path.join(__dirname, '..', '..', '..', '..', 'contracts', 'parity', 'parity.json'),
27
+ 'utf8',
28
+ ),
29
+ );
30
+ expect(local).toEqual(canonical);
31
+ });
32
+ });
33
+
34
+ // ─── Loader shape ────────────────────────────────────────────────────────────
35
+
36
+ describe('parity loader', () => {
37
+ it('exposes status symbols', () => {
38
+ expect(parity.status.symbols.success).toBeTruthy();
39
+ expect(parity.status.symbols.error).toBeTruthy();
40
+ });
41
+
42
+ it('exposes spinner frames and interval', () => {
43
+ expect(parity.spinner.frames.length).toBeGreaterThan(0);
44
+ expect(parity.spinner.interval_ms).toBeGreaterThan(0);
45
+ });
46
+
47
+ it('exposes help section order and titles', () => {
48
+ expect(parity.help.section_order.length).toBeGreaterThan(0);
49
+ for (const section of parity.help.section_order) {
50
+ expect(parity.help.sections[section]).toBeDefined();
51
+ }
52
+ });
53
+ });
package/src/tui/parity.ts CHANGED
@@ -2,12 +2,15 @@
2
2
  * @module tui/parity
3
3
  * @package @hop-top/kit
4
4
  *
5
- * Loads tui/parity.json — the cross-language parity constants SoT.
5
+ * Cross-language parity constants SoT. The canonical file lives at
6
+ * `contracts/parity/parity.json`; a vendored copy ships next to this
7
+ * module so the published package is self-contained. A contract-sync
8
+ * test keeps the two in lockstep.
9
+ *
6
10
  * All TUI modules should import constants from here, not hardcode them.
7
11
  */
8
12
 
9
- import { existsSync, readFileSync } from 'node:fs';
10
- import { resolve } from 'node:path';
13
+ import parityRaw from './parity.json';
11
14
 
12
15
  interface ParityData {
13
16
  status: {
@@ -30,12 +33,4 @@ interface ParityData {
30
33
  };
31
34
  }
32
35
 
33
- // Resolve from source, built dist, or current workspace checkout.
34
- const _candidates = [
35
- resolve(__dirname, '..', '..', '..', '..', 'contracts', 'parity', 'parity.json'),
36
- resolve(__dirname, '..', '..', '..', '..', '..', 'contracts', 'parity', 'parity.json'),
37
- resolve(process.cwd(), 'contracts', 'parity', 'parity.json'),
38
- ];
39
- const _path = _candidates.find((path) => existsSync(path)) ?? _candidates[0];
40
-
41
- export const parity: ParityData = JSON.parse(readFileSync(_path, 'utf8'));
36
+ export const parity: ParityData = parityRaw;