@flanksource/clicky-ui 0.3.40 → 0.3.42

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 (759) hide show
  1. package/README.md +24 -0
  2. package/dist/ai.cjs +14 -0
  3. package/dist/ai.cjs.map +1 -1
  4. package/dist/ai.js +14 -0
  5. package/dist/ai.js.map +1 -1
  6. package/dist/comments/CommentCard.cjs +3 -1
  7. package/dist/comments/CommentCard.cjs.map +1 -1
  8. package/dist/comments/CommentCard.d.ts.map +1 -1
  9. package/dist/comments/CommentCard.js +4 -2
  10. package/dist/comments/CommentCard.js.map +1 -1
  11. package/dist/comments/CommentCardParts.cjs +16 -0
  12. package/dist/comments/CommentCardParts.cjs.map +1 -1
  13. package/dist/comments/CommentCardParts.d.ts +4 -1
  14. package/dist/comments/CommentCardParts.d.ts.map +1 -1
  15. package/dist/comments/CommentCardParts.js +16 -0
  16. package/dist/comments/CommentCardParts.js.map +1 -1
  17. package/dist/comments/comment-types.cjs.map +1 -1
  18. package/dist/comments/comment-types.d.ts +4 -0
  19. package/dist/comments/comment-types.d.ts.map +1 -1
  20. package/dist/comments/comment-types.js.map +1 -1
  21. package/dist/components/AccordionList.cjs +5 -1
  22. package/dist/components/AccordionList.cjs.map +1 -1
  23. package/dist/components/AccordionList.d.ts +3 -1
  24. package/dist/components/AccordionList.d.ts.map +1 -1
  25. package/dist/components/AccordionList.js +5 -1
  26. package/dist/components/AccordionList.js.map +1 -1
  27. package/dist/components/Combobox.cjs +54 -8
  28. package/dist/components/Combobox.cjs.map +1 -1
  29. package/dist/components/Combobox.d.ts.map +1 -1
  30. package/dist/components/Combobox.js +56 -10
  31. package/dist/components/Combobox.js.map +1 -1
  32. package/dist/components/ComboboxMenu.cjs +139 -113
  33. package/dist/components/ComboboxMenu.cjs.map +1 -1
  34. package/dist/components/ComboboxMenu.d.ts +3 -1
  35. package/dist/components/ComboboxMenu.d.ts.map +1 -1
  36. package/dist/components/ComboboxMenu.js +139 -113
  37. package/dist/components/ComboboxMenu.js.map +1 -1
  38. package/dist/components/ComboboxMenuTrigger.cjs +87 -0
  39. package/dist/components/ComboboxMenuTrigger.cjs.map +1 -0
  40. package/dist/components/ComboboxMenuTrigger.d.ts +23 -0
  41. package/dist/components/ComboboxMenuTrigger.d.ts.map +1 -0
  42. package/dist/components/ComboboxMenuTrigger.js +87 -0
  43. package/dist/components/ComboboxMenuTrigger.js.map +1 -0
  44. package/dist/components/JsonSchemaForm.cjs +39 -11
  45. package/dist/components/JsonSchemaForm.cjs.map +1 -1
  46. package/dist/components/JsonSchemaForm.d.ts +1 -1
  47. package/dist/components/JsonSchemaForm.d.ts.map +1 -1
  48. package/dist/components/JsonSchemaForm.js +38 -10
  49. package/dist/components/JsonSchemaForm.js.map +1 -1
  50. package/dist/components/SegmentedControl.cjs +20 -3
  51. package/dist/components/SegmentedControl.cjs.map +1 -1
  52. package/dist/components/SegmentedControl.d.ts +11 -0
  53. package/dist/components/SegmentedControl.d.ts.map +1 -1
  54. package/dist/components/SegmentedControl.js +21 -4
  55. package/dist/components/SegmentedControl.js.map +1 -1
  56. package/dist/components/combobox-types.d.ts +8 -0
  57. package/dist/components/combobox-types.d.ts.map +1 -1
  58. package/dist/components/json-schema-form-accordion-array.cjs +3 -1
  59. package/dist/components/json-schema-form-accordion-array.cjs.map +1 -1
  60. package/dist/components/json-schema-form-accordion-array.d.ts +4 -1
  61. package/dist/components/json-schema-form-accordion-array.d.ts.map +1 -1
  62. package/dist/components/json-schema-form-accordion-array.js +3 -1
  63. package/dist/components/json-schema-form-accordion-array.js.map +1 -1
  64. package/dist/components/json-schema-form-array-view.cjs +63 -0
  65. package/dist/components/json-schema-form-array-view.cjs.map +1 -0
  66. package/dist/components/json-schema-form-array-view.d.ts +21 -0
  67. package/dist/components/json-schema-form-array-view.d.ts.map +1 -0
  68. package/dist/components/json-schema-form-array-view.js +63 -0
  69. package/dist/components/json-schema-form-array-view.js.map +1 -0
  70. package/dist/components/json-schema-form-array.cjs +3 -7
  71. package/dist/components/json-schema-form-array.cjs.map +1 -1
  72. package/dist/components/json-schema-form-array.d.ts.map +1 -1
  73. package/dist/components/json-schema-form-array.js +3 -7
  74. package/dist/components/json-schema-form-array.js.map +1 -1
  75. package/dist/components/json-schema-form-conditionals.cjs +67 -0
  76. package/dist/components/json-schema-form-conditionals.cjs.map +1 -0
  77. package/dist/components/json-schema-form-conditionals.d.ts +9 -0
  78. package/dist/components/json-schema-form-conditionals.d.ts.map +1 -0
  79. package/dist/components/json-schema-form-conditionals.js +67 -0
  80. package/dist/components/json-schema-form-conditionals.js.map +1 -0
  81. package/dist/components/json-schema-form-debug-badge.cjs +108 -0
  82. package/dist/components/json-schema-form-debug-badge.cjs.map +1 -0
  83. package/dist/components/json-schema-form-debug-badge.d.ts +10 -0
  84. package/dist/components/json-schema-form-debug-badge.d.ts.map +1 -0
  85. package/dist/components/json-schema-form-debug-badge.js +108 -0
  86. package/dist/components/json-schema-form-debug-badge.js.map +1 -0
  87. package/dist/components/json-schema-form-debug-glyph-map.cjs +129 -0
  88. package/dist/components/json-schema-form-debug-glyph-map.cjs.map +1 -0
  89. package/dist/components/json-schema-form-debug-glyph-map.d.ts +20 -0
  90. package/dist/components/json-schema-form-debug-glyph-map.d.ts.map +1 -0
  91. package/dist/components/json-schema-form-debug-glyph-map.js +129 -0
  92. package/dist/components/json-schema-form-debug-glyph-map.js.map +1 -0
  93. package/dist/components/json-schema-form-debug-glyph.cjs +13 -0
  94. package/dist/components/json-schema-form-debug-glyph.cjs.map +1 -0
  95. package/dist/components/json-schema-form-debug-glyph.d.ts +6 -0
  96. package/dist/components/json-schema-form-debug-glyph.d.ts.map +1 -0
  97. package/dist/components/json-schema-form-debug-glyph.js +13 -0
  98. package/dist/components/json-schema-form-debug-glyph.js.map +1 -0
  99. package/dist/components/json-schema-form-debug-groups.cjs +56 -0
  100. package/dist/components/json-schema-form-debug-groups.cjs.map +1 -0
  101. package/dist/components/json-schema-form-debug-groups.d.ts +8 -0
  102. package/dist/components/json-schema-form-debug-groups.d.ts.map +1 -0
  103. package/dist/components/json-schema-form-debug-groups.js +56 -0
  104. package/dist/components/json-schema-form-debug-groups.js.map +1 -0
  105. package/dist/components/json-schema-form-debug-keywords.cjs +159 -0
  106. package/dist/components/json-schema-form-debug-keywords.cjs.map +1 -0
  107. package/dist/components/json-schema-form-debug-keywords.d.ts +6 -0
  108. package/dist/components/json-schema-form-debug-keywords.d.ts.map +1 -0
  109. package/dist/components/json-schema-form-debug-keywords.js +159 -0
  110. package/dist/components/json-schema-form-debug-keywords.js.map +1 -0
  111. package/dist/components/json-schema-form-debug-listeners.cjs +102 -0
  112. package/dist/components/json-schema-form-debug-listeners.cjs.map +1 -0
  113. package/dist/components/json-schema-form-debug-listeners.d.ts +6 -0
  114. package/dist/components/json-schema-form-debug-listeners.d.ts.map +1 -0
  115. package/dist/components/json-schema-form-debug-listeners.js +102 -0
  116. package/dist/components/json-schema-form-debug-listeners.js.map +1 -0
  117. package/dist/components/json-schema-form-debug.cjs +31 -0
  118. package/dist/components/json-schema-form-debug.cjs.map +1 -0
  119. package/dist/components/json-schema-form-debug.d.ts +11 -0
  120. package/dist/components/json-schema-form-debug.d.ts.map +1 -0
  121. package/dist/components/json-schema-form-debug.js +31 -0
  122. package/dist/components/json-schema-form-debug.js.map +1 -0
  123. package/dist/components/json-schema-form-defaults.cjs +68 -0
  124. package/dist/components/json-schema-form-defaults.cjs.map +1 -0
  125. package/dist/components/json-schema-form-defaults.d.ts +4 -0
  126. package/dist/components/json-schema-form-defaults.d.ts.map +1 -0
  127. package/dist/components/json-schema-form-defaults.js +68 -0
  128. package/dist/components/json-schema-form-defaults.js.map +1 -0
  129. package/dist/components/json-schema-form-enum-choice.cjs +114 -0
  130. package/dist/components/json-schema-form-enum-choice.cjs.map +1 -0
  131. package/dist/components/json-schema-form-enum-choice.d.ts +14 -0
  132. package/dist/components/json-schema-form-enum-choice.d.ts.map +1 -0
  133. package/dist/components/json-schema-form-enum-choice.js +114 -0
  134. package/dist/components/json-schema-form-enum-choice.js.map +1 -0
  135. package/dist/components/json-schema-form-errors.cjs +49 -31
  136. package/dist/components/json-schema-form-errors.cjs.map +1 -1
  137. package/dist/components/json-schema-form-errors.d.ts +4 -2
  138. package/dist/components/json-schema-form-errors.d.ts.map +1 -1
  139. package/dist/components/json-schema-form-errors.js +51 -33
  140. package/dist/components/json-schema-form-errors.js.map +1 -1
  141. package/dist/components/json-schema-form-fields.cjs +3 -93
  142. package/dist/components/json-schema-form-fields.cjs.map +1 -1
  143. package/dist/components/json-schema-form-fields.d.ts.map +1 -1
  144. package/dist/components/json-schema-form-fields.js +1 -91
  145. package/dist/components/json-schema-form-fields.js.map +1 -1
  146. package/dist/components/json-schema-form-filter.cjs +2 -1
  147. package/dist/components/json-schema-form-filter.cjs.map +1 -1
  148. package/dist/components/json-schema-form-filter.js +2 -1
  149. package/dist/components/json-schema-form-filter.js.map +1 -1
  150. package/dist/components/json-schema-form-item-summary.cjs +6 -2
  151. package/dist/components/json-schema-form-item-summary.cjs.map +1 -1
  152. package/dist/components/json-schema-form-item-summary.d.ts.map +1 -1
  153. package/dist/components/json-schema-form-item-summary.js +6 -2
  154. package/dist/components/json-schema-form-item-summary.js.map +1 -1
  155. package/dist/components/json-schema-form-layout.cjs +28 -19
  156. package/dist/components/json-schema-form-layout.cjs.map +1 -1
  157. package/dist/components/json-schema-form-layout.d.ts +8 -6
  158. package/dist/components/json-schema-form-layout.d.ts.map +1 -1
  159. package/dist/components/json-schema-form-layout.js +29 -20
  160. package/dist/components/json-schema-form-layout.js.map +1 -1
  161. package/dist/components/json-schema-form-listener-paths.cjs +52 -0
  162. package/dist/components/json-schema-form-listener-paths.cjs.map +1 -0
  163. package/dist/components/json-schema-form-listener-paths.d.ts +10 -0
  164. package/dist/components/json-schema-form-listener-paths.d.ts.map +1 -0
  165. package/dist/components/json-schema-form-listener-paths.js +52 -0
  166. package/dist/components/json-schema-form-listener-paths.js.map +1 -0
  167. package/dist/components/json-schema-form-listener-types.d.ts +22 -0
  168. package/dist/components/json-schema-form-listener-types.d.ts.map +1 -0
  169. package/dist/components/json-schema-form-listeners.cjs +256 -0
  170. package/dist/components/json-schema-form-listeners.cjs.map +1 -0
  171. package/dist/components/json-schema-form-listeners.d.ts +13 -0
  172. package/dist/components/json-schema-form-listeners.d.ts.map +1 -0
  173. package/dist/components/json-schema-form-listeners.js +256 -0
  174. package/dist/components/json-schema-form-listeners.js.map +1 -0
  175. package/dist/components/json-schema-form-object-array-view.cjs +62 -0
  176. package/dist/components/json-schema-form-object-array-view.cjs.map +1 -0
  177. package/dist/components/json-schema-form-object-array-view.d.ts +14 -0
  178. package/dist/components/json-schema-form-object-array-view.d.ts.map +1 -0
  179. package/dist/components/json-schema-form-object-array-view.js +62 -0
  180. package/dist/components/json-schema-form-object-array-view.js.map +1 -0
  181. package/dist/components/json-schema-form-object.cjs +3 -0
  182. package/dist/components/json-schema-form-object.cjs.map +1 -1
  183. package/dist/components/json-schema-form-object.d.ts.map +1 -1
  184. package/dist/components/json-schema-form-object.js +3 -0
  185. package/dist/components/json-schema-form-object.js.map +1 -1
  186. package/dist/components/json-schema-form-preferences.cjs +1 -0
  187. package/dist/components/json-schema-form-preferences.cjs.map +1 -1
  188. package/dist/components/json-schema-form-preferences.d.ts +1 -0
  189. package/dist/components/json-schema-form-preferences.d.ts.map +1 -1
  190. package/dist/components/json-schema-form-preferences.js +1 -0
  191. package/dist/components/json-schema-form-preferences.js.map +1 -1
  192. package/dist/components/json-schema-form-render.cjs +36 -12
  193. package/dist/components/json-schema-form-render.cjs.map +1 -1
  194. package/dist/components/json-schema-form-render.d.ts.map +1 -1
  195. package/dist/components/json-schema-form-render.js +38 -14
  196. package/dist/components/json-schema-form-render.js.map +1 -1
  197. package/dist/components/json-schema-form-resolve.cjs +6 -99
  198. package/dist/components/json-schema-form-resolve.cjs.map +1 -1
  199. package/dist/components/json-schema-form-resolve.d.ts +1 -8
  200. package/dist/components/json-schema-form-resolve.d.ts.map +1 -1
  201. package/dist/components/json-schema-form-resolve.js +5 -98
  202. package/dist/components/json-schema-form-resolve.js.map +1 -1
  203. package/dist/components/json-schema-form-runtime-types.d.ts +16 -0
  204. package/dist/components/json-schema-form-runtime-types.d.ts.map +1 -1
  205. package/dist/components/json-schema-form-table-array.cjs +67 -16
  206. package/dist/components/json-schema-form-table-array.cjs.map +1 -1
  207. package/dist/components/json-schema-form-table-array.d.ts +4 -1
  208. package/dist/components/json-schema-form-table-array.d.ts.map +1 -1
  209. package/dist/components/json-schema-form-table-array.js +70 -19
  210. package/dist/components/json-schema-form-table-array.js.map +1 -1
  211. package/dist/components/json-schema-form-tone.cjs +12 -0
  212. package/dist/components/json-schema-form-tone.cjs.map +1 -1
  213. package/dist/components/json-schema-form-tone.js +12 -0
  214. package/dist/components/json-schema-form-tone.js.map +1 -1
  215. package/dist/components/json-schema-form-types.d.ts +17 -0
  216. package/dist/components/json-schema-form-types.d.ts.map +1 -1
  217. package/dist/components/json-schema-form-utils.cjs +7 -1
  218. package/dist/components/json-schema-form-utils.cjs.map +1 -1
  219. package/dist/components/json-schema-form-utils.d.ts +2 -1
  220. package/dist/components/json-schema-form-utils.d.ts.map +1 -1
  221. package/dist/components/json-schema-form-utils.js +7 -1
  222. package/dist/components/json-schema-form-utils.js.map +1 -1
  223. package/dist/components.cjs +3 -2
  224. package/dist/components.cjs.map +1 -1
  225. package/dist/components.d.ts +3 -2
  226. package/dist/components.d.ts.map +1 -1
  227. package/dist/components.js +2 -1
  228. package/dist/components.js.map +1 -1
  229. package/dist/data/DataTable.cjs +9 -3
  230. package/dist/data/DataTable.cjs.map +1 -1
  231. package/dist/data/DataTable.d.ts +6 -0
  232. package/dist/data/DataTable.d.ts.map +1 -1
  233. package/dist/data/DataTable.js +9 -3
  234. package/dist/data/DataTable.js.map +1 -1
  235. package/dist/data/FixtureEditor/FixtureEditor.cjs +43 -24
  236. package/dist/data/FixtureEditor/FixtureEditor.cjs.map +1 -1
  237. package/dist/data/FixtureEditor/FixtureEditor.d.ts.map +1 -1
  238. package/dist/data/FixtureEditor/FixtureEditor.js +43 -24
  239. package/dist/data/FixtureEditor/FixtureEditor.js.map +1 -1
  240. package/dist/data/GraphDiagram.cjs +125 -138
  241. package/dist/data/GraphDiagram.cjs.map +1 -1
  242. package/dist/data/GraphDiagram.d.ts +30 -23
  243. package/dist/data/GraphDiagram.d.ts.map +1 -1
  244. package/dist/data/GraphDiagram.js +128 -141
  245. package/dist/data/GraphDiagram.js.map +1 -1
  246. package/dist/data/GraphDiagramEdges.cjs +208 -0
  247. package/dist/data/GraphDiagramEdges.cjs.map +1 -0
  248. package/dist/data/GraphDiagramEdges.d.ts +40 -0
  249. package/dist/data/GraphDiagramEdges.d.ts.map +1 -0
  250. package/dist/data/GraphDiagramEdges.js +208 -0
  251. package/dist/data/GraphDiagramEdges.js.map +1 -0
  252. package/dist/data/GraphDiagramNodes.cjs +142 -0
  253. package/dist/data/GraphDiagramNodes.cjs.map +1 -0
  254. package/dist/data/GraphDiagramNodes.d.ts +22 -0
  255. package/dist/data/GraphDiagramNodes.d.ts.map +1 -0
  256. package/dist/data/GraphDiagramNodes.js +142 -0
  257. package/dist/data/GraphDiagramNodes.js.map +1 -0
  258. package/dist/data/Tree.cjs +10 -2
  259. package/dist/data/Tree.cjs.map +1 -1
  260. package/dist/data/Tree.d.ts +6 -1
  261. package/dist/data/Tree.d.ts.map +1 -1
  262. package/dist/data/Tree.js +10 -2
  263. package/dist/data/Tree.js.map +1 -1
  264. package/dist/data/ai/PromptRunEditor/RuntimeRows.cjs +8 -3
  265. package/dist/data/ai/PromptRunEditor/RuntimeRows.cjs.map +1 -1
  266. package/dist/data/ai/PromptRunEditor/RuntimeRows.d.ts.map +1 -1
  267. package/dist/data/ai/PromptRunEditor/RuntimeRows.js +8 -3
  268. package/dist/data/ai/PromptRunEditor/RuntimeRows.js.map +1 -1
  269. package/dist/data/ai/PromptRunEditor/index.cjs +37 -43
  270. package/dist/data/ai/PromptRunEditor/index.cjs.map +1 -1
  271. package/dist/data/ai/PromptRunEditor/index.d.ts +3 -1
  272. package/dist/data/ai/PromptRunEditor/index.d.ts.map +1 -1
  273. package/dist/data/ai/PromptRunEditor/index.js +38 -44
  274. package/dist/data/ai/PromptRunEditor/index.js.map +1 -1
  275. package/dist/data/ai/PromptRunEditor/runtimeActions.cjs +16 -5
  276. package/dist/data/ai/PromptRunEditor/runtimeActions.cjs.map +1 -1
  277. package/dist/data/ai/PromptRunEditor/runtimeActions.d.ts +4 -1
  278. package/dist/data/ai/PromptRunEditor/runtimeActions.d.ts.map +1 -1
  279. package/dist/data/ai/PromptRunEditor/runtimeActions.js +17 -6
  280. package/dist/data/ai/PromptRunEditor/runtimeActions.js.map +1 -1
  281. package/dist/data/ai/SessionInspector.approvals-model.cjs +12 -0
  282. package/dist/data/ai/SessionInspector.approvals-model.cjs.map +1 -1
  283. package/dist/data/ai/SessionInspector.approvals-model.d.ts +11 -2
  284. package/dist/data/ai/SessionInspector.approvals-model.d.ts.map +1 -1
  285. package/dist/data/ai/SessionInspector.approvals-model.js +12 -0
  286. package/dist/data/ai/SessionInspector.approvals-model.js.map +1 -1
  287. package/dist/data/ai/SessionInspector.approvals.cjs +25 -1
  288. package/dist/data/ai/SessionInspector.approvals.cjs.map +1 -1
  289. package/dist/data/ai/SessionInspector.approvals.d.ts.map +1 -1
  290. package/dist/data/ai/SessionInspector.approvals.js +26 -2
  291. package/dist/data/ai/SessionInspector.approvals.js.map +1 -1
  292. package/dist/data/ai/SessionInspector.cjs +143 -167
  293. package/dist/data/ai/SessionInspector.cjs.map +1 -1
  294. package/dist/data/ai/SessionInspector.collection-types.d.ts +5 -0
  295. package/dist/data/ai/SessionInspector.collection-types.d.ts.map +1 -1
  296. package/dist/data/ai/SessionInspector.collection.cjs +18 -5
  297. package/dist/data/ai/SessionInspector.collection.cjs.map +1 -1
  298. package/dist/data/ai/SessionInspector.collection.d.ts +2 -0
  299. package/dist/data/ai/SessionInspector.collection.d.ts.map +1 -1
  300. package/dist/data/ai/SessionInspector.collection.fixtures.d.ts +6 -0
  301. package/dist/data/ai/SessionInspector.collection.fixtures.d.ts.map +1 -0
  302. package/dist/data/ai/SessionInspector.collection.js +18 -5
  303. package/dist/data/ai/SessionInspector.collection.js.map +1 -1
  304. package/dist/data/ai/SessionInspector.d.ts +24 -2
  305. package/dist/data/ai/SessionInspector.d.ts.map +1 -1
  306. package/dist/data/ai/SessionInspector.hierarchy-state.cjs +105 -7
  307. package/dist/data/ai/SessionInspector.hierarchy-state.cjs.map +1 -1
  308. package/dist/data/ai/SessionInspector.hierarchy-state.d.ts +12 -1
  309. package/dist/data/ai/SessionInspector.hierarchy-state.d.ts.map +1 -1
  310. package/dist/data/ai/SessionInspector.hierarchy-state.js +107 -9
  311. package/dist/data/ai/SessionInspector.hierarchy-state.js.map +1 -1
  312. package/dist/data/ai/SessionInspector.hierarchy.cjs +1 -1
  313. package/dist/data/ai/SessionInspector.hierarchy.cjs.map +1 -1
  314. package/dist/data/ai/SessionInspector.hierarchy.js +1 -1
  315. package/dist/data/ai/SessionInspector.hierarchy.js.map +1 -1
  316. package/dist/data/ai/SessionInspector.js +144 -168
  317. package/dist/data/ai/SessionInspector.js.map +1 -1
  318. package/dist/data/ai/SessionInspector.legacy.cjs +116 -0
  319. package/dist/data/ai/SessionInspector.legacy.cjs.map +1 -0
  320. package/dist/data/ai/SessionInspector.legacy.d.ts +19 -0
  321. package/dist/data/ai/SessionInspector.legacy.d.ts.map +1 -0
  322. package/dist/data/ai/SessionInspector.legacy.js +116 -0
  323. package/dist/data/ai/SessionInspector.legacy.js.map +1 -0
  324. package/dist/data/ai/SessionInspector.panels.cjs +3 -0
  325. package/dist/data/ai/SessionInspector.panels.cjs.map +1 -1
  326. package/dist/data/ai/SessionInspector.panels.d.ts.map +1 -1
  327. package/dist/data/ai/SessionInspector.panels.js +3 -0
  328. package/dist/data/ai/SessionInspector.panels.js.map +1 -1
  329. package/dist/data/ai/SessionInspector.plan.cjs +29 -12
  330. package/dist/data/ai/SessionInspector.plan.cjs.map +1 -1
  331. package/dist/data/ai/SessionInspector.plan.d.ts.map +1 -1
  332. package/dist/data/ai/SessionInspector.plan.js +30 -13
  333. package/dist/data/ai/SessionInspector.plan.js.map +1 -1
  334. package/dist/data/ai/SessionInspector.remote-view.cjs +44 -0
  335. package/dist/data/ai/SessionInspector.remote-view.cjs.map +1 -0
  336. package/dist/data/ai/SessionInspector.remote-view.d.ts +11 -0
  337. package/dist/data/ai/SessionInspector.remote-view.d.ts.map +1 -0
  338. package/dist/data/ai/SessionInspector.remote-view.js +44 -0
  339. package/dist/data/ai/SessionInspector.remote-view.js.map +1 -0
  340. package/dist/data/ai/SessionInspector.remote.cjs +275 -0
  341. package/dist/data/ai/SessionInspector.remote.cjs.map +1 -0
  342. package/dist/data/ai/SessionInspector.remote.d.ts +57 -0
  343. package/dist/data/ai/SessionInspector.remote.d.ts.map +1 -0
  344. package/dist/data/ai/SessionInspector.remote.js +275 -0
  345. package/dist/data/ai/SessionInspector.remote.js.map +1 -0
  346. package/dist/data/ai/SessionInspector.summary.cjs +9 -159
  347. package/dist/data/ai/SessionInspector.summary.cjs.map +1 -1
  348. package/dist/data/ai/SessionInspector.summary.d.ts +0 -3
  349. package/dist/data/ai/SessionInspector.summary.d.ts.map +1 -1
  350. package/dist/data/ai/SessionInspector.summary.js +11 -161
  351. package/dist/data/ai/SessionInspector.summary.js.map +1 -1
  352. package/dist/data/ai/SessionInspector.tab-state.cjs +15 -0
  353. package/dist/data/ai/SessionInspector.tab-state.cjs.map +1 -0
  354. package/dist/data/ai/SessionInspector.tab-state.d.ts +3 -0
  355. package/dist/data/ai/SessionInspector.tab-state.d.ts.map +1 -0
  356. package/dist/data/ai/SessionInspector.tab-state.js +15 -0
  357. package/dist/data/ai/SessionInspector.tab-state.js.map +1 -0
  358. package/dist/data/ai/SessionInspector.tabs.model.cjs +31 -18
  359. package/dist/data/ai/SessionInspector.tabs.model.cjs.map +1 -1
  360. package/dist/data/ai/SessionInspector.tabs.model.d.ts +3 -1
  361. package/dist/data/ai/SessionInspector.tabs.model.d.ts.map +1 -1
  362. package/dist/data/ai/SessionInspector.tabs.model.js +32 -19
  363. package/dist/data/ai/SessionInspector.tabs.model.js.map +1 -1
  364. package/dist/data/ai/SessionInspector.transcript.cjs +4 -0
  365. package/dist/data/ai/SessionInspector.transcript.cjs.map +1 -1
  366. package/dist/data/ai/SessionInspector.transcript.d.ts.map +1 -1
  367. package/dist/data/ai/SessionInspector.transcript.js +4 -0
  368. package/dist/data/ai/SessionInspector.transcript.js.map +1 -1
  369. package/dist/data/ai/SessionInspector.verification.cjs +53 -0
  370. package/dist/data/ai/SessionInspector.verification.cjs.map +1 -0
  371. package/dist/data/ai/SessionInspector.verification.d.ts +7 -0
  372. package/dist/data/ai/SessionInspector.verification.d.ts.map +1 -0
  373. package/dist/data/ai/SessionInspector.verification.js +53 -0
  374. package/dist/data/ai/SessionInspector.verification.js.map +1 -0
  375. package/dist/data/ai/SessionViewer.approval-body.cjs +146 -0
  376. package/dist/data/ai/SessionViewer.approval-body.cjs.map +1 -0
  377. package/dist/data/ai/SessionViewer.approval-body.d.ts +11 -0
  378. package/dist/data/ai/SessionViewer.approval-body.d.ts.map +1 -0
  379. package/dist/data/ai/SessionViewer.approval-body.js +146 -0
  380. package/dist/data/ai/SessionViewer.approval-body.js.map +1 -0
  381. package/dist/data/ai/SessionViewer.approval-forms.cjs +150 -0
  382. package/dist/data/ai/SessionViewer.approval-forms.cjs.map +1 -0
  383. package/dist/data/ai/SessionViewer.approval-forms.d.ts +23 -0
  384. package/dist/data/ai/SessionViewer.approval-forms.d.ts.map +1 -0
  385. package/dist/data/ai/SessionViewer.approval-forms.js +150 -0
  386. package/dist/data/ai/SessionViewer.approval-forms.js.map +1 -0
  387. package/dist/data/ai/SessionViewer.cjs +57 -20
  388. package/dist/data/ai/SessionViewer.cjs.map +1 -1
  389. package/dist/data/ai/SessionViewer.d.ts +13 -3
  390. package/dist/data/ai/SessionViewer.d.ts.map +1 -1
  391. package/dist/data/ai/SessionViewer.decision-controls.cjs +313 -0
  392. package/dist/data/ai/SessionViewer.decision-controls.cjs.map +1 -0
  393. package/dist/data/ai/SessionViewer.decision-controls.d.ts +43 -0
  394. package/dist/data/ai/SessionViewer.decision-controls.d.ts.map +1 -0
  395. package/dist/data/ai/SessionViewer.decision-controls.js +313 -0
  396. package/dist/data/ai/SessionViewer.decision-controls.js.map +1 -0
  397. package/dist/data/ai/SessionViewer.decision.cjs +21 -0
  398. package/dist/data/ai/SessionViewer.decision.cjs.map +1 -0
  399. package/dist/data/ai/SessionViewer.decision.d.ts +12 -0
  400. package/dist/data/ai/SessionViewer.decision.d.ts.map +1 -0
  401. package/dist/data/ai/SessionViewer.decision.js +21 -0
  402. package/dist/data/ai/SessionViewer.decision.js.map +1 -0
  403. package/dist/data/ai/SessionViewer.input.cjs +14 -0
  404. package/dist/data/ai/SessionViewer.input.cjs.map +1 -1
  405. package/dist/data/ai/SessionViewer.input.d.ts +5 -0
  406. package/dist/data/ai/SessionViewer.input.d.ts.map +1 -1
  407. package/dist/data/ai/SessionViewer.input.js +14 -0
  408. package/dist/data/ai/SessionViewer.input.js.map +1 -1
  409. package/dist/data/ai/SessionViewer.js +58 -21
  410. package/dist/data/ai/SessionViewer.js.map +1 -1
  411. package/dist/data/ai/SessionViewer.model.cjs +7 -1
  412. package/dist/data/ai/SessionViewer.model.cjs.map +1 -1
  413. package/dist/data/ai/SessionViewer.model.d.ts +25 -3
  414. package/dist/data/ai/SessionViewer.model.d.ts.map +1 -1
  415. package/dist/data/ai/SessionViewer.model.js +7 -1
  416. package/dist/data/ai/SessionViewer.model.js.map +1 -1
  417. package/dist/data/ai/SessionViewer.rows.cjs +6 -3
  418. package/dist/data/ai/SessionViewer.rows.cjs.map +1 -1
  419. package/dist/data/ai/SessionViewer.rows.d.ts +2 -1
  420. package/dist/data/ai/SessionViewer.rows.d.ts.map +1 -1
  421. package/dist/data/ai/SessionViewer.rows.js +6 -3
  422. package/dist/data/ai/SessionViewer.rows.js.map +1 -1
  423. package/dist/data/ai/SessionViewer.tool-row.cjs +29 -237
  424. package/dist/data/ai/SessionViewer.tool-row.cjs.map +1 -1
  425. package/dist/data/ai/SessionViewer.tool-row.d.ts.map +1 -1
  426. package/dist/data/ai/SessionViewer.tool-row.js +27 -235
  427. package/dist/data/ai/SessionViewer.tool-row.js.map +1 -1
  428. package/dist/data/ai/SessionViewer.unified.d.ts +17 -0
  429. package/dist/data/ai/SessionViewer.unified.d.ts.map +1 -1
  430. package/dist/data/ai/SessionViewerMenu.cjs +8 -2
  431. package/dist/data/ai/SessionViewerMenu.cjs.map +1 -1
  432. package/dist/data/ai/SessionViewerMenu.d.ts +4 -1
  433. package/dist/data/ai/SessionViewerMenu.d.ts.map +1 -1
  434. package/dist/data/ai/SessionViewerMenu.js +8 -2
  435. package/dist/data/ai/SessionViewerMenu.js.map +1 -1
  436. package/dist/data/ai/SpecRuntimeEditor/CommitSection.cjs +28 -17
  437. package/dist/data/ai/SpecRuntimeEditor/CommitSection.cjs.map +1 -1
  438. package/dist/data/ai/SpecRuntimeEditor/CommitSection.d.ts +10 -2
  439. package/dist/data/ai/SpecRuntimeEditor/CommitSection.d.ts.map +1 -1
  440. package/dist/data/ai/SpecRuntimeEditor/CommitSection.js +29 -18
  441. package/dist/data/ai/SpecRuntimeEditor/CommitSection.js.map +1 -1
  442. package/dist/data/ai/SpecRuntimeEditor/index.cjs +9 -1
  443. package/dist/data/ai/SpecRuntimeEditor/index.cjs.map +1 -1
  444. package/dist/data/ai/SpecRuntimeEditor/index.d.ts +9 -2
  445. package/dist/data/ai/SpecRuntimeEditor/index.d.ts.map +1 -1
  446. package/dist/data/ai/SpecRuntimeEditor/index.js +9 -1
  447. package/dist/data/ai/SpecRuntimeEditor/index.js.map +1 -1
  448. package/dist/data/ai/SpecRuntimeEditor/permission-mode-visuals.cjs +1 -1
  449. package/dist/data/ai/SpecRuntimeEditor/permission-mode-visuals.js +1 -1
  450. package/dist/data/ai/SpecRuntimeEditor/summaries.cjs.map +1 -1
  451. package/dist/data/ai/SpecRuntimeEditor/summaries.d.ts +8 -2
  452. package/dist/data/ai/SpecRuntimeEditor/summaries.d.ts.map +1 -1
  453. package/dist/data/ai/SpecRuntimeEditor/summaries.js.map +1 -1
  454. package/dist/data/ai/SpecRuntimeEditor/update.cjs +14 -6
  455. package/dist/data/ai/SpecRuntimeEditor/update.cjs.map +1 -1
  456. package/dist/data/ai/SpecRuntimeEditor/update.d.ts +1 -0
  457. package/dist/data/ai/SpecRuntimeEditor/update.d.ts.map +1 -1
  458. package/dist/data/ai/SpecRuntimeEditor/update.js +14 -6
  459. package/dist/data/ai/SpecRuntimeEditor/update.js.map +1 -1
  460. package/dist/data/ai/approval-request.cjs +75 -0
  461. package/dist/data/ai/approval-request.cjs.map +1 -0
  462. package/dist/data/ai/approval-request.d.ts +155 -0
  463. package/dist/data/ai/approval-request.d.ts.map +1 -0
  464. package/dist/data/ai/approval-request.js +75 -0
  465. package/dist/data/ai/approval-request.js.map +1 -0
  466. package/dist/data/ai/index.d.ts +6 -1
  467. package/dist/data/ai/index.d.ts.map +1 -1
  468. package/dist/data/ai/runtime-preset-menu/SavePresetDialog.cjs +125 -0
  469. package/dist/data/ai/runtime-preset-menu/SavePresetDialog.cjs.map +1 -0
  470. package/dist/data/ai/runtime-preset-menu/SavePresetDialog.d.ts +11 -0
  471. package/dist/data/ai/runtime-preset-menu/SavePresetDialog.d.ts.map +1 -0
  472. package/dist/data/ai/runtime-preset-menu/SavePresetDialog.js +125 -0
  473. package/dist/data/ai/runtime-preset-menu/SavePresetDialog.js.map +1 -0
  474. package/dist/data/ai/runtime-preset-menu/index.d.ts +3 -0
  475. package/dist/data/ai/runtime-preset-menu/index.d.ts.map +1 -0
  476. package/dist/data/ai/runtime-preset-menu/model.cjs +73 -0
  477. package/dist/data/ai/runtime-preset-menu/model.cjs.map +1 -0
  478. package/dist/data/ai/runtime-preset-menu/model.d.ts +13 -0
  479. package/dist/data/ai/runtime-preset-menu/model.d.ts.map +1 -0
  480. package/dist/data/ai/runtime-preset-menu/model.js +73 -0
  481. package/dist/data/ai/runtime-preset-menu/model.js.map +1 -0
  482. package/dist/data/ai/runtime-preset-menu/use-runtime-preset-menu.cjs +149 -0
  483. package/dist/data/ai/runtime-preset-menu/use-runtime-preset-menu.cjs.map +1 -0
  484. package/dist/data/ai/runtime-preset-menu/use-runtime-preset-menu.d.ts +15 -0
  485. package/dist/data/ai/runtime-preset-menu/use-runtime-preset-menu.d.ts.map +1 -0
  486. package/dist/data/ai/runtime-preset-menu/use-runtime-preset-menu.js +149 -0
  487. package/dist/data/ai/runtime-preset-menu/use-runtime-preset-menu.js.map +1 -0
  488. package/dist/data/ai/runtime-spec-fields.cjs +166 -0
  489. package/dist/data/ai/runtime-spec-fields.cjs.map +1 -0
  490. package/dist/data/ai/runtime-spec-fields.d.ts +13 -0
  491. package/dist/data/ai/runtime-spec-fields.d.ts.map +1 -0
  492. package/dist/data/ai/runtime-spec-fields.js +166 -0
  493. package/dist/data/ai/runtime-spec-fields.js.map +1 -0
  494. package/dist/data/ai/session-categories.cjs +4 -0
  495. package/dist/data/ai/session-categories.cjs.map +1 -1
  496. package/dist/data/ai/session-categories.d.ts +1 -0
  497. package/dist/data/ai/session-categories.d.ts.map +1 -1
  498. package/dist/data/ai/session-categories.js +4 -0
  499. package/dist/data/ai/session-categories.js.map +1 -1
  500. package/dist/data/ai/use-session-scroll.cjs +49 -21
  501. package/dist/data/ai/use-session-scroll.cjs.map +1 -1
  502. package/dist/data/ai/use-session-scroll.d.ts +2 -0
  503. package/dist/data/ai/use-session-scroll.d.ts.map +1 -1
  504. package/dist/data/ai/use-session-scroll.js +49 -21
  505. package/dist/data/ai/use-session-scroll.js.map +1 -1
  506. package/dist/data/chat/Chat.runtime.cjs +1 -1
  507. package/dist/data/chat/Chat.runtime.cjs.map +1 -1
  508. package/dist/data/chat/Chat.runtime.d.ts.map +1 -1
  509. package/dist/data/chat/Chat.runtime.js +1 -1
  510. package/dist/data/chat/Chat.runtime.js.map +1 -1
  511. package/dist/data/graph-columns-layout.cjs +216 -0
  512. package/dist/data/graph-columns-layout.cjs.map +1 -0
  513. package/dist/data/graph-columns-layout.d.ts +56 -0
  514. package/dist/data/graph-columns-layout.d.ts.map +1 -0
  515. package/dist/data/graph-columns-layout.js +216 -0
  516. package/dist/data/graph-columns-layout.js.map +1 -0
  517. package/dist/data/graph-diagram-model.cjs +73 -0
  518. package/dist/data/graph-diagram-model.cjs.map +1 -0
  519. package/dist/data/graph-diagram-model.d.ts +90 -0
  520. package/dist/data/graph-diagram-model.d.ts.map +1 -0
  521. package/dist/data/graph-diagram-model.js +73 -0
  522. package/dist/data/graph-diagram-model.js.map +1 -0
  523. package/dist/data/graph-edge-routing.cjs +235 -0
  524. package/dist/data/graph-edge-routing.cjs.map +1 -0
  525. package/dist/data/graph-edge-routing.d.ts +73 -0
  526. package/dist/data/graph-edge-routing.d.ts.map +1 -0
  527. package/dist/data/graph-edge-routing.js +235 -0
  528. package/dist/data/graph-edge-routing.js.map +1 -0
  529. package/dist/data/graph-layout.cjs +0 -82
  530. package/dist/data/graph-layout.cjs.map +1 -1
  531. package/dist/data/graph-layout.d.ts +1 -28
  532. package/dist/data/graph-layout.d.ts.map +1 -1
  533. package/dist/data/graph-layout.js +1 -83
  534. package/dist/data/graph-layout.js.map +1 -1
  535. package/dist/data/har/HarPanel.cjs +129 -33
  536. package/dist/data/har/HarPanel.cjs.map +1 -1
  537. package/dist/data/har/HarPanel.d.ts +13 -1
  538. package/dist/data/har/HarPanel.d.ts.map +1 -1
  539. package/dist/data/har/HarPanel.js +130 -34
  540. package/dist/data/har/HarPanel.js.map +1 -1
  541. package/dist/data/har/fixtures.d.ts +12 -0
  542. package/dist/data/har/fixtures.d.ts.map +1 -1
  543. package/dist/data/har/types.d.ts +12 -0
  544. package/dist/data/har/types.d.ts.map +1 -1
  545. package/dist/data/runtime/RuntimeBar.cjs +67 -84
  546. package/dist/data/runtime/RuntimeBar.cjs.map +1 -1
  547. package/dist/data/runtime/RuntimeBar.d.ts +4 -5
  548. package/dist/data/runtime/RuntimeBar.d.ts.map +1 -1
  549. package/dist/data/runtime/RuntimeBar.fields.cjs +170 -0
  550. package/dist/data/runtime/RuntimeBar.fields.cjs.map +1 -0
  551. package/dist/data/runtime/RuntimeBar.fields.d.ts +16 -0
  552. package/dist/data/runtime/RuntimeBar.fields.d.ts.map +1 -0
  553. package/dist/data/runtime/RuntimeBar.fields.js +170 -0
  554. package/dist/data/runtime/RuntimeBar.fields.js.map +1 -0
  555. package/dist/data/runtime/RuntimeBar.js +70 -87
  556. package/dist/data/runtime/RuntimeBar.js.map +1 -1
  557. package/dist/data/runtime/RuntimeBar.selection.cjs +56 -0
  558. package/dist/data/runtime/RuntimeBar.selection.cjs.map +1 -0
  559. package/dist/data/runtime/RuntimeBar.selection.d.ts +20 -0
  560. package/dist/data/runtime/RuntimeBar.selection.d.ts.map +1 -0
  561. package/dist/data/runtime/RuntimeBar.selection.js +56 -0
  562. package/dist/data/runtime/RuntimeBar.selection.js.map +1 -0
  563. package/dist/data/runtime/RuntimeBarActions.cjs +10 -6
  564. package/dist/data/runtime/RuntimeBarActions.cjs.map +1 -1
  565. package/dist/data/runtime/RuntimeBarActions.d.ts +8 -1
  566. package/dist/data/runtime/RuntimeBarActions.d.ts.map +1 -1
  567. package/dist/data/runtime/RuntimeBarActions.js +10 -6
  568. package/dist/data/runtime/RuntimeBarActions.js.map +1 -1
  569. package/dist/data/runtime/RuntimeBarIdentity.cjs +166 -0
  570. package/dist/data/runtime/RuntimeBarIdentity.cjs.map +1 -0
  571. package/dist/data/runtime/RuntimeBarIdentity.d.ts +25 -0
  572. package/dist/data/runtime/RuntimeBarIdentity.d.ts.map +1 -0
  573. package/dist/data/runtime/RuntimeBarIdentity.js +166 -0
  574. package/dist/data/runtime/RuntimeBarIdentity.js.map +1 -0
  575. package/dist/data/runtime/RuntimeBarLayout.cjs +95 -0
  576. package/dist/data/runtime/RuntimeBarLayout.cjs.map +1 -0
  577. package/dist/data/runtime/RuntimeBarLayout.d.ts +9 -0
  578. package/dist/data/runtime/RuntimeBarLayout.d.ts.map +1 -0
  579. package/dist/data/runtime/RuntimeBarLayout.js +95 -0
  580. package/dist/data/runtime/RuntimeBarLayout.js.map +1 -0
  581. package/dist/data/runtime/RuntimeBarSegment.cjs +25 -14
  582. package/dist/data/runtime/RuntimeBarSegment.cjs.map +1 -1
  583. package/dist/data/runtime/RuntimeBarSegment.d.ts +4 -0
  584. package/dist/data/runtime/RuntimeBarSegment.d.ts.map +1 -1
  585. package/dist/data/runtime/RuntimeBarSegment.js +25 -14
  586. package/dist/data/runtime/RuntimeBarSegment.js.map +1 -1
  587. package/dist/data/runtime/RuntimeLimitInput.cjs +41 -0
  588. package/dist/data/runtime/RuntimeLimitInput.cjs.map +1 -0
  589. package/dist/data/runtime/RuntimeLimitInput.d.ts +9 -0
  590. package/dist/data/runtime/RuntimeLimitInput.d.ts.map +1 -0
  591. package/dist/data/runtime/RuntimeLimitInput.js +41 -0
  592. package/dist/data/runtime/RuntimeLimitInput.js.map +1 -0
  593. package/dist/data/runtime/use-runtime-bar-overflow.cjs +70 -0
  594. package/dist/data/runtime/use-runtime-bar-overflow.cjs.map +1 -0
  595. package/dist/data/runtime/use-runtime-bar-overflow.d.ts +13 -0
  596. package/dist/data/runtime/use-runtime-bar-overflow.d.ts.map +1 -0
  597. package/dist/data/runtime/use-runtime-bar-overflow.js +70 -0
  598. package/dist/data/runtime/use-runtime-bar-overflow.js.map +1 -0
  599. package/dist/data/use-edge-focus.cjs +20 -0
  600. package/dist/data/use-edge-focus.cjs.map +1 -0
  601. package/dist/data/use-edge-focus.d.ts +23 -0
  602. package/dist/data/use-edge-focus.d.ts.map +1 -0
  603. package/dist/data/use-edge-focus.js +20 -0
  604. package/dist/data/use-edge-focus.js.map +1 -0
  605. package/dist/data/use-pan-zoom.cjs +159 -0
  606. package/dist/data/use-pan-zoom.cjs.map +1 -0
  607. package/dist/data/use-pan-zoom.d.ts +79 -0
  608. package/dist/data/use-pan-zoom.d.ts.map +1 -0
  609. package/dist/data/use-pan-zoom.js +159 -0
  610. package/dist/data/use-pan-zoom.js.map +1 -0
  611. package/dist/data/version-info.cjs +3 -3
  612. package/dist/data/version-info.js +3 -3
  613. package/dist/data.cjs +5 -1
  614. package/dist/data.cjs.map +1 -1
  615. package/dist/data.d.ts +4 -3
  616. package/dist/data.d.ts.map +1 -1
  617. package/dist/data.js +6 -2
  618. package/dist/data.js.map +1 -1
  619. package/dist/devtools/useDebugStream.cjs +5 -1
  620. package/dist/devtools/useDebugStream.cjs.map +1 -1
  621. package/dist/devtools/useDebugStream.d.ts.map +1 -1
  622. package/dist/devtools/useDebugStream.js +6 -2
  623. package/dist/devtools/useDebugStream.js.map +1 -1
  624. package/dist/hooks/event-source-provider.cjs +9 -0
  625. package/dist/hooks/event-source-provider.cjs.map +1 -0
  626. package/dist/hooks/event-source-provider.d.ts +15 -0
  627. package/dist/hooks/event-source-provider.d.ts.map +1 -0
  628. package/dist/hooks/event-source-provider.js +9 -0
  629. package/dist/hooks/event-source-provider.js.map +1 -0
  630. package/dist/hooks/event-source.cjs +11 -0
  631. package/dist/hooks/event-source.cjs.map +1 -0
  632. package/dist/hooks/event-source.d.ts +22 -0
  633. package/dist/hooks/event-source.d.ts.map +1 -0
  634. package/dist/hooks/event-source.js +11 -0
  635. package/dist/hooks/event-source.js.map +1 -0
  636. package/dist/hooks/use-log-tail.cjs +5 -1
  637. package/dist/hooks/use-log-tail.cjs.map +1 -1
  638. package/dist/hooks/use-log-tail.d.ts.map +1 -1
  639. package/dist/hooks/use-log-tail.js +5 -1
  640. package/dist/hooks/use-log-tail.js.map +1 -1
  641. package/dist/hooks/use-prompts.cjs +5 -1
  642. package/dist/hooks/use-prompts.cjs.map +1 -1
  643. package/dist/hooks/use-prompts.d.ts.map +1 -1
  644. package/dist/hooks/use-prompts.js +6 -2
  645. package/dist/hooks/use-prompts.js.map +1 -1
  646. package/dist/hooks/use-task-run.cjs +9 -2
  647. package/dist/hooks/use-task-run.cjs.map +1 -1
  648. package/dist/hooks/use-task-run.d.ts.map +1 -1
  649. package/dist/hooks/use-task-run.js +10 -3
  650. package/dist/hooks/use-task-run.js.map +1 -1
  651. package/dist/hooks.cjs +4 -0
  652. package/dist/hooks.cjs.map +1 -1
  653. package/dist/hooks.d.ts +2 -0
  654. package/dist/hooks.d.ts.map +1 -1
  655. package/dist/hooks.js +4 -0
  656. package/dist/hooks.js.map +1 -1
  657. package/dist/icons/programmingCatalog.cjs +34 -34
  658. package/dist/icons/programmingCatalog.cjs.map +1 -1
  659. package/dist/icons/programmingCatalog.js +34 -34
  660. package/dist/icons/programmingCatalog.js.map +1 -1
  661. package/dist/index.cjs +14 -3
  662. package/dist/index.cjs.map +1 -1
  663. package/dist/index.js +14 -3
  664. package/dist/index.js.map +1 -1
  665. package/dist/monaco/MonacoEditor.cjs +4 -1
  666. package/dist/monaco/MonacoEditor.cjs.map +1 -1
  667. package/dist/monaco/MonacoEditor.d.ts +1 -1
  668. package/dist/monaco/MonacoEditor.d.ts.map +1 -1
  669. package/dist/monaco/MonacoEditor.js +4 -1
  670. package/dist/monaco/MonacoEditor.js.map +1 -1
  671. package/dist/monaco/types.d.ts +2 -1
  672. package/dist/monaco/types.d.ts.map +1 -1
  673. package/dist/overlay/CommandPalette.cjs +14 -4
  674. package/dist/overlay/CommandPalette.cjs.map +1 -1
  675. package/dist/overlay/CommandPalette.d.ts +5 -1
  676. package/dist/overlay/CommandPalette.d.ts.map +1 -1
  677. package/dist/overlay/CommandPalette.js +14 -4
  678. package/dist/overlay/CommandPalette.js.map +1 -1
  679. package/dist/overlay/CommandPaletteList.cjs +5 -0
  680. package/dist/overlay/CommandPaletteList.cjs.map +1 -1
  681. package/dist/overlay/CommandPaletteList.d.ts +4 -2
  682. package/dist/overlay/CommandPaletteList.d.ts.map +1 -1
  683. package/dist/overlay/CommandPaletteList.js +5 -0
  684. package/dist/overlay/CommandPaletteList.js.map +1 -1
  685. package/dist/overlay/DropdownMenu.cjs +2 -0
  686. package/dist/overlay/DropdownMenu.cjs.map +1 -1
  687. package/dist/overlay/DropdownMenu.d.ts +4 -0
  688. package/dist/overlay/DropdownMenu.d.ts.map +1 -1
  689. package/dist/overlay/DropdownMenu.js +2 -0
  690. package/dist/overlay/DropdownMenu.js.map +1 -1
  691. package/dist/overlay/DropdownMenuSubmenu.cjs +31 -15
  692. package/dist/overlay/DropdownMenuSubmenu.cjs.map +1 -1
  693. package/dist/overlay/DropdownMenuSubmenu.d.ts.map +1 -1
  694. package/dist/overlay/DropdownMenuSubmenu.js +31 -15
  695. package/dist/overlay/DropdownMenuSubmenu.js.map +1 -1
  696. package/dist/rpc/OperationCatalog.cjs +32 -27
  697. package/dist/rpc/OperationCatalog.cjs.map +1 -1
  698. package/dist/rpc/OperationCatalog.d.ts +11 -1
  699. package/dist/rpc/OperationCatalog.d.ts.map +1 -1
  700. package/dist/rpc/OperationCatalog.js +32 -27
  701. package/dist/rpc/OperationCatalog.js.map +1 -1
  702. package/dist/rpc/OperationEntityContextPicker.cjs +62 -256
  703. package/dist/rpc/OperationEntityContextPicker.cjs.map +1 -1
  704. package/dist/rpc/OperationEntityContextPicker.d.ts.map +1 -1
  705. package/dist/rpc/OperationEntityContextPicker.js +64 -258
  706. package/dist/rpc/OperationEntityContextPicker.js.map +1 -1
  707. package/dist/rpc/OperationEntityPicker.cjs +185 -0
  708. package/dist/rpc/OperationEntityPicker.cjs.map +1 -0
  709. package/dist/rpc/OperationEntityPicker.d.ts +51 -0
  710. package/dist/rpc/OperationEntityPicker.d.ts.map +1 -0
  711. package/dist/rpc/OperationEntityPicker.js +185 -0
  712. package/dist/rpc/OperationEntityPicker.js.map +1 -0
  713. package/dist/rpc/OperationEntityPicker.model.cjs +39 -0
  714. package/dist/rpc/OperationEntityPicker.model.cjs.map +1 -0
  715. package/dist/rpc/OperationEntityPicker.model.d.ts +27 -0
  716. package/dist/rpc/OperationEntityPicker.model.d.ts.map +1 -0
  717. package/dist/rpc/OperationEntityPicker.model.js +39 -0
  718. package/dist/rpc/OperationEntityPicker.model.js.map +1 -0
  719. package/dist/rpc/operationCatalogRowSelection.cjs +85 -0
  720. package/dist/rpc/operationCatalogRowSelection.cjs.map +1 -0
  721. package/dist/rpc/operationCatalogRowSelection.d.ts +57 -0
  722. package/dist/rpc/operationCatalogRowSelection.d.ts.map +1 -0
  723. package/dist/rpc/operationCatalogRowSelection.js +85 -0
  724. package/dist/rpc/operationCatalogRowSelection.js.map +1 -0
  725. package/dist/rpc/operationEntityPicker.fixtures.d.ts +13 -0
  726. package/dist/rpc/operationEntityPicker.fixtures.d.ts.map +1 -0
  727. package/dist/rpc/useOperationPages.cjs +6 -1
  728. package/dist/rpc/useOperationPages.cjs.map +1 -1
  729. package/dist/rpc/useOperationPages.d.ts +3 -1
  730. package/dist/rpc/useOperationPages.d.ts.map +1 -1
  731. package/dist/rpc/useOperationPages.js +6 -1
  732. package/dist/rpc/useOperationPages.js.map +1 -1
  733. package/dist/rpc.cjs +2 -0
  734. package/dist/rpc.cjs.map +1 -1
  735. package/dist/rpc.d.ts +2 -0
  736. package/dist/rpc.d.ts.map +1 -1
  737. package/dist/rpc.js +2 -0
  738. package/dist/rpc.js.map +1 -1
  739. package/dist/styles.css +1 -1
  740. package/package.json +4 -1
  741. package/schemas/json-schema-form.schema.json +571 -0
  742. package/dist/data/runtime/RuntimeBarCombo.cjs +0 -423
  743. package/dist/data/runtime/RuntimeBarCombo.cjs.map +0 -1
  744. package/dist/data/runtime/RuntimeBarCombo.d.ts +0 -33
  745. package/dist/data/runtime/RuntimeBarCombo.d.ts.map +0 -1
  746. package/dist/data/runtime/RuntimeBarCombo.js +0 -423
  747. package/dist/data/runtime/RuntimeBarCombo.js.map +0 -1
  748. package/dist/data/runtime/RuntimeBarLimits.cjs +0 -262
  749. package/dist/data/runtime/RuntimeBarLimits.cjs.map +0 -1
  750. package/dist/data/runtime/RuntimeBarLimits.d.ts +0 -17
  751. package/dist/data/runtime/RuntimeBarLimits.d.ts.map +0 -1
  752. package/dist/data/runtime/RuntimeBarLimits.js +0 -262
  753. package/dist/data/runtime/RuntimeBarLimits.js.map +0 -1
  754. package/dist/data/runtime/RuntimeBarSegments.cjs +0 -346
  755. package/dist/data/runtime/RuntimeBarSegments.cjs.map +0 -1
  756. package/dist/data/runtime/RuntimeBarSegments.d.ts +0 -37
  757. package/dist/data/runtime/RuntimeBarSegments.d.ts.map +0 -1
  758. package/dist/data/runtime/RuntimeBarSegments.js +0 -346
  759. package/dist/data/runtime/RuntimeBarSegments.js.map +0 -1
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const agentActionIcons = require("../agent-action-icons.cjs");
4
- const SpecRuntimeEditor_sandboxModel = require("../SpecRuntimeEditor.sandbox-model.cjs");
5
4
  const UiPauseCircle = require("../../../icons/components/UiPauseCircle.cjs");
