@agimon-ai/doompi-user-feedback 0.0.1-alpha.69 → 0.0.1-alpha.70

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.
Files changed (193) hide show
  1. package/dist/{src/schemas/apiContracts.cjs → apiContracts.cjs} +5 -1
  2. package/dist/apiContracts.cjs.map +1 -0
  3. package/dist/{src/schemas/apiContracts.d.mts.map → apiContracts.d.mts.map} +1 -1
  4. package/dist/{src/schemas/apiContracts.mjs → apiContracts.mjs} +1 -1
  5. package/dist/apiContracts.mjs.map +1 -0
  6. package/dist/extensions/pi.cjs +495 -16
  7. package/dist/extensions/pi.cjs.map +1 -1
  8. package/dist/extensions/pi.d.mts +1 -1
  9. package/dist/extensions/pi.d.mts.map +1 -1
  10. package/dist/extensions/pi.mjs +483 -8
  11. package/dist/extensions/pi.mjs.map +1 -1
  12. package/dist/extensions/server.cjs +92 -10
  13. package/dist/extensions/server.cjs.map +1 -1
  14. package/dist/extensions/server.d.mts +1 -1
  15. package/dist/extensions/server.d.mts.map +1 -1
  16. package/dist/extensions/server.mjs +89 -7
  17. package/dist/extensions/server.mjs.map +1 -1
  18. package/dist/index.d.mts +49 -3
  19. package/dist/index.d.mts.map +1 -0
  20. package/dist/{_virtual/_rolldown/runtime.cjs → rolldown-runtime-VH7oDXx4.cjs} +6 -1
  21. package/dist/{src/tui/questionnaireComponent.mjs → runQuestionnaire-C4n_SWi2.mjs} +91 -2
  22. package/dist/runQuestionnaire-C4n_SWi2.mjs.map +1 -0
  23. package/dist/{src/tui/questionnaireComponent.cjs → runQuestionnaire-CRYC7DRF.cjs} +94 -2
  24. package/dist/runQuestionnaire-CRYC7DRF.cjs.map +1 -0
  25. package/dist/validationService-BuqweEhq.cjs +577 -0
  26. package/dist/validationService-BuqweEhq.cjs.map +1 -0
  27. package/dist/validationService-CS-VJaMo.mjs +500 -0
  28. package/dist/validationService-CS-VJaMo.mjs.map +1 -0
  29. package/package.json +17 -17
  30. package/dist/api-contracts.cjs +0 -7
  31. package/dist/api-contracts.d.cts +0 -2
  32. package/dist/api-contracts.d.mts +0 -2
  33. package/dist/api-contracts.mjs +0 -2
  34. package/dist/extensions/pi.d.cts +0 -5
  35. package/dist/extensions/pi.d.cts.map +0 -1
  36. package/dist/extensions/server.d.cts +0 -5
  37. package/dist/extensions/server.d.cts.map +0 -1
  38. package/dist/index.d.cts +0 -3
  39. package/dist/src/constants/questionnaire.cjs +0 -10
  40. package/dist/src/constants/questionnaire.cjs.map +0 -1
  41. package/dist/src/constants/questionnaire.mjs +0 -10
  42. package/dist/src/constants/questionnaire.mjs.map +0 -1
  43. package/dist/src/constants/tool.cjs +0 -23
  44. package/dist/src/constants/tool.cjs.map +0 -1
  45. package/dist/src/constants/tool.mjs +0 -17
  46. package/dist/src/constants/tool.mjs.map +0 -1
  47. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/root.cli.cjs +0 -145
  48. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/root.cli.cjs.map +0 -1
  49. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/root.cli.mjs +0 -145
  50. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/root.cli.mjs.map +0 -1
  51. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/root.server.cjs +0 -13
  52. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/root.server.cjs.map +0 -1
  53. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/root.server.mjs +0 -14
  54. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/root.server.mjs.map +0 -1
  55. package/dist/src/extensions/workspaces/sessions/(backend)/_tools/askUserHeadless.cjs +0 -71
  56. package/dist/src/extensions/workspaces/sessions/(backend)/_tools/askUserHeadless.cjs.map +0 -1
  57. package/dist/src/extensions/workspaces/sessions/(backend)/_tools/askUserHeadless.mjs +0 -71
  58. package/dist/src/extensions/workspaces/sessions/(backend)/_tools/askUserHeadless.mjs.map +0 -1
  59. package/dist/src/extensions/workspaces/sessions/(backend)/_tools/askUserQuestion.cjs +0 -128
  60. package/dist/src/extensions/workspaces/sessions/(backend)/_tools/askUserQuestion.cjs.map +0 -1
  61. package/dist/src/extensions/workspaces/sessions/(backend)/_tools/askUserQuestion.mjs +0 -128
  62. package/dist/src/extensions/workspaces/sessions/(backend)/_tools/askUserQuestion.mjs.map +0 -1
  63. package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/before-agent-start.cli.cjs +0 -6
  64. package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/before-agent-start.cli.cjs.map +0 -1
  65. package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/before-agent-start.cli.mjs +0 -6
  66. package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/before-agent-start.cli.mjs.map +0 -1
  67. package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/session-start.cli.cjs +0 -6
  68. package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/session-start.cli.cjs.map +0 -1
  69. package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/session-start.cli.mjs +0 -6
  70. package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/session-start.cli.mjs.map +0 -1
  71. package/dist/src/extensions/workspaces/sessions/(backend)/hook/before-agent-start.cli.cjs +0 -7
  72. package/dist/src/extensions/workspaces/sessions/(backend)/hook/before-agent-start.cli.cjs.map +0 -1
  73. package/dist/src/extensions/workspaces/sessions/(backend)/hook/before-agent-start.cli.mjs +0 -8
  74. package/dist/src/extensions/workspaces/sessions/(backend)/hook/before-agent-start.cli.mjs.map +0 -1
  75. package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-start.cli.cjs +0 -7
  76. package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-start.cli.cjs.map +0 -1
  77. package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-start.cli.mjs +0 -8
  78. package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-start.cli.mjs.map +0 -1
  79. package/dist/src/extensions/workspaces/sessions/(backend)/resource/_lib/doompi-use-user-feedback.cli.cjs +0 -15
  80. package/dist/src/extensions/workspaces/sessions/(backend)/resource/_lib/doompi-use-user-feedback.cli.cjs.map +0 -1
  81. package/dist/src/extensions/workspaces/sessions/(backend)/resource/_lib/doompi-use-user-feedback.cli.mjs +0 -15
  82. package/dist/src/extensions/workspaces/sessions/(backend)/resource/_lib/doompi-use-user-feedback.cli.mjs.map +0 -1
  83. package/dist/src/extensions/workspaces/sessions/(backend)/resource/doompi-use-user-feedback.cli.cjs +0 -7
  84. package/dist/src/extensions/workspaces/sessions/(backend)/resource/doompi-use-user-feedback.cli.cjs.map +0 -1
  85. package/dist/src/extensions/workspaces/sessions/(backend)/resource/doompi-use-user-feedback.cli.mjs +0 -8
  86. package/dist/src/extensions/workspaces/sessions/(backend)/resource/doompi-use-user-feedback.cli.mjs.map +0 -1
  87. package/dist/src/extensions/workspaces/sessions/(backend)/root.cli.cjs +0 -7
  88. package/dist/src/extensions/workspaces/sessions/(backend)/root.cli.cjs.map +0 -1
  89. package/dist/src/extensions/workspaces/sessions/(backend)/root.cli.mjs +0 -8
  90. package/dist/src/extensions/workspaces/sessions/(backend)/root.cli.mjs.map +0 -1
  91. package/dist/src/extensions/workspaces/sessions/(backend)/root.server.cjs +0 -7
  92. package/dist/src/extensions/workspaces/sessions/(backend)/root.server.cjs.map +0 -1
  93. package/dist/src/extensions/workspaces/sessions/(backend)/root.server.mjs +0 -8
  94. package/dist/src/extensions/workspaces/sessions/(backend)/root.server.mjs.map +0 -1
  95. package/dist/src/extensions/workspaces/sessions/(backend)/tool/askUserQuestion.cli.cjs +0 -9
  96. package/dist/src/extensions/workspaces/sessions/(backend)/tool/askUserQuestion.cli.cjs.map +0 -1
  97. package/dist/src/extensions/workspaces/sessions/(backend)/tool/askUserQuestion.cli.mjs +0 -10
  98. package/dist/src/extensions/workspaces/sessions/(backend)/tool/askUserQuestion.cli.mjs.map +0 -1
  99. package/dist/src/extensions/workspaces/sessions/(backend)/tool/askUserQuestion.server.cjs +0 -7
  100. package/dist/src/extensions/workspaces/sessions/(backend)/tool/askUserQuestion.server.cjs.map +0 -1
  101. package/dist/src/extensions/workspaces/sessions/(backend)/tool/askUserQuestion.server.mjs +0 -8
  102. package/dist/src/extensions/workspaces/sessions/(backend)/tool/askUserQuestion.server.mjs.map +0 -1
  103. package/dist/src/extensions/workspaces/sessions/(backend)/tool-restriction/_lib/ask-user-question.cli.cjs +0 -6
  104. package/dist/src/extensions/workspaces/sessions/(backend)/tool-restriction/_lib/ask-user-question.cli.cjs.map +0 -1
  105. package/dist/src/extensions/workspaces/sessions/(backend)/tool-restriction/_lib/ask-user-question.cli.mjs +0 -6
  106. package/dist/src/extensions/workspaces/sessions/(backend)/tool-restriction/_lib/ask-user-question.cli.mjs.map +0 -1
  107. package/dist/src/extensions/workspaces/sessions/(backend)/tool-restriction/ask-user-question.cli.cjs +0 -7
  108. package/dist/src/extensions/workspaces/sessions/(backend)/tool-restriction/ask-user-question.cli.cjs.map +0 -1
  109. package/dist/src/extensions/workspaces/sessions/(backend)/tool-restriction/ask-user-question.cli.mjs +0 -8
  110. package/dist/src/extensions/workspaces/sessions/(backend)/tool-restriction/ask-user-question.cli.mjs.map +0 -1
  111. package/dist/src/extensions/workspaces/sessions/(backend)/tool-restriction/askUserQuestion.server.cjs +0 -12
  112. package/dist/src/extensions/workspaces/sessions/(backend)/tool-restriction/askUserQuestion.server.cjs.map +0 -1
  113. package/dist/src/extensions/workspaces/sessions/(backend)/tool-restriction/askUserQuestion.server.mjs +0 -12
  114. package/dist/src/extensions/workspaces/sessions/(backend)/tool-restriction/askUserQuestion.server.mjs.map +0 -1
  115. package/dist/src/schemas/apiContracts.cjs.map +0 -1
  116. package/dist/src/schemas/apiContracts.d.cts +0 -53
  117. package/dist/src/schemas/apiContracts.d.cts.map +0 -1
  118. package/dist/src/schemas/apiContracts.mjs.map +0 -1
  119. package/dist/src/schemas/questionnaire.cjs +0 -37
  120. package/dist/src/schemas/questionnaire.cjs.map +0 -1
  121. package/dist/src/schemas/questionnaire.d.cts +0 -17
  122. package/dist/src/schemas/questionnaire.d.cts.map +0 -1
  123. package/dist/src/schemas/questionnaire.d.mts +0 -17
  124. package/dist/src/schemas/questionnaire.d.mts.map +0 -1
  125. package/dist/src/schemas/questionnaire.mjs +0 -35
  126. package/dist/src/schemas/questionnaire.mjs.map +0 -1
  127. package/dist/src/services/answerEnvelope/index.cjs +0 -116
  128. package/dist/src/services/answerEnvelope/index.cjs.map +0 -1
  129. package/dist/src/services/answerEnvelope/index.mjs +0 -115
  130. package/dist/src/services/answerEnvelope/index.mjs.map +0 -1
  131. package/dist/src/services/askUserToolGate/index.cjs +0 -16
  132. package/dist/src/services/askUserToolGate/index.cjs.map +0 -1
  133. package/dist/src/services/askUserToolGate/index.mjs +0 -16
  134. package/dist/src/services/askUserToolGate/index.mjs.map +0 -1
  135. package/dist/src/services/autonomousVoiceMode/index.cjs +0 -20
  136. package/dist/src/services/autonomousVoiceMode/index.cjs.map +0 -1
  137. package/dist/src/services/autonomousVoiceMode/index.mjs +0 -19
  138. package/dist/src/services/autonomousVoiceMode/index.mjs.map +0 -1
  139. package/dist/src/services/config/index.cjs +0 -47
  140. package/dist/src/services/config/index.cjs.map +0 -1
  141. package/dist/src/services/config/index.mjs +0 -41
  142. package/dist/src/services/config/index.mjs.map +0 -1
  143. package/dist/src/services/questionnaireCoordinator/index.cjs +0 -112
  144. package/dist/src/services/questionnaireCoordinator/index.cjs.map +0 -1
  145. package/dist/src/services/questionnaireCoordinator/index.mjs +0 -112
  146. package/dist/src/services/questionnaireCoordinator/index.mjs.map +0 -1
  147. package/dist/src/services/questionnaireService/index.cjs +0 -124
  148. package/dist/src/services/questionnaireService/index.cjs.map +0 -1
  149. package/dist/src/services/questionnaireService/index.mjs +0 -124
  150. package/dist/src/services/questionnaireService/index.mjs.map +0 -1
  151. package/dist/src/services/responseService/index.cjs +0 -50
  152. package/dist/src/services/responseService/index.cjs.map +0 -1
  153. package/dist/src/services/responseService/index.mjs +0 -43
  154. package/dist/src/services/responseService/index.mjs.map +0 -1
  155. package/dist/src/services/rpcQuestionnaire/index.cjs +0 -12
  156. package/dist/src/services/rpcQuestionnaire/index.cjs.map +0 -1
  157. package/dist/src/services/rpcQuestionnaire/index.mjs +0 -12
  158. package/dist/src/services/rpcQuestionnaire/index.mjs.map +0 -1
  159. package/dist/src/services/validationService/index.cjs +0 -62
  160. package/dist/src/services/validationService/index.cjs.map +0 -1
  161. package/dist/src/services/validationService/index.mjs +0 -56
  162. package/dist/src/services/validationService/index.mjs.map +0 -1
  163. package/dist/src/services/voiceQuestionHandoff/index.cjs +0 -61
  164. package/dist/src/services/voiceQuestionHandoff/index.cjs.map +0 -1
  165. package/dist/src/services/voiceQuestionHandoff/index.mjs +0 -57
  166. package/dist/src/services/voiceQuestionHandoff/index.mjs.map +0 -1
  167. package/dist/src/services/voiceQuestionNarration/index.cjs +0 -37
  168. package/dist/src/services/voiceQuestionNarration/index.cjs.map +0 -1
  169. package/dist/src/services/voiceQuestionNarration/index.mjs +0 -36
  170. package/dist/src/services/voiceQuestionNarration/index.mjs.map +0 -1
  171. package/dist/src/tui/askUserToolRender.cjs +0 -32
  172. package/dist/src/tui/askUserToolRender.cjs.map +0 -1
  173. package/dist/src/tui/askUserToolRender.mjs +0 -32
  174. package/dist/src/tui/askUserToolRender.mjs.map +0 -1
  175. package/dist/src/tui/externalEditor.cjs +0 -68
  176. package/dist/src/tui/externalEditor.cjs.map +0 -1
  177. package/dist/src/tui/externalEditor.mjs +0 -65
  178. package/dist/src/tui/externalEditor.mjs.map +0 -1
  179. package/dist/src/tui/questionnaireComponent.cjs.map +0 -1
  180. package/dist/src/tui/questionnaireComponent.mjs.map +0 -1
  181. package/dist/src/tui/runQuestionnaire.cjs +0 -32
  182. package/dist/src/tui/runQuestionnaire.cjs.map +0 -1
  183. package/dist/src/tui/runQuestionnaire.mjs +0 -32
  184. package/dist/src/tui/runQuestionnaire.mjs.map +0 -1
  185. package/dist/src/types/askUserWire.cjs +0 -39
  186. package/dist/src/types/askUserWire.cjs.map +0 -1
  187. package/dist/src/types/askUserWire.mjs +0 -37
  188. package/dist/src/types/askUserWire.mjs.map +0 -1
  189. package/dist/src/types/questionnaire.d.cts +0 -32
  190. package/dist/src/types/questionnaire.d.cts.map +0 -1
  191. package/dist/src/types/questionnaire.d.mts +0 -32
  192. package/dist/src/types/questionnaire.d.mts.map +0 -1
  193. /package/dist/{src/schemas/apiContracts.d.mts → apiContracts.d.mts} +0 -0
