style: biome formatting
This commit is contained in:
@@ -43,7 +43,6 @@ import {
|
||||
createClawdisCodingTools,
|
||||
sanitizeContentBlocksImages,
|
||||
} from "./pi-tools.js";
|
||||
import { SteerableProviderTransport } from "./steerable-provider-transport.js";
|
||||
import {
|
||||
applySkillEnvOverrides,
|
||||
applySkillEnvOverridesFromSnapshot,
|
||||
@@ -51,6 +50,7 @@ import {
|
||||
loadWorkspaceSkillEntries,
|
||||
type SkillSnapshot,
|
||||
} from "./skills.js";
|
||||
import { SteerableProviderTransport } from "./steerable-provider-transport.js";
|
||||
import { buildAgentSystemPrompt } from "./system-prompt.js";
|
||||
import { loadWorkspaceBootstrapFiles } from "./workspace.js";
|
||||
|
||||
|
||||
@@ -1,18 +1,15 @@
|
||||
import {
|
||||
agentLoop,
|
||||
agentLoopContinue,
|
||||
} from "./steerable-agent-loop.js";
|
||||
import type {
|
||||
AgentRunConfig,
|
||||
AgentTransport,
|
||||
ProviderTransportOptions,
|
||||
} from "@mariozechner/pi-agent-core";
|
||||
import type {
|
||||
AgentContext,
|
||||
AgentLoopConfig,
|
||||
Message,
|
||||
UserMessage,
|
||||
} from "@mariozechner/pi-ai";
|
||||
import type {
|
||||
AgentRunConfig,
|
||||
AgentTransport,
|
||||
} from "@mariozechner/pi-agent-core";
|
||||
import type { ProviderTransportOptions } from "@mariozechner/pi-agent-core";
|
||||
import { agentLoop, agentLoopContinue } from "./steerable-agent-loop.js";
|
||||
|
||||
export class SteerableProviderTransport implements AgentTransport {
|
||||
private options: ProviderTransportOptions;
|
||||
|
||||
@@ -759,7 +759,10 @@ export async function getReplyFromConfig(
|
||||
.join("\n\n")
|
||||
: baseBodyFinal;
|
||||
const queuedBody = mediaNote
|
||||
? [mediaNote, mediaReplyHint, queueBodyBase].filter(Boolean).join("\n").trim()
|
||||
? [mediaNote, mediaReplyHint, queueBodyBase]
|
||||
.filter(Boolean)
|
||||
.join("\n")
|
||||
.trim()
|
||||
: queueBodyBase;
|
||||
|
||||
if (queueEmbeddedPiMessage(sessionIdFinal, queuedBody)) {
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
import { createServer } from "node:http";
|
||||
import { type AddressInfo } from "node:net";
|
||||
import fs from "node:fs/promises";
|
||||
import { createServer } from "node:http";
|
||||
import type { AddressInfo } from "node:net";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { WebSocket } from "ws";
|
||||
import { defaultRuntime } from "../runtime.js";
|
||||
import { createCanvasHostHandler, startCanvasHost } from "./server.js";
|
||||
import {
|
||||
CANVAS_HOST_PATH,
|
||||
CANVAS_WS_PATH,
|
||||
injectCanvasLiveReload,
|
||||
} from "./a2ui.js";
|
||||
import { createCanvasHostHandler, startCanvasHost } from "./server.js";
|
||||
|
||||
describe("canvas host", () => {
|
||||
it("injects live reload script", () => {
|
||||
@@ -80,9 +80,7 @@ describe("canvas host", () => {
|
||||
const port = (server.address() as AddressInfo).port;
|
||||
|
||||
try {
|
||||
const res = await fetch(
|
||||
`http://127.0.0.1:${port}${CANVAS_HOST_PATH}/`,
|
||||
);
|
||||
const res = await fetch(`http://127.0.0.1:${port}${CANVAS_HOST_PATH}/`);
|
||||
const html = await res.text();
|
||||
expect(res.status).toBe(200);
|
||||
expect(html).toContain("v1");
|
||||
|
||||
@@ -48,7 +48,11 @@ export type CanvasHostHandler = {
|
||||
req: IncomingMessage,
|
||||
res: ServerResponse,
|
||||
) => Promise<boolean>;
|
||||
handleUpgrade: (req: IncomingMessage, socket: Socket, head: Buffer) => boolean;
|
||||
handleUpgrade: (
|
||||
req: IncomingMessage,
|
||||
socket: Socket,
|
||||
head: Buffer,
|
||||
) => boolean;
|
||||
close: () => Promise<void>;
|
||||
};
|
||||
|
||||
|
||||
@@ -55,9 +55,9 @@ const bridgeListConnected = vi.hoisted(() =>
|
||||
vi.fn(() => [] as BridgeClientInfo[]),
|
||||
);
|
||||
const bridgeSendEvent = vi.hoisted(() => vi.fn());
|
||||
const testTailnetIPv4 = vi.hoisted(
|
||||
() => ({ value: undefined as string | undefined }),
|
||||
);
|
||||
const testTailnetIPv4 = vi.hoisted(() => ({
|
||||
value: undefined as string | undefined,
|
||||
}));
|
||||
vi.mock("../infra/bridge/server.js", () => ({
|
||||
startNodeBridgeServer: vi.fn(async (opts: BridgeStartOpts) => {
|
||||
bridgeStartCalls.push(opts);
|
||||
|
||||
@@ -18,7 +18,10 @@ import {
|
||||
normalizeThinkLevel,
|
||||
normalizeVerboseLevel,
|
||||
} from "../auto-reply/thinking.js";
|
||||
import { handleA2uiHttpRequest, CANVAS_HOST_PATH } from "../canvas-host/a2ui.js";
|
||||
import {
|
||||
CANVAS_HOST_PATH,
|
||||
handleA2uiHttpRequest,
|
||||
} from "../canvas-host/a2ui.js";
|
||||
import {
|
||||
type CanvasHostHandler,
|
||||
createCanvasHostHandler,
|
||||
@@ -2380,7 +2383,10 @@ export async function startGatewayServer(
|
||||
const remoteAddr = (
|
||||
socket as WebSocket & { _socket?: { remoteAddress?: string } }
|
||||
)._socket?.remoteAddress;
|
||||
const canvasHostUrl = deriveCanvasHostUrl(req, canvasHost ? port : undefined);
|
||||
const canvasHostUrl = deriveCanvasHostUrl(
|
||||
req,
|
||||
canvasHost ? port : undefined,
|
||||
);
|
||||
logWs("in", "open", { connId, remoteAddr });
|
||||
const isWebchatConnect = (params: ConnectParams | null | undefined) =>
|
||||
params?.client?.mode === "webchat" ||
|
||||
|
||||
Reference in New Issue
Block a user