openfeel 1.0.0 → 1.0.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.
package/bin/openfeel.js CHANGED
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
- // OpenFeel CLI 入口 — 加载并启动 Commander 程序
3
- // 无参数时进入 REPL 交互模式,有参数时正常 CLI 模式
4
- import { program, applyHelpI18n, startRepl } from '../dist/cli/index.js';
5
-
6
- const args = process.argv.slice(2);
7
- // 在 parse 前注入翻译,此时命令树已就绪
8
- applyHelpI18n(program);
9
- if (args.length === 0) {
10
- startRepl(program);
11
- } else {
12
- program.parse();
13
- }
2
+ // OpenFeel CLI 入口 — 加载并启动 Commander 程序
3
+ // 无参数时进入 REPL 交互模式,有参数时正常 CLI 模式
4
+ import { program, applyHelpI18n, startRepl } from '../dist/cli/index.js';
5
+
6
+ const args = process.argv.slice(2);
7
+ // 在 parse 前注入翻译,此时命令树已就绪
8
+ applyHelpI18n(program);
9
+ if (args.length === 0) {
10
+ startRepl(program);
11
+ } else {
12
+ program.parse();
13
+ }
@@ -54,24 +54,24 @@ export function archiveStage(projectPath, stageName) {
54
54
  // 归档时间
55
55
  const archivedAt = new Date().toISOString();
56
56
  // 生成 Markdown 格式归档摘要
57
- const summary = `# 归档摘要 — ${stageName}
58
-
59
- - **归档时间**:${archivedAt}
60
- - **阶段名称**:${stageName}
61
- - **阶段状态**:${stage.status}
62
- - **依赖阶段**:${stage.deps.length > 0 ? stage.deps.join(', ') : '无'}
63
-
64
- ## 操作产出
65
-
66
- | ID | 标题 | 状态 | 尝试次数 |
67
- |----|------|------|----------|
68
- ${opRows}
69
-
70
- ## 审查记录
71
-
72
- | ID | 标题 | 状态 | 优先级 |
73
- |----|------|------|--------|
74
- ${reviewRows}
57
+ const summary = `# 归档摘要 — ${stageName}
58
+
59
+ - **归档时间**:${archivedAt}
60
+ - **阶段名称**:${stageName}
61
+ - **阶段状态**:${stage.status}
62
+ - **依赖阶段**:${stage.deps.length > 0 ? stage.deps.join(', ') : '无'}
63
+
64
+ ## 操作产出
65
+
66
+ | ID | 标题 | 状态 | 尝试次数 |
67
+ |----|------|------|----------|
68
+ ${opRows}
69
+
70
+ ## 审查记录
71
+
72
+ | ID | 标题 | 状态 | 优先级 |
73
+ |----|------|------|--------|
74
+ ${reviewRows}
75
75
  `;
76
76
  // 从 closed/resolved 状态的审查条目中提取知识描述
77
77
  const knowledgeExtracts = relatedReviews
@@ -227,116 +227,116 @@ export function readConfig(projectPath) {
227
227
  return normalizeConfig(parsed);
228
228
  }
229
229
  /** 中文版 config.yaml 模板 */
230
- const CONFIG_TEMPLATE_ZH = `# .openfeel/config.yaml
231
- # OpenFeel 项目全局工作流配置
232
- # 级联优先级:用户指令 > status.md 局部覆盖 > 本文件 defaults
233
- # 本文件为所有阶段提供默认值,status.md 可覆盖
234
-
235
- meta:
236
- version: 1.0.0
237
- project: OpenFeel
238
- tech_stack: TypeScript
239
-
240
- # ---- 工作流默认配置 ----
241
- # 所有阶段 status.md 的初始值由此处写入
242
- # 部署模板默认 auto+enabled,仓库自身默认 manual+disabled
243
-
244
- defaults:
245
- # 执行模式:manual=人工流程,agent 不自动接管
246
- # auto=Agent 可按状态机自动推进
247
- execution_mode: ${DEFAULT_CONFIG.execution_mode}
248
-
249
- # 自动推进:disabled=关闭自动闭环
250
- # enabled=在 execution_mode=auto 时允许自动调度
251
- auto_advance: ${DEFAULT_CONFIG.auto_advance}
252
-
253
- # 测试阶段:true=review_passed 后进入 test_writing→testing→bug_fixing 链路
254
- # false=review_passed 直接转 done,跳过测试链路
255
- test_enabled: ${String(DEFAULT_CONFIG.test_enabled)}
256
-
257
- # Worktree 合并模式:manual=手动确认合并
258
- # auto=Feel 自动 git merge + cleanup
259
- merge_mode: ${DEFAULT_CONFIG.merge_mode}
260
-
261
- # ---- 模型配置 ----
262
- # 配置 Agent 使用的模型后端。支持 Agent/角色 级精细化覆盖。
263
- # 注:实际模型由平台层分配,此处为 Awareness 目的。
264
- models:
265
- # 默认模型(兜底配置,所有未显式配置的 Agent 使用此模型)
266
- default:
267
- provider: deepseek
268
- model_name: deepseek-v4-pro
269
- # Agent 级覆盖(可选):为特定 Agent ID 分配不同模型
270
- # agents:
271
- # feel:
272
- # provider: deepseek
273
- # model_name: deepseek-v4-pro
274
- # 角色级覆盖(可选):按 Agent frontmatter model 字段匹配
275
- roles:
276
- # 快速模型:Executor、事务官 等执行类 Agent
277
- fast:
278
- provider: deepseek
279
- model_name: deepseek-v4-flash
280
- # 异种模型:Reviewer 交叉审查用(GLM 系列,与 DeepSeek 不同架构)
281
- cross_model:
282
- provider: zhipu
283
- model_name: glm-5.1
230
+ const CONFIG_TEMPLATE_ZH = `# .openfeel/config.yaml
231
+ # OpenFeel 项目全局工作流配置
232
+ # 级联优先级:用户指令 > status.md 局部覆盖 > 本文件 defaults
233
+ # 本文件为所有阶段提供默认值,status.md 可覆盖
234
+
235
+ meta:
236
+ version: 1.0.0
237
+ project: OpenFeel
238
+ tech_stack: TypeScript
239
+
240
+ # ---- 工作流默认配置 ----
241
+ # 所有阶段 status.md 的初始值由此处写入
242
+ # 部署模板默认 auto+enabled,仓库自身默认 manual+disabled
243
+
244
+ defaults:
245
+ # 执行模式:manual=人工流程,agent 不自动接管
246
+ # auto=Agent 可按状态机自动推进
247
+ execution_mode: ${DEFAULT_CONFIG.execution_mode}
248
+
249
+ # 自动推进:disabled=关闭自动闭环
250
+ # enabled=在 execution_mode=auto 时允许自动调度
251
+ auto_advance: ${DEFAULT_CONFIG.auto_advance}
252
+
253
+ # 测试阶段:true=review_passed 后进入 test_writing→testing→bug_fixing 链路
254
+ # false=review_passed 直接转 done,跳过测试链路
255
+ test_enabled: ${String(DEFAULT_CONFIG.test_enabled)}
256
+
257
+ # Worktree 合并模式:manual=手动确认合并
258
+ # auto=Feel 自动 git merge + cleanup
259
+ merge_mode: ${DEFAULT_CONFIG.merge_mode}
260
+
261
+ # ---- 模型配置 ----
262
+ # 配置 Agent 使用的模型后端。支持 Agent/角色 级精细化覆盖。
263
+ # 注:实际模型由平台层分配,此处为 Awareness 目的。
264
+ models:
265
+ # 默认模型(兜底配置,所有未显式配置的 Agent 使用此模型)
266
+ default:
267
+ provider: deepseek
268
+ model_name: deepseek-v4-pro
269
+ # Agent 级覆盖(可选):为特定 Agent ID 分配不同模型
270
+ # agents:
271
+ # feel:
272
+ # provider: deepseek
273
+ # model_name: deepseek-v4-pro
274
+ # 角色级覆盖(可选):按 Agent frontmatter model 字段匹配
275
+ roles:
276
+ # 快速模型:Executor、事务官 等执行类 Agent
277
+ fast:
278
+ provider: deepseek
279
+ model_name: deepseek-v4-flash
280
+ # 异种模型:Reviewer 交叉审查用(GLM 系列,与 DeepSeek 不同架构)
281
+ cross_model:
282
+ provider: zhipu
283
+ model_name: glm-5.1
284
284
  `;
285
285
  /** 英文版 config.yaml 模板 */
286
- const CONFIG_TEMPLATE_EN = `# .openfeel/config.yaml
287
- # OpenFeel project global workflow configuration
288
- # Cascade priority: user instructions > status.md local overrides > this file defaults
289
- # This file provides defaults for all stages; status.md can override
290
-
291
- meta:
292
- version: 1.0.0
293
- project: OpenFeel
294
- tech_stack: TypeScript
295
-
296
- # ---- Workflow Defaults ----
297
- # Initial values for all stage status.md are written from here
298
- # Deployment template defaults to auto+enabled, repo itself defaults to manual+disabled
299
-
300
- defaults:
301
- # Execution mode: manual=human workflow, agent does not automatically take over
302
- # auto=Agent can advance automatically according to the state machine
303
- execution_mode: ${DEFAULT_CONFIG.execution_mode}
304
-
305
- # Auto advance: disabled=auto-closed-loop off
306
- # enabled=allows auto-scheduling when execution_mode=auto
307
- auto_advance: ${DEFAULT_CONFIG.auto_advance}
308
-
309
- # Test enabled: true=after review_passed, enters test_writing→testing→bug_fixing chain
310
- # false=review_passed directly transitions to done, skipping test chain
311
- test_enabled: ${String(DEFAULT_CONFIG.test_enabled)}
312
-
313
- # Worktree merge mode: manual=manually confirm merge
314
- # auto=Feel auto git merge + cleanup
315
- merge_mode: ${DEFAULT_CONFIG.merge_mode}
316
-
317
- # ---- Model Configuration ----
318
- # Configure the model backend used by Agents. Supports Agent/role level fine-grained overrides.
319
- # Note: Actual models are allocated by the platform layer; this is for Awareness purposes.
320
- models:
321
- # Default model (fallback configuration, all Agents without explicit config use this model)
322
- default:
323
- provider: deepseek
324
- model_name: deepseek-v4-pro
325
- # Agent-level override (optional): assign a different model for a specific Agent ID
326
- # agents:
327
- # feel:
328
- # provider: deepseek
329
- # model_name: deepseek-v4-pro
330
- # Role-level override (optional): matches by Agent frontmatter model field
331
- roles:
332
- # Fast model: Executor, Utility Agent and other execution-type Agents
333
- fast:
334
- provider: deepseek
335
- model_name: deepseek-v4-flash
336
- # Cross-review model: Reviewer (GLM series, different architecture from DeepSeek)
337
- cross_model:
338
- provider: zhipu
339
- model_name: glm-5.1
286
+ const CONFIG_TEMPLATE_EN = `# .openfeel/config.yaml
287
+ # OpenFeel project global workflow configuration
288
+ # Cascade priority: user instructions > status.md local overrides > this file defaults
289
+ # This file provides defaults for all stages; status.md can override
290
+
291
+ meta:
292
+ version: 1.0.0
293
+ project: OpenFeel
294
+ tech_stack: TypeScript
295
+
296
+ # ---- Workflow Defaults ----
297
+ # Initial values for all stage status.md are written from here
298
+ # Deployment template defaults to auto+enabled, repo itself defaults to manual+disabled
299
+
300
+ defaults:
301
+ # Execution mode: manual=human workflow, agent does not automatically take over
302
+ # auto=Agent can advance automatically according to the state machine
303
+ execution_mode: ${DEFAULT_CONFIG.execution_mode}
304
+
305
+ # Auto advance: disabled=auto-closed-loop off
306
+ # enabled=allows auto-scheduling when execution_mode=auto
307
+ auto_advance: ${DEFAULT_CONFIG.auto_advance}
308
+
309
+ # Test enabled: true=after review_passed, enters test_writing→testing→bug_fixing chain
310
+ # false=review_passed directly transitions to done, skipping test chain
311
+ test_enabled: ${String(DEFAULT_CONFIG.test_enabled)}
312
+
313
+ # Worktree merge mode: manual=manually confirm merge
314
+ # auto=Feel auto git merge + cleanup
315
+ merge_mode: ${DEFAULT_CONFIG.merge_mode}
316
+
317
+ # ---- Model Configuration ----
318
+ # Configure the model backend used by Agents. Supports Agent/role level fine-grained overrides.
319
+ # Note: Actual models are allocated by the platform layer; this is for Awareness purposes.
320
+ models:
321
+ # Default model (fallback configuration, all Agents without explicit config use this model)
322
+ default:
323
+ provider: deepseek
324
+ model_name: deepseek-v4-pro
325
+ # Agent-level override (optional): assign a different model for a specific Agent ID
326
+ # agents:
327
+ # feel:
328
+ # provider: deepseek
329
+ # model_name: deepseek-v4-pro
330
+ # Role-level override (optional): matches by Agent frontmatter model field
331
+ roles:
332
+ # Fast model: Executor, Utility Agent and other execution-type Agents
333
+ fast:
334
+ provider: deepseek
335
+ model_name: deepseek-v4-flash
336
+ # Cross-review model: Reviewer (GLM series, different architecture from DeepSeek)
337
+ cross_model:
338
+ provider: zhipu
339
+ model_name: glm-5.1
340
340
  `;
341
341
  /**
342
342
  * 写入默认配置到 .openfeel/config.yaml
@@ -549,13 +549,13 @@ export class FlowManager {
549
549
  const filePath = resolve(logDir, fileName);
550
550
  // 仅当文件不存在时创建(幂等性)
551
551
  if (!existsSync(filePath)) {
552
- const content = `# ${fileName.replace('.md', '')}
553
- - **时间**:${now.toISOString()}
554
- - **阶段**:${stageId}
555
- - **节点**:${label}
556
- - **状态**:待填充
557
-
558
- > 此文件由流水线自动创建。请在此记录操作详情。
552
+ const content = `# ${fileName.replace('.md', '')}
553
+ - **时间**:${now.toISOString()}
554
+ - **阶段**:${stageId}
555
+ - **节点**:${label}
556
+ - **状态**:待填充
557
+
558
+ > 此文件由流水线自动创建。请在此记录操作详情。
559
559
  `;
560
560
  writeFileSync(filePath, content, 'utf-8');
561
561
  }