@@ -1,6 +1,10 @@
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
1
5
  //#region src/schemas/apiContracts.ts
2
6
  /** This facet contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
3
- const apiContracts = (0, require("@agimon-ai/doompi-core/api-contracts").defineApiContract)({
7
+ const apiContracts = (0, require("@agimon-ai/doompi-core/apiContracts").defineApiContract)({
4
8
  version: 1,
5
9
  http: [],
6
10
  sockets: [],
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apiContracts.cjs","names":["defineApiContract"],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract } from '@agimon-ai/doompi-core/apiContracts';\n\n/** This facet contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */\nexport const apiContracts = defineApiContract({ version: 1, http: [], sockets: [], dynamic: [] });\nexport default apiContracts;\n"],"mappings":";;;;;;AAGA,MAAa,gBAAA,gDAAeA,CAAAA,CAAAA,kBAAAA,CAAkB;CAAE,SAAS;CAAG,MAAM,CAAC;CAAG,SAAS,CAAC;CAAG,SAAS,CAAC;AAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"apiContracts.d.mts","names":[],"sources":["../../../src/schemas/apiContracts.ts"],"mappings":";;qBAGa"}
1
+ {"version":3,"file":"apiContracts.d.mts","names":[],"sources":["../src/schemas/apiContracts.ts"],"mappings":";;qBAGa"}
@@ -1,4 +1,4 @@
1
- import { defineApiContract } from "@agimon-ai/doompi-core/api-contracts";
1
+ import { defineApiContract } from "@agimon-ai/doompi-core/apiContracts";
2
2
  //#region src/schemas/apiContracts.ts
