@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
|
@@ -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.
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { mkdir } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { text } from "
|
|
4
|
-
import { generateText } from "
|
|
5
|
-
import { treeChildrenParse } from "
|
|
6
|
-
import { treeChildrenRead } from "
|
|
7
|
-
import { treeChildrenWrite } from "
|
|
8
|
-
import { treeInferenceProgressRun } from "
|
|
9
|
-
import { treeLeafPick } from "
|
|
10
|
-
import { treeNodeExpand } from "
|
|
11
|
-
import { treeNodeRead } from "
|
|
12
|
-
import { treeNodeWrite } from "
|
|
13
|
-
import { treeStateLeaves } from "
|
|
14
|
-
import { treeStateRead } from "
|
|
3
|
+
import { text } from "../../text/text.js";
|
|
4
|
+
import { generateText } from "../../modules/ai/generateText.js";
|
|
5
|
+
import { treeChildrenParse } from "../../modules/tree/treeChildrenParse.js";
|
|
6
|
+
import { treeChildrenRead } from "../../modules/tree/treeChildrenRead.js";
|
|
7
|
+
import { treeChildrenWrite } from "../../modules/tree/treeChildrenWrite.js";
|
|
8
|
+
import { treeInferenceProgressRun } from "../../modules/tree/treeInferenceProgressRun.js";
|
|
9
|
+
import { treeLeafPick } from "../../modules/tree/treeLeafPick.js";
|
|
10
|
+
import { treeNodeExpand } from "../../modules/tree/treeNodeExpand.js";
|
|
11
|
+
import { treeNodeRead } from "../../modules/tree/treeNodeRead.js";
|
|
12
|
+
import { treeNodeWrite } from "../../modules/tree/treeNodeWrite.js";
|
|
13
|
+
import { treeStateLeaves } from "../../modules/tree/treeStateLeaves.js";
|
|
14
|
+
import { treeStateRead } from "../../modules/tree/treeStateRead.js";
|
|
15
15
|
/**
|
|
16
16
|
* Runs persisted two-phase tree search: root walk, then LLM-guided leaf expansion.
|
|
17
17
|
* Expects: config.documentPrompt/childrenPrompt are deterministic and rootDir is writable.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { mkdtemp, readFile, rm } from "node:fs/promises";
|
|
2
2
|
import os from "node:os";
|
|
3
3
|
import path from "node:path";
|
|
4
|
-
import { text } from "
|
|
4
|
+
import { text } from "../../text/text.js";
|
|
5
5
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
6
6
|
const generateTextMock = vi.hoisted(() => vi.fn());
|
|
7
7
|
const treeNodeExpandMock = vi.hoisted(() => vi.fn());
|
|
@@ -15,8 +15,8 @@ vi.mock("@/modules/tree/treeNodeExpand.js", () => ({
|
|
|
15
15
|
vi.mock("@/modules/tree/treeLeafPick.js", () => ({
|
|
16
16
|
treeLeafPick: treeLeafPickMock
|
|
17
17
|
}));
|
|
18
|
-
import { treeNodeRead } from "
|
|
19
|
-
import { treeSearchRun } from "
|
|
18
|
+
import { treeNodeRead } from "../../modules/tree/treeNodeRead.js";
|
|
19
|
+
import { treeSearchRun } from "../../modules/tree/treeSearchRun.js";
|
|
20
20
|
describe("treeSearchRun", () => {
|
|
21
21
|
beforeEach(() => {
|
|
22
22
|
generateTextMock.mockReset();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ZodTypeAny } from "zod";
|
|
2
|
-
import type { ProviderModelSelectionMode } from "
|
|
2
|
+
import type { ProviderModelSelectionMode } from "../../types.js";
|
|
3
3
|
export type TreeNodeStatus = "unexpanded" | "in-progress" | "expanded" | "leaf";
|
|
4
4
|
export interface TreeSearchConfig {
|
|
5
5
|
rootDir: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { treeStateLeaves } from "
|
|
2
|
+
import { treeStateLeaves } from "../../modules/tree/treeStateLeaves.js";
|
|
3
3
|
describe("treeStateLeaves", () => {
|
|
4
4
|
it("returns unexpanded nodes with expanded parents only", () => {
|
|
5
5
|
const tree = [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import { treeChildrenRead } from "
|
|
3
|
-
import { treeNodeRead } from "
|
|
2
|
+
import { treeChildrenRead } from "../../modules/tree/treeChildrenRead.js";
|
|
3
|
+
import { treeNodeRead } from "../../modules/tree/treeNodeRead.js";
|
|
4
4
|
/**
|
|
5
5
|
* Reads persisted tree state from disk starting at root children.json.
|
|
6
6
|
* Expects: rootDir is the tree root directory containing root-level children.json.
|
|
@@ -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 { treeStateRead } from "
|
|
5
|
+
import { treeStateRead } from "../../modules/tree/treeStateRead.js";
|
|
6
6
|
describe("treeStateRead", () => {
|
|
7
7
|
it("returns empty state when root children.json is missing", async () => {
|
|
8
8
|
const tempDir = await mkdtemp(path.join(os.tmpdir(), "holdmybeer-tree-state-read-"));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { treeStateRender } from "
|
|
2
|
+
import { treeStateRender } from "../../modules/tree/treeStateRender.js";
|
|
3
3
|
describe("treeStateRender", () => {
|
|
4
4
|
it("renders indentation and status labels", () => {
|
|
5
5
|
const tree = [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { spawn } from "node:child_process";
|
|
2
|
-
import { textFormatKey } from "
|
|
3
|
-
import { pathResolveFromInitCwd } from "
|
|
2
|
+
import { textFormatKey } from "../../text/text.js";
|
|
3
|
+
import { pathResolveFromInitCwd } from "../../modules/util/pathResolveFromInitCwd.js";
|
|
4
4
|
/**
|
|
5
5
|
* Runs a command and captures stdout/stderr.
|
|
6
6
|
* Throws on non-zero exit unless allowFailure is true.
|
|
@@ -4,7 +4,7 @@ const spawnMock = vi.hoisted(() => vi.fn());
|
|
|
4
4
|
vi.mock("node:child_process", () => ({
|
|
5
5
|
spawn: spawnMock
|
|
6
6
|
}));
|
|
7
|
-
import { commandRun } from "
|
|
7
|
+
import { commandRun } from "../../modules/util/commandRun.js";
|
|
8
8
|
function spawnSuccessChild() {
|
|
9
9
|
const child = new EventEmitter();
|
|
10
10
|
child.stdout = new EventEmitter();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { mkdir, readFile, rename, rm, writeFile } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { AsyncLock } from "
|
|
4
|
-
import { pathLockConflicts } from "
|
|
3
|
+
import { AsyncLock } from "../../modules/util/asyncLock.js";
|
|
4
|
+
import { pathLockConflicts } from "../../modules/util/pathLockOverlap.js";
|
|
5
5
|
/**
|
|
6
6
|
* Coordinates path locks in-memory or through a disk-backed JSON file.
|
|
7
7
|
* Expects: all paths are in the same root namespace (usually repository-relative).
|
|
@@ -2,7 +2,7 @@ import { access, mkdtemp, readFile, rm } 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 { PathLock } from "
|
|
5
|
+
import { PathLock } from "../../modules/util/pathLock.js";
|
|
6
6
|
function pathLockDiskStateParse(raw) {
|
|
7
7
|
return JSON.parse(raw);
|
|
8
8
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { pathLockConflicts, pathLockOverlap } from "
|
|
2
|
+
import { pathLockConflicts, pathLockOverlap } from "../../modules/util/pathLockOverlap.js";
|
|
3
3
|
describe("pathLockOverlap", () => {
|
|
4
4
|
it("matches exact paths", () => {
|
|
5
5
|
expect(pathLockOverlap("src/app.ts", "src/app.ts")).toBe(true);
|
|
@@ -2,9 +2,9 @@ import { spawn } from "node:child_process";
|
|
|
2
2
|
import { readFileSync } from "node:fs";
|
|
3
3
|
import { dirname, resolve } from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
-
import { beerLog, beerLogLine, text } from "
|
|
6
|
-
import { commandRun } from "
|
|
7
|
-
import { releaseVersionPrompt } from "
|
|
5
|
+
import { beerLog, beerLogLine, text } from "../text/text.js";
|
|
6
|
+
import { commandRun } from "../modules/util/commandRun.js";
|
|
7
|
+
import { releaseVersionPrompt } from "../release/releaseVersionPrompt.js";
|
|
8
8
|
const scriptDirectory = dirname(fileURLToPath(import.meta.url));
|
|
9
9
|
const packageDirectory = resolve(scriptDirectory, "../..");
|
|
10
10
|
const repositoryDirectory = resolve(packageDirectory, "../..");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { text, textFormatKey } from "
|
|
2
|
-
import { promptInput } from "
|
|
3
|
-
import { releaseVersionIncrement } from "
|
|
1
|
+
import { text, textFormatKey } from "../text/text.js";
|
|
2
|
+
import { promptInput } from "../modules/prompt/promptInput.js";
|
|
3
|
+
import { releaseVersionIncrement } from "../release/releaseVersionIncrement.js";
|
|
4
4
|
const SEMVER_PATTERN = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;
|
|
5
5
|
/**
|
|
6
6
|
* Resolves the next package version using patch/minor/major/custom mode.
|
package/dist/text/text.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type TextKey, type TextKeysWithoutValues, type TextKeysWithValues, type TextValuesForKey, text } from "
|
|
1
|
+
import { type TextKey, type TextKeysWithoutValues, type TextKeysWithValues, type TextValuesForKey, text } from "../text/text.gen.js";
|
|
2
2
|
type TextFormatValues = Record<string, string | number>;
|
|
3
3
|
export { text };
|
|
4
|
-
export type { TextKey, TextKeysWithoutValues, TextKeysWithValues, TextValuesForKey } from "
|
|
4
|
+
export type { TextKey, TextKeysWithoutValues, TextKeysWithValues, TextValuesForKey } from "../text/text.gen.js";
|
|
5
5
|
/** Replaces {key} placeholders in a template with provided values. */
|
|
6
6
|
export declare function textFormat(template: string, values: TextFormatValues): string;
|
|
7
7
|
/** Formats a catalog entry by key with strongly typed placeholder values. */
|
package/dist/text/text.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { appendFileSync, mkdirSync } from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { text } from "
|
|
3
|
+
import { text } from "../text/text.gen.js";
|
|
4
4
|
export { text };
|
|
5
5
|
/** Replaces {key} placeholders in a template with provided values. */
|
|
6
6
|
export function textFormat(template, values) {
|