@yorz/cli 0.1.3 → 0.1.5
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/README.md +5 -2
- package/dist/cli/index.js +385 -28
- package/dist/gui/assets/{abnfDiagram-VRR7QNED-DE_Lwnyj.js → abnfDiagram-VRR7QNED-BjiKWU_r.js} +1 -1
- package/dist/gui/assets/{arc-0XKFeKL1.js → arc--ZszoeC5.js} +1 -1
- package/dist/gui/assets/{architectureDiagram-ZJ3FMSHR-WVMr6CTB.js → architectureDiagram-ZJ3FMSHR-D8beCiJM.js} +1 -1
- package/dist/gui/assets/{blockDiagram-677ZJIJ3-JmkelTQ6.js → blockDiagram-677ZJIJ3-XTjBv4Yl.js} +1 -1
- package/dist/gui/assets/{c4Diagram-LMCZKHZV-BYvSE_vv.js → c4Diagram-LMCZKHZV-B8mRAP6M.js} +1 -1
- package/dist/gui/assets/channel-DSEvjkHE.js +1 -0
- package/dist/gui/assets/{chunk-2Q5K7J3B-cgJ3ifz_.js → chunk-2Q5K7J3B-yiwKrUMh.js} +1 -1
- package/dist/gui/assets/{chunk-32BRIVSS-DR-AYVVA.js → chunk-32BRIVSS-BKUpEqmm.js} +1 -1
- package/dist/gui/assets/{chunk-5VM5RSS4-Di4z9gEz.js → chunk-5VM5RSS4-DbsGyMz5.js} +1 -1
- package/dist/gui/assets/{chunk-EX3LRPZG-CtCaJMGG.js → chunk-EX3LRPZG-DTBuQkne.js} +1 -1
- package/dist/gui/assets/{chunk-JWPE2WC7-EjoKlGne.js → chunk-JWPE2WC7-Durur7_4.js} +1 -1
- package/dist/gui/assets/{chunk-MOJQB5TN-ndMzM7-f.js → chunk-MOJQB5TN-DXNE2VJB.js} +1 -1
- package/dist/gui/assets/{chunk-RYQCIY6F-CDdJsSDv.js → chunk-RYQCIY6F-HY8qhnee.js} +1 -1
- package/dist/gui/assets/{chunk-V7JOEXUC-BptnbB4R.js → chunk-V7JOEXUC-BXRxPy5M.js} +1 -1
- package/dist/gui/assets/{chunk-VR4S4FIN-CF8Dsx8K.js → chunk-VR4S4FIN-Ws4fVn18.js} +1 -1
- package/dist/gui/assets/{chunk-XXDRQBXY-CgGWri-V.js → chunk-XXDRQBXY-CwHBGyO1.js} +1 -1
- package/dist/gui/assets/classDiagram-OUVF2IWQ-BN1qwPdD.js +1 -0
- package/dist/gui/assets/classDiagram-v2-EOCWNBFH-BN1qwPdD.js +1 -0
- package/dist/gui/assets/{cose-bilkent-JH36ORCC-Bm9uE-P8.js → cose-bilkent-JH36ORCC-C3oDctXM.js} +1 -1
- package/dist/gui/assets/{cynefin-VYW2F7L2-Dd-Apprt.js → cynefin-VYW2F7L2-BjremdIM.js} +1 -1
- package/dist/gui/assets/{cynefinDiagram-TSTJHNR4-DpGBOFX2.js → cynefinDiagram-TSTJHNR4-Cwe2fD65.js} +1 -1
- package/dist/gui/assets/{dagre-VKFMJZFB-DmKBW-UB.js → dagre-VKFMJZFB-Bx2kzeqs.js} +1 -1
- package/dist/gui/assets/{diagram-FQU43EPY-CYuUGN7Z.js → diagram-FQU43EPY-BVyLKNdq.js} +1 -1
- package/dist/gui/assets/{diagram-G47NLZAW-BZ-zUUWn.js → diagram-G47NLZAW-DicBAwcf.js} +1 -1
- package/dist/gui/assets/{diagram-NH7WQ7WH-D2qb5dA_.js → diagram-NH7WQ7WH-BbRrvaYb.js} +1 -1
- package/dist/gui/assets/{diagram-OA4YK3LP-BSy8-VUz.js → diagram-OA4YK3LP-C2YIUXV5.js} +1 -1
- package/dist/gui/assets/{diagram-WEI45ONY-B-vTVzM8.js → diagram-WEI45ONY-DJHPHFaZ.js} +1 -1
- package/dist/gui/assets/{ebnfDiagram-CCIWWBDH-cKb33glS.js → ebnfDiagram-CCIWWBDH-DtDW0rR6.js} +1 -1
- package/dist/gui/assets/{erDiagram-Q63AITRT-DvWEFI1U.js → erDiagram-Q63AITRT-C5CAH1UZ.js} +1 -1
- package/dist/gui/assets/{flowDiagram-23GEKE2U-CfvFgLP2.js → flowDiagram-23GEKE2U-DA2WblHa.js} +1 -1
- package/dist/gui/assets/{ganttDiagram-NO4QXBWP-BnDujV-k.js → ganttDiagram-NO4QXBWP-TMRYyAbG.js} +1 -1
- package/dist/gui/assets/{gitGraphDiagram-IHSO6WYX-Sv91FaB5.js → gitGraphDiagram-IHSO6WYX-Ci-GVNac.js} +1 -1
- package/dist/gui/assets/index-Bq3A8DU2.js +21 -0
- package/dist/gui/assets/{infoDiagram-FWYZ7A6U-BE3WS_us.js → infoDiagram-FWYZ7A6U-BV4Ye9h-.js} +1 -1
- package/dist/gui/assets/{ishikawaDiagram-FXEZZL3T-FObQPAd_.js → ishikawaDiagram-FXEZZL3T-CLBTOnXf.js} +1 -1
- package/dist/gui/assets/{journeyDiagram-5HDEW3XC-D3RAFL7x.js → journeyDiagram-5HDEW3XC-BINYoOlq.js} +1 -1
- package/dist/gui/assets/{kanban-definition-HUTT4EX6-Bx1DS2KG.js → kanban-definition-HUTT4EX6-Bvoywhuo.js} +1 -1
- package/dist/gui/assets/{linear-oevdTPQK.js → linear-CldLHplp.js} +1 -1
- package/dist/gui/assets/{mermaid.core-jn1Xktvs.js → mermaid.core-1Uynhu-S.js} +4 -4
- package/dist/gui/assets/{mindmap-definition-LN4V7U3C-xLT5IJki.js → mindmap-definition-LN4V7U3C-Sv5B_zGg.js} +1 -1
- package/dist/gui/assets/{pegDiagram-2B236MQR-DToAMrXG.js → pegDiagram-2B236MQR-CyYAur_9.js} +1 -1
- package/dist/gui/assets/{pieDiagram-ENE6RG2P-Cw6tv4YJ.js → pieDiagram-ENE6RG2P-D3P7lu31.js} +1 -1
- package/dist/gui/assets/{quadrantDiagram-ABIIQ3AL-GW5Knopm.js → quadrantDiagram-ABIIQ3AL-zmQrhKVf.js} +1 -1
- package/dist/gui/assets/{railroadDiagram-RFXS5EU6-CuP1sa-2.js → railroadDiagram-RFXS5EU6-D5HlXQ4M.js} +1 -1
- package/dist/gui/assets/{requirementDiagram-TGXJPOKE-D8IcCo1X.js → requirementDiagram-TGXJPOKE-BJcv5tpR.js} +1 -1
- package/dist/gui/assets/{sankeyDiagram-HTMAVEWB-CfT_C9uh.js → sankeyDiagram-HTMAVEWB-9R97Q-65.js} +1 -1
- package/dist/gui/assets/{sequenceDiagram-DBY2YBRQ-BwUwWFYe.js → sequenceDiagram-DBY2YBRQ-D6v2e_UA.js} +1 -1
- package/dist/gui/assets/{sizeCapture-X5ZJPWSS-DyBlcl4H.js → sizeCapture-X5ZJPWSS-5Ee75AoR.js} +1 -1
- package/dist/gui/assets/{stateDiagram-2N3HPSRC-yv8DkbvF.js → stateDiagram-2N3HPSRC-CiFKPVFd.js} +1 -1
- package/dist/gui/assets/stateDiagram-v2-6OUMAXLB-XeM3QPuf.js +1 -0
- package/dist/gui/assets/{swimlanes-5IMT3BWC-BnOmKdmr.js → swimlanes-5IMT3BWC-DejeKz32.js} +2 -2
- package/dist/gui/assets/swimlanesDiagram-G3AALYLV-BaUP5W6u.js +8 -0
- package/dist/gui/assets/{timeline-definition-FHXFAJF6-C6_-GVjE.js → timeline-definition-FHXFAJF6-CpW-bina.js} +1 -1
- package/dist/gui/assets/{vennDiagram-L72KCM5P-D_N0uLk2.js → vennDiagram-L72KCM5P-DFEDh4dV.js} +1 -1
- package/dist/gui/assets/{wardleyDiagram-EHGQE667-CnNoxFYY.js → wardleyDiagram-EHGQE667-B4Blcc-a.js} +1 -1
- package/dist/gui/assets/{xychartDiagram-FW5EYKEG-CloORw9z.js → xychartDiagram-FW5EYKEG-D9idxadT.js} +1 -1
- package/dist/gui/index.html +1 -1
- package/package.json +2 -2
- package/dist/_commonjsHelpers-DyI1JsEH.js +0 -34
- package/dist/abnfDiagram-VRR7QNED-UQS77aUi.js +0 -119
- package/dist/api-DrYc_Ds_.js +0 -129852
- package/dist/arc-B1cAL3U1.js +0 -132
- package/dist/architectureDiagram-ZJ3FMSHR-CfWOhs-q.js +0 -8816
- package/dist/blockDiagram-677ZJIJ3-CLOAAFZa.js +0 -3796
- package/dist/c4Diagram-LMCZKHZV-BGdELGkb.js +0 -2483
- package/dist/certs-BeimSwB3.js +0 -14071
- package/dist/certs-C4t5lAmJ.js +0 -14071
- package/dist/certs-CLLngjpY.js +0 -14071
- package/dist/certs-D3fTB-0_.js +0 -14071
- package/dist/channel-_gQD3mZ8.js +0 -8
- package/dist/chunk-2Q5K7J3B-DIJkMPWD.js +0 -20
- package/dist/chunk-32BRIVSS-CIQb7-9I.js +0 -117
- package/dist/chunk-5VM5RSS4-DmlAsh6o.js +0 -20
- package/dist/chunk-EX3LRPZG-BEXyn5R-.js +0 -1989
- package/dist/chunk-JWPE2WC7-XiIefccF.js +0 -17
- package/dist/chunk-MOJQB5TN-CC5OBDWw.js +0 -861
- package/dist/chunk-RYQCIY6F-DQacsGpB.js +0 -475
- package/dist/chunk-V7JOEXUC-TLRsIUvf.js +0 -2027
- package/dist/chunk-VR4S4FIN-9AfN7RDF.js +0 -25
- package/dist/chunk-XXDRQBXY-DhWucSRr.js +0 -14
- package/dist/classDiagram-OUVF2IWQ-CN55rRkB.js +0 -20
- package/dist/classDiagram-v2-EOCWNBFH-CN55rRkB.js +0 -20
- package/dist/cose-bilkent-JH36ORCC-8uGYe6_d.js +0 -4944
- package/dist/cynefin-VYW2F7L2-BwTeE-TI.js +0 -32061
- package/dist/cynefinDiagram-TSTJHNR4-DM7ixE-v.js +0 -454
- package/dist/cytoscape.esm-BTopYfIb.js +0 -30347
- package/dist/dagre-VKFMJZFB-blEDoYen.js +0 -522
- package/dist/defaultLocale-wHUL1xE2.js +0 -207
- package/dist/diagram-FQU43EPY-MEZlmmdi.js +0 -633
- package/dist/diagram-G47NLZAW-DZOZvHqp.js +0 -857
- package/dist/diagram-NH7WQ7WH-ChpmPbZz.js +0 -213
- package/dist/diagram-OA4YK3LP-oy4yvrnL.js +0 -489
- package/dist/diagram-WEI45ONY-B3nx1cYt.js +0 -305
- package/dist/ebnfDiagram-CCIWWBDH-BASj7BoO.js +0 -139
- package/dist/erDiagram-Q63AITRT-lujHq-S9.js +0 -1239
- package/dist/flowDiagram-23GEKE2U-BdsAVPgU.js +0 -2349
- package/dist/ganttDiagram-NO4QXBWP-DUUP4lsu.js +0 -3733
- package/dist/gitGraphDiagram-IHSO6WYX-BdIPAtb0.js +0 -1374
- package/dist/graph-CE8jV7cI.js +0 -2043
- package/dist/gui/assets/channel-BhMtSKKb.js +0 -1
- package/dist/gui/assets/classDiagram-OUVF2IWQ-DiPaZ7LY.js +0 -1
- package/dist/gui/assets/classDiagram-v2-EOCWNBFH-DiPaZ7LY.js +0 -1
- package/dist/gui/assets/index-Do-LzYBw.js +0 -21
- package/dist/gui/assets/stateDiagram-v2-6OUMAXLB-BspjtPpt.js +0 -1
- package/dist/gui/assets/swimlanesDiagram-G3AALYLV-BgPC3dJX.js +0 -8
- package/dist/index--GoVvfUP.js +0 -5447
- package/dist/index-3-WDiDAh.js +0 -5466
- package/dist/index-CHBXZAxg.js +0 -5460
- package/dist/index-DeCq8xn7.js +0 -5460
- package/dist/infoDiagram-FWYZ7A6U-D9wo93kg.js +0 -32
- package/dist/init-DDGa2CQM.js +0 -17
- package/dist/ishikawaDiagram-FXEZZL3T-DZh3_kt2.js +0 -968
- package/dist/journeyDiagram-5HDEW3XC-C8RWHIn0.js +0 -1256
- package/dist/kanban-definition-HUTT4EX6-B7qQtB5a.js +0 -1053
- package/dist/katex-WjDlQEfU.js +0 -14500
- package/dist/layout-DQAYh_L7.js +0 -2360
- package/dist/linear-C_kZRZXS.js +0 -341
- package/dist/map-BElV7BMC.js +0 -299
- package/dist/mermaid.core-Dy_tFRs7.js +0 -26495
- package/dist/mindmap-definition-LN4V7U3C-BzHCd5Ab.js +0 -1181
- package/dist/ordinal-C2kkg180.js +0 -77
- package/dist/pegDiagram-2B236MQR-B046bQWM.js +0 -127
- package/dist/pieDiagram-ENE6RG2P-B5_W2CZy.js +0 -316
- package/dist/quadrantDiagram-ABIIQ3AL-Bbpt496h.js +0 -1342
- package/dist/railroadDiagram-RFXS5EU6-10XIH3X0.js +0 -93
- package/dist/requirementDiagram-TGXJPOKE-Dt1QyccY.js +0 -1205
- package/dist/sankeyDiagram-HTMAVEWB-CnqRAq7M.js +0 -1274
- package/dist/sequenceDiagram-DBY2YBRQ-DtJLSXoz.js +0 -4515
- package/dist/sizeCapture-X5ZJPWSS-DUl5ZEo3.js +0 -63
- package/dist/stateDiagram-2N3HPSRC-b-qzcVNj.js +0 -449
- package/dist/stateDiagram-v2-6OUMAXLB-KjDlRfc7.js +0 -20
- package/dist/swimlanes-5IMT3BWC-CAjGnQLa.js +0 -8553
- package/dist/swimlanesDiagram-G3AALYLV-DiOi9bzU.js +0 -16
- package/dist/timeline-definition-FHXFAJF6-Bme2FWbh.js +0 -1597
- package/dist/vennDiagram-L72KCM5P-BUQgnZDB.js +0 -2516
- package/dist/wardleyDiagram-EHGQE667-DHR2Avlu.js +0 -976
- package/dist/xychartDiagram-FW5EYKEG-V4K5eBMS.js +0 -2000
package/README.md
CHANGED
|
@@ -34,13 +34,15 @@ npx -p @yorz/cli yorz <command>
|
|
|
34
34
|
yorz serve
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
This launches the YorZ Service (HTTP + SSE + static GUI). Open `http://localhost:7423` in your browser to access the dashboard.
|
|
37
|
+
This launches the YorZ Service (HTTP + SSE + static GUI) in the background by default. Open `http://localhost:7423` in your browser to access the dashboard.
|
|
38
38
|
|
|
39
39
|
Options:
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
42
|
yorz serve --port 8080 # custom port
|
|
43
43
|
yorz serve --open # auto-open browser
|
|
44
|
+
yorz serve --foreground # run in foreground
|
|
45
|
+
yorz serve stop # stop the background service
|
|
44
46
|
```
|
|
45
47
|
|
|
46
48
|
### Step 2 — Add a Project
|
|
@@ -75,7 +77,8 @@ Then ask your agent (Claude Code / OpenCode) to process it. The skill handles th
|
|
|
75
77
|
|
|
76
78
|
| Command | Description |
|
|
77
79
|
| ----------------------- | ---------------------------------------------------------------- |
|
|
78
|
-
| `yorz serve` | Start the YorZ Service
|
|
80
|
+
| `yorz serve` | Start or reuse the YorZ Service in the background. Multi-project. |
|
|
81
|
+
| `yorz serve stop` | Stop the background YorZ Service. |
|
|
79
82
|
| `yorz add <path>` | Initialize and register a directory as a YorZ project. |
|
|
80
83
|
| `yorz install skills` | Install the yorz-spec skill into Claude Code / OpenCode. |
|
|
81
84
|
| `yorz uninstall skills` | Remove the yorz-spec skill from agents. |
|
package/dist/cli/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { homedir, networkInterfaces } from "node:os";
|
|
3
3
|
import { Command, Option } from "commander";
|
|
4
|
-
import { stat, rm, mkdir, writeFile, readFile, access, rename, readdir, copyFile, open } from "node:fs/promises";
|
|
4
|
+
import { stat, rm, mkdir, writeFile, readFile, access, rename, readdir, copyFile, open, appendFile } from "node:fs/promises";
|
|
5
5
|
import { join, dirname, extname, resolve, sep, isAbsolute, basename as basename$1, relative, normalize } from "node:path";
|
|
6
6
|
import { spawn, execFile } from "node:child_process";
|
|
7
7
|
import { existsSync, statSync, mkdirSync, watch, readFileSync, createWriteStream } from "node:fs";
|
|
@@ -10,13 +10,14 @@ import { Hono } from "hono";
|
|
|
10
10
|
import { randomUUID, createHash } from "node:crypto";
|
|
11
11
|
import { promisify } from "node:util";
|
|
12
12
|
import { streamSSE } from "hono/streaming";
|
|
13
|
+
import { fileURLToPath } from "node:url";
|
|
13
14
|
import trash from "trash";
|
|
14
15
|
import matter from "gray-matter";
|
|
15
16
|
import chokidar from "chokidar";
|
|
16
17
|
import { EventEmitter } from "node:events";
|
|
17
18
|
import { createInterface } from "node:readline/promises";
|
|
18
19
|
import MarkdownIt from "markdown-it";
|
|
19
|
-
const version = "0.1.
|
|
20
|
+
const version = "0.1.5";
|
|
20
21
|
const pkg = {
|
|
21
22
|
version
|
|
22
23
|
};
|
|
@@ -68,6 +69,13 @@ const claudeAdapter = {
|
|
|
68
69
|
return join(ctx.cwd, ".claude", "skills");
|
|
69
70
|
}
|
|
70
71
|
};
|
|
72
|
+
const codexAdapter = {
|
|
73
|
+
name: "codex",
|
|
74
|
+
resolveSkillsDir(scope, ctx) {
|
|
75
|
+
if (scope === "user") return join(ctx.home, ".codex", "skills");
|
|
76
|
+
return join(ctx.cwd, ".codex", "skills");
|
|
77
|
+
}
|
|
78
|
+
};
|
|
71
79
|
const opencodeAdapter = {
|
|
72
80
|
name: "opencode",
|
|
73
81
|
resolveSkillsDir(scope, ctx) {
|
|
@@ -77,7 +85,8 @@ const opencodeAdapter = {
|
|
|
77
85
|
};
|
|
78
86
|
const ADAPTERS = {
|
|
79
87
|
claude: claudeAdapter,
|
|
80
|
-
opencode: opencodeAdapter
|
|
88
|
+
opencode: opencodeAdapter,
|
|
89
|
+
codex: codexAdapter
|
|
81
90
|
};
|
|
82
91
|
function getAdapter(name) {
|
|
83
92
|
if (name in ADAPTERS) return ADAPTERS[name];
|
|
@@ -1395,15 +1404,19 @@ class EventsHub {
|
|
|
1395
1404
|
return await next;
|
|
1396
1405
|
}
|
|
1397
1406
|
emit(s, topic, event, data) {
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
+
try {
|
|
1408
|
+
const frame = {
|
|
1409
|
+
event: "msg",
|
|
1410
|
+
data: JSON.stringify({ topic, event, data })
|
|
1411
|
+
};
|
|
1412
|
+
if (s.stream && !s.closed) {
|
|
1413
|
+
void s.stream.writeSSE(frame).catch(() => {
|
|
1414
|
+
});
|
|
1415
|
+
} else {
|
|
1416
|
+
s.queue.push(frame);
|
|
1417
|
+
}
|
|
1418
|
+
} catch (err) {
|
|
1419
|
+
console.error("[yorz] SSE emit error:", err);
|
|
1407
1420
|
}
|
|
1408
1421
|
}
|
|
1409
1422
|
async flush(s) {
|
|
@@ -1722,12 +1735,14 @@ function normalizeConfig$1(value) {
|
|
|
1722
1735
|
function normalizeAgent(value) {
|
|
1723
1736
|
if (typeof value === "string") {
|
|
1724
1737
|
if (value === "opencode") return { kind: "opencode" };
|
|
1738
|
+
if (value === "codex") return { kind: "codex" };
|
|
1725
1739
|
return { kind: "claude" };
|
|
1726
1740
|
}
|
|
1727
1741
|
if (!value || typeof value !== "object") return { kind: "claude" };
|
|
1728
1742
|
const obj = value;
|
|
1729
1743
|
const kind = obj.kind;
|
|
1730
1744
|
if (kind === "opencode") return { kind: "opencode" };
|
|
1745
|
+
if (kind === "codex") return { kind: "codex" };
|
|
1731
1746
|
if (kind === "custom") {
|
|
1732
1747
|
const cmd = typeof obj.cmd === "string" ? obj.cmd.trim() : "";
|
|
1733
1748
|
if (!cmd) return { kind: "claude" };
|
|
@@ -1806,6 +1821,7 @@ function parseAgent(value) {
|
|
|
1806
1821
|
const kind = obj.kind;
|
|
1807
1822
|
if (kind === "claude") return { value: { kind: "claude" } };
|
|
1808
1823
|
if (kind === "opencode") return { value: { kind: "opencode" } };
|
|
1824
|
+
if (kind === "codex") return { value: { kind: "codex" } };
|
|
1809
1825
|
if (kind === "custom") {
|
|
1810
1826
|
const cmd = obj.cmd;
|
|
1811
1827
|
if (typeof cmd !== "string" || !cmd.trim()) {
|
|
@@ -1826,7 +1842,7 @@ function parseAgent(value) {
|
|
|
1826
1842
|
}
|
|
1827
1843
|
return { value: { kind: "custom", cmd: cmd.trim(), args } };
|
|
1828
1844
|
}
|
|
1829
|
-
return { error: "agent.kind must be claude | opencode | custom" };
|
|
1845
|
+
return { error: "agent.kind must be claude | opencode | codex | custom" };
|
|
1830
1846
|
}
|
|
1831
1847
|
function parseSpecsDir(value) {
|
|
1832
1848
|
const fallback = defaultProjectConfig().specsDir;
|
|
@@ -2214,9 +2230,14 @@ function createStaticRoutes(guiRoot) {
|
|
|
2214
2230
|
return app;
|
|
2215
2231
|
}
|
|
2216
2232
|
function defaultGuiRoot() {
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2233
|
+
try {
|
|
2234
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
2235
|
+
return resolve(here, "..", "gui");
|
|
2236
|
+
} catch {
|
|
2237
|
+
const entry = process.argv[1];
|
|
2238
|
+
if (entry) return resolve(dirname(entry), "..", "gui");
|
|
2239
|
+
return resolve(process.cwd(), "dist", "gui");
|
|
2240
|
+
}
|
|
2220
2241
|
}
|
|
2221
2242
|
function resolveStaticFile(root, urlPath) {
|
|
2222
2243
|
const safe = normalize(urlPath).replace(/^\/+/, "");
|
|
@@ -2804,6 +2825,10 @@ function createApp(opts) {
|
|
|
2804
2825
|
api.route("/", createEventsRoutes(resolveProject, opts.registry, projectsBus));
|
|
2805
2826
|
app.route("/api", api);
|
|
2806
2827
|
app.route("/", createStaticRoutes(opts.guiRoot));
|
|
2828
|
+
app.onError((err, c) => {
|
|
2829
|
+
console.error("[yorz] route error:", err);
|
|
2830
|
+
return c.json({ error: "Internal Server Error", message: err.message }, 500);
|
|
2831
|
+
});
|
|
2807
2832
|
return app;
|
|
2808
2833
|
}
|
|
2809
2834
|
const SECTIONS = [
|
|
@@ -3367,6 +3392,22 @@ const BUILTIN = {
|
|
|
3367
3392
|
env: (cwd) => ({
|
|
3368
3393
|
PWD: cwd
|
|
3369
3394
|
})
|
|
3395
|
+
},
|
|
3396
|
+
codex: {
|
|
3397
|
+
cmd: "codex",
|
|
3398
|
+
// Codex CLI 的无人值守入口是 `codex exec <prompt>`。这里显式传入目标 cwd,
|
|
3399
|
+
// 并用 exec 支持的 bypass 参数关闭审批/沙箱,以对齐 claude bypassPermissions
|
|
3400
|
+
// 与 opencode skip-permissions 的后台执行语义;服务端 spawn 的 cwd 也会设置
|
|
3401
|
+
// 为同一个目录,作为进程工作目录兜底。
|
|
3402
|
+
args: (prompt, cwd) => [
|
|
3403
|
+
"exec",
|
|
3404
|
+
"--cd",
|
|
3405
|
+
cwd ?? ".",
|
|
3406
|
+
"--skip-git-repo-check",
|
|
3407
|
+
"--dangerously-bypass-approvals-and-sandbox",
|
|
3408
|
+
prompt
|
|
3409
|
+
],
|
|
3410
|
+
streamFormat: "text"
|
|
3370
3411
|
}
|
|
3371
3412
|
};
|
|
3372
3413
|
function resolveAgentCmd(opts) {
|
|
@@ -3402,11 +3443,13 @@ function readAgentCmd(cwd) {
|
|
|
3402
3443
|
const agent = data.agent;
|
|
3403
3444
|
if (typeof agent === "string") {
|
|
3404
3445
|
if (agent === "opencode") return BUILTIN.opencode;
|
|
3446
|
+
if (agent === "codex") return BUILTIN.codex;
|
|
3405
3447
|
return BUILTIN.claude;
|
|
3406
3448
|
}
|
|
3407
3449
|
if (!agent || typeof agent !== "object") return BUILTIN.claude;
|
|
3408
3450
|
const kind = agent.kind;
|
|
3409
3451
|
if (kind === "opencode") return BUILTIN.opencode;
|
|
3452
|
+
if (kind === "codex") return BUILTIN.codex;
|
|
3410
3453
|
if (kind === "custom") {
|
|
3411
3454
|
const cmd = agent.cmd;
|
|
3412
3455
|
const argsRaw = agent.args;
|
|
@@ -3566,15 +3609,19 @@ class AgentRunner {
|
|
|
3566
3609
|
void run();
|
|
3567
3610
|
};
|
|
3568
3611
|
const pushStdout = (text) => {
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3612
|
+
try {
|
|
3613
|
+
if (!text) return;
|
|
3614
|
+
append(text);
|
|
3615
|
+
writeToLog(text);
|
|
3616
|
+
emitter.emit("stdout", text);
|
|
3617
|
+
} catch (err) {
|
|
3618
|
+
console.error("[yorz] pushStdout error:", err);
|
|
3619
|
+
}
|
|
3573
3620
|
};
|
|
3574
3621
|
const cmd = this.resolveCmd();
|
|
3575
3622
|
let child;
|
|
3576
3623
|
try {
|
|
3577
|
-
child = spawn(cmd.cmd, cmd.args(input.prompt), {
|
|
3624
|
+
child = spawn(cmd.cmd, cmd.args(input.prompt, this.cwd), {
|
|
3578
3625
|
cwd: this.cwd,
|
|
3579
3626
|
env: { ...process.env, ...cmd.env?.(this.cwd) ?? {} },
|
|
3580
3627
|
stdio: ["ignore", "pipe", "pipe"],
|
|
@@ -4205,6 +4252,7 @@ async function start(opts = {}) {
|
|
|
4205
4252
|
console.log(` - ${p.name} -> ${p.path}`);
|
|
4206
4253
|
}
|
|
4207
4254
|
console.log(`agent heartbeat enabled (interval=${HEARTBEAT_INTERVAL_MS / 1e3}s)`);
|
|
4255
|
+
installGlobalErrorHandlers();
|
|
4208
4256
|
if (opts.open) await tryOpenBrowser(url);
|
|
4209
4257
|
return {
|
|
4210
4258
|
url,
|
|
@@ -4269,18 +4317,60 @@ async function tryOpenBrowser(url) {
|
|
|
4269
4317
|
} catch {
|
|
4270
4318
|
}
|
|
4271
4319
|
}
|
|
4320
|
+
let errorLogReady = false;
|
|
4321
|
+
async function ensureErrorLogDir() {
|
|
4322
|
+
const dir = join(resolveGlobalConfigDir(), "logs");
|
|
4323
|
+
if (!errorLogReady) {
|
|
4324
|
+
await mkdir(dir, { recursive: true });
|
|
4325
|
+
errorLogReady = true;
|
|
4326
|
+
}
|
|
4327
|
+
return join(dir, "serve-errors.log");
|
|
4328
|
+
}
|
|
4329
|
+
function logCrash(kind, payload) {
|
|
4330
|
+
const ts = (/* @__PURE__ */ new Date()).toISOString();
|
|
4331
|
+
const body = payload instanceof Error ? payload.stack ?? payload.message : String(payload);
|
|
4332
|
+
const line = `[${ts}] [${kind}] ${body}
|
|
4333
|
+
`;
|
|
4334
|
+
console.error(`[yorz] ${kind}:`, payload);
|
|
4335
|
+
void ensureErrorLogDir().then((fp) => appendFile(fp, line, "utf8")).catch(() => {
|
|
4336
|
+
});
|
|
4337
|
+
}
|
|
4338
|
+
function installGlobalErrorHandlers() {
|
|
4339
|
+
if (process.listenerCount("uncaughtException") > 0) return;
|
|
4340
|
+
process.on("uncaughtException", (err) => {
|
|
4341
|
+
logCrash("uncaughtException", err);
|
|
4342
|
+
});
|
|
4343
|
+
process.on("unhandledRejection", (reason) => {
|
|
4344
|
+
logCrash("unhandledRejection", reason);
|
|
4345
|
+
});
|
|
4346
|
+
}
|
|
4347
|
+
const DEFAULT_SERVE_PORT = 7423;
|
|
4348
|
+
const RUNTIME_FILE = "runtime.json";
|
|
4349
|
+
const START_LOCK_DIR = "serve.lock";
|
|
4350
|
+
const START_WAIT_MS = 5e3;
|
|
4272
4351
|
async function runServe(opts) {
|
|
4352
|
+
if (!opts.foreground) {
|
|
4353
|
+
return startBackgroundServe(opts);
|
|
4354
|
+
}
|
|
4273
4355
|
const handle = await start({
|
|
4274
4356
|
port: opts.port,
|
|
4275
4357
|
open: opts.open,
|
|
4276
4358
|
cwd: opts.cwd ?? process.cwd(),
|
|
4277
4359
|
noRegisterCwd: opts.noRegisterCwd
|
|
4278
4360
|
});
|
|
4361
|
+
await upsertProcess({
|
|
4362
|
+
pid: process.pid,
|
|
4363
|
+
port: handle.port,
|
|
4364
|
+
url: handle.url,
|
|
4365
|
+
startedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
4366
|
+
});
|
|
4367
|
+
console.log(`Stop with: yorz serve stop`);
|
|
4279
4368
|
const shutdown = async () => {
|
|
4280
4369
|
console.log("\nShutting down YorZ Service…");
|
|
4281
4370
|
try {
|
|
4282
4371
|
await handle.close();
|
|
4283
4372
|
} finally {
|
|
4373
|
+
await removeRuntimeForPid(process.pid);
|
|
4284
4374
|
process.exit(0);
|
|
4285
4375
|
}
|
|
4286
4376
|
};
|
|
@@ -4288,6 +4378,265 @@ async function runServe(opts) {
|
|
|
4288
4378
|
process.once("SIGTERM", () => void shutdown());
|
|
4289
4379
|
return handle;
|
|
4290
4380
|
}
|
|
4381
|
+
function startBackgroundServe(opts) {
|
|
4382
|
+
return withStartLock(async () => {
|
|
4383
|
+
const live = await readLiveProcesses();
|
|
4384
|
+
if (live.length > 0) {
|
|
4385
|
+
const existing = live[0];
|
|
4386
|
+
console.log(`YorZ Service is already running in background (pid=${existing.pid}).`);
|
|
4387
|
+
console.log(`Open ${existing.url}`);
|
|
4388
|
+
console.log(`Stop with: yorz serve stop`);
|
|
4389
|
+
return {
|
|
4390
|
+
background: true,
|
|
4391
|
+
reused: true,
|
|
4392
|
+
pid: existing.pid,
|
|
4393
|
+
port: existing.port,
|
|
4394
|
+
url: existing.url
|
|
4395
|
+
};
|
|
4396
|
+
}
|
|
4397
|
+
const entry = process.argv[1];
|
|
4398
|
+
if (!entry) throw new Error("Cannot resolve CLI entrypoint for background service");
|
|
4399
|
+
const child = spawn(process.execPath, [entry, "serve", ...backgroundArgs(opts)], {
|
|
4400
|
+
detached: true,
|
|
4401
|
+
stdio: "ignore"
|
|
4402
|
+
});
|
|
4403
|
+
child.unref();
|
|
4404
|
+
const runtime = await waitForRuntime(child.pid, START_WAIT_MS);
|
|
4405
|
+
const port = runtime?.port ?? opts.port ?? DEFAULT_SERVE_PORT;
|
|
4406
|
+
const url = runtime?.url ?? `http://localhost:${port}/`;
|
|
4407
|
+
console.log(`YorZ Service started in background (pid=${child.pid ?? "unknown"}).`);
|
|
4408
|
+
console.log(`Open ${url}${runtime ? "" : ` (or the next free port if ${port} is busy).`}`);
|
|
4409
|
+
console.log(`Stop with: yorz serve stop`);
|
|
4410
|
+
return {
|
|
4411
|
+
background: true,
|
|
4412
|
+
pid: child.pid,
|
|
4413
|
+
url,
|
|
4414
|
+
port
|
|
4415
|
+
};
|
|
4416
|
+
});
|
|
4417
|
+
}
|
|
4418
|
+
function backgroundArgs(opts) {
|
|
4419
|
+
const args = ["--foreground"];
|
|
4420
|
+
if (opts.port !== void 0) args.push("--port", String(opts.port));
|
|
4421
|
+
if (opts.open) args.push("--open");
|
|
4422
|
+
if (opts.cwd) args.push("--cwd", opts.cwd);
|
|
4423
|
+
if (opts.noRegisterCwd) args.push("--no-register-cwd");
|
|
4424
|
+
return args;
|
|
4425
|
+
}
|
|
4426
|
+
async function runStopServe() {
|
|
4427
|
+
const all = await readAllProcesses();
|
|
4428
|
+
if (all.length === 0) {
|
|
4429
|
+
return {
|
|
4430
|
+
stopped: false,
|
|
4431
|
+
stoppedPids: [],
|
|
4432
|
+
urls: [],
|
|
4433
|
+
message: "YorZ Service is not running."
|
|
4434
|
+
};
|
|
4435
|
+
}
|
|
4436
|
+
const alive = all.filter((p) => isProcessAlive(p.pid));
|
|
4437
|
+
const dead = all.filter((p) => !isProcessAlive(p.pid));
|
|
4438
|
+
if (alive.length === 0) {
|
|
4439
|
+
await removeRuntime();
|
|
4440
|
+
const deadPidList = dead.map((p) => `pid=${p.pid}`).join(", ");
|
|
4441
|
+
return {
|
|
4442
|
+
stopped: false,
|
|
4443
|
+
stoppedPids: [],
|
|
4444
|
+
urls: [],
|
|
4445
|
+
message: `YorZ Service was not running; removed stale runtime for ${deadPidList}.`
|
|
4446
|
+
};
|
|
4447
|
+
}
|
|
4448
|
+
const stoppedPids = [];
|
|
4449
|
+
const stoppedUrls = [];
|
|
4450
|
+
const failedPids = [];
|
|
4451
|
+
for (const proc of alive) {
|
|
4452
|
+
try {
|
|
4453
|
+
process.kill(proc.pid, "SIGTERM");
|
|
4454
|
+
} catch {
|
|
4455
|
+
failedPids.push(proc.pid);
|
|
4456
|
+
continue;
|
|
4457
|
+
}
|
|
4458
|
+
let stopped = await waitForProcessExit(proc.pid, 2e3);
|
|
4459
|
+
if (!stopped) {
|
|
4460
|
+
try {
|
|
4461
|
+
process.kill(proc.pid, "SIGKILL");
|
|
4462
|
+
} catch {
|
|
4463
|
+
}
|
|
4464
|
+
stopped = await waitForProcessExit(proc.pid, 2e3);
|
|
4465
|
+
}
|
|
4466
|
+
if (stopped) {
|
|
4467
|
+
stoppedPids.push(proc.pid);
|
|
4468
|
+
stoppedUrls.push(proc.url);
|
|
4469
|
+
} else {
|
|
4470
|
+
failedPids.push(proc.pid);
|
|
4471
|
+
}
|
|
4472
|
+
}
|
|
4473
|
+
if (failedPids.length === 0) {
|
|
4474
|
+
await removeRuntime();
|
|
4475
|
+
} else {
|
|
4476
|
+
await writeAllProcesses(all.filter((p) => failedPids.includes(p.pid)));
|
|
4477
|
+
}
|
|
4478
|
+
const pidList = stoppedPids.map((p) => `pid=${p}`).join(", ");
|
|
4479
|
+
if (failedPids.length > 0) {
|
|
4480
|
+
const failedList = failedPids.map((p) => `pid=${p}`).join(", ");
|
|
4481
|
+
return {
|
|
4482
|
+
stopped: stoppedPids.length > 0,
|
|
4483
|
+
stoppedPids,
|
|
4484
|
+
urls: stoppedUrls,
|
|
4485
|
+
message: `Stopped ${stoppedPids.length} process(es): ${pidList}. Still running: ${failedList}.`
|
|
4486
|
+
};
|
|
4487
|
+
}
|
|
4488
|
+
return {
|
|
4489
|
+
stopped: true,
|
|
4490
|
+
stoppedPids,
|
|
4491
|
+
urls: stoppedUrls,
|
|
4492
|
+
message: `Stopped ${stoppedPids.length} YorZ Service process(es): ${pidList}.`
|
|
4493
|
+
};
|
|
4494
|
+
}
|
|
4495
|
+
function runtimePath() {
|
|
4496
|
+
return join(resolveGlobalConfigDir(), RUNTIME_FILE);
|
|
4497
|
+
}
|
|
4498
|
+
function startLockPath() {
|
|
4499
|
+
return join(resolveGlobalConfigDir(), START_LOCK_DIR);
|
|
4500
|
+
}
|
|
4501
|
+
async function withStartLock(fn) {
|
|
4502
|
+
const lockPath = startLockPath();
|
|
4503
|
+
await mkdir(resolveGlobalConfigDir(), { recursive: true });
|
|
4504
|
+
try {
|
|
4505
|
+
await mkdir(lockPath, { recursive: false });
|
|
4506
|
+
} catch (err) {
|
|
4507
|
+
const code = err.code;
|
|
4508
|
+
if (code !== "EEXIST") throw err;
|
|
4509
|
+
const existing = await waitForLiveRuntime(START_WAIT_MS);
|
|
4510
|
+
if (existing) return await fn();
|
|
4511
|
+
await rm(lockPath, { recursive: true, force: true });
|
|
4512
|
+
await mkdir(lockPath, { recursive: false });
|
|
4513
|
+
}
|
|
4514
|
+
try {
|
|
4515
|
+
return await fn();
|
|
4516
|
+
} finally {
|
|
4517
|
+
await rm(lockPath, { recursive: true, force: true });
|
|
4518
|
+
}
|
|
4519
|
+
}
|
|
4520
|
+
async function waitForLiveRuntime(timeoutMs) {
|
|
4521
|
+
const until = Date.now() + timeoutMs;
|
|
4522
|
+
while (Date.now() < until) {
|
|
4523
|
+
const live = await readLiveProcesses();
|
|
4524
|
+
if (live.length > 0) return live[0];
|
|
4525
|
+
await sleep(100);
|
|
4526
|
+
}
|
|
4527
|
+
return null;
|
|
4528
|
+
}
|
|
4529
|
+
async function waitForRuntime(pid, timeoutMs) {
|
|
4530
|
+
const until = Date.now() + timeoutMs;
|
|
4531
|
+
while (Date.now() < until) {
|
|
4532
|
+
const live = await readLiveProcesses();
|
|
4533
|
+
const match = live.find((p) => pid === void 0 || p.pid === pid);
|
|
4534
|
+
if (match) return match;
|
|
4535
|
+
await sleep(100);
|
|
4536
|
+
}
|
|
4537
|
+
return null;
|
|
4538
|
+
}
|
|
4539
|
+
async function readLiveProcesses() {
|
|
4540
|
+
const all = await readAllProcesses();
|
|
4541
|
+
if (all.length === 0) return [];
|
|
4542
|
+
const alive = all.filter((p) => isProcessAlive(p.pid));
|
|
4543
|
+
const dead = all.filter((p) => !isProcessAlive(p.pid));
|
|
4544
|
+
if (dead.length > 0) {
|
|
4545
|
+
if (alive.length === 0) {
|
|
4546
|
+
await removeRuntime();
|
|
4547
|
+
} else {
|
|
4548
|
+
await writeAllProcesses(alive);
|
|
4549
|
+
}
|
|
4550
|
+
}
|
|
4551
|
+
return alive;
|
|
4552
|
+
}
|
|
4553
|
+
async function readAllProcesses() {
|
|
4554
|
+
const path = runtimePath();
|
|
4555
|
+
if (!existsSync(path)) return [];
|
|
4556
|
+
try {
|
|
4557
|
+
const raw = await readFile(path, "utf8");
|
|
4558
|
+
const parsed = JSON.parse(raw);
|
|
4559
|
+
if (parsed.version === 2 && Array.isArray(parsed.processes)) {
|
|
4560
|
+
return parsed.processes.filter(isValidEntry).map(toProcessEntry);
|
|
4561
|
+
}
|
|
4562
|
+
if (parsed.version === 1) {
|
|
4563
|
+
const entry = tryV1Entry(parsed);
|
|
4564
|
+
if (entry) return [entry];
|
|
4565
|
+
}
|
|
4566
|
+
return [];
|
|
4567
|
+
} catch {
|
|
4568
|
+
return [];
|
|
4569
|
+
}
|
|
4570
|
+
}
|
|
4571
|
+
function isValidEntry(obj) {
|
|
4572
|
+
if (typeof obj !== "object" || obj === null) return false;
|
|
4573
|
+
const o = obj;
|
|
4574
|
+
return typeof o.pid === "number" && typeof o.port === "number" && typeof o.url === "string" && typeof o.startedAt === "string";
|
|
4575
|
+
}
|
|
4576
|
+
function toProcessEntry(obj) {
|
|
4577
|
+
return {
|
|
4578
|
+
pid: obj.pid,
|
|
4579
|
+
port: obj.port,
|
|
4580
|
+
url: obj.url,
|
|
4581
|
+
startedAt: obj.startedAt
|
|
4582
|
+
};
|
|
4583
|
+
}
|
|
4584
|
+
function tryV1Entry(parsed) {
|
|
4585
|
+
if (typeof parsed.pid !== "number" || typeof parsed.port !== "number" || typeof parsed.url !== "string" || typeof parsed.startedAt !== "string") {
|
|
4586
|
+
return null;
|
|
4587
|
+
}
|
|
4588
|
+
return {
|
|
4589
|
+
pid: parsed.pid,
|
|
4590
|
+
port: parsed.port,
|
|
4591
|
+
url: parsed.url,
|
|
4592
|
+
startedAt: parsed.startedAt
|
|
4593
|
+
};
|
|
4594
|
+
}
|
|
4595
|
+
async function upsertProcess(entry) {
|
|
4596
|
+
const all = await readAllProcesses();
|
|
4597
|
+
const idx = all.findIndex((p) => p.pid === entry.pid);
|
|
4598
|
+
if (idx >= 0) all[idx] = entry;
|
|
4599
|
+
else all.push(entry);
|
|
4600
|
+
await writeAllProcesses(all);
|
|
4601
|
+
}
|
|
4602
|
+
async function writeAllProcesses(processes) {
|
|
4603
|
+
const path = runtimePath();
|
|
4604
|
+
await mkdir(resolveGlobalConfigDir(), { recursive: true });
|
|
4605
|
+
await writeFile(path, `${JSON.stringify({ version: 2, processes }, null, 2)}
|
|
4606
|
+
`, "utf8");
|
|
4607
|
+
}
|
|
4608
|
+
async function removeRuntimeForPid(pid) {
|
|
4609
|
+
const all = await readAllProcesses();
|
|
4610
|
+
const remaining = all.filter((p) => p.pid !== pid);
|
|
4611
|
+
if (remaining.length === all.length) return;
|
|
4612
|
+
if (remaining.length === 0) {
|
|
4613
|
+
await removeRuntime();
|
|
4614
|
+
} else {
|
|
4615
|
+
await writeAllProcesses(remaining);
|
|
4616
|
+
}
|
|
4617
|
+
}
|
|
4618
|
+
async function removeRuntime() {
|
|
4619
|
+
await rm(runtimePath(), { force: true });
|
|
4620
|
+
}
|
|
4621
|
+
function isProcessAlive(pid) {
|
|
4622
|
+
try {
|
|
4623
|
+
process.kill(pid, 0);
|
|
4624
|
+
return true;
|
|
4625
|
+
} catch {
|
|
4626
|
+
return false;
|
|
4627
|
+
}
|
|
4628
|
+
}
|
|
4629
|
+
async function waitForProcessExit(pid, timeoutMs) {
|
|
4630
|
+
const until = Date.now() + timeoutMs;
|
|
4631
|
+
while (Date.now() < until) {
|
|
4632
|
+
if (!isProcessAlive(pid)) return true;
|
|
4633
|
+
await sleep(100);
|
|
4634
|
+
}
|
|
4635
|
+
return !isProcessAlive(pid);
|
|
4636
|
+
}
|
|
4637
|
+
function sleep(ms) {
|
|
4638
|
+
return new Promise((resolve2) => setTimeout(resolve2, ms));
|
|
4639
|
+
}
|
|
4291
4640
|
class AddGitAbortedError extends Error {
|
|
4292
4641
|
constructor(message) {
|
|
4293
4642
|
super(message);
|
|
@@ -5331,11 +5680,11 @@ function installScopeTip(scopeSource) {
|
|
|
5331
5680
|
}
|
|
5332
5681
|
return null;
|
|
5333
5682
|
}
|
|
5334
|
-
const ALL_AGENTS = ["claude", "opencode"];
|
|
5683
|
+
const ALL_AGENTS = ["claude", "opencode", "codex"];
|
|
5335
5684
|
function parseAgents(value) {
|
|
5336
5685
|
if (value === "all") return ALL_AGENTS;
|
|
5337
|
-
if (value === "claude" || value === "opencode") return [value];
|
|
5338
|
-
throw new Error(`Invalid --agent: ${value}. Use 'claude' | 'opencode' | 'all'.`);
|
|
5686
|
+
if (value === "claude" || value === "opencode" || value === "codex") return [value];
|
|
5687
|
+
throw new Error(`Invalid --agent: ${value}. Use 'claude' | 'opencode' | 'codex' | 'all'.`);
|
|
5339
5688
|
}
|
|
5340
5689
|
function parseScope(value) {
|
|
5341
5690
|
if (value === "user" || value === "project") return value;
|
|
@@ -5347,7 +5696,7 @@ const installCmd = program.command("install").description("Install YorZ artifact
|
|
|
5347
5696
|
installCmd.action(() => {
|
|
5348
5697
|
installCmd.help();
|
|
5349
5698
|
});
|
|
5350
|
-
installCmd.command("skills").description("Install the yorz-spec skill into the target agent(s).").option("-a, --agent <agent>", "target agent: claude | opencode | all", "all").addOption(
|
|
5699
|
+
installCmd.command("skills").description("Install the yorz-spec skill into the target agent(s).").option("-a, --agent <agent>", "target agent: claude | opencode | codex | all", "all").addOption(
|
|
5351
5700
|
new Option("-s, --scope <scope>", "install scope: user | project").default(
|
|
5352
5701
|
INSTALL_SCOPE_DEFAULT
|
|
5353
5702
|
)
|
|
@@ -5371,7 +5720,7 @@ const uninstallCmd = program.command("uninstall").description("Remove YorZ artif
|
|
|
5371
5720
|
uninstallCmd.action(() => {
|
|
5372
5721
|
uninstallCmd.help();
|
|
5373
5722
|
});
|
|
5374
|
-
uninstallCmd.command("skills").description("Remove the yorz-spec skill from the target agent(s).").option("-a, --agent <agent>", "target agent: claude | opencode | all", "all").option("-s, --scope <scope>", "uninstall scope: user | project", INSTALL_SCOPE_DEFAULT).action(async (opts) => {
|
|
5723
|
+
uninstallCmd.command("skills").description("Remove the yorz-spec skill from the target agent(s).").option("-a, --agent <agent>", "target agent: claude | opencode | codex | all", "all").option("-s, --scope <scope>", "uninstall scope: user | project", INSTALL_SCOPE_DEFAULT).action(async (opts) => {
|
|
5375
5724
|
const agents = parseAgents(opts.agent);
|
|
5376
5725
|
const scope = parseScope(opts.scope);
|
|
5377
5726
|
for (const agent of agents) {
|
|
@@ -5413,10 +5762,13 @@ program.command("lint [paths...]").description("Lint spec.md / review.md files f
|
|
|
5413
5762
|
});
|
|
5414
5763
|
if (result.exitCode !== 0) process.exit(result.exitCode);
|
|
5415
5764
|
});
|
|
5416
|
-
program.command("serve").description("Start the YorZ Service (HTTP + SSE + static GUI; multi-project).").option("-p, --port <port>", "port to listen on", "7423").option("--open", "open the GUI in the default browser", false).option(
|
|
5765
|
+
const serveCmd = program.command("serve").description("Start the YorZ Service (HTTP + SSE + static GUI; multi-project).").option("-p, --port <port>", "port to listen on", "7423").option("--open", "open the GUI in the default browser", false).option("--foreground", "run the service in the foreground", false).option("--background", "run the service in the background (default)", false).option(
|
|
5417
5766
|
"--cwd <path>",
|
|
5418
5767
|
"directory to auto-register when it contains .yorz/ (default: process.cwd())"
|
|
5419
5768
|
).option("--no-register-cwd", "do not auto-register the current directory").action(async (opts) => {
|
|
5769
|
+
if (opts.foreground && opts.background) {
|
|
5770
|
+
throw new Error("Use either --foreground or --background, not both");
|
|
5771
|
+
}
|
|
5420
5772
|
const port = opts.port === void 0 ? void 0 : Number.parseInt(opts.port, 10);
|
|
5421
5773
|
if (port !== void 0 && (!Number.isFinite(port) || port < 0)) {
|
|
5422
5774
|
throw new Error(`Invalid --port: ${opts.port}`);
|
|
@@ -5425,9 +5777,14 @@ program.command("serve").description("Start the YorZ Service (HTTP + SSE + stati
|
|
|
5425
5777
|
port,
|
|
5426
5778
|
open: opts.open,
|
|
5427
5779
|
cwd: opts.cwd,
|
|
5428
|
-
noRegisterCwd: opts.
|
|
5780
|
+
noRegisterCwd: opts.registerCwd === false,
|
|
5781
|
+
foreground: opts.foreground === true
|
|
5429
5782
|
});
|
|
5430
5783
|
});
|
|
5784
|
+
serveCmd.command("stop").description("Stop the background YorZ Service.").action(async () => {
|
|
5785
|
+
const result = await runStopServe();
|
|
5786
|
+
console.log(result.message);
|
|
5787
|
+
});
|
|
5431
5788
|
program.parseAsync(process.argv).catch((err) => {
|
|
5432
5789
|
console.error(`error: ${err.message}`);
|
|
5433
5790
|
process.exit(1);
|
package/dist/gui/assets/{abnfDiagram-VRR7QNED-DE_Lwnyj.js → abnfDiagram-VRR7QNED-BjiKWU_r.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-
|
|
1
|
+
import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-DXNE2VJB.js";import{p as f}from"./chunk-JWPE2WC7-Durur7_4.js";import{_ as n,l as o}from"./mermaid.core-1Uynhu-S.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-BjremdIM.js";import"./index-Bq3A8DU2.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};
|
|
@@ -1 +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-
|
|
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-1Uynhu-S.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};
|