@nt-ai-lab/deterministic-agent-workflow-cli 0.4.0 → 0.4.1
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.
|
@@ -149,7 +149,10 @@ function handleRoute(engine, engineDeps, config, args, routeName, readStdin, get
|
|
|
149
149
|
switch (routeDef.type) {
|
|
150
150
|
case 'session-start': {
|
|
151
151
|
const transcriptPath = getSessionTranscriptPath === undefined ? '' : getSessionTranscriptPath();
|
|
152
|
-
|
|
152
|
+
const repository = getSessionRepository === undefined ? '' : getSessionRepository();
|
|
153
|
+
if (repository === undefined)
|
|
154
|
+
throw new TypeError('repository must be a non-empty string.');
|
|
155
|
+
return engineResultToRunnerResult(engine.startSession(resolveSessionId(), transcriptPath, repository));
|
|
153
156
|
}
|
|
154
157
|
case 'transition':
|
|
155
158
|
return engineResultToRunnerResult(engine.transition(resolveSessionId(), config.workflowDefinition.stateSchema.parse(resolveTarget())));
|
|
@@ -191,7 +194,10 @@ function handleHook(engine, resolvedHandler, readStdin) {
|
|
|
191
194
|
exitCode: EXIT_ALLOW
|
|
192
195
|
};
|
|
193
196
|
}
|
|
194
|
-
|
|
197
|
+
const repository = getRepositoryName(common.cwd);
|
|
198
|
+
if (repository === undefined)
|
|
199
|
+
throw new TypeError('repository must be a non-empty string.');
|
|
200
|
+
return engineResultToRunnerResult(engine.startSession(common.session_id, common.transcript_path, repository));
|
|
195
201
|
}
|
|
196
202
|
if (!engine.hasSession(common.session_id))
|
|
197
203
|
return {
|
|
@@ -21,10 +21,9 @@ export function createPreToolUseHandler(config) {
|
|
|
21
21
|
if (result.type === 'blocked')
|
|
22
22
|
return result;
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return engine.checkBash(sessionId, toolName, command, config.bashForbidden);
|
|
24
|
+
if (toolName === 'Bash')
|
|
25
|
+
return engine.checkBash(sessionId, toolName, command, config.bashForbidden);
|
|
26
|
+
return engine.checkWrite(sessionId, toolName, filePath, config.isWriteAllowed);
|
|
28
27
|
};
|
|
29
28
|
}
|
|
30
29
|
function extractFilePath(toolInput) {
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
const hookCommonInputSchema = z.object({
|
|
3
|
-
session_id: z.string(),
|
|
4
|
-
transcript_path: z.string(),
|
|
5
|
-
cwd: z.string(),
|
|
3
|
+
session_id: z.string().trim().min(1),
|
|
4
|
+
transcript_path: z.string().trim().min(1),
|
|
5
|
+
cwd: z.string().trim().min(1),
|
|
6
6
|
permission_mode: z.string().optional(),
|
|
7
|
-
hook_event_name: z.string(),
|
|
7
|
+
hook_event_name: z.string().trim().min(1),
|
|
8
8
|
});
|
|
9
9
|
const preToolUseInputSchema = hookCommonInputSchema.extend({
|
|
10
|
-
tool_name: z.string(),
|
|
10
|
+
tool_name: z.string().trim().min(1),
|
|
11
11
|
tool_input: z.record(z.unknown()),
|
|
12
|
-
tool_use_id: z.string(),
|
|
12
|
+
tool_use_id: z.string().trim().min(1),
|
|
13
13
|
});
|
|
14
14
|
const subagentStartInputSchema = hookCommonInputSchema.extend({
|
|
15
|
-
agent_id: z.string(),
|
|
16
|
-
agent_type: z.string(),
|
|
15
|
+
agent_id: z.string().trim().min(1),
|
|
16
|
+
agent_type: z.string().trim().min(1),
|
|
17
17
|
});
|
|
18
18
|
const teammateIdleInputSchema = hookCommonInputSchema.extend({ teammate_name: z.string().optional(), });
|
|
19
19
|
export { hookCommonInputSchema, preToolUseInputSchema, subagentStartInputSchema, teammateIdleInputSchema, };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nt-ai-lab/deterministic-agent-workflow-cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"zod": "^3.25.76",
|
|
20
|
-
"@nt-ai-lab/deterministic-agent-workflow-engine": "0.4.
|
|
21
|
-
"@nt-ai-lab/deterministic-agent-workflow-
|
|
22
|
-
"@nt-ai-lab/deterministic-agent-workflow-
|
|
20
|
+
"@nt-ai-lab/deterministic-agent-workflow-engine": "0.4.1",
|
|
21
|
+
"@nt-ai-lab/deterministic-agent-workflow-event-store": "0.4.1",
|
|
22
|
+
"@nt-ai-lab/deterministic-agent-workflow-dsl": "0.4.1"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"vitest": "^2.1.9"
|