3
3
  /** This facet contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
4
4
  const apiContracts = defineApiContract({
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apiContracts.mjs","names":[],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract } from '@agimon-ai/doompi-core/apiContracts';\n\n/** This facet contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */\nexport const apiContracts = defineApiContract({ version: 1, http: [], sockets: [], dynamic: [] });\nexport default apiContracts;\n"],"mappings":";;;AAGA,MAAa,eAAe,kBAAkB;CAAE,SAAS;CAAG,MAAM,CAAC;CAAG,SAAS,CAAC;CAAG,SAAS,CAAC;AAAE,CAAC"}
@@ -2,39 +2,518 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_root_cli = require("../src/extensions/workspaces/sessions/(backend)/root.cli.cjs");
6
- const require_before_agent_start_cli = require("../src/extensions/workspaces/sessions/(backend)/hook/before-agent-start.cli.cjs");
7
- const require_session_start_cli = require("../src/extensions/workspaces/sessions/(backend)/hook/session-start.cli.cjs");
8
- const require_doompi_use_user_feedback_cli = require("../src/extensions/workspaces/sessions/(backend)/resource/doompi-use-user-feedback.cli.cjs");
9
- const require_ask_user_question_cli = require("../src/extensions/workspaces/sessions/(backend)/tool-restriction/ask-user-question.cli.cjs");
10
- const require_askUserQuestion_cli = require("../src/extensions/workspaces/sessions/(backend)/tool/askUserQuestion.cli.cjs");
11
- let _agimon_ai_doompi_core_pi_extension = require("@agimon-ai/doompi-core/pi-extension");
12
- let _agimon_ai_doompi_core_extension_file = require("@agimon-ai/doompi-core/extension-file");
5
+ const require_rolldown_runtime = require("../rolldown-runtime-VH7oDXx4.cjs");
6
+ const require_validationService = require("../validationService-BuqweEhq.cjs");
7
+ let _agimon_ai_doompi_core_piExtension = require("@agimon-ai/doompi-core/piExtension");
8
+ let _agimon_ai_doompi_core_extensionFile = require("@agimon-ai/doompi-core/extensionFile");
9
+ let _agimon_ai_doompi_core_narration = require("@agimon-ai/doompi-core/narration");
10
+ let _agimon_ai_doompi_minor_mode = require("@agimon-ai/doompi-minor-mode");
11
+ let _agimon_ai_doompi_core_voiceTools = require("@agimon-ai/doompi-core/voiceTools");
12
+ let _agimon_ai_doompi_ui_toolChrome = require("@agimon-ai/doompi-ui/toolChrome");
13
+ let _agimon_ai_doompi_core_askUser = require("@agimon-ai/doompi-core/askUser");
14
+ let node_fs = require("node:fs");
15
+ node_fs = require_rolldown_runtime.__toESM(node_fs, 1);
16
+ let node_os = require("node:os");
17
+ node_os = require_rolldown_runtime.__toESM(node_os, 1);
18
+ let node_path = require("node:path");
19
+ node_path = require_rolldown_runtime.__toESM(node_path, 1);
20
+ //#region src/services/askUserToolGate/index.ts
21
+ /**
22
+ * Hides the questionnaire tool while nobody can answer it.
23
+ *
24
+ * Autonomous Voice narrates its own question and then waits for the spoken reply, so a
25
+ * questionnaire tool alongside it asks the same thing twice. A run without UI cannot render
26
+ * the questionnaire at all. Both cases only ever remove the name: the tool surface recomputes
27
+ * from every registered tool, so a visible gate restores it without tracking what it hid.
28
+ */
29
+ function askUserToolRestriction(toolName, visible) {
30
+ return (incoming) => visible ? incoming : incoming.filter((name) => name !== toolName);
31
+ }
32
+ //#endregion
33
+ //#region src/services/autonomousVoiceMode/index.ts
34
+ /**
35
+ * Matches only the Voice package's own autonomous mode, and only while it reports active.
36
+ *
37
+ * Both the source and the mode id are checked because another package may register a mode
38
+ * under the same id, and a transitional `activating` or `deactivating` record is not yet
39
+ * (or no longer) speaking.
40
+ */
41
+ function isAutonomousVoiceRecord(record) {
42
+ return record.descriptor.source === _agimon_ai_doompi_core_voiceTools.DOOM_VOICE_SOURCE && record.descriptor.id === _agimon_ai_doompi_core_voiceTools.DOOM_VOICE_AUTO_MODE_ID && record.state.activation === "active";
43
+ }
44
+ function isAutonomousVoiceActive(records) {
45
+ return records.some((record) => isAutonomousVoiceRecord(record));
46
+ }
47
+ //#endregion
48
+ //#region src/services/voiceQuestionNarration/index.ts
49
+ const MAX_QUESTION_CHARACTERS = 240;
50
+ const MAX_OPTION_CHARACTERS = 80;
51
+ const PATH_PATTERN = /\/(?:Users|home|private|tmp|var)\/[^\s,;:]+/gu;
52
+ const TOKEN_PATTERN = /\b(?:sk|api|token|key)[-_][A-Za-z0-9_-]{12,}\b/giu;
53
+ const CODE_PATTERN = /`[^`]*`|<\/?[A-Za-z][^>]*>|\$\([^)]*\)|\{[^}]*\}/gu;
54
+ const SAFE_FALLBACK = "I need your answer to the questions shown in the conversation.";
55
+ function takeCharacters(text, maximum) {
56
+ return Array.from(text).slice(0, maximum).join("").trim();
57
+ }
58
+ function sanitizeVoiceQuestionText(text, maximum) {
59
+ return takeCharacters(Array.from(text, (character) => {
60
+ const codePoint = character.codePointAt(0) ?? 0;
61
+ return codePoint < 32 || codePoint === 127 ? " " : character;
62
+ }).join("").replace(PATH_PATTERN, " ").replace(TOKEN_PATTERN, " ").replace(CODE_PATTERN, " ").replace(/\s+/gu, " ").trim(), maximum);
63
+ }
64
+ function spokenQuestion(params, questionIndex) {
65
+ const question = params.questions[questionIndex];
66
+ if (!question) return "";
67
+ const position = questionIndex + 1;
68
+ const prompt = sanitizeVoiceQuestionText(question.question, MAX_QUESTION_CHARACTERS) || `Question ${position} needs your choice`;
69
+ const labels = question.options.map((option, optionIndex) => {
70
+ const label = sanitizeVoiceQuestionText(option.label, MAX_OPTION_CHARACTERS);
71
+ return `${optionIndex + 1}, ${label || `option ${optionIndex + 1}`}`;
72
+ });
73
+ const selection = question.multiSelect ? "You may choose more than one option." : "Please choose one option.";
74
+ return `Question ${position}: ${prompt}. Options: ${labels.join("; ")}. ${selection} You may also answer in your own words.`;
75
+ }
76
+ function buildVoiceQuestionNarration(params) {
77
+ return sanitizeVoiceQuestionText(params.questions.map((_question, index) => spokenQuestion(params, index)).join(" "), _agimon_ai_doompi_core_narration.MAX_NARRATION_TEXT_CHARACTERS) || SAFE_FALLBACK;
78
+ }
79
+ //#endregion
80
+ //#region src/services/voiceQuestionHandoff/index.ts
81
+ const VOICE_WAIT_MESSAGE = "The questions were spoken through autonomous voice. Stop now and wait for the user's next message; it will arrive as an ordinary user message.";
82
+ function formatVoiceQuestionPrompt(params) {
83
+ const numberQuestions = params.questions.length > 1;
84
+ return params.questions.map((question, questionIndex) => {
85
+ return [
86
+ `${numberQuestions ? `${questionIndex + 1}. ` : ""}${question.question}${question.multiSelect ? " (Select all that apply.)" : ""}`,
87
+ ...question.options.map((option, optionIndex) => ` ${optionIndex + 1}. ${option.label}`),
88
+ " Type something."
89
+ ].join("\n");
90
+ }).join("\n\n");
91
+ }
92
+ var VoiceQuestionHandoff = class {
93
+ modes;
94
+ narration;
95
+ buildNarration;
96
+ constructor(modes, narration, buildNarration = buildVoiceQuestionNarration) {
97
+ this.modes = modes;
98
+ this.narration = narration;
99
+ this.buildNarration = buildNarration;
100
+ }
101
+ async handoff(params) {
102
+ if (!this.modes.list().some((record) => isAutonomousVoiceRecord(record))) return void 0;
103
+ const narration = (0, _agimon_ai_doompi_core_narration.createNarrationRequest)(this.buildNarration(params));
104
+ if (!narration) return void 0;
105
+ await this.narration.request(narration);
106
+ return {
107
+ answers: [],
108
+ cancelled: false,
109
+ delivery: "voice",
110
+ awaitingResponse: true,
111
+ voicePrompt: formatVoiceQuestionPrompt(params)
112
+ };
113
+ }
114
+ };
115
+ /** Create a handoff from services whose lifecycle is owned by a Cordis injection. */
116
+ function createVoiceQuestionHandoff(modes, narration) {
117
+ return new VoiceQuestionHandoff(modes, narration);
118
+ }
119
+ function buildVoiceToolResult(details) {
120
+ const prompt = details.voicePrompt?.trim();
121
+ return {
122
+ content: [{
123
+ type: "text",
124
+ text: prompt ? `${prompt}\n\n${VOICE_WAIT_MESSAGE}` : VOICE_WAIT_MESSAGE
125
+ }],
126
+ details,
127
+ terminate: true
128
+ };
129
+ }
130
+ //#endregion
131
+ //#region src/extensions/workspaces/sessions/(backend)/_lib/root.cli.ts
132
+ function cancelledResult() {
133
+ return {
134
+ answers: [],
135
+ cancelled: true
136
+ };
137
+ }
138
+ const root = (0, _agimon_ai_doompi_core_extensionFile.defineRoot)((_context) => {
139
+ let active = true;
140
+ let sessionGeneration = 0;
141
+ let sessionId;
142
+ let sessionReady = false;
143
+ let coordinator = new require_validationService.QuestionnaireCoordinator();
144
+ let voiceHandoff;
145
+ let voiceActive = false;
146
+ let hasUI = true;
147
+ const restrictionListeners = /* @__PURE__ */ new Set();
148
+ const currentRestriction = () => askUserToolRestriction(require_validationService.ASK_USER_QUESTION_TOOL_NAME, hasUI && !voiceActive);
149
+ const syncToolRestriction = () => restrictionListeners.forEach((listener) => listener());
150
+ let lifecycleQueue = Promise.resolve();
151
+ const pendingOperations = /* @__PURE__ */ new Set();
152
+ const trackOperation = (operation) => {
153
+ pendingOperations.add(operation);
154
+ operation.then(() => pendingOperations.delete(operation), () => pendingOperations.delete(operation));
155
+ return operation;
156
+ };
157
+ const ownsGeneration = (generation, expectedSessionId) => active && generation === sessionGeneration && expectedSessionId === sessionId;
158
+ const isContextActive = (context, signal) => active && sessionReady && signal?.aborted !== true && context.sessionManager.getSessionId() === sessionId;
159
+ const shutdownRuntime = async () => {
160
+ if (!active) return;
161
+ const ownedCoordinator = coordinator;
162
+ ownedCoordinator.shutdown();
163
+ active = false;
164
+ sessionGeneration += 1;
165
+ sessionReady = false;
166
+ sessionId = void 0;
167
+ await Promise.allSettled(pendingOperations);
168
+ await ownedCoordinator.waitForIdle();
169
+ };
170
+ const toolDependencies = {
171
+ enqueue: (runner, signal) => {
172
+ const ownedCoordinator = coordinator;
173
+ const generation = sessionGeneration;
174
+ const expectedSessionId = sessionId;
175
+ if (!sessionReady || !ownsGeneration(generation, expectedSessionId) || signal?.aborted) return Promise.resolve(cancelledResult());
176
+ return ownedCoordinator.enqueue(async (context) => {
177
+ if (!sessionReady || !ownsGeneration(generation, expectedSessionId) || context.signal.aborted) return cancelledResult();
178
+ const result = await runner({
179
+ ...context,
180
+ reportProgress: (progress) => {
181
+ if (ownsGeneration(generation, expectedSessionId) && !context.signal.aborted) context.reportProgress(progress);
182
+ }
183
+ });
184
+ return sessionReady && ownsGeneration(generation, expectedSessionId) && !context.signal.aborted ? result : cancelledResult();
185
+ }, signal);
186
+ },
187
+ isActive: isContextActive,
188
+ runTui: async (context, params, collapseKey, signal, reportProgress) => {
189
+ if (!isContextActive(context, signal)) return void 0;
190
+ const { runTuiQuestionnaire } = await Promise.resolve().then(() => require("../runQuestionnaire-CRYC7DRF.cjs"));
191
+ if (!isContextActive(context, signal)) return void 0;
192
+ const result = await runTuiQuestionnaire(context, params, collapseKey, signal, reportProgress);
193
+ return isContextActive(context, signal) ? result : void 0;
194
+ },
195
+ tryVoice: (params) => active && sessionReady ? voiceHandoff?.handoff(params) : void 0
196
+ };
197
+ const beforeAgentStart = (_event, context) => {
198
+ if (!isContextActive(context)) return;
199
+ hasUI = context.hasUI;
200
+ syncToolRestriction();
201
+ };
202
+ const sessionStart = (_event, context) => {
203
+ if (!active) return;
204
+ const previousCoordinator = coordinator;
205
+ previousCoordinator.shutdown();
206
+ const activeSessionId = context.sessionManager.getSessionId();
207
+ const generation = ++sessionGeneration;
208
+ coordinator = new require_validationService.QuestionnaireCoordinator();
209
+ sessionId = activeSessionId;
210
+ sessionReady = false;
211
+ const initializeSession = async () => {
212
+ await previousCoordinator.waitForIdle();
213
+ if (!ownsGeneration(generation, activeSessionId)) return;
214
+ sessionReady = true;
215
+ };
216
+ const operation = lifecycleQueue.then(initializeSession, initializeSession);
217
+ lifecycleQueue = operation.catch(() => void 0);
218
+ return trackOperation(operation);
219
+ };
220
+ return {
221
+ value: {
222
+ toolDependencies,
223
+ beforeAgentStart,
224
+ sessionStart,
225
+ toolRestriction: {
226
+ source: "@agimon-ai/doompi-user-feedback",
227
+ get restrict() {
228
+ return currentRestriction();
229
+ },
230
+ subscribe(listener) {
231
+ restrictionListeners.add(listener);
232
+ return () => {
233
+ restrictionListeners.delete(listener);
234
+ };
235
+ }
236
+ }
237
+ },
238
+ services: [(serviceContextOwner) => {
239
+ serviceContextOwner.inject([_agimon_ai_doompi_minor_mode.DOOM_MINOR_MODE_CATALOG_SERVICE, _agimon_ai_doompi_core_narration.DOOM_NARRATION_SERVICE], (serviceContext) => {
240
+ const handoff = createVoiceQuestionHandoff((0, _agimon_ai_doompi_minor_mode.requireMinorModeCatalog)(serviceContext), (0, _agimon_ai_doompi_core_narration.requireDoomNarrationService)(serviceContext));
241
+ voiceHandoff = handoff;
242
+ return () => {
243
+ if (voiceHandoff === handoff) voiceHandoff = void 0;
244
+ };
245
+ });
246
+ serviceContextOwner.inject([_agimon_ai_doompi_minor_mode.DOOM_MINOR_MODE_CATALOG_SERVICE], (modeContext) => {
247
+ const modes = (0, _agimon_ai_doompi_minor_mode.requireMinorModeCatalog)(modeContext);
248
+ const apply = () => {
249
+ voiceActive = isAutonomousVoiceActive(modes.list());
250
+ syncToolRestriction();
251
+ };
252
+ const unsubscribe = modes.subscribe(apply);
253
+ apply();
254
+ return () => {
255
+ unsubscribe();
256
+ voiceActive = false;
257
+ syncToolRestriction();
258
+ };
259
+ });
260
+ }],
261
+ onDispose: shutdownRuntime
262
+ };
263
+ });
264
+ //#endregion
265
+ //#region src/extensions/workspaces/sessions/(backend)/root.cli.ts
266
+ var root_cli_default = (0, _agimon_ai_doompi_core_extensionFile.defineRoot)(root);
267
+ //#endregion
268
+ //#region src/extensions/workspaces/sessions/(backend)/hook/_lib/before-agent-start.cli.ts
269
+ var before_agent_start_cli_default$1 = (context) => context.root.beforeAgentStart;
270
+ //#endregion
271
+ //#region src/extensions/workspaces/sessions/(backend)/hook/before-agent-start.cli.ts
272
+ var before_agent_start_cli_default = (0, _agimon_ai_doompi_core_extensionFile.defineCliHook)(before_agent_start_cli_default$1);
273
+ //#endregion
274
+ //#region src/extensions/workspaces/sessions/(backend)/hook/_lib/session-start.cli.ts
275
+ var session_start_cli_default$1 = (context) => context.root.sessionStart;
276
+ //#endregion
277
+ //#region src/extensions/workspaces/sessions/(backend)/hook/session-start.cli.ts
278
+ var session_start_cli_default = (0, _agimon_ai_doompi_core_extensionFile.defineCliHook)(session_start_cli_default$1);
279
+ //#endregion
280
+ //#region src/extensions/workspaces/sessions/(backend)/resource/_lib/doompi-use-user-feedback.cli.ts
281
+ function createDoompiUseUserFeedbackResource(moduleUrl) {
282
+ return {
283
+ source: "@agimon-ai/doompi-user-feedback",
284
+ moduleUrl,
285
+ skills: [{
286
+ name: "doompi-use-user-feedback",
287
+ description: "Use @agimon-ai/doompi-user-feedback: Structured user questions with interactive and autonomous Voice handoff for Pi agents."
288
+ }]
289
+ };
290
+ }
291
+ //#endregion
292
+ //#region src/extensions/workspaces/sessions/(backend)/resource/doompi-use-user-feedback.cli.ts
293
+ var doompi_use_user_feedback_cli_default = (0, _agimon_ai_doompi_core_extensionFile.defineResource)(createDoompiUseUserFeedbackResource(require("url").pathToFileURL(__filename).href));
294
+ //#endregion
295
+ //#region src/extensions/workspaces/sessions/(backend)/tool-restriction/_lib/ask-user-question.cli.ts
296
+ var ask_user_question_cli_default$1 = (context) => context.root.toolRestriction;
297
+ //#endregion
298
+ //#region src/extensions/workspaces/sessions/(backend)/tool-restriction/ask-user-question.cli.ts
299
+ var ask_user_question_cli_default = (0, _agimon_ai_doompi_core_extensionFile.defineToolRestriction)(ask_user_question_cli_default$1);
300
+ //#endregion
301
+ //#region src/tui/askUserToolRender.ts
302
+ const askUserToolRender = {
303
+ renderCall(args, theme) {
304
+ const params = args;
305
+ const headers = params.questions.map((question) => question.header).join(", ");
306
+ const count = `${params.questions.length} question${params.questions.length === 1 ? "" : "s"}`;
307
+ const heading = (0, _agimon_ai_doompi_ui_toolChrome.renderToolHeading)("ask", count, theme);
308
+ return new _agimon_ai_doompi_ui_toolChrome.DoomToolCall(headers ? `${heading} ${theme.fg("dim", `(${headers})`)}` : heading);
309
+ },
310
+ renderResult(result, _options, theme, context) {
311
+ const details = result.details;
312
+ if (!details) {
313
+ const raw = result.content.filter((block) => block.type === "text").map((block) => block.text).join("\n");
314
+ const color = context.isError ? "error" : "toolOutput";
315
+ const fallback = context.isError ? "✗ failed" : "✓ submitted";
316
+ return new _agimon_ai_doompi_ui_toolChrome.DoomToolResult([theme.fg(color, raw || fallback)], theme, { wrap: true });
317
+ }
318
+ if (details.cancelled) return new _agimon_ai_doompi_ui_toolChrome.DoomToolResult([theme.fg("warning", "◐") + theme.fg("dim", " cancelled")], theme);
319
+ if (details.delivery === "voice" && details.voicePrompt) return new _agimon_ai_doompi_ui_toolChrome.DoomToolResult([theme.fg("toolOutput", details.voicePrompt)], theme, { wrap: true });
320
+ const lines = details.answers.map((answer) => {
321
+ const scalar = answer.kind === "multi" ? (answer.selected ?? []).join(", ") : answer.answer;
322
+ return `${theme.fg("success", "✓")} ${theme.fg("accent", answer.question)}: ${theme.fg("toolOutput", scalar ?? "")}`;
323
+ });
324
+ if (lines.length === 0) lines.push(theme.fg("success", "✓") + theme.fg("dim", " submitted"));
325
+ return new _agimon_ai_doompi_ui_toolChrome.DoomToolResult(lines, theme, { wrap: true });
326
+ }
327
+ };
328
+ //#endregion
329
+ //#region src/services/config/index.ts
330
+ const DEFAULT_COLLAPSE_KEY = "ctrl+]";
331
+ function legacyConfigPath(environment) {
332
+ const configRoot = environment.XDG_CONFIG_HOME?.trim() || node_path.default.join(node_os.default.homedir(), ".config");
333
+ return node_path.default.join(configRoot, "rpiv-ask-user-question", "config.json");
334
+ }
335
+ function isRecord(value) {
336
+ return typeof value === "object" && value !== null && !Array.isArray(value);
337
+ }
338
+ function loadUserFeedbackConfig(environment = process.env) {
339
+ const filePath = legacyConfigPath(environment);
340
+ if (!node_fs.default.existsSync(filePath)) return {};
341
+ try {
342
+ const parsed = JSON.parse(node_fs.default.readFileSync(filePath, "utf8"));
343
+ if (!isRecord(parsed)) return {};
344
+ const rawGuidance = isRecord(parsed.guidance) ? parsed.guidance : void 0;
345
+ const guidance = rawGuidance ? {
346
+ ...typeof rawGuidance.promptSnippet === "string" ? { promptSnippet: rawGuidance.promptSnippet } : {},
347
+ ...Array.isArray(rawGuidance.promptGuidelines) && rawGuidance.promptGuidelines.every((item) => typeof item === "string") ? { promptGuidelines: rawGuidance.promptGuidelines } : {}
348
+ } : void 0;
349
+ return {
350
+ ...typeof parsed.collapseKey === "string" ? { collapseKey: parsed.collapseKey } : {},
351
+ ...guidance ? { guidance } : {}
352
+ };
353
+ } catch {
354
+ return {};
355
+ }
356
+ }
357
+ function resolveCollapseKey(config) {
358
+ const value = config.collapseKey?.trim().toLowerCase();
359
+ if (!value) return DEFAULT_COLLAPSE_KEY;
360
+ if (value === "off") return "off";
361
+ return /^[a-z0-9_+\-\]{}]+$/u.test(value) ? value : DEFAULT_COLLAPSE_KEY;
362
+ }
363
+ //#endregion
364
+ //#region src/services/rpcQuestionnaire/index.ts
365
+ async function runRpcQuestionnaire(context, params, signal, reportProgress) {
366
+ return require_validationService.runQuestionnaire({
367
+ select: (title, options, interactionSignal) => context.ui.select(title, [...options], { signal: interactionSignal }),
368
+ input: (title, placeholder, interactionSignal) => context.ui.input(title, placeholder, { signal: interactionSignal })
369
+ }, params, signal, reportProgress);
370
+ }
371
+ //#endregion
372
+ //#region src/extensions/workspaces/sessions/(backend)/_tools/askUserQuestion.ts
373
+ function emitPrompt(cordis, params) {
374
+ const payload = { questions: params.questions.map((question) => ({
375
+ question: question.question,
376
+ header: question.header,
377
+ multiSelect: question.multiSelect ?? false,
378
+ options: question.options.map((option) => ({
379
+ label: option.label,
380
+ description: option.description,
381
+ hasPreview: Boolean(option.preview)
382
+ }))
383
+ })) };
384
+ cordis.emit(_agimon_ai_doompi_core_askUser.DOOM_ASK_USER_PROMPT_EVENT, payload);
385
+ }
386
+ function emitBlocked(cordis, active) {
387
+ const payload = { active };
388
+ cordis.emit(_agimon_ai_doompi_core_askUser.DOOM_ASK_USER_BLOCKED_EVENT, payload);
389
+ }
390
+ function hasDialogUI(context) {
391
+ const ui = context.ui;
392
+ return typeof ui.select === "function" && typeof ui.input === "function";
393
+ }
394
+ function createAskUserQuestionTool(cordis, dependencies, renderers = {}) {
395
+ const configuredGuidance = loadUserFeedbackConfig().guidance;
396
+ return {
397
+ name: require_validationService.ASK_USER_QUESTION_TOOL_NAME,
398
+ label: "Ask User Question",
399
+ renderShell: "self",
400
+ description: `Ask the user one or more structured questions during execution. Use when you need to:
401
+ 1. Gather user preferences or requirements
402
+ 2. Clarify ambiguous instructions
403
+ 3. Get decisions on implementation choices as you work
404
+ 4. Offer choices to the user about what direction to take
405
+
406
+ Usage notes:
407
+ - Users can type a custom answer via the automatically appended "Type something." row on every question or press Esc to abandon the questionnaire. Do NOT author "Other" or "Type something." labels yourself, reserved labels are rejected at runtime.
408
+ - Use multiSelect: true when multiple answers are valid.
409
+ - If you recommend a specific option, make that the first option and add "(Recommended)" at the end of the label.
410
+
411
+ Preview feature:
412
+ Use the optional preview field for ASCII mockups, code snippets, diagrams, or configuration examples that users should compare visually. Do not use previews for simple preference questions.`,
413
+ promptSnippet: configuredGuidance?.promptSnippet ?? require_validationService.DEFAULT_PROMPT_SNIPPET,
414
+ promptGuidelines: configuredGuidance?.promptGuidelines ?? require_validationService.DEFAULT_PROMPT_GUIDELINES,
415
+ parameters: require_validationService.QuestionParamsSchema,
416
+ executionMode: "sequential",
417
+ async execute(_toolCallId, params, signal, _onUpdate, context) {
418
+ const typed = params;
419
+ const isActive = (activeSignal) => dependencies.isActive?.(context, activeSignal) ?? true;
420
+ const cancelled = () => ({
421
+ answers: [],
422
+ cancelled: true
423
+ });
424
+ if (!isActive(signal)) return require_validationService.buildToolResult(require_validationService.ERROR_SESSION_INACTIVE, cancelled());
425
+ if (!context.hasUI) return require_validationService.buildToolResult(require_validationService.ERROR_NO_UI, {
426
+ answers: [],
427
+ cancelled: true,
428
+ error: "no_ui"
429
+ });
430
+ const validation = require_validationService.validateQuestionnaire(typed);
431
+ if (!validation.ok) return require_validationService.buildToolResult(validation.message, {
432
+ answers: [],
433
+ cancelled: true,
434
+ error: validation.error
435
+ });
436
+ try {
437
+ const result = await dependencies.enqueue(async ({ signal: activeSignal, reportProgress }) => {
438
+ if (!isActive(activeSignal)) return cancelled();
439
+ emitPrompt(cordis, typed);
440
+ const voiceResult = await dependencies.tryVoice?.(typed);
441
+ if (voiceResult) return voiceResult;
442
+ let blocked = true;
443
+ const clearBlocked = () => {
444
+ if (!blocked) return;
445
+ blocked = false;
446
+ if (isActive()) emitBlocked(cordis, false);
447
+ };
448
+ activeSignal.addEventListener("abort", clearBlocked, { once: true });
449
+ emitBlocked(cordis, true);
450
+ try {
451
+ if (!isActive(activeSignal)) return cancelled();
452
+ if (context.mode === "rpc" && hasDialogUI(context)) {
453
+ const rpcResult = await runRpcQuestionnaire(context, typed, activeSignal, reportProgress);
454
+ return isActive(activeSignal) ? rpcResult : cancelled();
455
+ }
456
+ const tuiResult = await dependencies.runTui(context, typed, resolveCollapseKey(loadUserFeedbackConfig()), activeSignal, reportProgress);
457
+ if (!isActive(activeSignal)) return cancelled();
458
+ if (tuiResult !== void 0) return tuiResult;
459
+ if (hasDialogUI(context)) {
460
+ const rpcResult = await runRpcQuestionnaire(context, typed, activeSignal, reportProgress);
461
+ return isActive(activeSignal) ? rpcResult : cancelled();
462
+ }
463
+ return {
464
+ answers: [],
465
+ cancelled: true,
466
+ error: "no_custom_ui"
467
+ };
468
+ } finally {
469
+ activeSignal.removeEventListener("abort", clearBlocked);
470
+ clearBlocked();
471
+ }
472
+ }, signal);
473
+ if (result.delivery === "voice") return buildVoiceToolResult(result);
474
+ if (result.error === "no_custom_ui") return require_validationService.buildToolResult(require_validationService.ERROR_NO_CUSTOM_UI, result);
475
+ return require_validationService.buildQuestionnaireResponse(result, typed);
476
+ } catch (error) {
477
+ const cause = error instanceof Error ? error.message : String(error);
478
+ return require_validationService.buildToolResult(`${require_validationService.ERROR_SESSION_LOAD_FAILED} (cause: ${cause})`, {
479
+ answers: [],
480
+ cancelled: true,
481
+ error: "session_load_failed"
482
+ });
483
+ }
484
+ },
485
+ ...renderers
486
+ };
487
+ }
488
+ //#endregion
489
+ //#region src/extensions/workspaces/sessions/(backend)/tool/askUserQuestion.cli.ts
490
+ var askUserQuestion_cli_default = (0, _agimon_ai_doompi_core_extensionFile.defineCliTool)((context) => (0, _agimon_ai_doompi_core_piExtension.definePiTool)(createAskUserQuestionTool(context.context, context.root.toolDependencies, askUserToolRender)));
491
+ //#endregion
13
492
  //#region generated/pi.ts
14
493
  const at = (value, context) => typeof value === "function" ? value(context) : value;
15
494
  const via = (identity, value) => ({
16
495
  ...identity,
17
496
  ...value
18
497
  });
19
- const extension = (0, _agimon_ai_doompi_core_pi_extension.definePiExtension)("@agimon-ai/doompi-user-feedback", async (context) => {
20
- const scopeSession = await require_root_cli.default(context);
498
+ const extension = (0, _agimon_ai_doompi_core_piExtension.definePiExtension)("@agimon-ai/doompi-user-feedback", async (context) => {
499
+ const scopeSession = await root_cli_default(context);
21
500
  const contextSession = {
22
501
  ...context,
23
502
  root: scopeSession.value
24
503
  };
25
504
  return {
26
- ...(0, _agimon_ai_doompi_core_extension_file.composeRootHooks)(scopeSession),
505
+ ...(0, _agimon_ai_doompi_core_extensionFile.composeRootHooks)(scopeSession),
27
506
  events: {
28
- before_agent_start: at(require_before_agent_start_cli.default, contextSession),
29
- session_start: at(require_session_start_cli.default, contextSession)
507
+ before_agent_start: at(before_agent_start_cli_default, contextSession),
508
+ session_start: at(session_start_cli_default, contextSession)
30
509
  },
31
510
  get resources() {
32
- return [at(require_doompi_use_user_feedback_cli.default, contextSession)];
511
+ return [at(doompi_use_user_feedback_cli_default, contextSession)];
33
512
  },
34
513
  get toolRestrictions() {
35
- return [at(require_ask_user_question_cli.default, contextSession)];
514
+ return [at(ask_user_question_cli_default, contextSession)];
36
515
  },
37
- ...(0, _agimon_ai_doompi_core_pi_extension.piToolContributions)("@agimon-ai/doompi-user-feedback", [via({ name: "ask_user_question" }, at(require_askUserQuestion_cli.default, contextSession))]),
516
+ ...(0, _agimon_ai_doompi_core_piExtension.piToolContributions)("@agimon-ai/doompi-user-feedback", [via({ name: "ask_user_question" }, at(askUserQuestion_cli_default, contextSession))]),
38
517
  services: [...scopeSession.services ?? []]
39
518
  };
40
519
  });