@intra-mart/accel 0.5.0 → 0.6.0-dev.202609241904

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.
Files changed (49) hide show
  1. package/README.md +22 -3
  2. package/assets/runtime/ensure.mjs +914 -0
  3. package/dist/asset/dependencies.d.ts +7 -0
  4. package/dist/asset/dependencies.js +23 -0
  5. package/dist/asset/deployer.d.ts +1 -0
  6. package/dist/asset/deployer.js +11 -3
  7. package/dist/asset/installer.js +3 -8
  8. package/dist/asset/updater.d.ts +2 -0
  9. package/dist/asset/updater.js +3 -0
  10. package/dist/asset/walker.d.ts +1 -0
  11. package/dist/asset/walker.js +65 -3
  12. package/dist/commands/attach.d.ts +4 -1
  13. package/dist/commands/attach.js +8 -1
  14. package/dist/commands/detach.d.ts +2 -0
  15. package/dist/commands/detach.js +4 -0
  16. package/dist/commands/init.d.ts +4 -1
  17. package/dist/commands/init.js +8 -1
  18. package/dist/commands/switch.d.ts +3 -0
  19. package/dist/commands/switch.js +12 -3
  20. package/dist/commands/update.d.ts +4 -0
  21. package/dist/commands/update.js +26 -5
  22. package/dist/core/constants.d.ts +10 -1
  23. package/dist/core/constants.js +22 -1
  24. package/dist/core/errors.d.ts +11 -0
  25. package/dist/core/errors.js +6 -0
  26. package/dist/core/gitignore-entries.d.ts +7 -0
  27. package/dist/core/gitignore-entries.js +16 -0
  28. package/dist/core/paths.d.ts +1 -0
  29. package/dist/core/paths.js +1 -0
  30. package/dist/core/types.d.ts +2 -1
  31. package/dist/core/variable-interpolator.js +4 -0
  32. package/dist/i18n/en.js +15 -0
  33. package/dist/i18n/ja.js +15 -0
  34. package/dist/i18n/zh_CN.js +15 -0
  35. package/dist/interactive/next-steps.d.ts +1 -0
  36. package/dist/interactive/next-steps.js +3 -0
  37. package/dist/utils/credentials.d.ts +2 -1
  38. package/dist/utils/credentials.js +3 -2
  39. package/dist/utils/gitignore.d.ts +1 -0
  40. package/dist/utils/gitignore.js +8 -6
  41. package/dist/utils/mcp-generate.d.ts +8 -1
  42. package/dist/utils/mcp-generate.js +261 -31
  43. package/dist/utils/runtime-ensure.d.ts +55 -0
  44. package/dist/utils/runtime-ensure.js +391 -0
  45. package/dist/utils/sanitize-text.d.ts +2 -0
  46. package/dist/utils/sanitize-text.js +7 -0
  47. package/dist/utils/settings-io.d.ts +2 -1
  48. package/dist/utils/settings-io.js +2 -1
  49. package/package.json +7 -2
@@ -14,3 +14,9 @@ export const markReported = (err) => {
14
14
  };
15
15
  export const isReportedError = (err) => err instanceof Error &&
16
16
  err[REPORTED] === true;
