@nt-ai-lab/deterministic-agent-workflow-cli 0.3.4 → 0.3.6

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.
@@ -1,7 +1,7 @@
1
- import { flattenStoredEvent } from '@nt-ai-lab/deterministic-agent-workflow-engine';
1
+ import { reduceWorkflowStateFromStoredEvents } from '@nt-ai-lab/deterministic-agent-workflow-engine';
2
2
  import { buildDenialSummary, buildObservedEventTypes, buildStateDurationSummary, buildToolSummary, buildTransitionSummary, computeStatePeriods, } from './reflection-process-observations.js';
3
3
  function computeCurrentState(workflowDefinition, events) {
4
- return events.reduce((state, event) => workflowDefinition.fold(state, flattenStoredEvent(event)), workflowDefinition.initialState()).currentStateMachineState;
4
+ return reduceWorkflowStateFromStoredEvents(workflowDefinition, events).currentStateMachineState;
5
5
  }
6
6
  function buildDiscoverySources(input) {
7
7
  return [
@@ -1,4 +1,4 @@
1
- import { flattenStoredEvent, reviewPayloadSchema, } from '@nt-ai-lab/deterministic-agent-workflow-engine';
1
+ import { reduceWorkflowStateFromStoredEvents, reviewPayloadSchema, } from '@nt-ai-lab/deterministic-agent-workflow-engine';
2
2
  import { EXIT_ALLOW, EXIT_BLOCK, EXIT_ERROR, } from '../../../shell/exit-codes.js';
3
3
  function jsonResult(value) {
4
4
  return {
@@ -113,9 +113,7 @@ export function handleRecordReviewRoute(engine, engineDeps, workflowDefinition,
113
113
  });
114
114
  }
115
115
  function computeCurrentState(workflowDefinition, storedEvents) {
116
- const state = storedEvents
117
- .map(flattenStoredEvent)
118
- .reduce((currentState, event) => workflowDefinition.fold(currentState, event), workflowDefinition.initialState());
116
+ const state = reduceWorkflowStateFromStoredEvents(workflowDefinition, storedEvents);
119
117
  return state.currentStateMachineState;
120
118
  }
121
119
  function parseReviewPayload(readStdin) {
@@ -1,4 +1,4 @@
1
- import { pass, WorkflowEngine, } from '@nt-ai-lab/deterministic-agent-workflow-engine';
1
+ import { WorkflowEngine } from '@nt-ai-lab/deterministic-agent-workflow-engine';
2
2
  import { EXIT_ALLOW, EXIT_BLOCK, EXIT_ERROR } from '../../../shell/exit-codes.js';
3
3
  import { formatContextInjection, formatDenyDecision } from '../../../platform/infra/cli/presentation/hook-output.js';
4
4
  import { hookCommonInputSchema, preToolUseInputSchema, subagentStartInputSchema, teammateIdleInputSchema, } from '../../../platform/infra/external-clients/claude-hooks/hook-schemas.js';
@@ -95,7 +95,7 @@ export function createWorkflowRunner(config) {
95
95
  return handleHook(engine, resolvedHandler, options.readStdin);
96
96
  };
97
97
  }
98
- function handleWriteJournalRoute(engine, engineDeps, args, getSessionId) {
98
+ function handleWriteJournalRoute(engine, args, getSessionId) {
99
99
  const hasExplicitSessionId = getSessionId === undefined;
100
100
  const sessionId = hasExplicitSessionId ? args[1] : getSessionId();
101
101
  const agentNameIndex = hasExplicitSessionId ? 2 : 1;
@@ -108,15 +108,7 @@ function handleWriteJournalRoute(engine, engineDeps, args, getSessionId) {
108
108
  exitCode: EXIT_ERROR,
109
109
  };
110
110
  }
111
- return engineResultToRunnerResult(engine.transaction(sessionId, 'write-journal', (workflow) => {
112
- workflow.appendEvent({
113
- type: 'journal-entry',
114
- at: engineDeps.now(),
115
- agentName,
116
- content,
117
- });
118
- return pass();
119
- }));
111
+ return engineResultToRunnerResult(engine.writeJournal(sessionId, agentName, content));
120
112
  }
121
113
  function handleGetStateRoute(engine, args, getSessionId) {
122
114
  const sessionId = getSessionId === undefined ? args[1] : getSessionId();
@@ -176,7 +168,7 @@ function resolveBuiltinRoute(engine, engineDeps, config, args, routeName, readSt
176
168
  case 'record-review':
177
169
  return handleRecordReviewRoute(engine, engineDeps, config.workflowDefinition, args, readStdin, getSessionId);
178
170
  case 'write-journal':
179
- return handleWriteJournalRoute(engine, engineDeps, args, getSessionId);
171
+ return handleWriteJournalRoute(engine, args, getSessionId);
180
172
  default:
181
173
  return undefined;
182
174
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nt-ai-lab/deterministic-agent-workflow-cli",
3
- "version": "0.3.4",
3
+ "version": "0.3.6",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
@@ -12,9 +12,9 @@
12
12
  ],
13
13
  "dependencies": {
14
14
  "zod": "^3.25.76",
15
- "@nt-ai-lab/deterministic-agent-workflow-dsl": "0.3.4",
16
- "@nt-ai-lab/deterministic-agent-workflow-event-store": "0.3.4",
17
- "@nt-ai-lab/deterministic-agent-workflow-engine": "0.3.4"
15
+ "@nt-ai-lab/deterministic-agent-workflow-engine": "0.3.6",
16
+ "@nt-ai-lab/deterministic-agent-workflow-dsl": "0.3.6",
17
+ "@nt-ai-lab/deterministic-agent-workflow-event-store": "0.3.6"
18
18
  },
19
19
  "devDependencies": {
20
20
  "vitest": "^2.1.9"