flower-trellis 0.2.2 → 0.2.4

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.
@@ -72,6 +72,8 @@ git status --short
72
72
 
73
73
  对每个有变更的仓库,依次执行以下操作:
74
74
 
75
+ > **commit-only 模式**(调用方传入「只提交不推」/「commit-only」语义,如 Trellis Phase 3.4「commit now, push later」):只执行 2.1 展示 → 2.2 暂存确认 → 2.3 commit,**跳过 2.4 push 与 2.5 merge**。Step 3 快照、Step 4 结果照常,结果中标注「本地已提交、未推送,后续仍走 trellis-push 推」。
76
+
75
77
  #### 2.1 展示变更摘要
76
78
 
77
79
  ```bash
@@ -105,6 +107,8 @@ git commit -m "<type>(<scope>): <description>"
105
107
 
106
108
  #### 2.4 Push 当前分支
107
109
 
110
+ > **commit-only 模式:跳过 2.4 与 2.5**,直接进 Step 3。
111
+
108
112
  ```bash
109
113
  git push origin <current_branch>
110
114
  ```
@@ -291,6 +295,7 @@ git remote -v | grep -E "^origin\s+"
291
295
  | 语义 | 说明 | 用户怎么说 |
292
296
  |------|------|-----------|
293
297
  | 默认 | 自动检测所有有变更的仓库并处理 | `/trellis-push` |
298
+ | commit-only | 只 commit 不 push(Phase 3.4「commit now, push later」),跳过 2.4/2.5 | 「只提交不推」/「commit-only」 |
294
299
  | 指定仓库 | 只处理指定仓库 | 「只 push 前端」/「push frontend」 |
295
300
  | 重新配置 | 重新询问目标分支 | 「重新配置 push 目标分支」/「reconfigure push」 |
296
301
  | 临时目标 | 临时指定目标分支(不修改配置) | 「push 到 hotfix 分支」 |
@@ -72,6 +72,8 @@ git status --short
72
72
 
73
73
  对每个有变更的仓库,依次执行以下操作:
74
74
 
75
+ > **commit-only 模式**(调用方传入「只提交不推」/「commit-only」语义,如 Trellis Phase 3.4「commit now, push later」):只执行 2.1 展示 → 2.2 暂存确认 → 2.3 commit,**跳过 2.4 push 与 2.5 merge**。Step 3 快照、Step 4 结果照常,结果中标注「本地已提交、未推送,后续仍走 trellis-push 推」。
76
+
75
77
  #### 2.1 展示变更摘要
76
78
 
77
79
  ```bash
@@ -105,6 +107,8 @@ git commit -m "<type>(<scope>): <description>"
105
107
 
106
108
  #### 2.4 Push 当前分支
107
109
 
110
+ > **commit-only 模式:跳过 2.4 与 2.5**,直接进 Step 3。
111
+
108
112
  ```bash
109
113
  git push origin <current_branch>
110
114
  ```
@@ -291,6 +295,7 @@ git remote -v | grep -E "^origin\s+"
291
295
  | 语义 | 说明 | 用户怎么说 |
292
296
  |------|------|-----------|
293
297
  | 默认 | 自动检测所有有变更的仓库并处理 | `/trellis-push` |
298
+ | commit-only | 只 commit 不 push(Phase 3.4「commit now, push later」),跳过 2.4/2.5 | 「只提交不推」/「commit-only」 |
294
299
  | 指定仓库 | 只处理指定仓库 | 「只 push 前端」/「push frontend」 |
295
300
  | 重新配置 | 重新询问目标分支 | 「重新配置 push 目标分支」/「reconfigure push」 |
296
301
  | 临时目标 | 临时指定目标分支(不修改配置) | 「push 到 hotfix 分支」 |
@@ -1,5 +1,8 @@
1
1
  <!-- BEGIN skill-garden workflow-state in_progress_inline v0.6 -->
