Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(acp): accept SDK elicitation requests #11294

Mergedshivamhwp(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/11294/headmerged by juliusmarminge View on GitHub

Showing 4 changed files with 175 additions and 6 deletions (loading 1).

x
0 of 4 viewed, 4 left
147 additions and 0 deletionspackages/effect-acp/src/client.test.tsModified
View file
@@ -778,3 +778,150 @@
}),
});
+​
+const elicitationForm = {
+ sessionId: "session-1",
+ mode: "form" as const,
+ message: "Continue?",
+ requestedSchema: {
+ type: "object" as const,
+ properties: { choice: { type: "string" as const } },
+ required: ["choice"],
+ },
+};
+const decodeWireResponse = Schema.decodeEffect(Schema.fromJsonString(Schema.Unknown));
+const decodeWireError = Schema.decodeEffect(
+ Schema.fromJsonString(Schema.Struct({ error: Schema.Struct({ code: Schema.Finite }) })),
+);
+​
+it.effect.each(["accept", "decline", "cancel"] as const)(
+ "returns a flat %s action to the SDK and preserves the legacy response",
+ (action) =>
+ Effect.gen(function* () {
+ for (const method of ["elicitation/create", "session/elicitation"]) {
+ const { stdio, input, output } = yield* makeInMemoryStdio();
+ const acp = yield* AcpClient.make(stdio);
+ const answer = action === "accept" ? { action, content: { choice: "yes" } } : { action };
+ const response = { action: answer, _meta: { trace: "fixture" } };
+ yield* acp.handleElicitation((request) => {