refactor!: rename chat providers to channels

This commit is contained in:
Peter Steinberger
2026-01-13 06:16:43 +00:00
parent 0cd632ba84
commit 90342a4f3a
393 changed files with 8004 additions and 6737 deletions

View File

@@ -39,8 +39,8 @@ vi.mock("../config/sessions.js", () => ({
resolveMainSessionKey: mocks.resolveMainSessionKey,
resolveStorePath: mocks.resolveStorePath,
}));
vi.mock("../providers/plugins/index.js", () => ({
listProviderPlugins: () =>
vi.mock("../channels/plugins/index.js", () => ({
listChannelPlugins: () =>
[
{
id: "whatsapp",
@@ -56,7 +56,7 @@ vi.mock("../providers/plugins/index.js", () => ({
resolveAccount: () => ({}),
},
status: {
buildProviderSummary: async () => ({ linked: true, authAgeMs: 5000 }),
buildChannelSummary: async () => ({ linked: true, authAgeMs: 5000 }),
},
},
{
@@ -80,12 +80,12 @@ vi.mock("../providers/plugins/index.js", () => ({
typeof account.lastError === "string" && account.lastError,
)
.map((account) => ({
provider: "signal",
channel: "signal",
accountId:
typeof account.accountId === "string"
? account.accountId
: "default",
message: `Provider error: ${String(account.lastError)}`,
message: `Channel error: ${String(account.lastError)}`,
})),
},
},
@@ -110,12 +110,12 @@ vi.mock("../providers/plugins/index.js", () => ({
typeof account.lastError === "string" && account.lastError,
)
.map((account) => ({
provider: "imessage",
channel: "imessage",
accountId:
typeof account.accountId === "string"
? account.accountId
: "default",
message: `Provider error: ${String(account.lastError)}`,
message: `Channel error: ${String(account.lastError)}`,
})),
},
},
@@ -210,7 +210,7 @@ describe("statusCommand", () => {
it("prints JSON when requested", async () => {
await statusCommand({ json: true }, runtime as never);
const payload = JSON.parse((runtime.log as vi.Mock).mock.calls[0][0]);
expect(payload.linkProvider.linked).toBe(true);
expect(payload.linkChannel.linked).toBe(true);
expect(payload.sessions.count).toBe(1);
expect(payload.sessions.path).toBe("/tmp/sessions.json");
expect(payload.sessions.defaults.model).toBeTruthy();
@@ -228,7 +228,7 @@ describe("statusCommand", () => {
expect(logs.some((l) => l.includes("Overview"))).toBe(true);
expect(logs.some((l) => l.includes("Dashboard"))).toBe(true);
expect(logs.some((l) => l.includes("macos 14.0 (arm64)"))).toBe(true);
expect(logs.some((l) => l.includes("Providers"))).toBe(true);
expect(logs.some((l) => l.includes("Channels"))).toBe(true);
expect(logs.some((l) => l.includes("WhatsApp"))).toBe(true);
expect(logs.some((l) => l.includes("Sessions"))).toBe(true);
expect(logs.some((l) => l.includes("+1000"))).toBe(true);
@@ -265,7 +265,7 @@ describe("statusCommand", () => {
}
});
it("surfaces provider runtime errors from the gateway", async () => {
it("surfaces channel runtime errors from the gateway", async () => {
mocks.probeGateway.mockResolvedValueOnce({
ok: true,
url: "ws://127.0.0.1:18789",
@@ -278,7 +278,7 @@ describe("statusCommand", () => {
configSnapshot: null,
});
mocks.callGateway.mockResolvedValueOnce({
providerAccounts: {
channelAccounts: {
signal: [
{
accountId: "default",