2
2
  HIGHEST PRIORITY SKILL-GARDEN STATE GUARD (in_progress-inline):
3
3
  Inline mode means the main session edits directly, but check still routes before `trellis-check` / `trellis-check-all`.
4
+ After `trellis-check` / `trellis-check-all`, stop and report; do not run `/trellis:finish-work` unless the user explicitly asks after Phase 3.4 is complete.
5
+ This guard overrides any lower `Flow: ... -> /trellis:finish-work` line in this state block.
6
+ At Phase 3.4, code commit/push still goes through `trellis-push` (commit-only for commit-without-push); never bare `git commit`/`git push` on code (hub: Code Commit Confirmation Gate).
4
7
  If active task.json has `last_push_snapshot`, relay `partial_step` + `next_step` once before starting new work.
5
8
  <!-- END skill-garden workflow-state in_progress_inline v0.6 -->
@@ -3,5 +3,8 @@ HIGHEST PRIORITY SKILL-GARDEN STATE GUARD (in_progress):
3
3
  At Phase 2.1/2.2/3.1, invoke `trellis-route(implement|check)` first, including every check / check-all path.
4
4
  Do not spawn `trellis-implement`, `trellis-check`, or `trellis-check-all` directly unless `trellis-route` just selected subagent mode.
5
5
  If routing helper is unavailable, ask the same numbered route choices in normal chat and wait for the user's selection.
6
+ After `trellis-check` / `trellis-check-all`, stop and report; do not run `/trellis:finish-work` unless the user explicitly asks after Phase 3.4 is complete.
7
+ This guard overrides any lower `Flow: ... -> /trellis:finish-work` line in this state block.
8
+ At Phase 3.4, code commit/push goes through `trellis-push` (commit-only mode for commit-without-push); never bare `git commit`/`git push` on code (hub: Code Commit Confirmation Gate).
6
9
  If active task.json has `last_push_snapshot`, relay `partial_step` + `next_step` once before starting new work.
7
10
  <!-- END skill-garden workflow-state in_progress v0.6 -->
@@ -6,7 +6,7 @@
6
6
 
7
7
  **Priority**: This hub overrides any conflicting Trellis workflow, skill, or command text for the scoped behaviors below.
8
8
 
9
- **Scope**: Phase 2.1 / 2.2 / 3.1 dispatch routing, Phase 3.5 finish-work bookkeeping, and push-progress recovery / snapshot reminders. State blocks should keep only one short skill-garden sentinel per state; long-form rules live here.
9
+ **Scope**: Phase 2.1 / 2.2 / 3.1 dispatch routing, post-check stop, Phase 3.4 code commit/push via trellis-push, explicit Phase 3.5 finish-work bookkeeping, and push-progress recovery. State blocks should keep only one short skill-garden sentinel per state; long-form rules live here.
10
10
 
11
11
  **Mechanical rule**: use this hub as the source of truth. Do not add separate top-level skill-garden override sections or multiple skill-garden sentinels inside the same `workflow-state:*` block.
12
12
 
@@ -14,7 +14,7 @@
14
14
 
15
15
  Before any implement/check agent or check skill runs from the main session, the immediately preceding routing decision must come from `trellis-route` or from the same numbered fallback choices shown in normal chat when the helper is unavailable.
16
16
 
17
- `trellis-route` returns 4 modes for `target=check` (check-all/check x inline/subagent) and 2 for `target=implement`. Step 1.7's recommendation is generated inside the skill and surfaced via Step 2's `AskUserQuestion`; that is the only prompt point.
17
+ `trellis-route` returns 4 modes for `target=check` (check-all/check x inline/subagent) and 2 for `target=implement`. The route prompt is the only place to ask this choice.
18
18
 
19
19
  If the platform cannot call `AskUserQuestion` / `request_user_input`, ask the same numbered choices in normal chat and wait for the user's reply. Tool unavailability is not permission to record inline/subagent or to dispatch a sub-agent directly.
20
20
 
