@kubbisec/ai-linux-arm64 0.1.22 → 0.1.23

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 (358) hide show
  1. package/bin/kubbisec +0 -0
  2. package/bundled/components/kubbisec-model-selector.d.ts +34 -47
  3. package/bundled/components/kubbisec-model-selector.js +177 -187
  4. package/bundled/components/kubbisec-model-selector.js.map +1 -1
  5. package/bundled/config/config.d.ts +6 -6
  6. package/bundled/config/config.d.ts.map +1 -1
  7. package/bundled/config/config.js +52 -54
  8. package/bundled/config/config.js.map +1 -1
  9. package/bundled/config/detect-local-llm-providers.d.ts +16 -26
  10. package/bundled/config/detect-local-llm-providers.js +142 -130
  11. package/bundled/config/ensure-kbs-project-settings.d.ts +20 -0
  12. package/bundled/config/ensure-kbs-project-settings.d.ts.map +1 -0
  13. package/bundled/config/ensure-kbs-project-settings.js +46 -0
  14. package/bundled/config/ensure-kbs-project-settings.js.map +1 -0
  15. package/bundled/config/ensure-kubbisec-project-settings.d.ts +11 -9
  16. package/bundled/config/ensure-kubbisec-project-settings.d.ts.map +1 -1
  17. package/bundled/config/ensure-kubbisec-project-settings.js +72 -44
  18. package/bundled/config/ensure-kubbisec-project-settings.js.map +1 -1
  19. package/bundled/config/extended-context.d.ts +6 -5
  20. package/bundled/config/extended-context.js +22 -23
  21. package/bundled/config/feature-flags.d.ts +2 -10
  22. package/bundled/config/feature-flags.js +2 -8
  23. package/bundled/config/format-kubbisec-footer-status.d.ts +1 -1
  24. package/bundled/config/format-kubbisec-footer-status.js +31 -26
  25. package/bundled/config/kubbisec-extension-manifest.d.ts +2 -22
  26. package/bundled/config/kubbisec-extension-manifest.d.ts.map +1 -1
  27. package/bundled/config/kubbisec-extension-manifest.js +19 -20
  28. package/bundled/config/kubbisec-extension-manifest.js.map +1 -1
  29. package/bundled/config/llm-config-mutations.d.ts +25 -51
  30. package/bundled/config/llm-config-mutations.js +182 -173
  31. package/bundled/config/llm-config.d.ts +41 -54
  32. package/bundled/config/llm-config.js +199 -199
  33. package/bundled/config/llm-provider-catalog.d.ts +15 -18
  34. package/bundled/config/llm-provider-catalog.js +46 -45
  35. package/bundled/config/materialize-kubbisec-pi-resources.d.ts +1 -1
  36. package/bundled/config/materialize-kubbisec-pi-resources.d.ts.map +1 -1
  37. package/bundled/config/materialize-kubbisec-pi-resources.js +182 -174
  38. package/bundled/config/materialize-kubbisec-pi-resources.js.map +1 -1
  39. package/bundled/config/register-custom-llm-providers.d.ts +5 -11
  40. package/bundled/config/register-custom-llm-providers.js +15 -17
  41. package/bundled/config/register-kubbisec-llm-provider.d.ts +10 -14
  42. package/bundled/config/register-kubbisec-llm-provider.js +42 -50
  43. package/bundled/config/resolve-agents-context-file.d.ts +1 -1
  44. package/bundled/config/resolve-agents-context-file.js +34 -33
  45. package/bundled/config/resource-budget.d.ts +12 -12
  46. package/bundled/config/resource-budget.js +28 -28
  47. package/bundled/config/sync-kubbisec-pi-models.d.ts +3 -6
  48. package/bundled/config/sync-kubbisec-pi-models.js +58 -58
  49. package/bundled/copy/cli-reference-index.d.ts +2 -7
  50. package/bundled/copy/cli-reference-index.d.ts.map +1 -1
  51. package/bundled/copy/cli-reference-index.js +2 -62
  52. package/bundled/copy/cli-reference-index.js.map +1 -1
  53. package/bundled/copy/kubbisec-shell-copy.d.ts +6 -11
  54. package/bundled/copy/kubbisec-shell-copy.js +1 -1
  55. package/bundled/extensions/cli-local-shared.d.ts +36 -45
  56. package/bundled/extensions/cli-local-shared.d.ts.map +1 -1
  57. package/bundled/extensions/cli-local-shared.js +129 -128
  58. package/bundled/extensions/cli-local-shared.js.map +1 -1
  59. package/bundled/extensions/kubbisec-aspm-local.extension.d.ts +15 -18
  60. package/bundled/extensions/kubbisec-aspm-local.extension.d.ts.map +1 -1
  61. package/bundled/extensions/kubbisec-aspm-local.extension.js +106 -121
  62. package/bundled/extensions/kubbisec-aspm-local.extension.js.map +1 -1
  63. package/bundled/extensions/kubbisec-brand.extension.d.ts +1 -1
  64. package/bundled/extensions/kubbisec-brand.extension.js +25 -25
  65. package/bundled/extensions/kubbisec-byok-provider.extension.d.ts +1 -1
  66. package/bundled/extensions/kubbisec-byok-provider.extension.js +2 -2
  67. package/bundled/extensions/kubbisec-clarify.extension.d.ts +35 -64
  68. package/bundled/extensions/kubbisec-clarify.extension.d.ts.map +1 -1
  69. package/bundled/extensions/kubbisec-clarify.extension.js +305 -323
  70. package/bundled/extensions/kubbisec-clarify.extension.js.map +1 -1
  71. package/bundled/extensions/kubbisec-exit.extension.d.ts +1 -1
  72. package/bundled/extensions/kubbisec-exit.extension.js +32 -29
  73. package/bundled/extensions/kubbisec-extended-context.extension.d.ts +1 -1
  74. package/bundled/extensions/kubbisec-extended-context.extension.js +43 -56
  75. package/bundled/extensions/kubbisec-footer.extension.d.ts +14 -14
  76. package/bundled/extensions/kubbisec-footer.extension.d.ts.map +1 -1
  77. package/bundled/extensions/kubbisec-footer.extension.js +215 -205
  78. package/bundled/extensions/kubbisec-footer.extension.js.map +1 -1
  79. package/bundled/extensions/kubbisec-github-local.extension.d.ts +18 -29
  80. package/bundled/extensions/kubbisec-github-local.extension.d.ts.map +1 -1
  81. package/bundled/extensions/kubbisec-github-local.extension.js +457 -129
  82. package/bundled/extensions/kubbisec-github-local.extension.js.map +1 -1
  83. package/bundled/extensions/kubbisec-llm-config.extension.d.ts +1 -1
  84. package/bundled/extensions/kubbisec-llm-config.extension.js +181 -200
  85. package/bundled/extensions/kubbisec-memory.extension.d.ts +7 -9
  86. package/bundled/extensions/kubbisec-memory.extension.d.ts.map +1 -1
  87. package/bundled/extensions/kubbisec-memory.extension.js +95 -88
  88. package/bundled/extensions/kubbisec-naus-local.extension.d.ts +15 -18
  89. package/bundled/extensions/kubbisec-naus-local.extension.d.ts.map +1 -1
  90. package/bundled/extensions/kubbisec-naus-local.extension.js +103 -135
  91. package/bundled/extensions/kubbisec-naus-local.extension.js.map +1 -1
  92. package/bundled/extensions/kubbisec-platform-tools.extension.d.ts +21 -31
  93. package/bundled/extensions/kubbisec-platform-tools.extension.d.ts.map +1 -1
  94. package/bundled/extensions/kubbisec-platform-tools.extension.js +152 -152
  95. package/bundled/extensions/kubbisec-platform-tools.extension.js.map +1 -1
  96. package/bundled/extensions/kubbisec-runtime-status.extension.d.ts +8 -10
  97. package/bundled/extensions/kubbisec-runtime-status.extension.js +13 -15
  98. package/bundled/extensions/kubbisec-scope.extension.d.ts +7 -12
  99. package/bundled/extensions/kubbisec-scope.extension.js +13 -13
  100. package/bundled/extensions/kubbisec-skill-mentions.extension.d.ts +16 -27
  101. package/bundled/extensions/kubbisec-skill-mentions.extension.d.ts.map +1 -1
  102. package/bundled/extensions/kubbisec-skill-mentions.extension.js +64 -73
  103. package/bundled/extensions/kubbisec-skill-mentions.extension.js.map +1 -1
  104. package/bundled/extensions/kubbisec-skill-telemetry.extension.d.ts +3 -2
  105. package/bundled/extensions/kubbisec-skill-telemetry.extension.js +64 -59
  106. package/bundled/extensions/kubbisec-theme-lock.extension.d.ts +1 -1
  107. package/bundled/extensions/kubbisec-theme-lock.extension.js +34 -33
  108. package/bundled/extensions/kubbisec-ui.extension.d.ts +1 -1
  109. package/bundled/extensions/kubbisec-ui.extension.d.ts.map +1 -1
  110. package/bundled/extensions/kubbisec-ui.extension.js +122 -116
  111. package/bundled/extensions/kubbisec-ui.extension.js.map +1 -1
  112. package/bundled/extensions/kubbisec-workflow.extension.d.ts +18 -20
  113. package/bundled/extensions/kubbisec-workflow.extension.d.ts.map +1 -1
  114. package/bundled/extensions/kubbisec-workflow.extension.js +140 -138
  115. package/bundled/node_modules/@aspm/shared/dist/ai/index.d.ts +1 -0
  116. package/bundled/node_modules/@aspm/shared/dist/ai/index.d.ts.map +1 -1
  117. package/bundled/node_modules/@aspm/shared/dist/ai/index.js +1 -0
  118. package/bundled/node_modules/@aspm/shared/dist/ai/index.js.map +1 -1
  119. package/bundled/node_modules/@aspm/shared/dist/ai/product-knowledge/build-assistant-system-prompt.d.ts +7 -0
  120. package/bundled/node_modules/@aspm/shared/dist/ai/product-knowledge/build-assistant-system-prompt.d.ts.map +1 -0
  121. package/bundled/node_modules/@aspm/shared/dist/ai/product-knowledge/build-assistant-system-prompt.js +30 -0
  122. package/bundled/node_modules/@aspm/shared/dist/ai/product-knowledge/build-assistant-system-prompt.js.map +1 -0
  123. package/bundled/node_modules/@aspm/shared/dist/ai/product-knowledge/build-chat-system-prompt.d.ts +7 -0
  124. package/bundled/node_modules/@aspm/shared/dist/ai/product-knowledge/build-chat-system-prompt.d.ts.map +1 -0
  125. package/bundled/node_modules/@aspm/shared/dist/ai/product-knowledge/build-chat-system-prompt.js +14 -0
  126. package/bundled/node_modules/@aspm/shared/dist/ai/product-knowledge/build-chat-system-prompt.js.map +1 -0
  127. package/bundled/node_modules/@aspm/shared/dist/ai/product-knowledge/cli-reference-index.d.ts +6 -0
  128. package/bundled/node_modules/@aspm/shared/dist/ai/product-knowledge/cli-reference-index.d.ts.map +1 -0
  129. package/bundled/node_modules/@aspm/shared/dist/ai/product-knowledge/cli-reference-index.js +65 -0
  130. package/bundled/node_modules/@aspm/shared/dist/ai/product-knowledge/cli-reference-index.js.map +1 -0
  131. package/bundled/node_modules/@aspm/shared/dist/ai/product-knowledge/format-mcp-knowledge.d.ts +8 -0
  132. package/bundled/node_modules/@aspm/shared/dist/ai/product-knowledge/format-mcp-knowledge.d.ts.map +1 -0
  133. package/bundled/node_modules/@aspm/shared/dist/ai/product-knowledge/format-mcp-knowledge.js +29 -0
  134. package/bundled/node_modules/@aspm/shared/dist/ai/product-knowledge/format-mcp-knowledge.js.map +1 -0
  135. package/bundled/node_modules/@aspm/shared/dist/ai/product-knowledge/index.d.ts +7 -0
  136. package/bundled/node_modules/@aspm/shared/dist/ai/product-knowledge/index.d.ts.map +1 -0
  137. package/bundled/node_modules/@aspm/shared/dist/ai/product-knowledge/index.js +16 -0
  138. package/bundled/node_modules/@aspm/shared/dist/ai/product-knowledge/index.js.map +1 -0
  139. package/bundled/node_modules/@aspm/shared/dist/ai/product-knowledge/mcp-instructions.d.ts +2 -0
  140. package/bundled/node_modules/@aspm/shared/dist/ai/product-knowledge/mcp-instructions.d.ts.map +1 -0
  141. package/bundled/node_modules/@aspm/shared/dist/ai/product-knowledge/mcp-instructions.js +36 -0
  142. package/bundled/node_modules/@aspm/shared/dist/ai/product-knowledge/mcp-instructions.js.map +1 -0
  143. package/bundled/node_modules/@aspm/shared/dist/ai/product-knowledge/mental-map.d.ts +6 -0
  144. package/bundled/node_modules/@aspm/shared/dist/ai/product-knowledge/mental-map.d.ts.map +1 -0
  145. package/bundled/node_modules/@aspm/shared/dist/ai/product-knowledge/mental-map.js +32 -0
  146. package/bundled/node_modules/@aspm/shared/dist/ai/product-knowledge/mental-map.js.map +1 -0
  147. package/bundled/node_modules/@aspm/shared/dist/api-key/api-key-scope-groups.d.ts +12 -0
  148. package/bundled/node_modules/@aspm/shared/dist/api-key/api-key-scope-groups.d.ts.map +1 -0
  149. package/bundled/node_modules/@aspm/shared/dist/api-key/api-key-scope-groups.js +93 -0
  150. package/bundled/node_modules/@aspm/shared/dist/api-key/api-key-scope-groups.js.map +1 -0
  151. package/bundled/node_modules/@aspm/shared/dist/api-key/api-key-scope-presets.d.ts +13 -0
  152. package/bundled/node_modules/@aspm/shared/dist/api-key/api-key-scope-presets.d.ts.map +1 -0
  153. package/bundled/node_modules/@aspm/shared/dist/api-key/api-key-scope-presets.js +79 -0
  154. package/bundled/node_modules/@aspm/shared/dist/api-key/api-key-scope-presets.js.map +1 -0
  155. package/bundled/node_modules/@aspm/shared/dist/api-key/index.d.ts +4 -0
  156. package/bundled/node_modules/@aspm/shared/dist/api-key/index.d.ts.map +1 -0
  157. package/bundled/node_modules/@aspm/shared/dist/api-key/index.js +20 -0
  158. package/bundled/node_modules/@aspm/shared/dist/api-key/index.js.map +1 -0
  159. package/bundled/node_modules/@aspm/shared/dist/api-key/migrate-api-key-metadata.d.ts +20 -0
  160. package/bundled/node_modules/@aspm/shared/dist/api-key/migrate-api-key-metadata.d.ts.map +1 -0
  161. package/bundled/node_modules/@aspm/shared/dist/api-key/migrate-api-key-metadata.js +78 -0
  162. package/bundled/node_modules/@aspm/shared/dist/api-key/migrate-api-key-metadata.js.map +1 -0
  163. package/bundled/node_modules/@aspm/shared/dist/assistant/assistant-thread.d.ts +19 -0
  164. package/bundled/node_modules/@aspm/shared/dist/assistant/assistant-thread.d.ts.map +1 -0
  165. package/bundled/node_modules/@aspm/shared/dist/assistant/assistant-thread.js +126 -0
  166. package/bundled/node_modules/@aspm/shared/dist/assistant/assistant-thread.js.map +1 -0
  167. package/bundled/node_modules/@aspm/shared/dist/assistant/index.d.ts +1 -0
  168. package/bundled/node_modules/@aspm/shared/dist/assistant/index.d.ts.map +1 -1
  169. package/bundled/node_modules/@aspm/shared/dist/assistant/index.js +1 -0
  170. package/bundled/node_modules/@aspm/shared/dist/assistant/index.js.map +1 -1
  171. package/bundled/node_modules/@aspm/shared/dist/billing/index.d.ts +2 -0
  172. package/bundled/node_modules/@aspm/shared/dist/billing/index.d.ts.map +1 -0
  173. package/bundled/node_modules/@aspm/shared/dist/billing/index.js +18 -0
  174. package/bundled/node_modules/@aspm/shared/dist/billing/index.js.map +1 -0
  175. package/bundled/node_modules/@aspm/shared/dist/billing/plan-limits.d.ts +17 -0
  176. package/bundled/node_modules/@aspm/shared/dist/billing/plan-limits.d.ts.map +1 -0
  177. package/bundled/node_modules/@aspm/shared/dist/billing/plan-limits.js +30 -0
  178. package/bundled/node_modules/@aspm/shared/dist/billing/plan-limits.js.map +1 -0
  179. package/bundled/node_modules/@aspm/shared/dist/ci/ci-job-dependencies.d.ts +42 -0
  180. package/bundled/node_modules/@aspm/shared/dist/ci/ci-job-dependencies.d.ts.map +1 -0
  181. package/bundled/node_modules/@aspm/shared/dist/ci/ci-job-dependencies.js +147 -0
  182. package/bundled/node_modules/@aspm/shared/dist/ci/ci-job-dependencies.js.map +1 -0
  183. package/bundled/node_modules/@aspm/shared/dist/ci/git-checkout-log-policy.d.ts +12 -0
  184. package/bundled/node_modules/@aspm/shared/dist/ci/git-checkout-log-policy.d.ts.map +1 -0
  185. package/bundled/node_modules/@aspm/shared/dist/ci/git-checkout-log-policy.js +70 -0
  186. package/bundled/node_modules/@aspm/shared/dist/ci/git-checkout-log-policy.js.map +1 -0
  187. package/bundled/node_modules/@aspm/shared/dist/ci/index.d.ts +4 -0
  188. package/bundled/node_modules/@aspm/shared/dist/ci/index.d.ts.map +1 -0
  189. package/bundled/node_modules/@aspm/shared/dist/ci/index.js +20 -0
  190. package/bundled/node_modules/@aspm/shared/dist/ci/index.js.map +1 -0
  191. package/bundled/node_modules/@aspm/shared/dist/ci/kubbisec-ci-execution-env.d.ts +16 -0
  192. package/bundled/node_modules/@aspm/shared/dist/ci/kubbisec-ci-execution-env.d.ts.map +1 -0
  193. package/bundled/node_modules/@aspm/shared/dist/ci/kubbisec-ci-execution-env.js +45 -0
  194. package/bundled/node_modules/@aspm/shared/dist/ci/kubbisec-ci-execution-env.js.map +1 -0
  195. package/bundled/node_modules/@aspm/shared/dist/dto/create-report.dto.d.ts +1 -0
  196. package/bundled/node_modules/@aspm/shared/dist/dto/create-report.dto.d.ts.map +1 -1
  197. package/bundled/node_modules/@aspm/shared/dist/dto/create-report.dto.js +6 -0
  198. package/bundled/node_modules/@aspm/shared/dist/dto/create-report.dto.js.map +1 -1
  199. package/bundled/node_modules/@aspm/shared/dist/dto/index.d.ts +5 -3
  200. package/bundled/node_modules/@aspm/shared/dist/dto/index.d.ts.map +1 -1
  201. package/bundled/node_modules/@aspm/shared/dist/dto/index.js +5 -3
  202. package/bundled/node_modules/@aspm/shared/dist/dto/index.js.map +1 -1
  203. package/bundled/node_modules/@aspm/shared/dist/dto/update-project.dto.d.ts +9 -0
  204. package/bundled/node_modules/@aspm/shared/dist/dto/update-project.dto.d.ts.map +1 -0
  205. package/bundled/node_modules/@aspm/shared/dist/dto/update-project.dto.js +52 -0
  206. package/bundled/node_modules/@aspm/shared/dist/dto/update-project.dto.js.map +1 -0
  207. package/bundled/node_modules/@aspm/shared/dist/enums.d.ts +3 -1
  208. package/bundled/node_modules/@aspm/shared/dist/enums.d.ts.map +1 -1
  209. package/bundled/node_modules/@aspm/shared/dist/enums.js +4 -0
  210. package/bundled/node_modules/@aspm/shared/dist/enums.js.map +1 -1
  211. package/bundled/node_modules/@aspm/shared/dist/index.d.ts +8 -2
  212. package/bundled/node_modules/@aspm/shared/dist/index.d.ts.map +1 -1
  213. package/bundled/node_modules/@aspm/shared/dist/index.js +8 -2
  214. package/bundled/node_modules/@aspm/shared/dist/index.js.map +1 -1
  215. package/bundled/node_modules/@aspm/shared/dist/mcp/constants.d.ts +22 -0
  216. package/bundled/node_modules/@aspm/shared/dist/mcp/constants.d.ts.map +1 -0
  217. package/bundled/node_modules/@aspm/shared/dist/mcp/constants.js +52 -0
  218. package/bundled/node_modules/@aspm/shared/dist/mcp/constants.js.map +1 -0
  219. package/bundled/node_modules/@aspm/shared/dist/mcp/oauth-metadata.d.ts +37 -0
  220. package/bundled/node_modules/@aspm/shared/dist/mcp/oauth-metadata.d.ts.map +1 -0
  221. package/bundled/node_modules/@aspm/shared/dist/mcp/oauth-metadata.js +51 -0
  222. package/bundled/node_modules/@aspm/shared/dist/mcp/oauth-metadata.js.map +1 -0
  223. package/bundled/node_modules/@aspm/shared/dist/project-scanner-summary.d.ts +7 -4
  224. package/bundled/node_modules/@aspm/shared/dist/project-scanner-summary.d.ts.map +1 -1
  225. package/bundled/node_modules/@aspm/shared/dist/project-scanner-summary.js +15 -7
  226. package/bundled/node_modules/@aspm/shared/dist/project-scanner-summary.js.map +1 -1
  227. package/bundled/node_modules/@aspm/shared/dist/rbac/index.d.ts +1 -0
  228. package/bundled/node_modules/@aspm/shared/dist/rbac/index.d.ts.map +1 -1
  229. package/bundled/node_modules/@aspm/shared/dist/rbac/index.js +1 -0
  230. package/bundled/node_modules/@aspm/shared/dist/rbac/index.js.map +1 -1
  231. package/bundled/node_modules/@aspm/shared/dist/rbac/kubbisec-permission-descriptions.d.ts.map +1 -1
  232. package/bundled/node_modules/@aspm/shared/dist/rbac/kubbisec-permission-descriptions.js +2 -0
  233. package/bundled/node_modules/@aspm/shared/dist/rbac/kubbisec-permission-descriptions.js.map +1 -1
  234. package/bundled/node_modules/@aspm/shared/dist/rbac/kubbisec-permissions.d.ts +1 -1
  235. package/bundled/node_modules/@aspm/shared/dist/rbac/kubbisec-permissions.d.ts.map +1 -1
  236. package/bundled/node_modules/@aspm/shared/dist/rbac/kubbisec-permissions.js +2 -0
  237. package/bundled/node_modules/@aspm/shared/dist/rbac/kubbisec-permissions.js.map +1 -1
  238. package/bundled/node_modules/@aspm/shared/dist/rbac/member-quota.d.ts +8 -0
  239. package/bundled/node_modules/@aspm/shared/dist/rbac/member-quota.d.ts.map +1 -0
  240. package/bundled/node_modules/@aspm/shared/dist/rbac/member-quota.js +19 -0
  241. package/bundled/node_modules/@aspm/shared/dist/rbac/member-quota.js.map +1 -0
  242. package/bundled/node_modules/@aspm/shared/dist/rbac/resolve-org-permissions.d.ts.map +1 -1
  243. package/bundled/node_modules/@aspm/shared/dist/rbac/resolve-org-permissions.js +4 -0
  244. package/bundled/node_modules/@aspm/shared/dist/rbac/resolve-org-permissions.js.map +1 -1
  245. package/bundled/node_modules/@aspm/shared/dist/redaction.d.ts +1 -0
  246. package/bundled/node_modules/@aspm/shared/dist/redaction.d.ts.map +1 -1
  247. package/bundled/node_modules/@aspm/shared/dist/redaction.js +1 -0
  248. package/bundled/node_modules/@aspm/shared/dist/redaction.js.map +1 -1
  249. package/bundled/node_modules/@aspm/shared/dist/security/aspm-gate-rules.d.ts.map +1 -1
  250. package/bundled/node_modules/@aspm/shared/dist/security/aspm-gate-rules.js.map +1 -1
  251. package/bundled/node_modules/@aspm/shared/dist/security/build-aspm-security-matrix-pipeline-yaml.d.ts.map +1 -1
  252. package/bundled/node_modules/@aspm/shared/dist/security/build-aspm-security-matrix-pipeline-yaml.js.map +1 -1
  253. package/bundled/node_modules/@aspm/shared/dist/security/build-github-security-workflow-yaml.d.ts.map +1 -1
  254. package/bundled/node_modules/@aspm/shared/dist/security/build-github-security-workflow-yaml.js +2 -2
  255. package/bundled/node_modules/@aspm/shared/dist/security/build-github-security-workflow-yaml.js.map +1 -1
  256. package/bundled/node_modules/@aspm/shared/dist/security/index.d.ts +2 -2
  257. package/bundled/node_modules/@aspm/shared/dist/security/index.d.ts.map +1 -1
  258. package/bundled/node_modules/@aspm/shared/dist/security/index.js +2 -2
  259. package/bundled/node_modules/@aspm/shared/dist/security/index.js.map +1 -1
  260. package/bundled/node_modules/@aspm/shared/dist/shared-project/constants.d.ts +4 -0
  261. package/bundled/node_modules/@aspm/shared/dist/shared-project/constants.d.ts.map +1 -0
  262. package/bundled/node_modules/@aspm/shared/dist/shared-project/constants.js +10 -0
  263. package/bundled/node_modules/@aspm/shared/dist/shared-project/constants.js.map +1 -0
  264. package/bundled/node_modules/@aspm/shared/dist/shared-project/index.d.ts +4 -0
  265. package/bundled/node_modules/@aspm/shared/dist/shared-project/index.d.ts.map +1 -0
  266. package/bundled/node_modules/@aspm/shared/dist/shared-project/index.js +20 -0
  267. package/bundled/node_modules/@aspm/shared/dist/shared-project/index.js.map +1 -0
  268. package/bundled/node_modules/@aspm/shared/dist/shared-project/redact-log-lines.d.ts +2 -0
  269. package/bundled/node_modules/@aspm/shared/dist/shared-project/redact-log-lines.d.ts.map +1 -0
  270. package/bundled/node_modules/@aspm/shared/dist/shared-project/redact-log-lines.js +9 -0
  271. package/bundled/node_modules/@aspm/shared/dist/shared-project/redact-log-lines.js.map +1 -0
  272. package/bundled/node_modules/@aspm/shared/dist/shared-project/share-prefix.d.ts +3 -0
  273. package/bundled/node_modules/@aspm/shared/dist/shared-project/share-prefix.d.ts.map +1 -0
  274. package/bundled/node_modules/@aspm/shared/dist/shared-project/share-prefix.js +18 -0
  275. package/bundled/node_modules/@aspm/shared/dist/shared-project/share-prefix.js.map +1 -0
  276. package/bundled/node_modules/@aspm/shared/package.json +27 -5
  277. package/bundled/node_modules/@kubbisec/chat-memory/dist/sanitizer.js +2 -2
  278. package/bundled/node_modules/@kubbisec/chat-memory/dist/sanitizer.js.map +1 -1
  279. package/bundled/node_modules/@kubbisec/chat-memory/package.json +4 -4
  280. package/bundled/node_modules/@kubbisec/home/dist/migrate.d.ts.map +1 -1
  281. package/bundled/node_modules/@kubbisec/home/dist/migrate.js +1 -1
  282. package/bundled/node_modules/@kubbisec/home/dist/migrate.js.map +1 -1
  283. package/bundled/node_modules/@kubbisec/home/package.json +3 -3
  284. package/bundled/resolve-bundled-dist-root.js +130 -122
  285. package/bundled/resolve-bundled-dist-root.js.map +1 -1
  286. package/bundled/skills/aspm-platform/SKILL.md +3 -1
  287. package/bundled/skills/at-path-mentions.d.ts +1 -1
  288. package/bundled/skills/at-path-mentions.js +153 -146
  289. package/bundled/skills/chat-mention-render.d.ts +2 -2
  290. package/bundled/skills/chat-mention-render.js +126 -121
  291. package/bundled/skills/chat-mentions.d.ts +8 -17
  292. package/bundled/skills/chat-mentions.js +76 -76
  293. package/bundled/skills/github-local/SKILL.md +5 -5
  294. package/bundled/skills/kubbisec-resource-router/SKILL.md +3 -0
  295. package/bundled/skills/list-bundled-skills.d.ts +3 -3
  296. package/bundled/skills/list-bundled-skills.js +35 -33
  297. package/bundled/skills/naus-pipelines/SKILL.md +11 -10
  298. package/bundled/skills/remediation/SKILL.md +1 -1
  299. package/bundled/skills/skill-mention.d.ts +2 -10
  300. package/bundled/skills/skill-mention.js +2 -10
  301. package/bundled/theme/clear-terminal.d.ts +1 -1
  302. package/bundled/theme/clear-terminal.js +4 -3
  303. package/bundled/theme/footer-render-hook.d.ts +1 -1
  304. package/bundled/theme/footer-render-hook.js +3 -3
  305. package/bundled/theme/kubbisec-brand-fg.d.ts +1 -1
  306. package/bundled/theme/kubbisec-brand-fg.js +2 -2
  307. package/bundled/theme/kubbisec-menu-themes.d.ts +7 -7
  308. package/bundled/theme/kubbisec-menu-themes.js +31 -30
  309. package/bundled/theme/kubbisec-theme-name.d.ts +1 -1
  310. package/bundled/theme/kubbisec-theme-name.js +1 -1
  311. package/bundled/theme/patch-pi-settings-theme.runtime.d.ts +1 -1
  312. package/bundled/theme/patch-pi-settings-theme.runtime.js +10 -11
  313. package/bundled/theme/render-compact-header.d.ts +5 -13
  314. package/bundled/theme/render-compact-header.js +128 -126
  315. package/bundled/theme/render-compact-header.js.map +1 -1
  316. package/bundled/workflow/session-workflow-mode.d.ts +1 -1
  317. package/bundled/workflow/session-workflow-mode.js +33 -33
  318. package/package.json +1 -1
  319. package/bundled/clarify/clarify-gate-state.d.ts +0 -3
  320. package/bundled/clarify/clarify-gate-state.d.ts.map +0 -1
  321. package/bundled/clarify/clarify-gate-state.js +0 -9
  322. package/bundled/clarify/clarify-gate-state.js.map +0 -1
  323. package/bundled/clarify/clarify-gate.d.ts +0 -35
  324. package/bundled/clarify/clarify-gate.d.ts.map +0 -1
  325. package/bundled/clarify/clarify-gate.js +0 -159
  326. package/bundled/clarify/clarify-gate.js.map +0 -1
  327. package/bundled/clarify/clarify-select-panel.d.ts +0 -21
  328. package/bundled/clarify/clarify-select-panel.d.ts.map +0 -1
  329. package/bundled/clarify/clarify-select-panel.js +0 -80
  330. package/bundled/clarify/clarify-select-panel.js.map +0 -1
  331. package/bundled/clarify/clarify-ui-state.d.ts +0 -23
  332. package/bundled/clarify/clarify-ui-state.d.ts.map +0 -1
  333. package/bundled/clarify/clarify-ui-state.js +0 -48
  334. package/bundled/clarify/clarify-ui-state.js.map +0 -1
  335. package/bundled/clarify/parse-clarify-answer.d.ts +0 -32
  336. package/bundled/clarify/parse-clarify-answer.d.ts.map +0 -1
  337. package/bundled/clarify/parse-clarify-answer.js +0 -51
  338. package/bundled/clarify/parse-clarify-answer.js.map +0 -1
  339. package/bundled/clarify/question-format.d.ts +0 -50
  340. package/bundled/clarify/question-format.d.ts.map +0 -1
  341. package/bundled/clarify/question-format.js +0 -137
  342. package/bundled/clarify/question-format.js.map +0 -1
  343. package/bundled/clarify/questionnaire-tool.d.ts +0 -36
  344. package/bundled/clarify/questionnaire-tool.d.ts.map +0 -1
  345. package/bundled/clarify/questionnaire-tool.js +0 -197
  346. package/bundled/clarify/questionnaire-tool.js.map +0 -1
  347. package/bundled/clarify/scope-discovery.d.ts +0 -12
  348. package/bundled/clarify/scope-discovery.d.ts.map +0 -1
  349. package/bundled/clarify/scope-discovery.js +0 -122
  350. package/bundled/clarify/scope-discovery.js.map +0 -1
  351. package/bundled/clarify/session-questionnaire.d.ts +0 -61
  352. package/bundled/clarify/session-questionnaire.d.ts.map +0 -1
  353. package/bundled/clarify/session-questionnaire.js +0 -364
  354. package/bundled/clarify/session-questionnaire.js.map +0 -1
  355. package/bundled/clarify/session-questionnaire.types.d.ts +0 -49
  356. package/bundled/clarify/session-questionnaire.types.d.ts.map +0 -1
  357. package/bundled/clarify/session-questionnaire.types.js +0 -13
  358. package/bundled/clarify/session-questionnaire.types.js.map +0 -1
