chore: upgrade @ocas/* to ^0.3.0, migrate better-sqlite3 → node:sqlite
CI / check (pull_request) Failing after 1m13s
CI / check (pull_request) Failing after 1m13s
- @ocas/core and @ocas/fs upgraded from ^0.2.2 to ^0.3.0 - agent-hermes: replace better-sqlite3 with node:sqlite (DatabaseSync) - Remove better-sqlite3 and @types/better-sqlite3 dependencies - Fix remaining bun references in cli test helpers (execFileSync) Refs #28
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
"test:ci": "vitest run __tests__/"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ocas/core": "^0.2.2",
|
||||
"@ocas/core": "^0.3.0",
|
||||
"@united-workforce/util": "workspace:^",
|
||||
"@united-workforce/util-agent": "workspace:^"
|
||||
},
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
"test:ci": "vitest run __tests__/"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ocas/core": "^0.2.2",
|
||||
"@ocas/core": "^0.3.0",
|
||||
"@united-workforce/util": "workspace:^",
|
||||
"@united-workforce/util-agent": "workspace:^"
|
||||
},
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import Database from "better-sqlite3";
|
||||
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 {
|
||||
@@ -133,10 +133,10 @@ describe("storeHermesSessionDetail", () => {
|
||||
|
||||
// ── SQLite fallback tests ──────────────────────────────────────────
|
||||
|
||||
type TestDb = InstanceType<typeof Database>;
|
||||
type TestDb = DatabaseSync;
|
||||
|
||||
function createTestDb(dbPath: string): TestDb {
|
||||
const db = new Database(dbPath);
|
||||
const db = new DatabaseSync(dbPath);
|
||||
db.exec(`CREATE TABLE sessions (
|
||||
id TEXT PRIMARY KEY,
|
||||
model TEXT NOT NULL,
|
||||
|
||||
@@ -22,14 +22,12 @@
|
||||
"test:ci": "vitest run __tests__/"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ocas/core": "^0.2.2",
|
||||
"@ocas/core": "^0.3.0",
|
||||
"@united-workforce/protocol": "workspace:^",
|
||||
"@united-workforce/util": "workspace:^",
|
||||
"@united-workforce/util-agent": "workspace:^",
|
||||
"better-sqlite3": "^12.10.0"
|
||||
"@united-workforce/util-agent": "workspace:^"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/better-sqlite3": "^7.6.13",
|
||||
"typescript": "^5.8.3"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Database from "better-sqlite3";
|
||||
import { readFile } from "node:fs/promises";
|
||||
import { homedir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { DatabaseSync } from "node:sqlite";
|
||||
|
||||
import { bootstrap, putSchema, type Store } from "@ocas/core";
|
||||
|
||||
@@ -152,9 +152,9 @@ export function loadHermesSessionFromDb(
|
||||
dbPath: string | null = null,
|
||||
): HermesSessionJson | null {
|
||||
const resolvedPath = dbPath ?? getHermesDbPath();
|
||||
let db: InstanceType<typeof Database> | null = null;
|
||||
let db: DatabaseSync | null = null;
|
||||
try {
|
||||
db = new Database(resolvedPath, { readonly: true });
|
||||
db = new DatabaseSync(resolvedPath, { readOnly: true });
|
||||
const session = db
|
||||
.prepare("SELECT id, model, started_at FROM sessions WHERE id = ?")
|
||||
.get(sessionId) as DbSessionRow | null;
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
"uwf": "./dist/cli.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ocas/core": "^0.2.2",
|
||||
"@ocas/fs": "^0.2.2",
|
||||
"@ocas/core": "^0.3.0",
|
||||
"@ocas/fs": "^0.3.0",
|
||||
"@united-workforce/protocol": "workspace:^",
|
||||
"@united-workforce/util": "workspace:^",
|
||||
"@united-workforce/util-agent": "workspace:^",
|
||||
|
||||
@@ -89,7 +89,7 @@ describe("prompt commands", () => {
|
||||
});
|
||||
|
||||
test("prompt help subcommand is suppressed", () => {
|
||||
const output = execFileSync("bun", ["src/cli.ts", "prompt", "--help"], {
|
||||
const output = execFileSync("npx", ["tsx", "src/cli.ts", "prompt", "--help"], {
|
||||
cwd: join(__dirname, "..", ".."),
|
||||
encoding: "utf-8",
|
||||
env: { ...process.env, PATH: `/opt/homebrew/bin:${process.env.PATH}` },
|
||||
|
||||
@@ -8,7 +8,7 @@ const CLI_PATH = join(dirname(fileURLToPath(import.meta.url)), "..", "cli.js");
|
||||
|
||||
function runCli(args: string[]): { stdout: string; stderr: string; exitCode: number } {
|
||||
try {
|
||||
const stdout = execFileSync("bun", ["run", CLI_PATH, ...args], {
|
||||
const stdout = execFileSync("npx", ["tsx", CLI_PATH, ...args], {
|
||||
encoding: "utf8",
|
||||
env: { ...process.env, WORKFLOW_STORAGE_ROOT: "/tmp/uwf-test-nonexistent" },
|
||||
stdio: ["ignore", "pipe", "pipe"],
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
"test:ci": "vitest run src/__tests__/"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ocas/core": "^0.2.2",
|
||||
"@ocas/fs": "^0.2.2"
|
||||
"@ocas/core": "^0.3.0",
|
||||
"@ocas/fs": "^0.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.8.3"
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
"test:ci": "vitest run __tests__/ src/__tests__/"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ocas/core": "^0.2.2",
|
||||
"@ocas/fs": "^0.2.2",
|
||||
"@ocas/core": "^0.3.0",
|
||||
"@ocas/fs": "^0.3.0",
|
||||
"@united-workforce/protocol": "workspace:^",
|
||||
"@united-workforce/util": "workspace:^",
|
||||
"dotenv": "^16.6.1",
|
||||
|
||||
Reference in New Issue
Block a user