Files
coucou/windows/tests/subscriptions.test.mjs
T
Claude 2e7088a791 Windows and Linux: chat on your own subscription, as on the Mac
Settings → Chat → Your AI subscriptions: a switch per provider (Claude,
Google Gemini, ChatGPT, Cursor, GitHub Copilot), whether its terminal tool is
installed, how to sign in. cli_relay.rs runs Antigravity CLI / Gemini CLI,
Codex CLI, Cursor CLI and Copilot CLI read-only (plan or ask modes, no shell,
no edits), Claude Code through claude_code.rs as before. Through npm's .cmd
shims the prompt goes on stdin. Cursor and Copilot join the chat's picker once
their switch is on. The phone's chat takes the same path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LJm3SRL9k3gBPaVtfPhwcT
2026-10-30 00:01:18 +01:00

20 lines
1.1 KiB
JavaScript

// The model chip through a subscription (src/core/subscriptions.ts).
import { test } from "node:test";
import assert from "node:assert/strict";
import { chipLabel, setSubscriptions, subscribedProviders } from "../src/core/subscriptions.ts";
import { DEFAULT_SETTINGS } from "../src/core/state.ts";
const row = (provider, tool, on) => ({
provider, tool, on, installed: true, signIn: "x", installUrl: "https://x", subscriptionOnly: false,
});
test("the chip names the tool that answers", () => {
setSubscriptions([row("anthropic", "Claude Code", true), row("google", "Antigravity CLI", true), row("openai", "Codex CLI", false)]);
assert.equal(chipLabel({ ...DEFAULT_SETTINGS, chatProvider: "anthropic" }, "claude-opus-5"), "claude-opus-5 · Claude Code");
assert.equal(chipLabel({ ...DEFAULT_SETTINGS, chatProvider: "google" }, "gemini-2.0-flash"), "Antigravity CLI");
// Off: the API model, as before.
assert.equal(chipLabel({ ...DEFAULT_SETTINGS, chatProvider: "openai" }, "gpt-4o"), "gpt-4o");
assert.deepEqual([...subscribedProviders()], ["anthropic", "google"]);
});