chore: integrate proman scaffold
CI / check (pull_request) Failing after 1m47s

- Add proman.yaml with 8 packages in dependency order
- Add @shazhou/proman as devDependency
- Replace root scripts: build/test/check/format → proman commands
- Keep typecheck script for standalone tsc --build

Fixes #27
This commit is contained in:
2026-06-04 03:09:31 +00:00
parent 7b4859594a
commit 90893b0aa8
70 changed files with 201 additions and 123 deletions
@@ -1,4 +1,4 @@
import { describe, expect, test } from 'vitest';
import { describe, expect, test } from "vitest";
import type { LlmToolCall } from "../src/llm/types.js";
/** Mirror OpenAI response shape for parser coverage via chatCompletionWithTools integration later. */
+12 -9
View File
@@ -1,12 +1,15 @@
import { beforeEach, describe, expect, test, vi } from 'vitest';
const { mockChatCompletionWithTools, mockAppendSessionTurn, mockExecuteBuiltinTool } = vi.hoisted(() => ({
mockChatCompletionWithTools: vi.fn(async () => ({
content: "---\nstatus: done\n---",
toolCalls: [],
})),
mockAppendSessionTurn: vi.fn(async () => {}),
mockExecuteBuiltinTool: vi.fn(async () => "tool-result"),
}));
import { beforeEach, describe, expect, test, vi } from "vitest";
const { mockChatCompletionWithTools, mockAppendSessionTurn, mockExecuteBuiltinTool } = vi.hoisted(
() => ({
mockChatCompletionWithTools: vi.fn(async () => ({
content: "---\nstatus: done\n---",
toolCalls: [],
})),
mockAppendSessionTurn: vi.fn(async () => {}),
mockExecuteBuiltinTool: vi.fn(async () => "tool-result"),
}),
);
vi.mock("../src/llm/index.js", () => ({
chatCompletionWithTools: mockChatCompletionWithTools,
@@ -1,5 +1,5 @@
import { describe, expect, test } from 'vitest';
import { resolve } from "node:path";
import { describe, expect, test } from "vitest";
import { resolvePath } from "../src/tools/path.js";
describe("resolvePath", () => {
@@ -1,5 +1,5 @@
import { describe, expect, test } from 'vitest';
import type { AgentContext } from "@united-workforce/util-agent";
import { describe, expect, test } from "vitest";
import { buildBuiltinMessages } from "../src/prompt.js";
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'vitest';
import type { ThreadId } from "@united-workforce/protocol";
import type { AgentContext } from "@united-workforce/util-agent";
import { describe, expect, test } from "vitest";
import { buildClaudeCodePrompt } from "../src/claude-code.js";
function makeCtx(overrides: Partial<AgentContext> = {}): AgentContext {
@@ -1,5 +1,5 @@
import { describe, expect, test } from 'vitest';
import { createMemoryStore, walk } from "@ocas/core";
import { describe, expect, test } from "vitest";
import {
parseClaudeCodeJsonOutput,
parseClaudeCodeStreamOutput,
@@ -1,4 +1,4 @@
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
import { afterEach, beforeEach, describe, expect, it } from "vitest";
import { HermesAcpClient } from "../src/acp-client.js";
describe("handleSessionUpdate — text extraction", () => {
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'vitest';
import type { ThreadId } from "@united-workforce/protocol";
import type { AgentContext } from "@united-workforce/util-agent";
import { describe, expect, test } from "vitest";
import { buildHermesPrompt } from "../src/hermes.js";
function makeCtx(overrides: Partial<AgentContext> = {}): AgentContext {
@@ -1,4 +1,4 @@
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
import { afterEach, beforeEach, describe, expect, it } from "vitest";
import { HermesAcpClient } from "../../src/acp-client.js";
const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
@@ -1,4 +1,4 @@
import { afterEach, describe, expect, it } from 'vitest';
import { afterEach, describe, expect, it } from "vitest";
import { HermesAcpClient } from "../../src/acp-client.js";
/**
@@ -1,8 +1,7 @@
import { describe, expect, test } from 'vitest';
import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
import { readFileSync } from "node:fs";
import { join } from "node:path";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
import { describe, expect, test } from "vitest";
const PKG_ROOT = join(dirname(fileURLToPath(import.meta.url)), "..");
@@ -1,9 +1,9 @@
import { describe, expect, test } from 'vitest';
import { mkdtemp, rm, writeFile } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { DatabaseSync } from "node:sqlite";
import { createMemoryStore, refs, validate, walk } from "@ocas/core";
import { describe, expect, test } from "vitest";
import {
computeDurationMs,
@@ -1,13 +1,12 @@
import { afterEach, beforeEach, describe, expect, test } from 'vitest';
import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
import { execFileSync } from "node:child_process";
import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
import { putSchema } from "@ocas/core";
import { openStore } from "@ocas/fs";
import type { CasRef, StepNodePayload, ThreadId } from "@united-workforce/protocol";
import { afterEach, beforeEach, describe, expect, test } from "vitest";
import { registerUwfSchemas } from "../schemas.js";
import { seedThreads } from "./thread-test-helpers.js";
+1 -1
View File
@@ -1,7 +1,7 @@
import { describe, expect, test } from 'vitest';
import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { describe, expect, test } from "vitest";
import {
cmdConfigGet,
cmdConfigList,
@@ -1,9 +1,9 @@
import { describe, expect, test } from 'vitest';
import { mkdir, rm, writeFile } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { putSchema } from "@ocas/core";
import type { CasRef, ThreadId } from "@united-workforce/protocol";
import { describe, expect, test } from "vitest";
import { createMarker, deleteMarker } from "../background/index.js";
import { cmdThreadList, cmdThreadShow, cmdThreadStart } from "../commands/thread.js";
import {
@@ -1,7 +1,7 @@
import { afterEach, beforeEach, describe, expect, test } from 'vitest';
import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { afterEach, beforeEach, describe, expect, test } from "vitest";
import { parse } from "yaml";
import { createIncludeTag } from "../include.js";
+1 -1
View File
@@ -1,7 +1,7 @@
import { afterEach, beforeEach, describe, expect, test } from 'vitest';
import { mkdir, readdir, rm, writeFile } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { afterEach, beforeEach, describe, expect, test } from "vitest";
import { cmdLogClean, cmdLogList, cmdLogShow } from "../commands/log.js";
let storageRoot: string;
@@ -1,5 +1,5 @@
import { describe, expect, test } from 'vitest';
import type { Target, WorkflowPayload } from "@united-workforce/protocol";
import { describe, expect, test } from "vitest";
import { evaluate } from "../moderator/evaluate.js";
+1 -1
View File
@@ -1,7 +1,7 @@
import { describe, expect, test } from 'vitest';
import { execFileSync } from "node:child_process";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
import { describe, expect, test } from "vitest";
const __dirname = dirname(fileURLToPath(import.meta.url));
@@ -1,8 +1,8 @@
import { afterEach, beforeEach, describe, expect, test } from 'vitest';
import { mkdir, mkdtemp, rm } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { type CasRef, createThreadIndexEntry, type ThreadId } from "@united-workforce/protocol";
import { afterEach, beforeEach, describe, expect, test } from "vitest";
import { resolveHeadHash } from "../commands/shared.js";
import { addHistoryEntry, createUwfStore, setThread } from "../store.js";
@@ -1,8 +1,8 @@
import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest';
import { readFileSync } from "node:fs";
import { mkdtemp, rm } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
import { parse } from "yaml";
import { _agentNameFromBinary, _printAgentMenu, cmdSetup } from "../commands/setup.js";
@@ -80,7 +80,9 @@ describe("cmdSetup agent configuration", () => {
});
test("defaults to hermes agent when no agent specified", async () => {
vi.spyOn(globalThis, "fetch").mockResolvedValue(new Response(JSON.stringify({}), { status: 200 }));
vi.spyOn(globalThis, "fetch").mockResolvedValue(
new Response(JSON.stringify({}), { status: 200 }),
);
const result = await cmdSetup(baseArgs());
@@ -91,7 +93,9 @@ describe("cmdSetup agent configuration", () => {
});
test("writes specified agent as default", async () => {
vi.spyOn(globalThis, "fetch").mockResolvedValue(new Response(JSON.stringify({}), { status: 200 }));
vi.spyOn(globalThis, "fetch").mockResolvedValue(
new Response(JSON.stringify({}), { status: 200 }),
);
const result = await cmdSetup({ ...baseArgs(), agent: "claude-code" });
@@ -102,7 +106,9 @@ describe("cmdSetup agent configuration", () => {
});
test("preserves existing agents when adding new one", async () => {
vi.spyOn(globalThis, "fetch").mockResolvedValue(new Response(JSON.stringify({}), { status: 200 }));
vi.spyOn(globalThis, "fetch").mockResolvedValue(
new Response(JSON.stringify({}), { status: 200 }),
);
// First setup with hermes
await cmdSetup(baseArgs());
@@ -116,7 +122,9 @@ describe("cmdSetup agent configuration", () => {
});
test("updates defaultAgent on re-run with different agent", async () => {
vi.spyOn(globalThis, "fetch").mockResolvedValue(new Response(JSON.stringify({}), { status: 200 }));
vi.spyOn(globalThis, "fetch").mockResolvedValue(
new Response(JSON.stringify({}), { status: 200 }),
);
await cmdSetup(baseArgs());
const config1 = parse(readFileSync(join(storageRoot, "config.yaml"), "utf8"));
@@ -128,7 +136,9 @@ describe("cmdSetup agent configuration", () => {
});
test("normalizes agent name with uwf- prefix to bare name", async () => {
vi.spyOn(globalThis, "fetch").mockResolvedValue(new Response(JSON.stringify({}), { status: 200 }));
vi.spyOn(globalThis, "fetch").mockResolvedValue(
new Response(JSON.stringify({}), { status: 200 }),
);
const result = await cmdSetup({ ...baseArgs(), agent: "uwf-hermes" });
@@ -141,7 +151,9 @@ describe("cmdSetup agent configuration", () => {
});
test("normalizes uwf-claude-code to claude-code", async () => {
vi.spyOn(globalThis, "fetch").mockResolvedValue(new Response(JSON.stringify({}), { status: 200 }));
vi.spyOn(globalThis, "fetch").mockResolvedValue(
new Response(JSON.stringify({}), { status: 200 }),
);
const result = await cmdSetup({ ...baseArgs(), agent: "uwf-claude-code" });
@@ -1,7 +1,7 @@
import { afterEach, describe, expect, test, vi } from 'vitest';
import { mkdirSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { afterEach, describe, expect, test, vi } from "vitest";
import {
_discoverAgents,
_isBackspace,
@@ -1,7 +1,7 @@
import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest';
import { mkdtemp, rm } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
import { cmdSetup, validateModel } from "../commands/setup.js";
describe("validateModel", () => {
@@ -14,9 +14,9 @@ describe("validateModel", () => {
});
test("success path — returns ok on 200", async () => {
const mockFetch = vi.spyOn(globalThis, "fetch").mockResolvedValue(
new Response(JSON.stringify({}), { status: 200 }),
);
const mockFetch = vi
.spyOn(globalThis, "fetch")
.mockResolvedValue(new Response(JSON.stringify({}), { status: 200 }));
const result = await validateModel(BASE_URL, API_KEY, MODEL);
@@ -86,9 +86,9 @@ describe("validateModel", () => {
});
test("request body correctness", async () => {
const mockFetch = vi.spyOn(globalThis, "fetch").mockResolvedValue(
new Response(JSON.stringify({}), { status: 200 }),
);
const mockFetch = vi
.spyOn(globalThis, "fetch")
.mockResolvedValue(new Response(JSON.stringify({}), { status: 200 }));
await validateModel(BASE_URL, API_KEY, "my-special-model");
@@ -122,7 +122,9 @@ describe("cmdSetup with validation", () => {
});
test("includes validation result on success", async () => {
vi.spyOn(globalThis, "fetch").mockResolvedValue(new Response(JSON.stringify({}), { status: 200 }));
vi.spyOn(globalThis, "fetch").mockResolvedValue(
new Response(JSON.stringify({}), { status: 200 }),
);
const result = await cmdSetup(setupArgs());
@@ -1,9 +1,8 @@
import { describe, expect, test } from 'vitest';
import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
import { readFile } from "node:fs/promises";
import { join } from "node:path";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
import type { WorkflowPayload } from "@united-workforce/protocol";
import { describe, expect, test } from "vitest";
import { parse } from "yaml";
/**
@@ -1,4 +1,5 @@
import { describe, expect, test } from 'vitest';
import { describe, expect, test } from "vitest";
/**
* B-group tests: validate JSON parsing logic used by spawnAgent.
*
+1 -1
View File
@@ -1,10 +1,10 @@
import { afterEach, beforeEach, describe, expect, test } from 'vitest';
import { mkdir, mkdtemp, rm } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { bootstrap, putSchema } from "@ocas/core";
import { openStore } from "@ocas/fs";
import type { CasRef } from "@united-workforce/protocol";
import { afterEach, beforeEach, describe, expect, test } from "vitest";
import { cmdStepRead } from "../commands/step.js";
import { registerUwfSchemas } from "../schemas.js";
@@ -1,10 +1,10 @@
import { afterEach, beforeEach, describe, expect, test } from 'vitest';
import { mkdir, mkdtemp, rm } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { bootstrap, type Hash, type JSONSchema, putSchema } from "@ocas/core";
import { openStore } from "@ocas/fs";
import type { CasRef, StepNodePayload } from "@united-workforce/protocol";
import { afterEach, beforeEach, describe, expect, test } from "vitest";
import { cmdStepShow } from "../commands/step.js";
import { formatOutput } from "../format.js";
import { registerUwfSchemas } from "../schemas.js";
@@ -1,4 +1,3 @@
import { afterEach, beforeEach, describe, expect, test } from 'vitest';
import { mkdir, mkdtemp, rm } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
@@ -6,6 +5,7 @@ import { bootstrap, putSchema } from "@ocas/core";
import { openStore } from "@ocas/fs";
import type { CasRef, ThreadId } from "@united-workforce/protocol";
import { STEP_NODE_SCHEMA } from "@united-workforce/protocol";
import { afterEach, beforeEach, describe, expect, test } from "vitest";
import { cmdStepList } from "../commands/step.js";
import { cmdThreadRead } from "../commands/thread.js";
import { registerUwfSchemas } from "../schemas.js";
@@ -1,8 +1,8 @@
import { afterEach, beforeEach, describe, expect, test } from 'vitest';
import { mkdir, rm } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { createThreadIndexEntry, type ThreadId } from "@united-workforce/protocol";
import { afterEach, beforeEach, describe, expect, test } from "vitest";
import {
createUwfStore,
getCasDir,
@@ -1,6 +1,6 @@
import { afterEach, beforeEach, describe, expect, test } from 'vitest';
import { homedir } from "node:os";
import { join } from "node:path";
import { afterEach, beforeEach, describe, expect, test } from "vitest";
import { getDefaultStorageRoot, getGlobalCasDir, resolveStorageRoot } from "../store.js";
describe("Storage root resolution", () => {
@@ -1,8 +1,8 @@
import { describe, expect, test } from 'vitest';
import { mkdir, mkdtemp } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import type { CasRef, ThreadId } from "@united-workforce/protocol";
import { describe, expect, test } from "vitest";
import { addHistoryEntry, createUwfStore, loadAllHistory } from "../store.js";
async function makeUwfStore(storageRoot: string) {
@@ -1,10 +1,10 @@
import { afterEach, beforeEach, describe, expect, test } from 'vitest';
import { mkdir, mkdtemp, rm } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import type { CasRef, ThreadId } from "@united-workforce/protocol";
import { createThreadIndexEntry } from "@united-workforce/protocol";
import { extractUlidTimestamp, generateUlid } from "@united-workforce/util";
import { afterEach, beforeEach, describe, expect, test } from "vitest";
import { createMarker, deleteMarker } from "../background/index.js";
import { cmdThreadList } from "../commands/thread.js";
import { parseTimeInput } from "../commands/thread-time-parser.js";
@@ -1,8 +1,8 @@
import { describe, expect, test } from 'vitest';
import { mkdir, rm, writeFile } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import type { CasRef, StartNodePayload, ThreadId } from "@united-workforce/protocol";
import { describe, expect, test } from "vitest";
import { cmdThreadStart } from "../commands/thread.js";
import { createUwfStore, getThread } from "../store.js";
@@ -1,10 +1,10 @@
import { afterEach, beforeEach, describe, expect, test } from 'vitest';
import { mkdir, mkdtemp, rm } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { bootstrap, putSchema } from "@ocas/core";
import { openStore } from "@ocas/fs";
import type { CasRef, ThreadId } from "@united-workforce/protocol";
import { afterEach, beforeEach, describe, expect, test } from "vitest";
import { cmdThreadRead } from "../commands/thread.js";
import { registerUwfSchemas } from "../schemas.js";
import { seedThreads } from "./thread-test-helpers.js";
@@ -1,9 +1,9 @@
import { afterEach, beforeEach, describe, expect, test } from 'vitest';
import { mkdir, mkdtemp, rm } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { bootstrap, putSchema, type Store } from "@ocas/core";
import type { CasRef, ThreadId } from "@united-workforce/protocol";
import { afterEach, beforeEach, describe, expect, test } from "vitest";
import { cmdThreadRead, THREAD_READ_DEFAULT_QUOTA } from "../commands/thread.js";
import type { UwfStore } from "../store.js";
import { createUwfStore } from "../store.js";
@@ -1,13 +1,12 @@
import { afterEach, beforeEach, describe, expect, test } from 'vitest';
import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
import { execFileSync } from "node:child_process";
import { mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
import { putSchema } from "@ocas/core";
import { openStore } from "@ocas/fs";
import type { CasRef, StepNodePayload, ThreadId } from "@united-workforce/protocol";
import { afterEach, beforeEach, describe, expect, test } from "vitest";
import { cmdThreadShow } from "../commands/thread.js";
import { registerUwfSchemas } from "../schemas.js";
import { seedThreads } from "./thread-test-helpers.js";
@@ -1,9 +1,9 @@
import { describe, expect, test } from 'vitest';
import { mkdir, rm, writeFile } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { putSchema } from "@ocas/core";
import type { CasRef, ThreadId } from "@united-workforce/protocol";
import { describe, expect, test } from "vitest";
import { createMarker, deleteMarker } from "../background/index.js";
import { cmdThreadShow, cmdThreadStart } from "../commands/thread.js";
import {
@@ -1,9 +1,10 @@
import { describe, expect, test } from 'vitest';
import { execFileSync } from "node:child_process";
import { mkdir, rm, writeFile } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
import type { CasRef, StartNodePayload, ThreadId } from "@united-workforce/protocol";
import { describe, expect, test } from "vitest";
import { cmdThreadStart } from "../commands/thread.js";
import { createUwfStore, getThread } from "../store.js";
@@ -133,7 +134,8 @@ graph:
const workflowPath = await createTestWorkflow();
const testCwd = "/test/cli/path";
const uwfBin = join(process.cwd(), "dist", "cli.js");
const pkgRoot = dirname(dirname(dirname(fileURLToPath(import.meta.url))));
const uwfBin = join(pkgRoot, "dist", "cli.js");
// Register the workflow
execFileSync(process.execPath, [uwfBin, "workflow", "add", workflowPath], {
@@ -1,8 +1,7 @@
import { describe, expect, test } from 'vitest';
import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
import { execFileSync } from "node:child_process";
import { join } from "node:path";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
import { describe, expect, test } from "vitest";
const CLI_PATH = join(dirname(fileURLToPath(import.meta.url)), "..", "cli.js");
@@ -1,13 +1,12 @@
import { afterEach, beforeEach, describe, expect, test } from 'vitest';
import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
import { execFileSync } from "node:child_process";
import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
import { putSchema } from "@ocas/core";
import { openStore } from "@ocas/fs";
import type { CasRef, StepNodePayload, ThreadId } from "@united-workforce/protocol";
import { afterEach, beforeEach, describe, expect, test } from "vitest";
import { cmdThreadShow } from "../commands/thread.js";
import { registerUwfSchemas } from "../schemas.js";
import { seedThreads } from "./thread-test-helpers.js";
@@ -1,10 +1,10 @@
import { afterEach, beforeEach, describe, expect, test } from 'vitest';
import { mkdir, mkdtemp, rm } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { putSchema } from "@ocas/core";
import type { ThreadId } from "@united-workforce/protocol";
import { createThreadIndexEntry, markThreadSuspended } from "@united-workforce/protocol";
import { afterEach, beforeEach, describe, expect, test } from "vitest";
import { cmdThreadList, cmdThreadShow } from "../commands/thread.js";
import { createUwfStore } from "../store.js";
import { seedThreads } from "./thread-test-helpers.js";
+1 -1
View File
@@ -1,9 +1,9 @@
import { afterEach, beforeEach, describe, expect, test } from 'vitest';
import { mkdir, mkdtemp, rm } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { bootstrap, putSchema, type Store } from "@ocas/core";
import type { CasRef, ThreadId } from "@united-workforce/protocol";
import { afterEach, beforeEach, describe, expect, test } from "vitest";
import { cmdStepList, cmdStepShow } from "../commands/step.js";
import {
cmdThreadRead,
@@ -1,5 +1,5 @@
import { describe, expect, test } from 'vitest';
import type { WorkflowPayload } from "@united-workforce/protocol";
import { describe, expect, test } from "vitest";
import { validateWorkflow } from "../validate-semantic.js";
/** Build a valid two-role workflow that passes all checks. */
@@ -1,8 +1,8 @@
import { afterEach, beforeEach, describe, expect, test } from 'vitest';
import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import type { CasRef, WorkflowPayload } from "@united-workforce/protocol";
import { afterEach, beforeEach, describe, expect, test } from "vitest";
import { stringify } from "yaml";
import { cmdThreadStart } from "../commands/thread.js";
import type { UwfStore } from "../store.js";
@@ -1,4 +1,4 @@
import { describe, expect, test } from 'vitest';
import { describe, expect, test } from "vitest";
import { evaluate } from "../evaluate.js";
import { isSuspendResult } from "../types.js";
+2 -9
View File
@@ -330,11 +330,7 @@ export function getThread(varStore: VarStore, threadId: ThreadId): ThreadIndexEn
}
/** Set or update a single active thread entry. */
export function setThread(
varStore: VarStore,
threadId: ThreadId,
entry: ThreadIndexEntry,
): void {
export function setThread(varStore: VarStore, threadId: ThreadId, entry: ThreadIndexEntry): void {
const name = threadVarName(threadId);
// Head CAS nodes may use different schemas (StartNode vs StepNode) — clear all variants first.
varStore.remove(name);
@@ -423,10 +419,7 @@ export function loadAllHistory(varStore: VarStore): ThreadHistoryLine[] {
}));
}
export function findHistoryEntry(
varStore: VarStore,
threadId: ThreadId,
): ThreadHistoryLine | null {
export function findHistoryEntry(varStore: VarStore, threadId: ThreadId): ThreadHistoryLine | null {
const vars = varStore.list({ namePrefix: `${HISTORY_VAR_PREFIX}${threadId}` });
const v = vars.find((entry) => entry.name === `${HISTORY_VAR_PREFIX}${threadId}`);
if (v === undefined) {
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest';
import type { Edge, Node } from "@xyflow/react";
import { describe, expect, it } from "vitest";
import { LayoutLR } from "../index.js";
function makeNode(id: string): Node {
@@ -1,4 +1,4 @@
import { describe, expect, it } from 'vitest';
import { describe, expect, it } from "vitest";
import { transIn } from "../trans-in.js";
import type { WorkFlowStep } from "../type.js";
@@ -1,4 +1,4 @@
import { describe, expect, it } from 'vitest';
import { describe, expect, it } from "vitest";
import type { AnyWorkEdge, AnyWorkNode } from "../../type.js";
import { validate } from "../validate.js";
@@ -1,4 +1,4 @@
import { describe, expect, test } from 'vitest';
import { describe, expect, test } from "vitest";
import {
createThreadIndexEntry,
markThreadSuspended,
@@ -1,4 +1,4 @@
import { describe, expect, test } from 'vitest';
import { describe, expect, test } from "vitest";
import type { StartNodePayload, StepRecord, Target } from "../types.js";
describe("Protocol types for thread/edge location", () => {
@@ -1,5 +1,5 @@
import { describe, expect, test } from 'vitest';
import { createMemoryStore, putSchema, bootstrap } from "@ocas/core";
import { bootstrap, createMemoryStore, putSchema } from "@ocas/core";
import { describe, expect, test } from "vitest";
import { tryFrontmatterFastPath } from "../src/frontmatter.js";
@@ -1,5 +1,5 @@
import { describe, expect, test } from 'vitest';
import { createMemoryStore, putSchema, bootstrap } from "@ocas/core";
import { bootstrap, createMemoryStore, putSchema } from "@ocas/core";
import { describe, expect, test } from "vitest";
import { tryFrontmatterFastPath } from "../src/frontmatter.js";
@@ -1,5 +1,5 @@
import { describe, expect, test } from 'vitest';
import type { StepContext } from "@united-workforce/protocol";
import { describe, expect, test } from "vitest";
import { buildContinuationPrompt } from "../src/build-continuation-prompt.js";
const reviewerStep: StepContext = {
@@ -1,4 +1,4 @@
import { describe, expect, test } from 'vitest';
import { describe, expect, test } from "vitest";
import { buildOutputFormatInstruction } from "../src/build-output-format-instruction.js";
const PLANNER_SCHEMA = {
@@ -1,5 +1,5 @@
import { describe, expect, test } from 'vitest';
import type { RoleDefinition } from "@united-workforce/protocol";
import { describe, expect, test } from "vitest";
import { buildRolePrompt } from "../src/build-role-prompt.js";
describe("buildRolePrompt", () => {
@@ -1,4 +1,5 @@
import { describe, expect, test } from 'vitest';
import { describe, expect, test } from "vitest";
// We need to test buildHistory indirectly through buildContext
// since buildHistory is not exported. For now, we'll test the integration
// through the public API in a separate integration test.
@@ -1,5 +1,5 @@
import { describe, expect, test } from 'vitest';
import { createMemoryStore, putSchema, bootstrap } from "@ocas/core";
import { bootstrap, createMemoryStore, putSchema } from "@ocas/core";
import { describe, expect, test } from "vitest";
import { tryFrontmatterFastPath } from "../src/frontmatter.js";
@@ -1,5 +1,5 @@
import { describe, expect, test } from 'vitest';
import type { WorkflowConfig } from "@united-workforce/protocol";
import { describe, expect, test } from "vitest";
import { resolveExtractModelAlias } from "../src/extract.js";
function baseConfig(overrides: Partial<WorkflowConfig> = {}): WorkflowConfig {
@@ -1,7 +1,7 @@
import { afterEach, beforeEach, describe, expect, test } from 'vitest';
import { mkdir, readdir, readFile, rm, stat, writeFile } from "node:fs/promises";
import { dirname, join } from "node:path";
import type { ThreadId } from "@united-workforce/protocol";
import { afterEach, beforeEach, describe, expect, test } from "vitest";
import { getCachedSessionId, getCachePath, setCachedSessionId } from "../src/session-cache.js";
import { resolveStorageRoot } from "../src/storage.js";
@@ -1,4 +1,5 @@
import { afterEach, beforeEach, describe, expect, test } from 'vitest';
import { afterEach, beforeEach, describe, expect, test } from "vitest";
describe("parseArgv empty prompt error message", () => {
let stderrOutput: string;
let _exitCode: number | null;
+1 -1
View File
@@ -1,4 +1,4 @@
import { describe, expect, it } from 'vitest';
import { describe, expect, it } from "vitest";
import { env } from "../src/env.js";
describe("env", () => {
@@ -1,4 +1,4 @@
import { describe, expect, it } from 'vitest';
import { describe, expect, it } from "vitest";
import type { AgentFrontmatter } from "../src/index.js";
import { parseFrontmatterMarkdown, validateFrontmatter } from "../src/index.js";
@@ -1,7 +1,7 @@
import { afterEach, describe, expect, test } from 'vitest';
import { mkdirSync, mkdtempSync, readFileSync, rmSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { afterEach, describe, expect, test } from "vitest";
import { createProcessLogger } from "../src/process-logger/index.js";
@@ -1,4 +1,4 @@
import { describe, expect, it } from 'vitest';
import { describe, expect, it } from "vitest";
import { extractUlidTimestamp, generateUlid } from "../ulid.js";
describe("extractUlidTimestamp", () => {