Skip to content

Commit bb5ac54

Browse files
committed
refactor(signals): restructure signal handling and consolidate directives
move signal handling logic from directives to new signals module add signal manager to centralize event listeners and context update runner to use signal manager instead of directive manager move skip logic from directives to step/skip.ts update imports and references across the codebase
1 parent ed6c728 commit bb5ac54

File tree

31 files changed

+464
-621
lines changed

31 files changed

+464
-621
lines changed

src/cli/tui/app-shell.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ export function App(props: { initialToast?: InitialToast }) {
196196
const specPath = path.join(cwd, '.codemachine', 'inputs', 'specifications.md')
197197

198198
pendingWorkflowStart = () => {
199-
import("../../workflows/execution/run.js").then(({ runWorkflow }) => {
199+
import("../../workflows/run.js").then(({ runWorkflow }) => {
200200
runWorkflow({ cwd, specificationPath: specPath }).catch((error) => {
201201
// Emit error event to show toast with actual error message
202202
const errorMsg = error instanceof Error ? error.message : String(error)

src/cli/tui/routes/home/hooks/use-home-commands.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export function useHomeCommands(options: UseHomeCommandsOptions) {
6363
const specPath = getAbsoluteSpecPath()
6464

6565
try {
66-
const { validateSpecification } = await import("../../../../../workflows/execution/run.js")
66+
const { validateSpecification } = await import("../../../../../workflows/run.js")
6767
await validateSpecification(specPath)
6868
} catch (error) {
6969
if (error instanceof Error) {

src/workflows/directives/index.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,22 @@
33
*
44
* Agent-issued instructions that control workflow execution.
55
* Agents write to directive.json to issue directives.
6+
*
7+
* Supported directives:
8+
* - loop: Repeat steps
9+
* - checkpoint: Pause for user confirmation
10+
* - trigger: Execute another agent
11+
* - error: Report workflow error
12+
* - pause: Agent requests pause (different from user keypress)
13+
*
14+
* Note: skip logic moved to step/skip.ts
15+
* Note: signal manager moved to signals/manager
616
*/
717

818
export * from './types.js';
919
export * from './reader.js';
10-
export * from './skip.js';
1120
export * from './loop/index.js';
1221
export * from './trigger/index.js';
1322
export * from './checkpoint/index.js';
1423
export * from './error/index.js';
15-
export * from './manager/index.js';
1624
export * from './pause/index.js';

src/workflows/directives/manager/index.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/workflows/directives/manager/manager.ts

Lines changed: 0 additions & 164 deletions
This file was deleted.

src/workflows/directives/manager/types.ts

Lines changed: 0 additions & 93 deletions
This file was deleted.

src/workflows/directives/pause/handler.ts

Lines changed: 0 additions & 85 deletions
This file was deleted.

0 commit comments

Comments
 (0)