handmux 0.32.1 → 0.33.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/dist/bin/handmux.js +59 -7
- package/dist/build-meta.json +5 -0
- package/dist/package.json +13 -13
- package/dist/public/assets/{abnfDiagram-O67JEVCF-BR1eeLf3.js → abnfDiagram-O67JEVCF-BL42HdkU.js} +1 -1
- package/dist/public/assets/{arc-Cd58OOkg.js → arc-CgPou2S4.js} +1 -1
- package/dist/public/assets/{architectureDiagram-NJMV4G6O-C6BHL9rq.js → architectureDiagram-NJMV4G6O--irPoxEu.js} +1 -1
- package/dist/public/assets/{blockDiagram-BEXU5L5S-CjLESFlx.js → blockDiagram-BEXU5L5S-L64xhyt9.js} +1 -1
- package/dist/public/assets/{c4Diagram-YGBWAQC7-8jAxXe29.js → c4Diagram-YGBWAQC7-DB4Fsyh-.js} +1 -1
- package/dist/public/assets/channel-B-4i_mtq.js +1 -0
- package/dist/public/assets/{chunk-2Q5K7J3B-CYtARqEs.js → chunk-2Q5K7J3B-Dy33e8IR.js} +1 -1
- package/dist/public/assets/{chunk-3FUC2YCW-DaLgcVqW.js → chunk-3FUC2YCW-CcsFsjPm.js} +2 -2
- package/dist/public/assets/{chunk-5VM5RSS4-jNA5b8CJ.js → chunk-5VM5RSS4-CArfdzYd.js} +1 -1
- package/dist/public/assets/{chunk-GTNCS2PH-am0SVeIp.js → chunk-GTNCS2PH-C6XtE2UP.js} +1 -1
- package/dist/public/assets/{chunk-GWA4HPMP-DKFEXs2N.js → chunk-GWA4HPMP-D-WZR5sJ.js} +1 -1
- package/dist/public/assets/{chunk-JWPE2WC7-BixFujYe.js → chunk-JWPE2WC7-BeZZ73X1.js} +1 -1
- package/dist/public/assets/{chunk-NETBCI7D-6tqmsyIF.js → chunk-NETBCI7D-CLtp9zMu.js} +1 -1
- package/dist/public/assets/{chunk-WEXAMYUT-Dk7hsSTV.js → chunk-WEXAMYUT-DD7IP56D.js} +1 -1
- package/dist/public/assets/{chunk-XXDRQBXY-DUn-Susr.js → chunk-XXDRQBXY-Cv86oNXe.js} +1 -1
- package/dist/public/assets/{classDiagram-v2-NBCMYWYE-DYErAuKI.js → classDiagram-v2-NBCMYWYE-DU8lyLQB.js} +1 -1
- package/dist/public/assets/{cose-bilkent-JH36ORCC-CtDNSyRW.js → cose-bilkent-JH36ORCC-J-2oWluj.js} +1 -1
- package/dist/public/assets/{cynefin-OW5HDTMX-DUGQ5PFS.js → cynefin-OW5HDTMX-CCIuYnl3.js} +1 -1
- package/dist/public/assets/{cynefinDiagram-VND7K2PF-fk6pZSmY.js → cynefinDiagram-VND7K2PF-CJtcA0pj.js} +1 -1
- package/dist/public/assets/{dagre-6A5THRUB-BRbwyIZ2.js → dagre-6A5THRUB-CFgQ4Ue5.js} +1 -1
- package/dist/public/assets/{diagram-22UHCM2B-CPpRCHxE.js → diagram-22UHCM2B-FOxIkvaz.js} +1 -1
- package/dist/public/assets/{diagram-3UASUU5V-BmscSGEW.js → diagram-3UASUU5V-CTwZjCW_.js} +1 -1
- package/dist/public/assets/{diagram-ATOU4E4O-CbZ6pI2e.js → diagram-ATOU4E4O-C-8G4Oc-.js} +1 -1
- package/dist/public/assets/{diagram-CDSNMT55-62YnqcE_.js → diagram-CDSNMT55-CDwQ_9cK.js} +1 -1
- package/dist/public/assets/{diagram-MLGK6HIB-B1YjkGzs.js → diagram-MLGK6HIB-B7nZpgce.js} +1 -1
- package/dist/public/assets/{diagram-MPIPVDR6-BHcrolsX.js → diagram-MPIPVDR6-CL-MVeNP.js} +1 -1
- package/dist/public/assets/{ebnfDiagram-ZINNZB2B-CiQhvnay.js → ebnfDiagram-ZINNZB2B-BDKlW10f.js} +1 -1
- package/dist/public/assets/{elk-276RUBZZ-C6V2DMRk.js → elk-276RUBZZ-BxhLMeCj.js} +1 -1
- package/dist/public/assets/{erDiagram-OPXOYQCR-3XDAc19-.js → erDiagram-OPXOYQCR-CrFUQvsJ.js} +1 -1
- package/dist/public/assets/{flowDiagram-KWPJA3E3-B1pYtLHV.js → flowDiagram-KWPJA3E3-BWC2nxSM.js} +1 -1
- package/dist/public/assets/{ganttDiagram-FUAMR5RP-Crw0GNBd.js → ganttDiagram-FUAMR5RP-BOgMRhXM.js} +1 -1
- package/dist/public/assets/{gitGraphDiagram-X574FWY7-Dhtwc3J1.js → gitGraphDiagram-X574FWY7-3MllqYim.js} +1 -1
- package/dist/public/assets/index-CBrUd-Kh.js +199 -0
- package/dist/public/assets/index-CCO6YrGs.css +32 -0
- package/dist/public/assets/{infoDiagram-VRGFBTTK-DGZXRxs7.js → infoDiagram-VRGFBTTK-LinMc-6k.js} +1 -1
- package/dist/public/assets/{ishikawaDiagram-OU5B5YK6-CE7_WBbq.js → ishikawaDiagram-OU5B5YK6-DiUIK3na.js} +1 -1
- package/dist/public/assets/{journeyDiagram-ZHPQQLJL-DBwtFHs6.js → journeyDiagram-ZHPQQLJL-BMW2a-It.js} +1 -1
- package/dist/public/assets/{kanban-definition-PNTS6WVX-CIVjxu98.js → kanban-definition-PNTS6WVX-Ca5trfQx.js} +1 -1
- package/dist/public/assets/{linear-xkHqqKR9.js → linear-Dc5XChQu.js} +1 -1
- package/dist/public/assets/{mermaid.core-zckvkoNk.js → mermaid.core-BmhjJ770.js} +4 -4
- package/dist/public/assets/{mindmap-definition-NLK3R4M7-BhtT3Ov5.js → mindmap-definition-NLK3R4M7-DEhk7ub8.js} +1 -1
- package/dist/public/assets/{pegDiagram-GJSIUBJH-B_cQ_Jl7.js → pegDiagram-GJSIUBJH-_uH-miXr.js} +1 -1
- package/dist/public/assets/{pieDiagram-5QR66LMP-CmSvzsFO.js → pieDiagram-5QR66LMP-CbxFXQNO.js} +1 -1
- package/dist/public/assets/{quadrantDiagram-O4NWA36T-CrQjCy1U.js → quadrantDiagram-O4NWA36T-BJNIZfgq.js} +1 -1
- package/dist/public/assets/{railroadDiagram-XR7U4H2S-C1acbwaj.js → railroadDiagram-XR7U4H2S-W_CBkBXl.js} +1 -1
- package/dist/public/assets/{requirementDiagram-PLB6GJNP-GwmxQusX.js → requirementDiagram-PLB6GJNP-3bxFgzJ4.js} +1 -1
- package/dist/public/assets/{sankeyDiagram-IPEJSGJF-BQHO_DfU.js → sankeyDiagram-IPEJSGJF-Dy7RudSK.js} +1 -1
- package/dist/public/assets/{sequenceDiagram-PO4LG4MO-Bkan0EwC.js → sequenceDiagram-PO4LG4MO-CzNAfthb.js} +1 -1
- package/dist/public/assets/{sizeCapture-INFHLROL-Du_6xEkB.js → sizeCapture-INFHLROL-BCmCfX9H.js} +1 -1
- package/dist/public/assets/{stateDiagram-v2-GCMORJYK-oZ0rlPlh.js → stateDiagram-v2-GCMORJYK-CSZ5SzhP.js} +1 -1
- package/dist/public/assets/{swimlanes-2SLR337P-CSle5a30.js → swimlanes-2SLR337P-J2iZmFfM.js} +1 -1
- package/dist/public/assets/swimlanesDiagram-TC7HE7FX-2nFAi2qR.js +8 -0
- package/dist/public/assets/{timeline-definition-EJHVYXUP-CuVp2Rec.js → timeline-definition-EJHVYXUP-DtOyXEwn.js} +1 -1
- package/dist/public/assets/{usecaseDiagram-POWQR4AR-CyVcc5iP.js → usecaseDiagram-POWQR4AR-D93pK-Kv.js} +1 -1
- package/dist/public/assets/{vennDiagram-UO4OBE2U-Ct6hsuIA.js → vennDiagram-UO4OBE2U-DqT-TkVx.js} +1 -1
- package/dist/public/assets/{wardleyDiagram-VNRHLVJA-p2E1ZN7S.js → wardleyDiagram-VNRHLVJA-ldM3aPSL.js} +1 -1
- package/dist/public/assets/{xychartDiagram-PMCCYNJV-CEvDgoje.js → xychartDiagram-PMCCYNJV-CqvkJhmq.js} +1 -1
- package/dist/public/index.html +2 -2
- package/dist/src/agent-runtime/builtinRuntime.js +2 -1
- package/dist/src/agents/claudeNativeTail.js +7 -2
- package/dist/src/cli/i18n/en.js +1 -0
- package/dist/src/cli/i18n/zh.js +1 -0
- package/dist/src/cli/service.js +30 -12
- package/dist/src/cli/supervisorProcesses.js +12 -4
- package/dist/src/docs.js +6 -3
- package/dist/src/httpApi.js +6 -0
- package/dist/src/orphans.js +17 -4
- package/dist/src/projectTask/migrations.js +46 -0
- package/dist/src/projectTask/routes.js +13 -0
- package/dist/src/projectTask/schema.js +1 -1
- package/dist/src/projectTask/store.js +39 -5
- package/dist/src/routes/system.js +7 -20
- package/dist/src/server.js +26 -6
- package/dist/src/tmux/commands.js +42 -3
- package/dist/src/version.js +26 -0
- package/package.json +4 -4
- package/dist/public/assets/channel-D_ZJSyQy.js +0 -1
- package/dist/public/assets/index-DQER7DJq.css +0 -32
- package/dist/public/assets/index-DuNjw_qc.js +0 -203
- package/dist/public/assets/swimlanesDiagram-TC7HE7FX-D5IVJXhw.js +0 -8
package/dist/bin/handmux.js
CHANGED
|
@@ -42,6 +42,7 @@ import { claudeUsagePath } from '../src/usagePaths.js';
|
|
|
42
42
|
import { probe } from '../src/cli/probe.js';
|
|
43
43
|
import { notifyUpdate, runUpdateCheck, isBrewInstall, PKG_NAME } from '../src/cli/updateCheck.js';
|
|
44
44
|
import { t, initLocale } from '../src/cli/i18n/index.js';
|
|
45
|
+
import { SERVER_VERSION } from '../src/version.js';
|
|
45
46
|
import { runPush } from '../src/cli/pushCmd.js';
|
|
46
47
|
import { runAuthCommand } from '../src/cli/authCmd.js';
|
|
47
48
|
import { runWorkspaceCommand } from '../src/cli/workspaceCmd.js';
|
|
@@ -70,6 +71,13 @@ const ownerPidOf = (error) => {
|
|
|
70
71
|
return typeof ownerPid === 'number' && Number.isSafeInteger(ownerPid) && ownerPid > 0 ? ownerPid : null;
|
|
71
72
|
};
|
|
72
73
|
const stringFlag = (value) => typeof value === 'string' && value ? value : null;
|
|
74
|
+
// A restricted development shell may not permit `ps`. The dev profile has its own HOME, port and tmux
|
|
75
|
+
// socket, so its state file is a sufficient lifecycle anchor when the process-table backstop is unavailable.
|
|
76
|
+
// Production keeps the strict scan failure because it must never risk starting a duplicate supervisor.
|
|
77
|
+
function scanCurrentSupervisors() {
|
|
78
|
+
const result = scanSupervisorPids({ home: HOME });
|
|
79
|
+
return result.ok || process.env.HANDMUX_DEV_MODE !== '1' ? result : { ok: true, pids: [] };
|
|
80
|
+
}
|
|
73
81
|
// Agent launchers own every token after their built-in slug. Run this before Handmux parseArgs, locale and
|
|
74
82
|
// config peeking so Agent flags such as --config/--lang (including duplicates and `--`) stay byte-for-byte
|
|
75
83
|
// positional input and a broken Handmux config cannot block the Agent from starting.
|
|
@@ -280,6 +288,28 @@ function currentVersion() {
|
|
|
280
288
|
// restart a running instance; on success we refresh the update cache so the "upgrade available" notice
|
|
281
289
|
// clears, and remind them to `handmux restart` to actually run the new code.
|
|
282
290
|
function updateCmd() {
|
|
291
|
+
if (process.env.HANDMUX_DEV_MODE === '1') {
|
|
292
|
+
const source = process.env.HANDMUX_DEV_SOURCE;
|
|
293
|
+
if (!source) {
|
|
294
|
+
console.error('development update source is not configured; run ./dev.sh deploy');
|
|
295
|
+
process.exitCode = 1;
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
console.log('Updating the development package from the source checkout…');
|
|
299
|
+
const serverDir = path.join(source, 'server');
|
|
300
|
+
const bundle = spawnSync('npm', ['run', 'bundle'], { cwd: serverDir, stdio: 'inherit' });
|
|
301
|
+
const build = bundle.status === 0
|
|
302
|
+
? spawnSync('npm', ['run', 'build:server'], { cwd: serverDir, stdio: 'inherit' })
|
|
303
|
+
: bundle;
|
|
304
|
+
if (build.status !== 0) {
|
|
305
|
+
console.error('✗ Development update failed.');
|
|
306
|
+
process.exitCode = 1;
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
console.log('✓ Development package updated.');
|
|
310
|
+
console.log(' run `hm restart` to run the new version.');
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
283
313
|
if (isBrewInstall(SELF_REAL)) {
|
|
284
314
|
console.log(t('update.brew'));
|
|
285
315
|
return;
|
|
@@ -296,6 +326,18 @@ function updateCmd() {
|
|
|
296
326
|
process.exitCode = 1;
|
|
297
327
|
}
|
|
298
328
|
}
|
|
329
|
+
// launchd/systemd do not inherit the shell variables used by an isolated `hm` profile. Persist only
|
|
330
|
+
// path-like runtime settings (never tokens or credentials) so a development service starts in the same
|
|
331
|
+
// HOME/tmux/workspace as the command that installed it.
|
|
332
|
+
function serviceEnvironment() {
|
|
333
|
+
const values = { HOME };
|
|
334
|
+
for (const key of ['TMUX_TMPDIR', 'CODEX_HOME', 'HANDMUX_EXTRA_ROOTS', 'HANDMUX_DEV_MODE', 'HANDMUX_DEV_SOURCE', 'HANDMUX_SHARED_HOME']) {
|
|
335
|
+
const value = process.env[key];
|
|
336
|
+
if (value)
|
|
337
|
+
values[key] = value;
|
|
338
|
+
}
|
|
339
|
+
return values;
|
|
340
|
+
}
|
|
299
341
|
// Best-effort upgrade notice from the cached "latest version" (never blocks; refreshes in the background).
|
|
300
342
|
function maybeNotifyUpdate() {
|
|
301
343
|
notifyUpdate(HOME, { version: currentVersion(), selfPath: SELF_REAL });
|
|
@@ -326,7 +368,7 @@ async function start(authDefaults) {
|
|
|
326
368
|
console.warn(t('tmux.tooOld', { raw: tmux.raw, min: MIN_TMUX }));
|
|
327
369
|
// state.json cannot represent two supervisors. Refuse to add another when the real process table says
|
|
328
370
|
// the state is missing/stale or a historical duplicate already exists; `handmux stop` is the repair path.
|
|
329
|
-
const supervisors =
|
|
371
|
+
const supervisors = scanCurrentSupervisors();
|
|
330
372
|
if (!supervisors.ok) {
|
|
331
373
|
console.error(t('lifecycle.scanFailed'));
|
|
332
374
|
process.exitCode = 1;
|
|
@@ -423,7 +465,9 @@ async function start(authDefaults) {
|
|
|
423
465
|
// Rewriting + restarting the entry also refreshes baked config and upgrade-sensitive executable paths.
|
|
424
466
|
if (isServiceInstalled(HOME)) {
|
|
425
467
|
try {
|
|
426
|
-
installService(supervisorLaunchArgs(cfg, { home: HOME, entry: SELF }), {
|
|
468
|
+
installService(supervisorLaunchArgs(cfg, { home: HOME, entry: SELF }), {
|
|
469
|
+
home: HOME, log: { log() { } }, environment: serviceEnvironment(),
|
|
470
|
+
});
|
|
427
471
|
}
|
|
428
472
|
catch (error) {
|
|
429
473
|
console.error(t('err.generic', { msg: errorMessage(error) }));
|
|
@@ -463,7 +507,7 @@ function reapOrphans(st) {
|
|
|
463
507
|
// until none remain. This both repairs historical duplicates and prevents restart from racing a straggler.
|
|
464
508
|
async function stopAndWait() {
|
|
465
509
|
const st = readState(HOME);
|
|
466
|
-
const initial =
|
|
510
|
+
const initial = scanCurrentSupervisors();
|
|
467
511
|
if (!initial.ok) {
|
|
468
512
|
console.error(t('lifecycle.scanFailed'));
|
|
469
513
|
process.exitCode = 1;
|
|
@@ -490,7 +534,9 @@ async function stopAndWait() {
|
|
|
490
534
|
console.log(managed ? t('stop.stoppedManaged') : t('stop.notRunning'));
|
|
491
535
|
return true;
|
|
492
536
|
}
|
|
493
|
-
const result = await terminateSupervisorPids([...seen]
|
|
537
|
+
const result = await terminateSupervisorPids([...seen], {
|
|
538
|
+
scan: scanCurrentSupervisors,
|
|
539
|
+
});
|
|
494
540
|
if (!result.ok) {
|
|
495
541
|
console.error(t(result.reason === 'scan' ? 'lifecycle.scanFailed' : 'stop.timeout', {
|
|
496
542
|
pids: result.remaining.join(', '),
|
|
@@ -498,6 +544,11 @@ async function stopAndWait() {
|
|
|
498
544
|
process.exitCode = 1;
|
|
499
545
|
return false;
|
|
500
546
|
}
|
|
547
|
+
// A supervisor can disappear before it reaps its server/tunnel children (for example after a shell or
|
|
548
|
+
// service-manager interruption). Always retry the state-recorded child pids after the supervisor is gone;
|
|
549
|
+
// this is idempotent for a clean shutdown and prevents the next start from inheriting a project lock.
|
|
550
|
+
if (st)
|
|
551
|
+
reapOrphans(st);
|
|
501
552
|
clearState(HOME);
|
|
502
553
|
console.log(t(result.pids.length > 1 ? 'stop.stoppedMany' : 'stop.stopped', {
|
|
503
554
|
pid: result.pids[0], pids: result.pids.join(', '),
|
|
@@ -507,7 +558,7 @@ async function stopAndWait() {
|
|
|
507
558
|
async function status() {
|
|
508
559
|
const st = readState(HOME);
|
|
509
560
|
const installed = currentVersion();
|
|
510
|
-
const supervisors =
|
|
561
|
+
const supervisors = scanCurrentSupervisors();
|
|
511
562
|
if (!supervisors.ok)
|
|
512
563
|
console.warn(t('status.scanFailed'));
|
|
513
564
|
const stateAlive = !!(st && isAlive(st.supervisorPid));
|
|
@@ -616,7 +667,7 @@ async function serviceInstall() {
|
|
|
616
667
|
// Converge a pre-existing manual run (and any old broken managed/manual pair) before loading the service.
|
|
617
668
|
// Otherwise the very first `service install` can itself create two supervisors fighting over one port.
|
|
618
669
|
const existing = readState(HOME);
|
|
619
|
-
const supervisors =
|
|
670
|
+
const supervisors = scanCurrentSupervisors();
|
|
620
671
|
if (!supervisors.ok) {
|
|
621
672
|
console.error(t('lifecycle.scanFailed'));
|
|
622
673
|
process.exitCode = 1;
|
|
@@ -628,7 +679,7 @@ async function serviceInstall() {
|
|
|
628
679
|
}
|
|
629
680
|
const args = supervisorLaunchArgs(cfg, { home: HOME, entry: SELF });
|
|
630
681
|
try {
|
|
631
|
-
installService(args, { home: HOME });
|
|
682
|
+
installService(args, { home: HOME, environment: serviceEnvironment() });
|
|
632
683
|
}
|
|
633
684
|
catch (error) {
|
|
634
685
|
console.error(t('err.generic', { msg: errorMessage(error) }));
|
|
@@ -968,6 +1019,7 @@ async function printAccess(st) {
|
|
|
968
1019
|
const scan = bareUrl(publicUrl);
|
|
969
1020
|
console.log('');
|
|
970
1021
|
console.log(t('access.tunnel', { tunnel: st.tunnel, pid: st.supervisorPid }));
|
|
1022
|
+
console.log(t('access.version', { version: SERVER_VERSION ?? currentVersion() }));
|
|
971
1023
|
console.log(t('access.open', { url: scan || t('access.pending') }));
|
|
972
1024
|
if (st.tunnel === 'none' && st.lanUrl)
|
|
973
1025
|
console.log(t('access.lan', { url: bareUrl(st.lanUrl) }));
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "handmux",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.33.1",
|
|
4
4
|
"description": "A mobile vibe-coding cockpit — built on tmux: drive your live session, Claude Code / Codex — anything a terminal can run — from your phone.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "AGPL-3.0-only",
|
|
@@ -75,6 +75,18 @@
|
|
|
75
75
|
"vitest": "^2.0.0"
|
|
76
76
|
},
|
|
77
77
|
"whatsNew": [
|
|
78
|
+
{
|
|
79
|
+
"version": "0.33.1",
|
|
80
|
+
"date": "2026-10-02",
|
|
81
|
+
"zh": "对话复制和工作区操作更顺手",
|
|
82
|
+
"en": "Smoother conversation copying and workspace actions"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"version": "0.33.0",
|
|
86
|
+
"date": "2026-09-30",
|
|
87
|
+
"zh": "终端路径高亮不再闪烁 · 服务更新提示更可靠",
|
|
88
|
+
"en": "Steady terminal paths · reliable service update prompts"
|
|
89
|
+
},
|
|
78
90
|
{
|
|
79
91
|
"version": "0.32.1",
|
|
80
92
|
"date": "2026-09-28",
|
|
@@ -110,18 +122,6 @@
|
|
|
110
122
|
"date": "2026-09-18",
|
|
111
123
|
"zh": "修复 Linux 下 Claude 事件上报的兼容问题",
|
|
112
124
|
"en": "Compatibility fix for Claude event reporting on Linux"
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
"version": "0.29.1",
|
|
116
|
-
"date": "2026-09-18",
|
|
117
|
-
"zh": "修复 Claude 对话入口丢失 · 长时间运行不再变卡",
|
|
118
|
-
"en": "Fix lost Claude chat entries · no slowdown after long runs"
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
"version": "0.29.0",
|
|
122
|
-
"date": "2026-09-16",
|
|
123
|
-
"zh": "可信设备与可信地址保护",
|
|
124
|
-
"en": "Trusted device and address protection"
|
|
125
125
|
}
|
|
126
126
|
]
|
|
127
127
|
}
|
package/dist/public/assets/{abnfDiagram-O67JEVCF-BR1eeLf3.js → abnfDiagram-O67JEVCF-BL42HdkU.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as p,r as u,d as n}from"./chunk-GTNCS2PH-
|
|
1
|
+
import{g as p,r as u,d as n}from"./chunk-GTNCS2PH-C6XtE2UP.js";import{p as f}from"./chunk-JWPE2WC7-BeZZ73X1.js";import{c as a,aH as o}from"./mermaid.core-BmhjJ770.js";import{M as c,c as d}from"./cynefin-OW5HDTMX-CCIuYnl3.js";import"./index-CBrUd-Kh.js";var v=d().RailroadAbnf.parser.LangiumParser,i=a(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=a(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=a(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=a(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=a(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=a(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=a(e=>{f(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(P(r)))},"populateDb"),R={parse:a(e=>{n.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:n}},B={parser:R,db:n,renderer:u,styles:p};export{B as diagram};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bx as ln,aW as an,I as z,bi as w,G as N,af as un,W as y,bo as on,bj as F,aP as _,d as rn,n as t,aN as tn,k as sn,e as fn}from"./mermaid.core-
|
|
1
|
+
import{bx as ln,aW as an,I as z,bi as w,G as N,af as un,W as y,bo as on,bj as F,aP as _,d as rn,n as t,aN as tn,k as sn,e as fn}from"./mermaid.core-BmhjJ770.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,j,I,v,A,O,a){var q=j-l,i=I-h,n=O-v,d=a-A,u=d*q-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*q,h+u*i]}function Q(l,h,j,I,v,A,O){var a=l-j,q=h-I,i=(O?A:-A)/F(a*a+q*q),n=i*q,d=-i*a,u=l+n,s=h+d,f=j+n,c=I+d,S=(u+f)/2,o=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,D=(g<0?-1:1)*F(tn(0,T*T*R-P*P)),E=(P*g-m*D)/R,G=(-P*m-g*D)/R,b=(P*g+m*D)/R,p=(-P*m+g*D)/R,x=E-S,e=G-o,r=b-S,k=p-o;return x*x+e*e>r*r+k*k&&(E=b,G=p),{cx:E,cy:G,x01:-n,y01:-d,x11:E*(v/T-1),y11:G*(v/T-1)}}function hn(){var l=cn,h=yn,j=N(0),I=null,v=gn,A=dn,O=mn,a=null,q=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,S=rn(c-f),o=c>f;if(a||(a=n=q()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(S>on-y)a.moveTo(s*z(f),s*w(f)),a.arc(0,0,s,f,c,!o),u>y&&(a.moveTo(u*z(c),u*w(c)),a.arc(0,0,u,c,f,o));else{var m=f,g=c,R=f,T=c,P=S,D=S,E=O.apply(this,arguments)/2,G=E>y&&(I?+I.apply(this,arguments):F(u*u+s*s)),b=_(rn(s-u)/2,+j.apply(this,arguments)),p=b,x=b,e,r;if(G>y){var k=sn(G/u*w(E)),H=sn(G/s*w(E));(P-=k*2)>y?(k*=o?1:-1,R+=k,T-=k):(P=0,R=T=(f+c)/2),(D-=H*2)>y?(H*=o?1:-1,m+=H,g-=H):(D=0,m=g=(f+c)/2)}var B=s*z(m),C=s*w(m),J=u*z(T),K=u*w(T);if(b>y){var L=s*z(g),M=s*w(g),U=u*z(R),V=u*w(R),W;if(S<an)if(W=pn(B,C,U,V,L,M,J,K)){var X=B-W[0],Y=C-W[1],Z=L-W[0],$=M-W[1],nn=1/w(fn((X*Z+Y*$)/(F(X*X+Y*Y)*F(Z*Z+$*$)))/2),en=F(W[0]*W[0]+W[1]*W[1]);p=_(b,(u-en)/(nn-1)),x=_(b,(s-en)/(nn+1))}else p=x=0}D>y?x>y?(e=Q(U,V,B,C,s,x,o),r=Q(L,M,J,K,s,x,o),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<b?a.arc(e.cx,e.cy,x,t(e.y01,e.x01),t(r.y01,r.x01),!o):(a.arc(e.cx,e.cy,x,t(e.y01,e.x01),t(e.y11,e.x11),!o),a.arc(0,0,s,t(e.cy+e.y11,e.cx+e.x11),t(r.cy+r.y11,r.cx+r.x11),!o),a.arc(r.cx,r.cy,x,t(r.y11,r.x11),t(r.y01,r.x01),!o))):(a.moveTo(B,C),a.arc(0,0,s,m,g,!o)):a.moveTo(B,C),!(u>y)||!(P>y)?a.lineTo(J,K):p>y?(e=Q(J,K,L,M,u,-p,o),r=Q(B,C,U,V,u,-p,o),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<b?a.arc(e.cx,e.cy,p,t(e.y01,e.x01),t(r.y01,r.x01),!o):(a.arc(e.cx,e.cy,p,t(e.y01,e.x01),t(e.y11,e.x11),!o),a.arc(0,0,u,t(e.cy+e.y11,e.cx+e.x11),t(r.cy+r.y11,r.cx+r.x11),o),a.arc(r.cx,r.cy,p,t(r.y11,r.x11),t(r.y01,r.x01),!o))):a.arc(0,0,u,T,R,o)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[z(d)*n,w(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:N(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:N(+n),i):h},i.cornerRadius=function(n){return arguments.length?(j=typeof n=="function"?n:N(+n),i):j},i.padRadius=function(n){return arguments.length?(I=n==null?null:typeof n=="function"?n:N(+n),i):I},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:N(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:N(+n),i):A},i.padAngle=function(n){return arguments.length?(O=typeof n=="function"?n:N(+n),i):O},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
|