@slopus/beer 0.1.2 → 0.1.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.
- 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/prompts/PROMPT_AGENTS_MD.md +168 -0
- package/dist/_workflows/prompts/PROMPT_DECISIONS.md +372 -0
- package/dist/_workflows/prompts/PROMPT_PRODUCT_NAME.md +101 -0
- package/dist/_workflows/prompts/PROMPT_PRODUCT_PITCH.md +197 -0
- package/dist/_workflows/prompts/PROMPT_PRODUCT_PITCH_FINAL.md +44 -0
- package/dist/_workflows/prompts/PROMPT_PROJECT_BLUEPRINT.md +469 -0
- package/dist/_workflows/prompts/PROMPT_README.md +101 -0
- package/dist/_workflows/prompts/PROMPT_RESEARCH.md +407 -0
- package/dist/_workflows/prompts/PROMPT_RESEARCH_PROBLEMS.md +296 -0
- package/dist/_workflows/prompts/PROMPT_TECHNOLOGY_STACK.md +460 -0
- package/dist/_workflows/prompts/PROMPT_TECHNOLOGY_STACK_FINAL.md +48 -0
- 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
|
@@ -3,7 +3,7 @@ const commandRunMock = vi.hoisted(() => vi.fn());
|
|
|
3
3
|
vi.mock("@/modules/util/commandRun.js", () => ({
|
|
4
4
|
commandRun: commandRunMock
|
|
5
5
|
}));
|
|
6
|
-
import { gitRepoEnsure } from "
|
|
6
|
+
import { gitRepoEnsure } from "../../modules/git/gitRepoEnsure.js";
|
|
7
7
|
describe("gitRepoEnsure", () => {
|
|
8
8
|
beforeEach(() => {
|
|
9
9
|
commandRunMock.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 { gitignoreEnsure } from "
|
|
5
|
+
import { gitignoreEnsure } from "../../modules/git/gitignoreEnsure.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
|
-
import { text } from "
|
|
2
|
-
import { commandRun } from "
|
|
1
|
+
import { text } from "../../text/text.js";
|
|
2
|
+
import { commandRun } from "../../modules/util/commandRun.js";
|
|
3
3
|
/**
|
|
4
4
|
* Verifies GitHub CLI is installed and callable.
|
|
5
5
|
* Throws with a clear message when unavailable.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { githubRepoNameResolve } from "
|
|
2
|
+
import { githubRepoNameResolve } from "../../modules/github/githubRepoNameResolve.js";
|
|
3
3
|
describe("githubRepoNameResolve", () => {
|
|
4
4
|
it("keeps requested name when missing", async () => {
|
|
5
5
|
const result = await githubRepoNameResolve({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { githubRepoParse } from "
|
|
2
|
+
import { githubRepoParse } from "../../modules/github/githubRepoParse.js";
|
|
3
3
|
describe("githubRepoParse", () => {
|
|
4
4
|
it("parses owner/repo shorthand", () => {
|
|
5
5
|
expect(githubRepoParse("ex3ndr/holdmybeer")?.fullName).toBe("ex3ndr/holdmybeer");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GitHubRepoStatus } from "
|
|
1
|
+
import type { GitHubRepoStatus } from "../../modules/github/githubTypes.js";
|
|
2
2
|
/**
|
|
3
3
|
* Checks repository status for publish targeting.
|
|
4
4
|
* missing: not found, empty: exists with no content, nonEmpty: contains content.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { textFormatKey } from "
|
|
2
|
-
import { commandRun } from "
|
|
1
|
+
import { textFormatKey } from "../../text/text.js";
|
|
2
|
+
import { commandRun } from "../../modules/util/commandRun.js";
|
|
3
3
|
/**
|
|
4
4
|
* Checks repository status for publish targeting.
|
|
5
5
|
* missing: not found, empty: exists with no content, nonEmpty: contains content.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { text } from "
|
|
2
|
-
import { commandRun } from "
|
|
1
|
+
import { text } from "../../text/text.js";
|
|
2
|
+
import { commandRun } from "../../modules/util/commandRun.js";
|
|
3
3
|
/**
|
|
4
4
|
* Returns the authenticated GitHub login from gh auth.
|
|
5
5
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PlanSourceDocument } from "
|
|
2
|
-
import type { TreeNode } from "
|
|
1
|
+
import type { PlanSourceDocument } from "../../modules/plan/planSourceDocumentTypes.js";
|
|
2
|
+
import type { TreeNode } from "../../types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Builds the node-children prompt for decomposing one task node into sub-tasks.
|
|
5
5
|
* Expects: node document has been generated in the same session before this call.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { planPromptChildren } from "
|
|
2
|
+
import { planPromptChildren } from "../../modules/plan/planPromptChildren.js";
|
|
3
3
|
describe("planPromptChildren", () => {
|
|
4
4
|
it("requires json-only child output contract", () => {
|
|
5
5
|
const node = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PlanSourceDocument } from "
|
|
2
|
-
import type { TreeNode } from "
|
|
1
|
+
import type { PlanSourceDocument } from "../../modules/plan/planSourceDocumentTypes.js";
|
|
2
|
+
import type { TreeNode } from "../../types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Builds the node document prompt for a single task node in the planning tree.
|
|
5
5
|
* Expects: node is the currently expanded planning node and source docs are readable.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { planPromptDocument } from "
|
|
2
|
+
import { planPromptDocument } from "../../modules/plan/planPromptDocument.js";
|
|
3
3
|
describe("planPromptDocument", () => {
|
|
4
4
|
it("contains frontmatter and section requirements for the node", () => {
|
|
5
5
|
const node = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TreeNode } from "
|
|
1
|
+
import type { TreeNode } from "../../types.js";
|
|
2
2
|
/**
|
|
3
3
|
* Builds a picker prompt that prioritizes dependency-first planning of unexpanded leaves.
|
|
4
4
|
* Expects: treeOutline is a rendered state and leaves contains only unexpanded candidates.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { treeNodePathResolve } from "
|
|
1
|
+
import { treeNodePathResolve } from "../../modules/tree/treeNodePathResolve.js";
|
|
2
2
|
/**
|
|
3
3
|
* Builds a picker prompt that prioritizes dependency-first planning of unexpanded leaves.
|
|
4
4
|
* Expects: treeOutline is a rendered state and leaves contains only unexpanded candidates.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { planPromptPicker } from "
|
|
2
|
+
import { planPromptPicker } from "../../modules/plan/planPromptPicker.js";
|
|
3
3
|
describe("planPromptPicker", () => {
|
|
4
4
|
it("renders candidate leaf paths and output requirement", () => {
|
|
5
5
|
const leaves = [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PlanSourceDocument } from "
|
|
1
|
+
import type { PlanSourceDocument } from "../../modules/plan/planSourceDocumentTypes.js";
|
|
2
2
|
/**
|
|
3
3
|
* Builds the root planning prompt that enumerates exhaustive level-1 task streams.
|
|
4
4
|
* Expects: sourceDocuments contains at least one planning input document path.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { planPromptRoot } from "
|
|
2
|
+
import { planPromptRoot } from "../../modules/plan/planPromptRoot.js";
|
|
3
3
|
describe("planPromptRoot", () => {
|
|
4
4
|
it("embeds source document paths and output contract", () => {
|
|
5
5
|
const prompt = planPromptRoot([
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PlanSourceDocument } from "
|
|
1
|
+
import type { PlanSourceDocument } from "../../modules/plan/planSourceDocumentTypes.js";
|
|
2
2
|
/**
|
|
3
3
|
* Resolves available planning source documents from standard repository paths.
|
|
4
4
|
* Expects: projectPath is repository root and candidate files are regular markdown documents.
|
|
@@ -2,7 +2,7 @@ import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
|
|
|
2
2
|
import os from "node:os";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { describe, expect, it } from "vitest";
|
|
5
|
-
import { planSourceDocumentsResolve } from "
|
|
5
|
+
import { planSourceDocumentsResolve } from "../../modules/plan/planSourceDocumentsResolve.js";
|
|
6
6
|
describe("planSourceDocumentsResolve", () => {
|
|
7
7
|
it("returns only known planning documents that exist", async () => {
|
|
8
8
|
const tempDir = await mkdtemp(path.join(os.tmpdir(), "holdmybeer-plan-sources-"));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { providerModelsGet } from "
|
|
2
|
-
import { commandRun } from "
|
|
1
|
+
import { providerModelsGet } from "../../modules/providers/providerModelsGet.js";
|
|
2
|
+
import { commandRun } from "../../modules/util/commandRun.js";
|
|
3
3
|
const PROVIDER_PROBES = [
|
|
4
4
|
{
|
|
5
5
|
id: "pi",
|
|
@@ -3,7 +3,7 @@ const commandRunMock = vi.hoisted(() => vi.fn());
|
|
|
3
3
|
vi.mock("@/modules/util/commandRun.js", () => ({
|
|
4
4
|
commandRun: commandRunMock
|
|
5
5
|
}));
|
|
6
|
-
import { providerDetect } from "
|
|
6
|
+
import { providerDetect } from "../../modules/providers/providerDetect.js";
|
|
7
7
|
describe("providerDetect", () => {
|
|
8
8
|
beforeEach(() => {
|
|
9
9
|
commandRunMock.mockReset();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ProviderDetection, ProviderModelSelectionMode } from "
|
|
1
|
+
import type { ProviderDetection, ProviderModelSelectionMode } from "../../types.js";
|
|
2
2
|
export interface ProviderModelSelectInput {
|
|
3
3
|
provider: ProviderDetection;
|
|
4
4
|
modelPriority?: readonly string[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { providerModelSelect } from "
|
|
2
|
+
import { providerModelSelect } from "../../modules/providers/providerModelSelect.js";
|
|
3
3
|
describe("providerModelSelect", () => {
|
|
4
4
|
const provider = {
|
|
5
5
|
id: "pi",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { commandRun } from "
|
|
1
|
+
import { commandRun } from "../../modules/util/commandRun.js";
|
|
2
2
|
const RPC_MODELS_REQUEST = '{"id":"models","type":"get_available_models"}\n';
|
|
3
3
|
/**
|
|
4
4
|
* Queries the pi RPC API and returns currently available model ids.
|
|
@@ -3,7 +3,7 @@ const commandRunMock = vi.hoisted(() => vi.fn());
|
|
|
3
3
|
vi.mock("@/modules/util/commandRun.js", () => ({
|
|
4
4
|
commandRun: commandRunMock
|
|
5
5
|
}));
|
|
6
|
-
import { providerModelsGet } from "
|
|
6
|
+
import { providerModelsGet } from "../../modules/providers/providerModelsGet.js";
|
|
7
7
|
describe("providerModelsGet", () => {
|
|
8
8
|
beforeEach(() => {
|
|
9
9
|
commandRunMock.mockReset();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ProviderDetection, ProviderId } from "
|
|
1
|
+
import type { ProviderDetection, ProviderId } from "../../modules/providers/providerTypes.js";
|
|
2
2
|
/**
|
|
3
3
|
* Returns available providers ordered by requested provider id priority.
|
|
4
4
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { providerPriorityList } from "
|
|
2
|
+
import { providerPriorityList } from "../../modules/providers/providerPriorityList.js";
|
|
3
3
|
describe("providerPriorityList", () => {
|
|
4
4
|
it("orders available providers by requested provider ids", () => {
|
|
5
5
|
const providers = [{ id: "pi", available: true, command: "pi", priority: 1 }];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { InferenceWritePolicy } from "
|
|
1
|
+
import type { InferenceWritePolicy } from "../../modules/sandbox/sandboxInferenceTypes.js";
|
|
2
2
|
export interface SandboxInferenceFilesystemPolicyInput {
|
|
3
3
|
writePolicy?: InferenceWritePolicy;
|
|
4
4
|
projectPath?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import os from "node:os";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { pathResolveFromInitCwd } from "
|
|
3
|
+
import { pathResolveFromInitCwd } from "../../modules/util/pathResolveFromInitCwd.js";
|
|
4
4
|
const COMMON_HOME_RELATIVE_DENY_PATHS = [
|
|
5
5
|
".ssh",
|
|
6
6
|
".gnupg",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { afterAll, beforeEach, describe, expect, it } from "vitest";
|
|
3
|
-
import { sandboxInferenceFilesystemPolicy } from "
|
|
3
|
+
import { sandboxInferenceFilesystemPolicy } from "../../modules/sandbox/sandboxInferenceFilesystemPolicy.js";
|
|
4
4
|
describe("sandboxInferenceFilesystemPolicy", () => {
|
|
5
5
|
const initCwd = process.env.INIT_CWD;
|
|
6
6
|
const beerProjectPath = process.env.BEER_PROJECT_PATH;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { InferenceWritePolicy } from "
|
|
2
|
-
import type { CommandSandbox } from "
|
|
1
|
+
import type { InferenceWritePolicy } from "../../modules/sandbox/sandboxInferenceTypes.js";
|
|
2
|
+
import type { CommandSandbox } from "../../modules/sandbox/sandboxTypes.js";
|
|
3
3
|
export interface SandboxInferenceGetInput {
|
|
4
4
|
writePolicy?: InferenceWritePolicy;
|
|
5
5
|
projectPath?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SandboxManager } from "@anthropic-ai/sandbox-runtime";
|
|
2
|
-
import { sandboxInferenceFilesystemPolicy } from "
|
|
2
|
+
import { sandboxInferenceFilesystemPolicy } from "../../modules/sandbox/sandboxInferenceFilesystemPolicy.js";
|
|
3
3
|
/**
|
|
4
4
|
* Returns a per-call sandbox for inference commands.
|
|
5
5
|
* Network is unrestricted (no network config), writes follow writePolicy.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CommandSandbox } from "
|
|
1
|
+
import type { CommandSandbox } from "../../modules/sandbox/sandboxTypes.js";
|
|
2
2
|
/**
|
|
3
3
|
* Creates a sandbox implementation that does not alter commands.
|
|
4
4
|
* Expects: caller uses this only when provider execution must remain tool-free.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { sandboxPassthrough } from "
|
|
2
|
+
import { sandboxPassthrough } from "../../modules/sandbox/sandboxPassthrough.js";
|
|
3
3
|
describe("sandboxPassthrough", () => {
|
|
4
4
|
it("returns command unchanged", async () => {
|
|
5
5
|
const sandbox = sandboxPassthrough();
|
|
@@ -2,7 +2,7 @@ import { mkdtemp, rm, writeFile } from "node:fs/promises";
|
|
|
2
2
|
import os from "node:os";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { describe, expect, it } from "vitest";
|
|
5
|
-
import { treeChildrenRead } from "
|
|
5
|
+
import { treeChildrenRead } from "../../modules/tree/treeChildrenRead.js";
|
|
6
6
|
describe("treeChildrenRead", () => {
|
|
7
7
|
it("returns null when children.json is missing", async () => {
|
|
8
8
|
const tempDir = await mkdtemp(path.join(os.tmpdir(), "holdmybeer-tree-children-read-"));
|
|
@@ -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 { describe, expect, it } from "vitest";
|
|
5
|
-
import { treeChildrenWrite } from "
|
|
5
|
+
import { treeChildrenWrite } from "../../modules/tree/treeChildrenWrite.js";
|
|
6
6
|
describe("treeChildrenWrite", () => {
|
|
7
7
|
it("creates parent dirs and writes children.json", async () => {
|
|
8
8
|
const tempDir = await mkdtemp(path.join(os.tmpdir(), "holdmybeer-tree-children-write-"));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Context, GenerateEvent } from "
|
|
1
|
+
import type { Context, GenerateEvent } from "../../types.js";
|
|
2
2
|
/**
|
|
3
3
|
* Runs one inference call under a dedicated progress line with event-based status updates.
|
|
4
4
|
* Expects: message is a user-facing base progress label and run forwards onEvent into inference.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { generateProgressMessageResolve } from "
|
|
1
|
+
import { generateProgressMessageResolve } from "../../_workflows/steps/generateProgressMessageResolve.js";
|
|
2
2
|
/**
|
|
3
3
|
* Runs one inference call under a dedicated progress line with event-based status updates.
|
|
4
4
|
* Expects: message is a user-facing base progress label and run forwards onEvent into inference.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it, vi } from "vitest";
|
|
2
|
-
import { treeInferenceProgressRun } from "
|
|
2
|
+
import { treeInferenceProgressRun } from "../../modules/tree/treeInferenceProgressRun.js";
|
|
3
3
|
describe("treeInferenceProgressRun", () => {
|
|
4
4
|
it("maps inference events to progress updates", async () => {
|
|
5
5
|
const updates = [];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Context, TreeNode, TreeSearchConfig } from "
|
|
1
|
+
import type { Context, TreeNode, TreeSearchConfig } from "../../types.js";
|
|
2
2
|
/**
|
|
3
3
|
* Picks the next unexpanded leaf using an inference call over the rendered tree state.
|
|
4
4
|
* Expects: config.rootDir contains persisted tree node metadata.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { text } from "
|
|
2
|
-
import { generateText } from "
|
|
3
|
-
import { treeInferenceProgressRun } from "
|
|
4
|
-
import { treeNodePathResolve } from "
|
|
5
|
-
import { treeNodeRead } from "
|
|
6
|
-
import { treeStateLeaves } from "
|
|
7
|
-
import { treeStateRead } from "
|
|
8
|
-
import { treeStateRender } from "
|
|
1
|
+
import { text } from "../../text/text.js";
|
|
2
|
+
import { generateText } from "../../modules/ai/generateText.js";
|
|
3
|
+
import { treeInferenceProgressRun } from "../../modules/tree/treeInferenceProgressRun.js";
|
|
4
|
+
import { treeNodePathResolve } from "../../modules/tree/treeNodePathResolve.js";
|
|
5
|
+
import { treeNodeRead } from "../../modules/tree/treeNodeRead.js";
|
|
6
|
+
import { treeStateLeaves } from "../../modules/tree/treeStateLeaves.js";
|
|
7
|
+
import { treeStateRead } from "../../modules/tree/treeStateRead.js";
|
|
8
|
+
import { treeStateRender } from "../../modules/tree/treeStateRender.js";
|
|
9
9
|
/**
|
|
10
10
|
* Picks the next unexpanded leaf using an inference call over the rendered tree state.
|
|
11
11
|
* Expects: config.rootDir contains persisted tree node metadata.
|
|
@@ -19,7 +19,7 @@ vi.mock("@/modules/tree/treeStateLeaves.js", () => ({
|
|
|
19
19
|
vi.mock("@/modules/tree/treeNodeRead.js", () => ({
|
|
20
20
|
treeNodeRead: treeNodeReadMock
|
|
21
21
|
}));
|
|
22
|
-
import { treeLeafPick } from "
|
|
22
|
+
import { treeLeafPick } from "../../modules/tree/treeLeafPick.js";
|
|
23
23
|
describe("treeLeafPick", () => {
|
|
24
24
|
beforeEach(() => {
|
|
25
25
|
generateTextMock.mockReset();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Context, TreeChildEntry, TreeNode, TreeSearchConfig } from "
|
|
1
|
+
import type { Context, TreeChildEntry, TreeNode, TreeSearchConfig } from "../../types.js";
|
|
2
2
|
export interface TreeNodeExpandResult {
|
|
3
3
|
children: TreeChildEntry[];
|
|
4
4
|
status: "expanded" | "leaf";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { mkdir, stat } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { textFormatKey } from "
|
|
3
|
+
import { textFormatKey } from "../../text/text.js";
|
|
4
4
|
import matter from "gray-matter";
|
|
5
|
-
import { generateSessionCreate } from "
|
|
6
|
-
import { treeChildrenParse } from "
|
|
7
|
-
import { treeChildrenRead } from "
|
|
8
|
-
import { treeChildrenWrite } from "
|
|
9
|
-
import { treeInferenceProgressRun } from "
|
|
10
|
-
import { treeNodeRead } from "
|
|
11
|
-
import { treeNodeWrite } from "
|
|
5
|
+
import { generateSessionCreate } from "../../modules/ai/generateSessionCreate.js";
|
|
6
|
+
import { treeChildrenParse } from "../../modules/tree/treeChildrenParse.js";
|
|
7
|
+
import { treeChildrenRead } from "../../modules/tree/treeChildrenRead.js";
|
|
8
|
+
import { treeChildrenWrite } from "../../modules/tree/treeChildrenWrite.js";
|
|
9
|
+
import { treeInferenceProgressRun } from "../../modules/tree/treeInferenceProgressRun.js";
|
|
10
|
+
import { treeNodeRead } from "../../modules/tree/treeNodeRead.js";
|
|
11
|
+
import { treeNodeWrite } from "../../modules/tree/treeNodeWrite.js";
|
|
12
12
|
/**
|
|
13
13
|
* Expands a single node by generating its document and children list in one session.
|
|
14
14
|
* Expects: node points to an on-disk tree directory with writable permissions.
|
|
@@ -6,9 +6,9 @@ const generateSessionCreateMock = vi.hoisted(() => vi.fn());
|
|
|
6
6
|
vi.mock("@/modules/ai/generateSessionCreate.js", () => ({
|
|
7
7
|
generateSessionCreate: generateSessionCreateMock
|
|
8
8
|
}));
|
|
9
|
-
import { treeNodeExpand } from "
|
|
10
|
-
import { treeNodeRead } from "
|
|
11
|
-
import { treeNodeWrite } from "
|
|
9
|
+
import { treeNodeExpand } from "../../modules/tree/treeNodeExpand.js";
|
|
10
|
+
import { treeNodeRead } from "../../modules/tree/treeNodeRead.js";
|
|
11
|
+
import { treeNodeWrite } from "../../modules/tree/treeNodeWrite.js";
|
|
12
12
|
describe("treeNodeExpand", () => {
|
|
13
13
|
beforeEach(() => {
|
|
14
14
|
generateSessionCreateMock.mockReset();
|
|
@@ -2,7 +2,7 @@ import { mkdtemp, rm, writeFile } from "node:fs/promises";
|
|
|
2
2
|
import os from "node:os";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { describe, expect, it } from "vitest";
|
|
5
|
-
import { treeNodeRead } from "
|
|
5
|
+
import { treeNodeRead } from "../../modules/tree/treeNodeRead.js";
|
|
6
6
|
describe("treeNodeRead", () => {
|
|
7
7
|
it("returns null when node.json is missing", async () => {
|
|
8
8
|
const tempDir = await mkdtemp(path.join(os.tmpdir(), "holdmybeer-tree-node-read-"));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { treeNodeSlug } from "
|
|
2
|
+
import { treeNodeSlug } from "../../modules/tree/treeNodeSlug.js";
|
|
3
3
|
describe("treeNodeSlug", () => {
|
|
4
4
|
it("converts spaces to hyphen separators", () => {
|
|
5
5
|
expect(treeNodeSlug("Authentication System")).toBe("authentication-system");
|
|
@@ -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 { describe, expect, it } from "vitest";
|
|
5
|
-
import { treeNodeWrite } from "
|
|
5
|
+
import { treeNodeWrite } from "../../modules/tree/treeNodeWrite.js";
|
|
6
6
|
describe("treeNodeWrite", () => {
|
|
7
7
|
it("creates parent dirs and writes node.json", async () => {
|
|
8
8
|
const tempDir = await mkdtemp(path.join(os.tmpdir(), "holdmybeer-tree-node-write-"));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Context, TreeSearchConfig, TreeSearchResult } from "
|
|
1
|
+
import type { Context, TreeSearchConfig, TreeSearchResult } from "../../types.js";
|
|
2
2
|
/**
|
|
3
3
|
* Runs persisted two-phase tree search: root walk, then LLM-guided leaf expansion.
|
|
4
4
|
* Expects: config.documentPrompt/childrenPrompt are deterministic and rootDir is writable.
|