Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(llm): show how to install Google's Antigravity ACP server
Elian Doranf440b17ea695
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.jsonindex 8037020cae..77f84c8e50 100644--- a/apps/client/src/translations/en/translation.json+++ b/apps/client/src/translations/en/translation.json@@ -4049,6 +4049,9 @@"claude_agent_description": "Uses your Claude Pro/Max subscription through Claude Code, so no API key is needed. Claude Code must be installed on the machine running Trilium (the server when self-hosting, or this computer on desktop); sign in once by running \"claude /login\" there.","copilot_agent_description": "Uses your GitHub Copilot subscription through the GitHub Copilot CLI, so no API key is needed. The Copilot CLI must be installed on the machine running Trilium (the server when self-hosting, or this computer on desktop); sign in once by running \"copilot login\" there — an existing Copilot login from another editor is reused automatically.","antigravity_agent_description": "Uses the Gemini quota of your Google account (free, Google AI Pro or Ultra) through Google Antigravity, so no API key is needed.\n\nGoogle's Antigravity ACP server must be downloaded to the machine running Trilium: the server when self-hosting, or this computer on desktop.\n\nThe first time the models are listed, the Google sign-in page opens in a browser on that machine.",+ "antigravity_setup_download": "On the machine running Trilium, download the archive for your platform from Google's <Link>ACP registry entry</Link> and unzip it into a folder it can stay in.",+ "antigravity_setup_path": "Add that folder to <Code>PATH</Code>, or set the <Code>TRILIUM_ANTIGRAVITY_ACP_PATH</Code> environment variable to <Code>agy_acp_server.par</Code> in it (<Code>agy_acp_server.exe</Code> on Windows), then restart Trilium.",+ "antigravity_setup_sign_in": "Come back to this step. The first time, the Google sign-in page opens in a browser on that machine.","add_provider_title_named": "Add {{- name}}","provider_group_cloud": "Cloud providers","provider_group_cloud_description": "Pay per use with an API key, billed separately from any subscription you already have. Your notes are sent to the provider's servers.",diff --git a/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.tsx b/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.tsxindex 3b596faea8..8f52a3bff0 100644--- a/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.tsx+++ b/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.tsx@@ -398,10 +398,7 @@ export default function AddProviderModal({ show, onHidden, onSave, existingProviselected={selectedModels}onChange={setSelectedModels}autoSelectDefaults={seedDefaultModels}- // Only for the local runtimes: the checklist is about starting a- // server on your own machine, which says nothing useful about a- // hosted endpoint failing to list.- troubleshooting={providerType?.group === "local" ? <SelfHostedTroubleshooting /> : undefined}+ troubleshooting={troubleshootingFor(providerType)}/></CardSection></Card>@@ -510,9 +507,34 @@ export function prefilledBaseUrl(providerId: string): string {}/**- * Shown when a self-hosted endpoint can't be listed — the point at which the- * user needs setup instructions, rather than on the way in.+ * The checklist shown when a provider's models can't be listed, which is when+ * the user needs setup instructions. Only the local runtimes and Google+ * Antigravity have one: a hosted endpoint failing to list says nothing that+ * steps on the user's own machine would fix.*/+function troubleshootingFor(providerType: ProviderType | undefined) {+ if (providerType?.id === "antigravity-agent") {+ return <AntigravitySetup />;+ }+ return providerType?.group === "local" ? <SelfHostedTroubleshooting /> : undefined;+}++/** How to install Google's Antigravity ACP server, which Trilium does not bundle. */+function AntigravitySetup() {+ const components = {+ Code: <code />,+ // The registry entry lists the current archive for each platform.+ Link: <a className="tn-link" href="https://github.com/agentclientprotocol/registry/blob/main/antigravity-acp/agent.json" target="_blank" rel="noopener noreferrer" />+ };+ return (+ <ol className="model-selection-troubleshooting">+ <li><Trans i18nKey="llm.antigravity_setup_download" components={components} /></li>+ <li><Trans i18nKey="llm.antigravity_setup_path" components={components} /></li>+ <li><Trans i18nKey="llm.antigravity_setup_sign_in" components={components} /></li>+ </ol>+ );+}+function SelfHostedTroubleshooting() {return (<ul className="model-selection-troubleshooting">diff --git a/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.wizard.spec.tsx b/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.wizard.spec.tsxindex 19ed5f38a8..9547cf8aea 100644--- a/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.wizard.spec.tsx+++ b/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.wizard.spec.tsx@@ -47,7 +47,10 @@ vi.mock("../../../react/WizardModal", () => ({}));// Listing a provider's models is a request of its own, and none of these cases are about it.-vi.mock("./ModelSelection", () => ({ default: () => <div className="model-selection-stub" /> }));+// The stub renders the checklist it is handed, which the screen shows when listing fails.+vi.mock("./ModelSelection", () => ({+ default: ({ troubleshooting }: { troubleshooting?: preact.ComponentChildren }) => <div className="model-selection-stub">{troubleshooting}</div>+}));import AddProviderModal, { type LlmProviderConfig } from "./AddProviderModal";@@ -99,6 +102,27 @@ function finish() {act(() => void nextButton()?.click());}+describe("the model step", () => {+ /** Picks a provider and moves on to the model step. */+ function modelStepFor(name: string) {+ open();+ act(() => providerCard(name)?.click());+ act(() => void nextButton()?.click());+ return document.querySelector(".model-selection-stub");+ }++ it("offers the setup steps that fit the provider when its models cannot be listed", () => {+ const antigravity = modelStepFor("Google Antigravity");+ expect(antigravity?.textContent).toContain("llm.antigravity_setup_download");+ expect(antigravity?.textContent).toContain("llm.antigravity_setup_path");+ expect(antigravity?.textContent).toContain("llm.antigravity_setup_sign_in");+ expect(antigravity?.textContent).not.toContain("llm.troubleshoot_server_running");++ expect(modelStepFor("Ollama")?.textContent).toContain("llm.troubleshoot_server_running");+ expect(modelStepFor("Claude Code")?.textContent).toBe("");+ });+});+describe("picking a provider", () => {it("holds the step until one has been chosen, rather than taking whichever is first", () => {open();