handmux 0.33.0 → 0.33.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/dist/bin/handmux.js +57 -7
- package/dist/build-meta.json +3 -3
- package/dist/package.json +13 -13
- package/dist/public/assets/{abnfDiagram-O67JEVCF-D1FBJlXT.js → abnfDiagram-O67JEVCF-CEQgAYi1.js} +1 -1
- package/dist/public/assets/{arc-B31VKfrO.js → arc-gObMfWQt.js} +1 -1
- package/dist/public/assets/{architectureDiagram-NJMV4G6O-Cajbe6WC.js → architectureDiagram-NJMV4G6O-C_xZNQjZ.js} +1 -1
- package/dist/public/assets/{blockDiagram-BEXU5L5S-9W5MsDIf.js → blockDiagram-BEXU5L5S-BAoZ2IDv.js} +1 -1
- package/dist/public/assets/{c4Diagram-YGBWAQC7-R23e6gQl.js → c4Diagram-YGBWAQC7-B2NSKFIB.js} +1 -1
- package/dist/public/assets/channel-BQPKZepC.js +1 -0
- package/dist/public/assets/{chunk-2Q5K7J3B-D0jjnOlI.js → chunk-2Q5K7J3B-K0QpQx4V.js} +1 -1
- package/dist/public/assets/{chunk-3FUC2YCW-CcT6Lj9R.js → chunk-3FUC2YCW-xsylvvKQ.js} +2 -2
- package/dist/public/assets/{chunk-5VM5RSS4-aEKby37n.js → chunk-5VM5RSS4-Bu5nSAVn.js} +1 -1
- package/dist/public/assets/{chunk-GTNCS2PH-BwQbyPSe.js → chunk-GTNCS2PH-BdympnRg.js} +1 -1
- package/dist/public/assets/{chunk-GWA4HPMP-D1RHgBIt.js → chunk-GWA4HPMP-Dq6iCE-e.js} +1 -1
- package/dist/public/assets/{chunk-JWPE2WC7-E4Xg-_nO.js → chunk-JWPE2WC7-Bz98Hu8d.js} +1 -1
- package/dist/public/assets/{chunk-NETBCI7D-BU86bdoG.js → chunk-NETBCI7D-C_B-DWYb.js} +1 -1
- package/dist/public/assets/{chunk-WEXAMYUT-B4nx3TA-.js → chunk-WEXAMYUT-Dd1kDMJp.js} +1 -1
- package/dist/public/assets/{chunk-XXDRQBXY-mIUW9xrL.js → chunk-XXDRQBXY-D1iZdH4V.js} +1 -1
- package/dist/public/assets/{classDiagram-v2-NBCMYWYE-BbSHhQ-S.js → classDiagram-v2-NBCMYWYE-TbHVtlsK.js} +1 -1
- package/dist/public/assets/{cose-bilkent-JH36ORCC-D70i98SS.js → cose-bilkent-JH36ORCC-CRDXT20A.js} +1 -1
- package/dist/public/assets/{cynefin-OW5HDTMX-gYo210Yx.js → cynefin-OW5HDTMX-BjiH0OhR.js} +1 -1
- package/dist/public/assets/{cynefinDiagram-VND7K2PF-Cg-FL1Nq.js → cynefinDiagram-VND7K2PF-BxTreWie.js} +1 -1
- package/dist/public/assets/{dagre-6A5THRUB-Acot4_03.js → dagre-6A5THRUB-Cf9vO3PH.js} +1 -1
- package/dist/public/assets/{diagram-22UHCM2B-BxRx_05F.js → diagram-22UHCM2B-DKiEsIcj.js} +1 -1
- package/dist/public/assets/{diagram-3UASUU5V-Cxp1isMQ.js → diagram-3UASUU5V-BWEV32hy.js} +1 -1
- package/dist/public/assets/{diagram-ATOU4E4O-CByw5y_5.js → diagram-ATOU4E4O-DpX9ClkT.js} +1 -1
- package/dist/public/assets/{diagram-CDSNMT55-_HVlHueG.js → diagram-CDSNMT55-BDsVk1ax.js} +1 -1
- package/dist/public/assets/{diagram-MLGK6HIB-CO8yOxY-.js → diagram-MLGK6HIB-SAwq9615.js} +1 -1
- package/dist/public/assets/{diagram-MPIPVDR6-CLu_Y6iM.js → diagram-MPIPVDR6-D1dhiC50.js} +1 -1
- package/dist/public/assets/{ebnfDiagram-ZINNZB2B-DYxBxRzD.js → ebnfDiagram-ZINNZB2B-d2s3skPq.js} +1 -1
- package/dist/public/assets/{elk-276RUBZZ-CKffaWbm.js → elk-276RUBZZ-Dj1QJ_m7.js} +1 -1
- package/dist/public/assets/{erDiagram-OPXOYQCR-DTXcScrg.js → erDiagram-OPXOYQCR-BXjQfyS4.js} +1 -1
- package/dist/public/assets/{flowDiagram-KWPJA3E3-DNYdzimc.js → flowDiagram-KWPJA3E3-DPwKY_iH.js} +1 -1
- package/dist/public/assets/{ganttDiagram-FUAMR5RP-DcJpZsai.js → ganttDiagram-FUAMR5RP-Dxu6YY8n.js} +1 -1
- package/dist/public/assets/{gitGraphDiagram-X574FWY7-TA1dLaL1.js → gitGraphDiagram-X574FWY7-CUf4BDYT.js} +1 -1
- package/dist/public/assets/index-CCO6YrGs.css +32 -0
- package/dist/public/assets/index-CTECnRDI.js +199 -0
- package/dist/public/assets/{infoDiagram-VRGFBTTK-DDlB-vT4.js → infoDiagram-VRGFBTTK-Ezboy1z0.js} +1 -1
- package/dist/public/assets/{ishikawaDiagram-OU5B5YK6-B9TSWMH9.js → ishikawaDiagram-OU5B5YK6-CO4KGQtx.js} +1 -1
- package/dist/public/assets/{journeyDiagram-ZHPQQLJL-D0w_wLlX.js → journeyDiagram-ZHPQQLJL-BIHomnNS.js} +1 -1
- package/dist/public/assets/{kanban-definition-PNTS6WVX-IaBp06g0.js → kanban-definition-PNTS6WVX-Dd-ZhTiW.js} +1 -1
- package/dist/public/assets/{linear-aH2ZZaVY.js → linear-DiQLsGJD.js} +1 -1
- package/dist/public/assets/{mermaid.core-7Q2-CZFE.js → mermaid.core-BVBLuQ4L.js} +4 -4
- package/dist/public/assets/{mindmap-definition-NLK3R4M7-BS-ON3ct.js → mindmap-definition-NLK3R4M7-DgCZ1THg.js} +1 -1
- package/dist/public/assets/{pegDiagram-GJSIUBJH-BX2OWloP.js → pegDiagram-GJSIUBJH-NzxNKBVq.js} +1 -1
- package/dist/public/assets/{pieDiagram-5QR66LMP-BDFAY3lV.js → pieDiagram-5QR66LMP-BbqW9zhn.js} +1 -1
- package/dist/public/assets/{quadrantDiagram-O4NWA36T-iSKiJUTP.js → quadrantDiagram-O4NWA36T-CpzMtU5x.js} +1 -1
- package/dist/public/assets/{railroadDiagram-XR7U4H2S-CcfiaJ4c.js → railroadDiagram-XR7U4H2S-CrkG84hw.js} +1 -1
- package/dist/public/assets/{requirementDiagram-PLB6GJNP-BDNt28zr.js → requirementDiagram-PLB6GJNP-Q0UAuo9v.js} +1 -1
- package/dist/public/assets/{sankeyDiagram-IPEJSGJF-DSEoaolq.js → sankeyDiagram-IPEJSGJF-BESz67zf.js} +1 -1
- package/dist/public/assets/{sequenceDiagram-PO4LG4MO-BrXi64vQ.js → sequenceDiagram-PO4LG4MO-ZEVvVKw2.js} +1 -1
- package/dist/public/assets/{sizeCapture-INFHLROL-BuOjAd6_.js → sizeCapture-INFHLROL-CsfZkbtN.js} +1 -1
- package/dist/public/assets/{stateDiagram-v2-GCMORJYK-CDPnTkvE.js → stateDiagram-v2-GCMORJYK-DFlA40kP.js} +1 -1
- package/dist/public/assets/{swimlanes-2SLR337P-CA2-F_Hl.js → swimlanes-2SLR337P-DiXugNrr.js} +1 -1
- package/dist/public/assets/swimlanesDiagram-TC7HE7FX-BE21W-TR.js +8 -0
- package/dist/public/assets/{timeline-definition-EJHVYXUP-Bl6BGx-J.js → timeline-definition-EJHVYXUP-V0cPbycq.js} +1 -1
- package/dist/public/assets/{usecaseDiagram-POWQR4AR-KnKhSPxM.js → usecaseDiagram-POWQR4AR-DLPAg98Z.js} +1 -1
- package/dist/public/assets/{vennDiagram-UO4OBE2U-BS1_tiy2.js → vennDiagram-UO4OBE2U-mx17DyZw.js} +1 -1
- package/dist/public/assets/{wardleyDiagram-VNRHLVJA-YetgpezU.js → wardleyDiagram-VNRHLVJA-2abV5MJ_.js} +1 -1
- package/dist/public/assets/{xychartDiagram-PMCCYNJV-pHr_j7EQ.js → xychartDiagram-PMCCYNJV-DImmlCIa.js} +1 -1
- package/dist/public/index.html +2 -2
- package/dist/src/agent-runtime/builtinRuntime.js +2 -1
- 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/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 +3 -2
- package/dist/src/server.js +22 -5
- package/dist/src/tmux/commands.js +42 -3
- package/package.json +4 -4
- package/dist/public/assets/channel-DrikeCCA.js +0 -1
- package/dist/public/assets/index-BTyeMLLx.css +0 -32
- package/dist/public/assets/index-Bm_Lp7WV.js +0 -203
- package/dist/public/assets/swimlanesDiagram-TC7HE7FX-DCUWlMJI.js +0 -8
package/dist/bin/handmux.js
CHANGED
|
@@ -71,6 +71,13 @@ const ownerPidOf = (error) => {
|
|
|
71
71
|
return typeof ownerPid === 'number' && Number.isSafeInteger(ownerPid) && ownerPid > 0 ? ownerPid : null;
|
|
72
72
|
};
|
|
73
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
|
+
}
|
|
74
81
|
// Agent launchers own every token after their built-in slug. Run this before Handmux parseArgs, locale and
|
|
75
82
|
// config peeking so Agent flags such as --config/--lang (including duplicates and `--`) stay byte-for-byte
|
|
76
83
|
// positional input and a broken Handmux config cannot block the Agent from starting.
|
|
@@ -281,6 +288,28 @@ function currentVersion() {
|
|
|
281
288
|
// restart a running instance; on success we refresh the update cache so the "upgrade available" notice
|
|
282
289
|
// clears, and remind them to `handmux restart` to actually run the new code.
|
|
283
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
|
+
}
|
|
284
313
|
if (isBrewInstall(SELF_REAL)) {
|
|
285
314
|
console.log(t('update.brew'));
|
|
286
315
|
return;
|
|
@@ -297,6 +326,18 @@ function updateCmd() {
|
|
|
297
326
|
process.exitCode = 1;
|
|
298
327
|
}
|
|
299
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
|
+
}
|
|
300
341
|
// Best-effort upgrade notice from the cached "latest version" (never blocks; refreshes in the background).
|
|
301
342
|
function maybeNotifyUpdate() {
|
|
302
343
|
notifyUpdate(HOME, { version: currentVersion(), selfPath: SELF_REAL });
|
|
@@ -327,7 +368,7 @@ async function start(authDefaults) {
|
|
|
327
368
|
console.warn(t('tmux.tooOld', { raw: tmux.raw, min: MIN_TMUX }));
|
|
328
369
|
// state.json cannot represent two supervisors. Refuse to add another when the real process table says
|
|
329
370
|
// the state is missing/stale or a historical duplicate already exists; `handmux stop` is the repair path.
|
|
330
|
-
const supervisors =
|
|
371
|
+
const supervisors = scanCurrentSupervisors();
|
|
331
372
|
if (!supervisors.ok) {
|
|
332
373
|
console.error(t('lifecycle.scanFailed'));
|
|
333
374
|
process.exitCode = 1;
|
|
@@ -424,7 +465,9 @@ async function start(authDefaults) {
|
|
|
424
465
|
// Rewriting + restarting the entry also refreshes baked config and upgrade-sensitive executable paths.
|
|
425
466
|
if (isServiceInstalled(HOME)) {
|
|
426
467
|
try {
|
|
427
|
-
installService(supervisorLaunchArgs(cfg, { home: HOME, entry: SELF }), {
|
|
468
|
+
installService(supervisorLaunchArgs(cfg, { home: HOME, entry: SELF }), {
|
|
469
|
+
home: HOME, log: { log() { } }, environment: serviceEnvironment(),
|
|
470
|
+
});
|
|
428
471
|
}
|
|
429
472
|
catch (error) {
|
|
430
473
|
console.error(t('err.generic', { msg: errorMessage(error) }));
|
|
@@ -464,7 +507,7 @@ function reapOrphans(st) {
|
|
|
464
507
|
// until none remain. This both repairs historical duplicates and prevents restart from racing a straggler.
|
|
465
508
|
async function stopAndWait() {
|
|
466
509
|
const st = readState(HOME);
|
|
467
|
-
const initial =
|
|
510
|
+
const initial = scanCurrentSupervisors();
|
|
468
511
|
if (!initial.ok) {
|
|
469
512
|
console.error(t('lifecycle.scanFailed'));
|
|
470
513
|
process.exitCode = 1;
|
|
@@ -491,7 +534,9 @@ async function stopAndWait() {
|
|
|
491
534
|
console.log(managed ? t('stop.stoppedManaged') : t('stop.notRunning'));
|
|
492
535
|
return true;
|
|
493
536
|
}
|
|
494
|
-
const result = await terminateSupervisorPids([...seen]
|
|
537
|
+
const result = await terminateSupervisorPids([...seen], {
|
|
538
|
+
scan: scanCurrentSupervisors,
|
|
539
|
+
});
|
|
495
540
|
if (!result.ok) {
|
|
496
541
|
console.error(t(result.reason === 'scan' ? 'lifecycle.scanFailed' : 'stop.timeout', {
|
|
497
542
|
pids: result.remaining.join(', '),
|
|
@@ -499,6 +544,11 @@ async function stopAndWait() {
|
|
|
499
544
|
process.exitCode = 1;
|
|
500
545
|
return false;
|
|
501
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);
|
|
502
552
|
clearState(HOME);
|
|
503
553
|
console.log(t(result.pids.length > 1 ? 'stop.stoppedMany' : 'stop.stopped', {
|
|
504
554
|
pid: result.pids[0], pids: result.pids.join(', '),
|
|
@@ -508,7 +558,7 @@ async function stopAndWait() {
|
|
|
508
558
|
async function status() {
|
|
509
559
|
const st = readState(HOME);
|
|
510
560
|
const installed = currentVersion();
|
|
511
|
-
const supervisors =
|
|
561
|
+
const supervisors = scanCurrentSupervisors();
|
|
512
562
|
if (!supervisors.ok)
|
|
513
563
|
console.warn(t('status.scanFailed'));
|
|
514
564
|
const stateAlive = !!(st && isAlive(st.supervisorPid));
|
|
@@ -617,7 +667,7 @@ async function serviceInstall() {
|
|
|
617
667
|
// Converge a pre-existing manual run (and any old broken managed/manual pair) before loading the service.
|
|
618
668
|
// Otherwise the very first `service install` can itself create two supervisors fighting over one port.
|
|
619
669
|
const existing = readState(HOME);
|
|
620
|
-
const supervisors =
|
|
670
|
+
const supervisors = scanCurrentSupervisors();
|
|
621
671
|
if (!supervisors.ok) {
|
|
622
672
|
console.error(t('lifecycle.scanFailed'));
|
|
623
673
|
process.exitCode = 1;
|
|
@@ -629,7 +679,7 @@ async function serviceInstall() {
|
|
|
629
679
|
}
|
|
630
680
|
const args = supervisorLaunchArgs(cfg, { home: HOME, entry: SELF });
|
|
631
681
|
try {
|
|
632
|
-
installService(args, { home: HOME });
|
|
682
|
+
installService(args, { home: HOME, environment: serviceEnvironment() });
|
|
633
683
|
}
|
|
634
684
|
catch (error) {
|
|
635
685
|
console.error(t('err.generic', { msg: errorMessage(error) }));
|
package/dist/build-meta.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.33.
|
|
3
|
-
"buildId": "
|
|
4
|
-
"sourceHash": "sha256:
|
|
2
|
+
"version": "0.33.2",
|
|
3
|
+
"buildId": "4db6407c552d",
|
|
4
|
+
"sourceHash": "sha256:27331c27420f7e001596f1f148d0f42c0aab2c34188a445fff87efdbc2d92f1e"
|
|
5
5
|
}
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "handmux",
|
|
3
|
-
"version": "0.33.
|
|
3
|
+
"version": "0.33.2",
|
|
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.2",
|
|
80
|
+
"date": "2026-10-03",
|
|
81
|
+
"zh": "修复 v0.33.1 发布包的构建兼容问题",
|
|
82
|
+
"en": "Fixes build compatibility in the v0.33.1 package"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"version": "0.33.1",
|
|
86
|
+
"date": "2026-10-02",
|
|
87
|
+
"zh": "对话复制和工作区操作更顺手",
|
|
88
|
+
"en": "Smoother conversation copying and workspace actions"
|
|
89
|
+
},
|
|
78
90
|
{
|
|
79
91
|
"version": "0.33.0",
|
|
80
92
|
"date": "2026-09-30",
|
|
@@ -110,18 +122,6 @@
|
|
|
110
122
|
"date": "2026-09-19",
|
|
111
123
|
"zh": "文档预览全面升级:朗读、目录、查找、图表",
|
|
112
124
|
"en": "A full document reader: read-aloud, outline, search, diagrams"
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
"version": "0.29.2",
|
|
116
|
-
"date": "2026-09-18",
|
|
117
|
-
"zh": "修复 Linux 下 Claude 事件上报的兼容问题",
|
|
118
|
-
"en": "Compatibility fix for Claude event reporting on Linux"
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
"version": "0.29.1",
|
|
122
|
-
"date": "2026-09-18",
|
|
123
|
-
"zh": "修复 Claude 对话入口丢失 · 长时间运行不再变卡",
|
|
124
|
-
"en": "Fix lost Claude chat entries · no slowdown after long runs"
|
|
125
125
|
}
|
|
126
126
|
]
|
|
127
127
|
}
|
package/dist/public/assets/{abnfDiagram-O67JEVCF-D1FBJlXT.js → abnfDiagram-O67JEVCF-CEQgAYi1.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-BdympnRg.js";import{p as f}from"./chunk-JWPE2WC7-Bz98Hu8d.js";import{c as a,aH as o}from"./mermaid.core-BVBLuQ4L.js";import{M as c,c as d}from"./cynefin-OW5HDTMX-BjiH0OhR.js";import"./index-CTECnRDI.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-BVBLuQ4L.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};
|