Official

chat

Built-in chat UI (JavaScript UI plugin).

The app opens the listing; nothing installs until an agent in your Plugins workspace has read the files and you enable the plugin. In a terminal: dvg install divergence/chat@0.2.8

Permissions in 0.2.8

  • Control chats chats.controlHighCreates chats, sends prompts and cancels runs.Send prompts, answer agent questions, and create, change, fork, revert, stop and group chats
  • Run other plugins' commands commands.runHighRuns commands of other plugins.Run the sidebar's New chat command from the title bar, and its Close Chat and Reopen Closed Chat for Cmd+W and Cmd+Shift+T on a chat's only tab
  • Read chats chats.readMediumReads your transcripts and chat lists.Show workspaces, tasks, chats and transcripts, and follow them as agents work
  • Read files fs.readMediumReads files in the listed places.Suggest workspace files for @ mentionsPlaces: the open workspace
  • Show panels ui.slotsAlways grantedShows views in the listed parts of the window.Draw the chat grid, the title bar, and the Session panel with its rail buttonSlots: centertitlerailright

Files

service.test.ts25.9 KB
// The divergence/chat service and the chat plugin's use of
// divergence/tabs. Real activation against canned hosts: the queue and the
// draft titles are read through the provided methods and followed through
// its events, and subagent panes open through the tabs client.
import { fakeLayouts } from "../sdk/ui-testing.ts";
import assert from "node:assert/strict";
import test from "node:test";
import * as z from "zod";
import type {
  AgentEventKind,
  Api,
  AppState,
  AppStatePatch,
  Chat,
  HostEvent,
  RenderResult,
  SlotOptions,
  ViewContext,
} from "divergence";
import { testLayer } from "divergence/effect/testing";
import activate from "./main.ts";
import { draftTitle } from "./title.ts";
import { chat, fixtureTask, nodes } from "./ui-for-tests.test.ts";

const tick = () => new Promise<void>((resolve) => setImmediate(resolve));
const stable = (value: unknown) =>
  JSON.stringify(value, (_key, item: unknown) => (typeof item === "function" ? "@handler" : item));

type ServiceImpl = Record<string, (params: never, ctx: unknown) => Promise<unknown>>;
type ServiceEntry = {
  op: string;
  name: string;
  method?: string;
  event?: string;
  payload?: unknown;
  params?: unknown;
  impl?: ServiceImpl;
};

