@retaw106/mmc-pi 1.2.3 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -29,9 +29,9 @@ Install the published package with Pi's own installer:
29
29
  pi install npm:@retaw106/mmc-pi
30
30
  ```
31
31
 
32
- This adds the extension to `~/.pi/agent/settings.json`. Then create the config file manually at `~/.pi/agent/mmc.jsonc` (see Configuration below) — the historian model is required, or no summarization ever happens.
32
+ This adds the extension to `~/.pi/agent/settings.json`. Then create the config at `~/.pi/agent/mmc.jsonc` (see Configuration below) — hand-write it, or run the package's interactive `config-init` command (below). The historian model is required, or no summarization ever happens.
33
33
 
34
- > There is no setup wizard and no `doctor` CLI in this fork. Configuration is a hand-edited `mmc.jsonc`; the upstream `npx … setup` / `doctor` commands do not exist here.
34
+ > 本 fork 没有上游的 `doctor` CLI(上游 `npx … setup` / `doctor` 在这里不存在)。mmc 各包自带 `config-init`(生成)与 `config-check`(只读自检)两个命令,随下一次发版以 npm bin 提供(当前 `latest` 尚未包含);命令不映射 `doctor`/`--force`,也不新增宿主命令(见 Configuration 节)。
35
35
 
36
36
  To build from the monorepo instead (requires Bun `>= 1.4.0`): point Pi's `packages` array at `packages/pi-plugin` and run `bun run build` before starting Pi — the host loads the prebuilt `dist`.
37
37
 
@@ -50,14 +50,31 @@ mmc reads the Pi host's own config (project overrides user):
50
50
  {
51
51
  "enabled": true,
52
52
  "historian": {
53
- "pi": {
54
- "model": "anthropic/claude-haiku-4-5"
55
- }
53
+ "model": "provider/your-model"
56
54
  }
57
55
  }
58
56
  ```
59
57
 
60
- For the full configuration reference, see `CONFIGURATION.md` in the monorepo root — OpenCode and Pi share the same schema (`assets/magic-context.schema.json`, regenerated by the plugin build).
58
+ `historian.model` is required (no default) and takes a `provider/model` ID; optional `fallback_models`, and Pi reads `thinking_level` (OpenCode reads `variant`). Replace the placeholder with a model available in your host.
59
+
60
+ For the full configuration reference, see `docs/guides/配置说明.md` in the monorepo — OpenCode and Pi share the same schema (`assets/magic-context.schema.json`, regenerated by the plugin build).
61
+
62
+ ### 生成与自检用户级配置(交互命令)
63
+
64
+ 两包各带两个交互命令,**随下一次发版以 npm bin 提供**(当前 `latest` 尚未包含);以单一 bin 分发、按子命令分派,裸命令打印帮助、未知子命令被拒绝:
65
+
66
+ ```sh
67
+ # Pi(本包)
68
+ npx @retaw106/mmc-pi@latest config-init # 生成首份用户级配置
69
+ npx @retaw106/mmc-pi@latest config-check # 只读自检(不写文件)
70
+ # OpenCode 2 侧的同一组命令在 @retaw106/mmc-oc 包内,用法相同
71
+ ```
72
+
73
+ 两个命令都**交互选择目标宿主**(OpenCode / Pi),只作用于所选宿主的**用户级**配置。`config-init` 按既有规则解析用户配置路径(Pi 固定 `~/.pi/agent/`),若目标已存在 `.jsonc`/`.json` 则提示退出、不改动已有文件。逐项询问语言、historian 主模型、`maintenance.enabled`、`compaction.enabled`、全局 `cache_ttl`、全局 `execute_threshold_percentage`:每项均可留空(不写入该项)。其中 historian 主模型留空即不配置历史摘要模型(摘要需之后配置模型才会启用);其余项留空沿用插件默认。只写显式设置项,产出带注释的精简 JSONC,预览确认后落盘;只涉及主模型,不含回退模型、reasoning、按模型映射或绝对 token 阈值。纯离线:不读凭据、不探测模型可调用性。`compaction.enabled=false` 只关闭 mmc 自身的上下文管理,**不会**自动启用宿主的原生压缩。
74
+
75
+ `config-check` 强制交互式终端;只读所选宿主的用户级配置,不读项目级配置、不检查安装或数据库、不写任何文件。它校验格式、字段值、`{env:VAR}`/`{file:path}` 外部引用与 `$schema`;未知字段**警告但不失败**;配置缺失视为正常(沿用默认值)。不可读、失效链接、语法错误、字段值错误或外部引用错误 → 退出码 1。退出码:`0`=无错误(可有警告),`1`=有错误或取消,`2`=非交互终端或用法错误。**不回显实际配置值。**
76
+
77
+ 从本仓源码运行(备选):构建后直接以 Node 运行入口,例如 `node packages/pi-plugin/dist/config-init.js`。
61
78
 
62
79
  ---
63
80