@@ -4,378 +4,360 @@
4
4
  import { randomUUID } from "node:crypto";
5
5
  import * as fs from "node:fs";
6
6
  import { getKubbisecConfigPath } from "@kubbisec/home";
7
- import { shouldClarify } from "../clarify/clarify-gate.js";
7
+ import { shouldClarify, } from "../clarify/clarify-gate.js";
8
8
  import { setClarifyGateActive } from "../clarify/clarify-gate-state.js";
9
9
  import { renderClarifySelectPanel } from "../clarify/clarify-select-panel.js";
10
- import {
11
- getClarifyUiSnapshot,
12
- resetClarifyUiSnapshot,
13
- setClarifyUiChangeListener,
14
- setClarifyUiSnapshot,
15
- } from "../clarify/clarify-ui-state.js";
10
+ import { getClarifyUiSnapshot, resetClarifyUiSnapshot, setClarifyUiChangeListener, setClarifyUiSnapshot, } from "../clarify/clarify-ui-state.js";
16
11
  import { parseClarifyAnswer } from "../clarify/parse-clarify-answer.js";
17
12
  import { inferScenarioFromMessage } from "../clarify/question-format.js";
18
- import {
19
- applyParsedUserAnswerIfPending,
20
- executeQuestionnaireTool,
21
- questionnaireToolParametersSchema,
22
- } from "../clarify/questionnaire-tool.js";
13
+ import { applyParsedUserAnswerIfPending, executeQuestionnaireTool, questionnaireToolParametersSchema, } from "../clarify/questionnaire-tool.js";
23
14
  import { discoverScopeHints } from "../clarify/scope-discovery.js";