function fake(
  initial: AppState = { route: "chat", chatId: "c1", workspaceId: "w" },
  saved: Record<string, unknown> = {},
  withTabs = true,
  agentEnabled = true,
  contextRegistrationError?: Error,
  moreChats = 0,
) {
  let state = initial,
    dirty = true,
    nextId = 0;
  const views: {
    slot: string;
    options?: SlotOptions;
    render: (ctx: ViewContext<object>) => RenderResult;
    id: number;
    active: boolean;
  }[] = [];
  const listeners = new Map<string, Set<(event: HostEvent) => unknown>>(),
    appListeners = new Set<(state: AppState) => void>();
  const calls: { method: string; params: unknown }[] = [],
    focus: string[] = [],
    notices: string[] = [];
  const commands = new Map<string, () => unknown>(),
    stored: Record<string, unknown> = structuredClone(saved);
  // c1 has started (a session), so its composer names its agent instead of
  // offering the picker.
  const chats = [
    chat({ id: "c1", sessionId: "s1" }),
    chat({ id: "c2", title: "Second" }),
    ...Array.from({ length: moreChats }, (_, i) => chat({ id: `c${i + 3}`, sessionId: `s${i + 3}` })),
  ];
  const updates: number[] = [];
  const serviceLog: ServiceEntry[] = [];
  const serviceSubs = new Map<string, Set<(payload: unknown) => void>>();
  const tabsCalls: { method: string; params: unknown }[] = [];
  const tabsClient = {
    open: Object.assign(
      async (params: { kind: string; workspaceId: string; path: string }) => ({
        id: `${params.kind}:${params.workspaceId}:${params.path}`,
      }),
      {
        // The Effect adapter calls through `result`, never the direct call.
        result: async (params: { kind: string; workspaceId: string; path: string }) => {
          tabsCalls.push({ method: "open", params });
          return { ok: true as const, value: { id: `${params.kind}:${params.workspaceId}:${params.path}` } };
        },
      },
    ),
    close: Object.assign(async () => null, {
      result: async (params: unknown) => {
        tabsCalls.push({ method: "close", params });
        return { ok: true as const, value: null };
      },
    }),
    active: Object.assign(async () => null, {
      result: async () => ({ ok: true as const, value: null }),
    }),
    on: (event: string, fn: (payload: unknown) => void) => {
      const key = `divergence/tabs|${event}`;
      const set = serviceSubs.get(key) ?? new Set<(payload: unknown) => void>();
      serviceSubs.set(key, set);
      set.add(fn);
      return () => {
        set.delete(fn);
      };
    },
  };
  const servicesStub = {
    provide: async (def: { name: string }, impl: ServiceImpl) => {
      serviceLog.push({ op: "provide", name: def.name, impl });
      if (def.name === "divergence/chat-context" && contextRegistrationError) throw contextRegistrationError;
      return {
        emit: (event: string, payload: unknown) => {
          serviceLog.push({ op: "emit", name: def.name, event, payload });
          for (const fn of serviceSubs.get(`${def.name}|${event}`) ?? []) fn(payload);
        },
        remove: () => {},
      };
    },
    get: (name: string) => {
      if (name === "divergence/tabs" && withTabs) return tabsClient;
      throw new Error(`no provider for ${name}`);
    },
    available: (name: string) => name === "divergence/tabs" && withTabs,
    when: (name: string, fn: (client: unknown) => void) => {
      fn(name === "divergence/tabs" && withTabs ? tabsClient : undefined);
      return () => {};
    },
  };
  const response = (method: string, params: unknown): unknown => {
    if (
      method.startsWith("host/inputs.") ||
      method.startsWith("host/drafts.") ||
      method === "host/chats.context_policy"
    )
      throw Object.assign(new Error(`unknown host method ${method}`), { code: -32601 });
    if (method === "host/storage.get") return { value: stored[z.object({ key: z.string() }).parse(params).key] };
    if (method === "host/storage.set") {
      const p = z.object({ key: z.string(), value: z.unknown() }).parse(params);
      stored[p.key] = p.value;
      return {};
    }
    if (method === "host/chats.list") return { chats };
    if (method === "host/workspaces.list")
      return {
        workspaces: [
          { id: "w", name: "Workspace", path: "/fixture", position: 0 },
          { id: "w2", name: "Other", path: "/other", position: 1 },
        ],
      };
    // The chat reads every agent (`agents.all`); the baseline read the
    // enabled ones (`agents.list`). One fixture answers both.
    // As the host: `agents.list` holds only the enabled agents.
    if (method === "host/agents.list" && !agentEnabled) return { agents: [] };
    if (method === "host/agents.list" || method === "host/agents.all")
      return {
        agents: [
          {
            id: "agent",
            name: "Agent",
            icon: agentEnabled ? null : "<svg/>",
            enabled: agentEnabled,
            capabilities: { images: true, cancelTask: true, compact: true, fork: true },
          },
        ],
      };
    if (method === "host/chats.options")
      return {
        options: [
          {
            id: "mode",
            name: "Mode",
            kind: "select",
            category: "mode",
            value: "agent",
            choices: [{ value: "agent", name: "Agent" }],
          },
        ],
      };
    if (method === "host/chats.commands") return { commands: [] };
    if (method === "host/chats.skills") return { skills: [] };
    if (method === "host/chats.transcript")
      return { items: [], pendingApprovals: [], pendingQuestions: [], plan: null, usage: {}, running: false };
    if (method === "host/chats.load_history") return { items: 0 };
    if (method === "host/chats.checkpoints") return { checkpoints: [] };
    if (method === "host/security.pending") return { requests: [] };
    // A host whose chats are each a row of their own, with no side split.
    if (method === "host/tasks.list") return { tasks: [] };
    if (method === "host/layouts.side") return { remembered: [], open: false, width: 520 };
    if (method === "host/fs.search") return { paths: ["src/main.ts", "README.md"] };
    // The keys bound now, for the hints beside controls.
    if (method === "commands") return { commands: [], errors: [], file: "" };
    // This machine has no apps to open a workspace in.
    if (method === "open_in.apps") return { apps: [] };
    if (method === "host/chats.send" || method === "host/chats.cancel" || method === "host/chats.respond_question" || method === "host/chats.prepare")
      return {};
    throw new Error(`Unexpected method ${method}`);
  };
  const call = async (method: string, params: unknown) => {
    calls.push({ method, params });
    return response(method, params);
  };
  const update = (patch: AppStatePatch) => {
    state = {
      ...state,
      ...patch,
      chatId: patch.chatId === null ? undefined : (patch.chatId ?? state.chatId),
      workspaceId: patch.workspaceId === null ? undefined : (patch.workspaceId ?? state.workspaceId),
      route: patch.route ?? state.route,
      shared: { ...state.shared, ...patch.shared },
    };
    dirty = true;
    for (const listener of appListeners) listener(state);
  };
  const broker = testLayer();
  // This assertion describes a local fake; unused API methods fail rather than impersonating external replies.
  const api = new Proxy(
    {
      ...broker.api,
      uiCapabilities: undefined,
      plugin: "chat",
      id: "divergence/chat",
      services: servicesStub,
      host: {
        ...broker.api.host,
        call,
        kernel: call,
      },
      app: {
        state: () => state,
        update,
        share: (key: string, value: unknown) => update({ shared: { [key]: value } }),
        select: (chatId: string, workspaceId: string) => update({ chatId, workspaceId, route: "chat" }),
        route: (route: string) => update({ route }),
        onChange: (fn: (state: AppState) => void) => {
          appListeners.add(fn);
          return () => {
            appListeners.delete(fn);
          };
        },
      },
      layouts: fakeLayouts(),
      views: { add: (key: string, definition: any) => {
        const { slot: slot, render: render } = definition;
        const options = { ...definition, key };
        const _options = options;
        void slot; void _options; void options;
        const view = { slot, render, options, id: ++nextId, active: true };
        views.push(view);
        dirty = true;
        return {
          id: view.id,
          update: () => {
            updates.push(view.id);
            dirty = true;
          },
          remove: () => {
            view.active = false;
            dirty = true;
          },
        };
      } },
      on: (name: string, fn: (event: HostEvent) => unknown) => {
        const subscribers = listeners.get(name) ?? new Set();
        listeners.set(name, subscribers);
        subscribers.add(fn);
        return () => {
          subscribers.delete(fn);
        };
      },
      command: ({ id, run }: { id: string; run: (api: Api) => unknown }) => {
        commands.set(id, () => run(api));
        return {
          remove: () => {
            commands.delete(id);
          },
        };
      },
      slash: () => ({ remove() {} }),
      slashCommands: () => [],
      mentions: { list: () => [] },
      toolRenderers: () => [],
      focus: (id: string) => {
        focus.push(id);
      },
      notify: (message: string) => {
        notices.push(message);
      },
      sleep: (ms: number) => new Promise<void>((resolve) => setTimeout(resolve, ms)),
    },
    {
      get(target, key, receiver) {
        if (Reflect.has(target, key)) return Reflect.get(target, key, receiver);
        throw new Error(`Unexpected API ${String(key)}`);
      },
    },
  ) as unknown as Api;
  let trees: { slot: string; options?: SlotOptions; tree: RenderResult }[] = [];
  const render = () => {
    trees = views
      .filter((view) => view.active)
      .map((view) => ({
        slot: view.slot,
        options: view.options,
        tree: view.render({
          state: {},
          set: () => {},
          app: state,
          plugin: "chat",
          update: () => {
            dirty = true;
          },
        }),
      }));
  };
  const settle = async () => {
    for (let round = 0; round < 100; round++) {
      await tick();
      if (!dirty) {
        await tick();
        if (!dirty) return;
      }
      dirty = false;
      render();
    }
    throw new Error("Chat did not settle");
  };
  const invoke = (id: string, event = "onClick", payload: unknown = undefined) => {
    const node = trees.flatMap((view) => nodes(view.tree)).find((node) => node.id === id);
    assert.ok(node, `element ${id}`);
    const handler = z
      .custom<(payload: unknown) => unknown>((value) => typeof value === "function")
      .parse(node[event] as unknown);
    handler(payload);
  };
  const pressText = (text: string) => {
    const target = trees
      .flatMap((view) => nodes(view.tree))
      .filter((node) => typeof node.onClick === "function" && nodes(node).some((child) => child.text === text))
      .at(-1);
    assert.ok(target, text);
    target.onClick();
  };
  const ctx = { caller: { plugin: "test/client", id: "test/client" }, signal: AbortSignal.timeout(5000) };
  const provided = () => {
    const entry = serviceLog.find((item) => item.op === "provide" && item.name === "divergence/chat");
    assert.ok(entry, "chat service provided");
    return entry.impl as ServiceImpl;
  };
  return {
    pressText,
    api,
    calls,
    notices,
    update,
    updates,
    slotOf: (id: number) => views.find((view) => view.id === id)?.slot,
    settle,
    invoke,
    serviceLog,
    tabsCalls,
    provided,
    callChat: (method: string, params: unknown) => provided()[method]?.(params as never, ctx),
    emits: (event: string) => serviceLog.filter((item) => item.op === "emit" && item.event === event),
    state: () => state,
    slots: () => views.filter((view) => view.active).map((view) => view.slot),
    viewKeys: () => views.filter((view) => view.active).map((view) => view.options?.key),
    renderNow: (slot: string, key: string) => {
      const view = views.find((view) => view.active && view.slot === slot && view.options?.key === key);
      assert.ok(view, `registered ${slot} view ${key}`);
      return view.render({ state: {}, set: () => {}, app: state, plugin: "chat", update: () => {} });
    },
    texts: () => trees.flatMap((view) => nodes(view.tree)).map((node) => node.text),
    icons: () => trees.flatMap((view) => nodes(view.tree)).map((node) => node.svg),
    emit: (event: HostEvent) => {
      for (const name of [event.event, "*"]) for (const fn of listeners.get(name) ?? []) fn(event);
    },
  };
}
const agent = (kind: AgentEventKind): HostEvent => ({ event: "agent", chatId: "c1", kind });