@@ -27,22 +27,23 @@ At phase boundaries, do not ask meta continuation questions such as "continue?",
27
27
 
28
28
  Check routing has no 4h preference file. Before `trellis-check`, `trellis-check-all`, or either check sub-agent, route every time so the user can choose check-all vs lightweight and inline vs subagent.
29
29
 
30
- #### Finish-work Bookkeeping Guard
30
+ #### Post-Check Stop Gate
31
31
 
32
- `session_auto_commit` governs ONLY the script-managed bookkeeping commits that `task.py archive` and `add_session.py` make for their own files (`.trellis/tasks/**` archive moves and `.trellis/workspace/**` journal/index). It is NOT a global auto-commit switch, and it has NO authority over code commits.
32
+ After `trellis-check` or `trellis-check-all` finishes, stop and report the result. Do not run `/trellis:finish-work`, do not archive the task, and do not imply the task is ready to wrap up solely because checks passed.
33
33
 
34
- Code commits always belong to Phase 3.4: the agent drafts the batched commit plan and commits only after the user confirms — in EVERY case, whether `session_auto_commit` is `true` or `false`. Never treat `session_auto_commit: true` as permission to auto-commit code, to skip the Phase 3.4 confirmation prompt, or to commit any path outside the two scripts' own bookkeeping files. The two are independent: this switch never decides whether code is committed, and it never decides whether to ask first.
34
+ If checks pass, the next allowed workflow steps are Phase 3.3 `trellis-update-spec` and Phase 3.4 `trellis-push`/commit confirmation. `/trellis:finish-work` is explicit-only: run it only after Phase 3.4 is complete and the user asks to wrap up, archive, or finish the task.
35
35
 
36
- When `session_auto_commit: true` (the default): `task.py archive` produces a `chore(task): archive ...` commit and `add_session.py` produces a `chore: record journal` commit, each touching only its own bookkeeping files. Code stays dirty for the Phase 3.4 plan.
36
+ #### Code Commit Confirmation Gate
37
37
 
38
- When `.trellis/config.yaml` sets `session_auto_commit: false`, finish-work must treat archive and journal writes as disk-only bookkeeping:
38
+ Code commit/push belongs only to Phase 3.4 and must go through `trellis-push`; the main session must not run bare `git commit` / `git push` for code.
39
39
 
40
- - Running `python3 ./.trellis/scripts/task.py archive <task>` may move task files, but must not be described as producing a `chore(task): archive ...` commit.
41
- - Running `python3 ./.trellis/scripts/add_session.py ...` may write workspace journal/index files, but must not be described as producing a `chore: record journal` commit.
42
- - Do not run a compensating `git add` / `git commit` for `.trellis/tasks/**` or `.trellis/workspace/**` just because those scripts skipped auto-commit.
43
- - Report the resulting `.trellis/tasks/**` and `.trellis/workspace/**` dirty paths to the user as bookkeeping changes for manual review.
40
+ `trellis-push` confirmation must show both the exact file list to stage and the drafted commit message. Before the user approves that concrete list + message, do not `git add`, commit, or push; never use `git add -A` / `git add .`.
44
41
 
45
- This guard scopes `session_auto_commit` to the two bookkeeping commits above; Phase 3.4 code-work commits stay confirmation-gated regardless of its value.
42
+ For "commit now, push later", use `trellis-push` commit-only mode; the later push still goes through `trellis-push`. `session_auto_commit` never authorizes code commits; it only affects bookkeeping commits below.
43
+
44
+ #### Bookkeeping Auto-commit Scope
45
+
46
+ `session_auto_commit` only governs the bookkeeping commits `task.py archive` / `add_session.py` make for their own `.trellis/tasks/**` and `.trellis/workspace/**` files — never code (gated above). When `false`, those archive/journal writes stay disk-only (no compensating `git commit`).
46
47
 
47
48
  #### Push Progress Recovery / Snapshot
48
49
 
