takt 0.3.9 → 0.4.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.
Files changed (309) hide show
  1. package/README.md +364 -325
  2. package/dist/agents/index.d.ts +1 -1
  3. package/dist/agents/index.d.ts.map +1 -1
  4. package/dist/agents/index.js +1 -1
  5. package/dist/agents/index.js.map +1 -1
  6. package/dist/agents/runner.d.ts +0 -1
  7. package/dist/agents/runner.d.ts.map +1 -1
  8. package/dist/agents/runner.js +6 -5
  9. package/dist/agents/runner.js.map +1 -1
  10. package/dist/agents/types.d.ts +3 -1
  11. package/dist/agents/types.d.ts.map +1 -1
  12. package/dist/app/cli/commands.d.ts +1 -1
  13. package/dist/app/cli/commands.js +9 -1
  14. package/dist/app/cli/commands.js.map +1 -1
  15. package/dist/app/cli/routing.js +1 -0
  16. package/dist/app/cli/routing.js.map +1 -1
  17. package/dist/core/models/index.d.ts +1 -1
  18. package/dist/core/models/index.d.ts.map +1 -1
  19. package/dist/core/models/schemas.d.ts +8 -6
  20. package/dist/core/models/schemas.d.ts.map +1 -1
  21. package/dist/core/models/schemas.js +16 -15
  22. package/dist/core/models/schemas.js.map +1 -1
  23. package/dist/core/models/types.d.ts +1 -1
  24. package/dist/core/models/types.d.ts.map +1 -1
  25. package/dist/core/models/workflow-types.d.ts +26 -24
  26. package/dist/core/models/workflow-types.d.ts.map +1 -1
  27. package/dist/core/workflow/constants.d.ts +7 -7
  28. package/dist/core/workflow/constants.d.ts.map +1 -1
  29. package/dist/core/workflow/constants.js +7 -7
  30. package/dist/core/workflow/constants.js.map +1 -1
  31. package/dist/core/workflow/engine/MovementExecutor.d.ts +59 -0
  32. package/dist/core/workflow/engine/MovementExecutor.d.ts.map +1 -0
  33. package/dist/core/workflow/engine/{StepExecutor.js → MovementExecutor.js} +30 -25
  34. package/dist/core/workflow/engine/MovementExecutor.js.map +1 -0
  35. package/dist/core/workflow/engine/OptionsBuilder.d.ts +6 -6
  36. package/dist/core/workflow/engine/OptionsBuilder.d.ts.map +1 -1
  37. package/dist/core/workflow/engine/OptionsBuilder.js +8 -3
  38. package/dist/core/workflow/engine/OptionsBuilder.js.map +1 -1
  39. package/dist/core/workflow/engine/ParallelRunner.d.ts +12 -10
  40. package/dist/core/workflow/engine/ParallelRunner.d.ts.map +1 -1
  41. package/dist/core/workflow/engine/ParallelRunner.js +46 -41
  42. package/dist/core/workflow/engine/ParallelRunner.js.map +1 -1
  43. package/dist/core/workflow/engine/WorkflowEngine.d.ts +16 -16
  44. package/dist/core/workflow/engine/WorkflowEngine.d.ts.map +1 -1
  45. package/dist/core/workflow/engine/WorkflowEngine.js +105 -92
  46. package/dist/core/workflow/engine/WorkflowEngine.js.map +1 -1
  47. package/dist/core/workflow/engine/blocked-handler.d.ts +3 -3
  48. package/dist/core/workflow/engine/blocked-handler.d.ts.map +1 -1
  49. package/dist/core/workflow/engine/blocked-handler.js +2 -2
  50. package/dist/core/workflow/engine/blocked-handler.js.map +1 -1
  51. package/dist/core/workflow/engine/index.d.ts +2 -1
  52. package/dist/core/workflow/engine/index.d.ts.map +1 -1
  53. package/dist/core/workflow/engine/index.js +1 -1
  54. package/dist/core/workflow/engine/index.js.map +1 -1
  55. package/dist/core/workflow/engine/loop-detector.d.ts +5 -5
  56. package/dist/core/workflow/engine/loop-detector.d.ts.map +1 -1
  57. package/dist/core/workflow/engine/loop-detector.js +8 -8
  58. package/dist/core/workflow/engine/loop-detector.js.map +1 -1
  59. package/dist/core/workflow/engine/parallel-logger.d.ts +15 -15
  60. package/dist/core/workflow/engine/parallel-logger.d.ts.map +1 -1
  61. package/dist/core/workflow/engine/parallel-logger.js +22 -21
  62. package/dist/core/workflow/engine/parallel-logger.js.map +1 -1
  63. package/dist/core/workflow/engine/state-manager.d.ts +6 -6
  64. package/dist/core/workflow/engine/state-manager.d.ts.map +1 -1
  65. package/dist/core/workflow/engine/state-manager.js +15 -16
  66. package/dist/core/workflow/engine/state-manager.js.map +1 -1
  67. package/dist/core/workflow/engine/transitions.d.ts +5 -5
  68. package/dist/core/workflow/engine/transitions.d.ts.map +1 -1
  69. package/dist/core/workflow/engine/transitions.js +4 -4
  70. package/dist/core/workflow/engine/transitions.js.map +1 -1
  71. package/dist/core/workflow/evaluation/AggregateEvaluator.d.ts +15 -15
  72. package/dist/core/workflow/evaluation/AggregateEvaluator.d.ts.map +1 -1
  73. package/dist/core/workflow/evaluation/AggregateEvaluator.js +35 -33
  74. package/dist/core/workflow/evaluation/AggregateEvaluator.js.map +1 -1
  75. package/dist/core/workflow/evaluation/RuleEvaluator.d.ts +8 -8
  76. package/dist/core/workflow/evaluation/RuleEvaluator.d.ts.map +1 -1
  77. package/dist/core/workflow/evaluation/RuleEvaluator.js +18 -14
  78. package/dist/core/workflow/evaluation/RuleEvaluator.js.map +1 -1
  79. package/dist/core/workflow/evaluation/index.d.ts +4 -4
  80. package/dist/core/workflow/evaluation/index.d.ts.map +1 -1
  81. package/dist/core/workflow/evaluation/index.js +1 -1
  82. package/dist/core/workflow/evaluation/index.js.map +1 -1
  83. package/dist/core/workflow/evaluation/rule-utils.d.ts +4 -4
  84. package/dist/core/workflow/evaluation/rule-utils.d.ts.map +1 -1
  85. package/dist/core/workflow/evaluation/rule-utils.js +2 -2
  86. package/dist/core/workflow/evaluation/rule-utils.js.map +1 -1
  87. package/dist/core/workflow/index.d.ts +6 -6
  88. package/dist/core/workflow/index.d.ts.map +1 -1
  89. package/dist/core/workflow/index.js +5 -5
  90. package/dist/core/workflow/index.js.map +1 -1
  91. package/dist/core/workflow/instruction/InstructionBuilder.d.ts +17 -15
  92. package/dist/core/workflow/instruction/InstructionBuilder.d.ts.map +1 -1
  93. package/dist/core/workflow/instruction/InstructionBuilder.js +105 -120
  94. package/dist/core/workflow/instruction/InstructionBuilder.js.map +1 -1
  95. package/dist/core/workflow/instruction/ReportInstructionBuilder.d.ts +10 -11
  96. package/dist/core/workflow/instruction/ReportInstructionBuilder.d.ts.map +1 -1
  97. package/dist/core/workflow/instruction/ReportInstructionBuilder.js +38 -84
  98. package/dist/core/workflow/instruction/ReportInstructionBuilder.js.map +1 -1
  99. package/dist/core/workflow/instruction/StatusJudgmentBuilder.d.ts +6 -5
  100. package/dist/core/workflow/instruction/StatusJudgmentBuilder.d.ts.map +1 -1
  101. package/dist/core/workflow/instruction/StatusJudgmentBuilder.js +14 -22
  102. package/dist/core/workflow/instruction/StatusJudgmentBuilder.js.map +1 -1
  103. package/dist/core/workflow/instruction/escape.d.ts +3 -3
  104. package/dist/core/workflow/instruction/escape.d.ts.map +1 -1
  105. package/dist/core/workflow/instruction/escape.js +3 -3
  106. package/dist/core/workflow/instruction/escape.js.map +1 -1
  107. package/dist/core/workflow/instruction/instruction-context.d.ts +16 -49
  108. package/dist/core/workflow/instruction/instruction-context.d.ts.map +1 -1
  109. package/dist/core/workflow/instruction/instruction-context.js +17 -62
  110. package/dist/core/workflow/instruction/instruction-context.js.map +1 -1
  111. package/dist/core/workflow/instruction/status-rules.d.ts +19 -14
  112. package/dist/core/workflow/instruction/status-rules.d.ts.map +1 -1
  113. package/dist/core/workflow/instruction/status-rules.js +47 -66
  114. package/dist/core/workflow/instruction/status-rules.js.map +1 -1
  115. package/dist/core/workflow/phase-runner.d.ts +14 -8
  116. package/dist/core/workflow/phase-runner.d.ts.map +1 -1
  117. package/dist/core/workflow/phase-runner.js +75 -78
  118. package/dist/core/workflow/phase-runner.js.map +1 -1
  119. package/dist/core/workflow/types.d.ts +15 -12
  120. package/dist/core/workflow/types.d.ts.map +1 -1
  121. package/dist/features/config/ejectBuiltin.js +3 -3
  122. package/dist/features/config/ejectBuiltin.js.map +1 -1
  123. package/dist/features/interactive/interactive.d.ts.map +1 -1
  124. package/dist/features/interactive/interactive.js +38 -169
  125. package/dist/features/interactive/interactive.js.map +1 -1
  126. package/dist/features/prompt/index.d.ts +5 -0
  127. package/dist/features/prompt/index.d.ts.map +1 -0
  128. package/dist/features/prompt/index.js +5 -0
  129. package/dist/features/prompt/index.js.map +1 -0
  130. package/dist/features/prompt/preview.d.ts +14 -0
  131. package/dist/features/prompt/preview.d.ts.map +1 -0
  132. package/dist/features/prompt/preview.js +74 -0
  133. package/dist/features/prompt/preview.js.map +1 -0
  134. package/dist/features/tasks/add/index.d.ts +6 -9
  135. package/dist/features/tasks/add/index.d.ts.map +1 -1
  136. package/dist/features/tasks/add/index.js +23 -55
  137. package/dist/features/tasks/add/index.js.map +1 -1
  138. package/dist/features/tasks/execute/selectAndExecute.d.ts.map +1 -1
  139. package/dist/features/tasks/execute/selectAndExecute.js +1 -0
  140. package/dist/features/tasks/execute/selectAndExecute.js.map +1 -1
  141. package/dist/features/tasks/execute/taskExecution.d.ts.map +1 -1
  142. package/dist/features/tasks/execute/taskExecution.js +4 -3
  143. package/dist/features/tasks/execute/taskExecution.js.map +1 -1
  144. package/dist/features/tasks/execute/types.d.ts +13 -0
  145. package/dist/features/tasks/execute/types.d.ts.map +1 -1
  146. package/dist/features/tasks/execute/workflowExecution.d.ts.map +1 -1
  147. package/dist/features/tasks/execute/workflowExecution.js +63 -18
  148. package/dist/features/tasks/execute/workflowExecution.js.map +1 -1
  149. package/dist/features/tasks/index.d.ts +1 -1
  150. package/dist/features/tasks/index.d.ts.map +1 -1
  151. package/dist/features/tasks/index.js +1 -1
  152. package/dist/features/tasks/index.js.map +1 -1
  153. package/dist/features/tasks/list/index.d.ts.map +1 -1
  154. package/dist/features/tasks/list/index.js +0 -1
  155. package/dist/features/tasks/list/index.js.map +1 -1
  156. package/dist/features/tasks/list/taskActions.d.ts +1 -0
  157. package/dist/features/tasks/list/taskActions.d.ts.map +1 -1
  158. package/dist/features/tasks/list/taskActions.js +24 -1
  159. package/dist/features/tasks/list/taskActions.js.map +1 -1
  160. package/dist/features/workflowSelection/index.js +1 -1
  161. package/dist/features/workflowSelection/index.js.map +1 -1
  162. package/dist/index.d.ts +3 -3
  163. package/dist/index.d.ts.map +1 -1
  164. package/dist/index.js +1 -1
  165. package/dist/index.js.map +1 -1
  166. package/dist/infra/claude/client.d.ts +1 -1
  167. package/dist/infra/claude/client.d.ts.map +1 -1
  168. package/dist/infra/claude/client.js +6 -24
  169. package/dist/infra/claude/client.js.map +1 -1
  170. package/dist/infra/claude/executor.d.ts +0 -1
  171. package/dist/infra/claude/executor.d.ts.map +1 -1
  172. package/dist/infra/claude/executor.js +0 -2
  173. package/dist/infra/claude/executor.js.map +1 -1
  174. package/dist/infra/claude/index.js +2 -2
  175. package/dist/infra/claude/index.js.map +1 -1
  176. package/dist/infra/claude/options-builder.js +4 -4
  177. package/dist/infra/claude/options-builder.js.map +1 -1
  178. package/dist/infra/claude/process.d.ts +1 -1
  179. package/dist/infra/claude/process.d.ts.map +1 -1
  180. package/dist/infra/claude/process.js +1 -1
  181. package/dist/infra/claude/process.js.map +1 -1
  182. package/dist/infra/claude/query-manager.d.ts +1 -1
  183. package/dist/infra/claude/query-manager.d.ts.map +1 -1
  184. package/dist/infra/claude/query-manager.js +1 -2
  185. package/dist/infra/claude/query-manager.js.map +1 -1
  186. package/dist/infra/claude/stream-converter.d.ts +2 -2
  187. package/dist/infra/claude/stream-converter.js +2 -2
  188. package/dist/infra/claude/types.d.ts +1 -1
  189. package/dist/infra/claude/types.d.ts.map +1 -1
  190. package/dist/infra/codex/client.d.ts.map +1 -1
  191. package/dist/infra/codex/client.js +0 -1
  192. package/dist/infra/codex/client.js.map +1 -1
  193. package/dist/infra/config/global/globalConfig.d.ts.map +1 -1
  194. package/dist/infra/config/global/globalConfig.js +0 -1
  195. package/dist/infra/config/global/globalConfig.js.map +1 -1
  196. package/dist/infra/config/loaders/agentLoader.d.ts +1 -1
  197. package/dist/infra/config/loaders/agentLoader.d.ts.map +1 -1
  198. package/dist/infra/config/loaders/agentLoader.js +6 -5
  199. package/dist/infra/config/loaders/agentLoader.js.map +1 -1
  200. package/dist/infra/config/loaders/loader.d.ts +1 -1
  201. package/dist/infra/config/loaders/loader.js +1 -1
  202. package/dist/infra/config/loaders/workflowParser.d.ts.map +1 -1
  203. package/dist/infra/config/loaders/workflowParser.js +9 -5
  204. package/dist/infra/config/loaders/workflowParser.js.map +1 -1
  205. package/dist/infra/config/loaders/workflowResolver.d.ts +4 -4
  206. package/dist/infra/config/loaders/workflowResolver.js +11 -11
  207. package/dist/infra/config/loaders/workflowResolver.js.map +1 -1
  208. package/dist/infra/config/paths.d.ts +4 -4
  209. package/dist/infra/config/paths.d.ts.map +1 -1
  210. package/dist/infra/config/paths.js +7 -7
  211. package/dist/infra/config/paths.js.map +1 -1
  212. package/dist/infra/config/project/index.d.ts +1 -1
  213. package/dist/infra/config/project/index.d.ts.map +1 -1
  214. package/dist/infra/config/project/index.js.map +1 -1
  215. package/dist/infra/config/project/projectConfig.d.ts +2 -2
  216. package/dist/infra/config/project/projectConfig.d.ts.map +1 -1
  217. package/dist/infra/config/types.d.ts +0 -2
  218. package/dist/infra/config/types.d.ts.map +1 -1
  219. package/dist/infra/fs/index.d.ts +1 -1
  220. package/dist/infra/fs/index.d.ts.map +1 -1
  221. package/dist/infra/fs/index.js.map +1 -1
  222. package/dist/infra/fs/session.d.ts +1 -1
  223. package/dist/infra/fs/session.d.ts.map +1 -1
  224. package/dist/infra/fs/session.js +0 -1
  225. package/dist/infra/fs/session.js.map +1 -1
  226. package/dist/infra/providers/index.d.ts.map +1 -1
  227. package/dist/infra/providers/index.js +0 -1
  228. package/dist/infra/providers/index.js.map +1 -1
  229. package/dist/infra/task/autoCommit.js +1 -1
  230. package/dist/infra/task/autoCommit.js.map +1 -1
  231. package/dist/infra/task/branchList.d.ts +4 -2
  232. package/dist/infra/task/branchList.d.ts.map +1 -1
  233. package/dist/infra/task/branchList.js +87 -9
  234. package/dist/infra/task/branchList.js.map +1 -1
  235. package/dist/infra/task/clone.js +1 -1
  236. package/dist/infra/task/clone.js.map +1 -1
  237. package/dist/infra/task/parser.d.ts +1 -1
  238. package/dist/infra/task/parser.js +1 -1
  239. package/dist/infra/task/summarize.d.ts.map +1 -1
  240. package/dist/infra/task/summarize.js +3 -15
  241. package/dist/infra/task/summarize.js.map +1 -1
  242. package/dist/infra/task/types.d.ts +1 -0
  243. package/dist/infra/task/types.d.ts.map +1 -1
  244. package/dist/shared/context.d.ts.map +1 -1
  245. package/dist/shared/context.js +0 -1
  246. package/dist/shared/context.js.map +1 -1
  247. package/dist/shared/i18n/index.d.ts +31 -0
  248. package/dist/shared/i18n/index.d.ts.map +1 -0
  249. package/dist/shared/i18n/index.js +97 -0
  250. package/dist/shared/i18n/index.js.map +1 -0
  251. package/dist/shared/i18n/labels_en.yaml +37 -0
  252. package/dist/shared/i18n/labels_ja.yaml +37 -0
  253. package/dist/shared/prompt/select.d.ts +0 -3
  254. package/dist/shared/prompt/select.d.ts.map +1 -1
  255. package/dist/shared/prompt/select.js +5 -20
  256. package/dist/shared/prompt/select.js.map +1 -1
  257. package/dist/shared/prompts/en/perform_agent_system_prompt.md +7 -0
  258. package/dist/shared/prompts/en/perform_builtin_agent_system_prompt.md +7 -0
  259. package/dist/shared/prompts/en/perform_judge_message.md +24 -0
  260. package/dist/shared/prompts/en/perform_phase1_message.md +45 -0
  261. package/dist/shared/prompts/en/perform_phase2_message.md +31 -0
  262. package/dist/shared/prompts/en/perform_phase3_message.md +19 -0
  263. package/dist/shared/prompts/en/score_interactive_system_prompt.md +53 -0
  264. package/dist/shared/prompts/en/score_slug_system_prompt.md +19 -0
  265. package/dist/shared/prompts/en/score_summary_system_prompt.md +25 -0
  266. package/dist/shared/prompts/index.d.ts +27 -0
  267. package/dist/shared/prompts/index.d.ts.map +1 -0
  268. package/dist/shared/prompts/index.js +111 -0
  269. package/dist/shared/prompts/index.js.map +1 -0
  270. package/dist/shared/prompts/ja/perform_agent_system_prompt.md +7 -0
  271. package/dist/shared/prompts/ja/perform_builtin_agent_system_prompt.md +7 -0
  272. package/dist/shared/prompts/ja/perform_judge_message.md +24 -0
  273. package/dist/shared/prompts/ja/perform_phase1_message.md +44 -0
  274. package/dist/shared/prompts/ja/perform_phase2_message.md +30 -0
  275. package/dist/shared/prompts/ja/perform_phase3_message.md +19 -0
  276. package/dist/shared/prompts/ja/score_interactive_system_prompt.md +59 -0
  277. package/dist/shared/prompts/ja/score_slug_system_prompt.md +19 -0
  278. package/dist/shared/prompts/ja/score_summary_system_prompt.md +32 -0
  279. package/dist/shared/ui/LogManager.d.ts +1 -1
  280. package/dist/shared/ui/LogManager.d.ts.map +1 -1
  281. package/dist/shared/ui/LogManager.js +1 -2
  282. package/dist/shared/ui/LogManager.js.map +1 -1
  283. package/dist/shared/utils/debug.js +1 -1
  284. package/dist/shared/utils/debug.js.map +1 -1
  285. package/dist/shared/utils/types.d.ts +29 -1
  286. package/dist/shared/utils/types.d.ts.map +1 -1
  287. package/package.json +2 -2
  288. package/resources/global/en/{workflows → pieces}/default.yaml +16 -16
  289. package/resources/global/en/{workflows → pieces}/expert-cqrs.yaml +17 -17
  290. package/resources/global/en/{workflows → pieces}/expert.yaml +20 -20
  291. package/resources/global/en/{workflows → pieces}/magi.yaml +4 -4
  292. package/resources/global/en/{workflows → pieces}/minimal.yaml +7 -7
  293. package/resources/global/en/{workflows → pieces}/research.yaml +11 -11
  294. package/resources/global/en/{workflows → pieces}/review-fix-minimal.yaml +8 -8
  295. package/resources/global/en/{workflows → pieces}/review-only.yaml +7 -7
  296. package/resources/global/ja/agents/default/architecture-reviewer.md +3 -3
  297. package/resources/global/ja/agents/default/supervisor.md +1 -1
  298. package/resources/global/ja/agents/templates/planner.md +1 -1
  299. package/resources/global/ja/{workflows → pieces}/default.yaml +12 -12
  300. package/resources/global/ja/{workflows → pieces}/expert-cqrs.yaml +18 -18
  301. package/resources/global/ja/{workflows → pieces}/expert.yaml +15 -15
  302. package/resources/global/ja/{workflows → pieces}/magi.yaml +4 -4
  303. package/resources/global/ja/{workflows → pieces}/minimal.yaml +8 -8
  304. package/resources/global/ja/{workflows → pieces}/research.yaml +11 -11
  305. package/resources/global/ja/{workflows → pieces}/review-fix-minimal.yaml +8 -8
  306. package/resources/global/ja/{workflows → pieces}/review-only.yaml +7 -7
  307. package/dist/core/workflow/engine/StepExecutor.d.ts +0 -52
  308. package/dist/core/workflow/engine/StepExecutor.d.ts.map +0 -1
  309. package/dist/core/workflow/engine/StepExecutor.js.map +0 -1
@@ -0,0 +1,37 @@
1
+ # =============================================================================
2
+ # TAKT UI Labels — English
3
+ # =============================================================================
4
+ # User-facing display strings (not AI prompts).
5
+ # Template variables use {variableName} syntax.
6
+ # =============================================================================
7
+
8
+ # ===== Interactive Mode UI =====
9
+ interactive:
10
+ conversationLabel: "Conversation:"
11
+ noTranscript: "(No local transcript. Summarize the current session context.)"
12
+ ui:
13
+ intro: "Interactive mode - describe your task. Commands: /go (execute), /cancel (exit)"
14
+ resume: "Resuming previous session"
15
+ noConversation: "No conversation yet. Please describe your task first."
16
+ summarizeFailed: "Failed to summarize conversation. Please try again."
17
+ continuePrompt: "Okay, continue describing your task."
18
+ proposed: "Proposed task instruction:"
19
+ confirm: "Use this task instruction?"
20
+ cancelled: "Cancelled"
21
+
22
+ # ===== Workflow Execution UI =====
23
+ workflow:
24
+ iterationLimit:
25
+ maxReached: "最大イテレーションに到達しました ({currentIteration}/{maxIterations})"
26
+ currentMovement: "現在のムーブメント: {currentMovement}"
27
+ continueQuestion: "続行しますか?"
28
+ continueLabel: "続行する(追加イテレーション数を入力)"
29
+ continueDescription: "入力した回数だけ上限を増やします"
30
+ stopLabel: "終了する"
31
+ inputPrompt: "追加するイテレーション数を入力してください(1以上)"
32
+ invalidInput: "1以上の整数を入力してください。"
33
+ userInputPrompt: "追加の指示を入力してください(空で中止)"
34
+ notifyComplete: "ワークフロー完了 ({iteration} iterations)"
35
+ notifyAbort: "中断: {reason}"
36
+ sigintGraceful: "Ctrl+C: ワークフローを中断しています..."
37
+ sigintForce: "Ctrl+C: 強制終了します"
@@ -0,0 +1,37 @@
1
+ # =============================================================================
2
+ # TAKT UI Labels — 日本語
3
+ # =============================================================================
4
+ # ユーザー向け表示文字列(AIプロンプトではない)。
5
+ # テンプレート変数は {variableName} 形式を使用します。
6
+ # =============================================================================
7
+
8
+ # ===== Interactive Mode UI =====
9
+ interactive:
10
+ conversationLabel: "会話:"
11
+ noTranscript: "(ローカル履歴なし。現在のセッション文脈を要約してください。)"
12
+ ui:
13
+ intro: "対話モード - タスク内容を入力してください。コマンド: /go(実行), /cancel(終了)"
14
+ resume: "前回のセッションを再開します"
15
+ noConversation: "まだ会話がありません。まずタスク内容を入力してください。"
16
+ summarizeFailed: "会話の要約に失敗しました。再度お試しください。"
17
+ continuePrompt: "続けてタスク内容を入力してください。"
18
+ proposed: "提案されたタスク指示:"
19
+ confirm: "このタスク指示で進めますか?"
20
+ cancelled: "キャンセルしました"
21
+
22
+ # ===== Workflow Execution UI =====
23
+ workflow:
24
+ iterationLimit:
25
+ maxReached: "最大イテレーションに到達しました ({currentIteration}/{maxIterations})"
26
+ currentMovement: "現在のムーブメント: {currentMovement}"
27
+ continueQuestion: "続行しますか?"
28
+ continueLabel: "続行する(追加イテレーション数を入力)"
29
+ continueDescription: "入力した回数だけ上限を増やします"
30
+ stopLabel: "終了する"
31
+ inputPrompt: "追加するイテレーション数を入力してください(1以上)"
32
+ invalidInput: "1以上の整数を入力してください。"
33
+ userInputPrompt: "追加の指示を入力してください(空で中止)"
34
+ notifyComplete: "ワークフロー完了 ({iteration} iterations)"
35
+ notifyAbort: "中断: {reason}"
36
+ sigintGraceful: "Ctrl+C: ワークフローを中断しています..."
37
+ sigintForce: "Ctrl+C: 強制終了します"
@@ -54,14 +54,11 @@ export interface InteractiveSelectCallbacks<T extends string> {
54
54
  * Return null to delegate to default handler.
55
55
  */
56
56
  onKeyPress?: (key: string, value: T, index: number) => SelectOptionItem<T>[] | null;
57
- /** Called when 'b' key is pressed. Returns updated options for re-render. @deprecated Use onKeyPress instead */
58
- onBookmark?: (value: T, index: number) => SelectOptionItem<T>[];
59
57
  /** Custom label for cancel option (default: "Cancel") */
60
58
  cancelLabel?: string;
61
59
  }
62
60
  /**
63
61
  * Prompt user to select from a list of options using cursor navigation.
64
- * @param callbacks.onBookmark - Called when 'b' key is pressed. Returns updated options for re-render.
65
62
  * @returns Selected option or null if cancelled
66
63
  */
67
64
  export declare function selectOption<T extends string>(message: string, options: SelectOptionItem<T>[], callbacks?: InteractiveSelectCallbacks<T>): Promise<T | null>;
@@ -1 +1 @@
1
- {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/shared/prompt/select.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,mCAAmC;AACnC,MAAM,WAAW,gBAAgB,CAAC,CAAC,SAAS,MAAM;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,CAAC,CAAC;IACT,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,EACzC,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAE,EAC9B,aAAa,EAAE,MAAM,EACrB,eAAe,EAAE,OAAO,EACxB,WAAW,SAAW,GACrB,MAAM,EAAE,CAoCV;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,MAAM,EACjD,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAE,EAC9B,eAAe,EAAE,OAAO,GACvB,MAAM,CASR;AAED,qCAAqC;AACrC,MAAM,MAAM,cAAc,GACtB;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACpC;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,GAC5C;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GACzC;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,GAC7C;IAAE,MAAM,EAAE,iBAAiB,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE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AAE,MAAM,GAClB,cAAc,CAuBhB;AA4CD,gDAAgD;AAChD,MAAM,WAAW,0BAA0B,CAAC,CAAC,SAAS,MAAM;IAC1D;;;;OAIG;IACH,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,gBAAgB,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC;IACpF,yDAAyD;IACzD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAyGD;;;GAGG;AACH,wBAAsB,YAAY,CAAC,CAAC,SAAS,MAAM,EACjD,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAE,EAC9B,SAAS,CAAC,EAAE,0BAA0B,CAAC,CAAC,CAAC,GACxC,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAgBnB;AAED;;;GAGG;AACH,wBAAsB,uBAAuB,CAAC,CAAC,SAAS,MAAM,EAC5D,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,EAAE,EACtC,YAAY,EAAE,CAAC,GACd,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAwBnB"}
@@ -17,6 +17,8 @@ export function renderMenu(options, selectedIndex, hasCancelOption, cancelLabel
17
17
  const lines = [];
18
18
  for (let i = 0; i < options.length; i++) {
19
19
  const opt = options[i];
20
+ if (!opt)
21
+ continue;
20
22
  const isSelected = i === selectedIndex;
21
23
  const cursor = isSelected ? chalk.cyan('❯') : ' ';
22
24
  const truncatedLabel = truncateText(opt.label, maxWidth - labelPrefix);
@@ -125,7 +127,7 @@ function interactiveSelect(message, options, initialIndex, hasCancelOption, call
125
127
  let totalItems = hasCancelOption ? currentOptions.length + 1 : currentOptions.length;
126
128
  let selectedIndex = initialIndex;
127
129
  const cancelLabel = callbacks?.cancelLabel ?? 'Cancel';
128
- printHeader(message, !!callbacks?.onKeyPress || !!callbacks?.onBookmark);
130
+ printHeader(message, !!callbacks?.onKeyPress);
129
131
  process.stdout.write('\x1B[?7l');
130
132
  let totalLines = countRenderedLines(currentOptions, hasCancelOption);
131
133
  const lines = renderMenu(currentOptions, selectedIndex, hasCancelOption, cancelLabel);
@@ -174,25 +176,9 @@ function interactiveSelect(message, options, initialIndex, hasCancelOption, call
174
176
  cleanup(onKeypress);
175
177
  resolve({ selectedIndex: result.cancelIndex, finalOptions: currentOptions });
176
178
  break;
177
- case 'bookmark': {
178
- if (!callbacks?.onBookmark)
179
- break;
180
- // Only bookmark actual options, not the cancel row
181
- if (result.selectedIndex >= currentOptions.length)
182
- break;
183
- const item = currentOptions[result.selectedIndex];
184
- if (!item)
185
- break;
186
- const newOptions = callbacks.onBookmark(item.value, result.selectedIndex);
187
- // Find the same value in the new options to preserve cursor position
188
- const currentValue = item.value;
189
- currentOptions = newOptions;
190
- totalItems = hasCancelOption ? currentOptions.length + 1 : currentOptions.length;
191
- const newIdx = currentOptions.findIndex((o) => o.value === currentValue);
192
- selectedIndex = newIdx >= 0 ? newIdx : Math.min(selectedIndex, currentOptions.length - 1);
193
- totalLines = redrawMenu(currentOptions, selectedIndex, hasCancelOption, totalLines, cancelLabel);
179
+ case 'bookmark':
180
+ // Handled by custom onKeyPress
194
181
  break;
195
- }
196
182
  case 'remove_bookmark':
197
183
  // Ignore - should be handled by custom onKeyPress
198
184
  break;
@@ -209,7 +195,6 @@ function interactiveSelect(message, options, initialIndex, hasCancelOption, call
209
195
  }
210
196
  /**
211
197
  * Prompt user to select from a list of options using cursor navigation.
212
- * @param callbacks.onBookmark - Called when 'b' key is pressed. Returns updated options for re-render.
213
198
  * @returns Selected option or null if cancelled
214
199
  */
215
200
  export async function selectOption(message, options, callbacks) {
@@ -1 +1 @@
1
- {"version":3,"file":"select.js","sourceRoot":"","sources":["../../../src/shared/prompt/select.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,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AY,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IAE1D,MAAM,gBAAgB,GAA0B,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QACpE,GAAG,GAAG;QACN,KAAK,EAAE,GAAG,CAAC,KAAK,KAAK,YAAY,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK;KAC3F,CAAC,CAAC,CAAC;IAEJ,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,iBAAiB,CAAC,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;IAEjG,IAAI,aAAa,KAAK,OAAO,CAAC,MAAM,IAAI,aAAa,KAAK,CAAC,CAAC,EAAE,CAAC;QAC7D,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,QAAQ,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IACxC,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAClD,OAAO,QAAQ,CAAC,KAAK,CAAC;IACxB,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC"}
@@ -0,0 +1,7 @@
1
+ <!--
2
+ template: perform_agent_system_prompt
3
+ role: system prompt for user-defined agents
4
+ vars: agentDefinition
5
+ caller: AgentRunner
6
+ -->
7
+ {{agentDefinition}}
@@ -0,0 +1,7 @@
1
+ <!--
2
+ template: perform_builtin_agent_system_prompt
3
+ role: system prompt for builtin agents (Claude Code)
4
+ vars: agentName
5
+ caller: infra/claude/client.ts
6
+ -->
7
+ You are the {{agentName}} agent. Follow the standard {{agentName}} workflow.
@@ -0,0 +1,24 @@
1
+ <!--
2
+ template: perform_judge_message
3
+ phase: judge (AI-based rule evaluation)
4
+ vars: agentOutput, conditionList
5
+ caller: callAiJudge
6
+ -->
7
+ # Judge Task
8
+
9
+ You are a judge evaluating an agent's output against a set of conditions.
10
+ Read the agent output below, then determine which condition best matches.
11
+
12
+ ## Agent Output
13
+ ```
14
+ {{agentOutput}}
15
+ ```
16
+
17
+ ## Conditions
18
+ | # | Condition |
19
+ |---|-----------|
20
+ {{conditionList}}
21
+
22
+ ## Instructions
23
+ Output ONLY the tag `[JUDGE:N]` where N is the number of the best matching condition.
24
+ Do not output anything else.
@@ -0,0 +1,45 @@
1
+ <!--
2
+ template: perform_phase1_message
3
+ phase: 1 (main execution)
4
+ vars: workingDirectory, editRule, workflowStructure, iteration, movementIteration,
5
+ movement, hasReport, reportInfo, phaseNote, hasTaskSection, userRequest,
6
+ hasPreviousResponse, previousResponse, hasUserInputs, userInputs, instructions
7
+ builder: InstructionBuilder
8
+ -->
9
+ ## Execution Context
10
+ - Working Directory: {{workingDirectory}}
11
+
12
+ ## Execution Rules
13
+ - **Do NOT run git commit.** Commits are handled automatically by the system after workflow completion.
14
+ - **Do NOT use `cd` in Bash commands.** Your working directory is already set correctly. Run commands directly without changing directories.
15
+ {{#if editRule}}- {{editRule}}
16
+ {{/if}}
17
+ Note: This section is metadata. Follow the language used in the rest of the prompt.
18
+
19
+ ## Workflow Context
20
+ {{#if workflowStructure}}{{workflowStructure}}
21
+
22
+ {{/if}}- Iteration: {{iteration}}(workflow-wide)
23
+ - Movement Iteration: {{movementIteration}}(times this movement has run)
24
+ - Movement: {{movement}}
25
+ {{#if hasReport}}{{reportInfo}}
26
+
27
+ {{phaseNote}}{{/if}}
28
+ {{#if hasTaskSection}}
29
+
30
+ ## User Request
31
+ {{userRequest}}
32
+ {{/if}}
33
+ {{#if hasPreviousResponse}}
34
+
35
+ ## Previous Response
36
+ {{previousResponse}}
37
+ {{/if}}
38
+ {{#if hasUserInputs}}
39
+
40
+ ## Additional User Inputs
41
+ {{userInputs}}
42
+ {{/if}}
43
+
44
+ ## Instructions
45
+ {{instructions}}
@@ -0,0 +1,31 @@
1
+ <!--
2
+ template: perform_phase2_message
3
+ phase: 2 (report output)
4
+ vars: workingDirectory, reportContext, hasReportOutput, reportOutput,
5
+ hasReportFormat, reportFormat
6
+ builder: ReportInstructionBuilder
7
+ -->
8
+ ## Execution Context
9
+ - Working Directory: {{workingDirectory}}
10
+
11
+ ## Execution Rules
12
+ - **Do NOT run git commit.** Commits are handled automatically by the system after workflow completion.
13
+ - **Do NOT use `cd` in Bash commands.** Your working directory is already set correctly. Run commands directly without changing directories.
14
+ - **Do NOT modify project source files.** Only respond with the report content.
15
+ - **Use only the Report Directory files listed below.** Do not search or open reports outside that directory.
16
+ Note: This section is metadata. Follow the language used in the rest of the prompt.
17
+
18
+ ## Workflow Context
19
+ {{reportContext}}
20
+
21
+ ## Instructions
22
+ Respond with the results of the work you just completed as a report. **Tools are not available in this phase. Respond with the report content directly as text.**
23
+ **Respond with only the report content (no status tags, no commentary). You cannot use the Write tool or any other tools.**
24
+ {{#if hasReportOutput}}
25
+
26
+ {{reportOutput}}
27
+ {{/if}}
28
+ {{#if hasReportFormat}}
29
+
30
+ {{reportFormat}}
31
+ {{/if}}
@@ -0,0 +1,19 @@
1
+ <!--
2
+ template: perform_phase3_message
3
+ phase: 3 (status judgment)
4
+ vars: criteriaTable, outputList, hasAppendix, appendixContent
5
+ builder: StatusJudgmentBuilder
6
+ -->
7
+ Review your work results and determine the status. Do NOT perform any additional work.
8
+
9
+ ## Decision Criteria
10
+
11
+ {{criteriaTable}}
12
+
13
+ ## Output Format
14
+
15
+ {{outputList}}
16
+ {{#if hasAppendix}}
17
+
18
+ ### Appendix Template
19
+ {{appendixContent}}{{/if}}
@@ -0,0 +1,53 @@
1
+ <!--
2
+ template: score_interactive_system_prompt
3
+ role: system prompt for interactive planning mode
4
+ vars: workflowInfo, workflowName, workflowDescription
5
+ caller: features/interactive
6
+ -->
7
+ You are a task planning assistant. You help the user clarify and refine task requirements through conversation. You are in the PLANNING phase — execution happens later in a separate process.
8
+
9
+ ## Your role
10
+ - Ask clarifying questions about ambiguous requirements
11
+ - Clarify and refine the user's request into a clear task instruction
12
+ - Create concrete instructions for workflow agents to follow
13
+ - Summarize your understanding when appropriate
14
+ - Keep responses concise and focused
15
+
16
+ **Important**: Do NOT investigate the codebase, identify files, or make assumptions about implementation details. That is the job of the next workflow steps (plan/architect).
17
+
18
+ ## Critical: Understanding user intent
19
+ **The user is asking YOU to create a task instruction for the WORKFLOW, not asking you to execute the task.**
20
+
21
+ When the user says:
22
+ - "Review this code" → They want the WORKFLOW to review (you create the instruction)
23
+ - "Implement feature X" → They want the WORKFLOW to implement (you create the instruction)
24
+ - "Fix this bug" → They want the WORKFLOW to fix (you create the instruction)
25
+
26
+ These are NOT requests for YOU to investigate. Do NOT read files, check diffs, or explore code unless the user explicitly asks YOU to investigate in the planning phase.
27
+
28
+ ## When investigation IS appropriate (rare cases)
29
+ Only investigate when the user explicitly asks YOU (the planning assistant) to check something:
30
+ - "Check the README to understand the project structure" ✓
31
+ - "Read file X to see what it does" ✓
32
+ - "What does this project do?" ✓
33
+
34
+ ## When investigation is NOT appropriate (most cases)
35
+ Do NOT investigate when the user is describing a task for the workflow:
36
+ - "Review the changes" ✗ (workflow's job)
37
+ - "Fix the code" ✗ (workflow's job)
38
+ - "Implement X" ✗ (workflow's job)
39
+
40
+ ## Strict constraints
41
+ - You are ONLY refining requirements. Do NOT execute the task.
42
+ - Do NOT create, edit, or delete any files (except when explicitly asked to check something for planning).
43
+ - Do NOT use Read/Glob/Grep/Bash proactively. Only use them when the user explicitly asks YOU to investigate for planning purposes.
44
+ - Do NOT mention or reference any slash commands. You have no knowledge of them.
45
+ - When the user is satisfied with the requirements, they will proceed on their own. Do NOT instruct them on what to do next.
46
+ {{#if workflowInfo}}
47
+
48
+ ## Destination of Your Task Instruction
49
+ This task instruction will be passed to the "{{workflowName}}" workflow.
50
+ Workflow description: {{workflowDescription}}
51
+
52
+ Create the instruction in the format expected by this workflow.
53
+ {{/if}}
@@ -0,0 +1,19 @@
1
+ <!--
2
+ template: score_slug_system_prompt
3
+ role: system prompt for task name slug generation
4
+ vars: (none - task is passed as user message)
5
+ caller: infra/task/summarize
6
+ -->
7
+ You are a slug generator. Given a task description, output ONLY a slug.
8
+
9
+ NEVER output sentences. NEVER start with "this", "the", "i", "we", or "it".
10
+ ALWAYS start with a verb: add, fix, update, refactor, implement, remove, etc.
11
+
12
+ Format: verb-noun (lowercase, hyphens, max 30 chars)
13
+
14
+ Input → Output:
15
+ 認証機能を追加する → add-auth
16
+ Fix the login bug → fix-login-bug
17
+ ユーザー登録にメール認証を追加 → add-email-verification
18
+ worktreeを作るときブランチ名をAIで生成 → ai-branch-naming
19
+ レビュー画面に元の指示を表示する → show-original-instruction
@@ -0,0 +1,25 @@
1
+ <!--
2
+ template: score_summary_system_prompt
3
+ role: system prompt for conversation-to-task summarization
4
+ vars: workflowInfo, workflowName, workflowDescription, conversation
5
+ caller: features/interactive
6
+ -->
7
+ You are a task summarizer. Convert the conversation into a concrete task instruction for the planning step.
8
+
9
+ Requirements:
10
+ - Output only the final task instruction (no preamble).
11
+ - Be specific about scope and targets (files/modules) if mentioned.
12
+ - Preserve constraints and "do not" instructions.
13
+ - If details are missing, state what is missing as a short "Open Questions" section.
14
+ {{#if workflowInfo}}
15
+
16
+ ## Destination of Your Task Instruction
17
+ This task instruction will be passed to the "{{workflowName}}" workflow.
18
+ Workflow description: {{workflowDescription}}
19
+
20
+ Create the instruction in the format expected by this workflow.
21
+ {{/if}}
22
+ {{#if conversation}}
23
+
24
+ {{conversation}}
25
+ {{/if}}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Markdown template loader
3
+ *
4
+ * Loads prompt strings from Markdown template files (.md),
5
+ * applies {{variable}} substitution and {{#if}}...{{else}}...{{/if}}
6
+ * conditional blocks.
7
+ *
8
+ * Templates are organized in language subdirectories:
9
+ * {lang}/{name}.md — localized templates
10
+ */
11
+ import type { Language } from '../../core/models/types.js';
12
+ /**
13
+ * Render a template string by processing conditionals then substituting variables.
14
+ */
15
+ export declare function renderTemplate(template: string, vars: Record<string, string | boolean>): string;
16
+ /**
17
+ * Load a Markdown template, apply variable substitution and conditional blocks.
18
+ *
19
+ * @param name Template name (without extension), e.g. 'score_interactive_system_prompt'
20
+ * @param lang Language ('en' | 'ja').
21
+ * @param vars Variable values to substitute
22
+ * @returns Final prompt string
23
+ */
24
+ export declare function loadTemplate(name: string, lang: Language, vars?: Record<string, string | boolean>): string;
25
+ /** Reset cache (for tests) */
26
+ export declare function _resetCache(): void;
27
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/prompts/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AA6F3D;;GAEG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GACrC,MAAM,CAGR;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,QAAQ,EACd,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GACtC,MAAM,CAQR;AAED,8BAA8B;AAC9B,wBAAgB,WAAW,IAAI,IAAI,CAElC"}
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Markdown template loader
3
+ *
4
+ * Loads prompt strings from Markdown template files (.md),
5
+ * applies {{variable}} substitution and {{#if}}...{{else}}...{{/if}}
6
+ * conditional blocks.
7
+ *
8
+ * Templates are organized in language subdirectories:
9
+ * {lang}/{name}.md — localized templates
10
+ */
11
+ import { existsSync, readFileSync } from 'node:fs';
12
+ import { join, dirname } from 'node:path';
13
+ import { fileURLToPath } from 'node:url';
14
+ /** Cached raw template text (before variable substitution) */
15
+ const templateCache = new Map();
16
+ /**
17
+ * Resolve template file path.
18
+ *
19
+ * Loads `{lang}/{name}.md`.
20
+ * Throws if the file does not exist.
21
+ */
22
+ function resolveTemplatePath(name, lang) {
23
+ const __dirname = dirname(fileURLToPath(import.meta.url));
24
+ const localizedPath = join(__dirname, lang, `${name}.md`);
25
+ if (existsSync(localizedPath)) {
26
+ return localizedPath;
27
+ }
28
+ throw new Error(`Template not found: ${name} (lang: ${lang})`);
29
+ }
30
+ /**
31
+ * Strip HTML meta comments (<!-- ... -->) from template content.
32
+ */
33
+ function stripMetaComments(content) {
34
+ return content.replace(/<!--[\s\S]*?-->/g, '');
35
+ }
36
+ /**
37
+ * Read raw template text with caching.
38
+ */
39
+ function readTemplate(filePath) {
40
+ const cached = templateCache.get(filePath);
41
+ if (cached !== undefined)
42
+ return cached;
43
+ const raw = readFileSync(filePath, 'utf-8');
44
+ const content = stripMetaComments(raw);
45
+ templateCache.set(filePath, content);
46
+ return content;
47
+ }
48
+ /**
49
+ * Process {{#if variable}}...{{else}}...{{/if}} conditional blocks.
50
+ *
51
+ * A variable is truthy when:
52
+ * - It is a non-empty string
53
+ * - It is boolean true
54
+ *
55
+ * Nesting is NOT supported (per architecture decision).
56
+ */
57
+ function processConditionals(template, vars) {
58
+ // Pattern: {{#if varName}}...content...{{else}}...altContent...{{/if}}
59
+ // or: {{#if varName}}...content...{{/if}}
60
+ return template.replace(/\{\{#if\s+(\w+)\}\}([\s\S]*?)\{\{\/if\}\}/g, (_match, varName, body) => {
61
+ const value = vars[varName];
62
+ const isTruthy = value !== undefined && value !== false && value !== '';
63
+ const elseIndex = body.indexOf('{{else}}');
64
+ if (isTruthy) {
65
+ return elseIndex >= 0 ? body.slice(0, elseIndex) : body;
66
+ }
67
+ return elseIndex >= 0 ? body.slice(elseIndex + '{{else}}'.length) : '';
68
+ });
69
+ }
70
+ /**
71
+ * Replace {{variableName}} placeholders with values from vars.
72
+ * Undefined variables are replaced with empty string.
73
+ */
74
+ function substituteVariables(template, vars) {
75
+ return template.replace(/\{\{(\w+)\}\}/g, (_match, varName) => {
76
+ const value = vars[varName];
77
+ if (value === undefined || value === false)
78
+ return '';
79
+ if (value === true)
80
+ return 'true';
81
+ return value;
82
+ });
83
+ }
84
+ /**
85
+ * Render a template string by processing conditionals then substituting variables.
86
+ */
87
+ export function renderTemplate(template, vars) {
88
+ const afterConditionals = processConditionals(template, vars);
89
+ return substituteVariables(afterConditionals, vars);
90
+ }
91
+ /**
92
+ * Load a Markdown template, apply variable substitution and conditional blocks.
93
+ *
94
+ * @param name Template name (without extension), e.g. 'score_interactive_system_prompt'
95
+ * @param lang Language ('en' | 'ja').
96
+ * @param vars Variable values to substitute
97
+ * @returns Final prompt string
98
+ */
99
+ export function loadTemplate(name, lang, vars) {
100
+ const filePath = resolveTemplatePath(name, lang);
101
+ const raw = readTemplate(filePath);
102
+ if (vars) {
103
+ return renderTemplate(raw, vars);
104
+ }
105
+ return raw;
106
+ }
107
+ /** Reset cache (for tests) */
108
+ export function _resetCache() {
109
+ templateCache.clear();
110
+ }
111
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/shared/prompts/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,8DAA8D;AAC9D,MAAM,aAAa,GAAG,IAAI,GAAG,EAAkB,CAAC;AAEhD;;;;;GAKG;AACH,SAAS,mBAAmB,CAAC,IAAY,EAAE,IAAc;IACvD,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAE1D,MAAM,a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8BAA8B;AAC9B,MAAM,UAAU,WAAW;IACzB,aAAa,CAAC,KAAK,EAAE,CAAC;AACxB,CAAC"}
@@ -0,0 +1,7 @@
1
+ <!--
2
+ template: perform_agent_system_prompt
3
+ role: system prompt for user-defined agents
4
+ vars: agentDefinition
5
+ caller: AgentRunner
6
+ -->
7
+ {{agentDefinition}}
@@ -0,0 +1,7 @@
1
+ <!--
2
+ template: perform_builtin_agent_system_prompt
3
+ role: system prompt for builtin agents (Claude Code)
4
+ vars: agentName
5
+ caller: infra/claude/client.ts
6
+ -->
7
+ You are the {{agentName}} agent. Follow the standard {{agentName}} workflow.
@@ -0,0 +1,24 @@
1
+ <!--
2
+ template: perform_judge_message
3
+ phase: judge (AI-based rule evaluation)
4
+ vars: agentOutput, conditionList
5
+ caller: callAiJudge
6
+ -->
7
+ # 判定タスク
8
+
9
+ あなたはエージェントの出力を条件セットに対して評価する判定者です。
10
+ 以下のエージェント出力を読み、最も一致する条件を判定してください。
11
+
12
+ ## エージェント出力
13
+ ```
14
+ {{agentOutput}}
15
+ ```
16
+
17
+ ## 条件
18
+ | # | 条件 |
19
+ |---|------|
20
+ {{conditionList}}
21
+
22
+ ## 指示
23
+ 最も一致する条件の番号のタグ `[JUDGE:N]` のみを出力してください。
24
+ それ以外は出力しないでください。