for (const queue of [false, true]) {
  test(`the chat service submits an unopened restored draft without navigating (queue=${queue})`, async () => {
    const current = fake(undefined, { unsent: { c2: "Read README.md" } });
    const dispose = activate(current.api);
    try {
      await current.settle();
      if (queue) current.emit({ event: "chat_changed", chat: chat({ id: "c1", sessionId: "s1", status: "running" }) });
      await current.settle();
      assert.equal(await current.callChat("submitDraft", { chatId: "c2", queue }), null);
      await current.settle();
      assert.equal(current.state().chatId, "c1");
      assert.ok(current.calls.some((call) => call.method === "host/chats.options" && (call.params as { chatId: string }).chatId === "c2"));
      if (queue) {
        assert.deepEqual(await current.callChat("queued", {}), ["c2"]);
        current.emit({ event: "chat_changed", chat: chat({ id: "c1", sessionId: "s1", status: "idle" }) });
        await current.settle();
      }
      assert.deepEqual(current.calls.filter((call) => call.method === "host/chats.send").map((call) => call.params), [
        { chatId: "c2", blocks: [{ type: "text", text: "Read README.md" }] },
      ]);
      assert.deepEqual(current.notices, []);
    } finally {
      await dispose();
    }
  });
}

test("a selected replacement context policy does not abort stock chat activation", async () => {
  const error = Object.assign(new Error("custom-context provides divergence/chat-context"), {
    name: "ProvidedElsewhere",
    tag: "ProvidedElsewhere",
    service: "divergence/chat-context",
    provider: "custom-context",
  });
  const current = fake(undefined, undefined, true, true, error);
  const dispose = activate(current.api);
  try {
    await current.settle();
    assert.deepEqual(current.notices, [], "another selected policy is not a plugin failure");
    assert.ok(current.slots().includes("chat-settings"), "activation continues after context registration");
    current.invoke("prompt-c1", "onChange", { value: "draft after replacement" });
    await current.settle();
    assert.deepEqual(await current.callChat("draftTitles", {}), { c1: draftTitle("draft after replacement") });
  } finally {
    await dispose();
  }
});

