@xynogen/pix-ask 0.2.24 → 0.2.26
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/package.json +2 -2
- package/src/index.ts +11 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xynogen/pix-ask",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.26",
|
|
4
4
|
"description": "Pi tool — structured questionnaire UI (ask_user)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"access": "public"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@xynogen/pix-pretty": "^1.
|
|
38
|
+
"@xynogen/pix-pretty": "^1.19.0",
|
|
39
39
|
"@xynogen/pix-runtime": "^0.8.0",
|
|
40
40
|
"typebox": "^1.1.38"
|
|
41
41
|
},
|
package/src/index.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { modalOverlayOptions } from "@xynogen/pix-pretty/modal-frame";
|
|
|
4
4
|
import {
|
|
5
5
|
dotJoin,
|
|
6
6
|
formatCollapsedToolRow,
|
|
7
|
+
frameToolResult,
|
|
7
8
|
hideCollapsedToolCall,
|
|
8
9
|
pluralize,
|
|
9
10
|
} from "@xynogen/pix-pretty/utils";
|
|
@@ -43,8 +44,7 @@ export default function registerAsk(pi: ExtensionAPI): void {
|
|
|
43
44
|
description: `Ask the user up to ${MAX_QUESTIONS} structured questions (${MIN_OPTIONS}-${MAX_OPTIONS} options each) when requirements are ambiguous.`,
|
|
44
45
|
promptSnippet: `Ask the user up to ${MAX_QUESTIONS} structured questions (${MIN_OPTIONS}-${MAX_OPTIONS} options each) when requirements are ambiguous`,
|
|
45
46
|
promptGuidelines: [
|
|
46
|
-
|
|
47
|
-
"Do not stack multiple ask calls back-to-back — group all clarifying questions into one invocation.",
|
|
47
|
+
"Do not stack multiple ask_user calls back-to-back — group all clarifying questions into one invocation.",
|
|
48
48
|
],
|
|
49
49
|
executionMode: "sequential",
|
|
50
50
|
parameters: ParamsSchema,
|
|
@@ -133,6 +133,14 @@ export default function registerAsk(pi: ExtensionAPI): void {
|
|
|
133
133
|
text.setText(theme.fg("muted", "Waiting for user input…"));
|
|
134
134
|
return text;
|
|
135
135
|
}
|
|
136
|
+
if (renderCtx.isError) {
|
|
137
|
+
const error = result.content
|
|
138
|
+
.filter((part) => part.type === "text")
|
|
139
|
+
.map((part) => part.text)
|
|
140
|
+
.join("\n");
|
|
141
|
+
text.setText(error || "Error");
|
|
142
|
+
return frameToolResult(text, theme, true);
|
|
143
|
+
}
|
|
136
144
|
if (!details || details.cancelled || !details.answers?.length) {
|
|
137
145
|
// Cancellation is a warning outcome, not success — shared row keeps the
|
|
138
146
|
// tool identity and a text label (never color alone) for accessibility.
|
|
@@ -167,7 +175,7 @@ export default function registerAsk(pi: ExtensionAPI): void {
|
|
|
167
175
|
);
|
|
168
176
|
const header = `${theme.fg("success", "✓")} ${theme.fg("toolTitle", theme.bold("ask_user"))}`;
|
|
169
177
|
text.setText([header, ...lines].join("\n"));
|
|
170
|
-
return text;
|
|
178
|
+
return frameToolResult(text, theme, false);
|
|
171
179
|
},
|
|
172
180
|
});
|
|
173
181
|
});
|