openfeel 1.0.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/LICENSE +21 -0
- package/README.en.md +140 -0
- package/README.md +17 -0
- package/README.zh-CN.md +140 -0
- package/bin/openfeel.js +13 -0
- package/dist/cli/index.d.ts +11 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +119 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/repl.d.ts +10 -0
- package/dist/cli/repl.d.ts.map +1 -0
- package/dist/cli/repl.js +74 -0
- package/dist/cli/repl.js.map +1 -0
- package/dist/commands/archive.d.ts +7 -0
- package/dist/commands/archive.d.ts.map +1 -0
- package/dist/commands/archive.js +38 -0
- package/dist/commands/archive.js.map +1 -0
- package/dist/commands/config.d.ts +15 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +208 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/flow.d.ts +24 -0
- package/dist/commands/flow.d.ts.map +1 -0
- package/dist/commands/flow.js +1024 -0
- package/dist/commands/flow.js.map +1 -0
- package/dist/commands/init.d.ts +9 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +62 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/instructions.d.ts +7 -0
- package/dist/commands/instructions.d.ts.map +1 -0
- package/dist/commands/instructions.js +36 -0
- package/dist/commands/instructions.js.map +1 -0
- package/dist/commands/knowledge.d.ts +7 -0
- package/dist/commands/knowledge.d.ts.map +1 -0
- package/dist/commands/knowledge.js +174 -0
- package/dist/commands/knowledge.js.map +1 -0
- package/dist/commands/lint.d.ts +12 -0
- package/dist/commands/lint.d.ts.map +1 -0
- package/dist/commands/lint.js +192 -0
- package/dist/commands/lint.js.map +1 -0
- package/dist/commands/plan.d.ts +7 -0
- package/dist/commands/plan.d.ts.map +1 -0
- package/dist/commands/plan.js +73 -0
- package/dist/commands/plan.js.map +1 -0
- package/dist/commands/project.d.ts +7 -0
- package/dist/commands/project.d.ts.map +1 -0
- package/dist/commands/project.js +189 -0
- package/dist/commands/project.js.map +1 -0
- package/dist/commands/roadmap.d.ts +7 -0
- package/dist/commands/roadmap.d.ts.map +1 -0
- package/dist/commands/roadmap.js +26 -0
- package/dist/commands/roadmap.js.map +1 -0
- package/dist/commands/stage.d.ts +17 -0
- package/dist/commands/stage.d.ts.map +1 -0
- package/dist/commands/stage.js +291 -0
- package/dist/commands/stage.js.map +1 -0
- package/dist/commands/update.d.ts +8 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +87 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/commands/view.d.ts +7 -0
- package/dist/commands/view.d.ts.map +1 -0
- package/dist/commands/view.js +77 -0
- package/dist/commands/view.js.map +1 -0
- package/dist/core/archive/merge.d.ts +20 -0
- package/dist/core/archive/merge.d.ts.map +1 -0
- package/dist/core/archive/merge.js +118 -0
- package/dist/core/archive/merge.js.map +1 -0
- package/dist/core/artifact-graph/graph.d.ts +62 -0
- package/dist/core/artifact-graph/graph.d.ts.map +1 -0
- package/dist/core/artifact-graph/graph.js +184 -0
- package/dist/core/artifact-graph/graph.js.map +1 -0
- package/dist/core/artifact-graph/index.d.ts +10 -0
- package/dist/core/artifact-graph/index.d.ts.map +1 -0
- package/dist/core/artifact-graph/index.js +8 -0
- package/dist/core/artifact-graph/index.js.map +1 -0
- package/dist/core/artifact-graph/instruction-loader.d.ts +35 -0
- package/dist/core/artifact-graph/instruction-loader.d.ts.map +1 -0
- package/dist/core/artifact-graph/instruction-loader.js +358 -0
- package/dist/core/artifact-graph/instruction-loader.js.map +1 -0
- package/dist/core/artifact-graph/resolver.d.ts +10 -0
- package/dist/core/artifact-graph/resolver.d.ts.map +1 -0
- package/dist/core/artifact-graph/resolver.js +32 -0
- package/dist/core/artifact-graph/resolver.js.map +1 -0
- package/dist/core/artifact-graph/state.d.ts +9 -0
- package/dist/core/artifact-graph/state.d.ts.map +1 -0
- package/dist/core/artifact-graph/state.js +24 -0
- package/dist/core/artifact-graph/state.js.map +1 -0
- package/dist/core/artifact-graph/types.d.ts +22 -0
- package/dist/core/artifact-graph/types.d.ts.map +1 -0
- package/dist/core/artifact-graph/types.js +2 -0
- package/dist/core/artifact-graph/types.js.map +1 -0
- package/dist/core/config.d.ts +256 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +393 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/flow-manager.d.ts +492 -0
- package/dist/core/flow-manager.d.ts.map +1 -0
- package/dist/core/flow-manager.js +2379 -0
- package/dist/core/flow-manager.js.map +1 -0
- package/dist/core/i18n-data/en.d.ts +26 -0
- package/dist/core/i18n-data/en.d.ts.map +1 -0
- package/dist/core/i18n-data/en.js +492 -0
- package/dist/core/i18n-data/en.js.map +1 -0
- package/dist/core/i18n-data/types.d.ts +18 -0
- package/dist/core/i18n-data/types.d.ts.map +1 -0
- package/dist/core/i18n-data/types.js +8 -0
- package/dist/core/i18n-data/types.js.map +1 -0
- package/dist/core/i18n-data/zh-CN.d.ts +28 -0
- package/dist/core/i18n-data/zh-CN.d.ts.map +1 -0
- package/dist/core/i18n-data/zh-CN.js +524 -0
- package/dist/core/i18n-data/zh-CN.js.map +1 -0
- package/dist/core/i18n.d.ts +40 -0
- package/dist/core/i18n.d.ts.map +1 -0
- package/dist/core/i18n.js +135 -0
- package/dist/core/i18n.js.map +1 -0
- package/dist/core/init.d.ts +22 -0
- package/dist/core/init.d.ts.map +1 -0
- package/dist/core/init.js +292 -0
- package/dist/core/init.js.map +1 -0
- package/dist/core/metrics.d.ts +60 -0
- package/dist/core/metrics.d.ts.map +1 -0
- package/dist/core/metrics.js +137 -0
- package/dist/core/metrics.js.map +1 -0
- package/dist/core/pipeline-schema.d.ts +78 -0
- package/dist/core/pipeline-schema.d.ts.map +1 -0
- package/dist/core/pipeline-schema.js +57 -0
- package/dist/core/pipeline-schema.js.map +1 -0
- package/dist/core/plan/roadmap.d.ts +17 -0
- package/dist/core/plan/roadmap.d.ts.map +1 -0
- package/dist/core/plan/roadmap.js +71 -0
- package/dist/core/plan/roadmap.js.map +1 -0
- package/dist/core/plan/scheme.d.ts +34 -0
- package/dist/core/plan/scheme.d.ts.map +1 -0
- package/dist/core/plan/scheme.js +262 -0
- package/dist/core/plan/scheme.js.map +1 -0
- package/dist/core/plan/stage.d.ts +20 -0
- package/dist/core/plan/stage.d.ts.map +1 -0
- package/dist/core/plan/stage.js +120 -0
- package/dist/core/plan/stage.js.map +1 -0
- package/dist/core/public-logger.d.ts +84 -0
- package/dist/core/public-logger.d.ts.map +1 -0
- package/dist/core/public-logger.js +344 -0
- package/dist/core/public-logger.js.map +1 -0
- package/dist/core/schema.d.ts +70 -0
- package/dist/core/schema.d.ts.map +1 -0
- package/dist/core/schema.js +61 -0
- package/dist/core/schema.js.map +1 -0
- package/dist/core/template-loader.d.ts +22 -0
- package/dist/core/template-loader.d.ts.map +1 -0
- package/dist/core/template-loader.js +2848 -0
- package/dist/core/template-loader.js.map +1 -0
- package/dist/core/templates.d.ts +18 -0
- package/dist/core/templates.d.ts.map +1 -0
- package/dist/core/templates.js +50 -0
- package/dist/core/templates.js.map +1 -0
- package/dist/core/update.d.ts +40 -0
- package/dist/core/update.d.ts.map +1 -0
- package/dist/core/update.js +1569 -0
- package/dist/core/update.js.map +1 -0
- package/dist/core/view/entry.d.ts +37 -0
- package/dist/core/view/entry.d.ts.map +1 -0
- package/dist/core/view/entry.js +108 -0
- package/dist/core/view/entry.js.map +1 -0
- package/dist/core/workspace/identity.d.ts +60 -0
- package/dist/core/workspace/identity.d.ts.map +1 -0
- package/dist/core/workspace/identity.js +169 -0
- package/dist/core/workspace/identity.js.map +1 -0
- package/dist/core/workspace/knowledge.d.ts +55 -0
- package/dist/core/workspace/knowledge.d.ts.map +1 -0
- package/dist/core/workspace/knowledge.js +230 -0
- package/dist/core/workspace/knowledge.js.map +1 -0
- package/dist/core/workspace/structure.d.ts +9 -0
- package/dist/core/workspace/structure.d.ts.map +1 -0
- package/dist/core/workspace/structure.js +59 -0
- package/dist/core/workspace/structure.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/utils/kb-dedup.d.ts +46 -0
- package/dist/utils/kb-dedup.d.ts.map +1 -0
- package/dist/utils/kb-dedup.js +169 -0
- package/dist/utils/kb-dedup.js.map +1 -0
- package/dist/utils/path.d.ts +22 -0
- package/dist/utils/path.d.ts.map +1 -0
- package/dist/utils/path.js +37 -0
- package/dist/utils/path.js.map +1 -0
- package/package.json +61 -0
- package/schemas/spec-driven/schema.yaml +50 -0
- package/schemas/spec-driven/templates/design.md +43 -0
- package/schemas/spec-driven/templates/plan.md +46 -0
- package/schemas/spec-driven/templates/proposal.md +35 -0
- package/schemas/spec-driven/templates/tasks.md +39 -0
- package/scripts/patch-inquirer.js +70 -0
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** meta 块 Schema(允许扩展字段) */
|
|
3
|
+
export declare const ConfigMetaSchema: z.ZodObject<{
|
|
4
|
+
version: z.ZodOptional<z.ZodString>;
|
|
5
|
+
project: z.ZodOptional<z.ZodString>;
|
|
6
|
+
tech_stack: z.ZodOptional<z.ZodString>;
|
|
7
|
+
}, z.core.$loose>;
|
|
8
|
+
/** defaults 块 Schema(允许扩展字段) */
|
|
9
|
+
export declare const ConfigDefaultsSchema: z.ZodObject<{
|
|
10
|
+
execution_mode: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
11
|
+
manual: "manual";
|
|
12
|
+
auto: "auto";
|
|
13
|
+
}>>>;
|
|
14
|
+
auto_advance: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
15
|
+
disabled: "disabled";
|
|
16
|
+
enabled: "enabled";
|
|
17
|
+
}>>>;
|
|
18
|
+
test_enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
19
|
+
merge_mode: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
20
|
+
manual: "manual";
|
|
21
|
+
auto: "auto";
|
|
22
|
+
}>>>;
|
|
23
|
+
}, z.core.$loose>;
|
|
24
|
+
/** 单个模型配置 Schema */
|
|
25
|
+
export declare const ModelConfigSchema: z.ZodObject<{
|
|
26
|
+
provider: z.ZodString;
|
|
27
|
+
model_name: z.ZodString;
|
|
28
|
+
base_url: z.ZodOptional<z.ZodString>;
|
|
29
|
+
api_key_env: z.ZodOptional<z.ZodString>;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
/** 模型配置节 Schema */
|
|
32
|
+
export declare const ModelsSchema: z.ZodObject<{
|
|
33
|
+
default: z.ZodObject<{
|
|
34
|
+
provider: z.ZodString;
|
|
35
|
+
model_name: z.ZodString;
|
|
36
|
+
base_url: z.ZodOptional<z.ZodString>;
|
|
37
|
+
api_key_env: z.ZodOptional<z.ZodString>;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
40
|
+
provider: z.ZodString;
|
|
41
|
+
model_name: z.ZodString;
|
|
42
|
+
base_url: z.ZodOptional<z.ZodString>;
|
|
43
|
+
api_key_env: z.ZodOptional<z.ZodString>;
|
|
44
|
+
}, z.core.$strip>>>;
|
|
45
|
+
roles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
46
|
+
provider: z.ZodString;
|
|
47
|
+
model_name: z.ZodString;
|
|
48
|
+
base_url: z.ZodOptional<z.ZodString>;
|
|
49
|
+
api_key_env: z.ZodOptional<z.ZodString>;
|
|
50
|
+
}, z.core.$strip>>>;
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
/** 完整的 config.yaml Schema */
|
|
53
|
+
export declare const ConfigSchema: z.ZodObject<{
|
|
54
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
55
|
+
version: z.ZodOptional<z.ZodString>;
|
|
56
|
+
project: z.ZodOptional<z.ZodString>;
|
|
57
|
+
tech_stack: z.ZodOptional<z.ZodString>;
|
|
58
|
+
}, z.core.$loose>>;
|
|
59
|
+
defaults: z.ZodOptional<z.ZodObject<{
|
|
60
|
+
execution_mode: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
61
|
+
manual: "manual";
|
|
62
|
+
auto: "auto";
|
|
63
|
+
}>>>;
|
|
64
|
+
auto_advance: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
65
|
+
disabled: "disabled";
|
|
66
|
+
enabled: "enabled";
|
|
67
|
+
}>>>;
|
|
68
|
+
test_enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
69
|
+
merge_mode: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
70
|
+
manual: "manual";
|
|
71
|
+
auto: "auto";
|
|
72
|
+
}>>>;
|
|
73
|
+
}, z.core.$loose>>;
|
|
74
|
+
models: z.ZodOptional<z.ZodObject<{
|
|
75
|
+
default: z.ZodObject<{
|
|
76
|
+
provider: z.ZodString;
|
|
77
|
+
model_name: z.ZodString;
|
|
78
|
+
base_url: z.ZodOptional<z.ZodString>;
|
|
79
|
+
api_key_env: z.ZodOptional<z.ZodString>;
|
|
80
|
+
}, z.core.$strip>;
|
|
81
|
+
agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
82
|
+
provider: z.ZodString;
|
|
83
|
+
model_name: z.ZodString;
|
|
84
|
+
base_url: z.ZodOptional<z.ZodString>;
|
|
85
|
+
api_key_env: z.ZodOptional<z.ZodString>;
|
|
86
|
+
}, z.core.$strip>>>;
|
|
87
|
+
roles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
88
|
+
provider: z.ZodString;
|
|
89
|
+
model_name: z.ZodString;
|
|
90
|
+
base_url: z.ZodOptional<z.ZodString>;
|
|
91
|
+
api_key_env: z.ZodOptional<z.ZodString>;
|
|
92
|
+
}, z.core.$strip>>>;
|
|
93
|
+
}, z.core.$strip>>;
|
|
94
|
+
}, z.core.$loose>;
|
|
95
|
+
/** 用户基础信息 Schema:姓名 + 偏好语言 */
|
|
96
|
+
export declare const ProfileUserSchema: z.ZodObject<{
|
|
97
|
+
name: z.ZodOptional<z.ZodString>;
|
|
98
|
+
lang: z.ZodOptional<z.ZodEnum<{
|
|
99
|
+
"zh-CN": "zh-CN";
|
|
100
|
+
en: "en";
|
|
101
|
+
}>>;
|
|
102
|
+
}, z.core.$strip>;
|
|
103
|
+
/** 用户偏好 Schema:工作流偏好(全部可选,缺失时使用默认值) */
|
|
104
|
+
export declare const ProfilePreferencesSchema: z.ZodObject<{
|
|
105
|
+
auto_advance: z.ZodOptional<z.ZodEnum<{
|
|
106
|
+
disabled: "disabled";
|
|
107
|
+
enabled: "enabled";
|
|
108
|
+
}>>;
|
|
109
|
+
review_mode: z.ZodOptional<z.ZodEnum<{
|
|
110
|
+
full: "full";
|
|
111
|
+
skip_small_changes: "skip_small_changes";
|
|
112
|
+
}>>;
|
|
113
|
+
communication: z.ZodOptional<z.ZodEnum<{
|
|
114
|
+
concise: "concise";
|
|
115
|
+
detailed: "detailed";
|
|
116
|
+
}>>;
|
|
117
|
+
confirm_threshold: z.ZodOptional<z.ZodEnum<{
|
|
118
|
+
low: "low";
|
|
119
|
+
medium: "medium";
|
|
120
|
+
high: "high";
|
|
121
|
+
}>>;
|
|
122
|
+
}, z.core.$strip>;
|
|
123
|
+
/** 历史记录 Schema:最近项目信息 */
|
|
124
|
+
export declare const ProfileHistorySchema: z.ZodObject<{
|
|
125
|
+
last_project: z.ZodOptional<z.ZodString>;
|
|
126
|
+
recent_projects: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
127
|
+
}, z.core.$strip>;
|
|
128
|
+
/** 完整 Profile Schema:组合三块,全部可选,允许扩展字段 */
|
|
129
|
+
export declare const ProfileSchema: z.ZodObject<{
|
|
130
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
131
|
+
name: z.ZodOptional<z.ZodString>;
|
|
132
|
+
lang: z.ZodOptional<z.ZodEnum<{
|
|
133
|
+
"zh-CN": "zh-CN";
|
|
134
|
+
en: "en";
|
|
135
|
+
}>>;
|
|
136
|
+
}, z.core.$strip>>;
|
|
137
|
+
preferences: z.ZodOptional<z.ZodObject<{
|
|
138
|
+
auto_advance: z.ZodOptional<z.ZodEnum<{
|
|
139
|
+
disabled: "disabled";
|
|
140
|
+
enabled: "enabled";
|
|
141
|
+
}>>;
|
|
142
|
+
review_mode: z.ZodOptional<z.ZodEnum<{
|
|
143
|
+
full: "full";
|
|
144
|
+
skip_small_changes: "skip_small_changes";
|
|
145
|
+
}>>;
|
|
146
|
+
communication: z.ZodOptional<z.ZodEnum<{
|
|
147
|
+
concise: "concise";
|
|
148
|
+
detailed: "detailed";
|
|
149
|
+
}>>;
|
|
150
|
+
confirm_threshold: z.ZodOptional<z.ZodEnum<{
|
|
151
|
+
low: "low";
|
|
152
|
+
medium: "medium";
|
|
153
|
+
high: "high";
|
|
154
|
+
}>>;
|
|
155
|
+
}, z.core.$strip>>;
|
|
156
|
+
history: z.ZodOptional<z.ZodObject<{
|
|
157
|
+
last_project: z.ZodOptional<z.ZodString>;
|
|
158
|
+
recent_projects: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
159
|
+
}, z.core.$strip>>;
|
|
160
|
+
}, z.core.$loose>;
|
|
161
|
+
/** 全局用户画像结构(Zod inferred) */
|
|
162
|
+
export type Profile = z.infer<typeof ProfileSchema>;
|
|
163
|
+
/** 用户基础信息结构 */
|
|
164
|
+
export type UserProfile = z.infer<typeof ProfileUserSchema>;
|
|
165
|
+
/** 用户偏好结构 */
|
|
166
|
+
export type Preferences = z.infer<typeof ProfilePreferencesSchema>;
|
|
167
|
+
/** 历史记录结构 */
|
|
168
|
+
export type History = z.infer<typeof ProfileHistorySchema>;
|
|
169
|
+
/** 模型配置结构 */
|
|
170
|
+
export interface ModelConfig {
|
|
171
|
+
provider: string;
|
|
172
|
+
model_name: string;
|
|
173
|
+
base_url?: string;
|
|
174
|
+
api_key_env?: string;
|
|
175
|
+
}
|
|
176
|
+
/** 模型配置节结构 */
|
|
177
|
+
export interface ModelsConfig {
|
|
178
|
+
default: ModelConfig;
|
|
179
|
+
agents?: Record<string, ModelConfig>;
|
|
180
|
+
roles?: Record<string, ModelConfig>;
|
|
181
|
+
}
|
|
182
|
+
/** 配置文件结构(backward-compatible: 扁平字段 + 嵌套结构并存) */
|
|
183
|
+
export interface Config {
|
|
184
|
+
meta?: {
|
|
185
|
+
version?: string;
|
|
186
|
+
project?: string;
|
|
187
|
+
tech_stack?: string;
|
|
188
|
+
[key: string]: unknown;
|
|
189
|
+
};
|
|
190
|
+
defaults?: {
|
|
191
|
+
execution_mode?: 'manual' | 'auto';
|
|
192
|
+
auto_advance?: 'disabled' | 'enabled';
|
|
193
|
+
test_enabled?: boolean;
|
|
194
|
+
merge_mode?: 'manual' | 'auto';
|
|
195
|
+
[key: string]: unknown;
|
|
196
|
+
};
|
|
197
|
+
models?: ModelsConfig;
|
|
198
|
+
execution_mode?: 'manual' | 'auto';
|
|
199
|
+
auto_advance?: 'disabled' | 'enabled';
|
|
200
|
+
test_enabled?: boolean;
|
|
201
|
+
merge_mode?: 'manual' | 'auto';
|
|
202
|
+
[key: string]: unknown;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* 读取全局用户画像 ~/.config/openfeel/profile.yaml
|
|
206
|
+
* 文件不存在时返回默认 Profile(空用户名、zh-CN、disabled、full、concise、medium、空数组)。
|
|
207
|
+
* 文件存在时用 yaml.parse() 解析 + ProfileSchema.parse() 校验,
|
|
208
|
+
* 缺失字段回填默认值,返回带完整默认值的 Profile。
|
|
209
|
+
* @returns 带默认值的完整 Profile
|
|
210
|
+
*/
|
|
211
|
+
export declare function readProfile(): Profile;
|
|
212
|
+
/**
|
|
213
|
+
* 写入全局用户画像到 ~/.config/openfeel/profile.yaml
|
|
214
|
+
* 自动创建父目录 ~/.config/openfeel/(不存在时)。
|
|
215
|
+
* @param profile 要写入的 Profile 对象
|
|
216
|
+
*/
|
|
217
|
+
export declare function writeProfile(profile: Profile): void;
|
|
218
|
+
/**
|
|
219
|
+
* 确保全局 Profile 关键字段已自动填充
|
|
220
|
+
* 首次使用时 user.name 与 history.last_project 可能为空。
|
|
221
|
+
* 填充规则:
|
|
222
|
+
* 1. user.name 为空时:优先从 .openfeel/.info.json 的 user 字段读取,回退 git config user.name(复用 getUserName)
|
|
223
|
+
* 2. history.last_project 更新为当前 projectPath
|
|
224
|
+
* 3. projectPath 追加到 history.recent_projects 头部(去重,保留最近 5 个)
|
|
225
|
+
* 仅在发生变更时写盘,避免无谓 IO。
|
|
226
|
+
* @param projectPath 当前项目根路径
|
|
227
|
+
*/
|
|
228
|
+
export declare function ensureProfileDefaults(projectPath: string): void;
|
|
229
|
+
/**
|
|
230
|
+
* 读取项目下的 .openfeel/config.yaml
|
|
231
|
+
* 使用 yaml.parse() 解析嵌套结构,Zod Schema 校验,自动规范化
|
|
232
|
+
* 若文件不存在,返回空对象。
|
|
233
|
+
*/
|
|
234
|
+
export declare function readConfig(projectPath: string): Config;
|
|
235
|
+
/**
|
|
236
|
+
* 写入默认配置到 .openfeel/config.yaml
|
|
237
|
+
* @param projectPath 项目路径
|
|
238
|
+
* @param lang 语言,'zh-CN' 或 'en',默认 'zh-CN'
|
|
239
|
+
*/
|
|
240
|
+
export declare function writeDefaultConfig(projectPath: string, lang?: 'zh-CN' | 'en'): void;
|
|
241
|
+
/**
|
|
242
|
+
* 读取项目 config.yaml 中 defaults 块的指定 key
|
|
243
|
+
* @param projectPath 项目根路径
|
|
244
|
+
* @param key 配置键名(如 'auto_advance')
|
|
245
|
+
* @returns 配置值(string),未设置时返回 null
|
|
246
|
+
*/
|
|
247
|
+
export declare function getConfigValue(projectPath: string, key: string): string | null;
|
|
248
|
+
/**
|
|
249
|
+
* 向项目 config.yaml 的 defaults 块写入指定 key
|
|
250
|
+
* 使用 Zod Schema 局部校验 value,通过 yaml.Document 增量修改写回(保留注释与原始结构)
|
|
251
|
+
* @param projectPath 项目根路径
|
|
252
|
+
* @param key 配置键名(当前仅支持 ConfigDefaultsSchema 中定义的键)
|
|
253
|
+
* @param value 配置值
|
|
254
|
+
*/
|
|
255
|
+
export declare function setConfigValue(projectPath: string, key: string, value: string): void;
|
|
256
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,4BAA4B;AAC5B,eAAO,MAAM,gBAAgB;;;;iBAIb,CAAC;AAEjB,gCAAgC;AAChC,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;iBAKjB,CAAC;AAEjB,oBAAoB;AACpB,eAAO,MAAM,iBAAiB;;;;;iBAK5B,CAAC;AAEH,mBAAmB;AACnB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;iBAIvB,CAAC;AAEH,6BAA6B;AAC7B,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAIT,CAAC;AAIjB,8BAA8B;AAC9B,eAAO,MAAM,iBAAiB;;;;;;iBAG5B,CAAC;AAEH,uCAAuC;AACvC,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;iBAKnC,CAAC;AAEH,yBAAyB;AACzB,eAAO,MAAM,oBAAoB;;;iBAG/B,CAAC;AAEH,yCAAyC;AACzC,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAIV,CAAC;AAIjB,6BAA6B;AAC7B,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,eAAe;AACf,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;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AC;IACvB,UAAU,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAqDD;;;;;;GAMG;AACH,wBAAgB,WAAW,IAAI,OAAO,CAyBrC;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAOnD;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAkC/D;AAID;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAuBtD;AAoHD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,GAAE,OAAO,GAAG,IAAc,GAAG,IAAI,CAI5F;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAU9E;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAqBpF"}
|
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 配置文件读写
|
|
3
|
+
* 管理项目下的 .openfeel/config.yaml 文件,使用 yaml.parse() + Zod Schema 校验。
|
|
4
|
+
* 同时管理全局用户画像 ~/.config/openfeel/profile.yaml(跨项目共享偏好)。
|
|
5
|
+
*/
|
|
6
|
+
import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'node:fs';
|
|
7
|
+
import { resolve, join, dirname } from 'node:path';
|
|
8
|
+
import { homedir } from 'node:os';
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
import { parse as parseYaml, parseDocument, stringify as stringifyYaml } from 'yaml';
|
|
11
|
+
import { getUserName } from './workspace/identity.js';
|
|
12
|
+
// ── Zod Schema ──
|
|
13
|
+
/** meta 块 Schema(允许扩展字段) */
|
|
14
|
+
export const ConfigMetaSchema = z.object({
|
|
15
|
+
version: z.string().optional(),
|
|
16
|
+
project: z.string().optional(),
|
|
17
|
+
tech_stack: z.string().optional(),
|
|
18
|
+
}).passthrough();
|
|
19
|
+
/** defaults 块 Schema(允许扩展字段) */
|
|
20
|
+
export const ConfigDefaultsSchema = z.object({
|
|
21
|
+
execution_mode: z.enum(['manual', 'auto']).optional().default('manual'),
|
|
22
|
+
auto_advance: z.enum(['disabled', 'enabled']).optional().default('disabled'),
|
|
23
|
+
test_enabled: z.boolean().optional().default(false),
|
|
24
|
+
merge_mode: z.enum(['manual', 'auto']).optional().default('manual'),
|
|
25
|
+
}).passthrough();
|
|
26
|
+
/** 单个模型配置 Schema */
|
|
27
|
+
export const ModelConfigSchema = z.object({
|
|
28
|
+
provider: z.string(), // deepseek / openai / anthropic / zhipu / qwen
|
|
29
|
+
model_name: z.string(), // 具体模型 ID
|
|
30
|
+
base_url: z.string().optional(),
|
|
31
|
+
api_key_env: z.string().optional(), // 环境变量名
|
|
32
|
+
});
|
|
33
|
+
/** 模型配置节 Schema */
|
|
34
|
+
export const ModelsSchema = z.object({
|
|
35
|
+
default: ModelConfigSchema, // 兜底(必填)
|
|
36
|
+
agents: z.record(z.string(), ModelConfigSchema).optional(), // Agent 级覆盖
|
|
37
|
+
roles: z.record(z.string(), ModelConfigSchema).optional(), // 角色级覆盖
|
|
38
|
+
});
|
|
39
|
+
/** 完整的 config.yaml Schema */
|
|
40
|
+
export const ConfigSchema = z.object({
|
|
41
|
+
meta: ConfigMetaSchema.optional(),
|
|
42
|
+
defaults: ConfigDefaultsSchema.optional(),
|
|
43
|
+
models: ModelsSchema.optional(),
|
|
44
|
+
}).passthrough();
|
|
45
|
+
// ── 全局用户画像 Profile Schema(v5.0 记忆体系第一层) ──
|
|
46
|
+
/** 用户基础信息 Schema:姓名 + 偏好语言 */
|
|
47
|
+
export const ProfileUserSchema = z.object({
|
|
48
|
+
name: z.string().optional(),
|
|
49
|
+
lang: z.enum(['zh-CN', 'en']).optional(),
|
|
50
|
+
});
|
|
51
|
+
/** 用户偏好 Schema:工作流偏好(全部可选,缺失时使用默认值) */
|
|
52
|
+
export const ProfilePreferencesSchema = z.object({
|
|
53
|
+
auto_advance: z.enum(['enabled', 'disabled']).optional(),
|
|
54
|
+
review_mode: z.enum(['full', 'skip_small_changes']).optional(),
|
|
55
|
+
communication: z.enum(['concise', 'detailed']).optional(),
|
|
56
|
+
confirm_threshold: z.enum(['low', 'medium', 'high']).optional(),
|
|
57
|
+
});
|
|
58
|
+
/** 历史记录 Schema:最近项目信息 */
|
|
59
|
+
export const ProfileHistorySchema = z.object({
|
|
60
|
+
last_project: z.string().optional(),
|
|
61
|
+
recent_projects: z.array(z.string()).optional(),
|
|
62
|
+
});
|
|
63
|
+
/** 完整 Profile Schema:组合三块,全部可选,允许扩展字段 */
|
|
64
|
+
export const ProfileSchema = z.object({
|
|
65
|
+
user: ProfileUserSchema.optional(),
|
|
66
|
+
preferences: ProfilePreferencesSchema.optional(),
|
|
67
|
+
history: ProfileHistorySchema.optional(),
|
|
68
|
+
}).passthrough();
|
|
69
|
+
/** 默认配置值 */
|
|
70
|
+
const DEFAULT_CONFIG = {
|
|
71
|
+
execution_mode: 'manual',
|
|
72
|
+
auto_advance: 'disabled',
|
|
73
|
+
test_enabled: false,
|
|
74
|
+
merge_mode: 'manual',
|
|
75
|
+
};
|
|
76
|
+
// ── 工具函数 ──
|
|
77
|
+
/**
|
|
78
|
+
* 将 Config 的嵌套 defaults 字段提升到顶层
|
|
79
|
+
* 向后兼容旧代码中 config.execution_mode 等扁平访问方式
|
|
80
|
+
*/
|
|
81
|
+
function normalizeConfig(parsed) {
|
|
82
|
+
const result = { ...parsed };
|
|
83
|
+
// 若存在 defaults 块,将其字段提升到顶层(不覆盖已有的顶层值)
|
|
84
|
+
if (result.defaults) {
|
|
85
|
+
const defaults = result.defaults;
|
|
86
|
+
// 提升所有 defaults 字段
|
|
87
|
+
for (const [key, value] of Object.entries(defaults)) {
|
|
88
|
+
if (!(key in result)) {
|
|
89
|
+
result[key] = value;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return result;
|
|
94
|
+
}
|
|
95
|
+
// ── 全局用户画像 Profile 读写(v5.0 记忆体系第一层) ──
|
|
96
|
+
/** 默认全局 Profile(所有字段安全默认值,向后兼容的可选配置字段模式) */
|
|
97
|
+
const DEFAULT_PROFILE = {
|
|
98
|
+
user: { name: '', lang: 'zh-CN' },
|
|
99
|
+
preferences: {
|
|
100
|
+
auto_advance: 'disabled',
|
|
101
|
+
review_mode: 'full',
|
|
102
|
+
communication: 'concise',
|
|
103
|
+
confirm_threshold: 'medium',
|
|
104
|
+
},
|
|
105
|
+
history: { last_project: '', recent_projects: [] },
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* 构造全局 profile.yaml 的路径
|
|
109
|
+
* @returns ~/.config/openfeel/profile.yaml 的绝对路径
|
|
110
|
+
*/
|
|
111
|
+
function getProfilePath() {
|
|
112
|
+
return join(homedir(), '.config', 'openfeel', 'profile.yaml');
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* 读取全局用户画像 ~/.config/openfeel/profile.yaml
|
|
116
|
+
* 文件不存在时返回默认 Profile(空用户名、zh-CN、disabled、full、concise、medium、空数组)。
|
|
117
|
+
* 文件存在时用 yaml.parse() 解析 + ProfileSchema.parse() 校验,
|
|
118
|
+
* 缺失字段回填默认值,返回带完整默认值的 Profile。
|
|
119
|
+
* @returns 带默认值的完整 Profile
|
|
120
|
+
*/
|
|
121
|
+
export function readProfile() {
|
|
122
|
+
const profilePath = getProfilePath();
|
|
123
|
+
if (!existsSync(profilePath)) {
|
|
124
|
+
return { ...DEFAULT_PROFILE };
|
|
125
|
+
}
|
|
126
|
+
try {
|
|
127
|
+
const content = readFileSync(profilePath, 'utf-8');
|
|
128
|
+
const raw = parseYaml(content);
|
|
129
|
+
if (!raw || typeof raw !== 'object') {
|
|
130
|
+
return { ...DEFAULT_PROFILE };
|
|
131
|
+
}
|
|
132
|
+
const parsed = ProfileSchema.parse(raw);
|
|
133
|
+
// 与默认值深度合并:缺失字段回填默认值,同时保留顶层 passthrough 扩展字段
|
|
134
|
+
// (避免后续 writeProfile 全量写回时抹除用户自定义扩展字段,REV-002)
|
|
135
|
+
return {
|
|
136
|
+
...parsed,
|
|
137
|
+
user: { ...DEFAULT_PROFILE.user, ...(parsed.user ?? {}) },
|
|
138
|
+
preferences: { ...DEFAULT_PROFILE.preferences, ...(parsed.preferences ?? {}) },
|
|
139
|
+
history: { ...DEFAULT_PROFILE.history, ...(parsed.history ?? {}) },
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
catch {
|
|
143
|
+
// YAML 解析失败或 Zod 校验失败时回退默认值(保持可用性)
|
|
144
|
+
return { ...DEFAULT_PROFILE };
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* 写入全局用户画像到 ~/.config/openfeel/profile.yaml
|
|
149
|
+
* 自动创建父目录 ~/.config/openfeel/(不存在时)。
|
|
150
|
+
* @param profile 要写入的 Profile 对象
|
|
151
|
+
*/
|
|
152
|
+
export function writeProfile(profile) {
|
|
153
|
+
const profilePath = getProfilePath();
|
|
154
|
+
// 确保父目录存在
|
|
155
|
+
mkdirSync(dirname(profilePath), { recursive: true });
|
|
156
|
+
// 序列化为 YAML(保留块结构可读性)
|
|
157
|
+
const content = stringifyYaml(profile);
|
|
158
|
+
writeFileSync(profilePath, content, 'utf-8');
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* 确保全局 Profile 关键字段已自动填充
|
|
162
|
+
* 首次使用时 user.name 与 history.last_project 可能为空。
|
|
163
|
+
* 填充规则:
|
|
164
|
+
* 1. user.name 为空时:优先从 .openfeel/.info.json 的 user 字段读取,回退 git config user.name(复用 getUserName)
|
|
165
|
+
* 2. history.last_project 更新为当前 projectPath
|
|
166
|
+
* 3. projectPath 追加到 history.recent_projects 头部(去重,保留最近 5 个)
|
|
167
|
+
* 仅在发生变更时写盘,避免无谓 IO。
|
|
168
|
+
* @param projectPath 当前项目根路径
|
|
169
|
+
*/
|
|
170
|
+
export function ensureProfileDefaults(projectPath) {
|
|
171
|
+
// 路径规范化:统一分隔符、消除 . / ..,避免 recent_projects 因路径形式差异产生重复(REV-003)
|
|
172
|
+
const normalizedPath = resolve(projectPath);
|
|
173
|
+
const profile = readProfile();
|
|
174
|
+
let changed = false;
|
|
175
|
+
// 1. user.name 为空时自动填充(.info.json → git config 回退)
|
|
176
|
+
if (!profile.user?.name) {
|
|
177
|
+
profile.user = { ...(profile.user ?? {}), name: getUserName(normalizedPath) };
|
|
178
|
+
changed = true;
|
|
179
|
+
}
|
|
180
|
+
// 2. 更新 last_project
|
|
181
|
+
if (profile.history?.last_project !== normalizedPath) {
|
|
182
|
+
profile.history = { ...(profile.history ?? {}), last_project: normalizedPath };
|
|
183
|
+
changed = true;
|
|
184
|
+
}
|
|
185
|
+
// 3. recent_projects 去重追加(新项目置顶,保留最近 5 个)
|
|
186
|
+
const recent = profile.history?.recent_projects ?? [];
|
|
187
|
+
const deduped = [normalizedPath, ...recent.filter((p) => p !== normalizedPath)].slice(0, 5);
|
|
188
|
+
if (deduped.length !== recent.length || deduped.some((p, i) => p !== recent[i])) {
|
|
189
|
+
profile.history = { ...(profile.history ?? {}), recent_projects: deduped };
|
|
190
|
+
changed = true;
|
|
191
|
+
}
|
|
192
|
+
if (changed) {
|
|
193
|
+
try {
|
|
194
|
+
writeProfile(profile);
|
|
195
|
+
}
|
|
196
|
+
catch (err) {
|
|
197
|
+
// 写盘失败(权限不足、磁盘满、只读挂载等)时静默降级:仅告警,不阻断 Feel 启动(REV-001)
|
|
198
|
+
console.warn(`[profile] 自动填充写盘失败,已跳过:${err instanceof Error ? err.message : String(err)}`);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
// ── 公开 API ──
|
|
203
|
+
/**
|
|
204
|
+
* 读取项目下的 .openfeel/config.yaml
|
|
205
|
+
* 使用 yaml.parse() 解析嵌套结构,Zod Schema 校验,自动规范化
|
|
206
|
+
* 若文件不存在,返回空对象。
|
|
207
|
+
*/
|
|
208
|
+
export function readConfig(projectPath) {
|
|
209
|
+
const configPath = resolve(projectPath, '.openfeel', 'config.yaml');
|
|
210
|
+
if (!existsSync(configPath)) {
|
|
211
|
+
return {};
|
|
212
|
+
}
|
|
213
|
+
const content = readFileSync(configPath, 'utf-8');
|
|
214
|
+
const raw = parseYaml(content); // yaml.parse() 自动处理嵌套结构
|
|
215
|
+
// 预处理:将应为对象但值为 null 的字段转为 {}(兼容 "defaults:\n" 等空块)
|
|
216
|
+
const preprocessed = { ...raw };
|
|
217
|
+
if (preprocessed.meta === null) {
|
|
218
|
+
preprocessed.meta = {};
|
|
219
|
+
}
|
|
220
|
+
if (preprocessed.defaults === null) {
|
|
221
|
+
preprocessed.defaults = {};
|
|
222
|
+
}
|
|
223
|
+
if (preprocessed.models === null) {
|
|
224
|
+
delete preprocessed.models; // models 节为 null 时直接删除,让其走 optional 逻辑
|
|
225
|
+
}
|
|
226
|
+
const parsed = ConfigSchema.parse(preprocessed);
|
|
227
|
+
return normalizeConfig(parsed);
|
|
228
|
+
}
|
|
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
|
|
284
|
+
`;
|
|
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
|
|
340
|
+
`;
|
|
341
|
+
/**
|
|
342
|
+
* 写入默认配置到 .openfeel/config.yaml
|
|
343
|
+
* @param projectPath 项目路径
|
|
344
|
+
* @param lang 语言,'zh-CN' 或 'en',默认 'zh-CN'
|
|
345
|
+
*/
|
|
346
|
+
export function writeDefaultConfig(projectPath, lang = 'zh-CN') {
|
|
347
|
+
const configPath = resolve(projectPath, '.openfeel', 'config.yaml');
|
|
348
|
+
const content = lang === 'en' ? CONFIG_TEMPLATE_EN : CONFIG_TEMPLATE_ZH;
|
|
349
|
+
writeFileSync(configPath, content, 'utf-8');
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* 读取项目 config.yaml 中 defaults 块的指定 key
|
|
353
|
+
* @param projectPath 项目根路径
|
|
354
|
+
* @param key 配置键名(如 'auto_advance')
|
|
355
|
+
* @returns 配置值(string),未设置时返回 null
|
|
356
|
+
*/
|
|
357
|
+
export function getConfigValue(projectPath, key) {
|
|
358
|
+
const config = readConfig(projectPath);
|
|
359
|
+
if (!config.defaults) {
|
|
360
|
+
return null;
|
|
361
|
+
}
|
|
362
|
+
const value = config.defaults[key];
|
|
363
|
+
if (value === undefined || value === null) {
|
|
364
|
+
return null;
|
|
365
|
+
}
|
|
366
|
+
return String(value);
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* 向项目 config.yaml 的 defaults 块写入指定 key
|
|
370
|
+
* 使用 Zod Schema 局部校验 value,通过 yaml.Document 增量修改写回(保留注释与原始结构)
|
|
371
|
+
* @param projectPath 项目根路径
|
|
372
|
+
* @param key 配置键名(当前仅支持 ConfigDefaultsSchema 中定义的键)
|
|
373
|
+
* @param value 配置值
|
|
374
|
+
*/
|
|
375
|
+
export function setConfigValue(projectPath, key, value) {
|
|
376
|
+
const configPath = resolve(projectPath, '.openfeel', 'config.yaml');
|
|
377
|
+
// 1. 通过 ConfigDefaultsSchema.shape 做局部校验
|
|
378
|
+
const fieldSchema = ConfigDefaultsSchema.shape[key];
|
|
379
|
+
if (!fieldSchema) {
|
|
380
|
+
throw new Error(`Unknown config key: ${key}`);
|
|
381
|
+
}
|
|
382
|
+
// 对 enum 字段尝试直接解析值(如 'enabled'/'disabled' → Zod enum 通过)
|
|
383
|
+
fieldSchema.parse(value);
|
|
384
|
+
// 2. 读取原始 YAML(绕过 normalizeConfig,保留注释与原始结构;文件不存在则创建空文档)
|
|
385
|
+
const doc = existsSync(configPath)
|
|
386
|
+
? parseDocument(readFileSync(configPath, 'utf-8'))
|
|
387
|
+
: parseDocument('');
|
|
388
|
+
// 3. 写入 defaults[key](setIn 原地修改,路径不存在时自动创建节点)
|
|
389
|
+
doc.setIn(['defaults', key], value);
|
|
390
|
+
// 4. 序列化并写回
|
|
391
|
+
writeFileSync(configPath, doc.toString(), 'utf-8');
|
|
392
|
+
}
|
|
393
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EA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