test("other context registration failures remain visible and stop activation", async () => {
  for (const [tag, service] of [
    ["InvalidSchema", "divergence/chat-context"],
    ["NotDeclared", "divergence/chat-context"],
    ["ProvidedElsewhere", "divergence/input-scheduler"],
    [undefined, undefined],
  ]) {
    const error = Object.assign(new Error("registration failed"), { tag, service });
    const current = fake(undefined, undefined, true, true, error);
    const dispose = activate(current.api);
    try {
      await current.settle();
      assert.ok(
        current.notices.some((notice) => notice.includes("Plugin chat:")),
        "registration failure surfaces",
      );
      assert.ok(!current.slots().includes("chat-settings"), "invalid registration cannot finish activation");
    } finally {
      await dispose();
    }
  }
});

test("the chat service reads the queue and draft titles, and emits their changes", async (ctx) => {
  ctx.mock.method(Date, "now", () => 123);
  const current = fake();
  const dispose = activate(current.api);
  try {
    await current.settle();
    assert.deepEqual(await current.callChat("queued", {}), []);
    assert.deepEqual(await current.callChat("draftTitles", {}), {});
    current.invoke("prompt-c1", "onChange", { value: "hello" });
    await current.settle();
    // The title follows every key that changes it.
    assert.equal(current.emits("draftTitlesChanged").length, 1);
    assert.deepEqual(current.emits("draftTitlesChanged").at(-1)?.payload, { c1: draftTitle("hello") });
    current.invoke("prompt-c1", "onChange", { value: "hello world" });
    await current.settle();
    assert.equal(current.emits("draftTitlesChanged").length, 2);
    assert.deepEqual(current.emits("draftTitlesChanged").at(-1)?.payload, { c1: draftTitle("hello world") });
    // A key past the first line leaves the title as it was: nothing to announce.
    current.invoke("prompt-c1", "onChange", { value: "hello world\nand more" });
    await current.settle();
    assert.equal(current.emits("draftTitlesChanged").length, 2);
    // The drafts left the shared keys behind: nothing announces through them.
    assert.equal(current.state().shared?.draftTitles, undefined);
    assert.equal(current.state().shared?.queuedChats, undefined);
    assert.deepEqual(await current.callChat("draftTitles", {}), { c1: draftTitle("hello world") });
    assert.deepEqual(current.notices, []);
  } finally {
    await dispose();
  }
});

