wip: first run of implementation

This commit is contained in:
2026-02-25 20:29:01 +01:00
parent 2e203fa3a9
commit 20ea499a6f
40 changed files with 2170 additions and 22 deletions

View File

@@ -0,0 +1,38 @@
import { describe, expect, it } from 'vitest';
import { AgentTurnStateMachine } from '../../../../src/main/agentic/workflow/turnStateMachine';
describe('AgentTurnStateMachine', () => {
it('transitions to awaiting_input when envelope requests required input', () => {
const stateMachine = new AgentTurnStateMachine();
const next = stateMachine.transition({
previousState: 'planning',
envelope: {
intent: 'ask_input',
needsInput: {
required: true,
fields: [{ key: 'date', label: 'Date', inputType: 'date' }],
},
},
});
expect(next).toBe('awaiting_input');
});
it('transitions to completed when summarize intent has no required input', () => {
const stateMachine = new AgentTurnStateMachine();
const next = stateMachine.transition({
previousState: 'observing',
envelope: {
intent: 'summarize',
needsInput: {
required: false,
fields: [],
},
},
});
expect(next).toBe('completed');
});
});