chore: rename relay to gateway
This commit is contained in:
@@ -11,7 +11,7 @@ import {
|
||||
vi,
|
||||
} from "vitest";
|
||||
import * as commandReply from "../auto-reply/command-reply.js";
|
||||
import type { WarelayConfig } from "../config/config.js";
|
||||
import type { ClawdisConfig } from "../config/config.js";
|
||||
import * as configModule from "../config/config.js";
|
||||
import type { RuntimeEnv } from "../runtime.js";
|
||||
import { agentCommand } from "./agent.js";
|
||||
@@ -36,7 +36,7 @@ function makeStorePath() {
|
||||
|
||||
function mockConfig(
|
||||
storePath: string,
|
||||
replyOverrides?: Partial<NonNullable<WarelayConfig["inbound"]>["reply"]>,
|
||||
replyOverrides?: Partial<NonNullable<ClawdisConfig["inbound"]>["reply"]>,
|
||||
) {
|
||||
configSpy.mockReturnValue({
|
||||
inbound: {
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
type VerboseLevel,
|
||||
} from "../auto-reply/thinking.js";
|
||||
import { type CliDeps, createDefaultDeps } from "../cli/deps.js";
|
||||
import { loadConfig, type WarelayConfig } from "../config/config.js";
|
||||
import { loadConfig, type ClawdisConfig } from "../config/config.js";
|
||||
import {
|
||||
DEFAULT_IDLE_MINUTES,
|
||||
loadSessionStore,
|
||||
@@ -50,7 +50,7 @@ type SessionResolution = {
|
||||
persistedVerbose?: VerboseLevel;
|
||||
};
|
||||
|
||||
function assertCommandConfig(cfg: WarelayConfig) {
|
||||
function assertCommandConfig(cfg: ClawdisConfig) {
|
||||
const reply = cfg.inbound?.reply;
|
||||
if (!reply || reply.mode !== "command" || !reply.command?.length) {
|
||||
throw new Error(
|
||||
@@ -58,14 +58,14 @@ function assertCommandConfig(cfg: WarelayConfig) {
|
||||
);
|
||||
}
|
||||
return reply as NonNullable<
|
||||
NonNullable<WarelayConfig["inbound"]>["reply"]
|
||||
NonNullable<ClawdisConfig["inbound"]>["reply"]
|
||||
> & { mode: "command"; command: string[] };
|
||||
}
|
||||
|
||||
function resolveSession(opts: {
|
||||
to?: string;
|
||||
sessionId?: string;
|
||||
replyCfg: NonNullable<NonNullable<WarelayConfig["inbound"]>["reply"]>;
|
||||
replyCfg: NonNullable<NonNullable<ClawdisConfig["inbound"]>["reply"]>;
|
||||
}): SessionResolution {
|
||||
const sessionCfg = opts.replyCfg?.session;
|
||||
const scope = sessionCfg?.scope ?? "per-sender";
|
||||
|
||||
@@ -53,12 +53,12 @@ export async function sendCommand(
|
||||
return;
|
||||
}
|
||||
|
||||
// Try to send via IPC to running relay first (avoids Signal session corruption)
|
||||
// Try to send via IPC to running gateway first (avoids Signal session corruption)
|
||||
const ipcResult = await sendViaIpc(opts.to, opts.message, opts.media);
|
||||
if (ipcResult) {
|
||||
if (ipcResult.success) {
|
||||
runtime.log(
|
||||
success(`✅ Sent via relay IPC. Message ID: ${ipcResult.messageId}`),
|
||||
success(`✅ Sent via gateway IPC. Message ID: ${ipcResult.messageId}`),
|
||||
);
|
||||
if (opts.json) {
|
||||
runtime.log(
|
||||
@@ -77,7 +77,7 @@ export async function sendCommand(
|
||||
}
|
||||
return;
|
||||
}
|
||||
// IPC failed but relay is running - warn and fall back
|
||||
// IPC failed but gateway is running - warn and fall back
|
||||
runtime.log(
|
||||
info(
|
||||
`IPC send failed (${ipcResult.error}), falling back to direct connection`,
|
||||
|
||||
Reference in New Issue
Block a user