style: oxfmt fixes (#925) (thanks @grp06)
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
import { resolveChannelDefaultAccountId } from "../channels/plugins/helpers.js";
|
import { resolveChannelDefaultAccountId } from "../channels/plugins/helpers.js";
|
||||||
import { getChannelPlugin, listChannelPlugins, normalizeChannelId } from "../channels/plugins/index.js";
|
import {
|
||||||
|
getChannelPlugin,
|
||||||
|
listChannelPlugins,
|
||||||
|
normalizeChannelId,
|
||||||
|
} from "../channels/plugins/index.js";
|
||||||
import type { ChannelId } from "../channels/plugins/types.js";
|
import type { ChannelId } from "../channels/plugins/types.js";
|
||||||
import type { ClawdbotConfig } from "../config/config.js";
|
import type { ClawdbotConfig } from "../config/config.js";
|
||||||
import type { AgentBinding } from "../config/types.js";
|
import type { AgentBinding } from "../config/types.js";
|
||||||
|
|||||||
@@ -9,10 +9,7 @@ describe("sandbox docker config", () => {
|
|||||||
defaults: {
|
defaults: {
|
||||||
sandbox: {
|
sandbox: {
|
||||||
docker: {
|
docker: {
|
||||||
binds: [
|
binds: ["/var/run/docker.sock:/var/run/docker.sock", "/home/user/source:/source:rw"],
|
||||||
"/var/run/docker.sock:/var/run/docker.sock",
|
|
||||||
"/home/user/source:/source:rw",
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -141,8 +141,7 @@ const listHookChannelValues = () => ["last", ...listChannelPlugins().map((plugin
|
|||||||
export type HookMessageChannel = ChannelId | "last";
|
export type HookMessageChannel = ChannelId | "last";
|
||||||
|
|
||||||
const getHookChannelSet = () => new Set<string>(listHookChannelValues());
|
const getHookChannelSet = () => new Set<string>(listHookChannelValues());
|
||||||
export const getHookChannelError = () =>
|
export const getHookChannelError = () => `channel must be ${listHookChannelValues().join("|")}`;
|
||||||
`channel must be ${listHookChannelValues().join("|")}`;
|
|
||||||
|
|
||||||
export function resolveHookChannel(raw: unknown): HookMessageChannel | null {
|
export function resolveHookChannel(raw: unknown): HookMessageChannel | null {
|
||||||
if (raw === undefined) return "last";
|
if (raw === undefined) return "last";
|
||||||
|
|||||||
@@ -112,9 +112,7 @@ export type ClawdbotPluginApi = {
|
|||||||
tool: AnyAgentTool | ClawdbotPluginToolFactory,
|
tool: AnyAgentTool | ClawdbotPluginToolFactory,
|
||||||
opts?: { name?: string; names?: string[] },
|
opts?: { name?: string; names?: string[] },
|
||||||
) => void;
|
) => void;
|
||||||
registerChannel: (
|
registerChannel: (registration: ClawdbotPluginChannelRegistration | ChannelPlugin) => void;
|
||||||
registration: ClawdbotPluginChannelRegistration | ChannelPlugin,
|
|
||||||
) => void;
|
|
||||||
registerGatewayMethod: (method: string, handler: GatewayRequestHandler) => void;
|
registerGatewayMethod: (method: string, handler: GatewayRequestHandler) => void;
|
||||||
registerCli: (registrar: ClawdbotPluginCliRegistrar, opts?: { commands?: string[] }) => void;
|
registerCli: (registrar: ClawdbotPluginCliRegistrar, opts?: { commands?: string[] }) => void;
|
||||||
registerService: (service: ClawdbotPluginService) => void;
|
registerService: (service: ClawdbotPluginService) => void;
|
||||||
|
|||||||
@@ -86,7 +86,9 @@ export const listGatewayAgentChannelAliases = (): string[] =>
|
|||||||
export type GatewayAgentChannelHint = GatewayMessageChannel | "last";
|
export type GatewayAgentChannelHint = GatewayMessageChannel | "last";
|
||||||
|
|
||||||
export const listGatewayAgentChannelValues = (): string[] =>
|
export const listGatewayAgentChannelValues = (): string[] =>
|
||||||
Array.from(new Set([...listGatewayMessageChannels(), "last", ...listGatewayAgentChannelAliases()]));
|
Array.from(
|
||||||
|
new Set([...listGatewayMessageChannels(), "last", ...listGatewayAgentChannelAliases()]),
|
||||||
|
);
|
||||||
|
|
||||||
export function isGatewayMessageChannel(value: string): value is GatewayMessageChannel {
|
export function isGatewayMessageChannel(value: string): value is GatewayMessageChannel {
|
||||||
return listGatewayMessageChannels().includes(value as GatewayMessageChannel);
|
return listGatewayMessageChannels().includes(value as GatewayMessageChannel);
|
||||||
|
|||||||
Reference in New Issue
Block a user