24
- import {
25
- buildClarifyProgressLabel,
26
- finalizeQuestionnaireAtRoundLimit,
27
- hasMinimumScopeForScenario,
28
- readDefaultProjectId,
29
- readSessionQuestionnaire,
30
- shouldAcceptClarifyAnswer,
31
- writeSessionQuestionnaire,
32
- } from "../clarify/session-questionnaire.js";
15
+ import { buildClarifyProgressLabel, finalizeQuestionnaireAtRoundLimit, hasMinimumScopeForScenario, readDefaultProjectId, readSessionQuestionnaire, shouldAcceptClarifyAnswer, writeSessionQuestionnaire, } from "../clarify/session-questionnaire.js";
33
16
  import { resolveResourceBudget } from "../config/resource-budget.js";
34
17
  import { getSessionWorkflowMode } from "../workflow/session-workflow-mode.js";
35
18
  export const CLARIFY_MUTATION_TOOLS = new Set([
36
- "edit",
37
- "write",
38
- "bash",
39
- "delete",
40
- "patch",
41
- "apply_patch",
42
- "set_pipeline_yaml",
19
+ "edit",
20
+ "write",
21
+ "bash",
22
+ "delete",
23
+ "patch",
24
+ "apply_patch",
25
+ "set_pipeline_yaml",
43
26
  ]);
