@dawipong/opcflow 0.8.0 → 0.10.0
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.en.md +1 -1
- package/README.md +1 -1
- package/dist/cli.mjs +49 -4
- package/package.json +1 -1
- package/web/dist/assets/{abnfDiagram-VRR7QNED-Cwj4KBKb.js → abnfDiagram-VRR7QNED-CnWTNSpE.js} +1 -1
- package/web/dist/assets/{architectureDiagram-ZJ3FMSHR-B83QZuM-.js → architectureDiagram-ZJ3FMSHR-VWO34lk2.js} +1 -1
- package/web/dist/assets/{chunk-EX3LRPZG-DOdm7LPI.js → chunk-EX3LRPZG-uvZmsCz5.js} +1 -1
- package/web/dist/assets/{chunk-MOJQB5TN-BrFLYoih.js → chunk-MOJQB5TN-kgvZO8mh.js} +1 -1
- package/web/dist/assets/{chunk-PUDLZKDR-D4rKEnrx.js → chunk-PUDLZKDR-DpxgVMra.js} +1 -1
- package/web/dist/assets/{chunk-V7JOEXUC-Bb-id9Vk.js → chunk-V7JOEXUC-Dapnw7q1.js} +1 -1
- package/web/dist/assets/{classDiagram-OUVF2IWQ-XODf2seK.js → classDiagram-OUVF2IWQ-Dj-HxtUC.js} +1 -1
- package/web/dist/assets/{classDiagram-v2-EOCWNBFH-XODf2seK.js → classDiagram-v2-EOCWNBFH-Dj-HxtUC.js} +1 -1
- package/web/dist/assets/{cynefinDiagram-TSTJHNR4-BQ_p-vVW.js → cynefinDiagram-TSTJHNR4-DgsmI5ni.js} +1 -1
- package/web/dist/assets/{dagre-VKFMJZFB-sC49sUfv.js → dagre-VKFMJZFB-CGtYjfDT.js} +1 -1
- package/web/dist/assets/{diagram-G47NLZAW-BFZHUq5q.js → diagram-G47NLZAW-Ds-W6sa0.js} +1 -1
- package/web/dist/assets/{diagram-NH7WQ7WH-CnF3KhFt.js → diagram-NH7WQ7WH-DOuZjIeJ.js} +1 -1
- package/web/dist/assets/{diagram-OA4YK3LP-DyxQbSTl.js → diagram-OA4YK3LP-DA2KLwKM.js} +1 -1
- package/web/dist/assets/{diagram-WEI45ONY-u45fnoLo.js → diagram-WEI45ONY-DWfXa0w_.js} +1 -1
- package/web/dist/assets/{ebnfDiagram-CCIWWBDH-CRWFKre6.js → ebnfDiagram-CCIWWBDH-D14uZUD4.js} +1 -1
- package/web/dist/assets/{erDiagram-Q63AITRT-BWW0EF63.js → erDiagram-Q63AITRT-BIceg2Pk.js} +1 -1
- package/web/dist/assets/{flowDiagram-23GEKE2U-ADg31f6W.js → flowDiagram-23GEKE2U-BLms_ylv.js} +1 -1
- package/web/dist/assets/{ganttDiagram-NO4QXBWP-Cs24RF6t.js → ganttDiagram-NO4QXBWP-DAlK5TuK.js} +1 -1
- package/web/dist/assets/{index-Cf-76g9P.js → index-Bqp1_f-s.js} +80 -80
- package/web/dist/assets/{infoDiagram-FWYZ7A6U-C2mnh_tb.js → infoDiagram-FWYZ7A6U-7mRQzInB.js} +1 -1
- package/web/dist/assets/{ishikawaDiagram-FXEZZL3T-B_eQA-ns.js → ishikawaDiagram-FXEZZL3T-m2fCQ3C0.js} +1 -1
- package/web/dist/assets/{kanban-definition-HUTT4EX6-ov2PISLL.js → kanban-definition-HUTT4EX6-XSazudN_.js} +1 -1
- package/web/dist/assets/{linear-BcjVZ8a_.js → linear-DRty47xH.js} +1 -1
- package/web/dist/assets/{mindmap-definition-LN4V7U3C-0NmEERgv.js → mindmap-definition-LN4V7U3C-3Bj5A8oB.js} +1 -1
- package/web/dist/assets/{pegDiagram-2B236MQR-CiAlAiVi.js → pegDiagram-2B236MQR-CYPoakJr.js} +1 -1
- package/web/dist/assets/{pieDiagram-ENE6RG2P-inbfmWLn.js → pieDiagram-ENE6RG2P-BRZ4wSUu.js} +1 -1
- package/web/dist/assets/{quadrantDiagram-ABIIQ3AL-BG-L4IlR.js → quadrantDiagram-ABIIQ3AL-CclAvLIN.js} +1 -1
- package/web/dist/assets/{railroadDiagram-RFXS5EU6-zGdHxvjI.js → railroadDiagram-RFXS5EU6-DPaOsVAE.js} +1 -1
- package/web/dist/assets/{requirementDiagram-TGXJPOKE-DYBqltr1.js → requirementDiagram-TGXJPOKE-DUiw-EJj.js} +1 -1
- package/web/dist/assets/{sequenceDiagram-DBY2YBRQ-yoZvzY4D.js → sequenceDiagram-DBY2YBRQ-CH9aabAW.js} +1 -1
- package/web/dist/assets/{stateDiagram-2N3HPSRC-UXu_N6p7.js → stateDiagram-2N3HPSRC-BTw2pR1w.js} +1 -1
- package/web/dist/assets/{stateDiagram-v2-6OUMAXLB-K2x-LOU8.js → stateDiagram-v2-6OUMAXLB-bxEJ05w4.js} +1 -1
- package/web/dist/assets/{swimlanes-5IMT3BWC-CJml4vNZ.js → swimlanes-5IMT3BWC-DYcRF_OF.js} +1 -1
- package/web/dist/assets/{swimlanesDiagram-G3AALYLV-BJTq-tR6.js → swimlanesDiagram-G3AALYLV-Ckz5Fq-H.js} +1 -1
- package/web/dist/assets/{timeline-definition-FHXFAJF6-DmHx8Bri.js → timeline-definition-FHXFAJF6-DLsyNHJW.js} +1 -1
- package/web/dist/assets/{vennDiagram-L72KCM5P-jIe_jCw3.js → vennDiagram-L72KCM5P-BPNH_aJQ.js} +1 -1
- package/web/dist/assets/{wardleyDiagram-EHGQE667-DEJFp47s.js → wardleyDiagram-EHGQE667-DsA47KXe.js} +1 -1
- package/web/dist/assets/{xychartDiagram-FW5EYKEG-DBBG2OXr.js → xychartDiagram-FW5EYKEG-BGk7WwLI.js} +1 -1
- package/web/dist/index.html +1 -1
package/README.en.md
CHANGED
|
@@ -174,7 +174,7 @@ Generated by `init`, hand-edited afterwards — each project's coordinate system
|
|
|
174
174
|
mermaid / HTML-prototype iframe / code rendering, the **review-queue diff** (approved version vs.
|
|
175
175
|
current), the **artifact relation graph** (derived edges + manually declared edges: drag to connect,
|
|
176
176
|
manual edges unbindable, derived edges reconciled by scan; manual edges join invalidation propagation),
|
|
177
|
-
an event timeline, and live SSE refresh. Approve, reject, and thumbs-up/down prototypes right
|
|
177
|
+
an event timeline, and live SSE refresh. Set your **actor identity** in the header (when a team shares one workbench, approvals/feedback/edges are attributed per actor). Approve, reject, and thumbs-up/down prototypes right
|
|
178
178
|
here.
|
|
179
179
|
|
|
180
180
|
## Scripts
|
package/README.md
CHANGED
|
@@ -161,7 +161,7 @@ flowchart LR
|
|
|
161
161
|
`opcflow serve` 起在 `http://127.0.0.1:5620`:artifact 树(状态实时变色)、markdown / mermaid / HTML 原型
|
|
162
162
|
iframe / 代码渲染、**待审队列 diff**(approved 版本 vs 当前)、**产出物关系图**(自动推导边 + 手动声明边:
|
|
163
163
|
画布上拖线即声明、手动边可解绑、推导边由 scan 对账维护;手动边同样参与失效传播)、事件时间线、
|
|
164
|
-
SSE 实时刷新。审批、打回、给原型 👍👎
|
|
164
|
+
SSE 实时刷新。审批、打回、给原型 👍👎 都在这里点;头部可设置**操作人身份**(多人共用一个工作台时,审批/反馈/建边按 actor 区分留痕)。
|
|
165
165
|
|
|
166
166
|
## 脚本
|
|
167
167
|
|
package/dist/cli.mjs
CHANGED
|
@@ -506,6 +506,9 @@ var init_platforms = __esm({
|
|
|
506
506
|
agentsDir: ".claude/agents",
|
|
507
507
|
skillsDir: ".claude/skills",
|
|
508
508
|
hooksScanDir: ".claude/hooks",
|
|
509
|
+
rulesDir: null,
|
|
510
|
+
// 规则载体是 CLAUDE.md(手改大文件,刻意不追)
|
|
511
|
+
memoryDir: ".claude/agent-memory",
|
|
509
512
|
defaultModel: "opus",
|
|
510
513
|
memoryBlock: (role, lang) => claudeMemory(role, lang),
|
|
511
514
|
projectDirEnvVar: "CLAUDE_PROJECT_DIR",
|
|
@@ -555,6 +558,9 @@ var init_platforms = __esm({
|
|
|
555
558
|
agentsDir: ".codex/agents",
|
|
556
559
|
skillsDir: ".agents/skills",
|
|
557
560
|
hooksScanDir: null,
|
|
561
|
+
rulesDir: null,
|
|
562
|
+
// 规则/记忆载体都是 AGENTS.md(手改大文件,刻意不追)
|
|
563
|
+
memoryDir: null,
|
|
558
564
|
defaultModel: "gpt-5.1-codex",
|
|
559
565
|
memoryBlock: (_role, lang) => agentsMdMemory("Codex", lang),
|
|
560
566
|
projectDirEnvVar: "CODEX_PROJECT_DIR",
|
|
@@ -601,6 +607,9 @@ var init_platforms = __esm({
|
|
|
601
607
|
agentsDir: ".opencode/agents",
|
|
602
608
|
skillsDir: ".opencode/skills",
|
|
603
609
|
hooksScanDir: null,
|
|
610
|
+
rulesDir: null,
|
|
611
|
+
// 同 codex:AGENTS.md 承载,不追
|
|
612
|
+
memoryDir: null,
|
|
604
613
|
defaultModel: "anthropic/claude-opus-4-8",
|
|
605
614
|
memoryBlock: (_role, lang) => agentsMdMemory("OpenCode", lang),
|
|
606
615
|
projectDirEnvVar: "OPENCODE_PROJECT_DIR",
|
|
@@ -675,6 +684,9 @@ export const opcflow = async () => ({
|
|
|
675
684
|
agentsDir: ".cursor/agents",
|
|
676
685
|
skillsDir: ".cursor/skills",
|
|
677
686
|
hooksScanDir: null,
|
|
687
|
+
rulesDir: ".cursor/rules",
|
|
688
|
+
memoryDir: null,
|
|
689
|
+
// Cursor 原生 Memories 非文件形态,无法登记跟踪
|
|
678
690
|
defaultModel: "claude-opus-4-8",
|
|
679
691
|
memoryBlock: (_role, lang) => cursorMemory(lang),
|
|
680
692
|
projectDirEnvVar: "CURSOR_PROJECT_DIR",
|
|
@@ -755,6 +767,14 @@ function getKindRegistry(config) {
|
|
|
755
767
|
...merged["hook-script"],
|
|
756
768
|
pathPatterns: uniq(adapters.map((a) => a.hooksScanDir).filter((d) => !!d).map((d) => `${d}/`))
|
|
757
769
|
};
|
|
770
|
+
merged.rule = {
|
|
771
|
+
...merged.rule,
|
|
772
|
+
pathPatterns: uniq(adapters.map((a) => a.rulesDir).filter((d) => !!d).map((d) => `${d}/`))
|
|
773
|
+
};
|
|
774
|
+
merged.memory = {
|
|
775
|
+
...merged.memory,
|
|
776
|
+
pathPatterns: uniq(adapters.map((a) => a.memoryDir).filter((d) => !!d).map((d) => `${d}/`))
|
|
777
|
+
};
|
|
758
778
|
return merged;
|
|
759
779
|
}
|
|
760
780
|
function kindSpec(config, kind) {
|
|
@@ -803,6 +823,10 @@ var init_kind = __esm({
|
|
|
803
823
|
skill: { level: "project", approval: "human", parents: [], drivesStale: false, hashMode: "text-normalize", retrieval: "full", meta: true, pathPatterns: [".claude/skills/"] },
|
|
804
824
|
"hook-script": { level: "project", approval: "human", parents: [], drivesStale: false, hashMode: "text-normalize", retrieval: "full", meta: true, pathPatterns: [".claude/hooks/"] },
|
|
805
825
|
plan: { level: "project", approval: "human", parents: [], drivesStale: false, hashMode: "text-normalize", retrieval: "summary", meta: true, pathPatterns: ["docs/workbench/PLAN.md"] },
|
|
826
|
+
// 规则/记忆:平台原生读取生效的内容(approval:none——opcflow 只登记+跟踪变更进 draft,不设审卡);
|
|
827
|
+
// pathPatterns 按目标平台的 rulesDir/memoryDir 动态展开(getKindRegistry),仅目录文件形态可追
|
|
828
|
+
rule: { level: "project", approval: "none", parents: [], drivesStale: false, hashMode: "text-normalize", retrieval: "full", meta: true },
|
|
829
|
+
memory: { level: "project", approval: "none", parents: [], drivesStale: false, hashMode: "text-normalize", retrieval: "summary", meta: true },
|
|
806
830
|
baseline: { level: "project", approval: "human", parents: [], drivesStale: true, hashMode: "text-normalize", retrieval: "summary", pathPatterns: ["ARCHITECTURE.md", "TECH.md"] },
|
|
807
831
|
project: { level: "project", approval: "human", parents: [], drivesStale: true, hashMode: "text-normalize", retrieval: "summary", pathPatterns: ["{prd}/project.md"] },
|
|
808
832
|
roles: { level: "project", approval: "human", parents: ["project"], drivesStale: true, hashMode: "text-normalize", retrieval: "full", pathPatterns: ["{prd}/roles.md"] },
|
|
@@ -863,7 +887,8 @@ var init_roles = __esm({
|
|
|
863
887
|
init_kind();
|
|
864
888
|
DEFAULT_ROLE_REGISTRY = {
|
|
865
889
|
"product-manager": {
|
|
866
|
-
produces: ["project", "roles", "glossary", "flow", "module-prd", "page-prd"]
|
|
890
|
+
produces: ["project", "roles", "glossary", "flow", "module-prd", "page-prd"],
|
|
891
|
+
completeWithoutClaim: true
|
|
867
892
|
},
|
|
868
893
|
architect: {
|
|
869
894
|
produces: ["db-doc", "api-doc"],
|
|
@@ -1144,7 +1169,7 @@ function completeOutputRequirement(ctx, task) {
|
|
|
1144
1169
|
function validateComplete(ctx, task, status, opts = {}) {
|
|
1145
1170
|
const warnings = [];
|
|
1146
1171
|
if (status !== "completed") return { warnings, inputs: [] };
|
|
1147
|
-
if (task.
|
|
1172
|
+
if (task.assignee === null && !getRoleRegistry(ctx.config)[task.role]?.completeWithoutClaim) {
|
|
1148
1173
|
throw new Error(`\u4EFB\u52A1\u5C1A\u672A\u88AB\u9886\u53D6,\u65E0\u6CD5\u66F4\u65B0\u72B6\u6001`);
|
|
1149
1174
|
}
|
|
1150
1175
|
if (task.type === "legacy") return { warnings, inputs: [] };
|
|
@@ -2078,6 +2103,9 @@ function updateTask(ctx, { id, status, operator, force = false }) {
|
|
|
2078
2103
|
if (task.assignee !== null && task.assignee !== operator) {
|
|
2079
2104
|
throw new Error(`\u53EA\u6709\u6267\u884C\u4EBA\u624D\u80FD\u66F4\u65B0\u4EFB\u52A1\u72B6\u6001`);
|
|
2080
2105
|
}
|
|
2106
|
+
if (task.assignee === null && operator !== task.role && operator !== task.creator) {
|
|
2107
|
+
throw new Error(`\u672A\u9886\u53D6\u7684\u4EFB\u52A1\u4EC5\u521B\u5EFA\u8005\u6216\u89D2\u8272\u672C\u4EBA\u53EF\u66F4\u65B0\u72B6\u6001`);
|
|
2108
|
+
}
|
|
2081
2109
|
const { warnings } = validateComplete(ctx, task, status, { force });
|
|
2082
2110
|
let followupQaId = null;
|
|
2083
2111
|
const tx = ctx.db.transaction(() => {
|
|
@@ -2460,6 +2488,8 @@ function metaSources(config) {
|
|
|
2460
2488
|
add({ dir: a.agentsDir, filter: (n) => n.endsWith(".md") || n.endsWith(".toml") });
|
|
2461
2489
|
add({ dir: a.skillsDir, filter: (n) => n === "SKILL.md", recursive: true });
|
|
2462
2490
|
if (a.hooksScanDir) add({ dir: a.hooksScanDir, recursive: true });
|
|
2491
|
+
if (a.rulesDir) add({ dir: a.rulesDir, filter: (n) => n.endsWith(".md") || n.endsWith(".mdc"), recursive: true });
|
|
2492
|
+
if (a.memoryDir) add({ dir: a.memoryDir, filter: (n) => n.endsWith(".md"), recursive: true });
|
|
2463
2493
|
}
|
|
2464
2494
|
add({ dir: "docs/workbench", filter: (n) => n === "PLAN.md" });
|
|
2465
2495
|
return sources;
|
|
@@ -2840,6 +2870,9 @@ function recordQaResult(ctx, p) {
|
|
|
2840
2870
|
return { reworkTaskId: null };
|
|
2841
2871
|
}
|
|
2842
2872
|
const reworkRole = ownerRoleOf(ctx.config, "code") ?? "developer";
|
|
2873
|
+
if (getRoleRegistry(ctx.config)[reworkRole]?.onQaFail !== "rework") {
|
|
2874
|
+
return { reworkTaskId: null };
|
|
2875
|
+
}
|
|
2843
2876
|
const tx2 = ctx.db.transaction(() => {
|
|
2844
2877
|
const result = ctx.db.prepare(
|
|
2845
2878
|
`INSERT INTO tasks (module, role, endpoint, page, type, status, assignee, creator, content)
|
|
@@ -3914,13 +3947,25 @@ function guardedAbsPath(ctx, artifact, rel) {
|
|
|
3914
3947
|
async function createServer(ctx) {
|
|
3915
3948
|
const app = Fastify({ logger: false });
|
|
3916
3949
|
await app.register(fastifyCors, { origin: true });
|
|
3950
|
+
const authToken = ctx.config.server?.authToken;
|
|
3951
|
+
if (authToken) {
|
|
3952
|
+
app.addHook("preHandler", async (req, reply) => {
|
|
3953
|
+
if (req.method === "GET" || req.method === "HEAD" || req.method === "OPTIONS") return;
|
|
3954
|
+
if (req.headers["x-workbench-token"] !== authToken) {
|
|
3955
|
+
return reply.code(401).send({ error: "\u7F3A\u5C11\u6216\u9519\u8BEF\u7684 x-workbench-token(\u8BE5\u5DE5\u4F5C\u53F0\u5DF2\u542F\u7528\u5199\u4FDD\u62A4)" });
|
|
3956
|
+
}
|
|
3957
|
+
});
|
|
3958
|
+
}
|
|
3917
3959
|
const webDist = join17(WORKBENCH_DIR, "web/dist");
|
|
3918
3960
|
if (existsSync15(webDist)) {
|
|
3919
3961
|
await app.register(fastifyStatic, { root: webDist });
|
|
3920
3962
|
}
|
|
3921
|
-
const
|
|
3963
|
+
const protoPattern = getKindRegistry(ctx.config).prototype.pathPatterns?.[0];
|
|
3964
|
+
const protoRel = (protoPattern ? expandPattern(protoPattern, ctx.config) : `${ctx.config.docs.design}/prototypes/`).replace(/\/+$/, "");
|
|
3965
|
+
const protoRoot = join17(ctx.root, protoRel);
|
|
3922
3966
|
mkdirSync8(protoRoot, { recursive: true });
|
|
3923
3967
|
await app.register(fastifyStatic, { root: protoRoot, prefix: "/proto/", decorateReply: false });
|
|
3968
|
+
const previewUrlOf = (a) => a.path.startsWith(protoRel + "/") ? encodeURI(`/proto/${a.path.slice(protoRel.length + 1)}`) : null;
|
|
3924
3969
|
app.get("/api/meta", async () => ({
|
|
3925
3970
|
root: ctx.root,
|
|
3926
3971
|
language: ctx.config.language,
|
|
@@ -3960,7 +4005,7 @@ async function createServer(ctx) {
|
|
|
3960
4005
|
} else if (statSync6(abs).size <= MAX_INLINE_SIZE) {
|
|
3961
4006
|
content = readFileSync8(abs, "utf-8");
|
|
3962
4007
|
}
|
|
3963
|
-
return { artifact, content, isDirectory, missing, feedback, events };
|
|
4008
|
+
return { artifact, content, isDirectory, missing, feedback, events, previewUrl: previewUrlOf(artifact) };
|
|
3964
4009
|
});
|
|
3965
4010
|
app.get("/api/artifact/:id/files", async (req) => {
|
|
3966
4011
|
const artifact = getArtifact(ctx, parseInt(req.params.id));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dawipong/opcflow",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Spec-anchored, drift-enforced execution layer for AI coding agents — artifact DAG, trust gates, multi-role pipeline; generates agents/MCP/hooks for Claude Code, Codex, OpenCode & Cursor.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Dawi",
|
package/web/dist/assets/{abnfDiagram-VRR7QNED-Cwj4KBKb.js → abnfDiagram-VRR7QNED-CnWTNSpE.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{E as e}from"./src-Bp5IDfvJ.js";import{n as t}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import"./chunk-WYO6CB5R-C0vPAP7X.js";import"./index-
|
|
1
|
+
import{E as e}from"./src-Bp5IDfvJ.js";import{n as t}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import"./chunk-WYO6CB5R-C0vPAP7X.js";import"./index-Bqp1_f-s.js";import{m as n,t as r}from"./mermaid-parser.core-CICKlqAN.js";import{n as i,r as a,t as o}from"./chunk-MOJQB5TN-kgvZO8mh.js";import{t as s}from"./chunk-JWPE2WC7-DVXcaiue.js";var c=n().RailroadAbnf.parser.LangiumParser,l=t(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformAlternation`),u=t(e=>{let t=e.elements.map(f);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformConcatenation`),d=t(e=>{if(e.includes(`*`)){let[t,n]=e.split(`*`);return{min:t?parseInt(t,10):0,max:n?parseInt(n,10):1/0}}let t=parseInt(e,10);return{min:t,max:t}},`parseRepeat`),f=t(e=>{let t=p(e.primary);if(!e.repeat)return t;let{min:n,max:r}=d(e.repeat);return n===0&&r===1?{type:`optional`,element:t}:{type:`repetition`,element:t,min:n,max:r}},`transformElement`),p=t(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 l(e.element);case`AbnfOptionalGroup`:return{type:`optional`,element:l(e.element)};default:throw Error(`Unsupported ABNF primary node: ${e.$type}`)}},`transformPrimary`),m=t(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),h=t(e=>{s(e,o),e.title&&o.setTitle(e.title),e.rules.map(e=>o.addRule(m(e)))},`populateDb`),g={parser:{parse:t(t=>{o.clear(),e.debug(`[ABNF Parser] Starting Langium parse`);let n=c.parse(t);if(n.lexerErrors.length>0||n.parserErrors.length>0)throw new r(n);let i=n.value;e.debug(`[ABNF Parser] Parsed rules:`,i.rules.length),h(i),e.debug(`[ABNF Parser] Parse complete`)},`parse`),parser:{yy:o}},db:o,renderer:a,styles:i};export{g as diagram};
|