@juicesharp/rpiv-ask-user-question 0.9.1 → 0.10.0
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/ask-user-question.ts +5 -5
- package/package.json +4 -1
package/ask-user-question.ts
CHANGED
|
@@ -158,14 +158,14 @@ export function registerAskUserQuestionTool(pi: ExtensionAPI): void {
|
|
|
158
158
|
});
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
function buildMainItems(options: QuestionOption[]): WrappingSelectItem[] {
|
|
161
|
+
export function buildMainItems(options: QuestionOption[]): WrappingSelectItem[] {
|
|
162
162
|
return [
|
|
163
163
|
...options.map((o) => ({ label: o.label, description: o.description })),
|
|
164
164
|
{ label: TYPE_SOMETHING_LABEL, isOther: true },
|
|
165
165
|
];
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
function itemAt(
|
|
168
|
+
export function itemAt(
|
|
169
169
|
index: number,
|
|
170
170
|
mainItems: WrappingSelectItem[],
|
|
171
171
|
chatItems: WrappingSelectItem[],
|
|
@@ -173,7 +173,7 @@ function itemAt(
|
|
|
173
173
|
return index < mainItems.length ? mainItems[index] : chatItems[index - mainItems.length];
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
function wrapIndex(index: number, total: number): number {
|
|
176
|
+
export function wrapIndex(index: number, total: number): number {
|
|
177
177
|
return ((index % total) + total) % total;
|
|
178
178
|
}
|
|
179
179
|
|
|
@@ -203,7 +203,7 @@ function buildDialogContainer(
|
|
|
203
203
|
return container;
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
-
function buildResponse(choice: WrappingSelectItem | null, params: QuestionParams) {
|
|
206
|
+
export function buildResponse(choice: WrappingSelectItem | null, params: QuestionParams) {
|
|
207
207
|
if (!choice) {
|
|
208
208
|
return buildToolResult(DECLINE_MESSAGE, { question: params.question, answer: null });
|
|
209
209
|
}
|
|
@@ -229,7 +229,7 @@ function buildResponse(choice: WrappingSelectItem | null, params: QuestionParams
|
|
|
229
229
|
});
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
function buildToolResult(text: string, details: ToolDetails) {
|
|
232
|
+
export function buildToolResult(text: string, details: ToolDetails) {
|
|
233
233
|
return {
|
|
234
234
|
content: [{ type: "text" as const, text }],
|
|
235
235
|
details,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juicesharp/rpiv-ask-user-question",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Pi extension: lets the model ask you a clarifying question with structured options instead of guessing",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -22,6 +22,9 @@
|
|
|
22
22
|
"publishConfig": {
|
|
23
23
|
"access": "public"
|
|
24
24
|
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"test": "vitest run"
|
|
27
|
+
},
|
|
25
28
|
"files": [
|
|
26
29
|
"index.ts",
|
|
27
30
|
"ask-user-question.ts",
|