@bike4mind/cli 0.2.32-feat-ask-user-question.19782 → 0.2.32-feat-ask-user-question.19783

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.
@@ -3,7 +3,7 @@
3
3
  // package.json
4
4
  var package_default = {
5
5
  name: "@bike4mind/cli",
6
- version: "0.2.32-feat-ask-user-question.19782+79b1265be",
6
+ version: "0.2.32-feat-ask-user-question.19783+6ce0f7b05",
7
7
  type: "module",
8
8
  description: "Interactive CLI tool for Bike4Mind with ReAct agents",
9
9
  license: "UNLICENSED",
@@ -114,10 +114,10 @@ var package_default = {
114
114
  },
115
115
  devDependencies: {
116
116
  "@bike4mind/agents": "0.1.0",
117
- "@bike4mind/common": "2.53.1-feat-ask-user-question.19782+79b1265be",
118
- "@bike4mind/mcp": "1.32.1-feat-ask-user-question.19782+79b1265be",
119
- "@bike4mind/services": "2.51.1-feat-ask-user-question.19782+79b1265be",
120
- "@bike4mind/utils": "2.8.1-feat-ask-user-question.19782+79b1265be",
117
+ "@bike4mind/common": "2.53.1-feat-ask-user-question.19783+6ce0f7b05",
118
+ "@bike4mind/mcp": "1.32.1-feat-ask-user-question.19783+6ce0f7b05",
119
+ "@bike4mind/services": "2.51.1-feat-ask-user-question.19783+6ce0f7b05",
120
+ "@bike4mind/utils": "2.8.1-feat-ask-user-question.19783+6ce0f7b05",
121
121
  "@types/better-sqlite3": "^7.6.13",
122
122
  "@types/diff": "^5.0.9",
123
123
  "@types/jsonwebtoken": "^9.0.4",
@@ -138,7 +138,7 @@ var package_default = {
138
138
  optionalDependencies: {
139
139
  "@vscode/ripgrep": "^1.17.0"
140
140
  },
141
- gitHead: "79b1265bed108dba0efe530cbc29d9a32e2a808b"
141
+ gitHead: "6ce0f7b0546ad4c3222c3929978db020041bdb8e"
142
142
  };
143
143
 
144
144
  // src/utils/updateChecker.ts
@@ -3,7 +3,7 @@ import {
3
3
  fetchLatestVersion,
4
4
  forceCheckForUpdate,
5
5
  package_default
6
- } from "../chunk-NUHF3LFJ.js";
6
+ } from "../chunk-NYA5P7X7.js";
7
7
 
8
8
  // src/commands/doctorCommand.ts
9
9
  import { execSync } from "child_process";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  forceCheckForUpdate,
4
4
  package_default
5
- } from "../chunk-NUHF3LFJ.js";
5
+ } from "../chunk-NYA5P7X7.js";
6
6
 
7
7
  // src/commands/updateCommand.ts
8
8
  import { execSync } from "child_process";
