@vimhead.dev/norn-cli 0.1.0-tip.35436871363.1 → 0.1.0-tip.35568631545.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.
- package/assets/README.md +33 -16
- package/assets/docs/agents.md +4 -4
- package/assets/docs/cli.md +3 -3
- package/assets/docs/recovery.md +1 -1
- package/assets/docs/workflows.md +18 -11
- package/assets/examples/agent-then-analysis/plugin.ts +7 -7
- package/assets/examples/caller-selected-continuation/caller.ts +3 -3
- package/assets/examples/caller-selected-continuation/producer.ts +2 -2
- package/assets/examples/coordinating-multiple-agents/README.md +1 -1
- package/assets/examples/coordinating-multiple-agents/plugin.ts +9 -9
- package/assets/examples/getting-started/README.md +24 -9
- package/assets/examples/getting-started/plugin.ts +27 -12
- package/assets/examples/minimal-workflow/README.md +2 -2
- package/assets/examples/minimal-workflow/plugin.ts +1 -1
- package/assets/examples/shared-state/plugin.ts +5 -5
- package/assets/examples/worktree-development-loop/scope.ts +1 -1
- package/assets/examples/worktree-development-loop/workflows/development-loop/execute.ts +3 -3
- package/assets/examples/worktree-development-loop/workflows/development-loop/repository.ts +3 -3
- package/assets/examples/worktree-development-loop/workflows/implementation/execute.ts +5 -5
- package/assets/examples/worktree-development-loop/workflows/planning/execute.ts +3 -3
- package/assets/examples/worktree-development-loop/workflows/review/execute.ts +5 -5
- package/assets/examples/worktree-development-loop/workflows/review-router/execute.ts +1 -1
- package/assets/package.json +1 -1
- package/assets/packages/cli/src/generated-build-info.ts +2 -2
- package/assets/packages/cli/src/internal/engine.ts +15 -15
- package/assets/packages/cli/src/internal/{run.ts → execution-context.ts} +23 -31
- package/assets/packages/cli/src/internal/workflow-registry.ts +7 -4
- package/assets/packages/sdk/src/api.ts +43 -37
- package/assets/tests/workflow-ref.test.ts +4 -3
- package/dist/generated-build-info.d.ts +2 -2
- package/dist/generated-build-info.js +2 -2
- package/dist/internal/engine.d.ts +1 -1
- package/dist/internal/engine.js +13 -13
- package/dist/internal/{run.d.ts → execution-context.d.ts} +8 -13
- package/dist/internal/{run.js → execution-context.js} +11 -15
- package/dist/internal/workflow-registry.d.ts +2 -2
- package/dist/internal/workflow-registry.js +5 -2
- package/package.json +2 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { CreateAgentSessionOptions } from "@earendil-works/pi-coding-agent";
|
|
2
|
-
import type {
|
|
2
|
+
import type { NornAgents, NornCommands, NornLogs, NornRun } from "@vimhead.dev/norn";
|
|
3
3
|
import type { NornAgentResponseCollector } from "./agent-response-tool.ts";
|
|
4
4
|
import type { NornRunLogs } from "./logs.ts";
|
|
5
5
|
import type { NornRunLogger } from "./run-log.ts";
|
|
6
|
-
type
|
|
6
|
+
type NornExecutionContextInput = {
|
|
7
7
|
readonly id: string;
|
|
8
8
|
readonly runRoot: string;
|
|
9
9
|
readonly signal?: AbortSignal;
|
|
@@ -14,18 +14,13 @@ type DefaultNornRunInput = {
|
|
|
14
14
|
readonly logger: NornRunLogger;
|
|
15
15
|
readonly logs: NornRunLogs;
|
|
16
16
|
};
|
|
17
|
-
export declare class
|
|
17
|
+
export declare class NornExecutionContext {
|
|
18
18
|
private readonly input;
|
|
19
|
-
readonly
|
|
20
|
-
readonly
|
|
21
|
-
readonly
|
|
22
|
-
readonly
|
|
23
|
-
constructor(input:
|
|
19
|
+
readonly run: NornRun;
|
|
20
|
+
readonly logs: NornLogs;
|
|
21
|
+
readonly commands: NornCommands;
|
|
22
|
+
readonly agents: NornAgents;
|
|
23
|
+
constructor(input: NornExecutionContextInput);
|
|
24
24
|
private createAgentRunner;
|
|
25
|
-
next(workflowId: string, args: unknown): ReturnType<NornRun["next"]>;
|
|
26
|
-
complete(metadata?: NornRunOutcomeMetadata): ReturnType<NornRun["complete"]>;
|
|
27
|
-
fail(metadata: NornRunOutcomeMetadata & {
|
|
28
|
-
readonly summary: string;
|
|
29
|
-
}): ReturnType<NornRun["fail"]>;
|
|
30
25
|
}
|
|
31
26
|
export {};
|
|
@@ -4,13 +4,18 @@ function createWorkflowTransition(input) {
|
|
|
4
4
|
return { type: "next", workflowId: input.workflowId, args: input.args };
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
// src/internal/
|
|
7
|
+
// src/internal/execution-context.ts
|
|
8
8
|
import { NornAgentRunner } from "./agents.js";
|
|
9
9
|
import { NornCommandRunner } from "./commands.js";
|
|
10
|
-
var
|
|
10
|
+
var NornExecutionContext = class {
|
|
11
11
|
constructor(input) {
|
|
12
12
|
this.input = input;
|
|
13
|
-
this.
|
|
13
|
+
this.run = {
|
|
14
|
+
id: input.id,
|
|
15
|
+
next: (workflowId, args) => createWorkflowTransition({ workflowId, args }),
|
|
16
|
+
complete: (metadata) => ({ type: "complete", metadata }),
|
|
17
|
+
fail: (metadata) => ({ type: "fail", metadata })
|
|
18
|
+
};
|
|
14
19
|
this.logs = {
|
|
15
20
|
read: (log) => this.input.logs.read(log)
|
|
16
21
|
};
|
|
@@ -27,13 +32,13 @@ var NornRunContext = class {
|
|
|
27
32
|
};
|
|
28
33
|
}
|
|
29
34
|
input;
|
|
35
|
+
run;
|
|
30
36
|
logs;
|
|
31
37
|
commands;
|
|
32
38
|
agents;
|
|
33
|
-
id;
|
|
34
39
|
createAgentRunner() {
|
|
35
40
|
return new NornAgentRunner({
|
|
36
|
-
id: this.id,
|
|
41
|
+
id: this.input.id,
|
|
37
42
|
runRoot: this.input.runRoot,
|
|
38
43
|
signal: this.input.signal,
|
|
39
44
|
model: this.input.model,
|
|
@@ -44,16 +49,7 @@ var NornRunContext = class {
|
|
|
44
49
|
responseCollector: this.input.responseCollector
|
|
45
50
|
});
|
|
46
51
|
}
|
|
47
|
-
next(workflowId, args) {
|
|
48
|
-
return createWorkflowTransition({ workflowId, args });
|
|
49
|
-
}
|
|
50
|
-
complete(metadata) {
|
|
51
|
-
return { type: "complete", metadata };
|
|
52
|
-
}
|
|
53
|
-
fail(metadata) {
|
|
54
|
-
return { type: "fail", metadata };
|
|
55
|
-
}
|
|
56
52
|
};
|
|
57
53
|
export {
|
|
58
|
-
|
|
54
|
+
NornExecutionContext
|
|
59
55
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type NornAnyWorkflowDeclaration, type NornDispose, type NornInspectedWorkflowInfo, type NornRegisteredWorkflowInfo, type NornRunComplete, type NornRunFail, type
|
|
1
|
+
import { type NornAnyWorkflowDeclaration, type NornDispose, type NornInspectedWorkflowInfo, type NornRegisteredWorkflowInfo, type NornRunComplete, type NornRunFail, type NornRunNext, type NornWorkflowPaths, type NornWorkflowContext, type NornWorkflowSource, type NornProjectConfigurationInfo } from "@vimhead.dev/norn";
|
|
2
2
|
import type { TSchema } from "typebox";
|
|
3
3
|
export type NornRegisteredConfiguration = {
|
|
4
4
|
readonly key: string;
|
|
@@ -28,7 +28,7 @@ export type NornWorkflowStepResult = NornRunNext | {
|
|
|
28
28
|
readonly metadata: NornRunFail["metadata"];
|
|
29
29
|
};
|
|
30
30
|
type NornExecutionContextInput = {
|
|
31
|
-
readonly
|
|
31
|
+
readonly execution: Pick<NornWorkflowContext, "run" | "agents" | "commands" | "logs">;
|
|
32
32
|
readonly paths: NornWorkflowPaths;
|
|
33
33
|
readonly args: unknown;
|
|
34
34
|
readonly configOverride: unknown;
|
|
@@ -100,14 +100,17 @@ var NornWorkflowRegistry = class {
|
|
|
100
100
|
throw new Error(`Workflow returned invalid control result: ${workflow.id}`);
|
|
101
101
|
}
|
|
102
102
|
createExecutionContext(input) {
|
|
103
|
-
const { entry,
|
|
103
|
+
const { entry, execution, paths, configOverride } = input;
|
|
104
104
|
const scope = entry.scopeId ? this.scopes.get(entry.scopeId) : void 0;
|
|
105
105
|
return {
|
|
106
106
|
args: Value.Decode(entry.workflow.args, input.args),
|
|
107
107
|
config: parseExecutionConfig(entry.configuration, configOverride),
|
|
108
108
|
...scope ? { scope: { id: scope.definition.id, config: parseExecutionConfig(scope.configuration, configOverride) } } : {},
|
|
109
109
|
paths,
|
|
110
|
-
run
|
|
110
|
+
run: execution.run,
|
|
111
|
+
agents: execution.agents,
|
|
112
|
+
commands: execution.commands,
|
|
113
|
+
logs: execution.logs
|
|
111
114
|
};
|
|
112
115
|
}
|
|
113
116
|
requireEntry(id) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vimhead.dev/norn-cli",
|
|
3
|
-
"version": "0.1.0-tip.
|
|
3
|
+
"version": "0.1.0-tip.35568631545.1",
|
|
4
4
|
"description": "Harness-agnostic runtime for agent-driven and code-driven workflows, built primarily for agents.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@earendil-works/pi-coding-agent": "0.85.1",
|
|
44
44
|
"jiti": "^2.7.0",
|
|
45
45
|
"typebox": "^1.3.34",
|
|
46
|
-
"@vimhead.dev/norn": "0.1.0-tip.
|
|
46
|
+
"@vimhead.dev/norn": "0.1.0-tip.35568631545.1"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"build": "node ../../scripts/build-package.ts"
|