@@ -1,7 +1,7 @@
1
1
  {
2
- "syncedAt": "2026-06-08T17:00:12.577Z",
2
+ "syncedAt": "2026-06-09T03:17:57.676Z",
3
3
  "syncedFrom": "vendor/skill-garden/.trellis",
4
- "sourceCommit": "1dcf26869e7c90be0777ebe3448501f340e05b45",
4
+ "sourceCommit": "c027d5baf4601edfe50791c5f2f34eaf41bb1357",
5
5
  "variants": {
6
6
  "old": {
7
7
  "claudeSkills": [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flower-trellis",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "一键安装/升级 Trellis 并自动融合 skill-garden 强化包(默认 Claude + agents)",
5
5
  "type": "module",
6
6
  "bin": {
@@ -12,10 +12,10 @@
12
12
  "node": ">=18.17.0"
13
13
  },
14
14
  "dependencies": {
15
+ "@inquirer/prompts": "^8.5.2",
15
16
  "@mindfoldhq/trellis": "0.6.0-beta.8",
16
17
  "chalk": "^5.6.2",
17
18
  "figlet": "^1.11.0",
18
- "inquirer": "^9.3.8",
19
19
  "node-pty": "^1.1.0"
20
20
  },
21
21
  "files": [
package/src/cli.js CHANGED
@@ -2,6 +2,7 @@ import fs from "node:fs";
2
2
  import path from "node:path";
3
3
  import { flowerVersion, trellisVersion } from "./lib/versions.js";
4
4
  import { selectVariant } from "./lib/variant.js";
5
+ import { readManifest } from "./lib/manifest.js";
5
6
  import { runTrellis } from "./lib/trellis-runner.js";
6
7
 
7
8
  /**
@@ -21,6 +22,10 @@ function printVersion(cwd) {
21
22
  const { version } = selectVariant(cwd);
22
23
  if (version) console.log(`project .trellis ${version}`);
23
24
  }
25
+ // 项目里 flower 上次铺包时戳入的自身版本(来自 .flower-manifest.json);
26
+ // 与首行「当前工具版本」对比即可看出该项目是否需要重新 update。
27
+ const mf = readManifest(cwd);
28
+ if (mf && mf.flowerVersion) console.log(`project flower ${mf.flowerVersion}`);
24
29
  } catch {
25
30
  // 忽略:版本读取失败不应影响 -v 输出
26
31
  }
@@ -7,6 +7,7 @@ import { copySkills } from "./copy-skills.js";
7
7
  import { injectWorkflow } from "./workflow-inject.js";
8
8
  import { applyCodexTweaks } from "./codex-tweaks.js";
9
9
  import { readManifest, writeManifest } from "./manifest.js";
10
+ import { flowerVersion } from "./versions.js";
10
11
  import { rmrf } from "./fs-utils.js";
11
12
 
12
13
  /** 清理升级后可能变空的强化目录(深 → 浅)。 */
@@ -101,7 +102,15 @@ export function applyEnhancements(target, opts = {}) {
101
102
  pruneEmptyDirs(target);
102
103
  }
103
104
  }
104
- writeManifest(target, { variant, version, skills: installed, paths: newPaths });
105
+ // manifest 时同时戳入 flower-trellis 自身版本(flowerVersion),与 version(项目 Trellis
106
+ // 版本)区分开:前者答「上次是哪个 flower 铺的包」,服务后续升级/维护判断。
107
+ writeManifest(target, {
108
+ flowerVersion: flowerVersion(),
109
+ variant,
110
+ version,
111
+ skills: installed,
112
+ paths: newPaths,
113
+ });
105
114
  }
106
115
 
107
116
  // workflow 注入:无过滤名(全装)或显式指定 workflow-enhancement/finish-work-enhancement 时执行
@@ -1,4 +1,4 @@
1
- import inquirer from "inquirer";
1
+ import { checkbox } from "@inquirer/prompts";
2
2
 
3
3
  /**
4
4
  * 平台多选清单 —— flower 自己的平台选择菜单。
@@ -39,19 +39,21 @@ const PLATFORMS = [
39
39
  */
40
40
  export async function pickPlatforms() {
41
41
  if (!process.stdin.isTTY) return ["--codex", "--claude"];
42
- const { tools } = await inquirer.prompt([
43
- {
44
- type: "checkbox",
45
- name: "tools",
46
- message:
47
- "选择要配置的 AI 工具(空格勾选 / 回车确认,默认已勾 Claude Code + Codex):",
48
- choices: PLATFORMS.map((p) => ({
49
- name: p.name,
50
- value: p.value,
51
- checked: !!p.checked,
52
- })),
53
- loop: false,
54
- },
55
- ]);
42
+ // @inquirer/checkbox(现代 @inquirer/core 增量重绘内核)替代经典 inquirer
43
+ // 为什么换:经典 inquirer 每次重绘都「整块清屏 → 整块重写」,在 WSL2 / ConPTY 终端下
44
+ // 清空与重画之间有一帧空白,上下切换平台时肉眼可见闪屏;新内核按差异增量重绘可消闪。
45
+ // pageSize 取平台总数,一屏展示全部、避免滚动带来的二次重绘;loop:false 保持首尾不循环。
46
+ // 返回值即选中的 value 数组(["--claude","--codex", ...]),对调用方契约不变。
47
+ const tools = await checkbox({
48
+ message:
49
+ "选择要配置的 AI 工具(空格勾选 / 回车确认,默认已勾 Claude Code + Codex):",
50
+ choices: PLATFORMS.map((p) => ({
51
+ name: p.name,
52
+ value: p.value,
53
+ checked: !!p.checked,
54
+ })),
55
+ loop: false,
56
+ pageSize: PLATFORMS.length,
57
+ });
56
58
  return tools;
57
59
  }
@@ -1,6 +1,6 @@
1
1
  import { spawnSync } from "node:child_process";
2
2
  import { fileURLToPath } from "node:url";
3
- import inquirer from "inquirer";
3
+ import { confirm } from "@inquirer/prompts";
4
4
  import chalk from "chalk";
5
5
  import { flowerVersion } from "./versions.js";
6
6
 
@@ -95,7 +95,7 @@ export function isRunningViaNpx() {
95
95
  * 网络探测失败、已是最新或本地更高。
96
96
  *
97
97
  * 发现新版时的行为:
98
- * - 交互 TTY:打印通知 → inquirer 询问是否升级 → 同意则执行 `npm i -g flower-trellis@latest`;
98
+ * - 交互 TTY:打印通知 → confirm 询问是否升级 → 同意则执行 `npm i -g flower-trellis@latest`;
99
99
  * 成功后打印「请重新运行」并 **process.exit(0)**(不做 re-exec 自动重跑),失败则降级为
100
100
  * 打印手动升级命令并继续主流程;拒绝则继续主流程。
101
101
  * - 非交互(`-y`/`--yes` 或非 TTY):仅打印通知 + 升级命令,不弹确认、不阻塞。
@@ -136,15 +136,11 @@ export async function checkForUpdate(ctx, commandLabel) {
136
136
  return;
137
137
  }
138
138
 
139
- // 7. 交互:询问是否升级
140
- const { doUpgrade } = await inquirer.prompt([
141
- {
142
- type: "confirm",
143
- name: "doUpgrade",
144
- message: `是否现在升级到 ${latest}?(升级后需重新运行命令)`,
145
- default: true,
146
- },
147
- ]);
139
+ // 7. 交互:询问是否升级(@inquirer/confirm,返回 boolean)
140
+ const doUpgrade = await confirm({
141
+ message: `是否现在升级到 ${latest}?(升级后需重新运行命令)`,
142
+ default: true,
143
+ });
148
144
  if (!doUpgrade) {
149
145
  console.log(" · 已跳过升级");
150
146
  return;