44
27
  export const CLARIFY_READ_ONLY_TOOLS = new Set([
45
- "read",
46
- "grep",
47
- "find",
48
- "ls",
49
- "glob",
50
- "questionnaire",
51
- "aspm_docs",
52
- "naus_pipeline_docs",
53
- "list_findings",
28
+ "read",
29
+ "grep",
30
+ "find",
31
+ "ls",
32
+ "glob",
33
+ "questionnaire",
34
+ "aspm_docs",
35
+ "naus_pipeline_docs",
36
+ "list_findings",
54
37
  ]);
55
- export const CLARIFY_TOOL_BLOCK_REASON =
56
- "Complete o questionário de escopo (use o painel acima ou escreva a resposta) antes de editar ficheiros.";
38
+ export const CLARIFY_TOOL_BLOCK_REASON = "Complete o questionário de escopo (use o painel acima ou escreva a resposta) antes de editar ficheiros.";
57
39
  export function isClarifyMutationTool(toolName) {
58
- if (CLARIFY_READ_ONLY_TOOLS.has(toolName)) return false;
59
- return CLARIFY_MUTATION_TOOLS.has(toolName);
40
+ if (CLARIFY_READ_ONLY_TOOLS.has(toolName))
41
+ return false;
42
+ return CLARIFY_MUTATION_TOOLS.has(toolName);
60
43
  }
