From c9159df62a60fc84cc904c872eeafa00a46dbb7f Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Sat, 21 Nov 2026 15:09:28 +0700 Subject: [PATCH] Suggest Antigravity skills inside prompts (#10383) Preserve the provider command kind so Antigravity skills appear in inline autocomplete. Keep the built-in ACP commands available at the start of the prompt. --- .../src/server/acp-internal/connection.ts | 18 +++-- packages/plugin/src/server/acp.ts | 2 + packages/plugin/src/server/provider.ts | 8 ++- .../src/server/agent/plugin-provider.test.ts | 32 +++++++++ .../src/server/agent/plugin-provider.ts | 5 +- .../server/provider.test.ts | 67 +++++++++++++++++++ .../antigravity-provider/server/provider.ts | 16 +++++ public-docs/plugins/reference.md | 9 +++ 8 files changed, 149 insertions(+), 8 deletions(-) diff --git a/packages/plugin/src/server/acp-internal/connection.ts b/packages/plugin/src/server/acp-internal/connection.ts index 2323a95291..8d96e815bd 100644 --- a/packages/plugin/src/server/acp-internal/connection.ts +++ b/packages/plugin/src/server/acp-internal/connection.ts @@ -38,6 +38,7 @@ import { requireProviderCapabilities, type ProviderCatalog, type ProviderCapability, + type ProviderCommand, type ProviderConfigState, type ProviderConnectRequest, type ProviderConnection, @@ -1398,11 +1399,18 @@ class AcpRuntime { return; } if (update.sessionUpdate === "available_commands_update") { - const commands = update.availableCommands.map((command) => ({ - name: command.name, - description: command.description, - argumentHint: command.input?.hint, - })); + const context = { sessionId: this.options.boundarySessionId }; + const commands = update.availableCommands.map((command) => { + let entry: ProviderCommand = { + name: command.name, + description: command.description, + argumentHint: command.input?.hint, + }; + for (const transformer of this.transformers) { + entry = transformer.command?.(entry, context) ?? entry; + } + return entry; + }); this.emit({ type: "session.commands", sessionId: this.options.boundarySessionId, commands }); this.receivedInitialCommands = true; this.commandWaiter?.(); diff --git a/packages/plugin/src/server/acp.ts b/packages/plugin/src/server/acp.ts index e1be1884d6..4b79e0ee67 100644 --- a/packages/plugin/src/server/acp.ts +++ b/packages/plugin/src/server/acp.ts @@ -136,6 +136,8 @@ export interface AcpTransformer { configure?(change: AcpConfigChange, context: AcpConfigureContext): Promise<"handled" | "pass">; /** Rewrites every session config snapshot before Paseo sees it. */ config?(state: ProviderConfigState, context: AcpContext): ProviderConfigState; + /** Rewrites each advertised ACP slash command before Paseo sees it. */ + command?(command: ProviderCommand, context: AcpContext): ProviderCommand; notification?( notification: { method: string; params: JsonValue }, context: AcpContext, diff --git a/packages/plugin/src/server/provider.ts b/packages/plugin/src/server/provider.ts index 622a20d68d..c40c982e03 100644 --- a/packages/plugin/src/server/provider.ts +++ b/packages/plugin/src/server/provider.ts @@ -488,6 +488,7 @@ export interface ProviderCommand { name: string; description: string; argumentHint?: string; + kind?: "command" | "skill"; } export interface ProviderError { @@ -1214,7 +1215,12 @@ const noticeSchema = z }) .strip(); const commandSchema = z - .object({ name: idSchema, description: z.string(), argumentHint: z.string().optional() }) + .object({ + name: idSchema, + description: z.string(), + argumentHint: z.string().optional(), + kind: z.enum(["command", "skill"]).optional(), + }) .strip(); const usageSchema = z .object({ diff --git a/packages/server/src/server/agent/plugin-provider.test.ts b/packages/server/src/server/agent/plugin-provider.test.ts index d45967e7fe..66691a57a5 100644 --- a/packages/server/src/server/agent/plugin-provider.test.ts +++ b/packages/server/src/server/agent/plugin-provider.test.ts @@ -258,6 +258,38 @@ function eventsOfType(events: AgentStreamEvent[], type: AgentStreamEvent["type"] return events.filter((event) => event.type === type); } +test("preserves skills in a plugin session's command list", async () => { + const harness = createProviderHarness(); + const registry = new PluginAgentClientRegistry(createTestLogger()); + registry.replace([harness.registration]); + const session = await registry.clients()[harness.registration.id]!.createSession({ + provider: harness.registration.id, + cwd: tmpdir(), + }); + try { + const open = harness.inputs.find((input) => input.type === "session.open")!; + harness.emit({ + type: "session.commands", + sessionId: open.sessionId, + commands: [ + { name: "compact", description: "Compact the conversation" }, + { name: "diagnose", description: "Diagnose a bug", kind: "skill" }, + ], + }); + await expect(session.listCommands!()).resolves.toEqual([ + { + name: "compact", + description: "Compact the conversation", + argumentHint: "", + kind: "command", + }, + { name: "diagnose", description: "Diagnose a bug", argumentHint: "", kind: "skill" }, + ]); + } finally { + await session.close(); + } +}); + function createRewindProviderHarness( options: { reuseAnswerId?: boolean; diff --git a/packages/server/src/server/agent/plugin-provider.ts b/packages/server/src/server/agent/plugin-provider.ts index bb327e0299..f8e93a0626 100644 --- a/packages/server/src/server/agent/plugin-provider.ts +++ b/packages/server/src/server/agent/plugin-provider.ts @@ -19,6 +19,7 @@ import { type ProviderLaunch, requireProviderCapabilities, type ProviderCapability, + type ProviderCommand, type ProviderConfigChanges, type ProviderConfigState, type ProviderConnection, @@ -663,7 +664,7 @@ class ProviderRuntimeSession { private closedByProvider = false; private closePromise: Promise | null = null; config: ProviderConfigState = { models: [], modes: [], thinkingOptions: [] }; - commands: Array<{ name: string; description: string; argumentHint?: string }> = []; + commands: ProviderCommand[] = []; persistence: ProviderPersistence | null = null; constructor( @@ -1501,7 +1502,7 @@ class PluginAgentSession implements AgentSession { return this.bridge.commands.map((command) => ({ ...command, argumentHint: command.argumentHint ?? "", - kind: "command", + kind: command.kind ?? "command", })); } diff --git a/plugins/antigravity-provider/server/provider.test.ts b/plugins/antigravity-provider/server/provider.test.ts index 385e2ec882..8776549152 100644 --- a/plugins/antigravity-provider/server/provider.test.ts +++ b/plugins/antigravity-provider/server/provider.test.ts @@ -39,6 +39,73 @@ it("reports a CLI without the acp subcommand as unavailable", async () => { }); }); +it("publishes Antigravity skills separately from built-in commands", async () => { + const { directory, launch } = await launchAgent(` + const { createInterface } = require("node:readline"); + const send = (message) => process.stdout.write(JSON.stringify({ jsonrpc: "2.0", ...message }) + "\\n"); + createInterface({ input: process.stdin }).on("line", (line) => { + const { id, method } = JSON.parse(line); + if (method === "initialize") { + send({ id, result: { protocolVersion: 1 } }); + } + if (method === "session/new") { + send({ id, result: { sessionId: "native" } }); + send({ method: "session/update", params: { sessionId: "native", update: { + sessionUpdate: "available_commands_update", + availableCommands: ["goal", "compact", "schedule", "browser", "plan", "grill-me", + "teamwork", "learn", "boost", "agy-customizations", "antigravity-guide", "diagnose"] + .map(name => ({ name, description: name })), + } } }); + } + }); + `); + const connection = await createAntigravityProvider().connect({ + launch, + versions: [1], + capabilities: [], + }); + const events: ProviderEvent[] = []; + connection.onEvent((event) => events.push(event)); + try { + await connection.send({ + type: "session.open", + requestId: "new", + sessionId: "test", + history: "skip", + config: { cwd: directory, env: {}, mcpServers: {}, settings: {}, persist: false }, + }); + await expect + .poll(() => + events.find( + (event) => event.type === "session.commands" || event.type === "request.failed", + ), + ) + .toMatchObject({ type: "session.commands" }); + await expect + .poll(() => events.find((event) => event.type === "session.commands")?.commands) + .toEqual([ + ...[ + "goal", + "compact", + "schedule", + "browser", + "plan", + "grill-me", + "teamwork", + "learn", + "boost", + ].map((name) => ({ name, description: name, kind: "command" })), + ...["agy-customizations", "antigravity-guide", "diagnose"].map((name) => ({ + name, + description: name, + kind: "skill", + })), + ]); + } finally { + await connection.close(); + } +}); + it.each([true, false])( "loads a saved stream-JSON session with ACP system prompt support %s", async (supportsSystemPrompt) => { diff --git a/plugins/antigravity-provider/server/provider.ts b/plugins/antigravity-provider/server/provider.ts index acadd0b472..37980e53d0 100644 --- a/plugins/antigravity-provider/server/provider.ts +++ b/plugins/antigravity-provider/server/provider.ts @@ -17,7 +17,23 @@ const systemPromptCapability = z.object({ const fileWrite = z.object({ Path: z.string(), Content: z.string().optional() }); +// agy 1.5.13 advertises these built-in commands and its invocable skills in one ACP list. +const builtInCommands = new Set([ + "goal", + "compact", + "schedule", + "browser", + "plan", + "grill-me", + "teamwork", + "learn", + "boost", +]); + const antigravity: AcpTransformer = { + command(command) { + return { ...command, kind: builtInCommands.has(command.name) ? "command" : "skill" }; + }, toolCall(call) { if (call.name === "write_file") { const input = fileWrite.safeParse(call.input); diff --git a/public-docs/plugins/reference.md b/public-docs/plugins/reference.md index 965291c66b..47bd7d87a2 100644 --- a/public-docs/plugins/reference.md +++ b/public-docs/plugins/reference.md @@ -442,6 +442,15 @@ Use `config(state, context)` to return the configuration snapshot that Paseo dis Paseo calls this synchronous hook for initial, notification, and committed configuration snapshots. Use `configure` to send changes to the agent. +Publish `session.commands` to advertise slash commands and skills. Each entry carries `name`, +`description`, and optional `argumentHint` and `kind`. The composer suggests both kinds at the +start of a prompt. Use `kind: "skill"` if the agent accepts the skill inline as part of a normal +message. The default kind is `"command"`. + +In the ACP shim, use `command(entry, context)` to return a rewritten entry for each advertised +slash command. For example, a plugin with a vendor skill registry can set the kind with +`return { ...entry, kind: skills.has(entry.name) ? "skill" : "command" }`. + `ProviderRegistration.icon` is a file path relative to the plugin directory, such as `icon.svg`. It must resolve inside that directory to a regular file that follows the [SVG icon rules](#svg-rules). Paseo reads and validates the file when the plugin starts; the string