@calcit/procs 0.12.51 → 0.12.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.yarn/install-state.gz +0 -0
- package/README.md +1 -2
- package/RFCs/03-18-query-def-tree-show-chunked-display-plan.md +1 -1
- package/RFCs/07-06-semantic-tree-navigation-rfc.md +10 -10
- package/RFCs/07-26-agent-semantic-interface-roadmap-rfc.md +793 -0
- package/RFCs/README.md +2 -1
- package/editing-history/2026-02-23-2321-ns-imports-code-fixes.md +7 -7
- package/editing-history/2026-02-27-2200-split-def-command.md +3 -3
- package/editing-history/2026-02-27-2212-tree-raise-wrap.md +4 -4
- package/editing-history/2026-03-10-1040-edit-schema-primitive-tag-support.md +4 -4
- package/editing-history/2026-07-26-1220-to-js-data-options.md +14 -0
- package/editing-history/2026-07-26-1244-release-0.12.52.md +12 -0
- package/editing-history/2026-07-26-1313-cli-long-option-hints.md +14 -0
- package/editing-history/2026-07-26-1341-method-display-literals.md +5 -0
- package/editing-history/2026-07-26-2104-agent-semantic-interface-rfc.md +11 -0
- package/editing-history/2026-07-26-2107-static-analysis-agent-cli.md +30 -0
- package/editing-history/202607221613-remove-bundle-calcit-cli.md +7 -0
- package/editing-history/202607221944-replace-cr-sync-with-script.md +7 -0
- package/editing-history/20260728-1500-caps-module-status.md +17 -0
- package/editing-history/20260728-1501-release-0.12.53.md +6 -0
- package/editing-history/archived/2026-03-20-1229-query-window-3-with-parent-preview.md +5 -5
- package/editing-history/archived/2026-03-23-1137-command-echo-tool-output-cleanup.md +2 -2
- package/lib/calcit-data.d.mts +1 -1
- package/lib/calcit-data.mjs +39 -8
- package/lib/calcit.procs.d.mts +1 -0
- package/lib/package.json +3 -2
- package/package.json +3 -2
- package/ts-src/calcit-data.mts +40 -8
package/.yarn/install-state.gz
CHANGED
|
Binary file
|
package/README.md
CHANGED
|
@@ -40,12 +40,11 @@ Installed binaries:
|
|
|
40
40
|
- `calcit`, the runtime and js compiler
|
|
41
41
|
- `cr-wasm`, standalone WASM codegen tool
|
|
42
42
|
- `caps`, for downloading dependencies declared in `deps.cirru`
|
|
43
|
-
- `bundle_calcit`, bundle code for distribution
|
|
44
43
|
|
|
45
44
|
When installing from source, explicitly include both runners:
|
|
46
45
|
|
|
47
46
|
```bash
|
|
48
|
-
cargo install --path . --bin cr --bin cr-wasm --bin caps
|
|
47
|
+
cargo install --path . --bin cr --bin cr-wasm --bin caps
|
|
49
48
|
```
|
|
50
49
|
|
|
51
50
|
To use Calcit in GitHub Actions, try [setup-cr](https://github.com/calcit-lang/setup-cr).
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
## 1. 概要
|
|
10
10
|
|
|
11
|
-
当前 `cr tree` 系列编辑命令在定位子表达式时依赖纯数字点号路径(如
|
|
11
|
+
当前 `cr tree` 系列编辑命令在定位子表达式时依赖纯数字点号路径(如 `--path '0.3.2.1'`)。对于人类而言手动数坐标已经不方便,对于 LLM 而言更是结构性难题——LLM 在精确计数方面的可靠性与人类手动数行号相当。
|
|
12
12
|
|
|
13
13
|
本 RFC 提出 **四层互补方案**,从近到远逐步提升编辑体验:
|
|
14
14
|
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
```
|
|
38
38
|
1. cr tree show 'app.main/main!' → 查看代码结构
|
|
39
39
|
2. LLM 自己数目标表达式的坐标 → 容易数错
|
|
40
|
-
3. cr tree replace 'app.main/main!'
|
|
40
|
+
3. cr tree replace 'app.main/main!' --path '...' → 可能用错路径
|
|
41
41
|
4. 出错后重新数、重新试 → 迭代成本高
|
|
42
42
|
```
|
|
43
43
|
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
```
|
|
56
56
|
1. cr tree show 'app.main/main!' → 输出自动带路径注释
|
|
57
57
|
2. LLM 直接从注释中复制路径 → 不需要数
|
|
58
|
-
3. cr tree replace 'app.main/main!'
|
|
58
|
+
3. cr tree replace 'app.main/main!' --path '复制来的路径' ...
|
|
59
59
|
→ 一次成功
|
|
60
60
|
```
|
|
61
61
|
|
|
@@ -147,7 +147,7 @@ defn process (xs)
|
|
|
147
147
|
- `--path-annotations`:递归为所有嵌套 list 末尾追加注释(flag,无参数)
|
|
148
148
|
- 默认不追加任何注释节点,保持旧行为
|
|
149
149
|
- 当展示的节点子节点较多时,底部输出 tip 提示可开启 `--path-annotations` 或 `--chunked`
|
|
150
|
-
- 注释中的路径数字为相对于当前
|
|
150
|
+
- 注释中的路径数字为相对于当前 `--path` 定位 path 的索引
|
|
151
151
|
- 使用 dimmed 颜色渲染注释行,不干扰代码阅读
|
|
152
152
|
- 根节点的 path 为空字符串, 不用显示
|
|
153
153
|
- **末尾追加不改变索引**:注释节点是最后一个 child,不影响已有子节点的相对位置
|
|
@@ -422,13 +422,13 @@ cr tree search-replace 'app.main/main!' \
|
|
|
422
422
|
```bash
|
|
423
423
|
# 获取路径后用于后续编辑
|
|
424
424
|
PATH=$(cr query path 'app.main' --selector 'path heading def {} :name |init-fn $ nth 2')
|
|
425
|
-
cr tree replace 'app.main/main!'
|
|
425
|
+
cr tree replace 'app.main/main!' --path "$PATH" --code '...'
|
|
426
426
|
```
|
|
427
427
|
|
|
428
428
|
### 6.6 与现有路径的互操作
|
|
429
429
|
|
|
430
|
-
- `cr query path` 输出标准数字路径(如 `1.3.0`),可直接用于
|
|
431
|
-
- `--path-selector` 是
|
|
430
|
+
- `cr query path` 输出标准数字路径(如 `1.3.0`),可直接用于 `--path`
|
|
431
|
+
- `--path-selector` 是 `--path` 的超集替代,内部先解析为数字路径再执行
|
|
432
432
|
- 解析失败时给出明确错误信息(哪一步匹配失败、已匹配到的范围、剩余选择器是什么)
|
|
433
433
|
|
|
434
434
|
### 6.7 选择器语义对比
|
|
@@ -487,7 +487,7 @@ cr tree insert-after 'app.main/main!' \
|
|
|
487
487
|
|
|
488
488
|
### 7.4 锚点与路径的对比
|
|
489
489
|
|
|
490
|
-
| 特性 | 路径 (
|
|
490
|
+
| 特性 | 路径 (`--path '1.3.0'`) | 锚点 (`--anchor 'init-state'`) |
|
|
491
491
|
| ---------- | ---------------------- | ------------------------------ |
|
|
492
492
|
| 稳定性 | 编辑后可能失效 | 跟随代码移动,基本稳定 |
|
|
493
493
|
| 可读性 | 无意义数字 | 语义化名称 |
|
|
@@ -519,7 +519,7 @@ cr tree insert-after 'app.main/main!' \
|
|
|
519
519
|
|
|
520
520
|
- `path` 选择器解析器
|
|
521
521
|
- `cr query path` 命令
|
|
522
|
-
- `--path-selector` 替代
|
|
522
|
+
- `--path-selector` 替代 `--path` 的编辑命令集成
|
|
523
523
|
|
|
524
524
|
**预计工作量**:~5-7 天
|
|
525
525
|
**收益**:完整的语义化树形查询能力
|
|
@@ -540,7 +540,7 @@ cr tree insert-after 'app.main/main!' \
|
|
|
540
540
|
- 所有新参数均为 **opt-in**,现有行为完全保留
|
|
541
541
|
- `--path-annotations` 是 flag,默认关闭,传即开启
|
|
542
542
|
- `--chunked` 默认关闭,需手动开启
|
|
543
|
-
- `--pick` 和 `--path-selector` 与现有
|
|
543
|
+
- `--pick` 和 `--path-selector` 与现有 `--path` 互斥
|
|
544
544
|
- 锚点使用已有 `noted` macro,不引入新语法,对现有解析无影响
|
|
545
545
|
|
|
546
546
|
---
|