@intra-mart/accel 0.3.0-next.202605250439 → 0.3.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.
Files changed (68) hide show
  1. package/README.md +157 -41
  2. package/dist/asset/deployer.js +8 -17
  3. package/dist/asset/foreach-replacement.d.ts +2 -0
  4. package/dist/asset/foreach-replacement.js +20 -0
  5. package/dist/asset/github-provider.d.ts +2 -0
  6. package/dist/asset/github-provider.js +37 -0
  7. package/dist/asset/local-provider.js +1 -22
  8. package/dist/asset/walker.js +4 -15
  9. package/dist/commands/attach.d.ts +13 -1
  10. package/dist/commands/attach.js +33 -12
  11. package/dist/commands/deploy.d.ts +42 -3
  12. package/dist/commands/deploy.js +274 -40
  13. package/dist/commands/init.d.ts +13 -1
  14. package/dist/commands/init.js +33 -12
  15. package/dist/commands/login.d.ts +31 -0
  16. package/dist/commands/login.js +76 -0
  17. package/dist/core/catalog.d.ts +11 -0
  18. package/dist/core/catalog.js +40 -0
  19. package/dist/core/condition-evaluator.js +6 -3
  20. package/dist/core/constants.d.ts +3 -3
  21. package/dist/core/constants.js +6 -11
  22. package/dist/core/eval-context.d.ts +3 -0
  23. package/dist/core/eval-context.js +45 -0
  24. package/dist/core/types.d.ts +61 -12
  25. package/dist/core/types.js +2 -1
  26. package/dist/core/validators.d.ts +7 -2
  27. package/dist/core/validators.js +25 -12
  28. package/dist/core/variable-interpolator.d.ts +1 -1
  29. package/dist/core/variable-interpolator.js +19 -19
  30. package/dist/deploy/api-client.d.ts +5 -2
  31. package/dist/deploy/api-client.js +47 -1
  32. package/dist/deploy/target-selector.d.ts +11 -0
  33. package/dist/deploy/target-selector.js +16 -0
  34. package/dist/i18n/en.js +39 -6
  35. package/dist/i18n/ja.js +39 -6
  36. package/dist/i18n/zh_CN.js +39 -6
  37. package/dist/index.js +2 -0
  38. package/dist/interactive/agent-detect.js +1 -0
  39. package/dist/interactive/credential-auth.d.ts +15 -0
  40. package/dist/interactive/credential-auth.js +61 -0
  41. package/dist/interactive/credentials-prompts.d.ts +3 -1
  42. package/dist/interactive/credentials-prompts.js +50 -7
  43. package/dist/interactive/next-steps.js +3 -0
  44. package/dist/interactive/prompts.d.ts +3 -0
  45. package/dist/interactive/prompts.js +112 -52
  46. package/dist/interactive/summary.js +5 -1
  47. package/dist/juggling/extractor.d.ts +3 -2
  48. package/dist/juggling/extractor.js +9 -9
  49. package/dist/utils/args.d.ts +1 -0
  50. package/dist/utils/args.js +4 -0
  51. package/dist/utils/credentials.d.ts +7 -0
  52. package/dist/utils/credentials.js +21 -0
  53. package/dist/utils/date-formatter.d.ts +1 -0
  54. package/dist/utils/date-formatter.js +23 -0
  55. package/dist/utils/https.d.ts +2 -0
  56. package/dist/utils/https.js +44 -0
  57. package/dist/utils/mcp-sync.d.ts +4 -0
  58. package/dist/utils/mcp-sync.js +97 -0
  59. package/dist/utils/settings-io.d.ts +1 -0
  60. package/dist/utils/settings-io.js +8 -0
  61. package/package.json +6 -5
  62. package/assets/assets.tar.gz +0 -0
  63. package/dist/asset/default-source.d.ts +0 -1
  64. package/dist/asset/default-source.js +0 -6
  65. package/dist/core/module-map.d.ts +0 -3
  66. package/dist/core/module-map.js +0 -7
  67. package/dist/core/version-map.d.ts +0 -7
  68. package/dist/core/version-map.js +0 -45