package/dist/index.js CHANGED
@@ -16,7 +16,7 @@ import {
16
16
  import {
17
17
  checkForUpdate,
18
18
  package_default
19
- } from "./chunk-NUHF3LFJ.js";
19
+ } from "./chunk-NYA5P7X7.js";
20
20
  import {
21
21
  selectActiveBackgroundAgents,
22
22
  useCliStore
@@ -14745,6 +14745,53 @@ var _showUserQuestion = null;
14745
14745
  function setShowUserQuestionFn(fn) {
14746
14746
  _showUserQuestion = fn;
14747
14747
  }
14748
+ var MAX_QUESTIONS = 4;
14749
+ var MAX_OPTIONS_PER_QUESTION = 4;
14750
+ var MIN_OPTIONS_PER_QUESTION = 2;
14751
+ function validateArgs(args) {
14752
+ if (args === null || typeof args !== "object") {
14753
+ return { error: "Invalid arguments: expected an object." };
14754
+ }
14755
+ const obj = args;
14756
+ if (!Array.isArray(obj.questions) || obj.questions.length === 0) {
14757
+ return { error: "At least one question is required." };
14758
+ }
14759
+ if (obj.questions.length > MAX_QUESTIONS) {
14760
+ return { error: `Maximum ${MAX_QUESTIONS} questions allowed.` };
14761
+ }
14762
+ const questions = [];
14763
+ for (const raw of obj.questions) {
14764
+ if (raw === null || typeof raw !== "object") {
14765
+ return { error: "Each question must be an object." };
14766
+ }
14767
+ const q = raw;
14768
+ if (typeof q.question !== "string" || q.question.trim() === "") {
14769
+ return { error: 'Each question must have a non-empty "question" string.' };
14770
+ }
14771
+ if (!Array.isArray(q.options)) {
14772
+ return { error: `Question "${q.question}" must have an "options" array.` };
14773
+ }
14774
+ const options = [];
14775
+ for (const rawOpt of q.options.slice(0, MAX_OPTIONS_PER_QUESTION)) {
14776
+ if (rawOpt === null || typeof rawOpt !== "object")
14777
+ continue;
14778
+ const opt = rawOpt;
14779
+ options.push({
14780
+ label: typeof opt.label === "string" ? opt.label : "(untitled)",
14781
+ description: typeof opt.description === "string" ? opt.description : ""
14782
+ });
14783
+ }
14784
+ if (options.length < MIN_OPTIONS_PER_QUESTION) {
14785
+ return { error: `Question "${q.question}" must have at least ${MIN_OPTIONS_PER_QUESTION} options.` };
14786
+ }
14787
+ questions.push({
14788
+ question: q.question,
14789
+ options,
14790
+ multiSelect: q.multiSelect === true ? true : void 0
14791
+ });
14792
+ }
14793
+ return { questions };
14794
+ }
14748
14795
  var askUserQuestionTool = {
14749
14796
  name: "ask_user_question",
14750
14797
  implementation: () => ({
@@ -14754,44 +14801,31 @@ var askUserQuestionTool = {
14754
14801
  error: "ask_user_question is only available in the CLI environment."
14755
14802
  });
14756
14803
  }
14757
- const params = args;
14758
- if (!params.questions || !Array.isArray(params.questions) || params.questions.length === 0) {
14759
- return JSON.stringify({ error: "At least one question is required." });
14760
- }
14761
- if (params.questions.length > 4) {
14762
- return JSON.stringify({ error: "Maximum 4 questions allowed." });
14804
+ const validated = validateArgs(args);
14805
+ if ("error" in validated) {
14806
+ return JSON.stringify({ error: validated.error });
14763
14807
  }
14764
14808
  const payload = {
14765
- questions: params.questions.map((q) => ({
14809
+ questions: validated.questions.map((q) => ({
14766
14810
  question: q.question,
14767
- options: (q.options || []).slice(0, 4).map((o) => ({
14768
- label: o.label,
14769
- description: o.description
14770
- })),
14811
+ options: q.options,
14771
14812
  multiSelect: q.multiSelect === true
14772
14813
  }))
14773
14814
  };
14774
- for (const q of payload.questions) {
14775
- if (q.options.length < 2) {
14776
- return JSON.stringify({
14777
- error: `Question "${q.question}" must have at least 2 options.`
14778
- });
14779
- }
14780
- }
14781
14815
  const response = await _showUserQuestion(payload);
14782
14816
  return JSON.stringify(response);
14783
14817
  },
14784
14818
  toolSchema: {
14785
14819
  name: "ask_user_question",
14786
- description: 'Ask the user one or more structured questions with selectable options. Use this when you need clarification, user preferences, or decisions. Each question has 2-4 options. The user can also provide free-text via "Other". For multiSelect questions, the user can pick multiple options.',
14820
+ description: `Ask the user one or more structured questions with selectable options. Use this when you need clarification, user preferences, or decisions. Each question has ${MIN_OPTIONS_PER_QUESTION}-${MAX_OPTIONS_PER_QUESTION} options. The user can also provide free-text via "Other". For multiSelect questions, the user can pick multiple options.`,
14787
14821
  parameters: {
14788
14822
  type: "object",
14789
14823
  properties: {
14790
14824
  questions: {
14791
14825
  type: "array",
14792
- description: "Array of questions to ask (1-4 questions)",
14826
+ description: `Array of questions to ask (1-${MAX_QUESTIONS} questions)`,
14793
14827
  minItems: 1,
14794
- maxItems: 4,
14828
+ maxItems: MAX_QUESTIONS,
14795
14829
  items: {
14796
14830
  type: "object",
14797
14831
  properties: {
@@ -14801,9 +14835,9 @@ var askUserQuestionTool = {
14801
14835
  },
14802
14836
  options: {
14803
14837
  type: "array",
14804
- description: 'Available choices (2-4 options). An "Other" free-text option is always appended automatically.',
14805
- minItems: 2,
14806
- maxItems: 4,
14838
+ description: `Available choices (${MIN_OPTIONS_PER_QUESTION}-${MAX_OPTIONS_PER_QUESTION} options). An "Other" free-text option is always appended automatically.`,
14839
+ minItems: MIN_OPTIONS_PER_QUESTION,
14840
+ maxItems: MAX_OPTIONS_PER_QUESTION,
14807
14841
  items: {
14808
14842
  type: "object",
14809
14843
  properties: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bike4mind/cli",
3
- "version": "0.2.32-feat-ask-user-question.19782+79b1265be",
3
+ "version": "0.2.32-feat-ask-user-question.19783+6ce0f7b05",
4
4
  "type": "module",
5
5
  "description": "Interactive CLI tool for Bike4Mind with ReAct agents",
6
6
  "license": "UNLICENSED",
@@ -111,10 +111,10 @@
111
111
  },
112
112
  "devDependencies": {
113
113
  "@bike4mind/agents": "0.1.0",
114
- "@bike4mind/common": "2.53.1-feat-ask-user-question.19782+79b1265be",
115
- "@bike4mind/mcp": "1.32.1-feat-ask-user-question.19782+79b1265be",
116
- "@bike4mind/services": "2.51.1-feat-ask-user-question.19782+79b1265be",
117
- "@bike4mind/utils": "2.8.1-feat-ask-user-question.19782+79b1265be",
114
+ "@bike4mind/common": "2.53.1-feat-ask-user-question.19783+6ce0f7b05",
115
+ "@bike4mind/mcp": "1.32.1-feat-ask-user-question.19783+6ce0f7b05",
116
+ "@bike4mind/services": "2.51.1-feat-ask-user-question.19783+6ce0f7b05",
117
+ "@bike4mind/utils": "2.8.1-feat-ask-user-question.19783+6ce0f7b05",
118
118
  "@types/better-sqlite3": "^7.6.13",
119
119
  "@types/diff": "^5.0.9",
120
120
  "@types/jsonwebtoken": "^9.0.4",
@@ -135,5 +135,5 @@
135
135
  "optionalDependencies": {
136
136
  "@vscode/ripgrep": "^1.17.0"
137
137
  },
138
- "gitHead": "79b1265bed108dba0efe530cbc29d9a32e2a808b"
138
+ "gitHead": "6ce0f7b0546ad4c3222c3929978db020041bdb8e"
139
139
  }