style: tidy imports and formatting
This commit is contained in:
@@ -164,8 +164,7 @@ export function resolveThinkingDefault(params: {
|
|||||||
const configured = params.cfg.agent?.thinkingDefault;
|
const configured = params.cfg.agent?.thinkingDefault;
|
||||||
if (configured) return configured;
|
if (configured) return configured;
|
||||||
const candidate = params.catalog?.find(
|
const candidate = params.catalog?.find(
|
||||||
(entry) =>
|
(entry) => entry.provider === params.provider && entry.id === params.model,
|
||||||
entry.provider === params.provider && entry.id === params.model,
|
|
||||||
);
|
);
|
||||||
if (candidate?.reasoning) return "low";
|
if (candidate?.reasoning) return "low";
|
||||||
return "off";
|
return "off";
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ vi.mock("../agents/model-catalog.js", () => ({
|
|||||||
loadModelCatalog: vi.fn(),
|
loadModelCatalog: vi.fn(),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
import { runEmbeddedPiAgent } from "../agents/pi-embedded.js";
|
|
||||||
import { loadModelCatalog } from "../agents/model-catalog.js";
|
import { loadModelCatalog } from "../agents/model-catalog.js";
|
||||||
|
import { runEmbeddedPiAgent } from "../agents/pi-embedded.js";
|
||||||
import type { ClawdisConfig } from "../config/config.js";
|
import type { ClawdisConfig } from "../config/config.js";
|
||||||
import * as configModule from "../config/config.js";
|
import * as configModule from "../config/config.js";
|
||||||
import type { RuntimeEnv } from "../runtime.js";
|
import type { RuntimeEnv } from "../runtime.js";
|
||||||
|
|||||||
@@ -393,8 +393,9 @@ describe("Nix integration (U3, U5, U9)", () => {
|
|||||||
describe("U6: gateway port resolution", () => {
|
describe("U6: gateway port resolution", () => {
|
||||||
it("uses default when env and config are unset", async () => {
|
it("uses default when env and config are unset", async () => {
|
||||||
await withEnvOverride({ CLAWDIS_GATEWAY_PORT: undefined }, async () => {
|
await withEnvOverride({ CLAWDIS_GATEWAY_PORT: undefined }, async () => {
|
||||||
const { DEFAULT_GATEWAY_PORT, resolveGatewayPort } =
|
const { DEFAULT_GATEWAY_PORT, resolveGatewayPort } = await import(
|
||||||
await import("./config.js");
|
"./config.js"
|
||||||
|
);
|
||||||
expect(resolveGatewayPort({})).toBe(DEFAULT_GATEWAY_PORT);
|
expect(resolveGatewayPort({})).toBe(DEFAULT_GATEWAY_PORT);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ vi.mock("../agents/model-catalog.js", () => ({
|
|||||||
loadModelCatalog: vi.fn(),
|
loadModelCatalog: vi.fn(),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
import { runEmbeddedPiAgent } from "../agents/pi-embedded.js";
|
|
||||||
import { loadModelCatalog } from "../agents/model-catalog.js";
|
import { loadModelCatalog } from "../agents/model-catalog.js";
|
||||||
|
import { runEmbeddedPiAgent } from "../agents/pi-embedded.js";
|
||||||
import { runCronIsolatedAgentTurn } from "./isolated-agent.js";
|
import { runCronIsolatedAgentTurn } from "./isolated-agent.js";
|
||||||
|
|
||||||
async function withTempHome<T>(fn: (home: string) => Promise<T>): Promise<T> {
|
async function withTempHome<T>(fn: (home: string) => Promise<T>): Promise<T> {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { randomBytes } from "node:crypto";
|
|||||||
import {
|
import {
|
||||||
type ClawdisConfig,
|
type ClawdisConfig,
|
||||||
DEFAULT_GATEWAY_PORT,
|
DEFAULT_GATEWAY_PORT,
|
||||||
HooksGmailTailscaleMode,
|
type HooksGmailTailscaleMode,
|
||||||
resolveGatewayPort,
|
resolveGatewayPort,
|
||||||
} from "../config/config.js";
|
} from "../config/config.js";
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
import { Box, Container, Markdown, Spacer, Text } from "@mariozechner/pi-tui";
|
import { Box, Container, Markdown, Spacer, Text } from "@mariozechner/pi-tui";
|
||||||
import { formatToolDetail, resolveToolDisplay } from "../../agents/tool-display.js";
|
import {
|
||||||
|
formatToolDetail,
|
||||||
|
resolveToolDisplay,
|
||||||
|
} from "../../agents/tool-display.js";
|
||||||
import { markdownTheme, theme } from "../theme/theme.js";
|
import { markdownTheme, theme } from "../theme/theme.js";
|
||||||
|
|
||||||
type ToolResultContent = {
|
type ToolResultContent = {
|
||||||
@@ -106,7 +109,10 @@ export class ToolExecutionComponent extends Container {
|
|||||||
: theme.toolSuccessBg;
|
: theme.toolSuccessBg;
|
||||||
this.box.setBgFn((line) => bg(line));
|
this.box.setBgFn((line) => bg(line));
|
||||||
|
|
||||||
const display = resolveToolDisplay({ name: this.toolName, args: this.args });
|
const display = resolveToolDisplay({
|
||||||
|
name: this.toolName,
|
||||||
|
args: this.args,
|
||||||
|
});
|
||||||
const title = `${display.emoji} ${display.label}${this.isPartial ? " (running)" : ""}`;
|
const title = `${display.emoji} ${display.label}${this.isPartial ? " (running)" : ""}`;
|
||||||
this.header.setText(theme.toolTitle(theme.bold(title)));
|
this.header.setText(theme.toolTitle(theme.bold(title)));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user