@vimhead.dev/norn-cli 0.1.0-tip.0
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/README.md +13 -0
- package/assets/README.md +157 -0
- package/assets/docs/README.md +23 -0
- package/assets/docs/agents.md +64 -0
- package/assets/docs/cli.md +183 -0
- package/assets/docs/composition.md +76 -0
- package/assets/docs/persistence.md +56 -0
- package/assets/docs/projects.md +75 -0
- package/assets/docs/recovery.md +56 -0
- package/assets/docs/resources.md +61 -0
- package/assets/docs/workflows.md +57 -0
- package/assets/examples/agent-then-analysis/README.md +103 -0
- package/assets/examples/agent-then-analysis/input.json +5 -0
- package/assets/examples/agent-then-analysis/norn.project.json +4 -0
- package/assets/examples/agent-then-analysis/plugin.ts +89 -0
- package/assets/examples/coordinating-multiple-agents/README.md +56 -0
- package/assets/examples/coordinating-multiple-agents/input.json +10 -0
- package/assets/examples/coordinating-multiple-agents/norn.project.json +4 -0
- package/assets/examples/coordinating-multiple-agents/plugin.ts +102 -0
- package/assets/examples/coordinating-multiple-agents/queue-adapter.ts +52 -0
- package/assets/examples/coordinating-multiple-agents/work-queue.ts +153 -0
- package/assets/examples/minimal-workflow/README.md +71 -0
- package/assets/examples/minimal-workflow/norn.project.json +4 -0
- package/assets/examples/minimal-workflow/plugin.ts +29 -0
- package/assets/examples/shared-state/README.md +19 -0
- package/assets/examples/shared-state/input.json +1 -0
- package/assets/examples/shared-state/norn.project.json +4 -0
- package/assets/examples/shared-state/plugin.ts +47 -0
- package/assets/examples/worktree-development-loop/README.md +66 -0
- package/assets/examples/worktree-development-loop/index.ts +1 -0
- package/assets/examples/worktree-development-loop/manifest.ts +26 -0
- package/assets/examples/worktree-development-loop/norn.project.json +9 -0
- package/assets/examples/worktree-development-loop/plugin.ts +27 -0
- package/assets/examples/worktree-development-loop/shared/commands.ts +6 -0
- package/assets/examples/worktree-development-loop/state.ts +23 -0
- package/assets/examples/worktree-development-loop/workflows/development-loop/declaration.ts +8 -0
- package/assets/examples/worktree-development-loop/workflows/development-loop/execute.ts +18 -0
- package/assets/examples/worktree-development-loop/workflows/development-loop/index.ts +4 -0
- package/assets/examples/worktree-development-loop/workflows/development-loop/repository.ts +22 -0
- package/assets/examples/worktree-development-loop/workflows/development-loop/schema.ts +14 -0
- package/assets/examples/worktree-development-loop/workflows/implementation/declaration.ts +8 -0
- package/assets/examples/worktree-development-loop/workflows/implementation/execute.ts +54 -0
- package/assets/examples/worktree-development-loop/workflows/implementation/index.ts +3 -0
- package/assets/examples/worktree-development-loop/workflows/implementation/schema.ts +12 -0
- package/assets/examples/worktree-development-loop/workflows/planning/declaration.ts +8 -0
- package/assets/examples/worktree-development-loop/workflows/planning/execute.ts +28 -0
- package/assets/examples/worktree-development-loop/workflows/planning/index.ts +3 -0
- package/assets/examples/worktree-development-loop/workflows/planning/schema.ts +12 -0
- package/assets/examples/worktree-development-loop/workflows/review/declaration.ts +8 -0
- package/assets/examples/worktree-development-loop/workflows/review/execute.ts +53 -0
- package/assets/examples/worktree-development-loop/workflows/review/index.ts +10 -0
- package/assets/examples/worktree-development-loop/workflows/review/schema.ts +23 -0
- package/assets/examples/worktree-development-loop/workflows/review-router/declaration.ts +12 -0
- package/assets/examples/worktree-development-loop/workflows/review-router/execute.ts +51 -0
- package/assets/examples/worktree-development-loop/workflows/review-router/index.ts +3 -0
- package/assets/examples/worktree-development-loop/workflows/review-router/schema.ts +12 -0
- package/assets/package.json +1 -0
- package/assets/packages/cli/src/build-info.ts +36 -0
- package/assets/packages/cli/src/bun/cli.ts +16 -0
- package/assets/packages/cli/src/cli.ts +1135 -0
- package/assets/packages/cli/src/client.ts +167 -0
- package/assets/packages/cli/src/documentation-intro.ts +30 -0
- package/assets/packages/cli/src/documentation.ts +149 -0
- package/assets/packages/cli/src/generated-build-info.ts +12 -0
- package/assets/packages/cli/src/internal/agent-directory.ts +5 -0
- package/assets/packages/cli/src/internal/agent-response-tool.ts +96 -0
- package/assets/packages/cli/src/internal/agents.ts +365 -0
- package/assets/packages/cli/src/internal/artifacts.ts +26 -0
- package/assets/packages/cli/src/internal/commands.ts +180 -0
- package/assets/packages/cli/src/internal/documentation-bundle.ts +49 -0
- package/assets/packages/cli/src/internal/engine.ts +501 -0
- package/assets/packages/cli/src/internal/errors.ts +39 -0
- package/assets/packages/cli/src/internal/file-names.ts +3 -0
- package/assets/packages/cli/src/internal/launch-request.ts +94 -0
- package/assets/packages/cli/src/internal/logs.ts +41 -0
- package/assets/packages/cli/src/internal/metrics.ts +356 -0
- package/assets/packages/cli/src/internal/pi-assets.ts +95 -0
- package/assets/packages/cli/src/internal/resource-bindings.ts +35 -0
- package/assets/packages/cli/src/internal/run-lease.ts +158 -0
- package/assets/packages/cli/src/internal/run-log.ts +59 -0
- package/assets/packages/cli/src/internal/run-names.ts +36 -0
- package/assets/packages/cli/src/internal/run-resources.ts +23 -0
- package/assets/packages/cli/src/internal/run-state.ts +380 -0
- package/assets/packages/cli/src/internal/run-store.ts +323 -0
- package/assets/packages/cli/src/internal/run.ts +133 -0
- package/assets/packages/cli/src/internal/state-store.ts +75 -0
- package/assets/packages/cli/src/internal/usage.ts +70 -0
- package/assets/packages/cli/src/internal/workflow-registry.ts +176 -0
- package/assets/packages/cli/src/plugin-loader.ts +412 -0
- package/assets/packages/cli/src/resources.ts +67 -0
- package/assets/packages/core/src/agent-protocol.ts +1 -0
- package/assets/packages/core/src/atomic-files.ts +24 -0
- package/assets/packages/core/src/errors.ts +3 -0
- package/assets/packages/sdk/src/agent-resource-adapter.ts +11 -0
- package/assets/packages/sdk/src/api.ts +821 -0
- package/assets/packages/sdk/src/files.ts +136 -0
- package/assets/packages/sdk/src/index.ts +6 -0
- package/assets/packages/sdk/src/resources.ts +20 -0
- package/assets/packages/sdk/src/schema.ts +48 -0
- package/assets/packages/sdk/src/seer/config.ts +62 -0
- package/assets/packages/sdk/src/seer/index.ts +7 -0
- package/assets/packages/sdk/src/state-adapter.ts +75 -0
- package/assets/setup/providers.md +128 -0
- package/assets/setup/releases.md +76 -0
- package/assets/tests/workflow-ref.test.ts +113 -0
- package/bin/norn.mjs +10 -0
- package/dist/build-info.d.ts +30 -0
- package/dist/build-info.js +6 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +1032 -0
- package/dist/client.d.ts +48 -0
- package/dist/client.js +118 -0
- package/dist/documentation-intro.d.ts +5 -0
- package/dist/documentation-intro.js +29 -0
- package/dist/documentation.d.ts +33 -0
- package/dist/documentation.js +132 -0
- package/dist/generated-build-info.d.ts +10 -0
- package/dist/generated-build-info.js +14 -0
- package/dist/internal/agent-directory.d.ts +4 -0
- package/dist/internal/agent-directory.js +8 -0
- package/dist/internal/agent-response-tool.d.ts +21 -0
- package/dist/internal/agent-response-tool.js +79 -0
- package/dist/internal/agents.d.ts +29 -0
- package/dist/internal/agents.js +336 -0
- package/dist/internal/artifacts.d.ts +10 -0
- package/dist/internal/artifacts.js +29 -0
- package/dist/internal/commands.d.ts +18 -0
- package/dist/internal/commands.js +147 -0
- package/dist/internal/documentation-bundle.d.ts +16 -0
- package/dist/internal/documentation-bundle.js +42 -0
- package/dist/internal/engine.d.ts +44 -0
- package/dist/internal/engine.js +399 -0
- package/dist/internal/errors.d.ts +14 -0
- package/dist/internal/errors.js +38 -0
- package/dist/internal/file-names.d.ts +1 -0
- package/dist/internal/file-names.js +7 -0
- package/dist/internal/launch-request.d.ts +33 -0
- package/dist/internal/launch-request.js +110 -0
- package/dist/internal/logs.d.ts +16 -0
- package/dist/internal/logs.js +38 -0
- package/dist/internal/metrics.d.ts +19 -0
- package/dist/internal/metrics.js +282 -0
- package/dist/internal/pi-assets.d.ts +13 -0
- package/dist/internal/pi-assets.js +94 -0
- package/dist/internal/resource-bindings.d.ts +13 -0
- package/dist/internal/resource-bindings.js +34 -0
- package/dist/internal/run-lease.d.ts +32 -0
- package/dist/internal/run-lease.js +166 -0
- package/dist/internal/run-log.d.ts +30 -0
- package/dist/internal/run-log.js +71 -0
- package/dist/internal/run-names.d.ts +1 -0
- package/dist/internal/run-names.js +144 -0
- package/dist/internal/run-resources.d.ts +6 -0
- package/dist/internal/run-resources.js +26 -0
- package/dist/internal/run-state.d.ts +95 -0
- package/dist/internal/run-state.js +323 -0
- package/dist/internal/run-store.d.ts +35 -0
- package/dist/internal/run-store.js +314 -0
- package/dist/internal/run.d.ts +51 -0
- package/dist/internal/run.js +101 -0
- package/dist/internal/state-store.d.ts +22 -0
- package/dist/internal/state-store.js +97 -0
- package/dist/internal/usage.d.ts +5 -0
- package/dist/internal/usage.js +70 -0
- package/dist/internal/workflow-registry.d.ts +35 -0
- package/dist/internal/workflow-registry.js +129 -0
- package/dist/plugin-loader.d.ts +55 -0
- package/dist/plugin-loader.js +353 -0
- package/dist/resources.d.ts +11 -0
- package/dist/resources.js +98 -0
- package/package.json +52 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
export const implementationParamsSchema = z.object({
|
|
4
|
+
task: z.string(),
|
|
5
|
+
iteration: z.number().int().min(1),
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export const implementationAgentResponseSchema = z.object({
|
|
9
|
+
summary: z.string(),
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export type ImplementationParams = z.output<typeof implementationParamsSchema>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { NornWorkflowDefinition } from "@vimhead.dev/norn";
|
|
2
|
+
import { planningParamsSchema } from "./schema.ts";
|
|
3
|
+
|
|
4
|
+
export const planningWorkflow = {
|
|
5
|
+
isEntrypoint: false,
|
|
6
|
+
instructions: "Create an implementation plan for a repository task.",
|
|
7
|
+
params: planningParamsSchema,
|
|
8
|
+
} as const satisfies NornWorkflowDefinition;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { NornRunNext, NornRun } from "@vimhead.dev/norn";
|
|
2
|
+
import { worktreeDevelopmentLoopManifest } from "../../manifest.ts";
|
|
3
|
+
import { planningAgentResponseSchema, type PlanningParams } from "./schema.ts";
|
|
4
|
+
|
|
5
|
+
export async function executePlanningWorkflow(run: NornRun, params: PlanningParams): Promise<NornRunNext> {
|
|
6
|
+
const repositoryPath = await run.state.get(worktreeDevelopmentLoopManifest.states.developmentLoop.repositoryPath);
|
|
7
|
+
const planning = await run.agents.prompt({
|
|
8
|
+
label: "planning",
|
|
9
|
+
cwd: repositoryPath,
|
|
10
|
+
tools: ["read", "grep", "find", "ls"],
|
|
11
|
+
prompt: buildPlanningPrompt(params.task),
|
|
12
|
+
response: planningAgentResponseSchema,
|
|
13
|
+
});
|
|
14
|
+
const planArtifact = await run.artifacts.write("planning/plan.md", planning.plan);
|
|
15
|
+
await run.state.set(worktreeDevelopmentLoopManifest.states.planning.planArtifact, planArtifact);
|
|
16
|
+
return run.next(worktreeDevelopmentLoopManifest.workflows.implementation, { task: params.task, iteration: 1 });
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function buildPlanningPrompt(task: string): string {
|
|
20
|
+
return [
|
|
21
|
+
"Create a concise implementation plan for this repository task.",
|
|
22
|
+
"Do not modify files in this step.",
|
|
23
|
+
"Include assumptions, planned edits, and checks in the plan.",
|
|
24
|
+
"",
|
|
25
|
+
"Task:",
|
|
26
|
+
task,
|
|
27
|
+
].join("\n");
|
|
28
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
export const planningParamsSchema = z.object({
|
|
4
|
+
task: z.string(),
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
export const planningAgentResponseSchema = z.object({
|
|
8
|
+
plan: z.string(),
|
|
9
|
+
summary: z.string(),
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export type PlanningParams = z.output<typeof planningParamsSchema>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { NornWorkflowDefinition } from "@vimhead.dev/norn";
|
|
2
|
+
import { reviewParamsSchema } from "./schema.ts";
|
|
3
|
+
|
|
4
|
+
export const reviewWorkflow = {
|
|
5
|
+
isEntrypoint: false,
|
|
6
|
+
instructions: "Review the current repository boundary changes.",
|
|
7
|
+
params: reviewParamsSchema,
|
|
8
|
+
} as const satisfies NornWorkflowDefinition;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { NornRunNext, NornRun } from "@vimhead.dev/norn";
|
|
2
|
+
import { worktreeDevelopmentLoopManifest } from "../../manifest.ts";
|
|
3
|
+
import { ensureCommandSucceeded } from "../../shared/commands.ts";
|
|
4
|
+
import { reviewAgentResponseSchema, type ReviewParams } from "./schema.ts";
|
|
5
|
+
|
|
6
|
+
export async function executeReviewWorkflow(run: NornRun, params: ReviewParams): Promise<NornRunNext> {
|
|
7
|
+
const repositoryPath = await run.state.get(worktreeDevelopmentLoopManifest.states.developmentLoop.repositoryPath);
|
|
8
|
+
const planArtifact = await run.state.get(worktreeDevelopmentLoopManifest.states.planning.planArtifact);
|
|
9
|
+
const implementationSummary = await run.state.get(worktreeDevelopmentLoopManifest.states.implementation.implementationSummary);
|
|
10
|
+
const plan = await run.artifacts.read(planArtifact);
|
|
11
|
+
const diff = await run.commands.run({
|
|
12
|
+
label: `review-${params.iteration}-diff`,
|
|
13
|
+
cwd: repositoryPath,
|
|
14
|
+
command: "git status --short && git diff --stat HEAD -- . && git diff HEAD -- .",
|
|
15
|
+
});
|
|
16
|
+
await ensureCommandSucceeded(diff);
|
|
17
|
+
const diffOutput = await run.logs.read(diff.stdoutLog);
|
|
18
|
+
await run.artifacts.write(`review/iteration-${params.iteration}-diff.txt`, diffOutput);
|
|
19
|
+
const review = await run.agents.prompt({
|
|
20
|
+
label: `review-${params.iteration}`,
|
|
21
|
+
cwd: repositoryPath,
|
|
22
|
+
tools: ["read", "grep", "find", "ls", "bash"],
|
|
23
|
+
prompt: buildReviewPrompt(params.task, plan, implementationSummary, diffOutput),
|
|
24
|
+
response: reviewAgentResponseSchema,
|
|
25
|
+
});
|
|
26
|
+
const automatedReviewArtifact = await run.artifacts.write(`review/iteration-${params.iteration}-automated.json`, JSON.stringify(review, null, 2));
|
|
27
|
+
return run.next(worktreeDevelopmentLoopManifest.workflows.reviewRouter, {
|
|
28
|
+
iteration: params.iteration,
|
|
29
|
+
decision: review.decision,
|
|
30
|
+
summary: review.summary,
|
|
31
|
+
automatedReviewArtifact,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function buildReviewPrompt(task: string, plan: string, implementationSummary: string, diff: string): string {
|
|
36
|
+
return [
|
|
37
|
+
"Review the current repository changes against the task and plan.",
|
|
38
|
+
"Use accept only when the work is ready. Use revise for fixable issues. Use blocked when manual input is needed. Include review details in the summary.",
|
|
39
|
+
"",
|
|
40
|
+
"Task:",
|
|
41
|
+
task,
|
|
42
|
+
"",
|
|
43
|
+
"Plan:",
|
|
44
|
+
plan,
|
|
45
|
+
"",
|
|
46
|
+
"Implementation summary:",
|
|
47
|
+
implementationSummary,
|
|
48
|
+
"",
|
|
49
|
+
"Diff:",
|
|
50
|
+
diff.slice(0, 40_000),
|
|
51
|
+
].join("\n");
|
|
52
|
+
}
|
|
53
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { reviewWorkflow } from "./declaration.ts";
|
|
2
|
+
export { executeReviewWorkflow } from "./execute.ts";
|
|
3
|
+
export {
|
|
4
|
+
reviewAgentResponseSchema,
|
|
5
|
+
reviewDecisionSchema,
|
|
6
|
+
reviewParamsSchema,
|
|
7
|
+
storedReviewSchema,
|
|
8
|
+
type ReviewParams,
|
|
9
|
+
type StoredReview,
|
|
10
|
+
} from "./schema.ts";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { artifactRefSchema } from "@vimhead.dev/norn";
|
|
3
|
+
|
|
4
|
+
export const reviewDecisionSchema = z.enum(["accept", "revise", "blocked"]);
|
|
5
|
+
|
|
6
|
+
export const reviewParamsSchema = z.object({
|
|
7
|
+
task: z.string(),
|
|
8
|
+
iteration: z.number().int().min(1),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export const reviewAgentResponseSchema = z.object({
|
|
12
|
+
decision: reviewDecisionSchema,
|
|
13
|
+
summary: z.string(),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const storedReviewSchema = z.object({
|
|
17
|
+
decision: reviewDecisionSchema,
|
|
18
|
+
summary: z.string(),
|
|
19
|
+
reviewArtifact: artifactRefSchema,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export type ReviewParams = z.output<typeof reviewParamsSchema>;
|
|
23
|
+
export type StoredReview = z.output<typeof storedReviewSchema>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { NornWorkflowDefinition } from "@vimhead.dev/norn";
|
|
2
|
+
import { reviewRouterParamsSchema } from "./schema.ts";
|
|
3
|
+
|
|
4
|
+
export const reviewRouterWorkflow = {
|
|
5
|
+
isEntrypoint: false,
|
|
6
|
+
instructions: "Route implementation and review iterations based on the latest review decision.",
|
|
7
|
+
gate: {
|
|
8
|
+
enabled: true,
|
|
9
|
+
fields: ["decision", "summary"] as const,
|
|
10
|
+
},
|
|
11
|
+
params: reviewRouterParamsSchema,
|
|
12
|
+
} as const satisfies NornWorkflowDefinition;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { NornWorkflowExecutionResult, NornRun } from "@vimhead.dev/norn";
|
|
2
|
+
import { worktreeDevelopmentLoopManifest } from "../../manifest.ts";
|
|
3
|
+
import type { StoredReview } from "../review/schema.ts";
|
|
4
|
+
import type { ReviewRouterParams } from "./schema.ts";
|
|
5
|
+
|
|
6
|
+
export async function executeReviewRouterWorkflow(
|
|
7
|
+
run: NornRun,
|
|
8
|
+
params: ReviewRouterParams,
|
|
9
|
+
): Promise<NornWorkflowExecutionResult> {
|
|
10
|
+
const repositoryPath = await run.state.get(worktreeDevelopmentLoopManifest.states.developmentLoop.repositoryPath);
|
|
11
|
+
const planArtifact = await run.state.get(worktreeDevelopmentLoopManifest.states.planning.planArtifact);
|
|
12
|
+
const currentIteration = await run.state.get(worktreeDevelopmentLoopManifest.states.developmentLoop.currentIteration);
|
|
13
|
+
const maxIterations = await run.state.get(worktreeDevelopmentLoopManifest.states.developmentLoop.maxIterations);
|
|
14
|
+
const task = await run.state.get(worktreeDevelopmentLoopManifest.states.developmentLoop.task);
|
|
15
|
+
const reviewArtifact = await run.artifacts.write(
|
|
16
|
+
`review/iteration-${params.iteration}-decision.json`,
|
|
17
|
+
JSON.stringify({ decision: params.decision, summary: params.summary, automatedReviewArtifact: params.automatedReviewArtifact }, null, 2),
|
|
18
|
+
);
|
|
19
|
+
const lastReview: StoredReview = { decision: params.decision, summary: params.summary, reviewArtifact };
|
|
20
|
+
|
|
21
|
+
await run.state.set(worktreeDevelopmentLoopManifest.states.review.reviewDecision, params.decision);
|
|
22
|
+
await run.state.set(worktreeDevelopmentLoopManifest.states.review.reviewArtifact, reviewArtifact);
|
|
23
|
+
|
|
24
|
+
if (params.decision === "accept") {
|
|
25
|
+
return run.complete({
|
|
26
|
+
summary: `Implementation accepted after ${currentIteration} iteration(s).`,
|
|
27
|
+
artifacts: { plan: planArtifact, review: reviewArtifact },
|
|
28
|
+
data: { status: "done", repositoryPath, iterations: currentIteration, lastReview },
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (params.decision === "blocked") {
|
|
33
|
+
return run.fail({
|
|
34
|
+
summary: params.summary,
|
|
35
|
+
artifacts: { plan: planArtifact, review: reviewArtifact },
|
|
36
|
+
data: { status: "blocked", repositoryPath, iterations: currentIteration, lastReview },
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (currentIteration >= maxIterations) {
|
|
41
|
+
return run.fail({
|
|
42
|
+
summary: `Maximum iteration count reached after ${currentIteration} iteration(s).`,
|
|
43
|
+
artifacts: { plan: planArtifact, review: reviewArtifact },
|
|
44
|
+
data: { status: "needs-attention", repositoryPath, iterations: currentIteration, lastReview },
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const nextIteration = currentIteration + 1;
|
|
49
|
+
await run.state.set(worktreeDevelopmentLoopManifest.states.developmentLoop.currentIteration, nextIteration);
|
|
50
|
+
return run.next(worktreeDevelopmentLoopManifest.workflows.implementation, { task, iteration: nextIteration });
|
|
51
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { artifactRefSchema } from "@vimhead.dev/norn";
|
|
3
|
+
import { reviewDecisionSchema } from "../review/schema.ts";
|
|
4
|
+
|
|
5
|
+
export const reviewRouterParamsSchema = z.object({
|
|
6
|
+
iteration: z.number().int().min(1),
|
|
7
|
+
decision: reviewDecisionSchema,
|
|
8
|
+
summary: z.string(),
|
|
9
|
+
automatedReviewArtifact: artifactRefSchema,
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export type ReviewRouterParams = z.output<typeof reviewRouterParamsSchema>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":"0.1.0-tip.0"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { NORN_GENERATED_BUILD_INFO } from "./generated-build-info.ts";
|
|
2
|
+
|
|
3
|
+
export type NornBuildInfo = NornUnknownBuildInfo | NornNpmRegistryBuildInfo | NornGithubReleaseBinaryBuildInfo;
|
|
4
|
+
|
|
5
|
+
export type NornUnknownBuildInfo = {
|
|
6
|
+
readonly kind: "unknown";
|
|
7
|
+
readonly version: string;
|
|
8
|
+
readonly commit: string | null;
|
|
9
|
+
readonly upgrade: {
|
|
10
|
+
readonly supported: false;
|
|
11
|
+
readonly reason: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type NornNpmRegistryBuildInfo = {
|
|
16
|
+
readonly kind: "npm-registry";
|
|
17
|
+
readonly version: string;
|
|
18
|
+
readonly commit: string | null;
|
|
19
|
+
readonly packageSpec: string;
|
|
20
|
+
readonly upgrade: {
|
|
21
|
+
readonly supported: false;
|
|
22
|
+
readonly reason: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export type NornGithubReleaseBinaryBuildInfo = {
|
|
27
|
+
readonly kind: "github-release-binary";
|
|
28
|
+
readonly version: string;
|
|
29
|
+
readonly commit: string | null;
|
|
30
|
+
readonly repository: string;
|
|
31
|
+
readonly releaseTag: string;
|
|
32
|
+
readonly assetName: string;
|
|
33
|
+
readonly checksumAssetName: string;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const NORN_BUILD_INFO: NornBuildInfo = NORN_GENERATED_BUILD_INFO;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
import { resolveNornAgentDirectory } from "../internal/agent-directory.ts";
|
|
4
|
+
import { materializePiAssets, resolvePiAssetsCacheRoot } from "../internal/pi-assets.ts";
|
|
5
|
+
import { piAssetArchive, registerBunOAuthFlows } from "./pi-assets.generated.ts";
|
|
6
|
+
import { documentationAssets } from "./documentation-assets.generated.ts";
|
|
7
|
+
|
|
8
|
+
process.env.NORN_AGENT_DIR = resolveNornAgentDirectory({ home: homedir(), environment: process.env });
|
|
9
|
+
process.env.PI_CODING_AGENT_DIR = process.env.NORN_AGENT_DIR;
|
|
10
|
+
process.env.PI_PACKAGE_DIR = await materializePiAssets({
|
|
11
|
+
archive: piAssetArchive,
|
|
12
|
+
cacheRoot: resolvePiAssetsCacheRoot({ platform: process.platform, home: homedir(), environment: process.env }),
|
|
13
|
+
});
|
|
14
|
+
registerBunOAuthFlows();
|
|
15
|
+
const { main } = await import("../cli.ts");
|
|
16
|
+
await main(process.argv.slice(2), { kind: "embedded", bundle: documentationAssets });
|