61
44
  export function shouldBlockClarifyTool(toolName, gateActive, questionnaire) {
62
- if (!gateActive) return false;
63
- if (!questionnaire || questionnaire.status === "ready") return false;
64
- if (!isClarifyMutationTool(toolName)) return false;
65
- return true;
45
+ if (!gateActive)
46
+ return false;
47
+ if (!questionnaire || questionnaire.status === "ready")
48
+ return false;
49
+ if (!isClarifyMutationTool(toolName))
50
+ return false;
51
+ return true;
66
52
  }
67
53
  function readDefaultProjectConfigured() {
68
- if (readDefaultProjectId()) return true;
69
- try {
70
- const raw = fs.readFileSync(getKubbisecConfigPath(), "utf8");
71
- const parsed = JSON.parse(raw);
72
- return Boolean(parsed.defaultProject?.trim());
73
- } catch {
74
- return false;
75
- }
54
+ if (readDefaultProjectId())
55
+ return true;
56
+ try {
57
+ const raw = fs.readFileSync(getKubbisecConfigPath(), "utf8");
58
+ const parsed = JSON.parse(raw);
59
+ return Boolean(parsed.defaultProject?.trim());
60
+ }
61
+ catch {
62
+ return false;
63
+ }
76
64
  }
77
65
  export function detectChatMode(prompt) {
78
- if (getSessionWorkflowMode() === "plan") {
79
- return "plan";
80
- }
81
- const trimmed = prompt.trim();
82
- if (
83
- trimmed.startsWith("/mode:plan") ||
84
- /@plan\b/i.test(trimmed) ||
85
- /@planejar\b/i.test(trimmed)
86
- ) {
87
- return "plan";
88
- }
89
- const envMode = process.env.KUBBISEC_CHAT_MODE?.trim().toLowerCase();
90
- if (envMode === "plan") return "plan";
91
- return "default";
66
+ if (getSessionWorkflowMode() === "plan") {
67
+ return "plan";
68
+ }
69
+ const trimmed = prompt.trim();
70
+ if (trimmed.startsWith("/mode:plan") ||
71
+ /@plan\b/i.test(trimmed) ||
72
+ /@planejar\b/i.test(trimmed)) {
73
+ return "plan";
74
+ }
75
+ const envMode = process.env.KUBBISEC_CHAT_MODE?.trim().toLowerCase();
76
+ if (envMode === "plan")
77
+ return "plan";
78
+ return "default";
92
79
  }
