@yorz/cli 0.8.3 → 0.9.3
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/cli/index.js +104 -58
- package/dist/cli/serve-launcher.cjs +56 -0
- package/dist/gui/assets/abnfDiagram-VRR7QNED-BXdYbq3y.js +1 -0
- package/dist/gui/assets/arc-BDaL1Z0T.js +1 -0
- package/dist/gui/assets/architectureDiagram-ZJ3FMSHR-DBV2eI0R.js +36 -0
- package/dist/gui/assets/blockDiagram-677ZJIJ3-BukUw8ke.js +132 -0
- package/dist/gui/assets/c4Diagram-LMCZKHZV-BQRLrFmd.js +10 -0
- package/dist/gui/assets/channel-CmM-rnSu.js +1 -0
- package/dist/gui/assets/chunk-2Q5K7J3B-Bb01F4JY.js +1 -0
- package/dist/gui/assets/chunk-32BRIVSS-D_fmYp0w.js +1 -0
- package/dist/gui/assets/chunk-5VM5RSS4-CSVRyWUl.js +15 -0
- package/dist/gui/assets/chunk-EX3LRPZG-0tMlNePS.js +231 -0
- package/dist/gui/assets/chunk-JWPE2WC7-BjMvMllJ.js +1 -0
- package/dist/gui/assets/chunk-MOJQB5TN-kCAEgJRp.js +88 -0
- package/dist/gui/assets/chunk-RYQCIY6F-Bux4XgPK.js +1 -0
- package/dist/gui/assets/chunk-V7JOEXUC-BP87KF_P.js +206 -0
- package/dist/gui/assets/chunk-VR4S4FIN-DTiqIx-p.js +1 -0
- package/dist/gui/assets/chunk-XXDRQBXY-B7k8EFM_.js +1 -0
- package/dist/gui/assets/classDiagram-OUVF2IWQ-foBbbuIG.js +1 -0
- package/dist/gui/assets/classDiagram-v2-EOCWNBFH-foBbbuIG.js +1 -0
- package/dist/gui/assets/cose-bilkent-JH36ORCC-BaKMo0vy.js +1 -0
- package/dist/gui/assets/cynefin-VYW2F7L2-DzMBSujh.js +178 -0
- package/dist/gui/assets/cynefinDiagram-TSTJHNR4-BeUiEs05.js +62 -0
- package/dist/gui/assets/dagre-VKFMJZFB-Ds02vw0z.js +4 -0
- package/dist/gui/assets/diagram-FQU43EPY-CMCJAQGZ.js +3 -0
- package/dist/gui/assets/diagram-G47NLZAW-BsBRMo6j.js +24 -0
- package/dist/gui/assets/diagram-NH7WQ7WH-C4WG9hEr.js +24 -0
- package/dist/gui/assets/diagram-OA4YK3LP-BA2cjwAc.js +30 -0
- package/dist/gui/assets/diagram-WEI45ONY-DE9_2qZ8.js +41 -0
- package/dist/gui/assets/ebnfDiagram-CCIWWBDH-BL7vwncJ.js +1 -0
- package/dist/gui/assets/erDiagram-Q63AITRT-rCrtODep.js +85 -0
- package/dist/gui/assets/flowDiagram-23GEKE2U-DcgdUDC_.js +156 -0
- package/dist/gui/assets/ganttDiagram-NO4QXBWP-BsWsRaQX.js +292 -0
- package/dist/gui/assets/gitGraphDiagram-IHSO6WYX-Bh16bq4A.js +106 -0
- package/dist/gui/assets/index-e5JFp5J1.css +1 -0
- package/dist/gui/assets/index-oIjkNbg4.js +34 -0
- package/dist/gui/assets/infoDiagram-FWYZ7A6U-CKRUUIby.js +2 -0
- package/dist/gui/assets/ishikawaDiagram-FXEZZL3T-CEMvAMgC.js +70 -0
- package/dist/gui/assets/journeyDiagram-5HDEW3XC-hPSE5KSG.js +139 -0
- package/dist/gui/assets/kanban-definition-HUTT4EX6-D2JIKO0d.js +89 -0
- package/dist/gui/assets/linear-1sIzYuR6.js +1 -0
- package/dist/gui/assets/mermaid.core-_0eTmAI-.js +314 -0
- package/dist/gui/assets/mindmap-definition-LN4V7U3C-Pci6rYHR.js +96 -0
- package/dist/gui/assets/pegDiagram-2B236MQR-q2F8rPpc.js +1 -0
- package/dist/gui/assets/pieDiagram-ENE6RG2P-Bxs2H0I9.js +39 -0
- package/dist/gui/assets/quadrantDiagram-ABIIQ3AL-jhiPHiLV.js +7 -0
- package/dist/gui/assets/railroadDiagram-RFXS5EU6-DLkA9HFf.js +1 -0
- package/dist/gui/assets/requirementDiagram-TGXJPOKE-DmqV2XMZ.js +84 -0
- package/dist/gui/assets/sankeyDiagram-HTMAVEWB-DKKUsQKC.js +40 -0
- package/dist/gui/assets/sequenceDiagram-DBY2YBRQ-DFX-fI6J.js +162 -0
- package/dist/gui/assets/sizeCapture-X5ZJPWSS-dcpaI63h.js +1 -0
- package/dist/gui/assets/stateDiagram-2N3HPSRC-DOBn8whp.js +1 -0
- package/dist/gui/assets/stateDiagram-v2-6OUMAXLB-CSydFa0j.js +1 -0
- package/dist/gui/assets/swimlanes-5IMT3BWC-CrvE3E_z.js +2 -0
- package/dist/gui/assets/swimlanesDiagram-G3AALYLV-CqM-5nJs.js +8 -0
- package/dist/gui/assets/timeline-definition-FHXFAJF6-Cg8Rxg6S.js +120 -0
- package/dist/gui/assets/vennDiagram-L72KCM5P-CgwpgHPj.js +34 -0
- package/dist/gui/assets/wardleyDiagram-EHGQE667-Cnc-fgIC.js +78 -0
- package/dist/gui/assets/xychartDiagram-FW5EYKEG-Do9QbE6u.js +7 -0
- package/dist/gui/index.html +2 -2
- package/dist/{gui/assets/abnfDiagram-VRR7QNED-D4D9enbi.js → gui-mobile/assets/abnfDiagram-VRR7QNED-3aNc_9tC.js} +1 -1
- package/dist/{gui/assets/arc-Uhg-Jaz0.js → gui-mobile/assets/arc-BinP16HO.js} +1 -1
- package/dist/{gui/assets/architectureDiagram-ZJ3FMSHR-CCovxlgK.js → gui-mobile/assets/architectureDiagram-ZJ3FMSHR-DPaYnoe2.js} +1 -1
- package/dist/{gui/assets/blockDiagram-677ZJIJ3-BVUdWBA7.js → gui-mobile/assets/blockDiagram-677ZJIJ3-CcdgoWjg.js} +1 -1
- package/dist/{gui/assets/c4Diagram-LMCZKHZV-jKUs8qBl.js → gui-mobile/assets/c4Diagram-LMCZKHZV-Dt-ebUaz.js} +1 -1
- package/dist/gui-mobile/assets/channel-BwGfICk5.js +1 -0
- package/dist/{gui/assets/chunk-2Q5K7J3B-BQ1pmtPO.js → gui-mobile/assets/chunk-2Q5K7J3B-Dkn1JJmn.js} +1 -1
- package/dist/{gui/assets/chunk-32BRIVSS-CokJqC_m.js → gui-mobile/assets/chunk-32BRIVSS-Cou5wk8N.js} +1 -1
- package/dist/{gui/assets/chunk-5VM5RSS4-BsTyU26_.js → gui-mobile/assets/chunk-5VM5RSS4-DE1VWYBj.js} +1 -1
- package/dist/{gui/assets/chunk-EX3LRPZG-BtG1531e.js → gui-mobile/assets/chunk-EX3LRPZG-DIJfdh0r.js} +1 -1
- package/dist/{gui/assets/chunk-JWPE2WC7-CRJtNYf7.js → gui-mobile/assets/chunk-JWPE2WC7-DMTNZnRa.js} +1 -1
- package/dist/{gui/assets/chunk-MOJQB5TN-CuSjoqFP.js → gui-mobile/assets/chunk-MOJQB5TN-C37wZo1y.js} +1 -1
- package/dist/{gui/assets/chunk-RYQCIY6F-Dvq5myJ5.js → gui-mobile/assets/chunk-RYQCIY6F-B00F7z4X.js} +1 -1
- package/dist/{gui/assets/chunk-V7JOEXUC-2oWWymhr.js → gui-mobile/assets/chunk-V7JOEXUC-BBhJsm6x.js} +1 -1
- package/dist/{gui/assets/chunk-VR4S4FIN-BufsuH8E.js → gui-mobile/assets/chunk-VR4S4FIN-BaRfY0Qz.js} +1 -1
- package/dist/{gui/assets/chunk-XXDRQBXY-CZ-nS8L-.js → gui-mobile/assets/chunk-XXDRQBXY-DLP_jCaJ.js} +1 -1
- package/dist/gui-mobile/assets/classDiagram-OUVF2IWQ-BC5JEZFR.js +1 -0
- package/dist/gui-mobile/assets/classDiagram-v2-EOCWNBFH-BC5JEZFR.js +1 -0
- package/dist/{gui/assets/cose-bilkent-JH36ORCC-Gr6ZaATw.js → gui-mobile/assets/cose-bilkent-JH36ORCC--rhAXZui.js} +1 -1
- package/dist/{gui/assets/cynefin-VYW2F7L2-C5199IEw.js → gui-mobile/assets/cynefin-VYW2F7L2-DP4VQrg7.js} +1 -1
- package/dist/{gui/assets/cynefinDiagram-TSTJHNR4-D6fiPl1f.js → gui-mobile/assets/cynefinDiagram-TSTJHNR4-CQ3yGfYY.js} +1 -1
- package/dist/gui-mobile/assets/cytoscape.esm-OyMbaexL.js +331 -0
- package/dist/{gui/assets/dagre-VKFMJZFB-Bn8knEMn.js → gui-mobile/assets/dagre-VKFMJZFB-BbgmZx8f.js} +1 -1
- package/dist/gui-mobile/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/dist/{gui/assets/diagram-FQU43EPY-DVBF68AQ.js → gui-mobile/assets/diagram-FQU43EPY-B3ayJYFS.js} +1 -1
- package/dist/{gui/assets/diagram-G47NLZAW-BZ5yrrkI.js → gui-mobile/assets/diagram-G47NLZAW-CqXfBP6i.js} +1 -1
- package/dist/{gui/assets/diagram-NH7WQ7WH-pzIgTU3E.js → gui-mobile/assets/diagram-NH7WQ7WH-DPg20-Zs.js} +1 -1
- package/dist/{gui/assets/diagram-OA4YK3LP-CPaJk9pC.js → gui-mobile/assets/diagram-OA4YK3LP-DF9IybfH.js} +1 -1
- package/dist/{gui/assets/diagram-WEI45ONY-B-6GmQvM.js → gui-mobile/assets/diagram-WEI45ONY-BSAcECq5.js} +1 -1
- package/dist/{gui/assets/ebnfDiagram-CCIWWBDH-Bv1oxmeZ.js → gui-mobile/assets/ebnfDiagram-CCIWWBDH-BhJETAAk.js} +1 -1
- package/dist/{gui/assets/erDiagram-Q63AITRT-W41uQrQk.js → gui-mobile/assets/erDiagram-Q63AITRT-DWpkkPmJ.js} +1 -1
- package/dist/{gui/assets/flowDiagram-23GEKE2U-CHxHJDVM.js → gui-mobile/assets/flowDiagram-23GEKE2U-CHAjzU36.js} +1 -1
- package/dist/{gui/assets/ganttDiagram-NO4QXBWP-BUF9vvnT.js → gui-mobile/assets/ganttDiagram-NO4QXBWP-B3b1yqDR.js} +1 -1
- package/dist/{gui/assets/gitGraphDiagram-IHSO6WYX-CdMyc006.js → gui-mobile/assets/gitGraphDiagram-IHSO6WYX-BqRTGYY0.js} +1 -1
- package/dist/gui-mobile/assets/graph-DOmOIIwC.js +1 -0
- package/dist/gui-mobile/assets/index-BABBu2VR.css +1 -0
- package/dist/gui-mobile/assets/index-BwPHOQF7.js +33 -0
- package/dist/{gui/assets/infoDiagram-FWYZ7A6U-tOoSyFtd.js → gui-mobile/assets/infoDiagram-FWYZ7A6U-4PN9nRxs.js} +1 -1
- package/dist/gui-mobile/assets/init-Gi6I4Gst.js +1 -0
- package/dist/{gui/assets/ishikawaDiagram-FXEZZL3T-xzmSx4q7.js → gui-mobile/assets/ishikawaDiagram-FXEZZL3T-wzGQWfQz.js} +1 -1
- package/dist/gui-mobile/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
- package/dist/gui-mobile/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
- package/dist/gui-mobile/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
- package/dist/gui-mobile/assets/jetbrains-mono-latin-500-normal-CJOVTJB7.woff +0 -0
- package/dist/gui-mobile/assets/jetbrains-mono-latin-700-normal-BYuf6tUa.woff2 +0 -0
- package/dist/gui-mobile/assets/jetbrains-mono-latin-700-normal-D3wTyLJW.woff +0 -0
- package/dist/{gui/assets/journeyDiagram-5HDEW3XC-DDNB6MLL.js → gui-mobile/assets/journeyDiagram-5HDEW3XC-C0pTHZiP.js} +1 -1
- package/dist/{gui/assets/kanban-definition-HUTT4EX6-Bh-NqXAp.js → gui-mobile/assets/kanban-definition-HUTT4EX6-D_XwIFzm.js} +1 -1
- package/dist/gui-mobile/assets/katex-HP8lGamR.js +257 -0
- package/dist/gui-mobile/assets/layout-D-LzfAck.js +1 -0
- package/dist/{gui/assets/linear-BJWCgfrh.js → gui-mobile/assets/linear-DHPIiHoC.js} +1 -1
- package/dist/gui-mobile/assets/map-DxJ2ADlA.js +1 -0
- package/dist/{gui/assets/mermaid.core-DmUdNrWd.js → gui-mobile/assets/mermaid.core-DWa29NaI.js} +4 -4
- package/dist/{gui/assets/mindmap-definition-LN4V7U3C-CcwHk-9p.js → gui-mobile/assets/mindmap-definition-LN4V7U3C-BsAz9DiI.js} +1 -1
- package/dist/gui-mobile/assets/ordinal-Cboi1Yqb.js +1 -0
- package/dist/{gui/assets/pegDiagram-2B236MQR-DrnMrY4L.js → gui-mobile/assets/pegDiagram-2B236MQR-k9xbtGjh.js} +1 -1
- package/dist/{gui/assets/pieDiagram-ENE6RG2P-B5fQVAQi.js → gui-mobile/assets/pieDiagram-ENE6RG2P-vrMiQFQU.js} +1 -1
- package/dist/{gui/assets/quadrantDiagram-ABIIQ3AL-WcAQ7c3t.js → gui-mobile/assets/quadrantDiagram-ABIIQ3AL-C0mOJrSQ.js} +1 -1
- package/dist/{gui/assets/railroadDiagram-RFXS5EU6-CvhuJF1y.js → gui-mobile/assets/railroadDiagram-RFXS5EU6-BuXb1GwD.js} +1 -1
- package/dist/{gui/assets/requirementDiagram-TGXJPOKE-DOsKohKX.js → gui-mobile/assets/requirementDiagram-TGXJPOKE-zuyAg5UY.js} +1 -1
- package/dist/{gui/assets/sankeyDiagram-HTMAVEWB-vLfbJPAx.js → gui-mobile/assets/sankeyDiagram-HTMAVEWB-C5rsz_9V.js} +1 -1
- package/dist/{gui/assets/sequenceDiagram-DBY2YBRQ-DxKy0CAM.js → gui-mobile/assets/sequenceDiagram-DBY2YBRQ-CJPJqG5C.js} +1 -1
- package/dist/{gui/assets/sizeCapture-X5ZJPWSS-BE5SU9rY.js → gui-mobile/assets/sizeCapture-X5ZJPWSS-Dfmt1n7j.js} +1 -1
- package/dist/{gui/assets/stateDiagram-2N3HPSRC-Ct8Gvq1y.js → gui-mobile/assets/stateDiagram-2N3HPSRC-CcuZbZ-q.js} +1 -1
- package/dist/gui-mobile/assets/stateDiagram-v2-6OUMAXLB-D1oP_d1q.js +1 -0
- package/dist/{gui/assets/swimlanes-5IMT3BWC-0c9e31Te.js → gui-mobile/assets/swimlanes-5IMT3BWC-C3tNR3sN.js} +2 -2
- package/dist/gui-mobile/assets/swimlanesDiagram-G3AALYLV-auRnO-sL.js +8 -0
- package/dist/{gui/assets/timeline-definition-FHXFAJF6-D0m2eIpy.js → gui-mobile/assets/timeline-definition-FHXFAJF6-DJxPM33l.js} +1 -1
- package/dist/{gui/assets/vennDiagram-L72KCM5P-BnM9fTPa.js → gui-mobile/assets/vennDiagram-L72KCM5P-C95GuO2U.js} +1 -1
- package/dist/{gui/assets/wardleyDiagram-EHGQE667-BKyR-aXS.js → gui-mobile/assets/wardleyDiagram-EHGQE667-ULJzIJRO.js} +1 -1
- package/dist/gui-mobile/assets/workbox-window.prod.es5-BBnX5xw4.js +2 -0
- package/dist/{gui/assets/xychartDiagram-FW5EYKEG-Dr3zUp02.js → gui-mobile/assets/xychartDiagram-FW5EYKEG-X6HGdnuS.js} +1 -1
- package/dist/gui-mobile/icons/apple-touch-icon.png +0 -0
- package/dist/gui-mobile/icons/favicon-32.png +0 -0
- package/dist/gui-mobile/icons/icon-192.png +0 -0
- package/dist/gui-mobile/icons/icon-512.png +0 -0
- package/dist/gui-mobile/icons/maskable-512.png +0 -0
- package/dist/gui-mobile/index.html +74 -0
- package/dist/gui-mobile/manifest.webmanifest +1 -0
- package/dist/gui-mobile/sw.js +1 -0
- package/dist/gui-mobile/workbox-9c191d2f.js +1 -0
- package/package.json +9 -3
- package/dist/gui/assets/channel-C2ymEZyD.js +0 -1
- package/dist/gui/assets/classDiagram-OUVF2IWQ-BL75FVt0.js +0 -1
- package/dist/gui/assets/classDiagram-v2-EOCWNBFH-BL75FVt0.js +0 -1
- package/dist/gui/assets/index-Auit67b0.js +0 -40
- package/dist/gui/assets/index-bzRYB8_7.css +0 -1
- package/dist/gui/assets/stateDiagram-v2-6OUMAXLB-BZ2lYeO3.js +0 -1
- package/dist/gui/assets/swimlanesDiagram-G3AALYLV-BLfYiUPF.js +0 -8
package/dist/cli/index.js
CHANGED
|
@@ -7,11 +7,11 @@ import { createHash, randomUUID, randomBytes } from "node:crypto";
|
|
|
7
7
|
import { existsSync, openSync, closeSync, statSync, readSync, mkdirSync, watch, createReadStream } from "node:fs";
|
|
8
8
|
import { execFile, spawn, execFileSync } from "node:child_process";
|
|
9
9
|
import { promisify } from "node:util";
|
|
10
|
+
import { fileURLToPath } from "node:url";
|
|
10
11
|
import { serve } from "@hono/node-server";
|
|
11
12
|
import { isIP } from "node:net";
|
|
12
13
|
import { Hono } from "hono";
|
|
13
14
|
import { streamSSE } from "hono/streaming";
|
|
14
|
-
import { fileURLToPath } from "node:url";
|
|
15
15
|
import trash from "trash";
|
|
16
16
|
import matter from "gray-matter";
|
|
17
17
|
import chokidar from "chokidar";
|
|
@@ -23,7 +23,7 @@ import { createOpencode } from "@opencode-ai/sdk";
|
|
|
23
23
|
import { createInterface as createInterface$1 } from "node:readline/promises";
|
|
24
24
|
import MarkdownIt from "markdown-it";
|
|
25
25
|
const name = "@yorz/cli";
|
|
26
|
-
const version = "0.
|
|
26
|
+
const version = "0.9.3";
|
|
27
27
|
const type = "module";
|
|
28
28
|
const description = "";
|
|
29
29
|
const bin = { "yorz": "./dist/cli/index.js" };
|
|
@@ -34,9 +34,9 @@ const license = "LGPL-3.0-or-later";
|
|
|
34
34
|
const repository = { "type": "git", "url": "git+https://github.com/hughfenghen/YorZ.git" };
|
|
35
35
|
const homepage = "https://github.com/hughfenghen/YorZ#readme";
|
|
36
36
|
const publishConfig = { "access": "public" };
|
|
37
|
-
const scripts = { "build": "pnpm run build:cli && pnpm run build:gui", "build:cli": "vite build", "build:gui": "vite build --config vite.gui.config.ts", "dev:cli": "pnpm run build:cli && node dist/cli/index.js serve --port 7424 --foreground", "dev:gui": "vite --config vite.gui.config.ts", "typecheck": "tsc -b", "test": "vitest run", "test:agent": "node scripts/test-agent.mjs", "test:e2e": "pnpm run build && playwright test", "format": 'prettier --write "src/**/*.{ts,tsx,md,css}"', "prepublishOnly": "pnpm run build" };
|
|
37
|
+
const scripts = { "build": "pnpm run build:cli && pnpm run build:gui && pnpm run build:gui-mobile", "build:cli": "vite build", "build:gui": "vite build --config vite.gui.config.ts", "build:gui-mobile": "vite build --config vite.gui-mobile.config.ts", "dev:cli": "pnpm run build:cli && node dist/cli/index.js serve --port 7424 --foreground", "dev:gui": "vite --config vite.gui.config.ts", "dev:gui-mobile": "vite --config vite.gui-mobile.config.ts", "gen:mobile-icons": "node scripts/gen-mobile-icons.mjs", "typecheck": "tsc -b", "test": "vitest run", "test:agent": "node scripts/test-agent.mjs", "test:e2e": "pnpm run build && playwright test", "format": 'prettier --write "src/**/*.{ts,tsx,md,css}"', "prepare": "node scripts/setup-git-hooks.mjs", "prepublishOnly": "pnpm run build" };
|
|
38
38
|
const dependencies = { "@anthropic-ai/claude-agent-sdk": "^0.3.207", "@hono/node-server": "^2.0.4", "@openai/codex-sdk": "^0.144.1", "@opencode-ai/sdk": "^1.17.18", "chokidar": "^5.0.0", "commander": "^12.1.0", "gray-matter": "^4.0.3", "hono": "^4.12.25", "jsdom": "^25.0.1", "markdown-it": "^14.2.0", "mermaid": "^11.0.0", "morphdom": "^2.7.8", "parse-diff": "^0.12.0", "timeago.js": "^4.0.2", "trash": "^10.1.1" };
|
|
39
|
-
const devDependencies = { "@fontsource/jetbrains-mono": "^5.3.0", "@kobalte/core": "^0.13.12", "@playwright/test": "^1.61.0", "@solidjs/router": "^0.16.1", "@types/jsdom": "^21.1.7", "@types/markdown-it": "^14.1.2", "@types/node": "^22.10.0", "autoprefixer": "^10.5.2", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "concurrently": "^9.1.0", "highlight.js": "^11.11.1", "i18next": "^26.3.6", "i18next-browser-languagedetector": "^8.2.1", "lucide-solid": "^1.24.0", "markdown-it-task-lists": "^2.1.1", "postcss": "^8.5.16", "prettier": "^3.4.0", "solid-js": "^1.9.13", "tailwind-merge": "^3.6.0", "tailwindcss": "^3.4.19", "tailwindcss-animate": "^1.0.7", "typescript": "^5.7.0", "vite": "^6.0.0", "vite-plugin-solid": "^2.11.12", "vitest": "^2.1.0" };
|
|
39
|
+
const devDependencies = { "@fontsource/jetbrains-mono": "^5.3.0", "@kobalte/core": "^0.13.12", "@playwright/test": "^1.61.0", "@solidjs/router": "^0.16.1", "@types/jsdom": "^21.1.7", "@types/markdown-it": "^14.1.2", "@types/node": "^22.10.0", "autoprefixer": "^10.5.2", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "concurrently": "^9.1.0", "highlight.js": "^11.11.1", "i18next": "^26.3.6", "i18next-browser-languagedetector": "^8.2.1", "lucide-solid": "^1.24.0", "markdown-it-task-lists": "^2.1.1", "postcss": "^8.5.16", "prettier": "^3.4.0", "solid-js": "^1.9.13", "tailwind-merge": "^3.6.0", "tailwindcss": "^3.4.19", "tailwindcss-animate": "^1.0.7", "typescript": "^5.7.0", "vite": "^6.0.0", "vite-plugin-pwa": "^1.3.0", "vite-plugin-solid": "^2.11.12", "vitest": "^2.1.0", "workbox-window": "^7.4.1" };
|
|
40
40
|
const pkg = {
|
|
41
41
|
name,
|
|
42
42
|
version,
|
|
@@ -2352,12 +2352,6 @@ function normalizeAgent(value) {
|
|
|
2352
2352
|
if (kind === "inherit") return { kind: "inherit" };
|
|
2353
2353
|
if (kind === "opencode") return { kind: "opencode" };
|
|
2354
2354
|
if (kind === "codex") return { kind: "codex" };
|
|
2355
|
-
if (kind === "custom") {
|
|
2356
|
-
const cmd = typeof obj.cmd === "string" ? obj.cmd.trim() : "";
|
|
2357
|
-
if (!cmd) return { kind: "claude" };
|
|
2358
|
-
const args = Array.isArray(obj.args) ? obj.args.filter((a) => typeof a === "string") : [];
|
|
2359
|
-
return { kind: "custom", cmd, args };
|
|
2360
|
-
}
|
|
2361
2355
|
return { kind: "claude" };
|
|
2362
2356
|
}
|
|
2363
2357
|
function normalizeSpecsDir(value) {
|
|
@@ -2638,6 +2632,17 @@ async function partitionPathsByStatus(cwd, paths) {
|
|
|
2638
2632
|
}
|
|
2639
2633
|
return result;
|
|
2640
2634
|
}
|
|
2635
|
+
function pathsNeedingStage(changes, paths) {
|
|
2636
|
+
const byPath = new Map(changes.map((c) => [c.path, c]));
|
|
2637
|
+
const out = [];
|
|
2638
|
+
for (const p of paths) {
|
|
2639
|
+
const change = byPath.get(p);
|
|
2640
|
+
if (!change) continue;
|
|
2641
|
+
if (change.worktree === " ") continue;
|
|
2642
|
+
out.push(p);
|
|
2643
|
+
}
|
|
2644
|
+
return out;
|
|
2645
|
+
}
|
|
2641
2646
|
async function commit(cwd, opts) {
|
|
2642
2647
|
const message = opts.message?.trim() ?? "";
|
|
2643
2648
|
if (!message) throw new GitError("invalid_message", "commit message must not be empty");
|
|
@@ -2645,10 +2650,8 @@ async function commit(cwd, opts) {
|
|
|
2645
2650
|
throw new GitError("no_paths", "commit requires at least one path");
|
|
2646
2651
|
}
|
|
2647
2652
|
for (const p of opts.paths) assertSafeRelativePath(cwd, p);
|
|
2648
|
-
const
|
|
2649
|
-
|
|
2650
|
-
const allPaths = [...opts.paths, ...extraPaths];
|
|
2651
|
-
await runGit(cwd, ["add", "--", ...allPaths]);
|
|
2653
|
+
const toStage = pathsNeedingStage(await listChanges(cwd), opts.paths);
|
|
2654
|
+
if (toStage.length) await runGit(cwd, ["add", "--", ...toStage]);
|
|
2652
2655
|
const committed = await runGitRaw(cwd, ["commit", "-m", message]);
|
|
2653
2656
|
if (committed.code !== 0) {
|
|
2654
2657
|
const detail = `${committed.stdout}
|
|
@@ -3586,27 +3589,7 @@ function parseAgent(value) {
|
|
|
3586
3589
|
if (kind === "claude") return { value: { kind: "claude" } };
|
|
3587
3590
|
if (kind === "opencode") return { value: { kind: "opencode" } };
|
|
3588
3591
|
if (kind === "codex") return { value: { kind: "codex" } };
|
|
3589
|
-
|
|
3590
|
-
const cmd = obj.cmd;
|
|
3591
|
-
if (typeof cmd !== "string" || !cmd.trim()) {
|
|
3592
|
-
return { error: "agent.cmd required when kind=custom" };
|
|
3593
|
-
}
|
|
3594
|
-
if (cmd.length > 500) return { error: "agent.cmd too long (max 500)" };
|
|
3595
|
-
const argsRaw = obj.args;
|
|
3596
|
-
let args = [];
|
|
3597
|
-
if (argsRaw !== void 0) {
|
|
3598
|
-
if (!Array.isArray(argsRaw)) return { error: "agent.args must be an array of strings" };
|
|
3599
|
-
args = [];
|
|
3600
|
-
for (const a of argsRaw) {
|
|
3601
|
-
if (typeof a !== "string") return { error: "agent.args entries must be strings" };
|
|
3602
|
-
if (a.length > 500) return { error: "agent.args entry too long (max 500)" };
|
|
3603
|
-
args.push(a);
|
|
3604
|
-
}
|
|
3605
|
-
if (args.length > 64) return { error: "agent.args too many entries (max 64)" };
|
|
3606
|
-
}
|
|
3607
|
-
return { value: { kind: "custom", cmd: cmd.trim(), args } };
|
|
3608
|
-
}
|
|
3609
|
-
return { error: "agent.kind must be inherit | claude | opencode | codex | custom" };
|
|
3592
|
+
return { error: "agent.kind must be inherit | claude | opencode | codex" };
|
|
3610
3593
|
}
|
|
3611
3594
|
function parseSpecsDir(value) {
|
|
3612
3595
|
const fallback = defaultProjectConfig().specsDir;
|
|
@@ -5024,17 +5007,38 @@ const MIME = {
|
|
|
5024
5007
|
".mjs": "text/javascript; charset=utf-8",
|
|
5025
5008
|
".css": "text/css; charset=utf-8",
|
|
5026
5009
|
".json": "application/json; charset=utf-8",
|
|
5010
|
+
// PWA 清单:用 application/json 也能跑,但 Chrome 的安装性检查会报警告
|
|
5011
|
+
".webmanifest": "application/manifest+json; charset=utf-8",
|
|
5027
5012
|
".svg": "image/svg+xml",
|
|
5028
5013
|
".png": "image/png",
|
|
5029
5014
|
".jpg": "image/jpeg",
|
|
5015
|
+
".webp": "image/webp",
|
|
5030
5016
|
".ico": "image/x-icon",
|
|
5017
|
+
// 自托管字体:类型错了 Firefox 会直接拒绝加载
|
|
5018
|
+
".woff": "font/woff",
|
|
5019
|
+
".woff2": "font/woff2",
|
|
5031
5020
|
".map": "application/json; charset=utf-8"
|
|
5032
5021
|
};
|
|
5022
|
+
const MOBILE_PREFIX = "/m";
|
|
5033
5023
|
function createStaticRoutes(guiRoot) {
|
|
5034
5024
|
const root = guiRoot ?? defaultGuiRoot();
|
|
5025
|
+
const mobileRoot = resolve(root, "..", "gui-mobile");
|
|
5035
5026
|
const app = new Hono();
|
|
5027
|
+
app.get(MOBILE_PREFIX, (c) => c.redirect(`${MOBILE_PREFIX}/`));
|
|
5028
|
+
app.get(`${MOBILE_PREFIX}/*`, async (c) => {
|
|
5029
|
+
const subPath = c.req.path.slice(MOBILE_PREFIX.length) || "/";
|
|
5030
|
+
const file = resolveStaticFile(mobileRoot, subPath);
|
|
5031
|
+
if (file) return serveFile(c, file);
|
|
5032
|
+
const indexPath = join(mobileRoot, "index.html");
|
|
5033
|
+
if (existsSync(indexPath)) return serveFile(c, indexPath);
|
|
5034
|
+
return c.text(
|
|
5035
|
+
"YorZ mobile GUI is not built. Run `pnpm build:gui-mobile` first, then reload this page.",
|
|
5036
|
+
503
|
|
5037
|
+
);
|
|
5038
|
+
});
|
|
5036
5039
|
app.get("*", async (c) => {
|
|
5037
5040
|
if (c.req.path.startsWith("/api")) return c.notFound();
|
|
5041
|
+
if (c.req.path === "/" && isMobileRequest(c)) return c.redirect(`${MOBILE_PREFIX}/`);
|
|
5038
5042
|
const file = resolveStaticFile(root, c.req.path);
|
|
5039
5043
|
if (file) return serveFile(c, file);
|
|
5040
5044
|
const indexPath = join(root, "index.html");
|
|
@@ -5043,6 +5047,12 @@ function createStaticRoutes(guiRoot) {
|
|
|
5043
5047
|
});
|
|
5044
5048
|
return app;
|
|
5045
5049
|
}
|
|
5050
|
+
function isMobileRequest(c) {
|
|
5051
|
+
const ua = c.req.header("user-agent") ?? "";
|
|
5052
|
+
const chMobile = c.req.header("sec-ch-ua-mobile");
|
|
5053
|
+
if (chMobile === "?1") return true;
|
|
5054
|
+
return /Android|iPhone|iPad|iPod|Mobile/i.test(ua);
|
|
5055
|
+
}
|
|
5046
5056
|
function defaultGuiRoot() {
|
|
5047
5057
|
try {
|
|
5048
5058
|
const here = dirname(fileURLToPath(import.meta.url));
|
|
@@ -5068,8 +5078,12 @@ function resolveStaticFile(root, urlPath) {
|
|
|
5068
5078
|
}
|
|
5069
5079
|
async function serveFile(c, file) {
|
|
5070
5080
|
const body = await readFile(file);
|
|
5071
|
-
const
|
|
5081
|
+
const ext = extname(file);
|
|
5082
|
+
const mime = MIME[ext] ?? "application/octet-stream";
|
|
5072
5083
|
c.header("Content-Type", mime);
|
|
5084
|
+
if (ext === ".html" || /\bsw\.js$/.test(file) || /\bregisterSW\.js$/.test(file)) {
|
|
5085
|
+
c.header("Cache-Control", "no-cache");
|
|
5086
|
+
}
|
|
5073
5087
|
return c.body(body);
|
|
5074
5088
|
}
|
|
5075
5089
|
const DEBOUNCE_MS = 200;
|
|
@@ -7225,7 +7239,19 @@ class OpenCodeAdapter {
|
|
|
7225
7239
|
booting = null;
|
|
7226
7240
|
async ensure() {
|
|
7227
7241
|
if (!this.booting) {
|
|
7228
|
-
this.booting = createOpencode({
|
|
7242
|
+
this.booting = createOpencode({
|
|
7243
|
+
hostname: "127.0.0.1",
|
|
7244
|
+
port: 0,
|
|
7245
|
+
config: {
|
|
7246
|
+
permission: {
|
|
7247
|
+
edit: "allow",
|
|
7248
|
+
bash: "allow",
|
|
7249
|
+
webfetch: "allow",
|
|
7250
|
+
doom_loop: "allow",
|
|
7251
|
+
external_directory: "allow"
|
|
7252
|
+
}
|
|
7253
|
+
}
|
|
7254
|
+
}).catch((err) => {
|
|
7229
7255
|
this.booting = null;
|
|
7230
7256
|
throw err;
|
|
7231
7257
|
});
|
|
@@ -8484,17 +8510,14 @@ function startBackgroundServe(opts) {
|
|
|
8484
8510
|
const entry = process.argv[1];
|
|
8485
8511
|
if (!entry) throw new Error("Cannot resolve CLI entrypoint for background service");
|
|
8486
8512
|
const stdio = backgroundStdio();
|
|
8487
|
-
const child =
|
|
8488
|
-
detached: true,
|
|
8489
|
-
stdio: stdio.stdio
|
|
8490
|
-
});
|
|
8491
|
-
child.unref();
|
|
8513
|
+
const child = spawnBackgroundWorker([entry, "serve", ...backgroundArgs(opts)], stdio.stdio);
|
|
8492
8514
|
log().info("background service spawned", {
|
|
8493
8515
|
pid: child.pid,
|
|
8516
|
+
viaLauncher: process.platform === "win32",
|
|
8494
8517
|
stdioFile: stdio.path,
|
|
8495
8518
|
logFile: getLogger().filePath
|
|
8496
8519
|
});
|
|
8497
|
-
const runtime = await waitForRuntime(
|
|
8520
|
+
const runtime = await waitForRuntime(void 0, START_WAIT_MS);
|
|
8498
8521
|
if (!runtime) {
|
|
8499
8522
|
log().warn("timed out waiting for runtime.json", {
|
|
8500
8523
|
pid: child.pid,
|
|
@@ -8503,12 +8526,13 @@ function startBackgroundServe(opts) {
|
|
|
8503
8526
|
}
|
|
8504
8527
|
const port = runtime?.port ?? opts.port ?? DEFAULT_SERVE_PORT;
|
|
8505
8528
|
const url = runtime?.url ?? `http://localhost:${port}/`;
|
|
8506
|
-
|
|
8529
|
+
const servicePid = runtime?.pid ?? child.pid;
|
|
8530
|
+
console.log(`YorZ Service started in background (pid=${servicePid ?? "unknown"}).`);
|
|
8507
8531
|
console.log(`Open ${url}${runtime ? "" : ` (or the next free port if ${port} is busy).`}`);
|
|
8508
8532
|
console.log(`Stop with: yorz serve stop`);
|
|
8509
8533
|
return {
|
|
8510
8534
|
background: true,
|
|
8511
|
-
pid:
|
|
8535
|
+
pid: servicePid,
|
|
8512
8536
|
url,
|
|
8513
8537
|
port
|
|
8514
8538
|
};
|
|
@@ -8535,6 +8559,26 @@ function restartWorkerArgs(opts) {
|
|
|
8535
8559
|
args.push("--skip-skill-check");
|
|
8536
8560
|
return args;
|
|
8537
8561
|
}
|
|
8562
|
+
function resolveServeLauncherPath() {
|
|
8563
|
+
return join(dirname(fileURLToPath(import.meta.url)), "serve-launcher.cjs");
|
|
8564
|
+
}
|
|
8565
|
+
function backgroundWorkerSpawnArgv(launcherPath, execPath, workerArgv) {
|
|
8566
|
+
return [launcherPath, "--", execPath, ...workerArgv];
|
|
8567
|
+
}
|
|
8568
|
+
function spawnBackgroundWorker(workerArgv, stdio) {
|
|
8569
|
+
if (process.platform === "win32") {
|
|
8570
|
+
const launcher = spawnWithoutWindow(
|
|
8571
|
+
process.execPath,
|
|
8572
|
+
backgroundWorkerSpawnArgv(resolveServeLauncherPath(), process.execPath, workerArgv),
|
|
8573
|
+
{ detached: true, stdio }
|
|
8574
|
+
);
|
|
8575
|
+
launcher.unref();
|
|
8576
|
+
return launcher;
|
|
8577
|
+
}
|
|
8578
|
+
const child = spawnWithoutWindow(process.execPath, workerArgv, { detached: true, stdio });
|
|
8579
|
+
child.unref();
|
|
8580
|
+
return child;
|
|
8581
|
+
}
|
|
8538
8582
|
async function runRestartServe(opts = {}) {
|
|
8539
8583
|
silenceConsoleMirror();
|
|
8540
8584
|
if (opts.worker) {
|
|
@@ -8545,12 +8589,8 @@ async function runRestartServe(opts = {}) {
|
|
|
8545
8589
|
}
|
|
8546
8590
|
const entry = process.argv[1];
|
|
8547
8591
|
if (!entry) throw new Error("Cannot resolve CLI entrypoint for restart");
|
|
8548
|
-
|
|
8549
|
-
|
|
8550
|
-
stdio: "ignore"
|
|
8551
|
-
});
|
|
8552
|
-
child.unref();
|
|
8553
|
-
console.log(`YorZ Service restart scheduled (pid=${child.pid ?? "unknown"}).`);
|
|
8592
|
+
spawnBackgroundWorker([entry, ...restartWorkerArgs(opts)], "ignore");
|
|
8593
|
+
console.log(`YorZ Service restart scheduled.`);
|
|
8554
8594
|
}
|
|
8555
8595
|
async function ensureSkillsInstalledWithLog(cwd) {
|
|
8556
8596
|
const results = await ensureSkillsInstalled({ cwd });
|
|
@@ -8722,7 +8762,7 @@ async function waitForRuntime(pid, timeoutMs) {
|
|
|
8722
8762
|
const until = Date.now() + timeoutMs;
|
|
8723
8763
|
while (Date.now() < until) {
|
|
8724
8764
|
const live = await readLiveProcesses();
|
|
8725
|
-
const match = live.find((p) => pid === void 0
|
|
8765
|
+
const match = live.find((p) => pid === void 0);
|
|
8726
8766
|
if (match) return match;
|
|
8727
8767
|
await sleep(100);
|
|
8728
8768
|
}
|
|
@@ -8883,12 +8923,18 @@ async function readWindowsProcessSnapshot(pid) {
|
|
|
8883
8923
|
"if ($null -eq $p) { exit 1 }",
|
|
8884
8924
|
"$p | Select-Object CommandLine,CreationDate | ConvertTo-Json -Compress"
|
|
8885
8925
|
].join("; ");
|
|
8886
|
-
const { stdout } = await execFileAsync(
|
|
8887
|
-
"
|
|
8888
|
-
|
|
8889
|
-
|
|
8890
|
-
|
|
8891
|
-
|
|
8926
|
+
const { stdout } = await execFileAsync(
|
|
8927
|
+
"powershell.exe",
|
|
8928
|
+
[
|
|
8929
|
+
"-NoProfile",
|
|
8930
|
+
"-NonInteractive",
|
|
8931
|
+
"-Command",
|
|
8932
|
+
script
|
|
8933
|
+
],
|
|
8934
|
+
// 后台 Service 进程(detached,无控制台)内执行时,缺 windowsHide 会弹出
|
|
8935
|
+
// 可见的 PowerShell 窗口;前台终端调用则继承控制台,本就无影响。
|
|
8936
|
+
{ windowsHide: true }
|
|
8937
|
+
);
|
|
8892
8938
|
const parsed = JSON.parse(stdout.trim());
|
|
8893
8939
|
const commandLine = typeof parsed.CommandLine === "string" ? parsed.CommandLine : "";
|
|
8894
8940
|
const processStartedAt = typeof parsed.CreationDate === "string" ? parsed.CreationDate : void 0;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Windows 后台 Service 的中间 launcher(CommonJS,不参与打包,构建时原样复制到
|
|
3
|
+
* dist/cli/)。
|
|
4
|
+
*
|
|
5
|
+
* 为什么需要它:后台 worker 若以 DETACHED_PROCESS 直接启动,进程没有任何控制台,
|
|
6
|
+
* 它内部 SDK 裸 spawn 的 console 子程序(codex / opencode server 等)会被
|
|
7
|
+
* Windows 分配**可见**控制台——这就是启动服务 / 切 session 时闪现空白 cmd 弹窗
|
|
8
|
+
* 的根源。
|
|
9
|
+
*
|
|
10
|
+
* 解法:launcher 用 CREATE_NO_WINDOW(Node 的 windowsHide + 非 detached)拉起
|
|
11
|
+
* worker。CREATE_NO_WINDOW 的进程持有一个"无窗口的控制台",worker 内 SDK 裸
|
|
12
|
+
* spawn 的 console 子程序继承它,不再新建可见窗口。
|
|
13
|
+
*
|
|
14
|
+
* launcher 随后**驻留为 worker 的父进程守卫**:不主动退出,直到 worker 退出才
|
|
15
|
+
* 退出(并把 worker 的退出状态写入 stderr,即 serve-stdio.log)。这样 worker
|
|
16
|
+
* 始终是有父进程的普通子进程,不依赖"孤儿进程在各类终端/安全软件环境下能否
|
|
17
|
+
* 存活"的语义差异;`yorz serve stop` 终止 worker 后 launcher 自然退出,不残留。
|
|
18
|
+
* 代价是常驻一个空闲的 node 进程。
|
|
19
|
+
*
|
|
20
|
+
* 用法:node serve-launcher.cjs -- <execPath> <workerArgs...>
|
|
21
|
+
* worker 的 stdio 通过 'inherit' 接管 launcher 的 fd 0/1/2,而 launcher 自身的
|
|
22
|
+
* stdio 由调用方(serve.ts)定向到服务日志文件——worker 的未捕获输出因此仍落
|
|
23
|
+
* 到 serve-stdio.log,与旧的直接传 fd 语义一致。
|
|
24
|
+
*
|
|
25
|
+
* 已知坑(实测):worker 的 stdio 不能用 `stdio: ['ignore', 1, 2]` 数字 fd
|
|
26
|
+
* 形式——Windows 上该路径的 handle 传递会让 worker 静默死在初始化阶段;
|
|
27
|
+
* 'inherit' 走 libuv 的专门路径,实测正常。
|
|
28
|
+
*/
|
|
29
|
+
'use strict'
|
|
30
|
+
|
|
31
|
+
const { spawn } = require('child_process')
|
|
32
|
+
|
|
33
|
+
const sep = process.argv.indexOf('--')
|
|
34
|
+
const workerArgv = sep === -1 ? [] : process.argv.slice(sep + 1)
|
|
35
|
+
if (workerArgv.length < 2) {
|
|
36
|
+
process.stderr.write('[serve-launcher] missing worker argv after "--"\n')
|
|
37
|
+
process.exit(1)
|
|
38
|
+
}
|
|
39
|
+
// workerArgv 形如 [execPath, ...args];spawn 的 file 与 args 必须拆开——
|
|
40
|
+
// 若把 execPath 留在 args 里,node 会把它当作脚本路径执行而立即失败。
|
|
41
|
+
const [workerExecutable, ...workerArgs] = workerArgv
|
|
42
|
+
|
|
43
|
+
// 关键:非 detached + windowsHide => CREATE_NO_WINDOW => worker 拥有无窗口控制台。
|
|
44
|
+
const child = spawn(workerExecutable, workerArgs, {
|
|
45
|
+
windowsHide: true,
|
|
46
|
+
stdio: 'inherit',
|
|
47
|
+
})
|
|
48
|
+
child.once('error', (err) => {
|
|
49
|
+
process.stderr.write(`[serve-launcher] failed to start worker: ${err}\n`)
|
|
50
|
+
process.exit(1)
|
|
51
|
+
})
|
|
52
|
+
child.once('exit', (code, signal) => {
|
|
53
|
+
// worker 无论正常停止还是崩溃,launcher 都随之退出,保持父进程树干净。
|
|
54
|
+
process.stderr.write(`[serve-launcher] worker exited code=${code} signal=${signal}\n`)
|
|
55
|
+
process.exit(0)
|
|
56
|
+
})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-kCAEgJRp.js";import{p as f}from"./chunk-JWPE2WC7-BjMvMllJ.js";import{_ as n,l as o}from"./mermaid.core-_0eTmAI-.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-DzMBSujh.js";import"./index-oIjkNbg4.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(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=n(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=n(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=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.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:a}},B={parser:R,db:a,renderer:u,styles:p};export{B as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Y as ln,$ as an,a0 as F,a1 as q,a2 as j,a3 as un,a4 as y,a5 as tn,a6 as J,a7 as _,a8 as rn,a9 as o,aa as on,ab as sn,ac as fn}from"./mermaid.core-_0eTmAI-.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,I,D,v,A,z,a){var O=I-l,i=D-h,n=z-v,d=a-A,u=d*O-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function U(l,h,I,D,v,A,z){var a=l-I,O=h-D,i=(z?A:-A)/J(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,B=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,S=(g<0?-1:1)*J(on(0,T*T*R-P*P)),Y=(P*g-m*S)/R,$=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=Y-B,e=$-t,r=w-B,C=p-t;return x*x+e*e>r*r+C*C&&(Y=w,$=p),{cx:Y,cy:$,x01:-n,y01:-d,x11:Y*(v/T-1),y11:$*(v/T-1)}}function hn(){var l=cn,h=yn,I=j(0),D=null,v=gn,A=dn,z=mn,a=null,O=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,B=rn(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(B>tn-y)a.moveTo(s*F(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*F(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=B,S=B,Y=z.apply(this,arguments)/2,$=Y>y&&(D?+D.apply(this,arguments):J(u*u+s*s)),w=_(rn(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if($>y){var C=sn($/u*q(Y)),K=sn($/s*q(Y));(P-=C*2)>y?(C*=t?1:-1,R+=C,T-=C):(P=0,R=T=(f+c)/2),(S-=K*2)>y?(K*=t?1:-1,m+=K,g-=K):(S=0,m=g=(f+c)/2)}var G=s*F(m),H=s*q(m),L=u*F(T),M=u*q(T);if(w>y){var N=s*F(g),Q=s*q(g),V=u*F(R),W=u*q(R),E;if(B<an)if(E=pn(G,H,V,W,N,Q,L,M)){var X=G-E[0],Z=H-E[1],b=N-E[0],k=Q-E[1],nn=1/q(fn((X*b+Z*k)/(J(X*X+Z*Z)*J(b*b+k*k)))/2),en=J(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>y?x>y?(e=U(V,W,G,H,s,x,t),r=U(N,Q,L,M,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(G,H),a.arc(0,0,s,m,g,!t)):a.moveTo(G,H),!(u>y)||!(P>y)?a.lineTo(L,M):p>y?(e=U(L,M,N,Q,u,-p,t),r=U(G,H,V,W,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}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[F(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:j(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:j(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:j(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:j(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:j(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:j(+n),i):A},i.padAngle=function(n){return arguments.length?(z=typeof n=="function"?n:j(+n),i):z},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
|