@yorz/cli 0.8.2 → 0.9.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/cli/index.js +134 -59
- package/dist/gui/assets/abnfDiagram-VRR7QNED-CvFCe3r_.js +1 -0
- package/dist/gui/assets/arc-BR65Sp8N.js +1 -0
- package/dist/gui/assets/architectureDiagram-ZJ3FMSHR-AiVGAt8P.js +36 -0
- package/dist/gui/assets/blockDiagram-677ZJIJ3-HuFROz1l.js +132 -0
- package/dist/gui/assets/c4Diagram-LMCZKHZV-Cgt15wDO.js +10 -0
- package/dist/gui/assets/channel-DWjIfFiO.js +1 -0
- package/dist/gui/assets/chunk-2Q5K7J3B-ByMpzo_7.js +1 -0
- package/dist/gui/assets/chunk-32BRIVSS-LHwTDCaD.js +1 -0
- package/dist/gui/assets/chunk-5VM5RSS4-CXrS6z-4.js +15 -0
- package/dist/gui/assets/chunk-EX3LRPZG-Bw7a0zH3.js +231 -0
- package/dist/gui/assets/chunk-JWPE2WC7-wFaiogOx.js +1 -0
- package/dist/gui/assets/chunk-MOJQB5TN-CC4tXc_1.js +88 -0
- package/dist/gui/assets/chunk-RYQCIY6F-BzMRf9sh.js +1 -0
- package/dist/gui/assets/chunk-V7JOEXUC-DXF9bAuV.js +206 -0
- package/dist/gui/assets/chunk-VR4S4FIN-DlTRKb1a.js +1 -0
- package/dist/gui/assets/chunk-XXDRQBXY-kVTuzkcL.js +1 -0
- package/dist/gui/assets/classDiagram-OUVF2IWQ-I21k2As-.js +1 -0
- package/dist/gui/assets/classDiagram-v2-EOCWNBFH-I21k2As-.js +1 -0
- package/dist/gui/assets/cose-bilkent-JH36ORCC-BAqcUvRT.js +1 -0
- package/dist/gui/assets/cynefin-VYW2F7L2-BKxPBlKv.js +178 -0
- package/dist/gui/assets/cynefinDiagram-TSTJHNR4-B30nmSKx.js +62 -0
- package/dist/gui/assets/dagre-VKFMJZFB-B_6xJi_I.js +4 -0
- package/dist/gui/assets/diagram-FQU43EPY-DSPwTKxt.js +3 -0
- package/dist/gui/assets/diagram-G47NLZAW-CE6kku8E.js +24 -0
- package/dist/gui/assets/diagram-NH7WQ7WH-Dz_3pmyJ.js +24 -0
- package/dist/gui/assets/diagram-OA4YK3LP-9K6njZVx.js +30 -0
- package/dist/gui/assets/diagram-WEI45ONY-Dq-7pg1u.js +41 -0
- package/dist/gui/assets/ebnfDiagram-CCIWWBDH-DqkXLemr.js +1 -0
- package/dist/gui/assets/erDiagram-Q63AITRT-DwCKeJjN.js +85 -0
- package/dist/gui/assets/flowDiagram-23GEKE2U-BItXJm0z.js +156 -0
- package/dist/gui/assets/ganttDiagram-NO4QXBWP-B7F8aBqd.js +292 -0
- package/dist/gui/assets/gitGraphDiagram-IHSO6WYX-DOTmWDXD.js +106 -0
- package/dist/gui/assets/index-CkGO8Fpq.js +34 -0
- package/dist/gui/assets/index-e5JFp5J1.css +1 -0
- package/dist/gui/assets/infoDiagram-FWYZ7A6U-CH94-RWl.js +2 -0
- package/dist/gui/assets/ishikawaDiagram-FXEZZL3T-DnPsPjhE.js +70 -0
- package/dist/gui/assets/journeyDiagram-5HDEW3XC-IxNPj9DL.js +139 -0
- package/dist/gui/assets/kanban-definition-HUTT4EX6-CnEFBR_5.js +89 -0
- package/dist/gui/assets/linear-C76lB0Op.js +1 -0
- package/dist/gui/assets/mermaid.core-rkuoyu1Y.js +314 -0
- package/dist/gui/assets/mindmap-definition-LN4V7U3C-Cp4m5M8t.js +96 -0
- package/dist/gui/assets/pegDiagram-2B236MQR-OpqvRJRn.js +1 -0
- package/dist/gui/assets/pieDiagram-ENE6RG2P-CA2NTDmg.js +39 -0
- package/dist/gui/assets/quadrantDiagram-ABIIQ3AL-1wgAkd5_.js +7 -0
- package/dist/gui/assets/railroadDiagram-RFXS5EU6-D8sNxc-D.js +1 -0
- package/dist/gui/assets/requirementDiagram-TGXJPOKE-B_BAewjP.js +84 -0
- package/dist/gui/assets/sankeyDiagram-HTMAVEWB-D5yRszAY.js +40 -0
- package/dist/gui/assets/sequenceDiagram-DBY2YBRQ-xLRttR6a.js +162 -0
- package/dist/gui/assets/sizeCapture-X5ZJPWSS-uA8UtQtp.js +1 -0
- package/dist/gui/assets/stateDiagram-2N3HPSRC-JLfWMf-y.js +1 -0
- package/dist/gui/assets/stateDiagram-v2-6OUMAXLB-m9lGgZDF.js +1 -0
- package/dist/gui/assets/swimlanes-5IMT3BWC-DzNlggdg.js +2 -0
- package/dist/gui/assets/swimlanesDiagram-G3AALYLV-67oDFDZ3.js +8 -0
- package/dist/gui/assets/timeline-definition-FHXFAJF6-DisxBENp.js +120 -0
- package/dist/gui/assets/vennDiagram-L72KCM5P-B29R19dw.js +34 -0
- package/dist/gui/assets/wardleyDiagram-EHGQE667-B5eqpyg8.js +78 -0
- package/dist/gui/assets/xychartDiagram-FW5EYKEG-BFhk2kj2.js +7 -0
- package/dist/gui/index.html +2 -2
- package/dist/{gui/assets/abnfDiagram-VRR7QNED-gKm9Q_A3.js → gui-mobile/assets/abnfDiagram-VRR7QNED-dO2fe8On.js} +1 -1
- package/dist/{gui/assets/arc-CrUCh7Vt.js → gui-mobile/assets/arc-BBWQwcOX.js} +1 -1
- package/dist/{gui/assets/architectureDiagram-ZJ3FMSHR-CMSfijC7.js → gui-mobile/assets/architectureDiagram-ZJ3FMSHR-BdDouhRk.js} +1 -1
- package/dist/{gui/assets/blockDiagram-677ZJIJ3-p05lGQvB.js → gui-mobile/assets/blockDiagram-677ZJIJ3-CyfQcEAp.js} +1 -1
- package/dist/{gui/assets/c4Diagram-LMCZKHZV-Bv-YyQUO.js → gui-mobile/assets/c4Diagram-LMCZKHZV-BDwCd8AJ.js} +1 -1
- package/dist/gui-mobile/assets/channel-BH91jO0g.js +1 -0
- package/dist/{gui/assets/chunk-2Q5K7J3B-k4bjrCUS.js → gui-mobile/assets/chunk-2Q5K7J3B-C21jFDT7.js} +1 -1
- package/dist/{gui/assets/chunk-32BRIVSS-kWhk22-t.js → gui-mobile/assets/chunk-32BRIVSS-DYcgMwLC.js} +1 -1
- package/dist/{gui/assets/chunk-5VM5RSS4-CQ-OF-jm.js → gui-mobile/assets/chunk-5VM5RSS4-DHUChIkE.js} +1 -1
- package/dist/{gui/assets/chunk-EX3LRPZG-BCGCkTIr.js → gui-mobile/assets/chunk-EX3LRPZG-BsiOO0cg.js} +1 -1
- package/dist/{gui/assets/chunk-JWPE2WC7-BxQu3HdL.js → gui-mobile/assets/chunk-JWPE2WC7-DwRFcp8M.js} +1 -1
- package/dist/{gui/assets/chunk-MOJQB5TN-DkB3CKU9.js → gui-mobile/assets/chunk-MOJQB5TN-CZAIa8xj.js} +1 -1
- package/dist/{gui/assets/chunk-RYQCIY6F-62-xl5oz.js → gui-mobile/assets/chunk-RYQCIY6F-CjiSByKd.js} +1 -1
- package/dist/{gui/assets/chunk-V7JOEXUC-DLidRBp5.js → gui-mobile/assets/chunk-V7JOEXUC-C5X5gobg.js} +1 -1
- package/dist/{gui/assets/chunk-VR4S4FIN-CelmZEAj.js → gui-mobile/assets/chunk-VR4S4FIN-BG4Ho3oM.js} +1 -1
- package/dist/{gui/assets/chunk-XXDRQBXY-CZXSrEO5.js → gui-mobile/assets/chunk-XXDRQBXY-Cy55QGn1.js} +1 -1
- package/dist/gui-mobile/assets/classDiagram-OUVF2IWQ-DI_HWJF7.js +1 -0
- package/dist/gui-mobile/assets/classDiagram-v2-EOCWNBFH-DI_HWJF7.js +1 -0
- package/dist/{gui/assets/cose-bilkent-JH36ORCC-BJZADzHX.js → gui-mobile/assets/cose-bilkent-JH36ORCC-k5DcB7wy.js} +1 -1
- package/dist/{gui/assets/cynefin-VYW2F7L2-2kv3gQiJ.js → gui-mobile/assets/cynefin-VYW2F7L2-D0zs5vNv.js} +1 -1
- package/dist/{gui/assets/cynefinDiagram-TSTJHNR4-BJrGGRZT.js → gui-mobile/assets/cynefinDiagram-TSTJHNR4-CfH5z8jt.js} +1 -1
- package/dist/gui-mobile/assets/cytoscape.esm-OyMbaexL.js +331 -0
- package/dist/{gui/assets/dagre-VKFMJZFB-C2Eq7ks1.js → gui-mobile/assets/dagre-VKFMJZFB-WliPW3Tx.js} +1 -1
- package/dist/gui-mobile/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/dist/{gui/assets/diagram-FQU43EPY-DrIQap5j.js → gui-mobile/assets/diagram-FQU43EPY-CdurYY3r.js} +1 -1
- package/dist/{gui/assets/diagram-G47NLZAW-D3qrZmEa.js → gui-mobile/assets/diagram-G47NLZAW-CJFcYT7j.js} +1 -1
- package/dist/{gui/assets/diagram-NH7WQ7WH-BiV6-mMS.js → gui-mobile/assets/diagram-NH7WQ7WH-Covs7EOO.js} +1 -1
- package/dist/{gui/assets/diagram-OA4YK3LP-zJhDVFfZ.js → gui-mobile/assets/diagram-OA4YK3LP-c_vARYuP.js} +1 -1
- package/dist/{gui/assets/diagram-WEI45ONY-CDimAYs_.js → gui-mobile/assets/diagram-WEI45ONY-B8DLNiMy.js} +1 -1
- package/dist/{gui/assets/ebnfDiagram-CCIWWBDH-CCcf1QsU.js → gui-mobile/assets/ebnfDiagram-CCIWWBDH-dOuQRK-3.js} +1 -1
- package/dist/{gui/assets/erDiagram-Q63AITRT-Q8tGhvrZ.js → gui-mobile/assets/erDiagram-Q63AITRT-BosAgKfh.js} +1 -1
- package/dist/{gui/assets/flowDiagram-23GEKE2U-3alKs_Q2.js → gui-mobile/assets/flowDiagram-23GEKE2U-HWFThTdv.js} +1 -1
- package/dist/{gui/assets/ganttDiagram-NO4QXBWP-UwtLj5mp.js → gui-mobile/assets/ganttDiagram-NO4QXBWP-CJGUZTqX.js} +1 -1
- package/dist/{gui/assets/gitGraphDiagram-IHSO6WYX-BkdZNrvw.js → gui-mobile/assets/gitGraphDiagram-IHSO6WYX-D1j9Ff_z.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-BWC60m5U.js +33 -0
- package/dist/{gui/assets/infoDiagram-FWYZ7A6U-AtNZOkv_.js → gui-mobile/assets/infoDiagram-FWYZ7A6U-5Gq_R5ny.js} +1 -1
- package/dist/gui-mobile/assets/init-Gi6I4Gst.js +1 -0
- package/dist/{gui/assets/ishikawaDiagram-FXEZZL3T-fzZ3wFB-.js → gui-mobile/assets/ishikawaDiagram-FXEZZL3T-DZAckb0K.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-CaInQL3L.js → gui-mobile/assets/journeyDiagram-5HDEW3XC-B4ejke91.js} +1 -1
- package/dist/{gui/assets/kanban-definition-HUTT4EX6-BzazGxe7.js → gui-mobile/assets/kanban-definition-HUTT4EX6-CKIlESkz.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-FkI6GUdc.js → gui-mobile/assets/linear-DjghM5B6.js} +1 -1
- package/dist/gui-mobile/assets/map-DxJ2ADlA.js +1 -0
- package/dist/{gui/assets/mermaid.core-Dy3NGXqh.js → gui-mobile/assets/mermaid.core-Cery4OJZ.js} +4 -4
- package/dist/{gui/assets/mindmap-definition-LN4V7U3C-BkD5gUUF.js → gui-mobile/assets/mindmap-definition-LN4V7U3C-Bb9PmQcE.js} +1 -1
- package/dist/gui-mobile/assets/ordinal-Cboi1Yqb.js +1 -0
- package/dist/{gui/assets/pegDiagram-2B236MQR-DrzL8aNW.js → gui-mobile/assets/pegDiagram-2B236MQR-Dk6yxZPA.js} +1 -1
- package/dist/{gui/assets/pieDiagram-ENE6RG2P-BrrJjIcV.js → gui-mobile/assets/pieDiagram-ENE6RG2P-9qPsJCKZ.js} +1 -1
- package/dist/{gui/assets/quadrantDiagram-ABIIQ3AL-BvfIaaXh.js → gui-mobile/assets/quadrantDiagram-ABIIQ3AL-CpOioe7x.js} +1 -1
- package/dist/{gui/assets/railroadDiagram-RFXS5EU6-uDh6Eejs.js → gui-mobile/assets/railroadDiagram-RFXS5EU6-CYnrq0_H.js} +1 -1
- package/dist/{gui/assets/requirementDiagram-TGXJPOKE-mq71nhz4.js → gui-mobile/assets/requirementDiagram-TGXJPOKE-Dan1m7mP.js} +1 -1
- package/dist/{gui/assets/sankeyDiagram-HTMAVEWB-hXTichtO.js → gui-mobile/assets/sankeyDiagram-HTMAVEWB-6gqAXG6C.js} +1 -1
- package/dist/{gui/assets/sequenceDiagram-DBY2YBRQ-CgITKOd_.js → gui-mobile/assets/sequenceDiagram-DBY2YBRQ-D-7-OUF6.js} +1 -1
- package/dist/{gui/assets/sizeCapture-X5ZJPWSS-Bg4phjBx.js → gui-mobile/assets/sizeCapture-X5ZJPWSS-Cf4atOsc.js} +1 -1
- package/dist/{gui/assets/stateDiagram-2N3HPSRC-DKBi1ceK.js → gui-mobile/assets/stateDiagram-2N3HPSRC-CBem3dqE.js} +1 -1
- package/dist/gui-mobile/assets/stateDiagram-v2-6OUMAXLB-BQUCaoqO.js +1 -0
- package/dist/{gui/assets/swimlanes-5IMT3BWC-BotNlXJq.js → gui-mobile/assets/swimlanes-5IMT3BWC-CTxpjyu6.js} +2 -2
- package/dist/gui-mobile/assets/swimlanesDiagram-G3AALYLV-B6OThFgb.js +8 -0
- package/dist/{gui/assets/timeline-definition-FHXFAJF6-xPORA673.js → gui-mobile/assets/timeline-definition-FHXFAJF6-sxn38dUp.js} +1 -1
- package/dist/{gui/assets/vennDiagram-L72KCM5P-9lcR-L8Q.js → gui-mobile/assets/vennDiagram-L72KCM5P-BI_Xsfbx.js} +1 -1
- package/dist/{gui/assets/wardleyDiagram-EHGQE667-CLRUHnek.js → gui-mobile/assets/wardleyDiagram-EHGQE667-1DzhpDmv.js} +1 -1
- package/dist/gui-mobile/assets/workbox-window.prod.es5-BBnX5xw4.js +2 -0
- package/dist/{gui/assets/xychartDiagram-FW5EYKEG-C-oJxiEj.js → gui-mobile/assets/xychartDiagram-FW5EYKEG-AmEku7SD.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-DjP6myfL.js +0 -1
- package/dist/gui/assets/classDiagram-OUVF2IWQ-CqIEE3-0.js +0 -1
- package/dist/gui/assets/classDiagram-v2-EOCWNBFH-CqIEE3-0.js +0 -1
- package/dist/gui/assets/index-DakqmUCD.js +0 -40
- package/dist/gui/assets/index-bzRYB8_7.css +0 -1
- package/dist/gui/assets/stateDiagram-v2-6OUMAXLB-DSkELjnp.js +0 -1
- package/dist/gui/assets/swimlanesDiagram-G3AALYLV-_zGHZ8dn.js +0 -8
package/dist/cli/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { stat, mkdir, writeFile, rename, readFile, rm, access, cp, readdir, appe
|
|
|
5
5
|
import { join, isAbsolute, resolve, basename as basename$1, dirname, extname, relative, sep, normalize } from "node:path";
|
|
6
6
|
import { createHash, randomUUID, randomBytes } from "node:crypto";
|
|
7
7
|
import { existsSync, openSync, closeSync, statSync, readSync, mkdirSync, watch, createReadStream } from "node:fs";
|
|
8
|
-
import {
|
|
8
|
+
import { execFile, spawn, execFileSync } from "node:child_process";
|
|
9
9
|
import { promisify } from "node:util";
|
|
10
10
|
import { serve } from "@hono/node-server";
|
|
11
11
|
import { isIP } from "node:net";
|
|
@@ -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.2";
|
|
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,
|
|
@@ -482,6 +482,23 @@ const __vite_glob_0_40 = '> **Warning**\n>\n> ## THIS IS AN AUTOGENERATED FILE.
|
|
|
482
482
|
const __vite_glob_0_41 = '> **Warning**\n>\n> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT.\n>\n> ## Please edit the corresponding file in [/packages/mermaid/src/docs/syntax/treemap.md](../../packages/mermaid/src/docs/syntax/treemap.md).\n\n# Treemap Diagram\n\n> A treemap diagram displays hierarchical data as a set of nested rectangles. Each branch of the tree is represented by a rectangle, which is then tiled with smaller rectangles representing sub-branches.\n\n> **Warning**\n> This is a new diagram type in Mermaid. Its syntax may evolve in future versions.\n\n## Introduction\n\nTreemap diagrams are an effective way to visualize hierarchical data and show proportions between categories and subcategories. The size of each rectangle is proportional to the value it represents, making it easy to compare different parts of a hierarchy.\n\nTreemap diagrams are particularly useful for:\n\n- Visualizing hierarchical data structures\n- Comparing proportions between categories\n- Displaying large amounts of hierarchical data in a limited space\n- Identifying patterns and outliers in hierarchical data\n\n## Syntax\n\n```\ntreemap-beta\n"Section 1"\n "Leaf 1.1": 12\n "Section 1.2"\n "Leaf 1.2.1": 12\n"Section 2"\n "Leaf 2.1": 20\n "Leaf 2.2": 25\n```\n\n### Node Definition\n\nNodes in a treemap are defined using the following syntax:\n\n- **Section/Parent nodes**: Defined with quoted text `"Section Name"`\n- **Leaf nodes with values**: Defined with quoted text followed by a colon and value `"Leaf Name": value`\n- **Hierarchy**: Created using indentation (spaces or tabs)\n- **Styling**: Nodes can be styled using the `:::class` syntax\n\n## Examples\n\n### Basic Treemap\n\n```mermaid-example\ntreemap-beta\n"Category A"\n "Item A1": 10\n "Item A2": 20\n"Category B"\n "Item B1": 15\n "Item B2": 25\n```\n\n```mermaid\ntreemap-beta\n"Category A"\n "Item A1": 10\n "Item A2": 20\n"Category B"\n "Item B1": 15\n "Item B2": 25\n```\n\n### Hierarchical Treemap\n\n```mermaid-example\ntreemap-beta\n"Products"\n "Electronics"\n "Phones": 50\n "Computers": 30\n "Accessories": 20\n "Clothing"\n "Men\'s": 40\n "Women\'s": 40\n```\n\n```mermaid\ntreemap-beta\n"Products"\n "Electronics"\n "Phones": 50\n "Computers": 30\n "Accessories": 20\n "Clothing"\n "Men\'s": 40\n "Women\'s": 40\n```\n\n### Treemap with Styling\n\n```mermaid-example\ntreemap-beta\n"Section 1"\n "Leaf 1.1": 12\n "Section 1.2":::class1\n "Leaf 1.2.1": 12\n"Section 2"\n "Leaf 2.1": 20:::class1\n "Leaf 2.2": 25\n "Leaf 2.3": 12\n\nclassDef class1 fill:red,color:blue,stroke:#FFD600;\n```\n\n```mermaid\ntreemap-beta\n"Section 1"\n "Leaf 1.1": 12\n "Section 1.2":::class1\n "Leaf 1.2.1": 12\n"Section 2"\n "Leaf 2.1": 20:::class1\n "Leaf 2.2": 25\n "Leaf 2.3": 12\n\nclassDef class1 fill:red,color:blue,stroke:#FFD600;\n```\n\n## Styling and Configuration\n\nTreemap diagrams can be customized using Mermaid\'s styling and configuration options.\n\n### Using classDef for Styling\n\nYou can define custom styles for nodes using the `classDef` syntax, which is a standard feature across many Mermaid diagram types:\n\n```mermaid-example\ntreemap-beta\n"Main"\n "A": 20\n "B":::important\n "B1": 10\n "B2": 15\n "C": 5\n\nclassDef important fill:#f96,stroke:#333,stroke-width:2px;\n```\n\n```mermaid\ntreemap-beta\n"Main"\n "A": 20\n "B":::important\n "B1": 10\n "B2": 15\n "C": 5\n\nclassDef important fill:#f96,stroke:#333,stroke-width:2px;\n```\n\n### Theme Configuration\n\nYou can customize the colors of your treemap using the theme configuration:\n\n```mermaid-example\n---\nconfig:\n theme: \'forest\'\n---\ntreemap-beta\n"Category A"\n "Item A1": 10\n "Item A2": 20\n"Category B"\n "Item B1": 15\n "Item B2": 25\n```\n\n```mermaid\n---\nconfig:\n theme: \'forest\'\n---\ntreemap-beta\n"Category A"\n "Item A1": 10\n "Item A2": 20\n"Category B"\n "Item B1": 15\n "Item B2": 25\n```\n\n### Diagram Padding\n\nYou can adjust the padding around the treemap diagram using the `diagramPadding` configuration option:\n\n```mermaid-example\n---\nconfig:\n treemap:\n diagramPadding: 200\n---\ntreemap-beta\n"Category A"\n "Item A1": 10\n "Item A2": 20\n"Category B"\n "Item B1": 15\n "Item B2": 25\n```\n\n```mermaid\n---\nconfig:\n treemap:\n diagramPadding: 200\n---\ntreemap-beta\n"Category A"\n "Item A1": 10\n "Item A2": 20\n"Category B"\n "Item B1": 15\n "Item B2": 25\n```\n\n## Configuration Options\n\nThe treemap diagram supports the following configuration options:\n\n| Option | Description | Default |\n| -------------- | --------------------------------------------------------------------------- | ------- |\n| useMaxWidth | When true, the diagram width is set to 100% and scales with available space | true |\n| padding | Internal padding between nodes | 10 |\n| diagramPadding | Padding around the entire diagram | 8 |\n| showValues | Whether to show values in the treemap | true |\n| nodeWidth | Width of nodes | 100 |\n| nodeHeight | Height of nodes | 40 |\n| borderWidth | Width of borders | 1 |\n| valueFontSize | Font size for values | 12 |\n| labelFontSize | Font size for labels | 14 |\n| valueFormat | Format for values (see Value Formatting section) | \',\' |\n\n## Advanced Features\n\n### Value Formatting\n\nValues in treemap diagrams can be formatted to display in different ways using the `valueFormat` configuration option. This option primarily uses [D3\'s format specifiers](https://github.com/d3/d3-format#locale_format) to control how numbers are displayed, with some additional special cases for common formats.\n\nSome common format patterns:\n\n- `,` - Thousands separator (default)\n- `$` - Add dollar sign\n- `.1f` - Show one decimal place\n- `.1%` - Show as percentage with one decimal place\n- `$0,0` - Dollar sign with thousands separator\n- `$.2f` - Dollar sign with 2 decimal places\n- `$,.2f` - Dollar sign with thousands separator and 2 decimal places\n\nThe treemap diagram supports both standard D3 format specifiers and some common currency formats that combine the dollar sign with other formatting options.\n\nExample with currency formatting:\n\n```mermaid-example\n---\nconfig:\n treemap:\n valueFormat: \'$0,0\'\n---\ntreemap-beta\n"Budget"\n "Operations"\n "Salaries": 700000\n "Equipment": 200000\n "Supplies": 100000\n "Marketing"\n "Advertising": 400000\n "Events": 100000\n```\n\n```mermaid\n---\nconfig:\n treemap:\n valueFormat: \'$0,0\'\n---\ntreemap-beta\n"Budget"\n "Operations"\n "Salaries": 700000\n "Equipment": 200000\n "Supplies": 100000\n "Marketing"\n "Advertising": 400000\n "Events": 100000\n```\n\nExample with percentage formatting:\n\n```mermaid-example\n---\nconfig:\n treemap:\n valueFormat: \'$.1%\'\n---\ntreemap-beta\n"Market Share"\n "Company A": 0.35\n "Company B": 0.25\n "Company C": 0.15\n "Others": 0.25\n```\n\n```mermaid\n---\nconfig:\n treemap:\n valueFormat: \'$.1%\'\n---\ntreemap-beta\n"Market Share"\n "Company A": 0.35\n "Company B": 0.25\n "Company C": 0.15\n "Others": 0.25\n```\n\n## Common Use Cases\n\nTreemap diagrams are commonly used for:\n\n1. **Financial Data**: Visualizing budget allocations, market shares, or portfolio compositions\n2. **File System Analysis**: Showing disk space usage by folders and files\n3. **Population Demographics**: Displaying population distribution across regions and subregions\n4. **Product Hierarchies**: Visualizing product categories and their sales volumes\n5. **Organizational Structures**: Representing departments and team sizes in a company\n\n## Limitations\n\n- Treemap diagrams work best when the data has a natural hierarchy\n- Very small values may be difficult to see or label in a treemap diagram\n- Deep hierarchies (many levels) can be challenging to represent clearly\n- Treemap diagrams are not well suited for representing data with negative values\n\n## Related Diagrams\n\nIf treemap diagrams don\'t suit your needs, consider these alternatives:\n\n- [**Pie Charts**](./pie.md): For simple proportion comparisons without hierarchy\n- **Sunburst Diagrams**: For hierarchical data with a radial layout (yet to be released in Mermaid).\n- [**Sankey Diagrams**](./sankey.md): For flow-based hierarchical data\n\n## Notes\n\nThe treemap diagram implementation in Mermaid is designed to be simple to use while providing powerful visualization capabilities. As this is a newer diagram type, feedback and feature requests are welcome through the Mermaid GitHub repository.\n';
|
|
483
483
|
const __vite_glob_0_42 = '> **Warning**\n>\n> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT.\n>\n> ## Please edit the corresponding file in [/packages/mermaid/src/docs/syntax/xyChart.md](../../packages/mermaid/src/docs/syntax/xyChart.md).\n\n# XY Chart\n\n> In the context of mermaid-js, the XY chart is a comprehensive charting module that encompasses various types of charts that utilize both x-axis and y-axis for data representation. Presently, it includes two fundamental chart types: the bar chart and the line chart. These charts are designed to visually display and analyze data that involve two numerical variables.\n\n> It\'s important to note that while the current implementation of mermaid-js includes these two chart types, the framework is designed to be dynamic and adaptable. Therefore, it has the capacity for expansion and the inclusion of additional chart types in the future. This means that users can expect an evolving suite of charting options within the XY chart module, catering to various data visualization needs as new chart types are introduced over time.\n\n## Example\n\n```mermaid-example\nxychart\n title "Sales Revenue"\n x-axis [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]\n y-axis "Revenue (in $)" 4000 --> 11000\n bar [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]\n line [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]\n```\n\n```mermaid\nxychart\n title "Sales Revenue"\n x-axis [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]\n y-axis "Revenue (in $)" 4000 --> 11000\n bar [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]\n line [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]\n```\n\n## Syntax\n\n> **Note**\n> All text values that contain only one word can be written without `"`. If a text value has many words in it, specifically if it contains spaces, enclose the value in `"`\n\n### Orientations\n\nThe chart can be drawn horizontal or vertical, default value is vertical.\n\n```\nxychart horizontal\n...\n```\n\n### Title\n\nThe title is a short description of the chart and it will always render on top of the chart.\n\n#### Example\n\n```\nxychart\n title "This is a simple example"\n ...\n```\n\n> **Note**\n> If the title is a single word one no need to use `"`, but if it has space `"` is needed\n\n### x-axis\n\nThe x-axis primarily serves as a categorical value, although it can also function as a numeric range value when needed.\n\n#### Example\n\n1. `x-axis title min --> max` x-axis will function as numeric with the given range\n2. `x-axis "title with space" [cat1, "cat2 with space", cat3]` x-axis if categorical, categories are text type\n\n### y-axis\n\nThe y-axis is employed to represent numerical range values, it cannot have categorical values.\n\n#### Example\n\n1. `y-axis title min --> max`\n2. `y-axis title` it will only add the title, the range will be auto generated from data.\n\n> **Note**\n> Both x and y axis are optional if not provided we will try to create the range\n\n### Line chart\n\nA line chart offers the capability to graphically depict lines.\n\n#### Example\n\n1. `line [2.3, 45, .98, -3.4]` it can have all valid numeric values.\n2. `line "series name" [2.3, 45, .98, -3.4]` adds the line to the legend.\n\n### Bar chart\n\nA bar chart offers the capability to graphically depict bars.\n\n#### Example\n\n1. `bar [2.3, 45, .98, -3.4]` it can have all valid numeric values.\n2. `bar "series name" [2.3, 45, .98, -3.4]` adds the bar to the legend.\n\n### Legend (v\\<MERMAID_RELEASE_VERSION>+)\n\nNamed line and bar plots are automatically shown in a legend. Unnamed plots are omitted from the legend.\n\n```mermaid-example\nxychart-beta\n title "An Example Chart"\n x-axis ["90d", "60d", "30d", "7d", "1d", "Current"]\n y-axis "Seconds" 0 --> 198.2\n line "avg" [48.1, 41.5, 45.7, 72.8, 67.7, 59.9]\n line "p50" [38.2, 36.8, 39.7, 54.5, 49.0, 38.4]\n line "p95" [112.2, 75.3, 103.0, 177.0, 180.2, 109.4]\n```\n\n```mermaid\nxychart-beta\n title "An Example Chart"\n x-axis ["90d", "60d", "30d", "7d", "1d", "Current"]\n y-axis "Seconds" 0 --> 198.2\n line "avg" [48.1, 41.5, 45.7, 72.8, 67.7, 59.9]\n line "p50" [38.2, 36.8, 39.7, 54.5, 49.0, 38.4]\n line "p95" [112.2, 75.3, 103.0, 177.0, 180.2, 109.4]\n```\n\n#### Simplest example\n\nThe only two things required are the chart name (`xychart`) and one data set. So you will be able to draw a chart with a simple config like\n\n```\nxychart\n line [+1.3, .6, 2.4, -.34]\n```\n\n## Chart Configurations\n\n| Parameter | Description | Default value |\n| ------------------------ | ------------------------------------------------------------- | :-----------: |\n| width | Width of the chart | 700 |\n| height | Height of the chart | 500 |\n| titlePadding | Top and Bottom padding of the title | 10 |\n| titleFontSize | Title font size | 20 |\n| showTitle | Title to be shown or not | true |\n| showLegend | Legend to be shown for named plots or not | true |\n| legendFontSize | Legend font size | 14 |\n| legendPadding | Padding around the legend | 10 |\n| xAxis | xAxis configuration | AxisConfig |\n| yAxis | yAxis configuration | AxisConfig |\n| chartOrientation | \'vertical\' or \'horizontal\' | \'vertical\' |\n| plotReservedSpacePercent | Minimum space plots will take inside the chart | 50 |\n| showDataLabel | Should show the value corresponding to the bar within the bar | false |\n| showDataLabelOutsideBar | If showing data label then show it outside the bar. | false |\n\n### AxisConfig\n\n| Parameter | Description | Default value |\n| ------------- | ------------------------------------------------------------ | :-----------: |\n| showLabel | Show axis labels or tick values | true |\n| labelFontSize | Font size of the label to be drawn | 14 |\n| labelPadding | Top and Bottom padding of the label | 5 |\n| showTitle | Axis title to be shown or not | true |\n| titleFontSize | Axis title font size | 16 |\n| titlePadding | Top and Bottom padding of Axis title | 5 |\n| showTick | Tick to be shown or not | true |\n| tickLength | How long the tick will be | 5 |\n| tickWidth | How width the tick will be | 2 |\n| showAxisLine | Axis line to be shown or not | true |\n| axisLineWidth | Thickness of the axis line | 2 |\n| labelRotation | Label rotation in degrees (only applicable on bottom X axis) | 0 |\n\n## Chart Theme Variables\n\nThemes for xychart reside inside the `xychart` attribute, allowing customization through the following syntax:\n\n```yaml\n---\nconfig:\n themeVariables:\n xyChart:\n titleColor: \'#ff0000\'\n---\n```\n\n| Parameter | Description |\n| ---------------- | --------------------------------------------------------- |\n| backgroundColor | Background color of the whole chart |\n| titleColor | Color of the Title text |\n| dataLabelColor | Color of the Data labels (if shown) |\n| legendTextColor | Color of the legend text |\n| xAxisLabelColor | Color of the x-axis labels |\n| xAxisTitleColor | Color of the x-axis title |\n| xAxisTickColor | Color of the x-axis tick |\n| xAxisLineColor | Color of the x-axis line |\n| yAxisLabelColor | Color of the y-axis labels |\n| yAxisTitleColor | Color of the y-axis title |\n| yAxisTickColor | Color of the y-axis tick |\n| yAxisLineColor | Color of the y-axis line |\n| plotColorPalette | String of colors separated by comma e.g. "#f3456, #43445" |\n\n### Setting Colors for Lines and Bars\n\nTo set the color for lines and bars, use the `plotColorPalette` parameter. Colors in the palette will correspond sequentially to the elements in your chart (e.g., first bar/line will use the first color specified in the palette).\n\n```mermaid-example\n---\nconfig:\n themeVariables:\n xyChart:\n plotColorPalette: \'#000000, #0000FF, #00FF00, #FF0000\'\n---\nxychart\ntitle "Different Colors in xyChart"\nx-axis "categoriesX" ["Category 1", "Category 2", "Category 3", "Category 4"]\ny-axis "valuesY" 0 --> 50\n%% Black line\nline [10,20,30,40]\n%% Blue bar\nbar [20,30,25,35]\n%% Green bar\nbar [15,25,20,30]\n%% Red line\nline [5,15,25,35]\n```\n\n```mermaid\n---\nconfig:\n themeVariables:\n xyChart:\n plotColorPalette: \'#000000, #0000FF, #00FF00, #FF0000\'\n---\nxychart\ntitle "Different Colors in xyChart"\nx-axis "categoriesX" ["Category 1", "Category 2", "Category 3", "Category 4"]\ny-axis "valuesY" 0 --> 50\n%% Black line\nline [10,20,30,40]\n%% Blue bar\nbar [20,30,25,35]\n%% Green bar\nbar [15,25,20,30]\n%% Red line\nline [5,15,25,35]\n```\n\n## Displaying individual values on a bar chart (v11.14.0+)\n\nTo show the value corresponding to a bar specify `showDataLabel: true`.\n\n```mermaid-example\n---\nconfig:\n xyChart:\n showDataLabel: true\n---\nxychart\n title "Genres in top 100 book survey of 2025"\n x-axis [comedy, romance, mystery, crime, "non fiction", other]\n y-axis "Number of Books" 0 --> 30\n bar [12,2,20,25,17,24]\n```\n\n```mermaid\n---\nconfig:\n xyChart:\n showDataLabel: true\n---\nxychart\n title "Genres in top 100 book survey of 2025"\n x-axis [comedy, romance, mystery, crime, "non fiction", other]\n y-axis "Number of Books" 0 --> 30\n bar [12,2,20,25,17,24]\n```\n\nLabels are shown within the bar by default. To show the labels outside the bar, specify `showDataLabelOutsideBar: true`.\n\n```mermaid-example\n---\nconfig:\n xyChart:\n showDataLabel: true\n showDataLabelOutsideBar: true\n---\nxychart\n title "Genres in top 100 book survey of 2025"\n x-axis [comedy, romance, mystery, crime, "non fiction", other]\n y-axis "Number of Books" 0 --> 30\n bar [12,2,20,25,17,24]\n```\n\n```mermaid\n---\nconfig:\n xyChart:\n showDataLabel: true\n showDataLabelOutsideBar: true\n---\nxychart\n title "Genres in top 100 book survey of 2025"\n x-axis [comedy, romance, mystery, crime, "non fiction", other]\n y-axis "Number of Books" 0 --> 30\n bar [12,2,20,25,17,24]\n```\n\n## Per-point text labels for line charts (v\\<MERMAID_RELEASE_VERSION>+)\n\nEach data point in a `line` can optionally include a quoted string label after the numeric value. Labels render above points in vertical orientation, or to the right in horizontal orientation, using the line\'s stroke color.\n\n```mermaid-example\nxychart\n title "Smallest AI models scoring above 60% on MMLU"\n x-axis "Date" ["Apr 2022", "Feb 2023", "Jul 2023", "Sep 2023", "Apr 2024"]\n y-axis "Parameters (B)" 0 --> 600\n line [540 "PaLM", 65 "LLaMA-65B", 34 "Llama 2 34B", 7 "Mistral 7B", 3.8 "Phi-3-mini"]\n```\n\n```mermaid\nxychart\n title "Smallest AI models scoring above 60% on MMLU"\n x-axis "Date" ["Apr 2022", "Feb 2023", "Jul 2023", "Sep 2023", "Apr 2024"]\n y-axis "Parameters (B)" 0 --> 600\n line [540 "PaLM", 65 "LLaMA-65B", 34 "Llama 2 34B", 7 "Mistral 7B", 3.8 "Phi-3-mini"]\n```\n\nLabels are optional per point — you can mix labeled and unlabeled values:\n\n```mermaid-example\nxychart\n title "Quarterly Performance"\n x-axis [Q1, Q2, Q3, Q4]\n y-axis "Revenue ($M)" 0 --> 100\n line [25 "Launch", 45, 72, 90 "Target Hit"]\n```\n\n```mermaid\nxychart\n title "Quarterly Performance"\n x-axis [Q1, Q2, Q3, Q4]\n y-axis "Revenue ($M)" 0 --> 100\n line [25 "Launch", 45, 72, 90 "Target Hit"]\n```\n\nExisting syntax without labels continues to work unchanged.\n\n> **Note**\n> Point labels use a fixed font size of 12px. In vertical charts, labels appear above each point. In horizontal charts, labels appear to the right. Labels are currently supported on `line` plots only; the syntax is accepted on `bar` plots but labels are ignored.\n\n## Example on config and theme\n\n```mermaid-example\n---\nconfig:\n xyChart:\n width: 900\n height: 600\n showDataLabel: true\n themeVariables:\n xyChart:\n titleColor: "#ff0000"\n---\nxychart\n title "Sales Revenue"\n x-axis [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]\n y-axis "Revenue (in $)" 4000 --> 11000\n bar [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]\n line [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]\n```\n\n```mermaid\n---\nconfig:\n xyChart:\n width: 900\n height: 600\n showDataLabel: true\n themeVariables:\n xyChart:\n titleColor: "#ff0000"\n---\nxychart\n title "Sales Revenue"\n x-axis [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]\n y-axis "Revenue (in $)" 4000 --> 11000\n bar [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]\n line [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]\n```\n';
|
|
484
484
|
const __vite_glob_0_43 = '# 阶段流程(plan / tasks / execute / done / new-spec)\n\n## plan\n\n理解文档,分析现有代码,编写技术实现方案,更新到当前文档中;需要用户介入的事项以三级标题写入 `## 待确认项`,待用户后续审阅批注;暂时只需更新文档,不要实施代码。\n\n**目标:** 输出 `## 现状分析`、`## 技术实现方案`、`## 待确认项` 三节;禁止输出任务清单格式 `- [ ]`。\n\n若 `## 追加任务` 存在 `- [open] [feat|refct|fix] ...` 条目,必须将其纳入分析范围;plan 阶段不修改 `[open]` 状态标记。\n\n### 待确认项的三种类型\n\n一个待确认项,要么让用户**抉择**,要么让用户**确认**,要么请用户**自由补充**:\n\n| 类型 | 标记 | 语义 | 何时用 |\n| -------- | ------------------- | --------------------------------------------------------------------------------------- | --------------------- |\n| 抉择型 | `[choice]` | 给用户**选择权**:存在多个都可行、优劣取决于你拿不到的信息(业务优先级/外部约束)的方案 | 多方案差异大、难取舍 |\n| 确认型 | `[confirm]` | 给用户**否决权**:只有一个可行方案,但它有明显代价(技术债/影响面/不可逆) | 单方案但影响重大 |\n| 自由文本 | `(自由文本)` 后缀 | 请用户补一段开放说明 | 需要主观文案/开放意见 |\n\n> 无标记且带有序候选,向后兼容视为 `[choice]`。\n\n### 准入门槛(写入待确认项前必过的自检)\n\n**第一道过滤器先于类型判断**:这个答案,你能否通过读代码、跑测试、查项目约定自己确定?\n\n- **能** → 禁止写成待确认项,自己去查、去定,把决策+理由写进 `## 技术实现方案`(决策说明),不要打断用户。\n- **不能**(决策依赖用户独有信息,或选错的返工不可逆)→ 才写成待确认项,并归入 choice/confirm。\n\n> 待确认项是压力释放阀,不是免责声明。被你砍掉的判断不该凭空消失,要落成 `## 技术实现方案` 里的决策说明(决策 + 理由 + 被否决的备选)。\n\n### 抉择型 [choice] 正确示例\n\n```\n### 5.1 [choice] 候选答案的展现形式应采用哪种?\n1. 嵌套子列表\n2. 表格 (推荐)\n```\n\n- 候选写一级有序列表;恰 1 个候选以 ` (推荐)` / ` (推荐)` 结尾。\n- 空态与格式由 lint 的 `pending-questions/*` 规则保证。\n\n### 确认型 [confirm] 正确示例\n\n```\n### 5.2 [confirm] 将 UserID 从 int 迁移为 uuid\n\n**方案**:一次性迁移,双写过渡 2 周。\n**影响**:🔴 需停机窗口;对外 /api/user 字段类型变更,客户端需同步。\n```\n\n- 只有 `**方案**` 与 `**影响**`(或 `**代价**`)两字段,**不列候选**。\n- 影响行用红/黄语义标注严重度:🔴 breaking(破坏性/不可逆)、🟡 affected(有影响但可控)。\n- 确认型 = "我要这么干了,除非你喊停" 的知会 + 急停按钮:放行是常态,用户否决才是例外。\n\n### 确认型的否决语义(用户在 GUI 上如何回应)\n\n用户对确认型只有两种回应:**确认放行** 或 **否决**。否决必须携带理由,并细分意图(GUI 渲染为嵌套单选):\n\n| 用户决策 | 回写 `!!!选择:…` | 含义 |\n| ------------------------- | ------------------------------------ | ---------------------- |\n| 确认,按此推进 | `确认,按此推进` | 接受代价,继续 |\n| 否决·换方案 | `否决·换方案` | 原目标下另寻实现 |\n| 否决·补约束 | `否决·补约束` | 用户补充你漏掉的硬约束 |\n| 否决·弃目标·废弃当前目标 | `否决·弃目标·废弃当前目标,继续其余` | 该目标不做,其余照旧 |\n| 否决·弃目标·放弃整个 spec | `否决·弃目标·放弃整个 spec` | 整条 spec 作废 |\n\n> 决策不改动 API:编码进批注的 `选择:…`(结构化意图)+ `备注:…`(理由)。tasks 阶段按下表消费。\n\n### 图形化补充(plan 收尾子步骤)\n\n方案文字定稿后、结束 plan 前,**必须**专门回看 `## 现状分析`、`## 技术实现方案` 两节做一次 mermaid 图形化补充(仅此两节,其它章节不动):\n\n- 加载 [mermaid.md](./mermaid.md),先服从其**核心原则「图优先、精确信息折叠」**:表层给图(认知层),精确细节(路径、行号、类型/源码全文)折叠进 `<details>` 精确层,图与折叠互补不重复。\n- 按选型表与「必须用图」触发词补图:分步/分支散文→flowchart,接口/类型定义→classDiagram;含「兼容性/影响范围」时出结构图并按红=breaking、黄=affected 语义配色。\n- 这是一道独立聚焦的工序(不新增 stage):把「想清楚方案 / 写成文字」与「回看补图」分开,避免图形化被跳过。补图完成后再结束 plan。\n\n### 待确认项自检(plan 收尾子步骤)\n\n方案与图形化定稿后、结束 plan 前,**必须**专门回看 `## 待确认项` 做一次自检(与「图形化补充」同构:把"写方案"与"回看校验"分开,避免自检被跳过):\n\n1. **准入过滤**:逐条问"能否自己查证?"——能则删除该条、把决策落进 `## 技术实现方案`(决策说明)。\n2. **类型归类**:留下的每条明确标 `[choice]` 或 `[confirm]`(或 `(自由文本)`);单一类型,不兼具。\n3. **确认型补影响**:每个 `[confirm]` 必带 `**方案**` 与 `**影响**`(红/黄语义);影响写不出来,说明它其实够不上确认型,降级或删除。\n\n自检完成后再结束 plan。\n\n空态整章仅一行斜体占位:\n\n```\n## 5. 待确认项\n\n_暂无_\n```\n\n> 格式由 lint 的 `pending-questions/*` 规则保证;不确定时运行 `yorz lint` 查看报错。\n\n## tasks\n\n根据批注内容(`!!!` 前缀)更新技术方案;审查批注是否正确解答了待确认项;若引入新增/扩展需求或新增 bug,切回 plan;若存在冲突或歧义,回退 plan 并写入待确认项后退出;否则将技术方案拆解为可执行任务,写入文档,然后进入 execute。\n\n### 批注消费规则\n\n- 读取并消费所有 `!!!` 批注,将批注意图合并进 `## 技术实现方案` 与 `## 任务清单`。\n- 处理完成后**删除对应 `!!!` 文本**,然后**整段删除** `## 用户批注` 章节。\n\n### 确认型答复的消费\n\n当批注含 `!!!选择:<决策>;备注:<理由>`(引用行的前缀 `待确认项`/`待确认问题` 皆可),按 `选择:` 分派下游行为,并**无论确认或否决都留痕**——在 `## 技术实现方案` 追加一行决策记录:`> 决策记录:<条目> —— 用户<决策>,理由:<理由>。`(决策记录不随 `## 用户批注` 删除而蒸发):\n\n| `选择:` | 下游行为 |\n| ---------------------------------- | ---------------------------------------------------------------------------------------------- |\n| 确认,按此推进 | 接受代价,落决策记录,继续拆任务 |\n| 否决·换方案 | 切回 plan:原目标下另寻实现(新方案可能又产生 choice/confirm) |\n| 否决·补约束 | 切回 plan:把理由当硬约束重算方案 |\n| 否决·弃目标·废弃当前目标,继续其余 | 从 `## 需求` 剔除该目标,落决策记录,继续其余目标 |\n| 否决·弃目标·放弃整个 spec | 落决策记录(作废),将 `stage` 置 `done` 终止,`last_action` 记「用户放弃整个 spec,标记终止」 |\n\n### 任务清单正确示例\n\n```\n## 6. 任务清单\n\n- [ ] 删除 src/foo.ts 中的 deprecatedFunc(验收:grep 无残留引用)\n- [ ] 更新 index.ts 导出(验收:tsc --noEmit 通过)\n```\n\n> 每项任务包含"动作 + 对象 + 验收点";仅使用单层 `- [ ]`;禁止泛化任务。\n\n### `[manual]` 人工确认任务标记\n\n对「需人工确认、Agent 不能自动完成」的事项,用 `- [ ] [manual] ...` 标注:\n\n```\n- [ ] [manual] 联系运维确认灰度窗口(验收:人工回复确认)\n```\n\n`done` 收尾判定**忽略**未勾选的 `[manual]` 项:只要其余非 manual 任务全部完成,即可收尾为 `done`,无需等待人工项被勾选(详见 execute 的「收尾为 done」)。\n\n### 自动衔接\n\n> 任务量不构成暂停理由:以下衔接规则与任务清单长度、改动半径无关。\n\n若待确认项为 `_暂无_` 且无新冲突,同一轮继续进入 execute,**同一轮衔接 execute 前后不得**向用户追加任何"是否执行/是否继续"询问。\n\n## execute\n\n顺序执行 `## 任务清单` 中未完成项(`- [ ]`)。执行中若发现新增/扩展需求或新增 bug,立即停止,切回 plan。\n\n> **执行过程中不得对用户做整批/中段元确认**:除"新需求/新 bug → 切回 plan"这一合法阻塞外,任务清单内部的任何疑问都必须以 `## 待确认项` 形式写回触发重开,禁止追加"是否继续 / 我是否应该执行下一项"等问句停顿。\n\n### 每完成一项后立刻\n\n- 将该项从 `- [ ]` 改为 `- [x]`。\n- 在 `## 执行记录` 增加一条结果(改动点、验证方式、阻塞项若有)。\n\n### 默认执行验证\n\n若仓库存在可用测试/构建命令,默认执行并记录结果;若当前环境无法执行,记录原因。\n\n### 追加任务 `[open] → [fixed]` 状态机\n\n若本轮起因是 `## 追加任务` 中的 `[open]` 条目:每完成一个追加项,把状态标记从 `[open]` 改为 `[fixed]`(位置和正文保留不变),在 `## 执行记录` 追加一条结果。已 `[fixed]` 的条目保留作为历史,不删除。\n\n### 收尾为 done\n\n当 `## 任务清单` 不存在未完成的**非 `[manual]`** 任务(`- [ ] [manual]` 人工确认项被忽略),且 `## 待确认项` 为 `_暂无_`、无任何 `!!!` 批注、无 `## 追加任务` 的 `[open]` 条目时,在 execute 收尾同一轮:\n\n- 将 `stage` 置为 `done`,`last_action` 记「任务全部完成,标记 done」。\n- 在 `## 执行记录` 追加一条收尾条目。\n\n`done` 是终止态:机器 / GUI 可据 `stage=done` 直接判定完成。此后不再自动推进;收到新增/扩展需求、新 bug,或 `## 追加任务` 出现 `[open]` 时,按「变更重开流程」切回 `plan`。\n\n## new-spec\n\n当 `spec_path` 缺省且无法从 session 上下文恢复时,自动生成路径与初始骨架。\n\n### 步骤\n\n1. **提炼摘要**:从用户输入提炼 kebab-case `summary-name`(≤ 40 字符,不以数字开头,必须语义化):只使用对需求有语义代表性的英文/数字字符;中文为主难以提炼出可读 slug 时直接使用 `untitled-<NNN>`(3 位日期内自增编号)占位,**禁止把中文挤压为零散英文片段**(例如禁止出现 `spec-agent-spec-agent` 之类的拼接)。\n2. **判定 type**:`feat` / `refct` / `fix`;prompt 中已显式给出时直接使用;不确定时询问用户,兜底取 `feat`。\n3. **生成 id**:`YYMMDD.<type>.<summary-name>`(如 `260614.feat.spec-frontmatter`)。\n4. **生成路径**:`<specsDir>/<id>/spec.md`。id 冲突时追加 `-2`、`-3` 后缀。\n5. **初始化文档**:写入 frontmatter(`stage: plan`、`last_action: 新建 spec`、`updated_at` 本地秒级字符串、`summary` 为对需求的**真实概述**且 ≤ 200 字符,不要原样照搬整段需求);建议创建全部章节(背景 / 需求 / 现状分析 / 技术实现方案 / 待确认项 / 任务清单 / 执行记录),将用户原始需求写入背景或需求。\n6. **进入 plan**:初始化后在同一轮继续推进 plan,按 SKILL 规则补齐 `现状分析` / `技术实现方案` / `待确认项`,再视需要进入 tasks/execute;不要因为"文档已创建"就退出。\n\n### CLI 触发模式\n\nCLI/Service 同时给出 `类型:<type>` 与需求但未提供 `spec_path` 时,必须自动进入新建流程,不询问类型/路径;初始化后同一轮继续推进 plan,直到遇到真正阻塞才退出。\n';
|
|
485
|
+
const execFileP$1 = promisify(execFile);
|
|
486
|
+
function withHiddenWindowsConsole(options, platform2 = process.platform) {
|
|
487
|
+
if (platform2 !== "win32") return options;
|
|
488
|
+
return { ...options, windowsHide: true };
|
|
489
|
+
}
|
|
490
|
+
async function execFileWithoutWindow(file, args, options) {
|
|
491
|
+
const result = await execFileP$1(file, args, withHiddenWindowsConsole(options));
|
|
492
|
+
return { stdout: result.stdout, stderr: result.stderr };
|
|
493
|
+
}
|
|
494
|
+
function spawnWithoutWindow(command, args, options) {
|
|
495
|
+
return spawn(command, args, withHiddenWindowsConsole(options));
|
|
496
|
+
}
|
|
497
|
+
function resolveBrowserOpenInvocation(platform2, url) {
|
|
498
|
+
if (platform2 === "win32") return { command: "explorer.exe", args: [url] };
|
|
499
|
+
if (platform2 === "darwin") return { command: "open", args: [url] };
|
|
500
|
+
return { command: "xdg-open", args: [url] };
|
|
501
|
+
}
|
|
485
502
|
async function isGitRepo(cwd) {
|
|
486
503
|
try {
|
|
487
504
|
await stat(join(cwd, ".git"));
|
|
@@ -492,7 +509,11 @@ async function isGitRepo(cwd) {
|
|
|
492
509
|
}
|
|
493
510
|
async function runGitInit(cwd) {
|
|
494
511
|
await new Promise((resolve2, reject) => {
|
|
495
|
-
const child = spawn(
|
|
512
|
+
const child = spawn(
|
|
513
|
+
"git",
|
|
514
|
+
["init"],
|
|
515
|
+
withHiddenWindowsConsole({ cwd, stdio: "inherit" })
|
|
516
|
+
);
|
|
496
517
|
child.on("error", reject);
|
|
497
518
|
child.on("exit", (code) => {
|
|
498
519
|
if (code === 0) resolve2();
|
|
@@ -2482,23 +2503,6 @@ function createSessionsRoutes(resolveProject) {
|
|
|
2482
2503
|
});
|
|
2483
2504
|
return app;
|
|
2484
2505
|
}
|
|
2485
|
-
const execFileP$2 = promisify(execFile);
|
|
2486
|
-
function withHiddenWindowsConsole(options, platform2 = process.platform) {
|
|
2487
|
-
if (platform2 !== "win32") return options;
|
|
2488
|
-
return { ...options, windowsHide: true };
|
|
2489
|
-
}
|
|
2490
|
-
async function execFileWithoutWindow(file, args, options) {
|
|
2491
|
-
const result = await execFileP$2(file, args, withHiddenWindowsConsole(options));
|
|
2492
|
-
return { stdout: result.stdout, stderr: result.stderr };
|
|
2493
|
-
}
|
|
2494
|
-
function spawnWithoutWindow(command, args, options) {
|
|
2495
|
-
return spawn(command, args, withHiddenWindowsConsole(options));
|
|
2496
|
-
}
|
|
2497
|
-
function resolveBrowserOpenInvocation(platform2, url) {
|
|
2498
|
-
if (platform2 === "win32") return { command: "explorer.exe", args: [url] };
|
|
2499
|
-
if (platform2 === "darwin") return { command: "open", args: [url] };
|
|
2500
|
-
return { command: "xdg-open", args: [url] };
|
|
2501
|
-
}
|
|
2502
2506
|
class GitError extends Error {
|
|
2503
2507
|
code;
|
|
2504
2508
|
stderr;
|
|
@@ -2634,6 +2638,17 @@ async function partitionPathsByStatus(cwd, paths) {
|
|
|
2634
2638
|
}
|
|
2635
2639
|
return result;
|
|
2636
2640
|
}
|
|
2641
|
+
function pathsNeedingStage(changes, paths) {
|
|
2642
|
+
const byPath = new Map(changes.map((c) => [c.path, c]));
|
|
2643
|
+
const out = [];
|
|
2644
|
+
for (const p of paths) {
|
|
2645
|
+
const change = byPath.get(p);
|
|
2646
|
+
if (!change) continue;
|
|
2647
|
+
if (change.worktree === " ") continue;
|
|
2648
|
+
out.push(p);
|
|
2649
|
+
}
|
|
2650
|
+
return out;
|
|
2651
|
+
}
|
|
2637
2652
|
async function commit(cwd, opts) {
|
|
2638
2653
|
const message = opts.message?.trim() ?? "";
|
|
2639
2654
|
if (!message) throw new GitError("invalid_message", "commit message must not be empty");
|
|
@@ -2641,11 +2656,21 @@ async function commit(cwd, opts) {
|
|
|
2641
2656
|
throw new GitError("no_paths", "commit requires at least one path");
|
|
2642
2657
|
}
|
|
2643
2658
|
for (const p of opts.paths) assertSafeRelativePath(cwd, p);
|
|
2644
|
-
const
|
|
2645
|
-
|
|
2646
|
-
const
|
|
2647
|
-
|
|
2648
|
-
|
|
2659
|
+
const toStage = pathsNeedingStage(await listChanges(cwd), opts.paths);
|
|
2660
|
+
if (toStage.length) await runGit(cwd, ["add", "--", ...toStage]);
|
|
2661
|
+
const committed = await runGitRaw(cwd, ["commit", "-m", message]);
|
|
2662
|
+
if (committed.code !== 0) {
|
|
2663
|
+
const detail = `${committed.stdout}
|
|
2664
|
+
${committed.stderr}`.trim();
|
|
2665
|
+
if (/nothing (added )?to commit|no changes added to commit/i.test(detail)) {
|
|
2666
|
+
throw new GitError(
|
|
2667
|
+
"nothing_to_commit",
|
|
2668
|
+
"selected paths have no staged changes — the file list is out of date, refresh and retry",
|
|
2669
|
+
detail
|
|
2670
|
+
);
|
|
2671
|
+
}
|
|
2672
|
+
throw new GitError("git_failed", "git commit failed", detail);
|
|
2673
|
+
}
|
|
2649
2674
|
const { stdout } = await runGit(cwd, ["rev-parse", "HEAD"]);
|
|
2650
2675
|
return { commit: stdout.trim() };
|
|
2651
2676
|
}
|
|
@@ -2747,9 +2772,7 @@ async function listBranches(cwd) {
|
|
|
2747
2772
|
])
|
|
2748
2773
|
]);
|
|
2749
2774
|
const branches = parseRefLines(branchesResult.stdout);
|
|
2750
|
-
const remoteBranches = parseRefLines(remotesResult.stdout).filter(
|
|
2751
|
-
(ref) => !ref.endsWith("/HEAD")
|
|
2752
|
-
);
|
|
2775
|
+
const remoteBranches = parseRefLines(remotesResult.stdout).filter((ref) => !ref.endsWith("/HEAD"));
|
|
2753
2776
|
return { current, branches, remoteBranches };
|
|
2754
2777
|
}
|
|
2755
2778
|
async function checkoutBranch(cwd, branch) {
|
|
@@ -2934,6 +2957,8 @@ function buildGitOpsPrompt(action, specId, specRel) {
|
|
|
2934
2957
|
`;
|
|
2935
2958
|
}
|
|
2936
2959
|
}
|
|
2960
|
+
const MAX_STDERR_LINES = 6;
|
|
2961
|
+
const gitLog = () => getLogger().child("git");
|
|
2937
2962
|
function createGitRoutes(resolveProject) {
|
|
2938
2963
|
const app = new Hono();
|
|
2939
2964
|
const need = async (c) => {
|
|
@@ -2952,13 +2977,26 @@ function createGitRoutes(resolveProject) {
|
|
|
2952
2977
|
}
|
|
2953
2978
|
};
|
|
2954
2979
|
const toPaths = (value) => Array.isArray(value) ? value.filter((v) => typeof v === "string") : [];
|
|
2980
|
+
const gitFail = (c, err) => {
|
|
2981
|
+
const detail = err.stderr.trim().split("\n").slice(0, MAX_STDERR_LINES).join("\n");
|
|
2982
|
+
gitLog().warn("git command failed", {
|
|
2983
|
+
path: c.req.path,
|
|
2984
|
+
code: err.code,
|
|
2985
|
+
message: err.message,
|
|
2986
|
+
stderr: err.stderr.trim()
|
|
2987
|
+
});
|
|
2988
|
+
return c.json(
|
|
2989
|
+
{ error: detail ? `${err.message}: ${detail}` : err.message, code: err.code },
|
|
2990
|
+
400
|
|
2991
|
+
);
|
|
2992
|
+
};
|
|
2955
2993
|
app.get("/projects/:projectId/git/changes", async (c) => {
|
|
2956
2994
|
const p = await need(c);
|
|
2957
2995
|
if (p instanceof Response) return p;
|
|
2958
2996
|
try {
|
|
2959
2997
|
return c.json({ changes: await listChanges(p.path) });
|
|
2960
2998
|
} catch (err) {
|
|
2961
|
-
if (err instanceof GitError) return c
|
|
2999
|
+
if (err instanceof GitError) return gitFail(c, err);
|
|
2962
3000
|
throw err;
|
|
2963
3001
|
}
|
|
2964
3002
|
});
|
|
@@ -2970,7 +3008,7 @@ function createGitRoutes(resolveProject) {
|
|
|
2970
3008
|
try {
|
|
2971
3009
|
return c.json(await fileDiff(p.path, path));
|
|
2972
3010
|
} catch (err) {
|
|
2973
|
-
if (err instanceof GitError) return c
|
|
3011
|
+
if (err instanceof GitError) return gitFail(c, err);
|
|
2974
3012
|
throw err;
|
|
2975
3013
|
}
|
|
2976
3014
|
});
|
|
@@ -2980,7 +3018,7 @@ function createGitRoutes(resolveProject) {
|
|
|
2980
3018
|
try {
|
|
2981
3019
|
return c.json(await listBranches(p.path));
|
|
2982
3020
|
} catch (err) {
|
|
2983
|
-
if (err instanceof GitError) return c
|
|
3021
|
+
if (err instanceof GitError) return gitFail(c, err);
|
|
2984
3022
|
throw err;
|
|
2985
3023
|
}
|
|
2986
3024
|
});
|
|
@@ -2995,7 +3033,7 @@ function createGitRoutes(resolveProject) {
|
|
|
2995
3033
|
const result = await checkoutBranch(p.path, branch);
|
|
2996
3034
|
return c.json({ ok: true, ...result });
|
|
2997
3035
|
} catch (err) {
|
|
2998
|
-
if (err instanceof GitError) return c
|
|
3036
|
+
if (err instanceof GitError) return gitFail(c, err);
|
|
2999
3037
|
throw err;
|
|
3000
3038
|
}
|
|
3001
3039
|
});
|
|
@@ -3010,7 +3048,7 @@ function createGitRoutes(resolveProject) {
|
|
|
3010
3048
|
const result = await mergeBranch(p.path, branch);
|
|
3011
3049
|
return c.json({ ok: true, ...result });
|
|
3012
3050
|
} catch (err) {
|
|
3013
|
-
if (err instanceof GitError) return c
|
|
3051
|
+
if (err instanceof GitError) return gitFail(c, err);
|
|
3014
3052
|
throw err;
|
|
3015
3053
|
}
|
|
3016
3054
|
});
|
|
@@ -3026,7 +3064,7 @@ function createGitRoutes(resolveProject) {
|
|
|
3026
3064
|
try {
|
|
3027
3065
|
return c.json(await commit(p.path, { message, paths }));
|
|
3028
3066
|
} catch (err) {
|
|
3029
|
-
if (err instanceof GitError) return c
|
|
3067
|
+
if (err instanceof GitError) return gitFail(c, err);
|
|
3030
3068
|
throw err;
|
|
3031
3069
|
}
|
|
3032
3070
|
});
|
|
@@ -3041,7 +3079,7 @@ function createGitRoutes(resolveProject) {
|
|
|
3041
3079
|
await discard(p.path, { paths });
|
|
3042
3080
|
return c.json({ ok: true });
|
|
3043
3081
|
} catch (err) {
|
|
3044
|
-
if (err instanceof GitError) return c
|
|
3082
|
+
if (err instanceof GitError) return gitFail(c, err);
|
|
3045
3083
|
throw err;
|
|
3046
3084
|
}
|
|
3047
3085
|
});
|
|
@@ -3052,7 +3090,7 @@ function createGitRoutes(resolveProject) {
|
|
|
3052
3090
|
const result = await push(p.path);
|
|
3053
3091
|
return c.json({ ok: true, ...result });
|
|
3054
3092
|
} catch (err) {
|
|
3055
|
-
if (err instanceof GitError) return c
|
|
3093
|
+
if (err instanceof GitError) return gitFail(c, err);
|
|
3056
3094
|
throw err;
|
|
3057
3095
|
}
|
|
3058
3096
|
});
|
|
@@ -3063,7 +3101,7 @@ function createGitRoutes(resolveProject) {
|
|
|
3063
3101
|
const result = await pull(p.path);
|
|
3064
3102
|
return c.json({ ok: true, ...result });
|
|
3065
3103
|
} catch (err) {
|
|
3066
|
-
if (err instanceof GitError) return c
|
|
3104
|
+
if (err instanceof GitError) return gitFail(c, err);
|
|
3067
3105
|
throw err;
|
|
3068
3106
|
}
|
|
3069
3107
|
});
|
|
@@ -3604,7 +3642,8 @@ class PowerInhibitController {
|
|
|
3604
3642
|
constructor(opts = {}) {
|
|
3605
3643
|
this.globalConfigPath = opts.globalConfigPath;
|
|
3606
3644
|
this.platform = opts.platform ?? platform();
|
|
3607
|
-
this.spawnCommand = opts.spawnCommand ??
|
|
3645
|
+
this.spawnCommand = opts.spawnCommand ?? // win32 下经 withHiddenWindowsConsole 附加 windowsHide,避免 PowerShell 弹出可见控制台。
|
|
3646
|
+
((command, args, options) => spawn(command, args, withHiddenWindowsConsole(options, this.platform)));
|
|
3608
3647
|
}
|
|
3609
3648
|
setSessionRunning(sessionId, running) {
|
|
3610
3649
|
if (running) this.runningSessions.add(sessionId);
|
|
@@ -4469,18 +4508,22 @@ class CommandManager {
|
|
|
4469
4508
|
return failed;
|
|
4470
4509
|
}
|
|
4471
4510
|
try {
|
|
4472
|
-
const child = spawn(
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4511
|
+
const child = spawn(
|
|
4512
|
+
def.cli,
|
|
4513
|
+
// 显式传泛型,保留 stdio 元组在 SpawnOptions 上下文下的推断,避免重载解析失败。
|
|
4514
|
+
withHiddenWindowsConsole({
|
|
4515
|
+
shell: true,
|
|
4516
|
+
cwd: this.projectPath,
|
|
4517
|
+
env: process.env,
|
|
4518
|
+
// POSIX 依赖独立进程组发送负 PID 信号;Windows 使用 taskkill /T,且 detached
|
|
4519
|
+
// 会导致继承的日志文件描述符失效,所以 Windows 必须保持 attached。
|
|
4520
|
+
detached: process.platform !== "win32",
|
|
4521
|
+
// No pipes: the child writes straight into the log fd. Keeps a chatty
|
|
4522
|
+
// dev server from buffering through this process, and lets the REST
|
|
4523
|
+
// first paint and the SSE tail read from one single source.
|
|
4524
|
+
stdio: ["ignore", fd, fd]
|
|
4525
|
+
})
|
|
4526
|
+
);
|
|
4484
4527
|
child.unref();
|
|
4485
4528
|
const run = {
|
|
4486
4529
|
runId,
|
|
@@ -4990,17 +5033,38 @@ const MIME = {
|
|
|
4990
5033
|
".mjs": "text/javascript; charset=utf-8",
|
|
4991
5034
|
".css": "text/css; charset=utf-8",
|
|
4992
5035
|
".json": "application/json; charset=utf-8",
|
|
5036
|
+
// PWA 清单:用 application/json 也能跑,但 Chrome 的安装性检查会报警告
|
|
5037
|
+
".webmanifest": "application/manifest+json; charset=utf-8",
|
|
4993
5038
|
".svg": "image/svg+xml",
|
|
4994
5039
|
".png": "image/png",
|
|
4995
5040
|
".jpg": "image/jpeg",
|
|
5041
|
+
".webp": "image/webp",
|
|
4996
5042
|
".ico": "image/x-icon",
|
|
5043
|
+
// 自托管字体:类型错了 Firefox 会直接拒绝加载
|
|
5044
|
+
".woff": "font/woff",
|
|
5045
|
+
".woff2": "font/woff2",
|
|
4997
5046
|
".map": "application/json; charset=utf-8"
|
|
4998
5047
|
};
|
|
5048
|
+
const MOBILE_PREFIX = "/m";
|
|
4999
5049
|
function createStaticRoutes(guiRoot) {
|
|
5000
5050
|
const root = guiRoot ?? defaultGuiRoot();
|
|
5051
|
+
const mobileRoot = resolve(root, "..", "gui-mobile");
|
|
5001
5052
|
const app = new Hono();
|
|
5053
|
+
app.get(MOBILE_PREFIX, (c) => c.redirect(`${MOBILE_PREFIX}/`));
|
|
5054
|
+
app.get(`${MOBILE_PREFIX}/*`, async (c) => {
|
|
5055
|
+
const subPath = c.req.path.slice(MOBILE_PREFIX.length) || "/";
|
|
5056
|
+
const file = resolveStaticFile(mobileRoot, subPath);
|
|
5057
|
+
if (file) return serveFile(c, file);
|
|
5058
|
+
const indexPath = join(mobileRoot, "index.html");
|
|
5059
|
+
if (existsSync(indexPath)) return serveFile(c, indexPath);
|
|
5060
|
+
return c.text(
|
|
5061
|
+
"YorZ mobile GUI is not built. Run `pnpm build:gui-mobile` first, then reload this page.",
|
|
5062
|
+
503
|
|
5063
|
+
);
|
|
5064
|
+
});
|
|
5002
5065
|
app.get("*", async (c) => {
|
|
5003
5066
|
if (c.req.path.startsWith("/api")) return c.notFound();
|
|
5067
|
+
if (c.req.path === "/" && isMobileRequest(c)) return c.redirect(`${MOBILE_PREFIX}/`);
|
|
5004
5068
|
const file = resolveStaticFile(root, c.req.path);
|
|
5005
5069
|
if (file) return serveFile(c, file);
|
|
5006
5070
|
const indexPath = join(root, "index.html");
|
|
@@ -5009,6 +5073,12 @@ function createStaticRoutes(guiRoot) {
|
|
|
5009
5073
|
});
|
|
5010
5074
|
return app;
|
|
5011
5075
|
}
|
|
5076
|
+
function isMobileRequest(c) {
|
|
5077
|
+
const ua = c.req.header("user-agent") ?? "";
|
|
5078
|
+
const chMobile = c.req.header("sec-ch-ua-mobile");
|
|
5079
|
+
if (chMobile === "?1") return true;
|
|
5080
|
+
return /Android|iPhone|iPad|iPod|Mobile/i.test(ua);
|
|
5081
|
+
}
|
|
5012
5082
|
function defaultGuiRoot() {
|
|
5013
5083
|
try {
|
|
5014
5084
|
const here = dirname(fileURLToPath(import.meta.url));
|
|
@@ -5034,8 +5104,12 @@ function resolveStaticFile(root, urlPath) {
|
|
|
5034
5104
|
}
|
|
5035
5105
|
async function serveFile(c, file) {
|
|
5036
5106
|
const body = await readFile(file);
|
|
5037
|
-
const
|
|
5107
|
+
const ext = extname(file);
|
|
5108
|
+
const mime = MIME[ext] ?? "application/octet-stream";
|
|
5038
5109
|
c.header("Content-Type", mime);
|
|
5110
|
+
if (ext === ".html" || /\bsw\.js$/.test(file) || /\bregisterSW\.js$/.test(file)) {
|
|
5111
|
+
c.header("Cache-Control", "no-cache");
|
|
5112
|
+
}
|
|
5039
5113
|
return c.body(body);
|
|
5040
5114
|
}
|
|
5041
5115
|
const DEBOUNCE_MS = 200;
|
|
@@ -6991,7 +7065,6 @@ class CodexAdapter {
|
|
|
6991
7065
|
return null;
|
|
6992
7066
|
}
|
|
6993
7067
|
}
|
|
6994
|
-
const execFileP$1 = promisify(execFile);
|
|
6995
7068
|
const OPENCODE_QUOTA_INSTALL = "npx @slkiser/opencode-quota@latest init";
|
|
6996
7069
|
const OPENCODE_QUOTA_PLUGIN_BIN = join(
|
|
6997
7070
|
homedir(),
|
|
@@ -7248,8 +7321,9 @@ class OpenCodeAdapter {
|
|
|
7248
7321
|
let lastError;
|
|
7249
7322
|
for (const command of await opencodeQuotaCommands()) {
|
|
7250
7323
|
try {
|
|
7251
|
-
const { stdout } = await
|
|
7324
|
+
const { stdout } = await execFileWithoutWindow(command.cmd, command.args, {
|
|
7252
7325
|
cwd: this.cwd,
|
|
7326
|
+
encoding: "utf8",
|
|
7253
7327
|
timeout: 1e4,
|
|
7254
7328
|
maxBuffer: 1024 * 1024
|
|
7255
7329
|
});
|
|
@@ -8190,16 +8264,17 @@ function defaultRunUpdate() {
|
|
|
8190
8264
|
}
|
|
8191
8265
|
function defaultRunRestart() {
|
|
8192
8266
|
const restart = resolveRestartCommand();
|
|
8193
|
-
const child =
|
|
8267
|
+
const child = spawnWithoutWindow(restart.cmd, restart.args, {
|
|
8194
8268
|
detached: true,
|
|
8195
|
-
stdio: "ignore"
|
|
8269
|
+
stdio: "ignore",
|
|
8270
|
+
...process.platform === "win32" ? { shell: true } : {}
|
|
8196
8271
|
});
|
|
8197
8272
|
child.unref();
|
|
8198
8273
|
return Promise.resolve();
|
|
8199
8274
|
}
|
|
8200
8275
|
function runProcess(cmd, args) {
|
|
8201
8276
|
return new Promise((resolve2, reject) => {
|
|
8202
|
-
const child =
|
|
8277
|
+
const child = spawnWithoutWindow(cmd, args, { stdio: "ignore" });
|
|
8203
8278
|
child.on("error", reject);
|
|
8204
8279
|
child.on("exit", (code, signal) => {
|
|
8205
8280
|
if (code === 0) resolve2();
|
|
@@ -8510,7 +8585,7 @@ async function runRestartServe(opts = {}) {
|
|
|
8510
8585
|
}
|
|
8511
8586
|
const entry = process.argv[1];
|
|
8512
8587
|
if (!entry) throw new Error("Cannot resolve CLI entrypoint for restart");
|
|
8513
|
-
const child =
|
|
8588
|
+
const child = spawnWithoutWindow(process.execPath, [entry, ...restartWorkerArgs(opts)], {
|
|
8514
8589
|
detached: true,
|
|
8515
8590
|
stdio: "ignore"
|
|
8516
8591
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-CC4tXc_1.js";import{p as f}from"./chunk-JWPE2WC7-wFaiogOx.js";import{_ as n,l as o}from"./mermaid.core-rkuoyu1Y.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-BKxPBlKv.js";import"./index-CkGO8Fpq.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-rkuoyu1Y.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};
|