mirror of
https://github.com/MoonshotAI/kimi-code.git
synced 2026-10-22 14:40:19 +00:00
Compare commits
135 commits
@moonshot-
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
759958afdf | ||
|
|
79a76ea2da | ||
|
|
44cdf8f403 | ||
|
|
4c5d7d5e27 | ||
|
|
e7f1a99fc5 | ||
|
|
874d9abb32 | ||
|
|
0a90e2e8a2 | ||
|
|
366fafbf92 | ||
|
|
256ce61f0c | ||
|
|
4bad441fef | ||
|
|
95eeeecf9b | ||
|
|
67325c1b25 | ||
|
|
3079e9515f | ||
|
|
5fec8d19a5 | ||
|
|
ce0834a8f3 | ||
|
|
5710c5496a | ||
|
|
e5e56bc5fe | ||
|
|
47002256a0 | ||
|
|
4a82a07f08 | ||
|
|
18c6d64272 | ||
|
|
8fcd3326e7 | ||
|
|
6e7cc909da | ||
|
|
ef727e5179 | ||
|
|
c1459a6184 | ||
|
|
85077a4190 | ||
|
|
da5918c0c8 | ||
|
|
034117338c | ||
|
|
5bab748ddd | ||
|
|
9f0693becb | ||
|
|
60adab4c32 | ||
|
|
b2603264ec | ||
|
|
20b59915bb | ||
|
|
d4b9dc4a2d | ||
|
|
a9e764db61 | ||
|
|
d1c3b048fd | ||
|
|
f28c51c01f | ||
|
|
83a39b49ed | ||
|
|
0327e8e9a8 | ||
|
|
7e58f2d241 | ||
|
|
b510fa9aec | ||
|
|
3f0857eb7d | ||
|
|
e4c99a3bad | ||
|
|
c69bd6c5a0 | ||
|
|
afd95f64a5 | ||
|
|
fed19d24f0 | ||
|
|
cbd754049a | ||
|
|
c15638b0a1 | ||
|
|
0a3a2fbafa | ||
|
|
7f0ff53c8a | ||
|
|
c151d5a3d0 | ||
|
|
c9f01f0738 | ||
|
|
3395f5bea6 | ||
|
|
f0bc988bbc | ||
|
|
72fc1d0a33 | ||
|
|
e5b4b88ba9 | ||
|
|
419aced0e9 | ||
|
|
7091138f5e | ||
|
|
242ac23000 | ||
|
|
5b93669767 | ||
|
|
eec9bbd949 | ||
|
|
0f052fee13 | ||
|
|
21406fb4c8 | ||
|
|
33e368a1ef | ||
|
|
f409caa21e | ||
|
|
20a2cea72f | ||
|
|
06ebfc821e | ||
|
|
395d537237 | ||
|
|
e3bf50c083 | ||
|
|
a940f2ff04 | ||
|
|
1f6f0b1fa2 | ||
|
|
4fbe065442 | ||
|
|
09af3b483f | ||
|
|
e15c4fcbdf | ||
|
|
be7d5f5fea | ||
|
|
f67e6398fb | ||
|
|
c7dd84124a | ||
|
|
929403b6db | ||
|
|
a1e4c13d41 | ||
|
|
52437299ff | ||
|
|
ba41d07810 | ||
|
|
e17ff67928 | ||
|
|
b3212fd9ab | ||
|
|
a54e6f6a9b | ||
|
|
32000d08af | ||
|
|
75d6767e0e | ||
|
|
895e9d9b86 | ||
|
|
a268ad775d | ||
|
|
f7012aa23b | ||
|
|
bdf8f7975d | ||
|
|
6451f1e056 | ||
|
|
e796bb5d48 | ||
|
|
bb96d80748 | ||
|
|
994287acb3 | ||
|
|
7ad0c46682 | ||
|
|
0dc4d4fba8 | ||
|
|
0523bafb39 | ||
|
|
6a52dd781b | ||
|
|
b428bfd004 | ||
|
|
6a214b85e5 | ||
|
|
65ae3e368c | ||
|
|
99eaa993ba | ||
|
|
f17a22ebf4 | ||
|
|
9d07f634be | ||
|
|
2e605b10be | ||
|
|
97212596f7 | ||
|
|
7568f3118c | ||
|
|
6ffdf0d579 | ||
|
|
9df7a9ccfb | ||
|
|
7d3f88faa4 | ||
|
|
2502d2157f | ||
|
|
2cedfaf125 | ||
|
|
02d829e131 | ||
|
|
88a7d932f1 | ||
|
|
1815096590 | ||
|
|
caf7d4e2fe | ||
|
|
7dc253c5ce | ||
|
|
92c3c59b22 | ||
|
|
3cc6b2a330 | ||
|
|
60f2a63278 | ||
|
|
b0d0a80c32 | ||
|
|
73ebe9ab2f | ||
|
|
5acc863ae6 | ||
|
|
910aba273e | ||
|
|
53e5e3fca6 | ||
|
|
a80fe31cff | ||
|
|
5108cad9b6 | ||
|
|
e3f48a225b | ||
|
|
f233f9de04 | ||
|
|
1fddc16e3e | ||
|
|
c1047a6bbe | ||
|
|
c5ad17f06a | ||
|
|
86e08208e3 | ||
|
|
25dd4ce973 | ||
|
|
00bd3c2268 | ||
|
|
bbcdde0b13 |
1122 changed files with 72088 additions and 42620 deletions
|
|
@ -5,7 +5,7 @@ description: Use when generating changesets in the kimi-code repository — deci
|
|||
|
||||
# Generate Changesets
|
||||
|
||||
The only user-facing published package is the CLI: `@moonshot-ai/kimi-code`. All other `@moonshot-ai/*` packages (sdk, kosong, kaos, oauth, telemetry, and so on) are internal.
|
||||
The only user-facing published package is the CLI: `@moonshot-ai/kimi-code`. All other `@moonshot-ai/*` packages (sdk, kosong, oauth, telemetry, and so on) are internal.
|
||||
|
||||
## 1. Whether to Write
|
||||
|
||||
|
|
@ -32,6 +32,7 @@ Fix occasional loss of tool call results in long conversations.
|
|||
|
||||
Wording:
|
||||
- One short, user-facing English sentence that states only what changed. Drop trailing clauses that explain the cause, the benefit, or the mechanism.
|
||||
- When a default flips or an existing behavior is removed, name the behavior users lose, not only the new default. State the escape hatch if one exists, e.g. `Stop hot-reloading config, skills, and AGENTS.md by default; set [watch] enabled = true or KIMI_CODE_WATCH=1 to turn it back on.`; if there is none, say plainly that the old behavior is no longer available.
|
||||
- New features: say plainly what it is plus one line on how to use it, e.g. `Add the /foo slash command to list active sessions. Run /foo to see them.`
|
||||
- Experimental features: also state how to enable them (the flag, config key, or env var).
|
||||
- No file, class, or function names, and no PR numbers. No vague words like refactor, optimize, or improve. No real internal identifiers — use neutral placeholders such as `example.com` or `YOUR_API_KEY`.
|
||||
|
|
@ -60,4 +61,4 @@ Wording:
|
|||
4. **Show the changeset text to whoever requested the work and get their confirmation before committing.**
|
||||
5. Do not guess at changes you do not understand: finish the parts that are clear, then list what is unclear and ask whether you may dig into the code.
|
||||
|
||||
Before a release, review the accumulated `.changeset/` entries and delete the non-user-facing ones — the release PR regenerates from `.changeset/` on main, so deleting a file removes its changelog entry without touching shipped code.
|
||||
Before a release, review the accumulated `.changeset/` entries and delete the non-user-facing ones — the release PR regenerates from `.changeset/` on the selected release branch, so deleting a file removes its changelog entry without touching shipped code.
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ This skill reuses `sync-changelog`'s strip / classify / translate rules. Read `s
|
|||
|
||||
### 1. Locate the release PR
|
||||
|
||||
Select the PR targeting the intended `release/*` branch, not the legacy main version PR. Report its latest head CI link and result alongside the preview.
|
||||
|
||||
```bash
|
||||
gh pr list --state open --search "ci: release packages in:title" \
|
||||
--json number,title,url,headRefName,baseRefName
|
||||
|
|
|
|||
192
.agents/skills/review-pr/SKILL.md
Normal file
192
.agents/skills/review-pr/SKILL.md
Normal file
|
|
@ -0,0 +1,192 @@
|
|||
---
|
||||
name: review-pr
|
||||
description: 在 kimi-code 仓库里 review 一个 PR 时使用:按 PR 模板逐节核对描述与 diff,并单独做一轮"回归与用户影响"评审,给出影响等级与评审摘要,评审摘要用用户当前使用的语言。
|
||||
disable-model-invocation: true
|
||||
---
|
||||
|
||||
# Review PR
|
||||
|
||||
这个仓库过去的回归大多不是逻辑错误,而是"改动相对于自身意图是对的,但悄悄改掉了某个现有人群依赖的行为":方言分支收窄、默认值翻转、删 system prompt 句子、重构或移植时丢掉旧路径的功能、修复引入启动时序变化。通用 review 会把这类"有意的功能变更"排除在 bug 之外,所以这里把它单列成一轮。
|
||||
|
||||
评审判据只有一条:**改动前能工作的任何输入(配置键、环境变量、命令行参数、provider 响应形态、旧版本写的会话数据、客户端请求、hook 载荷)改动后必须行为不变,除非 PR 明确声明了这个变化并给出了退路。**
|
||||
|
||||
## 工作流
|
||||
|
||||
1. 拉 PR 元数据与描述:
|
||||
|
||||
```bash
|
||||
gh pr view <number> --json title,body,url,files,additions,deletions,baseRefName,headRefName
|
||||
```
|
||||
|
||||
2. 读完整 diff(大 PR 按文件分批读):
|
||||
|
||||
```bash
|
||||
gh pr diff <number>
|
||||
```
|
||||
|
||||
3. 读足够的周边代码来验证描述里的每个断言。只看 diff 看不出"改动前谁走到这个分支"。
|
||||
|
||||
4. **第一遍:定性。** 判断改动类型,决定第三遍的深度,见"第一遍:定性"。
|
||||
|
||||
5. **第二遍:按模板逐节核对。** 见"模板逐节核对"。
|
||||
|
||||
6. **第三遍:回归与用户影响。** 尽量用一个独立子 agent 跑:只给它 PR 号、base 与 head、两三句改动简介和 `surfaces.md` 的路径,不给它作者关于影响范围的结论,让它先从 diff 和代码独立列清单,回来后再与作者填的表对比。没有子 agent 能力时自己按同样顺序做:先列清单,再读作者的表。见"第三遍:回归与用户影响"。
|
||||
|
||||
7. 用用户当前使用的语言写评审摘要,格式见"输出"。
|
||||
|
||||
## 第一遍:定性
|
||||
|
||||
| 改动类型 | 第三遍深度 |
|
||||
|---|---|
|
||||
| 纯内部重构、测试、文档、测试 CI | 只需给出"没有可观测变化"的证据:哪些分支、默认值、契约文件没动 |
|
||||
| 发布与打包:release、native 构建、VS Code 发布工作流,打包脚本,web 产物同步 | 全做,人群按安装方式与平台分:npm 包、各平台 native 二进制、VS Code 市场、内置 web 产物 |
|
||||
| 新增功能,不动既有路径 | 只查新分支是否抢走了既有输入:新增条件是否排在旧条件之前 |
|
||||
| 行为变更、默认值翻转、校验或权限收紧或放宽 | 全做 |
|
||||
| prompt 文本变更:system prompt、工具描述、提醒、overlay、内置 skill | 全做,且每一句改动单独成行 |
|
||||
| 移植、替换旧路径、大重构:v1 到 v2、runtime binding、协议替换 | 全做,并要求作者给出旧路径功能清单 |
|
||||
| 协议、磁盘格式、SDK 导出、hook 载荷、命令行契约变化 | 全做,并点名仓库外的消费方 |
|
||||
| 修复类改动改了启动顺序、生命周期、异步时序 | 全做,重点看谁依赖原来的顺序 |
|
||||
|
||||
一个 PR 可以同时属于多类,按最重的那类处理。
|
||||
|
||||
## 第三遍:回归与用户影响
|
||||
|
||||
### 1. 行为变化清单
|
||||
|
||||
列出 diff 改变的每一个可观测行为,包括作者说"不变"的和作者认为"内部"的。内部包会打进 CLI 发布包,"内部"不等于用户无感。
|
||||
|
||||
每一行记录:行为、变化前、变化后、变化类型(新增 / 修改 / 删除 / 默认翻转 / 收紧 / 放宽)、证据(改动前后各一个 `file:line`,一侧不存在时给可达路径)。
|
||||
|
||||
读法:
|
||||
|
||||
- 对每个被删除或被收窄的分支、条件、默认值、句子,问"改动前谁走到这里,改动后他们去哪了"。
|
||||
- 对每个新增的分支或条件,问"哪些既有输入现在会先命中新分支"。#3492 的回归就是这样产生的:数组字段存在时不再读字符串字段,而 OpenRouter 形态的网关两者同时发。
|
||||
- 测试里"把旧断言改成新行为"的改动是行为变化的直接证据,逐条对应到清单。
|
||||
- 先看 diff 文件列表有没有命中 `surfaces.md` 的"触发线索"。命中的 surface 必须在清单里有对应行,否则就是漏项。
|
||||
|
||||
### 2. 受影响人群
|
||||
|
||||
每一行对应到 `surfaces.md` 里的具体人群,写出人群名字和"这个人群存在"的证据:文档页、issue、配置示例、provider 载荷形态。找不到人群的,不进 finding,进"待作者确认"。
|
||||
|
||||
### 3. 影响等级
|
||||
|
||||
等级只由改动的事实决定,不看 changeset、文档、测试这些补救状态。三步判定:
|
||||
|
||||
1. 数据丢失、安全边界放宽、老数据不可读、某人群的功能整体不可用:直接 L3。
|
||||
2. 否则,可感知且有一键退路(config、env、flag):L1;可感知且无退路,旧行为不可恢复:L2;无可观测变化:L0。
|
||||
3. 静默升级:用户提供的输入(配置、环境变量、数据、请求字段)被忽略或丢弃,且没有任何错误信号,用户无法自行发现:升一级,最高 L3。行为公开地变了、用户能在输出里看到的,不算静默。
|
||||
|
||||
广度三档,必须写出人群名字:全体用户 / 某类配置或平台人群 / 边缘环境。
|
||||
|
||||
每一行单独定级,PR 的等级取最高。静默升级的理由:没有信号就没有上报,回归会一直存活到有人偶然发现。
|
||||
|
||||
### 4. 补救核对
|
||||
|
||||
固定四问,逐条回答有 / 无 / 不适用,并给出证据:
|
||||
|
||||
- 退路开关:有没有 config、env 或 flag 能恢复旧行为。
|
||||
- changeset:有没有点明用户**失去了什么**,而不只是新默认是什么;没有退路时是否明说旧行为不可恢复。
|
||||
- 老数据与老客户端:旧版本写的会话、迁移来的数据、上一版发布的客户端(desktop、web、VS Code、ACP)是否仍然可用;回滚到上一版是否安全。
|
||||
- guard 测试:有没有一条测试把**未被改动的人群**的旧行为钉住。
|
||||
|
||||
再加一问:`docs/en` 与 `docs/zh` 里对这个 surface 的承诺是否同步更新。
|
||||
|
||||
### 等级对应的处理要求
|
||||
|
||||
- L3:建议阻塞。必须补 guard 测试,并提供退路、flag 门控或迁移,缺一不可合。
|
||||
- L2:需要维护者在 PR 里显式拍板;changeset 必须写明失去的行为;文档同步。
|
||||
- L1:核对 changeset 与文档即可。
|
||||
- L0:一句话说明为什么是 L0,给出证据。
|
||||
|
||||
### finding 与"待作者确认"的界线
|
||||
|
||||
- finding 必须同时有:改动前后各一处 `file:line` 证据,和一个具名人群及其存在证据。两者缺一,降级为"待作者确认"。新增整个文件或删除整段实现时一侧天然为空,这时给存在的那一侧加上受影响可达路径的 `file:line` 即可。
|
||||
- "待作者确认"最多 5 条,按可能的影响等级排序,多出来的只报数量。
|
||||
- 不要报:PR 之前就存在的问题(严重的单独一句"顺带发现")、lint 和类型检查会抓的问题、风格问题。
|
||||
- 不要把这些当成"无影响"的证据:作者说"不变"、没有测试引用被删的句子、改动只在内部包。
|
||||
|
||||
## 模板逐节核对
|
||||
|
||||
输出为中文时节名用下表的译名,其他语言沿用模板原文的节名:
|
||||
|
||||
| English | 中文 |
|
||||
|---------|------|
|
||||
| Requirement or Bug | 需求或 Bug |
|
||||
| Bug Reproduction Steps | Bug 复现步骤 |
|
||||
| Root Cause | 根本原因 |
|
||||
| Code Changes | 代码变更 |
|
||||
| Behavior Changes and Affected Users | 行为变化与受影响人群 |
|
||||
| Checklist | 检查清单 |
|
||||
|
||||
旧 PR 若仍用 `Impact Scope` 这一节,按"行为变化与受影响人群"的标准核对。
|
||||
|
||||
### 需求或 Bug
|
||||
|
||||
- 关联的 issue 是否有效、相关?
|
||||
- 没有 issue 时,需求是否用一两句话说清楚了?
|
||||
|
||||
### Bug 复现步骤
|
||||
|
||||
- bug 类 PR:步骤是否清晰、可复现?
|
||||
- 按步骤能否在 base 分支上确认 bug 存在?
|
||||
|
||||
### 根本原因
|
||||
|
||||
- bug 类 PR:根因解释是否令人信服?
|
||||
- 描述的根因与 diff 是否一致?
|
||||
- 是根本修复还是绕过,是否说清楚了?
|
||||
|
||||
### 代码变更
|
||||
|
||||
- 描述与实际 diff 是否一致?
|
||||
- 可视化大纲(diff 块、调用树、文件树)是否准确、有帮助?
|
||||
- 方案是否合理?有没有更简单的替代?
|
||||
- 有没有作者漏掉的边界情况?
|
||||
|
||||
### 行为变化与受影响人群
|
||||
|
||||
- 把第三遍独立列出的清单与作者填的表逐行对比:作者漏列的行为就是 finding;作者写了但你没找到证据的,进"待作者确认"。
|
||||
- 人群是否具名,还是只写了"部分用户"?
|
||||
- 写了 `None` 的,证据是否成立?
|
||||
- 受影响模块与测试覆盖是否与 diff 文件列表一致?有没有带风险的未测路径?
|
||||
|
||||
### 检查清单
|
||||
|
||||
- 适用的项是否都勾了?
|
||||
- 标为"不需要"的项,你是否同意?
|
||||
|
||||
## 输出
|
||||
|
||||
用用户当前使用的语言,按下面的顺序,示例为中文:
|
||||
|
||||
```markdown
|
||||
## 结论
|
||||
一句话:可合 / 需修改 / 建议阻塞。附 PR 影响等级与改动类型。
|
||||
|
||||
## 回归与用户影响
|
||||
- 改动类型:…
|
||||
- 影响等级:Lx(广度:…;是否静默:…)
|
||||
|
||||
| 行为 | 变化前 | 变化后 | 受影响人群 | 证据 | 等级 | 退路 |
|
||||
|---|---|---|---|---|---|---|
|
||||
|
||||
补救核对:
|
||||
- 退路开关:…
|
||||
- changeset 是否点明失去的行为:…
|
||||
- 老数据与老客户端:…
|
||||
- guard 测试:…
|
||||
- 文档:…
|
||||
|
||||
待作者确认(最多 5 条):
|
||||
1. …
|
||||
|
||||
## 模板逐节核对
|
||||
逐节说明是否填写充分,指出缺失、不准确、与 diff 不一致之处。
|
||||
|
||||
## 需要修改的项
|
||||
可执行的列表;没有则写"无"。
|
||||
```
|
||||
|
||||
## 复盘回填
|
||||
|
||||
每次线上回归复盘后,把新发现的人群或触发线索补进 `surfaces.md`,并在它的"历史案例"里加一行。清单不更新就会过时。
|
||||
129
.agents/skills/review-pr/surfaces.md
Normal file
129
.agents/skills/review-pr/surfaces.md
Normal file
|
|
@ -0,0 +1,129 @@
|
|||
# 人群与 surface 清单
|
||||
|
||||
`review-pr` 第三遍用的仓库专属清单:谁在依赖现有行为,diff 里碰到什么就必须列行为变化。它会过时,每次回归复盘后补一行,见 `SKILL.md` 的"复盘回填"。
|
||||
|
||||
## 一、人群:谁在依赖现有行为
|
||||
|
||||
### 客户端与入口
|
||||
|
||||
| 人群 | 说明 | 契约位置 |
|
||||
|---|---|---|
|
||||
| TUI 交互用户 | `kimi` 默认入口 | `apps/kimi-code/src/tui/` |
|
||||
| print 模式用户 | `kimi -p`,含解析 `--output-format stream-json` 输出的脚本。脚本解析者算二等人群,但输出格式变化必须写进 changeset(#3146) | `apps/kimi-code/src/cli/options.ts` |
|
||||
| desktop 与 web 用户 | 源码在 code-app 仓库,只消费 kap-server 的 `/api/v1` REST 与 `/api/v1/ws`。本仓 diff 看不到它们的用法,改契约时必须点名让作者去对方仓库核对 | `packages/kap-server/src/routes/`、`packages/kap-server/src/transport/ws/`、`docs/en/reference/server-api.md` |
|
||||
| VS Code 扩展用户 | 走 SDK 事件适配层,webview 有自己的渲染契约(#3250:v2 不再发 `display` 字段导致卡片空白) | `apps/vscode/` |
|
||||
| ACP 客户端用户 | Zed 等,`kimi acp`。stdio MCP 是 ACP 的默认传输,客户端会无条件发(#3167);能力矩阵是公开承诺(#3081) | `packages/acp-server/`、`docs/en/reference/kimi-acp.md` |
|
||||
| SDK 调用方 | `@moonshot-ai/kimi-code-sdk` 的导出面;其中 `KimiForCodingProvider` 走 kosong 的 provider 实现,CLI 与服务端不用 kosong | `packages/node-sdk/src/index.ts`、`packages/node-sdk/package.json` 的 `exports`、`packages/kosong/src/providers/` |
|
||||
| 远程控制用户 | `kimi web --remote-control`,凭据槽位与 relay 按登录区域选择(#3969) | `packages/remote-control/` |
|
||||
|
||||
### provider 方言
|
||||
|
||||
| 人群 | 说明 |
|
||||
|---|---|
|
||||
| Kimi 官方 | 默认路径,OAuth 托管登录,区域与 relay 差异 |
|
||||
| `openai` Chat Completions 兼容网关 | 最杂的一群:new-api 等中转、OpenRouter 形态(`reasoning` 字符串与 `reasoning_details` 数组并存,#3900)、只发 `reasoning_content` 的、严格校验历史消息的(#2819)、第三方模型对 `anyOf` 参数的处理(#3383) |
|
||||
| `anthropic`、`openai_responses`、`google-genai`、`vertexai` | 各自的 thinking、工具调用、usage 字段形态 |
|
||||
| 自定义模型配置 | `api_key_env`、models.dev catalog 导入、手动配置的 thinking 参数(#3448)、`[secondary_model]` 与 subagent model pool(#3192、#3903) |
|
||||
|
||||
代码位置:`packages/agent-core-v2/src/human/llm/requester/bases/`。
|
||||
|
||||
### 平台与环境
|
||||
|
||||
| 人群 | 已知敏感点 |
|
||||
|---|---|
|
||||
| Windows | 深路径与递归监听压力(#3931 的动机)、驱动器根与 UNC(#2876)、IME 组合输入(#3915)、CSI-u 键盘序列 |
|
||||
| Linux | 无 hardlink 的文件系统(#3535)、根目录海量文件导致的 OOM(#3892) |
|
||||
| macOS | 默认开发环境,最容易被当成"全体用户" |
|
||||
| 网络代理 | 后台子 agent 重试(#3721) |
|
||||
| native 二进制 vs npm 安装 | 启动路径、更新机制不同 |
|
||||
| 安装渠道 | npm 包、各平台 native 二进制、VS Code 市场包、内置 web 产物,由发布与打包工作流决定,`src/` 一行不动也能丢掉一个平台 |
|
||||
|
||||
### git 仓库形态
|
||||
|
||||
| 人群 | 已知敏感点 | 契约位置 |
|
||||
|---|---|---|
|
||||
| 子模块或 worktree 内启动的用户 | `core.worktree` 已设置;路径含符号链接时(macOS `/tmp`、链接的 home、Windows 映射盘)realpath 与字面路径不一致。#3964 的 git 探针在这里整体失败,已随 #4013 回滚 | `packages/agent-core-v2/src/app/git/gitService.ts` |
|
||||
| git-lfs、git-crypt 用户 | `.git/config` 里的 filter 驱动带 `required = true`;任何"清空 filter 命令"的加固都会让 `git status` 对已修改的被过滤文件直接 fatal,除非同时清 `required`。#3964 踩过,已随 #4013 回滚 | 同上 |
|
||||
| 大仓库用户 | 依赖 `core.fsmonitor`;footer 的后台 git 有超时预算,超时后静默当作 clean | `apps/kimi-code/src/utils/git/` |
|
||||
| 要求签名提交或 husky hooks 的仓库 | 任何自动提交路径(Tower 等)关闭 hooks 或签名都会改变提交结果 | `packages/agent-core-v2/src/features/tower/` |
|
||||
|
||||
### 配置状态
|
||||
|
||||
| 人群 | 说明 | 契约位置 |
|
||||
|---|---|---|
|
||||
| 默认配置用户 | 任何默认值翻转对他们都是行为变更 | `packages/agent-core-v2/docs/config-manifest.toml` |
|
||||
| experimental flag 用户 | `[experimental]` 与 `KIMI_CODE_EXPERIMENTAL_*`;flag 的 `default` 翻成 true 等于面向全体发布 | `packages/agent-core-v2/src/app/flag/flagRegistry.ts`、各域的 `flag.ts` |
|
||||
| legacy flag 用户 | `KIMI_CODE_LEGACY_FLAG`(#3820:TUI 与 print 模式静默忽略) | |
|
||||
| 自定义 agent 用户 | `--agent` 的 `disallowedTools` 等策略(#3417) | |
|
||||
| 配了 hooks 的用户 | 事件名与载荷是外部脚本的契约;配了 hook 时审批面板不渲染并被静默批准(#3888)、v2 不触发 PreToolUse(#3431) | `packages/agent-core-v2/src/features/externalHooks/internal/types.ts`、`docs/en/customization/hooks.md` |
|
||||
| skills、plugins、MCP 用户 | 含 stdio MCP、用户级 skill 根目录、`[watch]` 热加载(#3931 关掉默认,#4015 翻回;关掉时连带 AGENTS.md 变更提醒失效,`/reload` 只覆盖 config 与 skills) | `docs/en/customization/` |
|
||||
| 环境变量用户 | 同一个变量在 TUI、print 模式、kap-server 三个入口要行为一致(#3498:三个入口两种行为) | `docs/en/configuration/env-vars.md` |
|
||||
| 主题、键位、TUI 模式自定义用户 | `tui.toml` | `docs/en/customization/themes.md`、`docs/en/reference/keyboard.md` |
|
||||
|
||||
### 数据年代
|
||||
|
||||
| 人群 | 说明 | 契约位置 |
|
||||
|---|---|---|
|
||||
| 旧版本写的会话 | wire 日志、turn 编号、压缩后的 transcript(#3561、#3866、#3922);新版本能否读、回滚后能否读 | `packages/agent-core-v2/docs/wire-manifest.d.ts`、`packages/agent-core-v2/docs/state-manifest.d.ts` |
|
||||
| `kimi migrate` 迁来的会话 | 从 `~/.kimi/` 迁到 `~/.kimi-code/` | `packages/migration-legacy/` |
|
||||
| 搜索索引 | minidb 快照与 WAL | `packages/minidb/` |
|
||||
| 后台任务与 cron 持久化 | 非正常退出后的恢复(#3924) | |
|
||||
| 目录布局 | 任何读写 `~/.kimi-code/` 的代码 | `docs/en/configuration/data-locations.md` |
|
||||
|
||||
### 外部自动化
|
||||
|
||||
| 人群 | 契约 |
|
||||
|---|---|
|
||||
| 解析 `stream-json` 的脚本 | 事件形态与顺序 |
|
||||
| hook 脚本 | 事件名、载荷字段、返回值语义 |
|
||||
| `kimi export` 的消费者 | 导出格式 |
|
||||
| 关闭遥测的用户 | `KIMI_DISABLE_TELEMETRY` 在所有入口生效 |
|
||||
|
||||
### 模型行为人群
|
||||
|
||||
prompt 文本改动影响全体用户,且没有测试能证明"无影响"。已知依赖具体句子的人群:
|
||||
|
||||
- 依赖"不碰工作目录外文件"的(#3879 删除了这条规则)。
|
||||
- 依赖"cwd 即项目根"的(#3929 删除了这条断言)。
|
||||
- plan 模式提醒节奏(#3489)。
|
||||
|
||||
基于外部基准分析做的 prompt 改动,本质是把一个人群的收益换成另一个人群的损失,必须写明两边各是谁。
|
||||
|
||||
## 二、触发线索:diff 里碰到就必须列行为变化
|
||||
|
||||
| diff 里出现 | 代表的 surface | 必做的检查 |
|
||||
|---|---|---|
|
||||
| `packages/agent-core-v2/src/app/agentProfileCatalog/system.md`,以及 `packages/agent-core-v2/src/**/*.md`(工具描述、提醒、overlay、内置 skill) | 模型行为 | 每删或改一句单独成行:这句改动前约束了什么行为,谁依赖,现在由什么来约束 |
|
||||
| `packages/agent-core-v2/docs/config-manifest.toml`(由 `src/app/config/configSectionContributions.ts` 生成,`test/app/config/configManifest.test.ts` 守护同步) | 配置键、默认值、校验 | 默认翻转与校验收紧必列;改了 manifest 没改 `docs/en/configuration/config-files.md` 视为文档过时 |
|
||||
| `packages/agent-core-v2/src/**/flag.ts`、`packages/agent-core-v2/src/app/flag/flagRegistry.ts` | experimental flag | `default` 翻转等于面向全体发布,按行为变更处理 |
|
||||
| `packages/agent-core-v2/src/human/utils/watch.ts`(热加载开关)以及任何模块级默认常量、`?? true` / `?? false` 兜底被配置键覆盖的地方 | 默认值来源 | 默认翻转必列;退路的 config 路径要有 guard 测试,不能只靠 env;退路是否依赖 ConfigService 先于消费方构造 |
|
||||
| `packages/agent-core-v2/docs/wire-manifest.d.ts`、`packages/agent-core-v2/docs/state-manifest.d.ts` | 磁盘会话格式 | 旧会话能否读、回滚到上一版能否读、有无迁移 |
|
||||
| `packages/kap-server/test/__snapshots__/apiSurface.snapshot.test.ts.snap`、`packages/kap-server/src/routes/`、`packages/kap-server/src/transport/ws/` | desktop、web、VS Code 的服务端契约 | 消费方在仓库外,点名让作者去 code-app 核对;上一版客户端连新服务端是否仍可用 |
|
||||
| `packages/node-sdk/src/index.ts`、`packages/node-sdk/package.json` | SDK 导出面 | 删除或改签名即破坏性变更 |
|
||||
| `packages/klient/src/` | SDK 与 ACP 下面的客户端门面契约 | 只改 klient 的 PR 碰不到 node-sdk 导出面,按 SDK 调用方与 ACP 客户端两个人群核行为变化 |
|
||||
| `packages/transcript/src/contract/` | kap-server 发给 desktop、web、VS Code 的 transcript 载荷契约 | 消费方在 code-app,点名让作者去核;上一版客户端能否解析新载荷 |
|
||||
| `.github/workflows/release.yml`、`_native-build.yml`、`manual-native-bundle.yml`、`vscode-publish.yml`,`apps/kimi-code/scripts/native/`、`apps/kimi-code/scripts/check-web-assets.mjs` | 发布产物 | 按安装方式与平台核:npm 包内容、各平台 native 二进制、VS Code 市场包、内置 web 产物是否仍齐全 |
|
||||
| `packages/acp-server/` | ACP 客户端 | 对照 `docs/en/reference/kimi-acp.md` 的能力矩阵逐项核对 |
|
||||
| `apps/kimi-code/src/cli/` | 命令行参数、子命令、`--output-format` | 对照 `docs/en/reference/kimi-command.md` |
|
||||
| `packages/agent-core-v2/src/features/externalHooks/` | hook 事件与载荷 | 对照 `docs/en/customization/hooks.md` 的事件参考 |
|
||||
| `packages/agent-core-v2/src/human/llm/requester/bases/` | provider 方言分支 | 枚举每种上游载荷形态改动前后各走哪条分支,尤其是多个字段并存的网关 |
|
||||
| `packages/agent-core-v2/src/app/git/`、`apps/kimi-code/src/utils/git/` | 后台 git 的调用方式、config 覆盖、超时 | 对照"git 仓库形态"人群逐行核:前置探针失败是否让整个后台 git 静默不可用;覆盖的 config 键是否有 `required`、`gpgSign`、`hooksPath` 这类会把"禁用"变成"失败"的键;Windows 用例是否全部 skip |
|
||||
| `packages/migration-legacy/`、`packages/minidb/`、任何读写 `~/.kimi-code/` 布局的代码 | 数据年代 | 老数据是否仍可读、可迁移 |
|
||||
| 任何环境变量读取点的新增、删除或语义变化,不限写法(`process.env.X`、`process.env['X']`、动态键、helper)也不限 `KIMI_` 前缀 | 环境变量 | 对照 `docs/en/configuration/env-vars.md` 的全部条目;TUI、print 模式、kap-server 三个入口是否一致 |
|
||||
| `packages/agent-core-v2/src/app/scopes.ts`、`packages/agent-core-v2/src/features/featureAssemblyService.ts`、config ready 相关 | 启动顺序与生命周期 | 谁依赖原来的顺序;#3471 在合入 34 分钟后被 #3486 整体 revert |
|
||||
| `docs/en/**`、`docs/zh/**` 的 reference、configuration、customization 页 | 公开承诺 | 改了行为没改文档,或改了文档没改行为,都要指出 |
|
||||
| 测试里把旧断言改成新行为 | 行为变化的直接证据 | 逐条对应到行为变化清单 |
|
||||
|
||||
## 三、历史案例:用来校准等级
|
||||
|
||||
| 类型 | 案例 | 当时漏掉的问题 | 事后等级 |
|
||||
|---|---|---|---|
|
||||
| 方言分支收窄 | #3492 引入,#3900 用户报告,#3910 修复 | PR 正文写明"只有没有数组时才读字符串",没人问谁会两个字段同时发 | L2 无退路,输入被静默丢弃升 L3,openai 兼容网关人群 |
|
||||
| 默认值翻转 | #3931,五天后 #4015 翻回默认开 | changeset 只写新默认,没写运行中编辑 config、skills、AGENTS.md、agent 文件、mcp.json 不再自动生效;AGENTS.md 变更提醒随之失效,`/reload` 与 `/new` 不重读 AGENTS.md;review 未覆盖行为变化 | L1 有退路,但改了文件不生效也无任何信号,静默升 L2;changeset 没点明失去的行为,config 路径的退路无 guard 测试 |
|
||||
| prompt 删句子 | #3879、#3929 | "没有测试引用这句"被当成无影响证据 | L2 无退路,全体用户;行为公开可见,不算静默 |
|
||||
| 重构丢功能 | #2961 引入,#3081、#3167 用户报告,#3183 修复 | 重构删掉了 ACP 本地执行兜底与 stdio MCP 接受,文档承诺仍在 | L3,功能整体不可用,ACP 人群,报错响亮但无退路 |
|
||||
| 移植漏项 | #3498、#3098、#3250、#3431、#3820 | v1 路径有、v2 路径没有:env 变量、上下文用量、卡片字段、hook、legacy flag;没人列过旧路径功能清单 | L2 无退路,配置被静默忽略升 L3 |
|
||||
| 修复引入时序变化 | #3471 合入后 34 分钟被 #3486 revert | 延迟装配改变了启动顺序 | 全体用户 |
|
||||
| 输出契约无声变化 | #3146 | headless 事件输出变了,没有 changelog | L2,脚本解析者 |
|
||||
| 静默批准 | #3888 | 配了 hook 时审批面板不渲染,待审调用被静默批准 | L3,安全边界 |
|
||||
| 安全收紧连带 | #3964(2.1.0),两天后 #4013 整体回滚 | 盲审列出四条:后台 git 探针在子模块 + 符号链接路径下整体失败;filter 驱动 `required = true` 仓库 `git status` fatal;print、ACP、SDK 无信任入口导致 `additional_dir` 静默为空;`~` 条目让 local.toml 整文件失效并静默退出。PR 正文未列任何人群 | L3 候选,四条均无退路、changeset 未提;回滚后代码已不在 main |
|
||||
|
|
@ -126,7 +126,12 @@ Public-text rule: do not copy real internal endpoints, key names, account names,
|
|||
|
||||
### 4. Merge, Deduplicate, And Classify Entries
|
||||
|
||||
Before classifying, merge related entries and drop redundant ones from the user-facing changelog:
|
||||
First, count the stripped upstream entries in the version range being synced. The count decides how much curation happens before the human review checkpoint:
|
||||
|
||||
- **10 entries or fewer: list everything and let the user decide.** Classify every entry into its section and list them all — do not fold, merge, or drop entries on your own, and do not write a catch-all line. At the human review checkpoint (step 8), present the full list with advisory notes (which entries look low-signal under the two gates below, and why) so the user decides what stays, what merges, and what folds.
|
||||
- **More than 10 entries: curate first, then review.** Merge related entries and fold low-signal ones into the catch-all line before writing the page, using the rules below. The reviewer still owns the final cutoff — surface the borderline calls instead of resolving them silently.
|
||||
|
||||
The rules below are the shared curation standard: they drive the curator's fold/merge decisions when there are more than 10 entries, and they drive the advisory notes when there are 10 or fewer.
|
||||
|
||||
- **Curate for end users: collapse low-signal entries into one catch-all line.** The docs changelog is the only curated, user-facing outlet; the full entry list always remains in the upstream package changelog, so hiding detail here loses nothing. Apply two gates to every candidate entry. Gate 1, the reader-action test: **after reading this, is there something the reader must do, or something they must re-evaluate?** Gate 2, the channel test: **is the changelog the only channel that can deliver this?** The changelog is the channel of last resort — when the product itself surfaces the information in context, at the moment of need, to exactly the affected users, the entry is redundant no matter how real the improvement is. "Surfaced" means pushed into the user's path, not merely present on screen: an event-triggered card, prompt, or post-install screen forces the encounter, while a toggle, menu item, command, or settings page only waits to be found. Users do not explore — a capability that lives only in ambient UI is effectively undiscoverable, so the changelog must announce it. What in-product surfacing cannot deliver: hidden controls (env vars, config keys, opt-out flags nobody would find unprompted), invalidations of existing habits or expectations (in-product discovery comes as confusion), and capabilities users would not know to seek. An entry that fails either gate folds. Anchor both gates to the changelog's reader, never to the bug's victim: someone who hit a loud failure does not need the changelog to confirm the fix — the product working again is the notification — and a reader who never hit it gets nothing from the entry.
|
||||
- `Features`: keep when users would try it or must react to it — new capabilities create demand readers did not know to seek. Collapse only behavior that takes effect solely behind an experimental flag.
|
||||
|
|
@ -324,7 +329,7 @@ Check:
|
|||
- Each version has the same section set and order on both pages.
|
||||
- Each section has the same number of entries on both pages.
|
||||
- Within each section, the most valuable, obvious, and larger entries appear before smaller or narrower entries.
|
||||
- Low-signal entries were collapsed into the single catch-all line, placed last under `Bug Fixes` — or under `Polish` when nothing folded is a fix (both the reader-action test and the channel test applied); the catch-all wording matches what was folded and never claims fixes that did not happen; section sizes stay within the density defaults (about 2 Polish, 3 Bug Fixes) unless extra qualifying entries were deliberately kept and flagged for review. The catch-all line ends with the upstream changelog pointer (file link, no version anchor).
|
||||
- Entry count decided the curation level: a version range with 10 or fewer upstream entries lists everything classified, with no catch-all line (fold/merge decisions deferred to the review checkpoint); with more than 10, low-signal entries were collapsed into the single catch-all line, placed last under `Bug Fixes` — or under `Polish` when nothing folded is a fix (both the reader-action test and the channel test applied); the catch-all wording matches what was folded and never claims fixes that did not happen; section sizes stay within the density defaults (about 2 Polish, 3 Bug Fixes) unless extra qualifying entries were deliberately kept and flagged for review. The catch-all line ends with the upstream changelog pointer (file link, no version anchor).
|
||||
- PR links and commit hashes were stripped.
|
||||
- No `Thanks ...!` credit remains (remove it every time).
|
||||
- Real internal identifiers were replaced with neutral placeholders.
|
||||
|
|
@ -353,7 +358,7 @@ If the user chooses review:
|
|||
git diff docs/en/release-notes/changelog.md docs/zh/release-notes/changelog.md
|
||||
```
|
||||
|
||||
2. Summarize synced versions, section counts, and anything that needed manual classification. List every entry folded into a catch-all line (short titles, one line each), any section that exceeds the density defaults, and every borderline call flagged during curation — the reviewer cannot own a cutoff they cannot see.
|
||||
2. Summarize synced versions, section counts, and anything that needed manual classification. When the synced version range had 10 or fewer upstream entries and everything was listed, present the full entry list with advisory notes (which entries look low-signal and why) and ask the user to decide what stays, what merges, and what folds. When entries were folded into a catch-all line (more than 10 upstream entries), list every folded entry (short titles, one line each), any section that exceeds the density defaults, and every borderline call flagged during curation — the reviewer cannot own a cutoff they cannot see.
|
||||
3. Tell the user to reply when they are done reviewing, or to ask for edits.
|
||||
4. Do **not** commit, push, or open a PR until the user explicitly says review is complete, or asks to proceed.
|
||||
|
||||
|
|
@ -434,6 +439,7 @@ Return the PR URL to the user when done.
|
|||
- Never edit upstream `apps/kimi-code/CHANGELOG.md`.
|
||||
- Do not backfill unreleased `.changeset/*.md` drafts into the docs site.
|
||||
- If upstream wording is wrong, leave upstream alone and fix it in a future changeset.
|
||||
- A version range with 10 or fewer upstream entries is listed in full; fold/merge/drop decisions belong to the user at the review checkpoint, not the curator.
|
||||
- Always sync on a `docs/changelog-sync-*` branch and open a PR; never push changelog docs sync directly to `main`.
|
||||
- Wait for the human review checkpoint before committing, pushing, or opening a PR.
|
||||
|
||||
|
|
@ -446,7 +452,8 @@ Return the PR URL to the user when done.
|
|||
| Leaving the `Thanks ...!` credit in docs | Remove it every time, including the multi-author form |
|
||||
| Leaving near-duplicate micro-tweaks as separate bullets | Merge small tweaks to the same surface into one higher-level entry (e.g. composer height + font → composer's default styling) |
|
||||
| Listing many narrow fixes to the same surface as separate bullets | When three or more fixes target the same UI area or the same class of problem, merge them into one higher-level fix entry; keep genuinely distinct or high-value fixes standalone |
|
||||
| Listing low-signal fixes or internal changes as standalone bullets | Collapse them into the single catch-all line (`Fix several known issues.`) placed last under Bug Fixes; treat the section-size defaults (about 2 Polish, 3 Bug Fixes) as a density guard, not a quota |
|
||||
| Listing low-signal fixes or internal changes as standalone bullets when curating (>10 entries) | Collapse them into the single catch-all line (`Fix several known issues.`) placed last under Bug Fixes; treat the section-size defaults (about 2 Polish, 3 Bug Fixes) as a density guard, not a quota |
|
||||
| Folding, merging, or dropping entries on your own when the version range has 10 or fewer upstream entries | List everything classified, with no catch-all line, and let the user decide at the review checkpoint |
|
||||
| Folding a qualifying entry just to hit the section-size default | The defaults are density guards; keep entries that genuinely pass the reader-action test and flag the overflow for the human reviewer |
|
||||
| Keeping a fix because it was severe or hard-won | Severity makes the announcement redundant — the fix itself notifies whoever was hit; keep only behavior-change fixes and retrospective notices with a concrete, locatable action |
|
||||
| Keeping an improvement the product surfaces in context (recovery cards, post-install guidance, progress displays) | The product is the better channel — right users, moment of need; fold it (channel test) |
|
||||
|
|
|
|||
|
|
@ -1,38 +0,0 @@
|
|||
---
|
||||
name: tdd
|
||||
description: Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
|
||||
---
|
||||
|
||||
# Test-Driven Development
|
||||
|
||||
TDD is the red → green loop. This skill is the reference that makes that loop produce tests worth keeping: what a good test is, where tests go, the anti-patterns, and the rules of the loop. Every section applies on every cycle: consult them before and during the loop, not after.
|
||||
|
||||
When exploring the codebase, read `CONTEXT.md` (if it exists) so test names and interface vocabulary match the project's domain language, and respect ADRs in the area you're touching.
|
||||
|
||||
## What a good test is
|
||||
|
||||
Tests verify behavior through public interfaces, not implementation details. Code can change entirely; tests shouldn't. A good test reads like a specification: "user can checkout with valid cart" tells you exactly what capability exists, and it survives refactors because it doesn't care about internal structure.
|
||||
|
||||
See [tests.md](tests.md) for examples and [mocking.md](mocking.md) for mocking guidelines.
|
||||
|
||||
## Seams: where tests go
|
||||
|
||||
A **seam** is the public boundary you test at: the interface where you observe behavior without reaching inside. Tests live at seams, never against internals.
|
||||
|
||||
**Test only at pre-agreed seams.** Before writing any test, write down the seams under test and confirm them with the user. No test is written at an unconfirmed seam. You can't test everything, so agreeing the seams up front is how testing effort lands on the critical paths and complex logic instead of every edge case.
|
||||
|
||||
Ask: "What's the public interface, and which seams should we test?"
|
||||
|
||||
When the shape of that interface is itself in question (how deep the module is, where the seam belongs, what the interface should expose), call the Skill tool with "codebase-design" for the vocabulary. It is the shared source of the module, interface, depth, seam, adapter, leverage and locality terms, and it is a reference to consult, not a session to run.
|
||||
|
||||
## Anti-patterns
|
||||
|
||||
- **Implementation-coupled**: mocks internal collaborators, tests private methods, or verifies through a side channel (querying the database instead of using the interface). The tell: the test breaks when you refactor but behavior hasn't changed.
|
||||
- **Tautological**: the assertion recomputes the expected value the way the code does (`expect(add(a, b)).toBe(a + b)`, a snapshot derived by hand the same way, a constant asserted equal to itself), so it passes by construction and can never disagree with the code. Expected values must come from an independent source of truth: a known-good literal, a worked example, the spec.
|
||||
- **Horizontal slicing**: writing all tests first, then all implementation. Bulk tests verify _imagined_ behavior: you test the _shape_ of things rather than user-facing behavior, the tests go insensitive to real changes, and you commit to test structure before understanding the implementation. Work in **vertical slices** instead: one test → one implementation → repeat, each test a **tracer bullet** that responds to what the last cycle taught you.
|
||||
|
||||
## Rules of the loop
|
||||
|
||||
- **Red before green.** Write the failing test first, then only enough code to pass it. Don't anticipate future tests or add speculative features.
|
||||
- **One slice at a time.** One seam, one test, one minimal implementation per cycle.
|
||||
- **Refactoring is not part of the loop.** It belongs to the review stage (see the `code-review` skill), not the red → green implementation cycle.
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
# When to Mock
|
||||
|
||||
Mock at **system boundaries** only:
|
||||
|
||||
- External APIs (payment, email, etc.)
|
||||
- Databases (sometimes - prefer test DB)
|
||||
- Time/randomness
|
||||
- File system (sometimes)
|
||||
|
||||
Don't mock:
|
||||
|
||||
- Your own classes/modules
|
||||
- Internal collaborators
|
||||
- Anything you control
|
||||
|
||||
## Designing for Mockability
|
||||
|
||||
At system boundaries, design interfaces that are easy to mock:
|
||||
|
||||
**1. Use dependency injection**
|
||||
|
||||
Pass external dependencies in rather than creating them internally:
|
||||
|
||||
```typescript
|
||||
// Easy to mock
|
||||
function processPayment(order, paymentClient) {
|
||||
return paymentClient.charge(order.total);
|
||||
}
|
||||
|
||||
// Hard to mock
|
||||
function processPayment(order) {
|
||||
const client = new StripeClient(process.env.STRIPE_KEY);
|
||||
return client.charge(order.total);
|
||||
}
|
||||
```
|
||||
|
||||
**2. Prefer SDK-style interfaces over generic fetchers**
|
||||
|
||||
Create specific functions for each external operation instead of one generic function with conditional logic:
|
||||
|
||||
```typescript
|
||||
// GOOD: Each function is independently mockable
|
||||
const api = {
|
||||
getUser: (id) => fetch(`/users/${id}`),
|
||||
getOrders: (userId) => fetch(`/users/${userId}/orders`),
|
||||
createOrder: (data) => fetch('/orders', { method: 'POST', body: data }),
|
||||
};
|
||||
|
||||
// BAD: Mocking requires conditional logic inside the mock
|
||||
const api = {
|
||||
fetch: (endpoint, options) => fetch(endpoint, options),
|
||||
};
|
||||
```
|
||||
|
||||
The SDK approach means:
|
||||
- Each mock returns one specific shape
|
||||
- No conditional logic in test setup
|
||||
- Easier to see which endpoints a test exercises
|
||||
- Type safety per endpoint
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
# Good and Bad Tests
|
||||
|
||||
## Good Tests
|
||||
|
||||
**Integration-style**: Test through real interfaces, not mocks of internal parts.
|
||||
|
||||
```typescript
|
||||
// GOOD: Tests observable behavior
|
||||
test("user can checkout with valid cart", async () => {
|
||||
const cart = createCart();
|
||||
cart.add(product);
|
||||
const result = await checkout(cart, paymentMethod);
|
||||
expect(result.status).toBe("confirmed");
|
||||
});
|
||||
```
|
||||
|
||||
Characteristics:
|
||||
|
||||
- Tests behavior users/callers care about
|
||||
- Uses public API only
|
||||
- Survives internal refactors
|
||||
- Describes WHAT, not HOW
|
||||
- One logical assertion per test
|
||||
|
||||
## Bad Tests
|
||||
|
||||
**Implementation-detail tests**: Coupled to internal structure.
|
||||
|
||||
```typescript
|
||||
// BAD: Tests implementation details
|
||||
test("checkout calls paymentService.process", async () => {
|
||||
const mockPayment = jest.mock(paymentService);
|
||||
await checkout(cart, payment);
|
||||
expect(mockPayment.process).toHaveBeenCalledWith(cart.total);
|
||||
});
|
||||
```
|
||||
|
||||
Red flags:
|
||||
|
||||
- Mocking internal collaborators
|
||||
- Testing private methods
|
||||
- Asserting on call counts/order
|
||||
- Test breaks when refactoring without behavior change
|
||||
- Test name describes HOW not WHAT
|
||||
- Verifying through external means instead of interface
|
||||
|
||||
```typescript
|
||||
// BAD: Bypasses interface to verify
|
||||
test("createUser saves to database", async () => {
|
||||
await createUser({ name: "Alice" });
|
||||
const row = await db.query("SELECT * FROM users WHERE name = ?", ["Alice"]);
|
||||
expect(row).toBeDefined();
|
||||
});
|
||||
|
||||
// GOOD: Verifies through interface
|
||||
test("createUser makes user retrievable", async () => {
|
||||
const user = await createUser({ name: "Alice" });
|
||||
const retrieved = await getUser(user.id);
|
||||
expect(retrieved.name).toBe("Alice");
|
||||
});
|
||||
```
|
||||
|
||||
**Tautological tests**: Expected value restates the implementation, so the test passes by construction.
|
||||
|
||||
```typescript
|
||||
// BAD: Expected value is recomputed the way the code computes it
|
||||
test("calculateTotal sums line items", () => {
|
||||
const items = [{ price: 10 }, { price: 5 }];
|
||||
const expected = items.reduce((sum, i) => sum + i.price, 0);
|
||||
expect(calculateTotal(items)).toBe(expected);
|
||||
});
|
||||
|
||||
// GOOD: Expected value is an independent, known literal
|
||||
test("calculateTotal sums line items", () => {
|
||||
expect(calculateTotal([{ price: 10 }, { price: 5 }])).toBe(15);
|
||||
});
|
||||
```
|
||||
140
.agents/skills/write-pr/SKILL.md
Normal file
140
.agents/skills/write-pr/SKILL.md
Normal file
|
|
@ -0,0 +1,140 @@
|
|||
---
|
||||
name: write-pr
|
||||
description: 在 kimi-code 仓库里创建或更新 PR 时使用:如何把 PR 模板的每一节写得简洁、便于 reviewer 理解,包括"行为变化与受影响人群"表。
|
||||
---
|
||||
|
||||
# 写 PR 描述
|
||||
|
||||
为当前分支创建或更新 PR,描述要让 reviewer 明白这个改动为什么存在、实现长什么样、现有用户会失去什么。
|
||||
|
||||
## 工作流
|
||||
|
||||
1. 读 PR 模板:
|
||||
|
||||
`Read(.github/pull_request_template.md)`
|
||||
|
||||
2. 找到或创建 PR:
|
||||
- 先查当前分支有没有 PR:`gh pr view --json url,number,title,state 2>/dev/null`。
|
||||
- 没有的话,看 `git status --short --branch` 和当前分支上的提交。
|
||||
- 提交剩余改动,带 upstream 推送分支,用 `gh pr create` 创建 PR。
|
||||
- 遵守仓库的 git 安全规范。
|
||||
|
||||
3. 收集解释改动所需的上下文:
|
||||
- 读关联的 issue 和相关任务产物。
|
||||
- 读完整 diff(`git diff main...HEAD`)和足够的周边代码,理解行为与归属。
|
||||
- PR 已存在时,用 `gh pr view` 拿元数据和改动文件列表。
|
||||
|
||||
4. 按模板各节写描述。描述用用户当前使用的语言,行为变化表也一样;只有三样固定:PR 标题保持英文 Conventional Commit,changeset 保持英文(见 `gen-changesets` skill),节标题沿用模板原文。
|
||||
- **Requirement or Bug**:一句话,或 `Resolve #<number>`。不要多写。
|
||||
- **Bug Reproduction Steps**:只有 bug 类 PR 需要;feature 写 `N/A`。步骤已在 issue 里的写 `See linked issue`。
|
||||
- **Root Cause**:只有 bug 类 PR 需要;feature 写 `N/A`。说明根因,以及这是根本修复还是绕过。
|
||||
- **Code Changes**:能用可视化大纲说清楚的就不要写散文,见"代码变更的可视化大纲"。
|
||||
- **Behavior Changes and Affected Users**:先填行为变化表,再列受影响模块与测试覆盖,见"行为变化与受影响人群"。
|
||||
- **Checklist**:勾上所有适用的项。
|
||||
|
||||
5. 发布描述:
|
||||
- 先存到临时文件,再 `gh pr edit <number> --body-file <path>` 或 `gh pr create --body-file <path>`。
|
||||
- 确认更新成功。
|
||||
|
||||
## 行为变化与受影响人群
|
||||
|
||||
这一节回答一个问题:合入之后,现有用户会失去什么。这个仓库过去的回归大多来自没人回答这个问题,而不是逻辑错误。
|
||||
|
||||
判据:**改动前能工作的任何输入(配置键、环境变量、命令行参数、provider 响应形态、旧版本写的会话数据、客户端请求、hook 载荷)改动后必须行为不变,除非这里明确声明了变化并给出退路。**
|
||||
|
||||
写法:
|
||||
|
||||
1. 列出 diff 改变的每一个可观测行为,一行一个。包括你认为"不变"但分支条件挪动了的:新增的条件会不会先于旧条件命中既有输入;删除或收窄的分支改动前谁在走。内部包会打进 CLI 发布包,"内部"不等于用户无感。表格用 PR 描述的语言,下面的示例用英文只是示意形状:
|
||||
|
||||
| Behavior | Before | After | Who relies on the old behavior | Escape hatch |
|
||||
|---|---|---|---|---|
|
||||
| reasoning parsing when `reasoning_details` is an array | string `reasoning` also read | string ignored | OpenAI-compatible gateways that send both (OpenRouter dialect) | none |
|
||||
|
||||
2. 人群要具名,不要写"部分用户"。从 `.agents/skills/review-pr/surfaces.md` 里取:客户端(TUI、print 模式、desktop 与 web、VS Code、ACP、SDK)、provider 方言、平台、配置状态、数据年代、外部脚本。
|
||||
|
||||
3. 改了 prompt 文本(system prompt、工具描述、提醒)的,每一句单独成行,写清这句改动前约束了什么行为、谁依赖、现在由什么来约束。"没有测试引用这句"不是无影响的证据。
|
||||
|
||||
4. 替换或绕过旧路径的(移植、runtime binding、协议替换),额外列出旧路径的功能清单:它认哪些环境变量、有哪些兜底、接受哪些输入,以及每一项在新路径里的位置。
|
||||
|
||||
5. 确实没有可观测变化的,写 `None`,并说明证据:哪些分支、默认值、契约文件没动。
|
||||
|
||||
6. 表后面列受影响模块与每一行对应的测试覆盖。默认翻转或删除行为的,必须有一条测试把未被改动的人群的旧行为钉住,并且 changeset 要写明用户失去了什么,见 `gen-changesets` skill;没有退路的,在 PR 里请维护者显式拍板。
|
||||
|
||||
## 代码变更的可视化大纲
|
||||
|
||||
优先用结构化视图,少用散文。用能说清实现的最小组合,没变的类别不要列。
|
||||
|
||||
逻辑或算法变化用伪代码 diff:
|
||||
|
||||
```diff
|
||||
on(save)
|
||||
- write content
|
||||
+ if content is unchanged
|
||||
+ return cached result
|
||||
+ write new content
|
||||
+ invalidate cache
|
||||
```
|
||||
|
||||
运行时控制流用调用树 diff:
|
||||
|
||||
```diff
|
||||
submitForm
|
||||
createSession
|
||||
persistPrompt
|
||||
+ expandSkillMention
|
||||
launchAgent
|
||||
- navigateToSession
|
||||
+ navigateToSession
|
||||
+ subscribeToEvents
|
||||
```
|
||||
|
||||
文件职责变化用浅层文件树 diff:
|
||||
|
||||
```diff
|
||||
src/
|
||||
├── commands/
|
||||
+│ └── show-me.ts # expands the slash command
|
||||
├── sessions/
|
||||
-└── transport.ts
|
||||
+└── transport/
|
||||
+ ├── client.ts
|
||||
+ └── stream.ts
|
||||
```
|
||||
|
||||
组件或 UI 结构变化用树 diff:
|
||||
|
||||
```diff
|
||||
<SessionPage>
|
||||
useSessionEvents()
|
||||
<SessionToolbar>
|
||||
+ <RunSkillButton />
|
||||
<SessionTimeline>
|
||||
+ <SkillResultCard />
|
||||
```
|
||||
|
||||
组件交互、控制流或数据流用 Mermaid,解释 bug 机制时尤其有用:
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant User
|
||||
participant UI
|
||||
participant Daemon
|
||||
User->>UI: choose command
|
||||
UI->>Daemon: send expanded prompt
|
||||
Daemon-->>UI: stream result
|
||||
```
|
||||
|
||||
关键数据结构或类型变化用对应语言的代码块:
|
||||
|
||||
```ts
|
||||
interface SessionEvents {
|
||||
onTurnStart(cb: (turn: Turn) => void): void;
|
||||
onTurnEnd(cb: (turn: Turn) => void): void;
|
||||
}
|
||||
```
|
||||
|
||||
可视化大纲的规则:
|
||||
- 重点是"变了什么"且周边形状已存在时,用 `diff` 块。
|
||||
- 大部分是新内容,或 diff 记法会掩盖归属和顺序时,用对应语言或 `text` 块给出完整目标形状。
|
||||
- 按最容易理解的顺序讲:先文件还是先数据结构,哪个合适用哪个。
|
||||
- 像一个人对另一个人讲话:简单、连贯、简洁。
|
||||
|
|
@ -15,7 +15,6 @@ Current publishable packages:
|
|||
|
||||
All other workspace packages are private internal packages, are not published to npm, and are excluded via `ignore` in `.changeset/config.json`:
|
||||
|
||||
- `@moonshot-ai/kaos`
|
||||
- `@moonshot-ai/kimi-code-oauth`
|
||||
- `@moonshot-ai/kimi-telemetry`
|
||||
- `@moonshot-ai/kosong`
|
||||
|
|
@ -100,23 +99,27 @@ Commit messages must follow Conventional Commit style. Do not include any author
|
|||
|
||||
### 4. CI generates the release PR
|
||||
|
||||
Once the changeset file is merged into `main`, `.github/workflows/release.yml` uses `changesets/action@v1` to create or update a release PR.
|
||||
Changesets accumulate on `main`. Create `release/<cycle>` from the selected commit; pushes to that branch use `changesets/action@v1` to create or update its release PR. Manual **Release** runs on a release branch only prepare the PR. The workflow explicitly dispatches CI for the generated version branch.
|
||||
|
||||
The release PR runs:
|
||||
|
||||
- `pnpm changeset version`: bumps publishable package versions and updates changelogs;
|
||||
- Deletes the consumed `.changeset/*.md` files;
|
||||
- Uses the title `[CI]: Release packages`.
|
||||
- Uses the title `ci: release packages`.
|
||||
|
||||
### 5. Merge the release PR
|
||||
|
||||
Once the release PR is merged into `main`, the same workflow runs:
|
||||
Review the version PR, latest CI and CLI/extension pre-changelog together. Once the matching version PR is merged into `release/<cycle>`, publication waits for that exact commit’s push CI. Ordinary pushes do not publish. The existing publication steps then run:
|
||||
|
||||
- `pnpm install --frozen-lockfile`
|
||||
- `pnpm build`
|
||||
- `pnpm changeset publish`
|
||||
|
||||
The packages are then published via npm Trusted Publishing, and a GitHub Release is created.
|
||||
The packages are then published via npm Trusted Publishing, and a GitHub Release is created. CLI native builds still depend on Changesets reporting a newly published CLI package; npm-succeeded/native-failed whole-run recovery is not changed by this migration.
|
||||
|
||||
VS Code uses the same approved release commit and CI gate, publishing only when the extension version changed in that push. It retains its existing build and marketplace checks. It no longer publishes on main pushes or through a standalone manual entry. The documentation workflow is dispatched on main after CLI artifacts are uploaded; its deployment result is tracked separately. CDN remains manual.
|
||||
|
||||
Migration: merge the main infrastructure PR first to disable the old publisher, then the release infrastructure PR. These PRs do not publish. Close the obsolete main version PR separately. After the actual release, synchronize versions, changelogs, lockfile and consumed changeset removals back to main, preserving later main work. Main synchronization does not publish npm or VS Code. Do not change Desktop's submodule pointer as part of this step.
|
||||
|
||||
## Manual Publishing (Not Recommended)
|
||||
|
||||
|
|
@ -141,7 +144,7 @@ The root-level `pnpm run publish` first runs typecheck, lint, sherif, test, buil
|
|||
- Every PR that affects publishable-package behavior or public API should include a corresponding changeset.
|
||||
- Changes under `plugins/` (the bundled official plugins such as `kimi-datasource`) do **not** need a changeset: each plugin carries its own version in `kimi.plugin.json` and `plugins/marketplace.json` and is distributed via the marketplace CDN, separately from the `@moonshot-ai/kimi-code` npm package.
|
||||
- Changeset files must be committed to the repository — release PRs are only triggered after they're merged.
|
||||
- Release PRs require human review and merge; they will not publish automatically.
|
||||
- Release PRs require human review and approval. They do not publish before merge; merging the approved PR automatically publishes after its commit passes CI.
|
||||
- Do not add release changesets for private internal packages; only select `@moonshot-ai/kimi-code` and `@moonshot-ai/kimi-code-sdk`.
|
||||
- If a change in an underlying internal package alters user-visible behavior or public API of a publishable package, add a changeset to the affected publishable package. For example, when a bug fixed in `@moonshot-ai/kosong` resolves an issue CLI users encounter, add a changeset to `@moonshot-ai/kimi-code` describing the user-visible fix.
|
||||
- `@moonshot-ai/kimi-code` is the official CLI package name; after a global install it provides the `kimi` command.
|
||||
|
|
|
|||
5
.changeset/expand-live-thinking.md
Normal file
5
.changeset/expand-live-thinking.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"@moonshot-ai/kimi-code": minor
|
||||
---
|
||||
|
||||
Allow expanding thinking during streaming with Ctrl-O
|
||||
5
.changeset/fix-zombie-session-occupancy.md
Normal file
5
.changeset/fix-zombie-session-occupancy.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"@moonshot-ai/kimi-code": patch
|
||||
---
|
||||
|
||||
Fix sessions occasionally remaining occupied after an application crash on macOS and Linux.
|
||||
5
.changeset/import-cc-codex-refresh.md
Normal file
5
.changeset/import-cc-codex-refresh.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"@moonshot-ai/kimi-code": patch
|
||||
---
|
||||
|
||||
Update cross-tool imports for custom homes, instruction duplicate checks, project skills, and MCP settings; stop importing standalone `.claude/AGENTS.md`, project `.codex/AGENTS.md`, `.codex/CLAUDE.md`, and loose skill files, which can still be copied manually.
|
||||
5
.changeset/kap-session-idle-reclaim.md
Normal file
5
.changeset/kap-session-idle-reclaim.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"@moonshot-ai/kimi-code": minor
|
||||
---
|
||||
|
||||
Sessions in web and desktop now unload from memory after 30 minutes idle and resume transparently on next access.
|
||||
5
.changeset/provider-refresh-command.md
Normal file
5
.changeset/provider-refresh-command.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"@moonshot-ai/kimi-code": minor
|
||||
---
|
||||
|
||||
Add `/provider refresh [providerId]` to re-fetch provider model lists at runtime; unknown `/provider` subcommands now show a usage hint instead of opening the manager.
|
||||
5
.changeset/quick-resume-long-sessions.md
Normal file
5
.changeset/quick-resume-long-sessions.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"@moonshot-ai/kimi-code": patch
|
||||
---
|
||||
|
||||
Speed up session resume for long conversations.
|
||||
5
.changeset/session-lock-takeover.md
Normal file
5
.changeset/session-lock-takeover.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"@moonshot-ai/kimi-code": patch
|
||||
---
|
||||
|
||||
Offer to take over a session that is still in use after a retry, so sessions left locked by an exited process can be used again, and add a `KIMI_CODE_SESSION_LOCK=0` switch that turns off the session lock.
|
||||
5
.changeset/wedged-turn-transcript-axis.md
Normal file
5
.changeset/wedged-turn-transcript-axis.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"@moonshot-ai/kimi-code": patch
|
||||
---
|
||||
|
||||
Fix the conversation view freezing at an old point after restarting the app when a turn had been interrupted; interrupted turns are now marked instead of shown as completed.
|
||||
32
.github/pull_request_template.md
vendored
32
.github/pull_request_template.md
vendored
|
|
@ -6,24 +6,40 @@ External PRs are accepted for approved bug fixes only: link an issue that a main
|
|||
See https://github.com/MoonshotAI/kimi-code/blob/main/CONTRIBUTING.md for more.
|
||||
-->
|
||||
|
||||
## Related Issue
|
||||
## Requirement or Bug
|
||||
|
||||
<!-- Link the issue this change came from. External PRs must link an issue approved by a maintainer (an `/approve` comment) — PRs without one may be closed. -->
|
||||
<!-- If there's an issue, write Resolve #(issue_number).
|
||||
If it's a requirement, describe it briefly in plain language (under 100 characters). -->
|
||||
|
||||
Resolve #(issue_number)
|
||||
## Bug Reproduction Steps
|
||||
|
||||
## Problem
|
||||
<!-- Required for bug PRs only; write N/A for feature PRs.
|
||||
Prefer writing in the issue and linking here; if no issue exists, write directly. -->
|
||||
|
||||
<!-- What user need or limitation does this address? If the linked issue already covers this, write "See linked issue". -->
|
||||
## Root Cause
|
||||
|
||||
## What changed
|
||||
<!-- Required for bug PRs only. Explain the root cause.
|
||||
State whether this is a fundamental fix or a workaround. -->
|
||||
|
||||
<!-- What did you implement, and why does this approach fit Kimi Code? -->
|
||||
## Code Changes
|
||||
|
||||
<!-- Describe the code changes in plain, easy-to-understand language for the reviewer. -->
|
||||
|
||||
## Behavior Changes and Affected Users
|
||||
|
||||
<!-- List every observable behavior this PR changes, one row each, including behavior you
|
||||
consider "unchanged" whose branch conditions moved, and prompt-text edits sentence by sentence.
|
||||
| Behavior | Before | After | Who relies on the old behavior | Escape hatch |
|
||||
Name affected users concretely (client, provider dialect, platform, config state, data written
|
||||
by older versions, external scripts); see .agents/skills/review-pr/surfaces.md.
|
||||
Write "None" with evidence if nothing observable changes.
|
||||
Then list affected modules and the test coverage for each row. -->
|
||||
|
||||
## Checklist
|
||||
|
||||
- [ ] I have read the [CONTRIBUTING](https://github.com/MoonshotAI/kimi-code/blob/main/CONTRIBUTING.md) document.
|
||||
- [ ] I have linked a related issue (external PRs: the issue must have a maintainer's `/approve`).
|
||||
- [ ] I have linked a related issue (external PRs: issue must have a maintainer's `/approve`).
|
||||
- [ ] I have added tests that prove my feature works.
|
||||
- [ ] The behavior-change table above is complete, and every removed behavior or flipped default is named in the changeset and either has an escape hatch or was explicitly approved by a maintainer in this PR.
|
||||
- [ ] Ran `gen-changesets` skill, or this PR needs no changeset.
|
||||
- [ ] Ran `gen-docs` skill, or this PR needs no doc update.
|
||||
|
|
|
|||
20
.github/workflows/ci.yml
vendored
20
.github/workflows/ci.yml
vendored
|
|
@ -5,11 +5,27 @@ on:
|
|||
push:
|
||||
branches:
|
||||
- main
|
||||
- 'release/*'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ci-${{ github.ref }}-${{ startsWith(github.ref, 'refs/heads/release/') && github.sha || '' }}
|
||||
cancel-in-progress: ${{ !startsWith(github.ref, 'refs/heads/release/') }}
|
||||
|
||||
jobs:
|
||||
release-workflow-tests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
- run: node --test scripts/release-trigger.test.mjs
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
|
|
@ -141,10 +157,10 @@ jobs:
|
|||
- run: pnpm install --frozen-lockfile
|
||||
- name: Typecheck
|
||||
run: |
|
||||
pnpm dlx --package @typescript/native-preview@beta tsgo --version
|
||||
pnpm exec tsc --version
|
||||
for config in packages/*/tsconfig.json apps/kimi-code/tsconfig.json; do
|
||||
echo "Typechecking ${config}"
|
||||
pnpm dlx --package @typescript/native-preview@beta tsgo -p "${config}" --noEmit
|
||||
pnpm exec tsc -p "${config}" --noEmit
|
||||
done
|
||||
- name: Typecheck VS Code extension
|
||||
run: pnpm --filter kimi-code run typecheck
|
||||
|
|
|
|||
102
.github/workflows/release.yml
vendored
102
.github/workflows/release.yml
vendored
|
|
@ -2,16 +2,88 @@ name: Release
|
|||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
branches: ['release/*']
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
||||
concurrency:
|
||||
group: release-${{ github.ref }}-${{ github.sha }}
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
version:
|
||||
if: github.repository_owner == 'MoonshotAI' && startsWith(github.ref, 'refs/heads/release/')
|
||||
concurrency:
|
||||
group: release-version-${{ github.ref }}
|
||||
cancel-in-progress: false
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
actions: write
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: pnpm/action-setup@v6
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
cache: pnpm
|
||||
- run: pnpm install --frozen-lockfile
|
||||
- uses: changesets/action@v1
|
||||
id: version
|
||||
with:
|
||||
version: pnpm run version:release
|
||||
commit: 'ci: release packages'
|
||||
title: 'ci: release packages'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Check version PR
|
||||
if: steps.version.outputs.pullRequestNumber != ''
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
VERSION_BRANCH: changeset-release/${{ github.ref_name }}
|
||||
run: gh workflow run ci.yml --ref "$VERSION_BRANCH"
|
||||
|
||||
candidate:
|
||||
if: github.repository_owner == 'MoonshotAI' && github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release/')
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
actions: read
|
||||
checks: read
|
||||
outputs:
|
||||
publish: ${{ steps.trigger.outputs.publish }}
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
ref: ${{ github.sha }}
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
- name: Wait for merged version commit CI
|
||||
id: trigger
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: node scripts/release-trigger.mjs
|
||||
|
||||
vscode:
|
||||
needs: candidate
|
||||
if: needs.candidate.outputs.publish == 'true'
|
||||
permissions:
|
||||
contents: read
|
||||
uses: ./.github/workflows/vscode-publish.yml
|
||||
secrets:
|
||||
VSCE_PAT: ${{ secrets.VSCE_PAT }}
|
||||
OVSX_PAT: ${{ secrets.OVSX_PAT }}
|
||||
|
||||
release:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository_owner == 'MoonshotAI'
|
||||
needs: candidate
|
||||
if: needs.candidate.outputs.publish == 'true'
|
||||
outputs:
|
||||
packages_published: ${{ steps.changesets.outputs.published }}
|
||||
kimi_native_release: ${{ steps.kimi-release.outputs.should_publish }}
|
||||
|
|
@ -71,16 +143,6 @@ jobs:
|
|||
env:
|
||||
CHANGESETS_PUBLISHED_PACKAGES: ${{ steps.changesets.outputs.publishedPackages }}
|
||||
|
||||
deploy-docs:
|
||||
name: Deploy docs
|
||||
needs: release
|
||||
if: needs.release.outputs.packages_published == 'true'
|
||||
uses: ./.github/workflows/docs-deploy.yml
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
native-artifacts:
|
||||
name: Native release artifact
|
||||
needs: release
|
||||
|
|
@ -132,3 +194,15 @@ jobs:
|
|||
GH_TOKEN: ${{ github.token }}
|
||||
RELEASE_TAG: ${{ needs.release.outputs.kimi_release_tag }}
|
||||
run: gh release upload "$RELEASE_TAG" dist-native-release/* --clobber
|
||||
|
||||
deploy-docs:
|
||||
needs: publish-native-assets
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: write
|
||||
steps:
|
||||
- name: Deploy existing main documentation
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
GH_REPO: ${{ github.repository }}
|
||||
run: gh workflow run docs-deploy.yml --ref main
|
||||
|
|
|
|||
74
.github/workflows/vscode-publish.yml
vendored
74
.github/workflows/vscode-publish.yml
vendored
|
|
@ -1,35 +1,16 @@
|
|||
name: Publish VS Code extension
|
||||
|
||||
# 把 0.7.3 手动发版流程固化成 CI 流水线:
|
||||
#
|
||||
# pnpm install → package:platform(全 6 平台)→ package:verify
|
||||
# → extension host 冒烟(xvfb)→ publish:vsix → publish:ovsx
|
||||
#
|
||||
# 触发语义(参照 kimi-code-app 仓 desktop release.yml 的判定方式):
|
||||
# 只在"本次 push 改动了 apps/vscode/package.json 的 version"时发布,
|
||||
# 即 changesets 版本 PR("ci: release packages")合入后自动触发;
|
||||
# 普通 PR 合入不会改变版本号,不会发布。版本号比较以 push 事件的
|
||||
# before SHA 为基准(git show),可覆盖一次 push 含多个 commit 的情况,
|
||||
# 不依赖工作区状态。workflow_dispatch 为手动兜底,
|
||||
# 跳过版本号变化检查,直接走后续幂等闸门。
|
||||
#
|
||||
# 幂等(两道保险,可安全重跑,失败即停不自动重试):
|
||||
# 1. 发布前逐平台核验 VS Marketplace(vsce show)与 Open VSX(REST)
|
||||
# 线上版本:6 个 targetPlatform(darwin/linux/win32 × x64/arm64)
|
||||
# 全部在线才跳过对应发布步骤;任一平台缺失(如上次部分发布失败)
|
||||
# 即放行给发布步骤补齐,重跑可补齐;
|
||||
# 2. 发布脚本自身带 --skip-duplicate(vsce)/ already-exists 跳过(ovsx)。
|
||||
#
|
||||
# 前置条件:仓库管理员需先配置 secrets VSCE_PAT / OVSX_PAT,
|
||||
# 未配置时 publish 步骤会失败,属预期。
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
workflow_call:
|
||||
secrets:
|
||||
VSCE_PAT:
|
||||
required: false
|
||||
OVSX_PAT:
|
||||
required: false
|
||||
|
||||
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
||||
concurrency:
|
||||
group: vscode-publish-${{ github.ref }}
|
||||
cancel-in-progress: false
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
|
@ -38,13 +19,14 @@ jobs:
|
|||
publish:
|
||||
name: Publish VSIX to marketplaces
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository_owner == 'MoonshotAI'
|
||||
if: github.repository_owner == 'MoonshotAI' && startsWith(github.ref, 'refs/heads/release/')
|
||||
timeout-minutes: 90
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0 # 需要按 push 事件的 before SHA 取旧版本号比较
|
||||
ref: ${{ github.sha }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v6
|
||||
|
|
@ -62,7 +44,6 @@ jobs:
|
|||
id: gate
|
||||
shell: bash
|
||||
env:
|
||||
EVENT_NAME: ${{ github.event_name }}
|
||||
BEFORE_SHA: ${{ github.event.before }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
|
@ -71,27 +52,20 @@ jobs:
|
|||
echo "version=${version}" >> "$GITHUB_OUTPUT"
|
||||
echo "extension version: ${version}"
|
||||
|
||||
if [ "${EVENT_NAME}" = "workflow_dispatch" ]; then
|
||||
echo "manual dispatch — skipping version-change check"
|
||||
prev=""
|
||||
if [ -n "${BEFORE_SHA}" ] && [ -n "${BEFORE_SHA//0/}" ]; then
|
||||
if git show "${BEFORE_SHA}:${pkg}" > /tmp/prev-vscode-pkg.json 2> /dev/null; then
|
||||
prev="$(node -p "require('/tmp/prev-vscode-pkg.json').version")"
|
||||
fi
|
||||
else
|
||||
# 以 push 事件的 before SHA 为比较基准(覆盖多 commit 的单次 push)。
|
||||
# before 为空或全 0(如新分支首推)时无法比较,prev 视为空 →
|
||||
# 判定版本变化放行 —— 宁可多查一次线上闸门,不可漏发。
|
||||
prev=""
|
||||
if [ -n "${BEFORE_SHA}" ] && [ -n "${BEFORE_SHA//0/}" ]; then
|
||||
if git show "${BEFORE_SHA}:${pkg}" > /tmp/prev-vscode-pkg.json 2> /dev/null; then
|
||||
prev="$(node -p "require('/tmp/prev-vscode-pkg.json').version")"
|
||||
fi
|
||||
else
|
||||
echo "push event has no usable before SHA ('${BEFORE_SHA}') — treating as a version change"
|
||||
fi
|
||||
if [ "${prev}" = "${version}" ]; then
|
||||
echo "apps/vscode version unchanged in this push (${version}) — nothing to publish"
|
||||
echo "should_publish=false" >> "$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
fi
|
||||
echo "version changed ${prev:-<none>} -> ${version} — release push"
|
||||
echo "push event has no usable before SHA ('${BEFORE_SHA}') — treating as a version change"
|
||||
fi
|
||||
if [ "${prev}" = "${version}" ]; then
|
||||
echo "apps/vscode version unchanged in this push (${version}) — nothing to publish"
|
||||
echo "should_publish=false" >> "$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
fi
|
||||
echo "version changed ${prev:-<none>} -> ${version} — release push"
|
||||
echo "should_publish=true" >> "$GITHUB_OUTPUT"
|
||||
|
||||
# 线上闸门:逐平台核验,6 个 targetPlatform 全部在线才跳过对应市场;
|
||||
|
|
|
|||
45
AGENTS.md
45
AGENTS.md
|
|
@ -21,7 +21,6 @@ This is a TypeScript monorepo built for agent-assisted development. Keep the roo
|
|||
- `packages/agent-core-v2`: the DI × Scope agent engine (the v2 port behind kap-server). Four `LifecycleScope` tiers — `App` / `Workspace` / `Session` / `Agent` (`app/scopes.ts`) — plus the L3 unit layer (`Service`/`Fiber` units, collection contribution points, the Feature seam in `src/features/`); there is no App-level session lifecycle facade — callers compose `ISessionIndex` → `IWorkspaceLifecycleService.handlerFor` → the handler.
|
||||
- `packages/node-sdk`: the public TypeScript SDK and harness.
|
||||
- `packages/kosong`: the LLM / provider abstraction layer.
|
||||
- `packages/kaos`: the execution environment and file/process abstractions.
|
||||
- `packages/oauth`: Kimi OAuth and managed auth utilities.
|
||||
- `packages/telemetry`: shared client-side telemetry infrastructure.
|
||||
- `packages/transcript`: the isomorphic transcript rendering data layer — L1 agent-granular store, L2 idempotent operations, L3 `off/turn/block/delta` subscription granularity, L4 framework-free view registry, plus turn-cursor pagination. Pure TypeScript (browser-safe, no engine imports); the sole owner of the transcript contract types (`src/contract/`) and the op-batch sequencing contract.
|
||||
|
|
@ -58,7 +57,6 @@ This is a TypeScript monorepo built for agent-assisted development. Keep the roo
|
|||
- Internal methods with only a single parameter should not be turned into options objects just for stylistic uniformity.
|
||||
- Split functions only along abstraction levels: each function reads as one level of narrative (Step-down Rule), and a wrapper that adds no new abstraction level — especially one with a single call site — is inlined instead of extracted.
|
||||
- Except for a package's `index.ts`, other `index.ts` files should prefer `export * from './module';`.
|
||||
- When writing or updating tests, follow the `tdd` skill (`.agents/skills/tdd/SKILL.md`).
|
||||
- Do not add too many new test files. Prefer adding tests to the existing test file of the corresponding component or module.
|
||||
- When a test fails because of a user modification, default to fixing the test first; do not change the implementation to satisfy an old test unless the implementation truly has a bug.
|
||||
- Do not sacrifice code quality for external compatibility unless the user explicitly asks for it. Breaking changes go through changesets and a `major` bump, gated by the rule below.
|
||||
|
|
@ -75,12 +73,17 @@ This is a TypeScript monorepo built for agent-assisted development. Keep the roo
|
|||
- Project-map entries stay at 1–2 sentences; deep package docs live in the package's own `AGENTS.md`.
|
||||
- Keep instruction updates focused and supported by code facts.
|
||||
|
||||
## Release Workflow
|
||||
|
||||
- `main` accumulates changesets; `release/*` maintains `ci: release packages` PRs. Merging the matching version PR authorizes publication after its merge-commit CI succeeds. Ordinary pushes do not publish.
|
||||
- npm publishing and native artifacts retain the existing Changesets flow. CDN upload and routing remain separately approved operations. See `.changeset/README.md` for migration and main synchronization.
|
||||
|
||||
## Workflow Requirements
|
||||
|
||||
- Prefer `rg` / `rg --files` when reading code.
|
||||
- When designing changes, follow existing boundaries and local patterns first.
|
||||
- In public text and test data, replace real internal identifiers with neutral placeholders such as `example.com`, `example.test`, and `YOUR_API_KEY`. Before opening a PR, ask a read-only agent to audit the diff for context-specific internal identifiers.
|
||||
- When creating a PR, the PR title must follow Conventional Commit style, e.g. `chore: remove legacy format commands`.
|
||||
- When creating a PR, use the `write-pr` skill (`.agents/skills/write-pr/SKILL.md`) to write the PR description. The PR title must follow Conventional Commit style, e.g. `chore: remove legacy format commands`.
|
||||
- When an AI agent opens or updates a PR, fill in `.github/pull_request_template.md` — link the related issue or explain the problem, then describe what changed. Do not leave placeholder text or submit a generic summary of the diff.
|
||||
- Do not submit vague AI-generated PR text. The human author must understand the change well enough to explain the code, edge cases, and why the approach fits this repository.
|
||||
- After finishing a task and before submitting a PR, you must run the `gen-changesets` skill (see `.agents/skills/gen-changesets/SKILL.md`) and generate a changeset under `.changeset/` according to its rules.
|
||||
|
|
@ -91,3 +94,39 @@ This is a TypeScript monorepo built for agent-assisted development. Keep the roo
|
|||
- Agent working notes or handoff/summary documents (e.g. `HANDOVER-*.md`, `HANDOFF-*.md`, `handoff.md`).
|
||||
- Throwaway UI/UX prototypes or design mockups (e.g. `*-designs.html`, `*-mockup.html`, `*-demo(s).html`) at the repo root or under a `design/` folder. The only tracked `.html` files should be Vite `index.html` entrypoints.
|
||||
Before committing or opening a PR, run `git status` and `git diff --staged --stat` and remove anything matching these patterns. Put scratch work under `.tmp/` (gitignored) instead of the repo root or the source tree.
|
||||
|
||||
## Code Review Rules
|
||||
|
||||
These rules apply to every pull request review, automated or human. The user populations and contract files they refer to are listed in `.agents/skills/review-pr/surfaces.md`.
|
||||
|
||||
### Review scope: the PR's diff, not the repo
|
||||
|
||||
- Review only the PR's diff against its base. A problem in code the PR does not touch (pre-existing on base) is reported as a non-blocking note, never as a blocking finding — the sole exception is pre-existing code that the PR's behavior directly triggers or amplifies.
|
||||
- Report a class of issues in one pass: when a finding generalizes to several locations in the diff, list all of them at once instead of raising them across successive rounds.
|
||||
- No pure style or personal-preference findings. Every finding carries a severity: P0 blocking / P1 should-fix / P2 suggestion.
|
||||
- Re-reviews are incremental: review only what changed since the previous review; do not restate findings on unchanged code or re-raise resolved threads. Before treating a resolved thread as settled, verify the current code: suppress a finding only when the problem is actually fixed or the finding no longer holds.
|
||||
- Domain-specific rules keep their own canonical homes — changesets (`.agents/skills/gen-changesets/SKILL.md`), comment-free zones (General Coding Rules), PR text (`write-pr` skill); review against those, not ad-hoc taste.
|
||||
|
||||
### Enumerate changed behavior, not just bugs
|
||||
|
||||
Any input that worked before the change — a config key, env var, CLI flag, provider response shape, session written by an older version, client request, or hook payload — must behave the same after it unless the PR declares the change. For every deleted or narrowed branch, condition, default, or prompt sentence, ask who reached it before and where they go now; for every new condition, ask which existing inputs now match it first. Flag a PR that calls a path "unchanged" when its branch condition moved.
|
||||
|
||||
### A flipped default or removed behavior needs a named loss and an escape hatch
|
||||
|
||||
Everyone on the old default is affected. Require the changeset to name the behavior users lose, not only the new default; a config, env, or flag escape hatch or a maintainer's explicit sign-off in the PR; and a test that pins the old behavior for the population that keeps it.
|
||||
|
||||
### Prompt text is behavior
|
||||
|
||||
Editing or deleting sentences under `packages/agent-core-v2/src/**/*.md` (system prompt, tool descriptions, reminders, overlays, built-in skills) changes agent behavior for every user who receives that prompt. "No test references the sentence" is not evidence of no impact. Require the PR to name the population that receives the text (every session, plan mode, a flag-gated feature such as Tower), what the sentence enforced, who relied on it, and what enforces it now.
|
||||
|
||||
### Contract files are tripwires
|
||||
|
||||
The manifests under `packages/agent-core-v2/docs/` (`config-manifest.toml`, `wire-manifest.d.ts`, `state-manifest.d.ts`), `packages/kap-server/test/__snapshots__/apiSurface.snapshot.test.ts.snap`, `packages/node-sdk/src/index.ts`, `packages/agent-core-v2/src/features/externalHooks/`, `packages/acp-server/`, and `apps/kimi-code/src/cli/` are consumed outside this repository: desktop and web in code-app, the VS Code extension, ACP clients such as Zed, SDK users, hook scripts, and headless-output parsers. When they change, require the PR to name the consumers and how data and clients from the previous release keep working.
|
||||
|
||||
### Ports and refactors carry the old path's feature inventory
|
||||
|
||||
When a change replaces or bypasses an existing path, require a list of what the old path did — env vars honored, fallbacks, accepted inputs — and where each item lives in the new path. A silently dropped item is a regression, not a cleanup.
|
||||
|
||||
### Silent failure outranks a crash
|
||||
|
||||
A change that makes the product silently ignore configuration, silently approve or skip an action, or silently drop data is the most severe finding: users get no signal to report.
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ This is a pnpm monorepo. The most relevant entry points are:
|
|||
- `apps/vis` — session debug visualizer
|
||||
- `packages/node-sdk` — public TypeScript SDK (`@moonshot-ai/kimi-code-sdk`)
|
||||
- `packages/agent-core-v2` — the agent engine (v2, DI Scope architecture); `packages/agent-core` is v1 and being phased out
|
||||
- `packages/klient`, `kap-server`, `protocol`, `transcript`, `kosong`, `kaos`, `oauth`, `telemetry` — internal engine packages
|
||||
- `packages/klient`, `kap-server`, `protocol`, `transcript`, `kosong`, `oauth`, `telemetry` — internal engine packages
|
||||
- `docs/` — VitePress bilingual docs site
|
||||
|
||||
For the full project map, see [AGENTS.md](AGENTS.md).
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ Kimi Code 对 CLI/TUI 行为、agent 工作流和公开 API 已有自己的主
|
|||
- `apps/vis` — 会话调试可视化工具
|
||||
- `packages/node-sdk` — 公开 TypeScript SDK(`@moonshot-ai/kimi-code-sdk`)
|
||||
- `packages/agent-core-v2` — 当前的 agent 引擎(v2,DI Scope 架构);`packages/agent-core` 为 v1,正在逐步废弃
|
||||
- `packages/klient`、`kap-server`、`protocol`、`transcript`、`kosong`、`kaos`、`oauth`、`telemetry` — 内部引擎包
|
||||
- `packages/klient`、`kap-server`、`protocol`、`transcript`、`kosong`、`oauth`、`telemetry` — 内部引擎包
|
||||
- `docs/` — VitePress 双语文档站
|
||||
|
||||
完整项目地图见 [AGENTS.md](AGENTS.md)。
|
||||
|
|
|
|||
|
|
@ -1,5 +1,229 @@
|
|||
# @moonshot-ai/kimi-code
|
||||
|
||||
## 2.3.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- [#4294](https://github.com/MoonshotAI/kimi-code/pull/4294) [`3f80896`](https://github.com/MoonshotAI/kimi-code/commit/3f80896a79c5b17867898bd829b6d7a78f569f47) Thanks [@liruifengv](https://github.com/liruifengv)! - Add a confirmation dialog when switching models in a session with conversation history: start a new session, compact and continue, continue directly, or cancel. Shown only when enabled by cloud configuration.
|
||||
|
||||
- [#4188](https://github.com/MoonshotAI/kimi-code/pull/4188) [`3f0857e`](https://github.com/MoonshotAI/kimi-code/commit/3f0857eb7d612c4890c45dfa6acc8381f1e761c2) Thanks [@oocz](https://github.com/oocz)! - List plugin skills under their qualified `<pluginId>:<skillName>` name so same-named skills from different plugins all stay visible and invocable; invoking a plugin skill by its bare name no longer works, use the qualified name instead.
|
||||
|
||||
- [#4214](https://github.com/MoonshotAI/kimi-code/pull/4214) [`ef727e5`](https://github.com/MoonshotAI/kimi-code/commit/ef727e517923cb312cb48d42825c49dfacd528e7) Thanks [@sailist](https://github.com/sailist)! - Support streaming large requests and responses through remote control, raising the transfer limit from 10 MiB to 100 MiB, with concurrent transfers bounded to protect memory.
|
||||
|
||||
- [#4288](https://github.com/MoonshotAI/kimi-code/pull/4288) [`df0ff3c`](https://github.com/MoonshotAI/kimi-code/commit/df0ff3c5492e8f896927c4af9b4ae00b2b488607) Thanks [@github-actions](https://github.com/apps/github-actions)! - When the same session is open in multiple clients, sending from a second one now shows an occupancy prompt with retry/cancel, or reloads updates made elsewhere first and resends your message.
|
||||
|
||||
- [#4200](https://github.com/MoonshotAI/kimi-code/pull/4200) [`5bab748`](https://github.com/MoonshotAI/kimi-code/commit/5bab748dddaae4b2ac15822d72b83446e5fd7bf4) Thanks [@7Sageer](https://github.com/7Sageer)! - Automatically generate a session title after the first turn and show it as the terminal window title.
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#4250](https://github.com/MoonshotAI/kimi-code/pull/4250) [`6e7cc90`](https://github.com/MoonshotAI/kimi-code/commit/6e7cc909da9084a424f822dd5a9aae5b98070b73) Thanks [@sailist](https://github.com/sailist)! - Setting `[permission] dangerous_command_guard = false` now turns off every built-in confirmation guard — dangerous commands, sensitive-file access, and git control-path access — instead of only the dangerous-command guard.
|
||||
|
||||
- [#4281](https://github.com/MoonshotAI/kimi-code/pull/4281) [`5710c54`](https://github.com/MoonshotAI/kimi-code/commit/5710c5496a213742ca0687f69dd8eeb5bde52dbf) Thanks [@sailist](https://github.com/sailist)! - Fix session events stopping after a session is archived and restored.
|
||||
|
||||
- [#4201](https://github.com/MoonshotAI/kimi-code/pull/4201) [`83a39b4`](https://github.com/MoonshotAI/kimi-code/commit/83a39b49ed62627c7a604b39e26d8e9d17ade296) Thanks [@Grapedge](https://github.com/Grapedge)! - Stop blocking the terminal while the footer reads git status.
|
||||
|
||||
- [#4230](https://github.com/MoonshotAI/kimi-code/pull/4230) [`b260326`](https://github.com/MoonshotAI/kimi-code/commit/b2603264ec4687cee766cf5d5e6d4976e432961c) Thanks [@kimi-agent-bot](https://github.com/kimi-agent-bot)! - Report a clear error when thinking effort is set to off for Gemini 4 models.
|
||||
|
||||
- [#4208](https://github.com/MoonshotAI/kimi-code/pull/4208) [`20b5991`](https://github.com/MoonshotAI/kimi-code/commit/20b59915bb11fc56ec389aa96720f1b7daac0862) Thanks [@SeleneXX](https://github.com/SeleneXX)! - Fix Gemini 4 requests always failing with a 400 error.
|
||||
|
||||
- [#4242](https://github.com/MoonshotAI/kimi-code/pull/4242) [`c1459a6`](https://github.com/MoonshotAI/kimi-code/commit/c1459a61845056832b85a0a220ee11a2bc5132f8) Thanks [@wbxl2000](https://github.com/wbxl2000)! - Run hooks such as `PreToolUse` and `Stop` in the session's project directory, as documented, instead of the directory the server was started from.
|
||||
|
||||
- [#4210](https://github.com/MoonshotAI/kimi-code/pull/4210) [`f28c51c`](https://github.com/MoonshotAI/kimi-code/commit/f28c51c01f025bba9f0d0f58f6309e7517a8cd02) Thanks [@sailist](https://github.com/sailist)! - Add the [mcp] default_deferred config key: when the experimental tool-select flag is on, set default_deferred = true in config.toml to load every MCP server's tools on demand by default; a server can opt out with deferred: false.
|
||||
|
||||
- [#4171](https://github.com/MoonshotAI/kimi-code/pull/4171) [`0327e8e`](https://github.com/MoonshotAI/kimi-code/commit/0327e8e9a875949fd40141ef79f902d756dfd3db) Thanks [@7Sageer](https://github.com/7Sageer)! - Support custom-registry model upgrade metadata in model configuration.
|
||||
|
||||
- [#4188](https://github.com/MoonshotAI/kimi-code/pull/4188) [`3f0857e`](https://github.com/MoonshotAI/kimi-code/commit/3f0857eb7d612c4890c45dfa6acc8381f1e761c2) Thanks [@oocz](https://github.com/oocz)! - Allow uppercase letters, dot-separated segments, and @ suffixes in plugin names when installing plugins.
|
||||
|
||||
- [#4294](https://github.com/MoonshotAI/kimi-code/pull/4294) [`3f80896`](https://github.com/MoonshotAI/kimi-code/commit/3f80896a79c5b17867898bd829b6d7a78f569f47) Thanks [@liruifengv](https://github.com/liruifengv)! - Queue /compact while the agent is busy: the command now joins the message queue and runs in order instead of failing with an error; it is skipped if the context was auto-compacted while it waited.
|
||||
|
||||
- [#4190](https://github.com/MoonshotAI/kimi-code/pull/4190) [`e4c99a3`](https://github.com/MoonshotAI/kimi-code/commit/e4c99a3bad19b00bd1939b1cf254f427b50061f0) Thanks [@starquakee](https://github.com/starquakee)! - Clarify unavailable tools, announce when no tools can be loaded, and discourage repeated failed tool selections.
|
||||
|
||||
- [#4272](https://github.com/MoonshotAI/kimi-code/pull/4272) [`ce0834a`](https://github.com/MoonshotAI/kimi-code/commit/ce0834a8f301b89cc4523499a3e074c36851de8f) Thanks [@Grapedge](https://github.com/Grapedge)! - Move the session rating opt-out from tui.toml to config.toml.
|
||||
|
||||
- [#4066](https://github.com/MoonshotAI/kimi-code/pull/4066) [`85077a4`](https://github.com/MoonshotAI/kimi-code/commit/85077a419001285e49ede3574924f001935aed62) Thanks [@7Sageer](https://github.com/7Sageer)! - Keep subagent tool descriptions aligned with currently available tools.
|
||||
|
||||
- [#3799](https://github.com/MoonshotAI/kimi-code/pull/3799) [`7e58f2d`](https://github.com/MoonshotAI/kimi-code/commit/7e58f2d2410d2b541ffd57f4501c0436bba4ccbd) Thanks [@kimi-agent-bot](https://github.com/kimi-agent-bot)! - Fix the latest reply disappearing from the transcript after a background task completion notification arrives; the fold boundary is now anchored to the notification turn itself instead of the asynchronously mounted task card.
|
||||
|
||||
- [#4239](https://github.com/MoonshotAI/kimi-code/pull/4239) [`da5918c`](https://github.com/MoonshotAI/kimi-code/commit/da5918c0c861a1d670f4523a9f9dd968647fe4cb) Thanks [@RealKai42](https://github.com/RealKai42)! - Remind the agent to update its todo list after 5 steps without an update instead of 10, only while the list still has unfinished items, and ask it to bring the list up to date before its final reply.
|
||||
|
||||
- [#4248](https://github.com/MoonshotAI/kimi-code/pull/4248) [`8fcd332`](https://github.com/MoonshotAI/kimi-code/commit/8fcd3326e7488e5e0d4c595115ef74a10c340d5b) Thanks [@kimi-agent-bot](https://github.com/kimi-agent-bot)! - Show a single overflowing preview line in full instead of swapping it for a same-height expand hint.
|
||||
|
||||
- [#4304](https://github.com/MoonshotAI/kimi-code/pull/4304) [`d36071e`](https://github.com/MoonshotAI/kimi-code/commit/d36071ede6ae3cbdc08cbb8a0f7daf7bc6d06f2d) Thanks [@kimi-agent-bot](https://github.com/kimi-agent-bot)! - web: Improved interactions and fixed known bugs.
|
||||
|
||||
## 2.2.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- [#4159](https://github.com/MoonshotAI/kimi-code/pull/4159) [`0a3a2fb`](https://github.com/MoonshotAI/kimi-code/commit/0a3a2fbafab473df9e9f6609f825af78d2c1ce6d) Thanks [@RealKai42](https://github.com/RealKai42)! - Add an opt-in NotifyUser progress update feature (off by default): new sessions can show the agent's mid-turn progress with an optional one-line title, enabled in the TUI `/experiments` or the web/Desktop settings' Lab section; set `[experimental] notify_user = true` or `KIMI_CODE_EXPERIMENTAL_NOTIFY_USER=1` to turn it on.
|
||||
|
||||
- [#4145](https://github.com/MoonshotAI/kimi-code/pull/4145) [`242ac23`](https://github.com/MoonshotAI/kimi-code/commit/242ac230006447f8601e1678c49182bfbae89fe9) Thanks [@wbxl2000](https://github.com/wbxl2000)! - Add `kimi app [path]` to open a new desktop chat in the current or specified directory.
|
||||
|
||||
- [#4061](https://github.com/MoonshotAI/kimi-code/pull/4061) [`20a2cea`](https://github.com/MoonshotAI/kimi-code/commit/20a2cea72f5d2c4be3a3845e4ff24ce302a6630e) Thanks [@chengluyu](https://github.com/chengluyu)! - Cap the agent's in-turn wait for background tasks at 90 seconds (longer timeouts are no longer accepted), discourage repeated waits, and let a new message end the wait immediately.
|
||||
|
||||
- [#3998](https://github.com/MoonshotAI/kimi-code/pull/3998) [`09af3b4`](https://github.com/MoonshotAI/kimi-code/commit/09af3b483faac51a767aee50adb1bc1a8de4cc53) Thanks [@tpoisonooo](https://github.com/tpoisonooo)! - Tower mode: a message sent while the agent is running aborts the in-progress turn and runs as its own turn.
|
||||
|
||||
- [#4031](https://github.com/MoonshotAI/kimi-code/pull/4031) [`33e368a`](https://github.com/MoonshotAI/kimi-code/commit/33e368a1eff8d958856af8e2fb64f4db122b2247) Thanks [@Grapedge](https://github.com/Grapedge)! - Add sticky user message summaries in fullscreen mode; click a summary to jump to the original message.
|
||||
|
||||
- [#4074](https://github.com/MoonshotAI/kimi-code/pull/4074) [`c9f01f0`](https://github.com/MoonshotAI/kimi-code/commit/c9f01f07388abc2cdca40c9c5267f58c65086710) Thanks [@tpoisonooo](https://github.com/tpoisonooo)! - Tower mode: deterministic orchestration with TowerRebase and LLM-free status, goal/tower mutual exclusion, and workspace protection.
|
||||
|
||||
- [#4059](https://github.com/MoonshotAI/kimi-code/pull/4059) [`1f6f0b1`](https://github.com/MoonshotAI/kimi-code/commit/1f6f0b1fa2117cc9374c1be62c534b4a4d60e412) Thanks [@7Sageer](https://github.com/7Sageer)! - Add the KIMI_CODE_TRUST_WORKSPACE environment variable to mark the workspace as trusted.
|
||||
|
||||
- [#4165](https://github.com/MoonshotAI/kimi-code/pull/4165) [`afd95f6`](https://github.com/MoonshotAI/kimi-code/commit/afd95f64a5444b649a4cc33504513bf88e4c54ba) Thanks [@Grapedge](https://github.com/Grapedge)! - Replace user skill cards with highlighted prompts and support Ctrl-S for skill prompts.
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#4183](https://github.com/MoonshotAI/kimi-code/pull/4183) [`c15638b`](https://github.com/MoonshotAI/kimi-code/commit/c15638b0a1234e5aa97659fbc625d7dc4d60d93f) Thanks [@RealKai42](https://github.com/RealKai42)! - Cancel in-flight video uploads when a media read is interrupted.
|
||||
|
||||
- [#4081](https://github.com/MoonshotAI/kimi-code/pull/4081) [`06ebfc8`](https://github.com/MoonshotAI/kimi-code/commit/06ebfc821e304bd4ca3f828ae739954166463d65) Thanks [@sailist](https://github.com/sailist)! - Fix shifted turns and lost replies when a UserPromptSubmit hook injects text; hook JSON output without a "message" field is no longer added to the conversation.
|
||||
|
||||
- [#4154](https://github.com/MoonshotAI/kimi-code/pull/4154) [`419aced`](https://github.com/MoonshotAI/kimi-code/commit/419aced0e97fa04b75f8f71b089e1667f6de6d0a) Thanks [@7Sageer](https://github.com/7Sageer)! - Fix media file reading on the first turn after resuming a session.
|
||||
|
||||
- [#4083](https://github.com/MoonshotAI/kimi-code/pull/4083) [`f409caa`](https://github.com/MoonshotAI/kimi-code/commit/f409caa21e71ce7beb158d29ffca1fed76216a64) Thanks [@sailist](https://github.com/sailist)! - Cron tasks from the source session no longer fire inside a forked session.
|
||||
|
||||
- [#4152](https://github.com/MoonshotAI/kimi-code/pull/4152) [`f0bc988`](https://github.com/MoonshotAI/kimi-code/commit/f0bc988bbc7db08d650f37ae0eaa69bcc6e90696) Thanks [@7Sageer](https://github.com/7Sageer)! - Forked subagents now inherit the parent's available agent types, including custom agents.
|
||||
|
||||
- [#4057](https://github.com/MoonshotAI/kimi-code/pull/4057) [`a940f2f`](https://github.com/MoonshotAI/kimi-code/commit/a940f2ff049ed57abce68c59526de7a6628a4112) Thanks [@huangzheng2016](https://github.com/huangzheng2016)! - Fix the permission mode switch in the goal-start approval prompt not taking effect on the v2 engine.
|
||||
|
||||
- [#4081](https://github.com/MoonshotAI/kimi-code/pull/4081) [`06ebfc8`](https://github.com/MoonshotAI/kimi-code/commit/06ebfc821e304bd4ca3f828ae739954166463d65) Thanks [@sailist](https://github.com/sailist)! - Fix messages rendering out of place in sessions with a UserPromptSubmit hook.
|
||||
|
||||
- [#4153](https://github.com/MoonshotAI/kimi-code/pull/4153) [`7091138`](https://github.com/MoonshotAI/kimi-code/commit/7091138f5e66289d04b9b7a5cd77f94af9308be3) Thanks [@RealKai42](https://github.com/RealKai42)! - Let the agent write one- or two-sentence progress notes between tool calls instead of bare status lines; in the experimental Updates panel (`KIMI_CODE_EXPERIMENTAL_NOTIFY_USER=1`), stop asking the agent to repost its mid-turn text as an update and remind it to post updates less often.
|
||||
|
||||
- [#4054](https://github.com/MoonshotAI/kimi-code/pull/4054) [`4fbe065`](https://github.com/MoonshotAI/kimi-code/commit/4fbe065442179435c43d3c3dc8d11bb408b3fd30) Thanks [@RealKai42](https://github.com/RealKai42)! - Stop prompting the agent to send NotifyUser updates when a session is opened in a host that does not display them.
|
||||
|
||||
- [#4091](https://github.com/MoonshotAI/kimi-code/pull/4091) [`21406fb`](https://github.com/MoonshotAI/kimi-code/commit/21406fb4c805cc8c715e6d1f16ad3fb5f25f4fe3) Thanks [@sailist](https://github.com/sailist)! - Omit max_tokens for models without an explicit output limit, fixing repeated 400 errors on strict serving stacks (e.g. bare vLLM) when the model's max output size is unknown.
|
||||
|
||||
- [#4184](https://github.com/MoonshotAI/kimi-code/pull/4184) [`cbd7540`](https://github.com/MoonshotAI/kimi-code/commit/cbd754049a114ee36d1b27675c82819e4963c692) Thanks [@7Sageer](https://github.com/7Sageer)! - Remove the never-implemented `executor = "kaos"` option from MCP stdio server configuration; configs using it now fail validation at load time.
|
||||
|
||||
- [#2919](https://github.com/MoonshotAI/kimi-code/pull/2919) [`0f052fe`](https://github.com/MoonshotAI/kimi-code/commit/0f052fee1399f34086bb6343a56867d7df9b70b5) Thanks [@duyphan154](https://github.com/duyphan154)! - Sanitize foreground Bash tool output so captured terminal escape sequences no longer change the host terminal state.
|
||||
|
||||
- [#4164](https://github.com/MoonshotAI/kimi-code/pull/4164) [`3395f5b`](https://github.com/MoonshotAI/kimi-code/commit/3395f5bea6c77feb6a835d1ca3f4935970f96c6b) Thanks [@huangzheng2016](https://github.com/huangzheng2016)! - Show a "Shutting down" status hint while shutdown hooks run during exit, and let a Ctrl+C during that window force an immediate exit instead of waiting for the hook timeout.
|
||||
|
||||
- [#4033](https://github.com/MoonshotAI/kimi-code/pull/4033) [`eec9bbd`](https://github.com/MoonshotAI/kimi-code/commit/eec9bbd94958248034f5dbf109a639970308f05e) Thanks [@Grapedge](https://github.com/Grapedge)! - Feedback surveys now appear less often.
|
||||
|
||||
- [#4160](https://github.com/MoonshotAI/kimi-code/pull/4160) [`72fc1d0`](https://github.com/MoonshotAI/kimi-code/commit/72fc1d0a3375b2a87dff602a1d91726a99f360e0) Thanks [@kimi-agent-bot](https://github.com/kimi-agent-bot)! - Show "Working…" in the status spinner while thinking.
|
||||
|
||||
- [#4056](https://github.com/MoonshotAI/kimi-code/pull/4056) [`395d537`](https://github.com/MoonshotAI/kimi-code/commit/395d537237d737de0239159b60d1cc160bdf04e6) Thanks [@7Sageer](https://github.com/7Sageer)! - Replace inline MCP commands in the workspace trust prompt with activation summaries and configuration paths for manual inspection.
|
||||
|
||||
- [#4076](https://github.com/MoonshotAI/kimi-code/pull/4076) [`e3bf50c`](https://github.com/MoonshotAI/kimi-code/commit/e3bf50c0831d91ceb3656acf1b7a3f480eaada56) Thanks [@7Sageer](https://github.com/7Sageer)! - Remove interruption reminders from the conversation when their interrupted turns are undone.
|
||||
|
||||
- [#4031](https://github.com/MoonshotAI/kimi-code/pull/4031) [`33e368a`](https://github.com/MoonshotAI/kimi-code/commit/33e368a1eff8d958856af8e2fb64f4db122b2247) Thanks [@Grapedge](https://github.com/Grapedge)! - Replace the user message bullet ✨ with ❯.
|
||||
|
||||
- [#4221](https://github.com/MoonshotAI/kimi-code/pull/4221) [`2e6821d`](https://github.com/MoonshotAI/kimi-code/commit/2e6821dcbd8034f128b2326a73d4704201b7c108) Thanks [@kimi-agent-bot](https://github.com/kimi-agent-bot)! - web: Improved interactions and fixed known bugs.
|
||||
|
||||
## 2.1.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#4013](https://github.com/MoonshotAI/kimi-code/pull/4013) [`929403b`](https://github.com/MoonshotAI/kimi-code/commit/929403b6db219eae6099dd23eae2f0efa2bb2823) Thanks [@7Sageer](https://github.com/7Sageer)! - Roll back some of the overly defensive changes in 2.1.0
|
||||
|
||||
- [#4015](https://github.com/MoonshotAI/kimi-code/pull/4015) [`c7dd841`](https://github.com/MoonshotAI/kimi-code/commit/c7dd84124a00d2dc1a68fbbc3e54b1095ee9ac23) Thanks [@sailist](https://github.com/sailist)! - Revert filesystem watchers for config and workspace files to on by default. Set `[watch] enabled` to `false` or `KIMI_CODE_WATCH=0` to keep them off.
|
||||
|
||||
## 2.1.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- [#3990](https://github.com/MoonshotAI/kimi-code/pull/3990) [`32000d0`](https://github.com/MoonshotAI/kimi-code/commit/32000d08afcd019016fa60db0d68eaf21f3e35a6) Thanks [@Grapedge](https://github.com/Grapedge)! - In fullscreen, click a folded block to open or close it.
|
||||
|
||||
- [#4004](https://github.com/MoonshotAI/kimi-code/pull/4004) [`e17ff67`](https://github.com/MoonshotAI/kimi-code/commit/e17ff679281e340fd328bc2ebaba1237e79a9ad3) Thanks [@Grapedge](https://github.com/Grapedge)! - Add a TUI mode setting to /settings with an experimental fullscreen layout; switching modes takes effect after restarting Kimi Code. You can also set `tui_mode` in `~/.kimi-code/tui.toml` directly: `"regular"` renders into the terminal scrollback, while `"fullscreen"` makes parts of the UI mouse-interactive for a smoother experience.
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#3964](https://github.com/MoonshotAI/kimi-code/pull/3964) [`6451f1e`](https://github.com/MoonshotAI/kimi-code/commit/6451f1e056e90037bbf832f3578955cf8e55db64) Thanks [@7Sageer](https://github.com/7Sageer)! - Block file tools from accessing files outside the working directory through symlinks.
|
||||
|
||||
- [#3975](https://github.com/MoonshotAI/kimi-code/pull/3975) [`bb96d80`](https://github.com/MoonshotAI/kimi-code/commit/bb96d80748921618182369a40a6610f38fa16acb) Thanks [@RealKai42](https://github.com/RealKai42)! - Reduce the CLI's startup time and memory usage.
|
||||
|
||||
- [#3957](https://github.com/MoonshotAI/kimi-code/pull/3957) [`6a214b8`](https://github.com/MoonshotAI/kimi-code/commit/6a214b85e53e58a9ef6480f27bcb7b0103c0e34e) Thanks [@huangzheng2016](https://github.com/huangzheng2016)! - Fix a "Maximum call stack size exceeded" error when opening large sessions.
|
||||
|
||||
- [#3974](https://github.com/MoonshotAI/kimi-code/pull/3974) [`994287a`](https://github.com/MoonshotAI/kimi-code/commit/994287acb3a7428b580c09cabd5aba1b5a818aaa) Thanks [@liruifengv](https://github.com/liruifengv)! - Fix forked sessions getting their titles overwritten by auto-generated titles.
|
||||
|
||||
- [#3964](https://github.com/MoonshotAI/kimi-code/pull/3964) [`6451f1e`](https://github.com/MoonshotAI/kimi-code/commit/6451f1e056e90037bbf832f3578955cf8e55db64) Thanks [@7Sageer](https://github.com/7Sageer)! - Apply project-local configuration only after the workspace is trusted.
|
||||
|
||||
- [#3964](https://github.com/MoonshotAI/kimi-code/pull/3964) [`6451f1e`](https://github.com/MoonshotAI/kimi-code/commit/6451f1e056e90037bbf832f3578955cf8e55db64) Thanks [@7Sageer](https://github.com/7Sageer)! - Block repository git configuration from executing commands during background git operations.
|
||||
|
||||
- [#3969](https://github.com/MoonshotAI/kimi-code/pull/3969) [`b3212fd`](https://github.com/MoonshotAI/kimi-code/commit/b3212fd9abc1f4670fb47df16f0137957aed6f2d) Thanks [@sailist](https://github.com/sailist)! - Skip cloud telemetry on the global login until its collector is live, and keep shutdown from aborting TUI exit.
|
||||
|
||||
- [#3979](https://github.com/MoonshotAI/kimi-code/pull/3979) [`e796bb5`](https://github.com/MoonshotAI/kimi-code/commit/e796bb5d482ecb7976c25dad0563b74cc9ec2c68) Thanks [@sailist](https://github.com/sailist)! - Fix MCP OAuth not requesting the offline_access scope, which caused hourly browser re-authorization with providers like Vercel.
|
||||
|
||||
- [#3969](https://github.com/MoonshotAI/kimi-code/pull/3969) [`b3212fd`](https://github.com/MoonshotAI/kimi-code/commit/b3212fd9abc1f4670fb47df16f0137957aed6f2d) Thanks [@sailist](https://github.com/sailist)! - Fix Remote Control failing to start after `kimi login --region global`.
|
||||
|
||||
- [#3964](https://github.com/MoonshotAI/kimi-code/pull/3964) [`6451f1e`](https://github.com/MoonshotAI/kimi-code/commit/6451f1e056e90037bbf832f3578955cf8e55db64) Thanks [@7Sageer](https://github.com/7Sageer)! - Reject additional directories that resolve to the home directory or filesystem root.
|
||||
|
||||
- [#3995](https://github.com/MoonshotAI/kimi-code/pull/3995) [`a54e6f6`](https://github.com/MoonshotAI/kimi-code/commit/a54e6f6a9b36bc1346e41da576d96ff54aa557b6) Thanks [@7Sageer](https://github.com/7Sageer)! - Turn off repeat reminders and forced stops with `KIMI_CODE_REPEAT_BREAKER=0`.
|
||||
|
||||
- [#3970](https://github.com/MoonshotAI/kimi-code/pull/3970) [`895e9d9`](https://github.com/MoonshotAI/kimi-code/commit/895e9d9b868cf9899e444784130fa1946c6cef6c) Thanks [@chengluyu](https://github.com/chengluyu)! - Fix missing Swarm members after reopening an interrupted conversation.
|
||||
|
||||
- [#3989](https://github.com/MoonshotAI/kimi-code/pull/3989) [`a268ad7`](https://github.com/MoonshotAI/kimi-code/commit/a268ad775d9451d008d3c73de053655f6ab0772a) Thanks [@Grapedge](https://github.com/Grapedge)! - Show a Thinking… spinner and keep the status row height steady during streaming.
|
||||
|
||||
- [#3989](https://github.com/MoonshotAI/kimi-code/pull/3989) [`a268ad7`](https://github.com/MoonshotAI/kimi-code/commit/a268ad775d9451d008d3c73de053655f6ab0772a) Thanks [@Grapedge](https://github.com/Grapedge)! - Add a clickable "Jump to bottom" indicator to the fullscreen TUI.
|
||||
|
||||
- [#3976](https://github.com/MoonshotAI/kimi-code/pull/3976) [`f7012aa`](https://github.com/MoonshotAI/kimi-code/commit/f7012aa23b38d90d1a643166e2e78f706a606a34) Thanks [@tpoisonooo](https://github.com/tpoisonooo)! - Tower mode: smaller missions, stricter completion and review checks, and review history in rework briefings.
|
||||
|
||||
- [#3847](https://github.com/MoonshotAI/kimi-code/pull/3847) [`65ae3e3`](https://github.com/MoonshotAI/kimi-code/commit/65ae3e368c7cfa096242cacc12eeeb661e682977) Thanks [@tpoisonooo](https://github.com/tpoisonooo)! - Tower mode: mission titles must be ASCII, and task cards show the mission id.
|
||||
|
||||
- [#3931](https://github.com/MoonshotAI/kimi-code/pull/3931) [`f17a22e`](https://github.com/MoonshotAI/kimi-code/commit/f17a22ebf4e21b8196bfaaa9a2490707676bf519) Thanks [@sailist](https://github.com/sailist)! - Turn off filesystem watchers for config and workspace files by default. Set `[watch] enabled` to `true` or `KIMI_CODE_WATCH=1` to turn them back on.
|
||||
|
||||
- [#4005](https://github.com/MoonshotAI/kimi-code/pull/4005) [`ba41d07`](https://github.com/MoonshotAI/kimi-code/commit/ba41d07810cae37a9e529cad6b0f8e8abc8d7aaf) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Improved interactions and fixed known bugs.
|
||||
|
||||
## 2.0.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#3922](https://github.com/MoonshotAI/kimi-code/pull/3922) [`9df7a9c`](https://github.com/MoonshotAI/kimi-code/commit/9df7a9ccfb0d7d0713b51ae1ac165d0634fc40d2) Thanks [@sailist](https://github.com/sailist)! - Fix new messages occasionally landing at an old position in the conversation after resuming a session.
|
||||
|
||||
- [#3911](https://github.com/MoonshotAI/kimi-code/pull/3911) [`88a7d93`](https://github.com/MoonshotAI/kimi-code/commit/88a7d932f1cda95c78bf5488d34ff974a160fb08) Thanks [@Grapedge](https://github.com/Grapedge)! - Fix compaction failing after switching to a model with a smaller context window.
|
||||
|
||||
- [#3929](https://github.com/MoonshotAI/kimi-code/pull/3929) [`6ffdf0d`](https://github.com/MoonshotAI/kimi-code/commit/6ffdf0d579fa1a9f30c2d00c437c6c8de0c03997) Thanks [@7Hanrui](https://github.com/7Hanrui)! - The agent no longer assumes the current working directory is the project root.
|
||||
|
||||
- [#3933](https://github.com/MoonshotAI/kimi-code/pull/3933) [`9721259`](https://github.com/MoonshotAI/kimi-code/commit/97212596f7d694b9683046ec7aad4d1247d29468) Thanks [@liruifengv](https://github.com/liruifengv)! - Fix a message sent while the agent was running sometimes appearing twice in the chat.
|
||||
|
||||
- [#3934](https://github.com/MoonshotAI/kimi-code/pull/3934) [`2e605b1`](https://github.com/MoonshotAI/kimi-code/commit/2e605b10be906fb627c1f3aeaaa066b14ddbdbba) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Improved interactions and fixed known bugs.
|
||||
|
||||
## 2.0.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#3878](https://github.com/MoonshotAI/kimi-code/pull/3878) [`f233f9d`](https://github.com/MoonshotAI/kimi-code/commit/f233f9de04d71c42d27df870b18e1bc1a6605f16) Thanks [@7Sageer](https://github.com/7Sageer)! - Stop listing unavailable media tools in subagent menus and clarify Read errors for images and videos.
|
||||
|
||||
- [#3762](https://github.com/MoonshotAI/kimi-code/pull/3762) [`c5ad17f`](https://github.com/MoonshotAI/kimi-code/commit/c5ad17f06aa12702d2b30dff63acba9ed08f688d) Thanks [@7Sageer](https://github.com/7Sageer)! - Providers can read their API key from a named environment variable (`api_key_env` in `config.toml` or the provider API).
|
||||
|
||||
- [#3896](https://github.com/MoonshotAI/kimi-code/pull/3896) [`73ebe9a`](https://github.com/MoonshotAI/kimi-code/commit/73ebe9ab2fbf9bf0ffc8fe5a5375060ce8e984b5) Thanks [@sailist](https://github.com/sailist)! - Keep follow-up messages sent during a turn from appearing twice after a session reload.
|
||||
|
||||
- [#3889](https://github.com/MoonshotAI/kimi-code/pull/3889) [`5108cad`](https://github.com/MoonshotAI/kimi-code/commit/5108cad9b65845ae992520dcf732cbbccc6a34b9) Thanks [@huangzheng2016](https://github.com/huangzheng2016)! - Compact the session index on startup when many entries point to deleted sessions.
|
||||
|
||||
- [#3889](https://github.com/MoonshotAI/kimi-code/pull/3889) [`5108cad`](https://github.com/MoonshotAI/kimi-code/commit/5108cad9b65845ae992520dcf732cbbccc6a34b9) Thanks [@huangzheng2016](https://github.com/huangzheng2016)! - Start the CLI faster by removing a duplicate skills directory scan.
|
||||
|
||||
- [#3889](https://github.com/MoonshotAI/kimi-code/pull/3889) [`5108cad`](https://github.com/MoonshotAI/kimi-code/commit/5108cad9b65845ae992520dcf732cbbccc6a34b9) Thanks [@huangzheng2016](https://github.com/huangzheng2016)! - Open the session list and resume sessions faster on workspaces with many sessions.
|
||||
|
||||
- [#3889](https://github.com/MoonshotAI/kimi-code/pull/3889) [`5108cad`](https://github.com/MoonshotAI/kimi-code/commit/5108cad9b65845ae992520dcf732cbbccc6a34b9) Thanks [@huangzheng2016](https://github.com/huangzheng2016)! - Resume long sessions faster.
|
||||
|
||||
- [#3889](https://github.com/MoonshotAI/kimi-code/pull/3889) [`5108cad`](https://github.com/MoonshotAI/kimi-code/commit/5108cad9b65845ae992520dcf732cbbccc6a34b9) Thanks [@huangzheng2016](https://github.com/huangzheng2016)! - Index sessions for search in capped, incremental background passes, tunable via the [database] searchSyncSessionCap and searchSyncDebounceMs settings.
|
||||
|
||||
- [#3864](https://github.com/MoonshotAI/kimi-code/pull/3864) [`25dd4ce`](https://github.com/MoonshotAI/kimi-code/commit/25dd4ce97345c7ebfd9c036898e5eef955c45ea8) Thanks [@wbxl2000](https://github.com/wbxl2000)! - Rename the kimi install-app subcommand to kimi install-desktop; the old name keeps working as a hidden alias.
|
||||
|
||||
- [#3910](https://github.com/MoonshotAI/kimi-code/pull/3910) [`7dc253c`](https://github.com/MoonshotAI/kimi-code/commit/7dc253c5cefac7c277e5fc7071acf3e855fd503e) Thanks [@sailist](https://github.com/sailist)! - Restore thinking display for OpenAI-compatible providers that send a reasoning string next to an unrecognized reasoning_details array.
|
||||
|
||||
- [#3875](https://github.com/MoonshotAI/kimi-code/pull/3875) [`c1047a6`](https://github.com/MoonshotAI/kimi-code/commit/c1047a6bbe0e37d097e5da54d92dd3fb1b7a28da) Thanks [@7Sageer](https://github.com/7Sageer)! - Fix `kimi -p` exiting early and cancelling the active turn when a cron task fires.
|
||||
|
||||
- [#3894](https://github.com/MoonshotAI/kimi-code/pull/3894) [`910aba2`](https://github.com/MoonshotAI/kimi-code/commit/910aba273e2bee3a8815666a3a9c4fff609f2366) Thanks [@7Sageer](https://github.com/7Sageer)! - Drop literal decision clauses from the system prompt and the auto permission mode reminder.
|
||||
|
||||
- [#3889](https://github.com/MoonshotAI/kimi-code/pull/3889) [`5108cad`](https://github.com/MoonshotAI/kimi-code/commit/5108cad9b65845ae992520dcf732cbbccc6a34b9) Thanks [@huangzheng2016](https://github.com/huangzheng2016)! - Restore sessions with large file-edit histories faster.
|
||||
|
||||
- [#3889](https://github.com/MoonshotAI/kimi-code/pull/3889) [`5108cad`](https://github.com/MoonshotAI/kimi-code/commit/5108cad9b65845ae992520dcf732cbbccc6a34b9) Thanks [@huangzheng2016](https://github.com/huangzheng2016)! - Serve session transcript APIs faster on repeated calls.
|
||||
|
||||
- [#3885](https://github.com/MoonshotAI/kimi-code/pull/3885) [`5acc863`](https://github.com/MoonshotAI/kimi-code/commit/5acc863ae60c092457bd9ecdde55266b5fad7040) Thanks [@starquakee](https://github.com/starquakee)! - select_tools now points out already-available tools to call directly and suggests announced names for near-miss selections.
|
||||
|
||||
- [#3887](https://github.com/MoonshotAI/kimi-code/pull/3887) [`e3f48a2`](https://github.com/MoonshotAI/kimi-code/commit/e3f48a225bbedbe167b30510e67d66ee67fcb0ec) Thanks [@RealKai42](https://github.com/RealKai42)! - Fix deleting or archiving a session sometimes never finishing.
|
||||
|
||||
- [#3891](https://github.com/MoonshotAI/kimi-code/pull/3891) [`53e5e3f`](https://github.com/MoonshotAI/kimi-code/commit/53e5e3fca6bf377662bc4d61d220dde4ded8e7b7) Thanks [@sailist](https://github.com/sailist)! - Keep follow-up messages sent during a turn attached to that turn in the conversation history.
|
||||
|
||||
- [#3906](https://github.com/MoonshotAI/kimi-code/pull/3906) [`60f2a63`](https://github.com/MoonshotAI/kimi-code/commit/60f2a63278f28b77d9358cf589b2da6193bd2614) Thanks [@sailist](https://github.com/sailist)! - Keep a follow-up sent during a turn as one message, and undo the host turn instead of the follow-up alone.
|
||||
|
||||
- [#3879](https://github.com/MoonshotAI/kimi-code/pull/3879) [`1fddc16`](https://github.com/MoonshotAI/kimi-code/commit/1fddc16e3ea2de4c26a18acd764380adf9e2ed64) Thanks [@7Sageer](https://github.com/7Sageer)! - Remove the system-prompt rule that forbade all file access outside the working directory.
|
||||
|
||||
- [#3892](https://github.com/MoonshotAI/kimi-code/pull/3892) [`a80fe31`](https://github.com/MoonshotAI/kimi-code/commit/a80fe31cff0ebae686e60d7d5d0559ad2d2e843d) Thanks [@sailist](https://github.com/sailist)! - Stop workspace file watchers from scanning an unbounded project root, and add `[watch] enabled` / `KIMI_CODE_WATCH` to disable watching entirely.
|
||||
|
||||
- [#3869](https://github.com/MoonshotAI/kimi-code/pull/3869) [`86e0820`](https://github.com/MoonshotAI/kimi-code/commit/86e08208e3445171f6500c948234d7e3a0684324) Thanks [@sailist](https://github.com/sailist)! - Stop asking for approval of bash commands that cannot be statically analyzed in Ask When Needed permission mode.
|
||||
|
||||
## 2.0.0
|
||||
|
||||
### Major Changes
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
43
apps/kimi-code/dist-web/assets/CodeBlockNode-DXHZxqco.js
Normal file
43
apps/kimi-code/dist-web/assets/CodeBlockNode-DXHZxqco.js
Normal file
File diff suppressed because one or more lines are too long
1
apps/kimi-code/dist-web/assets/PreCodeBlock-txKBqZ4o.js
Normal file
1
apps/kimi-code/dist-web/assets/PreCodeBlock-txKBqZ4o.js
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
import{bQ as J,M as O,aU as p,bE as S,az as Q,aL as F,s as G,v as z,I as K,bJ as W,bL as Z,aw as X,H as A,bb as ee,bB as te,g as le,au as ae,T as ne,as as Y,bR as oe}from"./index-DusVyqlT.js";var k=(d,x,e)=>new Promise((n,s)=>{var r=i=>{try{c(e.next(i))}catch(v){s(v)}},y=i=>{try{c(e.throw(i))}catch(v){s(v)}},c=i=>i.done?n(i.value):Promise.resolve(i.value).then(r,y);c((e=e.apply(d,x)).next())});const ie=["id"],re=["data-placement"],se=J(O({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(d){var x;const e=d,n=p(null),s=p(null),r=p({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),y=p({}),c=p((x=e.placement)!=null?x:"top"),i=p(!1),v=p(!1);let E=null,M=null,R=null,P=null,w=null,f=0;function I(){return P?Promise.resolve(P):(w||(w=oe(()=>import("./floating-ui.dom-xGUaHE3m.js"),[]).then(a=>(P=a,a)).catch(a=>{throw w=null,a})),w)}function T(){E&&(E(),E=null),M=null,R=null}function D(a){return k(this,null,function*(){const t=e.anchorEl,l=n.value;if(!e.visible||!t||!l||M===t&&R===l)return;const{autoUpdate:o}=yield I();a()&&e.visible&&e.anchorEl===t&&n.value===l&&(T(),M=t,R=l,E=o(t,l,()=>{$().catch(()=>{B()})}))})}function $(){return k(this,null,function*(){var a,t;const l=e.anchorEl,o=n.value;if(!e.visible||!l||!o)return!1;const{arrow:u,computePosition:C,flip:h,offset:m,shift:b}=yield I();if(!e.visible||e.anchorEl!==l||n.value!==o)return!1;const g=[m((a=e.offset)!=null?a:6),h(),b({padding:6}),...s.value?[u({element:s.value,padding:4})]:[]],{x:j,y:q,placement:N,middlewareData:U}=yield C(l,o,{placement:(t=e.placement)!=null?t:"top",middleware:g,strategy:"fixed"});if(!e.visible||e.anchorEl!==l||n.value!==o)return!1;if(r.value.transform=`translate3d(${Math.round(j)}px, ${Math.round(q)}px, 0)`,r.value.left="0px",r.value.top="0px",c.value=N,U.arrow&&s.value){const{x:V,y:L}=U.arrow,H={top:"bottom",bottom:"top",left:"right",right:"left"}[N.split("-")[0]];y.value={left:V!=null?`${V}px`:"",top:L!=null?`${L}px`:"",[H]:"-3px"}}return!0})}function B(){var a,t;const l=e.anchorEl,o=n.value;if(!l||!o)return!1;const u=l.getBoundingClientRect(),C=o.getBoundingClientRect(),h=(a=e.offset)!=null?a:6,m=(t=e.placement)!=null?t:"top";let b=u.left,g=u.top;return m==="bottom"?g=u.bottom+h:m==="left"?b=u.left-C.width-h:m==="right"?b=u.right+h:g=u.top-C.height-h,r.value.transform=`translate3d(${Math.round(Math.max(0,b))}px, ${Math.round(Math.max(0,g))}px, 0)`,r.value.left="0px",r.value.top="0px",c.value=m,y.value={},!0}S(()=>e.visible,a=>k(null,null,function*(){const t=++f;if(a){if(i.value=!1,yield Y(),t!==f||!e.visible)return;if(e.anchorEl&&n.value)try{const l=e.anchorEl,o=n.value,u=l.getBoundingClientRect();if(!(yield $())||t!==f||!e.visible||e.anchorEl!==l||n.value!==o)return;v.value=!1,i.value=!0,yield D(()=>t===f)}catch{if(t!==f||!e.visible)return;if(i.value=B(),e.anchorEl&&n.value)try{yield D(()=>t===f)}catch{}}else i.value=!0}else T()}));let _=0;return S([()=>e.anchorEl,()=>e.placement,()=>e.content],([a],[t])=>k(null,null,function*(){v.value=!!(a&&t&&a!==t&&Math.hypot(a.getBoundingClientRect().left-t.getBoundingClientRect().left,a.getBoundingClientRect().top-t.getBoundingClientRect().top)<=120);const l=++_;if(e.visible&&e.anchorEl&&n.value){if(yield Y(),l!==_||!e.visible||!e.anchorEl||!n.value)return;try{const o=yield $();if(l!==_||!e.visible||!e.anchorEl||!n.value)return;o||B()}catch{B()}yield D(()=>l===_)}})),Q(()=>{f+=1,T()}),(a,t)=>(F(),G(ne,{to:"body"},[z("div",{class:ae(["markstream-vue",{dark:d.isDark}])},[K(le,{name:"tooltip",appear:""},{default:W(()=>[Z(z("div",{id:e.id,ref_key:"tooltip",ref:n,style:X({position:"fixed",transitionProperty:v.value?"opacity, transform":"opacity",left:r.value.left,top:r.value.top,transform:r.value.transform,visibility:i.value?"visible":"hidden",pointerEvents:i.value?void 0:"none"}),class:"tooltip-element",role:"tooltip"},[A(ee(d.content)+" ",1),z("div",{ref_key:"arrowEl",ref:s,class:"tooltip-arrow","data-placement":c.value,style:X(y.value)},null,12,re)],12,ie),[[te,d.visible]])]),_:1})],2)]))}}),[["__scopeId","data-v-c606ee4c"]]);export{se as default};
|
||||
import{bQ as H,M as J,aU as p,bE as S,az as O,aL as Q,s as F,v as I,I as K,bJ as W,bL as Z,aw as X,H as A,bb as ee,bB as te,g as le,au as ae,T as ne,as as Y,bR as oe}from"./index-BOtIzGLC.js";var k=(d,x,e)=>new Promise((n,s)=>{var r=i=>{try{c(e.next(i))}catch(v){s(v)}},y=i=>{try{c(e.throw(i))}catch(v){s(v)}},c=i=>i.done?n(i.value):Promise.resolve(i.value).then(r,y);c((e=e.apply(d,x)).next())});const ie=["id"],re=["data-placement"],se=H(J({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(d){var x;const e=d,n=p(null),s=p(null),r=p({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),y=p({}),c=p((x=e.placement)!=null?x:"top"),i=p(!1),v=p(!1);let E=null,M=null,R=null,P=null,w=null,f=0;function N(){return P?Promise.resolve(P):(w||(w=oe(()=>import("./floating-ui.dom-xGUaHE3m.js"),[]).then(a=>(P=a,a)).catch(a=>{throw w=null,a})),w)}function T(){E&&(E(),E=null),M=null,R=null}function D(a){return k(this,null,function*(){const t=e.anchorEl,l=n.value;if(!e.visible||!t||!l||M===t&&R===l)return;const{autoUpdate:o}=yield N();a()&&e.visible&&e.anchorEl===t&&n.value===l&&(T(),M=t,R=l,E=o(t,l,()=>{$().catch(()=>{B()})}))})}function $(){return k(this,null,function*(){var a,t;const l=e.anchorEl,o=n.value;if(!e.visible||!l||!o)return!1;const{arrow:u,computePosition:C,flip:h,offset:m,shift:b}=yield N();if(!e.visible||e.anchorEl!==l||n.value!==o)return!1;const g=[m((a=e.offset)!=null?a:6),h(),b({padding:6}),...s.value?[u({element:s.value,padding:4})]:[]],{x:j,y:q,placement:U,middlewareData:V}=yield C(l,o,{placement:(t=e.placement)!=null?t:"top",middleware:g,strategy:"fixed"});if(!e.visible||e.anchorEl!==l||n.value!==o)return!1;if(r.value.transform=`translate3d(${Math.round(j)}px, ${Math.round(q)}px, 0)`,r.value.left="0px",r.value.top="0px",c.value=U,V.arrow&&s.value){const{x:z,y:L}=V.arrow,G={top:"bottom",bottom:"top",left:"right",right:"left"}[U.split("-")[0]];y.value={left:z!=null?`${z}px`:"",top:L!=null?`${L}px`:"",[G]:"-3px"}}return!0})}function B(){var a,t;const l=e.anchorEl,o=n.value;if(!l||!o)return!1;const u=l.getBoundingClientRect(),C=o.getBoundingClientRect(),h=(a=e.offset)!=null?a:6,m=(t=e.placement)!=null?t:"top";let b=u.left,g=u.top;return m==="bottom"?g=u.bottom+h:m==="left"?b=u.left-C.width-h:m==="right"?b=u.right+h:g=u.top-C.height-h,r.value.transform=`translate3d(${Math.round(Math.max(0,b))}px, ${Math.round(Math.max(0,g))}px, 0)`,r.value.left="0px",r.value.top="0px",c.value=m,y.value={},!0}S(()=>e.visible,a=>k(null,null,function*(){const t=++f;if(a){if(i.value=!1,yield Y(),t!==f||!e.visible)return;if(e.anchorEl&&n.value)try{const l=e.anchorEl,o=n.value,u=l.getBoundingClientRect();if(!(yield $())||t!==f||!e.visible||e.anchorEl!==l||n.value!==o)return;v.value=!1,i.value=!0,yield D(()=>t===f)}catch{if(t!==f||!e.visible)return;if(i.value=B(),e.anchorEl&&n.value)try{yield D(()=>t===f)}catch{}}else i.value=!0}else T()}));let _=0;return S([()=>e.anchorEl,()=>e.placement,()=>e.content],([a],[t])=>k(null,null,function*(){v.value=!!(a&&t&&a!==t&&Math.hypot(a.getBoundingClientRect().left-t.getBoundingClientRect().left,a.getBoundingClientRect().top-t.getBoundingClientRect().top)<=120);const l=++_;if(e.visible&&e.anchorEl&&n.value){if(yield Y(),l!==_||!e.visible||!e.anchorEl||!n.value)return;try{const o=yield $();if(l!==_||!e.visible||!e.anchorEl||!n.value)return;o||B()}catch{B()}yield D(()=>l===_)}})),O(()=>{f+=1,T()}),(a,t)=>(Q(),F(ne,{to:"body"},[I("div",{class:ae(["markstream-vue",{dark:d.isDark}])},[K(le,{name:"tooltip",appear:""},{default:W(()=>[Z(I("div",{id:e.id,ref_key:"tooltip",ref:n,style:X({position:"fixed",transitionProperty:v.value?"opacity, transform":"opacity",left:r.value.left,top:r.value.top,transform:r.value.transform,visibility:i.value?"visible":"hidden",pointerEvents:i.value?void 0:"none"}),class:"tooltip-element",role:"tooltip"},[A(ee(d.content)+" ",1),I("div",{ref_key:"arrowEl",ref:s,class:"tooltip-arrow","data-placement":c.value,style:X(y.value)},null,12,re)],12,ie),[[te,d.visible]])]),_:1})],2)]))}}),[["__scopeId","data-v-c606ee4c"]]);export{se as default};
|
||||
|
|
@ -1 +1 @@
|
|||
import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-VIWv47K9.js";import{p as f}from"./chunk-JWPE2WC7-D24iyGyr.js";import{_ as n,l as o}from"./mermaid.core-DKNppTOJ.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-D3UUATjS.js";import"./index-DusVyqlT.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};
|
||||
import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-m4Krf3Vn.js";import{p as f}from"./chunk-JWPE2WC7-TZtJmqSP.js";import{_ as n,l as o}from"./mermaid.core-B_UcP3X_.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-BnQdr27u.js";import"./index-BOtIzGLC.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 @@
|
|||
import{G as ln,H as un,I as N,J as I,K as J,L as an,M as y,N as tn,O as j,P as _,Q as rn,R as o,S as on,T as sn,V as fn}from"./mermaid.core-DKNppTOJ.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,q,O,v,R,K,u){var D=q-l,i=O-h,n=K-v,d=u-R,a=d*D-n*i;if(!(a*a<y))return a=(n*(h-R)-d*(l-v))/a,[l+a*D,h+a*i]}function W(l,h,q,O,v,R,K){var u=l-q,D=h-O,i=(K?R:-R)/j(u*u+D*D),n=i*D,d=-i*u,a=l+n,s=h+d,f=q+n,c=O+d,L=(a+f)/2,t=(s+c)/2,m=f-a,g=c-s,A=m*m+g*g,T=v-R,P=a*c-f*s,E=(g<0?-1:1)*j(on(0,T*T*A-P*P)),G=(P*g-m*E)/A,H=(-P*m-g*E)/A,w=(P*g+m*E)/A,p=(-P*m+g*E)/A,x=G-L,e=H-t,r=w-L,M=p-t;return x*x+e*e>r*r+M*M&&(G=w,H=p),{cx:G,cy:H,x01:-n,y01:-d,x11:G*(v/T-1),y11:H*(v/T-1)}}function hn(){var l=cn,h=yn,q=J(0),O=null,v=gn,R=dn,K=mn,u=null,D=ln(i);function i(){var n,d,a=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-an,c=R.apply(this,arguments)-an,L=rn(c-f),t=c>f;if(u||(u=n=D()),s<a&&(d=s,s=a,a=d),!(s>y))u.moveTo(0,0);else if(L>tn-y)u.moveTo(s*N(f),s*I(f)),u.arc(0,0,s,f,c,!t),a>y&&(u.moveTo(a*N(c),a*I(c)),u.arc(0,0,a,c,f,t));else{var m=f,g=c,A=f,T=c,P=L,E=L,G=K.apply(this,arguments)/2,H=G>y&&(O?+O.apply(this,arguments):j(a*a+s*s)),w=_(rn(s-a)/2,+q.apply(this,arguments)),p=w,x=w,e,r;if(H>y){var M=sn(H/a*I(G)),z=sn(H/s*I(G));(P-=M*2)>y?(M*=t?1:-1,A+=M,T-=M):(P=0,A=T=(f+c)/2),(E-=z*2)>y?(z*=t?1:-1,m+=z,g-=z):(E=0,m=g=(f+c)/2)}var Q=s*N(m),V=s*I(m),B=a*N(T),C=a*I(T);if(w>y){var F=s*N(g),U=s*I(g),X=a*N(A),Y=a*I(A),S;if(L<un)if(S=pn(Q,V,X,Y,F,U,B,C)){var Z=Q-S[0],$=V-S[1],k=F-S[0],b=U-S[1],nn=1/I(fn((Z*k+$*b)/(j(Z*Z+$*$)*j(k*k+b*b)))/2),en=j(S[0]*S[0]+S[1]*S[1]);p=_(w,(a-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}E>y?x>y?(e=W(X,Y,Q,V,s,x,t),r=W(F,U,B,C,s,x,t),u.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?u.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(u.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),u.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),u.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(u.moveTo(Q,V),u.arc(0,0,s,m,g,!t)):u.moveTo(Q,V),!(a>y)||!(P>y)?u.lineTo(B,C):p>y?(e=W(B,C,F,U,a,-p,t),r=W(Q,V,X,Y,a,-p,t),u.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?u.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(u.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),u.arc(0,0,a,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),u.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):u.arc(0,0,a,T,A,t)}if(u.closePath(),n)return u=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +R.apply(this,arguments))/2-un/2;return[N(d)*n,I(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?(q=typeof n=="function"?n:J(+n),i):q},i.padRadius=function(n){return arguments.length?(O=n==null?null:typeof n=="function"?n:J(+n),i):O},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:J(+n),i):v},i.endAngle=function(n){return arguments.length?(R=typeof n=="function"?n:J(+n),i):R},i.padAngle=function(n){return arguments.length?(K=typeof n=="function"?n:J(+n),i):K},i.context=function(n){return arguments.length?(u=n??null,i):u},i}export{hn as d};
|
||||
import{G as ln,H as un,I as N,J as I,K as J,L as an,M as y,N as tn,O as j,P as _,Q as rn,R as o,S as on,T as sn,V as fn}from"./mermaid.core-B_UcP3X_.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,q,O,v,R,K,u){var D=q-l,i=O-h,n=K-v,d=u-R,a=d*D-n*i;if(!(a*a<y))return a=(n*(h-R)-d*(l-v))/a,[l+a*D,h+a*i]}function W(l,h,q,O,v,R,K){var u=l-q,D=h-O,i=(K?R:-R)/j(u*u+D*D),n=i*D,d=-i*u,a=l+n,s=h+d,f=q+n,c=O+d,L=(a+f)/2,t=(s+c)/2,m=f-a,g=c-s,A=m*m+g*g,T=v-R,P=a*c-f*s,E=(g<0?-1:1)*j(on(0,T*T*A-P*P)),G=(P*g-m*E)/A,H=(-P*m-g*E)/A,w=(P*g+m*E)/A,p=(-P*m+g*E)/A,x=G-L,e=H-t,r=w-L,M=p-t;return x*x+e*e>r*r+M*M&&(G=w,H=p),{cx:G,cy:H,x01:-n,y01:-d,x11:G*(v/T-1),y11:H*(v/T-1)}}function hn(){var l=cn,h=yn,q=J(0),O=null,v=gn,R=dn,K=mn,u=null,D=ln(i);function i(){var n,d,a=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-an,c=R.apply(this,arguments)-an,L=rn(c-f),t=c>f;if(u||(u=n=D()),s<a&&(d=s,s=a,a=d),!(s>y))u.moveTo(0,0);else if(L>tn-y)u.moveTo(s*N(f),s*I(f)),u.arc(0,0,s,f,c,!t),a>y&&(u.moveTo(a*N(c),a*I(c)),u.arc(0,0,a,c,f,t));else{var m=f,g=c,A=f,T=c,P=L,E=L,G=K.apply(this,arguments)/2,H=G>y&&(O?+O.apply(this,arguments):j(a*a+s*s)),w=_(rn(s-a)/2,+q.apply(this,arguments)),p=w,x=w,e,r;if(H>y){var M=sn(H/a*I(G)),z=sn(H/s*I(G));(P-=M*2)>y?(M*=t?1:-1,A+=M,T-=M):(P=0,A=T=(f+c)/2),(E-=z*2)>y?(z*=t?1:-1,m+=z,g-=z):(E=0,m=g=(f+c)/2)}var Q=s*N(m),V=s*I(m),B=a*N(T),C=a*I(T);if(w>y){var F=s*N(g),U=s*I(g),X=a*N(A),Y=a*I(A),S;if(L<un)if(S=pn(Q,V,X,Y,F,U,B,C)){var Z=Q-S[0],$=V-S[1],k=F-S[0],b=U-S[1],nn=1/I(fn((Z*k+$*b)/(j(Z*Z+$*$)*j(k*k+b*b)))/2),en=j(S[0]*S[0]+S[1]*S[1]);p=_(w,(a-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}E>y?x>y?(e=W(X,Y,Q,V,s,x,t),r=W(F,U,B,C,s,x,t),u.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?u.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(u.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),u.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),u.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(u.moveTo(Q,V),u.arc(0,0,s,m,g,!t)):u.moveTo(Q,V),!(a>y)||!(P>y)?u.lineTo(B,C):p>y?(e=W(B,C,F,U,a,-p,t),r=W(Q,V,X,Y,a,-p,t),u.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?u.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(u.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),u.arc(0,0,a,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),u.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):u.arc(0,0,a,T,A,t)}if(u.closePath(),n)return u=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +R.apply(this,arguments))/2-un/2;return[N(d)*n,I(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?(q=typeof n=="function"?n:J(+n),i):q},i.padRadius=function(n){return arguments.length?(O=n==null?null:typeof n=="function"?n:J(+n),i):O},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:J(+n),i):v},i.endAngle=function(n){return arguments.length?(R=typeof n=="function"?n:J(+n),i):R},i.padAngle=function(n){return arguments.length?(K=typeof n=="function"?n:J(+n),i):K},i.context=function(n){return arguments.length?(u=n??null,i):u},i}export{hn as d};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
apps/kimi-code/dist-web/assets/channel-Bw0eTBly.js
Normal file
1
apps/kimi-code/dist-web/assets/channel-Bw0eTBly.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
import{U as a,C as n}from"./mermaid.core-B_UcP3X_.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c};
|
||||
|
|
@ -1 +0,0 @@
|
|||
import{U as a,C as n}from"./mermaid.core-DKNppTOJ.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c};
|
||||
|
|
@ -1 +1 @@
|
|||
import{_ as i}from"./mermaid.core-DKNppTOJ.js";var r=class{constructor(t){this.init=t,this.records=this.init()}static{i(this,"ImperativeState")}reset(){this.records=this.init()}};export{r as I};
|
||||
import{_ as i}from"./mermaid.core-B_UcP3X_.js";var r=class{constructor(t){this.init=t,this.records=this.init()}static{i(this,"ImperativeState")}reset(){this.records=this.init()}};export{r as I};
|
||||
|
|
@ -1 +1 @@
|
|||
import{_ as i,d as l,n as d,j as o}from"./mermaid.core-DKNppTOJ.js";var x=i((r,t)=>{const e=r.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(const s in t.attrs)e.attr(s,t.attrs[s]);return t.class&&e.attr("class",t.class),e},"drawRect"),p=i((r,t)=>{const e={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};x(r,e).lower()},"drawBackgroundRect"),y=i((r,t)=>{const e=t.text.replace(d," "),s=r.append("text");s.attr("x",t.x),s.attr("y",t.y),s.attr("class","legend"),s.style("text-anchor",t.anchor),t.class&&s.attr("class",t.class);const a=s.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.text(e),s},"drawText"),m=i((r,t,e,s)=>{const a=r.append("image");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",n)},"drawImage"),g=i((r,t,e,s)=>{const a=r.append("use");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),h=i(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),f=i(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),w=i(()=>{let r=l(".mermaidTooltip");return r.empty()&&(r=l("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),r},"createTooltip");export{p as a,f as b,g as c,x as d,m as e,w as f,h as g,y as h};
|
||||
import{_ as i,d as l,n as d,j as o}from"./mermaid.core-B_UcP3X_.js";var x=i((r,t)=>{const e=r.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(const s in t.attrs)e.attr(s,t.attrs[s]);return t.class&&e.attr("class",t.class),e},"drawRect"),p=i((r,t)=>{const e={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};x(r,e).lower()},"drawBackgroundRect"),y=i((r,t)=>{const e=t.text.replace(d," "),s=r.append("text");s.attr("x",t.x),s.attr("y",t.y),s.attr("class","legend"),s.style("text-anchor",t.anchor),t.class&&s.attr("class",t.class);const a=s.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.text(e),s},"drawText"),m=i((r,t,e,s)=>{const a=r.append("image");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",n)},"drawImage"),g=i((r,t,e,s)=>{const a=r.append("use");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),h=i(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),f=i(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),w=i(()=>{let r=l(".mermaidTooltip");return r.empty()&&(r=l("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),r},"createTooltip");export{p as a,f as b,g as c,x as d,m as e,w as f,h as g,y as h};
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import{_ as e}from"./mermaid.core-DKNppTOJ.js";var l=e(()=>`
|
||||
import{_ as e}from"./mermaid.core-B_UcP3X_.js";var l=e(()=>`
|
||||
/* Font Awesome icon styling - consolidated */
|
||||
.label-icon {
|
||||
display: inline-block;
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
import{_ as i}from"./mermaid.core-DKNppTOJ.js";function t(c,e){c.accDescr&&e.setAccDescription?.(c.accDescr),c.accTitle&&e.setAccTitle?.(c.accTitle),c.title&&e.setDiagramTitle?.(c.title)}i(t,"populateCommonDb");export{t as p};
|
||||
import{_ as i}from"./mermaid.core-B_UcP3X_.js";function t(c,e){c.accDescr&&e.setAccDescription?.(c.accDescr),c.accTitle&&e.setAccTitle?.(c.accTitle),c.title&&e.setDiagramTitle?.(c.title)}i(t,"populateCommonDb");export{t as p};
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import{_ as p,l as w,F as L,z as E,q as I,W as X,e as q,i as H,c as G}from"./mermaid.core-DKNppTOJ.js";var z="",b="",N="",A=[],R=new Map,k=p(e=>H(e,G()),"sanitizeText"),F=p(e=>{switch(e.type){case"terminal":return{...e,value:k(e.value)};case"nonterminal":return{...e,name:k(e.name)};case"sequence":return{...e,elements:e.elements.map(F)};case"choice":return{...e,alternatives:e.alternatives.map(F)};case"optional":return{...e,element:F(e.element)};case"repetition":return{...e,element:F(e.element),separator:e.separator?F(e.separator):void 0};case"special":return{...e,text:k(e.text)}}},"sanitizeAstNode"),U=p(()=>{z="",b="",N="",A.length=0,R.clear(),I(),w.debug("[Railroad] Database cleared")},"clear"),W=p(e=>{z=k(e),w.debug("[Railroad] Title set:",e)},"setTitle"),_=p(()=>z,"getTitle"),j=p(e=>{const i={...e,name:k(e.name),definition:F(e.definition),comment:e.comment?k(e.comment):void 0};w.debug("[Railroad] Adding rule:",i.name),R.has(i.name)&&w.warn(`[Railroad] Rule '${i.name}' is already defined. Overwriting.`),A.push(i),R.set(i.name,i)},"addRule"),K=p(()=>A,"getRules"),J=p(e=>R.get(e),"getRule"),Q=p(e=>{b=k(e).replace(/^\s+/g,""),w.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),Z=p(()=>b,"getAccTitle"),V=p(e=>{N=k(e).replace(/\n\s+/g,`
|
||||
import{_ as p,l as w,F as L,z as E,q as I,W as X,e as q,i as H,c as G}from"./mermaid.core-B_UcP3X_.js";var z="",b="",N="",A=[],R=new Map,k=p(e=>H(e,G()),"sanitizeText"),F=p(e=>{switch(e.type){case"terminal":return{...e,value:k(e.value)};case"nonterminal":return{...e,name:k(e.name)};case"sequence":return{...e,elements:e.elements.map(F)};case"choice":return{...e,alternatives:e.alternatives.map(F)};case"optional":return{...e,element:F(e.element)};case"repetition":return{...e,element:F(e.element),separator:e.separator?F(e.separator):void 0};case"special":return{...e,text:k(e.text)}}},"sanitizeAstNode"),U=p(()=>{z="",b="",N="",A.length=0,R.clear(),I(),w.debug("[Railroad] Database cleared")},"clear"),W=p(e=>{z=k(e),w.debug("[Railroad] Title set:",e)},"setTitle"),_=p(()=>z,"getTitle"),j=p(e=>{const i={...e,name:k(e.name),definition:F(e.definition),comment:e.comment?k(e.comment):void 0};w.debug("[Railroad] Adding rule:",i.name),R.has(i.name)&&w.warn(`[Railroad] Rule '${i.name}' is already defined. Overwriting.`),A.push(i),R.set(i.name,i)},"addRule"),K=p(()=>A,"getRules"),J=p(e=>R.get(e),"getRule"),Q=p(e=>{b=k(e).replace(/^\s+/g,""),w.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),Z=p(()=>b,"getAccTitle"),V=p(e=>{N=k(e).replace(/\n\s+/g,`
|
||||
`),w.debug("[Railroad] Accessibility description set:",e)},"setAccDescription"),ee=p(()=>N,"getAccDescription"),te=W,re=_,ie={clear:U,setTitle:W,getTitle:_,addRule:j,getRules:K,getRule:J,setAccTitle:Q,getAccTitle:Z,setAccDescription:V,getAccDescription:ee,setDiagramTitle:te,getDiagramTitle:re},g={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},ne=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,ae=/^[\w "',.-]+$/,oe=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),B=p(e=>e?Object.keys(e).every(i=>i==="railroad"||oe.has(i)):!1,"isRailroadStyleOptions"),le=p(e=>e?"railroad"in e&&e.railroad?e.railroad:B(e)?e:{}:{},"extractRailroadOverrides"),se=p(e=>{if(!e||B(e))return{};const{railroad:i,svgId:a,theme:r,look:t,...n}=e;return n},"extractThemeOverrides"),m=p((e,i)=>{if(typeof e!="string")return i;const a=e.trim();return ne.test(a)?a:i},"sanitizeColorValue"),Y=p((e,i)=>{if(typeof e!="string")return i;const a=e.trim();return ae.test(a)?a:i},"sanitizeFontFamilyValue"),S=p((e,i)=>{const a=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(a)&&a>=0?a:i},"sanitizeNumberValue"),de=p(e=>{const i=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(i)&&i>0?i:void 0},"parseThemeFontSize"),ce=p(e=>{const i=Y(e.fontFamily,g.fontFamily),a=de(e.fontSize)??g.fontSize;return{...g,fontFamily:i,fontSize:a,terminalFill:m(e.secondBkg??e.secondaryColor,g.terminalFill),terminalStroke:m(e.secondaryBorderColor??e.lineColor,g.terminalStroke),terminalTextColor:m(e.secondaryTextColor??e.textColor,g.terminalTextColor),nonTerminalFill:m(e.mainBkg??e.background,g.nonTerminalFill),nonTerminalStroke:m(e.primaryBorderColor??e.lineColor,g.nonTerminalStroke),nonTerminalTextColor:m(e.primaryTextColor??e.textColor,g.nonTerminalTextColor),lineColor:m(e.lineColor,g.lineColor),markerFill:m(e.lineColor,g.markerFill),commentFill:m(e.labelBackground??e.tertiaryColor,g.commentFill),commentStroke:m(e.tertiaryBorderColor??e.lineColor,g.commentStroke),commentTextColor:m(e.tertiaryTextColor??e.textColor,g.commentTextColor),specialFill:m(e.tertiaryColor??e.secondaryColor,g.specialFill),specialStroke:m(e.tertiaryBorderColor??e.secondaryBorderColor,g.specialStroke),ruleNameColor:m(e.titleColor??e.textColor,g.ruleNameColor)}},"buildThemeDefaults"),M=p(e=>{const i=E(),a={...X(),...i.themeVariables??{},...se(e)},r=ce(a),t={...i.railroad??{},...le(e)};return{compactMode:t.compactMode??r.compactMode,padding:S(t.padding,r.padding),verticalSeparation:S(t.verticalSeparation,r.verticalSeparation),horizontalSeparation:S(t.horizontalSeparation,r.horizontalSeparation),arcRadius:S(t.arcRadius,r.arcRadius),fontSize:S(t.fontSize,r.fontSize),fontFamily:Y(t.fontFamily,r.fontFamily),terminalFill:m(t.terminalFill,r.terminalFill),terminalStroke:m(t.terminalStroke,r.terminalStroke),terminalTextColor:m(t.terminalTextColor,r.terminalTextColor),nonTerminalFill:m(t.nonTerminalFill,r.nonTerminalFill),nonTerminalStroke:m(t.nonTerminalStroke,r.nonTerminalStroke),nonTerminalTextColor:m(t.nonTerminalTextColor,r.nonTerminalTextColor),lineColor:m(t.lineColor,r.lineColor),strokeWidth:S(t.strokeWidth,r.strokeWidth),markerFill:m(t.markerFill,r.markerFill),commentFill:m(t.commentFill,r.commentFill),commentStroke:m(t.commentStroke,r.commentStroke),commentTextColor:m(t.commentTextColor,r.commentTextColor),specialFill:m(t.specialFill,r.specialFill),specialStroke:m(t.specialStroke,r.specialStroke),ruleNameColor:m(t.ruleNameColor,r.ruleNameColor),showMarkers:t.showMarkers??r.showMarkers,markerRadius:S(t.markerRadius,r.markerRadius)}},"buildRailroadStyleOptions"),ue=p(e=>{const{fontFamily:i,fontSize:a,terminalFill:r,terminalStroke:t,terminalTextColor:n,nonTerminalFill:h,nonTerminalStroke:s,nonTerminalTextColor:o,lineColor:u,strokeWidth:c,markerFill:d,commentFill:x,commentStroke:l,commentTextColor:f,specialFill:y,specialStroke:v,ruleNameColor:C}=M(e);return`
|
||||
.railroad-diagram {
|
||||
font-family: ${i};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
import{_ as a,e as w,l as x}from"./mermaid.core-DKNppTOJ.js";var d=a((e,t,i,r)=>{e.attr("class",i);const{width:o,height:h,x:n,y:c}=u(e,t);w(e,h,o,r);const s=l(n,c,o,h,t);e.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${t}`)},"setupViewPortForSVG"),u=a((e,t)=>{const i=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:i.width+t*2,height:i.height+t*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),l=a((e,t,i,r,o)=>`${e-o} ${t-o} ${i} ${r}`,"createViewBox");export{d as s};
|
||||
import{_ as a,e as w,l as x}from"./mermaid.core-B_UcP3X_.js";var d=a((e,t,i,r)=>{e.attr("class",i);const{width:o,height:h,x:n,y:c}=u(e,t);w(e,h,o,r);const s=l(n,c,o,h,t);e.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${t}`)},"setupViewPortForSVG"),u=a((e,t)=>{const i=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:i.width+t*2,height:i.height+t*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),l=a((e,t,i,r,o)=>`${e-o} ${t-o} ${i} ${r}`,"createViewBox");export{d as s};
|
||||
|
|
@ -1 +1 @@
|
|||
import{_ as a,d as o}from"./mermaid.core-DKNppTOJ.js";var d=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{d as g};
|
||||
import{_ as a,d as o}from"./mermaid.core-B_UcP3X_.js";var d=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{d as g};
|
||||
|
|
@ -0,0 +1 @@
|
|||
import{s as a,c as s,a as e,C as t}from"./chunk-V7JOEXUC-DyjtUXRY.js";import{_ as i}from"./mermaid.core-B_UcP3X_.js";import"./chunk-5VM5RSS4-DxIYPYOn.js";import"./chunk-XXDRQBXY-AHUPVB2f.js";import"./chunk-VR4S4FIN-CYEgbtU1.js";import"./chunk-32BRIVSS-D_mpvupa.js";import"./index-BOtIzGLC.js";var n={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};
|
||||
|
|
@ -1 +0,0 @@
|
|||
import{s as a,c as s,a as e,C as t}from"./chunk-V7JOEXUC-CzjVKRuS.js";import{_ as i}from"./mermaid.core-DKNppTOJ.js";import"./chunk-5VM5RSS4-CUvXVaNK.js";import"./chunk-XXDRQBXY-DGdcv7YP.js";import"./chunk-VR4S4FIN-DN3fhyNm.js";import"./chunk-32BRIVSS-BPgqH-Ub.js";import"./index-DusVyqlT.js";var n={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};
|
||||
|
|
@ -0,0 +1 @@
|
|||
import{s as a,c as s,a as e,C as t}from"./chunk-V7JOEXUC-DyjtUXRY.js";import{_ as i}from"./mermaid.core-B_UcP3X_.js";import"./chunk-5VM5RSS4-DxIYPYOn.js";import"./chunk-XXDRQBXY-AHUPVB2f.js";import"./chunk-VR4S4FIN-CYEgbtU1.js";import"./chunk-32BRIVSS-D_mpvupa.js";import"./index-BOtIzGLC.js";var n={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};
|
||||
|
|
@ -1 +0,0 @@
|
|||
import{s as a,c as s,a as e,C as t}from"./chunk-V7JOEXUC-CzjVKRuS.js";import{_ as i}from"./mermaid.core-DKNppTOJ.js";import"./chunk-5VM5RSS4-CUvXVaNK.js";import"./chunk-XXDRQBXY-DGdcv7YP.js";import"./chunk-VR4S4FIN-DN3fhyNm.js";import"./chunk-32BRIVSS-BPgqH-Ub.js";import"./index-DusVyqlT.js";var n={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
|||
import{c as O,w as I,a as J,f as P,b as E,s as A}from"./chunk-RYQCIY6F-BoueTeQN.js";import{_ as w,am as v,an as D,ao as H,ap as Y,l,c as _,aq as W,ar as $,ag as j,as as q,ah as R,af as F,at as z,au as K,av as G}from"./mermaid.core-DKNppTOJ.js";import{G as Q}from"./graph-DOmOIIwC.js";import{l as U}from"./layout-D-LzfAck.js";import"./map-DxJ2ADlA.js";import"./index-DusVyqlT.js";var C=w((s,t,g)=>Math.max(t,Math.min(g,s)),"clamp"),B=w((s="TB")=>{switch(s){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),V=w(s=>s==="flowchart"||s==="flowchart-v2"||s==="stateDiagram","shouldMergeSelfLoopSegments"),Z=w((s,t,g,y,c)=>{const o=[],r=new Set;if(g.forEach(({start:i,end:n})=>{i!==y&&r.add(i),n!==y&&r.add(n)}),r.forEach(i=>{const n=s.node(i);typeof n?.x=="number"&&typeof n?.y=="number"&&o.push(n)}),o.length===0&&g.forEach(({edge:i})=>{(i.points??[]).forEach(n=>{typeof n?.x=="number"&&typeof n?.y=="number"&&o.push(n)})}),o.length===0)return B(c);const f=o.reduce((i,n)=>({x:i.x+n.x/o.length,y:i.y+n.y/o.length}),{x:0,y:0}),h=f.x-t.x,a=f.y-t.y;return Math.abs(h)>Math.abs(a)?h>0?"right":"left":Math.abs(a)>0?a>0?"bottom":"top":B(c)},"getSelfLoopSide"),ee=w((s,t="top",g=0,y=0)=>{const c=s.x,o=s.y-g,r=s.width/2,f=s.height/2,h=Math.max(36,Math.min(100,s.width*.8)),a=C(Math.max(y,s.width*.35),36,h),i=C(Math.min(s.width,s.height)*.45,24,48);switch(t){case"bottom":{const n=o+f;return[{x:c-a/2,y:n},{x:c-a/2,y:n+i},{x:c+a/2,y:n+i},{x:c+a/2,y:n}]}case"right":{const n=c+r;return[{x:n,y:o-a/2},{x:n+i,y:o-a/2},{x:n+i,y:o+a/2},{x:n,y:o+a/2}]}case"left":{const n=c-r;return[{x:n,y:o-a/2},{x:n-i,y:o-a/2},{x:n-i,y:o+a/2},{x:n,y:o+a/2}]}case"top":default:{const n=o-f;return[{x:c-a/2,y:n},{x:c-a/2,y:n-i},{x:c+a/2,y:n-i},{x:c+a/2,y:n}]}}},"getSelfLoopPoints"),te=w((s,t,g="top",y=0,c={})=>{const r=s.x,f=s.y-y,h=c.width??0,a=c.height??0;switch(g){case"bottom":return{x:r,y:Math.max(...t.map(i=>i.y))+a/2+4};case"right":return{x:Math.max(...t.map(i=>i.x))+h/2+4,y:f};case"left":return{x:Math.min(...t.map(i=>i.x))-h/2-4,y:f};case"top":default:return{x:r,y:Math.min(...t.map(i=>i.y))-a/2-4}}},"getSelfLoopLabelPosition"),ne=w((s,t=0,{mergeSelfLoops:g=!0}={})=>{const y=new Map,c=[],o=s.graph()?.rankdir;return s.edges().forEach(r=>{const f=s.edge(r);if(g&&f.selfLoop){const h=f.selfLoop.id;y.has(h)||y.set(h,[]),y.get(h).push({edge:f,start:r.v,end:r.w})}else c.push({edge:f,start:r.v,end:r.w})}),y.forEach(r=>{if(r.length!==3){r.forEach(L=>c.push(L));return}r.sort((L,d)=>L.edge.selfLoop.order-d.edge.selfLoop.order);const[f,h,a]=r,i=f.edge.originalEdge??h.edge.originalEdge??a.edge.originalEdge??h.edge,n=s.node(i.start);if(!n){r.forEach(L=>c.push(L));return}const p={width:h.edge.width,height:h.edge.height},m=Z(s,n,r,i.start,o),X=ee(n,m,t,p.width??0),S=te(n,X,m,t,p),b={...h.edge,...i,id:i.id,points:X,start:i.start,end:i.end,x:S.x,y:S.y,width:p.width,height:p.height,labelStyle:h.edge.labelStyle,fromCluster:f.edge.fromCluster??h.edge.fromCluster??a.edge.fromCluster,toCluster:f.edge.toCluster??h.edge.toCluster??a.edge.toCluster};delete b.selfLoop,delete b.originalEdge,c.push({edge:b,start:b.start,end:b.end})}),c},"getEdgesToRender"),T=w(async(s,t,g,y,c,o)=>{l.warn("Graph in recursive render:XAX",I(t),c);const r=t.graph().rankdir;l.trace("Dir in recursive render - dir:",r);const f=s.insert("g").attr("class","root");t.nodes()?l.info("Recursive render XXX",t.nodes()):l.info("No nodes found for",t),t.edges().length>0&&l.info("Recursive edges",t.edge(t.edges()[0]));const h=f.insert("g").attr("class","clusters"),a=f.insert("g").attr("class","edgePaths"),i=f.insert("g").attr("class","edgeLabels"),n=f.insert("g").attr("class","nodes"),p=V(g);await Promise.all(t.nodes().map(async function(d){const e=t.node(d);if(c!==void 0){const u=JSON.parse(JSON.stringify(c.clusterData));l.trace(`Setting data for parent cluster XXX
|
||||
import{c as O,w as I,a as J,f as P,b as E,s as A}from"./chunk-RYQCIY6F-BrAj5IFL.js";import{_ as w,am as v,an as D,ao as H,ap as Y,l,c as _,aq as W,ar as $,ag as j,as as q,ah as R,af as F,at as z,au as K,av as G}from"./mermaid.core-B_UcP3X_.js";import{G as Q}from"./graph-DOmOIIwC.js";import{l as U}from"./layout-D-LzfAck.js";import"./map-DxJ2ADlA.js";import"./index-BOtIzGLC.js";var C=w((s,t,g)=>Math.max(t,Math.min(g,s)),"clamp"),B=w((s="TB")=>{switch(s){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),V=w(s=>s==="flowchart"||s==="flowchart-v2"||s==="stateDiagram","shouldMergeSelfLoopSegments"),Z=w((s,t,g,y,c)=>{const o=[],r=new Set;if(g.forEach(({start:i,end:n})=>{i!==y&&r.add(i),n!==y&&r.add(n)}),r.forEach(i=>{const n=s.node(i);typeof n?.x=="number"&&typeof n?.y=="number"&&o.push(n)}),o.length===0&&g.forEach(({edge:i})=>{(i.points??[]).forEach(n=>{typeof n?.x=="number"&&typeof n?.y=="number"&&o.push(n)})}),o.length===0)return B(c);const f=o.reduce((i,n)=>({x:i.x+n.x/o.length,y:i.y+n.y/o.length}),{x:0,y:0}),h=f.x-t.x,a=f.y-t.y;return Math.abs(h)>Math.abs(a)?h>0?"right":"left":Math.abs(a)>0?a>0?"bottom":"top":B(c)},"getSelfLoopSide"),ee=w((s,t="top",g=0,y=0)=>{const c=s.x,o=s.y-g,r=s.width/2,f=s.height/2,h=Math.max(36,Math.min(100,s.width*.8)),a=C(Math.max(y,s.width*.35),36,h),i=C(Math.min(s.width,s.height)*.45,24,48);switch(t){case"bottom":{const n=o+f;return[{x:c-a/2,y:n},{x:c-a/2,y:n+i},{x:c+a/2,y:n+i},{x:c+a/2,y:n}]}case"right":{const n=c+r;return[{x:n,y:o-a/2},{x:n+i,y:o-a/2},{x:n+i,y:o+a/2},{x:n,y:o+a/2}]}case"left":{const n=c-r;return[{x:n,y:o-a/2},{x:n-i,y:o-a/2},{x:n-i,y:o+a/2},{x:n,y:o+a/2}]}case"top":default:{const n=o-f;return[{x:c-a/2,y:n},{x:c-a/2,y:n-i},{x:c+a/2,y:n-i},{x:c+a/2,y:n}]}}},"getSelfLoopPoints"),te=w((s,t,g="top",y=0,c={})=>{const r=s.x,f=s.y-y,h=c.width??0,a=c.height??0;switch(g){case"bottom":return{x:r,y:Math.max(...t.map(i=>i.y))+a/2+4};case"right":return{x:Math.max(...t.map(i=>i.x))+h/2+4,y:f};case"left":return{x:Math.min(...t.map(i=>i.x))-h/2-4,y:f};case"top":default:return{x:r,y:Math.min(...t.map(i=>i.y))-a/2-4}}},"getSelfLoopLabelPosition"),ne=w((s,t=0,{mergeSelfLoops:g=!0}={})=>{const y=new Map,c=[],o=s.graph()?.rankdir;return s.edges().forEach(r=>{const f=s.edge(r);if(g&&f.selfLoop){const h=f.selfLoop.id;y.has(h)||y.set(h,[]),y.get(h).push({edge:f,start:r.v,end:r.w})}else c.push({edge:f,start:r.v,end:r.w})}),y.forEach(r=>{if(r.length!==3){r.forEach(L=>c.push(L));return}r.sort((L,d)=>L.edge.selfLoop.order-d.edge.selfLoop.order);const[f,h,a]=r,i=f.edge.originalEdge??h.edge.originalEdge??a.edge.originalEdge??h.edge,n=s.node(i.start);if(!n){r.forEach(L=>c.push(L));return}const p={width:h.edge.width,height:h.edge.height},m=Z(s,n,r,i.start,o),X=ee(n,m,t,p.width??0),S=te(n,X,m,t,p),b={...h.edge,...i,id:i.id,points:X,start:i.start,end:i.end,x:S.x,y:S.y,width:p.width,height:p.height,labelStyle:h.edge.labelStyle,fromCluster:f.edge.fromCluster??h.edge.fromCluster??a.edge.fromCluster,toCluster:f.edge.toCluster??h.edge.toCluster??a.edge.toCluster};delete b.selfLoop,delete b.originalEdge,c.push({edge:b,start:b.start,end:b.end})}),c},"getEdgesToRender"),T=w(async(s,t,g,y,c,o)=>{l.warn("Graph in recursive render:XAX",I(t),c);const r=t.graph().rankdir;l.trace("Dir in recursive render - dir:",r);const f=s.insert("g").attr("class","root");t.nodes()?l.info("Recursive render XXX",t.nodes()):l.info("No nodes found for",t),t.edges().length>0&&l.info("Recursive edges",t.edge(t.edges()[0]));const h=f.insert("g").attr("class","clusters"),a=f.insert("g").attr("class","edgePaths"),i=f.insert("g").attr("class","edgeLabels"),n=f.insert("g").attr("class","nodes"),p=V(g);await Promise.all(t.nodes().map(async function(d){const e=t.node(d);if(c!==void 0){const u=JSON.parse(JSON.stringify(c.clusterData));l.trace(`Setting data for parent cluster XXX
|
||||
Node.id = `,d,`
|
||||
data=`,u.height,`
|
||||
Parent cluster`,c.height),t.setNode(c.id,u),t.parent(d)||(l.trace("Setting parent",d,c.id),t.setParent(d,c.id,u))}if(l.info("(Insert) Node XXX"+d+": "+JSON.stringify(t.node(d))),e?.clusterNode){l.info("Cluster identified XBX",d,e.width,t.node(d));const{ranksep:u,nodesep:x}=t.graph();e.graph.setGraph({...e.graph.graph(),ranksep:u+25,nodesep:x});const N=await T(n,e.graph,g,y,t.node(d),o),M=N.elem;W(e,M),e.diff=N.diff||0,l.info("New compound node after recursive render XAX",d,"width",e.width,"height",e.height),$(M,e)}else t.children(d).length>0?(l.trace("Cluster - the non recursive path XBX",d,e.id,e,e.width,"Graph:",t),l.trace(P(e.id,t)),E.set(e.id,{id:P(e.id,t),node:e})):(l.trace("Node - the non recursive path XAX",d,n,t.node(d),r),await j(n,t.node(d),{config:o,dir:r}))})),await w(async()=>{const d=t.edges().map(async function(e){const u=t.edge(e.v,e.w,e.name);if(l.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),l.info("Edge "+e.v+" -> "+e.w+": ",e," ",JSON.stringify(t.edge(e))),l.info("Fix",E,"ids:",e.v,e.w,"Translating: ",E.get(e.v),E.get(e.w)),p&&u.selfLoop){if(u.selfLoop.order!==1)return;const x=u.id;u.id=u.selfLoop.id,await G(i,u),u.id=x;return}await G(i,u)});await Promise.all(d)},"processEdges")(),l.info("Graph before layout:",JSON.stringify(I(t))),l.info("############################################# XXX"),l.info("### Layout ### XXX"),l.info("############################################# XXX"),U(t),l.info("Graph after layout:",JSON.stringify(I(t)));let X=0,{subGraphTitleTotalMargin:S}=q(o);await Promise.all(A(t).map(async function(d){const e=t.node(d);if(l.info("Position XBX => "+d+": ("+e.x,","+e.y,") width: ",e.width," height: ",e.height),e?.clusterNode)e.y+=S,l.info("A tainted cluster node XBX1",d,e.id,e.width,e.height,e.x,e.y,t.parent(d)),E.get(e.id).node=e,R(e);else if(t.children(d).length>0){l.info("A pure cluster node XBX1",d,e.id,e.x,e.y,e.width,e.height,t.parent(d)),e.height+=S,t.node(e.parentId);const u=e?.padding/2||0,x=e?.labelBBox?.height||0,N=x-u||0;l.debug("OffsetY",N,"labelHeight",x,"halfPadding",u),await F(h,e),E.get(e.id).node=e}else{const u=t.node(e.parentId);e.y+=S/2,l.info("A regular node XBX1 - using the padding",e.id,"parent",e.parentId,e.width,e.height,e.x,e.y,"offsetY",e.offsetY,"parent",u,u?.offsetY,e),R(e)}}));const b=S/2;return ne(t,b,{mergeSelfLoops:p}).forEach(function({edge:d,start:e,end:u}){l.info("Edge "+e+" -> "+u+": "+JSON.stringify(d),d),d.points.forEach(k=>k.y+=b);const x=t.node(e),N=t.node(u),M=z(a,d,E,g,x,N,y);K(d,M)}),t.nodes().forEach(function(d){const e=t.node(d);l.info(d,e.type,e.diff),e.isGroup&&(X=e.diff)}),l.warn("Returning from recursive render XAX",f,X),{elem:f,diff:X}},"recursiveRender"),ce=w(async(s,t)=>{const g=new Q({multigraph:!0,compound:!0}).setGraph({rankdir:s.direction,nodesep:s.config?.nodeSpacing||s.config?.flowchart?.nodeSpacing||s.nodeSpacing,ranksep:s.config?.rankSpacing||s.config?.flowchart?.rankSpacing||s.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),y=t.select("g");v(y,s.markers,s.type,s.diagramId),D(),H(),Y(),O(),s.nodes.forEach(o=>{g.setNode(o.id,{...o}),o.parentId&&g.setParent(o.id,o.parentId)}),l.debug("Edges:",s.edges),s.edges.forEach(o=>{if(o.start===o.end){const r=o.start,f=r+"---"+r+"---1",h=r+"---"+r+"---2",a=g.node(r);g.setNode(f,{domId:f,id:f,parentId:a.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),g.setParent(f,a.parentId),g.setNode(h,{domId:h,id:h,parentId:a.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),g.setParent(h,a.parentId);const i=structuredClone(o),n=structuredClone(o),p=structuredClone(o),m=structuredClone(o);n.originalEdge=i,n.selfLoop={id:i.id,order:0},p.originalEdge=i,p.selfLoop={id:i.id,order:1},m.originalEdge=i,m.selfLoop={id:i.id,order:2},n.label="",n.arrowTypeEnd="none",n.endLabelLeft="",n.endLabelRight="",n.startLabelLeft="",n.id=r+"-cyclic-special-1",p.startLabelRight="",p.startLabelLeft="",p.endLabelLeft="",p.endLabelRight="",p.arrowTypeStart="none",p.arrowTypeEnd="none",p.id=r+"-cyclic-special-mid",m.label="",m.startLabelRight="",m.startLabelLeft="",m.arrowTypeStart="none",a.isGroup&&(n.fromCluster=r,m.toCluster=r),m.id=r+"-cyclic-special-2",m.arrowTypeStart="none",g.setEdge(r,f,n,r+"-cyclic-special-0"),g.setEdge(f,h,p,r+"-cyclic-special-1"),g.setEdge(h,r,m,r+"-cyclic-special-2")}else g.setEdge(o.start,o.end,{...o},o.id)}),l.warn("Graph at first:",JSON.stringify(I(g))),J(g),l.warn("Graph after XAX:",JSON.stringify(I(g)));const c=_();await T(y,g,s.type,s.diagramId,void 0,c)},"render");export{ne as getEdgesToRender,ce as render};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
|||
import{p as B}from"./chunk-JWPE2WC7-D24iyGyr.js";import{_ as b,B as u,F as $,e as C,l as m,b as S,a as D,o as T,p as z,g as F,s as P,z as E,D as A,q as W}from"./mermaid.core-DKNppTOJ.js";import{p as _}from"./cynefin-VYW2F7L2-D3UUATjS.js";import"./index-DusVyqlT.js";var N=A.packet,w=class{constructor(){this.packet=[],this.setAccTitle=S,this.getAccTitle=D,this.setDiagramTitle=T,this.getDiagramTitle=z,this.getAccDescription=F,this.setAccDescription=P}static{b(this,"PacketDB")}getConfig(){const t=u({...N,...E().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){W(),this.packet=[]}},L=1e4,M=b((t,e)=>{B(t,e);let r=-1,s=[],n=1;const{bitsPerRow:l}=e.getConfig();for(let{start:a,end:i,bits:d,label:c}of t.blocks){if(a!==void 0&&i!==void 0&&i<a)throw new Error(`Packet block ${a} - ${i} is invalid. End must be greater than start.`);if(a??=r+1,a!==r+1)throw new Error(`Packet block ${a} - ${i??a} is not contiguous. It should start from ${r+1}.`);if(d===0)throw new Error(`Packet block ${a} is invalid. Cannot have a zero bit field.`);for(i??=a+(d??1)-1,d??=i-a+1,r=i,m.debug(`Packet block ${a} - ${r} with label ${c}`);s.length<=l+1&&e.getPacket().length<L;){const[p,o]=Y({start:a,end:i,bits:d,label:c},n,l);if(s.push(p),p.end+1===n*l&&(e.pushWord(s),s=[],n++),!o)break;({start:a,end:i,bits:d,label:c}=o)}}e.pushWord(s)},"populate"),Y=b((t,e,r)=>{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const s=e*r-1,n=e*r;return[{start:t.start,end:s,label:t.label,bits:s-t.start},{start:n,end:t.end,label:t.label,bits:t.end-n}]},"getNextFittingBlock"),v={parser:{yy:void 0},parse:b(async t=>{const e=await _("packet",t),r=v.parser?.yy;if(!(r instanceof w))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");m.debug(e),M(e,r)},"parse")},I=b((t,e,r,s)=>{const n=s.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),o=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(o?0:a),k=d*c+2,f=$(e);f.attr("viewBox",`0 0 ${k} ${g}`),C(f,g,k,l.useMaxWidth);for(const[x,y]of p.entries())O(f,y,x,l);f.append("text").text(o).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),O=b((t,e,r,{rowHeight:s,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=t.append("g"),p=r*(s+l)+l;for(const o of e){const h=o.start%i*a+1,g=(o.end-o.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",s).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+s/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(o.label),!d)continue;const k=o.end===o.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(o.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(o.end)}},"drawWord"),j={draw:I},q={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},G=b(({packet:t}={})=>{const e=u(q,t);return`
|
||||
import{p as B}from"./chunk-JWPE2WC7-TZtJmqSP.js";import{_ as b,B as u,F as $,e as C,l as m,b as S,a as D,o as T,p as z,g as F,s as P,z as E,D as A,q as W}from"./mermaid.core-B_UcP3X_.js";import{p as _}from"./cynefin-VYW2F7L2-BnQdr27u.js";import"./index-BOtIzGLC.js";var N=A.packet,w=class{constructor(){this.packet=[],this.setAccTitle=S,this.getAccTitle=D,this.setDiagramTitle=T,this.getDiagramTitle=z,this.getAccDescription=F,this.setAccDescription=P}static{b(this,"PacketDB")}getConfig(){const t=u({...N,...E().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){W(),this.packet=[]}},L=1e4,M=b((t,e)=>{B(t,e);let r=-1,s=[],n=1;const{bitsPerRow:l}=e.getConfig();for(let{start:a,end:i,bits:d,label:c}of t.blocks){if(a!==void 0&&i!==void 0&&i<a)throw new Error(`Packet block ${a} - ${i} is invalid. End must be greater than start.`);if(a??=r+1,a!==r+1)throw new Error(`Packet block ${a} - ${i??a} is not contiguous. It should start from ${r+1}.`);if(d===0)throw new Error(`Packet block ${a} is invalid. Cannot have a zero bit field.`);for(i??=a+(d??1)-1,d??=i-a+1,r=i,m.debug(`Packet block ${a} - ${r} with label ${c}`);s.length<=l+1&&e.getPacket().length<L;){const[p,o]=Y({start:a,end:i,bits:d,label:c},n,l);if(s.push(p),p.end+1===n*l&&(e.pushWord(s),s=[],n++),!o)break;({start:a,end:i,bits:d,label:c}=o)}}e.pushWord(s)},"populate"),Y=b((t,e,r)=>{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const s=e*r-1,n=e*r;return[{start:t.start,end:s,label:t.label,bits:s-t.start},{start:n,end:t.end,label:t.label,bits:t.end-n}]},"getNextFittingBlock"),v={parser:{yy:void 0},parse:b(async t=>{const e=await _("packet",t),r=v.parser?.yy;if(!(r instanceof w))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");m.debug(e),M(e,r)},"parse")},I=b((t,e,r,s)=>{const n=s.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),o=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(o?0:a),k=d*c+2,f=$(e);f.attr("viewBox",`0 0 ${k} ${g}`),C(f,g,k,l.useMaxWidth);for(const[x,y]of p.entries())O(f,y,x,l);f.append("text").text(o).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),O=b((t,e,r,{rowHeight:s,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=t.append("g"),p=r*(s+l)+l;for(const o of e){const h=o.start%i*a+1,g=(o.end-o.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",s).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+s/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(o.label),!d)continue;const k=o.end===o.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(o.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(o.end)}},"drawWord"),j={draw:I},q={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},G=b(({packet:t}={})=>{const e=u(q,t);return`
|
||||
.packetByte {
|
||||
font-size: ${e.byteFontSize};
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import{I as X}from"./chunk-2Q5K7J3B-Df_GFe3n.js";import{p as O}from"./chunk-JWPE2WC7-D24iyGyr.js";import{o as G,b as Y,s as F,p as P,g as j,a as q,_ as f,B as A,l as D,F as Z,e as U,z as N,q as J,i as K,ai as Q,D as ee,aj as te}from"./mermaid.core-DKNppTOJ.js";import{p as ne}from"./cynefin-VYW2F7L2-D3UUATjS.js";import"./index-DusVyqlT.js";var E=/[─━│┃└┗├┣]/,S=/[└┗├┣]/,re=/[─━]/,V=/^[\s│┃]+$/,$=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,k=/^\s*%%/,ie=" ";function L(n){return n.some(e=>E.test(e))}f(L,"isBoxDrawingFormat");function _(n){for(const e of n){const t=S.exec(e);if(t?.index&&t.index>0)return t.index}return 4}f(_,"inferSegmentWidth");function M(n,e){return n.replace(/\bline\s+(\d+)\b/gi,(t,r)=>{const i=parseInt(r,10),a=e.get(i);return a?`line ${a}`:t})}f(M,"remapErrorLines");function R(n){const e=n.split(`
|
||||
import{I as X}from"./chunk-2Q5K7J3B-CMIj8h4B.js";import{p as O}from"./chunk-JWPE2WC7-TZtJmqSP.js";import{o as G,b as Y,s as F,p as P,g as j,a as q,_ as f,B as A,l as D,F as Z,e as U,z as N,q as J,i as K,ai as Q,D as ee,aj as te}from"./mermaid.core-B_UcP3X_.js";import{p as ne}from"./cynefin-VYW2F7L2-BnQdr27u.js";import"./index-BOtIzGLC.js";var E=/[─━│┃└┗├┣]/,S=/[└┗├┣]/,re=/[─━]/,V=/^[\s│┃]+$/,$=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,k=/^\s*%%/,ie=" ";function L(n){return n.some(e=>E.test(e))}f(L,"isBoxDrawingFormat");function _(n){for(const e of n){const t=S.exec(e);if(t?.index&&t.index>0)return t.index}return 4}f(_,"inferSegmentWidth");function M(n,e){return n.replace(/\bline\s+(\d+)\b/gi,(t,r)=>{const i=parseInt(r,10),a=e.get(i);return a?`line ${a}`:t})}f(M,"remapErrorLines");function R(n){const e=n.split(`
|
||||
`),t=new Map;let r=-1;for(const[s,o]of e.entries())if(o.trim()==="treeView-beta"){r=s;break}if(r===-1)return{text:n,lineMap:t};const i=[];for(let s=r+1;s<e.length;s++){const o=e[s];o.trim()===""||k.test(o)||$.test(o)||V.test(o)||i.push(o.replace(/\t/g," "))}if(!L(i))return{text:n,lineMap:t};const a=_(i),c=[];let l=0;for(let s=0;s<=r;s++)c.push(e[s]),l++,t.set(l,s+1);for(let s=r+1;s<e.length;s++){const o=e[s],h=o.trim(),p=s+1;if(h===""){c.push(o),l++,t.set(l,p);continue}if(k.test(o)){c.push(o),l++,t.set(l,p);continue}if($.test(o)){c.push(o),l++,t.set(l,p);continue}if(V.test(o))continue;const d=o.replace(/\t/g," "),w=S.exec(d);if(w?.index!==void 0){const g=w.index,m=Math.round(g/a)+1;let u=g+1;for(;u<d.length&&re.test(d[u]);)u++;for(;u<d.length&&d[u]===" ";)u++;const v=d.slice(u).trimEnd();if(!v)throw new Error(`Line ${p}: Empty node — expected a filename or directory name after the box-drawing prefix`);const W=ie.repeat(m);c.push(W+v),l++,t.set(l,p)}else{if(/^[\s─━│┃└┗├┣]+$/.test(d))continue;if(E.test(d))c.push(o),l++,t.set(l,p);else{if(/^\s+/.test(d))throw new Error(`Line ${p}: Unexpected indentation without box-drawing characters. In box-drawing format, use ├── or └── prefixes for indented nodes.`);c.push(o),l++,t.set(l,p)}}}return{text:c.join(`
|
||||
`),lineMap:t}}f(R,"preprocessBoxDrawing");var x=new X(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),oe=f(()=>{x.reset(),J()},"clear"),se=f(()=>x.records.stack[0],"getRoot"),ae=f(()=>x.records.cnt,"getCount"),ce=ee.treeView,le=f(()=>A(ce,N().treeView),"getConfig"),de=f((n,e,t,r,i,a)=>{for(;n<=x.records.stack[x.records.stack.length-1].level;)x.records.stack.pop();const c={id:x.records.cnt++,level:n,name:e,nodeType:t,icon:i,cssClass:r,description:a,children:[]};x.records.stack[x.records.stack.length-1].children.push(c),x.records.stack.push(c)},"addNode"),he={clear:oe,addNode:de,getRoot:se,getCount:ae,getConfig:le,getAccTitle:q,getAccDescription:j,getDiagramTitle:P,setAccDescription:F,setAccTitle:Y,setDiagramTitle:G},I=he,pe=f(n=>{O(n,I);for(const e of n.nodes){const t=typeof e.indent=="number"?e.indent:0;let r=e.name;const i=r.endsWith("/");i&&(r=r.slice(0,-1));const a=i?"directory":"file",c=e.classAnnotation||void 0,l=e.iconAnnotation,s=l!==void 0?l||"none":void 0,o=e.descAnnotation||void 0,h=o?K(o,N()):void 0;I.addNode(t,r,a,c,s,h)}},"populate"),fe={parse:f(async n=>{const{text:e,lineMap:t}=R(n);try{const r=await ne("treeView",e);D.debug(r),pe(r)}catch(r){throw t.size>0&&r instanceof Error&&(r.message=M(r.message,t)),r}},"parse")},b={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:'<path fill="currentColor" d="M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z"/>'},file:{body:'<path fill="currentColor" fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z" clip-rule="evenodd"/>'}}};function z(n,e){const t=e?.filenameIcons?.[n];if(t)return t;const r=n.lastIndexOf(".");if(r>0){const i=n.substring(r).toLowerCase(),a=e?.extensionIcons;return a?.[i]??a?.[i.slice(1)]}}f(z,"detectIcon");function C(n,e){return n.includes(":")?n:n in b.icons||!e?`${b.prefix}:${n}`:`${e}:${n}`}f(C,"qualifyIcon");function B(n,e){if(n.icon!=="none"){if(n.icon)return C(n.icon,e.defaultIconPack);if(e.showIcons){if(n.nodeType==="file"){const t=z(n.name,e);if(t==="none")return;if(t)return C(t,e.defaultIconPack)}return`${b.prefix}:${n.nodeType==="directory"?"folder":"file"}`}}}f(B,"getNodeIcon");te([{name:b.prefix,icons:b}]);var y=14,ge=4,ue=16,H=f((n,e)=>`tv-icon-${n}-${e.replace(/[^\w-]/g,"-")}`,"iconSymbolId"),we=f(async(n,e,t,r)=>{const i=new Set,a=f(s=>{const o=B(s,t);o&&i.add(o),s.children.forEach(a)},"collect");if(a(e),i.size===0)return;const c=await Promise.all([...i].map(async s=>({icon:s,svg:await Q(s,{height:y,width:y})}))),l=n.append("defs");for(const{icon:s,svg:o}of c)l.append("g").attr("id",H(r,s)).html(o)},"injectIconDefs"),me=f((n,e,t,r,i,a)=>{const c=r.append("g");let l="treeView-node-label";t.nodeType==="directory"&&(l+=" treeView-node-dir"),t.cssClass&&(l+=` ${t.cssClass}`);const s=y+ge,o=B(t,i),h=o!==void 0;o&&c.append("use").attr("xlink:href",`#${H(a,o)}`).attr("x",n+i.paddingX).attr("y",e+i.paddingY).attr("class","treeView-node-icon");const p=c.append("text").text(t.name).attr("dominant-baseline","middle").attr("class",l),{height:d,width:w}=p.node().getBBox(),g=d+i.paddingY*2,m=n+i.paddingX+(h?s:0);p.attr("x",m),p.attr("y",e+g/2);const u=m+w,v=w+i.paddingX*2+(h?s:0);return t.BBox={x:n,y:e,width:v,height:g},t.cssClass?.split(/\s+/).includes("highlight")&&c.insert("rect",":first-child").attr("x",n).attr("y",e+1).attr("width",0).attr("height",g-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:t,nodeGroup:c,labelRightEdge:u,centerY:e+g/2}},"positionLabel"),T=f((n,e,t,r,i,a)=>n.append("line").attr("x1",e).attr("y1",t).attr("x2",r).attr("y2",i).attr("stroke-width",a).attr("class","treeView-node-line"),"positionLine"),xe=f((n,e,t,r)=>{let i=0,a=0;const c=[],l=f((h,p,d,w)=>{const g=w*(d.rowIndent+d.paddingX),m=me(g,i,p,h,d,r);c.push(m);const{height:u,width:v}=p.BBox;T(h,g-d.rowIndent,i+u/2,g,i+u/2,d.lineThickness),a=Math.max(a,g+v),i+=u},"drawNode"),s=f((h,p=0)=>{l(n,h,t,p),h.children.forEach(m=>{s(m,p+1)});const{x:d,y:w,height:g}=h.BBox;if(h.children.length){const{y:m,height:u}=h.children[h.children.length-1].BBox;T(n,d+t.paddingX,w+g,d+t.paddingX,m+u/2+t.lineThickness/2,t.lineThickness)}},"processNode");s(e);const o=c.filter(h=>h.node.description);if(o.length>0){const p=Math.max(...c.map(d=>d.labelRightEdge))+ue;for(const d of o){const g=d.nodeGroup.append("text").text(d.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",p).attr("y",d.centerY).node().getBBox();a=Math.max(a,p+g.width+t.paddingX)}}for(const h of c)if(h.node.cssClass?.split(/\s+/).includes("highlight")){const p=h.nodeGroup.select(".treeView-highlight-bg");if(!p.empty()){const d=a-h.node.BBox.x+8;p.attr("width",d),a=Math.max(a,h.node.BBox.x+d+2)}}return{totalHeight:i,totalWidth:a}},"drawTree"),ve=f(async(n,e,t,r)=>{D.debug(`Rendering treeView diagram
|
||||
`+n);const i=r.db,a=i.getRoot(),c=i.getConfig(),l=Z(e);await we(l,a,c,e);const s=l.append("g");s.attr("class","tree-view");const{totalHeight:o,totalWidth:h}=xe(s,a,c,e);l.attr("viewBox",`-${c.lineThickness/2} 0 ${h} ${o}`),U(l,o,h,c.useMaxWidth)},"draw"),be={draw:ve},Ie=be,Ce={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},ye=f(({treeView:n})=>{const{labelFontSize:e,labelColor:t,lineColor:r,iconColor:i,descriptionColor:a,highlightBg:c,highlightStroke:l}=A(Ce,n);return`
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import{p as k}from"./chunk-JWPE2WC7-D24iyGyr.js";import{s as R,g as F,p as I,o as _,a as D,b as E,_ as c,F as z,q as P,B as y,z as C,D as G,l as B,W,e as V}from"./mermaid.core-DKNppTOJ.js";import{p as H}from"./cynefin-VYW2F7L2-D3UUATjS.js";import"./index-DusVyqlT.js";var m={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},w={axes:[],curves:[],options:m},x=structuredClone(w),j=G.radar,q=c(()=>y({...j,...C().radar}),"getConfig"),b=c(()=>x.axes,"getAxes"),N=c(()=>x.curves,"getCurves"),U=c(()=>x.options,"getOptions"),X=c(a=>{x.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Y=c(a=>{x.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:Z(t.entries)}))},"setCurves"),Z=c(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=b();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>s.axis?.$refText===e.name);if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),J=c(a=>{const t=a.reduce((e,r)=>(e[r.name]=r,e),{});x.options={showLegend:t.showLegend?.value??m.showLegend,ticks:t.ticks?.value??m.ticks,max:t.max?.value??m.max,min:t.min?.value??m.min,graticule:t.graticule?.value??m.graticule}},"setOptions"),K=c(()=>{P(),x=structuredClone(w)},"clear"),$={getAxes:b,getCurves:N,getOptions:U,setAxes:X,setCurves:Y,setOptions:J,getConfig:q,clear:K,setAccTitle:E,getAccTitle:D,setDiagramTitle:_,getDiagramTitle:I,getAccDescription:F,setAccDescription:R},Q=c(a=>{k(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),tt={parse:c(async a=>{const t=await H("radar",a);B.debug(t),Q(t)},"parse")},et=c((a,t,e,r)=>{const s=r.db,i=s.getAxes(),l=s.getCurves(),n=s.getOptions(),o=s.getConfig(),d=s.getDiagramTitle(),p=z(t),u=at(p,o),g=n.max??Math.max(...l.map(f=>Math.max(...f.entries))),h=n.min,v=Math.min(o.width,o.height)/2;rt(u,i,v,n.ticks,n.graticule),st(u,i,v,o),A(u,i,l,h,g,n.graticule,o),T(u,l,n.showLegend,o),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-o.height/2-o.marginTop)},"draw"),at=c((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return V(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),rt=c((a,t,e,r,s)=>{if(s==="circle")for(let i=0;i<r;i++){const l=e*(i+1)/r;a.append("circle").attr("r",l).attr("class","radarGraticule")}else if(s==="polygon"){const i=t.length;for(let l=0;l<r;l++){const n=e*(l+1)/r,o=t.map((d,p)=>{const u=2*p*Math.PI/i-Math.PI/2,g=n*Math.cos(u),h=n*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",o).attr("class","radarGraticule")}}},"drawGraticule"),st=c((a,t,e,r)=>{const s=t.length;for(let i=0;i<s;i++){const l=t[i].label,n=2*i*Math.PI/s-Math.PI/2,o=Math.cos(n),d=Math.sin(n);a.append("line").attr("x1",0).attr("y1",0).attr("x2",e*r.axisScaleFactor*o).attr("y2",e*r.axisScaleFactor*d).attr("class","radarAxisLine");const p=o>.01?"start":o<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",g=4;a.append("text").text(l).attr("x",e*r.axisLabelFactor*o+g*o).attr("y",e*r.axisLabelFactor*d+g*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function A(a,t,e,r,s,i,l){const n=t.length,o=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==n)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/n-Math.PI/2,f=M(g,r,s,o),S=f*Math.cos(v),O=f*Math.sin(v);return{x:S,y:O}});i==="circle"?a.append("path").attr("d",L(u,l.curveTension)).attr("class",`radarCurve-${p}`):i==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}c(A,"drawCurves");function M(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}c(M,"relativeRadius");function L(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s<e;s++){const i=a[(s-1+e)%e],l=a[s],n=a[(s+1)%e],o=a[(s+2)%e],d={x:l.x+(n.x-i.x)*t,y:l.y+(n.y-i.y)*t},p={x:n.x-(o.x-l.x)*t,y:n.y-(o.y-l.y)*t};r+=` C${d.x},${d.y} ${p.x},${p.y} ${n.x},${n.y}`}return`${r} Z`}c(L,"closedRoundCurve");function T(a,t,e,r){if(!e)return;const s=(r.width/2+r.marginRight)*3/4,i=-(r.height/2+r.marginTop)*3/4,l=20;t.forEach((n,o)=>{const d=a.append("g").attr("transform",`translate(${s}, ${i+o*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${o}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(n.label)})}c(T,"drawLegend");var nt={draw:et},ot=c((a,t)=>{let e="";for(let r=0;r<a.THEME_COLOR_LIMIT;r++){const s=a[`cScale${r}`];e+=`
|
||||
import{p as k}from"./chunk-JWPE2WC7-TZtJmqSP.js";import{s as R,g as F,p as I,o as _,a as D,b as E,_ as c,F as z,q as P,B as y,z as C,D as G,l as B,W,e as V}from"./mermaid.core-B_UcP3X_.js";import{p as H}from"./cynefin-VYW2F7L2-BnQdr27u.js";import"./index-BOtIzGLC.js";var m={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},w={axes:[],curves:[],options:m},x=structuredClone(w),j=G.radar,q=c(()=>y({...j,...C().radar}),"getConfig"),b=c(()=>x.axes,"getAxes"),N=c(()=>x.curves,"getCurves"),U=c(()=>x.options,"getOptions"),X=c(a=>{x.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Y=c(a=>{x.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:Z(t.entries)}))},"setCurves"),Z=c(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=b();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>s.axis?.$refText===e.name);if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),J=c(a=>{const t=a.reduce((e,r)=>(e[r.name]=r,e),{});x.options={showLegend:t.showLegend?.value??m.showLegend,ticks:t.ticks?.value??m.ticks,max:t.max?.value??m.max,min:t.min?.value??m.min,graticule:t.graticule?.value??m.graticule}},"setOptions"),K=c(()=>{P(),x=structuredClone(w)},"clear"),$={getAxes:b,getCurves:N,getOptions:U,setAxes:X,setCurves:Y,setOptions:J,getConfig:q,clear:K,setAccTitle:E,getAccTitle:D,setDiagramTitle:_,getDiagramTitle:I,getAccDescription:F,setAccDescription:R},Q=c(a=>{k(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),tt={parse:c(async a=>{const t=await H("radar",a);B.debug(t),Q(t)},"parse")},et=c((a,t,e,r)=>{const s=r.db,i=s.getAxes(),l=s.getCurves(),n=s.getOptions(),o=s.getConfig(),d=s.getDiagramTitle(),p=z(t),u=at(p,o),g=n.max??Math.max(...l.map(f=>Math.max(...f.entries))),h=n.min,v=Math.min(o.width,o.height)/2;rt(u,i,v,n.ticks,n.graticule),st(u,i,v,o),A(u,i,l,h,g,n.graticule,o),T(u,l,n.showLegend,o),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-o.height/2-o.marginTop)},"draw"),at=c((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return V(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),rt=c((a,t,e,r,s)=>{if(s==="circle")for(let i=0;i<r;i++){const l=e*(i+1)/r;a.append("circle").attr("r",l).attr("class","radarGraticule")}else if(s==="polygon"){const i=t.length;for(let l=0;l<r;l++){const n=e*(l+1)/r,o=t.map((d,p)=>{const u=2*p*Math.PI/i-Math.PI/2,g=n*Math.cos(u),h=n*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",o).attr("class","radarGraticule")}}},"drawGraticule"),st=c((a,t,e,r)=>{const s=t.length;for(let i=0;i<s;i++){const l=t[i].label,n=2*i*Math.PI/s-Math.PI/2,o=Math.cos(n),d=Math.sin(n);a.append("line").attr("x1",0).attr("y1",0).attr("x2",e*r.axisScaleFactor*o).attr("y2",e*r.axisScaleFactor*d).attr("class","radarAxisLine");const p=o>.01?"start":o<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",g=4;a.append("text").text(l).attr("x",e*r.axisLabelFactor*o+g*o).attr("y",e*r.axisLabelFactor*d+g*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function A(a,t,e,r,s,i,l){const n=t.length,o=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==n)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/n-Math.PI/2,f=M(g,r,s,o),S=f*Math.cos(v),O=f*Math.sin(v);return{x:S,y:O}});i==="circle"?a.append("path").attr("d",L(u,l.curveTension)).attr("class",`radarCurve-${p}`):i==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}c(A,"drawCurves");function M(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}c(M,"relativeRadius");function L(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s<e;s++){const i=a[(s-1+e)%e],l=a[s],n=a[(s+1)%e],o=a[(s+2)%e],d={x:l.x+(n.x-i.x)*t,y:l.y+(n.y-i.y)*t},p={x:n.x-(o.x-l.x)*t,y:n.y-(o.y-l.y)*t};r+=` C${d.x},${d.y} ${p.x},${p.y} ${n.x},${n.y}`}return`${r} Z`}c(L,"closedRoundCurve");function T(a,t,e,r){if(!e)return;const s=(r.width/2+r.marginRight)*3/4,i=-(r.height/2+r.marginTop)*3/4,l=20;t.forEach((n,o)=>{const d=a.append("g").attr("transform",`translate(${s}, ${i+o*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${o}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(n.label)})}c(T,"drawLegend");var nt={draw:et},ot=c((a,t)=>{let e="";for(let r=0;r<a.THEME_COLOR_LIMIT;r++){const s=a[`cScale${r}`];e+=`
|
||||
.radarCurve-${r} {
|
||||
color: ${s};
|
||||
fill: ${s};
|
||||
|
|
@ -1 +1 @@
|
|||
import{g as l,r as m,d as n}from"./chunk-MOJQB5TN-VIWv47K9.js";import{p}from"./chunk-JWPE2WC7-D24iyGyr.js";import{_ as t,l as o}from"./mermaid.core-DKNppTOJ.js";import{M as u,a as f}from"./cynefin-VYW2F7L2-D3UUATjS.js";import"./index-DusVyqlT.js";var c=f().RailroadEbnf.parser.LangiumParser,s=t(e=>{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),i=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},i(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),d=t(e=>e.postfixes.reduce((r,a)=>b(r,a),i(e.base)),"transformTerm"),y=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{p(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(y(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},R={parser:g,db:n,renderer:m,styles:l};export{R as diagram};
|
||||
import{g as l,r as m,d as n}from"./chunk-MOJQB5TN-m4Krf3Vn.js";import{p}from"./chunk-JWPE2WC7-TZtJmqSP.js";import{_ as t,l as o}from"./mermaid.core-B_UcP3X_.js";import{M as u,a as f}from"./cynefin-VYW2F7L2-BnQdr27u.js";import"./index-BOtIzGLC.js";var c=f().RailroadEbnf.parser.LangiumParser,s=t(e=>{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),i=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},i(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),d=t(e=>e.postfixes.reduce((r,a)=>b(r,a),i(e.base)),"transformTerm"),y=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{p(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(y(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},R={parser:g,db:n,renderer:m,styles:l};export{R as diagram};
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
|||
import{g as He}from"./chunk-5VM5RSS4-CUvXVaNK.js";import{g as Xe}from"./chunk-XXDRQBXY-DGdcv7YP.js";import{s as Qe}from"./chunk-VR4S4FIN-DN3fhyNm.js";import{_ as b,b6 as Ze,X as Oe,l as Z,c as g1,v as Je,x as $e,y as ie,b as et,s as tt,o as st,a as it,g as rt,p as at,k as nt,Y as ut,Z as ot,bp as lt,r as te,d as se,a5 as ct,q as ht,b9 as dt,t as pt}from"./mermaid.core-DKNppTOJ.js";import{f as ft}from"./chunk-32BRIVSS-BPgqH-Ub.js";import{c as gt}from"./channel-Dyw0qvA2.js";var bt="flowchart-",At=class{constructor(){this.vertexCounter=0,this.config=g1(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=et,this.setAccDescription=tt,this.setDiagramTitle=st,this.getAccTitle=it,this.getAccDescription=rt,this.getDiagramTitle=at,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{b(this,"FlowDB")}sanitizeText(e){return nt.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(const i of this.vertices.values())if(i.id===e)return this.diagramId?`${this.diagramId}-${i.domId}`:i.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,i,r,a,o,d,l={},A){if(!e||e.trim().length===0)return;let n;if(A!==void 0){let k;A.includes(`
|
||||
import{g as He}from"./chunk-5VM5RSS4-DxIYPYOn.js";import{g as Xe}from"./chunk-XXDRQBXY-AHUPVB2f.js";import{s as Qe}from"./chunk-VR4S4FIN-CYEgbtU1.js";import{_ as b,b6 as Ze,X as Oe,l as Z,c as g1,v as Je,x as $e,y as ie,b as et,s as tt,o as st,a as it,g as rt,p as at,k as nt,Y as ut,Z as ot,bp as lt,r as te,d as se,a5 as ct,q as ht,b9 as dt,t as pt}from"./mermaid.core-B_UcP3X_.js";import{f as ft}from"./chunk-32BRIVSS-D_mpvupa.js";import{c as gt}from"./channel-Bw0eTBly.js";var bt="flowchart-",At=class{constructor(){this.vertexCounter=0,this.config=g1(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=et,this.setAccDescription=tt,this.setDiagramTitle=st,this.getAccTitle=it,this.getAccDescription=rt,this.getDiagramTitle=at,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{b(this,"FlowDB")}sanitizeText(e){return nt.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(const i of this.vertices.values())if(i.id===e)return this.diagramId?`${this.diagramId}-${i.domId}`:i.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,i,r,a,o,d,l={},A){if(!e||e.trim().length===0)return;let n;if(A!==void 0){let k;A.includes(`
|
||||
`)?k=A+`
|
||||
`:k=`{
|
||||
`+A+`
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1142
apps/kimi-code/dist-web/assets/index-BOtIzGLC.js
Normal file
1142
apps/kimi-code/dist-web/assets/index-BOtIzGLC.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
32
apps/kimi-code/dist-web/assets/index-CYGRyXzg.css
Normal file
32
apps/kimi-code/dist-web/assets/index-CYGRyXzg.css
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1428
apps/kimi-code/dist-web/assets/index-jrcQVrPr.js
Normal file
1428
apps/kimi-code/dist-web/assets/index-jrcQVrPr.js
Normal file
File diff suppressed because one or more lines are too long
8
apps/kimi-code/dist-web/assets/index10-Bk1rSddE.js
Normal file
8
apps/kimi-code/dist-web/assets/index10-Bk1rSddE.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
apps/kimi-code/dist-web/assets/index5-Cn8mMRE9.js
Normal file
1
apps/kimi-code/dist-web/assets/index5-Cn8mMRE9.js
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -1 +0,0 @@
|
|||
import c from"./CodeBlockNode-BMkbTGvt.js";import{M as v,bl as g,aL as P,s as C,A as b,bJ as i,aY as d,av as k,a4 as x,ar as S,bk as T,q as O}from"./index-DusVyqlT.js";import"./safeRaf-DGuzXxDK.js";var H=Object.defineProperty,z=Object.defineProperties,j=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertySymbols,F=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable,m=(o,s,e)=>s in o?H(o,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[s]=e;const h=v({__name:"MarkdownCodeBlockNode",props:{node:{},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},darkTheme:{default:"vitesse-dark"},lightTheme:{default:"vitesse-light"},isDark:{type:Boolean,default:!1},isShowPreview:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},minWidth:{default:void 0},maxWidth:{default:void 0},showPreviewButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},showTooltips:{type:Boolean},autoScrollOnUpdate:{type:Boolean},autoScrollInitial:{type:Boolean},estimatedHeightPx:{},estimatedContentHeightPx:{},themes:{},langs:{},showHeader:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0}},emits:["previewCode","copy"],setup(o,{emit:s}){const e=o,p=s,w=c,f=g(),y=O(()=>{return t=((a,n)=>{for(var r in n||(n={}))F.call(n,r)&&m(a,r,n[r]);if(u)for(var r of u(n))W.call(n,r)&&m(a,r,n[r]);return a})({},f),l={node:e.node,loading:e.loading,stream:e.stream,darkTheme:e.darkTheme,lightTheme:e.lightTheme,isDark:e.isDark,isShowPreview:e.isShowPreview,enableFontSizeControl:e.enableFontSizeControl,minWidth:e.minWidth,maxWidth:e.maxWidth,themes:e.themes,showHeader:e.showHeader,showCopyButton:e.showCopyButton,showExpandButton:e.showExpandButton,showPreviewButton:e.showPreviewButton,showCollapseButton:e.showCollapseButton,showFontSizeButtons:e.showFontSizeButtons,showTooltips:e.showTooltips,estimatedHeightPx:e.estimatedHeightPx,estimatedContentHeightPx:e.estimatedContentHeightPx},z(t,j(l));var t,l});function B(t){p("previewCode",{type:t.artifactType,content:e.node.code,title:t.artifactTitle})}return(t,l)=>(P(),C(T(w),S(y.value,{onPreviewCode:B,onCopy:l[0]||(l[0]=a=>p("copy",a))}),b({_:2},[t.$slots["header-left"]?{name:"header-left",fn:i(()=>[d(t.$slots,"header-left")]),key:"0"}:void 0,t.$slots["header-right"]?{name:"header-right",fn:i(()=>[d(t.$slots,"header-right")]),key:"1"}:void 0,t.$slots.loading?{name:"loading",fn:i(a=>[d(t.$slots,"loading",k(x(a)))]),key:"2"}:void 0]),1040))}});h.install=o=>{o.component(h.__name,h)};export{h as default};
|
||||
File diff suppressed because one or more lines are too long
1
apps/kimi-code/dist-web/assets/index6-j0GEB-FX.js
Normal file
1
apps/kimi-code/dist-web/assets/index6-j0GEB-FX.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
import{bQ as A,M as K,a0 as W,bS as z,bT as C,aU as k,bU as I,bE as H,aD as P,az as V,aL as T,u as M,bb as X,s as q,bJ as j,v as B,aY as F,g as G,t as J,q as D,bV as Q,bW as Y,bX as Z}from"./index-BOtIzGLC.js";var N=(h,w,d)=>new Promise((y,e)=>{var _=o=>{try{t(d.next(o))}catch(i){e(i)}},s=o=>{try{t(d.throw(o))}catch(i){e(i)}},t=o=>o.done?y(o.value):Promise.resolve(o.value).then(_,s);t((d=d.apply(h,w)).next())});const ee=["data-markstream-mode","data-markstream-pending"],ne=["innerHTML"],ae={key:1,class:"math-inline math-inline--fallback"},le={class:"math-inline__loading",role:"status","aria-live":"polite"},L=A(K({__name:"MathInlineNode",props:{node:{}},setup(h){var w,d,y;const e=h,_=k(null),s=D(()=>e.node.markup==="$$"),t=D(()=>I(e.node.content)),o=((d=(w=W())==null?void 0:w.vnode.el)==null?void 0:d.nodeType)===1,i=(function(){if(!e.node.content)return{html:"",text:e.node.loading?"":e.node.raw,loading:e.node.loading};if(e.node.loading)return{html:"",text:"",loading:!0};const n=z();if(!n){const a=typeof window>"u"||o;return{html:"",text:a?e.node.raw:"",loading:!a}}try{const a=n.renderToString(t.value,{throwOnError:!1,displayMode:s.value});return C(t.value,s.value,a),{html:a,text:"",loading:!1}}catch{return{html:"",text:e.node.loading?"":e.node.raw,loading:e.node.loading}}})(),u=k(i.html),c=k(i.text);let b=!1,g=0,v=!1,m=null;const f=k(i.loading),x=k(!1);function E(n){n!=null&&n!==g||(x.value=!1)}function $(){return N(this,null,function*(){if(v)return;m&&(m.abort(),m=null);const n=++g;if(!e.node.content)return E(),u.value="",c.value=e.node.loading?"":e.node.raw,f.value=e.node.loading,void(b=!1);const a=new AbortController;m=a,x.value=!0,v||n!==g||a.signal.aborted?E(n):Q(t.value,s.value,{timeout:1500,waitTimeout:1500,maxRetries:8,signal:a.signal}).then(l=>{v||n!==g||(u.value=l,c.value="",f.value=!1,b=!0)}).catch(l=>N(null,null,function*(){if(v||n!==g)return;const p=l?.code||l?.name,U=p==="KATEX_DISABLED";if(p==="WORKER_INIT_ERROR"||l?.fallbackToRenderer||(p===Y||p==="WORKER_TIMEOUT")&&!e.node.loading){const S=yield Z();if(v||n!==g)return;if(S){try{const R=S.renderToString(t.value,{throwOnError:e.node.loading,displayMode:s.value});u.value=R,c.value="",f.value=!1,b=!0,C(t.value,s.value,R)}catch{}return}}if(U||!e.node.loading)return f.value=!1,u.value="",void(c.value=e.node.raw);b||(f.value=!0)})).finally(()=>{v||E(n)})})}i.html&&(b=!0);let r=null,O=`${I(e.node.content)}\0${(y=e.node.markup)!=null?y:""}\0${e.node.loading?"1":"0"}`;return H(()=>[e.node.content,e.node.loading,e.node.raw,e.node.markup],()=>{(function(){var n;const a=I(e.node.content),l=e.node.loading===!0,p=`${a}\0${(n=e.node.markup)!=null?n:""}\0${l?"1":"0"}`;if(p!==O){if(O=p,!l)return r!=null&&(clearTimeout(r),r=null),void $();r==null&&(r=setTimeout(()=>{r=null,$()},32))}})()}),P(()=>{u.value||$()}),V(()=>{v=!0,r!=null&&(clearTimeout(r),r=null),m&&(m.abort(),m=null)}),(n,a)=>(T(),M("span",{ref_key:"containerEl",ref:_,class:"math-inline-wrapper","data-markstream-math":"inline","data-markstream-mode":u.value?"katex":c.value?"fallback":"loading","data-markstream-pending":x.value?"true":void 0},[u.value?(T(),M("span",{key:0,class:"math-inline",innerHTML:u.value},null,8,ne)):c.value?(T(),M("span",ae,X(c.value),1)):f.value?(T(),q(G,{key:2,name:"table-node-fade"},{default:j(()=>[B("span",le,[F(n.$slots,"loading",{isLoading:f.value},()=>[a[0]||(a[0]=B("span",{class:"math-inline__spinner animate-spin","aria-hidden":"true"},null,-1)),a[1]||(a[1]=B("span",{class:"sr-only"},"Loading",-1))],!0)])]),_:3})):J("",!0)],8,ee))}}),[["__scopeId","data-v-73d5e320"]]);L.install=h=>{h.component(L.__name,L)};export{L as default};
|
||||
|
|
@ -1 +0,0 @@
|
|||
import{bQ as C,M as D,a0 as N,bS as U,bT as L,aU as h,bE as A,aD as K,az as W,aL as y,u as x,bb as z,s as H,bJ as P,v as M,aY as V,g as X,t as j,q as O,bU as q,bV as F,bW as J,bX as Q}from"./index-DusVyqlT.js";var S=(f,b,r)=>new Promise((e,k)=>{var i=l=>{try{p(r.next(l))}catch(t){k(t)}},d=l=>{try{p(r.throw(l))}catch(t){k(t)}},p=l=>l.done?e(l.value):Promise.resolve(l.value).then(i,d);p((r=r.apply(f,b)).next())});const Y=["data-markstream-mode","data-markstream-pending"],G=["innerHTML"],Z={key:1,class:"math-inline math-inline--fallback"},ee={class:"math-inline__loading",role:"status","aria-live":"polite"},R=C(D({__name:"MathInlineNode",props:{node:{}},setup(f){var b,r;const e=f,k=h(null),i=O(()=>e.node.markup==="$$"),d=O(()=>q(e.node.content)),p=((r=(b=N())==null?void 0:b.vnode.el)==null?void 0:r.nodeType)===1,l=(function(){if(!e.node.content)return{html:"",text:e.node.loading?"":e.node.raw,loading:e.node.loading};if(e.node.loading)return{html:"",text:"",loading:!0};const a=U();if(!a){const n=typeof window>"u"||p;return{html:"",text:n?e.node.raw:"",loading:!n}}try{const n=a.renderToString(d.value,{throwOnError:!1,displayMode:i.value});return L(d.value,i.value,n),{html:n,text:"",loading:!1}}catch{return{html:"",text:e.node.loading?"":e.node.raw,loading:e.node.loading}}})(),t=h(l.html),u=h(l.text);let g=!1,m=0,s=!1,c=null;const v=h(l.loading),_=h(!1);function T(a){a!=null&&a!==m||(_.value=!1)}function B(){return S(this,null,function*(){if(s)return;c&&(c.abort(),c=null);const a=++m;if(!e.node.content)return T(),t.value="",u.value=e.node.loading?"":e.node.raw,v.value=e.node.loading,void(g=!1);const n=new AbortController;c=n,_.value=!0,s||a!==m||n.signal.aborted?T(a):F(d.value,i.value,{timeout:1500,waitTimeout:1500,maxRetries:8,signal:n.signal}).then(o=>{s||a!==m||(t.value=o,u.value="",v.value=!1,g=!0)}).catch(o=>S(null,null,function*(){if(s||a!==m)return;const w=o?.code||o?.name,$=w==="KATEX_DISABLED";if(w==="WORKER_INIT_ERROR"||o?.fallbackToRenderer||(w===J||w==="WORKER_TIMEOUT")&&!e.node.loading){const I=yield Q();if(s||a!==m)return;if(I){try{const E=I.renderToString(d.value,{throwOnError:e.node.loading,displayMode:i.value});t.value=E,u.value="",v.value=!1,g=!0,L(d.value,i.value,E)}catch{}return}}if($||!e.node.loading)return v.value=!1,t.value="",void(u.value=e.node.raw);g||(v.value=!0)})).finally(()=>{s||T(a)})})}return l.html&&(g=!0),A(()=>[e.node.content,e.node.loading,e.node.raw,e.node.markup],()=>{B()}),K(()=>{t.value||B()}),W(()=>{s=!0,c&&(c.abort(),c=null)}),(a,n)=>(y(),x("span",{ref_key:"containerEl",ref:k,class:"math-inline-wrapper","data-markstream-math":"inline","data-markstream-mode":t.value?"katex":u.value?"fallback":"loading","data-markstream-pending":_.value?"true":void 0},[t.value?(y(),x("span",{key:0,class:"math-inline",innerHTML:t.value},null,8,G)):u.value?(y(),x("span",Z,z(u.value),1)):v.value?(y(),H(X,{key:2,name:"table-node-fade"},{default:P(()=>[M("span",ee,[V(a.$slots,"loading",{isLoading:v.value},()=>[n[0]||(n[0]=M("span",{class:"math-inline__spinner animate-spin","aria-hidden":"true"},null,-1)),n[1]||(n[1]=M("span",{class:"sr-only"},"Loading",-1))],!0)])]),_:3})):j("",!0)],8,Y))}}),[["__scopeId","data-v-6c556261"]]);R.install=f=>{f.component(R.__name,R)};export{R as default};
|
||||
2
apps/kimi-code/dist-web/assets/index8-DvUceGOQ.js
Normal file
2
apps/kimi-code/dist-web/assets/index8-DvUceGOQ.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
apps/kimi-code/dist-web/assets/index9-IShPpQOf.js
Normal file
1
apps/kimi-code/dist-web/assets/index9-IShPpQOf.js
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -1,2 +1,2 @@
|
|||
import{_ as a,l as s,F as o,e as i}from"./mermaid.core-DKNppTOJ.js";import{p as g}from"./cynefin-VYW2F7L2-D3UUATjS.js";import"./index-DusVyqlT.js";var p={parse:a(async r=>{const e=await g("info",r);s.debug(e)},"parse")},v={version:"11.16.0"},d=a(()=>v.version,"getVersion"),m={getVersion:d},c=a((r,e,n)=>{s.debug(`rendering info diagram
|
||||
import{_ as a,l as s,F as o,e as i}from"./mermaid.core-B_UcP3X_.js";import{p as g}from"./cynefin-VYW2F7L2-BnQdr27u.js";import"./index-BOtIzGLC.js";var p={parse:a(async r=>{const e=await g("info",r);s.debug(e)},"parse")},v={version:"11.16.0"},d=a(()=>v.version,"getVersion"),m={getVersion:d},c=a((r,e,n)=>{s.debug(`rendering info diagram
|
||||
`+r);const t=o(e);i(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${n}`)},"draw"),l={draw:c},b={parser:p,db:m,renderer:l};export{b as diagram};
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import{_ as l,c as lt,a1 as ct,F as ut,al as dt,q as yt,k as ft,o as et,a as pt,b as gt,g as kt,s as mt,p as wt,e as _t}from"./mermaid.core-DKNppTOJ.js";import"./index-DusVyqlT.js";var Q=(function(){var t=l(function(T,e,s,i){for(s=s||{},i=T.length;i--;s[T[i]]=e);return s},"o"),d=[1,4],n=[1,14],a=[1,12],o=[1,13],y=[6,7,8],p=[1,20],u=[1,18],m=[1,19],c=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],D={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:l(function(e,s,i,h,f,r,v){var w=r.length-1;switch(f){case 6:case 7:return h;case 15:h.addNode(r[w-1].length,r[w].trim());break;case 16:h.addNode(0,r[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:d},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:d},{6:n,7:[1,10],9:9,12:11,13:a,14:o},t(y,[2,3]),{1:[2,2]},t(y,[2,4]),t(y,[2,5]),{1:[2,6],6:n,12:15,13:a,14:o},{6:n,9:16,12:11,13:a,14:o},{6:p,7:u,10:17,11:m},t(c,[2,18],{14:[1,21]}),t(c,[2,16]),t(c,[2,17]),{6:p,7:u,10:22,11:m},{1:[2,7],6:n,12:15,13:a,14:o},t(k,[2,14],{7:g,11:_}),t(x,[2,8]),t(x,[2,9]),t(x,[2,10]),t(c,[2,15]),t(k,[2,13],{7:g,11:_}),t(x,[2,11]),t(x,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:l(function(e,s){if(s.recoverable)this.trace(e);else{var i=new Error(e);throw i.hash=s,i}},"parseError"),parse:l(function(e){var s=this,i=[0],h=[],f=[null],r=[],v=this.table,w="",I=0,$=0,L=2,A=1,C=r.slice.call(arguments,1),b=Object.create(this.lexer),S={yy:{}};for(var P in this.yy)Object.prototype.hasOwnProperty.call(this.yy,P)&&(S.yy[P]=this.yy[P]);b.setInput(e,S.yy),S.yy.lexer=b,S.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var R=b.yylloc;r.push(R);var H=b.options&&b.options.ranges;typeof S.yy.parseError=="function"?this.parseError=S.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function X(B){i.length=i.length-2*B,f.length=f.length-B,r.length=r.length-B}l(X,"popStack");function J(){var B;return B=h.pop()||b.lex()||A,typeof B!="number"&&(B instanceof Array&&(h=B,B=h.pop()),B=s.symbols_[B]||B),B}l(J,"lex");for(var M,F,N,Y,W={},G,V,tt,U;;){if(F=i[i.length-1],this.defaultActions[F]?N=this.defaultActions[F]:((M===null||typeof M>"u")&&(M=J()),N=v[F]&&v[F][M]),typeof N>"u"||!N.length||!N[0]){var q="";U=[];for(G in v[F])this.terminals_[G]&&G>L&&U.push("'"+this.terminals_[G]+"'");b.showPosition?q="Parse error on line "+(I+1)+`:
|
||||
import{_ as l,c as lt,a1 as ct,F as ut,al as dt,q as yt,k as ft,o as et,a as pt,b as gt,g as kt,s as mt,p as wt,e as _t}from"./mermaid.core-B_UcP3X_.js";import"./index-BOtIzGLC.js";var Q=(function(){var t=l(function(T,e,s,i){for(s=s||{},i=T.length;i--;s[T[i]]=e);return s},"o"),d=[1,4],n=[1,14],a=[1,12],o=[1,13],y=[6,7,8],p=[1,20],u=[1,18],m=[1,19],c=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],D={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:l(function(e,s,i,h,f,r,v){var w=r.length-1;switch(f){case 6:case 7:return h;case 15:h.addNode(r[w-1].length,r[w].trim());break;case 16:h.addNode(0,r[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:d},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:d},{6:n,7:[1,10],9:9,12:11,13:a,14:o},t(y,[2,3]),{1:[2,2]},t(y,[2,4]),t(y,[2,5]),{1:[2,6],6:n,12:15,13:a,14:o},{6:n,9:16,12:11,13:a,14:o},{6:p,7:u,10:17,11:m},t(c,[2,18],{14:[1,21]}),t(c,[2,16]),t(c,[2,17]),{6:p,7:u,10:22,11:m},{1:[2,7],6:n,12:15,13:a,14:o},t(k,[2,14],{7:g,11:_}),t(x,[2,8]),t(x,[2,9]),t(x,[2,10]),t(c,[2,15]),t(k,[2,13],{7:g,11:_}),t(x,[2,11]),t(x,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:l(function(e,s){if(s.recoverable)this.trace(e);else{var i=new Error(e);throw i.hash=s,i}},"parseError"),parse:l(function(e){var s=this,i=[0],h=[],f=[null],r=[],v=this.table,w="",I=0,$=0,L=2,A=1,C=r.slice.call(arguments,1),b=Object.create(this.lexer),S={yy:{}};for(var P in this.yy)Object.prototype.hasOwnProperty.call(this.yy,P)&&(S.yy[P]=this.yy[P]);b.setInput(e,S.yy),S.yy.lexer=b,S.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var R=b.yylloc;r.push(R);var H=b.options&&b.options.ranges;typeof S.yy.parseError=="function"?this.parseError=S.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function X(B){i.length=i.length-2*B,f.length=f.length-B,r.length=r.length-B}l(X,"popStack");function J(){var B;return B=h.pop()||b.lex()||A,typeof B!="number"&&(B instanceof Array&&(h=B,B=h.pop()),B=s.symbols_[B]||B),B}l(J,"lex");for(var M,F,N,Y,W={},G,V,tt,U;;){if(F=i[i.length-1],this.defaultActions[F]?N=this.defaultActions[F]:((M===null||typeof M>"u")&&(M=J()),N=v[F]&&v[F][M]),typeof N>"u"||!N.length||!N[0]){var q="";U=[];for(G in v[F])this.terminals_[G]&&G>L&&U.push("'"+this.terminals_[G]+"'");b.showPosition?q="Parse error on line "+(I+1)+`:
|
||||
`+b.showPosition()+`
|
||||
Expecting `+U.join(", ")+", got '"+(this.terminals_[M]||M)+"'":q="Parse error on line "+(I+1)+": Unexpected "+(M==A?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(q,{text:b.match,token:this.terminals_[M]||M,line:b.yylineno,loc:R,expected:U})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+F+", token: "+M);switch(N[0]){case 1:i.push(M),f.push(b.yytext),r.push(b.yylloc),i.push(N[1]),M=null,$=b.yyleng,w=b.yytext,I=b.yylineno,R=b.yylloc;break;case 2:if(V=this.productions_[N[1]][1],W.$=f[f.length-V],W._$={first_line:r[r.length-(V||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(V||1)].first_column,last_column:r[r.length-1].last_column},H&&(W._$.range=[r[r.length-(V||1)].range[0],r[r.length-1].range[1]]),Y=this.performAction.apply(W,[w,$,I,S.yy,N[1],f,r].concat(C)),typeof Y<"u")return Y;V&&(i=i.slice(0,-1*V*2),f=f.slice(0,-1*V),r=r.slice(0,-1*V)),i.push(this.productions_[N[1]][0]),f.push(W.$),r.push(W._$),tt=v[i[i.length-2]][i[i.length-1]],i.push(tt);break;case 3:return!0}}return!0},"parse")},O=(function(){var T={EOF:1,parseError:l(function(s,i){if(this.yy.parser)this.yy.parser.parseError(s,i);else throw new Error(s)},"parseError"),setInput:l(function(e,s){return this.yy=s||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:l(function(){var e=this._input[0];this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e;var s=e.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:l(function(e){var s=e.length,i=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var h=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var f=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===h.length?this.yylloc.first_column:0)+h[h.length-i.length].length-i[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
||||
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:l(function(e){this.unput(this.match.slice(e))},"less"),pastInput:l(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var e=this.pastInput(),s=new Array(e.length+1).join("-");return e+this.upcomingInput()+`
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import{g as gt}from"./chunk-5VM5RSS4-CUvXVaNK.js";import{a as mt,g as lt,h as xt,d as kt}from"./chunk-32BRIVSS-BPgqH-Ub.js";import{g as _t,s as vt,a as bt,b as wt,p as Tt,o as St,_ as s,c as R,d as X,e as $t,q as Mt}from"./mermaid.core-DKNppTOJ.js";import{d as it}from"./arc-CXuu1fyI.js";import"./index-DusVyqlT.js";var U=(function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,Q=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,z;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var H="";z=[];for(N in v[A])this.terminals_[N]&&N>yt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?H="Parse error on line "+(C+1)+`:
|
||||
import{g as gt}from"./chunk-5VM5RSS4-DxIYPYOn.js";import{a as mt,g as lt,h as xt,d as kt}from"./chunk-32BRIVSS-D_mpvupa.js";import{g as _t,s as vt,a as bt,b as wt,p as Tt,o as St,_ as s,c as R,d as X,e as $t,q as Mt}from"./mermaid.core-B_UcP3X_.js";import{d as it}from"./arc-CeSAjRC_.js";import"./index-BOtIzGLC.js";var U=(function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,Q=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,z;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var H="";z=[];for(N in v[A])this.terminals_[N]&&N>yt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?H="Parse error on line "+(C+1)+`:
|
||||
`+_.showPosition()+`
|
||||
Expecting `+z.join(", ")+", got '"+(this.terminals_[b]||b)+"'":H="Parse error on line "+(C+1)+": Unexpected "+(b==D?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(H,{text:_.match,token:this.terminals_[b]||b,line:_.yylineno,loc:Y,expected:z})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+A+", token: "+b);switch(T[0]){case 1:l.push(b),d.push(_.yytext),c.push(_.yylloc),l.push(T[1]),b=null,Q=_.yyleng,k=_.yytext,C=_.yylineno,Y=_.yylloc;break;case 2:if(M=this.productions_[T[1]][1],F.$=d[d.length-M],F._$={first_line:c[c.length-(M||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(M||1)].first_column,last_column:c[c.length-1].last_column},ft&&(F._$.range=[c[c.length-(M||1)].range[0],c[c.length-1].range[1]]),q=this.performAction.apply(F,[k,Q,C,I.yy,T[1],d,c].concat(dt)),typeof q<"u")return q;M&&(l=l.slice(0,-1*M*2),d=d.slice(0,-1*M),c=c.slice(0,-1*M)),l.push(this.productions_[T[1]][0]),d.push(F.$),c.push(F._$),et=v[l[l.length-2]][l[l.length-1]],l.push(et);break;case 3:return!0}}return!0},"parse")},m=(function(){var h={EOF:1,parseError:s(function(n,l){if(this.yy.parser)this.yy.parser.parseError(n,l);else throw new Error(n)},"parseError"),setInput:s(function(r,n){return this.yy=n||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:s(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var n=r.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:s(function(r){var n=r.length,l=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var d=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===y.length?this.yylloc.first_column:0)+y[y.length-l.length].length-l[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
||||
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:s(function(r){this.unput(this.match.slice(r))},"less"),pastInput:s(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var r=this.pastInput(),n=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import{_ as o,l as te,c as H,F as fe,af as ye,ag as be,ah as me,ad as _e,D as Y,i as j,Y as ke,Z as Ee,aa as Se,ab as ce,ac as le}from"./mermaid.core-DKNppTOJ.js";import{g as Ne}from"./chunk-5VM5RSS4-CUvXVaNK.js";import"./index-DusVyqlT.js";var $=(function(){var e=o(function(O,i,n,r){for(n=n||{},r=O.length;r--;n[O[r]]=i);return n},"o"),h=[1,4],p=[1,13],s=[1,12],d=[1,15],_=[1,16],m=[1,20],l=[1,19],D=[6,7,8],I=[1,26],g=[1,24],w=[1,25],k=[6,7,11],G=[1,31],N=[6,7,11,24],V=[1,6,13,16,17,20,23],f=[1,35],A=[1,36],L=[1,6,7,11,13,16,17,20,23],M=[1,38],T={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:o(function(i,n,r,a,u,t,U){var c=t.length-1;switch(u){case 6:case 7:return a;case 8:a.getLogger().trace("Stop NL ");break;case 9:a.getLogger().trace("Stop EOF ");break;case 11:a.getLogger().trace("Stop NL2 ");break;case 12:a.getLogger().trace("Stop EOF2 ");break;case 15:a.getLogger().info("Node: ",t[c-1].id),a.addNode(t[c-2].length,t[c-1].id,t[c-1].descr,t[c-1].type,t[c]);break;case 16:a.getLogger().info("Node: ",t[c].id),a.addNode(t[c-1].length,t[c].id,t[c].descr,t[c].type);break;case 17:a.getLogger().trace("Icon: ",t[c]),a.decorateNode({icon:t[c]});break;case 18:case 23:a.decorateNode({class:t[c]});break;case 19:a.getLogger().trace("SPACELIST");break;case 20:a.getLogger().trace("Node: ",t[c-1].id),a.addNode(0,t[c-1].id,t[c-1].descr,t[c-1].type,t[c]);break;case 21:a.getLogger().trace("Node: ",t[c].id),a.addNode(0,t[c].id,t[c].descr,t[c].type);break;case 22:a.decorateNode({icon:t[c]});break;case 27:a.getLogger().trace("node found ..",t[c-2]),this.$={id:t[c-1],descr:t[c-1],type:a.getType(t[c-2],t[c])};break;case 28:this.$={id:t[c],descr:t[c],type:0};break;case 29:a.getLogger().trace("node found ..",t[c-3]),this.$={id:t[c-3],descr:t[c-1],type:a.getType(t[c-2],t[c])};break;case 30:this.$=t[c-1]+t[c];break;case 31:this.$=t[c];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:p,7:[1,10],9:9,12:11,13:s,14:14,16:d,17:_,18:17,19:18,20:m,23:l},e(D,[2,3]),{1:[2,2]},e(D,[2,4]),e(D,[2,5]),{1:[2,6],6:p,12:21,13:s,14:14,16:d,17:_,18:17,19:18,20:m,23:l},{6:p,9:22,12:11,13:s,14:14,16:d,17:_,18:17,19:18,20:m,23:l},{6:I,7:g,10:23,11:w},e(k,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:m,23:l}),e(k,[2,19]),e(k,[2,21],{15:30,24:G}),e(k,[2,22]),e(k,[2,23]),e(N,[2,25]),e(N,[2,26]),e(N,[2,28],{20:[1,32]}),{21:[1,33]},{6:I,7:g,10:34,11:w},{1:[2,7],6:p,12:21,13:s,14:14,16:d,17:_,18:17,19:18,20:m,23:l},e(V,[2,14],{7:f,11:A}),e(L,[2,8]),e(L,[2,9]),e(L,[2,10]),e(k,[2,16],{15:37,24:G}),e(k,[2,17]),e(k,[2,18]),e(k,[2,20],{24:M}),e(N,[2,31]),{21:[1,39]},{22:[1,40]},e(V,[2,13],{7:f,11:A}),e(L,[2,11]),e(L,[2,12]),e(k,[2,15],{24:M}),e(N,[2,30]),{22:[1,41]},e(N,[2,27]),e(N,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(i,n){if(n.recoverable)this.trace(i);else{var r=new Error(i);throw r.hash=n,r}},"parseError"),parse:o(function(i){var n=this,r=[0],a=[],u=[null],t=[],U=this.table,c="",W=0,se=0,ue=2,re=1,ge=t.slice.call(arguments,1),b=Object.create(this.lexer),R={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(R.yy[J]=this.yy[J]);b.setInput(i,R.yy),R.yy.lexer=b,R.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var Z=b.yylloc;t.push(Z);var de=b.options&&b.options.ranges;typeof R.yy.parseError=="function"?this.parseError=R.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){r.length=r.length-2*S,u.length=u.length-S,t.length=t.length-S}o(pe,"popStack");function ae(){var S;return S=a.pop()||b.lex()||re,typeof S!="number"&&(S instanceof Array&&(a=S,S=a.pop()),S=n.symbols_[S]||S),S}o(ae,"lex");for(var E,P,x,q,F={},z,C,oe,X;;){if(P=r[r.length-1],this.defaultActions[P]?x=this.defaultActions[P]:((E===null||typeof E>"u")&&(E=ae()),x=U[P]&&U[P][E]),typeof x>"u"||!x.length||!x[0]){var Q="";X=[];for(z in U[P])this.terminals_[z]&&z>ue&&X.push("'"+this.terminals_[z]+"'");b.showPosition?Q="Parse error on line "+(W+1)+`:
|
||||
import{_ as o,l as te,c as H,F as fe,af as ye,ag as be,ah as me,ad as _e,D as Y,i as j,Y as ke,Z as Ee,aa as Se,ab as ce,ac as le}from"./mermaid.core-B_UcP3X_.js";import{g as Ne}from"./chunk-5VM5RSS4-DxIYPYOn.js";import"./index-BOtIzGLC.js";var $=(function(){var e=o(function(O,i,n,r){for(n=n||{},r=O.length;r--;n[O[r]]=i);return n},"o"),h=[1,4],p=[1,13],s=[1,12],d=[1,15],_=[1,16],m=[1,20],l=[1,19],D=[6,7,8],I=[1,26],g=[1,24],w=[1,25],k=[6,7,11],G=[1,31],N=[6,7,11,24],V=[1,6,13,16,17,20,23],f=[1,35],A=[1,36],L=[1,6,7,11,13,16,17,20,23],M=[1,38],T={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:o(function(i,n,r,a,u,t,U){var c=t.length-1;switch(u){case 6:case 7:return a;case 8:a.getLogger().trace("Stop NL ");break;case 9:a.getLogger().trace("Stop EOF ");break;case 11:a.getLogger().trace("Stop NL2 ");break;case 12:a.getLogger().trace("Stop EOF2 ");break;case 15:a.getLogger().info("Node: ",t[c-1].id),a.addNode(t[c-2].length,t[c-1].id,t[c-1].descr,t[c-1].type,t[c]);break;case 16:a.getLogger().info("Node: ",t[c].id),a.addNode(t[c-1].length,t[c].id,t[c].descr,t[c].type);break;case 17:a.getLogger().trace("Icon: ",t[c]),a.decorateNode({icon:t[c]});break;case 18:case 23:a.decorateNode({class:t[c]});break;case 19:a.getLogger().trace("SPACELIST");break;case 20:a.getLogger().trace("Node: ",t[c-1].id),a.addNode(0,t[c-1].id,t[c-1].descr,t[c-1].type,t[c]);break;case 21:a.getLogger().trace("Node: ",t[c].id),a.addNode(0,t[c].id,t[c].descr,t[c].type);break;case 22:a.decorateNode({icon:t[c]});break;case 27:a.getLogger().trace("node found ..",t[c-2]),this.$={id:t[c-1],descr:t[c-1],type:a.getType(t[c-2],t[c])};break;case 28:this.$={id:t[c],descr:t[c],type:0};break;case 29:a.getLogger().trace("node found ..",t[c-3]),this.$={id:t[c-3],descr:t[c-1],type:a.getType(t[c-2],t[c])};break;case 30:this.$=t[c-1]+t[c];break;case 31:this.$=t[c];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:p,7:[1,10],9:9,12:11,13:s,14:14,16:d,17:_,18:17,19:18,20:m,23:l},e(D,[2,3]),{1:[2,2]},e(D,[2,4]),e(D,[2,5]),{1:[2,6],6:p,12:21,13:s,14:14,16:d,17:_,18:17,19:18,20:m,23:l},{6:p,9:22,12:11,13:s,14:14,16:d,17:_,18:17,19:18,20:m,23:l},{6:I,7:g,10:23,11:w},e(k,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:m,23:l}),e(k,[2,19]),e(k,[2,21],{15:30,24:G}),e(k,[2,22]),e(k,[2,23]),e(N,[2,25]),e(N,[2,26]),e(N,[2,28],{20:[1,32]}),{21:[1,33]},{6:I,7:g,10:34,11:w},{1:[2,7],6:p,12:21,13:s,14:14,16:d,17:_,18:17,19:18,20:m,23:l},e(V,[2,14],{7:f,11:A}),e(L,[2,8]),e(L,[2,9]),e(L,[2,10]),e(k,[2,16],{15:37,24:G}),e(k,[2,17]),e(k,[2,18]),e(k,[2,20],{24:M}),e(N,[2,31]),{21:[1,39]},{22:[1,40]},e(V,[2,13],{7:f,11:A}),e(L,[2,11]),e(L,[2,12]),e(k,[2,15],{24:M}),e(N,[2,30]),{22:[1,41]},e(N,[2,27]),e(N,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(i,n){if(n.recoverable)this.trace(i);else{var r=new Error(i);throw r.hash=n,r}},"parseError"),parse:o(function(i){var n=this,r=[0],a=[],u=[null],t=[],U=this.table,c="",W=0,se=0,ue=2,re=1,ge=t.slice.call(arguments,1),b=Object.create(this.lexer),R={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(R.yy[J]=this.yy[J]);b.setInput(i,R.yy),R.yy.lexer=b,R.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var Z=b.yylloc;t.push(Z);var de=b.options&&b.options.ranges;typeof R.yy.parseError=="function"?this.parseError=R.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){r.length=r.length-2*S,u.length=u.length-S,t.length=t.length-S}o(pe,"popStack");function ae(){var S;return S=a.pop()||b.lex()||re,typeof S!="number"&&(S instanceof Array&&(a=S,S=a.pop()),S=n.symbols_[S]||S),S}o(ae,"lex");for(var E,P,x,q,F={},z,C,oe,X;;){if(P=r[r.length-1],this.defaultActions[P]?x=this.defaultActions[P]:((E===null||typeof E>"u")&&(E=ae()),x=U[P]&&U[P][E]),typeof x>"u"||!x.length||!x[0]){var Q="";X=[];for(z in U[P])this.terminals_[z]&&z>ue&&X.push("'"+this.terminals_[z]+"'");b.showPosition?Q="Parse error on line "+(W+1)+`:
|
||||
`+b.showPosition()+`
|
||||
Expecting `+X.join(", ")+", got '"+(this.terminals_[E]||E)+"'":Q="Parse error on line "+(W+1)+": Unexpected "+(E==re?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(Q,{text:b.match,token:this.terminals_[E]||E,line:b.yylineno,loc:Z,expected:X})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+E);switch(x[0]){case 1:r.push(E),u.push(b.yytext),t.push(b.yylloc),r.push(x[1]),E=null,se=b.yyleng,c=b.yytext,W=b.yylineno,Z=b.yylloc;break;case 2:if(C=this.productions_[x[1]][1],F.$=u[u.length-C],F._$={first_line:t[t.length-(C||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(C||1)].first_column,last_column:t[t.length-1].last_column},de&&(F._$.range=[t[t.length-(C||1)].range[0],t[t.length-1].range[1]]),q=this.performAction.apply(F,[c,se,W,R.yy,x[1],u,t].concat(ge)),typeof q<"u")return q;C&&(r=r.slice(0,-1*C*2),u=u.slice(0,-1*C),t=t.slice(0,-1*C)),r.push(this.productions_[x[1]][0]),u.push(F.$),t.push(F._$),oe=U[r[r.length-2]][r[r.length-1]],r.push(oe);break;case 3:return!0}}return!0},"parse")},K=(function(){var O={EOF:1,parseError:o(function(n,r){if(this.yy.parser)this.yy.parser.parseError(n,r);else throw new Error(n)},"parseError"),setInput:o(function(i,n){return this.yy=n||this.yy||{},this._input=i,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var n=i.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},"input"),unput:o(function(i){var n=i.length,r=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var a=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var u=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===a.length?this.yylloc.first_column:0)+a[a.length-r.length].length-r[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
||||
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(i){this.unput(this.match.slice(i))},"less"),pastInput:o(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var i=this.pastInput(),n=new Array(i.length+1).join("-");return i+this.upcomingInput()+`
|
||||
4
apps/kimi-code/dist-web/assets/layout-DcalC1b9.js
Normal file
4
apps/kimi-code/dist-web/assets/layout-DcalC1b9.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
7
apps/kimi-code/dist-web/assets/markstream-D5Q-JKRm.js
Normal file
7
apps/kimi-code/dist-web/assets/markstream-D5Q-JKRm.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
|||
import{g as oe}from"./chunk-XXDRQBXY-DGdcv7YP.js";import{s as ae}from"./chunk-VR4S4FIN-DN3fhyNm.js";import{_ as l,l as C,v as ce,x as le,z as he,D as G,c as B,i as F,b6 as de,aa as ge,ab as ue,ac as pe}from"./mermaid.core-DKNppTOJ.js";import"./index-DusVyqlT.js";const E=[];for(let e=0;e<256;++e)E.push((e+256).toString(16).slice(1));function fe(e,n=0){return(E[e[n+0]]+E[e[n+1]]+E[e[n+2]]+E[e[n+3]]+"-"+E[e[n+4]]+E[e[n+5]]+"-"+E[e[n+6]]+E[e[n+7]]+"-"+E[e[n+8]]+E[e[n+9]]+"-"+E[e[n+10]]+E[e[n+11]]+E[e[n+12]]+E[e[n+13]]+E[e[n+14]]+E[e[n+15]]).toLowerCase()}const me=new Uint8Array(16);function ye(){return crypto.getRandomValues(me)}function Ee(e,n,g){return crypto.randomUUID?crypto.randomUUID():_e(e)}function _e(e,n,g){e=e||{};const a=e.random??e.rng?.()??ye();if(a.length<16)throw new Error("Random bytes length must be >= 16");return a[6]=a[6]&15|64,a[8]=a[8]&63|128,fe(a)}var Y=(function(){var e=l(function(D,s,i,o){for(i=i||{},o=D.length;o--;i[D[o]]=s);return i},"o"),n=[1,4],g=[1,13],a=[1,12],t=[1,15],h=[1,16],f=[1,20],m=[1,19],_=[6,7,8],T=[1,26],I=[1,24],w=[1,25],d=[6,7,11],R=[1,6,13,15,16,19,22],q=[1,33],J=[1,34],A=[1,6,7,11,13,15,16,19,22],j={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:l(function(s,i,o,c,p,r,$){var u=r.length-1;switch(p){case 6:case 7:return c;case 8:c.getLogger().trace("Stop NL ");break;case 9:c.getLogger().trace("Stop EOF ");break;case 11:c.getLogger().trace("Stop NL2 ");break;case 12:c.getLogger().trace("Stop EOF2 ");break;case 15:c.getLogger().info("Node: ",r[u].id),c.addNode(r[u-1].length,r[u].id,r[u].descr,r[u].type);break;case 16:c.getLogger().trace("Icon: ",r[u]),c.decorateNode({icon:r[u]});break;case 17:case 21:c.decorateNode({class:r[u]});break;case 18:c.getLogger().trace("SPACELIST");break;case 19:c.getLogger().trace("Node: ",r[u].id),c.addNode(0,r[u].id,r[u].descr,r[u].type);break;case 20:c.decorateNode({icon:r[u]});break;case 25:c.getLogger().trace("node found ..",r[u-2]),this.$={id:r[u-1],descr:r[u-1],type:c.getType(r[u-2],r[u])};break;case 26:this.$={id:r[u],descr:r[u],type:c.nodeType.DEFAULT};break;case 27:c.getLogger().trace("node found ..",r[u-3]),this.$={id:r[u-3],descr:r[u-1],type:c.getType(r[u-2],r[u])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:g,7:[1,10],9:9,12:11,13:a,14:14,15:t,16:h,17:17,18:18,19:f,22:m},e(_,[2,3]),{1:[2,2]},e(_,[2,4]),e(_,[2,5]),{1:[2,6],6:g,12:21,13:a,14:14,15:t,16:h,17:17,18:18,19:f,22:m},{6:g,9:22,12:11,13:a,14:14,15:t,16:h,17:17,18:18,19:f,22:m},{6:T,7:I,10:23,11:w},e(d,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:f,22:m}),e(d,[2,18]),e(d,[2,19]),e(d,[2,20]),e(d,[2,21]),e(d,[2,23]),e(d,[2,24]),e(d,[2,26],{19:[1,30]}),{20:[1,31]},{6:T,7:I,10:32,11:w},{1:[2,7],6:g,12:21,13:a,14:14,15:t,16:h,17:17,18:18,19:f,22:m},e(R,[2,14],{7:q,11:J}),e(A,[2,8]),e(A,[2,9]),e(A,[2,10]),e(d,[2,15]),e(d,[2,16]),e(d,[2,17]),{20:[1,35]},{21:[1,36]},e(R,[2,13],{7:q,11:J}),e(A,[2,11]),e(A,[2,12]),{21:[1,37]},e(d,[2,25]),e(d,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:l(function(s,i){if(i.recoverable)this.trace(s);else{var o=new Error(s);throw o.hash=i,o}},"parseError"),parse:l(function(s){var i=this,o=[0],c=[],p=[null],r=[],$=this.table,u="",M=0,K=0,ne=2,Q=1,ie=r.slice.call(arguments,1),y=Object.create(this.lexer),L={yy:{}};for(var H in this.yy)Object.prototype.hasOwnProperty.call(this.yy,H)&&(L.yy[H]=this.yy[H]);y.setInput(s,L.yy),L.yy.lexer=y,L.yy.parser=this,typeof y.yylloc>"u"&&(y.yylloc={});var z=y.yylloc;r.push(z);var se=y.options&&y.options.ranges;typeof L.yy.parseError=="function"?this.parseError=L.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function re(k){o.length=o.length-2*k,p.length=p.length-k,r.length=r.length-k}l(re,"popStack");function Z(){var k;return k=c.pop()||y.lex()||Q,typeof k!="number"&&(k instanceof Array&&(c=k,k=c.pop()),k=i.symbols_[k]||k),k}l(Z,"lex");for(var b,v,S,W,O={},U,x,ee,V;;){if(v=o[o.length-1],this.defaultActions[v]?S=this.defaultActions[v]:((b===null||typeof b>"u")&&(b=Z()),S=$[v]&&$[v][b]),typeof S>"u"||!S.length||!S[0]){var X="";V=[];for(U in $[v])this.terminals_[U]&&U>ne&&V.push("'"+this.terminals_[U]+"'");y.showPosition?X="Parse error on line "+(M+1)+`:
|
||||
import{g as oe}from"./chunk-XXDRQBXY-AHUPVB2f.js";import{s as ae}from"./chunk-VR4S4FIN-CYEgbtU1.js";import{_ as l,l as C,v as ce,x as le,z as he,D as G,c as B,i as F,b6 as de,aa as ge,ab as ue,ac as pe}from"./mermaid.core-B_UcP3X_.js";import"./index-BOtIzGLC.js";const E=[];for(let e=0;e<256;++e)E.push((e+256).toString(16).slice(1));function fe(e,n=0){return(E[e[n+0]]+E[e[n+1]]+E[e[n+2]]+E[e[n+3]]+"-"+E[e[n+4]]+E[e[n+5]]+"-"+E[e[n+6]]+E[e[n+7]]+"-"+E[e[n+8]]+E[e[n+9]]+"-"+E[e[n+10]]+E[e[n+11]]+E[e[n+12]]+E[e[n+13]]+E[e[n+14]]+E[e[n+15]]).toLowerCase()}const me=new Uint8Array(16);function ye(){return crypto.getRandomValues(me)}function Ee(e,n,g){return crypto.randomUUID?crypto.randomUUID():_e(e)}function _e(e,n,g){e=e||{};const a=e.random??e.rng?.()??ye();if(a.length<16)throw new Error("Random bytes length must be >= 16");return a[6]=a[6]&15|64,a[8]=a[8]&63|128,fe(a)}var Y=(function(){var e=l(function(D,s,i,o){for(i=i||{},o=D.length;o--;i[D[o]]=s);return i},"o"),n=[1,4],g=[1,13],a=[1,12],t=[1,15],h=[1,16],f=[1,20],m=[1,19],_=[6,7,8],T=[1,26],I=[1,24],w=[1,25],d=[6,7,11],R=[1,6,13,15,16,19,22],q=[1,33],J=[1,34],A=[1,6,7,11,13,15,16,19,22],j={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:l(function(s,i,o,c,p,r,$){var u=r.length-1;switch(p){case 6:case 7:return c;case 8:c.getLogger().trace("Stop NL ");break;case 9:c.getLogger().trace("Stop EOF ");break;case 11:c.getLogger().trace("Stop NL2 ");break;case 12:c.getLogger().trace("Stop EOF2 ");break;case 15:c.getLogger().info("Node: ",r[u].id),c.addNode(r[u-1].length,r[u].id,r[u].descr,r[u].type);break;case 16:c.getLogger().trace("Icon: ",r[u]),c.decorateNode({icon:r[u]});break;case 17:case 21:c.decorateNode({class:r[u]});break;case 18:c.getLogger().trace("SPACELIST");break;case 19:c.getLogger().trace("Node: ",r[u].id),c.addNode(0,r[u].id,r[u].descr,r[u].type);break;case 20:c.decorateNode({icon:r[u]});break;case 25:c.getLogger().trace("node found ..",r[u-2]),this.$={id:r[u-1],descr:r[u-1],type:c.getType(r[u-2],r[u])};break;case 26:this.$={id:r[u],descr:r[u],type:c.nodeType.DEFAULT};break;case 27:c.getLogger().trace("node found ..",r[u-3]),this.$={id:r[u-3],descr:r[u-1],type:c.getType(r[u-2],r[u])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:g,7:[1,10],9:9,12:11,13:a,14:14,15:t,16:h,17:17,18:18,19:f,22:m},e(_,[2,3]),{1:[2,2]},e(_,[2,4]),e(_,[2,5]),{1:[2,6],6:g,12:21,13:a,14:14,15:t,16:h,17:17,18:18,19:f,22:m},{6:g,9:22,12:11,13:a,14:14,15:t,16:h,17:17,18:18,19:f,22:m},{6:T,7:I,10:23,11:w},e(d,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:f,22:m}),e(d,[2,18]),e(d,[2,19]),e(d,[2,20]),e(d,[2,21]),e(d,[2,23]),e(d,[2,24]),e(d,[2,26],{19:[1,30]}),{20:[1,31]},{6:T,7:I,10:32,11:w},{1:[2,7],6:g,12:21,13:a,14:14,15:t,16:h,17:17,18:18,19:f,22:m},e(R,[2,14],{7:q,11:J}),e(A,[2,8]),e(A,[2,9]),e(A,[2,10]),e(d,[2,15]),e(d,[2,16]),e(d,[2,17]),{20:[1,35]},{21:[1,36]},e(R,[2,13],{7:q,11:J}),e(A,[2,11]),e(A,[2,12]),{21:[1,37]},e(d,[2,25]),e(d,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:l(function(s,i){if(i.recoverable)this.trace(s);else{var o=new Error(s);throw o.hash=i,o}},"parseError"),parse:l(function(s){var i=this,o=[0],c=[],p=[null],r=[],$=this.table,u="",M=0,K=0,ne=2,Q=1,ie=r.slice.call(arguments,1),y=Object.create(this.lexer),L={yy:{}};for(var H in this.yy)Object.prototype.hasOwnProperty.call(this.yy,H)&&(L.yy[H]=this.yy[H]);y.setInput(s,L.yy),L.yy.lexer=y,L.yy.parser=this,typeof y.yylloc>"u"&&(y.yylloc={});var z=y.yylloc;r.push(z);var se=y.options&&y.options.ranges;typeof L.yy.parseError=="function"?this.parseError=L.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function re(k){o.length=o.length-2*k,p.length=p.length-k,r.length=r.length-k}l(re,"popStack");function Z(){var k;return k=c.pop()||y.lex()||Q,typeof k!="number"&&(k instanceof Array&&(c=k,k=c.pop()),k=i.symbols_[k]||k),k}l(Z,"lex");for(var b,v,S,W,O={},U,x,ee,V;;){if(v=o[o.length-1],this.defaultActions[v]?S=this.defaultActions[v]:((b===null||typeof b>"u")&&(b=Z()),S=$[v]&&$[v][b]),typeof S>"u"||!S.length||!S[0]){var X="";V=[];for(U in $[v])this.terminals_[U]&&U>ne&&V.push("'"+this.terminals_[U]+"'");y.showPosition?X="Parse error on line "+(M+1)+`:
|
||||
`+y.showPosition()+`
|
||||
Expecting `+V.join(", ")+", got '"+(this.terminals_[b]||b)+"'":X="Parse error on line "+(M+1)+": Unexpected "+(b==Q?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(X,{text:y.match,token:this.terminals_[b]||b,line:y.yylineno,loc:z,expected:V})}if(S[0]instanceof Array&&S.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+b);switch(S[0]){case 1:o.push(b),p.push(y.yytext),r.push(y.yylloc),o.push(S[1]),b=null,K=y.yyleng,u=y.yytext,M=y.yylineno,z=y.yylloc;break;case 2:if(x=this.productions_[S[1]][1],O.$=p[p.length-x],O._$={first_line:r[r.length-(x||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(x||1)].first_column,last_column:r[r.length-1].last_column},se&&(O._$.range=[r[r.length-(x||1)].range[0],r[r.length-1].range[1]]),W=this.performAction.apply(O,[u,K,M,L.yy,S[1],p,r].concat(ie)),typeof W<"u")return W;x&&(o=o.slice(0,-1*x*2),p=p.slice(0,-1*x),r=r.slice(0,-1*x)),o.push(this.productions_[S[1]][0]),p.push(O.$),r.push(O._$),ee=$[o[o.length-2]][o[o.length-1]],o.push(ee);break;case 3:return!0}}return!0},"parse")},te=(function(){var D={EOF:1,parseError:l(function(i,o){if(this.yy.parser)this.yy.parser.parseError(i,o);else throw new Error(i)},"parseError"),setInput:l(function(s,i){return this.yy=i||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:l(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var i=s.match(/(?:\r\n?|\n).*/g);return i?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:l(function(s){var i=s.length,o=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var c=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),o.length-1&&(this.yylineno-=o.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:o?(o.length===c.length?this.yylloc.first_column:0)+c[c.length-o.length].length-o[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
||||
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:l(function(s){this.unput(this.match.slice(s))},"less"),pastInput:l(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var s=this.pastInput(),i=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
|
||||
|
|
@ -1 +1 @@
|
|||
import{g as l,r as m,d as a}from"./chunk-MOJQB5TN-VIWv47K9.js";import{p}from"./chunk-JWPE2WC7-D24iyGyr.js";import{_ as t,l as o}from"./mermaid.core-DKNppTOJ.js";import{M as u,d as c}from"./cynefin-VYW2F7L2-D3UUATjS.js";import"./index-DusVyqlT.js";var f=c().RailroadPeg.parser.LangiumParser,i=t(e=>{const r=e.alternatives.map(d);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformOrderedChoice"),d=t(e=>{const r=e.elements.map(P);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),P=t(e=>{const r=g(e.suffix);return e.operator?{type:"special",text:e.operator==="&"?`&${s(r)}`:`!${s(r)}`}:r},"transformPrefix"),s=t(e=>{switch(e.type){case"terminal":return`"${e.value}"`;case"nonterminal":return e.name;case"special":return e.text;default:return"(...)"}},"nodeToLabel"),g=t(e=>{const r=v(e.primary);if(!e.operator)return r;switch(e.operator){case"?":return{type:"optional",element:r};case"*":return{type:"repetition",element:r,min:0,max:1/0};case"+":return{type:"repetition",element:r,min:1,max:1/0};default:throw new Error(`Unsupported PEG suffix operator: ${e.operator}`)}},"transformSuffix"),v=t(e=>{switch(e.$type){case"PegLiteral":return{type:"terminal",value:e.value};case"PegIdentifier":return{type:"nonterminal",name:e.name};case"PegGroup":return i(e.element);case"PegAny":return{type:"special",text:e.dot};default:throw new Error(`Unsupported PEG primary node: ${e.$type}`)}},"transformPrimary"),y=t(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=t(e=>{p(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(y(r)))},"populateDb"),b={parse:t(e=>{a.clear(),o.debug("[PEG Parser] Starting Langium parse");const r=f.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const n=r.value;o.debug("[PEG Parser] Parsed rules:",n.rules.length),h(n),o.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:a}},G={parser:b,db:a,renderer:m,styles:l};export{G as diagram};
|
||||
import{g as l,r as m,d as a}from"./chunk-MOJQB5TN-m4Krf3Vn.js";import{p}from"./chunk-JWPE2WC7-TZtJmqSP.js";import{_ as t,l as o}from"./mermaid.core-B_UcP3X_.js";import{M as u,d as c}from"./cynefin-VYW2F7L2-BnQdr27u.js";import"./index-BOtIzGLC.js";var f=c().RailroadPeg.parser.LangiumParser,i=t(e=>{const r=e.alternatives.map(d);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformOrderedChoice"),d=t(e=>{const r=e.elements.map(P);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),P=t(e=>{const r=g(e.suffix);return e.operator?{type:"special",text:e.operator==="&"?`&${s(r)}`:`!${s(r)}`}:r},"transformPrefix"),s=t(e=>{switch(e.type){case"terminal":return`"${e.value}"`;case"nonterminal":return e.name;case"special":return e.text;default:return"(...)"}},"nodeToLabel"),g=t(e=>{const r=v(e.primary);if(!e.operator)return r;switch(e.operator){case"?":return{type:"optional",element:r};case"*":return{type:"repetition",element:r,min:0,max:1/0};case"+":return{type:"repetition",element:r,min:1,max:1/0};default:throw new Error(`Unsupported PEG suffix operator: ${e.operator}`)}},"transformSuffix"),v=t(e=>{switch(e.$type){case"PegLiteral":return{type:"terminal",value:e.value};case"PegIdentifier":return{type:"nonterminal",name:e.name};case"PegGroup":return i(e.element);case"PegAny":return{type:"special",text:e.dot};default:throw new Error(`Unsupported PEG primary node: ${e.$type}`)}},"transformPrimary"),y=t(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=t(e=>{p(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(y(r)))},"populateDb"),b={parse:t(e=>{a.clear(),o.debug("[PEG Parser] Starting Langium parse");const r=f.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const n=r.value;o.debug("[PEG Parser] Parsed rules:",n.rules.length),h(n),o.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:a}},G={parser:b,db:a,renderer:m,styles:l};export{G as diagram};
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import{p as at}from"./chunk-JWPE2WC7-D24iyGyr.js";import{K as T,N as B,b5 as rt,g as nt,s as it,a as ot,b as st,p as lt,o as ct,_ as g,l as G,c as ut,B as dt,F as gt,a1 as pt,e as ht,q as ft,D as mt}from"./mermaid.core-DKNppTOJ.js";import{p as vt}from"./cynefin-VYW2F7L2-D3UUATjS.js";import{d as X}from"./arc-CXuu1fyI.js";import{o as xt}from"./ordinal-Cboi1Yqb.js";import"./index-DusVyqlT.js";import"./init-Gi6I4Gst.js";function St(t,n){return n<t?-1:n>t?1:n>=t?0:NaN}function yt(t){return t}function wt(){var t=yt,n=St,y=null,b=T(0),l=T(B),p=T(0);function i(e){var r,s=(e=rt(e)).length,h,w,$=0,f=new Array(s),o=new Array(s),D=+b.apply(this,arguments),E=Math.min(B,Math.max(-B,l.apply(this,arguments)-D)),k,F=Math.min(Math.abs(E)/s,p.apply(this,arguments)),u=F*(E<0?-1:1),A;for(r=0;r<s;++r)(A=o[f[r]=r]=+t(e[r],r,e))>0&&($+=A);for(n!=null?f.sort(function(M,m){return n(o[M],o[m])}):y!=null&&f.sort(function(M,m){return y(e[M],e[m])}),r=0,w=$?(E-s*u)/$:0;r<s;++r,D=k)h=f[r],A=o[h],k=D+(A>0?A*w:0)+u,o[h]={data:e[h],index:r,value:A,startAngle:D,endAngle:k,padAngle:F};return o}return i.value=function(e){return arguments.length?(t=typeof e=="function"?e:T(+e),i):t},i.sortValues=function(e){return arguments.length?(n=e,y=null,i):n},i.sort=function(e){return arguments.length?(y=e,n=null,i):y},i.startAngle=function(e){return arguments.length?(b=typeof e=="function"?e:T(+e),i):b},i.endAngle=function(e){return arguments.length?(l=typeof e=="function"?e:T(+e),i):l},i.padAngle=function(e){return arguments.length?(p=typeof e=="function"?e:T(+e),i):p},i}var At=mt.pie,I={sections:new Map,showData:!1},W=I.sections,V=I.showData,Ct=structuredClone(At),$t=g(()=>structuredClone(Ct),"getConfig"),Dt=g(()=>{W=new Map,V=I.showData,ft()},"clear"),Tt=g(({label:t,value:n})=>{if(n<0)throw new Error(`"${t}" has invalid value: ${n}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);W.has(t)||(W.set(t,n),G.debug(`added new section: ${t}, with value: ${n}`))},"addSection"),bt=g(()=>W,"getSections"),kt=g(t=>{V=t},"setShowData"),zt=g(()=>V,"getShowData"),Z={getConfig:$t,clear:Dt,setDiagramTitle:ct,getDiagramTitle:lt,setAccTitle:st,getAccTitle:ot,setAccDescription:it,getAccDescription:nt,addSection:Tt,getSections:bt,setShowData:kt,getShowData:zt},Et=g((t,n)=>{at(t,n),n.setShowData(t.showData),t.sections.map(n.addSection)},"populateDb"),Mt={parse:g(async t=>{const n=await vt("pie",t);G.debug(n),Et(n,Z)},"parse")},Rt=g(t=>`
|
||||
import{p as at}from"./chunk-JWPE2WC7-TZtJmqSP.js";import{K as T,N as B,b5 as rt,g as nt,s as it,a as ot,b as st,p as lt,o as ct,_ as g,l as G,c as ut,B as dt,F as gt,a1 as pt,e as ht,q as ft,D as mt}from"./mermaid.core-B_UcP3X_.js";import{p as vt}from"./cynefin-VYW2F7L2-BnQdr27u.js";import{d as X}from"./arc-CeSAjRC_.js";import{o as xt}from"./ordinal-Cboi1Yqb.js";import"./index-BOtIzGLC.js";import"./init-Gi6I4Gst.js";function St(t,n){return n<t?-1:n>t?1:n>=t?0:NaN}function yt(t){return t}function wt(){var t=yt,n=St,y=null,b=T(0),l=T(B),p=T(0);function i(e){var r,s=(e=rt(e)).length,h,w,$=0,f=new Array(s),o=new Array(s),D=+b.apply(this,arguments),E=Math.min(B,Math.max(-B,l.apply(this,arguments)-D)),k,F=Math.min(Math.abs(E)/s,p.apply(this,arguments)),u=F*(E<0?-1:1),A;for(r=0;r<s;++r)(A=o[f[r]=r]=+t(e[r],r,e))>0&&($+=A);for(n!=null?f.sort(function(M,m){return n(o[M],o[m])}):y!=null&&f.sort(function(M,m){return y(e[M],e[m])}),r=0,w=$?(E-s*u)/$:0;r<s;++r,D=k)h=f[r],A=o[h],k=D+(A>0?A*w:0)+u,o[h]={data:e[h],index:r,value:A,startAngle:D,endAngle:k,padAngle:F};return o}return i.value=function(e){return arguments.length?(t=typeof e=="function"?e:T(+e),i):t},i.sortValues=function(e){return arguments.length?(n=e,y=null,i):n},i.sort=function(e){return arguments.length?(y=e,n=null,i):y},i.startAngle=function(e){return arguments.length?(b=typeof e=="function"?e:T(+e),i):b},i.endAngle=function(e){return arguments.length?(l=typeof e=="function"?e:T(+e),i):l},i.padAngle=function(e){return arguments.length?(p=typeof e=="function"?e:T(+e),i):p},i}var At=mt.pie,I={sections:new Map,showData:!1},W=I.sections,V=I.showData,Ct=structuredClone(At),$t=g(()=>structuredClone(Ct),"getConfig"),Dt=g(()=>{W=new Map,V=I.showData,ft()},"clear"),Tt=g(({label:t,value:n})=>{if(n<0)throw new Error(`"${t}" has invalid value: ${n}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);W.has(t)||(W.set(t,n),G.debug(`added new section: ${t}, with value: ${n}`))},"addSection"),bt=g(()=>W,"getSections"),kt=g(t=>{V=t},"setShowData"),zt=g(()=>V,"getShowData"),Z={getConfig:$t,clear:Dt,setDiagramTitle:ct,getDiagramTitle:lt,setAccTitle:st,getAccTitle:ot,setAccDescription:it,getAccDescription:nt,addSection:Tt,getSections:bt,setShowData:kt,getShowData:zt},Et=g((t,n)=>{at(t,n),n.setShowData(t.showData),t.sections.map(n.addSection)},"populateDb"),Mt={parse:g(async t=>{const n=await vt("pie",t);G.debug(n),Et(n,Z)},"parse")},Rt=g(t=>`
|
||||
.pieCircle{
|
||||
stroke: ${t.pieStrokeColor};
|
||||
stroke-width : ${t.pieStrokeWidth};
|
||||
|
|
@ -0,0 +1 @@
|
|||
function s(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:0}function d(e,t){var n;if(!e)return t;if(e.classList.contains("markstream-pre__diff-line--collapsed"))return 32;const i=e.querySelector(".markstream-pre__diff-content");return Math.max(t,Math.ceil((n=i?.getBoundingClientRect().height)!=null?n:0))}function c(e,t){const n=window.getComputedStyle(e),i=s(n.getPropertyValue("--markstream-pre-diff-line-height"))||s(n.lineHeight)||18,g=e.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line"),h=e.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line"),o=Array.from({length:Math.max(g.length,h.length)},(a,l)=>{var r,f;const m=d((r=g[l])!=null?r:null,i),u=d((f=h[l])!=null?f:null,i);return{rowHeight:Math.max(i,m,u),originalHeight:m,modifiedHeight:u}});return o.length===t.length&&o.every((a,l)=>{const r=t[l];return r&&Math.abs(a.rowHeight-r.rowHeight)<=.5&&Math.abs(a.originalHeight-r.originalHeight)<=.5&&Math.abs(a.modifiedHeight-r.modifiedHeight)<=.5})?t:o}export{c as measurePreCodeDiffLines};
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
import{g as s,r as l,d as t}from"./chunk-MOJQB5TN-VIWv47K9.js";import{p as m}from"./chunk-JWPE2WC7-D24iyGyr.js";import{_ as n,l as i}from"./mermaid.core-DKNppTOJ.js";import{M as p,c as u}from"./cynefin-VYW2F7L2-D3UUATjS.js";import"./index-DusVyqlT.js";var d=u().Railroad.parser.LangiumParser,a=n(e=>{switch(e.$type){case"RailroadTerminalExpr":return{type:"terminal",value:e.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:e.name};case"RailroadSpecialExpr":return{type:"special",text:e.text};case"RailroadSequenceExpr":{const r=e.elements.map(a);return r.length===1?r[0]:{type:"sequence",elements:r}}case"RailroadChoiceExpr":{const r=e.alternatives.map(a);return r.length===1?r[0]:{type:"choice",alternatives:r}}case"RailroadOptionalExpr":return{type:"optional",element:a(e.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:a(e.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:a(e.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${e.$type}`)}},"transformExpression"),c=n(e=>({name:e.name,definition:a(e.definition)}),"transformRule"),g=n(e=>{m(e,t),e.title&&t.setTitle(e.title),e.rules.map(r=>t.addRule(c(r)))},"populateDb"),y={parse:n(e=>{t.clear(),i.debug("[Railroad Parser] Starting Langium parse");const r=d.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new p(r);const o=r.value;i.debug("[Railroad Parser] Parsed rules:",o.rules.length),g(o),i.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:t}},x={parser:y,db:t,renderer:l,styles:s};export{x as diagram};
|
||||
import{g as s,r as l,d as t}from"./chunk-MOJQB5TN-m4Krf3Vn.js";import{p as m}from"./chunk-JWPE2WC7-TZtJmqSP.js";import{_ as n,l as i}from"./mermaid.core-B_UcP3X_.js";import{M as p,c as u}from"./cynefin-VYW2F7L2-BnQdr27u.js";import"./index-BOtIzGLC.js";var d=u().Railroad.parser.LangiumParser,a=n(e=>{switch(e.$type){case"RailroadTerminalExpr":return{type:"terminal",value:e.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:e.name};case"RailroadSpecialExpr":return{type:"special",text:e.text};case"RailroadSequenceExpr":{const r=e.elements.map(a);return r.length===1?r[0]:{type:"sequence",elements:r}}case"RailroadChoiceExpr":{const r=e.alternatives.map(a);return r.length===1?r[0]:{type:"choice",alternatives:r}}case"RailroadOptionalExpr":return{type:"optional",element:a(e.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:a(e.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:a(e.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${e.$type}`)}},"transformExpression"),c=n(e=>({name:e.name,definition:a(e.definition)}),"transformRule"),g=n(e=>{m(e,t),e.title&&t.setTitle(e.title),e.rules.map(r=>t.addRule(c(r)))},"populateDb"),y={parse:n(e=>{t.clear(),i.debug("[Railroad Parser] Starting Langium parse");const r=d.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new p(r);const o=r.value;i.debug("[Railroad Parser] Parsed rules:",o.rules.length),g(o),i.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:t}},x={parser:y,db:t,renderer:l,styles:s};export{x as diagram};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue