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
@@ -4,22 +4,15 @@
4
4
  * Resumes the agent session and asks it to evaluate its work
5
5
  * and output the appropriate status tag. No tools are allowed.
6
6
  *
7
- * Includes:
8
- * - Header instruction (review and determine status)
9
- * - Status rules (criteria table + output format)
7
+ * Renders a single complete template combining the judgment header
8
+ * and status rules (criteria table + output format).
10
9
  */
11
- import { generateStatusRulesFromRules } from './status-rules.js';
12
- /** Localized strings for status judgment phase */
13
- const STATUS_JUDGMENT_STRINGS = {
14
- en: {
15
- header: 'Review your work results and determine the status. Do NOT perform any additional work.',
16
- },
17
- ja: {
18
- header: '作業結果を振り返り、ステータスを判定してください。追加の作業は行わないでください。',
19
- },
20
- };
10
+ import { generateStatusRulesComponents } from './status-rules.js';
11
+ import { loadTemplate } from '../../../shared/prompts/index.js';
21
12
  /**
22
13
  * Builds Phase 3 (status judgment) instructions.
14
+ *
15
+ * Renders a single complete template with all variables.
23
16
  */
24
17
  export class StatusJudgmentBuilder {
25
18
  step;
@@ -30,17 +23,16 @@ export class StatusJudgmentBuilder {
30
23
  }
31
24
  build() {
32
25
  if (!this.step.rules || this.step.rules.length === 0) {
33
- throw new Error(`StatusJudgmentBuilder called for step "${this.step.name}" which has no rules`);
26
+ throw new Error(`StatusJudgmentBuilder called for movement "${this.step.name}" which has no rules`);
34
27
  }
35
28
  const language = this.context.language ?? 'en';
36
- const s = STATUS_JUDGMENT_STRINGS[language];
37
- const sections = [];
38
- // Header
39
- sections.push(s.header);
40
- // Status rules (criteria table + output format)
41
- const generatedPrompt = generateStatusRulesFromRules(this.step.name, this.step.rules, language, { interactive: this.context.interactive });
42
- sections.push(generatedPrompt);
43
- return sections.join('\n\n');
29
+ const components = generateStatusRulesComponents(this.step.name, this.step.rules, language, { interactive: this.context.interactive });
30
+ return loadTemplate('perform_phase3_message', language, {
31
+ criteriaTable: components.criteriaTable,
32
+ outputList: components.outputList,
33
+ hasAppendix: components.hasAppendix,
34
+ appendixContent: components.appendixContent,
35
+ });
44
36
  }
45
37
  }
46
38
  //# sourceMappingURL=StatusJudgmentBuilder.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StatusJudgmentBuilder.js","sourceRoot":"","sources":["../../../../src/core/workflow/instruction/StatusJudgmentBuilder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAC;AAEjE,kDAAkD;AAClD,MAAM,uBAAuB,GAAG;IAC9B,EAAE,EAAE;QACF,MAAM,EAAE,wFAAwF;KACjG;IACD,EAAE,EAAE;QACF,MAAM,EAAE,2CAA2C;KACpD;CACO,CAAC;AAYX;;GAEG;AACH,MAAM,OAAO,qBAAqB;IAEb;IACA;IAFnB,YACmB,IAAkB,EAClB,OAA8B;QAD9B,SAAI,GAAJ,IAAI,CAAc;QAClB,YAAO,GAAP,OAAO,CAAuB;IAC9C,CAAC;IAEJ,KAAK;QACH,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACrD,MAAM,IAAI,KAAK,CAAC,0CAA0C,IAAI,CAAC,IAAI,CAAC,IAAI,sBAAsB,CAAC,CAAC;QAClG,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,IAAI,CAAC;QAC/C,MAAM,CAAC,GAAG,uBAAuB,CAAC,QAAQ,CAAC,CAAC;QAC5C,MAAM,QAAQ,GAAa,EAAE,CAAC;QAE9B,SAAS;QACT,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QAExB,gDAAgD;QAChD,MAAM,eAAe,GAAG,4BAA4B,CAClD,IAAI,CAAC,IAAI,CAAC,IAAI,EACd,IAAI,CA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CAAC,UAAU;YACjC,WAAW,EAAE,UAAU,CAAC,WAAW;YACnC,eAAe,EAAE,UAAU,CAAC,eAAe;SAC5C,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Used by instruction builders to process instruction_template content.
5
5
  */
6
- import type { WorkflowStep } from '../../models/types.js';
6
+ import type { WorkflowMovement } from '../../models/types.js';
7
7
  import type { InstructionContext } from './instruction-context.js';
8
8
  /**
9
9
  * Escape special characters in dynamic content to prevent template injection.
@@ -13,7 +13,7 @@ export declare function escapeTemplateChars(str: string): string;
13
13
  * Replace template placeholders in the instruction_template body.
14
14
  *
15
15
  * These placeholders may still be used in instruction_template for
16
- * backward compatibility or special cases.
16
+ * special cases or legacy templates.
17
17
  */
18
- export declare function replaceTemplatePlaceholders(template: string, step: WorkflowStep, context: InstructionContext): string;
18
+ export declare function replaceTemplatePlaceholders(template: string, step: WorkflowMovement, context: InstructionContext): string;
19
19
  //# sourceMappingURL=escape.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"escape.d.ts","sourceRoot":"","sources":["../../../../src/core/workflow/instruction/escape.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnE;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE,kBAAkB,GAC1B,MAAM,CA2CR"}
1
+ {"version":3,"file":"escape.d.ts","sourceRoot":"","sources":["../../../../src/core/workflow/instruction/escape.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnE;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,gBAAgB,EACtB,OAAO,EAAE,kBAAkB,GAC1B,MAAM,CA2CR"}
@@ -13,16 +13,16 @@ export function escapeTemplateChars(str) {
13
13
  * Replace template placeholders in the instruction_template body.
14
14
  *
15
15
  * These placeholders may still be used in instruction_template for
16
- * backward compatibility or special cases.
16
+ * special cases or legacy templates.
17
17
  */
18
18
  export function replaceTemplatePlaceholders(template, step, context) {
19
19
  let result = template;
20
20
  // Replace {task}
21
21
  result = result.replace(/\{task\}/g, escapeTemplateChars(context.task));
22
- // Replace {iteration}, {max_iterations}, and {step_iteration}
22
+ // Replace {iteration}, {max_iterations}, and {movement_iteration}
23
23
  result = result.replace(/\{iteration\}/g, String(context.iteration));
24
24
  result = result.replace(/\{max_iterations\}/g, String(context.maxIterations));
25
- result = result.replace(/\{step_iteration\}/g, String(context.stepIteration));
25
+ result = result.replace(/\{movement_iteration\}/g, String(context.movementIteration));
26
26
  // Replace {previous_response}
27
27
  if (step.passPreviousResponse) {
28
28
  if (context.previousOutput) {
@@ -1 +1 @@
1
- {"version":3,"file":"escape.js","sourceRoot":"","sources":["../../../../src/core/workflow/instruction/escape.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAW;IAC7C,OAAO,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACrD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B,CACzC,QAAgB,EAChB,IAAkB,EAClB,OAA2B;IAE3B,IAAI,MAAM,GAAG,QAAQ,CAA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,OAAO,CAAC,CACpD,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,wBAAwB,EAAE,EAAE,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IAED,wBAAwB;IACxB,MAAM,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpD,MAAM,GAAG,MAAM,CAAC,OAAO,CACrB,kBAAkB,EAClB,mBAAmB,CAAC,aAAa,CAAC,CACnC,CAAC;IAEF,uBAAuB;IACvB,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;QACtB,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAChE,CAAC;IAED,oDAAoD;IACpD,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;QACtB,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC,MAAM,EAAE,QAAgB,EAAE,EAAE;YAC1E,OAAO,GAAG,OAAO,CAAC,SAAS,IAAI,QAAQ,EAAE,CAAC;QAC5C,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -1,8 +1,7 @@
1
1
  /**
2
- * Instruction context types and execution metadata rendering
2
+ * Instruction context types and edit rule generation
3
3
  *
4
- * Defines the context structures used by instruction builders,
5
- * and renders execution metadata (working directory, rules) as markdown.
4
+ * Defines the context structures used by instruction builders.
6
5
  */
7
6
  import type { AgentResponse, Language } from '../../models/types.js';
8
7
  /**
@@ -15,15 +14,15 @@ export interface InstructionContext {
15
14
  iteration: number;
16
15
  /** Maximum iterations allowed */
17
16
  maxIterations: number;
18
- /** Current step's iteration number (how many times this step has been executed) */
19
- stepIteration: number;
17
+ /** Current movement's iteration number (how many times this movement has been executed) */
18
+ movementIteration: number;
20
19
  /** Working directory (agent work dir, may be a clone) */
21
20
  cwd: string;
22
21
  /** Project root directory (where .takt/ lives). */
23
22
  projectCwd: string;
24
23
  /** User inputs accumulated during workflow */
25
24
  userInputs: string[];
26
- /** Previous step output if available */
25
+ /** Previous movement output if available */
27
26
  previousOutput?: AgentResponse;
28
27
  /** Report directory path */
29
28
  reportDir?: string;
@@ -31,51 +30,19 @@ export interface InstructionContext {
31
30
  language?: Language;
32
31
  /** Whether interactive-only rules are enabled */
33
32
  interactive?: boolean;
33
+ /** Top-level workflow movements for workflow structure display */
34
+ workflowMovements?: ReadonlyArray<{
35
+ name: string;
36
+ description?: string;
37
+ }>;
38
+ /** Index of the current movement in workflowMovements (0-based) */
39
+ currentMovementIndex?: number;
34
40
  }
35
- /** Execution environment metadata prepended to agent instructions */
36
- export interface ExecutionMetadata {
37
- /** The agent's working directory (may be a clone) */
38
- readonly workingDirectory: string;
39
- /** Language for metadata rendering */
40
- readonly language: Language;
41
- /** Whether file editing is allowed for this step (undefined = no prompt) */
42
- readonly edit?: boolean;
43
- }
44
- /**
45
- * Build execution metadata from instruction context and step config.
46
- *
47
- * Pure function: (InstructionContext, edit?) → ExecutionMetadata.
48
- */
49
- export declare function buildExecutionMetadata(context: InstructionContext, edit?: boolean): ExecutionMetadata;
50
- /** Localized strings for execution metadata rendering */
51
- export declare const METADATA_STRINGS: {
52
- readonly en: {
53
- readonly heading: "## Execution Context";
54
- readonly workingDirectory: "Working Directory";
55
- readonly rulesHeading: "## Execution Rules";
56
- readonly noCommit: "**Do NOT run git commit.** Commits are handled automatically by the system after workflow completion.";
57
- readonly noCd: "**Do NOT use `cd` in Bash commands.** Your working directory is already set correctly. Run commands directly without changing directories.";
58
- readonly editEnabled: "**Editing is ENABLED for this step.** You may create, modify, and delete files as needed to fulfill the user's request.";
59
- readonly editDisabled: "**Editing is DISABLED for this step.** Do NOT create, modify, or delete any project source files. You may only read and search code. Report output will be handled automatically in a later phase.";
60
- readonly note: "Note: This section is metadata. Follow the language used in the rest of the prompt.";
61
- };
62
- readonly ja: {
63
- readonly heading: "## 実行コンテキスト";
64
- readonly workingDirectory: "作業ディレクトリ";
65
- readonly rulesHeading: "## 実行ルール";
66
- readonly noCommit: "**git commit を実行しないでください。** コミットはワークフロー完了後にシステムが自動で行います。";
67
- readonly noCd: "**Bashコマンドで `cd` を使用しないでください。** 作業ディレクトリは既に正しく設定されています。ディレクトリを変更せずにコマンドを実行してください。";
68
- readonly editEnabled: "**このステップでは編集が許可されています。** ユーザーの要求に応じて、ファイルの作成・変更・削除を行ってください。";
69
- readonly editDisabled: "**このステップでは編集が禁止されています。** プロジェクトのソースファイルを作成・変更・削除しないでください。コードの読み取り・検索のみ行ってください。レポート出力は後のフェーズで自動的に行われます。";
70
- readonly note: "";
71
- };
72
- };
73
41
  /**
74
- * Render execution metadata as a markdown string.
42
+ * Build the edit rule string for the execution context section.
75
43
  *
76
- * Pure function: ExecutionMetadata string.
77
- * Always includes heading + Working Directory + Execution Rules.
78
- * Language determines the output language; 'en' includes a note about language consistency.
44
+ * Returns a localized string describing the edit permission for this movement.
45
+ * Returns empty string when edit is undefined (no explicit permission).
79
46
  */
80
- export declare function renderExecutionMetadata(metadata: ExecutionMetadata): string;
47
+ export declare function buildEditRule(edit: boolean | undefined, language: Language): string;
81
48
  //# sourceMappingURL=instruction-context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"instruction-context.d.ts","sourceRoot":"","sources":["../../../../src/core/workflow/instruction/instruction-context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,0DAA0D;IAC1D,SAAS,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,mFAAmF;IACnF,aAAa,EAAE,MAAM,CAAC;IACtB,yDAAyD;IACzD,GAAG,EAAE,MAAM,CAAC;IACZ,mDAAmD;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,8CAA8C;IAC9C,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,wCAAwC;IACxC,cAAc,CAAC,EAAE,aAAa,CAAC;IAC/B,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,iDAAiD;IACjD,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,qEAAqE;AACrE,MAAM,WAAW,iBAAiB;IAChC,qDAAqD;IACrD,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,sCAAsC;IACtC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,4EAA4E;IAC5E,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,kBAAkB,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,iBAAiB,CAMrG;AAED,yDAAyD;AACzD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;CAqBnB,CAAC;AAEX;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,MAAM,CAqB3E"}
1
+ {"version":3,"file":"instruction-context.d.ts","sourceRoot":"","sources":["../../../../src/core/workflow/instruction/instruction-context.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,0DAA0D;IAC1D,SAAS,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,2FAA2F;IAC3F,iBAAiB,EAAE,MAAM,CAAC;IAC1B,yDAAyD;IACzD,GAAG,EAAE,MAAM,CAAC;IACZ,mDAAmD;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,8CAA8C;IAC9C,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,4CAA4C;IAC5C,cAAc,CAAC,EAAE,aAAa,CAAC;IAC/B,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,iDAAiD;IACjD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kEAAkE;IAClE,iBAAiB,CAAC,EAAE,aAAa,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC1E,mEAAmE;IACnE,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,EAAE,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAcnF"}
@@ -1,72 +1,27 @@
1
1
  /**
2
- * Instruction context types and execution metadata rendering
2
+ * Instruction context types and edit rule generation
3
3
  *
4
- * Defines the context structures used by instruction builders,
5
- * and renders execution metadata (working directory, rules) as markdown.
4
+ * Defines the context structures used by instruction builders.
6
5
  */
7
6
  /**
8
- * Build execution metadata from instruction context and step config.
7
+ * Build the edit rule string for the execution context section.
9
8
  *
10
- * Pure function: (InstructionContext, edit?) ExecutionMetadata.
9
+ * Returns a localized string describing the edit permission for this movement.
10
+ * Returns empty string when edit is undefined (no explicit permission).
11
11
  */
12
- export function buildExecutionMetadata(context, edit) {
13
- return {
14
- workingDirectory: context.cwd,
15
- language: context.language ?? 'en',
16
- edit,
17
- };
18
- }
19
- /** Localized strings for execution metadata rendering */
20
- export const METADATA_STRINGS = {
21
- en: {
22
- heading: '## Execution Context',
23
- workingDirectory: 'Working Directory',
24
- rulesHeading: '## Execution Rules',
25
- noCommit: '**Do NOT run git commit.** Commits are handled automatically by the system after workflow completion.',
26
- noCd: '**Do NOT use `cd` in Bash commands.** Your working directory is already set correctly. Run commands directly without changing directories.',
27
- editEnabled: '**Editing is ENABLED for this step.** You may create, modify, and delete files as needed to fulfill the user\'s request.',
28
- editDisabled: '**Editing is DISABLED for this step.** Do NOT create, modify, or delete any project source files. You may only read and search code. Report output will be handled automatically in a later phase.',
29
- note: 'Note: This section is metadata. Follow the language used in the rest of the prompt.',
30
- },
31
- ja: {
32
- heading: '## 実行コンテキスト',
33
- workingDirectory: '作業ディレクトリ',
34
- rulesHeading: '## 実行ルール',
35
- noCommit: '**git commit を実行しないでください。** コミットはワークフロー完了後にシステムが自動で行います。',
36
- noCd: '**Bashコマンドで `cd` を使用しないでください。** 作業ディレクトリは既に正しく設定されています。ディレクトリを変更せずにコマンドを実行してください。',
37
- editEnabled: '**このステップでは編集が許可されています。** ユーザーの要求に応じて、ファイルの作成・変更・削除を行ってください。',
38
- editDisabled: '**このステップでは編集が禁止されています。** プロジェクトのソースファイルを作成・変更・削除しないでください。コードの読み取り・検索のみ行ってください。レポート出力は後のフェーズで自動的に行われます。',
39
- note: '',
40
- },
41
- };
42
- /**
43
- * Render execution metadata as a markdown string.
44
- *
45
- * Pure function: ExecutionMetadata → string.
46
- * Always includes heading + Working Directory + Execution Rules.
47
- * Language determines the output language; 'en' includes a note about language consistency.
48
- */
49
- export function renderExecutionMetadata(metadata) {
50
- const strings = METADATA_STRINGS[metadata.language];
51
- const lines = [
52
- strings.heading,
53
- `- ${strings.workingDirectory}: ${metadata.workingDirectory}`,
54
- '',
55
- strings.rulesHeading,
56
- `- ${strings.noCommit}`,
57
- `- ${strings.noCd}`,
58
- ];
59
- if (metadata.edit === true) {
60
- lines.push(`- ${strings.editEnabled}`);
61
- }
62
- else if (metadata.edit === false) {
63
- lines.push(`- ${strings.editDisabled}`);
12
+ export function buildEditRule(edit, language) {
13
+ if (edit === true) {
14
+ if (language === 'ja') {
15
+ return '**このムーブメントでは編集が許可されています。** ユーザーの要求に応じて、ファイルの作成・変更・削除を行ってください。';
16
+ }
17
+ return '**Editing is ENABLED for this movement.** You may create, modify, and delete files as needed to fulfill the user\'s request.';
64
18
  }
65
- if (strings.note) {
66
- lines.push('');
67
- lines.push(strings.note);
19
+ if (edit === false) {
20
+ if (language === 'ja') {
21
+ return '**このムーブメントでは編集が禁止されています。** プロジェクトのソースファイルを作成・変更・削除しないでください。コードの読み取り・検索のみ行ってください。レポート出力は後のフェーズで自動的に行われます。';
22
+ }
23
+ return '**Editing is DISABLED for this movement.** Do NOT create, modify, or delete any project source files. You may only read and search code. Report output will be handled automatically in a later phase.';
68
24
  }
69
- lines.push('');
70
- return lines.join('\n');
25
+ return '';
71
26
  }
72
27
  //# sourceMappingURL=instruction-context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"instruction-context.js","sourceRoot":"","sources":["../../../../src/core/workflow/instruction/instruction-context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA0CH;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAA2B,EAAE,IAAc;IAChF,OAAO;QACL,gBAAgB,EAAE,OAAO,CAAC,GAAG;QAC7B,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,IAAI;QAClC,IAAI;KACL,CAAC;AACJ,CAAC;AAED,yDAAyD;AACzD,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,EAAE,EAAE;QACF,OAAO,EAAE,sBAAsB;QAC/B,gBAAgB,EAAE,mBAAmB;QACrC,YAAY,EAAE,oBAAoB;QAClC,QAAQ,EAAE,uGAAuG;QACjH,IAAI,EAAE,4IAA4I;QAClJ,WAAW,EAAE,0HAA0H;QACvI,YAAY,EAAE,oMAAoM;QAClN,IAAI,EAAE,qFAAqF;KAC5F;IACD,EAAE,EAAE;QACF,OAAO,EAAE,aAAa;QACtB,gBAAgB,EAAE,UAAU;QAC5B,YAAY,EAAE,UAAU;QACxB,QAAQ,EAAE,0DAA0D;QACpE,IAAI,EAAE,mFAAmF;QACzF,WAAW,EAAE,6DAA6D;QAC1E,YAAY,EAAE,wGAAwG;QACtH,IAAI,EAAE,EAAE;KACT;CACO,CAAC;AAEX;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CAAC,QAA2B;IACjE,MAAM,OAAO,GAAG,gBAAgB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACpD,MAAM,KAAK,GAAG;QACZ,OAAO,CAAC,OAAO;QACf,KAAK,OAAO,CAAC,gBAAgB,KAAK,QAAQ,CAAC,gBAAgB,EAAE;QAC7D,EAAE;QACF,OAAO,CAAC,YAAY;QACpB,KAAK,OAAO,CAAC,QAAQ,EAAE;QACvB,KAAK,OAAO,CAAC,IAAI,EAAE;KACpB,CAAC;IACF,IAAI,QAAQ,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,KAAK,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IACzC,CAAC;SAAM,IAAI,QAAQ,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;QACnC,KAAK,CAAC,IAAI,CAAC,KAAK,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IAC1C,CAAC;IACD,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
1
+ {"version":3,"file":"instruction-context.js","sourceRoot":"","sources":["../../../../src/core/workflow/instruction/instruction-context.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAoCH;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,IAAyB,EAAE,QAAkB;IACzE,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAClB,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;YACtB,OAAO,+DAA+D,CAAC;QACzE,CAAC;QACD,OAAO,8HAA8H,CAAC;IACxI,CAAC;IACD,IAAI,IAAI,KAAK,KAAK,EAAE,CAAC;QACnB,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;YACtB,OAAO,0GAA0G,CAAC;QACpH,CAAC;QACD,OAAO,wMAAwM,CAAC;IAClN,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC"}
@@ -1,23 +1,28 @@
1
1
  /**
2
- * Status rules prompt generation for workflow steps
2
+ * Status rules prompt generation for workflow movements
3
3
  *
4
- * Generates structured prompts that tell agents which numbered tags to output
5
- * based on the step's rule configuration.
4
+ * Generates structured status rules content that tells agents which
5
+ * numbered tags to output based on the movement's rule configuration.
6
+ *
7
+ * Returns individual components (criteriaTable, outputList, appendix)
8
+ * that are passed as template variables to Phase 1/Phase 3 templates.
6
9
  */
7
10
  import type { WorkflowRule, Language } from '../../models/types.js';
11
+ /** Components of the generated status rules */
12
+ export interface StatusRulesComponents {
13
+ criteriaTable: string;
14
+ outputList: string;
15
+ hasAppendix: boolean;
16
+ appendixContent: string;
17
+ }
8
18
  /**
9
- * Generate status rules prompt from rules configuration.
10
- * Creates a structured prompt that tells the agent which numbered tags to output.
19
+ * Generate status rules components from rules configuration.
11
20
  *
12
- * Example output for step "plan" with 3 rules:
13
- * ## 判定基準
14
- * | # | 状況 | タグ |
15
- * |---|------|------|
16
- * | 1 | 要件が明確で実装可能 | `[PLAN:1]` |
17
- * | 2 | ユーザーが質問をしている | `[PLAN:2]` |
18
- * | 3 | 要件が不明確、情報不足 | `[PLAN:3]` |
21
+ * Loop expansion (criteria table rows, output list items, appendix blocks)
22
+ * is done in code and returned as individual string components.
23
+ * These are passed as template variables to the Phase 1/Phase 3 templates.
19
24
  */
20
- export declare function generateStatusRulesFromRules(stepName: string, rules: WorkflowRule[], language: Language, options?: {
25
+ export declare function generateStatusRulesComponents(movementName: string, rules: WorkflowRule[], language: Language, options?: {
21
26
  interactive?: boolean;
22
- }): string;
27
+ }): StatusRulesComponents;
23
28
  //# sourceMappingURL=status-rules.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"status-rules.d.ts","sourceRoot":"","sources":["../../../../src/core/workflow/instruction/status-rules.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AA0BpE;;;;;;;;;;;GAWG;AACH,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,YAAY,EAAE,EACrB,QAAQ,EAAE,QAAQ,EAClB,OAAO,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,GAClC,MAAM,CA8CR"}
1
+ {"version":3,"file":"status-rules.d.ts","sourceRoot":"","sources":["../../../../src/core/workflow/instruction/status-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEpE,+CAA+C;AAC/C,MAAM,WAAW,qBAAqB;IACpC,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAC3C,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,YAAY,EAAE,EACrB,QAAQ,EAAE,QAAQ,EAClB,OAAO,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,GAClC,qBAAqB,CA2DvB"}
@@ -1,85 +1,66 @@
1
1
  /**
2
- * Status rules prompt generation for workflow steps
2
+ * Status rules prompt generation for workflow movements
3
3
  *
4
- * Generates structured prompts that tell agents which numbered tags to output
5
- * based on the step's rule configuration.
4
+ * Generates structured status rules content that tells agents which
5
+ * numbered tags to output based on the movement's rule configuration.
6
+ *
7
+ * Returns individual components (criteriaTable, outputList, appendix)
8
+ * that are passed as template variables to Phase 1/Phase 3 templates.
6
9
  */
7
- /** Localized strings for rules-based status prompt */
8
- const RULES_PROMPT_STRINGS = {
9
- en: {
10
- criteriaHeading: '## Decision Criteria',
11
- headerNum: '#',
12
- headerCondition: 'Condition',
13
- headerTag: 'Tag',
14
- outputHeading: '## Output Format',
15
- outputInstruction: 'Output the tag corresponding to your decision:',
16
- appendixHeading: '### Appendix Template',
17
- appendixInstruction: 'When outputting `[{tag}]`, append the following:',
18
- },
19
- ja: {
20
- criteriaHeading: '## 判定基準',
21
- headerNum: '#',
22
- headerCondition: '状況',
23
- headerTag: 'タグ',
24
- outputHeading: '## 出力フォーマット',
25
- outputInstruction: '判定に対応するタグを出力してください:',
26
- appendixHeading: '### 追加出力テンプレート',
27
- appendixInstruction: '`[{tag}]` を出力する場合、以下を追記してください:',
28
- },
29
- };
30
10
  /**
31
- * Generate status rules prompt from rules configuration.
32
- * Creates a structured prompt that tells the agent which numbered tags to output.
11
+ * Generate status rules components from rules configuration.
33
12
  *
34
- * Example output for step "plan" with 3 rules:
35
- * ## 判定基準
36
- * | # | 状況 | タグ |
37
- * |---|------|------|
38
- * | 1 | 要件が明確で実装可能 | `[PLAN:1]` |
39
- * | 2 | ユーザーが質問をしている | `[PLAN:2]` |
40
- * | 3 | 要件が不明確、情報不足 | `[PLAN:3]` |
13
+ * Loop expansion (criteria table rows, output list items, appendix blocks)
14
+ * is done in code and returned as individual string components.
15
+ * These are passed as template variables to the Phase 1/Phase 3 templates.
41
16
  */
42
- export function generateStatusRulesFromRules(stepName, rules, language, options) {
43
- const tag = stepName.toUpperCase();
44
- const strings = RULES_PROMPT_STRINGS[language];
17
+ export function generateStatusRulesComponents(movementName, rules, language, options) {
18
+ const tag = movementName.toUpperCase();
45
19
  const interactiveEnabled = options?.interactive;
46
20
  const visibleRules = rules
47
21
  .map((rule, index) => ({ rule, index }))
48
22
  .filter(({ rule }) => interactiveEnabled !== false || !rule.interactiveOnly);
49
- const lines = [];
50
- // Criteria table
51
- lines.push(strings.criteriaHeading);
52
- lines.push('');
53
- lines.push(`| ${strings.headerNum} | ${strings.headerCondition} | ${strings.headerTag} |`);
54
- lines.push('|---|------|------|');
55
- for (const { rule, index } of visibleRules) {
56
- lines.push(`| ${index + 1} | ${rule.condition} | \`[${tag}:${index + 1}]\` |`);
57
- }
58
- lines.push('');
59
- // Output format
60
- lines.push(strings.outputHeading);
61
- lines.push('');
62
- lines.push(strings.outputInstruction);
63
- lines.push('');
64
- for (const { rule, index } of visibleRules) {
65
- lines.push(`- \`[${tag}:${index + 1}]\` — ${rule.condition}`);
66
- }
67
- // Appendix templates (if any rules have appendix)
23
+ // Build criteria table rows
24
+ const headerNum = '#';
25
+ const headerCondition = language === 'ja' ? '状況' : 'Condition';
26
+ const headerTag = language === 'ja' ? 'タグ' : 'Tag';
27
+ const tableLines = [
28
+ `| ${headerNum} | ${headerCondition} | ${headerTag} |`,
29
+ '|---|------|------|',
30
+ ...visibleRules.map(({ rule, index }) => `| ${index + 1} | ${rule.condition} | \`[${tag}:${index + 1}]\` |`),
31
+ ];
32
+ const criteriaTable = tableLines.join('\n');
33
+ // Build output list
34
+ const outputInstruction = language === 'ja'
35
+ ? '判定に対応するタグを出力してください:'
36
+ : 'Output the tag corresponding to your decision:';
37
+ const outputLines = [
38
+ outputInstruction,
39
+ '',
40
+ ...visibleRules.map(({ rule, index }) => `- \`[${tag}:${index + 1}]\` — ${rule.condition}`),
41
+ ];
42
+ const outputList = outputLines.join('\n');
43
+ // Build appendix content
68
44
  const rulesWithAppendix = visibleRules.filter(({ rule }) => rule.appendix);
69
- if (rulesWithAppendix.length > 0) {
70
- lines.push('');
71
- lines.push(strings.appendixHeading);
45
+ const hasAppendix = rulesWithAppendix.length > 0;
46
+ let appendixContent = '';
47
+ if (hasAppendix) {
48
+ const appendixInstructionTemplate = language === 'ja'
49
+ ? '`[{tag}]` を出力する場合、以下を追記してください:'
50
+ : 'When outputting `[{tag}]`, append the following:';
51
+ const appendixBlocks = [];
72
52
  for (const { rule, index } of visibleRules) {
73
53
  if (!rule.appendix)
74
54
  continue;
75
55
  const tagStr = `[${tag}:${index + 1}]`;
76
- lines.push('');
77
- lines.push(strings.appendixInstruction.replace('{tag}', tagStr));
78
- lines.push('```');
79
- lines.push(rule.appendix.trimEnd());
80
- lines.push('```');
56
+ appendixBlocks.push('');
57
+ appendixBlocks.push(appendixInstructionTemplate.replace('{tag}', tagStr));
58
+ appendixBlocks.push('```');
59
+ appendixBlocks.push(rule.appendix.trimEnd());
60
+ appendixBlocks.push('```');
81
61
  }
62
+ appendixContent = appendixBlocks.join('\n');
82
63
  }
83
- return lines.join('\n');
64
+ return { criteriaTable, outputList, hasAppendix, appendixContent };
84
65
  }
85
66
  //# sourceMappingURL=status-rules.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"status-rules.js","sourceRoot":"","sources":["../../../../src/core/workflow/instruction/status-rules.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,sDAAsD;AACtD,MAAM,oBAAoB,GAAG;IAC3B,EAAE,EAAE;QACF,eAAe,EAAE,sBAAsB;QACvC,SAAS,EAAE,GAAG;QACd,eAAe,EAAE,WAAW;QAC5B,SAAS,EAAE,KAAK;QAChB,aAAa,EAAE,kBAAkB;QACjC,iBAAiB,EAAE,gDAAgD;QACnE,eAAe,EAAE,uBAAuB;QACxC,mBAAmB,EAAE,kDAAkD;KACxE;IACD,EAAE,EAAE;QACF,eAAe,EAAE,SAAS;QAC1B,SAAS,EAAE,GAAG;QACd,eAAe,EAAE,IAAI;QACrB,SAAS,EAAE,IAAI;QACf,aAAa,EAAE,aAAa;QAC5B,iBAAiB,EAAE,qBAAqB;QACxC,eAAe,EAAE,gBAAgB;QACjC,mBAAmB,EAAE,gCAAgC;KACtD;CACO,CAAC;AAEX;;;;;;;;;;;GAWG;AACH,MAAM,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AK,CAAC,CAAC;QAC7B,CAAC;QACD,eAAe,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC;IAED,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC;AACrE,CAAC"}
@@ -4,7 +4,8 @@
4
4
  * Handles Phase 2 (report output) and Phase 3 (status judgment)
5
5
  * as session-resume operations.
6
6
  */
7
- import type { WorkflowStep, Language } from '../models/types.js';
7
+ import type { WorkflowMovement, Language } from '../models/types.js';
8
+ import type { PhaseName } from './types.js';
8
9
  import { type RunAgentOptions } from '../../agents/runner.js';
9
10
  export interface PhaseRunnerContext {
10
11
  /** Working directory (agent work dir, may be a clone) */
@@ -17,26 +18,31 @@ export interface PhaseRunnerContext {
17
18
  interactive?: boolean;
18
19
  /** Get agent session ID */
19
20
  getSessionId: (agent: string) => string | undefined;
20
- /** Build resume options for a step */
21
- buildResumeOptions: (step: WorkflowStep, sessionId: string, overrides: Pick<RunAgentOptions, 'allowedTools' | 'maxTurns'>) => RunAgentOptions;
21
+ /** Build resume options for a movement */
22
+ buildResumeOptions: (step: WorkflowMovement, sessionId: string, overrides: Pick<RunAgentOptions, 'allowedTools' | 'maxTurns'>) => RunAgentOptions;
22
23
  /** Update agent session after a phase run */
23
24
  updateAgentSession: (agent: string, sessionId: string | undefined) => void;
25
+ /** Callback for phase lifecycle logging */
26
+ onPhaseStart?: (step: WorkflowMovement, phase: 1 | 2 | 3, phaseName: PhaseName, instruction: string) => void;
27
+ /** Callback for phase completion logging */
28
+ onPhaseComplete?: (step: WorkflowMovement, phase: 1 | 2 | 3, phaseName: PhaseName, content: string, status: string, error?: string) => void;
24
29
  }
25
30
  /**
26
- * Check if a step needs Phase 3 (status judgment).
31
+ * Check if a movement needs Phase 3 (status judgment).
27
32
  * Returns true when at least one rule requires tag-based detection.
28
33
  */
29
- export declare function needsStatusJudgmentPhase(step: WorkflowStep): boolean;
34
+ export declare function needsStatusJudgmentPhase(step: WorkflowMovement): boolean;
30
35
  /**
31
36
  * Phase 2: Report output.
32
37
  * Resumes the agent session with no tools to request report content.
33
- * The engine writes the report files to the Report Directory.
38
+ * Each report file is generated individually in a loop.
39
+ * Plain text responses are written directly to files (no JSON parsing).
34
40
  */
35
- export declare function runReportPhase(step: WorkflowStep, stepIteration: number, ctx: PhaseRunnerContext): Promise<void>;
41
+ export declare function runReportPhase(step: WorkflowMovement, movementIteration: number, ctx: PhaseRunnerContext): Promise<void>;
36
42
  /**
37
43
  * Phase 3: Status judgment.
38
44
  * Resumes the agent session with no tools to ask the agent to output a status tag.
39
45
  * Returns the Phase 3 response content (containing the status tag).
40
46
  */
41
- export declare function runStatusJudgmentPhase(step: WorkflowStep, ctx: PhaseRunnerContext): Promise<string>;
47
+ export declare function runStatusJudgmentPhase(step: WorkflowMovement, ctx: PhaseRunnerContext): Promise<string>;
42
48
  //# sourceMappingURL=phase-runner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"phase-runner.d.ts","sourceRoot":"","sources":["../../../src/core/workflow/phase-runner.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAY,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AASxE,MAAM,WAAW,kBAAkB;IACjC,yDAAyD;IACzD,GAAG,EAAE,MAAM,CAAC;IACZ,4BAA4B;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,iDAAiD;IACjD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,2BAA2B;IAC3B,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IACpD,sCAAsC;IACtC,kBAAkB,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EA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