* fix(hermes): show the full command of Hermes terminal calls
Hermes titles a terminal call with its own summary ("terminal: echo ... + 5
commands") and sends the full command only as "$ <command>" start content,
which the completion update replaces. It sends no rawInput, so the generic
ACP adapter fell back to the title and the full command was never stored.
Hermes now runs as a bundled runAcpProvider plugin. Its terminal transformer
lifts the start text into input.command and carries it across the
completion through context.previous; any other shape passes through, so an
upstream format change shows the title again instead of breaking.
The plugin ACP shim now builds the standard row for each ACP tool kind, so
read/search/fetch rows keep their shape after the move. Transformers still
see raw input, output and content, and a detail they set wins.
Moving Hermes surfaced two regressions, both fixed:
- The activity curator printed "[Shell] null" for typed rows whose name
looks namespaced (Hermes titles contain ":"); the raw-input fallback now
applies only to unknown rows.
- Agents saved by the generic adapter stored Hermes session-mode IDs, but
the shim uses Hermes's edit_approval_policy config option as ACP prefers,
so resume failed with invalid_params. legacyModes translates them.
Legacy extends:"acp" Hermes configs migrate on load, keeping a custom
command, gated on server_info.features.hermesProvider.
* fix(acp): keep Hermes approvals, Auto Accept, and session import after bundling
Moving Hermes from the generic ACP adapter to the plugin ACP shim dropped
behavior the adapter had:
- Approvals were built without a detail, so the approval card had no diff.
Approvals with no rawInput also failed with "Invalid params".
- The shim had no unattended mode, and agents that saved the adapter's
`auto_accept` toggle sent it back to Hermes as an unknown config option.
Hermes now offers a Full access mode, and a saved `auto_accept: true`
resumes in it.
- Session listing read only the first page of `session/list`, so the import
picker lost sessions past the first 50.
- Edit rows whose result is text lost that text instead of showing it as
the diff, unlike the generic adapter.
* fix(acp): keep a mode chosen after a saved Auto Accept toggle
The generic ACP adapter's `auto_accept` setting stays in the agent's saved
options after the move to a bundled ACP provider. It put the agent back in
the unattended mode on every reopen, even after the user chose another
mode, so approvals stopped asking again after a reload. The toggle now
counts only while the saved mode is one the generic adapter wrote, which
the agent no longer offers.
* fix(acp): keep whitespace-only text in Edit rows
The standard Edit row read old and new text with the same helper as
titles and paths, which skips blank strings. An edit that replaces text
with spaces lost its new text, so the app drew it as a deletion. File
text is now kept as written, as the previous formatter did.
177 lines
6.4 KiB
TypeScript
177 lines
6.4 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { ACP_PROVIDER_CATALOG } from "@/data/acp-provider-catalog";
|
|
import { buildAcpProviderConfigPatch, getAcpProviderCatalog } from "./use-acp-provider-catalog";
|
|
|
|
function findProvider(id: string) {
|
|
const entry = getAcpProviderCatalog().find((provider) => provider.id === id);
|
|
if (!entry) {
|
|
throw new Error(`Missing ACP provider catalog entry: ${id}`);
|
|
}
|
|
return entry;
|
|
}
|
|
|
|
describe("ACP provider catalog", () => {
|
|
it.each(["devin", "hermes", "kiro"])(
|
|
"#7087: %s supplies its provider mark to the catalog picker",
|
|
(provider) => {
|
|
expect(findProvider(provider).iconSvg).toContain("<svg");
|
|
},
|
|
);
|
|
|
|
it("vendors provider entries with unique ids and concrete commands", () => {
|
|
const ids = new Set<string>();
|
|
|
|
for (const entry of ACP_PROVIDER_CATALOG) {
|
|
expect(ids.has(entry.id)).toBe(false);
|
|
ids.add(entry.id);
|
|
expect(entry.title).not.toBe("");
|
|
expect(entry.description).not.toBe("");
|
|
expect(entry.installLink).toMatch(/^https:\/\//);
|
|
expect(entry.command.length).toBeGreaterThan(0);
|
|
expect(entry.command[0]).not.toBe("");
|
|
}
|
|
});
|
|
|
|
it("bundles SVG icons for catalog entries that declare an icon", () => {
|
|
const entriesWithIcons = ACP_PROVIDER_CATALOG.filter((entry) => entry.iconSvg !== null);
|
|
|
|
expect(entriesWithIcons.length).toBeGreaterThan(0);
|
|
for (const entry of entriesWithIcons) {
|
|
expect(entry.iconSvg).toContain("<svg");
|
|
}
|
|
});
|
|
|
|
it("does not offer Pi's unsupported ACP adapter", () => {
|
|
expect(ACP_PROVIDER_CATALOG.some((entry) => entry.id === "pi-acp")).toBe(false);
|
|
});
|
|
|
|
it("uses PATH commands for entries that were binary distributions upstream", () => {
|
|
expect(findProvider("amp-acp").command).toEqual(["amp-acp"]);
|
|
expect(findProvider("cursor").command).toEqual(["cursor-agent", "acp"]);
|
|
expect(findProvider("codewhale").command).toEqual(["codewhale", "serve", "--acp"]);
|
|
expect(findProvider("devin").command).toEqual(["devin", "acp"]);
|
|
expect(findProvider("goose").command).toEqual(["goose", "acp"]);
|
|
expect(findProvider("hoplite").command).toEqual(["hoplite", "acp"]);
|
|
expect(findProvider("fx").command).toEqual(["fx", "acp"]);
|
|
expect(findProvider("junie").command).toEqual(["junie", "--acp", "true"]);
|
|
expect(findProvider("kiro").command).toEqual(["kiro-cli", "acp"]);
|
|
expect(findProvider("poolside").command).toEqual(["pool", "acp"]);
|
|
expect(findProvider("traecli").command).toEqual(["traecli", "acp", "serve"]);
|
|
});
|
|
|
|
it("offers MiniMax Code through its pinned public ACP package", () => {
|
|
expect(findProvider("minimax-code")).toMatchObject({
|
|
title: "MiniMax Code",
|
|
version: "0.6.13",
|
|
// The package publishes `mcode`, not `code`, so npx needs the package and
|
|
// the binary named separately.
|
|
command: ["npx", "-y", "-p", "@minimax-ai/code@0.6.13", "mcode", "acp"],
|
|
});
|
|
expect(findProvider("minimax-code").iconSvg).toContain("<svg");
|
|
});
|
|
|
|
it("offers Hoplite through its local ACP bridge with the Hoplite mark", () => {
|
|
expect(findProvider("hoplite")).toMatchObject({
|
|
title: "Hoplite",
|
|
command: ["hoplite", "acp"],
|
|
installLink: "https://hoplite.sh/docs/cli#install",
|
|
});
|
|
expect(buildAcpProviderConfigPatch(findProvider("hoplite"), () => true)).toEqual({
|
|
providers: {
|
|
hoplite: { enabled: true },
|
|
},
|
|
});
|
|
const ids = getAcpProviderCatalog().map((entry) => entry.id);
|
|
expect(ids.indexOf("hermes")).toBeLessThan(ids.indexOf("hoplite"));
|
|
expect(ids.indexOf("hoplite")).toBeLessThan(ids.indexOf("junie"));
|
|
expect(findProvider("hoplite").iconSvg).toContain('fill="currentColor"');
|
|
});
|
|
|
|
it("offers fx as a bundled provider gated on its own host feature", () => {
|
|
expect(findProvider("fx")).toMatchObject({
|
|
title: "fx",
|
|
installLink: "https://fx.sh/docs/getting-started/installation",
|
|
});
|
|
expect(findProvider("fx").iconSvg).toContain('fill="currentColor"');
|
|
const supported: string[] = [];
|
|
expect(
|
|
buildAcpProviderConfigPatch(findProvider("fx"), (feature) => {
|
|
supported.push(feature);
|
|
return true;
|
|
}),
|
|
).toEqual({ providers: { fx: { enabled: true } } });
|
|
expect(supported).toEqual(["fxProvider"]);
|
|
});
|
|
|
|
it.each([
|
|
["hoplite", "Hoplite"],
|
|
["fx", "fx"],
|
|
])("rejects unsupported bundled %s before producing a patch", (id, title) => {
|
|
const unsupported = () => false;
|
|
expect(() => buildAcpProviderConfigPatch(findProvider(id), unsupported)).toThrow(
|
|
`Update the host to add ${title}.`,
|
|
);
|
|
});
|
|
|
|
it("maps a catalog entry to the daemon provider config patch", () => {
|
|
expect(buildAcpProviderConfigPatch(findProvider("amp-acp"))).toEqual({
|
|
providers: {
|
|
"amp-acp": {
|
|
extends: "acp",
|
|
label: "Amp",
|
|
description: "ACP wrapper for Amp - the frontier coding agent",
|
|
command: ["amp-acp"],
|
|
env: {},
|
|
},
|
|
},
|
|
});
|
|
});
|
|
|
|
it("preserves provider env in the daemon config patch", () => {
|
|
const patch = buildAcpProviderConfigPatch(findProvider("auggie"));
|
|
|
|
expect(patch.providers?.auggie?.env).toEqual({
|
|
AUGMENT_DISABLE_AUTO_UPDATE: "1",
|
|
});
|
|
});
|
|
|
|
it("registers Gajae Code with its ACP command and permission-prompt env", () => {
|
|
const patch = buildAcpProviderConfigPatch(findProvider("gjc"));
|
|
|
|
expect(patch.providers?.gjc?.command).toEqual(["gjc", "acp"]);
|
|
expect(patch.providers?.gjc?.env).toEqual({ GJC_ACP_PERMISSION_MODE: "prompt" });
|
|
});
|
|
|
|
it("preserves provider params in the daemon config patch", () => {
|
|
const droidPatch = buildAcpProviderConfigPatch(findProvider("factory-droid"));
|
|
|
|
expect(droidPatch.providers?.["factory-droid"]?.params).toEqual({
|
|
supportsMcpServers: false,
|
|
});
|
|
});
|
|
});
|
|
|
|
it.each([
|
|
{ id: "goose", feature: "gooseProvider" },
|
|
{ id: "hermes", feature: "hermesProvider" },
|
|
] as const)(
|
|
"adds bundled $id on capable hosts and uses the ACP config on older hosts",
|
|
({ id, feature }) => {
|
|
const entry = findProvider(id);
|
|
expect(buildAcpProviderConfigPatch(entry, (supported) => supported === feature)).toEqual({
|
|
providers: { [id]: { enabled: true } },
|
|
});
|
|
expect(buildAcpProviderConfigPatch(entry)).toEqual({
|
|
providers: {
|
|
[id]: {
|
|
extends: "acp",
|
|
label: entry.title,
|
|
description: entry.description,
|
|
command: [id, "acp"],
|
|
env: {},
|
|
},
|
|
},
|
|
});
|
|
},
|
|
);
|