@@ -10,29 +10,29 @@ import { FlowManager } from '../flow-manager.js';
10
10
  * 生成操作方案的固定 Markdown 模板
11
11
  */
12
12
  function generateSchemeTemplate(opId, stageName, title) {
13
- return `# ${opId}:${title}
14
-
15
- - **阶段**:${stageName}
16
- - **状态**:pending
17
- - **前置**:无
18
- - **负责 Agent**:Executor
19
- - **最多重试**:3
20
-
21
- ## 目标
22
- ${title}
23
-
24
- ## 实施步骤
25
- - [ ] 待补充
26
-
27
- ## 产出文件
28
- - 待补充
29
-
30
- ## 自测清单
31
- - [ ] 待补充
32
-
33
- ## 修正记录
34
- | 次数 | 时间 | 问题 | 修正内容 |
35
- |------|------|------|----------|
13
+ return `# ${opId}:${title}
14
+
15
+ - **阶段**:${stageName}
16
+ - **状态**:pending
17
+ - **前置**:无
18
+ - **负责 Agent**:Executor
19
+ - **最多重试**:3
20
+
21
+ ## 目标
22
+ ${title}
23
+
24
+ ## 实施步骤
25
+ - [ ] 待补充
26
+
27
+ ## 产出文件
28
+ - 待补充
29
+
30
+ ## 自测清单
31
+ - [ ] 待补充
32
+
33
+ ## 修正记录
34
+ | 次数 | 时间 | 问题 | 修正内容 |
35
+ |------|------|------|----------|
36
36
  `;
37
37
  }
38
38
  /**
@@ -26,55 +26,55 @@ export function addStage(projectPath, name, deps) {
26
26
  const overviewPath = join(stageDir, 'overview.md');
27
27
  if (!existsSync(overviewPath)) {
28
28
  const depsText = deps && deps.length > 0 ? deps.map((d) => `- ${d}`).join('\n') : '无';
29
- const overviewContent = `# ${name}
30
-
31
- ## 目标
32
-
33
- > 待补充
34
-
35
- ## 依赖
36
-
37
- ${depsText}
38
-
39
- ## 操作方案
40
-
41
- > 待补充
29
+ const overviewContent = `# ${name}
30
+
31
+ ## 目标
32
+
33
+ > 待补充
34
+
35
+ ## 依赖
36
+
37
+ ${depsText}
38
+
39
+ ## 操作方案
40
+
41
+ > 待补充
42
42
  `;
43
43
  writeFileSync(overviewPath, overviewContent, 'utf-8');
44
44
  }
