@paulp-o/opencode-auq 0.1.24 → 1.2.5

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAuGlD,eAAO,MAAM,sBAAsB,EAAE,MAoCnC,CAAC;AAEH,eAAe,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAuDlD,eAAO,MAAM,sBAAsB,EAAE,MAcnC,CAAC;AAEH,eAAe,sBAAsB,CAAC"}
package/dist/index.js CHANGED
@@ -1,42 +1,7 @@
1
1
  import { spawn } from "child_process";
2
2
  import { tool } from "@opencode-ai/plugin/tool";
3
+ import { AskUserQuestionsParametersSchema, TOOL_DESCRIPTION, } from "./schemas.js";
3
4
  const z = tool.schema;
4
- const OptionSchema = z.object({
5
- label: z
6
- .string()
7
- .describe("The display text for this option that the user will see and select. " +
8
- "Should be concise (1-5 words) and clearly describe the choice."),
9
- description: z
10
- .string()
11
- .optional()
12
- .describe("Explanation of what this option means or what will happen if chosen. " +
13
- "Useful for providing context about trade-offs or implications."),
14
- });
15
- const QuestionSchema = z.object({
16
- prompt: z
17
- .string()
18
- .describe("The complete question to ask the user. Should be clear, specific, and end with a question mark. " +
19
- "Example: 'Which programming language do you want to use?' " +
20
- "If multiSelect is true, phrase it accordingly, e.g. 'Which features do you want to enable?'"),
21
- title: z
22
- .string()
23
- .min(1, "Question title is required. Provide a short summary like 'Language' or 'Framework'.")
24
- .describe("Very short label displayed as a chip/tag (max 12 chars). " +
25
- "Examples: 'Auth method', 'Library', 'Approach'. " +
26
- "This title appears in the interface to help users quickly identify questions."),
27
- options: z
28
- .array(OptionSchema)
29
- .min(2)
30
- .max(4)
31
- .describe("The available choices for this question. Must have 2-4 options. " +
32
- "Each option should be a distinct, mutually exclusive choice (unless multiSelect is enabled). " +
33
- "There should be no 'Other' option, that will be provided automatically."),
34
- multiSelect: z
35
- .boolean()
36
- .describe("Set to true to allow the user to select multiple options instead of just one. " +
37
- "Use when choices are not mutually exclusive. Default: false (single-select)"),
38
- });
39
- const QuestionsSchema = z.array(QuestionSchema).min(1).max(4);
40
5
  const runAuqAsk = async (payload) => new Promise((resolve, reject) => {
41
6
  const child = spawn("auq", ["ask"], {
42
7
  stdio: ["pipe", "pipe", "pipe"],
@@ -73,29 +38,8 @@ const runAuqAsk = async (payload) => new Promise((resolve, reject) => {
73
38
  export const AskUserQuestionsPlugin = async () => ({
74
39
  tool: {
75
40
  ask_user_questions: tool({
76
- description: "Use this tool when you need to ask the user questions during execution. " +
77
- "This allows you to:\n" +
78
- "1. Gather user preferences or requirements\n" +
79
- "2. Clarify ambiguous instructions\n" +
80
- "3. Get decisions on implementation choices as you work\n" +
81
- "4. Offer choices to the user about what direction to take\n\n" +
82
- "FEATURES:\n" +
83
- "- Ask 1-4 structured questions via an interactive terminal interface\n" +
84
- "- Each question includes 2-4 multiple-choice options with explanatory descriptions\n" +
85
- "- Users can always provide custom free-text input as an alternative to predefined options\n" +
86
- "- Single-select mode (default): User picks ONE option or provides custom text\n" +
87
- "- Multi-select mode (multiSelect: true): User can select MULTIPLE options\n\n" +
88
- "USAGE NOTES:\n" +
89
- "- Always provide a descriptive 'title' field (max 12 chars) for each question\n" +
90
- "- Use multiSelect: true when choices are not mutually exclusive\n" +
91
- "- Option labels should be concise (1-5 words)\n" +
92
- "- Questions should end with a question mark\n" +
93
- "- Don't include an 'Other' option - it's provided automatically\n\n" +
94
- "- If user seems not aware how to answer the question, inform them that they need to install the 'auq' cli tool.\n\n" +
95
- "Returns a formatted summary of all questions and answers.",
96
- args: {
97
- questions: QuestionsSchema,
98
- },
41
+ description: TOOL_DESCRIPTION,
42
+ args: AskUserQuestionsParametersSchema.shape,
99
43
  async execute(args) {
100
44
  try {
101
45
  return await runAuqAsk({ questions: args.questions });
@@ -0,0 +1,37 @@
1
+ import { z } from "zod";
2
+ export declare const OptionSchema: z.ZodObject<{
3
+ label: z.ZodString;
4
+ description: z.ZodOptional<z.ZodString>;
5
+ }, z.core.$strip>;
6
+ export declare const QuestionSchema: z.ZodObject<{
7
+ prompt: z.ZodString;
8
+ title: z.ZodString;
9
+ options: z.ZodArray<z.ZodObject<{
10
+ label: z.ZodString;
11
+ description: z.ZodOptional<z.ZodString>;
12
+ }, z.core.$strip>>;
13
+ multiSelect: z.ZodBoolean;
14
+ }, z.core.$strip>;
15
+ export declare const QuestionsSchema: z.ZodArray<z.ZodObject<{
16
+ prompt: z.ZodString;
17
+ title: z.ZodString;
18
+ options: z.ZodArray<z.ZodObject<{
19
+ label: z.ZodString;
20
+ description: z.ZodOptional<z.ZodString>;
21
+ }, z.core.$strip>>;
22
+ multiSelect: z.ZodBoolean;
23
+ }, z.core.$strip>>;
24
+ export declare const AskUserQuestionsParametersSchema: z.ZodObject<{
25
+ questions: z.ZodArray<z.ZodObject<{
26
+ prompt: z.ZodString;
27
+ title: z.ZodString;
28
+ options: z.ZodArray<z.ZodObject<{
29
+ label: z.ZodString;
30
+ description: z.ZodOptional<z.ZodString>;
31
+ }, z.core.$strip>>;
32
+ multiSelect: z.ZodBoolean;
33
+ }, z.core.$strip>>;
34
+ }, z.core.$strip>;
35
+ export declare const TOOL_DESCRIPTION: string;
36
+ export type QuestionInput = z.infer<typeof QuestionSchema>;
37
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,YAAY;;;iBAcvB,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;iBAkCzB,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;kBAAwC,CAAC;AAErE,eAAO,MAAM,gCAAgC;;;;;;;;;;iBAO3C,CAAC;AAEH,eAAO,MAAM,gBAAgB,QAqBgC,CAAC;AAE9D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
@@ -0,0 +1,64 @@
1
+ import { z } from "zod";
2
+ export const OptionSchema = z.object({
3
+ label: z
4
+ .string()
5
+ .describe("The display text for this option that the user will see and select. " +
6
+ "Should be concise (1-5 words) and clearly describe the choice."),
7
+ description: z
8
+ .string()
9
+ .optional()
10
+ .describe("Explanation of what this option means or what will happen if chosen. " +
11
+ "Useful for providing context about trade-offs or implications."),
12
+ });
13
+ export const QuestionSchema = z.object({
14
+ prompt: z
15
+ .string()
16
+ .describe("The complete question to ask the user. Should be clear, specific, and end with a question mark. " +
17
+ "Example: 'Which programming language do you want to use?' " +
18
+ "If multiSelect is true, phrase it accordingly, e.g. 'Which features do you want to enable?'"),
19
+ title: z
20
+ .string()
21
+ .min(1, "Question title is required. Provide a short summary like 'Language' or 'Framework'.")
22
+ .describe("Very short label displayed as a chip/tag (max 12 chars). " +
23
+ "Examples: 'Auth method', 'Library', 'Approach'. " +
24
+ "This title appears in the interface to help users quickly identify questions."),
25
+ options: z
26
+ .array(OptionSchema)
27
+ .min(2)
28
+ .max(4)
29
+ .describe("The available choices for this question. Must have 2-4 options. " +
30
+ "Each option should be a distinct, mutually exclusive choice (unless multiSelect is enabled). " +
31
+ "There should be no 'Other' option, that will be provided automatically."),
32
+ multiSelect: z
33
+ .boolean()
34
+ .describe("Set to true to allow the user to select multiple options instead of just one. " +
35
+ "Use when choices are not mutually exclusive. Default: false (single-select)"),
36
+ });
37
+ export const QuestionsSchema = z.array(QuestionSchema).min(1).max(4);
38
+ export const AskUserQuestionsParametersSchema = z.object({
39
+ questions: QuestionsSchema.describe("Questions to ask the user (1-4 questions). " +
40
+ "Each question must include: prompt (full question text), title (short label, max 12 chars), " +
41
+ "options (2-4 choices with labels and descriptions), and multiSelect (boolean). " +
42
+ "Mark one choice as recommended if possible."),
43
+ });
44
+ export const TOOL_DESCRIPTION = "Use this tool when you need to ask the user questions during execution. " +
45
+ "This allows you to:\n" +
46
+ "1. Gather user preferences or requirements\n" +
47
+ "2. Clarify ambiguous instructions\n" +
48
+ "3. Get decisions on implementation choices as you work\n" +
49
+ "4. Offer choices to the user about what direction to take\n\n" +
50
+ "FEATURES:\n" +
51
+ "- Ask 1-4 structured questions via an interactive terminal interface\n" +
52
+ "- Each question includes 2-4 multiple-choice options with explanatory descriptions\n" +
53
+ "- Users can always provide custom free-text input as an alternative to predefined options\n" +
54
+ "- Single-select mode (default): User picks ONE option or provides custom text\n" +
55
+ "- Multi-select mode (multiSelect: true): User can select MULTIPLE options\n\n" +
56
+ "USAGE NOTES:\n" +
57
+ "- Always provide a descriptive 'title' field (max 12 chars) for each question\n" +
58
+ "- Use multiSelect: true when choices are not mutually exclusive\n" +
59
+ "- Option labels should be concise (1-5 words)\n" +
60
+ "- Questions should end with a question mark\n" +
61
+ "- Don't include an 'Other' option - it's provided automatically\n" +
62
+ "- Mark one choice as recommended if possible.\n\n" +
63
+ "- If user seems not aware how to answer the question, inform them that they need to install the 'auq' cli tool.\n\n" +
64
+ "Returns a formatted summary of all questions and answers.";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@paulp-o/opencode-auq",
4
- "version": "0.1.24",
4
+ "version": "1.2.5",
5
5
  "description": "OpenCode plugin that forwards ask_user_questions to the auq CLI",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",