@sushanglewis/lincoln 1.5.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 ADDED
@@ -0,0 +1,193 @@
1
+ # Lincoln TUI
2
+
3
+ Lincoln TUI 是 Lincoln 工作流的终端录音入口。它提供一个基于键盘的交互界面,让产品经理可以快速录制访谈、查看录音状态,并在停止后获得下一步处理命令。
4
+
5
+ ## 功能
6
+
7
+ - **Ready Screen**:启动前确认 session、topic、design、branch
8
+ - **菜单选择器**:↑/↓ 切换选项,Enter 确认,q / Esc 退出
9
+ - **实时录音界面**:显示录音时长和音量条(bar / dot / wave 三种样式)
10
+ - **停止确认**:自动给出 `claude process-interview <sessionId>` 命令
11
+ - **配置分层**:CLI 参数 > 项目级 `.lincolnrc` > 用户级 `~/.lincolnrc` > 默认值
12
+
13
+ ## 安装
14
+
15
+ ```bash
16
+ cd tools/lincoln
17
+ npm install
18
+ npm run build
19
+ npm link
20
+ ```
21
+
22
+ 安装后,全局可用:
23
+
24
+ ```bash
25
+ lincoln --help
26
+ ```
27
+
28
+ ## 使用
29
+
30
+ ### 基本用法
31
+
32
+ ```bash
33
+ lincoln 2026-06-28-checkout-interview \
34
+ --topic "结算流程 redesign 需求访谈" \
35
+ --design-id checkout-redesign \
36
+ --branch lincoln/2026-06-28-recording-checkout-redesign
37
+ ```
38
+
39
+ ### 使用项目级配置 `.lincolnrc`
40
+
41
+ ```bash
42
+ # 在项目根目录创建 .lincolnrc
43
+ cat > .lincolnrc <<EOF
44
+ topic: "结算流程 redesign 需求访谈"
45
+ design-id: checkout-redesign
46
+ branch: lincoln/2026-06-28-recording-checkout-redesign
47
+ audio-meter-style: wave
48
+ EOF
49
+
50
+ # 直接运行
51
+ lincoln 2026-06-28-checkout-interview
52
+ ```
53
+
54
+ ### 用户级配置
55
+
56
+ ```bash
57
+ cat > ~/.lincolnrc <<EOF
58
+ topic: "默认访谈主题"
59
+ design-id: default-design
60
+ branch: main
61
+ EOF
62
+ ```
63
+
64
+ 配置优先级:**CLI 参数 > `.lincolnrc` > `~/.lincolnrc` > 默认值**。
65
+
66
+ ## 快捷键
67
+
68
+ | 按键 | Ready Screen | Recording Screen | Stopped Screen |
69
+ |------|--------------|------------------|----------------|
70
+ | ↑ / ↓ | 移动菜单选择 | — | — |
71
+ | Enter | 确认选中项(开始录音 / 退出) | 停止录音 | 退出 |
72
+ | q / Esc | 退出 | 取消录音并退出 | 退出 |
73
+ | Ctrl+C | 退出 | 取消录音并退出 | 退出 |
74
+
75
+ ## 界面说明
76
+
77
+ ### Ready Screen
78
+
79
+ ```
80
+ ╭────────────────────────────────────────╮
81
+ │ ● ● ● Lincoln Recorder │
82
+ │ │
83
+ │ Session: 2026-06-28-checkout-interview │
84
+ │ Topic: 结算流程 redesign 需求访谈 │
85
+ │ Design: checkout-redesign │
86
+ │ Branch: lincoln/... │
87
+ │ │
88
+ │ ▸ 开始录音 [Enter] │
89
+ │ 退出 [q / Esc] │
90
+ ╰────────────────────────────────────────╯
91
+ ```
92
+
93
+ ### Recording Screen
94
+
95
+ 录音中显示当前时长和实时音量条。
96
+
97
+ ### Stopped Screen
98
+
99
+ ```
100
+ Stopped
101
+ Session 2026-06-28-checkout-interview saved.
102
+
103
+ Run this command in your terminal to generate knowledge artifacts:
104
+ claude process-interview 2026-06-28-checkout-interview
105
+
106
+ [any key] Exit
107
+ ```
108
+
109
+ 复制命令并在同一终端运行,即可触发访谈转写和摘要。
110
+
111
+ ## CLI 选项
112
+
113
+ ```
114
+ lincoln [session-id] [options]
115
+
116
+ Options:
117
+ --topic 访谈主题
118
+ --design-id 设计 ID
119
+ --branch Lincoln feature 分支名
120
+ --session-id 显式指定 session ID
121
+ --no-tui 不使用终端 UI 运行
122
+ --help, -h 显示帮助
123
+ ```
124
+
125
+ ## 开发
126
+
127
+ ```bash
128
+ cd tools/lincoln
129
+
130
+ # 安装依赖
131
+ npm install
132
+
133
+ # 开发模式(监听)
134
+ npm run dev
135
+
136
+ # 类型检查
137
+ npm run typecheck
138
+
139
+ # 运行测试
140
+ npm test
141
+
142
+ # 构建
143
+ npm run build
144
+ ```
145
+
146
+ ## 测试
147
+
148
+ 使用 Vitest + `ink-testing-library`:
149
+
150
+ ```bash
151
+ npm test
152
+ ```
153
+
154
+ 测试覆盖:
155
+
156
+ - 配置加载与合并
157
+ - Ready Screen 渲染和菜单选择
158
+ - 按键处理(Enter、q、Esc、方向键)
159
+ - 录音生命周期(start、stop、cancel)
160
+ - 停止后命令显示
161
+ - `useRecorder` hooks 依赖稳定性
162
+
163
+ ## 架构
164
+
165
+ ```
166
+ tools/lincoln/
167
+ ├── src/
168
+ │ ├── main.ts # CLI 入口
169
+ │ ├── config/ # 配置加载
170
+ │ ├── components/ # Ink UI 组件
171
+ │ ├── hooks/ # 通用 React hooks
172
+ │ └── recording/ # 录音子进程控制
173
+ ├── tests/ # Vitest 测试
174
+ ├── package.json
175
+ ├── tsconfig.json
176
+ └── README.md
177
+ ```
178
+
179
+ ## 与 lincoln-record 的关系
180
+
181
+ Lincoln TUI 本身不直接访问音频设备。它通过子进程启动 `tools/lincoln-record` Rust CLI,由后者完成本地录音与转写(whisper-rs + Metal 加速、说话人分离)。
182
+
183
+ TUI 只负责呈现界面和管理用户输入。停止录音后,TUI 打印命令,由用户手动触发 `claude process-interview`,避免嵌套 Claude Code 会话。
184
+
185
+ ## 依赖
186
+
187
+ - Node.js >= 20
188
+ - `lincoln-record`(Rust 本地录音转写 CLI,见 `tools/lincoln-record/`,需用 cargo 构建)
189
+ - `claude` CLI(用于后续 `process-interview` 步骤)
190
+
191
+ ## 许可证
192
+
193
+ MIT