@dev-sergeev/datalab-kit 0.1.2 → 0.1.4

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 (355) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +23 -5
  3. package/THIRD_PARTY_NOTICES.md +6 -2
  4. package/docs/adr/0001-user-settings-priority.md +2 -0
  5. package/docs/adr/0002-package-delivery.md +8 -0
  6. package/node_modules/@pi-plugins/elapsed/LICENSE +21 -0
  7. package/node_modules/@pi-plugins/elapsed/README.md +45 -0
  8. package/node_modules/@pi-plugins/elapsed/dist/index.d.mts +8 -0
  9. package/node_modules/@pi-plugins/elapsed/dist/index.d.mts.map +1 -0
  10. package/node_modules/@pi-plugins/elapsed/dist/index.mjs +47 -0
  11. package/node_modules/@pi-plugins/elapsed/dist/index.mjs.map +1 -0
  12. package/node_modules/@pi-plugins/elapsed/package.json +65 -0
  13. package/node_modules/@tifan/pi-recap/README.md +61 -0
  14. package/node_modules/@tifan/pi-recap/package.json +43 -0
  15. package/node_modules/@tifan/pi-recap/src/index.ts +586 -0
  16. package/node_modules/@tifan/pi-recap/src/model-picker.ts +234 -0
  17. package/node_modules/@tifan/pi-recap/src/models.ts +180 -0
  18. package/node_modules/@tifan/pi-recap/src/sanitize.ts +119 -0
  19. package/node_modules/@tifan/pi-recap/src/tui.ts +155 -0
  20. package/node_modules/@zigai/pi-extension-internals/README.md +24 -0
  21. package/node_modules/@zigai/pi-extension-internals/dist/editor-enhancer-registry.d.ts +21 -0
  22. package/node_modules/@zigai/pi-extension-internals/dist/editor-enhancer-registry.js +233 -0
  23. package/node_modules/@zigai/pi-extension-internals/dist/index.d.ts +6 -0
  24. package/node_modules/@zigai/pi-extension-internals/dist/index.js +3 -0
  25. package/node_modules/@zigai/pi-extension-internals/dist/linked-method-patch.d.ts +34 -0
  26. package/node_modules/@zigai/pi-extension-internals/dist/linked-method-patch.js +272 -0
  27. package/node_modules/@zigai/pi-extension-internals/dist/pi-internal-import.d.ts +11 -0
  28. package/node_modules/@zigai/pi-extension-internals/dist/pi-internal-import.js +139 -0
  29. package/node_modules/@zigai/pi-extension-internals/package.json +41 -0
  30. package/node_modules/@zigai/pi-extension-settings/LICENSE +21 -0
  31. package/node_modules/@zigai/pi-extension-settings/README.md +36 -0
  32. package/node_modules/@zigai/pi-extension-settings/dist/artifacts.d.ts +23 -0
  33. package/node_modules/@zigai/pi-extension-settings/dist/artifacts.d.ts.map +1 -0
  34. package/node_modules/@zigai/pi-extension-settings/dist/artifacts.js +75 -0
  35. package/node_modules/@zigai/pi-extension-settings/dist/artifacts.js.map +1 -0
  36. package/node_modules/@zigai/pi-extension-settings/dist/cli-entry.d.ts +3 -0
  37. package/node_modules/@zigai/pi-extension-settings/dist/cli-entry.d.ts.map +1 -0
  38. package/node_modules/@zigai/pi-extension-settings/dist/cli-entry.js +5 -0
  39. package/node_modules/@zigai/pi-extension-settings/dist/cli-entry.js.map +1 -0
  40. package/node_modules/@zigai/pi-extension-settings/dist/cli.d.ts +6 -0
  41. package/node_modules/@zigai/pi-extension-settings/dist/cli.d.ts.map +1 -0
  42. package/node_modules/@zigai/pi-extension-settings/dist/cli.js +87 -0
  43. package/node_modules/@zigai/pi-extension-settings/dist/cli.js.map +1 -0
  44. package/node_modules/@zigai/pi-extension-settings/dist/definition-marker.d.ts +2 -0
  45. package/node_modules/@zigai/pi-extension-settings/dist/definition-marker.d.ts.map +1 -0
  46. package/node_modules/@zigai/pi-extension-settings/dist/definition-marker.js +2 -0
  47. package/node_modules/@zigai/pi-extension-settings/dist/definition-marker.js.map +1 -0
  48. package/node_modules/@zigai/pi-extension-settings/dist/definition.d.ts +159 -0
  49. package/node_modules/@zigai/pi-extension-settings/dist/definition.d.ts.map +1 -0
  50. package/node_modules/@zigai/pi-extension-settings/dist/definition.js +248 -0
  51. package/node_modules/@zigai/pi-extension-settings/dist/definition.js.map +1 -0
  52. package/node_modules/@zigai/pi-extension-settings/dist/file-system.d.ts +10 -0
  53. package/node_modules/@zigai/pi-extension-settings/dist/file-system.d.ts.map +1 -0
  54. package/node_modules/@zigai/pi-extension-settings/dist/file-system.js +115 -0
  55. package/node_modules/@zigai/pi-extension-settings/dist/file-system.js.map +1 -0
  56. package/node_modules/@zigai/pi-extension-settings/dist/index.d.ts +2 -0
  57. package/node_modules/@zigai/pi-extension-settings/dist/index.d.ts.map +1 -0
  58. package/node_modules/@zigai/pi-extension-settings/dist/index.js +2 -0
  59. package/node_modules/@zigai/pi-extension-settings/dist/index.js.map +1 -0
  60. package/node_modules/@zigai/pi-extension-settings/dist/json-value.d.ts +18 -0
  61. package/node_modules/@zigai/pi-extension-settings/dist/json-value.d.ts.map +1 -0
  62. package/node_modules/@zigai/pi-extension-settings/dist/json-value.js +56 -0
  63. package/node_modules/@zigai/pi-extension-settings/dist/json-value.js.map +1 -0
  64. package/node_modules/@zigai/pi-extension-settings/dist/paths.d.ts +11 -0
  65. package/node_modules/@zigai/pi-extension-settings/dist/paths.d.ts.map +1 -0
  66. package/node_modules/@zigai/pi-extension-settings/dist/paths.js +23 -0
  67. package/node_modules/@zigai/pi-extension-settings/dist/paths.js.map +1 -0
  68. package/node_modules/@zigai/pi-extension-settings/dist/pi-host-paths.d.ts +5 -0
  69. package/node_modules/@zigai/pi-extension-settings/dist/pi-host-paths.d.ts.map +1 -0
  70. package/node_modules/@zigai/pi-extension-settings/dist/pi-host-paths.js +21 -0
  71. package/node_modules/@zigai/pi-extension-settings/dist/pi-host-paths.js.map +1 -0
  72. package/node_modules/@zigai/pi-extension-settings/dist/pi.d.ts +106 -0
  73. package/node_modules/@zigai/pi-extension-settings/dist/pi.d.ts.map +1 -0
  74. package/node_modules/@zigai/pi-extension-settings/dist/pi.js +122 -0
  75. package/node_modules/@zigai/pi-extension-settings/dist/pi.js.map +1 -0
  76. package/node_modules/@zigai/pi-extension-settings/dist/pi.ts +2537 -0
  77. package/node_modules/@zigai/pi-extension-settings/dist/pi.ts.map +7 -0
  78. package/node_modules/@zigai/pi-extension-settings/dist/projects.d.ts +10 -0
  79. package/node_modules/@zigai/pi-extension-settings/dist/projects.d.ts.map +1 -0
  80. package/node_modules/@zigai/pi-extension-settings/dist/projects.js +177 -0
  81. package/node_modules/@zigai/pi-extension-settings/dist/projects.js.map +1 -0
  82. package/node_modules/@zigai/pi-extension-settings/dist/runtime.d.ts +40 -0
  83. package/node_modules/@zigai/pi-extension-settings/dist/runtime.d.ts.map +1 -0
  84. package/node_modules/@zigai/pi-extension-settings/dist/runtime.js +158 -0
  85. package/node_modules/@zigai/pi-extension-settings/dist/runtime.js.map +1 -0
  86. package/node_modules/@zigai/pi-extension-settings/dist/runtime.ts +158 -0
  87. package/node_modules/@zigai/pi-extension-settings/dist/runtime.ts.map +7 -0
  88. package/node_modules/@zigai/pi-extension-settings/dist/schema-document.d.ts +19 -0
  89. package/node_modules/@zigai/pi-extension-settings/dist/schema-document.d.ts.map +1 -0
  90. package/node_modules/@zigai/pi-extension-settings/dist/schema-document.js +168 -0
  91. package/node_modules/@zigai/pi-extension-settings/dist/schema-document.js.map +1 -0
  92. package/node_modules/@zigai/pi-extension-settings/dist/settings-documentation.d.ts +9 -0
  93. package/node_modules/@zigai/pi-extension-settings/dist/settings-documentation.d.ts.map +1 -0
  94. package/node_modules/@zigai/pi-extension-settings/dist/settings-documentation.js +242 -0
  95. package/node_modules/@zigai/pi-extension-settings/dist/settings-documentation.js.map +1 -0
  96. package/node_modules/@zigai/pi-extension-settings/dist/settings-layer.d.ts +59 -0
  97. package/node_modules/@zigai/pi-extension-settings/dist/settings-layer.d.ts.map +1 -0
  98. package/node_modules/@zigai/pi-extension-settings/dist/settings-layer.js +98 -0
  99. package/node_modules/@zigai/pi-extension-settings/dist/settings-layer.js.map +1 -0
  100. package/node_modules/@zigai/pi-extension-settings/dist/settings-loader.d.ts +80 -0
  101. package/node_modules/@zigai/pi-extension-settings/dist/settings-loader.d.ts.map +1 -0
  102. package/node_modules/@zigai/pi-extension-settings/dist/settings-loader.js +144 -0
  103. package/node_modules/@zigai/pi-extension-settings/dist/settings-loader.js.map +1 -0
  104. package/node_modules/@zigai/pi-extension-settings/dist/settings-merge.d.ts +5 -0
  105. package/node_modules/@zigai/pi-extension-settings/dist/settings-merge.d.ts.map +1 -0
  106. package/node_modules/@zigai/pi-extension-settings/dist/settings-merge.js +30 -0
  107. package/node_modules/@zigai/pi-extension-settings/dist/settings-merge.js.map +1 -0
  108. package/node_modules/@zigai/pi-extension-settings/dist/settings-revision.d.ts +10 -0
  109. package/node_modules/@zigai/pi-extension-settings/dist/settings-revision.d.ts.map +1 -0
  110. package/node_modules/@zigai/pi-extension-settings/dist/settings-revision.js +16 -0
  111. package/node_modules/@zigai/pi-extension-settings/dist/settings-revision.js.map +1 -0
  112. package/node_modules/@zigai/pi-extension-settings/dist/settings-transaction.d.ts +54 -0
  113. package/node_modules/@zigai/pi-extension-settings/dist/settings-transaction.d.ts.map +1 -0
  114. package/node_modules/@zigai/pi-extension-settings/dist/settings-transaction.js +202 -0
  115. package/node_modules/@zigai/pi-extension-settings/dist/settings-transaction.js.map +1 -0
  116. package/node_modules/@zigai/pi-extension-settings/dist/typebox-runtime.d.ts +5 -0
  117. package/node_modules/@zigai/pi-extension-settings/dist/typebox-runtime.d.ts.map +1 -0
  118. package/node_modules/@zigai/pi-extension-settings/dist/typebox-runtime.js +9 -0
  119. package/node_modules/@zigai/pi-extension-settings/dist/typebox-runtime.js.map +1 -0
  120. package/node_modules/@zigai/pi-extension-settings/docs/generation.md +71 -0
  121. package/node_modules/@zigai/pi-extension-settings/docs/manual-setup.md +98 -0
  122. package/node_modules/@zigai/pi-extension-settings/docs/runtime.md +100 -0
  123. package/node_modules/@zigai/pi-extension-settings/docs/ui-controls.md +31 -0
  124. package/node_modules/@zigai/pi-extension-settings/package.json +97 -0
  125. package/node_modules/@zigai/pi-mention-anything/README.md +113 -0
  126. package/node_modules/@zigai/pi-mention-anything/config.schema.json +313 -0
  127. package/node_modules/@zigai/pi-mention-anything/docs/command-protocol.md +106 -0
  128. package/node_modules/@zigai/pi-mention-anything/docs/providers.md +128 -0
  129. package/node_modules/@zigai/pi-mention-anything/examples/query-command.mjs +96 -0
  130. package/node_modules/@zigai/pi-mention-anything/examples/recursive-tree.ts +28 -0
  131. package/node_modules/@zigai/pi-mention-anything/examples/static.ts +28 -0
  132. package/node_modules/@zigai/pi-mention-anything/examples/tmux.ts +90 -0
  133. package/node_modules/@zigai/pi-mention-anything/examples/tree-settings.json +25 -0
  134. package/node_modules/@zigai/pi-mention-anything/package.json +58 -0
  135. package/node_modules/@zigai/pi-mention-anything/src/api.ts +75 -0
  136. package/node_modules/@zigai/pi-mention-anything/src/autocomplete.ts +231 -0
  137. package/node_modules/@zigai/pi-mention-anything/src/chain-autocomplete.ts +596 -0
  138. package/node_modules/@zigai/pi-mention-anything/src/chain-syntax.ts +345 -0
  139. package/node_modules/@zigai/pi-mention-anything/src/command-provider.ts +291 -0
  140. package/node_modules/@zigai/pi-mention-anything/src/configured-source.ts +66 -0
  141. package/node_modules/@zigai/pi-mention-anything/src/editor.ts +180 -0
  142. package/node_modules/@zigai/pi-mention-anything/src/expand-mentions.ts +162 -0
  143. package/node_modules/@zigai/pi-mention-anything/src/index.ts +54 -0
  144. package/node_modules/@zigai/pi-mention-anything/src/initial-suggestions.ts +190 -0
  145. package/node_modules/@zigai/pi-mention-anything/src/list-provider.ts +71 -0
  146. package/node_modules/@zigai/pi-mention-anything/src/mention-hub.ts +307 -0
  147. package/node_modules/@zigai/pi-mention-anything/src/mention-resolution.ts +374 -0
  148. package/node_modules/@zigai/pi-mention-anything/src/mention-syntax.ts +105 -0
  149. package/node_modules/@zigai/pi-mention-anything/src/register-mention.ts +89 -0
  150. package/node_modules/@zigai/pi-mention-anything/src/rendering.ts +53 -0
  151. package/node_modules/@zigai/pi-mention-anything/src/selected-items.ts +21 -0
  152. package/node_modules/@zigai/pi-mention-anything/src/selection-history.ts +135 -0
  153. package/node_modules/@zigai/pi-mention-anything/src/settings-input.ts +317 -0
  154. package/node_modules/@zigai/pi-mention-anything/src/settings.prevalidated.ts +57 -0
  155. package/node_modules/@zigai/pi-mention-anything/src/settings.ts +52 -0
  156. package/node_modules/@zigai/pi-mention-anything/src/source-contract.ts +174 -0
  157. package/node_modules/@zigai/pi-mention-anything/src/source-controller.ts +1070 -0
  158. package/node_modules/@zigai/pi-mention-anything/src/source-runtime.ts +99 -0
  159. package/node_modules/@zigai/pi-mention-skill/README.md +60 -0
  160. package/node_modules/@zigai/pi-mention-skill/config.schema.json +81 -0
  161. package/node_modules/@zigai/pi-mention-skill/package.json +56 -0
  162. package/node_modules/@zigai/pi-mention-skill/src/index.ts +60 -0
  163. package/node_modules/@zigai/pi-mention-skill/src/settings-input.ts +74 -0
  164. package/node_modules/@zigai/pi-mention-skill/src/settings.prevalidated.ts +18 -0
  165. package/node_modules/@zigai/pi-mention-skill/src/settings.ts +54 -0
  166. package/node_modules/@zigai/pi-mention-skill/src/skill-commands.ts +18 -0
  167. package/node_modules/@zigai/pi-mention-skill/src/skill-content.ts +60 -0
  168. package/node_modules/@zigai/pi-mention-skill/src/skill-provider.ts +105 -0
  169. package/node_modules/@zigai/pi-mention-skill/src/slash-skill-filter.ts +29 -0
  170. package/node_modules/argparse/LICENSE +21 -0
  171. package/node_modules/argparse/README.md +257 -0
  172. package/node_modules/argparse/index.js +3 -0
  173. package/node_modules/argparse/lib/action/append/constant.js +47 -0
  174. package/node_modules/argparse/lib/action/append.js +53 -0
  175. package/node_modules/argparse/lib/action/count.js +40 -0
  176. package/node_modules/argparse/lib/action/help.js +47 -0
  177. package/node_modules/argparse/lib/action/store/constant.js +43 -0
  178. package/node_modules/argparse/lib/action/store/false.js +27 -0
  179. package/node_modules/argparse/lib/action/store/true.js +26 -0
  180. package/node_modules/argparse/lib/action/store.js +50 -0
  181. package/node_modules/argparse/lib/action/subparsers.js +149 -0
  182. package/node_modules/argparse/lib/action/version.js +47 -0
  183. package/node_modules/argparse/lib/action.js +146 -0
  184. package/node_modules/argparse/lib/action_container.js +482 -0
  185. package/node_modules/argparse/lib/argparse.js +14 -0
  186. package/node_modules/argparse/lib/argument/error.js +50 -0
  187. package/node_modules/argparse/lib/argument/exclusive.js +54 -0
  188. package/node_modules/argparse/lib/argument/group.js +75 -0
  189. package/node_modules/argparse/lib/argument_parser.js +1161 -0
  190. package/node_modules/argparse/lib/const.js +21 -0
  191. package/node_modules/argparse/lib/help/added_formatters.js +87 -0
  192. package/node_modules/argparse/lib/help/formatter.js +795 -0
  193. package/node_modules/argparse/lib/namespace.js +76 -0
  194. package/node_modules/argparse/lib/utils.js +57 -0
  195. package/node_modules/argparse/package.json +34 -0
  196. package/node_modules/esprima/LICENSE.BSD +21 -0
  197. package/node_modules/esprima/README.md +46 -0
  198. package/node_modules/esprima/bin/esparse.js +139 -0
  199. package/node_modules/esprima/bin/esvalidate.js +236 -0
  200. package/node_modules/esprima/dist/esprima.js +6709 -0
  201. package/node_modules/esprima/package.json +112 -0
  202. package/node_modules/extend-shallow/LICENSE +21 -0
  203. package/node_modules/extend-shallow/README.md +61 -0
  204. package/node_modules/extend-shallow/index.js +33 -0
  205. package/node_modules/extend-shallow/package.json +56 -0
  206. package/node_modules/graceful-fs/LICENSE +15 -0
  207. package/node_modules/graceful-fs/README.md +143 -0
  208. package/node_modules/graceful-fs/clone.js +23 -0
  209. package/node_modules/graceful-fs/graceful-fs.js +448 -0
  210. package/node_modules/graceful-fs/legacy-streams.js +118 -0
  211. package/node_modules/graceful-fs/package.json +53 -0
  212. package/node_modules/graceful-fs/polyfills.js +355 -0
  213. package/node_modules/gray-matter/LICENSE +21 -0
  214. package/node_modules/gray-matter/README.md +565 -0
  215. package/node_modules/gray-matter/gray-matter.d.ts +114 -0
  216. package/node_modules/gray-matter/index.js +228 -0
  217. package/node_modules/gray-matter/lib/defaults.js +18 -0
  218. package/node_modules/gray-matter/lib/engine.js +30 -0
  219. package/node_modules/gray-matter/lib/engines.js +54 -0
  220. package/node_modules/gray-matter/lib/excerpt.js +32 -0
  221. package/node_modules/gray-matter/lib/parse.js +13 -0
  222. package/node_modules/gray-matter/lib/stringify.js +56 -0
  223. package/node_modules/gray-matter/lib/to-file.js +43 -0
  224. package/node_modules/gray-matter/lib/utils.js +66 -0
  225. package/node_modules/gray-matter/package.json +127 -0
  226. package/node_modules/is-extendable/LICENSE +21 -0
  227. package/node_modules/is-extendable/README.md +72 -0
  228. package/node_modules/is-extendable/index.js +13 -0
  229. package/node_modules/is-extendable/package.json +51 -0
  230. package/node_modules/js-yaml/LICENSE +21 -0
  231. package/node_modules/js-yaml/README.md +302 -0
  232. package/node_modules/js-yaml/bin/js-yaml.js +132 -0
  233. package/node_modules/js-yaml/dist/js-yaml.js +4024 -0
  234. package/node_modules/js-yaml/dist/js-yaml.min.js +1 -0
  235. package/node_modules/js-yaml/index.js +7 -0
  236. package/node_modules/js-yaml/lib/js-yaml/common.js +59 -0
  237. package/node_modules/js-yaml/lib/js-yaml/dumper.js +850 -0
  238. package/node_modules/js-yaml/lib/js-yaml/exception.js +43 -0
  239. package/node_modules/js-yaml/lib/js-yaml/loader.js +1679 -0
  240. package/node_modules/js-yaml/lib/js-yaml/mark.js +76 -0
  241. package/node_modules/js-yaml/lib/js-yaml/schema/core.js +18 -0
  242. package/node_modules/js-yaml/lib/js-yaml/schema/default_full.js +25 -0
  243. package/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js +28 -0
  244. package/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js +17 -0
  245. package/node_modules/js-yaml/lib/js-yaml/schema/json.js +25 -0
  246. package/node_modules/js-yaml/lib/js-yaml/schema.js +108 -0
  247. package/node_modules/js-yaml/lib/js-yaml/type/binary.js +138 -0
  248. package/node_modules/js-yaml/lib/js-yaml/type/bool.js +35 -0
  249. package/node_modules/js-yaml/lib/js-yaml/type/float.js +116 -0
  250. package/node_modules/js-yaml/lib/js-yaml/type/int.js +173 -0
  251. package/node_modules/js-yaml/lib/js-yaml/type/js/function.js +93 -0
  252. package/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js +60 -0
  253. package/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js +28 -0
  254. package/node_modules/js-yaml/lib/js-yaml/type/map.js +8 -0
  255. package/node_modules/js-yaml/lib/js-yaml/type/merge.js +12 -0
  256. package/node_modules/js-yaml/lib/js-yaml/type/null.js +34 -0
  257. package/node_modules/js-yaml/lib/js-yaml/type/omap.js +44 -0
  258. package/node_modules/js-yaml/lib/js-yaml/type/pairs.js +53 -0
  259. package/node_modules/js-yaml/lib/js-yaml/type/seq.js +8 -0
  260. package/node_modules/js-yaml/lib/js-yaml/type/set.js +29 -0
  261. package/node_modules/js-yaml/lib/js-yaml/type/str.js +8 -0
  262. package/node_modules/js-yaml/lib/js-yaml/type/timestamp.js +88 -0
  263. package/node_modules/js-yaml/lib/js-yaml/type.js +61 -0
  264. package/node_modules/js-yaml/lib/js-yaml.js +39 -0
  265. package/node_modules/js-yaml/package.json +52 -0
  266. package/node_modules/kind-of/LICENSE +21 -0
  267. package/node_modules/kind-of/README.md +367 -0
  268. package/node_modules/kind-of/index.js +129 -0
  269. package/node_modules/kind-of/package.json +88 -0
  270. package/node_modules/node-addon-api/common 2.gypi +21 -0
  271. package/node_modules/node-addon-api/except 2.gypi +25 -0
  272. package/node_modules/node-addon-api/napi 2.h +3463 -0
  273. package/node_modules/node-addon-api/napi-inl 2.h +7250 -0
  274. package/node_modules/node-addon-api/napi-inl.deprecated 2.h +186 -0
  275. package/node_modules/node-addon-api/node_addon_api 2.gyp +42 -0
  276. package/node_modules/node-addon-api/node_api 2.gyp +9 -0
  277. package/node_modules/node-addon-api/noexcept 2.gypi +26 -0
  278. package/node_modules/node-addon-api/nothing 2.c +0 -0
  279. package/node_modules/pi-toggle-skills/README.md +213 -0
  280. package/node_modules/pi-toggle-skills/package.json +60 -0
  281. package/node_modules/pi-toggle-skills/src/index.ts +112 -0
  282. package/node_modules/pi-toggle-skills/src/skill-discovery.ts +258 -0
  283. package/node_modules/pi-toggle-skills/src/skill-selector.ts +435 -0
  284. package/node_modules/pi-toggle-skills/toggle-skills 2.ts +316 -0
  285. package/node_modules/pi-toggle-skills/toggle-skills.ts +316 -0
  286. package/node_modules/pi-toggle-skills/vitest.config 2.ts +15 -0
  287. package/node_modules/pi-toggle-skills/vitest.config.ts +15 -0
  288. package/node_modules/proper-lockfile/LICENSE +21 -0
  289. package/node_modules/proper-lockfile/README.md +183 -0
  290. package/node_modules/proper-lockfile/index.js +40 -0
  291. package/node_modules/proper-lockfile/lib/adapter.js +85 -0
  292. package/node_modules/proper-lockfile/lib/lockfile.js +342 -0
  293. package/node_modules/proper-lockfile/lib/mtime-precision.js +55 -0
  294. package/node_modules/proper-lockfile/node_modules/retry/.npmignore +3 -0
  295. package/node_modules/proper-lockfile/node_modules/retry/.travis.yml +15 -0
  296. package/node_modules/proper-lockfile/node_modules/retry/License +21 -0
  297. package/node_modules/proper-lockfile/node_modules/retry/Makefile +18 -0
  298. package/node_modules/proper-lockfile/node_modules/retry/README.md +227 -0
  299. package/node_modules/proper-lockfile/node_modules/retry/equation.gif +0 -0
  300. package/node_modules/proper-lockfile/node_modules/retry/example/dns.js +31 -0
  301. package/node_modules/proper-lockfile/node_modules/retry/example/stop.js +40 -0
  302. package/node_modules/proper-lockfile/node_modules/retry/index.js +1 -0
  303. package/node_modules/proper-lockfile/node_modules/retry/lib/retry.js +100 -0
  304. package/node_modules/proper-lockfile/node_modules/retry/lib/retry_operation.js +158 -0
  305. package/node_modules/proper-lockfile/node_modules/retry/package.json +32 -0
  306. package/node_modules/proper-lockfile/node_modules/retry/test/common.js +10 -0
  307. package/node_modules/proper-lockfile/node_modules/retry/test/integration/test-forever.js +24 -0
  308. package/node_modules/proper-lockfile/node_modules/retry/test/integration/test-retry-operation.js +258 -0
  309. package/node_modules/proper-lockfile/node_modules/retry/test/integration/test-retry-wrap.js +101 -0
  310. package/node_modules/proper-lockfile/node_modules/retry/test/integration/test-timeouts.js +69 -0
  311. package/node_modules/proper-lockfile/package.json +71 -0
  312. package/node_modules/section-matter/LICENSE +21 -0
  313. package/node_modules/section-matter/README.md +236 -0
  314. package/node_modules/section-matter/index.js +136 -0
  315. package/node_modules/section-matter/package.json +55 -0
  316. package/node_modules/signal-exit/LICENSE.txt +16 -0
  317. package/node_modules/signal-exit/README.md +39 -0
  318. package/node_modules/signal-exit/index.js +202 -0
  319. package/node_modules/signal-exit/package.json +38 -0
  320. package/node_modules/signal-exit/signals.js +53 -0
  321. package/node_modules/sprintf-js/.npmignore +1 -0
  322. package/node_modules/sprintf-js/.npmignore 2 +1 -0
  323. package/node_modules/sprintf-js/LICENSE +24 -0
  324. package/node_modules/sprintf-js/LICENSE 2 +24 -0
  325. package/node_modules/sprintf-js/README 2.md +88 -0
  326. package/node_modules/sprintf-js/README.md +88 -0
  327. package/node_modules/sprintf-js/bower 2.json +14 -0
  328. package/node_modules/sprintf-js/bower.json +14 -0
  329. package/node_modules/sprintf-js/demo/angular.html +20 -0
  330. package/node_modules/sprintf-js/dist/angular-sprintf.min.js +4 -0
  331. package/node_modules/sprintf-js/dist/angular-sprintf.min.js.map +1 -0
  332. package/node_modules/sprintf-js/dist/angular-sprintf.min.map +1 -0
  333. package/node_modules/sprintf-js/dist/sprintf.min.js +4 -0
  334. package/node_modules/sprintf-js/dist/sprintf.min.js.map +1 -0
  335. package/node_modules/sprintf-js/dist/sprintf.min.map +1 -0
  336. package/node_modules/sprintf-js/gruntfile 2.js +36 -0
  337. package/node_modules/sprintf-js/gruntfile.js +36 -0
  338. package/node_modules/sprintf-js/package 2.json +22 -0
  339. package/node_modules/sprintf-js/package.json +22 -0
  340. package/node_modules/sprintf-js/src/angular-sprintf.js +18 -0
  341. package/node_modules/sprintf-js/src/sprintf.js +208 -0
  342. package/node_modules/sprintf-js/test/test.js +82 -0
  343. package/node_modules/strip-bom-string/LICENSE +21 -0
  344. package/node_modules/strip-bom-string/README.md +66 -0
  345. package/node_modules/strip-bom-string/index.js +15 -0
  346. package/node_modules/strip-bom-string/package.json +60 -0
  347. package/node_modules/tree-sitter-bash/tree-sitter-bash 2.wasm +0 -0
  348. package/node_modules/typebox/license 2 +23 -0
  349. package/node_modules/typebox/package 2.json +87 -0
  350. package/node_modules/typebox/readme 2.md +370 -0
  351. package/node_modules/zod/compile 2.cjs +96 -0
  352. package/node_modules/zod/compile 2.js +52 -0
  353. package/node_modules/zod/index 2.cjs +52 -0
  354. package/node_modules/zod/index 2.js +7 -0
  355. package/package.json +13 -4
