@agentrq/acp-gateway 0.2.27 → 0.2.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/__tests__/index.test.js +17 -4
- package/dist/__tests__/index.test.js.map +1 -1
- package/dist/index.js +8 -3
- package/dist/index.js.map +1 -1
- package/dist/mcpClient.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ import { join } from "node:path";
|
|
|
6
6
|
import { EventEmitter } from "node:events";
|
|
7
7
|
import * as acp from "@agentclientprotocol/sdk";
|
|
8
8
|
import { createAcpSessionSwitcher, fetchNextTask, startPendingTask, drainPendingTasks, createSelfFillingTaskQueue, MAX_SKIPPED_FETCHES, IDLE_TASK_POLL_INTERVAL_MS, freeSlots, resetPendingTaskDrain, mapMcpServers, TaskQueue, createTaskQueue, resetConcurrencyReports, getOrCreateSession, openIdleSession, resetIdleSession, activeSessions, AuthenticationFailed, IDLE_SESSION_KEY, loginCommandFor, authConfig, modelConfig, createSessionWithAuth, isInteractiveTerminal, openAgentConnection, agentExitFailed, showAgentStderr, shouldPrintBanner, parseGatewayArgs, assertAgentRunnable, helpText, isRunnable, resolveOnPath, spawnTarget, needsShell, escapeCmdCommand, quoteForCmd, spawnArgsFor, terminateAgentProcess, printHelp, resolveAgentCommand, runListAgents, pickHumanApprovalMode, enforceHumanApprovalMode, handleAgentModeChange, runAgentCommand, loadWorkspace, createDetachedBridge, makeIsolatedDir, WORKSPACE_OPTIONAL_COMMANDS, findActiveSession, handleTaskCancellation, handleSetModel, handleSetConcurrency, runTurnForTask, resetTaskTurns, registerConcurrencyListeners, reportConcurrency, applyModelSelection, cancelledTaskSeq, markTaskCancelled, isTaskCancelled, nextTaskSeq, supportsCloseSession, closeSession, closeAllSessions, setupSignalHandlers, } from "../index.js";
|
|
9
|
-
import { sendModelsNotification } from "../acpClient.js";
|
|
9
|
+
import { AgentRQACPClient, sendModelsNotification } from "../acpClient.js";
|
|
10
10
|
import { AUTH_REQUIRED_CODE } from "../auth.js";
|
|
11
11
|
/**
|
|
12
12
|
* A stand-in for the workspace bridge.
|
|
@@ -2689,7 +2689,7 @@ describe("index", () => {
|
|
|
2689
2689
|
const workspace = loadWorkspace("list-models", file, emptyWorkspaceDir());
|
|
2690
2690
|
expect(workspace.agentrqConfig.name).toBe("agentrq-ws");
|
|
2691
2691
|
expect(workspace.mcpBridge.getServerName()).toBeUndefined();
|
|
2692
|
-
await expect(workspace.mcpBridge.
|
|
2692
|
+
await expect(workspace.mcpBridge.callTool("elicit", {})).rejects.toThrow("No agentrq workspace is configured");
|
|
2693
2693
|
});
|
|
2694
2694
|
it("should still report a --mcp-json path that is wrong", () => {
|
|
2695
2695
|
expect(() => loadWorkspace("list-models", "/nowhere/servers.json", emptyWorkspaceDir())).toThrow();
|
|
@@ -2717,15 +2717,28 @@ describe("index", () => {
|
|
|
2717
2717
|
});
|
|
2718
2718
|
});
|
|
2719
2719
|
describe("createDetachedBridge", () => {
|
|
2720
|
-
it("should fail
|
|
2720
|
+
it("should fail tool calls, drop notifications, and close quietly", async () => {
|
|
2721
2721
|
const bridge = createDetachedBridge();
|
|
2722
2722
|
await expect(bridge.callTool("elicit", {})).rejects.toThrow("No agentrq workspace is configured");
|
|
2723
|
-
await expect(bridge.sendNotification("notifications/x", {})).
|
|
2723
|
+
await expect(bridge.sendNotification("notifications/x", {})).resolves.toBeUndefined();
|
|
2724
2724
|
expect(bridge.getSessionId()).toBeUndefined();
|
|
2725
2725
|
expect(bridge.getServerName()).toBeUndefined();
|
|
2726
2726
|
expect(bridge.getAdvertisedTools()).toBeUndefined();
|
|
2727
2727
|
await expect(bridge.close()).resolves.toBeUndefined();
|
|
2728
2728
|
});
|
|
2729
|
+
it("should not print an error when the agent shares its slash commands", async () => {
|
|
2730
|
+
const errorSpy = vi.spyOn(console, "error").mockImplementation(() => { });
|
|
2731
|
+
const client = new AgentRQACPClient(createDetachedBridge());
|
|
2732
|
+
await client.sessionUpdate({
|
|
2733
|
+
sessionId: "s1",
|
|
2734
|
+
update: {
|
|
2735
|
+
sessionUpdate: "available_commands_update",
|
|
2736
|
+
availableCommands: [{ name: "init", description: "d" }],
|
|
2737
|
+
},
|
|
2738
|
+
});
|
|
2739
|
+
expect(errorSpy).not.toHaveBeenCalled();
|
|
2740
|
+
errorSpy.mockRestore();
|
|
2741
|
+
});
|
|
2729
2742
|
});
|
|
2730
2743
|
describe("runAgentCommand", () => {
|
|
2731
2744
|
const agentrqConfig = { env: {} };
|