93
80
  function resolveSurface() {
94
- const surface = process.env.KUBBISEC_CLARIFY_SURFACE?.trim().toLowerCase();
95
- if (surface === "fix" || surface === "watch" || surface === "task-consumer") {
96
- return surface;
97
- }
98
- if (process.env.KUBBISEC_FIX_MODE === "1" || process.env.KUBBISEC_WATCH_MODE === "1") {
99
- return process.env.KUBBISEC_WATCH_MODE === "1" ? "watch" : "fix";
100
- }
101
- return "chat";
81
+ const surface = process.env.KUBBISEC_CLARIFY_SURFACE?.trim().toLowerCase();
82
+ if (surface === "fix" || surface === "watch" || surface === "task-consumer") {
83
+ return surface;
84
+ }
85
+ if (process.env.KUBBISEC_FIX_MODE === "1" || process.env.KUBBISEC_WATCH_MODE === "1") {
86
+ return process.env.KUBBISEC_WATCH_MODE === "1" ? "watch" : "fix";
87
+ }
88
+ return "chat";
102
89
  }
103
90
  function buildGateInput(prompt, questionnaire) {
104
- const msg = prompt.trim();
105
- const budget = resolveResourceBudget();
106
- const scenario = questionnaire.scenario ?? inferScenarioFromMessage(msg);
107
- return {
108
- surface: resolveSurface(),
109
- userMessage: msg,
110
- hasProjectId: readDefaultProjectConfigured() || questionnaire.fields.projectIds.length > 0,
111
- hasVulnerabilityId: /\b(cve-|vuln|finding)/i.test(msg),
112
- hasSeverityFilter:
113
- Boolean(questionnaire.fields.severityMin) || /\b(severity|critical|high)\b/i.test(msg),
114
- mode: detectChatMode(msg),
115
- scenario,
116
- questionnaireStatus: questionnaire.status,
117
- fields: questionnaire.fields,
118
- historyCount: questionnaire.history.length,
119
- clarifyMaxRounds: budget.clarifyMaxRounds,
120
- };
91
+ const msg = prompt.trim();
92
+ const budget = resolveResourceBudget();
93
+ const scenario = questionnaire.scenario ?? inferScenarioFromMessage(msg);
94
+ return {
95
+ surface: resolveSurface(),
96
+ userMessage: msg,
97
+ hasProjectId: readDefaultProjectConfigured() || questionnaire.fields.projectIds.length > 0,
98
+ hasVulnerabilityId: /\b(cve-|vuln|finding)/i.test(msg),
99
+ hasSeverityFilter: Boolean(questionnaire.fields.severityMin) || /\b(severity|critical|high)\b/i.test(msg),
100
+ mode: detectChatMode(msg),
101
+ scenario,
102
+ questionnaireStatus: questionnaire.status,
103
+ fields: questionnaire.fields,
104
+ historyCount: questionnaire.history.length,
105
+ clarifyMaxRounds: budget.clarifyMaxRounds,
106
+ };
121
107
  }
