diff --git a/artifacts/api-server/package.json b/artifacts/api-server/package.json index 1521dcd..c40f475 100644 --- a/artifacts/api-server/package.json +++ b/artifacts/api-server/package.json @@ -6,7 +6,8 @@ "scripts": { "dev": "NODE_ENV=development tsx ./src/index.ts", "build": "tsx ./build.ts", - "typecheck": "tsc -p tsconfig.json --noEmit" + "typecheck": "tsc -p tsconfig.json --noEmit", + "smoke": "tsx ./src/smoke.ts" }, "dependencies": { "@workspace/db": "workspace:*", diff --git a/artifacts/api-server/src/lib/agent.ts b/artifacts/api-server/src/lib/agent.ts index cfc12e7..950d5c9 100644 --- a/artifacts/api-server/src/lib/agent.ts +++ b/artifacts/api-server/src/lib/agent.ts @@ -1,5 +1,4 @@ import { anthropic } from "@workspace/integrations-anthropic-ai"; -import type Anthropic from "@anthropic-ai/sdk"; export interface EvalResult { accepted: boolean; @@ -33,9 +32,9 @@ ACCEPT if the request is: clear enough to act on, ethical, lawful, and within th REJECT if the request is: harmful, illegal, unethical, incoherent, or spam. Respond ONLY with valid JSON: {"accepted": true, "reason": "..."} or {"accepted": false, "reason": "..."}`, messages: [{ role: "user", content: `Evaluate this request: ${requestText}` }], - } as Parameters[0]); + }); - const block = message.content[0] as Anthropic.TextBlock; + const block = message.content[0]; if (block.type !== "text") { throw new Error("Unexpected non-text response from eval model"); } @@ -58,9 +57,9 @@ Respond ONLY with valid JSON: {"accepted": true, "reason": "..."} or {"accepted" system: `You are Timmy, a capable AI agent. A user has paid for you to handle their request. Fulfill it thoroughly and helpfully. Be concise yet complete.`, messages: [{ role: "user", content: requestText }], - } as Parameters[0]); + }); - const block = message.content[0] as Anthropic.TextBlock; + const block = message.content[0]; if (block.type !== "text") { throw new Error("Unexpected non-text response from work model"); } diff --git a/scripts/src/smoke.ts b/artifacts/api-server/src/smoke.ts similarity index 86% rename from scripts/src/smoke.ts rename to artifacts/api-server/src/smoke.ts index 828f67f..6f991f6 100644 --- a/scripts/src/smoke.ts +++ b/artifacts/api-server/src/smoke.ts @@ -1,9 +1,9 @@ /** * Smoke test: confirms LNbitsService and AgentService are reachable. - * Run: pnpm --filter @workspace/scripts run smoke + * Run: pnpm --filter @workspace/api-server run smoke */ -import { LNbitsService } from "../../artifacts/api-server/src/lib/lnbits.ts"; -import { AgentService } from "../../artifacts/api-server/src/lib/agent.ts"; +import { LNbitsService } from "./lib/lnbits.js"; +import { AgentService } from "./lib/agent.js"; async function smokeLnbits(): Promise { const svc = new LNbitsService(); diff --git a/scripts/package.json b/scripts/package.json index f574b08..3413c78 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -5,12 +5,8 @@ "type": "module", "scripts": { "hello": "tsx ./src/hello.ts", - "smoke": "tsx ./src/smoke.ts", "typecheck": "tsc -p tsconfig.json --noEmit" }, - "dependencies": { - "@workspace/integrations-anthropic-ai": "workspace:*" - }, "devDependencies": { "@types/node": "catalog:", "tsx": "catalog:" diff --git a/scripts/tsconfig.json b/scripts/tsconfig.json index 4e74aff..12e3456 100644 --- a/scripts/tsconfig.json +++ b/scripts/tsconfig.json @@ -5,8 +5,5 @@ "rootDir": "src", "types": ["node"] }, - "include": ["src"], - "references": [ - { "path": "../lib/integrations-anthropic-ai" } - ] + "include": ["src"] }