package/dist/i18n/en.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export const messages = {
2
- "intro.init": "Generate an iAP (intra-mart Accel Platform) project and\nassets for Claude Code / GitHub Copilot.\nA few questions follow; everything is then deployed in one go.",
3
- "intro.attach": "Mark the current directory as an iAP project and\ndeploy assets for Claude Code / GitHub Copilot.\nA few questions follow; everything is then deployed in one go.",
2
+ "intro.init": "Generate an iAP (intra-mart Accel Platform) project and\nassets for Claude Code / Codex / GitHub Copilot.\nA few questions follow; everything is then deployed in one go.",
3
+ "intro.attach": "Mark the current directory as an iAP project and\ndeploy assets for Claude Code / Codex / GitHub Copilot.\nA few questions follow; everything is then deployed in one go.",
4
4
  "prompt.name": "Enter project name",
5
5
  "prompt.name.hint": "Used as the directory name and recorded in pom.xml <name> and package.json name\nProvide a concise name that represents the system or feature you are creating (e.g. customer-portal, invoice-management)",
6
6
  "prompt.artifactId": "Enter artifact ID (Maven artifactId)",
@@ -11,8 +11,10 @@ export const messages = {
11
11
  "prompt.accelplatformVersion.hint": "iAP release version. The deployed assets (CLAUDE.md, etc.) adapt to this version",
12
12
  "prompt.modules": "Select modules to use",
13
13
  "prompt.modules.hint": "iAP optional product modules. Each selection deploys matching skills, config, and CLAUDE.md sections",
14
+ "prompt.features": "Select features to use",
15
+ "prompt.features.hint": "iAP features used in this project. Skills and CLAUDE.md sections for the selected features will be deployed",
14
16
  "prompt.group": "Enter group name",
15
- "prompt.group.hint": "Recorded in pom.xml as the Maven groupId (dot-separated organization identifier)\nAn identifier for your organization or team; reverse-domain notation reduces collisions (e.g. com.example, jp.co.intramart.app)",
17
+ "prompt.group.hint": "Recorded in pom.xml as the Maven groupId (dot-separated organization identifier)\nAn identifier for your organization or team; reverse-domain notation reduces collisions (e.g. com.example, jp.co.intra_mart.app)",
16
18
  "prompt.projectVersion": "Enter project version",
17
19
  "prompt.projectVersion.hint": "Recorded in pom.xml <version> and package.json version\nThe release version of your project; Semantic Versioning (MAJOR.MINOR.PATCH) is common (e.g. 0.1.0, 1.0.0-SNAPSHOT)",
18
20
  "prompt.description": "Enter project description",
@@ -22,12 +24,13 @@ export const messages = {
22
24
  "prompt.javascript": "Use JavaScript instead of TypeScript?",
23
25
  "prompt.javascript.hint": "Affects the whole project setup (presence of tsconfig.json, pom.xml / package.json dependencies and scripts, agent asset language guidance)",
24
26
  "prompt.agent": "Select agent",
25
- "prompt.agent.hint": "claude-code deploys under .claude/, github-copilot deploys under .github/ (instructions, skills, etc.)",
27
+ "prompt.agent.hint": "claude-code deploys under .claude/, codex deploys under .codex/, github-copilot deploys under .github/ (instructions, skills, etc.)",
26
28
  "prompt.withGit": "Initialize Git repository?",
27
29
  "prompt.withGit.hint": "Runs git init inside the created project directory",
28
30
  "juggling.detected.version": "Detected version from juggling.im: {version}",
29
31
  "juggling.detected.modules": "Detected modules from juggling.im: {modules}",
30
32
  "juggling.notFound": "juggling.im not found at specified path: {path}",
33
+ "juggling.versionUnknown": "The juggling.im version {version} is not in the catalog. Select the version and modules manually.",
31
34
  "warning.versionMismatch": "Specified iAP version ({option}) differs from juggling.im ({juggling}). Using specified value.",
32
35
  "warning.moduleMismatch": "Specified modules differ from juggling.im. Using specified values.",
33
36
  "warning.gitNotFound": "git command not found. Skipping Git initialization.",
@@ -51,7 +54,9 @@ export const messages = {
51
54
  "error.accelNotFound": ".accel directory not found",
52
55
  "error.missingRequiredOptions": "The following required options are missing: {options}",
53
56
  "error.invalidVersion": "Invalid iAP version: {version}",
54
- "error.invalidModule": "Invalid module: {module}",
57
+ "error.invalidModule": "Invalid module (not in release {release}): {module}",
58
+ "error.invalidFeature": "Invalid feature (not in release {release}): {feature}",
59
+ "error.jugglingVersionUnknown": "The juggling.im version {version} is not in the catalog.",
55
60
  "error.invalidDatabase": "Invalid database: {database}",
56
61
  "error.invalidAgent": "Invalid agent: {agent}",
57
62
  "error.invalidPackageManager": "Invalid package manager (expected one of bun, npm, yarn, pnpm): {packageManager}",
@@ -67,6 +72,7 @@ export const messages = {
67
72
  "summary.label.description": "Description",
68
73
  "summary.label.accelplatformVersion": "iAP version",
69
74
  "summary.label.modules": "Modules",
75
+ "summary.label.features": "Features",
70
76
  "summary.label.database": "Database",
71
77
  "summary.label.javascript": "JavaScript",
72
78
  "summary.label.agents": "Agents",
@@ -85,12 +91,22 @@ export const messages = {
85
91
  "nextSteps.heading": "Next steps",
86
92
  "nextSteps.cd": "cd {path}",
87
93
  "nextSteps.agent.claudeCode": "Run claude to start agent-driven development",
88
- "nextSteps.agent.githubCopilot": "Run gh copilot to start agent-driven development",
94
+ "nextSteps.agent.codex": "Run codex to start agent-driven development",
95
+ "nextSteps.agent.githubCopilot": "Run copilot to start agent-driven development",
89
96
  "credentials.prompt.endpoint": "Enter the iAP endpoint (base URL)",
90
97
  "credentials.prompt.endpoint.hint": "Specify the iAP base URL (e.g. https://example.com/imart). The API path (/api/bearer/...) is assembled automatically",
91
98
  "credentials.prompt.apiKey": "Enter the API key (OAuth Bearer token)",
92
99
  "credentials.prompt.apiKey.hint": "iAP OAuth token (scope: development). Saved to .accel/credentials.json and added to .gitignore",
93
100
  "credentials.error.required": "A value is required",
101
+ "credentials.error.missingNonInteractive": "Connection information is required in non-interactive mode. Missing: {fields} (provide them via --endpoint / --api-key or the ACCEL_ENDPOINT / ACCEL_API_KEY environment variables).",
102
+ "credentials.verify.progress": "Verifying your connection information...",
103
+ "credentials.verify.notice": "Please re-enter your connection information.",
104
+ "credentials.verify.error.network": "Could not connect to iAP: {message}",
105
+ "credentials.verify.error.unauthorized": "Authentication failed (401). Check that the API key is correct.",
106
+ "credentials.verify.error.notFound": "Could not reach the given endpoint (404). Check that the endpoint URL is correct.",
107
+ "credentials.verify.error.unexpected": "Failed to verify connection information (HTTP {status}).",
108
+ "login.intro": "Accel CLI - login",
109
+ "login.complete": "Connection information saved.",
94
110
  "deploy.intro": "Accel CLI - deploy",
95
111
  "deploy.progress.fetchingStagings": "Fetching staging environments...",
96
112
  "deploy.progress.deploying": "Deploying...",
@@ -110,6 +126,9 @@ export const messages = {
110
126
  "deploy.cancelled": "Deployment cancelled.",
111
127
  "deploy.error.noStagings": "No staging environments found. Create a staging environment on the iAP side first.",
112
128
  "deploy.error.noTargetZip": "No deployable zip found under ./target/. Run a build (e.g. mvn package) first.",
129
+ "deploy.error.missingStagingId": "--staging-id is required in non-interactive mode. Specify the target staging ID.",
130
+ "deploy.error.zipNotResolved": "Could not uniquely determine the zip to deploy. Specify the file explicitly with --file.",
131
+ "deploy.error.fileNotFound": "The specified file was not found: {path}",
113
132
  "deploy.error.network": "Could not connect to iAP: {message}",
114
133
  "deploy.error.server": "iAP returned an error: {message}",
115
134
  "deploy.error.unauthorized": "Authentication failed (401). Check that the API key is correct.",
@@ -118,4 +137,18 @@ export const messages = {
118
137
  "deploy.error.badRequest": "Bad request (400).",
119
138
  "deploy.error.serverError": "A server error occurred (500).",
120
139
  "deploy.error.unexpectedResponse": "Received an unexpected response (HTTP {status}).",
140
+ "deploy.reauth.notFound": "The endpoint could not be reached (404). Check that the endpoint URL is correct.",
141
+ "deploy.reauth.notice": "Please re-enter your connection information.",
142
+ "deploy.result.shortcutUrl": "Shortcut URL",
143
+ "deploy.setup.heading": "Tenant Environment Setup Configs",
144
+ "deploy.setup.confirm": "Run tenant environment setup?",
145
+ "deploy.setup.confirmAll": "Execute all?",
146
+ "deploy.setup.selectConfigs": "Select the configs to execute",
147
+ "deploy.setup.executing": "Running tenant environment setup... ({config})",
148
+ "deploy.setup.resultSuccess": "Tenant environment setup completed.",
149
+ "deploy.setup.resultPartialFailure": "Tenant environment setup partially failed.",
150
+ "deploy.setup.error": "An error occurred during tenant environment setup: {message}",
151
+ "deploy.setup.resultHeader.section": "Section",
152
+ "deploy.setup.resultHeader.target": "Target",
153
+ "deploy.setup.resultHeader.result": "Result",
121
154
  };
package/dist/i18n/ja.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export const messages = {
2
- "intro.init": "iAP(intra-mart Accel Platform)プロジェクトと、\nClaude Code / GitHub Copilot 向けの資材を生成します。\nいくつか質問した後、最後に一括で配備します。",
3
- "intro.attach": "カレントディレクトリを iAP プロジェクトとして認識させ、\nClaude Code / GitHub Copilot 向けの資材を配備します。\nいくつか質問した後、最後に一括で配備します。",
2
+ "intro.init": "iAP(intra-mart Accel Platform)プロジェクトと、\nClaude Code / Codex / GitHub Copilot 向けの資材を生成します。\nいくつか質問した後、最後に一括で配備します。",
3
+ "intro.attach": "カレントディレクトリを iAP プロジェクトとして認識させ、\nClaude Code / Codex / GitHub Copilot 向けの資材を配備します。\nいくつか質問した後、最後に一括で配備します。",
4
4
  "prompt.name": "プロジェクト名を入力してください",
5
5
  "prompt.name.hint": "ディレクトリ名、pom.xml の <name>、package.json の name に反映されます\n作成するシステムや機能を端的に表す名称を指定してください(例: customer-portal, invoice-management)",
6
6
  "prompt.artifactId": "アーティファクトID(pomのartifactId)を入力してください",
@@ -11,8 +11,10 @@ export const messages = {
11
11
  "prompt.accelplatformVersion.hint": "iAP本体のリリース版。配備される資材(CLAUDE.md 等)の内容がこのバージョンに合わせて変化します",
12
12
  "prompt.modules": "利用するモジュールを選択してください",
13
13
  "prompt.modules.hint": "iAP のオプション製品群。選択したモジュール向けの Skill や設定ファイル、CLAUDE.md 内のセクションが配備されます",
14
+ "prompt.features": "利用する機能を選択してください",
15
+ "prompt.features.hint": "プロジェクトで利用する iAP の機能。選択した機能向けの Skill や CLAUDE.md 内のセクションが配備されます",
14
16
  "prompt.group": "グループ名を入力してください",
15
- "prompt.group.hint": "Maven の groupId として pom.xml に記録されます(組織を表すドット区切り名)\n所属する組織やチームを表す識別子。逆ドメイン記法で書くと他者と衝突しにくいです(例: com.example, jp.co.intramart.app)",
17
+ "prompt.group.hint": "Maven の groupId として pom.xml に記録されます(組織を表すドット区切り名)\n所属する組織やチームを表す識別子。逆ドメイン記法で書くと他者と衝突しにくいです(例: com.example, jp.co.intra_mart.app)",
16
18
  "prompt.projectVersion": "プロジェクトバージョンを入力してください",
17
19
  "prompt.projectVersion.hint": "pom.xml の <version> と package.json の version に反映されます\nプロジェクトのリリースバージョン。セマンティックバージョニング(MAJOR.MINOR.PATCH)が一般的です(例: 0.1.0, 1.0.0-SNAPSHOT)",
18
20
  "prompt.description": "プロジェクトの説明を入力してください",
@@ -22,12 +24,13 @@ export const messages = {
22
24
  "prompt.javascript": "TypeScriptの代わりにJavaScriptを利用しますか?",
23
25
  "prompt.javascript.hint": "プロジェクト全体の構成(tsconfig.json の有無、pom.xml / package.json の依存・スクリプト、エージェント資材内の言語ガイド)に影響します",
24
26
  "prompt.agent": "エージェントを選択してください",
25
- "prompt.agent.hint": "claude-code → .claude/ 配下、github-copilot → .github/ 配下に、指示書や skills などを配備します",
27
+ "prompt.agent.hint": "claude-code → .claude/ 配下、codex → .codex/ 配下、github-copilot → .github/ 配下に、指示書や skills などを配備します",
26
28
  "prompt.withGit": "Gitリポジトリを初期化しますか?",
27
29
  "prompt.withGit.hint": "作成したプロジェクトディレクトリで git init を実行します",
28
30
  "juggling.detected.version": "juggling.imからバージョンを検出: {version}",
29
31
  "juggling.detected.modules": "juggling.imからモジュールを検出: {modules}",
30
32
  "juggling.notFound": "指定されたパスにjuggling.imが見つかりません: {path}",
33
+ "juggling.versionUnknown": "juggling.imのバージョン {version} はカタログに存在しません。バージョンとモジュールを手動で選択してください。",
31
34
  "warning.versionMismatch": "指定されたiAPバージョン ({option}) とjuggling.imのバージョン ({juggling}) が異なります。指定値を優先します。",
32
35
  "warning.moduleMismatch": "指定されたモジュールとjuggling.imのモジュールが異なります。指定値を優先します。",
33
36
  "warning.gitNotFound": "gitコマンドが見つかりません。Git初期化をスキップします。",
@@ -51,7 +54,9 @@ export const messages = {
51
54
  "error.accelNotFound": ".accelディレクトリが見つかりません",
52
55
  "error.missingRequiredOptions": "以下の必須オプションが指定されていません: {options}",
53
56
  "error.invalidVersion": "無効なiAPバージョンです: {version}",
54
- "error.invalidModule": "無効なモジュールです: {module}",
57
+ "error.invalidModule": "無効なモジュールです(リリース {release} に存在しません): {module}",
58
+ "error.invalidFeature": "無効な機能です(リリース {release} に存在しません): {feature}",
59
+ "error.jugglingVersionUnknown": "juggling.imのバージョン {version} はカタログに存在しません。",
55
60
  "error.invalidDatabase": "無効なデータベースです: {database}",
56
61
  "error.invalidAgent": "無効なエージェントです: {agent}",
57
62
  "error.invalidPackageManager": "無効なパッケージマネージャです(bun, npm, yarn, pnpm のいずれかを指定してください): {packageManager}",
@@ -67,6 +72,7 @@ export const messages = {
67
72
  "summary.label.description": "説明",
68
73
  "summary.label.accelplatformVersion": "iAPバージョン",
69
74
  "summary.label.modules": "モジュール",
75
+ "summary.label.features": "機能",
70
76
  "summary.label.database": "データベース",
71
77
  "summary.label.javascript": "JavaScript",
72
78
  "summary.label.agents": "エージェント",
@@ -85,12 +91,22 @@ export const messages = {
85
91
  "nextSteps.heading": "次の手順",
86
92
  "nextSteps.cd": "cd {path}",
87
93
  "nextSteps.agent.claudeCode": "claude を起動してエージェント開発を始めてください",
88
- "nextSteps.agent.githubCopilot": "gh copilot を起動してエージェント開発を始めてください",
94
+ "nextSteps.agent.codex": "codex を起動してエージェント開発を始めてください",
95
+ "nextSteps.agent.githubCopilot": "copilot を起動してエージェント開発を始めてください",
89
96
  "credentials.prompt.endpoint": "iAP のエンドポイント(ベースURL)を入力してください",
90
97
  "credentials.prompt.endpoint.hint": "iAP のベースURL を指定してください(例: https://example.com/imart)。API パス(/api/bearer/...)は自動で組み立てられます",
91
98
  "credentials.prompt.apiKey": "APIキー(OAuth Bearer トークン)を入力してください",
92
99
  "credentials.prompt.apiKey.hint": "iAP の OAuth トークン(scope: development)。.accel/credentials.json に保存され、.gitignore に追加されます",
93
100
  "credentials.error.required": "値を入力してください",
101
+ "credentials.error.missingNonInteractive": "非対話モードでは接続情報が必要です。未指定の項目: {fields}(--endpoint / --api-key または ACCEL_ENDPOINT / ACCEL_API_KEY 環境変数で指定してください)",
102
+ "credentials.verify.progress": "接続情報を確認しています...",
103
+ "credentials.verify.notice": "接続情報を再入力してください。",
104
+ "credentials.verify.error.network": "iAP に接続できませんでした: {message}",
105
+ "credentials.verify.error.unauthorized": "認証に失敗しました(401)。APIキーが正しいか確認してください。",
106
+ "credentials.verify.error.notFound": "指定されたエンドポイントにアクセスできません(404)。エンドポイントの URL が正しいか確認してください。",
107
+ "credentials.verify.error.unexpected": "接続情報の確認に失敗しました(HTTP {status})。",
108
+ "login.intro": "Accel CLI - login",
109
+ "login.complete": "接続情報を保存しました。",
94
110
  "deploy.intro": "Accel CLI - deploy",
95
111
  "deploy.progress.fetchingStagings": "ステージング環境を取得しています...",
96
112
  "deploy.progress.deploying": "デプロイしています...",
@@ -110,6 +126,9 @@ export const messages = {
110
126
  "deploy.cancelled": "デプロイをキャンセルしました。",
111
127
  "deploy.error.noStagings": "ステージング環境が見つかりません。先に iAP 側でステージング環境を作成してください。",
112
128
  "deploy.error.noTargetZip": "./target/ 配下にデプロイ対象の zip が見つかりません。先にビルド(mvn package 等)を実行してください。",
129
+ "deploy.error.missingStagingId": "非対話モードでは --staging-id が必須です。デプロイ先のステージングIDを指定してください。",
130
+ "deploy.error.zipNotResolved": "デプロイ対象の zip を一意に特定できませんでした。--file でデプロイするファイルを明示してください。",
131
+ "deploy.error.fileNotFound": "指定されたファイルが見つかりません: {path}",
113
132
  "deploy.error.network": "iAP に接続できませんでした: {message}",
114
133
  "deploy.error.server": "iAP からエラーが返されました: {message}",
115
134
  "deploy.error.unauthorized": "認証に失敗しました(401)。APIキーが正しいか確認してください。",
@@ -118,4 +137,18 @@ export const messages = {
118
137
  "deploy.error.badRequest": "リクエストが不正です(400)。",
119
138
  "deploy.error.serverError": "サーバーエラーが発生しました(500)。",
120
139
  "deploy.error.unexpectedResponse": "想定外のレスポンスを受信しました(HTTP {status})。",
140
+ "deploy.reauth.notFound": "指定されたエンドポイントにアクセスできません(404)。エンドポイントの URL が正しいか確認してください。",
141
+ "deploy.reauth.notice": "接続情報を再入力してください。",
142
+ "deploy.result.shortcutUrl": "ショートカットURL",
143
+ "deploy.setup.heading": "テナント環境セットアップ設定",
144
+ "deploy.setup.confirm": "テナント環境セットアップを実行しますか?",
145
+ "deploy.setup.confirmAll": "全て実行しますか?",
146
+ "deploy.setup.selectConfigs": "実行する設定を選択してください",
147
+ "deploy.setup.executing": "テナント環境セットアップを実行しています... ({config})",
148
+ "deploy.setup.resultSuccess": "テナント環境セットアップが完了しました。",
149
+ "deploy.setup.resultPartialFailure": "テナント環境セットアップが一部失敗しました。",
150
+ "deploy.setup.error": "テナント環境セットアップの実行中にエラーが発生しました: {message}",
151
+ "deploy.setup.resultHeader.section": "セクション",
152
+ "deploy.setup.resultHeader.target": "対象",
153
+ "deploy.setup.resultHeader.result": "結果",
121
154
  };
@@ -1,6 +1,6 @@
1
1
  export const messages = {
2
- "intro.init": "生成 iAP(intra-mart Accel Platform)项目,\n以及面向 Claude Code / GitHub Copilot 的资源。\n将提出若干问题,最后统一进行部署。",
3
- "intro.attach": "将当前目录识别为 iAP 项目,\n并部署面向 Claude Code / GitHub Copilot 的资源。\n将提出若干问题,最后统一进行部署。",
2
+ "intro.init": "生成 iAP(intra-mart Accel Platform)项目,\n以及面向 Claude Code / Codex / GitHub Copilot 的资源。\n将提出若干问题,最后统一进行部署。",
3
+ "intro.attach": "将当前目录识别为 iAP 项目,\n并部署面向 Claude Code / Codex / GitHub Copilot 的资源。\n将提出若干问题,最后统一进行部署。",
4
4
  "prompt.name": "请输入项目名称",
5
5
  "prompt.name.hint": "用作目录名称,并写入 pom.xml 的 <name> 和 package.json 的 name\n请提供能简洁表达所创建系统或功能的名称(例如: customer-portal, invoice-management)",
6
6
  "prompt.artifactId": "请输入构件ID(Maven artifactId)",
@@ -11,8 +11,10 @@ export const messages = {
11
11
  "prompt.accelplatformVersion.hint": "iAP 本体的发行版。部署的资源(CLAUDE.md 等)会根据该版本变化",
12
12
  "prompt.modules": "请选择要使用的模块",
13
13
  "prompt.modules.hint": "iAP 的可选产品模块。每选一项会部署对应的 Skill、配置文件以及 CLAUDE.md 中的相应章节",
14
+ "prompt.features": "请选择要使用的功能",
15
+ "prompt.features.hint": "项目中使用的 iAP 功能。将部署所选功能对应的 Skill 和 CLAUDE.md 中的章节",
14
16
  "prompt.group": "请输入组名",
15
- "prompt.group.hint": "作为 Maven groupId 写入 pom.xml(表示组织的点分标识符)\n表示所属组织或团队的标识符;按反向域名记法书写可减少与他人的冲突(例如: com.example, jp.co.intramart.app)",
17
+ "prompt.group.hint": "作为 Maven groupId 写入 pom.xml(表示组织的点分标识符)\n表示所属组织或团队的标识符;按反向域名记法书写可减少与他人的冲突(例如: com.example, jp.co.intra_mart.app)",
16
18
  "prompt.projectVersion": "请输入项目版本",
17
19
  "prompt.projectVersion.hint": "写入 pom.xml 的 <version> 和 package.json 的 version\n项目的发布版本;常用语义化版本(MAJOR.MINOR.PATCH)(例如: 0.1.0, 1.0.0-SNAPSHOT)",
18
20
  "prompt.description": "请输入项目描述",
@@ -22,12 +24,13 @@ export const messages = {
22
24
  "prompt.javascript": "是否使用JavaScript代替TypeScript?",
23
25
  "prompt.javascript.hint": "影响整个项目结构(是否存在 tsconfig.json、pom.xml / package.json 的依赖与脚本、代理资源中的语言指引)",
24
26
  "prompt.agent": "请选择代理",
25
- "prompt.agent.hint": "claude-code 部署到 .claude/ 下,github-copilot 部署到 .github/ 下(指令书、skills 等)",
27
+ "prompt.agent.hint": "claude-code 部署到 .claude/ 下,codex 部署到 .codex/ 下,github-copilot 部署到 .github/ 下(指令书、skills 等)",
26
28
  "prompt.withGit": "是否初始化Git仓库?",
27
29
  "prompt.withGit.hint": "在创建的项目目录中执行 git init",
28
30
  "juggling.detected.version": "从juggling.im检测到版本: {version}",
29
31
  "juggling.detected.modules": "从juggling.im检测到模块: {modules}",
30
32
  "juggling.notFound": "在指定路径未找到juggling.im: {path}",
33
+ "juggling.versionUnknown": "juggling.im 的版本 {version} 不存在于目录中。请手动选择版本和模块。",
31
34
  "warning.versionMismatch": "指定的iAP版本 ({option}) 与juggling.im ({juggling}) 不同。将使用指定值。",
32
35
  "warning.moduleMismatch": "指定的模块与juggling.im不同。将使用指定值。",
33
36
  "warning.gitNotFound": "未找到git命令。跳过Git初始化。",
@@ -51,7 +54,9 @@ export const messages = {
51
54
  "error.accelNotFound": "未找到.accel目录",
52
55
  "error.missingRequiredOptions": "以下必需选项未指定: {options}",
53
56
  "error.invalidVersion": "无效的iAP版本: {version}",
54
- "error.invalidModule": "无效的模块: {module}",
57
+ "error.invalidModule": "无效的模块(不存在于发行版 {release}): {module}",
58
+ "error.invalidFeature": "无效的功能(不存在于发行版 {release}): {feature}",
59
+ "error.jugglingVersionUnknown": "juggling.im 的版本 {version} 不存在于目录中。",
55
60
  "error.invalidDatabase": "无效的数据库: {database}",
56
61
  "error.invalidAgent": "无效的代理: {agent}",
57
62
  "error.invalidPackageManager": "无效的包管理器(必须是 bun、npm、yarn、pnpm 之一): {packageManager}",
@@ -67,6 +72,7 @@ export const messages = {
67
72
  "summary.label.description": "描述",
68
73
  "summary.label.accelplatformVersion": "iAP版本",
69
74
  "summary.label.modules": "模块",
75
+ "summary.label.features": "功能",
70
76
  "summary.label.database": "数据库",
71
77
  "summary.label.javascript": "JavaScript",
72
78
  "summary.label.agents": "代理",
@@ -85,12 +91,22 @@ export const messages = {
85
91
  "nextSteps.heading": "下一步",
86
92
  "nextSteps.cd": "cd {path}",
87
93
  "nextSteps.agent.claudeCode": "执行 claude 开始基于代理的开发",
88
- "nextSteps.agent.githubCopilot": "执行 gh copilot 开始基于代理的开发",
94
+ "nextSteps.agent.codex": "执行 codex 开始基于代理的开发",
95
+ "nextSteps.agent.githubCopilot": "执行 copilot 开始基于代理的开发",
89
96
  "credentials.prompt.endpoint": "请输入 iAP 端点(基础URL)",
90
97
  "credentials.prompt.endpoint.hint": "请指定 iAP 的基础URL(例如: https://example.com/imart)。API 路径(/api/bearer/...)会自动拼接",
91
98
  "credentials.prompt.apiKey": "请输入 API 密钥(OAuth Bearer 令牌)",
92
99
  "credentials.prompt.apiKey.hint": "iAP 的 OAuth 令牌(scope: development)。将保存到 .accel/credentials.json 并添加到 .gitignore",
93
100
  "credentials.error.required": "请输入值",
101
+ "credentials.error.missingNonInteractive": "非交互模式下需要连接信息。缺少项:{fields}(请通过 --endpoint / --api-key 或 ACCEL_ENDPOINT / ACCEL_API_KEY 环境变量指定)。",
102
+ "credentials.verify.progress": "正在确认连接信息...",
103
+ "credentials.verify.notice": "请重新输入连接信息。",
104
+ "credentials.verify.error.network": "无法连接到 iAP: {message}",
105
+ "credentials.verify.error.unauthorized": "认证失败(401)。请确认 API 密钥是否正确。",
106
+ "credentials.verify.error.notFound": "无法访问指定的端点(404)。请确认端点 URL 是否正确。",
107
+ "credentials.verify.error.unexpected": "确认连接信息失败(HTTP {status})。",
108
+ "login.intro": "Accel CLI - login",
109
+ "login.complete": "连接信息已保存。",
94
110
  "deploy.intro": "Accel CLI - deploy",
95
111
  "deploy.progress.fetchingStagings": "正在获取暂存环境...",
96
112
  "deploy.progress.deploying": "正在部署...",
@@ -110,6 +126,9 @@ export const messages = {
110
126
  "deploy.cancelled": "已取消部署。",
111
127
  "deploy.error.noStagings": "未找到暂存环境。请先在 iAP 侧创建暂存环境。",
112
128
  "deploy.error.noTargetZip": "在 ./target/ 下未找到可部署的 zip。请先执行构建(如 mvn package)。",
129
+ "deploy.error.missingStagingId": "非交互模式下必须指定 --staging-id。请指定目标暂存环境 ID。",
130
+ "deploy.error.zipNotResolved": "无法唯一确定要部署的 zip。请使用 --file 明确指定要部署的文件。",
131
+ "deploy.error.fileNotFound": "未找到指定的文件:{path}",
113
132
  "deploy.error.network": "无法连接到 iAP: {message}",
114
133
  "deploy.error.server": "iAP 返回了错误: {message}",
115
134
  "deploy.error.unauthorized": "认证失败(401)。请确认 API 密钥是否正确。",
@@ -118,4 +137,18 @@ export const messages = {
118
137
  "deploy.error.badRequest": "请求无效(400)。",
119
138
  "deploy.error.serverError": "发生服务器错误(500)。",
120
139
  "deploy.error.unexpectedResponse": "收到意外的响应(HTTP {status})。",
140
+ "deploy.reauth.notFound": "无法访问指定的端点(404)。请确认端点 URL 是否正确。",
141
+ "deploy.reauth.notice": "请重新输入连接信息。",
142
+ "deploy.result.shortcutUrl": "快捷链接",
143
+ "deploy.setup.heading": "租户环境配置设置",
144
+ "deploy.setup.confirm": "是否执行租户环境配置?",
145
+ "deploy.setup.confirmAll": "是否全部执行?",
146
+ "deploy.setup.selectConfigs": "请选择要执行的配置",
147
+ "deploy.setup.executing": "正在执行租户环境配置... ({config})",
148
+ "deploy.setup.resultSuccess": "租户环境配置已完成。",
149
+ "deploy.setup.resultPartialFailure": "租户环境配置部分失败。",
150
+ "deploy.setup.error": "执行租户环境配置时发生错误: {message}",
151
+ "deploy.setup.resultHeader.section": "部分",
152
+ "deploy.setup.resultHeader.target": "对象",
153
+ "deploy.setup.resultHeader.result": "结果",
121
154
  };
package/dist/index.js CHANGED
@@ -3,6 +3,7 @@ import { defineCommand, runMain } from "citty";
3
3
  import { initCommand } from "./commands/init.js";
4
4
  import { attachCommand } from "./commands/attach.js";
5
5
  import { detachCommand } from "./commands/detach.js";
6
+ import { loginCommand } from "./commands/login.js";
6
7
  import { deployCommand } from "./commands/deploy.js";
7
8
  const main = defineCommand({
8
9
  meta: {
@@ -14,6 +15,7 @@ const main = defineCommand({
14
15
  init: initCommand,
15
16
  attach: attachCommand,
16
17
  detach: detachCommand,
18
+ login: loginCommand,
17
19
  deploy: deployCommand,
18
20
  },
19
21
  });
@@ -1,6 +1,7 @@
1
1
  import { commandExists } from "../utils/command-exists.js";
2
2
  const AGENT_COMMANDS = [
3
3
  { name: "claude-code", command: "claude" },
4
+ { name: "codex", command: "codex" },
4
5
  { name: "github-copilot", command: "gh" },
5
6
  ];
6
7
  export const detectAgents = () => {
@@ -0,0 +1,15 @@
1
+ import type { AccelCredentials } from "../core/types.js";
2
+ import { type ApiClient } from "../deploy/api-client.js";
3
+ export declare const isRetryableCredentialError: (err: unknown) => boolean;
4
+ export type VerifyDeps = {
5
+ apiClientFactory: (endpoint: string, apiKey: string) => ApiClient;
6
+ repromptCredentials: (current: AccelCredentials, locale: string) => Promise<AccelCredentials>;
7
+ persistCredentials: (projectDir: string, creds: AccelCredentials) => Promise<void>;
8
+ };
9
+ export declare const verifyCredentialsLoop: (projectDir: string, locale: string, initial: AccelCredentials, opts: {
10
+ dirty: boolean;
11
+ interactive?: boolean;
12
+ }, deps: VerifyDeps) => Promise<{
13
+ creds: AccelCredentials;
14
+ api: ApiClient;
15
+ }>;
@@ -0,0 +1,61 @@
1
+ import * as p from "@clack/prompts";
2
+ import { isDeployError } from "../deploy/api-client.js";
3
+ import { getMessage } from "../i18n/index.js";
4
+ export const isRetryableCredentialError = (err) => isDeployError(err) &&
5
+ (err.kind === "network" || err.status === 401 || err.status === 404);
6
+ const formatRetryableError = (err, locale) => {
7
+ if (err.kind === "network") {
8
+ return getMessage("credentials.verify.error.network", locale, {
9
+ message: err.serverMessage ?? "",
10
+ });
11
+ }
12
+ if (err.status === 401) {
13
+ return getMessage("credentials.verify.error.unauthorized", locale);
14
+ }
15
+ return getMessage("credentials.verify.error.notFound", locale);
16
+ };
17
+ const formatTerminalError = (err, locale) => {
18
+ if (isDeployError(err)) {
19
+ return getMessage("credentials.verify.error.unexpected", locale, {
20
+ status: String(err.status ?? "?"),
21
+ });
22
+ }
23
+ return err instanceof Error ? err.message : String(err);
24
+ };
25
+ export const verifyCredentialsLoop = async (projectDir, locale, initial, opts, deps) => {
26
+ const interactive = opts.interactive ?? true;
27
+ let creds = initial;
28
+ let dirty = opts.dirty;
29
+ let api = deps.apiClientFactory(creds.endpoint, creds.apiKey);
30
+ const spin = p.spinner();
31
+ for (;;) {
32
+ spin.start(getMessage("credentials.verify.progress", locale));
33
+ try {
34
+ await api.verifyToken();
35
+ spin.stop(getMessage("credentials.verify.progress", locale));
36
+ break;
37
+ }
38
+ catch (err) {
39
+ spin.stop(getMessage("credentials.verify.progress", locale));
40
+ if (!interactive) {
41
+ p.log.error(isRetryableCredentialError(err)
42
+ ? formatRetryableError(err, locale)
43
+ : formatTerminalError(err, locale));
44
+ throw err;
45
+ }
46
+ if (!isRetryableCredentialError(err)) {
47
+ p.log.error(formatTerminalError(err, locale));
48
+ throw err;
49
+ }
50
+ p.log.error(formatRetryableError(err, locale));
51
+ p.log.info(getMessage("credentials.verify.notice", locale));
52
+ creds = await deps.repromptCredentials(creds, locale);
53
+ api = deps.apiClientFactory(creds.endpoint, creds.apiKey);
54
+ dirty = true;
55
+ }
56
+ }
57
+ if (dirty) {
58
+ await deps.persistCredentials(projectDir, creds);
59
+ }
60
+ return { creds, api };
61
+ };
@@ -1,2 +1,4 @@
1
1
  import type { AccelCredentials } from "../core/types.js";
2
- export declare const ensureCredentials: (projectDir: string, locale: string) => Promise<AccelCredentials>;
2
+ export declare const ensureCredentials: (projectDir: string, locale: string, seed?: Partial<AccelCredentials>) => Promise<AccelCredentials>;
3
+ export declare const resolveCredentialsOrThrow: (projectDir: string, locale: string, seed: Partial<AccelCredentials>) => Promise<AccelCredentials>;
4
+ export declare const repromptCredentials: (current: AccelCredentials, locale: string, seed?: Partial<AccelCredentials>) => Promise<AccelCredentials>;
@@ -1,15 +1,15 @@
1
1
  import * as p from "@clack/prompts";
2
- import { readCredentials, writeCredentials, normalizeEndpoint, CREDENTIALS_GITIGNORE_ENTRY, } from "../utils/credentials.js";
3
- import { ensureGitignoreEntry } from "../utils/gitignore.js";
2
+ import { readCredentials, normalizeEndpoint } from "../utils/credentials.js";
3
+ import { persistCredentialsAndSyncMcp } from "../utils/mcp-sync.js";
4
4
  import { getMessage } from "../i18n/index.js";
5
5
  import { withHint } from "./format.js";
6
6
  const requiredValidator = (locale) => (value) => !value || value.trim().length === 0
7
7
  ? getMessage("credentials.error.required", locale)
8
8
  : undefined;
9
- export const ensureCredentials = async (projectDir, locale) => {
9
+ export const ensureCredentials = async (projectDir, locale, seed = {}) => {
10
10
  const existing = await readCredentials(projectDir);
11
- let endpoint = existing.endpoint;
12
- let apiKey = existing.apiKey;
11
+ let endpoint = seed.endpoint ?? existing.endpoint;
12
+ let apiKey = seed.apiKey ?? existing.apiKey;
13
13
  let changed = false;
14
14
  if (!endpoint) {
15
15
  const input = await p.text({
@@ -36,8 +36,51 @@ export const ensureCredentials = async (projectDir, locale) => {
36
36
  apiKey,
37
37
  };
38
38
  if (changed) {
39
- await writeCredentials(projectDir, creds);
40
- await ensureGitignoreEntry(projectDir, CREDENTIALS_GITIGNORE_ENTRY);
39
+ await persistCredentialsAndSyncMcp(projectDir, creds);
41
40
  }
42
41
  return creds;
43
42
  };
43
+ export const resolveCredentialsOrThrow = async (projectDir, locale, seed) => {
44
+ const existing = await readCredentials(projectDir);
45
+ const endpoint = seed.endpoint ?? existing.endpoint;
46
+ const apiKey = seed.apiKey ?? existing.apiKey;
47
+ const missing = [];
48
+ if (!endpoint || endpoint.trim().length === 0)
49
+ missing.push("endpoint");
50
+ if (!apiKey || apiKey.trim().length === 0)
51
+ missing.push("apiKey");
52
+ if (missing.length > 0) {
53
+ p.log.error(getMessage("credentials.error.missingNonInteractive", locale, {
54
+ fields: missing.join(", "),
55
+ }));
56
+ throw new Error(`missing credentials: ${missing.join(", ")}`);
57
+ }
58
+ return { endpoint: normalizeEndpoint(endpoint), apiKey: apiKey };
59
+ };
60
+ export const repromptCredentials = async (current, locale, seed = {}) => {
61
+ let endpoint = seed.endpoint;
62
+ if (endpoint === undefined) {
63
+ const endpointInput = await p.text({
64
+ message: withHint("credentials.prompt.endpoint", locale),
65
+ initialValue: current.endpoint,
66
+ validate: requiredValidator(locale),
67
+ });
68
+ if (p.isCancel(endpointInput))
69
+ process.exit(0);
70
+ endpoint = endpointInput;
71
+ }
72
+ let apiKey = seed.apiKey;
73
+ if (apiKey === undefined) {
74
+ const apiKeyInput = await p.password({
75
+ message: withHint("credentials.prompt.apiKey", locale),
76
+ validate: requiredValidator(locale),
77
+ });
78
+ if (p.isCancel(apiKeyInput))
79
+ process.exit(0);
80
+ apiKey = apiKeyInput;
81
+ }
82
+ return {
83
+ endpoint: normalizeEndpoint(endpoint),
84
+ apiKey,
85
+ };
86
+ };
@@ -9,6 +9,9 @@ export const buildNextStepsBody = (opts) => {
9
9
  if (opts.agents.includes("claude-code")) {
10
10
  steps.push(getMessage("nextSteps.agent.claudeCode", opts.locale));
11
11
  }
12
+ if (opts.agents.includes("codex")) {
13
+ steps.push(getMessage("nextSteps.agent.codex", opts.locale));
14
+ }
12
15
  if (opts.agents.includes("github-copilot")) {
13
16
  steps.push(getMessage("nextSteps.agent.githubCopilot", opts.locale));
14
17
  }
@@ -1,4 +1,5 @@
1
1
  import type { AccelSettings } from "../core/types.js";
2
+ import { type Release } from "../core/catalog.js";
2
3
  import { type Validators } from "../core/validators.js";
3
4
  export type PromptOptions = {
4
5
  name?: string;
@@ -6,6 +7,7 @@ export type PromptOptions = {
6
7
  jugglingProject?: string;
7
8
  accelplatformVersion?: string;
8
9
  module?: string[];
10
+ feature?: string[];
9
11
  group?: string;
10
12
  projectVersion?: string;
11
13
  description?: string;
@@ -23,4 +25,5 @@ export type ResolvedOptions = Omit<AccelSettings, "cliVersion" | "createdAt" | "
23
25
  };
24
26
  export declare const validateNonInteractive: (opts: PromptOptions) => string[];
25
27
  export declare const validateCliValues: (opts: PromptOptions, validators: Validators) => void;
28
+ export declare const validateCatalogValues: (opts: PromptOptions, release: Release, locale: string) => void;
26
29
  export declare const runPrompts: (opts: PromptOptions) => Promise<ResolvedOptions>;