test("a send to an idle chat reports it starting with the prompt box, until the send ends", async () => {
  const current = fake();
  const dispose = activate(current.api);
  try {
    await current.settle();
    assert.deepEqual(await current.callChat("starting", {}), []);
    current.invoke("prompt-c1", "onChange", { value: "hello" });
    current.invoke("prompt-c1", "onSubmit", undefined);
    assert.deepEqual(current.emits("startingChanged").at(0)?.payload, ["c1"], "reported in the step that sends");
    await current.settle();
    assert.ok(current.calls.some((call) => call.method === "host/chats.send"));
    assert.deepEqual(
      current.emits("startingChanged").map((entry) => entry.payload),
      [["c1"], []],
    );
    assert.deepEqual(current.notices, []);
  } finally {
    await dispose();
  }
});

test("a key renders the composer only when it changes what the prompt box shows besides the text", async () => {
  const current = fake();
  const dispose = activate(current.api);
  try {
    await current.settle();
    // The title bar follows the draft's title with every key; the rest of
    // the chat draws only what the key changed.
    const typed = (value: string) => {
      const before = current.updates.length;
      current.invoke("prompt-c1", "onChange", { value });
      return current
        .settle()
        .then(() => current.updates.slice(before).some((id) => !["title", "title-presentation"].includes(current.slotOf(id) ?? "")));
    };
    assert.equal(await typed("h"), true, "the first character turns Send on");
    assert.equal(await typed("he"), false, "the prompt draws its own text");
    assert.equal(await typed("hel"), false);
    assert.equal(await typed(""), true, "an empty prompt turns Send off");
    assert.equal(await typed("/"), true, "a command opens its picker");
  } finally {
    await dispose();
  }
});

test("restored queues and drafts reach the service on load", async (ctx) => {
  ctx.mock.method(Date, "now", () => 123);
  const current = fake(undefined, {
    queues: { chats: [{ chatId: "c2", text: "Queued chat" }] },
    unsent: { c1: "Other draft" },
  });
  const dispose = activate(current.api);
  try {
    await current.settle();
    assert.deepEqual(current.emits("queuedChanged")[0]?.payload, ["c2"]);
    // Restored data and chat metadata reconcile without an unrelated agent event.
    const drafts = current.emits("draftTitlesChanged").at(-1)?.payload as Record<string, string>;
    assert.equal(drafts["c1"], draftTitle("Other draft"));
    // Nothing runs, so the restored draft leaves the queue and starts.
    assert.deepEqual(await current.callChat("queued", {}), []);
    assert.deepEqual(await current.callChat("draftTitles", {}), drafts);
  } finally {
    await dispose();
  }
});

test("a subagent opens as the chat plugin's own tab, with its chat, with or without the tabs plugin", async (ctx) => {
  ctx.mock.method(Date, "now", () => 123);
  for (const withTabs of [true, false]) {
    const current = fake(undefined, undefined, withTabs);
    const dispose = activate(current.api);
    try {
      await current.settle();
      current.emit(
        agent({ event: "task", ...fixtureTask("child", { status: "completed", title: "Investigate", summary: "Hi" }) }),
      );
      await current.settle();
      // The subagent's row in the transcript opens its tab.
      current.pressText("Investigate");
      await current.settle();
      const layouts = (current.api as unknown as { layouts: ReturnType<typeof fakeLayouts> }).layouts;
      assert.deepEqual(layouts.opened, [{ kind: "subagent", key: "child", chatId: "c1" }]);
      assert.ok(layouts.registered.has("subagent") && layouts.registered.has("workflow"));
      assert.deepEqual(current.tabsCalls, [], "the tabs plugin is not asked");
      assert.deepEqual(current.notices, []);
    } finally {
      await dispose();
    }
  }
});