17
+ const ASSET_DEPENDENCY_ERROR = "AssetDependencyError";
18
+ export const createAssetDependencyError = (message, detail) => Object.assign(new Error(message), {
19
+ name: ASSET_DEPENDENCY_ERROR,
20
+ detail,
21
+ });
22
+ export const isAssetDependencyError = (err) => err instanceof Error && err.name === ASSET_DEPENDENCY_ERROR;
@@ -0,0 +1,7 @@
1
+ export declare const CREDENTIALS_GITIGNORE_ENTRY = ".accel/credentials.json";
2
+ export declare const MCP_STATE_GITIGNORE_ENTRY = ".accel/mcp-state.json";
3
+ export declare const RUNTIME_GITIGNORE_ENTRY = ".accel/runtime/";
4
+ export declare const NODE_MODULES_GITIGNORE_ENTRY = "node_modules";
5
+ export declare const MANAGED_GITIGNORE_ENTRIES: readonly string[];
6
+ export declare const DEPENDENCY_GITIGNORE_ENTRIES: readonly string[];
7
+ export declare const GITIGNORE_ENTRIES_VARIABLE_VALUE: string;
@@ -0,0 +1,16 @@
1
+ import { ACCEL_DIR, RUNTIME_DIR_REL } from "./constants.js";
2
+ export const CREDENTIALS_GITIGNORE_ENTRY = `${ACCEL_DIR}/credentials.json`;
3
+ export const MCP_STATE_GITIGNORE_ENTRY = `${ACCEL_DIR}/mcp-state.json`;
4
+ export const RUNTIME_GITIGNORE_ENTRY = `${RUNTIME_DIR_REL}/`;
5
+ export const NODE_MODULES_GITIGNORE_ENTRY = "node_modules";
6
+ export const MANAGED_GITIGNORE_ENTRIES = [
7
+ CREDENTIALS_GITIGNORE_ENTRY,
8
+ MCP_STATE_GITIGNORE_ENTRY,
9
+ RUNTIME_GITIGNORE_ENTRY,
10
+ NODE_MODULES_GITIGNORE_ENTRY,
11
+ ];
12
+ export const DEPENDENCY_GITIGNORE_ENTRIES = [
13
+ RUNTIME_GITIGNORE_ENTRY,
14
+ NODE_MODULES_GITIGNORE_ENTRY,
15
+ ];
16
+ export const GITIGNORE_ENTRIES_VARIABLE_VALUE = MANAGED_GITIGNORE_ENTRIES.join("\n");
@@ -4,3 +4,4 @@ export declare const configurePaths: (opts: {
4
4
  export declare const getPackageRoot: () => string;
5
5
  export declare const getCliVersion: () => string;
6
6
  export declare const getAssetsGithooksRoot: () => string;
7
+ export declare const getAssetsRuntimeRoot: () => string;
@@ -20,3 +20,4 @@ export const getCliVersion = () => {
20
20
  return cachedVersion;
21
21
  };
22
22
  export const getAssetsGithooksRoot = () => join(getPackageRoot(), "assets", "githooks");
23
+ export const getAssetsRuntimeRoot = () => join(getPackageRoot(), "assets", "runtime");
@@ -72,7 +72,7 @@ export type Message = {
72
72
  };
73
73
  export type MetaJson = {
74
74
  version: string;
75
- type: "file" | "directory" | "mcp";
75
+ type: "file" | "directory" | "mcp" | "dependencies";
76
76
  conditions?: Condition;
77
77
  rename?: RenameRule[];
78
78
  replacements?: Replacement[];
@@ -113,6 +113,7 @@ export type AccelSettings = {
113
113
  locale: string;
114
114
  packageManager: string;
115
115
  gitHooks?: boolean;
116
+ dependencies?: string[];
116
117
  jugglingProject: string | null;
117
118
  assetSource?: AssetSourceInfo;
118
119
  deployedAssets: Record<string, string>;
@@ -1,3 +1,5 @@
1
+ import { ensureCommandFor } from "./constants.js";
2
+ import { GITIGNORE_ENTRIES_VARIABLE_VALUE } from "./gitignore-entries.js";
1
3
  const VARIABLE_RESOLVERS = new Map([
2
4
  ["name", (c) => c.name],
3
5
  ["artifactId", (c) => c.artifactId],
@@ -9,6 +11,8 @@ const VARIABLE_RESOLVERS = new Map([
9
11
  ["database", (c) => c.database],
10
12
  ["projectVersion", (c) => c.projectVersion],
11
13
  ["packageManager", (c) => c.packageManager],
14
+ ["ensureCommand", (c) => ensureCommandFor(c.packageManager)],
15
+ ["gitignoreEntries", () => GITIGNORE_ENTRIES_VARIABLE_VALUE],
12
16
  ]);
13
17
  const INTERPOLATION_PATTERN = /\{\{\$([\w.]+)\}\}/g;
14
18
  export const interpolateVariables = (template, context, extraVariables) => {
package/dist/i18n/en.js CHANGED
@@ -42,6 +42,8 @@ export const messages = {
42
42
  "warning.gitHooksPathConflict": "Skipped enabling the pre-commit hook because git core.hooksPath is set to {current}. Integrate the token-leak check (.githooks/pre-commit) into your existing hook setup manually.",
43
43
  "warning.gitHooksForeignFiles": "Skipped setting core.hooksPath because .githooks contains files not managed by the CLI ({files}). After confirming they are safe, run git config core.hooksPath .githooks manually.",
44
44
  "warning.gitHooksLayoutSuspicious": "Skipped setting core.hooksPath because the .git reference points to an unexpected location outside the project ({path}). Run git config core.hooksPath .githooks manually if needed.",
45
+ "warning.ensureScriptUserFile": "Skipped placing the skill dependency install script because {path} is not managed by the CLI. Remove or move the file and rerun the command to enable automatic installation.",
46
+ "warning.ensureLaunchFailed": "Could not run {command}. Check the runtime (Node.js or Bun) and run it manually.",
45
47
  "attach.skipSummary": "{count} file(s) were skipped because they already exist.",
46
48
  "attach.overwritePrompt": "{path} already exists. Overwrite?",
47
49
  "attach.overwritePrompt.yes": "Yes (overwrite this file)",
@@ -80,6 +82,7 @@ export const messages = {
80
82
  "update.complete": "Update complete. Updated {updated}, kept {kept}, deleted {deleted} file(s).",
81
83
  "update.conflictSummary": "{count} conflict(s) found. Review the markers (<<<<<<<) and resolve them manually:",
82
84
  "update.installSkippedConflict": "install / build were skipped. After resolving the conflicts, run:\n {installCommand} && {buildCommand}",
85
+ "update.dependencyConflictHint": "Skill dependencies cannot be used until the conflicts in their package.json / lockfile are resolved. After resolving, run {command}.",
83
86
  "update.error.keepEditedWithoutAllow": "--keep-edited can only be used together with --allow-missing-base.",
84
87
  "update.error.baseFetchHint": "To continue in fallback mode, pass --allow-missing-base (add --keep-edited to keep edited files and skip them). If the asset repository moved, point to the new location with --asset-server-url / --asset-ref. As a last resort, run accel detach and re-run init.",
85
88
  "update.fallback.editedCount": "Without the base commit, upstream changes to edited files cannot be detected. Edited files that differ from upstream: {count}",
@@ -195,6 +198,7 @@ export const messages = {
195
198
  "progress.deploying.root": "Deploying root-level files ({files})",
196
199
  "progress.installing": "Running {command}...",
197
200
  "progress.building": "Running {command}...",
201
+ "progress.ensuringDependencies": "Preparing skill dependencies...",
198
202
  "progress.gitInit": "Running git init...",
199
203
  "progress.complete": "Project creation complete.",
200
204
  "nextSteps.heading": "Next steps",
@@ -202,6 +206,7 @@ export const messages = {
202
206
  "nextSteps.agent.claudeCode": "Run claude to start agent-driven development",
203
207
  "nextSteps.agent.codex": "Run codex to start agent-driven development",
204
208
  "nextSteps.agent.githubCopilot": "Run copilot to start agent-driven development",
209
+ "nextSteps.codexHookApproval": "On the first codex launch, choose \"Trust all and continue\" on the hooks review screen so skill dependencies are prepared automatically",
205
210
  "credentials.prompt.endpoint": "Enter the iAP endpoint (base URL)",
206
211
  "credentials.prompt.endpoint.hint": "Specify the iAP base URL (e.g. https://example.com/imart). The API path (/api/bearer/...) is assembled automatically",
207
212
  "credentials.prompt.apiKey": "Enter the API key (OAuth Bearer token)",
@@ -223,6 +228,16 @@ export const messages = {
223
228
  "mcp.warning.fragmentParse": "Skipped an MCP template that could not be read or parsed: {path}",
224
229
  "mcp.warning.outputParse": "Skipped generating this file because the existing MCP configuration could not be parsed: {path}",
225
230
  "mcp.warning.credentialEntryExcluded": "Some MCP entries could not be generated because the connection information could not be resolved: {path} ({names}). Check the connection information and the asset definition.",
231
+ "mcp.warning.settingBlocked": "Skipped some settings from the MCP config template because they do not fit the structure of the existing file: {path} ({names}).",
232
+ "dependencies.hooks.generated": "Generated or updated the session-start hook: {path}",
233
+ "dependencies.hooks.removed": "Removed the CLI-managed session-start hook from {path}",
234
+ "dependencies.hooks.outputParse": "Skipped generating the session-start hook because the existing file could not be parsed: {path}",
235
+ "dependencies.detach.linkRemoved": "Removed the node_modules link: {path}",
236
+ "dependencies.ensureFailed": "Failed to prepare skill dependencies.",
237
+ "error.dependencies.lockMissing": "The asset dependency directory {dir} has no lockfile {lock} for packageManager \"{packageManager}\". The asset repository may be incomplete.",
238
+ "error.dependencies.packageJsonMissing": "The asset dependency directory {dir} has no package.json.",
239
+ "error.dependencies.invalidRenameTarget": "rename.to \"{to}\" in the asset dependency directory {dir} must be package.json or a lockfile name.",
240
+ "error.dependencies.rootNotAllowed": "The asset dependency directory {dir} cannot be deployed to the project root, .accel, or .git. Place it under a skills directory.",
226
241
  "deploy.intro": "Accel CLI - deploy",
227
242
  "deploy.progress.fetchingStagings": "Fetching staging environments...",
228
243
  "deploy.progress.deploying": "Deploying...",
package/dist/i18n/ja.js CHANGED
@@ -42,6 +42,8 @@ export const messages = {
42
42
  "warning.gitHooksPathConflict": "gitのcore.hooksPathが {current} に設定されているため、pre-commitフックの有効化をスキップしました。トークン漏洩防止のチェック (.githooks/pre-commit) を既存のフック機構へ手動で組み込んでください。",
43
43
  "warning.gitHooksForeignFiles": ".githooks 配下にCLI管理外のファイル ({files}) が存在するため、core.hooksPathの自動設定をスキップしました。内容に問題がないことを確認した上で、git config core.hooksPath .githooks を手動で実行してください。",
44
44
  "warning.gitHooksLayoutSuspicious": ".git の参照先 ({path}) がプロジェクトの外を指しているため、core.hooksPathの自動設定をスキップしました。必要な場合は git config core.hooksPath .githooks を手動で実行してください。",
45
+ "warning.ensureScriptUserFile": "{path} はCLI管理外のファイルのため、skill の依存を install するスクリプトの配置をスキップしました。自動 install を有効にするには、このファイルを削除または退避してからコマンドを再実行してください。",
46
+ "warning.ensureLaunchFailed": "{command} を起動できませんでした。実行環境(Node.js または Bun)を確認した上で、手動で実行してください。",
45
47
  "attach.skipSummary": "{count}件のファイルは既に存在したためスキップしました。",
46
48
  "attach.overwritePrompt": "{path} は既に存在します。上書きしますか?",
47
49
  "attach.overwritePrompt.yes": "Yes (このファイルを上書き)",
@@ -80,6 +82,7 @@ export const messages = {
80
82
  "update.complete": "updateが完了しました。{updated}件を更新、{kept}件を保持、{deleted}件を削除しました。",
81
83
  "update.conflictSummary": "{count}件のコンフリクトがあります。マーカー(<<<<<<<)を確認して手動で解決してください:",
82
84
  "update.installSkippedConflict": "install / build はスキップされました。コンフリクト解決後に以下を実行してください:\n {installCommand} && {buildCommand}",
85
+ "update.dependencyConflictHint": "skill の依存ファイル(package.json / ロックファイル)のコンフリクトを解決するまで、その skill の依存は使えません。解決後に {command} を実行してください。",
83
86
  "update.error.keepEditedWithoutAllow": "--keep-edited は --allow-missing-base と併用する場合のみ指定できます。",
84
87
  "update.error.baseFetchHint": "フォールバックモードで続行するには --allow-missing-base を指定してください(--keep-edited 併用で編集済みファイルを保持してスキップ)。資材リポジトリが移転した場合は --asset-server-url / --asset-ref で取得元を変更できます。最終手段として accel detach 後に再度 init する方法もあります。",
85
88
  "update.fallback.editedCount": "基準コミット(base)なしで続行する場合、編集済みファイルの上流変更は判定できません。上流と差分のある編集済みファイル: {count}件",
@@ -195,6 +198,7 @@ export const messages = {
195
198
  "progress.deploying.root": "ルート直下を配備中 ({files})",
196
199
  "progress.installing": "{command} を実行しています...",
197
200
  "progress.building": "{command} を実行しています...",
201
+ "progress.ensuringDependencies": "skill の依存を準備しています...",
198
202
  "progress.gitInit": "git init を実行しています...",
199
203
  "progress.complete": "プロジェクトの作成が完了しました。",
200
204
  "nextSteps.heading": "次の手順",
@@ -202,6 +206,7 @@ export const messages = {
202
206
  "nextSteps.agent.claudeCode": "claude を起動してエージェント開発を始めてください",
203
207
  "nextSteps.agent.codex": "codex を起動してエージェント開発を始めてください",
204
208
  "nextSteps.agent.githubCopilot": "copilot を起動してエージェント開発を始めてください",
209
+ "nextSteps.codexHookApproval": "codex の初回起動時に表示されるフックのレビュー画面で「Trust all and continue」を選ぶと、skill の依存が自動で準備されます",
205
210
  "credentials.prompt.endpoint": "iAP のエンドポイント(ベースURL)を入力してください",
206
211
  "credentials.prompt.endpoint.hint": "iAP のベースURL を指定してください(例: https://example.com/imart)。API パス(/api/bearer/...)は自動で組み立てられます",
207
212
  "credentials.prompt.apiKey": "APIキー(OAuth Bearer トークン)を入力してください",
@@ -223,6 +228,16 @@ export const messages = {
223
228
  "mcp.warning.fragmentParse": "MCP 設定テンプレートを読み込めないか解析できないためスキップしました: {path}",
224
229
  "mcp.warning.outputParse": "既存の MCP 設定を解析できないため、このファイルの生成をスキップしました: {path}",
225
230
  "mcp.warning.credentialEntryExcluded": "接続情報を解決できないため、MCP 設定の一部エントリを生成できませんでした: {path}({names})。接続情報と資材の定義を確認してください。",
231
+ "mcp.warning.settingBlocked": "既存ファイルの構造と合わないため、MCP 設定テンプレートの一部の設定を書き込めませんでした: {path}({names})",
232
+ "dependencies.hooks.generated": "セッション開始フックを生成/更新しました: {path}",
233
+ "dependencies.hooks.removed": "CLI 管理のセッション開始フックを除去しました: {path}",
234
+ "dependencies.hooks.outputParse": "既存ファイルを解析できないため、セッション開始フックの生成をスキップしました: {path}",
235
+ "dependencies.detach.linkRemoved": "node_modules のリンクを削除しました: {path}",
236
+ "dependencies.ensureFailed": "skill の依存の準備に失敗しました。",
237
+ "error.dependencies.lockMissing": "資材の依存ディレクトリ {dir} に packageManager \"{packageManager}\" 用のロックファイル {lock} がありません。資材リポジトリの不備の可能性があります。",
238
+ "error.dependencies.packageJsonMissing": "資材の依存ディレクトリ {dir} に package.json がありません。",
239
+ "error.dependencies.invalidRenameTarget": "資材の依存ディレクトリ {dir} の rename.to \"{to}\" は package.json またはロックファイル名でなければなりません。",
240
+ "error.dependencies.rootNotAllowed": "資材の依存ディレクトリ {dir} はプロジェクトルート直下・.accel・.git には配備できません。skills のディレクトリ配下に置いてください。",
226
241
  "deploy.intro": "Accel CLI - deploy",
227
242
  "deploy.progress.fetchingStagings": "ステージング環境を取得しています...",
228
243
  "deploy.progress.deploying": "デプロイしています...",
@@ -42,6 +42,8 @@ export const messages = {
42
42
  "warning.gitHooksPathConflict": "由于 git 的 core.hooksPath 已设置为 {current},已跳过 pre-commit 钩子的启用。请手动将防止令牌泄露的检查(.githooks/pre-commit)集成到现有的钩子机制中。",
43
43
  "warning.gitHooksForeignFiles": "由于 .githooks 下存在不由 CLI 管理的文件({files}),已跳过 core.hooksPath 的自动设置。请确认其内容没有问题后,手动执行 git config core.hooksPath .githooks。",
44
44
  "warning.gitHooksLayoutSuspicious": "由于 .git 的引用指向项目外的异常位置({path}),已跳过 core.hooksPath 的自动设置。如有需要,请手动执行 git config core.hooksPath .githooks。",
45
+ "warning.ensureScriptUserFile": "由于 {path} 不是由 CLI 管理的文件,已跳过 skill 依赖安装脚本的部署。如需启用自动安装,请删除或移走该文件后重新执行命令。",
46
+ "warning.ensureLaunchFailed": "无法启动 {command}。请确认运行环境(Node.js 或 Bun)后手动执行。",
45
47
  "attach.skipSummary": "{count}个文件已存在,已跳过。",
46
48
  "attach.overwritePrompt": "{path} 已存在。要覆盖吗?",
47
49
  "attach.overwritePrompt.yes": "Yes (覆盖此文件)",
@@ -80,6 +82,7 @@ export const messages = {
80
82
  "update.complete": "update完成。更新{updated}个、保留{kept}个、删除{deleted}个文件。",
81
83
  "update.conflictSummary": "发现{count}个冲突。请检查标记(<<<<<<<)并手动解决:",
82
84
  "update.installSkippedConflict": "已跳过 install / build。解决冲突后请执行以下命令:\n {installCommand} && {buildCommand}",
85
+ "update.dependencyConflictHint": "在解决 skill 依赖文件(package.json / 锁文件)的冲突之前,无法使用该 skill 的依赖。解决后请执行 {command}。",
83
86
  "update.error.keepEditedWithoutAllow": "--keep-edited 仅可与 --allow-missing-base 一起使用。",
84
87
  "update.error.baseFetchHint": "要以回退模式继续,请指定 --allow-missing-base(同时指定 --keep-edited 可保留并跳过已编辑的文件)。如果资源仓库已迁移,可通过 --asset-server-url / --asset-ref 更改获取源。作为最后手段,可执行 accel detach 后重新 init。",
85
88
  "update.fallback.editedCount": "在没有基准提交(base)的情况下继续时,无法判定已编辑文件的上游变更。与上游存在差异的已编辑文件: {count}个",
@@ -195,6 +198,7 @@ export const messages = {
195
198
  "progress.deploying.root": "正在部署根目录文件 ({files})",
196
199
  "progress.installing": "正在执行 {command}...",
197
200
  "progress.building": "正在执行 {command}...",
201
+ "progress.ensuringDependencies": "正在准备 skill 依赖...",
198
202
  "progress.gitInit": "正在执行 git init...",
199
203
  "progress.complete": "项目创建完成。",
200
204
  "nextSteps.heading": "下一步",
@@ -202,6 +206,7 @@ export const messages = {
202
206
  "nextSteps.agent.claudeCode": "执行 claude 开始基于代理的开发",
203
207
  "nextSteps.agent.codex": "执行 codex 开始基于代理的开发",
204
208
  "nextSteps.agent.githubCopilot": "执行 copilot 开始基于代理的开发",
209
+ "nextSteps.codexHookApproval": "首次启动 codex 时,在钩子审核界面选择“Trust all and continue”,即可自动准备 skill 依赖",
205
210
  "credentials.prompt.endpoint": "请输入 iAP 端点(基础URL)",
206
211
  "credentials.prompt.endpoint.hint": "请指定 iAP 的基础URL(例如: https://example.com/imart)。API 路径(/api/bearer/...)会自动拼接",
207
212
  "credentials.prompt.apiKey": "请输入 API 密钥(OAuth Bearer 令牌)",
@@ -223,6 +228,16 @@ export const messages = {
223
228
  "mcp.warning.fragmentParse": "无法读取或解析 MCP 配置模板,已跳过: {path}",
224
229
  "mcp.warning.outputParse": "无法解析现有的 MCP 配置,已跳过该文件的生成: {path}",
225
230
  "mcp.warning.credentialEntryExcluded": "由于无法解析连接信息,部分 MCP 条目未能生成: {path}({names})。请检查连接信息与资料的定义。",
231
+ "mcp.warning.settingBlocked": "由于与现有文件的结构不一致,已跳过 MCP 配置模板中的部分设置: {path}({names})",
232
+ "dependencies.hooks.generated": "已生成或更新会话启动钩子: {path}",
233
+ "dependencies.hooks.removed": "已从 {path} 移除由 CLI 管理的会话启动钩子",
234
+ "dependencies.hooks.outputParse": "由于无法解析现有文件,已跳过会话启动钩子的生成: {path}",
235
+ "dependencies.detach.linkRemoved": "已删除 node_modules 链接: {path}",
236
+ "dependencies.ensureFailed": "skill 依赖准备失败。",
237
+ "error.dependencies.lockMissing": "资材依赖目录 {dir} 中没有 packageManager \"{packageManager}\" 对应的锁文件 {lock}。资源仓库可能不完整。",
238
+ "error.dependencies.packageJsonMissing": "资材依赖目录 {dir} 中没有 package.json。",
239
+ "error.dependencies.invalidRenameTarget": "资材依赖目录 {dir} 中的 rename.to \"{to}\" 必须是 package.json 或锁文件名。",
240
+ "error.dependencies.rootNotAllowed": "资材依赖目录 {dir} 不能部署到项目根目录、.accel 或 .git。请放在 skills 目录下。",
226
241
  "deploy.intro": "Accel CLI - deploy",
227
242
  "deploy.progress.fetchingStagings": "正在获取暂存环境...",
228
243
  "deploy.progress.deploying": "正在部署...",
@@ -4,6 +4,7 @@ export type NextStepsOptions = {
4
4
  agents: string[];
5
5
  isInit: boolean;
6
6
  locale: string;
7
+ codexHookApproval?: boolean;
7
8
  };
8
9
  export declare const buildNextStepsBody: (opts: NextStepsOptions) => string;
9
10
  export declare const printNextSteps: (opts: NextStepsOptions, logger?: Logger) => void;
@@ -11,6 +11,9 @@ export const buildNextStepsBody = (opts) => {
11
11
  }
12
12
  if (opts.agents.includes("codex")) {
13
13
  steps.push(getMessage("nextSteps.agent.codex", opts.locale));
14
+ if (opts.codexHookApproval) {
15
+ steps.push(getMessage("nextSteps.codexHookApproval", opts.locale));
16
+ }
14
17
  }
15
18
  if (opts.agents.includes("github-copilot")) {
16
19
  steps.push(getMessage("nextSteps.agent.githubCopilot", opts.locale));
@@ -1,5 +1,6 @@
1
1
  import type { AccelCredentials } from "../core/types.js";
2
- export declare const CREDENTIALS_GITIGNORE_ENTRY = ".accel/credentials.json";
2
+ import { CREDENTIALS_GITIGNORE_ENTRY } from "../core/gitignore-entries.js";
3
+ export { CREDENTIALS_GITIGNORE_ENTRY };
3
4
  export declare const normalizeEndpoint: (raw: string) => string;
4
5
  export declare const ENDPOINT_ENV = "ACCEL_ENDPOINT";
5
6
  export declare const API_KEY_ENV = "ACCEL_API_KEY";
@@ -1,9 +1,10 @@
1
1
  import { readFile, writeFile, mkdir } from "node:fs/promises";
2
2
  import { join } from "node:path";
3
3
  import { ensureGitignoreEntry } from "./gitignore.js";
4
- const ACCEL_DIR = ".accel";
4
+ import { ACCEL_DIR } from "../core/constants.js";
5
+ import { CREDENTIALS_GITIGNORE_ENTRY } from "../core/gitignore-entries.js";
5
6
  const CREDENTIALS_FILE = "credentials.json";
6
- export const CREDENTIALS_GITIGNORE_ENTRY = `${ACCEL_DIR}/${CREDENTIALS_FILE}`;
7
+ export { CREDENTIALS_GITIGNORE_ENTRY };
7
8
  export const normalizeEndpoint = (raw) => raw.trim().replace(/\/+$/, "");
8
9
  export const ENDPOINT_ENV = "ACCEL_ENDPOINT";
9
10
  export const API_KEY_ENV = "ACCEL_API_KEY";
@@ -1 +1,2 @@
1
1
  export declare const ensureGitignoreEntry: (projectDir: string, entry: string) => Promise<void>;
2
+ export declare const ensureGitignoreEntries: (projectDir: string, entries: readonly string[]) => Promise<void>;
@@ -1,6 +1,7 @@
1
1
  import { readFile, writeFile } from "node:fs/promises";
2
2
  import { join } from "node:path";
3
- export const ensureGitignoreEntry = async (projectDir, entry) => {
3
+ export const ensureGitignoreEntry = async (projectDir, entry) => ensureGitignoreEntries(projectDir, [entry]);
4
+ export const ensureGitignoreEntries = async (projectDir, entries) => {
4
5
  const gitignorePath = join(projectDir, ".gitignore");
5
6
  let content = "";
6
7
  try {
@@ -9,15 +10,16 @@ export const ensureGitignoreEntry = async (projectDir, entry) => {
9
10
  catch {
10
11
  content = "";
11
12
  }
12
- const alreadyPresent = content
13
- .split("\n")
14
- .some((line) => line.trim() === entry);
15
- if (alreadyPresent)
13
+ const present = new Set(content.split("\n").map((line) => line.trim()));
14
+ const missing = entries.filter((entry) => !present.has(entry));
15
+ if (missing.length === 0)
16
16
  return;
17
17
  let next = content;
18
18
  if (next.length > 0 && !next.endsWith("\n")) {
19
19
  next += "\n";
20
20
  }
21
- next += `${entry}\n`;
21
+ for (const entry of missing) {
22
+ next += `${entry}\n`;
23
+ }
22
24
  await writeFile(gitignorePath, next, "utf-8");
23
25
  };
@@ -1,5 +1,12 @@
1
1
  import type { AccelCredentials } from "../core/types.js";
2
- export type McpState = Record<string, string[]>;
2
+ export type ManagedSetting = {
3
+ path: string[];
4
+ value: unknown;
5
+ };
6
+ export type McpState = {
7
+ servers: Record<string, string[]>;
8
+ settings: Record<string, ManagedSetting[]>;
9
+ };
3
10
  type McpLogSink = {
4
11
  info: (msg: string) => void;
5
12
  warn: (msg: string) => void;