@aiwayds/dsh-opentui 0.12.0 → 0.12.2

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
@@ -5,6 +5,21 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.12.2] - 2026-11-13
9
+
10
+ ### Added
11
+
12
+ - **`--version` prints `dsh-opentui <version>` and exits** without booting the TUI or provisioning.
13
+ - **`--force` kills stale host/client instances sharing the current DSH_HOME** (TERM→KILL ladder, prints `--force: killed N stale instance(s)`) before a clean boot.
14
+
15
+ ## [0.12.1] - 2026-11-13
16
+
17
+ ### Fixed
18
+
19
+ - **Confirm dialog buttons are framed on all four sides.** Both actions now carry a full border, and the focused one is filled plus heavy-bordered, so the two choices read as buttons in either state instead of the unfocused one looking like plain text. The exit prompt in `/settings` renames its actions 取消/退出 to 返回/确认退出, and the hint line's Esc verb follows the cancel label (`Esc 返回`).
20
+ - **Wide glyphs (CJK) are no longer lost on panels under an overlay.** Covered layers used to be dimmed by a per-layer translucent scrim, whose alpha background fill rewrites the cells it covers and drops the trailing half of a double-width glyph (opentui 0.8.1) — background panel text came out mangled. Layers below the top are now dimmed through a color projection of the panel theme (new `dim` prop / `dimTheme`), and the scrim is kept only on the bottom layer, where it dims the page behind; dimmed panels keep every grapheme.
21
+ - **`/settings` section counts share one right-aligned column.** The counts used to trail their own labels, so the nav column's right edge moved row to row; they now sit in a fixed column at the list's width edge (new panel-kit `descriptionAlign` prop, `descriptionTone` is color-only again). The header separator also spans the panel's full inner width, so the rule meets both side borders instead of stopping three cells short.
22
+
8
23
  ## [0.10.2] - 2026-11-13
9
24
 
10
25
  ### Changed
@@ -4,6 +4,11 @@
4
4
  * the plugin-mode chain was retired in batch B4).
5
5
  *
6
6
  * Startup chain:
7
+ * 0. Bin-level flags — `--version` prints `dsh-opentui <version>` and
8
+ * exits 0 BEFORE anything else (no provision, no TUI); `--force` kills
9
+ * this profile's stale instances (resident dsh host + bun client, TERM
10
+ * then KILL) before startup continues. Both are consumed by the bin
11
+ * and never forwarded to the client.
7
12
  * 1. bun check — the client bundle runs under bun (FFI, import attributes,
8
13
  * bun export conditions); no bun on PATH → install guidance, exit 1.
