@agentclientprotocol/claude-agent-acp 0.76.1-preview.5 → 0.76.1-preview.7
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/dist/elicitation.d.ts +13 -10
- package/dist/elicitation.d.ts.map +1 -1
- package/dist/elicitation.js +43 -21
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +27 -4
- package/package.json +1 -1
package/dist/elicitation.d.ts
CHANGED
|
@@ -57,9 +57,10 @@ export declare function extractAskUserQuestions(input: Record<string, unknown>):
|
|
|
57
57
|
*
|
|
58
58
|
* Each question is followed by its own optional free-text "custom answer" field
|
|
59
59
|
* (`question_<n>_custom`), mirroring the CLI's per-question "Other" box: the
|
|
60
|
-
* user can type their own answer instead of
|
|
61
|
-
*
|
|
62
|
-
*
|
|
60
|
+
* user can type their own answer instead of (or, for a multi-select question,
|
|
61
|
+
* as well as) picking an option, scoped to that specific question. Nothing is
|
|
62
|
+
* marked required, so the user can also just skip — matching the built-in tool,
|
|
63
|
+
* which always offers Skip + a free-text box.
|
|
63
64
|
*/
|
|
64
65
|
export declare function askUserQuestionsToCreateRequest(questions: AskUserQuestion[], sessionId: string, toolCallId: string | undefined): CreateElicitationRequest;
|
|
65
66
|
/** Outcome of an AskUserQuestion elicitation, decoupled from any transport. */
|
|
@@ -73,13 +74,15 @@ export type AskUserQuestionOutcome = {
|
|
|
73
74
|
* Fold an ACP elicitation response into the AskUserQuestion tool's input.
|
|
74
75
|
*
|
|
75
76
|
* Selected labels are read back from the indexed form fields and written into
|
|
76
|
-
* `answers` as a `{ [questionText]: label }` map
|
|
77
|
-
* —
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
77
|
+
* `answers` as a `{ [questionText]: label }` map — the key shape the tool's own
|
|
78
|
+
* `call()` reads — with multi-selects comma-joined in the CLI's own quoted form
|
|
79
|
+
* (see `joinMultiSelectAnswer`). A non-empty per-question custom-answer field
|
|
80
|
+
* (`question_<n>_custom`) replaces the selection of a single-select question,
|
|
81
|
+
* since the user typed their own answer instead of picking one, and joins the
|
|
82
|
+
* selection of a multi-select question, where the two fields are independent
|
|
83
|
+
* and filling both means both. Decline yields empty answers (the model is told
|
|
84
|
+
* the user skipped rather than the turn aborting); cancel — and any
|
|
85
|
+
* custom/future action we don't understand — aborts the tool call.
|
|
83
86
|
*/
|
|
84
87
|
export declare function applyAskElicitationResponse(response: CreateElicitationResponse, toolInput: Record<string, unknown>, questions: AskUserQuestion[]): AskUserQuestionOutcome;
|
|
85
88
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elicitation.d.ts","sourceRoot":"","sources":["../src/elicitation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,EACV,wBAAwB,EAKzB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAC5F,OAAO,KAAK,EACV,oBAAoB,EAErB,MAAM,6CAA6C,CAAC;AAErD;;;;;;;;;;;;;GAaG;AAEH,yDAAyD;AACzD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,GAAG,EAAE,OAAO,CAAC;CACd,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,kBAAkB,EAC3B,SAAS,EAAE,MAAM,GAChB,wBAAwB,GAAG,IAAI,CAyBjC;AAgBD;;;GAGG;AACH,wBAAgB,uCAAuC,CACrD,QAAQ,EAAE,yBAAyB,GAClC,iBAAiB,CAUnB;AAED;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,oBAAoB,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAExE;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM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YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,QAAQ,CAAA;CAAE,CAAC;AAevF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,yBAAyB,EACnC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClC,SAAS,EAAE,eAAe,EAAE,GAC3B,sBAAsB,CA2CxB;AAgBD;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,4BAA4B,CAAC;AAEtE;;;;;;;GAOG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,qBAAqB,GAAG,IAAI,CAW9B;AAYD;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,qBAAqB,EAC7B,SAAS,EAAE,MAAM,GAChB,wBAAwB,CA+B1B;AAED;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAAC,QAAQ,EAAE,yBAAyB,GAAG,MAAM,CAG7F"}
|
package/dist/elicitation.js
CHANGED
|
@@ -108,9 +108,10 @@ const CUSTOM_ANSWER_META_KEY = "_askUserQuestionCustomAnswer";
|
|
|
108
108
|
*
|
|
109
109
|
* Each question is followed by its own optional free-text "custom answer" field
|
|
110
110
|
* (`question_<n>_custom`), mirroring the CLI's per-question "Other" box: the
|
|
111
|
-
* user can type their own answer instead of
|
|
112
|
-
*
|
|
113
|
-
*
|
|
111
|
+
* user can type their own answer instead of (or, for a multi-select question,
|
|
112
|
+
* as well as) picking an option, scoped to that specific question. Nothing is
|
|
113
|
+
* marked required, so the user can also just skip — matching the built-in tool,
|
|
114
|
+
* which always offers Skip + a free-text box.
|
|
114
115
|
*/
|
|
115
116
|
export function askUserQuestionsToCreateRequest(questions, sessionId, toolCallId) {
|
|
116
117
|
const single = questions.length === 1;
|
|
@@ -143,7 +144,9 @@ export function askUserQuestionsToCreateRequest(questions, sessionId, toolCallId
|
|
|
143
144
|
properties[questionCustomFieldKey(index)] = {
|
|
144
145
|
type: "string",
|
|
145
146
|
title: "Other",
|
|
146
|
-
description:
|
|
147
|
+
description: question.multiSelect
|
|
148
|
+
? "Type your own answer to add to your selection above (optional)."
|
|
149
|
+
: "Type your own answer instead of choosing an option above (optional).",
|
|
147
150
|
_meta: {
|
|
148
151
|
[CUSTOM_ANSWER_META_KEY]: {
|
|
149
152
|
questionId: questionFieldKey(index),
|
|
@@ -165,17 +168,31 @@ export function askUserQuestionsToCreateRequest(questions, sessionId, toolCallId
|
|
|
165
168
|
requestedSchema,
|
|
166
169
|
};
|
|
167
170
|
}
|
|
171
|
+
/**
|
|
172
|
+
* Serialize a multi-select answer the way the CLI's own AskUserQuestion UI
|
|
173
|
+
* does: comma-joined, with any item that itself contains the separator (or a
|
|
174
|
+
* double quote) JSON-quoted. The tool's `call()` splits the string back on the
|
|
175
|
+
* same rule, so a free-text answer like `Redis, not Memcached` stays one item
|
|
176
|
+
* instead of reading as two more picks.
|
|
177
|
+
*/
|
|
178
|
+
function joinMultiSelectAnswer(items) {
|
|
179
|
+
return items
|
|
180
|
+
.map((item) => (item.includes(", ") || item.includes('"') ? JSON.stringify(item) : item))
|
|
181
|
+
.join(", ");
|
|
182
|
+
}
|
|
168
183
|
/**
|
|
169
184
|
* Fold an ACP elicitation response into the AskUserQuestion tool's input.
|
|
170
185
|
*
|
|
171
186
|
* Selected labels are read back from the indexed form fields and written into
|
|
172
|
-
* `answers` as a `{ [questionText]: label }` map
|
|
173
|
-
* —
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
*
|
|
187
|
+
* `answers` as a `{ [questionText]: label }` map — the key shape the tool's own
|
|
188
|
+
* `call()` reads — with multi-selects comma-joined in the CLI's own quoted form
|
|
189
|
+
* (see `joinMultiSelectAnswer`). A non-empty per-question custom-answer field
|
|
190
|
+
* (`question_<n>_custom`) replaces the selection of a single-select question,
|
|
191
|
+
* since the user typed their own answer instead of picking one, and joins the
|
|
192
|
+
* selection of a multi-select question, where the two fields are independent
|
|
193
|
+
* and filling both means both. Decline yields empty answers (the model is told
|
|
194
|
+
* the user skipped rather than the turn aborting); cancel — and any
|
|
195
|
+
* custom/future action we don't understand — aborts the tool call.
|
|
179
196
|
*/
|
|
180
197
|
export function applyAskElicitationResponse(response, toolInput, questions) {
|
|
181
198
|
if (response.action === "decline") {
|
|
@@ -189,18 +206,23 @@ export function applyAskElicitationResponse(response, toolInput, questions) {
|
|
|
189
206
|
// stay in sync with what the built-in tool's call() expects to read back.
|
|
190
207
|
const answers = {};
|
|
191
208
|
questions.forEach((question, index) => {
|
|
192
|
-
// A typed custom answer wins over the selection: the user chose to write
|
|
193
|
-
// their own answer for this question instead of picking an option.
|
|
194
209
|
const custom = content[questionCustomFieldKey(index)];
|
|
195
|
-
|
|
196
|
-
answers[question.question] = custom.trim();
|
|
197
|
-
return;
|
|
198
|
-
}
|
|
210
|
+
const customText = typeof custom === "string" ? custom.trim() : "";
|
|
199
211
|
const value = content[questionFieldKey(index)];
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
212
|
+
const picks = value === undefined || value === null
|
|
213
|
+
? []
|
|
214
|
+
: Array.isArray(value)
|
|
215
|
+
? value.filter((item) => item !== undefined && item !== null && item !== "").map(String)
|
|
216
|
+
: [String(value)];
|
|
217
|
+
// A single-select question is answered by exactly one thing, so a typed
|
|
218
|
+
// custom answer replaces the pick: the user wrote their own answer instead
|
|
219
|
+
// of choosing an option. A multi-select is additive, and the form offers
|
|
220
|
+
// the selection and the custom box as independent fields — a user who
|
|
221
|
+
// fills both means both, so the typed answer joins the checked options.
|
|
222
|
+
const items = customText === "" ? picks : question.multiSelect ? [...picks, customText] : [customText];
|
|
223
|
+
// A single-select normally holds one item; the plain join only matters if a
|
|
224
|
+
// client hands back an array for it, and then mirrors the old behavior.
|
|
225
|
+
const text = question.multiSelect ? joinMultiSelectAnswer(items) : items.join(", ");
|
|
204
226
|
if (text === "") {
|
|
205
227
|
return;
|
|
206
228
|
}
|
package/dist/tools.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,QAAQ,EACT,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAaL,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,gBAAgB,EAKjB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAIL,oBAAoB,EAEpB,6BAA6B,EAE9B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,yCAAyC,EAGzC,qCAAqC,EAGrC,kCAAkC,EAGlC,+CAA+C,EAI/C,wBAAwB,EACxB,kCAAkC,EAIlC,gCAAgC,EAEhC,iCAAiC,EAClC,MAAM,sCAAsC,CAAC;AA4B9C,UAAU,QAAQ;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAChC;AAED,UAAU,UAAU;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC/B,KAAK,CAAC,EAAE;QACN,aAAa,CAAC,EAAE;YACd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F,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAI9D;AAED;8EAC8E;AAC9E,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAK5D;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAIxD;AAGD,eAAO,MAAM,qBAAqB,GAC/B,UAAU;IAAE,eAAe,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,KAAG,YAoBtD,CAAC;AAEJ;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,GACxB,SAAS;IAAE,SAAS,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,KAAG,YAsBpE,CAAC"}
|
package/dist/tools.js
CHANGED
|
@@ -971,17 +971,40 @@ export function parseTaskListOutput(content) {
|
|
|
971
971
|
const tasks = [];
|
|
972
972
|
const lines = text.trim().split("\n");
|
|
973
973
|
for (const line of lines) {
|
|
974
|
-
const match = /^#(\S+) \[(pending|in_progress|completed)\] (
|
|
974
|
+
const match = /^#(\S+) \[(pending|in_progress|completed)\] (.+)$/.exec(line);
|
|
975
975
|
if (!match) {
|
|
976
976
|
tasks.length = 0;
|
|
977
977
|
break;
|
|
978
978
|
}
|
|
979
|
+
let subject = match[3];
|
|
980
|
+
let owner;
|
|
981
|
+
let blockedBy = [];
|
|
982
|
+
const blockedMarker = " [blocked by ";
|
|
983
|
+
const blockedStart = subject.lastIndexOf(blockedMarker);
|
|
984
|
+
if (blockedStart > 0 && subject.endsWith("]")) {
|
|
985
|
+
const dependencies = subject.slice(blockedStart + blockedMarker.length, -1).split(", ");
|
|
986
|
+
if (dependencies.every((dependency) => dependency.length > 1 &&
|
|
987
|
+
dependency.startsWith("#") &&
|
|
988
|
+
!dependency.includes(",") &&
|
|
989
|
+
!dependency.includes("]"))) {
|
|
990
|
+
subject = subject.slice(0, blockedStart);
|
|
991
|
+
blockedBy = dependencies.map((dependency) => dependency.slice(1));
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
const ownerStart = subject.lastIndexOf(" (");
|
|
995
|
+
if (ownerStart > 0 && subject.endsWith(")")) {
|
|
996
|
+
const candidate = subject.slice(ownerStart + 2, -1);
|
|
997
|
+
if (!candidate.includes("(") && !candidate.includes(")")) {
|
|
998
|
+
subject = subject.slice(0, ownerStart);
|
|
999
|
+
owner = candidate || undefined;
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
979
1002
|
tasks.push({
|
|
980
1003
|
id: match[1],
|
|
981
|
-
subject
|
|
1004
|
+
subject,
|
|
982
1005
|
status: match[2],
|
|
983
|
-
...(
|
|
984
|
-
blockedBy
|
|
1006
|
+
...(owner ? { owner } : {}),
|
|
1007
|
+
blockedBy,
|
|
985
1008
|
});
|
|
986
1009
|
}
|
|
987
1010
|
if (tasks.length > 0)
|
package/package.json
CHANGED