@@ -0,0 +1,98 @@
1
+ import { Value } from "./typebox-runtime.js";
2
+ import { isJsonObject, isJsonString, JsonValueSchema, parseJson, } from "./json-value.js";
3
+ import { mergeSettings, settingsLayerFromFile } from "./settings-merge.js";
4
+ export function settingsValidationIssues(schema, value) {
5
+ return [...Value.Errors(schema, value)].map((issue) => ({
6
+ path: issue.instancePath === "" ? "/" : issue.instancePath,
7
+ message: issue.message,
8
+ }));
9
+ }
10
+ export function parseSettingsLayer(path, scope, text, layerSchema) {
11
+ const parsed = parseJson(text);
12
+ if (parsed === undefined) {
13
+ return {
14
+ settings: undefined,
15
+ schemaReference: undefined,
16
+ diagnostics: [
17
+ {
18
+ code: "config-malformed",
19
+ severity: "error",
20
+ scope,
21
+ path,
22
+ message: `${scope} settings contain malformed JSON and were ignored`,
23
+ },
24
+ ],
25
+ };
26
+ }
27
+ if (!Value.Check(layerSchema, parsed)) {
28
+ return {
29
+ settings: undefined,
30
+ schemaReference: undefined,
31
+ diagnostics: [
32
+ {
33
+ code: "config-invalid",
34
+ severity: "error",
35
+ scope,
36
+ path,
37
+ message: `${scope} settings do not match the extension schema and were ignored`,
38
+ issues: settingsValidationIssues(layerSchema, parsed),
39
+ },
40
+ ],
41
+ };
42
+ }
43
+ const schemaReference = isJsonObject(parsed) && isJsonString(parsed.$schema) ? parsed.$schema : undefined;
44
+ try {
45
+ const decoded = Value.Decode(layerSchema, parsed);
46
+ const decodedJson = Value.Parse(JsonValueSchema, decoded);
47
+ if (!isJsonObject(decodedJson)) {
48
+ return {
49
+ settings: undefined,
50
+ schemaReference,
51
+ diagnostics: [
52
+ {
53
+ code: "config-decode-failed",
54
+ severity: "error",
55
+ scope,
56
+ path,
57
+ message: `${scope} settings did not decode to a JSON object and were ignored`,
58
+ },
59
+ ],
60
+ };
61
+ }
62
+ return { settings: settingsLayerFromFile(decodedJson), schemaReference, diagnostics: [] };
63
+ }
64
+ catch {
65
+ return {
66
+ settings: undefined,
67
+ schemaReference,
68
+ diagnostics: [
69
+ {
70
+ code: "config-decode-failed",
71
+ severity: "error",
72
+ scope,
73
+ path,
74
+ message: `${scope} settings could not be decoded and were ignored`,
75
+ },
76
+ ],
77
+ };
78
+ }
79
+ }
80
+ export function applySettingsLayer(schema, current, layer, path, scope) {
81
+ if (layer.settings === undefined)
82
+ return { settings: current };
83
+ const merged = mergeSettings(current, layer.settings);
84
+ if (Value.Check(schema, merged))
85
+ return { settings: merged };
86
+ return {
87
+ settings: current,
88
+ diagnostic: {
89
+ code: "config-invalid",
90
+ severity: "error",
91
+ scope,
92
+ path,
93
+ message: `${scope} settings conflict with the resolved configuration and were ignored`,
94
+ issues: settingsValidationIssues(schema, merged),
95
+ },
96
+ };
97
+ }
98
+ //# sourceMappingURL=settings-layer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings-layer.js","sourceRoot":"","sources":["../src/settings-layer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C,OAAO,EACH,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,SAAS,GAGZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAgE3E,MAAM,UAAU,wBAAwB,CACpC,MAAe,EACf,KAAgB;IAEhB,OAAO,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACpD,I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AAO,EAAE,GAAG,KAAK,qEAAqE;YACtF,MAAM,EAAE,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC;SACnD;KACJ,CAAC;AACN,CAAC","sourcesContent":["import type { TObject, TSchema } from \"typebox\";\n\nimport { Value } from \"./typebox-runtime.ts\";\n\nimport {\n isJsonObject,\n isJsonString,\n JsonValueSchema,\n parseJson,\n type JsonObject,\n type JsonValue,\n} from \"./json-value.ts\";\nimport { mergeSettings, settingsLayerFromFile } from \"./settings-merge.ts\";\n\nexport type SettingsScope = \"global\" | \"project\";\n\n/**\n * Stable machine-readable category for a non-fatal settings problem.\n *\n * Callers should branch on this value rather than diagnostic text:\n *\n * - `bundled-schema-read-failed`: the generated schema could not be read.\n * - `bundled-schema-stale`: the bundled schema does not match the definition.\n * - `config-decode-failed`: a validated layer could not be decoded by TypeBox.\n * - `config-invalid`: a layer failed validation or conflicted with an earlier layer.\n * - `config-malformed`: a settings file contains malformed JSON.\n * - `config-read-failed`: a settings file could not be read.\n * - `config-scaffold-failed`: the initial global settings file could not be created.\n * - `schema-install-failed`: the editor schema could not be installed.\n */\nexport type SettingsDiagnosticCode =\n | \"bundled-schema-read-failed\"\n | \"bundled-schema-stale\"\n | \"config-decode-failed\"\n | \"config-invalid\"\n | \"config-malformed\"\n | \"config-read-failed\"\n | \"config-scaffold-failed\"\n | \"schema-install-failed\";\n\nexport type SettingsValidationIssue = {\n /** JSON Pointer to the invalid setting, or `/` for the document root. */\n readonly path: string;\n /** TypeBox validation message for this issue. */\n readonly message: string;\n};\n\n/**\n * A non-fatal problem encountered while loading settings.\n *\n * The affected schema or settings layer is ignored. Messages and validation issues contain no\n * settings values, making them suitable for display through Pi's UI.\n */\nexport type SettingsDiagnostic = {\n /** Stable category intended for programmatic handling. */\n readonly code: SettingsDiagnosticCode;\n /** All current diagnostics are errors; the field allows direct use with `ctx.ui.notify`. */\n readonly severity: \"error\";\n /** The settings layer or editor-schema operation that failed. */\n readonly scope: SettingsScope | \"schema\";\n /** Absolute path of the affected settings or schema file. */\n readonly path: string;\n /** User-facing summary that does not include settings values. */\n readonly message: string;\n /** JSON Pointer paths and validator messages when schema validation failed. */\n readonly issues?: readonly SettingsValidationIssue[];\n};\n\nexport type ParsedSettingsLayer = {\n /** Encoded JSON settings after editor-only metadata is removed. */\n readonly settings: JsonObject | undefined;\n /** Editor schema reference from the file, when present and valid. */\n readonly schemaReference: string | undefined;\n readonly diagnostics: readonly SettingsDiagnostic[];\n};\n\nexport function settingsValidationIssues(\n schema: TSchema,\n value: JsonValue,\n): readonly SettingsValidationIssue[] {\n return [...Value.Errors(schema, value)].map((issue) => ({\n path: issue.instancePath === \"\" ? \"/\" : issue.instancePath,\n message: issue.message,\n }));\n}\n\nexport function parseSettingsLayer(\n path: string,\n scope: SettingsScope,\n text: string,\n layerSchema: TSchema,\n): ParsedSettingsLayer {\n const parsed = parseJson(text);\n if (parsed === undefined) {\n return {\n settings: undefined,\n schemaReference: undefined,\n diagnostics: [\n {\n code: \"config-malformed\",\n severity: \"error\",\n scope,\n path,\n message: `${scope} settings contain malformed JSON and were ignored`,\n },\n ],\n };\n }\n\n if (!Value.Check(layerSchema, parsed)) {\n return {\n settings: undefined,\n schemaReference: undefined,\n diagnostics: [\n {\n code: \"config-invalid\",\n severity: \"error\",\n scope,\n path,\n message: `${scope} settings do not match the extension schema and were ignored`,\n issues: settingsValidationIssues(layerSchema, parsed),\n },\n ],\n };\n }\n\n const schemaReference =\n isJsonObject(parsed) && isJsonString(parsed.$schema) ? parsed.$schema : undefined;\n try {\n const decoded: unknown = Value.Decode(layerSchema, parsed);\n const decodedJson = Value.Parse(JsonValueSchema, decoded);\n if (!isJsonObject(decodedJson)) {\n return {\n settings: undefined,\n schemaReference,\n diagnostics: [\n {\n code: \"config-decode-failed\",\n severity: \"error\",\n scope,\n path,\n message: `${scope} settings did not decode to a JSON object and were ignored`,\n },\n ],\n };\n }\n return { settings: settingsLayerFromFile(decodedJson), schemaReference, diagnostics: [] };\n } catch {\n return {\n settings: undefined,\n schemaReference,\n diagnostics: [\n {\n code: \"config-decode-failed\",\n severity: \"error\",\n scope,\n path,\n message: `${scope} settings could not be decoded and were ignored`,\n },\n ],\n };\n }\n}\n\nexport type AppliedSettingsLayer = {\n readonly settings: JsonObject;\n readonly diagnostic?: SettingsDiagnostic;\n};\n\nexport function applySettingsLayer<Schema extends TObject>(\n schema: Schema,\n current: JsonObject,\n layer: Pick<ParsedSettingsLayer, \"settings\">,\n path: string,\n scope: SettingsScope,\n): AppliedSettingsLayer {\n if (layer.settings === undefined) return { settings: current };\n\n const merged = mergeSettings(current, layer.settings);\n if (Value.Check(schema, merged)) return { settings: merged };\n\n return {\n settings: current,\n diagnostic: {\n code: \"config-invalid\",\n severity: \"error\",\n scope,\n path,\n message: `${scope} settings conflict with the resolved configuration and were ignored`,\n issues: settingsValidationIssues(schema, merged),\n },\n };\n}\n"]}
@@ -0,0 +1,80 @@
1
+ import type { StaticDecode, TObject } from "typebox";
2
+ import type { ExtensionSettingsDefinition } from "./definition.ts";
3
+ import { type JsonObject } from "./json-value.ts";
4
+ import { type SettingsDiagnostic, type SettingsDiagnosticCode } from "./settings-layer.ts";
5
+ import { type PiSettingsRevision } from "./settings-revision.ts";
6
+ /**
7
+ * Source for the generated `config.schema.json` shipped with an extension.
8
+ *
9
+ * The content must exactly match the schema derived from the settings definition. A mismatch is
10
+ * reported as `bundled-schema-stale`, and neither the editor schema nor the initial global settings
11
+ * file is installed.
12
+ */
13
+ export type BundledSchemaSource = {
14
+ /** Use schema text already loaded by the extension. */
15
+ readonly kind: "content";
16
+ /** Complete generated JSON Schema, including its trailing newline. */
17
+ readonly content: string;
18
+ } | {
19
+ /** Read the schema synchronously from a bundled file URL. */
20
+ readonly kind: "url";
21
+ /** A `file:` URL, usually `new URL("../config.schema.json", import.meta.url)`. */
22
+ readonly url: URL;
23
+ };
24
+ export type ProjectSettingsLocation = {
25
+ readonly cwd: string;
26
+ readonly configDirName: string;
27
+ readonly trusted: boolean;
28
+ };
29
+ export type LoadSettingsOptions = {
30
+ readonly agentDir: string;
31
+ readonly bundledSchema: BundledSchemaSource;
32
+ readonly project?: ProjectSettingsLocation;
33
+ };
34
+ /**
35
+ * Result of resolving defaults, global settings, and an optional trusted-project override.
36
+ *
37
+ * File and validation failures are represented in {@link SettingsDiagnostic}; a failed layer is
38
+ * ignored and resolution continues from the last valid value.
39
+ *
40
+ * @template Schema The definition's TypeBox schema.
41
+ */
42
+ export type LoadedSettings<Schema extends TObject> = {
43
+ /** Fully resolved and TypeBox-decoded settings safe for extension code to consume. */
44
+ readonly settings: StaticDecode<Schema>;
45
+ /** Accepted encoded global layer after removal of editor-only metadata. */
46
+ readonly globalSettingsLayer: JsonObject | undefined;
47
+ /** Accepted encoded trusted-project layer after removal of editor metadata. */
48
+ readonly projectSettingsLayer: JsonObject | undefined;
49
+ /** Non-fatal problems encountered while installing, reading, validating, or decoding settings. */
50
+ readonly diagnostics: readonly SettingsDiagnostic[];
51
+ /** Absolute path of the extension's global settings file. */
52
+ readonly globalConfigPath: string;
53
+ /** Absolute project settings path, even when the project is untrusted; absent without a project. */
54
+ readonly projectConfigPath: string | undefined;
55
+ /** Revision of the exact global settings source read during this load; absent after a read failure. */
56
+ readonly globalRevision: PiSettingsRevision | undefined;
57
+ /**
58
+ * Combined revision of the global and trusted-project sources read during this load.
59
+ *
60
+ * Absent when no project was supplied, the project is untrusted, or either source could not be
61
+ * read. A missing settings file still has a revision and is distinct from an unreadable file.
62
+ */
63
+ readonly projectRevision: PiSettingsRevision | undefined;
64
+ /** Whether a valid global layer contributed to {@link LoadedSettings.settings}. */
65
+ readonly usedGlobalConfig: boolean;
66
+ /** Whether a valid trusted-project layer contributed to {@link LoadedSettings.settings}. */
67
+ readonly usedProjectConfig: boolean;
68
+ /** Whether this load created the global settings file from schema defaults. */
69
+ readonly scaffoldedGlobalConfig: boolean;
70
+ /**
71
+ * Result of installing the bundled editor schema in Pi's global settings directory.
72
+ *
73
+ * `created` and `updated` indicate a write, `unchanged` means the installed file already
74
+ * matched, and `unavailable` means the bundled schema could not be verified or installed.
75
+ */
76
+ readonly schemaStatus: "created" | "unavailable" | "unchanged" | "updated";
77
+ };
78
+ export type { SettingsDiagnostic, SettingsDiagnosticCode };
79
+ export declare function loadSettings<const Schema extends TObject>(definition: ExtensionSettingsDefinition<Schema>, options: LoadSettingsOptions): LoadedSettings<Schema>;
80
+ //# sourceMappingURL=settings-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings-loader.d.ts","sourceRoot":"","sources":["../src/settings-loader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAW,MAAM,SAAS,CAAC;AAE9D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAEnE,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG9D,OAAO,EAIH,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAE9B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAA0B,KAAK,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAGzF;;;;;;GAMG;AACH,MAAM,MAAM,mBAAmB,GACzB;IACI,uDAAuD;IACvD,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,sEAAsE;IACtE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC5B,GACD;IACI,6DAA6D;IAC7D,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IACrB,kFAAkF;IAClF,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC;CACrB,CAAC;AAER,MAAM,MAAM,uBAAuB,GAAG;IAClC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAC9B,QAAQ,CAAC,QAAQ,E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,OAAO,EAAE,mBAAmB,GAC7B,cAAc,CAAC,MAAM,CAAC,CA8HxB"}
@@ -0,0 +1,144 @@
1
+ import { readFileSync } from "node:fs";
2
+ import { readTextIfPresent, writeTextAtomically, writeTextIfMissing } from "./file-system.js";
3
+ import { formatJson } from "./json-value.js";
4
+ import { resolveGlobalSettingsPaths, resolveProjectSettingsPaths } from "./paths.js";
5
+ import { createDefaultSettingsDocument, createSettingsFileSchema } from "./schema-document.js";
6
+ import { applySettingsLayer, parseSettingsLayer, } from "./settings-layer.js";
7
+ import { createSettingsRevision } from "./settings-revision.js";
8
+ import { Value } from "./typebox-runtime.js";
9
+ function bundledSchemaContent(source) {
10
+ if (source.kind === "content")
11
+ return source.content;
12
+ try {
13
+ return readFileSync(source.url, "utf8");
14
+ }
15
+ catch {
16
+ return undefined;
17
+ }
18
+ }
19
+ function readLayer(path, scope, layerSchema) {
20
+ try {
21
+ const content = readTextIfPresent(path);
22
+ const parsed = content === undefined
23
+ ? { settings: undefined, schemaReference: undefined, diagnostics: [] }
24
+ : parseSettingsLayer(path, scope, content, layerSchema);
25
+ return { ...parsed, source: { status: "available", content } };
26
+ }
27
+ catch {
28
+ return {
29
+ settings: undefined,
30
+ diagnostics: [
31
+ {
32
+ code: "config-read-failed",
33
+ severity: "error",
34
+ scope,
35
+ path,
36
+ message: `${scope} settings could not be read and were ignored`,
37
+ },
38
+ ],
39
+ schemaReference: undefined,
40
+ source: { status: "unavailable" },
41
+ };
42
+ }
43
+ }
44
+ export function loadSettings(definition, options) {
45
+ const diagnostics = [];
46
+ const globalPaths = resolveGlobalSettingsPaths(options.agentDir, definition.id);
47
+ const projectPaths = options.project === undefined
48
+ ? undefined
49
+ : resolveProjectSettingsPaths(options.project.cwd, options.project.configDirName, definition.id);
50
+ const layerSchema = createSettingsFileSchema(definition);
51
+ const expectedSchema = formatJson(layerSchema);
52
+ const sourceSchema = bundledSchemaContent(options.bundledSchema);
53
+ let schemaStatus = "unavailable";
54
+ let scaffoldedGlobalConfig = false;
55
+ if (sourceSchema === undefined) {
56
+ diagnostics.push({
57
+ code: "bundled-schema-read-failed",
58
+ severity: "error",
59
+ scope: "schema",
60
+ path: globalPaths.schemaPath,
61
+ message: "The bundled settings schema could not be read",
62
+ });
63
+ }
64
+ else if (sourceSchema !== expectedSchema) {
65
+ diagnostics.push({
66
+ code: "bundled-schema-stale",
67
+ severity: "error",
68
+ scope: "schema",
69
+ path: globalPaths.schemaPath,
70
+ message: "The bundled settings schema is stale; run the artifact generator",
71
+ });
72
+ }
73
+ else {
74
+ try {
75
+ schemaStatus = writeTextAtomically(globalPaths.schemaPath, sourceSchema);
76
+ }
77
+ catch {
78
+ diagnostics.push({
79
+ code: "schema-install-failed",
80
+ severity: "error",
81
+ scope: "schema",
82
+ path: globalPaths.schemaPath,
83
+ message: "The local editor schema could not be installed",
84
+ });
85
+ }
86
+ if (schemaStatus !== "unavailable") {
87
+ try {
88
+ scaffoldedGlobalConfig =
89
+ writeTextIfMissing(globalPaths.configPath, () => formatJson(createDefaultSettingsDocument(definition))) === "created";
90
+ }
91
+ catch {
92
+ diagnostics.push({
93
+ code: "config-scaffold-failed",
94
+ severity: "error",
95
+ scope: "global",
96
+ path: globalPaths.configPath,
97
+ message: "The default global settings file could not be scaffolded",
98
+ });
99
+ }
100
+ }
101
+ }
102
+ const globalLayer = readLayer(globalPaths.configPath, "global", layerSchema);
103
+ diagnostics.push(...globalLayer.diagnostics);
104
+ const globalApplied = applySettingsLayer(definition.schema, definition.defaultSettings, globalLayer, globalPaths.configPath, "global");
105
+ if (globalApplied.diagnostic !== undefined)
106
+ diagnostics.push(globalApplied.diagnostic);
107
+ let resolved = globalApplied.settings;
108
+ let projectSettingsLayer;
109
+ let usedProjectConfig = false;
110
+ let projectRevision;
111
+ if (projectPaths !== undefined && options.project?.trusted === true) {
112
+ const projectLayer = readLayer(projectPaths.configPath, "project", layerSchema);
113
+ diagnostics.push(...projectLayer.diagnostics);
114
+ const projectApplied = applySettingsLayer(definition.schema, resolved, projectLayer, projectPaths.configPath, "project");
115
+ if (projectApplied.diagnostic !== undefined)
116
+ diagnostics.push(projectApplied.diagnostic);
117
+ if (projectLayer.settings !== undefined && projectApplied.diagnostic === undefined) {
118
+ resolved = projectApplied.settings;
119
+ projectSettingsLayer = projectLayer.settings;
120
+ usedProjectConfig = true;
121
+ }
122
+ if (globalLayer.source.status === "available" &&
123
+ projectLayer.source.status === "available") {
124
+ projectRevision = createSettingsRevision(globalLayer.source.content, projectLayer.source.content);
125
+ }
126
+ }
127
+ return {
128
+ settings: Value.Decode(Value.Clone(definition.schema), resolved),
129
+ globalSettingsLayer: globalApplied.diagnostic === undefined ? globalLayer.settings : undefined,
130
+ projectSettingsLayer,
131
+ diagnostics,
132
+ globalConfigPath: globalPaths.configPath,
133
+ projectConfigPath: projectPaths?.configPath,
134
+ globalRevision: globalLayer.source.status === "available"
135
+ ? createSettingsRevision(globalLayer.source.content)
136
+ : undefined,
137
+ projectRevision,
138
+ usedGlobalConfig: globalLayer.settings !== undefined && globalApplied.diagnostic === undefined,
139
+ usedProjectConfig,
140
+ scaffoldedGlobalConfig,
141
+ schemaStatus,
142
+ };
143
+ }
144
+ //# sourceMappingURL=settings-loader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings-loader.js","sourceRoot":"","sources":["../src/settings-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAKvC,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC9F,OAAO,EAAE,UAAU,EAAmB,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AACrF,OAAO,EAAE,6BAA6B,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAC/F,OAAO,EACH,kBAAkB,EAClB,kBAAkB,GAKrB,MAAM,qBAAqB,CAAC;AAC7B,O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;QAC3C,cAAc,EACV,WAAW,CAAC,MAAM,CAAC,MAAM,KAAK,WAAW;YACrC,CAAC,CAAC,sBAAsB,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC;YACpD,CAAC,CAAC,SAAS;QACnB,eAAe;QACf,gBAAgB,EACZ,WAAW,CAAC,QAAQ,KAAK,SAAS,IAAI,aAAa,CAAC,UAAU,KAAK,SAAS;QAChF,iBAAiB;QACjB,sBAAsB;QACtB,YAAY;KACf,CAAC;AACN,CAAC","sourcesContent":["import { readFileSync } from \"node:fs\";\n\nimport type { StaticDecode, TObject, TSchema } from \"typebox\";\n\nimport type { ExtensionSettingsDefinition } from \"./definition.ts\";\nimport { readTextIfPresent, writeTextAtomically, writeTextIfMissing } from \"./file-system.ts\";\nimport { formatJson, type JsonObject } from \"./json-value.ts\";\nimport { resolveGlobalSettingsPaths, resolveProjectSettingsPaths } from \"./paths.ts\";\nimport { createDefaultSettingsDocument, createSettingsFileSchema } from \"./schema-document.ts\";\nimport {\n applySettingsLayer,\n parseSettingsLayer,\n type ParsedSettingsLayer,\n type SettingsDiagnostic,\n type SettingsDiagnosticCode,\n type SettingsScope,\n} from \"./settings-layer.ts\";\nimport { createSettingsRevision, type PiSettingsRevision } from \"./settings-revision.ts\";\nimport { Value } from \"./typebox-runtime.ts\";\n\n/**\n * Source for the generated `config.schema.json` shipped with an extension.\n *\n * The content must exactly match the schema derived from the settings definition. A mismatch is\n * reported as `bundled-schema-stale`, and neither the editor schema nor the initial global settings\n * file is installed.\n */\nexport type BundledSchemaSource =\n | {\n /** Use schema text already loaded by the extension. */\n readonly kind: \"content\";\n /** Complete generated JSON Schema, including its trailing newline. */\n readonly content: string;\n }\n | {\n /** Read the schema synchronously from a bundled file URL. */\n readonly kind: \"url\";\n /** A `file:` URL, usually `new URL(\"../config.schema.json\", import.meta.url)`. */\n readonly url: URL;\n };\n\nexport type ProjectSettingsLocation = {\n readonly cwd: string;\n readonly configDirName: string;\n readonly trusted: boolean;\n};\n\nexport type LoadSettingsOptions = {\n readonly agentDir: string;\n readonly bundledSchema: BundledSchemaSource;\n readonly project?: ProjectSettingsLocation;\n};\n\n/**\n * Result of resolving defaults, global settings, and an optional trusted-project override.\n *\n * File and validation failures are represented in {@link SettingsDiagnostic}; a failed layer is\n * ignored and resolution continues from the last valid value.\n *\n * @template Schema The definition's TypeBox schema.\n */\nexport type LoadedSettings<Schema extends TObject> = {\n /** Fully resolved and TypeBox-decoded settings safe for extension code to consume. */\n readonly settings: StaticDecode<Schema>;\n /** Accepted encoded global layer after removal of editor-only metadata. */\n readonly globalSettingsLayer: JsonObject | undefined;\n /** Accepted encoded trusted-project layer after removal of editor metadata. */\n readonly projectSettingsLayer: JsonObject | undefined;\n /** Non-fatal problems encountered while installing, reading, validating, or decoding settings. */\n readonly diagnostics: readonly SettingsDiagnostic[];\n /** Absolute path of the extension's global settings file. */\n readonly globalConfigPath: string;\n /** Absolute project settings path, even when the project is untrusted; absent without a project. */\n readonly projectConfigPath: string | undefined;\n /** Revision of the exact global settings source read during this load; absent after a read failure. */\n readonly globalRevision: PiSettingsRevision | undefined;\n /**\n * Combined revision of the global and trusted-project sources read during this load.\n *\n * Absent when no project was supplied, the project is untrusted, or either source could not be\n * read. A missing settings file still has a revision and is distinct from an unreadable file.\n */\n readonly projectRevision: PiSettingsRevision | undefined;\n /** Whether a valid global layer contributed to {@link LoadedSettings.settings}. */\n readonly usedGlobalConfig: boolean;\n /** Whether a valid trusted-project layer contributed to {@link LoadedSettings.settings}. */\n readonly usedProjectConfig: boolean;\n /** Whether this load created the global settings file from schema defaults. */\n readonly scaffoldedGlobalConfig: boolean;\n /**\n * Result of installing the bundled editor schema in Pi's global settings directory.\n *\n * `created` and `updated` indicate a write, `unchanged` means the installed file already\n * matched, and `unavailable` means the bundled schema could not be verified or installed.\n */\n readonly schemaStatus: \"created\" | \"unavailable\" | \"unchanged\" | \"updated\";\n};\n\nexport type { SettingsDiagnostic, SettingsDiagnosticCode };\n\nfunction bundledSchemaContent(source: BundledSchemaSource): string | undefined {\n if (source.kind === \"content\") return source.content;\n\n try {\n return readFileSync(source.url, \"utf8\");\n } catch {\n return undefined;\n }\n}\n\ntype LayerSource =\n | { readonly status: \"available\"; readonly content: string | undefined }\n | { readonly status: \"unavailable\" };\n\ntype ReadSettingsLayer = ParsedSettingsLayer & { readonly source: LayerSource };\n\nfunction readLayer(path: string, scope: SettingsScope, layerSchema: TSchema): ReadSettingsLayer {\n try {\n const content = readTextIfPresent(path);\n const parsed =\n content === undefined\n ? { settings: undefined, schemaReference: undefined, diagnostics: [] }\n : parseSettingsLayer(path, scope, content, layerSchema);\n return { ...parsed, source: { status: \"available\", content } };\n } catch {\n return {\n settings: undefined,\n diagnostics: [\n {\n code: \"config-read-failed\",\n severity: \"error\",\n scope,\n path,\n message: `${scope} settings could not be read and were ignored`,\n },\n ],\n schemaReference: undefined,\n source: { status: \"unavailable\" },\n };\n }\n}\n\nexport function loadSettings<const Schema extends TObject>(\n definition: ExtensionSettingsDefinition<Schema>,\n options: LoadSettingsOptions,\n): LoadedSettings<Schema> {\n const diagnostics: SettingsDiagnostic[] = [];\n const globalPaths = resolveGlobalSettingsPaths(options.agentDir, definition.id);\n const projectPaths =\n options.project === undefined\n ? undefined\n : resolveProjectSettingsPaths(\n options.project.cwd,\n options.project.configDirName,\n definition.id,\n );\n\n const layerSchema = createSettingsFileSchema(definition);\n const expectedSchema = formatJson(layerSchema);\n const sourceSchema = bundledSchemaContent(options.bundledSchema);\n\n let schemaStatus: LoadedSettings<Schema>[\"schemaStatus\"] = \"unavailable\";\n let scaffoldedGlobalConfig = false;\n if (sourceSchema === undefined) {\n diagnostics.push({\n code: \"bundled-schema-read-failed\",\n severity: \"error\",\n scope: \"schema\",\n path: globalPaths.schemaPath,\n message: \"The bundled settings schema could not be read\",\n });\n } else if (sourceSchema !== expectedSchema) {\n diagnostics.push({\n code: \"bundled-schema-stale\",\n severity: \"error\",\n scope: \"schema\",\n path: globalPaths.schemaPath,\n message: \"The bundled settings schema is stale; run the artifact generator\",\n });\n } else {\n try {\n schemaStatus = writeTextAtomically(globalPaths.schemaPath, sourceSchema);\n } catch {\n diagnostics.push({\n code: \"schema-install-failed\",\n severity: \"error\",\n scope: \"schema\",\n path: globalPaths.schemaPath,\n message: \"The local editor schema could not be installed\",\n });\n }\n\n if (schemaStatus !== \"unavailable\") {\n try {\n scaffoldedGlobalConfig =\n writeTextIfMissing(globalPaths.configPath, () =>\n formatJson(createDefaultSettingsDocument(definition)),\n ) === \"created\";\n } catch {\n diagnostics.push({\n code: \"config-scaffold-failed\",\n severity: \"error\",\n scope: \"global\",\n path: globalPaths.configPath,\n message: \"The default global settings file could not be scaffolded\",\n });\n }\n }\n }\n\n const globalLayer = readLayer(globalPaths.configPath, \"global\", layerSchema);\n diagnostics.push(...globalLayer.diagnostics);\n const globalApplied = applySettingsLayer(\n definition.schema,\n definition.defaultSettings,\n globalLayer,\n globalPaths.configPath,\n \"global\",\n );\n if (globalApplied.diagnostic !== undefined) diagnostics.push(globalApplied.diagnostic);\n\n let resolved = globalApplied.settings;\n let projectSettingsLayer: JsonObject | undefined;\n let usedProjectConfig = false;\n let projectRevision: PiSettingsRevision | undefined;\n if (projectPaths !== undefined && options.project?.trusted === true) {\n const projectLayer = readLayer(projectPaths.configPath, \"project\", layerSchema);\n diagnostics.push(...projectLayer.diagnostics);\n const projectApplied = applySettingsLayer(\n definition.schema,\n resolved,\n projectLayer,\n projectPaths.configPath,\n \"project\",\n );\n if (projectApplied.diagnostic !== undefined) diagnostics.push(projectApplied.diagnostic);\n if (projectLayer.settings !== undefined && projectApplied.diagnostic === undefined) {\n resolved = projectApplied.settings;\n projectSettingsLayer = projectLayer.settings;\n usedProjectConfig = true;\n }\n if (\n globalLayer.source.status === \"available\" &&\n projectLayer.source.status === \"available\"\n ) {\n projectRevision = createSettingsRevision(\n globalLayer.source.content,\n projectLayer.source.content,\n );\n }\n }\n\n return {\n settings: Value.Decode(Value.Clone(definition.schema), resolved),\n globalSettingsLayer:\n globalApplied.diagnostic === undefined ? globalLayer.settings : undefined,\n projectSettingsLayer,\n diagnostics,\n globalConfigPath: globalPaths.configPath,\n projectConfigPath: projectPaths?.configPath,\n globalRevision:\n globalLayer.source.status === \"available\"\n ? createSettingsRevision(globalLayer.source.content)\n : undefined,\n projectRevision,\n usedGlobalConfig:\n globalLayer.settings !== undefined && globalApplied.diagnostic === undefined,\n usedProjectConfig,\n scaffoldedGlobalConfig,\n schemaStatus,\n };\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import { type JsonObject } from "./json-value.ts";
2
+ export declare function settingsLayerFromFile(file: JsonObject): JsonObject;
3
+ /** Deep-merge settings objects. Objects merge recursively; arrays and scalars replace. */
4
+ export declare function mergeSettings(current: JsonObject, next: JsonObject): JsonObject;
5
+ //# sourceMappingURL=settings-merge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings-merge.d.ts","sourceRoot":"","sources":["../src/settings-merge.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,UAAU,EAAkB,MAAM,iBAAiB,CAAC;AAa3F,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,CAOlE;AAED,0FAA0F;AAC1F,wBAAgB,aAAa,CAAC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,GAAG,UAAU,CAM/E"}
@@ -0,0 +1,30 @@
1
+ import { cloneJson, isJsonObject } from "./json-value.js";
2
+ function mergeValue(current, next) {
3
+ if (!isJsonObject(current) || !isJsonObject(next))
4
+ return cloneJson(next);
5
+ const merged = {};
6
+ for (const [key, value] of Object.entries(current))
7
+ merged[key] = cloneJson(value);
8
+ for (const [key, value] of Object.entries(next)) {
9
+ merged[key] = mergeValue(merged[key], value);
10
+ }
11
+ return merged;
12
+ }
13
+ export function settingsLayerFromFile(file) {
14
+ const settings = {};
15
+ for (const [key, value] of Object.entries(file)) {
16
+ if (key === "$schema")
17
+ continue;
18
+ settings[key] = cloneJson(value);
19
+ }
20
+ return settings;
21
+ }
22
+ /** Deep-merge settings objects. Objects merge recursively; arrays and scalars replace. */
23
+ export function mergeSettings(current, next) {
24
+ const merged = mergeValue(current, next);
25
+ if (!isJsonObject(merged)) {
26
+ throw new TypeError("Settings merge unexpectedly produced a non-object value.");
27
+ }
28
+ return merged;
29
+ }
30
+ //# sourceMappingURL=settings-merge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings-merge.js","sourceRoot":"","sources":["../src/settings-merge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAmC,MAAM,iBAAiB,CAAC;AAE3F,SAAS,UAAU,CAAC,OAA8B,EAAE,IAAe;IAC/D,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;QAAE,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;IAE1E,MAAM,MAAM,GAA8B,EAAE,CAAC;IAC7C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;QAAE,MAAM,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;IACnF,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9C,MAAM,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;IACjD,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,IAAgB;IAClD,MAAM,QAAQ,GAA8B,EAAE,CAAC;IAC/C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9C,IAAI,GAAG,KAAK,SAAS;YAAE,SAAS;QAChC,QAAQ,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,QAAQ,CAAC;AACpB,CAAC;AAED,0FAA0F;AAC1F,MAAM,UAAU,aAAa,CAAC,OAAmB,EAAE,IAAgB;IAC/D,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACzC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,SAAS,CAAC,0DAA0D,CAAC,CAAC;IACpF,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC","sourcesContent":["import { cloneJson, isJsonObject, type JsonObject, type JsonValue } from \"./json-value.ts\";\n\nfunction mergeValue(current: JsonValue | undefined, next: JsonValue): JsonValue {\n if (!isJsonObject(current) || !isJsonObject(next)) return cloneJson(next);\n\n const merged: Record<string, JsonValue> = {};\n for (const [key, value] of Object.entries(current)) merged[key] = cloneJson(value);\n for (const [key, value] of Object.entries(next)) {\n merged[key] = mergeValue(merged[key], value);\n }\n return merged;\n}\n\nexport function settingsLayerFromFile(file: JsonObject): JsonObject {\n const settings: Record<string, JsonValue> = {};\n for (const [key, value] of Object.entries(file)) {\n if (key === \"$schema\") continue;\n settings[key] = cloneJson(value);\n }\n return settings;\n}\n\n/** Deep-merge settings objects. Objects merge recursively; arrays and scalars replace. */\nexport function mergeSettings(current: JsonObject, next: JsonObject): JsonObject {\n const merged = mergeValue(current, next);\n if (!isJsonObject(merged)) {\n throw new TypeError(\"Settings merge unexpectedly produced a non-object value.\");\n }\n return merged;\n}\n"]}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Opaque revision token for the exact settings sources observed during loading or an update.
3
+ *
4
+ * Revisions contain no settings values. Callers should only retain and pass them back through
5
+ * `expectedRevision`; their string representation is not a stable persistence format.
6
+ */
7
+ export type PiSettingsRevision = `sha256:${string}`;
8
+ /** Hash length-prefixed sources so missing files and arbitrary contents cannot be ambiguous. */
9
+ export declare function createSettingsRevision(...sources: readonly (string | undefined)[]): PiSettingsRevision;
10
+ //# sourceMappingURL=settings-revision.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings-revision.d.ts","sourceRoot":"","sources":["../src/settings-revision.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG,UAAU,MAAM,EAAE,CAAC;AAEpD,gGAAgG;AAChG,wBAAgB,sBAAsB,CAClC,GAAG,OAAO,EAAE,SAAS,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,GAC5C,kBAAkB,CAYpB"}
@@ -0,0 +1,16 @@
1
+ import { createHash } from "node:crypto";
2
+ /** Hash length-prefixed sources so missing files and arbitrary contents cannot be ambiguous. */
3
+ export function createSettingsRevision(...sources) {
4
+ const hash = createHash("sha256");
5
+ for (const source of sources) {
6
+ if (source === undefined) {
7
+ hash.update("missing\0");
8
+ continue;
9
+ }
10
+ const content = Buffer.from(source, "utf8");
11
+ hash.update(`present:${content.byteLength}\0`);
12
+ hash.update(content);
13
+ }
14
+ return `sha256:${hash.digest("hex")}`;
15
+ }
16
+ //# sourceMappingURL=settings-revision.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings-revision.js","sourceRoot":"","sources":["../src/settings-revision.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAUzC,gGAAgG;AAChG,MAAM,UAAU,sBAAsB,CAClC,GAAG,OAAwC;IAE3C,MAAM,IAAI,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;IAClC,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC3B,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACvB,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;YACzB,SAAS;QACb,CAAC;QACD,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC5C,IAAI,CAAC,MAAM,CAAC,WAAW,OAAO,CAAC,UAAU,IAAI,CAAC,CAAC;QAC/C,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;IACD,OAAO,UAAU,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;AAC1C,CAAC","sourcesContent":["import { createHash } from \"node:crypto\";\n\n/**\n * Opaque revision token for the exact settings sources observed during loading or an update.\n *\n * Revisions contain no settings values. Callers should only retain and pass them back through\n * `expectedRevision`; their string representation is not a stable persistence format.\n */\nexport type PiSettingsRevision = `sha256:${string}`;\n\n/** Hash length-prefixed sources so missing files and arbitrary contents cannot be ambiguous. */\nexport function createSettingsRevision(\n ...sources: readonly (string | undefined)[]\n): PiSettingsRevision {\n const hash = createHash(\"sha256\");\n for (const source of sources) {\n if (source === undefined) {\n hash.update(\"missing\\0\");\n continue;\n }\n const content = Buffer.from(source, \"utf8\");\n hash.update(`present:${content.byteLength}\\0`);\n hash.update(content);\n }\n return `sha256:${hash.digest(\"hex\")}`;\n}\n"]}
@@ -0,0 +1,54 @@
1
+ import type { TObject } from "typebox";
2
+ import type { ExtensionSettingsDefinition, ExtensionSettingsLayer } from "./definition.ts";
3
+ import type { ExtensionSettingsPaths } from "./paths.ts";
4
+ import { type SettingsDiagnostic, type SettingsValidationIssue } from "./settings-layer.ts";
5
+ import { type PiSettingsRevision } from "./settings-revision.ts";
6
+ export type PiSettingsUpdateScope = "global" | "project";
7
+ export type PiSettingsUpdateIssue = SettingsValidationIssue;
8
+ export type UpdatePiExtensionSettingsOptions<Schema extends TObject> = {
9
+ /** Settings layer to update. Project updates require a trusted project. */
10
+ readonly scope: PiSettingsUpdateScope;
11
+ /** Reject the update if the relevant sources no longer match this loader revision. */
12
+ readonly expectedRevision?: PiSettingsRevision;
13
+ /**
14
+ * Produce the next encoded settings layer from the latest valid layer.
15
+ *
16
+ * The callback is invoked once, synchronously, while the settings transaction is locked. It may
17
+ * return a copy or mutate and return the supplied clone. Throwing an `Error` aborts the
18
+ * transaction and rejects `updatePiExtensionSettings` with the same error.
19
+ */
20
+ readonly update: (current: ExtensionSettingsLayer<Schema>) => ExtensionSettingsLayer<Schema>;
21
+ };
22
+ export type UpdatePiExtensionSettingsResult = {
23
+ readonly status: "updated" | "unchanged";
24
+ readonly revision: PiSettingsRevision;
25
+ } | {
26
+ readonly status: "conflict";
27
+ readonly reason: "schema-changed" | "settings-changed";
28
+ readonly message: string;
29
+ } | {
30
+ readonly status: "blocked";
31
+ readonly reason: "project-untrusted";
32
+ readonly message: string;
33
+ } | {
34
+ readonly status: "invalid-existing";
35
+ readonly message: string;
36
+ readonly diagnostics: readonly SettingsDiagnostic[];
37
+ } | {
38
+ readonly status: "invalid-update";
39
+ readonly message: string;
40
+ readonly issues: readonly PiSettingsUpdateIssue[];
41
+ } | {
42
+ readonly status: "failed";
43
+ readonly message: string;
44
+ };
45
+ export type SettingsTransactionPaths = {
46
+ readonly global: ExtensionSettingsPaths;
47
+ readonly project: ExtensionSettingsPaths;
48
+ };
49
+ export type SettingsTransactionOptions<Schema extends TObject> = UpdatePiExtensionSettingsOptions<Schema> & {
50
+ readonly paths: SettingsTransactionPaths;
51
+ readonly projectTrusted: boolean;
52
+ };
53
+ export declare function updateSettingsTransaction<Schema extends TObject>(definition: ExtensionSettingsDefinition<Schema>, options: SettingsTransactionOptions<Schema>): Promise<UpdatePiExtensionSettingsResult>;
54
+ //# sourceMappingURL=settings-transaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings-transaction.d.ts","sourceRoot":"","sources":["../src/settings-transaction.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAW,MAAM,SAAS,CAAC;AAEhD,OAAO,KAAK,EAAE,2BAA2B,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAU3F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEzD,OAAO,EAIH,KAAK,kBAAkB,EAEvB,KAA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