Merge pull request 'chore: integrate proman scaffold' (#32) from chore/27-proman-integration into main
CI / check (push) Failing after 1m40s
CI / check (push) Failing after 1m40s
chore: integrate proman scaffold (#32)
This commit was merged in pull request #32.
This commit is contained in:
@@ -14,3 +14,4 @@ packages/workflow-template-develop/develop.esm.js
|
|||||||
.claude
|
.claude
|
||||||
tmp.worktrees/
|
tmp.worktrees/
|
||||||
.worktrees/
|
.worktrees/
|
||||||
|
false/
|
||||||
|
|||||||
+4
-2
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://biomejs.dev/schemas/2.4.14/schema.json",
|
"$schema": "https://biomejs.dev/schemas/2.4.16/schema.json",
|
||||||
"files": {
|
"files": {
|
||||||
"includes": [
|
"includes": [
|
||||||
"**",
|
"**",
|
||||||
@@ -9,7 +9,9 @@
|
|||||||
"!**/legacy-packages",
|
"!**/legacy-packages",
|
||||||
"!scripts",
|
"!scripts",
|
||||||
"!packages/workflow/workflow",
|
"!packages/workflow/workflow",
|
||||||
"!xiaoju/scripts/bundle.ts"
|
"!xiaoju/scripts/bundle.ts",
|
||||||
|
"!false",
|
||||||
|
"!.pnpm-approved-builds.json"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"assist": { "actions": { "source": { "organizeImports": "on" } } },
|
"assist": { "actions": { "source": { "organizeImports": "on" } } },
|
||||||
|
|||||||
+5
-4
@@ -7,11 +7,11 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"uwf": "pnpm tsx packages/cli/src/cli.ts",
|
"uwf": "pnpm tsx packages/cli/src/cli.ts",
|
||||||
"prepublishOnly": "echo 'Use pnpm run release instead' && exit 1",
|
"prepublishOnly": "echo 'Use pnpm run release instead' && exit 1",
|
||||||
"build": "npx tsc --build",
|
"build": "proman build",
|
||||||
"check": "npx tsc --build && biome check . && bash scripts/lint-log-tags.sh",
|
"check": "proman check",
|
||||||
"typecheck": "npx tsc --build",
|
"typecheck": "npx tsc --build",
|
||||||
"format": "biome format --write .",
|
"format": "proman format",
|
||||||
"test": "pnpm -r run test",
|
"test": "proman test",
|
||||||
"test:ci": "pnpm -r run test:ci",
|
"test:ci": "pnpm -r run test:ci",
|
||||||
"changeset": "npx changeset",
|
"changeset": "npx changeset",
|
||||||
"version": "npx changeset version",
|
"version": "npx changeset version",
|
||||||
@@ -21,6 +21,7 @@
|
|||||||
"@agentclientprotocol/sdk": "^0.22.1",
|
"@agentclientprotocol/sdk": "^0.22.1",
|
||||||
"@biomejs/biome": "^2.4.14",
|
"@biomejs/biome": "^2.4.14",
|
||||||
"@changesets/cli": "^2.31.0",
|
"@changesets/cli": "^2.31.0",
|
||||||
|
"@shazhou/proman": "^0.5.1",
|
||||||
"@types/node": "^25.7.0",
|
"@types/node": "^25.7.0",
|
||||||
"@types/xxhashjs": "^0.2.4",
|
"@types/xxhashjs": "^0.2.4",
|
||||||
"@united-workforce/agent-hermes": "workspace:*",
|
"@united-workforce/agent-hermes": "workspace:*",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { describe, expect, test } from 'vitest';
|
import { describe, expect, test } from "vitest";
|
||||||
import type { LlmToolCall } from "../src/llm/types.js";
|
import type { LlmToolCall } from "../src/llm/types.js";
|
||||||
|
|
||||||
/** Mirror OpenAI response shape for parser coverage via chatCompletionWithTools integration later. */
|
/** Mirror OpenAI response shape for parser coverage via chatCompletionWithTools integration later. */
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
import { beforeEach, describe, expect, test, vi } from 'vitest';
|
import { beforeEach, describe, expect, test, vi } from "vitest";
|
||||||
const { mockChatCompletionWithTools, mockAppendSessionTurn, mockExecuteBuiltinTool } = vi.hoisted(() => ({
|
|
||||||
mockChatCompletionWithTools: vi.fn(async () => ({
|
const { mockChatCompletionWithTools, mockAppendSessionTurn, mockExecuteBuiltinTool } = vi.hoisted(
|
||||||
content: "---\nstatus: done\n---",
|
() => ({
|
||||||
toolCalls: [],
|
mockChatCompletionWithTools: vi.fn(async () => ({
|
||||||
})),
|
content: "---\nstatus: done\n---",
|
||||||
mockAppendSessionTurn: vi.fn(async () => {}),
|
toolCalls: [],
|
||||||
mockExecuteBuiltinTool: vi.fn(async () => "tool-result"),
|
})),
|
||||||
}));
|
mockAppendSessionTurn: vi.fn(async () => {}),
|
||||||
|
mockExecuteBuiltinTool: vi.fn(async () => "tool-result"),
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
vi.mock("../src/llm/index.js", () => ({
|
vi.mock("../src/llm/index.js", () => ({
|
||||||
chatCompletionWithTools: mockChatCompletionWithTools,
|
chatCompletionWithTools: mockChatCompletionWithTools,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { describe, expect, test } from 'vitest';
|
|
||||||
import { resolve } from "node:path";
|
import { resolve } from "node:path";
|
||||||
|
import { describe, expect, test } from "vitest";
|
||||||
import { resolvePath } from "../src/tools/path.js";
|
import { resolvePath } from "../src/tools/path.js";
|
||||||
|
|
||||||
describe("resolvePath", () => {
|
describe("resolvePath", () => {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { describe, expect, test } from 'vitest';
|
|
||||||
import type { AgentContext } from "@united-workforce/util-agent";
|
import type { AgentContext } from "@united-workforce/util-agent";
|
||||||
|
import { describe, expect, test } from "vitest";
|
||||||
|
|
||||||
import { buildBuiltinMessages } from "../src/prompt.js";
|
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 { ThreadId } from "@united-workforce/protocol";
|
||||||
import type { AgentContext } from "@united-workforce/util-agent";
|
import type { AgentContext } from "@united-workforce/util-agent";
|
||||||
|
import { describe, expect, test } from "vitest";
|
||||||
import { buildClaudeCodePrompt } from "../src/claude-code.js";
|
import { buildClaudeCodePrompt } from "../src/claude-code.js";
|
||||||
|
|
||||||
function makeCtx(overrides: Partial<AgentContext> = {}): AgentContext {
|
function makeCtx(overrides: Partial<AgentContext> = {}): AgentContext {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { describe, expect, test } from 'vitest';
|
|
||||||
import { createMemoryStore, walk } from "@ocas/core";
|
import { createMemoryStore, walk } from "@ocas/core";
|
||||||
|
import { describe, expect, test } from "vitest";
|
||||||
import {
|
import {
|
||||||
parseClaudeCodeJsonOutput,
|
parseClaudeCodeJsonOutput,
|
||||||
parseClaudeCodeStreamOutput,
|
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";
|
import { HermesAcpClient } from "../src/acp-client.js";
|
||||||
|
|
||||||
describe("handleSessionUpdate — text extraction", () => {
|
describe("handleSessionUpdate — text extraction", () => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { describe, expect, test } from 'vitest';
|
|
||||||
import type { ThreadId } from "@united-workforce/protocol";
|
import type { ThreadId } from "@united-workforce/protocol";
|
||||||
import type { AgentContext } from "@united-workforce/util-agent";
|
import type { AgentContext } from "@united-workforce/util-agent";
|
||||||
|
import { describe, expect, test } from "vitest";
|
||||||
import { buildHermesPrompt } from "../src/hermes.js";
|
import { buildHermesPrompt } from "../src/hermes.js";
|
||||||
|
|
||||||
function makeCtx(overrides: Partial<AgentContext> = {}): AgentContext {
|
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";
|
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;
|
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";
|
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 { 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)), "..");
|
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 { mkdtemp, rm, writeFile } from "node:fs/promises";
|
||||||
import { tmpdir } from "node:os";
|
import { tmpdir } from "node:os";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
import { DatabaseSync } from "node:sqlite";
|
import { DatabaseSync } from "node:sqlite";
|
||||||
import { createMemoryStore, refs, validate, walk } from "@ocas/core";
|
import { createMemoryStore, refs, validate, walk } from "@ocas/core";
|
||||||
|
import { describe, expect, test } from "vitest";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
computeDurationMs,
|
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 { execFileSync } from "node:child_process";
|
||||||
import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
|
import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
|
||||||
import { tmpdir } from "node:os";
|
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 { putSchema } from "@ocas/core";
|
||||||
import { openStore } from "@ocas/fs";
|
import { openStore } from "@ocas/fs";
|
||||||
import type { CasRef, StepNodePayload, ThreadId } from "@united-workforce/protocol";
|
import type { CasRef, StepNodePayload, ThreadId } from "@united-workforce/protocol";
|
||||||
|
import { afterEach, beforeEach, describe, expect, test } from "vitest";
|
||||||
import { registerUwfSchemas } from "../schemas.js";
|
import { registerUwfSchemas } from "../schemas.js";
|
||||||
import { seedThreads } from "./thread-test-helpers.js";
|
import { seedThreads } from "./thread-test-helpers.js";
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { describe, expect, test } from 'vitest';
|
|
||||||
import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
||||||
import { tmpdir } from "node:os";
|
import { tmpdir } from "node:os";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
|
import { describe, expect, test } from "vitest";
|
||||||
import {
|
import {
|
||||||
cmdConfigGet,
|
cmdConfigGet,
|
||||||
cmdConfigList,
|
cmdConfigList,
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { describe, expect, test } from 'vitest';
|
|
||||||
import { mkdir, rm, writeFile } from "node:fs/promises";
|
import { mkdir, rm, writeFile } from "node:fs/promises";
|
||||||
import { tmpdir } from "node:os";
|
import { tmpdir } from "node:os";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
import { putSchema } from "@ocas/core";
|
import { putSchema } from "@ocas/core";
|
||||||
import type { CasRef, ThreadId } from "@united-workforce/protocol";
|
import type { CasRef, ThreadId } from "@united-workforce/protocol";
|
||||||
|
import { describe, expect, test } from "vitest";
|
||||||
import { createMarker, deleteMarker } from "../background/index.js";
|
import { createMarker, deleteMarker } from "../background/index.js";
|
||||||
import { cmdThreadList, cmdThreadShow, cmdThreadStart } from "../commands/thread.js";
|
import { cmdThreadList, cmdThreadShow, cmdThreadStart } from "../commands/thread.js";
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { afterEach, beforeEach, describe, expect, test } from 'vitest';
|
|
||||||
import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
|
import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
|
||||||
import { tmpdir } from "node:os";
|
import { tmpdir } from "node:os";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
|
import { afterEach, beforeEach, describe, expect, test } from "vitest";
|
||||||
import { parse } from "yaml";
|
import { parse } from "yaml";
|
||||||
import { createIncludeTag } from "../include.js";
|
import { createIncludeTag } from "../include.js";
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { afterEach, beforeEach, describe, expect, test } from 'vitest';
|
|
||||||
import { mkdir, readdir, rm, writeFile } from "node:fs/promises";
|
import { mkdir, readdir, rm, writeFile } from "node:fs/promises";
|
||||||
import { tmpdir } from "node:os";
|
import { tmpdir } from "node:os";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
|
import { afterEach, beforeEach, describe, expect, test } from "vitest";
|
||||||
import { cmdLogClean, cmdLogList, cmdLogShow } from "../commands/log.js";
|
import { cmdLogClean, cmdLogList, cmdLogShow } from "../commands/log.js";
|
||||||
|
|
||||||
let storageRoot: string;
|
let storageRoot: string;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { describe, expect, test } from 'vitest';
|
|
||||||
import type { Target, WorkflowPayload } from "@united-workforce/protocol";
|
import type { Target, WorkflowPayload } from "@united-workforce/protocol";
|
||||||
|
import { describe, expect, test } from "vitest";
|
||||||
|
|
||||||
import { evaluate } from "../moderator/evaluate.js";
|
import { evaluate } from "../moderator/evaluate.js";
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { describe, expect, test } from 'vitest';
|
|
||||||
import { execFileSync } from "node:child_process";
|
import { execFileSync } from "node:child_process";
|
||||||
import { dirname, join } from "node:path";
|
import { dirname, join } from "node:path";
|
||||||
import { fileURLToPath } from "node:url";
|
import { fileURLToPath } from "node:url";
|
||||||
|
import { describe, expect, test } from "vitest";
|
||||||
|
|
||||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
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 { mkdir, mkdtemp, rm } from "node:fs/promises";
|
||||||
import { tmpdir } from "node:os";
|
import { tmpdir } from "node:os";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
import { type CasRef, createThreadIndexEntry, type ThreadId } from "@united-workforce/protocol";
|
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 { resolveHeadHash } from "../commands/shared.js";
|
||||||
import { addHistoryEntry, createUwfStore, setThread } from "../store.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 { readFileSync } from "node:fs";
|
||||||
import { mkdtemp, rm } from "node:fs/promises";
|
import { mkdtemp, rm } from "node:fs/promises";
|
||||||
import { tmpdir } from "node:os";
|
import { tmpdir } from "node:os";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
|
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
|
||||||
import { parse } from "yaml";
|
import { parse } from "yaml";
|
||||||
import { _agentNameFromBinary, _printAgentMenu, cmdSetup } from "../commands/setup.js";
|
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 () => {
|
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());
|
const result = await cmdSetup(baseArgs());
|
||||||
|
|
||||||
@@ -91,7 +93,9 @@ describe("cmdSetup agent configuration", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("writes specified agent as default", async () => {
|
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" });
|
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 () => {
|
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
|
// First setup with hermes
|
||||||
await cmdSetup(baseArgs());
|
await cmdSetup(baseArgs());
|
||||||
@@ -116,7 +122,9 @@ describe("cmdSetup agent configuration", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("updates defaultAgent on re-run with different agent", async () => {
|
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());
|
await cmdSetup(baseArgs());
|
||||||
const config1 = parse(readFileSync(join(storageRoot, "config.yaml"), "utf8"));
|
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 () => {
|
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" });
|
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 () => {
|
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" });
|
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 { mkdirSync, writeFileSync } from "node:fs";
|
||||||
import { tmpdir } from "node:os";
|
import { tmpdir } from "node:os";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
|
import { afterEach, describe, expect, test, vi } from "vitest";
|
||||||
import {
|
import {
|
||||||
_discoverAgents,
|
_discoverAgents,
|
||||||
_isBackspace,
|
_isBackspace,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest';
|
|
||||||
import { mkdtemp, rm } from "node:fs/promises";
|
import { mkdtemp, rm } from "node:fs/promises";
|
||||||
import { tmpdir } from "node:os";
|
import { tmpdir } from "node:os";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
|
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
|
||||||
import { cmdSetup, validateModel } from "../commands/setup.js";
|
import { cmdSetup, validateModel } from "../commands/setup.js";
|
||||||
|
|
||||||
describe("validateModel", () => {
|
describe("validateModel", () => {
|
||||||
@@ -14,9 +14,9 @@ describe("validateModel", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("success path — returns ok on 200", async () => {
|
test("success path — returns ok on 200", async () => {
|
||||||
const mockFetch = vi.spyOn(globalThis, "fetch").mockResolvedValue(
|
const mockFetch = vi
|
||||||
new Response(JSON.stringify({}), { status: 200 }),
|
.spyOn(globalThis, "fetch")
|
||||||
);
|
.mockResolvedValue(new Response(JSON.stringify({}), { status: 200 }));
|
||||||
|
|
||||||
const result = await validateModel(BASE_URL, API_KEY, MODEL);
|
const result = await validateModel(BASE_URL, API_KEY, MODEL);
|
||||||
|
|
||||||
@@ -86,9 +86,9 @@ describe("validateModel", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("request body correctness", async () => {
|
test("request body correctness", async () => {
|
||||||
const mockFetch = vi.spyOn(globalThis, "fetch").mockResolvedValue(
|
const mockFetch = vi
|
||||||
new Response(JSON.stringify({}), { status: 200 }),
|
.spyOn(globalThis, "fetch")
|
||||||
);
|
.mockResolvedValue(new Response(JSON.stringify({}), { status: 200 }));
|
||||||
|
|
||||||
await validateModel(BASE_URL, API_KEY, "my-special-model");
|
await validateModel(BASE_URL, API_KEY, "my-special-model");
|
||||||
|
|
||||||
@@ -122,7 +122,9 @@ describe("cmdSetup with validation", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("includes validation result on success", async () => {
|
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());
|
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 { 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 type { WorkflowPayload } from "@united-workforce/protocol";
|
||||||
|
import { describe, expect, test } from "vitest";
|
||||||
import { parse } from "yaml";
|
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.
|
* B-group tests: validate JSON parsing logic used by spawnAgent.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { afterEach, beforeEach, describe, expect, test } from 'vitest';
|
|
||||||
import { mkdir, mkdtemp, rm } from "node:fs/promises";
|
import { mkdir, mkdtemp, rm } from "node:fs/promises";
|
||||||
import { tmpdir } from "node:os";
|
import { tmpdir } from "node:os";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
import { bootstrap, putSchema } from "@ocas/core";
|
import { bootstrap, putSchema } from "@ocas/core";
|
||||||
import { openStore } from "@ocas/fs";
|
import { openStore } from "@ocas/fs";
|
||||||
import type { CasRef } from "@united-workforce/protocol";
|
import type { CasRef } from "@united-workforce/protocol";
|
||||||
|
import { afterEach, beforeEach, describe, expect, test } from "vitest";
|
||||||
import { cmdStepRead } from "../commands/step.js";
|
import { cmdStepRead } from "../commands/step.js";
|
||||||
import { registerUwfSchemas } from "../schemas.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 { mkdir, mkdtemp, rm } from "node:fs/promises";
|
||||||
import { tmpdir } from "node:os";
|
import { tmpdir } from "node:os";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
import { bootstrap, type Hash, type JSONSchema, putSchema } from "@ocas/core";
|
import { bootstrap, type Hash, type JSONSchema, putSchema } from "@ocas/core";
|
||||||
import { openStore } from "@ocas/fs";
|
import { openStore } from "@ocas/fs";
|
||||||
import type { CasRef, StepNodePayload } from "@united-workforce/protocol";
|
import type { CasRef, StepNodePayload } from "@united-workforce/protocol";
|
||||||
|
import { afterEach, beforeEach, describe, expect, test } from "vitest";
|
||||||
import { cmdStepShow } from "../commands/step.js";
|
import { cmdStepShow } from "../commands/step.js";
|
||||||
import { formatOutput } from "../format.js";
|
import { formatOutput } from "../format.js";
|
||||||
import { registerUwfSchemas } from "../schemas.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 { mkdir, mkdtemp, rm } from "node:fs/promises";
|
||||||
import { tmpdir } from "node:os";
|
import { tmpdir } from "node:os";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
@@ -6,6 +5,7 @@ import { bootstrap, putSchema } from "@ocas/core";
|
|||||||
import { openStore } from "@ocas/fs";
|
import { openStore } from "@ocas/fs";
|
||||||
import type { CasRef, ThreadId } from "@united-workforce/protocol";
|
import type { CasRef, ThreadId } from "@united-workforce/protocol";
|
||||||
import { STEP_NODE_SCHEMA } 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 { cmdStepList } from "../commands/step.js";
|
||||||
import { cmdThreadRead } from "../commands/thread.js";
|
import { cmdThreadRead } from "../commands/thread.js";
|
||||||
import { registerUwfSchemas } from "../schemas.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 { mkdir, rm } from "node:fs/promises";
|
||||||
import { tmpdir } from "node:os";
|
import { tmpdir } from "node:os";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
import { createThreadIndexEntry, type ThreadId } from "@united-workforce/protocol";
|
import { createThreadIndexEntry, type ThreadId } from "@united-workforce/protocol";
|
||||||
|
import { afterEach, beforeEach, describe, expect, test } from "vitest";
|
||||||
import {
|
import {
|
||||||
createUwfStore,
|
createUwfStore,
|
||||||
getCasDir,
|
getCasDir,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { afterEach, beforeEach, describe, expect, test } from 'vitest';
|
|
||||||
import { homedir } from "node:os";
|
import { homedir } from "node:os";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
|
import { afterEach, beforeEach, describe, expect, test } from "vitest";
|
||||||
import { getDefaultStorageRoot, getGlobalCasDir, resolveStorageRoot } from "../store.js";
|
import { getDefaultStorageRoot, getGlobalCasDir, resolveStorageRoot } from "../store.js";
|
||||||
|
|
||||||
describe("Storage root resolution", () => {
|
describe("Storage root resolution", () => {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { describe, expect, test } from 'vitest';
|
|
||||||
import { mkdir, mkdtemp } from "node:fs/promises";
|
import { mkdir, mkdtemp } from "node:fs/promises";
|
||||||
import { tmpdir } from "node:os";
|
import { tmpdir } from "node:os";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
import type { CasRef, ThreadId } from "@united-workforce/protocol";
|
import type { CasRef, ThreadId } from "@united-workforce/protocol";
|
||||||
|
import { describe, expect, test } from "vitest";
|
||||||
import { addHistoryEntry, createUwfStore, loadAllHistory } from "../store.js";
|
import { addHistoryEntry, createUwfStore, loadAllHistory } from "../store.js";
|
||||||
|
|
||||||
async function makeUwfStore(storageRoot: string) {
|
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 { mkdir, mkdtemp, rm } from "node:fs/promises";
|
||||||
import { tmpdir } from "node:os";
|
import { tmpdir } from "node:os";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
import type { CasRef, ThreadId } from "@united-workforce/protocol";
|
import type { CasRef, ThreadId } from "@united-workforce/protocol";
|
||||||
import { createThreadIndexEntry } from "@united-workforce/protocol";
|
import { createThreadIndexEntry } from "@united-workforce/protocol";
|
||||||
import { extractUlidTimestamp, generateUlid } from "@united-workforce/util";
|
import { extractUlidTimestamp, generateUlid } from "@united-workforce/util";
|
||||||
|
import { afterEach, beforeEach, describe, expect, test } from "vitest";
|
||||||
import { createMarker, deleteMarker } from "../background/index.js";
|
import { createMarker, deleteMarker } from "../background/index.js";
|
||||||
import { cmdThreadList } from "../commands/thread.js";
|
import { cmdThreadList } from "../commands/thread.js";
|
||||||
import { parseTimeInput } from "../commands/thread-time-parser.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 { mkdir, rm, writeFile } from "node:fs/promises";
|
||||||
import { tmpdir } from "node:os";
|
import { tmpdir } from "node:os";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
import type { CasRef, StartNodePayload, ThreadId } from "@united-workforce/protocol";
|
import type { CasRef, StartNodePayload, ThreadId } from "@united-workforce/protocol";
|
||||||
|
import { describe, expect, test } from "vitest";
|
||||||
import { cmdThreadStart } from "../commands/thread.js";
|
import { cmdThreadStart } from "../commands/thread.js";
|
||||||
import { createUwfStore, getThread } from "../store.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 { mkdir, mkdtemp, rm } from "node:fs/promises";
|
||||||
import { tmpdir } from "node:os";
|
import { tmpdir } from "node:os";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
import { bootstrap, putSchema } from "@ocas/core";
|
import { bootstrap, putSchema } from "@ocas/core";
|
||||||
import { openStore } from "@ocas/fs";
|
import { openStore } from "@ocas/fs";
|
||||||
import type { CasRef, ThreadId } from "@united-workforce/protocol";
|
import type { CasRef, ThreadId } from "@united-workforce/protocol";
|
||||||
|
import { afterEach, beforeEach, describe, expect, test } from "vitest";
|
||||||
import { cmdThreadRead } from "../commands/thread.js";
|
import { cmdThreadRead } from "../commands/thread.js";
|
||||||
import { registerUwfSchemas } from "../schemas.js";
|
import { registerUwfSchemas } from "../schemas.js";
|
||||||
import { seedThreads } from "./thread-test-helpers.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 { mkdir, mkdtemp, rm } from "node:fs/promises";
|
||||||
import { tmpdir } from "node:os";
|
import { tmpdir } from "node:os";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
import { bootstrap, putSchema, type Store } from "@ocas/core";
|
import { bootstrap, putSchema, type Store } from "@ocas/core";
|
||||||
import type { CasRef, ThreadId } from "@united-workforce/protocol";
|
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 { cmdThreadRead, THREAD_READ_DEFAULT_QUOTA } from "../commands/thread.js";
|
||||||
import type { UwfStore } from "../store.js";
|
import type { UwfStore } from "../store.js";
|
||||||
import { createUwfStore } 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 { execFileSync } from "node:child_process";
|
||||||
import { mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
|
import { mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
|
||||||
import { tmpdir } from "node:os";
|
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 { putSchema } from "@ocas/core";
|
||||||
import { openStore } from "@ocas/fs";
|
import { openStore } from "@ocas/fs";
|
||||||
import type { CasRef, StepNodePayload, ThreadId } from "@united-workforce/protocol";
|
import type { CasRef, StepNodePayload, ThreadId } from "@united-workforce/protocol";
|
||||||
|
import { afterEach, beforeEach, describe, expect, test } from "vitest";
|
||||||
import { cmdThreadShow } from "../commands/thread.js";
|
import { cmdThreadShow } from "../commands/thread.js";
|
||||||
import { registerUwfSchemas } from "../schemas.js";
|
import { registerUwfSchemas } from "../schemas.js";
|
||||||
import { seedThreads } from "./thread-test-helpers.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 { mkdir, rm, writeFile } from "node:fs/promises";
|
||||||
import { tmpdir } from "node:os";
|
import { tmpdir } from "node:os";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
import { putSchema } from "@ocas/core";
|
import { putSchema } from "@ocas/core";
|
||||||
import type { CasRef, ThreadId } from "@united-workforce/protocol";
|
import type { CasRef, ThreadId } from "@united-workforce/protocol";
|
||||||
|
import { describe, expect, test } from "vitest";
|
||||||
import { createMarker, deleteMarker } from "../background/index.js";
|
import { createMarker, deleteMarker } from "../background/index.js";
|
||||||
import { cmdThreadShow, cmdThreadStart } from "../commands/thread.js";
|
import { cmdThreadShow, cmdThreadStart } from "../commands/thread.js";
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
import { describe, expect, test } from 'vitest';
|
|
||||||
import { execFileSync } from "node:child_process";
|
import { execFileSync } from "node:child_process";
|
||||||
import { mkdir, rm, writeFile } from "node:fs/promises";
|
import { mkdir, rm, writeFile } from "node:fs/promises";
|
||||||
import { tmpdir } from "node:os";
|
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 type { CasRef, StartNodePayload, ThreadId } from "@united-workforce/protocol";
|
||||||
|
import { describe, expect, test } from "vitest";
|
||||||
import { cmdThreadStart } from "../commands/thread.js";
|
import { cmdThreadStart } from "../commands/thread.js";
|
||||||
import { createUwfStore, getThread } from "../store.js";
|
import { createUwfStore, getThread } from "../store.js";
|
||||||
|
|
||||||
@@ -133,7 +134,8 @@ graph:
|
|||||||
|
|
||||||
const workflowPath = await createTestWorkflow();
|
const workflowPath = await createTestWorkflow();
|
||||||
const testCwd = "/test/cli/path";
|
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
|
// Register the workflow
|
||||||
execFileSync(process.execPath, [uwfBin, "workflow", "add", workflowPath], {
|
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 { 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");
|
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 { execFileSync } from "node:child_process";
|
||||||
import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
|
import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
|
||||||
import { tmpdir } from "node:os";
|
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 { putSchema } from "@ocas/core";
|
||||||
import { openStore } from "@ocas/fs";
|
import { openStore } from "@ocas/fs";
|
||||||
import type { CasRef, StepNodePayload, ThreadId } from "@united-workforce/protocol";
|
import type { CasRef, StepNodePayload, ThreadId } from "@united-workforce/protocol";
|
||||||
|
import { afterEach, beforeEach, describe, expect, test } from "vitest";
|
||||||
import { cmdThreadShow } from "../commands/thread.js";
|
import { cmdThreadShow } from "../commands/thread.js";
|
||||||
import { registerUwfSchemas } from "../schemas.js";
|
import { registerUwfSchemas } from "../schemas.js";
|
||||||
import { seedThreads } from "./thread-test-helpers.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 { mkdir, mkdtemp, rm } from "node:fs/promises";
|
||||||
import { tmpdir } from "node:os";
|
import { tmpdir } from "node:os";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
import { putSchema } from "@ocas/core";
|
import { putSchema } from "@ocas/core";
|
||||||
import type { ThreadId } from "@united-workforce/protocol";
|
import type { ThreadId } from "@united-workforce/protocol";
|
||||||
import { createThreadIndexEntry, markThreadSuspended } 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 { cmdThreadList, cmdThreadShow } from "../commands/thread.js";
|
||||||
import { createUwfStore } from "../store.js";
|
import { createUwfStore } from "../store.js";
|
||||||
import { seedThreads } from "./thread-test-helpers.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 { mkdir, mkdtemp, rm } from "node:fs/promises";
|
||||||
import { tmpdir } from "node:os";
|
import { tmpdir } from "node:os";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
import { bootstrap, putSchema, type Store } from "@ocas/core";
|
import { bootstrap, putSchema, type Store } from "@ocas/core";
|
||||||
import type { CasRef, ThreadId } from "@united-workforce/protocol";
|
import type { CasRef, ThreadId } from "@united-workforce/protocol";
|
||||||
|
import { afterEach, beforeEach, describe, expect, test } from "vitest";
|
||||||
import { cmdStepList, cmdStepShow } from "../commands/step.js";
|
import { cmdStepList, cmdStepShow } from "../commands/step.js";
|
||||||
import {
|
import {
|
||||||
cmdThreadRead,
|
cmdThreadRead,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { describe, expect, test } from 'vitest';
|
|
||||||
import type { WorkflowPayload } from "@united-workforce/protocol";
|
import type { WorkflowPayload } from "@united-workforce/protocol";
|
||||||
|
import { describe, expect, test } from "vitest";
|
||||||
import { validateWorkflow } from "../validate-semantic.js";
|
import { validateWorkflow } from "../validate-semantic.js";
|
||||||
|
|
||||||
/** Build a valid two-role workflow that passes all checks. */
|
/** 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 { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
|
||||||
import { tmpdir } from "node:os";
|
import { tmpdir } from "node:os";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
import type { CasRef, WorkflowPayload } from "@united-workforce/protocol";
|
import type { CasRef, WorkflowPayload } from "@united-workforce/protocol";
|
||||||
|
import { afterEach, beforeEach, describe, expect, test } from "vitest";
|
||||||
import { stringify } from "yaml";
|
import { stringify } from "yaml";
|
||||||
import { cmdThreadStart } from "../commands/thread.js";
|
import { cmdThreadStart } from "../commands/thread.js";
|
||||||
import type { UwfStore } from "../store.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 { evaluate } from "../evaluate.js";
|
||||||
import { isSuspendResult } from "../types.js";
|
import { isSuspendResult } from "../types.js";
|
||||||
|
|
||||||
|
|||||||
@@ -330,11 +330,7 @@ export function getThread(varStore: VarStore, threadId: ThreadId): ThreadIndexEn
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Set or update a single active thread entry. */
|
/** Set or update a single active thread entry. */
|
||||||
export function setThread(
|
export function setThread(varStore: VarStore, threadId: ThreadId, entry: ThreadIndexEntry): void {
|
||||||
varStore: VarStore,
|
|
||||||
threadId: ThreadId,
|
|
||||||
entry: ThreadIndexEntry,
|
|
||||||
): void {
|
|
||||||
const name = threadVarName(threadId);
|
const name = threadVarName(threadId);
|
||||||
// Head CAS nodes may use different schemas (StartNode vs StepNode) — clear all variants first.
|
// Head CAS nodes may use different schemas (StartNode vs StepNode) — clear all variants first.
|
||||||
varStore.remove(name);
|
varStore.remove(name);
|
||||||
@@ -423,10 +419,7 @@ export function loadAllHistory(varStore: VarStore): ThreadHistoryLine[] {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
export function findHistoryEntry(
|
export function findHistoryEntry(varStore: VarStore, threadId: ThreadId): ThreadHistoryLine | null {
|
||||||
varStore: VarStore,
|
|
||||||
threadId: ThreadId,
|
|
||||||
): ThreadHistoryLine | null {
|
|
||||||
const vars = varStore.list({ namePrefix: `${HISTORY_VAR_PREFIX}${threadId}` });
|
const vars = varStore.list({ namePrefix: `${HISTORY_VAR_PREFIX}${threadId}` });
|
||||||
const v = vars.find((entry) => entry.name === `${HISTORY_VAR_PREFIX}${threadId}`);
|
const v = vars.find((entry) => entry.name === `${HISTORY_VAR_PREFIX}${threadId}`);
|
||||||
if (v === undefined) {
|
if (v === undefined) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { describe, expect, it } from 'vitest';
|
|
||||||
import type { Edge, Node } from "@xyflow/react";
|
import type { Edge, Node } from "@xyflow/react";
|
||||||
|
import { describe, expect, it } from "vitest";
|
||||||
import { LayoutLR } from "../index.js";
|
import { LayoutLR } from "../index.js";
|
||||||
|
|
||||||
function makeNode(id: string): Node {
|
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 { transIn } from "../trans-in.js";
|
||||||
import type { WorkFlowStep } from "../type.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 type { AnyWorkEdge, AnyWorkNode } from "../../type.js";
|
||||||
import { validate } from "../validate.js";
|
import { validate } from "../validate.js";
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { describe, expect, test } from 'vitest';
|
import { describe, expect, test } from "vitest";
|
||||||
import {
|
import {
|
||||||
createThreadIndexEntry,
|
createThreadIndexEntry,
|
||||||
markThreadSuspended,
|
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";
|
import type { StartNodePayload, StepRecord, Target } from "../types.js";
|
||||||
|
|
||||||
describe("Protocol types for thread/edge location", () => {
|
describe("Protocol types for thread/edge location", () => {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { describe, expect, test } from 'vitest';
|
import { bootstrap, createMemoryStore, putSchema } from "@ocas/core";
|
||||||
import { createMemoryStore, putSchema, bootstrap } from "@ocas/core";
|
import { describe, expect, test } from "vitest";
|
||||||
|
|
||||||
import { tryFrontmatterFastPath } from "../src/frontmatter.js";
|
import { tryFrontmatterFastPath } from "../src/frontmatter.js";
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { describe, expect, test } from 'vitest';
|
import { bootstrap, createMemoryStore, putSchema } from "@ocas/core";
|
||||||
import { createMemoryStore, putSchema, bootstrap } from "@ocas/core";
|
import { describe, expect, test } from "vitest";
|
||||||
|
|
||||||
import { tryFrontmatterFastPath } from "../src/frontmatter.js";
|
import { tryFrontmatterFastPath } from "../src/frontmatter.js";
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { describe, expect, test } from 'vitest';
|
|
||||||
import type { StepContext } from "@united-workforce/protocol";
|
import type { StepContext } from "@united-workforce/protocol";
|
||||||
|
import { describe, expect, test } from "vitest";
|
||||||
import { buildContinuationPrompt } from "../src/build-continuation-prompt.js";
|
import { buildContinuationPrompt } from "../src/build-continuation-prompt.js";
|
||||||
|
|
||||||
const reviewerStep: StepContext = {
|
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";
|
import { buildOutputFormatInstruction } from "../src/build-output-format-instruction.js";
|
||||||
|
|
||||||
const PLANNER_SCHEMA = {
|
const PLANNER_SCHEMA = {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { describe, expect, test } from 'vitest';
|
|
||||||
import type { RoleDefinition } from "@united-workforce/protocol";
|
import type { RoleDefinition } from "@united-workforce/protocol";
|
||||||
|
import { describe, expect, test } from "vitest";
|
||||||
import { buildRolePrompt } from "../src/build-role-prompt.js";
|
import { buildRolePrompt } from "../src/build-role-prompt.js";
|
||||||
|
|
||||||
describe("buildRolePrompt", () => {
|
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
|
// We need to test buildHistory indirectly through buildContext
|
||||||
// since buildHistory is not exported. For now, we'll test the integration
|
// since buildHistory is not exported. For now, we'll test the integration
|
||||||
// through the public API in a separate integration test.
|
// through the public API in a separate integration test.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { describe, expect, test } from 'vitest';
|
import { bootstrap, createMemoryStore, putSchema } from "@ocas/core";
|
||||||
import { createMemoryStore, putSchema, bootstrap } from "@ocas/core";
|
import { describe, expect, test } from "vitest";
|
||||||
|
|
||||||
import { tryFrontmatterFastPath } from "../src/frontmatter.js";
|
import { tryFrontmatterFastPath } from "../src/frontmatter.js";
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { describe, expect, test } from 'vitest';
|
|
||||||
import type { WorkflowConfig } from "@united-workforce/protocol";
|
import type { WorkflowConfig } from "@united-workforce/protocol";
|
||||||
|
import { describe, expect, test } from "vitest";
|
||||||
import { resolveExtractModelAlias } from "../src/extract.js";
|
import { resolveExtractModelAlias } from "../src/extract.js";
|
||||||
|
|
||||||
function baseConfig(overrides: Partial<WorkflowConfig> = {}): WorkflowConfig {
|
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 { mkdir, readdir, readFile, rm, stat, writeFile } from "node:fs/promises";
|
||||||
import { dirname, join } from "node:path";
|
import { dirname, join } from "node:path";
|
||||||
import type { ThreadId } from "@united-workforce/protocol";
|
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 { getCachedSessionId, getCachePath, setCachedSessionId } from "../src/session-cache.js";
|
||||||
import { resolveStorageRoot } from "../src/storage.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", () => {
|
describe("parseArgv empty prompt error message", () => {
|
||||||
let stderrOutput: string;
|
let stderrOutput: string;
|
||||||
let _exitCode: number | null;
|
let _exitCode: number | null;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { describe, expect, it } from 'vitest';
|
import { describe, expect, it } from "vitest";
|
||||||
import { env } from "../src/env.js";
|
import { env } from "../src/env.js";
|
||||||
|
|
||||||
describe("env", () => {
|
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 type { AgentFrontmatter } from "../src/index.js";
|
||||||
import { parseFrontmatterMarkdown, validateFrontmatter } 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 { mkdirSync, mkdtempSync, readFileSync, rmSync } from "node:fs";
|
||||||
import { tmpdir } from "node:os";
|
import { tmpdir } from "node:os";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
|
import { afterEach, describe, expect, test } from "vitest";
|
||||||
|
|
||||||
import { createProcessLogger } from "../src/process-logger/index.js";
|
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";
|
import { extractUlidTimestamp, generateUlid } from "../ulid.js";
|
||||||
|
|
||||||
describe("extractUlidTimestamp", () => {
|
describe("extractUlidTimestamp", () => {
|
||||||
|
|||||||
Generated
+27
@@ -17,6 +17,9 @@ importers:
|
|||||||
'@changesets/cli':
|
'@changesets/cli':
|
||||||
specifier: ^2.31.0
|
specifier: ^2.31.0
|
||||||
version: 2.31.0(@types/node@25.9.1)
|
version: 2.31.0(@types/node@25.9.1)
|
||||||
|
'@shazhou/proman':
|
||||||
|
specifier: ^0.5.1
|
||||||
|
version: 0.5.1(@biomejs/biome@2.4.16)(typescript@5.9.3)(vite@7.3.5(@types/node@25.9.1)(jiti@2.7.0)(lightningcss@1.32.0)(yaml@2.9.0))(vitest@3.2.6(@types/node@25.9.1)(jiti@2.7.0)(lightningcss@1.32.0)(msw@2.14.6(@types/node@25.9.1)(typescript@5.9.3))(yaml@2.9.0))
|
||||||
'@types/node':
|
'@types/node':
|
||||||
specifier: ^25.7.0
|
specifier: ^25.7.0
|
||||||
version: 25.9.1
|
version: 25.9.1
|
||||||
@@ -1092,6 +1095,21 @@ packages:
|
|||||||
'@sec-ant/readable-stream@0.4.1':
|
'@sec-ant/readable-stream@0.4.1':
|
||||||
resolution: {integrity: sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==}
|
resolution: {integrity: sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==}
|
||||||
|
|
||||||
|
'@shazhou/proman@0.5.1':
|
||||||
|
resolution: {integrity: sha512-GmFUvd8SAOUW/eaDIEh31pVKSE3XhbgHOZ5vSpX4xS+F8Zl6lAfhgVCjcjRK8w5d43tsH47CVorwyxQcRaJFfA==}
|
||||||
|
hasBin: true
|
||||||
|
peerDependencies:
|
||||||
|
'@biomejs/biome': ^2.0.0
|
||||||
|
typescript: ^5.0.0
|
||||||
|
vite: ^6.0.0
|
||||||
|
vitest: ^4.0.0
|
||||||
|
wrangler: ^3.0.0
|
||||||
|
peerDependenciesMeta:
|
||||||
|
vite:
|
||||||
|
optional: true
|
||||||
|
wrangler:
|
||||||
|
optional: true
|
||||||
|
|
||||||
'@sinclair/typebox@0.34.49':
|
'@sinclair/typebox@0.34.49':
|
||||||
resolution: {integrity: sha512-brySQQs7Jtn0joV8Xh9ZV/hZb9Ozb0pmazDIASBkYKCjXrXU3mpcFahmK/z4YDhGkQvP9mWJbVyahdtU5wQA+A==}
|
resolution: {integrity: sha512-brySQQs7Jtn0joV8Xh9ZV/hZb9Ozb0pmazDIASBkYKCjXrXU3mpcFahmK/z4YDhGkQvP9mWJbVyahdtU5wQA+A==}
|
||||||
|
|
||||||
@@ -3911,6 +3929,15 @@ snapshots:
|
|||||||
|
|
||||||
'@sec-ant/readable-stream@0.4.1': {}
|
'@sec-ant/readable-stream@0.4.1': {}
|
||||||
|
|
||||||
|
'@shazhou/proman@0.5.1(@biomejs/biome@2.4.16)(typescript@5.9.3)(vite@7.3.5(@types/node@25.9.1)(jiti@2.7.0)(lightningcss@1.32.0)(yaml@2.9.0))(vitest@3.2.6(@types/node@25.9.1)(jiti@2.7.0)(lightningcss@1.32.0)(msw@2.14.6(@types/node@25.9.1)(typescript@5.9.3))(yaml@2.9.0))':
|
||||||
|
dependencies:
|
||||||
|
'@biomejs/biome': 2.4.16
|
||||||
|
typescript: 5.9.3
|
||||||
|
vitest: 3.2.6(@types/node@25.9.1)(jiti@2.7.0)(lightningcss@1.32.0)(msw@2.14.6(@types/node@25.9.1)(typescript@5.9.3))(yaml@2.9.0)
|
||||||
|
yaml: 2.9.0
|
||||||
|
optionalDependencies:
|
||||||
|
vite: 7.3.5(@types/node@25.9.1)(jiti@2.7.0)(lightningcss@1.32.0)(yaml@2.9.0)
|
||||||
|
|
||||||
'@sinclair/typebox@0.34.49': {}
|
'@sinclair/typebox@0.34.49': {}
|
||||||
|
|
||||||
'@sindresorhus/merge-streams@4.0.0': {}
|
'@sindresorhus/merge-streams@4.0.0': {}
|
||||||
|
|||||||
+38
@@ -0,0 +1,38 @@
|
|||||||
|
packages:
|
||||||
|
- name: "@united-workforce/protocol"
|
||||||
|
path: packages/protocol
|
||||||
|
type: lib
|
||||||
|
|
||||||
|
- name: "@united-workforce/util"
|
||||||
|
path: packages/util
|
||||||
|
type: lib
|
||||||
|
|
||||||
|
- name: "@united-workforce/util-agent"
|
||||||
|
path: packages/util-agent
|
||||||
|
type: lib
|
||||||
|
|
||||||
|
- name: "@united-workforce/agent-hermes"
|
||||||
|
path: packages/agent-hermes
|
||||||
|
type: cli
|
||||||
|
|
||||||
|
- name: "@united-workforce/agent-claude-code"
|
||||||
|
path: packages/agent-claude-code
|
||||||
|
type: cli
|
||||||
|
|
||||||
|
- name: "@united-workforce/agent-builtin"
|
||||||
|
path: packages/agent-builtin
|
||||||
|
type: cli
|
||||||
|
|
||||||
|
- name: "@united-workforce/cli"
|
||||||
|
path: packages/cli
|
||||||
|
type: cli
|
||||||
|
|
||||||
|
- name: "@united-workforce/dashboard"
|
||||||
|
path: packages/dashboard
|
||||||
|
type: webui
|
||||||
|
private: true
|
||||||
|
|
||||||
|
release:
|
||||||
|
registry: https://registry.npmjs.org
|
||||||
|
access: public
|
||||||
|
gitTagPrefix: v
|
||||||
Reference in New Issue
Block a user