helloagents 3.0.15-beta.1 → 3.0.17-beta.1

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "helloagents",
3
- "version": "3.0.15-beta.1",
3
+ "version": "3.0.17-beta.1",
4
4
  "description": "HelloAGENTS — The orchestration kernel that makes any AI CLI smarter. Adds intelligent routing, quality verification (Ralph Loop), safety guards, and notifications.",
5
5
  "author": {
6
6
  "name": "HelloWind",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "helloagents",
3
- "version": "3.0.15-beta.1",
3
+ "version": "3.0.17-beta.1",
4
4
  "description": "HelloAGENTS — Quality-driven orchestration kernel for AI CLIs with intelligent routing, quality verification (Ralph Loop), safety guards, and notifications.",
5
5
  "author": {
6
6
  "name": "HelloWind",
package/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  **A workflow layer for AI coding CLIs: skills, project knowledge, delivery checks, safer config writes, and resumable execution.**
10
10
 
11
- [![Version](https://img.shields.io/badge/version-3.0.15-orange.svg)](./package.json)
11
+ [![Version](https://img.shields.io/badge/version-3.0.17-orange.svg)](./package.json)
12
12
  [![npm](https://img.shields.io/npm/v/helloagents.svg)](https://www.npmjs.com/package/helloagents)
13
13
  [![Node](https://img.shields.io/badge/node-%3E%3D18-339933.svg)](./package.json)
14
14
  [![Skills](https://img.shields.io/badge/skills-14-6366f1.svg)](./skills)
@@ -30,7 +30,7 @@
30
30
  ## Contents
31
31
 
32
32
  - [What HelloAGENTS Does](#what-helloagents-does)
33
- - [What Changed Since v3.0.12](#what-changed-since-v3012)
33
+ - [What Changed Since v3.0.16](#what-changed-since-v3016)
34
34
  - [Core Features](#core-features)
35
35
  - [Quick Start](#quick-start)
36
36
  - [CLI Management](#cli-management)
@@ -77,20 +77,15 @@ HelloAGENTS adds a workflow layer on top of Claude Code, Gemini CLI, and Codex C
77
77
  | Completion is vague | Natural language says “done” | Delivery checks use state, evidence, and verification |
78
78
  | Config writes are risky | CLI files can drift | Install, update, cleanup, and doctor flows check managed files |
79
79
 
80
- ## What Changed Since v3.0.12
80
+ ## What Changed Since v3.0.16
81
81
 
82
- These are the main user-visible changes in `v3.0.15`, compared with `v3.0.12`:
82
+ These are the main user-visible changes in `v3.0.17`, compared with `v3.0.16 beta`:
83
83
 
84
- - Install, update, uninstall, and branch switching now work through npm scripts and one-shot scripts, so host sync no longer depends on a stale `helloagents` executable during package updates.
85
- - Standby mode now reads from the stable runtime root `~/.helloagents/helloagents`; managed hooks use the `helloagents-js` entrypoint, and skills, templates, and runtime scripts no longer point at Node versioned global package paths.
86
- - Global mode now attempts Claude Code plugin and Gemini extension installation automatically, while Codex keeps using the managed local-plugin chain with marketplace and cache refresh.
87
- - Structured turn-state gating is stricter for `~auto` and `~loop`, so incomplete hand-offs must include concrete blocker evidence before the runtime accepts a pause.
88
- - Runtime state now uses session capsules under `.helloagents/sessions/<branch>/<session>/`, separating turn state, events, and delivery artifacts for concurrent CLI windows and worktrees.
89
- - Runtime state is written only when a workflow needs it, using the stable `helloagents-turn-state write --kind complete --role main` entrypoint instead of package script paths.
90
- - Codex standby refresh and cleanup preserve user-owned config content while refreshing managed carriers, local plugin files, marketplace entries, and doctor checks.
91
- - Output-format settings stay aligned across carriers and runtime injection, reducing cases where the final closeout layout is missed.
92
- - Debugging, testing, verification, and planning flows now include feedback loops, vertical-slice TDD, domain language, and AFK/HITL task markers while reusing the existing skills and templates.
93
- - Runtime prompts now use more consistent wording, and the docs explicitly state that AI CLI sessions must be restarted after reinstalling, refreshing, or switching modes.
84
+ - Managed host configuration now uses `helloagents-js.cmd` as the single stable entrypoint across Windows, macOS, and Linux.
85
+ - Codex `notify` now writes `notify = ["helloagents-js.cmd", "codex-notify"]`, so a synced `config.toml` no longer needs OS-specific command names.
86
+ - Claude Code and Gemini CLI standby hooks now use the same managed entrypoint as Codex, keeping host configuration wording and behavior consistent.
87
+ - The package exposes `helloagents-js.cmd` as an npm bin alias while keeping the runtime command path independent of Node global package locations.
88
+ - Runtime-root refresh now retries transient Windows filesystem rename errors, reducing occasional update/install failures when files are still being released.
94
89
 
95
90
  ## Core Features
96
91
 
@@ -116,7 +111,7 @@ HelloAGENTS includes 14 `hello-*` skills. They are loaded only when the current
116
111
  | `hello-reflect` | reusable lessons and knowledge updates |
117
112
 
118
113
  All UI work first follows the shared UI quality baseline.
119
- In activated projects or explicit UI workflows, `hello-ui` adds deeper design-contract execution, design-system mapping, and visual validation.
114
+ In global mode, activated projects, or explicit UI workflows, `hello-ui` adds deeper design-contract execution, design-system mapping, and visual validation on top of that baseline.
120
115
  When visual evidence is required, HelloAGENTS records it in the current session `artifacts/visual.json`.
121
116
 
122
117
  ### 2) Commands for different work styles
@@ -238,10 +233,10 @@ The CLI manages host files explicitly:
238
233
  npm install -g helloagents
239
234
  ```
240
235
 
241
- If another executable named `helloagents` already exists in your `PATH`, use the stable alias:
236
+ If another executable named `helloagents` already exists in your `PATH`, use the stable managed-entry alias:
242
237
 
243
238
  ```bash
244
- helloagents-js
239
+ helloagents-js.cmd
245
240
  ```
246
241
 
247
242
  By default, `postinstall` installs the package command, initializes `~/.helloagents/helloagents.json`, and syncs runtime files to `~/.helloagents/helloagents`. No host CLI is deployed unless you set `HELLOAGENTS=target[:mode]`, such as `HELLOAGENTS=codex:global`.
@@ -319,7 +314,7 @@ If you omit `--standby` or `--global`, HelloAGENTS first reuses the tracked/dete
319
314
 
320
315
  Use these when you do not want to depend on the `helloagents` binary being available during package updates. In `HELLOAGENTS=target[:mode]`, target can be `all`, `claude`, `gemini`, or `codex`; mode can be `standby` or `global`, and defaults to `standby`.
321
316
 
322
- Host configs use the stable `helloagents-js` entrypoint and runtime root `~/.helloagents/helloagents`, so Node global package paths can change without breaking managed hooks or Codex `notify`.
317
+ Host configs use the stable `helloagents-js.cmd` entrypoint and runtime root `~/.helloagents/helloagents`, so Node global package paths can change without breaking managed hooks or Codex `notify`. The same managed `config.toml` works across Windows, macOS, and Linux.
323
318
 
324
319
  #### npm commands
325
320
 
@@ -386,6 +381,9 @@ HELLOAGENTS=claude:standby HELLOAGENTS_ACTION=update curl -fsSL https://raw.gith
386
381
  # Switch branch
387
382
  HELLOAGENTS=all:global HELLOAGENTS_ACTION=switch-branch HELLOAGENTS_BRANCH=beta curl -fsSL https://raw.githubusercontent.com/hellowind777/helloagents/main/install.sh | sh
388
383
 
384
+ # Cleanup host integration without uninstalling the package
385
+ HELLOAGENTS=codex:standby HELLOAGENTS_ACTION=cleanup curl -fsSL https://raw.githubusercontent.com/hellowind777/helloagents/main/install.sh | sh
386
+
389
387
  # Uninstall
390
388
  HELLOAGENTS=gemini HELLOAGENTS_ACTION=uninstall curl -fsSL https://raw.githubusercontent.com/hellowind777/helloagents/main/install.sh | sh
391
389
  ```
@@ -402,6 +400,9 @@ $env:HELLOAGENTS="claude:standby"; $env:HELLOAGENTS_ACTION="update"; irm https:/
402
400
  # Switch branch
403
401
  $env:HELLOAGENTS="all:global"; $env:HELLOAGENTS_ACTION="switch-branch"; $env:HELLOAGENTS_BRANCH="beta"; irm https://raw.githubusercontent.com/hellowind777/helloagents/main/install.ps1 | iex
404
402
 
403
+ # Cleanup host integration without uninstalling the package
404
+ $env:HELLOAGENTS="codex:standby"; $env:HELLOAGENTS_ACTION="cleanup"; irm https://raw.githubusercontent.com/hellowind777/helloagents/main/install.ps1 | iex
405
+
405
406
  # Uninstall
406
407
  $env:HELLOAGENTS="gemini"; $env:HELLOAGENTS_ACTION="uninstall"; irm https://raw.githubusercontent.com/hellowind777/helloagents/main/install.ps1 | iex
407
408
  ```
@@ -561,8 +562,7 @@ UI work follows this priority:
561
562
 
562
563
  1. current `plan.md` or PRD UI decisions
563
564
  2. `.helloagents/DESIGN.md`
564
- 3. shared UI quality baseline
565
- 4. `hello-ui` implementation and validation rules
565
+ 3. `hello-ui` implementation and validation rules, together with the shared UI quality baseline
566
566
 
567
567
  For heavier UI work, `contract.json` can require:
568
568
 
@@ -589,7 +589,7 @@ Config file:
589
589
  ~/.helloagents/helloagents.json
590
590
  ```
591
591
 
592
- Default shape:
592
+ Default shape. `host_install_modes` is added when per-CLI modes are tracked:
593
593
 
594
594
  ```json
595
595
  {
@@ -601,7 +601,8 @@ Default shape:
601
601
  "kb_create_mode": 1,
602
602
  "project_store_mode": "local",
603
603
  "commit_attribution": "",
604
- "install_mode": "standby"
604
+ "install_mode": "standby",
605
+ "host_install_modes": {}
605
606
  }
606
607
  ```
607
608
 
@@ -616,6 +617,7 @@ Default shape:
616
617
  | `project_store_mode` | `"local"` | `local` or `repo-shared` |
617
618
  | `commit_attribution` | `""` | optional text appended to commit messages |
618
619
  | `install_mode` | `"standby"` | current default install mode |
620
+ | `host_install_modes` | `{}` | managed per-CLI mode map, such as `{ "codex": "standby" }`; used before falling back to `install_mode` |
619
621
 
620
622
  ## How Each CLI Is Integrated
621
623
 
@@ -639,7 +641,7 @@ Codex is rules-file driven by default.
639
641
 
640
642
  - standby writes `~/.codex/AGENTS.md`
641
643
  - standby writes a managed `model_instructions_file = "~/.codex/AGENTS.md"`
642
- - standby writes a managed `notify = ["helloagents-js", "codex-notify"]` command for closeout notification
644
+ - standby writes a managed `notify = ["helloagents-js.cmd", "codex-notify"]` command for closeout notification
643
645
  - standby creates `~/.codex/helloagents -> ~/.helloagents/helloagents`
644
646
  - global mode installs the native local-plugin chain
645
647
  - HelloAGENTS does not enable Codex hooks by default
@@ -665,6 +667,10 @@ The current test suite covers:
665
667
 
666
668
  ## FAQ
667
669
 
670
+ ### What is the role of `docs/`?
671
+
672
+ `docs/` is reference material for users and AI agents. It may lag behind implementation; runtime behavior is defined by source code, bootstrap files, skills, templates, and tests.
673
+
668
674
  ### Is this a CLI tool or a prompt framework?
669
675
 
670
676
  Both.
package/README_CN.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  **面向 AI 编码 CLI 的工作流层:技能、知识库、交付检查、更安全的配置写入,以及可恢复的执行流程。**
10
10
 
11
- [![Version](https://img.shields.io/badge/version-3.0.15-orange.svg)](./package.json)
11
+ [![Version](https://img.shields.io/badge/version-3.0.17-orange.svg)](./package.json)
12
12
  [![npm](https://img.shields.io/npm/v/helloagents.svg)](https://www.npmjs.com/package/helloagents)
13
13
  [![Node](https://img.shields.io/badge/node-%3E%3D18-339933.svg)](./package.json)
14
14
  [![Skills](https://img.shields.io/badge/skills-14-6366f1.svg)](./skills)
@@ -30,7 +30,7 @@
30
30
  ## 目录
31
31
 
32
32
  - [HelloAGENTS 做什么](#helloagents-做什么)
33
- - [相对 v3.0.12 的真实变化](#相对-v3012-的真实变化)
33
+ - [相对 v3.0.16 的真实变化](#相对-v3016-的真实变化)
34
34
  - [核心功能](#核心功能)
35
35
  - [快速开始](#快速开始)
36
36
  - [CLI 管理](#cli-管理)
@@ -77,20 +77,15 @@ HelloAGENTS 叠加在 Claude Code、Gemini CLI 和 Codex CLI 之上,帮助模
77
77
  | 完成态模糊 | 自然语言说“完成” | 按状态、证据和验证结果交付 |
78
78
  | 配置容易漂移 | CLI 文件可能不一致 | 安装、更新、清理和 doctor 会检查受管文件 |
79
79
 
80
- ## 相对 v3.0.12 的真实变化
80
+ ## 相对 v3.0.16 的真实变化
81
81
 
82
- 下面是当前 `v3.0.15` 相对 `v3.0.12` 的主要可见变化:
82
+ 下面是当前 `v3.0.17` 相对 `v3.0.16 beta` 的主要可见变化:
83
83
 
84
- - 安装、更新、卸载和切换分支支持通过 npm scripts 与一键脚本完成,更新过程中不再依赖可能已经失效的旧 `helloagents` 可执行文件。
85
- - 标准模式统一读取稳定运行根目录 `~/.helloagents/helloagents`,受管 hooks 使用 `helloagents-js` 入口,skills、templates 和运行时脚本不再指向带 Node 版本号的全局包路径。
86
- - 全局模式会自动尝试安装 Claude Code 插件和 Gemini 扩展;Codex 继续使用受管本地插件链路,并刷新 marketplace 与缓存副本。
87
- - `~auto` `~loop` 的结构化停顿门控更严格;流程确需暂停时,必须写明具体阻塞证据。
88
- - 运行态状态收敛到 `.helloagents/sessions/<branch>/<session>/` 下的会话胶囊,分别记录 turn-state、事件和交付证据,兼容多 CLI 窗口与多 worktree。
89
- - 仅在工作流需要运行时状态时,通过稳定入口 `helloagents-turn-state write --kind complete --role main` 写入,不再解析或拼接包内脚本路径。
90
- - Codex 标准模式刷新和清理会保留用户自有配置,同时更新受管 carrier、本地插件文件、marketplace 条目和 doctor 检查。
91
- - 输出格式配置在 carrier 与运行时注入中保持一致,减少收尾格式偶发不生效的问题。
92
- - 调试、测试、验证和规划流程补充反馈循环、垂直切片 TDD、领域语言和 AFK/HITL 任务标记,仍复用现有 skills 与模板体系。
93
- - 运行时提示统一为更自然的中文表述,并明确重装、刷新或切换模式后需要重启 AI CLI 或新开会话。
84
+ - 受管宿主配置统一使用 `helloagents-js.cmd` 作为 Windows、macOS 和 Linux 三端稳定入口。
85
+ - Codex `notify` 统一写入 `notify = ["helloagents-js.cmd", "codex-notify"]`,同步同一份 `config.toml` 时不再需要区分系统。
86
+ - Claude Code Gemini CLI 的标准模式 hooks 也使用同一受管入口,与 Codex 的配置行为和文档表述保持一致。
87
+ - npm 包新增 `helloagents-js.cmd` bin alias,同时保持运行命令不依赖 Node 全局包的实际安装路径。
88
+ - 稳定运行根目录刷新增加 Windows 临时文件系统重试,减少文件释放延迟导致的偶发更新/安装失败。
94
89
 
95
90
  ## 核心功能
96
91
 
@@ -116,7 +111,7 @@ HelloAGENTS 内置 14 个 `hello-*` 技能。技能只在当前阶段需要时
116
111
  | `hello-reflect` | 可复用经验和知识更新 |
117
112
 
118
113
  所有 UI 任务都会先受共享的 UI 质量基线约束。
119
- 在已激活项目或明确的 UI 工作流里,`hello-ui` 会进一步补充设计契约执行、设计系统映射与视觉验收。
114
+ 在全局模式、已激活项目或明确的 UI 工作流里,`hello-ui` 会在该基线之上补充设计契约执行、设计系统映射与视觉验收。
120
115
  当需要视觉证据时,HelloAGENTS 会写入当前会话的 `artifacts/visual.json`。
121
116
 
122
117
  ### 2)面向不同工作方式的命令
@@ -238,10 +233,10 @@ CLI 显式管理宿主文件:
238
233
  npm install -g helloagents
239
234
  ```
240
235
 
241
- 如果系统里已经有别的 `helloagents` 可执行文件,可以使用稳定别名:
236
+ 如果系统里已经有别的 `helloagents` 可执行文件,可以使用稳定的受管入口别名:
242
237
 
243
238
  ```bash
244
- helloagents-js
239
+ helloagents-js.cmd
245
240
  ```
246
241
 
247
242
  默认情况下,`postinstall` 会安装包命令、初始化 `~/.helloagents/helloagents.json`,并把运行时文件同步到 `~/.helloagents/helloagents`。如果希望 npm 在安装或更新后直接部署,设置 `HELLOAGENTS=目标[:模式]`,例如 `HELLOAGENTS=codex:global`。
@@ -319,7 +314,7 @@ helloagents doctor codex --json
319
314
 
320
315
  当你不想依赖更新过程中的 `helloagents` 可执行文件时,用 npm 或一键脚本。`HELLOAGENTS=目标[:模式]` 中,目标支持 `all`、`claude`、`gemini`、`codex`;模式支持 `standby`、`global`,省略时默认 `standby`。
321
316
 
322
- 宿主配置使用稳定的 `helloagents-js` 入口和运行根目录 `~/.helloagents/helloagents`,Node 全局包路径变化不会破坏受管 hooks 或 Codex `notify`。
317
+ 宿主配置使用稳定的 `helloagents-js.cmd` 入口和运行根目录 `~/.helloagents/helloagents`,Node 全局包路径变化不会破坏受管 hooks 或 Codex `notify`。同一份受管 `config.toml` 可在 Windows、macOS 和 Linux 之间同步。
323
318
 
324
319
  #### npm 命令
325
320
 
@@ -386,6 +381,9 @@ HELLOAGENTS=claude:standby HELLOAGENTS_ACTION=update curl -fsSL https://raw.gith
386
381
  # 切换分支
387
382
  HELLOAGENTS=all:global HELLOAGENTS_ACTION=switch-branch HELLOAGENTS_BRANCH=beta curl -fsSL https://raw.githubusercontent.com/hellowind777/helloagents/main/install.sh | sh
388
383
 
384
+ # 只清理宿主集成,不卸载包
385
+ HELLOAGENTS=codex:standby HELLOAGENTS_ACTION=cleanup curl -fsSL https://raw.githubusercontent.com/hellowind777/helloagents/main/install.sh | sh
386
+
389
387
  # 卸载
390
388
  HELLOAGENTS=gemini HELLOAGENTS_ACTION=uninstall curl -fsSL https://raw.githubusercontent.com/hellowind777/helloagents/main/install.sh | sh
391
389
  ```
@@ -402,6 +400,9 @@ $env:HELLOAGENTS="claude:standby"; $env:HELLOAGENTS_ACTION="update"; irm https:/
402
400
  # 切换分支
403
401
  $env:HELLOAGENTS="all:global"; $env:HELLOAGENTS_ACTION="switch-branch"; $env:HELLOAGENTS_BRANCH="beta"; irm https://raw.githubusercontent.com/hellowind777/helloagents/main/install.ps1 | iex
404
402
 
403
+ # 只清理宿主集成,不卸载包
404
+ $env:HELLOAGENTS="codex:standby"; $env:HELLOAGENTS_ACTION="cleanup"; irm https://raw.githubusercontent.com/hellowind777/helloagents/main/install.ps1 | iex
405
+
405
406
  # 卸载
406
407
  $env:HELLOAGENTS="gemini"; $env:HELLOAGENTS_ACTION="uninstall"; irm https://raw.githubusercontent.com/hellowind777/helloagents/main/install.ps1 | iex
407
408
  ```
@@ -439,7 +440,7 @@ npm uninstall -g helloagents
439
440
  |-----|----------|----------|
440
441
  | Claude Code | 原生插件安装 | 由 Claude Code 插件系统管理 |
441
442
  | Gemini CLI | 原生扩展安装 | 由 Gemini 扩展系统管理 |
442
- | Codex CLI | 原生本地插件链路 | `~/.agents/plugins/marketplace.json`、`~/plugins/helloagents/`、`~/.codex/plugins/cache/local-plugins/helloagents/local/`、`~/.codex/config.toml`、`~/.codex/helloagents -> ~/plugins/helloagents` |
443
+ | Codex CLI | 原生本地插件流程 | `~/.agents/plugins/marketplace.json`、`~/plugins/helloagents/`、`~/.codex/plugins/cache/local-plugins/helloagents/local/`、`~/.codex/config.toml`、`~/.codex/helloagents -> ~/plugins/helloagents` |
443
444
 
444
445
  全局模式下,HelloAGENTS 会自动尝试宿主原生命令。若宿主命令不可用,再手动执行:
445
446
 
@@ -563,8 +564,7 @@ UI 任务遵循以下优先级:
563
564
 
564
565
  1. 当前 `plan.md` 或 PRD 中的 UI 决策
565
566
  2. `.helloagents/DESIGN.md`
566
- 3. 共享 UI 质量基线
567
- 4. `hello-ui` 的实现和验收规则
567
+ 3. `hello-ui` 的实现和验收规则,与共享 UI 质量基线共同生效
568
568
 
569
569
  更重的 UI 任务可以通过 `contract.json` 要求:
570
570
 
@@ -591,7 +591,7 @@ UI 任务遵循以下优先级:
591
591
  ~/.helloagents/helloagents.json
592
592
  ```
593
593
 
594
- 默认结构:
594
+ 默认结构。`host_install_modes` 会在需要记录单个 CLI 模式时写入:
595
595
 
596
596
  ```json
597
597
  {
@@ -603,7 +603,8 @@ UI 任务遵循以下优先级:
603
603
  "kb_create_mode": 1,
604
604
  "project_store_mode": "local",
605
605
  "commit_attribution": "",
606
- "install_mode": "standby"
606
+ "install_mode": "standby",
607
+ "host_install_modes": {}
607
608
  }
608
609
  ```
609
610
 
@@ -618,6 +619,7 @@ UI 任务遵循以下优先级:
618
619
  | `project_store_mode` | `"local"` | `local` 或 `repo-shared` |
619
620
  | `commit_attribution` | `""` | 提交信息附加署名 |
620
621
  | `install_mode` | `"standby"` | 当前默认安装模式 |
622
+ | `host_install_modes` | `{}` | 受管的单 CLI 模式记录,如 `{ "codex": "standby" }`;优先于 `install_mode` |
621
623
 
622
624
  ## 各 CLI 集成方式
623
625
 
@@ -641,9 +643,9 @@ Codex 默认走规则文件驱动。
641
643
 
642
644
  - 标准模式写入 `~/.codex/AGENTS.md`
643
645
  - 标准模式写入受管 `model_instructions_file = "~/.codex/AGENTS.md"`
644
- - 标准模式写入受管 `notify = ["helloagents-js", "codex-notify"]` 命令用于收尾通知
646
+ - 标准模式写入受管 `notify = ["helloagents-js.cmd", "codex-notify"]` 命令用于收尾通知
645
647
  - 标准模式创建 `~/.codex/helloagents -> ~/.helloagents/helloagents`
646
- - 全局模式安装原生本地插件链路
648
+ - 全局模式安装原生本地插件流程
647
649
  - HelloAGENTS 默认不启用 Codex hooks
648
650
 
649
651
  ## 验证
@@ -667,6 +669,10 @@ npm test
667
669
 
668
670
  ## FAQ
669
671
 
672
+ ### `docs/` 的作用是什么?
673
+
674
+ `docs/` 只作为用户和 AI 理解项目的参考材料,可能滞后于实现。运行时行为以源码、bootstrap 文件、skills、templates 和测试为准。
675
+
670
676
  ### 这是 CLI 工具还是提示词框架?
671
677
 
672
678
  两者都是。
package/bootstrap-lite.md CHANGED
@@ -4,11 +4,10 @@
4
4
 
5
5
  ## 配置
6
6
  配置文件: ~/.helloagents/helloagents.json
7
- 如果当前上下文中已包含"当前用户设置"且包含本轮所需配置项,视为配置已完成读取,本轮直接复用。
8
- 否则,当本轮首次遇到受配置影响的行为时,再读取一次配置文件并复用本轮结果;不要为了展示、确认或同一结论重复读取。
9
- 输出格式判定属于受配置影响的行为;上下文没有"当前用户设置"时,最终收尾前必须读取一次该配置。
10
- 同一轮内对同一配置文件、模块、SKILL、模板只读取一次,后续直接复用已得结论,不要重复探测或重复读取同一路径。
11
- 在受限 CLI(如工作区限制导致家目录不可读)中,确需读取但失败时必须明确说明,并按默认值或当前已知设置执行;禁止静默回退或假装读取成功。
7
+ `output_language` 非空时,所有用户可见文本使用该语言;为空则跟随用户当前语言。
8
+ 会话级缓存优先:当前上下文已有"当前用户设置"、原始 JSON 或读取摘要,且覆盖所需配置项时,直接复用。
9
+ 仅在缺少所需项、用户要求刷新,或本轮修改后需要核验时读取;输出格式只在缺少 `output_format` 已知值时触发读取。
10
+ 同一会话内,同一路径的配置文件、模块、SKILL、模板只读一次并跨轮复用;读取失败必须明示,并按默认值或已知设置执行。
12
11
 
13
12
  ## 编码原则
14
13
  - 代码是唯一判断依据,文档与代码不一致时以代码为准
@@ -55,8 +54,8 @@
55
54
  - 项目已有技术栈、设计系统或方案包时必须遵循既有决策
56
55
 
57
56
  ### UI 质量基线(涉及视觉/交互任务时,全阶段生效)
58
- 任务涉及界面视觉、交互体验、页面结构、组件外观、信息呈现或设计需求时,统一遵循以下基线;适用于标准模式、标准模式+已激活项目与全局模式。
59
- 纯逻辑修复、纯文案修改、纯数据处理、纯后端实现等不涉及视觉/交互变化的任务,不触发本节;项目已有更高优先级的 UI 契约时,只用本节兜底,不得覆盖上层决策。
57
+ 任务涉及界面视觉、交互体验、页面结构、组件外观、信息呈现或设计需求时,统一遵循以下基线;适用于标准模式未激活项目、标准模式已激活项目与全局模式。
58
+ 纯逻辑修复、纯文案修改、纯数据处理、纯后端实现等不涉及视觉/交互变化的任务,不触发本节。本基线是最低质量线;已有 `plan.md` / PRD、`DESIGN.md` 或 `hello-ui` 约束时,与其共同生效,不覆盖上层决策。
60
59
 
61
60
  - 先判断本次视觉变更是延续既有风格、演进式优化还是探索性方案,再形成简短但明确的内部设计简报:界面目的、目标用户与场景、主要视口、情绪方向、记忆点;不得直接滑入泛化风格标签或模型默认审美
62
61
  - 已有项目优先复用现有组件、token、品牌资产、内容语气与交互模式;先建立最小设计系统:至少明确背景/表面/正文/弱化/强调/语义色,以及 display/headline/body/caption 等排版角色;缺少关键设计上下文时明确说明,不凭空发明视觉语言
@@ -207,7 +206,7 @@
207
206
  路径: {CWD}/.helloagents/
208
207
  所有文件的创建和更新必须按 templates/ 目录中对应模板的格式执行,不可自由发挥格式。
209
208
  说明:
210
- - `.helloagents/` 表示项目级存储路径,也是 standby 模式的激活信号
209
+ - `.helloagents/` 表示项目级存储路径,也是标准模式的项目激活信号
211
210
  - `state_path` 指向的状态文件、当前会话 `capsule.json`、`events.jsonl`、`artifacts/*.json`、`artifacts/loop-results.tsv` 等运行态文件始终保留在项目本地 `.helloagents/sessions/{branch}/{session}/`
212
211
  - `state_path` 是状态文件的唯一位置。宿主提供会话标识时,写入 `.helloagents/sessions/{branch}/{session}/STATE.md`;没有稳定会话标识时,写入 `.helloagents/sessions/{branch}/default/STATE.md`
213
212
  - 若 helloagents.json 中 `project_store_mode = "repo-shared"`,`context.md`、`guidelines.md`、`CHANGELOG.md`、`verify.yaml`、`DESIGN.md`、`modules/`、`plans/`、`archive/` 改按当前上下文中已注入的“当前项目存储”/“项目知识/方案目录”解析;未注入具体路径时,按当前存储模式自行解析,不要假定这些文件一定实际位于当前工作树中
package/bootstrap.md CHANGED
@@ -4,11 +4,10 @@
4
4
 
5
5
  ## 配置
6
6
  配置文件: ~/.helloagents/helloagents.json
7
- 如果当前上下文中已包含"当前用户设置"且包含本轮所需配置项,视为配置已完成读取,本轮直接复用。
8
- 否则,当本轮首次遇到受配置影响的行为时,再读取一次配置文件并复用本轮结果;不要为了展示、确认或同一结论重复读取。
9
- 输出格式判定属于受配置影响的行为;上下文没有"当前用户设置"时,最终收尾前必须读取一次该配置。
10
- 同一轮内对同一配置文件、模块、SKILL、模板只读取一次,后续直接复用已得结论,不要重复探测或重复读取同一路径。
11
- 在受限 CLI(如工作区限制导致家目录不可读)中,确需读取但失败时必须明确说明,并按默认值或当前已知设置执行;禁止静默回退或假装读取成功。
7
+ `output_language` 非空时,所有用户可见文本使用该语言;为空则跟随用户当前语言。
8
+ 会话级缓存优先:当前上下文已有"当前用户设置"、原始 JSON 或读取摘要,且覆盖所需配置项时,直接复用。
9
+ 仅在缺少所需项、用户要求刷新,或本轮修改后需要核验时读取;输出格式只在缺少 `output_format` 已知值时触发读取。
10
+ 同一会话内,同一路径的配置文件、模块、SKILL、模板只读一次并跨轮复用;读取失败必须明示,并按默认值或已知设置执行。
12
11
 
13
12
  ## 编码原则
14
13
  - 代码是唯一判断依据,文档与代码不一致时以代码为准
@@ -55,8 +54,8 @@
55
54
  - 项目已有技术栈、设计系统或方案包时必须遵循既有决策
56
55
 
57
56
  ### UI 质量基线(涉及视觉/交互任务时,全阶段生效)
58
- 任务涉及界面视觉、交互体验、页面结构、组件外观、信息呈现或设计需求时,统一遵循以下基线;适用于标准模式、标准模式+已激活项目与全局模式。
59
- 纯逻辑修复、纯文案修改、纯数据处理、纯后端实现等不涉及视觉/交互变化的任务,不触发本节;项目已有更高优先级的 UI 契约时,只用本节兜底,不得覆盖上层决策。
57
+ 任务涉及界面视觉、交互体验、页面结构、组件外观、信息呈现或设计需求时,统一遵循以下基线;适用于标准模式未激活项目、标准模式已激活项目与全局模式。
58
+ 纯逻辑修复、纯文案修改、纯数据处理、纯后端实现等不涉及视觉/交互变化的任务,不触发本节。本基线是最低质量线;已有 `plan.md` / PRD、`DESIGN.md` 或 `hello-ui` 约束时,与其共同生效,不覆盖上层决策。
60
59
 
61
60
  - 先判断本次视觉变更是延续既有风格、演进式优化还是探索性方案,再形成简短但明确的内部设计简报:界面目的、目标用户与场景、主要视口、情绪方向、记忆点;不得直接滑入泛化风格标签或模型默认审美
62
61
  - 已有项目优先复用现有组件、token、品牌资产、内容语气与交互模式;先建立最小设计系统:至少明确背景/表面/正文/弱化/强调/语义色,以及 display/headline/body/caption 等排版角色;缺少关键设计上下文时明确说明,不凭空发明视觉语言
@@ -276,7 +275,7 @@ hello-* 技能读取路径:`{HELLOAGENTS_READ_ROOT}/skills/{技能名}/SKILL.m
276
275
  路径: {CWD}/.helloagents/
277
276
  所有文件的创建和更新必须按 templates/ 目录中对应模板的格式执行,不可自由发挥格式。
278
277
  说明:
279
- - `.helloagents/` 表示项目级存储路径,也是 standby 模式的激活信号
278
+ - `.helloagents/` 表示项目级存储路径,也是标准模式的项目激活信号
280
279
  - `state_path` 指向的状态文件、当前会话 `capsule.json`、`events.jsonl`、`artifacts/*.json`、`artifacts/loop-results.tsv` 等运行态文件始终保留在项目本地 `.helloagents/sessions/{branch}/{session}/`
281
280
  - `state_path` 是状态文件的唯一位置。宿主提供会话标识时,写入 `.helloagents/sessions/{branch}/{session}/STATE.md`;没有稳定会话标识时,写入 `.helloagents/sessions/{branch}/default/STATE.md`
282
281
  - 若 helloagents.json 中 `project_store_mode = "repo-shared"`,`context.md`、`guidelines.md`、`CHANGELOG.md`、`verify.yaml`、`DESIGN.md`、`modules/`、`plans/`、`archive/` 改按当前上下文中已注入的“当前项目存储”/“项目知识/方案目录”解析;未注入具体路径时,按当前存储模式自行解析,不要假定这些文件一定实际位于当前工作树中
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "helloagents",
3
- "version": "3.0.15-beta.1",
3
+ "version": "3.0.17-beta.1",
4
4
  "description": "Quality-driven orchestration kernel for AI CLIs",
5
5
  "contextFileName": "bootstrap.md",
6
6
  "author": "HelloWind",
package/install.ps1 CHANGED
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # Environment:
4
4
  # HELLOAGENTS=all|claude|gemini|codex[:standby|global]
5
- # HELLOAGENTS_ACTION=install|update|uninstall|switch-branch|branch
5
+ # HELLOAGENTS_ACTION=install|update|cleanup|uninstall|switch-branch|branch
6
6
  # HELLOAGENTS_TARGET=all|claude|gemini|codex
7
7
  # HELLOAGENTS_MODE=standby|global
8
8
  # HELLOAGENTS_BRANCH=main|beta|...
@@ -97,6 +97,9 @@ switch ($Action) {
97
97
  }
98
98
  Sync-Hosts
99
99
  }
100
+ "cleanup" {
101
+ Cleanup-Hosts
102
+ }
100
103
  "switch-branch" {
101
104
  if (-not $Branch -and -not $env:HELLOAGENTS_PACKAGE) {
102
105
  throw "HELLOAGENTS_BRANCH or HELLOAGENTS_PACKAGE is required for switch-branch"
package/install.sh CHANGED
@@ -5,7 +5,7 @@ set -eu
5
5
  #
6
6
  # Environment:
7
7
  # HELLOAGENTS=all|claude|gemini|codex[:standby|global]
8
- # HELLOAGENTS_ACTION=install|update|uninstall|switch-branch|branch
8
+ # HELLOAGENTS_ACTION=install|update|cleanup|uninstall|switch-branch|branch
9
9
  # HELLOAGENTS_TARGET=all|claude|gemini|codex
10
10
  # HELLOAGENTS_MODE=standby|global
11
11
  # HELLOAGENTS_BRANCH=main|beta|...
@@ -97,6 +97,9 @@ case "$ACTION" in
97
97
  fi
98
98
  sync_hosts
99
99
  ;;
100
+ cleanup)
101
+ cleanup_hosts
102
+ ;;
100
103
  switch-branch|branch)
101
104
  if [ -z "$BRANCH" ] && [ -z "${HELLOAGENTS_PACKAGE:-}" ]; then
102
105
  echo "HELLOAGENTS_BRANCH or HELLOAGENTS_PACKAGE is required for switch-branch" >&2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "helloagents",
3
- "version": "3.0.15-beta.1",
3
+ "version": "3.0.17-beta.1",
4
4
  "type": "module",
5
5
  "description": "HelloAGENTS — The orchestration kernel that makes any AI CLI smarter. Adds intelligent routing, quality verification (Ralph Loop), safety guards, and notifications.",
6
6
  "author": "HelloWind",
@@ -13,6 +13,7 @@
13
13
  "bin": {
14
14
  "helloagents": "cli.mjs",
15
15
  "helloagents-js": "cli.mjs",
16
+ "helloagents-js.cmd": "cli.mjs",
16
17
  "helloagents-turn-state": "scripts/turn-state-cli.mjs"
17
18
  },
18
19
  "scripts": {
@@ -39,7 +39,7 @@ export function selectCapabilities({ cwd, skillName = '', options = {} }) {
39
39
  if (plan?.contract?.ui?.required || existsSync(getProjectDesignContractPath(cwd))) {
40
40
  capabilities.push({
41
41
  id: 'design-contract',
42
- description: `UI 契约:仅在 UI 场景按需读取当前 plan.md / prd/03-ui-design.md、${describeProjectStoreFile(cwd, 'DESIGN.md')} 与 hello-ui,不全局常驻。`,
42
+ description: `UI 契约:仅在 UI 场景按需读取当前 plan.md / prd/03-ui-design.md、${describeProjectStoreFile(cwd, 'DESIGN.md')} 与 hello-ui,并与 UI 质量基线共同生效。`,
43
43
  })
44
44
  }
45
45
  if (visualRequirement.required) {
@@ -7,7 +7,8 @@ import {
7
7
  export const CODEX_PLUGIN_CONFIG_HEADER = '[plugins."helloagents@local-plugins"]'
8
8
  export const CODEX_MANAGED_TOML_COMMENT = '# helloagents-managed'
9
9
  export const CODEX_MANAGED_MODEL_INSTRUCTIONS_PATH = '~/.codex/AGENTS.md'
10
- export const CODEX_MANAGED_NOTIFY_VALUE = '["helloagents-js", "codex-notify"]'
10
+ export const CODEX_MANAGED_NOTIFY_COMMAND = 'helloagents-js.cmd'
11
+ export const CODEX_MANAGED_NOTIFY_VALUE = `["${CODEX_MANAGED_NOTIFY_COMMAND}", "codex-notify"]`
11
12
 
12
13
  function normalizePath(value = '') {
13
14
  return String(value || '').replace(/\\/g, '/')
@@ -30,11 +31,7 @@ export function isManagedCodexModelInstruction(line = '') {
30
31
 
31
32
  export function isManagedCodexNotify(line = '') {
32
33
  const value = String(line || '').replace(/\\/g, '/')
33
- return value.includes(CODEX_MANAGED_TOML_COMMENT)
34
- || (
35
- value.includes('helloagents-js')
36
- && value.includes('codex-notify')
37
- )
34
+ return value.includes(CODEX_MANAGED_NOTIFY_VALUE)
38
35
  }
39
36
 
40
37
  export function isManagedCodexBackupInstruction(line = '') {
@@ -33,8 +33,9 @@ function runHostCommand(command, args) {
33
33
  }
34
34
 
35
35
  function buildNativeResult(result, successCN, successEN, manualCN, manualEN) {
36
- if (result.ok) return { noteCN: successCN, noteEN: successEN }
36
+ if (result.ok) return { ok: true, noteCN: successCN, noteEN: successEN }
37
37
  return {
38
+ ok: false,
38
39
  noteCN: `${manualCN}${result.output ? `;原因:${result.output}` : ''}`,
39
40
  noteEN: `${manualEN}${result.output ? `; reason: ${result.output}` : ''}`,
40
41
  }
@@ -64,6 +65,8 @@ function reportHostAction(runtime, action, host, mode, result = {}) {
64
65
  const isCleanup = action === 'cleanup' || action === 'uninstall'
65
66
  if (result.skipped) {
66
67
  console.log(runtime.msg(` - ${label} 未检测到,跳过`, ` - ${label} not detected, skipped`))
68
+ } else if (result.ok === false && !isCleanup) {
69
+ console.log(runtime.msg(` - ${label} 自动配置未完成`, ` - ${label} automatic setup did not complete`))
67
70
  } else if (isCleanup) {
68
71
  runtime.ok(runtime.msg(`${label} 已清理(${mode} 模式)`, `${label} cleaned (${mode} mode)`))
69
72
  } else if (mode === 'standby') {
@@ -151,24 +154,43 @@ function cleanupHostGlobal(runtime, host) {
151
154
  }
152
155
 
153
156
  function installStandby(runtime) {
154
- if (installClaudeStandby(runtime.home, runtime.pkgRoot)) runtime.ok(runtime.msg('Claude Code 已配置(standby 模式)', 'Claude Code configured (standby mode)'))
155
- if (installGeminiStandby(runtime.home, runtime.pkgRoot)) runtime.ok(runtime.msg('Gemini CLI 已配置(standby 模式)', 'Gemini CLI configured (standby mode)'))
157
+ const results = {}
158
+ if (installClaudeStandby(runtime.home, runtime.pkgRoot)) {
159
+ runtime.ok(runtime.msg('Claude Code 已配置(standby 模式)', 'Claude Code configured (standby mode)'))
160
+ results.claude = {}
161
+ } else {
162
+ results.claude = { skipped: true }
163
+ }
164
+ if (installGeminiStandby(runtime.home, runtime.pkgRoot)) {
165
+ runtime.ok(runtime.msg('Gemini CLI 已配置(standby 模式)', 'Gemini CLI configured (standby mode)'))
166
+ results.gemini = {}
167
+ } else {
168
+ results.gemini = { skipped: true }
169
+ }
156
170
  if (installCodexStandby(runtime.home, runtime.pkgRoot)) {
157
171
  cleanupCodexGlobalResidueForStandby(runtime.home)
158
172
  runtime.ok(runtime.msg('Codex CLI 已配置(standby 模式)', 'Codex CLI configured (standby mode)'))
173
+ results.codex = {}
174
+ } else {
175
+ console.log(runtime.msg(' - Codex CLI 未检测到,跳过', ' - Codex CLI not detected, skipped'))
176
+ results.codex = { skipped: true }
159
177
  }
160
- else console.log(runtime.msg(' - Codex CLI 未检测到,跳过', ' - Codex CLI not detected, skipped'))
178
+ return results
161
179
  }
162
180
 
163
181
  function installGlobal(runtime) {
182
+ const results = {}
164
183
  for (const host of ['claude', 'gemini', 'codex']) {
165
- reportHostAction(runtime, 'install', host, 'global', installHostGlobal(runtime, host))
184
+ const result = installHostGlobal(runtime, host)
185
+ reportHostAction(runtime, 'install', host, 'global', result)
186
+ results[host] = result
166
187
  }
188
+ return results
167
189
  }
168
190
 
169
191
  export function installAllHosts(runtime, mode) {
170
- if (mode === 'global') installGlobal(runtime)
171
- else installStandby(runtime)
192
+ if (mode === 'global') return installGlobal(runtime)
193
+ return installStandby(runtime)
172
194
  }
173
195
 
174
196
  export function uninstallAllHosts(runtime) {
@@ -115,7 +115,6 @@ function resolveHostMode(host, explicitMode, settings) {
115
115
  if (explicitMode) return explicitMode
116
116
  return detectHostMode(host)
117
117
  || getTrackedHostMode(settings, host)
118
- || (!hasTrackedHostModes(settings) ? (settings.install_mode || '') : '')
119
118
  || DEFAULTS.install_mode
120
119
  }
121
120
 
@@ -183,21 +182,31 @@ function runAllHostsLifecycle(action, explicitMode) {
183
182
  }
184
183
 
185
184
  const settings = readSettings(true)
186
- if (action === 'update' && !explicitMode) {
185
+ if (!explicitMode) {
187
186
  for (const host of HOSTS) {
188
187
  const mode = resolveHostMode(host, '', settings)
189
188
  const result = runHostLifecycle(runtime, action, host, mode)
190
- if (!result.skipped) setTrackedHostMode(settings, host, mode)
189
+ if (!result.skipped && result.ok !== false) setTrackedHostMode(settings, host, mode)
190
+ else clearTrackedHostMode(settings, host)
191
191
  }
192
192
  writeSettings(settings)
193
- runtime.printInstallMsg(settings.install_mode || DEFAULTS.install_mode, 'refresh')
193
+ const modes = Object.values(settings.host_install_modes || {})
194
+ const displayMode = modes.length && modes.every((mode) => mode === modes[0])
195
+ ? modes[0]
196
+ : settings.install_mode || DEFAULTS.install_mode
197
+ runtime.printInstallMsg(displayMode, action === 'update' ? 'refresh' : 'install')
194
198
  return
195
199
  }
196
200
 
197
201
  const mode = resolveInstallMode(explicitMode, settings)
198
202
  if (explicitMode) settings.install_mode = explicitMode
199
- installAllHosts(runtime, mode)
200
- setAllTrackedHostModes(settings, mode)
203
+ const results = installAllHosts(runtime, mode)
204
+ settings.host_install_modes = {}
205
+ for (const host of HOSTS) {
206
+ if (!results?.[host]?.skipped && results?.[host]?.ok !== false) {
207
+ settings.host_install_modes[host] = mode
208
+ }
209
+ }
201
210
  writeSettings(settings)
202
211
  runtime.printInstallMsg(mode, action === 'update' ? 'refresh' : 'install')
203
212
  }
@@ -87,7 +87,7 @@ HelloAGENTS v${pkgVersion} — The orchestration kernel for AI CLIs
87
87
  ${msg('安装', 'Install')}:
88
88
  npm install -g helloagents ${msg('(安装命令并同步稳定运行根目录;CLI 部署需显式执行 helloagents install ...)', '(installs the command and syncs the stable runtime root; deploy to CLIs explicitly with helloagents install ...)')}
89
89
  HELLOAGENTS=codex:global npm install -g helloagents
90
- helloagents-js ${msg('(稳定别名,避免与系统中同名可执行文件冲突)', '(stable alias to avoid conflicts with system executables of the same name)')}
90
+ helloagents-js.cmd ${msg('(受管宿主配置的跨平台稳定入口)', '(cross-platform stable entrypoint for managed host configs)')}
91
91
 
92
92
  ${msg('模式切换', 'Mode switching')}:
93
93
  helloagents --global ${msg('全局模式(自动尝试 Claude/Gemini 插件或扩展;Codex 自动装原生本地插件)', 'Global mode (auto-attempts Claude/Gemini plugins or extensions; native local plugin auto-install for Codex)')}
@@ -1,36 +1,15 @@
1
1
  import { join } from 'node:path'
2
2
 
3
- import { DEFAULTS } from './cli-config.mjs'
4
3
  import { safeJson } from './cli-utils.mjs'
5
4
 
6
- const CARRIER_SETTING_KEYS = [
7
- 'output_language',
8
- 'output_format',
9
- 'notify_level',
10
- 'ralph_loop_enabled',
11
- 'guard_enabled',
12
- 'kb_create_mode',
13
- 'project_store_mode',
14
- 'commit_attribution',
15
- ]
16
-
17
- function pickCarrierSettings(settings) {
18
- const merged = { ...DEFAULTS, ...(settings || {}) }
19
- return Object.fromEntries(CARRIER_SETTING_KEYS.map((key) => [key, merged[key]]))
20
- }
21
-
22
5
  export function readCarrierSettings(home) {
23
- return pickCarrierSettings(safeJson(join(home, '.helloagents', 'helloagents.json')) || {})
6
+ return safeJson(join(home, '.helloagents', 'helloagents.json')) || {}
24
7
  }
25
8
 
26
9
  export function buildRuntimeCarrier(bootstrapContent, settings = {}) {
10
+ void settings
27
11
  const normalized = String(bootstrapContent || '').trim()
28
12
  if (!normalized) return ''
29
13
 
30
- const carrierSettings = pickCarrierSettings(settings)
31
- const snapshot = Object.keys(carrierSettings).length
32
- ? `\n\n## 当前用户设置\n\`\`\`json\n${JSON.stringify(carrierSettings, null, 2)}\n\`\`\``
33
- : ''
34
-
35
- return `${normalized}${snapshot}\n`
14
+ return `${normalized}\n`
36
15
  }
@@ -43,6 +43,26 @@ function samePath(left, right) {
43
43
  return process.platform === 'win32' ? a.toLowerCase() === b.toLowerCase() : a === b
44
44
  }
45
45
 
46
+ function wait(ms) {
47
+ Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms)
48
+ }
49
+
50
+ function retryTransientFs(operation) {
51
+ let lastError
52
+ for (let attempt = 0; attempt < 6; attempt += 1) {
53
+ try {
54
+ return operation()
55
+ } catch (error) {
56
+ lastError = error
57
+ if (!['EPERM', 'EBUSY', 'ENOTEMPTY'].includes(error?.code) || attempt === 5) {
58
+ throw error
59
+ }
60
+ wait(40 * (attempt + 1))
61
+ }
62
+ }
63
+ throw lastError
64
+ }
65
+
46
66
  /** Sync package runtime files into the stable root without copying repo-only files. */
47
67
  export function syncRuntimeRoot(sourceRoot, runtimeRoot) {
48
68
  const source = resolve(sourceRoot)
@@ -57,8 +77,10 @@ export function syncRuntimeRoot(sourceRoot, runtimeRoot) {
57
77
 
58
78
  try {
59
79
  copyEntries(source, staging, RUNTIME_ROOT_ENTRIES)
60
- removeIfExists(target)
61
- renameSync(staging, target)
80
+ retryTransientFs(() => {
81
+ removeIfExists(target)
82
+ renameSync(staging, target)
83
+ })
62
84
  return { synced: true, root: target }
63
85
  } catch (error) {
64
86
  removeIfExists(staging)
@@ -132,9 +132,9 @@ export function cleanSettingsHooks(settingsPath, cleanPermissions = false) {
132
132
 
133
133
  function rewriteHookCommandToCli(command = '', pathVar = '') {
134
134
  const replacements = new Map([
135
- [`node "${pathVar}/scripts/notify.mjs"`, 'helloagents-js notify'],
136
- [`node "${pathVar}/scripts/guard.mjs"`, 'helloagents-js guard'],
137
- [`node "${pathVar}/scripts/ralph-loop.mjs"`, 'helloagents-js ralph-loop'],
135
+ [`node "${pathVar}/scripts/notify.mjs"`, 'helloagents-js.cmd notify'],
136
+ [`node "${pathVar}/scripts/guard.mjs"`, 'helloagents-js.cmd guard'],
137
+ [`node "${pathVar}/scripts/ralph-loop.mjs"`, 'helloagents-js.cmd ralph-loop'],
138
138
  ]);
139
139
 
140
140
  let next = command;
@@ -1,5 +1,7 @@
1
1
  export function shouldIgnoreCodexNotifyClient(client) {
2
- return !!client && client !== 'codex-tui';
2
+ if (!client) return false;
3
+ const normalized = String(client).trim().toLowerCase().replace(/[_\s]+/g, '-');
4
+ return normalized !== 'codex' && !normalized.startsWith('codex-');
3
5
  }
4
6
 
5
7
  export function shouldIgnoreFormattedSubagent(lastMsg, outputFormatEnabled) {
@@ -11,7 +11,7 @@ function shouldBypassRoute(prompt) {
11
11
 
12
12
  function buildHelpExtraRules(skillName) {
13
13
  if (skillName !== 'help') return ''
14
- return ' 这是 HelloAGENTS 的帮助命令,不是宿主 CLI 的内置帮助。仅显示 HelloAGENTS 的帮助和当前设置;优先使用当前上下文中已注入的“当前用户设置”,上下文不存在或缺少要展示的配置项时才读取 ~/.helloagents/helloagents.json;自动激活技能说明仅在全局模式或已激活项目中生效。不要调用宿主 CLI 的帮助工具(如 cli_help 或 /help),不要使用子代理,不要读取项目文件;若受工作区限制无法读取配置,必须明确说明并按已知默认值或已注入设置展示。'
14
+ return ' 这是 HelloAGENTS 的帮助命令,不是宿主 CLI 的内置帮助。仅显示 HelloAGENTS 的帮助和当前设置;优先使用当前会话上下文中已注入的“当前用户设置”、配置文件原始 JSON 或此前读取结果摘要,上下文不存在或缺少要展示的配置项时才读取一次 ~/.helloagents/helloagents.json;自动激活技能说明仅在全局模式或已激活项目中生效。不要调用宿主 CLI 的帮助工具(如 cli_help 或 /help),不要使用子代理,不要读取项目文件;若受工作区限制无法读取配置,必须明确说明并按已知默认值或已注入设置展示。'
15
15
  }
16
16
 
17
17
  function routeExplicitCommand({
@@ -5,7 +5,7 @@
5
5
  import { platform } from 'node:os';
6
6
  import { join } from 'node:path';
7
7
  import { existsSync } from 'node:fs';
8
- import { spawn } from 'node:child_process';
8
+ import { spawnSync } from 'node:child_process';
9
9
 
10
10
  const PLAT = platform();
11
11
 
@@ -55,16 +55,13 @@ function resolveWav(pkgRoot, event) {
55
55
  return existsSync(p) ? p : null;
56
56
  }
57
57
 
58
- function spawnDetached(command, args) {
58
+ function runSync(command, args) {
59
59
  try {
60
- const child = spawn(command, args, {
61
- detached: true,
60
+ const result = spawnSync(command, args, {
62
61
  stdio: 'ignore',
63
62
  windowsHide: true,
64
63
  });
65
- child.on('error', () => {});
66
- child.unref();
67
- return true;
64
+ return !result.error && result.status === 0;
68
65
  } catch {
69
66
  return false;
70
67
  }
@@ -76,15 +73,15 @@ export function playSound(pkgRoot, event) {
76
73
  if (!wav) { process.stderr.write('\x07'); return; }
77
74
  try {
78
75
  if (PLAT === 'win32') {
79
- spawnDetached('powershell', [
76
+ runSync('powershell', [
80
77
  '-NoProfile',
81
78
  '-c',
82
79
  `(New-Object Media.SoundPlayer '${wav.replace(/'/g, "''")}').PlaySync()`,
83
80
  ]);
84
81
  } else if (PLAT === 'darwin') {
85
- spawnDetached('afplay', [wav]);
82
+ runSync('afplay', [wav]);
86
83
  } else {
87
- spawnDetached('aplay', ['-q', wav]) || spawnDetached('paplay', [wav]);
84
+ if (!runSync('aplay', ['-q', wav]) && !runSync('paplay', [wav])) process.stderr.write('\x07');
88
85
  }
89
86
  } catch { process.stderr.write('\x07'); }
90
87
  }
@@ -127,16 +124,16 @@ export function desktopNotify(pkgRoot, event, extra) {
127
124
  try {
128
125
  if (PLAT === 'win32') {
129
126
  const iconPath = join(pkgRoot, 'assets', 'icons', 'icon.png').replace(/\//g, '\\');
130
- spawnDetached('powershell', ['-NoProfile', '-c', buildWindowsToastScript(notification, iconPath)]);
127
+ runSync('powershell', ['-NoProfile', '-c', buildWindowsToastScript(notification, iconPath)]);
131
128
  } else if (PLAT === 'darwin') {
132
129
  const subtitle = notification.sourceLabel
133
130
  ? ` subtitle "${escapeAppleScriptText(notification.sourceLabel)}"`
134
131
  : '';
135
- spawnDetached('osascript', ['-e',
132
+ runSync('osascript', ['-e',
136
133
  `display notification "${escapeAppleScriptText(notification.message)}" with title "${escapeAppleScriptText(notification.title)}"${subtitle}`],
137
134
  );
138
135
  } else {
139
- spawnDetached('notify-send', [notification.title, notification.body]);
136
+ if (!runSync('notify-send', [notification.title, notification.body])) process.stderr.write('\x07');
140
137
  }
141
138
  } catch { process.stderr.write('\x07'); }
142
139
  }
@@ -47,8 +47,12 @@ function normalizeNotifyLevel(value) {
47
47
 
48
48
  function notifyByLevel(event, extra, settings = getSettings()) {
49
49
  const level = normalizeNotifyLevel(settings.notify_level ?? 0);
50
- if (level === 2 || level === 3) playSound(event);
51
- if (level === 1 || level === 3) desktopNotify(event, extra);
50
+ if (level === 1) desktopNotify(event, extra);
51
+ if (level === 2) playSound(event);
52
+ if (level === 3) {
53
+ desktopNotify(event, extra);
54
+ playSound(event);
55
+ }
52
56
  }
53
57
 
54
58
  function buildNotifyExtra(payload = {}, options = {}) {
@@ -254,7 +258,7 @@ function cmdStop() {
254
258
  }
255
259
 
256
260
  const settings = getSettings();
257
- if (shouldProcess) {
261
+ if (shouldProcess || !turnState) {
258
262
  notifyByLevel('complete', buildNotifyExtra(payload), settings);
259
263
  }
260
264
  consumeMainTurnState(cwd, turnState, turnPayload);
@@ -291,7 +295,11 @@ function cmdCodexNotify() {
291
295
  if (turnState && turnState.kind !== 'complete') consumeMainTurnState(cwd, turnState, turnPayload);
292
296
  return;
293
297
  }
294
- if (!turnState) return;
298
+ if (!turnState) {
299
+ notifyByLevel('complete', buildNotifyExtra(data), getSettings());
300
+ clearRouteContext({ cwd, payload: turnPayload });
301
+ return;
302
+ }
295
303
  if (turnState.kind !== 'complete') {
296
304
  consumeMainTurnState(cwd, turnState, turnPayload);
297
305
  clearRouteContext({ cwd, payload: turnPayload });
@@ -167,7 +167,7 @@ export function buildUiContractHint(cwd, snapshot) {
167
167
  if (visualValidationRequired) {
168
168
  extraHints.push('若当前 UI 契约要求视觉验收,收尾前需写当前会话 `artifacts/visual.json` 记录关键视口、状态与结论')
169
169
  }
170
- return `UI 约束提示:如本次属于视觉/交互任务,设计决策优先级固定为:当前活跃 plan.md / prd/03-ui-design.md → ${describeProjectStoreFile(cwd, 'DESIGN.md')} → hello-ui。${extraHints.length > 0 ? ` ${extraHints.join(';')}。` : ''}`
170
+ return `UI 约束提示:如本次属于视觉/交互任务,设计决策优先级固定为:当前活跃 plan.md / prd/03-ui-design.md → ${describeProjectStoreFile(cwd, 'DESIGN.md')} → hello-ui,并与 UI 质量基线共同生效。${extraHints.length > 0 ? ` ${extraHints.join(';')}。` : ''}`
171
171
  }
172
172
 
173
173
  export { normalizeTaskFile, readStateSnapshot, listPlanPackages, getWorkflowSnapshot }
@@ -15,7 +15,7 @@ Trigger: ~commit [message]
15
15
  3. 生成 conventional commit message(如未提供)
16
16
  - 格式: type(scope): description
17
17
  - type: feat|fix|refactor|docs|test|chore|style|perf
18
- 4. 先一次性解析本轮设置:优先使用当前上下文中已注入的“当前用户设置”;上下文不存在或缺少 `commit_attribution` / `kb_create_mode` 时,读取一次 `~/.helloagents/helloagents.json`
18
+ 4. 先一次性解析会话中已知设置:优先使用当前会话上下文中已注入的“当前用户设置”、该配置文件原始 JSON 或此前读取结果摘要;上下文不存在或缺少 `commit_attribution` / `kb_create_mode` 时,才读取一次 `~/.helloagents/helloagents.json`
19
19
  5. 复用上一步已解析的设置获取 `commit_attribution`:
20
20
  - ""(空,默认)→ 不添加归属
21
21
  - 有内容(如 "Co-Authored-By: HelloAGENTS")→ 添加该内容到 commit message
@@ -39,7 +39,7 @@ Trigger: ~help
39
39
  完成时:hello-verify, hello-reflect
40
40
 
41
41
  ### 当前设置
42
- 优先使用当前上下文中已注入的“当前用户设置”显示;若上下文不存在该信息,或缺少下表任一配置项,读取一次 `~/.helloagents/helloagents.json`。
42
+ 优先使用当前会话上下文中已注入的“当前用户设置”、该配置文件原始 JSON 或此前读取结果摘要显示;若会话上下文不存在该信息,或缺少下表任一配置项,才读取一次 `~/.helloagents/helloagents.json`,并在后续轮次复用。
43
43
  如果当前 CLI 存在工作区限制导致家目录不可读,则明确说明“无法直接读取配置文件,以下按已注入设置或默认值展示”,不要改用无关工具或伪造已读取结果。
44
44
  | 配置项 | 默认值 | 作用 | 适用 CLI |
45
45
  |--------|-------|------|---------|
@@ -51,3 +51,5 @@ Trigger: ~help
51
51
  | kb_create_mode | 1 | 0=关闭/1=已激活项目或全局模式中编码自动/2=已激活项目或全局模式中始终 | Claude Code + Gemini CLI + Codex CLI |
52
52
  | project_store_mode | "local" | "local"=知识库/方案包保留在项目本地 `.helloagents/`;"repo-shared"=本地 `.helloagents/` 仅保留激活/STATE/运行态,知识库与方案包改写到 `~/.helloagents/projects/<repo-key>/` | Claude Code + Gemini CLI + Codex CLI |
53
53
  | commit_attribution | "" | 空=不添加/填写内容则添加到 commit message | Claude Code + Gemini CLI + Codex CLI |
54
+ | install_mode | "standby" | 当前默认安装模式 | Claude Code + Gemini CLI + Codex CLI |
55
+ | host_install_modes | {} | 单 CLI 模式记录,优先于 install_mode | Claude Code + Gemini CLI + Codex CLI |
@@ -1,20 +1,20 @@
1
1
  ---
2
2
  name: hello-ui
3
- description: 已进入显式 UI 工作流、已激活项目的视觉变更、设计系统改造或需要视觉验收时使用;在通用 UI 基线之上补充项目契约执行、设计系统映射与视觉验证。
3
+ description: 已进入显式 UI 工作流、全局模式中的 UI 任务、已激活项目的视觉变更、设计系统改造或需要视觉验收时使用;在通用 UI 基线之上补充项目契约执行、设计系统映射与视觉验证。
4
4
  ---
5
5
 
6
6
  本 skill 不是 UI 质量的唯一来源。当前已加载 bootstrap 中的 UI 质量基线负责所有 UI 任务的基础水准;本 skill 在显式 UI 工作流和复杂 UI 任务中,补充更明确的契约执行、实现映射与视觉验收。
7
7
  `.helloagents/` 在本 skill 中统一按项目级存储路径理解:会话证据使用当前 `state_path` 所在目录下的 `artifacts/*.json`;若 `project_store_mode=repo-shared`,`DESIGN.md` 与方案包按当前上下文中已注入的项目知识/方案目录解析。
8
8
 
9
9
  ## 适用边界
10
- 已进入显式 UI 规划/实现/验证路径,或当前项目已激活且任务涉及整页新建、跨多个组件的视觉重做、设计系统改造、需要截图验收的界面任务时,读取本 skill。
10
+ 已进入显式 UI 规划/实现/验证路径、全局模式中的 UI 任务,或当前项目已激活且任务涉及整页新建、跨多个组件的视觉重做、设计系统改造、需要截图验收的界面任务时,读取本 skill。
11
11
  标准模式未激活项目中的普通 UI 请求,仍只受当前 bootstrap 的 UI 质量基线约束;修复 bug、调整文案、改业务逻辑等不涉及视觉变更的任务,不读取本 skill。在已有设计系统中工作时,保留已建立的模式、结构和视觉语言。
12
12
 
13
13
  ## 设计契约优先级
14
14
  进入 UI 相关的规划、实现、验证时,按以下顺序做设计决策:
15
15
  1. 当前活跃方案包 `plan.md` 或 PRD 中已确认的 UI 决策
16
16
  2. `.helloagents/DESIGN.md`(按当前项目存储模式解析)
17
- 3. 本 skill 的通用规则
17
+ 3. 本 skill 的具体 UI 审美与实现规则,并与 UI 质量基线共同生效
18
18
  缺少上层产物时,才直接依赖下层规则;不得用通用审美覆盖已确认的项目契约。
19
19
 
20
20
  ## 核心职责
@@ -23,7 +23,7 @@ description: 按任务类型适用 — 建立质量驱动工作流,通过技
23
23
  ### 流程纪律(执行时)
24
24
  - 执行 command skill 时,公共阶段边界以当前已加载 bootstrap 为准;command skill 只补充该命令的专属动作和边界
25
25
  - 统一执行流程的六个阶段(ROUTE/TIER→SPEC→PLAN→BUILD→VERIFY→CONSOLIDATE)按当前 Delivery Tier 和实际任务推进;未进入的阶段不强行补齐,已进入的阶段不可跳过
26
- - 所有 UI 任务先受当前 bootstrap 的 UI 质量基线约束;已激活项目或显式 UI 工作流中的设计约束优先级固定为:当前 `plan.md` / PRD UI 决策 → `.helloagents/DESIGN.md`(按当前项目存储模式解析) → `hello-ui` 深层规则
26
+ - 所有 UI 任务先受当前 bootstrap 的 UI 质量基线约束;已激活项目、全局模式或显式 UI 工作流中的设计约束优先级固定为:当前 `plan.md` / PRD UI 决策 → `.helloagents/DESIGN.md`(按当前项目存储模式解析) → `hello-ui` 具体 UI 审美与实现规则,并与 UI 质量基线共同生效
27
27
  - 方案包存在 `contract.json` 时,验证分流、reviewer / tester 关注边界、可选 style advisor / visual validation 与交付检查优先按它执行,不再从自然语言总结里回推
28
28
  - 因阻塞判定而必须等待用户输入时,遵循当前 bootstrap 的等待输入规则,不得把等待输入包装成完成态
29
29
  - ~plan 的需求澄清与方案确认不可跳过,不可一个问题就出方案
@@ -57,7 +57,7 @@ Layer 3 — 资源文件(技能内引用时读取):
57
57
  禁止行为:
58
58
  - 禁止在 ROUTE / TIER / SPEC 阶段读取实现类技能(hello-ui/hello-test/hello-verify 等)
59
59
  - 禁止因为"可能用到"就提前读取技能文件——等到真正需要时再读
60
- - 同一轮内对同一配置文件、模块、SKILL、模板只读取一次,后续直接复用已得结论,不重复探测或重复读取同一路径
60
+ - 同一会话内,同一路径的配置文件、模块、SKILL、模板只读一次并跨轮复用;缺少所需内容、读取失败、用户要求刷新或本轮修改后才重新读取
61
61
  - ~command 命令只读取对应的 command SKILL.md,不连带读取其他技能
62
62
 
63
63
  ## 技能查找路径