9
14
  * 2. dsh check — the host CLI is the session carrier (profile storage,
@@ -47,6 +52,7 @@ import { existsSync, lstatSync, mkdirSync, readFileSync, realpathSync, renameSyn
47
52
  import { homedir } from 'node:os'
48
53
  import { dirname, join } from 'node:path'
49
54
  import { fileURLToPath } from 'node:url'
55
+ import { ancestorPids, killStaleProcesses, parseLauncherArgs, parseProcessHomes, parseProcessRows, readLauncherVersion, selectStaleProcesses } from './lib/launcher.mjs'
50
56
 
51
57
  const pkgRoot = dirname(dirname(fileURLToPath(import.meta.url)))
52
58
  const dshHome = process.env.DSH_HOME || join(homedir(), '.dsh')
@@ -57,6 +63,25 @@ function exitWithGuidance(what, installCmd) {
57
63
  process.exit(1)
58
64
  }
59
65
 
66
+ /** Run a helper command and return its stdout ('' on failure). */
67
+ function capture(cmd, args) {
68
+ const r = spawnSync(cmd, args, { encoding: 'utf8' })
69
+ return r.stdout ?? ''
70
+ }
71
+
72
+ // --- 0. Bin-level flags: --version short-circuits, --force pre-clears -------
73
+ const { version: versionFlag, force: forceFlag, rest: userArgs } = parseLauncherArgs(process.argv.slice(2))
74
+
75
+ if (versionFlag) {
76
+ const version = readLauncherVersion(pkgRoot)
77
+ if (!version) {
78
+ console.error(`dsh-opentui: could not read the version from ${join(pkgRoot, 'package.json')}.`)
79
+ process.exit(1)
80
+ }
81
+ console.log(`dsh-opentui ${version}`)
82
+ process.exit(0)
83
+ }
84
+
60
85
  // --- 1. bun: hard runtime dependency of the client chain -------------------
61
86
  if (!spawnSync('which', ['bun'], { encoding: 'utf8' }).stdout.trim()) {
62
87
  exitWithGuidance('bun', 'npm i -g bun')
@@ -67,13 +92,29 @@ if (!spawnSync('which', ['dsh'], { encoding: 'utf8' }).stdout.trim()) {
67
92
  exitWithGuidance('the dsh CLI', 'npm i -g @deepseek-ai/dsh')
68
93
  }
69
94
 
95
+ // --- 2.5 --force: kill this profile's stale instances before starting ------
96
+ // Matches the opentui-profile host (`node <...>/dsh --profile opentui ...`)
97
+ // and the dsh-opentui client (source entry or published bundle) by command
98
+ // line, scoped to THIS dsh home (see lib/launcher.mjs SCOPE). The launcher's
99
+ // own process tree is excluded; TERM first, then KILL for survivors.
100
+ if (forceFlag) {
101
+ const rows = parseProcessRows(capture('ps', ['-A', '-o', 'pid=,ppid=,command=']))
102
+ const homes = parseProcessHomes(capture('ps', ['eww', '-A', '-o', 'pid=,args=']))
103
+ const stale = selectStaleProcesses(rows, {
104
+ homes,
105
+ home: dshHome,
106
+ excludePids: ancestorPids(rows, process.pid),
107
+ })
108
+ const result = await killStaleProcesses(stale)
109
+ console.log(`--force: killed ${result.terminated} stale instance(s)`)
110
+ }
111
+
70
112
  // --- 3. Profile bootstrap (every start, best effort, idempotent) -----------
71
113
  // provision-opentui-profile.mjs is idempotent and understands
72
114
  // --provider/--model/--reasoning-effort --plugins/--dry-run; forward those,
73
115
  // ignore the rest. With nothing to do this is a local, sub-second pass.
74
116
  const opentuiProfileDir = join(dshHome, 'profiles', 'opentui')
75
117
  {
76
- const userArgs = process.argv.slice(2)
77
118
  const provisionFlags = []
78
119
  for (const name of ['provider', 'model', 'reasoning-effort']) {
79
120
  const i = userArgs.indexOf(`--${name}`)
@@ -265,7 +306,7 @@ if (!existsSync(clientEntry)) {
265
306
  console.error('dsh-opentui: reinstall the package (npm i -g @aiwayds/dsh-opentui), or rebuild it with `bun scripts/build-client.mjs` from the repo.')
266
307
  process.exit(1)
267
308
  }
268
- const result = spawnSync('bun', [clientEntry, ...process.argv.slice(2)], {
309
+ const result = spawnSync('bun', [clientEntry, ...userArgs], {
269
310
  stdio: 'inherit',
270
311
  })
271
312
  if (result.error) {
@@ -0,0 +1,283 @@
1
+ /**
2
+ * Launcher support for bin/dsh-opentui.mjs — the pure parts behind the
3
+ * `--version` / `--force` flags.
4
+ *
5
+ * WHY A SEPARATE MODULE: the bin is a top-level script (importing it would
6
+ * RUN it — provision, spawn, exit). Everything here is a pure function over
7
+ * plain data so the flags can be unit-tested without a dsh, a profile or a
8
+ * running client. The bin stays the only thing that touches the process.
9
+ *
10
+ * The two capabilities:
11
+ * 1. `--version` — print `dsh-opentui <version>` and exit 0, BEFORE any
12
+ * provision/profile work (see the bin's step 0).
13
+ * 2. `--force` — kill this profile's stale instances (the resident `dsh
14
+ * host and the bun client) before starting.
15
+ *
16
+ * SCOPE (requirement: never touch another profile's instances):
17
+ * a candidate is "ours" only when BOTH hold:
18
+ * - the command line is the host/client shape of the `opentui` profile
19
+ * (`node <...>/dsh --profile opentui ...` for the host; a bun process
20
+ * running the client entry for the client). A `dsh plugin --profile
21
+ * opentui add ...` provision child is NOT a host and never matches.
22
+ * - the process resolves to the SAME dsh home as this launcher (DSH_HOME
23
+ * from the process environment, defaulting to ~/.dsh). The profile
24
+ * instance is identified by (dsh home, profile) — the same key the
25
+ * host lockfile uses — so a parallel session running the same profile
26
+ * under a DIFFERENT DSH_HOME is a different instance and is left alone.
27
+ * NOTE: the DSH_HOME read is a ps-environment lookup, not command-line
28
+ * matching — if it is deemed over-engineered it can be dropped by
29
+ * removing the `theirs !== mine` comparison in selectStaleProcesses
30
+ * (kill selection then degrades to pure command-line matching).
31
+ */
32
+ import { readFileSync, realpathSync } from 'node:fs'
33
+ import { homedir } from 'node:os'
34
+ import { basename, join, resolve } from 'node:path'
35
+
36
+ /** The one product profile (ADR-0005 decision 3). */
37
+ export const PROFILE = 'opentui'
38
+
39
+ /** The default dsh home when DSH_HOME is unset (mirrors lifecycle.ts). */
40
+ export function defaultDshHome() {
41
+ return join(homedir(), '.dsh')
42
+ }
43
+
44
+ /**
45
+ * Split the launcher's argv into the flags the bin consumes itself and the
46
+ * arguments forwarded to the client bundle.
47
+ *
48
+ * `--version` and `--force` are BIN-level flags: they are consumed here and
49
+ * NOT forwarded (the client must never see `--force`).
50
+ */
51
+ export function parseLauncherArgs(argv) {
52
+ const args = Array.isArray(argv) ? argv : []
53
+ let version = false
54
+ let force = false
55
+ const rest = []
56
+ for (const arg of args) {
57
+ if (arg === '--version') {
58
+ version = true
59
+ continue
60
+ }
61
+ if (arg === '--force') {
62
+ force = true
63
+ continue
64
+ }
65
+ rest.push(arg)
66
+ }
67
+ return { version, force, rest }
68
+ }
69
+
70
+ /**
71
+ * The launcher's own version — read from its own package.json (the package
72
+ * root is the bin's grandparent directory). Returns undefined when the
73
+ * manifest is missing/unreadable so the caller can report it instead of
74
+ * printing a lie.
75
+ */
76
+ export function readLauncherVersion(pkgRoot) {
77
+ try {
78
+ const parsed = JSON.parse(readFileSync(join(pkgRoot, 'package.json'), 'utf8'))
79
+ return typeof parsed?.version === 'string' && parsed.version ? parsed.version : undefined
80
+ } catch {
81
+ return undefined
82
+ }
83
+ }
84
+
85
+ /**
86
+ * Parse `ps -A -o pid=,ppid=,command=` output into process rows.
87
+ *
88
+ * @returns [{ pid, ppid, command }]
89
+ */
90
+ export function parseProcessRows(psOutput) {
91
+ const rows = []
92
+ for (const line of String(psOutput ?? '').split('\n')) {
93
+ const match = /^\s*(\d+)\s+(\d+)\s+(.*)$/.exec(line)
94
+ if (!match) continue
95
+ rows.push({ pid: Number(match[1]), ppid: Number(match[2]), command: match[3] })
96
+ }
97
+ return rows
98
+ }
99
+
100
+ /**
101
+ * Parse `ps eww -A -o pid=,args=` output into a pid → DSH_HOME map.
102
+ *
103
+ * The environment is appended AFTER the command line, so the LAST
104
+ * `DSH_HOME=` token on the line is the environment's own copy (a command
105
+ * line that mentions DSH_HOME= itself therefore still resolves correctly).
106
+ * A pid without DSH_HOME in its environment uses the default home.
107
+ */
108
+ export function parseProcessHomes(psEwwOutput) {
109
+ const homes = new Map()
110
+ for (const line of String(psEwwOutput ?? '').split('\n')) {
111
+ const trimmed = line.trim()
112
+ if (!trimmed) continue
113
+ const pid = Number(trimmed.split(/\s+/)[0])
114
+ if (!Number.isInteger(pid) || pid <= 0) continue
115
+ const tokens = trimmed.split(/\s+/)
116
+ let home
117
+ for (let i = tokens.length - 1; i >= 1; i--) {
118
+ if (tokens[i].startsWith('DSH_HOME=')) {
119
+ home = tokens[i].slice('DSH_HOME='.length)
120
+ break
121
+ }
122
+ }
123
+ homes.set(pid, home)
124
+ }
125
+ return homes
126
+ }
127
+
128
+ /**
129
+ * Classify a process command line.
130
+ *
131
+ * @returns 'host' | 'client' | null
132
+ * host — the resident dsh host of the opentui profile
133
+ * client — a dsh-opentui client process (source tree entry or the
134
+ * published bundle)
135
+ * null — anything else (the shell/tmux wrapper, a `dsh plugin ...`
136
+ * provision run, a grep over these paths, another profile).
137
+ */
138
+ export function classifyProcess(command) {
139
+ const tokens = String(command ?? '')
140
+ .split(/\s+/)
141
+ .filter(Boolean)
142
+ if (tokens.length === 0) return null
143
+
144
+ const exe = basename(tokens[0])
145
+ // Only a real runtime may be the process itself — a shell that merely
146
+ // mentions these paths (`sh -c "dsh --profile opentui"`, a tmux command
147
+ // line) is NOT the host.
148
+ if (exe !== 'node' && exe !== 'bun' && exe !== 'dsh') return null
149
+
150
+ // The host: the dsh binary IS the process or sits right after the
151
+ // runtime (node/bun + script), and is followed by `--profile opentui`.
152
+ // Only the first two tokens may be the dsh binary — a wrapper script
153
+ // (`node wrapper.js dsh --profile opentui`) merely MENTIONS it.
154
+ for (let i = 0; i < Math.min(tokens.length, 2); i++) {
155
+ if (basename(tokens[i]) !== 'dsh') continue
156
+ const next = tokens[i + 1]
157
+ if (next === '--profile' && tokens[i + 2] === PROFILE) return 'host'
158
+ if (next === `--profile=${PROFILE}`) return 'host'
159
+ // `dsh plugin --profile opentui add ...` (provision) and
160
+ // `dsh opentui --dump-config` are not the host.
161
+ return null
162
+ }
163
+
164
+ // The client: the published bundle (`dist/client/index.js`) or the
165
+ // source-tree entry (`client-entry.tsx`).
166
+ for (const token of tokens) {
167
+ if (token.endsWith('client-entry.tsx')) return 'client'
168
+ if (token.endsWith('dist/client/index.js')) return 'client'
169
+ }
170
+ return null
171
+ }
172
+
173
+ /** Normalize a home path for comparison (absolute, symlinks resolved when
174
+ * the path exists — macOS maps /tmp to /private/tmp). */
175
+ export function normalizeHome(path) {
176
+ if (!path) return undefined
177
+ let out = resolve(path)
178
+ try {
179
+ out = realpathSync(out)
180
+ } catch {
181
+ /* not present on disk — the resolved path is what we compare */
182
+ }
183
+ return out
184
+ }
185
+
186
+ /**
187
+ * Pick the stale instances that belong to THIS profile instance.
188
+ *
189
+ * @param rows [{ pid, ppid, command }]
190
+ * @param homes pid → DSH_HOME (from `ps eww`)
191
+ * @param home the launcher's own dsh home
192
+ * @param excludePids pids that must never be killed (this process, its
193
+ * ancestors) — killing the launcher would kill the kill.
194
+ */
195
+ export function selectStaleProcesses(rows, { homes = new Map(), home, excludePids = [] } = {}) {
196
+ const excluded = new Set(excludePids.filter((pid) => typeof pid === 'number'))
197
+ const mine = normalizeHome(home || defaultDshHome())
198
+ const stale = []
199
+ for (const row of rows ?? []) {
200
+ if (!row || typeof row.pid !== 'number') continue
201
+ if (excluded.has(row.pid)) continue
202
+ const kind = classifyProcess(row.command)
203
+ if (!kind) continue
204
+ const theirs = normalizeHome(homes.get(row.pid) || defaultDshHome())
205
+ if (theirs !== mine) continue
206
+ stale.push({ pid: row.pid, kind })
207
+ }
208
+ return stale
209
+ }
210
+
211
+ /** The pids of this process and its ancestors — never kill targets. */
212
+ export function ancestorPids(rows, selfPid) {
213
+ const byPid = new Map((rows ?? []).map((row) => [row.pid, row.ppid]))
214
+ const chain = []
215
+ let pid = selfPid
216
+ for (let i = 0; i < 64 && typeof pid === 'number' && pid > 0; i++) {
217
+ chain.push(pid)
218
+ const parent = byPid.get(pid)
219
+ if (parent === undefined || parent === pid) break
220
+ pid = parent
221
+ }
222
+ return chain
223
+ }
224
+
225
+ /**
226
+ * TERM every target, wait for the grace window, then KILL the survivors.
227
+ * The injected `kill`/`sleep`/`isAlive` keep this testable without signals.
228
+ */
229
+ export async function killStaleProcesses(targets, options = {}) {
230
+ const {
231
+ kill = (pid, signal) => process.kill(pid, signal),
232
+ sleep = (ms) => new Promise((r) => setTimeout(r, ms)),
233
+ isAlive = (pid) => {
234
+ try {
235
+ process.kill(pid, 0)
236
+ return true
237
+ } catch {
238
+ return false
239
+ }
240
+ },
241
+ termWaitMs = 2000,
242
+ killWaitMs = 500,
243
+ pollMs = 50,
244
+ } = options
245
+
246
+ const pids = (targets ?? []).map((t) => t.pid)
247
+ if (pids.length === 0) return { terminated: 0, killed: 0, survivors: [] }
248
+
249
+ for (const pid of pids) {
250
+ try {
251
+ kill(pid, 'SIGTERM')
252
+ } catch {
253
+ /* already gone */
254
+ }
255
+ }
256
+
257
+ const termDeadline = Date.now() + termWaitMs
258
+ while (Date.now() < termDeadline) {
259
+ if (pids.every((pid) => !isAlive(pid))) break
260
+ await sleep(pollMs)
261
+ }
262
+
263
+ const survivors = pids.filter((pid) => isAlive(pid))
264
+ for (const pid of survivors) {
265
+ try {
266
+ kill(pid, 'SIGKILL')
267
+ } catch {
268
+ /* already gone */
269
+ }
270
+ }
271
+ if (survivors.length > 0) {
272
+ const killDeadline = Date.now() + killWaitMs
273
+ while (Date.now() < killDeadline) {
274
+ if (survivors.every((pid) => !isAlive(pid))) break
275
+ await sleep(pollMs)
276
+ }
277
+ }
278
+ return {
279
+ terminated: pids.length,
280
+ killed: survivors.length,
281
+ survivors: survivors.filter((pid) => isAlive(pid)),
282
+ }
283
+ }
@@ -51329,6 +51329,49 @@ function fadeTheme(theme, t) {
51329
51329
  identity: [mix(theme.identity[0]), mix(theme.identity[1])]
51330
51330
  };
51331
51331
  }
51332
+ function dimTheme(theme, factor) {
51333
+ const level = clamp012(factor);
51334
+ if (level >= 1)
51335
+ return theme;
51336
+ const dim = (color) => RGBA14.fromValues(color.r * level, color.g * level, color.b * level, color.a);
51337
+ const border = (token) => ({
51338
+ style: token.style,
51339
+ color: dim(token.color)
51340
+ });
51341
+ return {
51342
+ background: {
51343
+ surface: dim(theme.background.surface),
51344
+ raised: dim(theme.background.raised),
51345
+ content: dim(theme.background.content),
51346
+ scrim: dim(theme.background.scrim)
51347
+ },
51348
+ text: {
51349
+ base: dim(theme.text.base),
51350
+ muted: dim(theme.text.muted),
51351
+ faint: dim(theme.text.faint),
51352
+ accent: dim(theme.text.accent),
51353
+ disabled: dim(theme.text.disabled),
51354
+ danger: dim(theme.text.danger),
51355
+ warning: dim(theme.text.warning),
51356
+ success: dim(theme.text.success),
51357
+ code: dim(theme.text.code),
51358
+ user: dim(theme.text.user),
51359
+ system: dim(theme.text.system),
51360
+ heading: dim(theme.text.heading)
51361
+ },
51362
+ row: {
51363
+ activeBg: dim(theme.row.activeBg),
51364
+ activeFg: dim(theme.row.activeFg)
51365
+ },
51366
+ border: {
51367
+ base: border(theme.border.base),
51368
+ focused: border(theme.border.focused),
51369
+ warning: border(theme.border.warning)
51370
+ },
51371
+ attributes: theme.attributes,
51372
+ identity: [dim(theme.identity[0]), dim(theme.identity[1])]
51373
+ };
51374
+ }
51332
51375
  var PanelKitContext, PanelKeyRoutingContext, STATIC_MOTION, MIN_CONTRAST = 4.5;
51333
51376
  var init_theme4 = __esm(() => {
51334
51377
  init_server();
@@ -51625,7 +51668,7 @@ function Panel(props) {
51625
51668
  return props.fadeIn === false ? 1 : driver.progress();
51626
51669
  return current === "closed" ? 0 : 1;
51627
51670
  };
51628
- const theme = createMemo(() => fadeTheme(baseTheme(), fadeProgress()));
51671
+ const theme = createMemo(() => dimTheme(fadeTheme(baseTheme(), fadeProgress()), props.dim ?? 1));
51629
51672
  let pending = false;
51630
51673
  async function requestClose() {
51631
51674
  const current = phase();
@@ -51706,52 +51749,80 @@ function Panel(props) {
51706
51749
  const frameToken = () => resolveFrameToken(theme(), props.tone, props.border);
51707
51750
  const titleTint = () => resolveTitleColor(theme(), props.tone);
51708
51751
  const header = () => {
51709
- if (props.header)
51710
- return props.header;
51752
+ if (props.header) {
51753
+ return (() => {
51754
+ var _el$ = createElement("box");
51755
+ setProp(_el$, "flexDirection", "column");
51756
+ setProp(_el$, "flexShrink", 0);
51757
+ insert(_el$, () => props.header);
51758
+ effect((_p$) => {
51759
+ var _v$ = inset(), _v$2 = inset();
51760
+ _v$ !== _p$.e && (_p$.e = setProp(_el$, "paddingLeft", _v$, _p$.e));
51761
+ _v$2 !== _p$.t && (_p$.t = setProp(_el$, "paddingRight", _v$2, _p$.t));
51762
+ return _p$;
51763
+ }, {
51764
+ e: undefined,
51765
+ t: undefined
51766
+ });
51767
+ return _el$;
51768
+ })();
51769
+ }
51711
51770
  const width = Math.max(1, innerWidth() - inset() * 2);
51712
51771
  const layered = props.layered === true;
51713
51772
  return (() => {
51714
- var _el$ = createElement("box"), _el$2 = createElement("box"), _el$3 = createElement("text"), _el$4 = createElement("text");
51715
- insertNode(_el$, _el$2);
51716
- setProp(_el$, "flexDirection", "column");
51717
- setProp(_el$, "flexShrink", 0);
51773
+ var _el$2 = createElement("box"), _el$3 = createElement("box"), _el$4 = createElement("box"), _el$5 = createElement("text"), _el$6 = createElement("text");
51718
51774
  insertNode(_el$2, _el$3);
51719
- insertNode(_el$2, _el$4);
51720
- setProp(_el$2, "flexDirection", "row");
51721
- setProp(_el$2, "justifyContent", "space-between");
51775
+ setProp(_el$2, "flexDirection", "column");
51722
51776
  setProp(_el$2, "flexShrink", 0);
51723
- setProp(_el$2, "border", layered ? ["bottom"] : undefined);
51724
- setProp(_el$2, "borderStyle", "single");
51725
- insert(_el$3, () => truncate2(props.title, Math.max(1, width - 4)));
51726
- insertNode(_el$4, createTextNode(`esc`));
51727
- insert(_el$, createComponent2(Show, {
51777
+ insertNode(_el$3, _el$4);
51778
+ setProp(_el$3, "flexDirection", "column");
51779
+ setProp(_el$3, "flexShrink", 0);
51780
+ setProp(_el$3, "border", layered ? ["bottom"] : undefined);
51781
+ setProp(_el$3, "borderStyle", "single");
51782
+ insertNode(_el$4, _el$5);
51783
+ insertNode(_el$4, _el$6);
51784
+ setProp(_el$4, "flexDirection", "row");
51785
+ setProp(_el$4, "justifyContent", "space-between");
51786
+ setProp(_el$4, "flexShrink", 0);
51787
+ insert(_el$5, () => truncate2(props.title, Math.max(1, width - 4)));
51788
+ insertNode(_el$6, createTextNode(`esc`));
51789
+ insert(_el$2, createComponent2(Show, {
51728
51790
  get when() {
51729
51791
  return props.subtitle;
51730
51792
  },
51731
51793
  get children() {
51732
- var _el$6 = createElement("text");
51733
- setProp(_el$6, "wrapMode", "none");
51734
- insert(_el$6, () => truncate2(props.subtitle ?? "", width));
51794
+ var _el$8 = createElement("box"), _el$9 = createElement("text");
51795
+ insertNode(_el$8, _el$9);
51796
+ setProp(_el$8, "flexDirection", "column");
51797
+ setProp(_el$8, "flexShrink", 0);
51798
+ setProp(_el$9, "wrapMode", "none");
51799
+ insert(_el$9, () => truncate2(props.subtitle ?? "", width));
51735
51800
  effect((_p$) => {
51736
- var _v$ = theme().text.muted, _v$2 = theme().attributes.subtitle;
51737
- _v$ !== _p$.e && (_p$.e = setProp(_el$6, "fg", _v$, _p$.e));
51738
- _v$2 !== _p$.t && (_p$.t = setProp(_el$6, "attributes", _v$2, _p$.t));
51801
+ var _v$3 = inset(), _v$4 = inset(), _v$5 = theme().text.muted, _v$6 = theme().attributes.subtitle;
51802
+ _v$3 !== _p$.e && (_p$.e = setProp(_el$8, "paddingLeft", _v$3, _p$.e));
51803
+ _v$4 !== _p$.t && (_p$.t = setProp(_el$8, "paddingRight", _v$4, _p$.t));
51804
+ _v$5 !== _p$.a && (_p$.a = setProp(_el$9, "fg", _v$5, _p$.a));
51805
+ _v$6 !== _p$.o && (_p$.o = setProp(_el$9, "attributes", _v$6, _p$.o));
51739
51806
  return _p$;
51740
51807
  }, {
51741
51808
  e: undefined,
51742
- t: undefined
51809
+ t: undefined,
51810
+ a: undefined,
51811
+ o: undefined
51743
51812
  });
51744
- return _el$6;
51813
+ return _el$8;
51745
51814
  }
51746
51815
  }), null);
51747
51816
  effect((_p$) => {
51748
- var _v$3 = layered ? resolvePanelChrome(theme()).titleBand : undefined, _v$4 = resolvePanelChrome(theme()).divider, _v$5 = titleTint(), _v$6 = theme().attributes.title, _v$7 = theme().text.muted, _v$8 = theme().attributes.keyHint;
51749
- _v$3 !== _p$.e && (_p$.e = setProp(_el$, "backgroundColor", _v$3, _p$.e));
51750
- _v$4 !== _p$.t && (_p$.t = setProp(_el$2, "borderColor", _v$4, _p$.t));
51751
- _v$5 !== _p$.a && (_p$.a = setProp(_el$3, "fg", _v$5, _p$.a));
51752
- _v$6 !== _p$.o && (_p$.o = setProp(_el$3, "attributes", _v$6, _p$.o));
51753
- _v$7 !== _p$.i && (_p$.i = setProp(_el$4, "fg", _v$7, _p$.i));
51754
- _v$8 !== _p$.n && (_p$.n = setProp(_el$4, "attributes", _v$8, _p$.n));
51817
+ var _v$7 = layered ? resolvePanelChrome(theme()).titleBand : undefined, _v$8 = resolvePanelChrome(theme()).divider, _v$9 = inset(), _v$0 = inset(), _v$1 = titleTint(), _v$10 = theme().attributes.title, _v$11 = theme().text.muted, _v$12 = theme().attributes.keyHint;
51818
+ _v$7 !== _p$.e && (_p$.e = setProp(_el$2, "backgroundColor", _v$7, _p$.e));
51819
+ _v$8 !== _p$.t && (_p$.t = setProp(_el$3, "borderColor", _v$8, _p$.t));
51820
+ _v$9 !== _p$.a && (_p$.a = setProp(_el$4, "paddingLeft", _v$9, _p$.a));
51821
+ _v$0 !== _p$.o && (_p$.o = setProp(_el$4, "paddingRight", _v$0, _p$.o));
51822
+ _v$1 !== _p$.i && (_p$.i = setProp(_el$5, "fg", _v$1, _p$.i));
51823
+ _v$10 !== _p$.n && (_p$.n = setProp(_el$5, "attributes", _v$10, _p$.n));
51824
+ _v$11 !== _p$.s && (_p$.s = setProp(_el$6, "fg", _v$11, _p$.s));
51825
+ _v$12 !== _p$.h && (_p$.h = setProp(_el$6, "attributes", _v$12, _p$.h));
51755
51826
  return _p$;
51756
51827
  }, {
51757
51828
  e: undefined,
@@ -51759,9 +51830,11 @@ function Panel(props) {
51759
51830
  a: undefined,
51760
51831
  o: undefined,
51761
51832
  i: undefined,
51762
- n: undefined
51833
+ n: undefined,
51834
+ s: undefined,
51835
+ h: undefined
51763
51836
  });
51764
- return _el$;
51837
+ return _el$2;
51765
51838
  })();
51766
51839
  };
51767
51840
  const scrimColor = () => resolveScrimColor(baseTheme(), props.scrimAlpha ?? resolveScrimAlpha(baseTheme().background.scrim.toInts()[3], props.depth ?? 0));
@@ -51773,26 +51846,26 @@ function Panel(props) {
51773
51846
  return createComponent2(PanelKeyRoutingContext.Provider, {
51774
51847
  value: router,
51775
51848
  get children() {
51776
- var _el$7 = createElement("box"), _el$8 = createElement("box"), _el$9 = createElement("box"), _el$0 = createElement("box");
51777
- insertNode(_el$7, _el$8);
51778
- setProp(_el$7, "position", "absolute");
51779
- setProp(_el$7, "left", 0);
51780
- setProp(_el$7, "top", 0);
51781
- setProp(_el$7, "alignItems", "center");
51782
- insertNode(_el$8, _el$9);
51783
- setProp(_el$8, "flexShrink", 0);
51784
- setProp(_el$8, "border", ["top", "bottom", "left", "right"]);
51785
- setProp(_el$8, "paddingTop", 1);
51786
- insertNode(_el$9, _el$0);
51787
- setProp(_el$9, "flexDirection", "column");
51788
- setProp(_el$9, "flexGrow", 1);
51789
- setProp(_el$9, "flexShrink", 1);
51790
- setProp(_el$9, "paddingBottom", 1);
51791
- insert(_el$9, header, _el$0);
51792
- setProp(_el$0, "flexDirection", "column");
51793
- setProp(_el$0, "flexGrow", 1);
51794
- setProp(_el$0, "flexShrink", 1);
51795
- insert(_el$0, createComponent2(PanelKitContext.Provider, {
51849
+ var _el$0 = createElement("box"), _el$1 = createElement("box"), _el$10 = createElement("box"), _el$11 = createElement("box");
51850
+ insertNode(_el$0, _el$1);
51851
+ setProp(_el$0, "position", "absolute");
51852
+ setProp(_el$0, "left", 0);
51853
+ setProp(_el$0, "top", 0);
51854
+ setProp(_el$0, "alignItems", "center");
51855
+ insertNode(_el$1, _el$10);
51856
+ setProp(_el$1, "flexShrink", 0);
51857
+ setProp(_el$1, "border", ["top", "bottom", "left", "right"]);
51858
+ setProp(_el$1, "paddingTop", 1);
51859
+ insertNode(_el$10, _el$11);
51860
+ setProp(_el$10, "flexDirection", "column");
51861
+ setProp(_el$10, "flexGrow", 1);
51862
+ setProp(_el$10, "flexShrink", 1);
51863
+ setProp(_el$10, "paddingBottom", 1);
51864
+ insert(_el$10, header, _el$11);
51865
+ setProp(_el$11, "flexDirection", "column");
51866
+ setProp(_el$11, "flexGrow", 1);
51867
+ setProp(_el$11, "flexShrink", 1);
51868
+ insert(_el$11, createComponent2(PanelKitContext.Provider, {
51796
51869
  get value() {
51797
51870
  return {
51798
51871
  theme,
@@ -51805,22 +51878,22 @@ function Panel(props) {
51805
51878
  }
51806
51879
  }));
51807
51880
  effect((_p$) => {
51808
- var _v$9 = dimensions().width, _v$0 = dimensions().height, _v$1 = 3000 + (props.depth ?? 0), _v$10 = props.align === "top" ? undefined : "center", _v$11 = props.align === "top" ? Math.floor(dimensions().height / 4) : 0, _v$12 = props.scrim === false ? undefined : scrimColor(), _v$13 = frameWidth(), _v$14 = frameHeight(), _v$15 = Math.max(1, dimensions().width - 2), _v$16 = heightLimit(), _v$17 = theme().background.surface, _v$18 = frameToken().style, _v$19 = frameToken().color, _v$20 = inset(), _v$21 = inset();
51809
- _v$9 !== _p$.e && (_p$.e = setProp(_el$7, "width", _v$9, _p$.e));
51810
- _v$0 !== _p$.t && (_p$.t = setProp(_el$7, "height", _v$0, _p$.t));
51811
- _v$1 !== _p$.a && (_p$.a = setProp(_el$7, "zIndex", _v$1, _p$.a));
51812
- _v$10 !== _p$.o && (_p$.o = setProp(_el$7, "justifyContent", _v$10, _p$.o));
51813
- _v$11 !== _p$.i && (_p$.i = setProp(_el$7, "paddingTop", _v$11, _p$.i));
51814
- _v$12 !== _p$.n && (_p$.n = setProp(_el$7, "backgroundColor", _v$12, _p$.n));
51815
- _v$13 !== _p$.s && (_p$.s = setProp(_el$8, "width", _v$13, _p$.s));
51816
- _v$14 !== _p$.h && (_p$.h = setProp(_el$8, "height", _v$14, _p$.h));
51817
- _v$15 !== _p$.r && (_p$.r = setProp(_el$8, "maxWidth", _v$15, _p$.r));
51818
- _v$16 !== _p$.d && (_p$.d = setProp(_el$8, "maxHeight", _v$16, _p$.d));
51819
- _v$17 !== _p$.l && (_p$.l = setProp(_el$8, "backgroundColor", _v$17, _p$.l));
51820
- _v$18 !== _p$.u && (_p$.u = setProp(_el$8, "borderStyle", _v$18, _p$.u));
51821
- _v$19 !== _p$.c && (_p$.c = setProp(_el$8, "borderColor", _v$19, _p$.c));
51822
- _v$20 !== _p$.w && (_p$.w = setProp(_el$9, "paddingLeft", _v$20, _p$.w));
51823
- _v$21 !== _p$.m && (_p$.m = setProp(_el$9, "paddingRight", _v$21, _p$.m));
51881
+ var _v$13 = dimensions().width, _v$14 = dimensions().height, _v$15 = 3000 + (props.depth ?? 0), _v$16 = props.align === "top" ? undefined : "center", _v$17 = props.align === "top" ? Math.floor(dimensions().height / 4) : 0, _v$18 = props.scrim === false ? undefined : scrimColor(), _v$19 = frameWidth(), _v$20 = frameHeight(), _v$21 = Math.max(1, dimensions().width - 2), _v$22 = heightLimit(), _v$23 = theme().background.surface, _v$24 = frameToken().style, _v$25 = frameToken().color, _v$26 = inset(), _v$27 = inset();
51882
+ _v$13 !== _p$.e && (_p$.e = setProp(_el$0, "width", _v$13, _p$.e));
51883
+ _v$14 !== _p$.t && (_p$.t = setProp(_el$0, "height", _v$14, _p$.t));
51884
+ _v$15 !== _p$.a && (_p$.a = setProp(_el$0, "zIndex", _v$15, _p$.a));
51885
+ _v$16 !== _p$.o && (_p$.o = setProp(_el$0, "justifyContent", _v$16, _p$.o));
51886
+ _v$17 !== _p$.i && (_p$.i = setProp(_el$0, "paddingTop", _v$17, _p$.i));
51887
+ _v$18 !== _p$.n && (_p$.n = setProp(_el$0, "backgroundColor", _v$18, _p$.n));
51888
+ _v$19 !== _p$.s && (_p$.s = setProp(_el$1, "width", _v$19, _p$.s));
51889
+ _v$20 !== _p$.h && (_p$.h = setProp(_el$1, "height", _v$20, _p$.h));
51890
+ _v$21 !== _p$.r && (_p$.r = setProp(_el$1, "maxWidth", _v$21, _p$.r));
51891
+ _v$22 !== _p$.d && (_p$.d = setProp(_el$1, "maxHeight", _v$22, _p$.d));
51892
+ _v$23 !== _p$.l && (_p$.l = setProp(_el$1, "backgroundColor", _v$23, _p$.l));
51893
+ _v$24 !== _p$.u && (_p$.u = setProp(_el$1, "borderStyle", _v$24, _p$.u));
51894
+ _v$25 !== _p$.c && (_p$.c = setProp(_el$1, "borderColor", _v$25, _p$.c));
51895
+ _v$26 !== _p$.w && (_p$.w = setProp(_el$11, "paddingLeft", _v$26, _p$.w));
51896
+ _v$27 !== _p$.m && (_p$.m = setProp(_el$11, "paddingRight", _v$27, _p$.m));
51824
51897
  return _p$;
51825
51898
  }, {
51826
51899
  e: undefined,
@@ -51839,7 +51912,7 @@ function Panel(props) {
51839
51912
  w: undefined,
51840
51913
  m: undefined
51841
51914
  });
51842
- return _el$7;
51915
+ return _el$0;
51843
51916
  }
51844
51917
  });
51845
51918
  }
@@ -52504,6 +52577,15 @@ function ListRowView(props) {
52504
52577
  const labelBudget = props.width === undefined ? undefined : props.width - prefixCells - suffixCells;
52505
52578
  const hasColumns = props.columns !== undefined && props.columns.length > 0;
52506
52579
  const label = hasColumns ? "" : labelBudget === undefined ? item.label : truncateCells(item.label, labelBudget, "tail");
52580
+ const descriptionRightAligned = () => item.description !== undefined && item.descriptionAlign === "right" && !hasColumns && props.width !== undefined && props.width > 0;
52581
+ const descriptionGap = () => {
52582
+ if (item.description === undefined)
52583
+ return "";
52584
+ if (!descriptionRightAligned())
52585
+ return " ";
52586
+ const used = prefixCells + stringWidth2(label) + stringWidth2(item.description);
52587
+ return " ".repeat(Math.max(1, (props.width ?? 0) - used));
52588
+ };
52507
52589
  const columnText = () => {
52508
52590
  if (!hasColumns)
52509
52591
  return "";
@@ -52560,7 +52642,7 @@ function ListRowView(props) {
52560
52642
  },
52561
52643
  get children() {
52562
52644
  var _el$15 = createElement("text");
52563
- insert(_el$15, () => " " + item.description);
52645
+ insert(_el$15, () => descriptionGap() + (item.description ?? ""));
52564
52646
  effect((_$p) => setProp(_el$15, "fg", disabled ? theme().text.disabled : active() ? theme().row.activeFg : descriptionColor(theme(), item.descriptionTone), _$p));
52565
52647
  return _el$15;
52566
52648
  }
@@ -52945,11 +53027,11 @@ function ConfirmDialog(props) {
52945
53027
  insert(_el$, (() => {
52946
53028
  var _c$ = memo2(() => typeof props.message === "string");
52947
53029
  return () => _c$() ? (() => {
52948
- var _el$6 = createElement("text");
52949
- setProp(_el$6, "wrapMode", "word");
52950
- insert(_el$6, () => props.message);
52951
- effect((_$p) => setProp(_el$6, "fg", messageTone(), _$p));
52952
- return _el$6;
53030
+ var _el$5 = createElement("text");
53031
+ setProp(_el$5, "wrapMode", "word");
53032
+ insert(_el$5, () => props.message);
53033
+ effect((_$p) => setProp(_el$5, "fg", messageTone(), _$p));
53034
+ return _el$5;
52953
53035
  })() : props.message;
52954
53036
  })(), _el$2);
52955
53037
  setProp(_el$2, "flexDirection", "row");
@@ -52969,8 +53051,8 @@ function ConfirmDialog(props) {
52969
53051
  setProp(_el$3, "flexDirection", "row");
52970
53052
  setProp(_el$3, "justifyContent", "flex-end");
52971
53053
  setProp(_el$3, "flexShrink", 0);
52972
- insertNode(_el$4, createTextNode(`\u2190\u2192 \u9009\u62E9 \xB7 Enter \u786E\u8BA4 \xB7 Esc \u53D6\u6D88`));
52973
53054
  setProp(_el$4, "wrapMode", "none");
53055
+ insert(_el$4, () => `\u2190\u2192 \u9009\u62E9 \xB7 Enter \u786E\u8BA4 \xB7 Esc ${props.cancelLabel ?? "Cancel"}`);
52974
53056
  effect((_p$) => {
52975
53057
  var _v$ = theme().text.muted, _v$2 = theme().attributes.keyHint;
52976
53058
  _v$ !== _p$.e && (_p$.e = setProp(_el$4, "fg", _v$, _p$.e));
@@ -52986,10 +53068,10 @@ function ConfirmDialog(props) {
52986
53068
  function ConfirmButton(props) {
52987
53069
  const token = () => props.state().focused ? props.theme().border.focused : props.theme().border.base;
52988
53070
  return (() => {
52989
- var _el$7 = createElement("box");
52990
- setProp(_el$7, "flexShrink", 0);
52991
- setProp(_el$7, "border", ["left", "right"]);
52992
- insert(_el$7, createComponent2(Button, {
53071
+ var _el$6 = createElement("box");
53072
+ setProp(_el$6, "flexShrink", 0);
53073
+ setProp(_el$6, "border", ["top", "right", "bottom", "left"]);
53074
+ insert(_el$6, createComponent2(Button, {
52993
53075
  get label() {
52994
53076
  return props.state().label;
52995
53077
  },
@@ -52997,7 +53079,7 @@ function ConfirmButton(props) {
52997
53079
  return props.state().variant;
52998
53080
  },
52999
53081
  get keyHint() {
53000
- return props.state().keyHint;
53082
+ return props.state().keyHint || undefined;
53001
53083
  },
53002
53084
  get disabled() {
53003
53085
  return props.state().disabled;
@@ -53011,14 +53093,14 @@ function ConfirmButton(props) {
53011
53093
  }));
53012
53094
  effect((_p$) => {
53013
53095
  var _v$3 = token().style, _v$4 = token().color;
53014
- _v$3 !== _p$.e && (_p$.e = setProp(_el$7, "borderStyle", _v$3, _p$.e));
53015
- _v$4 !== _p$.t && (_p$.t = setProp(_el$7, "borderColor", _v$4, _p$.t));
53096
+ _v$3 !== _p$.e && (_p$.e = setProp(_el$6, "borderStyle", _v$3, _p$.e));
53097
+ _v$4 !== _p$.t && (_p$.t = setProp(_el$6, "borderColor", _v$4, _p$.t));
53016
53098
  return _p$;
53017
53099
  }, {
53018
53100
  e: undefined,
53019
53101
  t: undefined
53020
53102
  });
53021
- return _el$7;
53103
+ return _el$6;
53022
53104
  })();
53023
53105
  }
53024
53106
  var init_confirm = __esm(() => {
@@ -53030,7 +53112,6 @@ var init_confirm = __esm(() => {
53030
53112
  init_index_bun();
53031
53113
  init_index_bun();
53032
53114
  init_index_bun();
53033
- init_index_bun();
53034
53115
  init_server();
53035
53116
  init_theme4();
53036
53117
  init_button();
@@ -53134,11 +53215,36 @@ function inTree(root, node) {
53134
53215
  }
53135
53216
  function PanelStack(props) {
53136
53217
  const renderer = useRenderer();
53218
+ const panelTheme = usePanelTheme();
53137
53219
  const [layers, setLayers] = createSignal([]);
53138
53220
  const handles = new Map;
53139
53221
  let counter = 0;
53140
53222
  let baseFocus = null;
53141
53223
  const maxDepth = () => props.maxDepth ?? 4;
53224
+ const layerScrimAlpha = (index) => {
53225
+ const entry = layers()[index];
53226
+ if (!entry || entry.options.scrim === false)
53227
+ return 0;
53228
+ return entry.options.scrimAlpha ?? resolveScrimAlpha(panelTheme().background.scrim.toInts()[3], index);
53229
+ };
53230
+ const dimFor = (index) => {
53231
+ let left = 1;
53232
+ for (let above = index + 1;above < layers().length; above += 1) {
53233
+ left *= 1 - layerScrimAlpha(above) / 255;
53234
+ }
53235
+ return left;
53236
+ };
53237
+ const pageScrimAlpha = (index) => {
53238
+ if (index !== 0 || layers().length < 2)
53239
+ return;
53240
+ if (layers()[0]?.options.scrimAlpha !== undefined)
53241
+ return;
53242
+ let left = 1;
53243
+ for (let at = 0;at < layers().length; at += 1) {
53244
+ left *= 1 - layerScrimAlpha(at) / 255;
53245
+ }
53246
+ return Math.round((1 - left) * 255);
53247
+ };
53142
53248
  const restore = (target) => {
53143
53249
  queueMicrotask(() => {
53144
53250
  if (layers().length > 0)
@@ -53266,7 +53372,7 @@ function PanelStack(props) {
53266
53372
  title: options.title,
53267
53373
  tone: options.tone ?? "warning",
53268
53374
  size: "medium",
53269
- height: 10,
53375
+ height: 12,
53270
53376
  onClose: () => {
53271
53377
  if (settled)
53272
53378
  return;
@@ -53302,6 +53408,15 @@ function PanelStack(props) {
53302
53408
  get active() {
53303
53409
  return index() === layers().length - 1;
53304
53410
  },
53411
+ get scrim() {
53412
+ return memo2(() => index() === 0)() ? entry.options.scrim : false;
53413
+ },
53414
+ get scrimAlpha() {
53415
+ return memo2(() => index() === 0)() ? pageScrimAlpha(index()) : entry.options.scrimAlpha;
53416
+ },
53417
+ get dim() {
53418
+ return dimFor(index());
53419
+ },
53305
53420
  onClose: () => {
53306
53421
  entry.options.onClose?.();
53307
53422
  removeEntry(entry.id);
@@ -53330,6 +53445,7 @@ var init_stack = __esm(() => {
53330
53445
  init_server();
53331
53446
  init_confirm();
53332
53447
  init_panel();
53448
+ init_theme4();
53333
53449
  PanelStackContext = createContext(undefined);
53334
53450
  });
53335
53451
 
@@ -55446,7 +55562,7 @@ var init_agents_panel = __esm(() => {
55446
55562
  import { TextAttributes as TextAttributes11 } from "@opentui/core";
55447
55563
  function resolveVersion() {
55448
55564
  try {
55449
- return "0.12.0";
55565
+ return "0.12.2";
55450
55566
  } catch {
55451
55567
  return "dev";
55452
55568
  }
@@ -56031,8 +56147,8 @@ function SettingsModalBody(props) {
56031
56147
  const exit = await panels.confirm({
56032
56148
  title: "\u9000\u51FA\u8BBE\u7F6E\uFF1F",
56033
56149
  message: "\u6240\u6709\u6539\u52A8\u5DF2\u5373\u65F6\u4FDD\u5B58\u3002",
56034
- confirmLabel: "\u9000\u51FA",
56035
- cancelLabel: "\u53D6\u6D88",
56150
+ confirmLabel: "\u786E\u8BA4\u9000\u51FA",
56151
+ cancelLabel: "\u8FD4\u56DE",
56036
56152
  destructive: true
56037
56153
  });
56038
56154
  if (exit)
@@ -56224,7 +56340,8 @@ function SettingsModalBody(props) {
56224
56340
  id: section.id,
56225
56341
  label: section.label,
56226
56342
  description: `${section.rows.length}`,
56227
- descriptionTone: "system"
56343
+ descriptionTone: "system",
56344
+ descriptionAlign: "right"
56228
56345
  })));
56229
56346
  const rowWidth = () => settingsRowWidth(dimensions().width, dimensions().height);
56230
56347
  const rowItems = createMemo(() => rowListItems(visibleRows()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiwayds/dsh-opentui",
3
- "version": "0.12.0",
3
+ "version": "0.12.2",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "bin": {