45
45
  // 创建 status.md(若不存在)
46
46
  const statusPath = join(stageDir, 'status.md');
47
47
  if (!existsSync(statusPath)) {
48
- const statusContent = `# ${name} 状态
49
-
50
- - **执行模式**:manual
51
- - **自动推进**:disabled
52
- - **状态**:planned
53
- - **当前责任 Agent**:user
54
- - **上一责任 Agent**:none
55
- - **更新时间**:${new Date().toISOString().replace('T', ' ').substring(0, 16)}
56
-
57
- ## Worktree / Session
58
-
59
- - **工作模式**:manual
60
- - **分支名**:-
61
- - **Session 名称**:-
62
- - **合并状态**:not_started
63
- - **清理策略**:manual
64
-
65
- ## 当前任务
66
-
67
- > 待补充
68
-
69
- ## 阻塞 / 暂停原因
70
-
71
- 无
72
-
73
- ## 状态记录
74
-
75
- | 时间 | Agent | 状态变化 | 说明 |
76
- |------|-------|----------|------|
77
- | ${new Date().toISOString().replace('T', ' ').substring(0, 16)} | user | planned | 阶段已创建 |
48
+ const statusContent = `# ${name} 状态
49
+
50
+ - **执行模式**:manual
51
+ - **自动推进**:disabled
52
+ - **状态**:planned
53
+ - **当前责任 Agent**:user
54
+ - **上一责任 Agent**:none
55
+ - **更新时间**:${new Date().toISOString().replace('T', ' ').substring(0, 16)}
56
+
57
+ ## Worktree / Session
58
+
59
+ - **工作模式**:manual
60
+ - **分支名**:-
61
+ - **Session 名称**:-
62
+ - **合并状态**:not_started
63
+ - **清理策略**:manual
64
+
65
+ ## 当前任务
66
+
67
+ > 待补充
68
+
69
+ ## 阻塞 / 暂停原因
70
+
71
+ 无
72
+
73
+ ## 状态记录
74
+
75
+ | 时间 | Agent | 状态变化 | 说明 |
76
+ |------|-------|----------|------|
77
+ | ${new Date().toISOString().replace('T', ' ').substring(0, 16)} | user | planned | 阶段已创建 |
78
78
  `;
79
79
  writeFileSync(statusPath, statusContent, 'utf-8');
80
80
  }
@@ -1 +1 @@
1
- {"version":3,"file":"template-loader.d.ts","sourceRoot":"","sources":["../../src/core/template-loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAuvFH;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAWvE;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAGnD;AAED,4CAA4C;AAC5C,MAAM,MAAM,YAAY,GAAG,mBAAmB,GAAG,WAAW,CAAC;AAE7D,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,GAAG,MAAM,CAe7E;AAGD,eAAO,MAAM,kBAAkB,EAAE,MAAqC,CAAC;AACvE,eAAO,MAAM,8BAA8B,EAAE,MAA6C,CAAC"}
1
+ {"version":3,"file":"template-loader.d.ts","sourceRoot":"","sources":["../../src/core/template-loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAuwFH;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAWvE;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAGnD;AAED,4CAA4C;AAC5C,MAAM,MAAM,YAAY,GAAG,mBAAmB,GAAG,WAAW,CAAC;AAE7D,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,GAAG,MAAM,CAe7E;AAGD,eAAO,MAAM,kBAAkB,EAAE,MAAqC,CAAC;AACvE,eAAO,MAAM,8BAA8B,EAAE,MAA6C,CAAC"}