ly-workflow-codex 0.2.0 → 0.3.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 +20 -16
- package/dist/cli.mjs +410 -70
- package/dist/index.d.mts +27 -31
- package/dist/index.d.ts +27 -31
- package/dist/index.mjs +1 -1
- package/dist/shared/{ly-workflow-codex.K-E7PMp3.mjs → ly-workflow-codex.DZD52_5A.mjs} +494 -356
- package/package.json +1 -1
- package/templates/skills-codex/apply.md +46 -15
- package/templates/skills-codex/archive.md +15 -2
- package/templates/skills-codex/init.md +10 -13
- package/templates/skills-codex/propose.md +39 -19
- package/templates/skills-codex/review-code.md +72 -48
- package/templates/skills-codex/review-plan.md +64 -43
package/dist/index.d.mts
CHANGED
|
@@ -4,11 +4,13 @@ import * as i18next from 'i18next';
|
|
|
4
4
|
type HostId = 'codex' | 'claude';
|
|
5
5
|
/** 宿主无关的模板渲染配置(共享 LyConfig 的相关切片) */
|
|
6
6
|
interface HostAdapterConfig {
|
|
7
|
-
/**
|
|
7
|
+
/** 审查执行者(LyConfig.codexHost.reviewExecutor);未配置等价 'main',由模板运行时解析 */
|
|
8
|
+
reviewExecutor?: 'main' | 'subagent';
|
|
9
|
+
/** coding 执行者(LyConfig.codexHost.codingExecutor);未配置等价 'main',由模板运行时解析 */
|
|
10
|
+
codingExecutor?: 'main' | 'subagent';
|
|
11
|
+
/** 审查 subagent 模型(LyConfig.codexHost.reviewModel);仅在 reviewExecutor === 'subagent' 时生效 */
|
|
8
12
|
reviewModel?: string;
|
|
9
|
-
/**
|
|
10
|
-
reviewModelB?: string;
|
|
11
|
-
/** coding subagent(实施)模型(LyConfig.codexHost.codingModel);未配置或空白时回退当前会话模型 */
|
|
13
|
+
/** coding subagent 模型(LyConfig.codexHost.codingModel);仅在 codingExecutor === 'subagent' 时生效 */
|
|
12
14
|
codingModel?: string;
|
|
13
15
|
}
|
|
14
16
|
/** 适配器安装/卸载/校验共用的上下文 */
|
|
@@ -18,7 +20,7 @@ interface HostAdapterContext {
|
|
|
18
20
|
force: boolean;
|
|
19
21
|
/** npm 包内 templates/ 目录 */
|
|
20
22
|
templateDir: string;
|
|
21
|
-
/**
|
|
23
|
+
/** 角色词位置(~/.codex/lyx/prompts/,测试可注入) */
|
|
22
24
|
promptsDir: string;
|
|
23
25
|
/** codex skills 安装目录(~/.agents/skills/,测试可注入) */
|
|
24
26
|
codexSkillsDir: string;
|
|
@@ -52,11 +54,13 @@ interface CliOptions {
|
|
|
52
54
|
lang?: SupportedLang;
|
|
53
55
|
force?: boolean;
|
|
54
56
|
skipPrompt?: boolean;
|
|
57
|
+
initOpenspec?: boolean;
|
|
55
58
|
workflows?: string;
|
|
56
59
|
installDir?: string;
|
|
57
60
|
}
|
|
58
61
|
|
|
59
62
|
type SupportedLang = 'zh-CN' | 'en';
|
|
63
|
+
type ExecutorKind = 'main' | 'subagent';
|
|
60
64
|
interface LyConfig {
|
|
61
65
|
general: {
|
|
62
66
|
version: string;
|
|
@@ -73,9 +77,13 @@ interface LyConfig {
|
|
|
73
77
|
backup: string;
|
|
74
78
|
};
|
|
75
79
|
codexHost?: {
|
|
80
|
+
reviewExecutor?: ExecutorKind;
|
|
81
|
+
codingExecutor?: ExecutorKind;
|
|
76
82
|
reviewModel?: string;
|
|
77
|
-
reviewModelB?: string;
|
|
78
83
|
codingModel?: string;
|
|
84
|
+
reviewReasoningEffort?: string;
|
|
85
|
+
codingReasoningEffort?: string;
|
|
86
|
+
spawnableModels?: string[];
|
|
79
87
|
};
|
|
80
88
|
}
|
|
81
89
|
interface WorkflowConfig {
|
|
@@ -128,9 +136,13 @@ declare function createDefaultConfig(options: {
|
|
|
128
136
|
language: SupportedLang;
|
|
129
137
|
installedWorkflows: string[];
|
|
130
138
|
codexHost?: {
|
|
139
|
+
reviewExecutor?: ExecutorKind;
|
|
140
|
+
codingExecutor?: ExecutorKind;
|
|
131
141
|
reviewModel?: string;
|
|
132
|
-
reviewModelB?: string;
|
|
133
142
|
codingModel?: string;
|
|
143
|
+
reviewReasoningEffort?: string;
|
|
144
|
+
codingReasoningEffort?: string;
|
|
145
|
+
spawnableModels?: string[];
|
|
134
146
|
};
|
|
135
147
|
/** 已安装宿主集合(兼容旧配置;codex 单宿主缺省 ['codex']) */
|
|
136
148
|
installedHosts?: HostId[];
|
|
@@ -146,25 +158,11 @@ declare function getWorkflowById(id: string): WorkflowConfig | undefined;
|
|
|
146
158
|
interface InstallWorkflowsConfig {
|
|
147
159
|
/** codex 宿主审查模型(LyConfig.codexHost.reviewModel) */
|
|
148
160
|
reviewModel?: string;
|
|
149
|
-
/**
|
|
161
|
+
/** 角色词目录(默认 ~/.codex/lyx/prompts/) */
|
|
150
162
|
promptsDir?: string;
|
|
151
163
|
/** codex skills 安装目录(默认 ~/.agents/skills/,测试可注入) */
|
|
152
164
|
codexSkillsDir?: string;
|
|
153
165
|
}
|
|
154
|
-
/**
|
|
155
|
-
* 旧位置角色词迁移:~/.claude/.ly/prompts/ → ~/.ly/prompts/(内容移动 + 旧目录清理)。
|
|
156
|
-
* 失败不抛出(返回 error 字段,调用方报告但不阻断安装主流程)。
|
|
157
|
-
*/
|
|
158
|
-
interface PromptsMigrationResult {
|
|
159
|
-
migrated: boolean;
|
|
160
|
-
from?: string;
|
|
161
|
-
to?: string;
|
|
162
|
-
error?: string;
|
|
163
|
-
}
|
|
164
|
-
declare function migrateLegacyPrompts(options?: {
|
|
165
|
-
homeDir?: string;
|
|
166
|
-
promptsDir?: string;
|
|
167
|
-
}): Promise<PromptsMigrationResult>;
|
|
168
166
|
declare function installWorkflows(workflowIds: string[], installDir: string, force?: boolean, config?: InstallWorkflowsConfig): Promise<InstallResult>;
|
|
169
167
|
interface UninstallResult {
|
|
170
168
|
success: boolean;
|
|
@@ -172,17 +170,15 @@ interface UninstallResult {
|
|
|
172
170
|
removedSkills: string[];
|
|
173
171
|
/** 清理的旧安装位残留 ~/.codex/prompts/ly-*.md 文件名 */
|
|
174
172
|
removedLegacyPrompts: string[];
|
|
175
|
-
/**
|
|
176
|
-
|
|
177
|
-
/** 共享配置 ~/.ly/config.toml 是否保留(保守策略:一律保留,仅提示) */
|
|
178
|
-
configTomlKept: boolean;
|
|
173
|
+
/** 是否清除了角色词子目录 ~/.codex/lyx/prompts/codex/(父目录与其余子目录保留;worktrees/ 不在此处,它沿用共用的 ~/.ly/worktrees/,卸载不碰) */
|
|
174
|
+
removedPrompts: boolean;
|
|
179
175
|
errors: string[];
|
|
180
176
|
}
|
|
181
177
|
/**
|
|
182
178
|
* Uninstall workflows(codex 单宿主):
|
|
183
179
|
* - 移除 ~/.agents/skills/ly-* skill 目录,并清理旧安装位 ~/.codex/prompts/ly-*.md 残留
|
|
184
|
-
* -
|
|
185
|
-
* -
|
|
180
|
+
* - 删除本包私有目录 ~/.codex/lyx/(config.toml 与 prompts/)——该目录已是本包私有产物,可无条件删除
|
|
181
|
+
* - 不碰 worktrees/:worktree 目录沿用共用的 ~/.ly/worktrees/(两个项目共用),卸载不删除
|
|
186
182
|
* - 触发 codex 侧残留清理(AGENTS.md 区块 / config.toml 旧区块 / 旧 agents)
|
|
187
183
|
*/
|
|
188
184
|
declare function uninstallWorkflows(installDir: string, options?: {
|
|
@@ -193,7 +189,7 @@ declare function uninstallWorkflows(installDir: string, options?: {
|
|
|
193
189
|
lyPromptsDir?: string;
|
|
194
190
|
/** codex skills 安装目录(默认 ~/.agents/skills/,测试可注入) */
|
|
195
191
|
codexSkillsDir?: string;
|
|
196
|
-
/**
|
|
192
|
+
/** 配置目录(默认 ~/.codex/lyx,测试可注入) */
|
|
197
193
|
lyDir?: string;
|
|
198
194
|
}): Promise<UninstallResult>;
|
|
199
195
|
|
|
@@ -219,5 +215,5 @@ declare function checkForUpdates(): Promise<{
|
|
|
219
215
|
latestVersion: string | null;
|
|
220
216
|
}>;
|
|
221
217
|
|
|
222
|
-
export { ADAPTERS, changeLanguage, checkForUpdates, compareVersions, createDefaultConfig, getConfigPath, getCurrentVersion, getLatestVersion, getLyDir, getLyPromptsDir, getWorkflowById, getWorkflowConfigs, i18n, init, initI18n, installWorkflows,
|
|
223
|
-
export type { CliOptions, HostAdapter, HostId, InitOptions, InstallResult, LyConfig, SupportedLang, WorkflowConfig };
|
|
218
|
+
export { ADAPTERS, changeLanguage, checkForUpdates, compareVersions, createDefaultConfig, getConfigPath, getCurrentVersion, getLatestVersion, getLyDir, getLyPromptsDir, getWorkflowById, getWorkflowConfigs, i18n, init, initI18n, installWorkflows, readLyConfig, showMainMenu, uninstallWorkflows, update, writeLyConfig };
|
|
219
|
+
export type { CliOptions, ExecutorKind, HostAdapter, HostId, InitOptions, InstallResult, LyConfig, SupportedLang, WorkflowConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -4,11 +4,13 @@ import * as i18next from 'i18next';
|
|
|
4
4
|
type HostId = 'codex' | 'claude';
|
|
5
5
|
/** 宿主无关的模板渲染配置(共享 LyConfig 的相关切片) */
|
|
6
6
|
interface HostAdapterConfig {
|
|
7
|
-
/**
|
|
7
|
+
/** 审查执行者(LyConfig.codexHost.reviewExecutor);未配置等价 'main',由模板运行时解析 */
|
|
8
|
+
reviewExecutor?: 'main' | 'subagent';
|
|
9
|
+
/** coding 执行者(LyConfig.codexHost.codingExecutor);未配置等价 'main',由模板运行时解析 */
|
|
10
|
+
codingExecutor?: 'main' | 'subagent';
|
|
11
|
+
/** 审查 subagent 模型(LyConfig.codexHost.reviewModel);仅在 reviewExecutor === 'subagent' 时生效 */
|
|
8
12
|
reviewModel?: string;
|
|
9
|
-
/**
|
|
10
|
-
reviewModelB?: string;
|
|
11
|
-
/** coding subagent(实施)模型(LyConfig.codexHost.codingModel);未配置或空白时回退当前会话模型 */
|
|
13
|
+
/** coding subagent 模型(LyConfig.codexHost.codingModel);仅在 codingExecutor === 'subagent' 时生效 */
|
|
12
14
|
codingModel?: string;
|
|
13
15
|
}
|
|
14
16
|
/** 适配器安装/卸载/校验共用的上下文 */
|
|
@@ -18,7 +20,7 @@ interface HostAdapterContext {
|
|
|
18
20
|
force: boolean;
|
|
19
21
|
/** npm 包内 templates/ 目录 */
|
|
20
22
|
templateDir: string;
|
|
21
|
-
/**
|
|
23
|
+
/** 角色词位置(~/.codex/lyx/prompts/,测试可注入) */
|
|
22
24
|
promptsDir: string;
|
|
23
25
|
/** codex skills 安装目录(~/.agents/skills/,测试可注入) */
|
|
24
26
|
codexSkillsDir: string;
|
|
@@ -52,11 +54,13 @@ interface CliOptions {
|
|
|
52
54
|
lang?: SupportedLang;
|
|
53
55
|
force?: boolean;
|
|
54
56
|
skipPrompt?: boolean;
|
|
57
|
+
initOpenspec?: boolean;
|
|
55
58
|
workflows?: string;
|
|
56
59
|
installDir?: string;
|
|
57
60
|
}
|
|
58
61
|
|
|
59
62
|
type SupportedLang = 'zh-CN' | 'en';
|
|
63
|
+
type ExecutorKind = 'main' | 'subagent';
|
|
60
64
|
interface LyConfig {
|
|
61
65
|
general: {
|
|
62
66
|
version: string;
|
|
@@ -73,9 +77,13 @@ interface LyConfig {
|
|
|
73
77
|
backup: string;
|
|
74
78
|
};
|
|
75
79
|
codexHost?: {
|
|
80
|
+
reviewExecutor?: ExecutorKind;
|
|
81
|
+
codingExecutor?: ExecutorKind;
|
|
76
82
|
reviewModel?: string;
|
|
77
|
-
reviewModelB?: string;
|
|
78
83
|
codingModel?: string;
|
|
84
|
+
reviewReasoningEffort?: string;
|
|
85
|
+
codingReasoningEffort?: string;
|
|
86
|
+
spawnableModels?: string[];
|
|
79
87
|
};
|
|
80
88
|
}
|
|
81
89
|
interface WorkflowConfig {
|
|
@@ -128,9 +136,13 @@ declare function createDefaultConfig(options: {
|
|
|
128
136
|
language: SupportedLang;
|
|
129
137
|
installedWorkflows: string[];
|
|
130
138
|
codexHost?: {
|
|
139
|
+
reviewExecutor?: ExecutorKind;
|
|
140
|
+
codingExecutor?: ExecutorKind;
|
|
131
141
|
reviewModel?: string;
|
|
132
|
-
reviewModelB?: string;
|
|
133
142
|
codingModel?: string;
|
|
143
|
+
reviewReasoningEffort?: string;
|
|
144
|
+
codingReasoningEffort?: string;
|
|
145
|
+
spawnableModels?: string[];
|
|
134
146
|
};
|
|
135
147
|
/** 已安装宿主集合(兼容旧配置;codex 单宿主缺省 ['codex']) */
|
|
136
148
|
installedHosts?: HostId[];
|
|
@@ -146,25 +158,11 @@ declare function getWorkflowById(id: string): WorkflowConfig | undefined;
|
|
|
146
158
|
interface InstallWorkflowsConfig {
|
|
147
159
|
/** codex 宿主审查模型(LyConfig.codexHost.reviewModel) */
|
|
148
160
|
reviewModel?: string;
|
|
149
|
-
/**
|
|
161
|
+
/** 角色词目录(默认 ~/.codex/lyx/prompts/) */
|
|
150
162
|
promptsDir?: string;
|
|
151
163
|
/** codex skills 安装目录(默认 ~/.agents/skills/,测试可注入) */
|
|
152
164
|
codexSkillsDir?: string;
|
|
153
165
|
}
|
|
154
|
-
/**
|
|
155
|
-
* 旧位置角色词迁移:~/.claude/.ly/prompts/ → ~/.ly/prompts/(内容移动 + 旧目录清理)。
|
|
156
|
-
* 失败不抛出(返回 error 字段,调用方报告但不阻断安装主流程)。
|
|
157
|
-
*/
|
|
158
|
-
interface PromptsMigrationResult {
|
|
159
|
-
migrated: boolean;
|
|
160
|
-
from?: string;
|
|
161
|
-
to?: string;
|
|
162
|
-
error?: string;
|
|
163
|
-
}
|
|
164
|
-
declare function migrateLegacyPrompts(options?: {
|
|
165
|
-
homeDir?: string;
|
|
166
|
-
promptsDir?: string;
|
|
167
|
-
}): Promise<PromptsMigrationResult>;
|
|
168
166
|
declare function installWorkflows(workflowIds: string[], installDir: string, force?: boolean, config?: InstallWorkflowsConfig): Promise<InstallResult>;
|
|
169
167
|
interface UninstallResult {
|
|
170
168
|
success: boolean;
|
|
@@ -172,17 +170,15 @@ interface UninstallResult {
|
|
|
172
170
|
removedSkills: string[];
|
|
173
171
|
/** 清理的旧安装位残留 ~/.codex/prompts/ly-*.md 文件名 */
|
|
174
172
|
removedLegacyPrompts: string[];
|
|
175
|
-
/**
|
|
176
|
-
|
|
177
|
-
/** 共享配置 ~/.ly/config.toml 是否保留(保守策略:一律保留,仅提示) */
|
|
178
|
-
configTomlKept: boolean;
|
|
173
|
+
/** 是否清除了角色词子目录 ~/.codex/lyx/prompts/codex/(父目录与其余子目录保留;worktrees/ 不在此处,它沿用共用的 ~/.ly/worktrees/,卸载不碰) */
|
|
174
|
+
removedPrompts: boolean;
|
|
179
175
|
errors: string[];
|
|
180
176
|
}
|
|
181
177
|
/**
|
|
182
178
|
* Uninstall workflows(codex 单宿主):
|
|
183
179
|
* - 移除 ~/.agents/skills/ly-* skill 目录,并清理旧安装位 ~/.codex/prompts/ly-*.md 残留
|
|
184
|
-
* -
|
|
185
|
-
* -
|
|
180
|
+
* - 删除本包私有目录 ~/.codex/lyx/(config.toml 与 prompts/)——该目录已是本包私有产物,可无条件删除
|
|
181
|
+
* - 不碰 worktrees/:worktree 目录沿用共用的 ~/.ly/worktrees/(两个项目共用),卸载不删除
|
|
186
182
|
* - 触发 codex 侧残留清理(AGENTS.md 区块 / config.toml 旧区块 / 旧 agents)
|
|
187
183
|
*/
|
|
188
184
|
declare function uninstallWorkflows(installDir: string, options?: {
|
|
@@ -193,7 +189,7 @@ declare function uninstallWorkflows(installDir: string, options?: {
|
|
|
193
189
|
lyPromptsDir?: string;
|
|
194
190
|
/** codex skills 安装目录(默认 ~/.agents/skills/,测试可注入) */
|
|
195
191
|
codexSkillsDir?: string;
|
|
196
|
-
/**
|
|
192
|
+
/** 配置目录(默认 ~/.codex/lyx,测试可注入) */
|
|
197
193
|
lyDir?: string;
|
|
198
194
|
}): Promise<UninstallResult>;
|
|
199
195
|
|
|
@@ -219,5 +215,5 @@ declare function checkForUpdates(): Promise<{
|
|
|
219
215
|
latestVersion: string | null;
|
|
220
216
|
}>;
|
|
221
217
|
|
|
222
|
-
export { ADAPTERS, changeLanguage, checkForUpdates, compareVersions, createDefaultConfig, getConfigPath, getCurrentVersion, getLatestVersion, getLyDir, getLyPromptsDir, getWorkflowById, getWorkflowConfigs, i18n, init, initI18n, installWorkflows,
|
|
223
|
-
export type { CliOptions, HostAdapter, HostId, InitOptions, InstallResult, LyConfig, SupportedLang, WorkflowConfig };
|
|
218
|
+
export { ADAPTERS, changeLanguage, checkForUpdates, compareVersions, createDefaultConfig, getConfigPath, getCurrentVersion, getLatestVersion, getLyDir, getLyPromptsDir, getWorkflowById, getWorkflowConfigs, i18n, init, initI18n, installWorkflows, readLyConfig, showMainMenu, uninstallWorkflows, update, writeLyConfig };
|
|
219
|
+
export type { CliOptions, ExecutorKind, HostAdapter, HostId, InitOptions, InstallResult, LyConfig, SupportedLang, WorkflowConfig };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as ADAPTERS, c as changeLanguage,
|
|
1
|
+
export { A as ADAPTERS, c as changeLanguage, m as checkForUpdates, n as compareVersions, d as createDefaultConfig, g as getConfigPath, o as getCurrentVersion, p as getLatestVersion, e as getLyDir, f as getLyPromptsDir, h as getWorkflowById, j as getWorkflowConfigs, a as i18n, i as init, b as initI18n, k as installWorkflows, r as readLyConfig, s as showMainMenu, l as uninstallWorkflows, u as update, w as writeLyConfig } from './shared/ly-workflow-codex.DZD52_5A.mjs';
|
|
2
2
|
import 'node:child_process';
|
|
3
3
|
import 'node:os';
|
|
4
4
|
import 'node:util';
|