6
5
  const UiShieldSlash = require("../../../icons/components/UiShieldSlash.cjs");
7
6
  const UiPencilSimpleLine = require("../../../icons/components/UiPencilSimpleLine.cjs");
@@ -9,6 +8,7 @@ const UiHandPalm = require("../../../icons/components/UiHandPalm.cjs");
9
8
  const UiLockOpen = require("../../../icons/components/UiLockOpen.cjs");
10
9
  const UiRobotAi = require("../../../icons/components/UiRobotAi.cjs");
11
10
  const UiLock = require("../../../icons/components/UiLock.cjs");
11
+ const SpecRuntimeEditor_sandboxModel = require("../SpecRuntimeEditor.sandbox-model.cjs");
12
12
  const CODEX_PERMISSION_MODES = {
13
13
  default: { icon: UiLock.UiLock, tone: "slate", label: "Read only" },
14
14
  acceptEdits: {
@@ -1,5 +1,4 @@
1
1
  import { PERMISSION_MODE_ICONS } from "../agent-action-icons.js";
2
- import { SPEC_PERMISSION_MODES } from "../SpecRuntimeEditor.sandbox-model.js";
3
2
  import { UiPauseCircle } from "../../../icons/components/UiPauseCircle.js";
4
3
  import { UiShieldSlash } from "../../../icons/components/UiShieldSlash.js";
5
4
  import { UiPencilSimpleLine } from "../../../icons/components/UiPencilSimpleLine.js";
@@ -7,6 +6,7 @@ import { UiHandPalm } from "../../../icons/components/UiHandPalm.js";
7
6
  import { UiLockOpen } from "../../../icons/components/UiLockOpen.js";
8
7
  import { UiRobotAi } from "../../../icons/components/UiRobotAi.js";
9
8
  import { UiLock } from "../../../icons/components/UiLock.js";
9
+ import { SPEC_PERMISSION_MODES } from "../SpecRuntimeEditor.sandbox-model.js";
10
10
  const CODEX_PERMISSION_MODES = {
11
11
  default: { icon: UiLock, tone: "slate", label: "Read only" },
12
12
  acceptEdits: {
@@ -1 +1 @@
1
- {"version":3,"file":"summaries.cjs","sources":["../../../../src/data/ai/SpecRuntimeEditor/summaries.ts"],"sourcesContent":["import type { ChatModel } from \"../../chat/types\";\nimport type { AISpecRuntimeValue } from \"../SpecRuntimeEditor.model\";\nimport { UNSPECIFIED_LABEL } from \"../../runtime/unspecified\";\nimport { checkoutMode, commitPhase, worktreeMode } from \"./update\";\nimport { isDenyMode, type PermissionListEntry } from \"./permissions-model\";\n\nexport function summarizeModel(\n value: AISpecRuntimeValue,\n models: ChatModel[] = [],\n): string {\n const parts: string[] = [];\n const model = value.model?.trim();\n if (model) {\n parts.push(models.find((m) => m.id === model)?.label ?? model);\n }\n if (value.effort) parts.push(value.effort);\n return parts.length > 0 ? parts.join(\" · \") : UNSPECIFIED_LABEL;\n}\n\nexport function summarizePrompt(value: AISpecRuntimeValue): string {\n const overrides = [\n value.prompt?.user,\n value.prompt?.system,\n value.prompt?.appendSystem,\n ].filter((text) => Boolean(text?.trim())).length;\n if (overrides === 0) return \"Base prompt only\";\n return `${overrides} override${overrides > 1 ? \"s\" : \"\"} set`;\n}\n\nexport function summarizeWorkspace(value: AISpecRuntimeValue): string {\n const mode = checkoutMode(value);\n if (mode === \"none\") return \"No checkout\";\n const parts: string[] = [mode];\n const ref = value.setup?.checkout?.ref?.trim();\n if (ref) parts.push(ref);\n const worktree = worktreeMode(value);\n parts.push(worktree === \"none\" ? \"in-place\" : `${worktree} worktree`);\n return parts.join(\" · \");\n}\n\nexport function summarizePermissions(\n _value: AISpecRuntimeValue,\n entries: PermissionListEntry[],\n): string {\n const parts: string[] = [];\n const denied = entries.filter(\n (entry) => entry.domain === \"tools\" && entry.mode === \"deny\",\n ).length;\n const off = entries.filter(\n (entry) => entry.domain !== \"tools\" && isDenyMode(entry.mode),\n ).length;\n if (denied > 0) parts.push(`${denied} denied`);\n if (off > 0) parts.push(`${off} off`);\n return parts.length > 0 ? parts.join(\" · \") : \"No overrides\";\n}\n\nexport function summarizeEnvironment(value: AISpecRuntimeValue): string {\n const vars = (value.setup?.envVars ?? []).filter((item) =>\n Boolean(item.name?.trim()),\n );\n if (vars.length === 0) return \"No variables\";\n const secrets = vars.filter((item) => {\n if (typeof item.valueFrom === \"string\") {\n return item.valueFrom.trim().startsWith(\"secret://\");\n }\n return Boolean(item.valueFrom?.secretKeyRef);\n }).length;\n const parts = [`${vars.length} var${vars.length !== 1 ? \"s\" : \"\"}`];\n if (secrets > 0) parts.push(`${secrets} secret`);\n return parts.join(\" · \");\n}\n\nexport function summarizeVerify(value: AISpecRuntimeValue): string {\n const verify = value.workflow?.verify;\n if (!verify) return \"No fixture\";\n const parts: string[] = [];\n if (verify.fixture?.trim()) parts.push(\"Fixture\");\n if (verify.scope === \"changed\") parts.push(\"changed files\");\n if (verify.maxIterations != null && verify.maxIterations > 0) {\n parts.push(\n `${verify.maxIterations} iteration${verify.maxIterations !== 1 ? \"s\" : \"\"}`,\n );\n }\n if (verify.commands?.length) {\n parts.push(`${verify.commands.length} command${verify.commands.length !== 1 ? \"s\" : \"\"}`);\n }\n if (verify.prompts?.length) {\n parts.push(`${verify.prompts.length} prompt${verify.prompts.length !== 1 ? \"s\" : \"\"}`);\n }\n return parts.length > 0 ? parts.join(\" · \") : \"No fixture\";\n}\n\nconst COMMIT_PHASE_SUMMARIES = {\n none: \"Leave uncommitted\",\n turn: \"Commit every turn\",\n agent: \"Commit after the loop\",\n run: \"Commit changes\",\n} as const;\n\nexport function summarizeCommit(value: AISpecRuntimeValue): string {\n const phase = commitPhase(value);\n const summary = COMMIT_PHASE_SUMMARIES[phase];\n return value.workflow?.commits?.[0]?.dryRun\n ? `${summary} · dry run`\n : summary;\n}\n\nexport function summarizeCLIArgs(value: AISpecRuntimeValue): string {\n const flags = Object.entries(value.cliArgs ?? {}).filter(\n ([, item]) =>\n item !== undefined &&\n item !== \"\" &&\n item !== false &&\n (!Array.isArray(item) || item.length > 0),\n ).length;\n if (flags === 0) return \"Defaults\";\n return `${flags} flag${flags !== 1 ? \"s\" : \"\"} set`;\n}\n\n// The rail target chip: repo (from checkout URL or local path) plus ref.\nexport function summarizeTarget(value: AISpecRuntimeValue): string | undefined {\n const checkout = value.setup?.checkout;\n const source = checkout?.url?.trim() || checkout?.path?.trim();\n if (!source) return undefined;\n // Split-and-filter instead of `.replace(/\\/+$/, \"\")`: the trailing-slash\n // strip was a polynomial (ReDoS) match on many-`/` inputs. Empty segments\n // from trailing/duplicate slashes are dropped, so the last one is the repo.\n const segments = source.split(\"/\").filter(Boolean);\n const repo = segments[segments.length - 1]?.replace(/\\.git$/, \"\");\n if (!repo) return undefined;\n const ref = checkout?.ref?.trim();\n return ref ? `${repo} · ${ref}` : repo;\n}\n"],"names":[],"mappings":";;AAwHO,SAAS,gBAAgB,OAA+C;;AAC7E,QAAM,YAAW,WAAM,UAAN,mBAAa;AAC9B,QAAM,WAAS,0CAAU,QAAV,mBAAe,aAAU,0CAAU,SAAV,mBAAgB;AACxD,MAAI,CAAC,OAAQ,QAAO;AAIpB,QAAM,WAAW,OAAO,MAAM,GAAG,EAAE,OAAO,OAAO;AACjD,QAAM,QAAO,cAAS,SAAS,SAAS,CAAC,MAA5B,mBAA+B,QAAQ,UAAU;AAC9D,MAAI,CAAC,KAAM,QAAO;AAClB,QAAM,OAAM,0CAAU,QAAV,mBAAe;AAC3B,SAAO,MAAM,GAAG,IAAI,MAAM,GAAG,KAAK;AACpC;;"}
1
+ {"version":3,"file":"summaries.cjs","sources":["../../../../src/data/ai/SpecRuntimeEditor/summaries.ts"],"sourcesContent":["import type { ChatModel } from \"../../chat/types\";\nimport type {\n AISpecRuntimeCommit,\n AISpecRuntimeValue,\n} from \"../SpecRuntimeEditor.model\";\nimport { UNSPECIFIED_LABEL } from \"../../runtime/unspecified\";\nimport {\n checkoutMode,\n commitPhase,\n commitPhaseFromEntry,\n worktreeMode,\n} from \"./update\";\nimport { isDenyMode, type PermissionListEntry } from \"./permissions-model\";\n\nexport function summarizeModel(\n value: AISpecRuntimeValue,\n models: ChatModel[] = [],\n): string {\n const parts: string[] = [];\n const model = value.model?.trim();\n if (model) {\n parts.push(models.find((m) => m.id === model)?.label ?? model);\n }\n if (value.effort) parts.push(value.effort);\n return parts.length > 0 ? parts.join(\" · \") : UNSPECIFIED_LABEL;\n}\n\nexport function summarizePrompt(value: AISpecRuntimeValue): string {\n const overrides = [\n value.prompt?.user,\n value.prompt?.system,\n value.prompt?.appendSystem,\n ].filter((text) => Boolean(text?.trim())).length;\n if (overrides === 0) return \"Base prompt only\";\n return `${overrides} override${overrides > 1 ? \"s\" : \"\"} set`;\n}\n\nexport function summarizeWorkspace(value: AISpecRuntimeValue): string {\n const mode = checkoutMode(value);\n if (mode === \"none\") return \"No checkout\";\n const parts: string[] = [mode];\n const ref = value.setup?.checkout?.ref?.trim();\n if (ref) parts.push(ref);\n const worktree = worktreeMode(value);\n parts.push(worktree === \"none\" ? \"in-place\" : `${worktree} worktree`);\n return parts.join(\" · \");\n}\n\nexport function summarizePermissions(\n _value: AISpecRuntimeValue,\n entries: PermissionListEntry[],\n): string {\n const parts: string[] = [];\n const denied = entries.filter(\n (entry) => entry.domain === \"tools\" && entry.mode === \"deny\",\n ).length;\n const off = entries.filter(\n (entry) => entry.domain !== \"tools\" && isDenyMode(entry.mode),\n ).length;\n if (denied > 0) parts.push(`${denied} denied`);\n if (off > 0) parts.push(`${off} off`);\n return parts.length > 0 ? parts.join(\" · \") : \"No overrides\";\n}\n\nexport function summarizeEnvironment(value: AISpecRuntimeValue): string {\n const vars = (value.setup?.envVars ?? []).filter((item) =>\n Boolean(item.name?.trim()),\n );\n if (vars.length === 0) return \"No variables\";\n const secrets = vars.filter((item) => {\n if (typeof item.valueFrom === \"string\") {\n return item.valueFrom.trim().startsWith(\"secret://\");\n }\n return Boolean(item.valueFrom?.secretKeyRef);\n }).length;\n const parts = [`${vars.length} var${vars.length !== 1 ? \"s\" : \"\"}`];\n if (secrets > 0) parts.push(`${secrets} secret`);\n return parts.join(\" · \");\n}\n\nexport function summarizeVerify(value: AISpecRuntimeValue): string {\n const verify = value.workflow?.verify;\n if (!verify) return \"No fixture\";\n const parts: string[] = [];\n if (verify.fixture?.trim()) parts.push(\"Fixture\");\n if (verify.scope === \"changed\") parts.push(\"changed files\");\n if (verify.maxIterations != null && verify.maxIterations > 0) {\n parts.push(\n `${verify.maxIterations} iteration${verify.maxIterations !== 1 ? \"s\" : \"\"}`,\n );\n }\n if (verify.commands?.length) {\n parts.push(`${verify.commands.length} command${verify.commands.length !== 1 ? \"s\" : \"\"}`);\n }\n if (verify.prompts?.length) {\n parts.push(`${verify.prompts.length} prompt${verify.prompts.length !== 1 ? \"s\" : \"\"}`);\n }\n return parts.length > 0 ? parts.join(\" · \") : \"No fixture\";\n}\n\nconst COMMIT_PHASE_SUMMARIES = {\n none: \"Leave uncommitted\",\n turn: \"Commit every turn\",\n agent: \"Commit after the loop\",\n run: \"Commit changes\",\n} as const;\n\n// Matches the CommitSection phase select's own option labels, since this is\n// the vocabulary the section reads back to the operator as \"what's selected\"\n// rather than the free-standing summary line's own copy.\nconst COMMIT_PHASE_SELECT_LABELS = {\n turn: \"Every turn\",\n agent: \"After the loop\",\n run: \"End of run\",\n} as const;\n\n/**\n * Reads back the effective commit intent: the operator's own policy, or —\n * only while `workflow.commits` is entirely unset and `inheritedCommits` is\n * non-empty — the inherited stanza from a lower spec layer, clearly marked so\n * it never reads as \"the operator chose this\".\n */\nexport function summarizeCommit(\n value: AISpecRuntimeValue,\n inheritedCommits?: AISpecRuntimeCommit[] | undefined,\n): string {\n const operatorSet = value.workflow?.commits !== undefined;\n const inherited = operatorSet ? undefined : inheritedCommits?.[0];\n if (inherited) {\n const parts = [\n COMMIT_PHASE_SELECT_LABELS[commitPhaseFromEntry(inherited)],\n \"inherited\",\n ];\n if (inherited.stage) parts.push(inherited.stage);\n if (inherited.gates) parts.push(`${inherited.gates} gates`);\n return parts.join(\" · \");\n }\n const phase = commitPhase(value);\n const summary = COMMIT_PHASE_SUMMARIES[phase];\n return value.workflow?.commits?.[0]?.dryRun\n ? `${summary} · dry run`\n : summary;\n}\n\nexport function summarizeCLIArgs(value: AISpecRuntimeValue): string {\n const flags = Object.entries(value.cliArgs ?? {}).filter(\n ([, item]) =>\n item !== undefined &&\n item !== \"\" &&\n item !== false &&\n (!Array.isArray(item) || item.length > 0),\n ).length;\n if (flags === 0) return \"Defaults\";\n return `${flags} flag${flags !== 1 ? \"s\" : \"\"} set`;\n}\n\n// The rail target chip: repo (from checkout URL or local path) plus ref.\nexport function summarizeTarget(value: AISpecRuntimeValue): string | undefined {\n const checkout = value.setup?.checkout;\n const source = checkout?.url?.trim() || checkout?.path?.trim();\n if (!source) return undefined;\n // Split-and-filter instead of `.replace(/\\/+$/, \"\")`: the trailing-slash\n // strip was a polynomial (ReDoS) match on many-`/` inputs. Empty segments\n // from trailing/duplicate slashes are dropped, so the last one is the repo.\n const segments = source.split(\"/\").filter(Boolean);\n const repo = segments[segments.length - 1]?.replace(/\\.git$/, \"\");\n if (!repo) return undefined;\n const ref = checkout?.ref?.trim();\n return ref ? `${repo} · ${ref}` : repo;\n}\n"],"names":[],"mappings":";;AA6JO,SAAS,gBAAgB,OAA+C;;AAC7E,QAAM,YAAW,WAAM,UAAN,mBAAa;AAC9B,QAAM,WAAS,0CAAU,QAAV,mBAAe,aAAU,0CAAU,SAAV,mBAAgB;AACxD,MAAI,CAAC,OAAQ,QAAO;AAIpB,QAAM,WAAW,OAAO,MAAM,GAAG,EAAE,OAAO,OAAO;AACjD,QAAM,QAAO,cAAS,SAAS,SAAS,CAAC,MAA5B,mBAA+B,QAAQ,UAAU;AAC9D,MAAI,CAAC,KAAM,QAAO;AAClB,QAAM,OAAM,0CAAU,QAAV,mBAAe;AAC3B,SAAO,MAAM,GAAG,IAAI,MAAM,GAAG,KAAK;AACpC;;"}
@@ -1,5 +1,5 @@
1
1
  import { ChatModel } from '../../chat/types.js';
2
- import { AISpecRuntimeValue } from '../SpecRuntimeEditor.model.js';
2
+ import { AISpecRuntimeCommit, AISpecRuntimeValue } from '../SpecRuntimeEditor.model.js';
3
3
  import { PermissionListEntry } from './permissions-model.js';
4
4
  export declare function summarizeModel(value: AISpecRuntimeValue, models?: ChatModel[]): string;
5
5
  export declare function summarizePrompt(value: AISpecRuntimeValue): string;
@@ -7,7 +7,13 @@ export declare function summarizeWorkspace(value: AISpecRuntimeValue): string;
7
7
  export declare function summarizePermissions(_value: AISpecRuntimeValue, entries: PermissionListEntry[]): string;
8
8
  export declare function summarizeEnvironment(value: AISpecRuntimeValue): string;
9
9
  export declare function summarizeVerify(value: AISpecRuntimeValue): string;
10
- export declare function summarizeCommit(value: AISpecRuntimeValue): string;
10
+ /**
11
+ * Reads back the effective commit intent: the operator's own policy, or —
12
+ * only while `workflow.commits` is entirely unset and `inheritedCommits` is
13
+ * non-empty — the inherited stanza from a lower spec layer, clearly marked so
14
+ * it never reads as "the operator chose this".
15
+ */
16
+ export declare function summarizeCommit(value: AISpecRuntimeValue, inheritedCommits?: AISpecRuntimeCommit[] | undefined): string;
11
17
  export declare function summarizeCLIArgs(value: AISpecRuntimeValue): string;
12
18
  export declare function summarizeTarget(value: AISpecRuntimeValue): string | undefined;
13
19
  //# sourceMappingURL=summaries.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"summaries.d.ts","sourceRoot":"","sources":["../../../../src/data/ai/SpecRuntimeEditor/summaries.ts"],"names":[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CAQR;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,kBAAkB,GAAG,MAAM,CAQjE;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,kBAAkB,GAAG,MAAM,CASpE;AAED,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,kBAAkB,EAC1B,OAAO,EAAE,mBAAmB,EAAE,GAC7B,MAAM,CAWR;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,kBAAkB,GAAG,MAAM,CActE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,kBAAkB,GAAG,MAAM,CAkBjE;AAkBD;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,kBAAkB,EACzB,gBAAgB,CAAC,EAAE,mBAAmB,EAAE,GAAG,SAAS,GACnD,MAAM,CAiBR;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,kBAAkB,GAAG,MAAM,CAUlE;AAGD,wBAAgB,eAAe,CAAC,KAAK,EAAE,kBAAkB,GAAG,MAAM,GAAG,SAAS,CAY7E"}
@@ -1 +1 @@
1
- {"version":3,"file":"summaries.js","sources":["../../../../src/data/ai/SpecRuntimeEditor/summaries.ts"],"sourcesContent":["import type { ChatModel } from \"../../chat/types\";\nimport type { AISpecRuntimeValue } from \"../SpecRuntimeEditor.model\";\nimport { UNSPECIFIED_LABEL } from \"../../runtime/unspecified\";\nimport { checkoutMode, commitPhase, worktreeMode } from \"./update\";\nimport { isDenyMode, type PermissionListEntry } from \"./permissions-model\";\n\nexport function summarizeModel(\n value: AISpecRuntimeValue,\n models: ChatModel[] = [],\n): string {\n const parts: string[] = [];\n const model = value.model?.trim();\n if (model) {\n parts.push(models.find((m) => m.id === model)?.label ?? model);\n }\n if (value.effort) parts.push(value.effort);\n return parts.length > 0 ? parts.join(\" · \") : UNSPECIFIED_LABEL;\n}\n\nexport function summarizePrompt(value: AISpecRuntimeValue): string {\n const overrides = [\n value.prompt?.user,\n value.prompt?.system,\n value.prompt?.appendSystem,\n ].filter((text) => Boolean(text?.trim())).length;\n if (overrides === 0) return \"Base prompt only\";\n return `${overrides} override${overrides > 1 ? \"s\" : \"\"} set`;\n}\n\nexport function summarizeWorkspace(value: AISpecRuntimeValue): string {\n const mode = checkoutMode(value);\n if (mode === \"none\") return \"No checkout\";\n const parts: string[] = [mode];\n const ref = value.setup?.checkout?.ref?.trim();\n if (ref) parts.push(ref);\n const worktree = worktreeMode(value);\n parts.push(worktree === \"none\" ? \"in-place\" : `${worktree} worktree`);\n return parts.join(\" · \");\n}\n\nexport function summarizePermissions(\n _value: AISpecRuntimeValue,\n entries: PermissionListEntry[],\n): string {\n const parts: string[] = [];\n const denied = entries.filter(\n (entry) => entry.domain === \"tools\" && entry.mode === \"deny\",\n ).length;\n const off = entries.filter(\n (entry) => entry.domain !== \"tools\" && isDenyMode(entry.mode),\n ).length;\n if (denied > 0) parts.push(`${denied} denied`);\n if (off > 0) parts.push(`${off} off`);\n return parts.length > 0 ? parts.join(\" · \") : \"No overrides\";\n}\n\nexport function summarizeEnvironment(value: AISpecRuntimeValue): string {\n const vars = (value.setup?.envVars ?? []).filter((item) =>\n Boolean(item.name?.trim()),\n );\n if (vars.length === 0) return \"No variables\";\n const secrets = vars.filter((item) => {\n if (typeof item.valueFrom === \"string\") {\n return item.valueFrom.trim().startsWith(\"secret://\");\n }\n return Boolean(item.valueFrom?.secretKeyRef);\n }).length;\n const parts = [`${vars.length} var${vars.length !== 1 ? \"s\" : \"\"}`];\n if (secrets > 0) parts.push(`${secrets} secret`);\n return parts.join(\" · \");\n}\n\nexport function summarizeVerify(value: AISpecRuntimeValue): string {\n const verify = value.workflow?.verify;\n if (!verify) return \"No fixture\";\n const parts: string[] = [];\n if (verify.fixture?.trim()) parts.push(\"Fixture\");\n if (verify.scope === \"changed\") parts.push(\"changed files\");\n if (verify.maxIterations != null && verify.maxIterations > 0) {\n parts.push(\n `${verify.maxIterations} iteration${verify.maxIterations !== 1 ? \"s\" : \"\"}`,\n );\n }\n if (verify.commands?.length) {\n parts.push(`${verify.commands.length} command${verify.commands.length !== 1 ? \"s\" : \"\"}`);\n }\n if (verify.prompts?.length) {\n parts.push(`${verify.prompts.length} prompt${verify.prompts.length !== 1 ? \"s\" : \"\"}`);\n }\n return parts.length > 0 ? parts.join(\" · \") : \"No fixture\";\n}\n\nconst COMMIT_PHASE_SUMMARIES = {\n none: \"Leave uncommitted\",\n turn: \"Commit every turn\",\n agent: \"Commit after the loop\",\n run: \"Commit changes\",\n} as const;\n\nexport function summarizeCommit(value: AISpecRuntimeValue): string {\n const phase = commitPhase(value);\n const summary = COMMIT_PHASE_SUMMARIES[phase];\n return value.workflow?.commits?.[0]?.dryRun\n ? `${summary} · dry run`\n : summary;\n}\n\nexport function summarizeCLIArgs(value: AISpecRuntimeValue): string {\n const flags = Object.entries(value.cliArgs ?? {}).filter(\n ([, item]) =>\n item !== undefined &&\n item !== \"\" &&\n item !== false &&\n (!Array.isArray(item) || item.length > 0),\n ).length;\n if (flags === 0) return \"Defaults\";\n return `${flags} flag${flags !== 1 ? \"s\" : \"\"} set`;\n}\n\n// The rail target chip: repo (from checkout URL or local path) plus ref.\nexport function summarizeTarget(value: AISpecRuntimeValue): string | undefined {\n const checkout = value.setup?.checkout;\n const source = checkout?.url?.trim() || checkout?.path?.trim();\n if (!source) return undefined;\n // Split-and-filter instead of `.replace(/\\/+$/, \"\")`: the trailing-slash\n // strip was a polynomial (ReDoS) match on many-`/` inputs. Empty segments\n // from trailing/duplicate slashes are dropped, so the last one is the repo.\n const segments = source.split(\"/\").filter(Boolean);\n const repo = segments[segments.length - 1]?.replace(/\\.git$/, \"\");\n if (!repo) return undefined;\n const ref = checkout?.ref?.trim();\n return ref ? `${repo} · ${ref}` : repo;\n}\n"],"names":[],"mappings":"AAwHO,SAAS,gBAAgB,OAA+C;AAAxE;AACL,QAAM,YAAW,WAAM,UAAN,mBAAa;AAC9B,QAAM,WAAS,0CAAU,QAAV,mBAAe,aAAU,0CAAU,SAAV,mBAAgB;AACxD,MAAI,CAAC,OAAQ,QAAO;AAIpB,QAAM,WAAW,OAAO,MAAM,GAAG,EAAE,OAAO,OAAO;AACjD,QAAM,QAAO,cAAS,SAAS,SAAS,CAAC,MAA5B,mBAA+B,QAAQ,UAAU;AAC9D,MAAI,CAAC,KAAM,QAAO;AAClB,QAAM,OAAM,0CAAU,QAAV,mBAAe;AAC3B,SAAO,MAAM,GAAG,IAAI,MAAM,GAAG,KAAK;AACpC;"}
1
+ {"version":3,"file":"summaries.js","sources":["../../../../src/data/ai/SpecRuntimeEditor/summaries.ts"],"sourcesContent":["import type { ChatModel } from \"../../chat/types\";\nimport type {\n AISpecRuntimeCommit,\n AISpecRuntimeValue,\n} from \"../SpecRuntimeEditor.model\";\nimport { UNSPECIFIED_LABEL } from \"../../runtime/unspecified\";\nimport {\n checkoutMode,\n commitPhase,\n commitPhaseFromEntry,\n worktreeMode,\n} from \"./update\";\nimport { isDenyMode, type PermissionListEntry } from \"./permissions-model\";\n\nexport function summarizeModel(\n value: AISpecRuntimeValue,\n models: ChatModel[] = [],\n): string {\n const parts: string[] = [];\n const model = value.model?.trim();\n if (model) {\n parts.push(models.find((m) => m.id === model)?.label ?? model);\n }\n if (value.effort) parts.push(value.effort);\n return parts.length > 0 ? parts.join(\" · \") : UNSPECIFIED_LABEL;\n}\n\nexport function summarizePrompt(value: AISpecRuntimeValue): string {\n const overrides = [\n value.prompt?.user,\n value.prompt?.system,\n value.prompt?.appendSystem,\n ].filter((text) => Boolean(text?.trim())).length;\n if (overrides === 0) return \"Base prompt only\";\n return `${overrides} override${overrides > 1 ? \"s\" : \"\"} set`;\n}\n\nexport function summarizeWorkspace(value: AISpecRuntimeValue): string {\n const mode = checkoutMode(value);\n if (mode === \"none\") return \"No checkout\";\n const parts: string[] = [mode];\n const ref = value.setup?.checkout?.ref?.trim();\n if (ref) parts.push(ref);\n const worktree = worktreeMode(value);\n parts.push(worktree === \"none\" ? \"in-place\" : `${worktree} worktree`);\n return parts.join(\" · \");\n}\n\nexport function summarizePermissions(\n _value: AISpecRuntimeValue,\n entries: PermissionListEntry[],\n): string {\n const parts: string[] = [];\n const denied = entries.filter(\n (entry) => entry.domain === \"tools\" && entry.mode === \"deny\",\n ).length;\n const off = entries.filter(\n (entry) => entry.domain !== \"tools\" && isDenyMode(entry.mode),\n ).length;\n if (denied > 0) parts.push(`${denied} denied`);\n if (off > 0) parts.push(`${off} off`);\n return parts.length > 0 ? parts.join(\" · \") : \"No overrides\";\n}\n\nexport function summarizeEnvironment(value: AISpecRuntimeValue): string {\n const vars = (value.setup?.envVars ?? []).filter((item) =>\n Boolean(item.name?.trim()),\n );\n if (vars.length === 0) return \"No variables\";\n const secrets = vars.filter((item) => {\n if (typeof item.valueFrom === \"string\") {\n return item.valueFrom.trim().startsWith(\"secret://\");\n }\n return Boolean(item.valueFrom?.secretKeyRef);\n }).length;\n const parts = [`${vars.length} var${vars.length !== 1 ? \"s\" : \"\"}`];\n if (secrets > 0) parts.push(`${secrets} secret`);\n return parts.join(\" · \");\n}\n\nexport function summarizeVerify(value: AISpecRuntimeValue): string {\n const verify = value.workflow?.verify;\n if (!verify) return \"No fixture\";\n const parts: string[] = [];\n if (verify.fixture?.trim()) parts.push(\"Fixture\");\n if (verify.scope === \"changed\") parts.push(\"changed files\");\n if (verify.maxIterations != null && verify.maxIterations > 0) {\n parts.push(\n `${verify.maxIterations} iteration${verify.maxIterations !== 1 ? \"s\" : \"\"}`,\n );\n }\n if (verify.commands?.length) {\n parts.push(`${verify.commands.length} command${verify.commands.length !== 1 ? \"s\" : \"\"}`);\n }\n if (verify.prompts?.length) {\n parts.push(`${verify.prompts.length} prompt${verify.prompts.length !== 1 ? \"s\" : \"\"}`);\n }\n return parts.length > 0 ? parts.join(\" · \") : \"No fixture\";\n}\n\nconst COMMIT_PHASE_SUMMARIES = {\n none: \"Leave uncommitted\",\n turn: \"Commit every turn\",\n agent: \"Commit after the loop\",\n run: \"Commit changes\",\n} as const;\n\n// Matches the CommitSection phase select's own option labels, since this is\n// the vocabulary the section reads back to the operator as \"what's selected\"\n// rather than the free-standing summary line's own copy.\nconst COMMIT_PHASE_SELECT_LABELS = {\n turn: \"Every turn\",\n agent: \"After the loop\",\n run: \"End of run\",\n} as const;\n\n/**\n * Reads back the effective commit intent: the operator's own policy, or —\n * only while `workflow.commits` is entirely unset and `inheritedCommits` is\n * non-empty — the inherited stanza from a lower spec layer, clearly marked so\n * it never reads as \"the operator chose this\".\n */\nexport function summarizeCommit(\n value: AISpecRuntimeValue,\n inheritedCommits?: AISpecRuntimeCommit[] | undefined,\n): string {\n const operatorSet = value.workflow?.commits !== undefined;\n const inherited = operatorSet ? undefined : inheritedCommits?.[0];\n if (inherited) {\n const parts = [\n COMMIT_PHASE_SELECT_LABELS[commitPhaseFromEntry(inherited)],\n \"inherited\",\n ];\n if (inherited.stage) parts.push(inherited.stage);\n if (inherited.gates) parts.push(`${inherited.gates} gates`);\n return parts.join(\" · \");\n }\n const phase = commitPhase(value);\n const summary = COMMIT_PHASE_SUMMARIES[phase];\n return value.workflow?.commits?.[0]?.dryRun\n ? `${summary} · dry run`\n : summary;\n}\n\nexport function summarizeCLIArgs(value: AISpecRuntimeValue): string {\n const flags = Object.entries(value.cliArgs ?? {}).filter(\n ([, item]) =>\n item !== undefined &&\n item !== \"\" &&\n item !== false &&\n (!Array.isArray(item) || item.length > 0),\n ).length;\n if (flags === 0) return \"Defaults\";\n return `${flags} flag${flags !== 1 ? \"s\" : \"\"} set`;\n}\n\n// The rail target chip: repo (from checkout URL or local path) plus ref.\nexport function summarizeTarget(value: AISpecRuntimeValue): string | undefined {\n const checkout = value.setup?.checkout;\n const source = checkout?.url?.trim() || checkout?.path?.trim();\n if (!source) return undefined;\n // Split-and-filter instead of `.replace(/\\/+$/, \"\")`: the trailing-slash\n // strip was a polynomial (ReDoS) match on many-`/` inputs. Empty segments\n // from trailing/duplicate slashes are dropped, so the last one is the repo.\n const segments = source.split(\"/\").filter(Boolean);\n const repo = segments[segments.length - 1]?.replace(/\\.git$/, \"\");\n if (!repo) return undefined;\n const ref = checkout?.ref?.trim();\n return ref ? `${repo} · ${ref}` : repo;\n}\n"],"names":[],"mappings":"AA6JO,SAAS,gBAAgB,OAA+C;AAAxE;AACL,QAAM,YAAW,WAAM,UAAN,mBAAa;AAC9B,QAAM,WAAS,0CAAU,QAAV,mBAAe,aAAU,0CAAU,SAAV,mBAAgB;AACxD,MAAI,CAAC,OAAQ,QAAO;AAIpB,QAAM,WAAW,OAAO,MAAM,GAAG,EAAE,OAAO,OAAO;AACjD,QAAM,QAAO,cAAS,SAAS,SAAS,CAAC,MAA5B,mBAA+B,QAAQ,UAAU;AAC9D,MAAI,CAAC,KAAM,QAAO;AAClB,QAAM,OAAM,0CAAU,QAAV,mBAAe;AAC3B,SAAO,MAAM,GAAG,IAAI,MAAM,GAAG,KAAK;AACpC;"}
@@ -36,7 +36,9 @@ function sandboxRef(value) {
36
36
  function withSandbox(value, patch) {
37
37
  const next = { ...sandboxRef(value), ...patch };
38
38
  if (!next.mode) {
39
- throw new Error("sandbox.mode is required before configuring sandbox settings");
39
+ throw new Error(
40
+ "sandbox.mode is required before configuring sandbox settings"
41
+ );
40
42
  }
41
43
  return withRoot(value, { sandbox: next });
42
44
  }
@@ -114,12 +116,15 @@ function withCommitPhase(value, phase) {
114
116
  }
115
117
  return withCommit(value, { on: phase });
116
118
  }
119
+ function commitPhaseFromEntry(commit) {
120
+ const on = commit == null ? void 0 : commit.on;
121
+ return on === "turn" || on === "agent" ? on : "run";
122
+ }
117
123
  function commitPhase(value) {
118
- var _a, _b;
124
+ var _a;
119
125
  const commits = (_a = value.workflow) == null ? void 0 : _a.commits;
120
126
  if (!(commits == null ? void 0 : commits.length)) return "none";
121
- const on = (_b = commits[0]) == null ? void 0 : _b.on;
122
- return on === "turn" || on === "agent" ? on : "run";
127
+ return commitPhaseFromEntry(commits[0]);
123
128
  }
124
129
  function withCheckoutMode(value, mode) {
125
130
  if (mode === "none") {
@@ -137,6 +142,7 @@ function withCheckoutMode(value, mode) {
137
142
  return withCheckout(value, { mode, path: "" });
138
143
  }
139
144
  function withWorktreeMode(value, mode) {
145
+ var _a;
140
146
  if (mode === "none") {
141
147
  return withWorktree(value, {
142
148
  mode,
@@ -146,10 +152,11 @@ function withWorktreeMode(value, mode) {
146
152
  keep: false
147
153
  });
148
154
  }
155
+ const next = ((_a = value.workflow) == null ? void 0 : _a.commits) === void 0 ? withCommitPhase(value, "turn") : value;
149
156
  if (mode === "existing") {
150
- return withWorktree(value, { mode, prefix: "", base: "", keep: false });
157
+ return withWorktree(next, { mode, prefix: "", base: "", keep: false });
151
158
  }
152
- return withWorktree(value, { mode });
159
+ return withWorktree(next, { mode });
153
160
  }
154
161
  function checkoutMode(value) {
155
162
  var _a;
@@ -167,6 +174,7 @@ function worktreeMode(value) {
167
174
  }
168
175
  exports.checkoutMode = checkoutMode;
169
176
  exports.commitPhase = commitPhase;
177
+ exports.commitPhaseFromEntry = commitPhaseFromEntry;
170
178
  exports.sandboxRef = sandboxRef;
171
179
  exports.withBudgetValue = withBudgetValue;
172
180
  exports.withCheckout = withCheckout;
@@ -1 +1 @@
1
- {"version":3,"file":"update.cjs","sources":["../../../../src/data/ai/SpecRuntimeEditor/update.ts"],"sourcesContent":["import type {\n AISpecRuntimeConnections,\n AISpecRuntimeMemory,\n AISpecRuntimePermissions,\n AISpecRuntimePrompt,\n AISpecRuntimeSandbox,\n AISpecRuntimeSandboxDispatch,\n AISpecRuntimeSandboxPolicy,\n AISpecRuntimeSetup,\n AISpecRuntimeValue,\n SpecCheckoutMode,\n SpecCommitPhase,\n SpecPermissionMode,\n SpecSandboxMode,\n SpecStashMode,\n SpecWorktreeMode,\n} from \"../SpecRuntimeEditor.model\";\n\ntype SpecCheckout = NonNullable<AISpecRuntimeSetup[\"checkout\"]>;\ntype SpecWorktree = NonNullable<SpecCheckout[\"worktree\"]>;\ntype SpecDirty = NonNullable<SpecCheckout[\"dirty\"]>;\ntype SpecWorkflow = NonNullable<AISpecRuntimeValue[\"workflow\"]>;\ntype SpecCommit = NonNullable<SpecWorkflow[\"commits\"]>[number];\ntype SpecBudget = NonNullable<AISpecRuntimeValue[\"budget\"]>;\n\nexport function withRoot(\n value: AISpecRuntimeValue,\n patch: Partial<AISpecRuntimeValue>,\n): AISpecRuntimeValue {\n return { ...value, ...patch };\n}\n\n// Sets a top-level scalar, deleting the key entirely when cleared so the\n// compacted payload omits it instead of carrying an empty string/undefined.\nexport function withOptionalRoot(\n value: AISpecRuntimeValue,\n key: keyof AISpecRuntimeValue,\n next: unknown,\n): AISpecRuntimeValue {\n const updated = { ...value } as Record<string, unknown>;\n if (next === undefined || next === \"\") {\n delete updated[key];\n } else {\n updated[key] = next;\n }\n return updated as AISpecRuntimeValue;\n}\n\nexport function withPrompt(\n value: AISpecRuntimeValue,\n patch: Partial<AISpecRuntimePrompt>,\n): AISpecRuntimeValue {\n return withRoot(value, { prompt: { ...value.prompt, ...patch } });\n}\n\nexport function withBudget(\n value: AISpecRuntimeValue,\n budget: SpecBudget,\n): AISpecRuntimeValue {\n return withRoot(value, { budget });\n}\n\nexport function withBudgetValue(\n value: AISpecRuntimeValue,\n key: keyof SpecBudget,\n next: number | string | undefined,\n): AISpecRuntimeValue {\n const budget = { ...value.budget } as Record<string, unknown>;\n if (next === undefined || next === \"\") {\n delete budget[key];\n } else {\n budget[key] = next;\n }\n return withRoot(value, { budget: budget as SpecBudget });\n}\n\nexport function withMemory(\n value: AISpecRuntimeValue,\n patch: Partial<AISpecRuntimeMemory>,\n): AISpecRuntimeValue {\n return withRoot(value, { memory: { ...value.memory, ...patch } });\n}\n\nexport function withPermissions(\n value: AISpecRuntimeValue,\n patch: Partial<AISpecRuntimePermissions>,\n): AISpecRuntimeValue {\n return withRoot(value, { permissions: { ...value.permissions, ...patch } });\n}\n\n/**\n * Reads the sandbox ref in object form regardless of which form it is stored\n * in, so the section's controls do not each have to re-narrow the union.\n */\nexport function sandboxRef(value: AISpecRuntimeValue): AISpecRuntimeSandbox {\n if (typeof value.sandbox === \"string\") {\n return { mode: value.sandbox.trim() as SpecSandboxMode };\n }\n return value.sandbox ?? {};\n}\n\n/**\n * Patches the unified ref while keeping its object form during editing.\n */\nexport function withSandbox(\n value: AISpecRuntimeValue,\n patch: Partial<AISpecRuntimeSandbox>,\n): AISpecRuntimeValue {\n const next: AISpecRuntimeSandbox = { ...sandboxRef(value), ...patch };\n if (!next.mode) {\n throw new Error(\"sandbox.mode is required before configuring sandbox settings\");\n }\n return withRoot(value, { sandbox: next });\n}\n\nexport function withSandboxMode(\n value: AISpecRuntimeValue,\n mode: SpecSandboxMode,\n): AISpecRuntimeValue {\n const current = sandboxRef(value);\n if (current.mode === mode) return value;\n return withRoot(value, { sandbox: { mode } });\n}\n\nexport function withSandboxBackend(\n value: AISpecRuntimeValue,\n backend: string,\n): AISpecRuntimeValue {\n const next = { ...sandboxRef(value) };\n const selected = backend.trim();\n if (selected) next.backend = selected;\n else delete next.backend;\n return withRoot(value, { sandbox: next });\n}\n\nexport function withSandboxAgent(\n value: AISpecRuntimeValue,\n agent: string,\n): AISpecRuntimeValue {\n const next = { ...sandboxRef(value) };\n const selected = agent.trim();\n if (selected) next.agent = selected;\n else delete next.agent;\n return withRoot(value, { sandbox: next });\n}\n\n// The base posture is independent of the sandbox (see AISpecRuntimePermissions\n// doc comment), so unlike sandbox settings it deletes cleanly to Unspecified\n// without needing a mode to be configured first.\nexport function withPermissionMode(\n value: AISpecRuntimeValue,\n mode: SpecPermissionMode | undefined,\n): AISpecRuntimeValue {\n const next = { ...value.permissions } as AISpecRuntimePermissions;\n if (mode) next.mode = mode;\n else delete next.mode;\n if (Object.keys(next).length === 0) {\n const { permissions: _permissions, ...rest } = value;\n return rest as AISpecRuntimeValue;\n }\n return withRoot(value, { permissions: next });\n}\n\nexport function withSandboxPolicy(\n value: AISpecRuntimeValue,\n patch: Partial<AISpecRuntimeSandboxPolicy>,\n): AISpecRuntimeValue {\n if (sandboxRef(value).mode !== \"native\") {\n throw new Error(\"native sandbox policy requires sandbox.mode native\");\n }\n return withSandbox(value, {\n policy: { ...sandboxRef(value).policy, ...patch },\n });\n}\n\nexport function withSandboxDispatch(\n value: AISpecRuntimeValue,\n patch: Partial<AISpecRuntimeSandboxDispatch>,\n): AISpecRuntimeValue {\n if (sandboxRef(value).mode !== \"git-agent\") {\n throw new Error(\"sandbox dispatch policy requires sandbox.mode git-agent\");\n }\n return withSandbox(value, {\n dispatch: { ...sandboxRef(value).dispatch, ...patch },\n });\n}\n\nexport function withSetup(\n value: AISpecRuntimeValue,\n patch: Partial<AISpecRuntimeSetup>,\n): AISpecRuntimeValue {\n return withRoot(value, { setup: { ...value.setup, ...patch } });\n}\n\nexport function withConnections(\n value: AISpecRuntimeValue,\n patch: Partial<AISpecRuntimeConnections>,\n): AISpecRuntimeValue {\n return withSetup(value, {\n connections: { ...value.setup?.connections, ...patch },\n });\n}\n\nexport function withCheckout(\n value: AISpecRuntimeValue,\n patch: SpecCheckout,\n): AISpecRuntimeValue {\n return withSetup(value, {\n checkout: { ...value.setup?.checkout, ...patch },\n });\n}\n\nexport function withWorktree(\n value: AISpecRuntimeValue,\n patch: SpecWorktree,\n): AISpecRuntimeValue {\n return withCheckout(value, {\n worktree: { ...value.setup?.checkout?.worktree, ...patch },\n });\n}\n\nexport function withDirty(\n value: AISpecRuntimeValue,\n patch: SpecDirty,\n): AISpecRuntimeValue {\n return withCheckout(value, {\n dirty: { ...value.setup?.checkout?.dirty, ...patch },\n });\n}\n\nexport function withVerify(\n value: AISpecRuntimeValue,\n patch: NonNullable<SpecWorkflow[\"verify\"]>,\n): AISpecRuntimeValue {\n return withRoot(value, {\n workflow: {\n ...value.workflow,\n verify: { ...value.workflow?.verify, ...patch },\n },\n });\n}\n\n// The editor drives a single commit policy. A spec authored by hand may declare\n// several stanzas; the ones past the first are carried through untouched rather\n// than collapsed away by an edit to a field the editor does surface.\nexport function withCommit(\n value: AISpecRuntimeValue,\n patch: Partial<SpecCommit>,\n): AISpecRuntimeValue {\n const [first, ...rest] = value.workflow?.commits ?? [];\n return withRoot(value, {\n workflow: { ...value.workflow, commits: [{ ...first, ...patch }, ...rest] },\n });\n}\n\n// \"Never\" drops every stanza rather than flagging one off: an absent list is how\n// the spec says \"commit nothing\", and a surviving {dryRun: true} would leave the\n// section reading as configured.\nexport function withCommitPhase(\n value: AISpecRuntimeValue,\n phase: SpecCommitPhase | \"none\",\n): AISpecRuntimeValue {\n if (phase === \"none\") {\n return withRoot(value, { workflow: { ...value.workflow, commits: [] } });\n }\n return withCommit(value, { on: phase });\n}\n\n// A stanza with no explicit phase commits at the end of the run, matching\n// api.Commit.Phase()'s default.\nexport function commitPhase(\n value: AISpecRuntimeValue,\n): SpecCommitPhase | \"none\" {\n const commits = value.workflow?.commits;\n if (!commits?.length) return \"none\";\n const on = commits[0]?.on;\n return on === \"turn\" || on === \"agent\" ? on : \"run\";\n}\n\n// Mode switches clear the fields that no longer apply, so stale values from a\n// previous mode never leak into the compacted payload.\nexport function withCheckoutMode(\n value: AISpecRuntimeValue,\n mode: SpecCheckoutMode,\n): AISpecRuntimeValue {\n if (mode === \"none\") {\n return withCheckout(value, {\n mode,\n url: \"\",\n path: \"\",\n connection: \"\",\n ref: \"\",\n depth: 0,\n });\n }\n if (mode === \"local\")\n return withCheckout(value, { mode, url: \"\", connection: \"\" });\n return withCheckout(value, { mode, path: \"\" });\n}\n\nexport function withWorktreeMode(\n value: AISpecRuntimeValue,\n mode: SpecWorktreeMode,\n): AISpecRuntimeValue {\n if (mode === \"none\") {\n return withWorktree(value, {\n mode,\n prefix: \"\",\n base: \"\",\n path: \"\",\n keep: false,\n });\n }\n if (mode === \"existing\") {\n return withWorktree(value, { mode, prefix: \"\", base: \"\", keep: false });\n }\n return withWorktree(value, { mode });\n}\n\nexport function withStashMode(\n value: AISpecRuntimeValue,\n stash: SpecStashMode,\n): AISpecRuntimeValue {\n return withDirty(value, stash === \"none\" ? { stash, since: \"\" } : { stash });\n}\n\nexport function checkoutMode(value: AISpecRuntimeValue): SpecCheckoutMode {\n const checkout = value.setup?.checkout;\n if (checkout?.mode === \"remote\") return \"remote\";\n if (checkout?.mode === \"local\" || checkout?.path) return \"local\";\n return \"none\";\n}\n\nexport function worktreeMode(value: AISpecRuntimeValue): SpecWorktreeMode {\n const mode = value.setup?.checkout?.worktree?.mode;\n if (mode === \"existing\") return \"existing\";\n if (mode === \"new\") return \"new\";\n return \"none\";\n}\n\nexport function stashMode(value: AISpecRuntimeValue): SpecStashMode {\n const stash = value.setup?.checkout?.dirty?.stash;\n if (\n stash === \"untracked\" ||\n stash === \"unstaged\" ||\n stash === \"staged\" ||\n stash === \"all\"\n ) {\n return stash;\n }\n return \"none\";\n}\n\nexport function parseOptionalNumber(\n value: string,\n integer = false,\n): number | undefined {\n if (value.trim() === \"\") return undefined;\n const parsed = Number(value);\n if (!Number.isFinite(parsed)) return undefined;\n return integer ? Math.max(0, Math.trunc(parsed)) : parsed;\n}\n"],"names":[],"mappings":";;AAyBO,SAAS,SACd,OACA,OACoB;AACpB,SAAO,EAAE,GAAG,OAAO,GAAG,MAAA;AACxB;AAIO,SAAS,iBACd,OACA,KACA,MACoB;AACpB,QAAM,UAAU,EAAE,GAAG,MAAA;AACrB,MAAI,SAAS,UAAa,SAAS,IAAI;AACrC,WAAO,QAAQ,GAAG;AAAA,EACpB,OAAO;AACL,YAAQ,GAAG,IAAI;AAAA,EACjB;AACA,SAAO;AACT;AAEO,SAAS,WACd,OACA,OACoB;AACpB,SAAO,SAAS,OAAO,EAAE,QAAQ,EAAE,GAAG,MAAM,QAAQ,GAAG,MAAA,GAAS;AAClE;AASO,SAAS,gBACd,OACA,KACA,MACoB;AACpB,QAAM,SAAS,EAAE,GAAG,MAAM,OAAA;AAC1B,MAAI,SAAS,UAAa,SAAS,IAAI;AACrC,WAAO,OAAO,GAAG;AAAA,EACnB,OAAO;AACL,WAAO,GAAG,IAAI;AAAA,EAChB;AACA,SAAO,SAAS,OAAO,EAAE,QAA8B;AACzD;AAEO,SAAS,W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Aa,aAAb,mBAAuB,aAAvB,mBAAiC;AAC9C,MAAI,SAAS,WAAY,QAAO;AAChC,MAAI,SAAS,MAAO,QAAO;AAC3B,SAAO;AACT;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"update.cjs","sources":["../../../../src/data/ai/SpecRuntimeEditor/update.ts"],"sourcesContent":["import type {\n AISpecRuntimeConnections,\n AISpecRuntimeMemory,\n AISpecRuntimePermissions,\n AISpecRuntimePrompt,\n AISpecRuntimeSandbox,\n AISpecRuntimeSandboxDispatch,\n AISpecRuntimeSandboxPolicy,\n AISpecRuntimeSetup,\n AISpecRuntimeValue,\n SpecCheckoutMode,\n SpecCommitPhase,\n SpecPermissionMode,\n SpecSandboxMode,\n SpecStashMode,\n SpecWorktreeMode,\n} from \"../SpecRuntimeEditor.model\";\n\ntype SpecCheckout = NonNullable<AISpecRuntimeSetup[\"checkout\"]>;\ntype SpecWorktree = NonNullable<SpecCheckout[\"worktree\"]>;\ntype SpecDirty = NonNullable<SpecCheckout[\"dirty\"]>;\ntype SpecWorkflow = NonNullable<AISpecRuntimeValue[\"workflow\"]>;\ntype SpecCommit = NonNullable<SpecWorkflow[\"commits\"]>[number];\ntype SpecBudget = NonNullable<AISpecRuntimeValue[\"budget\"]>;\n\nexport function withRoot(\n value: AISpecRuntimeValue,\n patch: Partial<AISpecRuntimeValue>,\n): AISpecRuntimeValue {\n return { ...value, ...patch };\n}\n\n// Sets a top-level scalar, deleting the key entirely when cleared so the\n// compacted payload omits it instead of carrying an empty string/undefined.\nexport function withOptionalRoot(\n value: AISpecRuntimeValue,\n key: keyof AISpecRuntimeValue,\n next: unknown,\n): AISpecRuntimeValue {\n const updated = { ...value } as Record<string, unknown>;\n if (next === undefined || next === \"\") {\n delete updated[key];\n } else {\n updated[key] = next;\n }\n return updated as AISpecRuntimeValue;\n}\n\nexport function withPrompt(\n value: AISpecRuntimeValue,\n patch: Partial<AISpecRuntimePrompt>,\n): AISpecRuntimeValue {\n return withRoot(value, { prompt: { ...value.prompt, ...patch } });\n}\n\nexport function withBudget(\n value: AISpecRuntimeValue,\n budget: SpecBudget,\n): AISpecRuntimeValue {\n return withRoot(value, { budget });\n}\n\nexport function withBudgetValue(\n value: AISpecRuntimeValue,\n key: keyof SpecBudget,\n next: number | string | undefined,\n): AISpecRuntimeValue {\n const budget = { ...value.budget } as Record<string, unknown>;\n if (next === undefined || next === \"\") {\n delete budget[key];\n } else {\n budget[key] = next;\n }\n return withRoot(value, { budget: budget as SpecBudget });\n}\n\nexport function withMemory(\n value: AISpecRuntimeValue,\n patch: Partial<AISpecRuntimeMemory>,\n): AISpecRuntimeValue {\n return withRoot(value, { memory: { ...value.memory, ...patch } });\n}\n\nexport function withPermissions(\n value: AISpecRuntimeValue,\n patch: Partial<AISpecRuntimePermissions>,\n): AISpecRuntimeValue {\n return withRoot(value, { permissions: { ...value.permissions, ...patch } });\n}\n\n/**\n * Reads the sandbox ref in object form regardless of which form it is stored\n * in, so the section's controls do not each have to re-narrow the union.\n */\nexport function sandboxRef(value: AISpecRuntimeValue): AISpecRuntimeSandbox {\n if (typeof value.sandbox === \"string\") {\n return { mode: value.sandbox.trim() as SpecSandboxMode };\n }\n return value.sandbox ?? {};\n}\n\n/**\n * Patches the unified ref while keeping its object form during editing.\n */\nexport function withSandbox(\n value: AISpecRuntimeValue,\n patch: Partial<AISpecRuntimeSandbox>,\n): AISpecRuntimeValue {\n const next: AISpecRuntimeSandbox = { ...sandboxRef(value), ...patch };\n if (!next.mode) {\n throw new Error(\n \"sandbox.mode is required before configuring sandbox settings\",\n );\n }\n return withRoot(value, { sandbox: next });\n}\n\nexport function withSandboxMode(\n value: AISpecRuntimeValue,\n mode: SpecSandboxMode,\n): AISpecRuntimeValue {\n const current = sandboxRef(value);\n if (current.mode === mode) return value;\n return withRoot(value, { sandbox: { mode } });\n}\n\nexport function withSandboxBackend(\n value: AISpecRuntimeValue,\n backend: string,\n): AISpecRuntimeValue {\n const next = { ...sandboxRef(value) };\n const selected = backend.trim();\n if (selected) next.backend = selected;\n else delete next.backend;\n return withRoot(value, { sandbox: next });\n}\n\nexport function withSandboxAgent(\n value: AISpecRuntimeValue,\n agent: string,\n): AISpecRuntimeValue {\n const next = { ...sandboxRef(value) };\n const selected = agent.trim();\n if (selected) next.agent = selected;\n else delete next.agent;\n return withRoot(value, { sandbox: next });\n}\n\n// The base posture is independent of the sandbox (see AISpecRuntimePermissions\n// doc comment), so unlike sandbox settings it deletes cleanly to Unspecified\n// without needing a mode to be configured first.\nexport function withPermissionMode(\n value: AISpecRuntimeValue,\n mode: SpecPermissionMode | undefined,\n): AISpecRuntimeValue {\n const next = { ...value.permissions } as AISpecRuntimePermissions;\n if (mode) next.mode = mode;\n else delete next.mode;\n if (Object.keys(next).length === 0) {\n const { permissions: _permissions, ...rest } = value;\n return rest as AISpecRuntimeValue;\n }\n return withRoot(value, { permissions: next });\n}\n\nexport function withSandboxPolicy(\n value: AISpecRuntimeValue,\n patch: Partial<AISpecRuntimeSandboxPolicy>,\n): AISpecRuntimeValue {\n if (sandboxRef(value).mode !== \"native\") {\n throw new Error(\"native sandbox policy requires sandbox.mode native\");\n }\n return withSandbox(value, {\n policy: { ...sandboxRef(value).policy, ...patch },\n });\n}\n\nexport function withSandboxDispatch(\n value: AISpecRuntimeValue,\n patch: Partial<AISpecRuntimeSandboxDispatch>,\n): AISpecRuntimeValue {\n if (sandboxRef(value).mode !== \"git-agent\") {\n throw new Error(\"sandbox dispatch policy requires sandbox.mode git-agent\");\n }\n return withSandbox(value, {\n dispatch: { ...sandboxRef(value).dispatch, ...patch },\n });\n}\n\nexport function withSetup(\n value: AISpecRuntimeValue,\n patch: Partial<AISpecRuntimeSetup>,\n): AISpecRuntimeValue {\n return withRoot(value, { setup: { ...value.setup, ...patch } });\n}\n\nexport function withConnections(\n value: AISpecRuntimeValue,\n patch: Partial<AISpecRuntimeConnections>,\n): AISpecRuntimeValue {\n return withSetup(value, {\n connections: { ...value.setup?.connections, ...patch },\n });\n}\n\nexport function withCheckout(\n value: AISpecRuntimeValue,\n patch: SpecCheckout,\n): AISpecRuntimeValue {\n return withSetup(value, {\n checkout: { ...value.setup?.checkout, ...patch },\n });\n}\n\nexport function withWorktree(\n value: AISpecRuntimeValue,\n patch: SpecWorktree,\n): AISpecRuntimeValue {\n return withCheckout(value, {\n worktree: { ...value.setup?.checkout?.worktree, ...patch },\n });\n}\n\nexport function withDirty(\n value: AISpecRuntimeValue,\n patch: SpecDirty,\n): AISpecRuntimeValue {\n return withCheckout(value, {\n dirty: { ...value.setup?.checkout?.dirty, ...patch },\n });\n}\n\nexport function withVerify(\n value: AISpecRuntimeValue,\n patch: NonNullable<SpecWorkflow[\"verify\"]>,\n): AISpecRuntimeValue {\n return withRoot(value, {\n workflow: {\n ...value.workflow,\n verify: { ...value.workflow?.verify, ...patch },\n },\n });\n}\n\n// The editor drives a single commit policy. A spec authored by hand may declare\n// several stanzas; the ones past the first are carried through untouched rather\n// than collapsed away by an edit to a field the editor does surface.\nexport function withCommit(\n value: AISpecRuntimeValue,\n patch: Partial<SpecCommit>,\n): AISpecRuntimeValue {\n const [first, ...rest] = value.workflow?.commits ?? [];\n return withRoot(value, {\n workflow: { ...value.workflow, commits: [{ ...first, ...patch }, ...rest] },\n });\n}\n\n// \"Never\" drops every stanza rather than flagging one off: an absent list is how\n// the spec says \"commit nothing\", and a surviving {dryRun: true} would leave the\n// section reading as configured.\nexport function withCommitPhase(\n value: AISpecRuntimeValue,\n phase: SpecCommitPhase | \"none\",\n): AISpecRuntimeValue {\n if (phase === \"none\") {\n return withRoot(value, { workflow: { ...value.workflow, commits: [] } });\n }\n return withCommit(value, { on: phase });\n}\n\n// A stanza with no explicit phase commits at the end of the run, matching\n// api.Commit.Phase()'s default. Shared between a value's own first commit\n// stanza and an inherited stanza the section displays in its place.\nexport function commitPhaseFromEntry(\n commit: SpecCommit | undefined,\n): SpecCommitPhase {\n const on = commit?.on;\n return on === \"turn\" || on === \"agent\" ? on : \"run\";\n}\n\nexport function commitPhase(\n value: AISpecRuntimeValue,\n): SpecCommitPhase | \"none\" {\n const commits = value.workflow?.commits;\n if (!commits?.length) return \"none\";\n return commitPhaseFromEntry(commits[0]);\n}\n\n// Mode switches clear the fields that no longer apply, so stale values from a\n// previous mode never leak into the compacted payload.\nexport function withCheckoutMode(\n value: AISpecRuntimeValue,\n mode: SpecCheckoutMode,\n): AISpecRuntimeValue {\n if (mode === \"none\") {\n return withCheckout(value, {\n mode,\n url: \"\",\n path: \"\",\n connection: \"\",\n ref: \"\",\n depth: 0,\n });\n }\n if (mode === \"local\")\n return withCheckout(value, { mode, url: \"\", connection: \"\" });\n return withCheckout(value, { mode, path: \"\" });\n}\n\nexport function withWorktreeMode(\n value: AISpecRuntimeValue,\n mode: SpecWorktreeMode,\n): AISpecRuntimeValue {\n if (mode === \"none\") {\n return withWorktree(value, {\n mode,\n prefix: \"\",\n base: \"\",\n path: \"\",\n keep: false,\n });\n }\n const next =\n value.workflow?.commits === undefined\n ? withCommitPhase(value, \"turn\")\n : value;\n if (mode === \"existing\") {\n return withWorktree(next, { mode, prefix: \"\", base: \"\", keep: false });\n }\n return withWorktree(next, { mode });\n}\n\nexport function withStashMode(\n value: AISpecRuntimeValue,\n stash: SpecStashMode,\n): AISpecRuntimeValue {\n return withDirty(value, stash === \"none\" ? { stash, since: \"\" } : { stash });\n}\n\nexport function checkoutMode(value: AISpecRuntimeValue): SpecCheckoutMode {\n const checkout = value.setup?.checkout;\n if (checkout?.mode === \"remote\") return \"remote\";\n if (checkout?.mode === \"local\" || checkout?.path) return \"local\";\n return \"none\";\n}\n\nexport function worktreeMode(value: AISpecRuntimeValue): SpecWorktreeMode {\n const mode = value.setup?.checkout?.worktree?.mode;\n if (mode === \"existing\") return \"existing\";\n if (mode === \"new\") return \"new\";\n return \"none\";\n}\n\nexport function stashMode(value: AISpecRuntimeValue): SpecStashMode {\n const stash = value.setup?.checkout?.dirty?.stash;\n if (\n stash === \"untracked\" ||\n stash === \"unstaged\" ||\n stash === \"staged\" ||\n stash === \"all\"\n ) {\n return stash;\n }\n return \"none\";\n}\n\nexport function parseOptionalNumber(\n value: string,\n integer = false,\n): number | undefined {\n if (value.trim() === \"\") return undefined;\n const parsed = Number(value);\n if (!Number.isFinite(parsed)) return undefined;\n return integer ? Math.max(0, Math.trunc(parsed)) : parsed;\n}\n"],"names":[],"mappings":";;AAyBO,SAAS,SACd,OACA,OACoB;AACpB,SAAO,EAAE,GAAG,OAAO,GAAG,MAAA;AACxB;AAIO,SAAS,iBACd,OACA,KACA,MACoB;AACpB,QAAM,UAAU,EAAE,GAAG,MAAA;AACrB,MAAI,SAAS,UAAa,SAAS,IAAI;AACrC,WAAO,QAAQ,GAAG;AAAA,EACpB,OAAO;AACL,YAAQ,GAAG,IAAI;AAAA,EACjB;AACA,SAAO;AACT;AAEO,SAAS,WACd,OACA,OACoB;AACpB,SAAO,SAAS,OAAO,EAAE,QAAQ,EAAE,GAAG,MAAM,QAAQ,GAAG,MAAA,GAAS;AAClE;AASO,SAAS,gBACd,OACA,KACA,MACoB;AACpB,QAAM,SAAS,EAAE,GAAG,MAAM,OAAA;AAC1B,MAAI,SAAS,UAAa,SAAS,IAAI;AACrC,WAAO,OAAO,GAAG;AAAA,EACnB,OAAO;AACL,WAAO,GAAG,IAAI;AAAA,EAChB;AACA,SAAO,SAAS,OAAO,EAAE,QAA8B;AACzD;AAEO,SAAS,WACd,OACA,OACoB;AACpB,SAAO,SAAS,OAAO,EAAE,QAAQ,EAAE,GAAG,MAAM,QAAQ,GAAG,MAAA,GAAS;AAClE;AAaO,SAAS,WAAW,OAAiD;AAC1E,MAAI,OAAO,MAAM,YAAY,UAAU;AACrC,WAAO,EAAE,MAAM,MAAM,QAAQ,OAAK;AAAA,EACpC;AACA,SAAO,MAAM,WAAW,CAAA;AAC1B;AAKO,SAAS,YACd,OACA,OACoB;AACpB,QAAM,OAA6B,EAAE,GAAG,WAAW,KAAK,GAAG,GAAG,MAAA;AAC9D,MAAI,CAAC,KAAK,M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Q,CAAC,CAAC;AACxC;AAIO,SAAS,iBACd,OACA,MACoB;AACpB,MAAI,SAAS,QAAQ;AACnB,WAAO,aAAa,OAAO;AAAA,MACzB;AAAA,MACA,KAAK;AAAA,MACL,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,KAAK;AAAA,MACL,OAAO;AAAA,IAAA,CACR;AAAA,EACH;AACA,MAAI,SAAS;AACX,WAAO,aAAa,OAAO,EAAE,MAAM,KAAK,IAAI,YAAY,IAAI;AAC9D,SAAO,aAAa,OAAO,EAAE,MAAM,MAAM,IAAI;AAC/C;AAEO,SAAS,iBACd,OACA,MACoB;;AACpB,MAAI,SAAS,QAAQ;AACnB,WAAO,aAAa,OAAO;AAAA,MACzB;AAAA,MACA,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,IAAA,CACP;AAAA,EACH;AACA,QAAM,SACJ,WAAM,aAAN,mBAAgB,aAAY,SACxB,gBAAgB,OAAO,MAAM,IAC7B;AACN,MAAI,SAAS,YAAY;AACvB,WAAO,aAAa,MAAM,EAAE,MAAM,QAAQ,IAAI,MAAM,IAAI,MAAM,OAAO;AAAA,EACvE;AACA,SAAO,aAAa,MAAM,EAAE,MAAM;AACpC;AASO,SAAS,aAAa,OAA6C;;AACxE,QAAM,YAAW,WAAM,UAAN,mBAAa;AAC9B,OAAI,qCAAU,UAAS,SAAU,QAAO;AACxC,OAAI,qCAAU,UAAS,YAAW,qCAAU,MAAM,QAAO;AACzD,SAAO;AACT;AAEO,SAAS,aAAa,OAA6C;;AACxE,QAAM,QAAO,uBAAM,UAAN,mBAAa,aAAb,mBAAuB,aAAvB,mBAAiC;AAC9C,MAAI,SAAS,WAAY,QAAO;AAChC,MAAI,SAAS,MAAO,QAAO;AAC3B,SAAO;AACT;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -35,6 +35,7 @@ export declare function withDirty(value: AISpecRuntimeValue, patch: SpecDirty):
35
35
  export declare function withVerify(value: AISpecRuntimeValue, patch: NonNullable<SpecWorkflow["verify"]>): AISpecRuntimeValue;
36
36
  export declare function withCommit(value: AISpecRuntimeValue, patch: Partial<SpecCommit>): AISpecRuntimeValue;
37
37
  export declare function withCommitPhase(value: AISpecRuntimeValue, phase: SpecCommitPhase | "none"): AISpecRuntimeValue;
38
+ export declare function commitPhaseFromEntry(commit: SpecCommit | undefined): SpecCommitPhase;
38
39
  export declare function commitPhase(value: AISpecRuntimeValue): SpecCommitPhase | "none";
39
40
  export declare function withCheckoutMode(value: AISpecRuntimeValue, mode: SpecCheckoutMode): AISpecRuntimeValue;
40
41
  export declare function withWorktreeMode(value: AISpecRuntimeValue, mode: SpecWorktreeMode): AISpecRuntimeValue;
@@ -1 +1 @@
1
- {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../../src/data/ai/SpecRuntimeEditor/update.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EACnB,oBAAoB,EACpB,4BAA4B,EAC5B,0BAA0B,EAC1B,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,gBAAgB,EACjB,MAAM,4BAA4B,CAAC;AAEpC,KAAK,YAAY,GAAG,WAAW,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC,CAAC;AAChE,KAAK,YAAY,GAAG,WAAW,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC;AAC1D,KAAK,SAAS,GAAG,WAAW,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;AACpD,KAAK,YAAY,GAAG,WAAW,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC,CAAC;AAChE,KAAK,UAAU,GAAG,WAAW,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAC/D,KAAK,UAAU,GAAG,WAAW,CAAC,kBAAkB,CAAC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E,kBAAkB,EACzB,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,GACzC,kBAAkB,CAOpB;AAKD,wBAAgB,UAAU,CACxB,KAAK,EAAE,kBAAkB,EACzB,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,GACzB,kBAAkB,CAKpB;AAKD,wBAAgB,eAAe,CAC7B,KAAK,EAAE,kBAAkB,EACzB,KAAK,EAAE,eAAe,GAAG,MAAM,GAC9B,kBAAkB,CAKpB;AAKD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,UAAU,GAAG,SAAS,GAC7B,eAAe,CAGjB;AAED,wBAAgB,WAAW,CACzB,KAAK,EAAE,kBAAkB,GACxB,eAAe,GAAG,MAAM,CAI1B;AAID,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,kBAAkB,EACzB,IAAI,EAAE,gBAAgB,GACrB,kBAAkB,CAcpB;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,kBAAkB,EACzB,IAAI,EAAE,gBAAgB,GACrB,kBAAkB,CAkBpB;AAED,wBAAgB,aAAa,CAC3B,KAAK,EAAE,kBAAkB,EACzB,KAAK,EAAE,aAAa,GACnB,kBAAkB,CAEpB;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,kBAAkB,GAAG,gBAAgB,CAKxE;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,kBAAkB,GAAG,gBAAgB,CAKxE;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,kBAAkB,GAAG,aAAa,CAWlE;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,EACb,OAAO,UAAQ,GACd,MAAM,GAAG,SAAS,CAKpB"}
@@ -34,7 +34,9 @@ function sandboxRef(value) {
34
34
  function withSandbox(value, patch) {
35
35
  const next = { ...sandboxRef(value), ...patch };
36
36
  if (!next.mode) {
37
- throw new Error("sandbox.mode is required before configuring sandbox settings");
37
+ throw new Error(
38
+ "sandbox.mode is required before configuring sandbox settings"
39
+ );
38
40
  }
39
41
  return withRoot(value, { sandbox: next });
40
42
  }
@@ -112,12 +114,15 @@ function withCommitPhase(value, phase) {
112
114
  }
113
115
  return withCommit(value, { on: phase });
114
116
  }
117
+ function commitPhaseFromEntry(commit) {
118
+ const on = commit == null ? void 0 : commit.on;
119
+ return on === "turn" || on === "agent" ? on : "run";
120
+ }
115
121
  function commitPhase(value) {
116
- var _a, _b;
122
+ var _a;
117
123
  const commits = (_a = value.workflow) == null ? void 0 : _a.commits;
118
124
  if (!(commits == null ? void 0 : commits.length)) return "none";
119
- const on = (_b = commits[0]) == null ? void 0 : _b.on;
120
- return on === "turn" || on === "agent" ? on : "run";
125
+ return commitPhaseFromEntry(commits[0]);
121
126
  }
122
127
  function withCheckoutMode(value, mode) {
123
128
  if (mode === "none") {
@@ -135,6 +140,7 @@ function withCheckoutMode(value, mode) {
135
140
  return withCheckout(value, { mode, path: "" });
136
141
  }
137
142
  function withWorktreeMode(value, mode) {
143
+ var _a;
138
144
  if (mode === "none") {
139
145
  return withWorktree(value, {
140
146
  mode,
@@ -144,10 +150,11 @@ function withWorktreeMode(value, mode) {
144
150
  keep: false
145
151
  });
146
152
  }
153
+ const next = ((_a = value.workflow) == null ? void 0 : _a.commits) === void 0 ? withCommitPhase(value, "turn") : value;
147
154
  if (mode === "existing") {
148
- return withWorktree(value, { mode, prefix: "", base: "", keep: false });
155
+ return withWorktree(next, { mode, prefix: "", base: "", keep: false });
149
156
  }
150
- return withWorktree(value, { mode });
157
+ return withWorktree(next, { mode });
151
158
  }
152
159
  function checkoutMode(value) {
153
160
  var _a;
@@ -166,6 +173,7 @@ function worktreeMode(value) {
166
173
  export {
167
174
  checkoutMode,
168
175
  commitPhase,
176
+ commitPhaseFromEntry,
169
177
  sandboxRef,
170
178
  withBudgetValue,
171
179
  withCheckout,
@@ -1 +1 @@
1
- {"version":3,"file":"update.js","sources":["../../../../src/data/ai/SpecRuntimeEditor/update.ts"],"sourcesContent":["import type {\n AISpecRuntimeConnections,\n AISpecRuntimeMemory,\n AISpecRuntimePermissions,\n AISpecRuntimePrompt,\n AISpecRuntimeSandbox,\n AISpecRuntimeSandboxDispatch,\n AISpecRuntimeSandboxPolicy,\n AISpecRuntimeSetup,\n AISpecRuntimeValue,\n SpecCheckoutMode,\n SpecCommitPhase,\n SpecPermissionMode,\n SpecSandboxMode,\n SpecStashMode,\n SpecWorktreeMode,\n} from \"../SpecRuntimeEditor.model\";\n\ntype SpecCheckout = NonNullable<AISpecRuntimeSetup[\"checkout\"]>;\ntype SpecWorktree = NonNullable<SpecCheckout[\"worktree\"]>;\ntype SpecDirty = NonNullable<SpecCheckout[\"dirty\"]>;\ntype SpecWorkflow = NonNullable<AISpecRuntimeValue[\"workflow\"]>;\ntype SpecCommit = NonNullable<SpecWorkflow[\"commits\"]>[number];\ntype SpecBudget = NonNullable<AISpecRuntimeValue[\"budget\"]>;\n\nexport function withRoot(\n value: AISpecRuntimeValue,\n patch: Partial<AISpecRuntimeValue>,\n): AISpecRuntimeValue {\n return { ...value, ...patch };\n}\n\n// Sets a top-level scalar, deleting the key entirely when cleared so the\n// compacted payload omits it instead of carrying an empty string/undefined.\nexport function withOptionalRoot(\n value: AISpecRuntimeValue,\n key: keyof AISpecRuntimeValue,\n next: unknown,\n): AISpecRuntimeValue {\n const updated = { ...value } as Record<string, unknown>;\n if (next === undefined || next === \"\") {\n delete updated[key];\n } else {\n updated[key] = next;\n }\n return updated as AISpecRuntimeValue;\n}\n\nexport function withPrompt(\n value: AISpecRuntimeValue,\n patch: Partial<AISpecRuntimePrompt>,\n): AISpecRuntimeValue {\n return withRoot(value, { prompt: { ...value.prompt, ...patch } });\n}\n\nexport function withBudget(\n value: AISpecRuntimeValue,\n budget: SpecBudget,\n): AISpecRuntimeValue {\n return withRoot(value, { budget });\n}\n\nexport function withBudgetValue(\n value: AISpecRuntimeValue,\n key: keyof SpecBudget,\n next: number | string | undefined,\n): AISpecRuntimeValue {\n const budget = { ...value.budget } as Record<string, unknown>;\n if (next === undefined || next === \"\") {\n delete budget[key];\n } else {\n budget[key] = next;\n }\n return withRoot(value, { budget: budget as SpecBudget });\n}\n\nexport function withMemory(\n value: AISpecRuntimeValue,\n patch: Partial<AISpecRuntimeMemory>,\n): AISpecRuntimeValue {\n return withRoot(value, { memory: { ...value.memory, ...patch } });\n}\n\nexport function withPermissions(\n value: AISpecRuntimeValue,\n patch: Partial<AISpecRuntimePermissions>,\n): AISpecRuntimeValue {\n return withRoot(value, { permissions: { ...value.permissions, ...patch } });\n}\n\n/**\n * Reads the sandbox ref in object form regardless of which form it is stored\n * in, so the section's controls do not each have to re-narrow the union.\n */\nexport function sandboxRef(value: AISpecRuntimeValue): AISpecRuntimeSandbox {\n if (typeof value.sandbox === \"string\") {\n return { mode: value.sandbox.trim() as SpecSandboxMode };\n }\n return value.sandbox ?? {};\n}\n\n/**\n * Patches the unified ref while keeping its object form during editing.\n */\nexport function withSandbox(\n value: AISpecRuntimeValue,\n patch: Partial<AISpecRuntimeSandbox>,\n): AISpecRuntimeValue {\n const next: AISpecRuntimeSandbox = { ...sandboxRef(value), ...patch };\n if (!next.mode) {\n throw new Error(\"sandbox.mode is required before configuring sandbox settings\");\n }\n return withRoot(value, { sandbox: next });\n}\n\nexport function withSandboxMode(\n value: AISpecRuntimeValue,\n mode: SpecSandboxMode,\n): AISpecRuntimeValue {\n const current = sandboxRef(value);\n if (current.mode === mode) return value;\n return withRoot(value, { sandbox: { mode } });\n}\n\nexport function withSandboxBackend(\n value: AISpecRuntimeValue,\n backend: string,\n): AISpecRuntimeValue {\n const next = { ...sandboxRef(value) };\n const selected = backend.trim();\n if (selected) next.backend = selected;\n else delete next.backend;\n return withRoot(value, { sandbox: next });\n}\n\nexport function withSandboxAgent(\n value: AISpecRuntimeValue,\n agent: string,\n): AISpecRuntimeValue {\n const next = { ...sandboxRef(value) };\n const selected = agent.trim();\n if (selected) next.agent = selected;\n else delete next.agent;\n return withRoot(value, { sandbox: next });\n}\n\n// The base posture is independent of the sandbox (see AISpecRuntimePermissions\n// doc comment), so unlike sandbox settings it deletes cleanly to Unspecified\n// without needing a mode to be configured first.\nexport function withPermissionMode(\n value: AISpecRuntimeValue,\n mode: SpecPermissionMode | undefined,\n): AISpecRuntimeValue {\n const next = { ...value.permissions } as AISpecRuntimePermissions;\n if (mode) next.mode = mode;\n else delete next.mode;\n if (Object.keys(next).length === 0) {\n const { permissions: _permissions, ...rest } = value;\n return rest as AISpecRuntimeValue;\n }\n return withRoot(value, { permissions: next });\n}\n\nexport function withSandboxPolicy(\n value: AISpecRuntimeValue,\n patch: Partial<AISpecRuntimeSandboxPolicy>,\n): AISpecRuntimeValue {\n if (sandboxRef(value).mode !== \"native\") {\n throw new Error(\"native sandbox policy requires sandbox.mode native\");\n }\n return withSandbox(value, {\n policy: { ...sandboxRef(value).policy, ...patch },\n });\n}\n\nexport function withSandboxDispatch(\n value: AISpecRuntimeValue,\n patch: Partial<AISpecRuntimeSandboxDispatch>,\n): AISpecRuntimeValue {\n if (sandboxRef(value).mode !== \"git-agent\") {\n throw new Error(\"sandbox dispatch policy requires sandbox.mode git-agent\");\n }\n return withSandbox(value, {\n dispatch: { ...sandboxRef(value).dispatch, ...patch },\n });\n}\n\nexport function withSetup(\n value: AISpecRuntimeValue,\n patch: Partial<AISpecRuntimeSetup>,\n): AISpecRuntimeValue {\n return withRoot(value, { setup: { ...value.setup, ...patch } });\n}\n\nexport function withConnections(\n value: AISpecRuntimeValue,\n patch: Partial<AISpecRuntimeConnections>,\n): AISpecRuntimeValue {\n return withSetup(value, {\n connections: { ...value.setup?.connections, ...patch },\n });\n}\n\nexport function withCheckout(\n value: AISpecRuntimeValue,\n patch: SpecCheckout,\n): AISpecRuntimeValue {\n return withSetup(value, {\n checkout: { ...value.setup?.checkout, ...patch },\n });\n}\n\nexport function withWorktree(\n value: AISpecRuntimeValue,\n patch: SpecWorktree,\n): AISpecRuntimeValue {\n return withCheckout(value, {\n worktree: { ...value.setup?.checkout?.worktree, ...patch },\n });\n}\n\nexport function withDirty(\n value: AISpecRuntimeValue,\n patch: SpecDirty,\n): AISpecRuntimeValue {\n return withCheckout(value, {\n dirty: { ...value.setup?.checkout?.dirty, ...patch },\n });\n}\n\nexport function withVerify(\n value: AISpecRuntimeValue,\n patch: NonNullable<SpecWorkflow[\"verify\"]>,\n): AISpecRuntimeValue {\n return withRoot(value, {\n workflow: {\n ...value.workflow,\n verify: { ...value.workflow?.verify, ...patch },\n },\n });\n}\n\n// The editor drives a single commit policy. A spec authored by hand may declare\n// several stanzas; the ones past the first are carried through untouched rather\n// than collapsed away by an edit to a field the editor does surface.\nexport function withCommit(\n value: AISpecRuntimeValue,\n patch: Partial<SpecCommit>,\n): AISpecRuntimeValue {\n const [first, ...rest] = value.workflow?.commits ?? [];\n return withRoot(value, {\n workflow: { ...value.workflow, commits: [{ ...first, ...patch }, ...rest] },\n });\n}\n\n// \"Never\" drops every stanza rather than flagging one off: an absent list is how\n// the spec says \"commit nothing\", and a surviving {dryRun: true} would leave the\n// section reading as configured.\nexport function withCommitPhase(\n value: AISpecRuntimeValue,\n phase: SpecCommitPhase | \"none\",\n): AISpecRuntimeValue {\n if (phase === \"none\") {\n return withRoot(value, { workflow: { ...value.workflow, commits: [] } });\n }\n return withCommit(value, { on: phase });\n}\n\n// A stanza with no explicit phase commits at the end of the run, matching\n// api.Commit.Phase()'s default.\nexport function commitPhase(\n value: AISpecRuntimeValue,\n): SpecCommitPhase | \"none\" {\n const commits = value.workflow?.commits;\n if (!commits?.length) return \"none\";\n const on = commits[0]?.on;\n return on === \"turn\" || on === \"agent\" ? on : \"run\";\n}\n\n// Mode switches clear the fields that no longer apply, so stale values from a\n// previous mode never leak into the compacted payload.\nexport function withCheckoutMode(\n value: AISpecRuntimeValue,\n mode: SpecCheckoutMode,\n): AISpecRuntimeValue {\n if (mode === \"none\") {\n return withCheckout(value, {\n mode,\n url: \"\",\n path: \"\",\n connection: \"\",\n ref: \"\",\n depth: 0,\n });\n }\n if (mode === \"local\")\n return withCheckout(value, { mode, url: \"\", connection: \"\" });\n return withCheckout(value, { mode, path: \"\" });\n}\n\nexport function withWorktreeMode(\n value: AISpecRuntimeValue,\n mode: SpecWorktreeMode,\n): AISpecRuntimeValue {\n if (mode === \"none\") {\n return withWorktree(value, {\n mode,\n prefix: \"\",\n base: \"\",\n path: \"\",\n keep: false,\n });\n }\n if (mode === \"existing\") {\n return withWorktree(value, { mode, prefix: \"\", base: \"\", keep: false });\n }\n return withWorktree(value, { mode });\n}\n\nexport function withStashMode(\n value: AISpecRuntimeValue,\n stash: SpecStashMode,\n): AISpecRuntimeValue {\n return withDirty(value, stash === \"none\" ? { stash, since: \"\" } : { stash });\n}\n\nexport function checkoutMode(value: AISpecRuntimeValue): SpecCheckoutMode {\n const checkout = value.setup?.checkout;\n if (checkout?.mode === \"remote\") return \"remote\";\n if (checkout?.mode === \"local\" || checkout?.path) return \"local\";\n return \"none\";\n}\n\nexport function worktreeMode(value: AISpecRuntimeValue): SpecWorktreeMode {\n const mode = value.setup?.checkout?.worktree?.mode;\n if (mode === \"existing\") return \"existing\";\n if (mode === \"new\") return \"new\";\n return \"none\";\n}\n\nexport function stashMode(value: AISpecRuntimeValue): SpecStashMode {\n const stash = value.setup?.checkout?.dirty?.stash;\n if (\n stash === \"untracked\" ||\n stash === \"unstaged\" ||\n stash === \"staged\" ||\n stash === \"all\"\n ) {\n return stash;\n }\n return \"none\";\n}\n\nexport function parseOptionalNumber(\n value: string,\n integer = false,\n): number | undefined {\n if (value.trim() === \"\") return undefined;\n const parsed = Number(value);\n if (!Number.isFinite(parsed)) return undefined;\n return integer ? Math.max(0, Math.trunc(parsed)) : parsed;\n}\n"],"names":[],"mappings":"AAyBO,SAAS,SACd,OACA,OACoB;AACpB,SAAO,EAAE,GAAG,OAAO,GAAG,MAAA;AACxB;AAIO,SAAS,iBACd,OACA,KACA,MACoB;AACpB,QAAM,UAAU,EAAE,GAAG,MAAA;AACrB,MAAI,SAAS,UAAa,SAAS,IAAI;AACrC,WA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,MACzB;AAAA,MACA,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,IAAA,CACP;AAAA,EACH;AACA,MAAI,SAAS,YAAY;AACvB,WAAO,aAAa,OAAO,EAAE,MAAM,QAAQ,IAAI,MAAM,IAAI,MAAM,OAAO;AAAA,EACxE;AACA,SAAO,aAAa,OAAO,EAAE,MAAM;AACrC;AASO,SAAS,aAAa,OAA6C;AA7SnE;AA8SL,QAAM,YAAW,WAAM,UAAN,mBAAa;AAC9B,OAAI,qCAAU,UAAS,SAAU,QAAO;AACxC,OAAI,qCAAU,UAAS,YAAW,qCAAU,MAAM,QAAO;AACzD,SAAO;AACT;AAEO,SAAS,aAAa,OAA6C;AApTnE;AAqTL,QAAM,QAAO,uBAAM,UAAN,mBAAa,aAAb,mBAAuB,aAAvB,mBAAiC;AAC9C,MAAI,SAAS,WAAY,QAAO;AAChC,MAAI,SAAS,MAAO,QAAO;AAC3B,SAAO;AACT;"}
1
+ {"version":3,"file":"update.js","sources":["../../../../src/data/ai/SpecRuntimeEditor/update.ts"],"sourcesContent":["import type {\n AISpecRuntimeConnections,\n AISpecRuntimeMemory,\n AISpecRuntimePermissions,\n AISpecRuntimePrompt,\n AISpecRuntimeSandbox,\n AISpecRuntimeSandboxDispatch,\n AISpecRuntimeSandboxPolicy,\n AISpecRuntimeSetup,\n AISpecRuntimeValue,\n SpecCheckoutMode,\n SpecCommitPhase,\n SpecPermissionMode,\n SpecSandboxMode,\n SpecStashMode,\n SpecWorktreeMode,\n} from \"../SpecRuntimeEditor.model\";\n\ntype SpecCheckout = NonNullable<AISpecRuntimeSetup[\"checkout\"]>;\ntype SpecWorktree = NonNullable<SpecCheckout[\"worktree\"]>;\ntype SpecDirty = NonNullable<SpecCheckout[\"dirty\"]>;\ntype SpecWorkflow = NonNullable<AISpecRuntimeValue[\"workflow\"]>;\ntype SpecCommit = NonNullable<SpecWorkflow[\"commits\"]>[number];\ntype SpecBudget = NonNullable<AISpecRuntimeValue[\"budget\"]>;\n\nexport function withRoot(\n value: AISpecRuntimeValue,\n patch: Partial<AISpecRuntimeValue>,\n): AISpecRuntimeValue {\n return { ...value, ...patch };\n}\n\n// Sets a top-level scalar, deleting the key entirely when cleared so the\n// compacted payload omits it instead of carrying an empty string/undefined.\nexport function withOptionalRoot(\n value: AISpecRuntimeValue,\n key: keyof AISpecRuntimeValue,\n next: unknown,\n): AISpecRuntimeValue {\n const updated = { ...value } as Record<string, unknown>;\n if (next === undefined || next === \"\") {\n delete updated[key];\n } else {\n updated[key] = next;\n }\n return updated as AISpecRuntimeValue;\n}\n\nexport function withPrompt(\n value: AISpecRuntimeValue,\n patch: Partial<AISpecRuntimePrompt>,\n): AISpecRuntimeValue {\n return withRoot(value, { prompt: { ...value.prompt, ...patch } });\n}\n\nexport function withBudget(\n value: AISpecRuntimeValue,\n budget: SpecBudget,\n): AISpecRuntimeValue {\n return withRoot(value, { budget });\n}\n\nexport function withBudgetValue(\n value: AISpecRuntimeValue,\n key: keyof SpecBudget,\n next: number | string | undefined,\n): AISpecRuntimeValue {\n const budget = { ...value.budget } as Record<string, unknown>;\n if (next === undefined || next === \"\") {\n delete budget[key];\n } else {\n budget[key] = next;\n }\n return withRoot(value, { budget: budget as SpecBudget });\n}\n\nexport function withMemory(\n value: AISpecRuntimeValue,\n patch: Partial<AISpecRuntimeMemory>,\n): AISpecRuntimeValue {\n return withRoot(value, { memory: { ...value.memory, ...patch } });\n}\n\nexport function withPermissions(\n value: AISpecRuntimeValue,\n patch: Partial<AISpecRuntimePermissions>,\n): AISpecRuntimeValue {\n return withRoot(value, { permissions: { ...value.permissions, ...patch } });\n}\n\n/**\n * Reads the sandbox ref in object form regardless of which form it is stored\n * in, so the section's controls do not each have to re-narrow the union.\n */\nexport function sandboxRef(value: AISpecRuntimeValue): AISpecRuntimeSandbox {\n if (typeof value.sandbox === \"string\") {\n return { mode: value.sandbox.trim() as SpecSandboxMode };\n }\n return value.sandbox ?? {};\n}\n\n/**\n * Patches the unified ref while keeping its object form during editing.\n */\nexport function withSandbox(\n value: AISpecRuntimeValue,\n patch: Partial<AISpecRuntimeSandbox>,\n): AISpecRuntimeValue {\n const next: AISpecRuntimeSandbox = { ...sandboxRef(value), ...patch };\n if (!next.mode) {\n throw new Error(\n \"sandbox.mode is required before configuring sandbox settings\",\n );\n }\n return withRoot(value, { sandbox: next });\n}\n\nexport function withSandboxMode(\n value: AISpecRuntimeValue,\n mode: SpecSandboxMode,\n): AISpecRuntimeValue {\n const current = sandboxRef(value);\n if (current.mode === mode) return value;\n return withRoot(value, { sandbox: { mode } });\n}\n\nexport function withSandboxBackend(\n value: AISpecRuntimeValue,\n backend: string,\n): AISpecRuntimeValue {\n const next = { ...sandboxRef(value) };\n const selected = backend.trim();\n if (selected) next.backend = selected;\n else delete next.backend;\n return withRoot(value, { sandbox: next });\n}\n\nexport function withSandboxAgent(\n value: AISpecRuntimeValue,\n agent: string,\n): AISpecRuntimeValue {\n const next = { ...sandboxRef(value) };\n const selected = agent.trim();\n if (selected) next.agent = selected;\n else delete next.agent;\n return withRoot(value, { sandbox: next });\n}\n\n// The base posture is independent of the sandbox (see AISpecRuntimePermissions\n// doc comment), so unlike sandbox settings it deletes cleanly to Unspecified\n// without needing a mode to be configured first.\nexport function withPermissionMode(\n value: AISpecRuntimeValue,\n mode: SpecPermissionMode | undefined,\n): AISpecRuntimeValue {\n const next = { ...value.permissions } as AISpecRuntimePermissions;\n if (mode) next.mode = mode;\n else delete next.mode;\n if (Object.keys(next).length === 0) {\n const { permissions: _permissions, ...rest } = value;\n return rest as AISpecRuntimeValue;\n }\n return withRoot(value, { permissions: next });\n}\n\nexport function withSandboxPolicy(\n value: AISpecRuntimeValue,\n patch: Partial<AISpecRuntimeSandboxPolicy>,\n): AISpecRuntimeValue {\n if (sandboxRef(value).mode !== \"native\") {\n throw new Error(\"native sandbox policy requires sandbox.mode native\");\n }\n return withSandbox(value, {\n policy: { ...sandboxRef(value).policy, ...patch },\n });\n}\n\nexport function withSandboxDispatch(\n value: AISpecRuntimeValue,\n patch: Partial<AISpecRuntimeSandboxDispatch>,\n): AISpecRuntimeValue {\n if (sandboxRef(value).mode !== \"git-agent\") {\n throw new Error(\"sandbox dispatch policy requires sandbox.mode git-agent\");\n }\n return withSandbox(value, {\n dispatch: { ...sandboxRef(value).dispatch, ...patch },\n });\n}\n\nexport function withSetup(\n value: AISpecRuntimeValue,\n patch: Partial<AISpecRuntimeSetup>,\n): AISpecRuntimeValue {\n return withRoot(value, { setup: { ...value.setup, ...patch } });\n}\n\nexport function withConnections(\n value: AISpecRuntimeValue,\n patch: Partial<AISpecRuntimeConnections>,\n): AISpecRuntimeValue {\n return withSetup(value, {\n connections: { ...value.setup?.connections, ...patch },\n });\n}\n\nexport function withCheckout(\n value: AISpecRuntimeValue,\n patch: SpecCheckout,\n): AISpecRuntimeValue {\n return withSetup(value, {\n checkout: { ...value.setup?.checkout, ...patch },\n });\n}\n\nexport function withWorktree(\n value: AISpecRuntimeValue,\n patch: SpecWorktree,\n): AISpecRuntimeValue {\n return withCheckout(value, {\n worktree: { ...value.setup?.checkout?.worktree, ...patch },\n });\n}\n\nexport function withDirty(\n value: AISpecRuntimeValue,\n patch: SpecDirty,\n): AISpecRuntimeValue {\n return withCheckout(value, {\n dirty: { ...value.setup?.checkout?.dirty, ...patch },\n });\n}\n\nexport function withVerify(\n value: AISpecRuntimeValue,\n patch: NonNullable<SpecWorkflow[\"verify\"]>,\n): AISpecRuntimeValue {\n return withRoot(value, {\n workflow: {\n ...value.workflow,\n verify: { ...value.workflow?.verify, ...patch },\n },\n });\n}\n\n// The editor drives a single commit policy. A spec authored by hand may declare\n// several stanzas; the ones past the first are carried through untouched rather\n// than collapsed away by an edit to a field the editor does surface.\nexport function withCommit(\n value: AISpecRuntimeValue,\n patch: Partial<SpecCommit>,\n): AISpecRuntimeValue {\n const [first, ...rest] = value.workflow?.commits ?? [];\n return withRoot(value, {\n workflow: { ...value.workflow, commits: [{ ...first, ...patch }, ...rest] },\n });\n}\n\n// \"Never\" drops every stanza rather than flagging one off: an absent list is how\n// the spec says \"commit nothing\", and a surviving {dryRun: true} would leave the\n// section reading as configured.\nexport function withCommitPhase(\n value: AISpecRuntimeValue,\n phase: SpecCommitPhase | \"none\",\n): AISpecRuntimeValue {\n if (phase === \"none\") {\n return withRoot(value, { workflow: { ...value.workflow, commits: [] } });\n }\n return withCommit(value, { on: phase });\n}\n\n// A stanza with no explicit phase commits at the end of the run, matching\n// api.Commit.Phase()'s default. Shared between a value's own first commit\n// stanza and an inherited stanza the section displays in its place.\nexport function commitPhaseFromEntry(\n commit: SpecCommit | undefined,\n): SpecCommitPhase {\n const on = commit?.on;\n return on === \"turn\" || on === \"agent\" ? on : \"run\";\n}\n\nexport function commitPhase(\n value: AISpecRuntimeValue,\n): SpecCommitPhase | \"none\" {\n const commits = value.workflow?.commits;\n if (!commits?.length) return \"none\";\n return commitPhaseFromEntry(commits[0]);\n}\n\n// Mode switches clear the fields that no longer apply, so stale values from a\n// previous mode never leak into the compacted payload.\nexport function withCheckoutMode(\n value: AISpecRuntimeValue,\n mode: SpecCheckoutMode,\n): AISpecRuntimeValue {\n if (mode === \"none\") {\n return withCheckout(value, {\n mode,\n url: \"\",\n path: \"\",\n connection: \"\",\n ref: \"\",\n depth: 0,\n });\n }\n if (mode === \"local\")\n return withCheckout(value, { mode, url: \"\", connection: \"\" });\n return withCheckout(value, { mode, path: \"\" });\n}\n\nexport function withWorktreeMode(\n value: AISpecRuntimeValue,\n mode: SpecWorktreeMode,\n): AISpecRuntimeValue {\n if (mode === \"none\") {\n return withWorktree(value, {\n mode,\n prefix: \"\",\n base: \"\",\n path: \"\",\n keep: false,\n });\n }\n const next =\n value.workflow?.commits === undefined\n ? withCommitPhase(value, \"turn\")\n : value;\n if (mode === \"existing\") {\n return withWorktree(next, { mode, prefix: \"\", base: \"\", keep: false });\n }\n return withWorktree(next, { mode });\n}\n\nexport function withStashMode(\n value: AISpecRuntimeValue,\n stash: SpecStashMode,\n): AISpecRuntimeValue {\n return withDirty(value, stash === \"none\" ? { stash, since: \"\" } : { stash });\n}\n\nexport function checkoutMode(value: AISpecRuntimeValue): SpecCheckoutMode {\n const checkout = value.setup?.checkout;\n if (checkout?.mode === \"remote\") return \"remote\";\n if (checkout?.mode === \"local\" || checkout?.path) return \"local\";\n return \"none\";\n}\n\nexport function worktreeMode(value: AISpecRuntimeValue): SpecWorktreeMode {\n const mode = value.setup?.checkout?.worktree?.mode;\n if (mode === \"existing\") return \"existing\";\n if (mode === \"new\") return \"new\";\n return \"none\";\n}\n\nexport function stashMode(value: AISpecRuntimeValue): SpecStashMode {\n const stash = value.setup?.checkout?.dirty?.stash;\n if (\n stash === \"untracked\" ||\n stash === \"unstaged\" ||\n stash === \"staged\" ||\n stash === \"all\"\n ) {\n return stash;\n }\n return \"none\";\n}\n\nexport function parseOptionalNumber(\n value: string,\n integer = false,\n): number | undefined {\n if (value.trim() === \"\") return undefined;\n const parsed = Number(value);\n if (!Number.isFinite(parsed)) return undefined;\n return integer ? Math.max(0, Math.trunc(parsed)) : parsed;\n}\n"],"names":[],"mappings":"AAyBO,SAAS,SACd,OACA,OACoB;AACpB,SAAO,EAAE,GAAG,OAAO,GAAG,MAAA;AACxB;AAIO,SAAS,iBACd,OACA,KACA,MACoB;AACpB,QAAM,UAAU,EAAE,GAAG,MAAA;AACrB,MAAI,SAAS,UAAa,SAAS,IAAI;AACrC,WAAO,QAAQ,GAAG;AAAA,EACpB,OAAO;AACL,YAAQ,GAAG,IAAI;AAAA,EACjB;AACA,SAAO;AACT;AAEO,SAAS,WACd,OACA,OACoB;AACpB,SAAO,SAAS,OAAO,EAAE,QAAQ,EAAE,GAAG,MAAM,QAAQ,GAAG,MAAA,GAAS;AAClE;AASO,SAAS,gBACd,OACA,KACA,MACoB;AACpB,QAAM,SAAS,EAAE,GAAG,MAAM,OAAA;AAC1B,MAAI,SAAS,UAAa,SAAS,IAAI;AACrC,WAAO,OAAO,GAAG;AAAA,EACnB,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A,EACvE;AACA,SAAO,aAAa,MAAM,EAAE,MAAM;AACpC;AASO,SAAS,aAAa,OAA6C;AA1TnE;AA2TL,QAAM,YAAW,WAAM,UAAN,mBAAa;AAC9B,OAAI,qCAAU,UAAS,SAAU,QAAO;AACxC,OAAI,qCAAU,UAAS,YAAW,qCAAU,MAAM,QAAO;AACzD,SAAO;AACT;AAEO,SAAS,aAAa,OAA6C;AAjUnE;AAkUL,QAAM,QAAO,uBAAM,UAAN,mBAAa,aAAb,mBAAuB,aAAvB,mBAAiC;AAC9C,MAAI,SAAS,WAAY,QAAO;AAChC,MAAI,SAAS,MAAO,QAAO;AAC3B,SAAO;AACT;"}
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const OWN_BODY_KINDS = /* @__PURE__ */ new Set([
4
+ "command",
5
+ "filesystem",
6
+ "network",
7
+ "permissions",
8
+ "elicitation",
9
+ "plan"
10
+ ]);
11
+ function hasApprovalBody(request) {
12
+ return request !== void 0 && OWN_BODY_KINDS.has(request.kind);
13
+ }
14
+ function grantEntries(policy) {
15
+ var _a, _b, _c, _d;
16
+ const entries = [];
17
+ for (const root of ((_a = policy.filesystem) == null ? void 0 : _a.writableRoots) ?? []) {
18
+ entries.push({
19
+ key: `write:${root}`,
20
+ label: `Write ${root}`,
21
+ apply: (grant) => {
22
+ const filesystem = grant.filesystem ?? (grant.filesystem = {});
23
+ (filesystem.writableRoots ?? (filesystem.writableRoots = [])).push(root);
24
+ }
25
+ });
26
+ }
27
+ for (const root of ((_b = policy.filesystem) == null ? void 0 : _b.readableRoots) ?? []) {
28
+ entries.push({
29
+ key: `read:${root}`,
30
+ label: `Read ${root}`,
31
+ apply: (grant) => {
32
+ const filesystem = grant.filesystem ?? (grant.filesystem = {});
33
+ (filesystem.readableRoots ?? (filesystem.readableRoots = [])).push(root);
34
+ }
35
+ });
36
+ }
37
+ const access = (_c = policy.network) == null ? void 0 : _c.access;
38
+ if (access) {
39
+ entries.push({
40
+ key: "network:access",
41
+ label: `Network access: ${access}`,
42
+ apply: (grant) => {
43
+ (grant.network ?? (grant.network = {})).access = access;
44
+ }
45
+ });
46
+ }
47
+ for (const domain of ((_d = policy.network) == null ? void 0 : _d.allowedDomains) ?? []) {
48
+ entries.push({
49
+ key: `domain:${domain}`,
50
+ label: `Network domain ${domain}`,
51
+ apply: (grant) => {
52
+ const network = grant.network ?? (grant.network = {});
53
+ (network.allowedDomains ?? (network.allowedDomains = [])).push(domain);
54
+ }
55
+ });
56
+ }
57
+ return entries;
58
+ }
59
+ function grantFromSelection(entries, selected) {
60
+ const grant = {};
61
+ for (const entry of entries) {
62
+ if (selected.has(entry.key)) entry.apply(grant);
63
+ }
64
+ return grant;
65
+ }
66
+ function offeredScopes(request) {
67
+ return ((request == null ? void 0 : request.supportedScopes) ?? []).filter(
68
+ (scope) => scope !== "request"
69
+ );
70
+ }
71
+ exports.grantEntries = grantEntries;
72
+ exports.grantFromSelection = grantFromSelection;
73
+ exports.hasApprovalBody = hasApprovalBody;
74
+ exports.offeredScopes = offeredScopes;
75
+ //# sourceMappingURL=approval-request.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"approval-request.cjs","sources":["../../../src/data/ai/approval-request.ts"],"sourcesContent":["// Typed mirror of captain's `api.ApprovalRequest` / `api.ApprovalDecision` JSON\n// (pkg/api/approval.go). Every field beyond `tool`/`input` is optional here: a\n// host that predates the unified approval callback sends only the old shape and\n// the viewer must keep rendering it.\n\nexport type ApprovalKind =\n | \"tool\"\n | \"command\"\n | \"filesystem\"\n | \"network\"\n | \"permissions\"\n | \"question\"\n | \"elicitation\"\n | \"plan\";\n\n/** How far an approval reaches. Absent or \"request\" means this request only. */\nexport type ApprovalScope = \"request\" | \"turn\" | \"session\";\n\nexport interface StdinWrite {\n terminal: string;\n chars: string;\n}\n\nexport interface CommandApproval {\n command?: string;\n cwd?: string;\n unsandboxed?: boolean;\n stdin?: StdinWrite;\n /** The provider's suggested persistent rule. Shown, never offered as an action. */\n proposedPolicy?: string[];\n}\n\nexport type FilesystemOperation = \"read\" | \"write\" | \"edit\" | \"delete\" | \"patch\";\n\nexport interface FileChange {\n path: string;\n kind: string;\n}\n\nexport interface FilesystemApproval {\n operation: FilesystemOperation;\n paths?: string[];\n changes?: FileChange[];\n}\n\nexport interface NetworkApproval {\n host?: string;\n protocol?: string;\n url?: string;\n command?: string;\n}\n\nexport type SandboxFilesystemAccess = \"read-only\" | \"workspace-write\";\nexport type SandboxNetworkAccess = \"disabled\" | \"restricted\" | \"unrestricted\";\n\nexport interface SandboxFilesystemPolicy {\n access?: SandboxFilesystemAccess;\n writableRoots?: string[];\n readableRoots?: string[];\n deniedReadRoots?: string[];\n deniedWriteRoots?: string[];\n includeSystemTemp?: boolean;\n}\n\nexport interface SandboxNetworkPolicy {\n access?: SandboxNetworkAccess;\n allowedDomains?: string[];\n deniedDomains?: string[];\n allowedUnixSockets?: string[];\n allowAllUnixSockets?: boolean;\n allowLocalBinding?: boolean;\n allowedMachServices?: string[];\n httpProxyPort?: number;\n socksProxyPort?: number;\n}\n\nexport interface SandboxCommandPolicy {\n excludedFromSandbox?: string[];\n allowUnsandboxed?: boolean;\n}\n\nexport interface SandboxCredentialsPolicy {\n deniedFiles?: string[];\n deniedEnv?: string[];\n maskedEnv?: string[];\n}\n\nexport interface SandboxPlatformPolicy {\n allowAppleEvents?: boolean;\n weakerNestedIsolation?: boolean;\n weakerNetworkIsolation?: boolean;\n}\n\n/** captain `api.NativeSandboxPolicy`: the sandbox vocabulary a permissions\n * request is expressed in and a grant is answered in. A grant may carry only\n * `filesystem.writableRoots`/`readableRoots` and `network`, and only entries the\n * request listed. */\nexport interface NativeSandboxPolicy {\n required?: boolean;\n filesystem?: SandboxFilesystemPolicy;\n network?: SandboxNetworkPolicy;\n commands?: SandboxCommandPolicy;\n credentials?: SandboxCredentialsPolicy;\n platform?: SandboxPlatformPolicy;\n}\n\n/** captain `api.TerminalQuestion`. Answers are keyed by `id`, or by `text` when\n * the provider gives questions no id (Claude). */\nexport interface ApprovalQuestion {\n id?: string;\n text: string;\n context?: string;\n options?: string[];\n optionDescriptions?: Record<string, string>;\n multiSelect?: boolean;\n secret?: boolean;\n}\n\nexport type ElicitationMode = \"form\" | \"url\";\n\nexport interface ElicitationApproval {\n server: string;\n mode: ElicitationMode;\n message: string;\n /** The requested form: a flat object schema of primitive fields. */\n schema?: Record<string, unknown>;\n url?: string;\n elicitationId?: string;\n}\n\n/** The plan an agent asks to implement (captain `TerminalPlan`). */\nexport interface ApprovalPlan {\n content: string;\n path?: string;\n}\n\nexport interface ApprovalRequest {\n tool: string;\n input?: Record<string, unknown>;\n toolUseId?: string;\n sessionId?: string;\n kind: ApprovalKind;\n turnId?: string;\n reason?: string;\n /** Approving exceeds the run's initial sandbox posture. */\n escalates?: boolean;\n /** Cancel (deny + interrupt the turn) is available. */\n interruptible?: boolean;\n supportedScopes?: ApprovalScope[];\n command?: CommandApproval;\n filesystem?: FilesystemApproval;\n network?: NetworkApproval;\n permissions?: NativeSandboxPolicy;\n questions?: ApprovalQuestion[];\n elicitation?: ElicitationApproval;\n /** Approving leaves plan mode; a deny keeps planning with the message as feedback. */\n plan?: ApprovalPlan;\n}\n\n/** The decision fields beyond allow/message that a typed approval can carry. */\nexport interface ApprovalDecisionFields {\n /** Question answers, keyed by question id (or text). */\n answers?: Record<string, string | string[]>;\n /** Deny and interrupt the turn. Only valid on an `interruptible` request. */\n interrupt?: boolean;\n /** Widen an approval beyond this request; only a scope in `supportedScopes`. */\n scope?: Exclude<ApprovalScope, \"request\">;\n /** The approved subset of a `permissions` request. */\n grants?: NativeSandboxPolicy;\n /** Accepted form-mode elicitation content. */\n content?: Record<string, unknown>;\n}\n\n/** Kinds whose body the viewer draws itself instead of the generic tool row;\n * `tool` and `question` keep their existing rows and only gain controls. */\nconst OWN_BODY_KINDS: ReadonlySet<ApprovalKind> = new Set([\n \"command\",\n \"filesystem\",\n \"network\",\n \"permissions\",\n \"elicitation\",\n \"plan\",\n]);\n\nexport function hasApprovalBody(\n request: ApprovalRequest | undefined,\n): request is ApprovalRequest {\n return request !== undefined && OWN_BODY_KINDS.has(request.kind);\n}\n\n/** One selectable entry of a permissions request. */\nexport interface GrantEntry {\n key: string;\n label: string;\n /** Adds this entry to a grant under construction. */\n apply: (grant: NativeSandboxPolicy) => void;\n}\n\n/** Lists exactly what a permissions request asks for, one entry per grantable\n * item. Only the fields captain accepts back in a grant are listed. */\nexport function grantEntries(policy: NativeSandboxPolicy): GrantEntry[] {\n const entries: GrantEntry[] = [];\n for (const root of policy.filesystem?.writableRoots ?? []) {\n entries.push({\n key: `write:${root}`,\n label: `Write ${root}`,\n apply: (grant) => {\n const filesystem = (grant.filesystem ??= {});\n (filesystem.writableRoots ??= []).push(root);\n },\n });\n }\n for (const root of policy.filesystem?.readableRoots ?? []) {\n entries.push({\n key: `read:${root}`,\n label: `Read ${root}`,\n apply: (grant) => {\n const filesystem = (grant.filesystem ??= {});\n (filesystem.readableRoots ??= []).push(root);\n },\n });\n }\n const access = policy.network?.access;\n if (access) {\n entries.push({\n key: \"network:access\",\n label: `Network access: ${access}`,\n apply: (grant) => {\n (grant.network ??= {}).access = access;\n },\n });\n }\n for (const domain of policy.network?.allowedDomains ?? []) {\n entries.push({\n key: `domain:${domain}`,\n label: `Network domain ${domain}`,\n apply: (grant) => {\n const network = (grant.network ??= {});\n (network.allowedDomains ??= []).push(domain);\n },\n });\n }\n return entries;\n}\n\n/** Builds the grant for the selected entry keys. */\nexport function grantFromSelection(\n entries: readonly GrantEntry[],\n selected: ReadonlySet<string>,\n): NativeSandboxPolicy {\n const grant: NativeSandboxPolicy = {};\n for (const entry of entries) {\n if (selected.has(entry.key)) entry.apply(grant);\n }\n return grant;\n}\n\n/** The scopes a host may offer beyond a single request. */\nexport function offeredScopes(\n request: ApprovalRequest | undefined,\n): Exclude<ApprovalScope, \"request\">[] {\n return (request?.supportedScopes ?? []).filter(\n (scope): scope is Exclude<ApprovalScope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