// Settings turned the chat's agent off after the chat started. The chat
// read only the enabled agents, so its composer showed the raw id
// (`acp:cline`) and the generic mark.
test("a chat whose agent was turned off still names it with its mark", async () => {
  const current = fake(undefined, {}, true, false);
  const dispose = activate(current.api);
  try {
    await current.settle();
    assert.ok(current.calls.some((call) => call.method === "host/agents.all"));
    assert.ok(current.texts().includes("Agent"), "the agent's name, not its id");
    assert.ok(current.icons().includes("<svg/>"), "the agent's own mark");
  } finally {
    await dispose();
  }
});

// ⌘N showed the new chat only after the host and this plugin had answered.
// The sidebar now hands over the draft it opens next, which the host keeps
// out of the chat list, and its page stays built while other chats come and go.
test("the next new chat is built ahead from the chat handed over and kept through eviction", async () => {
  const current = fake(undefined, {}, true, true, undefined, 12);
  const dispose = activate(current.api);
  const cases = () =>
    (nodes(current.renderNow("center-presentation", "center-cases"))[0]?.select as { cases: Record<string, unknown> }).cases;
  try {
    await current.settle();
    let answered = false;
    const prepared = Promise.resolve(current.callChat("prepareNewChat", { chat: chat({ id: "next" }) })).then((result) => {
      answered = true;
      return result;
    });
    await Promise.resolve();
    assert.equal(answered, false, "it answers only once its page can be selected");
    await current.settle();
    assert.equal(await prepared, null);
    assert.ok(cases().next, "the unlisted draft is available to native selection");
    assert.ok(
      !current.calls.some((call) => call.method === "host/chats.transcript" && (call.params as { chatId?: string }).chatId === "next"),
      "an untouched draft needs no transcript read",
    );
    for (let n = 3; n <= 14; n++) await current.callChat("prefetch", { chatId: `c${n}` });
    await current.settle();
    assert.ok(current.viewKeys().includes("center:next"), "reading other chats ahead does not evict it");
    assert.ok(cases().next);
  } finally {
    await dispose();
  }
});

test("the prefetch service builds a selectable presentation without selection work", async () => {
  const current = fake(undefined, {}, true, true, undefined, 4);
  const dispose = activate(current.api);
  const asked = (method: string, chatId: string) =>
    current.calls.filter((call) => call.method === method && (call.params as { chatId?: string }).chatId === chatId).length;
  try {
    await current.settle();
    assert.equal(await current.callChat("prefetch", { chatId: "c3" }), null);
    await current.settle();
    assert.equal(asked("host/chats.transcript", "c3"), 1, "read ahead");
    assert.equal(asked("host/chats.load_history", "c3"), 0, "the agent's history waits for the chat to show");
    for (const key of ["chat:c3", "composer:c3", "center:c3", "title:c3"])
      assert.ok(current.viewKeys().includes(key), `${key} is prepared`);
    const selector = nodes(current.renderNow("center-presentation", "center-cases"))[0]?.select as {
      cases: Record<string, unknown>;
    };
    assert.ok(selector.cases.c3, "the ready presentation is available to native selection");
    assert.equal(asked("host/chats.prepare", "c3"), 0, "session preparation waits for selection");
    current.update({ chatId: "c3" });
    await current.settle();
    assert.equal(asked("host/chats.transcript", "c3"), 1, "shown from what was read");
    assert.equal(asked("host/chats.load_history", "c3"), 1);
  } finally {
    await dispose();
  }
});

Versions

VersionPublishedPlugin APISizePermissionsStatus
0.2.9latestNov 21, 2026>=5 <6349 KB5 permissionsListed
0.2.8Nov 16, 2026>=5 <6348.6 KB5 permissionsListed
0.2.7Nov 11, 2026>=5 <6314.3 KB5 permissionsListed
0.2.6Nov 9, 2026>=5 <6306.2 KB5 permissionsListed
0.2.5Oct 27, 2026>=2 <4178.6 KB5 permissionsListed

Reviews and comments

0 threads · 0 reviews

No comments yet.