@slopus/beer 0.1.2 → 0.1.4
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/dist/_workflows/_index.d.ts +1 -1
- package/dist/_workflows/_index.js +7 -7
- package/dist/_workflows/bootstrap.d.ts +1 -1
- package/dist/_workflows/bootstrap.js +14 -14
- package/dist/_workflows/checkpointWorkflow.d.ts +1 -1
- package/dist/_workflows/checkpointWorkflow.js +2 -2
- package/dist/_workflows/context/context.d.ts +2 -2
- package/dist/_workflows/context/context.js +11 -11
- package/dist/_workflows/context/context.spec.js +1 -1
- package/dist/_workflows/context/utils/contextApplyConfig.d.ts +1 -1
- package/dist/_workflows/context/utils/contextApplyConfig.js +1 -1
- package/dist/_workflows/context/utils/contextApplyConfig.spec.js +1 -1
- package/dist/_workflows/context/utils/contextAskGithubRepo.d.ts +1 -1
- package/dist/_workflows/context/utils/contextAskGithubRepo.js +3 -3
- package/dist/_workflows/context/utils/contextAskGithubRepo.spec.js +1 -1
- package/dist/_workflows/context/utils/contextGitignoreEnsure.spec.js +1 -1
- package/dist/_workflows/context/utils/progressMultilineStart.spec.js +1 -1
- package/dist/_workflows/planWorkflow.d.ts +1 -1
- package/dist/_workflows/planWorkflow.js +9 -9
- package/dist/_workflows/ralphLoopWorkflow.d.ts +1 -1
- package/dist/_workflows/ralphLoopWorkflow.js +5 -5
- package/dist/_workflows/ralphWorkflow.d.ts +1 -1
- package/dist/_workflows/ralphWorkflow.js +5 -5
- package/dist/_workflows/researchWorkflow.d.ts +1 -1
- package/dist/_workflows/researchWorkflow.js +3 -3
- package/dist/_workflows/steps/generate.d.ts +2 -2
- package/dist/_workflows/steps/generate.js +3 -3
- package/dist/_workflows/steps/generateCommit.d.ts +1 -1
- package/dist/_workflows/steps/generateCommit.js +2 -2
- package/dist/_workflows/steps/generateDocument.d.ts +2 -2
- package/dist/_workflows/steps/generateDocument.js +3 -3
- package/dist/_workflows/steps/generateFrontmatter.d.ts +2 -2
- package/dist/_workflows/steps/generateFrontmatter.js +1 -1
- package/dist/_workflows/steps/generateProgressMessageResolve.d.ts +1 -1
- package/dist/_workflows/steps/generateReadme.d.ts +1 -1
- package/dist/_workflows/steps/generateReadme.js +2 -2
- package/dist/_workflows/steps/ralphExecute.d.ts +1 -1
- package/dist/_workflows/steps/ralphExecute.js +2 -2
- package/dist/_workflows/steps/ralphLoopExecute.d.ts +1 -1
- package/dist/_workflows/steps/ralphLoopExecute.js +2 -2
- package/dist/_workflows/steps/ralphLoopPlanGenerate.d.ts +1 -1
- package/dist/_workflows/steps/ralphLoopPlanGenerate.js +3 -3
- package/dist/_workflows/steps/ralphLoopPlanPathResolve.d.ts +1 -1
- package/dist/_workflows/steps/ralphLoopReviewRound.d.ts +1 -1
- package/dist/_workflows/steps/ralphLoopReviewRound.js +2 -2
- package/dist/_workflows/steps/ralphPlan.d.ts +1 -1
- package/dist/_workflows/steps/ralphPlan.js +6 -6
- package/dist/_workflows/steps/ralphPlanPathResolve.d.ts +1 -1
- package/dist/_workflows/steps/ralphReview.d.ts +1 -1
- package/dist/_workflows/steps/ralphReview.js +4 -4
- package/dist/main.js +5 -5
- package/dist/modules/ai/aiOutputExtract.spec.js +1 -1
- package/dist/modules/ai/generate.d.ts +2 -2
- package/dist/modules/ai/generate.js +5 -5
- package/dist/modules/ai/generate.spec.js +1 -1
- package/dist/modules/ai/generate.unit.spec.js +1 -1
- package/dist/modules/ai/generateEventTypes.d.ts +2 -2
- package/dist/modules/ai/generateFile.d.ts +2 -2
- package/dist/modules/ai/generateFile.js +2 -2
- package/dist/modules/ai/generateFile.spec.js +1 -1
- package/dist/modules/ai/generatePureSessionCreate.d.ts +3 -3
- package/dist/modules/ai/generatePureSessionCreate.js +1 -1
- package/dist/modules/ai/generatePureSessionCreate.spec.js +1 -1
- package/dist/modules/ai/generatePureText.d.ts +2 -2
- package/dist/modules/ai/generatePureText.js +5 -5
- package/dist/modules/ai/generatePureText.spec.js +1 -1
- package/dist/modules/ai/generateSessionCreate.d.ts +2 -2
- package/dist/modules/ai/generateSessionCreate.js +1 -1
- package/dist/modules/ai/generateSessionCreate.spec.js +1 -1
- package/dist/modules/ai/generateText.d.ts +2 -2
- package/dist/modules/ai/generateText.js +1 -1
- package/dist/modules/ai/generateText.spec.js +1 -1
- package/dist/modules/ai/generateVerify.spec.js +1 -1
- package/dist/modules/ai/providerGenerate.d.ts +3 -3
- package/dist/modules/ai/providerGenerate.js +2 -2
- package/dist/modules/ai/providerGenerate.spec.js +2 -2
- package/dist/modules/ai/providerGenerate.unit.spec.js +1 -1
- package/dist/modules/ai/providers/commandJSONL.d.ts +1 -1
- package/dist/modules/ai/providers/commandJSONL.js +2 -2
- package/dist/modules/ai/providers/commandJSONL.spec.js +1 -1
- package/dist/modules/ai/providers/piProviderGenerate.d.ts +1 -1
- package/dist/modules/ai/providers/piProviderGenerate.js +1 -1
- package/dist/modules/ai/providers/piProviderGenerate.spec.js +1 -1
- package/dist/modules/beer/beerOriginalPathResolve.spec.js +1 -1
- package/dist/modules/beer/beerSettingsRead.d.ts +1 -1
- package/dist/modules/beer/beerSettingsRead.spec.js +1 -1
- package/dist/modules/beer/beerSettingsTypes.d.ts +2 -2
- package/dist/modules/beer/beerSettingsWrite.d.ts +1 -1
- package/dist/modules/git/gitPush.js +1 -1
- package/dist/modules/git/gitRemoteEnsure.js +1 -1
- package/dist/modules/git/gitRepoCheckout.js +1 -1
- package/dist/modules/git/gitRepoCheckout.spec.js +2 -2
- package/dist/modules/git/gitRepoEnsure.js +1 -1
- package/dist/modules/git/gitRepoEnsure.spec.js +1 -1
- package/dist/modules/git/gitStageAndCommit.js +1 -1
- package/dist/modules/git/gitignoreEnsure.spec.js +1 -1
- package/dist/modules/github/githubCliEnsure.js +2 -2
- package/dist/modules/github/githubOwnerChoicesGet.js +1 -1
- package/dist/modules/github/githubRepoCreate.js +1 -1
- package/dist/modules/github/githubRepoExists.js +1 -1
- package/dist/modules/github/githubRepoNameResolve.d.ts +1 -1
- package/dist/modules/github/githubRepoNameResolve.js +1 -1
- package/dist/modules/github/githubRepoNameResolve.spec.js +1 -1
- package/dist/modules/github/githubRepoParse.d.ts +1 -1
- package/dist/modules/github/githubRepoParse.spec.js +1 -1
- package/dist/modules/github/githubRepoStatusGet.d.ts +1 -1
- package/dist/modules/github/githubRepoStatusGet.js +2 -2
- package/dist/modules/github/githubViewerGet.js +2 -2
- package/dist/modules/plan/planPromptChildren.d.ts +2 -2
- package/dist/modules/plan/planPromptChildren.spec.js +1 -1
- package/dist/modules/plan/planPromptDocument.d.ts +2 -2
- package/dist/modules/plan/planPromptDocument.spec.js +1 -1
- package/dist/modules/plan/planPromptPicker.d.ts +1 -1
- package/dist/modules/plan/planPromptPicker.js +1 -1
- package/dist/modules/plan/planPromptPicker.spec.js +1 -1
- package/dist/modules/plan/planPromptRoot.d.ts +1 -1
- package/dist/modules/plan/planPromptRoot.spec.js +1 -1
- package/dist/modules/plan/planSourceDocumentsResolve.d.ts +1 -1
- package/dist/modules/plan/planSourceDocumentsResolve.spec.js +1 -1
- package/dist/modules/providers/providerDetect.d.ts +1 -1
- package/dist/modules/providers/providerDetect.js +2 -2
- package/dist/modules/providers/providerDetect.spec.js +1 -1
- package/dist/modules/providers/providerModelSelect.d.ts +1 -1
- package/dist/modules/providers/providerModelSelect.spec.js +1 -1
- package/dist/modules/providers/providerModelsGet.d.ts +1 -1
- package/dist/modules/providers/providerModelsGet.js +1 -1
- package/dist/modules/providers/providerModelsGet.spec.js +1 -1
- package/dist/modules/providers/providerPriorityList.d.ts +1 -1
- package/dist/modules/providers/providerPriorityList.spec.js +1 -1
- package/dist/modules/sandbox/sandboxInferenceFilesystemPolicy.d.ts +1 -1
- package/dist/modules/sandbox/sandboxInferenceFilesystemPolicy.js +1 -1
- package/dist/modules/sandbox/sandboxInferenceFilesystemPolicy.spec.js +1 -1
- package/dist/modules/sandbox/sandboxInferenceGet.d.ts +2 -2
- package/dist/modules/sandbox/sandboxInferenceGet.js +1 -1
- package/dist/modules/sandbox/sandboxPassthrough.d.ts +1 -1
- package/dist/modules/sandbox/sandboxPassthrough.spec.js +1 -1
- package/dist/modules/tree/treeChildrenParse.d.ts +1 -1
- package/dist/modules/tree/treeChildrenRead.d.ts +1 -1
- package/dist/modules/tree/treeChildrenRead.spec.js +1 -1
- package/dist/modules/tree/treeChildrenWrite.d.ts +1 -1
- package/dist/modules/tree/treeChildrenWrite.spec.js +1 -1
- package/dist/modules/tree/treeInferenceProgressRun.d.ts +1 -1
- package/dist/modules/tree/treeInferenceProgressRun.js +1 -1
- package/dist/modules/tree/treeInferenceProgressRun.spec.js +1 -1
- package/dist/modules/tree/treeLeafPick.d.ts +1 -1
- package/dist/modules/tree/treeLeafPick.js +8 -8
- package/dist/modules/tree/treeLeafPick.spec.js +1 -1
- package/dist/modules/tree/treeNodeExpand.d.ts +1 -1
- package/dist/modules/tree/treeNodeExpand.js +8 -8
- package/dist/modules/tree/treeNodeExpand.spec.js +3 -3
- package/dist/modules/tree/treeNodePathResolve.d.ts +1 -1
- package/dist/modules/tree/treeNodeRead.d.ts +1 -1
- package/dist/modules/tree/treeNodeRead.spec.js +1 -1
- package/dist/modules/tree/treeNodeSlug.spec.js +1 -1
- package/dist/modules/tree/treeNodeWrite.d.ts +1 -1
- package/dist/modules/tree/treeNodeWrite.spec.js +1 -1
- package/dist/modules/tree/treeSearchRun.d.ts +1 -1
- package/dist/modules/tree/treeSearchRun.js +12 -12
- package/dist/modules/tree/treeSearchRun.spec.js +3 -3
- package/dist/modules/tree/treeSearchTypes.d.ts +1 -1
- package/dist/modules/tree/treeStateLeaves.d.ts +1 -1
- package/dist/modules/tree/treeStateLeaves.spec.js +1 -1
- package/dist/modules/tree/treeStateRead.d.ts +1 -1
- package/dist/modules/tree/treeStateRead.js +2 -2
- package/dist/modules/tree/treeStateRead.spec.js +1 -1
- package/dist/modules/tree/treeStateRender.d.ts +1 -1
- package/dist/modules/tree/treeStateRender.spec.js +1 -1
- package/dist/modules/util/asyncLock.spec.js +1 -1
- package/dist/modules/util/commandRun.d.ts +1 -1
- package/dist/modules/util/commandRun.js +2 -2
- package/dist/modules/util/commandRun.spec.js +1 -1
- package/dist/modules/util/pathLock.js +2 -2
- package/dist/modules/util/pathLock.spec.js +1 -1
- package/dist/modules/util/pathLockOverlap.spec.js +1 -1
- package/dist/release/releaseRun.js +3 -3
- package/dist/release/releaseVersionPrompt.js +3 -3
- package/dist/text/text.d.ts +2 -2
- package/dist/text/text.js +1 -1
- package/dist/text/text.spec.js +1 -1
- package/dist/text/textGenBuild.js +1 -1
- package/dist/text/textGenGenerate.spec.js +1 -1
- package/dist/types.d.ts +9 -9
- package/dist/types.js +1 -1
- package/package.json +3 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { text } from "
|
|
2
|
-
import { bootstrap } from "
|
|
3
|
-
import { checkpointWorkflow } from "
|
|
4
|
-
import { planWorkflow } from "
|
|
5
|
-
import { ralphLoopWorkflow } from "
|
|
6
|
-
import { ralphWorkflow } from "
|
|
7
|
-
import { researchWorkflow } from "
|
|
1
|
+
import { text } from "../text/text.js";
|
|
2
|
+
import { bootstrap } from "../_workflows/bootstrap.js";
|
|
3
|
+
import { checkpointWorkflow } from "../_workflows/checkpointWorkflow.js";
|
|
4
|
+
import { planWorkflow } from "../_workflows/planWorkflow.js";
|
|
5
|
+
import { ralphLoopWorkflow } from "../_workflows/ralphLoopWorkflow.js";
|
|
6
|
+
import { ralphWorkflow } from "../_workflows/ralphWorkflow.js";
|
|
7
|
+
import { researchWorkflow } from "../_workflows/researchWorkflow.js";
|
|
8
8
|
export const workflowBootstrap = {
|
|
9
9
|
id: "bootstrap",
|
|
10
10
|
title: text.workflow_bootstrap_title,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { text, textFormatKey } from "
|
|
2
|
-
import { generateReadme } from "
|
|
3
|
-
import { beerOriginalPathResolve } from "
|
|
4
|
-
import { gitRemoteEnsure } from "
|
|
5
|
-
import { gitRepoCheckout } from "
|
|
6
|
-
import { gitRepoEnsure } from "
|
|
7
|
-
import { githubOwnerChoicesGet } from "
|
|
8
|
-
import { githubRepoCreate } from "
|
|
9
|
-
import { githubRepoNameResolve } from "
|
|
10
|
-
import { githubRepoStatusGet } from "
|
|
11
|
-
import { githubRepoUrlBuild } from "
|
|
12
|
-
import { githubViewerGet } from "
|
|
13
|
-
import { promptConfirm } from "
|
|
14
|
-
import { promptInput } from "
|
|
1
|
+
import { text, textFormatKey } from "../text/text.js";
|
|
2
|
+
import { generateReadme } from "../_workflows/steps/generateReadme.js";
|
|
3
|
+
import { beerOriginalPathResolve } from "../modules/beer/beerOriginalPathResolve.js";
|
|
4
|
+
import { gitRemoteEnsure } from "../modules/git/gitRemoteEnsure.js";
|
|
5
|
+
import { gitRepoCheckout } from "../modules/git/gitRepoCheckout.js";
|
|
6
|
+
import { gitRepoEnsure } from "../modules/git/gitRepoEnsure.js";
|
|
7
|
+
import { githubOwnerChoicesGet } from "../modules/github/githubOwnerChoicesGet.js";
|
|
8
|
+
import { githubRepoCreate } from "../modules/github/githubRepoCreate.js";
|
|
9
|
+
import { githubRepoNameResolve } from "../modules/github/githubRepoNameResolve.js";
|
|
10
|
+
import { githubRepoStatusGet } from "../modules/github/githubRepoStatusGet.js";
|
|
11
|
+
import { githubRepoUrlBuild } from "../modules/github/githubRepoUrlBuild.js";
|
|
12
|
+
import { githubViewerGet } from "../modules/github/githubViewerGet.js";
|
|
13
|
+
import { promptConfirm } from "../modules/prompt/promptConfirm.js";
|
|
14
|
+
import { promptInput } from "../modules/prompt/promptInput.js";
|
|
15
15
|
/**
|
|
16
16
|
* Runs the interactive bootstrap workflow for holdmybeer.
|
|
17
17
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { text } from "
|
|
2
|
-
import { promptInput } from "
|
|
1
|
+
import { text } from "../text/text.js";
|
|
2
|
+
import { promptInput } from "../modules/prompt/promptInput.js";
|
|
3
3
|
/**
|
|
4
4
|
* Runs a checkpoint workflow with AI-generated commit message.
|
|
5
5
|
* Expects: repository is initialized and configured for pushing to origin/main.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PathLock } from "
|
|
2
|
-
import type { BeerSettings, GitHubRepoRef, PathLockResult, ProviderDetection, ProviderModelSelectionMode } from "
|
|
1
|
+
import { PathLock } from "../../modules/util/pathLock.js";
|
|
2
|
+
import type { BeerSettings, GitHubRepoRef, PathLockResult, ProviderDetection, ProviderModelSelectionMode } from "../../types.js";
|
|
3
3
|
export interface ContextCheckpointOptions {
|
|
4
4
|
remote?: string;
|
|
5
5
|
branch?: string;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { lstat, mkdir, stat, symlink, unlink, writeFile } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { text as catalog } from "
|
|
4
|
-
import { contextApplyConfig } from "
|
|
5
|
-
import { contextAskGithubRepo } from "
|
|
6
|
-
import { contextGitignoreEnsure } from "
|
|
7
|
-
import { progressMultilineStart } from "
|
|
8
|
-
import { generateCommit } from "
|
|
9
|
-
import { beerSettingsRead } from "
|
|
10
|
-
import { gitPush } from "
|
|
11
|
-
import { gitStageAndCommit } from "
|
|
12
|
-
import { providerDetect } from "
|
|
13
|
-
import { PathLock } from "
|
|
3
|
+
import { text as catalog } from "../../text/text.js";
|
|
4
|
+
import { contextApplyConfig } from "../../_workflows/context/utils/contextApplyConfig.js";
|
|
5
|
+
import { contextAskGithubRepo } from "../../_workflows/context/utils/contextAskGithubRepo.js";
|
|
6
|
+
import { contextGitignoreEnsure } from "../../_workflows/context/utils/contextGitignoreEnsure.js";
|
|
7
|
+
import { progressMultilineStart } from "../../_workflows/context/utils/progressMultilineStart.js";
|
|
8
|
+
import { generateCommit } from "../../_workflows/steps/generateCommit.js";
|
|
9
|
+
import { beerSettingsRead } from "../../modules/beer/beerSettingsRead.js";
|
|
10
|
+
import { gitPush } from "../../modules/git/gitPush.js";
|
|
11
|
+
import { gitStageAndCommit } from "../../modules/git/gitStageAndCommit.js";
|
|
12
|
+
import { providerDetect } from "../../modules/providers/providerDetect.js";
|
|
13
|
+
import { PathLock } from "../../modules/util/pathLock.js";
|
|
14
14
|
/**
|
|
15
15
|
* Runtime workflow context with repository-aware helpers.
|
|
16
16
|
* Expects: projectPath points to the repository root.
|
|
@@ -34,7 +34,7 @@ vi.mock("@/_workflows/context/utils/contextGitignoreEnsure.js", () => ({
|
|
|
34
34
|
vi.mock("@/_workflows/context/utils/progressMultilineStart.js", () => ({
|
|
35
35
|
progressMultilineStart: progressMultilineStartMock
|
|
36
36
|
}));
|
|
37
|
-
import { Context } from "
|
|
37
|
+
import { Context } from "../../_workflows/context/context.js";
|
|
38
38
|
describe("Context", () => {
|
|
39
39
|
beforeEach(() => {
|
|
40
40
|
providerDetectMock.mockReset();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import { beerSettingsWrite } from "
|
|
2
|
+
import { beerSettingsWrite } from "../../../modules/beer/beerSettingsWrite.js";
|
|
3
3
|
/**
|
|
4
4
|
* Applies a mutation to current settings and persists the result to .beer/settings.json.
|
|
5
5
|
* Expects: projectPath is the repository root.
|
|
@@ -3,7 +3,7 @@ const beerSettingsWriteMock = vi.hoisted(() => vi.fn());
|
|
|
3
3
|
vi.mock("@/modules/beer/beerSettingsWrite.js", () => ({
|
|
4
4
|
beerSettingsWrite: beerSettingsWriteMock
|
|
5
5
|
}));
|
|
6
|
-
import { contextApplyConfig } from "
|
|
6
|
+
import { contextApplyConfig } from "../../../_workflows/context/utils/contextApplyConfig.js";
|
|
7
7
|
describe("contextApplyConfig", () => {
|
|
8
8
|
it("applies update, persists with refreshed timestamp, and keeps input immutable", async () => {
|
|
9
9
|
const current = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { githubRepoExists } from "
|
|
2
|
-
import { githubRepoParse } from "
|
|
3
|
-
import { promptInput } from "
|
|
1
|
+
import { githubRepoExists } from "../../../modules/github/githubRepoExists.js";
|
|
2
|
+
import { githubRepoParse } from "../../../modules/github/githubRepoParse.js";
|
|
3
|
+
import { promptInput } from "../../../modules/prompt/promptInput.js";
|
|
4
4
|
/**
|
|
5
5
|
* Prompts until a valid and accessible GitHub repository is provided.
|
|
6
6
|
* Expects: question is a non-empty prompt text for the user.
|
|
@@ -11,7 +11,7 @@ vi.mock("@/modules/github/githubRepoParse.js", () => ({
|
|
|
11
11
|
vi.mock("@/modules/github/githubRepoExists.js", () => ({
|
|
12
12
|
githubRepoExists: githubRepoExistsMock
|
|
13
13
|
}));
|
|
14
|
-
import { contextAskGithubRepo } from "
|
|
14
|
+
import { contextAskGithubRepo } from "../../../_workflows/context/utils/contextAskGithubRepo.js";
|
|
15
15
|
describe("contextAskGithubRepo", () => {
|
|
16
16
|
beforeEach(() => {
|
|
17
17
|
promptInputMock.mockReset();
|
|
@@ -2,7 +2,7 @@ import { mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
|
|
|
2
2
|
import os from "node:os";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { afterEach, describe, expect, it } from "vitest";
|
|
5
|
-
import { contextGitignoreEnsure } from "
|
|
5
|
+
import { contextGitignoreEnsure } from "../../../_workflows/context/utils/contextGitignoreEnsure.js";
|
|
6
6
|
const tempDirs = [];
|
|
7
7
|
afterEach(async () => {
|
|
8
8
|
await Promise.all(tempDirs.splice(0).map((dir) => rm(dir, { recursive: true, force: true })));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
2
|
-
import { progressMultilineStart } from "
|
|
2
|
+
import { progressMultilineStart } from "../../../_workflows/context/utils/progressMultilineStart.js";
|
|
3
3
|
const originalIsTTY = process.stderr.isTTY;
|
|
4
4
|
afterEach(() => {
|
|
5
5
|
process.stderr.isTTY = originalIsTTY;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import { text } from "
|
|
2
|
+
import { text } from "../text/text.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
import { planPromptChildren } from "
|
|
5
|
-
import { planPromptDocument } from "
|
|
6
|
-
import { planPromptPicker } from "
|
|
7
|
-
import { planPromptRoot } from "
|
|
8
|
-
import { planSourceDocumentsResolve } from "
|
|
9
|
-
import { treeSearchRun } from "
|
|
10
|
-
import { treeStateRead } from "
|
|
11
|
-
import { treeStateRender } from "
|
|
4
|
+
import { planPromptChildren } from "../modules/plan/planPromptChildren.js";
|
|
5
|
+
import { planPromptDocument } from "../modules/plan/planPromptDocument.js";
|
|
6
|
+
import { planPromptPicker } from "../modules/plan/planPromptPicker.js";
|
|
7
|
+
import { planPromptRoot } from "../modules/plan/planPromptRoot.js";
|
|
8
|
+
import { planSourceDocumentsResolve } from "../modules/plan/planSourceDocumentsResolve.js";
|
|
9
|
+
import { treeSearchRun } from "../modules/tree/treeSearchRun.js";
|
|
10
|
+
import { treeStateRead } from "../modules/tree/treeStateRead.js";
|
|
11
|
+
import { treeStateRender } from "../modules/tree/treeStateRender.js";
|
|
12
12
|
const planNodeFrontmatterSchema = z.object({
|
|
13
13
|
title: z.string().min(1),
|
|
14
14
|
slug: z.string().min(1),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { text } from "
|
|
2
|
-
import { ralphLoopExecute } from "
|
|
3
|
-
import { ralphLoopPlanGenerate } from "
|
|
4
|
-
import { ralphLoopReviewRound } from "
|
|
5
|
-
import { promptInput } from "
|
|
1
|
+
import { text } from "../text/text.js";
|
|
2
|
+
import { ralphLoopExecute } from "../_workflows/steps/ralphLoopExecute.js";
|
|
3
|
+
import { ralphLoopPlanGenerate } from "../_workflows/steps/ralphLoopPlanGenerate.js";
|
|
4
|
+
import { ralphLoopReviewRound } from "../_workflows/steps/ralphLoopReviewRound.js";
|
|
5
|
+
import { promptInput } from "../modules/prompt/promptInput.js";
|
|
6
6
|
/**
|
|
7
7
|
* Runs the ralph-loop workflow: ask goal, plan, execute, and review in 3 rounds.
|
|
8
8
|
* Expects: ctx.projectPath is the repository root for execution and review writes.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Context } from "
|
|
1
|
+
import type { Context } from "../types.js";
|
|
2
2
|
/**
|
|
3
3
|
* Runs the ralph workflow: plan with Opus, execute with codex-xhigh, and review with codex-high.
|
|
4
4
|
* Expects: ctx.projectPath is repository root for execution and review write operations.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { text } from "
|
|
2
|
-
import { ralphExecute } from "
|
|
3
|
-
import { ralphPlan } from "
|
|
4
|
-
import { ralphReview } from "
|
|
5
|
-
import { promptInput } from "
|
|
1
|
+
import { text } from "../text/text.js";
|
|
2
|
+
import { ralphExecute } from "../_workflows/steps/ralphExecute.js";
|
|
3
|
+
import { ralphPlan } from "../_workflows/steps/ralphPlan.js";
|
|
4
|
+
import { ralphReview } from "../_workflows/steps/ralphReview.js";
|
|
5
|
+
import { promptInput } from "../modules/prompt/promptInput.js";
|
|
6
6
|
/**
|
|
7
7
|
* Runs the ralph workflow: plan with Opus, execute with codex-xhigh, and review with codex-high.
|
|
8
8
|
* Expects: ctx.projectPath is repository root for execution and review write operations.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { beerLogLine, text } from "
|
|
3
|
+
import { beerLogLine, text } from "../text/text.js";
|
|
4
4
|
import matter from "gray-matter";
|
|
5
5
|
import { z } from "zod";
|
|
6
|
-
import { generateDocument } from "
|
|
7
|
-
import { promptConfirm } from "
|
|
6
|
+
import { generateDocument } from "../_workflows/steps/generateDocument.js";
|
|
7
|
+
import { promptConfirm } from "../modules/prompt/promptConfirm.js";
|
|
8
8
|
const deepResearchQuerySchema = z.object({
|
|
9
9
|
deepResearchQuery: z.string().min(1)
|
|
10
10
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type GeneratePermissions, type GenerateResult } from "
|
|
2
|
-
import type { Context } from "
|
|
1
|
+
import { type GeneratePermissions, type GenerateResult } from "../../modules/ai/generate.js";
|
|
2
|
+
import type { Context } from "../../types.js";
|
|
3
3
|
export interface RunInferenceOptions extends GeneratePermissions {
|
|
4
4
|
progressMessage: string;
|
|
5
5
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { text } from "
|
|
2
|
-
import { generateProgressMessageResolve } from "
|
|
3
|
-
import { generate as generateAi } from "
|
|
1
|
+
import { text } from "../../text/text.js";
|
|
2
|
+
import { generateProgressMessageResolve } from "../../_workflows/steps/generateProgressMessageResolve.js";
|
|
3
|
+
import { generate as generateAi } from "../../modules/ai/generate.js";
|
|
4
4
|
/**
|
|
5
5
|
* Runs inference for a workflow step using the provided context.
|
|
6
6
|
* Expects: promptTemplate may include {{key}} placeholders from values and progressMessage is non-empty.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { text } from "
|
|
2
|
-
import { generate } from "
|
|
1
|
+
import { text } from "../../text/text.js";
|
|
2
|
+
import { generate } from "../../_workflows/steps/generate.js";
|
|
3
3
|
const promptTemplate = [
|
|
4
4
|
"Generate one Angular-style git commit message.",
|
|
5
5
|
"Return a single line only.",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type GenerateFilePermissions } from "
|
|
2
|
-
import type { Context, ProviderModelSelectionMode } from "
|
|
1
|
+
import { type GenerateFilePermissions } from "../../modules/ai/generateFile.js";
|
|
2
|
+
import type { Context, ProviderModelSelectionMode } from "../../types.js";
|
|
3
3
|
export type GenerateDocumentPromptId = "PROMPT_RESEARCH" | "PROMPT_RESEARCH_PROBLEMS" | "PROMPT_DECISIONS" | "PROMPT_PRODUCT_PITCH" | "PROMPT_PRODUCT_PITCH_FINAL" | "PROMPT_PRODUCT_NAME" | "PROMPT_TECHNOLOGY_STACK" | "PROMPT_TECHNOLOGY_STACK_FINAL" | "PROMPT_AGENTS_MD" | "PROMPT_PROJECT_BLUEPRINT";
|
|
4
4
|
export interface GenerateDocumentInput {
|
|
5
5
|
promptId: GenerateDocumentPromptId;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { readFileSync } from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
|
-
import { text } from "
|
|
5
|
-
import { generateProgressMessageResolve } from "
|
|
6
|
-
import { generateFile } from "
|
|
4
|
+
import { text } from "../../text/text.js";
|
|
5
|
+
import { generateProgressMessageResolve } from "../../_workflows/steps/generateProgressMessageResolve.js";
|
|
6
|
+
import { generateFile } from "../../modules/ai/generateFile.js";
|
|
7
7
|
const promptsPath = path.join(path.dirname(fileURLToPath(import.meta.url)), "../prompts");
|
|
8
8
|
const promptById = {
|
|
9
9
|
PROMPT_RESEARCH: readFileSync(path.join(promptsPath, "PROMPT_RESEARCH.md"), "utf-8"),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ZodTypeAny } from "zod";
|
|
2
|
-
import { type GenerateFilePermissions } from "
|
|
3
|
-
import type { Context } from "
|
|
2
|
+
import { type GenerateFilePermissions } from "../../modules/ai/generateFile.js";
|
|
3
|
+
import type { Context } from "../../types.js";
|
|
4
4
|
export interface GenerateFrontmatterOptions extends Omit<GenerateFilePermissions, "verify"> {
|
|
5
5
|
}
|
|
6
6
|
export interface GenerateFrontmatterResult {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import matter from "gray-matter";
|
|
3
|
-
import { generateFile } from "
|
|
3
|
+
import { generateFile } from "../../modules/ai/generateFile.js";
|
|
4
4
|
/**
|
|
5
5
|
* Generates a file and requires YAML frontmatter that matches the given schema.
|
|
6
6
|
* Expects: outputFilePath is project-relative or absolute and schema is a zod object-like validator.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { readFileSync } from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
|
-
import { text, textFormat } from "
|
|
5
|
-
import { generateFile } from "
|
|
4
|
+
import { text, textFormat } from "../../text/text.js";
|
|
5
|
+
import { generateFile } from "../../modules/ai/generateFile.js";
|
|
6
6
|
const promptTemplate = readFileSync(path.join(path.dirname(fileURLToPath(import.meta.url)), "../prompts/PROMPT_README.md"), "utf-8");
|
|
7
7
|
/**
|
|
8
8
|
* Generates README.md at project root using sonnet-biased inference.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { text } from "
|
|
4
|
-
import { generate } from "
|
|
3
|
+
import { text } from "../../text/text.js";
|
|
4
|
+
import { generate } from "../../_workflows/steps/generate.js";
|
|
5
5
|
const executePromptTemplate = [
|
|
6
6
|
"Implement this build goal in the current repository: {{buildGoal}}",
|
|
7
7
|
"Use this finalized plan as the exact scope of work:",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { text } from "
|
|
4
|
-
import { generate } from "
|
|
3
|
+
import { text } from "../../text/text.js";
|
|
4
|
+
import { generate } from "../../_workflows/steps/generate.js";
|
|
5
5
|
const executePromptTemplate = [
|
|
6
6
|
"Implement this request in the current repository: {{buildGoal}}",
|
|
7
7
|
"Follow this plan exactly, then complete all pending implementation and test tasks:",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { text } from "
|
|
4
|
-
import { generate } from "
|
|
5
|
-
import { ralphLoopPlanPathResolve } from "
|
|
3
|
+
import { text } from "../../text/text.js";
|
|
4
|
+
import { generate } from "../../_workflows/steps/generate.js";
|
|
5
|
+
import { ralphLoopPlanPathResolve } from "../../_workflows/steps/ralphLoopPlanPathResolve.js";
|
|
6
6
|
const planPromptTemplate = [
|
|
7
7
|
"Create a markdown implementation plan for this request: {{buildGoal}}",
|
|
8
8
|
"Output only the final plan markdown (no wrappers).",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { textFormatKey } from "
|
|
4
|
-
import { generate } from "
|
|
3
|
+
import { textFormatKey } from "../../text/text.js";
|
|
4
|
+
import { generate } from "../../_workflows/steps/generate.js";
|
|
5
5
|
const reviewPromptTemplate = [
|
|
6
6
|
"Run review round {{round}} of 3 for this implementation plan:",
|
|
7
7
|
"{{planContent}}",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { text, textFormatKey } from "
|
|
4
|
-
import { generateProgressMessageResolve } from "
|
|
5
|
-
import { ralphPlanPathResolve } from "
|
|
6
|
-
import { ralphPlanResponseParse } from "
|
|
7
|
-
import { generateSessionCreate } from "
|
|
8
|
-
import { promptInput } from "
|
|
3
|
+
import { text, textFormatKey } from "../../text/text.js";
|
|
4
|
+
import { generateProgressMessageResolve } from "../../_workflows/steps/generateProgressMessageResolve.js";
|
|
5
|
+
import { ralphPlanPathResolve } from "../../_workflows/steps/ralphPlanPathResolve.js";
|
|
6
|
+
import { ralphPlanResponseParse } from "../../_workflows/steps/ralphPlanResponseParse.js";
|
|
7
|
+
import { generateSessionCreate } from "../../modules/ai/generateSessionCreate.js";
|
|
8
|
+
import { promptInput } from "../../modules/prompt/promptInput.js";
|
|
9
9
|
const initialPlanningPromptTemplate = [
|
|
10
10
|
"Create an implementation plan for this build goal: {{buildGoal}}",
|
|
11
11
|
"Respond using this exact structure:",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { text } from "
|
|
4
|
-
import { generateProgressMessageResolve } from "
|
|
5
|
-
import { ralphReviewNoIssuesDetect } from "
|
|
6
|
-
import { generateSessionCreate } from "
|
|
3
|
+
import { text } from "../../text/text.js";
|
|
4
|
+
import { generateProgressMessageResolve } from "../../_workflows/steps/generateProgressMessageResolve.js";
|
|
5
|
+
import { ralphReviewNoIssuesDetect } from "../../_workflows/steps/ralphReviewNoIssuesDetect.js";
|
|
6
|
+
import { generateSessionCreate } from "../../modules/ai/generateSessionCreate.js";
|
|
7
7
|
const MAX_REVIEW_ROUNDS = 10;
|
|
8
8
|
const reviewInitialPromptTemplate = [
|
|
9
9
|
"Review the implemented changes against this plan:",
|
package/dist/main.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { readFileSync } from "node:fs";
|
|
2
2
|
import select from "@inquirer/select";
|
|
3
|
-
import { text } from "
|
|
3
|
+
import { text } from "./text/text.js";
|
|
4
4
|
import { Command } from "commander";
|
|
5
|
-
import { workflows } from "
|
|
6
|
-
import { Context } from "
|
|
7
|
-
import { githubCliEnsure } from "
|
|
8
|
-
import { pathResolveFromInitCwd } from "
|
|
5
|
+
import { workflows } from "./_workflows/_index.js";
|
|
6
|
+
import { Context } from "./_workflows/context/context.js";
|
|
7
|
+
import { githubCliEnsure } from "./modules/github/githubCliEnsure.js";
|
|
8
|
+
import { pathResolveFromInitCwd } from "./modules/util/pathResolveFromInitCwd.js";
|
|
9
9
|
const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf-8"));
|
|
10
10
|
const program = new Command();
|
|
11
11
|
program
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { aiOutputExtract } from "
|
|
2
|
+
import { aiOutputExtract } from "../../modules/ai/aiOutputExtract.js";
|
|
3
3
|
describe("aiOutputExtract", () => {
|
|
4
4
|
it("extracts text from output tags", () => {
|
|
5
5
|
const result = aiOutputExtract("before\n<output>Hello</output>\nafter");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { InferenceWritePolicy } from "
|
|
2
|
-
import type { Context, GenerateEvent, ProviderId, ProviderModelSelectionMode } from "
|
|
1
|
+
import type { InferenceWritePolicy } from "../../modules/sandbox/sandboxInferenceTypes.js";
|
|
2
|
+
import type { Context, GenerateEvent, ProviderId, ProviderModelSelectionMode } from "../../types.js";
|
|
3
3
|
export interface GenerateResult {
|
|
4
4
|
provider?: string;
|
|
5
5
|
sessionId?: string;
|