122
108
  export function buildClarifyContextMessage(questionnaire) {
123
- const panelReady = questionnaire.awaitingUserAnswer && questionnaire.pending?.questionMarkdown;
124
- return `[SCOPE GATE — internal only, never repeat to user]
109
+ const panelReady = questionnaire.awaitingUserAnswer && questionnaire.pending?.questionMarkdown;
110
+ return `[SCOPE GATE — internal only, never repeat to user]
125
111
  ${panelReady ? "Questionnaire panel is visible — do NOT ask user to look at the panel." : "Scope still missing — questionnaire auto-ask may run."}
126
112
  Read-only until scope ready. User-facing replies: max 2 sentences; no chain-of-thought.
127
113
  ${questionnaire.awaitingUserAnswer ? "Wait for panel answer or free text." : "Use questionnaire record if user already gave scope in prose."}`;
128
114
  }
129
115
  function extractQuestionText(markdown) {
130
- for (const line of markdown.split("\n")) {
131
- const trimmed = line.trim();
132
- if (trimmed && !/^[A-D]\)/.test(trimmed)) return trimmed;
133
- }
134
- return markdown.split("\n")[0]?.trim() ?? "";
116
+ for (const line of markdown.split("\n")) {
117
+ const trimmed = line.trim();
118
+ if (trimmed && !/^[A-D]\)/.test(trimmed))
119
+ return trimmed;
120
+ }
121
+ return markdown.split("\n")[0]?.trim() ?? "";
135
122
  }
136
123
  export function syncClarifyUi(questionnaire) {
137
- if (questionnaire.status === "ready") {
138
- setClarifyUiSnapshot({
139
- phase: "ready",
140
- progressLabel: null,
141
- questionMarkdown: null,
142
- questionText: null,
143
- optionLabels: [],
144
- selected: [],
145
- focusedIndex: 0,
146
- });
147
- return;
148
- }
149
- if (!questionnaire.awaitingUserAnswer || !questionnaire.pending?.questionMarkdown) {
124
+ if (questionnaire.status === "ready") {
125
+ setClarifyUiSnapshot({
126
+ phase: "ready",
127
+ progressLabel: null,
128
+ questionMarkdown: null,
129
+ questionText: null,
130
+ optionLabels: [],
131
+ selected: [],
132
+ focusedIndex: 0,
133
+ });
134
+ return;
135
+ }
136
+ if (!questionnaire.awaitingUserAnswer || !questionnaire.pending?.questionMarkdown) {
137
+ setClarifyUiSnapshot({
138
+ phase: "idle",
139
+ progressLabel: null,
140
+ questionMarkdown: null,
141
+ questionText: null,
142
+ optionLabels: [],
143
+ selected: [],
144
+ focusedIndex: 0,
145
+ });
146
+ return;
147
+ }
148
+ const pending = questionnaire.pending;
150
149
  setClarifyUiSnapshot({
151
- phase: "idle",
152
- progressLabel: null,
153
- questionMarkdown: null,
154
- questionText: null,
155
- optionLabels: [],
156
- selected: [],
157
- focusedIndex: 0,
150
+ phase: "asking",
151
+ progressLabel: buildClarifyProgressLabel(questionnaire),
152
+ questionMarkdown: pending.questionMarkdown,
153
+ questionText: extractQuestionText(pending.questionMarkdown),
154
+ optionLabels: pending.optionLabels,
155
+ selectionMode: pending.selectionMode ?? "single",
156
+ selected: [],
157
+ focusedIndex: 0,
158
158
  });
159
- return;
160
- }
161
- const pending = questionnaire.pending;
162
- setClarifyUiSnapshot({
163
- phase: "asking",
164
- progressLabel: buildClarifyProgressLabel(questionnaire),
165
- questionMarkdown: pending.questionMarkdown,
166
- questionText: extractQuestionText(pending.questionMarkdown),
167
- optionLabels: pending.optionLabels,
168
- selectionMode: pending.selectionMode ?? "single",
169
- selected: [],
170
- focusedIndex: 0,
171
- });
172
159
  }
173
160
  function applyDiscoveredScope(questionnaire, prompt, cwd) {
174
- const discovered = discoverScopeHints(cwd, prompt);
175
- if (!discovered.fields || Object.keys(discovered.fields).length === 0) {
176
- return questionnaire;
177
- }
178
- const result = executeQuestionnaireTool(questionnaire, {
179
- action: "record",
180
- scenario: discovered.scenario,
181
- fields: discovered.fields,
182
- });
183
- return result.questionnaire;
161
+ const discovered = discoverScopeHints(cwd, prompt);
162
+ if (!discovered.fields || Object.keys(discovered.fields).length === 0) {
163
+ return questionnaire;
164
+ }
165
+ const result = executeQuestionnaireTool(questionnaire, {
166
+ action: "record",
167
+ scenario: discovered.scenario,
168
+ fields: discovered.fields,
169
+ });
170
+ return result.questionnaire;
184
171
  }
185
172
  export function autoAskNextQuestion(questionnaire, prompt) {
186
- if (questionnaire.awaitingUserAnswer || questionnaire.status === "ready") {
187
- return questionnaire;
188
- }
189
- const scenario = questionnaire.scenario ?? inferScenarioFromMessage(prompt);
190
- const result = executeQuestionnaireTool(questionnaire, {
191
- action: "ask",
192
- scenario,
193
- });
194
- if (!result.ok) return questionnaire;
195
- return result.questionnaire;
173
+ if (questionnaire.awaitingUserAnswer || questionnaire.status === "ready") {
174
+ return questionnaire;
175
+ }
176
+ const scenario = questionnaire.scenario ?? inferScenarioFromMessage(prompt);
177
+ const result = executeQuestionnaireTool(questionnaire, {
178
+ action: "ask",
179
+ scenario,
180
+ });
181
+ if (!result.ok)
182
+ return questionnaire;
183
+ return result.questionnaire;
196
184
  }
197
185
  function maybeMarkReady(questionnaire) {
198
- const scenario = questionnaire.scenario ?? "remediation";
199
- if (
200
- questionnaire.status === "collecting" &&
201
- !questionnaire.awaitingUserAnswer &&
202
- hasMinimumScopeForScenario(scenario, questionnaire.fields)
203
- ) {
204
- return { ...questionnaire, status: "ready", pending: null };
205
- }
206
- return questionnaire;
186
+ const scenario = questionnaire.scenario ?? "remediation";
187
+ if (questionnaire.status === "collecting" &&
188
+ !questionnaire.awaitingUserAnswer &&
189
+ hasMinimumScopeForScenario(scenario, questionnaire.fields)) {
190
+ return { ...questionnaire, status: "ready", pending: null };
191
+ }
192
+ return questionnaire;
207
193
  }
208
194
  export function updateClarifyStatus(ctx, questionnaire) {
209
- if (!ctx.hasUI) return;
210
- if (questionnaire.status === "ready") {
195
+ if (!ctx.hasUI)
196
+ return;
197
+ if (questionnaire.status === "ready") {
198
+ ctx.ui.setStatus("kubbisec-clarify", undefined);
199
+ return;
200
+ }
201
+ if (questionnaire.awaitingUserAnswer) {
202
+ ctx.ui.setStatus("kubbisec-clarify", ctx.ui.theme.fg("warning", `questionário · ${questionnaire.status}`));
203
+ return;
204
+ }
211
205
  ctx.ui.setStatus("kubbisec-clarify", undefined);
212
- return;
213
- }
214
- if (questionnaire.awaitingUserAnswer) {
215
- ctx.ui.setStatus(
216
- "kubbisec-clarify",
217
- ctx.ui.theme.fg("warning", `questionário · ${questionnaire.status}`),
218
- );
219
- return;
220
- }
221
- ctx.ui.setStatus("kubbisec-clarify", undefined);
222
206
  }
223
207
  export function processClarifyPrompt(questionnaire, prompt, cwd, clarifyMaxRounds) {
224
- let next = questionnaire;
225
- if (next.status === "collecting" && prompt.trim()) {
226
- const selectionMode = next.pending?.selectionMode ?? "single";
227
- const parsed = parseClarifyAnswer(prompt, selectionMode);
228
- if (shouldAcceptClarifyAnswer(next, parsed)) {
229
- next = applyParsedUserAnswerIfPending(next, parsed);
230
- next = finalizeQuestionnaireAtRoundLimit(next, clarifyMaxRounds);
231
- next = maybeMarkReady(next);
208
+ let next = questionnaire;
209
+ if (next.status === "collecting" && prompt.trim()) {
210
+ const selectionMode = next.pending?.selectionMode ?? "single";
211
+ const parsed = parseClarifyAnswer(prompt, selectionMode);
212
+ if (shouldAcceptClarifyAnswer(next, parsed)) {
213
+ next = applyParsedUserAnswerIfPending(next, parsed);
214
+ next = finalizeQuestionnaireAtRoundLimit(next, clarifyMaxRounds);
215
+ next = maybeMarkReady(next);
216
+ }
232
217
  }
233
- }
234
- next = applyDiscoveredScope(next, prompt, cwd);
235
- next = maybeMarkReady(next);
236
- return next;
218
+ next = applyDiscoveredScope(next, prompt, cwd);
219
+ next = maybeMarkReady(next);
220
+ return next;
237
221
  }
238
222
  export default function kubbisecClarify(api) {
239
- const sessionId = randomUUID();
240
- let questionnaire = readSessionQuestionnaire(process.cwd(), sessionId);
241
- let gateActive = false;
242
- let clarifyWidgetRegistered = false;
243
- let lastUserMessage = "";
244
- let sessionCwd = process.cwd();
245
- function persist(ctx, next) {
246
- questionnaire = next;
247
- try {
248
- writeSessionQuestionnaire(ctx.cwd, next);
249
- } catch (error) {
250
- console.warn("[kubbisec-clarify] Failed to persist session questionnaire:", error);
251
- }
252
- updateClarifyStatus(ctx, next);
253
- syncClarifyUi(next);
254
- }
255
- function ensureClarifyWidget(ctx) {
256
- if (!ctx.hasUI || clarifyWidgetRegistered) return;
257
- clarifyWidgetRegistered = true;
258
- ctx.ui.setWidget(
259
- "kubbisec-clarify-panel",
260
- (tui, theme) => {
261
- setClarifyUiChangeListener(() => {
262
- tui.requestRender();
263
- });
264
- return {
265
- dispose() {
266
- setClarifyUiChangeListener(undefined);
267
- },
268
- invalidate() {
269
- tui.requestRender();
270
- },
271
- render(w) {
272
- return renderClarifySelectPanel(w, getClarifyUiSnapshot(), theme);
273
- },
274
- };
275
- },
276
- { placement: "aboveEditor" },
277
- );
278
- }
279
- api.registerTool({
280
- name: "questionnaire",
281
- label: "Scope questionnaire",
282
- description:
283
- "Format and track contextual scope questions (ask/record/status/complete). KubbiSec renders options in the panel above the editor.",
284
- parameters: questionnaireToolParametersSchema(),
285
- async execute(_toolCallId, params) {
286
- const input = params;
287
- const result = executeQuestionnaireTool(questionnaire, input, lastUserMessage);
288
- questionnaire = result.questionnaire;
289
- try {
290
- writeSessionQuestionnaire(sessionCwd, questionnaire);
291
- } catch {
292
- // best effort
293
- }
294
- syncClarifyUi(questionnaire);
295
- return {
296
- content: [{ type: "text", text: result.message }],
297
- details: { ok: result.ok, status: result.status, action: result.action },
298
- };
299
- },
300
- });
301
- api.on("session_start", async (_event, ctx) => {
302
- sessionCwd = ctx.cwd;
303
- questionnaire = readSessionQuestionnaire(ctx.cwd, sessionId);
304
- gateActive = false;
305
- setClarifyGateActive(false);
306
- lastUserMessage = "";
307
- resetClarifyUiSnapshot();
308
- ensureClarifyWidget(ctx);
309
- updateClarifyStatus(ctx, questionnaire);
310
- syncClarifyUi(questionnaire);
311
- });
312
- api.on("session_shutdown", async () => {
313
- resetClarifyUiSnapshot();
314
- setClarifyGateActive(false);
315
- });
316
- api.on("before_agent_start", async (event, ctx) => {
317
- const { prompt } = event;
318
- lastUserMessage = prompt;
319
- const surface = resolveSurface();
320
- ensureClarifyWidget(ctx);
321
- if (surface !== "chat") {
322
- gateActive = false;
323
- setClarifyGateActive(false);
324
- resetClarifyUiSnapshot();
325
- return undefined;
223
+ const sessionId = randomUUID();
224
+ let questionnaire = readSessionQuestionnaire(process.cwd(), sessionId);
225
+ let gateActive = false;
226
+ let clarifyWidgetRegistered = false;
227
+ let lastUserMessage = "";
228
+ let sessionCwd = process.cwd();
229
+ function persist(ctx, next) {
230
+ questionnaire = next;
231
+ try {
232
+ writeSessionQuestionnaire(ctx.cwd, next);
233
+ }
234
+ catch (error) {
235
+ console.warn("[kubbisec-clarify] Failed to persist session questionnaire:", error);
236
+ }
237
+ updateClarifyStatus(ctx, next);
238
+ syncClarifyUi(next);
326
239
  }
327
- const budget = resolveResourceBudget();
328
- let next = readSessionQuestionnaire(ctx.cwd, questionnaire.sessionId);
329
- next = processClarifyPrompt(next, prompt, ctx.cwd, budget.clarifyMaxRounds);
330
- const gateInput = buildGateInput(prompt, next);
331
- gateActive = shouldClarify(gateInput);
332
- setClarifyGateActive(gateActive);
333
- if (!gateActive) {
334
- next = maybeMarkReady(next);
335
- persist(ctx, next);
336
- return undefined;
240
+ function ensureClarifyWidget(ctx) {
241
+ if (!ctx.hasUI || clarifyWidgetRegistered)
242
+ return;
243
+ clarifyWidgetRegistered = true;
244
+ ctx.ui.setWidget("kubbisec-clarify-panel", (tui, theme) => {
245
+ setClarifyUiChangeListener(() => {
246
+ tui.requestRender();
247
+ });
248
+ return {
249
+ dispose() {
250
+ setClarifyUiChangeListener(undefined);
251
+ },
252
+ invalidate() {
253
+ tui.requestRender();
254
+ },
255
+ render(w) {
256
+ return renderClarifySelectPanel(w, getClarifyUiSnapshot(), theme);
257
+ },
258
+ };
259
+ }, { placement: "aboveEditor" });
337
260
  }
338
- if (next.status === "collecting" && !next.awaitingUserAnswer) {
339
- next = autoAskNextQuestion(next, prompt);
340
- next = maybeMarkReady(next);
341
- persist(ctx, next);
342
- if (next.awaitingUserAnswer) {
261
+ api.registerTool({
262
+ name: "questionnaire",
263
+ label: "Scope questionnaire",
264
+ description: "Format and track contextual scope questions (ask/record/status/complete). KubbiSec renders options in the panel above the editor.",
265
+ parameters: questionnaireToolParametersSchema(),
266
+ async execute(_toolCallId, params) {
267
+ const input = params;
268
+ const result = executeQuestionnaireTool(questionnaire, input, lastUserMessage);
269
+ questionnaire = result.questionnaire;
270
+ try {
271
+ writeSessionQuestionnaire(sessionCwd, questionnaire);
272
+ }
273
+ catch {
274
+ // best effort
275
+ }
276
+ syncClarifyUi(questionnaire);
277
+ return {
278
+ content: [{ type: "text", text: result.message }],
279
+ details: { ok: result.ok, status: result.status, action: result.action },
280
+ };
281
+ },
282
+ });
283
+ api.on("session_start", async (_event, ctx) => {
284
+ sessionCwd = ctx.cwd;
285
+ questionnaire = readSessionQuestionnaire(ctx.cwd, sessionId);
286
+ gateActive = false;
287
+ setClarifyGateActive(false);
288
+ lastUserMessage = "";
289
+ resetClarifyUiSnapshot();
290
+ ensureClarifyWidget(ctx);
291
+ updateClarifyStatus(ctx, questionnaire);
292
+ syncClarifyUi(questionnaire);
293
+ });
294
+ api.on("session_shutdown", async () => {
295
+ resetClarifyUiSnapshot();
296
+ setClarifyGateActive(false);
297
+ });
298
+ api.on("before_agent_start", async (event, ctx) => {
299
+ const { prompt } = event;
300
+ lastUserMessage = prompt;
301
+ const surface = resolveSurface();
302
+ ensureClarifyWidget(ctx);
303
+ if (surface !== "chat") {
304
+ gateActive = false;
305
+ setClarifyGateActive(false);
306
+ resetClarifyUiSnapshot();
307
+ return undefined;
308
+ }
309
+ const budget = resolveResourceBudget();
310
+ let next = readSessionQuestionnaire(ctx.cwd, questionnaire.sessionId);
311
+ next = processClarifyPrompt(next, prompt, ctx.cwd, budget.clarifyMaxRounds);
312
+ const gateInput = buildGateInput(prompt, next);
313
+ gateActive = shouldClarify(gateInput);
314
+ setClarifyGateActive(gateActive);
315
+ if (!gateActive) {
316
+ next = maybeMarkReady(next);
317
+ persist(ctx, next);
318
+ return undefined;
319
+ }
320
+ if (next.status === "collecting" && !next.awaitingUserAnswer) {
321
+ next = autoAskNextQuestion(next, prompt);
322
+ next = maybeMarkReady(next);
323
+ persist(ctx, next);
324
+ if (next.awaitingUserAnswer) {
325
+ return {
326
+ message: {
327
+ customType: "kubbisec-clarify",
328
+ content: buildClarifyContextMessage(next),
329
+ display: false,
330
+ },
331
+ };
332
+ }
333
+ return {
334
+ message: {
335
+ customType: "kubbisec-clarify",
336
+ content: buildClarifyContextMessage(next),
337
+ display: false,
338
+ },
339
+ };
340
+ }
341
+ persist(ctx, next);
342
+ return undefined;
343
+ });
344
+ api.on("tool_call", async (event, ctx) => {
345
+ const surface = resolveSurface();
346
+ if (surface !== "chat") {
347
+ return undefined;
348
+ }
349
+ questionnaire = readSessionQuestionnaire(ctx.cwd, questionnaire.sessionId);
350
+ const { toolName } = event;
351
+ if (toolName === "questionnaire") {
352
+ return undefined;
353
+ }
354
+ if (!shouldBlockClarifyTool(toolName, gateActive, questionnaire)) {
355
+ return undefined;
356
+ }
343
357
  return {
344
- message: {
345
- customType: "kubbisec-clarify",
346
- content: buildClarifyContextMessage(next),
347
- display: false,
348
- },
358
+ block: true,
359
+ reason: CLARIFY_TOOL_BLOCK_REASON,
349
360
  };
350
- }
351
- return {
352
- message: {
353
- customType: "kubbisec-clarify",
354
- content: buildClarifyContextMessage(next),
355
- display: false,
356
- },
357
- };
358
- }
359
- persist(ctx, next);
360
- return undefined;
361
- });
362
- api.on("tool_call", async (event, ctx) => {
363
- const surface = resolveSurface();
364
- if (surface !== "chat") {
365
- return undefined;
366
- }
367
- questionnaire = readSessionQuestionnaire(ctx.cwd, questionnaire.sessionId);
368
- const { toolName } = event;
369
- if (toolName === "questionnaire") {
370
- return undefined;
371
- }
372
- if (!shouldBlockClarifyTool(toolName, gateActive, questionnaire)) {
373
- return undefined;
374
- }
375
- return {
376
- block: true,
377
- reason: CLARIFY_TOOL_BLOCK_REASON,
378
- };
379
- });
361
+ });
380
362
  }
381
- //# sourceMappingURL=kubbisec-clarify.extension.js.map
363
+ //# sourceMappingURL=kubbisec-clarify.extension.js.map